• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Difference Between Java 7 and Java 8 (with respect to Annotations )

 
Ranch Hand
Posts: 105
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

Can anyone Guide me through the Basic Changes or Advancement's that has been done in JAVA 8 from JAVA 7 ,

Especially with respect to Annotations ...

Any Guidance will be Highly Appreciated ...


Thanking You in Advance .
 
Ranch Hand
Posts: 254
1
MySQL Database Java Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you read this https://en.wikipedia.org/wiki/Java_version_history#Java_SE_7_.28July_28.2C_2011.29 and the section below that?
 
Bartender
Posts: 11445
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to a more suitable forum.
From http://en.wikipedia.org/wiki/Java_version_history#Java_SE_8 looks like JSR 308 is annotation related
Check out
http://jcp.org/en/jsr/detail?id=308
http://openjdk.java.net/projects/type-annotations/
 
Rancher
Posts: 43024
76
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All released Java version have substantive documentation of what changed; for example, this is the one for Java 7. But there isn't even a release candidate version of Java 8, so there's not a lot of documentation available yet. You can probably find something somewhere around here, or in what's been published already, like this article (which I found through a quick Google search; it should be easy to find more).
 
Rohit Kumar Singh
Ranch Hand
Posts: 105
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok let me study those...


Thanks everyone for there Responses ...
 
author
Posts: 284
35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java 8 has two enhancements to annotation processing: repeated annotations and type use annotations. Moreover, reflection has been enhanced to report method parameter names. This has the potential to simplify annotations on method parameters.

Repeated annotations are the most interesting part for most people. Right now, to specify a composite key, you have to write:



Ugh. With repeated annotations, you can write



Some future version of JavaEE is very likely to embrace this.

Type use annotations let you put annotations on many more places than before, e.g.



There isn't actually a @NonNull annotation in Java, but there is a 3rd party framework (http://types.cs.washington.edu/checker-framework/) that provides it.

With method parameter reflection, it is possible to, well, get the names of the method parameters through reflection. Instead of



you can write



if your param names are the same as the method parameter names, as they are in 99.44% of all cases.

(This is in JAX-RS.)

Unfortunately, for the necessary information to appear in the classfile, the source must be compiled as javac -parameters SourceFile.java. Let’s hope annotation writers
will enthusiastically embrace this mechanism, so there will be momentum to drop that compiler flag in the future.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic