Skip to content

[MCOMPILER-158] Symbol name should be displayed during compiler error using Java 7 #865

@jira-importer

Description

@jira-importer

Raghuram opened MCOMPILER-158 and commented

Got to install Java 7. Tried it out on some of our source code which uses maven. Worked fine till there was a compilation error.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project my-app: Compilation failure
[ERROR] \work\my-app\src\main\java\com\mycompany\app\App.java:[11,45] error: cannot find symbol
[ERROR] -> [Help 1]

I am ok with the error, but which symbol does it fail to find? Tried the same thing with Java 6.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project my-app: Compilation failure
[ERROR] \work\my-app\src\main\java\com\mycompany\app\App.java:[11,45] cannot find symbol
[ERROR] symbol  : variable Dummy
[ERROR] location: class com.mycompany.app.App
[ERROR] -> [Help 1]

I can clearly see which variable is not found. So what has changed?

Tried javac on the class. Output with java 7.

javac App.java
App.java:11: error: cannot find symbol
        System.out.println( "Hello World!" + Dummy);
                                             ^
  symbol:   variable Dummy
  location: class App
  1 error

Output with java 6.

javac App.java
    App.java:11: cannot find symbol
    symbol  : variable Dummy
    location: class com.mycompany.app.App
            System.out.println( "Hello World!" + Dummy);
                                                 ^
    1 error

We can see a couple of differences with Java 7 compiler compared to Java 6.

  • Location does not show complete package, just the class
  • Symbol and location now come after the line which has the error, instead of before.
  • An additional "error" word comes before the error message

Essentially there is a change in compiler output in case of errors, which I guess needs a corresponding maven compiler change.


Affects: 2.3.2

10 votes, 6 watchers

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions