Package org.aspectj.bridge

Examples of org.aspectj.bridge.Message


          inJar.close();
        }
        inJar.close();
      }
    } catch (FileNotFoundException ex) {
      IMessage message = new Message("Could not find input jar file " + inFile.getPath() + ", ignoring", new SourceLocation(
          inFile, 0), false);
      world.getMessageHandler().handleMessage(message);
    } catch (IOException ex) {
      IMessage message = new Message("Could not read input jar file " + inFile.getPath() + "(" + ex.getMessage() + ")",
          new SourceLocation(inFile, 0), true);
      world.getMessageHandler().handleMessage(message);
    } finally {
      if (inJar != null) {
        try {
          inJar.close();
        } catch (IOException ex) {
          IMessage message = new Message("Could not close input jar file " + inFile.getPath() + "(" + ex.getMessage()
              + ")", new SourceLocation(inFile, 0), true);
          world.getMessageHandler().handleMessage(message);
        }
      }
    }
View Full Code Here


          } catch (Exception e) {
            // recover from crash whilst producing debug string
            classDebugInfo = clazz.getClassName();
          }
          String messageText = "trouble in: \n" + classDebugInfo;
          getWorld().getMessageHandler().handleMessage(new Message(messageText, IMessage.ABORT, re, null));
        } catch (Error re) {
          String classDebugInfo = null;
          try {
            classDebugInfo = clazz.toLongString();
          } catch (Exception e) {
            // recover from crash whilst producing debug string
            classDebugInfo = clazz.getClassName();
          }
          String messageText = "trouble in: \n" + classDebugInfo;
          getWorld().getMessageHandler().handleMessage(new Message(messageText, IMessage.ABORT, re, null));
        }
      } else {
        checkDeclareTypeErrorOrWarning(world, classType);
      }
      // this is very odd return behavior trying to keep everyone happy
View Full Code Here

   * convenenience method for creating and issuing messages via the message handler - if you supply two locations you will get two
   * messages.
   */
  public void showMessage(Kind kind, String message, ISourceLocation loc1, ISourceLocation loc2) {
    if (loc1 != null) {
      messageHandler.handleMessage(new Message(message, kind, null, loc1));
      if (loc2 != null) {
        messageHandler.handleMessage(new Message(message, kind, null, loc2));
      }
    } else {
      messageHandler.handleMessage(new Message(message, kind, null, loc2));
    }
  }
View Full Code Here

            }
            if (order != 0 && order != thisOrder) {
              ISourceLocation[] isls = new ISourceLocation[2];
              isls[0] = orderer.getSourceLocation();
              isls[1] = d.getSourceLocation();
              Message m = new Message("conflicting declare precedence orderings for aspects: "
                  + firstAspect.getName() + " and " + secondAspect.getName(), null, true, isls);
              world.getMessageHandler().handleMessage(m);
            } else {
              order = thisOrder;
            }
View Full Code Here

      viewManager = new BrowserViewManager();
      optionsFrame = new OptionsFrame(iconRegistry);

      initialized = true;
    } catch (Throwable t) {
      Message error = new Message("AJDE UI failed to initialize", IMessage.ABORT, t, null);
      uiBuildMsgHandler.handleMessage(error);
    }
  }
View Full Code Here

    Runnable runner = new Runnable() {
      public void run() {
        try {
          Reflection.runMainInSameVM(props.classpath, props.mainClass, props.args);
        } catch (Throwable e) {
          Message msg = new Message("Error running " + props.mainClass, IMessage.ERROR, e, null);
          uiBuildMsgHandler.handleMessage(msg);
        }
      }
    };
    Thread result = new Thread(runner, props.mainClass);
