You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Akhilesh Singh (Jira)" <ji...@apache.org> on 2022/02/04 09:46:00 UTC
[jira] [Resolved] (NETBEANS-2094) AssertionError while typing before an annotation in anonymous inner class
[ https://issues.apache.org/jira/browse/NETBEANS-2094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Akhilesh Singh resolved NETBEANS-2094.
--------------------------------------
Fix Version/s: NB13
Resolution: Information Provided
> AssertionError while typing before an annotation in anonymous inner class
> -------------------------------------------------------------------------
>
> Key: NETBEANS-2094
> URL: https://issues.apache.org/jira/browse/NETBEANS-2094
> Project: NetBeans
> Issue Type: Bug
> Components: java - Source
> Affects Versions: 10.0
> Reporter: Austin Stephens
> Assignee: Akhilesh Singh
> Priority: Critical
> Fix For: NB13
>
>
> Paste the following into a code file:
> {code:java}
> public static InputStream foo(InputStream from){
> return new InputStream() {
> MemoryStream ms = new MemoryStream();
> GZIPOutputStream compress = new GZIPOutputStream(ms.getOutputStream());
>
> @Override
> public int read() throws IOException {
> throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
> }
> }
> }
> {code}
> and try to type "byte[] buffer" above the Override Annotation. An assertion error will be thrown with the stack trace of:
> {noformat}
> Assert.error:155
> Assert.checkNonNull:62
> Annotate.fromAnnotations:167
> Annotate.lambda$annotateTypeSecondStage$5:1031
> 861978341.run
> Annotate.flush:194
> Annotate.unblockAnnotations:144
> TypeEnter.complete:229
> Symbol.complete:645
> Symbol$ClassSymbol.complete:1352
> Attr.visitClassDef:982
> NBAttr.visitClassDef:61
> JCTree$JCClassDecl.accept:778
> Attr.attribTree:673
> Attr.attribStat:749
> Attr.visitAnonymousClassDefinition:2508
> Attr.visitNewClass:2391
> JCTree$JCNewClass.accept:1695
> Attr.attribTree:673
> Attr.visitReturn:1931
> JCTree$JCReturn.accept:1552
> Attr.attribTree:673
> Attr.attribStat:749
> Attr.attribStats:773
> Attr.visitBlock:1350
> NBAttr.visitBlock:73
> JCTree$JCBlock.accept:1026
> Attr.attribTree:673
> Attr.attribStat:749
> JavacParser.parseImpl:399
> JavacParser.parse:332
> TaskProcessor.callParse:598
> SourceCache.getResult:228
> ResultIterator.getParserResult:115
> ResultIterator.getParserResult:129
> TaskProcessor.callUserTask:586
> ParserManager$UserTaskAction.run:130
> ParserManager$UserTaskAction.run:114
> TaskProcessor$2.call:181
> TaskProcessor$2.call:178
> FileChangedManager.priorityIO:153
> ProvidedExtensions.priorityIO:335
> DataObjectEnvFactory.runPriorityIO:118
> Utilities.runPriorityIO:67
> TaskProcessor.runUserTask:178
> ParserManager.parse:81
> JPACodeCompletionProvider$JPACodeCompletionQuery.query:118
> AsyncCompletionTask.run:198
> RequestProcessor$Task.run:1418
> GlobalLookup.execute:45
> Lookups.executeWith:278
> RequestProcessor$Processor.run:2033 {noformat}
> It will also explode with a NullPointer if you try to add a variable before "MemoryStream" (e.g. "byte[] buffer =")
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists