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 235620

Summary: AssertionError: isSameType UNKNOWN
Product: java Reporter: theshadow27 <theshadow27>
Component: EditorAssignee: Dusan Balek <dbalek>
Status: RESOLVED FIXED    
Severity: normal CC: jbosboom, jiriprox, theshadow27
Priority: P3    
Version: 7.4   
Hardware: All   
OS: All   
See Also: https://netbeans.org/bugzilla/show_bug.cgi?id=236155
https://netbeans.org/bugzilla/show_bug.cgi?id=236152
Issue Type: DEFECT Exception Reporter: 203651
Attachments: stacktrace
stacktrace
full stacktrace (both exceptions
testcase
testcase: Issue235620.java
stacktrace
stacktrace

Description theshadow27 2013-09-06 18:37:59 UTC
This bug was originally marked as duplicate of bug 233939, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE Dev (Build 201309060001)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.25-b01, Java(TM) SE Runtime Environment, 1.7.0_25-b15
OS: Mac OS X

User Comments:
theshadow27: Highlighted some code




Stacktrace: 
java.lang.AssertionError: isSameType UNKNOWN
   at com.sun.tools.javac.code.Types$SameTypeVisitor.visitType(Types.java:1110)
   at com.sun.tools.javac.code.Types$SameTypeVisitor.visitType(Types.java:1082)
   at com.sun.tools.javac.code.Type.accept(Type.java:169)
   at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:4392)
   at com.sun.tools.javac.code.Types$SameTypeVisitor.visitArrayType(Types.java:1161)
   at com.sun.tools.javac.code.Types$SameTypeVisitor.visitArrayType(Types.java:1082)
Comment 1 theshadow27 2013-09-06 18:38:00 UTC
Created attachment 139774 [details]
stacktrace
Comment 2 theshadow27 2013-09-06 18:58:57 UTC
SEVERE [org.openide.util.Exceptions]
java.lang.NullPointerException
Caused: org.netbeans.modules.parsing.spi.ParseException
	at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:211)
	at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:106)
[catch] at org.netbeans.modules.editor.java.JavaCompletionProvider$JavaCompletionQuery.query(JavaCompletionProvider.java:301)
	at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:223)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2042)
WARNING [org.netbeans.modules.findbugs.RunFindBugs]: Cannot find sig file for: com.pericore.util.HeapStreamTest$42
INFO [org.netbeans.api.java.source.ElementHandle]: Resolved type is null for kind = CLASS
INFO [org.netbeans.api.java.source.ElementHandle]: Cannot resolve: ElementHandle[kind=CLASS; sigs=com.pericore.util.HeapStreamTest$42 ]
INFO [org.netbeans.api.java.source.ElementHandle]: Resolved type is null for kind = CLASS
INFO [org.netbeans.api.java.source.ElementHandle]: Cannot resolve: ElementHandle[kind=CLASS; sigs=com.pericore.util.HeapStreamTest$42 ]
Comment 3 theshadow27 2013-09-19 14:41:58 UTC
This was reopened automatically re: id #692509, on dev build 130918, which seems to be very different than the original bug in build 130906. Make sure to check out the exception from 2013-09-19 before closing this - it might be a different issue entirely.
Comment 4 theshadow27 2013-09-19 14:51:10 UTC
Created attachment 140255 [details]
stacktrace

pasted an annonomous class into a @Test method of a nessted junit class. The structure is bascially:

@RunWith(Suite.class)
@SuiteClasses(OuterTest.InnerClass.class)
public class OuterTest{
  static void run(Runnable r) { r.run(); }
  public static class InnerClass{
      @Test
      public void testSomething(){
// ---- Snip ---
           run(new Runnable(){
               @Override
               void run(){
                   assertEquals("a", "b"); 
               }
           });
// ----- /Snip ----
      }
  }
} 

pased Snip into a new @Test method of the InnerClass
Comment 5 theshadow27 2013-09-19 15:00:39 UTC
See also bug 236152, which, after this exception is raised, can be triggered consistently just by clicking in the editor window in the section of pasted code (which has no hints and remains highlighted yellow). Everything seems to go back to normal after the file is saved.
Comment 6 theshadow27 2013-09-20 16:55:05 UTC
Created attachment 140315 [details]
full stacktrace (both exceptions

Full stacktrace of both exceptions
Comment 7 theshadow27 2013-09-24 19:56:20 UTC
Created attachment 140428 [details]
testcase

The attached testcase allows the issue to be reproduced simply and repeatably in the latest dev build (130924). 

 * Steps:
 *
 * 1) in the testSomething() method, highlight the code between the two comments
 * 2) Copy the highlighted code using ctrl+c
 * 3) Place cursor in the testSomethingElse() method between the two comments
 * 4) Paste the copied code using ctrl+v
 * 
 * This will trigger the AssertionError consistently
Comment 8 Jiri Prox 2013-09-24 21:36:49 UTC
reproducible
Comment 9 theshadow27 2013-09-26 13:28:54 UTC
Created attachment 140509 [details]
testcase: Issue235620.java

Updated testcase to actually produce the AssertionError reported in this bug (bug 235620). Previous (obsolete) testcase was duplicating the NullPointerException reported in bug 236155. Also, this testcase can be used to demonstrate bug 236152. 

Steps To Reproduce:

 1) in the testSomething() method, highlight the code between the two comments

 2) Copy the highlighted code using ctrl+c

 3) Place cursor in the testSomethingElse() method between the two comments

 4) Paste the copied code using ctrl+v
  
  This will trigger first the NPE from bug 236155, then the AssertionError from bug 235620 
 
 5) then click inside the pasted method. This will trigger the IllegalArgumentException from bug 236152
Comment 10 Exceptions Reporter 2014-02-08 16:31:23 UTC
Created attachment 144942 [details]
stacktrace

Copy/Paste
Comment 11 Jiri Prox 2014-03-12 12:31:11 UTC
Created attachment 145968 [details]
stacktrace

Copying content of one (about 5 classes) packaged into another
Comment 12 Tomas Zezula 2014-08-19 12:40:49 UTC
Fixed jet-main a7b71995b49f
Comment 13 Quality Engineering 2014-08-21 02:30:04 UTC
Integrated into 'main-silver', will be available in build *201408210001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/a7b71995b49f
User: Tomas Zezula <tzezula@netbeans.org>
Log: #235620:AssertionError: isSameType UNKNOWN