Bug 232039 - Class in same Package not valid type
Class in same Package not valid type
Status: NEW
Product: java
Classification: Unclassified
Component: Compiler
7.3
PC Windows XP
: P3 with 1 vote (vote)
: TBD
Assigned To: Dusan Balek
issues@java
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-30 05:52 UTC by bht
Modified: 2013-09-02 14:21 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments
Test case in zip file (9.78 KB, application/zip)
2013-06-30 05:52 UTC, bht
Details
Screen shot of hint (5.10 KB, image/gif)
2013-06-30 05:54 UTC, bht
Details
package stmt commented out (20.42 KB, image/gif)
2013-06-30 06:50 UTC, bht
Details
Projects window - no error (4.83 KB, image/gif)
2013-06-30 06:51 UTC, bht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bht 2013-06-30 05:52:07 UTC
Created attachment 136507 [details]
Test case in zip file

Product Version: NetBeans IDE 7.3 (Build 201306052037)
Java: 1.7.0_25; Java HotSpot(TM) Client VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b17
System: Windows XP version 5.1 running on x86; Cp1252; en_NZ (nb)


In the attached Maven project, a missing import in a Java class cannot be fixed
via the hint. The hint shows the message that results from the missing import in a way:

The type of get(int) is erroneous
where E is a type-variable:
E extends Object declared in interface List
---
(Alt+Enter shows hints)

and when pressing Alt+Enter:

"Split into declaration and assignment"
Comment 1 bht 2013-06-30 05:54:28 UTC
Created attachment 136508 [details]
Screen shot of hint
Comment 2 bht 2013-06-30 06:50:04 UTC
The package statement in Gee1Leg.java is commented out (can't remember that I did that). However, in my current installation in the projects window, the file is not marked erroneous.
Comment 3 bht 2013-06-30 06:50:46 UTC
Created attachment 136511 [details]
package stmt commented out
Comment 4 bht 2013-06-30 06:51:19 UTC
Created attachment 136512 [details]
Projects window - no error
Comment 5 Jan Lahoda 2013-07-19 08:02:11 UTC
For the record: the only bug here is that a compile-time error is not reported in a specific case. The easiest way to reproduce is this:
----Test.java
package test;
public Test {
    java.util.List<A> l;
}
----A.java
----

(Note that it is not a compile time error not to have the Java source files in the correct package structure.)


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo