commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCI-59) Eclipse compiler is unable to compile additional top-level classes
Date Sun, 18 Aug 2013 20:32:48 GMT

    [ https://issues.apache.org/jira/browse/JCI-59?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13743362#comment-13743362
] 

Sebb commented on JCI-59:
-------------------------

I think I've discovered the cause of the problem.

The method INameEnvironment#isPackage(char[][], char[]) in the class EclipseJavaCompiler is
returning true for the entry (jci, AdditionalTopLevel) - however of course it is not a package.

It returns true because the code checks to see whether the it can find either the class file
or the source file.
If it finds neither, it assumes that the item is a package, which of course is not the case
here.

I don't (yet) know how to fix this. Perhaps there is a simple way to keep track of packages?
                
> Eclipse compiler is unable to compile additional top-level classes
> ------------------------------------------------------------------
>
>                 Key: JCI-59
>                 URL: https://issues.apache.org/jira/browse/JCI-59
>             Project: Commons JCI
>          Issue Type: Bug
>          Components: compiler eclipse
>    Affects Versions: 1.1
>            Reporter: Jingkei Ly
>            Assignee: Torsten Curdt
>             Fix For: 1.1
>
>         Attachments: JCI-59-testcase-1.patch
>
>
> When using the Eclipse compiler, I am unable to compile additional top-level classes.
For example,
> {code}
> package jci;
> public class Simple {
>     public String toString() {
>           return "Simple";
>      }
> }
>  class AdditionalTopLevel {
>        public String toString() {
>             return "AdditionalTopLevel";
>        }
> }
> {code}
> Causes the compile -error- warning: The type AdditionalTopLevel collides with a package.
> This works fine with the Javac compiler and the Janino compiler.
>                         

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message