Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7118681

javac gets NullPointerException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 7
    • tools
    • x86
    • linux_redhat_5.0

      FULL PRODUCT VERSION :
      java version "1.7.0_01"
      Java(TM) SE Runtime Environment (build 1.7.0_01-b08)
      Java HotSpot(TM) Client VM (build 21.1-b02, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Linux glxrhel5 2.6.18-274.12.1.el5 #1 SMP Tue Nov 8 21:40:25 EST 2011 i686 i686 i386 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      javac got an unhandled exception

      REGRESSION. Last worked in version 6u29

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile some java code

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Compiled java code
      ACTUAL -
      Java code did not compile because compiler quit

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Information:An exception has occurred in the compiler (1.7.0_01). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
      Information:java.lang.AssertionError: java.lang.NullPointerException
      Information: at com.sun.tools.javac.code.Symbol$VarSymbol.getConstValue(Symbol.java:1005)
      Information: at com.sun.tools.javac.comp.Attr.checkInit(Attr.java:2627)
      Information: at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:2285)
      Information: at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1677)
      Information: at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:431)
      Information: at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:418)
      Information: at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:449)
      Information: at com.sun.tools.javac.comp.Annotate.enterAttributeValue(Annotate.java:203)
      Information: at com.sun.tools.javac.comp.Annotate.enterAnnotation(Annotate.java:181)
      Information: at com.sun.tools.javac.comp.MemberEnter.enterAnnotations(MemberEnter.java:778)
      Information: at com.sun.tools.javac.comp.MemberEnter.access$300(MemberEnter.java:56)
      Information: at com.sun.tools.javac.comp.MemberEnter$5.enterAnnotation(MemberEnter.java:746)
      Information: at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:109)
      Information: at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:101)
      Information: at com.sun.tools.javac.comp.Enter.complete(Enter.java:510)
      Information: at com.sun.tools.javac.comp.Enter.main(Enter.java:469)
      Information: at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:929)
      Information: at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
      Information: at com.sun.tools.javac.main.Main.compile(Main.java:417)
      Information: at com.sun.tools.javac.main.Main.compile(Main.java:331)
      Information: at com.sun.tools.javac.main.Main.compile(Main.java:322)
      Information: at com.sun.tools.javac.Main.compile(Main.java:76)
      Information: at com.sun.tools.javac.Main.main(Main.java:61)
      Information: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      Information: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      Information: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      Information: at java.lang.reflect.Method.invoke(Method.java:601)
      Information: at com.intellij.rt.compiler.JavacRunner.main(JavacRunner.java:71)
      Information: at com.sun.tools.javac.code.Lint$AugmentVisitor.augment(Lint.java:290)
      Information: at com.sun.tools.javac.code.Lint.augment(Lint.java:82)
      Information: at com.sun.tools.javac.comp.Attr.attribLazyConstantValue(Attr.java:597)
      Information: at com.sun.tools.javac.code.Symbol$VarSymbol$1.call(Symbol.java:971)
      Information: at com.sun.tools.javac.code.Symbol$VarSymbol.getConstValue(Symbol.java:1003)
      Information: ... 27 more
      Information:Note: Some input files use unchecked or unsafe operations.
      Information:Note: Recompile with -Xlint:unchecked for details.
      Information:Compilation completed with 231 errors and 0 warnings
      Information:231 errors
      Information:0 warnings
      Error:: java.lang.NullPointerException

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package com.attachmate.rx;

      import com.attachmate.rx.util.FindFileUtil;

      import java.util.List;

      /**
       * Base class for tests that iterate over classes in the classpath.
       */
      public abstract class AbstractClassHierarchyTestCase<Type>
      {
          /**
           * Iterates through the classpath and validates anything that extends
           * the specified class.
           * @param baseClass the base class
           * @throws Exception if an error occurs
           */
          protected void validateClassesExtendingClass(Class<Type> baseClass) throws Exception
          {
              List<String> names = FindFileUtil.getClasspathClassNames();
              for (String name: names)
              {
                  if (name.startsWith("com.attachmate.rx") && !name.contains("NativeKeyHandling") && !name.endsWith("RxNative"))
                  {
                      try
                      {
                          Class c = Class.forName(name);
                          if (baseClass.isAssignableFrom(c))
                          {
                              validateClass((Class<Type>)c);
                          }
                      }
                      catch (UnsatisfiedLinkError le)
                      {
                          // ignore native library proxy classes (not available on all platforms)
                      }
                      catch (NoClassDefFoundError ncdfe)
                      {
                          // ignore native library proxy classes (not available on all platforms)
                      }
                  }
              }
          }

          protected abstract void validateClass(Class<? extends Type> c) throws Exception;
      }
      ---------- END SOURCE ----------

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: