Examples of SourceFileAttribute


Examples of net.sf.rej.java.attribute.SourceFileAttribute

    }
   
    // Add some useful information as comments

    // Source file name
    SourceFileAttribute sfA = cfA.getAttributes().getSourceFileAttribute();
    SourceFileAttribute sfB = cfB.getAttributes().getSourceFileAttribute();
    if (sfA == null && sfB == null) {
      // Add nothing, neither has a source file attribute
    } else if (sfA == null || sfB == null) {
      // Only one has a source file attribute
      if (sfA != null) {
        ClassCommentRow sfComment = new ClassCommentRow("SourceFile = " + sfA.getSourceFile());
        this.rowsA.add(sfComment);
        this.rowsAll.add(sfComment);
      }
     
      if (sfB != null) {
        ClassCommentRow sfComment = new ClassCommentRow("SourceFile = " + sfB.getSourceFile());
        this.rowsB.add(sfComment);
        this.rowsAll.add(sfComment);       
      }
     
    } else {
      // Both have source file attributes
      if (sfA.getSourceFile().equals(sfB.getSourceFile())) {
        ClassCommentRow sfComment = new ClassCommentRow("SourceFile = " + sfA.getSourceFile());
        this.rowsAll.add(sfComment);
      } else {
        ClassCommentRow sfCommentA = new ClassCommentRow("SourceFile = " + sfA.getSourceFile());
        this.rowsA.add(sfCommentA);
        this.rowsAll.add(sfCommentA);

        ClassCommentRow sfCommentB = new ClassCommentRow("SourceFile = " + sfB.getSourceFile());
        this.rowsB.add(sfCommentB);
        this.rowsAll.add(sfCommentB);
      }
    }
   
View Full Code Here

Examples of net.sf.rej.java.attribute.SourceFileAttribute

    }
   
    // Add some useful information as comments

    // Source file name
    SourceFileAttribute sf = cf.getAttributes().getSourceFileAttribute();
    if (sf != null) {
      ClassCommentRow sfComment = new ClassCommentRow("SourceFile = " + sf.getSourceFile());
      this.rows.add(sfComment);
    }
   
    // Class version
      ClassCommentRow versionComment = new ClassCommentRow("Class Version: " + cf.getMajorVersion() + "." + cf.getMinorVersion());
View Full Code Here

Examples of org.apache.harmony.pack200.bytecode.SourceFileAttribute

        .getAttributeLayout(AttributeLayout.ATTRIBUTE_SOURCE_FILE,
            AttributeLayout.CONTEXT_CLASS);
    if (SOURCE_FILE.matches(classBands.getClassFlags()[classNum])) {
      String fileName = fullName.substring(i) + ".java";
      classFile.attributes = new Attribute[] { (Attribute) cp
          .add(new SourceFileAttribute(fileName)) };
    } else {
      classFile.attributes = new Attribute[] {};
    }
    // this/superclass
    ClassFileEntry cfThis = cp.add(new CPClass(fullName));
View Full Code Here

Examples of org.apache.harmony.pack200.bytecode.SourceFileAttribute

        .getAttributeLayout(AttributeLayout.ATTRIBUTE_SOURCE_FILE,
            AttributeLayout.CONTEXT_CLASS);
    if (SOURCE_FILE.matches(classBands.getClassFlags()[classNum])) {
      String fileName = fullName.substring(i) + ".java";
      classFile.attributes = new Attribute[] { (Attribute) cp
          .add(new SourceFileAttribute(fileName)) };
    } else {
      classFile.attributes = new Attribute[] {};
    }
    // this/superclass
    ClassFileEntry cfThis = cp.add(new CPClass(fullName));
View Full Code Here

Examples of org.apache.harmony.pack200.bytecode.SourceFileAttribute

                        className = className.substring(0, index);
                    }
                    // Add .java to the end
                    value = className + ".java";
                }
                classAttributes[i].add(new SourceFileAttribute(value));
                sourceFileIndex++;
            }
            if (enclosingMethodLayout.matches(flag)) {
                // long result =
            }
View Full Code Here

Examples of org.apache.harmony.pack200.bytecode.SourceFileAttribute

    assertFalse(equal2.equals(unequal));
    assertFalse(unequal.equals(equal1));
    assertFalse(unequal.equals(equal2));
  }
  public void testSourceAttribute() {
    SourceFileAttribute sfa1 = new SourceFileAttribute(new String("Thing.java")); //$NON-NLS-1$
    SourceFileAttribute sfa2 = new SourceFileAttribute(new String("Thing.java")); //$NON-NLS-1$
    SourceFileAttribute sfa3 = new SourceFileAttribute(new String("OtherThing.java")); //$NON-NLS-1$
    checkEquality(sfa1,sfa2,"Thing.java",sfa3); //$NON-NLS-1$
  }
View Full Code Here

Examples of org.apache.harmony.pack200.bytecode.SourceFileAttribute

            fileName = fullName.substring(i, firstDollar) + ".java";
        } else {
            fileName = fullName.substring(i) + ".java";
        }
      classFile.attributes = new Attribute[] { (Attribute) cp
          .add(new SourceFileAttribute(fileName)) };
    } else {
      classFile.attributes = new Attribute[] {};
    }
    // this/superclass
    ClassFileEntry cfThis = cp.add(new CPClass(fullName));
View Full Code Here

Examples of org.apache.harmony.pack200.bytecode.SourceFileAttribute

                        className = className.substring(0, index);
                    }
                    // Add .java to the end
                    value = className + ".java";
                }
                classAttributes[i].add(new SourceFileAttribute(value));
                sourceFileIndex++;
            }
            if (enclosingMethodLayout.matches(flag)) {
                CPClass theClass = new CPClass(enclosingMethodRC[enclosingMethodIndex]);
                CPNameAndType theMethod = new CPNameAndType(enclosingMethodRDN[enclosingMethodIndex]);
View Full Code Here

Examples of org.apache.harmony.pack200.bytecode.SourceFileAttribute

    assertFalse(equal2.equals(unequal));
    assertFalse(unequal.equals(equal1));
    assertFalse(unequal.equals(equal2));
  }
  public void testSourceAttribute() {
    SourceFileAttribute sfa1 = new SourceFileAttribute(new String("Thing.java")); //$NON-NLS-1$
    SourceFileAttribute sfa2 = new SourceFileAttribute(new String("Thing.java")); //$NON-NLS-1$
    SourceFileAttribute sfa3 = new SourceFileAttribute(new String("OtherThing.java")); //$NON-NLS-1$
    checkEquality(sfa1,sfa2,"Thing.java",sfa3); //$NON-NLS-1$
  }
View Full Code Here

Examples of org.apache.harmony.pack200.bytecode.SourceFileAttribute

    int i = fullName.lastIndexOf("/") + 1; // if lastIndexOf==-1, then
    // -1+1=0, so str.substring(0)
    // == str
    String fileName = fullName.substring(i) + ".java";
    classFile.attributes = new Attribute[] { (Attribute) cp
        .add(new SourceFileAttribute(fileName)) };
    // this/superclass
    ClassFileEntry cfThis = cp.add(new CPClass(fullName));
    ClassFileEntry cfSuper = cp.add(new CPClass(classSuper[classNum]));
    // add interfaces
    ClassFileEntry cfInterfaces[] = new ClassFileEntry[classInterfaces[classNum].length];
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.