Bug 232039 - Class in same Package not valid type
Class in same Package not valid type
Product: java
Classification: Unclassified
Component: Compiler
PC Windows XP
: P3 with 1 vote (vote)
Assigned To: Dusan Balek
Depends on:
  Show dependency treegraph
Reported: 2013-06-30 05:52 UTC by bht
Modified: 2015-09-17 11:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT

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

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:
package test;
public Test {
    java.util.List<A> l;

(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.

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