Bug 544640 - NPE in Java Builder
Summary: NPE in Java Builder
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.10   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2019-02-20 12:24 EST by Valery Maltsev CLA
Modified: 2023-02-09 13:08 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Valery Maltsev CLA 2019-02-20 12:24:49 EST
Eclipse fails to build a project and shows a popup "Errors occured during the build". In details field it has only
"Errors occurred during the build.
   Errors running builder 'Java Builder' on project 'bla-bla'.
   java.lang.NullPointerException"
After starting Eclipse with -debug -consoleLog, the console contains the following
================================
!ENTRY org.eclipse.core.resources 4 2 2019-02-20 17:56:16.724
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.jdt.internal.compiler.ast.Expression.computeConversion(Expression.java:682)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.computeConversion(MessageSend.java:457)
	at org.eclipse.jdt.internal.compiler.ast.Assignment.resolveType(Assignment.java:231)
	at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:1034)
	at org.eclipse.jdt.internal.compiler.ast.Statement.resolveCase(Statement.java:429)
	at org.eclipse.jdt.internal.compiler.ast.SwitchStatement.resolve(SwitchStatement.java:529)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:641)
	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:316)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:551)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1229)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1354)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:652)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:892)
	at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:145)
	at java.base/java.lang.Thread.run(Thread.java:834)

!ENTRY org.eclipse.core.resources 4 75 2019-02-20 17:56:16.751
!MESSAGE Errors occurred during the build.
!SUBENTRY 1 org.eclipse.jdt.core 4 75 2019-02-20 17:56:16.752
!MESSAGE Errors running builder 'Java Builder' on project 'bla-bla'.
!STACK 0
java.lang.NullPointerException
	at org.eclipse.jdt.internal.compiler.ast.Expression.computeConversion(Expression.java:682)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.computeConversion(MessageSend.java:457)
	at org.eclipse.jdt.internal.compiler.ast.Assignment.resolveType(Assignment.java:231)
	at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:1034)
	at org.eclipse.jdt.internal.compiler.ast.Statement.resolveCase(Statement.java:429)
	at org.eclipse.jdt.internal.compiler.ast.SwitchStatement.resolve(SwitchStatement.java:529)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:641)
	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:316)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:551)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1229)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1354)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:652)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:892)
	at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:145)
	at java.base/java.lang.Thread.run(Thread.java:834)
================================
Eclipse.buildId=4.10.0.I20181206-0815
openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
Comment 1 Jay Arthanareeswaran CLA 2019-02-20 23:48:07 EST
Do you know the code that causes this?

You can try running Eclipse with tracing enabled for the following options:

org.eclipse.jdt.core/debug=true
org.eclipse.jdt.core/debug/compiler=true

More details on enabling this can be found here:

https://wiki.eclipse.org/FAQ_How_do_I_use_the_platform_debug_tracing_facility
Comment 2 Valery Maltsev CLA 2019-02-21 10:46:17 EST
eclipse.buildId=4.10.0.I20181206-0815
java.version=11.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product -consoleLog -debug /usr/local/share/eclipse/java-2018-12/eclipse/.options

org.eclipse.jdt.core
Error
Thu Feb 21 16:40:33 CET 2019
Exception occurred during problem detection:
----------------------------------- SOURCE BEGIN -------------------------------------
package com.project.jfx.view;

import static com.project.jfx.util.Cast.cast;

import com.project.jfx.model.context.SessionContext;
import com.project.jfx.model.item.Item;
import com.project.jfx.process.Process;

import javafx.scene.Node;

public final class NodeActionUtil {

  public static <T extends SessionContext> void addDoubleClickLogic(Node cell, T context, Item item) {

    if (item == null || context == null) {
      return;
    }

    Process<T, ?, Item, Item, ?, ?> process = null;

    switch (item.getType()) {

      case BLOB:
      case DATAFILE:
      case DOCUMENT:
      case DTD:
      case LIBRARY:
      case SCHEMA:

        process = cast(context.rootCtx().functions().updatePropertiesProcess());
        break;

      case USER:

        process = cast(context.rootCtx().functions().updateUserProcess());
        break;

      case INDEX:
        process = cast(context.rootCtx().functions().updateIndexProcess());
        break;

      case DATABASE:
        process = cast(context.rootCtx().functions().updateDatabaseProcess());
        break;

      case BACKUP_INFO:
      case BRANCH:
      case CATALOG:
      case EXTERNAL_INDEX_INFO:
      case FEDERATION_SET:
      case GROUP:
      case METADATA:
      case PERSISTENT_MAP:
      case SEGMENT:
      case VERSION:
      default:
    }

    if (process == null) {
      return;
    }

    final Process<T, ?, Item, Item, ?, ?> action = process;

    cell.setOnMouseClicked(event -> {

      if (event.getClickCount() >= 2) {
        action.processAsync(context, item);
      }
    });
  }

  // Private Utility Class Constructor

  private NodeActionUtil() {
    // NOOP
  }
}

----------------------------------- SOURCE END -------------------------------------

java.lang.NullPointerException
	at org.eclipse.jdt.internal.compiler.ast.Expression.computeConversion(Expression.java:682)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.computeConversion(MessageSend.java:457)
	at org.eclipse.jdt.internal.compiler.ast.Assignment.resolveType(Assignment.java:231)
	at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:1034)
	at org.eclipse.jdt.internal.compiler.ast.Statement.resolveCase(Statement.java:429)
	at org.eclipse.jdt.internal.compiler.ast.SwitchStatement.resolve(SwitchStatement.java:529)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:641)
	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:316)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:551)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1229)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1354)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:652)
	at org.eclipse.jdt.internal.compiler.Compiler.resolve(Compiler.java:1055)
	at org.eclipse.jdt.internal.compiler.Compiler.resolve(Compiler.java:1100)
	at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:280)
	at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:346)
	at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:193)
	at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:94)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:736)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:802)
	at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1322)
	at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:131)
	at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.access$0(JavaReconcilingStrategy.java:113)
	at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:93)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:90)
	at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:157)
	at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:92)
	at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:107)
	at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:76)
	at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:210)
Comment 3 Eclipse Genie CLA 2021-02-11 12:42:08 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 4 Eclipse Genie CLA 2023-02-09 13:08:51 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.