Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
None
-
None
-
None
-
OpenJDK Runtime Environment 14-ea+27-1339
Description
'records' not executing from the same/single source files. Compilation is fine but while running getting error "Unknown element: "i1". Writing record in seperate class work fairly.
Writing below code in the java editor throws IllegalArgumentException.
public class JDK14Appplication {
public static void main(String[] args)
}
class RECA1{
public record Test2(long i1, int j1) {
}
}
Stack trace :
Exception 1:
javax.lang.model.element.UnknownElementException: Unknown element: "i"javax.lang.model.element.UnknownElementException: Unknown element: "i" at java.compiler@14-ea/javax.lang.model.util.AbstractElementVisitor6.visitUnknown(AbstractElementVisitor6.java:126) at java.compiler@14-ea/javax.lang.model.element.ElementVisitor.visitRecordComponent(ElementVisitor.java:190) at java.compiler@14-ea/javax.lang.model.util.AbstractElementVisitor6.visitRecordComponent(AbstractElementVisitor6.java:164) at jdk.compiler/com.sun.tools.javac.code.Symbol$RecordComponent.accept(Symbol.java:1758) at java.compiler@14-ea/javax.lang.model.util.ElementScanner6.scan(ElementScanner6.java:154) at java.compiler@14-ea/javax.lang.model.util.ElementScanner6.scan(ElementScanner6.java:141) at java.compiler@14-ea/javax.lang.model.util.ElementScanner6.visitType(ElementScanner6.java:194) at org.netbeans.api.java.source.SourceUtils$3$1.visitType(SourceUtils.java:864) at org.netbeans.api.java.source.SourceUtils$3$1.visitType(SourceUtils.java:858) at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.accept(Symbol.java:1522) at java.compiler@14-ea/javax.lang.model.util.ElementScanner6.scan(ElementScanner6.java:154) at java.compiler@14-ea/javax.lang.model.util.ElementScanner6.scan(ElementScanner6.java:141) at org.netbeans.api.java.source.SourceUtils$3.run(SourceUtils.java:870) at org.netbeans.api.java.source.SourceUtils$3.run(SourceUtils.java:853) at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:502) at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:586) at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:130) at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:114) at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:181) at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:178) at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:153) at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:335) at org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:118) at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:67) at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:178) at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:81) at org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:452) at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:423) at org.netbeans.api.java.source.SourceUtils.getMainClasses(SourceUtils.java:853) at org.netbeans.modules.java.api.common.util.CommonProjectUtils.getMainMethods(CommonProjectUtils.java:133) at org.netbeans.modules.java.api.common.project.JavaActionProvider$4.getTargetNames(JavaActionProvider.java:1124) at org.netbeans.modules.java.api.common.project.BaseActionProvider$BrokenAPIActionDecorator.getTargetNames(BaseActionProvider.java:795) at org.netbeans.modules.java.api.common.project.BaseActionProvider.lambda$getTargetNames$2(BaseActionProvider.java:311) at java.base/java.util.Optional.map(Optional.java:258) at org.netbeans.modules.java.api.common.project.BaseActionProvider.getTargetNames(BaseActionProvider.java:297) at org.netbeans.modules.java.j2seproject.J2SEActionProvider.getTargetNames(J2SEActionProvider.java:275) at org.netbeans.modules.java.api.common.project.BaseActionProvider$BrokenAPIActionDecorator.getTargetNames(BaseActionProvider.java:782) at org.netbeans.modules.java.api.common.project.ActionProviderSupport$JavaModelWork.execute(ActionProviderSupport.java:1305) at org.netbeans.modules.java.api.common.project.ActionProviderSupport$JavaModelWork.run(ActionProviderSupport.java:1287) at org.netbeans.modules.java.api.common.project.ActionProviderSupport.lambda$invokeByJavaSource$7(ActionProviderSupport.java:917) at org.netbeans.modules.java.source.parsing.MimeTask.run(MimeTask.java:60) at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:586) at org.netbeans.modules.parsing.api.ParserManager$MimeTaskAction.run(ParserManager.java:357) at org.netbeans.modules.parsing.api.ParserManager$MimeTaskAction.run(ParserManager.java:340) at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:181) at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:178) at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:153) at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:335) at org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:118) at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:67) at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:178) at org.netbeans.modules.parsing.impl.RunWhenScanFinishedSupport.runWhenScanFinished(RunWhenScanFinishedSupport.java:123) at org.netbeans.modules.parsing.api.ParserManager.parseWhenScanFinished(ParserManager.java:334) at org.netbeans.api.java.source.JavaSource.runWhenScanFinished(JavaSource.java:607) at org.netbeans.modules.java.api.common.project.ActionProviderSupport.invokeByJavaSource(ActionProviderSupport.java:916) at org.netbeans.modules.java.api.common.project.ActionProviderSupport.invokeTarget(ActionProviderSupport.java:207) at org.netbeans.modules.java.api.common.project.JavaActionProvider$ScriptAction.invoke(JavaActionProvider.java:465) at org.netbeans.modules.java.api.common.project.JavaActionProvider.lambda$invokeAction$1(JavaActionProvider.java:895) at java.base/java.util.Optional.ifPresent(Optional.java:176) at org.netbeans.modules.java.api.common.project.JavaActionProvider.invokeAction(JavaActionProvider.java:888) at org.netbeans.modules.java.api.common.project.BaseActionProvider.invokeAction(BaseActionProvider.java:225) at org.netbeans.modules.java.j2seproject.J2SEActionProvider.lambda$invokeAction$0(J2SEActionProvider.java:292) at org.netbeans.modules.java.j2seproject.J2SEActionProvider.invokeAction(J2SEActionProvider.java:337) at org.netbeans.spi.project.support.LookupProviderSupport$MergedActionProvider.invokeAction(LookupProviderSupport.java:262) at org.netbeans.modules.project.ui.actions.FileAction$3$1.run(FileAction.java:219) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:316) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715) at java.base/java.security.AccessController.doPrivileged(AccessController.java:391) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740) at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)[catch] at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Exception 2:
javax.lang.model.element.UnknownElementException: Unknown element: "i"javax.lang.model.element.UnknownElementException: Unknown element: "i" at java.compiler@14-ea/javax.lang.model.util.AbstractElementVisitor6.visitUnknown(AbstractElementVisitor6.java:126) at java.compiler@14-ea/javax.lang.model.element.ElementVisitor.visitRecordComponent(ElementVisitor.java:190) at java.compiler@14-ea/javax.lang.model.util.AbstractElementVisitor6.visitRecordComponent(AbstractElementVisitor6.java:164) at jdk.compiler/com.sun.tools.javac.code.Symbol$RecordComponent.accept(Symbol.java:1758) at java.compiler@14-ea/javax.lang.model.util.ElementScanner6.scan(ElementScanner6.java:154) at java.compiler@14-ea/javax.lang.model.util.ElementScanner6.scan(ElementScanner6.java:141) at org.netbeans.modules.java.source.indexing.FQN2Files$1.visitType(FQN2Files.java:79) at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.accept(Symbol.java:1522) at java.compiler@14-ea/javax.lang.model.util.ElementScanner6.scan(ElementScanner6.java:154) at java.compiler@14-ea/javax.lang.model.util.ElementScanner6.scan(ElementScanner6.java:141) at org.netbeans.modules.java.source.indexing.FQN2Files.set(FQN2Files.java:103)[catch] at org.netbeans.modules.java.source.indexing.VanillaCompileWorker.compile(VanillaCompileWorker.java:281) at org.netbeans.modules.java.source.indexing.JavaCustomIndexer.index(JavaCustomIndexer.java:361) at org.netbeans.modules.parsing.spi.indexing.Indexable$MyAccessor$2.run(Indexable.java:138) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.runIndexer(RepositoryUpdater.java:275) at org.netbeans.modules.parsing.spi.indexing.Indexable$MyAccessor.index(Indexable.java:136) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.doIndex(RepositoryUpdater.java:2750) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.access$800(RepositoryUpdater.java:2154) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work$1.run(RepositoryUpdater.java:2636) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work$1.run(RepositoryUpdater.java:2634) at org.netbeans.modules.parsing.impl.indexing.errors.TaskCache.refreshTransaction(TaskCache.java:540) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.index(RepositoryUpdater.java:2634) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work$3.call(RepositoryUpdater.java:3300) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work$3.call(RepositoryUpdater.java:3255) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$4.run(RepositoryUpdater.java:2127) at org.openide.util.lookup.Lookups.executeWith(Lookups.java:279) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.runInContext(RepositoryUpdater.java:2123) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.runInContext(RepositoryUpdater.java:2104) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.access$1500(RepositoryUpdater.java:136) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.scanFiles(RepositoryUpdater.java:3255) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$FileListWork.getDone(RepositoryUpdater.java:3785) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.doTheWork(RepositoryUpdater.java:3420) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task._run(RepositoryUpdater.java:6183) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task.access$4300(RepositoryUpdater.java:5834) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task$2$1.run(RepositoryUpdater.java:6099) at org.openide.util.lookup.Lookups.executeWith(Lookups.java:279) at org.netbeans.modules.parsing.impl.RunWhenScanFinishedSupport.performScan(RunWhenScanFinishedSupport.java:83) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task$2.call(RepositoryUpdater.java:6095) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task$2.call(RepositoryUpdater.java:6091) at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:153) at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:335) at org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:118) at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:67) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task.run(RepositoryUpdater.java:6091) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418) at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45) at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
Attachments
Issue Links
- duplicates
-
NETBEANS-3604 Supports for Records (JEP 359) in JDK-14
- Closed