docs: private static @CheckForNull
      IJavaElement getJavaElement(BugInstance bug, IJavaProject project) throws JavaModelException {
  
          SourceLineAnnotation primarySourceLineAnnotation = bug.getPrimarySourceLineAnnotation();
          String qualifiedClassName = primarySourceLineAnnotation.getClassName();
  
  //        if (Reporter.DEBUG) {
  //            System.out.println("Looking up class: " + packageName + ", " + qualifiedClassName);
  //        }
  
          Matcher m = fullName.matcher(qualifiedClassName);
          IType type;
          String innerName = null;
          if (m.matches() && m.group(2).length() > 0) {
  
              String outerQualifiedClassName = m.group(1).replace('$', '.');
              innerName = m.group(2).substring(1);
              // second argument is required to find also secondary types
              type = project.findType(outerQualifiedClassName, (IProgressMonitor) null);
  
              /*
               * code below only points to the first line of inner class even if
               * this is not a class bug but field bug
               */
              if (type != null && !hasLineInfo(primarySourceLineAnnotation)) {
                  completeInnerClassInfo(qualifiedClassName, innerName, type, bug);
              }
          } else {
              // second argument is required to find also secondary types
              type = project.findType(qualifiedClassName.replace('$', '.'), (IProgressMonitor) null);
  
              // for inner classes, some detectors does not properly report source
              // lines:
              // instead of reporting the first line of inner class, they report
              // first line of parent class
              // in this case we will try to fix this here and point to the right
              // start line
              if (type != null && type.isMember()) {
                  if (!hasLineInfo(primarySourceLineAnnotation)) {
                      completeInnerClassInfo(qualifiedClassName, type.getElementName(), type, bug);
                  }
              }
          }
  
          // reassign it as it may be changed for inner classes
          primarySourceLineAnnotation = bug.getPrimarySourceLineAnnotation();
  
          /*
           * Eclipse can help us find the line number for fields => we trying to
           * add line info for fields here
           */
          int startLine = primarySourceLineAnnotation.getStartLine();
          // TODO don't use "1", use "0" ?
          if (startLine <= 1 && type != null) {
              FieldAnnotation primaryField = bug.getPrimaryField();
              if(primaryField != null) {
                  completeFieldInfo(qualifiedClassName, type, bug, primaryField);
              }
          }
  
          return type;
      }