Examples of ExceptionLabel


Examples of org.aspectj.org.eclipse.jdt.internal.compiler.codegen.ExceptionLabel

      generateMethod(classFile, aspectOfMethod, new BodyGenerator() {
        public void generate(CodeStream codeStream) {
         
          Label instanceFound = new Label(codeStream);

          ExceptionLabel anythingGoesWrong = new ExceptionLabel(codeStream,world.makeTypeBinding(UnresolvedType.JAVA_LANG_EXCEPTION));
          codeStream.aload_0()
          codeStream.invokestatic(world.makeMethodBindingForCall(AjcMemberMaker.perTypeWithinGetInstance(typeX)));
          codeStream.astore_1();
          codeStream.aload_1();
          codeStream.ifnonnull(instanceFound);
          codeStream.new_(world.makeTypeBinding(AjcMemberMaker.NO_ASPECT_BOUND_EXCEPTION));
          codeStream.dup();
         
          codeStream.ldc(typeX.getName());
          codeStream.aconst_null();
         
          codeStream.invokespecial(world.makeMethodBindingForCall(AjcMemberMaker.noAspectBoundExceptionInit2()));
          codeStream.athrow();
          instanceFound.place();
            codeStream.aload_1();
         
          codeStream.areturn();
          anythingGoesWrong.placeEnd();
          anythingGoesWrong.place();
         
          codeStream.astore_1();
          codeStream.new_(world.makeTypeBinding(AjcMemberMaker.NO_ASPECT_BOUND_EXCEPTION));
         
          codeStream.dup();
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.codegen.ExceptionLabel

  // PTWIMPL Generate hasAspect() method
  private void generatePerTypeWithinHasAspectMethod(ClassFile classFile) {
      final EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(this.scope);
      generateMethod(classFile, hasAspectMethod, new BodyGenerator() {
        public void generate(CodeStream codeStream) {
             ExceptionLabel goneBang = new ExceptionLabel(codeStream,world.makeTypeBinding(UnresolvedType.JAVA_LANG_EXCEPTION));
             Label noInstanceExists = new Label(codeStream);
             Label leave = new Label(codeStream);
             goneBang.placeStart();
             codeStream.aload_0();
             codeStream.invokestatic(world.makeMethodBinding(AjcMemberMaker.perTypeWithinGetInstance(typeX)));
             codeStream.ifnull(noInstanceExists);
             codeStream.iconst_1();
             codeStream.goto_(leave);
             noInstanceExists.place();
             codeStream.iconst_0();
             leave.place();
             goneBang.placeEnd();
             codeStream.ireturn();
             goneBang.place();
             codeStream.astore_1();
             codeStream.iconst_0();
             codeStream.ireturn();
        }});
    }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.codegen.ExceptionLabel

  private void generatePerTypeWithinGetInstanceMethod(ClassFile classFile) {
      final EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(this.scope);
      generateMethod(classFile, AjcMemberMaker.perTypeWithinGetInstance(world.fromBinding(binding)),
      new BodyGenerator() {
        public void generate(CodeStream codeStream) {
          ExceptionLabel exc = new ExceptionLabel(codeStream,world.makeTypeBinding(UnresolvedType.JAVA_LANG_EXCEPTION));
          exc.placeStart();
          codeStream.aload_0();
          codeStream.ldc(NameMangler.perTypeWithinLocalAspectOf(typeX));
          codeStream.aconst_null();
          codeStream.invokevirtual(
              new MethodBinding(
                  0,
                  "getDeclaredMethod".toCharArray(),
                  world.makeTypeBinding(UnresolvedType.forSignature("Ljava/lang/reflect/Method;")), // return type
                   new TypeBinding[]{world.makeTypeBinding(UnresolvedType.forSignature("Ljava/lang/String;")),
                                 world.makeTypeBinding(UnresolvedType.forSignature("[Ljava/lang/Class;"))},
                  new ReferenceBinding[0],
                  (ReferenceBinding)world.makeTypeBinding(UnresolvedType.JAVA_LANG_CLASS)));
          codeStream.astore_1();
          codeStream.aload_1();
          codeStream.aconst_null();
          codeStream.aconst_null();
          codeStream.invokevirtual(
              new MethodBinding(
                  0,
                  "invoke".toCharArray(),
                  world.makeTypeBinding(UnresolvedType.OBJECT),
                  new TypeBinding[]{world.makeTypeBinding(UnresolvedType.OBJECT),world.makeTypeBinding(UnresolvedType.forSignature("[Ljava/lang/Object;"))},
                  new ReferenceBinding[0],
                  (ReferenceBinding)world.makeTypeBinding(UnresolvedType.JAVA_LANG_REFLECT_METHOD)));
          codeStream.checkcast(world.makeTypeBinding(typeX));
          codeStream.astore_2();
          codeStream.aload_2();
          exc.placeEnd();
          codeStream.areturn();
          exc.place();
          codeStream.astore_1();
          // this just returns null now - the old version used to throw the caught exception!
          codeStream.aconst_null();
          codeStream.areturn();
        }});
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.codegen.ExceptionLabel

    // there is no exception table, so we need to offset by 2 the current offset and move
    // on the attribute generation
    this.contents[localContentsOffset++] = (byte) (exceptionHandlersCount >> 8);
    this.contents[localContentsOffset++] = (byte) exceptionHandlersCount;
    for (int i = 0, max = this.codeStream.exceptionLabelsCounter; i < max; i++) {
      ExceptionLabel exceptionLabel = exceptionLabels[i];
      if (exceptionLabel != null) {
        int iRange = 0, maxRange = exceptionLabel.getCount();
        if ((maxRange & 1) != 0) {
          this.codeStream.methodDeclaration.scope.problemReporter().abortDueToInternalError(
              Messages.bind(Messages.abort_invalidExceptionAttribute, new String(this.codeStream.methodDeclaration.selector)),
              this.codeStream.methodDeclaration);
        }
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.codegen.ExceptionLabel

    // there is no exception table, so we need to offset by 2 the current offset and move
    // on the attribute generation
    this.contents[localContentsOffset++] = (byte) (exceptionHandlersCount >> 8);
    this.contents[localContentsOffset++] = (byte) exceptionHandlersCount;
    for (int i = 0, max = this.codeStream.exceptionLabelsCounter; i < max; i++) {
      ExceptionLabel exceptionLabel = exceptionLabels[i];
      if (exceptionLabel != null) {
        int iRange = 0, maxRange = exceptionLabel.getCount();
        if ((maxRange & 1) != 0) {
          this.codeStream.methodDeclaration.scope.problemReporter().abortDueToInternalError(
              Messages.bind(Messages.abort_invalidExceptionAttribute, new String(this.codeStream.methodDeclaration.selector)),
              this.codeStream.methodDeclaration);
        }
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.codegen.ExceptionLabel

      // there is no exception table, so we need to offset by 2 the current offset and move
      // on the attribute generation
      this.contents[localContentsOffset++] = (byte) (exceptionHandlersCount >> 8);
      this.contents[localContentsOffset++] = (byte) exceptionHandlersCount;
      for (int i = 0, max = this.codeStream.exceptionLabelsCounter; i < max; i++) {
        ExceptionLabel exceptionLabel = exceptionLabels[i];
        if (exceptionLabel != null) {
          int iRange = 0, maxRange = exceptionLabel.getCount();
          if ((maxRange & 1) != 0) {
            this.referenceBinding.scope.problemReporter().abortDueToInternalError(
                Messages.bind(Messages.abort_invalidExceptionAttribute, new String(binding.selector),
                    this.referenceBinding.scope.problemReporter().referenceContext));
          }
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.codegen.ExceptionLabel

    // there is no exception table, so we need to offset by 2 the current offset and move
    // on the attribute generation
    this.contents[localContentsOffset++] = (byte) (exceptionHandlersCount >> 8);
    this.contents[localContentsOffset++] = (byte) exceptionHandlersCount;
    for (int i = 0, max = this.codeStream.exceptionLabelsCounter; i < max; i++) {
      ExceptionLabel exceptionLabel = exceptionLabels[i];
      if (exceptionLabel != null) {
        int iRange = 0, maxRange = exceptionLabel.getCount();
        if ((maxRange & 1) != 0) {
          if (this.codeStream.methodDeclaration != null) {
            this.codeStream.methodDeclaration.scope.problemReporter().abortDueToInternalError(
                Messages.bind(Messages.abort_invalidExceptionAttribute, new String(this.codeStream.methodDeclaration.selector)),
                this.codeStream.methodDeclaration);
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.codegen.ExceptionLabel

      declaration.getAllAnnotationContexts(targetType, localVariable, allTypeAnnotationContexts);
    }
   
    ExceptionLabel[] exceptionLabels = this.codeStream.exceptionLabels;
    for (int i = 0, max = this.codeStream.exceptionLabelsCounter; i < max; i++) {
      ExceptionLabel exceptionLabel = exceptionLabels[i];
      if (exceptionLabel.exceptionTypeReference != null && (exceptionLabel.exceptionTypeReference.bits & ASTNode.HasTypeAnnotations) != 0) {
        exceptionLabel.exceptionTypeReference.getAllAnnotationContexts(AnnotationTargetTypeConstants.EXCEPTION_PARAMETER, i, allTypeAnnotationContexts, exceptionLabel.se7Annotations);
      }
    }
   
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.codegen.ExceptionLabel

    // there is no exception table, so we need to offset by 2 the current offset and move
    // on the attribute generation
    this.contents[localContentsOffset++] = (byte) (exceptionHandlersCount >> 8);
    this.contents[localContentsOffset++] = (byte) exceptionHandlersCount;
    for (int i = 0, max = this.codeStream.exceptionLabelsCounter; i < max; i++) {
      ExceptionLabel exceptionLabel = exceptionLabels[i];
      if (exceptionLabel != null) {
        int iRange = 0, maxRange = exceptionLabel.getCount();
        if ((maxRange & 1) != 0) {
          this.codeStream.methodDeclaration.scope.problemReporter().abortDueToInternalError(
              Messages.bind(Messages.abort_invalidExceptionAttribute, new String(this.codeStream.methodDeclaration.selector)),
              this.codeStream.methodDeclaration);
        }
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.codegen.ExceptionLabel

      // there is no exception table, so we need to offset by 2 the current offset and move
      // on the attribute generation
      this.contents[localContentsOffset++] = (byte) (exceptionHandlersCount >> 8);
      this.contents[localContentsOffset++] = (byte) exceptionHandlersCount;
      for (int i = 0, max = this.codeStream.exceptionLabelsCounter; i < max; i++) {
        ExceptionLabel exceptionLabel = exceptionLabels[i];
        if (exceptionLabel != null) {
          int iRange = 0, maxRange = exceptionLabel.getCount();
          if ((maxRange & 1) != 0) {
            this.referenceBinding.scope.problemReporter().abortDueToInternalError(
                Messages.bind(Messages.abort_invalidExceptionAttribute, new String(binding.selector),
                    this.referenceBinding.scope.problemReporter().referenceContext));
          }
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.