示例#1
0
  private void addToAllChildren(LibMethodHolder addLmh) {

    LibClassHolder containingClass = addLmh.getContainingClass();
    if (containingClass.getAllChildTypes() == null) {
      containingClass.setAllChildTypes(
          RepositoryAnalyzer.getInstance().getAllChildTypes(containingClass.getName()));
    }

    for (String childClass : containingClass.getAllChildTypes()) {
      LibMethodHolder childLmh =
          RepositoryAnalyzer.getInstance().getEqviMethodDeclaration(childClass, addLmh);
      if (childLmh != null) {
        methodsInvoked.add(childLmh);
        childLmh.getCallingMethods().add(this);
      }
    }
  }
示例#2
0
 public void incrNumImplements(String codeSampleName, String methodName) {
   String packageName =
       RepositoryAnalyzer.getInstance().getCodeSampleIDToPackageMapper().get(codeSampleName);
   if (!visitedPackagesForImplements.contains(packageName)) {
     visitedPackagesForImplements.add(packageName);
     numImplements++;
   }
   localNumImplements++;
 }
示例#3
0
  public LibMethodHolder(String methodSig) {
    ID = RepositoryAnalyzer.getUniqueIDForMI();
    int firstComma = methodSig.indexOf(",");
    int leftBrace = methodSig.indexOf("(");

    returnType = methodSig.substring(0, firstComma);
    name = methodSig.substring(firstComma + 1, leftBrace);
    argumentStr = methodSig.substring(leftBrace + 1, methodSig.length() - 1);

    if (!argumentStr.equals("")) argTypes = argumentStr.split(",");
    else argTypes = new String[0];

    argumentStr = "(" + argumentStr + ")";
  }
示例#4
0
  public void incrNumExtensions(String codeSampleName, String methodName) {
    String packageName =
        RepositoryAnalyzer.getInstance().getCodeSampleIDToPackageMapper().get(codeSampleName);
    if (!visitedPackagesForExtends.contains(packageName)) {
      visitedPackagesForExtends.add(packageName);
      numExtensions++;

      // Storing the code examples for this method invocation
      CodeExampleStore cesObj = new CodeExampleStore();
      cesObj.filename = codeSampleName;
      cesObj.methodname = methodName;
      cesObj.type = LibMethodHolder.HOOK;
      hookExampleStore.add(cesObj);
    }
    localNumExtensions++;
  }
示例#5
0
 public LibMethodHolder() {
   ID = RepositoryAnalyzer.getUniqueIDForMI();
 }