View Full Code Here

        }
        // handle errors
        String context = props.mainClass + " command \"" + command + "\"";
        if (null != thrown) {
          String m = "Exception running " + context;
          uiBuildMsgHandler.handleMessage(new Message(m, IMessage.ERROR, thrown, null));
        } else if (0 != result) {
          String m = "Result of running " + context;
          uiBuildMsgHandler.handleMessage(new Message(m, IMessage.ERROR, null, null));
        }
        if (null != any.fromInPipe) {
          String m = "Error processing input pipe for " + context;
          uiBuildMsgHandler.handleMessage(new Message(m, IMessage.ERROR, thrown, null));
        }
        if (null != any.fromOutPipe) {
          String m = "Error processing output pipe for " + context;
          uiBuildMsgHandler.handleMessage(new Message(m, IMessage.ERROR, thrown, null));
        }
        if (null != any.fromErrPipe) {
          String m = "Error processing error pipe for " + context;
          uiBuildMsgHandler.handleMessage(new Message(m, IMessage.ERROR, thrown, null));
        }
      }
    };

    controller = LangUtil.makeProcess(controller, props.classpath, props.mainClass, props.args);
View Full Code Here

   * Ensures that the id associated with this compiler is non-null. If it is null then sends an ABORT message to the
   * messageHandler.
   */
  private boolean hasValidId() {
    if (compilerId == null) {
      Message msg = new Message("compiler didn't have an id associated with it", IMessage.ABORT, null, null);
      handler.handleMessage(msg);
      return false;
    }
    return true;
  }
View Full Code Here

   * Error reporting
   *
   * @param message
   */
  private void reportError(String message) {
    world.getMessageHandler().handleMessage(new Message(message, IMessage.ERROR, null, null));
  }
View Full Code Here

    try {
      reportProgressBegin();

      // record the options passed to the compiler if INFO turned on
      if (!msgHandlerAdapter.isIgnoring(IMessage.INFO)) {
        handleMessage(new Message(getFormattedOptionsString(), IMessage.INFO, null, null));
      }

      CompilationAndWeavingContext.reset();

      if (fullBuild) { // FULL BUILD
        AjBuildConfig buildConfig = generateAjBuildConfig();
        if (buildConfig == null) {
          return;
        }
        ajBuildManager.batchBuild(buildConfig, msgHandlerAdapter);
      } else { // INCREMENTAL BUILD
        // Only rebuild the config object if the configuration has changed
        AjBuildConfig buildConfig = null;
        ICompilerConfiguration compilerConfig = compiler.getCompilerConfiguration();
        int changes = compilerConfig.getConfigurationChanges();
        if (changes != ICompilerConfiguration.NO_CHANGES) {

          // What configuration changes can we cope with? And besides just repairing the config object
          // what does it mean for any existing state that we have?

          buildConfig = generateAjBuildConfig();
          if (buildConfig == null) {
            return;
          }
        } else {
          buildConfig = ajBuildManager.getState().getBuildConfig();
          buildConfig.setChanged(changes); // pass it through for the state to use it when making decisions
          buildConfig.setModifiedFiles(compilerConfig.getProjectSourceFilesChanged());
          buildConfig.setClasspathElementsWithModifiedContents(compilerConfig.getClasspathElementsWithModifiedContents());
          compilerConfig.configurationRead();
        }
        ajBuildManager.incrementalBuild(buildConfig, msgHandlerAdapter);
      }
      IncrementalStateManager.recordSuccessfulBuild(compiler.getId(), ajBuildManager.getState());

    } catch (ConfigParser.ParseException pe) {
      handleMessage(new Message("Config file entry invalid, file: " + pe.getFile().getPath() + ", line number: "
          + pe.getLine(), IMessage.WARNING, null, null));
    } catch (AbortException e) {
      final IMessage message = e.getIMessage();
      if (message == null) {
        handleMessage(new Message(LangUtil.unqualifiedClassName(e) + " thrown: " + e.getMessage(), IMessage.ERROR, e, null));
      } else {
        handleMessage(new Message(message.getMessage() + "\n" + CompilationAndWeavingContext.getCurrentContext(),
            IMessage.ERROR, e, null));
      }
    } catch (Throwable t) {
      handleMessage(new Message("Compile error: " + LangUtil.unqualifiedClassName(t) + " thrown: " + "" + t.getMessage(),
          IMessage.ABORT, t, null));
    } finally {
      compiler.getBuildProgressMonitor().finish(ajBuildManager.wasFullBuild());
    }
  }
View Full Code Here

TOP

Related Classes of org.aspectj.bridge.Message

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.