This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 232039 - Class in same Package not valid type
Summary: Class in same Package not valid type
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Compiler (show other bugs)
Version: 7.3
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-30 05:52 UTC by bht
Modified: 2015-09-17 11:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


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.)
Comment 6 Martin Balin 2015-09-17 11:16:12 UTC
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.