Package org.aspectj.weaver

Examples of org.aspectj.weaver.BCException


          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.");
              }
            }
View Full Code Here


    validBoxing.put("ZLjava/lang/Boolean;", "booleanValue");
  }

  public static void appendConversion(InstructionList il, InstructionFactory fact, ResolvedType fromType, ResolvedType toType) {
    if (!toType.isConvertableFrom(fromType) && !fromType.isConvertableFrom(toType)) {
      throw new BCException("can't convert from " + fromType + " to " + toType);
    }
    // XXX I'm sure this test can be simpler but my brain hurts and this
    // works
    if (!toType.getWorld().isInJava5Mode()) {
      if (toType.needsNoConversionFrom(fromType)) {
View Full Code Here

      return il;
    }

    if (fromType.equals(Type.VOID)) {
      if (toType instanceof BasicType) {
        throw new BCException("attempting to cast from void to basic type");
      }
      il.append(InstructionFactory.createNull(Type.OBJECT));
      return il;
    }
View Full Code Here

    try {
      testingParseCounter++;
      ClassParser parser = new ClassParser(new ByteArrayInputStream(bytes), filename);
      return parser.parse();
    } catch (IOException e) {
      throw new BCException("malformed class file");
    }
  }
View Full Code Here

    }
    ih.removeAllTargeters();
    try {
      il.delete(ih);
    } catch (TargetLostException e) {
      throw new BCException("this really can't happen");
    }
  }
View Full Code Here

    // assert (dupHandle.getInstruction() instanceof DUP);

    try {
      range.getBody().delete(newHandle, endHandle);
    } catch (TargetLostException e) {
      throw new BCException("shouldn't happen");
    }
  }
View Full Code Here

        // Type t = ana.getType(getEnclosingClass().getConstantPool());
        // t = new ArrayType(t,ana.getDimensions());
        // Just use a standard java.lang.object array - that will work fine
        return BcelWorld.fromBcel(new ArrayType(Type.OBJECT, ana.getDimensions()));
      }
      throw new BCException("Can't determine real target of clone() when processing instruction "
          + searchPtr.getInstruction() + ".  Perhaps avoid selecting clone with your pointcut?");
    }
    return tx;
  }
View Full Code Here

      annotations = found.getAnnotationTypes();
    }

    if (annotations == null) {
      // We can't have recognized the shadow - should blow up now to be on the safe side
      throw new BCException("Could not discover annotations for shadow: " + getKind());
    }

    for (ResolvedType annotationType : annotations) {
      AnnotationAccessVar accessVar = new AnnotationAccessVar(this, getKind(), annotationType.resolve(world), relevantType,
          annotationHolder);
View Full Code Here

   */
  LazyMethodGen extractShadowInstructionsIntoNewMethod(String extractedMethodName, int extractedMethodVisibilityModifier,
      ISourceLocation adviceSourceLocation, List<String> parameterNames) {
    // LazyMethodGen.assertGoodBody(range.getBody(), extractedMethodName);
    if (!getKind().allowsExtraction()) {
      throw new BCException("Attempt to extract method from a shadow kind (" + getKind()
          + ") that does not support this operation");
    }
    LazyMethodGen newMethod = createShadowMethodGen(extractedMethodName, extractedMethodVisibilityModifier, parameterNames);
    IntMap remapper = makeRemap();
    range.extractInstructionsInto(newMethod, remapper, (getKind() != PreInitialization) && isFallsThrough());
View Full Code Here

          if (Modifier.isStatic(enclosingMethod.getAccessFlags()) && enclosingMethod.getName().startsWith("access$")) {
            targetType = BcelWorld.fromBcel(enclosingMethod.getArgumentTypes()[0]);
          }
        } else {
          if (!targetType.resolve(world).isAssignableFrom(getThisType().resolve(world))) {
            throw new BCException("bad bytecode");
          }
          targetType = getThisType();
        }
      }
      parameterNames.add("target");
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.BCException

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.