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 255429 - "Unknown type" for for-loop variables
Summary: "Unknown type" for for-loop variables
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2015-09-20 11:32 UTC by _ gtzabari
Modified: 2015-09-24 01:29 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2015-09-20 11:32:58 UTC
Product Version: NetBeans IDE Dev (Build 201509180002)
Java: 1.8.0_51; Java HotSpot(TM) 64-Bit Server VM 25.51-b03
Runtime: Java(TM) SE Runtime Environment 1.8.0_51-b16
System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb)
User directory: C:\Users\Gili\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\dev

It looks like a regression was introduced in the past 3 weeks.

Given:

		for (Worker child: worker.getChildren())
			startYear(child, listener);

if I set a breakpoint on the "startYear" line and hover the mouse over "child" I get: Unknown type "child"

I get a similar error when adding "child" to the Variables tab.
Comment 1 _ gtzabari 2015-09-20 11:33:59 UTC
More information: I can evaluate "worker" just fine, even though "child" and "worker" are both of type "Worker".
Comment 2 Martin Entlicher 2015-09-21 16:20:02 UTC
Reproduced.
It's strange, when you add parenthesis like:
    for (Worker child: worker.getChildren()) {
        startYear(child, listener);
    }
then "child" is resolved correctly.
Comment 3 Martin Entlicher 2015-09-21 16:46:57 UTC
In 8.1 beta "child" is evaluated even without parenthesis. => it is a regression.
Comment 4 Martin Entlicher 2015-09-22 14:00:37 UTC
The primary cause of this bug is issue #255486. It was revealed by fix of issue #254934.

The fix of issue #  was changed not to be sensitive to error elements:
changeset:   292396:57c29cf25c7f
http://hg.netbeans.org/core-main/rev/57c29cf25c7f
Comment 5 Quality Engineering 2015-09-24 01:29:07 UTC
Integrated into 'main-silver', will be available in build *201509240002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/57c29cf25c7f
User: mentlicher@netbeans.org
Log: #255429: Change the fix of issue #254934 not to be sensitive for error elements.