org.eclipse.pde.api.tools_1.0.301.v20111129-2053

 34: aload_0
    //   35: invokestatic 558	org/eclipse/pde/api/tools/internal/builder/BuildState:getSerializationFile	(Lorg/eclipse/core/resources/IProject;)Ljava/io/File;
    //   38: astore_2
    //   39: aload_2
    //   40: ifnonnull +4 -> 44
    //   43: return
    //   44: lconst_0
    //   45: lstore_3
    //   46: getstatic 477	org/eclipse/pde/api/tools/internal/builder/ApiAnalysisBuilder:DEBUG	Z
    //   49: ifeq +7 -> 56
    //   52: invokestatic 524	java/lang/System:currentTimeMillis	()J
    //   55: lstore_3
    //   56: new 250	java/io/DataOutputStream
    //   59: dup
    //   60: new 248	java/io/BufferedOutputStream
    //   63: dup
    //   64: new 253	java/io/FileOutputStream
    //   67: dup
    //   68: aload_2
    //   69: invokespecial 510	java/io/FileOutputStream:<init>	(Ljava/io/File;)V
    //   72: invokespecial 492	java/io/BufferedOutputStream:<init>	(Ljava/io/OutputStream;)V
    //   75: invokespecial 504	java/io/DataOutputStream:<init>	(Ljava/io/OutputStream;)V
    //   78: astore 5
    //   80: aload_1
    //   81: aload 5
    //   83: invokestatic 556	org/eclipse/pde/api/tools/internal/builder/BuildState:write	(Lorg/eclipse/pde/api/tools/internal/builder/BuildState;Ljava/io/DataOutputStream;)V
    //   86: goto +13 -> 99
    //   89: astore 6
    //   91: aload 5
    //   93: invokevirtual 500	java/io/DataOutputStream:close	()V
    //   96: aload 6
    //   98: athrow
    //   99: aload 5
    //   101: invokevirtual 500	java/io/DataOutputStream:close	()V
    //   104: goto +91 -> 195
    //   107: astore 5
    //   109: aload_2
    //   110: invokevirtual 506	java/io/File:delete	()Z
    //   113: pop
    //   114: goto +4 -> 118
    //   117: pop
    //   118: new 274	org/eclipse/core/runtime/CoreException
    //   121: dup
    //   122: new 276	org/eclipse/core/runtime/Status
    //   125: dup
    //   126: iconst_4
    //   127: ldc 3
    //   129: iconst_2
    //   130: getstatic 488	org/eclipse/pde/api/tools/internal/builder/BuilderMessages:build_cannotSaveState	Ljava/lang/String;
    //   133: aload_0
    //   134: invokeinterface 582 1 0
    //   139: invokestatic 543	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   142: aload 5
    //   144: invokespecial 541	org/eclipse/core/runtime/Status:<init>	(ILjava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
    //   147: invokespecial 540	org/eclipse/core/runtime/CoreException:<init>	(Lorg/eclipse/core/runtime/IStatus;)V
    //   150: athrow
    //   151: astore 5
    //   153: aload_2
    //   154: invokevirtual 506	java/io/File:delete	()Z
    //   157: pop
    //   158: goto +4 -> 162
    //   161: pop
    //   162: new 274	org/eclipse/core/runtime/CoreException
    //   165: dup
    //   166: new 276	org/eclipse/core/runtime/Status
    //   169: dup
    //   170: iconst_4
    //   171: ldc 3
    //   173: iconst_2
    //   174: getstatic 488	org/eclipse/pde/api/tools/internal/builder/BuilderMessages:build_cannotSaveState	Ljava/lang/String;
    //   177: aload_0
    //   178: invokeinterface 582 1 0
    //   183: invokestatic 543	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   186: aload 5
    //   188: invokespecial 541	org/eclipse/core/runtime/Status:<init>	(ILjava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
    //   191: invokespecial 540	org/eclipse/core/runtime/CoreException:<init>	(Lorg/eclipse/core/runtime/IStatus;)V
    //   194: athrow
    //   195: getstatic 477	org/eclipse/pde/api/tools/internal/builder/ApiAnalysisBuilder:DEBUG	Z
    //   198: ifeq +25 -> 223
    //   201: invokestatic 524	java/lang/System:currentTimeMillis	()J
    //   204: lload_3
    //   205: lsub
    //   206: lstore_3
    //   207: getstatic 475	java/lang/System:out	Ljava/io/PrintStream;
    //   210: getstatic 489	org/eclipse/pde/api/tools/internal/builder/BuilderMessages:build_saveStateComplete	Ljava/lang/String;
    //   213: lload_3
    //   214: invokestatic 518	java/lang/String:valueOf	(J)Ljava/lang/String;
    //   217: invokestatic 543	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   220: invokevirtual 512	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   223: return
    // Line number table:
    //   Java source line #606	-> byte code offset #0
    //   Java source line #607	-> byte code offset #6
    //   Java source line #609	-> byte code offset #34
    //   Java source line #610	-> byte code offset #39
    //   Java source line #611	-> byte code offset #44
    //   Java source line #612	-> byte code offset #46
    //   Java source line #613	-> byte code offset #52
    //   Java source line #616	-> byte code offset #56
    //   Java source line #618	-> byte code offset #80
    //   Java source line #619	-> byte code offset #89
    //   Java source line #620	-> byte code offset #91
    //   Java source line #621	-> byte code offset #96
    //   Java source line #620	-> byte code offset #99
    //   Java source line #622	-> byte code offset #107
    //   Java source line #624	-> byte code offset #109
    //   Java source line #625	-> byte code offset #117
    //   Java source line #628	-> byte code offset #118
    //   Java source line #629	-> byte code offset #122
    //   Java source line #630	-> byte code offset #130
    //   Java source line #629	-> byte code offset #144
    //   Java source line #628	-> byte code offset #147
    //   Java source line #631	-> byte code offset #151
    //   Java source line #633	-> byte code offset #153
    //   Java source line #634	-> byte code offset #161
    //   Java source line #637	-> byte code offset #162
    //   Java source line #638	-> byte code offset #166
    //   Java source line #639	-> byte code offset #174
    //   Java source line #638	-> byte code offset #188
    //   Java source line #637	-> byte code offset #191
    //   Java source line #641	-> byte code offset #195
    //   Java source line #642	-> byte code offset #201
    //   Java source line #643	-> byte code offset #207
    //   Java source line #645	-> byte code offset #223
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	224	0	project	IProject
    //   0	224	1	state	BuildState
    //   38	116	2	file	File
    //   45	169	3	t	long
    //   78	22	5	out	DataOutputStream
    //   107	36	5	e	RuntimeException
    //   151	36	5	e	IOException
    //   89	8	6	localObject	Object
    //   117	1	8	localSecurityException1	SecurityException
    //   161	1	9	localSecurityException2	SecurityException
    // Exception table:
    //   from	to	target	type
    //   80	89	89	finally
    //   56	104	107	java/lang/RuntimeException
    //   109	114	117	java/lang/SecurityException
    //   56	104	151	java/io/IOException
    //   153	158	161	java/lang/SecurityException
  }
  
  public static long computeBuildPathCRC(IProject project)
  {
    IJavaProject jp = JavaCore.create(project);
    try
    {
      IClasspathEntry[] classpath = jp.getResolvedClasspath(true);
      CRC32 crc32 = new CRC32();
      for (int i = 0; i < classpath.length; i++)
      {
        IClasspathEntry entry = classpath[i];
        crc32.update(entry.getPath().toPortableString().getBytes());
      }
      return crc32.getValue();
    }
    catch (JavaModelException localJavaModelException) {}
    return -1L;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.builder.BuildState
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.builder;

import org.eclipse.osgi.util.NLS;

public class BuilderMessages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.pde.api.tools.internal.builder.buildermessages";
  public static String api_analysis_builder;
  public static String api_analysis_on_0;
  public static String building_workspace_profile;
  public static String checking_api_usage;
  public static String checking_external_dependencies;
  public static String AbstractTypeLeakDetector_vis_type_has_no_api_description;
  public static String ApiAnalysisBuilder_builder_for_project;
  public static String ApiAnalysisBuilder_finding_affected_source_files;
  public static String ApiAnalysisBuilder_initializing_analyzer;
  public static String ApiProblemFactory_problem_message_not_found;
  public static String CleaningAPIDescription;
  public static String BaseApiAnalyzer_analyzing_api;
  public static String BaseApiAnalyzer_checking_compat;
  public static String BaseApiAnalyzer_checking_since_tags;
  public static String BaseApiAnalyzer_comparing_api_profiles;
  public static String BaseApiAnalyzer_Constructor;
  public static String BaseApiAnalyzer_Method;
  public static String BaseApiAnalyzer_more_version_problems;
  public static String BaseApiAnalyzer_processing_deltas;
  public static String BaseApiAnalyzer_scanning_0;
  public static String BaseApiAnalyzer_validating_javadoc_tags;
  public static String build_wrongFileFormat;
  public static String build_saveStateComplete;
  public static String build_cannotSaveState;
  public static String undefinedRange;
  public static String reportUnsatisfiedConstraint;
  public static String ReferenceAnalyzer_analyzing_api_checking_use;
  public static String ReferenceAnalyzer_analyzing_api;
  public static String ReferenceAnalyzer_api_analysis_error;
  public static String ReferenceAnalyzer_checking_api_used_by;
  public static String ReferenceExtractor_failed_to_lookup_method;
  public static String ReferenceExtractor_failed_to_lookup_field;
  public static String TagValidator_a_class;
  public static String TagValidator_a_constructor;
  public static String TagValidator_a_field;
  public static String TagValidator_a_final_annotation_field;
  public static String TagValidator_a_final_class;
  public static String TagValidator_a_final_field;
  public static String TagValidator_a_final_method;
  public static String TagValidator_a_method;
  public static String TagValidator_a_method_in_a_final_class;
  public static String TagValidator_a_static_final_method;
  public static String TagValidator_a_static_method;
  public static String TagValidator_an_abstract_class;
  public static String TagValidator_an_annotation;
  public static String TagValidator_an_annotation_method;
  public static String TagValidator_an_enum;
  public static String TagValidator_an_enum_constant;
  public static String TagValidator_an_enum_method;
  public static String TagValidator_an_interface;
  public static String TagValidator_an_interface_method;
  public static String TagValidator_annotation_field;
  public static String TagValidator_enum_field;
  public static String TagValidator_private_constructor;
  public static String TagValidator_private_enum_field;
  public static String TagValidator_private_enum_method;
  public static String TagValidator_private_field;
  public static String TagValidator_private_method;
  public static String IncrementalBuilder_builder_for_project;
  
  static
  {
    NLS.initializeMessages("org.eclipse.pde.api.tools.internal.builder.buildermessages", BuilderMessages.class);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.builder.BuilderMessages
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.builder;

import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.jdt.core.dom.ITypeBinding;
import org.eclipse.jdt.core.dom.TypeDeclaration;
import org.eclipse.pde.api.tools.internal.model.ApiType;

class IllegalExtendsProblemDetector$MethodFinder
  extends ASTVisitor
{
  IMethod method;
  private IType jtype;
  private ApiType type;
  final IllegalExtendsProblemDetector this$0;
  
  public IllegalExtendsProblemDetector$MethodFinder(IllegalExtendsProblemDetector paramIllegalExtendsProblemDetector, ApiType type, IType jtype)
  {
    this$0 = paramIllegalExtendsProblemDetector;method = null;this.jtype = null;this.type = null;
    this.type = type;
    this.jtype = jtype;
  }
  
  public boolean visit(AnonymousClassDeclaration node)
  {
    if (method == null)
    {
      ITypeBinding binding = node.resolveBinding();
      String binaryName = binding.getBinaryName();
      if (type.getName().endsWith(binaryName))
      {
        try
        {
          IJavaElement element = jtype.getCompilationUnit().getElementAt(node.getStartPosition());
          if (element != null)
          {
            IJavaElement ancestor = element.getAncestor(9);
            if (ancestor != null) {
              method = ((IMethod)ancestor);
            }
          }
        }
        catch (JavaModelException localJavaModelException) {}
        return false;
      }
    }
    return true;
  }
  
  public boolean visit(TypeDeclaration node)
  {
    if ((method == null) && (node.isLocalTypeDeclaration()))
    {
      ITypeBinding binding = node.resolveBinding();
      String binaryName = binding.getBinaryName();
      if (type.getName().endsWith(binaryName))
      {
        try
        {
          IJavaElement element = jtype.getCompilationUnit().getElementAt(node.getStartPosition());
          if (element.getElementType() == 7)
          {
            IType ltype = (IType)element;
            IJavaElement parent = ltype.getParent();
            if (parent.getElementType() == 9) {
              method = ((IMethod)parent);
            }
          }
        }
        catch (JavaModelException localJavaModelException) {}
        return false;
      }
    }
    return true;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.builder.IllegalExtendsProblemDetector.MethodFinder
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.builder;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.core.dom.ASTNode;
import org.eclipse.jdt.core.dom.ASTParser;
import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.jdt.core.dom.ITypeBinding;
import org.eclipse.jdt.core.dom.TypeDeclaration;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.Position;
import org.eclipse.pde.api.tools.internal.model.ApiType;
import org.eclipse.pde.api.tools.internal.provisional.builder.IReference;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiMethod;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiType;
import org.eclipse.pde.api.tools.internal.util.Signatures;

public class IllegalExtendsProblemDetector
  extends AbstractIllegalTypeReference
{
  class MethodFinder
    extends ASTVisitor
  {
    IMethod method = null;
    private IType jtype = null;
    private ApiType type = null;
    
    public MethodFinder(ApiType type, IType jtype)
    {
      this.type = type;
      this.jtype = jtype;
    }
    
    public boolean visit(AnonymousClassDeclaration node)
    {
      if (method == null)
      {
        ITypeBinding binding = node.resolveBinding();
        String binaryName = binding.getBinaryName();
        if (type.getName().endsWith(binaryName))
        {
          try
          {
            IJavaElement element = jtype.getCompilationUnit().getElementAt(node.getStartPosition());
            if (element != null)
            {
              IJavaElement ancestor = element.getAncestor(9);
              if (ancestor != null) {
                method = ((IMethod)ancestor);
              }
            }
          }
          catch (JavaModelException localJavaModelException) {}
          return false;
        }
      }
      return true;
    }
    
    public boolean visit(TypeDeclaration node)
    {
      if ((method == null) && (node.isLocalTypeDeclaration()))
      {
        ITypeBinding binding = node.resolveBinding();
        String binaryName = binding.getBinaryName();
        if (type.getName().endsWith(binaryName))
        {
          try
          {
            IJavaElement element = jtype.getCompilationUnit().getElementAt(node.getStartPosition());
            if (element.getElementType() == 7)
            {
              IType ltype = (IType)element;
              IJavaElement parent = ltype.getParent();
              if (parent.getElementType() == 9) {
                method = ((IMethod)parent);
              }
            }
          }
          catch (JavaModelException localJavaModelException) {}
          return false;
        }
      }
      return true;
    }
  }
  
  public int getReferenceKinds()
  {
    return 1;
  }
  
  protected int getProblemKind()
  {
    return 1;
  }
  
  protected int getProblemFlags(IReference reference)
  {
    IApiType type = (IApiType)reference.getMember();
    if (type.isLocal()) {
      return 10;
    }
    if (type.isAnonymous()) {
      return 11;
    }
    return super.getProblemFlags(reference);
  }
  
  protected String getSeverityKey()
  {
    return "ILLEGAL_EXTEND";
  }
  
  protected String[] getMessageArgs(IReference reference)
    throws CoreException
  {
    ApiType ltype = (ApiType)reference.getMember();
    String simpleTypeName = getSimpleTypeName(reference.getResolvedReference());
    if (ltype.isAnonymous())
    {
      IApiType etype = ltype.getEnclosingType();
      String signature = Signatures.getQualifiedTypeSignature(etype);
      IApiMethod method = ltype.getEnclosingMethod();
      if (method != null) {
        signature = Signatures.getQualifiedMethodSignature(method);
      }
      return new String[] { signature, simpleTypeName };
    }
    if (ltype.isLocal())
    {
      IApiType etype = ltype.getEnclosingType();
      IApiMethod method = ltype.getEnclosingMethod();
      if (method != null)
      {
        String methodsig = Signatures.getQualifiedMethodSignature(method);
        return new String[] {
          Signatures.getAnonymousTypeName(ltype.getName()), 
          methodsig, 
          simpleTypeName };
      }
      return new String[] {
        Signatures.getAnonymousTypeName(ltype.getName()), 
        getSimpleTypeName(etype), 
        simpleTypeName };
    }
    return super.getMessageArgs(reference);
  }
  
  protected String[] getQualifiedMessageArgs(IReference reference)
    throws CoreException
  {
    ApiType ltype = (ApiType)reference.getMember();
    if ((ltype.isLocal()) || (ltype.isAnonymous())) {
      return getMessageArgs(reference);
    }
    return super.getQualifiedMessageArgs(reference);
  }
  
  protected Position getSourceRange(IType type, IDocument doc, IReference reference)
    throws CoreException, BadLocationException
  {
    ApiType ltype = (ApiType)reference.getMember();
    IMethod method = null;
    if (ltype.isAnonymous())
    {
      getEnclosingMethod(type, reference, doc);
      if (reference.getLineNumber() < 0) {
        return defaultSourcePosition(type, reference);
      }
      String name = getSimpleTypeName(reference.getResolvedReference());
      Position pos = getMethodNameRange(true, name, doc, reference);
      if (pos == null) {
        return defaultSourcePosition(type, reference);
      }
      return pos;
    }
    if (ltype.isLocal())
    {
      String name = ltype.getSimpleName();
      ICompilationUnit cunit = type.getCompilationUnit();
      if (cunit.isWorkingCopy()) {
        cunit.reconcile(4, false, null, null);
      }
      IType localtype = type;
      method = getEnclosingMethod(type, reference, doc);
      if (method != null) {
        localtype = method.getType(name, 1);
      }
      if (localtype.exists())
      {
        ISourceRange range = localtype.getNameRange();
        return new Position(range.getOffset(), range.getLength());
      }
      return defaultSourcePosition(type, reference);
    }
    return super.getSourceRange(type, doc, reference);
  }
  
  private IMethod getEnclosingMethod(IType jtype, IReference reference, IDocument document)
    throws CoreException
  {
    ApiType type = (ApiType)reference.getMember();
    IApiMethod apimethod = type.getEnclosingMethod();
    if (apimethod != null)
    {
      String signature = Signatures.processMethodSignature(apimethod);
      String methodname = Signatures.getMethodName(apimethod);
      IMethod method = jtype.getMethod(methodname, Signature.getParameterTypes(signature));
      if (method.exists()) {
        return method;
      }
    }
    else
    {
      IMethod method = null;
      if (reference.getLineNumber() > -1) {
        try
        {
          int offset = document.getLineOffset(reference.getLineNumber());
          method = quickLookup(jtype, document, reference, offset);
        }
        catch (BadLocationException localBadLocationException) {}
      }
      if (method == null)
      {
        ISourceRange range = jtype.getCompilationUnit().getSourceRange();
        ASTParser parser = ASTParser.newParser(4);
        parser.setSource(jtype.getCompilationUnit());
        parser.setSourceRange(range.getOffset(), range.getLength());
        parser.setResolveBindings(true);
        ASTNode ptype = parser.createAST(null);
        MethodFinder finder = new MethodFinder(type, jtype);
        ptype.accept(finder);
        method = method;
      }
      if ((method != null) && (method.exists()))
      {
        ApiType etype = (ApiType)type.getEnclosingType();
        IApiMethod[] methods = etype.getMethods();
        String msig = null;
        for (int i = 0; i < methods.length; i++)
        {
          msig = methods[i].getSignature();
          if ((Signatures.getMethodName(methods[i]).equals(method.getElementName())) && 
            (Signatures.matchesSignatures(msig.replace('/', '.'), method.getSignature()))) {
            type.setEnclosingMethodInfo(methods[i].getName(), msig);
          }
        }
        return method;
      }
    }
    return null;
  }
  
  private IMethod quickLookup(IType jtype, IDocument document, IReference reference, int offset)
    throws JavaModelException
  {
    if (offset > -1)
    {
      IJavaElement element = jtype.getCompilationUnit().getElementAt(offset);
      if (element != null)
      {
        IJavaElement ancestor = element.getAncestor(9);
        if (ancestor != null) {
          return (IMethod)ancestor;
        }
      }
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.builder.IllegalExtendsProblemDetector
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.builder;

import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IType;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.Position;
import org.eclipse.pde.api.tools.internal.model.MethodKey;
import org.eclipse.pde.api.tools.internal.provisional.builder.IReference;
import org.eclipse.pde.api.tools.internal.provisional.descriptors.IFieldDescriptor;
import org.eclipse.pde.api.tools.internal.provisional.descriptors.IReferenceTypeDescriptor;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiField;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiMember;

public class IllegalFieldReferenceDetector
  extends AbstractProblemDetector
{
  private Map fIllegalFields = new HashMap();
  private Map fFieldComponents = new HashMap();
  
  void addIllegalField(IFieldDescriptor field, String componentId)
  {
    fIllegalFields.put(new MethodKey(field.getEnclosingType().getQualifiedName(), field.getName(), null, true), field);
    fFieldComponents.put(field, componentId);
  }
  
  public boolean considerReference(IReference reference)
  {
    if ((super.considerReference(reference)) && (fIllegalFields.containsKey(new MethodKey(reference.getReferencedTypeName(), reference.getReferencedMemberName(), reference.getReferencedSignature(), true))))
    {
      retainReference(reference);
      return true;
    }
    return false;
  }
  
  public int getReferenceKinds()
  {
    return 
      30720;
  }
  
  protected int getProblemKind()
  {
    return 3;
  }
  
  protected String getSeverityKey()
  {
    return "ILLEGAL_REFERENCE";
  }
  
  protected int getProblemFlags(IReference reference)
  {
    return 9;
  }
  
  protected int getElementType(IReference reference)
  {
    return 5;
  }
  
  protected String[] getMessageArgs(IReference reference)
    throws CoreException
  {
    IApiField field = (IApiField)reference.getResolvedReference();
    return new String[] {
      getSimpleTypeName(field), 
      getSimpleTypeName(reference.getMember()), 
      field.getName() };
  }
  
  protected String[] getQualifiedMessageArgs(IReference reference)
    throws CoreException
  {
    IApiField field = (IApiField)reference.getResolvedReference();
    return new String[] {
      getQualifiedTypeName(field), 
      getQualifiedTypeName(reference.getMember()), 
      field.getName() };
  }
  
  protected Position getSourceRange(IType type, IDocument document, IReference reference)
    throws CoreException, BadLocationException
  {
    return getFieldNameRange((IApiField)reference.getResolvedReference(), document, reference);
  }
  
  protected boolean isProblem(IReference reference)
  {
    if (!super.isProblem(reference)) {
      return false;
    }
    Object componentId = fFieldComponents.get(reference.getResolvedReference().getHandle());
    return isReferenceFromComponent(reference, componentId);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.builder.IllegalFieldReferenceDetector
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.builder;

import java.util.HashMap;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.pde.api.tools.internal.provisional.ApiPlugin;
import org.eclipse.pde.api.tools.internal.provisional.Factory;
import org.eclipse.pde.api.tools.internal.provisional.IApiAnnotations;
import org.eclipse.pde.api.tools.internal.provisional.IApiDescription;
import org.eclipse.pde.api.tools.internal.provisional.RestrictionModifiers;
import org.eclipse.pde.api.tools.internal.provisional.builder.IReference;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiComponent;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiMember;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiType;

public class IllegalImplementsProblemDetector
  extends AbstractIllegalTypeReference
{
  private HashMap fRestrictedInterfaces = new HashMap();
  
  public int getReferenceKinds()
  {
    return 2;
  }
  
  protected int getProblemKind()
  {
    return 4;
  }
  
  protected String getSeverityKey()
  {
    return "ILLEGAL_IMPLEMENT";
  }
  
  public boolean considerReference(IReference reference)
  {
    try
    {
      if (super.considerReference(reference)) {
        return true;
      }
      IApiType type = (IApiType)reference.getMember();
      IApiType[] inters = type.getSuperInterfaces();
      IApiType inter = null;
      for (int j = 0; j < inters.length; j++) {
        if (inters[j].getName().equals(reference.getReferencedTypeName()))
        {
          inter = inters[j];
          break;
        }
      }
      if ((inter != null) && (findRestrictedSuperinterfaces(type.getApiComponent(), reference.getReferencedTypeName(), inter)))
      {
        retainReference(reference);
        return true;
      }
    }
    catch (CoreException ce)
    {
      if (DEBUG) {
        ApiPlugin.log(ce);
      }
    }
    return false;
  }
  
  protected boolean isProblem(IReference reference)
  {
    try
    {
      if (isIllegalType(reference)) {
        return super.isProblem(reference);
      }
      if (fRestrictedInterfaces.size() > 0)
      {
        IApiMember member = reference.getMember();
        if (member.getType() == 2)
        {
          IApiType itype = (IApiType)fRestrictedInterfaces.get(reference.getReferencedTypeName());
          return (itype != null) && (!isImplemented(((IApiType)member).getSuperclass(), itype.getName()));
        }
      }
      return true;
    }
    catch (CoreException ce)
    {
      if (DEBUG) {
        ApiPlugin.log(ce);
      }
    }
    return super.isProblem(reference);
  }
  
  protected String[] getMessageArgs(IReference reference)
    throws CoreException
  {
    if (isIllegalType(reference)) {
      return super.getMessageArgs(reference);
    }
    if (fRestrictedInterfaces.size() > 0)
    {
      IApiType type = (IApiType)reference.getResolvedReference();
      IApiType inter = (IApiType)fRestrictedInterfaces.get(type.getName());
      if (inter != null) {
        return new String[] { getSimpleTypeName(type), inter.getSimpleName(), getSimpleTypeName(reference.getMember()) };
      }
    }
    return super.getMessageArgs(reference);
  }
  
  protected String[] getQualifiedMessageArgs(IReference reference)
    throws CoreException
  {
    if (isIllegalType(reference)) {
      return super.getQualifiedMessageArgs(reference);
    }
    if (fRestrictedInterfaces.size() > 0)
    {
      IApiType type = (IApiType)reference.getResolvedReference();
      IApiType inter = (IApiType)fRestrictedInterfaces.get(type.getName());
      if (inter != null) {
        return new String[] { getQualifiedTypeName(type), inter.getName(), getQualifiedTypeName(reference.getMember()) };
      }
    }
    return super.getQualifiedMessageArgs(reference);
  }
  
  protected int getProblemFlags(IReference reference)
  {
    if (isIllegalType(reference)) {
      return super.getProblemFlags(reference);
    }
    return 10;
  }
  
  private boolean isImplemented(IApiType type, String iname)
    throws CoreException
  {
    if (type == null) {
      return false;
    }
    if (isImplemented(iname, type.getSuperInterfaces())) {
      return true;
    }
    return isImplemented(type.getSuperclass(), iname);
  }
  
  private boolean isImplemented(String iname, IApiType[] interfaces)
    throws CoreException
  {
    if (interfaces.length == 0) {
      return false;
    }
    for (int i = 0; i < interfaces.length; i++)
    {
      if (interfaces[i].getName().equals(iname)) {
        return true;
      }
      if (isImplemented(iname, interfaces[i].getSuperInterfaces())) {
        return true;
      }
    }
    return false;
  }
  
  private boolean findRestrictedSuperinterfaces(IApiComponent originalcomponent, String entryinterface, IApiType type)
    throws CoreException
  {
    IApiType[] inters = type.getSuperInterfaces();
    if (inters.length == 0) {
      return false;
    }
    IApiAnnotations annot = null;
    IApiComponent comp = null;
    for (int i = 0; i < inters.length; i++)
    {
      comp = inters[i].getApiComponent();
      if (comp != null)
      {
        if (!comp.equals(originalcomponent))
        {
          annot = comp.getApiDescription().resolveAnnotations(Factory.typeDescriptor(inters[i].getName()));
          if ((annot != null) && (RestrictionModifiers.isImplementRestriction(annot.getRestrictions()))) {
            return fRestrictedInterfaces.put(entryinterface, inters[i]) == null;
          }
        }
        return findRestrictedSuperinterfaces(originalcomponent, entryinterface, inters[i]);
      }
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.builder.IllegalImplementsProblemDetector
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.builder;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IType;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.Position;
import org.eclipse.pde.api.tools.internal.provisional.builder.IReference;

public class IllegalInstantiateProblemDetector
  extends AbstractIllegalTypeReference
{
  public int getReferenceKinds()
  {
    return 134217728;
  }
  
  protected Position getSourceRange(IType type, IDocument document, IReference reference)
    throws CoreException, BadLocationException
  {
    String name = getSimpleTypeName(reference.getResolvedReference());
    Position pos = getMethodNameRange(true, name, document, reference);
    if (pos == null) {
      return defaultSourcePosition(type, reference);
    }
    return pos;
  }
  
  protected int getProblemKind()
  {
    return 2;
  }
  
  protected String getSeverityKey()
  {
    return "ILLEGAL_INSTANTIATE";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.builder.IllegalInstantiateProblemDetector
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.builder;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IType;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.Position;
import org.eclipse.pde.api.tools.internal.provisional.builder.IReference;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiMethod;
import org.eclipse.pde.api.tools.internal.util.Signatures;

public class IllegalMethodReferenceDetector
  extends AbstractIllegalMethodReference
{
  public int getReferenceKinds()
  {
    return 
      1049536;
  }
  
  protected int getProblemKind()
  {
    return 3;
  }
  
  protected String getSeverityKey()
  {
    return "ILLEGAL_REFERENCE";
  }
  
  protected String[] getMessageArgs(IReference reference)
    throws CoreException
  {
    IApiMethod method = (IApiMethod)reference.getResolvedReference();
    if (method.isConstructor()) {
      return new String[] {
        Signatures.getMethodSignature(method), 
        getSimpleTypeName(reference.getMember()) };
    }
    return new String[] {
      getSimpleTypeName(method), 
      getSimpleTypeName(reference.getMember()), 
      Signatures.getMethodSignature(method) };
  }
  
  protected Position getSourceRange(IType type, IDocument document, IReference reference)
    throws CoreException, BadLocationException
  {
    IApiMethod method = (IApiMethod)reference.getResolvedReference();
    Position pos = getMethodNameRange(method.isConstructor(), Signatures.getMethodName(method), document, reference);
    if (pos == null) {
      return defaultSourcePosition(type, reference);
    }
    return pos;
  }
  
  protected String[] getQualifiedMessageArgs(IReference reference)
    throws CoreException
  {
    IApiMethod method = (IApiMethod)reference.getResolvedReference();
    return new String[] {
      getQualifiedTypeName(method), 
      getQualifiedTypeName(reference.getMember()), 
      Signatures.getMethodSignature(method) };
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.builder.IllegalMethodReferenceDetector
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.builder;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.Position;
import org.eclipse.pde.api.tools.internal.provisional.builder.IReference;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiMethod;
import org.eclipse.pde.api.tools.internal.util.Signatures;

public class IllegalOverrideProblemDetector
  extends AbstractIllegalMethodReference
{
  public int getReferenceKinds()
  {
    return 268435456;
  }
  
  protected int getProblemKind()
  {
    return 5;
  }
  
  protected String getSeverityKey()
  {
    return "ILLEGAL_OVERRIDE";
  }
  
  protected String[] getMessageArgs(IReference reference)
    throws CoreException
  {
    IApiMethod method = (IApiMethod)reference.getResolvedReference();
    return new String[] {
      getSimpleTypeName(method), 
      getSimpleTypeName(reference.getMember()), 
      Signature.toString(method.getSignature(), method.getName(), null, false, false) };
  }
  
  protected String[] getQualifiedMessageArgs(IReference reference)
    throws CoreException
  {
    IApiMethod method = (IApiMethod)reference.getResolvedReference();
    return new String[] {
      getTypeName(method), 
      getTypeName(reference.getMember()), 
      Signatures.getMethodSignature(method) };
  }
  
  protected Position getSourceRange(IType type, IDocument doc, IReference reference)
    throws CoreException, BadLocationException
  {
    return getSourceRangeForMethod(type, reference, (IApiMethod)reference.getResolvedReference());
  }
  
  protected int getProblemFlags(IReference reference)
  {
    return 0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.builder.IllegalOverrideProblemDetector
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.builder;

import java.util.HashSet;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;

class IncrementalApiBuilder$Change
{
  int changeKind;
  int fileKind;
  int deltaKind;
  IProject project;
  IFile resource;
  String typeName;
  final IncrementalApiBuilder this$0;
  
  IncrementalApiBuilder$Change(IncrementalApiBuilder paramIncrementalApiBuilder, int kind, int deltaKind, IFile resource, String typeName, int fileKind)
  {
    this$0 = paramIncrementalApiBuilder;
    changeKind = kind;
    this.deltaKind = deltaKind;
    this.resource = resource;
    project = resource.getProject();
    this.typeName = typeName;
    this.fileKind = fileKind;
  }
  
  boolean isContained(IProject project, HashSet others)
  {
    return (this.project.equals(project)) || ((others != null) && (others.contains(this.project)));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.builder.IncrementalApiBuilder.Change
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.builder;

import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IResourceDeltaVisitor;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.pde.api.tools.internal.TypeAnnotations;
import org.eclipse.pde.api.tools.internal.provisional.ApiPlugin;
import org.eclipse.pde.api.tools.internal.provisional.Factory;
import org.eclipse.pde.api.tools.internal.provisional.IApiAnnotations;
import org.eclipse.pde.api.tools.internal.provisional.IApiDescription;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiBaseline;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiComponent;
import org.eclipse.pde.api.tools.internal.util.Util;

class IncrementalApiBuilder$ResourceDeltaVisitor
  implements IResourceDeltaVisitor
{
  List changes;
  boolean buildpathChanged;
  final IncrementalApiBuilder this$0;
  
  IncrementalApiBuilder$ResourceDeltaVisitor(IncrementalApiBuilder paramIncrementalApiBuilder, boolean pathChanged)
  {
    this$0 = paramIncrementalApiBuilder;changes = new ArrayList();buildpathChanged = false;
    buildpathChanged = pathChanged;
  }
  
  public boolean visit(IResourceDelta delta)
    throws CoreException
  {
    switch (delta.getResource().getType())
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd