Package org.aspectj.apache.bcel.classfile

Examples of org.aspectj.apache.bcel.classfile.Unknown


    // first pass, look for version
    List<Unknown> forSecondPass = new ArrayList<Unknown>();
    for (int i = as.length - 1; i >= 0; i--) {
      Attribute a = as[i];
      if (a instanceof Unknown) {
        Unknown u = (Unknown) a;
        String name = u.getName();
        if (name.charAt(0) == 'o') { // 'o'rg.aspectj
          if (name.startsWith(AjAttribute.AttributePrefix)) {
            if (name.endsWith(WeaverVersionInfo.AttributeName)) {
              version = (AjAttribute.WeaverVersionInfo) AjAttribute.read(version, name, u.getBytes(), context, w,
                  dataDecompressor);
              if (version.getMajorVersion() > WeaverVersionInfo.getCurrentWeaverMajorVersion()) {
                throw new BCException(
                    "Unable to continue, this version of AspectJ supports classes built with weaver version "
                        + WeaverVersionInfo.toCurrentVersionString() + " but the class " + classname
                        + " is version " + version.toString() + ".  Please update your AspectJ.");
              }
            }
            forSecondPass.add(u);
          }
        }
      }
    }

    // FIXASC why going backwards? is it important
    for (int i = forSecondPass.size() - 1; i >= 0; i--) {
      Unknown a = forSecondPass.get(i);
      String name = a.getName();
      AjAttribute attr = AjAttribute.read(version, name, a.getBytes(), context, w, dataDecompressor);
      if (attr != null) {
        attributes.add(attr);
      }
    }
    return attributes;
View Full Code Here


  public static Attribute bcelAttribute(AjAttribute a, ConstantPool pool) {
    int nameIndex = pool.addUtf8(a.getNameString());
    byte[] bytes = a.getBytes(new BcelConstantPoolWriter(pool));
    int length = bytes.length;

    return new Unknown(nameIndex, length, bytes, pool);
  }
View Full Code Here

    // first pass, look for version
    List<Unknown> forSecondPass = new ArrayList<Unknown>();
    for (int i = as.length - 1; i >= 0; i--) {
      Attribute a = as[i];
      if (a instanceof Unknown) {
        Unknown u = (Unknown) a;
        String name = u.getName();
        if (name.charAt(0) == 'o') { // 'o'rg.aspectj
          if (name.startsWith(AjAttribute.AttributePrefix)) {
            if (name.endsWith(WeaverVersionInfo.AttributeName)) {
              version = (AjAttribute.WeaverVersionInfo) AjAttribute.read(version, name, u.getBytes(), context, w,
                  dataDecompressor);
              if (version.getMajorVersion() > WeaverVersionInfo.getCurrentWeaverMajorVersion()) {
                throw new BCException(
                    "Unable to continue, this version of AspectJ supports classes built with weaver version "
                        + WeaverVersionInfo.toCurrentVersionString() + " but the class " + classname
                        + " is version " + version.toString() + ".  Please update your AspectJ.");
              }
            }
            forSecondPass.add(u);
          }
        }
      }
    }

    // FIXASC why going backwards? is it important
    for (int i = forSecondPass.size() - 1; i >= 0; i--) {
      Unknown a = forSecondPass.get(i);
      String name = a.getName();
      AjAttribute attr = AjAttribute.read(version, name, a.getBytes(), context, w, dataDecompressor);
      if (attr != null) {
        attributes.add(attr);
      }
    }
    return attributes;
View Full Code Here

  public static Attribute bcelAttribute(AjAttribute a, ConstantPool pool) {
    int nameIndex = pool.addUtf8(a.getNameString());
    byte[] bytes = a.getBytes(new BcelConstantPoolWriter(pool));
    int length = bytes.length;

    return new Unknown(nameIndex, length, bytes, pool);
  }
View Full Code Here

    String data = getSourceDebugExtensionString();
    //System.err.println(data);
    byte[] bytes = Utility.stringToUTF(data);
    int length = bytes.length;

    return new Unknown(nameIndex, length, bytes, constantPoolGen.getConstantPool());   
 
View Full Code Here

    // first pass, look for version
    List forSecondPass = new ArrayList();
    for (int i = as.length - 1; i >= 0; i--) {
      Attribute a = as[i];
      if (a instanceof Unknown) {
        Unknown u = (Unknown) a;
        String name = u.getName();
        if (name.startsWith(AjAttribute.AttributePrefix)) {
          if (name.endsWith(WeaverVersionInfo.AttributeName)) {
            version = (AjAttribute.WeaverVersionInfo)AjAttribute.read(version,name,u.getBytes(),context,msgHandler);
            if (version.getMajorVersion() > WeaverVersionInfo.getCurrentWeaverMajorVersion()) {
              throw new BCException("Unable to continue, this version of AspectJ supports classes built with weaver version "+
                  WeaverVersionInfo.toCurrentVersionString()+" but the class "+classname+" is version "+version.toString());
            }
                    }
          forSecondPass.add(a);
        }
      }
    }
       
    for (int i = forSecondPass.size()-1; i >= 0; i--) {
      Unknown a = (Unknown)forSecondPass.get(i);
      String name = a.getName();
      AjAttribute attr = AjAttribute.read(version,name,a.getBytes(),context,msgHandler);
      if (attr!=null) l.add(attr);
    }
    return l;
  }
View Full Code Here

  public static Attribute bcelAttribute(AjAttribute a, ConstantPoolGen pool) {
    int nameIndex = pool.addUtf8(a.getNameString());
    byte[] bytes = a.getBytes();
    int length = bytes.length;

    return new Unknown(nameIndex, length, bytes, pool.getConstantPool());

  }
View Full Code Here

TOP

Related Classes of org.aspectj.apache.bcel.classfile.Unknown

Copyright © 2018 www.massapicom. 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.