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 163145 - Bad import fix if unused static exists
Summary: Bad import fix if unused static exists
Status: CLOSED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Max Sauer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-20 18:31 UTC by fommil
Modified: 2009-05-05 22:35 UTC (History)
1 user (show)

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 fommil 2009-04-20 18:31:26 UTC
Insert a static import into the header, but don't call that method. Call "Fix All Imports"... the static import is removed but the static keyword is transferred onto 
another import resulting in illegal code.
Comment 1 Max Sauer 2009-04-21 09:35:39 UTC
Hi Sam, could you please provide sample source and your build number? I cannot reproduce this issue with:

package javaapplication9;

import java.util.List;
import static ss.NewClass.getSS;
import java.util.Set;

public class Main {
    Set s;
    List l;
}

----
Product Version: NetBeans IDE Dev (Build 090414)
Java: 1.5.0_16; Java HotSpot(TM) Client VM 1.5.0_16-133
System: Mac OS X version 10.5.6 running on i386; MacRoman; en_US (nb)

Comment 2 fommil 2009-04-22 13:52:29 UTC
I'd like to NetFIX [1] this bug. Is it possible? [1] http://wiki.netbeans.org/NetFIX
Comment 3 Max Sauer 2009-04-22 14:30:26 UTC
Yes, you can -- and you're welcome. But first mention a reproducible scenario in this issue.
Comment 4 fommil 2009-04-22 21:20:15 UTC
Odd, I've not been able to reproduce... although it happened to me twice today.

Closing for now, but will reopen when I can isolate the offending actions!
Comment 5 Jan Lahoda 2009-05-04 14:27:50 UTC
Having a reproducible test case, this should not be very hard to fix. Most likely a bug in the code generator. Bugs in
code generator are typically fixed as follows:
-add one or more tests into the generator test suite (package org.netbeans.api.java.source.gen in java.source's tests).
In this case, the test(s) should be added into ImportsTest, IMO.
-fix the problem, so that the test passes. In this case, most likely in CasualDiff in java.source.
-run whole codegen test suite by executing "ant -Dtest.config=generator test" inside java.source module. All tests must
pass (this test suite is being run during the jet-main continuous build, so all tests should be passing).
Comment 6 fommil 2009-05-04 14:30:37 UTC
I can't reproduce... happy for you to close.