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 174782

Summary: [68cat] Fix imports does not resolve static imports
Product: java Reporter: giorgio42 <giorgio42>
Component: EditorAssignee: Max Sauer <msauer>
Status: RESOLVED DUPLICATE    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Windows Vista   
Issue Type: DEFECT Exception Reporter:

Description giorgio42 2009-10-16 21:50:17 UTC
[ JDK VERSION : 1.6.* ]


I have a J2SE project with Test Packages. junit-4.5.jar is on the
test class path (through appropriately setting the project
properties).

If I write

@Test
public void myTest()
{
  int expectedNumberOfFoos = 4;
  int numberOfFoos = returnSomething();
  assertEquals( "Wrong number of Foos", expectedNumberOfFoos,
numberOfFoos );
}

and then press Ctrl+Shift+I NetBeans is not able to resolve the
assertEquals() method and does nothing instead of adding

import static org.junit.Assert.assertEquals;

Moreover, when I manually add the import statement and the cursor is
at the pipe character in the snippet here,

import static org.junit.Assert.|

NB shows all overloads of all static methods in Assert as if I would
be writing code in a method body. NB should only show the names of
the static methods, no overloads and no parameters.
Comment 1 giorgio42 2009-10-16 21:52:03 UTC
I could confirm this behavior with M2 and a version compiled from todays main-golden repository.

Comment 2 Jiri Prox 2009-10-19 11:19:53 UTC

*** This issue has been marked as a duplicate of 89258 ***