Skip to content

Conversation

sosguthorpe
Copy link

Add details of method causing errors during AOP introduction.

@graemerocher
Copy link
Contributor

needs a test

@dstepanov
Copy link
Contributor

This needs a different solution, usually javac will pinpoint to the class that caused the issue, but of the class is not part of the compiled classes that is hard to understand where is the problem

@sosguthorpe
Copy link
Author

sosguthorpe commented Aug 21, 2025

OK. But it didn't print the class and we were left with an error message that mentioned a private unnamed method, and this was javac. I'm not sure what you mean by part of the compiled classes. It was a bean-class in the codebase, that extended another, in a different package, where the parent had an annotated package private method. I don't understand why that wouldn't be part of the classes to compile? Given the processor was visiting the class in the first place it has to be no?

Incidentally the Eclipse JDT compiler worked fine. Presumably because visitor processed the method in the same package as the declaring class and not the owning class, although I am just guessing.

Happy for this pr to be closed as won't do. But the fact still remains I had to pull down core, alter it and build it to get simple sign-pointing to which class was causing the breakage.

@dstepanov
Copy link
Contributor

Can you pls create a sample project with a problem?

@sosguthorpe
Copy link
Author

Yes, of course, no problem:
https://github.com/sosguthorpe/javac-error-replicator

./gradlew clean assemble

> Task :compileJava FAILED
error: Method annotated as executable but is declared private. To invoke the method using reflection annotate it with @ReflectiveAccess
1 error

@sosguthorpe
Copy link
Author

I'd be happy to help with a different solution. Perhaps if there is no "location" then the ProcessingException could be printed differently? It gets the Element that caused the error so that should be possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants