public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/49556] New: The import A cannot be resolved,But the A is placed at the current dir.
@ 2011-06-28  4:51 licheng.1212 at gmail dot com
  2011-06-28  6:09 ` [Bug java/49556] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: licheng.1212 at gmail dot com @ 2011-06-28  4:51 UTC (permalink / raw)
  To: java-prs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49556

           Summary: The import A cannot be resolved,But the A is placed at
                    the current dir.
           Product: gcc
           Version: 4.4.2
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: java
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: licheng.1212@gmail.com


there is a test case:

[lee@localhost test]$ pwd
/home/lee/project/test
[lee@localhost test]$ ls
A.java  Main.java
[lee@localhost test]$ cat A.java 
public final class A {
    public void a()
    {
        System.out.println("A print");
    }
}
[lee@localhost test]$ cat Main.java 
import A;
class Main{
    public static void main(String args[])
    {
        A a=new A();
        a.a();
    }
}
[lee@localhost test]$ gcj --classpath=./ -c Main.java 
Main.java:1: error: The import A cannot be resolved
    import A;
           ^
1 problem (1 error)
[lee@localhost test]$ 

But when I change the A to a package,then it's OK

[lee@localhost test]$ tree
.
|-- Main.java
`-- pakfile
    `-- A.java

1 directory, 2 files
[lee@localhost test]$ cat pakfile/A.java 
package pakfile;
public final class A {
    public void a()
    {
        System.out.println("A print");
    }
}
[lee@localhost test]$ cat Main.java 
import pakfile.A;
class Main{
    public static void main(String args[])
    {
        A a=new A();
        a.a();
    }
}
[lee@localhost test]$ gcj --classpath=./ -c Main.java 
[lee@localhost test]$


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug java/49556] The import A cannot be resolved,But the A is placed at the current dir.
  2011-06-28  4:51 [Bug java/49556] New: The import A cannot be resolved,But the A is placed at the current dir licheng.1212 at gmail dot com
@ 2011-06-28  6:09 ` pinskia at gcc dot gnu.org
  2011-06-28 16:25 ` licheng.1212 at gmail dot com
  2011-08-23 12:18 ` licheng.1212 at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-06-28  6:09 UTC (permalink / raw)
  To: java-prs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49556

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|blocker                     |normal

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-06-28 06:09:20 UTC ---
I think this is correct as classes in the same packages don't cannot be
imported.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug java/49556] The import A cannot be resolved,But the A is placed at the current dir.
  2011-06-28  4:51 [Bug java/49556] New: The import A cannot be resolved,But the A is placed at the current dir licheng.1212 at gmail dot com
  2011-06-28  6:09 ` [Bug java/49556] " pinskia at gcc dot gnu.org
@ 2011-06-28 16:25 ` licheng.1212 at gmail dot com
  2011-08-23 12:18 ` licheng.1212 at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: licheng.1212 at gmail dot com @ 2011-06-28 16:25 UTC (permalink / raw)
  To: java-prs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49556

--- Comment #2 from licheng.1212 at gmail dot com <licheng.1212 at gmail dot com> 2011-06-28 16:25:21 UTC ---
(In reply to comment #1)
> I think this is correct as classes in the same packages don't cannot be
> imported.

yes,you are right!Please close this bug


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug java/49556] The import A cannot be resolved,But the A is placed at the current dir.
  2011-06-28  4:51 [Bug java/49556] New: The import A cannot be resolved,But the A is placed at the current dir licheng.1212 at gmail dot com
  2011-06-28  6:09 ` [Bug java/49556] " pinskia at gcc dot gnu.org
  2011-06-28 16:25 ` licheng.1212 at gmail dot com
@ 2011-08-23 12:18 ` licheng.1212 at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: licheng.1212 at gmail dot com @ 2011-08-23 12:18 UTC (permalink / raw)
  To: java-prs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49556

licheng.1212@gmail.com <licheng.1212 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #3 from licheng.1212 at gmail dot com <licheng.1212 at gmail dot com> 2011-08-23 12:18:12 UTC ---
same as the javac


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-08-23 12:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-28  4:51 [Bug java/49556] New: The import A cannot be resolved,But the A is placed at the current dir licheng.1212 at gmail dot com
2011-06-28  6:09 ` [Bug java/49556] " pinskia at gcc dot gnu.org
2011-06-28 16:25 ` licheng.1212 at gmail dot com
2011-08-23 12:18 ` licheng.1212 at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).