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

  • Home
  • SEARCH
  • 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 7776387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:52:13+00:00 2026-06-01T17:52:13+00:00

I switched an existing code base to Java 7 and I keep getting this

  • 0

I switched an existing code base to Java 7 and I keep getting this warning:

warning: File for type '[Insert class here]' created in the last round 
  will not be subject to annotation processing.

A quick search reveals that no one has hit this warning.

It’s not documented in the javac compiler source either:

From OpenJDK\langtools\src\share\classes\com\sun\tools\javac\processing\JavacFiler.java

private JavaFileObject createSourceOrClassFile(boolean isSourceFile, String name) throws IOException {
    checkNameAndExistence(name, isSourceFile);
    Location loc = (isSourceFile ? SOURCE_OUTPUT : CLASS_OUTPUT);
    JavaFileObject.Kind kind = (isSourceFile ?
                                JavaFileObject.Kind.SOURCE :
                                JavaFileObject.Kind.CLASS);

    JavaFileObject fileObject =
        fileManager.getJavaFileForOutput(loc, name, kind, null);
    checkFileReopening(fileObject, true);

    if (lastRound) // <-------------------------------TRIGGERS WARNING
        log.warning("proc.file.create.last.round", name);

    if (isSourceFile)
        aggregateGeneratedSourceNames.add(name);
    else
        aggregateGeneratedClassNames.add(name);
    openTypeNames.add(name);

    return new FilerOutputJavaFileObject(name, fileObject);
}

What does this mean and what steps can I take to clear this warning?

Thanks.

  • 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-06-01T17:52:15+00:00Added an answer on June 1, 2026 at 5:52 pm

    In OpenJDK test case this warning produced because processor uses “processingOver()” to write new file exactly at last round.

    public boolean process(Set<? extends TypeElement> elems, RoundEnvironment renv) {
            if (renv.processingOver()) { // Write only at last round
                Filer filer = processingEnv.getFiler();
                Messager messager = processingEnv.getMessager();
                try {
                    JavaFileObject fo = filer.createSourceFile("Gen");
                    Writer out = fo.openWriter();
                    out.write("class Gen { }");
                    out.close();
                    messager.printMessage(Diagnostic.Kind.NOTE, "File 'Gen' created");
                } catch (IOException e) {
                    messager.printMessage(Diagnostic.Kind.ERROR, e.toString());
                }
            }
            return false;
        }
    

    I modified original example code a bit. Added diagnostic note “File ‘Gen’ created”, replaced “*” mask with “org.junit.runner.RunWith” and set return value to “true”. Produced compiler log was:

    Round 1:
    input files: {ProcFileCreateLastRound}
    annotations: [org.junit.runner.RunWith]
    last round: false
    Processor AnnoProc matches [org.junit.runner.RunWith] and returns true.
    Round 2:
    input files: {}
    annotations: []
    last round: true
    Note: File 'Gen' created
    Compilation completed successfully with 1 warning
    0 errors
    1 warning
    Warning: File for type 'Gen' created in the last round will not be subject to annotation processing.
    

    If we remove my custom note from log, it’s hard to tell that file ‘Gen’ was actually created on ‘Round 2’ – last round. So, basic advice applies: if in doubt – add more logs.


    Where is also a little bit of useful info on this page:
    http://docs.oracle.com/javase/7/docs/technotes/tools/solaris/javac.html

    Read section about “ANNOTATION PROCESSING” and try to get more info with compiler options:
    -XprintProcessorInfo
    Print information about which annotations a processor is asked to process.
    -XprintRounds Print information about initial and subsequent annotation processing rounds.

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

Sidebar

Related Questions

I switched lecturers today and he stated using a weird code to me. (He
I recently switched to a new setup that is reporting PHP Notices; my code
I recently switched from a Java based project to a C#/.net project. I previously
When I first switched from Java to C#, I was really impressed with C#'s
We just switched to Glassfish V2. We are now getting errors when setting a
I realise that there are many existing questions regarding this issue, but I haven't
Using SubSonic 3 ActiveRecord, I generated code from an existing database that had foreign
I have an existing WebGL renderer (too much code to be useful to share)
I have an existing website written in ASP.net, I have recently switched to Mac
Is there an existing Linux/POSIX C/C++ library or example code for how to rebind

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.