Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6103955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:47:15+00:00 2026-05-23T13:47:15+00:00

I downloaded JDK source code (6u23 build b5) for research, and Eclipsed decided to

  • 0

I downloaded JDK source code (6u23 build b5) for research, and Eclipsed decided to automatically build it. Astonishingly, it found errors.

A few examples.

java.beans.MetaData, line 1365:

ConstructorProperties annotation = constructor.getAnnotation(ConstructorProperties.class);

Type mismatch: cannot convert from Annotation to ConstructorProperties

java.awt.AWTEvent, line 220:

AWTAccessor.setAWTEventAccessor(new AWTAccessor.AWTEventAccessor() {

The type new AWTAccessor.AWTEventAccessor(){} must implement the inherited abstract method AWTAccessor.AWTEventAccessor.getAccessControlContext(AWTEvent)

I thought this code supposed to be absolutely correct, if not being one of the best examples of Java usage that one can learn from. But that doesn’t even compile!

Update: I exported java package into individual project, removed the java package default import to avoid possible namespace conflicts and used JVM 1.6.0 to build it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:47:15+00:00Added an answer on May 23, 2026 at 1:47 pm

    The problem you have here is that the specification for generics has evolved over time. 😐 The latest version of Sun/Oracle Java compiles this code correctly, however its the IDE which doesn’t realise it now compiles. (Unfortunately Eclipse uses its own compiler and its not always exactly the same as the Sun/Oracle compiler)

    I am pretty sure older versions of the compiler would produce an error for this line of code.

    It used to be that if a type was not a generic, all generics were turned off, even if that didn’t make sense. In the case of this method.

    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) 
    
    // constructor is not a generic type.
    private static String[] getAnnotationValue(Constructor constructor) {
            ConstructorProperties annotation = constructor.getAnnotation(ConstructorProperties.class);
    

    The older compilers would assume this was a non-generic method as the Constructor is not generic. However the newer compiler identifies this method is self contained and it shouldn’t matter whether the class is a generic type of not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for the JDK source code for Java 1.5 update 18 (on win
Assume I am compiling the JDK from source downloaded from Oracle. Now the JDK
I download the Java JDK 6 source code .tar file, and I extracted all
I recently downloaded ndepend and ran an analysis on an open source project I
I recently downloaded the source tarball for a GTK application that I'd like to
I cannot for the life of me attach the java source code to eclipse
I thought this would be very easy. I downloaded the JDK, extracted src.zip, modified
I've written code to automatically download a batch of files using an InputStream and
I have downloaded JDK 6 and also I have sqljdb4.jar and I have database.properties
I downloaded eclipse helios. I have jdk 1.6 installed. I am not getting dynamic

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.