Exception Fact Sheet for "jedit"

The goal of an Exception Fact Sheet is to reveal the design of exception handling in an application.

--Maxence, Martin

For feedback, please contact Martin

Table of contents

Basic Statistics

Number of Classes 1208
Number of Domain Exception Types (Thrown or Caught) 13
Number of Domain Checked Exception Types 9
Number of Domain Runtime Exception Types 4
Number of Domain Unknown Exception Types 0
nTh = Number of Throw 673
nTh = Number of Throw in Catch 249
Number of Catch-Rethrow (may not be correct) 110
nC = Number of Catch 700
nCTh = Number of Catch with Throw 181
Number of Empty Catch (really Empty) 36
Number of Empty Catch (with comments) 42
Number of Empty Catch 78
nM = Number of Methods 6927
nbFunctionWithCatch = Number of Methods with Catch 512 / 6927
nbFunctionWithThrow = Number of Methods with Throw 378 / 6927
nbFunctionWithThrowS = Number of Methods with ThrowS 493 / 6927
nbFunctionTransmitting = Number of Methods with "Throws" but NO catch, NO throw (only transmitting) 271 / 6927
P1 = nCTh / nC 25.9% (0.259)
P2 = nMC / nM 7.4% (0.074)
P3 = nbFunctionWithThrow / nbFunction 5.5% (0.055)
P4 = nbFunctionTransmitting / nbFunction 3.9% (0.039)
P5 = nbThrowInCatch / nbThrow 37% (0.37)
R2 = nCatch / nThrow 1.04
A1 = Number of Caught Exception Types From External Libraries 42
A2 = Number of Reused Exception Types From External Libraries (thrown from application code) 17

W1 is a rough estimation of the richness of the exception model. It does not take into account the inheritance relationships between domain exceptions.

Proportion P1 measures the overall exception flow. According to our experience, it varies from 5% to 70%. Early-catch design generally yields a low P1, libraries that must warn clients about errors (e.g. databases) generally have a high P1.

Proportion P2 measures the dispersion of catch blocks in the application. According to our experience, it varies from 2% to 15%. A small P2 indicates a rather centralized management of errors.

R1 shows how many exceptions types from libraries (incl. JDK) are thrown from application code. For instance, IllegalArgumentException comes from the JDK but is used in many applications.

A1 measures the awareness of the application to library exceptions. A high value of A1 means either that the application is polluted with checked exceptions or that it is able to apply specific recovery depending on the library exception.

Exception Hierachy

Exception Map

Each exception that is used at least once in the project is a dot. A orange dot represents a domain exception that is defined in the application. A blue dot exception is defined in the JDK or in a library. The x-axis represents the number of times an exception is caught, the y-axis the number of times an exception is thrown.

Exceptions With State

State means fields. Number of exceptions with state: 5
UtilTargetError
              package org.gjt.sp.jedit.bsh;public class UtilTargetError extends UtilEvalError
{
	public Throwable t;

	public UtilTargetError( String message, Throwable t ) {
		super( message );
		this.t = t;
	}

	public UtilTargetError( Throwable t ) {
		this( null, t );
	}

	/**
		Override toEvalError to throw TargetError type.
	*/
	public EvalError toEvalError( 
		String msg, SimpleNode node, CallStack callstack  ) 
	{
		if ( msg == null )
			msg = getMessage();
		else
			msg = msg + ": " + getMessage();

		return new TargetError( msg, t, node, callstack, false );
	}
}
            
TargetError
              package org.gjt.sp.jedit.bsh;public class TargetError extends EvalError 
{
	Throwable target;
	boolean inNativeCode;

	public TargetError(
		String msg, Throwable t, SimpleNode node, CallStack callstack, 
		boolean inNativeCode )
	{
		super( msg, node, callstack );
		target = t;
		this.inNativeCode = inNativeCode;
	}

	public TargetError( Throwable t, SimpleNode node, CallStack callstack )
	{
		this("TargetError", t, node, callstack, false);
	}

	public Throwable getTarget()
	{
		// check for easy mistake
		if(target instanceof InvocationTargetException)
			return((InvocationTargetException)target).getTargetException();
		else
			return target;
	}

	public String toString() 
	{
		return super.toString() 
			+ "\nTarget exception: " + 
			printTargetError( target );
	}

    public void printStackTrace() { 
		printStackTrace( false, System.err );
	}

    public void printStackTrace( PrintStream out ) { 
		printStackTrace( false, out );
	}

    public void printStackTrace( boolean debug, PrintStream out ) {
		if ( debug ) {
			super.printStackTrace( out );
			out.println("--- Target Stack Trace ---");
		}
		target.printStackTrace( out );
	}

	/**
		Generate a printable string showing the wrapped target exception.
		If the proxy mechanism is available, allow the extended print to
		check for UndeclaredThrowableException and print that embedded error.
	*/
	public String printTargetError( Throwable t ) 
	{
		String s = target.toString();

		if ( Capabilities.canGenerateInterfaces() )
			s += "\n" + xPrintTargetError( t );

		return s;
	}

	/**
		Extended form of print target error.
		This indirection is used to print UndeclaredThrowableExceptions 
		which are possible when the proxy mechanism is available.

		We are shielded from compile problems by using a bsh script.
		This is acceptable here because we're not in a critical path...
		Otherwise we'd need yet another dynamically loaded module just for this.
	*/
	public String xPrintTargetError( Throwable t ) 
	{
		String getTarget =
			"import java.lang.reflect.UndeclaredThrowableException;"+
			"String result=\"\";"+
			"while ( target instanceof UndeclaredThrowableException ) {"+
			"	target=target.getUndeclaredThrowable(); " +
			"	result+=\"Nested: \"+target.toString();" +
			"}"+
			"return result;";
		Interpreter i = new Interpreter();
		try {
			i.set("target", t);
			return (String)i.eval( getTarget );
		} catch ( EvalError e ) {
			throw new InterpreterError("xprintarget: "+e.toString() );
		}
	}

	/**
		Return true if the TargetError was generated from native code.
		e.g. if the script called into a compiled java class which threw
		the excpetion.  We distinguish so that we can print the stack trace
		for the native code case... the stack trace would not be useful if
		the exception was generated by the script.  e.g. if the script
		explicitly threw an exception... (the stack trace would simply point
		to the bsh internals which generated the exception).
	*/
	public boolean inNativeCode() { 
		return inNativeCode; 
	}
}
            
EvalError
              package org.gjt.sp.jedit.bsh;public class EvalError extends Exception 
{
	SimpleNode node;

	// Note: no way to mutate the Throwable message, must maintain our own
	String message;

	CallStack callstack;

	public EvalError( String s, SimpleNode node, CallStack callstack ) {
		setMessage(s);
		this.node = node;
		// freeze the callstack for the stack trace.
		if ( callstack != null )
			this.callstack = callstack.copy();
	}

	/**
		Print the error with line number and stack trace.
	*/
	public String toString() 
	{
		String trace;
		if ( node != null )
			trace = " : at Line: "+ node.getLineNumber() 
				+ " :\n in file: "+ node.getSourceFile()
				+ "\n : "+node.getText();
		else
			// Users should not normally see this.
			trace = ": <at unknown location>";

		if ( callstack != null )
			trace = trace +"\n" + getScriptStackTrace();

		return getMessage() + trace;
	}

	/**
		Re-throw the error, prepending the specified message.
	*/
	public void reThrow( String msg ) 
		throws EvalError 
	{
		prependMessage( msg );
		throw this;
	}

	/**
		The error has trace info associated with it. 
		i.e. It has an AST node that can print its location and source text.
	*/
	SimpleNode getNode() {
		return node;
	}

	void setNode( SimpleNode node ) {
		this.node = node;
	}

	public String getErrorText() { 
		if ( node != null )
			return node.getText() ;
		else
			return "<unknown error>";
	}

	public int getErrorLineNumber() { 
		if ( node != null )
			return node.getLineNumber() ;
		else
			return -1;
	}

	public String getErrorSourceFile() {
		if ( node != null )
			return node.getSourceFile() ;
		else
			return "<unknown file>";
	}

	public String getScriptStackTrace() 
	{
		if ( callstack == null )
			return "<Unknown>";

		String trace = "";
		CallStack stack = callstack.copy();
		while ( stack.depth() > 0 ) 
		{
			NameSpace ns = stack.pop();
			SimpleNode node = ns.getNode();
			if ( ns.isMethod )
			{
				trace = trace + "\nCalled from method: " + ns.getName();
				if ( node != null )
					trace += " : at Line: "+ node.getLineNumber() 
						+ " : in file: "+ node.getSourceFile()
						+ " : "+node.getText();
			}
		}

		return trace;
	}

	/**
		@see #toString() for a full display of the information
	*/
	public String getMessage() { return message; }

	public void setMessage( String s ) { message = s; }

	/**
		Prepend the message if it is non-null.
	*/
	protected void prependMessage( String s ) 
	{ 
		if ( s == null )
			return;

		if ( message == null )
			message = s;
		else
			message = s + " : "+ message;
	}

}
            
ParseException
              package org.gjt.sp.jedit.bsh;public class ParseException extends EvalError {
// End BeanShell Modification - public, extend EvalError

	// Begin BeanShell Modification - sourceFile

	String sourceFile = "<unknown>";

	/**
		Used to add source file info to exception
	*/
	public void setErrorSourceFile( String file ) {
		this.sourceFile = file;
	}

	public String getErrorSourceFile() { 
		return sourceFile; 
	}

	// End BeanShell Modification - sourceFile

  /**
   * This constructor is used by the method "generateParseException"
   * in the generated parser.  Calling this constructor generates
   * a new object of this type with the fields "currentToken",
   * "expectedTokenSequences", and "tokenImage" set.  The boolean
   * flag "specialConstructor" is also set to true to indicate that
   * this constructor was used to create this object.
   * This constructor calls its super class with the empty string
   * to force the "toString" method of parent class "Throwable" to
   * print the error message in the form:
   *     ParseException: <result of getMessage>
   */
  public ParseException(Token currentTokenVal,
                        int[][] expectedTokenSequencesVal,
                        String[] tokenImageVal
                       )
  {
	// Begin BeanShell Modification - constructor
	this();
	// End BeanShell Modification - constructor
    specialConstructor = true;
    currentToken = currentTokenVal;
    expectedTokenSequences = expectedTokenSequencesVal;
    tokenImage = tokenImageVal;
  }

  /**
   * The following constructors are for use by you for whatever
   * purpose you can think of.  Constructing the exception in this
   * manner makes the exception behave in the normal way - i.e., as
   * documented in the class "Throwable".  The fields "errorToken",
   * "expectedTokenSequences", and "tokenImage" do not contain
   * relevant information.  The JavaCC generated code does not use
   * these constructors.
   */

  public ParseException() {
	// Begin BeanShell Modification - constructor
	this("");
	// End BeanShell Modification - constructor
    specialConstructor = false;
  }

  public ParseException(String message) {
	// Begin BeanShell Modification - super constructor args
	// null node, null callstack, ParseException knows where the error is.
	super( message, null, null );
	// End BeanShell Modification - super constructor args
    specialConstructor = false;
  }

  /**
   * This variable determines which constructor was used to create
   * this object and thereby affects the semantics of the
   * "getMessage" method (see below).
   */
  protected boolean specialConstructor;

  /**
   * This is the last token that has been consumed successfully.  If
   * this object has been created due to a parse error, the token
   * followng this token will (therefore) be the first error token.
   */
  public Token currentToken;

  /**
   * Each entry in this array is an array of integers.  Each array
   * of integers represents a sequence of tokens (by their ordinal
   * values) that is expected at this point of the parse.
   */
  public int[][] expectedTokenSequences;

  /**
   * This is a reference to the "tokenImage" array of the generated
   * parser within which the parse error occurred.  This array is
   * defined in the generated ...Constants interface.
   */
  public String[] tokenImage;

  // Begin BeanShell Modification - moved body to overloaded getMessage()
  public String	getMessage() {
	return getMessage( false );
  }
  // End BeanShell Modification - moved body to overloaded getMessage()

  /**
   * This method has the standard behavior when this object has been
   * created using the standard constructors.  Otherwise, it uses
   * "currentToken" and "expectedTokenSequences" to generate a parse
   * error message and returns it.  If this object has been created
   * due to a parse error, and you do not catch it (it gets thrown
   * from the parser), then this method is called during the printing
   * of the final stack trace, and hence the correct error message
   * gets displayed.
   */
  // Begin BeanShell Modification - added debug param
  public String getMessage( boolean debug ) {
  // End BeanShell Modification - added debug param
    if (!specialConstructor) {
      return super.getMessage();
    }
    String expected = "";
    int maxSize = 0;
    for (int i = 0; i < expectedTokenSequences.length; i++) {
      if (maxSize < expectedTokenSequences[i].length) {
        maxSize = expectedTokenSequences[i].length;
      }
      for (int j = 0; j < expectedTokenSequences[i].length; j++) {
        expected += tokenImage[expectedTokenSequences[i][j]] + " ";
      }
      if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
        expected += "...";
      }
      expected += eol + "    ";
    }
	// Begin BeanShell Modification - added sourceFile info
    String retval = "In file: "+ sourceFile +" Encountered \"";
	// End BeanShell Modification - added sourceFile info
    Token tok = currentToken.next;
    for (int i = 0; i < maxSize; i++) {
      if (i != 0) retval += " ";
      if (tok.kind == 0) {
        retval += tokenImage[0];
        break;
      }
      retval += add_escapes(tok.image);
      tok = tok.next; 
    }
    retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn + "." + eol;

	// Begin BeanShell Modification - made conditional on debug
	if ( debug )
	{
		if (expectedTokenSequences.length == 1) {
		  retval += "Was expecting:" + eol + "    ";
		} else {
		  retval += "Was expecting one of:" + eol + "    ";
		}

		retval += expected;
	}
	// End BeanShell Modification - made conditional on debug

    return retval;
  }

  /**
   * The end of line string for this machine.
   */
  protected String eol = System.getProperty("line.separator", "\n");
 
  /**
   * Used to convert raw characters to their escaped version
   * when these raw version cannot be used as part of an ASCII
   * string literal.
   */
  protected String add_escapes(String str) {
      StringBuilder retval = new StringBuilder();
      char ch;
      for (int i = 0; i < str.length(); i++) {
        switch (str.charAt(i))
        {
           case 0 :
              continue;
           case '\b':
              retval.append("\\b");
              continue;
           case '\t':
              retval.append("\\t");
              continue;
           case '\n':
              retval.append("\\n");
              continue;
           case '\f':
              retval.append("\\f");
              continue;
           case '\r':
              retval.append("\\r");
              continue;
           case '\"':
              retval.append("\\\"");
              continue;
           case '\'':
              retval.append("\\\'");
              continue;
           case '\\':
              retval.append("\\\\");
              continue;
           default:
              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
                 String s = "0000" + Integer.toString(ch, 16);
                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
              } else {
                 retval.append(ch);
              }
              continue;
        }
      }
      return retval.toString();
   }

	// Begin BeanShell Modification - override error methods and toString

	public int getErrorLineNumber() 
	{
		return currentToken.next.beginLine;
	}

	public String getErrorText() { 
		// copied from generated getMessage()
		int	maxSize	= 0;
		for	(int i = 0; i <	expectedTokenSequences.length; i++) {
		  if (maxSize < expectedTokenSequences[i].length)
			maxSize	= expectedTokenSequences[i].length;
		}

		String retval = "";
		Token tok =	currentToken.next;
		for	(int i = 0; i <	maxSize; i++) 
		{
		  if (i != 0) retval += " ";
		  if (tok.kind == 0) {
			retval += tokenImage[0];
			break;
		  }
		  retval +=	add_escapes(tok.image);
		  tok = tok.next;
		}
		
		return retval;
	}

	public String toString() {
		return getMessage();
	}

	// End BeanShell Modification - override error methods and toString

}
            
TokenMgrError
              package org.gjt.sp.jedit.bsh;public class TokenMgrError extends Error
{
   /*
    * Ordinals for various reasons why an Error of this type can be thrown.
    */

   /**
    * Lexical error occured.
    */
   static final int LEXICAL_ERROR = 0;

   /**
    * An attempt wass made to create a second instance of a static token manager.
    */
   static final int STATIC_LEXER_ERROR = 1;

   /**
    * Tried to change to an invalid lexical state.
    */
   static final int INVALID_LEXICAL_STATE = 2;

   /**
    * Detected (and bailed out of) an infinite loop in the token manager.
    */
   static final int LOOP_DETECTED = 3;

   /**
    * Indicates the reason why the exception is thrown. It will have
    * one of the above 4 values.
    */
   int errorCode;

   /**
    * Replaces unprintable characters by their espaced (or unicode escaped)
    * equivalents in the given string
    */
   protected static final String addEscapes(String str) {
	  StringBuilder retval = new StringBuilder();
      char ch;
      for (int i = 0; i < str.length(); i++) {
        switch (str.charAt(i))
        {
           case 0 :
              continue;
           case '\b':
              retval.append("\\b");
              continue;
           case '\t':
              retval.append("\\t");
              continue;
           case '\n':
              retval.append("\\n");
              continue;
           case '\f':
              retval.append("\\f");
              continue;
           case '\r':
              retval.append("\\r");
              continue;
           case '\"':
              retval.append("\\\"");
              continue;
           case '\'':
              retval.append("\\\'");
              continue;
           case '\\':
              retval.append("\\\\");
              continue;
           default:
              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
                 String s = "0000" + Integer.toString(ch, 16);
                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
              } else {
                 retval.append(ch);
              }
              continue;
        }
      }
      return retval.toString();
   }

   /**
    * Returns a detailed message for the Error when it is thrown by the
    * token manager to indicate a lexical error.
    * Parameters : 
    *    EOFSeen     : indicates if EOF caused the lexicl error
    *    curLexState : lexical state in which this error occured
    *    errorLine   : line number when the error occured
    *    errorColumn : column number when the error occured
    *    errorAfter  : prefix that was seen before this error occured
    *    curchar     : the offending character
    * Note: You can customize the lexical error message by modifying this method.
    */
   protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
      return("Lexical error at line " +
           errorLine + ", column " +
           errorColumn + ".  Encountered: " +
           (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
           "after : \"" + addEscapes(errorAfter) + "\"");
   }

   /**
    * You can also modify the body of this method to customize your error messages.
    * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
    * of end-users concern, so you can return something like : 
    *
    *     "Internal Error : Please file a bug report .... "
    *
    * from this method for such cases in the release version of your parser.
    */
   public String getMessage() {
      return super.getMessage();
   }

   /*
    * Constructors of various flavors follow.
    */

   public TokenMgrError() {
   }

   public TokenMgrError(String message, int reason) {
      super(message);
      errorCode = reason;
   }

   public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
      this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
   }
}
            

Thrown Exceptions Summary

A (Domain) exception is defined in the application. A (Lib) exception is defined in the JDK or in a library. An exception can be thrown, thrown from within a catch, or declared in the signature of a method (usually for checked exceptions). Hovering over a number triggers showing code snippets from the application code.

Type Exception Thrown Thrown
from Catch
Declared
- Unknown 179
              
//in org/gjt/sp/jedit/bsh/BSHUnaryExpression.java
throw e.toEvalError( this, callstack );

              
//in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
throw e.toEvalError( this, callstack );

              
//in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
throw e.toEvalError( this, callstack );

              
//in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
throw e.toEvalError( 
				"Arrays may only be indexed by integer types.", 
				callerInfo, callstack );

              
//in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
throw e.toEvalError( this, callstack );

              
//in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
throw e.toEvalError( "Property: "+value, this, callstack );

              
//in org/gjt/sp/jedit/bsh/BshMethod.java
throw e2.toEvalError( "Typed method parameter assignment", 
						callerInfo, callstack  );

              
//in org/gjt/sp/jedit/bsh/BshMethod.java
throw e3.toEvalError( callerInfo, callstack );

              
//in org/gjt/sp/jedit/bsh/BshMethod.java
throw e.toEvalError(
					"Incorrect type returned from method: " 
					+ name + e.getMessage(), node, callstack );

              
//in org/gjt/sp/jedit/bsh/Reflect.java
throw e.toEvalError( callerInfo, callstack );

              
//in org/gjt/sp/jedit/bsh/Reflect.java
throw e;

              
//in org/gjt/sp/jedit/bsh/Reflect.java
throw e;

              
//in org/gjt/sp/jedit/bsh/Reflect.java
throw cantFindConstructor( clas, types );

              
//in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
throw e.toEvalError( this, callstack );

              
//in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
throw e2.toEvalError( this, callstack );

              
//in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
throw e.toEvalError( this, callstack );

              
//in org/gjt/sp/jedit/bsh/XThis.java
throw te.getTarget();

              
//in org/gjt/sp/jedit/bsh/XThis.java
throw ee;

              
//in org/gjt/sp/jedit/bsh/BSHCastExpression.java
throw e.toEvalError( this, callstack  );

              
//in org/gjt/sp/jedit/bsh/BSHPrimaryExpression.java
throw e.toEvalError( this, callstack );

              
//in org/gjt/sp/jedit/bsh/BSHTypedVariableDeclaration.java
throw e.toEvalError( this, callstack );

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw createParseException( e.getMessage() );

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte001;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte001;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte001;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw createParseException(
                                "Error or number too big for integer type: "+ literal );

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw createParseException("Error parsing character: "+x.image);

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw createParseException("Error parsing string: "+x.image);

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw generateParseException();

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw generateParseException();

              
//in org/gjt/sp/jedit/bsh/Parser.java
throw jj_ls;

              
//in org/gjt/sp/jedit/bsh/BSHTryStatement.java
throw target;

              
//in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
throw e.toEvalError( this, callstack );

              
//in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
throw e.toEvalError( this, callstack );

              
//in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
throw e.toEvalError( this, callstack );

              
//in org/gjt/sp/jedit/bsh/Name.java
throw e.toEvalError(
				"Local method invocation", callerInfo, callstack );

              
//in org/gjt/sp/jedit/bsh/Name.java
throw e.toEvalError("Error loading command: ", 
				callerInfo, callstack );

              
//in org/gjt/sp/jedit/bsh/Name.java
throw e.toEvalError(
					"Local method invocation", callerInfo, callstack );

              
//in org/gjt/sp/jedit/bsh/Name.java
throw e.toEvalError("Error invoking compiled command: ",
				callerInfo, callstack );

              
//in org/gjt/sp/jedit/bsh/BSHBinaryExpression.java
throw e.toEvalError( this, callstack  );

              
//in org/gjt/sp/jedit/bsh/BSHSwitchStatement.java
throw e.toEvalError(
					"Switch value: "+switchExp.getText()+": ", 
					this, callstack );

              
//in org/gjt/sp/jedit/bsh/Types.java
throw castError( toType, fromType, operation );

              
//in org/gjt/sp/jedit/bsh/Types.java
throw castError( toType, fromType , operation  );

              
//in org/gjt/sp/jedit/bsh/JavaCharStream.java
throw e;

              
//in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
throw noClassDefFound( name, e2 );

              
//in org/gjt/sp/jedit/bsh/BSHImportDeclaration.java
throw e.toEvalError( this, callstack  );

              
//in org/gjt/sp/jedit/bsh/EvalError.java
throw this;

              
//in org/gjt/sp/jedit/bsh/BshClassManager.java
throw noClassDefFound( name, e );

              
//in org/gjt/sp/jedit/bsh/BshClassManager.java
throw cmUnavailable();

              
//in org/gjt/sp/jedit/bsh/BshClassManager.java
throw cmUnavailable();

              
//in org/gjt/sp/jedit/bsh/BshClassManager.java
throw cmUnavailable();

              
//in org/gjt/sp/jedit/bsh/BshClassManager.java
throw cmUnavailable();

              
//in org/gjt/sp/jedit/bsh/BshClassManager.java
throw cmUnavailable();

              
//in org/gjt/sp/jedit/bsh/BshClassManager.java
throw cmUnavailable();

              
//in org/gjt/sp/jedit/bsh/BSHMethodDeclaration.java
throw e.toEvalError(this,callstack);

              
//in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
throw e.toEvalError( this, callstack );

              
//in org/gjt/sp/jedit/bsh/BSHEnhancedForStatement.java
throw e.toEvalError(
					"for loop iterator variable:"+ varName, this, callstack );

              
//in org/gjt/sp/jedit/bsh/BSHAssignment.java
throw e.toEvalError( this, callstack );

              
//in org/gjt/sp/jedit/bsh/BSHAssignment.java
throw e.toEvalError( this, callstack );

              
//in org/gjt/sp/jedit/bsh/Primitive.java
throw Types.castError( Reflect.normalizeClassName(toType), 
					"void value", operation );

              
//in org/gjt/sp/jedit/bsh/Primitive.java
throw Types.castError(
						"primitive type:" + toType, "Null value", operation );

              
//in org/gjt/sp/jedit/bsh/Primitive.java
throw Types.castError(
						"object type:" + toType, "primitive value", operation);

              
//in org/gjt/sp/jedit/bsh/Primitive.java
throw Types.castError( toType, fromType, operation );

              
//in org/gjt/sp/jedit/bsh/Primitive.java
throw Types.castError( toType, fromType, operation );

              
//in org/gjt/sp/jedit/bsh/LHS.java
throw e1;

              
//in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
throw e.toEvalError(
						"Error in array initializer", this, callstack );

              
//in org/gjt/sp/jedit/bsh/BSHClassDeclaration.java
throw e.toEvalError( this, callstack );

              
//in org/gjt/sp/jedit/bsh/Interpreter.java
throw e;

              
//in org/gjt/sp/jedit/bsh/Interpreter.java
throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() );

              
//in org/gjt/sp/jedit/bsh/Interpreter.java
throw e.toEvalError( SimpleNode.JAVACODE, callstack );

              
//in org/gjt/sp/jedit/bsh/Interpreter.java
throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() );

              
//in org/gjt/sp/jedit/BeanShellFacade.java
throw (Exception)t;

              
//in org/gjt/sp/jedit/BeanShellFacade.java
throw (Error)t;

              
//in org/gjt/sp/jedit/BeanShellFacade.java
throw (Exception)t;

              
//in org/gjt/sp/jedit/BeanShellFacade.java
throw (Error)t;

              
//in org/gjt/sp/jedit/BeanShellFacade.java
throw e;

              
//in org/gjt/sp/jedit/io/FileVFS.java
throw io;

              
//in org/gjt/sp/jedit/bufferio/BufferIORequest.java
throw wrapping;

              
//in org/gjt/sp/jedit/JARClassLoader.java
throw cnf2;

              
//in org/gjt/sp/jedit/JARClassLoader.java
throw pending;

            
- -
- Builder 59
              
// in org/gjt/sp/jedit/bsh/BSHUnaryExpression.java
throw e.toEvalError( this, callstack );

              
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
throw e.toEvalError( this, callstack );

              
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
throw e.toEvalError( this, callstack );

              
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
throw e.toEvalError( 
				"Arrays may only be indexed by integer types.", 
				callerInfo, callstack );

              
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
throw e.toEvalError( this, callstack );

              
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
throw e.toEvalError( "Property: "+value, this, callstack );

              
// in org/gjt/sp/jedit/bsh/BshMethod.java
throw e2.toEvalError( "Typed method parameter assignment", 
						callerInfo, callstack  );

              
// in org/gjt/sp/jedit/bsh/BshMethod.java
throw e3.toEvalError( callerInfo, callstack );

              
// in org/gjt/sp/jedit/bsh/BshMethod.java
throw e.toEvalError(
					"Incorrect type returned from method: " 
					+ name + e.getMessage(), node, callstack );

              
// in org/gjt/sp/jedit/bsh/Reflect.java
throw e.toEvalError( callerInfo, callstack );

              
// in org/gjt/sp/jedit/bsh/Reflect.java
throw cantFindConstructor( clas, types );

              
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
throw e.toEvalError( this, callstack );

              
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
throw e2.toEvalError( this, callstack );

              
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
throw e.toEvalError( this, callstack );

              
// in org/gjt/sp/jedit/bsh/XThis.java
throw te.getTarget();

              
// in org/gjt/sp/jedit/bsh/BSHCastExpression.java
throw e.toEvalError( this, callstack  );

              
// in org/gjt/sp/jedit/bsh/BSHPrimaryExpression.java
throw e.toEvalError( this, callstack );

              
// in org/gjt/sp/jedit/bsh/BSHTypedVariableDeclaration.java
throw e.toEvalError( this, callstack );

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw createParseException( e.getMessage() );

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw createParseException(
                                "Error or number too big for integer type: "+ literal );

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw createParseException("Error parsing character: "+x.image);

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw createParseException("Error parsing string: "+x.image);

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw generateParseException();

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw generateParseException();

              
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
throw e.toEvalError( this, callstack );

              
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
throw e.toEvalError( this, callstack );

              
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
throw e.toEvalError( this, callstack );

              
// in org/gjt/sp/jedit/bsh/Name.java
throw e.toEvalError(
				"Local method invocation", callerInfo, callstack );

              
// in org/gjt/sp/jedit/bsh/Name.java
throw e.toEvalError("Error loading command: ", 
				callerInfo, callstack );

              
// in org/gjt/sp/jedit/bsh/Name.java
throw e.toEvalError(
					"Local method invocation", callerInfo, callstack );

              
// in org/gjt/sp/jedit/bsh/Name.java
throw e.toEvalError("Error invoking compiled command: ",
				callerInfo, callstack );

              
// in org/gjt/sp/jedit/bsh/BSHBinaryExpression.java
throw e.toEvalError( this, callstack  );

              
// in org/gjt/sp/jedit/bsh/BSHSwitchStatement.java
throw e.toEvalError(
					"Switch value: "+switchExp.getText()+": ", 
					this, callstack );

              
// in org/gjt/sp/jedit/bsh/Types.java
throw castError( toType, fromType, operation );

              
// in org/gjt/sp/jedit/bsh/Types.java
throw castError( toType, fromType , operation  );

              
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
throw noClassDefFound( name, e2 );

              
// in org/gjt/sp/jedit/bsh/BSHImportDeclaration.java
throw e.toEvalError( this, callstack  );

              
// in org/gjt/sp/jedit/bsh/BshClassManager.java
throw noClassDefFound( name, e );

              
// in org/gjt/sp/jedit/bsh/BshClassManager.java
throw cmUnavailable();

              
// in org/gjt/sp/jedit/bsh/BshClassManager.java
throw cmUnavailable();

              
// in org/gjt/sp/jedit/bsh/BshClassManager.java
throw cmUnavailable();

              
// in org/gjt/sp/jedit/bsh/BshClassManager.java
throw cmUnavailable();

              
// in org/gjt/sp/jedit/bsh/BshClassManager.java
throw cmUnavailable();

              
// in org/gjt/sp/jedit/bsh/BshClassManager.java
throw cmUnavailable();

              
// in org/gjt/sp/jedit/bsh/BSHMethodDeclaration.java
throw e.toEvalError(this,callstack);

              
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
throw e.toEvalError( this, callstack );

              
// in org/gjt/sp/jedit/bsh/BSHEnhancedForStatement.java
throw e.toEvalError(
					"for loop iterator variable:"+ varName, this, callstack );

              
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
throw e.toEvalError( this, callstack );

              
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
throw e.toEvalError( this, callstack );

              
// in org/gjt/sp/jedit/bsh/Primitive.java
throw Types.castError( Reflect.normalizeClassName(toType), 
					"void value", operation );

              
// in org/gjt/sp/jedit/bsh/Primitive.java
throw Types.castError(
						"primitive type:" + toType, "Null value", operation );

              
// in org/gjt/sp/jedit/bsh/Primitive.java
throw Types.castError(
						"object type:" + toType, "primitive value", operation);

              
// in org/gjt/sp/jedit/bsh/Primitive.java
throw Types.castError( toType, fromType, operation );

              
// in org/gjt/sp/jedit/bsh/Primitive.java
throw Types.castError( toType, fromType, operation );

              
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
throw e.toEvalError(
						"Error in array initializer", this, callstack );

              
// in org/gjt/sp/jedit/bsh/BSHClassDeclaration.java
throw e.toEvalError( this, callstack );

              
// in org/gjt/sp/jedit/bsh/Interpreter.java
throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() );

              
// in org/gjt/sp/jedit/bsh/Interpreter.java
throw e.toEvalError( SimpleNode.JAVACODE, callstack );

              
// in org/gjt/sp/jedit/bsh/Interpreter.java
throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() );

            
- -
- Variable 120
              
// in org/gjt/sp/jedit/bsh/Reflect.java
throw e;

              
// in org/gjt/sp/jedit/bsh/Reflect.java
throw e;

              
// in org/gjt/sp/jedit/bsh/XThis.java
throw ee;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte001;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte001;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte001;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (RuntimeException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (ParseException)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw (Error)jjte000;

              
// in org/gjt/sp/jedit/bsh/Parser.java
throw jj_ls;

              
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
throw target;

              
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
throw e;

              
// in org/gjt/sp/jedit/bsh/EvalError.java
throw this;

              
// in org/gjt/sp/jedit/bsh/LHS.java
throw e1;

              
// in org/gjt/sp/jedit/bsh/Interpreter.java
throw e;

              
// in org/gjt/sp/jedit/BeanShellFacade.java
throw (Exception)t;

              
// in org/gjt/sp/jedit/BeanShellFacade.java
throw (Error)t;

              
// in org/gjt/sp/jedit/BeanShellFacade.java
throw (Exception)t;

              
// in org/gjt/sp/jedit/BeanShellFacade.java
throw (Error)t;

              
// in org/gjt/sp/jedit/BeanShellFacade.java
throw e;

              
// in org/gjt/sp/jedit/io/FileVFS.java
throw io;

              
// in org/gjt/sp/jedit/bufferio/BufferIORequest.java
throw wrapping;

              
// in org/gjt/sp/jedit/JARClassLoader.java
throw cnf2;

              
// in org/gjt/sp/jedit/JARClassLoader.java
throw pending;

            
- -
(Domain) InterpreterError 90
              
// in org/gjt/sp/jedit/bsh/BSHUnaryExpression.java
private Object primitiveWrapperUnaryOperation(Object val, int kind) throws UtilEvalError { Class operandType = val.getClass(); Object operand = Primitive.promoteToInteger(val); if ( operand instanceof Boolean ) return new Boolean( Primitive.booleanUnaryOperation((Boolean)operand, kind)); else if ( operand instanceof Integer ) { int result = Primitive.intUnaryOperation((Integer)operand, kind); // ++ and -- must be cast back the original type if(kind == INCR || kind == DECR) { if(operandType == Byte.TYPE) return new Byte((byte)result); if(operandType == Short.TYPE) return new Short((short)result); if(operandType == Character.TYPE) return new Character((char)result); } return new Integer(result); } else if(operand instanceof Long) return new Long(Primitive.longUnaryOperation((Long)operand, kind)); else if(operand instanceof Float) return new Float(Primitive.floatUnaryOperation((Float)operand, kind)); else if(operand instanceof Double) return new Double(Primitive.doubleUnaryOperation((Double)operand, kind)); else throw new InterpreterError("An error occurred. Please call technical support."); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
public Object doSuffix( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError { // Handle ".class" suffix operation // Prefix must be a BSHType if ( operation == CLASS ) if ( obj instanceof BSHType ) { if ( toLHS ) throw new EvalError("Can't assign .class", this, callstack ); NameSpace namespace = callstack.top(); return ((BSHType)obj).getType( callstack, interpreter ); } else throw new EvalError( "Attempt to use .class suffix on non class.", this, callstack ); /* Evaluate our prefix if it needs evaluating first. If this is the first evaluation our prefix mayb be a Node (directly from the PrimaryPrefix) - eval() it to an object. If it's an LHS, resolve to a value. Note: The ambiguous name construct is now necessary where the node may be an ambiguous name. If this becomes common we might want to make a static method nodeToObject() or something. The point is that we can't just eval() - we need to direct the evaluation to the context sensitive type of result; namely object, class, etc. */ if ( obj instanceof SimpleNode ) if ( obj instanceof BSHAmbiguousName ) obj = ((BSHAmbiguousName)obj).toObject(callstack, interpreter); else obj = ((SimpleNode)obj).eval(callstack, interpreter); else if ( obj instanceof LHS ) try { obj = ((LHS)obj).getValue(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } try { switch(operation) { case INDEX: return doIndex( obj, toLHS, callstack, interpreter ); case NAME: return doName( obj, toLHS, callstack, interpreter ); case PROPERTY: return doProperty( toLHS, obj, callstack, interpreter ); default: throw new InterpreterError( "Unknown suffix type" ); } } catch(ReflectError e) { throw new EvalError("reflection error: " + e, this, callstack ); } catch(InvocationTargetException e) { throw new TargetError( "target exception", e.getTargetException(), this, callstack, true); } }
// in org/gjt/sp/jedit/bsh/BshMethod.java
Object invoke( Object[] argValues, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean overrideNameSpace ) throws EvalError { if ( argValues != null ) for (int i=0; i<argValues.length; i++) if ( argValues[i] == null ) throw new Error("HERE!"); if ( javaMethod != null ) try { return Reflect.invokeMethod( javaMethod, javaObject, argValues ); } catch ( ReflectError e ) { throw new EvalError( "Error invoking Java method: "+e, callerInfo, callstack ); } catch ( InvocationTargetException e2 ) { throw new TargetError( "Exception invoking imported object method.", e2, callerInfo, callstack, true/*isNative*/ ); } // is this a syncrhonized method? if ( modifiers != null && modifiers.hasModifier("synchronized") ) { // The lock is our declaring namespace's This reference // (the method's 'super'). Or in the case of a class it's the // class instance. Object lock; if ( declaringNameSpace.isClass ) { try { lock = declaringNameSpace.getClassInstance(); } catch ( UtilEvalError e ) { throw new InterpreterError( "Can't get class instance for synchronized method."); } } else lock = declaringNameSpace.getThis(interpreter); // ??? synchronized( lock ) { return invokeImpl( argValues, interpreter, callstack, callerInfo, overrideNameSpace ); } } else return invokeImpl( argValues, interpreter, callstack, callerInfo, overrideNameSpace ); }
// in org/gjt/sp/jedit/bsh/This.java
static This getThis( NameSpace namespace, Interpreter declaringInterpreter ) { try { Class c; if ( Capabilities.canGenerateInterfaces() ) c = Class.forName( "org.gjt.sp.jedit.bsh.XThis" ); else if ( Capabilities.haveSwing() ) c = Class.forName( "org.gjt.sp.jedit.bsh.JThis" ); else return new This( namespace, declaringInterpreter ); return (This)Reflect.constructObject( c, new Object [] { namespace, declaringInterpreter } ); } catch ( Exception e ) { throw new InterpreterError("internal error 1 in This: "+e); } }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
public static Class generateClassImpl( String name, Modifiers modifiers, Class [] interfaces, Class superClass, BSHBlock block, boolean isInterface, CallStack callstack, Interpreter interpreter ) throws EvalError { // Scripting classes currently requires accessibility // This can be eliminated with a bit more work. try { Capabilities.setAccessibility( true ); } catch ( Capabilities.Unavailable e ) { throw new EvalError( "Defining classes currently requires reflective Accessibility.", block, callstack ); } NameSpace enclosingNameSpace = callstack.top(); String packageName = enclosingNameSpace.getPackage(); String className = enclosingNameSpace.isClass ? ( enclosingNameSpace.getName()+"$"+name ) : name; String fqClassName = packageName == null ? className : packageName + "." + className; BshClassManager bcm = interpreter.getClassManager(); // Race condition here... bcm.definingClass( fqClassName ); // Create the class static namespace NameSpace classStaticNameSpace = new NameSpace( enclosingNameSpace, className); classStaticNameSpace.isClass = true; callstack.push( classStaticNameSpace ); // Evaluate any inner class class definitions in the block // effectively recursively call this method for contained classes first block.evalBlock( callstack, interpreter, true/*override*/, ClassNodeFilter.CLASSCLASSES ); // Generate the type for our class Variable [] variables = getDeclaredVariables( block, callstack, interpreter, packageName ); DelayedEvalBshMethod [] methods = getDeclaredMethods( block, callstack, interpreter, packageName ); ClassGeneratorUtil classGenerator = new ClassGeneratorUtil( modifiers, className, packageName, superClass, interfaces, variables, methods, classStaticNameSpace, isInterface ); byte [] code = classGenerator.generateClass(); // if debug, write out the class file to debugClasses directory String dir = System.getProperty("debugClasses"); if ( dir != null ) try { FileOutputStream out= new FileOutputStream( dir+"/"+className+".class" ); out.write(code); out.close(); } catch ( IOException e ) { } // Define the new class in the classloader Class genClass = bcm.defineClass( fqClassName, code ); // import the unq name into parent enclosingNameSpace.importClass( fqClassName.replace('$','.') ); try { classStaticNameSpace.setLocalVariable( ClassGeneratorUtil.BSHINIT, block, false/*strictJava*/ ); } catch ( UtilEvalError e ) { throw new InterpreterError("unable to init static: "+e ); } // Give the static space its class static import // important to do this after all classes are defined classStaticNameSpace.setClassStatic( genClass ); // evaluate the static portion of the block in the static space block.evalBlock( callstack, interpreter, true/*override*/, ClassNodeFilter.CLASSSTATIC ); callstack.pop(); if ( !genClass.isInterface() ) { // Set the static bsh This callback String bshStaticFieldName = ClassGeneratorUtil.BSHSTATIC+className; try { LHS lhs = Reflect.getLHSStaticField( genClass, bshStaticFieldName ); lhs.assign( classStaticNameSpace.getThis( interpreter ), false/*strict*/ ); } catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); } } bcm.doneDefiningClass( fqClassName ); return genClass; }
// in org/gjt/sp/jedit/bsh/Reflect.java
static Object invokeMethod( Method method, Object object, Object[] args ) throws ReflectError, InvocationTargetException { if ( args == null ) args = new Object[0]; logInvokeMethod( "Invoking method (entry): ", method, args ); // Map types to assignable forms, need to keep this fast... Object [] tmpArgs = new Object [ args.length ]; Class [] types = method.getParameterTypes(); try { for (int i=0; i<args.length; i++) tmpArgs[i] = Types.castObject( args[i]/*rhs*/, types[i]/*lhsType*/, Types.ASSIGNMENT ); } catch ( UtilEvalError e ) { throw new InterpreterError( "illegal argument type in method invocation: "+e ); } // unwrap any primitives tmpArgs = Primitive.unwrap( tmpArgs ); logInvokeMethod( "Invoking method (after massaging values): ", method, tmpArgs ); try { Object returnValue = method.invoke( object, tmpArgs ); if ( returnValue == null ) returnValue = Primitive.NULL; Class returnType = method.getReturnType(); return Primitive.wrap( returnValue, returnType ); } catch( IllegalAccessException e ) { throw new ReflectError( "Cannot access method " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " in '" + method.getDeclaringClass() + "' :" + e ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Method resolveJavaMethod( BshClassManager bcm, Class clas, String name, Class [] types, boolean staticOnly ) throws UtilEvalError { if ( clas == null ) throw new InterpreterError("null class"); // Lookup previously cached method Method method = null; if ( bcm == null ) Interpreter.debug("resolveJavaMethod UNOPTIMIZED lookup"); else method = bcm.getResolvedMethod( clas, name, types, staticOnly ); if ( method == null ) { boolean publicOnly = !Capabilities.haveAccessibility(); // Searching for the method may, itself be a priviledged action try { method = findOverloadedMethod( clas, name, types, publicOnly ); } catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching methods of: "+clas, e ); } checkFoundStaticMethod( method, staticOnly, clas ); // This is the first time we've seen this method, set accessibility // Note: even if it's a public method, we may have found it in a // non-public class if ( method != null && !publicOnly ) { try { ReflectManager.RMSetAccessible( method ); } catch ( UtilEvalError e ) { /*ignore*/ } } // If succeeded cache the resolved method. if ( method != null && bcm != null ) bcm.cacheResolvedMethod( clas, types, method ); } return method; }
// in org/gjt/sp/jedit/bsh/SimpleNode.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { throw new InterpreterError( "Unimplemented or inappropriate for " + getClass().getName() ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { throw new InterpreterError( "Don't know how to eval an ambiguous name!" +" Use toObject() if you want an object." ); }
// in org/gjt/sp/jedit/bsh/BSHLiteral.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { if ( value == null ) throw new InterpreterError("Null in bsh literal: "+value); return value; }
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { BSHBlock tryBlock = ((BSHBlock)jjtGetChild(0)); Vector catchParams = new Vector(); Vector catchBlocks = new Vector(); int nchild = jjtGetNumChildren(); Node node = null; int i=1; while((i < nchild) && ((node = jjtGetChild(i++)) instanceof BSHFormalParameter)) { catchParams.addElement(node); catchBlocks.addElement(jjtGetChild(i++)); node = null; } // finaly block BSHBlock finallyBlock = null; if(node != null) finallyBlock = (BSHBlock)node; // Why both of these? TargetError target = null; Throwable thrown = null; Object ret = null; /* Evaluate the contents of the try { } block and catch any resulting TargetErrors generated by the script. We save the callstack depth and if an exception is thrown we pop back to that depth before contiuing. The exception short circuited any intervening method context pops. Note: we the stack info... what do we do with it? append to exception message? */ int callstackDepth = callstack.depth(); try { ret = tryBlock.eval(callstack, interpreter); } catch( TargetError e ) { target = e; String stackInfo = "Bsh Stack: "; while ( callstack.depth() > callstackDepth ) stackInfo += "\t" + callstack.pop() +"\n"; } // unwrap the target error if ( target != null ) thrown = target.getTarget(); // If we have an exception, find a catch if (thrown != null) { int n = catchParams.size(); for(i=0; i<n; i++) { // Get catch block BSHFormalParameter fp = (BSHFormalParameter)catchParams.elementAt(i); // Should cache this subject to classloader change message // Evaluation of the formal parameter simply resolves its // type via the specified namespace.. it doesn't modify the // namespace. fp.eval( callstack, interpreter ); if ( fp.type == null && interpreter.getStrictJava() ) throw new EvalError( "(Strict Java) Untyped catch block", this, callstack ); // If the param is typed check assignability if ( fp.type != null ) try { thrown = (Throwable)Types.castObject( thrown/*rsh*/, fp.type/*lhsType*/, Types.ASSIGNMENT ); } catch( UtilEvalError e ) { /* Catch the mismatch and continue to try the next Note: this is innefficient, should have an isAssignableFrom() that doesn't throw // TODO: we do now have a way to test assignment // in castObject(), use it? */ continue; } // Found match, execute catch block BSHBlock cb = (BSHBlock)(catchBlocks.elementAt(i)); // Prepare to execute the block. // We must create a new BlockNameSpace to hold the catch // parameter and swap it on the stack after initializing it. NameSpace enclosingNameSpace = callstack.top(); BlockNameSpace cbNameSpace = new BlockNameSpace( enclosingNameSpace ); try { if ( fp.type == BSHFormalParameter.UNTYPED ) // set an untyped variable directly in the block cbNameSpace.setBlockVariable( fp.name, thrown ); else { // set a typed variable (directly in the block) Modifiers modifiers = new Modifiers(); cbNameSpace.setTypedVariable( fp.name, fp.type, thrown, new Modifiers()/*none*/ ); } } catch ( UtilEvalError e ) { throw new InterpreterError( "Unable to set var in catch block namespace." ); } // put cbNameSpace on the top of the stack callstack.swap( cbNameSpace ); try { ret = cb.eval( callstack, interpreter ); } finally { // put it back callstack.swap( enclosingNameSpace ); } target = null; // handled target break; } } // evaluate finally block if(finallyBlock != null) ret = finallyBlock.eval(callstack, interpreter); // exception fell through, throw it upward... if(target != null) throw target; if(ret instanceof ReturnControl) return ret; else return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/Name.java
synchronized public Object toObject( CallStack callstack, Interpreter interpreter, boolean forceClass ) throws UtilEvalError { reset(); Object obj = null; while( evalName != null ) obj = consumeNextObjectField( callstack, interpreter, forceClass, false/*autoalloc*/ ); if ( obj == null ) throw new InterpreterError("null value in toObject()"); return obj; }
// in org/gjt/sp/jedit/bsh/Name.java
private Object completeRound( String lastEvalName, String nextEvalName, Object returnObject ) { if ( returnObject == null ) throw new InterpreterError("lastEvalName = "+lastEvalName); this.lastEvalName = lastEvalName; this.evalName = nextEvalName; this.evalBaseObject = returnObject; return returnObject; }
// in org/gjt/sp/jedit/bsh/Name.java
Object resolveThisFieldReference( CallStack callstack, NameSpace thisNameSpace, Interpreter interpreter, String varName, boolean specialFieldsVisible ) throws UtilEvalError { if ( varName.equals("this") ) { /* Somewhat of a hack. If the special fields are visible (we're operating relative to a 'this' type already) dissallow further .this references to prevent user from skipping to things like super.this.caller */ if ( specialFieldsVisible ) throw new UtilEvalError("Redundant to call .this on This type"); // Allow getThis() to work through BlockNameSpace to the method // namespace // XXX re-eval this... do we need it? This ths = thisNameSpace.getThis( interpreter ); thisNameSpace= ths.getNameSpace(); Object result = ths; NameSpace classNameSpace = getClassNameSpace( thisNameSpace ); if ( classNameSpace != null ) { if ( isCompound( evalName ) ) result = classNameSpace.getThis( interpreter ); else result = classNameSpace.getClassInstance(); } return result; } /* Some duplication for "super". See notes for "this" above If we're in an enclsing class instance and have a superclass instance our super is the superclass instance. */ if ( varName.equals("super") ) { //if ( specialFieldsVisible ) //throw new UtilEvalError("Redundant to call .this on This type"); // Allow getSuper() to through BlockNameSpace to the method's super This ths = thisNameSpace.getSuper( interpreter ); thisNameSpace = ths.getNameSpace(); // super is now the closure's super or class instance // XXXX re-evaluate this // can getSuper work by itself now? // If we're a class instance and the parent is also a class instance // then super means our parent. if ( thisNameSpace.getParent() != null && thisNameSpace.getParent().isClass ) ths = thisNameSpace.getParent().getThis( interpreter ); return ths; } Object obj = null; if ( varName.equals("global") ) obj = thisNameSpace.getGlobal( interpreter ); if ( obj == null && specialFieldsVisible ) { if (varName.equals("namespace")) obj = thisNameSpace; else if (varName.equals("variables")) obj = thisNameSpace.getVariableNames(); else if (varName.equals("methods")) obj = thisNameSpace.getMethodNames(); else if ( varName.equals("interpreter") ) if ( lastEvalName.equals("this") ) obj = interpreter; else throw new UtilEvalError( "Can only call .interpreter on literal 'this'"); } if ( obj == null && specialFieldsVisible && varName.equals("caller") ) { if ( lastEvalName.equals("this") || lastEvalName.equals("caller") ) { // get the previous context (see notes for this class) if ( callstack == null ) throw new InterpreterError("no callstack"); obj = callstack.get( ++callstackDepth ).getThis( interpreter ); } else throw new UtilEvalError( "Can only call .caller on literal 'this' or literal '.caller'"); // early return return obj; } if ( obj == null && specialFieldsVisible && varName.equals("callstack") ) { if ( lastEvalName.equals("this") ) { // get the previous context (see notes for this class) if ( callstack == null ) throw new InterpreterError("no callstack"); obj = callstack; } else throw new UtilEvalError( "Can only call .callstack on literal 'this'"); } if ( obj == null ) obj = thisNameSpace.getVariable(varName); if ( obj == null ) throw new InterpreterError("null this field ref:"+varName); return obj; }
// in org/gjt/sp/jedit/bsh/Name.java
synchronized public LHS toLHS( CallStack callstack, Interpreter interpreter ) throws UtilEvalError { // Should clean this up to a single return statement reset(); LHS lhs; // Simple (non-compound) variable assignment e.g. x=5; if ( !isCompound(evalName) ) { if ( evalName.equals("this") ) throw new UtilEvalError("Can't assign to 'this'." ); // Interpreter.debug("Simple var LHS..."); lhs = new LHS( namespace, evalName, false/*bubble up if allowed*/); return lhs; } // Field e.g. foo.bar=5; Object obj = null; try { while( evalName != null && isCompound( evalName ) ) { obj = consumeNextObjectField( callstack, interpreter, false/*forcclass*/, true/*autoallocthis*/ ); } } catch( UtilEvalError e ) { throw new UtilEvalError( "LHS evaluation: " + e.getMessage() ); } // Finished eval and its a class. if ( evalName == null && obj instanceof ClassIdentifier ) throw new UtilEvalError("Can't assign to class: " + value ); if ( obj == null ) throw new UtilEvalError("Error in LHS: " + value ); // e.g. this.x=5; or someThisType.x=5; if ( obj instanceof This ) { // dissallow assignment to magic fields if ( evalName.equals("namespace") || evalName.equals("variables") || evalName.equals("methods") || evalName.equals("caller") ) throw new UtilEvalError( "Can't assign to special variable: "+evalName ); Interpreter.debug("found This reference evaluating LHS"); /* If this was a literal "super" reference then we allow recursion in setting the variable to get the normal effect of finding the nearest definition starting at the super scope. On any other resolution qualified by a 'this' type reference we want to set the variable directly in that scope. e.g. this.x=5; or someThisType.x=5; In the old scoping rules super didn't do this. */ boolean localVar = !lastEvalName.equals("super"); return new LHS( ((This)obj).namespace, evalName, localVar ); } if ( evalName != null ) { try { if ( obj instanceof ClassIdentifier ) { Class clas = ((ClassIdentifier)obj).getTargetClass(); lhs = Reflect.getLHSStaticField(clas, evalName); return lhs; } else { lhs = Reflect.getLHSObjectField(obj, evalName); return lhs; } } catch(ReflectError e) { throw new UtilEvalError("Field access: "+e); } } throw new InterpreterError("Internal error in lhs..."); }
// in org/gjt/sp/jedit/bsh/Name.java
private Object invokeLocalMethod( Interpreter interpreter, Object[] args, CallStack callstack, SimpleNode callerInfo ) throws EvalError/*, ReflectError, InvocationTargetException*/ { if ( Interpreter.DEBUG ) Interpreter.debug( "invokeLocalMethod: " + value ); if ( interpreter == null ) throw new InterpreterError( "invokeLocalMethod: interpreter = null"); String commandName = value; Class [] argTypes = Types.getTypes( args ); // Check for existing method BshMethod meth = null; try { meth = namespace.getMethod( commandName, argTypes ); } catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); } // If defined, invoke it if ( meth != null ) return meth.invoke( args, interpreter, callstack, callerInfo ); BshClassManager bcm = interpreter.getClassManager(); // Look for a BeanShell command Object commandObject; try { commandObject = namespace.getCommand( commandName, argTypes, interpreter ); } catch ( UtilEvalError e ) { throw e.toEvalError("Error loading command: ", callerInfo, callstack ); } // should try to print usage here if nothing found if ( commandObject == null ) { // Look for a default invoke() handler method in the namespace // Note: this code duplicates that in This.java... should it? // Call on 'This' can never be a command BshMethod invokeMethod = null; try { invokeMethod = namespace.getMethod( "invoke", new Class [] { null, null } ); } catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); } if ( invokeMethod != null ) return invokeMethod.invoke( new Object [] { commandName, args }, interpreter, callstack, callerInfo ); throw new EvalError( "Command not found: " +StringUtil.methodString( commandName, argTypes ), callerInfo, callstack ); } if ( commandObject instanceof BshMethod ) return ((BshMethod)commandObject).invoke( args, interpreter, callstack, callerInfo ); if ( commandObject instanceof Class ) try { return Reflect.invokeCompiledCommand( ((Class)commandObject), args, interpreter, callstack ); } catch ( UtilEvalError e ) { throw e.toEvalError("Error invoking compiled command: ", callerInfo, callstack ); } throw new InterpreterError("invalid command type"); }
// in org/gjt/sp/jedit/bsh/ExternalNameSpace.java
protected void putExternalMap( String name, Object value ) { if ( value instanceof Variable ) try { value = unwrapVariable( (Variable)value ); } catch ( UtilEvalError ute ) { // There should be no case for this. unwrapVariable throws // UtilEvalError in some cases where it holds an LHS or array // index. throw new InterpreterError("unexpected UtilEvalError"); } if ( value instanceof Primitive ) value = Primitive.unwrap( (Primitive)value ); externalMap.put( name, value ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
public static ConstructorArgs getConstructorArgs( String superClassName, This classStaticThis, Object [] consArgs, int index ) { DelayedEvalBshMethod [] constructors; try { constructors = (DelayedEvalBshMethod [])classStaticThis.getNameSpace() .getVariable( BSHCONSTRUCTORS ); } catch ( Exception e ) { throw new InterpreterError( "unable to get instance initializer: "+e ); } if ( index == DEFAULTCONSTRUCTOR ) // auto-gen default constructor return ConstructorArgs.DEFAULT; // use default super constructor DelayedEvalBshMethod constructor = constructors[index]; if ( constructor.methodBody.jjtGetNumChildren() == 0 ) return ConstructorArgs.DEFAULT; // use default super constructor // Determine if the constructor calls this() or super() String altConstructor = null; BSHArguments argsNode = null; SimpleNode firstStatement = (SimpleNode)constructor.methodBody.jjtGetChild(0); if ( firstStatement instanceof BSHPrimaryExpression ) firstStatement = (SimpleNode)firstStatement.jjtGetChild(0); if ( firstStatement instanceof BSHMethodInvocation ) { BSHMethodInvocation methodNode = (BSHMethodInvocation)firstStatement; BSHAmbiguousName methodName = methodNode.getNameNode(); if ( methodName.text.equals("super") || methodName.text.equals("this") ) { altConstructor = methodName.text; argsNode = methodNode.getArgsNode(); } } if ( altConstructor == null ) return ConstructorArgs.DEFAULT; // use default super constructor // Make a tmp namespace to hold the original constructor args for // use in eval of the parameters node NameSpace consArgsNameSpace = new NameSpace( classStaticThis.getNameSpace(), "consArgs" ); String [] consArgNames = constructor.getParameterNames(); Class [] consArgTypes = constructor.getParameterTypes(); for( int i=0; i<consArgs.length; i++ ) { try { consArgsNameSpace.setTypedVariable( consArgNames[i], consArgTypes[i], consArgs[i], null/*modifiers*/); } catch ( UtilEvalError e ) { throw new InterpreterError("err setting local cons arg:"+e); } } // evaluate the args CallStack callstack = new CallStack(); callstack.push( consArgsNameSpace); Object [] args = null; Interpreter interpreter = classStaticThis.declaringInterpreter; try { args = argsNode.getArguments( callstack, interpreter ); } catch ( EvalError e ) { throw new InterpreterError( "Error evaluating constructor args: "+e ); } Class [] argTypes = Types.getTypes( args ); args = Primitive.unwrap( args ); Class superClass = interpreter.getClassManager().classForName( superClassName ); if ( superClass == null ) throw new InterpreterError( "can't find superclass: "+superClassName ); Constructor [] superCons = superClass.getDeclaredConstructors(); // find the matching super() constructor for the args if ( altConstructor.equals("super") ) { int i = Reflect.findMostSpecificConstructorIndex( argTypes , superCons ); if ( i == -1 ) throw new InterpreterError("can't find constructor for args!"); return new ConstructorArgs( i, args ); } // find the matching this() constructor for the args Class [][] candidates = new Class [ constructors.length ] []; for(int i=0; i< candidates.length; i++ ) candidates[i] = constructors[i].getParameterTypes(); int i = Reflect.findMostSpecificSignature( argTypes, candidates ); if ( i == -1 ) throw new InterpreterError("can't find constructor for args 2!"); // this() constructors come after super constructors in the table int selector = i+superCons.length; int ourSelector = index+superCons.length; // Are we choosing ourselves recursively through a this() reference? if ( selector == ourSelector ) throw new InterpreterError( "Recusive constructor call."); return new ConstructorArgs( selector, args ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
public static void initInstance( Object instance, String className, Object [] args ) { Class [] sig = Types.getTypes( args ); CallStack callstack = new CallStack(); Interpreter interpreter; NameSpace instanceNameSpace; // check to see if the instance has already been initialized // (the case if using a this() alternate constuctor) This instanceThis = getClassInstanceThis( instance, className ); // XXX clean up this conditional if ( instanceThis == null ) { // Create the instance 'This' namespace, set it on the object // instance and invoke the instance initializer // Get the static This reference from the proto-instance This classStaticThis = getClassStaticThis( instance.getClass(), className ); interpreter = classStaticThis.declaringInterpreter; // Get the instance initializer block from the static This BSHBlock instanceInitBlock; try { instanceInitBlock = (BSHBlock)classStaticThis.getNameSpace() .getVariable( BSHINIT ); } catch ( Exception e ) { throw new InterpreterError( "unable to get instance initializer: "+e ); } // Create the instance namespace instanceNameSpace = new NameSpace( classStaticThis.getNameSpace(), className ); instanceNameSpace.isClass = true; // Set the instance This reference on the instance instanceThis = instanceNameSpace.getThis( interpreter ); try { LHS lhs = Reflect.getLHSObjectField( instance, BSHTHIS+className ); lhs.assign( instanceThis, false/*strict*/ ); } catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); } // Give the instance space its object import instanceNameSpace.setClassInstance( instance ); // should use try/finally here to pop ns callstack.push( instanceNameSpace ); // evaluate the instance portion of the block in it try { // Evaluate the initializer block instanceInitBlock.evalBlock( callstack, interpreter, true/*override*/, ClassGeneratorImpl.ClassNodeFilter.CLASSINSTANCE ); } catch ( Exception e ) { throw new InterpreterError("Error in class initialization: "+e); } callstack.pop(); } else { // The object instance has already been initialzed by another // constructor. Fall through to invoke the constructor body below. interpreter = instanceThis.declaringInterpreter; instanceNameSpace = instanceThis.getNameSpace(); } // invoke the constructor method from the instanceThis String constructorName = getBaseName( className ); try { // Find the constructor (now in the instance namespace) BshMethod constructor = instanceNameSpace.getMethod( constructorName, sig, true/*declaredOnly*/ ); // if args, we must have constructor if ( args.length > 0 && constructor == null ) throw new InterpreterError( "Can't find constructor: "+ className ); // Evaluate the constructor if ( constructor != null ) constructor.invoke( args, interpreter, callstack, null/*callerInfo*/, false/*overrideNameSpace*/ ) ; } catch ( Exception e ) { if ( e instanceof TargetError ) e =(Exception)((TargetError)e).getTarget(); if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); e.printStackTrace( System.err ); throw new InterpreterError("Error in class initialization: "+e ); } }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
static This getClassStaticThis( Class clas, String className ) { try { return (This)Reflect.getStaticFieldValue( clas, BSHSTATIC + className ); } catch ( Exception e ) { throw new InterpreterError("Unable to get class static space: "+e); } }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
static This getClassInstanceThis( Object instance, String className ) { try { Object o = Reflect.getObjectFieldValue( instance, BSHTHIS+className ); return (This)Primitive.unwrap(o); // unwrap Primitive.Null to null } catch ( Exception e ) { throw new InterpreterError( "Generated class: Error getting This"+e ); } }
// in org/gjt/sp/jedit/bsh/TargetError.java
public String xPrintTargetError( Throwable t ) { String getTarget = "import java.lang.reflect.UndeclaredThrowableException;"+ "String result=\"\";"+ "while ( target instanceof UndeclaredThrowableException ) {"+ " target=target.getUndeclaredThrowable(); " + " result+=\"Nested: \"+target.toString();" + "}"+ "return result;"; Interpreter i = new Interpreter(); try { i.set("target", t); return (String)i.eval( getTarget ); } catch ( EvalError e ) { throw new InterpreterError("xprintarget: "+e.toString() ); } }
// in org/gjt/sp/jedit/bsh/Types.java
static boolean isSignatureAssignable( Class[] from, Class[] to, int round ) { if ( round != JAVA_VARARGS_ASSIGNABLE && from.length != to.length ) return false; switch ( round ) { case JAVA_BASE_ASSIGNABLE: for( int i=0; i<from.length; i++ ) if ( !isJavaBaseAssignable( to[i], from[i] ) ) return false; return true; case JAVA_BOX_TYPES_ASSIGABLE: for( int i=0; i<from.length; i++ ) if ( !isJavaBoxTypesAssignable( to[i], from[i] ) ) return false; return true; case JAVA_VARARGS_ASSIGNABLE: return isSignatureVarargsAssignable( from, to ); case BSH_ASSIGNABLE: for( int i=0; i<from.length; i++ ) if ( !isBshAssignable( to[i], from[i] ) ) return false; return true; default: throw new InterpreterError("bad case"); } }
// in org/gjt/sp/jedit/bsh/Types.java
static boolean isBshAssignable( Class toType, Class fromType ) { try { return castObject( toType, fromType, null/*fromValue*/, ASSIGNMENT, true/*checkOnly*/ ) == VALID_CAST; } catch ( UtilEvalError e ) { // This should not happen with checkOnly true throw new InterpreterError("err in cast check: "+e); } }
// in org/gjt/sp/jedit/bsh/Types.java
public static Object castObject( Object fromValue, Class toType, int operation ) throws UtilEvalError { if ( fromValue == null ) throw new InterpreterError("null fromValue"); Class fromType = fromValue instanceof Primitive ? ((Primitive)fromValue).getType() : fromValue.getClass(); return castObject( toType, fromType, fromValue, operation, false/*checkonly*/ ); }
// in org/gjt/sp/jedit/bsh/Types.java
private static Object castObject( Class toType, Class fromType, Object fromValue, int operation, boolean checkOnly ) throws UtilEvalError { /* Lots of preconditions checked here... Once things are running smoothly we might comment these out (That's what assertions are for). */ if ( checkOnly && fromValue != null ) throw new InterpreterError("bad cast params 1"); if ( !checkOnly && fromValue == null ) throw new InterpreterError("bad cast params 2"); if ( fromType == Primitive.class ) throw new InterpreterError("bad from Type, need to unwrap"); if ( fromValue == Primitive.NULL && fromType != null ) throw new InterpreterError("inconsistent args 1"); if ( fromValue == Primitive.VOID && fromType != Void.TYPE ) throw new InterpreterError("inconsistent args 2"); if ( toType == Void.TYPE ) throw new InterpreterError("loose toType should be null"); // assignment to loose type, void type, or exactly same type if ( toType == null || toType == fromType ) return checkOnly ? VALID_CAST : fromValue; // Casting to primitive type if ( toType.isPrimitive() ) { if ( fromType == Void.TYPE || fromType == null || fromType.isPrimitive() ) { // Both primitives, do primitive cast return Primitive.castPrimitive( toType, fromType, (Primitive)fromValue, checkOnly, operation ); } else { if ( Primitive.isWrapperType( fromType ) ) { // wrapper to primitive // Convert value to Primitive and check/cast it. //Object r = checkOnly ? VALID_CAST : Class unboxedFromType = Primitive.unboxType( fromType ); Primitive primFromValue; if ( checkOnly ) primFromValue = null; // must be null in checkOnly else primFromValue = (Primitive)Primitive.wrap( fromValue, unboxedFromType ); return Primitive.castPrimitive( toType, unboxedFromType, primFromValue, checkOnly, operation ); } else { // Cannot cast from arbitrary object to primitive if ( checkOnly ) return INVALID_CAST; else throw castError( toType, fromType, operation ); } } } // Else, casting to reference type // Casting from primitive or void (to reference type) if ( fromType == Void.TYPE || fromType == null || fromType.isPrimitive() ) { // cast from primitive to wrapper type if ( Primitive.isWrapperType( toType ) && fromType != Void.TYPE && fromType != null ) { // primitive to wrapper type return checkOnly ? VALID_CAST : Primitive.castWrapper( Primitive.unboxType(toType), ((Primitive)fromValue).getValue() ); } // Primitive (not null or void) to Object.class type if ( toType == Object.class && fromType != Void.TYPE && fromType != null ) { // box it return checkOnly ? VALID_CAST : ((Primitive)fromValue).getValue(); } // Primitive to arbitrary object type. // Allow Primitive.castToType() to handle it as well as cases of // Primitive.NULL and Primitive.VOID return Primitive.castPrimitive( toType, fromType, (Primitive)fromValue, checkOnly, operation ); } // If type already assignable no cast necessary // We do this last to allow various errors above to be caught. // e.g cast Primitive.Void to Object would pass this if ( toType.isAssignableFrom( fromType ) ) return checkOnly ? VALID_CAST : fromValue; // Can we use the proxy mechanism to cast a bsh.This to // the correct interface? if ( toType.isInterface() && org.gjt.sp.jedit.bsh.This.class.isAssignableFrom( fromType ) && Capabilities.canGenerateInterfaces() ) return checkOnly ? VALID_CAST : ((org.gjt.sp.jedit.bsh.This)fromValue).getInterface( toType ); // Both numeric wrapper types? // Try numeric style promotion wrapper cast if ( Primitive.isWrapperType( toType ) && Primitive.isWrapperType( fromType ) ) return checkOnly ? VALID_CAST : Primitive.castWrapper( toType, fromValue ); if ( checkOnly ) return INVALID_CAST; else throw castError( toType, fromType , operation ); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public Class defineClass( String name, byte [] code ) { baseClassPath.setClassSource( name, new GeneratedClassSource( code ) ); try { reloadClasses( new String [] { name } ); } catch ( ClassPathException e ) { throw new org.gjt.sp.jedit.bsh.InterpreterError("defineClass: "+e); } return classForName( name ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
Object getClassInstance() throws UtilEvalError { if ( classInstance != null ) return classInstance; if ( classStatic != null //|| ( getParent()!=null && getParent().classStatic != null ) ) throw new UtilEvalError( "Can't refer to class instance from static context."); else throw new InterpreterError( "Can't resolve class instance 'this' in: "+this); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
public static BshClassManager createClassManager( Interpreter interpreter ) { BshClassManager manager; // Do we have the necessary jdk1.2 packages and optional package? if ( Capabilities.classExists("java.lang.ref.WeakReference") && Capabilities.classExists("java.util.HashMap") && Capabilities.classExists("org.gjt.sp.jedit.bsh.classpath.ClassManagerImpl") ) try { // Try to load the module // don't refer to it directly here or we're dependent upon it Class clas = Class.forName( "org.gjt.sp.jedit.bsh.classpath.ClassManagerImpl" ); manager = (BshClassManager)clas.newInstance(); } catch ( Exception e ) { throw new InterpreterError("Error loading classmanager: "+e); } else manager = new BshClassManager(); if ( interpreter == null ) interpreter = new Interpreter(); manager.declaringInterpreter = interpreter; return manager; }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
public Class classForName( String name ) { if ( isClassBeingDefined( name ) ) throw new InterpreterError( "Attempting to load class in the process of being defined: " +name ); Class clas = null; try { clas = plainClassForName( name ); } catch ( ClassNotFoundException e ) { /*ignore*/ } // try scripted class if ( clas == null ) clas = loadSourceClass( name ); return clas; }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
protected void definingClass( String className ) { String baseName = Name.suffix(className,1); int i = baseName.indexOf("$"); if ( i != -1 ) baseName = baseName.substring(i+1); String cur = (String)definingClassesBaseNames.get( baseName ); if ( cur != null ) throw new InterpreterError("Defining class problem: "+className +": BeanShell cannot yet simultaneously define two or more " +"dependant classes of the same name. Attempt to define: " + className +" while defining: "+cur ); definingClasses.put( className, NOVALUE ); definingClassesBaseNames.put( baseName, className ); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
public Class defineClass( String name, byte [] code ) { throw new InterpreterError("Can't create class ("+name +") without class manager package."); /* Old implementation injected classes into the parent classloader. This was incorrect behavior for several reasons. The biggest problem is that classes could therefore only be defined once across all executions of the script... ClassLoader cl = this.getClass().getClassLoader(); Class clas; try { clas = (Class)Reflect.invokeObjectMethod( cl, "defineClass", new Object [] { name, code, new Primitive( (int)0 )/offset/, new Primitive( code.length )/len/ }, (Interpreter)null, (CallStack)null, (SimpleNode)null ); } catch ( Exception e ) { e.printStackTrace(); throw new InterpreterError("Unable to define class: "+ e ); } absoluteNonClasses.remove( name ); // may have been axed previously return clas; */ }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { BSHPrimaryExpression lhsNode = (BSHPrimaryExpression)jjtGetChild(0); if ( lhsNode == null ) throw new InterpreterError( "Error, null LHSnode" ); boolean strictJava = interpreter.getStrictJava(); LHS lhs = lhsNode.toLHS( callstack, interpreter); if ( lhs == null ) throw new InterpreterError( "Error, null LHS" ); // For operator-assign operations save the lhs value before evaluating // the rhs. This is correct Java behavior for postfix operations // e.g. i=1; i+=i++; // should be 2 not 3 Object lhsValue = null; if ( operator != ASSIGN ) // assign doesn't need the pre-value try { lhsValue = lhs.getValue(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } SimpleNode rhsNode = (SimpleNode)jjtGetChild(1); Object rhs; // implement "blocks" foo = { }; // if ( rhsNode instanceof BSHBlock ) // rsh = // else rhs = rhsNode.eval(callstack, interpreter); if ( rhs == Primitive.VOID ) throw new EvalError("Void assignment.", this, callstack ); try { switch(operator) { case ASSIGN: return lhs.assign( rhs, strictJava ); case PLUSASSIGN: return lhs.assign( operation(lhsValue, rhs, PLUS), strictJava ); case MINUSASSIGN: return lhs.assign( operation(lhsValue, rhs, MINUS), strictJava ); case STARASSIGN: return lhs.assign( operation(lhsValue, rhs, STAR), strictJava ); case SLASHASSIGN: return lhs.assign( operation(lhsValue, rhs, SLASH), strictJava ); case ANDASSIGN: case ANDASSIGNX: return lhs.assign( operation(lhsValue, rhs, BIT_AND), strictJava ); case ORASSIGN: case ORASSIGNX: return lhs.assign( operation(lhsValue, rhs, BIT_OR), strictJava ); case XORASSIGN: return lhs.assign( operation(lhsValue, rhs, XOR), strictJava ); case MODASSIGN: return lhs.assign( operation(lhsValue, rhs, MOD), strictJava ); case LSHIFTASSIGN: case LSHIFTASSIGNX: return lhs.assign( operation(lhsValue, rhs, LSHIFT), strictJava ); case RSIGNEDSHIFTASSIGN: case RSIGNEDSHIFTASSIGNX: return lhs.assign( operation(lhsValue, rhs, RSIGNEDSHIFT ), strictJava ); case RUNSIGNEDSHIFTASSIGN: case RUNSIGNEDSHIFTASSIGNX: return lhs.assign( operation(lhsValue, rhs, RUNSIGNEDSHIFT), strictJava ); default: throw new InterpreterError( "unimplemented operator in assignment BSH"); } } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
public Object getValue() { if ( value == Special.NULL_VALUE ) return null; else if ( value == Special.VOID_TYPE ) throw new InterpreterError("attempt to unwrap void type"); else return value; }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Boolean booleanBinaryOperation(Boolean B1, Boolean B2, int kind) { boolean lhs = B1.booleanValue(); boolean rhs = B2.booleanValue(); switch(kind) { case EQ: return new Boolean(lhs == rhs); case NE: return new Boolean(lhs != rhs); case BOOL_OR: case BOOL_ORX: return new Boolean( lhs || rhs ); case BOOL_AND: case BOOL_ANDX: return new Boolean( lhs && rhs ); default: throw new InterpreterError("unimplemented binary operator"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object longBinaryOperation(Long L1, Long L2, int kind) { long lhs = L1.longValue(); long rhs = L2.longValue(); switch(kind) { // boolean case LT: case LTX: return new Boolean(lhs < rhs); case GT: case GTX: return new Boolean(lhs > rhs); case EQ: return new Boolean(lhs == rhs); case LE: case LEX: return new Boolean(lhs <= rhs); case GE: case GEX: return new Boolean(lhs >= rhs); case NE: return new Boolean(lhs != rhs); // arithmetic case PLUS: return new Long(lhs + rhs); case MINUS: return new Long(lhs - rhs); case STAR: return new Long(lhs * rhs); case SLASH: return new Long(lhs / rhs); case MOD: return new Long(lhs % rhs); // bitwise case LSHIFT: case LSHIFTX: return new Long(lhs << rhs); case RSIGNEDSHIFT: case RSIGNEDSHIFTX: return new Long(lhs >> rhs); case RUNSIGNEDSHIFT: case RUNSIGNEDSHIFTX: return new Long(lhs >>> rhs); case BIT_AND: case BIT_ANDX: return new Long(lhs & rhs); case BIT_OR: case BIT_ORX: return new Long(lhs | rhs); case XOR: return new Long(lhs ^ rhs); default: throw new InterpreterError( "Unimplemented binary long operator"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object intBinaryOperation(Integer I1, Integer I2, int kind) { int lhs = I1.intValue(); int rhs = I2.intValue(); switch(kind) { // boolean case LT: case LTX: return new Boolean(lhs < rhs); case GT: case GTX: return new Boolean(lhs > rhs); case EQ: return new Boolean(lhs == rhs); case LE: case LEX: return new Boolean(lhs <= rhs); case GE: case GEX: return new Boolean(lhs >= rhs); case NE: return new Boolean(lhs != rhs); // arithmetic case PLUS: return new Integer(lhs + rhs); case MINUS: return new Integer(lhs - rhs); case STAR: return new Integer(lhs * rhs); case SLASH: return new Integer(lhs / rhs); case MOD: return new Integer(lhs % rhs); // bitwise case LSHIFT: case LSHIFTX: return new Integer(lhs << rhs); case RSIGNEDSHIFT: case RSIGNEDSHIFTX: return new Integer(lhs >> rhs); case RUNSIGNEDSHIFT: case RUNSIGNEDSHIFTX: return new Integer(lhs >>> rhs); case BIT_AND: case BIT_ANDX: return new Integer(lhs & rhs); case BIT_OR: case BIT_ORX: return new Integer(lhs | rhs); case XOR: return new Integer(lhs ^ rhs); default: throw new InterpreterError( "Unimplemented binary integer operator"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object doubleBinaryOperation(Double D1, Double D2, int kind) throws UtilEvalError { double lhs = D1.doubleValue(); double rhs = D2.doubleValue(); switch(kind) { // boolean case LT: case LTX: return new Boolean(lhs < rhs); case GT: case GTX: return new Boolean(lhs > rhs); case EQ: return new Boolean(lhs == rhs); case LE: case LEX: return new Boolean(lhs <= rhs); case GE: case GEX: return new Boolean(lhs >= rhs); case NE: return new Boolean(lhs != rhs); // arithmetic case PLUS: return new Double(lhs + rhs); case MINUS: return new Double(lhs - rhs); case STAR: return new Double(lhs * rhs); case SLASH: return new Double(lhs / rhs); case MOD: return new Double(lhs % rhs); // can't shift floating-point values case LSHIFT: case LSHIFTX: case RSIGNEDSHIFT: case RSIGNEDSHIFTX: case RUNSIGNEDSHIFT: case RUNSIGNEDSHIFTX: throw new UtilEvalError("Can't shift doubles"); default: throw new InterpreterError( "Unimplemented binary double operator"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object floatBinaryOperation(Float F1, Float F2, int kind) throws UtilEvalError { float lhs = F1.floatValue(); float rhs = F2.floatValue(); switch(kind) { // boolean case LT: case LTX: return new Boolean(lhs < rhs); case GT: case GTX: return new Boolean(lhs > rhs); case EQ: return new Boolean(lhs == rhs); case LE: case LEX: return new Boolean(lhs <= rhs); case GE: case GEX: return new Boolean(lhs >= rhs); case NE: return new Boolean(lhs != rhs); // arithmetic case PLUS: return new Float(lhs + rhs); case MINUS: return new Float(lhs - rhs); case STAR: return new Float(lhs * rhs); case SLASH: return new Float(lhs / rhs); case MOD: return new Float(lhs % rhs); // can't shift floats case LSHIFT: case LSHIFTX: case RSIGNEDSHIFT: case RSIGNEDSHIFTX: case RUNSIGNEDSHIFT: case RUNSIGNEDSHIFTX: throw new UtilEvalError("Can't shift floats "); default: throw new InterpreterError( "Unimplemented binary float operator"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
public static Primitive unaryOperation(Primitive val, int kind) throws UtilEvalError { if (val == NULL) throw new UtilEvalError( "illegal use of null object or 'null' literal"); if (val == VOID) throw new UtilEvalError( "illegal use of undefined object or 'void' literal"); Class operandType = val.getType(); Object operand = promoteToInteger(val.getValue()); if ( operand instanceof Boolean ) return new Primitive(booleanUnaryOperation((Boolean)operand, kind)); else if(operand instanceof Integer) { int result = intUnaryOperation((Integer)operand, kind); // ++ and -- must be cast back the original type if(kind == INCR || kind == DECR) { if(operandType == Byte.TYPE) return new Primitive((byte)result); if(operandType == Short.TYPE) return new Primitive((short)result); if(operandType == Character.TYPE) return new Primitive((char)result); } return new Primitive(result); } else if(operand instanceof Long) return new Primitive(longUnaryOperation((Long)operand, kind)); else if(operand instanceof Float) return new Primitive(floatUnaryOperation((Float)operand, kind)); else if(operand instanceof Double) return new Primitive(doubleUnaryOperation((Double)operand, kind)); else throw new InterpreterError( "An error occurred. Please call technical support."); }
// in org/gjt/sp/jedit/bsh/Primitive.java
static int intUnaryOperation(Integer I, int kind) { int operand = I.intValue(); switch(kind) { case PLUS: return operand; case MINUS: return -operand; case TILDE: return ~operand; case INCR: return operand + 1; case DECR: return operand - 1; default: throw new InterpreterError("bad integer unaryOperation"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
static long longUnaryOperation(Long L, int kind) { long operand = L.longValue(); switch(kind) { case PLUS: return operand; case MINUS: return -operand; case TILDE: return ~operand; case INCR: return operand + 1; case DECR: return operand - 1; default: throw new InterpreterError("bad long unaryOperation"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
static float floatUnaryOperation(Float F, int kind) { float operand = F.floatValue(); switch(kind) { case PLUS: return operand; case MINUS: return -operand; default: throw new InterpreterError("bad float unaryOperation"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
static double doubleUnaryOperation(Double D, int kind) { double operand = D.doubleValue(); switch(kind) { case PLUS: return operand; case MINUS: return -operand; default: throw new InterpreterError("bad double unaryOperation"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
public static Primitive getDefaultValue( Class type ) { if ( type == null || !type.isPrimitive() ) return Primitive.NULL; if ( type == Boolean.TYPE ) return new Primitive( false ); // non boolean primitive, get appropriate flavor of zero try { return new Primitive((int)0).castToType( type, Types.CAST ); } catch ( UtilEvalError e ) { throw new InterpreterError( "bad cast" ); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
public static Class boxType( Class primitiveType ) { Class c = (Class)wrapperMap.get( primitiveType ); if ( c != null ) return c; throw new InterpreterError( "Not a primitive type: "+ primitiveType ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
public static Class unboxType( Class wrapperType ) { Class c = (Class)wrapperMap.get( wrapperType ); if ( c != null ) return c; throw new InterpreterError( "Not a primitive wrapper type: "+wrapperType ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Primitive castPrimitive( Class toType, Class fromType, Primitive fromValue, boolean checkOnly, int operation ) throws UtilEvalError { /* Lots of preconditions checked here... Once things are running smoothly we might comment these out (That's what assertions are for). */ if ( checkOnly && fromValue != null ) throw new InterpreterError("bad cast param 1"); if ( !checkOnly && fromValue == null ) throw new InterpreterError("bad cast param 2"); if ( fromType != null && !fromType.isPrimitive() ) throw new InterpreterError("bad fromType:" +fromType); if ( fromValue == Primitive.NULL && fromType != null ) throw new InterpreterError("inconsistent args 1"); if ( fromValue == Primitive.VOID && fromType != Void.TYPE ) throw new InterpreterError("inconsistent args 2"); // can't cast void to anything if ( fromType == Void.TYPE ) if ( checkOnly ) return Types.INVALID_CAST; else throw Types.castError( Reflect.normalizeClassName(toType), "void value", operation ); // unwrap Primitive fromValue to its wrapper value, etc. Object value = null; if ( fromValue != null ) value = fromValue.getValue(); if ( toType.isPrimitive() ) { // Trying to cast null to primitive type? if ( fromType == null ) if ( checkOnly ) return Types.INVALID_CAST; else throw Types.castError( "primitive type:" + toType, "Null value", operation ); // fall through } else { // Trying to cast primitive to an object type // Primitive.NULL can be cast to any object type if ( fromType == null ) return checkOnly ? Types.VALID_CAST : Primitive.NULL; if ( checkOnly ) return Types.INVALID_CAST; else throw Types.castError( "object type:" + toType, "primitive value", operation); } // can only cast boolean to boolean if ( fromType == Boolean.TYPE ) { if ( toType != Boolean.TYPE ) if ( checkOnly ) return Types.INVALID_CAST; else throw Types.castError( toType, fromType, operation ); return checkOnly ? Types.VALID_CAST : fromValue; } // Do numeric cast // Only allow legal Java assignment unless we're a CAST operation if ( operation == Types.ASSIGNMENT && !Types.isJavaAssignable( toType, fromType ) ) { if ( checkOnly ) return Types.INVALID_CAST; else throw Types.castError( toType, fromType, operation ); } return checkOnly ? Types.VALID_CAST : new Primitive( castWrapper(toType, value) ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object castWrapper( Class toType, Object value ) { if ( !toType.isPrimitive() ) throw new InterpreterError("invalid type in castWrapper: "+toType); if ( value == null ) throw new InterpreterError("null value in castWrapper, guard"); if ( value instanceof Boolean ) { if ( toType != Boolean.TYPE ) throw new InterpreterError("bad wrapper cast of boolean"); else return value; } // first promote char to Number type to avoid duplicating code if ( value instanceof Character ) value = new Integer(((Character)value).charValue()); if ( !(value instanceof Number) ) throw new InterpreterError("bad type in cast"); Number number = (Number)value; if (toType == Byte.TYPE) return new Byte(number.byteValue()); if (toType == Short.TYPE) return new Short(number.shortValue()); if (toType == Character.TYPE) return new Character((char)number.intValue()); if (toType == Integer.TYPE) return new Integer(number.intValue()); if (toType == Long.TYPE) return new Long(number.longValue()); if (toType == Float.TYPE) return new Float(number.floatValue()); if (toType == Double.TYPE) return new Double(number.doubleValue()); throw new InterpreterError("error in wrapper cast"); }
// in org/gjt/sp/jedit/bsh/LHS.java
public Object getValue() throws UtilEvalError { if ( type == VARIABLE ) return nameSpace.getVariable( varName ); if (type == FIELD) try { Object o = field.get( object ); return Primitive.wrap( o, field.getType() ); } catch(IllegalAccessException e2) { throw new UtilEvalError("Can't read field: " + field); } if ( type == PROPERTY ) try { return Reflect.getObjectProperty(object, propName); } catch(ReflectError e) { Interpreter.debug(e.getMessage()); throw new UtilEvalError("No such property: " + propName); } if ( type == INDEX ) try { return Reflect.getIndex(object, index); } catch(Exception e) { throw new UtilEvalError("Array access: " + e); } throw new InterpreterError("LHS type"); }
// in org/gjt/sp/jedit/bsh/LHS.java
public Object assign( Object val, boolean strictJava ) throws UtilEvalError { if ( type == VARIABLE ) { // Set the variable in namespace according to localVar flag if ( localVar ) nameSpace.setLocalVariable( varName, val, strictJava ); else nameSpace.setVariable( varName, val, strictJava ); } else if ( type == FIELD ) { try { Object fieldVal = val instanceof Primitive ? ((Primitive)val).getValue() : val; // This should probably be in Reflect.java ReflectManager.RMSetAccessible( field ); field.set( object, fieldVal ); return val; } catch( NullPointerException e) { throw new UtilEvalError( "LHS ("+field.getName()+") not a static field."); } catch( IllegalAccessException e2) { throw new UtilEvalError( "LHS ("+field.getName()+") can't access field: "+e2); } catch( IllegalArgumentException e3) { String type = val instanceof Primitive ? ((Primitive)val).getType().getName() : val.getClass().getName(); throw new UtilEvalError( "Argument type mismatch. " + (val == null ? "null" : type ) + " not assignable to field "+field.getName()); } } else if ( type == PROPERTY ) { /* if ( object instanceof Hashtable ) ((Hashtable)object).put(propName, val); */ CollectionManager cm = CollectionManager.getCollectionManager(); if ( cm.isMap( object ) ) cm.putInMap( object/*map*/, propName, val ); else try { Reflect.setObjectProperty(object, propName, val); } catch(ReflectError e) { Interpreter.debug("Assignment: " + e.getMessage()); throw new UtilEvalError("No such property: " + propName); } } else if ( type == INDEX ) try { Reflect.setIndex(object, index, val); } catch ( UtilTargetError e1 ) { // pass along target error throw e1; } catch ( Exception e ) { throw new UtilEvalError("Assignment: " + e.getMessage()); } else throw new InterpreterError("unknown lhs"); return val; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public void run() { if(evalOnly) throw new RuntimeException("bsh Interpreter: No stream"); /* We'll print our banner using eval(String) in order to exercise the parser and get the basic expression classes loaded... This ameliorates the delay after typing the first statement. */ if ( interactive ) try { eval("printBanner();"); } catch ( EvalError e ) { println( "BeanShell "+VERSION+" - by Pat Niemeyer (pat@pat.net)"); } // init the callstack. CallStack callstack = new CallStack( globalNameSpace ); boolean eof = false; while( !eof ) { try { // try to sync up the console System.out.flush(); System.err.flush(); Thread.yield(); // this helps a little if ( interactive ) print( getBshPrompt() ); eof = Line(); if( get_jjtree().nodeArity() > 0 ) // number of child nodes { SimpleNode node = (SimpleNode)(get_jjtree().rootNode()); if(DEBUG) node.dump(">"); Object ret = node.eval( callstack, this ); // sanity check during development if ( callstack.depth() > 1 ) throw new InterpreterError( "Callstack growing: "+callstack); if(ret instanceof ReturnControl) ret = ((ReturnControl)ret).value; if( ret != Primitive.VOID ) { setu("$_", ret); if ( showResults ) println("<" + ret + ">"); } } } catch(ParseException e) { error("Parser Error: " + e.getMessage(DEBUG)); if ( DEBUG ) e.printStackTrace(); if(!interactive) eof = true; parser.reInitInput(in); } catch(InterpreterError e) { error("Internal Error: " + e.getMessage()); e.printStackTrace(); if(!interactive) eof = true; } catch(TargetError e) { error("// Uncaught Exception: " + e ); if ( e.inNativeCode() ) e.printStackTrace( DEBUG, err ); if(!interactive) eof = true; setu("$_e", e.getTarget()); } catch (EvalError e) { if ( interactive ) error( "EvalError: "+e.toString() ); else error( "EvalError: "+e.getMessage() ); if(DEBUG) e.printStackTrace(); if(!interactive) eof = true; } catch(Exception e) { error("Unknown error: " + e); if ( DEBUG ) e.printStackTrace(); if(!interactive) eof = true; } catch(TokenMgrError e) { error("Error parsing input: " + e); /* We get stuck in infinite loops here when unicode escapes fail. Must re-init the char stream reader (ASCII_UCodeESC_CharStream.java) */ parser.reInitTokenInput( in ); if(!interactive) eof = true; } finally { get_jjtree().reset(); // reinit the callstack if ( callstack.depth() > 1 ) { callstack.clear(); callstack.push( globalNameSpace ); } } } if ( interactive && exitOnEOF ) System.exit(0); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object eval( Reader in, NameSpace nameSpace, String sourceFileInfo /*, CallStack callstack */ ) throws EvalError { Object retVal = null; if ( Interpreter.DEBUG ) debug("eval: nameSpace = "+nameSpace); /* Create non-interactive local interpreter for this namespace with source from the input stream and out/err same as this interpreter. */ Interpreter localInterpreter = new Interpreter( in, out, err, false, nameSpace, this, sourceFileInfo ); CallStack callstack = new CallStack( nameSpace ); boolean eof = false; while(!eof) { SimpleNode node = null; try { eof = localInterpreter.Line(); if (localInterpreter.get_jjtree().nodeArity() > 0) { node = (SimpleNode)localInterpreter.get_jjtree().rootNode(); // nodes remember from where they were sourced node.setSourceFile( sourceFileInfo ); if ( TRACE ) println( "// " +node.getText() ); retVal = node.eval( callstack, localInterpreter ); // sanity check during development if ( callstack.depth() > 1 ) throw new InterpreterError( "Callstack growing: "+callstack); if ( retVal instanceof ReturnControl ) { retVal = ((ReturnControl)retVal).value; break; // non-interactive, return control now } if ( localInterpreter.showResults && retVal != Primitive.VOID ) println("<" + retVal + ">"); } } catch(ParseException e) { /* throw new EvalError( "Sourced file: "+sourceFileInfo+" parser Error: " + e.getMessage( DEBUG ), node, callstack ); */ if ( DEBUG ) // show extra "expecting..." info error( e.getMessage(DEBUG) ); // add the source file info and throw again e.setErrorSourceFile( sourceFileInfo ); throw e; } catch ( InterpreterError e ) { e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" internal Error: " + e.getMessage(), node, callstack); } catch ( TargetError e ) { // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow("Sourced file: "+sourceFileInfo); } catch ( EvalError e) { if ( DEBUG) e.printStackTrace(); // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow( "Sourced file: "+sourceFileInfo ); } catch ( Exception e) { if ( DEBUG) e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" unknown error: " + e.getMessage(), node, callstack); } catch(TokenMgrError e) { throw new EvalError( "Sourced file: "+sourceFileInfo+" Token Parsing Error: " + e.getMessage(), node, callstack ); } finally { localInterpreter.get_jjtree().reset(); // reinit the callstack if ( callstack.depth() > 1 ) { callstack.clear(); callstack.push( nameSpace ); } } } return Primitive.unwrap( retVal ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
Object getu( String name ) { try { return get( name ); } catch ( EvalError e ) { throw new InterpreterError("set: "+e); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
void setu(String name, Object value) { try { set(name, value); } catch ( EvalError e ) { throw new InterpreterError("set: "+e); } }
// in org/gjt/sp/jedit/bsh/DelayedEvalBshMethod.java
public Class getReturnType() { if ( returnTypeNode == null ) return null; // BSHType will cache the type for us try { return returnTypeNode.evalReturnType( callstack, interpreter ); } catch ( EvalError e ) { throw new InterpreterError("can't eval return type: "+e); } }
// in org/gjt/sp/jedit/bsh/DelayedEvalBshMethod.java
public Class [] getParameterTypes() { // BSHFormalParameters will cache the type for us try { return (Class [])paramTypesNode.eval( callstack, interpreter ); } catch ( EvalError e ) { throw new InterpreterError("can't eval param types: "+e); } }
// in org/gjt/sp/jedit/bsh/CallStack.java
public NameSpace pop() { if ( depth() < 1 ) throw new InterpreterError("pop on empty CallStack"); NameSpace top = top(); stack.removeElementAt(0); return top; }
26
              
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( UtilEvalError e ) { throw new InterpreterError( "Can't get class instance for synchronized method."); }
// in org/gjt/sp/jedit/bsh/This.java
catch ( Exception e ) { throw new InterpreterError("internal error 1 in This: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( UtilEvalError e ) { throw new InterpreterError("unable to init static: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( UtilEvalError e ) { throw new InterpreterError( "illegal argument type in method invocation: "+e ); }
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
catch ( UtilEvalError e ) { throw new InterpreterError( "Unable to set var in catch block namespace." ); }
// in org/gjt/sp/jedit/bsh/ExternalNameSpace.java
catch ( UtilEvalError ute ) { // There should be no case for this. unwrapVariable throws // UtilEvalError in some cases where it holds an LHS or array // index. throw new InterpreterError("unexpected UtilEvalError"); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( UtilEvalError e ) { throw new InterpreterError("can't set cons var"); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "unable to get instance initializer: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( UtilEvalError e ) { throw new InterpreterError("err setting local cons arg:"+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( EvalError e ) { throw new InterpreterError( "Error evaluating constructor args: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "unable to get instance initializer: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Error in class initialization: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { if ( e instanceof TargetError ) e =(Exception)((TargetError)e).getTarget(); if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); e.printStackTrace( System.err ); throw new InterpreterError("Error in class initialization: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Unable to get class static space: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "Generated class: Error getting This"+e ); }
// in org/gjt/sp/jedit/bsh/TargetError.java
catch ( EvalError e ) { throw new InterpreterError("xprintarget: "+e.toString() ); }
// in org/gjt/sp/jedit/bsh/Types.java
catch ( UtilEvalError e ) { // This should not happen with checkOnly true throw new InterpreterError("err in cast check: "+e); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassPathException e ) { throw new org.gjt.sp.jedit.bsh.InterpreterError("defineClass: "+e); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( Exception e ) { throw new InterpreterError("Error loading classmanager: "+e); }
// in org/gjt/sp/jedit/bsh/Primitive.java
catch ( UtilEvalError e ) { throw new InterpreterError( "bad cast" ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e ) { throw new InterpreterError("set: "+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e ) { throw new InterpreterError("set: "+e); }
// in org/gjt/sp/jedit/bsh/DelayedEvalBshMethod.java
catch ( EvalError e ) { throw new InterpreterError("can't eval return type: "+e); }
// in org/gjt/sp/jedit/bsh/DelayedEvalBshMethod.java
catch ( EvalError e ) { throw new InterpreterError("can't eval param types: "+e); }
0
(Domain) EvalError 59
              
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
public Object doSuffix( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError { // Handle ".class" suffix operation // Prefix must be a BSHType if ( operation == CLASS ) if ( obj instanceof BSHType ) { if ( toLHS ) throw new EvalError("Can't assign .class", this, callstack ); NameSpace namespace = callstack.top(); return ((BSHType)obj).getType( callstack, interpreter ); } else throw new EvalError( "Attempt to use .class suffix on non class.", this, callstack ); /* Evaluate our prefix if it needs evaluating first. If this is the first evaluation our prefix mayb be a Node (directly from the PrimaryPrefix) - eval() it to an object. If it's an LHS, resolve to a value. Note: The ambiguous name construct is now necessary where the node may be an ambiguous name. If this becomes common we might want to make a static method nodeToObject() or something. The point is that we can't just eval() - we need to direct the evaluation to the context sensitive type of result; namely object, class, etc. */ if ( obj instanceof SimpleNode ) if ( obj instanceof BSHAmbiguousName ) obj = ((BSHAmbiguousName)obj).toObject(callstack, interpreter); else obj = ((SimpleNode)obj).eval(callstack, interpreter); else if ( obj instanceof LHS ) try { obj = ((LHS)obj).getValue(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } try { switch(operation) { case INDEX: return doIndex( obj, toLHS, callstack, interpreter ); case NAME: return doName( obj, toLHS, callstack, interpreter ); case PROPERTY: return doProperty( toLHS, obj, callstack, interpreter ); default: throw new InterpreterError( "Unknown suffix type" ); } } catch(ReflectError e) { throw new EvalError("reflection error: " + e, this, callstack ); } catch(InvocationTargetException e) { throw new TargetError( "target exception", e.getTargetException(), this, callstack, true); } }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
private Object doName( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError, ReflectError, InvocationTargetException { try { // .length on array if ( field.equals("length") && obj.getClass().isArray() ) if ( toLHS ) throw new EvalError( "Can't assign array length", this, callstack ); else return new Primitive(Array.getLength(obj)); // field access if ( jjtGetNumChildren() == 0 ) if ( toLHS ) return Reflect.getLHSObjectField(obj, field); else return Reflect.getObjectFieldValue( obj, field ); // Method invocation // (LHS or non LHS evaluation can both encounter method calls) Object[] oa = ((BSHArguments)jjtGetChild(0)).getArguments( callstack, interpreter); // TODO: // Note: this try/catch block is copied from BSHMethodInvocation // we need to factor out this common functionality and make sure // we handle all cases ... (e.g. property style access, etc.) // maybe move this to Reflect ? try { return Reflect.invokeObjectMethod( obj, field, oa, interpreter, callstack, this ); } catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); } catch ( InvocationTargetException e ) { String msg = "Method Invocation "+field; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); } } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
static int getIndexAux( Object obj, CallStack callstack, Interpreter interpreter, SimpleNode callerInfo ) throws EvalError { if ( !obj.getClass().isArray() ) throw new EvalError("Not an array", callerInfo, callstack ); int index; try { Object indexVal = ((SimpleNode)callerInfo.jjtGetChild(0)).eval( callstack, interpreter ); if ( !(indexVal instanceof Primitive) ) indexVal = Types.castObject( indexVal, Integer.TYPE, Types.ASSIGNMENT ); index = ((Primitive)indexVal).intValue(); } catch( UtilEvalError e ) { Interpreter.debug("doIndex: "+e); throw e.toEvalError( "Arrays may only be indexed by integer types.", callerInfo, callstack ); } return index; }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
private Object doProperty( boolean toLHS, Object obj, CallStack callstack, Interpreter interpreter ) throws EvalError { if(obj == Primitive.VOID) throw new EvalError( "Attempt to access property on undefined variable or class name", this, callstack ); if ( obj instanceof Primitive ) throw new EvalError("Attempt to access property on a primitive", this, callstack ); Object value = ((SimpleNode)jjtGetChild(0)).eval( callstack, interpreter); if ( !( value instanceof String ) ) throw new EvalError( "Property expression must be a String or identifier.", this, callstack ); if ( toLHS ) return new LHS(obj, (String)value); // Property style access to Hashtable or Map CollectionManager cm = CollectionManager.getCollectionManager(); if ( cm.isMap( obj ) ) { Object val = cm.getFromMap( obj, value/*key*/ ); return ( val == null ? val = Primitive.NULL : val ); } try { return Reflect.getObjectProperty( obj, (String)value ); } catch ( UtilEvalError e) { throw e.toEvalError( "Property: "+value, this, callstack ); } catch (ReflectError e) { throw new EvalError("No such property: " + value, this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BshMethod.java
Object invoke( Object[] argValues, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean overrideNameSpace ) throws EvalError { if ( argValues != null ) for (int i=0; i<argValues.length; i++) if ( argValues[i] == null ) throw new Error("HERE!"); if ( javaMethod != null ) try { return Reflect.invokeMethod( javaMethod, javaObject, argValues ); } catch ( ReflectError e ) { throw new EvalError( "Error invoking Java method: "+e, callerInfo, callstack ); } catch ( InvocationTargetException e2 ) { throw new TargetError( "Exception invoking imported object method.", e2, callerInfo, callstack, true/*isNative*/ ); } // is this a syncrhonized method? if ( modifiers != null && modifiers.hasModifier("synchronized") ) { // The lock is our declaring namespace's This reference // (the method's 'super'). Or in the case of a class it's the // class instance. Object lock; if ( declaringNameSpace.isClass ) { try { lock = declaringNameSpace.getClassInstance(); } catch ( UtilEvalError e ) { throw new InterpreterError( "Can't get class instance for synchronized method."); } } else lock = declaringNameSpace.getThis(interpreter); // ??? synchronized( lock ) { return invokeImpl( argValues, interpreter, callstack, callerInfo, overrideNameSpace ); } } else return invokeImpl( argValues, interpreter, callstack, callerInfo, overrideNameSpace ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
private Object invokeImpl( Object[] argValues, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean overrideNameSpace ) throws EvalError { Class returnType = getReturnType(); Class [] paramTypes = getParameterTypes(); // If null callstack if ( callstack == null ) callstack = new CallStack( declaringNameSpace ); if ( argValues == null ) argValues = new Object [] { }; // Cardinality (number of args) mismatch if ( argValues.length != numArgs ) { /* // look for help string try { // should check for null namespace here String help = (String)declaringNameSpace.get( "bsh.help."+name, interpreter ); interpreter.println(help); return Primitive.VOID; } catch ( Exception e ) { throw eval error } */ throw new EvalError( "Wrong number of arguments for local method: " + name, callerInfo, callstack ); } // Make the local namespace for the method invocation NameSpace localNameSpace; if ( overrideNameSpace ) localNameSpace = callstack.top(); else { localNameSpace = new NameSpace( declaringNameSpace, name ); localNameSpace.isMethod = true; } // should we do this for both cases above? localNameSpace.setNode( callerInfo ); // set the method parameters in the local namespace for(int i=0; i<numArgs; i++) { // Set typed variable if ( paramTypes[i] != null ) { try { argValues[i] = //Types.getAssignableForm( argValues[i], paramTypes[i] ); Types.castObject( argValues[i], paramTypes[i], Types.ASSIGNMENT ); } catch( UtilEvalError e) { throw new EvalError( "Invalid argument: " + "`"+paramNames[i]+"'" + " for method: " + name + " : " + e.getMessage(), callerInfo, callstack ); } try { localNameSpace.setTypedVariable( paramNames[i], paramTypes[i], argValues[i], null/*modifiers*/); } catch ( UtilEvalError e2 ) { throw e2.toEvalError( "Typed method parameter assignment", callerInfo, callstack ); } } // Set untyped variable else // untyped param { // getAssignable would catch this for typed param if ( argValues[i] == Primitive.VOID) throw new EvalError( "Undefined variable or class name, parameter: " + paramNames[i] + " to method: " + name, callerInfo, callstack ); else try { localNameSpace.setLocalVariable( paramNames[i], argValues[i], interpreter.getStrictJava() ); } catch ( UtilEvalError e3 ) { throw e3.toEvalError( callerInfo, callstack ); } } } // Push the new namespace on the call stack if ( !overrideNameSpace ) callstack.push( localNameSpace ); // Invoke the block, overriding namespace with localNameSpace Object ret = methodBody.eval( callstack, interpreter, true/*override*/ ); // save the callstack including the called method, just for error mess CallStack returnStack = callstack.copy(); // Get back to caller namespace if ( !overrideNameSpace ) callstack.pop(); ReturnControl retControl = null; if ( ret instanceof ReturnControl ) { retControl = (ReturnControl)ret; // Method body can only use 'return' statment type return control. if ( retControl.kind == retControl.RETURN ) ret = ((ReturnControl)ret).value; else // retControl.returnPoint is the Node of the return statement throw new EvalError("'continue' or 'break' in method body", retControl.returnPoint, returnStack ); // Check for explicit return of value from void method type. // retControl.returnPoint is the Node of the return statement if ( returnType == Void.TYPE && ret != Primitive.VOID ) throw new EvalError( "Cannot return value from void method", retControl.returnPoint, returnStack); } if ( returnType != null ) { // If return type void, return void as the value. if ( returnType == Void.TYPE ) return Primitive.VOID; // return type is a class try { ret = // Types.getAssignableForm( ret, (Class)returnType ); Types.castObject( ret, returnType, Types.ASSIGNMENT ); } catch( UtilEvalError e ) { // Point to return statement point if we had one. // (else it was implicit return? What's the case here?) SimpleNode node = callerInfo; if ( retControl != null ) node = retControl.returnPoint; throw e.toEvalError( "Incorrect type returned from method: " + name + e.getMessage(), node, callstack ); } } return ret; }
// in org/gjt/sp/jedit/bsh/This.java
public Object invokeMethod( String methodName, Object [] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean declaredOnly ) throws EvalError { /* Wrap nulls. This is a bit of a cludge to address a deficiency in the class generator whereby it does not wrap nulls on method delegate. See Class Generator.java. If we fix that then we can remove this. (just have to generate the code there.) */ if ( args != null ) { Object [] oa = new Object [args.length]; for(int i=0; i<args.length; i++) oa[i] = ( args[i] == null ? Primitive.NULL : args[i] ); args = oa; } if ( interpreter == null ) interpreter = declaringInterpreter; if ( callstack == null ) callstack = new CallStack( namespace ); if ( callerInfo == null ) callerInfo = SimpleNode.JAVACODE; // Find the bsh method Class [] types = Types.getTypes( args ); BshMethod bshMethod = null; try { bshMethod = namespace.getMethod( methodName, types, declaredOnly ); } catch ( UtilEvalError e ) { // leave null } if ( bshMethod != null ) return bshMethod.invoke( args, interpreter, callstack, callerInfo ); /* No scripted method of that name. Implement the required part of the Object protocol: public int hashCode(); public boolean equals(java.lang.Object); public java.lang.String toString(); if these were not handled by scripted methods we must provide a default impl. */ // a default toString() that shows the interfaces we implement if ( methodName.equals("toString" ) ) return toString(); // a default hashCode() if ( methodName.equals("hashCode" ) ) return new Integer(this.hashCode()); // a default equals() testing for equality with the This reference if ( methodName.equals("equals" ) ) { Object obj = args[0]; return new Boolean( this == obj ); } // Look for a default invoke() handler method in the namespace // Note: this code duplicates that in NameSpace getCommand() // is that ok? try { bshMethod = namespace.getMethod( "invoke", new Class [] { null, null } ); } catch ( UtilEvalError e ) { /*leave null*/ } // Call script "invoke( String methodName, Object [] args ); if ( bshMethod != null ) return bshMethod.invoke( new Object [] { methodName, args }, interpreter, callstack, callerInfo ); throw new EvalError("Method " + StringUtil.methodString( methodName, types ) + " not found in bsh scripted object: "+ namespace.getName(), callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHArguments.java
public Object[] getArguments( CallStack callstack, Interpreter interpreter) throws EvalError { // evaluate each child Object[] args = new Object[jjtGetNumChildren()]; for(int i = 0; i < args.length; i++) { args[i] = ((SimpleNode)jjtGetChild(i)).eval(callstack, interpreter); if ( args[i] == Primitive.VOID ) throw new EvalError( "Undefined argument: " + ((SimpleNode)jjtGetChild(i)).getText(), this, callstack ); } return args; }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
public static Class generateClassImpl( String name, Modifiers modifiers, Class [] interfaces, Class superClass, BSHBlock block, boolean isInterface, CallStack callstack, Interpreter interpreter ) throws EvalError { // Scripting classes currently requires accessibility // This can be eliminated with a bit more work. try { Capabilities.setAccessibility( true ); } catch ( Capabilities.Unavailable e ) { throw new EvalError( "Defining classes currently requires reflective Accessibility.", block, callstack ); } NameSpace enclosingNameSpace = callstack.top(); String packageName = enclosingNameSpace.getPackage(); String className = enclosingNameSpace.isClass ? ( enclosingNameSpace.getName()+"$"+name ) : name; String fqClassName = packageName == null ? className : packageName + "." + className; BshClassManager bcm = interpreter.getClassManager(); // Race condition here... bcm.definingClass( fqClassName ); // Create the class static namespace NameSpace classStaticNameSpace = new NameSpace( enclosingNameSpace, className); classStaticNameSpace.isClass = true; callstack.push( classStaticNameSpace ); // Evaluate any inner class class definitions in the block // effectively recursively call this method for contained classes first block.evalBlock( callstack, interpreter, true/*override*/, ClassNodeFilter.CLASSCLASSES ); // Generate the type for our class Variable [] variables = getDeclaredVariables( block, callstack, interpreter, packageName ); DelayedEvalBshMethod [] methods = getDeclaredMethods( block, callstack, interpreter, packageName ); ClassGeneratorUtil classGenerator = new ClassGeneratorUtil( modifiers, className, packageName, superClass, interfaces, variables, methods, classStaticNameSpace, isInterface ); byte [] code = classGenerator.generateClass(); // if debug, write out the class file to debugClasses directory String dir = System.getProperty("debugClasses"); if ( dir != null ) try { FileOutputStream out= new FileOutputStream( dir+"/"+className+".class" ); out.write(code); out.close(); } catch ( IOException e ) { } // Define the new class in the classloader Class genClass = bcm.defineClass( fqClassName, code ); // import the unq name into parent enclosingNameSpace.importClass( fqClassName.replace('$','.') ); try { classStaticNameSpace.setLocalVariable( ClassGeneratorUtil.BSHINIT, block, false/*strictJava*/ ); } catch ( UtilEvalError e ) { throw new InterpreterError("unable to init static: "+e ); } // Give the static space its class static import // important to do this after all classes are defined classStaticNameSpace.setClassStatic( genClass ); // evaluate the static portion of the block in the static space block.evalBlock( callstack, interpreter, true/*override*/, ClassNodeFilter.CLASSSTATIC ); callstack.pop(); if ( !genClass.isInterface() ) { // Set the static bsh This callback String bshStaticFieldName = ClassGeneratorUtil.BSHSTATIC+className; try { LHS lhs = Reflect.getLHSStaticField( genClass, bshStaticFieldName ); lhs.assign( classStaticNameSpace.getThis( interpreter ), false/*strict*/ ); } catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); } } bcm.doneDefiningClass( fqClassName ); return genClass; }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
public Class toClass( CallStack callstack, Interpreter interpreter ) throws EvalError { try { return getName( callstack.top() ).toClass(); } catch ( ClassNotFoundException e ) { throw new EvalError( e.getMessage(), this, callstack ); } catch ( UtilEvalError e2 ) { // ClassPathException is a type of UtilEvalError throw e2.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHPrimaryExpression.java
public LHS toLHS( CallStack callstack, Interpreter interpreter) throws EvalError { Object obj = eval( true, callstack, interpreter ); if ( ! (obj instanceof LHS) ) throw new EvalError("Can't assign to:", this, callstack ); else return (LHS)obj; }
// in org/gjt/sp/jedit/bsh/BSHPrimaryExpression.java
private Object eval( boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError { Object obj = jjtGetChild(0); int numChildren = jjtGetNumChildren(); for(int i=1; i<numChildren; i++) obj = ((BSHPrimarySuffix)jjtGetChild(i)).doSuffix( obj, toLHS, callstack, interpreter); /* If the result is a Node eval() it to an object or LHS (as determined by toLHS) */ if ( obj instanceof SimpleNode ) if ( obj instanceof BSHAmbiguousName ) if ( toLHS ) obj = ((BSHAmbiguousName)obj).toLHS( callstack, interpreter); else obj = ((BSHAmbiguousName)obj).toObject( callstack, interpreter); else // Some arbitrary kind of node if ( toLHS ) // is this right? throw new EvalError("Can't assign to prefix.", this, callstack ); else obj = ((SimpleNode)obj).eval(callstack, interpreter); // return LHS or value object as determined by toLHS if ( obj instanceof LHS ) if ( toLHS ) return obj; else try { return ((LHS)obj).getValue(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } else return obj; }
// in org/gjt/sp/jedit/bsh/BSHType.java
public Class getType( CallStack callstack, Interpreter interpreter ) throws EvalError { // return cached type if available if ( type != null ) return type; // first node will either be PrimitiveType or AmbiguousName SimpleNode node = getTypeNode(); if ( node instanceof BSHPrimitiveType ) baseType = ((BSHPrimitiveType)node).getType(); else baseType = ((BSHAmbiguousName)node).toClass( callstack, interpreter ); if ( arrayDims > 0 ) { try { // Get the type by constructing a prototype array with // arbitrary (zero) length in each dimension. int[] dims = new int[arrayDims]; // int array default zeros Object obj = Array.newInstance(baseType, dims); type = obj.getClass(); } catch(Exception e) { throw new EvalError("Couldn't construct array type", this, callstack ); } } else type = baseType; // hack... sticking to first interpreter that resolves this // see comments on type instance variable interpreter.getClassManager().addListener(this); return type; }
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { BSHBlock tryBlock = ((BSHBlock)jjtGetChild(0)); Vector catchParams = new Vector(); Vector catchBlocks = new Vector(); int nchild = jjtGetNumChildren(); Node node = null; int i=1; while((i < nchild) && ((node = jjtGetChild(i++)) instanceof BSHFormalParameter)) { catchParams.addElement(node); catchBlocks.addElement(jjtGetChild(i++)); node = null; } // finaly block BSHBlock finallyBlock = null; if(node != null) finallyBlock = (BSHBlock)node; // Why both of these? TargetError target = null; Throwable thrown = null; Object ret = null; /* Evaluate the contents of the try { } block and catch any resulting TargetErrors generated by the script. We save the callstack depth and if an exception is thrown we pop back to that depth before contiuing. The exception short circuited any intervening method context pops. Note: we the stack info... what do we do with it? append to exception message? */ int callstackDepth = callstack.depth(); try { ret = tryBlock.eval(callstack, interpreter); } catch( TargetError e ) { target = e; String stackInfo = "Bsh Stack: "; while ( callstack.depth() > callstackDepth ) stackInfo += "\t" + callstack.pop() +"\n"; } // unwrap the target error if ( target != null ) thrown = target.getTarget(); // If we have an exception, find a catch if (thrown != null) { int n = catchParams.size(); for(i=0; i<n; i++) { // Get catch block BSHFormalParameter fp = (BSHFormalParameter)catchParams.elementAt(i); // Should cache this subject to classloader change message // Evaluation of the formal parameter simply resolves its // type via the specified namespace.. it doesn't modify the // namespace. fp.eval( callstack, interpreter ); if ( fp.type == null && interpreter.getStrictJava() ) throw new EvalError( "(Strict Java) Untyped catch block", this, callstack ); // If the param is typed check assignability if ( fp.type != null ) try { thrown = (Throwable)Types.castObject( thrown/*rsh*/, fp.type/*lhsType*/, Types.ASSIGNMENT ); } catch( UtilEvalError e ) { /* Catch the mismatch and continue to try the next Note: this is innefficient, should have an isAssignableFrom() that doesn't throw // TODO: we do now have a way to test assignment // in castObject(), use it? */ continue; } // Found match, execute catch block BSHBlock cb = (BSHBlock)(catchBlocks.elementAt(i)); // Prepare to execute the block. // We must create a new BlockNameSpace to hold the catch // parameter and swap it on the stack after initializing it. NameSpace enclosingNameSpace = callstack.top(); BlockNameSpace cbNameSpace = new BlockNameSpace( enclosingNameSpace ); try { if ( fp.type == BSHFormalParameter.UNTYPED ) // set an untyped variable directly in the block cbNameSpace.setBlockVariable( fp.name, thrown ); else { // set a typed variable (directly in the block) Modifiers modifiers = new Modifiers(); cbNameSpace.setTypedVariable( fp.name, fp.type, thrown, new Modifiers()/*none*/ ); } } catch ( UtilEvalError e ) { throw new InterpreterError( "Unable to set var in catch block namespace." ); } // put cbNameSpace on the top of the stack callstack.swap( cbNameSpace ); try { ret = cb.eval( callstack, interpreter ); } finally { // put it back callstack.swap( enclosingNameSpace ); } target = null; // handled target break; } } // evaluate finally block if(finallyBlock != null) ret = finallyBlock.eval(callstack, interpreter); // exception fell through, throw it upward... if(target != null) throw target; if(ret instanceof ReturnControl) return ret; else return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object objectAllocation( BSHAmbiguousName nameNode, BSHArguments argumentsNode, CallStack callstack, Interpreter interpreter ) throws EvalError { NameSpace namespace = callstack.top(); Object[] args = argumentsNode.getArguments( callstack, interpreter ); if ( args == null) throw new EvalError( "Null args in new.", this, callstack ); // Look for scripted class object Object obj = nameNode.toObject( callstack, interpreter, false/* force class*/ ); // Try regular class obj = nameNode.toObject( callstack, interpreter, true/*force class*/ ); Class type = null; if ( obj instanceof ClassIdentifier ) type = ((ClassIdentifier)obj).getTargetClass(); else throw new EvalError( "Unknown class: "+nameNode.text, this, callstack ); // Is an inner class style object allocation boolean hasBody = jjtGetNumChildren() > 2; if ( hasBody ) { BSHBlock body = (BSHBlock)jjtGetChild(2); if ( type.isInterface() ) return constructWithInterfaceBody( type, args, body, callstack, interpreter ); else return constructWithClassBody( type, args, body, callstack, interpreter ); } else return constructObject( type, args, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object constructObject( Class type, Object[] args, CallStack callstack ) throws EvalError { Object obj; try { obj = Reflect.constructObject( type, args ); } catch ( ReflectError e) { throw new EvalError( "Constructor error: " + e.getMessage(), this, callstack ); } catch(InvocationTargetException e) { // No need to wrap this debug Interpreter.debug("The constructor threw an exception:\n\t" + e.getTargetException()); throw new TargetError( "Object constructor", e.getTargetException(), this, callstack, true); } String className = type.getName(); // Is it an inner class? if ( className.indexOf("$") == -1 ) return obj; // Temporary hack to support inner classes // If the obj is a non-static inner class then import the context... // This is not a sufficient emulation of inner classes. // Replace this later... // work through to class 'this' This ths = callstack.top().getThis( null ); NameSpace instanceNameSpace = Name.getClassNameSpace( ths.getNameSpace() ); // Change the parent (which was the class static) to the class instance // We really need to check if we're a static inner class here first... // but for some reason Java won't show the static modifier on our // fake inner classes... could generate a flag field. if ( instanceNameSpace != null && className.startsWith( instanceNameSpace.getName() +"$") ) { try { ClassGenerator.getClassGenerator().setInstanceNameSpaceParent( obj, className, instanceNameSpace ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } } return obj; }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object constructWithClassBody( Class type, Object[] args, BSHBlock block, CallStack callstack, Interpreter interpreter ) throws EvalError { String name = callstack.top().getName() + "$" + (++innerClassCount); Modifiers modifiers = new Modifiers(); modifiers.addModifier( Modifiers.CLASS, "public" ); Class clas; try { clas = ClassGenerator.getClassGenerator() .generateClass( name, modifiers, null/*interfaces*/, type/*superClass*/, block, false/*isInterface*/, callstack, interpreter ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } try { return Reflect.constructObject( clas, args ); } catch ( Exception e ) { if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); throw new EvalError( "Error constructing inner class instance: "+e, this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object objectArrayAllocation( BSHAmbiguousName nameNode, BSHArrayDimensions dimensionsNode, CallStack callstack, Interpreter interpreter ) throws EvalError { NameSpace namespace = callstack.top(); Class type = nameNode.toClass( callstack, interpreter ); if ( type == null ) throw new EvalError( "Class " + nameNode.getName(namespace) + " not found.", this, callstack ); return arrayAllocation( dimensionsNode, type, callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object arrayNewInstance( Class type, BSHArrayDimensions dimensionsNode, CallStack callstack ) throws EvalError { if ( dimensionsNode.numUndefinedDims > 0 ) { Object proto = Array.newInstance( type, new int [dimensionsNode.numUndefinedDims] ); // zeros type = proto.getClass(); } try { return Array.newInstance( type, dimensionsNode.definedDimensions); } catch( NegativeArraySizeException e1 ) { throw new TargetError( e1, this, callstack ); } catch( Exception e ) { throw new EvalError("Can't construct primitive array: " + e.getMessage(), this, callstack); } }
// in org/gjt/sp/jedit/bsh/Name.java
private Object invokeLocalMethod( Interpreter interpreter, Object[] args, CallStack callstack, SimpleNode callerInfo ) throws EvalError/*, ReflectError, InvocationTargetException*/ { if ( Interpreter.DEBUG ) Interpreter.debug( "invokeLocalMethod: " + value ); if ( interpreter == null ) throw new InterpreterError( "invokeLocalMethod: interpreter = null"); String commandName = value; Class [] argTypes = Types.getTypes( args ); // Check for existing method BshMethod meth = null; try { meth = namespace.getMethod( commandName, argTypes ); } catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); } // If defined, invoke it if ( meth != null ) return meth.invoke( args, interpreter, callstack, callerInfo ); BshClassManager bcm = interpreter.getClassManager(); // Look for a BeanShell command Object commandObject; try { commandObject = namespace.getCommand( commandName, argTypes, interpreter ); } catch ( UtilEvalError e ) { throw e.toEvalError("Error loading command: ", callerInfo, callstack ); } // should try to print usage here if nothing found if ( commandObject == null ) { // Look for a default invoke() handler method in the namespace // Note: this code duplicates that in This.java... should it? // Call on 'This' can never be a command BshMethod invokeMethod = null; try { invokeMethod = namespace.getMethod( "invoke", new Class [] { null, null } ); } catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); } if ( invokeMethod != null ) return invokeMethod.invoke( new Object [] { commandName, args }, interpreter, callstack, callerInfo ); throw new EvalError( "Command not found: " +StringUtil.methodString( commandName, argTypes ), callerInfo, callstack ); } if ( commandObject instanceof BshMethod ) return ((BshMethod)commandObject).invoke( args, interpreter, callstack, callerInfo ); if ( commandObject instanceof Class ) try { return Reflect.invokeCompiledCommand( ((Class)commandObject), args, interpreter, callstack ); } catch ( UtilEvalError e ) { throw e.toEvalError("Error invoking compiled command: ", callerInfo, callstack ); } throw new InterpreterError("invalid command type"); }
// in org/gjt/sp/jedit/bsh/BSHThrowStatement.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { Object obj = ((SimpleNode)jjtGetChild(0)).eval(callstack, interpreter); // need to loosen this to any throwable... do we need to handle // that in interpreter somewhere? check first... if(!(obj instanceof Exception)) throw new EvalError("Expression in 'throw' must be Exception type", this, callstack ); // wrap the exception in a TargetException to propogate it up throw new TargetError( (Exception)obj, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHBinaryExpression.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { Object lhs = ((SimpleNode)jjtGetChild(0)).eval(callstack, interpreter); /* Doing instanceof? Next node is a type. */ if (kind == INSTANCEOF) { // null object ref is not instance of any type if ( lhs == Primitive.NULL ) return new Primitive(false); Class rhs = ((BSHType)jjtGetChild(1)).getType( callstack, interpreter ); /* // primitive (number or void) cannot be tested for instanceof if (lhs instanceof Primitive) throw new EvalError("Cannot be instance of primitive type." ); */ /* Primitive (number or void) is not normally an instanceof anything. But for internal use we'll test true for the bsh.Primitive class. i.e. (5 instanceof bsh.Primitive) will be true */ if ( lhs instanceof Primitive ) if ( rhs == org.gjt.sp.jedit.bsh.Primitive.class ) return new Primitive(true); else return new Primitive(false); // General case - performe the instanceof based on assignability boolean ret = Types.isJavaBaseAssignable( rhs, lhs.getClass() ); return new Primitive(ret); } // The following two boolean checks were tacked on. // This could probably be smoothed out. /* Look ahead and short circuit evaluation of the rhs if: we're a boolean AND and the lhs is false. */ if ( kind == BOOL_AND || kind == BOOL_ANDX ) { Object obj = lhs; if ( isPrimitiveValue(lhs) ) obj = ((Primitive)lhs).getValue(); if ( obj instanceof Boolean && ( ((Boolean)obj).booleanValue() == false ) ) return new Primitive(false); } /* Look ahead and short circuit evaluation of the rhs if: we're a boolean AND and the lhs is false. */ if ( kind == BOOL_OR || kind == BOOL_ORX ) { Object obj = lhs; if ( isPrimitiveValue(lhs) ) obj = ((Primitive)lhs).getValue(); if ( obj instanceof Boolean && ( ((Boolean)obj).booleanValue() == true ) ) return new Primitive(true); } // end stuff that was tacked on for boolean short-circuiting. /* Are both the lhs and rhs either wrappers or primitive values? do binary op */ boolean isLhsWrapper = isWrapper( lhs ); Object rhs = ((SimpleNode)jjtGetChild(1)).eval(callstack, interpreter); boolean isRhsWrapper = isWrapper( rhs ); if ( ( isLhsWrapper || isPrimitiveValue( lhs ) ) && ( isRhsWrapper || isPrimitiveValue( rhs ) ) ) { // Special case for EQ on two wrapper objects if ( (isLhsWrapper && isRhsWrapper && kind == EQ)) { /* Don't auto-unwrap wrappers (preserve identity semantics) FALL THROUGH TO OBJECT OPERATIONS BELOW. */ } else try { return Primitive.binaryOperation(lhs, rhs, kind); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } } /* Doing the following makes it hard to use untyped vars... e.g. if ( arg == null ) ...what if arg is a primitive? The answer is that we should test only if the var is typed...? need to get that info here... else { // Do we have a mixture of primitive values and non-primitives ? // (primitiveValue = not null, not void) int primCount = 0; if ( isPrimitiveValue( lhs ) ) ++primCount; if ( isPrimitiveValue( rhs ) ) ++primCount; if ( primCount > 1 ) // both primitive types, should have been handled above throw new InterpreterError("should not be here"); else if ( primCount == 1 ) // mixture of one and the other throw new EvalError("Operator: '" + tokenImage[kind] +"' inappropriate for object / primitive combination.", this, callstack ); // else fall through to handle both non-primitive types // end check for primitive and non-primitive mix } */ /* Treat lhs and rhs as arbitrary objects and do the operation. (including NULL and VOID represented by their Primitive types) */ //System.out.println("binary op arbitrary obj: {"+lhs+"}, {"+rhs+"}"); switch(kind) { case EQ: return new Primitive((lhs == rhs)); case NE: return new Primitive((lhs != rhs)); case PLUS: if(lhs instanceof String || rhs instanceof String) return lhs.toString() + rhs.toString(); // FALL THROUGH TO DEFAULT CASE!!! default: if(lhs instanceof Primitive || rhs instanceof Primitive) if ( lhs == Primitive.VOID || rhs == Primitive.VOID ) throw new EvalError( "illegal use of undefined variable, class, or 'void' literal", this, callstack ); else if ( lhs == Primitive.NULL || rhs == Primitive.NULL ) throw new EvalError( "illegal use of null value or 'null' literal", this, callstack); throw new EvalError("Operator: '" + tokenImage[kind] + "' inappropriate for objects", this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHIfStatement.java
public static boolean evaluateCondition( SimpleNode condExp, CallStack callstack, Interpreter interpreter) throws EvalError { Object obj = condExp.eval(callstack, interpreter); if(obj instanceof Primitive) { if ( obj == Primitive.VOID ) throw new EvalError("Condition evaluates to void type", condExp, callstack ); obj = ((Primitive)obj).getValue(); } if(obj instanceof Boolean) return ((Boolean)obj).booleanValue(); else throw new EvalError( "Condition must evaluate to a Boolean or boolean.", condExp, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHSwitchStatement.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { int numchild = jjtGetNumChildren(); int child = 0; SimpleNode switchExp = ((SimpleNode)jjtGetChild(child++)); Object switchVal = switchExp.eval( callstack, interpreter ); /* Note: this could be made clearer by adding an inner class for the cases and an object context for the child traversal. */ // first label BSHSwitchLabel label; Object node; ReturnControl returnControl=null; // get the first label if ( child >= numchild ) throw new EvalError("Empty switch statement.", this, callstack ); label = ((BSHSwitchLabel)jjtGetChild(child++)); // while more labels or blocks and haven't hit return control while ( child < numchild && returnControl == null ) { // if label is default or equals switchVal if ( label.isDefault || primitiveEquals( switchVal, label.eval( callstack, interpreter ), callstack, switchExp ) ) { // execute nodes, skipping labels, until a break or return while ( child < numchild ) { node = jjtGetChild(child++); if ( node instanceof BSHSwitchLabel ) continue; // eval it Object value = ((SimpleNode)node).eval( callstack, interpreter ); // should check to disallow continue here? if ( value instanceof ReturnControl ) { returnControl = (ReturnControl)value; break; } } } else { // skip nodes until next label while ( child < numchild ) { node = jjtGetChild(child++); if ( node instanceof BSHSwitchLabel ) { label = (BSHSwitchLabel)node; break; } } } } if ( returnControl != null && returnControl.kind == RETURN ) return returnControl; else return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHImportDeclaration.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { NameSpace namespace = callstack.top(); if ( superImport ) try { namespace.doSuperImport(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } else { if ( staticImport ) { if ( importPackage ) { Class clas = ((BSHAmbiguousName)jjtGetChild(0)).toClass( callstack, interpreter ); namespace.importStatic( clas ); } else throw new EvalError( "static field imports not supported yet", this, callstack ); } else { String name = ((BSHAmbiguousName)jjtGetChild(0)).text; if ( importPackage ) namespace.importPackage(name); else namespace.importClass(name); } } return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHArrayDimensions.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { SimpleNode child = (SimpleNode)jjtGetChild(0); /* Child is array initializer. Evaluate it and fill in the dimensions it returns. Initialized arrays are always fully defined (no undefined dimensions to worry about). The syntax uses the undefinedDimension count. e.g. int [][] { 1, 2 }; */ if (child instanceof BSHArrayInitializer) { if ( baseType == null ) throw new EvalError( "Internal Array Eval err: unknown base type", this, callstack ); Object initValue = ((BSHArrayInitializer)child).eval( baseType, numUndefinedDims, callstack, interpreter); Class arrayClass = initValue.getClass(); int actualDimensions = Reflect.getArrayDimensions(arrayClass); definedDimensions = new int[ actualDimensions ]; // Compare with number of dimensions actually created with the // number specified (syntax uses the undefined ones here) if ( definedDimensions.length != numUndefinedDims ) throw new EvalError( "Incompatible initializer. Allocation calls for a " + numUndefinedDims+ " dimensional array, but initializer is a " + actualDimensions + " dimensional array", this, callstack ); // fill in definedDimensions [] lengths Object arraySlice = initValue; for ( int i = 0; i < definedDimensions.length; i++ ) { definedDimensions[i] = Array.getLength( arraySlice ); if ( definedDimensions[i] > 0 ) arraySlice = Array.get(arraySlice, 0); } return initValue; } else // Evaluate the defined dimensions of the array { definedDimensions = new int[ numDefinedDims ]; for(int i = 0; i < numDefinedDims; i++) { try { Object length = ((SimpleNode)jjtGetChild(i)).eval( callstack, interpreter); definedDimensions[i] = ((Primitive)length).intValue(); } catch(Exception e) { throw new EvalError( "Array index: " + i + " does not evaluate to an integer", this, callstack ); } } } return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHMethodDeclaration.java
private void evalNodes( CallStack callstack, Interpreter interpreter ) throws EvalError { insureNodesParsed(); // validate that the throws names are class names for(int i=firstThrowsClause; i<numThrows+firstThrowsClause; i++) ((BSHAmbiguousName)jjtGetChild(i)).toClass( callstack, interpreter ); paramsNode.eval( callstack, interpreter ); // if strictJava mode, check for loose parameters and return type if ( interpreter.getStrictJava() ) { for(int i=0; i<paramsNode.paramTypes.length; i++) if ( paramsNode.paramTypes[i] == null ) // Warning: Null callstack here. Don't think we need // a stack trace to indicate how we sourced the method. throw new EvalError( "(Strict Java Mode) Undeclared argument type, parameter: " + paramsNode.getParamNames()[i] + " in method: " + name, this, null ); if ( returnType == null ) // Warning: Null callstack here. Don't think we need // a stack trace to indicate how we sourced the method. throw new EvalError( "(Strict Java Mode) Undeclared return type for method: " + name, this, null ); } }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { NameSpace namespace = callstack.top(); BSHAmbiguousName nameNode = getNameNode(); // Do not evaluate methods this() or super() in class instance space // (i.e. inside a constructor) if ( namespace.getParent() != null && namespace.getParent().isClass && ( nameNode.text.equals("super") || nameNode.text.equals("this") ) ) return Primitive.VOID; Name name = nameNode.getName(namespace); Object[] args = getArgsNode().getArguments(callstack, interpreter); // This try/catch block is replicated is BSHPrimarySuffix... need to // factor out common functionality... // Move to Reflect? try { return name.invokeMethod( interpreter, args, callstack, this); } catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); } catch ( InvocationTargetException e ) { String msg = "Method Invocation "+name; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHEnhancedForStatement.java
public Object eval( CallStack callstack , Interpreter interpreter ) throws EvalError { Class elementType = null; SimpleNode expression, statement=null; NameSpace enclosingNameSpace = callstack.top(); SimpleNode firstNode =((SimpleNode)jjtGetChild(0)); int nodeCount = jjtGetNumChildren(); if ( firstNode instanceof BSHType ) { elementType=((BSHType)firstNode).getType( callstack, interpreter ); expression=((SimpleNode)jjtGetChild(1)); if ( nodeCount>2 ) statement=((SimpleNode)jjtGetChild(2)); } else { expression=firstNode; if ( nodeCount>1 ) statement=((SimpleNode)jjtGetChild(1)); } BlockNameSpace eachNameSpace = new BlockNameSpace( enclosingNameSpace ); callstack.swap( eachNameSpace ); final Object iteratee = expression.eval( callstack, interpreter ); if ( iteratee == Primitive.NULL ) throw new EvalError("The collection, array, map, iterator, or " + "enumeration portion of a for statement cannot be null.", this, callstack ); CollectionManager cm = CollectionManager.getCollectionManager(); if ( !cm.isBshIterable( iteratee ) ) throw new EvalError("Can't iterate over type: " +iteratee.getClass(), this, callstack ); BshIterator iterator = cm.getBshIterator( iteratee ); Object returnControl = Primitive.VOID; while( iterator.hasNext() ) { try { if ( elementType != null ) eachNameSpace.setTypedVariable( varName/*name*/, elementType/*type*/, iterator.next()/*value*/, new Modifiers()/*none*/ ); else eachNameSpace.setVariable( varName, iterator.next(), false ); } catch ( UtilEvalError e ) { throw e.toEvalError( "for loop iterator variable:"+ varName, this, callstack ); } boolean breakout = false; // switch eats a multi-level break here? if ( statement != null ) // not empty statement { Object ret = statement.eval( callstack, interpreter ); if (ret instanceof ReturnControl) { switch(((ReturnControl)ret).kind) { case RETURN: returnControl = ret; breakout = true; break; case CONTINUE: break; case BREAK: breakout = true; break; } } } if (breakout) break; } callstack.swap(enclosingNameSpace); return returnControl; }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { BSHPrimaryExpression lhsNode = (BSHPrimaryExpression)jjtGetChild(0); if ( lhsNode == null ) throw new InterpreterError( "Error, null LHSnode" ); boolean strictJava = interpreter.getStrictJava(); LHS lhs = lhsNode.toLHS( callstack, interpreter); if ( lhs == null ) throw new InterpreterError( "Error, null LHS" ); // For operator-assign operations save the lhs value before evaluating // the rhs. This is correct Java behavior for postfix operations // e.g. i=1; i+=i++; // should be 2 not 3 Object lhsValue = null; if ( operator != ASSIGN ) // assign doesn't need the pre-value try { lhsValue = lhs.getValue(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } SimpleNode rhsNode = (SimpleNode)jjtGetChild(1); Object rhs; // implement "blocks" foo = { }; // if ( rhsNode instanceof BSHBlock ) // rsh = // else rhs = rhsNode.eval(callstack, interpreter); if ( rhs == Primitive.VOID ) throw new EvalError("Void assignment.", this, callstack ); try { switch(operator) { case ASSIGN: return lhs.assign( rhs, strictJava ); case PLUSASSIGN: return lhs.assign( operation(lhsValue, rhs, PLUS), strictJava ); case MINUSASSIGN: return lhs.assign( operation(lhsValue, rhs, MINUS), strictJava ); case STARASSIGN: return lhs.assign( operation(lhsValue, rhs, STAR), strictJava ); case SLASHASSIGN: return lhs.assign( operation(lhsValue, rhs, SLASH), strictJava ); case ANDASSIGN: case ANDASSIGNX: return lhs.assign( operation(lhsValue, rhs, BIT_AND), strictJava ); case ORASSIGN: case ORASSIGNX: return lhs.assign( operation(lhsValue, rhs, BIT_OR), strictJava ); case XORASSIGN: return lhs.assign( operation(lhsValue, rhs, XOR), strictJava ); case MODASSIGN: return lhs.assign( operation(lhsValue, rhs, MOD), strictJava ); case LSHIFTASSIGN: case LSHIFTASSIGNX: return lhs.assign( operation(lhsValue, rhs, LSHIFT), strictJava ); case RSIGNEDSHIFTASSIGN: case RSIGNEDSHIFTASSIGNX: return lhs.assign( operation(lhsValue, rhs, RSIGNEDSHIFT ), strictJava ); case RUNSIGNEDSHIFTASSIGN: case RUNSIGNEDSHIFTASSIGNX: return lhs.assign( operation(lhsValue, rhs, RUNSIGNEDSHIFT), strictJava ); default: throw new InterpreterError( "unimplemented operator in assignment BSH"); } } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { throw new EvalError( "Array initializer has no base type.", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
public Object eval( Class baseType, int dimensions, CallStack callstack, Interpreter interpreter ) throws EvalError { int numInitializers = jjtGetNumChildren(); // allocate the array to store the initializers int [] dima = new int [dimensions]; // description of the array // The other dimensions default to zero and are assigned when // the values are set. dima[0] = numInitializers; Object initializers = Array.newInstance( baseType, dima ); // Evaluate the initializers for (int i = 0; i < numInitializers; i++) { SimpleNode node = (SimpleNode)jjtGetChild(i); Object currentInitializer; if ( node instanceof BSHArrayInitializer ) { if ( dimensions < 2 ) throw new EvalError( "Invalid Location for Intializer, position: "+i, this, callstack ); currentInitializer = ((BSHArrayInitializer)node).eval( baseType, dimensions-1, callstack, interpreter); } else currentInitializer = node.eval( callstack, interpreter); if ( currentInitializer == Primitive.VOID ) throw new EvalError( "Void in array initializer, position"+i, this, callstack ); // Determine if any conversion is necessary on the initializers. // // Quick test to see if conversions apply: // If the dimensionality of the array is 1 then the elements of // the initializer can be primitives or boxable types. If it is // greater then the values must be array (object) types and there // are currently no conversions that we do on those. // If we have conversions on those in the future then we need to // get the real base type here instead of the dimensionless one. Object value = currentInitializer; if ( dimensions == 1 ) { // We do a bsh cast here. strictJava should be able to affect // the cast there when we tighten control try { value = Types.castObject( currentInitializer, baseType, Types.CAST ); } catch ( UtilEvalError e ) { throw e.toEvalError( "Error in array initializer", this, callstack ); } // unwrap any primitive, map voids to null, etc. value = Primitive.unwrap( value ); } // store the value in the array try { Array.set(initializers, i, value); } catch( IllegalArgumentException e ) { Interpreter.debug("illegal arg"+e); throwTypeError( baseType, currentInitializer, i, callstack ); } catch( ArrayStoreException e ) { // I think this can happen Interpreter.debug("arraystore"+e); throwTypeError( baseType, currentInitializer, i, callstack ); } } return initializers; }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
private void throwTypeError( Class baseType, Object initializer, int argNum, CallStack callstack ) throws EvalError { String rhsType; if (initializer instanceof Primitive) rhsType = ((Primitive)initializer).getType().getName(); else rhsType = Reflect.normalizeClassName( initializer.getClass()); throw new EvalError ( "Incompatible type: " + rhsType +" in initializer of array type: "+ baseType +" at position: "+argNum, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHClassDeclaration.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { int child = 0; // resolve superclass if any Class superClass = null; if ( extend ) { BSHAmbiguousName superNode = (BSHAmbiguousName)jjtGetChild(child++); superClass = superNode.toClass( callstack, interpreter ); } // Get interfaces Class [] interfaces = new Class[numInterfaces]; for( int i=0; i<numInterfaces; i++) { BSHAmbiguousName node = (BSHAmbiguousName)jjtGetChild(child++); interfaces[i] = node.toClass(callstack, interpreter); if ( !interfaces[i].isInterface() ) throw new EvalError( "Type: "+node.text+" is not an interface!", this, callstack ); } BSHBlock block; // Get the class body BSHBlock if ( child < jjtGetNumChildren() ) block = (BSHBlock)jjtGetChild(child); else block = new BSHBlock( ParserTreeConstants.JJTBLOCK ); try { return ClassGenerator.getClassGenerator().generateClass( name, modifiers, interfaces, superClass, block, isInterface, callstack, interpreter ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object eval( Reader in, NameSpace nameSpace, String sourceFileInfo /*, CallStack callstack */ ) throws EvalError { Object retVal = null; if ( Interpreter.DEBUG ) debug("eval: nameSpace = "+nameSpace); /* Create non-interactive local interpreter for this namespace with source from the input stream and out/err same as this interpreter. */ Interpreter localInterpreter = new Interpreter( in, out, err, false, nameSpace, this, sourceFileInfo ); CallStack callstack = new CallStack( nameSpace ); boolean eof = false; while(!eof) { SimpleNode node = null; try { eof = localInterpreter.Line(); if (localInterpreter.get_jjtree().nodeArity() > 0) { node = (SimpleNode)localInterpreter.get_jjtree().rootNode(); // nodes remember from where they were sourced node.setSourceFile( sourceFileInfo ); if ( TRACE ) println( "// " +node.getText() ); retVal = node.eval( callstack, localInterpreter ); // sanity check during development if ( callstack.depth() > 1 ) throw new InterpreterError( "Callstack growing: "+callstack); if ( retVal instanceof ReturnControl ) { retVal = ((ReturnControl)retVal).value; break; // non-interactive, return control now } if ( localInterpreter.showResults && retVal != Primitive.VOID ) println("<" + retVal + ">"); } } catch(ParseException e) { /* throw new EvalError( "Sourced file: "+sourceFileInfo+" parser Error: " + e.getMessage( DEBUG ), node, callstack ); */ if ( DEBUG ) // show extra "expecting..." info error( e.getMessage(DEBUG) ); // add the source file info and throw again e.setErrorSourceFile( sourceFileInfo ); throw e; } catch ( InterpreterError e ) { e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" internal Error: " + e.getMessage(), node, callstack); } catch ( TargetError e ) { // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow("Sourced file: "+sourceFileInfo); } catch ( EvalError e) { if ( DEBUG) e.printStackTrace(); // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow( "Sourced file: "+sourceFileInfo ); } catch ( Exception e) { if ( DEBUG) e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" unknown error: " + e.getMessage(), node, callstack); } catch(TokenMgrError e) { throw new EvalError( "Sourced file: "+sourceFileInfo+" Token Parsing Error: " + e.getMessage(), node, callstack ); } finally { localInterpreter.get_jjtree().reset(); // reinit the callstack if ( callstack.depth() > 1 ) { callstack.clear(); callstack.push( nameSpace ); } } } return Primitive.unwrap( retVal ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public void unset( String name ) throws EvalError { /* We jump through some hoops here to handle arbitrary cases like unset("bsh.foo"); */ CallStack callstack = new CallStack(); try { LHS lhs = globalNameSpace.getNameResolver( name ).toLHS( callstack, this ); if ( lhs.type != LHS.VARIABLE ) throw new EvalError("Can't unset, not a variable: "+name, SimpleNode.JAVACODE, new CallStack() ); //lhs.assign( null, false ); lhs.nameSpace.unsetVariable( name ); } catch ( UtilEvalError e ) { throw new EvalError( e.getMessage(), SimpleNode.JAVACODE, new CallStack() ); } }
// in org/gjt/sp/jedit/bsh/BSHVariableDeclarator.java
public Object eval( BSHType typeNode, CallStack callstack, Interpreter interpreter) throws EvalError { // null value means no value Object value = null; if ( jjtGetNumChildren() > 0 ) { SimpleNode initializer = (SimpleNode)jjtGetChild(0); /* If we have type info and the child is an array initializer pass it along... Else use the default eval style. (This allows array initializer to handle the problem... allowing for future enhancements in loosening types there). */ if ( (typeNode != null) && initializer instanceof BSHArrayInitializer ) value = ((BSHArrayInitializer)initializer).eval( typeNode.getBaseType(), typeNode.getArrayDims(), callstack, interpreter); else value = initializer.eval( callstack, interpreter); } if ( value == Primitive.VOID ) throw new EvalError("Void initializer.", this, callstack ); return value; }
17
              
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch(ReflectError e) { throw new EvalError("reflection error: " + e, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch (ReflectError e) { throw new EvalError("No such property: " + value, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( ReflectError e ) { throw new EvalError( "Error invoking Java method: "+e, callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch( UtilEvalError e) { throw new EvalError( "Invalid argument: " + "`"+paramNames[i]+"'" + " for method: " + name + " : " + e.getMessage(), callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( Capabilities.Unavailable e ) { throw new EvalError( "Defining classes currently requires reflective Accessibility.", block, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( ClassNotFoundException e ) { throw new EvalError( e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHType.java
catch(Exception e) { throw new EvalError("Couldn't construct array type", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( ReflectError e) { throw new EvalError( "Constructor error: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( Exception e ) { if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); throw new EvalError( "Error constructing inner class instance: "+e, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch( Exception e ) { throw new EvalError("Can't construct primitive array: " + e.getMessage(), this, callstack); }
// in org/gjt/sp/jedit/bsh/BSHArrayDimensions.java
catch(Exception e) { throw new EvalError( "Array index: " + i + " does not evaluate to an integer", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( InterpreterError e ) { e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" internal Error: " + e.getMessage(), node, callstack); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e) { if ( DEBUG) e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" unknown error: " + e.getMessage(), node, callstack); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(TokenMgrError e) { throw new EvalError( "Sourced file: "+sourceFileInfo+" Token Parsing Error: " + e.getMessage(), node, callstack ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw new EvalError( e.getMessage(), SimpleNode.JAVACODE, new CallStack() ); }
96
              
// in org/gjt/sp/jedit/bsh/BSHUnaryExpression.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { SimpleNode node = (SimpleNode)jjtGetChild(0); // If this is a unary increment of decrement (either pre or postfix) // then we need an LHS to which to assign the result. Otherwise // just do the unary operation for the value. try { if ( kind == INCR || kind == DECR ) { LHS lhs = ((BSHPrimaryExpression)node).toLHS( callstack, interpreter ); return lhsUnaryOperation( lhs, interpreter.getStrictJava() ); } else return unaryOperation( node.eval(callstack, interpreter), kind ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
public Object doSuffix( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError { // Handle ".class" suffix operation // Prefix must be a BSHType if ( operation == CLASS ) if ( obj instanceof BSHType ) { if ( toLHS ) throw new EvalError("Can't assign .class", this, callstack ); NameSpace namespace = callstack.top(); return ((BSHType)obj).getType( callstack, interpreter ); } else throw new EvalError( "Attempt to use .class suffix on non class.", this, callstack ); /* Evaluate our prefix if it needs evaluating first. If this is the first evaluation our prefix mayb be a Node (directly from the PrimaryPrefix) - eval() it to an object. If it's an LHS, resolve to a value. Note: The ambiguous name construct is now necessary where the node may be an ambiguous name. If this becomes common we might want to make a static method nodeToObject() or something. The point is that we can't just eval() - we need to direct the evaluation to the context sensitive type of result; namely object, class, etc. */ if ( obj instanceof SimpleNode ) if ( obj instanceof BSHAmbiguousName ) obj = ((BSHAmbiguousName)obj).toObject(callstack, interpreter); else obj = ((SimpleNode)obj).eval(callstack, interpreter); else if ( obj instanceof LHS ) try { obj = ((LHS)obj).getValue(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } try { switch(operation) { case INDEX: return doIndex( obj, toLHS, callstack, interpreter ); case NAME: return doName( obj, toLHS, callstack, interpreter ); case PROPERTY: return doProperty( toLHS, obj, callstack, interpreter ); default: throw new InterpreterError( "Unknown suffix type" ); } } catch(ReflectError e) { throw new EvalError("reflection error: " + e, this, callstack ); } catch(InvocationTargetException e) { throw new TargetError( "target exception", e.getTargetException(), this, callstack, true); } }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
private Object doName( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError, ReflectError, InvocationTargetException { try { // .length on array if ( field.equals("length") && obj.getClass().isArray() ) if ( toLHS ) throw new EvalError( "Can't assign array length", this, callstack ); else return new Primitive(Array.getLength(obj)); // field access if ( jjtGetNumChildren() == 0 ) if ( toLHS ) return Reflect.getLHSObjectField(obj, field); else return Reflect.getObjectFieldValue( obj, field ); // Method invocation // (LHS or non LHS evaluation can both encounter method calls) Object[] oa = ((BSHArguments)jjtGetChild(0)).getArguments( callstack, interpreter); // TODO: // Note: this try/catch block is copied from BSHMethodInvocation // we need to factor out this common functionality and make sure // we handle all cases ... (e.g. property style access, etc.) // maybe move this to Reflect ? try { return Reflect.invokeObjectMethod( obj, field, oa, interpreter, callstack, this ); } catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); } catch ( InvocationTargetException e ) { String msg = "Method Invocation "+field; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); } } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
static int getIndexAux( Object obj, CallStack callstack, Interpreter interpreter, SimpleNode callerInfo ) throws EvalError { if ( !obj.getClass().isArray() ) throw new EvalError("Not an array", callerInfo, callstack ); int index; try { Object indexVal = ((SimpleNode)callerInfo.jjtGetChild(0)).eval( callstack, interpreter ); if ( !(indexVal instanceof Primitive) ) indexVal = Types.castObject( indexVal, Integer.TYPE, Types.ASSIGNMENT ); index = ((Primitive)indexVal).intValue(); } catch( UtilEvalError e ) { Interpreter.debug("doIndex: "+e); throw e.toEvalError( "Arrays may only be indexed by integer types.", callerInfo, callstack ); } return index; }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
private Object doIndex( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter ) throws EvalError, ReflectError { int index = getIndexAux( obj, callstack, interpreter, this ); if ( toLHS ) return new LHS(obj, index); else try { return Reflect.getIndex(obj, index); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
private Object doProperty( boolean toLHS, Object obj, CallStack callstack, Interpreter interpreter ) throws EvalError { if(obj == Primitive.VOID) throw new EvalError( "Attempt to access property on undefined variable or class name", this, callstack ); if ( obj instanceof Primitive ) throw new EvalError("Attempt to access property on a primitive", this, callstack ); Object value = ((SimpleNode)jjtGetChild(0)).eval( callstack, interpreter); if ( !( value instanceof String ) ) throw new EvalError( "Property expression must be a String or identifier.", this, callstack ); if ( toLHS ) return new LHS(obj, (String)value); // Property style access to Hashtable or Map CollectionManager cm = CollectionManager.getCollectionManager(); if ( cm.isMap( obj ) ) { Object val = cm.getFromMap( obj, value/*key*/ ); return ( val == null ? val = Primitive.NULL : val ); } try { return Reflect.getObjectProperty( obj, (String)value ); } catch ( UtilEvalError e) { throw e.toEvalError( "Property: "+value, this, callstack ); } catch (ReflectError e) { throw new EvalError("No such property: " + value, this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BshMethod.java
public Object invoke( Object[] argValues, Interpreter interpreter ) throws EvalError { return invoke( argValues, interpreter, null, null, false ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
public Object invoke( Object[] argValues, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo ) throws EvalError { return invoke( argValues, interpreter, callstack, callerInfo, false ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
Object invoke( Object[] argValues, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean overrideNameSpace ) throws EvalError { if ( argValues != null ) for (int i=0; i<argValues.length; i++) if ( argValues[i] == null ) throw new Error("HERE!"); if ( javaMethod != null ) try { return Reflect.invokeMethod( javaMethod, javaObject, argValues ); } catch ( ReflectError e ) { throw new EvalError( "Error invoking Java method: "+e, callerInfo, callstack ); } catch ( InvocationTargetException e2 ) { throw new TargetError( "Exception invoking imported object method.", e2, callerInfo, callstack, true/*isNative*/ ); } // is this a syncrhonized method? if ( modifiers != null && modifiers.hasModifier("synchronized") ) { // The lock is our declaring namespace's This reference // (the method's 'super'). Or in the case of a class it's the // class instance. Object lock; if ( declaringNameSpace.isClass ) { try { lock = declaringNameSpace.getClassInstance(); } catch ( UtilEvalError e ) { throw new InterpreterError( "Can't get class instance for synchronized method."); } } else lock = declaringNameSpace.getThis(interpreter); // ??? synchronized( lock ) { return invokeImpl( argValues, interpreter, callstack, callerInfo, overrideNameSpace ); } } else return invokeImpl( argValues, interpreter, callstack, callerInfo, overrideNameSpace ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
private Object invokeImpl( Object[] argValues, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean overrideNameSpace ) throws EvalError { Class returnType = getReturnType(); Class [] paramTypes = getParameterTypes(); // If null callstack if ( callstack == null ) callstack = new CallStack( declaringNameSpace ); if ( argValues == null ) argValues = new Object [] { }; // Cardinality (number of args) mismatch if ( argValues.length != numArgs ) { /* // look for help string try { // should check for null namespace here String help = (String)declaringNameSpace.get( "bsh.help."+name, interpreter ); interpreter.println(help); return Primitive.VOID; } catch ( Exception e ) { throw eval error } */ throw new EvalError( "Wrong number of arguments for local method: " + name, callerInfo, callstack ); } // Make the local namespace for the method invocation NameSpace localNameSpace; if ( overrideNameSpace ) localNameSpace = callstack.top(); else { localNameSpace = new NameSpace( declaringNameSpace, name ); localNameSpace.isMethod = true; } // should we do this for both cases above? localNameSpace.setNode( callerInfo ); // set the method parameters in the local namespace for(int i=0; i<numArgs; i++) { // Set typed variable if ( paramTypes[i] != null ) { try { argValues[i] = //Types.getAssignableForm( argValues[i], paramTypes[i] ); Types.castObject( argValues[i], paramTypes[i], Types.ASSIGNMENT ); } catch( UtilEvalError e) { throw new EvalError( "Invalid argument: " + "`"+paramNames[i]+"'" + " for method: " + name + " : " + e.getMessage(), callerInfo, callstack ); } try { localNameSpace.setTypedVariable( paramNames[i], paramTypes[i], argValues[i], null/*modifiers*/); } catch ( UtilEvalError e2 ) { throw e2.toEvalError( "Typed method parameter assignment", callerInfo, callstack ); } } // Set untyped variable else // untyped param { // getAssignable would catch this for typed param if ( argValues[i] == Primitive.VOID) throw new EvalError( "Undefined variable or class name, parameter: " + paramNames[i] + " to method: " + name, callerInfo, callstack ); else try { localNameSpace.setLocalVariable( paramNames[i], argValues[i], interpreter.getStrictJava() ); } catch ( UtilEvalError e3 ) { throw e3.toEvalError( callerInfo, callstack ); } } } // Push the new namespace on the call stack if ( !overrideNameSpace ) callstack.push( localNameSpace ); // Invoke the block, overriding namespace with localNameSpace Object ret = methodBody.eval( callstack, interpreter, true/*override*/ ); // save the callstack including the called method, just for error mess CallStack returnStack = callstack.copy(); // Get back to caller namespace if ( !overrideNameSpace ) callstack.pop(); ReturnControl retControl = null; if ( ret instanceof ReturnControl ) { retControl = (ReturnControl)ret; // Method body can only use 'return' statment type return control. if ( retControl.kind == retControl.RETURN ) ret = ((ReturnControl)ret).value; else // retControl.returnPoint is the Node of the return statement throw new EvalError("'continue' or 'break' in method body", retControl.returnPoint, returnStack ); // Check for explicit return of value from void method type. // retControl.returnPoint is the Node of the return statement if ( returnType == Void.TYPE && ret != Primitive.VOID ) throw new EvalError( "Cannot return value from void method", retControl.returnPoint, returnStack); } if ( returnType != null ) { // If return type void, return void as the value. if ( returnType == Void.TYPE ) return Primitive.VOID; // return type is a class try { ret = // Types.getAssignableForm( ret, (Class)returnType ); Types.castObject( ret, returnType, Types.ASSIGNMENT ); } catch( UtilEvalError e ) { // Point to return statement point if we had one. // (else it was implicit return? What's the case here?) SimpleNode node = callerInfo; if ( retControl != null ) node = retControl.returnPoint; throw e.toEvalError( "Incorrect type returned from method: " + name + e.getMessage(), node, callstack ); } } return ret; }
// in org/gjt/sp/jedit/bsh/This.java
public Object invokeMethod( String name, Object [] args ) throws EvalError { // null callstack, one will be created for us return invokeMethod( name, args, null/*declaringInterpreter*/, null, null, false/*declaredOnly*/ ); }
// in org/gjt/sp/jedit/bsh/This.java
public Object invokeMethod( String methodName, Object [] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean declaredOnly ) throws EvalError { /* Wrap nulls. This is a bit of a cludge to address a deficiency in the class generator whereby it does not wrap nulls on method delegate. See Class Generator.java. If we fix that then we can remove this. (just have to generate the code there.) */ if ( args != null ) { Object [] oa = new Object [args.length]; for(int i=0; i<args.length; i++) oa[i] = ( args[i] == null ? Primitive.NULL : args[i] ); args = oa; } if ( interpreter == null ) interpreter = declaringInterpreter; if ( callstack == null ) callstack = new CallStack( namespace ); if ( callerInfo == null ) callerInfo = SimpleNode.JAVACODE; // Find the bsh method Class [] types = Types.getTypes( args ); BshMethod bshMethod = null; try { bshMethod = namespace.getMethod( methodName, types, declaredOnly ); } catch ( UtilEvalError e ) { // leave null } if ( bshMethod != null ) return bshMethod.invoke( args, interpreter, callstack, callerInfo ); /* No scripted method of that name. Implement the required part of the Object protocol: public int hashCode(); public boolean equals(java.lang.Object); public java.lang.String toString(); if these were not handled by scripted methods we must provide a default impl. */ // a default toString() that shows the interfaces we implement if ( methodName.equals("toString" ) ) return toString(); // a default hashCode() if ( methodName.equals("hashCode" ) ) return new Integer(this.hashCode()); // a default equals() testing for equality with the This reference if ( methodName.equals("equals" ) ) { Object obj = args[0]; return new Boolean( this == obj ); } // Look for a default invoke() handler method in the namespace // Note: this code duplicates that in NameSpace getCommand() // is that ok? try { bshMethod = namespace.getMethod( "invoke", new Class [] { null, null } ); } catch ( UtilEvalError e ) { /*leave null*/ } // Call script "invoke( String methodName, Object [] args ); if ( bshMethod != null ) return bshMethod.invoke( new Object [] { methodName, args }, interpreter, callstack, callerInfo ); throw new EvalError("Method " + StringUtil.methodString( methodName, types ) + " not found in bsh scripted object: "+ namespace.getName(), callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHArguments.java
public Object[] getArguments( CallStack callstack, Interpreter interpreter) throws EvalError { // evaluate each child Object[] args = new Object[jjtGetNumChildren()]; for(int i = 0; i < args.length; i++) { args[i] = ((SimpleNode)jjtGetChild(i)).eval(callstack, interpreter); if ( args[i] == Primitive.VOID ) throw new EvalError( "Undefined argument: " + ((SimpleNode)jjtGetChild(i)).getText(), this, callstack ); } return args; }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
public Class generateClass( String name, Modifiers modifiers, Class [] interfaces, Class superClass, BSHBlock block, boolean isInterface, CallStack callstack, Interpreter interpreter ) throws EvalError { // Delegate to the static method return generateClassImpl( name, modifiers, interfaces, superClass, block, isInterface, callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
public static Class generateClassImpl( String name, Modifiers modifiers, Class [] interfaces, Class superClass, BSHBlock block, boolean isInterface, CallStack callstack, Interpreter interpreter ) throws EvalError { // Scripting classes currently requires accessibility // This can be eliminated with a bit more work. try { Capabilities.setAccessibility( true ); } catch ( Capabilities.Unavailable e ) { throw new EvalError( "Defining classes currently requires reflective Accessibility.", block, callstack ); } NameSpace enclosingNameSpace = callstack.top(); String packageName = enclosingNameSpace.getPackage(); String className = enclosingNameSpace.isClass ? ( enclosingNameSpace.getName()+"$"+name ) : name; String fqClassName = packageName == null ? className : packageName + "." + className; BshClassManager bcm = interpreter.getClassManager(); // Race condition here... bcm.definingClass( fqClassName ); // Create the class static namespace NameSpace classStaticNameSpace = new NameSpace( enclosingNameSpace, className); classStaticNameSpace.isClass = true; callstack.push( classStaticNameSpace ); // Evaluate any inner class class definitions in the block // effectively recursively call this method for contained classes first block.evalBlock( callstack, interpreter, true/*override*/, ClassNodeFilter.CLASSCLASSES ); // Generate the type for our class Variable [] variables = getDeclaredVariables( block, callstack, interpreter, packageName ); DelayedEvalBshMethod [] methods = getDeclaredMethods( block, callstack, interpreter, packageName ); ClassGeneratorUtil classGenerator = new ClassGeneratorUtil( modifiers, className, packageName, superClass, interfaces, variables, methods, classStaticNameSpace, isInterface ); byte [] code = classGenerator.generateClass(); // if debug, write out the class file to debugClasses directory String dir = System.getProperty("debugClasses"); if ( dir != null ) try { FileOutputStream out= new FileOutputStream( dir+"/"+className+".class" ); out.write(code); out.close(); } catch ( IOException e ) { } // Define the new class in the classloader Class genClass = bcm.defineClass( fqClassName, code ); // import the unq name into parent enclosingNameSpace.importClass( fqClassName.replace('$','.') ); try { classStaticNameSpace.setLocalVariable( ClassGeneratorUtil.BSHINIT, block, false/*strictJava*/ ); } catch ( UtilEvalError e ) { throw new InterpreterError("unable to init static: "+e ); } // Give the static space its class static import // important to do this after all classes are defined classStaticNameSpace.setClassStatic( genClass ); // evaluate the static portion of the block in the static space block.evalBlock( callstack, interpreter, true/*override*/, ClassNodeFilter.CLASSSTATIC ); callstack.pop(); if ( !genClass.isInterface() ) { // Set the static bsh This callback String bshStaticFieldName = ClassGeneratorUtil.BSHSTATIC+className; try { LHS lhs = Reflect.getLHSStaticField( genClass, bshStaticFieldName ); lhs.assign( classStaticNameSpace.getThis( interpreter ), false/*strict*/ ); } catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); } } bcm.doneDefiningClass( fqClassName ); return genClass; }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
static DelayedEvalBshMethod [] getDeclaredMethods( BSHBlock body, CallStack callstack, Interpreter interpreter, String defaultPackage ) throws EvalError { List methods = new ArrayList(); for( int child=0; child<body.jjtGetNumChildren(); child++ ) { SimpleNode node = (SimpleNode)body.jjtGetChild(child); if ( node instanceof BSHMethodDeclaration ) { BSHMethodDeclaration md = (BSHMethodDeclaration)node; md.insureNodesParsed(); Modifiers modifiers = md.modifiers; String name = md.name; String returnType = md.getReturnTypeDescriptor( callstack, interpreter, defaultPackage ); BSHReturnType returnTypeNode = md.getReturnTypeNode(); BSHFormalParameters paramTypesNode = md.paramsNode; String [] paramTypes = paramTypesNode.getTypeDescriptors( callstack, interpreter, defaultPackage ); DelayedEvalBshMethod bm = new DelayedEvalBshMethod( name, returnType, returnTypeNode, md.paramsNode.getParamNames(), paramTypes, paramTypesNode, md.blockNode, null/*declaringNameSpace*/, modifiers, callstack, interpreter ); methods.add( bm ); } } return (DelayedEvalBshMethod [])methods.toArray( new DelayedEvalBshMethod[0] ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object invokeObjectMethod( Object object, String methodName, Object[] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo ) throws ReflectError, EvalError, InvocationTargetException { // Bsh scripted object if ( object instanceof This && !This.isExposedThisMethod(methodName) ) return ((This)object).invokeMethod( methodName, args, interpreter, callstack, callerInfo, false/*delcaredOnly*/ ); // Plain Java object, find the java method try { BshClassManager bcm = interpreter == null ? null : interpreter.getClassManager(); Class clas = object.getClass(); Method method = resolveExpectedJavaMethod( bcm, clas, object, methodName, args, false ); return invokeMethod( method, object, args ); } catch ( UtilEvalError e ) { throw e.toEvalError( callerInfo, callstack ); } }
// in org/gjt/sp/jedit/bsh/SimpleNode.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { throw new InterpreterError( "Unimplemented or inappropriate for " + getClass().getName() ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
public Object toObject( CallStack callstack, Interpreter interpreter ) throws EvalError { return toObject( callstack, interpreter, false ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
Object toObject( CallStack callstack, Interpreter interpreter, boolean forceClass ) throws EvalError { try { return getName( callstack.top() ).toObject( callstack, interpreter, forceClass ); } catch ( UtilEvalError e ) { //e.printStackTrace(); throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
public Class toClass( CallStack callstack, Interpreter interpreter ) throws EvalError { try { return getName( callstack.top() ).toClass(); } catch ( ClassNotFoundException e ) { throw new EvalError( e.getMessage(), this, callstack ); } catch ( UtilEvalError e2 ) { // ClassPathException is a type of UtilEvalError throw e2.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
public LHS toLHS( CallStack callstack, Interpreter interpreter) throws EvalError { try { return getName( callstack.top() ).toLHS( callstack, interpreter ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { throw new InterpreterError( "Don't know how to eval an ambiguous name!" +" Use toObject() if you want an object." ); }
// in org/gjt/sp/jedit/bsh/XThis.java
public Object invokeImpl( Object proxy, Method method, Object[] args ) throws EvalError { String methodName = method.getName(); CallStack callstack = new CallStack( namespace ); /* If equals() is not explicitly defined we must override the default implemented by the This object protocol for scripted object. To support XThis equals() must test for equality with the generated proxy object, not the scripted bsh This object; otherwise callers from outside in Java will not see a the proxy object as equal to itself. */ BshMethod equalsMethod = null; try { equalsMethod = namespace.getMethod( "equals", new Class [] { Object.class } ); } catch ( UtilEvalError e ) {/*leave null*/ } if ( methodName.equals("equals" ) && equalsMethod == null ) { Object obj = args[0]; return new Boolean( proxy == obj ); } /* If toString() is not explicitly defined override the default to show the proxy interfaces. */ BshMethod toStringMethod = null; try { toStringMethod = namespace.getMethod( "toString", new Class [] { } ); } catch ( UtilEvalError e ) {/*leave null*/ } if ( methodName.equals("toString" ) && toStringMethod == null) { Class [] ints = proxy.getClass().getInterfaces(); // XThis.this refers to the enclosing class instance StringBuilder sb = new StringBuilder( XThis.this.toString() + "\nimplements:" ); for(int i=0; i<ints.length; i++) sb.append( " "+ ints[i].getName() + ((ints.length > 1)?",":"") ); return sb.toString(); } Class [] paramTypes = method.getParameterTypes(); return Primitive.unwrap( invokeMethod( methodName, Primitive.wrap(args, paramTypes) ) ); }
// in org/gjt/sp/jedit/bsh/BSHCastExpression.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { NameSpace namespace = callstack.top(); Class toType = ((BSHType)jjtGetChild(0)).getType( callstack, interpreter ); SimpleNode expression = (SimpleNode)jjtGetChild(1); // evaluate the expression Object fromValue = expression.eval(callstack, interpreter); Class fromType = fromValue.getClass(); // TODO: need to add isJavaCastable() test for strictJava // (as opposed to isJavaAssignable()) try { return Types.castObject( fromValue, toType, Types.CAST ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHPrimaryExpression.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { return eval( false, callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/BSHPrimaryExpression.java
public LHS toLHS( CallStack callstack, Interpreter interpreter) throws EvalError { Object obj = eval( true, callstack, interpreter ); if ( ! (obj instanceof LHS) ) throw new EvalError("Can't assign to:", this, callstack ); else return (LHS)obj; }
// in org/gjt/sp/jedit/bsh/BSHPrimaryExpression.java
private Object eval( boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError { Object obj = jjtGetChild(0); int numChildren = jjtGetNumChildren(); for(int i=1; i<numChildren; i++) obj = ((BSHPrimarySuffix)jjtGetChild(i)).doSuffix( obj, toLHS, callstack, interpreter); /* If the result is a Node eval() it to an object or LHS (as determined by toLHS) */ if ( obj instanceof SimpleNode ) if ( obj instanceof BSHAmbiguousName ) if ( toLHS ) obj = ((BSHAmbiguousName)obj).toLHS( callstack, interpreter); else obj = ((BSHAmbiguousName)obj).toObject( callstack, interpreter); else // Some arbitrary kind of node if ( toLHS ) // is this right? throw new EvalError("Can't assign to prefix.", this, callstack ); else obj = ((SimpleNode)obj).eval(callstack, interpreter); // return LHS or value object as determined by toLHS if ( obj instanceof LHS ) if ( toLHS ) return obj; else try { return ((LHS)obj).getValue(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } else return obj; }
// in org/gjt/sp/jedit/bsh/BSHLiteral.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { if ( value == null ) throw new InterpreterError("Null in bsh literal: "+value); return value; }
// in org/gjt/sp/jedit/bsh/BSHTypedVariableDeclaration.java
Class evalType( CallStack callstack, Interpreter interpreter ) throws EvalError { BSHType typeNode = getTypeNode(); return typeNode.getType( callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/BSHTypedVariableDeclaration.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { try { NameSpace namespace = callstack.top(); BSHType typeNode = getTypeNode(); Class type = typeNode.getType( callstack, interpreter ); BSHVariableDeclarator [] bvda = getDeclarators(); for (int i = 0; i < bvda.length; i++) { BSHVariableDeclarator dec = bvda[i]; // Type node is passed down the chain for array initializers // which need it under some circumstances Object value = dec.eval( typeNode, callstack, interpreter); try { namespace.setTypedVariable( dec.name, type, value, modifiers ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } } } catch ( EvalError e ) { e.reThrow( "Typed variable declaration" ); } return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHWhileStatement.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { int numChild = jjtGetNumChildren(); // Order of body and condition is swapped for do / while SimpleNode condExp, body = null; if ( isDoStatement ) { condExp = (SimpleNode)jjtGetChild(1); body =(SimpleNode)jjtGetChild(0); } else { condExp = (SimpleNode)jjtGetChild(0); if ( numChild > 1 ) // has body, else just for side effects body =(SimpleNode)jjtGetChild(1); } boolean doOnceFlag = isDoStatement; while( doOnceFlag || BSHIfStatement.evaluateCondition(condExp, callstack, interpreter ) ) { if ( body == null ) // no body? continue; Object ret = body.eval(callstack, interpreter); boolean breakout = false; if(ret instanceof ReturnControl) { switch(((ReturnControl)ret).kind ) { case RETURN: return ret; case CONTINUE: continue; case BREAK: breakout = true; break; } } if(breakout) break; doOnceFlag = false; } return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHType.java
public Class getType( CallStack callstack, Interpreter interpreter ) throws EvalError { // return cached type if available if ( type != null ) return type; // first node will either be PrimitiveType or AmbiguousName SimpleNode node = getTypeNode(); if ( node instanceof BSHPrimitiveType ) baseType = ((BSHPrimitiveType)node).getType(); else baseType = ((BSHAmbiguousName)node).toClass( callstack, interpreter ); if ( arrayDims > 0 ) { try { // Get the type by constructing a prototype array with // arbitrary (zero) length in each dimension. int[] dims = new int[arrayDims]; // int array default zeros Object obj = Array.newInstance(baseType, dims); type = obj.getClass(); } catch(Exception e) { throw new EvalError("Couldn't construct array type", this, callstack ); } } else type = baseType; // hack... sticking to first interpreter that resolves this // see comments on type instance variable interpreter.getClassManager().addListener(this); return type; }
// in org/gjt/sp/jedit/bsh/BSHForStatement.java
public Object eval(CallStack callstack , Interpreter interpreter) throws EvalError { int i = 0; if(hasForInit) forInit = ((SimpleNode)jjtGetChild(i++)); if(hasExpression) expression = ((SimpleNode)jjtGetChild(i++)); if(hasForUpdate) forUpdate = ((SimpleNode)jjtGetChild(i++)); if(i < jjtGetNumChildren()) // should normally be statement = ((SimpleNode)jjtGetChild(i)); NameSpace enclosingNameSpace= callstack.top(); BlockNameSpace forNameSpace = new BlockNameSpace( enclosingNameSpace ); /* Note: some interesting things are going on here. 1) We swap instead of push... The primary mode of operation acts like we are in the enclosing namespace... (super must be preserved, etc.) 2) We do *not* call the body block eval with the namespace override. Instead we allow it to create a second subordinate BlockNameSpace child of the forNameSpace. Variable propogation still works through the chain, but the block's child cleans the state between iteration. (which is correct Java behavior... see forscope4.bsh) */ // put forNameSpace it on the top of the stack // Note: it's important that there is only one exit point from this // method so that we can swap back the namespace. callstack.swap( forNameSpace ); // Do the for init if ( hasForInit ) forInit.eval( callstack, interpreter ); Object returnControl = Primitive.VOID; while(true) { if ( hasExpression ) { boolean cond = BSHIfStatement.evaluateCondition( expression, callstack, interpreter ); if ( !cond ) break; } boolean breakout = false; // switch eats a multi-level break here? if ( statement != null ) // not empty statement { // do *not* invoke special override for block... (see above) Object ret = statement.eval( callstack, interpreter ); if (ret instanceof ReturnControl) { switch(((ReturnControl)ret).kind) { case RETURN: returnControl = ret; breakout = true; break; case CONTINUE: break; case BREAK: breakout = true; break; } } } if ( breakout ) break; if ( hasForUpdate ) forUpdate.eval( callstack, interpreter ); } callstack.swap( enclosingNameSpace ); // put it back return returnControl; }
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { BSHBlock tryBlock = ((BSHBlock)jjtGetChild(0)); Vector catchParams = new Vector(); Vector catchBlocks = new Vector(); int nchild = jjtGetNumChildren(); Node node = null; int i=1; while((i < nchild) && ((node = jjtGetChild(i++)) instanceof BSHFormalParameter)) { catchParams.addElement(node); catchBlocks.addElement(jjtGetChild(i++)); node = null; } // finaly block BSHBlock finallyBlock = null; if(node != null) finallyBlock = (BSHBlock)node; // Why both of these? TargetError target = null; Throwable thrown = null; Object ret = null; /* Evaluate the contents of the try { } block and catch any resulting TargetErrors generated by the script. We save the callstack depth and if an exception is thrown we pop back to that depth before contiuing. The exception short circuited any intervening method context pops. Note: we the stack info... what do we do with it? append to exception message? */ int callstackDepth = callstack.depth(); try { ret = tryBlock.eval(callstack, interpreter); } catch( TargetError e ) { target = e; String stackInfo = "Bsh Stack: "; while ( callstack.depth() > callstackDepth ) stackInfo += "\t" + callstack.pop() +"\n"; } // unwrap the target error if ( target != null ) thrown = target.getTarget(); // If we have an exception, find a catch if (thrown != null) { int n = catchParams.size(); for(i=0; i<n; i++) { // Get catch block BSHFormalParameter fp = (BSHFormalParameter)catchParams.elementAt(i); // Should cache this subject to classloader change message // Evaluation of the formal parameter simply resolves its // type via the specified namespace.. it doesn't modify the // namespace. fp.eval( callstack, interpreter ); if ( fp.type == null && interpreter.getStrictJava() ) throw new EvalError( "(Strict Java) Untyped catch block", this, callstack ); // If the param is typed check assignability if ( fp.type != null ) try { thrown = (Throwable)Types.castObject( thrown/*rsh*/, fp.type/*lhsType*/, Types.ASSIGNMENT ); } catch( UtilEvalError e ) { /* Catch the mismatch and continue to try the next Note: this is innefficient, should have an isAssignableFrom() that doesn't throw // TODO: we do now have a way to test assignment // in castObject(), use it? */ continue; } // Found match, execute catch block BSHBlock cb = (BSHBlock)(catchBlocks.elementAt(i)); // Prepare to execute the block. // We must create a new BlockNameSpace to hold the catch // parameter and swap it on the stack after initializing it. NameSpace enclosingNameSpace = callstack.top(); BlockNameSpace cbNameSpace = new BlockNameSpace( enclosingNameSpace ); try { if ( fp.type == BSHFormalParameter.UNTYPED ) // set an untyped variable directly in the block cbNameSpace.setBlockVariable( fp.name, thrown ); else { // set a typed variable (directly in the block) Modifiers modifiers = new Modifiers(); cbNameSpace.setTypedVariable( fp.name, fp.type, thrown, new Modifiers()/*none*/ ); } } catch ( UtilEvalError e ) { throw new InterpreterError( "Unable to set var in catch block namespace." ); } // put cbNameSpace on the top of the stack callstack.swap( cbNameSpace ); try { ret = cb.eval( callstack, interpreter ); } finally { // put it back callstack.swap( enclosingNameSpace ); } target = null; // handled target break; } } // evaluate finally block if(finallyBlock != null) ret = finallyBlock.eval(callstack, interpreter); // exception fell through, throw it upward... if(target != null) throw target; if(ret instanceof ReturnControl) return ret; else return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { // type is either a class name or a primitive type SimpleNode type = (SimpleNode)jjtGetChild(0); // args is either constructor arguments or array dimensions SimpleNode args = (SimpleNode)jjtGetChild(1); if ( type instanceof BSHAmbiguousName ) { BSHAmbiguousName name = (BSHAmbiguousName)type; if (args instanceof BSHArguments) return objectAllocation(name, (BSHArguments)args, callstack, interpreter ); else return objectArrayAllocation(name, (BSHArrayDimensions)args, callstack, interpreter ); } else return primitiveArrayAllocation((BSHPrimitiveType)type, (BSHArrayDimensions)args, callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object objectAllocation( BSHAmbiguousName nameNode, BSHArguments argumentsNode, CallStack callstack, Interpreter interpreter ) throws EvalError { NameSpace namespace = callstack.top(); Object[] args = argumentsNode.getArguments( callstack, interpreter ); if ( args == null) throw new EvalError( "Null args in new.", this, callstack ); // Look for scripted class object Object obj = nameNode.toObject( callstack, interpreter, false/* force class*/ ); // Try regular class obj = nameNode.toObject( callstack, interpreter, true/*force class*/ ); Class type = null; if ( obj instanceof ClassIdentifier ) type = ((ClassIdentifier)obj).getTargetClass(); else throw new EvalError( "Unknown class: "+nameNode.text, this, callstack ); // Is an inner class style object allocation boolean hasBody = jjtGetNumChildren() > 2; if ( hasBody ) { BSHBlock body = (BSHBlock)jjtGetChild(2); if ( type.isInterface() ) return constructWithInterfaceBody( type, args, body, callstack, interpreter ); else return constructWithClassBody( type, args, body, callstack, interpreter ); } else return constructObject( type, args, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object constructObject( Class type, Object[] args, CallStack callstack ) throws EvalError { Object obj; try { obj = Reflect.constructObject( type, args ); } catch ( ReflectError e) { throw new EvalError( "Constructor error: " + e.getMessage(), this, callstack ); } catch(InvocationTargetException e) { // No need to wrap this debug Interpreter.debug("The constructor threw an exception:\n\t" + e.getTargetException()); throw new TargetError( "Object constructor", e.getTargetException(), this, callstack, true); } String className = type.getName(); // Is it an inner class? if ( className.indexOf("$") == -1 ) return obj; // Temporary hack to support inner classes // If the obj is a non-static inner class then import the context... // This is not a sufficient emulation of inner classes. // Replace this later... // work through to class 'this' This ths = callstack.top().getThis( null ); NameSpace instanceNameSpace = Name.getClassNameSpace( ths.getNameSpace() ); // Change the parent (which was the class static) to the class instance // We really need to check if we're a static inner class here first... // but for some reason Java won't show the static modifier on our // fake inner classes... could generate a flag field. if ( instanceNameSpace != null && className.startsWith( instanceNameSpace.getName() +"$") ) { try { ClassGenerator.getClassGenerator().setInstanceNameSpaceParent( obj, className, instanceNameSpace ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } } return obj; }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object constructWithClassBody( Class type, Object[] args, BSHBlock block, CallStack callstack, Interpreter interpreter ) throws EvalError { String name = callstack.top().getName() + "$" + (++innerClassCount); Modifiers modifiers = new Modifiers(); modifiers.addModifier( Modifiers.CLASS, "public" ); Class clas; try { clas = ClassGenerator.getClassGenerator() .generateClass( name, modifiers, null/*interfaces*/, type/*superClass*/, block, false/*isInterface*/, callstack, interpreter ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } try { return Reflect.constructObject( clas, args ); } catch ( Exception e ) { if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); throw new EvalError( "Error constructing inner class instance: "+e, this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object constructWithInterfaceBody( Class type, Object[] args, BSHBlock body, CallStack callstack, Interpreter interpreter ) throws EvalError { NameSpace namespace = callstack.top(); NameSpace local = new NameSpace(namespace, "AnonymousBlock"); callstack.push(local); body.eval( callstack, interpreter, true/*overrideNamespace*/ ); callstack.pop(); // statical import fields from the interface so that code inside // can refer to the fields directly (e.g. HEIGHT) local.importStatic( type ); try { return local.getThis(interpreter).getInterface( type ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object objectArrayAllocation( BSHAmbiguousName nameNode, BSHArrayDimensions dimensionsNode, CallStack callstack, Interpreter interpreter ) throws EvalError { NameSpace namespace = callstack.top(); Class type = nameNode.toClass( callstack, interpreter ); if ( type == null ) throw new EvalError( "Class " + nameNode.getName(namespace) + " not found.", this, callstack ); return arrayAllocation( dimensionsNode, type, callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object primitiveArrayAllocation( BSHPrimitiveType typeNode, BSHArrayDimensions dimensionsNode, CallStack callstack, Interpreter interpreter ) throws EvalError { Class type = typeNode.getType(); return arrayAllocation( dimensionsNode, type, callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object arrayAllocation( BSHArrayDimensions dimensionsNode, Class type, CallStack callstack, Interpreter interpreter ) throws EvalError { /* dimensionsNode can return either a fully intialized array or VOID. when VOID the prescribed array dimensions (defined and undefined) are contained in the node. */ Object result = dimensionsNode.eval( type, callstack, interpreter ); if ( result != Primitive.VOID ) return result; else return arrayNewInstance( type, dimensionsNode, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object arrayNewInstance( Class type, BSHArrayDimensions dimensionsNode, CallStack callstack ) throws EvalError { if ( dimensionsNode.numUndefinedDims > 0 ) { Object proto = Array.newInstance( type, new int [dimensionsNode.numUndefinedDims] ); // zeros type = proto.getClass(); } try { return Array.newInstance( type, dimensionsNode.definedDimensions); } catch( NegativeArraySizeException e1 ) { throw new TargetError( e1, this, callstack ); } catch( Exception e ) { throw new EvalError("Can't construct primitive array: " + e.getMessage(), this, callstack); } }
// in org/gjt/sp/jedit/bsh/Name.java
public Object invokeMethod( Interpreter interpreter, Object[] args, CallStack callstack, SimpleNode callerInfo ) throws UtilEvalError, EvalError, ReflectError, InvocationTargetException { String methodName = Name.suffix(value, 1); BshClassManager bcm = interpreter.getClassManager(); NameSpace namespace = callstack.top(); // Optimization - If classOfStaticMethod is set then we have already // been here and determined that this is a static method invocation. // Note: maybe factor this out with path below... clean up. if ( classOfStaticMethod != null ) { return Reflect.invokeStaticMethod( bcm, classOfStaticMethod, methodName, args ); } if ( !Name.isCompound(value) ) return invokeLocalMethod( interpreter, args, callstack, callerInfo ); // Note: if we want methods declared inside blocks to be accessible via // this.methodname() inside the block we could handle it here as a // special case. See also resolveThisFieldReference() special handling // for BlockNameSpace case. They currently work via the direct name // e.g. methodName(). String prefix = Name.prefix(value); // Superclass method invocation? (e.g. super.foo()) if ( prefix.equals("super") && Name.countParts(value) == 2 ) { // Allow getThis() to work through block namespaces first This ths = namespace.getThis( interpreter ); NameSpace thisNameSpace = ths.getNameSpace(); NameSpace classNameSpace = getClassNameSpace( thisNameSpace ); if ( classNameSpace != null ) { Object instance = classNameSpace.getClassInstance(); return ClassGenerator.getClassGenerator() .invokeSuperclassMethod( bcm, instance, methodName, args ); } } // Find target object or class identifier Name targetName = namespace.getNameResolver( prefix ); Object obj = targetName.toObject( callstack, interpreter ); if ( obj == Primitive.VOID ) throw new UtilEvalError( "Attempt to resolve method: "+methodName +"() on undefined variable or class name: "+targetName); // if we've got an object, resolve the method if ( !(obj instanceof ClassIdentifier) ) { if (obj instanceof Primitive) { if (obj == Primitive.NULL) throw new UtilTargetError( new NullPointerException( "Null Pointer in Method Invocation" ) ); // some other primitive // should avoid calling methods on primitive, as we do // in Name (can't treat primitive like an object message) // but the hole is useful right now. if ( Interpreter.DEBUG ) interpreter.debug( "Attempt to access method on primitive..." + " allowing bsh.Primitive to peek through for debugging"); } // found an object and it's not an undefined variable return Reflect.invokeObjectMethod( obj, methodName, args, interpreter, callstack, callerInfo ); } // It's a class // try static method if ( Interpreter.DEBUG ) Interpreter.debug("invokeMethod: trying static - " + targetName); Class clas = ((ClassIdentifier)obj).getTargetClass(); // cache the fact that this is a static method invocation on this class classOfStaticMethod = clas; if ( clas != null ) return Reflect.invokeStaticMethod( bcm, clas, methodName, args ); // return null; ??? throw new UtilEvalError("invokeMethod: unknown target: " + targetName); }
// in org/gjt/sp/jedit/bsh/Name.java
private Object invokeLocalMethod( Interpreter interpreter, Object[] args, CallStack callstack, SimpleNode callerInfo ) throws EvalError/*, ReflectError, InvocationTargetException*/ { if ( Interpreter.DEBUG ) Interpreter.debug( "invokeLocalMethod: " + value ); if ( interpreter == null ) throw new InterpreterError( "invokeLocalMethod: interpreter = null"); String commandName = value; Class [] argTypes = Types.getTypes( args ); // Check for existing method BshMethod meth = null; try { meth = namespace.getMethod( commandName, argTypes ); } catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); } // If defined, invoke it if ( meth != null ) return meth.invoke( args, interpreter, callstack, callerInfo ); BshClassManager bcm = interpreter.getClassManager(); // Look for a BeanShell command Object commandObject; try { commandObject = namespace.getCommand( commandName, argTypes, interpreter ); } catch ( UtilEvalError e ) { throw e.toEvalError("Error loading command: ", callerInfo, callstack ); } // should try to print usage here if nothing found if ( commandObject == null ) { // Look for a default invoke() handler method in the namespace // Note: this code duplicates that in This.java... should it? // Call on 'This' can never be a command BshMethod invokeMethod = null; try { invokeMethod = namespace.getMethod( "invoke", new Class [] { null, null } ); } catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); } if ( invokeMethod != null ) return invokeMethod.invoke( new Object [] { commandName, args }, interpreter, callstack, callerInfo ); throw new EvalError( "Command not found: " +StringUtil.methodString( commandName, argTypes ), callerInfo, callstack ); } if ( commandObject instanceof BshMethod ) return ((BshMethod)commandObject).invoke( args, interpreter, callstack, callerInfo ); if ( commandObject instanceof Class ) try { return Reflect.invokeCompiledCommand( ((Class)commandObject), args, interpreter, callstack ); } catch ( UtilEvalError e ) { throw e.toEvalError("Error invoking compiled command: ", callerInfo, callstack ); } throw new InterpreterError("invalid command type"); }
// in org/gjt/sp/jedit/bsh/BSHPackageDeclaration.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { BSHAmbiguousName name = (BSHAmbiguousName)jjtGetChild(0); NameSpace namespace = callstack.top(); namespace.setPackage( name.text ); // import the package we're in by default... namespace.importPackage( name.text ); return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHThrowStatement.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { Object obj = ((SimpleNode)jjtGetChild(0)).eval(callstack, interpreter); // need to loosen this to any throwable... do we need to handle // that in interpreter somewhere? check first... if(!(obj instanceof Exception)) throw new EvalError("Expression in 'throw' must be Exception type", this, callstack ); // wrap the exception in a TargetException to propogate it up throw new TargetError( (Exception)obj, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHBinaryExpression.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { Object lhs = ((SimpleNode)jjtGetChild(0)).eval(callstack, interpreter); /* Doing instanceof? Next node is a type. */ if (kind == INSTANCEOF) { // null object ref is not instance of any type if ( lhs == Primitive.NULL ) return new Primitive(false); Class rhs = ((BSHType)jjtGetChild(1)).getType( callstack, interpreter ); /* // primitive (number or void) cannot be tested for instanceof if (lhs instanceof Primitive) throw new EvalError("Cannot be instance of primitive type." ); */ /* Primitive (number or void) is not normally an instanceof anything. But for internal use we'll test true for the bsh.Primitive class. i.e. (5 instanceof bsh.Primitive) will be true */ if ( lhs instanceof Primitive ) if ( rhs == org.gjt.sp.jedit.bsh.Primitive.class ) return new Primitive(true); else return new Primitive(false); // General case - performe the instanceof based on assignability boolean ret = Types.isJavaBaseAssignable( rhs, lhs.getClass() ); return new Primitive(ret); } // The following two boolean checks were tacked on. // This could probably be smoothed out. /* Look ahead and short circuit evaluation of the rhs if: we're a boolean AND and the lhs is false. */ if ( kind == BOOL_AND || kind == BOOL_ANDX ) { Object obj = lhs; if ( isPrimitiveValue(lhs) ) obj = ((Primitive)lhs).getValue(); if ( obj instanceof Boolean && ( ((Boolean)obj).booleanValue() == false ) ) return new Primitive(false); } /* Look ahead and short circuit evaluation of the rhs if: we're a boolean AND and the lhs is false. */ if ( kind == BOOL_OR || kind == BOOL_ORX ) { Object obj = lhs; if ( isPrimitiveValue(lhs) ) obj = ((Primitive)lhs).getValue(); if ( obj instanceof Boolean && ( ((Boolean)obj).booleanValue() == true ) ) return new Primitive(true); } // end stuff that was tacked on for boolean short-circuiting. /* Are both the lhs and rhs either wrappers or primitive values? do binary op */ boolean isLhsWrapper = isWrapper( lhs ); Object rhs = ((SimpleNode)jjtGetChild(1)).eval(callstack, interpreter); boolean isRhsWrapper = isWrapper( rhs ); if ( ( isLhsWrapper || isPrimitiveValue( lhs ) ) && ( isRhsWrapper || isPrimitiveValue( rhs ) ) ) { // Special case for EQ on two wrapper objects if ( (isLhsWrapper && isRhsWrapper && kind == EQ)) { /* Don't auto-unwrap wrappers (preserve identity semantics) FALL THROUGH TO OBJECT OPERATIONS BELOW. */ } else try { return Primitive.binaryOperation(lhs, rhs, kind); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } } /* Doing the following makes it hard to use untyped vars... e.g. if ( arg == null ) ...what if arg is a primitive? The answer is that we should test only if the var is typed...? need to get that info here... else { // Do we have a mixture of primitive values and non-primitives ? // (primitiveValue = not null, not void) int primCount = 0; if ( isPrimitiveValue( lhs ) ) ++primCount; if ( isPrimitiveValue( rhs ) ) ++primCount; if ( primCount > 1 ) // both primitive types, should have been handled above throw new InterpreterError("should not be here"); else if ( primCount == 1 ) // mixture of one and the other throw new EvalError("Operator: '" + tokenImage[kind] +"' inappropriate for object / primitive combination.", this, callstack ); // else fall through to handle both non-primitive types // end check for primitive and non-primitive mix } */ /* Treat lhs and rhs as arbitrary objects and do the operation. (including NULL and VOID represented by their Primitive types) */ //System.out.println("binary op arbitrary obj: {"+lhs+"}, {"+rhs+"}"); switch(kind) { case EQ: return new Primitive((lhs == rhs)); case NE: return new Primitive((lhs != rhs)); case PLUS: if(lhs instanceof String || rhs instanceof String) return lhs.toString() + rhs.toString(); // FALL THROUGH TO DEFAULT CASE!!! default: if(lhs instanceof Primitive || rhs instanceof Primitive) if ( lhs == Primitive.VOID || rhs == Primitive.VOID ) throw new EvalError( "illegal use of undefined variable, class, or 'void' literal", this, callstack ); else if ( lhs == Primitive.NULL || rhs == Primitive.NULL ) throw new EvalError( "illegal use of null value or 'null' literal", this, callstack); throw new EvalError("Operator: '" + tokenImage[kind] + "' inappropriate for objects", this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHIfStatement.java
public Object eval(CallStack callstack, Interpreter interpreter) throws EvalError { Object ret = null; if( evaluateCondition( (SimpleNode)jjtGetChild(0), callstack, interpreter ) ) ret = ((SimpleNode)jjtGetChild(1)).eval(callstack, interpreter); else if(jjtGetNumChildren() > 2) ret = ((SimpleNode)jjtGetChild(2)).eval(callstack, interpreter); if(ret instanceof ReturnControl) return ret; else return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHIfStatement.java
public static boolean evaluateCondition( SimpleNode condExp, CallStack callstack, Interpreter interpreter) throws EvalError { Object obj = condExp.eval(callstack, interpreter); if(obj instanceof Primitive) { if ( obj == Primitive.VOID ) throw new EvalError("Condition evaluates to void type", condExp, callstack ); obj = ((Primitive)obj).getValue(); } if(obj instanceof Boolean) return ((Boolean)obj).booleanValue(); else throw new EvalError( "Condition must evaluate to a Boolean or boolean.", condExp, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHSwitchStatement.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { int numchild = jjtGetNumChildren(); int child = 0; SimpleNode switchExp = ((SimpleNode)jjtGetChild(child++)); Object switchVal = switchExp.eval( callstack, interpreter ); /* Note: this could be made clearer by adding an inner class for the cases and an object context for the child traversal. */ // first label BSHSwitchLabel label; Object node; ReturnControl returnControl=null; // get the first label if ( child >= numchild ) throw new EvalError("Empty switch statement.", this, callstack ); label = ((BSHSwitchLabel)jjtGetChild(child++)); // while more labels or blocks and haven't hit return control while ( child < numchild && returnControl == null ) { // if label is default or equals switchVal if ( label.isDefault || primitiveEquals( switchVal, label.eval( callstack, interpreter ), callstack, switchExp ) ) { // execute nodes, skipping labels, until a break or return while ( child < numchild ) { node = jjtGetChild(child++); if ( node instanceof BSHSwitchLabel ) continue; // eval it Object value = ((SimpleNode)node).eval( callstack, interpreter ); // should check to disallow continue here? if ( value instanceof ReturnControl ) { returnControl = (ReturnControl)value; break; } } } else { // skip nodes until next label while ( child < numchild ) { node = jjtGetChild(child++); if ( node instanceof BSHSwitchLabel ) { label = (BSHSwitchLabel)node; break; } } } } if ( returnControl != null && returnControl.kind == RETURN ) return returnControl; else return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHSwitchStatement.java
private boolean primitiveEquals( Object switchVal, Object targetVal, CallStack callstack, SimpleNode switchExp ) throws EvalError { if ( switchVal instanceof Primitive || targetVal instanceof Primitive ) try { // binaryOperation can return Primitive or wrapper type Object result = Primitive.binaryOperation( switchVal, targetVal, ParserConstants.EQ ); result = Primitive.unwrap( result ); return result.equals( Boolean.TRUE ); } catch ( UtilEvalError e ) { throw e.toEvalError( "Switch value: "+switchExp.getText()+": ", this, callstack ); } else return switchVal.equals( targetVal ); }
// in org/gjt/sp/jedit/bsh/BSHBlock.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { return eval( callstack, interpreter, false ); }
// in org/gjt/sp/jedit/bsh/BSHBlock.java
public Object eval( CallStack callstack, Interpreter interpreter, boolean overrideNamespace ) throws EvalError { Object syncValue = null; if ( isSynchronized ) { // First node is the expression on which to sync SimpleNode exp = ((SimpleNode)jjtGetChild(0)); syncValue = exp.eval(callstack, interpreter); } Object ret; if ( isSynchronized ) // Do the actual synchronization synchronized( syncValue ) { ret = evalBlock( callstack, interpreter, overrideNamespace, null/*filter*/); } else ret = evalBlock( callstack, interpreter, overrideNamespace, null/*filter*/ ); return ret; }
// in org/gjt/sp/jedit/bsh/BSHBlock.java
Object evalBlock( CallStack callstack, Interpreter interpreter, boolean overrideNamespace, NodeFilter nodeFilter ) throws EvalError { Object ret = Primitive.VOID; NameSpace enclosingNameSpace = null; if ( !overrideNamespace ) { enclosingNameSpace= callstack.top(); BlockNameSpace bodyNameSpace = new BlockNameSpace( enclosingNameSpace ); callstack.swap( bodyNameSpace ); } int startChild = isSynchronized ? 1 : 0; int numChildren = jjtGetNumChildren(); try { /* Evaluate block in two passes: First do class declarations then do everything else. */ for(int i=startChild; i<numChildren; i++) { SimpleNode node = ((SimpleNode)jjtGetChild(i)); if ( nodeFilter != null && !nodeFilter.isVisible( node ) ) continue; if ( node instanceof BSHClassDeclaration ) node.eval( callstack, interpreter ); } for(int i=startChild; i<numChildren; i++) { SimpleNode node = ((SimpleNode)jjtGetChild(i)); if ( node instanceof BSHClassDeclaration ) continue; // filter nodes if ( nodeFilter != null && !nodeFilter.isVisible( node ) ) continue; ret = node.eval( callstack, interpreter ); // statement or embedded block evaluated a return statement if ( ret instanceof ReturnControl ) break; } } finally { // make sure we put the namespace back when we leave. if ( !overrideNamespace ) callstack.swap( enclosingNameSpace ); } return ret; }
// in org/gjt/sp/jedit/bsh/BSHImportDeclaration.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { NameSpace namespace = callstack.top(); if ( superImport ) try { namespace.doSuperImport(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } else { if ( staticImport ) { if ( importPackage ) { Class clas = ((BSHAmbiguousName)jjtGetChild(0)).toClass( callstack, interpreter ); namespace.importStatic( clas ); } else throw new EvalError( "static field imports not supported yet", this, callstack ); } else { String name = ((BSHAmbiguousName)jjtGetChild(0)).text; if ( importPackage ) namespace.importPackage(name); else namespace.importClass(name); } } return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public Object invokeMethod( String methodName, Object [] args, Interpreter interpreter ) throws EvalError { return invokeMethod( methodName, args, interpreter, null, null ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public Object invokeMethod( String methodName, Object [] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo ) throws EvalError { return getThis( interpreter ).invokeMethod( methodName, args, interpreter, callstack, callerInfo, false/*declaredOnly*/ ); }
// in org/gjt/sp/jedit/bsh/BSHReturnStatement.java
public Object eval(CallStack callstack, Interpreter interpreter) throws EvalError { Object value; if(jjtGetNumChildren() > 0) value = ((SimpleNode)jjtGetChild(0)).eval(callstack, interpreter); else value = Primitive.VOID; return new ReturnControl( kind, value, this ); }
// in org/gjt/sp/jedit/bsh/EvalError.java
public void reThrow( String msg ) throws EvalError { prependMessage( msg ); throw this; }
// in org/gjt/sp/jedit/bsh/BSHTernaryExpression.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { SimpleNode cond = (SimpleNode)jjtGetChild(0), evalTrue = (SimpleNode)jjtGetChild(1), evalFalse = (SimpleNode)jjtGetChild(2); if ( BSHIfStatement.evaluateCondition( cond, callstack, interpreter ) ) return evalTrue.eval( callstack, interpreter ); else return evalFalse.eval( callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/BSHArrayDimensions.java
public Object eval( Class type, CallStack callstack, Interpreter interpreter ) throws EvalError { if ( Interpreter.DEBUG ) Interpreter.debug("array base type = "+type); baseType = type; return eval( callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/BSHArrayDimensions.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { SimpleNode child = (SimpleNode)jjtGetChild(0); /* Child is array initializer. Evaluate it and fill in the dimensions it returns. Initialized arrays are always fully defined (no undefined dimensions to worry about). The syntax uses the undefinedDimension count. e.g. int [][] { 1, 2 }; */ if (child instanceof BSHArrayInitializer) { if ( baseType == null ) throw new EvalError( "Internal Array Eval err: unknown base type", this, callstack ); Object initValue = ((BSHArrayInitializer)child).eval( baseType, numUndefinedDims, callstack, interpreter); Class arrayClass = initValue.getClass(); int actualDimensions = Reflect.getArrayDimensions(arrayClass); definedDimensions = new int[ actualDimensions ]; // Compare with number of dimensions actually created with the // number specified (syntax uses the undefined ones here) if ( definedDimensions.length != numUndefinedDims ) throw new EvalError( "Incompatible initializer. Allocation calls for a " + numUndefinedDims+ " dimensional array, but initializer is a " + actualDimensions + " dimensional array", this, callstack ); // fill in definedDimensions [] lengths Object arraySlice = initValue; for ( int i = 0; i < definedDimensions.length; i++ ) { definedDimensions[i] = Array.getLength( arraySlice ); if ( definedDimensions[i] > 0 ) arraySlice = Array.get(arraySlice, 0); } return initValue; } else // Evaluate the defined dimensions of the array { definedDimensions = new int[ numDefinedDims ]; for(int i = 0; i < numDefinedDims; i++) { try { Object length = ((SimpleNode)jjtGetChild(i)).eval( callstack, interpreter); definedDimensions[i] = ((Primitive)length).intValue(); } catch(Exception e) { throw new EvalError( "Array index: " + i + " does not evaluate to an integer", this, callstack ); } } } return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHMethodDeclaration.java
Class evalReturnType( CallStack callstack, Interpreter interpreter ) throws EvalError { insureNodesParsed(); if ( returnTypeNode != null ) return returnTypeNode.evalReturnType( callstack, interpreter ); else return null; }
// in org/gjt/sp/jedit/bsh/BSHMethodDeclaration.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { returnType = evalReturnType( callstack, interpreter ); evalNodes( callstack, interpreter ); // Install an *instance* of this method in the namespace. // See notes in BshMethod // This is not good... // need a way to update eval without re-installing... // so that we can re-eval params, etc. when classloader changes // look into this NameSpace namespace = callstack.top(); BshMethod bshMethod = new BshMethod( this, namespace, modifiers ); try { namespace.setMethod( name, bshMethod ); } catch ( UtilEvalError e ) { throw e.toEvalError(this,callstack); } return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHMethodDeclaration.java
private void evalNodes( CallStack callstack, Interpreter interpreter ) throws EvalError { insureNodesParsed(); // validate that the throws names are class names for(int i=firstThrowsClause; i<numThrows+firstThrowsClause; i++) ((BSHAmbiguousName)jjtGetChild(i)).toClass( callstack, interpreter ); paramsNode.eval( callstack, interpreter ); // if strictJava mode, check for loose parameters and return type if ( interpreter.getStrictJava() ) { for(int i=0; i<paramsNode.paramTypes.length; i++) if ( paramsNode.paramTypes[i] == null ) // Warning: Null callstack here. Don't think we need // a stack trace to indicate how we sourced the method. throw new EvalError( "(Strict Java Mode) Undeclared argument type, parameter: " + paramsNode.getParamNames()[i] + " in method: " + name, this, null ); if ( returnType == null ) // Warning: Null callstack here. Don't think we need // a stack trace to indicate how we sourced the method. throw new EvalError( "(Strict Java Mode) Undeclared return type for method: " + name, this, null ); } }
// in org/gjt/sp/jedit/bsh/BSHFormalParameters.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { if ( paramTypes != null ) return paramTypes; insureParsed(); Class [] paramTypes = new Class[numArgs]; for(int i=0; i<numArgs; i++) { BSHFormalParameter param = (BSHFormalParameter)jjtGetChild(i); paramTypes[i] = (Class)param.eval( callstack, interpreter ); } this.paramTypes = paramTypes; return paramTypes; }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { NameSpace namespace = callstack.top(); BSHAmbiguousName nameNode = getNameNode(); // Do not evaluate methods this() or super() in class instance space // (i.e. inside a constructor) if ( namespace.getParent() != null && namespace.getParent().isClass && ( nameNode.text.equals("super") || nameNode.text.equals("this") ) ) return Primitive.VOID; Name name = nameNode.getName(namespace); Object[] args = getArgsNode().getArguments(callstack, interpreter); // This try/catch block is replicated is BSHPrimarySuffix... need to // factor out common functionality... // Move to Reflect? try { return name.invokeMethod( interpreter, args, callstack, this); } catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); } catch ( InvocationTargetException e ) { String msg = "Method Invocation "+name; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHEnhancedForStatement.java
public Object eval( CallStack callstack , Interpreter interpreter ) throws EvalError { Class elementType = null; SimpleNode expression, statement=null; NameSpace enclosingNameSpace = callstack.top(); SimpleNode firstNode =((SimpleNode)jjtGetChild(0)); int nodeCount = jjtGetNumChildren(); if ( firstNode instanceof BSHType ) { elementType=((BSHType)firstNode).getType( callstack, interpreter ); expression=((SimpleNode)jjtGetChild(1)); if ( nodeCount>2 ) statement=((SimpleNode)jjtGetChild(2)); } else { expression=firstNode; if ( nodeCount>1 ) statement=((SimpleNode)jjtGetChild(1)); } BlockNameSpace eachNameSpace = new BlockNameSpace( enclosingNameSpace ); callstack.swap( eachNameSpace ); final Object iteratee = expression.eval( callstack, interpreter ); if ( iteratee == Primitive.NULL ) throw new EvalError("The collection, array, map, iterator, or " + "enumeration portion of a for statement cannot be null.", this, callstack ); CollectionManager cm = CollectionManager.getCollectionManager(); if ( !cm.isBshIterable( iteratee ) ) throw new EvalError("Can't iterate over type: " +iteratee.getClass(), this, callstack ); BshIterator iterator = cm.getBshIterator( iteratee ); Object returnControl = Primitive.VOID; while( iterator.hasNext() ) { try { if ( elementType != null ) eachNameSpace.setTypedVariable( varName/*name*/, elementType/*type*/, iterator.next()/*value*/, new Modifiers()/*none*/ ); else eachNameSpace.setVariable( varName, iterator.next(), false ); } catch ( UtilEvalError e ) { throw e.toEvalError( "for loop iterator variable:"+ varName, this, callstack ); } boolean breakout = false; // switch eats a multi-level break here? if ( statement != null ) // not empty statement { Object ret = statement.eval( callstack, interpreter ); if (ret instanceof ReturnControl) { switch(((ReturnControl)ret).kind) { case RETURN: returnControl = ret; breakout = true; break; case CONTINUE: break; case BREAK: breakout = true; break; } } } if (breakout) break; } callstack.swap(enclosingNameSpace); return returnControl; }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { BSHPrimaryExpression lhsNode = (BSHPrimaryExpression)jjtGetChild(0); if ( lhsNode == null ) throw new InterpreterError( "Error, null LHSnode" ); boolean strictJava = interpreter.getStrictJava(); LHS lhs = lhsNode.toLHS( callstack, interpreter); if ( lhs == null ) throw new InterpreterError( "Error, null LHS" ); // For operator-assign operations save the lhs value before evaluating // the rhs. This is correct Java behavior for postfix operations // e.g. i=1; i+=i++; // should be 2 not 3 Object lhsValue = null; if ( operator != ASSIGN ) // assign doesn't need the pre-value try { lhsValue = lhs.getValue(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } SimpleNode rhsNode = (SimpleNode)jjtGetChild(1); Object rhs; // implement "blocks" foo = { }; // if ( rhsNode instanceof BSHBlock ) // rsh = // else rhs = rhsNode.eval(callstack, interpreter); if ( rhs == Primitive.VOID ) throw new EvalError("Void assignment.", this, callstack ); try { switch(operator) { case ASSIGN: return lhs.assign( rhs, strictJava ); case PLUSASSIGN: return lhs.assign( operation(lhsValue, rhs, PLUS), strictJava ); case MINUSASSIGN: return lhs.assign( operation(lhsValue, rhs, MINUS), strictJava ); case STARASSIGN: return lhs.assign( operation(lhsValue, rhs, STAR), strictJava ); case SLASHASSIGN: return lhs.assign( operation(lhsValue, rhs, SLASH), strictJava ); case ANDASSIGN: case ANDASSIGNX: return lhs.assign( operation(lhsValue, rhs, BIT_AND), strictJava ); case ORASSIGN: case ORASSIGNX: return lhs.assign( operation(lhsValue, rhs, BIT_OR), strictJava ); case XORASSIGN: return lhs.assign( operation(lhsValue, rhs, XOR), strictJava ); case MODASSIGN: return lhs.assign( operation(lhsValue, rhs, MOD), strictJava ); case LSHIFTASSIGN: case LSHIFTASSIGNX: return lhs.assign( operation(lhsValue, rhs, LSHIFT), strictJava ); case RSIGNEDSHIFTASSIGN: case RSIGNEDSHIFTASSIGNX: return lhs.assign( operation(lhsValue, rhs, RSIGNEDSHIFT ), strictJava ); case RUNSIGNEDSHIFTASSIGN: case RUNSIGNEDSHIFTASSIGNX: return lhs.assign( operation(lhsValue, rhs, RUNSIGNEDSHIFT), strictJava ); default: throw new InterpreterError( "unimplemented operator in assignment BSH"); } } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHSwitchLabel.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { if ( isDefault ) return null; // should probably error SimpleNode label = ((SimpleNode)jjtGetChild(0)); return label.eval( callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { throw new EvalError( "Array initializer has no base type.", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
public Object eval( Class baseType, int dimensions, CallStack callstack, Interpreter interpreter ) throws EvalError { int numInitializers = jjtGetNumChildren(); // allocate the array to store the initializers int [] dima = new int [dimensions]; // description of the array // The other dimensions default to zero and are assigned when // the values are set. dima[0] = numInitializers; Object initializers = Array.newInstance( baseType, dima ); // Evaluate the initializers for (int i = 0; i < numInitializers; i++) { SimpleNode node = (SimpleNode)jjtGetChild(i); Object currentInitializer; if ( node instanceof BSHArrayInitializer ) { if ( dimensions < 2 ) throw new EvalError( "Invalid Location for Intializer, position: "+i, this, callstack ); currentInitializer = ((BSHArrayInitializer)node).eval( baseType, dimensions-1, callstack, interpreter); } else currentInitializer = node.eval( callstack, interpreter); if ( currentInitializer == Primitive.VOID ) throw new EvalError( "Void in array initializer, position"+i, this, callstack ); // Determine if any conversion is necessary on the initializers. // // Quick test to see if conversions apply: // If the dimensionality of the array is 1 then the elements of // the initializer can be primitives or boxable types. If it is // greater then the values must be array (object) types and there // are currently no conversions that we do on those. // If we have conversions on those in the future then we need to // get the real base type here instead of the dimensionless one. Object value = currentInitializer; if ( dimensions == 1 ) { // We do a bsh cast here. strictJava should be able to affect // the cast there when we tighten control try { value = Types.castObject( currentInitializer, baseType, Types.CAST ); } catch ( UtilEvalError e ) { throw e.toEvalError( "Error in array initializer", this, callstack ); } // unwrap any primitive, map voids to null, etc. value = Primitive.unwrap( value ); } // store the value in the array try { Array.set(initializers, i, value); } catch( IllegalArgumentException e ) { Interpreter.debug("illegal arg"+e); throwTypeError( baseType, currentInitializer, i, callstack ); } catch( ArrayStoreException e ) { // I think this can happen Interpreter.debug("arraystore"+e); throwTypeError( baseType, currentInitializer, i, callstack ); } } return initializers; }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
private void throwTypeError( Class baseType, Object initializer, int argNum, CallStack callstack ) throws EvalError { String rhsType; if (initializer instanceof Primitive) rhsType = ((Primitive)initializer).getType().getName(); else rhsType = Reflect.normalizeClassName( initializer.getClass()); throw new EvalError ( "Incompatible type: " + rhsType +" in initializer of array type: "+ baseType +" at position: "+argNum, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHClassDeclaration.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { int child = 0; // resolve superclass if any Class superClass = null; if ( extend ) { BSHAmbiguousName superNode = (BSHAmbiguousName)jjtGetChild(child++); superClass = superNode.toClass( callstack, interpreter ); } // Get interfaces Class [] interfaces = new Class[numInterfaces]; for( int i=0; i<numInterfaces; i++) { BSHAmbiguousName node = (BSHAmbiguousName)jjtGetChild(child++); interfaces[i] = node.toClass(callstack, interpreter); if ( !interfaces[i].isInterface() ) throw new EvalError( "Type: "+node.text+" is not an interface!", this, callstack ); } BSHBlock block; // Get the class body BSHBlock if ( child < jjtGetNumChildren() ) block = (BSHBlock)jjtGetChild(child); else block = new BSHBlock( ParserTreeConstants.JJTBLOCK ); try { return ClassGenerator.getClassGenerator().generateClass( name, modifiers, interfaces, superClass, block, isInterface, callstack, interpreter ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHFormalParameter.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { if ( jjtGetNumChildren() > 0 ) type = ((BSHType)jjtGetChild(0)).getType( callstack, interpreter ); else type = UNTYPED; return type; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object source( String filename, NameSpace nameSpace ) throws FileNotFoundException, IOException, EvalError { File file = pathToFile( filename ); if ( Interpreter.DEBUG ) debug("Sourcing file: "+file); Reader sourceIn = new BufferedReader( new FileReader(file) ); try { return eval( sourceIn, nameSpace, filename ); } finally { sourceIn.close(); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object source( String filename ) throws FileNotFoundException, IOException, EvalError { return source( filename, globalNameSpace ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object eval( Reader in, NameSpace nameSpace, String sourceFileInfo /*, CallStack callstack */ ) throws EvalError { Object retVal = null; if ( Interpreter.DEBUG ) debug("eval: nameSpace = "+nameSpace); /* Create non-interactive local interpreter for this namespace with source from the input stream and out/err same as this interpreter. */ Interpreter localInterpreter = new Interpreter( in, out, err, false, nameSpace, this, sourceFileInfo ); CallStack callstack = new CallStack( nameSpace ); boolean eof = false; while(!eof) { SimpleNode node = null; try { eof = localInterpreter.Line(); if (localInterpreter.get_jjtree().nodeArity() > 0) { node = (SimpleNode)localInterpreter.get_jjtree().rootNode(); // nodes remember from where they were sourced node.setSourceFile( sourceFileInfo ); if ( TRACE ) println( "// " +node.getText() ); retVal = node.eval( callstack, localInterpreter ); // sanity check during development if ( callstack.depth() > 1 ) throw new InterpreterError( "Callstack growing: "+callstack); if ( retVal instanceof ReturnControl ) { retVal = ((ReturnControl)retVal).value; break; // non-interactive, return control now } if ( localInterpreter.showResults && retVal != Primitive.VOID ) println("<" + retVal + ">"); } } catch(ParseException e) { /* throw new EvalError( "Sourced file: "+sourceFileInfo+" parser Error: " + e.getMessage( DEBUG ), node, callstack ); */ if ( DEBUG ) // show extra "expecting..." info error( e.getMessage(DEBUG) ); // add the source file info and throw again e.setErrorSourceFile( sourceFileInfo ); throw e; } catch ( InterpreterError e ) { e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" internal Error: " + e.getMessage(), node, callstack); } catch ( TargetError e ) { // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow("Sourced file: "+sourceFileInfo); } catch ( EvalError e) { if ( DEBUG) e.printStackTrace(); // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow( "Sourced file: "+sourceFileInfo ); } catch ( Exception e) { if ( DEBUG) e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" unknown error: " + e.getMessage(), node, callstack); } catch(TokenMgrError e) { throw new EvalError( "Sourced file: "+sourceFileInfo+" Token Parsing Error: " + e.getMessage(), node, callstack ); } finally { localInterpreter.get_jjtree().reset(); // reinit the callstack if ( callstack.depth() > 1 ) { callstack.clear(); callstack.push( nameSpace ); } } } return Primitive.unwrap( retVal ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object eval( Reader in ) throws EvalError { return eval( in, globalNameSpace, "eval stream" ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object eval( String statements ) throws EvalError { if ( Interpreter.DEBUG ) debug("eval(String): "+statements); return eval(statements, globalNameSpace); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object eval( String statements, NameSpace nameSpace ) throws EvalError { String s = ( statements.endsWith(";") ? statements : statements+";" ); return eval( new StringReader(s), nameSpace, "inline evaluation of: ``"+ showEvalString(s)+"''" ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object get( String name ) throws EvalError { try { Object ret = globalNameSpace.get( name, this ); return Primitive.unwrap( ret ); } catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() ); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public void set( String name, Object value ) throws EvalError { // map null to Primtive.NULL coming in... if ( value == null ) value = Primitive.NULL; CallStack callstack = new CallStack(); try { if ( Name.isCompound( name ) ) { LHS lhs = globalNameSpace.getNameResolver( name ).toLHS( callstack, this ); lhs.assign( value, false ); } else // optimization for common case globalNameSpace.setVariable( name, value, false ); } catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, callstack ); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public void set(String name, long value) throws EvalError { set(name, new Primitive(value)); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public void set(String name, int value) throws EvalError { set(name, new Primitive(value)); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public void set(String name, double value) throws EvalError { set(name, new Primitive(value)); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public void set(String name, float value) throws EvalError { set(name, new Primitive(value)); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public void set(String name, boolean value) throws EvalError { set(name, new Primitive(value)); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public void unset( String name ) throws EvalError { /* We jump through some hoops here to handle arbitrary cases like unset("bsh.foo"); */ CallStack callstack = new CallStack(); try { LHS lhs = globalNameSpace.getNameResolver( name ).toLHS( callstack, this ); if ( lhs.type != LHS.VARIABLE ) throw new EvalError("Can't unset, not a variable: "+name, SimpleNode.JAVACODE, new CallStack() ); //lhs.assign( null, false ); lhs.nameSpace.unsetVariable( name ); } catch ( UtilEvalError e ) { throw new EvalError( e.getMessage(), SimpleNode.JAVACODE, new CallStack() ); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object getInterface( Class interf ) throws EvalError { try { return globalNameSpace.getThis( this ).getInterface( interf ); } catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() ); } }
// in org/gjt/sp/jedit/bsh/BSHVariableDeclarator.java
public Object eval( BSHType typeNode, CallStack callstack, Interpreter interpreter) throws EvalError { // null value means no value Object value = null; if ( jjtGetNumChildren() > 0 ) { SimpleNode initializer = (SimpleNode)jjtGetChild(0); /* If we have type info and the child is an array initializer pass it along... Else use the default eval style. (This allows array initializer to handle the problem... allowing for future enhancements in loosening types there). */ if ( (typeNode != null) && initializer instanceof BSHArrayInitializer ) value = ((BSHArrayInitializer)initializer).eval( typeNode.getBaseType(), typeNode.getArrayDims(), callstack, interpreter); else value = initializer.eval( callstack, interpreter); } if ( value == Primitive.VOID ) throw new EvalError("Void initializer.", this, callstack ); return value; }
// in org/gjt/sp/jedit/bsh/BSHReturnType.java
public Class evalReturnType( CallStack callstack, Interpreter interpreter ) throws EvalError { if ( isVoid ) return Void.TYPE; else return getTypeNode().getType( callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/BSHStatementExpressionList.java
public Object eval(CallStack callstack, Interpreter interpreter) throws EvalError { int n = jjtGetNumChildren(); for(int i=0; i<n; i++) { SimpleNode node = ((SimpleNode)jjtGetChild(i)); node.eval(callstack, interpreter); } return Primitive.VOID; }
(Domain) UtilEvalError 59
              
// in org/gjt/sp/jedit/bsh/BSHUnaryExpression.java
private Object unaryOperation( Object op, int kind ) throws UtilEvalError { if (op instanceof Boolean || op instanceof Character || op instanceof Number) return primitiveWrapperUnaryOperation( op, kind ); if ( !(op instanceof Primitive) ) throw new UtilEvalError( "Unary operation " + tokenImage[kind] + " inappropriate for object" ); return Primitive.unaryOperation((Primitive)op, kind); }
// in org/gjt/sp/jedit/bsh/This.java
public Object getInterface( Class clas ) throws UtilEvalError { if ( clas.isInstance( this ) ) return this; else throw new UtilEvalError( "Dynamic proxy mechanism not available. " + "Cannot construct interface type: "+clas ); }
// in org/gjt/sp/jedit/bsh/This.java
public Object getInterface( Class [] ca ) throws UtilEvalError { for(int i=0; i<ca.length; i++) if ( !(ca[i].isInstance( this )) ) throw new UtilEvalError( "Dynamic proxy mechanism not available. " + "Cannot construct interface type: "+ca[i] ); return this; }
// in org/gjt/sp/jedit/bsh/Variable.java
public void setValue( Object value, int context ) throws UtilEvalError { // check this.value if ( hasModifier("final") && this.value != null ) throw new UtilEvalError ("Final variable, can't re-assign."); if ( value == null ) value = Primitive.getDefaultValue( type ); if ( lhs != null ) { lhs.assign( value, false/*strictjava*/ ); return; } // TODO: should add isJavaCastable() test for strictJava // (as opposed to isJavaAssignable()) if ( type != null ) value = Types.castObject( value, type, context == DECLARATION ? Types.CAST : Types.ASSIGNMENT ); this.value= value; }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Field resolveExpectedJavaField( Class clas, String fieldName, boolean staticOnly ) throws UtilEvalError, ReflectError { Field field; try { if ( Capabilities.haveAccessibility() ) field = findAccessibleField( clas, fieldName ); else // Class getField() finds only public (and in interfaces, etc.) field = clas.getField(fieldName); } catch( NoSuchFieldException e) { throw new ReflectError("No such field: " + fieldName ); } catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching fields of: "+clas, e ); } if ( staticOnly && !Modifier.isStatic( field.getModifiers() ) ) throw new UtilEvalError( "Can't reach instance field: "+fieldName +" from static context: "+clas.getName() ); return field; }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getObjectProperty( Object obj, String propName ) throws UtilEvalError, ReflectError { Object[] args = new Object[] { }; Interpreter.debug("property access: "); Method method = null; Exception e1=null, e2=null; try { String accessorName = accessorName( "get", propName ); method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); } catch ( Exception e ) { e1 = e; } if ( method == null ) try { String accessorName = accessorName( "is", propName ); method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); if ( method.getReturnType() != Boolean.TYPE ) method = null; } catch ( Exception e ) { e2 = e; } if ( method == null ) throw new ReflectError("Error in property getter: " +e1 + (e2!=null?" : "+e2:"") ); try { return invokeMethod( method, obj, args ); } catch(InvocationTargetException e) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static void setObjectProperty( Object obj, String propName, Object value) throws ReflectError, UtilEvalError { String accessorName = accessorName( "set", propName ); Object[] args = new Object[] { value }; Interpreter.debug("property access: "); try { Method method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); invokeMethod( method, obj, args ); } catch ( InvocationTargetException e ) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object invokeCompiledCommand( Class commandClass, Object [] args, Interpreter interpreter, CallStack callstack ) throws UtilEvalError { // add interpereter and namespace to args list Object[] invokeArgs = new Object[args.length + 2]; invokeArgs[0] = interpreter; invokeArgs[1] = callstack; System.arraycopy( args, 0, invokeArgs, 2, args.length ); BshClassManager bcm = interpreter.getClassManager(); try { return Reflect.invokeStaticMethod( bcm, commandClass, "invoke", invokeArgs ); } catch ( InvocationTargetException e ) { throw new UtilEvalError( "Error in compiled command: "+e.getTargetException() ); } catch ( ReflectError e ) { throw new UtilEvalError("Error invoking compiled command: "+e ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
private static void checkFoundStaticMethod( Method method, boolean staticOnly, Class clas ) throws UtilEvalError { // We're looking for a static method but found an instance method if ( method != null && staticOnly && !isStatic( method ) ) throw new UtilEvalError( "Cannot reach instance method: " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " from static context: "+ clas.getName() ); }
// in org/gjt/sp/jedit/bsh/Name.java
private Object consumeNextObjectField( CallStack callstack, Interpreter interpreter, boolean forceClass, boolean autoAllocateThis ) throws UtilEvalError { /* Is it a simple variable name? Doing this first gives the correct Java precedence for vars vs. imported class names (at least in the simple case - see tests/precedence1.bsh). It should also speed things up a bit. */ if ( (evalBaseObject == null && !isCompound(evalName) ) && !forceClass ) { Object obj = resolveThisFieldReference( callstack, namespace, interpreter, evalName, false ); if ( obj != Primitive.VOID ) return completeRound( evalName, FINISHED, obj ); } /* Is it a bsh script variable reference? If we're just starting the eval of name (no base object) or we're evaluating relative to a This type reference check. */ String varName = prefix(evalName, 1); if ( ( evalBaseObject == null || evalBaseObject instanceof This ) && !forceClass ) { if ( Interpreter.DEBUG ) Interpreter.debug("trying to resolve variable: " + varName); Object obj; // switch namespace and special var visibility if ( evalBaseObject == null ) { obj = resolveThisFieldReference( callstack, namespace, interpreter, varName, false ); } else { obj = resolveThisFieldReference( callstack, ((This)evalBaseObject).namespace, interpreter, varName, true ); } if ( obj != Primitive.VOID ) { // Resolved the variable if ( Interpreter.DEBUG ) Interpreter.debug( "resolved variable: " + varName + " in namespace: "+namespace); return completeRound( varName, suffix(evalName), obj ); } } /* Is it a class name? If we're just starting eval of name try to make it, else fail. */ if ( evalBaseObject == null ) { if ( Interpreter.DEBUG ) Interpreter.debug( "trying class: " + evalName); /* Keep adding parts until we have a class */ Class clas = null; int i = 1; String className = null; for(; i <= countParts(evalName); i++) { className = prefix(evalName, i); if ( (clas = namespace.getClass(className)) != null ) break; } if ( clas != null ) { return completeRound( className, suffix( evalName, countParts(evalName)-i ), new ClassIdentifier(clas) ); } // not a class (or variable per above) if ( Interpreter.DEBUG ) Interpreter.debug( "not a class, trying var prefix "+evalName ); } // No variable or class found in 'this' type ref. // if autoAllocateThis then create one; a child 'this'. if ( ( evalBaseObject == null || evalBaseObject instanceof This ) && !forceClass && autoAllocateThis ) { NameSpace targetNameSpace = ( evalBaseObject == null ) ? namespace : ((This)evalBaseObject).namespace; Object obj = new NameSpace( targetNameSpace, "auto: "+varName ).getThis( interpreter ); targetNameSpace.setVariable( varName, obj, false ); return completeRound( varName, suffix(evalName), obj ); } /* If we didn't find a class or variable name (or prefix) above there are two possibilities: - If we are a simple name then we can pass as a void variable reference. - If we are compound then we must fail at this point. */ if ( evalBaseObject == null ) { if ( !isCompound(evalName) ) { return completeRound( evalName, FINISHED, Primitive.VOID ); } else throw new UtilEvalError( "Class or variable not found: " + evalName); } /* -------------------------------------------------------- After this point we're definitely evaluating relative to a base object. -------------------------------------------------------- */ /* Do some basic validity checks. */ if ( evalBaseObject == Primitive.NULL) // previous round produced null throw new UtilTargetError( new NullPointerException( "Null Pointer while evaluating: " +value ) ); if ( evalBaseObject == Primitive.VOID) // previous round produced void throw new UtilEvalError( "Undefined variable or class name while evaluating: "+value); if ( evalBaseObject instanceof Primitive) throw new UtilEvalError("Can't treat primitive like an object. "+ "Error while evaluating: "+value); /* Resolve relative to a class type static field, inner class, ? */ if ( evalBaseObject instanceof ClassIdentifier ) { Class clas = ((ClassIdentifier)evalBaseObject).getTargetClass(); String field = prefix(evalName, 1); // Class qualified 'this' reference from inner class. // e.g. 'MyOuterClass.this' if ( field.equals("this") ) { // find the enclosing class instance space of the class name NameSpace ns = namespace; while ( ns != null ) { // getClassInstance() throws exception if not there if ( ns.classInstance != null && ns.classInstance.getClass() == clas ) return completeRound( field, suffix(evalName), ns.classInstance ); ns=ns.getParent(); } throw new UtilEvalError( "Can't find enclosing 'this' instance of class: "+clas); } Object obj = null; // static field? try { if ( Interpreter.DEBUG ) Interpreter.debug("Name call to getStaticFieldValue, class: " +clas+", field:"+field); obj = Reflect.getStaticFieldValue(clas, field); } catch( ReflectError e ) { if ( Interpreter.DEBUG ) Interpreter.debug("field reflect error: "+e); } // inner class? if ( obj == null ) { String iclass = clas.getName()+"$"+field; Class c = namespace.getClass( iclass ); if ( c != null ) obj = new ClassIdentifier(c); } if ( obj == null ) throw new UtilEvalError( "No static field or inner class: " + field + " of " + clas ); return completeRound( field, suffix(evalName), obj ); } /* If we've fallen through here we are no longer resolving to a class type. */ if ( forceClass ) throw new UtilEvalError( value +" does not resolve to a class name." ); /* Some kind of field access? */ String field = prefix(evalName, 1); // length access on array? if ( field.equals("length") && evalBaseObject.getClass().isArray() ) { Object obj = new Primitive(Array.getLength(evalBaseObject)); return completeRound( field, suffix(evalName), obj ); } // Check for field on object // Note: could eliminate throwing the exception somehow try { Object obj = Reflect.getObjectFieldValue(evalBaseObject, field); return completeRound( field, suffix(evalName), obj ); } catch(ReflectError e) { /* not a field */ } // if we get here we have failed throw new UtilEvalError( "Cannot access field: " + field + ", on object: " + evalBaseObject); }
// in org/gjt/sp/jedit/bsh/Name.java
Object resolveThisFieldReference( CallStack callstack, NameSpace thisNameSpace, Interpreter interpreter, String varName, boolean specialFieldsVisible ) throws UtilEvalError { if ( varName.equals("this") ) { /* Somewhat of a hack. If the special fields are visible (we're operating relative to a 'this' type already) dissallow further .this references to prevent user from skipping to things like super.this.caller */ if ( specialFieldsVisible ) throw new UtilEvalError("Redundant to call .this on This type"); // Allow getThis() to work through BlockNameSpace to the method // namespace // XXX re-eval this... do we need it? This ths = thisNameSpace.getThis( interpreter ); thisNameSpace= ths.getNameSpace(); Object result = ths; NameSpace classNameSpace = getClassNameSpace( thisNameSpace ); if ( classNameSpace != null ) { if ( isCompound( evalName ) ) result = classNameSpace.getThis( interpreter ); else result = classNameSpace.getClassInstance(); } return result; } /* Some duplication for "super". See notes for "this" above If we're in an enclsing class instance and have a superclass instance our super is the superclass instance. */ if ( varName.equals("super") ) { //if ( specialFieldsVisible ) //throw new UtilEvalError("Redundant to call .this on This type"); // Allow getSuper() to through BlockNameSpace to the method's super This ths = thisNameSpace.getSuper( interpreter ); thisNameSpace = ths.getNameSpace(); // super is now the closure's super or class instance // XXXX re-evaluate this // can getSuper work by itself now? // If we're a class instance and the parent is also a class instance // then super means our parent. if ( thisNameSpace.getParent() != null && thisNameSpace.getParent().isClass ) ths = thisNameSpace.getParent().getThis( interpreter ); return ths; } Object obj = null; if ( varName.equals("global") ) obj = thisNameSpace.getGlobal( interpreter ); if ( obj == null && specialFieldsVisible ) { if (varName.equals("namespace")) obj = thisNameSpace; else if (varName.equals("variables")) obj = thisNameSpace.getVariableNames(); else if (varName.equals("methods")) obj = thisNameSpace.getMethodNames(); else if ( varName.equals("interpreter") ) if ( lastEvalName.equals("this") ) obj = interpreter; else throw new UtilEvalError( "Can only call .interpreter on literal 'this'"); } if ( obj == null && specialFieldsVisible && varName.equals("caller") ) { if ( lastEvalName.equals("this") || lastEvalName.equals("caller") ) { // get the previous context (see notes for this class) if ( callstack == null ) throw new InterpreterError("no callstack"); obj = callstack.get( ++callstackDepth ).getThis( interpreter ); } else throw new UtilEvalError( "Can only call .caller on literal 'this' or literal '.caller'"); // early return return obj; } if ( obj == null && specialFieldsVisible && varName.equals("callstack") ) { if ( lastEvalName.equals("this") ) { // get the previous context (see notes for this class) if ( callstack == null ) throw new InterpreterError("no callstack"); obj = callstack; } else throw new UtilEvalError( "Can only call .callstack on literal 'this'"); } if ( obj == null ) obj = thisNameSpace.getVariable(varName); if ( obj == null ) throw new InterpreterError("null this field ref:"+varName); return obj; }
// in org/gjt/sp/jedit/bsh/Name.java
synchronized public LHS toLHS( CallStack callstack, Interpreter interpreter ) throws UtilEvalError { // Should clean this up to a single return statement reset(); LHS lhs; // Simple (non-compound) variable assignment e.g. x=5; if ( !isCompound(evalName) ) { if ( evalName.equals("this") ) throw new UtilEvalError("Can't assign to 'this'." ); // Interpreter.debug("Simple var LHS..."); lhs = new LHS( namespace, evalName, false/*bubble up if allowed*/); return lhs; } // Field e.g. foo.bar=5; Object obj = null; try { while( evalName != null && isCompound( evalName ) ) { obj = consumeNextObjectField( callstack, interpreter, false/*forcclass*/, true/*autoallocthis*/ ); } } catch( UtilEvalError e ) { throw new UtilEvalError( "LHS evaluation: " + e.getMessage() ); } // Finished eval and its a class. if ( evalName == null && obj instanceof ClassIdentifier ) throw new UtilEvalError("Can't assign to class: " + value ); if ( obj == null ) throw new UtilEvalError("Error in LHS: " + value ); // e.g. this.x=5; or someThisType.x=5; if ( obj instanceof This ) { // dissallow assignment to magic fields if ( evalName.equals("namespace") || evalName.equals("variables") || evalName.equals("methods") || evalName.equals("caller") ) throw new UtilEvalError( "Can't assign to special variable: "+evalName ); Interpreter.debug("found This reference evaluating LHS"); /* If this was a literal "super" reference then we allow recursion in setting the variable to get the normal effect of finding the nearest definition starting at the super scope. On any other resolution qualified by a 'this' type reference we want to set the variable directly in that scope. e.g. this.x=5; or someThisType.x=5; In the old scoping rules super didn't do this. */ boolean localVar = !lastEvalName.equals("super"); return new LHS( ((This)obj).namespace, evalName, localVar ); } if ( evalName != null ) { try { if ( obj instanceof ClassIdentifier ) { Class clas = ((ClassIdentifier)obj).getTargetClass(); lhs = Reflect.getLHSStaticField(clas, evalName); return lhs; } else { lhs = Reflect.getLHSObjectField(obj, evalName); return lhs; } } catch(ReflectError e) { throw new UtilEvalError("Field access: "+e); } } throw new InterpreterError("Internal error in lhs..."); }
// in org/gjt/sp/jedit/bsh/Name.java
public Object invokeMethod( Interpreter interpreter, Object[] args, CallStack callstack, SimpleNode callerInfo ) throws UtilEvalError, EvalError, ReflectError, InvocationTargetException { String methodName = Name.suffix(value, 1); BshClassManager bcm = interpreter.getClassManager(); NameSpace namespace = callstack.top(); // Optimization - If classOfStaticMethod is set then we have already // been here and determined that this is a static method invocation. // Note: maybe factor this out with path below... clean up. if ( classOfStaticMethod != null ) { return Reflect.invokeStaticMethod( bcm, classOfStaticMethod, methodName, args ); } if ( !Name.isCompound(value) ) return invokeLocalMethod( interpreter, args, callstack, callerInfo ); // Note: if we want methods declared inside blocks to be accessible via // this.methodname() inside the block we could handle it here as a // special case. See also resolveThisFieldReference() special handling // for BlockNameSpace case. They currently work via the direct name // e.g. methodName(). String prefix = Name.prefix(value); // Superclass method invocation? (e.g. super.foo()) if ( prefix.equals("super") && Name.countParts(value) == 2 ) { // Allow getThis() to work through block namespaces first This ths = namespace.getThis( interpreter ); NameSpace thisNameSpace = ths.getNameSpace(); NameSpace classNameSpace = getClassNameSpace( thisNameSpace ); if ( classNameSpace != null ) { Object instance = classNameSpace.getClassInstance(); return ClassGenerator.getClassGenerator() .invokeSuperclassMethod( bcm, instance, methodName, args ); } } // Find target object or class identifier Name targetName = namespace.getNameResolver( prefix ); Object obj = targetName.toObject( callstack, interpreter ); if ( obj == Primitive.VOID ) throw new UtilEvalError( "Attempt to resolve method: "+methodName +"() on undefined variable or class name: "+targetName); // if we've got an object, resolve the method if ( !(obj instanceof ClassIdentifier) ) { if (obj instanceof Primitive) { if (obj == Primitive.NULL) throw new UtilTargetError( new NullPointerException( "Null Pointer in Method Invocation" ) ); // some other primitive // should avoid calling methods on primitive, as we do // in Name (can't treat primitive like an object message) // but the hole is useful right now. if ( Interpreter.DEBUG ) interpreter.debug( "Attempt to access method on primitive..." + " allowing bsh.Primitive to peek through for debugging"); } // found an object and it's not an undefined variable return Reflect.invokeObjectMethod( obj, methodName, args, interpreter, callstack, callerInfo ); } // It's a class // try static method if ( Interpreter.DEBUG ) Interpreter.debug("invokeMethod: trying static - " + targetName); Class clas = ((ClassIdentifier)obj).getTargetClass(); // cache the fact that this is a static method invocation on this class classOfStaticMethod = clas; if ( clas != null ) return Reflect.invokeStaticMethod( bcm, clas, methodName, args ); // return null; ??? throw new UtilEvalError("invokeMethod: unknown target: " + targetName); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public void doSuperImport() throws UtilEvalError { // Should we prevent it from happening twice? try { getClassPath().insureInitialized(); // prime the lookup table getClassNameByUnqName( "" ) ; // always true now //getClassPath().setNameCompletionIncludeUnqNames(true); } catch ( ClassPathException e ) { throw new UtilEvalError("Error importing classpath "+ e ); } superImport = true; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
Object getClassInstance() throws UtilEvalError { if ( classInstance != null ) return classInstance; if ( classStatic != null //|| ( getParent()!=null && getParent().classStatic != null ) ) throw new UtilEvalError( "Can't refer to class instance from static context."); else throw new InterpreterError( "Can't resolve class instance 'this' in: "+this); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
void setVariable( String name, Object value, boolean strictJava, boolean recurse ) throws UtilEvalError { if ( variables == null ) variables = new Hashtable(); // primitives should have been wrapped // {{{ jEdit change //if ( value == null ) // throw new InterpreterError("null variable value"); if ( value == null ) { // don't break jEdit core and plugins! unsetVariable(name); return; } // }}} // Locate the variable definition if it exists. Variable existing = getVariableImpl( name, recurse ); // Found an existing variable here (or above if recurse allowed) if ( existing != null ) { try { existing.setValue( value, Variable.ASSIGNMENT ); } catch ( UtilEvalError e ) { throw new UtilEvalError( "Variable assignment: " + name + ": " + e.getMessage()); } } else // No previous variable definition found here (or above if recurse) { if ( strictJava ) throw new UtilEvalError( "(Strict Java mode) Assignment to undeclared variable: " +name ); // If recurse, set global untyped var, else set it here. //NameSpace varScope = recurse ? getGlobal() : this; // This modification makes default allocation local NameSpace varScope = this; varScope.variables.put( name, new Variable( name, value, null/*modifiers*/ ) ); // nameSpaceChanged() on new variable addition nameSpaceChanged(); } }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public void setTypedVariable( String name, Class type, Object value, Modifiers modifiers ) throws UtilEvalError { //checkVariableModifiers( name, modifiers ); if ( variables == null ) variables = new Hashtable(); // Setting a typed variable is always a local operation. Variable existing = getVariableImpl( name, false/*recurse*/ ); // Null value is just a declaration // Note: we might want to keep any existing value here instead of reset /* // Moved to Variable if ( value == null ) value = Primitive.getDefaultValue( type ); */ // does the variable already exist? if ( existing != null ) { // Is it typed? if ( existing.getType() != null ) { // If it had a different type throw error. // This allows declaring the same var again, but not with // a different (even if assignable) type. if ( existing.getType() != type ) { throw new UtilEvalError( "Typed variable: "+name +" was previously declared with type: " + existing.getType() ); } else { // else set it and return existing.setValue( value, Variable.DECLARATION ); return; } } // Careful here: // else fall through to override and install the new typed version } // Add the new typed var variables.put( name, new Variable( name, type, value, modifiers ) ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
private BshMethod loadScriptedCommand( InputStream in, String name, Class [] argTypes, String resourcePath, Interpreter interpreter ) throws UtilEvalError { try { interpreter.eval( new InputStreamReader(in), this, resourcePath ); } catch ( EvalError e ) { /* Here we catch any EvalError from the interpreter because we are using it as a tool to load the command, not as part of the execution path. */ Interpreter.debug( e.toString() ); throw new UtilEvalError( "Error loading script: "+ e.getMessage()); } // Look for the loaded command BshMethod meth = getMethod( name, argTypes ); /* if ( meth == null ) throw new UtilEvalError("Loaded resource: " + resourcePath + "had an error or did not contain the correct method" ); */ return meth; }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
private Object operation( Object lhs, Object rhs, int kind ) throws UtilEvalError { /* Implement String += value; According to the JLS, value may be anything. In BeanShell, we'll disallow VOID (undefined) values. (or should we map them to the empty string?) */ if ( lhs instanceof String && rhs != Primitive.VOID ) { if ( kind != PLUS ) throw new UtilEvalError( "Use of non + operator with String LHS" ); return (String)lhs + rhs; } if ( lhs instanceof Primitive || rhs instanceof Primitive ) if(lhs == Primitive.VOID || rhs == Primitive.VOID) throw new UtilEvalError( "Illegal use of undefined object or 'void' literal" ); else if ( lhs == Primitive.NULL || rhs == Primitive.NULL ) throw new UtilEvalError( "Illegal use of null object or 'null' literal" ); if( (lhs instanceof Boolean || lhs instanceof Character || lhs instanceof Number || lhs instanceof Primitive) && (rhs instanceof Boolean || rhs instanceof Character || rhs instanceof Number || rhs instanceof Primitive) ) { return Primitive.binaryOperation(lhs, rhs, kind); } throw new UtilEvalError("Non primitive value in operator: " + lhs.getClass() + " " + tokenImage[kind] + " " + rhs.getClass() ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
public static Object binaryOperation( Object obj1, Object obj2, int kind) throws UtilEvalError { // special primitive types if ( obj1 == NULL || obj2 == NULL ) throw new UtilEvalError( "Null value or 'null' literal in binary operation"); if ( obj1 == VOID || obj2 == VOID ) throw new UtilEvalError( "Undefined variable, class, or 'void' literal in binary operation"); // keep track of the original types Class lhsOrgType = obj1.getClass(); Class rhsOrgType = obj2.getClass(); // Unwrap primitives if ( obj1 instanceof Primitive ) obj1 = ((Primitive)obj1).getValue(); if ( obj2 instanceof Primitive ) obj2 = ((Primitive)obj2).getValue(); Object[] operands = promotePrimitives(obj1, obj2); Object lhs = operands[0]; Object rhs = operands[1]; if(lhs.getClass() != rhs.getClass()) throw new UtilEvalError("Type mismatch in operator. " + lhs.getClass() + " cannot be used with " + rhs.getClass() ); Object result; try { result = binaryOperationImpl( lhs, rhs, kind ); } catch ( ArithmeticException e ) { throw new UtilTargetError( "Arithemetic Exception in binary op", e); } // If both original args were Primitives return a Primitive result // else it was mixed (wrapper/primitive) return the wrapper type // Exception is for boolean result, return the primitive if ( (lhsOrgType == Primitive.class && rhsOrgType == Primitive.class) || result instanceof Boolean ) return new Primitive( result ); else return result; }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object binaryOperationImpl( Object lhs, Object rhs, int kind ) throws UtilEvalError { if(lhs instanceof Boolean) return booleanBinaryOperation((Boolean)lhs, (Boolean)rhs, kind); else if(lhs instanceof Integer) return intBinaryOperation( (Integer)lhs, (Integer)rhs, kind ); else if(lhs instanceof Long) return longBinaryOperation((Long)lhs, (Long)rhs, kind); else if(lhs instanceof Float) return floatBinaryOperation((Float)lhs, (Float)rhs, kind); else if(lhs instanceof Double) return doubleBinaryOperation( (Double)lhs, (Double)rhs, kind); else throw new UtilEvalError("Invalid types in binary operator" ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object doubleBinaryOperation(Double D1, Double D2, int kind) throws UtilEvalError { double lhs = D1.doubleValue(); double rhs = D2.doubleValue(); switch(kind) { // boolean case LT: case LTX: return new Boolean(lhs < rhs); case GT: case GTX: return new Boolean(lhs > rhs); case EQ: return new Boolean(lhs == rhs); case LE: case LEX: return new Boolean(lhs <= rhs); case GE: case GEX: return new Boolean(lhs >= rhs); case NE: return new Boolean(lhs != rhs); // arithmetic case PLUS: return new Double(lhs + rhs); case MINUS: return new Double(lhs - rhs); case STAR: return new Double(lhs * rhs); case SLASH: return new Double(lhs / rhs); case MOD: return new Double(lhs % rhs); // can't shift floating-point values case LSHIFT: case LSHIFTX: case RSIGNEDSHIFT: case RSIGNEDSHIFTX: case RUNSIGNEDSHIFT: case RUNSIGNEDSHIFTX: throw new UtilEvalError("Can't shift doubles"); default: throw new InterpreterError( "Unimplemented binary double operator"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object floatBinaryOperation(Float F1, Float F2, int kind) throws UtilEvalError { float lhs = F1.floatValue(); float rhs = F2.floatValue(); switch(kind) { // boolean case LT: case LTX: return new Boolean(lhs < rhs); case GT: case GTX: return new Boolean(lhs > rhs); case EQ: return new Boolean(lhs == rhs); case LE: case LEX: return new Boolean(lhs <= rhs); case GE: case GEX: return new Boolean(lhs >= rhs); case NE: return new Boolean(lhs != rhs); // arithmetic case PLUS: return new Float(lhs + rhs); case MINUS: return new Float(lhs - rhs); case STAR: return new Float(lhs * rhs); case SLASH: return new Float(lhs / rhs); case MOD: return new Float(lhs % rhs); // can't shift floats case LSHIFT: case LSHIFTX: case RSIGNEDSHIFT: case RSIGNEDSHIFTX: case RUNSIGNEDSHIFT: case RUNSIGNEDSHIFTX: throw new UtilEvalError("Can't shift floats "); default: throw new InterpreterError( "Unimplemented binary float operator"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
public static Primitive unaryOperation(Primitive val, int kind) throws UtilEvalError { if (val == NULL) throw new UtilEvalError( "illegal use of null object or 'null' literal"); if (val == VOID) throw new UtilEvalError( "illegal use of undefined object or 'void' literal"); Class operandType = val.getType(); Object operand = promoteToInteger(val.getValue()); if ( operand instanceof Boolean ) return new Primitive(booleanUnaryOperation((Boolean)operand, kind)); else if(operand instanceof Integer) { int result = intUnaryOperation((Integer)operand, kind); // ++ and -- must be cast back the original type if(kind == INCR || kind == DECR) { if(operandType == Byte.TYPE) return new Primitive((byte)result); if(operandType == Short.TYPE) return new Primitive((short)result); if(operandType == Character.TYPE) return new Primitive((char)result); } return new Primitive(result); } else if(operand instanceof Long) return new Primitive(longUnaryOperation((Long)operand, kind)); else if(operand instanceof Float) return new Primitive(floatUnaryOperation((Float)operand, kind)); else if(operand instanceof Double) return new Primitive(doubleUnaryOperation((Double)operand, kind)); else throw new InterpreterError( "An error occurred. Please call technical support."); }
// in org/gjt/sp/jedit/bsh/Primitive.java
static boolean booleanUnaryOperation(Boolean B, int kind) throws UtilEvalError { boolean operand = B.booleanValue(); switch(kind) { case BANG: return !operand; default: throw new UtilEvalError("Operator inappropriate for boolean"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
public int intValue() throws UtilEvalError { if(value instanceof Number) return((Number)value).intValue(); else throw new UtilEvalError("Primitive not a number"); }
// in org/gjt/sp/jedit/bsh/Primitive.java
public boolean booleanValue() throws UtilEvalError { if(value instanceof Boolean) return((Boolean)value).booleanValue(); else throw new UtilEvalError("Primitive not a boolean"); }
// in org/gjt/sp/jedit/bsh/Primitive.java
public Number numberValue() throws UtilEvalError { Object value = this.value; // Promote character to Number type for these purposes if (value instanceof Character) value = new Integer(((Character)value).charValue()); if (value instanceof Number) return (Number)value; else throw new UtilEvalError("Primitive not a number"); }
// in org/gjt/sp/jedit/bsh/LHS.java
public Object getValue() throws UtilEvalError { if ( type == VARIABLE ) return nameSpace.getVariable( varName ); if (type == FIELD) try { Object o = field.get( object ); return Primitive.wrap( o, field.getType() ); } catch(IllegalAccessException e2) { throw new UtilEvalError("Can't read field: " + field); } if ( type == PROPERTY ) try { return Reflect.getObjectProperty(object, propName); } catch(ReflectError e) { Interpreter.debug(e.getMessage()); throw new UtilEvalError("No such property: " + propName); } if ( type == INDEX ) try { return Reflect.getIndex(object, index); } catch(Exception e) { throw new UtilEvalError("Array access: " + e); } throw new InterpreterError("LHS type"); }
// in org/gjt/sp/jedit/bsh/LHS.java
public Object assign( Object val, boolean strictJava ) throws UtilEvalError { if ( type == VARIABLE ) { // Set the variable in namespace according to localVar flag if ( localVar ) nameSpace.setLocalVariable( varName, val, strictJava ); else nameSpace.setVariable( varName, val, strictJava ); } else if ( type == FIELD ) { try { Object fieldVal = val instanceof Primitive ? ((Primitive)val).getValue() : val; // This should probably be in Reflect.java ReflectManager.RMSetAccessible( field ); field.set( object, fieldVal ); return val; } catch( NullPointerException e) { throw new UtilEvalError( "LHS ("+field.getName()+") not a static field."); } catch( IllegalAccessException e2) { throw new UtilEvalError( "LHS ("+field.getName()+") can't access field: "+e2); } catch( IllegalArgumentException e3) { String type = val instanceof Primitive ? ((Primitive)val).getType().getName() : val.getClass().getName(); throw new UtilEvalError( "Argument type mismatch. " + (val == null ? "null" : type ) + " not assignable to field "+field.getName()); } } else if ( type == PROPERTY ) { /* if ( object instanceof Hashtable ) ((Hashtable)object).put(propName, val); */ CollectionManager cm = CollectionManager.getCollectionManager(); if ( cm.isMap( object ) ) cm.putInMap( object/*map*/, propName, val ); else try { Reflect.setObjectProperty(object, propName, val); } catch(ReflectError e) { Interpreter.debug("Assignment: " + e.getMessage()); throw new UtilEvalError("No such property: " + propName); } } else if ( type == INDEX ) try { Reflect.setIndex(object, index, val); } catch ( UtilTargetError e1 ) { // pass along target error throw e1; } catch ( Exception e ) { throw new UtilEvalError("Assignment: " + e.getMessage()); } else throw new InterpreterError("unknown lhs"); return val; }
17
              
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(InvocationTargetException e) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( InvocationTargetException e ) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( InvocationTargetException e ) { throw new UtilEvalError( "Error in compiled command: "+e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { throw new UtilEvalError("Error invoking compiled command: "+e ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch( UtilEvalError e ) { throw new UtilEvalError( "LHS evaluation: " + e.getMessage() ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch(ReflectError e) { throw new UtilEvalError("Field access: "+e); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassPathException e ) { throw new UtilEvalError("Error importing classpath "+ e ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
catch ( UtilEvalError e ) { throw new UtilEvalError( "Variable assignment: " + name + ": " + e.getMessage()); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
catch ( EvalError e ) { /* Here we catch any EvalError from the interpreter because we are using it as a tool to load the command, not as part of the execution path. */ Interpreter.debug( e.toString() ); throw new UtilEvalError( "Error loading script: "+ e.getMessage()); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(IllegalAccessException e2) { throw new UtilEvalError("Can't read field: " + field); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(ReflectError e) { Interpreter.debug(e.getMessage()); throw new UtilEvalError("No such property: " + propName); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(Exception e) { throw new UtilEvalError("Array access: " + e); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( NullPointerException e) { throw new UtilEvalError( "LHS ("+field.getName()+") not a static field."); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( IllegalAccessException e2) { throw new UtilEvalError( "LHS ("+field.getName()+") can't access field: "+e2); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( IllegalArgumentException e3) { String type = val instanceof Primitive ? ((Primitive)val).getType().getName() : val.getClass().getName(); throw new UtilEvalError( "Argument type mismatch. " + (val == null ? "null" : type ) + " not assignable to field "+field.getName()); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(ReflectError e) { Interpreter.debug("Assignment: " + e.getMessage()); throw new UtilEvalError("No such property: " + propName); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch ( Exception e ) { throw new UtilEvalError("Assignment: " + e.getMessage()); }
94
              
// in org/gjt/sp/jedit/bsh/BSHUnaryExpression.java
private Object lhsUnaryOperation( LHS lhs, boolean strictJava ) throws UtilEvalError { if ( Interpreter.DEBUG ) Interpreter.debug("lhsUnaryOperation"); Object prevalue, postvalue; prevalue = lhs.getValue(); postvalue = unaryOperation(prevalue, kind); Object retVal; if ( postfix ) retVal = prevalue; else retVal = postvalue; lhs.assign( postvalue, strictJava ); return retVal; }
// in org/gjt/sp/jedit/bsh/BSHUnaryExpression.java
private Object unaryOperation( Object op, int kind ) throws UtilEvalError { if (op instanceof Boolean || op instanceof Character || op instanceof Number) return primitiveWrapperUnaryOperation( op, kind ); if ( !(op instanceof Primitive) ) throw new UtilEvalError( "Unary operation " + tokenImage[kind] + " inappropriate for object" ); return Primitive.unaryOperation((Primitive)op, kind); }
// in org/gjt/sp/jedit/bsh/BSHUnaryExpression.java
private Object primitiveWrapperUnaryOperation(Object val, int kind) throws UtilEvalError { Class operandType = val.getClass(); Object operand = Primitive.promoteToInteger(val); if ( operand instanceof Boolean ) return new Boolean( Primitive.booleanUnaryOperation((Boolean)operand, kind)); else if ( operand instanceof Integer ) { int result = Primitive.intUnaryOperation((Integer)operand, kind); // ++ and -- must be cast back the original type if(kind == INCR || kind == DECR) { if(operandType == Byte.TYPE) return new Byte((byte)result); if(operandType == Short.TYPE) return new Short((short)result); if(operandType == Character.TYPE) return new Character((char)result); } return new Integer(result); } else if(operand instanceof Long) return new Long(Primitive.longUnaryOperation((Long)operand, kind)); else if(operand instanceof Float) return new Float(Primitive.floatUnaryOperation((Float)operand, kind)); else if(operand instanceof Double) return new Double(Primitive.doubleUnaryOperation((Double)operand, kind)); else throw new InterpreterError("An error occurred. Please call technical support."); }
// in org/gjt/sp/jedit/bsh/This.java
public Object getInterface( Class clas ) throws UtilEvalError { if ( clas.isInstance( this ) ) return this; else throw new UtilEvalError( "Dynamic proxy mechanism not available. " + "Cannot construct interface type: "+clas ); }
// in org/gjt/sp/jedit/bsh/This.java
public Object getInterface( Class [] ca ) throws UtilEvalError { for(int i=0; i<ca.length; i++) if ( !(ca[i].isInstance( this )) ) throw new UtilEvalError( "Dynamic proxy mechanism not available. " + "Cannot construct interface type: "+ca[i] ); return this; }
// in org/gjt/sp/jedit/bsh/Variable.java
public void setValue( Object value, int context ) throws UtilEvalError { // check this.value if ( hasModifier("final") && this.value != null ) throw new UtilEvalError ("Final variable, can't re-assign."); if ( value == null ) value = Primitive.getDefaultValue( type ); if ( lhs != null ) { lhs.assign( value, false/*strictjava*/ ); return; } // TODO: should add isJavaCastable() test for strictJava // (as opposed to isJavaAssignable()) if ( type != null ) value = Types.castObject( value, type, context == DECLARATION ? Types.CAST : Types.ASSIGNMENT ); this.value= value; }
// in org/gjt/sp/jedit/bsh/Variable.java
Object getValue() throws UtilEvalError { if ( lhs != null ) return lhs.getValue(); return value; }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
public Object invokeSuperclassMethod( BshClassManager bcm, Object instance, String methodName, Object [] args ) throws UtilEvalError, ReflectError, InvocationTargetException { // Delegate to the static method return invokeSuperclassMethodImpl( bcm, instance, methodName, args ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
public static Object invokeSuperclassMethodImpl( BshClassManager bcm, Object instance, String methodName, Object [] args ) throws UtilEvalError, ReflectError, InvocationTargetException { String superName = ClassGeneratorUtil.BSHSUPER+methodName; // look for the specially named super delegate method Class clas = instance.getClass(); Method superMethod = Reflect.resolveJavaMethod( bcm, clas, superName, Types.getTypes(args), false/*onlyStatic*/ ); if ( superMethod != null ) return Reflect.invokeMethod( superMethod, instance, args ); // No super method, try to invoke regular method // could be a superfluous "super." which is legal. Class superClass = clas.getSuperclass(); superMethod = Reflect.resolveExpectedJavaMethod( bcm, superClass, instance, methodName, args, false/*onlyStatic*/ ); return Reflect.invokeMethod( superMethod, instance, args ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object invokeStaticMethod( BshClassManager bcm, Class clas, String methodName, Object [] args ) throws ReflectError, UtilEvalError, InvocationTargetException { Interpreter.debug("invoke static Method"); Method method = resolveExpectedJavaMethod( bcm, clas, null, methodName, args, true ); return invokeMethod( method, null, args ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getStaticFieldValue(Class clas, String fieldName) throws UtilEvalError, ReflectError { return getFieldValue( clas, null, fieldName, true/*onlystatic*/); }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getObjectFieldValue( Object object, String fieldName ) throws UtilEvalError, ReflectError { if ( object instanceof This ) return ((This)object).namespace.getVariable( fieldName ); else { try { return getFieldValue( object.getClass(), object, fieldName, false/*onlystatic*/); } catch ( ReflectError e ) { // no field, try property acces if ( hasObjectPropertyGetter( object.getClass(), fieldName ) ) return getObjectProperty( object, fieldName ); else throw e; } } }
// in org/gjt/sp/jedit/bsh/Reflect.java
static LHS getLHSStaticField(Class clas, String fieldName) throws UtilEvalError, ReflectError { Field f = resolveExpectedJavaField( clas, fieldName, true/*onlystatic*/); return new LHS(f); }
// in org/gjt/sp/jedit/bsh/Reflect.java
static LHS getLHSObjectField( Object object, String fieldName ) throws UtilEvalError, ReflectError { if ( object instanceof This ) { // I guess this is when we pass it as an argument? // Setting locally boolean recurse = false; return new LHS( ((This)object).namespace, fieldName, recurse ); } try { Field f = resolveExpectedJavaField( object.getClass(), fieldName, false/*staticOnly*/ ); return new LHS(object, f); } catch ( ReflectError e ) { // not a field, try property access if ( hasObjectPropertySetter( object.getClass(), fieldName ) ) return new LHS( object, fieldName ); else throw e; } }
// in org/gjt/sp/jedit/bsh/Reflect.java
private static Object getFieldValue( Class clas, Object object, String fieldName, boolean staticOnly ) throws UtilEvalError, ReflectError { try { Field f = resolveExpectedJavaField( clas, fieldName, staticOnly ); Object value = f.get(object); Class returnType = f.getType(); return Primitive.wrap( value, returnType ); } catch( NullPointerException e ) { // shouldn't happen throw new ReflectError( "???" + fieldName + " is not a static field."); } catch(IllegalAccessException e) { throw new ReflectError("Can't access field: " + fieldName); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Field resolveJavaField( Class clas, String fieldName, boolean staticOnly ) throws UtilEvalError { try { return resolveExpectedJavaField( clas, fieldName, staticOnly ); } catch ( ReflectError e ) { return null; } }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Field resolveExpectedJavaField( Class clas, String fieldName, boolean staticOnly ) throws UtilEvalError, ReflectError { Field field; try { if ( Capabilities.haveAccessibility() ) field = findAccessibleField( clas, fieldName ); else // Class getField() finds only public (and in interfaces, etc.) field = clas.getField(fieldName); } catch( NoSuchFieldException e) { throw new ReflectError("No such field: " + fieldName ); } catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching fields of: "+clas, e ); } if ( staticOnly && !Modifier.isStatic( field.getModifiers() ) ) throw new UtilEvalError( "Can't reach instance field: "+fieldName +" from static context: "+clas.getName() ); return field; }
// in org/gjt/sp/jedit/bsh/Reflect.java
private static Field findAccessibleField( Class clas, String fieldName ) throws UtilEvalError, NoSuchFieldException { Field field; // Quick check catches public fields include those in interfaces try { field = clas.getField(fieldName); ReflectManager.RMSetAccessible( field ); return field; } catch ( NoSuchFieldException e ) { } // Now, on with the hunt... while ( clas != null ) { try { field = clas.getDeclaredField(fieldName); ReflectManager.RMSetAccessible( field ); return field; // Not found, fall through to next class } catch(NoSuchFieldException e) { } clas = clas.getSuperclass(); } throw new NoSuchFieldException( fieldName ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Method resolveExpectedJavaMethod( BshClassManager bcm, Class clas, Object object, String name, Object[] args, boolean staticOnly ) throws ReflectError, UtilEvalError { if ( object == Primitive.NULL ) throw new UtilTargetError( new NullPointerException( "Attempt to invoke method " +name+" on null value" ) ); Class [] types = Types.getTypes(args); Method method = resolveJavaMethod( bcm, clas, name, types, staticOnly ); if ( method == null ) throw new ReflectError( ( staticOnly ? "Static method " : "Method " ) + StringUtil.methodString(name, types) + " not found in class'" + clas.getName() + "'"); return method; }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Method resolveJavaMethod( BshClassManager bcm, Class clas, String name, Class [] types, boolean staticOnly ) throws UtilEvalError { if ( clas == null ) throw new InterpreterError("null class"); // Lookup previously cached method Method method = null; if ( bcm == null ) Interpreter.debug("resolveJavaMethod UNOPTIMIZED lookup"); else method = bcm.getResolvedMethod( clas, name, types, staticOnly ); if ( method == null ) { boolean publicOnly = !Capabilities.haveAccessibility(); // Searching for the method may, itself be a priviledged action try { method = findOverloadedMethod( clas, name, types, publicOnly ); } catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching methods of: "+clas, e ); } checkFoundStaticMethod( method, staticOnly, clas ); // This is the first time we've seen this method, set accessibility // Note: even if it's a public method, we may have found it in a // non-public class if ( method != null && !publicOnly ) { try { ReflectManager.RMSetAccessible( method ); } catch ( UtilEvalError e ) { /*ignore*/ } } // If succeeded cache the resolved method. if ( method != null && bcm != null ) bcm.cacheResolvedMethod( clas, types, method ); } return method; }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getObjectProperty( Object obj, String propName ) throws UtilEvalError, ReflectError { Object[] args = new Object[] { }; Interpreter.debug("property access: "); Method method = null; Exception e1=null, e2=null; try { String accessorName = accessorName( "get", propName ); method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); } catch ( Exception e ) { e1 = e; } if ( method == null ) try { String accessorName = accessorName( "is", propName ); method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); if ( method.getReturnType() != Boolean.TYPE ) method = null; } catch ( Exception e ) { e2 = e; } if ( method == null ) throw new ReflectError("Error in property getter: " +e1 + (e2!=null?" : "+e2:"") ); try { return invokeMethod( method, obj, args ); } catch(InvocationTargetException e) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static void setObjectProperty( Object obj, String propName, Object value) throws ReflectError, UtilEvalError { String accessorName = accessorName( "set", propName ); Object[] args = new Object[] { value }; Interpreter.debug("property access: "); try { Method method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); invokeMethod( method, obj, args ); } catch ( InvocationTargetException e ) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object invokeCompiledCommand( Class commandClass, Object [] args, Interpreter interpreter, CallStack callstack ) throws UtilEvalError { // add interpereter and namespace to args list Object[] invokeArgs = new Object[args.length + 2]; invokeArgs[0] = interpreter; invokeArgs[1] = callstack; System.arraycopy( args, 0, invokeArgs, 2, args.length ); BshClassManager bcm = interpreter.getClassManager(); try { return Reflect.invokeStaticMethod( bcm, commandClass, "invoke", invokeArgs ); } catch ( InvocationTargetException e ) { throw new UtilEvalError( "Error in compiled command: "+e.getTargetException() ); } catch ( ReflectError e ) { throw new UtilEvalError("Error invoking compiled command: "+e ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
private static void checkFoundStaticMethod( Method method, boolean staticOnly, Class clas ) throws UtilEvalError { // We're looking for a static method but found an instance method if ( method != null && staticOnly && !isStatic( method ) ) throw new UtilEvalError( "Cannot reach instance method: " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " from static context: "+ clas.getName() ); }
// in org/gjt/sp/jedit/bsh/Name.java
public Object toObject( CallStack callstack, Interpreter interpreter ) throws UtilEvalError { return toObject( callstack, interpreter, false ); }
// in org/gjt/sp/jedit/bsh/Name.java
synchronized public Object toObject( CallStack callstack, Interpreter interpreter, boolean forceClass ) throws UtilEvalError { reset(); Object obj = null; while( evalName != null ) obj = consumeNextObjectField( callstack, interpreter, forceClass, false/*autoalloc*/ ); if ( obj == null ) throw new InterpreterError("null value in toObject()"); return obj; }
// in org/gjt/sp/jedit/bsh/Name.java
private Object consumeNextObjectField( CallStack callstack, Interpreter interpreter, boolean forceClass, boolean autoAllocateThis ) throws UtilEvalError { /* Is it a simple variable name? Doing this first gives the correct Java precedence for vars vs. imported class names (at least in the simple case - see tests/precedence1.bsh). It should also speed things up a bit. */ if ( (evalBaseObject == null && !isCompound(evalName) ) && !forceClass ) { Object obj = resolveThisFieldReference( callstack, namespace, interpreter, evalName, false ); if ( obj != Primitive.VOID ) return completeRound( evalName, FINISHED, obj ); } /* Is it a bsh script variable reference? If we're just starting the eval of name (no base object) or we're evaluating relative to a This type reference check. */ String varName = prefix(evalName, 1); if ( ( evalBaseObject == null || evalBaseObject instanceof This ) && !forceClass ) { if ( Interpreter.DEBUG ) Interpreter.debug("trying to resolve variable: " + varName); Object obj; // switch namespace and special var visibility if ( evalBaseObject == null ) { obj = resolveThisFieldReference( callstack, namespace, interpreter, varName, false ); } else { obj = resolveThisFieldReference( callstack, ((This)evalBaseObject).namespace, interpreter, varName, true ); } if ( obj != Primitive.VOID ) { // Resolved the variable if ( Interpreter.DEBUG ) Interpreter.debug( "resolved variable: " + varName + " in namespace: "+namespace); return completeRound( varName, suffix(evalName), obj ); } } /* Is it a class name? If we're just starting eval of name try to make it, else fail. */ if ( evalBaseObject == null ) { if ( Interpreter.DEBUG ) Interpreter.debug( "trying class: " + evalName); /* Keep adding parts until we have a class */ Class clas = null; int i = 1; String className = null; for(; i <= countParts(evalName); i++) { className = prefix(evalName, i); if ( (clas = namespace.getClass(className)) != null ) break; } if ( clas != null ) { return completeRound( className, suffix( evalName, countParts(evalName)-i ), new ClassIdentifier(clas) ); } // not a class (or variable per above) if ( Interpreter.DEBUG ) Interpreter.debug( "not a class, trying var prefix "+evalName ); } // No variable or class found in 'this' type ref. // if autoAllocateThis then create one; a child 'this'. if ( ( evalBaseObject == null || evalBaseObject instanceof This ) && !forceClass && autoAllocateThis ) { NameSpace targetNameSpace = ( evalBaseObject == null ) ? namespace : ((This)evalBaseObject).namespace; Object obj = new NameSpace( targetNameSpace, "auto: "+varName ).getThis( interpreter ); targetNameSpace.setVariable( varName, obj, false ); return completeRound( varName, suffix(evalName), obj ); } /* If we didn't find a class or variable name (or prefix) above there are two possibilities: - If we are a simple name then we can pass as a void variable reference. - If we are compound then we must fail at this point. */ if ( evalBaseObject == null ) { if ( !isCompound(evalName) ) { return completeRound( evalName, FINISHED, Primitive.VOID ); } else throw new UtilEvalError( "Class or variable not found: " + evalName); } /* -------------------------------------------------------- After this point we're definitely evaluating relative to a base object. -------------------------------------------------------- */ /* Do some basic validity checks. */ if ( evalBaseObject == Primitive.NULL) // previous round produced null throw new UtilTargetError( new NullPointerException( "Null Pointer while evaluating: " +value ) ); if ( evalBaseObject == Primitive.VOID) // previous round produced void throw new UtilEvalError( "Undefined variable or class name while evaluating: "+value); if ( evalBaseObject instanceof Primitive) throw new UtilEvalError("Can't treat primitive like an object. "+ "Error while evaluating: "+value); /* Resolve relative to a class type static field, inner class, ? */ if ( evalBaseObject instanceof ClassIdentifier ) { Class clas = ((ClassIdentifier)evalBaseObject).getTargetClass(); String field = prefix(evalName, 1); // Class qualified 'this' reference from inner class. // e.g. 'MyOuterClass.this' if ( field.equals("this") ) { // find the enclosing class instance space of the class name NameSpace ns = namespace; while ( ns != null ) { // getClassInstance() throws exception if not there if ( ns.classInstance != null && ns.classInstance.getClass() == clas ) return completeRound( field, suffix(evalName), ns.classInstance ); ns=ns.getParent(); } throw new UtilEvalError( "Can't find enclosing 'this' instance of class: "+clas); } Object obj = null; // static field? try { if ( Interpreter.DEBUG ) Interpreter.debug("Name call to getStaticFieldValue, class: " +clas+", field:"+field); obj = Reflect.getStaticFieldValue(clas, field); } catch( ReflectError e ) { if ( Interpreter.DEBUG ) Interpreter.debug("field reflect error: "+e); } // inner class? if ( obj == null ) { String iclass = clas.getName()+"$"+field; Class c = namespace.getClass( iclass ); if ( c != null ) obj = new ClassIdentifier(c); } if ( obj == null ) throw new UtilEvalError( "No static field or inner class: " + field + " of " + clas ); return completeRound( field, suffix(evalName), obj ); } /* If we've fallen through here we are no longer resolving to a class type. */ if ( forceClass ) throw new UtilEvalError( value +" does not resolve to a class name." ); /* Some kind of field access? */ String field = prefix(evalName, 1); // length access on array? if ( field.equals("length") && evalBaseObject.getClass().isArray() ) { Object obj = new Primitive(Array.getLength(evalBaseObject)); return completeRound( field, suffix(evalName), obj ); } // Check for field on object // Note: could eliminate throwing the exception somehow try { Object obj = Reflect.getObjectFieldValue(evalBaseObject, field); return completeRound( field, suffix(evalName), obj ); } catch(ReflectError e) { /* not a field */ } // if we get here we have failed throw new UtilEvalError( "Cannot access field: " + field + ", on object: " + evalBaseObject); }
// in org/gjt/sp/jedit/bsh/Name.java
Object resolveThisFieldReference( CallStack callstack, NameSpace thisNameSpace, Interpreter interpreter, String varName, boolean specialFieldsVisible ) throws UtilEvalError { if ( varName.equals("this") ) { /* Somewhat of a hack. If the special fields are visible (we're operating relative to a 'this' type already) dissallow further .this references to prevent user from skipping to things like super.this.caller */ if ( specialFieldsVisible ) throw new UtilEvalError("Redundant to call .this on This type"); // Allow getThis() to work through BlockNameSpace to the method // namespace // XXX re-eval this... do we need it? This ths = thisNameSpace.getThis( interpreter ); thisNameSpace= ths.getNameSpace(); Object result = ths; NameSpace classNameSpace = getClassNameSpace( thisNameSpace ); if ( classNameSpace != null ) { if ( isCompound( evalName ) ) result = classNameSpace.getThis( interpreter ); else result = classNameSpace.getClassInstance(); } return result; } /* Some duplication for "super". See notes for "this" above If we're in an enclsing class instance and have a superclass instance our super is the superclass instance. */ if ( varName.equals("super") ) { //if ( specialFieldsVisible ) //throw new UtilEvalError("Redundant to call .this on This type"); // Allow getSuper() to through BlockNameSpace to the method's super This ths = thisNameSpace.getSuper( interpreter ); thisNameSpace = ths.getNameSpace(); // super is now the closure's super or class instance // XXXX re-evaluate this // can getSuper work by itself now? // If we're a class instance and the parent is also a class instance // then super means our parent. if ( thisNameSpace.getParent() != null && thisNameSpace.getParent().isClass ) ths = thisNameSpace.getParent().getThis( interpreter ); return ths; } Object obj = null; if ( varName.equals("global") ) obj = thisNameSpace.getGlobal( interpreter ); if ( obj == null && specialFieldsVisible ) { if (varName.equals("namespace")) obj = thisNameSpace; else if (varName.equals("variables")) obj = thisNameSpace.getVariableNames(); else if (varName.equals("methods")) obj = thisNameSpace.getMethodNames(); else if ( varName.equals("interpreter") ) if ( lastEvalName.equals("this") ) obj = interpreter; else throw new UtilEvalError( "Can only call .interpreter on literal 'this'"); } if ( obj == null && specialFieldsVisible && varName.equals("caller") ) { if ( lastEvalName.equals("this") || lastEvalName.equals("caller") ) { // get the previous context (see notes for this class) if ( callstack == null ) throw new InterpreterError("no callstack"); obj = callstack.get( ++callstackDepth ).getThis( interpreter ); } else throw new UtilEvalError( "Can only call .caller on literal 'this' or literal '.caller'"); // early return return obj; } if ( obj == null && specialFieldsVisible && varName.equals("callstack") ) { if ( lastEvalName.equals("this") ) { // get the previous context (see notes for this class) if ( callstack == null ) throw new InterpreterError("no callstack"); obj = callstack; } else throw new UtilEvalError( "Can only call .callstack on literal 'this'"); } if ( obj == null ) obj = thisNameSpace.getVariable(varName); if ( obj == null ) throw new InterpreterError("null this field ref:"+varName); return obj; }
// in org/gjt/sp/jedit/bsh/Name.java
synchronized public Class toClass() throws ClassNotFoundException, UtilEvalError { if ( asClass != null ) return asClass; reset(); // "var" means untyped, return null class if ( evalName.equals("var") ) return asClass = null; /* Try straightforward class name first */ Class clas = namespace.getClass( evalName ); if ( clas == null ) { /* Try toObject() which knows how to work through inner classes and see what we end up with */ Object obj = null; try { // Null interpreter and callstack references. // class only resolution should not require them. obj = toObject( null, null, true ); } catch ( UtilEvalError e ) { }; // couldn't resolve it if ( obj instanceof ClassIdentifier ) clas = ((ClassIdentifier)obj).getTargetClass(); } if ( clas == null ) throw new ClassNotFoundException( "Class: " + value+ " not found in namespace"); asClass = clas; return asClass; }
// in org/gjt/sp/jedit/bsh/Name.java
synchronized public LHS toLHS( CallStack callstack, Interpreter interpreter ) throws UtilEvalError { // Should clean this up to a single return statement reset(); LHS lhs; // Simple (non-compound) variable assignment e.g. x=5; if ( !isCompound(evalName) ) { if ( evalName.equals("this") ) throw new UtilEvalError("Can't assign to 'this'." ); // Interpreter.debug("Simple var LHS..."); lhs = new LHS( namespace, evalName, false/*bubble up if allowed*/); return lhs; } // Field e.g. foo.bar=5; Object obj = null; try { while( evalName != null && isCompound( evalName ) ) { obj = consumeNextObjectField( callstack, interpreter, false/*forcclass*/, true/*autoallocthis*/ ); } } catch( UtilEvalError e ) { throw new UtilEvalError( "LHS evaluation: " + e.getMessage() ); } // Finished eval and its a class. if ( evalName == null && obj instanceof ClassIdentifier ) throw new UtilEvalError("Can't assign to class: " + value ); if ( obj == null ) throw new UtilEvalError("Error in LHS: " + value ); // e.g. this.x=5; or someThisType.x=5; if ( obj instanceof This ) { // dissallow assignment to magic fields if ( evalName.equals("namespace") || evalName.equals("variables") || evalName.equals("methods") || evalName.equals("caller") ) throw new UtilEvalError( "Can't assign to special variable: "+evalName ); Interpreter.debug("found This reference evaluating LHS"); /* If this was a literal "super" reference then we allow recursion in setting the variable to get the normal effect of finding the nearest definition starting at the super scope. On any other resolution qualified by a 'this' type reference we want to set the variable directly in that scope. e.g. this.x=5; or someThisType.x=5; In the old scoping rules super didn't do this. */ boolean localVar = !lastEvalName.equals("super"); return new LHS( ((This)obj).namespace, evalName, localVar ); } if ( evalName != null ) { try { if ( obj instanceof ClassIdentifier ) { Class clas = ((ClassIdentifier)obj).getTargetClass(); lhs = Reflect.getLHSStaticField(clas, evalName); return lhs; } else { lhs = Reflect.getLHSObjectField(obj, evalName); return lhs; } } catch(ReflectError e) { throw new UtilEvalError("Field access: "+e); } } throw new InterpreterError("Internal error in lhs..."); }
// in org/gjt/sp/jedit/bsh/Name.java
public Object invokeMethod( Interpreter interpreter, Object[] args, CallStack callstack, SimpleNode callerInfo ) throws UtilEvalError, EvalError, ReflectError, InvocationTargetException { String methodName = Name.suffix(value, 1); BshClassManager bcm = interpreter.getClassManager(); NameSpace namespace = callstack.top(); // Optimization - If classOfStaticMethod is set then we have already // been here and determined that this is a static method invocation. // Note: maybe factor this out with path below... clean up. if ( classOfStaticMethod != null ) { return Reflect.invokeStaticMethod( bcm, classOfStaticMethod, methodName, args ); } if ( !Name.isCompound(value) ) return invokeLocalMethod( interpreter, args, callstack, callerInfo ); // Note: if we want methods declared inside blocks to be accessible via // this.methodname() inside the block we could handle it here as a // special case. See also resolveThisFieldReference() special handling // for BlockNameSpace case. They currently work via the direct name // e.g. methodName(). String prefix = Name.prefix(value); // Superclass method invocation? (e.g. super.foo()) if ( prefix.equals("super") && Name.countParts(value) == 2 ) { // Allow getThis() to work through block namespaces first This ths = namespace.getThis( interpreter ); NameSpace thisNameSpace = ths.getNameSpace(); NameSpace classNameSpace = getClassNameSpace( thisNameSpace ); if ( classNameSpace != null ) { Object instance = classNameSpace.getClassInstance(); return ClassGenerator.getClassGenerator() .invokeSuperclassMethod( bcm, instance, methodName, args ); } } // Find target object or class identifier Name targetName = namespace.getNameResolver( prefix ); Object obj = targetName.toObject( callstack, interpreter ); if ( obj == Primitive.VOID ) throw new UtilEvalError( "Attempt to resolve method: "+methodName +"() on undefined variable or class name: "+targetName); // if we've got an object, resolve the method if ( !(obj instanceof ClassIdentifier) ) { if (obj instanceof Primitive) { if (obj == Primitive.NULL) throw new UtilTargetError( new NullPointerException( "Null Pointer in Method Invocation" ) ); // some other primitive // should avoid calling methods on primitive, as we do // in Name (can't treat primitive like an object message) // but the hole is useful right now. if ( Interpreter.DEBUG ) interpreter.debug( "Attempt to access method on primitive..." + " allowing bsh.Primitive to peek through for debugging"); } // found an object and it's not an undefined variable return Reflect.invokeObjectMethod( obj, methodName, args, interpreter, callstack, callerInfo ); } // It's a class // try static method if ( Interpreter.DEBUG ) Interpreter.debug("invokeMethod: trying static - " + targetName); Class clas = ((ClassIdentifier)obj).getTargetClass(); // cache the fact that this is a static method invocation on this class classOfStaticMethod = clas; if ( clas != null ) return Reflect.invokeStaticMethod( bcm, clas, methodName, args ); // return null; ??? throw new UtilEvalError("invokeMethod: unknown target: " + targetName); }
// in org/gjt/sp/jedit/bsh/ExternalNameSpace.java
void setVariable( String name, Object value, boolean strictJava, boolean recurse ) throws UtilEvalError { super.setVariable( name, value, strictJava, recurse ); putExternalMap( name, value ); }
// in org/gjt/sp/jedit/bsh/ExternalNameSpace.java
protected Variable getVariableImpl( String name, boolean recurse ) throws UtilEvalError { // check the external map for the variable name Object value = externalMap.get( name ); Variable var; if ( value == null ) { // The var is not in external map and it should therefore not be // found in local scope (it may have been removed via the map). // Clear it prophalactically. super.unsetVariable( name ); // Search parent for var if applicable. var = super.getVariableImpl( name, recurse ); } else { // Var in external map may be found in local scope with type and // modifier info. Variable localVar = super.getVariableImpl( name, false ); // If not in local scope then it was added via the external map, // we'll wrap it and pass it along. Else we'll use the local // version. if ( localVar == null ) var = new Variable( name, (Class)null, value, (Modifiers)null ); else var = localVar; } return var; }
// in org/gjt/sp/jedit/bsh/ExternalNameSpace.java
public void setTypedVariable( String name, Class type, Object value, Modifiers modifiers ) throws UtilEvalError { super.setTypedVariable( name, type, value, modifiers ); putExternalMap( name, value ); }
// in org/gjt/sp/jedit/bsh/ExternalNameSpace.java
public void setMethod( String name, BshMethod method ) throws UtilEvalError { super.setMethod( name, method ); }
// in org/gjt/sp/jedit/bsh/ExternalNameSpace.java
public BshMethod getMethod( String name, Class [] sig, boolean declaredOnly ) throws UtilEvalError { return super.getMethod( name, sig, declaredOnly ); }
// in org/gjt/sp/jedit/bsh/BlockNameSpace.java
public void setVariable( String name, Object value, boolean strictJava, boolean recurse ) throws UtilEvalError { if ( weHaveVar( name ) ) // set the var here in the block namespace super.setVariable( name, value, strictJava, false ); else // set the var in the enclosing (parent) namespace getParent().setVariable( name, value, strictJava, recurse ); }
// in org/gjt/sp/jedit/bsh/BlockNameSpace.java
public void setBlockVariable( String name, Object value ) throws UtilEvalError { super.setVariable( name, value, false/*strict?*/, false ); }
// in org/gjt/sp/jedit/bsh/BlockNameSpace.java
public void setMethod(String name, BshMethod method) throws UtilEvalError { getParent().setMethod( name, method ); }
// in org/gjt/sp/jedit/bsh/Types.java
public static Object castObject( Object fromValue, Class toType, int operation ) throws UtilEvalError { if ( fromValue == null ) throw new InterpreterError("null fromValue"); Class fromType = fromValue instanceof Primitive ? ((Primitive)fromValue).getType() : fromValue.getClass(); return castObject( toType, fromType, fromValue, operation, false/*checkonly*/ ); }
// in org/gjt/sp/jedit/bsh/Types.java
private static Object castObject( Class toType, Class fromType, Object fromValue, int operation, boolean checkOnly ) throws UtilEvalError { /* Lots of preconditions checked here... Once things are running smoothly we might comment these out (That's what assertions are for). */ if ( checkOnly && fromValue != null ) throw new InterpreterError("bad cast params 1"); if ( !checkOnly && fromValue == null ) throw new InterpreterError("bad cast params 2"); if ( fromType == Primitive.class ) throw new InterpreterError("bad from Type, need to unwrap"); if ( fromValue == Primitive.NULL && fromType != null ) throw new InterpreterError("inconsistent args 1"); if ( fromValue == Primitive.VOID && fromType != Void.TYPE ) throw new InterpreterError("inconsistent args 2"); if ( toType == Void.TYPE ) throw new InterpreterError("loose toType should be null"); // assignment to loose type, void type, or exactly same type if ( toType == null || toType == fromType ) return checkOnly ? VALID_CAST : fromValue; // Casting to primitive type if ( toType.isPrimitive() ) { if ( fromType == Void.TYPE || fromType == null || fromType.isPrimitive() ) { // Both primitives, do primitive cast return Primitive.castPrimitive( toType, fromType, (Primitive)fromValue, checkOnly, operation ); } else { if ( Primitive.isWrapperType( fromType ) ) { // wrapper to primitive // Convert value to Primitive and check/cast it. //Object r = checkOnly ? VALID_CAST : Class unboxedFromType = Primitive.unboxType( fromType ); Primitive primFromValue; if ( checkOnly ) primFromValue = null; // must be null in checkOnly else primFromValue = (Primitive)Primitive.wrap( fromValue, unboxedFromType ); return Primitive.castPrimitive( toType, unboxedFromType, primFromValue, checkOnly, operation ); } else { // Cannot cast from arbitrary object to primitive if ( checkOnly ) return INVALID_CAST; else throw castError( toType, fromType, operation ); } } } // Else, casting to reference type // Casting from primitive or void (to reference type) if ( fromType == Void.TYPE || fromType == null || fromType.isPrimitive() ) { // cast from primitive to wrapper type if ( Primitive.isWrapperType( toType ) && fromType != Void.TYPE && fromType != null ) { // primitive to wrapper type return checkOnly ? VALID_CAST : Primitive.castWrapper( Primitive.unboxType(toType), ((Primitive)fromValue).getValue() ); } // Primitive (not null or void) to Object.class type if ( toType == Object.class && fromType != Void.TYPE && fromType != null ) { // box it return checkOnly ? VALID_CAST : ((Primitive)fromValue).getValue(); } // Primitive to arbitrary object type. // Allow Primitive.castToType() to handle it as well as cases of // Primitive.NULL and Primitive.VOID return Primitive.castPrimitive( toType, fromType, (Primitive)fromValue, checkOnly, operation ); } // If type already assignable no cast necessary // We do this last to allow various errors above to be caught. // e.g cast Primitive.Void to Object would pass this if ( toType.isAssignableFrom( fromType ) ) return checkOnly ? VALID_CAST : fromValue; // Can we use the proxy mechanism to cast a bsh.This to // the correct interface? if ( toType.isInterface() && org.gjt.sp.jedit.bsh.This.class.isAssignableFrom( fromType ) && Capabilities.canGenerateInterfaces() ) return checkOnly ? VALID_CAST : ((org.gjt.sp.jedit.bsh.This)fromValue).getInterface( toType ); // Both numeric wrapper types? // Try numeric style promotion wrapper cast if ( Primitive.isWrapperType( toType ) && Primitive.isWrapperType( fromType ) ) return checkOnly ? VALID_CAST : Primitive.castWrapper( toType, fromValue ); if ( checkOnly ) return INVALID_CAST; else throw castError( toType, fromType , operation ); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public void doSuperImport() throws UtilEvalError { // Should we prevent it from happening twice? try { getClassPath().insureInitialized(); // prime the lookup table getClassNameByUnqName( "" ) ; // always true now //getClassPath().setNameCompletionIncludeUnqNames(true); } catch ( ClassPathException e ) { throw new UtilEvalError("Error importing classpath "+ e ); } superImport = true; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
Object getClassInstance() throws UtilEvalError { if ( classInstance != null ) return classInstance; if ( classStatic != null //|| ( getParent()!=null && getParent().classStatic != null ) ) throw new UtilEvalError( "Can't refer to class instance from static context."); else throw new InterpreterError( "Can't resolve class instance 'this' in: "+this); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public Object get( String name, Interpreter interpreter ) throws UtilEvalError { CallStack callstack = new CallStack( this ); return getNameResolver( name ).toObject( callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public void setVariable( String name, Object value, boolean strictJava ) throws UtilEvalError { // if localscoping switch follow strictJava, else recurse boolean recurse = Interpreter.LOCALSCOPING ? strictJava : true; setVariable( name, value, strictJava, recurse ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
void setLocalVariable( String name, Object value, boolean strictJava ) throws UtilEvalError { setVariable( name, value, strictJava, false/*recurse*/ ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
void setVariable( String name, Object value, boolean strictJava, boolean recurse ) throws UtilEvalError { if ( variables == null ) variables = new Hashtable(); // primitives should have been wrapped // {{{ jEdit change //if ( value == null ) // throw new InterpreterError("null variable value"); if ( value == null ) { // don't break jEdit core and plugins! unsetVariable(name); return; } // }}} // Locate the variable definition if it exists. Variable existing = getVariableImpl( name, recurse ); // Found an existing variable here (or above if recurse allowed) if ( existing != null ) { try { existing.setValue( value, Variable.ASSIGNMENT ); } catch ( UtilEvalError e ) { throw new UtilEvalError( "Variable assignment: " + name + ": " + e.getMessage()); } } else // No previous variable definition found here (or above if recurse) { if ( strictJava ) throw new UtilEvalError( "(Strict Java mode) Assignment to undeclared variable: " +name ); // If recurse, set global untyped var, else set it here. //NameSpace varScope = recurse ? getGlobal() : this; // This modification makes default allocation local NameSpace varScope = this; varScope.variables.put( name, new Variable( name, value, null/*modifiers*/ ) ); // nameSpaceChanged() on new variable addition nameSpaceChanged(); } }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public Object getVariable( String name ) throws UtilEvalError { return getVariable( name, true ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public Object getVariable( String name, boolean recurse ) throws UtilEvalError { Variable var = getVariableImpl( name, recurse ); return unwrapVariable( var ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
protected Variable getVariableImpl( String name, boolean recurse ) throws UtilEvalError { Variable var = null; // Change import precedence if we are a class body/instance // Get imported first. if ( var == null && isClass ) var = getImportedVar( name ); if ( var == null && variables != null ) var = (Variable)variables.get(name); // Change import precedence if we are a class body/instance if ( var == null && !isClass ) var = getImportedVar( name ); // try parent if ( recurse && (var == null) && (parent != null) ) var = parent.getVariableImpl( name, recurse ); return var; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
protected Object unwrapVariable( Variable var ) throws UtilEvalError { return (var == null) ? Primitive.VOID : var.getValue(); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public void setTypedVariable( String name, Class type, Object value, boolean isFinal ) throws UtilEvalError { Modifiers modifiers = new Modifiers(); if ( isFinal ) modifiers.addModifier( Modifiers.FIELD, "final" ); setTypedVariable( name, type, value, modifiers ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public void setTypedVariable( String name, Class type, Object value, Modifiers modifiers ) throws UtilEvalError { //checkVariableModifiers( name, modifiers ); if ( variables == null ) variables = new Hashtable(); // Setting a typed variable is always a local operation. Variable existing = getVariableImpl( name, false/*recurse*/ ); // Null value is just a declaration // Note: we might want to keep any existing value here instead of reset /* // Moved to Variable if ( value == null ) value = Primitive.getDefaultValue( type ); */ // does the variable already exist? if ( existing != null ) { // Is it typed? if ( existing.getType() != null ) { // If it had a different type throw error. // This allows declaring the same var again, but not with // a different (even if assignable) type. if ( existing.getType() != type ) { throw new UtilEvalError( "Typed variable: "+name +" was previously declared with type: " + existing.getType() ); } else { // else set it and return existing.setValue( value, Variable.DECLARATION ); return; } } // Careful here: // else fall through to override and install the new typed version } // Add the new typed var variables.put( name, new Variable( name, type, value, modifiers ) ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public void setMethod( String name, BshMethod method ) throws UtilEvalError { //checkMethodModifiers( method ); if ( methods == null ) methods = new Hashtable(); Object m = methods.get(name); //{{{ jEdit version: properly handle methods with same signature. if (m == null) methods.put(name, method); else if (m instanceof BshMethod) { // is the new method overriding the old method? if (Arrays.equals(((BshMethod)m).getParameterTypes(), method.getParameterTypes())) { methods.put(name, method); } else { Vector v = new Vector(); v.addElement( m ); v.addElement( method ); methods.put( name, v ); } } else { Vector _methods = (Vector) m; for (int i = 0; i < _methods.size(); i++) { // Check whether the new method overrides some old // method in the list. BshMethod _old_m = (BshMethod) _methods.get(i); if (Arrays.equals(_old_m.getParameterTypes(), method.getParameterTypes())) { _methods.remove(i); break; } } _methods.addElement( method ); } //}}} //{{{ Original BeanShell code // if ( m == null ) // methods.put(name, method); // else // if ( m instanceof BshMethod ) { // Vector v = new Vector(); // v.addElement( m ); // v.addElement( method ); // methods.put( name, v ); // } else // Vector // ((Vector)m).addElement( method ); //}}} }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public BshMethod getMethod( String name, Class [] sig ) throws UtilEvalError { return getMethod( name, sig, false/*declaredOnly*/ ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public BshMethod getMethod( String name, Class [] sig, boolean declaredOnly ) throws UtilEvalError { BshMethod method = null; // Change import precedence if we are a class body/instance // Get import first. if ( method == null && isClass && !declaredOnly ) method = getImportedMethod( name, sig ); Object m = null; if ( method == null && methods != null ) { m = methods.get(name); // m contains either BshMethod or Vector of BshMethod if ( m != null ) { // unwrap BshMethod [] ma; if ( m instanceof Vector ) { Vector vm = (Vector)m; ma = new BshMethod[ vm.size() ]; vm.copyInto( ma ); } else ma = new BshMethod[] { (BshMethod)m }; // Apply most specific signature matching Class [][] candidates = new Class[ ma.length ][]; for( int i=0; i< ma.length; i++ ) candidates[i] = ma[i].getParameterTypes(); int match = Reflect.findMostSpecificSignature( sig, candidates ); if ( match != -1 ) method = ma[match]; } } if ( method == null && !isClass && !declaredOnly ) method = getImportedMethod( name, sig ); // try parent if ( !declaredOnly && (method == null) && (parent != null) ) return parent.getMethod( name, sig ); return method; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public Object getCommand( String name, Class [] argTypes, Interpreter interpreter ) throws UtilEvalError { if (Interpreter.DEBUG) Interpreter.debug("getCommand: "+name); BshClassManager bcm = interpreter.getClassManager(); InputStream in = getCommand( name ); if ( in != null ) return loadScriptedCommand( in, name, argTypes, name, interpreter ); /* // Chop leading "/" and change "/" to "." String className; if ( path.equals("/") ) className = name; else className = path.substring(1).replace('/','.') +"."+name; Class clas = bcm.classForName( className ); if ( clas != null ) return clas; */ if ( parent != null ) return parent.getCommand( name, argTypes, interpreter ); else return null; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
protected BshMethod getImportedMethod( String name, Class [] sig ) throws UtilEvalError { // Try object imports if ( importedObjects != null ) for(int i=0; i<importedObjects.size(); i++) { Object object = importedObjects.elementAt(i); Class clas = object.getClass(); Method method = Reflect.resolveJavaMethod( getClassManager(), clas, name, sig, false/*onlyStatic*/ ); if ( method != null ) return new BshMethod( method, object ); } // Try static imports if ( importedStatic!= null ) for(int i=0; i<importedStatic.size(); i++) { Class clas = (Class)importedStatic.elementAt(i); Method method = Reflect.resolveJavaMethod( getClassManager(), clas, name, sig, true/*onlyStatic*/ ); if ( method != null ) return new BshMethod( method, null/*object*/ ); } return null; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
protected Variable getImportedVar( String name ) throws UtilEvalError { // Try object imports if ( importedObjects != null ) for(int i=0; i<importedObjects.size(); i++) { Object object = importedObjects.elementAt(i); Class clas = object.getClass(); Field field = Reflect.resolveJavaField( clas, name, false/*onlyStatic*/ ); if ( field != null ) return new Variable( name, field.getType(), new LHS( object, field ) ); } // Try static imports if ( importedStatic!= null ) for(int i=0; i<importedStatic.size(); i++) { Class clas = (Class)importedStatic.elementAt(i); Field field = Reflect.resolveJavaField( clas, name, true/*onlyStatic*/ ); if ( field != null ) return new Variable( name, field.getType(), new LHS( field ) ); } return null; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
private BshMethod loadScriptedCommand( InputStream in, String name, Class [] argTypes, String resourcePath, Interpreter interpreter ) throws UtilEvalError { try { interpreter.eval( new InputStreamReader(in), this, resourcePath ); } catch ( EvalError e ) { /* Here we catch any EvalError from the interpreter because we are using it as a tool to load the command, not as part of the execution path. */ Interpreter.debug( e.toString() ); throw new UtilEvalError( "Error loading script: "+ e.getMessage()); } // Look for the loaded command BshMethod meth = getMethod( name, argTypes ); /* if ( meth == null ) throw new UtilEvalError("Loaded resource: " + resourcePath + "had an error or did not contain the correct method" ); */ return meth; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public Class getClass( String name ) throws UtilEvalError { Class c = getClassImpl(name); if ( c != null ) return c; else // implement the recursion for getClassImpl() if ( parent != null ) return parent.getClass( name ); else return null; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
private Class getClassImpl( String name ) throws UtilEvalError { Class c = null; // Check the cache if (classCache != null) { c = (Class)classCache.get(name); if ( c != null ) return c; } // Unqualified (simple, non-compound) name boolean unqualifiedName = !Name.isCompound(name); // Unqualified name check imported if ( unqualifiedName ) { // Try imported class if ( c == null ) c = getImportedClassImpl( name ); // if found as imported also cache it if ( c != null ) { cacheClass( name, c ); return c; } } // Try absolute c = classForName( name ); if ( c != null ) { // Cache unqualified names to prevent import check again if ( unqualifiedName ) cacheClass( name, c ); return c; } // Not found if ( Interpreter.DEBUG ) Interpreter.debug("getClass(): " + name + " not found in "+this); return null; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
private Class getImportedClassImpl( String name ) throws UtilEvalError { // Try explicitly imported class, e.g. import foo.Bar; String fullname = null; if ( importedClasses != null ) fullname = (String)importedClasses.get(name); // not sure if we should really recurse here for explicitly imported // class in parent... if ( fullname != null ) { /* Found the full name in imported classes. */ // Try to make the full imported name Class clas=classForName(fullname); // Handle imported inner class case if ( clas == null ) { // Imported full name wasn't found as an absolute class // If it is compound, try to resolve to an inner class. // (maybe this should happen in the BshClassManager?) if ( Name.isCompound( fullname ) ) try { clas = getNameResolver( fullname ).toClass(); } catch ( ClassNotFoundException e ) { /* not a class */ } else if ( Interpreter.DEBUG ) Interpreter.debug( "imported unpackaged name not found:" +fullname); // If found cache the full name in the BshClassManager if ( clas != null ) { // (should we cache info in not a class case too?) getClassManager().cacheClassInfo( fullname, clas ); return clas; } } else return clas; // It was explicitly imported, but we don't know what it is. // should we throw an error here?? return null; } /* Try imported packages, e.g. "import foo.bar.*;" in reverse order of import... (give later imports precedence...) */ if ( importedPackages != null ) for(int i=importedPackages.size()-1; i>=0; i--) { String s = ((String)importedPackages.elementAt(i)) + "." + name; Class c=classForName(s); if ( c != null ) return c; } BshClassManager bcm = getClassManager(); /* Try super import if available Note: we do this last to allow explicitly imported classes and packages to take priority. This method will also throw an error indicating ambiguity if it exists... */ if ( bcm.hasSuperImport() ) { String s = bcm.getClassNameByUnqName( name ); if ( s != null ) return classForName( s ); } return null; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public void doSuperImport() throws UtilEvalError { getClassManager().doSuperImport(); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public void setVariable(String name, Object value) throws UtilEvalError { setVariable(name,value,false); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
public void setClassPath( URL [] cp ) throws UtilEvalError { throw cmUnavailable(); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
public void reloadAllClasses() throws UtilEvalError { throw cmUnavailable(); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
public void reloadClasses( String [] classNames ) throws UtilEvalError { throw cmUnavailable(); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
public void reloadPackage( String pack ) throws UtilEvalError { throw cmUnavailable(); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
protected void doSuperImport() throws UtilEvalError { throw cmUnavailable(); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
protected String getClassNameByUnqName( String name ) throws UtilEvalError { throw cmUnavailable(); }
// in org/gjt/sp/jedit/bsh/ClassGenerator.java
public static ClassGenerator getClassGenerator() throws UtilEvalError { if ( cg == null ) { try { Class clas = Class.forName( "org.gjt.sp.jedit.bsh.ClassGeneratorImpl" ); cg = (ClassGenerator)clas.newInstance(); } catch ( Exception e ) { throw new Unavailable("ClassGenerator unavailable: "+e); } } return cg; }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
private Object operation( Object lhs, Object rhs, int kind ) throws UtilEvalError { /* Implement String += value; According to the JLS, value may be anything. In BeanShell, we'll disallow VOID (undefined) values. (or should we map them to the empty string?) */ if ( lhs instanceof String && rhs != Primitive.VOID ) { if ( kind != PLUS ) throw new UtilEvalError( "Use of non + operator with String LHS" ); return (String)lhs + rhs; } if ( lhs instanceof Primitive || rhs instanceof Primitive ) if(lhs == Primitive.VOID || rhs == Primitive.VOID) throw new UtilEvalError( "Illegal use of undefined object or 'void' literal" ); else if ( lhs == Primitive.NULL || rhs == Primitive.NULL ) throw new UtilEvalError( "Illegal use of null object or 'null' literal" ); if( (lhs instanceof Boolean || lhs instanceof Character || lhs instanceof Number || lhs instanceof Primitive) && (rhs instanceof Boolean || rhs instanceof Character || rhs instanceof Number || rhs instanceof Primitive) ) { return Primitive.binaryOperation(lhs, rhs, kind); } throw new UtilEvalError("Non primitive value in operator: " + lhs.getClass() + " " + tokenImage[kind] + " " + rhs.getClass() ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
public static Object binaryOperation( Object obj1, Object obj2, int kind) throws UtilEvalError { // special primitive types if ( obj1 == NULL || obj2 == NULL ) throw new UtilEvalError( "Null value or 'null' literal in binary operation"); if ( obj1 == VOID || obj2 == VOID ) throw new UtilEvalError( "Undefined variable, class, or 'void' literal in binary operation"); // keep track of the original types Class lhsOrgType = obj1.getClass(); Class rhsOrgType = obj2.getClass(); // Unwrap primitives if ( obj1 instanceof Primitive ) obj1 = ((Primitive)obj1).getValue(); if ( obj2 instanceof Primitive ) obj2 = ((Primitive)obj2).getValue(); Object[] operands = promotePrimitives(obj1, obj2); Object lhs = operands[0]; Object rhs = operands[1]; if(lhs.getClass() != rhs.getClass()) throw new UtilEvalError("Type mismatch in operator. " + lhs.getClass() + " cannot be used with " + rhs.getClass() ); Object result; try { result = binaryOperationImpl( lhs, rhs, kind ); } catch ( ArithmeticException e ) { throw new UtilTargetError( "Arithemetic Exception in binary op", e); } // If both original args were Primitives return a Primitive result // else it was mixed (wrapper/primitive) return the wrapper type // Exception is for boolean result, return the primitive if ( (lhsOrgType == Primitive.class && rhsOrgType == Primitive.class) || result instanceof Boolean ) return new Primitive( result ); else return result; }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object binaryOperationImpl( Object lhs, Object rhs, int kind ) throws UtilEvalError { if(lhs instanceof Boolean) return booleanBinaryOperation((Boolean)lhs, (Boolean)rhs, kind); else if(lhs instanceof Integer) return intBinaryOperation( (Integer)lhs, (Integer)rhs, kind ); else if(lhs instanceof Long) return longBinaryOperation((Long)lhs, (Long)rhs, kind); else if(lhs instanceof Float) return floatBinaryOperation((Float)lhs, (Float)rhs, kind); else if(lhs instanceof Double) return doubleBinaryOperation( (Double)lhs, (Double)rhs, kind); else throw new UtilEvalError("Invalid types in binary operator" ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object doubleBinaryOperation(Double D1, Double D2, int kind) throws UtilEvalError { double lhs = D1.doubleValue(); double rhs = D2.doubleValue(); switch(kind) { // boolean case LT: case LTX: return new Boolean(lhs < rhs); case GT: case GTX: return new Boolean(lhs > rhs); case EQ: return new Boolean(lhs == rhs); case LE: case LEX: return new Boolean(lhs <= rhs); case GE: case GEX: return new Boolean(lhs >= rhs); case NE: return new Boolean(lhs != rhs); // arithmetic case PLUS: return new Double(lhs + rhs); case MINUS: return new Double(lhs - rhs); case STAR: return new Double(lhs * rhs); case SLASH: return new Double(lhs / rhs); case MOD: return new Double(lhs % rhs); // can't shift floating-point values case LSHIFT: case LSHIFTX: case RSIGNEDSHIFT: case RSIGNEDSHIFTX: case RUNSIGNEDSHIFT: case RUNSIGNEDSHIFTX: throw new UtilEvalError("Can't shift doubles"); default: throw new InterpreterError( "Unimplemented binary double operator"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object floatBinaryOperation(Float F1, Float F2, int kind) throws UtilEvalError { float lhs = F1.floatValue(); float rhs = F2.floatValue(); switch(kind) { // boolean case LT: case LTX: return new Boolean(lhs < rhs); case GT: case GTX: return new Boolean(lhs > rhs); case EQ: return new Boolean(lhs == rhs); case LE: case LEX: return new Boolean(lhs <= rhs); case GE: case GEX: return new Boolean(lhs >= rhs); case NE: return new Boolean(lhs != rhs); // arithmetic case PLUS: return new Float(lhs + rhs); case MINUS: return new Float(lhs - rhs); case STAR: return new Float(lhs * rhs); case SLASH: return new Float(lhs / rhs); case MOD: return new Float(lhs % rhs); // can't shift floats case LSHIFT: case LSHIFTX: case RSIGNEDSHIFT: case RSIGNEDSHIFTX: case RUNSIGNEDSHIFT: case RUNSIGNEDSHIFTX: throw new UtilEvalError("Can't shift floats "); default: throw new InterpreterError( "Unimplemented binary float operator"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
public static Primitive unaryOperation(Primitive val, int kind) throws UtilEvalError { if (val == NULL) throw new UtilEvalError( "illegal use of null object or 'null' literal"); if (val == VOID) throw new UtilEvalError( "illegal use of undefined object or 'void' literal"); Class operandType = val.getType(); Object operand = promoteToInteger(val.getValue()); if ( operand instanceof Boolean ) return new Primitive(booleanUnaryOperation((Boolean)operand, kind)); else if(operand instanceof Integer) { int result = intUnaryOperation((Integer)operand, kind); // ++ and -- must be cast back the original type if(kind == INCR || kind == DECR) { if(operandType == Byte.TYPE) return new Primitive((byte)result); if(operandType == Short.TYPE) return new Primitive((short)result); if(operandType == Character.TYPE) return new Primitive((char)result); } return new Primitive(result); } else if(operand instanceof Long) return new Primitive(longUnaryOperation((Long)operand, kind)); else if(operand instanceof Float) return new Primitive(floatUnaryOperation((Float)operand, kind)); else if(operand instanceof Double) return new Primitive(doubleUnaryOperation((Double)operand, kind)); else throw new InterpreterError( "An error occurred. Please call technical support."); }
// in org/gjt/sp/jedit/bsh/Primitive.java
static boolean booleanUnaryOperation(Boolean B, int kind) throws UtilEvalError { boolean operand = B.booleanValue(); switch(kind) { case BANG: return !operand; default: throw new UtilEvalError("Operator inappropriate for boolean"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
public int intValue() throws UtilEvalError { if(value instanceof Number) return((Number)value).intValue(); else throw new UtilEvalError("Primitive not a number"); }
// in org/gjt/sp/jedit/bsh/Primitive.java
public boolean booleanValue() throws UtilEvalError { if(value instanceof Boolean) return((Boolean)value).booleanValue(); else throw new UtilEvalError("Primitive not a boolean"); }
// in org/gjt/sp/jedit/bsh/Primitive.java
public Number numberValue() throws UtilEvalError { Object value = this.value; // Promote character to Number type for these purposes if (value instanceof Character) value = new Integer(((Character)value).charValue()); if (value instanceof Number) return (Number)value; else throw new UtilEvalError("Primitive not a number"); }
// in org/gjt/sp/jedit/bsh/Primitive.java
public Primitive castToType( Class toType, int operation ) throws UtilEvalError { return castPrimitive( toType, getType()/*fromType*/, this/*fromValue*/, false/*checkOnly*/, operation ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Primitive castPrimitive( Class toType, Class fromType, Primitive fromValue, boolean checkOnly, int operation ) throws UtilEvalError { /* Lots of preconditions checked here... Once things are running smoothly we might comment these out (That's what assertions are for). */ if ( checkOnly && fromValue != null ) throw new InterpreterError("bad cast param 1"); if ( !checkOnly && fromValue == null ) throw new InterpreterError("bad cast param 2"); if ( fromType != null && !fromType.isPrimitive() ) throw new InterpreterError("bad fromType:" +fromType); if ( fromValue == Primitive.NULL && fromType != null ) throw new InterpreterError("inconsistent args 1"); if ( fromValue == Primitive.VOID && fromType != Void.TYPE ) throw new InterpreterError("inconsistent args 2"); // can't cast void to anything if ( fromType == Void.TYPE ) if ( checkOnly ) return Types.INVALID_CAST; else throw Types.castError( Reflect.normalizeClassName(toType), "void value", operation ); // unwrap Primitive fromValue to its wrapper value, etc. Object value = null; if ( fromValue != null ) value = fromValue.getValue(); if ( toType.isPrimitive() ) { // Trying to cast null to primitive type? if ( fromType == null ) if ( checkOnly ) return Types.INVALID_CAST; else throw Types.castError( "primitive type:" + toType, "Null value", operation ); // fall through } else { // Trying to cast primitive to an object type // Primitive.NULL can be cast to any object type if ( fromType == null ) return checkOnly ? Types.VALID_CAST : Primitive.NULL; if ( checkOnly ) return Types.INVALID_CAST; else throw Types.castError( "object type:" + toType, "primitive value", operation); } // can only cast boolean to boolean if ( fromType == Boolean.TYPE ) { if ( toType != Boolean.TYPE ) if ( checkOnly ) return Types.INVALID_CAST; else throw Types.castError( toType, fromType, operation ); return checkOnly ? Types.VALID_CAST : fromValue; } // Do numeric cast // Only allow legal Java assignment unless we're a CAST operation if ( operation == Types.ASSIGNMENT && !Types.isJavaAssignable( toType, fromType ) ) { if ( checkOnly ) return Types.INVALID_CAST; else throw Types.castError( toType, fromType, operation ); } return checkOnly ? Types.VALID_CAST : new Primitive( castWrapper(toType, value) ); }
// in org/gjt/sp/jedit/bsh/LHS.java
public Object getValue() throws UtilEvalError { if ( type == VARIABLE ) return nameSpace.getVariable( varName ); if (type == FIELD) try { Object o = field.get( object ); return Primitive.wrap( o, field.getType() ); } catch(IllegalAccessException e2) { throw new UtilEvalError("Can't read field: " + field); } if ( type == PROPERTY ) try { return Reflect.getObjectProperty(object, propName); } catch(ReflectError e) { Interpreter.debug(e.getMessage()); throw new UtilEvalError("No such property: " + propName); } if ( type == INDEX ) try { return Reflect.getIndex(object, index); } catch(Exception e) { throw new UtilEvalError("Array access: " + e); } throw new InterpreterError("LHS type"); }
// in org/gjt/sp/jedit/bsh/LHS.java
public Object assign( Object val, boolean strictJava ) throws UtilEvalError { if ( type == VARIABLE ) { // Set the variable in namespace according to localVar flag if ( localVar ) nameSpace.setLocalVariable( varName, val, strictJava ); else nameSpace.setVariable( varName, val, strictJava ); } else if ( type == FIELD ) { try { Object fieldVal = val instanceof Primitive ? ((Primitive)val).getValue() : val; // This should probably be in Reflect.java ReflectManager.RMSetAccessible( field ); field.set( object, fieldVal ); return val; } catch( NullPointerException e) { throw new UtilEvalError( "LHS ("+field.getName()+") not a static field."); } catch( IllegalAccessException e2) { throw new UtilEvalError( "LHS ("+field.getName()+") can't access field: "+e2); } catch( IllegalArgumentException e3) { String type = val instanceof Primitive ? ((Primitive)val).getType().getName() : val.getClass().getName(); throw new UtilEvalError( "Argument type mismatch. " + (val == null ? "null" : type ) + " not assignable to field "+field.getName()); } } else if ( type == PROPERTY ) { /* if ( object instanceof Hashtable ) ((Hashtable)object).put(propName, val); */ CollectionManager cm = CollectionManager.getCollectionManager(); if ( cm.isMap( object ) ) cm.putInMap( object/*map*/, propName, val ); else try { Reflect.setObjectProperty(object, propName, val); } catch(ReflectError e) { Interpreter.debug("Assignment: " + e.getMessage()); throw new UtilEvalError("No such property: " + propName); } } else if ( type == INDEX ) try { Reflect.setIndex(object, index, val); } catch ( UtilTargetError e1 ) { // pass along target error throw e1; } catch ( Exception e ) { throw new UtilEvalError("Assignment: " + e.getMessage()); } else throw new InterpreterError("unknown lhs"); return val; }
// in org/gjt/sp/jedit/BeanShellFacade.java
protected void setVariable(NameSpace nameSpace, String name, Object object) throws UtilEvalError { if (nameSpace.getVariable(name) == Primitive.VOID) nameSpace.setVariable(name,object, false); }
// in org/gjt/sp/jedit/BeanShell.java
Override protected void setupDefaultVariables(NameSpace namespace, View view) throws UtilEvalError { if(view != null) { EditPane editPane = view.getEditPane(); setVariable(namespace, "view", view); setVariable(namespace, "editPane",editPane); setVariable(namespace, "buffer",editPane.getBuffer()); setVariable(namespace, "textArea",editPane.getTextArea()); setVariable(namespace, "wm",view.getDockableWindowManager()); } }
// in org/gjt/sp/jedit/BeanShell.java
Override protected void resetDefaultVariables(NameSpace namespace) throws UtilEvalError { namespace.setVariable("view",null, false); namespace.setVariable("editPane",null, false); namespace.setVariable("buffer",null, false); namespace.setVariable("textArea",null, false); namespace.setVariable("wm",null, false); }
// in org/gjt/sp/jedit/JEditBeanShellAction.java
Override protected void setupDefaultVariables(NameSpace namespace, TextArea textArea) throws UtilEvalError { if(textArea != null) { setVariable(namespace, "buffer",textArea.getBuffer()); setVariable(namespace, "textArea",textArea); } }
// in org/gjt/sp/jedit/JEditBeanShellAction.java
Override protected void resetDefaultVariables(NameSpace namespace) throws UtilEvalError { namespace.setVariable("buffer",null, false); namespace.setVariable("textArea",null, false); }
(Lib) IllegalArgumentException 55
              
// in org/jedit/keymap/KeymapManagerImpl.java
Override public boolean copyKeymap(String name, String newName) { Log.log(Log.DEBUG, this, "copyKeymap(" + name + ',' + newName + ')'); File keymapFile = getUserKeymapFile(newName); if (keymapFile.exists()) throw new IllegalArgumentException("Keymap " + newName + " already exists"); File originalKeymap = getKeymapFile(name); if (!originalKeymap.isFile()) throw new IllegalArgumentException("Keymap " + name + " doesn't exist"); keymapFile.getParentFile().mkdirs(); BufferedInputStream in = null; BufferedOutputStream out = null; Log.log(Log.DEBUG, this, "Copying "+ originalKeymap.getAbsolutePath() + " to " + keymapFile.getAbsolutePath()); try { in = new BufferedInputStream(new FileInputStream(originalKeymap)); out = new BufferedOutputStream(new FileOutputStream(keymapFile)); IOUtilities.copyStream(null, in, out, false); return true; } catch (IOException e) { Log.log(Log.ERROR, this, e); } finally { IOUtilities.closeQuietly(in); IOUtilities.closeQuietly(out); } return false; }
// in org/gjt/sp/jedit/gui/ExtendedGridLayout.java
public void addLayoutComponent(Component component, Object constraints) { if (null == constraints) { constraints = new ExtendedGridLayoutConstraints(component); } if (constraints instanceof ExtendedGridLayoutConstraints) { ExtendedGridLayoutConstraints eglConstraints = (ExtendedGridLayoutConstraints)constraints; if (eglConstraints.isPlaceholder()) { throw new IllegalArgumentException("constraints must not be a placeholder"); } else if (component != eglConstraints.getComponent()) { throw new IllegalArgumentException("constraints is not the right one for this component"); } comptable.put(component,eglConstraints); } else { throw new IllegalArgumentException("constraints must not be an ExtendedGridLayoutConstraints object"); } }
// in org/gjt/sp/jedit/gui/ExtendedGridLayout.java
private Dimension getSize(Container parent, LayoutSize layoutSize, boolean fillRawSizes, Dimension gridSize, List<List<ExtendedGridLayoutConstraints>> gridRows, Set<ExtendedGridLayoutConstraints> colspans, Set<ExtendedGridLayoutConstraints> rowspans, int[][] resultArrays) { if (fillRawSizes && (resultArrays.length < 6)) { throw new IllegalArgumentException("If fillRawSizes is true, resultArrays.length must be >= 6 (" + resultArrays.length + ')'); } int[] minimumColWidths = new int[gridSize.width]; int[] minimumRowHeights = new int[gridSize.height]; int[] preferredColWidths = new int[gridSize.width]; int[] preferredRowHeights = new int[gridSize.height]; int[] maximumColWidths = new int[gridSize.width]; int[] maximumRowHeights = new int[gridSize.height]; Arrays.fill(minimumColWidths,0); Arrays.fill(minimumRowHeights,0); Arrays.fill(preferredColWidths,0); Arrays.fill(preferredRowHeights,0); Arrays.fill(maximumColWidths,0); Arrays.fill(maximumRowHeights,0); // get the maximum of the minimum sizes, // the maximum of the preferred sizes and // the minimum of the maximum sizes // of all rows and columns, not taking // rowspans and colspans into account for (int row=0 ; row<gridSize.height ; row++) { List<ExtendedGridLayoutConstraints> gridRow = gridRows.get(row); for (int col=0 ; col<gridSize.width ; col++) { ExtendedGridLayoutConstraints cell = gridRow.get(col); if ((null != cell) && (null != cell.getComponent())) { Component component = cell.getComponent(); Dimension minimumSize = component.getMinimumSize(); Dimension preferredSize = component.getPreferredSize(); Dimension maximumSize = component.getMaximumSize(); if (!colspans.contains(cell)) { minimumColWidths[col] = Math.max(minimumColWidths[col],minimumSize.width); preferredColWidths[col] = Math.max(preferredColWidths[col],preferredSize.width); maximumColWidths[col] = Math.max(maximumColWidths[col],maximumSize.width); } if (!rowspans.contains(cell)) { minimumRowHeights[row] = Math.max(minimumRowHeights[row],minimumSize.height); preferredRowHeights[row] = Math.max(preferredRowHeights[row],preferredSize.height); maximumRowHeights[row] = Math.max(maximumRowHeights[row],maximumSize.height); } } } } // correct cases where // minimumColWidths[col] <= preferredColWidths[col] <= maximumColWidths[col] // is not true by clipping to the minimumColWidths and maximumColWidths for (int col=0 ; col<gridSize.width ; col++) { if (minimumColWidths[col] >= maximumColWidths[col]) { maximumColWidths[col] = minimumColWidths[col]; preferredColWidths[col] = minimumColWidths[col]; } else if (preferredColWidths[col] < minimumColWidths[col]) { preferredColWidths[col] = minimumColWidths[col]; } else if (preferredColWidths[col] > maximumColWidths[col]) { preferredColWidths[col] = maximumColWidths[col]; } } // plug in the colspans and correct the minimum, preferred and // maximum column widths the colspans are part of for (ExtendedGridLayoutConstraints cell : colspans) { int fromCol = cell.getCol(); int colspan = cell.getEffectiveColspan(); int toCol = fromCol + colspan; int currentMinimumColWidth = 0; int currentPreferredColWidth = 0; int currentMaximumColWidth = 0; for (int col=fromCol ; col<toCol ; col++) { int minimumColWidth = minimumColWidths[col]; if ((Integer.MAX_VALUE-minimumColWidth) < currentMinimumColWidth) { currentMinimumColWidth = Integer.MAX_VALUE; } else { currentMinimumColWidth += minimumColWidth; } int preferredColWidth = preferredColWidths[col]; if ((Integer.MAX_VALUE-preferredColWidth) < currentPreferredColWidth) { currentPreferredColWidth = Integer.MAX_VALUE; } else { currentPreferredColWidth += preferredColWidth; } int maximumColWidth = maximumColWidths[col]; if ((Integer.MAX_VALUE-maximumColWidth) < currentMaximumColWidth) { currentMaximumColWidth = Integer.MAX_VALUE; } else { currentMaximumColWidth += maximumColWidth; } } Component component = cell.getComponent(); int wantedMaximumColWidth = component.getMaximumSize().width - ((colspan - 1) * hgap); if (currentMaximumColWidth < wantedMaximumColWidth) { redistributeSpace(currentMaximumColWidth, wantedMaximumColWidth, fromCol,toCol, maximumColWidths, maximumColWidths, maximumColWidths); } int wantedMinimumColWidth = component.getMinimumSize().width - ((colspan - 1) * hgap); if (currentMinimumColWidth < wantedMinimumColWidth) { redistributeSpace(currentMinimumColWidth, wantedMinimumColWidth, fromCol,toCol, minimumColWidths, minimumColWidths, maximumColWidths); } int wantedPreferredColWidth = component.getPreferredSize().width - ((colspan - 1) * hgap); if (currentPreferredColWidth < wantedPreferredColWidth) { redistributeSpace(currentPreferredColWidth, wantedPreferredColWidth, fromCol,toCol, preferredColWidths, minimumColWidths, maximumColWidths); } } // correct cases where // minimumColWidths[col] <= preferredColWidths[col] <= maximumColWidths[col] // is not true by clipping to the minimumColWidths and maximumColWidths for (int col=0 ; col<gridSize.width ; col++) { if (minimumColWidths[col] >= maximumColWidths[col]) { maximumColWidths[col] = minimumColWidths[col]; preferredColWidths[col] = minimumColWidths[col]; } else if (preferredColWidths[col] < minimumColWidths[col]) { preferredColWidths[col] = minimumColWidths[col]; } else if (preferredColWidths[col] > maximumColWidths[col]) { preferredColWidths[col] = maximumColWidths[col]; } } // correct cases where // minimumRowHeights[row] <= preferredRowHeights[row] <= maximumRowHeights[row] // is not true by clipping to the minimumRowHeights and maximumRowHeights for (int row=0 ; row<gridSize.height ; row++) { if (minimumRowHeights[row] >= maximumRowHeights[row]) { maximumRowHeights[row] = minimumRowHeights[row]; preferredRowHeights[row] = minimumRowHeights[row]; } else if (preferredRowHeights[row] < minimumRowHeights[row]) { preferredRowHeights[row] = minimumRowHeights[row]; } else if (preferredRowHeights[row] > maximumRowHeights[row]) { preferredRowHeights[row] = maximumRowHeights[row]; } } // plug in the rowspans and correct the minimum, preferred and // maximum row heights the rowspans are part of for (ExtendedGridLayoutConstraints cell : rowspans) { int fromRow = cell.getRow(); int rowspan = cell.getEffectiveRowspan(); int toRow = fromRow + rowspan; int currentMinimumRowHeight = 0; int currentPreferredRowHeight = 0; int currentMaximumRowHeight = 0; for (int row=fromRow ; row<toRow ; row++) { int minimumRowHeight = minimumRowHeights[row]; if ((Integer.MAX_VALUE-minimumRowHeight) < currentMinimumRowHeight) { currentMinimumRowHeight = Integer.MAX_VALUE; } else { currentMinimumRowHeight += minimumRowHeight; } int preferredRowHeight = preferredRowHeights[row]; if ((Integer.MAX_VALUE-preferredRowHeight) < currentPreferredRowHeight) { currentPreferredRowHeight = Integer.MAX_VALUE; } else { currentPreferredRowHeight += preferredRowHeight; } int maximumRowHeight = maximumRowHeights[row]; if ((Integer.MAX_VALUE-maximumRowHeight) < currentMaximumRowHeight) { currentMaximumRowHeight = Integer.MAX_VALUE; } else { currentMaximumRowHeight += maximumRowHeight; } } Component component = cell.getComponent(); int wantedMaximumRowHeight = component.getMaximumSize().height - ((rowspan - 1) * vgap); if (currentMaximumRowHeight < wantedMaximumRowHeight) { redistributeSpace(currentMaximumRowHeight, wantedMaximumRowHeight, fromRow,toRow, maximumRowHeights, maximumRowHeights, maximumRowHeights); } int wantedMinimumRowHeight = component.getMinimumSize().height - ((rowspan - 1) * vgap); if (currentMinimumRowHeight < wantedMinimumRowHeight) { redistributeSpace(currentMinimumRowHeight, wantedMinimumRowHeight, fromRow,toRow, minimumRowHeights, minimumRowHeights, maximumRowHeights); } int wantedPreferredRowHeight = component.getPreferredSize().height - ((rowspan - 1) * vgap); if (currentPreferredRowHeight < wantedPreferredRowHeight) { redistributeSpace(currentPreferredRowHeight, wantedPreferredRowHeight, fromRow,toRow, preferredRowHeights, minimumRowHeights, maximumRowHeights); } } // correct cases where // minimumRowHeights[row] <= preferredRowHeights[row] <= maximumRowHeights[row] // is not true by clipping to the minimumRowHeights and maximumRowHeights for (int row=0 ; row<gridSize.height ; row++) { if (minimumRowHeights[row] >= maximumRowHeights[row]) { maximumRowHeights[row] = minimumRowHeights[row]; preferredRowHeights[row] = minimumRowHeights[row]; } else if (preferredRowHeights[row] < minimumRowHeights[row]) { preferredRowHeights[row] = minimumRowHeights[row]; } else if (preferredRowHeights[row] > maximumRowHeights[row]) { preferredRowHeights[row] = maximumRowHeights[row]; } } // copies the computed sizes to the result arrays if (fillRawSizes) { resultArrays[0] = minimumColWidths; resultArrays[1] = minimumRowHeights; resultArrays[2] = preferredColWidths; resultArrays[3] = preferredRowHeights; resultArrays[4] = maximumColWidths; resultArrays[5] = maximumRowHeights; } // sums up the sizes for return value int[] colWidths; int[] rowHeights; switch (layoutSize) { case MINIMUM: colWidths = minimumColWidths; rowHeights = minimumRowHeights; break; case PREFERRED: colWidths = preferredColWidths; rowHeights = preferredRowHeights; break; case MAXIMUM: colWidths = maximumColWidths; rowHeights = maximumRowHeights; break; default: throw new InternalError("Missing case branch for LayoutSize: " + layoutSize); } long totalWidth = 0; long totalHeight = 0; for (int width : colWidths) { totalWidth += width; } for (int height : rowHeights) { totalHeight += height; } // add space between components or between // componetns and the borders of the parent container if (!fillRawSizes) { Insets insets = parent.getInsets(); totalWidth += insets.left + insets.right + ((gridSize.width - 1) * hgap) + distanceToBorders.left + distanceToBorders.right; totalHeight += insets.top + insets.bottom + ((gridSize.height - 1) * vgap) + distanceToBorders.top + distanceToBorders.bottom; } // clip the size to Integer.MAX_VALUE if too big if (totalWidth > Integer.MAX_VALUE) { totalWidth = Integer.MAX_VALUE; } if (totalHeight > Integer.MAX_VALUE) { totalHeight = Integer.MAX_VALUE; } return new Dimension((int)totalWidth,(int)totalHeight); }
// in org/gjt/sp/jedit/gui/KeyEventTranslator.java
public static void setModifierMapping(int c, int a, int m, int s) { int duplicateMapping = (c & a) | (c & m) | (c & s) | (a & m) | (a & s) | (m & s); if((duplicateMapping & InputEvent.CTRL_MASK) != 0) { throw new IllegalArgumentException( "CTRL is mapped to more than one modifier"); } if((duplicateMapping & InputEvent.ALT_MASK) != 0) { throw new IllegalArgumentException( "ALT is mapped to more than one modifier"); } if((duplicateMapping & InputEvent.META_MASK) != 0) { throw new IllegalArgumentException( "META is mapped to more than one modifier"); } if((duplicateMapping & InputEvent.SHIFT_MASK) != 0) { throw new IllegalArgumentException( "SHIFT is mapped to more than one modifier"); } KeyEventTranslator.c = c; KeyEventTranslator.a = a; KeyEventTranslator.m = m; KeyEventTranslator.s = s; }
// in org/gjt/sp/jedit/gui/FilteredListModel.java
public void setList(JList list) { if (list.getModel() != this) throw new IllegalArgumentException("The given list " + list + " doesn't use this model " + this); this.list = list; }
// in org/gjt/sp/jedit/gui/ExtendedGridLayoutConstraints.java
void setCol(int col) { if (col < 0) { throw new IllegalArgumentException("col must be non-negative (" + col + ')'); } this.col = col; }
// in org/gjt/sp/jedit/gui/FilteredTableModel.java
public void setTable(JTable table) { if (table.getModel() != this) throw new IllegalArgumentException("The given table " + table + " doesn't use this model " + this); this.table = table; }
// in org/gjt/sp/jedit/bsh/CollectionManager.java
protected Enumeration createEnumeration( Object iterateOverMe ) { if(iterateOverMe==null) throw new NullPointerException("Object arguments passed to " + "the BasicBshIterator constructor cannot be null."); if (iterateOverMe instanceof Enumeration) return (Enumeration)iterateOverMe; if (iterateOverMe instanceof Vector) return ((Vector)iterateOverMe).elements(); if (iterateOverMe.getClass().isArray()) { final Object array = iterateOverMe; return new Enumeration() { int index = 0, length = Array.getLength(array); public Object nextElement() { return Array.get(array, index++); } public boolean hasMoreElements() { return index<length; } }; } if (iterateOverMe instanceof String) return createEnumeration(((String)iterateOverMe).toCharArray()); if (iterateOverMe instanceof StringBuffer) return createEnumeration( iterateOverMe.toString().toCharArray()); if (iterateOverMe instanceof StringBuilder) return createEnumeration( iterateOverMe.toString().toCharArray()); throw new IllegalArgumentException( "Cannot enumerate object of type "+iterateOverMe.getClass()); }
// in org/gjt/sp/jedit/bsh/org/objectweb/asm/CodeWriter.java
public void visitJumpInsn (final int opcode, final Label label) { if (CHECK) { if (label.owner == null) { label.owner = this; } else if (label.owner != this) { throw new IllegalArgumentException(); } } if (computeMaxs) { if (opcode == Constants.GOTO) { // no stack change, but end of current block (with one new successor) if (currentBlock != null) { currentBlock.maxStackSize = maxStackSize; addSuccessor(stackSize, label); currentBlock = null; } } else if (opcode == Constants.JSR) { if (currentBlock != null) { addSuccessor(stackSize + 1, label); } } else { // updates current stack size (max stack size unchanged because stack // size variation always negative in this case) stackSize += SIZE[opcode]; if (currentBlock != null) { addSuccessor(stackSize, label); } } } // adds the instruction to the bytecode of the method if (label.resolved && label.position - code.length < Short.MIN_VALUE) { // case of a backward jump with an offset < -32768. In this case we // automatically replace GOTO with GOTO_W, JSR with JSR_W and IFxxx <l> // with IFNOTxxx <l'> GOTO_W <l>, where IFNOTxxx is the "opposite" opcode // of IFxxx (i.e., IFNE for IFEQ) and where <l'> designates the // instruction just after the GOTO_W. if (opcode == Constants.GOTO) { code.put1(200); // GOTO_W } else if (opcode == Constants.JSR) { code.put1(201); // JSR_W } else { code.put1(opcode <= 166 ? ((opcode + 1) ^ 1) - 1 : opcode ^ 1); code.put2(8); // jump offset code.put1(200); // GOTO_W } label.put(this, code, code.length - 1, true); } else { // case of a backward jump with an offset >= -32768, or of a forward jump // with, of course, an unknown offset. In these cases we store the offset // in 2 bytes (which will be increased in resizeInstructions, if needed). code.put1(opcode); label.put(this, code, code.length - 1, false); } }
// in org/gjt/sp/jedit/bsh/org/objectweb/asm/CodeWriter.java
public void visitLabel (final Label label) { if (CHECK) { if (label.owner == null) { label.owner = this; } else if (label.owner != this) { throw new IllegalArgumentException(); } } if (computeMaxs) { if (currentBlock != null) { // ends current block (with one new successor) currentBlock.maxStackSize = maxStackSize; addSuccessor(stackSize, label); } // begins a new current block, // resets the relative current and max stack sizes currentBlock = label; stackSize = 0; maxStackSize = 0; } // resolves previous forward references to label, if any resize |= label.resolve(this, code.length, code.data); }
// in org/gjt/sp/jedit/bsh/org/objectweb/asm/CodeWriter.java
public void visitTryCatchBlock ( final Label start, final Label end, final Label handler, final String type) { if (CHECK) { if (start.owner != this || end.owner != this || handler.owner != this) { throw new IllegalArgumentException(); } if (!start.resolved || !end.resolved || !handler.resolved) { throw new IllegalArgumentException(); } } if (computeMaxs) { // pushes handler block onto the stack of blocks to be visited if (!handler.pushed) { handler.beginStackSize = 1; handler.pushed = true; handler.next = blockStack; blockStack = handler; } } ++catchCount; if (catchTable == null) { catchTable = new ByteVector(); } catchTable.put2(start.position); catchTable.put2(end.position); catchTable.put2(handler.position); catchTable.put2(type != null ? cw.newClass(type).index : 0); }
// in org/gjt/sp/jedit/bsh/org/objectweb/asm/CodeWriter.java
public void visitLocalVariable ( final String name, final String desc, final Label start, final Label end, final int index) { if (CHECK) { if (start.owner != this || !start.resolved) { throw new IllegalArgumentException(); } if (end.owner != this || !end.resolved) { throw new IllegalArgumentException(); } } if (localVar == null) { cw.newUTF8("LocalVariableTable"); localVar = new ByteVector(); } ++localVarCount; localVar.put2(start.position); localVar.put2(end.position - start.position); localVar.put2(cw.newUTF8(name).index); localVar.put2(cw.newUTF8(desc).index); localVar.put2(index); }
// in org/gjt/sp/jedit/bsh/org/objectweb/asm/CodeWriter.java
public void visitLineNumber (final int line, final Label start) { if (CHECK) { if (start.owner != this || !start.resolved) { throw new IllegalArgumentException(); } } if (lineNumber == null) { cw.newUTF8("LineNumberTable"); lineNumber = new ByteVector(); } ++lineNumberCount; lineNumber.put2(start.position); lineNumber.put2(line); }
// in org/gjt/sp/jedit/bsh/org/objectweb/asm/ClassWriter.java
Item newCst (final Object cst) { if (cst instanceof Integer) { int val = ((Integer)cst).intValue(); return newInteger(val); } else if (cst instanceof Float) { float val = ((Float)cst).floatValue(); return newFloat(val); } else if (cst instanceof Long) { long val = ((Long)cst).longValue(); return newLong(val); } else if (cst instanceof Double) { double val = ((Double)cst).doubleValue(); return newDouble(val); } else if (cst instanceof String) { return newString((String)cst); } else { throw new IllegalArgumentException("value " + cst); } }
// in org/gjt/sp/jedit/bsh/org/objectweb/asm/Label.java
void put ( final CodeWriter owner, final ByteVector out, final int source, final boolean wideOffset) { if (CodeWriter.CHECK) { if (this.owner == null) { this.owner = owner; } else if (this.owner != owner) { throw new IllegalArgumentException(); } } if (resolved) { if (wideOffset) { out.put4(position - source); } else { out.put2(position - source); } } else { if (wideOffset) { addReference(-1 - source, out.length); out.put4(-1); } else { addReference(source, out.length); out.put2(-1); } } }
// in org/gjt/sp/jedit/bsh/org/objectweb/asm/Label.java
boolean resolve ( final CodeWriter owner, final int position, final byte[] data) { if (CodeWriter.CHECK) { if (this.owner == null) { this.owner = owner; } if (resolved || this.owner != owner) { throw new IllegalArgumentException(); } } boolean needUpdate = false; this.resolved = true; this.position = position; int i = 0; while (i < referenceCount) { int source = srcAndRefPositions[i++]; int reference = srcAndRefPositions[i++]; int offset; if (source >= 0) { offset = position - source; if (offset < Short.MIN_VALUE || offset > Short.MAX_VALUE) { // changes the opcode of the jump instruction, in order to be able to // find it later (see resizeInstructions in CodeWriter). These // temporary opcodes are similar to jump instruction opcodes, except // that the 2 bytes offset is unsigned (and can therefore represent // values from 0 to 65535, which is sufficient since the size of a // method is limited to 65535 bytes). int opcode = data[reference - 1] & 0xFF; if (opcode <= Constants.JSR) { // changes IFEQ ... JSR to opcodes 202 to 217 (inclusive) data[reference - 1] = (byte)(opcode + 49); } else { // changes IFNULL and IFNONNULL to opcodes 218 and 219 (inclusive) data[reference - 1] = (byte)(opcode + 20); } needUpdate = true; } data[reference++] = (byte)(offset >>> 8); data[reference] = (byte)offset; } else { offset = position + source + 1; data[reference++] = (byte)(offset >>> 24); data[reference++] = (byte)(offset >>> 16); data[reference++] = (byte)(offset >>> 8); data[reference] = (byte)offset; } } return needUpdate; }
// in org/gjt/sp/jedit/bsh/org/objectweb/asm/ByteVector.java
public ByteVector putUTF (final String s) { int charLength = s.length(); int byteLength = 0; for (int i = 0; i < charLength; ++i) { char c = s.charAt(i); if (c >= '\001' && c <= '\177') { byteLength++; } else if (c > '\u07FF') { byteLength += 3; } else { byteLength += 2; } } if (byteLength > 65535) { throw new IllegalArgumentException(); } int length = this.length; if (length + 2 + byteLength > data.length) { enlarge(2 + byteLength); } byte[] data = this.data; data[length++] = (byte)(byteLength >>> 8); data[length++] = (byte)(byteLength); for (int i = 0; i < charLength; ++i) { char c = s.charAt(i); if (c >= '\001' && c <= '\177') { data[length++] = (byte)c; } else if (c > '\u07FF') { data[length++] = (byte)(0xE0 | c >> 12 & 0xF); data[length++] = (byte)(0x80 | c >> 6 & 0x3F); data[length++] = (byte)(0x80 | c & 0x3F); } else { data[length++] = (byte)(0xC0 | c >> 6 & 0x1F); data[length++] = (byte)(0x80 | c & 0x3F); } } this.length = length; return this; }
// in org/gjt/sp/jedit/bsh/collection/CollectionIterator.java
protected Iterator createIterator(Object iterateOverMe) { if (iterateOverMe==null) throw new NullPointerException("Object arguments passed to " + "the CollectionIterator constructor cannot be null."); if (iterateOverMe instanceof Iterator) return (Iterator)iterateOverMe; if (iterateOverMe instanceof Collection) return ((Collection)iterateOverMe).iterator(); /* Should we be able to iterate over maps? if (iterateOverMe instanceof Map) return ((Map)iterateOverMe).entrySet().iterator(); */ throw new IllegalArgumentException( "Cannot enumerate object of type "+iterateOverMe.getClass()); }
// in org/gjt/sp/jedit/io/VFSFile.java
public String getExtendedAttribute(String name) { if(name.equals(VFS.EA_TYPE)) { switch(getType()) { case FILE: return jEdit.getProperty("vfs.browser.type.file"); case DIRECTORY: return jEdit.getProperty("vfs.browser.type.directory"); case FILESYSTEM: return jEdit.getProperty("vfs.browser.type.filesystem"); default: throw new IllegalArgumentException(); } } else if(name.equals(VFS.EA_STATUS)) { if(isReadable()) { if(isWriteable()) return jEdit.getProperty("vfs.browser.status.rw"); else return jEdit.getProperty("vfs.browser.status.ro"); } else { if(isWriteable()) return jEdit.getProperty("vfs.browser.status.append"); else return jEdit.getProperty("vfs.browser.status.no"); } } else if(name.equals(VFS.EA_SIZE)) { if(getType() != FILE) return null; else return StandardUtilities.formatFileSize(getLength()); } else return null; }
// in org/gjt/sp/jedit/search/HyperSearchResults.java
private void goToSelectedNode(int mode) { TreePath path = resultTree.getSelectionPath(); if(path == null) return; DefaultMutableTreeNode node = (DefaultMutableTreeNode)path .getLastPathComponent(); Object value = node.getUserObject(); // do nothing if clicked "foo (showing n occurrences in m files)" if(node.getParent() != resultTreeRoot && value instanceof HyperSearchNode) { HyperSearchNode n = (HyperSearchNode)value; Buffer buffer = n.getBuffer(view); if(buffer == null) return; EditPane pane; switch(mode) { case M_OPEN: pane = view.goToBuffer(buffer); break; case M_OPEN_NEW_VIEW: pane = jEdit.newView(view,buffer,false).getEditPane(); break; case M_OPEN_NEW_PLAIN_VIEW: pane = jEdit.newView(view,buffer,true).getEditPane(); break; case M_OPEN_NEW_SPLIT: pane = view.splitHorizontally(); break; default: throw new IllegalArgumentException("Bad mode: " + mode); } n.goTo(pane); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public void getLineText(int line,int relativeStartOffset, Segment segment) { if(line < 0 || line >= lineMgr.getLineCount()) throw new ArrayIndexOutOfBoundsException(line); try { readLock(); int start = (line == 0 ? 0 : lineMgr.getLineEndOffset(line - 1)); int end = lineMgr.getLineEndOffset(line); if((start+relativeStartOffset)>end) { throw new IllegalArgumentException("This index is outside the line length (start+relativeOffset):"+start+" + "+relativeStartOffset+" > "+"endffset:"+end); } else { getText(start+relativeStartOffset,end - start -relativeStartOffset- 1,segment); } } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public void updateColumnBlocks(int startLine,int endLine,int startColumn, Node parent) { if (parent != null && startLine >= 0 && endLine >= 0 && startLine <= endLine) { int currentLine = startLine; int colBlockWidth=0; Vector<ColumnBlockLine> columnBlockLines = new Vector<ColumnBlockLine>(); //while(currentLine<=endLine) ColumnBlock parentColumnBlock = (ColumnBlock) parent; for(int ik=startLine- parentColumnBlock.getStartLine();currentLine<=endLine;ik++) { Segment seg = new Segment(); int actualStart = startColumn; if(!parentColumnBlock.getLines().isEmpty()) { ColumnBlockLine line = parentColumnBlock.getLines().elementAt(ik); if(currentLine!=line.getLine()) { throw new IllegalArgumentException(); } actualStart = line.getColumnEndIndex()+1; } getLineText(currentLine, actualStart, seg); int tabPos = getTabStopPosition(seg); if(tabPos>=0) { columnBlockLines.add(new ColumnBlockLine(currentLine, actualStart, actualStart+tabPos)); if(tabPos>colBlockWidth) { colBlockWidth = tabPos; } } if (tabPos < 0 && !columnBlockLines.isEmpty() || !columnBlockLines.isEmpty() && currentLine == endLine) { ColumnBlock block = new ColumnBlock(this, columnBlockLines.elementAt(0).getLine(), startColumn+colBlockWidth, columnBlockLines.elementAt(columnBlockLines.size()-1).getLine(), startColumn+colBlockWidth); block.setLines(columnBlockLines); block.setParent(parent); block.setWidth(colBlockWidth); block.setTabSizeDirtyStatus(true,false); //block.populateTabSizes(); parent.addChild(block); colBlockWidth=0; columnBlockLines = new Vector<ColumnBlockLine>(); updateColumnBlocks(block.getStartLine(), block.getEndLine(), startColumn+block.getColumnWidth()+1, block); } currentLine++; } } else { throw new IllegalArgumentException(); } }
// in org/gjt/sp/jedit/textarea/ElasticTabstopsTabExpander.java
Override public float nextTabStop(float x, int tabOffset) { float _tabSize = 0; if(textArea.buffer.getBooleanProperty("elasticTabstops")&&textArea.buffer.getColumnBlock()!=null) { int line = textArea.buffer.getLineOfOffset(tabOffset); _tabSize = getTabSize(textArea.buffer.getColumnBlock().getColumnBlock(line, tabOffset),line); if(_tabSize<0) { throw new IllegalArgumentException("Unaccounted tab at line "+textArea.buffer.getLineOfOffset(tabOffset)+" at index "+tabOffset); } } //keep minimum tab size of textArea.tabSize _tabSize+= textArea.tabSize; return (x+_tabSize); }
// in org/gjt/sp/jedit/textarea/ColumnBlock.java
Override //{{{ addChild() method public void addChild(Node node) { // must add the children in sorted order ColumnBlock block = (ColumnBlock) node; ColumnBlock blockBelow = searchChildren(block.startLine); if (blockBelow != null) { if (blockBelow.isLineWithinThisBlock(block.endLine) >= 0) { throw new IllegalArgumentException("Overlapping column blocks: " + block + " \n&\n" + blockBelow); } int index = children.indexOf(blockBelow); children.add(index, node); } else { children.add(node); } }
// in org/gjt/sp/jedit/textarea/ColumnBlock.java
private void throwException(int offset, int line) { throw new IllegalArgumentException("{ELSTIC TABSTOP}CORRUPT DATA@{" + System.currentTimeMillis() + "} & Thread : " + Thread.currentThread().getName() + " :Cannot find the size for tab at offset " + (offset - buffer.getLineStartOffset(line)) + "in line " + line + "while searching in \n " + this); }
// in org/gjt/sp/jedit/textarea/TextArea.java
public void moveCaretPosition(int newCaret, int scrollMode) { if(newCaret < 0 || newCaret > buffer.getLength()) { throw new IllegalArgumentException("caret out of bounds: " + newCaret); } int oldCaretLine = caretLine; if(caret == newCaret) finishCaretUpdate(oldCaretLine,scrollMode,false); else { caret = getCharacterBoundaryAt(newCaret); caretLine = getLineOfOffset(caret); magicCaret = -1; finishCaretUpdate(oldCaretLine,scrollMode,true); } }
// in org/gjt/sp/jedit/textarea/TextArea.java
Override public char setIndex(int position) { if (0 <= position && position <= sequence.length()) { index = position; return current(); } else { // There should be a bug in caller. // Stacktrace will be enough. throw new IllegalArgumentException(); } }
// in org/gjt/sp/jedit/textarea/ElasticTabStopBufferListener.java
public void contentRemoved(JEditBuffer buffer, int startLine, int offset, int numLines, int length) { if(!buffer.getBooleanProperty("elasticTabstops")) { return; } String charDeleted; boolean isASimpleChar = false; ColumnBlock rootBlock = buffer.getColumnBlock(); if(rootBlock==null) { return; } if((numLines==0)&(length==1)) { isASimpleChar = true; } if((!isASimpleChar)) { //we need to remove column blocks //find the column block lying just below the first line deleted ColumnBlock firstBlockEffected = rootBlock.searchChildren(startLine); //info we need to determine inside this if block int startLineToBuild = -1; int endLineToBuild = -1; ColumnBlock firstBlockToBeUpdated = null; ColumnBlock firstBlockToBeRemoved = null; ColumnBlock lastBlockToBeRemoved = null; if(firstBlockEffected!=null) { int indexFirstBlockEffected =rootBlock.getChildren().indexOf(firstBlockEffected); ColumnBlock blockAboveFirstEffected = null; boolean justBelowBlock = false; if(indexFirstBlockEffected>0) { blockAboveFirstEffected = (ColumnBlock)rootBlock.getChildren().get(indexFirstBlockEffected-1); if(blockAboveFirstEffected.endLine==startLine-1 ) { justBelowBlock = true; } } int posFirstLine = firstBlockEffected.isLineWithinThisBlock(startLine); boolean firstLineLiesInside =posFirstLine==0; boolean firstLineLiesAbove =posFirstLine<0; int posLastLine = firstBlockEffected.isLineWithinThisBlock(startLine+numLines); boolean lastLineLiesInside =posLastLine==0; boolean lastLineLiesAbove = posLastLine<0; boolean lastLineLiesBelow = posLastLine>0; //deletion above block if(lastLineLiesAbove ) { //if last line lies above this block cannot be connected to a block above in this deletion without touching the block above /*if(justBelowBlock&&startLine+numLines+1==firstBlockEffected.startLine) { startLineToBuild=blockAboveFirstEffected.startLine; endLineToBuild= firstBlockEffected.endLine; firstBlockToBeRemoved = blockAboveFirstEffected; lastBlockToBeRemoved = firstBlockEffected; }*/ firstBlockToBeUpdated = firstBlockEffected; //else //{ firstBlockToBeRemoved =lastBlockToBeRemoved= null; startLineToBuild=endLineToBuild=-1; //} } //deletion inside block else if((firstLineLiesInside||firstLineLiesAbove)&&lastLineLiesInside) { startLineToBuild = Math.min( firstBlockEffected.startLine,startLine); endLineToBuild = firstBlockEffected.endLine-numLines; //if(indexFirstBlockEffected<rootBlock.getChildren().size()-1) //{ //firstBlockToBeUpdated =(ColumnBlock)rootBlock.getChildren().get(indexFirstBlockEffected+1) ; //} firstBlockToBeRemoved =lastBlockToBeRemoved= firstBlockEffected; if(justBelowBlock) { startLineToBuild =blockAboveFirstEffected.startLine ; firstBlockToBeRemoved = blockAboveFirstEffected; } } //deletion might cover other blocks as well else if(((firstLineLiesInside)||(firstLineLiesAbove))&&lastLineLiesBelow) { startLineToBuild = Math.min(startLine, firstBlockEffected.startLine); firstBlockToBeRemoved = firstBlockEffected; ColumnBlock blockBelow = rootBlock.searchChildren(startLine+numLines); int indexLastBlock = rootBlock.getChildren().indexOf(blockBelow); if(blockBelow!=null) { //deletion partially overlaps this block if(blockBelow.isLineWithinThisBlock(startLine+numLines)==0) { if(justBelowBlock) { startLineToBuild =blockAboveFirstEffected.startLine ; firstBlockToBeRemoved = blockAboveFirstEffected; } lastBlockToBeRemoved = blockBelow; endLineToBuild = blockBelow.endLine-numLines; //if(indexLastBlock<rootBlock.getChildren().size()-1) //{ //firstBlockToBeUpdated = (ColumnBlock)rootBlock.getChildren().get(indexLastBlock+1); //} } //deletion lies above this block else { //do not need to consider blockJustAbove here as we cannot connect two column blocks without //ending on one of the lines of either //firstBlockToBeUpdated = blockBelow; //if we have reached here there is surely a block above this one lastBlockToBeRemoved = (ColumnBlock)rootBlock.getChildren().get(indexLastBlock-1); //if the first Block is wholly covered then all column blocks are being deleted completely and there is nothing to build endLineToBuild = firstLineLiesAbove?-1:startLine; //consider the case where last line deleted is just above the column block block below if((blockBelow.startLine==startLine+numLines+1)&&(endLineToBuild!=-1)) { endLineToBuild = blockBelow.endLine-numLines; lastBlockToBeRemoved = blockBelow; } if(endLineToBuild==-1) { startLineToBuild = -1; } } } //no block below last line else { lastBlockToBeRemoved = (ColumnBlock)rootBlock.getChildren().get(rootBlock.getChildren().size()-1); //firstBlockToBeUpdated = null; if(firstLineLiesInside) { endLineToBuild = startLine; } else { startLineToBuild = -1; endLineToBuild= -1; } } } } //deletion lies below all column blocks else { startLineToBuild = -1; endLineToBuild = -1; //firstBlockToBeUpdated = null; firstBlockToBeRemoved = null; lastBlockToBeRemoved = null; } //once we reach here we have three things to do //1)delete columnBlocks using firstBlockToBeDeleted and lastBlockToBeDeleted Vector blocksToBeRemoved =null; if(firstBlockToBeRemoved!=null) { int startIndex = rootBlock.getChildren().indexOf(firstBlockToBeRemoved); blocksToBeRemoved = new Vector(); if(lastBlockToBeRemoved==null) { throw new IllegalArgumentException("Deletion not handled properly"); } int endIndex = rootBlock.getChildren().indexOf(lastBlockToBeRemoved); for(int i=startIndex;i<=endIndex;i++) { blocksToBeRemoved.add(rootBlock.getChildren().get(i)); } } //2)update startLine/endLine in column blocks using firstBlockToBeUpdated if(numLines>0) { rootBlock.endLine-=numLines; if((lastBlockToBeRemoved!=null)||(firstBlockToBeUpdated!=null)) { int startIndex=-1; if(lastBlockToBeRemoved!=null) { startIndex = rootBlock.getChildren().indexOf(lastBlockToBeRemoved); //start just after the last block to be removed startIndex++; } else if(firstBlockToBeUpdated!=null) { startIndex = rootBlock.getChildren().indexOf(firstBlockToBeUpdated); } for(int i=startIndex;i<rootBlock.getChildren().size();i++) { ((ColumnBlock)rootBlock.getChildren().get(i)).updateLineNo(-1*numLines); } } } //once we are done with (2) we can safely change rootBlock if(blocksToBeRemoved!=null) { rootBlock.getChildren().removeAll(blocksToBeRemoved); } //3)rebuild column blocks using endLine and startLine if(startLineToBuild!=-1&&endLineToBuild!=-1) { buffer.updateColumnBlocks(startLineToBuild, endLineToBuild, 0, rootBlock); rootBlock.setDirtyStatus(false); textArea.chunkCache.invalidateChunksFromPhys(startLineToBuild); textArea.invalidateLineRange(startLineToBuild, endLineToBuild); } rootBlock.setDirtyStatus(false); handledDeletion = true; } else { int startingLine = -1; int endLine = -1; //a simple char has been entered //if this lies inside a column block update the startIndex and endIndex of this blocks corresponding ColumnBlockLine //and all subsequent ColumnBlock Lines after this one //check whether columnBlockWidth is valid ColumnBlock innerContainingBlock = rootBlock.getContainingBlock(startLine, offset); //do nothing if this char does not lie inside a column block if(innerContainingBlock!=null) { if(!singleTabDeleted) { innerContainingBlock.updateColumnBlockLineOffset(startLine, -1*length, false); ColumnBlockLine containingLine = innerContainingBlock.getLines().elementAt(startLine-innerContainingBlock.startLine); startingLine = innerContainingBlock.startLine; endLine = innerContainingBlock.endLine; innerContainingBlock.setTabSizeDirtyStatus(true,false); } else { //no need to update line offset as ColumnBlock would be rebuilt ColumnBlock innerParent = (ColumnBlock)innerContainingBlock.getParent(); startingLine = innerContainingBlock.startLine; endLine = innerContainingBlock.endLine; innerParent.getChildren().remove(innerContainingBlock); //startingLine = innerParent.startLine; //endLine = innerParent.endLine; //innerParent.getChildren().removeAllElements(); buffer.updateColumnBlocks(startingLine, endLine,(int)innerParent.columnBlockWidth , innerParent); } } else { //this line must have been retokenized and repainted by the BufferHandler so repaint it again here after column blocks dirty status is updated startingLine = startLine; endLine = startLine; } handledDeletion = true; rootBlock.setDirtyStatus(false); if(startingLine!=-1&&endLine!=-1) { textArea.chunkCache.invalidateChunksFromPhys(startingLine); textArea.invalidateLineRange(startingLine, endLine); } } }
// in org/gjt/sp/jedit/textarea/SelectionManager.java
void addToSelection(Selection addMe) { if(addMe.start > addMe.end) { throw new IllegalArgumentException(addMe.start + " > " + addMe.end); } else if(addMe.start == addMe.end) { if(addMe instanceof Selection.Range) return; else if(addMe instanceof Selection.Rect) { if(((Selection.Rect)addMe).extraEndVirt == 0) return; } } Iterator<Selection> iter = selection.iterator(); while(iter.hasNext()) { // try and merge existing selections one by // one with the new selection Selection s = iter.next(); if(s.overlaps(addMe)) { addMe.start = Math.min(s.start,addMe.start); addMe.end = Math.max(s.end,addMe.end); iter.remove(); } } addMe.startLine = textArea.getLineOfOffset(addMe.start); addMe.endLine = textArea.getLineOfOffset(addMe.end); boolean added = false; for(int i = 0; i < selection.size(); i++) { Selection s = selection.get(i); if(addMe.start < s.start) { selection.add(i,addMe); added = true; break; } } if(!added) selection.add(addMe); textArea.invalidateLineRange(addMe.startLine,addMe.endLine); }
// in org/gjt/sp/jedit/browser/VFSBrowser.java
public void paste(VFSFile file) throws IOException, UnsupportedFlavorException { if (file == null) throw new IllegalArgumentException("file cannot be null"); String targetPath = null; switch (file.getType()) { case VFSFile.FILESYSTEM: return; case VFSFile.FILE: targetPath = MiscUtilities.getParentOfPath(file.getPath()); break; case VFSFile.DIRECTORY: targetPath = file.getPath(); break; } VFS vfs = VFSManager.getVFSForPath(targetPath); Object vfsSession = null; try { vfsSession = vfs.createVFSSession(targetPath, this); if (vfsSession == null) { Log.log(Log.ERROR, this, "Unable to create session for " + targetPath); return; } Transferable transferable = Registers.getRegister('$').getTransferable(); List<String> sources = new ArrayList<String>(); if (transferable.isDataFlavorSupported(ListVFSFileTransferable.jEditFileList)) { Iterable<VFSFile> copiedFiles = (Iterable<VFSFile>) transferable.getTransferData(ListVFSFileTransferable.jEditFileList); for (VFSFile copiedFile : copiedFiles) { sources.add(copiedFile.getPath()); } } else if (transferable.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { Iterable<File> copiedFiles = (Iterable<File>) transferable.getTransferData(DataFlavor.javaFileListFlavor); for (File copiedFile : copiedFiles) { sources.add(copiedFile.getAbsolutePath()); } } CopyFileWorker worker = new CopyFileWorker(this, sources, targetPath); ThreadUtilities.runInBackground(worker); } finally { vfs._endVFSSession(vfsSession, this); } }
// in org/gjt/sp/jedit/PluginJAR.java
private static PluginDepends getPluginDepends(String dep) throws IllegalArgumentException { boolean optional; if(dep.startsWith("optional ")) { optional = true; dep = dep.substring("optional ".length()); } else { optional = false; } int index = dep.indexOf(' '); if(index == -1) throw new IllegalArgumentException("wrong dependency"); String what = dep.substring(0,index); String arg = dep.substring(index + 1); PluginDepends depends = new PluginDepends(); depends.what = what; depends.arg = arg; depends.optional = optional; return depends; }
// in org/gjt/sp/util/Log.java
private static String urgencyToString(int urgency) { switch(urgency) { case DEBUG: return "debug"; case MESSAGE: return "message"; case NOTICE: return "notice"; case WARNING: return "warning"; case ERROR: return "error"; } throw new IllegalArgumentException("Invalid urgency: " + urgency); }
// in org/gjt/sp/util/SyntaxUtilities.java
public static SyntaxStyle parseStyle(String str, String family, int size, boolean color, Color defaultFgColor) throws IllegalArgumentException { Color fgColor = defaultFgColor; Color bgColor = null; boolean italic = false; boolean bold = false; StringTokenizer st = new StringTokenizer(str); while(st.hasMoreTokens()) { String s = st.nextToken(); if(s.startsWith("color:")) { if(color) fgColor = parseColor(s.substring(6), Color.black); } else if(s.startsWith("bgColor:")) { if(color) bgColor = parseColor(s.substring(8), null); } else if(s.startsWith("style:")) { for(int i = 6; i < s.length(); i++) { if(s.charAt(i) == 'i') italic = true; else if(s.charAt(i) == 'b') bold = true; else throw new IllegalArgumentException( "Invalid style: " + s); } } else throw new IllegalArgumentException( "Invalid directive: " + s); } return new SyntaxStyle(fgColor,bgColor, new Font(family, (italic ? Font.ITALIC : 0) | (bold ? Font.BOLD : 0), size)); }
0 6
              
// in org/gjt/sp/jedit/bsh/CollectionManager.java
public BshIterator getBshIterator( Object obj ) throws IllegalArgumentException { return new BasicBshIterator( obj ); }
// in org/gjt/sp/jedit/bsh/collection/CollectionManagerImpl.java
public BshIterator getBshIterator( Object obj ) throws IllegalArgumentException { if ( obj instanceof Collection || obj instanceof Iterator ) return new CollectionIterator( obj ); else return new org.gjt.sp.jedit.bsh.CollectionManager.BasicBshIterator( obj ); }
// in org/gjt/sp/jedit/GUIUtilities.java
public static SyntaxStyle parseStyle(String str, String family, int size) throws IllegalArgumentException { return SyntaxUtilities.parseStyle(str,family,size,true); }
// in org/gjt/sp/jedit/PluginJAR.java
private static PluginDepends getPluginDepends(String dep) throws IllegalArgumentException { boolean optional; if(dep.startsWith("optional ")) { optional = true; dep = dep.substring("optional ".length()); } else { optional = false; } int index = dep.indexOf(' '); if(index == -1) throw new IllegalArgumentException("wrong dependency"); String what = dep.substring(0,index); String arg = dep.substring(index + 1); PluginDepends depends = new PluginDepends(); depends.what = what; depends.arg = arg; depends.optional = optional; return depends; }
// in org/gjt/sp/util/SyntaxUtilities.java
public static SyntaxStyle parseStyle(String str, String family, int size, boolean color, Color defaultFgColor) throws IllegalArgumentException { Color fgColor = defaultFgColor; Color bgColor = null; boolean italic = false; boolean bold = false; StringTokenizer st = new StringTokenizer(str); while(st.hasMoreTokens()) { String s = st.nextToken(); if(s.startsWith("color:")) { if(color) fgColor = parseColor(s.substring(6), Color.black); } else if(s.startsWith("bgColor:")) { if(color) bgColor = parseColor(s.substring(8), null); } else if(s.startsWith("style:")) { for(int i = 6; i < s.length(); i++) { if(s.charAt(i) == 'i') italic = true; else if(s.charAt(i) == 'b') bold = true; else throw new IllegalArgumentException( "Invalid style: " + s); } } else throw new IllegalArgumentException( "Invalid directive: " + s); } return new SyntaxStyle(fgColor,bgColor, new Font(family, (italic ? Font.ITALIC : 0) | (bold ? Font.BOLD : 0), size)); }
// in org/gjt/sp/util/SyntaxUtilities.java
public static SyntaxStyle parseStyle(String str, String family, int size, boolean color) throws IllegalArgumentException { return parseStyle(str, family, size, color, Color.black); }
(Domain) ParseException 43
              
// in org/gjt/sp/jedit/bsh/Parser.java
final public boolean Line() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 0: jj_consume_token(0); Interpreter.debug("End of File!"); {if (true) return true;} break; default: if (jj_2_1(1)) { BlockStatement(); {if (true) return false;} } else { jj_consume_token(-1); throw new ParseException(); } } throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public Modifiers Modifiers(int context, boolean lookahead) throws ParseException { Modifiers mods = null; label_1: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ABSTRACT: case FINAL: case NATIVE: case PRIVATE: case PROTECTED: case PUBLIC: case STATIC: case STRICTFP: case SYNCHRONIZED: case TRANSIENT: case VOLATILE: ; break; default: break label_1; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PRIVATE: jj_consume_token(PRIVATE); break; case PROTECTED: jj_consume_token(PROTECTED); break; case PUBLIC: jj_consume_token(PUBLIC); break; case SYNCHRONIZED: jj_consume_token(SYNCHRONIZED); break; case FINAL: jj_consume_token(FINAL); break; case NATIVE: jj_consume_token(NATIVE); break; case TRANSIENT: jj_consume_token(TRANSIENT); break; case VOLATILE: jj_consume_token(VOLATILE); break; case ABSTRACT: jj_consume_token(ABSTRACT); break; case STATIC: jj_consume_token(STATIC); break; case STRICTFP: jj_consume_token(STRICTFP); break; default: jj_consume_token(-1); throw new ParseException(); } if ( !lookahead ) try { if ( mods == null ) mods = new Modifiers(); mods.addModifier( context, getToken(0).image ); } catch ( IllegalStateException e ) { {if (true) throw createParseException( e.getMessage() );} } } {if (true) return mods;} throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ClassDeclaration() throws ParseException { /*@bgen(jjtree) ClassDeclaration */ BSHClassDeclaration jjtn000 = new BSHClassDeclaration(JJTCLASSDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Modifiers mods; Token name; int numInterfaces; try { mods = Modifiers(Modifiers.CLASS, false); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case CLASS: jj_consume_token(CLASS); break; case INTERFACE: jj_consume_token(INTERFACE); jjtn000.isInterface=true; break; default: jj_consume_token(-1); throw new ParseException(); } name = jj_consume_token(IDENTIFIER); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case EXTENDS: jj_consume_token(EXTENDS); AmbiguousName(); jjtn000.extend = true; break; default: ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IMPLEMENTS: jj_consume_token(IMPLEMENTS); numInterfaces = NameList(); jjtn000.numInterfaces=numInterfaces; break; default: ; } Block(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.modifiers = mods; jjtn000.name = name.image; } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void MethodDeclaration() throws ParseException { /*@bgen(jjtree) MethodDeclaration */ BSHMethodDeclaration jjtn000 = new BSHMethodDeclaration(JJTMETHODDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t = null; Modifiers mods; int count; try { mods = Modifiers(Modifiers.METHOD, false); jjtn000.modifiers = mods; if (jj_2_2(2147483647)) { t = jj_consume_token(IDENTIFIER); jjtn000.name = t.image; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case SHORT: case VOID: case IDENTIFIER: ReturnType(); t = jj_consume_token(IDENTIFIER); jjtn000.name = t.image; break; default: jj_consume_token(-1); throw new ParseException(); } } FormalParameters(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case THROWS: jj_consume_token(THROWS); count = NameList(); jjtn000.numThrows=count; break; default: ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: Block(); break; case SEMICOLON: jj_consume_token(SEMICOLON); break; default: jj_consume_token(-1); throw new ParseException(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ImportDeclaration() throws ParseException { /*@bgen(jjtree) ImportDeclaration */ BSHImportDeclaration jjtn000 = new BSHImportDeclaration(JJTIMPORTDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token s = null; Token t = null; try { if (jj_2_3(3)) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STATIC: s = jj_consume_token(STATIC); break; default: ; } jj_consume_token(IMPORT); AmbiguousName(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case DOT: t = jj_consume_token(DOT); jj_consume_token(STAR); break; default: ; } jj_consume_token(SEMICOLON); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); if ( s != null ) jjtn000.staticImport = true; if ( t != null ) jjtn000.importPackage = true; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IMPORT: jj_consume_token(IMPORT); jj_consume_token(STAR); jj_consume_token(SEMICOLON); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.superImport = true; break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void VariableInitializer() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: ArrayInitializer(); break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: Expression(); break; default: jj_consume_token(-1); throw new ParseException(); } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void FormalParameter() throws ParseException { /*@bgen(jjtree) FormalParameter */ BSHFormalParameter jjtn000 = new BSHFormalParameter(JJTFORMALPARAMETER); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t; try { if (jj_2_5(2)) { Type(); t = jj_consume_token(IDENTIFIER); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.name = t.image; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENTIFIER: t = jj_consume_token(IDENTIFIER); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.name = t.image; break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Type() throws ParseException { /*@bgen(jjtree) Type */ BSHType jjtn000 = new BSHType(JJTTYPE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case SHORT: PrimitiveType(); break; case IDENTIFIER: AmbiguousName(); break; default: jj_consume_token(-1); throw new ParseException(); } label_4: while (true) { if (jj_2_6(2)) { ; } else { break label_4; } jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); jjtn000.addArrayDimension(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ReturnType() throws ParseException { /*@bgen(jjtree) ReturnType */ BSHReturnType jjtn000 = new BSHReturnType(JJTRETURNTYPE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case VOID: jj_consume_token(VOID); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.isVoid = true; break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case SHORT: case IDENTIFIER: Type(); break; default: jj_consume_token(-1); throw new ParseException(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PrimitiveType() throws ParseException { /*@bgen(jjtree) PrimitiveType */ BSHPrimitiveType jjtn000 = new BSHPrimitiveType(JJTPRIMITIVETYPE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: jj_consume_token(BOOLEAN); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Boolean.TYPE; break; case CHAR: jj_consume_token(CHAR); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Character.TYPE; break; case BYTE: jj_consume_token(BYTE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Byte.TYPE; break; case SHORT: jj_consume_token(SHORT); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Short.TYPE; break; case INT: jj_consume_token(INT); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Integer.TYPE; break; case LONG: jj_consume_token(LONG); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Long.TYPE; break; case FLOAT: jj_consume_token(FLOAT); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Float.TYPE; break; case DOUBLE: jj_consume_token(DOUBLE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Double.TYPE; break; default: jj_consume_token(-1); throw new ParseException(); } } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Expression() throws ParseException { if (jj_2_8(2147483647)) { Assignment(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: ConditionalExpression(); break; default: jj_consume_token(-1); throw new ParseException(); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public int AssignmentOperator() throws ParseException { Token t; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ASSIGN: jj_consume_token(ASSIGN); break; case STARASSIGN: jj_consume_token(STARASSIGN); break; case SLASHASSIGN: jj_consume_token(SLASHASSIGN); break; case MODASSIGN: jj_consume_token(MODASSIGN); break; case PLUSASSIGN: jj_consume_token(PLUSASSIGN); break; case MINUSASSIGN: jj_consume_token(MINUSASSIGN); break; case ANDASSIGN: jj_consume_token(ANDASSIGN); break; case XORASSIGN: jj_consume_token(XORASSIGN); break; case ORASSIGN: jj_consume_token(ORASSIGN); break; case LSHIFTASSIGN: jj_consume_token(LSHIFTASSIGN); break; case LSHIFTASSIGNX: jj_consume_token(LSHIFTASSIGNX); break; case RSIGNEDSHIFTASSIGN: jj_consume_token(RSIGNEDSHIFTASSIGN); break; case RSIGNEDSHIFTASSIGNX: jj_consume_token(RSIGNEDSHIFTASSIGNX); break; case RUNSIGNEDSHIFTASSIGN: jj_consume_token(RUNSIGNEDSHIFTASSIGN); break; case RUNSIGNEDSHIFTASSIGNX: jj_consume_token(RUNSIGNEDSHIFTASSIGNX); break; default: jj_consume_token(-1); throw new ParseException(); } t = getToken(0); {if (true) return t.kind;} throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ConditionalOrExpression() throws ParseException { Token t=null; ConditionalAndExpression(); label_7: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOL_OR: case BOOL_ORX: ; break; default: break label_7; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOL_OR: t = jj_consume_token(BOOL_OR); break; case BOOL_ORX: t = jj_consume_token(BOOL_ORX); break; default: jj_consume_token(-1); throw new ParseException(); } ConditionalAndExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ConditionalAndExpression() throws ParseException { Token t=null; InclusiveOrExpression(); label_8: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOL_AND: case BOOL_ANDX: ; break; default: break label_8; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOL_AND: t = jj_consume_token(BOOL_AND); break; case BOOL_ANDX: t = jj_consume_token(BOOL_ANDX); break; default: jj_consume_token(-1); throw new ParseException(); } InclusiveOrExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void InclusiveOrExpression() throws ParseException { Token t=null; ExclusiveOrExpression(); label_9: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_OR: case BIT_ORX: ; break; default: break label_9; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_OR: t = jj_consume_token(BIT_OR); break; case BIT_ORX: t = jj_consume_token(BIT_ORX); break; default: jj_consume_token(-1); throw new ParseException(); } ExclusiveOrExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void AndExpression() throws ParseException { Token t=null; EqualityExpression(); label_11: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_AND: case BIT_ANDX: ; break; default: break label_11; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_AND: t = jj_consume_token(BIT_AND); break; case BIT_ANDX: t = jj_consume_token(BIT_ANDX); break; default: jj_consume_token(-1); throw new ParseException(); } EqualityExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void EqualityExpression() throws ParseException { Token t = null; InstanceOfExpression(); label_12: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case EQ: case NE: ; break; default: break label_12; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case EQ: t = jj_consume_token(EQ); break; case NE: t = jj_consume_token(NE); break; default: jj_consume_token(-1); throw new ParseException(); } InstanceOfExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void RelationalExpression() throws ParseException { Token t = null; ShiftExpression(); label_13: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case GT: case GTX: case LT: case LTX: case LE: case LEX: case GE: case GEX: ; break; default: break label_13; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LT: t = jj_consume_token(LT); break; case LTX: t = jj_consume_token(LTX); break; case GT: t = jj_consume_token(GT); break; case GTX: t = jj_consume_token(GTX); break; case LE: t = jj_consume_token(LE); break; case LEX: t = jj_consume_token(LEX); break; case GE: t = jj_consume_token(GE); break; case GEX: t = jj_consume_token(GEX); break; default: jj_consume_token(-1); throw new ParseException(); } ShiftExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ShiftExpression() throws ParseException { Token t = null; AdditiveExpression(); label_14: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LSHIFT: case LSHIFTX: case RSIGNEDSHIFT: case RSIGNEDSHIFTX: case RUNSIGNEDSHIFT: case RUNSIGNEDSHIFTX: ; break; default: break label_14; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LSHIFT: t = jj_consume_token(LSHIFT); break; case LSHIFTX: t = jj_consume_token(LSHIFTX); break; case RSIGNEDSHIFT: t = jj_consume_token(RSIGNEDSHIFT); break; case RSIGNEDSHIFTX: t = jj_consume_token(RSIGNEDSHIFTX); break; case RUNSIGNEDSHIFT: t = jj_consume_token(RUNSIGNEDSHIFT); break; case RUNSIGNEDSHIFTX: t = jj_consume_token(RUNSIGNEDSHIFTX); break; default: jj_consume_token(-1); throw new ParseException(); } AdditiveExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void AdditiveExpression() throws ParseException { Token t = null; MultiplicativeExpression(); label_15: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: case MINUS: ; break; default: break label_15; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: t = jj_consume_token(PLUS); break; case MINUS: t = jj_consume_token(MINUS); break; default: jj_consume_token(-1); throw new ParseException(); } MultiplicativeExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void MultiplicativeExpression() throws ParseException { Token t = null; UnaryExpression(); label_16: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STAR: case SLASH: case MOD: ; break; default: break label_16; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STAR: t = jj_consume_token(STAR); break; case SLASH: t = jj_consume_token(SLASH); break; case MOD: t = jj_consume_token(MOD); break; default: jj_consume_token(-1); throw new ParseException(); } UnaryExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void UnaryExpression() throws ParseException { Token t = null; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: case MINUS: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: t = jj_consume_token(PLUS); break; case MINUS: t = jj_consume_token(MINUS); break; default: jj_consume_token(-1); throw new ParseException(); } UnaryExpression(); BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 1); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } } break; case INCR: PreIncrementExpression(); break; case DECR: PreDecrementExpression(); break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: UnaryExpressionNotPlusMinus(); break; default: jj_consume_token(-1); throw new ParseException(); } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void UnaryExpressionNotPlusMinus() throws ParseException { Token t = null; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BANG: case TILDE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case TILDE: t = jj_consume_token(TILDE); break; case BANG: t = jj_consume_token(BANG); break; default: jj_consume_token(-1); throw new ParseException(); } UnaryExpression(); BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 1); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } } break; default: if (jj_2_9(2147483647)) { CastExpression(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: PostfixExpression(); break; default: jj_consume_token(-1); throw new ParseException(); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void CastLookahead() throws ParseException { if (jj_2_10(2)) { jj_consume_token(LPAREN); PrimitiveType(); } else if (jj_2_11(2147483647)) { jj_consume_token(LPAREN); AmbiguousName(); jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: jj_consume_token(LPAREN); AmbiguousName(); jj_consume_token(RPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case TILDE: jj_consume_token(TILDE); break; case BANG: jj_consume_token(BANG); break; case LPAREN: jj_consume_token(LPAREN); break; case IDENTIFIER: jj_consume_token(IDENTIFIER); break; case NEW: jj_consume_token(NEW); break; case FALSE: case NULL: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: Literal(); break; default: jj_consume_token(-1); throw new ParseException(); } break; default: jj_consume_token(-1); throw new ParseException(); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PostfixExpression() throws ParseException { Token t = null; if (jj_2_12(2147483647)) { PrimaryExpression(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INCR: t = jj_consume_token(INCR); break; case DECR: t = jj_consume_token(DECR); break; default: jj_consume_token(-1); throw new ParseException(); } BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 1); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; jjtn001.postfix = true; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } } } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: PrimaryExpression(); break; default: jj_consume_token(-1); throw new ParseException(); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void CastExpression() throws ParseException { /*@bgen(jjtree) CastExpression */ BSHCastExpression jjtn000 = new BSHCastExpression(JJTCASTEXPRESSION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { if (jj_2_13(2147483647)) { jj_consume_token(LPAREN); Type(); jj_consume_token(RPAREN); UnaryExpression(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: jj_consume_token(LPAREN); Type(); jj_consume_token(RPAREN); UnaryExpressionNotPlusMinus(); break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PrimaryPrefix() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FALSE: case NULL: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: Literal(); break; case LPAREN: jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); break; case NEW: AllocationExpression(); break; default: if (jj_2_14(2147483647)) { MethodInvocation(); } else if (jj_2_15(2147483647)) { Type(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENTIFIER: AmbiguousName(); break; default: jj_consume_token(-1); throw new ParseException(); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PrimarySuffix() throws ParseException { /*@bgen(jjtree) PrimarySuffix */ BSHPrimarySuffix jjtn000 = new BSHPrimarySuffix(JJTPRIMARYSUFFIX); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t = null; try { if (jj_2_16(2)) { jj_consume_token(DOT); jj_consume_token(CLASS); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.operation = BSHPrimarySuffix.CLASS; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: jj_consume_token(LBRACKET); Expression(); jj_consume_token(RBRACKET); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.operation = BSHPrimarySuffix.INDEX; break; case DOT: jj_consume_token(DOT); t = jj_consume_token(IDENTIFIER); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: Arguments(); break; default: ; } jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.operation = BSHPrimarySuffix.NAME; jjtn000.field = t.image; break; case LBRACE: jj_consume_token(LBRACE); Expression(); jj_consume_token(RBRACE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.operation = BSHPrimarySuffix.PROPERTY; break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Literal() throws ParseException { /*@bgen(jjtree) Literal */ BSHLiteral jjtn000 = new BSHLiteral(JJTLITERAL); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token x; boolean b; String literal; char ch; try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INTEGER_LITERAL: x = jj_consume_token(INTEGER_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); literal = x.image; ch = literal.charAt(literal.length()-1); if(ch == 'l' || ch == 'L') { literal = literal.substring(0,literal.length()-1); // This really should be Long.decode, but there isn't one. As a result, // hex and octal literals ending in 'l' or 'L' don't work. jjtn000.value = new Primitive( new Long( literal ).longValue() ); } else try { jjtn000.value = new Primitive( Integer.decode( literal ).intValue() ); } catch ( NumberFormatException e ) { {if (true) throw createParseException( "Error or number too big for integer type: "+ literal );} } break; case FLOATING_POINT_LITERAL: x = jj_consume_token(FLOATING_POINT_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); literal = x.image; ch = literal.charAt(literal.length()-1); if(ch == 'f' || ch == 'F') { literal = literal.substring(0,literal.length()-1); jjtn000.value = new Primitive( new Float( literal ).floatValue() ); } else { if(ch == 'd' || ch == 'D') literal = literal.substring(0,literal.length()-1); jjtn000.value = new Primitive( new Double( literal ).doubleValue() ); } break; case CHARACTER_LITERAL: x = jj_consume_token(CHARACTER_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); try { jjtn000.charSetup( x.image.substring(1, x.image.length() - 1) ); } catch ( Exception e ) { {if (true) throw createParseException("Error parsing character: "+x.image);} } break; case STRING_LITERAL: x = jj_consume_token(STRING_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); try { jjtn000.stringSetup( x.image.substring(1, x.image.length() - 1) ); } catch ( Exception e ) { {if (true) throw createParseException("Error parsing string: "+x.image);} } break; case FALSE: case TRUE: b = BooleanLiteral(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.value = new Primitive( b ); break; case NULL: NullLiteral(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.value = Primitive.NULL; break; case VOID: VoidLiteral(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.value = Primitive.VOID; break; default: jj_consume_token(-1); throw new ParseException(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public boolean BooleanLiteral() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case TRUE: jj_consume_token(TRUE); {if (true) return true;} break; case FALSE: jj_consume_token(FALSE); {if (true) return false;} break; default: jj_consume_token(-1); throw new ParseException(); } throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void AllocationExpression() throws ParseException { /*@bgen(jjtree) AllocationExpression */ BSHAllocationExpression jjtn000 = new BSHAllocationExpression(JJTALLOCATIONEXPRESSION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { if (jj_2_18(2)) { jj_consume_token(NEW); PrimitiveType(); ArrayDimensions(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case NEW: jj_consume_token(NEW); AmbiguousName(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: ArrayDimensions(); break; case LPAREN: Arguments(); if (jj_2_17(2)) { Block(); } else { ; } break; default: jj_consume_token(-1); throw new ParseException(); } break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ArrayDimensions() throws ParseException { /*@bgen(jjtree) ArrayDimensions */ BSHArrayDimensions jjtn000 = new BSHArrayDimensions(JJTARRAYDIMENSIONS); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { if (jj_2_21(2)) { label_19: while (true) { jj_consume_token(LBRACKET); Expression(); jj_consume_token(RBRACKET); jjtn000.addDefinedDimension(); if (jj_2_19(2)) { ; } else { break label_19; } } label_20: while (true) { if (jj_2_20(2)) { ; } else { break label_20; } jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); jjtn000.addUndefinedDimension(); } } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: label_21: while (true) { jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); jjtn000.addUndefinedDimension(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: ; break; default: break label_21; } } ArrayInitializer(); break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Statement() throws ParseException { if (jj_2_22(2)) { LabeledStatement(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: Block(); break; case SEMICOLON: EmptyStatement(); break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: StatementExpression(); jj_consume_token(SEMICOLON); break; case SWITCH: SwitchStatement(); break; case IF: IfStatement(); break; case WHILE: WhileStatement(); break; case DO: DoStatement(); break; default: if (isRegularForStatement()) { ForStatement(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FOR: EnhancedForStatement(); break; case BREAK: BreakStatement(); break; case CONTINUE: ContinueStatement(); break; case RETURN: ReturnStatement(); break; case SYNCHRONIZED: SynchronizedStatement(); break; case THROW: ThrowStatement(); break; case TRY: TryStatement(); break; default: jj_consume_token(-1); throw new ParseException(); } } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void BlockStatement() throws ParseException { if (jj_2_24(2147483647)) { ClassDeclaration(); } else if (jj_2_25(2147483647)) { MethodDeclaration(); } else if (jj_2_26(2147483647)) { MethodDeclaration(); } else if (jj_2_27(2147483647)) { TypedVariableDeclaration(); jj_consume_token(SEMICOLON); } else if (jj_2_28(1)) { Statement(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IMPORT: case STATIC: ImportDeclaration(); break; case PACKAGE: PackageDeclaration(); break; case FORMAL_COMMENT: FormalComment(); break; default: jj_consume_token(-1); throw new ParseException(); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void SwitchLabel() throws ParseException { /*@bgen(jjtree) SwitchLabel */ BSHSwitchLabel jjtn000 = new BSHSwitchLabel(JJTSWITCHLABEL); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case CASE: jj_consume_token(CASE); Expression(); jj_consume_token(COLON); break; case _DEFAULT: jj_consume_token(_DEFAULT); jj_consume_token(COLON); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.isDefault = true; break; default: jj_consume_token(-1); throw new ParseException(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void EnhancedForStatement() throws ParseException { /*@bgen(jjtree) EnhancedForStatement */ BSHEnhancedForStatement jjtn000 = new BSHEnhancedForStatement(JJTENHANCEDFORSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t = null; try { if (jj_2_30(4)) { jj_consume_token(FOR); jj_consume_token(LPAREN); t = jj_consume_token(IDENTIFIER); jj_consume_token(COLON); Expression(); jj_consume_token(RPAREN); Statement(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.varName = t.image; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FOR: jj_consume_token(FOR); jj_consume_token(LPAREN); Type(); t = jj_consume_token(IDENTIFIER); jj_consume_token(COLON); Expression(); jj_consume_token(RPAREN); Statement(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.varName = t.image; break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ForInit() throws ParseException { Token t = null; if (jj_2_31(2147483647)) { TypedVariableDeclaration(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: StatementExpressionList(); break; default: jj_consume_token(-1); throw new ParseException(); } } }
0 77
              
// in org/gjt/sp/jedit/bsh/Parser.java
public static void main( String [] args ) throws IOException, ParseException { boolean print = false; int i=0; if ( args[0].equals("-p") ) { i++; print=true; } for(; i< args.length; i++) { Reader in = new FileReader(args[i]); Parser parser = new Parser(in); parser.setRetainComments(true); while( !parser.Line()/*eof*/ ) if ( print ) System.out.println( parser.popNode() ); } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public boolean Line() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 0: jj_consume_token(0); Interpreter.debug("End of File!"); {if (true) return true;} break; default: if (jj_2_1(1)) { BlockStatement(); {if (true) return false;} } else { jj_consume_token(-1); throw new ParseException(); } } throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public Modifiers Modifiers(int context, boolean lookahead) throws ParseException { Modifiers mods = null; label_1: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ABSTRACT: case FINAL: case NATIVE: case PRIVATE: case PROTECTED: case PUBLIC: case STATIC: case STRICTFP: case SYNCHRONIZED: case TRANSIENT: case VOLATILE: ; break; default: break label_1; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PRIVATE: jj_consume_token(PRIVATE); break; case PROTECTED: jj_consume_token(PROTECTED); break; case PUBLIC: jj_consume_token(PUBLIC); break; case SYNCHRONIZED: jj_consume_token(SYNCHRONIZED); break; case FINAL: jj_consume_token(FINAL); break; case NATIVE: jj_consume_token(NATIVE); break; case TRANSIENT: jj_consume_token(TRANSIENT); break; case VOLATILE: jj_consume_token(VOLATILE); break; case ABSTRACT: jj_consume_token(ABSTRACT); break; case STATIC: jj_consume_token(STATIC); break; case STRICTFP: jj_consume_token(STRICTFP); break; default: jj_consume_token(-1); throw new ParseException(); } if ( !lookahead ) try { if ( mods == null ) mods = new Modifiers(); mods.addModifier( context, getToken(0).image ); } catch ( IllegalStateException e ) { {if (true) throw createParseException( e.getMessage() );} } } {if (true) return mods;} throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ClassDeclaration() throws ParseException { /*@bgen(jjtree) ClassDeclaration */ BSHClassDeclaration jjtn000 = new BSHClassDeclaration(JJTCLASSDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Modifiers mods; Token name; int numInterfaces; try { mods = Modifiers(Modifiers.CLASS, false); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case CLASS: jj_consume_token(CLASS); break; case INTERFACE: jj_consume_token(INTERFACE); jjtn000.isInterface=true; break; default: jj_consume_token(-1); throw new ParseException(); } name = jj_consume_token(IDENTIFIER); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case EXTENDS: jj_consume_token(EXTENDS); AmbiguousName(); jjtn000.extend = true; break; default: ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IMPLEMENTS: jj_consume_token(IMPLEMENTS); numInterfaces = NameList(); jjtn000.numInterfaces=numInterfaces; break; default: ; } Block(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.modifiers = mods; jjtn000.name = name.image; } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void MethodDeclaration() throws ParseException { /*@bgen(jjtree) MethodDeclaration */ BSHMethodDeclaration jjtn000 = new BSHMethodDeclaration(JJTMETHODDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t = null; Modifiers mods; int count; try { mods = Modifiers(Modifiers.METHOD, false); jjtn000.modifiers = mods; if (jj_2_2(2147483647)) { t = jj_consume_token(IDENTIFIER); jjtn000.name = t.image; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case SHORT: case VOID: case IDENTIFIER: ReturnType(); t = jj_consume_token(IDENTIFIER); jjtn000.name = t.image; break; default: jj_consume_token(-1); throw new ParseException(); } } FormalParameters(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case THROWS: jj_consume_token(THROWS); count = NameList(); jjtn000.numThrows=count; break; default: ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: Block(); break; case SEMICOLON: jj_consume_token(SEMICOLON); break; default: jj_consume_token(-1); throw new ParseException(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PackageDeclaration() throws ParseException { /*@bgen(jjtree) PackageDeclaration */ BSHPackageDeclaration jjtn000 = new BSHPackageDeclaration(JJTPACKAGEDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(PACKAGE); AmbiguousName(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ImportDeclaration() throws ParseException { /*@bgen(jjtree) ImportDeclaration */ BSHImportDeclaration jjtn000 = new BSHImportDeclaration(JJTIMPORTDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token s = null; Token t = null; try { if (jj_2_3(3)) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STATIC: s = jj_consume_token(STATIC); break; default: ; } jj_consume_token(IMPORT); AmbiguousName(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case DOT: t = jj_consume_token(DOT); jj_consume_token(STAR); break; default: ; } jj_consume_token(SEMICOLON); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); if ( s != null ) jjtn000.staticImport = true; if ( t != null ) jjtn000.importPackage = true; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IMPORT: jj_consume_token(IMPORT); jj_consume_token(STAR); jj_consume_token(SEMICOLON); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.superImport = true; break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void VariableDeclarator() throws ParseException { /*@bgen(jjtree) VariableDeclarator */ BSHVariableDeclarator jjtn000 = new BSHVariableDeclarator(JJTVARIABLEDECLARATOR); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t; try { t = jj_consume_token(IDENTIFIER); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ASSIGN: jj_consume_token(ASSIGN); VariableInitializer(); break; default: ; } jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.name = t.image; } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void VariableInitializer() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: ArrayInitializer(); break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: Expression(); break; default: jj_consume_token(-1); throw new ParseException(); } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ArrayInitializer() throws ParseException { /*@bgen(jjtree) ArrayInitializer */ BSHArrayInitializer jjtn000 = new BSHArrayInitializer(JJTARRAYINITIALIZER); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(LBRACE); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case LBRACE: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: VariableInitializer(); label_2: while (true) { if (jj_2_4(2)) { ; } else { break label_2; } jj_consume_token(COMMA); VariableInitializer(); } break; default: ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: jj_consume_token(COMMA); break; default: ; } jj_consume_token(RBRACE); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void FormalParameters() throws ParseException { /*@bgen(jjtree) FormalParameters */ BSHFormalParameters jjtn000 = new BSHFormalParameters(JJTFORMALPARAMETERS); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(LPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case SHORT: case IDENTIFIER: FormalParameter(); label_3: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: break label_3; } jj_consume_token(COMMA); FormalParameter(); } break; default: ; } jj_consume_token(RPAREN); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void FormalParameter() throws ParseException { /*@bgen(jjtree) FormalParameter */ BSHFormalParameter jjtn000 = new BSHFormalParameter(JJTFORMALPARAMETER); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t; try { if (jj_2_5(2)) { Type(); t = jj_consume_token(IDENTIFIER); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.name = t.image; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENTIFIER: t = jj_consume_token(IDENTIFIER); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.name = t.image; break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Type() throws ParseException { /*@bgen(jjtree) Type */ BSHType jjtn000 = new BSHType(JJTTYPE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case SHORT: PrimitiveType(); break; case IDENTIFIER: AmbiguousName(); break; default: jj_consume_token(-1); throw new ParseException(); } label_4: while (true) { if (jj_2_6(2)) { ; } else { break label_4; } jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); jjtn000.addArrayDimension(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ReturnType() throws ParseException { /*@bgen(jjtree) ReturnType */ BSHReturnType jjtn000 = new BSHReturnType(JJTRETURNTYPE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case VOID: jj_consume_token(VOID); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.isVoid = true; break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case SHORT: case IDENTIFIER: Type(); break; default: jj_consume_token(-1); throw new ParseException(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PrimitiveType() throws ParseException { /*@bgen(jjtree) PrimitiveType */ BSHPrimitiveType jjtn000 = new BSHPrimitiveType(JJTPRIMITIVETYPE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: jj_consume_token(BOOLEAN); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Boolean.TYPE; break; case CHAR: jj_consume_token(CHAR); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Character.TYPE; break; case BYTE: jj_consume_token(BYTE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Byte.TYPE; break; case SHORT: jj_consume_token(SHORT); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Short.TYPE; break; case INT: jj_consume_token(INT); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Integer.TYPE; break; case LONG: jj_consume_token(LONG); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Long.TYPE; break; case FLOAT: jj_consume_token(FLOAT); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Float.TYPE; break; case DOUBLE: jj_consume_token(DOUBLE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Double.TYPE; break; default: jj_consume_token(-1); throw new ParseException(); } } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void AmbiguousName() throws ParseException { /*@bgen(jjtree) AmbiguousName */ BSHAmbiguousName jjtn000 = new BSHAmbiguousName(JJTAMBIGUOUSNAME); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t; StringBuilder s; try { t = jj_consume_token(IDENTIFIER); s = new StringBuilder(t.image); label_5: while (true) { if (jj_2_7(2)) { ; } else { break label_5; } jj_consume_token(DOT); t = jj_consume_token(IDENTIFIER); s.append("."+t.image); } jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.text = s.toString(); } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public int NameList() throws ParseException { int count = 0; AmbiguousName(); ++count; label_6: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: break label_6; } jj_consume_token(COMMA); AmbiguousName(); ++count; } {if (true) return count;} throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Expression() throws ParseException { if (jj_2_8(2147483647)) { Assignment(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: ConditionalExpression(); break; default: jj_consume_token(-1); throw new ParseException(); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Assignment() throws ParseException { /*@bgen(jjtree) Assignment */ BSHAssignment jjtn000 = new BSHAssignment(JJTASSIGNMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);int op ; try { PrimaryExpression(); op = AssignmentOperator(); jjtn000.operator = op; Expression(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public int AssignmentOperator() throws ParseException { Token t; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ASSIGN: jj_consume_token(ASSIGN); break; case STARASSIGN: jj_consume_token(STARASSIGN); break; case SLASHASSIGN: jj_consume_token(SLASHASSIGN); break; case MODASSIGN: jj_consume_token(MODASSIGN); break; case PLUSASSIGN: jj_consume_token(PLUSASSIGN); break; case MINUSASSIGN: jj_consume_token(MINUSASSIGN); break; case ANDASSIGN: jj_consume_token(ANDASSIGN); break; case XORASSIGN: jj_consume_token(XORASSIGN); break; case ORASSIGN: jj_consume_token(ORASSIGN); break; case LSHIFTASSIGN: jj_consume_token(LSHIFTASSIGN); break; case LSHIFTASSIGNX: jj_consume_token(LSHIFTASSIGNX); break; case RSIGNEDSHIFTASSIGN: jj_consume_token(RSIGNEDSHIFTASSIGN); break; case RSIGNEDSHIFTASSIGNX: jj_consume_token(RSIGNEDSHIFTASSIGNX); break; case RUNSIGNEDSHIFTASSIGN: jj_consume_token(RUNSIGNEDSHIFTASSIGN); break; case RUNSIGNEDSHIFTASSIGNX: jj_consume_token(RUNSIGNEDSHIFTASSIGNX); break; default: jj_consume_token(-1); throw new ParseException(); } t = getToken(0); {if (true) return t.kind;} throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ConditionalExpression() throws ParseException { ConditionalOrExpression(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case HOOK: jj_consume_token(HOOK); Expression(); jj_consume_token(COLON); BSHTernaryExpression jjtn001 = new BSHTernaryExpression(JJTTERNARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { ConditionalExpression(); } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 3); jjtreeCloseNodeScope(jjtn001); } } break; default: ; } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ConditionalOrExpression() throws ParseException { Token t=null; ConditionalAndExpression(); label_7: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOL_OR: case BOOL_ORX: ; break; default: break label_7; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOL_OR: t = jj_consume_token(BOOL_OR); break; case BOOL_ORX: t = jj_consume_token(BOOL_ORX); break; default: jj_consume_token(-1); throw new ParseException(); } ConditionalAndExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ConditionalAndExpression() throws ParseException { Token t=null; InclusiveOrExpression(); label_8: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOL_AND: case BOOL_ANDX: ; break; default: break label_8; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOL_AND: t = jj_consume_token(BOOL_AND); break; case BOOL_ANDX: t = jj_consume_token(BOOL_ANDX); break; default: jj_consume_token(-1); throw new ParseException(); } InclusiveOrExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void InclusiveOrExpression() throws ParseException { Token t=null; ExclusiveOrExpression(); label_9: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_OR: case BIT_ORX: ; break; default: break label_9; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_OR: t = jj_consume_token(BIT_OR); break; case BIT_ORX: t = jj_consume_token(BIT_ORX); break; default: jj_consume_token(-1); throw new ParseException(); } ExclusiveOrExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ExclusiveOrExpression() throws ParseException { Token t=null; AndExpression(); label_10: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case XOR: ; break; default: break label_10; } t = jj_consume_token(XOR); AndExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void AndExpression() throws ParseException { Token t=null; EqualityExpression(); label_11: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_AND: case BIT_ANDX: ; break; default: break label_11; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_AND: t = jj_consume_token(BIT_AND); break; case BIT_ANDX: t = jj_consume_token(BIT_ANDX); break; default: jj_consume_token(-1); throw new ParseException(); } EqualityExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void EqualityExpression() throws ParseException { Token t = null; InstanceOfExpression(); label_12: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case EQ: case NE: ; break; default: break label_12; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case EQ: t = jj_consume_token(EQ); break; case NE: t = jj_consume_token(NE); break; default: jj_consume_token(-1); throw new ParseException(); } InstanceOfExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void InstanceOfExpression() throws ParseException { Token t = null; RelationalExpression(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INSTANCEOF: t = jj_consume_token(INSTANCEOF); Type(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } break; default: ; } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void RelationalExpression() throws ParseException { Token t = null; ShiftExpression(); label_13: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case GT: case GTX: case LT: case LTX: case LE: case LEX: case GE: case GEX: ; break; default: break label_13; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LT: t = jj_consume_token(LT); break; case LTX: t = jj_consume_token(LTX); break; case GT: t = jj_consume_token(GT); break; case GTX: t = jj_consume_token(GTX); break; case LE: t = jj_consume_token(LE); break; case LEX: t = jj_consume_token(LEX); break; case GE: t = jj_consume_token(GE); break; case GEX: t = jj_consume_token(GEX); break; default: jj_consume_token(-1); throw new ParseException(); } ShiftExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ShiftExpression() throws ParseException { Token t = null; AdditiveExpression(); label_14: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LSHIFT: case LSHIFTX: case RSIGNEDSHIFT: case RSIGNEDSHIFTX: case RUNSIGNEDSHIFT: case RUNSIGNEDSHIFTX: ; break; default: break label_14; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LSHIFT: t = jj_consume_token(LSHIFT); break; case LSHIFTX: t = jj_consume_token(LSHIFTX); break; case RSIGNEDSHIFT: t = jj_consume_token(RSIGNEDSHIFT); break; case RSIGNEDSHIFTX: t = jj_consume_token(RSIGNEDSHIFTX); break; case RUNSIGNEDSHIFT: t = jj_consume_token(RUNSIGNEDSHIFT); break; case RUNSIGNEDSHIFTX: t = jj_consume_token(RUNSIGNEDSHIFTX); break; default: jj_consume_token(-1); throw new ParseException(); } AdditiveExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void AdditiveExpression() throws ParseException { Token t = null; MultiplicativeExpression(); label_15: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: case MINUS: ; break; default: break label_15; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: t = jj_consume_token(PLUS); break; case MINUS: t = jj_consume_token(MINUS); break; default: jj_consume_token(-1); throw new ParseException(); } MultiplicativeExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void MultiplicativeExpression() throws ParseException { Token t = null; UnaryExpression(); label_16: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STAR: case SLASH: case MOD: ; break; default: break label_16; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STAR: t = jj_consume_token(STAR); break; case SLASH: t = jj_consume_token(SLASH); break; case MOD: t = jj_consume_token(MOD); break; default: jj_consume_token(-1); throw new ParseException(); } UnaryExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void UnaryExpression() throws ParseException { Token t = null; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: case MINUS: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: t = jj_consume_token(PLUS); break; case MINUS: t = jj_consume_token(MINUS); break; default: jj_consume_token(-1); throw new ParseException(); } UnaryExpression(); BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 1); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } } break; case INCR: PreIncrementExpression(); break; case DECR: PreDecrementExpression(); break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: UnaryExpressionNotPlusMinus(); break; default: jj_consume_token(-1); throw new ParseException(); } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PreIncrementExpression() throws ParseException { Token t = null; t = jj_consume_token(INCR); PrimaryExpression(); BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 1); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PreDecrementExpression() throws ParseException { Token t = null; t = jj_consume_token(DECR); PrimaryExpression(); BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 1); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void UnaryExpressionNotPlusMinus() throws ParseException { Token t = null; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BANG: case TILDE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case TILDE: t = jj_consume_token(TILDE); break; case BANG: t = jj_consume_token(BANG); break; default: jj_consume_token(-1); throw new ParseException(); } UnaryExpression(); BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 1); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } } break; default: if (jj_2_9(2147483647)) { CastExpression(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: PostfixExpression(); break; default: jj_consume_token(-1); throw new ParseException(); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void CastLookahead() throws ParseException { if (jj_2_10(2)) { jj_consume_token(LPAREN); PrimitiveType(); } else if (jj_2_11(2147483647)) { jj_consume_token(LPAREN); AmbiguousName(); jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: jj_consume_token(LPAREN); AmbiguousName(); jj_consume_token(RPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case TILDE: jj_consume_token(TILDE); break; case BANG: jj_consume_token(BANG); break; case LPAREN: jj_consume_token(LPAREN); break; case IDENTIFIER: jj_consume_token(IDENTIFIER); break; case NEW: jj_consume_token(NEW); break; case FALSE: case NULL: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: Literal(); break; default: jj_consume_token(-1); throw new ParseException(); } break; default: jj_consume_token(-1); throw new ParseException(); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PostfixExpression() throws ParseException { Token t = null; if (jj_2_12(2147483647)) { PrimaryExpression(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INCR: t = jj_consume_token(INCR); break; case DECR: t = jj_consume_token(DECR); break; default: jj_consume_token(-1); throw new ParseException(); } BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 1); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; jjtn001.postfix = true; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } } } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: PrimaryExpression(); break; default: jj_consume_token(-1); throw new ParseException(); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void CastExpression() throws ParseException { /*@bgen(jjtree) CastExpression */ BSHCastExpression jjtn000 = new BSHCastExpression(JJTCASTEXPRESSION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { if (jj_2_13(2147483647)) { jj_consume_token(LPAREN); Type(); jj_consume_token(RPAREN); UnaryExpression(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: jj_consume_token(LPAREN); Type(); jj_consume_token(RPAREN); UnaryExpressionNotPlusMinus(); break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PrimaryExpression() throws ParseException { /*@bgen(jjtree) PrimaryExpression */ BSHPrimaryExpression jjtn000 = new BSHPrimaryExpression(JJTPRIMARYEXPRESSION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { PrimaryPrefix(); label_17: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: case LBRACKET: case DOT: ; break; default: break label_17; } PrimarySuffix(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void MethodInvocation() throws ParseException { /*@bgen(jjtree) MethodInvocation */ BSHMethodInvocation jjtn000 = new BSHMethodInvocation(JJTMETHODINVOCATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { AmbiguousName(); Arguments(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PrimaryPrefix() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FALSE: case NULL: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: Literal(); break; case LPAREN: jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); break; case NEW: AllocationExpression(); break; default: if (jj_2_14(2147483647)) { MethodInvocation(); } else if (jj_2_15(2147483647)) { Type(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENTIFIER: AmbiguousName(); break; default: jj_consume_token(-1); throw new ParseException(); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PrimarySuffix() throws ParseException { /*@bgen(jjtree) PrimarySuffix */ BSHPrimarySuffix jjtn000 = new BSHPrimarySuffix(JJTPRIMARYSUFFIX); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t = null; try { if (jj_2_16(2)) { jj_consume_token(DOT); jj_consume_token(CLASS); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.operation = BSHPrimarySuffix.CLASS; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: jj_consume_token(LBRACKET); Expression(); jj_consume_token(RBRACKET); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.operation = BSHPrimarySuffix.INDEX; break; case DOT: jj_consume_token(DOT); t = jj_consume_token(IDENTIFIER); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: Arguments(); break; default: ; } jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.operation = BSHPrimarySuffix.NAME; jjtn000.field = t.image; break; case LBRACE: jj_consume_token(LBRACE); Expression(); jj_consume_token(RBRACE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.operation = BSHPrimarySuffix.PROPERTY; break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Literal() throws ParseException { /*@bgen(jjtree) Literal */ BSHLiteral jjtn000 = new BSHLiteral(JJTLITERAL); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token x; boolean b; String literal; char ch; try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INTEGER_LITERAL: x = jj_consume_token(INTEGER_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); literal = x.image; ch = literal.charAt(literal.length()-1); if(ch == 'l' || ch == 'L') { literal = literal.substring(0,literal.length()-1); // This really should be Long.decode, but there isn't one. As a result, // hex and octal literals ending in 'l' or 'L' don't work. jjtn000.value = new Primitive( new Long( literal ).longValue() ); } else try { jjtn000.value = new Primitive( Integer.decode( literal ).intValue() ); } catch ( NumberFormatException e ) { {if (true) throw createParseException( "Error or number too big for integer type: "+ literal );} } break; case FLOATING_POINT_LITERAL: x = jj_consume_token(FLOATING_POINT_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); literal = x.image; ch = literal.charAt(literal.length()-1); if(ch == 'f' || ch == 'F') { literal = literal.substring(0,literal.length()-1); jjtn000.value = new Primitive( new Float( literal ).floatValue() ); } else { if(ch == 'd' || ch == 'D') literal = literal.substring(0,literal.length()-1); jjtn000.value = new Primitive( new Double( literal ).doubleValue() ); } break; case CHARACTER_LITERAL: x = jj_consume_token(CHARACTER_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); try { jjtn000.charSetup( x.image.substring(1, x.image.length() - 1) ); } catch ( Exception e ) { {if (true) throw createParseException("Error parsing character: "+x.image);} } break; case STRING_LITERAL: x = jj_consume_token(STRING_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); try { jjtn000.stringSetup( x.image.substring(1, x.image.length() - 1) ); } catch ( Exception e ) { {if (true) throw createParseException("Error parsing string: "+x.image);} } break; case FALSE: case TRUE: b = BooleanLiteral(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.value = new Primitive( b ); break; case NULL: NullLiteral(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.value = Primitive.NULL; break; case VOID: VoidLiteral(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.value = Primitive.VOID; break; default: jj_consume_token(-1); throw new ParseException(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public boolean BooleanLiteral() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case TRUE: jj_consume_token(TRUE); {if (true) return true;} break; case FALSE: jj_consume_token(FALSE); {if (true) return false;} break; default: jj_consume_token(-1); throw new ParseException(); } throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void NullLiteral() throws ParseException { jj_consume_token(NULL); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void VoidLiteral() throws ParseException { jj_consume_token(VOID); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Arguments() throws ParseException { /*@bgen(jjtree) Arguments */ BSHArguments jjtn000 = new BSHArguments(JJTARGUMENTS); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(LPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: ArgumentList(); break; default: ; } jj_consume_token(RPAREN); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ArgumentList() throws ParseException { Expression(); label_18: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: break label_18; } jj_consume_token(COMMA); Expression(); } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void AllocationExpression() throws ParseException { /*@bgen(jjtree) AllocationExpression */ BSHAllocationExpression jjtn000 = new BSHAllocationExpression(JJTALLOCATIONEXPRESSION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { if (jj_2_18(2)) { jj_consume_token(NEW); PrimitiveType(); ArrayDimensions(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case NEW: jj_consume_token(NEW); AmbiguousName(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: ArrayDimensions(); break; case LPAREN: Arguments(); if (jj_2_17(2)) { Block(); } else { ; } break; default: jj_consume_token(-1); throw new ParseException(); } break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ArrayDimensions() throws ParseException { /*@bgen(jjtree) ArrayDimensions */ BSHArrayDimensions jjtn000 = new BSHArrayDimensions(JJTARRAYDIMENSIONS); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { if (jj_2_21(2)) { label_19: while (true) { jj_consume_token(LBRACKET); Expression(); jj_consume_token(RBRACKET); jjtn000.addDefinedDimension(); if (jj_2_19(2)) { ; } else { break label_19; } } label_20: while (true) { if (jj_2_20(2)) { ; } else { break label_20; } jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); jjtn000.addUndefinedDimension(); } } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: label_21: while (true) { jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); jjtn000.addUndefinedDimension(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: ; break; default: break label_21; } } ArrayInitializer(); break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Statement() throws ParseException { if (jj_2_22(2)) { LabeledStatement(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: Block(); break; case SEMICOLON: EmptyStatement(); break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: StatementExpression(); jj_consume_token(SEMICOLON); break; case SWITCH: SwitchStatement(); break; case IF: IfStatement(); break; case WHILE: WhileStatement(); break; case DO: DoStatement(); break; default: if (isRegularForStatement()) { ForStatement(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FOR: EnhancedForStatement(); break; case BREAK: BreakStatement(); break; case CONTINUE: ContinueStatement(); break; case RETURN: ReturnStatement(); break; case SYNCHRONIZED: SynchronizedStatement(); break; case THROW: ThrowStatement(); break; case TRY: TryStatement(); break; default: jj_consume_token(-1); throw new ParseException(); } } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void LabeledStatement() throws ParseException { jj_consume_token(IDENTIFIER); jj_consume_token(COLON); Statement(); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Block() throws ParseException { /*@bgen(jjtree) Block */ BSHBlock jjtn000 = new BSHBlock(JJTBLOCK); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(LBRACE); label_22: while (true) { if (jj_2_23(1)) { ; } else { break label_22; } BlockStatement(); } jj_consume_token(RBRACE); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void BlockStatement() throws ParseException { if (jj_2_24(2147483647)) { ClassDeclaration(); } else if (jj_2_25(2147483647)) { MethodDeclaration(); } else if (jj_2_26(2147483647)) { MethodDeclaration(); } else if (jj_2_27(2147483647)) { TypedVariableDeclaration(); jj_consume_token(SEMICOLON); } else if (jj_2_28(1)) { Statement(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IMPORT: case STATIC: ImportDeclaration(); break; case PACKAGE: PackageDeclaration(); break; case FORMAL_COMMENT: FormalComment(); break; default: jj_consume_token(-1); throw new ParseException(); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void FormalComment() throws ParseException { /*@bgen(jjtree) #FormalComment( retainComments) */ BSHFormalComment jjtn000 = new BSHFormalComment(JJTFORMALCOMMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t; try { t = jj_consume_token(FORMAL_COMMENT); jjtree.closeNodeScope(jjtn000, retainComments); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.text=t.image; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, retainComments); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void EmptyStatement() throws ParseException { jj_consume_token(SEMICOLON); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void StatementExpression() throws ParseException { Expression(); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void SwitchStatement() throws ParseException { /*@bgen(jjtree) SwitchStatement */ BSHSwitchStatement jjtn000 = new BSHSwitchStatement(JJTSWITCHSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(SWITCH); jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); jj_consume_token(LBRACE); label_23: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case CASE: case _DEFAULT: ; break; default: break label_23; } SwitchLabel(); label_24: while (true) { if (jj_2_29(1)) { ; } else { break label_24; } BlockStatement(); } } jj_consume_token(RBRACE); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void SwitchLabel() throws ParseException { /*@bgen(jjtree) SwitchLabel */ BSHSwitchLabel jjtn000 = new BSHSwitchLabel(JJTSWITCHLABEL); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case CASE: jj_consume_token(CASE); Expression(); jj_consume_token(COLON); break; case _DEFAULT: jj_consume_token(_DEFAULT); jj_consume_token(COLON); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.isDefault = true; break; default: jj_consume_token(-1); throw new ParseException(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void IfStatement() throws ParseException { /*@bgen(jjtree) IfStatement */ BSHIfStatement jjtn000 = new BSHIfStatement(JJTIFSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(IF); jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); Statement(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ELSE: jj_consume_token(ELSE); Statement(); break; default: ; } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void WhileStatement() throws ParseException { /*@bgen(jjtree) WhileStatement */ BSHWhileStatement jjtn000 = new BSHWhileStatement(JJTWHILESTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(WHILE); jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); Statement(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void DoStatement() throws ParseException { /*@bgen(jjtree) WhileStatement */ BSHWhileStatement jjtn000 = new BSHWhileStatement(JJTWHILESTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(DO); Statement(); jj_consume_token(WHILE); jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); jj_consume_token(SEMICOLON); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.isDoStatement=true; } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ForStatement() throws ParseException { /*@bgen(jjtree) ForStatement */ BSHForStatement jjtn000 = new BSHForStatement(JJTFORSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t = null; try { jj_consume_token(FOR); jj_consume_token(LPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ABSTRACT: case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FINAL: case FLOAT: case INT: case LONG: case NATIVE: case NEW: case NULL: case PRIVATE: case PROTECTED: case PUBLIC: case SHORT: case STATIC: case STRICTFP: case SYNCHRONIZED: case TRANSIENT: case TRUE: case VOID: case VOLATILE: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: ForInit(); jjtn000.hasForInit=true; break; default: ; } jj_consume_token(SEMICOLON); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: Expression(); jjtn000.hasExpression=true; break; default: ; } jj_consume_token(SEMICOLON); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: ForUpdate(); jjtn000.hasForUpdate=true; break; default: ; } jj_consume_token(RPAREN); Statement(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void EnhancedForStatement() throws ParseException { /*@bgen(jjtree) EnhancedForStatement */ BSHEnhancedForStatement jjtn000 = new BSHEnhancedForStatement(JJTENHANCEDFORSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t = null; try { if (jj_2_30(4)) { jj_consume_token(FOR); jj_consume_token(LPAREN); t = jj_consume_token(IDENTIFIER); jj_consume_token(COLON); Expression(); jj_consume_token(RPAREN); Statement(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.varName = t.image; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FOR: jj_consume_token(FOR); jj_consume_token(LPAREN); Type(); t = jj_consume_token(IDENTIFIER); jj_consume_token(COLON); Expression(); jj_consume_token(RPAREN); Statement(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.varName = t.image; break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ForInit() throws ParseException { Token t = null; if (jj_2_31(2147483647)) { TypedVariableDeclaration(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: StatementExpressionList(); break; default: jj_consume_token(-1); throw new ParseException(); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void TypedVariableDeclaration() throws ParseException { /*@bgen(jjtree) TypedVariableDeclaration */ BSHTypedVariableDeclaration jjtn000 = new BSHTypedVariableDeclaration(JJTTYPEDVARIABLEDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t = null; Modifiers mods; try { mods = Modifiers(Modifiers.FIELD, false); Type(); VariableDeclarator(); label_25: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: break label_25; } jj_consume_token(COMMA); VariableDeclarator(); } jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.modifiers = mods; } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void StatementExpressionList() throws ParseException { /*@bgen(jjtree) StatementExpressionList */ BSHStatementExpressionList jjtn000 = new BSHStatementExpressionList(JJTSTATEMENTEXPRESSIONLIST); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { StatementExpression(); label_26: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: break label_26; } jj_consume_token(COMMA); StatementExpression(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ForUpdate() throws ParseException { StatementExpressionList(); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void BreakStatement() throws ParseException { /*@bgen(jjtree) ReturnStatement */ BSHReturnStatement jjtn000 = new BSHReturnStatement(JJTRETURNSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(BREAK); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENTIFIER: jj_consume_token(IDENTIFIER); break; default: ; } jj_consume_token(SEMICOLON); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.kind = BREAK; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ContinueStatement() throws ParseException { /*@bgen(jjtree) ReturnStatement */ BSHReturnStatement jjtn000 = new BSHReturnStatement(JJTRETURNSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(CONTINUE); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENTIFIER: jj_consume_token(IDENTIFIER); break; default: ; } jj_consume_token(SEMICOLON); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.kind = CONTINUE; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ReturnStatement() throws ParseException { /*@bgen(jjtree) ReturnStatement */ BSHReturnStatement jjtn000 = new BSHReturnStatement(JJTRETURNSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(RETURN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: Expression(); break; default: ; } jj_consume_token(SEMICOLON); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.kind = RETURN; } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void SynchronizedStatement() throws ParseException { /*@bgen(jjtree) Block */ BSHBlock jjtn000 = new BSHBlock(JJTBLOCK); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(SYNCHRONIZED); jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); Block(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.isSynchronized=true; } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ThrowStatement() throws ParseException { /*@bgen(jjtree) ThrowStatement */ BSHThrowStatement jjtn000 = new BSHThrowStatement(JJTTHROWSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(THROW); Expression(); jj_consume_token(SEMICOLON); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void TryStatement() throws ParseException { /*@bgen(jjtree) TryStatement */ BSHTryStatement jjtn000 = new BSHTryStatement(JJTTRYSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);boolean closed = false; try { jj_consume_token(TRY); Block(); label_27: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case CATCH: ; break; default: break label_27; } jj_consume_token(CATCH); jj_consume_token(LPAREN); FormalParameter(); jj_consume_token(RPAREN); Block(); closed = true; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FINALLY: jj_consume_token(FINALLY); Block(); closed = true; break; default: ; } jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); if ( !closed ) {if (true) throw generateParseException();} } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final private Token jj_consume_token(int kind) throws ParseException { Token oldToken; if ((oldToken = token).next != null) token = token.next; else token = token.next = token_source.getNextToken(); jj_ntk = -1; if (token.kind == kind) { return token; } token = oldToken; throw generateParseException(); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
private boolean Line() throws ParseException { return parser.Line(); }
(Lib) InternalError 36
              
// in org/gjt/sp/jedit/View.java
public void setSplitConfig(Buffer buffer, String splitConfig) { try { Component comp = restoreSplitConfig(buffer,splitConfig); setMainContent(comp); updateTitle(); } catch(IOException e) { // this should never throw an exception. throw new InternalError(); } }
// in org/gjt/sp/jedit/pluginmgr/InstallPanel.java
Override public void actionPerformed(ActionEvent evt) { switch (command) { case TAB_OUT_FORWARD: KeyboardFocusManager.getCurrentKeyboardFocusManager().focusNextComponent(); break; case TAB_OUT_BACK: KeyboardFocusManager.getCurrentKeyboardFocusManager().focusPreviousComponent(); break; case EDIT_PLUGIN: int[] rows = table.getSelectedRows(); Object[] state = new Object[rows.length]; for (int i=0 ; i<rows.length ; i++) { state[i] = pluginModel.getValueAt(rows[i],0); } for (int i=0 ; i<rows.length ; i++) { pluginModel.setValueAt(state[i].equals(Boolean.FALSE),rows[i],0); } break; case CLOSE_PLUGIN_MANAGER: window.ok(); break; default: throw new InternalError(); } }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
Override public void actionPerformed(ActionEvent evt) { switch (command) { case TAB_OUT_FORWARD: KeyboardFocusManager.getCurrentKeyboardFocusManager().focusNextComponent(); break; case TAB_OUT_BACK: KeyboardFocusManager.getCurrentKeyboardFocusManager().focusPreviousComponent(); break; case EDIT_PLUGIN: int[] rows = table.getSelectedRows(); for (int i = 0; i < rows.length; i++) { Object st = pluginModel.getValueAt(rows[i], 0); pluginModel.setValueAt(st.equals(Boolean.FALSE), rows[i], 0); } break; case CLOSE_PLUGIN_MANAGER: window.ok(); break; default: throw new InternalError(); } }
// in org/gjt/sp/jedit/gui/PanelWindowContainer.java
public void register(DockableWindowManagerImpl.Entry entry) { dockables.add(entry); //{{{ Create button int rotation; if(position.equals(DockableWindowManagerImpl.TOP) || position.equals(DockableWindowManagerImpl.BOTTOM)) rotation = RotatedTextIcon.NONE; else if(position.equals(DockableWindowManagerImpl.LEFT)) rotation = RotatedTextIcon.CCW; else if(position.equals(DockableWindowManagerImpl.RIGHT)) rotation = RotatedTextIcon.CW; else throw new InternalError("Invalid position: " + position); JToggleButton button = new JToggleButton(); button.setMargin(new Insets(1,1,1,1)); button.setRequestFocusEnabled(false); button.setIcon(new RotatedTextIcon(rotation,button.getFont(), entry.shortTitle())); button.setActionCommand(entry.factory.name); button.addActionListener(new ActionHandler()); button.addMouseListener(new MenuMouseHandler()); if(OperatingSystem.isMacOSLF()) button.putClientProperty("JButton.buttonType","toolbar"); //}}} buttonGroup.add(button); buttons.add(button); entry.btn = button; wm.revalidate(); }
// in org/gjt/sp/jedit/gui/VariableGridLayout.java
private Dimension getLayoutSize(Container parent, LayoutSize which) { synchronized (parent.getTreeLock()) { update(parent); int ncomponents = parent.getComponentCount(); long h = 0; long w = 0; for (int r = 0, i = 0; r < nrows; r++) { int row_height = 0; for (int c = 0; c < ncols; c++, i++) { if (i < ncomponents) { switch (which) { case MINIMUM: row_height = Math.max(row_height, parent.getComponent(i).getMinimumSize().height); break; case MAXIMUM: row_height = Math.max(row_height, parent.getComponent(i).getMaximumSize().height); break; case PREFERRED: row_height = Math.max(row_height, parent.getComponent(i).getPreferredSize().height); break; default: throw new InternalError("Missing case branch for LayoutSize: " + which); } }
// in org/gjt/sp/jedit/gui/ExtendedGridLayout.java
private Dimension getSize(Container parent, LayoutSize layoutSize, boolean fillRawSizes, Dimension gridSize, List<List<ExtendedGridLayoutConstraints>> gridRows, Set<ExtendedGridLayoutConstraints> colspans, Set<ExtendedGridLayoutConstraints> rowspans, int[][] resultArrays) { if (fillRawSizes && (resultArrays.length < 6)) { throw new IllegalArgumentException("If fillRawSizes is true, resultArrays.length must be >= 6 (" + resultArrays.length + ')'); } int[] minimumColWidths = new int[gridSize.width]; int[] minimumRowHeights = new int[gridSize.height]; int[] preferredColWidths = new int[gridSize.width]; int[] preferredRowHeights = new int[gridSize.height]; int[] maximumColWidths = new int[gridSize.width]; int[] maximumRowHeights = new int[gridSize.height]; Arrays.fill(minimumColWidths,0); Arrays.fill(minimumRowHeights,0); Arrays.fill(preferredColWidths,0); Arrays.fill(preferredRowHeights,0); Arrays.fill(maximumColWidths,0); Arrays.fill(maximumRowHeights,0); // get the maximum of the minimum sizes, // the maximum of the preferred sizes and // the minimum of the maximum sizes // of all rows and columns, not taking // rowspans and colspans into account for (int row=0 ; row<gridSize.height ; row++) { List<ExtendedGridLayoutConstraints> gridRow = gridRows.get(row); for (int col=0 ; col<gridSize.width ; col++) { ExtendedGridLayoutConstraints cell = gridRow.get(col); if ((null != cell) && (null != cell.getComponent())) { Component component = cell.getComponent(); Dimension minimumSize = component.getMinimumSize(); Dimension preferredSize = component.getPreferredSize(); Dimension maximumSize = component.getMaximumSize(); if (!colspans.contains(cell)) { minimumColWidths[col] = Math.max(minimumColWidths[col],minimumSize.width); preferredColWidths[col] = Math.max(preferredColWidths[col],preferredSize.width); maximumColWidths[col] = Math.max(maximumColWidths[col],maximumSize.width); } if (!rowspans.contains(cell)) { minimumRowHeights[row] = Math.max(minimumRowHeights[row],minimumSize.height); preferredRowHeights[row] = Math.max(preferredRowHeights[row],preferredSize.height); maximumRowHeights[row] = Math.max(maximumRowHeights[row],maximumSize.height); } } } } // correct cases where // minimumColWidths[col] <= preferredColWidths[col] <= maximumColWidths[col] // is not true by clipping to the minimumColWidths and maximumColWidths for (int col=0 ; col<gridSize.width ; col++) { if (minimumColWidths[col] >= maximumColWidths[col]) { maximumColWidths[col] = minimumColWidths[col]; preferredColWidths[col] = minimumColWidths[col]; } else if (preferredColWidths[col] < minimumColWidths[col]) { preferredColWidths[col] = minimumColWidths[col]; } else if (preferredColWidths[col] > maximumColWidths[col]) { preferredColWidths[col] = maximumColWidths[col]; } } // plug in the colspans and correct the minimum, preferred and // maximum column widths the colspans are part of for (ExtendedGridLayoutConstraints cell : colspans) { int fromCol = cell.getCol(); int colspan = cell.getEffectiveColspan(); int toCol = fromCol + colspan; int currentMinimumColWidth = 0; int currentPreferredColWidth = 0; int currentMaximumColWidth = 0; for (int col=fromCol ; col<toCol ; col++) { int minimumColWidth = minimumColWidths[col]; if ((Integer.MAX_VALUE-minimumColWidth) < currentMinimumColWidth) { currentMinimumColWidth = Integer.MAX_VALUE; } else { currentMinimumColWidth += minimumColWidth; } int preferredColWidth = preferredColWidths[col]; if ((Integer.MAX_VALUE-preferredColWidth) < currentPreferredColWidth) { currentPreferredColWidth = Integer.MAX_VALUE; } else { currentPreferredColWidth += preferredColWidth; } int maximumColWidth = maximumColWidths[col]; if ((Integer.MAX_VALUE-maximumColWidth) < currentMaximumColWidth) { currentMaximumColWidth = Integer.MAX_VALUE; } else { currentMaximumColWidth += maximumColWidth; } } Component component = cell.getComponent(); int wantedMaximumColWidth = component.getMaximumSize().width - ((colspan - 1) * hgap); if (currentMaximumColWidth < wantedMaximumColWidth) { redistributeSpace(currentMaximumColWidth, wantedMaximumColWidth, fromCol,toCol, maximumColWidths, maximumColWidths, maximumColWidths); } int wantedMinimumColWidth = component.getMinimumSize().width - ((colspan - 1) * hgap); if (currentMinimumColWidth < wantedMinimumColWidth) { redistributeSpace(currentMinimumColWidth, wantedMinimumColWidth, fromCol,toCol, minimumColWidths, minimumColWidths, maximumColWidths); } int wantedPreferredColWidth = component.getPreferredSize().width - ((colspan - 1) * hgap); if (currentPreferredColWidth < wantedPreferredColWidth) { redistributeSpace(currentPreferredColWidth, wantedPreferredColWidth, fromCol,toCol, preferredColWidths, minimumColWidths, maximumColWidths); } } // correct cases where // minimumColWidths[col] <= preferredColWidths[col] <= maximumColWidths[col] // is not true by clipping to the minimumColWidths and maximumColWidths for (int col=0 ; col<gridSize.width ; col++) { if (minimumColWidths[col] >= maximumColWidths[col]) { maximumColWidths[col] = minimumColWidths[col]; preferredColWidths[col] = minimumColWidths[col]; } else if (preferredColWidths[col] < minimumColWidths[col]) { preferredColWidths[col] = minimumColWidths[col]; } else if (preferredColWidths[col] > maximumColWidths[col]) { preferredColWidths[col] = maximumColWidths[col]; } } // correct cases where // minimumRowHeights[row] <= preferredRowHeights[row] <= maximumRowHeights[row] // is not true by clipping to the minimumRowHeights and maximumRowHeights for (int row=0 ; row<gridSize.height ; row++) { if (minimumRowHeights[row] >= maximumRowHeights[row]) { maximumRowHeights[row] = minimumRowHeights[row]; preferredRowHeights[row] = minimumRowHeights[row]; } else if (preferredRowHeights[row] < minimumRowHeights[row]) { preferredRowHeights[row] = minimumRowHeights[row]; } else if (preferredRowHeights[row] > maximumRowHeights[row]) { preferredRowHeights[row] = maximumRowHeights[row]; } } // plug in the rowspans and correct the minimum, preferred and // maximum row heights the rowspans are part of for (ExtendedGridLayoutConstraints cell : rowspans) { int fromRow = cell.getRow(); int rowspan = cell.getEffectiveRowspan(); int toRow = fromRow + rowspan; int currentMinimumRowHeight = 0; int currentPreferredRowHeight = 0; int currentMaximumRowHeight = 0; for (int row=fromRow ; row<toRow ; row++) { int minimumRowHeight = minimumRowHeights[row]; if ((Integer.MAX_VALUE-minimumRowHeight) < currentMinimumRowHeight) { currentMinimumRowHeight = Integer.MAX_VALUE; } else { currentMinimumRowHeight += minimumRowHeight; } int preferredRowHeight = preferredRowHeights[row]; if ((Integer.MAX_VALUE-preferredRowHeight) < currentPreferredRowHeight) { currentPreferredRowHeight = Integer.MAX_VALUE; } else { currentPreferredRowHeight += preferredRowHeight; } int maximumRowHeight = maximumRowHeights[row]; if ((Integer.MAX_VALUE-maximumRowHeight) < currentMaximumRowHeight) { currentMaximumRowHeight = Integer.MAX_VALUE; } else { currentMaximumRowHeight += maximumRowHeight; } } Component component = cell.getComponent(); int wantedMaximumRowHeight = component.getMaximumSize().height - ((rowspan - 1) * vgap); if (currentMaximumRowHeight < wantedMaximumRowHeight) { redistributeSpace(currentMaximumRowHeight, wantedMaximumRowHeight, fromRow,toRow, maximumRowHeights, maximumRowHeights, maximumRowHeights); } int wantedMinimumRowHeight = component.getMinimumSize().height - ((rowspan - 1) * vgap); if (currentMinimumRowHeight < wantedMinimumRowHeight) { redistributeSpace(currentMinimumRowHeight, wantedMinimumRowHeight, fromRow,toRow, minimumRowHeights, minimumRowHeights, maximumRowHeights); } int wantedPreferredRowHeight = component.getPreferredSize().height - ((rowspan - 1) * vgap); if (currentPreferredRowHeight < wantedPreferredRowHeight) { redistributeSpace(currentPreferredRowHeight, wantedPreferredRowHeight, fromRow,toRow, preferredRowHeights, minimumRowHeights, maximumRowHeights); } } // correct cases where // minimumRowHeights[row] <= preferredRowHeights[row] <= maximumRowHeights[row] // is not true by clipping to the minimumRowHeights and maximumRowHeights for (int row=0 ; row<gridSize.height ; row++) { if (minimumRowHeights[row] >= maximumRowHeights[row]) { maximumRowHeights[row] = minimumRowHeights[row]; preferredRowHeights[row] = minimumRowHeights[row]; } else if (preferredRowHeights[row] < minimumRowHeights[row]) { preferredRowHeights[row] = minimumRowHeights[row]; } else if (preferredRowHeights[row] > maximumRowHeights[row]) { preferredRowHeights[row] = maximumRowHeights[row]; } } // copies the computed sizes to the result arrays if (fillRawSizes) { resultArrays[0] = minimumColWidths; resultArrays[1] = minimumRowHeights; resultArrays[2] = preferredColWidths; resultArrays[3] = preferredRowHeights; resultArrays[4] = maximumColWidths; resultArrays[5] = maximumRowHeights; } // sums up the sizes for return value int[] colWidths; int[] rowHeights; switch (layoutSize) { case MINIMUM: colWidths = minimumColWidths; rowHeights = minimumRowHeights; break; case PREFERRED: colWidths = preferredColWidths; rowHeights = preferredRowHeights; break; case MAXIMUM: colWidths = maximumColWidths; rowHeights = maximumRowHeights; break; default: throw new InternalError("Missing case branch for LayoutSize: " + layoutSize); } long totalWidth = 0; long totalHeight = 0; for (int width : colWidths) { totalWidth += width; } for (int height : rowHeights) { totalHeight += height; } // add space between components or between // componetns and the borders of the parent container if (!fillRawSizes) { Insets insets = parent.getInsets(); totalWidth += insets.left + insets.right + ((gridSize.width - 1) * hgap) + distanceToBorders.left + distanceToBorders.right; totalHeight += insets.top + insets.bottom + ((gridSize.height - 1) * vgap) + distanceToBorders.top + distanceToBorders.bottom; } // clip the size to Integer.MAX_VALUE if too big if (totalWidth > Integer.MAX_VALUE) { totalWidth = Integer.MAX_VALUE; } if (totalHeight > Integer.MAX_VALUE) { totalHeight = Integer.MAX_VALUE; } return new Dimension((int)totalWidth,(int)totalHeight); }
// in org/gjt/sp/jedit/gui/DockablePanel.java
private int getAppropriateCursor() { String position = panel.getPosition(); if(position.equals(DockableWindowManager.TOP)) return Cursor.N_RESIZE_CURSOR; else if(position.equals(DockableWindowManager.LEFT)) return Cursor.W_RESIZE_CURSOR; else if(position.equals(DockableWindowManager.BOTTOM)) return Cursor.S_RESIZE_CURSOR; else if(position.equals(DockableWindowManager.RIGHT)) return Cursor.E_RESIZE_CURSOR; else throw new InternalError(); }
// in org/gjt/sp/jedit/gui/ToolBarManager.java
public void addToolBar(int group, int layer, Component toolbar) { Entry entry = new Entry(layer, toolbar); if (group == View.TOP_GROUP) addToolBar(top, topToolBars, entry); else if (group == View.BOTTOM_GROUP) addToolBar(bottom, bottomToolBars, entry); else throw new InternalError("Invalid tool bar group"); }
// in org/gjt/sp/jedit/gui/ContextAddDialog.java
public String getSelection() { if(!isOK) return null; if(separator.isSelected()) return "-"; else if(action.isSelected()) { AbstractContextOptionPane.MenuItem selectedValue = (AbstractContextOptionPane.MenuItem) list.getSelectedValue(); return selectedValue == null ? null : selectedValue.actionName; } else throw new InternalError(); }
// in org/gjt/sp/jedit/gui/JCheckBoxList.java
public Object getValueAt(int row, int col) { JCheckBoxList.Entry entry = items.get(row); switch(col) { case 0: return Boolean.valueOf(entry.checked); case 1: return entry.value; default: throw new InternalError(); } }
// in org/gjt/sp/jedit/gui/JCheckBoxList.java
Override public Class getColumnClass(int col) { switch(col) { case 0: return Boolean.class; case 1: return String.class; default: throw new InternalError(); } }
// in org/gjt/sp/jedit/gui/DockableWindowFactory.java
Override public void endElement(String uri, String localName, String name) { if(name == null) return; String tag = peekElement(); if(name.equals(tag)) { if(tag.equals("DOCKABLE")) { registerDockableWindow(plugin, dockableName,code.toString(),actions, movable); cachedDockableNames.add(dockableName); cachedDockableActionFlags.add( Boolean.valueOf(actions)); cachedDockableMovableFlags.add( Boolean.valueOf(movable)); // make default be true for the next // action actions = true; movable = MOVABLE_DEFAULT; code.setLength(0); } popElement(); } else { // can't happen throw new InternalError(); } }
// in org/gjt/sp/jedit/ActionListHandler.java
Override public void endElement(String uri, String localName, String qName) { String tag = peekElement(); if (qName.equals(tag)) { if (tag.equals("ACTION")) { String selected = (isSelected.length() > 0) ? isSelected.toString() : null; JEditAbstractEditAction action = actionSet.createBeanShellAction(actionName, code.toString(), selected, noRepeat, noRecord, noRememberLast); actionSet.addAction(action); noRepeat = noRecord = noRememberLast = false; code.setLength(0); isSelected.setLength(0); } popElement(); } else { // can't happen throw new InternalError(); } }
// in org/gjt/sp/jedit/OptionGroup.java
private void insertionSort(String newLabel, Object newObj) { if(sort) { for(int i = 0; i < members.size(); i++) { Object obj = members.elementAt(i); String label; if(obj instanceof OptionPane) { String name = ((OptionPane)obj).getName(); label = jEdit.getProperty("options." + name + ".label","NO LABEL PROPERTY: " + name); } else if(obj instanceof String) { label = jEdit.getProperty("options." + obj + ".label","NO LABEL PROPERTY: " + obj); } else if(obj instanceof OptionGroup) label = ((OptionGroup)obj).getLabel(); else throw new InternalError(); if(newLabel.compareToIgnoreCase(label) < 0) { members.insertElementAt(newObj,i); return; } } } members.addElement(newObj); }
// in org/gjt/sp/jedit/jEdit.java
Override public void run() { int pos; // Handle line number if(marker.startsWith("+line:")) { try { String arg = marker.substring(6); String[] lineCol = arg.split(","); int line, col; if(lineCol.length > 1) { line = Integer.parseInt(lineCol[0]); col = Integer.parseInt(lineCol[1]); } else { line = Integer.parseInt(marker.substring(6)); col = 1; } pos = buffer.getLineStartOffset(line - 1) + (col - 1); } catch(Exception e) { return; } } // Handle marker else if(marker.startsWith("+marker:")) { if(marker.length() != 9) return; Marker m = buffer.getMarker(marker.charAt(8)); if(m == null) return; pos = m.getPosition(); } // Can't happen else throw new InternalError(); if(view != null && view.getBuffer() == buffer) { view.getTextArea().setCaretPosition(pos); buffer.setIntegerProperty(Buffer.CARET,pos); buffer.setBooleanProperty(Buffer.CARET_POSITIONED,true); } else { buffer.setIntegerProperty(Buffer.CARET,pos); buffer.setBooleanProperty(Buffer.CARET_POSITIONED,true); buffer.unsetProperty(Buffer.SCROLL_VERT); } }
// in org/gjt/sp/jedit/buffer/UndoManager.java
public int undo() { if(insideCompoundEdit()) throw new InternalError("Unbalanced begin/endCompoundEdit()"); if(undosLast == null) return -1; else { reviseUndoId(); undoCount--; int caret = undosLast.undo(); redosFirst = undosLast; undosLast = undosLast.prev; if(undosLast == null) undosFirst = null; return caret; } }
// in org/gjt/sp/jedit/buffer/UndoManager.java
public int redo() { if(insideCompoundEdit()) throw new InternalError("Unbalanced begin/endCompoundEdit()"); if(redosFirst == null) return -1; else { reviseUndoId(); undoCount++; int caret = redosFirst.redo(); undosLast = redosFirst; if(undosFirst == null) undosFirst = undosLast; redosFirst = redosFirst.next; return caret; } }
// in org/gjt/sp/jedit/options/BrowserColorsOptionPane.java
public Class getColumnClass(int col) { switch(col) { case 0: return String.class; case 1: return Color.class; default: throw new InternalError(); } }
// in org/gjt/sp/jedit/options/DockingOptionPane.java
public Class getColumnClass(int col) { switch(col) { case 0: case 1: return String.class; default: throw new InternalError(); } }
// in org/gjt/sp/jedit/options/DockingOptionPane.java
public Object getValueAt(int row, int col) { Entry window = (Entry)windows.elementAt(row); switch(col) { case 0: return window.title; case 1: return window.dockPosition; default: throw new InternalError(); } }
// in org/gjt/sp/jedit/options/DockingOptionPane.java
public void setValueAt(Object value, int row, int col) { if(col == 0) return; Entry window = (Entry)windows.elementAt(row); switch(col) { case 1: window.dockPosition = (String)value; break; default: throw new InternalError(); } fireTableRowsUpdated(row,row); }
// in org/gjt/sp/jedit/options/DockingOptionPane.java
public String getColumnName(int index) { switch(index) { case 0: return jEdit.getProperty("options.docking.title"); case 1: return jEdit.getProperty("options.docking.dockPosition"); default: throw new InternalError(); } }
// in org/gjt/sp/jedit/options/ToolBarOptionPane.java
public ToolBarOptionPane.Button getSelection() { if(!isOK) return null; if(separator.isSelected()) return new ToolBarOptionPane.Button("-",null,null,"-"); else { Icon icon; String iconName; if(builtin.isSelected()) { ToolBarOptionPane.IconListEntry selectedIcon = (ToolBarOptionPane.IconListEntry) builtinCombo.getSelectedItem(); icon = selectedIcon.icon; iconName = selectedIcon.name; } else { icon = fileButton.getIcon(); iconName = fileIcon; if(iconName == null) iconName = "Blank24.gif"; } String label; String actionName; if(action.isSelected()) { ToolBarOptionPane.Button button = (ToolBarOptionPane.Button)list .getSelectedValue(); label = button.label; actionName = button.actionName; } else throw new InternalError(); return new ToolBarOptionPane.Button(actionName, iconName,icon,label); } }
// in org/gjt/sp/jedit/options/BufferOptionPane.java
Override protected void _save() { int index = lineSeparator.getSelectedIndex(); String lineSep; if(index == 0) lineSep = "\n"; else if(index == 1) lineSep = "\r\n"; else if(index == 2) lineSep = "\r"; else throw new InternalError(); String oldLineSep = buffer.getStringProperty(JEditBuffer.LINESEP); if(oldLineSep == null) oldLineSep = System.getProperty("line.separator"); if(!oldLineSep.equals(lineSep)) { buffer.setStringProperty(JEditBuffer.LINESEP, lineSep); buffer.setDirty(true); } String encoding = (String)this.encoding.getSelectedItem(); String oldEncoding = buffer.getStringProperty(JEditBuffer.ENCODING); if(!oldEncoding.equals(encoding)) { buffer.setStringProperty(JEditBuffer.ENCODING,encoding); buffer.setDirty(true); // Disable auto-detect because user explicitly // specify an encoding. buffer.setBooleanProperty(Buffer.ENCODING_AUTODETECT,false); } boolean gzippedValue = gzipped.isSelected(); boolean oldGzipped = buffer.getBooleanProperty( Buffer.GZIPPED); if(gzippedValue != oldGzipped) { buffer.setBooleanProperty(Buffer.GZIPPED,gzippedValue); buffer.setDirty(true); } buffer.setStringProperty("folding",(String)folding.getSelectedItem()); buffer.setStringProperty("wrap",(String)wrap.getSelectedItem()); try { buffer.setProperty("maxLineLen",new Integer( maxLineLen.getSelectedItem().toString())); } catch(NumberFormatException nf) { } try { buffer.setProperty("tabSize",new Integer( tabSize.getSelectedItem().toString())); } catch(NumberFormatException nf) { } try { buffer.setProperty("indentSize",new Integer( indentSize.getSelectedItem().toString())); } catch(NumberFormatException nf) { } buffer.setBooleanProperty("noTabs",noTabs.isSelected()); buffer.setBooleanProperty("elasticTabstops",elasticTabstops.isSelected()); buffer.setStringProperty("autoIndent", (String)autoIndent.getSelectedItem()); index = mode.getSelectedIndex(); buffer.setMode(modes[index]); switch(checkModStatus.getSelectedIndex()) { case 0: buffer.setAutoReloadDialog(false); buffer.setAutoReload(false); break; case 1: buffer.setAutoReloadDialog(true); buffer.setAutoReload(false); break; case 2: buffer.setAutoReloadDialog(true); buffer.setAutoReload(true); break; case 3: buffer.setAutoReloadDialog(false); buffer.setAutoReload(true); break; } }
// in org/gjt/sp/jedit/textarea/TextArea.java
public void setSelectedText(Selection s, String selectedText) { if(!isEditable()) { throw new InternalError("Text component" + " read only"); } try { buffer.beginCompoundEdit(); moveCaretPosition(s.setText(buffer,selectedText)); } // No matter what happends... stops us from leaving buffer // in a bad state finally { buffer.endCompoundEdit(); } // no no no!!!! //selectNone(); }
// in org/gjt/sp/jedit/textarea/Selection.java
Override public Object clone() { try { return super.clone(); } catch(CloneNotSupportedException e) { throw new InternalError("I just drank a whole " + "bottle of cough syrup and I feel " + "funny!"); } }
// in org/gjt/sp/jedit/textarea/RangeMap.java
void put(int start, int end, int[] put) { if(Debug.FOLD_VIS_DEBUG) { StringBuilder buf = new StringBuilder(50); buf.append("fvmput(").append(start).append(','); buf.append(end).append(','); buf.append('{'); if(put != null) { for(int i = 0; i < put.length; i++) { if(i != 0) buf.append(','); buf.append(put[i]); } } buf.append("})"); Log.log(Log.DEBUG,this,buf.toString()); } int putl = put == null ? 0 : put.length; int delta = putl - (end - start); if(fvmcount + delta > fvm.length) { int[] newfvm = new int[(fvm.length << 1) + 1]; System.arraycopy(fvm,0,newfvm,0,fvmcount); fvm = newfvm; } if(delta != 0) { System.arraycopy(fvm,end,fvm,start + putl, fvmcount - end); } if(putl != 0) { System.arraycopy(put,0,fvm,start,put.length); } fvmcount += delta; dump(); if(fvmcount == 0) throw new InternalError(); }
// in org/gjt/sp/jedit/textarea/BufferHandler.java
public void transactionComplete(JEditBuffer buffer) { if(textArea.getDisplayManager() != displayManager) { delayedUpdate = false; return; } if(delayedUpdate) doDelayedUpdate(); textArea._finishCaretUpdate(); delayedUpdate = false; //{{{ Debug code if(Debug.SCROLL_VERIFY) { int line = delayedUpdateStart; if(!displayManager.isLineVisible(line)) line = displayManager.getNextVisibleLine(line); System.err.println(delayedUpdateStart + ":" + delayedUpdateEnd + ':' + textArea.getLineCount()); int scrollLineCount = 0; while(line != -1 && line <= delayedUpdateEnd) { scrollLineCount += displayManager.getScreenLineCount(line); line = displayManager.getNextVisibleLine(line); } if(scrollLineCount != displayManager.getScrollLineCount()) { throw new InternalError(scrollLineCount + " != " + displayManager.getScrollLineCount()); } } //}}} }
// in org/gjt/sp/jedit/syntax/XModeHandler.java
public void endElement(String uri, String localName, String name) { TagDecl tag = popElement(); if (name.equals(tag.tagName)) { if(tag.lastDelegateSet != null && ! tag.tagName.equals("IMPORT") && ! tag.lastDelegateSet.getModeName().equals(modeName)) { Mode mode = ModeProvider.instance.getMode(tag.lastDelegateSet.getModeName()); if( ! reloadModes.contains(mode) ) { reloadModes.add(mode); } } //{{{ PROPERTY if (tag.tagName.equals("PROPERTY")) { props.put(propName,propValue); } //}}} //{{{ PROPS else if (tag.tagName.equals("PROPS")) { if(peekElement().tagName.equals("RULES")) rules.setProperties(props); else modeProps = props; props = new Hashtable<String, String>(); } //}}} //{{{ RULES else if (tag.tagName.equals("RULES")) { rules.setKeywords(keywords); keywords = null; rules = null; } //}}} //{{{ IMPORT else if (tag.tagName.equals("IMPORT")) { // prevent lockups if (!rules.equals(tag.lastDelegateSet)) { rules.addRuleSet(tag.lastDelegateSet); } } //}}} //{{{ TERMINATE else if (tag.tagName.equals("TERMINATE")) { rules.setTerminateChar(tag.termChar); } //}}} //{{{ SEQ else if (tag.tagName.equals("SEQ")) { if(tag.lastStart == null) { error("empty-tag","SEQ"); return; } rules.addRule(ParserRule.createSequenceRule( tag.lastStartPosMatch,tag.lastStart.toString(), tag.lastDelegateSet,tag.lastTokenID)); } //}}} //{{{ SEQ_REGEXP else if (tag.tagName.equals("SEQ_REGEXP")) { if(tag.lastStart == null) { error("empty-tag","SEQ_REGEXP"); return; } try { if (null != tag.lastHashChars) { rules.addRule(ParserRule.createRegexpSequenceRule( tag.lastStartPosMatch,tag.lastHashChars.toCharArray(), tag.lastStart.toString(),tag.lastDelegateSet, tag.lastTokenID,findParent("RULES").lastIgnoreCase)); } else { rules.addRule(ParserRule.createRegexpSequenceRule( tag.lastHashChar,tag.lastStartPosMatch, tag.lastStart.toString(),tag.lastDelegateSet, tag.lastTokenID,findParent("RULES").lastIgnoreCase)); } } catch(PatternSyntaxException re) { error("regexp",re); } } //}}} //{{{ SPAN else if (tag.tagName.equals("SPAN")) { if(tag.lastStart == null) { error("empty-tag","BEGIN"); return; } if(tag.lastEnd == null) { error("empty-tag","END"); return; } rules.addRule(ParserRule .createSpanRule( tag.lastStartPosMatch,tag.lastStart.toString(), tag.lastEndPosMatch,tag.lastEnd.toString(), tag.lastDelegateSet, tag.lastTokenID,tag.lastMatchType, tag.lastNoLineBreak, tag.lastNoWordBreak, tag.lastEscape)); } //}}} //{{{ SPAN_REGEXP else if (tag.tagName.equals("SPAN_REGEXP")) { if(tag.lastStart == null) { error("empty-tag","BEGIN"); return; } if(tag.lastEnd == null) { error("empty-tag","END"); return; } try { if (null != tag.lastHashChars) { rules.addRule(ParserRule .createRegexpSpanRule( tag.lastStartPosMatch,tag.lastHashChars.toCharArray(), tag.lastStart.toString(), tag.lastEndPosMatch,tag.lastEnd.toString(), tag.lastDelegateSet, tag.lastTokenID, tag.lastMatchType, tag.lastNoLineBreak, tag.lastNoWordBreak, findParent("RULES").lastIgnoreCase, tag.lastEscape, tag.lastEndRegexp)); } else { rules.addRule(ParserRule .createRegexpSpanRule( tag.lastHashChar, tag.lastStartPosMatch,tag.lastStart.toString(), tag.lastEndPosMatch,tag.lastEnd.toString(), tag.lastDelegateSet, tag.lastTokenID, tag.lastMatchType, tag.lastNoLineBreak, tag.lastNoWordBreak, findParent("RULES").lastIgnoreCase, tag.lastEscape, tag.lastEndRegexp)); } } catch(PatternSyntaxException re) { error("regexp",re); } } //}}} //{{{ EOL_SPAN else if (tag.tagName.equals("EOL_SPAN")) { if(tag.lastStart == null) { error("empty-tag","EOL_SPAN"); return; } rules.addRule(ParserRule.createEOLSpanRule( tag.lastStartPosMatch,tag.lastStart.toString(), tag.lastDelegateSet,tag.lastTokenID, tag.lastMatchType)); } //}}} //{{{ EOL_SPAN_REGEXP else if (tag.tagName.equals("EOL_SPAN_REGEXP")) { if(tag.lastStart == null) { error("empty-tag","EOL_SPAN_REGEXP"); return; } try { if (null != tag.lastHashChars) { rules.addRule(ParserRule.createRegexpEOLSpanRule( tag.lastStartPosMatch,tag.lastHashChars.toCharArray(), tag.lastStart.toString(),tag.lastDelegateSet, tag.lastTokenID,tag.lastMatchType, findParent("RULES").lastIgnoreCase)); } else { rules.addRule(ParserRule.createRegexpEOLSpanRule( tag.lastHashChar,tag.lastStartPosMatch, tag.lastStart.toString(),tag.lastDelegateSet, tag.lastTokenID,tag.lastMatchType, findParent("RULES").lastIgnoreCase)); } } catch(PatternSyntaxException re) { error("regexp",re); } } //}}} //{{{ MARK_FOLLOWING else if (tag.tagName.equals("MARK_FOLLOWING")) { if(tag.lastStart == null) { error("empty-tag","MARK_FOLLOWING"); return; } rules.addRule(ParserRule .createMarkFollowingRule( tag.lastStartPosMatch,tag.lastStart.toString(), tag.lastTokenID,tag.lastMatchType)); } //}}} //{{{ MARK_PREVIOUS else if (tag.tagName.equals("MARK_PREVIOUS")) { if(tag.lastStart == null) { error("empty-tag","MARK_PREVIOUS"); return; } rules.addRule(ParserRule .createMarkPreviousRule( tag.lastStartPosMatch,tag.lastStart.toString(), tag.lastTokenID,tag.lastMatchType)); } //}}} //{{{ Keywords else if ( !tag.tagName.equals("END") && !tag.tagName.equals("BEGIN") && !tag.tagName.equals("KEYWORDS") && !tag.tagName.equals("MODE")) { byte token = Token.stringToToken(tag.tagName); if(token != -1) { if (tag.lastKeyword == null || tag.lastKeyword.length() == 0) { error("empty-keyword", null); } else { addKeyword(tag.lastKeyword.toString(),token); } } } //}}} } else { // can't happen throw new InternalError(); } }
// in org/gjt/sp/jedit/syntax/TokenMarker.java
private boolean handleRuleStart(ParserRule checkRule) { // Some rules can only match in certain locations if (null == checkRule.upHashChars) { if (checkRule.upHashChar != null && (pos + checkRule.upHashChar.length < line.array.length) && !checkHashString(checkRule)) { return false; } } else { if (-1 == Arrays.binarySearch( checkRule.upHashChars, Character.toUpperCase(line.array[pos]))) { return false; } } int offset = (checkRule.action & ParserRule.MARK_PREVIOUS) != 0 ? lastOffset : pos; if(!offsetMatches(offset, checkRule.startPosMatch)) { return false; } int matchedChars; Matcher match = null; // See if the rule's start sequence matches here if((checkRule.action & ParserRule.REGEXP) == 0) { pattern.array = checkRule.start; pattern.offset = 0; pattern.count = pattern.array.length; matchedChars = pattern.count; if(!SyntaxUtilities.regionMatches(context.rules .getIgnoreCase(),line,pos,pattern.array)) { return false; } } else { // note that all regexps start with \A so they only // match the start of the string //int matchStart = pos - line.offset; CharSequence charSeq = new SegmentCharSequence(line, pos - line.offset, line.count - (pos - line.offset)); match = checkRule.startRegexp.matcher(charSeq); if(!match.lookingAt()) { return false; } else if(match.start() != 0) { throw new InternalError("Can't happen"); } else { matchedChars = match.end(); /* workaround for hang if match was * zero-width. not sure if there is * a better way to handle this */ if(matchedChars == 0) matchedChars = 1; } } if((checkRule.action & ParserRule.IS_ESCAPE) == ParserRule.IS_ESCAPE) { pos += pattern.count; } else { if(context.inRule != null) handleRuleEnd(context.inRule); markKeyword((checkRule.action & ParserRule.MARK_PREVIOUS) != ParserRule.MARK_PREVIOUS); switch(checkRule.action & ParserRule.MAJOR_ACTIONS) { //{{{ SEQ case ParserRule.SEQ: context.spanEndSubst = null; context.spanEndSubstRegex = null; if((checkRule.action & ParserRule.REGEXP) != 0) { handleTokenWithSpaces(tokenHandler, checkRule.token, pos - line.offset, matchedChars, context); } else { tokenHandler.handleToken(line, checkRule.token, pos - line.offset, matchedChars,context); } // a DELEGATE attribute on a SEQ changes the // ruleset from the end of the SEQ onwards if(checkRule.delegate != null) { context = new LineContext( checkRule.delegate, context.parent); keywords = context.rules.getKeywords(); } break; //}}} //{{{ SPAN, EOL_SPAN case ParserRule.SPAN: case ParserRule.EOL_SPAN: context.setInRule(checkRule); byte tokenType = matchToken(checkRule, context.inRule, context); if((checkRule.action & ParserRule.REGEXP) != 0) { handleTokenWithSpaces(tokenHandler, tokenType, pos - line.offset, matchedChars, context); } else { tokenHandler.handleToken(line,tokenType, pos - line.offset, matchedChars,context); } char[] spanEndSubst = null; Pattern spanEndSubstRegex = null; /* substitute result of matching the rule start * into the end string. * * eg, in shell script mode, <<\s*(\w+) is * matched into \<$1\> to construct rules for * highlighting read-ins like this <<EOF * ... * EOF */ if(match != null && match.groupCount() > 0) { if (checkRule.end != null) { spanEndSubst = substitute(match, checkRule.end, false); } else if (checkRule.endRegexp != null) { char[] pattern = checkRule.endRegexp.pattern().toCharArray(); pattern = substitute(match, pattern, true); spanEndSubstRegex = Pattern.compile(new String(pattern)); } } context.spanEndSubst = spanEndSubst; context.spanEndSubstRegex = spanEndSubstRegex; context = new LineContext( checkRule.delegate, context); keywords = context.rules.getKeywords(); break; //}}} //{{{ MARK_FOLLOWING case ParserRule.MARK_FOLLOWING: tokenHandler.handleToken(line, matchToken(checkRule, checkRule, context), pos - line.offset, pattern.count,context); context.spanEndSubst = null; context.spanEndSubstRegex = null; context.setInRule(checkRule); break; //}}} //{{{ MARK_PREVIOUS case ParserRule.MARK_PREVIOUS: context.spanEndSubst = null; context.spanEndSubstRegex = null; if(pos != lastOffset) { tokenHandler.handleToken(line, checkRule.token, lastOffset - line.offset, pos - lastOffset, context); } tokenHandler.handleToken(line, matchToken(checkRule, checkRule, context), pos - line.offset,pattern.count, context); break; //}}} default: throw new InternalError("Unhandled major action"); } // move pos to last character of match sequence pos += matchedChars - 1; lastOffset = pos + 1; // break out of inner for loop to check next char } return true; }
// in org/gjt/sp/jedit/ServiceListHandler.java
public void endElement(String uri, String localName, String name) { String tag = peekElement(); if(name.equals(tag)) { if (tag.equals("SERVICE")) { ServiceManager.Descriptor d = new ServiceManager.Descriptor( serviceClass,serviceName,code.toString(),plugin); ServiceManager.registerService(d); cachedServices.add(d); code.setLength(0); } popElement(); } else { // can't happen throw new InternalError(); } }
// in org/gjt/sp/util/WorkThreadPool.java
Request getNextRequest() { synchronized(lock) { Request request = firstRequest; if(request == null) return null; firstRequest = firstRequest.next; if(firstRequest == null) lastRequest = null; if(request.alreadyRun) throw new InternalError("AIEE!!! Request run twice!!! " + request.run); request.alreadyRun = true; /* StringBuffer buf = new StringBuffer("request queue is now: "); Request _request = request.next; while(_request != null) { buf.append(_request.id); if(_request.next != null) buf.append(","); _request = _request.next; } Log.log(Log.DEBUG,this,buf.toString()); */ return request; } }
// in org/gjt/sp/util/WorkThreadPool.java
private Request getNextAWTRequest() { Request request = firstAWTRequest; firstAWTRequest = firstAWTRequest.next; if(firstAWTRequest == null) lastAWTRequest = null; if(request.alreadyRun) throw new InternalError("AIEE!!! Request run twice!!! " + request.run); request.alreadyRun = true; /* StringBuffer buf = new StringBuffer("AWT request queue is now: "); Request _request = request.next; while(_request != null) { buf.append(_request.id); if(_request.next != null) buf.append(","); _request = _request.next; } Log.log(Log.DEBUG,this,buf.toString()); */ return request; }
3
              
// in org/gjt/sp/jedit/View.java
catch(IOException e) { // this should never throw an exception. throw new InternalError(); }
// in org/gjt/sp/jedit/textarea/Selection.java
catch(CloneNotSupportedException e) { throw new InternalError("I just drank a whole " + "bottle of cough syrup and I feel " + "funny!"); }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { throw new InternalError("Missing or invalid glob for handler " + name); }
0
(Lib) ArrayIndexOutOfBoundsException 27
              
// in org/gjt/sp/jedit/buffer/PositionManager.java
void contentInserted(int offset, int length) { if(offset > this.offset) throw new ArrayIndexOutOfBoundsException(); this.offset += length; checkInvariants(); }
// in org/gjt/sp/jedit/buffer/PositionManager.java
void contentRemoved(int offset, int length) { if(offset > this.offset) throw new ArrayIndexOutOfBoundsException(); if(this.offset <= offset + length) this.offset = offset; else this.offset -= length; checkInvariants(); }
// in org/gjt/sp/jedit/buffer/PositionManager.java
private void checkInvariants() { if(offset < 0 || offset > buffer.getLength()) throw new ArrayIndexOutOfBoundsException(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public int getLineOfOffset(int offset) { try { readLock(); if(offset < 0 || offset > getLength()) throw new ArrayIndexOutOfBoundsException(offset); return lineMgr.getLineOfOffset(offset); } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public int getLineStartOffset(int line) { try { readLock(); if(line < 0 || line >= lineMgr.getLineCount()) throw new ArrayIndexOutOfBoundsException(line); else if(line == 0) return 0; return lineMgr.getLineEndOffset(line - 1); } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public int getLineEndOffset(int line) { try { readLock(); if(line < 0 || line >= lineMgr.getLineCount()) throw new ArrayIndexOutOfBoundsException(line); return lineMgr.getLineEndOffset(line); } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public String getLineText(int line) { if(line < 0 || line >= lineMgr.getLineCount()) throw new ArrayIndexOutOfBoundsException(line); try { readLock(); int start = line == 0 ? 0 : lineMgr.getLineEndOffset(line - 1); int end = lineMgr.getLineEndOffset(line); return getText(start,end - start - 1); } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public void getLineText(int line,int relativeStartOffset, Segment segment) { if(line < 0 || line >= lineMgr.getLineCount()) throw new ArrayIndexOutOfBoundsException(line); try { readLock(); int start = (line == 0 ? 0 : lineMgr.getLineEndOffset(line - 1)); int end = lineMgr.getLineEndOffset(line); if((start+relativeStartOffset)>end) { throw new IllegalArgumentException("This index is outside the line length (start+relativeOffset):"+start+" + "+relativeStartOffset+" > "+"endffset:"+end); } else { getText(start+relativeStartOffset,end - start -relativeStartOffset- 1,segment); } } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public CharSequence getLineSegment(int line) { if(line < 0 || line >= lineMgr.getLineCount()) throw new ArrayIndexOutOfBoundsException(line); try { readLock(); int start = line == 0 ? 0 : lineMgr.getLineEndOffset(line - 1); int end = lineMgr.getLineEndOffset(line); return getSegment(start,end - start - 1); } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public String getText(int start, int length) { try { readLock(); if(start < 0 || length < 0 || start + length > contentMgr.getLength()) throw new ArrayIndexOutOfBoundsException(start + ":" + length); return contentMgr.getText(start,length); } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public void getText(int start, int length, Segment seg) { try { readLock(); if(start < 0 || length < 0 || start + length > contentMgr.getLength()) throw new ArrayIndexOutOfBoundsException(start + ":" + length); contentMgr.getText(start,length,seg); } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public CharSequence getSegment(int start, int length) { try { readLock(); if(start < 0 || length < 0 || start + length > contentMgr.getLength()) throw new ArrayIndexOutOfBoundsException(start + ":" + length); return contentMgr.getSegment(start,length); } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public void insert(int offset, CharSequence seq) { if(seq == null) return; int len = seq.length(); if(len == 0) return; if(isReadOnly()) throw new RuntimeException("buffer read-only"); try { writeLock(); if(offset < 0 || offset > contentMgr.getLength()) throw new ArrayIndexOutOfBoundsException(offset); contentMgr.insert(offset,seq); integerArray.clear(); for(int i = 0; i < len; i++) { if(seq.charAt(i) == '\n') integerArray.add(i + 1); } if(!undoInProgress) { undoMgr.contentInserted(offset,len, seq.toString(),!dirty); } contentInserted(offset,len,integerArray); } finally { writeUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public void remove(int offset, int length) { if(length == 0) return; if(isReadOnly()) throw new RuntimeException("buffer read-only"); try { transaction = true; writeLock(); if(offset < 0 || length < 0 || offset + length > contentMgr.getLength()) throw new ArrayIndexOutOfBoundsException(offset + ":" + length); int startLine = lineMgr.getLineOfOffset(offset); int endLine = lineMgr.getLineOfOffset(offset + length); int numLines = endLine - startLine; if(!undoInProgress && !loading) { undoMgr.contentRemoved(offset,length, getText(offset,length), !dirty); } firePreContentRemoved(startLine,offset,numLines,length); contentMgr.remove(offset,length); lineMgr.contentRemoved(startLine,offset,numLines,length); positionMgr.contentRemoved(offset,length); setDirty(true); fireContentRemoved(startLine,offset,numLines,length); /* otherwise it will be delivered later */ if(!undoInProgress && !insideCompoundEdit()) fireTransactionComplete(); } finally { transaction = false; writeUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public void markTokens(int lineIndex, TokenHandler tokenHandler) { Segment seg = new Segment(); if(lineIndex < 0 || lineIndex >= lineMgr.getLineCount()) throw new ArrayIndexOutOfBoundsException(lineIndex); int firstInvalidLineContext = lineMgr.getFirstInvalidLineContext(); int start; if(contextInsensitive || firstInvalidLineContext == -1) { start = lineIndex; } else { start = Math.min(firstInvalidLineContext, lineIndex); } if(Debug.TOKEN_MARKER_DEBUG) Log.log(Log.DEBUG,this,"tokenize from " + start + " to " + lineIndex); TokenMarker.LineContext oldContext = null; TokenMarker.LineContext context = null; for(int i = start; i <= lineIndex; i++) { getLineText(i,seg); oldContext = lineMgr.getLineContext(i); TokenMarker.LineContext prevContext = ( (i == 0 || contextInsensitive) ? null : lineMgr.getLineContext(i - 1) ); TokenHandler _tokenHandler = i == lineIndex ? tokenHandler : DummyTokenHandler.INSTANCE; context = markTokens(seg, prevContext, _tokenHandler); lineMgr.setLineContext(i,context); } int lineCount = lineMgr.getLineCount(); if(lineCount - 1 == lineIndex) lineMgr.setFirstInvalidLineContext(-1); else if(oldContext != context) lineMgr.setFirstInvalidLineContext(lineIndex + 1); else if(firstInvalidLineContext == -1) /* do nothing */; else { lineMgr.setFirstInvalidLineContext(Math.max( firstInvalidLineContext,lineIndex + 1)); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public Position createPosition(int offset) { try { readLock(); if(offset < 0 || offset > contentMgr.getLength()) throw new ArrayIndexOutOfBoundsException(offset); return positionMgr.createPosition(offset); } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public int getFoldLevel(int line) { if(line < 0 || line >= lineMgr.getLineCount()) throw new ArrayIndexOutOfBoundsException(line); if(foldHandler instanceof DummyFoldHandler) return 0; int firstInvalidFoldLevel = lineMgr.getFirstInvalidFoldLevel(); if(firstInvalidFoldLevel == -1 || line < firstInvalidFoldLevel) { return lineMgr.getFoldLevel(line); } else { if(Debug.FOLD_DEBUG) Log.log(Log.DEBUG,this,"Invalid fold levels from " + firstInvalidFoldLevel + " to " + line); int newFoldLevel = 0; boolean changed = false; int firstUpdatedFoldLevel = firstInvalidFoldLevel; for(int i = firstInvalidFoldLevel; i <= line; i++) { Segment seg = new Segment(); newFoldLevel = foldHandler.getFoldLevel(this,i,seg); if(newFoldLevel != lineMgr.getFoldLevel(i)) { if(Debug.FOLD_DEBUG) Log.log(Log.DEBUG,this,i + " fold level changed"); changed = true; // Update preceding fold levels if necessary if (i == firstInvalidFoldLevel) { List<Integer> precedingFoldLevels = foldHandler.getPrecedingFoldLevels( this,i,seg,newFoldLevel); if (precedingFoldLevels != null) { int j = i; for (Integer foldLevel: precedingFoldLevels) { j--; lineMgr.setFoldLevel(j,foldLevel.intValue()); } if (j < firstUpdatedFoldLevel) firstUpdatedFoldLevel = j; } } } lineMgr.setFoldLevel(i,newFoldLevel); } if(line == lineMgr.getLineCount() - 1) lineMgr.setFirstInvalidFoldLevel(-1); else lineMgr.setFirstInvalidFoldLevel(line + 1); if(changed) { if(Debug.FOLD_DEBUG) Log.log(Log.DEBUG,this,"fold level changed: " + firstUpdatedFoldLevel + ',' + line); fireFoldLevelChanged(firstUpdatedFoldLevel,line); } return newFoldLevel; } }
// in org/gjt/sp/jedit/buffer/BufferSegment.java
public char charAt(int index) { if (index < len) return data[offset+index]; else if (next != null) return next.charAt(index-len); else throw new ArrayIndexOutOfBoundsException(index); }
// in org/gjt/sp/jedit/buffer/BufferSegment.java
private BufferSegment subSegment(int start, int end) { if (0 <= start && start <= end) if (end <= len) return new BufferSegment(data,offset+start, end-start); else if (next != null) if (start < len) return new BufferSegment(data, offset+start,len-start, next.subSegment(0,end-len)); else return next.subSegment(start-len, end-len); else throw new ArrayIndexOutOfBoundsException(); else throw new ArrayIndexOutOfBoundsException(); }
// in org/gjt/sp/jedit/TextUtilities.java
public static Token getTokenAtOffset(Token tokens, int offset) { if(offset == 0 && tokens.id == Token.END) return tokens; for(;;) { if(tokens.id == Token.END) throw new ArrayIndexOutOfBoundsException("offset > line length"); if(tokens.offset + tokens.length > offset) return tokens; else tokens = tokens.next; } }
// in org/gjt/sp/jedit/TextUtilities.java
public static int findMatchingBracket(JEditBuffer buffer, int line, int offset) { if(offset < 0 || offset >= buffer.getLineLength(line)) { throw new ArrayIndexOutOfBoundsException(offset + ":" + buffer.getLineLength(line)); } Segment lineText = new Segment(); buffer.getLineText(line,lineText); char c = lineText.array[lineText.offset + offset]; // false - backwards, true - forwards boolean[] direction = new boolean[1]; // corresponding character char cprime = getComplementaryBracket(c,direction); if( cprime == '\0' ) { // c is no bracket return -1; } // 1 because we've already 'seen' the first bracket int count = 1; DefaultTokenHandler tokenHandler = new DefaultTokenHandler(); buffer.markTokens(line,tokenHandler); // Get the syntax token at 'offset' // only tokens with the same type will be checked for // the corresponding bracket byte idOfBracket = getTokenAtOffset(tokenHandler.getTokens(),offset).id; boolean haveTokens = true; int startLine = line; //{{{ Forward search if(direction[0]) { offset++; for(;;) { for(int i = offset; i < lineText.count; i++) { char ch = lineText.array[lineText.offset + i]; if(ch == c) { if(!haveTokens) { tokenHandler.init(); buffer.markTokens(line,tokenHandler); haveTokens = true; } if(getTokenAtOffset(tokenHandler.getTokens(),i).id == idOfBracket) count++; } else if(ch == cprime) { if(!haveTokens) { tokenHandler.init(); buffer.markTokens(line,tokenHandler); haveTokens = true; } if(getTokenAtOffset(tokenHandler.getTokens(),i).id == idOfBracket) { count--; if(count == 0) return buffer.getLineStartOffset(line) + i; } } } //{{{ Go on to next line line++; if(line >= buffer.getLineCount() || (line - startLine) > BRACKET_MATCH_LIMIT) break; buffer.getLineText(line,lineText); offset = 0; haveTokens = false; //}}} } } //}}} //{{{ Backward search else { offset--; for(;;) { for(int i = offset; i >= 0; i--) { char ch = lineText.array[lineText.offset + i]; if(ch == c) { if(!haveTokens) { tokenHandler.init(); buffer.markTokens(line,tokenHandler); haveTokens = true; } if(getTokenAtOffset(tokenHandler.getTokens(),i).id == idOfBracket) count++; } else if(ch == cprime) { if(!haveTokens) { tokenHandler.init(); buffer.markTokens(line,tokenHandler); haveTokens = true; } if(getTokenAtOffset(tokenHandler.getTokens(),i).id == idOfBracket) { count--; if(count == 0) return buffer.getLineStartOffset(line) + i; } } } //{{{ Go on to previous line line--; if(line < 0 || (startLine - line) > BRACKET_MATCH_LIMIT) break; buffer.getLineText(line,lineText); offset = lineText.count - 1; haveTokens = false; //}}} } } //}}} // Nothing found return -1; }
// in org/gjt/sp/jedit/textarea/ChunkCache.java
private void updateChunksUpTo(int lastScreenLine) { // this method is a nightmare if(lastScreenLine >= lineInfo.length) throw new ArrayIndexOutOfBoundsException(lastScreenLine); // if one line's chunks are invalid, remaining lines are also // invalid if(lastScreenLine < firstInvalidLine) return; int firstScreenLine = getFirstScreenLine(); int physicalLine = getUpdateStartLine(firstScreenLine); if(Debug.CHUNK_CACHE_DEBUG) { Log.log(Log.DEBUG,this,"Updating chunks from " + firstScreenLine + " to " + lastScreenLine); } // Note that we rely on the fact that when a physical line is // invalidated, all screen lines/subregions of that line are // invalidated as well. See below comment for code that tries // to uphold this assumption. out.clear(); int offset; int length; for(int i = firstScreenLine; i <= lastScreenLine; i++) { LineInfo info = lineInfo[i]; Chunk chunks; // get another line of chunks if(out.isEmpty()) { // unless this is the first time, increment // the line number if(physicalLine != -1 && i != firstScreenLine) { physicalLine = textArea.displayManager .getNextVisibleLine(physicalLine); } // empty space if(physicalLine == -1) { info.chunks = null; info.physicalLine = -1; // fix the bug where the horiz. // scroll bar was not updated // after creating a new file. info.width = 0; continue; } // chunk the line. lineToChunkList(physicalLine,out); info.firstSubregion = true; // if the line has no text, out.size() == 0 if(out.isEmpty()) { if(i == 0) { if(textArea.displayManager.firstLine.skew > 0) { Log.log(Log.ERROR,this,"BUG: skew=" + textArea.displayManager.firstLine.skew + ",out.size()=" + out.size()); textArea.displayManager.firstLine.skew = 0; needFullRepaint = true; lastScreenLine = lineInfo.length - 1; } } chunks = null; offset = 0; length = 1; } // otherwise, the number of subregions else { if(i == 0) { int skew = textArea.displayManager.firstLine.skew; if(skew >= out.size()) { // The skew cannot be greater than the chunk count of the line // we need at least one chunk per subregion in a line Log.log(Log.ERROR,this,"BUG: skew=" + skew + ",out.size()=" + out.size()); needFullRepaint = true; lastScreenLine = lineInfo.length - 1; } else if(skew > 0) { info.firstSubregion = false; for(int j = 0; j < skew; j++) out.remove(0); } } chunks = out.remove(0); offset = chunks.offset; if (!out.isEmpty()) length = out.get(0).offset - offset; else length = textArea.getLineLength(physicalLine) - offset + 1; } } else { info.firstSubregion = false; chunks = out.remove(0); offset = chunks.offset; if (!out.isEmpty()) length = out.get(0).offset - offset; else length = textArea.getLineLength(physicalLine) - offset + 1; } boolean lastSubregion = out.isEmpty(); if(i == lastScreenLine && lastScreenLine != lineInfo.length - 1) { /* if the user changes the syntax token at the * end of a line, need to do a full repaint. */ if(tokenHandler.getLineContext() != info.lineContext) { lastScreenLine++; needFullRepaint = true; } /* If this line has become longer or shorter * (in which case the new physical line number * is different from the cached one) we need to: * - continue updating past the last line * - advise the text area to repaint * On the other hand, if the line wraps beyond * lastScreenLine, we need to keep updating the * chunk list to ensure proper alignment of * invalidation flags (see start of method) */ else if(info.physicalLine != physicalLine || info.lastSubregion != lastSubregion) { lastScreenLine++; needFullRepaint = true; } /* We only cache entire physical lines at once; * don't want to split a physical line into * screen lines and only have some valid. */ else if (!out.isEmpty()) lastScreenLine++; } info.physicalLine = physicalLine; info.lastSubregion = lastSubregion; info.offset = offset; info.length = length; info.chunks = chunks; info.lineContext = tokenHandler.getLineContext(); } firstInvalidLine = Math.max(lastScreenLine + 1,firstInvalidLine); }
// in org/gjt/sp/jedit/textarea/DisplayManager.java
public int getNextVisibleLine(int line) { if(line < 0 || line >= buffer.getLineCount()) throw new ArrayIndexOutOfBoundsException(line); return folds.next(line); }
// in org/gjt/sp/jedit/textarea/DisplayManager.java
public int getPrevVisibleLine(int line) { if(line < 0 || line >= buffer.getLineCount()) throw new ArrayIndexOutOfBoundsException(line); return folds.prev(line); }
// in org/gjt/sp/jedit/textarea/DisplayManager.java
public void narrow(int start, int end) { int lineCount = buffer.getLineCount(); if(start > end || start < 0 || end >= lineCount) throw new ArrayIndexOutOfBoundsException(start + ", " + end); if(start < getFirstVisibleLine() || end > getLastVisibleLine()) expandAllFolds(); if(start != 0) hideLineRange(0,start - 1); if(end != lineCount - 1) hideLineRange(end + 1,lineCount - 1); // if we narrowed to a single collapsed fold if(start != lineCount - 1 && !isLineVisible(start + 1)) expandFold(start,false); textArea.fireNarrowActive(); notifyScreenLineChanges(); textArea.foldStructureChanged(); }
// in org/gjt/sp/jedit/syntax/Chunk.java
public static float offsetToX(Chunk chunks, int offset) { if(chunks != null && offset < chunks.offset) { throw new ArrayIndexOutOfBoundsException(offset + " < " + chunks.offset); } float x = 0.0f; while(chunks != null) { if(chunks.isAccessible() && offset < chunks.offset + chunks.length) return x + chunks.offsetToX(offset - chunks.offset); x += chunks.width; chunks = (Chunk)chunks.next; } return x; }
0 0
(Lib) NullPointerException 21
              
// in org/gjt/sp/jedit/gui/ExtendedGridLayout.java
private ExtendedGridLayoutConstraints lookupConstraints(Component component) { if (null == component) { throw new NullPointerException("component must not be null"); } ExtendedGridLayoutConstraints constraints = comptable.get(component); if (null == constraints) { constraints = new ExtendedGridLayoutConstraints(component); comptable.put(component,constraints); } return constraints; }
// in org/gjt/sp/jedit/EditPane.java
public void setBuffer(final Buffer buffer, boolean requestFocus) { if(buffer == null) throw new NullPointerException(); if(this.buffer == buffer) return; if (bufferSet.indexOf(buffer) == -1) { jEdit.getBufferSetManager().addBuffer(this, buffer); } //if(buffer.insideCompoundEdit()) // buffer.endCompoundEdit(); EditBus.send(new BufferChanging(this, buffer)); if (bufferSet.indexOf(this.buffer) != -1) { // when closing the last buffer of a bufferSet, the current buffer will still be the closed // buffer until a new empty buffer is created. // So if the current buffer is not anymore in the bufferSet, do not set the recentBuffer recentBuffer = this.buffer; } if(recentBuffer != null) saveCaretInfo(); this.buffer = buffer; textArea.setBuffer(buffer); if(!init) { view.updateTitle(); if(bufferSwitcher != null) { if(bufferSwitcher.getSelectedItem() != buffer) bufferSwitcher.setSelectedItem(buffer); bufferSwitcher.setToolTipText(buffer.getPath()); } EditBus.send(new EditPaneUpdate(this,EditPaneUpdate .BUFFER_CHANGED)); } if (requestFocus) { SwingUtilities.invokeLater(new Runnable() { public void run() { // only do this if we are the current edit pane if(view.getEditPane() == EditPane.this && (bufferSwitcher == null || !bufferSwitcher.isPopupVisible())) { textArea.requestFocus(); } } }); }
// in org/gjt/sp/jedit/bsh/CollectionManager.java
protected Enumeration createEnumeration( Object iterateOverMe ) { if(iterateOverMe==null) throw new NullPointerException("Object arguments passed to " + "the BasicBshIterator constructor cannot be null."); if (iterateOverMe instanceof Enumeration) return (Enumeration)iterateOverMe; if (iterateOverMe instanceof Vector) return ((Vector)iterateOverMe).elements(); if (iterateOverMe.getClass().isArray()) { final Object array = iterateOverMe; return new Enumeration() { int index = 0, length = Array.getLength(array); public Object nextElement() { return Array.get(array, index++); } public boolean hasMoreElements() { return index<length; } }; } if (iterateOverMe instanceof String) return createEnumeration(((String)iterateOverMe).toCharArray()); if (iterateOverMe instanceof StringBuffer) return createEnumeration( iterateOverMe.toString().toCharArray()); if (iterateOverMe instanceof StringBuilder) return createEnumeration( iterateOverMe.toString().toCharArray()); throw new IllegalArgumentException( "Cannot enumerate object of type "+iterateOverMe.getClass()); }
// in org/gjt/sp/jedit/bsh/collection/CollectionIterator.java
protected Iterator createIterator(Object iterateOverMe) { if (iterateOverMe==null) throw new NullPointerException("Object arguments passed to " + "the CollectionIterator constructor cannot be null."); if (iterateOverMe instanceof Iterator) return (Iterator)iterateOverMe; if (iterateOverMe instanceof Collection) return ((Collection)iterateOverMe).iterator(); /* Should we be able to iterate over maps? if (iterateOverMe instanceof Map) return ((Map)iterateOverMe).entrySet().iterator(); */ throw new IllegalArgumentException( "Cannot enumerate object of type "+iterateOverMe.getClass()); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public void setMode(Mode mode, boolean forceContextInsensitive) { /* This protects against stupid people (like me) * doing stuff like buffer.setMode(jEdit.getMode(...)); */ if(mode == null) throw new NullPointerException("Mode must be non-null"); this.mode = mode; contextInsensitive = forceContextInsensitive || mode.getBooleanProperty("contextInsensitive"); setTokenMarker(mode.getTokenMarker()); resetCachedProperties(); propertiesChanged(); }
// in org/gjt/sp/jedit/ActionSet.java
public void setLabel(String label) { if(label == null) throw new NullPointerException(); this.label = label; }
0 0
(Lib) Error 17
              
// in org/gjt/sp/jedit/pluginmgr/InstallPanel.java
Override public Class getColumnClass(int columnIndex) { switch (columnIndex) { case 0: return Boolean.class; case 1: case 2: case 3: case 4: case 5: return Object.class; default: throw new Error("Column out of range"); } }
// in org/gjt/sp/jedit/pluginmgr/InstallPanel.java
Override public String getColumnName(int column) { switch (column) { case 0: return " "; case 1: return ' '+jEdit.getProperty("install-plugins.info.name"); case 2: return ' '+jEdit.getProperty("install-plugins.info.category"); case 3: return ' '+jEdit.getProperty("install-plugins.info.version"); case 4: return ' '+jEdit.getProperty("install-plugins.info.size"); case 5: return ' '+jEdit.getProperty("install-plugins.info.releaseDate"); default: throw new Error("Column out of range"); } }
// in org/gjt/sp/jedit/pluginmgr/InstallPanel.java
Override public Object getValueAt(int rowIndex,int columnIndex) { Object obj = filteredEntries.get(rowIndex); if(obj instanceof String) { if(columnIndex == 1) return obj; else return null; } else { Entry entry = (Entry)obj; switch (columnIndex) { case 0: return entry.install; case 1: return entry.name; case 2: return entry.set; case 3: if (updates) return entry.installedVersion + "->" + entry.version; return entry.version; case 4: return formatSize(entry.size); case 5: return entry.date; default: throw new Error("Column out of range"); } } }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
Override public String getColumnName(int column) { switch (column) { case 0: return " "; case 1: return jEdit.getProperty("manage-plugins.info.name"); case 2: return jEdit.getProperty("manage-plugins.info.version"); case 3: return jEdit.getProperty("manage-plugins.info.status"); case 4: return jEdit.getProperty("manage-plugins.info.data"); default: throw new Error("Column out of range"); } }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
Override public Object getValueAt(int rowIndex,int columnIndex) { Entry entry = entries.get(rowIndex); switch (columnIndex) { case 0: return Boolean.valueOf(!entry.status.equals(Entry.NOT_LOADED)); case 1: if(entry.name == null) { return MiscUtilities.getFileName(entry.jar); } else { return entry.name; } case 2: return entry.version; case 3: return jEdit.getProperty("plugin-manager.status." + entry.status); case 4: if (entry.dataSize == null && entry.plugin != null) { File pluginDirectory = entry.plugin.getPluginHome(); if (null == pluginDirectory) { return null; } if (pluginDirectory.exists()) { entry.dataSize = StandardUtilities.formatFileSize(IOUtilities.fileLength(pluginDirectory)); } else { if (jEdit.getBooleanProperty("plugin." + entry.clazz + ".usePluginHome")) { entry.dataSize = StandardUtilities.formatFileSize(0); } else { entry.dataSize = jEdit.getProperty("manage-plugins.data-size.unknown"); } } } return entry.dataSize; default: throw new Error("Column out of range"); } }
// in org/gjt/sp/jedit/bsh/BshMethod.java
Object invoke( Object[] argValues, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean overrideNameSpace ) throws EvalError { if ( argValues != null ) for (int i=0; i<argValues.length; i++) if ( argValues[i] == null ) throw new Error("HERE!"); if ( javaMethod != null ) try { return Reflect.invokeMethod( javaMethod, javaObject, argValues ); } catch ( ReflectError e ) { throw new EvalError( "Error invoking Java method: "+e, callerInfo, callstack ); } catch ( InvocationTargetException e2 ) { throw new TargetError( "Exception invoking imported object method.", e2, callerInfo, callstack, true/*isNative*/ ); } // is this a syncrhonized method? if ( modifiers != null && modifiers.hasModifier("synchronized") ) { // The lock is our declaring namespace's This reference // (the method's 'super'). Or in the case of a class it's the // class instance. Object lock; if ( declaringNameSpace.isClass ) { try { lock = declaringNameSpace.getClassInstance(); } catch ( UtilEvalError e ) { throw new InterpreterError( "Can't get class instance for synchronized method."); } } else lock = declaringNameSpace.getThis(interpreter); // ??? synchronized( lock ) { return invokeImpl( argValues, interpreter, callstack, callerInfo, overrideNameSpace ); } } else return invokeImpl( argValues, interpreter, callstack, callerInfo, overrideNameSpace ); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public boolean Line() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 0: jj_consume_token(0); Interpreter.debug("End of File!"); {if (true) return true;} break; default: if (jj_2_1(1)) { BlockStatement(); {if (true) return false;} } else { jj_consume_token(-1); throw new ParseException(); } } throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public Modifiers Modifiers(int context, boolean lookahead) throws ParseException { Modifiers mods = null; label_1: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ABSTRACT: case FINAL: case NATIVE: case PRIVATE: case PROTECTED: case PUBLIC: case STATIC: case STRICTFP: case SYNCHRONIZED: case TRANSIENT: case VOLATILE: ; break; default: break label_1; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PRIVATE: jj_consume_token(PRIVATE); break; case PROTECTED: jj_consume_token(PROTECTED); break; case PUBLIC: jj_consume_token(PUBLIC); break; case SYNCHRONIZED: jj_consume_token(SYNCHRONIZED); break; case FINAL: jj_consume_token(FINAL); break; case NATIVE: jj_consume_token(NATIVE); break; case TRANSIENT: jj_consume_token(TRANSIENT); break; case VOLATILE: jj_consume_token(VOLATILE); break; case ABSTRACT: jj_consume_token(ABSTRACT); break; case STATIC: jj_consume_token(STATIC); break; case STRICTFP: jj_consume_token(STRICTFP); break; default: jj_consume_token(-1); throw new ParseException(); } if ( !lookahead ) try { if ( mods == null ) mods = new Modifiers(); mods.addModifier( context, getToken(0).image ); } catch ( IllegalStateException e ) { {if (true) throw createParseException( e.getMessage() );} } } {if (true) return mods;} throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public int NameList() throws ParseException { int count = 0; AmbiguousName(); ++count; label_6: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: break label_6; } jj_consume_token(COMMA); AmbiguousName(); ++count; } {if (true) return count;} throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public int AssignmentOperator() throws ParseException { Token t; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ASSIGN: jj_consume_token(ASSIGN); break; case STARASSIGN: jj_consume_token(STARASSIGN); break; case SLASHASSIGN: jj_consume_token(SLASHASSIGN); break; case MODASSIGN: jj_consume_token(MODASSIGN); break; case PLUSASSIGN: jj_consume_token(PLUSASSIGN); break; case MINUSASSIGN: jj_consume_token(MINUSASSIGN); break; case ANDASSIGN: jj_consume_token(ANDASSIGN); break; case XORASSIGN: jj_consume_token(XORASSIGN); break; case ORASSIGN: jj_consume_token(ORASSIGN); break; case LSHIFTASSIGN: jj_consume_token(LSHIFTASSIGN); break; case LSHIFTASSIGNX: jj_consume_token(LSHIFTASSIGNX); break; case RSIGNEDSHIFTASSIGN: jj_consume_token(RSIGNEDSHIFTASSIGN); break; case RSIGNEDSHIFTASSIGNX: jj_consume_token(RSIGNEDSHIFTASSIGNX); break; case RUNSIGNEDSHIFTASSIGN: jj_consume_token(RUNSIGNEDSHIFTASSIGN); break; case RUNSIGNEDSHIFTASSIGNX: jj_consume_token(RUNSIGNEDSHIFTASSIGNX); break; default: jj_consume_token(-1); throw new ParseException(); } t = getToken(0); {if (true) return t.kind;} throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public boolean BooleanLiteral() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case TRUE: jj_consume_token(TRUE); {if (true) return true;} break; case FALSE: jj_consume_token(FALSE); {if (true) return false;} break; default: jj_consume_token(-1); throw new ParseException(); } throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
protected void ExpandBuff(boolean wrapAround) { char[] newbuffer = new char[bufsize + 2048]; int newbufline[] = new int[bufsize + 2048]; int newbufcolumn[] = new int[bufsize + 2048]; try { if (wrapAround) { System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos); buffer = newbuffer; System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos); bufline = newbufline; System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos); bufcolumn = newbufcolumn; bufpos += (bufsize - tokenBegin); } else { System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); buffer = newbuffer; System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); bufline = newbufline; System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); bufcolumn = newbufcolumn; bufpos -= tokenBegin; } } catch (Throwable t) { throw new Error(t.getMessage()); } available = (bufsize += 2048); tokenBegin = 0; }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
public char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; if (++bufpos == bufsize) bufpos = 0; return buffer[bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if ((buffer[bufpos] = c = ReadByte()) == '\\') { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = ReadByte()) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch(java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = ReadByte()) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval(ReadByte()) << 8 | hexval(ReadByte()) << 4 | hexval(ReadByte())); column += 4; } catch(java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; else { backup(backSlashCnt - 1); return '\\'; } } else { UpdateLineColumn(c); return (c); } }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public void removeListener( Listener l ) { throw new Error("unimplemented"); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public byte [] getCode( String className ) { throw new Error("Unimplemented"); }
2
              
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch (Throwable t) { throw new Error(t.getMessage()); }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch(java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); }
0
(Domain) ReflectError 14
              
// in org/gjt/sp/jedit/bsh/Reflect.java
static Object invokeMethod( Method method, Object object, Object[] args ) throws ReflectError, InvocationTargetException { if ( args == null ) args = new Object[0]; logInvokeMethod( "Invoking method (entry): ", method, args ); // Map types to assignable forms, need to keep this fast... Object [] tmpArgs = new Object [ args.length ]; Class [] types = method.getParameterTypes(); try { for (int i=0; i<args.length; i++) tmpArgs[i] = Types.castObject( args[i]/*rhs*/, types[i]/*lhsType*/, Types.ASSIGNMENT ); } catch ( UtilEvalError e ) { throw new InterpreterError( "illegal argument type in method invocation: "+e ); } // unwrap any primitives tmpArgs = Primitive.unwrap( tmpArgs ); logInvokeMethod( "Invoking method (after massaging values): ", method, tmpArgs ); try { Object returnValue = method.invoke( object, tmpArgs ); if ( returnValue == null ) returnValue = Primitive.NULL; Class returnType = method.getReturnType(); return Primitive.wrap( returnValue, returnType ); } catch( IllegalAccessException e ) { throw new ReflectError( "Cannot access method " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " in '" + method.getDeclaringClass() + "' :" + e ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getIndex(Object array, int index) throws ReflectError, UtilTargetError { if ( Interpreter.DEBUG ) Interpreter.debug("getIndex: "+array+", index="+index); try { Object val = Array.get(array, index); return Primitive.wrap( val, array.getClass().getComponentType() ); } catch( ArrayIndexOutOfBoundsException e1 ) { throw new UtilTargetError( e1 ); } catch(Exception e) { throw new ReflectError("Array access:" + e); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static void setIndex(Object array, int index, Object val) throws ReflectError, UtilTargetError { try { val = Primitive.unwrap(val); Array.set(array, index, val); } catch( ArrayStoreException e2 ) { throw new UtilTargetError( e2 ); } catch( IllegalArgumentException e1 ) { throw new UtilTargetError( new ArrayStoreException( e1.toString() ) ); } catch(Exception e) { throw new ReflectError("Array access:" + e); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
private static Object getFieldValue( Class clas, Object object, String fieldName, boolean staticOnly ) throws UtilEvalError, ReflectError { try { Field f = resolveExpectedJavaField( clas, fieldName, staticOnly ); Object value = f.get(object); Class returnType = f.getType(); return Primitive.wrap( value, returnType ); } catch( NullPointerException e ) { // shouldn't happen throw new ReflectError( "???" + fieldName + " is not a static field."); } catch(IllegalAccessException e) { throw new ReflectError("Can't access field: " + fieldName); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Field resolveExpectedJavaField( Class clas, String fieldName, boolean staticOnly ) throws UtilEvalError, ReflectError { Field field; try { if ( Capabilities.haveAccessibility() ) field = findAccessibleField( clas, fieldName ); else // Class getField() finds only public (and in interfaces, etc.) field = clas.getField(fieldName); } catch( NoSuchFieldException e) { throw new ReflectError("No such field: " + fieldName ); } catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching fields of: "+clas, e ); } if ( staticOnly && !Modifier.isStatic( field.getModifiers() ) ) throw new UtilEvalError( "Can't reach instance field: "+fieldName +" from static context: "+clas.getName() ); return field; }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Method resolveExpectedJavaMethod( BshClassManager bcm, Class clas, Object object, String name, Object[] args, boolean staticOnly ) throws ReflectError, UtilEvalError { if ( object == Primitive.NULL ) throw new UtilTargetError( new NullPointerException( "Attempt to invoke method " +name+" on null value" ) ); Class [] types = Types.getTypes(args); Method method = resolveJavaMethod( bcm, clas, name, types, staticOnly ); if ( method == null ) throw new ReflectError( ( staticOnly ? "Static method " : "Method " ) + StringUtil.methodString(name, types) + " not found in class'" + clas.getName() + "'"); return method; }
// in org/gjt/sp/jedit/bsh/Reflect.java
static Object constructObject( Class clas, Object[] args ) throws ReflectError, InvocationTargetException { if ( clas.isInterface() ) throw new ReflectError( "Can't create instance of an interface: "+clas); Object obj = null; Class[] types = Types.getTypes(args); Constructor con = null; // Find the constructor. // (there are no inherited constructors to worry about) Constructor[] constructors = Capabilities.haveAccessibility() ? clas.getDeclaredConstructors() : clas.getConstructors() ; if ( Interpreter.DEBUG ) Interpreter.debug("Looking for most specific constructor: "+clas); con = findMostSpecificConstructor(types, constructors); if ( con == null ) throw cantFindConstructor( clas, types ); if ( !isPublic( con ) ) try { ReflectManager.RMSetAccessible( con ); } catch ( UtilEvalError e ) { /*ignore*/ } args=Primitive.unwrap( args ); try { obj = con.newInstance( args ); } catch(InstantiationException e) { throw new ReflectError("The class "+clas+" is abstract "); } catch(IllegalAccessException e) { throw new ReflectError( "We don't have permission to create an instance." +"Use setAccessibility(true) to enable access." ); } catch(IllegalArgumentException e) { throw new ReflectError("The number of arguments was wrong"); } if (obj == null) throw new ReflectError("Couldn't construct the object"); return obj; }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getObjectProperty( Object obj, String propName ) throws UtilEvalError, ReflectError { Object[] args = new Object[] { }; Interpreter.debug("property access: "); Method method = null; Exception e1=null, e2=null; try { String accessorName = accessorName( "get", propName ); method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); } catch ( Exception e ) { e1 = e; } if ( method == null ) try { String accessorName = accessorName( "is", propName ); method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); if ( method.getReturnType() != Boolean.TYPE ) method = null; } catch ( Exception e ) { e2 = e; } if ( method == null ) throw new ReflectError("Error in property getter: " +e1 + (e2!=null?" : "+e2:"") ); try { return invokeMethod( method, obj, args ); } catch(InvocationTargetException e) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Class getArrayBaseType(Class arrayClass) throws ReflectError { if ( !arrayClass.isArray() ) throw new ReflectError("The class is not an array."); return arrayClass.getComponentType(); }
9
              
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( IllegalAccessException e ) { throw new ReflectError( "Cannot access method " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " in '" + method.getDeclaringClass() + "' :" + e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(Exception e) { throw new ReflectError("Array access:" + e); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(Exception e) { throw new ReflectError("Array access:" + e); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( NullPointerException e ) { // shouldn't happen throw new ReflectError( "???" + fieldName + " is not a static field."); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalAccessException e) { throw new ReflectError("Can't access field: " + fieldName); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( NoSuchFieldException e) { throw new ReflectError("No such field: " + fieldName ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(InstantiationException e) { throw new ReflectError("The class "+clas+" is abstract "); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalAccessException e) { throw new ReflectError( "We don't have permission to create an instance." +"Use setAccessibility(true) to enable access." ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalArgumentException e) { throw new ReflectError("The number of arguments was wrong"); }
21
              
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
private Object doName( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError, ReflectError, InvocationTargetException { try { // .length on array if ( field.equals("length") && obj.getClass().isArray() ) if ( toLHS ) throw new EvalError( "Can't assign array length", this, callstack ); else return new Primitive(Array.getLength(obj)); // field access if ( jjtGetNumChildren() == 0 ) if ( toLHS ) return Reflect.getLHSObjectField(obj, field); else return Reflect.getObjectFieldValue( obj, field ); // Method invocation // (LHS or non LHS evaluation can both encounter method calls) Object[] oa = ((BSHArguments)jjtGetChild(0)).getArguments( callstack, interpreter); // TODO: // Note: this try/catch block is copied from BSHMethodInvocation // we need to factor out this common functionality and make sure // we handle all cases ... (e.g. property style access, etc.) // maybe move this to Reflect ? try { return Reflect.invokeObjectMethod( obj, field, oa, interpreter, callstack, this ); } catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); } catch ( InvocationTargetException e ) { String msg = "Method Invocation "+field; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); } } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
private Object doIndex( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter ) throws EvalError, ReflectError { int index = getIndexAux( obj, callstack, interpreter, this ); if ( toLHS ) return new LHS(obj, index); else try { return Reflect.getIndex(obj, index); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
public Object invokeSuperclassMethod( BshClassManager bcm, Object instance, String methodName, Object [] args ) throws UtilEvalError, ReflectError, InvocationTargetException { // Delegate to the static method return invokeSuperclassMethodImpl( bcm, instance, methodName, args ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
public static Object invokeSuperclassMethodImpl( BshClassManager bcm, Object instance, String methodName, Object [] args ) throws UtilEvalError, ReflectError, InvocationTargetException { String superName = ClassGeneratorUtil.BSHSUPER+methodName; // look for the specially named super delegate method Class clas = instance.getClass(); Method superMethod = Reflect.resolveJavaMethod( bcm, clas, superName, Types.getTypes(args), false/*onlyStatic*/ ); if ( superMethod != null ) return Reflect.invokeMethod( superMethod, instance, args ); // No super method, try to invoke regular method // could be a superfluous "super." which is legal. Class superClass = clas.getSuperclass(); superMethod = Reflect.resolveExpectedJavaMethod( bcm, superClass, instance, methodName, args, false/*onlyStatic*/ ); return Reflect.invokeMethod( superMethod, instance, args ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object invokeObjectMethod( Object object, String methodName, Object[] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo ) throws ReflectError, EvalError, InvocationTargetException { // Bsh scripted object if ( object instanceof This && !This.isExposedThisMethod(methodName) ) return ((This)object).invokeMethod( methodName, args, interpreter, callstack, callerInfo, false/*delcaredOnly*/ ); // Plain Java object, find the java method try { BshClassManager bcm = interpreter == null ? null : interpreter.getClassManager(); Class clas = object.getClass(); Method method = resolveExpectedJavaMethod( bcm, clas, object, methodName, args, false ); return invokeMethod( method, object, args ); } catch ( UtilEvalError e ) { throw e.toEvalError( callerInfo, callstack ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object invokeStaticMethod( BshClassManager bcm, Class clas, String methodName, Object [] args ) throws ReflectError, UtilEvalError, InvocationTargetException { Interpreter.debug("invoke static Method"); Method method = resolveExpectedJavaMethod( bcm, clas, null, methodName, args, true ); return invokeMethod( method, null, args ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
static Object invokeMethod( Method method, Object object, Object[] args ) throws ReflectError, InvocationTargetException { if ( args == null ) args = new Object[0]; logInvokeMethod( "Invoking method (entry): ", method, args ); // Map types to assignable forms, need to keep this fast... Object [] tmpArgs = new Object [ args.length ]; Class [] types = method.getParameterTypes(); try { for (int i=0; i<args.length; i++) tmpArgs[i] = Types.castObject( args[i]/*rhs*/, types[i]/*lhsType*/, Types.ASSIGNMENT ); } catch ( UtilEvalError e ) { throw new InterpreterError( "illegal argument type in method invocation: "+e ); } // unwrap any primitives tmpArgs = Primitive.unwrap( tmpArgs ); logInvokeMethod( "Invoking method (after massaging values): ", method, tmpArgs ); try { Object returnValue = method.invoke( object, tmpArgs ); if ( returnValue == null ) returnValue = Primitive.NULL; Class returnType = method.getReturnType(); return Primitive.wrap( returnValue, returnType ); } catch( IllegalAccessException e ) { throw new ReflectError( "Cannot access method " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " in '" + method.getDeclaringClass() + "' :" + e ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getIndex(Object array, int index) throws ReflectError, UtilTargetError { if ( Interpreter.DEBUG ) Interpreter.debug("getIndex: "+array+", index="+index); try { Object val = Array.get(array, index); return Primitive.wrap( val, array.getClass().getComponentType() ); } catch( ArrayIndexOutOfBoundsException e1 ) { throw new UtilTargetError( e1 ); } catch(Exception e) { throw new ReflectError("Array access:" + e); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static void setIndex(Object array, int index, Object val) throws ReflectError, UtilTargetError { try { val = Primitive.unwrap(val); Array.set(array, index, val); } catch( ArrayStoreException e2 ) { throw new UtilTargetError( e2 ); } catch( IllegalArgumentException e1 ) { throw new UtilTargetError( new ArrayStoreException( e1.toString() ) ); } catch(Exception e) { throw new ReflectError("Array access:" + e); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getStaticFieldValue(Class clas, String fieldName) throws UtilEvalError, ReflectError { return getFieldValue( clas, null, fieldName, true/*onlystatic*/); }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getObjectFieldValue( Object object, String fieldName ) throws UtilEvalError, ReflectError { if ( object instanceof This ) return ((This)object).namespace.getVariable( fieldName ); else { try { return getFieldValue( object.getClass(), object, fieldName, false/*onlystatic*/); } catch ( ReflectError e ) { // no field, try property acces if ( hasObjectPropertyGetter( object.getClass(), fieldName ) ) return getObjectProperty( object, fieldName ); else throw e; } } }
// in org/gjt/sp/jedit/bsh/Reflect.java
static LHS getLHSStaticField(Class clas, String fieldName) throws UtilEvalError, ReflectError { Field f = resolveExpectedJavaField( clas, fieldName, true/*onlystatic*/); return new LHS(f); }
// in org/gjt/sp/jedit/bsh/Reflect.java
static LHS getLHSObjectField( Object object, String fieldName ) throws UtilEvalError, ReflectError { if ( object instanceof This ) { // I guess this is when we pass it as an argument? // Setting locally boolean recurse = false; return new LHS( ((This)object).namespace, fieldName, recurse ); } try { Field f = resolveExpectedJavaField( object.getClass(), fieldName, false/*staticOnly*/ ); return new LHS(object, f); } catch ( ReflectError e ) { // not a field, try property access if ( hasObjectPropertySetter( object.getClass(), fieldName ) ) return new LHS( object, fieldName ); else throw e; } }
// in org/gjt/sp/jedit/bsh/Reflect.java
private static Object getFieldValue( Class clas, Object object, String fieldName, boolean staticOnly ) throws UtilEvalError, ReflectError { try { Field f = resolveExpectedJavaField( clas, fieldName, staticOnly ); Object value = f.get(object); Class returnType = f.getType(); return Primitive.wrap( value, returnType ); } catch( NullPointerException e ) { // shouldn't happen throw new ReflectError( "???" + fieldName + " is not a static field."); } catch(IllegalAccessException e) { throw new ReflectError("Can't access field: " + fieldName); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Field resolveExpectedJavaField( Class clas, String fieldName, boolean staticOnly ) throws UtilEvalError, ReflectError { Field field; try { if ( Capabilities.haveAccessibility() ) field = findAccessibleField( clas, fieldName ); else // Class getField() finds only public (and in interfaces, etc.) field = clas.getField(fieldName); } catch( NoSuchFieldException e) { throw new ReflectError("No such field: " + fieldName ); } catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching fields of: "+clas, e ); } if ( staticOnly && !Modifier.isStatic( field.getModifiers() ) ) throw new UtilEvalError( "Can't reach instance field: "+fieldName +" from static context: "+clas.getName() ); return field; }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Method resolveExpectedJavaMethod( BshClassManager bcm, Class clas, Object object, String name, Object[] args, boolean staticOnly ) throws ReflectError, UtilEvalError { if ( object == Primitive.NULL ) throw new UtilTargetError( new NullPointerException( "Attempt to invoke method " +name+" on null value" ) ); Class [] types = Types.getTypes(args); Method method = resolveJavaMethod( bcm, clas, name, types, staticOnly ); if ( method == null ) throw new ReflectError( ( staticOnly ? "Static method " : "Method " ) + StringUtil.methodString(name, types) + " not found in class'" + clas.getName() + "'"); return method; }
// in org/gjt/sp/jedit/bsh/Reflect.java
static Object constructObject( Class clas, Object[] args ) throws ReflectError, InvocationTargetException { if ( clas.isInterface() ) throw new ReflectError( "Can't create instance of an interface: "+clas); Object obj = null; Class[] types = Types.getTypes(args); Constructor con = null; // Find the constructor. // (there are no inherited constructors to worry about) Constructor[] constructors = Capabilities.haveAccessibility() ? clas.getDeclaredConstructors() : clas.getConstructors() ; if ( Interpreter.DEBUG ) Interpreter.debug("Looking for most specific constructor: "+clas); con = findMostSpecificConstructor(types, constructors); if ( con == null ) throw cantFindConstructor( clas, types ); if ( !isPublic( con ) ) try { ReflectManager.RMSetAccessible( con ); } catch ( UtilEvalError e ) { /*ignore*/ } args=Primitive.unwrap( args ); try { obj = con.newInstance( args ); } catch(InstantiationException e) { throw new ReflectError("The class "+clas+" is abstract "); } catch(IllegalAccessException e) { throw new ReflectError( "We don't have permission to create an instance." +"Use setAccessibility(true) to enable access." ); } catch(IllegalArgumentException e) { throw new ReflectError("The number of arguments was wrong"); } if (obj == null) throw new ReflectError("Couldn't construct the object"); return obj; }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getObjectProperty( Object obj, String propName ) throws UtilEvalError, ReflectError { Object[] args = new Object[] { }; Interpreter.debug("property access: "); Method method = null; Exception e1=null, e2=null; try { String accessorName = accessorName( "get", propName ); method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); } catch ( Exception e ) { e1 = e; } if ( method == null ) try { String accessorName = accessorName( "is", propName ); method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); if ( method.getReturnType() != Boolean.TYPE ) method = null; } catch ( Exception e ) { e2 = e; } if ( method == null ) throw new ReflectError("Error in property getter: " +e1 + (e2!=null?" : "+e2:"") ); try { return invokeMethod( method, obj, args ); } catch(InvocationTargetException e) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static void setObjectProperty( Object obj, String propName, Object value) throws ReflectError, UtilEvalError { String accessorName = accessorName( "set", propName ); Object[] args = new Object[] { value }; Interpreter.debug("property access: "); try { Method method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); invokeMethod( method, obj, args ); } catch ( InvocationTargetException e ) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Class getArrayBaseType(Class arrayClass) throws ReflectError { if ( !arrayClass.isArray() ) throw new ReflectError("The class is not an array."); return arrayClass.getComponentType(); }
// in org/gjt/sp/jedit/bsh/Name.java
public Object invokeMethod( Interpreter interpreter, Object[] args, CallStack callstack, SimpleNode callerInfo ) throws UtilEvalError, EvalError, ReflectError, InvocationTargetException { String methodName = Name.suffix(value, 1); BshClassManager bcm = interpreter.getClassManager(); NameSpace namespace = callstack.top(); // Optimization - If classOfStaticMethod is set then we have already // been here and determined that this is a static method invocation. // Note: maybe factor this out with path below... clean up. if ( classOfStaticMethod != null ) { return Reflect.invokeStaticMethod( bcm, classOfStaticMethod, methodName, args ); } if ( !Name.isCompound(value) ) return invokeLocalMethod( interpreter, args, callstack, callerInfo ); // Note: if we want methods declared inside blocks to be accessible via // this.methodname() inside the block we could handle it here as a // special case. See also resolveThisFieldReference() special handling // for BlockNameSpace case. They currently work via the direct name // e.g. methodName(). String prefix = Name.prefix(value); // Superclass method invocation? (e.g. super.foo()) if ( prefix.equals("super") && Name.countParts(value) == 2 ) { // Allow getThis() to work through block namespaces first This ths = namespace.getThis( interpreter ); NameSpace thisNameSpace = ths.getNameSpace(); NameSpace classNameSpace = getClassNameSpace( thisNameSpace ); if ( classNameSpace != null ) { Object instance = classNameSpace.getClassInstance(); return ClassGenerator.getClassGenerator() .invokeSuperclassMethod( bcm, instance, methodName, args ); } } // Find target object or class identifier Name targetName = namespace.getNameResolver( prefix ); Object obj = targetName.toObject( callstack, interpreter ); if ( obj == Primitive.VOID ) throw new UtilEvalError( "Attempt to resolve method: "+methodName +"() on undefined variable or class name: "+targetName); // if we've got an object, resolve the method if ( !(obj instanceof ClassIdentifier) ) { if (obj instanceof Primitive) { if (obj == Primitive.NULL) throw new UtilTargetError( new NullPointerException( "Null Pointer in Method Invocation" ) ); // some other primitive // should avoid calling methods on primitive, as we do // in Name (can't treat primitive like an object message) // but the hole is useful right now. if ( Interpreter.DEBUG ) interpreter.debug( "Attempt to access method on primitive..." + " allowing bsh.Primitive to peek through for debugging"); } // found an object and it's not an undefined variable return Reflect.invokeObjectMethod( obj, methodName, args, interpreter, callstack, callerInfo ); } // It's a class // try static method if ( Interpreter.DEBUG ) Interpreter.debug("invokeMethod: trying static - " + targetName); Class clas = ((ClassIdentifier)obj).getTargetClass(); // cache the fact that this is a static method invocation on this class classOfStaticMethod = clas; if ( clas != null ) return Reflect.invokeStaticMethod( bcm, clas, methodName, args ); // return null; ??? throw new UtilEvalError("invokeMethod: unknown target: " + targetName); }
(Lib) RuntimeException 10
              
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public static byte [] readBytesFromFile( File base, String className ) { String n = className.replace( '.', File.separatorChar ) + ".class"; File file = new File( base, n ); if ( file == null || !file.exists() ) return null; byte [] bytes; try { FileInputStream fis = new FileInputStream(file); DataInputStream dis = new DataInputStream( fis ); bytes = new byte [ (int)file.length() ]; dis.readFully( bytes ); dis.close(); } catch(IOException ie ) { throw new RuntimeException("Couldn't load file: "+file); } return bytes; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public static void addMappingFeedback( MappingFeedback mf ) { if ( mappingFeedbackListener != null ) throw new RuntimeException("Unimplemented: already a listener"); mappingFeedbackListener = mf; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public void run() { if(evalOnly) throw new RuntimeException("bsh Interpreter: No stream"); /* We'll print our banner using eval(String) in order to exercise the parser and get the basic expression classes loaded... This ameliorates the delay after typing the first statement. */ if ( interactive ) try { eval("printBanner();"); } catch ( EvalError e ) { println( "BeanShell "+VERSION+" - by Pat Niemeyer (pat@pat.net)"); } // init the callstack. CallStack callstack = new CallStack( globalNameSpace ); boolean eof = false; while( !eof ) { try { // try to sync up the console System.out.flush(); System.err.flush(); Thread.yield(); // this helps a little if ( interactive ) print( getBshPrompt() ); eof = Line(); if( get_jjtree().nodeArity() > 0 ) // number of child nodes { SimpleNode node = (SimpleNode)(get_jjtree().rootNode()); if(DEBUG) node.dump(">"); Object ret = node.eval( callstack, this ); // sanity check during development if ( callstack.depth() > 1 ) throw new InterpreterError( "Callstack growing: "+callstack); if(ret instanceof ReturnControl) ret = ((ReturnControl)ret).value; if( ret != Primitive.VOID ) { setu("$_", ret); if ( showResults ) println("<" + ret + ">"); } } } catch(ParseException e) { error("Parser Error: " + e.getMessage(DEBUG)); if ( DEBUG ) e.printStackTrace(); if(!interactive) eof = true; parser.reInitInput(in); } catch(InterpreterError e) { error("Internal Error: " + e.getMessage()); e.printStackTrace(); if(!interactive) eof = true; } catch(TargetError e) { error("// Uncaught Exception: " + e ); if ( e.inNativeCode() ) e.printStackTrace( DEBUG, err ); if(!interactive) eof = true; setu("$_e", e.getTarget()); } catch (EvalError e) { if ( interactive ) error( "EvalError: "+e.toString() ); else error( "EvalError: "+e.getMessage() ); if(DEBUG) e.printStackTrace(); if(!interactive) eof = true; } catch(Exception e) { error("Unknown error: " + e); if ( DEBUG ) e.printStackTrace(); if(!interactive) eof = true; } catch(TokenMgrError e) { error("Error parsing input: " + e); /* We get stuck in infinite loops here when unicode escapes fail. Must re-init the char stream reader (ASCII_UCodeESC_CharStream.java) */ parser.reInitTokenInput( in ); if(!interactive) eof = true; } finally { get_jjtree().reset(); // reinit the callstack if ( callstack.depth() > 1 ) { callstack.clear(); callstack.push( globalNameSpace ); } } } if ( interactive && exitOnEOF ) System.exit(0); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
private static int replaceInSelection(View view, TextArea textArea, Buffer buffer, SearchMatcher matcher, boolean smartCaseReplace, Selection s) throws Exception { /* if an occurence occurs at the beginning of the selection, the selection start will get moved. this sucks, so we hack to avoid it. */ int start = s.getStart(); int returnValue; if(s instanceof Selection.Range) { returnValue = _replace(view,buffer,matcher, s.getStart(),s.getEnd(), smartCaseReplace); textArea.removeFromSelection(s); textArea.addToSelection(new Selection.Range( start,s.getEnd())); } else if(s instanceof Selection.Rect) { Selection.Rect rect = (Selection.Rect)s; int startCol = rect.getStartColumn( buffer); int endCol = rect.getEndColumn( buffer); returnValue = 0; for(int j = s.getStartLine(); j <= s.getEndLine(); j++) { returnValue += _replace(view,buffer,matcher, getColumnOnOtherLine(buffer,j,startCol), getColumnOnOtherLine(buffer,j,endCol), smartCaseReplace); } textArea.addToSelection(new Selection.Rect( start,s.getEnd())); } else throw new RuntimeException("Unsupported: " + s); return returnValue; }
// in org/gjt/sp/jedit/search/HyperSearchResults.java
Override public void actionPerformed(ActionEvent evt) { JCheckBoxMenuItem menuItem = (JCheckBoxMenuItem) evt.getSource(); boolean curState = menuItem.isSelected(); TreePath path = resultTree.getSelectionPath(); DefaultMutableTreeNode operNode = (DefaultMutableTreeNode)path.getLastPathComponent(); HyperSearchOperationNode operNodeObj = (HyperSearchOperationNode)operNode.getUserObject(); if (curState) operNodeObj.cacheResultNodes(operNode); operNode.removeAllChildren(); if (curState) { Exception excp = null; try { operNodeObj.insertTreeNodes(resultTree, operNode); } catch (Exception ex) { operNodeObj.restoreFlatNodes(resultTree, operNode); menuItem.setSelected(false); excp = ex; } finally { ((DefaultTreeModel)resultTree.getModel()).nodeStructureChanged(operNode); expandAllNodes(operNode); resultTree.scrollPathToVisible( new TreePath(operNode.getPath())); } if (excp != null) throw new RuntimeException(excp); } else operNodeObj.restoreFlatNodes(resultTree, operNode); operNodeObj.setTreeViewDisplayed(menuItem.isSelected()); }
// in org/gjt/sp/jedit/jEdit.java
private static String fontStyleToString(int style) { if(style == 0) return "PLAIN"; else if(style == Font.BOLD) return "BOLD"; else if(style == Font.ITALIC) return "ITALIC"; else if(style == (Font.BOLD | Font.ITALIC)) return "BOLDITALIC"; else throw new RuntimeException("Invalid style: " + style); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public void insert(int offset, CharSequence seq) { if(seq == null) return; int len = seq.length(); if(len == 0) return; if(isReadOnly()) throw new RuntimeException("buffer read-only"); try { writeLock(); if(offset < 0 || offset > contentMgr.getLength()) throw new ArrayIndexOutOfBoundsException(offset); contentMgr.insert(offset,seq); integerArray.clear(); for(int i = 0; i < len; i++) { if(seq.charAt(i) == '\n') integerArray.add(i + 1); } if(!undoInProgress) { undoMgr.contentInserted(offset,len, seq.toString(),!dirty); } contentInserted(offset,len,integerArray); } finally { writeUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public void remove(int offset, int length) { if(length == 0) return; if(isReadOnly()) throw new RuntimeException("buffer read-only"); try { transaction = true; writeLock(); if(offset < 0 || length < 0 || offset + length > contentMgr.getLength()) throw new ArrayIndexOutOfBoundsException(offset + ":" + length); int startLine = lineMgr.getLineOfOffset(offset); int endLine = lineMgr.getLineOfOffset(offset + length); int numLines = endLine - startLine; if(!undoInProgress && !loading) { undoMgr.contentRemoved(offset,length, getText(offset,length), !dirty); } firePreContentRemoved(startLine,offset,numLines,length); contentMgr.remove(offset,length); lineMgr.contentRemoved(startLine,offset,numLines,length); positionMgr.contentRemoved(offset,length); setDirty(true); fireContentRemoved(startLine,offset,numLines,length); /* otherwise it will be delivered later */ if(!undoInProgress && !insideCompoundEdit()) fireTransactionComplete(); } finally { transaction = false; writeUnlock(); } }
// in org/gjt/sp/jedit/textarea/TextArea.java
public int replaceSelection(String selectedText) { if(!isEditable()) throw new RuntimeException("Text component read only"); int newCaret = -1; if(getSelectionCount() == 0) { // for compatibility with older jEdit versions buffer.insert(caret,selectedText); } else { try { buffer.beginCompoundEdit(); Selection[] selection = getSelection(); for(int i = 0; i < selection.length; i++) newCaret = selection[i].setText(buffer,selectedText); } finally { buffer.endCompoundEdit(); } } return newCaret; }
// in org/gjt/sp/jedit/PluginJAR.java
boolean containsClass(String className) { try { getZipFile(); } catch (IOException ioe) { throw new RuntimeException(ioe); } Enumeration<? extends ZipEntry> itr = zipFile.entries(); while (itr.hasMoreElements()) { String entry = itr.nextElement().toString(); if (entry.endsWith(".class")) { String name = entry.substring(0, entry.length() - 6).replace('/', '.'); if (name.equals(className)) return true; } } return false; }
2
              
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch(IOException ie ) { throw new RuntimeException("Couldn't load file: "+file); }
// in org/gjt/sp/jedit/PluginJAR.java
catch (IOException ioe) { throw new RuntimeException(ioe); }
0
(Lib) IOException 11
              
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
private static Map<String, HistoryModel> loadFromReader(BufferedReader in) throws IOException { Map<String, HistoryModel> result = new HashMap<String, HistoryModel>(); HistoryModel currentModel = null; String line; while((line = in.readLine()) != null) { if(line.length() > 0 && line.charAt(0) == '[' && line.charAt(line.length() - 1) == ']') { if(currentModel != null) { result.put(currentModel.getName(), currentModel); } String modelName = MiscUtilities .escapesToChars(line.substring( 1,line.length() - 1)); currentModel = new HistoryModel( modelName); } else if(currentModel == null) { throw new IOException("History data starts" + " before model name"); } else { currentModel.addElement(MiscUtilities .escapesToChars(line)); } } if(currentModel != null) { result.put(currentModel.getName(),currentModel); } return result; }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
static final int hexval(char c) throws java.io.IOException { switch(c) { case '0' : return 0; case '1' : return 1; case '2' : return 2; case '3' : return 3; case '4' : return 4; case '5' : return 5; case '6' : return 6; case '7' : return 7; case '8' : return 8; case '9' : return 9; case 'a' : case 'A' : return 10; case 'b' : case 'B' : return 11; case 'c' : case 'C' : return 12; case 'd' : case 'D' : return 13; case 'e' : case 'E' : return 14; case 'f' : case 'F' : return 15; } throw new java.io.IOException(); // Should never come here }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
protected void FillBuff() throws java.io.IOException { int i; if (maxNextCharInd == 4096) maxNextCharInd = nextCharInd = 0; try { if ((i = inputStream.read(nextCharBuf, maxNextCharInd, 4096 - maxNextCharInd)) == -1) { inputStream.close(); throw new java.io.IOException(); } else maxNextCharInd += i; return; } catch(java.io.IOException e) { if (bufpos != 0) { --bufpos; backup(0); } else { bufline[bufpos] = line; bufcolumn[bufpos] = column; } throw e; } }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
static List traverseDirForClassesAux( File topDir, File dir ) throws IOException { List list = new ArrayList(); String top = topDir.getAbsolutePath(); File [] children = dir.listFiles(); for (int i=0; i< children.length; i++) { File child = children[i]; if ( child.isDirectory() ) list.addAll( traverseDirForClassesAux( topDir, child ) ); else { String name = child.getAbsolutePath(); if ( isClassFileName( name ) ) { /* Remove absolute (topdir) portion of path and leave package-class part */ if ( name.startsWith( top ) ) name = name.substring( top.length()+1 ); else throw new IOException( "problem parsing paths" ); name = canonicalizeClassName(name); list.add( name ); } } } return list; }
// in org/gjt/sp/jedit/bsh/Remote.java
public static int eval( String url, String text ) throws IOException { String returnValue = null; if ( url.startsWith( "http:" ) ) { returnValue = doHttp( url, text ); } else if ( url.startsWith( "bsh:" ) ) { returnValue = doBsh( url, text ); } else throw new IOException( "Unrecognized URL type." +"Scheme must be http:// or bsh://"); try { return Integer.parseInt( returnValue ); } catch ( Exception e ) { // this convention may change... return 0; } }
// in org/gjt/sp/jedit/io/VFSFile.java
public boolean isBinary(Object session) throws IOException { InputStream in = getVFS()._createInputStream(session,getPath(), false,jEdit.getActiveView()); if(in == null) throw new IOException("Unable to get a Stream for this file "+this); try { return MiscUtilities.isBinary(in); } finally { IOUtilities.closeQuietly(in); } }
// in org/gjt/sp/jedit/io/VFS.java
public static boolean copy(ProgressObserver progress, VFS sourceVFS, Object sourceSession,String sourcePath, VFS targetVFS, Object targetSession,String targetPath, Component comp, boolean canStop, boolean sendVFSUpdate) throws IOException { if (progress != null) progress.setStatus("Initializing"); InputStream in = null; OutputStream out = null; try { VFSFile sourceVFSFile = sourceVFS._getFile(sourceSession, sourcePath, comp); if (sourceVFSFile == null) throw new FileNotFoundException("source path " + sourcePath + " doesn't exists"); if (progress != null) { progress.setMaximum(sourceVFSFile.getLength()); } VFSFile targetVFSFile = targetVFS._getFile(targetSession, targetPath, comp); if (targetVFSFile == null) { String parentTargetPath = MiscUtilities.getParentOfPath(targetPath); VFSFile parentTargetVFSFile = targetVFS._getFile(targetSession, parentTargetPath, comp); if (parentTargetVFSFile == null) throw new FileNotFoundException("target path " + parentTargetPath + " doesn't exists"); if (parentTargetVFSFile.getType() == VFSFile.DIRECTORY) { String targetFilename = MiscUtilities.getFileName(targetPath); targetPath = MiscUtilities.constructPath(parentTargetPath, targetFilename); } else { throw new IOException("The parent of target path is a file"); } } else if (targetVFSFile.getType() == VFSFile.DIRECTORY) { if (targetVFSFile.getPath().equals(sourceVFSFile.getPath())) return false; targetPath = MiscUtilities.constructPath(targetPath, sourceVFSFile.getName()); } in = new BufferedInputStream(sourceVFS._createInputStream(sourceSession, sourcePath, false, comp)); out = new BufferedOutputStream(targetVFS._createOutputStream(targetSession, targetPath, comp)); boolean copyResult = IOUtilities.copyStream(IOBUFSIZE, progress, in, out, canStop); if (sendVFSUpdate) VFSManager.sendVFSUpdate(targetVFS, targetPath, true); return copyResult; } finally { IOUtilities.closeQuietly(in); IOUtilities.closeQuietly(out); } }
// in org/gjt/sp/jedit/proto/jeditresource/PluginResURLConnection.java
public void connect() throws IOException { if(!connected) { if(plugin == null) { in = jEdit.class.getResourceAsStream(resource); } else { PluginJAR[] plugins = jEdit.getPluginJARs(); for(int i = 0; i < plugins.length; i++) { PluginJAR jar = plugins[i]; String jarName =MiscUtilities.getFileName(jar.getPath()).toLowerCase(); if(plugin.equalsIgnoreCase(jarName)) { in = jar.getClassLoader() .getResourceAsStream(resource); break; } } } if(in == null) { throw new IOException("Resource not found: " + plugin + "!" + resource); } connected = true; } }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
public void run() { /* if the VFS supports renaming files, we first * save to #<filename>#save#, then rename that * to <filename>, so that if the save fails, * data will not be lost. * * as of 4.1pre7 we now call vfs.getTwoStageSaveName() * instead of constructing the path directly * since some VFS's might not allow # in filenames. */ boolean vfsRenameCap = (vfs.getCapabilities() & VFS.RENAME_CAP) != 0; boolean wantTwoStage = wantTwoStageSave(buffer); boolean twoStageSave = vfsRenameCap && wantTwoStage; try { String[] args = { vfs.getFileName(path) }; setStatus(jEdit.getProperty("vfs.status.save",args)); // the entire save operation can be aborted... setAbortable(true); path = vfs._canonPath(session,path,view); if(!MiscUtilities.isURL(path)) path = MiscUtilities.resolveSymlinks(path); String savePath; if(twoStageSave) { savePath = vfs.getTwoStageSaveName(path); if (savePath == null) { throw new IOException( "Can't get a temporary path for two-stage save: " + path); } } else { makeBackup(); savePath = path; } OutputStream out = vfs._createOutputStream(session,savePath,view); if(out == null) { buffer.setBooleanProperty(ERROR_OCCURRED,true); return; } try { // this must be after the stream is created or // we deadlock with SSHTools. buffer.readLock(); try { // Can't use buffer.getName() here because // it is not changed until the save is // complete if(path.endsWith(".gz")) buffer.setBooleanProperty(Buffer.GZIPPED,true); else if (buffer.getName().endsWith(".gz")) { // The path do not ends with gz. // The buffer name was .gz. // So it means it's blabla.txt.gz -> blabla.txt, I remove // the gz property buffer.setBooleanProperty(Buffer.GZIPPED, false); } if(buffer.getBooleanProperty(Buffer.GZIPPED)) out = new GZIPOutputStream(out); write(buffer,out); } finally { buffer.readUnlock(); } } finally { IOUtilities.closeQuietly(out); } if(twoStageSave) { makeBackup(); if(!vfs._rename(session,savePath,path,view)) throw new IOException("Rename failed: " + savePath); } if(!twoStageSave) VFSManager.sendVFSUpdate(vfs,path,true); } catch (FileNotFoundException e) { Log.log(Log.ERROR,this,"Unable to save buffer " + e); String[] pp = { e.getMessage() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(UnsupportedCharsetException e) { Log.log(Log.ERROR, this, e, e); String[] pp = { e.getCharsetName() }; VFSManager.error(view,path,"ioerror.unsupported-encoding-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } finally { try { vfs._saveComplete(session,buffer,path,view); if( twoStageSave ) { vfs._finishTwoStageSave(session,buffer,path,view); } // clean up left-over markers file if(!jEdit.getBooleanProperty("persistentMarkers")) vfs._delete(session,Buffer.getMarkersPath(vfs, path),view); vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } } }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
private InputStream getNakedStream() throws IOException { InputStream in = vfs._createInputStream(session,path,false,view); if(in != null) { return in; } throw new IOException("Unable to get a Stream for " + path); }
0 134
              
// in org/gjt/sp/jedit/View.java
private Component restoreSplitConfig(Buffer buffer, String splitConfig) throws IOException // this is where checked exceptions piss me off. this method only uses // a StringReader which can never throw an exception... { if(buffer != null) { return editPane = createEditPane(buffer); } else if(splitConfig == null || splitConfig.trim().length() == 0) { Buffer buf = jEdit.getFirstBuffer(); if (buf == null) { buf = BufferSetManager.createUntitledBuffer(); } return editPane = createEditPane(buf); } Buffer[] buffers = jEdit.getBuffers(); Stack<Object> stack = new Stack<Object>(); // we create a stream tokenizer for parsing a simple // stack-based language StreamTokenizer st = new StreamTokenizer(new StringReader( splitConfig)); st.whitespaceChars(0,' '); /* all printable ASCII characters */ st.wordChars('#','~'); st.commentChar('!'); st.quoteChar('"'); st.eolIsSignificant(false); List<Buffer> editPaneBuffers = new ArrayList<Buffer>(); loop: while (true) { switch(st.nextToken()) { case StreamTokenizer.TT_EOF: break loop; case StreamTokenizer.TT_WORD: if("vertical".equals(st.sval) || "horizontal".equals(st.sval)) { int orientation = "vertical".equals(st.sval) ? JSplitPane.VERTICAL_SPLIT : JSplitPane.HORIZONTAL_SPLIT; int divider = (Integer) stack.pop(); Object obj1 = stack.pop(); Object obj2 = stack.pop(); // Backward compatibility with pre-bufferset versions if (obj1 instanceof Buffer) { Buffer b1 = buffer = (Buffer) obj1; obj1 = editPane = createEditPane(b1); } if (obj2 instanceof Buffer) { Buffer b2 = (Buffer) obj2; obj2 = createEditPane(b2); } stack.push(splitPane = new JSplitPane( orientation, (Component)obj1, (Component)obj2)); splitPane.setOneTouchExpandable(true); splitPane.setBorder(null); splitPane.setMinimumSize( new Dimension(0,0)); splitPane.setDividerLocation(divider); } else if("buffer".equals(st.sval)) { Object obj = stack.pop(); if(obj instanceof Integer) { int index = (Integer) obj; if(index >= 0 && index < buffers.length) buffer = buffers[index]; } else if(obj instanceof String) { String path = (String)obj; buffer = jEdit.getBuffer(path); if (buffer == null) { buffer = jEdit.openTemporary(jEdit.getActiveView(), null, path, true, null); jEdit.commitTemporary(buffer); } } if(buffer == null) buffer = jEdit.getFirstBuffer(); stack.push(buffer); editPaneBuffers.add(buffer); } else if ("buff".equals(st.sval)) { String path = (String)stack.pop(); buffer = jEdit.getBuffer(path); if (buffer == null) { Log.log(Log.WARNING, this, "Buffer " + path + " doesn't exist"); } else { editPaneBuffers.add(buffer); } } else if ("bufferset".equals(st.sval)) { // pop the bufferset scope. Not used anymore but still here for compatibility // with old perspectives stack.pop(); buffer = (Buffer) stack.pop(); editPane = createEditPane(buffer); stack.push(editPane); BufferSet bufferSet = editPane.getBufferSet(); int i = 0; for (Buffer buff : editPaneBuffers) { bufferSet.addBufferAt(buff,i); i++; } editPaneBuffers.clear(); } break; case StreamTokenizer.TT_NUMBER: stack.push((int)st.nval); break; case '"': stack.push(st.sval); break; } } // Backward compatibility with pre-bufferset versions Object obj = stack.peek(); if (obj instanceof Buffer) { obj = editPane = createEditPane((Buffer)obj); } updateGutterBorders(); return (Component)obj; }
// in org/gjt/sp/jedit/pluginmgr/MirrorList.java
private void readXml() throws IOException { String settingsDirectory = jEdit.getSettingsDirectory(); if(settingsDirectory == null) return; File mirrorList = new File(MiscUtilities.constructPath( settingsDirectory,"mirrorList.xml")); if(!mirrorList.exists()) return; InputStream inputStream = null; try { inputStream = new BufferedInputStream(new FileInputStream(mirrorList)); ByteArrayOutputStream out = new ByteArrayOutputStream(); IOUtilities.copyStream(null,inputStream,out, false); xml = out.toString(); } finally { IOUtilities.closeQuietly(inputStream); } }
// in org/gjt/sp/jedit/pluginmgr/MirrorList.java
private void downloadXml(String path) throws IOException { InputStream inputStream = null; try { inputStream = new URL(path).openStream(); ByteArrayOutputStream out = new ByteArrayOutputStream(); IOUtilities.copyStream(null,inputStream,out, false); xml = out.toString(); } finally { IOUtilities.closeQuietly(inputStream); } }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
private static Collection<String> getDeclaredJars(String jarName) throws IOException { Collection<String> jarList = new ArrayList<String>(); PluginJAR pluginJAR = new PluginJAR(new File(jarName)); PluginJAR.PluginCacheEntry pluginCacheEntry = PluginJAR.getPluginCache(pluginJAR); if (pluginCacheEntry == null) { pluginCacheEntry = pluginJAR.generateCache(); } Properties cachedProperties = pluginCacheEntry.cachedProperties; String jars = cachedProperties.getProperty("plugin." + pluginCacheEntry.pluginClass + ".jars"); if (jars != null) { String dir = MiscUtilities.getParentOfPath(pluginJAR.getPath()); StringTokenizer st = new StringTokenizer(jars); while (st.hasMoreTokens()) { String _jarPath = MiscUtilities.constructPath(dir, st.nextToken()); if (new File(_jarPath).exists()) jarList.add(_jarPath); } } jarList.add(jarName); return jarList; }
// in org/gjt/sp/jedit/gui/PingPongList.java
Override public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { return data; }
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
private static Map<String, HistoryModel> loadFromReader(BufferedReader in) throws IOException { Map<String, HistoryModel> result = new HashMap<String, HistoryModel>(); HistoryModel currentModel = null; String line; while((line = in.readLine()) != null) { if(line.length() > 0 && line.charAt(0) == '[' && line.charAt(line.length() - 1) == ']') { if(currentModel != null) { result.put(currentModel.getName(), currentModel); } String modelName = MiscUtilities .escapesToChars(line.substring( 1,line.length() - 1)); currentModel = new HistoryModel( modelName); } else if(currentModel == null) { throw new IOException("History data starts" + " before model name"); } else { currentModel.addElement(MiscUtilities .escapesToChars(line)); } } if(currentModel != null) { result.put(currentModel.getName(),currentModel); } return result; }
// in org/gjt/sp/jedit/PropertyManager.java
void loadSystemProps(InputStream in) throws IOException { loadProps(system,in); }
// in org/gjt/sp/jedit/PropertyManager.java
void loadSystemProps(Reader in) throws IOException { loadProps(system,in); }
// in org/gjt/sp/jedit/PropertyManager.java
void loadSiteProps(InputStream in) throws IOException { loadProps(site,in); }
// in org/gjt/sp/jedit/PropertyManager.java
void loadLocalizationProps(Reader in) throws IOException { if (in == null) localization.clear(); else loadProps(localization,in); }
// in org/gjt/sp/jedit/PropertyManager.java
void loadUserProps(InputStream in) throws IOException { loadProps(user,in); }
// in org/gjt/sp/jedit/PropertyManager.java
void saveUserProps(OutputStream out) throws IOException { user.store(out,"jEdit properties"); }
// in org/gjt/sp/jedit/PropertyManager.java
Properties loadPluginProps(InputStream in) throws IOException { Properties plugin = new Properties(); loadProps(plugin,in); plugins.add(plugin); return plugin; }
// in org/gjt/sp/jedit/PropertyManager.java
private static void loadProps(Properties into, InputStream in) throws IOException { try { into.load(in); } finally { in.close(); } }
// in org/gjt/sp/jedit/PropertyManager.java
private static void loadProps(Properties into, Reader in) throws IOException { try { into.load(in); } finally { in.close(); } }
// in org/gjt/sp/jedit/bsh/CommandLineReader.java
public int read() throws IOException { int b; if ( state == sentSemi ) { state = lastCharNL; return '\n'; } // skip CR while ( (b = in.read()) == '\r' ); if ( b == '\n' ) if ( state == lastCharNL ) { b = ';'; state = sentSemi; } else state = lastCharNL; else state = normal; return b; }
// in org/gjt/sp/jedit/bsh/CommandLineReader.java
public int read(char buff[], int off, int len) throws IOException { int b = read(); if ( b == -1 ) return -1; // EOF, not zero read apparently else { buff[off]=(char)b; return 1; } }
// in org/gjt/sp/jedit/bsh/Parser.java
public static void main( String [] args ) throws IOException, ParseException { boolean print = false; int i=0; if ( args[0].equals("-p") ) { i++; print=true; } for(; i< args.length; i++) { Reader in = new FileReader(args[i]); Parser parser = new Parser(in); parser.setRetainComments(true); while( !parser.Line()/*eof*/ ) if ( print ) System.out.println( parser.popNode() ); } }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
static final int hexval(char c) throws java.io.IOException { switch(c) { case '0' : return 0; case '1' : return 1; case '2' : return 2; case '3' : return 3; case '4' : return 4; case '5' : return 5; case '6' : return 6; case '7' : return 7; case '8' : return 8; case '9' : return 9; case 'a' : case 'A' : return 10; case 'b' : case 'B' : return 11; case 'c' : case 'C' : return 12; case 'd' : case 'D' : return 13; case 'e' : case 'E' : return 14; case 'f' : case 'F' : return 15; } throw new java.io.IOException(); // Should never come here }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
protected void FillBuff() throws java.io.IOException { int i; if (maxNextCharInd == 4096) maxNextCharInd = nextCharInd = 0; try { if ((i = inputStream.read(nextCharBuf, maxNextCharInd, 4096 - maxNextCharInd)) == -1) { inputStream.close(); throw new java.io.IOException(); } else maxNextCharInd += i; return; } catch(java.io.IOException e) { if (bufpos != 0) { --bufpos; backup(0); } else { bufline[bufpos] = line; bufcolumn[bufpos] = column; } throw e; } }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
protected char ReadByte() throws java.io.IOException { if (++nextCharInd >= maxNextCharInd) FillBuff(); return nextCharBuf[nextCharInd]; }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
public char BeginToken() throws java.io.IOException { if (inBuf > 0) { --inBuf; if (++bufpos == bufsize) bufpos = 0; tokenBegin = bufpos; return buffer[bufpos]; } tokenBegin = 0; bufpos = -1; return readChar(); }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
public char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; if (++bufpos == bufsize) bufpos = 0; return buffer[bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if ((buffer[bufpos] = c = ReadByte()) == '\\') { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = ReadByte()) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch(java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = ReadByte()) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval(ReadByte()) << 8 | hexval(ReadByte()) << 4 | hexval(ReadByte())); column += 4; } catch(java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; else { backup(backSlashCnt - 1); return '\\'; } } else { UpdateLineColumn(c); return (c); } }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public void addClassPath( URL path ) throws IOException { if ( baseLoader == null ) setClassPath( new URL [] { path } ); else { // opportunity here for listener in classpath baseLoader.addURL( path ); baseClassPath.add( path ); classLoaderChanged(); } }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public void add( URL url ) throws IOException { path.add(url); if ( mapsInitialized ) map( url ); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
synchronized void map( URL url ) throws IOException { String name = url.getFile(); File f = new File( name ); if ( f.isDirectory() ) { classMapping( "Directory "+ f.toString() ); map( traverseDirForClasses( f ), new DirClassSource(f) ); } else if ( isArchiveFileName( name ) ) { classMapping("Archive: "+url ); map( searchJarForClasses( url ), new JarClassSource(url) ); } /* else if ( isClassFileName( name ) ) map( looseClass( name ), url ); */ else { String s = "Not a classpath component: "+ name ; errorWhileMapping( s ); } }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
static String [] traverseDirForClasses( File dir ) throws IOException { List list = traverseDirForClassesAux( dir, dir ); return (String[])list.toArray( new String[0] ); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
static List traverseDirForClassesAux( File topDir, File dir ) throws IOException { List list = new ArrayList(); String top = topDir.getAbsolutePath(); File [] children = dir.listFiles(); for (int i=0; i< children.length; i++) { File child = children[i]; if ( child.isDirectory() ) list.addAll( traverseDirForClassesAux( topDir, child ) ); else { String name = child.getAbsolutePath(); if ( isClassFileName( name ) ) { /* Remove absolute (topdir) portion of path and leave package-class part */ if ( name.startsWith( top ) ) name = name.substring( top.length()+1 ); else throw new IOException( "problem parsing paths" ); name = canonicalizeClassName(name); list.add( name ); } } } return list; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
static String [] searchJarForClasses( URL jar ) throws IOException { Vector v = new Vector(); InputStream in = jar.openStream(); ZipInputStream zin = new ZipInputStream(in); ZipEntry ze; while( (ze= zin.getNextEntry()) != null ) { String name=ze.getName(); if ( isClassFileName( name ) ) v.addElement( canonicalizeClassName(name) ); } zin.close(); String [] sa = new String [v.size()]; v.copyInto(sa); return sa; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
private synchronized void writeObject(java.io.ObjectOutputStream s) throws IOException { // clear name resolvers... don't know if this is necessary. names = null; s.defaultWriteObject(); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
public void addClassPath( URL path ) throws IOException { }
// in org/gjt/sp/jedit/bsh/Remote.java
public static int eval( String url, String text ) throws IOException { String returnValue = null; if ( url.startsWith( "http:" ) ) { returnValue = doHttp( url, text ); } else if ( url.startsWith( "bsh:" ) ) { returnValue = doBsh( url, text ); } else throw new IOException( "Unrecognized URL type." +"Scheme must be http:// or bsh://"); try { return Integer.parseInt( returnValue ); } catch ( Exception e ) { // this convention may change... return 0; } }
// in org/gjt/sp/jedit/bsh/Remote.java
private static void sendLine( String line, OutputStream outPipe ) throws IOException { outPipe.write( line.getBytes() ); outPipe.flush(); }
// in org/gjt/sp/jedit/bsh/Remote.java
static String getFile( String name ) throws FileNotFoundException, IOException { StringBuilder sb = new StringBuilder(); BufferedReader bin = new BufferedReader( new FileReader( name ) ); String line; while ( (line=bin.readLine()) != null ) sb.append( line ).append( "\n" ); return sb.toString(); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public static void main( String [] args ) { if ( args.length > 0 ) { String filename = args[0]; String [] bshArgs; if ( args.length > 1 ) { bshArgs = new String [ args.length -1 ]; System.arraycopy( args, 1, bshArgs, 0, args.length-1 ); } else bshArgs = new String [0]; Interpreter interpreter = new Interpreter(); //System.out.println("run i = "+interpreter); interpreter.setu( "bsh.args", bshArgs ); try { Object result = interpreter.source( filename, interpreter.globalNameSpace ); if ( result instanceof Class ) try { invokeMain( (Class)result, bshArgs ); } catch ( Exception e ) { Object o = e; if ( e instanceof InvocationTargetException ) o = ((InvocationTargetException)e) .getTargetException(); System.err.println( "Class: "+result+" main method threw exception:"+o); } } catch ( FileNotFoundException e ) { System.out.println("File not found: "+e); } catch ( TargetError e ) { System.out.println("Script threw exception: "+e); if ( e.inNativeCode() ) e.printStackTrace( DEBUG, System.err ); } catch ( EvalError e ) { System.out.println("Evaluation Error: "+e); } catch ( IOException e ) { System.out.println("I/O Error: "+e); } } else { // Workaround for JDK bug 4071281, where system.in.available() // returns too large a value. This bug has been fixed in JDK 1.2. InputStream src; if ( System.getProperty("os.name").startsWith("Windows") && System.getProperty("java.version").startsWith("1.1.")) { src = new FilterInputStream(System.in) { public int available() throws IOException { return 0; } }; } else src = System.in; Reader in = new CommandLineReader( new InputStreamReader(src)); Interpreter interpreter = new Interpreter( in, System.out, System.err, true ); interpreter.run(); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public int available() throws IOException { return 0; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object source( String filename, NameSpace nameSpace ) throws FileNotFoundException, IOException, EvalError { File file = pathToFile( filename ); if ( Interpreter.DEBUG ) debug("Sourcing file: "+file); Reader sourceIn = new BufferedReader( new FileReader(file) ); try { return eval( sourceIn, nameSpace, filename ); } finally { sourceIn.close(); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object source( String filename ) throws FileNotFoundException, IOException, EvalError { return source( filename, globalNameSpace ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public File pathToFile( String fileName ) throws IOException { File file = new File( fileName ); // if relative, fix up to bsh.cwd if ( !file.isAbsolute() ) { String cwd = (String)getu("bsh.cwd"); file = new File( cwd + File.separator + fileName ); } // The canonical file name is also absolute. // No need for getAbsolutePath() here... return new File( file.getCanonicalPath() ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
private void readObject(ObjectInputStream stream) throws java.io.IOException, ClassNotFoundException { stream.defaultReadObject(); // set transient fields if ( console != null ) { setOut( console.getOut() ); setErr( console.getErr() ); } else { setOut( System.out ); setErr( System.err ); } }
// in org/gjt/sp/jedit/Registers.java
private static String stripEOLChars(String selection) throws IOException { boolean trailingEOL = selection.endsWith("\n") || selection.endsWith(System.getProperty( "line.separator")); // Some Java versions return the clipboard // contents using the native line separator, // so have to convert it here BufferedReader in = new BufferedReader( new StringReader(selection)); StringBuilder buf = new StringBuilder(selection.length()); String line; while((line = in.readLine()) != null) { // broken Eclipse workaround! // 24 Febuary 2004 if(line.endsWith("\0")) { line = line.substring(0, line.length() - 1); } buf.append(line); buf.append('\n'); } // remove trailing \n if(!trailingEOL && buf.length() != 0) buf.setLength(buf.length() - 1); return buf.toString(); }
// in org/gjt/sp/jedit/io/UrlVFS.java
public InputStream _createInputStream(Object session, String path, boolean ignoreErrors, Component comp) throws IOException { try { return new URL(path).openStream(); } catch(MalformedURLException mu) { Log.log(Log.ERROR,this,mu); String[] args = { mu.getMessage() }; VFSManager.error(comp,path,"ioerror.badurl",args); return null; } }
// in org/gjt/sp/jedit/io/UrlVFS.java
public OutputStream _createOutputStream(Object session, String path, Component comp) throws IOException { try { return new URL(path).openConnection() .getOutputStream(); } catch(MalformedURLException mu) { Log.log(Log.ERROR,this,mu); String[] args = { mu.getMessage() }; VFSManager.error(comp,path,"ioerror.badurl",args); return null; } }
// in org/gjt/sp/jedit/io/VFSFile.java
public boolean isBinary(Object session) throws IOException { InputStream in = getVFS()._createInputStream(session,getPath(), false,jEdit.getActiveView()); if(in == null) throw new IOException("Unable to get a Stream for this file "+this); try { return MiscUtilities.isBinary(in); } finally { IOUtilities.closeQuietly(in); } }
// in org/gjt/sp/jedit/io/CopyFileWorker.java
private void copy(Object vfsSession, VFS vfs, String sourcePath, String sourceName, String targetPath) throws IOException, InterruptedException { String name = getTargetName(vfsSession, vfs, targetPath, sourceName); if (name == null) { return; } String targetName = MiscUtilities.constructPath(targetPath, name); CountDownLatch latch = new CountDownLatch(1); ThreadUtilities.runInBackground(new CopyFileWorker(comp, sourcePath, targetName, latch)); latch.await(); }
// in org/gjt/sp/jedit/io/CopyFileWorker.java
private String getTargetName(Object session, VFS vfs, String path, String baseName) throws IOException { if (behavior == Behavior.OVERWRITE) { // We want to overwrite, no need to check anything return baseName; } String s = MiscUtilities.constructPath(target, baseName); VFSFile file = vfs._getFile(session, s, comp); if (file == null) { // The target file do not exist, perfect return baseName; } if (behavior == Behavior.SKIP) return null; String extension = MiscUtilities.getFileExtension(baseName); String nameNoExtension = MiscUtilities.getBaseName(baseName); for (int i = 1;i<1000;i++) { String name = nameNoExtension + "-copy-" + i; if (extension != null) name += extension; s = MiscUtilities.constructPath(path, name); file = vfs._getFile(session, s, comp); if (file == null) return name; } return null; }
// in org/gjt/sp/jedit/io/EncodingWithBOM.java
public Reader getTextReader(InputStream in) throws IOException { byte[] actualMark = new byte[bom.length]; int count = in.read(actualMark); if (count < bom.length || !Arrays.equals(actualMark, bom)) { throw new MalformedInputException(0); } return plain.getTextReader(in); }
// in org/gjt/sp/jedit/io/EncodingWithBOM.java
public Writer getTextWriter(OutputStream out) throws IOException { out.write(bom); return plain.getTextWriter(out); }
// in org/gjt/sp/jedit/io/EncodingWithBOM.java
public Reader getPermissiveTextReader(InputStream in) throws IOException { byte[] actualMark = new byte[bom.length]; int count = in.read(actualMark); if (count < bom.length || !Arrays.equals(actualMark, bom)) { // Concatenate the non-BOM bytes and the rest of // input so that the non-BOM bytes are reinterepreted // as some characters. in = new SequenceInputStream( new ByteArrayInputStream(actualMark, 0, count), in); } return plain.getPermissiveTextReader(in); }
// in org/gjt/sp/jedit/io/EncodingWithBOM.java
public String detectEncoding(InputStream sample) throws IOException { byte[] mark = new byte[4]; int count = sample.read(mark); byte low = (byte)(BOM16 & 0xff); byte high = (byte)((BOM16 >> 8) & 0xff); if (count >= 4) { if (mark[0] == low && mark[1] == high && mark[2] == 0x00 && mark[3] == 0x00) { return "X-UTF-32LE-BOM"; } else if (mark[0] == 0x00 && mark[1] == 0x00 && mark[2] == high && mark[3] == low) { return "X-UTF-32BE-BOM"; } } if (count >= 2) { if (mark[0] == low && mark[1] == high) { return "x-UTF-16LE-BOM"; } else if (mark[0] == high && mark[1] == low) { // "x-UTF-16BE-BOM" does not available. // But an encoder for "UTF-16" actually uses // big endian with corresponding BOM. It just // works as "UTF-16BE with BOM". return "UTF-16"; } } if (count >= UTF8BOM.length) { int i = 0; while (i < UTF8BOM.length) { if (mark[i] != UTF8BOM[i]) { break; } ++i; } if (i == UTF8BOM.length) { return "UTF-8Y"; } } return null; }
// in org/gjt/sp/jedit/io/XMLEncodingDetector.java
public String detectEncoding(InputStream sample) throws IOException { // Length of longest XML PI used for encoding detection. // <?xml version="1.0" encoding="................"?> final int XML_PI_LENGTH = 50; byte[] _xmlPI = new byte[XML_PI_LENGTH]; int offset = 0; int count; while((count = sample.read(_xmlPI,offset, XML_PI_LENGTH - offset)) != -1) { offset += count; if(offset == XML_PI_LENGTH) break; } return getXMLEncoding(new String(_xmlPI,0,offset,"ASCII")); }
// in org/gjt/sp/jedit/io/RegexEncodingDetector.java
public String detectEncoding(InputStream sample) throws IOException { InputStreamReader reader = new InputStreamReader(sample); final int bufferSize = 1024; char[] buffer = new char[bufferSize]; int readSize = reader.read(buffer, 0, bufferSize); if (readSize > 0) { Matcher matcher = pattern.matcher( CharBuffer.wrap(buffer, 0, readSize)); // Tracking of this implicit state within Matcher // is required to know where is the start of // replacement after calling appendReplacement(). int appendPosition = 0; while (matcher.find()) { String extracted = extractReplacement( matcher, appendPosition, replacement); if (EncodingServer.hasEncoding(extracted)) { return extracted; } appendPosition = matcher.end(); } } return null; }
// in org/gjt/sp/jedit/io/AutoDetection.java
public static boolean isGzipped(InputStream sample) throws IOException { int magic1 = GZIPInputStream.GZIP_MAGIC & 0xff; int magic2 = (GZIPInputStream.GZIP_MAGIC >> 8) & 0xff; return sample.read() == magic1 && sample.read() == magic2; }
// in org/gjt/sp/jedit/io/AutoDetection.java
public static String getDetectedEncoding(BufferedInputStream markedStream) throws IOException { List<EncodingDetector> detectors = getEncodingDetectors(); for (EncodingDetector detector: detectors) { // FIXME: Here the method reset() can fail if the // previous detector read more than buffer size of // markedStream. markedStream.reset(); // Wrap once more so that calling mark() // or reset() in detectEncoding() don't // alter the mark position of markedStream. String detected = detector.detectEncoding( new BufferedInputStream(markedStream)); if (detected != null) { return detected; } } return null; }
// in org/gjt/sp/jedit/io/AutoDetection.java
public BufferedInputStream getRewindedStream() throws IOException { markedStream.reset(); return markedStream; }
// in org/gjt/sp/jedit/io/CharsetEncoding.java
public Reader getTextReader(InputStream in) throws IOException { // Pass the decoder explicitly to report a decode error // as an exception instead of replacing with "\uFFFD". // The form "InputStreamReader(in, encoding)" seemed to use // CodingErrorAction.REPLACE internally. return new InputStreamReader(in, body.newDecoder()); }
// in org/gjt/sp/jedit/io/CharsetEncoding.java
public Writer getTextWriter(OutputStream out) throws IOException { // Pass the encoder explicitly because of same reason // in getTextReader(); return new OutputStreamWriter(out, body.newEncoder()); }
// in org/gjt/sp/jedit/io/CharsetEncoding.java
public Reader getPermissiveTextReader(InputStream in) throws IOException { // Use REPLACE action to indicate where the coding error // happened by the replacement character "\uFFFD". CharsetDecoder permissive = body.newDecoder(); permissive.onMalformedInput(CodingErrorAction.REPLACE); permissive.onUnmappableCharacter(CodingErrorAction.REPLACE); return new InputStreamReader(in, permissive); }
// in org/gjt/sp/jedit/io/FileVFS.java
Override public String _canonPath(Object session, String path, Component comp) throws IOException { return MiscUtilities.canonPath(path); }
// in org/gjt/sp/jedit/io/FileVFS.java
Override public void _backup(Object session, String path, Component comp) throws IOException { File file = new File(path); if (!file.exists()) return; MiscUtilities.saveBackup(file); }
// in org/gjt/sp/jedit/io/FileVFS.java
Override public InputStream _createInputStream(Object session, String path, boolean ignoreErrors, Component comp) throws IOException { try { return new FileInputStream(path); } catch(IOException io) { if(ignoreErrors) return null; else throw io; } }
// in org/gjt/sp/jedit/io/FileVFS.java
Override public OutputStream _createOutputStream(Object session, String path, Component comp) throws IOException { return new FileOutputStream(path); }
// in org/gjt/sp/jedit/io/EncodingServer.java
public static Reader getTextReader(InputStream in, String encoding) throws IOException { return getEncoding(encoding).getTextReader(in); }
// in org/gjt/sp/jedit/io/EncodingServer.java
public static Writer getTextWriter(OutputStream out, String encoding) throws IOException { return getEncoding(encoding).getTextWriter(out); }
// in org/gjt/sp/jedit/io/VFS.java
public static boolean copy(ProgressObserver progress, VFS sourceVFS, Object sourceSession,String sourcePath, VFS targetVFS, Object targetSession,String targetPath, Component comp, boolean canStop) throws IOException { return copy(progress, sourceVFS, sourceSession, sourcePath, targetVFS, targetSession, targetPath, comp, canStop, true); }
// in org/gjt/sp/jedit/io/VFS.java
public static boolean copy(ProgressObserver progress, VFS sourceVFS, Object sourceSession,String sourcePath, VFS targetVFS, Object targetSession,String targetPath, Component comp, boolean canStop, boolean sendVFSUpdate) throws IOException { if (progress != null) progress.setStatus("Initializing"); InputStream in = null; OutputStream out = null; try { VFSFile sourceVFSFile = sourceVFS._getFile(sourceSession, sourcePath, comp); if (sourceVFSFile == null) throw new FileNotFoundException("source path " + sourcePath + " doesn't exists"); if (progress != null) { progress.setMaximum(sourceVFSFile.getLength()); } VFSFile targetVFSFile = targetVFS._getFile(targetSession, targetPath, comp); if (targetVFSFile == null) { String parentTargetPath = MiscUtilities.getParentOfPath(targetPath); VFSFile parentTargetVFSFile = targetVFS._getFile(targetSession, parentTargetPath, comp); if (parentTargetVFSFile == null) throw new FileNotFoundException("target path " + parentTargetPath + " doesn't exists"); if (parentTargetVFSFile.getType() == VFSFile.DIRECTORY) { String targetFilename = MiscUtilities.getFileName(targetPath); targetPath = MiscUtilities.constructPath(parentTargetPath, targetFilename); } else { throw new IOException("The parent of target path is a file"); } } else if (targetVFSFile.getType() == VFSFile.DIRECTORY) { if (targetVFSFile.getPath().equals(sourceVFSFile.getPath())) return false; targetPath = MiscUtilities.constructPath(targetPath, sourceVFSFile.getName()); } in = new BufferedInputStream(sourceVFS._createInputStream(sourceSession, sourcePath, false, comp)); out = new BufferedOutputStream(targetVFS._createOutputStream(targetSession, targetPath, comp)); boolean copyResult = IOUtilities.copyStream(IOBUFSIZE, progress, in, out, canStop); if (sendVFSUpdate) VFSManager.sendVFSUpdate(targetVFS, targetPath, true); return copyResult; } finally { IOUtilities.closeQuietly(in); IOUtilities.closeQuietly(out); } }
// in org/gjt/sp/jedit/io/VFS.java
public static boolean copy(ProgressObserver progress, String sourcePath,String targetPath, Component comp, boolean canStop, boolean sendVFSUpdate) throws IOException { VFS sourceVFS = VFSManager.getVFSForPath(sourcePath); Object sourceSession = sourceVFS.createVFSSession(sourcePath, comp); if (sourceSession == null) { Log.log(Log.WARNING, VFS.class, "Unable to get a valid session from " + sourceVFS + " for path " + sourcePath); return false; } VFS targetVFS = VFSManager.getVFSForPath(targetPath); Object targetSession = targetVFS.createVFSSession(targetPath, comp); if (targetSession == null) { Log.log(Log.WARNING, VFS.class, "Unable to get a valid session from " + targetVFS + " for path " + targetPath); return false; } return copy(progress, sourceVFS, sourceSession, sourcePath, targetVFS, targetSession, targetPath, comp,canStop, sendVFSUpdate); }
// in org/gjt/sp/jedit/io/VFS.java
public static boolean copy(ProgressObserver progress, String sourcePath,String targetPath, Component comp, boolean canStop) throws IOException { return copy(progress, sourcePath, targetPath, comp, canStop, true); }
// in org/gjt/sp/jedit/io/VFS.java
public String _canonPath(Object session, String path, Component comp) throws IOException { return path; }
// in org/gjt/sp/jedit/io/VFS.java
public String[] _listDirectory(Object session, String directory, String glob, boolean recursive, Component comp ) throws IOException { String[] retval = _listDirectory(session, directory, glob, recursive, comp, true, false); return retval; }
// in org/gjt/sp/jedit/io/VFS.java
public String[] _listDirectory(Object session, String directory, String glob, boolean recursive, Component comp, boolean skipBinary, boolean skipHidden) throws IOException { VFSFileFilter filter = new GlobVFSFileFilter(glob); return _listDirectory(session, directory, filter, recursive, comp, skipBinary, skipHidden); }
// in org/gjt/sp/jedit/io/VFS.java
public String[] _listDirectory(Object session, String directory, VFSFileFilter filter, boolean recursive, Component comp, boolean skipBinary, boolean skipHidden) throws IOException { List<String> files = new ArrayList<String>(100); listFiles(session,new HashSet<String>(), files,directory,filter, recursive, comp, skipBinary, skipHidden); String[] retVal = files.toArray(new String[files.size()]); Arrays.sort(retVal,new StandardUtilities.StringCompare<String>(true)); return retVal; }
// in org/gjt/sp/jedit/io/VFS.java
public VFSFile[] _listFiles(Object session, String directory, Component comp) throws IOException { VFSManager.error(comp,directory,"vfs.not-supported.list",new String[] { name }); return null; }
// in org/gjt/sp/jedit/io/VFS.java
public VFSFile _getFile(Object session, String path, Component comp) throws IOException { return null; }
// in org/gjt/sp/jedit/io/VFS.java
public boolean _delete(Object session, String path, Component comp) throws IOException { return false; }
// in org/gjt/sp/jedit/io/VFS.java
public boolean _rename(Object session, String from, String to, Component comp) throws IOException { return false; }
// in org/gjt/sp/jedit/io/VFS.java
public boolean _mkdir(Object session, String directory, Component comp) throws IOException { return false; }
// in org/gjt/sp/jedit/io/VFS.java
public void _backup(Object session, String path, Component comp) throws IOException { // File systems do not like some characters, which // may be part of a general path. Let's get rid of them. String sForeignChars = ":*?\"<>|"; // Construct a regex from sForeignChars StringBuilder sbForeignCharsEsc = new StringBuilder(20); for (int i = 0; i < sForeignChars.length(); i++) { sbForeignCharsEsc.append("\\"); sbForeignCharsEsc.append(sForeignChars.charAt(i)); } String pathNorm = path.replaceAll("[" + sbForeignCharsEsc + "]", "_"); // maybe the file is not applicable to local filesystem // but don't worry - for backup purposes it may be out // of a real filesystem File file = new File(pathNorm); File backupDir = MiscUtilities.prepareBackupDirectory(file); if (!backupDir.exists()) { // Usually that means there is no specified backup // directory. Log.log(Log.WARNING, VFS.class, "Backup of file " + path + " failed. Directory " + backupDir + " does not exist."); return; } File backupFile = MiscUtilities.prepareBackupFile(file, backupDir); if (backupFile == null) { return; } // do copy using VFS.copy VFS vfsDst = VFSManager.getVFSForPath(backupFile.getPath()); Object sessionDst = vfsDst.createVFSSessionSafe( backupFile.getPath(), comp); if (sessionDst == null) { return; } try { VFS vfsSrc = VFSManager.getVFSForPath(path); if (!copy(null, vfsSrc, session, path, vfsDst, sessionDst, backupFile.getPath(), comp, true)) { Log.log(Log.WARNING, VFS.class, "Backup of file " + path + " failed. Copy to " + backupFile + " failed."); } } finally { vfsDst._endVFSSession(sessionDst, comp); } }
// in org/gjt/sp/jedit/io/VFS.java
public InputStream _createInputStream(Object session, String path, boolean ignoreErrors, Component comp) throws IOException { VFSManager.error(comp,path,"vfs.not-supported.load",new String[] { name }); return null; }
// in org/gjt/sp/jedit/io/VFS.java
public OutputStream _createOutputStream(Object session, String path, Component comp) throws IOException { VFSManager.error(comp,path,"vfs.not-supported.save",new String[] { name }); return null; }
// in org/gjt/sp/jedit/io/VFS.java
public void _saveComplete(Object session, Buffer buffer, String path, Component comp) throws IOException {}
// in org/gjt/sp/jedit/io/VFS.java
public void _finishTwoStageSave(Object session, Buffer buffer, String path, Component comp) throws IOException { }
// in org/gjt/sp/jedit/io/VFS.java
public void _endVFSSession(Object session, Component comp) throws IOException { }
// in org/gjt/sp/jedit/io/VFS.java
private void listFiles(Object session, Collection<String> stack, List<String> files, String directory, VFSFileFilter filter, boolean recursive, Component comp, boolean skipBinary, boolean skipHidden) throws IOException { if (recursive && !MiscUtilities.isURL(directory)) { String resolvedPath = MiscUtilities.resolveSymlinks(directory); /* * If looking at a symlink, do not traverse the * resolved path more than once. */ if (!directory.equals(resolvedPath)) { if (stack.contains(resolvedPath)) { Log.log(Log.ERROR,this, "Recursion in listFiles(): " + directory); return; } stack.add(resolvedPath); } } Thread ct = Thread.currentThread(); WorkThread wt = null; if (ct instanceof WorkThread) { wt = (WorkThread) ct; } VFSFile[] _files = _listFiles(session,directory, comp); if(_files == null || _files.length == 0) return; for(int i = 0; i < _files.length; i++) { if (wt != null && wt.isAborted() || ct.isInterrupted()) break; VFSFile file = _files[i]; if (skipHidden && (file.isHidden() || MiscUtilities.isBackup(file.getName()))) continue; if(!filter.accept(file)) continue; if(file.getType() == VFSFile.DIRECTORY || file.getType() == VFSFile.FILESYSTEM) { if(recursive) { String canonPath = _canonPath(session, file.getPath(),comp); listFiles(session,stack,files, canonPath,filter,recursive, comp, skipBinary, skipHidden); } } else // It's a regular file { if (skipBinary) { try { if (file.isBinary(session)) { Log.log(Log.NOTICE,this ,file.getPath() + ": skipped as a binary file"); continue; } } catch(IOException e) { Log.log(Log.ERROR,this,e); // may be not binary... } } files.add(file.getPath()); } } }
// in org/gjt/sp/jedit/proto/jeditresource/PluginResURLConnection.java
public void connect() throws IOException { if(!connected) { if(plugin == null) { in = jEdit.class.getResourceAsStream(resource); } else { PluginJAR[] plugins = jEdit.getPluginJARs(); for(int i = 0; i < plugins.length; i++) { PluginJAR jar = plugins[i]; String jarName =MiscUtilities.getFileName(jar.getPath()).toLowerCase(); if(plugin.equalsIgnoreCase(jarName)) { in = jar.getClassLoader() .getResourceAsStream(resource); break; } } } if(in == null) { throw new IOException("Resource not found: " + plugin + "!" + resource); } connected = true; } }
// in org/gjt/sp/jedit/proto/jeditresource/PluginResURLConnection.java
public InputStream getInputStream() throws IOException { connect(); return in; }
// in org/gjt/sp/jedit/proto/jeditresource/Handler.java
public URLConnection openConnection(URL url) throws IOException { PluginResURLConnection c = new PluginResURLConnection(url); c.connect(); return c; }
// in org/gjt/sp/jedit/jEdit.java
private static Reader getResourceAsUTF8Text(String name) throws IOException { InputStream bytes = jEdit.class.getResourceAsStream(name); if (bytes == null) { return null; } Reader text = null; try { // Using our CharsetEncoding to reliably detect // encoding errors. CharsetEncoding utf8 = new CharsetEncoding("UTF-8"); text = utf8.getTextReader(bytes); } finally { if (text == null) { bytes.close(); } } return text; }
// in org/gjt/sp/jedit/bufferio/BufferIORequest.java
protected Reader autodetect(InputStream in) throws IOException { return MiscUtilities.autodetect(in, buffer); }
// in org/gjt/sp/jedit/bufferio/BufferIORequest.java
protected SegmentBuffer read(Reader in, long length, boolean insert) throws IOException { /* we guess an initial size for the array */ IntegerArray endOffsets = new IntegerArray( Math.max(1,(int)(length / 50))); // only true if the file size is known boolean trackProgress = !buffer.isTemporary() && length != 0; if(trackProgress) { setMaximum(length); setValue(0); } // if the file size is not known, start with a resonable // default buffer size if(length == 0) length = IOBUFSIZE; SegmentBuffer seg = new SegmentBuffer((int)length + 1); char[] buf = new char[IOBUFSIZE]; /* Number of characters in 'buf' array. InputStream.read() doesn't always fill the array (eg, the file size is not a multiple of IOBUFSIZE, or it is a GZipped file, etc) */ int len; // True if a \n was read after a \r. Usually // means this is a DOS/Windows file boolean CRLF = false; // A \r was read, hence a MacOS file boolean CROnly = false; // Was the previous read character a \r? // If we read a \n and this is true, we assume // we have a DOS/Windows file boolean lastWasCR = false; // Number of lines read. Every 100 lines, we update the // progress bar int lineCount = 0; while((len = in.read(buf,0,buf.length)) != -1) { // Offset of previous line, relative to // the start of the I/O buffer (NOT // relative to the start of the document) int lastLine = 0; for(int i = 0; i < len; i++) { // Look for line endings. switch(buf[i]) { case '\r': // If we read a \r and // lastWasCR is also true, // it is probably a Mac file // (\r\r in stream) if(lastWasCR) { CROnly = true; CRLF = false; } // Otherwise set a flag, // so that \n knows that last // was a \r else { lastWasCR = true; } // Insert a line seg.append(buf,lastLine,i - lastLine); seg.append('\n'); endOffsets.add(seg.count); if(trackProgress && lineCount++ % PROGRESS_INTERVAL == 0) setValue(seg.count); // This is i+1 to take the // trailing \n into account lastLine = i + 1; break; case '\n': /* If lastWasCR is true, we just read a \r followed by a \n. We specify that this is a Windows file, but take no further action and just ignore the \r. */ if(lastWasCR) { CROnly = false; CRLF = true; lastWasCR = false; /* Bump lastLine so that the next line doesn't erronously pick up the \r */ lastLine = i + 1; } /* Otherwise, we found a \n that follows some other * character, hence we have a Unix file */ else { CROnly = false; CRLF = false; seg.append(buf,lastLine, i - lastLine); seg.append('\n'); endOffsets.add(seg.count); if(trackProgress && lineCount++ % PROGRESS_INTERVAL == 0) setValue(seg.count); lastLine = i + 1; } break; default: /* If we find some other character that follows a \r, so it is not a Windows file, and probably a Mac file */ if(lastWasCR) { CROnly = true; CRLF = false; lastWasCR = false; } break; } } if(trackProgress) setValue(seg.count); // Add remaining stuff from buffer seg.append(buf,lastLine,len - lastLine); } setAbortable(false); String lineSeparator; if(seg.count == 0) { // fix for "[ 865589 ] 0-byte files should open using // the default line seperator" lineSeparator = jEdit.getProperty( "buffer.lineSeparator", System.getProperty("line.separator")); } else if(CRLF) lineSeparator = "\r\n"; else if(CROnly) lineSeparator = "\r"; else lineSeparator = "\n"; // Chop trailing newline and/or ^Z (if any) int bufferLength = seg.count; if(bufferLength != 0) { char ch = seg.array[bufferLength - 1]; if(ch == 0x1a /* DOS ^Z */) seg.count--; } buffer.setBooleanProperty(Buffer.TRAILING_EOL,false); if(bufferLength != 0 && jEdit.getBooleanProperty("stripTrailingEOL")) { char ch = seg.array[bufferLength - 1]; if(ch == '\n') { buffer.setBooleanProperty(Buffer.TRAILING_EOL,true); seg.count--; endOffsets.setSize(endOffsets.getSize() - 1); } } // add a line marker at the end for proper offset manager // operation endOffsets.add(seg.count + 1); // to avoid having to deal with read/write locks and such, // we insert the loaded data into the buffer in the // post-load cleanup runnable, which runs in the AWT thread. if(!insert) { buffer.setProperty(LOAD_DATA,seg); buffer.setProperty(END_OFFSETS,endOffsets); buffer.setProperty(NEW_PATH,path); if(lineSeparator != null) buffer.setProperty(JEditBuffer.LINESEP,lineSeparator); } // used in insert() return seg; }
// in org/gjt/sp/jedit/bufferio/BufferIORequest.java
protected void write(Buffer buffer, OutputStream out) throws IOException { String encodingName = buffer.getStringProperty(JEditBuffer.ENCODING); Encoding encoding = EncodingServer.getEncoding(encodingName); Writer writer = encoding.getTextWriter( new BufferedOutputStream(out, getByteIOBufferSize())); Segment lineSegment = new Segment(); String newline = buffer.getStringProperty(JEditBuffer.LINESEP); if(newline == null) newline = System.getProperty("line.separator"); final int bufferLineCount = buffer.getLineCount(); setMaximum(bufferLineCount / PROGRESS_INTERVAL); setValue(0); int i = 0; while(i < bufferLineCount) { buffer.getLineText(i,lineSegment); try { writer.write(lineSegment.array, lineSegment.offset, lineSegment.count); if(i < bufferLineCount - 1 || (jEdit.getBooleanProperty("stripTrailingEOL") && buffer.getBooleanProperty(Buffer.TRAILING_EOL))) { writer.write(newline); } } catch(CharacterCodingException e) { String message = getWriteEncodingErrorMessage( encodingName, encoding, lineSegment, i); IOException wrapping = new CharConversionException(message); wrapping.initCause(e); throw wrapping; } if(++i % PROGRESS_INTERVAL == 0) setValue(i / PROGRESS_INTERVAL); } writer.flush(); }
// in org/gjt/sp/jedit/bufferio/BufferIORequest.java
private static int getFirstGuiltyCharacterIndex(Encoding encoding, Segment line) throws IOException { if(line.count < 1) { return -1; } else if(line.count == 1) { return 0; } Writer tester = encoding.getTextWriter( new OutputStream() { public void write(int b) {} }); for(int i = 0; i < line.count; ++i) { try { tester.write(line.array[line.offset + i]); } catch(CharacterCodingException e) { return i; } } return -1; }
// in org/gjt/sp/jedit/bufferio/MarkersSaveRequest.java
private void writeMarkers(OutputStream out) throws IOException { Writer o = new BufferedWriter(new OutputStreamWriter(out)); try { List<Marker> markers = buffer.getMarkers(); synchronized (markers) { setMaximum(markers.size()); for(int i = 0; i < markers.size(); i++) { setValue(i+1); Marker marker = markers.get(i); o.write('!'); o.write(marker.getShortcut()); o.write(';'); String pos = String.valueOf(marker.getPosition()); o.write(pos); o.write(';'); o.write(pos); o.write('\n'); } } } finally { o.close(); } }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
private void makeBackup() throws IOException { // Only backup once per session if(buffer.getProperty(Buffer.BACKED_UP) == null || jEdit.getBooleanProperty("backupEverySave")) { if (jEdit.getIntegerProperty("backups",1) > 0) vfs._backup(session,path,view); buffer.setBooleanProperty(Buffer.BACKED_UP, true); } }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
private InputStream getNakedStream() throws IOException { InputStream in = vfs._createInputStream(session,path,false,view); if(in != null) { return in; } throw new IOException("Unable to get a Stream for " + path); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
private long getContentLength() throws IOException { VFSFile entry = vfs._getFile(session,path,view); if(entry != null) return entry.getLength(); else return 0L; }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
private BufferedInputStream rewindContentsStream(BufferedInputStream markedStream, boolean gzipped) throws IOException { try { markedStream.reset(); return markedStream; } catch(IOException e) { Log.log(Log.NOTICE, this , path + ": Reopening to rewind the stream"); // Reopen the stream because the mark has been // invalidated while previous reading. markedStream.close(); InputStream in = getNakedStream(); try { if(gzipped) { in = new GZIPInputStream(in); } BufferedInputStream result = AutoDetection.getMarkedStream(in); in = null; return result; } finally { IOUtilities.closeQuietly(in); } } }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
private void readContents() throws IOException { long length = getContentLength(); BufferedInputStream markedStream = AutoDetection.getMarkedStream(getNakedStream()); try { boolean gzipped = false; // encodingProviders is consist of given // encodings as String or contents-aware // detectors as EncodingDetector. List<Object> encodingProviders = new ArrayList<Object>(); boolean autodetect = buffer.getBooleanProperty(Buffer.ENCODING_AUTODETECT); if(autodetect) { gzipped = AutoDetection.isGzipped(markedStream); markedStream.reset(); encodingProviders.addAll(AutoDetection.getEncodingDetectors()); // If the detected encoding fail, fallback to // the original encoding. encodingProviders.add(buffer.getStringProperty(JEditBuffer.ENCODING)); String fallbackEncodings = jEdit.getProperty("fallbackEncodings"); if(fallbackEncodings != null && fallbackEncodings.length() > 0) { for(String encoding: fallbackEncodings.split("\\s+")) { encodingProviders.add(encoding); } } } else { gzipped = buffer.getBooleanProperty(Buffer.GZIPPED); encodingProviders.add(buffer.getStringProperty(JEditBuffer.ENCODING)); } if(gzipped) { Log.log(Log.DEBUG, this, path + ": Stream is gzipped."); markedStream = AutoDetection.getMarkedStream( new GZIPInputStream(markedStream)); } Set<String> failedEncodings = new HashSet<String>(); Exception encodingError = null; for(Object encodingProvider: encodingProviders) { String encoding = null; if (encodingProvider instanceof String) { encoding = (String)encodingProvider; } else if(encodingProvider instanceof EncodingDetector) { markedStream = rewindContentsStream(markedStream, gzipped); encoding = ((EncodingDetector)encodingProvider).detectEncoding(new BufferedInputStream(markedStream)); } else { Log.log(Log.DEBUG, this, "Strange encodingProvider: " + encodingProvider); } if(encoding == null || encoding.length() <= 0 || failedEncodings.contains(encoding)) { continue; } markedStream = rewindContentsStream(markedStream, gzipped); try { read(EncodingServer.getTextReader(markedStream, encoding) , length, false); if(autodetect) { // Store the successful properties. if(gzipped) { buffer.setBooleanProperty(Buffer.GZIPPED,true); } buffer.setProperty(JEditBuffer.ENCODING, encoding); } return; } catch(CharConversionException e) { encodingError = e; } catch(CharacterCodingException e) { encodingError = e; } catch(UnsupportedEncodingException e) { encodingError = e; } catch(UnsupportedCharsetException e) { encodingError = e; } Log.log(Log.NOTICE, this, path + ": " + encoding + ": " + encodingError); failedEncodings.add(encoding); } // All possible detectors and encodings failed. Object[] pp = { TextUtilities.join(failedEncodings,","), "" }; if(failedEncodings.size() < 2) { pp[1] = encodingError.toString(); } else { pp[1] = "See details in Activity Log"; } VFSManager.error(view,path,"ioerror.encoding-error",pp,Log.NOTICE); markedStream = rewindContentsStream(markedStream, gzipped); read(EncodingServer.getEncoding( buffer.getStringProperty(JEditBuffer.ENCODING) ).getPermissiveTextReader(markedStream) , length, false); if(autodetect && gzipped) { buffer.setBooleanProperty(Buffer.GZIPPED,true); } } finally { markedStream.close(); } }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
private static void readMarkers(Buffer buffer, InputStream _in) throws IOException { // For `reload' command buffer.removeAllMarkers(); BufferedReader in = new BufferedReader(new InputStreamReader(_in)); try { String line; while((line = in.readLine()) != null) { // malformed marks file? if(line.length() == 0) continue; // compatibility kludge for jEdit 3.1 and earlier if(line.charAt(0) != '!') continue; char shortcut = line.charAt(1); int start = line.indexOf(';'); int end = line.indexOf(';',start + 1); int position = Integer.parseInt(line.substring(start + 1,end)); buffer.addMarker(shortcut,position); } buffer.setMarkersChanged(false); } finally { in.close(); } }
// in org/gjt/sp/jedit/JARClassLoader.java
public Enumeration getResources(String name) throws IOException { class SingleElementEnumeration implements Enumeration { private Object element; SingleElementEnumeration(Object element) { this.element = element; } public boolean hasMoreElements() { return element != null; } public Object nextElement() { if(element != null) { Object retval = element; element = null; return retval; } else throw new NoSuchElementException(); } } URL resource = getResource(name); return new SingleElementEnumeration(resource); }
// in org/gjt/sp/jedit/JARClassLoader.java
private void definePackage(String clazz) throws IOException { int idx = clazz.lastIndexOf('.'); if (idx != -1) { String name = clazz.substring(0, idx); if (getPackage(name) == null) definePackage(name, new JarFile(jar.getFile()).getManifest()); } }
// in org/gjt/sp/jedit/MiscUtilities.java
public static boolean isBinary(InputStream in) throws IOException { AutoDetection.Result detection = new AutoDetection.Result(in); // If an encoding is detected, this is a text stream if (detection.getDetectedEncoding() != null) { return false; } // Read the stream in system default encoding. The encoding // might be wrong. But enough for binary detection. try { return containsNullCharacter( new InputStreamReader(detection.getRewindedStream())); } catch (MalformedInputException mie) { // This error probably means the input is binary. return true; } }
// in org/gjt/sp/jedit/MiscUtilities.java
public static Reader autodetect(InputStream in, Buffer buffer) throws IOException { String encoding; if (buffer == null) encoding = System.getProperty("file.encoding"); else encoding = buffer.getStringProperty(JEditBuffer.ENCODING); boolean gzipped = false; if (buffer == null || buffer.getBooleanProperty(Buffer.ENCODING_AUTODETECT)) { AutoDetection.Result detection = new AutoDetection.Result(in); gzipped = detection.streamIsGzipped(); if (gzipped) { Log.log(Log.DEBUG, MiscUtilities.class , "Stream is Gzipped"); } String detected = detection.getDetectedEncoding(); if (detected != null) { encoding = detected; Log.log(Log.DEBUG, MiscUtilities.class , "Stream encoding detected is " + detected); } in = detection.getRewindedStream(); } else { // Make the stream buffered in the same way. in = AutoDetection.getMarkedStream(in); } Reader result = EncodingServer.getTextReader(in, encoding); if (buffer != null) { // Store the successful properties. if (gzipped) { buffer.setBooleanProperty(Buffer.GZIPPED,true); } buffer.setProperty(JEditBuffer.ENCODING, encoding); } return result; }
// in org/gjt/sp/jedit/MiscUtilities.java
private static boolean containsNullCharacter(Reader reader) throws IOException { int nbChars = jEdit.getIntegerProperty("vfs.binaryCheck.length",100); int authorized = jEdit.getIntegerProperty("vfs.binaryCheck.count",1); for (long i = 0L;i < nbChars;i++) { int c = reader.read(); if (c == -1) return false; if (c == 0) { authorized--; if (authorized == 0) return true; } } return false; }
// in org/gjt/sp/jedit/datatransfer/ListVFSFileTransferable.java
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (jEditFileList.equals(flavor)) { return files; } else if (DataFlavor.stringFlavor.equals(flavor)) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < files.size(); i++) { VFSFile vfsFile = files.get(i); if (i != 0) builder.append('\n'); builder.append(vfsFile.getPath()); } return builder.toString(); } else if (DataFlavor.javaFileListFlavor.equals(flavor)) { List<File> files = new ArrayList<File>(this.files.size()); for (VFSFile file : this.files) { if (file.getVFS() instanceof FileVFS) files.add(new File(file.getPath())); } return files; } throw new UnsupportedFlavorException(flavor); }
// in org/gjt/sp/jedit/datatransfer/RichTextTransferable.java
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (!isDataFlavorSupported(flavor)) throw new UnsupportedFlavorException(flavor); return new JEditRichText(text, mode); }
// in org/gjt/sp/jedit/datatransfer/JEditTransferable.java
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (!isDataFlavorSupported(flavor)) throw new UnsupportedFlavorException(flavor); Transferable transferable = flavors.get(flavor); return transferable.getTransferData(flavor); }
// in org/gjt/sp/jedit/browser/VFSBrowser.java
public void paste(VFSFile file) throws IOException, UnsupportedFlavorException { if (file == null) throw new IllegalArgumentException("file cannot be null"); String targetPath = null; switch (file.getType()) { case VFSFile.FILESYSTEM: return; case VFSFile.FILE: targetPath = MiscUtilities.getParentOfPath(file.getPath()); break; case VFSFile.DIRECTORY: targetPath = file.getPath(); break; } VFS vfs = VFSManager.getVFSForPath(targetPath); Object vfsSession = null; try { vfsSession = vfs.createVFSSession(targetPath, this); if (vfsSession == null) { Log.log(Log.ERROR, this, "Unable to create session for " + targetPath); return; } Transferable transferable = Registers.getRegister('$').getTransferable(); List<String> sources = new ArrayList<String>(); if (transferable.isDataFlavorSupported(ListVFSFileTransferable.jEditFileList)) { Iterable<VFSFile> copiedFiles = (Iterable<VFSFile>) transferable.getTransferData(ListVFSFileTransferable.jEditFileList); for (VFSFile copiedFile : copiedFiles) { sources.add(copiedFile.getPath()); } } else if (transferable.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { Iterable<File> copiedFiles = (Iterable<File>) transferable.getTransferData(DataFlavor.javaFileListFlavor); for (File copiedFile : copiedFiles) { sources.add(copiedFile.getAbsolutePath()); } } CopyFileWorker worker = new CopyFileWorker(this, sources, targetPath); ThreadUtilities.runInBackground(worker); } finally { vfs._endVFSSession(vfsSession, this); } }
// in org/gjt/sp/jedit/PluginJAR.java
public synchronized ZipFile getZipFile() throws IOException { if(zipFile == null) { Log.log(Log.DEBUG,this,"Opening " + path); zipFile = new ZipFile(path); } return zipFile; }
// in org/gjt/sp/jedit/PluginJAR.java
public PluginCacheEntry generateCache() throws IOException { properties = new Properties(); localizationProperties = new HashMap<String, Properties>(); List<String> classes = new LinkedList<String>(); List<String> resources = new LinkedList<String>(); ZipFile zipFile = getZipFile(); List<String> plugins = new LinkedList<String>(); PluginCacheEntry cache = new PluginCacheEntry(); cache.modTime = file.lastModified(); Enumeration<? extends ZipEntry> entries = zipFile.entries(); Pattern languageFilePattern = Pattern.compile("lang_(\\w+).properties"); while(entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); String name = entry.getName(); String lname = name.toLowerCase(); if("actions.xml".equals(lname)) { cache.actionsURI = classLoader.getResource(name); } else if("browser.actions.xml".equals(lname)) { cache.browserActionsURI = classLoader.getResource(name); } else if("dockables.xml".equals(lname)) { dockablesURI = classLoader.getResource(name); cache.dockablesURI = dockablesURI; } else if("services.xml".equals(lname)) { servicesURI = classLoader.getResource(name); cache.servicesURI = servicesURI; } else if(lname.endsWith(".props")) { InputStream in = null; try { in = classLoader.getResourceAsStream(name); properties.load(in); } finally { IOUtilities.closeQuietly(in); } } else if(name.endsWith(".class")) { String className = MiscUtilities .fileToClass(name); if(className.endsWith("Plugin")) { plugins.add(className); } classes.add(className); } else { Matcher matcher = languageFilePattern.matcher(lname); if (matcher.matches()) { String languageName = matcher.group(1); Properties props = new Properties(); InputStream in = null; try { in = classLoader.getResourceAsStream(name); props.load(in); localizationProperties.put(languageName, props); } finally { IOUtilities.closeQuietly(in); } } else resources.add(name); } } cache.cachedProperties = properties; cache.localizationProperties = localizationProperties; // this must be done before loading cachedProperties if (cache.localizationProperties != null) { localizationProperties = cache.localizationProperties; String currentLanguage = jEdit.getCurrentLanguage(); Properties langProperties = localizationProperties.get(currentLanguage); if (langProperties != null) { jEdit.addPluginProps(langProperties); } } jEdit.addPluginProps(properties); this.classes = cache.classes = classes.toArray( new String[classes.size()]); this.resources = cache.resources = resources.toArray( new String[resources.size()]); String label = null; for (String className : plugins) { String _label = jEdit.getProperty("plugin." + className + ".name"); String version = jEdit.getProperty("plugin." + className + ".version"); if(_label == null || version == null) { Log.log(Log.WARNING,this,"Ignoring: " + className); } else { cache.pluginClass = className; // Check if a plugin with the same name // is already loaded if (!continueLoading(className, cache.cachedProperties)) { return null; } else { EditPlugin otherPlugin = jEdit.getPlugin(className); if (otherPlugin != null) { jEdit.removePluginJAR(otherPlugin.getPluginJAR(), false); // otherPlugin.getPluginJAR().uninit(false); } } plugin = new EditPlugin.Deferred(this, className); label = _label; break; } } if(cache.actionsURI != null) { actions = new ActionSet(this,null,null, cache.actionsURI); actions.load(); cache.cachedActionNames = actions.getCacheableActionNames(); cache.cachedActionToggleFlags = new boolean[cache.cachedActionNames.length]; for(int i = 0; i < cache.cachedActionNames.length; i++) { cache.cachedActionToggleFlags[i] = jEdit.getBooleanProperty( cache.cachedActionNames[i] + ".toggle"); } } if(cache.browserActionsURI != null) { browserActions = new ActionSet(this,null,null, cache.browserActionsURI); browserActions.load(); VFSBrowser.getActionContext().addActionSet(browserActions); cache.cachedBrowserActionNames = browserActions.getCacheableActionNames(); cache.cachedBrowserActionToggleFlags = new boolean[ cache.cachedBrowserActionNames.length]; for(int i = 0; i < cache.cachedBrowserActionNames.length; i++) { cache.cachedBrowserActionToggleFlags[i] = jEdit.getBooleanProperty( cache.cachedBrowserActionNames[i] + ".toggle"); } } if(dockablesURI != null) { DockableWindowFactory.getInstance() .loadDockableWindows(this, dockablesURI,cache); } if(actions.size() != 0) { if(label != null) { actions.setLabel(jEdit.getProperty( "action-set.plugin", new String[] { label })); } else actionsPresentButNotCoreClass(); jEdit.addActionSet(actions); } if(servicesURI != null) { ServiceManager.loadServices(this,servicesURI,cache); } return cache; }
// in org/gjt/sp/jedit/PluginJAR.java
public boolean read(DataInputStream din) throws IOException { int cacheMagic = din.readInt(); if(cacheMagic != MAGIC) return false; String cacheBuild = readString(din); if(!cacheBuild.equals(jEdit.getBuild())) return false; long cacheModTime = din.readLong(); if(cacheModTime != modTime) return false; actionsURI = readURI(din); cachedActionNames = readStringArray(din); cachedActionToggleFlags = readBooleanArray(din); browserActionsURI = readURI(din); cachedBrowserActionNames = readStringArray(din); cachedBrowserActionToggleFlags = readBooleanArray(din); dockablesURI = readURI(din); cachedDockableNames = readStringArray(din); cachedDockableActionFlags = readBooleanArray(din); cachedDockableMovableFlags = readBooleanArray(din); servicesURI = readURI(din); int len = din.readInt(); if(len == 0) cachedServices = null; else { cachedServices = new ServiceManager.Descriptor[len]; for(int i = 0; i < len; i++) { ServiceManager.Descriptor d = new ServiceManager.Descriptor( readString(din), readString(din), null, plugin); cachedServices[i] = d; } } classes = readStringArray(din); resources = readStringArray(din); cachedProperties = readMap(din); localizationProperties = readLanguagesMap(din); pluginClass = readString(din); return true; }
// in org/gjt/sp/jedit/PluginJAR.java
public void write(DataOutputStream dout) throws IOException { dout.writeInt(MAGIC); writeString(dout,jEdit.getBuild()); dout.writeLong(modTime); writeString(dout,actionsURI); writeStringArray(dout,cachedActionNames); writeBooleanArray(dout,cachedActionToggleFlags); writeString(dout,browserActionsURI); writeStringArray(dout,cachedBrowserActionNames); writeBooleanArray(dout,cachedBrowserActionToggleFlags); writeString(dout,dockablesURI); writeStringArray(dout,cachedDockableNames); writeBooleanArray(dout,cachedDockableActionFlags); writeBooleanArray(dout,cachedDockableMovableFlags); writeString(dout,servicesURI); if(cachedServices == null) dout.writeInt(0); else { dout.writeInt(cachedServices.length); for(int i = 0; i < cachedServices.length; i++) { writeString(dout,cachedServices[i].clazz); writeString(dout,cachedServices[i].name); } } writeStringArray(dout,classes); writeStringArray(dout,resources); writeMap(dout,cachedProperties); writeLanguages(dout, localizationProperties); writeString(dout,pluginClass); }
// in org/gjt/sp/jedit/PluginJAR.java
private static String readString(DataInputStream din) throws IOException { int len = din.readInt(); if(len == 0) return null; char[] str = new char[len]; for(int i = 0; i < len; i++) str[i] = din.readChar(); return new String(str); }
// in org/gjt/sp/jedit/PluginJAR.java
private static URL readURI(DataInputStream din) throws IOException { String str = readString(din); if(str == null) return null; else return new URL(str); }
// in org/gjt/sp/jedit/PluginJAR.java
private static String[] readStringArray(DataInputStream din) throws IOException { int len = din.readInt(); if(len == 0) return null; String[] str = new String[len]; for(int i = 0; i < len; i++) { str[i] = readString(din); } return str; }
// in org/gjt/sp/jedit/PluginJAR.java
private static boolean[] readBooleanArray(DataInputStream din) throws IOException { int len = din.readInt(); if(len == 0) return null; boolean[] bools = new boolean[len]; for(int i = 0; i < len; i++) { bools[i] = din.readBoolean(); } return bools; }
// in org/gjt/sp/jedit/PluginJAR.java
private static Properties readMap(DataInputStream din) throws IOException { Properties returnValue = new Properties(); int count = din.readInt(); for(int i = 0; i < count; i++) { String key = readString(din); String value = readString(din); if(value == null) value = ""; returnValue.setProperty(key, value); } return returnValue; }
// in org/gjt/sp/jedit/PluginJAR.java
private static Map<String, Properties> readLanguagesMap(DataInputStream din) throws IOException { int languagesCount = din.readInt(); if (languagesCount == 0) return Collections.emptyMap(); Map<String, Properties> languages = new HashMap<String, Properties>(languagesCount); for (int i = 0;i<languagesCount;i++) { String lang = readString(din); Properties props = readMap(din); languages.put(lang, props); } return languages; }
// in org/gjt/sp/jedit/PluginJAR.java
private static void writeString(DataOutputStream dout, Object obj) throws IOException { if(obj == null) { dout.writeInt(0); } else { String str = obj.toString(); dout.writeInt(str.length()); dout.writeChars(str); } }
// in org/gjt/sp/jedit/PluginJAR.java
private static void writeStringArray(DataOutputStream dout, String[] str) throws IOException { if(str == null) { dout.writeInt(0); } else { dout.writeInt(str.length); for(int i = 0; i < str.length; i++) { writeString(dout,str[i]); } } }
// in org/gjt/sp/jedit/PluginJAR.java
private static void writeBooleanArray(DataOutputStream dout, boolean[] bools) throws IOException { if(bools == null) { dout.writeInt(0); } else { dout.writeInt(bools.length); for(int i = 0; i < bools.length; i++) { dout.writeBoolean(bools[i]); } } }
// in org/gjt/sp/jedit/PluginJAR.java
private static void writeMap(DataOutputStream dout, Properties properties) throws IOException { dout.writeInt(properties.size()); Set<Map.Entry<Object, Object>> set = properties.entrySet(); for (Map.Entry<Object, Object> entry : set) { writeString(dout,entry.getKey()); writeString(dout,entry.getValue()); } }
// in org/gjt/sp/jedit/PluginJAR.java
private static void writeLanguages(DataOutputStream dout, Map<String, Properties> languages) throws IOException { dout.writeInt(languages.size()); for (Map.Entry<String, Properties> entry : languages.entrySet()) { writeString(dout, entry.getKey()); writeMap(dout, entry.getValue()); } }
// in org/gjt/sp/jedit/SettingsXML.java
public void writeXMLDeclaration() throws IOException { writeXMLDeclaration("1.0"); }
// in org/gjt/sp/jedit/SettingsXML.java
public void writeXMLDeclaration(String version) throws IOException { write("<?xml" + " version=\"" + version + "\"" + " encoding=\"" + encoding + "\"" + " ?>"); newLine(); }
// in org/gjt/sp/jedit/SettingsXML.java
public void finish() throws IOException { close(); jEdit.backupSettingsFile(file); file.delete(); twoStageSaveFile.renameTo(file); knownLastModified = file.lastModified(); }
// in org/gjt/sp/jedit/SettingsXML.java
public void load(DefaultHandler handler) throws IOException { XMLUtilities.parseXML(new FileInputStream(file), handler); knownLastModified = file.lastModified(); }
// in org/gjt/sp/jedit/SettingsXML.java
public Saver openSaver() throws IOException { return new Saver(); }
// in org/gjt/sp/util/IOUtilities.java
public static boolean copyStream(int bufferSize, ProgressObserver progress, InputStream in, OutputStream out, boolean canStop) throws IOException { byte[] buffer = new byte[bufferSize]; int n; long copied = 0L; while (-1 != (n = in.read(buffer))) { out.write(buffer, 0, n); copied += n; if(progress != null) { progress.setStatus(StandardUtilities.formatFileSize(copied)); progress.setValue(copied); } if(canStop && Thread.interrupted()) return false; } return true; }
// in org/gjt/sp/util/IOUtilities.java
public static boolean copyStream(ProgressObserver progress, InputStream in, OutputStream out, boolean canStop) throws IOException { return copyStream(4096,progress, in, out, canStop); }
// in org/gjt/sp/util/XMLUtilities.java
public static boolean parseXML(InputStream in, DefaultHandler handler) throws IOException { try { XMLReader parser = XMLReaderFactory.createXMLReader(); InputSource isrc = new InputSource( new BufferedInputStream(in)); isrc.setSystemId("jedit.jar"); parser.setContentHandler(handler); parser.setDTDHandler(handler); parser.setEntityResolver(handler); parser.setErrorHandler(handler); parser.parse(isrc); } catch(SAXParseException se) { int line = se.getLineNumber(); Log.log(Log.ERROR,XMLUtilities.class, "while parsing from " + in + ": SAXParseException: line " + line + ": " , se); return true; } catch(SAXException e) { Log.log(Log.ERROR,XMLUtilities.class,e); return true; } finally { IOUtilities.closeQuietly(in); } return false; }
(Domain) UtilTargetError 9
              
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getIndex(Object array, int index) throws ReflectError, UtilTargetError { if ( Interpreter.DEBUG ) Interpreter.debug("getIndex: "+array+", index="+index); try { Object val = Array.get(array, index); return Primitive.wrap( val, array.getClass().getComponentType() ); } catch( ArrayIndexOutOfBoundsException e1 ) { throw new UtilTargetError( e1 ); } catch(Exception e) { throw new ReflectError("Array access:" + e); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static void setIndex(Object array, int index, Object val) throws ReflectError, UtilTargetError { try { val = Primitive.unwrap(val); Array.set(array, index, val); } catch( ArrayStoreException e2 ) { throw new UtilTargetError( e2 ); } catch( IllegalArgumentException e1 ) { throw new UtilTargetError( new ArrayStoreException( e1.toString() ) ); } catch(Exception e) { throw new ReflectError("Array access:" + e); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Field resolveExpectedJavaField( Class clas, String fieldName, boolean staticOnly ) throws UtilEvalError, ReflectError { Field field; try { if ( Capabilities.haveAccessibility() ) field = findAccessibleField( clas, fieldName ); else // Class getField() finds only public (and in interfaces, etc.) field = clas.getField(fieldName); } catch( NoSuchFieldException e) { throw new ReflectError("No such field: " + fieldName ); } catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching fields of: "+clas, e ); } if ( staticOnly && !Modifier.isStatic( field.getModifiers() ) ) throw new UtilEvalError( "Can't reach instance field: "+fieldName +" from static context: "+clas.getName() ); return field; }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Method resolveExpectedJavaMethod( BshClassManager bcm, Class clas, Object object, String name, Object[] args, boolean staticOnly ) throws ReflectError, UtilEvalError { if ( object == Primitive.NULL ) throw new UtilTargetError( new NullPointerException( "Attempt to invoke method " +name+" on null value" ) ); Class [] types = Types.getTypes(args); Method method = resolveJavaMethod( bcm, clas, name, types, staticOnly ); if ( method == null ) throw new ReflectError( ( staticOnly ? "Static method " : "Method " ) + StringUtil.methodString(name, types) + " not found in class'" + clas.getName() + "'"); return method; }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Method resolveJavaMethod( BshClassManager bcm, Class clas, String name, Class [] types, boolean staticOnly ) throws UtilEvalError { if ( clas == null ) throw new InterpreterError("null class"); // Lookup previously cached method Method method = null; if ( bcm == null ) Interpreter.debug("resolveJavaMethod UNOPTIMIZED lookup"); else method = bcm.getResolvedMethod( clas, name, types, staticOnly ); if ( method == null ) { boolean publicOnly = !Capabilities.haveAccessibility(); // Searching for the method may, itself be a priviledged action try { method = findOverloadedMethod( clas, name, types, publicOnly ); } catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching methods of: "+clas, e ); } checkFoundStaticMethod( method, staticOnly, clas ); // This is the first time we've seen this method, set accessibility // Note: even if it's a public method, we may have found it in a // non-public class if ( method != null && !publicOnly ) { try { ReflectManager.RMSetAccessible( method ); } catch ( UtilEvalError e ) { /*ignore*/ } } // If succeeded cache the resolved method. if ( method != null && bcm != null ) bcm.cacheResolvedMethod( clas, types, method ); } return method; }
// in org/gjt/sp/jedit/bsh/Name.java
private Object consumeNextObjectField( CallStack callstack, Interpreter interpreter, boolean forceClass, boolean autoAllocateThis ) throws UtilEvalError { /* Is it a simple variable name? Doing this first gives the correct Java precedence for vars vs. imported class names (at least in the simple case - see tests/precedence1.bsh). It should also speed things up a bit. */ if ( (evalBaseObject == null && !isCompound(evalName) ) && !forceClass ) { Object obj = resolveThisFieldReference( callstack, namespace, interpreter, evalName, false ); if ( obj != Primitive.VOID ) return completeRound( evalName, FINISHED, obj ); } /* Is it a bsh script variable reference? If we're just starting the eval of name (no base object) or we're evaluating relative to a This type reference check. */ String varName = prefix(evalName, 1); if ( ( evalBaseObject == null || evalBaseObject instanceof This ) && !forceClass ) { if ( Interpreter.DEBUG ) Interpreter.debug("trying to resolve variable: " + varName); Object obj; // switch namespace and special var visibility if ( evalBaseObject == null ) { obj = resolveThisFieldReference( callstack, namespace, interpreter, varName, false ); } else { obj = resolveThisFieldReference( callstack, ((This)evalBaseObject).namespace, interpreter, varName, true ); } if ( obj != Primitive.VOID ) { // Resolved the variable if ( Interpreter.DEBUG ) Interpreter.debug( "resolved variable: " + varName + " in namespace: "+namespace); return completeRound( varName, suffix(evalName), obj ); } } /* Is it a class name? If we're just starting eval of name try to make it, else fail. */ if ( evalBaseObject == null ) { if ( Interpreter.DEBUG ) Interpreter.debug( "trying class: " + evalName); /* Keep adding parts until we have a class */ Class clas = null; int i = 1; String className = null; for(; i <= countParts(evalName); i++) { className = prefix(evalName, i); if ( (clas = namespace.getClass(className)) != null ) break; } if ( clas != null ) { return completeRound( className, suffix( evalName, countParts(evalName)-i ), new ClassIdentifier(clas) ); } // not a class (or variable per above) if ( Interpreter.DEBUG ) Interpreter.debug( "not a class, trying var prefix "+evalName ); } // No variable or class found in 'this' type ref. // if autoAllocateThis then create one; a child 'this'. if ( ( evalBaseObject == null || evalBaseObject instanceof This ) && !forceClass && autoAllocateThis ) { NameSpace targetNameSpace = ( evalBaseObject == null ) ? namespace : ((This)evalBaseObject).namespace; Object obj = new NameSpace( targetNameSpace, "auto: "+varName ).getThis( interpreter ); targetNameSpace.setVariable( varName, obj, false ); return completeRound( varName, suffix(evalName), obj ); } /* If we didn't find a class or variable name (or prefix) above there are two possibilities: - If we are a simple name then we can pass as a void variable reference. - If we are compound then we must fail at this point. */ if ( evalBaseObject == null ) { if ( !isCompound(evalName) ) { return completeRound( evalName, FINISHED, Primitive.VOID ); } else throw new UtilEvalError( "Class or variable not found: " + evalName); } /* -------------------------------------------------------- After this point we're definitely evaluating relative to a base object. -------------------------------------------------------- */ /* Do some basic validity checks. */ if ( evalBaseObject == Primitive.NULL) // previous round produced null throw new UtilTargetError( new NullPointerException( "Null Pointer while evaluating: " +value ) ); if ( evalBaseObject == Primitive.VOID) // previous round produced void throw new UtilEvalError( "Undefined variable or class name while evaluating: "+value); if ( evalBaseObject instanceof Primitive) throw new UtilEvalError("Can't treat primitive like an object. "+ "Error while evaluating: "+value); /* Resolve relative to a class type static field, inner class, ? */ if ( evalBaseObject instanceof ClassIdentifier ) { Class clas = ((ClassIdentifier)evalBaseObject).getTargetClass(); String field = prefix(evalName, 1); // Class qualified 'this' reference from inner class. // e.g. 'MyOuterClass.this' if ( field.equals("this") ) { // find the enclosing class instance space of the class name NameSpace ns = namespace; while ( ns != null ) { // getClassInstance() throws exception if not there if ( ns.classInstance != null && ns.classInstance.getClass() == clas ) return completeRound( field, suffix(evalName), ns.classInstance ); ns=ns.getParent(); } throw new UtilEvalError( "Can't find enclosing 'this' instance of class: "+clas); } Object obj = null; // static field? try { if ( Interpreter.DEBUG ) Interpreter.debug("Name call to getStaticFieldValue, class: " +clas+", field:"+field); obj = Reflect.getStaticFieldValue(clas, field); } catch( ReflectError e ) { if ( Interpreter.DEBUG ) Interpreter.debug("field reflect error: "+e); } // inner class? if ( obj == null ) { String iclass = clas.getName()+"$"+field; Class c = namespace.getClass( iclass ); if ( c != null ) obj = new ClassIdentifier(c); } if ( obj == null ) throw new UtilEvalError( "No static field or inner class: " + field + " of " + clas ); return completeRound( field, suffix(evalName), obj ); } /* If we've fallen through here we are no longer resolving to a class type. */ if ( forceClass ) throw new UtilEvalError( value +" does not resolve to a class name." ); /* Some kind of field access? */ String field = prefix(evalName, 1); // length access on array? if ( field.equals("length") && evalBaseObject.getClass().isArray() ) { Object obj = new Primitive(Array.getLength(evalBaseObject)); return completeRound( field, suffix(evalName), obj ); } // Check for field on object // Note: could eliminate throwing the exception somehow try { Object obj = Reflect.getObjectFieldValue(evalBaseObject, field); return completeRound( field, suffix(evalName), obj ); } catch(ReflectError e) { /* not a field */ } // if we get here we have failed throw new UtilEvalError( "Cannot access field: " + field + ", on object: " + evalBaseObject); }
// in org/gjt/sp/jedit/bsh/Name.java
public Object invokeMethod( Interpreter interpreter, Object[] args, CallStack callstack, SimpleNode callerInfo ) throws UtilEvalError, EvalError, ReflectError, InvocationTargetException { String methodName = Name.suffix(value, 1); BshClassManager bcm = interpreter.getClassManager(); NameSpace namespace = callstack.top(); // Optimization - If classOfStaticMethod is set then we have already // been here and determined that this is a static method invocation. // Note: maybe factor this out with path below... clean up. if ( classOfStaticMethod != null ) { return Reflect.invokeStaticMethod( bcm, classOfStaticMethod, methodName, args ); } if ( !Name.isCompound(value) ) return invokeLocalMethod( interpreter, args, callstack, callerInfo ); // Note: if we want methods declared inside blocks to be accessible via // this.methodname() inside the block we could handle it here as a // special case. See also resolveThisFieldReference() special handling // for BlockNameSpace case. They currently work via the direct name // e.g. methodName(). String prefix = Name.prefix(value); // Superclass method invocation? (e.g. super.foo()) if ( prefix.equals("super") && Name.countParts(value) == 2 ) { // Allow getThis() to work through block namespaces first This ths = namespace.getThis( interpreter ); NameSpace thisNameSpace = ths.getNameSpace(); NameSpace classNameSpace = getClassNameSpace( thisNameSpace ); if ( classNameSpace != null ) { Object instance = classNameSpace.getClassInstance(); return ClassGenerator.getClassGenerator() .invokeSuperclassMethod( bcm, instance, methodName, args ); } } // Find target object or class identifier Name targetName = namespace.getNameResolver( prefix ); Object obj = targetName.toObject( callstack, interpreter ); if ( obj == Primitive.VOID ) throw new UtilEvalError( "Attempt to resolve method: "+methodName +"() on undefined variable or class name: "+targetName); // if we've got an object, resolve the method if ( !(obj instanceof ClassIdentifier) ) { if (obj instanceof Primitive) { if (obj == Primitive.NULL) throw new UtilTargetError( new NullPointerException( "Null Pointer in Method Invocation" ) ); // some other primitive // should avoid calling methods on primitive, as we do // in Name (can't treat primitive like an object message) // but the hole is useful right now. if ( Interpreter.DEBUG ) interpreter.debug( "Attempt to access method on primitive..." + " allowing bsh.Primitive to peek through for debugging"); } // found an object and it's not an undefined variable return Reflect.invokeObjectMethod( obj, methodName, args, interpreter, callstack, callerInfo ); } // It's a class // try static method if ( Interpreter.DEBUG ) Interpreter.debug("invokeMethod: trying static - " + targetName); Class clas = ((ClassIdentifier)obj).getTargetClass(); // cache the fact that this is a static method invocation on this class classOfStaticMethod = clas; if ( clas != null ) return Reflect.invokeStaticMethod( bcm, clas, methodName, args ); // return null; ??? throw new UtilEvalError("invokeMethod: unknown target: " + targetName); }
// in org/gjt/sp/jedit/bsh/Primitive.java
public static Object binaryOperation( Object obj1, Object obj2, int kind) throws UtilEvalError { // special primitive types if ( obj1 == NULL || obj2 == NULL ) throw new UtilEvalError( "Null value or 'null' literal in binary operation"); if ( obj1 == VOID || obj2 == VOID ) throw new UtilEvalError( "Undefined variable, class, or 'void' literal in binary operation"); // keep track of the original types Class lhsOrgType = obj1.getClass(); Class rhsOrgType = obj2.getClass(); // Unwrap primitives if ( obj1 instanceof Primitive ) obj1 = ((Primitive)obj1).getValue(); if ( obj2 instanceof Primitive ) obj2 = ((Primitive)obj2).getValue(); Object[] operands = promotePrimitives(obj1, obj2); Object lhs = operands[0]; Object rhs = operands[1]; if(lhs.getClass() != rhs.getClass()) throw new UtilEvalError("Type mismatch in operator. " + lhs.getClass() + " cannot be used with " + rhs.getClass() ); Object result; try { result = binaryOperationImpl( lhs, rhs, kind ); } catch ( ArithmeticException e ) { throw new UtilTargetError( "Arithemetic Exception in binary op", e); } // If both original args were Primitives return a Primitive result // else it was mixed (wrapper/primitive) return the wrapper type // Exception is for boolean result, return the primitive if ( (lhsOrgType == Primitive.class && rhsOrgType == Primitive.class) || result instanceof Boolean ) return new Primitive( result ); else return result; }
6
              
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( ArrayIndexOutOfBoundsException e1 ) { throw new UtilTargetError( e1 ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( ArrayStoreException e2 ) { throw new UtilTargetError( e2 ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( IllegalArgumentException e1 ) { throw new UtilTargetError( new ArrayStoreException( e1.toString() ) ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching fields of: "+clas, e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching methods of: "+clas, e ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
catch ( ArithmeticException e ) { throw new UtilTargetError( "Arithemetic Exception in binary op", e); }
2
              
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getIndex(Object array, int index) throws ReflectError, UtilTargetError { if ( Interpreter.DEBUG ) Interpreter.debug("getIndex: "+array+", index="+index); try { Object val = Array.get(array, index); return Primitive.wrap( val, array.getClass().getComponentType() ); } catch( ArrayIndexOutOfBoundsException e1 ) { throw new UtilTargetError( e1 ); } catch(Exception e) { throw new ReflectError("Array access:" + e); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static void setIndex(Object array, int index, Object val) throws ReflectError, UtilTargetError { try { val = Primitive.unwrap(val); Array.set(array, index, val); } catch( ArrayStoreException e2 ) { throw new UtilTargetError( e2 ); } catch( IllegalArgumentException e1 ) { throw new UtilTargetError( new ArrayStoreException( e1.toString() ) ); } catch(Exception e) { throw new ReflectError("Array access:" + e); } }
(Lib) ClassNotFoundException 7
              
// in org/gjt/sp/jedit/bsh/Name.java
synchronized public Class toClass() throws ClassNotFoundException, UtilEvalError { if ( asClass != null ) return asClass; reset(); // "var" means untyped, return null class if ( evalName.equals("var") ) return asClass = null; /* Try straightforward class name first */ Class clas = namespace.getClass( evalName ); if ( clas == null ) { /* Try toObject() which knows how to work through inner classes and see what we end up with */ Object obj = null; try { // Null interpreter and callstack references. // class only resolution should not require them. obj = toObject( null, null, true ); } catch ( UtilEvalError e ) { }; // couldn't resolve it if ( obj instanceof ClassIdentifier ) clas = ((ClassIdentifier)obj).getTargetClass(); } if ( clas == null ) throw new ClassNotFoundException( "Class: " + value+ " not found in namespace"); asClass = clas; return asClass; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
public Class loadClass(String name, boolean resolve) throws ClassNotFoundException { Class c = null; /* Check first for classes loaded through this loader. The VM will not allow a class to be loaded twice. */ c = findLoadedClass(name); if ( c != null ) return c; // This is copied from ClassManagerImpl // We should refactor this somehow if it sticks around if ( name.startsWith( ClassManagerImpl.BSH_PACKAGE ) ) try { return org.gjt.sp.jedit.bsh.Interpreter.class.getClassLoader().loadClass( name ); } catch ( ClassNotFoundException e ) {} /* Try to find the class using our classloading mechanism. Note: I wish we didn't have to catch the exception here... slow */ try { c = findClass( name ); } catch ( ClassNotFoundException e ) { } if ( c == null ) throw new ClassNotFoundException("here in loaClass"); if ( resolve ) resolveClass( c ); return c; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
protected Class findClass( String name ) throws ClassNotFoundException { // Deal with this cast somehow... maybe have this class use // ClassManagerImpl type directly. // Don't add the method to BshClassManager... it's really an impl thing ClassManagerImpl bcm = (ClassManagerImpl)getClassManager(); // Should we try to load the class ourselves or delegate? // look for overlay loader // Deal with this cast somehow... maybe have this class use // ClassManagerImpl type directly. // Don't add the method to BshClassManager... it's really an impl thing ClassLoader cl = bcm.getLoaderForClass( name ); Class c; // If there is a designated loader and it's not us delegate to it if ( cl != null && cl != this ) try { return cl.loadClass( name ); } catch ( ClassNotFoundException e ) { throw new ClassNotFoundException( "Designated loader could not find class: "+e ); } // Let URLClassLoader try any paths it may have if ( getURLs().length > 0 ) try { return super.findClass(name); } catch ( ClassNotFoundException e ) { //System.out.println( // "base loader here caught class not found: "+name ); } // If there is a baseLoader and it's not us delegate to it cl = bcm.getBaseLoader(); if ( cl != null && cl != this ) try { return cl.loadClass( name ); } catch ( ClassNotFoundException e ) { } // Try system loader return bcm.plainClassForName( name ); }
// in org/gjt/sp/jedit/JARClassLoader.java
public Class loadClass(String clazz, boolean resolveIt) throws ClassNotFoundException { ClassNotFoundException pending = null; if (delegateFirst) { try { return loadFromParent(clazz); } catch (ClassNotFoundException cnf) { // keep going if class was not found. pending = cnf; } } Object obj = classHash.get(clazz); if(obj == NO_CLASS) { // we remember which classes we don't exist // because BeanShell tries loading all possible // <imported prefix>.<class name> combinations throw new ClassNotFoundException(clazz); } else if(obj instanceof JARClassLoader) { JARClassLoader classLoader = (JARClassLoader)obj; try { return classLoader._loadClass(clazz,resolveIt); } catch (ClassNotFoundException cnf2) { classHash.put(clazz,NO_CLASS); throw cnf2; } } else if (delegateFirst) { // if delegating, reaching this statement means // the class was really not found. Otherwise // we'll try loading from the parent class loader. throw pending; } return loadFromParent(clazz); }
// in org/gjt/sp/jedit/JARClassLoader.java
private synchronized Class _loadClass(String clazz, boolean resolveIt) throws ClassNotFoundException { jar.activatePlugin(); synchronized(this) { Class cls = findLoadedClass(clazz); if(cls != null) { if(resolveIt) resolveClass(cls); return cls; } String name = MiscUtilities.classToFile(clazz); try { definePackage(clazz); ZipFile zipFile = jar.getZipFile(); ZipEntry entry = zipFile.getEntry(name); if(entry == null) throw new ClassNotFoundException(clazz); InputStream in = zipFile.getInputStream(entry); int len = (int)entry.getSize(); byte[] data = new byte[len]; int success = 0; int offset = 0; while(success < len) { len -= success; offset += success; success = in.read(data,offset,len); if(success == -1) { Log.log(Log.ERROR,this,"Failed to load class " + clazz + " from " + zipFile.getName()); throw new ClassNotFoundException(clazz); } } cls = defineClass(clazz,data,0,data.length); if(resolveIt) resolveClass(cls); return cls; } catch(IOException io) { Log.log(Log.ERROR,this,io); throw new ClassNotFoundException(clazz); } } }
2
              
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
catch ( ClassNotFoundException e ) { throw new ClassNotFoundException( "Designated loader could not find class: "+e ); }
// in org/gjt/sp/jedit/JARClassLoader.java
catch(IOException io) { Log.log(Log.ERROR,this,io); throw new ClassNotFoundException(clazz); }
9
              
// in org/gjt/sp/jedit/bsh/Name.java
synchronized public Class toClass() throws ClassNotFoundException, UtilEvalError { if ( asClass != null ) return asClass; reset(); // "var" means untyped, return null class if ( evalName.equals("var") ) return asClass = null; /* Try straightforward class name first */ Class clas = namespace.getClass( evalName ); if ( clas == null ) { /* Try toObject() which knows how to work through inner classes and see what we end up with */ Object obj = null; try { // Null interpreter and callstack references. // class only resolution should not require them. obj = toObject( null, null, true ); } catch ( UtilEvalError e ) { }; // couldn't resolve it if ( obj instanceof ClassIdentifier ) clas = ((ClassIdentifier)obj).getTargetClass(); } if ( clas == null ) throw new ClassNotFoundException( "Class: " + value+ " not found in namespace"); asClass = clas; return asClass; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
public Class loadClass(String name, boolean resolve) throws ClassNotFoundException { Class c = null; /* Check first for classes loaded through this loader. The VM will not allow a class to be loaded twice. */ c = findLoadedClass(name); if ( c != null ) return c; // This is copied from ClassManagerImpl // We should refactor this somehow if it sticks around if ( name.startsWith( ClassManagerImpl.BSH_PACKAGE ) ) try { return org.gjt.sp.jedit.bsh.Interpreter.class.getClassLoader().loadClass( name ); } catch ( ClassNotFoundException e ) {} /* Try to find the class using our classloading mechanism. Note: I wish we didn't have to catch the exception here... slow */ try { c = findClass( name ); } catch ( ClassNotFoundException e ) { } if ( c == null ) throw new ClassNotFoundException("here in loaClass"); if ( resolve ) resolveClass( c ); return c; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
protected Class findClass( String name ) throws ClassNotFoundException { // Deal with this cast somehow... maybe have this class use // ClassManagerImpl type directly. // Don't add the method to BshClassManager... it's really an impl thing ClassManagerImpl bcm = (ClassManagerImpl)getClassManager(); // Should we try to load the class ourselves or delegate? // look for overlay loader // Deal with this cast somehow... maybe have this class use // ClassManagerImpl type directly. // Don't add the method to BshClassManager... it's really an impl thing ClassLoader cl = bcm.getLoaderForClass( name ); Class c; // If there is a designated loader and it's not us delegate to it if ( cl != null && cl != this ) try { return cl.loadClass( name ); } catch ( ClassNotFoundException e ) { throw new ClassNotFoundException( "Designated loader could not find class: "+e ); } // Let URLClassLoader try any paths it may have if ( getURLs().length > 0 ) try { return super.findClass(name); } catch ( ClassNotFoundException e ) { //System.out.println( // "base loader here caught class not found: "+name ); } // If there is a baseLoader and it's not us delegate to it cl = bcm.getBaseLoader(); if ( cl != null && cl != this ) try { return cl.loadClass( name ); } catch ( ClassNotFoundException e ) { } // Try system loader return bcm.plainClassForName( name ); }
// in org/gjt/sp/jedit/bsh/classpath/DiscreteFilesClassLoader.java
public Class findClass( String name ) throws ClassNotFoundException { // Load it if it's one of our classes ClassSource source = map.get( name ); if ( source != null ) { byte [] code = source.getCode( name ); return defineClass( name, code, 0, code.length ); } else // Let superclass BshClassLoader (URLClassLoader) findClass try // to find the class... return super.findClass( name ); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
public Class plainClassForName( String name ) throws ClassNotFoundException { Class c = null; try { if ( externalClassLoader != null ) c = externalClassLoader.loadClass( name ); else c = Class.forName( name ); cacheClassInfo( name, c ); /* Original note: Jdk under Win is throwing these to warn about lower case / upper case possible mismatch. e.g. bsh.console bsh.Console Update: Prior to 1.3 we were squeltching NoClassDefFoundErrors which was very annoying. I cannot reproduce the original problem and this was never a valid solution. If there are legacy VMs that have problems we can include a more specific test for them here. */ } catch ( NoClassDefFoundError e ) { throw noClassDefFound( name, e ); } return c; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
private void readObject(ObjectInputStream stream) throws java.io.IOException, ClassNotFoundException { stream.defaultReadObject(); // set transient fields if ( console != null ) { setOut( console.getOut() ); setErr( console.getErr() ); } else { setOut( System.out ); setErr( System.err ); } }
// in org/gjt/sp/jedit/JARClassLoader.java
public Class loadClass(String clazz, boolean resolveIt) throws ClassNotFoundException { ClassNotFoundException pending = null; if (delegateFirst) { try { return loadFromParent(clazz); } catch (ClassNotFoundException cnf) { // keep going if class was not found. pending = cnf; } } Object obj = classHash.get(clazz); if(obj == NO_CLASS) { // we remember which classes we don't exist // because BeanShell tries loading all possible // <imported prefix>.<class name> combinations throw new ClassNotFoundException(clazz); } else if(obj instanceof JARClassLoader) { JARClassLoader classLoader = (JARClassLoader)obj; try { return classLoader._loadClass(clazz,resolveIt); } catch (ClassNotFoundException cnf2) { classHash.put(clazz,NO_CLASS); throw cnf2; } } else if (delegateFirst) { // if delegating, reaching this statement means // the class was really not found. Otherwise // we'll try loading from the parent class loader. throw pending; } return loadFromParent(clazz); }
// in org/gjt/sp/jedit/JARClassLoader.java
private synchronized Class _loadClass(String clazz, boolean resolveIt) throws ClassNotFoundException { jar.activatePlugin(); synchronized(this) { Class cls = findLoadedClass(clazz); if(cls != null) { if(resolveIt) resolveClass(cls); return cls; } String name = MiscUtilities.classToFile(clazz); try { definePackage(clazz); ZipFile zipFile = jar.getZipFile(); ZipEntry entry = zipFile.getEntry(name); if(entry == null) throw new ClassNotFoundException(clazz); InputStream in = zipFile.getInputStream(entry); int len = (int)entry.getSize(); byte[] data = new byte[len]; int success = 0; int offset = 0; while(success < len) { len -= success; offset += success; success = in.read(data,offset,len); if(success == -1) { Log.log(Log.ERROR,this,"Failed to load class " + clazz + " from " + zipFile.getName()); throw new ClassNotFoundException(clazz); } } cls = defineClass(clazz,data,0,data.length); if(resolveIt) resolveClass(cls); return cls; } catch(IOException io) { Log.log(Log.ERROR,this,io); throw new ClassNotFoundException(clazz); } } }
// in org/gjt/sp/jedit/JARClassLoader.java
private Class loadFromParent(String clazz) throws ClassNotFoundException { Class cls; ClassLoader parentLoader = getClass().getClassLoader(); if (parentLoader != null) cls = parentLoader.loadClass(clazz); else cls = findSystemClass(clazz); return cls; }
(Domain) TargetError 7
              
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
public Object doSuffix( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError { // Handle ".class" suffix operation // Prefix must be a BSHType if ( operation == CLASS ) if ( obj instanceof BSHType ) { if ( toLHS ) throw new EvalError("Can't assign .class", this, callstack ); NameSpace namespace = callstack.top(); return ((BSHType)obj).getType( callstack, interpreter ); } else throw new EvalError( "Attempt to use .class suffix on non class.", this, callstack ); /* Evaluate our prefix if it needs evaluating first. If this is the first evaluation our prefix mayb be a Node (directly from the PrimaryPrefix) - eval() it to an object. If it's an LHS, resolve to a value. Note: The ambiguous name construct is now necessary where the node may be an ambiguous name. If this becomes common we might want to make a static method nodeToObject() or something. The point is that we can't just eval() - we need to direct the evaluation to the context sensitive type of result; namely object, class, etc. */ if ( obj instanceof SimpleNode ) if ( obj instanceof BSHAmbiguousName ) obj = ((BSHAmbiguousName)obj).toObject(callstack, interpreter); else obj = ((SimpleNode)obj).eval(callstack, interpreter); else if ( obj instanceof LHS ) try { obj = ((LHS)obj).getValue(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } try { switch(operation) { case INDEX: return doIndex( obj, toLHS, callstack, interpreter ); case NAME: return doName( obj, toLHS, callstack, interpreter ); case PROPERTY: return doProperty( toLHS, obj, callstack, interpreter ); default: throw new InterpreterError( "Unknown suffix type" ); } } catch(ReflectError e) { throw new EvalError("reflection error: " + e, this, callstack ); } catch(InvocationTargetException e) { throw new TargetError( "target exception", e.getTargetException(), this, callstack, true); } }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
private Object doName( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError, ReflectError, InvocationTargetException { try { // .length on array if ( field.equals("length") && obj.getClass().isArray() ) if ( toLHS ) throw new EvalError( "Can't assign array length", this, callstack ); else return new Primitive(Array.getLength(obj)); // field access if ( jjtGetNumChildren() == 0 ) if ( toLHS ) return Reflect.getLHSObjectField(obj, field); else return Reflect.getObjectFieldValue( obj, field ); // Method invocation // (LHS or non LHS evaluation can both encounter method calls) Object[] oa = ((BSHArguments)jjtGetChild(0)).getArguments( callstack, interpreter); // TODO: // Note: this try/catch block is copied from BSHMethodInvocation // we need to factor out this common functionality and make sure // we handle all cases ... (e.g. property style access, etc.) // maybe move this to Reflect ? try { return Reflect.invokeObjectMethod( obj, field, oa, interpreter, callstack, this ); } catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); } catch ( InvocationTargetException e ) { String msg = "Method Invocation "+field; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); } } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BshMethod.java
Object invoke( Object[] argValues, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean overrideNameSpace ) throws EvalError { if ( argValues != null ) for (int i=0; i<argValues.length; i++) if ( argValues[i] == null ) throw new Error("HERE!"); if ( javaMethod != null ) try { return Reflect.invokeMethod( javaMethod, javaObject, argValues ); } catch ( ReflectError e ) { throw new EvalError( "Error invoking Java method: "+e, callerInfo, callstack ); } catch ( InvocationTargetException e2 ) { throw new TargetError( "Exception invoking imported object method.", e2, callerInfo, callstack, true/*isNative*/ ); } // is this a syncrhonized method? if ( modifiers != null && modifiers.hasModifier("synchronized") ) { // The lock is our declaring namespace's This reference // (the method's 'super'). Or in the case of a class it's the // class instance. Object lock; if ( declaringNameSpace.isClass ) { try { lock = declaringNameSpace.getClassInstance(); } catch ( UtilEvalError e ) { throw new InterpreterError( "Can't get class instance for synchronized method."); } } else lock = declaringNameSpace.getThis(interpreter); // ??? synchronized( lock ) { return invokeImpl( argValues, interpreter, callstack, callerInfo, overrideNameSpace ); } } else return invokeImpl( argValues, interpreter, callstack, callerInfo, overrideNameSpace ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object constructObject( Class type, Object[] args, CallStack callstack ) throws EvalError { Object obj; try { obj = Reflect.constructObject( type, args ); } catch ( ReflectError e) { throw new EvalError( "Constructor error: " + e.getMessage(), this, callstack ); } catch(InvocationTargetException e) { // No need to wrap this debug Interpreter.debug("The constructor threw an exception:\n\t" + e.getTargetException()); throw new TargetError( "Object constructor", e.getTargetException(), this, callstack, true); } String className = type.getName(); // Is it an inner class? if ( className.indexOf("$") == -1 ) return obj; // Temporary hack to support inner classes // If the obj is a non-static inner class then import the context... // This is not a sufficient emulation of inner classes. // Replace this later... // work through to class 'this' This ths = callstack.top().getThis( null ); NameSpace instanceNameSpace = Name.getClassNameSpace( ths.getNameSpace() ); // Change the parent (which was the class static) to the class instance // We really need to check if we're a static inner class here first... // but for some reason Java won't show the static modifier on our // fake inner classes... could generate a flag field. if ( instanceNameSpace != null && className.startsWith( instanceNameSpace.getName() +"$") ) { try { ClassGenerator.getClassGenerator().setInstanceNameSpaceParent( obj, className, instanceNameSpace ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } } return obj; }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object arrayNewInstance( Class type, BSHArrayDimensions dimensionsNode, CallStack callstack ) throws EvalError { if ( dimensionsNode.numUndefinedDims > 0 ) { Object proto = Array.newInstance( type, new int [dimensionsNode.numUndefinedDims] ); // zeros type = proto.getClass(); } try { return Array.newInstance( type, dimensionsNode.definedDimensions); } catch( NegativeArraySizeException e1 ) { throw new TargetError( e1, this, callstack ); } catch( Exception e ) { throw new EvalError("Can't construct primitive array: " + e.getMessage(), this, callstack); } }
// in org/gjt/sp/jedit/bsh/BSHThrowStatement.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { Object obj = ((SimpleNode)jjtGetChild(0)).eval(callstack, interpreter); // need to loosen this to any throwable... do we need to handle // that in interpreter somewhere? check first... if(!(obj instanceof Exception)) throw new EvalError("Expression in 'throw' must be Exception type", this, callstack ); // wrap the exception in a TargetException to propogate it up throw new TargetError( (Exception)obj, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { NameSpace namespace = callstack.top(); BSHAmbiguousName nameNode = getNameNode(); // Do not evaluate methods this() or super() in class instance space // (i.e. inside a constructor) if ( namespace.getParent() != null && namespace.getParent().isClass && ( nameNode.text.equals("super") || nameNode.text.equals("this") ) ) return Primitive.VOID; Name name = nameNode.getName(namespace); Object[] args = getArgsNode().getArguments(callstack, interpreter); // This try/catch block is replicated is BSHPrimarySuffix... need to // factor out common functionality... // Move to Reflect? try { return name.invokeMethod( interpreter, args, callstack, this); } catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); } catch ( InvocationTargetException e ) { String msg = "Method Invocation "+name; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
6
              
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch(InvocationTargetException e) { throw new TargetError( "target exception", e.getTargetException(), this, callstack, true); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( InvocationTargetException e ) { String msg = "Method Invocation "+field; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( InvocationTargetException e2 ) { throw new TargetError( "Exception invoking imported object method.", e2, callerInfo, callstack, true/*isNative*/ ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch(InvocationTargetException e) { // No need to wrap this debug Interpreter.debug("The constructor threw an exception:\n\t" + e.getTargetException()); throw new TargetError( "Object constructor", e.getTargetException(), this, callstack, true); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch( NegativeArraySizeException e1 ) { throw new TargetError( e1, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( InvocationTargetException e ) { String msg = "Method Invocation "+name; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); }
0
(Domain) ClassPathException 6
              
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public void reloadClasses( String [] classNames ) throws ClassPathException { // validate that it is a class here? // init base class loader if there is none... if ( baseLoader == null ) initBaseLoader(); DiscreteFilesClassLoader.ClassSourceMap map = new DiscreteFilesClassLoader.ClassSourceMap(); for (int i=0; i< classNames.length; i++) { String name = classNames[i]; // look in baseLoader class path ClassSource classSource = baseClassPath.getClassSource( name ); // look in user class path if ( classSource == null ) { BshClassPath.getUserClassPath().insureInitialized(); classSource = BshClassPath.getUserClassPath().getClassSource( name ); } // No point in checking boot class path, can't reload those. // else we could have used fullClassPath above. if ( classSource == null ) throw new ClassPathException("Nothing known about class: " +name ); // JarClassSource is not working... just need to implement it's // getCode() method or, if we decide to, allow the BshClassManager // to handle it... since it is a URLClassLoader and can handle JARs if ( classSource instanceof JarClassSource ) throw new ClassPathException("Cannot reload class: "+name+ " from source: "+ classSource ); map.put( name, classSource ); } // Create classloader for the set of classes ClassLoader cl = new DiscreteFilesClassLoader( this, map ); // map those classes the loader in the overlay map Iterator it = map.keySet().iterator(); while ( it.hasNext() ) loaderMap.put( (String)it.next(), cl ); classLoaderChanged(); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public void reloadPackage( String pack ) throws ClassPathException { Collection classes = baseClassPath.getClassesForPackage( pack ); if ( classes == null ) classes = BshClassPath.getUserClassPath().getClassesForPackage( pack ); // no point in checking boot class path, can't reload those if ( classes == null ) throw new ClassPathException("No classes found for package: "+pack); reloadClasses( (String[])classes.toArray( new String[0] ) ); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public String getClassNameByUnqName( String name ) throws ClassPathException { insureInitialized(); UnqualifiedNameTable unqNameTable = getUnqualifiedNameTable(); Object obj = unqNameTable.get( name ); if ( obj instanceof AmbiguousName ) throw new ClassPathException("Ambigous class names: "+ ((AmbiguousName)obj).get() ); return (String)obj; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public static URL [] getUserClassPathComponents() throws ClassPathException { if ( userClassPathComp != null ) return userClassPathComp; String cp=System.getProperty("java.class.path"); String [] paths=StringUtil.split(cp, File.pathSeparator); URL [] urls = new URL[ paths.length ]; try { for ( int i=0; i<paths.length; i++) // We take care to get the canonical path first. // Java deals with relative paths for it's bootstrap loader // but JARClassLoader doesn't. urls[i] = new File( new File(paths[i]).getCanonicalPath() ).toURL(); } catch ( IOException e ) { throw new ClassPathException("can't parse class path: "+e); } userClassPathComp = urls; return urls; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public static BshClassPath getBootClassPath() throws ClassPathException { if ( bootClassPath == null ) { try { //String rtjar = System.getProperty("java.home")+"/lib/rt.jar"; String rtjar = getRTJarPath(); URL url = new File( rtjar ).toURL(); bootClassPath = new BshClassPath( "Boot Class Path", new URL[] { url } ); } catch ( MalformedURLException e ) { throw new ClassPathException(" can't find boot jar: "+e); } } return bootClassPath; }
2
              
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch ( IOException e ) { throw new ClassPathException("can't parse class path: "+e); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch ( MalformedURLException e ) { throw new ClassPathException(" can't find boot jar: "+e); }
9
              
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public void reloadAllClasses() throws ClassPathException { BshClassPath bcp = new BshClassPath("temp"); bcp.addComponent( baseClassPath ); bcp.addComponent( BshClassPath.getUserClassPath() ); setClassPath( bcp.getPathComponents() ); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public void reloadClasses( String [] classNames ) throws ClassPathException { // validate that it is a class here? // init base class loader if there is none... if ( baseLoader == null ) initBaseLoader(); DiscreteFilesClassLoader.ClassSourceMap map = new DiscreteFilesClassLoader.ClassSourceMap(); for (int i=0; i< classNames.length; i++) { String name = classNames[i]; // look in baseLoader class path ClassSource classSource = baseClassPath.getClassSource( name ); // look in user class path if ( classSource == null ) { BshClassPath.getUserClassPath().insureInitialized(); classSource = BshClassPath.getUserClassPath().getClassSource( name ); } // No point in checking boot class path, can't reload those. // else we could have used fullClassPath above. if ( classSource == null ) throw new ClassPathException("Nothing known about class: " +name ); // JarClassSource is not working... just need to implement it's // getCode() method or, if we decide to, allow the BshClassManager // to handle it... since it is a URLClassLoader and can handle JARs if ( classSource instanceof JarClassSource ) throw new ClassPathException("Cannot reload class: "+name+ " from source: "+ classSource ); map.put( name, classSource ); } // Create classloader for the set of classes ClassLoader cl = new DiscreteFilesClassLoader( this, map ); // map those classes the loader in the overlay map Iterator it = map.keySet().iterator(); while ( it.hasNext() ) loaderMap.put( (String)it.next(), cl ); classLoaderChanged(); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public void reloadPackage( String pack ) throws ClassPathException { Collection classes = baseClassPath.getClassesForPackage( pack ); if ( classes == null ) classes = BshClassPath.getUserClassPath().getClassesForPackage( pack ); // no point in checking boot class path, can't reload those if ( classes == null ) throw new ClassPathException("No classes found for package: "+pack); reloadClasses( (String[])classes.toArray( new String[0] ) ); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public BshClassPath getClassPath() throws ClassPathException { if ( fullClassPath != null ) return fullClassPath; fullClassPath = new BshClassPath("BeanShell Full Class Path"); fullClassPath.addComponent( BshClassPath.getUserClassPath() ); try { fullClassPath.addComponent( BshClassPath.getBootClassPath() ); } catch ( ClassPathException e ) { System.err.println("Warning: can't get boot class path"); } fullClassPath.addComponent( baseClassPath ); return fullClassPath; }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public String getClassNameByUnqName( String name ) throws ClassPathException { return getClassPath().getClassNameByUnqName( name ); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public String getClassNameByUnqName( String name ) throws ClassPathException { insureInitialized(); UnqualifiedNameTable unqNameTable = getUnqualifiedNameTable(); Object obj = unqNameTable.get( name ); if ( obj instanceof AmbiguousName ) throw new ClassPathException("Ambigous class names: "+ ((AmbiguousName)obj).get() ); return (String)obj; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public static URL [] getUserClassPathComponents() throws ClassPathException { if ( userClassPathComp != null ) return userClassPathComp; String cp=System.getProperty("java.class.path"); String [] paths=StringUtil.split(cp, File.pathSeparator); URL [] urls = new URL[ paths.length ]; try { for ( int i=0; i<paths.length; i++) // We take care to get the canonical path first. // Java deals with relative paths for it's bootstrap loader // but JARClassLoader doesn't. urls[i] = new File( new File(paths[i]).getCanonicalPath() ).toURL(); } catch ( IOException e ) { throw new ClassPathException("can't parse class path: "+e); } userClassPathComp = urls; return urls; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public static BshClassPath getUserClassPath() throws ClassPathException { if ( userClassPath == null ) userClassPath = new BshClassPath( "User Class Path", getUserClassPathComponents() ); return userClassPath; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public static BshClassPath getBootClassPath() throws ClassPathException { if ( bootClassPath == null ) { try { //String rtjar = System.getProperty("java.home")+"/lib/rt.jar"; String rtjar = getRTJarPath(); URL url = new File( rtjar ).toURL(); bootClassPath = new BshClassPath( "Boot Class Path", new URL[] { url } ); } catch ( MalformedURLException e ) { throw new ClassPathException(" can't find boot jar: "+e); } } return bootClassPath; }
(Domain) Unavailable 4
              
// in org/gjt/sp/jedit/bsh/ClassGenerator.java
public static ClassGenerator getClassGenerator() throws UtilEvalError { if ( cg == null ) { try { Class clas = Class.forName( "org.gjt.sp.jedit.bsh.ClassGeneratorImpl" ); cg = (ClassGenerator)clas.newInstance(); } catch ( Exception e ) { throw new Unavailable("ClassGenerator unavailable: "+e); } } return cg; }
// in org/gjt/sp/jedit/bsh/ReflectManager.java
public static ReflectManager getReflectManager() throws Unavailable { if ( rfm == null ) { Class clas; try { clas = Class.forName( "org.gjt.sp.jedit.bsh.reflect.ReflectManagerImpl" ); rfm = (ReflectManager)clas.newInstance(); } catch ( Exception e ) { throw new Unavailable("Reflect Manager unavailable: "+e); } } return rfm; }
// in org/gjt/sp/jedit/bsh/Capabilities.java
public static void setAccessibility( boolean b ) throws Unavailable { if ( b == false ) { accessibility = false; return; } if ( !classExists( "java.lang.reflect.AccessibleObject" ) || !classExists("org.gjt.sp.jedit.bsh.reflect.ReflectManagerImpl") ) throw new Unavailable( "Accessibility unavailable" ); // test basic access try { String.class.getDeclaredMethods(); } catch ( SecurityException e ) { throw new Unavailable("Accessibility unavailable: "+e); } accessibility = true; }
3
              
// in org/gjt/sp/jedit/bsh/ClassGenerator.java
catch ( Exception e ) { throw new Unavailable("ClassGenerator unavailable: "+e); }
// in org/gjt/sp/jedit/bsh/ReflectManager.java
catch ( Exception e ) { throw new Unavailable("Reflect Manager unavailable: "+e); }
// in org/gjt/sp/jedit/bsh/Capabilities.java
catch ( SecurityException e ) { throw new Unavailable("Accessibility unavailable: "+e); }
3
              
// in org/gjt/sp/jedit/bsh/ReflectManager.java
public static ReflectManager getReflectManager() throws Unavailable { if ( rfm == null ) { Class clas; try { clas = Class.forName( "org.gjt.sp.jedit.bsh.reflect.ReflectManagerImpl" ); rfm = (ReflectManager)clas.newInstance(); } catch ( Exception e ) { throw new Unavailable("Reflect Manager unavailable: "+e); } } return rfm; }
// in org/gjt/sp/jedit/bsh/ReflectManager.java
public static boolean RMSetAccessible( Object obj ) throws Unavailable { return getReflectManager().setAccessible( obj ); }
// in org/gjt/sp/jedit/bsh/Capabilities.java
public static void setAccessibility( boolean b ) throws Unavailable { if ( b == false ) { accessibility = false; return; } if ( !classExists( "java.lang.reflect.AccessibleObject" ) || !classExists("org.gjt.sp.jedit.bsh.reflect.ReflectManagerImpl") ) throw new Unavailable( "Accessibility unavailable" ); // test basic access try { String.class.getDeclaredMethods(); } catch ( SecurityException e ) { throw new Unavailable("Accessibility unavailable: "+e); } accessibility = true; }
(Lib) IllegalStateException 3
              
// in org/gjt/sp/jedit/bsh/Modifiers.java
public void addModifier( int context, String name ) { if ( modifiers == null ) modifiers = new Hashtable(); Object existing = modifiers.put( name, Void.TYPE/*arbitrary flag*/ ); if ( existing != null ) throw new IllegalStateException("Duplicate modifier: "+ name ); int count = 0; if ( hasModifier("private") ) ++count; if ( hasModifier("protected") ) ++count; if ( hasModifier("public") ) ++count; if ( count > 1 ) throw new IllegalStateException( "public/private/protected cannot be used in combination." ); switch( context ) { case CLASS: validateForClass(); break; case METHOD: validateForMethod(); break; case FIELD: validateForField(); break; } }
// in org/gjt/sp/jedit/bsh/Modifiers.java
private void insureNo( String modifier, String context ) { if ( hasModifier( modifier ) ) throw new IllegalStateException( context + " cannot be declared '"+modifier+"'"); }
0 1
              
// in org/gjt/sp/jedit/search/HyperSearchResults.java
Override public void exportToClipboard(JComponent comp, Clipboard clip, int action) throws IllegalStateException { TreePath [] paths = resultTree.getSelectionPaths(); ToStringNodes toStringNodes = new ToStringNodes(); for (TreePath path: paths) { DefaultMutableTreeNode operNode = (DefaultMutableTreeNode) path.getLastPathComponent(); toStringNodes.processNode(operNode); } StringSelection selection = new StringSelection( toStringNodes.nodesString.toString()); Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); clipboard.setContents(selection, null); }
(Lib) UnsupportedFlavorException 3
              
// in org/gjt/sp/jedit/datatransfer/ListVFSFileTransferable.java
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (jEditFileList.equals(flavor)) { return files; } else if (DataFlavor.stringFlavor.equals(flavor)) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < files.size(); i++) { VFSFile vfsFile = files.get(i); if (i != 0) builder.append('\n'); builder.append(vfsFile.getPath()); } return builder.toString(); } else if (DataFlavor.javaFileListFlavor.equals(flavor)) { List<File> files = new ArrayList<File>(this.files.size()); for (VFSFile file : this.files) { if (file.getVFS() instanceof FileVFS) files.add(new File(file.getPath())); } return files; } throw new UnsupportedFlavorException(flavor); }
// in org/gjt/sp/jedit/datatransfer/RichTextTransferable.java
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (!isDataFlavorSupported(flavor)) throw new UnsupportedFlavorException(flavor); return new JEditRichText(text, mode); }
// in org/gjt/sp/jedit/datatransfer/JEditTransferable.java
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (!isDataFlavorSupported(flavor)) throw new UnsupportedFlavorException(flavor); Transferable transferable = flavors.get(flavor); return transferable.getTransferData(flavor); }
0 5
              
// in org/gjt/sp/jedit/gui/PingPongList.java
Override public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { return data; }
// in org/gjt/sp/jedit/datatransfer/ListVFSFileTransferable.java
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (jEditFileList.equals(flavor)) { return files; } else if (DataFlavor.stringFlavor.equals(flavor)) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < files.size(); i++) { VFSFile vfsFile = files.get(i); if (i != 0) builder.append('\n'); builder.append(vfsFile.getPath()); } return builder.toString(); } else if (DataFlavor.javaFileListFlavor.equals(flavor)) { List<File> files = new ArrayList<File>(this.files.size()); for (VFSFile file : this.files) { if (file.getVFS() instanceof FileVFS) files.add(new File(file.getPath())); } return files; } throw new UnsupportedFlavorException(flavor); }
// in org/gjt/sp/jedit/datatransfer/RichTextTransferable.java
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (!isDataFlavorSupported(flavor)) throw new UnsupportedFlavorException(flavor); return new JEditRichText(text, mode); }
// in org/gjt/sp/jedit/datatransfer/JEditTransferable.java
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (!isDataFlavorSupported(flavor)) throw new UnsupportedFlavorException(flavor); Transferable transferable = flavors.get(flavor); return transferable.getTransferData(flavor); }
// in org/gjt/sp/jedit/browser/VFSBrowser.java
public void paste(VFSFile file) throws IOException, UnsupportedFlavorException { if (file == null) throw new IllegalArgumentException("file cannot be null"); String targetPath = null; switch (file.getType()) { case VFSFile.FILESYSTEM: return; case VFSFile.FILE: targetPath = MiscUtilities.getParentOfPath(file.getPath()); break; case VFSFile.DIRECTORY: targetPath = file.getPath(); break; } VFS vfs = VFSManager.getVFSForPath(targetPath); Object vfsSession = null; try { vfsSession = vfs.createVFSSession(targetPath, this); if (vfsSession == null) { Log.log(Log.ERROR, this, "Unable to create session for " + targetPath); return; } Transferable transferable = Registers.getRegister('$').getTransferable(); List<String> sources = new ArrayList<String>(); if (transferable.isDataFlavorSupported(ListVFSFileTransferable.jEditFileList)) { Iterable<VFSFile> copiedFiles = (Iterable<VFSFile>) transferable.getTransferData(ListVFSFileTransferable.jEditFileList); for (VFSFile copiedFile : copiedFiles) { sources.add(copiedFile.getPath()); } } else if (transferable.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { Iterable<File> copiedFiles = (Iterable<File>) transferable.getTransferData(DataFlavor.javaFileListFlavor); for (File copiedFile : copiedFiles) { sources.add(copiedFile.getAbsolutePath()); } } CopyFileWorker worker = new CopyFileWorker(this, sources, targetPath); ThreadUtilities.runInBackground(worker); } finally { vfs._endVFSSession(vfsSession, this); } }
(Lib) FileNotFoundException 2
              
// in org/gjt/sp/jedit/io/VFS.java
public static boolean copy(ProgressObserver progress, VFS sourceVFS, Object sourceSession,String sourcePath, VFS targetVFS, Object targetSession,String targetPath, Component comp, boolean canStop, boolean sendVFSUpdate) throws IOException { if (progress != null) progress.setStatus("Initializing"); InputStream in = null; OutputStream out = null; try { VFSFile sourceVFSFile = sourceVFS._getFile(sourceSession, sourcePath, comp); if (sourceVFSFile == null) throw new FileNotFoundException("source path " + sourcePath + " doesn't exists"); if (progress != null) { progress.setMaximum(sourceVFSFile.getLength()); } VFSFile targetVFSFile = targetVFS._getFile(targetSession, targetPath, comp); if (targetVFSFile == null) { String parentTargetPath = MiscUtilities.getParentOfPath(targetPath); VFSFile parentTargetVFSFile = targetVFS._getFile(targetSession, parentTargetPath, comp); if (parentTargetVFSFile == null) throw new FileNotFoundException("target path " + parentTargetPath + " doesn't exists"); if (parentTargetVFSFile.getType() == VFSFile.DIRECTORY) { String targetFilename = MiscUtilities.getFileName(targetPath); targetPath = MiscUtilities.constructPath(parentTargetPath, targetFilename); } else { throw new IOException("The parent of target path is a file"); } } else if (targetVFSFile.getType() == VFSFile.DIRECTORY) { if (targetVFSFile.getPath().equals(sourceVFSFile.getPath())) return false; targetPath = MiscUtilities.constructPath(targetPath, sourceVFSFile.getName()); } in = new BufferedInputStream(sourceVFS._createInputStream(sourceSession, sourcePath, false, comp)); out = new BufferedOutputStream(targetVFS._createOutputStream(targetSession, targetPath, comp)); boolean copyResult = IOUtilities.copyStream(IOBUFSIZE, progress, in, out, canStop); if (sendVFSUpdate) VFSManager.sendVFSUpdate(targetVFS, targetPath, true); return copyResult; } finally { IOUtilities.closeQuietly(in); IOUtilities.closeQuietly(out); } }
0 3
              
// in org/gjt/sp/jedit/bsh/Remote.java
static String getFile( String name ) throws FileNotFoundException, IOException { StringBuilder sb = new StringBuilder(); BufferedReader bin = new BufferedReader( new FileReader( name ) ); String line; while ( (line=bin.readLine()) != null ) sb.append( line ).append( "\n" ); return sb.toString(); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object source( String filename, NameSpace nameSpace ) throws FileNotFoundException, IOException, EvalError { File file = pathToFile( filename ); if ( Interpreter.DEBUG ) debug("Sourcing file: "+file); Reader sourceIn = new BufferedReader( new FileReader(file) ); try { return eval( sourceIn, nameSpace, filename ); } finally { sourceIn.close(); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object source( String filename ) throws FileNotFoundException, IOException, EvalError { return source( filename, globalNameSpace ); }
(Domain) TextAreaException 2
              
// in org/gjt/sp/jedit/textarea/TextArea.java
public void addExplicitFold() throws TextAreaException { if(!buffer.isEditable()) { getToolkit().beep(); return; } if(!"explicit".equals(buffer.getStringProperty("folding"))) { throw new TextAreaException("folding-not-explicit"); } try { buffer.beginCompoundEdit(); if (getSelectionCount() == 0) { int caretBack = addExplicitFold(caret, caret, caretLine, caretLine); setCaretPosition(caret - caretBack); } else { Selection[] selections = getSelection(); Selection selection = null; int caretBack = 0; for (int i = 0; i < selections.length; i++) { selection = selections[i]; caretBack = addExplicitFold(selection.start, selection.end, selection.startLine,selection.endLine); } // Selection cannot be null because there is at least 1 selection assert selection != null; setCaretPosition(selection.start - caretBack, false); } } finally { buffer.endCompoundEdit(); } }
// in org/gjt/sp/jedit/textarea/TextArea.java
public void formatParagraph() throws TextAreaException { if(!buffer.isEditable()) { getToolkit().beep(); return; } if(maxLineLen <= 0) { throw new TextAreaException("format-maxlinelen"); } Selection[] selection = getSelection(); if(selection.length != 0) { buffer.beginCompoundEdit(); for(int i = 0; i < selection.length; i++) { Selection s = selection[i]; setSelectedText(s,TextUtilities.format( getSelectedText(s),maxLineLen, buffer.getTabSize())); } buffer.endCompoundEdit(); } else { int lineNo = getCaretLine(); int start = 0, end = buffer.getLength(); for(int i = lineNo - 1; i >= 0; i--) { if (lineContainsSpaceAndTabs(i)) { start = getLineEndOffset(i); break; } } for(int i = lineNo + 1; i < getLineCount(); i++) { if (lineContainsSpaceAndTabs(i)) { end = getLineStartOffset(i) - 1; break; } } try { buffer.beginCompoundEdit(); String text = buffer.getText(start,end - start); int offset = getCaretPosition() - start; int noSpaceOffset = TextUtilities.indexIgnoringWhitespace( text,offset); buffer.remove(start,end - start); text = TextUtilities.format( text,maxLineLen,buffer.getTabSize()); buffer.insert(start,text); int caretPos = start; if (text.length() != 0) { caretPos += Math.min(text.length(), TextUtilities.ignoringWhitespaceIndex( text,noSpaceOffset)); } moveCaretPosition(caretPos); } finally { buffer.endCompoundEdit(); } } }
0 2
              
// in org/gjt/sp/jedit/textarea/TextArea.java
public void addExplicitFold() throws TextAreaException { if(!buffer.isEditable()) { getToolkit().beep(); return; } if(!"explicit".equals(buffer.getStringProperty("folding"))) { throw new TextAreaException("folding-not-explicit"); } try { buffer.beginCompoundEdit(); if (getSelectionCount() == 0) { int caretBack = addExplicitFold(caret, caret, caretLine, caretLine); setCaretPosition(caret - caretBack); } else { Selection[] selections = getSelection(); Selection selection = null; int caretBack = 0; for (int i = 0; i < selections.length; i++) { selection = selections[i]; caretBack = addExplicitFold(selection.start, selection.end, selection.startLine,selection.endLine); } // Selection cannot be null because there is at least 1 selection assert selection != null; setCaretPosition(selection.start - caretBack, false); } } finally { buffer.endCompoundEdit(); } }
// in org/gjt/sp/jedit/textarea/TextArea.java
public void formatParagraph() throws TextAreaException { if(!buffer.isEditable()) { getToolkit().beep(); return; } if(maxLineLen <= 0) { throw new TextAreaException("format-maxlinelen"); } Selection[] selection = getSelection(); if(selection.length != 0) { buffer.beginCompoundEdit(); for(int i = 0; i < selection.length; i++) { Selection s = selection[i]; setSelectedText(s,TextUtilities.format( getSelectedText(s),maxLineLen, buffer.getTabSize())); } buffer.endCompoundEdit(); } else { int lineNo = getCaretLine(); int start = 0, end = buffer.getLength(); for(int i = lineNo - 1; i >= 0; i--) { if (lineContainsSpaceAndTabs(i)) { start = getLineEndOffset(i); break; } } for(int i = lineNo + 1; i < getLineCount(); i++) { if (lineContainsSpaceAndTabs(i)) { end = getLineStartOffset(i) - 1; break; } } try { buffer.beginCompoundEdit(); String text = buffer.getText(start,end - start); int offset = getCaretPosition() - start; int noSpaceOffset = TextUtilities.indexIgnoringWhitespace( text,offset); buffer.remove(start,end - start); text = TextUtilities.format( text,maxLineLen,buffer.getTabSize()); buffer.insert(start,text); int caretPos = start; if (text.length() != 0) { caretPos += Math.min(text.length(), TextUtilities.ignoringWhitespaceIndex( text,noSpaceOffset)); } moveCaretPosition(caretPos); } finally { buffer.endCompoundEdit(); } } }
(Domain) TokenMgrError 2
              
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
public void SwitchTo(int lexState) { if (lexState >= 1 || lexState < 0) throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); else curLexState = lexState; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
public Token getNextToken() { int kind; Token specialToken = null; Token matchedToken; int curPos = 0; EOFLoop : for (;;) { try { curChar = input_stream.BeginToken(); } catch(java.io.IOException e) { jjmatchedKind = 0; matchedToken = jjFillToken(); matchedToken.specialToken = specialToken; return matchedToken; } jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_0(); if (jjmatchedKind != 0x7fffffff) { if (jjmatchedPos + 1 < curPos) input_stream.backup(curPos - jjmatchedPos - 1); if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { matchedToken = jjFillToken(); matchedToken.specialToken = specialToken; return matchedToken; } else { if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { matchedToken = jjFillToken(); if (specialToken == null) specialToken = matchedToken; else { matchedToken.specialToken = specialToken; specialToken = (specialToken.next = matchedToken); } } continue EOFLoop; } } int error_line = input_stream.getEndLine(); int error_column = input_stream.getEndColumn(); String error_after = null; boolean EOFSeen = false; try { input_stream.readChar(); input_stream.backup(1); } catch (java.io.IOException e1) { EOFSeen = true; error_after = curPos <= 1 ? "" : input_stream.GetImage(); if (curChar == '\n' || curChar == '\r') { error_line++; error_column = 0; } else error_column++; } if (!EOFSeen) { input_stream.backup(1); error_after = curPos <= 1 ? "" : input_stream.GetImage(); } throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); } }
0 0
(Lib) UnsupportedCharsetException 2
              
// in org/gjt/sp/jedit/io/EncodingServer.java
public static Encoding getEncoding(String name) { try { return new CharsetEncoding(name); } catch (IllegalCharsetNameException e) { // just failed } catch (UnsupportedCharsetException e) { // just failed } Object namedService = ServiceManager.getService(serviceClass, name); if (namedService != null && namedService instanceof Encoding) { return (Encoding)namedService; } // UnsupportedCharsetException is for java.nio.charset, // but throw this here too so that this can be caught as // an encoding error by catch clause for general I/O code. throw new UnsupportedCharsetException("No such encoding: \"" + name + "\""); }
0 0
(Lib) Exception 1
              
// in org/gjt/sp/jedit/jEdit.java
public static void main(String[] args) { StringList slargs = new StringList(args); //{{{ Check for Java 1.6 or later String javaVersion = System.getProperty("java.version"); if(javaVersion.compareTo("1.6") < 0) { System.err.println("You are running Java version " + javaVersion + '.'); System.err.println("jEdit requires Java 1.6 or later."); System.exit(1); } //}}} startupDone.add(false); // later on we need to know if certain code is called from // the main thread mainThread = Thread.currentThread(); settingsDirectory = MiscUtilities.constructPath( System.getProperty("user.home"), ".jedit"); // On mac, different rules (should) apply if(OperatingSystem.isMacOS()) settingsDirectory = MiscUtilities.constructPath( System.getProperty("user.home"), "Library/jEdit" ); else if (OperatingSystem.isWindows()) { String appData = System.getenv("APPDATA"); if (appData != null) settingsDirectory = MiscUtilities.constructPath( appData, "jEdit"); } // MacOS users expect the app to keep running after all windows // are closed background = OperatingSystem.isMacOS(); //{{{ Parse command line boolean endOpts = false; int level = Log.WARNING; String portFile = "server"; boolean restore = true; boolean newView = true; boolean newPlainView = false; boolean gui = true; // open initial view? boolean loadPlugins = true; boolean runStartupScripts = true; boolean quit = false; boolean wait = false; boolean shouldRelocateSettings = true; String userDir = System.getProperty("user.dir"); boolean splash = true; // script to run String scriptFile = null; for(int i = 0; i < args.length; i++) { String arg = args[i]; if(arg == null) continue; else if(arg.length() == 0) args[i] = null; else if(arg.startsWith("-") && !endOpts) { if(arg.equals("--")) endOpts = true; else if(arg.equals("-usage")) { version(); System.err.println(); usage(); System.exit(1); } else if(arg.equals("-version")) { version(); System.exit(1); } else if(arg.startsWith("-log=")) { try { level = Integer.parseInt(arg.substring("-log=".length())); } catch(NumberFormatException nf) { System.err.println("Malformed option: " + arg); } } else if(arg.equals("-nosettings")) settingsDirectory = null; else if(arg.startsWith("-settings=")) { settingsDirectory = arg.substring(10); shouldRelocateSettings = false; } else if(arg.startsWith("-noserver")) portFile = null; else if(arg.equals("-server")) portFile = "server"; else if(arg.startsWith("-server=")) portFile = arg.substring(8); else if(arg.startsWith("-background")) background = true; else if(arg.startsWith("-nobackground")) background = false; else if(arg.equals("-gui")) gui = true; else if(arg.equals("-nogui")) gui = false; else if(arg.equals("-newview")) newView = true; else if(arg.equals("-newplainview")) newPlainView = true; else if(arg.equals("-reuseview")) newPlainView = newView = false; else if(arg.equals("-restore")) restore = true; else if(arg.equals("-norestore")) restore = false; else if(arg.equals("-plugins")) loadPlugins = true; else if(arg.equals("-noplugins")) loadPlugins = false; else if(arg.equals("-startupscripts")) runStartupScripts = true; else if(arg.equals("-nostartupscripts")) runStartupScripts = false; else if(arg.startsWith("-run=")) scriptFile = arg.substring(5); else if(arg.equals("-wait")) wait = true; else if(arg.equals("-quit")) quit = true; else if(arg.equals("-nosplash")) splash = false; else { System.err.println("Unknown option: " + arg); usage(); System.exit(1); } args[i] = null; } } //}}} JTrayIconManager.setTrayIconArgs(restore, userDir, args); //{{{ We need these initializations very early on if(settingsDirectory != null) { settingsDirectory = MiscUtilities.resolveSymlinks( settingsDirectory); } if(settingsDirectory != null && portFile != null) portFile = MiscUtilities.constructPath(settingsDirectory,portFile); else portFile = null; Log.init(true,level); Log.log(Log.MESSAGE,jEdit.class, "starting with command line arguments: " + slargs.join(" ")); //}}} //{{{ Try connecting to another running jEdit instance if(portFile != null && new File(portFile).exists()) { try { BufferedReader in = new BufferedReader(new FileReader(portFile)); String check = in.readLine(); if(!"b".equals(check)) throw new Exception("Wrong port file format"); int port = Integer.parseInt(in.readLine()); int key = Integer.parseInt(in.readLine()); Socket socket = new Socket(InetAddress.getByName("127.0.0.1"),port); DataOutputStream out = new DataOutputStream( socket.getOutputStream()); out.writeInt(key); String script; if(quit) { script = "socket.close();\n" + "jEdit.exit(null,true);\n"; } else { script = makeServerScript(wait,restore, newView,newPlainView,args, scriptFile); } out.writeUTF(script); Log.log(Log.DEBUG,jEdit.class,"Waiting for server"); // block until its closed try { socket.getInputStream().read(); } catch(Exception e) { } in.close(); out.close(); System.exit(0); } catch(Exception e) { // ok, this one seems to confuse newbies // endlessly, so log it as NOTICE, not // ERROR Log.log(Log.NOTICE,jEdit.class,"An error occurred" + " while connecting to the jEdit server instance."); Log.log(Log.NOTICE,jEdit.class,"This probably means that" + " jEdit crashed and/or exited abnormally"); Log.log(Log.NOTICE,jEdit.class,"the last time it was run."); Log.log(Log.NOTICE,jEdit.class,"If you don't" + " know what this means, don't worry."); Log.log(Log.NOTICE,jEdit.class,e); } } if(quit) { // if no server running and user runs jedit -quit, // just exit System.exit(0); } //}}} // This must be done before anything graphical is displayed, so we can't even // wait for the settings to be loaded, because the splash screen will already // be visible if (OperatingSystem.isMacOS() && !new File(settingsDirectory, "noquartz").exists()) { System.setProperty("apple.awt.graphics.UseQuartz", "true"); } // don't show splash screen if there is a file named // 'nosplash' in the settings directory logTime("before splash screen activation"); if(splash && (!new File(settingsDirectory,"nosplash").exists())) GUIUtilities.showSplashScreen(); logTime("after splash screen activation"); //{{{ Settings migration code. // Windows check introduced in 5.0pre1. // MacOS check introduced in 4.3. if((OperatingSystem.isMacOS() || OperatingSystem.isWindows()) && shouldRelocateSettings && settingsDirectory != null) { relocateSettings(); } // }}} //{{{ Initialize settings directory Writer stream; if(settingsDirectory != null) { File _settingsDirectory = new File(settingsDirectory); if(!_settingsDirectory.exists()) _settingsDirectory.mkdirs(); File _macrosDirectory = new File(settingsDirectory,"macros"); if(!_macrosDirectory.exists()) _macrosDirectory.mkdir(); String logPath = MiscUtilities.constructPath( settingsDirectory,"activity.log"); backupSettingsFile(new File(logPath)); try { stream = new BufferedWriter(new FileWriter(logPath)); // Write a warning message: String lineSep = System.getProperty("line.separator"); stream.write("Log file created on " + new Date()); stream.write(lineSep); stream.write("IMPORTANT:"); stream.write(lineSep); stream.write("Because updating this file after " + "every log message would kill"); stream.write(lineSep); stream.write("performance, it will be *incomplete* " + "unless you invoke the"); stream.write(lineSep); stream.write("Utilities->Troubleshooting->Update " + "Activity Log on Disk command!"); stream.write(lineSep); } catch(Exception e) { e.printStackTrace(); stream = null; } } else { stream = null; } //}}} Log.setLogWriter(stream); Log.log(Log.NOTICE,jEdit.class,"jEdit version " + getVersion()); Log.log(Log.MESSAGE,jEdit.class,"Settings directory is " + settingsDirectory); //{{{ Get things rolling GUIUtilities.advanceSplashProgress("init"); initMisc(); GUIUtilities.advanceSplashProgress("init system properties"); initSystemProperties(); GUIUtilities.advanceSplashProgress("init beanshell"); BeanShell.init(); GUIUtilities.advanceSplashProgress("loading site properties"); if(jEditHome != null) initSiteProperties(); GUIUtilities.advanceSplashProgress("loading user properties"); initUserProperties(); initLocalizationProperties(); GUIUtilities.advanceSplashProgress("init GUI"); GUIUtilities.init(); bufferSetManager = new BufferSetManager(); //}}} //{{{ Initialize server if(portFile != null) { GUIUtilities.advanceSplashProgress("init server"); server = new EditServer(portFile); if(!server.isOK()) server = null; } else { GUIUtilities.advanceSplashProgress(); if(background) { background = false; Log.log(Log.WARNING,jEdit.class,"You cannot specify both the" + " -background and -noserver switches"); } } //}}} //{{{ Do more stuff GUIUtilities.advanceSplashProgress("init look and feel"); initPLAF(); GUIUtilities.advanceSplashProgress("init VFS Manager"); VFSManager.init(); GUIUtilities.advanceSplashProgress("init resources"); initResources(); if (settingsDirectory != null) { GUIUtilities.advanceSplashProgress("Migrate keymaps"); MigrationService keymapMigration = ServiceManager.getService(MigrationService.class, "keymap"); keymapMigration.migrate(); } SearchAndReplace.load(); if(loadPlugins) { GUIUtilities.advanceSplashProgress("init plugins"); initPlugins(); } else GUIUtilities.advanceSplashProgress(); Registers.setSaver(new JEditRegisterSaver()); Registers.setListener(new JEditRegistersListener()); GUIUtilities.advanceSplashProgress("init history model"); HistoryModel.setSaver(new JEditHistoryModelSaver()); HistoryModel.loadHistory(); GUIUtilities.advanceSplashProgress("init buffer history"); BufferHistory.load(); GUIUtilities.advanceSplashProgress("init killring"); KillRing.setInstance(new JEditKillRing()); KillRing.getInstance().load(); GUIUtilities.advanceSplashProgress("init various properties"); propertiesChanged(); GUIUtilities.advanceSplashProgress("init modes"); // Buffer sort sortBuffers = getBooleanProperty("sortBuffers"); sortByName = getBooleanProperty("sortByName"); reloadModes(); GUIUtilities.advanceSplashProgress("activate plugins"); //}}} //{{{ Activate plugins that must be activated at startup for(int i = 0; i < jars.size(); i++) { jars.elementAt(i).activatePluginIfNecessary(); } //}}} String[] serviceNames = ServiceManager.getServiceNames(JEditTransferableService.class); for (String serviceName : serviceNames) { JEditTransferableService service = ServiceManager.getService(JEditTransferableService.class, serviceName); org.gjt.sp.jedit.datatransfer.TransferHandler.getInstance().registerTransferableService(service); } //{{{ Load macros and run startup scripts, after plugins and settings are loaded GUIUtilities.advanceSplashProgress("init macros"); Macros.loadMacros(); Macros.getMacroActionSet().initKeyBindings(); if(runStartupScripts && jEditHome != null) { String path = MiscUtilities.constructPath(jEditHome,"startup"); File file = new File(path); if(file.exists()) { runStartupScripts(file); } else GUIUtilities.advanceSplashProgress(); } else GUIUtilities.advanceSplashProgress("run startup scripts"); if(runStartupScripts && settingsDirectory != null) { String path = MiscUtilities.constructPath(settingsDirectory,"startup"); File file = new File(path); if (file.exists()) { GUIUtilities.advanceSplashProgress("run startup scripts"); runStartupScripts(file); } else { GUIUtilities.advanceSplashProgress(); file.mkdirs(); } } else { GUIUtilities.advanceSplashProgress(); } //}}} //{{{ Run script specified with -run= parameter if(scriptFile != null) { GUIUtilities.advanceSplashProgress("run script file"); scriptFile = MiscUtilities.constructPath(userDir,scriptFile); try { BeanShell.getNameSpace().setVariable("args",args); } catch(UtilEvalError e) { Log.log(Log.ERROR,jEdit.class,e); } BeanShell.runScript(null,scriptFile,null,false); } else { GUIUtilities.advanceSplashProgress(); } //}}} GUIUtilities.advanceSplashProgress(); // Create dynamic actions for switching to saved layouts. // The list of saved layouts is retrieved from the docking framework, // which can be provided by a plugin, so this must be called only after // the plugins are loaded. DockingLayoutManager.init(); // Open files, create the view and hide the splash screen. SyntaxUtilities.propertyManager = jEdit.propertyManager; finishStartup(gui,restore,newPlainView,userDir,args); logTime("main done"); }
0 42
              
// in org/gjt/sp/jedit/help/HelpViewer.java
Override public void gotoURL(String url, final boolean addToHistory, final int scrollPosition) { // the TOC pane looks up user's guide URLs relative to the // doc directory... String shortURL; if (MiscUtilities.isURL(url)) { if (url.startsWith(baseURL)) { shortURL = url.substring(baseURL.length()); if(shortURL.startsWith("/")) { shortURL = shortURL.substring(1); } } else { shortURL = url; } } else { shortURL = url; if(baseURL.endsWith("/")) { url = baseURL + url; } else { url = baseURL + '/' + url; } } // reset default cursor so that the hand cursor doesn't // stick around viewer.setCursor(Cursor.getDefaultCursor()); try { final URL _url = new URL(url); final String _shortURL = shortURL; if(!_url.equals(viewer.getPage())) { title.setText(jEdit.getProperty("helpviewer.loading")); } else { /* don't show loading msg because we won't receive a propertyChanged */ } historyModel.setCurrentScrollPosition(viewer.getPage(),getCurrentScrollPosition()); /* call setPage asynchronously, because it can block when one can't connect to host. Calling setPage outside from the EDT violates the single-tread rule of Swing, but it's an experienced workaround (see merge request #2984022 - fix blocking HelpViewer https://sourceforge.net/tracker/?func=detail&aid=2984022&group_id=588&atid=1235750 for discussion). Once jEdit sets JDK 7 as dependency, all this should be reverted to synchronous code. */ SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() { private boolean success; @Override protected Void doInBackground() throws Exception { try { viewer.setPage(_url); success = true; } catch(IOException io) { Log.log(Log.ERROR,this,io); String[] args = { _url.toString(), io.toString() }; GUIUtilities.error(HelpViewer.this,"read-error",args); } return null; } @Override protected void done() { if (success) { if (scrollPosition != 0) { viewerScrollPane.getVerticalScrollBar().setValue(scrollPosition); } if(addToHistory) { historyModel.addToHistory(_url.toString()); } HelpViewer.this.shortURL = _shortURL; // select the appropriate tree node. if(_shortURL != null) { toc.selectNode(_shortURL); } viewer.requestFocus(); } } }; worker.execute(); } catch(MalformedURLException mf) { Log.log(Log.ERROR,this,mf); String[] args = { url, mf.getMessage() }; GUIUtilities.error(this,"badurl",args); } }
// in org/gjt/sp/jedit/help/HelpViewer.java
Override protected Void doInBackground() throws Exception { try { viewer.setPage(_url); success = true; } catch(IOException io) { Log.log(Log.ERROR,this,io); String[] args = { _url.toString(), io.toString() }; GUIUtilities.error(HelpViewer.this,"read-error",args); } return null; }
// in org/gjt/sp/jedit/help/HelpIndex.java
public void indexDirectory(String dir) throws Exception { String[] files = VFSManager.getFileVFS() ._listDirectory(null,dir,"*.{html,txt}",true,null); for(int i = 0; i < files.length; i++) { indexURL(files[i]); } }
// in org/gjt/sp/jedit/help/HelpIndex.java
public void indexJAR(ZipFile jar) throws Exception { Enumeration e = jar.entries(); while(e.hasMoreElements()) { ZipEntry entry = (ZipEntry)e.nextElement(); String name = entry.getName(); String lname = name.toLowerCase(); if(lname.endsWith(".html")/* || lname.endsWith(".txt") */) { // only works for jEdit plugins String url = "jeditresource:/" + MiscUtilities.getFileName(jar.getName()) + "!/" + name; Log.log(Log.DEBUG,this,url); indexStream(jar.getInputStream(entry),url); } } }
// in org/gjt/sp/jedit/help/HelpIndex.java
public void indexURL(String url) throws Exception { InputStream _in; if(MiscUtilities.isURL(url)) _in = new URL(url).openStream(); else { _in = new FileInputStream(url); // hack since HelpViewer needs a URL... url = "file:" + url; } indexStream(_in,url); }
// in org/gjt/sp/jedit/help/HelpIndex.java
private void indexStream(InputStream _in, String fileName) throws Exception { HelpFile file = new HelpFile(fileName); files.add(file); int index = files.size() - 1; StringBuilder titleText = new StringBuilder(); BufferedReader in = new BufferedReader( new InputStreamReader(_in)); try { StringBuilder word = new StringBuilder(); boolean insideTag = false; boolean insideEntity = false; boolean title = false; int c; while((c = in.read()) != -1) { char ch = (char)c; if(insideTag) { if(ch == '>') { if(word.toString().equals("title")) title = true; insideTag = false; word.setLength(0); } else word.append(ch); } else if(insideEntity) { if(ch == ';') insideEntity = false; } else if(ch == '<') { if(title) title = false; if(word.length() != 0) { addWord(word.toString(),index,title); word.setLength(0); } insideTag = true; } else if(ch == '&') insideEntity = true; else if(title) titleText.append(ch); else if(!Character.isLetterOrDigit(ch)) { if(word.length() != 0) { addWord(word.toString(),index,title); word.setLength(0); } } else word.append(ch); } } finally { in.close(); } if(titleText.length() == 0) file.title = fileName; else file.title = titleText.toString(); }
// in org/gjt/sp/jedit/bsh/CommandLineReader.java
public static void main( String [] args ) throws Exception { Reader in = new CommandLineReader( new InputStreamReader(System.in) ); while ( true ) System.out.println( in.read() ); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public static void main( String [] args ) throws Exception { URL [] urls = new URL [ args.length ]; for(int i=0; i< args.length; i++) urls[i] = new File(args[i]).toURL(); BshClassPath bcp = new BshClassPath( "Test", urls ); }
// in org/gjt/sp/jedit/bsh/Remote.java
public static void main( String args[] ) throws Exception { if ( args.length < 2 ) { System.out.println( "usage: Remote URL(http|bsh) file [ file ] ... "); System.exit(1); } String url = args[0]; String text = getFile(args[1]); int ret = eval( url, text ); System.exit( ret ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public static void invokeMain( Class clas, String [] args ) throws Exception { Method main = Reflect.resolveJavaMethod( null/*BshClassManager*/, clas, "main", new Class [] { String [].class }, true/*onlyStatic*/ ); if ( main != null ) main.invoke( null, new Object [] { args } ); }
// in org/gjt/sp/jedit/EditServer.java
private boolean handleClient(final Socket client, DataInputStream in) throws Exception { int key = in.readInt(); if(key != authKey) { Log.log(Log.ERROR,this,client + ": wrong" + " authorization key (got " + key + ", expected " + authKey + ")"); in.close(); client.close(); return false; } else { // Reset the timeout client.setSoTimeout(0); Log.log(Log.DEBUG,this,client + ": authenticated" + " successfully"); final String script = in.readUTF(); Log.log(Log.DEBUG,this,script); SwingUtilities.invokeLater(new Runnable() { public void run() { try { NameSpace ns = new NameSpace( BeanShell.getNameSpace(), "EditServer namespace"); ns.setVariable("socket",client); BeanShell.eval(null,ns,script); } catch(org.gjt.sp.jedit.bsh.UtilEvalError e) { Log.log(Log.ERROR,this,e); } finally { try { BeanShell.getNameSpace().setVariable("socket",null); } catch(org.gjt.sp.jedit.bsh.UtilEvalError e) { Log.log(Log.ERROR,this,e); } } } }); return true; }
// in org/gjt/sp/jedit/EditBus.java
private static void dispatch(EBMessageHandler emh, EBMessage msg) throws Exception { if (emh.handler != null) emh.handler.invoke(emh.comp, msg); else { assert (emh.comp instanceof EBComponent); ((EBComponent)emh.comp).handleMessage(msg); } }
// in org/gjt/sp/jedit/BeanShellFacade.java
public Object _eval(T view, NameSpace namespace, String command) throws Exception { Interpreter interp = createInterpreter(namespace); try { setupDefaultVariables(namespace,view); if(Debug.BEANSHELL_DEBUG) Log.log(Log.DEBUG,BeanShellFacade.class,command); return interp.eval(command); } catch(Exception e) { unwrapException(e); // never called return null; } finally { try { resetDefaultVariables(namespace); } catch(UtilEvalError e) { // do nothing } } }
// in org/gjt/sp/jedit/BeanShellFacade.java
public BshMethod cacheBlock(String id, String code, boolean namespace) throws Exception { // Make local namespace so that the method could be GCed // if it becomes unnecessary. NameSpace local = new NameSpace(global, "__internal_" + id); // This name should be unique enough not to shadow any outer // identifier. String name = "__runCachedMethod"; if(namespace) { _eval(null,local,name + "(ns) {\nthis.callstack.set(0,ns);\n" + code + "\n}"); return local.getMethod(name,new Class[] { NameSpace.class }); } else { _eval(null,local,name + "() {\n" + code + "\n}"); return local.getMethod(name,new Class[0]); } }
// in org/gjt/sp/jedit/BeanShellFacade.java
public Object runCachedBlock(BshMethod method, T param, NameSpace namespace) throws Exception { boolean useNamespace; if(namespace == null) { useNamespace = false; namespace = global; } else useNamespace = true; try { setupDefaultVariables(namespace,param); Object retVal = method.invoke(useNamespace ? new Object[] { namespace } : NO_ARGS, interpForMethods,new CallStack(), null); if(retVal instanceof Primitive) { if(retVal == Primitive.VOID) return null; else return ((Primitive)retVal).getValue(); } else return retVal; } catch(Exception e) { unwrapException(e); // never called return null; } finally { resetDefaultVariables(namespace); } }
// in org/gjt/sp/jedit/BeanShellFacade.java
protected static void unwrapException(Exception e) throws Exception { if(e instanceof TargetError) { Throwable t = ((TargetError)e).getTarget(); if(t instanceof Exception) throw (Exception)t; else if(t instanceof Error) throw (Error)t; } if(e instanceof InvocationTargetException) { Throwable t = ((InvocationTargetException)e).getTargetException(); if(t instanceof Exception) throw (Exception)t; else if(t instanceof Error) throw (Error)t; } throw e; }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
public static SearchMatcher getSearchMatcher() throws Exception { if (matcher != null) return matcher; if (search == null || "".equals(search)) return null; if (regexp) { Pattern re = Pattern.compile(search, PatternSearchMatcher.getFlag(ignoreCase)); matcher = new PatternSearchMatcher(re, ignoreCase, wholeWord); } else matcher = new BoyerMooreSearchMatcher(search, ignoreCase, wholeWord); return matcher; }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
public static boolean find(View view, Buffer buffer, int start) throws Exception { return find(view,buffer,start,false,false); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
public static boolean find(View view, Buffer buffer, int start, boolean firstTime, boolean reverse) throws Exception { EditBus.send(new PositionChanging(view.getEditPane())); SearchMatcher matcher = getSearchMatcher(); if(matcher == null) { view.getToolkit().beep(); return false; } CharSequence text; boolean startOfLine; boolean endOfLine; if(reverse) { text = new ReverseCharSequence(buffer.getSegment(0,start)); startOfLine = true; endOfLine = (buffer.getLineEndOffset( buffer.getLineOfOffset(start)) - 1 == start); } else { text = buffer.getSegment(start,buffer.getLength() - start); startOfLine = (buffer.getLineStartOffset( buffer.getLineOfOffset(start)) == start); endOfLine = true; } String noWordSep = (String) buffer.getMode().getProperty("noWordSep"); matcher.setNoWordSep(noWordSep); SearchMatcher.Match match = matcher.nextMatch(text, startOfLine,endOfLine,firstTime,reverse); if(match != null) { jEdit.commitTemporary(buffer); view.setBuffer(buffer,true); JEditTextArea textArea = view.getTextArea(); if(reverse) { textArea.setSelection(new Selection.Range( start - match.end, start - match.start)); // make sure end of match is visible textArea.scrollTo(start - match.start,false); textArea.moveCaretPosition(start - match.end); } else { textArea.setSelection(new Selection.Range( start + match.start, start + match.end)); textArea.moveCaretPosition(start + match.end); // make sure start of match is visible textArea.scrollTo(start + match.start,false); } return true; } else return false; }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
private static void initReplace() throws Exception { if(beanshell && replace.length() != 0) { String text; if( replace.trim().startsWith( "{" ) ) text = replace; else text = "return (" + replace + ");"; replaceMethod = BeanShell.cacheBlock("replace", text,true); } else replaceMethod = null; }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
private static int replaceInSelection(View view, TextArea textArea, Buffer buffer, SearchMatcher matcher, boolean smartCaseReplace, Selection s) throws Exception { /* if an occurence occurs at the beginning of the selection, the selection start will get moved. this sucks, so we hack to avoid it. */ int start = s.getStart(); int returnValue; if(s instanceof Selection.Range) { returnValue = _replace(view,buffer,matcher, s.getStart(),s.getEnd(), smartCaseReplace); textArea.removeFromSelection(s); textArea.addToSelection(new Selection.Range( start,s.getEnd())); } else if(s instanceof Selection.Rect) { Selection.Rect rect = (Selection.Rect)s; int startCol = rect.getStartColumn( buffer); int endCol = rect.getEndColumn( buffer); returnValue = 0; for(int j = s.getStartLine(); j <= s.getEndLine(); j++) { returnValue += _replace(view,buffer,matcher, getColumnOnOtherLine(buffer,j,startCol), getColumnOnOtherLine(buffer,j,endCol), smartCaseReplace); } textArea.addToSelection(new Selection.Rect( start,s.getEnd())); } else throw new RuntimeException("Unsupported: " + s); return returnValue; }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
private static int _replace(View view, JEditBuffer buffer, SearchMatcher matcher, int start, int end, boolean smartCaseReplace) throws Exception { String wordBreakChars = (String) buffer.getMode().getProperty("wordBreakChars"); matcher.setNoWordSep(wordBreakChars); int occurCount = 0; boolean endOfLine = (buffer.getLineEndOffset( buffer.getLineOfOffset(end)) - 1 == end); int offset = start; loop: for(int counter = 0; ; counter++) { boolean startOfLine = (buffer.getLineStartOffset( buffer.getLineOfOffset(offset)) == offset); CharSequence text = buffer.getSegment(offset,end - offset); SearchMatcher.Match occur = matcher.nextMatch( text,startOfLine,endOfLine,counter == 0,false); if(occur == null) break loop; CharSequence found = text.subSequence( occur.start, occur.end); int length = replaceOne(view,buffer,occur,offset, found,smartCaseReplace); if(length == -1) offset += occur.end; else { offset += occur.start + length; end += (length - found.length()); occurCount++; } } return occurCount; }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
private static int replaceOne(View view, JEditBuffer buffer, SearchMatcher.Match occur, int offset, CharSequence found, boolean smartCaseReplace) throws Exception { String subst = replaceOne(view,buffer,occur,found); if(smartCaseReplace && ignoreCase) { int strCase = TextUtilities.getStringCase(found); if(strCase == TextUtilities.LOWER_CASE) subst = subst.toLowerCase(); else if(strCase == TextUtilities.UPPER_CASE) subst = subst.toUpperCase(); else if(strCase == TextUtilities.TITLE_CASE) subst = TextUtilities.toTitleCase(subst); } if(subst != null) { int start = offset + occur.start; int end = offset + occur.end; if (end - start > 0) buffer.remove(start,end - start); buffer.insert(start,subst); return subst.length(); } else return -1; }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
private static String replaceOne(View view, JEditBuffer buffer, SearchMatcher.Match occur, CharSequence found) throws Exception { if(regexp) { if(replaceMethod != null) return regexpBeanShellReplace(view,buffer,occur); else return regexpReplace(occur,found); } else { if(replaceMethod != null) return literalBeanShellReplace(view,buffer,found); else return replace; } }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
private static String regexpBeanShellReplace(View view, JEditBuffer buffer, SearchMatcher.Match occur) throws Exception { replaceNS.setVariable("buffer", buffer, false); for(int i = 0; i < occur.substitutions.length; i++) { replaceNS.setVariable("_" + i, occur.substitutions[i]); } Object obj = BeanShell.runCachedBlock( replaceMethod,view,replaceNS); for(int i = 0; i < occur.substitutions.length; i++) { replaceNS.setVariable("_" + i, null, false); } // Not really necessary because it is already cleared in the end of // BeanShell.runCachedBlock() replaceNS.setVariable("buffer", null, false); if(obj == null) return ""; else return obj.toString(); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
private static String regexpReplace(SearchMatcher.Match occur, CharSequence found) throws Exception { StringBuilder buf = new StringBuilder(); for(int i = 0; i < replace.length(); i++) { char ch = replace.charAt(i); switch(ch) { case '$': if(i == replace.length() - 1) { // last character of the replace string, // it is not a capturing group buf.append(ch); break; } ch = replace.charAt(++i); if(ch == '$') { // It was $$, so it is an escaped $ buf.append('$'); } else if(ch == '0') { // $0 meaning the first capturing group : // the found value buf.append(found); } else if(Character.isDigit(ch)) { int n = ch - '0'; while (i < replace.length() - 1) { ch = replace.charAt(++i); if (Character.isDigit(ch)) { n = n * 10 + (ch - '0'); } else { // The character is not // a digit, going back and // end loop i--; break; } } if(n < occur .substitutions .length) { String subs = occur.substitutions[n]; if (subs != null) buf.append(subs); } } break; case '\\': if(i == replace.length() - 1) { buf.append('\\'); break; } ch = replace.charAt(++i); switch(ch) { case 'n': buf.append('\n'); break; case 't': buf.append('\t'); break; default: buf.append(ch); break; } break; default: buf.append(ch); break; } } return buf.toString(); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
private static String literalBeanShellReplace(View view, JEditBuffer buffer, CharSequence found) throws Exception { replaceNS.setVariable("buffer",buffer); replaceNS.setVariable("_0",found); Object obj = BeanShell.runCachedBlock( replaceMethod, view,replaceNS); replaceNS.setVariable("_0", null, false); // Not really necessary because it is already cleared in the end of // BeanShell.runCachedBlock() replaceNS.setVariable("buffer", null, false); if(obj == null) return ""; else return obj.toString(); }
// in org/gjt/sp/jedit/search/HyperSearchRequest.java
private int searchInSelection(Buffer buffer) throws Exception { setCancellable(false); int resultCount = 0; try { buffer.readLock(); for(int i = 0; i < selection.length; i++) { Selection s = selection[i]; if(s instanceof Selection.Rect) { for(int j = s.getStartLine(); j <= s.getEndLine(); j++) { resultCount += doHyperSearch(buffer, s.getStart(buffer,j), s.getEnd(buffer,j)); } } else { resultCount += doHyperSearch(buffer, s.getStart(),s.getEnd()); } } } finally { buffer.readUnlock(); } setCancellable(true); return resultCount; }
// in org/gjt/sp/jedit/search/HyperSearchRequest.java
private int doHyperSearch(Buffer buffer, int start, int end) throws Exception { setCancellable(false); HyperSearchFileNode hyperSearchFileNode = new HyperSearchFileNode(buffer.getPath()); DefaultMutableTreeNode bufferNode = new DefaultMutableTreeNode(hyperSearchFileNode); int resultCount = doHyperSearch(buffer,start,end,bufferNode); hyperSearchFileNode.setCount(resultCount); if(resultCount != 0) rootSearchNode.insert(bufferNode,rootSearchNode.getChildCount()); setCancellable(true); return resultCount; }
// in org/gjt/sp/jedit/Abbrevs.java
private static void loadAbbrevs(Reader _in) throws Exception { BufferedReader in = new BufferedReader(_in); try { Hashtable<String,String> currentAbbrevs = globalAbbrevs; String line; while((line = in.readLine()) != null) { int index = line.indexOf('|'); if(line.length() == 0) continue; else if(line.startsWith("[") && index == -1) { if(line.equals("[global]")) currentAbbrevs = globalAbbrevs; else { String mode = line.substring(1, line.length() - 1); currentAbbrevs = modes.get(mode); if(currentAbbrevs == null) { currentAbbrevs = new Hashtable<String,String>(); modes.put(mode,currentAbbrevs); } } } else if(index != -1) { currentAbbrevs.put(line.substring(0,index), line.substring(index + 1)); } } } finally { in.close(); } }
// in org/gjt/sp/jedit/Abbrevs.java
private static void saveAbbrevs(Writer _out) throws Exception { BufferedWriter out = new BufferedWriter(_out); String lineSep = System.getProperty("line.separator"); // write global abbrevs out.write("[global]"); out.write(lineSep); saveAbbrevs(out,globalAbbrevs); // write mode abbrevs Enumeration<String> keys = modes.keys(); Enumeration<Hashtable<String,String>> values = modes.elements(); while(keys.hasMoreElements()) { out.write('['); out.write(keys.nextElement()); out.write(']'); out.write(lineSep); saveAbbrevs(out,values.nextElement()); } out.close(); }
// in org/gjt/sp/jedit/Abbrevs.java
private static void saveAbbrevs(Writer out, Hashtable<String,String> abbrevs) throws Exception { String lineSep = System.getProperty("line.separator"); Enumeration<String> keys = abbrevs.keys(); Enumeration<String> values = abbrevs.elements(); while(keys.hasMoreElements()) { String abbrev = keys.nextElement(); out.write(abbrev); out.write('|'); out.write(values.nextElement()); out.write(lineSep); } }
// in org/gjt/sp/jedit/BeanShell.java
public static void _runScript(View view, String path, Reader in, boolean ownNamespace) throws Exception { _runScript(view,path,in,ownNamespace ? new NameSpace(bsh.getNameSpace(),"namespace") : bsh.getNameSpace()); }
// in org/gjt/sp/jedit/BeanShell.java
public static void _runScript(View view, String path, Reader in, NameSpace namespace) throws Exception { Log.log(Log.MESSAGE,BeanShell.class,"Running script " + path); Interpreter interp = BeanShellFacade.createInterpreter(namespace); try { if(in == null) { Buffer buffer = jEdit.openTemporary(null, null,path,false); if(!buffer.isLoaded()) VFSManager.waitForRequests(); in = new StringReader(buffer.getText(0, buffer.getLength())); } bsh.setupDefaultVariables(namespace,view); interp.set("scriptPath",path); running = true; interp.eval(in,namespace,path); } catch(Exception e) { BeanShellFacade.unwrapException(e); } finally { running = false; try { // no need to do this for macros! if(namespace == bsh.getNameSpace()) { bsh.resetDefaultVariables(namespace); interp.unset("scriptPath"); } } catch(EvalError e) { // do nothing } } }
// in org/gjt/sp/jedit/BeanShell.java
public static Object _eval(View view, NameSpace namespace, String command) throws Exception { return bsh._eval(view, namespace, command); }
// in org/gjt/sp/jedit/BeanShell.java
public static BshMethod cacheBlock(String id, String code, boolean namespace) throws Exception { return bsh.cacheBlock(id, code, namespace); }
// in org/gjt/sp/jedit/BeanShell.java
public static Object runCachedBlock(BshMethod method, View view, NameSpace namespace) throws Exception { return bsh.runCachedBlock(method, view, namespace); }
// in org/gjt/sp/jedit/textarea/TextAreaTransferHandler.java
private boolean importFile(JComponent c, Transferable t) throws Exception { Log.log(Log.DEBUG,this,"=> File list"); EditPane editPane = (EditPane) GUIUtilities.getComponentParent( c,EditPane.class); View view = editPane.getView(); Buffer buffer = null; // per the Java API, javaFileListFlavor guarantees that a // List<File> will be returned. So suppress warning for this // statement. We know what we're doing. @SuppressWarnings("unchecked") List<File> data = (List<File>) t.getTransferData(DataFlavor.javaFileListFlavor); boolean browsedDirectory = false; BufferSetManager bufferSetManager = jEdit.getBufferSetManager(); for (File file : data) { if (file.isDirectory()) { if (!browsedDirectory) { VFSBrowser.browseDirectory(view, file.getPath()); browsedDirectory = true; } continue; } Buffer _buffer = jEdit.openFile(editPane, file.getPath()); if (_buffer != null) { buffer = _buffer; bufferSetManager.addBuffer(editPane, buffer); } } if(buffer != null) editPane.setBuffer(buffer); view.toFront(); view.requestFocus(); editPane.requestFocus(); return true; }
// in org/gjt/sp/jedit/textarea/TextAreaTransferHandler.java
private boolean importURIList(JComponent c, Transferable t,DataFlavor uriListStringDataFlavor) throws Exception { String str = (String) t.getTransferData(uriListStringDataFlavor); Log.log(Log.DEBUG,this,"=> URIList \""+str+ '\"'); EditPane editPane = (EditPane) GUIUtilities.getComponentParent(c, EditPane.class); View view = editPane.getView(); JEditTextArea textArea = (JEditTextArea) c; if (dragSource == null) { boolean found = false; String[] components = str.split("\r\n"); boolean browsedDirectory = false; for (int i = 0;i<components.length;i++) { String str0 = components[i]; // gnome-commander adds a 0 byte at the end of the file name, discard it int len = str0.length(); if (len > 0 && (int)str0.charAt(len - 1) == 0) str0 = str0.substring(0, len - 1); if (str0.length() > 0) { URI uri = new URI(str0); // this handles the URI-decoding if ("file".equals(uri.getScheme())) { File file = new File(uri.getPath()); if (file.isDirectory()) { if (!browsedDirectory) { VFSBrowser.browseDirectory(view, file.getPath()); browsedDirectory = true; } } else { VFSManager.runInAWTThread(new DraggedURLLoader(textArea,uri.getPath())); } found = true; } else { Log.log(Log.DEBUG,this,"I do not know how to handle this URI "+uri+", ignoring."); } } else { // This should be the last component, because every URI in the list is terminated with a "\r\n", even the last one. if (i!=components.length-1) { Log.log(Log.DEBUG,this,"Odd: there is an empty line in the uri list which is not the last line."); } } } if (found) { return true; } } return true; }
// in org/gjt/sp/jedit/textarea/TextAreaTransferHandler.java
private boolean importText(JComponent c, Transferable t) throws Exception { String str = (String)t.getTransferData( DataFlavor.stringFlavor); str = str.trim(); Log.log(Log.DEBUG,this,"=> String \""+str+ '\"'); JEditTextArea textArea = (JEditTextArea)c; if (dragSource == null) { boolean found = false; String[] components = str.split("\n"); for (String str0 : components) { // Only examine the string for a URL if it came from // outside of jEdit. VFS vfs = VFSManager.getVFSForPath(str0); if (!(vfs instanceof FileVFS) || str.startsWith("file://")) { // str = str.replace('\n',' ').replace('\r',' ').trim(); if (str0.startsWith("file://")) { str0 = str0.substring(7); } VFSManager.runInWorkThread(new DraggedURLLoader(textArea, str0)); } found = true; } if (found) return true; } if(dragSource != null && textArea.getBuffer() == dragSource.getBuffer()) { compoundEdit = true; textArea.getBuffer().beginCompoundEdit(); } sameTextArea = textArea == dragSource; int caret = textArea.getCaretPosition(); Selection s = textArea.getSelectionAtOffset(caret); /* if user drops into the same selection where they started, do nothing. */ if(s != null) { if(sameTextArea) return false; /* if user drops into a selection, replace selection */ int startPos = s.start; textArea.setSelectedText(s,str); textArea.setSelection(new Selection.Range(startPos,startPos+str.length())); } /* otherwise just insert the text */ else { if (sameTextArea) { insertPos = caret; insertOffset = 0; Selection[] selections = textArea.getSelection(); for (Selection selection : selections) { if (selection.end < insertPos + insertOffset) insertOffset -= selection.end - selection.start; } } else { textArea.getBuffer().insert(caret,str); textArea.setSelection(new Selection.Range(caret,caret+str.length())); } } textArea.scrollToCaret(true); return true; }
// in org/gjt/sp/jedit/menu/EnhancedMenu.java
protected void finalize() throws Exception { if(ebStub != null) EditBus.removeFromBus(ebStub); }
// in org/gjt/sp/jedit/BeanShellAction.java
public BshMethod get() throws java.lang.Exception { if (cache != null) { BshMethod cached = cache.get(); if (cached != null) { return cached; } } BshMethod newOne = BeanShell.cacheBlock(name, source, true); cache = new SoftReference<BshMethod>(newOne); return newOne; }
(Lib) MalformedInputException 1
              
// in org/gjt/sp/jedit/io/EncodingWithBOM.java
public Reader getTextReader(InputStream in) throws IOException { byte[] actualMark = new byte[bom.length]; int count = in.read(actualMark); if (count < bom.length || !Arrays.equals(actualMark, bom)) { throw new MalformedInputException(0); } return plain.getTextReader(in); }
0 0
(Lib) NoSuchElementException 1
              
// in org/gjt/sp/jedit/JARClassLoader.java
public Object nextElement() { if(element != null) { Object retval = element; element = null; return retval; } else throw new NoSuchElementException(); }
0 0
(Lib) NoSuchFieldException 1
              
// in org/gjt/sp/jedit/bsh/Reflect.java
private static Field findAccessibleField( Class clas, String fieldName ) throws UtilEvalError, NoSuchFieldException { Field field; // Quick check catches public fields include those in interfaces try { field = clas.getField(fieldName); ReflectManager.RMSetAccessible( field ); return field; } catch ( NoSuchFieldException e ) { } // Now, on with the hunt... while ( clas != null ) { try { field = clas.getDeclaredField(fieldName); ReflectManager.RMSetAccessible( field ); return field; // Not found, fall through to next class } catch(NoSuchFieldException e) { } clas = clas.getSuperclass(); } throw new NoSuchFieldException( fieldName ); }
0 1
              
// in org/gjt/sp/jedit/bsh/Reflect.java
private static Field findAccessibleField( Class clas, String fieldName ) throws UtilEvalError, NoSuchFieldException { Field field; // Quick check catches public fields include those in interfaces try { field = clas.getField(fieldName); ReflectManager.RMSetAccessible( field ); return field; } catch ( NoSuchFieldException e ) { } // Now, on with the hunt... while ( clas != null ) { try { field = clas.getDeclaredField(fieldName); ReflectManager.RMSetAccessible( field ); return field; // Not found, fall through to next class } catch(NoSuchFieldException e) { } clas = clas.getSuperclass(); } throw new NoSuchFieldException( fieldName ); }
(Lib) UnsupportedOperationException 1
              
// in org/gjt/sp/jedit/JARClassLoader.java
public String getResourceAsPath(String name) { // this must be fixed during plugin development if(jar == null) throw new UnsupportedOperationException( "don't call getResourceAsPath() on anonymous JARClassLoader"); if(!name.startsWith("/")) name = '/' + name; return "jeditresource:/" + MiscUtilities.getFileName( jar.getPath()) + '!' + name; }
0 0
Explicit thrown (throw new...): 494/673
Explicit thrown ratio: 73.4%
Builder thrown ratio: 8.8%
Variable thrown ratio: 17.8%
Checked Runtime Total
Domain 203 92 295
Lib 12 107 119
Total 215 199

Caught Exceptions Summary

A (Domain) exception is defined in the application. A (Lib) exception is defined in the JDK or in a library. An exception can be caught, and it happens that the catch block contains a throw (e.g. for wrapping a low-level exception). Hovering over a number triggers showing code snippets from the application code.

Type Exception Caught
(directly)
Caught
with Thrown
(Lib) Exception 147
            
// in org/gjt/sp/jedit/print/BufferPrintable.java
catch(Exception e) { Log.log(Log.ERROR,this,e); final String[] args = { e.toString() }; SwingUtilities.invokeLater(new Runnable() { public void run() { GUIUtilities.error(view,"print-error",args); } }); }
// in org/gjt/sp/jedit/print/BufferPrinter1_4.java
catch(Exception e) { Log.log(Log.ERROR,BufferPrinter1_4.class,e); }
// in org/gjt/sp/jedit/print/BufferPrinter1_4.java
catch(Exception e) { e.printStackTrace(); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(Exception e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(Exception e) { Log.log(Log.ERROR,this,e); return null; }
// in org/gjt/sp/jedit/pluginmgr/InstallPanel.java
catch (Exception e) { Log.log(Log.WARNING, this, "Loading Pluginset failed:" + e.getMessage()); return false; }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
catch (Exception e) { Log.log(Log.WARNING, this, "Exception thrown loading: " + jarName, e); }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
catch (Exception e) { Log.log(Log.ERROR, this, "Loading Pluginset Error", e); return false; }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
catch (Exception e) { Log.log(Log.ERROR, this, "Saving State Error", e); }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
catch (Exception ex) { Log.log(Log.ERROR, this, "ManagePanel HelpButton Update", ex); }
// in org/gjt/sp/jedit/pluginmgr/PluginListHandler.java
catch (Exception e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/pluginmgr/MirrorListHandler.java
catch (Exception e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/pluginmgr/PluginManagerProgress.java
catch(Exception e) { }
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch (Exception e) { Log.log(Log.MESSAGE, this, "No cached copy. Downloading from mirror. "); downloadIt = true; }
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch (Exception e) { Log.log(Log.ERROR, this, "readpluginlist: error", e); if (cachedURL.startsWith("file:///")) { Log.log(Log.DEBUG, this, "Unable to read plugin list, deleting cached file and try again"); new File(cachedURL.substring(8)).delete(); if (allowRetry) { plugins.clear(); pluginHash.clear(); pluginSets.clear(); readPluginList(false); } } }
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch (Exception e) { Log.log (Log.ERROR, this, "CacheRemotePluginList: error", e); }
// in org/gjt/sp/jedit/gui/FontSelectorDialog.java
catch(Exception e) { size = 12; }
// in org/gjt/sp/jedit/gui/FontSelectorDialog.java
catch(Exception e) { Log.log(Log.ERROR,this,"Broken Java implementation!"); /* Log.log(Log.ERROR,this,"Using deprecated Toolkit.getFontList()"); */ Log.log(Log.ERROR,this,e); /* fonts = getToolkit().getFontList(); */ fonts = new String[] { "Broken Java implementation!" }; }
// in org/gjt/sp/jedit/gui/FontSelectorDialog.java
catch(Exception e) { size = 12; }
// in org/gjt/sp/jedit/gui/TipOfTheDay.java
catch(Exception e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/gui/AboutDialog.java
catch(Exception exc) { tell("AboutPanel: " + exc); }
// in org/gjt/sp/jedit/gui/AboutDialog.java
catch(Exception exc) { Log.log(Log.ERROR, this, exc); }
// in org/gjt/sp/jedit/gui/KeyEventTranslator.java
catch(Exception e) { Log.log(Log.ERROR,KeyEventTranslator.class, "Invalid key code: " + code); return KeyEvent.VK_UNDEFINED; }
// in org/gjt/sp/jedit/gui/DockableWindowManagerImpl.java
catch (Exception e) {}
// in org/gjt/sp/jedit/gui/SplashScreen.java
catch(Exception e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/gui/GrabKeyDialog.java
catch(Exception e) { Log.log(Log.ERROR,GrabKeyDialog.class,e); }
// in org/gjt/sp/jedit/gui/DockableWindowFactory.java
catch (Exception e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/ActionListHandler.java
catch (Exception e) { Log.log(Log.ERROR,this, e); }
// in org/gjt/sp/jedit/help/HelpSearchPanel.java
catch(Exception e) { index = null; Log.log(Log.ERROR,this,e); GUIUtilities.error(helpViewer.getComponent(),"helpviewer.search.error", new String[] { e.toString() }); }
// in org/gjt/sp/jedit/bsh/This.java
catch ( Exception e ) { throw new InterpreterError("internal error 1 in This: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(Exception e) { throw new ReflectError("Array access:" + e); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(Exception e) { throw new ReflectError("Array access:" + e); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( Exception e ) { e1 = e; }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( Exception e ) { e2 = e; }
// in org/gjt/sp/jedit/bsh/BSHType.java
catch(Exception e) { throw new EvalError("Couldn't construct array type", this, callstack ); }
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( Exception e ) { {if (true) throw createParseException("Error parsing character: "+x.image);} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( Exception e ) { {if (true) throw createParseException("Error parsing string: "+x.image);} }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( Exception e ) { if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); throw new EvalError( "Error constructing inner class instance: "+e, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch( Exception e ) { throw new EvalError("Can't construct primitive array: " + e.getMessage(), this, callstack); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "unable to get instance initializer: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "unable to get instance initializer: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Error in class initialization: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { if ( e instanceof TargetError ) e =(Exception)((TargetError)e).getTarget(); if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); e.printStackTrace( System.err ); throw new InterpreterError("Error in class initialization: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Unable to get class static space: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "Generated class: Error getting This"+e ); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( Exception e ) { // used to squeltch this... changed for 1.3 // see BshClassManager }
// in org/gjt/sp/jedit/bsh/BSHArrayDimensions.java
catch(Exception e) { throw new EvalError( "Array index: " + i + " does not evaluate to an integer", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( Exception e ) { throw new InterpreterError("Error loading classmanager: "+e); }
// in org/gjt/sp/jedit/bsh/Remote.java
catch ( Exception e ) { // this convention may change... return 0; }
// in org/gjt/sp/jedit/bsh/Remote.java
catch ( Exception ex ) { System.err.println("Bad URL: "+orgURL+": "+ex ); return returnValue; }
// in org/gjt/sp/jedit/bsh/Remote.java
catch(Exception ex) { System.err.println("Error communicating with server: "+ex); return returnValue; }
// in org/gjt/sp/jedit/bsh/ClassGenerator.java
catch ( Exception e ) { throw new Unavailable("ClassGenerator unavailable: "+e); }
// in org/gjt/sp/jedit/bsh/ReflectManager.java
catch ( Exception e ) { throw new Unavailable("Reflect Manager unavailable: "+e); }
// in org/gjt/sp/jedit/bsh/CollectionManager.java
catch ( Exception e ) { Interpreter.debug("unable to load CollectionManagerImpl: "+e); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(Exception e) { throw new UtilEvalError("Array access: " + e); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch ( Exception e ) { throw new UtilEvalError("Assignment: " + e.getMessage()); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e ) { Object o = e; if ( e instanceof InvocationTargetException ) o = ((InvocationTargetException)e) .getTargetException(); System.err.println( "Class: "+result+" main method threw exception:"+o); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(Exception e) { error("Unknown error: " + e); if ( DEBUG ) e.printStackTrace(); if(!interactive) eof = true; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e) { if ( DEBUG) e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" unknown error: " + e.getMessage(), node, callstack); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e ) { // squeltch security exception, filenotfoundexception if ( Interpreter.DEBUG ) debug("Could not find rc file: "+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e ) { System.err.println("Could not init static(2):"+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e ) { return "bsh % "; }
// in org/gjt/sp/jedit/EditServer.java
catch(Exception e) { if(!abort) Log.log(Log.ERROR,this,e); abort = true; }
// in org/gjt/sp/jedit/Registers.java
catch(Exception e) { Log.log(Log.NOTICE,this,e); return null; }
// in org/gjt/sp/jedit/AbstractOptionPane.java
catch (Exception e) { /* There probably wasn't a tooltip, * or it wasn't a JComponent. We don't care. */ }
// in org/gjt/sp/jedit/BeanShellFacade.java
catch(Exception e) { unwrapException(e); // never called return null; }
// in org/gjt/sp/jedit/BeanShellFacade.java
catch(Exception e) { unwrapException(e); // never called return null; }
// in org/gjt/sp/jedit/Mode.java
catch(Exception e) { Log.log(Log.ERROR,this,"Bad indent rule " + prop + '=' + value + ':'); Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/Mode.java
catch(Exception e) { Log.log(Log.ERROR,this,"Bad indent rule " + prop + '=' + value + ':'); Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/GUIUtilities.java
catch(Exception e) { try { url = new URL(defaultIconPath + iconName); } catch(Exception ex) { Log.log(Log.ERROR,GUIUtilities.class, "Icon not found: " + iconName); Log.log(Log.ERROR,GUIUtilities.class,ex); return null; } }
// in org/gjt/sp/jedit/GUIUtilities.java
catch(Exception ex) { Log.log(Log.ERROR,GUIUtilities.class, "Icon not found: " + iconName); Log.log(Log.ERROR,GUIUtilities.class,ex); return null; }
// in org/gjt/sp/jedit/GUIUtilities.java
catch (Exception e) { // ignored }
// in org/gjt/sp/jedit/GUIUtilities.java
catch (Exception e) { // ignored }
// in org/gjt/sp/jedit/GUIUtilities.java
catch (Exception e) { return null; }
// in org/gjt/sp/jedit/GUIUtilities.java
catch (Exception e) { return null; }
// in org/gjt/sp/jedit/GUIUtilities.java
catch (Exception e) { return JOptionPane.CANCEL_OPTION; }
// in org/gjt/sp/jedit/GUIUtilities.java
catch (Exception e) { return 0; }
// in org/gjt/sp/jedit/GUIUtilities.java
catch (Exception e) { return JOptionPane.CANCEL_OPTION; }
// in org/gjt/sp/jedit/GUIUtilities.java
catch (Exception e) { return JOptionPane.CANCEL_OPTION; }
// in org/gjt/sp/jedit/GUIUtilities.java
catch(Exception e) { /* Workaround for OS X bug. */ Log.log(Log.ERROR,GUIUtilities.class,e); }
// in org/gjt/sp/jedit/GUIUtilities.java
catch(Exception e) { // This is probably an error, but it will be logged in // KeyEventTranslator.parseKey anyway, so just ignore it here. text = key.toUpperCase(); }
// in org/gjt/sp/jedit/search/SearchBar.java
catch(Exception e) { Log.log(Log.DEBUG,this,e); // invalid regexp, ignore // return true to avoid annoying beeping while // typing a re ret = true; }
// in org/gjt/sp/jedit/search/AllBufferSet.java
catch(Exception e) { Log.log(Log.ERROR,this,e); return null; }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
catch(Exception e) { results.searchFailed(); handleError(comp,e); return false; }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
catch(Exception e) { handleError(comp,e); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
catch(Exception e) { handleError(comp,e); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
catch(Exception e) { handleError(comp,e); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
catch(Exception e) { handleError(comp,e); }
// in org/gjt/sp/jedit/search/HyperSearchResults.java
catch (Exception e) { style = "color:#000000"; s = SyntaxUtilities.parseStyle(style, f.getFamily(), f.getSize(), true); }
// in org/gjt/sp/jedit/search/HyperSearchResults.java
catch (Exception ex) { operNodeObj.restoreFlatNodes(resultTree, operNode); menuItem.setSelected(false); excp = ex; }
// in org/gjt/sp/jedit/search/HyperSearchRequest.java
catch(final Exception e) { Log.log(Log.ERROR,this,e); ThreadUtilities.runInDispatchThread(new Runnable() { public void run() { SearchAndReplace.handleError(view,e); } }); }
// in org/gjt/sp/jedit/search/DirectoryListSet.java
catch(Exception e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { // ok, this one seems to confuse newbies // endlessly, so log it as NOTICE, not // ERROR Log.log(Log.NOTICE,jEdit.class,"An error occurred" + " while connecting to the jEdit server instance."); Log.log(Log.NOTICE,jEdit.class,"This probably means that" + " jEdit crashed and/or exited abnormally"); Log.log(Log.NOTICE,jEdit.class,"the last time it was run."); Log.log(Log.NOTICE,jEdit.class,"If you don't" + " know what this means, don't worry."); Log.log(Log.NOTICE,jEdit.class,e); }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { e.printStackTrace(); stream = null; }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { Log.log(Log.ERROR,jEdit.class, "Error while loading system properties!"); Log.log(Log.ERROR,jEdit.class, "One of the following property files could not be loaded:\n" + "- jedit.props\n" + "- jedit_gui.props\n" + "- jedit_en.props\n" + "jedit.jar is probably corrupt."); Log.log(Log.ERROR,jEdit.class,e); System.exit(1); }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { Log.log(Log.ERROR,jEdit.class,e); }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { Log.log(Log.ERROR,jEdit.class,e); }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { Log.log(Log.ERROR, jEdit.class, "Window " + iWindow + ": " + window, e); break; }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { Log.log(Log.ERROR,jEdit.class,e); }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { return; }
// in org/gjt/sp/jedit/Abbrevs.java
catch(Exception e) { Log.log(Log.ERROR,Abbrevs.class,"Error while saving " + file1); Log.log(Log.ERROR,Abbrevs.class,e); }
// in org/gjt/sp/jedit/Abbrevs.java
catch(Exception e) { Log.log(Log.ERROR,Abbrevs.class,"Error while loading " + file); Log.log(Log.ERROR,Abbrevs.class,e); }
// in org/gjt/sp/jedit/Abbrevs.java
catch(Exception e) { Log.log(Log.ERROR,Abbrevs.class,"Error while loading default.abbrevs"); Log.log(Log.ERROR,Abbrevs.class,e); }
// in org/gjt/sp/jedit/BufferHistory.java
catch(Exception e) { Log.log(Log.ERROR,BufferHistory.class,e); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Exception e) { return defaultValue; }
// in org/gjt/sp/jedit/options/IntegerInputVerifier.java
catch (Exception e) { return false; }
// in org/gjt/sp/jedit/options/PluginManagerOptionPane.java
catch (final Exception ex) { if (download) { Log.log(Log.ERROR,this,ex); ThreadUtilities.runInDispatchThread(new Runnable() { public void run() { GUIUtilities.error(PluginManagerOptionPane.this, "ioerror",new String[] { ex.toString() }); } }); }
// in org/gjt/sp/jedit/bufferio/BufferIORequest.java
catch(Exception e) { // Ignore. }
// in org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); // Incomplete autosave file should not exist. if(out != null) { try { out.close(); out = null; vfs._delete(session,path,view); } catch(IOException ioe) { Log.log(Log.ERROR,this,ioe); } } }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(Exception e) { // ignore }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); Object[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/BeanShell.java
catch(Exception e) { BeanShellFacade.unwrapException(e); }
// in org/gjt/sp/jedit/JEditKillRing.java
catch(Exception e) { Log.log(Log.ERROR,KillRing.class,e); }
// in org/gjt/sp/jedit/JEditKillRing.java
catch (Exception e) { Log.log(Log.ERROR, this, "Failed to get character from PI" + "\"" + target + "\"" + " with \"" + data + "\"" + ": " + e); return; }
// in org/gjt/sp/jedit/JEditRegisterSaver.java
catch(Exception e) { Log.log(Log.ERROR,Registers.class,e); }
// in org/gjt/sp/jedit/textarea/TextAreaTransferHandler.java
catch(Exception e) { Log.log(Log.ERROR,this,e); returnValue = false; }
// in org/gjt/sp/jedit/textarea/TextAreaTransferHandler.java
catch(Exception e) { Log.log(Log.DEBUG,this,"exportDone in sameTextArea"); Log.log(Log.DEBUG,this,e); }
// in org/gjt/sp/jedit/textarea/ExtensionManager.java
catch(Exception e) { Log.log(Log.ERROR,this,"Error repainting line" + " range {" + firstLine + ',' + lastLine + "}:"); Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/textarea/JEditTextArea.java
catch(Exception e) { getToolkit().beep(); }
// in org/gjt/sp/jedit/syntax/Token.java
catch(Exception e) { return -1; }
// in org/gjt/sp/jedit/PluginJAR.java
catch(Exception e) { String[] args = { pluginDepends.arg }; jEdit.pluginError(path, "plugin-error.dep-class",args); ok = false; }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { Log.log(Log.ERROR, Macros.class, e); return; }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { // ignored }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { // ignored }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { return null; }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { return JOptionPane.CANCEL_OPTION; }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { return JOptionPane.CANCEL_OPTION; }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { Log.log(Log.ERROR, Macros.class, e); macroHandlers.remove(handler); }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { throw new InternalError("Missing or invalid glob for handler " + name); }
// in org/gjt/sp/jedit/ServiceListHandler.java
catch (Exception e) { Log.log(Log.ERROR, e, e); }
// in org/gjt/sp/util/Log.java
catch(Exception e) { // do nothing, who cares }
// in org/gjt/sp/util/Log.java
catch(Exception e) { e.printStackTrace(realErr); }
// in org/gjt/sp/util/PropertiesBean.java
catch (Exception e) { // These exceptions shouldn't occur during normal runtime, // so we catch them and print an error message. Users of this // class should fix these before releasing the code. Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/util/PropertiesBean.java
catch (Exception e) { // These exceptions shouldn't occur during normal runtime, // so we catch them and print an error message. Users of this // class should fix these before releasing the code. Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/util/PropertiesBean.java
catch (Exception e) { // These exceptions shouldn't occur during normal runtime, // so we catch them and print an error message. Users of this // class should fix these before releasing the code. Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/util/WorkThreadPool.java
catch(Exception e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/util/SyntaxUtilities.java
catch(Exception e) { Log.log(Log.ERROR,StandardUtilities.class,e); }
// in org/gjt/sp/util/HtmlUtilities.java
catch (Exception e) { style = "color:#000000"; s = SyntaxUtilities.parseStyle(style, f.getFamily(), f.getSize(), true); }
// in org/gjt/sp/util/XMLUtilities.java
catch (Exception e) { Log.log(Log.ERROR,XMLUtilities.class, "Error while opening " + test + ':'); Log.log(Log.ERROR,XMLUtilities.class,e); }
24
            
// in org/gjt/sp/jedit/bsh/This.java
catch ( Exception e ) { throw new InterpreterError("internal error 1 in This: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(Exception e) { throw new ReflectError("Array access:" + e); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(Exception e) { throw new ReflectError("Array access:" + e); }
// in org/gjt/sp/jedit/bsh/BSHType.java
catch(Exception e) { throw new EvalError("Couldn't construct array type", this, callstack ); }
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( Exception e ) { {if (true) throw createParseException("Error parsing character: "+x.image);} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( Exception e ) { {if (true) throw createParseException("Error parsing string: "+x.image);} }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( Exception e ) { if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); throw new EvalError( "Error constructing inner class instance: "+e, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch( Exception e ) { throw new EvalError("Can't construct primitive array: " + e.getMessage(), this, callstack); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "unable to get instance initializer: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "unable to get instance initializer: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Error in class initialization: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { if ( e instanceof TargetError ) e =(Exception)((TargetError)e).getTarget(); if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); e.printStackTrace( System.err ); throw new InterpreterError("Error in class initialization: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Unable to get class static space: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "Generated class: Error getting This"+e ); }
// in org/gjt/sp/jedit/bsh/BSHArrayDimensions.java
catch(Exception e) { throw new EvalError( "Array index: " + i + " does not evaluate to an integer", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( Exception e ) { throw new InterpreterError("Error loading classmanager: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGenerator.java
catch ( Exception e ) { throw new Unavailable("ClassGenerator unavailable: "+e); }
// in org/gjt/sp/jedit/bsh/ReflectManager.java
catch ( Exception e ) { throw new Unavailable("Reflect Manager unavailable: "+e); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(Exception e) { throw new UtilEvalError("Array access: " + e); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch ( Exception e ) { throw new UtilEvalError("Assignment: " + e.getMessage()); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e) { if ( DEBUG) e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" unknown error: " + e.getMessage(), node, callstack); }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { throw new InternalError("Missing or invalid glob for handler " + name); }
(Lib) IOException 141
            
// in org/jedit/keymap/KeymapManagerImpl.java
catch (IOException e) { Log.log(Log.ERROR, this, e); }
// in org/jedit/keymap/KeymapImpl.java
catch (IOException e) { Log.log(Log.ERROR, this, "Unable to load properties", e); }
// in org/jedit/keymap/KeymapImpl.java
catch (IOException e) { Log.log(Log.ERROR, this, "Unable to save properties", e); }
// in org/gjt/sp/jedit/View.java
catch(IOException e) { // this should never throw an exception. throw new InternalError(); }
// in org/gjt/sp/jedit/View.java
catch(IOException io) { //Log.log(Log.ERROR,this,io); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(IOException io) { Log.log(Log.ERROR,this,io); String[] args = { io.getMessage() }; GUIUtilities.error(null,"ioerror",args); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(IOException io) { Log.log(Log.ERROR,this,io); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(final IOException io) { Log.log(Log.ERROR,this,io); SwingUtilities.invokeLater(new Runnable() { public void run() { String[] args = { io.getMessage() }; GUIUtilities.error(null,"plugin-error-download",args); } }); return null; }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
catch (IOException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
catch (IOException e1) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/gui/PingPongList.java
catch (IOException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/gui/statusbar/LastModifiedWidgetFactory.java
catch (IOException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/gui/statusbar/LastModifiedWidgetFactory.java
catch (IOException e) { }
// in org/gjt/sp/jedit/gui/DockableWindowManagerImpl.java
catch (IOException e) { Log.log(Log.ERROR, this, e, e); return false; }
// in org/gjt/sp/jedit/gui/DockableWindowManagerImpl.java
catch (IOException e) { return false; }
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
catch(IOException io) { Log.log(Log.ERROR,HistoryModel.class,io); }
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
catch(IOException io) { Log.log(Log.ERROR,HistoryModel.class,io); }
// in org/gjt/sp/jedit/gui/DockableWindowFactory.java
catch(IOException e) { Log.log(Log.ERROR,DockableWindowManager.class,e); }
// in org/gjt/sp/jedit/ServiceManager.java
catch (IOException ioe) { Log.log(Log.ERROR, ServiceManager.class, ioe); }
// in org/gjt/sp/jedit/help/HelpTOCPanel.java
catch(IOException e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/help/HelpViewer.java
catch(IOException io) { Log.log(Log.ERROR,this,io); String[] args = { _url.toString(), io.toString() }; GUIUtilities.error(HelpViewer.this,"read-error",args); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( IOException e ) { }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch(java.io.IOException e) { if (bufpos != 0) { --bufpos; backup(0); } else { bufline[bufpos] = line; bufcolumn[bufpos] = column; } throw e; }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch(java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch(java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch ( IOException e ) { String s = "Error constructing classpath: " +urls[i]+": "+e; errorWhileMapping( s ); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch ( IOException e ) { throw new ClassPathException("can't parse class path: "+e); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch(IOException ie ) { throw new RuntimeException("Couldn't load file: "+file); }
// in org/gjt/sp/jedit/bsh/Remote.java
catch (IOException e2) { System.out.println(e2); // I/O error }
// in org/gjt/sp/jedit/bsh/commands/dir.java
catch (IOException e ) { env.println("error reading path: "+e); return; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( IOException e ) { System.out.println("I/O Error: "+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( IOException e ) { System.err.println("Can't redirect output to file: "+filename ); }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { return pos + 1; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(0, active0, active1, active2); return 1; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(1, active0, active1, active2); return 2; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(2, active0, active1, active2); return 3; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(3, active0, active1, active2); return 4; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(4, active0, active1, active2); return 5; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(5, active0, active1, active2); return 6; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(6, active0, active1, active2); return 7; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(7, active0, active1, active2); return 8; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(8, active0, active1, active2); return 9; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(9, active0, active1, active2); return 10; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(10, active0, active1, active2); return 11; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(11, 0L, active1, active2); return 12; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(12, 0L, active1, active2); return 13; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(13, 0L, active1, active2); return 14; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(14, 0L, active1, active2); return 15; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(15, 0L, active1, active2); return 16; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(16, 0L, active1, active2); return 17; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(17, 0L, active1, active2); return 18; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(18, 0L, active1, active2); return 19; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(19, 0L, active1, active2); return 20; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(20, 0L, 0L, active2); return 21; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(21, 0L, 0L, active2); return 22; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(22, 0L, 0L, active2); return 23; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(23, 0L, 0L, active2); return 24; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(24, 0L, 0L, active2); return 25; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(25, 0L, 0L, active2); return 26; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(26, 0L, 0L, active2); return 27; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { return curPos; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjmatchedKind = 0; matchedToken = jjFillToken(); matchedToken.specialToken = specialToken; return matchedToken; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch (java.io.IOException e1) { EOFSeen = true; error_after = curPos <= 1 ? "" : input_stream.GetImage(); if (curChar == '\n' || curChar == '\r') { error_line++; error_column = 0; } else error_column++; }
// in org/gjt/sp/jedit/EditServer.java
catch(IOException io) { /* on some Windows versions, connections to localhost * fail if the network is not running. To avoid * confusing newbies with weird error messages, log * errors that occur while starting the server * as NOTICE, not ERROR */ Log.log(Log.NOTICE,this,io); }
// in org/gjt/sp/jedit/EditServer.java
catch(IOException io) { }
// in org/gjt/sp/jedit/Registers.java
catch (IOException e) { Log.log(Log.ERROR, Registers.class, e); }
// in org/gjt/sp/jedit/Registers.java
catch (IOException e) { Log.log(Log.ERROR, Registers.class, e); }
// in org/gjt/sp/jedit/Registers.java
catch (IOException e) { Log.log(Log.ERROR, Registers.class, e); }
// in org/gjt/sp/jedit/Registers.java
catch (IOException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/io/VFSFile.java
catch(IOException e) { VFSManager.error(e,path,browser); }
// in org/gjt/sp/jedit/io/VFSFile.java
catch(IOException e) { VFSManager.error(e,path,browser); }
// in org/gjt/sp/jedit/io/CopyFileWorker.java
catch (IOException e) { Log.log(Log.ERROR, this, e, e); }
// in org/gjt/sp/jedit/io/CopyFileWorker.java
catch (IOException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/io/CopyFileWorker.java
catch (IOException e) { }
// in org/gjt/sp/jedit/io/LocalFileSaveTask.java
catch (IOException e) { Log.log(Log.ERROR, this, e, e); }
// in org/gjt/sp/jedit/io/FileVFS.java
catch(IOException io) { canonPath = path; }
// in org/gjt/sp/jedit/io/FileVFS.java
catch(IOException io) { toCanonPath = to; }
// in org/gjt/sp/jedit/io/FileVFS.java
catch(IOException io) { fromCanonPath = from; }
// in org/gjt/sp/jedit/io/FileVFS.java
catch(IOException io) { canonPath = directory; }
// in org/gjt/sp/jedit/io/FileVFS.java
catch(IOException io) { if(ignoreErrors) return null; else throw io; }
// in org/gjt/sp/jedit/io/VFS.java
catch(IOException e) { Log.log(Log.ERROR,this,e); // may be not binary... }
// in org/gjt/sp/jedit/search/DirectoryListSet.java
catch(IOException io) { VFSManager.error(comp,directory,"ioerror",new String[] { io.toString() }); return null; }
// in org/gjt/sp/jedit/jEdit.java
catch(IOException io) { Log.log(Log.ERROR,jEdit.class,io); }
// in org/gjt/sp/jedit/jEdit.java
catch(IOException io) { Log.log(Log.ERROR,jEdit.class,io); }
// in org/gjt/sp/jedit/jEdit.java
catch(IOException e) { Log.log(Log.ERROR,jEdit.class,"Cannot load site snippet " + snippet); Log.log(Log.ERROR,jEdit.class,e); }
// in org/gjt/sp/jedit/jEdit.java
catch (IOException e) { if (getBooleanProperty("lang.usedefaultlocale")) { // if it is the default locale, it is not an error Log.log(Log.ERROR, jEdit.class, "Unable to load language", e); } }
// in org/gjt/sp/jedit/jEdit.java
catch(IOException e) { Log.log(Log.ERROR,jEdit.class,e); }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,newPath,"ioerror", new String[] { io.toString() }); setPerformingIO(false); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,newPath,"ioerror", new String[] { io.toString() }); setPerformingIO(false); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { //Log.log(Log.ERROR,this,io); }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; }
// in org/gjt/sp/jedit/BufferHistory.java
catch(IOException e) { Log.log(Log.ERROR,BufferHistory.class,e); }
// in org/gjt/sp/jedit/options/AppearanceOptionPane.java
catch(IOException io) { Log.log(Log.ERROR,this,io); }
// in org/gjt/sp/jedit/options/PluginManagerOptionPane.java
catch (IOException e) { Log.log(Log.ERROR,this, "Unable to write cached mirror list : " + mirrorList); }
// in org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); // Incomplete autosave file should not exist. if(out != null) { try { out.close(); out = null; vfs._delete(session,path,view); } catch(IOException ioe) { Log.log(Log.ERROR,this,ioe); } } }
// in org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
catch(IOException ioe) { Log.log(Log.ERROR,this,ioe); }
// in org/gjt/sp/jedit/bufferio/MarkersSaveRequest.java
catch(IOException io) { Log.log(Log.ERROR,this,io); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(IOException e) { Log.log(Log.NOTICE, this , path + ": Reopening to rewind the stream"); // Reopen the stream because the mark has been // invalidated while previous reading. markedStream.close(); InputStream in = getNakedStream(); try { if(gzipped) { in = new GZIPInputStream(in); } BufferedInputStream result = AutoDetection.getMarkedStream(in); in = null; return result; } finally { IOUtilities.closeQuietly(in); } }
// in org/gjt/sp/jedit/PerspectiveManager.java
catch(IOException e) { Log.log(Log.ERROR,PerspectiveManager.class,e); }
// in org/gjt/sp/jedit/PerspectiveManager.java
catch(IOException io) { Log.log(Log.ERROR,PerspectiveManager.class,"Error saving " + perspectiveXML); Log.log(Log.ERROR,PerspectiveManager.class,io); }
// in org/gjt/sp/jedit/JEditKillRing.java
catch (IOException ioe) { Log.log(Log.ERROR, this, ioe); }
// in org/gjt/sp/jedit/EditPlugin.java
catch (IOException e) { return null; }
// in org/gjt/sp/jedit/EditPlugin.java
catch (IOException e) { return null; }
// in org/gjt/sp/jedit/JEditRegisterSaver.java
catch (IOException ioe) { Log.log(Log.ERROR, Registers.class, ioe); }
// in org/gjt/sp/jedit/JARClassLoader.java
catch(IOException io) { Log.log(Log.ERROR,this,io); return null; }
// in org/gjt/sp/jedit/JARClassLoader.java
catch(IOException io) { Log.log(Log.ERROR,this,io); return null; }
// in org/gjt/sp/jedit/JARClassLoader.java
catch(IOException io) { Log.log(Log.ERROR,this,io); throw new ClassNotFoundException(clazz); }
// in org/gjt/sp/jedit/textarea/StandaloneTextArea.java
catch (IOException e) { Log.log(Log.ERROR, TextArea.class, e); }
// in org/gjt/sp/jedit/MiscUtilities.java
catch(IOException io) { return path; }
// in org/gjt/sp/jedit/SplitConfigParser.java
catch (IOException e) { // StringReader will not throw an IOException as long as the // string it is reading is not null, which won't happen here. }
// in org/gjt/sp/jedit/browser/DeleteBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/DeleteBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/BrowserView.java
catch (IOException e) { Log.log(Log.ERROR, this, e, e); }
// in org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); String[] pp = { io.toString() }; VFSManager.error(browser, path,"ioerror.directory-error",pp); }
// in org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); String[] pp = { io.toString() }; VFSManager.error(browser, path,"ioerror.directory-error",pp); }
// in org/gjt/sp/jedit/browser/VFSFileChooserDialog.java
catch(IOException e) { VFSManager.error(e,path,browser); }
// in org/gjt/sp/jedit/browser/VFSFileChooserDialog.java
catch(IOException e) { VFSManager.error(e,path,browser); }
// in org/gjt/sp/jedit/browser/RenameBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/RenameBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/MkDirBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); args[0] = io.toString(); VFSManager.error(browser, path,"ioerror",args); }
// in org/gjt/sp/jedit/browser/MkDirBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); args[0] = io.toString(); VFSManager.error(browser, path,"ioerror",args); }
// in org/gjt/sp/jedit/PluginJAR.java
catch (IOException ioe) { throw new RuntimeException(ioe); }
// in org/gjt/sp/jedit/PluginJAR.java
catch(IOException io) { Log.log(Log.ERROR,PluginJAR.class,io); return null; }
// in org/gjt/sp/jedit/PluginJAR.java
catch(IOException io) { Log.log(Log.ERROR,PluginJAR.class,io); IOUtilities.closeQuietly(dout); new File(jarCachePath).delete(); }
// in org/gjt/sp/jedit/PluginJAR.java
catch(IOException io) { Log.log(Log.ERROR,this,"Cannot load" + " plugin " + path); Log.log(Log.ERROR,this,io); String[] args = { io.toString() }; jEdit.pluginError(path,"plugin-error.load-error",args); uninit(false); }
// in org/gjt/sp/jedit/PluginJAR.java
catch(IOException io) { Log.log(Log.ERROR,this,io); }
// in org/gjt/sp/jedit/JEditActionSet.java
catch(IOException e) { Log.log(Log.ERROR,this,uri,e); }
// in org/gjt/sp/util/Log.java
catch(IOException io) { io.printStackTrace(realErr); }
// in org/gjt/sp/util/Log.java
catch(IOException io) { io.printStackTrace(realErr); }
// in org/gjt/sp/util/Log.java
catch (IOException ioe) { // don't do anything? }
// in org/gjt/sp/util/IOUtilities.java
catch (IOException ioe) { Log.log(Log.WARNING, IOUtilities.class, "Error moving file: " + ioe + " : " + ioe.getMessage()); }
// in org/gjt/sp/util/IOUtilities.java
catch (IOException e) { //ignore }
// in org/gjt/sp/util/IOUtilities.java
catch (IOException e) { // ignore }
// in org/gjt/sp/util/IOUtilities.java
catch (IOException e) { //ignore }
// in org/gjt/sp/util/IOUtilities.java
catch (IOException e) { //ignore }
// in org/gjt/sp/util/IOUtilities.java
catch (IOException e) { // ignore }
// in org/gjt/sp/util/IOUtilities.java
catch (IOException e) { //ignore }
// in org/gjt/sp/util/IOUtilities.java
catch (IOException e) { // ignore }
// in org/gjt/sp/util/IOUtilities.java
catch (IOException e) { //ignore }
8
            
// in org/gjt/sp/jedit/View.java
catch(IOException e) { // this should never throw an exception. throw new InternalError(); }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch(java.io.IOException e) { if (bufpos != 0) { --bufpos; backup(0); } else { bufline[bufpos] = line; bufcolumn[bufpos] = column; } throw e; }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch(java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch ( IOException e ) { throw new ClassPathException("can't parse class path: "+e); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch(IOException ie ) { throw new RuntimeException("Couldn't load file: "+file); }
// in org/gjt/sp/jedit/io/FileVFS.java
catch(IOException io) { if(ignoreErrors) return null; else throw io; }
// in org/gjt/sp/jedit/JARClassLoader.java
catch(IOException io) { Log.log(Log.ERROR,this,io); throw new ClassNotFoundException(clazz); }
// in org/gjt/sp/jedit/PluginJAR.java
catch (IOException ioe) { throw new RuntimeException(ioe); }
(Lib) Throwable 79
            
// in org/jedit/options/OptionGroupPane.java
catch (Throwable t) { Log.log(Log.ERROR, this, "Error initializing option pane:"); Log.log(Log.ERROR, this, t); }
// in org/jedit/options/OptionGroupPane.java
catch (Throwable t) { Log.log(Log.ERROR, this, "Error saving options:"); Log.log(Log.ERROR, this, t); }
// in org/gjt/sp/jedit/gui/OptionsDialog.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Error initializing options:", t); }
// in org/gjt/sp/jedit/gui/OptionsDialog.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Error saving options:", t); }
// in org/gjt/sp/jedit/help/HelpIndex.java
catch(Throwable e) { Log.log(Log.ERROR,this,"Error indexing editor help"); Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/help/HelpIndex.java
catch(Throwable e) { Log.log(Log.ERROR,this,"Error indexing JAR: " + jars[i].getPath()); Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch (Throwable t) { throw new Error(t.getMessage()); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Throwable e ) { System.err.println("Could not init static(3):"+e); }
// in org/gjt/sp/jedit/EditBus.java
catch(Throwable t) { Log.log(Log.ERROR,EditBus.class,"Exception" + " while sending message on EditBus:"); Log.log(Log.ERROR,EditBus.class,t); }
// in org/gjt/sp/jedit/BeanShellFacade.java
catch(Throwable e) { Log.log(Log.ERROR,BeanShellFacade.class,e); handleException(param,null,e); }
// in org/gjt/sp/jedit/io/FileVFS.java
catch (Throwable t) { }
// in org/gjt/sp/jedit/io/FileVFS.java
catch (Throwable t) { }
// in org/gjt/sp/jedit/Buffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer undo event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/Buffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer undo event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/Buffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer begin redo event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/Buffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer end redo event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/BeanShell.java
catch(Throwable e) { Log.log(Log.ERROR,BeanShell.class,e); bsh.handleException(view,null,e); }
// in org/gjt/sp/jedit/BeanShell.java
catch(Throwable e) { Log.log(Log.ERROR,BeanShell.class,e); bsh.handleException(view,path,e); }
// in org/gjt/sp/jedit/BeanShell.java
catch(Throwable e) { Log.log(Log.ERROR,BeanShell.class,e); bsh.handleException(view,path,e); }
// in org/gjt/sp/jedit/JEditBeanShellAction.java
catch(Throwable e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/JEditBeanShellAction.java
catch(Throwable e) { Log.log(Log.ERROR,this,e); // dialogs fuck things up if a menu is visible, etc! //new BeanShellErrorDialog(view,e); // so that in the future we don't see streams of // exceptions isSelected = null; return false; }
// in org/gjt/sp/jedit/textarea/ExtensionManager.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); // remove it so editor can continue // functioning iter.remove(); }
// in org/gjt/sp/jedit/textarea/TextArea.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/textarea/TextArea.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/textarea/TextArea.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/textarea/TextArea.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/textarea/TextArea.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/menu/EnhancedCheckBoxMenuItem.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); return false; }
// in org/gjt/sp/jedit/BeanShellAction.java
catch(Throwable e) { Log.log(Log.ERROR,this,e); new BeanShellErrorDialog(view,e); }
// in org/gjt/sp/jedit/BeanShellAction.java
catch(Throwable e) { Log.log(Log.ERROR,this,e); // dialogs fuck things up if a menu is visible, etc! //new BeanShellErrorDialog(view,e); // so that in the future we don't see streams of // exceptions isSelected = null; return false; }
// in org/gjt/sp/jedit/syntax/ModeProvider.java
catch (Throwable e) { error(fileName, e); }
// in org/gjt/sp/jedit/PluginJAR.java
catch (Throwable t) { breakPlugin(); Log.log(Log.ERROR,this,"Error while starting plugin " + className); Log.log(Log.ERROR,this,t); String[] args = { t.toString() }; jEdit.pluginError(path,"plugin-error.start-error",args); return; }
// in org/gjt/sp/jedit/PluginJAR.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Error while " + "stopping plugin:"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/PluginJAR.java
catch(Throwable t) { breakPlugin(); Log.log(Log.ERROR,PluginJAR.this, "Error while starting plugin " + plugin.getClassName()); Log.log(Log.ERROR,PluginJAR.this,t); String[] args = { t.toString() }; jEdit.pluginError(path, "plugin-error.start-error",args); }
// in org/gjt/sp/util/WorkThreadPool.java
catch(Throwable t) { Log.log(Log.ERROR,WorkThread.class,"Exception " + "in AWT thread:"); Log.log(Log.ERROR,WorkThread.class,t); }
// in org/gjt/sp/util/Task.java
catch (Throwable t) { Log.log(Log.ERROR, this, t); }
// in org/gjt/sp/util/WorkThread.java
catch(Throwable t) { Log.log(Log.ERROR,WorkThread.class,"Exception in work thread: ", t); }
103
            
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch (Throwable t) { throw new Error(t.getMessage()); }
(Domain) UtilEvalError 71
            
// in org/gjt/sp/jedit/gui/DockableWindowFactory.java
catch(UtilEvalError e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/bsh/BSHUnaryExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch( UtilEvalError e ) { Interpreter.debug("doIndex: "+e); throw e.toEvalError( "Arrays may only be indexed by integer types.", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e) { throw e.toEvalError( "Property: "+value, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( UtilEvalError e ) { throw new InterpreterError( "Can't get class instance for synchronized method."); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch( UtilEvalError e) { throw new EvalError( "Invalid argument: " + "`"+paramNames[i]+"'" + " for method: " + name + " : " + e.getMessage(), callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( UtilEvalError e2 ) { throw e2.toEvalError( "Typed method parameter assignment", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( UtilEvalError e3 ) { throw e3.toEvalError( callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch( UtilEvalError e ) { // Point to return statement point if we had one. // (else it was implicit return? What's the case here?) SimpleNode node = callerInfo; if ( retControl != null ) node = retControl.returnPoint; throw e.toEvalError( "Incorrect type returned from method: " + name + e.getMessage(), node, callstack ); }
// in org/gjt/sp/jedit/bsh/This.java
catch ( UtilEvalError e ) { // leave null }
// in org/gjt/sp/jedit/bsh/This.java
catch ( UtilEvalError e ) { /*leave null*/ }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( UtilEvalError e ) { throw new InterpreterError("unable to init static: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( UtilEvalError e ) { // value error shouldn't happen }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( UtilEvalError e ) { throw e.toEvalError( callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( UtilEvalError e ) { throw new InterpreterError( "illegal argument type in method invocation: "+e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( UtilEvalError e ) { /*ignore*/ }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( UtilEvalError e ) { /*ignore*/ }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( UtilEvalError e ) { //e.printStackTrace(); throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( UtilEvalError e2 ) { // ClassPathException is a type of UtilEvalError throw e2.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/XThis.java
catch ( UtilEvalError e ) {/*leave null*/ }
// in org/gjt/sp/jedit/bsh/XThis.java
catch ( UtilEvalError e ) {/*leave null*/ }
// in org/gjt/sp/jedit/bsh/BSHCastExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimaryExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHTypedVariableDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
catch( UtilEvalError e ) { /* Catch the mismatch and continue to try the next Note: this is innefficient, should have an isAssignableFrom() that doesn't throw // TODO: we do now have a way to test assignment // in castObject(), use it? */ continue; }
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
catch ( UtilEvalError e ) { throw new InterpreterError( "Unable to set var in catch block namespace." ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { }
// in org/gjt/sp/jedit/bsh/Name.java
catch( UtilEvalError e ) { throw new UtilEvalError( "LHS evaluation: " + e.getMessage() ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError("Error loading command: ", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError("Error invoking compiled command: ", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/ExternalNameSpace.java
catch ( UtilEvalError ute ) { // There should be no case for this. unwrapVariable throws // UtilEvalError in some cases where it holds an LHS or array // index. throw new InterpreterError("unexpected UtilEvalError"); }
// in org/gjt/sp/jedit/bsh/BSHBinaryExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( UtilEvalError e ) { throw new InterpreterError("can't set cons var"); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( UtilEvalError e ) { throw new InterpreterError("err setting local cons arg:"+e); }
// in org/gjt/sp/jedit/bsh/BSHSwitchStatement.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Switch value: "+switchExp.getText()+": ", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BlockNameSpace.java
catch ( UtilEvalError e ) { return false; }
// in org/gjt/sp/jedit/bsh/Types.java
catch ( UtilEvalError e ) { // This should not happen with checkOnly true throw new InterpreterError("err in cast check: "+e); }
// in org/gjt/sp/jedit/bsh/BSHImportDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
catch ( UtilEvalError e ) { throw new UtilEvalError( "Variable assignment: " + name + ": " + e.getMessage()); }
// in org/gjt/sp/jedit/bsh/BSHMethodDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError(this,callstack); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHEnhancedForStatement.java
catch ( UtilEvalError e ) { throw e.toEvalError( "for loop iterator variable:"+ varName, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
catch ( UtilEvalError e ) { throw new InterpreterError( "bad cast" ); }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Error in array initializer", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHClassDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, callstack ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw new EvalError( e.getMessage(), SimpleNode.JAVACODE, new CallStack() ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() ); }
// in org/gjt/sp/jedit/bsh/JThis.java
catch ( UtilEvalError e ) {/*squeltch*/ }
// in org/gjt/sp/jedit/bsh/JThis.java
catch ( UtilEvalError e ) { /*squeltch*/ }
// in org/gjt/sp/jedit/bsh/JThis.java
catch ( UtilEvalError e ) {/*squeltch*/ }
// in org/gjt/sp/jedit/EditServer.java
catch(org.gjt.sp.jedit.bsh.UtilEvalError e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/EditServer.java
catch(org.gjt.sp.jedit.bsh.UtilEvalError e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/BeanShellFacade.java
catch(UtilEvalError e) { // do nothing }
// in org/gjt/sp/jedit/jEdit.java
catch(UtilEvalError e) { Log.log(Log.ERROR,jEdit.class,e); }
// in org/gjt/sp/jedit/JEditBeanShellAction.java
catch(UtilEvalError err) { Log.log(Log.ERROR,this,err); }
// in org/gjt/sp/jedit/browser/VFSBrowser.java
catch(UtilEvalError err) { Log.log(Log.ERROR,this,err); }
// in org/gjt/sp/jedit/browser/VFSBrowser.java
catch(UtilEvalError err) { Log.log(Log.ERROR,this,err); }
// in org/gjt/sp/jedit/BeanShellAction.java
catch(UtilEvalError err) { Log.log(Log.ERROR,this,err); }
49
            
// in org/gjt/sp/jedit/bsh/BSHUnaryExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch( UtilEvalError e ) { Interpreter.debug("doIndex: "+e); throw e.toEvalError( "Arrays may only be indexed by integer types.", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e) { throw e.toEvalError( "Property: "+value, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( UtilEvalError e ) { throw new InterpreterError( "Can't get class instance for synchronized method."); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch( UtilEvalError e) { throw new EvalError( "Invalid argument: " + "`"+paramNames[i]+"'" + " for method: " + name + " : " + e.getMessage(), callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( UtilEvalError e2 ) { throw e2.toEvalError( "Typed method parameter assignment", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( UtilEvalError e3 ) { throw e3.toEvalError( callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch( UtilEvalError e ) { // Point to return statement point if we had one. // (else it was implicit return? What's the case here?) SimpleNode node = callerInfo; if ( retControl != null ) node = retControl.returnPoint; throw e.toEvalError( "Incorrect type returned from method: " + name + e.getMessage(), node, callstack ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( UtilEvalError e ) { throw new InterpreterError("unable to init static: "+e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( UtilEvalError e ) { throw e.toEvalError( callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( UtilEvalError e ) { throw new InterpreterError( "illegal argument type in method invocation: "+e ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( UtilEvalError e ) { //e.printStackTrace(); throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( UtilEvalError e2 ) { // ClassPathException is a type of UtilEvalError throw e2.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHCastExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimaryExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHTypedVariableDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
catch ( UtilEvalError e ) { throw new InterpreterError( "Unable to set var in catch block namespace." ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch( UtilEvalError e ) { throw new UtilEvalError( "LHS evaluation: " + e.getMessage() ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError("Error loading command: ", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError("Error invoking compiled command: ", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/ExternalNameSpace.java
catch ( UtilEvalError ute ) { // There should be no case for this. unwrapVariable throws // UtilEvalError in some cases where it holds an LHS or array // index. throw new InterpreterError("unexpected UtilEvalError"); }
// in org/gjt/sp/jedit/bsh/BSHBinaryExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( UtilEvalError e ) { throw new InterpreterError("can't set cons var"); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( UtilEvalError e ) { throw new InterpreterError("err setting local cons arg:"+e); }
// in org/gjt/sp/jedit/bsh/BSHSwitchStatement.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Switch value: "+switchExp.getText()+": ", this, callstack ); }
// in org/gjt/sp/jedit/bsh/Types.java
catch ( UtilEvalError e ) { // This should not happen with checkOnly true throw new InterpreterError("err in cast check: "+e); }
// in org/gjt/sp/jedit/bsh/BSHImportDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
catch ( UtilEvalError e ) { throw new UtilEvalError( "Variable assignment: " + name + ": " + e.getMessage()); }
// in org/gjt/sp/jedit/bsh/BSHMethodDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError(this,callstack); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHEnhancedForStatement.java
catch ( UtilEvalError e ) { throw e.toEvalError( "for loop iterator variable:"+ varName, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
catch ( UtilEvalError e ) { throw new InterpreterError( "bad cast" ); }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Error in array initializer", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHClassDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, callstack ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw new EvalError( e.getMessage(), SimpleNode.JAVACODE, new CallStack() ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() ); }
(Domain) LookaheadSuccess 31
            
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
0
(Lib) NumberFormatException 23
            
// in org/gjt/sp/jedit/gui/SelectLineRange.java
catch(NumberFormatException nf) { getToolkit().beep(); return; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( NumberFormatException e ) { {if (true) throw createParseException( "Error or number too big for integer type: "+ literal );} }
// in org/gjt/sp/jedit/jEdit.java
catch(NumberFormatException nf) { System.err.println("Malformed option: " + arg); }
// in org/gjt/sp/jedit/jEdit.java
catch(NumberFormatException nf) { return def; }
// in org/gjt/sp/jedit/jEdit.java
catch(NumberFormatException nf) { return def; }
// in org/gjt/sp/jedit/jEdit.java
catch(NumberFormatException nf) { return def; }
// in org/gjt/sp/jedit/jEdit.java
catch(NumberFormatException nf) { return def; }
// in org/gjt/sp/jedit/jEdit.java
catch(NumberFormatException nf) { }
// in org/gjt/sp/jedit/Buffer.java
catch(NumberFormatException nf) { retVal = value; }
// in org/gjt/sp/jedit/BufferHistory.java
catch (NumberFormatException e) { Log.log(Log.ERROR, this, "Unable to parse caret position " + charData); }
// in org/gjt/sp/jedit/options/GeneralOptionPane.java
catch (NumberFormatException e) { Log.log(Log.WARNING, this, "hypersearchResultsWarning: " + hypersearchResultsWarning.getText() + " is not a valid value for this option"); }
// in org/gjt/sp/jedit/options/BufferOptionPane.java
catch(NumberFormatException nf) { }
// in org/gjt/sp/jedit/options/BufferOptionPane.java
catch(NumberFormatException nf) { }
// in org/gjt/sp/jedit/options/BufferOptionPane.java
catch(NumberFormatException nf) { }
// in org/gjt/sp/jedit/textarea/StandaloneTextArea.java
catch (NumberFormatException e) { }
// in org/gjt/sp/jedit/textarea/StandaloneTextArea.java
catch (NumberFormatException e) { }
// in org/gjt/sp/jedit/textarea/StandaloneTextArea.java
catch(NumberFormatException nf) { return def; }
// in org/gjt/sp/jedit/textarea/StandaloneTextArea.java
catch(NumberFormatException nf) { return def; }
// in org/gjt/sp/jedit/textarea/StandaloneTextArea.java
catch(NumberFormatException nf) { return def; }
// in org/gjt/sp/jedit/syntax/XModeHandler.java
catch (NumberFormatException e) { error("termchar-invalid",tmp); termChar = -1; }
// in org/gjt/sp/jedit/JEditMode.java
catch(NumberFormatException nf) { value = property; }
// in org/gjt/sp/jedit/JEditMode.java
catch(NumberFormatException nf) { return global; }
// in org/gjt/sp/util/SyntaxUtilities.java
catch(NumberFormatException nf) { return defaultColor; }
1
            
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( NumberFormatException e ) { {if (true) throw createParseException( "Error or number too big for integer type: "+ literal );} }
(Domain) EvalError 20
            
// in org/gjt/sp/jedit/bsh/This.java
catch( EvalError e ) { declaringInterpreter.error( "Exception in runnable:" + e ); }
// in org/gjt/sp/jedit/bsh/XThis.java
catch ( EvalError ee ) { // Ease debugging... // XThis.this refers to the enclosing class instance if ( Interpreter.DEBUG ) Interpreter.debug( "EvalError in scripted interface: " + XThis.this.toString() + ": "+ ee ); throw ee; }
// in org/gjt/sp/jedit/bsh/BSHTypedVariableDeclaration.java
catch ( EvalError e ) { e.reThrow( "Typed variable declaration" ); }
// in org/gjt/sp/jedit/bsh/BSHType.java
catch ( EvalError e ) { //throw new InterpreterError("unable to resolve type: "+e); // ignore and try default package //System.out.println("BSHType: "+node+" class not found"); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( EvalError e ) { throw new InterpreterError( "Error evaluating constructor args: "+e ); }
// in org/gjt/sp/jedit/bsh/TargetError.java
catch ( EvalError e ) { throw new InterpreterError("xprintarget: "+e.toString() ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
catch ( EvalError e ) { /* Here we catch any EvalError from the interpreter because we are using it as a tool to load the command, not as part of the execution path. */ Interpreter.debug( e.toString() ); throw new UtilEvalError( "Error loading script: "+ e.getMessage()); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( EvalError e ) { // ignore System.err.println( e ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e ) { System.out.println("Evaluation Error: "+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e ) { println( "BeanShell "+VERSION+" - by Pat Niemeyer (pat@pat.net)"); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch (EvalError e) { if ( interactive ) error( "EvalError: "+e.toString() ); else error( "EvalError: "+e.getMessage() ); if(DEBUG) e.printStackTrace(); if(!interactive) eof = true; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e) { if ( DEBUG) e.printStackTrace(); // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow( "Sourced file: "+sourceFileInfo ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e ) { throw new InterpreterError("set: "+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e ) { throw new InterpreterError("set: "+e); }
// in org/gjt/sp/jedit/bsh/JThis.java
catch(EvalError e) { declaringInterpreter.error( "local event hander method invocation error:" + e ); }
// in org/gjt/sp/jedit/bsh/JThis.java
catch(EvalError e) { declaringInterpreter.error( "local event hander method invocation error:" + e ); }
// in org/gjt/sp/jedit/bsh/JThis.java
catch(EvalError e) { declaringInterpreter.error( "local event handler imageUpdate: method invocation error:" + e ); }
// in org/gjt/sp/jedit/bsh/DelayedEvalBshMethod.java
catch ( EvalError e ) { throw new InterpreterError("can't eval return type: "+e); }
// in org/gjt/sp/jedit/bsh/DelayedEvalBshMethod.java
catch ( EvalError e ) { throw new InterpreterError("can't eval param types: "+e); }
// in org/gjt/sp/jedit/BeanShell.java
catch(EvalError e) { // do nothing }
8
            
// in org/gjt/sp/jedit/bsh/XThis.java
catch ( EvalError ee ) { // Ease debugging... // XThis.this refers to the enclosing class instance if ( Interpreter.DEBUG ) Interpreter.debug( "EvalError in scripted interface: " + XThis.this.toString() + ": "+ ee ); throw ee; }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( EvalError e ) { throw new InterpreterError( "Error evaluating constructor args: "+e ); }
// in org/gjt/sp/jedit/bsh/TargetError.java
catch ( EvalError e ) { throw new InterpreterError("xprintarget: "+e.toString() ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
catch ( EvalError e ) { /* Here we catch any EvalError from the interpreter because we are using it as a tool to load the command, not as part of the execution path. */ Interpreter.debug( e.toString() ); throw new UtilEvalError( "Error loading script: "+ e.getMessage()); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e ) { throw new InterpreterError("set: "+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e ) { throw new InterpreterError("set: "+e); }
// in org/gjt/sp/jedit/bsh/DelayedEvalBshMethod.java
catch ( EvalError e ) { throw new InterpreterError("can't eval return type: "+e); }
// in org/gjt/sp/jedit/bsh/DelayedEvalBshMethod.java
catch ( EvalError e ) { throw new InterpreterError("can't eval param types: "+e); }
(Lib) ClassNotFoundException 19
            
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( ClassNotFoundException e ) { throw new EvalError( e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassNotFoundException e ) {}
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassNotFoundException e ) {}
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassNotFoundException e ) {}
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassNotFoundException e ) { // fall through }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassNotFoundException e ) {}
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
catch ( ClassNotFoundException e ) {}
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
catch ( ClassNotFoundException e ) { }
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
catch ( ClassNotFoundException e ) { throw new ClassNotFoundException( "Designated loader could not find class: "+e ); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
catch ( ClassNotFoundException e ) { //System.out.println( // "base loader here caught class not found: "+name ); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
catch ( ClassNotFoundException e ) { }
// in org/gjt/sp/jedit/bsh/NameSpace.java
catch ( ClassNotFoundException e ) { /* not a class */ }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( ClassNotFoundException e ) { /*ignore*/ }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( ClassNotFoundException e ) { System.err.println("Class not found in source file: "+name ); return null; }
// in org/gjt/sp/jedit/bsh/Capabilities.java
catch ( ClassNotFoundException e ) { }
// in org/gjt/sp/jedit/JARClassLoader.java
catch (ClassNotFoundException cnf) { // keep going if class was not found. pending = cnf; }
// in org/gjt/sp/jedit/JARClassLoader.java
catch (ClassNotFoundException cnf2) { classHash.put(clazz,NO_CLASS); throw cnf2; }
// in org/gjt/sp/jedit/MiscUtilities.java
catch(ClassNotFoundException e1) { Class.forName("com.sun.tools.javac.Main"); }
// in org/gjt/sp/jedit/MiscUtilities.java
catch(ClassNotFoundException e) { //Log.log(Log.DEBUG, MiscUtilities.class, // "- is not in system classpath."); }
3
            
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( ClassNotFoundException e ) { throw new EvalError( e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
catch ( ClassNotFoundException e ) { throw new ClassNotFoundException( "Designated loader could not find class: "+e ); }
// in org/gjt/sp/jedit/JARClassLoader.java
catch (ClassNotFoundException cnf2) { classHash.put(clazz,NO_CLASS); throw cnf2; }
(Domain) ReflectError 16
            
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch(ReflectError e) { throw new EvalError("reflection error: " + e, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch (ReflectError e) { throw new EvalError("No such property: " + value, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( ReflectError e ) { throw new EvalError( "Error invoking Java method: "+e, callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { // no field, try property acces if ( hasObjectPropertyGetter( object.getClass(), fieldName ) ) return getObjectProperty( object, fieldName ); else throw e; }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { // not a field, try property access if ( hasObjectPropertySetter( object.getClass(), fieldName ) ) return new LHS( object, fieldName ); else throw e; }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { return null; }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( ReflectError e ) { /*shouldn't happen*/ }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { throw new UtilEvalError("Error invoking compiled command: "+e ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( ReflectError e) { throw new EvalError( "Constructor error: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch( ReflectError e ) { if ( Interpreter.DEBUG ) Interpreter.debug("field reflect error: "+e); }
// in org/gjt/sp/jedit/bsh/Name.java
catch(ReflectError e) { /* not a field */ }
// in org/gjt/sp/jedit/bsh/Name.java
catch(ReflectError e) { throw new UtilEvalError("Field access: "+e); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(ReflectError e) { Interpreter.debug(e.getMessage()); throw new UtilEvalError("No such property: " + propName); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(ReflectError e) { Interpreter.debug("Assignment: " + e.getMessage()); throw new UtilEvalError("No such property: " + propName); }
12
            
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch(ReflectError e) { throw new EvalError("reflection error: " + e, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch (ReflectError e) { throw new EvalError("No such property: " + value, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( ReflectError e ) { throw new EvalError( "Error invoking Java method: "+e, callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { // no field, try property acces if ( hasObjectPropertyGetter( object.getClass(), fieldName ) ) return getObjectProperty( object, fieldName ); else throw e; }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { // not a field, try property access if ( hasObjectPropertySetter( object.getClass(), fieldName ) ) return new LHS( object, fieldName ); else throw e; }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { throw new UtilEvalError("Error invoking compiled command: "+e ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( ReflectError e) { throw new EvalError( "Constructor error: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch(ReflectError e) { throw new UtilEvalError("Field access: "+e); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(ReflectError e) { Interpreter.debug(e.getMessage()); throw new UtilEvalError("No such property: " + propName); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(ReflectError e) { Interpreter.debug("Assignment: " + e.getMessage()); throw new UtilEvalError("No such property: " + propName); }
(Lib) FileNotFoundException 12
            
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(FileNotFoundException e) { Log.log(Log.ERROR,this,e); SwingUtilities.invokeLater(new Runnable() { public void run() { GUIUtilities.error(null,"plugin-error-download",new Object[]{""}); } }); return null; }
// in org/gjt/sp/jedit/gui/DockableWindowManagerImpl.java
catch (FileNotFoundException e) { return false; }
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
catch(FileNotFoundException fnf) { //Log.log(Log.DEBUG,HistoryModel.class,fnf); }
// in org/gjt/sp/jedit/help/HelpTOCPanel.java
catch(FileNotFoundException e) { /* it is acceptable only for the API TOC : the user can choose not to install them */ if("api/toc.xml".equals(path)) { Log.log(Log.NOTICE,this, "The API docs for jEdit will not be available (reinstall jEdit if you want them)"); root.add( createNode("http://www.jedit.org/api/overview-summary.html", jEdit.getProperty("helpviewer.toc.online-apidocs"))); } else { Log.log(Log.ERROR,this,e); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( FileNotFoundException e ) { System.out.println("File not found: "+e); }
// in org/gjt/sp/jedit/jEdit.java
catch(FileNotFoundException fnf) { Log.log(Log.DEBUG,jEdit.class,fnf); }
// in org/gjt/sp/jedit/jEdit.java
catch(FileNotFoundException fnf) { //Log.log(Log.DEBUG,jEdit.class,fnf); }
// in org/gjt/sp/jedit/Abbrevs.java
catch(FileNotFoundException fnf) { }
// in org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
catch (FileNotFoundException e) { Log.log(Log.WARNING,this,"Unable to save " + e.getMessage()); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch (FileNotFoundException e) { Log.log(Log.ERROR,this,"Unable to save buffer " + e); String[] pp = { e.getMessage() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/syntax/ModeProvider.java
catch (FileNotFoundException e1) { InputStream resource = ModeProvider.class.getResourceAsStream(fileName); if (resource == null) error(fileName, e1); grammar = new BufferedInputStream(resource); }
// in org/gjt/sp/jedit/PluginJAR.java
catch(FileNotFoundException fnf) { return null; }
0
(Lib) MalformedURLException 12
            
// in org/gjt/sp/jedit/help/HelpViewer.java
catch(MalformedURLException mu) { Log.log(Log.ERROR,this,mu); // what to do? }
// in org/gjt/sp/jedit/help/HelpViewer.java
catch(MalformedURLException mf) { Log.log(Log.ERROR,this,mf); String[] args = { url, mf.getMessage() }; GUIUtilities.error(this,"badurl",args); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch ( MalformedURLException e ) { throw new ClassPathException(" can't find boot jar: "+e); }
// in org/gjt/sp/jedit/bsh/Remote.java
catch (MalformedURLException e) { System.out.println(e); // bad postURL }
// in org/gjt/sp/jedit/io/UrlVFS.java
catch(MalformedURLException mu) { Log.log(Log.ERROR,this,mu); String[] args = { mu.getMessage() }; VFSManager.error(comp,path,"ioerror.badurl",args); return null; }
// in org/gjt/sp/jedit/io/UrlVFS.java
catch(MalformedURLException mu) { Log.log(Log.ERROR,this,mu); String[] args = { mu.getMessage() }; VFSManager.error(comp,path,"ioerror.badurl",args); return null; }
// in org/gjt/sp/jedit/io/UrlVFS.java
catch (MalformedURLException mue) { Log.log(Log.ERROR,this,mue); return super.getFilePath(vfsPath); }
// in org/gjt/sp/jedit/jEdit.java
catch (MalformedURLException mue) { path = MiscUtilities.constructPath(parent,path); }
// in org/gjt/sp/jedit/options/ToolBarOptionPane.java
catch(MalformedURLException mf) { Log.log(Log.ERROR,this,mf); }
// in org/gjt/sp/jedit/options/ToolBarOptionPane.java
catch(MalformedURLException mf) { Log.log(Log.ERROR,this,mf); }
// in org/gjt/sp/jedit/JARClassLoader.java
catch (MalformedURLException e) {}
// in org/gjt/sp/jedit/MiscUtilities.java
catch(MalformedURLException mf) { return false; }
1
            
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch ( MalformedURLException e ) { throw new ClassPathException(" can't find boot jar: "+e); }
(Lib) IllegalArgumentException 11
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( IllegalArgumentException e1 ) { throw new UtilTargetError( new ArrayStoreException( e1.toString() ) ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalArgumentException e) { throw new ReflectError("The number of arguments was wrong"); }
// in org/gjt/sp/jedit/bsh/CollectionManager.java
catch( IllegalArgumentException e ) { return false; }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( IllegalArgumentException e3) { String type = val instanceof Primitive ? ((Primitive)val).getType().getName() : val.getClass().getName(); throw new UtilEvalError( "Argument type mismatch. " + (val == null ? "null" : type ) + " not assignable to field "+field.getName()); }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
catch( IllegalArgumentException e ) { Interpreter.debug("illegal arg"+e); throwTypeError( baseType, currentInitializer, i, callstack ); }
// in org/gjt/sp/jedit/options/ShortcutsOptionPane.java
catch (IllegalArgumentException eae) {}
// in org/gjt/sp/jedit/options/ViewOptionPane.java
catch (IllegalArgumentException e) { Log.log(Log.ERROR, this, e); scope = BufferSet.Scope.global; }
// in org/gjt/sp/jedit/bufferset/BufferSetManager.java
catch (IllegalArgumentException e) { Log.log(Log.ERROR, this, e); scope = BufferSet.Scope.global; }
// in org/gjt/sp/jedit/PluginJAR.java
catch (IllegalArgumentException e) { Log.log(Log.ERROR, PluginJAR.class, className + " has an invalid dependency: " + dep); continue; }
// in org/gjt/sp/jedit/PluginJAR.java
catch (IllegalArgumentException e) { Log.log(Log.ERROR,this,name + " has an invalid" + " dependency: " + dep); ok = false; continue; }
// in org/gjt/sp/util/PropertiesBean.java
catch (IllegalArgumentException iae) { /* Ignore these. */ }
3
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( IllegalArgumentException e1 ) { throw new UtilTargetError( new ArrayStoreException( e1.toString() ) ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalArgumentException e) { throw new ReflectError("The number of arguments was wrong"); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( IllegalArgumentException e3) { String type = val instanceof Primitive ? ((Primitive)val).getType().getName() : val.getClass().getName(); throw new UtilEvalError( "Argument type mismatch. " + (val == null ? "null" : type ) + " not assignable to field "+field.getName()); }
(Lib) InterruptedException 11
            
// in org/gjt/sp/jedit/gui/SplashScreen.java
catch(InterruptedException ie) { Log.log(Log.ERROR,this,ie); }
// in org/gjt/sp/jedit/gui/SplashScreen.java
catch(InterruptedException ie) { Log.log(Log.ERROR,this,ie); }
// in org/gjt/sp/jedit/EditBus.java
catch (InterruptedException ie) { interrupted = true; Log.log(Log.ERROR, EditBus.class, ie); }
// in org/gjt/sp/jedit/io/CopyFileWorker.java
catch (InterruptedException e) { Log.log(Log.WARNING, this, "Copy was interrupted"); }
// in org/gjt/sp/jedit/io/VFSManager.java
catch (InterruptedException ie) { // preserve interruption flag, but don't stop Thread.currentThread().interrupt(); }
// in org/gjt/sp/jedit/io/VFSManager.java
catch(InterruptedException ie) { // We don't stop, we have to display errors. // However the flag must be preserved. Thread.currentThread().interrupt(); // But since someone breaks us, let's exit // this waiting loop. break; }
// in org/gjt/sp/jedit/GUIUtilities.java
catch (InterruptedException ie) { }
// in org/gjt/sp/jedit/browser/VFSBrowser.java
catch (InterruptedException e) { Log.log(Log.ERROR, this, e, e); }
// in org/gjt/sp/util/ThreadUtilities.java
catch (InterruptedException e) { Log.log(Log.ERROR, ThreadUtilities.class, e); }
// in org/gjt/sp/util/WorkThreadPool.java
catch(InterruptedException ie) { Log.log(Log.ERROR,this,ie); }
// in org/gjt/sp/util/WorkThread.java
catch(InterruptedException ie) { Log.log(Log.ERROR,this,ie); }
0
(Lib) InvocationTargetException 11
            
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch(InvocationTargetException e) { throw new TargetError( "target exception", e.getTargetException(), this, callstack, true); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( InvocationTargetException e ) { String msg = "Method Invocation "+field; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( InvocationTargetException e2 ) { throw new TargetError( "Exception invoking imported object method.", e2, callerInfo, callstack, true/*isNative*/ ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(InvocationTargetException e) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( InvocationTargetException e ) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( InvocationTargetException e ) { throw new UtilEvalError( "Error in compiled command: "+e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch(InvocationTargetException e) { // No need to wrap this debug Interpreter.debug("The constructor threw an exception:\n\t" + e.getTargetException()); throw new TargetError( "Object constructor", e.getTargetException(), this, callstack, true); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( InvocationTargetException e ) { String msg = "Method Invocation "+name; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); }
// in org/gjt/sp/jedit/EditBus.java
catch (InvocationTargetException ite) { Log.log(Log.ERROR, EditBus.class, ite); }
// in org/gjt/sp/jedit/EditBus.java
catch (InvocationTargetException t) { Log.log(Log.ERROR,EditBus.class,"Exception" + " while sending message on EditBus:"); Log.log(Log.ERROR, EditBus.class, t.getCause()); }
// in org/gjt/sp/jedit/io/VFSManager.java
catch (InvocationTargetException ite) { Log.log(Log.ERROR, ErrorDisplayer.class, ite); }
8
            
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch(InvocationTargetException e) { throw new TargetError( "target exception", e.getTargetException(), this, callstack, true); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( InvocationTargetException e ) { String msg = "Method Invocation "+field; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( InvocationTargetException e2 ) { throw new TargetError( "Exception invoking imported object method.", e2, callerInfo, callstack, true/*isNative*/ ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(InvocationTargetException e) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( InvocationTargetException e ) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( InvocationTargetException e ) { throw new UtilEvalError( "Error in compiled command: "+e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch(InvocationTargetException e) { // No need to wrap this debug Interpreter.debug("The constructor threw an exception:\n\t" + e.getTargetException()); throw new TargetError( "Object constructor", e.getTargetException(), this, callstack, true); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( InvocationTargetException e ) { String msg = "Method Invocation "+name; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); }
(Domain) Abort 8
            
// in org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
catch(WorkThread.Abort a) { }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/util/WorkThread.java
catch(Abort a) { Log.log(Log.ERROR,WorkThread.class,"Unhandled abort", a); }
0
(Lib) PatternSyntaxException 7
            
// in org/gjt/sp/jedit/Mode.java
catch(PatternSyntaxException re) { Log.log(Log.ERROR,this,"Invalid filename/firstline" + " globs in mode " + name); Log.log(Log.ERROR,this,re); }
// in org/gjt/sp/jedit/io/VFS.java
catch(PatternSyntaxException e) { Log.log(Log.ERROR,VFS.class,"Invalid regular expression: " + glob); Log.log(Log.ERROR,VFS.class,e); }
// in org/gjt/sp/jedit/menu/RecentFilesProvider.java
catch(PatternSyntaxException re) { Log.log(Log.ERROR,this,re.getMessage()); }
// in org/gjt/sp/jedit/syntax/XModeHandler.java
catch(PatternSyntaxException e) { error("regexp",e); }
// in org/gjt/sp/jedit/syntax/XModeHandler.java
catch(PatternSyntaxException re) { error("regexp",re); }
// in org/gjt/sp/jedit/syntax/XModeHandler.java
catch(PatternSyntaxException re) { error("regexp",re); }
// in org/gjt/sp/jedit/syntax/XModeHandler.java
catch(PatternSyntaxException re) { error("regexp",re); }
0
(Lib) SecurityException 7
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching fields of: "+clas, e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching methods of: "+clas, e ); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( SecurityException e ) { }
// in org/gjt/sp/jedit/bsh/Capabilities.java
catch ( SecurityException e ) { throw new Unavailable("Accessibility unavailable: "+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( SecurityException e ) { // applets can't see sys props setu( "bsh.cwd", "." ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( SecurityException e ) { System.err.println("Could not init static:"+e); }
// in org/gjt/sp/jedit/jEdit.java
catch(SecurityException se) { Log.log(Log.ERROR,jEdit.class,se); }
3
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching fields of: "+clas, e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching methods of: "+clas, e ); }
// in org/gjt/sp/jedit/bsh/Capabilities.java
catch ( SecurityException e ) { throw new Unavailable("Accessibility unavailable: "+e); }
(Lib) IllegalAccessException 5
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( IllegalAccessException e ) { throw new ReflectError( "Cannot access method " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " in '" + method.getDeclaringClass() + "' :" + e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalAccessException e) { throw new ReflectError("Can't access field: " + fieldName); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalAccessException e) { throw new ReflectError( "We don't have permission to create an instance." +"Use setAccessibility(true) to enable access." ); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(IllegalAccessException e2) { throw new UtilEvalError("Can't read field: " + field); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( IllegalAccessException e2) { throw new UtilEvalError( "LHS ("+field.getName()+") can't access field: "+e2); }
5
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( IllegalAccessException e ) { throw new ReflectError( "Cannot access method " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " in '" + method.getDeclaringClass() + "' :" + e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalAccessException e) { throw new ReflectError("Can't access field: " + fieldName); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalAccessException e) { throw new ReflectError( "We don't have permission to create an instance." +"Use setAccessibility(true) to enable access." ); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(IllegalAccessException e2) { throw new UtilEvalError("Can't read field: " + field); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( IllegalAccessException e2) { throw new UtilEvalError( "LHS ("+field.getName()+") can't access field: "+e2); }
(Domain) TargetError 5
            
// in org/gjt/sp/jedit/bsh/XThis.java
catch ( TargetError te ) { // Unwrap target exception. If the interface declares that // it throws the ex it will be delivered. If not it will be // wrapped in an UndeclaredThrowable throw te.getTarget(); }
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
catch( TargetError e ) { target = e; String stackInfo = "Bsh Stack: "; while ( callstack.depth() > callstackDepth ) stackInfo += "\t" + callstack.pop() +"\n"; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( TargetError e ) { System.out.println("Script threw exception: "+e); if ( e.inNativeCode() ) e.printStackTrace( DEBUG, System.err ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(TargetError e) { error("// Uncaught Exception: " + e ); if ( e.inNativeCode() ) e.printStackTrace( DEBUG, err ); if(!interactive) eof = true; setu("$_e", e.getTarget()); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( TargetError e ) { // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow("Sourced file: "+sourceFileInfo); }
1
            
// in org/gjt/sp/jedit/bsh/XThis.java
catch ( TargetError te ) { // Unwrap target exception. If the interface declares that // it throws the ex it will be delivered. If not it will be // wrapped in an UndeclaredThrowable throw te.getTarget(); }
(Lib) UnsupportedFlavorException 5
            
// in org/gjt/sp/jedit/gui/PingPongList.java
catch (UnsupportedFlavorException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/Registers.java
catch (UnsupportedFlavorException e) { }
// in org/gjt/sp/jedit/Registers.java
catch (UnsupportedFlavorException e) { Log.log(Log.ERROR, Registers.class, e); }
// in org/gjt/sp/jedit/Registers.java
catch (UnsupportedFlavorException e) { Log.log(Log.ERROR, Registers.class, e); }
// in org/gjt/sp/jedit/Registers.java
catch (UnsupportedFlavorException e) { Log.log(Log.ERROR, this, e); }
0
(Lib) CharacterCodingException 4
            
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
catch(CharacterCodingException e) { // It seems to be made by an old version of jEdit. in.close(); Log.log(Log.MESSAGE,HistoryModel.class, "Failed to load history with UTF-8." + " Fallbacking to the system default encoding."); in = new BufferedReader(new FileReader(history)); models.putAll(loadFromReader(in)); }
// in org/gjt/sp/jedit/bufferio/BufferIORequest.java
catch(CharacterCodingException e) { String message = getWriteEncodingErrorMessage( encodingName, encoding, lineSegment, i); IOException wrapping = new CharConversionException(message); wrapping.initCause(e); throw wrapping; }
// in org/gjt/sp/jedit/bufferio/BufferIORequest.java
catch(CharacterCodingException e) { return i; }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(CharacterCodingException e) { encodingError = e; }
1
            
// in org/gjt/sp/jedit/bufferio/BufferIORequest.java
catch(CharacterCodingException e) { String message = getWriteEncodingErrorMessage( encodingName, encoding, lineSegment, i); IOException wrapping = new CharConversionException(message); wrapping.initCause(e); throw wrapping; }
(Domain) ClassPathException 3
            
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassPathException e ) { System.err.println("Warning: can't get boot class path"); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassPathException e ) { throw new UtilEvalError("Error importing classpath "+ e ); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassPathException e ) { throw new org.gjt.sp.jedit.bsh.InterpreterError("defineClass: "+e); }
2
            
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassPathException e ) { throw new UtilEvalError("Error importing classpath "+ e ); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassPathException e ) { throw new org.gjt.sp.jedit.bsh.InterpreterError("defineClass: "+e); }
(Lib) IllegalCharsetNameException 3
            
// in org/gjt/sp/jedit/io/XMLEncodingDetector.java
catch(IllegalCharsetNameException e) { Log.log(Log.WARNING, XMLEncodingDetector.class, "XML PI specifies illegal encoding: " + encoding, e); }
// in org/gjt/sp/jedit/io/EncodingServer.java
catch (IllegalCharsetNameException e) { // just failed }
// in org/gjt/sp/jedit/io/EncodingServer.java
catch (IllegalCharsetNameException e) { // The name is illegal for java.nio.charset.Charset. // But it may be legal for service name. }
0
(Lib) NoSuchFieldException 3
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( NoSuchFieldException e) { throw new ReflectError("No such field: " + fieldName ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( NoSuchFieldException e ) { }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(NoSuchFieldException e) { }
1
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( NoSuchFieldException e) { throw new ReflectError("No such field: " + fieldName ); }
(Lib) NullPointerException 3
            
// in org/jedit/options/OptionGroupPane.java
catch (NullPointerException npe) {}
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( NullPointerException e ) { // shouldn't happen throw new ReflectError( "???" + fieldName + " is not a static field."); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( NullPointerException e) { throw new UtilEvalError( "LHS ("+field.getName()+") not a static field."); }
2
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( NullPointerException e ) { // shouldn't happen throw new ReflectError( "???" + fieldName + " is not a static field."); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( NullPointerException e) { throw new UtilEvalError( "LHS ("+field.getName()+") not a static field."); }
(Domain) ParseException 3
            
// in org/gjt/sp/jedit/pluginmgr/InstallPanel.java
catch (ParseException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(ParseException e) { error("Parser Error: " + e.getMessage(DEBUG)); if ( DEBUG ) e.printStackTrace(); if(!interactive) eof = true; parser.reInitInput(in); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(ParseException e) { /* throw new EvalError( "Sourced file: "+sourceFileInfo+" parser Error: " + e.getMessage( DEBUG ), node, callstack ); */ if ( DEBUG ) // show extra "expecting..." info error( e.getMessage(DEBUG) ); // add the source file info and throw again e.setErrorSourceFile( sourceFileInfo ); throw e; }
1
            
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(ParseException e) { /* throw new EvalError( "Sourced file: "+sourceFileInfo+" parser Error: " + e.getMessage( DEBUG ), node, callstack ); */ if ( DEBUG ) // show extra "expecting..." info error( e.getMessage(DEBUG) ); // add the source file info and throw again e.setErrorSourceFile( sourceFileInfo ); throw e; }
(Lib) UnsupportedCharsetException 3
            
// in org/gjt/sp/jedit/io/EncodingServer.java
catch (UnsupportedCharsetException e) { // just failed }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(UnsupportedCharsetException e) { Log.log(Log.ERROR, this, e, e); String[] pp = { e.getCharsetName() }; VFSManager.error(view,path,"ioerror.unsupported-encoding-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(UnsupportedCharsetException e) { encodingError = e; }
0
(Lib) ArrayStoreException 2
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( ArrayStoreException e2 ) { throw new UtilTargetError( e2 ); }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
catch( ArrayStoreException e ) { // I think this can happen Interpreter.debug("arraystore"+e); throwTypeError( baseType, currentInitializer, i, callstack ); }
1
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( ArrayStoreException e2 ) { throw new UtilTargetError( e2 ); }
(Domain) InterpreterError 2
            
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(InterpreterError e) { error("Internal Error: " + e.getMessage()); e.printStackTrace(); if(!interactive) eof = true; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( InterpreterError e ) { e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" internal Error: " + e.getMessage(), node, callstack); }
1
            
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( InterpreterError e ) { e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" internal Error: " + e.getMessage(), node, callstack); }
(Lib) InterruptedIOException 2
            
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(InterruptedIOException iio) { }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(InterruptedIOException iio) { // do nothing, user clicked 'Stop' return null; }
0
(Lib) NoClassDefFoundError 2
            
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( NoClassDefFoundError e2 ) { throw noClassDefFound( name, e2 ); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( NoClassDefFoundError e ) { throw noClassDefFound( name, e ); }
2
            
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( NoClassDefFoundError e2 ) { throw noClassDefFound( name, e2 ); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( NoClassDefFoundError e ) { throw noClassDefFound( name, e ); }
(Lib) NoSuchMethodException 2
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( NoSuchMethodException e ) { /* fall through */ }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( NoSuchMethodException e ) { return false; }
0
(Lib) OutOfMemoryError 2
            
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(OutOfMemoryError oom) { Log.log(Log.ERROR,this,oom); VFSManager.error(view,path,"out-of-memory-error",null); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/JEditKillRing.java
catch (OutOfMemoryError oem) { Log.log(Log.ERROR, this, "Unable to load entire Killring, too low memory, increase your jvm max heap size"); String start = jEdit.getProperty("killring.start"); String deleteKillRing = jEdit.getProperty("killring.delete"); String stop = jEdit.getProperty("killring.stop"); int selected = GUIUtilities.option(null, "killring.load-memoryerror", null, JOptionPane.ERROR_MESSAGE, new Object[]{start, deleteKillRing, stop}, start); if (selected == 2) { System.exit(-1); } else if (selected == 1) { new File(MiscUtilities.constructPath( jEdit.getSettingsDirectory(),"killring.xml")).delete(); return; } }
0
(Lib) SAXException 2
            
// in org/gjt/sp/jedit/syntax/ModeProvider.java
catch (SAXException saxe) { Log.log(Log.ERROR, this, saxe); return; }
// in org/gjt/sp/util/XMLUtilities.java
catch(SAXException e) { Log.log(Log.ERROR,XMLUtilities.class,e); return true; }
0
(Domain) TextAreaException 2
            
// in org/gjt/sp/jedit/textarea/JEditTextArea.java
catch (TextAreaException e) { GUIUtilities.error(view,"folding-not-explicit",null); }
// in org/gjt/sp/jedit/textarea/JEditTextArea.java
catch (TextAreaException e) { GUIUtilities.error(view,"format-maxlinelen",null); }
0
(Domain) TokenMgrError 2
            
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(TokenMgrError e) { error("Error parsing input: " + e); /* We get stuck in infinite loops here when unicode escapes fail. Must re-init the char stream reader (ASCII_UCodeESC_CharStream.java) */ parser.reInitTokenInput( in ); if(!interactive) eof = true; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(TokenMgrError e) { throw new EvalError( "Sourced file: "+sourceFileInfo+" Token Parsing Error: " + e.getMessage(), node, callstack ); }
1
            
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(TokenMgrError e) { throw new EvalError( "Sourced file: "+sourceFileInfo+" Token Parsing Error: " + e.getMessage(), node, callstack ); }
(Lib) AWTException 1
            
// in org/gjt/sp/jedit/gui/tray/JTrayIconManager.java
catch (AWTException e) { Log.log(Log.ERROR, JEditSwingTrayIcon.class, "Unable to add Tray icon", e); trayIcon = null; return; }
0
(Lib) ArithmeticException 1
            
// in org/gjt/sp/jedit/bsh/Primitive.java
catch ( ArithmeticException e ) { throw new UtilTargetError( "Arithemetic Exception in binary op", e); }
1
            
// in org/gjt/sp/jedit/bsh/Primitive.java
catch ( ArithmeticException e ) { throw new UtilTargetError( "Arithemetic Exception in binary op", e); }
(Lib) ArrayIndexOutOfBoundsException 1
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( ArrayIndexOutOfBoundsException e1 ) { throw new UtilTargetError( e1 ); }
1
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( ArrayIndexOutOfBoundsException e1 ) { throw new UtilTargetError( e1 ); }
(Lib) BadLocationException 1
            
// in org/gjt/sp/jedit/gui/ErrorListDialog.java
catch (BadLocationException e) { }
0
(Lib) CharConversionException 1
            
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(CharConversionException e) { encodingError = e; }
0
(Lib) CloneNotSupportedException 1
            
// in org/gjt/sp/jedit/textarea/Selection.java
catch(CloneNotSupportedException e) { throw new InternalError("I just drank a whole " + "bottle of cough syrup and I feel " + "funny!"); }
1
            
// in org/gjt/sp/jedit/textarea/Selection.java
catch(CloneNotSupportedException e) { throw new InternalError("I just drank a whole " + "bottle of cough syrup and I feel " + "funny!"); }
(Lib) IllegalStateException 1
            
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( IllegalStateException e ) { {if (true) throw createParseException( e.getMessage() );} }
1
            
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( IllegalStateException e ) { {if (true) throw createParseException( e.getMessage() );} }
(Lib) InstantiationException 1
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(InstantiationException e) { throw new ReflectError("The class "+clas+" is abstract "); }
1
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(InstantiationException e) { throw new ReflectError("The class "+clas+" is abstract "); }
(Lib) MalformedInputException 1
            
// in org/gjt/sp/jedit/MiscUtilities.java
catch (MalformedInputException mie) { // This error probably means the input is binary. return true; }
0
(Lib) NegativeArraySizeException 1
            
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch( NegativeArraySizeException e1 ) { throw new TargetError( e1, this, callstack ); }
1
            
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch( NegativeArraySizeException e1 ) { throw new TargetError( e1, this, callstack ); }
(Lib) NoSuchAlgorithmException 1
            
// in org/gjt/sp/util/StandardUtilities.java
catch (NoSuchAlgorithmException e) { Log.log(Log.ERROR, StandardUtilities.class, "Can't Calculate MD5 hash!", e); return dummy; }
0
(Lib) PrinterAbortException 1
            
// in org/gjt/sp/jedit/print/BufferPrintable.java
catch(PrinterAbortException ae) { Log.log(Log.DEBUG,this,ae); }
0
(Lib) SAXParseException 1
            
// in org/gjt/sp/util/XMLUtilities.java
catch(SAXParseException se) { int line = se.getLineNumber(); Log.log(Log.ERROR,XMLUtilities.class, "while parsing from " + in + ": SAXParseException: line " + line + ": " , se); return true; }
0
(Lib) TooManyListenersException 1
            
// in org/gjt/sp/jedit/textarea/TextArea.java
catch(TooManyListenersException e) { Log.log(Log.ERROR,this,e); }
0
(Domain) Unavailable 1
            
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( Capabilities.Unavailable e ) { throw new EvalError( "Defining classes currently requires reflective Accessibility.", block, callstack ); }
1
            
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( Capabilities.Unavailable e ) { throw new EvalError( "Defining classes currently requires reflective Accessibility.", block, callstack ); }
(Lib) UnknownHostException 1
            
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch(java.net.UnknownHostException e) { GUIUtilities.error(jEdit.getActiveView() , "plugin-manager.list-download.disconnected" , new Object[]{e.getMessage()}); Log.log (Log.ERROR, this, "CacheRemotePluginList: error", e); }
0
(Lib) UnsupportedEncodingException 1
            
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(UnsupportedEncodingException e) { encodingError = e; }
0
(Domain) UtilTargetError 1
            
// in org/gjt/sp/jedit/bsh/LHS.java
catch ( UtilTargetError e1 ) { // pass along target error throw e1; }
1
            
// in org/gjt/sp/jedit/bsh/LHS.java
catch ( UtilTargetError e1 ) { // pass along target error throw e1; }
(Lib) ZipException 1
            
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(ZipException e) { Log.log(Log.ERROR,this,e); GUIUtilities.error(null,"plugin-error-download",new Object[]{""}); }
0

Exception Recast Summary

There is a common practice of throwing exceptions from within a catch block (e.g. for wrapping a low-level exception). The following table summarizes the usage of this practice in the application. The last column gives the number of times it happens for a pair of exceptions. The graph below the table graphically renders the same information. For a given node, its color represents its origin (blue means library exception, orange means domain exception); the left-most number is the number of times it is thrown, the right-most is the number of times it is caught.

Catch Throw
(Lib) IllegalArgumentException
(Domain) UtilTargetError
(Domain) ReflectError
(Domain) UtilEvalError
1
                    
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( IllegalArgumentException e1 ) { throw new UtilTargetError( new ArrayStoreException( e1.toString() ) ); }
1
                    
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalArgumentException e) { throw new ReflectError("The number of arguments was wrong"); }
1
                    
// in org/gjt/sp/jedit/bsh/LHS.java
catch( IllegalArgumentException e3) { String type = val instanceof Primitive ? ((Primitive)val).getType().getName() : val.getClass().getName(); throw new UtilEvalError( "Argument type mismatch. " + (val == null ? "null" : type ) + " not assignable to field "+field.getName()); }
(Lib) IOException
(Lib) InternalError
(Lib) Error
(Domain) ClassPathException
(Lib) RuntimeException
(Lib) ClassNotFoundException
Unknown
1
                    
// in org/gjt/sp/jedit/View.java
catch(IOException e) { // this should never throw an exception. throw new InternalError(); }
1
                    
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch(java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); }
1
                    
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch ( IOException e ) { throw new ClassPathException("can't parse class path: "+e); }
2
                    
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch(IOException ie ) { throw new RuntimeException("Couldn't load file: "+file); }
// in org/gjt/sp/jedit/PluginJAR.java
catch (IOException ioe) { throw new RuntimeException(ioe); }
1
                    
// in org/gjt/sp/jedit/JARClassLoader.java
catch(IOException io) { Log.log(Log.ERROR,this,io); throw new ClassNotFoundException(clazz); }
2
                    
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch(java.io.IOException e) { if (bufpos != 0) { --bufpos; backup(0); } else { bufline[bufpos] = line; bufcolumn[bufpos] = column; } throw e; }
// in org/gjt/sp/jedit/io/FileVFS.java
catch(IOException io) { if(ignoreErrors) return null; else throw io; }
(Lib) Throwable
(Lib) Error
Unknown
1
                    
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch (Throwable t) { throw new Error(t.getMessage()); }
102
                    
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
(Lib) NullPointerException
(Domain) ReflectError
(Domain) UtilEvalError
1
                    
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( NullPointerException e ) { // shouldn't happen throw new ReflectError( "???" + fieldName + " is not a static field."); }
1
                    
// in org/gjt/sp/jedit/bsh/LHS.java
catch( NullPointerException e) { throw new UtilEvalError( "LHS ("+field.getName()+") not a static field."); }
(Lib) Exception
(Domain) InterpreterError
(Domain) ReflectError
(Domain) EvalError
(Domain) Unavailable
(Domain) UtilEvalError
(Lib) InternalError
Unknown
10
                    
// in org/gjt/sp/jedit/bsh/This.java
catch ( Exception e ) { throw new InterpreterError("internal error 1 in This: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "unable to get instance initializer: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "unable to get instance initializer: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Error in class initialization: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { if ( e instanceof TargetError ) e =(Exception)((TargetError)e).getTarget(); if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); e.printStackTrace( System.err ); throw new InterpreterError("Error in class initialization: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Unable to get class static space: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "Generated class: Error getting This"+e ); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( Exception e ) { throw new InterpreterError("Error loading classmanager: "+e); }
2
                    
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(Exception e) { throw new ReflectError("Array access:" + e); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(Exception e) { throw new ReflectError("Array access:" + e); }
5
                    
// in org/gjt/sp/jedit/bsh/BSHType.java
catch(Exception e) { throw new EvalError("Couldn't construct array type", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( Exception e ) { if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); throw new EvalError( "Error constructing inner class instance: "+e, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch( Exception e ) { throw new EvalError("Can't construct primitive array: " + e.getMessage(), this, callstack); }
// in org/gjt/sp/jedit/bsh/BSHArrayDimensions.java
catch(Exception e) { throw new EvalError( "Array index: " + i + " does not evaluate to an integer", this, callstack ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e) { if ( DEBUG) e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" unknown error: " + e.getMessage(), node, callstack); }
2
                    
// in org/gjt/sp/jedit/bsh/ClassGenerator.java
catch ( Exception e ) { throw new Unavailable("ClassGenerator unavailable: "+e); }
// in org/gjt/sp/jedit/bsh/ReflectManager.java
catch ( Exception e ) { throw new Unavailable("Reflect Manager unavailable: "+e); }
2
                    
// in org/gjt/sp/jedit/bsh/LHS.java
catch(Exception e) { throw new UtilEvalError("Array access: " + e); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch ( Exception e ) { throw new UtilEvalError("Assignment: " + e.getMessage()); }
1
                    
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { throw new InternalError("Missing or invalid glob for handler " + name); }
2
                    
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( Exception e ) { {if (true) throw createParseException("Error parsing character: "+x.image);} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( Exception e ) { {if (true) throw createParseException("Error parsing string: "+x.image);} }
(Domain) UtilEvalError
(Domain) InterpreterError
(Domain) EvalError
(Domain) UtilEvalError
Unknown
9
                    
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( UtilEvalError e ) { throw new InterpreterError( "Can't get class instance for synchronized method."); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( UtilEvalError e ) { throw new InterpreterError("unable to init static: "+e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( UtilEvalError e ) { throw new InterpreterError( "illegal argument type in method invocation: "+e ); }
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
catch ( UtilEvalError e ) { throw new InterpreterError( "Unable to set var in catch block namespace." ); }
// in org/gjt/sp/jedit/bsh/ExternalNameSpace.java
catch ( UtilEvalError ute ) { // There should be no case for this. unwrapVariable throws // UtilEvalError in some cases where it holds an LHS or array // index. throw new InterpreterError("unexpected UtilEvalError"); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( UtilEvalError e ) { throw new InterpreterError("can't set cons var"); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( UtilEvalError e ) { throw new InterpreterError("err setting local cons arg:"+e); }
// in org/gjt/sp/jedit/bsh/Types.java
catch ( UtilEvalError e ) { // This should not happen with checkOnly true throw new InterpreterError("err in cast check: "+e); }
// in org/gjt/sp/jedit/bsh/Primitive.java
catch ( UtilEvalError e ) { throw new InterpreterError( "bad cast" ); }
2
                    
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch( UtilEvalError e) { throw new EvalError( "Invalid argument: " + "`"+paramNames[i]+"'" + " for method: " + name + " : " + e.getMessage(), callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw new EvalError( e.getMessage(), SimpleNode.JAVACODE, new CallStack() ); }
2
                    
// in org/gjt/sp/jedit/bsh/Name.java
catch( UtilEvalError e ) { throw new UtilEvalError( "LHS evaluation: " + e.getMessage() ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
catch ( UtilEvalError e ) { throw new UtilEvalError( "Variable assignment: " + name + ": " + e.getMessage()); }
36
                    
// in org/gjt/sp/jedit/bsh/BSHUnaryExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch( UtilEvalError e ) { Interpreter.debug("doIndex: "+e); throw e.toEvalError( "Arrays may only be indexed by integer types.", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e) { throw e.toEvalError( "Property: "+value, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( UtilEvalError e2 ) { throw e2.toEvalError( "Typed method parameter assignment", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( UtilEvalError e3 ) { throw e3.toEvalError( callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch( UtilEvalError e ) { // Point to return statement point if we had one. // (else it was implicit return? What's the case here?) SimpleNode node = callerInfo; if ( retControl != null ) node = retControl.returnPoint; throw e.toEvalError( "Incorrect type returned from method: " + name + e.getMessage(), node, callstack ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( UtilEvalError e ) { throw e.toEvalError( callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( UtilEvalError e ) { //e.printStackTrace(); throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( UtilEvalError e2 ) { // ClassPathException is a type of UtilEvalError throw e2.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHCastExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimaryExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHTypedVariableDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError("Error loading command: ", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError("Error invoking compiled command: ", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHBinaryExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHSwitchStatement.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Switch value: "+switchExp.getText()+": ", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHImportDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHMethodDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError(this,callstack); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHEnhancedForStatement.java
catch ( UtilEvalError e ) { throw e.toEvalError( "for loop iterator variable:"+ varName, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Error in array initializer", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHClassDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, callstack ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() ); }
(Domain) UtilTargetError
Unknown
1
                    
// in org/gjt/sp/jedit/bsh/LHS.java
catch ( UtilTargetError e1 ) { // pass along target error throw e1; }
(Domain) TargetError
Unknown
1
                    
// in org/gjt/sp/jedit/bsh/XThis.java
catch ( TargetError te ) { // Unwrap target exception. If the interface declares that // it throws the ex it will be delivered. If not it will be // wrapped in an UndeclaredThrowable throw te.getTarget(); }
(Domain) ClassPathException
(Domain) UtilEvalError
(Domain) InterpreterError
1
                    
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassPathException e ) { throw new UtilEvalError("Error importing classpath "+ e ); }
1
                    
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassPathException e ) { throw new org.gjt.sp.jedit.bsh.InterpreterError("defineClass: "+e); }
(Domain) EvalError
(Domain) InterpreterError
(Domain) UtilEvalError
Unknown
6
                    
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( EvalError e ) { throw new InterpreterError( "Error evaluating constructor args: "+e ); }
// in org/gjt/sp/jedit/bsh/TargetError.java
catch ( EvalError e ) { throw new InterpreterError("xprintarget: "+e.toString() ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e ) { throw new InterpreterError("set: "+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e ) { throw new InterpreterError("set: "+e); }
// in org/gjt/sp/jedit/bsh/DelayedEvalBshMethod.java
catch ( EvalError e ) { throw new InterpreterError("can't eval return type: "+e); }
// in org/gjt/sp/jedit/bsh/DelayedEvalBshMethod.java
catch ( EvalError e ) { throw new InterpreterError("can't eval param types: "+e); }
1
                    
// in org/gjt/sp/jedit/bsh/NameSpace.java
catch ( EvalError e ) { /* Here we catch any EvalError from the interpreter because we are using it as a tool to load the command, not as part of the execution path. */ Interpreter.debug( e.toString() ); throw new UtilEvalError( "Error loading script: "+ e.getMessage()); }
1
                    
// in org/gjt/sp/jedit/bsh/XThis.java
catch ( EvalError ee ) { // Ease debugging... // XThis.this refers to the enclosing class instance if ( Interpreter.DEBUG ) Interpreter.debug( "EvalError in scripted interface: " + XThis.this.toString() + ": "+ ee ); throw ee; }
(Domain) Unavailable
(Domain) EvalError
1
                    
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( Capabilities.Unavailable e ) { throw new EvalError( "Defining classes currently requires reflective Accessibility.", block, callstack ); }
(Domain) ParseException
Unknown
1
                    
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(ParseException e) { /* throw new EvalError( "Sourced file: "+sourceFileInfo+" parser Error: " + e.getMessage( DEBUG ), node, callstack ); */ if ( DEBUG ) // show extra "expecting..." info error( e.getMessage(DEBUG) ); // add the source file info and throw again e.setErrorSourceFile( sourceFileInfo ); throw e; }
(Domain) ReflectError
(Domain) EvalError
(Domain) UtilEvalError
Unknown
6
                    
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch(ReflectError e) { throw new EvalError("reflection error: " + e, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch (ReflectError e) { throw new EvalError("No such property: " + value, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( ReflectError e ) { throw new EvalError( "Error invoking Java method: "+e, callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( ReflectError e) { throw new EvalError( "Constructor error: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); }
4
                    
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { throw new UtilEvalError("Error invoking compiled command: "+e ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch(ReflectError e) { throw new UtilEvalError("Field access: "+e); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(ReflectError e) { Interpreter.debug(e.getMessage()); throw new UtilEvalError("No such property: " + propName); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(ReflectError e) { Interpreter.debug("Assignment: " + e.getMessage()); throw new UtilEvalError("No such property: " + propName); }
2
                    
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { // no field, try property acces if ( hasObjectPropertyGetter( object.getClass(), fieldName ) ) return getObjectProperty( object, fieldName ); else throw e; }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { // not a field, try property access if ( hasObjectPropertySetter( object.getClass(), fieldName ) ) return new LHS( object, fieldName ); else throw e; }
(Domain) TokenMgrError
(Domain) EvalError
1
                    
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(TokenMgrError e) { throw new EvalError( "Sourced file: "+sourceFileInfo+" Token Parsing Error: " + e.getMessage(), node, callstack ); }
(Lib) NumberFormatException
Unknown
1
                    
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( NumberFormatException e ) { {if (true) throw createParseException( "Error or number too big for integer type: "+ literal );} }
(Lib) CharacterCodingException
Unknown
1
                    
// in org/gjt/sp/jedit/bufferio/BufferIORequest.java
catch(CharacterCodingException e) { String message = getWriteEncodingErrorMessage( encodingName, encoding, lineSegment, i); IOException wrapping = new CharConversionException(message); wrapping.initCause(e); throw wrapping; }
(Lib) MalformedURLException
(Domain) ClassPathException
1
                    
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch ( MalformedURLException e ) { throw new ClassPathException(" can't find boot jar: "+e); }
(Domain) InterpreterError
(Domain) EvalError
1
                    
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( InterpreterError e ) { e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" internal Error: " + e.getMessage(), node, callstack); }
(Lib) InvocationTargetException
(Domain) TargetError
(Domain) UtilEvalError
5
                    
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch(InvocationTargetException e) { throw new TargetError( "target exception", e.getTargetException(), this, callstack, true); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( InvocationTargetException e ) { String msg = "Method Invocation "+field; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( InvocationTargetException e2 ) { throw new TargetError( "Exception invoking imported object method.", e2, callerInfo, callstack, true/*isNative*/ ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch(InvocationTargetException e) { // No need to wrap this debug Interpreter.debug("The constructor threw an exception:\n\t" + e.getTargetException()); throw new TargetError( "Object constructor", e.getTargetException(), this, callstack, true); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( InvocationTargetException e ) { String msg = "Method Invocation "+name; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); }
3
                    
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(InvocationTargetException e) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( InvocationTargetException e ) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( InvocationTargetException e ) { throw new UtilEvalError( "Error in compiled command: "+e.getTargetException() ); }
(Lib) IllegalAccessException
(Domain) ReflectError
(Domain) UtilEvalError
3
                    
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( IllegalAccessException e ) { throw new ReflectError( "Cannot access method " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " in '" + method.getDeclaringClass() + "' :" + e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalAccessException e) { throw new ReflectError("Can't access field: " + fieldName); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalAccessException e) { throw new ReflectError( "We don't have permission to create an instance." +"Use setAccessibility(true) to enable access." ); }
2
                    
// in org/gjt/sp/jedit/bsh/LHS.java
catch(IllegalAccessException e2) { throw new UtilEvalError("Can't read field: " + field); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( IllegalAccessException e2) { throw new UtilEvalError( "LHS ("+field.getName()+") can't access field: "+e2); }
(Lib) ArrayIndexOutOfBoundsException
(Domain) UtilTargetError
1
                    
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( ArrayIndexOutOfBoundsException e1 ) { throw new UtilTargetError( e1 ); }
(Lib) ArrayStoreException
(Domain) UtilTargetError
1
                    
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( ArrayStoreException e2 ) { throw new UtilTargetError( e2 ); }
(Lib) NoSuchFieldException
(Domain) ReflectError
1
                    
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( NoSuchFieldException e) { throw new ReflectError("No such field: " + fieldName ); }
(Lib) SecurityException
(Domain) UtilTargetError
(Domain) Unavailable
2
                    
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching fields of: "+clas, e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching methods of: "+clas, e ); }
1
                    
// in org/gjt/sp/jedit/bsh/Capabilities.java
catch ( SecurityException e ) { throw new Unavailable("Accessibility unavailable: "+e); }
(Lib) InstantiationException
(Domain) ReflectError
1
                    
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(InstantiationException e) { throw new ReflectError("The class "+clas+" is abstract "); }
(Lib) ClassNotFoundException
(Domain) EvalError
(Lib) ClassNotFoundException
Unknown
1
                    
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( ClassNotFoundException e ) { throw new EvalError( e.getMessage(), this, callstack ); }
1
                    
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
catch ( ClassNotFoundException e ) { throw new ClassNotFoundException( "Designated loader could not find class: "+e ); }
1
                    
// in org/gjt/sp/jedit/JARClassLoader.java
catch (ClassNotFoundException cnf2) { classHash.put(clazz,NO_CLASS); throw cnf2; }
(Lib) IllegalStateException
Unknown
1
                    
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( IllegalStateException e ) { {if (true) throw createParseException( e.getMessage() );} }
(Lib) NegativeArraySizeException
(Domain) TargetError
1
                    
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch( NegativeArraySizeException e1 ) { throw new TargetError( e1, this, callstack ); }
(Lib) NoClassDefFoundError
Unknown
2
                    
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( NoClassDefFoundError e2 ) { throw noClassDefFound( name, e2 ); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( NoClassDefFoundError e ) { throw noClassDefFound( name, e ); }
(Lib) ArithmeticException
(Domain) UtilTargetError
1
                    
// in org/gjt/sp/jedit/bsh/Primitive.java
catch ( ArithmeticException e ) { throw new UtilTargetError( "Arithemetic Exception in binary op", e); }
(Lib) CloneNotSupportedException
(Lib) InternalError
1
                    
// in org/gjt/sp/jedit/textarea/Selection.java
catch(CloneNotSupportedException e) { throw new InternalError("I just drank a whole " + "bottle of cough syrup and I feel " + "funny!"); }

Caught / Thrown Exception

Not all exceptions are thrown AND caught in the same project. The following table gives the exceptions types with respect to this. The lower left hand side sell lists all exceptions thrown but not caught (prevalent for libraries), the upper right-hand side lists all exceptions caught but not thrown (usually coming from external dependencies).

Thrown Not Thrown
Caught
Type Name
(Lib) IllegalArgumentException
(Lib) IOException
(Lib) NullPointerException
(Lib) Exception
(Domain) UtilEvalError
(Domain) UtilTargetError
(Domain) TargetError
(Domain) ClassPathException
(Domain) EvalError
(Domain) Unavailable
(Domain) ParseException
(Domain) ReflectError
(Domain) TextAreaException
(Lib) FileNotFoundException
(Domain) TokenMgrError
(Lib) UnsupportedFlavorException
(Domain) InterpreterError
(Lib) ArrayIndexOutOfBoundsException
(Lib) NoSuchFieldException
(Lib) ClassNotFoundException
(Lib) IllegalStateException
(Lib) UnsupportedCharsetException
(Lib) MalformedInputException
Type Name
(Lib) Throwable
(Lib) PrinterAbortException
(Lib) InterruptedIOException
(Lib) ZipException
(Domain) LookaheadSuccess
(Domain) Abort
(Lib) UnknownHostException
(Lib) BadLocationException
(Lib) AWTException
(Lib) InterruptedException
(Lib) NumberFormatException
(Lib) CharacterCodingException
(Lib) MalformedURLException
(Lib) InvocationTargetException
(Lib) IllegalAccessException
(Lib) ArrayStoreException
(Lib) SecurityException
(Lib) InstantiationException
(Lib) NoSuchMethodException
(Lib) NegativeArraySizeException
(Lib) NoClassDefFoundError
(Lib) ArithmeticException
(Lib) PatternSyntaxException
(Lib) IllegalCharsetNameException
(Lib) OutOfMemoryError
(Lib) CharConversionException
(Lib) UnsupportedEncodingException
(Lib) TooManyListenersException
(Lib) CloneNotSupportedException
(Lib) SAXException
(Lib) NoSuchAlgorithmException
(Lib) SAXParseException
Not caught
Type Name
(Lib) InternalError
(Lib) Error
(Lib) RuntimeException
(Lib) UnsupportedOperationException
(Lib) NoSuchElementException

Methods called in Catch and Finally Blocks

The following shows the methods that are called inside catch blocks (first column) and finally blocks (second column). For each method, we give the number of times it is called in a catch block (second sub-column), and the total number of calls (third sub-column). If the method name is red, it means that it is only called from catch/finally blocks. Hovering over a number triggers showing code snippets from the application code.

Catch Finally
Method Nbr Nbr total
log 272
                  
// in org/jedit/keymap/KeymapManagerImpl.java
catch (IOException e) { Log.log(Log.ERROR, this, e); }
// in org/jedit/keymap/KeymapImpl.java
catch (IOException e) { Log.log(Log.ERROR, this, "Unable to load properties", e); }
// in org/jedit/keymap/KeymapImpl.java
catch (IOException e) { Log.log(Log.ERROR, this, "Unable to save properties", e); }
// in org/jedit/options/OptionGroupPane.java
catch (Throwable t) { Log.log(Log.ERROR, this, "Error initializing option pane:"); Log.log(Log.ERROR, this, t); }
// in org/jedit/options/OptionGroupPane.java
catch (Throwable t) { Log.log(Log.ERROR, this, "Error saving options:"); Log.log(Log.ERROR, this, t); }
// in org/gjt/sp/jedit/print/BufferPrintable.java
catch(PrinterAbortException ae) { Log.log(Log.DEBUG,this,ae); }
// in org/gjt/sp/jedit/print/BufferPrintable.java
catch(Exception e) { Log.log(Log.ERROR,this,e); final String[] args = { e.toString() }; SwingUtilities.invokeLater(new Runnable() { public void run() { GUIUtilities.error(view,"print-error",args); } }); }
// in org/gjt/sp/jedit/print/BufferPrinter1_4.java
catch(Exception e) { Log.log(Log.ERROR,BufferPrinter1_4.class,e); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(ZipException e) { Log.log(Log.ERROR,this,e); GUIUtilities.error(null,"plugin-error-download",new Object[]{""}); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(IOException io) { Log.log(Log.ERROR,this,io); String[] args = { io.getMessage() }; GUIUtilities.error(null,"ioerror",args); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(Exception e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(IOException io) { Log.log(Log.ERROR,this,io); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(FileNotFoundException e) { Log.log(Log.ERROR,this,e); SwingUtilities.invokeLater(new Runnable() { public void run() { GUIUtilities.error(null,"plugin-error-download",new Object[]{""}); } }); return null; }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(final IOException io) { Log.log(Log.ERROR,this,io); SwingUtilities.invokeLater(new Runnable() { public void run() { String[] args = { io.getMessage() }; GUIUtilities.error(null,"plugin-error-download",args); } }); return null; }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(Exception e) { Log.log(Log.ERROR,this,e); return null; }
// in org/gjt/sp/jedit/pluginmgr/InstallPanel.java
catch (Exception e) { Log.log(Log.WARNING, this, "Loading Pluginset failed:" + e.getMessage()); return false; }
// in org/gjt/sp/jedit/pluginmgr/InstallPanel.java
catch (ParseException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
catch (Exception e) { Log.log(Log.WARNING, this, "Exception thrown loading: " + jarName, e); }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
catch (Exception e) { Log.log(Log.ERROR, this, "Loading Pluginset Error", e); return false; }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
catch (Exception e) { Log.log(Log.ERROR, this, "Saving State Error", e); }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
catch (IOException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
catch (IOException e1) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
catch (Exception ex) { Log.log(Log.ERROR, this, "ManagePanel HelpButton Update", ex); }
// in org/gjt/sp/jedit/pluginmgr/PluginListHandler.java
catch (Exception e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/pluginmgr/MirrorListHandler.java
catch (Exception e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch (Exception e) { Log.log(Log.MESSAGE, this, "No cached copy. Downloading from mirror. "); downloadIt = true; }
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch (Exception e) { Log.log(Log.ERROR, this, "readpluginlist: error", e); if (cachedURL.startsWith("file:///")) { Log.log(Log.DEBUG, this, "Unable to read plugin list, deleting cached file and try again"); new File(cachedURL.substring(8)).delete(); if (allowRetry) { plugins.clear(); pluginHash.clear(); pluginSets.clear(); readPluginList(false); } } }
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch(java.net.UnknownHostException e) { GUIUtilities.error(jEdit.getActiveView() , "plugin-manager.list-download.disconnected" , new Object[]{e.getMessage()}); Log.log (Log.ERROR, this, "CacheRemotePluginList: error", e); }
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch (Exception e) { Log.log (Log.ERROR, this, "CacheRemotePluginList: error", e); }
// in org/gjt/sp/jedit/gui/PingPongList.java
catch (UnsupportedFlavorException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/gui/PingPongList.java
catch (IOException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/gui/FontSelectorDialog.java
catch(Exception e) { Log.log(Log.ERROR,this,"Broken Java implementation!"); /* Log.log(Log.ERROR,this,"Using deprecated Toolkit.getFontList()"); */ Log.log(Log.ERROR,this,e); /* fonts = getToolkit().getFontList(); */ fonts = new String[] { "Broken Java implementation!" }; }
// in org/gjt/sp/jedit/gui/OptionsDialog.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Error initializing options:", t); }
// in org/gjt/sp/jedit/gui/OptionsDialog.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Error saving options:", t); }
// in org/gjt/sp/jedit/gui/TipOfTheDay.java
catch(Exception e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/gui/AboutDialog.java
catch(Exception exc) { Log.log(Log.ERROR, this, exc); }
// in org/gjt/sp/jedit/gui/tray/JTrayIconManager.java
catch (AWTException e) { Log.log(Log.ERROR, JEditSwingTrayIcon.class, "Unable to add Tray icon", e); trayIcon = null; return; }
// in org/gjt/sp/jedit/gui/statusbar/LastModifiedWidgetFactory.java
catch (IOException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/gui/KeyEventTranslator.java
catch(Exception e) { Log.log(Log.ERROR,KeyEventTranslator.class, "Invalid key code: " + code); return KeyEvent.VK_UNDEFINED; }
// in org/gjt/sp/jedit/gui/DockableWindowManagerImpl.java
catch (IOException e) { Log.log(Log.ERROR, this, e, e); return false; }
// in org/gjt/sp/jedit/gui/SplashScreen.java
catch(Exception e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/gui/SplashScreen.java
catch(InterruptedException ie) { Log.log(Log.ERROR,this,ie); }
// in org/gjt/sp/jedit/gui/SplashScreen.java
catch(InterruptedException ie) { Log.log(Log.ERROR,this,ie); }
// in org/gjt/sp/jedit/gui/GrabKeyDialog.java
catch(Exception e) { Log.log(Log.ERROR,GrabKeyDialog.class,e); }
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
catch(CharacterCodingException e) { // It seems to be made by an old version of jEdit. in.close(); Log.log(Log.MESSAGE,HistoryModel.class, "Failed to load history with UTF-8." + " Fallbacking to the system default encoding."); in = new BufferedReader(new FileReader(history)); models.putAll(loadFromReader(in)); }
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
catch(IOException io) { Log.log(Log.ERROR,HistoryModel.class,io); }
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
catch(IOException io) { Log.log(Log.ERROR,HistoryModel.class,io); }
// in org/gjt/sp/jedit/gui/DockableWindowFactory.java
catch(IOException e) { Log.log(Log.ERROR,DockableWindowManager.class,e); }
// in org/gjt/sp/jedit/gui/DockableWindowFactory.java
catch (Exception e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/gui/DockableWindowFactory.java
catch(UtilEvalError e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/ActionListHandler.java
catch (Exception e) { Log.log(Log.ERROR,this, e); }
// in org/gjt/sp/jedit/ServiceManager.java
catch (IOException ioe) { Log.log(Log.ERROR, ServiceManager.class, ioe); }
// in org/gjt/sp/jedit/help/HelpTOCPanel.java
catch(FileNotFoundException e) { /* it is acceptable only for the API TOC : the user can choose not to install them */ if("api/toc.xml".equals(path)) { Log.log(Log.NOTICE,this, "The API docs for jEdit will not be available (reinstall jEdit if you want them)"); root.add( createNode("http://www.jedit.org/api/overview-summary.html", jEdit.getProperty("helpviewer.toc.online-apidocs"))); } else { Log.log(Log.ERROR,this,e); } }
// in org/gjt/sp/jedit/help/HelpTOCPanel.java
catch(IOException e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/help/HelpSearchPanel.java
catch(Exception e) { index = null; Log.log(Log.ERROR,this,e); GUIUtilities.error(helpViewer.getComponent(),"helpviewer.search.error", new String[] { e.toString() }); }
// in org/gjt/sp/jedit/help/HelpViewer.java
catch(MalformedURLException mu) { Log.log(Log.ERROR,this,mu); // what to do? }
// in org/gjt/sp/jedit/help/HelpViewer.java
catch(IOException io) { Log.log(Log.ERROR,this,io); String[] args = { _url.toString(), io.toString() }; GUIUtilities.error(HelpViewer.this,"read-error",args); }
// in org/gjt/sp/jedit/help/HelpViewer.java
catch(MalformedURLException mf) { Log.log(Log.ERROR,this,mf); String[] args = { url, mf.getMessage() }; GUIUtilities.error(this,"badurl",args); }
// in org/gjt/sp/jedit/help/HelpIndex.java
catch(Throwable e) { Log.log(Log.ERROR,this,"Error indexing editor help"); Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/help/HelpIndex.java
catch(Throwable e) { Log.log(Log.ERROR,this,"Error indexing JAR: " + jars[i].getPath()); Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/EditServer.java
catch(IOException io) { /* on some Windows versions, connections to localhost * fail if the network is not running. To avoid * confusing newbies with weird error messages, log * errors that occur while starting the server * as NOTICE, not ERROR */ Log.log(Log.NOTICE,this,io); }
// in org/gjt/sp/jedit/EditServer.java
catch(Exception e) { if(!abort) Log.log(Log.ERROR,this,e); abort = true; }
// in org/gjt/sp/jedit/EditServer.java
catch(org.gjt.sp.jedit.bsh.UtilEvalError e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/EditServer.java
catch(org.gjt.sp.jedit.bsh.UtilEvalError e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/EditBus.java
catch (InterruptedException ie) { interrupted = true; Log.log(Log.ERROR, EditBus.class, ie); }
// in org/gjt/sp/jedit/EditBus.java
catch (InvocationTargetException ite) { Log.log(Log.ERROR, EditBus.class, ite); }
// in org/gjt/sp/jedit/EditBus.java
catch (InvocationTargetException t) { Log.log(Log.ERROR,EditBus.class,"Exception" + " while sending message on EditBus:"); Log.log(Log.ERROR, EditBus.class, t.getCause()); }
// in org/gjt/sp/jedit/EditBus.java
catch(Throwable t) { Log.log(Log.ERROR,EditBus.class,"Exception" + " while sending message on EditBus:"); Log.log(Log.ERROR,EditBus.class,t); }
// in org/gjt/sp/jedit/Registers.java
catch (IOException e) { Log.log(Log.ERROR, Registers.class, e); }
// in org/gjt/sp/jedit/Registers.java
catch (UnsupportedFlavorException e) { Log.log(Log.ERROR, Registers.class, e); }
// in org/gjt/sp/jedit/Registers.java
catch (IOException e) { Log.log(Log.ERROR, Registers.class, e); }
// in org/gjt/sp/jedit/Registers.java
catch (UnsupportedFlavorException e) { Log.log(Log.ERROR, Registers.class, e); }
// in org/gjt/sp/jedit/Registers.java
catch (IOException e) { Log.log(Log.ERROR, Registers.class, e); }
// in org/gjt/sp/jedit/Registers.java
catch(Exception e) { Log.log(Log.NOTICE,this,e); return null; }
// in org/gjt/sp/jedit/Registers.java
catch (UnsupportedFlavorException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/Registers.java
catch (IOException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/BeanShellFacade.java
catch(Throwable e) { Log.log(Log.ERROR,BeanShellFacade.class,e); handleException(param,null,e); }
// in org/gjt/sp/jedit/Mode.java
catch(PatternSyntaxException re) { Log.log(Log.ERROR,this,"Invalid filename/firstline" + " globs in mode " + name); Log.log(Log.ERROR,this,re); }
// in org/gjt/sp/jedit/Mode.java
catch(Exception e) { Log.log(Log.ERROR,this,"Bad indent rule " + prop + '=' + value + ':'); Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/Mode.java
catch(Exception e) { Log.log(Log.ERROR,this,"Bad indent rule " + prop + '=' + value + ':'); Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/io/UrlVFS.java
catch(MalformedURLException mu) { Log.log(Log.ERROR,this,mu); String[] args = { mu.getMessage() }; VFSManager.error(comp,path,"ioerror.badurl",args); return null; }
// in org/gjt/sp/jedit/io/UrlVFS.java
catch(MalformedURLException mu) { Log.log(Log.ERROR,this,mu); String[] args = { mu.getMessage() }; VFSManager.error(comp,path,"ioerror.badurl",args); return null; }
// in org/gjt/sp/jedit/io/UrlVFS.java
catch (MalformedURLException mue) { Log.log(Log.ERROR,this,mue); return super.getFilePath(vfsPath); }
// in org/gjt/sp/jedit/io/CopyFileWorker.java
catch (IOException e) { Log.log(Log.ERROR, this, e, e); }
// in org/gjt/sp/jedit/io/CopyFileWorker.java
catch (IOException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/io/CopyFileWorker.java
catch (InterruptedException e) { Log.log(Log.WARNING, this, "Copy was interrupted"); }
// in org/gjt/sp/jedit/io/XMLEncodingDetector.java
catch(IllegalCharsetNameException e) { Log.log(Log.WARNING, XMLEncodingDetector.class, "XML PI specifies illegal encoding: " + encoding, e); }
// in org/gjt/sp/jedit/io/LocalFileSaveTask.java
catch (IOException e) { Log.log(Log.ERROR, this, e, e); }
// in org/gjt/sp/jedit/io/VFSManager.java
catch (InvocationTargetException ite) { Log.log(Log.ERROR, ErrorDisplayer.class, ite); }
// in org/gjt/sp/jedit/io/VFS.java
catch(IOException e) { Log.log(Log.ERROR,this,e); // may be not binary... }
// in org/gjt/sp/jedit/io/VFS.java
catch(PatternSyntaxException e) { Log.log(Log.ERROR,VFS.class,"Invalid regular expression: " + glob); Log.log(Log.ERROR,VFS.class,e); }
// in org/gjt/sp/jedit/GUIUtilities.java
catch(Exception e) { try { url = new URL(defaultIconPath + iconName); } catch(Exception ex) { Log.log(Log.ERROR,GUIUtilities.class, "Icon not found: " + iconName); Log.log(Log.ERROR,GUIUtilities.class,ex); return null; } }
// in org/gjt/sp/jedit/GUIUtilities.java
catch(Exception ex) { Log.log(Log.ERROR,GUIUtilities.class, "Icon not found: " + iconName); Log.log(Log.ERROR,GUIUtilities.class,ex); return null; }
// in org/gjt/sp/jedit/GUIUtilities.java
catch(Exception e) { /* Workaround for OS X bug. */ Log.log(Log.ERROR,GUIUtilities.class,e); }
// in org/gjt/sp/jedit/search/SearchBar.java
catch(Exception e) { Log.log(Log.DEBUG,this,e); // invalid regexp, ignore // return true to avoid annoying beeping while // typing a re ret = true; }
// in org/gjt/sp/jedit/search/AllBufferSet.java
catch(Exception e) { Log.log(Log.ERROR,this,e); return null; }
// in org/gjt/sp/jedit/search/HyperSearchRequest.java
catch(final Exception e) { Log.log(Log.ERROR,this,e); ThreadUtilities.runInDispatchThread(new Runnable() { public void run() { SearchAndReplace.handleError(view,e); } }); }
// in org/gjt/sp/jedit/search/DirectoryListSet.java
catch(Exception e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { // ok, this one seems to confuse newbies // endlessly, so log it as NOTICE, not // ERROR Log.log(Log.NOTICE,jEdit.class,"An error occurred" + " while connecting to the jEdit server instance."); Log.log(Log.NOTICE,jEdit.class,"This probably means that" + " jEdit crashed and/or exited abnormally"); Log.log(Log.NOTICE,jEdit.class,"the last time it was run."); Log.log(Log.NOTICE,jEdit.class,"If you don't" + " know what this means, don't worry."); Log.log(Log.NOTICE,jEdit.class,e); }
// in org/gjt/sp/jedit/jEdit.java
catch(UtilEvalError e) { Log.log(Log.ERROR,jEdit.class,e); }
// in org/gjt/sp/jedit/jEdit.java
catch(IOException io) { Log.log(Log.ERROR,jEdit.class,io); }
// in org/gjt/sp/jedit/jEdit.java
catch(SecurityException se) { Log.log(Log.ERROR,jEdit.class,se); }
// in org/gjt/sp/jedit/jEdit.java
catch(IOException io) { Log.log(Log.ERROR,jEdit.class,io); }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { Log.log(Log.ERROR,jEdit.class, "Error while loading system properties!"); Log.log(Log.ERROR,jEdit.class, "One of the following property files could not be loaded:\n" + "- jedit.props\n" + "- jedit_gui.props\n" + "- jedit_en.props\n" + "jedit.jar is probably corrupt."); Log.log(Log.ERROR,jEdit.class,e); System.exit(1); }
// in org/gjt/sp/jedit/jEdit.java
catch(FileNotFoundException fnf) { Log.log(Log.DEBUG,jEdit.class,fnf); }
// in org/gjt/sp/jedit/jEdit.java
catch(IOException e) { Log.log(Log.ERROR,jEdit.class,"Cannot load site snippet " + snippet); Log.log(Log.ERROR,jEdit.class,e); }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { Log.log(Log.ERROR,jEdit.class,e); }
// in org/gjt/sp/jedit/jEdit.java
catch (IOException e) { if (getBooleanProperty("lang.usedefaultlocale")) { // if it is the default locale, it is not an error Log.log(Log.ERROR, jEdit.class, "Unable to load language", e); } }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { Log.log(Log.ERROR,jEdit.class,e); }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { Log.log(Log.ERROR, jEdit.class, "Window " + iWindow + ": " + window, e); break; }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { Log.log(Log.ERROR,jEdit.class,e); }
// in org/gjt/sp/jedit/jEdit.java
catch(IOException e) { Log.log(Log.ERROR,jEdit.class,e); }
// in org/gjt/sp/jedit/Buffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer undo event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/Buffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer undo event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/Buffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer begin redo event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/Buffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer end redo event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/Abbrevs.java
catch(Exception e) { Log.log(Log.ERROR,Abbrevs.class,"Error while saving " + file1); Log.log(Log.ERROR,Abbrevs.class,e); }
// in org/gjt/sp/jedit/Abbrevs.java
catch(Exception e) { Log.log(Log.ERROR,Abbrevs.class,"Error while loading " + file); Log.log(Log.ERROR,Abbrevs.class,e); }
// in org/gjt/sp/jedit/Abbrevs.java
catch(Exception e) { Log.log(Log.ERROR,Abbrevs.class,"Error while loading default.abbrevs"); Log.log(Log.ERROR,Abbrevs.class,e); }
// in org/gjt/sp/jedit/BufferHistory.java
catch(IOException e) { Log.log(Log.ERROR,BufferHistory.class,e); }
// in org/gjt/sp/jedit/BufferHistory.java
catch(Exception e) { Log.log(Log.ERROR,BufferHistory.class,e); }
// in org/gjt/sp/jedit/BufferHistory.java
catch (NumberFormatException e) { Log.log(Log.ERROR, this, "Unable to parse caret position " + charData); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/options/AppearanceOptionPane.java
catch(IOException io) { Log.log(Log.ERROR,this,io); }
// in org/gjt/sp/jedit/options/PluginManagerOptionPane.java
catch (final Exception ex) { if (download) { Log.log(Log.ERROR,this,ex); ThreadUtilities.runInDispatchThread(new Runnable() { public void run() { GUIUtilities.error(PluginManagerOptionPane.this, "ioerror",new String[] { ex.toString() }); } }); }
// in org/gjt/sp/jedit/options/PluginManagerOptionPane.java
catch (IOException e) { Log.log(Log.ERROR,this, "Unable to write cached mirror list : " + mirrorList); }
// in org/gjt/sp/jedit/options/GeneralOptionPane.java
catch (NumberFormatException e) { Log.log(Log.WARNING, this, "hypersearchResultsWarning: " + hypersearchResultsWarning.getText() + " is not a valid value for this option"); }
// in org/gjt/sp/jedit/options/ToolBarOptionPane.java
catch(MalformedURLException mf) { Log.log(Log.ERROR,this,mf); }
// in org/gjt/sp/jedit/options/ToolBarOptionPane.java
catch(MalformedURLException mf) { Log.log(Log.ERROR,this,mf); }
// in org/gjt/sp/jedit/options/ViewOptionPane.java
catch (IllegalArgumentException e) { Log.log(Log.ERROR, this, e); scope = BufferSet.Scope.global; }
// in org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
catch (FileNotFoundException e) { Log.log(Log.WARNING,this,"Unable to save " + e.getMessage()); }
// in org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); // Incomplete autosave file should not exist. if(out != null) { try { out.close(); out = null; vfs._delete(session,path,view); } catch(IOException ioe) { Log.log(Log.ERROR,this,ioe); } } }
// in org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
catch(IOException ioe) { Log.log(Log.ERROR,this,ioe); }
// in org/gjt/sp/jedit/bufferio/MarkersSaveRequest.java
catch(IOException io) { Log.log(Log.ERROR,this,io); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch (FileNotFoundException e) { Log.log(Log.ERROR,this,"Unable to save buffer " + e); String[] pp = { e.getMessage() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(UnsupportedCharsetException e) { Log.log(Log.ERROR, this, e, e); String[] pp = { e.getCharsetName() }; VFSManager.error(view,path,"ioerror.unsupported-encoding-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); Object[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(OutOfMemoryError oom) { Log.log(Log.ERROR,this,oom); VFSManager.error(view,path,"out-of-memory-error",null); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(IOException e) { Log.log(Log.NOTICE, this , path + ": Reopening to rewind the stream"); // Reopen the stream because the mark has been // invalidated while previous reading. markedStream.close(); InputStream in = getNakedStream(); try { if(gzipped) { in = new GZIPInputStream(in); } BufferedInputStream result = AutoDetection.getMarkedStream(in); in = null; return result; } finally { IOUtilities.closeQuietly(in); } }
// in org/gjt/sp/jedit/BeanShell.java
catch(Throwable e) { Log.log(Log.ERROR,BeanShell.class,e); bsh.handleException(view,null,e); }
// in org/gjt/sp/jedit/BeanShell.java
catch(Throwable e) { Log.log(Log.ERROR,BeanShell.class,e); bsh.handleException(view,path,e); }
// in org/gjt/sp/jedit/BeanShell.java
catch(Throwable e) { Log.log(Log.ERROR,BeanShell.class,e); bsh.handleException(view,path,e); }
// in org/gjt/sp/jedit/PerspectiveManager.java
catch(IOException e) { Log.log(Log.ERROR,PerspectiveManager.class,e); }
// in org/gjt/sp/jedit/PerspectiveManager.java
catch(IOException io) { Log.log(Log.ERROR,PerspectiveManager.class,"Error saving " + perspectiveXML); Log.log(Log.ERROR,PerspectiveManager.class,io); }
// in org/gjt/sp/jedit/bufferset/BufferSetManager.java
catch (IllegalArgumentException e) { Log.log(Log.ERROR, this, e); scope = BufferSet.Scope.global; }
// in org/gjt/sp/jedit/JEditKillRing.java
catch (OutOfMemoryError oem) { Log.log(Log.ERROR, this, "Unable to load entire Killring, too low memory, increase your jvm max heap size"); String start = jEdit.getProperty("killring.start"); String deleteKillRing = jEdit.getProperty("killring.delete"); String stop = jEdit.getProperty("killring.stop"); int selected = GUIUtilities.option(null, "killring.load-memoryerror", null, JOptionPane.ERROR_MESSAGE, new Object[]{start, deleteKillRing, stop}, start); if (selected == 2) { System.exit(-1); } else if (selected == 1) { new File(MiscUtilities.constructPath( jEdit.getSettingsDirectory(),"killring.xml")).delete(); return; } }
// in org/gjt/sp/jedit/JEditKillRing.java
catch (IOException ioe) { Log.log(Log.ERROR, this, ioe); }
// in org/gjt/sp/jedit/JEditKillRing.java
catch(Exception e) { Log.log(Log.ERROR,KillRing.class,e); }
// in org/gjt/sp/jedit/JEditKillRing.java
catch (Exception e) { Log.log(Log.ERROR, this, "Failed to get character from PI" + "\"" + target + "\"" + " with \"" + data + "\"" + ": " + e); return; }
// in org/gjt/sp/jedit/JEditBeanShellAction.java
catch(Throwable e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/JEditBeanShellAction.java
catch(Throwable e) { Log.log(Log.ERROR,this,e); // dialogs fuck things up if a menu is visible, etc! //new BeanShellErrorDialog(view,e); // so that in the future we don't see streams of // exceptions isSelected = null; return false; }
// in org/gjt/sp/jedit/JEditBeanShellAction.java
catch(UtilEvalError err) { Log.log(Log.ERROR,this,err); }
// in org/gjt/sp/jedit/JEditRegisterSaver.java
catch (IOException ioe) { Log.log(Log.ERROR, Registers.class, ioe); }
// in org/gjt/sp/jedit/JEditRegisterSaver.java
catch(Exception e) { Log.log(Log.ERROR,Registers.class,e); }
// in org/gjt/sp/jedit/JARClassLoader.java
catch(IOException io) { Log.log(Log.ERROR,this,io); return null; }
// in org/gjt/sp/jedit/JARClassLoader.java
catch(IOException io) { Log.log(Log.ERROR,this,io); return null; }
// in org/gjt/sp/jedit/JARClassLoader.java
catch(IOException io) { Log.log(Log.ERROR,this,io); throw new ClassNotFoundException(clazz); }
// in org/gjt/sp/jedit/textarea/TextAreaTransferHandler.java
catch(Exception e) { Log.log(Log.ERROR,this,e); returnValue = false; }
// in org/gjt/sp/jedit/textarea/TextAreaTransferHandler.java
catch(Exception e) { Log.log(Log.DEBUG,this,"exportDone in sameTextArea"); Log.log(Log.DEBUG,this,e); }
// in org/gjt/sp/jedit/textarea/ExtensionManager.java
catch(Exception e) { Log.log(Log.ERROR,this,"Error repainting line" + " range {" + firstLine + ',' + lastLine + "}:"); Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/textarea/ExtensionManager.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); // remove it so editor can continue // functioning iter.remove(); }
// in org/gjt/sp/jedit/textarea/TextArea.java
catch(TooManyListenersException e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/textarea/TextArea.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/textarea/TextArea.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/textarea/TextArea.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/textarea/TextArea.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/textarea/TextArea.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/textarea/StandaloneTextArea.java
catch (IOException e) { Log.log(Log.ERROR, TextArea.class, e); }
// in org/gjt/sp/jedit/menu/EnhancedCheckBoxMenuItem.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); return false; }
// in org/gjt/sp/jedit/menu/RecentFilesProvider.java
catch(PatternSyntaxException re) { Log.log(Log.ERROR,this,re.getMessage()); }
// in org/gjt/sp/jedit/browser/DeleteBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/DeleteBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/BrowserView.java
catch (IOException e) { Log.log(Log.ERROR, this, e, e); }
// in org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); String[] pp = { io.toString() }; VFSManager.error(browser, path,"ioerror.directory-error",pp); }
// in org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); String[] pp = { io.toString() }; VFSManager.error(browser, path,"ioerror.directory-error",pp); }
// in org/gjt/sp/jedit/browser/RenameBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/RenameBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/MkDirBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); args[0] = io.toString(); VFSManager.error(browser, path,"ioerror",args); }
// in org/gjt/sp/jedit/browser/MkDirBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); args[0] = io.toString(); VFSManager.error(browser, path,"ioerror",args); }
// in org/gjt/sp/jedit/browser/VFSBrowser.java
catch (InterruptedException e) { Log.log(Log.ERROR, this, e, e); }
// in org/gjt/sp/jedit/browser/VFSBrowser.java
catch(UtilEvalError err) { Log.log(Log.ERROR,this,err); }
// in org/gjt/sp/jedit/browser/VFSBrowser.java
catch(UtilEvalError err) { Log.log(Log.ERROR,this,err); }
// in org/gjt/sp/jedit/BeanShellAction.java
catch(Throwable e) { Log.log(Log.ERROR,this,e); new BeanShellErrorDialog(view,e); }
// in org/gjt/sp/jedit/BeanShellAction.java
catch(Throwable e) { Log.log(Log.ERROR,this,e); // dialogs fuck things up if a menu is visible, etc! //new BeanShellErrorDialog(view,e); // so that in the future we don't see streams of // exceptions isSelected = null; return false; }
// in org/gjt/sp/jedit/BeanShellAction.java
catch(UtilEvalError err) { Log.log(Log.ERROR,this,err); }
// in org/gjt/sp/jedit/syntax/ModeProvider.java
catch (SAXException saxe) { Log.log(Log.ERROR, this, saxe); return; }
// in org/gjt/sp/jedit/PluginJAR.java
catch (IllegalArgumentException e) { Log.log(Log.ERROR, PluginJAR.class, className + " has an invalid dependency: " + dep); continue; }
// in org/gjt/sp/jedit/PluginJAR.java
catch (IllegalArgumentException e) { Log.log(Log.ERROR,this,name + " has an invalid" + " dependency: " + dep); ok = false; continue; }
// in org/gjt/sp/jedit/PluginJAR.java
catch (Throwable t) { breakPlugin(); Log.log(Log.ERROR,this,"Error while starting plugin " + className); Log.log(Log.ERROR,this,t); String[] args = { t.toString() }; jEdit.pluginError(path,"plugin-error.start-error",args); return; }
// in org/gjt/sp/jedit/PluginJAR.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Error while " + "stopping plugin:"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/PluginJAR.java
catch(IOException io) { Log.log(Log.ERROR,PluginJAR.class,io); return null; }
// in org/gjt/sp/jedit/PluginJAR.java
catch(IOException io) { Log.log(Log.ERROR,PluginJAR.class,io); IOUtilities.closeQuietly(dout); new File(jarCachePath).delete(); }
// in org/gjt/sp/jedit/PluginJAR.java
catch(IOException io) { Log.log(Log.ERROR,this,"Cannot load" + " plugin " + path); Log.log(Log.ERROR,this,io); String[] args = { io.toString() }; jEdit.pluginError(path,"plugin-error.load-error",args); uninit(false); }
// in org/gjt/sp/jedit/PluginJAR.java
catch(IOException io) { Log.log(Log.ERROR,this,io); }
// in org/gjt/sp/jedit/PluginJAR.java
catch(Throwable t) { breakPlugin(); Log.log(Log.ERROR,PluginJAR.this, "Error while starting plugin " + plugin.getClassName()); Log.log(Log.ERROR,PluginJAR.this,t); String[] args = { t.toString() }; jEdit.pluginError(path, "plugin-error.start-error",args); }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { Log.log(Log.ERROR, Macros.class, e); return; }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { Log.log(Log.ERROR, Macros.class, e); macroHandlers.remove(handler); }
// in org/gjt/sp/jedit/ServiceListHandler.java
catch (Exception e) { Log.log(Log.ERROR, e, e); }
// in org/gjt/sp/jedit/JEditActionSet.java
catch(IOException e) { Log.log(Log.ERROR,this,uri,e); }
// in org/gjt/sp/util/StandardUtilities.java
catch (NoSuchAlgorithmException e) { Log.log(Log.ERROR, StandardUtilities.class, "Can't Calculate MD5 hash!", e); return dummy; }
// in org/gjt/sp/util/ThreadUtilities.java
catch (InterruptedException e) { Log.log(Log.ERROR, ThreadUtilities.class, e); }
// in org/gjt/sp/util/PropertiesBean.java
catch (Exception e) { // These exceptions shouldn't occur during normal runtime, // so we catch them and print an error message. Users of this // class should fix these before releasing the code. Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/util/PropertiesBean.java
catch (Exception e) { // These exceptions shouldn't occur during normal runtime, // so we catch them and print an error message. Users of this // class should fix these before releasing the code. Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/util/PropertiesBean.java
catch (Exception e) { // These exceptions shouldn't occur during normal runtime, // so we catch them and print an error message. Users of this // class should fix these before releasing the code. Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/util/WorkThreadPool.java
catch(InterruptedException ie) { Log.log(Log.ERROR,this,ie); }
// in org/gjt/sp/util/WorkThreadPool.java
catch(Exception e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/util/WorkThreadPool.java
catch(Throwable t) { Log.log(Log.ERROR,WorkThread.class,"Exception " + "in AWT thread:"); Log.log(Log.ERROR,WorkThread.class,t); }
// in org/gjt/sp/util/Task.java
catch (Throwable t) { Log.log(Log.ERROR, this, t); }
// in org/gjt/sp/util/SyntaxUtilities.java
catch(Exception e) { Log.log(Log.ERROR,StandardUtilities.class,e); }
// in org/gjt/sp/util/IOUtilities.java
catch (IOException ioe) { Log.log(Log.WARNING, IOUtilities.class, "Error moving file: " + ioe + " : " + ioe.getMessage()); }
// in org/gjt/sp/util/WorkThread.java
catch(InterruptedException ie) { Log.log(Log.ERROR,this,ie); }
// in org/gjt/sp/util/WorkThread.java
catch(Abort a) { Log.log(Log.ERROR,WorkThread.class,"Unhandled abort", a); }
// in org/gjt/sp/util/WorkThread.java
catch(Throwable t) { Log.log(Log.ERROR,WorkThread.class,"Exception in work thread: ", t); }
// in org/gjt/sp/util/XMLUtilities.java
catch(SAXParseException se) { int line = se.getLineNumber(); Log.log(Log.ERROR,XMLUtilities.class, "while parsing from " + in + ": SAXParseException: line " + line + ": " , se); return true; }
// in org/gjt/sp/util/XMLUtilities.java
catch(SAXException e) { Log.log(Log.ERROR,XMLUtilities.class,e); return true; }
// in org/gjt/sp/util/XMLUtilities.java
catch (Exception e) { Log.log(Log.ERROR,XMLUtilities.class, "Error while opening " + test + ':'); Log.log(Log.ERROR,XMLUtilities.class,e); }
602
error 62
                  
// in org/gjt/sp/jedit/print/BufferPrintable.java
catch(Exception e) { Log.log(Log.ERROR,this,e); final String[] args = { e.toString() }; SwingUtilities.invokeLater(new Runnable() { public void run() { GUIUtilities.error(view,"print-error",args); } }); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(ZipException e) { Log.log(Log.ERROR,this,e); GUIUtilities.error(null,"plugin-error-download",new Object[]{""}); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(IOException io) { Log.log(Log.ERROR,this,io); String[] args = { io.getMessage() }; GUIUtilities.error(null,"ioerror",args); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(FileNotFoundException e) { Log.log(Log.ERROR,this,e); SwingUtilities.invokeLater(new Runnable() { public void run() { GUIUtilities.error(null,"plugin-error-download",new Object[]{""}); } }); return null; }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(final IOException io) { Log.log(Log.ERROR,this,io); SwingUtilities.invokeLater(new Runnable() { public void run() { String[] args = { io.getMessage() }; GUIUtilities.error(null,"plugin-error-download",args); } }); return null; }
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch(java.net.UnknownHostException e) { GUIUtilities.error(jEdit.getActiveView() , "plugin-manager.list-download.disconnected" , new Object[]{e.getMessage()}); Log.log (Log.ERROR, this, "CacheRemotePluginList: error", e); }
// in org/gjt/sp/jedit/help/HelpSearchPanel.java
catch(Exception e) { index = null; Log.log(Log.ERROR,this,e); GUIUtilities.error(helpViewer.getComponent(),"helpviewer.search.error", new String[] { e.toString() }); }
// in org/gjt/sp/jedit/help/HelpViewer.java
catch(IOException io) { Log.log(Log.ERROR,this,io); String[] args = { _url.toString(), io.toString() }; GUIUtilities.error(HelpViewer.this,"read-error",args); }
// in org/gjt/sp/jedit/help/HelpViewer.java
catch(MalformedURLException mf) { Log.log(Log.ERROR,this,mf); String[] args = { url, mf.getMessage() }; GUIUtilities.error(this,"badurl",args); }
// in org/gjt/sp/jedit/bsh/This.java
catch( EvalError e ) { declaringInterpreter.error( "Exception in runnable:" + e ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(ParseException e) { error("Parser Error: " + e.getMessage(DEBUG)); if ( DEBUG ) e.printStackTrace(); if(!interactive) eof = true; parser.reInitInput(in); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(InterpreterError e) { error("Internal Error: " + e.getMessage()); e.printStackTrace(); if(!interactive) eof = true; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(TargetError e) { error("// Uncaught Exception: " + e ); if ( e.inNativeCode() ) e.printStackTrace( DEBUG, err ); if(!interactive) eof = true; setu("$_e", e.getTarget()); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch (EvalError e) { if ( interactive ) error( "EvalError: "+e.toString() ); else error( "EvalError: "+e.getMessage() ); if(DEBUG) e.printStackTrace(); if(!interactive) eof = true; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(Exception e) { error("Unknown error: " + e); if ( DEBUG ) e.printStackTrace(); if(!interactive) eof = true; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(TokenMgrError e) { error("Error parsing input: " + e); /* We get stuck in infinite loops here when unicode escapes fail. Must re-init the char stream reader (ASCII_UCodeESC_CharStream.java) */ parser.reInitTokenInput( in ); if(!interactive) eof = true; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(ParseException e) { /* throw new EvalError( "Sourced file: "+sourceFileInfo+" parser Error: " + e.getMessage( DEBUG ), node, callstack ); */ if ( DEBUG ) // show extra "expecting..." info error( e.getMessage(DEBUG) ); // add the source file info and throw again e.setErrorSourceFile( sourceFileInfo ); throw e; }
// in org/gjt/sp/jedit/bsh/JThis.java
catch(EvalError e) { declaringInterpreter.error( "local event hander method invocation error:" + e ); }
// in org/gjt/sp/jedit/bsh/JThis.java
catch(EvalError e) { declaringInterpreter.error( "local event hander method invocation error:" + e ); }
// in org/gjt/sp/jedit/bsh/JThis.java
catch(EvalError e) { declaringInterpreter.error( "local event handler imageUpdate: method invocation error:" + e ); }
// in org/gjt/sp/jedit/io/UrlVFS.java
catch(MalformedURLException mu) { Log.log(Log.ERROR,this,mu); String[] args = { mu.getMessage() }; VFSManager.error(comp,path,"ioerror.badurl",args); return null; }
// in org/gjt/sp/jedit/io/UrlVFS.java
catch(MalformedURLException mu) { Log.log(Log.ERROR,this,mu); String[] args = { mu.getMessage() }; VFSManager.error(comp,path,"ioerror.badurl",args); return null; }
// in org/gjt/sp/jedit/io/VFSFile.java
catch(IOException e) { VFSManager.error(e,path,browser); }
// in org/gjt/sp/jedit/io/VFSFile.java
catch(IOException e) { VFSManager.error(e,path,browser); }
// in org/gjt/sp/jedit/search/DirectoryListSet.java
catch(IOException io) { VFSManager.error(comp,directory,"ioerror",new String[] { io.toString() }); return null; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,newPath,"ioerror", new String[] { io.toString() }); setPerformingIO(false); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,newPath,"ioerror", new String[] { io.toString() }); setPerformingIO(false); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; }
// in org/gjt/sp/jedit/options/PluginManagerOptionPane.java
catch (final Exception ex) { if (download) { Log.log(Log.ERROR,this,ex); ThreadUtilities.runInDispatchThread(new Runnable() { public void run() { GUIUtilities.error(PluginManagerOptionPane.this, "ioerror",new String[] { ex.toString() }); } }); }
// in org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); // Incomplete autosave file should not exist. if(out != null) { try { out.close(); out = null; vfs._delete(session,path,view); } catch(IOException ioe) { Log.log(Log.ERROR,this,ioe); } } }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch (FileNotFoundException e) { Log.log(Log.ERROR,this,"Unable to save buffer " + e); String[] pp = { e.getMessage() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(UnsupportedCharsetException e) { Log.log(Log.ERROR, this, e, e); String[] pp = { e.getCharsetName() }; VFSManager.error(view,path,"ioerror.unsupported-encoding-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); Object[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(OutOfMemoryError oom) { Log.log(Log.ERROR,this,oom); VFSManager.error(view,path,"out-of-memory-error",null); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/textarea/JEditTextArea.java
catch (TextAreaException e) { GUIUtilities.error(view,"folding-not-explicit",null); }
// in org/gjt/sp/jedit/textarea/JEditTextArea.java
catch (TextAreaException e) { GUIUtilities.error(view,"format-maxlinelen",null); }
// in org/gjt/sp/jedit/browser/DeleteBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/DeleteBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); String[] pp = { io.toString() }; VFSManager.error(browser, path,"ioerror.directory-error",pp); }
// in org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); String[] pp = { io.toString() }; VFSManager.error(browser, path,"ioerror.directory-error",pp); }
// in org/gjt/sp/jedit/browser/VFSFileChooserDialog.java
catch(IOException e) { VFSManager.error(e,path,browser); }
// in org/gjt/sp/jedit/browser/VFSFileChooserDialog.java
catch(IOException e) { VFSManager.error(e,path,browser); }
// in org/gjt/sp/jedit/browser/RenameBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/RenameBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/MkDirBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); args[0] = io.toString(); VFSManager.error(browser, path,"ioerror",args); }
// in org/gjt/sp/jedit/browser/MkDirBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); args[0] = io.toString(); VFSManager.error(browser, path,"ioerror",args); }
// in org/gjt/sp/jedit/syntax/ModeProvider.java
catch (FileNotFoundException e1) { InputStream resource = ModeProvider.class.getResourceAsStream(fileName); if (resource == null) error(fileName, e1); grammar = new BufferedInputStream(resource); }
// in org/gjt/sp/jedit/syntax/ModeProvider.java
catch (Throwable e) { error(fileName, e); }
// in org/gjt/sp/jedit/syntax/XModeHandler.java
catch(PatternSyntaxException e) { error("regexp",e); }
// in org/gjt/sp/jedit/syntax/XModeHandler.java
catch(PatternSyntaxException re) { error("regexp",re); }
// in org/gjt/sp/jedit/syntax/XModeHandler.java
catch(PatternSyntaxException re) { error("regexp",re); }
// in org/gjt/sp/jedit/syntax/XModeHandler.java
catch(PatternSyntaxException re) { error("regexp",re); }
// in org/gjt/sp/jedit/syntax/XModeHandler.java
catch (NumberFormatException e) { error("termchar-invalid",tmp); termChar = -1; }
131
toEvalError 36
                  
// in org/gjt/sp/jedit/bsh/BSHUnaryExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch( UtilEvalError e ) { Interpreter.debug("doIndex: "+e); throw e.toEvalError( "Arrays may only be indexed by integer types.", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e) { throw e.toEvalError( "Property: "+value, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( UtilEvalError e2 ) { throw e2.toEvalError( "Typed method parameter assignment", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( UtilEvalError e3 ) { throw e3.toEvalError( callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch( UtilEvalError e ) { // Point to return statement point if we had one. // (else it was implicit return? What's the case here?) SimpleNode node = callerInfo; if ( retControl != null ) node = retControl.returnPoint; throw e.toEvalError( "Incorrect type returned from method: " + name + e.getMessage(), node, callstack ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( UtilEvalError e ) { throw e.toEvalError( callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( UtilEvalError e ) { //e.printStackTrace(); throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( UtilEvalError e2 ) { // ClassPathException is a type of UtilEvalError throw e2.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHCastExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimaryExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHTypedVariableDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError("Error loading command: ", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError("Error invoking compiled command: ", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHBinaryExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHSwitchStatement.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Switch value: "+switchExp.getText()+": ", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHImportDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHMethodDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError(this,callstack); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHEnhancedForStatement.java
catch ( UtilEvalError e ) { throw e.toEvalError( "for loop iterator variable:"+ varName, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Error in array initializer", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHClassDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, callstack ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() ); }
37
toString 35
                  
// in org/gjt/sp/jedit/print/BufferPrintable.java
catch(Exception e) { Log.log(Log.ERROR,this,e); final String[] args = { e.toString() }; SwingUtilities.invokeLater(new Runnable() { public void run() { GUIUtilities.error(view,"print-error",args); } }); }
// in org/gjt/sp/jedit/help/HelpSearchPanel.java
catch(Exception e) { index = null; Log.log(Log.ERROR,this,e); GUIUtilities.error(helpViewer.getComponent(),"helpviewer.search.error", new String[] { e.toString() }); }
// in org/gjt/sp/jedit/help/HelpViewer.java
catch(IOException io) { Log.log(Log.ERROR,this,io); String[] args = { _url.toString(), io.toString() }; GUIUtilities.error(HelpViewer.this,"read-error",args); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( IllegalArgumentException e1 ) { throw new UtilTargetError( new ArrayStoreException( e1.toString() ) ); }
// in org/gjt/sp/jedit/bsh/XThis.java
catch ( EvalError ee ) { // Ease debugging... // XThis.this refers to the enclosing class instance if ( Interpreter.DEBUG ) Interpreter.debug( "EvalError in scripted interface: " + XThis.this.toString() + ": "+ ee ); throw ee; }
// in org/gjt/sp/jedit/bsh/TargetError.java
catch ( EvalError e ) { throw new InterpreterError("xprintarget: "+e.toString() ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
catch ( EvalError e ) { /* Here we catch any EvalError from the interpreter because we are using it as a tool to load the command, not as part of the execution path. */ Interpreter.debug( e.toString() ); throw new UtilEvalError( "Error loading script: "+ e.getMessage()); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch (EvalError e) { if ( interactive ) error( "EvalError: "+e.toString() ); else error( "EvalError: "+e.getMessage() ); if(DEBUG) e.printStackTrace(); if(!interactive) eof = true; }
// in org/gjt/sp/jedit/search/DirectoryListSet.java
catch(IOException io) { VFSManager.error(comp,directory,"ioerror",new String[] { io.toString() }); return null; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,newPath,"ioerror", new String[] { io.toString() }); setPerformingIO(false); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,newPath,"ioerror", new String[] { io.toString() }); setPerformingIO(false); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; }
// in org/gjt/sp/jedit/options/PluginManagerOptionPane.java
catch (final Exception ex) { if (download) { Log.log(Log.ERROR,this,ex); ThreadUtilities.runInDispatchThread(new Runnable() { public void run() { GUIUtilities.error(PluginManagerOptionPane.this, "ioerror",new String[] { ex.toString() }); } }); }
// in org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); // Incomplete autosave file should not exist. if(out != null) { try { out.close(); out = null; vfs._delete(session,path,view); } catch(IOException ioe) { Log.log(Log.ERROR,this,ioe); } } }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); Object[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/browser/DeleteBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/DeleteBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); String[] pp = { io.toString() }; VFSManager.error(browser, path,"ioerror.directory-error",pp); }
// in org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); String[] pp = { io.toString() }; VFSManager.error(browser, path,"ioerror.directory-error",pp); }
// in org/gjt/sp/jedit/browser/RenameBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/RenameBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/MkDirBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); args[0] = io.toString(); VFSManager.error(browser, path,"ioerror",args); }
// in org/gjt/sp/jedit/browser/MkDirBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); args[0] = io.toString(); VFSManager.error(browser, path,"ioerror",args); }
// in org/gjt/sp/jedit/PluginJAR.java
catch (Throwable t) { breakPlugin(); Log.log(Log.ERROR,this,"Error while starting plugin " + className); Log.log(Log.ERROR,this,t); String[] args = { t.toString() }; jEdit.pluginError(path,"plugin-error.start-error",args); return; }
// in org/gjt/sp/jedit/PluginJAR.java
catch(IOException io) { Log.log(Log.ERROR,this,"Cannot load" + " plugin " + path); Log.log(Log.ERROR,this,io); String[] args = { io.toString() }; jEdit.pluginError(path,"plugin-error.load-error",args); uninit(false); }
// in org/gjt/sp/jedit/PluginJAR.java
catch(Throwable t) { breakPlugin(); Log.log(Log.ERROR,PluginJAR.this, "Error while starting plugin " + plugin.getClassName()); Log.log(Log.ERROR,PluginJAR.this,t); String[] args = { t.toString() }; jEdit.pluginError(path, "plugin-error.start-error",args); }
332
clearNodeScope
34
                  
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
34
getMessage 34
                  
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(IOException io) { Log.log(Log.ERROR,this,io); String[] args = { io.getMessage() }; GUIUtilities.error(null,"ioerror",args); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(final IOException io) { Log.log(Log.ERROR,this,io); SwingUtilities.invokeLater(new Runnable() { public void run() { String[] args = { io.getMessage() }; GUIUtilities.error(null,"plugin-error-download",args); } }); return null; }
// in org/gjt/sp/jedit/pluginmgr/InstallPanel.java
catch (Exception e) { Log.log(Log.WARNING, this, "Loading Pluginset failed:" + e.getMessage()); return false; }
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch(java.net.UnknownHostException e) { GUIUtilities.error(jEdit.getActiveView() , "plugin-manager.list-download.disconnected" , new Object[]{e.getMessage()}); Log.log (Log.ERROR, this, "CacheRemotePluginList: error", e); }
// in org/gjt/sp/jedit/help/HelpViewer.java
catch(MalformedURLException mf) { Log.log(Log.ERROR,this,mf); String[] args = { url, mf.getMessage() }; GUIUtilities.error(this,"badurl",args); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch( UtilEvalError e) { throw new EvalError( "Invalid argument: " + "`"+paramNames[i]+"'" + " for method: " + name + " : " + e.getMessage(), callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch( UtilEvalError e ) { // Point to return statement point if we had one. // (else it was implicit return? What's the case here?) SimpleNode node = callerInfo; if ( retControl != null ) node = retControl.returnPoint; throw e.toEvalError( "Incorrect type returned from method: " + name + e.getMessage(), node, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( ClassNotFoundException e ) { throw new EvalError( e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( IllegalStateException e ) { {if (true) throw createParseException( e.getMessage() );} }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( ReflectError e) { throw new EvalError( "Constructor error: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch( Exception e ) { throw new EvalError("Can't construct primitive array: " + e.getMessage(), this, callstack); }
// in org/gjt/sp/jedit/bsh/Name.java
catch( UtilEvalError e ) { throw new UtilEvalError( "LHS evaluation: " + e.getMessage() ); }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch (Throwable t) { throw new Error(t.getMessage()); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
catch ( UtilEvalError e ) { throw new UtilEvalError( "Variable assignment: " + name + ": " + e.getMessage()); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
catch ( EvalError e ) { /* Here we catch any EvalError from the interpreter because we are using it as a tool to load the command, not as part of the execution path. */ Interpreter.debug( e.toString() ); throw new UtilEvalError( "Error loading script: "+ e.getMessage()); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(ReflectError e) { Interpreter.debug(e.getMessage()); throw new UtilEvalError("No such property: " + propName); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(ReflectError e) { Interpreter.debug("Assignment: " + e.getMessage()); throw new UtilEvalError("No such property: " + propName); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch ( Exception e ) { throw new UtilEvalError("Assignment: " + e.getMessage()); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(ParseException e) { error("Parser Error: " + e.getMessage(DEBUG)); if ( DEBUG ) e.printStackTrace(); if(!interactive) eof = true; parser.reInitInput(in); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(InterpreterError e) { error("Internal Error: " + e.getMessage()); e.printStackTrace(); if(!interactive) eof = true; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch (EvalError e) { if ( interactive ) error( "EvalError: "+e.toString() ); else error( "EvalError: "+e.getMessage() ); if(DEBUG) e.printStackTrace(); if(!interactive) eof = true; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(ParseException e) { /* throw new EvalError( "Sourced file: "+sourceFileInfo+" parser Error: " + e.getMessage( DEBUG ), node, callstack ); */ if ( DEBUG ) // show extra "expecting..." info error( e.getMessage(DEBUG) ); // add the source file info and throw again e.setErrorSourceFile( sourceFileInfo ); throw e; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( InterpreterError e ) { e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" internal Error: " + e.getMessage(), node, callstack); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e) { if ( DEBUG) e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" unknown error: " + e.getMessage(), node, callstack); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(TokenMgrError e) { throw new EvalError( "Sourced file: "+sourceFileInfo+" Token Parsing Error: " + e.getMessage(), node, callstack ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw new EvalError( e.getMessage(), SimpleNode.JAVACODE, new CallStack() ); }
// in org/gjt/sp/jedit/io/UrlVFS.java
catch(MalformedURLException mu) { Log.log(Log.ERROR,this,mu); String[] args = { mu.getMessage() }; VFSManager.error(comp,path,"ioerror.badurl",args); return null; }
// in org/gjt/sp/jedit/io/UrlVFS.java
catch(MalformedURLException mu) { Log.log(Log.ERROR,this,mu); String[] args = { mu.getMessage() }; VFSManager.error(comp,path,"ioerror.badurl",args); return null; }
// in org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
catch (FileNotFoundException e) { Log.log(Log.WARNING,this,"Unable to save " + e.getMessage()); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch (FileNotFoundException e) { Log.log(Log.ERROR,this,"Unable to save buffer " + e); String[] pp = { e.getMessage() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/menu/RecentFilesProvider.java
catch(PatternSyntaxException re) { Log.log(Log.ERROR,this,re.getMessage()); }
// in org/gjt/sp/util/IOUtilities.java
catch (IOException ioe) { Log.log(Log.WARNING, IOUtilities.class, "Error moving file: " + ioe + " : " + ioe.getMessage()); }
44
popNode 34
                  
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
39
jjStopStringLiteralDfa_0 27
                  
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(0, active0, active1, active2); return 1; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(1, active0, active1, active2); return 2; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(2, active0, active1, active2); return 3; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(3, active0, active1, active2); return 4; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(4, active0, active1, active2); return 5; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(5, active0, active1, active2); return 6; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(6, active0, active1, active2); return 7; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(7, active0, active1, active2); return 8; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(8, active0, active1, active2); return 9; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(9, active0, active1, active2); return 10; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(10, active0, active1, active2); return 11; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(11, 0L, active1, active2); return 12; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(12, 0L, active1, active2); return 13; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(13, 0L, active1, active2); return 14; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(14, 0L, active1, active2); return 15; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(15, 0L, active1, active2); return 16; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(16, 0L, active1, active2); return 17; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(17, 0L, active1, active2); return 18; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(18, 0L, active1, active2); return 19; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(19, 0L, active1, active2); return 20; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(20, 0L, 0L, active2); return 21; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(21, 0L, 0L, active2); return 22; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(22, 0L, 0L, active2); return 23; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(23, 0L, 0L, active2); return 24; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(24, 0L, 0L, active2); return 25; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(25, 0L, 0L, active2); return 26; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(26, 0L, 0L, active2); return 27; }
28
println 19
                  
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassPathException e ) { System.err.println("Warning: can't get boot class path"); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( EvalError e ) { // ignore System.err.println( e ); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( ClassNotFoundException e ) { System.err.println("Class not found in source file: "+name ); return null; }
// in org/gjt/sp/jedit/bsh/Remote.java
catch ( Exception ex ) { System.err.println("Bad URL: "+orgURL+": "+ex ); return returnValue; }
// in org/gjt/sp/jedit/bsh/Remote.java
catch(Exception ex) { System.err.println("Error communicating with server: "+ex); return returnValue; }
// in org/gjt/sp/jedit/bsh/Remote.java
catch (MalformedURLException e) { System.out.println(e); // bad postURL }
// in org/gjt/sp/jedit/bsh/Remote.java
catch (IOException e2) { System.out.println(e2); // I/O error }
// in org/gjt/sp/jedit/bsh/commands/dir.java
catch (IOException e ) { env.println("error reading path: "+e); return; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e ) { Object o = e; if ( e instanceof InvocationTargetException ) o = ((InvocationTargetException)e) .getTargetException(); System.err.println( "Class: "+result+" main method threw exception:"+o); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( FileNotFoundException e ) { System.out.println("File not found: "+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( TargetError e ) { System.out.println("Script threw exception: "+e); if ( e.inNativeCode() ) e.printStackTrace( DEBUG, System.err ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e ) { System.out.println("Evaluation Error: "+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( IOException e ) { System.out.println("I/O Error: "+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e ) { println( "BeanShell "+VERSION+" - by Pat Niemeyer (pat@pat.net)"); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( IOException e ) { System.err.println("Can't redirect output to file: "+filename ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( SecurityException e ) { System.err.println("Could not init static:"+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e ) { System.err.println("Could not init static(2):"+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Throwable e ) { System.err.println("Could not init static(3):"+e); }
// in org/gjt/sp/jedit/jEdit.java
catch(NumberFormatException nf) { System.err.println("Malformed option: " + arg); }
98
setBooleanProperty 16
                  
// in org/gjt/sp/jedit/bufferio/MarkersSaveRequest.java
catch(IOException io) { Log.log(Log.ERROR,this,io); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch (FileNotFoundException e) { Log.log(Log.ERROR,this,"Unable to save buffer " + e); String[] pp = { e.getMessage() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(UnsupportedCharsetException e) { Log.log(Log.ERROR, this, e, e); String[] pp = { e.getCharsetName() }; VFSManager.error(view,path,"ioerror.unsupported-encoding-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); Object[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(OutOfMemoryError oom) { Log.log(Log.ERROR,this,oom); VFSManager.error(view,path,"out-of-memory-error",null); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); }
167
printStackTrace 15
                  
// in org/gjt/sp/jedit/print/BufferPrinter1_4.java
catch(Exception e) { e.printStackTrace(); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { if ( e instanceof TargetError ) e =(Exception)((TargetError)e).getTarget(); if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); e.printStackTrace( System.err ); throw new InterpreterError("Error in class initialization: "+e ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( TargetError e ) { System.out.println("Script threw exception: "+e); if ( e.inNativeCode() ) e.printStackTrace( DEBUG, System.err ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(ParseException e) { error("Parser Error: " + e.getMessage(DEBUG)); if ( DEBUG ) e.printStackTrace(); if(!interactive) eof = true; parser.reInitInput(in); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(InterpreterError e) { error("Internal Error: " + e.getMessage()); e.printStackTrace(); if(!interactive) eof = true; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(TargetError e) { error("// Uncaught Exception: " + e ); if ( e.inNativeCode() ) e.printStackTrace( DEBUG, err ); if(!interactive) eof = true; setu("$_e", e.getTarget()); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch (EvalError e) { if ( interactive ) error( "EvalError: "+e.toString() ); else error( "EvalError: "+e.getMessage() ); if(DEBUG) e.printStackTrace(); if(!interactive) eof = true; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(Exception e) { error("Unknown error: " + e); if ( DEBUG ) e.printStackTrace(); if(!interactive) eof = true; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( InterpreterError e ) { e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" internal Error: " + e.getMessage(), node, callstack); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e) { if ( DEBUG) e.printStackTrace(); // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow( "Sourced file: "+sourceFileInfo ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e) { if ( DEBUG) e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" unknown error: " + e.getMessage(), node, callstack); }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { e.printStackTrace(); stream = null; }
// in org/gjt/sp/util/Log.java
catch(IOException io) { io.printStackTrace(realErr); }
// in org/gjt/sp/util/Log.java
catch(IOException io) { io.printStackTrace(realErr); }
// in org/gjt/sp/util/Log.java
catch(Exception e) { e.printStackTrace(realErr); }
23
debug 11
                  
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch( UtilEvalError e ) { Interpreter.debug("doIndex: "+e); throw e.toEvalError( "Arrays may only be indexed by integer types.", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/XThis.java
catch ( EvalError ee ) { // Ease debugging... // XThis.this refers to the enclosing class instance if ( Interpreter.DEBUG ) Interpreter.debug( "EvalError in scripted interface: " + XThis.this.toString() + ": "+ ee ); throw ee; }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch(InvocationTargetException e) { // No need to wrap this debug Interpreter.debug("The constructor threw an exception:\n\t" + e.getTargetException()); throw new TargetError( "Object constructor", e.getTargetException(), this, callstack, true); }
// in org/gjt/sp/jedit/bsh/Name.java
catch( ReflectError e ) { if ( Interpreter.DEBUG ) Interpreter.debug("field reflect error: "+e); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
catch ( EvalError e ) { /* Here we catch any EvalError from the interpreter because we are using it as a tool to load the command, not as part of the execution path. */ Interpreter.debug( e.toString() ); throw new UtilEvalError( "Error loading script: "+ e.getMessage()); }
// in org/gjt/sp/jedit/bsh/CollectionManager.java
catch ( Exception e ) { Interpreter.debug("unable to load CollectionManagerImpl: "+e); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(ReflectError e) { Interpreter.debug(e.getMessage()); throw new UtilEvalError("No such property: " + propName); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(ReflectError e) { Interpreter.debug("Assignment: " + e.getMessage()); throw new UtilEvalError("No such property: " + propName); }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
catch( IllegalArgumentException e ) { Interpreter.debug("illegal arg"+e); throwTypeError( baseType, currentInitializer, i, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
catch( ArrayStoreException e ) { // I think this can happen Interpreter.debug("arraystore"+e); throwTypeError( baseType, currentInitializer, i, callstack ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e ) { // squeltch security exception, filenotfoundexception if ( Interpreter.DEBUG ) debug("Could not find rc file: "+e); }
48
getTargetException 11
                  
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch(InvocationTargetException e) { throw new TargetError( "target exception", e.getTargetException(), this, callstack, true); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( InvocationTargetException e ) { String msg = "Method Invocation "+field; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(InvocationTargetException e) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( InvocationTargetException e ) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( InvocationTargetException e ) { throw new UtilEvalError( "Error in compiled command: "+e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch(InvocationTargetException e) { // No need to wrap this debug Interpreter.debug("The constructor threw an exception:\n\t" + e.getTargetException()); throw new TargetError( "Object constructor", e.getTargetException(), this, callstack, true); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( Exception e ) { if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); throw new EvalError( "Error constructing inner class instance: "+e, this, callstack ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { if ( e instanceof TargetError ) e =(Exception)((TargetError)e).getTarget(); if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); e.printStackTrace( System.err ); throw new InterpreterError("Error in class initialization: "+e ); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( InvocationTargetException e ) { String msg = "Method Invocation "+name; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e ) { Object o = e; if ( e instanceof InvocationTargetException ) o = ((InvocationTargetException)e) .getTargetException(); System.err.println( "Class: "+result+" main method threw exception:"+o); }
13
setCancellable 8
                  
// in org/gjt/sp/jedit/browser/DeleteBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/DeleteBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); String[] pp = { io.toString() }; VFSManager.error(browser, path,"ioerror.directory-error",pp); }
// in org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); String[] pp = { io.toString() }; VFSManager.error(browser, path,"ioerror.directory-error",pp); }
// in org/gjt/sp/jedit/browser/RenameBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/RenameBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/MkDirBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); args[0] = io.toString(); VFSManager.error(browser, path,"ioerror",args); }
// in org/gjt/sp/jedit/browser/MkDirBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); args[0] = io.toString(); VFSManager.error(browser, path,"ioerror",args); }
17
getName 6
                  
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( IllegalAccessException e ) { throw new ReflectError( "Cannot access method " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " in '" + method.getDeclaringClass() + "' :" + e ); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( NullPointerException e) { throw new UtilEvalError( "LHS ("+field.getName()+") not a static field."); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( IllegalAccessException e2) { throw new UtilEvalError( "LHS ("+field.getName()+") can't access field: "+e2); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( IllegalArgumentException e3) { String type = val instanceof Primitive ? ((Primitive)val).getType().getName() : val.getClass().getName(); throw new UtilEvalError( "Argument type mismatch. " + (val == null ? "null" : type ) + " not assignable to field "+field.getName()); }
233
handleError
6
                  
// in org/gjt/sp/jedit/search/SearchAndReplace.java
catch(Exception e) { results.searchFailed(); handleError(comp,e); return false; }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
catch(Exception e) { handleError(comp,e); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
catch(Exception e) { handleError(comp,e); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
catch(Exception e) { handleError(comp,e); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
catch(Exception e) { handleError(comp,e); }
// in org/gjt/sp/jedit/search/HyperSearchRequest.java
catch(final Exception e) { Log.log(Log.ERROR,this,e); ThreadUtilities.runInDispatchThread(new Runnable() { public void run() { SearchAndReplace.handleError(view,e); } }); }
6
createParseException
4
                  
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( IllegalStateException e ) { {if (true) throw createParseException( e.getMessage() );} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( NumberFormatException e ) { {if (true) throw createParseException( "Error or number too big for integer type: "+ literal );} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( Exception e ) { {if (true) throw createParseException("Error parsing character: "+x.image);} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( Exception e ) { {if (true) throw createParseException("Error parsing string: "+x.image);} }
4
getProperty 4
                  
// in org/gjt/sp/jedit/help/HelpTOCPanel.java
catch(FileNotFoundException e) { /* it is acceptable only for the API TOC : the user can choose not to install them */ if("api/toc.xml".equals(path)) { Log.log(Log.NOTICE,this, "The API docs for jEdit will not be available (reinstall jEdit if you want them)"); root.add( createNode("http://www.jedit.org/api/overview-summary.html", jEdit.getProperty("helpviewer.toc.online-apidocs"))); } else { Log.log(Log.ERROR,this,e); } }
// in org/gjt/sp/jedit/JEditKillRing.java
catch (OutOfMemoryError oem) { Log.log(Log.ERROR, this, "Unable to load entire Killring, too low memory, increase your jvm max heap size"); String start = jEdit.getProperty("killring.start"); String deleteKillRing = jEdit.getProperty("killring.delete"); String stop = jEdit.getProperty("killring.stop"); int selected = GUIUtilities.option(null, "killring.load-memoryerror", null, JOptionPane.ERROR_MESSAGE, new Object[]{start, deleteKillRing, stop}, start); if (selected == 2) { System.exit(-1); } else if (selected == 1) { new File(MiscUtilities.constructPath( jEdit.getSettingsDirectory(),"killring.xml")).delete(); return; } }
1340
handleException
4
                  
// in org/gjt/sp/jedit/BeanShellFacade.java
catch(Throwable e) { Log.log(Log.ERROR,BeanShellFacade.class,e); handleException(param,null,e); }
// in org/gjt/sp/jedit/BeanShell.java
catch(Throwable e) { Log.log(Log.ERROR,BeanShell.class,e); bsh.handleException(view,null,e); }
// in org/gjt/sp/jedit/BeanShell.java
catch(Throwable e) { Log.log(Log.ERROR,BeanShell.class,e); bsh.handleException(view,path,e); }
// in org/gjt/sp/jedit/BeanShell.java
catch(Throwable e) { Log.log(Log.ERROR,BeanShell.class,e); bsh.handleException(view,path,e); }
4
inNativeCode
4
                  
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( InvocationTargetException e ) { String msg = "Method Invocation "+field; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( InvocationTargetException e ) { String msg = "Method Invocation "+name; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( TargetError e ) { System.out.println("Script threw exception: "+e); if ( e.inNativeCode() ) e.printStackTrace( DEBUG, System.err ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(TargetError e) { error("// Uncaught Exception: " + e ); if ( e.inNativeCode() ) e.printStackTrace( DEBUG, err ); if(!interactive) eof = true; setu("$_e", e.getTarget()); }
4
pluginError 4
                  
// in org/gjt/sp/jedit/PluginJAR.java
catch(Exception e) { String[] args = { pluginDepends.arg }; jEdit.pluginError(path, "plugin-error.dep-class",args); ok = false; }
// in org/gjt/sp/jedit/PluginJAR.java
catch (Throwable t) { breakPlugin(); Log.log(Log.ERROR,this,"Error while starting plugin " + className); Log.log(Log.ERROR,this,t); String[] args = { t.toString() }; jEdit.pluginError(path,"plugin-error.start-error",args); return; }
// in org/gjt/sp/jedit/PluginJAR.java
catch(IOException io) { Log.log(Log.ERROR,this,"Cannot load" + " plugin " + path); Log.log(Log.ERROR,this,io); String[] args = { io.toString() }; jEdit.pluginError(path,"plugin-error.load-error",args); uninit(false); }
// in org/gjt/sp/jedit/PluginJAR.java
catch(Throwable t) { breakPlugin(); Log.log(Log.ERROR,PluginJAR.this, "Error while starting plugin " + plugin.getClassName()); Log.log(Log.ERROR,PluginJAR.this,t); String[] args = { t.toString() }; jEdit.pluginError(path, "plugin-error.start-error",args); }
13
CallStack 3
                  
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw new EvalError( e.getMessage(), SimpleNode.JAVACODE, new CallStack() ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() ); }
18
File 3
                  
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch (Exception e) { Log.log(Log.ERROR, this, "readpluginlist: error", e); if (cachedURL.startsWith("file:///")) { Log.log(Log.DEBUG, this, "Unable to read plugin list, deleting cached file and try again"); new File(cachedURL.substring(8)).delete(); if (allowRetry) { plugins.clear(); pluginHash.clear(); pluginSets.clear(); readPluginList(false); } } }
// in org/gjt/sp/jedit/JEditKillRing.java
catch (OutOfMemoryError oem) { Log.log(Log.ERROR, this, "Unable to load entire Killring, too low memory, increase your jvm max heap size"); String start = jEdit.getProperty("killring.start"); String deleteKillRing = jEdit.getProperty("killring.delete"); String stop = jEdit.getProperty("killring.stop"); int selected = GUIUtilities.option(null, "killring.load-memoryerror", null, JOptionPane.ERROR_MESSAGE, new Object[]{start, deleteKillRing, stop}, start); if (selected == 2) { System.exit(-1); } else if (selected == 1) { new File(MiscUtilities.constructPath( jEdit.getSettingsDirectory(),"killring.xml")).delete(); return; } }
// in org/gjt/sp/jedit/PluginJAR.java
catch(IOException io) { Log.log(Log.ERROR,PluginJAR.class,io); IOUtilities.closeQuietly(dout); new File(jarCachePath).delete(); }
118
clear 3
                  
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch (Exception e) { Log.log(Log.ERROR, this, "readpluginlist: error", e); if (cachedURL.startsWith("file:///")) { Log.log(Log.DEBUG, this, "Unable to read plugin list, deleting cached file and try again"); new File(cachedURL.substring(8)).delete(); if (allowRetry) { plugins.clear(); pluginHash.clear(); pluginSets.clear(); readPluginList(false); } } }
62
close 3
                  
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
catch(CharacterCodingException e) { // It seems to be made by an old version of jEdit. in.close(); Log.log(Log.MESSAGE,HistoryModel.class, "Failed to load history with UTF-8." + " Fallbacking to the system default encoding."); in = new BufferedReader(new FileReader(history)); models.putAll(loadFromReader(in)); }
// in org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); // Incomplete autosave file should not exist. if(out != null) { try { out.close(); out = null; vfs._delete(session,path,view); } catch(IOException ioe) { Log.log(Log.ERROR,this,ioe); } } }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(IOException e) { Log.log(Log.NOTICE, this , path + ": Reopening to rewind the stream"); // Reopen the stream because the mark has been // invalidated while previous reading. markedStream.close(); InputStream in = getNakedStream(); try { if(gzipped) { in = new GZIPInputStream(in); } BufferedInputStream result = AutoDetection.getMarkedStream(in); in = null; return result; } finally { IOUtilities.closeQuietly(in); } }
68
delete 3
                  
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch (Exception e) { Log.log(Log.ERROR, this, "readpluginlist: error", e); if (cachedURL.startsWith("file:///")) { Log.log(Log.DEBUG, this, "Unable to read plugin list, deleting cached file and try again"); new File(cachedURL.substring(8)).delete(); if (allowRetry) { plugins.clear(); pluginHash.clear(); pluginSets.clear(); readPluginList(false); } } }
// in org/gjt/sp/jedit/JEditKillRing.java
catch (OutOfMemoryError oem) { Log.log(Log.ERROR, this, "Unable to load entire Killring, too low memory, increase your jvm max heap size"); String start = jEdit.getProperty("killring.start"); String deleteKillRing = jEdit.getProperty("killring.delete"); String stop = jEdit.getProperty("killring.stop"); int selected = GUIUtilities.option(null, "killring.load-memoryerror", null, JOptionPane.ERROR_MESSAGE, new Object[]{start, deleteKillRing, stop}, start); if (selected == 2) { System.exit(-1); } else if (selected == 1) { new File(MiscUtilities.constructPath( jEdit.getSettingsDirectory(),"killring.xml")).delete(); return; } }
// in org/gjt/sp/jedit/PluginJAR.java
catch(IOException io) { Log.log(Log.ERROR,PluginJAR.class,io); IOUtilities.closeQuietly(dout); new File(jarCachePath).delete(); }
29
getClass 3
                  
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { // no field, try property acces if ( hasObjectPropertyGetter( object.getClass(), fieldName ) ) return getObjectProperty( object, fieldName ); else throw e; }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { // not a field, try property access if ( hasObjectPropertySetter( object.getClass(), fieldName ) ) return new LHS( object, fieldName ); else throw e; }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( IllegalArgumentException e3) { String type = val instanceof Primitive ? ((Primitive)val).getType().getName() : val.getClass().getName(); throw new UtilEvalError( "Argument type mismatch. " + (val == null ? "null" : type ) + " not assignable to field "+field.getName()); }
99
getTarget 3
                  
// in org/gjt/sp/jedit/bsh/XThis.java
catch ( TargetError te ) { // Unwrap target exception. If the interface declares that // it throws the ex it will be delivered. If not it will be // wrapped in an UndeclaredThrowable throw te.getTarget(); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { if ( e instanceof TargetError ) e =(Exception)((TargetError)e).getTarget(); if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); e.printStackTrace( System.err ); throw new InterpreterError("Error in class initialization: "+e ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(TargetError e) { error("// Uncaught Exception: " + e ); if ( e.inNativeCode() ) e.printStackTrace( DEBUG, err ); if(!interactive) eof = true; setu("$_e", e.getTarget()); }
5
invokeLater 3
                  
// in org/gjt/sp/jedit/print/BufferPrintable.java
catch(Exception e) { Log.log(Log.ERROR,this,e); final String[] args = { e.toString() }; SwingUtilities.invokeLater(new Runnable() { public void run() { GUIUtilities.error(view,"print-error",args); } }); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(FileNotFoundException e) { Log.log(Log.ERROR,this,e); SwingUtilities.invokeLater(new Runnable() { public void run() { GUIUtilities.error(null,"plugin-error-download",new Object[]{""}); } }); return null; }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(final IOException io) { Log.log(Log.ERROR,this,io); SwingUtilities.invokeLater(new Runnable() { public void run() { String[] args = { io.getMessage() }; GUIUtilities.error(null,"plugin-error-download",args); } }); return null; }
43
reThrow
3
                  
// in org/gjt/sp/jedit/bsh/BSHTypedVariableDeclaration.java
catch ( EvalError e ) { e.reThrow( "Typed variable declaration" ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( TargetError e ) { // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow("Sourced file: "+sourceFileInfo); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e) { if ( DEBUG) e.printStackTrace(); // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow( "Sourced file: "+sourceFileInfo ); }
3
unwrapException
3
                  
// in org/gjt/sp/jedit/BeanShellFacade.java
catch(Exception e) { unwrapException(e); // never called return null; }
// in org/gjt/sp/jedit/BeanShellFacade.java
catch(Exception e) { unwrapException(e); // never called return null; }
// in org/gjt/sp/jedit/BeanShell.java
catch(Exception e) { BeanShellFacade.unwrapException(e); }
3
backup 2
                  
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch(java.io.IOException e) { if (bufpos != 0) { --bufpos; backup(0); } else { bufline[bufpos] = line; bufcolumn[bufpos] = column; } throw e; }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch(java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; }
7
beep 2
                  
// in org/gjt/sp/jedit/gui/SelectLineRange.java
catch(NumberFormatException nf) { getToolkit().beep(); return; }
// in org/gjt/sp/jedit/textarea/JEditTextArea.java
catch(Exception e) { getToolkit().beep(); }
121
breakPlugin 2
                  
// in org/gjt/sp/jedit/PluginJAR.java
catch (Throwable t) { breakPlugin(); Log.log(Log.ERROR,this,"Error while starting plugin " + className); Log.log(Log.ERROR,this,t); String[] args = { t.toString() }; jEdit.pluginError(path,"plugin-error.start-error",args); return; }
// in org/gjt/sp/jedit/PluginJAR.java
catch(Throwable t) { breakPlugin(); Log.log(Log.ERROR,PluginJAR.this, "Error while starting plugin " + plugin.getClassName()); Log.log(Log.ERROR,PluginJAR.this,t); String[] args = { t.toString() }; jEdit.pluginError(path, "plugin-error.start-error",args); }
6
closeQuietly 2
                  
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(IOException e) { Log.log(Log.NOTICE, this , path + ": Reopening to rewind the stream"); // Reopen the stream because the mark has been // invalidated while previous reading. markedStream.close(); InputStream in = getNakedStream(); try { if(gzipped) { in = new GZIPInputStream(in); } BufferedInputStream result = AutoDetection.getMarkedStream(in); in = null; return result; } finally { IOUtilities.closeQuietly(in); } }
// in org/gjt/sp/jedit/PluginJAR.java
catch(IOException io) { Log.log(Log.ERROR,PluginJAR.class,io); IOUtilities.closeQuietly(dout); new File(jarCachePath).delete(); }
48
constructPath 2
                  
// in org/gjt/sp/jedit/jEdit.java
catch (MalformedURLException mue) { path = MiscUtilities.constructPath(parent,path); }
// in org/gjt/sp/jedit/JEditKillRing.java
catch (OutOfMemoryError oem) { Log.log(Log.ERROR, this, "Unable to load entire Killring, too low memory, increase your jvm max heap size"); String start = jEdit.getProperty("killring.start"); String deleteKillRing = jEdit.getProperty("killring.delete"); String stop = jEdit.getProperty("killring.stop"); int selected = GUIUtilities.option(null, "killring.load-memoryerror", null, JOptionPane.ERROR_MESSAGE, new Object[]{start, deleteKillRing, stop}, start); if (selected == 2) { System.exit(-1); } else if (selected == 1) { new File(MiscUtilities.constructPath( jEdit.getSettingsDirectory(),"killring.xml")).delete(); return; } }
85
currentThread 2
                  
// in org/gjt/sp/jedit/io/VFSManager.java
catch (InterruptedException ie) { // preserve interruption flag, but don't stop Thread.currentThread().interrupt(); }
// in org/gjt/sp/jedit/io/VFSManager.java
catch(InterruptedException ie) { // We don't stop, we have to display errors. // However the flag must be preserved. Thread.currentThread().interrupt(); // But since someone breaks us, let's exit // this waiting loop. break; }
22
exit 2
                  
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { Log.log(Log.ERROR,jEdit.class, "Error while loading system properties!"); Log.log(Log.ERROR,jEdit.class, "One of the following property files could not be loaded:\n" + "- jedit.props\n" + "- jedit_gui.props\n" + "- jedit_en.props\n" + "jedit.jar is probably corrupt."); Log.log(Log.ERROR,jEdit.class,e); System.exit(1); }
// in org/gjt/sp/jedit/JEditKillRing.java
catch (OutOfMemoryError oem) { Log.log(Log.ERROR, this, "Unable to load entire Killring, too low memory, increase your jvm max heap size"); String start = jEdit.getProperty("killring.start"); String deleteKillRing = jEdit.getProperty("killring.delete"); String stop = jEdit.getProperty("killring.stop"); int selected = GUIUtilities.option(null, "killring.load-memoryerror", null, JOptionPane.ERROR_MESSAGE, new Object[]{start, deleteKillRing, stop}, start); if (selected == 2) { System.exit(-1); } else if (selected == 1) { new File(MiscUtilities.constructPath( jEdit.getSettingsDirectory(),"killring.xml")).delete(); return; } }
15
getFamily 2
                  
// in org/gjt/sp/jedit/search/HyperSearchResults.java
catch (Exception e) { style = "color:#000000"; s = SyntaxUtilities.parseStyle(style, f.getFamily(), f.getSize(), true); }
// in org/gjt/sp/util/HtmlUtilities.java
catch (Exception e) { style = "color:#000000"; s = SyntaxUtilities.parseStyle(style, f.getFamily(), f.getSize(), true); }
11
getNode 2
                  
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( TargetError e ) { // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow("Sourced file: "+sourceFileInfo); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e) { if ( DEBUG) e.printStackTrace(); // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow( "Sourced file: "+sourceFileInfo ); }
6
getSize 2
                  
// in org/gjt/sp/jedit/search/HyperSearchResults.java
catch (Exception e) { style = "color:#000000"; s = SyntaxUtilities.parseStyle(style, f.getFamily(), f.getSize(), true); }
// in org/gjt/sp/util/HtmlUtilities.java
catch (Exception e) { style = "color:#000000"; s = SyntaxUtilities.parseStyle(style, f.getFamily(), f.getSize(), true); }
105
getText 2
                  
// in org/gjt/sp/jedit/bsh/BSHSwitchStatement.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Switch value: "+switchExp.getText()+": ", this, callstack ); }
// in org/gjt/sp/jedit/options/GeneralOptionPane.java
catch (NumberFormatException e) { Log.log(Log.WARNING, this, "hypersearchResultsWarning: " + hypersearchResultsWarning.getText() + " is not a valid value for this option"); }
133
getToolkit 2
                  
// in org/gjt/sp/jedit/gui/SelectLineRange.java
catch(NumberFormatException nf) { getToolkit().beep(); return; }
// in org/gjt/sp/jedit/textarea/JEditTextArea.java
catch(Exception e) { getToolkit().beep(); }
119
interrupt 2
                  
// in org/gjt/sp/jedit/io/VFSManager.java
catch (InterruptedException ie) { // preserve interruption flag, but don't stop Thread.currentThread().interrupt(); }
// in org/gjt/sp/jedit/io/VFSManager.java
catch(InterruptedException ie) { // We don't stop, we have to display errors. // However the flag must be preserved. Thread.currentThread().interrupt(); // But since someone breaks us, let's exit // this waiting loop. break; }
4
noClassDefFound
2
                  
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( NoClassDefFoundError e2 ) { throw noClassDefFound( name, e2 ); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( NoClassDefFoundError e ) { throw noClassDefFound( name, e ); }
2
parseStyle 2
                  
// in org/gjt/sp/jedit/search/HyperSearchResults.java
catch (Exception e) { style = "color:#000000"; s = SyntaxUtilities.parseStyle(style, f.getFamily(), f.getSize(), true); }
// in org/gjt/sp/util/HtmlUtilities.java
catch (Exception e) { style = "color:#000000"; s = SyntaxUtilities.parseStyle(style, f.getFamily(), f.getSize(), true); }
13
remove 2
                  
// in org/gjt/sp/jedit/textarea/ExtensionManager.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); // remove it so editor can continue // functioning iter.remove(); }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { Log.log(Log.ERROR, Macros.class, e); macroHandlers.remove(handler); }
211
runInDispatchThread 2
                  
// in org/gjt/sp/jedit/search/HyperSearchRequest.java
catch(final Exception e) { Log.log(Log.ERROR,this,e); ThreadUtilities.runInDispatchThread(new Runnable() { public void run() { SearchAndReplace.handleError(view,e); } }); }
// in org/gjt/sp/jedit/options/PluginManagerOptionPane.java
catch (final Exception ex) { if (download) { Log.log(Log.ERROR,this,ex); ThreadUtilities.runInDispatchThread(new Runnable() { public void run() { GUIUtilities.error(PluginManagerOptionPane.this, "ioerror",new String[] { ex.toString() }); } }); }
23
setNode 2
                  
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( TargetError e ) { // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow("Sourced file: "+sourceFileInfo); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e) { if ( DEBUG) e.printStackTrace(); // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow( "Sourced file: "+sourceFileInfo ); }
3
setPerformingIO 2
                  
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,newPath,"ioerror", new String[] { io.toString() }); setPerformingIO(false); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,newPath,"ioerror", new String[] { io.toString() }); setPerformingIO(false); return false; }
11
setu 2
                  
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( SecurityException e ) { // applets can't see sys props setu( "bsh.cwd", "." ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(TargetError e) { error("// Uncaught Exception: " + e ); if ( e.inNativeCode() ) e.printStackTrace( DEBUG, err ); if(!interactive) eof = true; setu("$_e", e.getTarget()); }
13
throwTypeError
2
                  
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
catch( IllegalArgumentException e ) { Interpreter.debug("illegal arg"+e); throwTypeError( baseType, currentInitializer, i, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
catch( ArrayStoreException e ) { // I think this can happen Interpreter.debug("arraystore"+e); throwTypeError( baseType, currentInitializer, i, callstack ); }
2
BeanShellErrorDialog 1
                  
// in org/gjt/sp/jedit/BeanShellAction.java
catch(Throwable e) { Log.log(Log.ERROR,this,e); new BeanShellErrorDialog(view,e); }
2
BufferedInputStream 1
                  
// in org/gjt/sp/jedit/syntax/ModeProvider.java
catch (FileNotFoundException e1) { InputStream resource = ModeProvider.class.getResourceAsStream(fileName); if (resource == null) error(fileName, e1); grammar = new BufferedInputStream(resource); }
14
BufferedReader 1
                  
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
catch(CharacterCodingException e) { // It seems to be made by an old version of jEdit. in.close(); Log.log(Log.MESSAGE,HistoryModel.class, "Failed to load history with UTF-8." + " Fallbacking to the system default encoding."); in = new BufferedReader(new FileReader(history)); models.putAll(loadFromReader(in)); }
13
FileReader 1
                  
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
catch(CharacterCodingException e) { // It seems to be made by an old version of jEdit. in.close(); Log.log(Log.MESSAGE,HistoryModel.class, "Failed to load history with UTF-8." + " Fallbacking to the system default encoding."); in = new BufferedReader(new FileReader(history)); models.putAll(loadFromReader(in)); }
5
GZIPInputStream 1
                  
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(IOException e) { Log.log(Log.NOTICE, this , path + ": Reopening to rewind the stream"); // Reopen the stream because the mark has been // invalidated while previous reading. markedStream.close(); InputStream in = getNakedStream(); try { if(gzipped) { in = new GZIPInputStream(in); } BufferedInputStream result = AutoDetection.getMarkedStream(in); in = null; return result; } finally { IOUtilities.closeQuietly(in); } }
4
GetImage 1
                  
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch (java.io.IOException e1) { EOFSeen = true; error_after = curPos <= 1 ? "" : input_stream.GetImage(); if (curChar == '\n' || curChar == '\r') { error_line++; error_column = 0; } else error_column++; }
3
LHS 1
                  
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { // not a field, try property access if ( hasObjectPropertySetter( object.getClass(), fieldName ) ) return new LHS( object, fieldName ); else throw e; }
10
URL 1
                  
// in org/gjt/sp/jedit/GUIUtilities.java
catch(Exception e) { try { url = new URL(defaultIconPath + iconName); } catch(Exception ex) { Log.log(Log.ERROR,GUIUtilities.class, "Icon not found: " + iconName); Log.log(Log.ERROR,GUIUtilities.class,ex); return null; } }
20
_delete 1
                  
// in org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); // Incomplete autosave file should not exist. if(out != null) { try { out.close(); out = null; vfs._delete(session,path,view); } catch(IOException ioe) { Log.log(Log.ERROR,this,ioe); } } }
4
add 1
                  
// in org/gjt/sp/jedit/help/HelpTOCPanel.java
catch(FileNotFoundException e) { /* it is acceptable only for the API TOC : the user can choose not to install them */ if("api/toc.xml".equals(path)) { Log.log(Log.NOTICE,this, "The API docs for jEdit will not be available (reinstall jEdit if you want them)"); root.add( createNode("http://www.jedit.org/api/overview-summary.html", jEdit.getProperty("helpviewer.toc.online-apidocs"))); } else { Log.log(Log.ERROR,this,e); } }
1215
createNode 1
                  
// in org/gjt/sp/jedit/help/HelpTOCPanel.java
catch(FileNotFoundException e) { /* it is acceptable only for the API TOC : the user can choose not to install them */ if("api/toc.xml".equals(path)) { Log.log(Log.NOTICE,this, "The API docs for jEdit will not be available (reinstall jEdit if you want them)"); root.add( createNode("http://www.jedit.org/api/overview-summary.html", jEdit.getProperty("helpviewer.toc.online-apidocs"))); } else { Log.log(Log.ERROR,this,e); } }
11
depth 1
                  
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
catch( TargetError e ) { target = e; String stackInfo = "Bsh Stack: "; while ( callstack.depth() > callstackDepth ) stackInfo += "\t" + callstack.pop() +"\n"; }
10
equals 1
                  
// in org/gjt/sp/jedit/help/HelpTOCPanel.java
catch(FileNotFoundException e) { /* it is acceptable only for the API TOC : the user can choose not to install them */ if("api/toc.xml".equals(path)) { Log.log(Log.NOTICE,this, "The API docs for jEdit will not be available (reinstall jEdit if you want them)"); root.add( createNode("http://www.jedit.org/api/overview-summary.html", jEdit.getProperty("helpviewer.toc.online-apidocs"))); } else { Log.log(Log.ERROR,this,e); } }
688
errorWhileMapping 1
                  
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch ( IOException e ) { String s = "Error constructing classpath: " +urls[i]+": "+e; errorWhileMapping( s ); }
3
forName 1
                  
// in org/gjt/sp/jedit/MiscUtilities.java
catch(ClassNotFoundException e1) { Class.forName("com.sun.tools.javac.Main"); }
14
getActiveView 1
                  
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch(java.net.UnknownHostException e) { GUIUtilities.error(jEdit.getActiveView() , "plugin-manager.list-download.disconnected" , new Object[]{e.getMessage()}); Log.log (Log.ERROR, this, "CacheRemotePluginList: error", e); }
38
getBooleanProperty 1
                  
// in org/gjt/sp/jedit/jEdit.java
catch (IOException e) { if (getBooleanProperty("lang.usedefaultlocale")) { // if it is the default locale, it is not an error Log.log(Log.ERROR, jEdit.class, "Unable to load language", e); } }
341
getCause
1
                  
// in org/gjt/sp/jedit/EditBus.java
catch (InvocationTargetException t) { Log.log(Log.ERROR,EditBus.class,"Exception" + " while sending message on EditBus:"); Log.log(Log.ERROR, EditBus.class, t.getCause()); }
1
getCharsetName
1
                  
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(UnsupportedCharsetException e) { Log.log(Log.ERROR, this, e, e); String[] pp = { e.getCharsetName() }; VFSManager.error(view,path,"ioerror.unsupported-encoding-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
1
getClassName 1
                  
// in org/gjt/sp/jedit/PluginJAR.java
catch(Throwable t) { breakPlugin(); Log.log(Log.ERROR,PluginJAR.this, "Error while starting plugin " + plugin.getClassName()); Log.log(Log.ERROR,PluginJAR.this,t); String[] args = { t.toString() }; jEdit.pluginError(path, "plugin-error.start-error",args); }
39
getComponent 1
                  
// in org/gjt/sp/jedit/help/HelpSearchPanel.java
catch(Exception e) { index = null; Log.log(Log.ERROR,this,e); GUIUtilities.error(helpViewer.getComponent(),"helpviewer.search.error", new String[] { e.toString() }); }
23
getDeclaringClass
1
                  
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( IllegalAccessException e ) { throw new ReflectError( "Cannot access method " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " in '" + method.getDeclaringClass() + "' :" + e ); }
1
getFilePath 1
                  
// in org/gjt/sp/jedit/io/UrlVFS.java
catch (MalformedURLException mue) { Log.log(Log.ERROR,this,mue); return super.getFilePath(vfsPath); }
3
getLineNumber 1
                  
// in org/gjt/sp/util/XMLUtilities.java
catch(SAXParseException se) { int line = se.getLineNumber(); Log.log(Log.ERROR,XMLUtilities.class, "while parsing from " + in + ": SAXParseException: line " + line + ": " , se); return true; }
7
getMarkedStream 1
                  
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(IOException e) { Log.log(Log.NOTICE, this , path + ": Reopening to rewind the stream"); // Reopen the stream because the mark has been // invalidated while previous reading. markedStream.close(); InputStream in = getNakedStream(); try { if(gzipped) { in = new GZIPInputStream(in); } BufferedInputStream result = AutoDetection.getMarkedStream(in); in = null; return result; } finally { IOUtilities.closeQuietly(in); } }
6
getNakedStream 1
                  
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(IOException e) { Log.log(Log.NOTICE, this , path + ": Reopening to rewind the stream"); // Reopen the stream because the mark has been // invalidated while previous reading. markedStream.close(); InputStream in = getNakedStream(); try { if(gzipped) { in = new GZIPInputStream(in); } BufferedInputStream result = AutoDetection.getMarkedStream(in); in = null; return result; } finally { IOUtilities.closeQuietly(in); } }
2
getObjectProperty 1
                  
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { // no field, try property acces if ( hasObjectPropertyGetter( object.getClass(), fieldName ) ) return getObjectProperty( object, fieldName ); else throw e; }
3
getParameterTypes 1
                  
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( IllegalAccessException e ) { throw new ReflectError( "Cannot access method " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " in '" + method.getDeclaringClass() + "' :" + e ); }
22
getPath 1
                  
// in org/gjt/sp/jedit/help/HelpIndex.java
catch(Throwable e) { Log.log(Log.ERROR,this,"Error indexing JAR: " + jars[i].getPath()); Log.log(Log.ERROR,this,e); }
170
getResourceAsStream 1
                  
// in org/gjt/sp/jedit/syntax/ModeProvider.java
catch (FileNotFoundException e1) { InputStream resource = ModeProvider.class.getResourceAsStream(fileName); if (resource == null) error(fileName, e1); grammar = new BufferedInputStream(resource); }
20
getSettingsDirectory 1
                  
// in org/gjt/sp/jedit/JEditKillRing.java
catch (OutOfMemoryError oem) { Log.log(Log.ERROR, this, "Unable to load entire Killring, too low memory, increase your jvm max heap size"); String start = jEdit.getProperty("killring.start"); String deleteKillRing = jEdit.getProperty("killring.delete"); String stop = jEdit.getProperty("killring.stop"); int selected = GUIUtilities.option(null, "killring.load-memoryerror", null, JOptionPane.ERROR_MESSAGE, new Object[]{start, deleteKillRing, stop}, start); if (selected == 2) { System.exit(-1); } else if (selected == 1) { new File(MiscUtilities.constructPath( jEdit.getSettingsDirectory(),"killring.xml")).delete(); return; } }
42
getType 1
                  
// in org/gjt/sp/jedit/bsh/LHS.java
catch( IllegalArgumentException e3) { String type = val instanceof Primitive ? ((Primitive)val).getType().getName() : val.getClass().getName(); throw new UtilEvalError( "Argument type mismatch. " + (val == null ? "null" : type ) + " not assignable to field "+field.getName()); }
98
getWriteEncodingErrorMessage
1
                  
// in org/gjt/sp/jedit/bufferio/BufferIORequest.java
catch(CharacterCodingException e) { String message = getWriteEncodingErrorMessage( encodingName, encoding, lineSegment, i); IOException wrapping = new CharConversionException(message); wrapping.initCause(e); throw wrapping; }
1
hasObjectPropertyGetter
1
                  
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { // no field, try property acces if ( hasObjectPropertyGetter( object.getClass(), fieldName ) ) return getObjectProperty( object, fieldName ); else throw e; }
1
hasObjectPropertySetter
1
                  
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { // not a field, try property access if ( hasObjectPropertySetter( object.getClass(), fieldName ) ) return new LHS( object, fieldName ); else throw e; }
1
initCause
1
                  
// in org/gjt/sp/jedit/bufferio/BufferIORequest.java
catch(CharacterCodingException e) { String message = getWriteEncodingErrorMessage( encodingName, encoding, lineSegment, i); IOException wrapping = new CharConversionException(message); wrapping.initCause(e); throw wrapping; }
1
jjFillToken 1
                  
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjmatchedKind = 0; matchedToken = jjFillToken(); matchedToken.specialToken = specialToken; return matchedToken; }
3
loadFromReader 1
                  
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
catch(CharacterCodingException e) { // It seems to be made by an old version of jEdit. in.close(); Log.log(Log.MESSAGE,HistoryModel.class, "Failed to load history with UTF-8." + " Fallbacking to the system default encoding."); in = new BufferedReader(new FileReader(history)); models.putAll(loadFromReader(in)); }
2
methodString 1
                  
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( IllegalAccessException e ) { throw new ReflectError( "Cannot access method " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " in '" + method.getDeclaringClass() + "' :" + e ); }
8
option 1
                  
// in org/gjt/sp/jedit/JEditKillRing.java
catch (OutOfMemoryError oem) { Log.log(Log.ERROR, this, "Unable to load entire Killring, too low memory, increase your jvm max heap size"); String start = jEdit.getProperty("killring.start"); String deleteKillRing = jEdit.getProperty("killring.delete"); String stop = jEdit.getProperty("killring.stop"); int selected = GUIUtilities.option(null, "killring.load-memoryerror", null, JOptionPane.ERROR_MESSAGE, new Object[]{start, deleteKillRing, stop}, start); if (selected == 2) { System.exit(-1); } else if (selected == 1) { new File(MiscUtilities.constructPath( jEdit.getSettingsDirectory(),"killring.xml")).delete(); return; } }
2
pop 1
                  
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
catch( TargetError e ) { target = e; String stackInfo = "Bsh Stack: "; while ( callstack.depth() > callstackDepth ) stackInfo += "\t" + callstack.pop() +"\n"; }
42
put 1
                  
// in org/gjt/sp/jedit/JARClassLoader.java
catch (ClassNotFoundException cnf2) { classHash.put(clazz,NO_CLASS); throw cnf2; }
332
putAll 1
                  
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
catch(CharacterCodingException e) { // It seems to be made by an old version of jEdit. in.close(); Log.log(Log.MESSAGE,HistoryModel.class, "Failed to load history with UTF-8." + " Fallbacking to the system default encoding."); in = new BufferedReader(new FileReader(history)); models.putAll(loadFromReader(in)); }
9
reInitInput
1
                  
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(ParseException e) { error("Parser Error: " + e.getMessage(DEBUG)); if ( DEBUG ) e.printStackTrace(); if(!interactive) eof = true; parser.reInitInput(in); }
1
reInitTokenInput
1
                  
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(TokenMgrError e) { error("Error parsing input: " + e); /* We get stuck in infinite loops here when unicode escapes fail. Must re-init the char stream reader (ASCII_UCodeESC_CharStream.java) */ parser.reInitTokenInput( in ); if(!interactive) eof = true; }
1
readPluginList 1
                  
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch (Exception e) { Log.log(Log.ERROR, this, "readpluginlist: error", e); if (cachedURL.startsWith("file:///")) { Log.log(Log.DEBUG, this, "Unable to read plugin list, deleting cached file and try again"); new File(cachedURL.substring(8)).delete(); if (allowRetry) { plugins.clear(); pluginHash.clear(); pluginSets.clear(); readPluginList(false); } } }
2
restoreFlatNodes 1
                  
// in org/gjt/sp/jedit/search/HyperSearchResults.java
catch (Exception ex) { operNodeObj.restoreFlatNodes(resultTree, operNode); menuItem.setSelected(false); excp = ex; }
2
searchFailed 1
                  
// in org/gjt/sp/jedit/search/SearchAndReplace.java
catch(Exception e) { results.searchFailed(); handleError(comp,e); return false; }
4
setErrorSourceFile
1
                  
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(ParseException e) { /* throw new EvalError( "Sourced file: "+sourceFileInfo+" parser Error: " + e.getMessage( DEBUG ), node, callstack ); */ if ( DEBUG ) // show extra "expecting..." info error( e.getMessage(DEBUG) ); // add the source file info and throw again e.setErrorSourceFile( sourceFileInfo ); throw e; }
1
setSelected 1
                  
// in org/gjt/sp/jedit/search/HyperSearchResults.java
catch (Exception ex) { operNodeObj.restoreFlatNodes(resultTree, operNode); menuItem.setSelected(false); excp = ex; }
160
startsWith 1
                  
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch (Exception e) { Log.log(Log.ERROR, this, "readpluginlist: error", e); if (cachedURL.startsWith("file:///")) { Log.log(Log.DEBUG, this, "Unable to read plugin list, deleting cached file and try again"); new File(cachedURL.substring(8)).delete(); if (allowRetry) { plugins.clear(); pluginHash.clear(); pluginSets.clear(); readPluginList(false); } } }
102
substring 1
                  
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch (Exception e) { Log.log(Log.ERROR, this, "readpluginlist: error", e); if (cachedURL.startsWith("file:///")) { Log.log(Log.DEBUG, this, "Unable to read plugin list, deleting cached file and try again"); new File(cachedURL.substring(8)).delete(); if (allowRetry) { plugins.clear(); pluginHash.clear(); pluginSets.clear(); readPluginList(false); } } }
202
tell
1
                  
// in org/gjt/sp/jedit/gui/AboutDialog.java
catch(Exception exc) { tell("AboutPanel: " + exc); }
1
toUpperCase 1
                  
// in org/gjt/sp/jedit/GUIUtilities.java
catch(Exception e) { // This is probably an error, but it will be logged in // KeyEventTranslator.parseKey anyway, so just ignore it here. text = key.toUpperCase(); }
29
uninit 1
                  
// in org/gjt/sp/jedit/PluginJAR.java
catch(IOException io) { Log.log(Log.ERROR,this,"Cannot load" + " plugin " + path); Log.log(Log.ERROR,this,io); String[] args = { io.toString() }; jEdit.pluginError(path,"plugin-error.load-error",args); uninit(false); }
5
Method Nbr Nbr total
closeNodeScope 55
                  
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 3); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, retainComments); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
109
jjtreeCloseNodeScope 55
                  
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 3); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, retainComments); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
// in org/gjt/sp/jedit/bsh/Parser.java
finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } }
109
closeQuietly 47
                  
// in org/jedit/keymap/KeymapManagerImpl.java
finally { IOUtilities.closeQuietly(in); IOUtilities.closeQuietly(out); }
// in org/jedit/keymap/KeymapImpl.java
finally { IOUtilities.closeQuietly(in); }
// in org/jedit/keymap/KeymapImpl.java
finally { IOUtilities.closeQuietly(out); }
// in org/gjt/sp/jedit/pluginmgr/MirrorList.java
finally { IOUtilities.closeQuietly(inputStream); }
// in org/gjt/sp/jedit/pluginmgr/MirrorList.java
finally { IOUtilities.closeQuietly(inputStream); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
finally { IOUtilities.closeQuietly(in); IOUtilities.closeQuietly(out); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
finally { IOUtilities.closeQuietly(in); IOUtilities.closeQuietly(out); }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
finally { IOUtilities.closeQuietly(writer); }
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
finally { IOUtilities.closeQuietly(in); IOUtilities.closeQuietly(inputStream); }
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
finally { IOUtilities.closeQuietly(out); IOUtilities.closeQuietly(is); }
// in org/gjt/sp/jedit/gui/DockableWindowManagerImpl.java
finally { IOUtilities.closeQuietly(out); }
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
finally { IOUtilities.closeQuietly(in); }
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
finally { IOUtilities.closeQuietly(out); }
// in org/gjt/sp/jedit/io/VFSFile.java
finally { IOUtilities.closeQuietly(in); }
// in org/gjt/sp/jedit/io/LocalFileSaveTask.java
finally { IOUtilities.closeQuietly(ch); IOUtilities.closeQuietly(os); }
// in org/gjt/sp/jedit/io/FileVFS.java
finally { IOUtilities.closeQuietly(reader); }
// in org/gjt/sp/jedit/io/VFS.java
finally { IOUtilities.closeQuietly(in); IOUtilities.closeQuietly(out); }
// in org/gjt/sp/jedit/jEdit.java
finally { IOUtilities.closeQuietly(out); }
// in org/gjt/sp/jedit/jEdit.java
finally { IOUtilities.closeQuietly(out); }
// in org/gjt/sp/jedit/jEdit.java
finally { IOUtilities.closeQuietly(langResource); }
// in org/gjt/sp/jedit/BufferHistory.java
finally { IOUtilities.closeQuietly(out); }
// in org/gjt/sp/jedit/options/AppearanceOptionPane.java
finally { IOUtilities.closeQuietly(out); }
// in org/gjt/sp/jedit/options/PluginManagerOptionPane.java
finally { IOUtilities.closeQuietly(out); }
// in org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
finally { IOUtilities.closeQuietly(out); }
// in org/gjt/sp/jedit/bufferio/MarkersSaveRequest.java
finally { IOUtilities.closeQuietly(out); }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
finally { IOUtilities.closeQuietly(in); try { vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
finally { IOUtilities.closeQuietly(out); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
finally { IOUtilities.closeQuietly(markers); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
finally { IOUtilities.closeQuietly(in); }
// in org/gjt/sp/jedit/PerspectiveManager.java
finally { IOUtilities.closeQuietly(out); }
// in org/gjt/sp/jedit/JEditKillRing.java
finally { IOUtilities.closeQuietly(out); }
// in org/gjt/sp/jedit/JEditRegisterSaver.java
finally { IOUtilities.closeQuietly(out); }
// in org/gjt/sp/jedit/textarea/StandaloneTextArea.java
finally { IOUtilities.closeQuietly(in); }
// in org/gjt/sp/jedit/syntax/ModeProvider.java
finally { IOUtilities.closeQuietly(grammar); }
// in org/gjt/sp/jedit/PluginJAR.java
finally { IOUtilities.closeQuietly(din); }
// in org/gjt/sp/jedit/PluginJAR.java
finally { IOUtilities.closeQuietly(in); }
// in org/gjt/sp/jedit/PluginJAR.java
finally { IOUtilities.closeQuietly(in); }
// in org/gjt/sp/util/IOUtilities.java
finally { closeQuietly(fos); closeQuietly(fis); }
// in org/gjt/sp/util/XMLUtilities.java
finally { IOUtilities.closeQuietly(in); }
48
endCompoundEdit 35
                  
// in org/gjt/sp/jedit/gui/InputHandler.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/gui/InputHandler.java
finally { if(repeatCount != 1) buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/gui/InputHandler.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/input/TextAreaInputHandler.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/Registers.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { endCompoundEdit(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { endCompoundEdit(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { endCompoundEdit(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { endCompoundEdit(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { endCompoundEdit(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { endCompoundEdit(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { endCompoundEdit(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { endCompoundEdit(); }
// in org/gjt/sp/jedit/BeanShell.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/textarea/TextAreaTransferHandler.java
finally { if(compoundEdit) { compoundEdit = false; textArea.getBuffer().endCompoundEdit(); } }
// in org/gjt/sp/jedit/textarea/TextArea.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/textarea/TextArea.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/textarea/TextArea.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/textarea/TextArea.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/textarea/TextArea.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/textarea/TextArea.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/textarea/TextArea.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/textarea/TextArea.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/textarea/TextArea.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/textarea/TextArea.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/textarea/TextArea.java
finally { if(overwrite || indent) buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/textarea/TextArea.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/textarea/TextArea.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/textarea/TextArea.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/Macros.java
finally { buffer.endCompoundEdit(); }
// in org/gjt/sp/jedit/Macros.java
finally { view.getBuffer().endCompoundEdit(); }
// in org/gjt/sp/jedit/Macros.java
finally { /* I already wrote a comment expaining this in * Macro.invoke(). */ if(buffer.insideCompoundEdit()) buffer.endCompoundEdit(); }
42
_endVFSSession
17
                  
// in org/gjt/sp/jedit/gui/statusbar/LastModifiedWidgetFactory.java
finally { try { vfs._endVFSSession(session, view); } catch (IOException e) { } }
// in org/gjt/sp/jedit/io/VFSFile.java
finally { try { vfs._endVFSSession(session,browser); } catch(IOException e) { VFSManager.error(e,path,browser); } }
// in org/gjt/sp/jedit/io/CopyFileWorker.java
finally { VFSManager.sendVFSUpdate(vfs, target, true); try { if (targetSession != null) vfs._endVFSSession(targetSession, comp); } catch (IOException e) { } }
// in org/gjt/sp/jedit/io/VFS.java
finally { vfsDst._endVFSSession(sessionDst, comp); }
// in org/gjt/sp/jedit/search/DirectoryListSet.java
finally { vfs._endVFSSession(session, comp); }
// in org/gjt/sp/jedit/Buffer.java
finally { try { vfs._endVFSSession(session,view); } catch(IOException io) { VFSManager.error(view,newPath,"ioerror", new String[] { io.toString() }); setPerformingIO(false); return false; } }
// in org/gjt/sp/jedit/Buffer.java
finally { try { vfs._endVFSSession(session,view); } catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; } }
// in org/gjt/sp/jedit/Buffer.java
finally { try { vfs._endVFSSession(session,view); } catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; } }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
finally { IOUtilities.closeQuietly(in); try { vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
finally { try { vfs._saveComplete(session,buffer,path,view); if( twoStageSave ) { vfs._finishTwoStageSave(session,buffer,path,view); } // clean up left-over markers file if(!jEdit.getBooleanProperty("persistentMarkers")) vfs._delete(session,Buffer.getMarkersPath(vfs, path),view); vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
finally { try { vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
// in org/gjt/sp/jedit/browser/DeleteBrowserTask.java
finally { try { vfs._endVFSSession(session, browser); } catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); } }
// in org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java
finally { try { vfs._endVFSSession(session,browser); } catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); String[] pp = { io.toString() }; VFSManager.error(browser, path,"ioerror.directory-error",pp); } }
// in org/gjt/sp/jedit/browser/VFSFileChooserDialog.java
finally { try { vfs._endVFSSession( session, browser); } catch(IOException e) { VFSManager.error(e,path,browser); } }
// in org/gjt/sp/jedit/browser/RenameBrowserTask.java
finally { try { vfs._endVFSSession(session, browser); } catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); } }
// in org/gjt/sp/jedit/browser/MkDirBrowserTask.java
finally { try { vfs._endVFSSession(session,browser); } catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); args[0] = io.toString(); VFSManager.error(browser, path,"ioerror",args); } }
// in org/gjt/sp/jedit/browser/VFSBrowser.java
finally { vfs._endVFSSession(vfsSession, this); }
17
readUnlock
17
                  
// in org/gjt/sp/jedit/search/HyperSearchRequest.java
finally { buffer.readUnlock(); }
// in org/gjt/sp/jedit/search/HyperSearchRequest.java
finally { buffer.readUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { readUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { readUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { readUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { readUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { readUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { readUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { readUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { readUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { readUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { readUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { readUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { readUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { readUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { readUnlock(); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
finally { buffer.readUnlock(); }
17
error 12
                  
// in org/gjt/sp/jedit/io/VFSFile.java
finally { try { vfs._endVFSSession(session,browser); } catch(IOException e) { VFSManager.error(e,path,browser); } }
// in org/gjt/sp/jedit/Buffer.java
finally { try { vfs._endVFSSession(session,view); } catch(IOException io) { VFSManager.error(view,newPath,"ioerror", new String[] { io.toString() }); setPerformingIO(false); return false; } }
// in org/gjt/sp/jedit/Buffer.java
finally { try { vfs._endVFSSession(session,view); } catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; } }
// in org/gjt/sp/jedit/Buffer.java
finally { try { vfs._endVFSSession(session,view); } catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; } }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
finally { IOUtilities.closeQuietly(in); try { vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
finally { try { vfs._saveComplete(session,buffer,path,view); if( twoStageSave ) { vfs._finishTwoStageSave(session,buffer,path,view); } // clean up left-over markers file if(!jEdit.getBooleanProperty("persistentMarkers")) vfs._delete(session,Buffer.getMarkersPath(vfs, path),view); vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
finally { try { vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
// in org/gjt/sp/jedit/browser/DeleteBrowserTask.java
finally { try { vfs._endVFSSession(session, browser); } catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); } }
// in org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java
finally { try { vfs._endVFSSession(session,browser); } catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); String[] pp = { io.toString() }; VFSManager.error(browser, path,"ioerror.directory-error",pp); } }
// in org/gjt/sp/jedit/browser/VFSFileChooserDialog.java
finally { try { vfs._endVFSSession( session, browser); } catch(IOException e) { VFSManager.error(e,path,browser); } }
// in org/gjt/sp/jedit/browser/RenameBrowserTask.java
finally { try { vfs._endVFSSession(session, browser); } catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); } }
// in org/gjt/sp/jedit/browser/MkDirBrowserTask.java
finally { try { vfs._endVFSSession(session,browser); } catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); args[0] = io.toString(); VFSManager.error(browser, path,"ioerror",args); } }
131
log 12
                  
// in org/gjt/sp/jedit/pluginmgr/Roster.java
finally { try { if(zipFile != null) zipFile.close(); } catch(IOException io) { Log.log(Log.ERROR,this,io); } if(jEdit.getBooleanProperty( "plugin-manager.deleteDownloads")) { new File(path).delete(); } }
// in org/gjt/sp/jedit/EditServer.java
finally { try { BeanShell.getNameSpace().setVariable("socket",null); } catch(org.gjt.sp.jedit.bsh.UtilEvalError e) { Log.log(Log.ERROR,this,e); } }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
finally { IOUtilities.closeQuietly(in); try { vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
finally { try { vfs._saveComplete(session,buffer,path,view); if( twoStageSave ) { vfs._finishTwoStageSave(session,buffer,path,view); } // clean up left-over markers file if(!jEdit.getBooleanProperty("persistentMarkers")) vfs._delete(session,Buffer.getMarkersPath(vfs, path),view); vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
finally { try { vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
// in org/gjt/sp/jedit/JEditBeanShellAction.java
finally { try { global.setVariable("_comp",null); } catch(UtilEvalError err) { Log.log(Log.ERROR,this,err); } }
// in org/gjt/sp/jedit/browser/DeleteBrowserTask.java
finally { try { vfs._endVFSSession(session, browser); } catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); } }
// in org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java
finally { try { vfs._endVFSSession(session,browser); } catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); String[] pp = { io.toString() }; VFSManager.error(browser, path,"ioerror.directory-error",pp); } }
// in org/gjt/sp/jedit/browser/RenameBrowserTask.java
finally { try { vfs._endVFSSession(session, browser); } catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); } }
// in org/gjt/sp/jedit/browser/MkDirBrowserTask.java
finally { try { vfs._endVFSSession(session,browser); } catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); args[0] = io.toString(); VFSManager.error(browser, path,"ioerror",args); } }
// in org/gjt/sp/jedit/browser/VFSBrowser.java
finally { try { global.setVariable("browser",null); global.setVariable("files",null); } catch(UtilEvalError err) { Log.log(Log.ERROR,this,err); } }
// in org/gjt/sp/jedit/BeanShellAction.java
finally { try { global.setVariable("_comp",null); } catch(UtilEvalError err) { Log.log(Log.ERROR,this,err); } }
602
close 11
                  
// in org/gjt/sp/jedit/pluginmgr/Roster.java
finally { try { if(zipFile != null) zipFile.close(); } catch(IOException io) { Log.log(Log.ERROR,this,io); } if(jEdit.getBooleanProperty( "plugin-manager.deleteDownloads")) { new File(path).delete(); } }
// in org/gjt/sp/jedit/help/HelpIndex.java
finally { in.close(); }
// in org/gjt/sp/jedit/PropertyManager.java
finally { in.close(); }
// in org/gjt/sp/jedit/PropertyManager.java
finally { in.close(); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
finally { sourceIn.close(); }
// in org/gjt/sp/jedit/EditServer.java
finally { out.close(); }
// in org/gjt/sp/jedit/jEdit.java
finally { if (text == null) { bytes.close(); } }
// in org/gjt/sp/jedit/Abbrevs.java
finally { in.close(); }
// in org/gjt/sp/jedit/bufferio/MarkersSaveRequest.java
finally { o.close(); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
finally { markedStream.close(); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
finally { in.close(); }
68
toString 10
                  
// in org/gjt/sp/jedit/Buffer.java
finally { try { vfs._endVFSSession(session,view); } catch(IOException io) { VFSManager.error(view,newPath,"ioerror", new String[] { io.toString() }); setPerformingIO(false); return false; } }
// in org/gjt/sp/jedit/Buffer.java
finally { try { vfs._endVFSSession(session,view); } catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; } }
// in org/gjt/sp/jedit/Buffer.java
finally { try { vfs._endVFSSession(session,view); } catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; } }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
finally { IOUtilities.closeQuietly(in); try { vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
finally { try { vfs._saveComplete(session,buffer,path,view); if( twoStageSave ) { vfs._finishTwoStageSave(session,buffer,path,view); } // clean up left-over markers file if(!jEdit.getBooleanProperty("persistentMarkers")) vfs._delete(session,Buffer.getMarkersPath(vfs, path),view); vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
finally { try { vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
// in org/gjt/sp/jedit/browser/DeleteBrowserTask.java
finally { try { vfs._endVFSSession(session, browser); } catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); } }
// in org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java
finally { try { vfs._endVFSSession(session,browser); } catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); String[] pp = { io.toString() }; VFSManager.error(browser, path,"ioerror.directory-error",pp); } }
// in org/gjt/sp/jedit/browser/RenameBrowserTask.java
finally { try { vfs._endVFSSession(session, browser); } catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); } }
// in org/gjt/sp/jedit/browser/MkDirBrowserTask.java
finally { try { vfs._endVFSSession(session,browser); } catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); args[0] = io.toString(); VFSManager.error(browser, path,"ioerror",args); } }
332
writeUnlock
9
                  
// in org/gjt/sp/jedit/Buffer.java
finally { writeUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { writeUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { transaction = false; writeUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { writeUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { undoInProgress = false; writeUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { undoInProgress = false; writeUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { writeUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { writeUnlock(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
finally { writeUnlock(); }
9
unlock 7
                  
// in org/gjt/sp/jedit/EditBus.java
finally { components.unlock(); }
// in org/gjt/sp/jedit/BufferHistory.java
finally { historyLock.readLock().unlock(); }
// in org/gjt/sp/jedit/BufferHistory.java
finally { historyLock.writeLock().unlock(); }
// in org/gjt/sp/jedit/BufferHistory.java
finally { historyLock.writeLock().unlock(); }
// in org/gjt/sp/jedit/BufferHistory.java
finally { historyLock.readLock().unlock(); }
// in org/gjt/sp/jedit/BufferHistory.java
finally { historyLock.writeLock().unlock(); }
// in org/gjt/sp/jedit/BufferHistory.java
finally { historyLock.writeLock().unlock(); }
9
setBooleanProperty 6
                  
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
finally { IOUtilities.closeQuietly(in); try { vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
finally { try { vfs._saveComplete(session,buffer,path,view); if( twoStageSave ) { vfs._finishTwoStageSave(session,buffer,path,view); } // clean up left-over markers file if(!jEdit.getBooleanProperty("persistentMarkers")) vfs._delete(session,Buffer.getMarkersPath(vfs, path),view); vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
finally { try { vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
167
setVariable 5
                  
// in org/gjt/sp/jedit/EditServer.java
finally { try { BeanShell.getNameSpace().setVariable("socket",null); } catch(org.gjt.sp.jedit.bsh.UtilEvalError e) { Log.log(Log.ERROR,this,e); } }
// in org/gjt/sp/jedit/JEditBeanShellAction.java
finally { try { global.setVariable("_comp",null); } catch(UtilEvalError err) { Log.log(Log.ERROR,this,err); } }
// in org/gjt/sp/jedit/browser/VFSBrowser.java
finally { try { global.setVariable("browser",null); global.setVariable("files",null); } catch(UtilEvalError err) { Log.log(Log.ERROR,this,err); } }
// in org/gjt/sp/jedit/BeanShellAction.java
finally { try { global.setVariable("_comp",null); } catch(UtilEvalError err) { Log.log(Log.ERROR,this,err); } }
46
setCancellable 4
                  
// in org/gjt/sp/jedit/browser/DeleteBrowserTask.java
finally { try { vfs._endVFSSession(session, browser); } catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); } }
// in org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java
finally { try { vfs._endVFSSession(session,browser); } catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); String[] pp = { io.toString() }; VFSManager.error(browser, path,"ioerror.directory-error",pp); } }
// in org/gjt/sp/jedit/browser/RenameBrowserTask.java
finally { try { vfs._endVFSSession(session, browser); } catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); } }
// in org/gjt/sp/jedit/browser/MkDirBrowserTask.java
finally { try { vfs._endVFSSession(session,browser); } catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); args[0] = io.toString(); VFSManager.error(browser, path,"ioerror",args); } }
17
writeLock 4
                  
// in org/gjt/sp/jedit/BufferHistory.java
finally { historyLock.writeLock().unlock(); }
// in org/gjt/sp/jedit/BufferHistory.java
finally { historyLock.writeLock().unlock(); }
// in org/gjt/sp/jedit/BufferHistory.java
finally { historyLock.writeLock().unlock(); }
// in org/gjt/sp/jedit/BufferHistory.java
finally { historyLock.writeLock().unlock(); }
19
hideWaitCursor
3
                  
// in org/gjt/sp/jedit/search/SearchAndReplace.java
finally { view.hideWaitCursor(); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
finally { view.hideWaitCursor(); }
// in org/gjt/sp/jedit/jEdit.java
finally { if(view != null) view.hideWaitCursor(); }
3
reset 3
                  
// in org/gjt/sp/jedit/bsh/Interpreter.java
finally { get_jjtree().reset(); // reinit the callstack if ( callstack.depth() > 1 ) { callstack.clear(); callstack.push( globalNameSpace ); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
finally { localInterpreter.get_jjtree().reset(); // reinit the callstack if ( callstack.depth() > 1 ) { callstack.clear(); callstack.push( nameSpace ); } }
// in org/gjt/sp/util/Log.java
finally { buffer.reset(); }
41
resetDefaultVariables
3
                  
// in org/gjt/sp/jedit/BeanShellFacade.java
finally { try { resetDefaultVariables(namespace); } catch(UtilEvalError e) { // do nothing } }
// in org/gjt/sp/jedit/BeanShellFacade.java
finally { resetDefaultVariables(namespace); }
// in org/gjt/sp/jedit/BeanShell.java
finally { running = false; try { // no need to do this for macros! if(namespace == bsh.getNameSpace()) { bsh.resetDefaultVariables(namespace); interp.unset("scriptPath"); } } catch(EvalError e) { // do nothing } }
3
clear 2
                  
// in org/gjt/sp/jedit/bsh/Interpreter.java
finally { get_jjtree().reset(); // reinit the callstack if ( callstack.depth() > 1 ) { callstack.clear(); callstack.push( globalNameSpace ); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
finally { localInterpreter.get_jjtree().reset(); // reinit the callstack if ( callstack.depth() > 1 ) { callstack.clear(); callstack.push( nameSpace ); } }
62
depth 2
                  
// in org/gjt/sp/jedit/bsh/Interpreter.java
finally { get_jjtree().reset(); // reinit the callstack if ( callstack.depth() > 1 ) { callstack.clear(); callstack.push( globalNameSpace ); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
finally { localInterpreter.get_jjtree().reset(); // reinit the callstack if ( callstack.depth() > 1 ) { callstack.clear(); callstack.push( nameSpace ); } }
10
getBooleanProperty 2
                  
// in org/gjt/sp/jedit/pluginmgr/Roster.java
finally { try { if(zipFile != null) zipFile.close(); } catch(IOException io) { Log.log(Log.ERROR,this,io); } if(jEdit.getBooleanProperty( "plugin-manager.deleteDownloads")) { new File(path).delete(); } }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
finally { try { vfs._saveComplete(session,buffer,path,view); if( twoStageSave ) { vfs._finishTwoStageSave(session,buffer,path,view); } // clean up left-over markers file if(!jEdit.getBooleanProperty("persistentMarkers")) vfs._delete(session,Buffer.getMarkersPath(vfs, path),view); vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
341
getBuffer 2
                  
// in org/gjt/sp/jedit/textarea/TextAreaTransferHandler.java
finally { if(compoundEdit) { compoundEdit = false; textArea.getBuffer().endCompoundEdit(); } }
// in org/gjt/sp/jedit/Macros.java
finally { view.getBuffer().endCompoundEdit(); }
178
getNameSpace 2
                  
// in org/gjt/sp/jedit/EditServer.java
finally { try { BeanShell.getNameSpace().setVariable("socket",null); } catch(org.gjt.sp.jedit.bsh.UtilEvalError e) { Log.log(Log.ERROR,this,e); } }
// in org/gjt/sp/jedit/BeanShell.java
finally { running = false; try { // no need to do this for macros! if(namespace == bsh.getNameSpace()) { bsh.resetDefaultVariables(namespace); interp.unset("scriptPath"); } } catch(EvalError e) { // do nothing } }
36
get_jjtree 2
                  
// in org/gjt/sp/jedit/bsh/Interpreter.java
finally { get_jjtree().reset(); // reinit the callstack if ( callstack.depth() > 1 ) { callstack.clear(); callstack.push( globalNameSpace ); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
finally { localInterpreter.get_jjtree().reset(); // reinit the callstack if ( callstack.depth() > 1 ) { callstack.clear(); callstack.push( nameSpace ); } }
6
push 2
                  
// in org/gjt/sp/jedit/bsh/Interpreter.java
finally { get_jjtree().reset(); // reinit the callstack if ( callstack.depth() > 1 ) { callstack.clear(); callstack.push( globalNameSpace ); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
finally { localInterpreter.get_jjtree().reset(); // reinit the callstack if ( callstack.depth() > 1 ) { callstack.clear(); callstack.push( nameSpace ); } }
34
readLock 2
                  
// in org/gjt/sp/jedit/BufferHistory.java
finally { historyLock.readLock().unlock(); }
// in org/gjt/sp/jedit/BufferHistory.java
finally { historyLock.readLock().unlock(); }
23
runInDispatchThread 2
                  
// in org/gjt/sp/jedit/search/HyperSearchRequest.java
finally { ThreadUtilities.runInDispatchThread(new Runnable() { public void run() { results.searchDone(rootSearchNode, selectNode); } }); }
// in org/gjt/sp/jedit/options/PluginManagerOptionPane.java
finally { ThreadUtilities.runInDispatchThread(new Runnable() { public void run() { updateMirrors.setEnabled(true); updateStatus.setText(null); } }); }
23
swap 2
                  
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
finally { // put it back callstack.swap( enclosingNameSpace ); }
// in org/gjt/sp/jedit/bsh/BSHBlock.java
finally { // make sure we put the namespace back when we leave. if ( !overrideNamespace ) callstack.swap( enclosingNameSpace ); }
8
File 1
                  
// in org/gjt/sp/jedit/pluginmgr/Roster.java
finally { try { if(zipFile != null) zipFile.close(); } catch(IOException io) { Log.log(Log.ERROR,this,io); } if(jEdit.getBooleanProperty( "plugin-manager.deleteDownloads")) { new File(path).delete(); } }
118
TreePath 1
                  
// in org/gjt/sp/jedit/search/HyperSearchResults.java
finally { ((DefaultTreeModel)resultTree.getModel()).nodeStructureChanged(operNode); expandAllNodes(operNode); resultTree.scrollPathToVisible( new TreePath(operNode.getPath())); }
25
_delete 1
                  
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
finally { try { vfs._saveComplete(session,buffer,path,view); if( twoStageSave ) { vfs._finishTwoStageSave(session,buffer,path,view); } // clean up left-over markers file if(!jEdit.getBooleanProperty("persistentMarkers")) vfs._delete(session,Buffer.getMarkersPath(vfs, path),view); vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
4
_finishTwoStageSave
1
                  
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
finally { try { vfs._saveComplete(session,buffer,path,view); if( twoStageSave ) { vfs._finishTwoStageSave(session,buffer,path,view); } // clean up left-over markers file if(!jEdit.getBooleanProperty("persistentMarkers")) vfs._delete(session,Buffer.getMarkersPath(vfs, path),view); vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
1
_saveComplete
1
                  
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
finally { try { vfs._saveComplete(session,buffer,path,view); if( twoStageSave ) { vfs._finishTwoStageSave(session,buffer,path,view); } // clean up left-over markers file if(!jEdit.getBooleanProperty("persistentMarkers")) vfs._delete(session,Buffer.getMarkersPath(vfs, path),view); vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
1
countDown 1
                  
// in org/gjt/sp/jedit/io/CopyFileWorker.java
finally { if (latch != null) latch.countDown(); }
3
currentThread 1
                  
// in org/gjt/sp/jedit/EditBus.java
finally { if (interrupted) { Thread.currentThread().interrupt(); } }
22
delete 1
                  
// in org/gjt/sp/jedit/pluginmgr/Roster.java
finally { try { if(zipFile != null) zipFile.close(); } catch(IOException io) { Log.log(Log.ERROR,this,io); } if(jEdit.getBooleanProperty( "plugin-manager.deleteDownloads")) { new File(path).delete(); } }
29
expandAllNodes 1
                  
// in org/gjt/sp/jedit/search/HyperSearchResults.java
finally { ((DefaultTreeModel)resultTree.getModel()).nodeStructureChanged(operNode); expandAllNodes(operNode); resultTree.scrollPathToVisible( new TreePath(operNode.getPath())); }
2
fireStatusChanged 1
                  
// in org/gjt/sp/util/WorkThread.java
finally { synchronized(abortLock) { aborted = abortable = false; } status = null; progressValue = progressMaximum = 0; pool.requestDone(); pool.fireStatusChanged(this); }
6
getMarkersPath 1
                  
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
finally { try { vfs._saveComplete(session,buffer,path,view); if( twoStageSave ) { vfs._finishTwoStageSave(session,buffer,path,view); } // clean up left-over markers file if(!jEdit.getBooleanProperty("persistentMarkers")) vfs._delete(session,Buffer.getMarkersPath(vfs, path),view); vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } }
3
getModel 1
                  
// in org/gjt/sp/jedit/search/HyperSearchResults.java
finally { ((DefaultTreeModel)resultTree.getModel()).nodeStructureChanged(operNode); expandAllNodes(operNode); resultTree.scrollPathToVisible( new TreePath(operNode.getPath())); }
76
getPath 1
                  
// in org/gjt/sp/jedit/search/HyperSearchResults.java
finally { ((DefaultTreeModel)resultTree.getModel()).nodeStructureChanged(operNode); expandAllNodes(operNode); resultTree.scrollPathToVisible( new TreePath(operNode.getPath())); }
170
getPredefinedCursor 1
                  
// in org/gjt/sp/jedit/search/SearchDialog.java
finally { setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }
16
insideCompoundEdit 1
                  
// in org/gjt/sp/jedit/Macros.java
finally { /* I already wrote a comment expaining this in * Macro.invoke(). */ if(buffer.insideCompoundEdit()) buffer.endCompoundEdit(); }
9
interrupt 1
                  
// in org/gjt/sp/jedit/EditBus.java
finally { if (interrupted) { Thread.currentThread().interrupt(); } }
4
nodeStructureChanged 1
                  
// in org/gjt/sp/jedit/search/HyperSearchResults.java
finally { ((DefaultTreeModel)resultTree.getModel()).nodeStructureChanged(operNode); expandAllNodes(operNode); resultTree.scrollPathToVisible( new TreePath(operNode.getPath())); }
2
requestDone
1
                  
// in org/gjt/sp/util/WorkThread.java
finally { synchronized(abortLock) { aborted = abortable = false; } status = null; progressValue = progressMaximum = 0; pool.requestDone(); pool.fireStatusChanged(this); }
1
runInAWTThread 1
                  
// in org/gjt/sp/jedit/browser/VFSBrowser.java
finally { // Do not change this until all VFS Browser tasks are // done in ThreadUtilities VFSManager.runInAWTThread(new Runnable() { public void run() { maybeReloadRequestRunning = false; } });
12
scrollPathToVisible 1
                  
// in org/gjt/sp/jedit/search/HyperSearchResults.java
finally { ((DefaultTreeModel)resultTree.getModel()).nodeStructureChanged(operNode); expandAllNodes(operNode); resultTree.scrollPathToVisible( new TreePath(operNode.getPath())); }
11
searchDone 1
                  
// in org/gjt/sp/jedit/search/HyperSearchRequest.java
finally { ThreadUtilities.runInDispatchThread(new Runnable() { public void run() { results.searchDone(rootSearchNode, selectNode); } }); }
3
sendVFSUpdate 1
                  
// in org/gjt/sp/jedit/io/CopyFileWorker.java
finally { VFSManager.sendVFSUpdate(vfs, target, true); try { if (targetSession != null) vfs._endVFSSession(targetSession, comp); } catch (IOException e) { } }
11
setCursor 1
                  
// in org/gjt/sp/jedit/search/SearchDialog.java
finally { setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }
24
setEnabled 1
                  
// in org/gjt/sp/jedit/options/PluginManagerOptionPane.java
finally { ThreadUtilities.runInDispatchThread(new Runnable() { public void run() { updateMirrors.setEnabled(true); updateStatus.setText(null); } }); }
189
setLoading 1
                  
// in org/gjt/sp/jedit/JEditRegisterSaver.java
finally { Registers.setLoading(false); }
6
setPerformingIO 1
                  
// in org/gjt/sp/jedit/Buffer.java
finally { try { vfs._endVFSSession(session,view); } catch(IOException io) { VFSManager.error(view,newPath,"ioerror", new String[] { io.toString() }); setPerformingIO(false); return false; } }
11
setPerspectiveEnabled 1
                  
// in org/gjt/sp/jedit/jEdit.java
finally { PerspectiveManager.setPerspectiveEnabled(true); }
2
setText 1
                  
// in org/gjt/sp/jedit/options/PluginManagerOptionPane.java
finally { ThreadUtilities.runInDispatchThread(new Runnable() { public void run() { updateMirrors.setEnabled(true); updateStatus.setText(null); } }); }
202
unset
1
                  
// in org/gjt/sp/jedit/BeanShell.java
finally { running = false; try { // no need to do this for macros! if(namespace == bsh.getNameSpace()) { bsh.resetDefaultVariables(namespace); interp.unset("scriptPath"); } } catch(EvalError e) { // do nothing } }
1

Reference Table

This table concatenates the results of the previous tables.

Checked/Runtime Type Exception Thrown Thrown from Catch Declared Caught directly Caught
with Thrown
Caught
with Thrown Runtime
unknown (Lib) . 0 0 0 0 0 0
unknown (Lib) AWTException 0 0 0 1
            
// in org/gjt/sp/jedit/gui/tray/JTrayIconManager.java
catch (AWTException e) { Log.log(Log.ERROR, JEditSwingTrayIcon.class, "Unable to add Tray icon", e); trayIcon = null; return; }
0 0
runtime (Domain) Abort
public static class Abort extends Error
	{
		public Abort()
		{
			super("Work request aborted");
		}
	}
0 0 0 8
            
// in org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
catch(WorkThread.Abort a) { }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/util/WorkThread.java
catch(Abort a) { Log.log(Log.ERROR,WorkThread.class,"Unhandled abort", a); }
0 0
unknown (Lib) ArithmeticException 0 0 0 1
            
// in org/gjt/sp/jedit/bsh/Primitive.java
catch ( ArithmeticException e ) { throw new UtilTargetError( "Arithemetic Exception in binary op", e); }
1
            
// in org/gjt/sp/jedit/bsh/Primitive.java
catch ( ArithmeticException e ) { throw new UtilTargetError( "Arithemetic Exception in binary op", e); }
0
unknown (Lib) ArrayIndexOutOfBoundsException 27
            
// in org/gjt/sp/jedit/buffer/PositionManager.java
void contentInserted(int offset, int length) { if(offset > this.offset) throw new ArrayIndexOutOfBoundsException(); this.offset += length; checkInvariants(); }
// in org/gjt/sp/jedit/buffer/PositionManager.java
void contentRemoved(int offset, int length) { if(offset > this.offset) throw new ArrayIndexOutOfBoundsException(); if(this.offset <= offset + length) this.offset = offset; else this.offset -= length; checkInvariants(); }
// in org/gjt/sp/jedit/buffer/PositionManager.java
private void checkInvariants() { if(offset < 0 || offset > buffer.getLength()) throw new ArrayIndexOutOfBoundsException(); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public int getLineOfOffset(int offset) { try { readLock(); if(offset < 0 || offset > getLength()) throw new ArrayIndexOutOfBoundsException(offset); return lineMgr.getLineOfOffset(offset); } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public int getLineStartOffset(int line) { try { readLock(); if(line < 0 || line >= lineMgr.getLineCount()) throw new ArrayIndexOutOfBoundsException(line); else if(line == 0) return 0; return lineMgr.getLineEndOffset(line - 1); } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public int getLineEndOffset(int line) { try { readLock(); if(line < 0 || line >= lineMgr.getLineCount()) throw new ArrayIndexOutOfBoundsException(line); return lineMgr.getLineEndOffset(line); } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public String getLineText(int line) { if(line < 0 || line >= lineMgr.getLineCount()) throw new ArrayIndexOutOfBoundsException(line); try { readLock(); int start = line == 0 ? 0 : lineMgr.getLineEndOffset(line - 1); int end = lineMgr.getLineEndOffset(line); return getText(start,end - start - 1); } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public void getLineText(int line,int relativeStartOffset, Segment segment) { if(line < 0 || line >= lineMgr.getLineCount()) throw new ArrayIndexOutOfBoundsException(line); try { readLock(); int start = (line == 0 ? 0 : lineMgr.getLineEndOffset(line - 1)); int end = lineMgr.getLineEndOffset(line); if((start+relativeStartOffset)>end) { throw new IllegalArgumentException("This index is outside the line length (start+relativeOffset):"+start+" + "+relativeStartOffset+" > "+"endffset:"+end); } else { getText(start+relativeStartOffset,end - start -relativeStartOffset- 1,segment); } } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public CharSequence getLineSegment(int line) { if(line < 0 || line >= lineMgr.getLineCount()) throw new ArrayIndexOutOfBoundsException(line); try { readLock(); int start = line == 0 ? 0 : lineMgr.getLineEndOffset(line - 1); int end = lineMgr.getLineEndOffset(line); return getSegment(start,end - start - 1); } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public String getText(int start, int length) { try { readLock(); if(start < 0 || length < 0 || start + length > contentMgr.getLength()) throw new ArrayIndexOutOfBoundsException(start + ":" + length); return contentMgr.getText(start,length); } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public void getText(int start, int length, Segment seg) { try { readLock(); if(start < 0 || length < 0 || start + length > contentMgr.getLength()) throw new ArrayIndexOutOfBoundsException(start + ":" + length); contentMgr.getText(start,length,seg); } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public CharSequence getSegment(int start, int length) { try { readLock(); if(start < 0 || length < 0 || start + length > contentMgr.getLength()) throw new ArrayIndexOutOfBoundsException(start + ":" + length); return contentMgr.getSegment(start,length); } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public void insert(int offset, CharSequence seq) { if(seq == null) return; int len = seq.length(); if(len == 0) return; if(isReadOnly()) throw new RuntimeException("buffer read-only"); try { writeLock(); if(offset < 0 || offset > contentMgr.getLength()) throw new ArrayIndexOutOfBoundsException(offset); contentMgr.insert(offset,seq); integerArray.clear(); for(int i = 0; i < len; i++) { if(seq.charAt(i) == '\n') integerArray.add(i + 1); } if(!undoInProgress) { undoMgr.contentInserted(offset,len, seq.toString(),!dirty); } contentInserted(offset,len,integerArray); } finally { writeUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public void remove(int offset, int length) { if(length == 0) return; if(isReadOnly()) throw new RuntimeException("buffer read-only"); try { transaction = true; writeLock(); if(offset < 0 || length < 0 || offset + length > contentMgr.getLength()) throw new ArrayIndexOutOfBoundsException(offset + ":" + length); int startLine = lineMgr.getLineOfOffset(offset); int endLine = lineMgr.getLineOfOffset(offset + length); int numLines = endLine - startLine; if(!undoInProgress && !loading) { undoMgr.contentRemoved(offset,length, getText(offset,length), !dirty); } firePreContentRemoved(startLine,offset,numLines,length); contentMgr.remove(offset,length); lineMgr.contentRemoved(startLine,offset,numLines,length); positionMgr.contentRemoved(offset,length); setDirty(true); fireContentRemoved(startLine,offset,numLines,length); /* otherwise it will be delivered later */ if(!undoInProgress && !insideCompoundEdit()) fireTransactionComplete(); } finally { transaction = false; writeUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public void markTokens(int lineIndex, TokenHandler tokenHandler) { Segment seg = new Segment(); if(lineIndex < 0 || lineIndex >= lineMgr.getLineCount()) throw new ArrayIndexOutOfBoundsException(lineIndex); int firstInvalidLineContext = lineMgr.getFirstInvalidLineContext(); int start; if(contextInsensitive || firstInvalidLineContext == -1) { start = lineIndex; } else { start = Math.min(firstInvalidLineContext, lineIndex); } if(Debug.TOKEN_MARKER_DEBUG) Log.log(Log.DEBUG,this,"tokenize from " + start + " to " + lineIndex); TokenMarker.LineContext oldContext = null; TokenMarker.LineContext context = null; for(int i = start; i <= lineIndex; i++) { getLineText(i,seg); oldContext = lineMgr.getLineContext(i); TokenMarker.LineContext prevContext = ( (i == 0 || contextInsensitive) ? null : lineMgr.getLineContext(i - 1) ); TokenHandler _tokenHandler = i == lineIndex ? tokenHandler : DummyTokenHandler.INSTANCE; context = markTokens(seg, prevContext, _tokenHandler); lineMgr.setLineContext(i,context); } int lineCount = lineMgr.getLineCount(); if(lineCount - 1 == lineIndex) lineMgr.setFirstInvalidLineContext(-1); else if(oldContext != context) lineMgr.setFirstInvalidLineContext(lineIndex + 1); else if(firstInvalidLineContext == -1) /* do nothing */; else { lineMgr.setFirstInvalidLineContext(Math.max( firstInvalidLineContext,lineIndex + 1)); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public Position createPosition(int offset) { try { readLock(); if(offset < 0 || offset > contentMgr.getLength()) throw new ArrayIndexOutOfBoundsException(offset); return positionMgr.createPosition(offset); } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public int getFoldLevel(int line) { if(line < 0 || line >= lineMgr.getLineCount()) throw new ArrayIndexOutOfBoundsException(line); if(foldHandler instanceof DummyFoldHandler) return 0; int firstInvalidFoldLevel = lineMgr.getFirstInvalidFoldLevel(); if(firstInvalidFoldLevel == -1 || line < firstInvalidFoldLevel) { return lineMgr.getFoldLevel(line); } else { if(Debug.FOLD_DEBUG) Log.log(Log.DEBUG,this,"Invalid fold levels from " + firstInvalidFoldLevel + " to " + line); int newFoldLevel = 0; boolean changed = false; int firstUpdatedFoldLevel = firstInvalidFoldLevel; for(int i = firstInvalidFoldLevel; i <= line; i++) { Segment seg = new Segment(); newFoldLevel = foldHandler.getFoldLevel(this,i,seg); if(newFoldLevel != lineMgr.getFoldLevel(i)) { if(Debug.FOLD_DEBUG) Log.log(Log.DEBUG,this,i + " fold level changed"); changed = true; // Update preceding fold levels if necessary if (i == firstInvalidFoldLevel) { List<Integer> precedingFoldLevels = foldHandler.getPrecedingFoldLevels( this,i,seg,newFoldLevel); if (precedingFoldLevels != null) { int j = i; for (Integer foldLevel: precedingFoldLevels) { j--; lineMgr.setFoldLevel(j,foldLevel.intValue()); } if (j < firstUpdatedFoldLevel) firstUpdatedFoldLevel = j; } } } lineMgr.setFoldLevel(i,newFoldLevel); } if(line == lineMgr.getLineCount() - 1) lineMgr.setFirstInvalidFoldLevel(-1); else lineMgr.setFirstInvalidFoldLevel(line + 1); if(changed) { if(Debug.FOLD_DEBUG) Log.log(Log.DEBUG,this,"fold level changed: " + firstUpdatedFoldLevel + ',' + line); fireFoldLevelChanged(firstUpdatedFoldLevel,line); } return newFoldLevel; } }
// in org/gjt/sp/jedit/buffer/BufferSegment.java
public char charAt(int index) { if (index < len) return data[offset+index]; else if (next != null) return next.charAt(index-len); else throw new ArrayIndexOutOfBoundsException(index); }
// in org/gjt/sp/jedit/buffer/BufferSegment.java
private BufferSegment subSegment(int start, int end) { if (0 <= start && start <= end) if (end <= len) return new BufferSegment(data,offset+start, end-start); else if (next != null) if (start < len) return new BufferSegment(data, offset+start,len-start, next.subSegment(0,end-len)); else return next.subSegment(start-len, end-len); else throw new ArrayIndexOutOfBoundsException(); else throw new ArrayIndexOutOfBoundsException(); }
// in org/gjt/sp/jedit/TextUtilities.java
public static Token getTokenAtOffset(Token tokens, int offset) { if(offset == 0 && tokens.id == Token.END) return tokens; for(;;) { if(tokens.id == Token.END) throw new ArrayIndexOutOfBoundsException("offset > line length"); if(tokens.offset + tokens.length > offset) return tokens; else tokens = tokens.next; } }
// in org/gjt/sp/jedit/TextUtilities.java
public static int findMatchingBracket(JEditBuffer buffer, int line, int offset) { if(offset < 0 || offset >= buffer.getLineLength(line)) { throw new ArrayIndexOutOfBoundsException(offset + ":" + buffer.getLineLength(line)); } Segment lineText = new Segment(); buffer.getLineText(line,lineText); char c = lineText.array[lineText.offset + offset]; // false - backwards, true - forwards boolean[] direction = new boolean[1]; // corresponding character char cprime = getComplementaryBracket(c,direction); if( cprime == '\0' ) { // c is no bracket return -1; } // 1 because we've already 'seen' the first bracket int count = 1; DefaultTokenHandler tokenHandler = new DefaultTokenHandler(); buffer.markTokens(line,tokenHandler); // Get the syntax token at 'offset' // only tokens with the same type will be checked for // the corresponding bracket byte idOfBracket = getTokenAtOffset(tokenHandler.getTokens(),offset).id; boolean haveTokens = true; int startLine = line; //{{{ Forward search if(direction[0]) { offset++; for(;;) { for(int i = offset; i < lineText.count; i++) { char ch = lineText.array[lineText.offset + i]; if(ch == c) { if(!haveTokens) { tokenHandler.init(); buffer.markTokens(line,tokenHandler); haveTokens = true; } if(getTokenAtOffset(tokenHandler.getTokens(),i).id == idOfBracket) count++; } else if(ch == cprime) { if(!haveTokens) { tokenHandler.init(); buffer.markTokens(line,tokenHandler); haveTokens = true; } if(getTokenAtOffset(tokenHandler.getTokens(),i).id == idOfBracket) { count--; if(count == 0) return buffer.getLineStartOffset(line) + i; } } } //{{{ Go on to next line line++; if(line >= buffer.getLineCount() || (line - startLine) > BRACKET_MATCH_LIMIT) break; buffer.getLineText(line,lineText); offset = 0; haveTokens = false; //}}} } } //}}} //{{{ Backward search else { offset--; for(;;) { for(int i = offset; i >= 0; i--) { char ch = lineText.array[lineText.offset + i]; if(ch == c) { if(!haveTokens) { tokenHandler.init(); buffer.markTokens(line,tokenHandler); haveTokens = true; } if(getTokenAtOffset(tokenHandler.getTokens(),i).id == idOfBracket) count++; } else if(ch == cprime) { if(!haveTokens) { tokenHandler.init(); buffer.markTokens(line,tokenHandler); haveTokens = true; } if(getTokenAtOffset(tokenHandler.getTokens(),i).id == idOfBracket) { count--; if(count == 0) return buffer.getLineStartOffset(line) + i; } } } //{{{ Go on to previous line line--; if(line < 0 || (startLine - line) > BRACKET_MATCH_LIMIT) break; buffer.getLineText(line,lineText); offset = lineText.count - 1; haveTokens = false; //}}} } } //}}} // Nothing found return -1; }
// in org/gjt/sp/jedit/textarea/ChunkCache.java
private void updateChunksUpTo(int lastScreenLine) { // this method is a nightmare if(lastScreenLine >= lineInfo.length) throw new ArrayIndexOutOfBoundsException(lastScreenLine); // if one line's chunks are invalid, remaining lines are also // invalid if(lastScreenLine < firstInvalidLine) return; int firstScreenLine = getFirstScreenLine(); int physicalLine = getUpdateStartLine(firstScreenLine); if(Debug.CHUNK_CACHE_DEBUG) { Log.log(Log.DEBUG,this,"Updating chunks from " + firstScreenLine + " to " + lastScreenLine); } // Note that we rely on the fact that when a physical line is // invalidated, all screen lines/subregions of that line are // invalidated as well. See below comment for code that tries // to uphold this assumption. out.clear(); int offset; int length; for(int i = firstScreenLine; i <= lastScreenLine; i++) { LineInfo info = lineInfo[i]; Chunk chunks; // get another line of chunks if(out.isEmpty()) { // unless this is the first time, increment // the line number if(physicalLine != -1 && i != firstScreenLine) { physicalLine = textArea.displayManager .getNextVisibleLine(physicalLine); } // empty space if(physicalLine == -1) { info.chunks = null; info.physicalLine = -1; // fix the bug where the horiz. // scroll bar was not updated // after creating a new file. info.width = 0; continue; } // chunk the line. lineToChunkList(physicalLine,out); info.firstSubregion = true; // if the line has no text, out.size() == 0 if(out.isEmpty()) { if(i == 0) { if(textArea.displayManager.firstLine.skew > 0) { Log.log(Log.ERROR,this,"BUG: skew=" + textArea.displayManager.firstLine.skew + ",out.size()=" + out.size()); textArea.displayManager.firstLine.skew = 0; needFullRepaint = true; lastScreenLine = lineInfo.length - 1; } } chunks = null; offset = 0; length = 1; } // otherwise, the number of subregions else { if(i == 0) { int skew = textArea.displayManager.firstLine.skew; if(skew >= out.size()) { // The skew cannot be greater than the chunk count of the line // we need at least one chunk per subregion in a line Log.log(Log.ERROR,this,"BUG: skew=" + skew + ",out.size()=" + out.size()); needFullRepaint = true; lastScreenLine = lineInfo.length - 1; } else if(skew > 0) { info.firstSubregion = false; for(int j = 0; j < skew; j++) out.remove(0); } } chunks = out.remove(0); offset = chunks.offset; if (!out.isEmpty()) length = out.get(0).offset - offset; else length = textArea.getLineLength(physicalLine) - offset + 1; } } else { info.firstSubregion = false; chunks = out.remove(0); offset = chunks.offset; if (!out.isEmpty()) length = out.get(0).offset - offset; else length = textArea.getLineLength(physicalLine) - offset + 1; } boolean lastSubregion = out.isEmpty(); if(i == lastScreenLine && lastScreenLine != lineInfo.length - 1) { /* if the user changes the syntax token at the * end of a line, need to do a full repaint. */ if(tokenHandler.getLineContext() != info.lineContext) { lastScreenLine++; needFullRepaint = true; } /* If this line has become longer or shorter * (in which case the new physical line number * is different from the cached one) we need to: * - continue updating past the last line * - advise the text area to repaint * On the other hand, if the line wraps beyond * lastScreenLine, we need to keep updating the * chunk list to ensure proper alignment of * invalidation flags (see start of method) */ else if(info.physicalLine != physicalLine || info.lastSubregion != lastSubregion) { lastScreenLine++; needFullRepaint = true; } /* We only cache entire physical lines at once; * don't want to split a physical line into * screen lines and only have some valid. */ else if (!out.isEmpty()) lastScreenLine++; } info.physicalLine = physicalLine; info.lastSubregion = lastSubregion; info.offset = offset; info.length = length; info.chunks = chunks; info.lineContext = tokenHandler.getLineContext(); } firstInvalidLine = Math.max(lastScreenLine + 1,firstInvalidLine); }
// in org/gjt/sp/jedit/textarea/DisplayManager.java
public int getNextVisibleLine(int line) { if(line < 0 || line >= buffer.getLineCount()) throw new ArrayIndexOutOfBoundsException(line); return folds.next(line); }
// in org/gjt/sp/jedit/textarea/DisplayManager.java
public int getPrevVisibleLine(int line) { if(line < 0 || line >= buffer.getLineCount()) throw new ArrayIndexOutOfBoundsException(line); return folds.prev(line); }
// in org/gjt/sp/jedit/textarea/DisplayManager.java
public void narrow(int start, int end) { int lineCount = buffer.getLineCount(); if(start > end || start < 0 || end >= lineCount) throw new ArrayIndexOutOfBoundsException(start + ", " + end); if(start < getFirstVisibleLine() || end > getLastVisibleLine()) expandAllFolds(); if(start != 0) hideLineRange(0,start - 1); if(end != lineCount - 1) hideLineRange(end + 1,lineCount - 1); // if we narrowed to a single collapsed fold if(start != lineCount - 1 && !isLineVisible(start + 1)) expandFold(start,false); textArea.fireNarrowActive(); notifyScreenLineChanges(); textArea.foldStructureChanged(); }
// in org/gjt/sp/jedit/syntax/Chunk.java
public static float offsetToX(Chunk chunks, int offset) { if(chunks != null && offset < chunks.offset) { throw new ArrayIndexOutOfBoundsException(offset + " < " + chunks.offset); } float x = 0.0f; while(chunks != null) { if(chunks.isAccessible() && offset < chunks.offset + chunks.length) return x + chunks.offsetToX(offset - chunks.offset); x += chunks.width; chunks = (Chunk)chunks.next; } return x; }
0 0 1
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( ArrayIndexOutOfBoundsException e1 ) { throw new UtilTargetError( e1 ); }
1
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( ArrayIndexOutOfBoundsException e1 ) { throw new UtilTargetError( e1 ); }
0
unknown (Lib) ArrayStoreException 0 0
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( IllegalArgumentException e1 ) { throw new UtilTargetError( new ArrayStoreException( e1.toString() ) ); }
0 2
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( ArrayStoreException e2 ) { throw new UtilTargetError( e2 ); }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
catch( ArrayStoreException e ) { // I think this can happen Interpreter.debug("arraystore"+e); throwTypeError( baseType, currentInitializer, i, callstack ); }
1
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( ArrayStoreException e2 ) { throw new UtilTargetError( e2 ); }
0
unknown (Lib) BadLocationException 0 0 0 1
            
// in org/gjt/sp/jedit/gui/ErrorListDialog.java
catch (BadLocationException e) { }
0 0
unknown (Lib) CharConversionException 0 0 0 1
            
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(CharConversionException e) { encodingError = e; }
0 0
unknown (Lib) CharacterCodingException 0 0 0 4
            
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
catch(CharacterCodingException e) { // It seems to be made by an old version of jEdit. in.close(); Log.log(Log.MESSAGE,HistoryModel.class, "Failed to load history with UTF-8." + " Fallbacking to the system default encoding."); in = new BufferedReader(new FileReader(history)); models.putAll(loadFromReader(in)); }
// in org/gjt/sp/jedit/bufferio/BufferIORequest.java
catch(CharacterCodingException e) { String message = getWriteEncodingErrorMessage( encodingName, encoding, lineSegment, i); IOException wrapping = new CharConversionException(message); wrapping.initCause(e); throw wrapping; }
// in org/gjt/sp/jedit/bufferio/BufferIORequest.java
catch(CharacterCodingException e) { return i; }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(CharacterCodingException e) { encodingError = e; }
1
            
// in org/gjt/sp/jedit/bufferio/BufferIORequest.java
catch(CharacterCodingException e) { String message = getWriteEncodingErrorMessage( encodingName, encoding, lineSegment, i); IOException wrapping = new CharConversionException(message); wrapping.initCause(e); throw wrapping; }
0
unknown (Lib) ClassNotFoundException 7
            
// in org/gjt/sp/jedit/bsh/Name.java
synchronized public Class toClass() throws ClassNotFoundException, UtilEvalError { if ( asClass != null ) return asClass; reset(); // "var" means untyped, return null class if ( evalName.equals("var") ) return asClass = null; /* Try straightforward class name first */ Class clas = namespace.getClass( evalName ); if ( clas == null ) { /* Try toObject() which knows how to work through inner classes and see what we end up with */ Object obj = null; try { // Null interpreter and callstack references. // class only resolution should not require them. obj = toObject( null, null, true ); } catch ( UtilEvalError e ) { }; // couldn't resolve it if ( obj instanceof ClassIdentifier ) clas = ((ClassIdentifier)obj).getTargetClass(); } if ( clas == null ) throw new ClassNotFoundException( "Class: " + value+ " not found in namespace"); asClass = clas; return asClass; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
public Class loadClass(String name, boolean resolve) throws ClassNotFoundException { Class c = null; /* Check first for classes loaded through this loader. The VM will not allow a class to be loaded twice. */ c = findLoadedClass(name); if ( c != null ) return c; // This is copied from ClassManagerImpl // We should refactor this somehow if it sticks around if ( name.startsWith( ClassManagerImpl.BSH_PACKAGE ) ) try { return org.gjt.sp.jedit.bsh.Interpreter.class.getClassLoader().loadClass( name ); } catch ( ClassNotFoundException e ) {} /* Try to find the class using our classloading mechanism. Note: I wish we didn't have to catch the exception here... slow */ try { c = findClass( name ); } catch ( ClassNotFoundException e ) { } if ( c == null ) throw new ClassNotFoundException("here in loaClass"); if ( resolve ) resolveClass( c ); return c; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
protected Class findClass( String name ) throws ClassNotFoundException { // Deal with this cast somehow... maybe have this class use // ClassManagerImpl type directly. // Don't add the method to BshClassManager... it's really an impl thing ClassManagerImpl bcm = (ClassManagerImpl)getClassManager(); // Should we try to load the class ourselves or delegate? // look for overlay loader // Deal with this cast somehow... maybe have this class use // ClassManagerImpl type directly. // Don't add the method to BshClassManager... it's really an impl thing ClassLoader cl = bcm.getLoaderForClass( name ); Class c; // If there is a designated loader and it's not us delegate to it if ( cl != null && cl != this ) try { return cl.loadClass( name ); } catch ( ClassNotFoundException e ) { throw new ClassNotFoundException( "Designated loader could not find class: "+e ); } // Let URLClassLoader try any paths it may have if ( getURLs().length > 0 ) try { return super.findClass(name); } catch ( ClassNotFoundException e ) { //System.out.println( // "base loader here caught class not found: "+name ); } // If there is a baseLoader and it's not us delegate to it cl = bcm.getBaseLoader(); if ( cl != null && cl != this ) try { return cl.loadClass( name ); } catch ( ClassNotFoundException e ) { } // Try system loader return bcm.plainClassForName( name ); }
// in org/gjt/sp/jedit/JARClassLoader.java
public Class loadClass(String clazz, boolean resolveIt) throws ClassNotFoundException { ClassNotFoundException pending = null; if (delegateFirst) { try { return loadFromParent(clazz); } catch (ClassNotFoundException cnf) { // keep going if class was not found. pending = cnf; } } Object obj = classHash.get(clazz); if(obj == NO_CLASS) { // we remember which classes we don't exist // because BeanShell tries loading all possible // <imported prefix>.<class name> combinations throw new ClassNotFoundException(clazz); } else if(obj instanceof JARClassLoader) { JARClassLoader classLoader = (JARClassLoader)obj; try { return classLoader._loadClass(clazz,resolveIt); } catch (ClassNotFoundException cnf2) { classHash.put(clazz,NO_CLASS); throw cnf2; } } else if (delegateFirst) { // if delegating, reaching this statement means // the class was really not found. Otherwise // we'll try loading from the parent class loader. throw pending; } return loadFromParent(clazz); }
// in org/gjt/sp/jedit/JARClassLoader.java
private synchronized Class _loadClass(String clazz, boolean resolveIt) throws ClassNotFoundException { jar.activatePlugin(); synchronized(this) { Class cls = findLoadedClass(clazz); if(cls != null) { if(resolveIt) resolveClass(cls); return cls; } String name = MiscUtilities.classToFile(clazz); try { definePackage(clazz); ZipFile zipFile = jar.getZipFile(); ZipEntry entry = zipFile.getEntry(name); if(entry == null) throw new ClassNotFoundException(clazz); InputStream in = zipFile.getInputStream(entry); int len = (int)entry.getSize(); byte[] data = new byte[len]; int success = 0; int offset = 0; while(success < len) { len -= success; offset += success; success = in.read(data,offset,len); if(success == -1) { Log.log(Log.ERROR,this,"Failed to load class " + clazz + " from " + zipFile.getName()); throw new ClassNotFoundException(clazz); } } cls = defineClass(clazz,data,0,data.length); if(resolveIt) resolveClass(cls); return cls; } catch(IOException io) { Log.log(Log.ERROR,this,io); throw new ClassNotFoundException(clazz); } } }
2
            
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
catch ( ClassNotFoundException e ) { throw new ClassNotFoundException( "Designated loader could not find class: "+e ); }
// in org/gjt/sp/jedit/JARClassLoader.java
catch(IOException io) { Log.log(Log.ERROR,this,io); throw new ClassNotFoundException(clazz); }
9
            
// in org/gjt/sp/jedit/bsh/Name.java
synchronized public Class toClass() throws ClassNotFoundException, UtilEvalError { if ( asClass != null ) return asClass; reset(); // "var" means untyped, return null class if ( evalName.equals("var") ) return asClass = null; /* Try straightforward class name first */ Class clas = namespace.getClass( evalName ); if ( clas == null ) { /* Try toObject() which knows how to work through inner classes and see what we end up with */ Object obj = null; try { // Null interpreter and callstack references. // class only resolution should not require them. obj = toObject( null, null, true ); } catch ( UtilEvalError e ) { }; // couldn't resolve it if ( obj instanceof ClassIdentifier ) clas = ((ClassIdentifier)obj).getTargetClass(); } if ( clas == null ) throw new ClassNotFoundException( "Class: " + value+ " not found in namespace"); asClass = clas; return asClass; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
public Class loadClass(String name, boolean resolve) throws ClassNotFoundException { Class c = null; /* Check first for classes loaded through this loader. The VM will not allow a class to be loaded twice. */ c = findLoadedClass(name); if ( c != null ) return c; // This is copied from ClassManagerImpl // We should refactor this somehow if it sticks around if ( name.startsWith( ClassManagerImpl.BSH_PACKAGE ) ) try { return org.gjt.sp.jedit.bsh.Interpreter.class.getClassLoader().loadClass( name ); } catch ( ClassNotFoundException e ) {} /* Try to find the class using our classloading mechanism. Note: I wish we didn't have to catch the exception here... slow */ try { c = findClass( name ); } catch ( ClassNotFoundException e ) { } if ( c == null ) throw new ClassNotFoundException("here in loaClass"); if ( resolve ) resolveClass( c ); return c; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
protected Class findClass( String name ) throws ClassNotFoundException { // Deal with this cast somehow... maybe have this class use // ClassManagerImpl type directly. // Don't add the method to BshClassManager... it's really an impl thing ClassManagerImpl bcm = (ClassManagerImpl)getClassManager(); // Should we try to load the class ourselves or delegate? // look for overlay loader // Deal with this cast somehow... maybe have this class use // ClassManagerImpl type directly. // Don't add the method to BshClassManager... it's really an impl thing ClassLoader cl = bcm.getLoaderForClass( name ); Class c; // If there is a designated loader and it's not us delegate to it if ( cl != null && cl != this ) try { return cl.loadClass( name ); } catch ( ClassNotFoundException e ) { throw new ClassNotFoundException( "Designated loader could not find class: "+e ); } // Let URLClassLoader try any paths it may have if ( getURLs().length > 0 ) try { return super.findClass(name); } catch ( ClassNotFoundException e ) { //System.out.println( // "base loader here caught class not found: "+name ); } // If there is a baseLoader and it's not us delegate to it cl = bcm.getBaseLoader(); if ( cl != null && cl != this ) try { return cl.loadClass( name ); } catch ( ClassNotFoundException e ) { } // Try system loader return bcm.plainClassForName( name ); }
// in org/gjt/sp/jedit/bsh/classpath/DiscreteFilesClassLoader.java
public Class findClass( String name ) throws ClassNotFoundException { // Load it if it's one of our classes ClassSource source = map.get( name ); if ( source != null ) { byte [] code = source.getCode( name ); return defineClass( name, code, 0, code.length ); } else // Let superclass BshClassLoader (URLClassLoader) findClass try // to find the class... return super.findClass( name ); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
public Class plainClassForName( String name ) throws ClassNotFoundException { Class c = null; try { if ( externalClassLoader != null ) c = externalClassLoader.loadClass( name ); else c = Class.forName( name ); cacheClassInfo( name, c ); /* Original note: Jdk under Win is throwing these to warn about lower case / upper case possible mismatch. e.g. bsh.console bsh.Console Update: Prior to 1.3 we were squeltching NoClassDefFoundErrors which was very annoying. I cannot reproduce the original problem and this was never a valid solution. If there are legacy VMs that have problems we can include a more specific test for them here. */ } catch ( NoClassDefFoundError e ) { throw noClassDefFound( name, e ); } return c; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
private void readObject(ObjectInputStream stream) throws java.io.IOException, ClassNotFoundException { stream.defaultReadObject(); // set transient fields if ( console != null ) { setOut( console.getOut() ); setErr( console.getErr() ); } else { setOut( System.out ); setErr( System.err ); } }
// in org/gjt/sp/jedit/JARClassLoader.java
public Class loadClass(String clazz, boolean resolveIt) throws ClassNotFoundException { ClassNotFoundException pending = null; if (delegateFirst) { try { return loadFromParent(clazz); } catch (ClassNotFoundException cnf) { // keep going if class was not found. pending = cnf; } } Object obj = classHash.get(clazz); if(obj == NO_CLASS) { // we remember which classes we don't exist // because BeanShell tries loading all possible // <imported prefix>.<class name> combinations throw new ClassNotFoundException(clazz); } else if(obj instanceof JARClassLoader) { JARClassLoader classLoader = (JARClassLoader)obj; try { return classLoader._loadClass(clazz,resolveIt); } catch (ClassNotFoundException cnf2) { classHash.put(clazz,NO_CLASS); throw cnf2; } } else if (delegateFirst) { // if delegating, reaching this statement means // the class was really not found. Otherwise // we'll try loading from the parent class loader. throw pending; } return loadFromParent(clazz); }
// in org/gjt/sp/jedit/JARClassLoader.java
private synchronized Class _loadClass(String clazz, boolean resolveIt) throws ClassNotFoundException { jar.activatePlugin(); synchronized(this) { Class cls = findLoadedClass(clazz); if(cls != null) { if(resolveIt) resolveClass(cls); return cls; } String name = MiscUtilities.classToFile(clazz); try { definePackage(clazz); ZipFile zipFile = jar.getZipFile(); ZipEntry entry = zipFile.getEntry(name); if(entry == null) throw new ClassNotFoundException(clazz); InputStream in = zipFile.getInputStream(entry); int len = (int)entry.getSize(); byte[] data = new byte[len]; int success = 0; int offset = 0; while(success < len) { len -= success; offset += success; success = in.read(data,offset,len); if(success == -1) { Log.log(Log.ERROR,this,"Failed to load class " + clazz + " from " + zipFile.getName()); throw new ClassNotFoundException(clazz); } } cls = defineClass(clazz,data,0,data.length); if(resolveIt) resolveClass(cls); return cls; } catch(IOException io) { Log.log(Log.ERROR,this,io); throw new ClassNotFoundException(clazz); } } }
// in org/gjt/sp/jedit/JARClassLoader.java
private Class loadFromParent(String clazz) throws ClassNotFoundException { Class cls; ClassLoader parentLoader = getClass().getClassLoader(); if (parentLoader != null) cls = parentLoader.loadClass(clazz); else cls = findSystemClass(clazz); return cls; }
19
            
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( ClassNotFoundException e ) { throw new EvalError( e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassNotFoundException e ) {}
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassNotFoundException e ) {}
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassNotFoundException e ) {}
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassNotFoundException e ) { // fall through }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassNotFoundException e ) {}
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
catch ( ClassNotFoundException e ) {}
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
catch ( ClassNotFoundException e ) { }
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
catch ( ClassNotFoundException e ) { throw new ClassNotFoundException( "Designated loader could not find class: "+e ); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
catch ( ClassNotFoundException e ) { //System.out.println( // "base loader here caught class not found: "+name ); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
catch ( ClassNotFoundException e ) { }
// in org/gjt/sp/jedit/bsh/NameSpace.java
catch ( ClassNotFoundException e ) { /* not a class */ }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( ClassNotFoundException e ) { /*ignore*/ }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( ClassNotFoundException e ) { System.err.println("Class not found in source file: "+name ); return null; }
// in org/gjt/sp/jedit/bsh/Capabilities.java
catch ( ClassNotFoundException e ) { }
// in org/gjt/sp/jedit/JARClassLoader.java
catch (ClassNotFoundException cnf) { // keep going if class was not found. pending = cnf; }
// in org/gjt/sp/jedit/JARClassLoader.java
catch (ClassNotFoundException cnf2) { classHash.put(clazz,NO_CLASS); throw cnf2; }
// in org/gjt/sp/jedit/MiscUtilities.java
catch(ClassNotFoundException e1) { Class.forName("com.sun.tools.javac.Main"); }
// in org/gjt/sp/jedit/MiscUtilities.java
catch(ClassNotFoundException e) { //Log.log(Log.DEBUG, MiscUtilities.class, // "- is not in system classpath."); }
3
            
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( ClassNotFoundException e ) { throw new EvalError( e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassLoader.java
catch ( ClassNotFoundException e ) { throw new ClassNotFoundException( "Designated loader could not find class: "+e ); }
// in org/gjt/sp/jedit/JARClassLoader.java
catch (ClassNotFoundException cnf2) { classHash.put(clazz,NO_CLASS); throw cnf2; }
0
checked (Domain) ClassPathException
public class ClassPathException extends UtilEvalError {
	public ClassPathException( String msg ) { super(msg); }
}
6
            
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public void reloadClasses( String [] classNames ) throws ClassPathException { // validate that it is a class here? // init base class loader if there is none... if ( baseLoader == null ) initBaseLoader(); DiscreteFilesClassLoader.ClassSourceMap map = new DiscreteFilesClassLoader.ClassSourceMap(); for (int i=0; i< classNames.length; i++) { String name = classNames[i]; // look in baseLoader class path ClassSource classSource = baseClassPath.getClassSource( name ); // look in user class path if ( classSource == null ) { BshClassPath.getUserClassPath().insureInitialized(); classSource = BshClassPath.getUserClassPath().getClassSource( name ); } // No point in checking boot class path, can't reload those. // else we could have used fullClassPath above. if ( classSource == null ) throw new ClassPathException("Nothing known about class: " +name ); // JarClassSource is not working... just need to implement it's // getCode() method or, if we decide to, allow the BshClassManager // to handle it... since it is a URLClassLoader and can handle JARs if ( classSource instanceof JarClassSource ) throw new ClassPathException("Cannot reload class: "+name+ " from source: "+ classSource ); map.put( name, classSource ); } // Create classloader for the set of classes ClassLoader cl = new DiscreteFilesClassLoader( this, map ); // map those classes the loader in the overlay map Iterator it = map.keySet().iterator(); while ( it.hasNext() ) loaderMap.put( (String)it.next(), cl ); classLoaderChanged(); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public void reloadPackage( String pack ) throws ClassPathException { Collection classes = baseClassPath.getClassesForPackage( pack ); if ( classes == null ) classes = BshClassPath.getUserClassPath().getClassesForPackage( pack ); // no point in checking boot class path, can't reload those if ( classes == null ) throw new ClassPathException("No classes found for package: "+pack); reloadClasses( (String[])classes.toArray( new String[0] ) ); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public String getClassNameByUnqName( String name ) throws ClassPathException { insureInitialized(); UnqualifiedNameTable unqNameTable = getUnqualifiedNameTable(); Object obj = unqNameTable.get( name ); if ( obj instanceof AmbiguousName ) throw new ClassPathException("Ambigous class names: "+ ((AmbiguousName)obj).get() ); return (String)obj; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public static URL [] getUserClassPathComponents() throws ClassPathException { if ( userClassPathComp != null ) return userClassPathComp; String cp=System.getProperty("java.class.path"); String [] paths=StringUtil.split(cp, File.pathSeparator); URL [] urls = new URL[ paths.length ]; try { for ( int i=0; i<paths.length; i++) // We take care to get the canonical path first. // Java deals with relative paths for it's bootstrap loader // but JARClassLoader doesn't. urls[i] = new File( new File(paths[i]).getCanonicalPath() ).toURL(); } catch ( IOException e ) { throw new ClassPathException("can't parse class path: "+e); } userClassPathComp = urls; return urls; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public static BshClassPath getBootClassPath() throws ClassPathException { if ( bootClassPath == null ) { try { //String rtjar = System.getProperty("java.home")+"/lib/rt.jar"; String rtjar = getRTJarPath(); URL url = new File( rtjar ).toURL(); bootClassPath = new BshClassPath( "Boot Class Path", new URL[] { url } ); } catch ( MalformedURLException e ) { throw new ClassPathException(" can't find boot jar: "+e); } } return bootClassPath; }
2
            
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch ( IOException e ) { throw new ClassPathException("can't parse class path: "+e); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch ( MalformedURLException e ) { throw new ClassPathException(" can't find boot jar: "+e); }
9
            
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public void reloadAllClasses() throws ClassPathException { BshClassPath bcp = new BshClassPath("temp"); bcp.addComponent( baseClassPath ); bcp.addComponent( BshClassPath.getUserClassPath() ); setClassPath( bcp.getPathComponents() ); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public void reloadClasses( String [] classNames ) throws ClassPathException { // validate that it is a class here? // init base class loader if there is none... if ( baseLoader == null ) initBaseLoader(); DiscreteFilesClassLoader.ClassSourceMap map = new DiscreteFilesClassLoader.ClassSourceMap(); for (int i=0; i< classNames.length; i++) { String name = classNames[i]; // look in baseLoader class path ClassSource classSource = baseClassPath.getClassSource( name ); // look in user class path if ( classSource == null ) { BshClassPath.getUserClassPath().insureInitialized(); classSource = BshClassPath.getUserClassPath().getClassSource( name ); } // No point in checking boot class path, can't reload those. // else we could have used fullClassPath above. if ( classSource == null ) throw new ClassPathException("Nothing known about class: " +name ); // JarClassSource is not working... just need to implement it's // getCode() method or, if we decide to, allow the BshClassManager // to handle it... since it is a URLClassLoader and can handle JARs if ( classSource instanceof JarClassSource ) throw new ClassPathException("Cannot reload class: "+name+ " from source: "+ classSource ); map.put( name, classSource ); } // Create classloader for the set of classes ClassLoader cl = new DiscreteFilesClassLoader( this, map ); // map those classes the loader in the overlay map Iterator it = map.keySet().iterator(); while ( it.hasNext() ) loaderMap.put( (String)it.next(), cl ); classLoaderChanged(); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public void reloadPackage( String pack ) throws ClassPathException { Collection classes = baseClassPath.getClassesForPackage( pack ); if ( classes == null ) classes = BshClassPath.getUserClassPath().getClassesForPackage( pack ); // no point in checking boot class path, can't reload those if ( classes == null ) throw new ClassPathException("No classes found for package: "+pack); reloadClasses( (String[])classes.toArray( new String[0] ) ); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public BshClassPath getClassPath() throws ClassPathException { if ( fullClassPath != null ) return fullClassPath; fullClassPath = new BshClassPath("BeanShell Full Class Path"); fullClassPath.addComponent( BshClassPath.getUserClassPath() ); try { fullClassPath.addComponent( BshClassPath.getBootClassPath() ); } catch ( ClassPathException e ) { System.err.println("Warning: can't get boot class path"); } fullClassPath.addComponent( baseClassPath ); return fullClassPath; }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public String getClassNameByUnqName( String name ) throws ClassPathException { return getClassPath().getClassNameByUnqName( name ); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public String getClassNameByUnqName( String name ) throws ClassPathException { insureInitialized(); UnqualifiedNameTable unqNameTable = getUnqualifiedNameTable(); Object obj = unqNameTable.get( name ); if ( obj instanceof AmbiguousName ) throw new ClassPathException("Ambigous class names: "+ ((AmbiguousName)obj).get() ); return (String)obj; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public static URL [] getUserClassPathComponents() throws ClassPathException { if ( userClassPathComp != null ) return userClassPathComp; String cp=System.getProperty("java.class.path"); String [] paths=StringUtil.split(cp, File.pathSeparator); URL [] urls = new URL[ paths.length ]; try { for ( int i=0; i<paths.length; i++) // We take care to get the canonical path first. // Java deals with relative paths for it's bootstrap loader // but JARClassLoader doesn't. urls[i] = new File( new File(paths[i]).getCanonicalPath() ).toURL(); } catch ( IOException e ) { throw new ClassPathException("can't parse class path: "+e); } userClassPathComp = urls; return urls; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public static BshClassPath getUserClassPath() throws ClassPathException { if ( userClassPath == null ) userClassPath = new BshClassPath( "User Class Path", getUserClassPathComponents() ); return userClassPath; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public static BshClassPath getBootClassPath() throws ClassPathException { if ( bootClassPath == null ) { try { //String rtjar = System.getProperty("java.home")+"/lib/rt.jar"; String rtjar = getRTJarPath(); URL url = new File( rtjar ).toURL(); bootClassPath = new BshClassPath( "Boot Class Path", new URL[] { url } ); } catch ( MalformedURLException e ) { throw new ClassPathException(" can't find boot jar: "+e); } } return bootClassPath; }
3
            
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassPathException e ) { System.err.println("Warning: can't get boot class path"); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassPathException e ) { throw new UtilEvalError("Error importing classpath "+ e ); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassPathException e ) { throw new org.gjt.sp.jedit.bsh.InterpreterError("defineClass: "+e); }
2
            
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassPathException e ) { throw new UtilEvalError("Error importing classpath "+ e ); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassPathException e ) { throw new org.gjt.sp.jedit.bsh.InterpreterError("defineClass: "+e); }
0
unknown (Lib) CloneNotSupportedException 0 0 0 1
            
// in org/gjt/sp/jedit/textarea/Selection.java
catch(CloneNotSupportedException e) { throw new InternalError("I just drank a whole " + "bottle of cough syrup and I feel " + "funny!"); }
1
            
// in org/gjt/sp/jedit/textarea/Selection.java
catch(CloneNotSupportedException e) { throw new InternalError("I just drank a whole " + "bottle of cough syrup and I feel " + "funny!"); }
0
runtime (Lib) Error 17
            
// in org/gjt/sp/jedit/pluginmgr/InstallPanel.java
Override public Class getColumnClass(int columnIndex) { switch (columnIndex) { case 0: return Boolean.class; case 1: case 2: case 3: case 4: case 5: return Object.class; default: throw new Error("Column out of range"); } }
// in org/gjt/sp/jedit/pluginmgr/InstallPanel.java
Override public String getColumnName(int column) { switch (column) { case 0: return " "; case 1: return ' '+jEdit.getProperty("install-plugins.info.name"); case 2: return ' '+jEdit.getProperty("install-plugins.info.category"); case 3: return ' '+jEdit.getProperty("install-plugins.info.version"); case 4: return ' '+jEdit.getProperty("install-plugins.info.size"); case 5: return ' '+jEdit.getProperty("install-plugins.info.releaseDate"); default: throw new Error("Column out of range"); } }
// in org/gjt/sp/jedit/pluginmgr/InstallPanel.java
Override public Object getValueAt(int rowIndex,int columnIndex) { Object obj = filteredEntries.get(rowIndex); if(obj instanceof String) { if(columnIndex == 1) return obj; else return null; } else { Entry entry = (Entry)obj; switch (columnIndex) { case 0: return entry.install; case 1: return entry.name; case 2: return entry.set; case 3: if (updates) return entry.installedVersion + "->" + entry.version; return entry.version; case 4: return formatSize(entry.size); case 5: return entry.date; default: throw new Error("Column out of range"); } } }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
Override public String getColumnName(int column) { switch (column) { case 0: return " "; case 1: return jEdit.getProperty("manage-plugins.info.name"); case 2: return jEdit.getProperty("manage-plugins.info.version"); case 3: return jEdit.getProperty("manage-plugins.info.status"); case 4: return jEdit.getProperty("manage-plugins.info.data"); default: throw new Error("Column out of range"); } }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
Override public Object getValueAt(int rowIndex,int columnIndex) { Entry entry = entries.get(rowIndex); switch (columnIndex) { case 0: return Boolean.valueOf(!entry.status.equals(Entry.NOT_LOADED)); case 1: if(entry.name == null) { return MiscUtilities.getFileName(entry.jar); } else { return entry.name; } case 2: return entry.version; case 3: return jEdit.getProperty("plugin-manager.status." + entry.status); case 4: if (entry.dataSize == null && entry.plugin != null) { File pluginDirectory = entry.plugin.getPluginHome(); if (null == pluginDirectory) { return null; } if (pluginDirectory.exists()) { entry.dataSize = StandardUtilities.formatFileSize(IOUtilities.fileLength(pluginDirectory)); } else { if (jEdit.getBooleanProperty("plugin." + entry.clazz + ".usePluginHome")) { entry.dataSize = StandardUtilities.formatFileSize(0); } else { entry.dataSize = jEdit.getProperty("manage-plugins.data-size.unknown"); } } } return entry.dataSize; default: throw new Error("Column out of range"); } }
// in org/gjt/sp/jedit/bsh/BshMethod.java
Object invoke( Object[] argValues, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean overrideNameSpace ) throws EvalError { if ( argValues != null ) for (int i=0; i<argValues.length; i++) if ( argValues[i] == null ) throw new Error("HERE!"); if ( javaMethod != null ) try { return Reflect.invokeMethod( javaMethod, javaObject, argValues ); } catch ( ReflectError e ) { throw new EvalError( "Error invoking Java method: "+e, callerInfo, callstack ); } catch ( InvocationTargetException e2 ) { throw new TargetError( "Exception invoking imported object method.", e2, callerInfo, callstack, true/*isNative*/ ); } // is this a syncrhonized method? if ( modifiers != null && modifiers.hasModifier("synchronized") ) { // The lock is our declaring namespace's This reference // (the method's 'super'). Or in the case of a class it's the // class instance. Object lock; if ( declaringNameSpace.isClass ) { try { lock = declaringNameSpace.getClassInstance(); } catch ( UtilEvalError e ) { throw new InterpreterError( "Can't get class instance for synchronized method."); } } else lock = declaringNameSpace.getThis(interpreter); // ??? synchronized( lock ) { return invokeImpl( argValues, interpreter, callstack, callerInfo, overrideNameSpace ); } } else return invokeImpl( argValues, interpreter, callstack, callerInfo, overrideNameSpace ); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public boolean Line() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 0: jj_consume_token(0); Interpreter.debug("End of File!"); {if (true) return true;} break; default: if (jj_2_1(1)) { BlockStatement(); {if (true) return false;} } else { jj_consume_token(-1); throw new ParseException(); } } throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public Modifiers Modifiers(int context, boolean lookahead) throws ParseException { Modifiers mods = null; label_1: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ABSTRACT: case FINAL: case NATIVE: case PRIVATE: case PROTECTED: case PUBLIC: case STATIC: case STRICTFP: case SYNCHRONIZED: case TRANSIENT: case VOLATILE: ; break; default: break label_1; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PRIVATE: jj_consume_token(PRIVATE); break; case PROTECTED: jj_consume_token(PROTECTED); break; case PUBLIC: jj_consume_token(PUBLIC); break; case SYNCHRONIZED: jj_consume_token(SYNCHRONIZED); break; case FINAL: jj_consume_token(FINAL); break; case NATIVE: jj_consume_token(NATIVE); break; case TRANSIENT: jj_consume_token(TRANSIENT); break; case VOLATILE: jj_consume_token(VOLATILE); break; case ABSTRACT: jj_consume_token(ABSTRACT); break; case STATIC: jj_consume_token(STATIC); break; case STRICTFP: jj_consume_token(STRICTFP); break; default: jj_consume_token(-1); throw new ParseException(); } if ( !lookahead ) try { if ( mods == null ) mods = new Modifiers(); mods.addModifier( context, getToken(0).image ); } catch ( IllegalStateException e ) { {if (true) throw createParseException( e.getMessage() );} } } {if (true) return mods;} throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public int NameList() throws ParseException { int count = 0; AmbiguousName(); ++count; label_6: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: break label_6; } jj_consume_token(COMMA); AmbiguousName(); ++count; } {if (true) return count;} throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public int AssignmentOperator() throws ParseException { Token t; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ASSIGN: jj_consume_token(ASSIGN); break; case STARASSIGN: jj_consume_token(STARASSIGN); break; case SLASHASSIGN: jj_consume_token(SLASHASSIGN); break; case MODASSIGN: jj_consume_token(MODASSIGN); break; case PLUSASSIGN: jj_consume_token(PLUSASSIGN); break; case MINUSASSIGN: jj_consume_token(MINUSASSIGN); break; case ANDASSIGN: jj_consume_token(ANDASSIGN); break; case XORASSIGN: jj_consume_token(XORASSIGN); break; case ORASSIGN: jj_consume_token(ORASSIGN); break; case LSHIFTASSIGN: jj_consume_token(LSHIFTASSIGN); break; case LSHIFTASSIGNX: jj_consume_token(LSHIFTASSIGNX); break; case RSIGNEDSHIFTASSIGN: jj_consume_token(RSIGNEDSHIFTASSIGN); break; case RSIGNEDSHIFTASSIGNX: jj_consume_token(RSIGNEDSHIFTASSIGNX); break; case RUNSIGNEDSHIFTASSIGN: jj_consume_token(RUNSIGNEDSHIFTASSIGN); break; case RUNSIGNEDSHIFTASSIGNX: jj_consume_token(RUNSIGNEDSHIFTASSIGNX); break; default: jj_consume_token(-1); throw new ParseException(); } t = getToken(0); {if (true) return t.kind;} throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public boolean BooleanLiteral() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case TRUE: jj_consume_token(TRUE); {if (true) return true;} break; case FALSE: jj_consume_token(FALSE); {if (true) return false;} break; default: jj_consume_token(-1); throw new ParseException(); } throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
protected void ExpandBuff(boolean wrapAround) { char[] newbuffer = new char[bufsize + 2048]; int newbufline[] = new int[bufsize + 2048]; int newbufcolumn[] = new int[bufsize + 2048]; try { if (wrapAround) { System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos); buffer = newbuffer; System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos); bufline = newbufline; System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos); bufcolumn = newbufcolumn; bufpos += (bufsize - tokenBegin); } else { System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); buffer = newbuffer; System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); bufline = newbufline; System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); bufcolumn = newbufcolumn; bufpos -= tokenBegin; } } catch (Throwable t) { throw new Error(t.getMessage()); } available = (bufsize += 2048); tokenBegin = 0; }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
public char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; if (++bufpos == bufsize) bufpos = 0; return buffer[bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if ((buffer[bufpos] = c = ReadByte()) == '\\') { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = ReadByte()) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch(java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = ReadByte()) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval(ReadByte()) << 8 | hexval(ReadByte()) << 4 | hexval(ReadByte())); column += 4; } catch(java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; else { backup(backSlashCnt - 1); return '\\'; } } else { UpdateLineColumn(c); return (c); } }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public void removeListener( Listener l ) { throw new Error("unimplemented"); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public byte [] getCode( String className ) { throw new Error("Unimplemented"); }
2
            
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch (Throwable t) { throw new Error(t.getMessage()); }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch(java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); }
0 0 0 0
checked (Domain) EvalError
public class EvalError extends Exception 
{
	SimpleNode node;

	// Note: no way to mutate the Throwable message, must maintain our own
	String message;

	CallStack callstack;

	public EvalError( String s, SimpleNode node, CallStack callstack ) {
		setMessage(s);
		this.node = node;
		// freeze the callstack for the stack trace.
		if ( callstack != null )
			this.callstack = callstack.copy();
	}

	/**
		Print the error with line number and stack trace.
	*/
	public String toString() 
	{
		String trace;
		if ( node != null )
			trace = " : at Line: "+ node.getLineNumber() 
				+ " :\n in file: "+ node.getSourceFile()
				+ "\n : "+node.getText();
		else
			// Users should not normally see this.
			trace = ": <at unknown location>";

		if ( callstack != null )
			trace = trace +"\n" + getScriptStackTrace();

		return getMessage() + trace;
	}

	/**
		Re-throw the error, prepending the specified message.
	*/
	public void reThrow( String msg ) 
		throws EvalError 
	{
		prependMessage( msg );
		throw this;
	}

	/**
		The error has trace info associated with it. 
		i.e. It has an AST node that can print its location and source text.
	*/
	SimpleNode getNode() {
		return node;
	}

	void setNode( SimpleNode node ) {
		this.node = node;
	}

	public String getErrorText() { 
		if ( node != null )
			return node.getText() ;
		else
			return "<unknown error>";
	}

	public int getErrorLineNumber() { 
		if ( node != null )
			return node.getLineNumber() ;
		else
			return -1;
	}

	public String getErrorSourceFile() {
		if ( node != null )
			return node.getSourceFile() ;
		else
			return "<unknown file>";
	}

	public String getScriptStackTrace() 
	{
		if ( callstack == null )
			return "<Unknown>";

		String trace = "";
		CallStack stack = callstack.copy();
		while ( stack.depth() > 0 ) 
		{
			NameSpace ns = stack.pop();
			SimpleNode node = ns.getNode();
			if ( ns.isMethod )
			{
				trace = trace + "\nCalled from method: " + ns.getName();
				if ( node != null )
					trace += " : at Line: "+ node.getLineNumber() 
						+ " : in file: "+ node.getSourceFile()
						+ " : "+node.getText();
			}
		}

		return trace;
	}

	/**
		@see #toString() for a full display of the information
	*/
	public String getMessage() { return message; }

	public void setMessage( String s ) { message = s; }

	/**
		Prepend the message if it is non-null.
	*/
	protected void prependMessage( String s ) 
	{ 
		if ( s == null )
			return;

		if ( message == null )
			message = s;
		else
			message = s + " : "+ message;
	}

}
59
            
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
public Object doSuffix( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError { // Handle ".class" suffix operation // Prefix must be a BSHType if ( operation == CLASS ) if ( obj instanceof BSHType ) { if ( toLHS ) throw new EvalError("Can't assign .class", this, callstack ); NameSpace namespace = callstack.top(); return ((BSHType)obj).getType( callstack, interpreter ); } else throw new EvalError( "Attempt to use .class suffix on non class.", this, callstack ); /* Evaluate our prefix if it needs evaluating first. If this is the first evaluation our prefix mayb be a Node (directly from the PrimaryPrefix) - eval() it to an object. If it's an LHS, resolve to a value. Note: The ambiguous name construct is now necessary where the node may be an ambiguous name. If this becomes common we might want to make a static method nodeToObject() or something. The point is that we can't just eval() - we need to direct the evaluation to the context sensitive type of result; namely object, class, etc. */ if ( obj instanceof SimpleNode ) if ( obj instanceof BSHAmbiguousName ) obj = ((BSHAmbiguousName)obj).toObject(callstack, interpreter); else obj = ((SimpleNode)obj).eval(callstack, interpreter); else if ( obj instanceof LHS ) try { obj = ((LHS)obj).getValue(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } try { switch(operation) { case INDEX: return doIndex( obj, toLHS, callstack, interpreter ); case NAME: return doName( obj, toLHS, callstack, interpreter ); case PROPERTY: return doProperty( toLHS, obj, callstack, interpreter ); default: throw new InterpreterError( "Unknown suffix type" ); } } catch(ReflectError e) { throw new EvalError("reflection error: " + e, this, callstack ); } catch(InvocationTargetException e) { throw new TargetError( "target exception", e.getTargetException(), this, callstack, true); } }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
private Object doName( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError, ReflectError, InvocationTargetException { try { // .length on array if ( field.equals("length") && obj.getClass().isArray() ) if ( toLHS ) throw new EvalError( "Can't assign array length", this, callstack ); else return new Primitive(Array.getLength(obj)); // field access if ( jjtGetNumChildren() == 0 ) if ( toLHS ) return Reflect.getLHSObjectField(obj, field); else return Reflect.getObjectFieldValue( obj, field ); // Method invocation // (LHS or non LHS evaluation can both encounter method calls) Object[] oa = ((BSHArguments)jjtGetChild(0)).getArguments( callstack, interpreter); // TODO: // Note: this try/catch block is copied from BSHMethodInvocation // we need to factor out this common functionality and make sure // we handle all cases ... (e.g. property style access, etc.) // maybe move this to Reflect ? try { return Reflect.invokeObjectMethod( obj, field, oa, interpreter, callstack, this ); } catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); } catch ( InvocationTargetException e ) { String msg = "Method Invocation "+field; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); } } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
static int getIndexAux( Object obj, CallStack callstack, Interpreter interpreter, SimpleNode callerInfo ) throws EvalError { if ( !obj.getClass().isArray() ) throw new EvalError("Not an array", callerInfo, callstack ); int index; try { Object indexVal = ((SimpleNode)callerInfo.jjtGetChild(0)).eval( callstack, interpreter ); if ( !(indexVal instanceof Primitive) ) indexVal = Types.castObject( indexVal, Integer.TYPE, Types.ASSIGNMENT ); index = ((Primitive)indexVal).intValue(); } catch( UtilEvalError e ) { Interpreter.debug("doIndex: "+e); throw e.toEvalError( "Arrays may only be indexed by integer types.", callerInfo, callstack ); } return index; }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
private Object doProperty( boolean toLHS, Object obj, CallStack callstack, Interpreter interpreter ) throws EvalError { if(obj == Primitive.VOID) throw new EvalError( "Attempt to access property on undefined variable or class name", this, callstack ); if ( obj instanceof Primitive ) throw new EvalError("Attempt to access property on a primitive", this, callstack ); Object value = ((SimpleNode)jjtGetChild(0)).eval( callstack, interpreter); if ( !( value instanceof String ) ) throw new EvalError( "Property expression must be a String or identifier.", this, callstack ); if ( toLHS ) return new LHS(obj, (String)value); // Property style access to Hashtable or Map CollectionManager cm = CollectionManager.getCollectionManager(); if ( cm.isMap( obj ) ) { Object val = cm.getFromMap( obj, value/*key*/ ); return ( val == null ? val = Primitive.NULL : val ); } try { return Reflect.getObjectProperty( obj, (String)value ); } catch ( UtilEvalError e) { throw e.toEvalError( "Property: "+value, this, callstack ); } catch (ReflectError e) { throw new EvalError("No such property: " + value, this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BshMethod.java
Object invoke( Object[] argValues, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean overrideNameSpace ) throws EvalError { if ( argValues != null ) for (int i=0; i<argValues.length; i++) if ( argValues[i] == null ) throw new Error("HERE!"); if ( javaMethod != null ) try { return Reflect.invokeMethod( javaMethod, javaObject, argValues ); } catch ( ReflectError e ) { throw new EvalError( "Error invoking Java method: "+e, callerInfo, callstack ); } catch ( InvocationTargetException e2 ) { throw new TargetError( "Exception invoking imported object method.", e2, callerInfo, callstack, true/*isNative*/ ); } // is this a syncrhonized method? if ( modifiers != null && modifiers.hasModifier("synchronized") ) { // The lock is our declaring namespace's This reference // (the method's 'super'). Or in the case of a class it's the // class instance. Object lock; if ( declaringNameSpace.isClass ) { try { lock = declaringNameSpace.getClassInstance(); } catch ( UtilEvalError e ) { throw new InterpreterError( "Can't get class instance for synchronized method."); } } else lock = declaringNameSpace.getThis(interpreter); // ??? synchronized( lock ) { return invokeImpl( argValues, interpreter, callstack, callerInfo, overrideNameSpace ); } } else return invokeImpl( argValues, interpreter, callstack, callerInfo, overrideNameSpace ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
private Object invokeImpl( Object[] argValues, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean overrideNameSpace ) throws EvalError { Class returnType = getReturnType(); Class [] paramTypes = getParameterTypes(); // If null callstack if ( callstack == null ) callstack = new CallStack( declaringNameSpace ); if ( argValues == null ) argValues = new Object [] { }; // Cardinality (number of args) mismatch if ( argValues.length != numArgs ) { /* // look for help string try { // should check for null namespace here String help = (String)declaringNameSpace.get( "bsh.help."+name, interpreter ); interpreter.println(help); return Primitive.VOID; } catch ( Exception e ) { throw eval error } */ throw new EvalError( "Wrong number of arguments for local method: " + name, callerInfo, callstack ); } // Make the local namespace for the method invocation NameSpace localNameSpace; if ( overrideNameSpace ) localNameSpace = callstack.top(); else { localNameSpace = new NameSpace( declaringNameSpace, name ); localNameSpace.isMethod = true; } // should we do this for both cases above? localNameSpace.setNode( callerInfo ); // set the method parameters in the local namespace for(int i=0; i<numArgs; i++) { // Set typed variable if ( paramTypes[i] != null ) { try { argValues[i] = //Types.getAssignableForm( argValues[i], paramTypes[i] ); Types.castObject( argValues[i], paramTypes[i], Types.ASSIGNMENT ); } catch( UtilEvalError e) { throw new EvalError( "Invalid argument: " + "`"+paramNames[i]+"'" + " for method: " + name + " : " + e.getMessage(), callerInfo, callstack ); } try { localNameSpace.setTypedVariable( paramNames[i], paramTypes[i], argValues[i], null/*modifiers*/); } catch ( UtilEvalError e2 ) { throw e2.toEvalError( "Typed method parameter assignment", callerInfo, callstack ); } } // Set untyped variable else // untyped param { // getAssignable would catch this for typed param if ( argValues[i] == Primitive.VOID) throw new EvalError( "Undefined variable or class name, parameter: " + paramNames[i] + " to method: " + name, callerInfo, callstack ); else try { localNameSpace.setLocalVariable( paramNames[i], argValues[i], interpreter.getStrictJava() ); } catch ( UtilEvalError e3 ) { throw e3.toEvalError( callerInfo, callstack ); } } } // Push the new namespace on the call stack if ( !overrideNameSpace ) callstack.push( localNameSpace ); // Invoke the block, overriding namespace with localNameSpace Object ret = methodBody.eval( callstack, interpreter, true/*override*/ ); // save the callstack including the called method, just for error mess CallStack returnStack = callstack.copy(); // Get back to caller namespace if ( !overrideNameSpace ) callstack.pop(); ReturnControl retControl = null; if ( ret instanceof ReturnControl ) { retControl = (ReturnControl)ret; // Method body can only use 'return' statment type return control. if ( retControl.kind == retControl.RETURN ) ret = ((ReturnControl)ret).value; else // retControl.returnPoint is the Node of the return statement throw new EvalError("'continue' or 'break' in method body", retControl.returnPoint, returnStack ); // Check for explicit return of value from void method type. // retControl.returnPoint is the Node of the return statement if ( returnType == Void.TYPE && ret != Primitive.VOID ) throw new EvalError( "Cannot return value from void method", retControl.returnPoint, returnStack); } if ( returnType != null ) { // If return type void, return void as the value. if ( returnType == Void.TYPE ) return Primitive.VOID; // return type is a class try { ret = // Types.getAssignableForm( ret, (Class)returnType ); Types.castObject( ret, returnType, Types.ASSIGNMENT ); } catch( UtilEvalError e ) { // Point to return statement point if we had one. // (else it was implicit return? What's the case here?) SimpleNode node = callerInfo; if ( retControl != null ) node = retControl.returnPoint; throw e.toEvalError( "Incorrect type returned from method: " + name + e.getMessage(), node, callstack ); } } return ret; }
// in org/gjt/sp/jedit/bsh/This.java
public Object invokeMethod( String methodName, Object [] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean declaredOnly ) throws EvalError { /* Wrap nulls. This is a bit of a cludge to address a deficiency in the class generator whereby it does not wrap nulls on method delegate. See Class Generator.java. If we fix that then we can remove this. (just have to generate the code there.) */ if ( args != null ) { Object [] oa = new Object [args.length]; for(int i=0; i<args.length; i++) oa[i] = ( args[i] == null ? Primitive.NULL : args[i] ); args = oa; } if ( interpreter == null ) interpreter = declaringInterpreter; if ( callstack == null ) callstack = new CallStack( namespace ); if ( callerInfo == null ) callerInfo = SimpleNode.JAVACODE; // Find the bsh method Class [] types = Types.getTypes( args ); BshMethod bshMethod = null; try { bshMethod = namespace.getMethod( methodName, types, declaredOnly ); } catch ( UtilEvalError e ) { // leave null } if ( bshMethod != null ) return bshMethod.invoke( args, interpreter, callstack, callerInfo ); /* No scripted method of that name. Implement the required part of the Object protocol: public int hashCode(); public boolean equals(java.lang.Object); public java.lang.String toString(); if these were not handled by scripted methods we must provide a default impl. */ // a default toString() that shows the interfaces we implement if ( methodName.equals("toString" ) ) return toString(); // a default hashCode() if ( methodName.equals("hashCode" ) ) return new Integer(this.hashCode()); // a default equals() testing for equality with the This reference if ( methodName.equals("equals" ) ) { Object obj = args[0]; return new Boolean( this == obj ); } // Look for a default invoke() handler method in the namespace // Note: this code duplicates that in NameSpace getCommand() // is that ok? try { bshMethod = namespace.getMethod( "invoke", new Class [] { null, null } ); } catch ( UtilEvalError e ) { /*leave null*/ } // Call script "invoke( String methodName, Object [] args ); if ( bshMethod != null ) return bshMethod.invoke( new Object [] { methodName, args }, interpreter, callstack, callerInfo ); throw new EvalError("Method " + StringUtil.methodString( methodName, types ) + " not found in bsh scripted object: "+ namespace.getName(), callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHArguments.java
public Object[] getArguments( CallStack callstack, Interpreter interpreter) throws EvalError { // evaluate each child Object[] args = new Object[jjtGetNumChildren()]; for(int i = 0; i < args.length; i++) { args[i] = ((SimpleNode)jjtGetChild(i)).eval(callstack, interpreter); if ( args[i] == Primitive.VOID ) throw new EvalError( "Undefined argument: " + ((SimpleNode)jjtGetChild(i)).getText(), this, callstack ); } return args; }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
public static Class generateClassImpl( String name, Modifiers modifiers, Class [] interfaces, Class superClass, BSHBlock block, boolean isInterface, CallStack callstack, Interpreter interpreter ) throws EvalError { // Scripting classes currently requires accessibility // This can be eliminated with a bit more work. try { Capabilities.setAccessibility( true ); } catch ( Capabilities.Unavailable e ) { throw new EvalError( "Defining classes currently requires reflective Accessibility.", block, callstack ); } NameSpace enclosingNameSpace = callstack.top(); String packageName = enclosingNameSpace.getPackage(); String className = enclosingNameSpace.isClass ? ( enclosingNameSpace.getName()+"$"+name ) : name; String fqClassName = packageName == null ? className : packageName + "." + className; BshClassManager bcm = interpreter.getClassManager(); // Race condition here... bcm.definingClass( fqClassName ); // Create the class static namespace NameSpace classStaticNameSpace = new NameSpace( enclosingNameSpace, className); classStaticNameSpace.isClass = true; callstack.push( classStaticNameSpace ); // Evaluate any inner class class definitions in the block // effectively recursively call this method for contained classes first block.evalBlock( callstack, interpreter, true/*override*/, ClassNodeFilter.CLASSCLASSES ); // Generate the type for our class Variable [] variables = getDeclaredVariables( block, callstack, interpreter, packageName ); DelayedEvalBshMethod [] methods = getDeclaredMethods( block, callstack, interpreter, packageName ); ClassGeneratorUtil classGenerator = new ClassGeneratorUtil( modifiers, className, packageName, superClass, interfaces, variables, methods, classStaticNameSpace, isInterface ); byte [] code = classGenerator.generateClass(); // if debug, write out the class file to debugClasses directory String dir = System.getProperty("debugClasses"); if ( dir != null ) try { FileOutputStream out= new FileOutputStream( dir+"/"+className+".class" ); out.write(code); out.close(); } catch ( IOException e ) { } // Define the new class in the classloader Class genClass = bcm.defineClass( fqClassName, code ); // import the unq name into parent enclosingNameSpace.importClass( fqClassName.replace('$','.') ); try { classStaticNameSpace.setLocalVariable( ClassGeneratorUtil.BSHINIT, block, false/*strictJava*/ ); } catch ( UtilEvalError e ) { throw new InterpreterError("unable to init static: "+e ); } // Give the static space its class static import // important to do this after all classes are defined classStaticNameSpace.setClassStatic( genClass ); // evaluate the static portion of the block in the static space block.evalBlock( callstack, interpreter, true/*override*/, ClassNodeFilter.CLASSSTATIC ); callstack.pop(); if ( !genClass.isInterface() ) { // Set the static bsh This callback String bshStaticFieldName = ClassGeneratorUtil.BSHSTATIC+className; try { LHS lhs = Reflect.getLHSStaticField( genClass, bshStaticFieldName ); lhs.assign( classStaticNameSpace.getThis( interpreter ), false/*strict*/ ); } catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); } } bcm.doneDefiningClass( fqClassName ); return genClass; }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
public Class toClass( CallStack callstack, Interpreter interpreter ) throws EvalError { try { return getName( callstack.top() ).toClass(); } catch ( ClassNotFoundException e ) { throw new EvalError( e.getMessage(), this, callstack ); } catch ( UtilEvalError e2 ) { // ClassPathException is a type of UtilEvalError throw e2.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHPrimaryExpression.java
public LHS toLHS( CallStack callstack, Interpreter interpreter) throws EvalError { Object obj = eval( true, callstack, interpreter ); if ( ! (obj instanceof LHS) ) throw new EvalError("Can't assign to:", this, callstack ); else return (LHS)obj; }
// in org/gjt/sp/jedit/bsh/BSHPrimaryExpression.java
private Object eval( boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError { Object obj = jjtGetChild(0); int numChildren = jjtGetNumChildren(); for(int i=1; i<numChildren; i++) obj = ((BSHPrimarySuffix)jjtGetChild(i)).doSuffix( obj, toLHS, callstack, interpreter); /* If the result is a Node eval() it to an object or LHS (as determined by toLHS) */ if ( obj instanceof SimpleNode ) if ( obj instanceof BSHAmbiguousName ) if ( toLHS ) obj = ((BSHAmbiguousName)obj).toLHS( callstack, interpreter); else obj = ((BSHAmbiguousName)obj).toObject( callstack, interpreter); else // Some arbitrary kind of node if ( toLHS ) // is this right? throw new EvalError("Can't assign to prefix.", this, callstack ); else obj = ((SimpleNode)obj).eval(callstack, interpreter); // return LHS or value object as determined by toLHS if ( obj instanceof LHS ) if ( toLHS ) return obj; else try { return ((LHS)obj).getValue(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } else return obj; }
// in org/gjt/sp/jedit/bsh/BSHType.java
public Class getType( CallStack callstack, Interpreter interpreter ) throws EvalError { // return cached type if available if ( type != null ) return type; // first node will either be PrimitiveType or AmbiguousName SimpleNode node = getTypeNode(); if ( node instanceof BSHPrimitiveType ) baseType = ((BSHPrimitiveType)node).getType(); else baseType = ((BSHAmbiguousName)node).toClass( callstack, interpreter ); if ( arrayDims > 0 ) { try { // Get the type by constructing a prototype array with // arbitrary (zero) length in each dimension. int[] dims = new int[arrayDims]; // int array default zeros Object obj = Array.newInstance(baseType, dims); type = obj.getClass(); } catch(Exception e) { throw new EvalError("Couldn't construct array type", this, callstack ); } } else type = baseType; // hack... sticking to first interpreter that resolves this // see comments on type instance variable interpreter.getClassManager().addListener(this); return type; }
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { BSHBlock tryBlock = ((BSHBlock)jjtGetChild(0)); Vector catchParams = new Vector(); Vector catchBlocks = new Vector(); int nchild = jjtGetNumChildren(); Node node = null; int i=1; while((i < nchild) && ((node = jjtGetChild(i++)) instanceof BSHFormalParameter)) { catchParams.addElement(node); catchBlocks.addElement(jjtGetChild(i++)); node = null; } // finaly block BSHBlock finallyBlock = null; if(node != null) finallyBlock = (BSHBlock)node; // Why both of these? TargetError target = null; Throwable thrown = null; Object ret = null; /* Evaluate the contents of the try { } block and catch any resulting TargetErrors generated by the script. We save the callstack depth and if an exception is thrown we pop back to that depth before contiuing. The exception short circuited any intervening method context pops. Note: we the stack info... what do we do with it? append to exception message? */ int callstackDepth = callstack.depth(); try { ret = tryBlock.eval(callstack, interpreter); } catch( TargetError e ) { target = e; String stackInfo = "Bsh Stack: "; while ( callstack.depth() > callstackDepth ) stackInfo += "\t" + callstack.pop() +"\n"; } // unwrap the target error if ( target != null ) thrown = target.getTarget(); // If we have an exception, find a catch if (thrown != null) { int n = catchParams.size(); for(i=0; i<n; i++) { // Get catch block BSHFormalParameter fp = (BSHFormalParameter)catchParams.elementAt(i); // Should cache this subject to classloader change message // Evaluation of the formal parameter simply resolves its // type via the specified namespace.. it doesn't modify the // namespace. fp.eval( callstack, interpreter ); if ( fp.type == null && interpreter.getStrictJava() ) throw new EvalError( "(Strict Java) Untyped catch block", this, callstack ); // If the param is typed check assignability if ( fp.type != null ) try { thrown = (Throwable)Types.castObject( thrown/*rsh*/, fp.type/*lhsType*/, Types.ASSIGNMENT ); } catch( UtilEvalError e ) { /* Catch the mismatch and continue to try the next Note: this is innefficient, should have an isAssignableFrom() that doesn't throw // TODO: we do now have a way to test assignment // in castObject(), use it? */ continue; } // Found match, execute catch block BSHBlock cb = (BSHBlock)(catchBlocks.elementAt(i)); // Prepare to execute the block. // We must create a new BlockNameSpace to hold the catch // parameter and swap it on the stack after initializing it. NameSpace enclosingNameSpace = callstack.top(); BlockNameSpace cbNameSpace = new BlockNameSpace( enclosingNameSpace ); try { if ( fp.type == BSHFormalParameter.UNTYPED ) // set an untyped variable directly in the block cbNameSpace.setBlockVariable( fp.name, thrown ); else { // set a typed variable (directly in the block) Modifiers modifiers = new Modifiers(); cbNameSpace.setTypedVariable( fp.name, fp.type, thrown, new Modifiers()/*none*/ ); } } catch ( UtilEvalError e ) { throw new InterpreterError( "Unable to set var in catch block namespace." ); } // put cbNameSpace on the top of the stack callstack.swap( cbNameSpace ); try { ret = cb.eval( callstack, interpreter ); } finally { // put it back callstack.swap( enclosingNameSpace ); } target = null; // handled target break; } } // evaluate finally block if(finallyBlock != null) ret = finallyBlock.eval(callstack, interpreter); // exception fell through, throw it upward... if(target != null) throw target; if(ret instanceof ReturnControl) return ret; else return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object objectAllocation( BSHAmbiguousName nameNode, BSHArguments argumentsNode, CallStack callstack, Interpreter interpreter ) throws EvalError { NameSpace namespace = callstack.top(); Object[] args = argumentsNode.getArguments( callstack, interpreter ); if ( args == null) throw new EvalError( "Null args in new.", this, callstack ); // Look for scripted class object Object obj = nameNode.toObject( callstack, interpreter, false/* force class*/ ); // Try regular class obj = nameNode.toObject( callstack, interpreter, true/*force class*/ ); Class type = null; if ( obj instanceof ClassIdentifier ) type = ((ClassIdentifier)obj).getTargetClass(); else throw new EvalError( "Unknown class: "+nameNode.text, this, callstack ); // Is an inner class style object allocation boolean hasBody = jjtGetNumChildren() > 2; if ( hasBody ) { BSHBlock body = (BSHBlock)jjtGetChild(2); if ( type.isInterface() ) return constructWithInterfaceBody( type, args, body, callstack, interpreter ); else return constructWithClassBody( type, args, body, callstack, interpreter ); } else return constructObject( type, args, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object constructObject( Class type, Object[] args, CallStack callstack ) throws EvalError { Object obj; try { obj = Reflect.constructObject( type, args ); } catch ( ReflectError e) { throw new EvalError( "Constructor error: " + e.getMessage(), this, callstack ); } catch(InvocationTargetException e) { // No need to wrap this debug Interpreter.debug("The constructor threw an exception:\n\t" + e.getTargetException()); throw new TargetError( "Object constructor", e.getTargetException(), this, callstack, true); } String className = type.getName(); // Is it an inner class? if ( className.indexOf("$") == -1 ) return obj; // Temporary hack to support inner classes // If the obj is a non-static inner class then import the context... // This is not a sufficient emulation of inner classes. // Replace this later... // work through to class 'this' This ths = callstack.top().getThis( null ); NameSpace instanceNameSpace = Name.getClassNameSpace( ths.getNameSpace() ); // Change the parent (which was the class static) to the class instance // We really need to check if we're a static inner class here first... // but for some reason Java won't show the static modifier on our // fake inner classes... could generate a flag field. if ( instanceNameSpace != null && className.startsWith( instanceNameSpace.getName() +"$") ) { try { ClassGenerator.getClassGenerator().setInstanceNameSpaceParent( obj, className, instanceNameSpace ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } } return obj; }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object constructWithClassBody( Class type, Object[] args, BSHBlock block, CallStack callstack, Interpreter interpreter ) throws EvalError { String name = callstack.top().getName() + "$" + (++innerClassCount); Modifiers modifiers = new Modifiers(); modifiers.addModifier( Modifiers.CLASS, "public" ); Class clas; try { clas = ClassGenerator.getClassGenerator() .generateClass( name, modifiers, null/*interfaces*/, type/*superClass*/, block, false/*isInterface*/, callstack, interpreter ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } try { return Reflect.constructObject( clas, args ); } catch ( Exception e ) { if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); throw new EvalError( "Error constructing inner class instance: "+e, this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object objectArrayAllocation( BSHAmbiguousName nameNode, BSHArrayDimensions dimensionsNode, CallStack callstack, Interpreter interpreter ) throws EvalError { NameSpace namespace = callstack.top(); Class type = nameNode.toClass( callstack, interpreter ); if ( type == null ) throw new EvalError( "Class " + nameNode.getName(namespace) + " not found.", this, callstack ); return arrayAllocation( dimensionsNode, type, callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object arrayNewInstance( Class type, BSHArrayDimensions dimensionsNode, CallStack callstack ) throws EvalError { if ( dimensionsNode.numUndefinedDims > 0 ) { Object proto = Array.newInstance( type, new int [dimensionsNode.numUndefinedDims] ); // zeros type = proto.getClass(); } try { return Array.newInstance( type, dimensionsNode.definedDimensions); } catch( NegativeArraySizeException e1 ) { throw new TargetError( e1, this, callstack ); } catch( Exception e ) { throw new EvalError("Can't construct primitive array: " + e.getMessage(), this, callstack); } }
// in org/gjt/sp/jedit/bsh/Name.java
private Object invokeLocalMethod( Interpreter interpreter, Object[] args, CallStack callstack, SimpleNode callerInfo ) throws EvalError/*, ReflectError, InvocationTargetException*/ { if ( Interpreter.DEBUG ) Interpreter.debug( "invokeLocalMethod: " + value ); if ( interpreter == null ) throw new InterpreterError( "invokeLocalMethod: interpreter = null"); String commandName = value; Class [] argTypes = Types.getTypes( args ); // Check for existing method BshMethod meth = null; try { meth = namespace.getMethod( commandName, argTypes ); } catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); } // If defined, invoke it if ( meth != null ) return meth.invoke( args, interpreter, callstack, callerInfo ); BshClassManager bcm = interpreter.getClassManager(); // Look for a BeanShell command Object commandObject; try { commandObject = namespace.getCommand( commandName, argTypes, interpreter ); } catch ( UtilEvalError e ) { throw e.toEvalError("Error loading command: ", callerInfo, callstack ); } // should try to print usage here if nothing found if ( commandObject == null ) { // Look for a default invoke() handler method in the namespace // Note: this code duplicates that in This.java... should it? // Call on 'This' can never be a command BshMethod invokeMethod = null; try { invokeMethod = namespace.getMethod( "invoke", new Class [] { null, null } ); } catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); } if ( invokeMethod != null ) return invokeMethod.invoke( new Object [] { commandName, args }, interpreter, callstack, callerInfo ); throw new EvalError( "Command not found: " +StringUtil.methodString( commandName, argTypes ), callerInfo, callstack ); } if ( commandObject instanceof BshMethod ) return ((BshMethod)commandObject).invoke( args, interpreter, callstack, callerInfo ); if ( commandObject instanceof Class ) try { return Reflect.invokeCompiledCommand( ((Class)commandObject), args, interpreter, callstack ); } catch ( UtilEvalError e ) { throw e.toEvalError("Error invoking compiled command: ", callerInfo, callstack ); } throw new InterpreterError("invalid command type"); }
// in org/gjt/sp/jedit/bsh/BSHThrowStatement.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { Object obj = ((SimpleNode)jjtGetChild(0)).eval(callstack, interpreter); // need to loosen this to any throwable... do we need to handle // that in interpreter somewhere? check first... if(!(obj instanceof Exception)) throw new EvalError("Expression in 'throw' must be Exception type", this, callstack ); // wrap the exception in a TargetException to propogate it up throw new TargetError( (Exception)obj, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHBinaryExpression.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { Object lhs = ((SimpleNode)jjtGetChild(0)).eval(callstack, interpreter); /* Doing instanceof? Next node is a type. */ if (kind == INSTANCEOF) { // null object ref is not instance of any type if ( lhs == Primitive.NULL ) return new Primitive(false); Class rhs = ((BSHType)jjtGetChild(1)).getType( callstack, interpreter ); /* // primitive (number or void) cannot be tested for instanceof if (lhs instanceof Primitive) throw new EvalError("Cannot be instance of primitive type." ); */ /* Primitive (number or void) is not normally an instanceof anything. But for internal use we'll test true for the bsh.Primitive class. i.e. (5 instanceof bsh.Primitive) will be true */ if ( lhs instanceof Primitive ) if ( rhs == org.gjt.sp.jedit.bsh.Primitive.class ) return new Primitive(true); else return new Primitive(false); // General case - performe the instanceof based on assignability boolean ret = Types.isJavaBaseAssignable( rhs, lhs.getClass() ); return new Primitive(ret); } // The following two boolean checks were tacked on. // This could probably be smoothed out. /* Look ahead and short circuit evaluation of the rhs if: we're a boolean AND and the lhs is false. */ if ( kind == BOOL_AND || kind == BOOL_ANDX ) { Object obj = lhs; if ( isPrimitiveValue(lhs) ) obj = ((Primitive)lhs).getValue(); if ( obj instanceof Boolean && ( ((Boolean)obj).booleanValue() == false ) ) return new Primitive(false); } /* Look ahead and short circuit evaluation of the rhs if: we're a boolean AND and the lhs is false. */ if ( kind == BOOL_OR || kind == BOOL_ORX ) { Object obj = lhs; if ( isPrimitiveValue(lhs) ) obj = ((Primitive)lhs).getValue(); if ( obj instanceof Boolean && ( ((Boolean)obj).booleanValue() == true ) ) return new Primitive(true); } // end stuff that was tacked on for boolean short-circuiting. /* Are both the lhs and rhs either wrappers or primitive values? do binary op */ boolean isLhsWrapper = isWrapper( lhs ); Object rhs = ((SimpleNode)jjtGetChild(1)).eval(callstack, interpreter); boolean isRhsWrapper = isWrapper( rhs ); if ( ( isLhsWrapper || isPrimitiveValue( lhs ) ) && ( isRhsWrapper || isPrimitiveValue( rhs ) ) ) { // Special case for EQ on two wrapper objects if ( (isLhsWrapper && isRhsWrapper && kind == EQ)) { /* Don't auto-unwrap wrappers (preserve identity semantics) FALL THROUGH TO OBJECT OPERATIONS BELOW. */ } else try { return Primitive.binaryOperation(lhs, rhs, kind); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } } /* Doing the following makes it hard to use untyped vars... e.g. if ( arg == null ) ...what if arg is a primitive? The answer is that we should test only if the var is typed...? need to get that info here... else { // Do we have a mixture of primitive values and non-primitives ? // (primitiveValue = not null, not void) int primCount = 0; if ( isPrimitiveValue( lhs ) ) ++primCount; if ( isPrimitiveValue( rhs ) ) ++primCount; if ( primCount > 1 ) // both primitive types, should have been handled above throw new InterpreterError("should not be here"); else if ( primCount == 1 ) // mixture of one and the other throw new EvalError("Operator: '" + tokenImage[kind] +"' inappropriate for object / primitive combination.", this, callstack ); // else fall through to handle both non-primitive types // end check for primitive and non-primitive mix } */ /* Treat lhs and rhs as arbitrary objects and do the operation. (including NULL and VOID represented by their Primitive types) */ //System.out.println("binary op arbitrary obj: {"+lhs+"}, {"+rhs+"}"); switch(kind) { case EQ: return new Primitive((lhs == rhs)); case NE: return new Primitive((lhs != rhs)); case PLUS: if(lhs instanceof String || rhs instanceof String) return lhs.toString() + rhs.toString(); // FALL THROUGH TO DEFAULT CASE!!! default: if(lhs instanceof Primitive || rhs instanceof Primitive) if ( lhs == Primitive.VOID || rhs == Primitive.VOID ) throw new EvalError( "illegal use of undefined variable, class, or 'void' literal", this, callstack ); else if ( lhs == Primitive.NULL || rhs == Primitive.NULL ) throw new EvalError( "illegal use of null value or 'null' literal", this, callstack); throw new EvalError("Operator: '" + tokenImage[kind] + "' inappropriate for objects", this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHIfStatement.java
public static boolean evaluateCondition( SimpleNode condExp, CallStack callstack, Interpreter interpreter) throws EvalError { Object obj = condExp.eval(callstack, interpreter); if(obj instanceof Primitive) { if ( obj == Primitive.VOID ) throw new EvalError("Condition evaluates to void type", condExp, callstack ); obj = ((Primitive)obj).getValue(); } if(obj instanceof Boolean) return ((Boolean)obj).booleanValue(); else throw new EvalError( "Condition must evaluate to a Boolean or boolean.", condExp, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHSwitchStatement.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { int numchild = jjtGetNumChildren(); int child = 0; SimpleNode switchExp = ((SimpleNode)jjtGetChild(child++)); Object switchVal = switchExp.eval( callstack, interpreter ); /* Note: this could be made clearer by adding an inner class for the cases and an object context for the child traversal. */ // first label BSHSwitchLabel label; Object node; ReturnControl returnControl=null; // get the first label if ( child >= numchild ) throw new EvalError("Empty switch statement.", this, callstack ); label = ((BSHSwitchLabel)jjtGetChild(child++)); // while more labels or blocks and haven't hit return control while ( child < numchild && returnControl == null ) { // if label is default or equals switchVal if ( label.isDefault || primitiveEquals( switchVal, label.eval( callstack, interpreter ), callstack, switchExp ) ) { // execute nodes, skipping labels, until a break or return while ( child < numchild ) { node = jjtGetChild(child++); if ( node instanceof BSHSwitchLabel ) continue; // eval it Object value = ((SimpleNode)node).eval( callstack, interpreter ); // should check to disallow continue here? if ( value instanceof ReturnControl ) { returnControl = (ReturnControl)value; break; } } } else { // skip nodes until next label while ( child < numchild ) { node = jjtGetChild(child++); if ( node instanceof BSHSwitchLabel ) { label = (BSHSwitchLabel)node; break; } } } } if ( returnControl != null && returnControl.kind == RETURN ) return returnControl; else return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHImportDeclaration.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { NameSpace namespace = callstack.top(); if ( superImport ) try { namespace.doSuperImport(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } else { if ( staticImport ) { if ( importPackage ) { Class clas = ((BSHAmbiguousName)jjtGetChild(0)).toClass( callstack, interpreter ); namespace.importStatic( clas ); } else throw new EvalError( "static field imports not supported yet", this, callstack ); } else { String name = ((BSHAmbiguousName)jjtGetChild(0)).text; if ( importPackage ) namespace.importPackage(name); else namespace.importClass(name); } } return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHArrayDimensions.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { SimpleNode child = (SimpleNode)jjtGetChild(0); /* Child is array initializer. Evaluate it and fill in the dimensions it returns. Initialized arrays are always fully defined (no undefined dimensions to worry about). The syntax uses the undefinedDimension count. e.g. int [][] { 1, 2 }; */ if (child instanceof BSHArrayInitializer) { if ( baseType == null ) throw new EvalError( "Internal Array Eval err: unknown base type", this, callstack ); Object initValue = ((BSHArrayInitializer)child).eval( baseType, numUndefinedDims, callstack, interpreter); Class arrayClass = initValue.getClass(); int actualDimensions = Reflect.getArrayDimensions(arrayClass); definedDimensions = new int[ actualDimensions ]; // Compare with number of dimensions actually created with the // number specified (syntax uses the undefined ones here) if ( definedDimensions.length != numUndefinedDims ) throw new EvalError( "Incompatible initializer. Allocation calls for a " + numUndefinedDims+ " dimensional array, but initializer is a " + actualDimensions + " dimensional array", this, callstack ); // fill in definedDimensions [] lengths Object arraySlice = initValue; for ( int i = 0; i < definedDimensions.length; i++ ) { definedDimensions[i] = Array.getLength( arraySlice ); if ( definedDimensions[i] > 0 ) arraySlice = Array.get(arraySlice, 0); } return initValue; } else // Evaluate the defined dimensions of the array { definedDimensions = new int[ numDefinedDims ]; for(int i = 0; i < numDefinedDims; i++) { try { Object length = ((SimpleNode)jjtGetChild(i)).eval( callstack, interpreter); definedDimensions[i] = ((Primitive)length).intValue(); } catch(Exception e) { throw new EvalError( "Array index: " + i + " does not evaluate to an integer", this, callstack ); } } } return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHMethodDeclaration.java
private void evalNodes( CallStack callstack, Interpreter interpreter ) throws EvalError { insureNodesParsed(); // validate that the throws names are class names for(int i=firstThrowsClause; i<numThrows+firstThrowsClause; i++) ((BSHAmbiguousName)jjtGetChild(i)).toClass( callstack, interpreter ); paramsNode.eval( callstack, interpreter ); // if strictJava mode, check for loose parameters and return type if ( interpreter.getStrictJava() ) { for(int i=0; i<paramsNode.paramTypes.length; i++) if ( paramsNode.paramTypes[i] == null ) // Warning: Null callstack here. Don't think we need // a stack trace to indicate how we sourced the method. throw new EvalError( "(Strict Java Mode) Undeclared argument type, parameter: " + paramsNode.getParamNames()[i] + " in method: " + name, this, null ); if ( returnType == null ) // Warning: Null callstack here. Don't think we need // a stack trace to indicate how we sourced the method. throw new EvalError( "(Strict Java Mode) Undeclared return type for method: " + name, this, null ); } }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { NameSpace namespace = callstack.top(); BSHAmbiguousName nameNode = getNameNode(); // Do not evaluate methods this() or super() in class instance space // (i.e. inside a constructor) if ( namespace.getParent() != null && namespace.getParent().isClass && ( nameNode.text.equals("super") || nameNode.text.equals("this") ) ) return Primitive.VOID; Name name = nameNode.getName(namespace); Object[] args = getArgsNode().getArguments(callstack, interpreter); // This try/catch block is replicated is BSHPrimarySuffix... need to // factor out common functionality... // Move to Reflect? try { return name.invokeMethod( interpreter, args, callstack, this); } catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); } catch ( InvocationTargetException e ) { String msg = "Method Invocation "+name; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHEnhancedForStatement.java
public Object eval( CallStack callstack , Interpreter interpreter ) throws EvalError { Class elementType = null; SimpleNode expression, statement=null; NameSpace enclosingNameSpace = callstack.top(); SimpleNode firstNode =((SimpleNode)jjtGetChild(0)); int nodeCount = jjtGetNumChildren(); if ( firstNode instanceof BSHType ) { elementType=((BSHType)firstNode).getType( callstack, interpreter ); expression=((SimpleNode)jjtGetChild(1)); if ( nodeCount>2 ) statement=((SimpleNode)jjtGetChild(2)); } else { expression=firstNode; if ( nodeCount>1 ) statement=((SimpleNode)jjtGetChild(1)); } BlockNameSpace eachNameSpace = new BlockNameSpace( enclosingNameSpace ); callstack.swap( eachNameSpace ); final Object iteratee = expression.eval( callstack, interpreter ); if ( iteratee == Primitive.NULL ) throw new EvalError("The collection, array, map, iterator, or " + "enumeration portion of a for statement cannot be null.", this, callstack ); CollectionManager cm = CollectionManager.getCollectionManager(); if ( !cm.isBshIterable( iteratee ) ) throw new EvalError("Can't iterate over type: " +iteratee.getClass(), this, callstack ); BshIterator iterator = cm.getBshIterator( iteratee ); Object returnControl = Primitive.VOID; while( iterator.hasNext() ) { try { if ( elementType != null ) eachNameSpace.setTypedVariable( varName/*name*/, elementType/*type*/, iterator.next()/*value*/, new Modifiers()/*none*/ ); else eachNameSpace.setVariable( varName, iterator.next(), false ); } catch ( UtilEvalError e ) { throw e.toEvalError( "for loop iterator variable:"+ varName, this, callstack ); } boolean breakout = false; // switch eats a multi-level break here? if ( statement != null ) // not empty statement { Object ret = statement.eval( callstack, interpreter ); if (ret instanceof ReturnControl) { switch(((ReturnControl)ret).kind) { case RETURN: returnControl = ret; breakout = true; break; case CONTINUE: break; case BREAK: breakout = true; break; } } } if (breakout) break; } callstack.swap(enclosingNameSpace); return returnControl; }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { BSHPrimaryExpression lhsNode = (BSHPrimaryExpression)jjtGetChild(0); if ( lhsNode == null ) throw new InterpreterError( "Error, null LHSnode" ); boolean strictJava = interpreter.getStrictJava(); LHS lhs = lhsNode.toLHS( callstack, interpreter); if ( lhs == null ) throw new InterpreterError( "Error, null LHS" ); // For operator-assign operations save the lhs value before evaluating // the rhs. This is correct Java behavior for postfix operations // e.g. i=1; i+=i++; // should be 2 not 3 Object lhsValue = null; if ( operator != ASSIGN ) // assign doesn't need the pre-value try { lhsValue = lhs.getValue(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } SimpleNode rhsNode = (SimpleNode)jjtGetChild(1); Object rhs; // implement "blocks" foo = { }; // if ( rhsNode instanceof BSHBlock ) // rsh = // else rhs = rhsNode.eval(callstack, interpreter); if ( rhs == Primitive.VOID ) throw new EvalError("Void assignment.", this, callstack ); try { switch(operator) { case ASSIGN: return lhs.assign( rhs, strictJava ); case PLUSASSIGN: return lhs.assign( operation(lhsValue, rhs, PLUS), strictJava ); case MINUSASSIGN: return lhs.assign( operation(lhsValue, rhs, MINUS), strictJava ); case STARASSIGN: return lhs.assign( operation(lhsValue, rhs, STAR), strictJava ); case SLASHASSIGN: return lhs.assign( operation(lhsValue, rhs, SLASH), strictJava ); case ANDASSIGN: case ANDASSIGNX: return lhs.assign( operation(lhsValue, rhs, BIT_AND), strictJava ); case ORASSIGN: case ORASSIGNX: return lhs.assign( operation(lhsValue, rhs, BIT_OR), strictJava ); case XORASSIGN: return lhs.assign( operation(lhsValue, rhs, XOR), strictJava ); case MODASSIGN: return lhs.assign( operation(lhsValue, rhs, MOD), strictJava ); case LSHIFTASSIGN: case LSHIFTASSIGNX: return lhs.assign( operation(lhsValue, rhs, LSHIFT), strictJava ); case RSIGNEDSHIFTASSIGN: case RSIGNEDSHIFTASSIGNX: return lhs.assign( operation(lhsValue, rhs, RSIGNEDSHIFT ), strictJava ); case RUNSIGNEDSHIFTASSIGN: case RUNSIGNEDSHIFTASSIGNX: return lhs.assign( operation(lhsValue, rhs, RUNSIGNEDSHIFT), strictJava ); default: throw new InterpreterError( "unimplemented operator in assignment BSH"); } } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { throw new EvalError( "Array initializer has no base type.", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
public Object eval( Class baseType, int dimensions, CallStack callstack, Interpreter interpreter ) throws EvalError { int numInitializers = jjtGetNumChildren(); // allocate the array to store the initializers int [] dima = new int [dimensions]; // description of the array // The other dimensions default to zero and are assigned when // the values are set. dima[0] = numInitializers; Object initializers = Array.newInstance( baseType, dima ); // Evaluate the initializers for (int i = 0; i < numInitializers; i++) { SimpleNode node = (SimpleNode)jjtGetChild(i); Object currentInitializer; if ( node instanceof BSHArrayInitializer ) { if ( dimensions < 2 ) throw new EvalError( "Invalid Location for Intializer, position: "+i, this, callstack ); currentInitializer = ((BSHArrayInitializer)node).eval( baseType, dimensions-1, callstack, interpreter); } else currentInitializer = node.eval( callstack, interpreter); if ( currentInitializer == Primitive.VOID ) throw new EvalError( "Void in array initializer, position"+i, this, callstack ); // Determine if any conversion is necessary on the initializers. // // Quick test to see if conversions apply: // If the dimensionality of the array is 1 then the elements of // the initializer can be primitives or boxable types. If it is // greater then the values must be array (object) types and there // are currently no conversions that we do on those. // If we have conversions on those in the future then we need to // get the real base type here instead of the dimensionless one. Object value = currentInitializer; if ( dimensions == 1 ) { // We do a bsh cast here. strictJava should be able to affect // the cast there when we tighten control try { value = Types.castObject( currentInitializer, baseType, Types.CAST ); } catch ( UtilEvalError e ) { throw e.toEvalError( "Error in array initializer", this, callstack ); } // unwrap any primitive, map voids to null, etc. value = Primitive.unwrap( value ); } // store the value in the array try { Array.set(initializers, i, value); } catch( IllegalArgumentException e ) { Interpreter.debug("illegal arg"+e); throwTypeError( baseType, currentInitializer, i, callstack ); } catch( ArrayStoreException e ) { // I think this can happen Interpreter.debug("arraystore"+e); throwTypeError( baseType, currentInitializer, i, callstack ); } } return initializers; }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
private void throwTypeError( Class baseType, Object initializer, int argNum, CallStack callstack ) throws EvalError { String rhsType; if (initializer instanceof Primitive) rhsType = ((Primitive)initializer).getType().getName(); else rhsType = Reflect.normalizeClassName( initializer.getClass()); throw new EvalError ( "Incompatible type: " + rhsType +" in initializer of array type: "+ baseType +" at position: "+argNum, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHClassDeclaration.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { int child = 0; // resolve superclass if any Class superClass = null; if ( extend ) { BSHAmbiguousName superNode = (BSHAmbiguousName)jjtGetChild(child++); superClass = superNode.toClass( callstack, interpreter ); } // Get interfaces Class [] interfaces = new Class[numInterfaces]; for( int i=0; i<numInterfaces; i++) { BSHAmbiguousName node = (BSHAmbiguousName)jjtGetChild(child++); interfaces[i] = node.toClass(callstack, interpreter); if ( !interfaces[i].isInterface() ) throw new EvalError( "Type: "+node.text+" is not an interface!", this, callstack ); } BSHBlock block; // Get the class body BSHBlock if ( child < jjtGetNumChildren() ) block = (BSHBlock)jjtGetChild(child); else block = new BSHBlock( ParserTreeConstants.JJTBLOCK ); try { return ClassGenerator.getClassGenerator().generateClass( name, modifiers, interfaces, superClass, block, isInterface, callstack, interpreter ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object eval( Reader in, NameSpace nameSpace, String sourceFileInfo /*, CallStack callstack */ ) throws EvalError { Object retVal = null; if ( Interpreter.DEBUG ) debug("eval: nameSpace = "+nameSpace); /* Create non-interactive local interpreter for this namespace with source from the input stream and out/err same as this interpreter. */ Interpreter localInterpreter = new Interpreter( in, out, err, false, nameSpace, this, sourceFileInfo ); CallStack callstack = new CallStack( nameSpace ); boolean eof = false; while(!eof) { SimpleNode node = null; try { eof = localInterpreter.Line(); if (localInterpreter.get_jjtree().nodeArity() > 0) { node = (SimpleNode)localInterpreter.get_jjtree().rootNode(); // nodes remember from where they were sourced node.setSourceFile( sourceFileInfo ); if ( TRACE ) println( "// " +node.getText() ); retVal = node.eval( callstack, localInterpreter ); // sanity check during development if ( callstack.depth() > 1 ) throw new InterpreterError( "Callstack growing: "+callstack); if ( retVal instanceof ReturnControl ) { retVal = ((ReturnControl)retVal).value; break; // non-interactive, return control now } if ( localInterpreter.showResults && retVal != Primitive.VOID ) println("<" + retVal + ">"); } } catch(ParseException e) { /* throw new EvalError( "Sourced file: "+sourceFileInfo+" parser Error: " + e.getMessage( DEBUG ), node, callstack ); */ if ( DEBUG ) // show extra "expecting..." info error( e.getMessage(DEBUG) ); // add the source file info and throw again e.setErrorSourceFile( sourceFileInfo ); throw e; } catch ( InterpreterError e ) { e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" internal Error: " + e.getMessage(), node, callstack); } catch ( TargetError e ) { // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow("Sourced file: "+sourceFileInfo); } catch ( EvalError e) { if ( DEBUG) e.printStackTrace(); // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow( "Sourced file: "+sourceFileInfo ); } catch ( Exception e) { if ( DEBUG) e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" unknown error: " + e.getMessage(), node, callstack); } catch(TokenMgrError e) { throw new EvalError( "Sourced file: "+sourceFileInfo+" Token Parsing Error: " + e.getMessage(), node, callstack ); } finally { localInterpreter.get_jjtree().reset(); // reinit the callstack if ( callstack.depth() > 1 ) { callstack.clear(); callstack.push( nameSpace ); } } } return Primitive.unwrap( retVal ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public void unset( String name ) throws EvalError { /* We jump through some hoops here to handle arbitrary cases like unset("bsh.foo"); */ CallStack callstack = new CallStack(); try { LHS lhs = globalNameSpace.getNameResolver( name ).toLHS( callstack, this ); if ( lhs.type != LHS.VARIABLE ) throw new EvalError("Can't unset, not a variable: "+name, SimpleNode.JAVACODE, new CallStack() ); //lhs.assign( null, false ); lhs.nameSpace.unsetVariable( name ); } catch ( UtilEvalError e ) { throw new EvalError( e.getMessage(), SimpleNode.JAVACODE, new CallStack() ); } }
// in org/gjt/sp/jedit/bsh/BSHVariableDeclarator.java
public Object eval( BSHType typeNode, CallStack callstack, Interpreter interpreter) throws EvalError { // null value means no value Object value = null; if ( jjtGetNumChildren() > 0 ) { SimpleNode initializer = (SimpleNode)jjtGetChild(0); /* If we have type info and the child is an array initializer pass it along... Else use the default eval style. (This allows array initializer to handle the problem... allowing for future enhancements in loosening types there). */ if ( (typeNode != null) && initializer instanceof BSHArrayInitializer ) value = ((BSHArrayInitializer)initializer).eval( typeNode.getBaseType(), typeNode.getArrayDims(), callstack, interpreter); else value = initializer.eval( callstack, interpreter); } if ( value == Primitive.VOID ) throw new EvalError("Void initializer.", this, callstack ); return value; }
17
            
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch(ReflectError e) { throw new EvalError("reflection error: " + e, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch (ReflectError e) { throw new EvalError("No such property: " + value, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( ReflectError e ) { throw new EvalError( "Error invoking Java method: "+e, callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch( UtilEvalError e) { throw new EvalError( "Invalid argument: " + "`"+paramNames[i]+"'" + " for method: " + name + " : " + e.getMessage(), callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( Capabilities.Unavailable e ) { throw new EvalError( "Defining classes currently requires reflective Accessibility.", block, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( ClassNotFoundException e ) { throw new EvalError( e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHType.java
catch(Exception e) { throw new EvalError("Couldn't construct array type", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( ReflectError e) { throw new EvalError( "Constructor error: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( Exception e ) { if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); throw new EvalError( "Error constructing inner class instance: "+e, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch( Exception e ) { throw new EvalError("Can't construct primitive array: " + e.getMessage(), this, callstack); }
// in org/gjt/sp/jedit/bsh/BSHArrayDimensions.java
catch(Exception e) { throw new EvalError( "Array index: " + i + " does not evaluate to an integer", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( InterpreterError e ) { e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" internal Error: " + e.getMessage(), node, callstack); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e) { if ( DEBUG) e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" unknown error: " + e.getMessage(), node, callstack); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(TokenMgrError e) { throw new EvalError( "Sourced file: "+sourceFileInfo+" Token Parsing Error: " + e.getMessage(), node, callstack ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw new EvalError( e.getMessage(), SimpleNode.JAVACODE, new CallStack() ); }
96
            
// in org/gjt/sp/jedit/bsh/BSHUnaryExpression.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { SimpleNode node = (SimpleNode)jjtGetChild(0); // If this is a unary increment of decrement (either pre or postfix) // then we need an LHS to which to assign the result. Otherwise // just do the unary operation for the value. try { if ( kind == INCR || kind == DECR ) { LHS lhs = ((BSHPrimaryExpression)node).toLHS( callstack, interpreter ); return lhsUnaryOperation( lhs, interpreter.getStrictJava() ); } else return unaryOperation( node.eval(callstack, interpreter), kind ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
public Object doSuffix( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError { // Handle ".class" suffix operation // Prefix must be a BSHType if ( operation == CLASS ) if ( obj instanceof BSHType ) { if ( toLHS ) throw new EvalError("Can't assign .class", this, callstack ); NameSpace namespace = callstack.top(); return ((BSHType)obj).getType( callstack, interpreter ); } else throw new EvalError( "Attempt to use .class suffix on non class.", this, callstack ); /* Evaluate our prefix if it needs evaluating first. If this is the first evaluation our prefix mayb be a Node (directly from the PrimaryPrefix) - eval() it to an object. If it's an LHS, resolve to a value. Note: The ambiguous name construct is now necessary where the node may be an ambiguous name. If this becomes common we might want to make a static method nodeToObject() or something. The point is that we can't just eval() - we need to direct the evaluation to the context sensitive type of result; namely object, class, etc. */ if ( obj instanceof SimpleNode ) if ( obj instanceof BSHAmbiguousName ) obj = ((BSHAmbiguousName)obj).toObject(callstack, interpreter); else obj = ((SimpleNode)obj).eval(callstack, interpreter); else if ( obj instanceof LHS ) try { obj = ((LHS)obj).getValue(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } try { switch(operation) { case INDEX: return doIndex( obj, toLHS, callstack, interpreter ); case NAME: return doName( obj, toLHS, callstack, interpreter ); case PROPERTY: return doProperty( toLHS, obj, callstack, interpreter ); default: throw new InterpreterError( "Unknown suffix type" ); } } catch(ReflectError e) { throw new EvalError("reflection error: " + e, this, callstack ); } catch(InvocationTargetException e) { throw new TargetError( "target exception", e.getTargetException(), this, callstack, true); } }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
private Object doName( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError, ReflectError, InvocationTargetException { try { // .length on array if ( field.equals("length") && obj.getClass().isArray() ) if ( toLHS ) throw new EvalError( "Can't assign array length", this, callstack ); else return new Primitive(Array.getLength(obj)); // field access if ( jjtGetNumChildren() == 0 ) if ( toLHS ) return Reflect.getLHSObjectField(obj, field); else return Reflect.getObjectFieldValue( obj, field ); // Method invocation // (LHS or non LHS evaluation can both encounter method calls) Object[] oa = ((BSHArguments)jjtGetChild(0)).getArguments( callstack, interpreter); // TODO: // Note: this try/catch block is copied from BSHMethodInvocation // we need to factor out this common functionality and make sure // we handle all cases ... (e.g. property style access, etc.) // maybe move this to Reflect ? try { return Reflect.invokeObjectMethod( obj, field, oa, interpreter, callstack, this ); } catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); } catch ( InvocationTargetException e ) { String msg = "Method Invocation "+field; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); } } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
static int getIndexAux( Object obj, CallStack callstack, Interpreter interpreter, SimpleNode callerInfo ) throws EvalError { if ( !obj.getClass().isArray() ) throw new EvalError("Not an array", callerInfo, callstack ); int index; try { Object indexVal = ((SimpleNode)callerInfo.jjtGetChild(0)).eval( callstack, interpreter ); if ( !(indexVal instanceof Primitive) ) indexVal = Types.castObject( indexVal, Integer.TYPE, Types.ASSIGNMENT ); index = ((Primitive)indexVal).intValue(); } catch( UtilEvalError e ) { Interpreter.debug("doIndex: "+e); throw e.toEvalError( "Arrays may only be indexed by integer types.", callerInfo, callstack ); } return index; }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
private Object doIndex( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter ) throws EvalError, ReflectError { int index = getIndexAux( obj, callstack, interpreter, this ); if ( toLHS ) return new LHS(obj, index); else try { return Reflect.getIndex(obj, index); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
private Object doProperty( boolean toLHS, Object obj, CallStack callstack, Interpreter interpreter ) throws EvalError { if(obj == Primitive.VOID) throw new EvalError( "Attempt to access property on undefined variable or class name", this, callstack ); if ( obj instanceof Primitive ) throw new EvalError("Attempt to access property on a primitive", this, callstack ); Object value = ((SimpleNode)jjtGetChild(0)).eval( callstack, interpreter); if ( !( value instanceof String ) ) throw new EvalError( "Property expression must be a String or identifier.", this, callstack ); if ( toLHS ) return new LHS(obj, (String)value); // Property style access to Hashtable or Map CollectionManager cm = CollectionManager.getCollectionManager(); if ( cm.isMap( obj ) ) { Object val = cm.getFromMap( obj, value/*key*/ ); return ( val == null ? val = Primitive.NULL : val ); } try { return Reflect.getObjectProperty( obj, (String)value ); } catch ( UtilEvalError e) { throw e.toEvalError( "Property: "+value, this, callstack ); } catch (ReflectError e) { throw new EvalError("No such property: " + value, this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BshMethod.java
public Object invoke( Object[] argValues, Interpreter interpreter ) throws EvalError { return invoke( argValues, interpreter, null, null, false ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
public Object invoke( Object[] argValues, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo ) throws EvalError { return invoke( argValues, interpreter, callstack, callerInfo, false ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
Object invoke( Object[] argValues, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean overrideNameSpace ) throws EvalError { if ( argValues != null ) for (int i=0; i<argValues.length; i++) if ( argValues[i] == null ) throw new Error("HERE!"); if ( javaMethod != null ) try { return Reflect.invokeMethod( javaMethod, javaObject, argValues ); } catch ( ReflectError e ) { throw new EvalError( "Error invoking Java method: "+e, callerInfo, callstack ); } catch ( InvocationTargetException e2 ) { throw new TargetError( "Exception invoking imported object method.", e2, callerInfo, callstack, true/*isNative*/ ); } // is this a syncrhonized method? if ( modifiers != null && modifiers.hasModifier("synchronized") ) { // The lock is our declaring namespace's This reference // (the method's 'super'). Or in the case of a class it's the // class instance. Object lock; if ( declaringNameSpace.isClass ) { try { lock = declaringNameSpace.getClassInstance(); } catch ( UtilEvalError e ) { throw new InterpreterError( "Can't get class instance for synchronized method."); } } else lock = declaringNameSpace.getThis(interpreter); // ??? synchronized( lock ) { return invokeImpl( argValues, interpreter, callstack, callerInfo, overrideNameSpace ); } } else return invokeImpl( argValues, interpreter, callstack, callerInfo, overrideNameSpace ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
private Object invokeImpl( Object[] argValues, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean overrideNameSpace ) throws EvalError { Class returnType = getReturnType(); Class [] paramTypes = getParameterTypes(); // If null callstack if ( callstack == null ) callstack = new CallStack( declaringNameSpace ); if ( argValues == null ) argValues = new Object [] { }; // Cardinality (number of args) mismatch if ( argValues.length != numArgs ) { /* // look for help string try { // should check for null namespace here String help = (String)declaringNameSpace.get( "bsh.help."+name, interpreter ); interpreter.println(help); return Primitive.VOID; } catch ( Exception e ) { throw eval error } */ throw new EvalError( "Wrong number of arguments for local method: " + name, callerInfo, callstack ); } // Make the local namespace for the method invocation NameSpace localNameSpace; if ( overrideNameSpace ) localNameSpace = callstack.top(); else { localNameSpace = new NameSpace( declaringNameSpace, name ); localNameSpace.isMethod = true; } // should we do this for both cases above? localNameSpace.setNode( callerInfo ); // set the method parameters in the local namespace for(int i=0; i<numArgs; i++) { // Set typed variable if ( paramTypes[i] != null ) { try { argValues[i] = //Types.getAssignableForm( argValues[i], paramTypes[i] ); Types.castObject( argValues[i], paramTypes[i], Types.ASSIGNMENT ); } catch( UtilEvalError e) { throw new EvalError( "Invalid argument: " + "`"+paramNames[i]+"'" + " for method: " + name + " : " + e.getMessage(), callerInfo, callstack ); } try { localNameSpace.setTypedVariable( paramNames[i], paramTypes[i], argValues[i], null/*modifiers*/); } catch ( UtilEvalError e2 ) { throw e2.toEvalError( "Typed method parameter assignment", callerInfo, callstack ); } } // Set untyped variable else // untyped param { // getAssignable would catch this for typed param if ( argValues[i] == Primitive.VOID) throw new EvalError( "Undefined variable or class name, parameter: " + paramNames[i] + " to method: " + name, callerInfo, callstack ); else try { localNameSpace.setLocalVariable( paramNames[i], argValues[i], interpreter.getStrictJava() ); } catch ( UtilEvalError e3 ) { throw e3.toEvalError( callerInfo, callstack ); } } } // Push the new namespace on the call stack if ( !overrideNameSpace ) callstack.push( localNameSpace ); // Invoke the block, overriding namespace with localNameSpace Object ret = methodBody.eval( callstack, interpreter, true/*override*/ ); // save the callstack including the called method, just for error mess CallStack returnStack = callstack.copy(); // Get back to caller namespace if ( !overrideNameSpace ) callstack.pop(); ReturnControl retControl = null; if ( ret instanceof ReturnControl ) { retControl = (ReturnControl)ret; // Method body can only use 'return' statment type return control. if ( retControl.kind == retControl.RETURN ) ret = ((ReturnControl)ret).value; else // retControl.returnPoint is the Node of the return statement throw new EvalError("'continue' or 'break' in method body", retControl.returnPoint, returnStack ); // Check for explicit return of value from void method type. // retControl.returnPoint is the Node of the return statement if ( returnType == Void.TYPE && ret != Primitive.VOID ) throw new EvalError( "Cannot return value from void method", retControl.returnPoint, returnStack); } if ( returnType != null ) { // If return type void, return void as the value. if ( returnType == Void.TYPE ) return Primitive.VOID; // return type is a class try { ret = // Types.getAssignableForm( ret, (Class)returnType ); Types.castObject( ret, returnType, Types.ASSIGNMENT ); } catch( UtilEvalError e ) { // Point to return statement point if we had one. // (else it was implicit return? What's the case here?) SimpleNode node = callerInfo; if ( retControl != null ) node = retControl.returnPoint; throw e.toEvalError( "Incorrect type returned from method: " + name + e.getMessage(), node, callstack ); } } return ret; }
// in org/gjt/sp/jedit/bsh/This.java
public Object invokeMethod( String name, Object [] args ) throws EvalError { // null callstack, one will be created for us return invokeMethod( name, args, null/*declaringInterpreter*/, null, null, false/*declaredOnly*/ ); }
// in org/gjt/sp/jedit/bsh/This.java
public Object invokeMethod( String methodName, Object [] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean declaredOnly ) throws EvalError { /* Wrap nulls. This is a bit of a cludge to address a deficiency in the class generator whereby it does not wrap nulls on method delegate. See Class Generator.java. If we fix that then we can remove this. (just have to generate the code there.) */ if ( args != null ) { Object [] oa = new Object [args.length]; for(int i=0; i<args.length; i++) oa[i] = ( args[i] == null ? Primitive.NULL : args[i] ); args = oa; } if ( interpreter == null ) interpreter = declaringInterpreter; if ( callstack == null ) callstack = new CallStack( namespace ); if ( callerInfo == null ) callerInfo = SimpleNode.JAVACODE; // Find the bsh method Class [] types = Types.getTypes( args ); BshMethod bshMethod = null; try { bshMethod = namespace.getMethod( methodName, types, declaredOnly ); } catch ( UtilEvalError e ) { // leave null } if ( bshMethod != null ) return bshMethod.invoke( args, interpreter, callstack, callerInfo ); /* No scripted method of that name. Implement the required part of the Object protocol: public int hashCode(); public boolean equals(java.lang.Object); public java.lang.String toString(); if these were not handled by scripted methods we must provide a default impl. */ // a default toString() that shows the interfaces we implement if ( methodName.equals("toString" ) ) return toString(); // a default hashCode() if ( methodName.equals("hashCode" ) ) return new Integer(this.hashCode()); // a default equals() testing for equality with the This reference if ( methodName.equals("equals" ) ) { Object obj = args[0]; return new Boolean( this == obj ); } // Look for a default invoke() handler method in the namespace // Note: this code duplicates that in NameSpace getCommand() // is that ok? try { bshMethod = namespace.getMethod( "invoke", new Class [] { null, null } ); } catch ( UtilEvalError e ) { /*leave null*/ } // Call script "invoke( String methodName, Object [] args ); if ( bshMethod != null ) return bshMethod.invoke( new Object [] { methodName, args }, interpreter, callstack, callerInfo ); throw new EvalError("Method " + StringUtil.methodString( methodName, types ) + " not found in bsh scripted object: "+ namespace.getName(), callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHArguments.java
public Object[] getArguments( CallStack callstack, Interpreter interpreter) throws EvalError { // evaluate each child Object[] args = new Object[jjtGetNumChildren()]; for(int i = 0; i < args.length; i++) { args[i] = ((SimpleNode)jjtGetChild(i)).eval(callstack, interpreter); if ( args[i] == Primitive.VOID ) throw new EvalError( "Undefined argument: " + ((SimpleNode)jjtGetChild(i)).getText(), this, callstack ); } return args; }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
public Class generateClass( String name, Modifiers modifiers, Class [] interfaces, Class superClass, BSHBlock block, boolean isInterface, CallStack callstack, Interpreter interpreter ) throws EvalError { // Delegate to the static method return generateClassImpl( name, modifiers, interfaces, superClass, block, isInterface, callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
public static Class generateClassImpl( String name, Modifiers modifiers, Class [] interfaces, Class superClass, BSHBlock block, boolean isInterface, CallStack callstack, Interpreter interpreter ) throws EvalError { // Scripting classes currently requires accessibility // This can be eliminated with a bit more work. try { Capabilities.setAccessibility( true ); } catch ( Capabilities.Unavailable e ) { throw new EvalError( "Defining classes currently requires reflective Accessibility.", block, callstack ); } NameSpace enclosingNameSpace = callstack.top(); String packageName = enclosingNameSpace.getPackage(); String className = enclosingNameSpace.isClass ? ( enclosingNameSpace.getName()+"$"+name ) : name; String fqClassName = packageName == null ? className : packageName + "." + className; BshClassManager bcm = interpreter.getClassManager(); // Race condition here... bcm.definingClass( fqClassName ); // Create the class static namespace NameSpace classStaticNameSpace = new NameSpace( enclosingNameSpace, className); classStaticNameSpace.isClass = true; callstack.push( classStaticNameSpace ); // Evaluate any inner class class definitions in the block // effectively recursively call this method for contained classes first block.evalBlock( callstack, interpreter, true/*override*/, ClassNodeFilter.CLASSCLASSES ); // Generate the type for our class Variable [] variables = getDeclaredVariables( block, callstack, interpreter, packageName ); DelayedEvalBshMethod [] methods = getDeclaredMethods( block, callstack, interpreter, packageName ); ClassGeneratorUtil classGenerator = new ClassGeneratorUtil( modifiers, className, packageName, superClass, interfaces, variables, methods, classStaticNameSpace, isInterface ); byte [] code = classGenerator.generateClass(); // if debug, write out the class file to debugClasses directory String dir = System.getProperty("debugClasses"); if ( dir != null ) try { FileOutputStream out= new FileOutputStream( dir+"/"+className+".class" ); out.write(code); out.close(); } catch ( IOException e ) { } // Define the new class in the classloader Class genClass = bcm.defineClass( fqClassName, code ); // import the unq name into parent enclosingNameSpace.importClass( fqClassName.replace('$','.') ); try { classStaticNameSpace.setLocalVariable( ClassGeneratorUtil.BSHINIT, block, false/*strictJava*/ ); } catch ( UtilEvalError e ) { throw new InterpreterError("unable to init static: "+e ); } // Give the static space its class static import // important to do this after all classes are defined classStaticNameSpace.setClassStatic( genClass ); // evaluate the static portion of the block in the static space block.evalBlock( callstack, interpreter, true/*override*/, ClassNodeFilter.CLASSSTATIC ); callstack.pop(); if ( !genClass.isInterface() ) { // Set the static bsh This callback String bshStaticFieldName = ClassGeneratorUtil.BSHSTATIC+className; try { LHS lhs = Reflect.getLHSStaticField( genClass, bshStaticFieldName ); lhs.assign( classStaticNameSpace.getThis( interpreter ), false/*strict*/ ); } catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); } } bcm.doneDefiningClass( fqClassName ); return genClass; }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
static DelayedEvalBshMethod [] getDeclaredMethods( BSHBlock body, CallStack callstack, Interpreter interpreter, String defaultPackage ) throws EvalError { List methods = new ArrayList(); for( int child=0; child<body.jjtGetNumChildren(); child++ ) { SimpleNode node = (SimpleNode)body.jjtGetChild(child); if ( node instanceof BSHMethodDeclaration ) { BSHMethodDeclaration md = (BSHMethodDeclaration)node; md.insureNodesParsed(); Modifiers modifiers = md.modifiers; String name = md.name; String returnType = md.getReturnTypeDescriptor( callstack, interpreter, defaultPackage ); BSHReturnType returnTypeNode = md.getReturnTypeNode(); BSHFormalParameters paramTypesNode = md.paramsNode; String [] paramTypes = paramTypesNode.getTypeDescriptors( callstack, interpreter, defaultPackage ); DelayedEvalBshMethod bm = new DelayedEvalBshMethod( name, returnType, returnTypeNode, md.paramsNode.getParamNames(), paramTypes, paramTypesNode, md.blockNode, null/*declaringNameSpace*/, modifiers, callstack, interpreter ); methods.add( bm ); } } return (DelayedEvalBshMethod [])methods.toArray( new DelayedEvalBshMethod[0] ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object invokeObjectMethod( Object object, String methodName, Object[] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo ) throws ReflectError, EvalError, InvocationTargetException { // Bsh scripted object if ( object instanceof This && !This.isExposedThisMethod(methodName) ) return ((This)object).invokeMethod( methodName, args, interpreter, callstack, callerInfo, false/*delcaredOnly*/ ); // Plain Java object, find the java method try { BshClassManager bcm = interpreter == null ? null : interpreter.getClassManager(); Class clas = object.getClass(); Method method = resolveExpectedJavaMethod( bcm, clas, object, methodName, args, false ); return invokeMethod( method, object, args ); } catch ( UtilEvalError e ) { throw e.toEvalError( callerInfo, callstack ); } }
// in org/gjt/sp/jedit/bsh/SimpleNode.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { throw new InterpreterError( "Unimplemented or inappropriate for " + getClass().getName() ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
public Object toObject( CallStack callstack, Interpreter interpreter ) throws EvalError { return toObject( callstack, interpreter, false ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
Object toObject( CallStack callstack, Interpreter interpreter, boolean forceClass ) throws EvalError { try { return getName( callstack.top() ).toObject( callstack, interpreter, forceClass ); } catch ( UtilEvalError e ) { //e.printStackTrace(); throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
public Class toClass( CallStack callstack, Interpreter interpreter ) throws EvalError { try { return getName( callstack.top() ).toClass(); } catch ( ClassNotFoundException e ) { throw new EvalError( e.getMessage(), this, callstack ); } catch ( UtilEvalError e2 ) { // ClassPathException is a type of UtilEvalError throw e2.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
public LHS toLHS( CallStack callstack, Interpreter interpreter) throws EvalError { try { return getName( callstack.top() ).toLHS( callstack, interpreter ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { throw new InterpreterError( "Don't know how to eval an ambiguous name!" +" Use toObject() if you want an object." ); }
// in org/gjt/sp/jedit/bsh/XThis.java
public Object invokeImpl( Object proxy, Method method, Object[] args ) throws EvalError { String methodName = method.getName(); CallStack callstack = new CallStack( namespace ); /* If equals() is not explicitly defined we must override the default implemented by the This object protocol for scripted object. To support XThis equals() must test for equality with the generated proxy object, not the scripted bsh This object; otherwise callers from outside in Java will not see a the proxy object as equal to itself. */ BshMethod equalsMethod = null; try { equalsMethod = namespace.getMethod( "equals", new Class [] { Object.class } ); } catch ( UtilEvalError e ) {/*leave null*/ } if ( methodName.equals("equals" ) && equalsMethod == null ) { Object obj = args[0]; return new Boolean( proxy == obj ); } /* If toString() is not explicitly defined override the default to show the proxy interfaces. */ BshMethod toStringMethod = null; try { toStringMethod = namespace.getMethod( "toString", new Class [] { } ); } catch ( UtilEvalError e ) {/*leave null*/ } if ( methodName.equals("toString" ) && toStringMethod == null) { Class [] ints = proxy.getClass().getInterfaces(); // XThis.this refers to the enclosing class instance StringBuilder sb = new StringBuilder( XThis.this.toString() + "\nimplements:" ); for(int i=0; i<ints.length; i++) sb.append( " "+ ints[i].getName() + ((ints.length > 1)?",":"") ); return sb.toString(); } Class [] paramTypes = method.getParameterTypes(); return Primitive.unwrap( invokeMethod( methodName, Primitive.wrap(args, paramTypes) ) ); }
// in org/gjt/sp/jedit/bsh/BSHCastExpression.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { NameSpace namespace = callstack.top(); Class toType = ((BSHType)jjtGetChild(0)).getType( callstack, interpreter ); SimpleNode expression = (SimpleNode)jjtGetChild(1); // evaluate the expression Object fromValue = expression.eval(callstack, interpreter); Class fromType = fromValue.getClass(); // TODO: need to add isJavaCastable() test for strictJava // (as opposed to isJavaAssignable()) try { return Types.castObject( fromValue, toType, Types.CAST ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHPrimaryExpression.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { return eval( false, callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/BSHPrimaryExpression.java
public LHS toLHS( CallStack callstack, Interpreter interpreter) throws EvalError { Object obj = eval( true, callstack, interpreter ); if ( ! (obj instanceof LHS) ) throw new EvalError("Can't assign to:", this, callstack ); else return (LHS)obj; }
// in org/gjt/sp/jedit/bsh/BSHPrimaryExpression.java
private Object eval( boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError { Object obj = jjtGetChild(0); int numChildren = jjtGetNumChildren(); for(int i=1; i<numChildren; i++) obj = ((BSHPrimarySuffix)jjtGetChild(i)).doSuffix( obj, toLHS, callstack, interpreter); /* If the result is a Node eval() it to an object or LHS (as determined by toLHS) */ if ( obj instanceof SimpleNode ) if ( obj instanceof BSHAmbiguousName ) if ( toLHS ) obj = ((BSHAmbiguousName)obj).toLHS( callstack, interpreter); else obj = ((BSHAmbiguousName)obj).toObject( callstack, interpreter); else // Some arbitrary kind of node if ( toLHS ) // is this right? throw new EvalError("Can't assign to prefix.", this, callstack ); else obj = ((SimpleNode)obj).eval(callstack, interpreter); // return LHS or value object as determined by toLHS if ( obj instanceof LHS ) if ( toLHS ) return obj; else try { return ((LHS)obj).getValue(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } else return obj; }
// in org/gjt/sp/jedit/bsh/BSHLiteral.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { if ( value == null ) throw new InterpreterError("Null in bsh literal: "+value); return value; }
// in org/gjt/sp/jedit/bsh/BSHTypedVariableDeclaration.java
Class evalType( CallStack callstack, Interpreter interpreter ) throws EvalError { BSHType typeNode = getTypeNode(); return typeNode.getType( callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/BSHTypedVariableDeclaration.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { try { NameSpace namespace = callstack.top(); BSHType typeNode = getTypeNode(); Class type = typeNode.getType( callstack, interpreter ); BSHVariableDeclarator [] bvda = getDeclarators(); for (int i = 0; i < bvda.length; i++) { BSHVariableDeclarator dec = bvda[i]; // Type node is passed down the chain for array initializers // which need it under some circumstances Object value = dec.eval( typeNode, callstack, interpreter); try { namespace.setTypedVariable( dec.name, type, value, modifiers ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } } } catch ( EvalError e ) { e.reThrow( "Typed variable declaration" ); } return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHWhileStatement.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { int numChild = jjtGetNumChildren(); // Order of body and condition is swapped for do / while SimpleNode condExp, body = null; if ( isDoStatement ) { condExp = (SimpleNode)jjtGetChild(1); body =(SimpleNode)jjtGetChild(0); } else { condExp = (SimpleNode)jjtGetChild(0); if ( numChild > 1 ) // has body, else just for side effects body =(SimpleNode)jjtGetChild(1); } boolean doOnceFlag = isDoStatement; while( doOnceFlag || BSHIfStatement.evaluateCondition(condExp, callstack, interpreter ) ) { if ( body == null ) // no body? continue; Object ret = body.eval(callstack, interpreter); boolean breakout = false; if(ret instanceof ReturnControl) { switch(((ReturnControl)ret).kind ) { case RETURN: return ret; case CONTINUE: continue; case BREAK: breakout = true; break; } } if(breakout) break; doOnceFlag = false; } return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHType.java
public Class getType( CallStack callstack, Interpreter interpreter ) throws EvalError { // return cached type if available if ( type != null ) return type; // first node will either be PrimitiveType or AmbiguousName SimpleNode node = getTypeNode(); if ( node instanceof BSHPrimitiveType ) baseType = ((BSHPrimitiveType)node).getType(); else baseType = ((BSHAmbiguousName)node).toClass( callstack, interpreter ); if ( arrayDims > 0 ) { try { // Get the type by constructing a prototype array with // arbitrary (zero) length in each dimension. int[] dims = new int[arrayDims]; // int array default zeros Object obj = Array.newInstance(baseType, dims); type = obj.getClass(); } catch(Exception e) { throw new EvalError("Couldn't construct array type", this, callstack ); } } else type = baseType; // hack... sticking to first interpreter that resolves this // see comments on type instance variable interpreter.getClassManager().addListener(this); return type; }
// in org/gjt/sp/jedit/bsh/BSHForStatement.java
public Object eval(CallStack callstack , Interpreter interpreter) throws EvalError { int i = 0; if(hasForInit) forInit = ((SimpleNode)jjtGetChild(i++)); if(hasExpression) expression = ((SimpleNode)jjtGetChild(i++)); if(hasForUpdate) forUpdate = ((SimpleNode)jjtGetChild(i++)); if(i < jjtGetNumChildren()) // should normally be statement = ((SimpleNode)jjtGetChild(i)); NameSpace enclosingNameSpace= callstack.top(); BlockNameSpace forNameSpace = new BlockNameSpace( enclosingNameSpace ); /* Note: some interesting things are going on here. 1) We swap instead of push... The primary mode of operation acts like we are in the enclosing namespace... (super must be preserved, etc.) 2) We do *not* call the body block eval with the namespace override. Instead we allow it to create a second subordinate BlockNameSpace child of the forNameSpace. Variable propogation still works through the chain, but the block's child cleans the state between iteration. (which is correct Java behavior... see forscope4.bsh) */ // put forNameSpace it on the top of the stack // Note: it's important that there is only one exit point from this // method so that we can swap back the namespace. callstack.swap( forNameSpace ); // Do the for init if ( hasForInit ) forInit.eval( callstack, interpreter ); Object returnControl = Primitive.VOID; while(true) { if ( hasExpression ) { boolean cond = BSHIfStatement.evaluateCondition( expression, callstack, interpreter ); if ( !cond ) break; } boolean breakout = false; // switch eats a multi-level break here? if ( statement != null ) // not empty statement { // do *not* invoke special override for block... (see above) Object ret = statement.eval( callstack, interpreter ); if (ret instanceof ReturnControl) { switch(((ReturnControl)ret).kind) { case RETURN: returnControl = ret; breakout = true; break; case CONTINUE: break; case BREAK: breakout = true; break; } } } if ( breakout ) break; if ( hasForUpdate ) forUpdate.eval( callstack, interpreter ); } callstack.swap( enclosingNameSpace ); // put it back return returnControl; }
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { BSHBlock tryBlock = ((BSHBlock)jjtGetChild(0)); Vector catchParams = new Vector(); Vector catchBlocks = new Vector(); int nchild = jjtGetNumChildren(); Node node = null; int i=1; while((i < nchild) && ((node = jjtGetChild(i++)) instanceof BSHFormalParameter)) { catchParams.addElement(node); catchBlocks.addElement(jjtGetChild(i++)); node = null; } // finaly block BSHBlock finallyBlock = null; if(node != null) finallyBlock = (BSHBlock)node; // Why both of these? TargetError target = null; Throwable thrown = null; Object ret = null; /* Evaluate the contents of the try { } block and catch any resulting TargetErrors generated by the script. We save the callstack depth and if an exception is thrown we pop back to that depth before contiuing. The exception short circuited any intervening method context pops. Note: we the stack info... what do we do with it? append to exception message? */ int callstackDepth = callstack.depth(); try { ret = tryBlock.eval(callstack, interpreter); } catch( TargetError e ) { target = e; String stackInfo = "Bsh Stack: "; while ( callstack.depth() > callstackDepth ) stackInfo += "\t" + callstack.pop() +"\n"; } // unwrap the target error if ( target != null ) thrown = target.getTarget(); // If we have an exception, find a catch if (thrown != null) { int n = catchParams.size(); for(i=0; i<n; i++) { // Get catch block BSHFormalParameter fp = (BSHFormalParameter)catchParams.elementAt(i); // Should cache this subject to classloader change message // Evaluation of the formal parameter simply resolves its // type via the specified namespace.. it doesn't modify the // namespace. fp.eval( callstack, interpreter ); if ( fp.type == null && interpreter.getStrictJava() ) throw new EvalError( "(Strict Java) Untyped catch block", this, callstack ); // If the param is typed check assignability if ( fp.type != null ) try { thrown = (Throwable)Types.castObject( thrown/*rsh*/, fp.type/*lhsType*/, Types.ASSIGNMENT ); } catch( UtilEvalError e ) { /* Catch the mismatch and continue to try the next Note: this is innefficient, should have an isAssignableFrom() that doesn't throw // TODO: we do now have a way to test assignment // in castObject(), use it? */ continue; } // Found match, execute catch block BSHBlock cb = (BSHBlock)(catchBlocks.elementAt(i)); // Prepare to execute the block. // We must create a new BlockNameSpace to hold the catch // parameter and swap it on the stack after initializing it. NameSpace enclosingNameSpace = callstack.top(); BlockNameSpace cbNameSpace = new BlockNameSpace( enclosingNameSpace ); try { if ( fp.type == BSHFormalParameter.UNTYPED ) // set an untyped variable directly in the block cbNameSpace.setBlockVariable( fp.name, thrown ); else { // set a typed variable (directly in the block) Modifiers modifiers = new Modifiers(); cbNameSpace.setTypedVariable( fp.name, fp.type, thrown, new Modifiers()/*none*/ ); } } catch ( UtilEvalError e ) { throw new InterpreterError( "Unable to set var in catch block namespace." ); } // put cbNameSpace on the top of the stack callstack.swap( cbNameSpace ); try { ret = cb.eval( callstack, interpreter ); } finally { // put it back callstack.swap( enclosingNameSpace ); } target = null; // handled target break; } } // evaluate finally block if(finallyBlock != null) ret = finallyBlock.eval(callstack, interpreter); // exception fell through, throw it upward... if(target != null) throw target; if(ret instanceof ReturnControl) return ret; else return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { // type is either a class name or a primitive type SimpleNode type = (SimpleNode)jjtGetChild(0); // args is either constructor arguments or array dimensions SimpleNode args = (SimpleNode)jjtGetChild(1); if ( type instanceof BSHAmbiguousName ) { BSHAmbiguousName name = (BSHAmbiguousName)type; if (args instanceof BSHArguments) return objectAllocation(name, (BSHArguments)args, callstack, interpreter ); else return objectArrayAllocation(name, (BSHArrayDimensions)args, callstack, interpreter ); } else return primitiveArrayAllocation((BSHPrimitiveType)type, (BSHArrayDimensions)args, callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object objectAllocation( BSHAmbiguousName nameNode, BSHArguments argumentsNode, CallStack callstack, Interpreter interpreter ) throws EvalError { NameSpace namespace = callstack.top(); Object[] args = argumentsNode.getArguments( callstack, interpreter ); if ( args == null) throw new EvalError( "Null args in new.", this, callstack ); // Look for scripted class object Object obj = nameNode.toObject( callstack, interpreter, false/* force class*/ ); // Try regular class obj = nameNode.toObject( callstack, interpreter, true/*force class*/ ); Class type = null; if ( obj instanceof ClassIdentifier ) type = ((ClassIdentifier)obj).getTargetClass(); else throw new EvalError( "Unknown class: "+nameNode.text, this, callstack ); // Is an inner class style object allocation boolean hasBody = jjtGetNumChildren() > 2; if ( hasBody ) { BSHBlock body = (BSHBlock)jjtGetChild(2); if ( type.isInterface() ) return constructWithInterfaceBody( type, args, body, callstack, interpreter ); else return constructWithClassBody( type, args, body, callstack, interpreter ); } else return constructObject( type, args, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object constructObject( Class type, Object[] args, CallStack callstack ) throws EvalError { Object obj; try { obj = Reflect.constructObject( type, args ); } catch ( ReflectError e) { throw new EvalError( "Constructor error: " + e.getMessage(), this, callstack ); } catch(InvocationTargetException e) { // No need to wrap this debug Interpreter.debug("The constructor threw an exception:\n\t" + e.getTargetException()); throw new TargetError( "Object constructor", e.getTargetException(), this, callstack, true); } String className = type.getName(); // Is it an inner class? if ( className.indexOf("$") == -1 ) return obj; // Temporary hack to support inner classes // If the obj is a non-static inner class then import the context... // This is not a sufficient emulation of inner classes. // Replace this later... // work through to class 'this' This ths = callstack.top().getThis( null ); NameSpace instanceNameSpace = Name.getClassNameSpace( ths.getNameSpace() ); // Change the parent (which was the class static) to the class instance // We really need to check if we're a static inner class here first... // but for some reason Java won't show the static modifier on our // fake inner classes... could generate a flag field. if ( instanceNameSpace != null && className.startsWith( instanceNameSpace.getName() +"$") ) { try { ClassGenerator.getClassGenerator().setInstanceNameSpaceParent( obj, className, instanceNameSpace ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } } return obj; }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object constructWithClassBody( Class type, Object[] args, BSHBlock block, CallStack callstack, Interpreter interpreter ) throws EvalError { String name = callstack.top().getName() + "$" + (++innerClassCount); Modifiers modifiers = new Modifiers(); modifiers.addModifier( Modifiers.CLASS, "public" ); Class clas; try { clas = ClassGenerator.getClassGenerator() .generateClass( name, modifiers, null/*interfaces*/, type/*superClass*/, block, false/*isInterface*/, callstack, interpreter ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } try { return Reflect.constructObject( clas, args ); } catch ( Exception e ) { if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); throw new EvalError( "Error constructing inner class instance: "+e, this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object constructWithInterfaceBody( Class type, Object[] args, BSHBlock body, CallStack callstack, Interpreter interpreter ) throws EvalError { NameSpace namespace = callstack.top(); NameSpace local = new NameSpace(namespace, "AnonymousBlock"); callstack.push(local); body.eval( callstack, interpreter, true/*overrideNamespace*/ ); callstack.pop(); // statical import fields from the interface so that code inside // can refer to the fields directly (e.g. HEIGHT) local.importStatic( type ); try { return local.getThis(interpreter).getInterface( type ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object objectArrayAllocation( BSHAmbiguousName nameNode, BSHArrayDimensions dimensionsNode, CallStack callstack, Interpreter interpreter ) throws EvalError { NameSpace namespace = callstack.top(); Class type = nameNode.toClass( callstack, interpreter ); if ( type == null ) throw new EvalError( "Class " + nameNode.getName(namespace) + " not found.", this, callstack ); return arrayAllocation( dimensionsNode, type, callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object primitiveArrayAllocation( BSHPrimitiveType typeNode, BSHArrayDimensions dimensionsNode, CallStack callstack, Interpreter interpreter ) throws EvalError { Class type = typeNode.getType(); return arrayAllocation( dimensionsNode, type, callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object arrayAllocation( BSHArrayDimensions dimensionsNode, Class type, CallStack callstack, Interpreter interpreter ) throws EvalError { /* dimensionsNode can return either a fully intialized array or VOID. when VOID the prescribed array dimensions (defined and undefined) are contained in the node. */ Object result = dimensionsNode.eval( type, callstack, interpreter ); if ( result != Primitive.VOID ) return result; else return arrayNewInstance( type, dimensionsNode, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object arrayNewInstance( Class type, BSHArrayDimensions dimensionsNode, CallStack callstack ) throws EvalError { if ( dimensionsNode.numUndefinedDims > 0 ) { Object proto = Array.newInstance( type, new int [dimensionsNode.numUndefinedDims] ); // zeros type = proto.getClass(); } try { return Array.newInstance( type, dimensionsNode.definedDimensions); } catch( NegativeArraySizeException e1 ) { throw new TargetError( e1, this, callstack ); } catch( Exception e ) { throw new EvalError("Can't construct primitive array: " + e.getMessage(), this, callstack); } }
// in org/gjt/sp/jedit/bsh/Name.java
public Object invokeMethod( Interpreter interpreter, Object[] args, CallStack callstack, SimpleNode callerInfo ) throws UtilEvalError, EvalError, ReflectError, InvocationTargetException { String methodName = Name.suffix(value, 1); BshClassManager bcm = interpreter.getClassManager(); NameSpace namespace = callstack.top(); // Optimization - If classOfStaticMethod is set then we have already // been here and determined that this is a static method invocation. // Note: maybe factor this out with path below... clean up. if ( classOfStaticMethod != null ) { return Reflect.invokeStaticMethod( bcm, classOfStaticMethod, methodName, args ); } if ( !Name.isCompound(value) ) return invokeLocalMethod( interpreter, args, callstack, callerInfo ); // Note: if we want methods declared inside blocks to be accessible via // this.methodname() inside the block we could handle it here as a // special case. See also resolveThisFieldReference() special handling // for BlockNameSpace case. They currently work via the direct name // e.g. methodName(). String prefix = Name.prefix(value); // Superclass method invocation? (e.g. super.foo()) if ( prefix.equals("super") && Name.countParts(value) == 2 ) { // Allow getThis() to work through block namespaces first This ths = namespace.getThis( interpreter ); NameSpace thisNameSpace = ths.getNameSpace(); NameSpace classNameSpace = getClassNameSpace( thisNameSpace ); if ( classNameSpace != null ) { Object instance = classNameSpace.getClassInstance(); return ClassGenerator.getClassGenerator() .invokeSuperclassMethod( bcm, instance, methodName, args ); } } // Find target object or class identifier Name targetName = namespace.getNameResolver( prefix ); Object obj = targetName.toObject( callstack, interpreter ); if ( obj == Primitive.VOID ) throw new UtilEvalError( "Attempt to resolve method: "+methodName +"() on undefined variable or class name: "+targetName); // if we've got an object, resolve the method if ( !(obj instanceof ClassIdentifier) ) { if (obj instanceof Primitive) { if (obj == Primitive.NULL) throw new UtilTargetError( new NullPointerException( "Null Pointer in Method Invocation" ) ); // some other primitive // should avoid calling methods on primitive, as we do // in Name (can't treat primitive like an object message) // but the hole is useful right now. if ( Interpreter.DEBUG ) interpreter.debug( "Attempt to access method on primitive..." + " allowing bsh.Primitive to peek through for debugging"); } // found an object and it's not an undefined variable return Reflect.invokeObjectMethod( obj, methodName, args, interpreter, callstack, callerInfo ); } // It's a class // try static method if ( Interpreter.DEBUG ) Interpreter.debug("invokeMethod: trying static - " + targetName); Class clas = ((ClassIdentifier)obj).getTargetClass(); // cache the fact that this is a static method invocation on this class classOfStaticMethod = clas; if ( clas != null ) return Reflect.invokeStaticMethod( bcm, clas, methodName, args ); // return null; ??? throw new UtilEvalError("invokeMethod: unknown target: " + targetName); }
// in org/gjt/sp/jedit/bsh/Name.java
private Object invokeLocalMethod( Interpreter interpreter, Object[] args, CallStack callstack, SimpleNode callerInfo ) throws EvalError/*, ReflectError, InvocationTargetException*/ { if ( Interpreter.DEBUG ) Interpreter.debug( "invokeLocalMethod: " + value ); if ( interpreter == null ) throw new InterpreterError( "invokeLocalMethod: interpreter = null"); String commandName = value; Class [] argTypes = Types.getTypes( args ); // Check for existing method BshMethod meth = null; try { meth = namespace.getMethod( commandName, argTypes ); } catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); } // If defined, invoke it if ( meth != null ) return meth.invoke( args, interpreter, callstack, callerInfo ); BshClassManager bcm = interpreter.getClassManager(); // Look for a BeanShell command Object commandObject; try { commandObject = namespace.getCommand( commandName, argTypes, interpreter ); } catch ( UtilEvalError e ) { throw e.toEvalError("Error loading command: ", callerInfo, callstack ); } // should try to print usage here if nothing found if ( commandObject == null ) { // Look for a default invoke() handler method in the namespace // Note: this code duplicates that in This.java... should it? // Call on 'This' can never be a command BshMethod invokeMethod = null; try { invokeMethod = namespace.getMethod( "invoke", new Class [] { null, null } ); } catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); } if ( invokeMethod != null ) return invokeMethod.invoke( new Object [] { commandName, args }, interpreter, callstack, callerInfo ); throw new EvalError( "Command not found: " +StringUtil.methodString( commandName, argTypes ), callerInfo, callstack ); } if ( commandObject instanceof BshMethod ) return ((BshMethod)commandObject).invoke( args, interpreter, callstack, callerInfo ); if ( commandObject instanceof Class ) try { return Reflect.invokeCompiledCommand( ((Class)commandObject), args, interpreter, callstack ); } catch ( UtilEvalError e ) { throw e.toEvalError("Error invoking compiled command: ", callerInfo, callstack ); } throw new InterpreterError("invalid command type"); }
// in org/gjt/sp/jedit/bsh/BSHPackageDeclaration.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { BSHAmbiguousName name = (BSHAmbiguousName)jjtGetChild(0); NameSpace namespace = callstack.top(); namespace.setPackage( name.text ); // import the package we're in by default... namespace.importPackage( name.text ); return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHThrowStatement.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { Object obj = ((SimpleNode)jjtGetChild(0)).eval(callstack, interpreter); // need to loosen this to any throwable... do we need to handle // that in interpreter somewhere? check first... if(!(obj instanceof Exception)) throw new EvalError("Expression in 'throw' must be Exception type", this, callstack ); // wrap the exception in a TargetException to propogate it up throw new TargetError( (Exception)obj, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHBinaryExpression.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { Object lhs = ((SimpleNode)jjtGetChild(0)).eval(callstack, interpreter); /* Doing instanceof? Next node is a type. */ if (kind == INSTANCEOF) { // null object ref is not instance of any type if ( lhs == Primitive.NULL ) return new Primitive(false); Class rhs = ((BSHType)jjtGetChild(1)).getType( callstack, interpreter ); /* // primitive (number or void) cannot be tested for instanceof if (lhs instanceof Primitive) throw new EvalError("Cannot be instance of primitive type." ); */ /* Primitive (number or void) is not normally an instanceof anything. But for internal use we'll test true for the bsh.Primitive class. i.e. (5 instanceof bsh.Primitive) will be true */ if ( lhs instanceof Primitive ) if ( rhs == org.gjt.sp.jedit.bsh.Primitive.class ) return new Primitive(true); else return new Primitive(false); // General case - performe the instanceof based on assignability boolean ret = Types.isJavaBaseAssignable( rhs, lhs.getClass() ); return new Primitive(ret); } // The following two boolean checks were tacked on. // This could probably be smoothed out. /* Look ahead and short circuit evaluation of the rhs if: we're a boolean AND and the lhs is false. */ if ( kind == BOOL_AND || kind == BOOL_ANDX ) { Object obj = lhs; if ( isPrimitiveValue(lhs) ) obj = ((Primitive)lhs).getValue(); if ( obj instanceof Boolean && ( ((Boolean)obj).booleanValue() == false ) ) return new Primitive(false); } /* Look ahead and short circuit evaluation of the rhs if: we're a boolean AND and the lhs is false. */ if ( kind == BOOL_OR || kind == BOOL_ORX ) { Object obj = lhs; if ( isPrimitiveValue(lhs) ) obj = ((Primitive)lhs).getValue(); if ( obj instanceof Boolean && ( ((Boolean)obj).booleanValue() == true ) ) return new Primitive(true); } // end stuff that was tacked on for boolean short-circuiting. /* Are both the lhs and rhs either wrappers or primitive values? do binary op */ boolean isLhsWrapper = isWrapper( lhs ); Object rhs = ((SimpleNode)jjtGetChild(1)).eval(callstack, interpreter); boolean isRhsWrapper = isWrapper( rhs ); if ( ( isLhsWrapper || isPrimitiveValue( lhs ) ) && ( isRhsWrapper || isPrimitiveValue( rhs ) ) ) { // Special case for EQ on two wrapper objects if ( (isLhsWrapper && isRhsWrapper && kind == EQ)) { /* Don't auto-unwrap wrappers (preserve identity semantics) FALL THROUGH TO OBJECT OPERATIONS BELOW. */ } else try { return Primitive.binaryOperation(lhs, rhs, kind); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } } /* Doing the following makes it hard to use untyped vars... e.g. if ( arg == null ) ...what if arg is a primitive? The answer is that we should test only if the var is typed...? need to get that info here... else { // Do we have a mixture of primitive values and non-primitives ? // (primitiveValue = not null, not void) int primCount = 0; if ( isPrimitiveValue( lhs ) ) ++primCount; if ( isPrimitiveValue( rhs ) ) ++primCount; if ( primCount > 1 ) // both primitive types, should have been handled above throw new InterpreterError("should not be here"); else if ( primCount == 1 ) // mixture of one and the other throw new EvalError("Operator: '" + tokenImage[kind] +"' inappropriate for object / primitive combination.", this, callstack ); // else fall through to handle both non-primitive types // end check for primitive and non-primitive mix } */ /* Treat lhs and rhs as arbitrary objects and do the operation. (including NULL and VOID represented by their Primitive types) */ //System.out.println("binary op arbitrary obj: {"+lhs+"}, {"+rhs+"}"); switch(kind) { case EQ: return new Primitive((lhs == rhs)); case NE: return new Primitive((lhs != rhs)); case PLUS: if(lhs instanceof String || rhs instanceof String) return lhs.toString() + rhs.toString(); // FALL THROUGH TO DEFAULT CASE!!! default: if(lhs instanceof Primitive || rhs instanceof Primitive) if ( lhs == Primitive.VOID || rhs == Primitive.VOID ) throw new EvalError( "illegal use of undefined variable, class, or 'void' literal", this, callstack ); else if ( lhs == Primitive.NULL || rhs == Primitive.NULL ) throw new EvalError( "illegal use of null value or 'null' literal", this, callstack); throw new EvalError("Operator: '" + tokenImage[kind] + "' inappropriate for objects", this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHIfStatement.java
public Object eval(CallStack callstack, Interpreter interpreter) throws EvalError { Object ret = null; if( evaluateCondition( (SimpleNode)jjtGetChild(0), callstack, interpreter ) ) ret = ((SimpleNode)jjtGetChild(1)).eval(callstack, interpreter); else if(jjtGetNumChildren() > 2) ret = ((SimpleNode)jjtGetChild(2)).eval(callstack, interpreter); if(ret instanceof ReturnControl) return ret; else return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHIfStatement.java
public static boolean evaluateCondition( SimpleNode condExp, CallStack callstack, Interpreter interpreter) throws EvalError { Object obj = condExp.eval(callstack, interpreter); if(obj instanceof Primitive) { if ( obj == Primitive.VOID ) throw new EvalError("Condition evaluates to void type", condExp, callstack ); obj = ((Primitive)obj).getValue(); } if(obj instanceof Boolean) return ((Boolean)obj).booleanValue(); else throw new EvalError( "Condition must evaluate to a Boolean or boolean.", condExp, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHSwitchStatement.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { int numchild = jjtGetNumChildren(); int child = 0; SimpleNode switchExp = ((SimpleNode)jjtGetChild(child++)); Object switchVal = switchExp.eval( callstack, interpreter ); /* Note: this could be made clearer by adding an inner class for the cases and an object context for the child traversal. */ // first label BSHSwitchLabel label; Object node; ReturnControl returnControl=null; // get the first label if ( child >= numchild ) throw new EvalError("Empty switch statement.", this, callstack ); label = ((BSHSwitchLabel)jjtGetChild(child++)); // while more labels or blocks and haven't hit return control while ( child < numchild && returnControl == null ) { // if label is default or equals switchVal if ( label.isDefault || primitiveEquals( switchVal, label.eval( callstack, interpreter ), callstack, switchExp ) ) { // execute nodes, skipping labels, until a break or return while ( child < numchild ) { node = jjtGetChild(child++); if ( node instanceof BSHSwitchLabel ) continue; // eval it Object value = ((SimpleNode)node).eval( callstack, interpreter ); // should check to disallow continue here? if ( value instanceof ReturnControl ) { returnControl = (ReturnControl)value; break; } } } else { // skip nodes until next label while ( child < numchild ) { node = jjtGetChild(child++); if ( node instanceof BSHSwitchLabel ) { label = (BSHSwitchLabel)node; break; } } } } if ( returnControl != null && returnControl.kind == RETURN ) return returnControl; else return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHSwitchStatement.java
private boolean primitiveEquals( Object switchVal, Object targetVal, CallStack callstack, SimpleNode switchExp ) throws EvalError { if ( switchVal instanceof Primitive || targetVal instanceof Primitive ) try { // binaryOperation can return Primitive or wrapper type Object result = Primitive.binaryOperation( switchVal, targetVal, ParserConstants.EQ ); result = Primitive.unwrap( result ); return result.equals( Boolean.TRUE ); } catch ( UtilEvalError e ) { throw e.toEvalError( "Switch value: "+switchExp.getText()+": ", this, callstack ); } else return switchVal.equals( targetVal ); }
// in org/gjt/sp/jedit/bsh/BSHBlock.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { return eval( callstack, interpreter, false ); }
// in org/gjt/sp/jedit/bsh/BSHBlock.java
public Object eval( CallStack callstack, Interpreter interpreter, boolean overrideNamespace ) throws EvalError { Object syncValue = null; if ( isSynchronized ) { // First node is the expression on which to sync SimpleNode exp = ((SimpleNode)jjtGetChild(0)); syncValue = exp.eval(callstack, interpreter); } Object ret; if ( isSynchronized ) // Do the actual synchronization synchronized( syncValue ) { ret = evalBlock( callstack, interpreter, overrideNamespace, null/*filter*/); } else ret = evalBlock( callstack, interpreter, overrideNamespace, null/*filter*/ ); return ret; }
// in org/gjt/sp/jedit/bsh/BSHBlock.java
Object evalBlock( CallStack callstack, Interpreter interpreter, boolean overrideNamespace, NodeFilter nodeFilter ) throws EvalError { Object ret = Primitive.VOID; NameSpace enclosingNameSpace = null; if ( !overrideNamespace ) { enclosingNameSpace= callstack.top(); BlockNameSpace bodyNameSpace = new BlockNameSpace( enclosingNameSpace ); callstack.swap( bodyNameSpace ); } int startChild = isSynchronized ? 1 : 0; int numChildren = jjtGetNumChildren(); try { /* Evaluate block in two passes: First do class declarations then do everything else. */ for(int i=startChild; i<numChildren; i++) { SimpleNode node = ((SimpleNode)jjtGetChild(i)); if ( nodeFilter != null && !nodeFilter.isVisible( node ) ) continue; if ( node instanceof BSHClassDeclaration ) node.eval( callstack, interpreter ); } for(int i=startChild; i<numChildren; i++) { SimpleNode node = ((SimpleNode)jjtGetChild(i)); if ( node instanceof BSHClassDeclaration ) continue; // filter nodes if ( nodeFilter != null && !nodeFilter.isVisible( node ) ) continue; ret = node.eval( callstack, interpreter ); // statement or embedded block evaluated a return statement if ( ret instanceof ReturnControl ) break; } } finally { // make sure we put the namespace back when we leave. if ( !overrideNamespace ) callstack.swap( enclosingNameSpace ); } return ret; }
// in org/gjt/sp/jedit/bsh/BSHImportDeclaration.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { NameSpace namespace = callstack.top(); if ( superImport ) try { namespace.doSuperImport(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } else { if ( staticImport ) { if ( importPackage ) { Class clas = ((BSHAmbiguousName)jjtGetChild(0)).toClass( callstack, interpreter ); namespace.importStatic( clas ); } else throw new EvalError( "static field imports not supported yet", this, callstack ); } else { String name = ((BSHAmbiguousName)jjtGetChild(0)).text; if ( importPackage ) namespace.importPackage(name); else namespace.importClass(name); } } return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public Object invokeMethod( String methodName, Object [] args, Interpreter interpreter ) throws EvalError { return invokeMethod( methodName, args, interpreter, null, null ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public Object invokeMethod( String methodName, Object [] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo ) throws EvalError { return getThis( interpreter ).invokeMethod( methodName, args, interpreter, callstack, callerInfo, false/*declaredOnly*/ ); }
// in org/gjt/sp/jedit/bsh/BSHReturnStatement.java
public Object eval(CallStack callstack, Interpreter interpreter) throws EvalError { Object value; if(jjtGetNumChildren() > 0) value = ((SimpleNode)jjtGetChild(0)).eval(callstack, interpreter); else value = Primitive.VOID; return new ReturnControl( kind, value, this ); }
// in org/gjt/sp/jedit/bsh/EvalError.java
public void reThrow( String msg ) throws EvalError { prependMessage( msg ); throw this; }
// in org/gjt/sp/jedit/bsh/BSHTernaryExpression.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { SimpleNode cond = (SimpleNode)jjtGetChild(0), evalTrue = (SimpleNode)jjtGetChild(1), evalFalse = (SimpleNode)jjtGetChild(2); if ( BSHIfStatement.evaluateCondition( cond, callstack, interpreter ) ) return evalTrue.eval( callstack, interpreter ); else return evalFalse.eval( callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/BSHArrayDimensions.java
public Object eval( Class type, CallStack callstack, Interpreter interpreter ) throws EvalError { if ( Interpreter.DEBUG ) Interpreter.debug("array base type = "+type); baseType = type; return eval( callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/BSHArrayDimensions.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { SimpleNode child = (SimpleNode)jjtGetChild(0); /* Child is array initializer. Evaluate it and fill in the dimensions it returns. Initialized arrays are always fully defined (no undefined dimensions to worry about). The syntax uses the undefinedDimension count. e.g. int [][] { 1, 2 }; */ if (child instanceof BSHArrayInitializer) { if ( baseType == null ) throw new EvalError( "Internal Array Eval err: unknown base type", this, callstack ); Object initValue = ((BSHArrayInitializer)child).eval( baseType, numUndefinedDims, callstack, interpreter); Class arrayClass = initValue.getClass(); int actualDimensions = Reflect.getArrayDimensions(arrayClass); definedDimensions = new int[ actualDimensions ]; // Compare with number of dimensions actually created with the // number specified (syntax uses the undefined ones here) if ( definedDimensions.length != numUndefinedDims ) throw new EvalError( "Incompatible initializer. Allocation calls for a " + numUndefinedDims+ " dimensional array, but initializer is a " + actualDimensions + " dimensional array", this, callstack ); // fill in definedDimensions [] lengths Object arraySlice = initValue; for ( int i = 0; i < definedDimensions.length; i++ ) { definedDimensions[i] = Array.getLength( arraySlice ); if ( definedDimensions[i] > 0 ) arraySlice = Array.get(arraySlice, 0); } return initValue; } else // Evaluate the defined dimensions of the array { definedDimensions = new int[ numDefinedDims ]; for(int i = 0; i < numDefinedDims; i++) { try { Object length = ((SimpleNode)jjtGetChild(i)).eval( callstack, interpreter); definedDimensions[i] = ((Primitive)length).intValue(); } catch(Exception e) { throw new EvalError( "Array index: " + i + " does not evaluate to an integer", this, callstack ); } } } return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHMethodDeclaration.java
Class evalReturnType( CallStack callstack, Interpreter interpreter ) throws EvalError { insureNodesParsed(); if ( returnTypeNode != null ) return returnTypeNode.evalReturnType( callstack, interpreter ); else return null; }
// in org/gjt/sp/jedit/bsh/BSHMethodDeclaration.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { returnType = evalReturnType( callstack, interpreter ); evalNodes( callstack, interpreter ); // Install an *instance* of this method in the namespace. // See notes in BshMethod // This is not good... // need a way to update eval without re-installing... // so that we can re-eval params, etc. when classloader changes // look into this NameSpace namespace = callstack.top(); BshMethod bshMethod = new BshMethod( this, namespace, modifiers ); try { namespace.setMethod( name, bshMethod ); } catch ( UtilEvalError e ) { throw e.toEvalError(this,callstack); } return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/BSHMethodDeclaration.java
private void evalNodes( CallStack callstack, Interpreter interpreter ) throws EvalError { insureNodesParsed(); // validate that the throws names are class names for(int i=firstThrowsClause; i<numThrows+firstThrowsClause; i++) ((BSHAmbiguousName)jjtGetChild(i)).toClass( callstack, interpreter ); paramsNode.eval( callstack, interpreter ); // if strictJava mode, check for loose parameters and return type if ( interpreter.getStrictJava() ) { for(int i=0; i<paramsNode.paramTypes.length; i++) if ( paramsNode.paramTypes[i] == null ) // Warning: Null callstack here. Don't think we need // a stack trace to indicate how we sourced the method. throw new EvalError( "(Strict Java Mode) Undeclared argument type, parameter: " + paramsNode.getParamNames()[i] + " in method: " + name, this, null ); if ( returnType == null ) // Warning: Null callstack here. Don't think we need // a stack trace to indicate how we sourced the method. throw new EvalError( "(Strict Java Mode) Undeclared return type for method: " + name, this, null ); } }
// in org/gjt/sp/jedit/bsh/BSHFormalParameters.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { if ( paramTypes != null ) return paramTypes; insureParsed(); Class [] paramTypes = new Class[numArgs]; for(int i=0; i<numArgs; i++) { BSHFormalParameter param = (BSHFormalParameter)jjtGetChild(i); paramTypes[i] = (Class)param.eval( callstack, interpreter ); } this.paramTypes = paramTypes; return paramTypes; }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { NameSpace namespace = callstack.top(); BSHAmbiguousName nameNode = getNameNode(); // Do not evaluate methods this() or super() in class instance space // (i.e. inside a constructor) if ( namespace.getParent() != null && namespace.getParent().isClass && ( nameNode.text.equals("super") || nameNode.text.equals("this") ) ) return Primitive.VOID; Name name = nameNode.getName(namespace); Object[] args = getArgsNode().getArguments(callstack, interpreter); // This try/catch block is replicated is BSHPrimarySuffix... need to // factor out common functionality... // Move to Reflect? try { return name.invokeMethod( interpreter, args, callstack, this); } catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); } catch ( InvocationTargetException e ) { String msg = "Method Invocation "+name; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHEnhancedForStatement.java
public Object eval( CallStack callstack , Interpreter interpreter ) throws EvalError { Class elementType = null; SimpleNode expression, statement=null; NameSpace enclosingNameSpace = callstack.top(); SimpleNode firstNode =((SimpleNode)jjtGetChild(0)); int nodeCount = jjtGetNumChildren(); if ( firstNode instanceof BSHType ) { elementType=((BSHType)firstNode).getType( callstack, interpreter ); expression=((SimpleNode)jjtGetChild(1)); if ( nodeCount>2 ) statement=((SimpleNode)jjtGetChild(2)); } else { expression=firstNode; if ( nodeCount>1 ) statement=((SimpleNode)jjtGetChild(1)); } BlockNameSpace eachNameSpace = new BlockNameSpace( enclosingNameSpace ); callstack.swap( eachNameSpace ); final Object iteratee = expression.eval( callstack, interpreter ); if ( iteratee == Primitive.NULL ) throw new EvalError("The collection, array, map, iterator, or " + "enumeration portion of a for statement cannot be null.", this, callstack ); CollectionManager cm = CollectionManager.getCollectionManager(); if ( !cm.isBshIterable( iteratee ) ) throw new EvalError("Can't iterate over type: " +iteratee.getClass(), this, callstack ); BshIterator iterator = cm.getBshIterator( iteratee ); Object returnControl = Primitive.VOID; while( iterator.hasNext() ) { try { if ( elementType != null ) eachNameSpace.setTypedVariable( varName/*name*/, elementType/*type*/, iterator.next()/*value*/, new Modifiers()/*none*/ ); else eachNameSpace.setVariable( varName, iterator.next(), false ); } catch ( UtilEvalError e ) { throw e.toEvalError( "for loop iterator variable:"+ varName, this, callstack ); } boolean breakout = false; // switch eats a multi-level break here? if ( statement != null ) // not empty statement { Object ret = statement.eval( callstack, interpreter ); if (ret instanceof ReturnControl) { switch(((ReturnControl)ret).kind) { case RETURN: returnControl = ret; breakout = true; break; case CONTINUE: break; case BREAK: breakout = true; break; } } } if (breakout) break; } callstack.swap(enclosingNameSpace); return returnControl; }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { BSHPrimaryExpression lhsNode = (BSHPrimaryExpression)jjtGetChild(0); if ( lhsNode == null ) throw new InterpreterError( "Error, null LHSnode" ); boolean strictJava = interpreter.getStrictJava(); LHS lhs = lhsNode.toLHS( callstack, interpreter); if ( lhs == null ) throw new InterpreterError( "Error, null LHS" ); // For operator-assign operations save the lhs value before evaluating // the rhs. This is correct Java behavior for postfix operations // e.g. i=1; i+=i++; // should be 2 not 3 Object lhsValue = null; if ( operator != ASSIGN ) // assign doesn't need the pre-value try { lhsValue = lhs.getValue(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } SimpleNode rhsNode = (SimpleNode)jjtGetChild(1); Object rhs; // implement "blocks" foo = { }; // if ( rhsNode instanceof BSHBlock ) // rsh = // else rhs = rhsNode.eval(callstack, interpreter); if ( rhs == Primitive.VOID ) throw new EvalError("Void assignment.", this, callstack ); try { switch(operator) { case ASSIGN: return lhs.assign( rhs, strictJava ); case PLUSASSIGN: return lhs.assign( operation(lhsValue, rhs, PLUS), strictJava ); case MINUSASSIGN: return lhs.assign( operation(lhsValue, rhs, MINUS), strictJava ); case STARASSIGN: return lhs.assign( operation(lhsValue, rhs, STAR), strictJava ); case SLASHASSIGN: return lhs.assign( operation(lhsValue, rhs, SLASH), strictJava ); case ANDASSIGN: case ANDASSIGNX: return lhs.assign( operation(lhsValue, rhs, BIT_AND), strictJava ); case ORASSIGN: case ORASSIGNX: return lhs.assign( operation(lhsValue, rhs, BIT_OR), strictJava ); case XORASSIGN: return lhs.assign( operation(lhsValue, rhs, XOR), strictJava ); case MODASSIGN: return lhs.assign( operation(lhsValue, rhs, MOD), strictJava ); case LSHIFTASSIGN: case LSHIFTASSIGNX: return lhs.assign( operation(lhsValue, rhs, LSHIFT), strictJava ); case RSIGNEDSHIFTASSIGN: case RSIGNEDSHIFTASSIGNX: return lhs.assign( operation(lhsValue, rhs, RSIGNEDSHIFT ), strictJava ); case RUNSIGNEDSHIFTASSIGN: case RUNSIGNEDSHIFTASSIGNX: return lhs.assign( operation(lhsValue, rhs, RUNSIGNEDSHIFT), strictJava ); default: throw new InterpreterError( "unimplemented operator in assignment BSH"); } } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHSwitchLabel.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { if ( isDefault ) return null; // should probably error SimpleNode label = ((SimpleNode)jjtGetChild(0)); return label.eval( callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { throw new EvalError( "Array initializer has no base type.", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
public Object eval( Class baseType, int dimensions, CallStack callstack, Interpreter interpreter ) throws EvalError { int numInitializers = jjtGetNumChildren(); // allocate the array to store the initializers int [] dima = new int [dimensions]; // description of the array // The other dimensions default to zero and are assigned when // the values are set. dima[0] = numInitializers; Object initializers = Array.newInstance( baseType, dima ); // Evaluate the initializers for (int i = 0; i < numInitializers; i++) { SimpleNode node = (SimpleNode)jjtGetChild(i); Object currentInitializer; if ( node instanceof BSHArrayInitializer ) { if ( dimensions < 2 ) throw new EvalError( "Invalid Location for Intializer, position: "+i, this, callstack ); currentInitializer = ((BSHArrayInitializer)node).eval( baseType, dimensions-1, callstack, interpreter); } else currentInitializer = node.eval( callstack, interpreter); if ( currentInitializer == Primitive.VOID ) throw new EvalError( "Void in array initializer, position"+i, this, callstack ); // Determine if any conversion is necessary on the initializers. // // Quick test to see if conversions apply: // If the dimensionality of the array is 1 then the elements of // the initializer can be primitives or boxable types. If it is // greater then the values must be array (object) types and there // are currently no conversions that we do on those. // If we have conversions on those in the future then we need to // get the real base type here instead of the dimensionless one. Object value = currentInitializer; if ( dimensions == 1 ) { // We do a bsh cast here. strictJava should be able to affect // the cast there when we tighten control try { value = Types.castObject( currentInitializer, baseType, Types.CAST ); } catch ( UtilEvalError e ) { throw e.toEvalError( "Error in array initializer", this, callstack ); } // unwrap any primitive, map voids to null, etc. value = Primitive.unwrap( value ); } // store the value in the array try { Array.set(initializers, i, value); } catch( IllegalArgumentException e ) { Interpreter.debug("illegal arg"+e); throwTypeError( baseType, currentInitializer, i, callstack ); } catch( ArrayStoreException e ) { // I think this can happen Interpreter.debug("arraystore"+e); throwTypeError( baseType, currentInitializer, i, callstack ); } } return initializers; }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
private void throwTypeError( Class baseType, Object initializer, int argNum, CallStack callstack ) throws EvalError { String rhsType; if (initializer instanceof Primitive) rhsType = ((Primitive)initializer).getType().getName(); else rhsType = Reflect.normalizeClassName( initializer.getClass()); throw new EvalError ( "Incompatible type: " + rhsType +" in initializer of array type: "+ baseType +" at position: "+argNum, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHClassDeclaration.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { int child = 0; // resolve superclass if any Class superClass = null; if ( extend ) { BSHAmbiguousName superNode = (BSHAmbiguousName)jjtGetChild(child++); superClass = superNode.toClass( callstack, interpreter ); } // Get interfaces Class [] interfaces = new Class[numInterfaces]; for( int i=0; i<numInterfaces; i++) { BSHAmbiguousName node = (BSHAmbiguousName)jjtGetChild(child++); interfaces[i] = node.toClass(callstack, interpreter); if ( !interfaces[i].isInterface() ) throw new EvalError( "Type: "+node.text+" is not an interface!", this, callstack ); } BSHBlock block; // Get the class body BSHBlock if ( child < jjtGetNumChildren() ) block = (BSHBlock)jjtGetChild(child); else block = new BSHBlock( ParserTreeConstants.JJTBLOCK ); try { return ClassGenerator.getClassGenerator().generateClass( name, modifiers, interfaces, superClass, block, isInterface, callstack, interpreter ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHFormalParameter.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { if ( jjtGetNumChildren() > 0 ) type = ((BSHType)jjtGetChild(0)).getType( callstack, interpreter ); else type = UNTYPED; return type; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object source( String filename, NameSpace nameSpace ) throws FileNotFoundException, IOException, EvalError { File file = pathToFile( filename ); if ( Interpreter.DEBUG ) debug("Sourcing file: "+file); Reader sourceIn = new BufferedReader( new FileReader(file) ); try { return eval( sourceIn, nameSpace, filename ); } finally { sourceIn.close(); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object source( String filename ) throws FileNotFoundException, IOException, EvalError { return source( filename, globalNameSpace ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object eval( Reader in, NameSpace nameSpace, String sourceFileInfo /*, CallStack callstack */ ) throws EvalError { Object retVal = null; if ( Interpreter.DEBUG ) debug("eval: nameSpace = "+nameSpace); /* Create non-interactive local interpreter for this namespace with source from the input stream and out/err same as this interpreter. */ Interpreter localInterpreter = new Interpreter( in, out, err, false, nameSpace, this, sourceFileInfo ); CallStack callstack = new CallStack( nameSpace ); boolean eof = false; while(!eof) { SimpleNode node = null; try { eof = localInterpreter.Line(); if (localInterpreter.get_jjtree().nodeArity() > 0) { node = (SimpleNode)localInterpreter.get_jjtree().rootNode(); // nodes remember from where they were sourced node.setSourceFile( sourceFileInfo ); if ( TRACE ) println( "// " +node.getText() ); retVal = node.eval( callstack, localInterpreter ); // sanity check during development if ( callstack.depth() > 1 ) throw new InterpreterError( "Callstack growing: "+callstack); if ( retVal instanceof ReturnControl ) { retVal = ((ReturnControl)retVal).value; break; // non-interactive, return control now } if ( localInterpreter.showResults && retVal != Primitive.VOID ) println("<" + retVal + ">"); } } catch(ParseException e) { /* throw new EvalError( "Sourced file: "+sourceFileInfo+" parser Error: " + e.getMessage( DEBUG ), node, callstack ); */ if ( DEBUG ) // show extra "expecting..." info error( e.getMessage(DEBUG) ); // add the source file info and throw again e.setErrorSourceFile( sourceFileInfo ); throw e; } catch ( InterpreterError e ) { e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" internal Error: " + e.getMessage(), node, callstack); } catch ( TargetError e ) { // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow("Sourced file: "+sourceFileInfo); } catch ( EvalError e) { if ( DEBUG) e.printStackTrace(); // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow( "Sourced file: "+sourceFileInfo ); } catch ( Exception e) { if ( DEBUG) e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" unknown error: " + e.getMessage(), node, callstack); } catch(TokenMgrError e) { throw new EvalError( "Sourced file: "+sourceFileInfo+" Token Parsing Error: " + e.getMessage(), node, callstack ); } finally { localInterpreter.get_jjtree().reset(); // reinit the callstack if ( callstack.depth() > 1 ) { callstack.clear(); callstack.push( nameSpace ); } } } return Primitive.unwrap( retVal ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object eval( Reader in ) throws EvalError { return eval( in, globalNameSpace, "eval stream" ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object eval( String statements ) throws EvalError { if ( Interpreter.DEBUG ) debug("eval(String): "+statements); return eval(statements, globalNameSpace); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object eval( String statements, NameSpace nameSpace ) throws EvalError { String s = ( statements.endsWith(";") ? statements : statements+";" ); return eval( new StringReader(s), nameSpace, "inline evaluation of: ``"+ showEvalString(s)+"''" ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object get( String name ) throws EvalError { try { Object ret = globalNameSpace.get( name, this ); return Primitive.unwrap( ret ); } catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() ); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public void set( String name, Object value ) throws EvalError { // map null to Primtive.NULL coming in... if ( value == null ) value = Primitive.NULL; CallStack callstack = new CallStack(); try { if ( Name.isCompound( name ) ) { LHS lhs = globalNameSpace.getNameResolver( name ).toLHS( callstack, this ); lhs.assign( value, false ); } else // optimization for common case globalNameSpace.setVariable( name, value, false ); } catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, callstack ); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public void set(String name, long value) throws EvalError { set(name, new Primitive(value)); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public void set(String name, int value) throws EvalError { set(name, new Primitive(value)); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public void set(String name, double value) throws EvalError { set(name, new Primitive(value)); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public void set(String name, float value) throws EvalError { set(name, new Primitive(value)); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public void set(String name, boolean value) throws EvalError { set(name, new Primitive(value)); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public void unset( String name ) throws EvalError { /* We jump through some hoops here to handle arbitrary cases like unset("bsh.foo"); */ CallStack callstack = new CallStack(); try { LHS lhs = globalNameSpace.getNameResolver( name ).toLHS( callstack, this ); if ( lhs.type != LHS.VARIABLE ) throw new EvalError("Can't unset, not a variable: "+name, SimpleNode.JAVACODE, new CallStack() ); //lhs.assign( null, false ); lhs.nameSpace.unsetVariable( name ); } catch ( UtilEvalError e ) { throw new EvalError( e.getMessage(), SimpleNode.JAVACODE, new CallStack() ); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object getInterface( Class interf ) throws EvalError { try { return globalNameSpace.getThis( this ).getInterface( interf ); } catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() ); } }
// in org/gjt/sp/jedit/bsh/BSHVariableDeclarator.java
public Object eval( BSHType typeNode, CallStack callstack, Interpreter interpreter) throws EvalError { // null value means no value Object value = null; if ( jjtGetNumChildren() > 0 ) { SimpleNode initializer = (SimpleNode)jjtGetChild(0); /* If we have type info and the child is an array initializer pass it along... Else use the default eval style. (This allows array initializer to handle the problem... allowing for future enhancements in loosening types there). */ if ( (typeNode != null) && initializer instanceof BSHArrayInitializer ) value = ((BSHArrayInitializer)initializer).eval( typeNode.getBaseType(), typeNode.getArrayDims(), callstack, interpreter); else value = initializer.eval( callstack, interpreter); } if ( value == Primitive.VOID ) throw new EvalError("Void initializer.", this, callstack ); return value; }
// in org/gjt/sp/jedit/bsh/BSHReturnType.java
public Class evalReturnType( CallStack callstack, Interpreter interpreter ) throws EvalError { if ( isVoid ) return Void.TYPE; else return getTypeNode().getType( callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/BSHStatementExpressionList.java
public Object eval(CallStack callstack, Interpreter interpreter) throws EvalError { int n = jjtGetNumChildren(); for(int i=0; i<n; i++) { SimpleNode node = ((SimpleNode)jjtGetChild(i)); node.eval(callstack, interpreter); } return Primitive.VOID; }
20
            
// in org/gjt/sp/jedit/bsh/This.java
catch( EvalError e ) { declaringInterpreter.error( "Exception in runnable:" + e ); }
// in org/gjt/sp/jedit/bsh/XThis.java
catch ( EvalError ee ) { // Ease debugging... // XThis.this refers to the enclosing class instance if ( Interpreter.DEBUG ) Interpreter.debug( "EvalError in scripted interface: " + XThis.this.toString() + ": "+ ee ); throw ee; }
// in org/gjt/sp/jedit/bsh/BSHTypedVariableDeclaration.java
catch ( EvalError e ) { e.reThrow( "Typed variable declaration" ); }
// in org/gjt/sp/jedit/bsh/BSHType.java
catch ( EvalError e ) { //throw new InterpreterError("unable to resolve type: "+e); // ignore and try default package //System.out.println("BSHType: "+node+" class not found"); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( EvalError e ) { throw new InterpreterError( "Error evaluating constructor args: "+e ); }
// in org/gjt/sp/jedit/bsh/TargetError.java
catch ( EvalError e ) { throw new InterpreterError("xprintarget: "+e.toString() ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
catch ( EvalError e ) { /* Here we catch any EvalError from the interpreter because we are using it as a tool to load the command, not as part of the execution path. */ Interpreter.debug( e.toString() ); throw new UtilEvalError( "Error loading script: "+ e.getMessage()); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( EvalError e ) { // ignore System.err.println( e ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e ) { System.out.println("Evaluation Error: "+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e ) { println( "BeanShell "+VERSION+" - by Pat Niemeyer (pat@pat.net)"); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch (EvalError e) { if ( interactive ) error( "EvalError: "+e.toString() ); else error( "EvalError: "+e.getMessage() ); if(DEBUG) e.printStackTrace(); if(!interactive) eof = true; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e) { if ( DEBUG) e.printStackTrace(); // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow( "Sourced file: "+sourceFileInfo ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e ) { throw new InterpreterError("set: "+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e ) { throw new InterpreterError("set: "+e); }
// in org/gjt/sp/jedit/bsh/JThis.java
catch(EvalError e) { declaringInterpreter.error( "local event hander method invocation error:" + e ); }
// in org/gjt/sp/jedit/bsh/JThis.java
catch(EvalError e) { declaringInterpreter.error( "local event hander method invocation error:" + e ); }
// in org/gjt/sp/jedit/bsh/JThis.java
catch(EvalError e) { declaringInterpreter.error( "local event handler imageUpdate: method invocation error:" + e ); }
// in org/gjt/sp/jedit/bsh/DelayedEvalBshMethod.java
catch ( EvalError e ) { throw new InterpreterError("can't eval return type: "+e); }
// in org/gjt/sp/jedit/bsh/DelayedEvalBshMethod.java
catch ( EvalError e ) { throw new InterpreterError("can't eval param types: "+e); }
// in org/gjt/sp/jedit/BeanShell.java
catch(EvalError e) { // do nothing }
8
            
// in org/gjt/sp/jedit/bsh/XThis.java
catch ( EvalError ee ) { // Ease debugging... // XThis.this refers to the enclosing class instance if ( Interpreter.DEBUG ) Interpreter.debug( "EvalError in scripted interface: " + XThis.this.toString() + ": "+ ee ); throw ee; }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( EvalError e ) { throw new InterpreterError( "Error evaluating constructor args: "+e ); }
// in org/gjt/sp/jedit/bsh/TargetError.java
catch ( EvalError e ) { throw new InterpreterError("xprintarget: "+e.toString() ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
catch ( EvalError e ) { /* Here we catch any EvalError from the interpreter because we are using it as a tool to load the command, not as part of the execution path. */ Interpreter.debug( e.toString() ); throw new UtilEvalError( "Error loading script: "+ e.getMessage()); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e ) { throw new InterpreterError("set: "+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e ) { throw new InterpreterError("set: "+e); }
// in org/gjt/sp/jedit/bsh/DelayedEvalBshMethod.java
catch ( EvalError e ) { throw new InterpreterError("can't eval return type: "+e); }
// in org/gjt/sp/jedit/bsh/DelayedEvalBshMethod.java
catch ( EvalError e ) { throw new InterpreterError("can't eval param types: "+e); }
6
checked (Lib) Exception 1
            
// in org/gjt/sp/jedit/jEdit.java
public static void main(String[] args) { StringList slargs = new StringList(args); //{{{ Check for Java 1.6 or later String javaVersion = System.getProperty("java.version"); if(javaVersion.compareTo("1.6") < 0) { System.err.println("You are running Java version " + javaVersion + '.'); System.err.println("jEdit requires Java 1.6 or later."); System.exit(1); } //}}} startupDone.add(false); // later on we need to know if certain code is called from // the main thread mainThread = Thread.currentThread(); settingsDirectory = MiscUtilities.constructPath( System.getProperty("user.home"), ".jedit"); // On mac, different rules (should) apply if(OperatingSystem.isMacOS()) settingsDirectory = MiscUtilities.constructPath( System.getProperty("user.home"), "Library/jEdit" ); else if (OperatingSystem.isWindows()) { String appData = System.getenv("APPDATA"); if (appData != null) settingsDirectory = MiscUtilities.constructPath( appData, "jEdit"); } // MacOS users expect the app to keep running after all windows // are closed background = OperatingSystem.isMacOS(); //{{{ Parse command line boolean endOpts = false; int level = Log.WARNING; String portFile = "server"; boolean restore = true; boolean newView = true; boolean newPlainView = false; boolean gui = true; // open initial view? boolean loadPlugins = true; boolean runStartupScripts = true; boolean quit = false; boolean wait = false; boolean shouldRelocateSettings = true; String userDir = System.getProperty("user.dir"); boolean splash = true; // script to run String scriptFile = null; for(int i = 0; i < args.length; i++) { String arg = args[i]; if(arg == null) continue; else if(arg.length() == 0) args[i] = null; else if(arg.startsWith("-") && !endOpts) { if(arg.equals("--")) endOpts = true; else if(arg.equals("-usage")) { version(); System.err.println(); usage(); System.exit(1); } else if(arg.equals("-version")) { version(); System.exit(1); } else if(arg.startsWith("-log=")) { try { level = Integer.parseInt(arg.substring("-log=".length())); } catch(NumberFormatException nf) { System.err.println("Malformed option: " + arg); } } else if(arg.equals("-nosettings")) settingsDirectory = null; else if(arg.startsWith("-settings=")) { settingsDirectory = arg.substring(10); shouldRelocateSettings = false; } else if(arg.startsWith("-noserver")) portFile = null; else if(arg.equals("-server")) portFile = "server"; else if(arg.startsWith("-server=")) portFile = arg.substring(8); else if(arg.startsWith("-background")) background = true; else if(arg.startsWith("-nobackground")) background = false; else if(arg.equals("-gui")) gui = true; else if(arg.equals("-nogui")) gui = false; else if(arg.equals("-newview")) newView = true; else if(arg.equals("-newplainview")) newPlainView = true; else if(arg.equals("-reuseview")) newPlainView = newView = false; else if(arg.equals("-restore")) restore = true; else if(arg.equals("-norestore")) restore = false; else if(arg.equals("-plugins")) loadPlugins = true; else if(arg.equals("-noplugins")) loadPlugins = false; else if(arg.equals("-startupscripts")) runStartupScripts = true; else if(arg.equals("-nostartupscripts")) runStartupScripts = false; else if(arg.startsWith("-run=")) scriptFile = arg.substring(5); else if(arg.equals("-wait")) wait = true; else if(arg.equals("-quit")) quit = true; else if(arg.equals("-nosplash")) splash = false; else { System.err.println("Unknown option: " + arg); usage(); System.exit(1); } args[i] = null; } } //}}} JTrayIconManager.setTrayIconArgs(restore, userDir, args); //{{{ We need these initializations very early on if(settingsDirectory != null) { settingsDirectory = MiscUtilities.resolveSymlinks( settingsDirectory); } if(settingsDirectory != null && portFile != null) portFile = MiscUtilities.constructPath(settingsDirectory,portFile); else portFile = null; Log.init(true,level); Log.log(Log.MESSAGE,jEdit.class, "starting with command line arguments: " + slargs.join(" ")); //}}} //{{{ Try connecting to another running jEdit instance if(portFile != null && new File(portFile).exists()) { try { BufferedReader in = new BufferedReader(new FileReader(portFile)); String check = in.readLine(); if(!"b".equals(check)) throw new Exception("Wrong port file format"); int port = Integer.parseInt(in.readLine()); int key = Integer.parseInt(in.readLine()); Socket socket = new Socket(InetAddress.getByName("127.0.0.1"),port); DataOutputStream out = new DataOutputStream( socket.getOutputStream()); out.writeInt(key); String script; if(quit) { script = "socket.close();\n" + "jEdit.exit(null,true);\n"; } else { script = makeServerScript(wait,restore, newView,newPlainView,args, scriptFile); } out.writeUTF(script); Log.log(Log.DEBUG,jEdit.class,"Waiting for server"); // block until its closed try { socket.getInputStream().read(); } catch(Exception e) { } in.close(); out.close(); System.exit(0); } catch(Exception e) { // ok, this one seems to confuse newbies // endlessly, so log it as NOTICE, not // ERROR Log.log(Log.NOTICE,jEdit.class,"An error occurred" + " while connecting to the jEdit server instance."); Log.log(Log.NOTICE,jEdit.class,"This probably means that" + " jEdit crashed and/or exited abnormally"); Log.log(Log.NOTICE,jEdit.class,"the last time it was run."); Log.log(Log.NOTICE,jEdit.class,"If you don't" + " know what this means, don't worry."); Log.log(Log.NOTICE,jEdit.class,e); } } if(quit) { // if no server running and user runs jedit -quit, // just exit System.exit(0); } //}}} // This must be done before anything graphical is displayed, so we can't even // wait for the settings to be loaded, because the splash screen will already // be visible if (OperatingSystem.isMacOS() && !new File(settingsDirectory, "noquartz").exists()) { System.setProperty("apple.awt.graphics.UseQuartz", "true"); } // don't show splash screen if there is a file named // 'nosplash' in the settings directory logTime("before splash screen activation"); if(splash && (!new File(settingsDirectory,"nosplash").exists())) GUIUtilities.showSplashScreen(); logTime("after splash screen activation"); //{{{ Settings migration code. // Windows check introduced in 5.0pre1. // MacOS check introduced in 4.3. if((OperatingSystem.isMacOS() || OperatingSystem.isWindows()) && shouldRelocateSettings && settingsDirectory != null) { relocateSettings(); } // }}} //{{{ Initialize settings directory Writer stream; if(settingsDirectory != null) { File _settingsDirectory = new File(settingsDirectory); if(!_settingsDirectory.exists()) _settingsDirectory.mkdirs(); File _macrosDirectory = new File(settingsDirectory,"macros"); if(!_macrosDirectory.exists()) _macrosDirectory.mkdir(); String logPath = MiscUtilities.constructPath( settingsDirectory,"activity.log"); backupSettingsFile(new File(logPath)); try { stream = new BufferedWriter(new FileWriter(logPath)); // Write a warning message: String lineSep = System.getProperty("line.separator"); stream.write("Log file created on " + new Date()); stream.write(lineSep); stream.write("IMPORTANT:"); stream.write(lineSep); stream.write("Because updating this file after " + "every log message would kill"); stream.write(lineSep); stream.write("performance, it will be *incomplete* " + "unless you invoke the"); stream.write(lineSep); stream.write("Utilities->Troubleshooting->Update " + "Activity Log on Disk command!"); stream.write(lineSep); } catch(Exception e) { e.printStackTrace(); stream = null; } } else { stream = null; } //}}} Log.setLogWriter(stream); Log.log(Log.NOTICE,jEdit.class,"jEdit version " + getVersion()); Log.log(Log.MESSAGE,jEdit.class,"Settings directory is " + settingsDirectory); //{{{ Get things rolling GUIUtilities.advanceSplashProgress("init"); initMisc(); GUIUtilities.advanceSplashProgress("init system properties"); initSystemProperties(); GUIUtilities.advanceSplashProgress("init beanshell"); BeanShell.init(); GUIUtilities.advanceSplashProgress("loading site properties"); if(jEditHome != null) initSiteProperties(); GUIUtilities.advanceSplashProgress("loading user properties"); initUserProperties(); initLocalizationProperties(); GUIUtilities.advanceSplashProgress("init GUI"); GUIUtilities.init(); bufferSetManager = new BufferSetManager(); //}}} //{{{ Initialize server if(portFile != null) { GUIUtilities.advanceSplashProgress("init server"); server = new EditServer(portFile); if(!server.isOK()) server = null; } else { GUIUtilities.advanceSplashProgress(); if(background) { background = false; Log.log(Log.WARNING,jEdit.class,"You cannot specify both the" + " -background and -noserver switches"); } } //}}} //{{{ Do more stuff GUIUtilities.advanceSplashProgress("init look and feel"); initPLAF(); GUIUtilities.advanceSplashProgress("init VFS Manager"); VFSManager.init(); GUIUtilities.advanceSplashProgress("init resources"); initResources(); if (settingsDirectory != null) { GUIUtilities.advanceSplashProgress("Migrate keymaps"); MigrationService keymapMigration = ServiceManager.getService(MigrationService.class, "keymap"); keymapMigration.migrate(); } SearchAndReplace.load(); if(loadPlugins) { GUIUtilities.advanceSplashProgress("init plugins"); initPlugins(); } else GUIUtilities.advanceSplashProgress(); Registers.setSaver(new JEditRegisterSaver()); Registers.setListener(new JEditRegistersListener()); GUIUtilities.advanceSplashProgress("init history model"); HistoryModel.setSaver(new JEditHistoryModelSaver()); HistoryModel.loadHistory(); GUIUtilities.advanceSplashProgress("init buffer history"); BufferHistory.load(); GUIUtilities.advanceSplashProgress("init killring"); KillRing.setInstance(new JEditKillRing()); KillRing.getInstance().load(); GUIUtilities.advanceSplashProgress("init various properties"); propertiesChanged(); GUIUtilities.advanceSplashProgress("init modes"); // Buffer sort sortBuffers = getBooleanProperty("sortBuffers"); sortByName = getBooleanProperty("sortByName"); reloadModes(); GUIUtilities.advanceSplashProgress("activate plugins"); //}}} //{{{ Activate plugins that must be activated at startup for(int i = 0; i < jars.size(); i++) { jars.elementAt(i).activatePluginIfNecessary(); } //}}} String[] serviceNames = ServiceManager.getServiceNames(JEditTransferableService.class); for (String serviceName : serviceNames) { JEditTransferableService service = ServiceManager.getService(JEditTransferableService.class, serviceName); org.gjt.sp.jedit.datatransfer.TransferHandler.getInstance().registerTransferableService(service); } //{{{ Load macros and run startup scripts, after plugins and settings are loaded GUIUtilities.advanceSplashProgress("init macros"); Macros.loadMacros(); Macros.getMacroActionSet().initKeyBindings(); if(runStartupScripts && jEditHome != null) { String path = MiscUtilities.constructPath(jEditHome,"startup"); File file = new File(path); if(file.exists()) { runStartupScripts(file); } else GUIUtilities.advanceSplashProgress(); } else GUIUtilities.advanceSplashProgress("run startup scripts"); if(runStartupScripts && settingsDirectory != null) { String path = MiscUtilities.constructPath(settingsDirectory,"startup"); File file = new File(path); if (file.exists()) { GUIUtilities.advanceSplashProgress("run startup scripts"); runStartupScripts(file); } else { GUIUtilities.advanceSplashProgress(); file.mkdirs(); } } else { GUIUtilities.advanceSplashProgress(); } //}}} //{{{ Run script specified with -run= parameter if(scriptFile != null) { GUIUtilities.advanceSplashProgress("run script file"); scriptFile = MiscUtilities.constructPath(userDir,scriptFile); try { BeanShell.getNameSpace().setVariable("args",args); } catch(UtilEvalError e) { Log.log(Log.ERROR,jEdit.class,e); } BeanShell.runScript(null,scriptFile,null,false); } else { GUIUtilities.advanceSplashProgress(); } //}}} GUIUtilities.advanceSplashProgress(); // Create dynamic actions for switching to saved layouts. // The list of saved layouts is retrieved from the docking framework, // which can be provided by a plugin, so this must be called only after // the plugins are loaded. DockingLayoutManager.init(); // Open files, create the view and hide the splash screen. SyntaxUtilities.propertyManager = jEdit.propertyManager; finishStartup(gui,restore,newPlainView,userDir,args); logTime("main done"); }
0 42
            
// in org/gjt/sp/jedit/help/HelpViewer.java
Override public void gotoURL(String url, final boolean addToHistory, final int scrollPosition) { // the TOC pane looks up user's guide URLs relative to the // doc directory... String shortURL; if (MiscUtilities.isURL(url)) { if (url.startsWith(baseURL)) { shortURL = url.substring(baseURL.length()); if(shortURL.startsWith("/")) { shortURL = shortURL.substring(1); } } else { shortURL = url; } } else { shortURL = url; if(baseURL.endsWith("/")) { url = baseURL + url; } else { url = baseURL + '/' + url; } } // reset default cursor so that the hand cursor doesn't // stick around viewer.setCursor(Cursor.getDefaultCursor()); try { final URL _url = new URL(url); final String _shortURL = shortURL; if(!_url.equals(viewer.getPage())) { title.setText(jEdit.getProperty("helpviewer.loading")); } else { /* don't show loading msg because we won't receive a propertyChanged */ } historyModel.setCurrentScrollPosition(viewer.getPage(),getCurrentScrollPosition()); /* call setPage asynchronously, because it can block when one can't connect to host. Calling setPage outside from the EDT violates the single-tread rule of Swing, but it's an experienced workaround (see merge request #2984022 - fix blocking HelpViewer https://sourceforge.net/tracker/?func=detail&aid=2984022&group_id=588&atid=1235750 for discussion). Once jEdit sets JDK 7 as dependency, all this should be reverted to synchronous code. */ SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() { private boolean success; @Override protected Void doInBackground() throws Exception { try { viewer.setPage(_url); success = true; } catch(IOException io) { Log.log(Log.ERROR,this,io); String[] args = { _url.toString(), io.toString() }; GUIUtilities.error(HelpViewer.this,"read-error",args); } return null; } @Override protected void done() { if (success) { if (scrollPosition != 0) { viewerScrollPane.getVerticalScrollBar().setValue(scrollPosition); } if(addToHistory) { historyModel.addToHistory(_url.toString()); } HelpViewer.this.shortURL = _shortURL; // select the appropriate tree node. if(_shortURL != null) { toc.selectNode(_shortURL); } viewer.requestFocus(); } } }; worker.execute(); } catch(MalformedURLException mf) { Log.log(Log.ERROR,this,mf); String[] args = { url, mf.getMessage() }; GUIUtilities.error(this,"badurl",args); } }
// in org/gjt/sp/jedit/help/HelpViewer.java
Override protected Void doInBackground() throws Exception { try { viewer.setPage(_url); success = true; } catch(IOException io) { Log.log(Log.ERROR,this,io); String[] args = { _url.toString(), io.toString() }; GUIUtilities.error(HelpViewer.this,"read-error",args); } return null; }
// in org/gjt/sp/jedit/help/HelpIndex.java
public void indexDirectory(String dir) throws Exception { String[] files = VFSManager.getFileVFS() ._listDirectory(null,dir,"*.{html,txt}",true,null); for(int i = 0; i < files.length; i++) { indexURL(files[i]); } }
// in org/gjt/sp/jedit/help/HelpIndex.java
public void indexJAR(ZipFile jar) throws Exception { Enumeration e = jar.entries(); while(e.hasMoreElements()) { ZipEntry entry = (ZipEntry)e.nextElement(); String name = entry.getName(); String lname = name.toLowerCase(); if(lname.endsWith(".html")/* || lname.endsWith(".txt") */) { // only works for jEdit plugins String url = "jeditresource:/" + MiscUtilities.getFileName(jar.getName()) + "!/" + name; Log.log(Log.DEBUG,this,url); indexStream(jar.getInputStream(entry),url); } } }
// in org/gjt/sp/jedit/help/HelpIndex.java
public void indexURL(String url) throws Exception { InputStream _in; if(MiscUtilities.isURL(url)) _in = new URL(url).openStream(); else { _in = new FileInputStream(url); // hack since HelpViewer needs a URL... url = "file:" + url; } indexStream(_in,url); }
// in org/gjt/sp/jedit/help/HelpIndex.java
private void indexStream(InputStream _in, String fileName) throws Exception { HelpFile file = new HelpFile(fileName); files.add(file); int index = files.size() - 1; StringBuilder titleText = new StringBuilder(); BufferedReader in = new BufferedReader( new InputStreamReader(_in)); try { StringBuilder word = new StringBuilder(); boolean insideTag = false; boolean insideEntity = false; boolean title = false; int c; while((c = in.read()) != -1) { char ch = (char)c; if(insideTag) { if(ch == '>') { if(word.toString().equals("title")) title = true; insideTag = false; word.setLength(0); } else word.append(ch); } else if(insideEntity) { if(ch == ';') insideEntity = false; } else if(ch == '<') { if(title) title = false; if(word.length() != 0) { addWord(word.toString(),index,title); word.setLength(0); } insideTag = true; } else if(ch == '&') insideEntity = true; else if(title) titleText.append(ch); else if(!Character.isLetterOrDigit(ch)) { if(word.length() != 0) { addWord(word.toString(),index,title); word.setLength(0); } } else word.append(ch); } } finally { in.close(); } if(titleText.length() == 0) file.title = fileName; else file.title = titleText.toString(); }
// in org/gjt/sp/jedit/bsh/CommandLineReader.java
public static void main( String [] args ) throws Exception { Reader in = new CommandLineReader( new InputStreamReader(System.in) ); while ( true ) System.out.println( in.read() ); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public static void main( String [] args ) throws Exception { URL [] urls = new URL [ args.length ]; for(int i=0; i< args.length; i++) urls[i] = new File(args[i]).toURL(); BshClassPath bcp = new BshClassPath( "Test", urls ); }
// in org/gjt/sp/jedit/bsh/Remote.java
public static void main( String args[] ) throws Exception { if ( args.length < 2 ) { System.out.println( "usage: Remote URL(http|bsh) file [ file ] ... "); System.exit(1); } String url = args[0]; String text = getFile(args[1]); int ret = eval( url, text ); System.exit( ret ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public static void invokeMain( Class clas, String [] args ) throws Exception { Method main = Reflect.resolveJavaMethod( null/*BshClassManager*/, clas, "main", new Class [] { String [].class }, true/*onlyStatic*/ ); if ( main != null ) main.invoke( null, new Object [] { args } ); }
// in org/gjt/sp/jedit/EditServer.java
private boolean handleClient(final Socket client, DataInputStream in) throws Exception { int key = in.readInt(); if(key != authKey) { Log.log(Log.ERROR,this,client + ": wrong" + " authorization key (got " + key + ", expected " + authKey + ")"); in.close(); client.close(); return false; } else { // Reset the timeout client.setSoTimeout(0); Log.log(Log.DEBUG,this,client + ": authenticated" + " successfully"); final String script = in.readUTF(); Log.log(Log.DEBUG,this,script); SwingUtilities.invokeLater(new Runnable() { public void run() { try { NameSpace ns = new NameSpace( BeanShell.getNameSpace(), "EditServer namespace"); ns.setVariable("socket",client); BeanShell.eval(null,ns,script); } catch(org.gjt.sp.jedit.bsh.UtilEvalError e) { Log.log(Log.ERROR,this,e); } finally { try { BeanShell.getNameSpace().setVariable("socket",null); } catch(org.gjt.sp.jedit.bsh.UtilEvalError e) { Log.log(Log.ERROR,this,e); } } } }); return true; }
// in org/gjt/sp/jedit/EditBus.java
private static void dispatch(EBMessageHandler emh, EBMessage msg) throws Exception { if (emh.handler != null) emh.handler.invoke(emh.comp, msg); else { assert (emh.comp instanceof EBComponent); ((EBComponent)emh.comp).handleMessage(msg); } }
// in org/gjt/sp/jedit/BeanShellFacade.java
public Object _eval(T view, NameSpace namespace, String command) throws Exception { Interpreter interp = createInterpreter(namespace); try { setupDefaultVariables(namespace,view); if(Debug.BEANSHELL_DEBUG) Log.log(Log.DEBUG,BeanShellFacade.class,command); return interp.eval(command); } catch(Exception e) { unwrapException(e); // never called return null; } finally { try { resetDefaultVariables(namespace); } catch(UtilEvalError e) { // do nothing } } }
// in org/gjt/sp/jedit/BeanShellFacade.java
public BshMethod cacheBlock(String id, String code, boolean namespace) throws Exception { // Make local namespace so that the method could be GCed // if it becomes unnecessary. NameSpace local = new NameSpace(global, "__internal_" + id); // This name should be unique enough not to shadow any outer // identifier. String name = "__runCachedMethod"; if(namespace) { _eval(null,local,name + "(ns) {\nthis.callstack.set(0,ns);\n" + code + "\n}"); return local.getMethod(name,new Class[] { NameSpace.class }); } else { _eval(null,local,name + "() {\n" + code + "\n}"); return local.getMethod(name,new Class[0]); } }
// in org/gjt/sp/jedit/BeanShellFacade.java
public Object runCachedBlock(BshMethod method, T param, NameSpace namespace) throws Exception { boolean useNamespace; if(namespace == null) { useNamespace = false; namespace = global; } else useNamespace = true; try { setupDefaultVariables(namespace,param); Object retVal = method.invoke(useNamespace ? new Object[] { namespace } : NO_ARGS, interpForMethods,new CallStack(), null); if(retVal instanceof Primitive) { if(retVal == Primitive.VOID) return null; else return ((Primitive)retVal).getValue(); } else return retVal; } catch(Exception e) { unwrapException(e); // never called return null; } finally { resetDefaultVariables(namespace); } }
// in org/gjt/sp/jedit/BeanShellFacade.java
protected static void unwrapException(Exception e) throws Exception { if(e instanceof TargetError) { Throwable t = ((TargetError)e).getTarget(); if(t instanceof Exception) throw (Exception)t; else if(t instanceof Error) throw (Error)t; } if(e instanceof InvocationTargetException) { Throwable t = ((InvocationTargetException)e).getTargetException(); if(t instanceof Exception) throw (Exception)t; else if(t instanceof Error) throw (Error)t; } throw e; }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
public static SearchMatcher getSearchMatcher() throws Exception { if (matcher != null) return matcher; if (search == null || "".equals(search)) return null; if (regexp) { Pattern re = Pattern.compile(search, PatternSearchMatcher.getFlag(ignoreCase)); matcher = new PatternSearchMatcher(re, ignoreCase, wholeWord); } else matcher = new BoyerMooreSearchMatcher(search, ignoreCase, wholeWord); return matcher; }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
public static boolean find(View view, Buffer buffer, int start) throws Exception { return find(view,buffer,start,false,false); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
public static boolean find(View view, Buffer buffer, int start, boolean firstTime, boolean reverse) throws Exception { EditBus.send(new PositionChanging(view.getEditPane())); SearchMatcher matcher = getSearchMatcher(); if(matcher == null) { view.getToolkit().beep(); return false; } CharSequence text; boolean startOfLine; boolean endOfLine; if(reverse) { text = new ReverseCharSequence(buffer.getSegment(0,start)); startOfLine = true; endOfLine = (buffer.getLineEndOffset( buffer.getLineOfOffset(start)) - 1 == start); } else { text = buffer.getSegment(start,buffer.getLength() - start); startOfLine = (buffer.getLineStartOffset( buffer.getLineOfOffset(start)) == start); endOfLine = true; } String noWordSep = (String) buffer.getMode().getProperty("noWordSep"); matcher.setNoWordSep(noWordSep); SearchMatcher.Match match = matcher.nextMatch(text, startOfLine,endOfLine,firstTime,reverse); if(match != null) { jEdit.commitTemporary(buffer); view.setBuffer(buffer,true); JEditTextArea textArea = view.getTextArea(); if(reverse) { textArea.setSelection(new Selection.Range( start - match.end, start - match.start)); // make sure end of match is visible textArea.scrollTo(start - match.start,false); textArea.moveCaretPosition(start - match.end); } else { textArea.setSelection(new Selection.Range( start + match.start, start + match.end)); textArea.moveCaretPosition(start + match.end); // make sure start of match is visible textArea.scrollTo(start + match.start,false); } return true; } else return false; }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
private static void initReplace() throws Exception { if(beanshell && replace.length() != 0) { String text; if( replace.trim().startsWith( "{" ) ) text = replace; else text = "return (" + replace + ");"; replaceMethod = BeanShell.cacheBlock("replace", text,true); } else replaceMethod = null; }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
private static int replaceInSelection(View view, TextArea textArea, Buffer buffer, SearchMatcher matcher, boolean smartCaseReplace, Selection s) throws Exception { /* if an occurence occurs at the beginning of the selection, the selection start will get moved. this sucks, so we hack to avoid it. */ int start = s.getStart(); int returnValue; if(s instanceof Selection.Range) { returnValue = _replace(view,buffer,matcher, s.getStart(),s.getEnd(), smartCaseReplace); textArea.removeFromSelection(s); textArea.addToSelection(new Selection.Range( start,s.getEnd())); } else if(s instanceof Selection.Rect) { Selection.Rect rect = (Selection.Rect)s; int startCol = rect.getStartColumn( buffer); int endCol = rect.getEndColumn( buffer); returnValue = 0; for(int j = s.getStartLine(); j <= s.getEndLine(); j++) { returnValue += _replace(view,buffer,matcher, getColumnOnOtherLine(buffer,j,startCol), getColumnOnOtherLine(buffer,j,endCol), smartCaseReplace); } textArea.addToSelection(new Selection.Rect( start,s.getEnd())); } else throw new RuntimeException("Unsupported: " + s); return returnValue; }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
private static int _replace(View view, JEditBuffer buffer, SearchMatcher matcher, int start, int end, boolean smartCaseReplace) throws Exception { String wordBreakChars = (String) buffer.getMode().getProperty("wordBreakChars"); matcher.setNoWordSep(wordBreakChars); int occurCount = 0; boolean endOfLine = (buffer.getLineEndOffset( buffer.getLineOfOffset(end)) - 1 == end); int offset = start; loop: for(int counter = 0; ; counter++) { boolean startOfLine = (buffer.getLineStartOffset( buffer.getLineOfOffset(offset)) == offset); CharSequence text = buffer.getSegment(offset,end - offset); SearchMatcher.Match occur = matcher.nextMatch( text,startOfLine,endOfLine,counter == 0,false); if(occur == null) break loop; CharSequence found = text.subSequence( occur.start, occur.end); int length = replaceOne(view,buffer,occur,offset, found,smartCaseReplace); if(length == -1) offset += occur.end; else { offset += occur.start + length; end += (length - found.length()); occurCount++; } } return occurCount; }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
private static int replaceOne(View view, JEditBuffer buffer, SearchMatcher.Match occur, int offset, CharSequence found, boolean smartCaseReplace) throws Exception { String subst = replaceOne(view,buffer,occur,found); if(smartCaseReplace && ignoreCase) { int strCase = TextUtilities.getStringCase(found); if(strCase == TextUtilities.LOWER_CASE) subst = subst.toLowerCase(); else if(strCase == TextUtilities.UPPER_CASE) subst = subst.toUpperCase(); else if(strCase == TextUtilities.TITLE_CASE) subst = TextUtilities.toTitleCase(subst); } if(subst != null) { int start = offset + occur.start; int end = offset + occur.end; if (end - start > 0) buffer.remove(start,end - start); buffer.insert(start,subst); return subst.length(); } else return -1; }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
private static String replaceOne(View view, JEditBuffer buffer, SearchMatcher.Match occur, CharSequence found) throws Exception { if(regexp) { if(replaceMethod != null) return regexpBeanShellReplace(view,buffer,occur); else return regexpReplace(occur,found); } else { if(replaceMethod != null) return literalBeanShellReplace(view,buffer,found); else return replace; } }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
private static String regexpBeanShellReplace(View view, JEditBuffer buffer, SearchMatcher.Match occur) throws Exception { replaceNS.setVariable("buffer", buffer, false); for(int i = 0; i < occur.substitutions.length; i++) { replaceNS.setVariable("_" + i, occur.substitutions[i]); } Object obj = BeanShell.runCachedBlock( replaceMethod,view,replaceNS); for(int i = 0; i < occur.substitutions.length; i++) { replaceNS.setVariable("_" + i, null, false); } // Not really necessary because it is already cleared in the end of // BeanShell.runCachedBlock() replaceNS.setVariable("buffer", null, false); if(obj == null) return ""; else return obj.toString(); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
private static String regexpReplace(SearchMatcher.Match occur, CharSequence found) throws Exception { StringBuilder buf = new StringBuilder(); for(int i = 0; i < replace.length(); i++) { char ch = replace.charAt(i); switch(ch) { case '$': if(i == replace.length() - 1) { // last character of the replace string, // it is not a capturing group buf.append(ch); break; } ch = replace.charAt(++i); if(ch == '$') { // It was $$, so it is an escaped $ buf.append('$'); } else if(ch == '0') { // $0 meaning the first capturing group : // the found value buf.append(found); } else if(Character.isDigit(ch)) { int n = ch - '0'; while (i < replace.length() - 1) { ch = replace.charAt(++i); if (Character.isDigit(ch)) { n = n * 10 + (ch - '0'); } else { // The character is not // a digit, going back and // end loop i--; break; } } if(n < occur .substitutions .length) { String subs = occur.substitutions[n]; if (subs != null) buf.append(subs); } } break; case '\\': if(i == replace.length() - 1) { buf.append('\\'); break; } ch = replace.charAt(++i); switch(ch) { case 'n': buf.append('\n'); break; case 't': buf.append('\t'); break; default: buf.append(ch); break; } break; default: buf.append(ch); break; } } return buf.toString(); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
private static String literalBeanShellReplace(View view, JEditBuffer buffer, CharSequence found) throws Exception { replaceNS.setVariable("buffer",buffer); replaceNS.setVariable("_0",found); Object obj = BeanShell.runCachedBlock( replaceMethod, view,replaceNS); replaceNS.setVariable("_0", null, false); // Not really necessary because it is already cleared in the end of // BeanShell.runCachedBlock() replaceNS.setVariable("buffer", null, false); if(obj == null) return ""; else return obj.toString(); }
// in org/gjt/sp/jedit/search/HyperSearchRequest.java
private int searchInSelection(Buffer buffer) throws Exception { setCancellable(false); int resultCount = 0; try { buffer.readLock(); for(int i = 0; i < selection.length; i++) { Selection s = selection[i]; if(s instanceof Selection.Rect) { for(int j = s.getStartLine(); j <= s.getEndLine(); j++) { resultCount += doHyperSearch(buffer, s.getStart(buffer,j), s.getEnd(buffer,j)); } } else { resultCount += doHyperSearch(buffer, s.getStart(),s.getEnd()); } } } finally { buffer.readUnlock(); } setCancellable(true); return resultCount; }
// in org/gjt/sp/jedit/search/HyperSearchRequest.java
private int doHyperSearch(Buffer buffer, int start, int end) throws Exception { setCancellable(false); HyperSearchFileNode hyperSearchFileNode = new HyperSearchFileNode(buffer.getPath()); DefaultMutableTreeNode bufferNode = new DefaultMutableTreeNode(hyperSearchFileNode); int resultCount = doHyperSearch(buffer,start,end,bufferNode); hyperSearchFileNode.setCount(resultCount); if(resultCount != 0) rootSearchNode.insert(bufferNode,rootSearchNode.getChildCount()); setCancellable(true); return resultCount; }
// in org/gjt/sp/jedit/Abbrevs.java
private static void loadAbbrevs(Reader _in) throws Exception { BufferedReader in = new BufferedReader(_in); try { Hashtable<String,String> currentAbbrevs = globalAbbrevs; String line; while((line = in.readLine()) != null) { int index = line.indexOf('|'); if(line.length() == 0) continue; else if(line.startsWith("[") && index == -1) { if(line.equals("[global]")) currentAbbrevs = globalAbbrevs; else { String mode = line.substring(1, line.length() - 1); currentAbbrevs = modes.get(mode); if(currentAbbrevs == null) { currentAbbrevs = new Hashtable<String,String>(); modes.put(mode,currentAbbrevs); } } } else if(index != -1) { currentAbbrevs.put(line.substring(0,index), line.substring(index + 1)); } } } finally { in.close(); } }
// in org/gjt/sp/jedit/Abbrevs.java
private static void saveAbbrevs(Writer _out) throws Exception { BufferedWriter out = new BufferedWriter(_out); String lineSep = System.getProperty("line.separator"); // write global abbrevs out.write("[global]"); out.write(lineSep); saveAbbrevs(out,globalAbbrevs); // write mode abbrevs Enumeration<String> keys = modes.keys(); Enumeration<Hashtable<String,String>> values = modes.elements(); while(keys.hasMoreElements()) { out.write('['); out.write(keys.nextElement()); out.write(']'); out.write(lineSep); saveAbbrevs(out,values.nextElement()); } out.close(); }
// in org/gjt/sp/jedit/Abbrevs.java
private static void saveAbbrevs(Writer out, Hashtable<String,String> abbrevs) throws Exception { String lineSep = System.getProperty("line.separator"); Enumeration<String> keys = abbrevs.keys(); Enumeration<String> values = abbrevs.elements(); while(keys.hasMoreElements()) { String abbrev = keys.nextElement(); out.write(abbrev); out.write('|'); out.write(values.nextElement()); out.write(lineSep); } }
// in org/gjt/sp/jedit/BeanShell.java
public static void _runScript(View view, String path, Reader in, boolean ownNamespace) throws Exception { _runScript(view,path,in,ownNamespace ? new NameSpace(bsh.getNameSpace(),"namespace") : bsh.getNameSpace()); }
// in org/gjt/sp/jedit/BeanShell.java
public static void _runScript(View view, String path, Reader in, NameSpace namespace) throws Exception { Log.log(Log.MESSAGE,BeanShell.class,"Running script " + path); Interpreter interp = BeanShellFacade.createInterpreter(namespace); try { if(in == null) { Buffer buffer = jEdit.openTemporary(null, null,path,false); if(!buffer.isLoaded()) VFSManager.waitForRequests(); in = new StringReader(buffer.getText(0, buffer.getLength())); } bsh.setupDefaultVariables(namespace,view); interp.set("scriptPath",path); running = true; interp.eval(in,namespace,path); } catch(Exception e) { BeanShellFacade.unwrapException(e); } finally { running = false; try { // no need to do this for macros! if(namespace == bsh.getNameSpace()) { bsh.resetDefaultVariables(namespace); interp.unset("scriptPath"); } } catch(EvalError e) { // do nothing } } }
// in org/gjt/sp/jedit/BeanShell.java
public static Object _eval(View view, NameSpace namespace, String command) throws Exception { return bsh._eval(view, namespace, command); }
// in org/gjt/sp/jedit/BeanShell.java
public static BshMethod cacheBlock(String id, String code, boolean namespace) throws Exception { return bsh.cacheBlock(id, code, namespace); }
// in org/gjt/sp/jedit/BeanShell.java
public static Object runCachedBlock(BshMethod method, View view, NameSpace namespace) throws Exception { return bsh.runCachedBlock(method, view, namespace); }
// in org/gjt/sp/jedit/textarea/TextAreaTransferHandler.java
private boolean importFile(JComponent c, Transferable t) throws Exception { Log.log(Log.DEBUG,this,"=> File list"); EditPane editPane = (EditPane) GUIUtilities.getComponentParent( c,EditPane.class); View view = editPane.getView(); Buffer buffer = null; // per the Java API, javaFileListFlavor guarantees that a // List<File> will be returned. So suppress warning for this // statement. We know what we're doing. @SuppressWarnings("unchecked") List<File> data = (List<File>) t.getTransferData(DataFlavor.javaFileListFlavor); boolean browsedDirectory = false; BufferSetManager bufferSetManager = jEdit.getBufferSetManager(); for (File file : data) { if (file.isDirectory()) { if (!browsedDirectory) { VFSBrowser.browseDirectory(view, file.getPath()); browsedDirectory = true; } continue; } Buffer _buffer = jEdit.openFile(editPane, file.getPath()); if (_buffer != null) { buffer = _buffer; bufferSetManager.addBuffer(editPane, buffer); } } if(buffer != null) editPane.setBuffer(buffer); view.toFront(); view.requestFocus(); editPane.requestFocus(); return true; }
// in org/gjt/sp/jedit/textarea/TextAreaTransferHandler.java
private boolean importURIList(JComponent c, Transferable t,DataFlavor uriListStringDataFlavor) throws Exception { String str = (String) t.getTransferData(uriListStringDataFlavor); Log.log(Log.DEBUG,this,"=> URIList \""+str+ '\"'); EditPane editPane = (EditPane) GUIUtilities.getComponentParent(c, EditPane.class); View view = editPane.getView(); JEditTextArea textArea = (JEditTextArea) c; if (dragSource == null) { boolean found = false; String[] components = str.split("\r\n"); boolean browsedDirectory = false; for (int i = 0;i<components.length;i++) { String str0 = components[i]; // gnome-commander adds a 0 byte at the end of the file name, discard it int len = str0.length(); if (len > 0 && (int)str0.charAt(len - 1) == 0) str0 = str0.substring(0, len - 1); if (str0.length() > 0) { URI uri = new URI(str0); // this handles the URI-decoding if ("file".equals(uri.getScheme())) { File file = new File(uri.getPath()); if (file.isDirectory()) { if (!browsedDirectory) { VFSBrowser.browseDirectory(view, file.getPath()); browsedDirectory = true; } } else { VFSManager.runInAWTThread(new DraggedURLLoader(textArea,uri.getPath())); } found = true; } else { Log.log(Log.DEBUG,this,"I do not know how to handle this URI "+uri+", ignoring."); } } else { // This should be the last component, because every URI in the list is terminated with a "\r\n", even the last one. if (i!=components.length-1) { Log.log(Log.DEBUG,this,"Odd: there is an empty line in the uri list which is not the last line."); } } } if (found) { return true; } } return true; }
// in org/gjt/sp/jedit/textarea/TextAreaTransferHandler.java
private boolean importText(JComponent c, Transferable t) throws Exception { String str = (String)t.getTransferData( DataFlavor.stringFlavor); str = str.trim(); Log.log(Log.DEBUG,this,"=> String \""+str+ '\"'); JEditTextArea textArea = (JEditTextArea)c; if (dragSource == null) { boolean found = false; String[] components = str.split("\n"); for (String str0 : components) { // Only examine the string for a URL if it came from // outside of jEdit. VFS vfs = VFSManager.getVFSForPath(str0); if (!(vfs instanceof FileVFS) || str.startsWith("file://")) { // str = str.replace('\n',' ').replace('\r',' ').trim(); if (str0.startsWith("file://")) { str0 = str0.substring(7); } VFSManager.runInWorkThread(new DraggedURLLoader(textArea, str0)); } found = true; } if (found) return true; } if(dragSource != null && textArea.getBuffer() == dragSource.getBuffer()) { compoundEdit = true; textArea.getBuffer().beginCompoundEdit(); } sameTextArea = textArea == dragSource; int caret = textArea.getCaretPosition(); Selection s = textArea.getSelectionAtOffset(caret); /* if user drops into the same selection where they started, do nothing. */ if(s != null) { if(sameTextArea) return false; /* if user drops into a selection, replace selection */ int startPos = s.start; textArea.setSelectedText(s,str); textArea.setSelection(new Selection.Range(startPos,startPos+str.length())); } /* otherwise just insert the text */ else { if (sameTextArea) { insertPos = caret; insertOffset = 0; Selection[] selections = textArea.getSelection(); for (Selection selection : selections) { if (selection.end < insertPos + insertOffset) insertOffset -= selection.end - selection.start; } } else { textArea.getBuffer().insert(caret,str); textArea.setSelection(new Selection.Range(caret,caret+str.length())); } } textArea.scrollToCaret(true); return true; }
// in org/gjt/sp/jedit/menu/EnhancedMenu.java
protected void finalize() throws Exception { if(ebStub != null) EditBus.removeFromBus(ebStub); }
// in org/gjt/sp/jedit/BeanShellAction.java
public BshMethod get() throws java.lang.Exception { if (cache != null) { BshMethod cached = cache.get(); if (cached != null) { return cached; } } BshMethod newOne = BeanShell.cacheBlock(name, source, true); cache = new SoftReference<BshMethod>(newOne); return newOne; }
147
            
// in org/gjt/sp/jedit/print/BufferPrintable.java
catch(Exception e) { Log.log(Log.ERROR,this,e); final String[] args = { e.toString() }; SwingUtilities.invokeLater(new Runnable() { public void run() { GUIUtilities.error(view,"print-error",args); } }); }
// in org/gjt/sp/jedit/print/BufferPrinter1_4.java
catch(Exception e) { Log.log(Log.ERROR,BufferPrinter1_4.class,e); }
// in org/gjt/sp/jedit/print/BufferPrinter1_4.java
catch(Exception e) { e.printStackTrace(); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(Exception e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(Exception e) { Log.log(Log.ERROR,this,e); return null; }
// in org/gjt/sp/jedit/pluginmgr/InstallPanel.java
catch (Exception e) { Log.log(Log.WARNING, this, "Loading Pluginset failed:" + e.getMessage()); return false; }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
catch (Exception e) { Log.log(Log.WARNING, this, "Exception thrown loading: " + jarName, e); }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
catch (Exception e) { Log.log(Log.ERROR, this, "Loading Pluginset Error", e); return false; }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
catch (Exception e) { Log.log(Log.ERROR, this, "Saving State Error", e); }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
catch (Exception ex) { Log.log(Log.ERROR, this, "ManagePanel HelpButton Update", ex); }
// in org/gjt/sp/jedit/pluginmgr/PluginListHandler.java
catch (Exception e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/pluginmgr/MirrorListHandler.java
catch (Exception e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/pluginmgr/PluginManagerProgress.java
catch(Exception e) { }
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch (Exception e) { Log.log(Log.MESSAGE, this, "No cached copy. Downloading from mirror. "); downloadIt = true; }
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch (Exception e) { Log.log(Log.ERROR, this, "readpluginlist: error", e); if (cachedURL.startsWith("file:///")) { Log.log(Log.DEBUG, this, "Unable to read plugin list, deleting cached file and try again"); new File(cachedURL.substring(8)).delete(); if (allowRetry) { plugins.clear(); pluginHash.clear(); pluginSets.clear(); readPluginList(false); } } }
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch (Exception e) { Log.log (Log.ERROR, this, "CacheRemotePluginList: error", e); }
// in org/gjt/sp/jedit/gui/FontSelectorDialog.java
catch(Exception e) { size = 12; }
// in org/gjt/sp/jedit/gui/FontSelectorDialog.java
catch(Exception e) { Log.log(Log.ERROR,this,"Broken Java implementation!"); /* Log.log(Log.ERROR,this,"Using deprecated Toolkit.getFontList()"); */ Log.log(Log.ERROR,this,e); /* fonts = getToolkit().getFontList(); */ fonts = new String[] { "Broken Java implementation!" }; }
// in org/gjt/sp/jedit/gui/FontSelectorDialog.java
catch(Exception e) { size = 12; }
// in org/gjt/sp/jedit/gui/TipOfTheDay.java
catch(Exception e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/gui/AboutDialog.java
catch(Exception exc) { tell("AboutPanel: " + exc); }
// in org/gjt/sp/jedit/gui/AboutDialog.java
catch(Exception exc) { Log.log(Log.ERROR, this, exc); }
// in org/gjt/sp/jedit/gui/KeyEventTranslator.java
catch(Exception e) { Log.log(Log.ERROR,KeyEventTranslator.class, "Invalid key code: " + code); return KeyEvent.VK_UNDEFINED; }
// in org/gjt/sp/jedit/gui/DockableWindowManagerImpl.java
catch (Exception e) {}
// in org/gjt/sp/jedit/gui/SplashScreen.java
catch(Exception e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/gui/GrabKeyDialog.java
catch(Exception e) { Log.log(Log.ERROR,GrabKeyDialog.class,e); }
// in org/gjt/sp/jedit/gui/DockableWindowFactory.java
catch (Exception e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/ActionListHandler.java
catch (Exception e) { Log.log(Log.ERROR,this, e); }
// in org/gjt/sp/jedit/help/HelpSearchPanel.java
catch(Exception e) { index = null; Log.log(Log.ERROR,this,e); GUIUtilities.error(helpViewer.getComponent(),"helpviewer.search.error", new String[] { e.toString() }); }
// in org/gjt/sp/jedit/bsh/This.java
catch ( Exception e ) { throw new InterpreterError("internal error 1 in This: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(Exception e) { throw new ReflectError("Array access:" + e); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(Exception e) { throw new ReflectError("Array access:" + e); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( Exception e ) { e1 = e; }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( Exception e ) { e2 = e; }
// in org/gjt/sp/jedit/bsh/BSHType.java
catch(Exception e) { throw new EvalError("Couldn't construct array type", this, callstack ); }
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( Exception e ) { {if (true) throw createParseException("Error parsing character: "+x.image);} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( Exception e ) { {if (true) throw createParseException("Error parsing string: "+x.image);} }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( Exception e ) { if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); throw new EvalError( "Error constructing inner class instance: "+e, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch( Exception e ) { throw new EvalError("Can't construct primitive array: " + e.getMessage(), this, callstack); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "unable to get instance initializer: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "unable to get instance initializer: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Error in class initialization: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { if ( e instanceof TargetError ) e =(Exception)((TargetError)e).getTarget(); if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); e.printStackTrace( System.err ); throw new InterpreterError("Error in class initialization: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Unable to get class static space: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "Generated class: Error getting This"+e ); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( Exception e ) { // used to squeltch this... changed for 1.3 // see BshClassManager }
// in org/gjt/sp/jedit/bsh/BSHArrayDimensions.java
catch(Exception e) { throw new EvalError( "Array index: " + i + " does not evaluate to an integer", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( Exception e ) { throw new InterpreterError("Error loading classmanager: "+e); }
// in org/gjt/sp/jedit/bsh/Remote.java
catch ( Exception e ) { // this convention may change... return 0; }
// in org/gjt/sp/jedit/bsh/Remote.java
catch ( Exception ex ) { System.err.println("Bad URL: "+orgURL+": "+ex ); return returnValue; }
// in org/gjt/sp/jedit/bsh/Remote.java
catch(Exception ex) { System.err.println("Error communicating with server: "+ex); return returnValue; }
// in org/gjt/sp/jedit/bsh/ClassGenerator.java
catch ( Exception e ) { throw new Unavailable("ClassGenerator unavailable: "+e); }
// in org/gjt/sp/jedit/bsh/ReflectManager.java
catch ( Exception e ) { throw new Unavailable("Reflect Manager unavailable: "+e); }
// in org/gjt/sp/jedit/bsh/CollectionManager.java
catch ( Exception e ) { Interpreter.debug("unable to load CollectionManagerImpl: "+e); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(Exception e) { throw new UtilEvalError("Array access: " + e); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch ( Exception e ) { throw new UtilEvalError("Assignment: " + e.getMessage()); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e ) { Object o = e; if ( e instanceof InvocationTargetException ) o = ((InvocationTargetException)e) .getTargetException(); System.err.println( "Class: "+result+" main method threw exception:"+o); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(Exception e) { error("Unknown error: " + e); if ( DEBUG ) e.printStackTrace(); if(!interactive) eof = true; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e) { if ( DEBUG) e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" unknown error: " + e.getMessage(), node, callstack); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e ) { // squeltch security exception, filenotfoundexception if ( Interpreter.DEBUG ) debug("Could not find rc file: "+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e ) { System.err.println("Could not init static(2):"+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e ) { return "bsh % "; }
// in org/gjt/sp/jedit/EditServer.java
catch(Exception e) { if(!abort) Log.log(Log.ERROR,this,e); abort = true; }
// in org/gjt/sp/jedit/Registers.java
catch(Exception e) { Log.log(Log.NOTICE,this,e); return null; }
// in org/gjt/sp/jedit/AbstractOptionPane.java
catch (Exception e) { /* There probably wasn't a tooltip, * or it wasn't a JComponent. We don't care. */ }
// in org/gjt/sp/jedit/BeanShellFacade.java
catch(Exception e) { unwrapException(e); // never called return null; }
// in org/gjt/sp/jedit/BeanShellFacade.java
catch(Exception e) { unwrapException(e); // never called return null; }
// in org/gjt/sp/jedit/Mode.java
catch(Exception e) { Log.log(Log.ERROR,this,"Bad indent rule " + prop + '=' + value + ':'); Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/Mode.java
catch(Exception e) { Log.log(Log.ERROR,this,"Bad indent rule " + prop + '=' + value + ':'); Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/GUIUtilities.java
catch(Exception e) { try { url = new URL(defaultIconPath + iconName); } catch(Exception ex) { Log.log(Log.ERROR,GUIUtilities.class, "Icon not found: " + iconName); Log.log(Log.ERROR,GUIUtilities.class,ex); return null; } }
// in org/gjt/sp/jedit/GUIUtilities.java
catch(Exception ex) { Log.log(Log.ERROR,GUIUtilities.class, "Icon not found: " + iconName); Log.log(Log.ERROR,GUIUtilities.class,ex); return null; }
// in org/gjt/sp/jedit/GUIUtilities.java
catch (Exception e) { // ignored }
// in org/gjt/sp/jedit/GUIUtilities.java
catch (Exception e) { // ignored }
// in org/gjt/sp/jedit/GUIUtilities.java
catch (Exception e) { return null; }
// in org/gjt/sp/jedit/GUIUtilities.java
catch (Exception e) { return null; }
// in org/gjt/sp/jedit/GUIUtilities.java
catch (Exception e) { return JOptionPane.CANCEL_OPTION; }
// in org/gjt/sp/jedit/GUIUtilities.java
catch (Exception e) { return 0; }
// in org/gjt/sp/jedit/GUIUtilities.java
catch (Exception e) { return JOptionPane.CANCEL_OPTION; }
// in org/gjt/sp/jedit/GUIUtilities.java
catch (Exception e) { return JOptionPane.CANCEL_OPTION; }
// in org/gjt/sp/jedit/GUIUtilities.java
catch(Exception e) { /* Workaround for OS X bug. */ Log.log(Log.ERROR,GUIUtilities.class,e); }
// in org/gjt/sp/jedit/GUIUtilities.java
catch(Exception e) { // This is probably an error, but it will be logged in // KeyEventTranslator.parseKey anyway, so just ignore it here. text = key.toUpperCase(); }
// in org/gjt/sp/jedit/search/SearchBar.java
catch(Exception e) { Log.log(Log.DEBUG,this,e); // invalid regexp, ignore // return true to avoid annoying beeping while // typing a re ret = true; }
// in org/gjt/sp/jedit/search/AllBufferSet.java
catch(Exception e) { Log.log(Log.ERROR,this,e); return null; }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
catch(Exception e) { results.searchFailed(); handleError(comp,e); return false; }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
catch(Exception e) { handleError(comp,e); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
catch(Exception e) { handleError(comp,e); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
catch(Exception e) { handleError(comp,e); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
catch(Exception e) { handleError(comp,e); }
// in org/gjt/sp/jedit/search/HyperSearchResults.java
catch (Exception e) { style = "color:#000000"; s = SyntaxUtilities.parseStyle(style, f.getFamily(), f.getSize(), true); }
// in org/gjt/sp/jedit/search/HyperSearchResults.java
catch (Exception ex) { operNodeObj.restoreFlatNodes(resultTree, operNode); menuItem.setSelected(false); excp = ex; }
// in org/gjt/sp/jedit/search/HyperSearchRequest.java
catch(final Exception e) { Log.log(Log.ERROR,this,e); ThreadUtilities.runInDispatchThread(new Runnable() { public void run() { SearchAndReplace.handleError(view,e); } }); }
// in org/gjt/sp/jedit/search/DirectoryListSet.java
catch(Exception e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { // ok, this one seems to confuse newbies // endlessly, so log it as NOTICE, not // ERROR Log.log(Log.NOTICE,jEdit.class,"An error occurred" + " while connecting to the jEdit server instance."); Log.log(Log.NOTICE,jEdit.class,"This probably means that" + " jEdit crashed and/or exited abnormally"); Log.log(Log.NOTICE,jEdit.class,"the last time it was run."); Log.log(Log.NOTICE,jEdit.class,"If you don't" + " know what this means, don't worry."); Log.log(Log.NOTICE,jEdit.class,e); }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { e.printStackTrace(); stream = null; }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { Log.log(Log.ERROR,jEdit.class, "Error while loading system properties!"); Log.log(Log.ERROR,jEdit.class, "One of the following property files could not be loaded:\n" + "- jedit.props\n" + "- jedit_gui.props\n" + "- jedit_en.props\n" + "jedit.jar is probably corrupt."); Log.log(Log.ERROR,jEdit.class,e); System.exit(1); }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { Log.log(Log.ERROR,jEdit.class,e); }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { Log.log(Log.ERROR,jEdit.class,e); }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { Log.log(Log.ERROR, jEdit.class, "Window " + iWindow + ": " + window, e); break; }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { Log.log(Log.ERROR,jEdit.class,e); }
// in org/gjt/sp/jedit/jEdit.java
catch(Exception e) { return; }
// in org/gjt/sp/jedit/Abbrevs.java
catch(Exception e) { Log.log(Log.ERROR,Abbrevs.class,"Error while saving " + file1); Log.log(Log.ERROR,Abbrevs.class,e); }
// in org/gjt/sp/jedit/Abbrevs.java
catch(Exception e) { Log.log(Log.ERROR,Abbrevs.class,"Error while loading " + file); Log.log(Log.ERROR,Abbrevs.class,e); }
// in org/gjt/sp/jedit/Abbrevs.java
catch(Exception e) { Log.log(Log.ERROR,Abbrevs.class,"Error while loading default.abbrevs"); Log.log(Log.ERROR,Abbrevs.class,e); }
// in org/gjt/sp/jedit/BufferHistory.java
catch(Exception e) { Log.log(Log.ERROR,BufferHistory.class,e); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Exception e) { return defaultValue; }
// in org/gjt/sp/jedit/options/IntegerInputVerifier.java
catch (Exception e) { return false; }
// in org/gjt/sp/jedit/options/PluginManagerOptionPane.java
catch (final Exception ex) { if (download) { Log.log(Log.ERROR,this,ex); ThreadUtilities.runInDispatchThread(new Runnable() { public void run() { GUIUtilities.error(PluginManagerOptionPane.this, "ioerror",new String[] { ex.toString() }); } }); }
// in org/gjt/sp/jedit/bufferio/BufferIORequest.java
catch(Exception e) { // Ignore. }
// in org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); // Incomplete autosave file should not exist. if(out != null) { try { out.close(); out = null; vfs._delete(session,path,view); } catch(IOException ioe) { Log.log(Log.ERROR,this,ioe); } } }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(Exception e) { // ignore }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); Object[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.read-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/BeanShell.java
catch(Exception e) { BeanShellFacade.unwrapException(e); }
// in org/gjt/sp/jedit/JEditKillRing.java
catch(Exception e) { Log.log(Log.ERROR,KillRing.class,e); }
// in org/gjt/sp/jedit/JEditKillRing.java
catch (Exception e) { Log.log(Log.ERROR, this, "Failed to get character from PI" + "\"" + target + "\"" + " with \"" + data + "\"" + ": " + e); return; }
// in org/gjt/sp/jedit/JEditRegisterSaver.java
catch(Exception e) { Log.log(Log.ERROR,Registers.class,e); }
// in org/gjt/sp/jedit/textarea/TextAreaTransferHandler.java
catch(Exception e) { Log.log(Log.ERROR,this,e); returnValue = false; }
// in org/gjt/sp/jedit/textarea/TextAreaTransferHandler.java
catch(Exception e) { Log.log(Log.DEBUG,this,"exportDone in sameTextArea"); Log.log(Log.DEBUG,this,e); }
// in org/gjt/sp/jedit/textarea/ExtensionManager.java
catch(Exception e) { Log.log(Log.ERROR,this,"Error repainting line" + " range {" + firstLine + ',' + lastLine + "}:"); Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/textarea/JEditTextArea.java
catch(Exception e) { getToolkit().beep(); }
// in org/gjt/sp/jedit/syntax/Token.java
catch(Exception e) { return -1; }
// in org/gjt/sp/jedit/PluginJAR.java
catch(Exception e) { String[] args = { pluginDepends.arg }; jEdit.pluginError(path, "plugin-error.dep-class",args); ok = false; }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { Log.log(Log.ERROR, Macros.class, e); return; }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { // ignored }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { // ignored }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { return null; }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { return JOptionPane.CANCEL_OPTION; }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { return JOptionPane.CANCEL_OPTION; }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { Log.log(Log.ERROR, Macros.class, e); macroHandlers.remove(handler); }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { throw new InternalError("Missing or invalid glob for handler " + name); }
// in org/gjt/sp/jedit/ServiceListHandler.java
catch (Exception e) { Log.log(Log.ERROR, e, e); }
// in org/gjt/sp/util/Log.java
catch(Exception e) { // do nothing, who cares }
// in org/gjt/sp/util/Log.java
catch(Exception e) { e.printStackTrace(realErr); }
// in org/gjt/sp/util/PropertiesBean.java
catch (Exception e) { // These exceptions shouldn't occur during normal runtime, // so we catch them and print an error message. Users of this // class should fix these before releasing the code. Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/util/PropertiesBean.java
catch (Exception e) { // These exceptions shouldn't occur during normal runtime, // so we catch them and print an error message. Users of this // class should fix these before releasing the code. Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/util/PropertiesBean.java
catch (Exception e) { // These exceptions shouldn't occur during normal runtime, // so we catch them and print an error message. Users of this // class should fix these before releasing the code. Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/util/WorkThreadPool.java
catch(Exception e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/util/SyntaxUtilities.java
catch(Exception e) { Log.log(Log.ERROR,StandardUtilities.class,e); }
// in org/gjt/sp/util/HtmlUtilities.java
catch (Exception e) { style = "color:#000000"; s = SyntaxUtilities.parseStyle(style, f.getFamily(), f.getSize(), true); }
// in org/gjt/sp/util/XMLUtilities.java
catch (Exception e) { Log.log(Log.ERROR,XMLUtilities.class, "Error while opening " + test + ':'); Log.log(Log.ERROR,XMLUtilities.class,e); }
24
            
// in org/gjt/sp/jedit/bsh/This.java
catch ( Exception e ) { throw new InterpreterError("internal error 1 in This: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(Exception e) { throw new ReflectError("Array access:" + e); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(Exception e) { throw new ReflectError("Array access:" + e); }
// in org/gjt/sp/jedit/bsh/BSHType.java
catch(Exception e) { throw new EvalError("Couldn't construct array type", this, callstack ); }
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( Exception e ) { {if (true) throw createParseException("Error parsing character: "+x.image);} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( Exception e ) { {if (true) throw createParseException("Error parsing string: "+x.image);} }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( Exception e ) { if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); throw new EvalError( "Error constructing inner class instance: "+e, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch( Exception e ) { throw new EvalError("Can't construct primitive array: " + e.getMessage(), this, callstack); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "unable to get instance initializer: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "unable to get instance initializer: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Error in class initialization: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { if ( e instanceof TargetError ) e =(Exception)((TargetError)e).getTarget(); if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); e.printStackTrace( System.err ); throw new InterpreterError("Error in class initialization: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Unable to get class static space: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "Generated class: Error getting This"+e ); }
// in org/gjt/sp/jedit/bsh/BSHArrayDimensions.java
catch(Exception e) { throw new EvalError( "Array index: " + i + " does not evaluate to an integer", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( Exception e ) { throw new InterpreterError("Error loading classmanager: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGenerator.java
catch ( Exception e ) { throw new Unavailable("ClassGenerator unavailable: "+e); }
// in org/gjt/sp/jedit/bsh/ReflectManager.java
catch ( Exception e ) { throw new Unavailable("Reflect Manager unavailable: "+e); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(Exception e) { throw new UtilEvalError("Array access: " + e); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch ( Exception e ) { throw new UtilEvalError("Assignment: " + e.getMessage()); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Exception e) { if ( DEBUG) e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" unknown error: " + e.getMessage(), node, callstack); }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { throw new InternalError("Missing or invalid glob for handler " + name); }
10
unknown (Lib) FileNotFoundException 2
            
// in org/gjt/sp/jedit/io/VFS.java
public static boolean copy(ProgressObserver progress, VFS sourceVFS, Object sourceSession,String sourcePath, VFS targetVFS, Object targetSession,String targetPath, Component comp, boolean canStop, boolean sendVFSUpdate) throws IOException { if (progress != null) progress.setStatus("Initializing"); InputStream in = null; OutputStream out = null; try { VFSFile sourceVFSFile = sourceVFS._getFile(sourceSession, sourcePath, comp); if (sourceVFSFile == null) throw new FileNotFoundException("source path " + sourcePath + " doesn't exists"); if (progress != null) { progress.setMaximum(sourceVFSFile.getLength()); } VFSFile targetVFSFile = targetVFS._getFile(targetSession, targetPath, comp); if (targetVFSFile == null) { String parentTargetPath = MiscUtilities.getParentOfPath(targetPath); VFSFile parentTargetVFSFile = targetVFS._getFile(targetSession, parentTargetPath, comp); if (parentTargetVFSFile == null) throw new FileNotFoundException("target path " + parentTargetPath + " doesn't exists"); if (parentTargetVFSFile.getType() == VFSFile.DIRECTORY) { String targetFilename = MiscUtilities.getFileName(targetPath); targetPath = MiscUtilities.constructPath(parentTargetPath, targetFilename); } else { throw new IOException("The parent of target path is a file"); } } else if (targetVFSFile.getType() == VFSFile.DIRECTORY) { if (targetVFSFile.getPath().equals(sourceVFSFile.getPath())) return false; targetPath = MiscUtilities.constructPath(targetPath, sourceVFSFile.getName()); } in = new BufferedInputStream(sourceVFS._createInputStream(sourceSession, sourcePath, false, comp)); out = new BufferedOutputStream(targetVFS._createOutputStream(targetSession, targetPath, comp)); boolean copyResult = IOUtilities.copyStream(IOBUFSIZE, progress, in, out, canStop); if (sendVFSUpdate) VFSManager.sendVFSUpdate(targetVFS, targetPath, true); return copyResult; } finally { IOUtilities.closeQuietly(in); IOUtilities.closeQuietly(out); } }
0 3
            
// in org/gjt/sp/jedit/bsh/Remote.java
static String getFile( String name ) throws FileNotFoundException, IOException { StringBuilder sb = new StringBuilder(); BufferedReader bin = new BufferedReader( new FileReader( name ) ); String line; while ( (line=bin.readLine()) != null ) sb.append( line ).append( "\n" ); return sb.toString(); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object source( String filename, NameSpace nameSpace ) throws FileNotFoundException, IOException, EvalError { File file = pathToFile( filename ); if ( Interpreter.DEBUG ) debug("Sourcing file: "+file); Reader sourceIn = new BufferedReader( new FileReader(file) ); try { return eval( sourceIn, nameSpace, filename ); } finally { sourceIn.close(); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object source( String filename ) throws FileNotFoundException, IOException, EvalError { return source( filename, globalNameSpace ); }
12
            
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(FileNotFoundException e) { Log.log(Log.ERROR,this,e); SwingUtilities.invokeLater(new Runnable() { public void run() { GUIUtilities.error(null,"plugin-error-download",new Object[]{""}); } }); return null; }
// in org/gjt/sp/jedit/gui/DockableWindowManagerImpl.java
catch (FileNotFoundException e) { return false; }
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
catch(FileNotFoundException fnf) { //Log.log(Log.DEBUG,HistoryModel.class,fnf); }
// in org/gjt/sp/jedit/help/HelpTOCPanel.java
catch(FileNotFoundException e) { /* it is acceptable only for the API TOC : the user can choose not to install them */ if("api/toc.xml".equals(path)) { Log.log(Log.NOTICE,this, "The API docs for jEdit will not be available (reinstall jEdit if you want them)"); root.add( createNode("http://www.jedit.org/api/overview-summary.html", jEdit.getProperty("helpviewer.toc.online-apidocs"))); } else { Log.log(Log.ERROR,this,e); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( FileNotFoundException e ) { System.out.println("File not found: "+e); }
// in org/gjt/sp/jedit/jEdit.java
catch(FileNotFoundException fnf) { Log.log(Log.DEBUG,jEdit.class,fnf); }
// in org/gjt/sp/jedit/jEdit.java
catch(FileNotFoundException fnf) { //Log.log(Log.DEBUG,jEdit.class,fnf); }
// in org/gjt/sp/jedit/Abbrevs.java
catch(FileNotFoundException fnf) { }
// in org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
catch (FileNotFoundException e) { Log.log(Log.WARNING,this,"Unable to save " + e.getMessage()); }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch (FileNotFoundException e) { Log.log(Log.ERROR,this,"Unable to save buffer " + e); String[] pp = { e.getMessage() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/syntax/ModeProvider.java
catch (FileNotFoundException e1) { InputStream resource = ModeProvider.class.getResourceAsStream(fileName); if (resource == null) error(fileName, e1); grammar = new BufferedInputStream(resource); }
// in org/gjt/sp/jedit/PluginJAR.java
catch(FileNotFoundException fnf) { return null; }
0 0
checked (Lib) IOException 11
            
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
private static Map<String, HistoryModel> loadFromReader(BufferedReader in) throws IOException { Map<String, HistoryModel> result = new HashMap<String, HistoryModel>(); HistoryModel currentModel = null; String line; while((line = in.readLine()) != null) { if(line.length() > 0 && line.charAt(0) == '[' && line.charAt(line.length() - 1) == ']') { if(currentModel != null) { result.put(currentModel.getName(), currentModel); } String modelName = MiscUtilities .escapesToChars(line.substring( 1,line.length() - 1)); currentModel = new HistoryModel( modelName); } else if(currentModel == null) { throw new IOException("History data starts" + " before model name"); } else { currentModel.addElement(MiscUtilities .escapesToChars(line)); } } if(currentModel != null) { result.put(currentModel.getName(),currentModel); } return result; }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
static final int hexval(char c) throws java.io.IOException { switch(c) { case '0' : return 0; case '1' : return 1; case '2' : return 2; case '3' : return 3; case '4' : return 4; case '5' : return 5; case '6' : return 6; case '7' : return 7; case '8' : return 8; case '9' : return 9; case 'a' : case 'A' : return 10; case 'b' : case 'B' : return 11; case 'c' : case 'C' : return 12; case 'd' : case 'D' : return 13; case 'e' : case 'E' : return 14; case 'f' : case 'F' : return 15; } throw new java.io.IOException(); // Should never come here }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
protected void FillBuff() throws java.io.IOException { int i; if (maxNextCharInd == 4096) maxNextCharInd = nextCharInd = 0; try { if ((i = inputStream.read(nextCharBuf, maxNextCharInd, 4096 - maxNextCharInd)) == -1) { inputStream.close(); throw new java.io.IOException(); } else maxNextCharInd += i; return; } catch(java.io.IOException e) { if (bufpos != 0) { --bufpos; backup(0); } else { bufline[bufpos] = line; bufcolumn[bufpos] = column; } throw e; } }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
static List traverseDirForClassesAux( File topDir, File dir ) throws IOException { List list = new ArrayList(); String top = topDir.getAbsolutePath(); File [] children = dir.listFiles(); for (int i=0; i< children.length; i++) { File child = children[i]; if ( child.isDirectory() ) list.addAll( traverseDirForClassesAux( topDir, child ) ); else { String name = child.getAbsolutePath(); if ( isClassFileName( name ) ) { /* Remove absolute (topdir) portion of path and leave package-class part */ if ( name.startsWith( top ) ) name = name.substring( top.length()+1 ); else throw new IOException( "problem parsing paths" ); name = canonicalizeClassName(name); list.add( name ); } } } return list; }
// in org/gjt/sp/jedit/bsh/Remote.java
public static int eval( String url, String text ) throws IOException { String returnValue = null; if ( url.startsWith( "http:" ) ) { returnValue = doHttp( url, text ); } else if ( url.startsWith( "bsh:" ) ) { returnValue = doBsh( url, text ); } else throw new IOException( "Unrecognized URL type." +"Scheme must be http:// or bsh://"); try { return Integer.parseInt( returnValue ); } catch ( Exception e ) { // this convention may change... return 0; } }
// in org/gjt/sp/jedit/io/VFSFile.java
public boolean isBinary(Object session) throws IOException { InputStream in = getVFS()._createInputStream(session,getPath(), false,jEdit.getActiveView()); if(in == null) throw new IOException("Unable to get a Stream for this file "+this); try { return MiscUtilities.isBinary(in); } finally { IOUtilities.closeQuietly(in); } }
// in org/gjt/sp/jedit/io/VFS.java
public static boolean copy(ProgressObserver progress, VFS sourceVFS, Object sourceSession,String sourcePath, VFS targetVFS, Object targetSession,String targetPath, Component comp, boolean canStop, boolean sendVFSUpdate) throws IOException { if (progress != null) progress.setStatus("Initializing"); InputStream in = null; OutputStream out = null; try { VFSFile sourceVFSFile = sourceVFS._getFile(sourceSession, sourcePath, comp); if (sourceVFSFile == null) throw new FileNotFoundException("source path " + sourcePath + " doesn't exists"); if (progress != null) { progress.setMaximum(sourceVFSFile.getLength()); } VFSFile targetVFSFile = targetVFS._getFile(targetSession, targetPath, comp); if (targetVFSFile == null) { String parentTargetPath = MiscUtilities.getParentOfPath(targetPath); VFSFile parentTargetVFSFile = targetVFS._getFile(targetSession, parentTargetPath, comp); if (parentTargetVFSFile == null) throw new FileNotFoundException("target path " + parentTargetPath + " doesn't exists"); if (parentTargetVFSFile.getType() == VFSFile.DIRECTORY) { String targetFilename = MiscUtilities.getFileName(targetPath); targetPath = MiscUtilities.constructPath(parentTargetPath, targetFilename); } else { throw new IOException("The parent of target path is a file"); } } else if (targetVFSFile.getType() == VFSFile.DIRECTORY) { if (targetVFSFile.getPath().equals(sourceVFSFile.getPath())) return false; targetPath = MiscUtilities.constructPath(targetPath, sourceVFSFile.getName()); } in = new BufferedInputStream(sourceVFS._createInputStream(sourceSession, sourcePath, false, comp)); out = new BufferedOutputStream(targetVFS._createOutputStream(targetSession, targetPath, comp)); boolean copyResult = IOUtilities.copyStream(IOBUFSIZE, progress, in, out, canStop); if (sendVFSUpdate) VFSManager.sendVFSUpdate(targetVFS, targetPath, true); return copyResult; } finally { IOUtilities.closeQuietly(in); IOUtilities.closeQuietly(out); } }
// in org/gjt/sp/jedit/proto/jeditresource/PluginResURLConnection.java
public void connect() throws IOException { if(!connected) { if(plugin == null) { in = jEdit.class.getResourceAsStream(resource); } else { PluginJAR[] plugins = jEdit.getPluginJARs(); for(int i = 0; i < plugins.length; i++) { PluginJAR jar = plugins[i]; String jarName =MiscUtilities.getFileName(jar.getPath()).toLowerCase(); if(plugin.equalsIgnoreCase(jarName)) { in = jar.getClassLoader() .getResourceAsStream(resource); break; } } } if(in == null) { throw new IOException("Resource not found: " + plugin + "!" + resource); } connected = true; } }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
public void run() { /* if the VFS supports renaming files, we first * save to #<filename>#save#, then rename that * to <filename>, so that if the save fails, * data will not be lost. * * as of 4.1pre7 we now call vfs.getTwoStageSaveName() * instead of constructing the path directly * since some VFS's might not allow # in filenames. */ boolean vfsRenameCap = (vfs.getCapabilities() & VFS.RENAME_CAP) != 0; boolean wantTwoStage = wantTwoStageSave(buffer); boolean twoStageSave = vfsRenameCap && wantTwoStage; try { String[] args = { vfs.getFileName(path) }; setStatus(jEdit.getProperty("vfs.status.save",args)); // the entire save operation can be aborted... setAbortable(true); path = vfs._canonPath(session,path,view); if(!MiscUtilities.isURL(path)) path = MiscUtilities.resolveSymlinks(path); String savePath; if(twoStageSave) { savePath = vfs.getTwoStageSaveName(path); if (savePath == null) { throw new IOException( "Can't get a temporary path for two-stage save: " + path); } } else { makeBackup(); savePath = path; } OutputStream out = vfs._createOutputStream(session,savePath,view); if(out == null) { buffer.setBooleanProperty(ERROR_OCCURRED,true); return; } try { // this must be after the stream is created or // we deadlock with SSHTools. buffer.readLock(); try { // Can't use buffer.getName() here because // it is not changed until the save is // complete if(path.endsWith(".gz")) buffer.setBooleanProperty(Buffer.GZIPPED,true); else if (buffer.getName().endsWith(".gz")) { // The path do not ends with gz. // The buffer name was .gz. // So it means it's blabla.txt.gz -> blabla.txt, I remove // the gz property buffer.setBooleanProperty(Buffer.GZIPPED, false); } if(buffer.getBooleanProperty(Buffer.GZIPPED)) out = new GZIPOutputStream(out); write(buffer,out); } finally { buffer.readUnlock(); } } finally { IOUtilities.closeQuietly(out); } if(twoStageSave) { makeBackup(); if(!vfs._rename(session,savePath,path,view)) throw new IOException("Rename failed: " + savePath); } if(!twoStageSave) VFSManager.sendVFSUpdate(vfs,path,true); } catch (FileNotFoundException e) { Log.log(Log.ERROR,this,"Unable to save buffer " + e); String[] pp = { e.getMessage() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(UnsupportedCharsetException e) { Log.log(Log.ERROR, this, e, e); String[] pp = { e.getCharsetName() }; VFSManager.error(view,path,"ioerror.unsupported-encoding-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } finally { try { vfs._saveComplete(session,buffer,path,view); if( twoStageSave ) { vfs._finishTwoStageSave(session,buffer,path,view); } // clean up left-over markers file if(!jEdit.getBooleanProperty("persistentMarkers")) vfs._delete(session,Buffer.getMarkersPath(vfs, path),view); vfs._endVFSSession(session,view); } catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); } catch(WorkThread.Abort a) { buffer.setBooleanProperty(ERROR_OCCURRED,true); } } }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
private InputStream getNakedStream() throws IOException { InputStream in = vfs._createInputStream(session,path,false,view); if(in != null) { return in; } throw new IOException("Unable to get a Stream for " + path); }
0 134
            
// in org/gjt/sp/jedit/View.java
private Component restoreSplitConfig(Buffer buffer, String splitConfig) throws IOException // this is where checked exceptions piss me off. this method only uses // a StringReader which can never throw an exception... { if(buffer != null) { return editPane = createEditPane(buffer); } else if(splitConfig == null || splitConfig.trim().length() == 0) { Buffer buf = jEdit.getFirstBuffer(); if (buf == null) { buf = BufferSetManager.createUntitledBuffer(); } return editPane = createEditPane(buf); } Buffer[] buffers = jEdit.getBuffers(); Stack<Object> stack = new Stack<Object>(); // we create a stream tokenizer for parsing a simple // stack-based language StreamTokenizer st = new StreamTokenizer(new StringReader( splitConfig)); st.whitespaceChars(0,' '); /* all printable ASCII characters */ st.wordChars('#','~'); st.commentChar('!'); st.quoteChar('"'); st.eolIsSignificant(false); List<Buffer> editPaneBuffers = new ArrayList<Buffer>(); loop: while (true) { switch(st.nextToken()) { case StreamTokenizer.TT_EOF: break loop; case StreamTokenizer.TT_WORD: if("vertical".equals(st.sval) || "horizontal".equals(st.sval)) { int orientation = "vertical".equals(st.sval) ? JSplitPane.VERTICAL_SPLIT : JSplitPane.HORIZONTAL_SPLIT; int divider = (Integer) stack.pop(); Object obj1 = stack.pop(); Object obj2 = stack.pop(); // Backward compatibility with pre-bufferset versions if (obj1 instanceof Buffer) { Buffer b1 = buffer = (Buffer) obj1; obj1 = editPane = createEditPane(b1); } if (obj2 instanceof Buffer) { Buffer b2 = (Buffer) obj2; obj2 = createEditPane(b2); } stack.push(splitPane = new JSplitPane( orientation, (Component)obj1, (Component)obj2)); splitPane.setOneTouchExpandable(true); splitPane.setBorder(null); splitPane.setMinimumSize( new Dimension(0,0)); splitPane.setDividerLocation(divider); } else if("buffer".equals(st.sval)) { Object obj = stack.pop(); if(obj instanceof Integer) { int index = (Integer) obj; if(index >= 0 && index < buffers.length) buffer = buffers[index]; } else if(obj instanceof String) { String path = (String)obj; buffer = jEdit.getBuffer(path); if (buffer == null) { buffer = jEdit.openTemporary(jEdit.getActiveView(), null, path, true, null); jEdit.commitTemporary(buffer); } } if(buffer == null) buffer = jEdit.getFirstBuffer(); stack.push(buffer); editPaneBuffers.add(buffer); } else if ("buff".equals(st.sval)) { String path = (String)stack.pop(); buffer = jEdit.getBuffer(path); if (buffer == null) { Log.log(Log.WARNING, this, "Buffer " + path + " doesn't exist"); } else { editPaneBuffers.add(buffer); } } else if ("bufferset".equals(st.sval)) { // pop the bufferset scope. Not used anymore but still here for compatibility // with old perspectives stack.pop(); buffer = (Buffer) stack.pop(); editPane = createEditPane(buffer); stack.push(editPane); BufferSet bufferSet = editPane.getBufferSet(); int i = 0; for (Buffer buff : editPaneBuffers) { bufferSet.addBufferAt(buff,i); i++; } editPaneBuffers.clear(); } break; case StreamTokenizer.TT_NUMBER: stack.push((int)st.nval); break; case '"': stack.push(st.sval); break; } } // Backward compatibility with pre-bufferset versions Object obj = stack.peek(); if (obj instanceof Buffer) { obj = editPane = createEditPane((Buffer)obj); } updateGutterBorders(); return (Component)obj; }
// in org/gjt/sp/jedit/pluginmgr/MirrorList.java
private void readXml() throws IOException { String settingsDirectory = jEdit.getSettingsDirectory(); if(settingsDirectory == null) return; File mirrorList = new File(MiscUtilities.constructPath( settingsDirectory,"mirrorList.xml")); if(!mirrorList.exists()) return; InputStream inputStream = null; try { inputStream = new BufferedInputStream(new FileInputStream(mirrorList)); ByteArrayOutputStream out = new ByteArrayOutputStream(); IOUtilities.copyStream(null,inputStream,out, false); xml = out.toString(); } finally { IOUtilities.closeQuietly(inputStream); } }
// in org/gjt/sp/jedit/pluginmgr/MirrorList.java
private void downloadXml(String path) throws IOException { InputStream inputStream = null; try { inputStream = new URL(path).openStream(); ByteArrayOutputStream out = new ByteArrayOutputStream(); IOUtilities.copyStream(null,inputStream,out, false); xml = out.toString(); } finally { IOUtilities.closeQuietly(inputStream); } }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
private static Collection<String> getDeclaredJars(String jarName) throws IOException { Collection<String> jarList = new ArrayList<String>(); PluginJAR pluginJAR = new PluginJAR(new File(jarName)); PluginJAR.PluginCacheEntry pluginCacheEntry = PluginJAR.getPluginCache(pluginJAR); if (pluginCacheEntry == null) { pluginCacheEntry = pluginJAR.generateCache(); } Properties cachedProperties = pluginCacheEntry.cachedProperties; String jars = cachedProperties.getProperty("plugin." + pluginCacheEntry.pluginClass + ".jars"); if (jars != null) { String dir = MiscUtilities.getParentOfPath(pluginJAR.getPath()); StringTokenizer st = new StringTokenizer(jars); while (st.hasMoreTokens()) { String _jarPath = MiscUtilities.constructPath(dir, st.nextToken()); if (new File(_jarPath).exists()) jarList.add(_jarPath); } } jarList.add(jarName); return jarList; }
// in org/gjt/sp/jedit/gui/PingPongList.java
Override public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { return data; }
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
private static Map<String, HistoryModel> loadFromReader(BufferedReader in) throws IOException { Map<String, HistoryModel> result = new HashMap<String, HistoryModel>(); HistoryModel currentModel = null; String line; while((line = in.readLine()) != null) { if(line.length() > 0 && line.charAt(0) == '[' && line.charAt(line.length() - 1) == ']') { if(currentModel != null) { result.put(currentModel.getName(), currentModel); } String modelName = MiscUtilities .escapesToChars(line.substring( 1,line.length() - 1)); currentModel = new HistoryModel( modelName); } else if(currentModel == null) { throw new IOException("History data starts" + " before model name"); } else { currentModel.addElement(MiscUtilities .escapesToChars(line)); } } if(currentModel != null) { result.put(currentModel.getName(),currentModel); } return result; }
// in org/gjt/sp/jedit/PropertyManager.java
void loadSystemProps(InputStream in) throws IOException { loadProps(system,in); }
// in org/gjt/sp/jedit/PropertyManager.java
void loadSystemProps(Reader in) throws IOException { loadProps(system,in); }
// in org/gjt/sp/jedit/PropertyManager.java
void loadSiteProps(InputStream in) throws IOException { loadProps(site,in); }
// in org/gjt/sp/jedit/PropertyManager.java
void loadLocalizationProps(Reader in) throws IOException { if (in == null) localization.clear(); else loadProps(localization,in); }
// in org/gjt/sp/jedit/PropertyManager.java
void loadUserProps(InputStream in) throws IOException { loadProps(user,in); }
// in org/gjt/sp/jedit/PropertyManager.java
void saveUserProps(OutputStream out) throws IOException { user.store(out,"jEdit properties"); }
// in org/gjt/sp/jedit/PropertyManager.java
Properties loadPluginProps(InputStream in) throws IOException { Properties plugin = new Properties(); loadProps(plugin,in); plugins.add(plugin); return plugin; }
// in org/gjt/sp/jedit/PropertyManager.java
private static void loadProps(Properties into, InputStream in) throws IOException { try { into.load(in); } finally { in.close(); } }
// in org/gjt/sp/jedit/PropertyManager.java
private static void loadProps(Properties into, Reader in) throws IOException { try { into.load(in); } finally { in.close(); } }
// in org/gjt/sp/jedit/bsh/CommandLineReader.java
public int read() throws IOException { int b; if ( state == sentSemi ) { state = lastCharNL; return '\n'; } // skip CR while ( (b = in.read()) == '\r' ); if ( b == '\n' ) if ( state == lastCharNL ) { b = ';'; state = sentSemi; } else state = lastCharNL; else state = normal; return b; }
// in org/gjt/sp/jedit/bsh/CommandLineReader.java
public int read(char buff[], int off, int len) throws IOException { int b = read(); if ( b == -1 ) return -1; // EOF, not zero read apparently else { buff[off]=(char)b; return 1; } }
// in org/gjt/sp/jedit/bsh/Parser.java
public static void main( String [] args ) throws IOException, ParseException { boolean print = false; int i=0; if ( args[0].equals("-p") ) { i++; print=true; } for(; i< args.length; i++) { Reader in = new FileReader(args[i]); Parser parser = new Parser(in); parser.setRetainComments(true); while( !parser.Line()/*eof*/ ) if ( print ) System.out.println( parser.popNode() ); } }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
static final int hexval(char c) throws java.io.IOException { switch(c) { case '0' : return 0; case '1' : return 1; case '2' : return 2; case '3' : return 3; case '4' : return 4; case '5' : return 5; case '6' : return 6; case '7' : return 7; case '8' : return 8; case '9' : return 9; case 'a' : case 'A' : return 10; case 'b' : case 'B' : return 11; case 'c' : case 'C' : return 12; case 'd' : case 'D' : return 13; case 'e' : case 'E' : return 14; case 'f' : case 'F' : return 15; } throw new java.io.IOException(); // Should never come here }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
protected void FillBuff() throws java.io.IOException { int i; if (maxNextCharInd == 4096) maxNextCharInd = nextCharInd = 0; try { if ((i = inputStream.read(nextCharBuf, maxNextCharInd, 4096 - maxNextCharInd)) == -1) { inputStream.close(); throw new java.io.IOException(); } else maxNextCharInd += i; return; } catch(java.io.IOException e) { if (bufpos != 0) { --bufpos; backup(0); } else { bufline[bufpos] = line; bufcolumn[bufpos] = column; } throw e; } }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
protected char ReadByte() throws java.io.IOException { if (++nextCharInd >= maxNextCharInd) FillBuff(); return nextCharBuf[nextCharInd]; }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
public char BeginToken() throws java.io.IOException { if (inBuf > 0) { --inBuf; if (++bufpos == bufsize) bufpos = 0; tokenBegin = bufpos; return buffer[bufpos]; } tokenBegin = 0; bufpos = -1; return readChar(); }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
public char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; if (++bufpos == bufsize) bufpos = 0; return buffer[bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if ((buffer[bufpos] = c = ReadByte()) == '\\') { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = ReadByte()) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch(java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = ReadByte()) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval(ReadByte()) << 8 | hexval(ReadByte()) << 4 | hexval(ReadByte())); column += 4; } catch(java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; else { backup(backSlashCnt - 1); return '\\'; } } else { UpdateLineColumn(c); return (c); } }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public void addClassPath( URL path ) throws IOException { if ( baseLoader == null ) setClassPath( new URL [] { path } ); else { // opportunity here for listener in classpath baseLoader.addURL( path ); baseClassPath.add( path ); classLoaderChanged(); } }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public void add( URL url ) throws IOException { path.add(url); if ( mapsInitialized ) map( url ); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
synchronized void map( URL url ) throws IOException { String name = url.getFile(); File f = new File( name ); if ( f.isDirectory() ) { classMapping( "Directory "+ f.toString() ); map( traverseDirForClasses( f ), new DirClassSource(f) ); } else if ( isArchiveFileName( name ) ) { classMapping("Archive: "+url ); map( searchJarForClasses( url ), new JarClassSource(url) ); } /* else if ( isClassFileName( name ) ) map( looseClass( name ), url ); */ else { String s = "Not a classpath component: "+ name ; errorWhileMapping( s ); } }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
static String [] traverseDirForClasses( File dir ) throws IOException { List list = traverseDirForClassesAux( dir, dir ); return (String[])list.toArray( new String[0] ); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
static List traverseDirForClassesAux( File topDir, File dir ) throws IOException { List list = new ArrayList(); String top = topDir.getAbsolutePath(); File [] children = dir.listFiles(); for (int i=0; i< children.length; i++) { File child = children[i]; if ( child.isDirectory() ) list.addAll( traverseDirForClassesAux( topDir, child ) ); else { String name = child.getAbsolutePath(); if ( isClassFileName( name ) ) { /* Remove absolute (topdir) portion of path and leave package-class part */ if ( name.startsWith( top ) ) name = name.substring( top.length()+1 ); else throw new IOException( "problem parsing paths" ); name = canonicalizeClassName(name); list.add( name ); } } } return list; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
static String [] searchJarForClasses( URL jar ) throws IOException { Vector v = new Vector(); InputStream in = jar.openStream(); ZipInputStream zin = new ZipInputStream(in); ZipEntry ze; while( (ze= zin.getNextEntry()) != null ) { String name=ze.getName(); if ( isClassFileName( name ) ) v.addElement( canonicalizeClassName(name) ); } zin.close(); String [] sa = new String [v.size()]; v.copyInto(sa); return sa; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
private synchronized void writeObject(java.io.ObjectOutputStream s) throws IOException { // clear name resolvers... don't know if this is necessary. names = null; s.defaultWriteObject(); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
public void addClassPath( URL path ) throws IOException { }
// in org/gjt/sp/jedit/bsh/Remote.java
public static int eval( String url, String text ) throws IOException { String returnValue = null; if ( url.startsWith( "http:" ) ) { returnValue = doHttp( url, text ); } else if ( url.startsWith( "bsh:" ) ) { returnValue = doBsh( url, text ); } else throw new IOException( "Unrecognized URL type." +"Scheme must be http:// or bsh://"); try { return Integer.parseInt( returnValue ); } catch ( Exception e ) { // this convention may change... return 0; } }
// in org/gjt/sp/jedit/bsh/Remote.java
private static void sendLine( String line, OutputStream outPipe ) throws IOException { outPipe.write( line.getBytes() ); outPipe.flush(); }
// in org/gjt/sp/jedit/bsh/Remote.java
static String getFile( String name ) throws FileNotFoundException, IOException { StringBuilder sb = new StringBuilder(); BufferedReader bin = new BufferedReader( new FileReader( name ) ); String line; while ( (line=bin.readLine()) != null ) sb.append( line ).append( "\n" ); return sb.toString(); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public static void main( String [] args ) { if ( args.length > 0 ) { String filename = args[0]; String [] bshArgs; if ( args.length > 1 ) { bshArgs = new String [ args.length -1 ]; System.arraycopy( args, 1, bshArgs, 0, args.length-1 ); } else bshArgs = new String [0]; Interpreter interpreter = new Interpreter(); //System.out.println("run i = "+interpreter); interpreter.setu( "bsh.args", bshArgs ); try { Object result = interpreter.source( filename, interpreter.globalNameSpace ); if ( result instanceof Class ) try { invokeMain( (Class)result, bshArgs ); } catch ( Exception e ) { Object o = e; if ( e instanceof InvocationTargetException ) o = ((InvocationTargetException)e) .getTargetException(); System.err.println( "Class: "+result+" main method threw exception:"+o); } } catch ( FileNotFoundException e ) { System.out.println("File not found: "+e); } catch ( TargetError e ) { System.out.println("Script threw exception: "+e); if ( e.inNativeCode() ) e.printStackTrace( DEBUG, System.err ); } catch ( EvalError e ) { System.out.println("Evaluation Error: "+e); } catch ( IOException e ) { System.out.println("I/O Error: "+e); } } else { // Workaround for JDK bug 4071281, where system.in.available() // returns too large a value. This bug has been fixed in JDK 1.2. InputStream src; if ( System.getProperty("os.name").startsWith("Windows") && System.getProperty("java.version").startsWith("1.1.")) { src = new FilterInputStream(System.in) { public int available() throws IOException { return 0; } }; } else src = System.in; Reader in = new CommandLineReader( new InputStreamReader(src)); Interpreter interpreter = new Interpreter( in, System.out, System.err, true ); interpreter.run(); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public int available() throws IOException { return 0; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object source( String filename, NameSpace nameSpace ) throws FileNotFoundException, IOException, EvalError { File file = pathToFile( filename ); if ( Interpreter.DEBUG ) debug("Sourcing file: "+file); Reader sourceIn = new BufferedReader( new FileReader(file) ); try { return eval( sourceIn, nameSpace, filename ); } finally { sourceIn.close(); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object source( String filename ) throws FileNotFoundException, IOException, EvalError { return source( filename, globalNameSpace ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public File pathToFile( String fileName ) throws IOException { File file = new File( fileName ); // if relative, fix up to bsh.cwd if ( !file.isAbsolute() ) { String cwd = (String)getu("bsh.cwd"); file = new File( cwd + File.separator + fileName ); } // The canonical file name is also absolute. // No need for getAbsolutePath() here... return new File( file.getCanonicalPath() ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
private void readObject(ObjectInputStream stream) throws java.io.IOException, ClassNotFoundException { stream.defaultReadObject(); // set transient fields if ( console != null ) { setOut( console.getOut() ); setErr( console.getErr() ); } else { setOut( System.out ); setErr( System.err ); } }
// in org/gjt/sp/jedit/Registers.java
private static String stripEOLChars(String selection) throws IOException { boolean trailingEOL = selection.endsWith("\n") || selection.endsWith(System.getProperty( "line.separator")); // Some Java versions return the clipboard // contents using the native line separator, // so have to convert it here BufferedReader in = new BufferedReader( new StringReader(selection)); StringBuilder buf = new StringBuilder(selection.length()); String line; while((line = in.readLine()) != null) { // broken Eclipse workaround! // 24 Febuary 2004 if(line.endsWith("\0")) { line = line.substring(0, line.length() - 1); } buf.append(line); buf.append('\n'); } // remove trailing \n if(!trailingEOL && buf.length() != 0) buf.setLength(buf.length() - 1); return buf.toString(); }
// in org/gjt/sp/jedit/io/UrlVFS.java
public InputStream _createInputStream(Object session, String path, boolean ignoreErrors, Component comp) throws IOException { try { return new URL(path).openStream(); } catch(MalformedURLException mu) { Log.log(Log.ERROR,this,mu); String[] args = { mu.getMessage() }; VFSManager.error(comp,path,"ioerror.badurl",args); return null; } }
// in org/gjt/sp/jedit/io/UrlVFS.java
public OutputStream _createOutputStream(Object session, String path, Component comp) throws IOException { try { return new URL(path).openConnection() .getOutputStream(); } catch(MalformedURLException mu) { Log.log(Log.ERROR,this,mu); String[] args = { mu.getMessage() }; VFSManager.error(comp,path,"ioerror.badurl",args); return null; } }
// in org/gjt/sp/jedit/io/VFSFile.java
public boolean isBinary(Object session) throws IOException { InputStream in = getVFS()._createInputStream(session,getPath(), false,jEdit.getActiveView()); if(in == null) throw new IOException("Unable to get a Stream for this file "+this); try { return MiscUtilities.isBinary(in); } finally { IOUtilities.closeQuietly(in); } }
// in org/gjt/sp/jedit/io/CopyFileWorker.java
private void copy(Object vfsSession, VFS vfs, String sourcePath, String sourceName, String targetPath) throws IOException, InterruptedException { String name = getTargetName(vfsSession, vfs, targetPath, sourceName); if (name == null) { return; } String targetName = MiscUtilities.constructPath(targetPath, name); CountDownLatch latch = new CountDownLatch(1); ThreadUtilities.runInBackground(new CopyFileWorker(comp, sourcePath, targetName, latch)); latch.await(); }
// in org/gjt/sp/jedit/io/CopyFileWorker.java
private String getTargetName(Object session, VFS vfs, String path, String baseName) throws IOException { if (behavior == Behavior.OVERWRITE) { // We want to overwrite, no need to check anything return baseName; } String s = MiscUtilities.constructPath(target, baseName); VFSFile file = vfs._getFile(session, s, comp); if (file == null) { // The target file do not exist, perfect return baseName; } if (behavior == Behavior.SKIP) return null; String extension = MiscUtilities.getFileExtension(baseName); String nameNoExtension = MiscUtilities.getBaseName(baseName); for (int i = 1;i<1000;i++) { String name = nameNoExtension + "-copy-" + i; if (extension != null) name += extension; s = MiscUtilities.constructPath(path, name); file = vfs._getFile(session, s, comp); if (file == null) return name; } return null; }
// in org/gjt/sp/jedit/io/EncodingWithBOM.java
public Reader getTextReader(InputStream in) throws IOException { byte[] actualMark = new byte[bom.length]; int count = in.read(actualMark); if (count < bom.length || !Arrays.equals(actualMark, bom)) { throw new MalformedInputException(0); } return plain.getTextReader(in); }
// in org/gjt/sp/jedit/io/EncodingWithBOM.java
public Writer getTextWriter(OutputStream out) throws IOException { out.write(bom); return plain.getTextWriter(out); }
// in org/gjt/sp/jedit/io/EncodingWithBOM.java
public Reader getPermissiveTextReader(InputStream in) throws IOException { byte[] actualMark = new byte[bom.length]; int count = in.read(actualMark); if (count < bom.length || !Arrays.equals(actualMark, bom)) { // Concatenate the non-BOM bytes and the rest of // input so that the non-BOM bytes are reinterepreted // as some characters. in = new SequenceInputStream( new ByteArrayInputStream(actualMark, 0, count), in); } return plain.getPermissiveTextReader(in); }
// in org/gjt/sp/jedit/io/EncodingWithBOM.java
public String detectEncoding(InputStream sample) throws IOException { byte[] mark = new byte[4]; int count = sample.read(mark); byte low = (byte)(BOM16 & 0xff); byte high = (byte)((BOM16 >> 8) & 0xff); if (count >= 4) { if (mark[0] == low && mark[1] == high && mark[2] == 0x00 && mark[3] == 0x00) { return "X-UTF-32LE-BOM"; } else if (mark[0] == 0x00 && mark[1] == 0x00 && mark[2] == high && mark[3] == low) { return "X-UTF-32BE-BOM"; } } if (count >= 2) { if (mark[0] == low && mark[1] == high) { return "x-UTF-16LE-BOM"; } else if (mark[0] == high && mark[1] == low) { // "x-UTF-16BE-BOM" does not available. // But an encoder for "UTF-16" actually uses // big endian with corresponding BOM. It just // works as "UTF-16BE with BOM". return "UTF-16"; } } if (count >= UTF8BOM.length) { int i = 0; while (i < UTF8BOM.length) { if (mark[i] != UTF8BOM[i]) { break; } ++i; } if (i == UTF8BOM.length) { return "UTF-8Y"; } } return null; }
// in org/gjt/sp/jedit/io/XMLEncodingDetector.java
public String detectEncoding(InputStream sample) throws IOException { // Length of longest XML PI used for encoding detection. // <?xml version="1.0" encoding="................"?> final int XML_PI_LENGTH = 50; byte[] _xmlPI = new byte[XML_PI_LENGTH]; int offset = 0; int count; while((count = sample.read(_xmlPI,offset, XML_PI_LENGTH - offset)) != -1) { offset += count; if(offset == XML_PI_LENGTH) break; } return getXMLEncoding(new String(_xmlPI,0,offset,"ASCII")); }
// in org/gjt/sp/jedit/io/RegexEncodingDetector.java
public String detectEncoding(InputStream sample) throws IOException { InputStreamReader reader = new InputStreamReader(sample); final int bufferSize = 1024; char[] buffer = new char[bufferSize]; int readSize = reader.read(buffer, 0, bufferSize); if (readSize > 0) { Matcher matcher = pattern.matcher( CharBuffer.wrap(buffer, 0, readSize)); // Tracking of this implicit state within Matcher // is required to know where is the start of // replacement after calling appendReplacement(). int appendPosition = 0; while (matcher.find()) { String extracted = extractReplacement( matcher, appendPosition, replacement); if (EncodingServer.hasEncoding(extracted)) { return extracted; } appendPosition = matcher.end(); } } return null; }
// in org/gjt/sp/jedit/io/AutoDetection.java
public static boolean isGzipped(InputStream sample) throws IOException { int magic1 = GZIPInputStream.GZIP_MAGIC & 0xff; int magic2 = (GZIPInputStream.GZIP_MAGIC >> 8) & 0xff; return sample.read() == magic1 && sample.read() == magic2; }
// in org/gjt/sp/jedit/io/AutoDetection.java
public static String getDetectedEncoding(BufferedInputStream markedStream) throws IOException { List<EncodingDetector> detectors = getEncodingDetectors(); for (EncodingDetector detector: detectors) { // FIXME: Here the method reset() can fail if the // previous detector read more than buffer size of // markedStream. markedStream.reset(); // Wrap once more so that calling mark() // or reset() in detectEncoding() don't // alter the mark position of markedStream. String detected = detector.detectEncoding( new BufferedInputStream(markedStream)); if (detected != null) { return detected; } } return null; }
// in org/gjt/sp/jedit/io/AutoDetection.java
public BufferedInputStream getRewindedStream() throws IOException { markedStream.reset(); return markedStream; }
// in org/gjt/sp/jedit/io/CharsetEncoding.java
public Reader getTextReader(InputStream in) throws IOException { // Pass the decoder explicitly to report a decode error // as an exception instead of replacing with "\uFFFD". // The form "InputStreamReader(in, encoding)" seemed to use // CodingErrorAction.REPLACE internally. return new InputStreamReader(in, body.newDecoder()); }
// in org/gjt/sp/jedit/io/CharsetEncoding.java
public Writer getTextWriter(OutputStream out) throws IOException { // Pass the encoder explicitly because of same reason // in getTextReader(); return new OutputStreamWriter(out, body.newEncoder()); }
// in org/gjt/sp/jedit/io/CharsetEncoding.java
public Reader getPermissiveTextReader(InputStream in) throws IOException { // Use REPLACE action to indicate where the coding error // happened by the replacement character "\uFFFD". CharsetDecoder permissive = body.newDecoder(); permissive.onMalformedInput(CodingErrorAction.REPLACE); permissive.onUnmappableCharacter(CodingErrorAction.REPLACE); return new InputStreamReader(in, permissive); }
// in org/gjt/sp/jedit/io/FileVFS.java
Override public String _canonPath(Object session, String path, Component comp) throws IOException { return MiscUtilities.canonPath(path); }
// in org/gjt/sp/jedit/io/FileVFS.java
Override public void _backup(Object session, String path, Component comp) throws IOException { File file = new File(path); if (!file.exists()) return; MiscUtilities.saveBackup(file); }
// in org/gjt/sp/jedit/io/FileVFS.java
Override public InputStream _createInputStream(Object session, String path, boolean ignoreErrors, Component comp) throws IOException { try { return new FileInputStream(path); } catch(IOException io) { if(ignoreErrors) return null; else throw io; } }
// in org/gjt/sp/jedit/io/FileVFS.java
Override public OutputStream _createOutputStream(Object session, String path, Component comp) throws IOException { return new FileOutputStream(path); }
// in org/gjt/sp/jedit/io/EncodingServer.java
public static Reader getTextReader(InputStream in, String encoding) throws IOException { return getEncoding(encoding).getTextReader(in); }
// in org/gjt/sp/jedit/io/EncodingServer.java
public static Writer getTextWriter(OutputStream out, String encoding) throws IOException { return getEncoding(encoding).getTextWriter(out); }
// in org/gjt/sp/jedit/io/VFS.java
public static boolean copy(ProgressObserver progress, VFS sourceVFS, Object sourceSession,String sourcePath, VFS targetVFS, Object targetSession,String targetPath, Component comp, boolean canStop) throws IOException { return copy(progress, sourceVFS, sourceSession, sourcePath, targetVFS, targetSession, targetPath, comp, canStop, true); }
// in org/gjt/sp/jedit/io/VFS.java
public static boolean copy(ProgressObserver progress, VFS sourceVFS, Object sourceSession,String sourcePath, VFS targetVFS, Object targetSession,String targetPath, Component comp, boolean canStop, boolean sendVFSUpdate) throws IOException { if (progress != null) progress.setStatus("Initializing"); InputStream in = null; OutputStream out = null; try { VFSFile sourceVFSFile = sourceVFS._getFile(sourceSession, sourcePath, comp); if (sourceVFSFile == null) throw new FileNotFoundException("source path " + sourcePath + " doesn't exists"); if (progress != null) { progress.setMaximum(sourceVFSFile.getLength()); } VFSFile targetVFSFile = targetVFS._getFile(targetSession, targetPath, comp); if (targetVFSFile == null) { String parentTargetPath = MiscUtilities.getParentOfPath(targetPath); VFSFile parentTargetVFSFile = targetVFS._getFile(targetSession, parentTargetPath, comp); if (parentTargetVFSFile == null) throw new FileNotFoundException("target path " + parentTargetPath + " doesn't exists"); if (parentTargetVFSFile.getType() == VFSFile.DIRECTORY) { String targetFilename = MiscUtilities.getFileName(targetPath); targetPath = MiscUtilities.constructPath(parentTargetPath, targetFilename); } else { throw new IOException("The parent of target path is a file"); } } else if (targetVFSFile.getType() == VFSFile.DIRECTORY) { if (targetVFSFile.getPath().equals(sourceVFSFile.getPath())) return false; targetPath = MiscUtilities.constructPath(targetPath, sourceVFSFile.getName()); } in = new BufferedInputStream(sourceVFS._createInputStream(sourceSession, sourcePath, false, comp)); out = new BufferedOutputStream(targetVFS._createOutputStream(targetSession, targetPath, comp)); boolean copyResult = IOUtilities.copyStream(IOBUFSIZE, progress, in, out, canStop); if (sendVFSUpdate) VFSManager.sendVFSUpdate(targetVFS, targetPath, true); return copyResult; } finally { IOUtilities.closeQuietly(in); IOUtilities.closeQuietly(out); } }
// in org/gjt/sp/jedit/io/VFS.java
public static boolean copy(ProgressObserver progress, String sourcePath,String targetPath, Component comp, boolean canStop, boolean sendVFSUpdate) throws IOException { VFS sourceVFS = VFSManager.getVFSForPath(sourcePath); Object sourceSession = sourceVFS.createVFSSession(sourcePath, comp); if (sourceSession == null) { Log.log(Log.WARNING, VFS.class, "Unable to get a valid session from " + sourceVFS + " for path " + sourcePath); return false; } VFS targetVFS = VFSManager.getVFSForPath(targetPath); Object targetSession = targetVFS.createVFSSession(targetPath, comp); if (targetSession == null) { Log.log(Log.WARNING, VFS.class, "Unable to get a valid session from " + targetVFS + " for path " + targetPath); return false; } return copy(progress, sourceVFS, sourceSession, sourcePath, targetVFS, targetSession, targetPath, comp,canStop, sendVFSUpdate); }
// in org/gjt/sp/jedit/io/VFS.java
public static boolean copy(ProgressObserver progress, String sourcePath,String targetPath, Component comp, boolean canStop) throws IOException { return copy(progress, sourcePath, targetPath, comp, canStop, true); }
// in org/gjt/sp/jedit/io/VFS.java
public String _canonPath(Object session, String path, Component comp) throws IOException { return path; }
// in org/gjt/sp/jedit/io/VFS.java
public String[] _listDirectory(Object session, String directory, String glob, boolean recursive, Component comp ) throws IOException { String[] retval = _listDirectory(session, directory, glob, recursive, comp, true, false); return retval; }
// in org/gjt/sp/jedit/io/VFS.java
public String[] _listDirectory(Object session, String directory, String glob, boolean recursive, Component comp, boolean skipBinary, boolean skipHidden) throws IOException { VFSFileFilter filter = new GlobVFSFileFilter(glob); return _listDirectory(session, directory, filter, recursive, comp, skipBinary, skipHidden); }
// in org/gjt/sp/jedit/io/VFS.java
public String[] _listDirectory(Object session, String directory, VFSFileFilter filter, boolean recursive, Component comp, boolean skipBinary, boolean skipHidden) throws IOException { List<String> files = new ArrayList<String>(100); listFiles(session,new HashSet<String>(), files,directory,filter, recursive, comp, skipBinary, skipHidden); String[] retVal = files.toArray(new String[files.size()]); Arrays.sort(retVal,new StandardUtilities.StringCompare<String>(true)); return retVal; }
// in org/gjt/sp/jedit/io/VFS.java
public VFSFile[] _listFiles(Object session, String directory, Component comp) throws IOException { VFSManager.error(comp,directory,"vfs.not-supported.list",new String[] { name }); return null; }
// in org/gjt/sp/jedit/io/VFS.java
public VFSFile _getFile(Object session, String path, Component comp) throws IOException { return null; }
// in org/gjt/sp/jedit/io/VFS.java
public boolean _delete(Object session, String path, Component comp) throws IOException { return false; }
// in org/gjt/sp/jedit/io/VFS.java
public boolean _rename(Object session, String from, String to, Component comp) throws IOException { return false; }
// in org/gjt/sp/jedit/io/VFS.java
public boolean _mkdir(Object session, String directory, Component comp) throws IOException { return false; }
// in org/gjt/sp/jedit/io/VFS.java
public void _backup(Object session, String path, Component comp) throws IOException { // File systems do not like some characters, which // may be part of a general path. Let's get rid of them. String sForeignChars = ":*?\"<>|"; // Construct a regex from sForeignChars StringBuilder sbForeignCharsEsc = new StringBuilder(20); for (int i = 0; i < sForeignChars.length(); i++) { sbForeignCharsEsc.append("\\"); sbForeignCharsEsc.append(sForeignChars.charAt(i)); } String pathNorm = path.replaceAll("[" + sbForeignCharsEsc + "]", "_"); // maybe the file is not applicable to local filesystem // but don't worry - for backup purposes it may be out // of a real filesystem File file = new File(pathNorm); File backupDir = MiscUtilities.prepareBackupDirectory(file); if (!backupDir.exists()) { // Usually that means there is no specified backup // directory. Log.log(Log.WARNING, VFS.class, "Backup of file " + path + " failed. Directory " + backupDir + " does not exist."); return; } File backupFile = MiscUtilities.prepareBackupFile(file, backupDir); if (backupFile == null) { return; } // do copy using VFS.copy VFS vfsDst = VFSManager.getVFSForPath(backupFile.getPath()); Object sessionDst = vfsDst.createVFSSessionSafe( backupFile.getPath(), comp); if (sessionDst == null) { return; } try { VFS vfsSrc = VFSManager.getVFSForPath(path); if (!copy(null, vfsSrc, session, path, vfsDst, sessionDst, backupFile.getPath(), comp, true)) { Log.log(Log.WARNING, VFS.class, "Backup of file " + path + " failed. Copy to " + backupFile + " failed."); } } finally { vfsDst._endVFSSession(sessionDst, comp); } }
// in org/gjt/sp/jedit/io/VFS.java
public InputStream _createInputStream(Object session, String path, boolean ignoreErrors, Component comp) throws IOException { VFSManager.error(comp,path,"vfs.not-supported.load",new String[] { name }); return null; }
// in org/gjt/sp/jedit/io/VFS.java
public OutputStream _createOutputStream(Object session, String path, Component comp) throws IOException { VFSManager.error(comp,path,"vfs.not-supported.save",new String[] { name }); return null; }
// in org/gjt/sp/jedit/io/VFS.java
public void _saveComplete(Object session, Buffer buffer, String path, Component comp) throws IOException {}
// in org/gjt/sp/jedit/io/VFS.java
public void _finishTwoStageSave(Object session, Buffer buffer, String path, Component comp) throws IOException { }
// in org/gjt/sp/jedit/io/VFS.java
public void _endVFSSession(Object session, Component comp) throws IOException { }
// in org/gjt/sp/jedit/io/VFS.java
private void listFiles(Object session, Collection<String> stack, List<String> files, String directory, VFSFileFilter filter, boolean recursive, Component comp, boolean skipBinary, boolean skipHidden) throws IOException { if (recursive && !MiscUtilities.isURL(directory)) { String resolvedPath = MiscUtilities.resolveSymlinks(directory); /* * If looking at a symlink, do not traverse the * resolved path more than once. */ if (!directory.equals(resolvedPath)) { if (stack.contains(resolvedPath)) { Log.log(Log.ERROR,this, "Recursion in listFiles(): " + directory); return; } stack.add(resolvedPath); } } Thread ct = Thread.currentThread(); WorkThread wt = null; if (ct instanceof WorkThread) { wt = (WorkThread) ct; } VFSFile[] _files = _listFiles(session,directory, comp); if(_files == null || _files.length == 0) return; for(int i = 0; i < _files.length; i++) { if (wt != null && wt.isAborted() || ct.isInterrupted()) break; VFSFile file = _files[i]; if (skipHidden && (file.isHidden() || MiscUtilities.isBackup(file.getName()))) continue; if(!filter.accept(file)) continue; if(file.getType() == VFSFile.DIRECTORY || file.getType() == VFSFile.FILESYSTEM) { if(recursive) { String canonPath = _canonPath(session, file.getPath(),comp); listFiles(session,stack,files, canonPath,filter,recursive, comp, skipBinary, skipHidden); } } else // It's a regular file { if (skipBinary) { try { if (file.isBinary(session)) { Log.log(Log.NOTICE,this ,file.getPath() + ": skipped as a binary file"); continue; } } catch(IOException e) { Log.log(Log.ERROR,this,e); // may be not binary... } } files.add(file.getPath()); } } }
// in org/gjt/sp/jedit/proto/jeditresource/PluginResURLConnection.java
public void connect() throws IOException { if(!connected) { if(plugin == null) { in = jEdit.class.getResourceAsStream(resource); } else { PluginJAR[] plugins = jEdit.getPluginJARs(); for(int i = 0; i < plugins.length; i++) { PluginJAR jar = plugins[i]; String jarName =MiscUtilities.getFileName(jar.getPath()).toLowerCase(); if(plugin.equalsIgnoreCase(jarName)) { in = jar.getClassLoader() .getResourceAsStream(resource); break; } } } if(in == null) { throw new IOException("Resource not found: " + plugin + "!" + resource); } connected = true; } }
// in org/gjt/sp/jedit/proto/jeditresource/PluginResURLConnection.java
public InputStream getInputStream() throws IOException { connect(); return in; }
// in org/gjt/sp/jedit/proto/jeditresource/Handler.java
public URLConnection openConnection(URL url) throws IOException { PluginResURLConnection c = new PluginResURLConnection(url); c.connect(); return c; }
// in org/gjt/sp/jedit/jEdit.java
private static Reader getResourceAsUTF8Text(String name) throws IOException { InputStream bytes = jEdit.class.getResourceAsStream(name); if (bytes == null) { return null; } Reader text = null; try { // Using our CharsetEncoding to reliably detect // encoding errors. CharsetEncoding utf8 = new CharsetEncoding("UTF-8"); text = utf8.getTextReader(bytes); } finally { if (text == null) { bytes.close(); } } return text; }
// in org/gjt/sp/jedit/bufferio/BufferIORequest.java
protected Reader autodetect(InputStream in) throws IOException { return MiscUtilities.autodetect(in, buffer); }
// in org/gjt/sp/jedit/bufferio/BufferIORequest.java
protected SegmentBuffer read(Reader in, long length, boolean insert) throws IOException { /* we guess an initial size for the array */ IntegerArray endOffsets = new IntegerArray( Math.max(1,(int)(length / 50))); // only true if the file size is known boolean trackProgress = !buffer.isTemporary() && length != 0; if(trackProgress) { setMaximum(length); setValue(0); } // if the file size is not known, start with a resonable // default buffer size if(length == 0) length = IOBUFSIZE; SegmentBuffer seg = new SegmentBuffer((int)length + 1); char[] buf = new char[IOBUFSIZE]; /* Number of characters in 'buf' array. InputStream.read() doesn't always fill the array (eg, the file size is not a multiple of IOBUFSIZE, or it is a GZipped file, etc) */ int len; // True if a \n was read after a \r. Usually // means this is a DOS/Windows file boolean CRLF = false; // A \r was read, hence a MacOS file boolean CROnly = false; // Was the previous read character a \r? // If we read a \n and this is true, we assume // we have a DOS/Windows file boolean lastWasCR = false; // Number of lines read. Every 100 lines, we update the // progress bar int lineCount = 0; while((len = in.read(buf,0,buf.length)) != -1) { // Offset of previous line, relative to // the start of the I/O buffer (NOT // relative to the start of the document) int lastLine = 0; for(int i = 0; i < len; i++) { // Look for line endings. switch(buf[i]) { case '\r': // If we read a \r and // lastWasCR is also true, // it is probably a Mac file // (\r\r in stream) if(lastWasCR) { CROnly = true; CRLF = false; } // Otherwise set a flag, // so that \n knows that last // was a \r else { lastWasCR = true; } // Insert a line seg.append(buf,lastLine,i - lastLine); seg.append('\n'); endOffsets.add(seg.count); if(trackProgress && lineCount++ % PROGRESS_INTERVAL == 0) setValue(seg.count); // This is i+1 to take the // trailing \n into account lastLine = i + 1; break; case '\n': /* If lastWasCR is true, we just read a \r followed by a \n. We specify that this is a Windows file, but take no further action and just ignore the \r. */ if(lastWasCR) { CROnly = false; CRLF = true; lastWasCR = false; /* Bump lastLine so that the next line doesn't erronously pick up the \r */ lastLine = i + 1; } /* Otherwise, we found a \n that follows some other * character, hence we have a Unix file */ else { CROnly = false; CRLF = false; seg.append(buf,lastLine, i - lastLine); seg.append('\n'); endOffsets.add(seg.count); if(trackProgress && lineCount++ % PROGRESS_INTERVAL == 0) setValue(seg.count); lastLine = i + 1; } break; default: /* If we find some other character that follows a \r, so it is not a Windows file, and probably a Mac file */ if(lastWasCR) { CROnly = true; CRLF = false; lastWasCR = false; } break; } } if(trackProgress) setValue(seg.count); // Add remaining stuff from buffer seg.append(buf,lastLine,len - lastLine); } setAbortable(false); String lineSeparator; if(seg.count == 0) { // fix for "[ 865589 ] 0-byte files should open using // the default line seperator" lineSeparator = jEdit.getProperty( "buffer.lineSeparator", System.getProperty("line.separator")); } else if(CRLF) lineSeparator = "\r\n"; else if(CROnly) lineSeparator = "\r"; else lineSeparator = "\n"; // Chop trailing newline and/or ^Z (if any) int bufferLength = seg.count; if(bufferLength != 0) { char ch = seg.array[bufferLength - 1]; if(ch == 0x1a /* DOS ^Z */) seg.count--; } buffer.setBooleanProperty(Buffer.TRAILING_EOL,false); if(bufferLength != 0 && jEdit.getBooleanProperty("stripTrailingEOL")) { char ch = seg.array[bufferLength - 1]; if(ch == '\n') { buffer.setBooleanProperty(Buffer.TRAILING_EOL,true); seg.count--; endOffsets.setSize(endOffsets.getSize() - 1); } } // add a line marker at the end for proper offset manager // operation endOffsets.add(seg.count + 1); // to avoid having to deal with read/write locks and such, // we insert the loaded data into the buffer in the // post-load cleanup runnable, which runs in the AWT thread. if(!insert) { buffer.setProperty(LOAD_DATA,seg); buffer.setProperty(END_OFFSETS,endOffsets); buffer.setProperty(NEW_PATH,path); if(lineSeparator != null) buffer.setProperty(JEditBuffer.LINESEP,lineSeparator); } // used in insert() return seg; }
// in org/gjt/sp/jedit/bufferio/BufferIORequest.java
protected void write(Buffer buffer, OutputStream out) throws IOException { String encodingName = buffer.getStringProperty(JEditBuffer.ENCODING); Encoding encoding = EncodingServer.getEncoding(encodingName); Writer writer = encoding.getTextWriter( new BufferedOutputStream(out, getByteIOBufferSize())); Segment lineSegment = new Segment(); String newline = buffer.getStringProperty(JEditBuffer.LINESEP); if(newline == null) newline = System.getProperty("line.separator"); final int bufferLineCount = buffer.getLineCount(); setMaximum(bufferLineCount / PROGRESS_INTERVAL); setValue(0); int i = 0; while(i < bufferLineCount) { buffer.getLineText(i,lineSegment); try { writer.write(lineSegment.array, lineSegment.offset, lineSegment.count); if(i < bufferLineCount - 1 || (jEdit.getBooleanProperty("stripTrailingEOL") && buffer.getBooleanProperty(Buffer.TRAILING_EOL))) { writer.write(newline); } } catch(CharacterCodingException e) { String message = getWriteEncodingErrorMessage( encodingName, encoding, lineSegment, i); IOException wrapping = new CharConversionException(message); wrapping.initCause(e); throw wrapping; } if(++i % PROGRESS_INTERVAL == 0) setValue(i / PROGRESS_INTERVAL); } writer.flush(); }
// in org/gjt/sp/jedit/bufferio/BufferIORequest.java
private static int getFirstGuiltyCharacterIndex(Encoding encoding, Segment line) throws IOException { if(line.count < 1) { return -1; } else if(line.count == 1) { return 0; } Writer tester = encoding.getTextWriter( new OutputStream() { public void write(int b) {} }); for(int i = 0; i < line.count; ++i) { try { tester.write(line.array[line.offset + i]); } catch(CharacterCodingException e) { return i; } } return -1; }
// in org/gjt/sp/jedit/bufferio/MarkersSaveRequest.java
private void writeMarkers(OutputStream out) throws IOException { Writer o = new BufferedWriter(new OutputStreamWriter(out)); try { List<Marker> markers = buffer.getMarkers(); synchronized (markers) { setMaximum(markers.size()); for(int i = 0; i < markers.size(); i++) { setValue(i+1); Marker marker = markers.get(i); o.write('!'); o.write(marker.getShortcut()); o.write(';'); String pos = String.valueOf(marker.getPosition()); o.write(pos); o.write(';'); o.write(pos); o.write('\n'); } } } finally { o.close(); } }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
private void makeBackup() throws IOException { // Only backup once per session if(buffer.getProperty(Buffer.BACKED_UP) == null || jEdit.getBooleanProperty("backupEverySave")) { if (jEdit.getIntegerProperty("backups",1) > 0) vfs._backup(session,path,view); buffer.setBooleanProperty(Buffer.BACKED_UP, true); } }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
private InputStream getNakedStream() throws IOException { InputStream in = vfs._createInputStream(session,path,false,view); if(in != null) { return in; } throw new IOException("Unable to get a Stream for " + path); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
private long getContentLength() throws IOException { VFSFile entry = vfs._getFile(session,path,view); if(entry != null) return entry.getLength(); else return 0L; }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
private BufferedInputStream rewindContentsStream(BufferedInputStream markedStream, boolean gzipped) throws IOException { try { markedStream.reset(); return markedStream; } catch(IOException e) { Log.log(Log.NOTICE, this , path + ": Reopening to rewind the stream"); // Reopen the stream because the mark has been // invalidated while previous reading. markedStream.close(); InputStream in = getNakedStream(); try { if(gzipped) { in = new GZIPInputStream(in); } BufferedInputStream result = AutoDetection.getMarkedStream(in); in = null; return result; } finally { IOUtilities.closeQuietly(in); } } }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
private void readContents() throws IOException { long length = getContentLength(); BufferedInputStream markedStream = AutoDetection.getMarkedStream(getNakedStream()); try { boolean gzipped = false; // encodingProviders is consist of given // encodings as String or contents-aware // detectors as EncodingDetector. List<Object> encodingProviders = new ArrayList<Object>(); boolean autodetect = buffer.getBooleanProperty(Buffer.ENCODING_AUTODETECT); if(autodetect) { gzipped = AutoDetection.isGzipped(markedStream); markedStream.reset(); encodingProviders.addAll(AutoDetection.getEncodingDetectors()); // If the detected encoding fail, fallback to // the original encoding. encodingProviders.add(buffer.getStringProperty(JEditBuffer.ENCODING)); String fallbackEncodings = jEdit.getProperty("fallbackEncodings"); if(fallbackEncodings != null && fallbackEncodings.length() > 0) { for(String encoding: fallbackEncodings.split("\\s+")) { encodingProviders.add(encoding); } } } else { gzipped = buffer.getBooleanProperty(Buffer.GZIPPED); encodingProviders.add(buffer.getStringProperty(JEditBuffer.ENCODING)); } if(gzipped) { Log.log(Log.DEBUG, this, path + ": Stream is gzipped."); markedStream = AutoDetection.getMarkedStream( new GZIPInputStream(markedStream)); } Set<String> failedEncodings = new HashSet<String>(); Exception encodingError = null; for(Object encodingProvider: encodingProviders) { String encoding = null; if (encodingProvider instanceof String) { encoding = (String)encodingProvider; } else if(encodingProvider instanceof EncodingDetector) { markedStream = rewindContentsStream(markedStream, gzipped); encoding = ((EncodingDetector)encodingProvider).detectEncoding(new BufferedInputStream(markedStream)); } else { Log.log(Log.DEBUG, this, "Strange encodingProvider: " + encodingProvider); } if(encoding == null || encoding.length() <= 0 || failedEncodings.contains(encoding)) { continue; } markedStream = rewindContentsStream(markedStream, gzipped); try { read(EncodingServer.getTextReader(markedStream, encoding) , length, false); if(autodetect) { // Store the successful properties. if(gzipped) { buffer.setBooleanProperty(Buffer.GZIPPED,true); } buffer.setProperty(JEditBuffer.ENCODING, encoding); } return; } catch(CharConversionException e) { encodingError = e; } catch(CharacterCodingException e) { encodingError = e; } catch(UnsupportedEncodingException e) { encodingError = e; } catch(UnsupportedCharsetException e) { encodingError = e; } Log.log(Log.NOTICE, this, path + ": " + encoding + ": " + encodingError); failedEncodings.add(encoding); } // All possible detectors and encodings failed. Object[] pp = { TextUtilities.join(failedEncodings,","), "" }; if(failedEncodings.size() < 2) { pp[1] = encodingError.toString(); } else { pp[1] = "See details in Activity Log"; } VFSManager.error(view,path,"ioerror.encoding-error",pp,Log.NOTICE); markedStream = rewindContentsStream(markedStream, gzipped); read(EncodingServer.getEncoding( buffer.getStringProperty(JEditBuffer.ENCODING) ).getPermissiveTextReader(markedStream) , length, false); if(autodetect && gzipped) { buffer.setBooleanProperty(Buffer.GZIPPED,true); } } finally { markedStream.close(); } }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
private static void readMarkers(Buffer buffer, InputStream _in) throws IOException { // For `reload' command buffer.removeAllMarkers(); BufferedReader in = new BufferedReader(new InputStreamReader(_in)); try { String line; while((line = in.readLine()) != null) { // malformed marks file? if(line.length() == 0) continue; // compatibility kludge for jEdit 3.1 and earlier if(line.charAt(0) != '!') continue; char shortcut = line.charAt(1); int start = line.indexOf(';'); int end = line.indexOf(';',start + 1); int position = Integer.parseInt(line.substring(start + 1,end)); buffer.addMarker(shortcut,position); } buffer.setMarkersChanged(false); } finally { in.close(); } }
// in org/gjt/sp/jedit/JARClassLoader.java
public Enumeration getResources(String name) throws IOException { class SingleElementEnumeration implements Enumeration { private Object element; SingleElementEnumeration(Object element) { this.element = element; } public boolean hasMoreElements() { return element != null; } public Object nextElement() { if(element != null) { Object retval = element; element = null; return retval; } else throw new NoSuchElementException(); } } URL resource = getResource(name); return new SingleElementEnumeration(resource); }
// in org/gjt/sp/jedit/JARClassLoader.java
private void definePackage(String clazz) throws IOException { int idx = clazz.lastIndexOf('.'); if (idx != -1) { String name = clazz.substring(0, idx); if (getPackage(name) == null) definePackage(name, new JarFile(jar.getFile()).getManifest()); } }
// in org/gjt/sp/jedit/MiscUtilities.java
public static boolean isBinary(InputStream in) throws IOException { AutoDetection.Result detection = new AutoDetection.Result(in); // If an encoding is detected, this is a text stream if (detection.getDetectedEncoding() != null) { return false; } // Read the stream in system default encoding. The encoding // might be wrong. But enough for binary detection. try { return containsNullCharacter( new InputStreamReader(detection.getRewindedStream())); } catch (MalformedInputException mie) { // This error probably means the input is binary. return true; } }
// in org/gjt/sp/jedit/MiscUtilities.java
public static Reader autodetect(InputStream in, Buffer buffer) throws IOException { String encoding; if (buffer == null) encoding = System.getProperty("file.encoding"); else encoding = buffer.getStringProperty(JEditBuffer.ENCODING); boolean gzipped = false; if (buffer == null || buffer.getBooleanProperty(Buffer.ENCODING_AUTODETECT)) { AutoDetection.Result detection = new AutoDetection.Result(in); gzipped = detection.streamIsGzipped(); if (gzipped) { Log.log(Log.DEBUG, MiscUtilities.class , "Stream is Gzipped"); } String detected = detection.getDetectedEncoding(); if (detected != null) { encoding = detected; Log.log(Log.DEBUG, MiscUtilities.class , "Stream encoding detected is " + detected); } in = detection.getRewindedStream(); } else { // Make the stream buffered in the same way. in = AutoDetection.getMarkedStream(in); } Reader result = EncodingServer.getTextReader(in, encoding); if (buffer != null) { // Store the successful properties. if (gzipped) { buffer.setBooleanProperty(Buffer.GZIPPED,true); } buffer.setProperty(JEditBuffer.ENCODING, encoding); } return result; }
// in org/gjt/sp/jedit/MiscUtilities.java
private static boolean containsNullCharacter(Reader reader) throws IOException { int nbChars = jEdit.getIntegerProperty("vfs.binaryCheck.length",100); int authorized = jEdit.getIntegerProperty("vfs.binaryCheck.count",1); for (long i = 0L;i < nbChars;i++) { int c = reader.read(); if (c == -1) return false; if (c == 0) { authorized--; if (authorized == 0) return true; } } return false; }
// in org/gjt/sp/jedit/datatransfer/ListVFSFileTransferable.java
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (jEditFileList.equals(flavor)) { return files; } else if (DataFlavor.stringFlavor.equals(flavor)) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < files.size(); i++) { VFSFile vfsFile = files.get(i); if (i != 0) builder.append('\n'); builder.append(vfsFile.getPath()); } return builder.toString(); } else if (DataFlavor.javaFileListFlavor.equals(flavor)) { List<File> files = new ArrayList<File>(this.files.size()); for (VFSFile file : this.files) { if (file.getVFS() instanceof FileVFS) files.add(new File(file.getPath())); } return files; } throw new UnsupportedFlavorException(flavor); }
// in org/gjt/sp/jedit/datatransfer/RichTextTransferable.java
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (!isDataFlavorSupported(flavor)) throw new UnsupportedFlavorException(flavor); return new JEditRichText(text, mode); }
// in org/gjt/sp/jedit/datatransfer/JEditTransferable.java
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (!isDataFlavorSupported(flavor)) throw new UnsupportedFlavorException(flavor); Transferable transferable = flavors.get(flavor); return transferable.getTransferData(flavor); }
// in org/gjt/sp/jedit/browser/VFSBrowser.java
public void paste(VFSFile file) throws IOException, UnsupportedFlavorException { if (file == null) throw new IllegalArgumentException("file cannot be null"); String targetPath = null; switch (file.getType()) { case VFSFile.FILESYSTEM: return; case VFSFile.FILE: targetPath = MiscUtilities.getParentOfPath(file.getPath()); break; case VFSFile.DIRECTORY: targetPath = file.getPath(); break; } VFS vfs = VFSManager.getVFSForPath(targetPath); Object vfsSession = null; try { vfsSession = vfs.createVFSSession(targetPath, this); if (vfsSession == null) { Log.log(Log.ERROR, this, "Unable to create session for " + targetPath); return; } Transferable transferable = Registers.getRegister('$').getTransferable(); List<String> sources = new ArrayList<String>(); if (transferable.isDataFlavorSupported(ListVFSFileTransferable.jEditFileList)) { Iterable<VFSFile> copiedFiles = (Iterable<VFSFile>) transferable.getTransferData(ListVFSFileTransferable.jEditFileList); for (VFSFile copiedFile : copiedFiles) { sources.add(copiedFile.getPath()); } } else if (transferable.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { Iterable<File> copiedFiles = (Iterable<File>) transferable.getTransferData(DataFlavor.javaFileListFlavor); for (File copiedFile : copiedFiles) { sources.add(copiedFile.getAbsolutePath()); } } CopyFileWorker worker = new CopyFileWorker(this, sources, targetPath); ThreadUtilities.runInBackground(worker); } finally { vfs._endVFSSession(vfsSession, this); } }
// in org/gjt/sp/jedit/PluginJAR.java
public synchronized ZipFile getZipFile() throws IOException { if(zipFile == null) { Log.log(Log.DEBUG,this,"Opening " + path); zipFile = new ZipFile(path); } return zipFile; }
// in org/gjt/sp/jedit/PluginJAR.java
public PluginCacheEntry generateCache() throws IOException { properties = new Properties(); localizationProperties = new HashMap<String, Properties>(); List<String> classes = new LinkedList<String>(); List<String> resources = new LinkedList<String>(); ZipFile zipFile = getZipFile(); List<String> plugins = new LinkedList<String>(); PluginCacheEntry cache = new PluginCacheEntry(); cache.modTime = file.lastModified(); Enumeration<? extends ZipEntry> entries = zipFile.entries(); Pattern languageFilePattern = Pattern.compile("lang_(\\w+).properties"); while(entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); String name = entry.getName(); String lname = name.toLowerCase(); if("actions.xml".equals(lname)) { cache.actionsURI = classLoader.getResource(name); } else if("browser.actions.xml".equals(lname)) { cache.browserActionsURI = classLoader.getResource(name); } else if("dockables.xml".equals(lname)) { dockablesURI = classLoader.getResource(name); cache.dockablesURI = dockablesURI; } else if("services.xml".equals(lname)) { servicesURI = classLoader.getResource(name); cache.servicesURI = servicesURI; } else if(lname.endsWith(".props")) { InputStream in = null; try { in = classLoader.getResourceAsStream(name); properties.load(in); } finally { IOUtilities.closeQuietly(in); } } else if(name.endsWith(".class")) { String className = MiscUtilities .fileToClass(name); if(className.endsWith("Plugin")) { plugins.add(className); } classes.add(className); } else { Matcher matcher = languageFilePattern.matcher(lname); if (matcher.matches()) { String languageName = matcher.group(1); Properties props = new Properties(); InputStream in = null; try { in = classLoader.getResourceAsStream(name); props.load(in); localizationProperties.put(languageName, props); } finally { IOUtilities.closeQuietly(in); } } else resources.add(name); } } cache.cachedProperties = properties; cache.localizationProperties = localizationProperties; // this must be done before loading cachedProperties if (cache.localizationProperties != null) { localizationProperties = cache.localizationProperties; String currentLanguage = jEdit.getCurrentLanguage(); Properties langProperties = localizationProperties.get(currentLanguage); if (langProperties != null) { jEdit.addPluginProps(langProperties); } } jEdit.addPluginProps(properties); this.classes = cache.classes = classes.toArray( new String[classes.size()]); this.resources = cache.resources = resources.toArray( new String[resources.size()]); String label = null; for (String className : plugins) { String _label = jEdit.getProperty("plugin." + className + ".name"); String version = jEdit.getProperty("plugin." + className + ".version"); if(_label == null || version == null) { Log.log(Log.WARNING,this,"Ignoring: " + className); } else { cache.pluginClass = className; // Check if a plugin with the same name // is already loaded if (!continueLoading(className, cache.cachedProperties)) { return null; } else { EditPlugin otherPlugin = jEdit.getPlugin(className); if (otherPlugin != null) { jEdit.removePluginJAR(otherPlugin.getPluginJAR(), false); // otherPlugin.getPluginJAR().uninit(false); } } plugin = new EditPlugin.Deferred(this, className); label = _label; break; } } if(cache.actionsURI != null) { actions = new ActionSet(this,null,null, cache.actionsURI); actions.load(); cache.cachedActionNames = actions.getCacheableActionNames(); cache.cachedActionToggleFlags = new boolean[cache.cachedActionNames.length]; for(int i = 0; i < cache.cachedActionNames.length; i++) { cache.cachedActionToggleFlags[i] = jEdit.getBooleanProperty( cache.cachedActionNames[i] + ".toggle"); } } if(cache.browserActionsURI != null) { browserActions = new ActionSet(this,null,null, cache.browserActionsURI); browserActions.load(); VFSBrowser.getActionContext().addActionSet(browserActions); cache.cachedBrowserActionNames = browserActions.getCacheableActionNames(); cache.cachedBrowserActionToggleFlags = new boolean[ cache.cachedBrowserActionNames.length]; for(int i = 0; i < cache.cachedBrowserActionNames.length; i++) { cache.cachedBrowserActionToggleFlags[i] = jEdit.getBooleanProperty( cache.cachedBrowserActionNames[i] + ".toggle"); } } if(dockablesURI != null) { DockableWindowFactory.getInstance() .loadDockableWindows(this, dockablesURI,cache); } if(actions.size() != 0) { if(label != null) { actions.setLabel(jEdit.getProperty( "action-set.plugin", new String[] { label })); } else actionsPresentButNotCoreClass(); jEdit.addActionSet(actions); } if(servicesURI != null) { ServiceManager.loadServices(this,servicesURI,cache); } return cache; }
// in org/gjt/sp/jedit/PluginJAR.java
public boolean read(DataInputStream din) throws IOException { int cacheMagic = din.readInt(); if(cacheMagic != MAGIC) return false; String cacheBuild = readString(din); if(!cacheBuild.equals(jEdit.getBuild())) return false; long cacheModTime = din.readLong(); if(cacheModTime != modTime) return false; actionsURI = readURI(din); cachedActionNames = readStringArray(din); cachedActionToggleFlags = readBooleanArray(din); browserActionsURI = readURI(din); cachedBrowserActionNames = readStringArray(din); cachedBrowserActionToggleFlags = readBooleanArray(din); dockablesURI = readURI(din); cachedDockableNames = readStringArray(din); cachedDockableActionFlags = readBooleanArray(din); cachedDockableMovableFlags = readBooleanArray(din); servicesURI = readURI(din); int len = din.readInt(); if(len == 0) cachedServices = null; else { cachedServices = new ServiceManager.Descriptor[len]; for(int i = 0; i < len; i++) { ServiceManager.Descriptor d = new ServiceManager.Descriptor( readString(din), readString(din), null, plugin); cachedServices[i] = d; } } classes = readStringArray(din); resources = readStringArray(din); cachedProperties = readMap(din); localizationProperties = readLanguagesMap(din); pluginClass = readString(din); return true; }
// in org/gjt/sp/jedit/PluginJAR.java
public void write(DataOutputStream dout) throws IOException { dout.writeInt(MAGIC); writeString(dout,jEdit.getBuild()); dout.writeLong(modTime); writeString(dout,actionsURI); writeStringArray(dout,cachedActionNames); writeBooleanArray(dout,cachedActionToggleFlags); writeString(dout,browserActionsURI); writeStringArray(dout,cachedBrowserActionNames); writeBooleanArray(dout,cachedBrowserActionToggleFlags); writeString(dout,dockablesURI); writeStringArray(dout,cachedDockableNames); writeBooleanArray(dout,cachedDockableActionFlags); writeBooleanArray(dout,cachedDockableMovableFlags); writeString(dout,servicesURI); if(cachedServices == null) dout.writeInt(0); else { dout.writeInt(cachedServices.length); for(int i = 0; i < cachedServices.length; i++) { writeString(dout,cachedServices[i].clazz); writeString(dout,cachedServices[i].name); } } writeStringArray(dout,classes); writeStringArray(dout,resources); writeMap(dout,cachedProperties); writeLanguages(dout, localizationProperties); writeString(dout,pluginClass); }
// in org/gjt/sp/jedit/PluginJAR.java
private static String readString(DataInputStream din) throws IOException { int len = din.readInt(); if(len == 0) return null; char[] str = new char[len]; for(int i = 0; i < len; i++) str[i] = din.readChar(); return new String(str); }
// in org/gjt/sp/jedit/PluginJAR.java
private static URL readURI(DataInputStream din) throws IOException { String str = readString(din); if(str == null) return null; else return new URL(str); }
// in org/gjt/sp/jedit/PluginJAR.java
private static String[] readStringArray(DataInputStream din) throws IOException { int len = din.readInt(); if(len == 0) return null; String[] str = new String[len]; for(int i = 0; i < len; i++) { str[i] = readString(din); } return str; }
// in org/gjt/sp/jedit/PluginJAR.java
private static boolean[] readBooleanArray(DataInputStream din) throws IOException { int len = din.readInt(); if(len == 0) return null; boolean[] bools = new boolean[len]; for(int i = 0; i < len; i++) { bools[i] = din.readBoolean(); } return bools; }
// in org/gjt/sp/jedit/PluginJAR.java
private static Properties readMap(DataInputStream din) throws IOException { Properties returnValue = new Properties(); int count = din.readInt(); for(int i = 0; i < count; i++) { String key = readString(din); String value = readString(din); if(value == null) value = ""; returnValue.setProperty(key, value); } return returnValue; }
// in org/gjt/sp/jedit/PluginJAR.java
private static Map<String, Properties> readLanguagesMap(DataInputStream din) throws IOException { int languagesCount = din.readInt(); if (languagesCount == 0) return Collections.emptyMap(); Map<String, Properties> languages = new HashMap<String, Properties>(languagesCount); for (int i = 0;i<languagesCount;i++) { String lang = readString(din); Properties props = readMap(din); languages.put(lang, props); } return languages; }
// in org/gjt/sp/jedit/PluginJAR.java
private static void writeString(DataOutputStream dout, Object obj) throws IOException { if(obj == null) { dout.writeInt(0); } else { String str = obj.toString(); dout.writeInt(str.length()); dout.writeChars(str); } }
// in org/gjt/sp/jedit/PluginJAR.java
private static void writeStringArray(DataOutputStream dout, String[] str) throws IOException { if(str == null) { dout.writeInt(0); } else { dout.writeInt(str.length); for(int i = 0; i < str.length; i++) { writeString(dout,str[i]); } } }
// in org/gjt/sp/jedit/PluginJAR.java
private static void writeBooleanArray(DataOutputStream dout, boolean[] bools) throws IOException { if(bools == null) { dout.writeInt(0); } else { dout.writeInt(bools.length); for(int i = 0; i < bools.length; i++) { dout.writeBoolean(bools[i]); } } }
// in org/gjt/sp/jedit/PluginJAR.java
private static void writeMap(DataOutputStream dout, Properties properties) throws IOException { dout.writeInt(properties.size()); Set<Map.Entry<Object, Object>> set = properties.entrySet(); for (Map.Entry<Object, Object> entry : set) { writeString(dout,entry.getKey()); writeString(dout,entry.getValue()); } }
// in org/gjt/sp/jedit/PluginJAR.java
private static void writeLanguages(DataOutputStream dout, Map<String, Properties> languages) throws IOException { dout.writeInt(languages.size()); for (Map.Entry<String, Properties> entry : languages.entrySet()) { writeString(dout, entry.getKey()); writeMap(dout, entry.getValue()); } }
// in org/gjt/sp/jedit/SettingsXML.java
public void writeXMLDeclaration() throws IOException { writeXMLDeclaration("1.0"); }
// in org/gjt/sp/jedit/SettingsXML.java
public void writeXMLDeclaration(String version) throws IOException { write("<?xml" + " version=\"" + version + "\"" + " encoding=\"" + encoding + "\"" + " ?>"); newLine(); }
// in org/gjt/sp/jedit/SettingsXML.java
public void finish() throws IOException { close(); jEdit.backupSettingsFile(file); file.delete(); twoStageSaveFile.renameTo(file); knownLastModified = file.lastModified(); }
// in org/gjt/sp/jedit/SettingsXML.java
public void load(DefaultHandler handler) throws IOException { XMLUtilities.parseXML(new FileInputStream(file), handler); knownLastModified = file.lastModified(); }
// in org/gjt/sp/jedit/SettingsXML.java
public Saver openSaver() throws IOException { return new Saver(); }
// in org/gjt/sp/util/IOUtilities.java
public static boolean copyStream(int bufferSize, ProgressObserver progress, InputStream in, OutputStream out, boolean canStop) throws IOException { byte[] buffer = new byte[bufferSize]; int n; long copied = 0L; while (-1 != (n = in.read(buffer))) { out.write(buffer, 0, n); copied += n; if(progress != null) { progress.setStatus(StandardUtilities.formatFileSize(copied)); progress.setValue(copied); } if(canStop && Thread.interrupted()) return false; } return true; }
// in org/gjt/sp/util/IOUtilities.java
public static boolean copyStream(ProgressObserver progress, InputStream in, OutputStream out, boolean canStop) throws IOException { return copyStream(4096,progress, in, out, canStop); }
// in org/gjt/sp/util/XMLUtilities.java
public static boolean parseXML(InputStream in, DefaultHandler handler) throws IOException { try { XMLReader parser = XMLReaderFactory.createXMLReader(); InputSource isrc = new InputSource( new BufferedInputStream(in)); isrc.setSystemId("jedit.jar"); parser.setContentHandler(handler); parser.setDTDHandler(handler); parser.setEntityResolver(handler); parser.setErrorHandler(handler); parser.parse(isrc); } catch(SAXParseException se) { int line = se.getLineNumber(); Log.log(Log.ERROR,XMLUtilities.class, "while parsing from " + in + ": SAXParseException: line " + line + ": " , se); return true; } catch(SAXException e) { Log.log(Log.ERROR,XMLUtilities.class,e); return true; } finally { IOUtilities.closeQuietly(in); } return false; }
141
            
// in org/jedit/keymap/KeymapManagerImpl.java
catch (IOException e) { Log.log(Log.ERROR, this, e); }
// in org/jedit/keymap/KeymapImpl.java
catch (IOException e) { Log.log(Log.ERROR, this, "Unable to load properties", e); }
// in org/jedit/keymap/KeymapImpl.java
catch (IOException e) { Log.log(Log.ERROR, this, "Unable to save properties", e); }
// in org/gjt/sp/jedit/View.java
catch(IOException e) { // this should never throw an exception. throw new InternalError(); }
// in org/gjt/sp/jedit/View.java
catch(IOException io) { //Log.log(Log.ERROR,this,io); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(IOException io) { Log.log(Log.ERROR,this,io); String[] args = { io.getMessage() }; GUIUtilities.error(null,"ioerror",args); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(IOException io) { Log.log(Log.ERROR,this,io); }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(final IOException io) { Log.log(Log.ERROR,this,io); SwingUtilities.invokeLater(new Runnable() { public void run() { String[] args = { io.getMessage() }; GUIUtilities.error(null,"plugin-error-download",args); } }); return null; }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
catch (IOException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
catch (IOException e1) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/gui/PingPongList.java
catch (IOException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/gui/statusbar/LastModifiedWidgetFactory.java
catch (IOException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/gui/statusbar/LastModifiedWidgetFactory.java
catch (IOException e) { }
// in org/gjt/sp/jedit/gui/DockableWindowManagerImpl.java
catch (IOException e) { Log.log(Log.ERROR, this, e, e); return false; }
// in org/gjt/sp/jedit/gui/DockableWindowManagerImpl.java
catch (IOException e) { return false; }
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
catch(IOException io) { Log.log(Log.ERROR,HistoryModel.class,io); }
// in org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
catch(IOException io) { Log.log(Log.ERROR,HistoryModel.class,io); }
// in org/gjt/sp/jedit/gui/DockableWindowFactory.java
catch(IOException e) { Log.log(Log.ERROR,DockableWindowManager.class,e); }
// in org/gjt/sp/jedit/ServiceManager.java
catch (IOException ioe) { Log.log(Log.ERROR, ServiceManager.class, ioe); }
// in org/gjt/sp/jedit/help/HelpTOCPanel.java
catch(IOException e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/help/HelpViewer.java
catch(IOException io) { Log.log(Log.ERROR,this,io); String[] args = { _url.toString(), io.toString() }; GUIUtilities.error(HelpViewer.this,"read-error",args); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( IOException e ) { }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch(java.io.IOException e) { if (bufpos != 0) { --bufpos; backup(0); } else { bufline[bufpos] = line; bufcolumn[bufpos] = column; } throw e; }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch(java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch(java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch ( IOException e ) { String s = "Error constructing classpath: " +urls[i]+": "+e; errorWhileMapping( s ); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch ( IOException e ) { throw new ClassPathException("can't parse class path: "+e); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch(IOException ie ) { throw new RuntimeException("Couldn't load file: "+file); }
// in org/gjt/sp/jedit/bsh/Remote.java
catch (IOException e2) { System.out.println(e2); // I/O error }
// in org/gjt/sp/jedit/bsh/commands/dir.java
catch (IOException e ) { env.println("error reading path: "+e); return; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( IOException e ) { System.out.println("I/O Error: "+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( IOException e ) { System.err.println("Can't redirect output to file: "+filename ); }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { return pos + 1; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(0, active0, active1, active2); return 1; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(1, active0, active1, active2); return 2; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(2, active0, active1, active2); return 3; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(3, active0, active1, active2); return 4; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(4, active0, active1, active2); return 5; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(5, active0, active1, active2); return 6; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(6, active0, active1, active2); return 7; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(7, active0, active1, active2); return 8; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(8, active0, active1, active2); return 9; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(9, active0, active1, active2); return 10; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(10, active0, active1, active2); return 11; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(11, 0L, active1, active2); return 12; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(12, 0L, active1, active2); return 13; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(13, 0L, active1, active2); return 14; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(14, 0L, active1, active2); return 15; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(15, 0L, active1, active2); return 16; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(16, 0L, active1, active2); return 17; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(17, 0L, active1, active2); return 18; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(18, 0L, active1, active2); return 19; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(19, 0L, active1, active2); return 20; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(20, 0L, 0L, active2); return 21; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(21, 0L, 0L, active2); return 22; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(22, 0L, 0L, active2); return 23; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(23, 0L, 0L, active2); return 24; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(24, 0L, 0L, active2); return 25; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(25, 0L, 0L, active2); return 26; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjStopStringLiteralDfa_0(26, 0L, 0L, active2); return 27; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { return curPos; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch(java.io.IOException e) { jjmatchedKind = 0; matchedToken = jjFillToken(); matchedToken.specialToken = specialToken; return matchedToken; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
catch (java.io.IOException e1) { EOFSeen = true; error_after = curPos <= 1 ? "" : input_stream.GetImage(); if (curChar == '\n' || curChar == '\r') { error_line++; error_column = 0; } else error_column++; }
// in org/gjt/sp/jedit/EditServer.java
catch(IOException io) { /* on some Windows versions, connections to localhost * fail if the network is not running. To avoid * confusing newbies with weird error messages, log * errors that occur while starting the server * as NOTICE, not ERROR */ Log.log(Log.NOTICE,this,io); }
// in org/gjt/sp/jedit/EditServer.java
catch(IOException io) { }
// in org/gjt/sp/jedit/Registers.java
catch (IOException e) { Log.log(Log.ERROR, Registers.class, e); }
// in org/gjt/sp/jedit/Registers.java
catch (IOException e) { Log.log(Log.ERROR, Registers.class, e); }
// in org/gjt/sp/jedit/Registers.java
catch (IOException e) { Log.log(Log.ERROR, Registers.class, e); }
// in org/gjt/sp/jedit/Registers.java
catch (IOException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/io/VFSFile.java
catch(IOException e) { VFSManager.error(e,path,browser); }
// in org/gjt/sp/jedit/io/VFSFile.java
catch(IOException e) { VFSManager.error(e,path,browser); }
// in org/gjt/sp/jedit/io/CopyFileWorker.java
catch (IOException e) { Log.log(Log.ERROR, this, e, e); }
// in org/gjt/sp/jedit/io/CopyFileWorker.java
catch (IOException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/io/CopyFileWorker.java
catch (IOException e) { }
// in org/gjt/sp/jedit/io/LocalFileSaveTask.java
catch (IOException e) { Log.log(Log.ERROR, this, e, e); }
// in org/gjt/sp/jedit/io/FileVFS.java
catch(IOException io) { canonPath = path; }
// in org/gjt/sp/jedit/io/FileVFS.java
catch(IOException io) { toCanonPath = to; }
// in org/gjt/sp/jedit/io/FileVFS.java
catch(IOException io) { fromCanonPath = from; }
// in org/gjt/sp/jedit/io/FileVFS.java
catch(IOException io) { canonPath = directory; }
// in org/gjt/sp/jedit/io/FileVFS.java
catch(IOException io) { if(ignoreErrors) return null; else throw io; }
// in org/gjt/sp/jedit/io/VFS.java
catch(IOException e) { Log.log(Log.ERROR,this,e); // may be not binary... }
// in org/gjt/sp/jedit/search/DirectoryListSet.java
catch(IOException io) { VFSManager.error(comp,directory,"ioerror",new String[] { io.toString() }); return null; }
// in org/gjt/sp/jedit/jEdit.java
catch(IOException io) { Log.log(Log.ERROR,jEdit.class,io); }
// in org/gjt/sp/jedit/jEdit.java
catch(IOException io) { Log.log(Log.ERROR,jEdit.class,io); }
// in org/gjt/sp/jedit/jEdit.java
catch(IOException e) { Log.log(Log.ERROR,jEdit.class,"Cannot load site snippet " + snippet); Log.log(Log.ERROR,jEdit.class,e); }
// in org/gjt/sp/jedit/jEdit.java
catch (IOException e) { if (getBooleanProperty("lang.usedefaultlocale")) { // if it is the default locale, it is not an error Log.log(Log.ERROR, jEdit.class, "Unable to load language", e); } }
// in org/gjt/sp/jedit/jEdit.java
catch(IOException e) { Log.log(Log.ERROR,jEdit.class,e); }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,newPath,"ioerror", new String[] { io.toString() }); setPerformingIO(false); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,newPath,"ioerror", new String[] { io.toString() }); setPerformingIO(false); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { //Log.log(Log.ERROR,this,io); }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; }
// in org/gjt/sp/jedit/Buffer.java
catch(IOException io) { VFSManager.error(view,path,"ioerror", new String[] { io.toString() }); return false; }
// in org/gjt/sp/jedit/BufferHistory.java
catch(IOException e) { Log.log(Log.ERROR,BufferHistory.class,e); }
// in org/gjt/sp/jedit/options/AppearanceOptionPane.java
catch(IOException io) { Log.log(Log.ERROR,this,io); }
// in org/gjt/sp/jedit/options/PluginManagerOptionPane.java
catch (IOException e) { Log.log(Log.ERROR,this, "Unable to write cached mirror list : " + mirrorList); }
// in org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
catch(Exception e) { Log.log(Log.ERROR,this,e); String[] pp = { e.toString() }; VFSManager.error(view,path,"ioerror.write-error",pp); // Incomplete autosave file should not exist. if(out != null) { try { out.close(); out = null; vfs._delete(session,path,view); } catch(IOException ioe) { Log.log(Log.ERROR,this,ioe); } } }
// in org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
catch(IOException ioe) { Log.log(Log.ERROR,this,ioe); }
// in org/gjt/sp/jedit/bufferio/MarkersSaveRequest.java
catch(IOException io) { Log.log(Log.ERROR,this,io); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(IOException e) { Log.log(Log.NOTICE, this , path + ": Reopening to rewind the stream"); // Reopen the stream because the mark has been // invalidated while previous reading. markedStream.close(); InputStream in = getNakedStream(); try { if(gzipped) { in = new GZIPInputStream(in); } BufferedInputStream result = AutoDetection.getMarkedStream(in); in = null; return result; } finally { IOUtilities.closeQuietly(in); } }
// in org/gjt/sp/jedit/PerspectiveManager.java
catch(IOException e) { Log.log(Log.ERROR,PerspectiveManager.class,e); }
// in org/gjt/sp/jedit/PerspectiveManager.java
catch(IOException io) { Log.log(Log.ERROR,PerspectiveManager.class,"Error saving " + perspectiveXML); Log.log(Log.ERROR,PerspectiveManager.class,io); }
// in org/gjt/sp/jedit/JEditKillRing.java
catch (IOException ioe) { Log.log(Log.ERROR, this, ioe); }
// in org/gjt/sp/jedit/EditPlugin.java
catch (IOException e) { return null; }
// in org/gjt/sp/jedit/EditPlugin.java
catch (IOException e) { return null; }
// in org/gjt/sp/jedit/JEditRegisterSaver.java
catch (IOException ioe) { Log.log(Log.ERROR, Registers.class, ioe); }
// in org/gjt/sp/jedit/JARClassLoader.java
catch(IOException io) { Log.log(Log.ERROR,this,io); return null; }
// in org/gjt/sp/jedit/JARClassLoader.java
catch(IOException io) { Log.log(Log.ERROR,this,io); return null; }
// in org/gjt/sp/jedit/JARClassLoader.java
catch(IOException io) { Log.log(Log.ERROR,this,io); throw new ClassNotFoundException(clazz); }
// in org/gjt/sp/jedit/textarea/StandaloneTextArea.java
catch (IOException e) { Log.log(Log.ERROR, TextArea.class, e); }
// in org/gjt/sp/jedit/MiscUtilities.java
catch(IOException io) { return path; }
// in org/gjt/sp/jedit/SplitConfigParser.java
catch (IOException e) { // StringReader will not throw an IOException as long as the // string it is reading is not null, which won't happen here. }
// in org/gjt/sp/jedit/browser/DeleteBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/DeleteBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/BrowserView.java
catch (IOException e) { Log.log(Log.ERROR, this, e, e); }
// in org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); String[] pp = { io.toString() }; VFSManager.error(browser, path,"ioerror.directory-error",pp); }
// in org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); String[] pp = { io.toString() }; VFSManager.error(browser, path,"ioerror.directory-error",pp); }
// in org/gjt/sp/jedit/browser/VFSFileChooserDialog.java
catch(IOException e) { VFSManager.error(e,path,browser); }
// in org/gjt/sp/jedit/browser/VFSFileChooserDialog.java
catch(IOException e) { VFSManager.error(e,path,browser); }
// in org/gjt/sp/jedit/browser/RenameBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/RenameBrowserTask.java
catch (IOException io) { setCancellable(false); Log.log(Log.ERROR, this, io); String[] pp = {io.toString()}; VFSManager.error(browser, path, "ioerror.directory-error", pp); }
// in org/gjt/sp/jedit/browser/MkDirBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); args[0] = io.toString(); VFSManager.error(browser, path,"ioerror",args); }
// in org/gjt/sp/jedit/browser/MkDirBrowserTask.java
catch(IOException io) { setCancellable(false); Log.log(Log.ERROR,this,io); args[0] = io.toString(); VFSManager.error(browser, path,"ioerror",args); }
// in org/gjt/sp/jedit/PluginJAR.java
catch (IOException ioe) { throw new RuntimeException(ioe); }
// in org/gjt/sp/jedit/PluginJAR.java
catch(IOException io) { Log.log(Log.ERROR,PluginJAR.class,io); return null; }
// in org/gjt/sp/jedit/PluginJAR.java
catch(IOException io) { Log.log(Log.ERROR,PluginJAR.class,io); IOUtilities.closeQuietly(dout); new File(jarCachePath).delete(); }
// in org/gjt/sp/jedit/PluginJAR.java
catch(IOException io) { Log.log(Log.ERROR,this,"Cannot load" + " plugin " + path); Log.log(Log.ERROR,this,io); String[] args = { io.toString() }; jEdit.pluginError(path,"plugin-error.load-error",args); uninit(false); }
// in org/gjt/sp/jedit/PluginJAR.java
catch(IOException io) { Log.log(Log.ERROR,this,io); }
// in org/gjt/sp/jedit/JEditActionSet.java
catch(IOException e) { Log.log(Log.ERROR,this,uri,e); }
// in org/gjt/sp/util/Log.java
catch(IOException io) { io.printStackTrace(realErr); }
// in org/gjt/sp/util/Log.java
catch(IOException io) { io.printStackTrace(realErr); }
// in org/gjt/sp/util/Log.java
catch (IOException ioe) { // don't do anything? }
// in org/gjt/sp/util/IOUtilities.java
catch (IOException ioe) { Log.log(Log.WARNING, IOUtilities.class, "Error moving file: " + ioe + " : " + ioe.getMessage()); }
// in org/gjt/sp/util/IOUtilities.java
catch (IOException e) { //ignore }
// in org/gjt/sp/util/IOUtilities.java
catch (IOException e) { // ignore }
// in org/gjt/sp/util/IOUtilities.java
catch (IOException e) { //ignore }
// in org/gjt/sp/util/IOUtilities.java
catch (IOException e) { //ignore }
// in org/gjt/sp/util/IOUtilities.java
catch (IOException e) { // ignore }
// in org/gjt/sp/util/IOUtilities.java
catch (IOException e) { //ignore }
// in org/gjt/sp/util/IOUtilities.java
catch (IOException e) { // ignore }
// in org/gjt/sp/util/IOUtilities.java
catch (IOException e) { //ignore }
8
            
// in org/gjt/sp/jedit/View.java
catch(IOException e) { // this should never throw an exception. throw new InternalError(); }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch(java.io.IOException e) { if (bufpos != 0) { --bufpos; backup(0); } else { bufline[bufpos] = line; bufcolumn[bufpos] = column; } throw e; }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch(java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch ( IOException e ) { throw new ClassPathException("can't parse class path: "+e); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch(IOException ie ) { throw new RuntimeException("Couldn't load file: "+file); }
// in org/gjt/sp/jedit/io/FileVFS.java
catch(IOException io) { if(ignoreErrors) return null; else throw io; }
// in org/gjt/sp/jedit/JARClassLoader.java
catch(IOException io) { Log.log(Log.ERROR,this,io); throw new ClassNotFoundException(clazz); }
// in org/gjt/sp/jedit/PluginJAR.java
catch (IOException ioe) { throw new RuntimeException(ioe); }
3
unknown (Lib) IllegalAccessException 0 0 0 5
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( IllegalAccessException e ) { throw new ReflectError( "Cannot access method " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " in '" + method.getDeclaringClass() + "' :" + e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalAccessException e) { throw new ReflectError("Can't access field: " + fieldName); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalAccessException e) { throw new ReflectError( "We don't have permission to create an instance." +"Use setAccessibility(true) to enable access." ); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(IllegalAccessException e2) { throw new UtilEvalError("Can't read field: " + field); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( IllegalAccessException e2) { throw new UtilEvalError( "LHS ("+field.getName()+") can't access field: "+e2); }
5
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( IllegalAccessException e ) { throw new ReflectError( "Cannot access method " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " in '" + method.getDeclaringClass() + "' :" + e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalAccessException e) { throw new ReflectError("Can't access field: " + fieldName); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalAccessException e) { throw new ReflectError( "We don't have permission to create an instance." +"Use setAccessibility(true) to enable access." ); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(IllegalAccessException e2) { throw new UtilEvalError("Can't read field: " + field); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( IllegalAccessException e2) { throw new UtilEvalError( "LHS ("+field.getName()+") can't access field: "+e2); }
0
runtime (Lib) IllegalArgumentException 55
            
// in org/jedit/keymap/KeymapManagerImpl.java
Override public boolean copyKeymap(String name, String newName) { Log.log(Log.DEBUG, this, "copyKeymap(" + name + ',' + newName + ')'); File keymapFile = getUserKeymapFile(newName); if (keymapFile.exists()) throw new IllegalArgumentException("Keymap " + newName + " already exists"); File originalKeymap = getKeymapFile(name); if (!originalKeymap.isFile()) throw new IllegalArgumentException("Keymap " + name + " doesn't exist"); keymapFile.getParentFile().mkdirs(); BufferedInputStream in = null; BufferedOutputStream out = null; Log.log(Log.DEBUG, this, "Copying "+ originalKeymap.getAbsolutePath() + " to " + keymapFile.getAbsolutePath()); try { in = new BufferedInputStream(new FileInputStream(originalKeymap)); out = new BufferedOutputStream(new FileOutputStream(keymapFile)); IOUtilities.copyStream(null, in, out, false); return true; } catch (IOException e) { Log.log(Log.ERROR, this, e); } finally { IOUtilities.closeQuietly(in); IOUtilities.closeQuietly(out); } return false; }
// in org/gjt/sp/jedit/gui/ExtendedGridLayout.java
public void addLayoutComponent(Component component, Object constraints) { if (null == constraints) { constraints = new ExtendedGridLayoutConstraints(component); } if (constraints instanceof ExtendedGridLayoutConstraints) { ExtendedGridLayoutConstraints eglConstraints = (ExtendedGridLayoutConstraints)constraints; if (eglConstraints.isPlaceholder()) { throw new IllegalArgumentException("constraints must not be a placeholder"); } else if (component != eglConstraints.getComponent()) { throw new IllegalArgumentException("constraints is not the right one for this component"); } comptable.put(component,eglConstraints); } else { throw new IllegalArgumentException("constraints must not be an ExtendedGridLayoutConstraints object"); } }
// in org/gjt/sp/jedit/gui/ExtendedGridLayout.java
private Dimension getSize(Container parent, LayoutSize layoutSize, boolean fillRawSizes, Dimension gridSize, List<List<ExtendedGridLayoutConstraints>> gridRows, Set<ExtendedGridLayoutConstraints> colspans, Set<ExtendedGridLayoutConstraints> rowspans, int[][] resultArrays) { if (fillRawSizes && (resultArrays.length < 6)) { throw new IllegalArgumentException("If fillRawSizes is true, resultArrays.length must be >= 6 (" + resultArrays.length + ')'); } int[] minimumColWidths = new int[gridSize.width]; int[] minimumRowHeights = new int[gridSize.height]; int[] preferredColWidths = new int[gridSize.width]; int[] preferredRowHeights = new int[gridSize.height]; int[] maximumColWidths = new int[gridSize.width]; int[] maximumRowHeights = new int[gridSize.height]; Arrays.fill(minimumColWidths,0); Arrays.fill(minimumRowHeights,0); Arrays.fill(preferredColWidths,0); Arrays.fill(preferredRowHeights,0); Arrays.fill(maximumColWidths,0); Arrays.fill(maximumRowHeights,0); // get the maximum of the minimum sizes, // the maximum of the preferred sizes and // the minimum of the maximum sizes // of all rows and columns, not taking // rowspans and colspans into account for (int row=0 ; row<gridSize.height ; row++) { List<ExtendedGridLayoutConstraints> gridRow = gridRows.get(row); for (int col=0 ; col<gridSize.width ; col++) { ExtendedGridLayoutConstraints cell = gridRow.get(col); if ((null != cell) && (null != cell.getComponent())) { Component component = cell.getComponent(); Dimension minimumSize = component.getMinimumSize(); Dimension preferredSize = component.getPreferredSize(); Dimension maximumSize = component.getMaximumSize(); if (!colspans.contains(cell)) { minimumColWidths[col] = Math.max(minimumColWidths[col],minimumSize.width); preferredColWidths[col] = Math.max(preferredColWidths[col],preferredSize.width); maximumColWidths[col] = Math.max(maximumColWidths[col],maximumSize.width); } if (!rowspans.contains(cell)) { minimumRowHeights[row] = Math.max(minimumRowHeights[row],minimumSize.height); preferredRowHeights[row] = Math.max(preferredRowHeights[row],preferredSize.height); maximumRowHeights[row] = Math.max(maximumRowHeights[row],maximumSize.height); } } } } // correct cases where // minimumColWidths[col] <= preferredColWidths[col] <= maximumColWidths[col] // is not true by clipping to the minimumColWidths and maximumColWidths for (int col=0 ; col<gridSize.width ; col++) { if (minimumColWidths[col] >= maximumColWidths[col]) { maximumColWidths[col] = minimumColWidths[col]; preferredColWidths[col] = minimumColWidths[col]; } else if (preferredColWidths[col] < minimumColWidths[col]) { preferredColWidths[col] = minimumColWidths[col]; } else if (preferredColWidths[col] > maximumColWidths[col]) { preferredColWidths[col] = maximumColWidths[col]; } } // plug in the colspans and correct the minimum, preferred and // maximum column widths the colspans are part of for (ExtendedGridLayoutConstraints cell : colspans) { int fromCol = cell.getCol(); int colspan = cell.getEffectiveColspan(); int toCol = fromCol + colspan; int currentMinimumColWidth = 0; int currentPreferredColWidth = 0; int currentMaximumColWidth = 0; for (int col=fromCol ; col<toCol ; col++) { int minimumColWidth = minimumColWidths[col]; if ((Integer.MAX_VALUE-minimumColWidth) < currentMinimumColWidth) { currentMinimumColWidth = Integer.MAX_VALUE; } else { currentMinimumColWidth += minimumColWidth; } int preferredColWidth = preferredColWidths[col]; if ((Integer.MAX_VALUE-preferredColWidth) < currentPreferredColWidth) { currentPreferredColWidth = Integer.MAX_VALUE; } else { currentPreferredColWidth += preferredColWidth; } int maximumColWidth = maximumColWidths[col]; if ((Integer.MAX_VALUE-maximumColWidth) < currentMaximumColWidth) { currentMaximumColWidth = Integer.MAX_VALUE; } else { currentMaximumColWidth += maximumColWidth; } } Component component = cell.getComponent(); int wantedMaximumColWidth = component.getMaximumSize().width - ((colspan - 1) * hgap); if (currentMaximumColWidth < wantedMaximumColWidth) { redistributeSpace(currentMaximumColWidth, wantedMaximumColWidth, fromCol,toCol, maximumColWidths, maximumColWidths, maximumColWidths); } int wantedMinimumColWidth = component.getMinimumSize().width - ((colspan - 1) * hgap); if (currentMinimumColWidth < wantedMinimumColWidth) { redistributeSpace(currentMinimumColWidth, wantedMinimumColWidth, fromCol,toCol, minimumColWidths, minimumColWidths, maximumColWidths); } int wantedPreferredColWidth = component.getPreferredSize().width - ((colspan - 1) * hgap); if (currentPreferredColWidth < wantedPreferredColWidth) { redistributeSpace(currentPreferredColWidth, wantedPreferredColWidth, fromCol,toCol, preferredColWidths, minimumColWidths, maximumColWidths); } } // correct cases where // minimumColWidths[col] <= preferredColWidths[col] <= maximumColWidths[col] // is not true by clipping to the minimumColWidths and maximumColWidths for (int col=0 ; col<gridSize.width ; col++) { if (minimumColWidths[col] >= maximumColWidths[col]) { maximumColWidths[col] = minimumColWidths[col]; preferredColWidths[col] = minimumColWidths[col]; } else if (preferredColWidths[col] < minimumColWidths[col]) { preferredColWidths[col] = minimumColWidths[col]; } else if (preferredColWidths[col] > maximumColWidths[col]) { preferredColWidths[col] = maximumColWidths[col]; } } // correct cases where // minimumRowHeights[row] <= preferredRowHeights[row] <= maximumRowHeights[row] // is not true by clipping to the minimumRowHeights and maximumRowHeights for (int row=0 ; row<gridSize.height ; row++) { if (minimumRowHeights[row] >= maximumRowHeights[row]) { maximumRowHeights[row] = minimumRowHeights[row]; preferredRowHeights[row] = minimumRowHeights[row]; } else if (preferredRowHeights[row] < minimumRowHeights[row]) { preferredRowHeights[row] = minimumRowHeights[row]; } else if (preferredRowHeights[row] > maximumRowHeights[row]) { preferredRowHeights[row] = maximumRowHeights[row]; } } // plug in the rowspans and correct the minimum, preferred and // maximum row heights the rowspans are part of for (ExtendedGridLayoutConstraints cell : rowspans) { int fromRow = cell.getRow(); int rowspan = cell.getEffectiveRowspan(); int toRow = fromRow + rowspan; int currentMinimumRowHeight = 0; int currentPreferredRowHeight = 0; int currentMaximumRowHeight = 0; for (int row=fromRow ; row<toRow ; row++) { int minimumRowHeight = minimumRowHeights[row]; if ((Integer.MAX_VALUE-minimumRowHeight) < currentMinimumRowHeight) { currentMinimumRowHeight = Integer.MAX_VALUE; } else { currentMinimumRowHeight += minimumRowHeight; } int preferredRowHeight = preferredRowHeights[row]; if ((Integer.MAX_VALUE-preferredRowHeight) < currentPreferredRowHeight) { currentPreferredRowHeight = Integer.MAX_VALUE; } else { currentPreferredRowHeight += preferredRowHeight; } int maximumRowHeight = maximumRowHeights[row]; if ((Integer.MAX_VALUE-maximumRowHeight) < currentMaximumRowHeight) { currentMaximumRowHeight = Integer.MAX_VALUE; } else { currentMaximumRowHeight += maximumRowHeight; } } Component component = cell.getComponent(); int wantedMaximumRowHeight = component.getMaximumSize().height - ((rowspan - 1) * vgap); if (currentMaximumRowHeight < wantedMaximumRowHeight) { redistributeSpace(currentMaximumRowHeight, wantedMaximumRowHeight, fromRow,toRow, maximumRowHeights, maximumRowHeights, maximumRowHeights); } int wantedMinimumRowHeight = component.getMinimumSize().height - ((rowspan - 1) * vgap); if (currentMinimumRowHeight < wantedMinimumRowHeight) { redistributeSpace(currentMinimumRowHeight, wantedMinimumRowHeight, fromRow,toRow, minimumRowHeights, minimumRowHeights, maximumRowHeights); } int wantedPreferredRowHeight = component.getPreferredSize().height - ((rowspan - 1) * vgap); if (currentPreferredRowHeight < wantedPreferredRowHeight) { redistributeSpace(currentPreferredRowHeight, wantedPreferredRowHeight, fromRow,toRow, preferredRowHeights, minimumRowHeights, maximumRowHeights); } } // correct cases where // minimumRowHeights[row] <= preferredRowHeights[row] <= maximumRowHeights[row] // is not true by clipping to the minimumRowHeights and maximumRowHeights for (int row=0 ; row<gridSize.height ; row++) { if (minimumRowHeights[row] >= maximumRowHeights[row]) { maximumRowHeights[row] = minimumRowHeights[row]; preferredRowHeights[row] = minimumRowHeights[row]; } else if (preferredRowHeights[row] < minimumRowHeights[row]) { preferredRowHeights[row] = minimumRowHeights[row]; } else if (preferredRowHeights[row] > maximumRowHeights[row]) { preferredRowHeights[row] = maximumRowHeights[row]; } } // copies the computed sizes to the result arrays if (fillRawSizes) { resultArrays[0] = minimumColWidths; resultArrays[1] = minimumRowHeights; resultArrays[2] = preferredColWidths; resultArrays[3] = preferredRowHeights; resultArrays[4] = maximumColWidths; resultArrays[5] = maximumRowHeights; } // sums up the sizes for return value int[] colWidths; int[] rowHeights; switch (layoutSize) { case MINIMUM: colWidths = minimumColWidths; rowHeights = minimumRowHeights; break; case PREFERRED: colWidths = preferredColWidths; rowHeights = preferredRowHeights; break; case MAXIMUM: colWidths = maximumColWidths; rowHeights = maximumRowHeights; break; default: throw new InternalError("Missing case branch for LayoutSize: " + layoutSize); } long totalWidth = 0; long totalHeight = 0; for (int width : colWidths) { totalWidth += width; } for (int height : rowHeights) { totalHeight += height; } // add space between components or between // componetns and the borders of the parent container if (!fillRawSizes) { Insets insets = parent.getInsets(); totalWidth += insets.left + insets.right + ((gridSize.width - 1) * hgap) + distanceToBorders.left + distanceToBorders.right; totalHeight += insets.top + insets.bottom + ((gridSize.height - 1) * vgap) + distanceToBorders.top + distanceToBorders.bottom; } // clip the size to Integer.MAX_VALUE if too big if (totalWidth > Integer.MAX_VALUE) { totalWidth = Integer.MAX_VALUE; } if (totalHeight > Integer.MAX_VALUE) { totalHeight = Integer.MAX_VALUE; } return new Dimension((int)totalWidth,(int)totalHeight); }
// in org/gjt/sp/jedit/gui/KeyEventTranslator.java
public static void setModifierMapping(int c, int a, int m, int s) { int duplicateMapping = (c & a) | (c & m) | (c & s) | (a & m) | (a & s) | (m & s); if((duplicateMapping & InputEvent.CTRL_MASK) != 0) { throw new IllegalArgumentException( "CTRL is mapped to more than one modifier"); } if((duplicateMapping & InputEvent.ALT_MASK) != 0) { throw new IllegalArgumentException( "ALT is mapped to more than one modifier"); } if((duplicateMapping & InputEvent.META_MASK) != 0) { throw new IllegalArgumentException( "META is mapped to more than one modifier"); } if((duplicateMapping & InputEvent.SHIFT_MASK) != 0) { throw new IllegalArgumentException( "SHIFT is mapped to more than one modifier"); } KeyEventTranslator.c = c; KeyEventTranslator.a = a; KeyEventTranslator.m = m; KeyEventTranslator.s = s; }
// in org/gjt/sp/jedit/gui/FilteredListModel.java
public void setList(JList list) { if (list.getModel() != this) throw new IllegalArgumentException("The given list " + list + " doesn't use this model " + this); this.list = list; }
// in org/gjt/sp/jedit/gui/ExtendedGridLayoutConstraints.java
void setCol(int col) { if (col < 0) { throw new IllegalArgumentException("col must be non-negative (" + col + ')'); } this.col = col; }
// in org/gjt/sp/jedit/gui/FilteredTableModel.java
public void setTable(JTable table) { if (table.getModel() != this) throw new IllegalArgumentException("The given table " + table + " doesn't use this model " + this); this.table = table; }
// in org/gjt/sp/jedit/bsh/CollectionManager.java
protected Enumeration createEnumeration( Object iterateOverMe ) { if(iterateOverMe==null) throw new NullPointerException("Object arguments passed to " + "the BasicBshIterator constructor cannot be null."); if (iterateOverMe instanceof Enumeration) return (Enumeration)iterateOverMe; if (iterateOverMe instanceof Vector) return ((Vector)iterateOverMe).elements(); if (iterateOverMe.getClass().isArray()) { final Object array = iterateOverMe; return new Enumeration() { int index = 0, length = Array.getLength(array); public Object nextElement() { return Array.get(array, index++); } public boolean hasMoreElements() { return index<length; } }; } if (iterateOverMe instanceof String) return createEnumeration(((String)iterateOverMe).toCharArray()); if (iterateOverMe instanceof StringBuffer) return createEnumeration( iterateOverMe.toString().toCharArray()); if (iterateOverMe instanceof StringBuilder) return createEnumeration( iterateOverMe.toString().toCharArray()); throw new IllegalArgumentException( "Cannot enumerate object of type "+iterateOverMe.getClass()); }
// in org/gjt/sp/jedit/bsh/org/objectweb/asm/CodeWriter.java
public void visitJumpInsn (final int opcode, final Label label) { if (CHECK) { if (label.owner == null) { label.owner = this; } else if (label.owner != this) { throw new IllegalArgumentException(); } } if (computeMaxs) { if (opcode == Constants.GOTO) { // no stack change, but end of current block (with one new successor) if (currentBlock != null) { currentBlock.maxStackSize = maxStackSize; addSuccessor(stackSize, label); currentBlock = null; } } else if (opcode == Constants.JSR) { if (currentBlock != null) { addSuccessor(stackSize + 1, label); } } else { // updates current stack size (max stack size unchanged because stack // size variation always negative in this case) stackSize += SIZE[opcode]; if (currentBlock != null) { addSuccessor(stackSize, label); } } } // adds the instruction to the bytecode of the method if (label.resolved && label.position - code.length < Short.MIN_VALUE) { // case of a backward jump with an offset < -32768. In this case we // automatically replace GOTO with GOTO_W, JSR with JSR_W and IFxxx <l> // with IFNOTxxx <l'> GOTO_W <l>, where IFNOTxxx is the "opposite" opcode // of IFxxx (i.e., IFNE for IFEQ) and where <l'> designates the // instruction just after the GOTO_W. if (opcode == Constants.GOTO) { code.put1(200); // GOTO_W } else if (opcode == Constants.JSR) { code.put1(201); // JSR_W } else { code.put1(opcode <= 166 ? ((opcode + 1) ^ 1) - 1 : opcode ^ 1); code.put2(8); // jump offset code.put1(200); // GOTO_W } label.put(this, code, code.length - 1, true); } else { // case of a backward jump with an offset >= -32768, or of a forward jump // with, of course, an unknown offset. In these cases we store the offset // in 2 bytes (which will be increased in resizeInstructions, if needed). code.put1(opcode); label.put(this, code, code.length - 1, false); } }
// in org/gjt/sp/jedit/bsh/org/objectweb/asm/CodeWriter.java
public void visitLabel (final Label label) { if (CHECK) { if (label.owner == null) { label.owner = this; } else if (label.owner != this) { throw new IllegalArgumentException(); } } if (computeMaxs) { if (currentBlock != null) { // ends current block (with one new successor) currentBlock.maxStackSize = maxStackSize; addSuccessor(stackSize, label); } // begins a new current block, // resets the relative current and max stack sizes currentBlock = label; stackSize = 0; maxStackSize = 0; } // resolves previous forward references to label, if any resize |= label.resolve(this, code.length, code.data); }
// in org/gjt/sp/jedit/bsh/org/objectweb/asm/CodeWriter.java
public void visitTryCatchBlock ( final Label start, final Label end, final Label handler, final String type) { if (CHECK) { if (start.owner != this || end.owner != this || handler.owner != this) { throw new IllegalArgumentException(); } if (!start.resolved || !end.resolved || !handler.resolved) { throw new IllegalArgumentException(); } } if (computeMaxs) { // pushes handler block onto the stack of blocks to be visited if (!handler.pushed) { handler.beginStackSize = 1; handler.pushed = true; handler.next = blockStack; blockStack = handler; } } ++catchCount; if (catchTable == null) { catchTable = new ByteVector(); } catchTable.put2(start.position); catchTable.put2(end.position); catchTable.put2(handler.position); catchTable.put2(type != null ? cw.newClass(type).index : 0); }
// in org/gjt/sp/jedit/bsh/org/objectweb/asm/CodeWriter.java
public void visitLocalVariable ( final String name, final String desc, final Label start, final Label end, final int index) { if (CHECK) { if (start.owner != this || !start.resolved) { throw new IllegalArgumentException(); } if (end.owner != this || !end.resolved) { throw new IllegalArgumentException(); } } if (localVar == null) { cw.newUTF8("LocalVariableTable"); localVar = new ByteVector(); } ++localVarCount; localVar.put2(start.position); localVar.put2(end.position - start.position); localVar.put2(cw.newUTF8(name).index); localVar.put2(cw.newUTF8(desc).index); localVar.put2(index); }
// in org/gjt/sp/jedit/bsh/org/objectweb/asm/CodeWriter.java
public void visitLineNumber (final int line, final Label start) { if (CHECK) { if (start.owner != this || !start.resolved) { throw new IllegalArgumentException(); } } if (lineNumber == null) { cw.newUTF8("LineNumberTable"); lineNumber = new ByteVector(); } ++lineNumberCount; lineNumber.put2(start.position); lineNumber.put2(line); }
// in org/gjt/sp/jedit/bsh/org/objectweb/asm/ClassWriter.java
Item newCst (final Object cst) { if (cst instanceof Integer) { int val = ((Integer)cst).intValue(); return newInteger(val); } else if (cst instanceof Float) { float val = ((Float)cst).floatValue(); return newFloat(val); } else if (cst instanceof Long) { long val = ((Long)cst).longValue(); return newLong(val); } else if (cst instanceof Double) { double val = ((Double)cst).doubleValue(); return newDouble(val); } else if (cst instanceof String) { return newString((String)cst); } else { throw new IllegalArgumentException("value " + cst); } }
// in org/gjt/sp/jedit/bsh/org/objectweb/asm/Label.java
void put ( final CodeWriter owner, final ByteVector out, final int source, final boolean wideOffset) { if (CodeWriter.CHECK) { if (this.owner == null) { this.owner = owner; } else if (this.owner != owner) { throw new IllegalArgumentException(); } } if (resolved) { if (wideOffset) { out.put4(position - source); } else { out.put2(position - source); } } else { if (wideOffset) { addReference(-1 - source, out.length); out.put4(-1); } else { addReference(source, out.length); out.put2(-1); } } }
// in org/gjt/sp/jedit/bsh/org/objectweb/asm/Label.java
boolean resolve ( final CodeWriter owner, final int position, final byte[] data) { if (CodeWriter.CHECK) { if (this.owner == null) { this.owner = owner; } if (resolved || this.owner != owner) { throw new IllegalArgumentException(); } } boolean needUpdate = false; this.resolved = true; this.position = position; int i = 0; while (i < referenceCount) { int source = srcAndRefPositions[i++]; int reference = srcAndRefPositions[i++]; int offset; if (source >= 0) { offset = position - source; if (offset < Short.MIN_VALUE || offset > Short.MAX_VALUE) { // changes the opcode of the jump instruction, in order to be able to // find it later (see resizeInstructions in CodeWriter). These // temporary opcodes are similar to jump instruction opcodes, except // that the 2 bytes offset is unsigned (and can therefore represent // values from 0 to 65535, which is sufficient since the size of a // method is limited to 65535 bytes). int opcode = data[reference - 1] & 0xFF; if (opcode <= Constants.JSR) { // changes IFEQ ... JSR to opcodes 202 to 217 (inclusive) data[reference - 1] = (byte)(opcode + 49); } else { // changes IFNULL and IFNONNULL to opcodes 218 and 219 (inclusive) data[reference - 1] = (byte)(opcode + 20); } needUpdate = true; } data[reference++] = (byte)(offset >>> 8); data[reference] = (byte)offset; } else { offset = position + source + 1; data[reference++] = (byte)(offset >>> 24); data[reference++] = (byte)(offset >>> 16); data[reference++] = (byte)(offset >>> 8); data[reference] = (byte)offset; } } return needUpdate; }
// in org/gjt/sp/jedit/bsh/org/objectweb/asm/ByteVector.java
public ByteVector putUTF (final String s) { int charLength = s.length(); int byteLength = 0; for (int i = 0; i < charLength; ++i) { char c = s.charAt(i); if (c >= '\001' && c <= '\177') { byteLength++; } else if (c > '\u07FF') { byteLength += 3; } else { byteLength += 2; } } if (byteLength > 65535) { throw new IllegalArgumentException(); } int length = this.length; if (length + 2 + byteLength > data.length) { enlarge(2 + byteLength); } byte[] data = this.data; data[length++] = (byte)(byteLength >>> 8); data[length++] = (byte)(byteLength); for (int i = 0; i < charLength; ++i) { char c = s.charAt(i); if (c >= '\001' && c <= '\177') { data[length++] = (byte)c; } else if (c > '\u07FF') { data[length++] = (byte)(0xE0 | c >> 12 & 0xF); data[length++] = (byte)(0x80 | c >> 6 & 0x3F); data[length++] = (byte)(0x80 | c & 0x3F); } else { data[length++] = (byte)(0xC0 | c >> 6 & 0x1F); data[length++] = (byte)(0x80 | c & 0x3F); } } this.length = length; return this; }
// in org/gjt/sp/jedit/bsh/collection/CollectionIterator.java
protected Iterator createIterator(Object iterateOverMe) { if (iterateOverMe==null) throw new NullPointerException("Object arguments passed to " + "the CollectionIterator constructor cannot be null."); if (iterateOverMe instanceof Iterator) return (Iterator)iterateOverMe; if (iterateOverMe instanceof Collection) return ((Collection)iterateOverMe).iterator(); /* Should we be able to iterate over maps? if (iterateOverMe instanceof Map) return ((Map)iterateOverMe).entrySet().iterator(); */ throw new IllegalArgumentException( "Cannot enumerate object of type "+iterateOverMe.getClass()); }
// in org/gjt/sp/jedit/io/VFSFile.java
public String getExtendedAttribute(String name) { if(name.equals(VFS.EA_TYPE)) { switch(getType()) { case FILE: return jEdit.getProperty("vfs.browser.type.file"); case DIRECTORY: return jEdit.getProperty("vfs.browser.type.directory"); case FILESYSTEM: return jEdit.getProperty("vfs.browser.type.filesystem"); default: throw new IllegalArgumentException(); } } else if(name.equals(VFS.EA_STATUS)) { if(isReadable()) { if(isWriteable()) return jEdit.getProperty("vfs.browser.status.rw"); else return jEdit.getProperty("vfs.browser.status.ro"); } else { if(isWriteable()) return jEdit.getProperty("vfs.browser.status.append"); else return jEdit.getProperty("vfs.browser.status.no"); } } else if(name.equals(VFS.EA_SIZE)) { if(getType() != FILE) return null; else return StandardUtilities.formatFileSize(getLength()); } else return null; }
// in org/gjt/sp/jedit/search/HyperSearchResults.java
private void goToSelectedNode(int mode) { TreePath path = resultTree.getSelectionPath(); if(path == null) return; DefaultMutableTreeNode node = (DefaultMutableTreeNode)path .getLastPathComponent(); Object value = node.getUserObject(); // do nothing if clicked "foo (showing n occurrences in m files)" if(node.getParent() != resultTreeRoot && value instanceof HyperSearchNode) { HyperSearchNode n = (HyperSearchNode)value; Buffer buffer = n.getBuffer(view); if(buffer == null) return; EditPane pane; switch(mode) { case M_OPEN: pane = view.goToBuffer(buffer); break; case M_OPEN_NEW_VIEW: pane = jEdit.newView(view,buffer,false).getEditPane(); break; case M_OPEN_NEW_PLAIN_VIEW: pane = jEdit.newView(view,buffer,true).getEditPane(); break; case M_OPEN_NEW_SPLIT: pane = view.splitHorizontally(); break; default: throw new IllegalArgumentException("Bad mode: " + mode); } n.goTo(pane); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public void getLineText(int line,int relativeStartOffset, Segment segment) { if(line < 0 || line >= lineMgr.getLineCount()) throw new ArrayIndexOutOfBoundsException(line); try { readLock(); int start = (line == 0 ? 0 : lineMgr.getLineEndOffset(line - 1)); int end = lineMgr.getLineEndOffset(line); if((start+relativeStartOffset)>end) { throw new IllegalArgumentException("This index is outside the line length (start+relativeOffset):"+start+" + "+relativeStartOffset+" > "+"endffset:"+end); } else { getText(start+relativeStartOffset,end - start -relativeStartOffset- 1,segment); } } finally { readUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public void updateColumnBlocks(int startLine,int endLine,int startColumn, Node parent) { if (parent != null && startLine >= 0 && endLine >= 0 && startLine <= endLine) { int currentLine = startLine; int colBlockWidth=0; Vector<ColumnBlockLine> columnBlockLines = new Vector<ColumnBlockLine>(); //while(currentLine<=endLine) ColumnBlock parentColumnBlock = (ColumnBlock) parent; for(int ik=startLine- parentColumnBlock.getStartLine();currentLine<=endLine;ik++) { Segment seg = new Segment(); int actualStart = startColumn; if(!parentColumnBlock.getLines().isEmpty()) { ColumnBlockLine line = parentColumnBlock.getLines().elementAt(ik); if(currentLine!=line.getLine()) { throw new IllegalArgumentException(); } actualStart = line.getColumnEndIndex()+1; } getLineText(currentLine, actualStart, seg); int tabPos = getTabStopPosition(seg); if(tabPos>=0) { columnBlockLines.add(new ColumnBlockLine(currentLine, actualStart, actualStart+tabPos)); if(tabPos>colBlockWidth) { colBlockWidth = tabPos; } } if (tabPos < 0 && !columnBlockLines.isEmpty() || !columnBlockLines.isEmpty() && currentLine == endLine) { ColumnBlock block = new ColumnBlock(this, columnBlockLines.elementAt(0).getLine(), startColumn+colBlockWidth, columnBlockLines.elementAt(columnBlockLines.size()-1).getLine(), startColumn+colBlockWidth); block.setLines(columnBlockLines); block.setParent(parent); block.setWidth(colBlockWidth); block.setTabSizeDirtyStatus(true,false); //block.populateTabSizes(); parent.addChild(block); colBlockWidth=0; columnBlockLines = new Vector<ColumnBlockLine>(); updateColumnBlocks(block.getStartLine(), block.getEndLine(), startColumn+block.getColumnWidth()+1, block); } currentLine++; } } else { throw new IllegalArgumentException(); } }
// in org/gjt/sp/jedit/textarea/ElasticTabstopsTabExpander.java
Override public float nextTabStop(float x, int tabOffset) { float _tabSize = 0; if(textArea.buffer.getBooleanProperty("elasticTabstops")&&textArea.buffer.getColumnBlock()!=null) { int line = textArea.buffer.getLineOfOffset(tabOffset); _tabSize = getTabSize(textArea.buffer.getColumnBlock().getColumnBlock(line, tabOffset),line); if(_tabSize<0) { throw new IllegalArgumentException("Unaccounted tab at line "+textArea.buffer.getLineOfOffset(tabOffset)+" at index "+tabOffset); } } //keep minimum tab size of textArea.tabSize _tabSize+= textArea.tabSize; return (x+_tabSize); }
// in org/gjt/sp/jedit/textarea/ColumnBlock.java
Override //{{{ addChild() method public void addChild(Node node) { // must add the children in sorted order ColumnBlock block = (ColumnBlock) node; ColumnBlock blockBelow = searchChildren(block.startLine); if (blockBelow != null) { if (blockBelow.isLineWithinThisBlock(block.endLine) >= 0) { throw new IllegalArgumentException("Overlapping column blocks: " + block + " \n&\n" + blockBelow); } int index = children.indexOf(blockBelow); children.add(index, node); } else { children.add(node); } }
// in org/gjt/sp/jedit/textarea/ColumnBlock.java
private void throwException(int offset, int line) { throw new IllegalArgumentException("{ELSTIC TABSTOP}CORRUPT DATA@{" + System.currentTimeMillis() + "} & Thread : " + Thread.currentThread().getName() + " :Cannot find the size for tab at offset " + (offset - buffer.getLineStartOffset(line)) + "in line " + line + "while searching in \n " + this); }
// in org/gjt/sp/jedit/textarea/TextArea.java
public void moveCaretPosition(int newCaret, int scrollMode) { if(newCaret < 0 || newCaret > buffer.getLength()) { throw new IllegalArgumentException("caret out of bounds: " + newCaret); } int oldCaretLine = caretLine; if(caret == newCaret) finishCaretUpdate(oldCaretLine,scrollMode,false); else { caret = getCharacterBoundaryAt(newCaret); caretLine = getLineOfOffset(caret); magicCaret = -1; finishCaretUpdate(oldCaretLine,scrollMode,true); } }
// in org/gjt/sp/jedit/textarea/TextArea.java
Override public char setIndex(int position) { if (0 <= position && position <= sequence.length()) { index = position; return current(); } else { // There should be a bug in caller. // Stacktrace will be enough. throw new IllegalArgumentException(); } }
// in org/gjt/sp/jedit/textarea/ElasticTabStopBufferListener.java
public void contentRemoved(JEditBuffer buffer, int startLine, int offset, int numLines, int length) { if(!buffer.getBooleanProperty("elasticTabstops")) { return; } String charDeleted; boolean isASimpleChar = false; ColumnBlock rootBlock = buffer.getColumnBlock(); if(rootBlock==null) { return; } if((numLines==0)&(length==1)) { isASimpleChar = true; } if((!isASimpleChar)) { //we need to remove column blocks //find the column block lying just below the first line deleted ColumnBlock firstBlockEffected = rootBlock.searchChildren(startLine); //info we need to determine inside this if block int startLineToBuild = -1; int endLineToBuild = -1; ColumnBlock firstBlockToBeUpdated = null; ColumnBlock firstBlockToBeRemoved = null; ColumnBlock lastBlockToBeRemoved = null; if(firstBlockEffected!=null) { int indexFirstBlockEffected =rootBlock.getChildren().indexOf(firstBlockEffected); ColumnBlock blockAboveFirstEffected = null; boolean justBelowBlock = false; if(indexFirstBlockEffected>0) { blockAboveFirstEffected = (ColumnBlock)rootBlock.getChildren().get(indexFirstBlockEffected-1); if(blockAboveFirstEffected.endLine==startLine-1 ) { justBelowBlock = true; } } int posFirstLine = firstBlockEffected.isLineWithinThisBlock(startLine); boolean firstLineLiesInside =posFirstLine==0; boolean firstLineLiesAbove =posFirstLine<0; int posLastLine = firstBlockEffected.isLineWithinThisBlock(startLine+numLines); boolean lastLineLiesInside =posLastLine==0; boolean lastLineLiesAbove = posLastLine<0; boolean lastLineLiesBelow = posLastLine>0; //deletion above block if(lastLineLiesAbove ) { //if last line lies above this block cannot be connected to a block above in this deletion without touching the block above /*if(justBelowBlock&&startLine+numLines+1==firstBlockEffected.startLine) { startLineToBuild=blockAboveFirstEffected.startLine; endLineToBuild= firstBlockEffected.endLine; firstBlockToBeRemoved = blockAboveFirstEffected; lastBlockToBeRemoved = firstBlockEffected; }*/ firstBlockToBeUpdated = firstBlockEffected; //else //{ firstBlockToBeRemoved =lastBlockToBeRemoved= null; startLineToBuild=endLineToBuild=-1; //} } //deletion inside block else if((firstLineLiesInside||firstLineLiesAbove)&&lastLineLiesInside) { startLineToBuild = Math.min( firstBlockEffected.startLine,startLine); endLineToBuild = firstBlockEffected.endLine-numLines; //if(indexFirstBlockEffected<rootBlock.getChildren().size()-1) //{ //firstBlockToBeUpdated =(ColumnBlock)rootBlock.getChildren().get(indexFirstBlockEffected+1) ; //} firstBlockToBeRemoved =lastBlockToBeRemoved= firstBlockEffected; if(justBelowBlock) { startLineToBuild =blockAboveFirstEffected.startLine ; firstBlockToBeRemoved = blockAboveFirstEffected; } } //deletion might cover other blocks as well else if(((firstLineLiesInside)||(firstLineLiesAbove))&&lastLineLiesBelow) { startLineToBuild = Math.min(startLine, firstBlockEffected.startLine); firstBlockToBeRemoved = firstBlockEffected; ColumnBlock blockBelow = rootBlock.searchChildren(startLine+numLines); int indexLastBlock = rootBlock.getChildren().indexOf(blockBelow); if(blockBelow!=null) { //deletion partially overlaps this block if(blockBelow.isLineWithinThisBlock(startLine+numLines)==0) { if(justBelowBlock) { startLineToBuild =blockAboveFirstEffected.startLine ; firstBlockToBeRemoved = blockAboveFirstEffected; } lastBlockToBeRemoved = blockBelow; endLineToBuild = blockBelow.endLine-numLines; //if(indexLastBlock<rootBlock.getChildren().size()-1) //{ //firstBlockToBeUpdated = (ColumnBlock)rootBlock.getChildren().get(indexLastBlock+1); //} } //deletion lies above this block else { //do not need to consider blockJustAbove here as we cannot connect two column blocks without //ending on one of the lines of either //firstBlockToBeUpdated = blockBelow; //if we have reached here there is surely a block above this one lastBlockToBeRemoved = (ColumnBlock)rootBlock.getChildren().get(indexLastBlock-1); //if the first Block is wholly covered then all column blocks are being deleted completely and there is nothing to build endLineToBuild = firstLineLiesAbove?-1:startLine; //consider the case where last line deleted is just above the column block block below if((blockBelow.startLine==startLine+numLines+1)&&(endLineToBuild!=-1)) { endLineToBuild = blockBelow.endLine-numLines; lastBlockToBeRemoved = blockBelow; } if(endLineToBuild==-1) { startLineToBuild = -1; } } } //no block below last line else { lastBlockToBeRemoved = (ColumnBlock)rootBlock.getChildren().get(rootBlock.getChildren().size()-1); //firstBlockToBeUpdated = null; if(firstLineLiesInside) { endLineToBuild = startLine; } else { startLineToBuild = -1; endLineToBuild= -1; } } } } //deletion lies below all column blocks else { startLineToBuild = -1; endLineToBuild = -1; //firstBlockToBeUpdated = null; firstBlockToBeRemoved = null; lastBlockToBeRemoved = null; } //once we reach here we have three things to do //1)delete columnBlocks using firstBlockToBeDeleted and lastBlockToBeDeleted Vector blocksToBeRemoved =null; if(firstBlockToBeRemoved!=null) { int startIndex = rootBlock.getChildren().indexOf(firstBlockToBeRemoved); blocksToBeRemoved = new Vector(); if(lastBlockToBeRemoved==null) { throw new IllegalArgumentException("Deletion not handled properly"); } int endIndex = rootBlock.getChildren().indexOf(lastBlockToBeRemoved); for(int i=startIndex;i<=endIndex;i++) { blocksToBeRemoved.add(rootBlock.getChildren().get(i)); } } //2)update startLine/endLine in column blocks using firstBlockToBeUpdated if(numLines>0) { rootBlock.endLine-=numLines; if((lastBlockToBeRemoved!=null)||(firstBlockToBeUpdated!=null)) { int startIndex=-1; if(lastBlockToBeRemoved!=null) { startIndex = rootBlock.getChildren().indexOf(lastBlockToBeRemoved); //start just after the last block to be removed startIndex++; } else if(firstBlockToBeUpdated!=null) { startIndex = rootBlock.getChildren().indexOf(firstBlockToBeUpdated); } for(int i=startIndex;i<rootBlock.getChildren().size();i++) { ((ColumnBlock)rootBlock.getChildren().get(i)).updateLineNo(-1*numLines); } } } //once we are done with (2) we can safely change rootBlock if(blocksToBeRemoved!=null) { rootBlock.getChildren().removeAll(blocksToBeRemoved); } //3)rebuild column blocks using endLine and startLine if(startLineToBuild!=-1&&endLineToBuild!=-1) { buffer.updateColumnBlocks(startLineToBuild, endLineToBuild, 0, rootBlock); rootBlock.setDirtyStatus(false); textArea.chunkCache.invalidateChunksFromPhys(startLineToBuild); textArea.invalidateLineRange(startLineToBuild, endLineToBuild); } rootBlock.setDirtyStatus(false); handledDeletion = true; } else { int startingLine = -1; int endLine = -1; //a simple char has been entered //if this lies inside a column block update the startIndex and endIndex of this blocks corresponding ColumnBlockLine //and all subsequent ColumnBlock Lines after this one //check whether columnBlockWidth is valid ColumnBlock innerContainingBlock = rootBlock.getContainingBlock(startLine, offset); //do nothing if this char does not lie inside a column block if(innerContainingBlock!=null) { if(!singleTabDeleted) { innerContainingBlock.updateColumnBlockLineOffset(startLine, -1*length, false); ColumnBlockLine containingLine = innerContainingBlock.getLines().elementAt(startLine-innerContainingBlock.startLine); startingLine = innerContainingBlock.startLine; endLine = innerContainingBlock.endLine; innerContainingBlock.setTabSizeDirtyStatus(true,false); } else { //no need to update line offset as ColumnBlock would be rebuilt ColumnBlock innerParent = (ColumnBlock)innerContainingBlock.getParent(); startingLine = innerContainingBlock.startLine; endLine = innerContainingBlock.endLine; innerParent.getChildren().remove(innerContainingBlock); //startingLine = innerParent.startLine; //endLine = innerParent.endLine; //innerParent.getChildren().removeAllElements(); buffer.updateColumnBlocks(startingLine, endLine,(int)innerParent.columnBlockWidth , innerParent); } } else { //this line must have been retokenized and repainted by the BufferHandler so repaint it again here after column blocks dirty status is updated startingLine = startLine; endLine = startLine; } handledDeletion = true; rootBlock.setDirtyStatus(false); if(startingLine!=-1&&endLine!=-1) { textArea.chunkCache.invalidateChunksFromPhys(startingLine); textArea.invalidateLineRange(startingLine, endLine); } } }
// in org/gjt/sp/jedit/textarea/SelectionManager.java
void addToSelection(Selection addMe) { if(addMe.start > addMe.end) { throw new IllegalArgumentException(addMe.start + " > " + addMe.end); } else if(addMe.start == addMe.end) { if(addMe instanceof Selection.Range) return; else if(addMe instanceof Selection.Rect) { if(((Selection.Rect)addMe).extraEndVirt == 0) return; } } Iterator<Selection> iter = selection.iterator(); while(iter.hasNext()) { // try and merge existing selections one by // one with the new selection Selection s = iter.next(); if(s.overlaps(addMe)) { addMe.start = Math.min(s.start,addMe.start); addMe.end = Math.max(s.end,addMe.end); iter.remove(); } } addMe.startLine = textArea.getLineOfOffset(addMe.start); addMe.endLine = textArea.getLineOfOffset(addMe.end); boolean added = false; for(int i = 0; i < selection.size(); i++) { Selection s = selection.get(i); if(addMe.start < s.start) { selection.add(i,addMe); added = true; break; } } if(!added) selection.add(addMe); textArea.invalidateLineRange(addMe.startLine,addMe.endLine); }
// in org/gjt/sp/jedit/browser/VFSBrowser.java
public void paste(VFSFile file) throws IOException, UnsupportedFlavorException { if (file == null) throw new IllegalArgumentException("file cannot be null"); String targetPath = null; switch (file.getType()) { case VFSFile.FILESYSTEM: return; case VFSFile.FILE: targetPath = MiscUtilities.getParentOfPath(file.getPath()); break; case VFSFile.DIRECTORY: targetPath = file.getPath(); break; } VFS vfs = VFSManager.getVFSForPath(targetPath); Object vfsSession = null; try { vfsSession = vfs.createVFSSession(targetPath, this); if (vfsSession == null) { Log.log(Log.ERROR, this, "Unable to create session for " + targetPath); return; } Transferable transferable = Registers.getRegister('$').getTransferable(); List<String> sources = new ArrayList<String>(); if (transferable.isDataFlavorSupported(ListVFSFileTransferable.jEditFileList)) { Iterable<VFSFile> copiedFiles = (Iterable<VFSFile>) transferable.getTransferData(ListVFSFileTransferable.jEditFileList); for (VFSFile copiedFile : copiedFiles) { sources.add(copiedFile.getPath()); } } else if (transferable.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { Iterable<File> copiedFiles = (Iterable<File>) transferable.getTransferData(DataFlavor.javaFileListFlavor); for (File copiedFile : copiedFiles) { sources.add(copiedFile.getAbsolutePath()); } } CopyFileWorker worker = new CopyFileWorker(this, sources, targetPath); ThreadUtilities.runInBackground(worker); } finally { vfs._endVFSSession(vfsSession, this); } }
// in org/gjt/sp/jedit/PluginJAR.java
private static PluginDepends getPluginDepends(String dep) throws IllegalArgumentException { boolean optional; if(dep.startsWith("optional ")) { optional = true; dep = dep.substring("optional ".length()); } else { optional = false; } int index = dep.indexOf(' '); if(index == -1) throw new IllegalArgumentException("wrong dependency"); String what = dep.substring(0,index); String arg = dep.substring(index + 1); PluginDepends depends = new PluginDepends(); depends.what = what; depends.arg = arg; depends.optional = optional; return depends; }
// in org/gjt/sp/util/Log.java
private static String urgencyToString(int urgency) { switch(urgency) { case DEBUG: return "debug"; case MESSAGE: return "message"; case NOTICE: return "notice"; case WARNING: return "warning"; case ERROR: return "error"; } throw new IllegalArgumentException("Invalid urgency: " + urgency); }
// in org/gjt/sp/util/SyntaxUtilities.java
public static SyntaxStyle parseStyle(String str, String family, int size, boolean color, Color defaultFgColor) throws IllegalArgumentException { Color fgColor = defaultFgColor; Color bgColor = null; boolean italic = false; boolean bold = false; StringTokenizer st = new StringTokenizer(str); while(st.hasMoreTokens()) { String s = st.nextToken(); if(s.startsWith("color:")) { if(color) fgColor = parseColor(s.substring(6), Color.black); } else if(s.startsWith("bgColor:")) { if(color) bgColor = parseColor(s.substring(8), null); } else if(s.startsWith("style:")) { for(int i = 6; i < s.length(); i++) { if(s.charAt(i) == 'i') italic = true; else if(s.charAt(i) == 'b') bold = true; else throw new IllegalArgumentException( "Invalid style: " + s); } } else throw new IllegalArgumentException( "Invalid directive: " + s); } return new SyntaxStyle(fgColor,bgColor, new Font(family, (italic ? Font.ITALIC : 0) | (bold ? Font.BOLD : 0), size)); }
0 6
            
// in org/gjt/sp/jedit/bsh/CollectionManager.java
public BshIterator getBshIterator( Object obj ) throws IllegalArgumentException { return new BasicBshIterator( obj ); }
// in org/gjt/sp/jedit/bsh/collection/CollectionManagerImpl.java
public BshIterator getBshIterator( Object obj ) throws IllegalArgumentException { if ( obj instanceof Collection || obj instanceof Iterator ) return new CollectionIterator( obj ); else return new org.gjt.sp.jedit.bsh.CollectionManager.BasicBshIterator( obj ); }
// in org/gjt/sp/jedit/GUIUtilities.java
public static SyntaxStyle parseStyle(String str, String family, int size) throws IllegalArgumentException { return SyntaxUtilities.parseStyle(str,family,size,true); }
// in org/gjt/sp/jedit/PluginJAR.java
private static PluginDepends getPluginDepends(String dep) throws IllegalArgumentException { boolean optional; if(dep.startsWith("optional ")) { optional = true; dep = dep.substring("optional ".length()); } else { optional = false; } int index = dep.indexOf(' '); if(index == -1) throw new IllegalArgumentException("wrong dependency"); String what = dep.substring(0,index); String arg = dep.substring(index + 1); PluginDepends depends = new PluginDepends(); depends.what = what; depends.arg = arg; depends.optional = optional; return depends; }
// in org/gjt/sp/util/SyntaxUtilities.java
public static SyntaxStyle parseStyle(String str, String family, int size, boolean color, Color defaultFgColor) throws IllegalArgumentException { Color fgColor = defaultFgColor; Color bgColor = null; boolean italic = false; boolean bold = false; StringTokenizer st = new StringTokenizer(str); while(st.hasMoreTokens()) { String s = st.nextToken(); if(s.startsWith("color:")) { if(color) fgColor = parseColor(s.substring(6), Color.black); } else if(s.startsWith("bgColor:")) { if(color) bgColor = parseColor(s.substring(8), null); } else if(s.startsWith("style:")) { for(int i = 6; i < s.length(); i++) { if(s.charAt(i) == 'i') italic = true; else if(s.charAt(i) == 'b') bold = true; else throw new IllegalArgumentException( "Invalid style: " + s); } } else throw new IllegalArgumentException( "Invalid directive: " + s); } return new SyntaxStyle(fgColor,bgColor, new Font(family, (italic ? Font.ITALIC : 0) | (bold ? Font.BOLD : 0), size)); }
// in org/gjt/sp/util/SyntaxUtilities.java
public static SyntaxStyle parseStyle(String str, String family, int size, boolean color) throws IllegalArgumentException { return parseStyle(str, family, size, color, Color.black); }
11
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( IllegalArgumentException e1 ) { throw new UtilTargetError( new ArrayStoreException( e1.toString() ) ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalArgumentException e) { throw new ReflectError("The number of arguments was wrong"); }
// in org/gjt/sp/jedit/bsh/CollectionManager.java
catch( IllegalArgumentException e ) { return false; }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( IllegalArgumentException e3) { String type = val instanceof Primitive ? ((Primitive)val).getType().getName() : val.getClass().getName(); throw new UtilEvalError( "Argument type mismatch. " + (val == null ? "null" : type ) + " not assignable to field "+field.getName()); }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
catch( IllegalArgumentException e ) { Interpreter.debug("illegal arg"+e); throwTypeError( baseType, currentInitializer, i, callstack ); }
// in org/gjt/sp/jedit/options/ShortcutsOptionPane.java
catch (IllegalArgumentException eae) {}
// in org/gjt/sp/jedit/options/ViewOptionPane.java
catch (IllegalArgumentException e) { Log.log(Log.ERROR, this, e); scope = BufferSet.Scope.global; }
// in org/gjt/sp/jedit/bufferset/BufferSetManager.java
catch (IllegalArgumentException e) { Log.log(Log.ERROR, this, e); scope = BufferSet.Scope.global; }
// in org/gjt/sp/jedit/PluginJAR.java
catch (IllegalArgumentException e) { Log.log(Log.ERROR, PluginJAR.class, className + " has an invalid dependency: " + dep); continue; }
// in org/gjt/sp/jedit/PluginJAR.java
catch (IllegalArgumentException e) { Log.log(Log.ERROR,this,name + " has an invalid" + " dependency: " + dep); ok = false; continue; }
// in org/gjt/sp/util/PropertiesBean.java
catch (IllegalArgumentException iae) { /* Ignore these. */ }
3
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( IllegalArgumentException e1 ) { throw new UtilTargetError( new ArrayStoreException( e1.toString() ) ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalArgumentException e) { throw new ReflectError("The number of arguments was wrong"); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( IllegalArgumentException e3) { String type = val instanceof Primitive ? ((Primitive)val).getType().getName() : val.getClass().getName(); throw new UtilEvalError( "Argument type mismatch. " + (val == null ? "null" : type ) + " not assignable to field "+field.getName()); }
0
unknown (Lib) IllegalCharsetNameException 0 0 0 3
            
// in org/gjt/sp/jedit/io/XMLEncodingDetector.java
catch(IllegalCharsetNameException e) { Log.log(Log.WARNING, XMLEncodingDetector.class, "XML PI specifies illegal encoding: " + encoding, e); }
// in org/gjt/sp/jedit/io/EncodingServer.java
catch (IllegalCharsetNameException e) { // just failed }
// in org/gjt/sp/jedit/io/EncodingServer.java
catch (IllegalCharsetNameException e) { // The name is illegal for java.nio.charset.Charset. // But it may be legal for service name. }
0 0
runtime (Lib) IllegalStateException 3
            
// in org/gjt/sp/jedit/bsh/Modifiers.java
public void addModifier( int context, String name ) { if ( modifiers == null ) modifiers = new Hashtable(); Object existing = modifiers.put( name, Void.TYPE/*arbitrary flag*/ ); if ( existing != null ) throw new IllegalStateException("Duplicate modifier: "+ name ); int count = 0; if ( hasModifier("private") ) ++count; if ( hasModifier("protected") ) ++count; if ( hasModifier("public") ) ++count; if ( count > 1 ) throw new IllegalStateException( "public/private/protected cannot be used in combination." ); switch( context ) { case CLASS: validateForClass(); break; case METHOD: validateForMethod(); break; case FIELD: validateForField(); break; } }
// in org/gjt/sp/jedit/bsh/Modifiers.java
private void insureNo( String modifier, String context ) { if ( hasModifier( modifier ) ) throw new IllegalStateException( context + " cannot be declared '"+modifier+"'"); }
0 1
            
// in org/gjt/sp/jedit/search/HyperSearchResults.java
Override public void exportToClipboard(JComponent comp, Clipboard clip, int action) throws IllegalStateException { TreePath [] paths = resultTree.getSelectionPaths(); ToStringNodes toStringNodes = new ToStringNodes(); for (TreePath path: paths) { DefaultMutableTreeNode operNode = (DefaultMutableTreeNode) path.getLastPathComponent(); toStringNodes.processNode(operNode); } StringSelection selection = new StringSelection( toStringNodes.nodesString.toString()); Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); clipboard.setContents(selection, null); }
1
            
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( IllegalStateException e ) { {if (true) throw createParseException( e.getMessage() );} }
1
            
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( IllegalStateException e ) { {if (true) throw createParseException( e.getMessage() );} }
0
unknown (Lib) InstantiationException 0 0 0 1
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(InstantiationException e) { throw new ReflectError("The class "+clas+" is abstract "); }
1
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(InstantiationException e) { throw new ReflectError("The class "+clas+" is abstract "); }
0
unknown (Lib) InternalError 36
            
// in org/gjt/sp/jedit/View.java
public void setSplitConfig(Buffer buffer, String splitConfig) { try { Component comp = restoreSplitConfig(buffer,splitConfig); setMainContent(comp); updateTitle(); } catch(IOException e) { // this should never throw an exception. throw new InternalError(); } }
// in org/gjt/sp/jedit/pluginmgr/InstallPanel.java
Override public void actionPerformed(ActionEvent evt) { switch (command) { case TAB_OUT_FORWARD: KeyboardFocusManager.getCurrentKeyboardFocusManager().focusNextComponent(); break; case TAB_OUT_BACK: KeyboardFocusManager.getCurrentKeyboardFocusManager().focusPreviousComponent(); break; case EDIT_PLUGIN: int[] rows = table.getSelectedRows(); Object[] state = new Object[rows.length]; for (int i=0 ; i<rows.length ; i++) { state[i] = pluginModel.getValueAt(rows[i],0); } for (int i=0 ; i<rows.length ; i++) { pluginModel.setValueAt(state[i].equals(Boolean.FALSE),rows[i],0); } break; case CLOSE_PLUGIN_MANAGER: window.ok(); break; default: throw new InternalError(); } }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
Override public void actionPerformed(ActionEvent evt) { switch (command) { case TAB_OUT_FORWARD: KeyboardFocusManager.getCurrentKeyboardFocusManager().focusNextComponent(); break; case TAB_OUT_BACK: KeyboardFocusManager.getCurrentKeyboardFocusManager().focusPreviousComponent(); break; case EDIT_PLUGIN: int[] rows = table.getSelectedRows(); for (int i = 0; i < rows.length; i++) { Object st = pluginModel.getValueAt(rows[i], 0); pluginModel.setValueAt(st.equals(Boolean.FALSE), rows[i], 0); } break; case CLOSE_PLUGIN_MANAGER: window.ok(); break; default: throw new InternalError(); } }
// in org/gjt/sp/jedit/gui/PanelWindowContainer.java
public void register(DockableWindowManagerImpl.Entry entry) { dockables.add(entry); //{{{ Create button int rotation; if(position.equals(DockableWindowManagerImpl.TOP) || position.equals(DockableWindowManagerImpl.BOTTOM)) rotation = RotatedTextIcon.NONE; else if(position.equals(DockableWindowManagerImpl.LEFT)) rotation = RotatedTextIcon.CCW; else if(position.equals(DockableWindowManagerImpl.RIGHT)) rotation = RotatedTextIcon.CW; else throw new InternalError("Invalid position: " + position); JToggleButton button = new JToggleButton(); button.setMargin(new Insets(1,1,1,1)); button.setRequestFocusEnabled(false); button.setIcon(new RotatedTextIcon(rotation,button.getFont(), entry.shortTitle())); button.setActionCommand(entry.factory.name); button.addActionListener(new ActionHandler()); button.addMouseListener(new MenuMouseHandler()); if(OperatingSystem.isMacOSLF()) button.putClientProperty("JButton.buttonType","toolbar"); //}}} buttonGroup.add(button); buttons.add(button); entry.btn = button; wm.revalidate(); }
// in org/gjt/sp/jedit/gui/VariableGridLayout.java
private Dimension getLayoutSize(Container parent, LayoutSize which) { synchronized (parent.getTreeLock()) { update(parent); int ncomponents = parent.getComponentCount(); long h = 0; long w = 0; for (int r = 0, i = 0; r < nrows; r++) { int row_height = 0; for (int c = 0; c < ncols; c++, i++) { if (i < ncomponents) { switch (which) { case MINIMUM: row_height = Math.max(row_height, parent.getComponent(i).getMinimumSize().height); break; case MAXIMUM: row_height = Math.max(row_height, parent.getComponent(i).getMaximumSize().height); break; case PREFERRED: row_height = Math.max(row_height, parent.getComponent(i).getPreferredSize().height); break; default: throw new InternalError("Missing case branch for LayoutSize: " + which); } }
// in org/gjt/sp/jedit/gui/ExtendedGridLayout.java
private Dimension getSize(Container parent, LayoutSize layoutSize, boolean fillRawSizes, Dimension gridSize, List<List<ExtendedGridLayoutConstraints>> gridRows, Set<ExtendedGridLayoutConstraints> colspans, Set<ExtendedGridLayoutConstraints> rowspans, int[][] resultArrays) { if (fillRawSizes && (resultArrays.length < 6)) { throw new IllegalArgumentException("If fillRawSizes is true, resultArrays.length must be >= 6 (" + resultArrays.length + ')'); } int[] minimumColWidths = new int[gridSize.width]; int[] minimumRowHeights = new int[gridSize.height]; int[] preferredColWidths = new int[gridSize.width]; int[] preferredRowHeights = new int[gridSize.height]; int[] maximumColWidths = new int[gridSize.width]; int[] maximumRowHeights = new int[gridSize.height]; Arrays.fill(minimumColWidths,0); Arrays.fill(minimumRowHeights,0); Arrays.fill(preferredColWidths,0); Arrays.fill(preferredRowHeights,0); Arrays.fill(maximumColWidths,0); Arrays.fill(maximumRowHeights,0); // get the maximum of the minimum sizes, // the maximum of the preferred sizes and // the minimum of the maximum sizes // of all rows and columns, not taking // rowspans and colspans into account for (int row=0 ; row<gridSize.height ; row++) { List<ExtendedGridLayoutConstraints> gridRow = gridRows.get(row); for (int col=0 ; col<gridSize.width ; col++) { ExtendedGridLayoutConstraints cell = gridRow.get(col); if ((null != cell) && (null != cell.getComponent())) { Component component = cell.getComponent(); Dimension minimumSize = component.getMinimumSize(); Dimension preferredSize = component.getPreferredSize(); Dimension maximumSize = component.getMaximumSize(); if (!colspans.contains(cell)) { minimumColWidths[col] = Math.max(minimumColWidths[col],minimumSize.width); preferredColWidths[col] = Math.max(preferredColWidths[col],preferredSize.width); maximumColWidths[col] = Math.max(maximumColWidths[col],maximumSize.width); } if (!rowspans.contains(cell)) { minimumRowHeights[row] = Math.max(minimumRowHeights[row],minimumSize.height); preferredRowHeights[row] = Math.max(preferredRowHeights[row],preferredSize.height); maximumRowHeights[row] = Math.max(maximumRowHeights[row],maximumSize.height); } } } } // correct cases where // minimumColWidths[col] <= preferredColWidths[col] <= maximumColWidths[col] // is not true by clipping to the minimumColWidths and maximumColWidths for (int col=0 ; col<gridSize.width ; col++) { if (minimumColWidths[col] >= maximumColWidths[col]) { maximumColWidths[col] = minimumColWidths[col]; preferredColWidths[col] = minimumColWidths[col]; } else if (preferredColWidths[col] < minimumColWidths[col]) { preferredColWidths[col] = minimumColWidths[col]; } else if (preferredColWidths[col] > maximumColWidths[col]) { preferredColWidths[col] = maximumColWidths[col]; } } // plug in the colspans and correct the minimum, preferred and // maximum column widths the colspans are part of for (ExtendedGridLayoutConstraints cell : colspans) { int fromCol = cell.getCol(); int colspan = cell.getEffectiveColspan(); int toCol = fromCol + colspan; int currentMinimumColWidth = 0; int currentPreferredColWidth = 0; int currentMaximumColWidth = 0; for (int col=fromCol ; col<toCol ; col++) { int minimumColWidth = minimumColWidths[col]; if ((Integer.MAX_VALUE-minimumColWidth) < currentMinimumColWidth) { currentMinimumColWidth = Integer.MAX_VALUE; } else { currentMinimumColWidth += minimumColWidth; } int preferredColWidth = preferredColWidths[col]; if ((Integer.MAX_VALUE-preferredColWidth) < currentPreferredColWidth) { currentPreferredColWidth = Integer.MAX_VALUE; } else { currentPreferredColWidth += preferredColWidth; } int maximumColWidth = maximumColWidths[col]; if ((Integer.MAX_VALUE-maximumColWidth) < currentMaximumColWidth) { currentMaximumColWidth = Integer.MAX_VALUE; } else { currentMaximumColWidth += maximumColWidth; } } Component component = cell.getComponent(); int wantedMaximumColWidth = component.getMaximumSize().width - ((colspan - 1) * hgap); if (currentMaximumColWidth < wantedMaximumColWidth) { redistributeSpace(currentMaximumColWidth, wantedMaximumColWidth, fromCol,toCol, maximumColWidths, maximumColWidths, maximumColWidths); } int wantedMinimumColWidth = component.getMinimumSize().width - ((colspan - 1) * hgap); if (currentMinimumColWidth < wantedMinimumColWidth) { redistributeSpace(currentMinimumColWidth, wantedMinimumColWidth, fromCol,toCol, minimumColWidths, minimumColWidths, maximumColWidths); } int wantedPreferredColWidth = component.getPreferredSize().width - ((colspan - 1) * hgap); if (currentPreferredColWidth < wantedPreferredColWidth) { redistributeSpace(currentPreferredColWidth, wantedPreferredColWidth, fromCol,toCol, preferredColWidths, minimumColWidths, maximumColWidths); } } // correct cases where // minimumColWidths[col] <= preferredColWidths[col] <= maximumColWidths[col] // is not true by clipping to the minimumColWidths and maximumColWidths for (int col=0 ; col<gridSize.width ; col++) { if (minimumColWidths[col] >= maximumColWidths[col]) { maximumColWidths[col] = minimumColWidths[col]; preferredColWidths[col] = minimumColWidths[col]; } else if (preferredColWidths[col] < minimumColWidths[col]) { preferredColWidths[col] = minimumColWidths[col]; } else if (preferredColWidths[col] > maximumColWidths[col]) { preferredColWidths[col] = maximumColWidths[col]; } } // correct cases where // minimumRowHeights[row] <= preferredRowHeights[row] <= maximumRowHeights[row] // is not true by clipping to the minimumRowHeights and maximumRowHeights for (int row=0 ; row<gridSize.height ; row++) { if (minimumRowHeights[row] >= maximumRowHeights[row]) { maximumRowHeights[row] = minimumRowHeights[row]; preferredRowHeights[row] = minimumRowHeights[row]; } else if (preferredRowHeights[row] < minimumRowHeights[row]) { preferredRowHeights[row] = minimumRowHeights[row]; } else if (preferredRowHeights[row] > maximumRowHeights[row]) { preferredRowHeights[row] = maximumRowHeights[row]; } } // plug in the rowspans and correct the minimum, preferred and // maximum row heights the rowspans are part of for (ExtendedGridLayoutConstraints cell : rowspans) { int fromRow = cell.getRow(); int rowspan = cell.getEffectiveRowspan(); int toRow = fromRow + rowspan; int currentMinimumRowHeight = 0; int currentPreferredRowHeight = 0; int currentMaximumRowHeight = 0; for (int row=fromRow ; row<toRow ; row++) { int minimumRowHeight = minimumRowHeights[row]; if ((Integer.MAX_VALUE-minimumRowHeight) < currentMinimumRowHeight) { currentMinimumRowHeight = Integer.MAX_VALUE; } else { currentMinimumRowHeight += minimumRowHeight; } int preferredRowHeight = preferredRowHeights[row]; if ((Integer.MAX_VALUE-preferredRowHeight) < currentPreferredRowHeight) { currentPreferredRowHeight = Integer.MAX_VALUE; } else { currentPreferredRowHeight += preferredRowHeight; } int maximumRowHeight = maximumRowHeights[row]; if ((Integer.MAX_VALUE-maximumRowHeight) < currentMaximumRowHeight) { currentMaximumRowHeight = Integer.MAX_VALUE; } else { currentMaximumRowHeight += maximumRowHeight; } } Component component = cell.getComponent(); int wantedMaximumRowHeight = component.getMaximumSize().height - ((rowspan - 1) * vgap); if (currentMaximumRowHeight < wantedMaximumRowHeight) { redistributeSpace(currentMaximumRowHeight, wantedMaximumRowHeight, fromRow,toRow, maximumRowHeights, maximumRowHeights, maximumRowHeights); } int wantedMinimumRowHeight = component.getMinimumSize().height - ((rowspan - 1) * vgap); if (currentMinimumRowHeight < wantedMinimumRowHeight) { redistributeSpace(currentMinimumRowHeight, wantedMinimumRowHeight, fromRow,toRow, minimumRowHeights, minimumRowHeights, maximumRowHeights); } int wantedPreferredRowHeight = component.getPreferredSize().height - ((rowspan - 1) * vgap); if (currentPreferredRowHeight < wantedPreferredRowHeight) { redistributeSpace(currentPreferredRowHeight, wantedPreferredRowHeight, fromRow,toRow, preferredRowHeights, minimumRowHeights, maximumRowHeights); } } // correct cases where // minimumRowHeights[row] <= preferredRowHeights[row] <= maximumRowHeights[row] // is not true by clipping to the minimumRowHeights and maximumRowHeights for (int row=0 ; row<gridSize.height ; row++) { if (minimumRowHeights[row] >= maximumRowHeights[row]) { maximumRowHeights[row] = minimumRowHeights[row]; preferredRowHeights[row] = minimumRowHeights[row]; } else if (preferredRowHeights[row] < minimumRowHeights[row]) { preferredRowHeights[row] = minimumRowHeights[row]; } else if (preferredRowHeights[row] > maximumRowHeights[row]) { preferredRowHeights[row] = maximumRowHeights[row]; } } // copies the computed sizes to the result arrays if (fillRawSizes) { resultArrays[0] = minimumColWidths; resultArrays[1] = minimumRowHeights; resultArrays[2] = preferredColWidths; resultArrays[3] = preferredRowHeights; resultArrays[4] = maximumColWidths; resultArrays[5] = maximumRowHeights; } // sums up the sizes for return value int[] colWidths; int[] rowHeights; switch (layoutSize) { case MINIMUM: colWidths = minimumColWidths; rowHeights = minimumRowHeights; break; case PREFERRED: colWidths = preferredColWidths; rowHeights = preferredRowHeights; break; case MAXIMUM: colWidths = maximumColWidths; rowHeights = maximumRowHeights; break; default: throw new InternalError("Missing case branch for LayoutSize: " + layoutSize); } long totalWidth = 0; long totalHeight = 0; for (int width : colWidths) { totalWidth += width; } for (int height : rowHeights) { totalHeight += height; } // add space between components or between // componetns and the borders of the parent container if (!fillRawSizes) { Insets insets = parent.getInsets(); totalWidth += insets.left + insets.right + ((gridSize.width - 1) * hgap) + distanceToBorders.left + distanceToBorders.right; totalHeight += insets.top + insets.bottom + ((gridSize.height - 1) * vgap) + distanceToBorders.top + distanceToBorders.bottom; } // clip the size to Integer.MAX_VALUE if too big if (totalWidth > Integer.MAX_VALUE) { totalWidth = Integer.MAX_VALUE; } if (totalHeight > Integer.MAX_VALUE) { totalHeight = Integer.MAX_VALUE; } return new Dimension((int)totalWidth,(int)totalHeight); }
// in org/gjt/sp/jedit/gui/DockablePanel.java
private int getAppropriateCursor() { String position = panel.getPosition(); if(position.equals(DockableWindowManager.TOP)) return Cursor.N_RESIZE_CURSOR; else if(position.equals(DockableWindowManager.LEFT)) return Cursor.W_RESIZE_CURSOR; else if(position.equals(DockableWindowManager.BOTTOM)) return Cursor.S_RESIZE_CURSOR; else if(position.equals(DockableWindowManager.RIGHT)) return Cursor.E_RESIZE_CURSOR; else throw new InternalError(); }
// in org/gjt/sp/jedit/gui/ToolBarManager.java
public void addToolBar(int group, int layer, Component toolbar) { Entry entry = new Entry(layer, toolbar); if (group == View.TOP_GROUP) addToolBar(top, topToolBars, entry); else if (group == View.BOTTOM_GROUP) addToolBar(bottom, bottomToolBars, entry); else throw new InternalError("Invalid tool bar group"); }
// in org/gjt/sp/jedit/gui/ContextAddDialog.java
public String getSelection() { if(!isOK) return null; if(separator.isSelected()) return "-"; else if(action.isSelected()) { AbstractContextOptionPane.MenuItem selectedValue = (AbstractContextOptionPane.MenuItem) list.getSelectedValue(); return selectedValue == null ? null : selectedValue.actionName; } else throw new InternalError(); }
// in org/gjt/sp/jedit/gui/JCheckBoxList.java
public Object getValueAt(int row, int col) { JCheckBoxList.Entry entry = items.get(row); switch(col) { case 0: return Boolean.valueOf(entry.checked); case 1: return entry.value; default: throw new InternalError(); } }
// in org/gjt/sp/jedit/gui/JCheckBoxList.java
Override public Class getColumnClass(int col) { switch(col) { case 0: return Boolean.class; case 1: return String.class; default: throw new InternalError(); } }
// in org/gjt/sp/jedit/gui/DockableWindowFactory.java
Override public void endElement(String uri, String localName, String name) { if(name == null) return; String tag = peekElement(); if(name.equals(tag)) { if(tag.equals("DOCKABLE")) { registerDockableWindow(plugin, dockableName,code.toString(),actions, movable); cachedDockableNames.add(dockableName); cachedDockableActionFlags.add( Boolean.valueOf(actions)); cachedDockableMovableFlags.add( Boolean.valueOf(movable)); // make default be true for the next // action actions = true; movable = MOVABLE_DEFAULT; code.setLength(0); } popElement(); } else { // can't happen throw new InternalError(); } }
// in org/gjt/sp/jedit/ActionListHandler.java
Override public void endElement(String uri, String localName, String qName) { String tag = peekElement(); if (qName.equals(tag)) { if (tag.equals("ACTION")) { String selected = (isSelected.length() > 0) ? isSelected.toString() : null; JEditAbstractEditAction action = actionSet.createBeanShellAction(actionName, code.toString(), selected, noRepeat, noRecord, noRememberLast); actionSet.addAction(action); noRepeat = noRecord = noRememberLast = false; code.setLength(0); isSelected.setLength(0); } popElement(); } else { // can't happen throw new InternalError(); } }
// in org/gjt/sp/jedit/OptionGroup.java
private void insertionSort(String newLabel, Object newObj) { if(sort) { for(int i = 0; i < members.size(); i++) { Object obj = members.elementAt(i); String label; if(obj instanceof OptionPane) { String name = ((OptionPane)obj).getName(); label = jEdit.getProperty("options." + name + ".label","NO LABEL PROPERTY: " + name); } else if(obj instanceof String) { label = jEdit.getProperty("options." + obj + ".label","NO LABEL PROPERTY: " + obj); } else if(obj instanceof OptionGroup) label = ((OptionGroup)obj).getLabel(); else throw new InternalError(); if(newLabel.compareToIgnoreCase(label) < 0) { members.insertElementAt(newObj,i); return; } } } members.addElement(newObj); }
// in org/gjt/sp/jedit/jEdit.java
Override public void run() { int pos; // Handle line number if(marker.startsWith("+line:")) { try { String arg = marker.substring(6); String[] lineCol = arg.split(","); int line, col; if(lineCol.length > 1) { line = Integer.parseInt(lineCol[0]); col = Integer.parseInt(lineCol[1]); } else { line = Integer.parseInt(marker.substring(6)); col = 1; } pos = buffer.getLineStartOffset(line - 1) + (col - 1); } catch(Exception e) { return; } } // Handle marker else if(marker.startsWith("+marker:")) { if(marker.length() != 9) return; Marker m = buffer.getMarker(marker.charAt(8)); if(m == null) return; pos = m.getPosition(); } // Can't happen else throw new InternalError(); if(view != null && view.getBuffer() == buffer) { view.getTextArea().setCaretPosition(pos); buffer.setIntegerProperty(Buffer.CARET,pos); buffer.setBooleanProperty(Buffer.CARET_POSITIONED,true); } else { buffer.setIntegerProperty(Buffer.CARET,pos); buffer.setBooleanProperty(Buffer.CARET_POSITIONED,true); buffer.unsetProperty(Buffer.SCROLL_VERT); } }
// in org/gjt/sp/jedit/buffer/UndoManager.java
public int undo() { if(insideCompoundEdit()) throw new InternalError("Unbalanced begin/endCompoundEdit()"); if(undosLast == null) return -1; else { reviseUndoId(); undoCount--; int caret = undosLast.undo(); redosFirst = undosLast; undosLast = undosLast.prev; if(undosLast == null) undosFirst = null; return caret; } }
// in org/gjt/sp/jedit/buffer/UndoManager.java
public int redo() { if(insideCompoundEdit()) throw new InternalError("Unbalanced begin/endCompoundEdit()"); if(redosFirst == null) return -1; else { reviseUndoId(); undoCount++; int caret = redosFirst.redo(); undosLast = redosFirst; if(undosFirst == null) undosFirst = undosLast; redosFirst = redosFirst.next; return caret; } }
// in org/gjt/sp/jedit/options/BrowserColorsOptionPane.java
public Class getColumnClass(int col) { switch(col) { case 0: return String.class; case 1: return Color.class; default: throw new InternalError(); } }
// in org/gjt/sp/jedit/options/DockingOptionPane.java
public Class getColumnClass(int col) { switch(col) { case 0: case 1: return String.class; default: throw new InternalError(); } }
// in org/gjt/sp/jedit/options/DockingOptionPane.java
public Object getValueAt(int row, int col) { Entry window = (Entry)windows.elementAt(row); switch(col) { case 0: return window.title; case 1: return window.dockPosition; default: throw new InternalError(); } }
// in org/gjt/sp/jedit/options/DockingOptionPane.java
public void setValueAt(Object value, int row, int col) { if(col == 0) return; Entry window = (Entry)windows.elementAt(row); switch(col) { case 1: window.dockPosition = (String)value; break; default: throw new InternalError(); } fireTableRowsUpdated(row,row); }
// in org/gjt/sp/jedit/options/DockingOptionPane.java
public String getColumnName(int index) { switch(index) { case 0: return jEdit.getProperty("options.docking.title"); case 1: return jEdit.getProperty("options.docking.dockPosition"); default: throw new InternalError(); } }
// in org/gjt/sp/jedit/options/ToolBarOptionPane.java
public ToolBarOptionPane.Button getSelection() { if(!isOK) return null; if(separator.isSelected()) return new ToolBarOptionPane.Button("-",null,null,"-"); else { Icon icon; String iconName; if(builtin.isSelected()) { ToolBarOptionPane.IconListEntry selectedIcon = (ToolBarOptionPane.IconListEntry) builtinCombo.getSelectedItem(); icon = selectedIcon.icon; iconName = selectedIcon.name; } else { icon = fileButton.getIcon(); iconName = fileIcon; if(iconName == null) iconName = "Blank24.gif"; } String label; String actionName; if(action.isSelected()) { ToolBarOptionPane.Button button = (ToolBarOptionPane.Button)list .getSelectedValue(); label = button.label; actionName = button.actionName; } else throw new InternalError(); return new ToolBarOptionPane.Button(actionName, iconName,icon,label); } }
// in org/gjt/sp/jedit/options/BufferOptionPane.java
Override protected void _save() { int index = lineSeparator.getSelectedIndex(); String lineSep; if(index == 0) lineSep = "\n"; else if(index == 1) lineSep = "\r\n"; else if(index == 2) lineSep = "\r"; else throw new InternalError(); String oldLineSep = buffer.getStringProperty(JEditBuffer.LINESEP); if(oldLineSep == null) oldLineSep = System.getProperty("line.separator"); if(!oldLineSep.equals(lineSep)) { buffer.setStringProperty(JEditBuffer.LINESEP, lineSep); buffer.setDirty(true); } String encoding = (String)this.encoding.getSelectedItem(); String oldEncoding = buffer.getStringProperty(JEditBuffer.ENCODING); if(!oldEncoding.equals(encoding)) { buffer.setStringProperty(JEditBuffer.ENCODING,encoding); buffer.setDirty(true); // Disable auto-detect because user explicitly // specify an encoding. buffer.setBooleanProperty(Buffer.ENCODING_AUTODETECT,false); } boolean gzippedValue = gzipped.isSelected(); boolean oldGzipped = buffer.getBooleanProperty( Buffer.GZIPPED); if(gzippedValue != oldGzipped) { buffer.setBooleanProperty(Buffer.GZIPPED,gzippedValue); buffer.setDirty(true); } buffer.setStringProperty("folding",(String)folding.getSelectedItem()); buffer.setStringProperty("wrap",(String)wrap.getSelectedItem()); try { buffer.setProperty("maxLineLen",new Integer( maxLineLen.getSelectedItem().toString())); } catch(NumberFormatException nf) { } try { buffer.setProperty("tabSize",new Integer( tabSize.getSelectedItem().toString())); } catch(NumberFormatException nf) { } try { buffer.setProperty("indentSize",new Integer( indentSize.getSelectedItem().toString())); } catch(NumberFormatException nf) { } buffer.setBooleanProperty("noTabs",noTabs.isSelected()); buffer.setBooleanProperty("elasticTabstops",elasticTabstops.isSelected()); buffer.setStringProperty("autoIndent", (String)autoIndent.getSelectedItem()); index = mode.getSelectedIndex(); buffer.setMode(modes[index]); switch(checkModStatus.getSelectedIndex()) { case 0: buffer.setAutoReloadDialog(false); buffer.setAutoReload(false); break; case 1: buffer.setAutoReloadDialog(true); buffer.setAutoReload(false); break; case 2: buffer.setAutoReloadDialog(true); buffer.setAutoReload(true); break; case 3: buffer.setAutoReloadDialog(false); buffer.setAutoReload(true); break; } }
// in org/gjt/sp/jedit/textarea/TextArea.java
public void setSelectedText(Selection s, String selectedText) { if(!isEditable()) { throw new InternalError("Text component" + " read only"); } try { buffer.beginCompoundEdit(); moveCaretPosition(s.setText(buffer,selectedText)); } // No matter what happends... stops us from leaving buffer // in a bad state finally { buffer.endCompoundEdit(); } // no no no!!!! //selectNone(); }
// in org/gjt/sp/jedit/textarea/Selection.java
Override public Object clone() { try { return super.clone(); } catch(CloneNotSupportedException e) { throw new InternalError("I just drank a whole " + "bottle of cough syrup and I feel " + "funny!"); } }
// in org/gjt/sp/jedit/textarea/RangeMap.java
void put(int start, int end, int[] put) { if(Debug.FOLD_VIS_DEBUG) { StringBuilder buf = new StringBuilder(50); buf.append("fvmput(").append(start).append(','); buf.append(end).append(','); buf.append('{'); if(put != null) { for(int i = 0; i < put.length; i++) { if(i != 0) buf.append(','); buf.append(put[i]); } } buf.append("})"); Log.log(Log.DEBUG,this,buf.toString()); } int putl = put == null ? 0 : put.length; int delta = putl - (end - start); if(fvmcount + delta > fvm.length) { int[] newfvm = new int[(fvm.length << 1) + 1]; System.arraycopy(fvm,0,newfvm,0,fvmcount); fvm = newfvm; } if(delta != 0) { System.arraycopy(fvm,end,fvm,start + putl, fvmcount - end); } if(putl != 0) { System.arraycopy(put,0,fvm,start,put.length); } fvmcount += delta; dump(); if(fvmcount == 0) throw new InternalError(); }
// in org/gjt/sp/jedit/textarea/BufferHandler.java
public void transactionComplete(JEditBuffer buffer) { if(textArea.getDisplayManager() != displayManager) { delayedUpdate = false; return; } if(delayedUpdate) doDelayedUpdate(); textArea._finishCaretUpdate(); delayedUpdate = false; //{{{ Debug code if(Debug.SCROLL_VERIFY) { int line = delayedUpdateStart; if(!displayManager.isLineVisible(line)) line = displayManager.getNextVisibleLine(line); System.err.println(delayedUpdateStart + ":" + delayedUpdateEnd + ':' + textArea.getLineCount()); int scrollLineCount = 0; while(line != -1 && line <= delayedUpdateEnd) { scrollLineCount += displayManager.getScreenLineCount(line); line = displayManager.getNextVisibleLine(line); } if(scrollLineCount != displayManager.getScrollLineCount()) { throw new InternalError(scrollLineCount + " != " + displayManager.getScrollLineCount()); } } //}}} }
// in org/gjt/sp/jedit/syntax/XModeHandler.java
public void endElement(String uri, String localName, String name) { TagDecl tag = popElement(); if (name.equals(tag.tagName)) { if(tag.lastDelegateSet != null && ! tag.tagName.equals("IMPORT") && ! tag.lastDelegateSet.getModeName().equals(modeName)) { Mode mode = ModeProvider.instance.getMode(tag.lastDelegateSet.getModeName()); if( ! reloadModes.contains(mode) ) { reloadModes.add(mode); } } //{{{ PROPERTY if (tag.tagName.equals("PROPERTY")) { props.put(propName,propValue); } //}}} //{{{ PROPS else if (tag.tagName.equals("PROPS")) { if(peekElement().tagName.equals("RULES")) rules.setProperties(props); else modeProps = props; props = new Hashtable<String, String>(); } //}}} //{{{ RULES else if (tag.tagName.equals("RULES")) { rules.setKeywords(keywords); keywords = null; rules = null; } //}}} //{{{ IMPORT else if (tag.tagName.equals("IMPORT")) { // prevent lockups if (!rules.equals(tag.lastDelegateSet)) { rules.addRuleSet(tag.lastDelegateSet); } } //}}} //{{{ TERMINATE else if (tag.tagName.equals("TERMINATE")) { rules.setTerminateChar(tag.termChar); } //}}} //{{{ SEQ else if (tag.tagName.equals("SEQ")) { if(tag.lastStart == null) { error("empty-tag","SEQ"); return; } rules.addRule(ParserRule.createSequenceRule( tag.lastStartPosMatch,tag.lastStart.toString(), tag.lastDelegateSet,tag.lastTokenID)); } //}}} //{{{ SEQ_REGEXP else if (tag.tagName.equals("SEQ_REGEXP")) { if(tag.lastStart == null) { error("empty-tag","SEQ_REGEXP"); return; } try { if (null != tag.lastHashChars) { rules.addRule(ParserRule.createRegexpSequenceRule( tag.lastStartPosMatch,tag.lastHashChars.toCharArray(), tag.lastStart.toString(),tag.lastDelegateSet, tag.lastTokenID,findParent("RULES").lastIgnoreCase)); } else { rules.addRule(ParserRule.createRegexpSequenceRule( tag.lastHashChar,tag.lastStartPosMatch, tag.lastStart.toString(),tag.lastDelegateSet, tag.lastTokenID,findParent("RULES").lastIgnoreCase)); } } catch(PatternSyntaxException re) { error("regexp",re); } } //}}} //{{{ SPAN else if (tag.tagName.equals("SPAN")) { if(tag.lastStart == null) { error("empty-tag","BEGIN"); return; } if(tag.lastEnd == null) { error("empty-tag","END"); return; } rules.addRule(ParserRule .createSpanRule( tag.lastStartPosMatch,tag.lastStart.toString(), tag.lastEndPosMatch,tag.lastEnd.toString(), tag.lastDelegateSet, tag.lastTokenID,tag.lastMatchType, tag.lastNoLineBreak, tag.lastNoWordBreak, tag.lastEscape)); } //}}} //{{{ SPAN_REGEXP else if (tag.tagName.equals("SPAN_REGEXP")) { if(tag.lastStart == null) { error("empty-tag","BEGIN"); return; } if(tag.lastEnd == null) { error("empty-tag","END"); return; } try { if (null != tag.lastHashChars) { rules.addRule(ParserRule .createRegexpSpanRule( tag.lastStartPosMatch,tag.lastHashChars.toCharArray(), tag.lastStart.toString(), tag.lastEndPosMatch,tag.lastEnd.toString(), tag.lastDelegateSet, tag.lastTokenID, tag.lastMatchType, tag.lastNoLineBreak, tag.lastNoWordBreak, findParent("RULES").lastIgnoreCase, tag.lastEscape, tag.lastEndRegexp)); } else { rules.addRule(ParserRule .createRegexpSpanRule( tag.lastHashChar, tag.lastStartPosMatch,tag.lastStart.toString(), tag.lastEndPosMatch,tag.lastEnd.toString(), tag.lastDelegateSet, tag.lastTokenID, tag.lastMatchType, tag.lastNoLineBreak, tag.lastNoWordBreak, findParent("RULES").lastIgnoreCase, tag.lastEscape, tag.lastEndRegexp)); } } catch(PatternSyntaxException re) { error("regexp",re); } } //}}} //{{{ EOL_SPAN else if (tag.tagName.equals("EOL_SPAN")) { if(tag.lastStart == null) { error("empty-tag","EOL_SPAN"); return; } rules.addRule(ParserRule.createEOLSpanRule( tag.lastStartPosMatch,tag.lastStart.toString(), tag.lastDelegateSet,tag.lastTokenID, tag.lastMatchType)); } //}}} //{{{ EOL_SPAN_REGEXP else if (tag.tagName.equals("EOL_SPAN_REGEXP")) { if(tag.lastStart == null) { error("empty-tag","EOL_SPAN_REGEXP"); return; } try { if (null != tag.lastHashChars) { rules.addRule(ParserRule.createRegexpEOLSpanRule( tag.lastStartPosMatch,tag.lastHashChars.toCharArray(), tag.lastStart.toString(),tag.lastDelegateSet, tag.lastTokenID,tag.lastMatchType, findParent("RULES").lastIgnoreCase)); } else { rules.addRule(ParserRule.createRegexpEOLSpanRule( tag.lastHashChar,tag.lastStartPosMatch, tag.lastStart.toString(),tag.lastDelegateSet, tag.lastTokenID,tag.lastMatchType, findParent("RULES").lastIgnoreCase)); } } catch(PatternSyntaxException re) { error("regexp",re); } } //}}} //{{{ MARK_FOLLOWING else if (tag.tagName.equals("MARK_FOLLOWING")) { if(tag.lastStart == null) { error("empty-tag","MARK_FOLLOWING"); return; } rules.addRule(ParserRule .createMarkFollowingRule( tag.lastStartPosMatch,tag.lastStart.toString(), tag.lastTokenID,tag.lastMatchType)); } //}}} //{{{ MARK_PREVIOUS else if (tag.tagName.equals("MARK_PREVIOUS")) { if(tag.lastStart == null) { error("empty-tag","MARK_PREVIOUS"); return; } rules.addRule(ParserRule .createMarkPreviousRule( tag.lastStartPosMatch,tag.lastStart.toString(), tag.lastTokenID,tag.lastMatchType)); } //}}} //{{{ Keywords else if ( !tag.tagName.equals("END") && !tag.tagName.equals("BEGIN") && !tag.tagName.equals("KEYWORDS") && !tag.tagName.equals("MODE")) { byte token = Token.stringToToken(tag.tagName); if(token != -1) { if (tag.lastKeyword == null || tag.lastKeyword.length() == 0) { error("empty-keyword", null); } else { addKeyword(tag.lastKeyword.toString(),token); } } } //}}} } else { // can't happen throw new InternalError(); } }
// in org/gjt/sp/jedit/syntax/TokenMarker.java
private boolean handleRuleStart(ParserRule checkRule) { // Some rules can only match in certain locations if (null == checkRule.upHashChars) { if (checkRule.upHashChar != null && (pos + checkRule.upHashChar.length < line.array.length) && !checkHashString(checkRule)) { return false; } } else { if (-1 == Arrays.binarySearch( checkRule.upHashChars, Character.toUpperCase(line.array[pos]))) { return false; } } int offset = (checkRule.action & ParserRule.MARK_PREVIOUS) != 0 ? lastOffset : pos; if(!offsetMatches(offset, checkRule.startPosMatch)) { return false; } int matchedChars; Matcher match = null; // See if the rule's start sequence matches here if((checkRule.action & ParserRule.REGEXP) == 0) { pattern.array = checkRule.start; pattern.offset = 0; pattern.count = pattern.array.length; matchedChars = pattern.count; if(!SyntaxUtilities.regionMatches(context.rules .getIgnoreCase(),line,pos,pattern.array)) { return false; } } else { // note that all regexps start with \A so they only // match the start of the string //int matchStart = pos - line.offset; CharSequence charSeq = new SegmentCharSequence(line, pos - line.offset, line.count - (pos - line.offset)); match = checkRule.startRegexp.matcher(charSeq); if(!match.lookingAt()) { return false; } else if(match.start() != 0) { throw new InternalError("Can't happen"); } else { matchedChars = match.end(); /* workaround for hang if match was * zero-width. not sure if there is * a better way to handle this */ if(matchedChars == 0) matchedChars = 1; } } if((checkRule.action & ParserRule.IS_ESCAPE) == ParserRule.IS_ESCAPE) { pos += pattern.count; } else { if(context.inRule != null) handleRuleEnd(context.inRule); markKeyword((checkRule.action & ParserRule.MARK_PREVIOUS) != ParserRule.MARK_PREVIOUS); switch(checkRule.action & ParserRule.MAJOR_ACTIONS) { //{{{ SEQ case ParserRule.SEQ: context.spanEndSubst = null; context.spanEndSubstRegex = null; if((checkRule.action & ParserRule.REGEXP) != 0) { handleTokenWithSpaces(tokenHandler, checkRule.token, pos - line.offset, matchedChars, context); } else { tokenHandler.handleToken(line, checkRule.token, pos - line.offset, matchedChars,context); } // a DELEGATE attribute on a SEQ changes the // ruleset from the end of the SEQ onwards if(checkRule.delegate != null) { context = new LineContext( checkRule.delegate, context.parent); keywords = context.rules.getKeywords(); } break; //}}} //{{{ SPAN, EOL_SPAN case ParserRule.SPAN: case ParserRule.EOL_SPAN: context.setInRule(checkRule); byte tokenType = matchToken(checkRule, context.inRule, context); if((checkRule.action & ParserRule.REGEXP) != 0) { handleTokenWithSpaces(tokenHandler, tokenType, pos - line.offset, matchedChars, context); } else { tokenHandler.handleToken(line,tokenType, pos - line.offset, matchedChars,context); } char[] spanEndSubst = null; Pattern spanEndSubstRegex = null; /* substitute result of matching the rule start * into the end string. * * eg, in shell script mode, <<\s*(\w+) is * matched into \<$1\> to construct rules for * highlighting read-ins like this <<EOF * ... * EOF */ if(match != null && match.groupCount() > 0) { if (checkRule.end != null) { spanEndSubst = substitute(match, checkRule.end, false); } else if (checkRule.endRegexp != null) { char[] pattern = checkRule.endRegexp.pattern().toCharArray(); pattern = substitute(match, pattern, true); spanEndSubstRegex = Pattern.compile(new String(pattern)); } } context.spanEndSubst = spanEndSubst; context.spanEndSubstRegex = spanEndSubstRegex; context = new LineContext( checkRule.delegate, context); keywords = context.rules.getKeywords(); break; //}}} //{{{ MARK_FOLLOWING case ParserRule.MARK_FOLLOWING: tokenHandler.handleToken(line, matchToken(checkRule, checkRule, context), pos - line.offset, pattern.count,context); context.spanEndSubst = null; context.spanEndSubstRegex = null; context.setInRule(checkRule); break; //}}} //{{{ MARK_PREVIOUS case ParserRule.MARK_PREVIOUS: context.spanEndSubst = null; context.spanEndSubstRegex = null; if(pos != lastOffset) { tokenHandler.handleToken(line, checkRule.token, lastOffset - line.offset, pos - lastOffset, context); } tokenHandler.handleToken(line, matchToken(checkRule, checkRule, context), pos - line.offset,pattern.count, context); break; //}}} default: throw new InternalError("Unhandled major action"); } // move pos to last character of match sequence pos += matchedChars - 1; lastOffset = pos + 1; // break out of inner for loop to check next char } return true; }
// in org/gjt/sp/jedit/ServiceListHandler.java
public void endElement(String uri, String localName, String name) { String tag = peekElement(); if(name.equals(tag)) { if (tag.equals("SERVICE")) { ServiceManager.Descriptor d = new ServiceManager.Descriptor( serviceClass,serviceName,code.toString(),plugin); ServiceManager.registerService(d); cachedServices.add(d); code.setLength(0); } popElement(); } else { // can't happen throw new InternalError(); } }
// in org/gjt/sp/util/WorkThreadPool.java
Request getNextRequest() { synchronized(lock) { Request request = firstRequest; if(request == null) return null; firstRequest = firstRequest.next; if(firstRequest == null) lastRequest = null; if(request.alreadyRun) throw new InternalError("AIEE!!! Request run twice!!! " + request.run); request.alreadyRun = true; /* StringBuffer buf = new StringBuffer("request queue is now: "); Request _request = request.next; while(_request != null) { buf.append(_request.id); if(_request.next != null) buf.append(","); _request = _request.next; } Log.log(Log.DEBUG,this,buf.toString()); */ return request; } }
// in org/gjt/sp/util/WorkThreadPool.java
private Request getNextAWTRequest() { Request request = firstAWTRequest; firstAWTRequest = firstAWTRequest.next; if(firstAWTRequest == null) lastAWTRequest = null; if(request.alreadyRun) throw new InternalError("AIEE!!! Request run twice!!! " + request.run); request.alreadyRun = true; /* StringBuffer buf = new StringBuffer("AWT request queue is now: "); Request _request = request.next; while(_request != null) { buf.append(_request.id); if(_request.next != null) buf.append(","); _request = _request.next; } Log.log(Log.DEBUG,this,buf.toString()); */ return request; }
3
            
// in org/gjt/sp/jedit/View.java
catch(IOException e) { // this should never throw an exception. throw new InternalError(); }
// in org/gjt/sp/jedit/textarea/Selection.java
catch(CloneNotSupportedException e) { throw new InternalError("I just drank a whole " + "bottle of cough syrup and I feel " + "funny!"); }
// in org/gjt/sp/jedit/Macros.java
catch (Exception e) { throw new InternalError("Missing or invalid glob for handler " + name); }
0 0 0 0
runtime (Domain) InterpreterError
public class InterpreterError extends RuntimeException
{
	public InterpreterError(String s)
	{
		super(s);
	}
}
90
            
// in org/gjt/sp/jedit/bsh/BSHUnaryExpression.java
private Object primitiveWrapperUnaryOperation(Object val, int kind) throws UtilEvalError { Class operandType = val.getClass(); Object operand = Primitive.promoteToInteger(val); if ( operand instanceof Boolean ) return new Boolean( Primitive.booleanUnaryOperation((Boolean)operand, kind)); else if ( operand instanceof Integer ) { int result = Primitive.intUnaryOperation((Integer)operand, kind); // ++ and -- must be cast back the original type if(kind == INCR || kind == DECR) { if(operandType == Byte.TYPE) return new Byte((byte)result); if(operandType == Short.TYPE) return new Short((short)result); if(operandType == Character.TYPE) return new Character((char)result); } return new Integer(result); } else if(operand instanceof Long) return new Long(Primitive.longUnaryOperation((Long)operand, kind)); else if(operand instanceof Float) return new Float(Primitive.floatUnaryOperation((Float)operand, kind)); else if(operand instanceof Double) return new Double(Primitive.doubleUnaryOperation((Double)operand, kind)); else throw new InterpreterError("An error occurred. Please call technical support."); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
public Object doSuffix( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError { // Handle ".class" suffix operation // Prefix must be a BSHType if ( operation == CLASS ) if ( obj instanceof BSHType ) { if ( toLHS ) throw new EvalError("Can't assign .class", this, callstack ); NameSpace namespace = callstack.top(); return ((BSHType)obj).getType( callstack, interpreter ); } else throw new EvalError( "Attempt to use .class suffix on non class.", this, callstack ); /* Evaluate our prefix if it needs evaluating first. If this is the first evaluation our prefix mayb be a Node (directly from the PrimaryPrefix) - eval() it to an object. If it's an LHS, resolve to a value. Note: The ambiguous name construct is now necessary where the node may be an ambiguous name. If this becomes common we might want to make a static method nodeToObject() or something. The point is that we can't just eval() - we need to direct the evaluation to the context sensitive type of result; namely object, class, etc. */ if ( obj instanceof SimpleNode ) if ( obj instanceof BSHAmbiguousName ) obj = ((BSHAmbiguousName)obj).toObject(callstack, interpreter); else obj = ((SimpleNode)obj).eval(callstack, interpreter); else if ( obj instanceof LHS ) try { obj = ((LHS)obj).getValue(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } try { switch(operation) { case INDEX: return doIndex( obj, toLHS, callstack, interpreter ); case NAME: return doName( obj, toLHS, callstack, interpreter ); case PROPERTY: return doProperty( toLHS, obj, callstack, interpreter ); default: throw new InterpreterError( "Unknown suffix type" ); } } catch(ReflectError e) { throw new EvalError("reflection error: " + e, this, callstack ); } catch(InvocationTargetException e) { throw new TargetError( "target exception", e.getTargetException(), this, callstack, true); } }
// in org/gjt/sp/jedit/bsh/BshMethod.java
Object invoke( Object[] argValues, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean overrideNameSpace ) throws EvalError { if ( argValues != null ) for (int i=0; i<argValues.length; i++) if ( argValues[i] == null ) throw new Error("HERE!"); if ( javaMethod != null ) try { return Reflect.invokeMethod( javaMethod, javaObject, argValues ); } catch ( ReflectError e ) { throw new EvalError( "Error invoking Java method: "+e, callerInfo, callstack ); } catch ( InvocationTargetException e2 ) { throw new TargetError( "Exception invoking imported object method.", e2, callerInfo, callstack, true/*isNative*/ ); } // is this a syncrhonized method? if ( modifiers != null && modifiers.hasModifier("synchronized") ) { // The lock is our declaring namespace's This reference // (the method's 'super'). Or in the case of a class it's the // class instance. Object lock; if ( declaringNameSpace.isClass ) { try { lock = declaringNameSpace.getClassInstance(); } catch ( UtilEvalError e ) { throw new InterpreterError( "Can't get class instance for synchronized method."); } } else lock = declaringNameSpace.getThis(interpreter); // ??? synchronized( lock ) { return invokeImpl( argValues, interpreter, callstack, callerInfo, overrideNameSpace ); } } else return invokeImpl( argValues, interpreter, callstack, callerInfo, overrideNameSpace ); }
// in org/gjt/sp/jedit/bsh/This.java
static This getThis( NameSpace namespace, Interpreter declaringInterpreter ) { try { Class c; if ( Capabilities.canGenerateInterfaces() ) c = Class.forName( "org.gjt.sp.jedit.bsh.XThis" ); else if ( Capabilities.haveSwing() ) c = Class.forName( "org.gjt.sp.jedit.bsh.JThis" ); else return new This( namespace, declaringInterpreter ); return (This)Reflect.constructObject( c, new Object [] { namespace, declaringInterpreter } ); } catch ( Exception e ) { throw new InterpreterError("internal error 1 in This: "+e); } }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
public static Class generateClassImpl( String name, Modifiers modifiers, Class [] interfaces, Class superClass, BSHBlock block, boolean isInterface, CallStack callstack, Interpreter interpreter ) throws EvalError { // Scripting classes currently requires accessibility // This can be eliminated with a bit more work. try { Capabilities.setAccessibility( true ); } catch ( Capabilities.Unavailable e ) { throw new EvalError( "Defining classes currently requires reflective Accessibility.", block, callstack ); } NameSpace enclosingNameSpace = callstack.top(); String packageName = enclosingNameSpace.getPackage(); String className = enclosingNameSpace.isClass ? ( enclosingNameSpace.getName()+"$"+name ) : name; String fqClassName = packageName == null ? className : packageName + "." + className; BshClassManager bcm = interpreter.getClassManager(); // Race condition here... bcm.definingClass( fqClassName ); // Create the class static namespace NameSpace classStaticNameSpace = new NameSpace( enclosingNameSpace, className); classStaticNameSpace.isClass = true; callstack.push( classStaticNameSpace ); // Evaluate any inner class class definitions in the block // effectively recursively call this method for contained classes first block.evalBlock( callstack, interpreter, true/*override*/, ClassNodeFilter.CLASSCLASSES ); // Generate the type for our class Variable [] variables = getDeclaredVariables( block, callstack, interpreter, packageName ); DelayedEvalBshMethod [] methods = getDeclaredMethods( block, callstack, interpreter, packageName ); ClassGeneratorUtil classGenerator = new ClassGeneratorUtil( modifiers, className, packageName, superClass, interfaces, variables, methods, classStaticNameSpace, isInterface ); byte [] code = classGenerator.generateClass(); // if debug, write out the class file to debugClasses directory String dir = System.getProperty("debugClasses"); if ( dir != null ) try { FileOutputStream out= new FileOutputStream( dir+"/"+className+".class" ); out.write(code); out.close(); } catch ( IOException e ) { } // Define the new class in the classloader Class genClass = bcm.defineClass( fqClassName, code ); // import the unq name into parent enclosingNameSpace.importClass( fqClassName.replace('$','.') ); try { classStaticNameSpace.setLocalVariable( ClassGeneratorUtil.BSHINIT, block, false/*strictJava*/ ); } catch ( UtilEvalError e ) { throw new InterpreterError("unable to init static: "+e ); } // Give the static space its class static import // important to do this after all classes are defined classStaticNameSpace.setClassStatic( genClass ); // evaluate the static portion of the block in the static space block.evalBlock( callstack, interpreter, true/*override*/, ClassNodeFilter.CLASSSTATIC ); callstack.pop(); if ( !genClass.isInterface() ) { // Set the static bsh This callback String bshStaticFieldName = ClassGeneratorUtil.BSHSTATIC+className; try { LHS lhs = Reflect.getLHSStaticField( genClass, bshStaticFieldName ); lhs.assign( classStaticNameSpace.getThis( interpreter ), false/*strict*/ ); } catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); } } bcm.doneDefiningClass( fqClassName ); return genClass; }
// in org/gjt/sp/jedit/bsh/Reflect.java
static Object invokeMethod( Method method, Object object, Object[] args ) throws ReflectError, InvocationTargetException { if ( args == null ) args = new Object[0]; logInvokeMethod( "Invoking method (entry): ", method, args ); // Map types to assignable forms, need to keep this fast... Object [] tmpArgs = new Object [ args.length ]; Class [] types = method.getParameterTypes(); try { for (int i=0; i<args.length; i++) tmpArgs[i] = Types.castObject( args[i]/*rhs*/, types[i]/*lhsType*/, Types.ASSIGNMENT ); } catch ( UtilEvalError e ) { throw new InterpreterError( "illegal argument type in method invocation: "+e ); } // unwrap any primitives tmpArgs = Primitive.unwrap( tmpArgs ); logInvokeMethod( "Invoking method (after massaging values): ", method, tmpArgs ); try { Object returnValue = method.invoke( object, tmpArgs ); if ( returnValue == null ) returnValue = Primitive.NULL; Class returnType = method.getReturnType(); return Primitive.wrap( returnValue, returnType ); } catch( IllegalAccessException e ) { throw new ReflectError( "Cannot access method " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " in '" + method.getDeclaringClass() + "' :" + e ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Method resolveJavaMethod( BshClassManager bcm, Class clas, String name, Class [] types, boolean staticOnly ) throws UtilEvalError { if ( clas == null ) throw new InterpreterError("null class"); // Lookup previously cached method Method method = null; if ( bcm == null ) Interpreter.debug("resolveJavaMethod UNOPTIMIZED lookup"); else method = bcm.getResolvedMethod( clas, name, types, staticOnly ); if ( method == null ) { boolean publicOnly = !Capabilities.haveAccessibility(); // Searching for the method may, itself be a priviledged action try { method = findOverloadedMethod( clas, name, types, publicOnly ); } catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching methods of: "+clas, e ); } checkFoundStaticMethod( method, staticOnly, clas ); // This is the first time we've seen this method, set accessibility // Note: even if it's a public method, we may have found it in a // non-public class if ( method != null && !publicOnly ) { try { ReflectManager.RMSetAccessible( method ); } catch ( UtilEvalError e ) { /*ignore*/ } } // If succeeded cache the resolved method. if ( method != null && bcm != null ) bcm.cacheResolvedMethod( clas, types, method ); } return method; }
// in org/gjt/sp/jedit/bsh/SimpleNode.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { throw new InterpreterError( "Unimplemented or inappropriate for " + getClass().getName() ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { throw new InterpreterError( "Don't know how to eval an ambiguous name!" +" Use toObject() if you want an object." ); }
// in org/gjt/sp/jedit/bsh/BSHLiteral.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { if ( value == null ) throw new InterpreterError("Null in bsh literal: "+value); return value; }
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { BSHBlock tryBlock = ((BSHBlock)jjtGetChild(0)); Vector catchParams = new Vector(); Vector catchBlocks = new Vector(); int nchild = jjtGetNumChildren(); Node node = null; int i=1; while((i < nchild) && ((node = jjtGetChild(i++)) instanceof BSHFormalParameter)) { catchParams.addElement(node); catchBlocks.addElement(jjtGetChild(i++)); node = null; } // finaly block BSHBlock finallyBlock = null; if(node != null) finallyBlock = (BSHBlock)node; // Why both of these? TargetError target = null; Throwable thrown = null; Object ret = null; /* Evaluate the contents of the try { } block and catch any resulting TargetErrors generated by the script. We save the callstack depth and if an exception is thrown we pop back to that depth before contiuing. The exception short circuited any intervening method context pops. Note: we the stack info... what do we do with it? append to exception message? */ int callstackDepth = callstack.depth(); try { ret = tryBlock.eval(callstack, interpreter); } catch( TargetError e ) { target = e; String stackInfo = "Bsh Stack: "; while ( callstack.depth() > callstackDepth ) stackInfo += "\t" + callstack.pop() +"\n"; } // unwrap the target error if ( target != null ) thrown = target.getTarget(); // If we have an exception, find a catch if (thrown != null) { int n = catchParams.size(); for(i=0; i<n; i++) { // Get catch block BSHFormalParameter fp = (BSHFormalParameter)catchParams.elementAt(i); // Should cache this subject to classloader change message // Evaluation of the formal parameter simply resolves its // type via the specified namespace.. it doesn't modify the // namespace. fp.eval( callstack, interpreter ); if ( fp.type == null && interpreter.getStrictJava() ) throw new EvalError( "(Strict Java) Untyped catch block", this, callstack ); // If the param is typed check assignability if ( fp.type != null ) try { thrown = (Throwable)Types.castObject( thrown/*rsh*/, fp.type/*lhsType*/, Types.ASSIGNMENT ); } catch( UtilEvalError e ) { /* Catch the mismatch and continue to try the next Note: this is innefficient, should have an isAssignableFrom() that doesn't throw // TODO: we do now have a way to test assignment // in castObject(), use it? */ continue; } // Found match, execute catch block BSHBlock cb = (BSHBlock)(catchBlocks.elementAt(i)); // Prepare to execute the block. // We must create a new BlockNameSpace to hold the catch // parameter and swap it on the stack after initializing it. NameSpace enclosingNameSpace = callstack.top(); BlockNameSpace cbNameSpace = new BlockNameSpace( enclosingNameSpace ); try { if ( fp.type == BSHFormalParameter.UNTYPED ) // set an untyped variable directly in the block cbNameSpace.setBlockVariable( fp.name, thrown ); else { // set a typed variable (directly in the block) Modifiers modifiers = new Modifiers(); cbNameSpace.setTypedVariable( fp.name, fp.type, thrown, new Modifiers()/*none*/ ); } } catch ( UtilEvalError e ) { throw new InterpreterError( "Unable to set var in catch block namespace." ); } // put cbNameSpace on the top of the stack callstack.swap( cbNameSpace ); try { ret = cb.eval( callstack, interpreter ); } finally { // put it back callstack.swap( enclosingNameSpace ); } target = null; // handled target break; } } // evaluate finally block if(finallyBlock != null) ret = finallyBlock.eval(callstack, interpreter); // exception fell through, throw it upward... if(target != null) throw target; if(ret instanceof ReturnControl) return ret; else return Primitive.VOID; }
// in org/gjt/sp/jedit/bsh/Name.java
synchronized public Object toObject( CallStack callstack, Interpreter interpreter, boolean forceClass ) throws UtilEvalError { reset(); Object obj = null; while( evalName != null ) obj = consumeNextObjectField( callstack, interpreter, forceClass, false/*autoalloc*/ ); if ( obj == null ) throw new InterpreterError("null value in toObject()"); return obj; }
// in org/gjt/sp/jedit/bsh/Name.java
private Object completeRound( String lastEvalName, String nextEvalName, Object returnObject ) { if ( returnObject == null ) throw new InterpreterError("lastEvalName = "+lastEvalName); this.lastEvalName = lastEvalName; this.evalName = nextEvalName; this.evalBaseObject = returnObject; return returnObject; }
// in org/gjt/sp/jedit/bsh/Name.java
Object resolveThisFieldReference( CallStack callstack, NameSpace thisNameSpace, Interpreter interpreter, String varName, boolean specialFieldsVisible ) throws UtilEvalError { if ( varName.equals("this") ) { /* Somewhat of a hack. If the special fields are visible (we're operating relative to a 'this' type already) dissallow further .this references to prevent user from skipping to things like super.this.caller */ if ( specialFieldsVisible ) throw new UtilEvalError("Redundant to call .this on This type"); // Allow getThis() to work through BlockNameSpace to the method // namespace // XXX re-eval this... do we need it? This ths = thisNameSpace.getThis( interpreter ); thisNameSpace= ths.getNameSpace(); Object result = ths; NameSpace classNameSpace = getClassNameSpace( thisNameSpace ); if ( classNameSpace != null ) { if ( isCompound( evalName ) ) result = classNameSpace.getThis( interpreter ); else result = classNameSpace.getClassInstance(); } return result; } /* Some duplication for "super". See notes for "this" above If we're in an enclsing class instance and have a superclass instance our super is the superclass instance. */ if ( varName.equals("super") ) { //if ( specialFieldsVisible ) //throw new UtilEvalError("Redundant to call .this on This type"); // Allow getSuper() to through BlockNameSpace to the method's super This ths = thisNameSpace.getSuper( interpreter ); thisNameSpace = ths.getNameSpace(); // super is now the closure's super or class instance // XXXX re-evaluate this // can getSuper work by itself now? // If we're a class instance and the parent is also a class instance // then super means our parent. if ( thisNameSpace.getParent() != null && thisNameSpace.getParent().isClass ) ths = thisNameSpace.getParent().getThis( interpreter ); return ths; } Object obj = null; if ( varName.equals("global") ) obj = thisNameSpace.getGlobal( interpreter ); if ( obj == null && specialFieldsVisible ) { if (varName.equals("namespace")) obj = thisNameSpace; else if (varName.equals("variables")) obj = thisNameSpace.getVariableNames(); else if (varName.equals("methods")) obj = thisNameSpace.getMethodNames(); else if ( varName.equals("interpreter") ) if ( lastEvalName.equals("this") ) obj = interpreter; else throw new UtilEvalError( "Can only call .interpreter on literal 'this'"); } if ( obj == null && specialFieldsVisible && varName.equals("caller") ) { if ( lastEvalName.equals("this") || lastEvalName.equals("caller") ) { // get the previous context (see notes for this class) if ( callstack == null ) throw new InterpreterError("no callstack"); obj = callstack.get( ++callstackDepth ).getThis( interpreter ); } else throw new UtilEvalError( "Can only call .caller on literal 'this' or literal '.caller'"); // early return return obj; } if ( obj == null && specialFieldsVisible && varName.equals("callstack") ) { if ( lastEvalName.equals("this") ) { // get the previous context (see notes for this class) if ( callstack == null ) throw new InterpreterError("no callstack"); obj = callstack; } else throw new UtilEvalError( "Can only call .callstack on literal 'this'"); } if ( obj == null ) obj = thisNameSpace.getVariable(varName); if ( obj == null ) throw new InterpreterError("null this field ref:"+varName); return obj; }
// in org/gjt/sp/jedit/bsh/Name.java
synchronized public LHS toLHS( CallStack callstack, Interpreter interpreter ) throws UtilEvalError { // Should clean this up to a single return statement reset(); LHS lhs; // Simple (non-compound) variable assignment e.g. x=5; if ( !isCompound(evalName) ) { if ( evalName.equals("this") ) throw new UtilEvalError("Can't assign to 'this'." ); // Interpreter.debug("Simple var LHS..."); lhs = new LHS( namespace, evalName, false/*bubble up if allowed*/); return lhs; } // Field e.g. foo.bar=5; Object obj = null; try { while( evalName != null && isCompound( evalName ) ) { obj = consumeNextObjectField( callstack, interpreter, false/*forcclass*/, true/*autoallocthis*/ ); } } catch( UtilEvalError e ) { throw new UtilEvalError( "LHS evaluation: " + e.getMessage() ); } // Finished eval and its a class. if ( evalName == null && obj instanceof ClassIdentifier ) throw new UtilEvalError("Can't assign to class: " + value ); if ( obj == null ) throw new UtilEvalError("Error in LHS: " + value ); // e.g. this.x=5; or someThisType.x=5; if ( obj instanceof This ) { // dissallow assignment to magic fields if ( evalName.equals("namespace") || evalName.equals("variables") || evalName.equals("methods") || evalName.equals("caller") ) throw new UtilEvalError( "Can't assign to special variable: "+evalName ); Interpreter.debug("found This reference evaluating LHS"); /* If this was a literal "super" reference then we allow recursion in setting the variable to get the normal effect of finding the nearest definition starting at the super scope. On any other resolution qualified by a 'this' type reference we want to set the variable directly in that scope. e.g. this.x=5; or someThisType.x=5; In the old scoping rules super didn't do this. */ boolean localVar = !lastEvalName.equals("super"); return new LHS( ((This)obj).namespace, evalName, localVar ); } if ( evalName != null ) { try { if ( obj instanceof ClassIdentifier ) { Class clas = ((ClassIdentifier)obj).getTargetClass(); lhs = Reflect.getLHSStaticField(clas, evalName); return lhs; } else { lhs = Reflect.getLHSObjectField(obj, evalName); return lhs; } } catch(ReflectError e) { throw new UtilEvalError("Field access: "+e); } } throw new InterpreterError("Internal error in lhs..."); }
// in org/gjt/sp/jedit/bsh/Name.java
private Object invokeLocalMethod( Interpreter interpreter, Object[] args, CallStack callstack, SimpleNode callerInfo ) throws EvalError/*, ReflectError, InvocationTargetException*/ { if ( Interpreter.DEBUG ) Interpreter.debug( "invokeLocalMethod: " + value ); if ( interpreter == null ) throw new InterpreterError( "invokeLocalMethod: interpreter = null"); String commandName = value; Class [] argTypes = Types.getTypes( args ); // Check for existing method BshMethod meth = null; try { meth = namespace.getMethod( commandName, argTypes ); } catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); } // If defined, invoke it if ( meth != null ) return meth.invoke( args, interpreter, callstack, callerInfo ); BshClassManager bcm = interpreter.getClassManager(); // Look for a BeanShell command Object commandObject; try { commandObject = namespace.getCommand( commandName, argTypes, interpreter ); } catch ( UtilEvalError e ) { throw e.toEvalError("Error loading command: ", callerInfo, callstack ); } // should try to print usage here if nothing found if ( commandObject == null ) { // Look for a default invoke() handler method in the namespace // Note: this code duplicates that in This.java... should it? // Call on 'This' can never be a command BshMethod invokeMethod = null; try { invokeMethod = namespace.getMethod( "invoke", new Class [] { null, null } ); } catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); } if ( invokeMethod != null ) return invokeMethod.invoke( new Object [] { commandName, args }, interpreter, callstack, callerInfo ); throw new EvalError( "Command not found: " +StringUtil.methodString( commandName, argTypes ), callerInfo, callstack ); } if ( commandObject instanceof BshMethod ) return ((BshMethod)commandObject).invoke( args, interpreter, callstack, callerInfo ); if ( commandObject instanceof Class ) try { return Reflect.invokeCompiledCommand( ((Class)commandObject), args, interpreter, callstack ); } catch ( UtilEvalError e ) { throw e.toEvalError("Error invoking compiled command: ", callerInfo, callstack ); } throw new InterpreterError("invalid command type"); }
// in org/gjt/sp/jedit/bsh/ExternalNameSpace.java
protected void putExternalMap( String name, Object value ) { if ( value instanceof Variable ) try { value = unwrapVariable( (Variable)value ); } catch ( UtilEvalError ute ) { // There should be no case for this. unwrapVariable throws // UtilEvalError in some cases where it holds an LHS or array // index. throw new InterpreterError("unexpected UtilEvalError"); } if ( value instanceof Primitive ) value = Primitive.unwrap( (Primitive)value ); externalMap.put( name, value ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
public static ConstructorArgs getConstructorArgs( String superClassName, This classStaticThis, Object [] consArgs, int index ) { DelayedEvalBshMethod [] constructors; try { constructors = (DelayedEvalBshMethod [])classStaticThis.getNameSpace() .getVariable( BSHCONSTRUCTORS ); } catch ( Exception e ) { throw new InterpreterError( "unable to get instance initializer: "+e ); } if ( index == DEFAULTCONSTRUCTOR ) // auto-gen default constructor return ConstructorArgs.DEFAULT; // use default super constructor DelayedEvalBshMethod constructor = constructors[index]; if ( constructor.methodBody.jjtGetNumChildren() == 0 ) return ConstructorArgs.DEFAULT; // use default super constructor // Determine if the constructor calls this() or super() String altConstructor = null; BSHArguments argsNode = null; SimpleNode firstStatement = (SimpleNode)constructor.methodBody.jjtGetChild(0); if ( firstStatement instanceof BSHPrimaryExpression ) firstStatement = (SimpleNode)firstStatement.jjtGetChild(0); if ( firstStatement instanceof BSHMethodInvocation ) { BSHMethodInvocation methodNode = (BSHMethodInvocation)firstStatement; BSHAmbiguousName methodName = methodNode.getNameNode(); if ( methodName.text.equals("super") || methodName.text.equals("this") ) { altConstructor = methodName.text; argsNode = methodNode.getArgsNode(); } } if ( altConstructor == null ) return ConstructorArgs.DEFAULT; // use default super constructor // Make a tmp namespace to hold the original constructor args for // use in eval of the parameters node NameSpace consArgsNameSpace = new NameSpace( classStaticThis.getNameSpace(), "consArgs" ); String [] consArgNames = constructor.getParameterNames(); Class [] consArgTypes = constructor.getParameterTypes(); for( int i=0; i<consArgs.length; i++ ) { try { consArgsNameSpace.setTypedVariable( consArgNames[i], consArgTypes[i], consArgs[i], null/*modifiers*/); } catch ( UtilEvalError e ) { throw new InterpreterError("err setting local cons arg:"+e); } } // evaluate the args CallStack callstack = new CallStack(); callstack.push( consArgsNameSpace); Object [] args = null; Interpreter interpreter = classStaticThis.declaringInterpreter; try { args = argsNode.getArguments( callstack, interpreter ); } catch ( EvalError e ) { throw new InterpreterError( "Error evaluating constructor args: "+e ); } Class [] argTypes = Types.getTypes( args ); args = Primitive.unwrap( args ); Class superClass = interpreter.getClassManager().classForName( superClassName ); if ( superClass == null ) throw new InterpreterError( "can't find superclass: "+superClassName ); Constructor [] superCons = superClass.getDeclaredConstructors(); // find the matching super() constructor for the args if ( altConstructor.equals("super") ) { int i = Reflect.findMostSpecificConstructorIndex( argTypes , superCons ); if ( i == -1 ) throw new InterpreterError("can't find constructor for args!"); return new ConstructorArgs( i, args ); } // find the matching this() constructor for the args Class [][] candidates = new Class [ constructors.length ] []; for(int i=0; i< candidates.length; i++ ) candidates[i] = constructors[i].getParameterTypes(); int i = Reflect.findMostSpecificSignature( argTypes, candidates ); if ( i == -1 ) throw new InterpreterError("can't find constructor for args 2!"); // this() constructors come after super constructors in the table int selector = i+superCons.length; int ourSelector = index+superCons.length; // Are we choosing ourselves recursively through a this() reference? if ( selector == ourSelector ) throw new InterpreterError( "Recusive constructor call."); return new ConstructorArgs( selector, args ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
public static void initInstance( Object instance, String className, Object [] args ) { Class [] sig = Types.getTypes( args ); CallStack callstack = new CallStack(); Interpreter interpreter; NameSpace instanceNameSpace; // check to see if the instance has already been initialized // (the case if using a this() alternate constuctor) This instanceThis = getClassInstanceThis( instance, className ); // XXX clean up this conditional if ( instanceThis == null ) { // Create the instance 'This' namespace, set it on the object // instance and invoke the instance initializer // Get the static This reference from the proto-instance This classStaticThis = getClassStaticThis( instance.getClass(), className ); interpreter = classStaticThis.declaringInterpreter; // Get the instance initializer block from the static This BSHBlock instanceInitBlock; try { instanceInitBlock = (BSHBlock)classStaticThis.getNameSpace() .getVariable( BSHINIT ); } catch ( Exception e ) { throw new InterpreterError( "unable to get instance initializer: "+e ); } // Create the instance namespace instanceNameSpace = new NameSpace( classStaticThis.getNameSpace(), className ); instanceNameSpace.isClass = true; // Set the instance This reference on the instance instanceThis = instanceNameSpace.getThis( interpreter ); try { LHS lhs = Reflect.getLHSObjectField( instance, BSHTHIS+className ); lhs.assign( instanceThis, false/*strict*/ ); } catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); } // Give the instance space its object import instanceNameSpace.setClassInstance( instance ); // should use try/finally here to pop ns callstack.push( instanceNameSpace ); // evaluate the instance portion of the block in it try { // Evaluate the initializer block instanceInitBlock.evalBlock( callstack, interpreter, true/*override*/, ClassGeneratorImpl.ClassNodeFilter.CLASSINSTANCE ); } catch ( Exception e ) { throw new InterpreterError("Error in class initialization: "+e); } callstack.pop(); } else { // The object instance has already been initialzed by another // constructor. Fall through to invoke the constructor body below. interpreter = instanceThis.declaringInterpreter; instanceNameSpace = instanceThis.getNameSpace(); } // invoke the constructor method from the instanceThis String constructorName = getBaseName( className ); try { // Find the constructor (now in the instance namespace) BshMethod constructor = instanceNameSpace.getMethod( constructorName, sig, true/*declaredOnly*/ ); // if args, we must have constructor if ( args.length > 0 && constructor == null ) throw new InterpreterError( "Can't find constructor: "+ className ); // Evaluate the constructor if ( constructor != null ) constructor.invoke( args, interpreter, callstack, null/*callerInfo*/, false/*overrideNameSpace*/ ) ; } catch ( Exception e ) { if ( e instanceof TargetError ) e =(Exception)((TargetError)e).getTarget(); if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); e.printStackTrace( System.err ); throw new InterpreterError("Error in class initialization: "+e ); } }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
static This getClassStaticThis( Class clas, String className ) { try { return (This)Reflect.getStaticFieldValue( clas, BSHSTATIC + className ); } catch ( Exception e ) { throw new InterpreterError("Unable to get class static space: "+e); } }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
static This getClassInstanceThis( Object instance, String className ) { try { Object o = Reflect.getObjectFieldValue( instance, BSHTHIS+className ); return (This)Primitive.unwrap(o); // unwrap Primitive.Null to null } catch ( Exception e ) { throw new InterpreterError( "Generated class: Error getting This"+e ); } }
// in org/gjt/sp/jedit/bsh/TargetError.java
public String xPrintTargetError( Throwable t ) { String getTarget = "import java.lang.reflect.UndeclaredThrowableException;"+ "String result=\"\";"+ "while ( target instanceof UndeclaredThrowableException ) {"+ " target=target.getUndeclaredThrowable(); " + " result+=\"Nested: \"+target.toString();" + "}"+ "return result;"; Interpreter i = new Interpreter(); try { i.set("target", t); return (String)i.eval( getTarget ); } catch ( EvalError e ) { throw new InterpreterError("xprintarget: "+e.toString() ); } }
// in org/gjt/sp/jedit/bsh/Types.java
static boolean isSignatureAssignable( Class[] from, Class[] to, int round ) { if ( round != JAVA_VARARGS_ASSIGNABLE && from.length != to.length ) return false; switch ( round ) { case JAVA_BASE_ASSIGNABLE: for( int i=0; i<from.length; i++ ) if ( !isJavaBaseAssignable( to[i], from[i] ) ) return false; return true; case JAVA_BOX_TYPES_ASSIGABLE: for( int i=0; i<from.length; i++ ) if ( !isJavaBoxTypesAssignable( to[i], from[i] ) ) return false; return true; case JAVA_VARARGS_ASSIGNABLE: return isSignatureVarargsAssignable( from, to ); case BSH_ASSIGNABLE: for( int i=0; i<from.length; i++ ) if ( !isBshAssignable( to[i], from[i] ) ) return false; return true; default: throw new InterpreterError("bad case"); } }
// in org/gjt/sp/jedit/bsh/Types.java
static boolean isBshAssignable( Class toType, Class fromType ) { try { return castObject( toType, fromType, null/*fromValue*/, ASSIGNMENT, true/*checkOnly*/ ) == VALID_CAST; } catch ( UtilEvalError e ) { // This should not happen with checkOnly true throw new InterpreterError("err in cast check: "+e); } }
// in org/gjt/sp/jedit/bsh/Types.java
public static Object castObject( Object fromValue, Class toType, int operation ) throws UtilEvalError { if ( fromValue == null ) throw new InterpreterError("null fromValue"); Class fromType = fromValue instanceof Primitive ? ((Primitive)fromValue).getType() : fromValue.getClass(); return castObject( toType, fromType, fromValue, operation, false/*checkonly*/ ); }
// in org/gjt/sp/jedit/bsh/Types.java
private static Object castObject( Class toType, Class fromType, Object fromValue, int operation, boolean checkOnly ) throws UtilEvalError { /* Lots of preconditions checked here... Once things are running smoothly we might comment these out (That's what assertions are for). */ if ( checkOnly && fromValue != null ) throw new InterpreterError("bad cast params 1"); if ( !checkOnly && fromValue == null ) throw new InterpreterError("bad cast params 2"); if ( fromType == Primitive.class ) throw new InterpreterError("bad from Type, need to unwrap"); if ( fromValue == Primitive.NULL && fromType != null ) throw new InterpreterError("inconsistent args 1"); if ( fromValue == Primitive.VOID && fromType != Void.TYPE ) throw new InterpreterError("inconsistent args 2"); if ( toType == Void.TYPE ) throw new InterpreterError("loose toType should be null"); // assignment to loose type, void type, or exactly same type if ( toType == null || toType == fromType ) return checkOnly ? VALID_CAST : fromValue; // Casting to primitive type if ( toType.isPrimitive() ) { if ( fromType == Void.TYPE || fromType == null || fromType.isPrimitive() ) { // Both primitives, do primitive cast return Primitive.castPrimitive( toType, fromType, (Primitive)fromValue, checkOnly, operation ); } else { if ( Primitive.isWrapperType( fromType ) ) { // wrapper to primitive // Convert value to Primitive and check/cast it. //Object r = checkOnly ? VALID_CAST : Class unboxedFromType = Primitive.unboxType( fromType ); Primitive primFromValue; if ( checkOnly ) primFromValue = null; // must be null in checkOnly else primFromValue = (Primitive)Primitive.wrap( fromValue, unboxedFromType ); return Primitive.castPrimitive( toType, unboxedFromType, primFromValue, checkOnly, operation ); } else { // Cannot cast from arbitrary object to primitive if ( checkOnly ) return INVALID_CAST; else throw castError( toType, fromType, operation ); } } } // Else, casting to reference type // Casting from primitive or void (to reference type) if ( fromType == Void.TYPE || fromType == null || fromType.isPrimitive() ) { // cast from primitive to wrapper type if ( Primitive.isWrapperType( toType ) && fromType != Void.TYPE && fromType != null ) { // primitive to wrapper type return checkOnly ? VALID_CAST : Primitive.castWrapper( Primitive.unboxType(toType), ((Primitive)fromValue).getValue() ); } // Primitive (not null or void) to Object.class type if ( toType == Object.class && fromType != Void.TYPE && fromType != null ) { // box it return checkOnly ? VALID_CAST : ((Primitive)fromValue).getValue(); } // Primitive to arbitrary object type. // Allow Primitive.castToType() to handle it as well as cases of // Primitive.NULL and Primitive.VOID return Primitive.castPrimitive( toType, fromType, (Primitive)fromValue, checkOnly, operation ); } // If type already assignable no cast necessary // We do this last to allow various errors above to be caught. // e.g cast Primitive.Void to Object would pass this if ( toType.isAssignableFrom( fromType ) ) return checkOnly ? VALID_CAST : fromValue; // Can we use the proxy mechanism to cast a bsh.This to // the correct interface? if ( toType.isInterface() && org.gjt.sp.jedit.bsh.This.class.isAssignableFrom( fromType ) && Capabilities.canGenerateInterfaces() ) return checkOnly ? VALID_CAST : ((org.gjt.sp.jedit.bsh.This)fromValue).getInterface( toType ); // Both numeric wrapper types? // Try numeric style promotion wrapper cast if ( Primitive.isWrapperType( toType ) && Primitive.isWrapperType( fromType ) ) return checkOnly ? VALID_CAST : Primitive.castWrapper( toType, fromValue ); if ( checkOnly ) return INVALID_CAST; else throw castError( toType, fromType , operation ); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public Class defineClass( String name, byte [] code ) { baseClassPath.setClassSource( name, new GeneratedClassSource( code ) ); try { reloadClasses( new String [] { name } ); } catch ( ClassPathException e ) { throw new org.gjt.sp.jedit.bsh.InterpreterError("defineClass: "+e); } return classForName( name ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
Object getClassInstance() throws UtilEvalError { if ( classInstance != null ) return classInstance; if ( classStatic != null //|| ( getParent()!=null && getParent().classStatic != null ) ) throw new UtilEvalError( "Can't refer to class instance from static context."); else throw new InterpreterError( "Can't resolve class instance 'this' in: "+this); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
public static BshClassManager createClassManager( Interpreter interpreter ) { BshClassManager manager; // Do we have the necessary jdk1.2 packages and optional package? if ( Capabilities.classExists("java.lang.ref.WeakReference") && Capabilities.classExists("java.util.HashMap") && Capabilities.classExists("org.gjt.sp.jedit.bsh.classpath.ClassManagerImpl") ) try { // Try to load the module // don't refer to it directly here or we're dependent upon it Class clas = Class.forName( "org.gjt.sp.jedit.bsh.classpath.ClassManagerImpl" ); manager = (BshClassManager)clas.newInstance(); } catch ( Exception e ) { throw new InterpreterError("Error loading classmanager: "+e); } else manager = new BshClassManager(); if ( interpreter == null ) interpreter = new Interpreter(); manager.declaringInterpreter = interpreter; return manager; }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
public Class classForName( String name ) { if ( isClassBeingDefined( name ) ) throw new InterpreterError( "Attempting to load class in the process of being defined: " +name ); Class clas = null; try { clas = plainClassForName( name ); } catch ( ClassNotFoundException e ) { /*ignore*/ } // try scripted class if ( clas == null ) clas = loadSourceClass( name ); return clas; }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
protected void definingClass( String className ) { String baseName = Name.suffix(className,1); int i = baseName.indexOf("$"); if ( i != -1 ) baseName = baseName.substring(i+1); String cur = (String)definingClassesBaseNames.get( baseName ); if ( cur != null ) throw new InterpreterError("Defining class problem: "+className +": BeanShell cannot yet simultaneously define two or more " +"dependant classes of the same name. Attempt to define: " + className +" while defining: "+cur ); definingClasses.put( className, NOVALUE ); definingClassesBaseNames.put( baseName, className ); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
public Class defineClass( String name, byte [] code ) { throw new InterpreterError("Can't create class ("+name +") without class manager package."); /* Old implementation injected classes into the parent classloader. This was incorrect behavior for several reasons. The biggest problem is that classes could therefore only be defined once across all executions of the script... ClassLoader cl = this.getClass().getClassLoader(); Class clas; try { clas = (Class)Reflect.invokeObjectMethod( cl, "defineClass", new Object [] { name, code, new Primitive( (int)0 )/offset/, new Primitive( code.length )/len/ }, (Interpreter)null, (CallStack)null, (SimpleNode)null ); } catch ( Exception e ) { e.printStackTrace(); throw new InterpreterError("Unable to define class: "+ e ); } absoluteNonClasses.remove( name ); // may have been axed previously return clas; */ }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { BSHPrimaryExpression lhsNode = (BSHPrimaryExpression)jjtGetChild(0); if ( lhsNode == null ) throw new InterpreterError( "Error, null LHSnode" ); boolean strictJava = interpreter.getStrictJava(); LHS lhs = lhsNode.toLHS( callstack, interpreter); if ( lhs == null ) throw new InterpreterError( "Error, null LHS" ); // For operator-assign operations save the lhs value before evaluating // the rhs. This is correct Java behavior for postfix operations // e.g. i=1; i+=i++; // should be 2 not 3 Object lhsValue = null; if ( operator != ASSIGN ) // assign doesn't need the pre-value try { lhsValue = lhs.getValue(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } SimpleNode rhsNode = (SimpleNode)jjtGetChild(1); Object rhs; // implement "blocks" foo = { }; // if ( rhsNode instanceof BSHBlock ) // rsh = // else rhs = rhsNode.eval(callstack, interpreter); if ( rhs == Primitive.VOID ) throw new EvalError("Void assignment.", this, callstack ); try { switch(operator) { case ASSIGN: return lhs.assign( rhs, strictJava ); case PLUSASSIGN: return lhs.assign( operation(lhsValue, rhs, PLUS), strictJava ); case MINUSASSIGN: return lhs.assign( operation(lhsValue, rhs, MINUS), strictJava ); case STARASSIGN: return lhs.assign( operation(lhsValue, rhs, STAR), strictJava ); case SLASHASSIGN: return lhs.assign( operation(lhsValue, rhs, SLASH), strictJava ); case ANDASSIGN: case ANDASSIGNX: return lhs.assign( operation(lhsValue, rhs, BIT_AND), strictJava ); case ORASSIGN: case ORASSIGNX: return lhs.assign( operation(lhsValue, rhs, BIT_OR), strictJava ); case XORASSIGN: return lhs.assign( operation(lhsValue, rhs, XOR), strictJava ); case MODASSIGN: return lhs.assign( operation(lhsValue, rhs, MOD), strictJava ); case LSHIFTASSIGN: case LSHIFTASSIGNX: return lhs.assign( operation(lhsValue, rhs, LSHIFT), strictJava ); case RSIGNEDSHIFTASSIGN: case RSIGNEDSHIFTASSIGNX: return lhs.assign( operation(lhsValue, rhs, RSIGNEDSHIFT ), strictJava ); case RUNSIGNEDSHIFTASSIGN: case RUNSIGNEDSHIFTASSIGNX: return lhs.assign( operation(lhsValue, rhs, RUNSIGNEDSHIFT), strictJava ); default: throw new InterpreterError( "unimplemented operator in assignment BSH"); } } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
public Object getValue() { if ( value == Special.NULL_VALUE ) return null; else if ( value == Special.VOID_TYPE ) throw new InterpreterError("attempt to unwrap void type"); else return value; }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Boolean booleanBinaryOperation(Boolean B1, Boolean B2, int kind) { boolean lhs = B1.booleanValue(); boolean rhs = B2.booleanValue(); switch(kind) { case EQ: return new Boolean(lhs == rhs); case NE: return new Boolean(lhs != rhs); case BOOL_OR: case BOOL_ORX: return new Boolean( lhs || rhs ); case BOOL_AND: case BOOL_ANDX: return new Boolean( lhs && rhs ); default: throw new InterpreterError("unimplemented binary operator"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object longBinaryOperation(Long L1, Long L2, int kind) { long lhs = L1.longValue(); long rhs = L2.longValue(); switch(kind) { // boolean case LT: case LTX: return new Boolean(lhs < rhs); case GT: case GTX: return new Boolean(lhs > rhs); case EQ: return new Boolean(lhs == rhs); case LE: case LEX: return new Boolean(lhs <= rhs); case GE: case GEX: return new Boolean(lhs >= rhs); case NE: return new Boolean(lhs != rhs); // arithmetic case PLUS: return new Long(lhs + rhs); case MINUS: return new Long(lhs - rhs); case STAR: return new Long(lhs * rhs); case SLASH: return new Long(lhs / rhs); case MOD: return new Long(lhs % rhs); // bitwise case LSHIFT: case LSHIFTX: return new Long(lhs << rhs); case RSIGNEDSHIFT: case RSIGNEDSHIFTX: return new Long(lhs >> rhs); case RUNSIGNEDSHIFT: case RUNSIGNEDSHIFTX: return new Long(lhs >>> rhs); case BIT_AND: case BIT_ANDX: return new Long(lhs & rhs); case BIT_OR: case BIT_ORX: return new Long(lhs | rhs); case XOR: return new Long(lhs ^ rhs); default: throw new InterpreterError( "Unimplemented binary long operator"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object intBinaryOperation(Integer I1, Integer I2, int kind) { int lhs = I1.intValue(); int rhs = I2.intValue(); switch(kind) { // boolean case LT: case LTX: return new Boolean(lhs < rhs); case GT: case GTX: return new Boolean(lhs > rhs); case EQ: return new Boolean(lhs == rhs); case LE: case LEX: return new Boolean(lhs <= rhs); case GE: case GEX: return new Boolean(lhs >= rhs); case NE: return new Boolean(lhs != rhs); // arithmetic case PLUS: return new Integer(lhs + rhs); case MINUS: return new Integer(lhs - rhs); case STAR: return new Integer(lhs * rhs); case SLASH: return new Integer(lhs / rhs); case MOD: return new Integer(lhs % rhs); // bitwise case LSHIFT: case LSHIFTX: return new Integer(lhs << rhs); case RSIGNEDSHIFT: case RSIGNEDSHIFTX: return new Integer(lhs >> rhs); case RUNSIGNEDSHIFT: case RUNSIGNEDSHIFTX: return new Integer(lhs >>> rhs); case BIT_AND: case BIT_ANDX: return new Integer(lhs & rhs); case BIT_OR: case BIT_ORX: return new Integer(lhs | rhs); case XOR: return new Integer(lhs ^ rhs); default: throw new InterpreterError( "Unimplemented binary integer operator"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object doubleBinaryOperation(Double D1, Double D2, int kind) throws UtilEvalError { double lhs = D1.doubleValue(); double rhs = D2.doubleValue(); switch(kind) { // boolean case LT: case LTX: return new Boolean(lhs < rhs); case GT: case GTX: return new Boolean(lhs > rhs); case EQ: return new Boolean(lhs == rhs); case LE: case LEX: return new Boolean(lhs <= rhs); case GE: case GEX: return new Boolean(lhs >= rhs); case NE: return new Boolean(lhs != rhs); // arithmetic case PLUS: return new Double(lhs + rhs); case MINUS: return new Double(lhs - rhs); case STAR: return new Double(lhs * rhs); case SLASH: return new Double(lhs / rhs); case MOD: return new Double(lhs % rhs); // can't shift floating-point values case LSHIFT: case LSHIFTX: case RSIGNEDSHIFT: case RSIGNEDSHIFTX: case RUNSIGNEDSHIFT: case RUNSIGNEDSHIFTX: throw new UtilEvalError("Can't shift doubles"); default: throw new InterpreterError( "Unimplemented binary double operator"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object floatBinaryOperation(Float F1, Float F2, int kind) throws UtilEvalError { float lhs = F1.floatValue(); float rhs = F2.floatValue(); switch(kind) { // boolean case LT: case LTX: return new Boolean(lhs < rhs); case GT: case GTX: return new Boolean(lhs > rhs); case EQ: return new Boolean(lhs == rhs); case LE: case LEX: return new Boolean(lhs <= rhs); case GE: case GEX: return new Boolean(lhs >= rhs); case NE: return new Boolean(lhs != rhs); // arithmetic case PLUS: return new Float(lhs + rhs); case MINUS: return new Float(lhs - rhs); case STAR: return new Float(lhs * rhs); case SLASH: return new Float(lhs / rhs); case MOD: return new Float(lhs % rhs); // can't shift floats case LSHIFT: case LSHIFTX: case RSIGNEDSHIFT: case RSIGNEDSHIFTX: case RUNSIGNEDSHIFT: case RUNSIGNEDSHIFTX: throw new UtilEvalError("Can't shift floats "); default: throw new InterpreterError( "Unimplemented binary float operator"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
public static Primitive unaryOperation(Primitive val, int kind) throws UtilEvalError { if (val == NULL) throw new UtilEvalError( "illegal use of null object or 'null' literal"); if (val == VOID) throw new UtilEvalError( "illegal use of undefined object or 'void' literal"); Class operandType = val.getType(); Object operand = promoteToInteger(val.getValue()); if ( operand instanceof Boolean ) return new Primitive(booleanUnaryOperation((Boolean)operand, kind)); else if(operand instanceof Integer) { int result = intUnaryOperation((Integer)operand, kind); // ++ and -- must be cast back the original type if(kind == INCR || kind == DECR) { if(operandType == Byte.TYPE) return new Primitive((byte)result); if(operandType == Short.TYPE) return new Primitive((short)result); if(operandType == Character.TYPE) return new Primitive((char)result); } return new Primitive(result); } else if(operand instanceof Long) return new Primitive(longUnaryOperation((Long)operand, kind)); else if(operand instanceof Float) return new Primitive(floatUnaryOperation((Float)operand, kind)); else if(operand instanceof Double) return new Primitive(doubleUnaryOperation((Double)operand, kind)); else throw new InterpreterError( "An error occurred. Please call technical support."); }
// in org/gjt/sp/jedit/bsh/Primitive.java
static int intUnaryOperation(Integer I, int kind) { int operand = I.intValue(); switch(kind) { case PLUS: return operand; case MINUS: return -operand; case TILDE: return ~operand; case INCR: return operand + 1; case DECR: return operand - 1; default: throw new InterpreterError("bad integer unaryOperation"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
static long longUnaryOperation(Long L, int kind) { long operand = L.longValue(); switch(kind) { case PLUS: return operand; case MINUS: return -operand; case TILDE: return ~operand; case INCR: return operand + 1; case DECR: return operand - 1; default: throw new InterpreterError("bad long unaryOperation"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
static float floatUnaryOperation(Float F, int kind) { float operand = F.floatValue(); switch(kind) { case PLUS: return operand; case MINUS: return -operand; default: throw new InterpreterError("bad float unaryOperation"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
static double doubleUnaryOperation(Double D, int kind) { double operand = D.doubleValue(); switch(kind) { case PLUS: return operand; case MINUS: return -operand; default: throw new InterpreterError("bad double unaryOperation"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
public static Primitive getDefaultValue( Class type ) { if ( type == null || !type.isPrimitive() ) return Primitive.NULL; if ( type == Boolean.TYPE ) return new Primitive( false ); // non boolean primitive, get appropriate flavor of zero try { return new Primitive((int)0).castToType( type, Types.CAST ); } catch ( UtilEvalError e ) { throw new InterpreterError( "bad cast" ); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
public static Class boxType( Class primitiveType ) { Class c = (Class)wrapperMap.get( primitiveType ); if ( c != null ) return c; throw new InterpreterError( "Not a primitive type: "+ primitiveType ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
public static Class unboxType( Class wrapperType ) { Class c = (Class)wrapperMap.get( wrapperType ); if ( c != null ) return c; throw new InterpreterError( "Not a primitive wrapper type: "+wrapperType ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Primitive castPrimitive( Class toType, Class fromType, Primitive fromValue, boolean checkOnly, int operation ) throws UtilEvalError { /* Lots of preconditions checked here... Once things are running smoothly we might comment these out (That's what assertions are for). */ if ( checkOnly && fromValue != null ) throw new InterpreterError("bad cast param 1"); if ( !checkOnly && fromValue == null ) throw new InterpreterError("bad cast param 2"); if ( fromType != null && !fromType.isPrimitive() ) throw new InterpreterError("bad fromType:" +fromType); if ( fromValue == Primitive.NULL && fromType != null ) throw new InterpreterError("inconsistent args 1"); if ( fromValue == Primitive.VOID && fromType != Void.TYPE ) throw new InterpreterError("inconsistent args 2"); // can't cast void to anything if ( fromType == Void.TYPE ) if ( checkOnly ) return Types.INVALID_CAST; else throw Types.castError( Reflect.normalizeClassName(toType), "void value", operation ); // unwrap Primitive fromValue to its wrapper value, etc. Object value = null; if ( fromValue != null ) value = fromValue.getValue(); if ( toType.isPrimitive() ) { // Trying to cast null to primitive type? if ( fromType == null ) if ( checkOnly ) return Types.INVALID_CAST; else throw Types.castError( "primitive type:" + toType, "Null value", operation ); // fall through } else { // Trying to cast primitive to an object type // Primitive.NULL can be cast to any object type if ( fromType == null ) return checkOnly ? Types.VALID_CAST : Primitive.NULL; if ( checkOnly ) return Types.INVALID_CAST; else throw Types.castError( "object type:" + toType, "primitive value", operation); } // can only cast boolean to boolean if ( fromType == Boolean.TYPE ) { if ( toType != Boolean.TYPE ) if ( checkOnly ) return Types.INVALID_CAST; else throw Types.castError( toType, fromType, operation ); return checkOnly ? Types.VALID_CAST : fromValue; } // Do numeric cast // Only allow legal Java assignment unless we're a CAST operation if ( operation == Types.ASSIGNMENT && !Types.isJavaAssignable( toType, fromType ) ) { if ( checkOnly ) return Types.INVALID_CAST; else throw Types.castError( toType, fromType, operation ); } return checkOnly ? Types.VALID_CAST : new Primitive( castWrapper(toType, value) ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object castWrapper( Class toType, Object value ) { if ( !toType.isPrimitive() ) throw new InterpreterError("invalid type in castWrapper: "+toType); if ( value == null ) throw new InterpreterError("null value in castWrapper, guard"); if ( value instanceof Boolean ) { if ( toType != Boolean.TYPE ) throw new InterpreterError("bad wrapper cast of boolean"); else return value; } // first promote char to Number type to avoid duplicating code if ( value instanceof Character ) value = new Integer(((Character)value).charValue()); if ( !(value instanceof Number) ) throw new InterpreterError("bad type in cast"); Number number = (Number)value; if (toType == Byte.TYPE) return new Byte(number.byteValue()); if (toType == Short.TYPE) return new Short(number.shortValue()); if (toType == Character.TYPE) return new Character((char)number.intValue()); if (toType == Integer.TYPE) return new Integer(number.intValue()); if (toType == Long.TYPE) return new Long(number.longValue()); if (toType == Float.TYPE) return new Float(number.floatValue()); if (toType == Double.TYPE) return new Double(number.doubleValue()); throw new InterpreterError("error in wrapper cast"); }
// in org/gjt/sp/jedit/bsh/LHS.java
public Object getValue() throws UtilEvalError { if ( type == VARIABLE ) return nameSpace.getVariable( varName ); if (type == FIELD) try { Object o = field.get( object ); return Primitive.wrap( o, field.getType() ); } catch(IllegalAccessException e2) { throw new UtilEvalError("Can't read field: " + field); } if ( type == PROPERTY ) try { return Reflect.getObjectProperty(object, propName); } catch(ReflectError e) { Interpreter.debug(e.getMessage()); throw new UtilEvalError("No such property: " + propName); } if ( type == INDEX ) try { return Reflect.getIndex(object, index); } catch(Exception e) { throw new UtilEvalError("Array access: " + e); } throw new InterpreterError("LHS type"); }
// in org/gjt/sp/jedit/bsh/LHS.java
public Object assign( Object val, boolean strictJava ) throws UtilEvalError { if ( type == VARIABLE ) { // Set the variable in namespace according to localVar flag if ( localVar ) nameSpace.setLocalVariable( varName, val, strictJava ); else nameSpace.setVariable( varName, val, strictJava ); } else if ( type == FIELD ) { try { Object fieldVal = val instanceof Primitive ? ((Primitive)val).getValue() : val; // This should probably be in Reflect.java ReflectManager.RMSetAccessible( field ); field.set( object, fieldVal ); return val; } catch( NullPointerException e) { throw new UtilEvalError( "LHS ("+field.getName()+") not a static field."); } catch( IllegalAccessException e2) { throw new UtilEvalError( "LHS ("+field.getName()+") can't access field: "+e2); } catch( IllegalArgumentException e3) { String type = val instanceof Primitive ? ((Primitive)val).getType().getName() : val.getClass().getName(); throw new UtilEvalError( "Argument type mismatch. " + (val == null ? "null" : type ) + " not assignable to field "+field.getName()); } } else if ( type == PROPERTY ) { /* if ( object instanceof Hashtable ) ((Hashtable)object).put(propName, val); */ CollectionManager cm = CollectionManager.getCollectionManager(); if ( cm.isMap( object ) ) cm.putInMap( object/*map*/, propName, val ); else try { Reflect.setObjectProperty(object, propName, val); } catch(ReflectError e) { Interpreter.debug("Assignment: " + e.getMessage()); throw new UtilEvalError("No such property: " + propName); } } else if ( type == INDEX ) try { Reflect.setIndex(object, index, val); } catch ( UtilTargetError e1 ) { // pass along target error throw e1; } catch ( Exception e ) { throw new UtilEvalError("Assignment: " + e.getMessage()); } else throw new InterpreterError("unknown lhs"); return val; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public void run() { if(evalOnly) throw new RuntimeException("bsh Interpreter: No stream"); /* We'll print our banner using eval(String) in order to exercise the parser and get the basic expression classes loaded... This ameliorates the delay after typing the first statement. */ if ( interactive ) try { eval("printBanner();"); } catch ( EvalError e ) { println( "BeanShell "+VERSION+" - by Pat Niemeyer (pat@pat.net)"); } // init the callstack. CallStack callstack = new CallStack( globalNameSpace ); boolean eof = false; while( !eof ) { try { // try to sync up the console System.out.flush(); System.err.flush(); Thread.yield(); // this helps a little if ( interactive ) print( getBshPrompt() ); eof = Line(); if( get_jjtree().nodeArity() > 0 ) // number of child nodes { SimpleNode node = (SimpleNode)(get_jjtree().rootNode()); if(DEBUG) node.dump(">"); Object ret = node.eval( callstack, this ); // sanity check during development if ( callstack.depth() > 1 ) throw new InterpreterError( "Callstack growing: "+callstack); if(ret instanceof ReturnControl) ret = ((ReturnControl)ret).value; if( ret != Primitive.VOID ) { setu("$_", ret); if ( showResults ) println("<" + ret + ">"); } } } catch(ParseException e) { error("Parser Error: " + e.getMessage(DEBUG)); if ( DEBUG ) e.printStackTrace(); if(!interactive) eof = true; parser.reInitInput(in); } catch(InterpreterError e) { error("Internal Error: " + e.getMessage()); e.printStackTrace(); if(!interactive) eof = true; } catch(TargetError e) { error("// Uncaught Exception: " + e ); if ( e.inNativeCode() ) e.printStackTrace( DEBUG, err ); if(!interactive) eof = true; setu("$_e", e.getTarget()); } catch (EvalError e) { if ( interactive ) error( "EvalError: "+e.toString() ); else error( "EvalError: "+e.getMessage() ); if(DEBUG) e.printStackTrace(); if(!interactive) eof = true; } catch(Exception e) { error("Unknown error: " + e); if ( DEBUG ) e.printStackTrace(); if(!interactive) eof = true; } catch(TokenMgrError e) { error("Error parsing input: " + e); /* We get stuck in infinite loops here when unicode escapes fail. Must re-init the char stream reader (ASCII_UCodeESC_CharStream.java) */ parser.reInitTokenInput( in ); if(!interactive) eof = true; } finally { get_jjtree().reset(); // reinit the callstack if ( callstack.depth() > 1 ) { callstack.clear(); callstack.push( globalNameSpace ); } } } if ( interactive && exitOnEOF ) System.exit(0); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public Object eval( Reader in, NameSpace nameSpace, String sourceFileInfo /*, CallStack callstack */ ) throws EvalError { Object retVal = null; if ( Interpreter.DEBUG ) debug("eval: nameSpace = "+nameSpace); /* Create non-interactive local interpreter for this namespace with source from the input stream and out/err same as this interpreter. */ Interpreter localInterpreter = new Interpreter( in, out, err, false, nameSpace, this, sourceFileInfo ); CallStack callstack = new CallStack( nameSpace ); boolean eof = false; while(!eof) { SimpleNode node = null; try { eof = localInterpreter.Line(); if (localInterpreter.get_jjtree().nodeArity() > 0) { node = (SimpleNode)localInterpreter.get_jjtree().rootNode(); // nodes remember from where they were sourced node.setSourceFile( sourceFileInfo ); if ( TRACE ) println( "// " +node.getText() ); retVal = node.eval( callstack, localInterpreter ); // sanity check during development if ( callstack.depth() > 1 ) throw new InterpreterError( "Callstack growing: "+callstack); if ( retVal instanceof ReturnControl ) { retVal = ((ReturnControl)retVal).value; break; // non-interactive, return control now } if ( localInterpreter.showResults && retVal != Primitive.VOID ) println("<" + retVal + ">"); } } catch(ParseException e) { /* throw new EvalError( "Sourced file: "+sourceFileInfo+" parser Error: " + e.getMessage( DEBUG ), node, callstack ); */ if ( DEBUG ) // show extra "expecting..." info error( e.getMessage(DEBUG) ); // add the source file info and throw again e.setErrorSourceFile( sourceFileInfo ); throw e; } catch ( InterpreterError e ) { e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" internal Error: " + e.getMessage(), node, callstack); } catch ( TargetError e ) { // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow("Sourced file: "+sourceFileInfo); } catch ( EvalError e) { if ( DEBUG) e.printStackTrace(); // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow( "Sourced file: "+sourceFileInfo ); } catch ( Exception e) { if ( DEBUG) e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" unknown error: " + e.getMessage(), node, callstack); } catch(TokenMgrError e) { throw new EvalError( "Sourced file: "+sourceFileInfo+" Token Parsing Error: " + e.getMessage(), node, callstack ); } finally { localInterpreter.get_jjtree().reset(); // reinit the callstack if ( callstack.depth() > 1 ) { callstack.clear(); callstack.push( nameSpace ); } } } return Primitive.unwrap( retVal ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
Object getu( String name ) { try { return get( name ); } catch ( EvalError e ) { throw new InterpreterError("set: "+e); } }
// in org/gjt/sp/jedit/bsh/Interpreter.java
void setu(String name, Object value) { try { set(name, value); } catch ( EvalError e ) { throw new InterpreterError("set: "+e); } }
// in org/gjt/sp/jedit/bsh/DelayedEvalBshMethod.java
public Class getReturnType() { if ( returnTypeNode == null ) return null; // BSHType will cache the type for us try { return returnTypeNode.evalReturnType( callstack, interpreter ); } catch ( EvalError e ) { throw new InterpreterError("can't eval return type: "+e); } }
// in org/gjt/sp/jedit/bsh/DelayedEvalBshMethod.java
public Class [] getParameterTypes() { // BSHFormalParameters will cache the type for us try { return (Class [])paramTypesNode.eval( callstack, interpreter ); } catch ( EvalError e ) { throw new InterpreterError("can't eval param types: "+e); } }
// in org/gjt/sp/jedit/bsh/CallStack.java
public NameSpace pop() { if ( depth() < 1 ) throw new InterpreterError("pop on empty CallStack"); NameSpace top = top(); stack.removeElementAt(0); return top; }
26
            
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( UtilEvalError e ) { throw new InterpreterError( "Can't get class instance for synchronized method."); }
// in org/gjt/sp/jedit/bsh/This.java
catch ( Exception e ) { throw new InterpreterError("internal error 1 in This: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( UtilEvalError e ) { throw new InterpreterError("unable to init static: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( UtilEvalError e ) { throw new InterpreterError( "illegal argument type in method invocation: "+e ); }
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
catch ( UtilEvalError e ) { throw new InterpreterError( "Unable to set var in catch block namespace." ); }
// in org/gjt/sp/jedit/bsh/ExternalNameSpace.java
catch ( UtilEvalError ute ) { // There should be no case for this. unwrapVariable throws // UtilEvalError in some cases where it holds an LHS or array // index. throw new InterpreterError("unexpected UtilEvalError"); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( UtilEvalError e ) { throw new InterpreterError("can't set cons var"); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "unable to get instance initializer: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( UtilEvalError e ) { throw new InterpreterError("err setting local cons arg:"+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( EvalError e ) { throw new InterpreterError( "Error evaluating constructor args: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "unable to get instance initializer: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Error in class gen setup: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Error in class initialization: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { if ( e instanceof TargetError ) e =(Exception)((TargetError)e).getTarget(); if ( e instanceof InvocationTargetException ) e = (Exception)((InvocationTargetException)e) .getTargetException(); e.printStackTrace( System.err ); throw new InterpreterError("Error in class initialization: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError("Unable to get class static space: "+e); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( Exception e ) { throw new InterpreterError( "Generated class: Error getting This"+e ); }
// in org/gjt/sp/jedit/bsh/TargetError.java
catch ( EvalError e ) { throw new InterpreterError("xprintarget: "+e.toString() ); }
// in org/gjt/sp/jedit/bsh/Types.java
catch ( UtilEvalError e ) { // This should not happen with checkOnly true throw new InterpreterError("err in cast check: "+e); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassPathException e ) { throw new org.gjt.sp.jedit.bsh.InterpreterError("defineClass: "+e); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( Exception e ) { throw new InterpreterError("Error loading classmanager: "+e); }
// in org/gjt/sp/jedit/bsh/Primitive.java
catch ( UtilEvalError e ) { throw new InterpreterError( "bad cast" ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e ) { throw new InterpreterError("set: "+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( EvalError e ) { throw new InterpreterError("set: "+e); }
// in org/gjt/sp/jedit/bsh/DelayedEvalBshMethod.java
catch ( EvalError e ) { throw new InterpreterError("can't eval return type: "+e); }
// in org/gjt/sp/jedit/bsh/DelayedEvalBshMethod.java
catch ( EvalError e ) { throw new InterpreterError("can't eval param types: "+e); }
0 2
            
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(InterpreterError e) { error("Internal Error: " + e.getMessage()); e.printStackTrace(); if(!interactive) eof = true; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( InterpreterError e ) { e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" internal Error: " + e.getMessage(), node, callstack); }
1
            
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( InterpreterError e ) { e.printStackTrace(); throw new EvalError( "Sourced file: "+sourceFileInfo+" internal Error: " + e.getMessage(), node, callstack); }
0
unknown (Lib) InterruptedException 0 0 1
            
// in org/gjt/sp/jedit/io/CopyFileWorker.java
private void copy(Object vfsSession, VFS vfs, String sourcePath, String sourceName, String targetPath) throws IOException, InterruptedException { String name = getTargetName(vfsSession, vfs, targetPath, sourceName); if (name == null) { return; } String targetName = MiscUtilities.constructPath(targetPath, name); CountDownLatch latch = new CountDownLatch(1); ThreadUtilities.runInBackground(new CopyFileWorker(comp, sourcePath, targetName, latch)); latch.await(); }
11
            
// in org/gjt/sp/jedit/gui/SplashScreen.java
catch(InterruptedException ie) { Log.log(Log.ERROR,this,ie); }
// in org/gjt/sp/jedit/gui/SplashScreen.java
catch(InterruptedException ie) { Log.log(Log.ERROR,this,ie); }
// in org/gjt/sp/jedit/EditBus.java
catch (InterruptedException ie) { interrupted = true; Log.log(Log.ERROR, EditBus.class, ie); }
// in org/gjt/sp/jedit/io/CopyFileWorker.java
catch (InterruptedException e) { Log.log(Log.WARNING, this, "Copy was interrupted"); }
// in org/gjt/sp/jedit/io/VFSManager.java
catch (InterruptedException ie) { // preserve interruption flag, but don't stop Thread.currentThread().interrupt(); }
// in org/gjt/sp/jedit/io/VFSManager.java
catch(InterruptedException ie) { // We don't stop, we have to display errors. // However the flag must be preserved. Thread.currentThread().interrupt(); // But since someone breaks us, let's exit // this waiting loop. break; }
// in org/gjt/sp/jedit/GUIUtilities.java
catch (InterruptedException ie) { }
// in org/gjt/sp/jedit/browser/VFSBrowser.java
catch (InterruptedException e) { Log.log(Log.ERROR, this, e, e); }
// in org/gjt/sp/util/ThreadUtilities.java
catch (InterruptedException e) { Log.log(Log.ERROR, ThreadUtilities.class, e); }
// in org/gjt/sp/util/WorkThreadPool.java
catch(InterruptedException ie) { Log.log(Log.ERROR,this,ie); }
// in org/gjt/sp/util/WorkThread.java
catch(InterruptedException ie) { Log.log(Log.ERROR,this,ie); }
0 0
unknown (Lib) InterruptedIOException 0 0 0 2
            
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(InterruptedIOException iio) { }
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(InterruptedIOException iio) { // do nothing, user clicked 'Stop' return null; }
0 0
unknown (Lib) InvocationTargetException 0 0 8
            
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
private Object doName( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError, ReflectError, InvocationTargetException { try { // .length on array if ( field.equals("length") && obj.getClass().isArray() ) if ( toLHS ) throw new EvalError( "Can't assign array length", this, callstack ); else return new Primitive(Array.getLength(obj)); // field access if ( jjtGetNumChildren() == 0 ) if ( toLHS ) return Reflect.getLHSObjectField(obj, field); else return Reflect.getObjectFieldValue( obj, field ); // Method invocation // (LHS or non LHS evaluation can both encounter method calls) Object[] oa = ((BSHArguments)jjtGetChild(0)).getArguments( callstack, interpreter); // TODO: // Note: this try/catch block is copied from BSHMethodInvocation // we need to factor out this common functionality and make sure // we handle all cases ... (e.g. property style access, etc.) // maybe move this to Reflect ? try { return Reflect.invokeObjectMethod( obj, field, oa, interpreter, callstack, this ); } catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); } catch ( InvocationTargetException e ) { String msg = "Method Invocation "+field; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); } } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
public Object invokeSuperclassMethod( BshClassManager bcm, Object instance, String methodName, Object [] args ) throws UtilEvalError, ReflectError, InvocationTargetException { // Delegate to the static method return invokeSuperclassMethodImpl( bcm, instance, methodName, args ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
public static Object invokeSuperclassMethodImpl( BshClassManager bcm, Object instance, String methodName, Object [] args ) throws UtilEvalError, ReflectError, InvocationTargetException { String superName = ClassGeneratorUtil.BSHSUPER+methodName; // look for the specially named super delegate method Class clas = instance.getClass(); Method superMethod = Reflect.resolveJavaMethod( bcm, clas, superName, Types.getTypes(args), false/*onlyStatic*/ ); if ( superMethod != null ) return Reflect.invokeMethod( superMethod, instance, args ); // No super method, try to invoke regular method // could be a superfluous "super." which is legal. Class superClass = clas.getSuperclass(); superMethod = Reflect.resolveExpectedJavaMethod( bcm, superClass, instance, methodName, args, false/*onlyStatic*/ ); return Reflect.invokeMethod( superMethod, instance, args ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object invokeObjectMethod( Object object, String methodName, Object[] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo ) throws ReflectError, EvalError, InvocationTargetException { // Bsh scripted object if ( object instanceof This && !This.isExposedThisMethod(methodName) ) return ((This)object).invokeMethod( methodName, args, interpreter, callstack, callerInfo, false/*delcaredOnly*/ ); // Plain Java object, find the java method try { BshClassManager bcm = interpreter == null ? null : interpreter.getClassManager(); Class clas = object.getClass(); Method method = resolveExpectedJavaMethod( bcm, clas, object, methodName, args, false ); return invokeMethod( method, object, args ); } catch ( UtilEvalError e ) { throw e.toEvalError( callerInfo, callstack ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object invokeStaticMethod( BshClassManager bcm, Class clas, String methodName, Object [] args ) throws ReflectError, UtilEvalError, InvocationTargetException { Interpreter.debug("invoke static Method"); Method method = resolveExpectedJavaMethod( bcm, clas, null, methodName, args, true ); return invokeMethod( method, null, args ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
static Object invokeMethod( Method method, Object object, Object[] args ) throws ReflectError, InvocationTargetException { if ( args == null ) args = new Object[0]; logInvokeMethod( "Invoking method (entry): ", method, args ); // Map types to assignable forms, need to keep this fast... Object [] tmpArgs = new Object [ args.length ]; Class [] types = method.getParameterTypes(); try { for (int i=0; i<args.length; i++) tmpArgs[i] = Types.castObject( args[i]/*rhs*/, types[i]/*lhsType*/, Types.ASSIGNMENT ); } catch ( UtilEvalError e ) { throw new InterpreterError( "illegal argument type in method invocation: "+e ); } // unwrap any primitives tmpArgs = Primitive.unwrap( tmpArgs ); logInvokeMethod( "Invoking method (after massaging values): ", method, tmpArgs ); try { Object returnValue = method.invoke( object, tmpArgs ); if ( returnValue == null ) returnValue = Primitive.NULL; Class returnType = method.getReturnType(); return Primitive.wrap( returnValue, returnType ); } catch( IllegalAccessException e ) { throw new ReflectError( "Cannot access method " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " in '" + method.getDeclaringClass() + "' :" + e ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
static Object constructObject( Class clas, Object[] args ) throws ReflectError, InvocationTargetException { if ( clas.isInterface() ) throw new ReflectError( "Can't create instance of an interface: "+clas); Object obj = null; Class[] types = Types.getTypes(args); Constructor con = null; // Find the constructor. // (there are no inherited constructors to worry about) Constructor[] constructors = Capabilities.haveAccessibility() ? clas.getDeclaredConstructors() : clas.getConstructors() ; if ( Interpreter.DEBUG ) Interpreter.debug("Looking for most specific constructor: "+clas); con = findMostSpecificConstructor(types, constructors); if ( con == null ) throw cantFindConstructor( clas, types ); if ( !isPublic( con ) ) try { ReflectManager.RMSetAccessible( con ); } catch ( UtilEvalError e ) { /*ignore*/ } args=Primitive.unwrap( args ); try { obj = con.newInstance( args ); } catch(InstantiationException e) { throw new ReflectError("The class "+clas+" is abstract "); } catch(IllegalAccessException e) { throw new ReflectError( "We don't have permission to create an instance." +"Use setAccessibility(true) to enable access." ); } catch(IllegalArgumentException e) { throw new ReflectError("The number of arguments was wrong"); } if (obj == null) throw new ReflectError("Couldn't construct the object"); return obj; }
// in org/gjt/sp/jedit/bsh/Name.java
public Object invokeMethod( Interpreter interpreter, Object[] args, CallStack callstack, SimpleNode callerInfo ) throws UtilEvalError, EvalError, ReflectError, InvocationTargetException { String methodName = Name.suffix(value, 1); BshClassManager bcm = interpreter.getClassManager(); NameSpace namespace = callstack.top(); // Optimization - If classOfStaticMethod is set then we have already // been here and determined that this is a static method invocation. // Note: maybe factor this out with path below... clean up. if ( classOfStaticMethod != null ) { return Reflect.invokeStaticMethod( bcm, classOfStaticMethod, methodName, args ); } if ( !Name.isCompound(value) ) return invokeLocalMethod( interpreter, args, callstack, callerInfo ); // Note: if we want methods declared inside blocks to be accessible via // this.methodname() inside the block we could handle it here as a // special case. See also resolveThisFieldReference() special handling // for BlockNameSpace case. They currently work via the direct name // e.g. methodName(). String prefix = Name.prefix(value); // Superclass method invocation? (e.g. super.foo()) if ( prefix.equals("super") && Name.countParts(value) == 2 ) { // Allow getThis() to work through block namespaces first This ths = namespace.getThis( interpreter ); NameSpace thisNameSpace = ths.getNameSpace(); NameSpace classNameSpace = getClassNameSpace( thisNameSpace ); if ( classNameSpace != null ) { Object instance = classNameSpace.getClassInstance(); return ClassGenerator.getClassGenerator() .invokeSuperclassMethod( bcm, instance, methodName, args ); } } // Find target object or class identifier Name targetName = namespace.getNameResolver( prefix ); Object obj = targetName.toObject( callstack, interpreter ); if ( obj == Primitive.VOID ) throw new UtilEvalError( "Attempt to resolve method: "+methodName +"() on undefined variable or class name: "+targetName); // if we've got an object, resolve the method if ( !(obj instanceof ClassIdentifier) ) { if (obj instanceof Primitive) { if (obj == Primitive.NULL) throw new UtilTargetError( new NullPointerException( "Null Pointer in Method Invocation" ) ); // some other primitive // should avoid calling methods on primitive, as we do // in Name (can't treat primitive like an object message) // but the hole is useful right now. if ( Interpreter.DEBUG ) interpreter.debug( "Attempt to access method on primitive..." + " allowing bsh.Primitive to peek through for debugging"); } // found an object and it's not an undefined variable return Reflect.invokeObjectMethod( obj, methodName, args, interpreter, callstack, callerInfo ); } // It's a class // try static method if ( Interpreter.DEBUG ) Interpreter.debug("invokeMethod: trying static - " + targetName); Class clas = ((ClassIdentifier)obj).getTargetClass(); // cache the fact that this is a static method invocation on this class classOfStaticMethod = clas; if ( clas != null ) return Reflect.invokeStaticMethod( bcm, clas, methodName, args ); // return null; ??? throw new UtilEvalError("invokeMethod: unknown target: " + targetName); }
11
            
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch(InvocationTargetException e) { throw new TargetError( "target exception", e.getTargetException(), this, callstack, true); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( InvocationTargetException e ) { String msg = "Method Invocation "+field; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( InvocationTargetException e2 ) { throw new TargetError( "Exception invoking imported object method.", e2, callerInfo, callstack, true/*isNative*/ ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(InvocationTargetException e) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( InvocationTargetException e ) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( InvocationTargetException e ) { throw new UtilEvalError( "Error in compiled command: "+e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch(InvocationTargetException e) { // No need to wrap this debug Interpreter.debug("The constructor threw an exception:\n\t" + e.getTargetException()); throw new TargetError( "Object constructor", e.getTargetException(), this, callstack, true); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( InvocationTargetException e ) { String msg = "Method Invocation "+name; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); }
// in org/gjt/sp/jedit/EditBus.java
catch (InvocationTargetException ite) { Log.log(Log.ERROR, EditBus.class, ite); }
// in org/gjt/sp/jedit/EditBus.java
catch (InvocationTargetException t) { Log.log(Log.ERROR,EditBus.class,"Exception" + " while sending message on EditBus:"); Log.log(Log.ERROR, EditBus.class, t.getCause()); }
// in org/gjt/sp/jedit/io/VFSManager.java
catch (InvocationTargetException ite) { Log.log(Log.ERROR, ErrorDisplayer.class, ite); }
8
            
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch(InvocationTargetException e) { throw new TargetError( "target exception", e.getTargetException(), this, callstack, true); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( InvocationTargetException e ) { String msg = "Method Invocation "+field; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( InvocationTargetException e2 ) { throw new TargetError( "Exception invoking imported object method.", e2, callerInfo, callstack, true/*isNative*/ ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(InvocationTargetException e) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( InvocationTargetException e ) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( InvocationTargetException e ) { throw new UtilEvalError( "Error in compiled command: "+e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch(InvocationTargetException e) { // No need to wrap this debug Interpreter.debug("The constructor threw an exception:\n\t" + e.getTargetException()); throw new TargetError( "Object constructor", e.getTargetException(), this, callstack, true); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( InvocationTargetException e ) { String msg = "Method Invocation "+name; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); }
0
runtime (Domain) LookaheadSuccess
static private final class LookaheadSuccess extends java.lang.Error { }
0 0 0 31
            
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch(LookaheadSuccess ls) { return true; }
0 0
unknown (Lib) MalformedInputException 1
            
// in org/gjt/sp/jedit/io/EncodingWithBOM.java
public Reader getTextReader(InputStream in) throws IOException { byte[] actualMark = new byte[bom.length]; int count = in.read(actualMark); if (count < bom.length || !Arrays.equals(actualMark, bom)) { throw new MalformedInputException(0); } return plain.getTextReader(in); }
0 0 1
            
// in org/gjt/sp/jedit/MiscUtilities.java
catch (MalformedInputException mie) { // This error probably means the input is binary. return true; }
0 0
unknown (Lib) MalformedURLException 0 0 0 12
            
// in org/gjt/sp/jedit/help/HelpViewer.java
catch(MalformedURLException mu) { Log.log(Log.ERROR,this,mu); // what to do? }
// in org/gjt/sp/jedit/help/HelpViewer.java
catch(MalformedURLException mf) { Log.log(Log.ERROR,this,mf); String[] args = { url, mf.getMessage() }; GUIUtilities.error(this,"badurl",args); }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch ( MalformedURLException e ) { throw new ClassPathException(" can't find boot jar: "+e); }
// in org/gjt/sp/jedit/bsh/Remote.java
catch (MalformedURLException e) { System.out.println(e); // bad postURL }
// in org/gjt/sp/jedit/io/UrlVFS.java
catch(MalformedURLException mu) { Log.log(Log.ERROR,this,mu); String[] args = { mu.getMessage() }; VFSManager.error(comp,path,"ioerror.badurl",args); return null; }
// in org/gjt/sp/jedit/io/UrlVFS.java
catch(MalformedURLException mu) { Log.log(Log.ERROR,this,mu); String[] args = { mu.getMessage() }; VFSManager.error(comp,path,"ioerror.badurl",args); return null; }
// in org/gjt/sp/jedit/io/UrlVFS.java
catch (MalformedURLException mue) { Log.log(Log.ERROR,this,mue); return super.getFilePath(vfsPath); }
// in org/gjt/sp/jedit/jEdit.java
catch (MalformedURLException mue) { path = MiscUtilities.constructPath(parent,path); }
// in org/gjt/sp/jedit/options/ToolBarOptionPane.java
catch(MalformedURLException mf) { Log.log(Log.ERROR,this,mf); }
// in org/gjt/sp/jedit/options/ToolBarOptionPane.java
catch(MalformedURLException mf) { Log.log(Log.ERROR,this,mf); }
// in org/gjt/sp/jedit/JARClassLoader.java
catch (MalformedURLException e) {}
// in org/gjt/sp/jedit/MiscUtilities.java
catch(MalformedURLException mf) { return false; }
1
            
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch ( MalformedURLException e ) { throw new ClassPathException(" can't find boot jar: "+e); }
0
unknown (Lib) NegativeArraySizeException 0 0 0 1
            
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch( NegativeArraySizeException e1 ) { throw new TargetError( e1, this, callstack ); }
1
            
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch( NegativeArraySizeException e1 ) { throw new TargetError( e1, this, callstack ); }
0
unknown (Lib) NoClassDefFoundError 0 0 0 2
            
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( NoClassDefFoundError e2 ) { throw noClassDefFound( name, e2 ); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( NoClassDefFoundError e ) { throw noClassDefFound( name, e ); }
2
            
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( NoClassDefFoundError e2 ) { throw noClassDefFound( name, e2 ); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
catch ( NoClassDefFoundError e ) { throw noClassDefFound( name, e ); }
0
unknown (Lib) NoSuchAlgorithmException 0 0 0 1
            
// in org/gjt/sp/util/StandardUtilities.java
catch (NoSuchAlgorithmException e) { Log.log(Log.ERROR, StandardUtilities.class, "Can't Calculate MD5 hash!", e); return dummy; }
0 0
unknown (Lib) NoSuchElementException 1
            
// in org/gjt/sp/jedit/JARClassLoader.java
public Object nextElement() { if(element != null) { Object retval = element; element = null; return retval; } else throw new NoSuchElementException(); }
0 0 0 0 0
unknown (Lib) NoSuchFieldException 1
            
// in org/gjt/sp/jedit/bsh/Reflect.java
private static Field findAccessibleField( Class clas, String fieldName ) throws UtilEvalError, NoSuchFieldException { Field field; // Quick check catches public fields include those in interfaces try { field = clas.getField(fieldName); ReflectManager.RMSetAccessible( field ); return field; } catch ( NoSuchFieldException e ) { } // Now, on with the hunt... while ( clas != null ) { try { field = clas.getDeclaredField(fieldName); ReflectManager.RMSetAccessible( field ); return field; // Not found, fall through to next class } catch(NoSuchFieldException e) { } clas = clas.getSuperclass(); } throw new NoSuchFieldException( fieldName ); }
0 1
            
// in org/gjt/sp/jedit/bsh/Reflect.java
private static Field findAccessibleField( Class clas, String fieldName ) throws UtilEvalError, NoSuchFieldException { Field field; // Quick check catches public fields include those in interfaces try { field = clas.getField(fieldName); ReflectManager.RMSetAccessible( field ); return field; } catch ( NoSuchFieldException e ) { } // Now, on with the hunt... while ( clas != null ) { try { field = clas.getDeclaredField(fieldName); ReflectManager.RMSetAccessible( field ); return field; // Not found, fall through to next class } catch(NoSuchFieldException e) { } clas = clas.getSuperclass(); } throw new NoSuchFieldException( fieldName ); }
3
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( NoSuchFieldException e) { throw new ReflectError("No such field: " + fieldName ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( NoSuchFieldException e ) { }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(NoSuchFieldException e) { }
1
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( NoSuchFieldException e) { throw new ReflectError("No such field: " + fieldName ); }
0
unknown (Lib) NoSuchMethodException 0 0 0 2
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( NoSuchMethodException e ) { /* fall through */ }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( NoSuchMethodException e ) { return false; }
0 0
runtime (Lib) NullPointerException 21
            
// in org/gjt/sp/jedit/gui/ExtendedGridLayout.java
private ExtendedGridLayoutConstraints lookupConstraints(Component component) { if (null == component) { throw new NullPointerException("component must not be null"); } ExtendedGridLayoutConstraints constraints = comptable.get(component); if (null == constraints) { constraints = new ExtendedGridLayoutConstraints(component); comptable.put(component,constraints); } return constraints; }
// in org/gjt/sp/jedit/EditPane.java
public void setBuffer(final Buffer buffer, boolean requestFocus) { if(buffer == null) throw new NullPointerException(); if(this.buffer == buffer) return; if (bufferSet.indexOf(buffer) == -1) { jEdit.getBufferSetManager().addBuffer(this, buffer); } //if(buffer.insideCompoundEdit()) // buffer.endCompoundEdit(); EditBus.send(new BufferChanging(this, buffer)); if (bufferSet.indexOf(this.buffer) != -1) { // when closing the last buffer of a bufferSet, the current buffer will still be the closed // buffer until a new empty buffer is created. // So if the current buffer is not anymore in the bufferSet, do not set the recentBuffer recentBuffer = this.buffer; } if(recentBuffer != null) saveCaretInfo(); this.buffer = buffer; textArea.setBuffer(buffer); if(!init) { view.updateTitle(); if(bufferSwitcher != null) { if(bufferSwitcher.getSelectedItem() != buffer) bufferSwitcher.setSelectedItem(buffer); bufferSwitcher.setToolTipText(buffer.getPath()); } EditBus.send(new EditPaneUpdate(this,EditPaneUpdate .BUFFER_CHANGED)); } if (requestFocus) { SwingUtilities.invokeLater(new Runnable() { public void run() { // only do this if we are the current edit pane if(view.getEditPane() == EditPane.this && (bufferSwitcher == null || !bufferSwitcher.isPopupVisible())) { textArea.requestFocus(); } } }); }
// in org/gjt/sp/jedit/bsh/CollectionManager.java
protected Enumeration createEnumeration( Object iterateOverMe ) { if(iterateOverMe==null) throw new NullPointerException("Object arguments passed to " + "the BasicBshIterator constructor cannot be null."); if (iterateOverMe instanceof Enumeration) return (Enumeration)iterateOverMe; if (iterateOverMe instanceof Vector) return ((Vector)iterateOverMe).elements(); if (iterateOverMe.getClass().isArray()) { final Object array = iterateOverMe; return new Enumeration() { int index = 0, length = Array.getLength(array); public Object nextElement() { return Array.get(array, index++); } public boolean hasMoreElements() { return index<length; } }; } if (iterateOverMe instanceof String) return createEnumeration(((String)iterateOverMe).toCharArray()); if (iterateOverMe instanceof StringBuffer) return createEnumeration( iterateOverMe.toString().toCharArray()); if (iterateOverMe instanceof StringBuilder) return createEnumeration( iterateOverMe.toString().toCharArray()); throw new IllegalArgumentException( "Cannot enumerate object of type "+iterateOverMe.getClass()); }
// in org/gjt/sp/jedit/bsh/collection/CollectionIterator.java
protected Iterator createIterator(Object iterateOverMe) { if (iterateOverMe==null) throw new NullPointerException("Object arguments passed to " + "the CollectionIterator constructor cannot be null."); if (iterateOverMe instanceof Iterator) return (Iterator)iterateOverMe; if (iterateOverMe instanceof Collection) return ((Collection)iterateOverMe).iterator(); /* Should we be able to iterate over maps? if (iterateOverMe instanceof Map) return ((Map)iterateOverMe).entrySet().iterator(); */ throw new IllegalArgumentException( "Cannot enumerate object of type "+iterateOverMe.getClass()); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public void setMode(Mode mode, boolean forceContextInsensitive) { /* This protects against stupid people (like me) * doing stuff like buffer.setMode(jEdit.getMode(...)); */ if(mode == null) throw new NullPointerException("Mode must be non-null"); this.mode = mode; contextInsensitive = forceContextInsensitive || mode.getBooleanProperty("contextInsensitive"); setTokenMarker(mode.getTokenMarker()); resetCachedProperties(); propertiesChanged(); }
// in org/gjt/sp/jedit/ActionSet.java
public void setLabel(String label) { if(label == null) throw new NullPointerException(); this.label = label; }
0 0 3
            
// in org/jedit/options/OptionGroupPane.java
catch (NullPointerException npe) {}
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( NullPointerException e ) { // shouldn't happen throw new ReflectError( "???" + fieldName + " is not a static field."); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( NullPointerException e) { throw new UtilEvalError( "LHS ("+field.getName()+") not a static field."); }
2
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( NullPointerException e ) { // shouldn't happen throw new ReflectError( "???" + fieldName + " is not a static field."); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( NullPointerException e) { throw new UtilEvalError( "LHS ("+field.getName()+") not a static field."); }
0
unknown (Lib) NumberFormatException 0 0 0 23
            
// in org/gjt/sp/jedit/gui/SelectLineRange.java
catch(NumberFormatException nf) { getToolkit().beep(); return; }
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( NumberFormatException e ) { {if (true) throw createParseException( "Error or number too big for integer type: "+ literal );} }
// in org/gjt/sp/jedit/jEdit.java
catch(NumberFormatException nf) { System.err.println("Malformed option: " + arg); }
// in org/gjt/sp/jedit/jEdit.java
catch(NumberFormatException nf) { return def; }
// in org/gjt/sp/jedit/jEdit.java
catch(NumberFormatException nf) { return def; }
// in org/gjt/sp/jedit/jEdit.java
catch(NumberFormatException nf) { return def; }
// in org/gjt/sp/jedit/jEdit.java
catch(NumberFormatException nf) { return def; }
// in org/gjt/sp/jedit/jEdit.java
catch(NumberFormatException nf) { }
// in org/gjt/sp/jedit/Buffer.java
catch(NumberFormatException nf) { retVal = value; }
// in org/gjt/sp/jedit/BufferHistory.java
catch (NumberFormatException e) { Log.log(Log.ERROR, this, "Unable to parse caret position " + charData); }
// in org/gjt/sp/jedit/options/GeneralOptionPane.java
catch (NumberFormatException e) { Log.log(Log.WARNING, this, "hypersearchResultsWarning: " + hypersearchResultsWarning.getText() + " is not a valid value for this option"); }
// in org/gjt/sp/jedit/options/BufferOptionPane.java
catch(NumberFormatException nf) { }
// in org/gjt/sp/jedit/options/BufferOptionPane.java
catch(NumberFormatException nf) { }
// in org/gjt/sp/jedit/options/BufferOptionPane.java
catch(NumberFormatException nf) { }
// in org/gjt/sp/jedit/textarea/StandaloneTextArea.java
catch (NumberFormatException e) { }
// in org/gjt/sp/jedit/textarea/StandaloneTextArea.java
catch (NumberFormatException e) { }
// in org/gjt/sp/jedit/textarea/StandaloneTextArea.java
catch(NumberFormatException nf) { return def; }
// in org/gjt/sp/jedit/textarea/StandaloneTextArea.java
catch(NumberFormatException nf) { return def; }
// in org/gjt/sp/jedit/textarea/StandaloneTextArea.java
catch(NumberFormatException nf) { return def; }
// in org/gjt/sp/jedit/syntax/XModeHandler.java
catch (NumberFormatException e) { error("termchar-invalid",tmp); termChar = -1; }
// in org/gjt/sp/jedit/JEditMode.java
catch(NumberFormatException nf) { value = property; }
// in org/gjt/sp/jedit/JEditMode.java
catch(NumberFormatException nf) { return global; }
// in org/gjt/sp/util/SyntaxUtilities.java
catch(NumberFormatException nf) { return defaultColor; }
1
            
// in org/gjt/sp/jedit/bsh/Parser.java
catch ( NumberFormatException e ) { {if (true) throw createParseException( "Error or number too big for integer type: "+ literal );} }
0
unknown (Lib) OutOfMemoryError 0 0 0 2
            
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(OutOfMemoryError oom) { Log.log(Log.ERROR,this,oom); VFSManager.error(view,path,"out-of-memory-error",null); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/JEditKillRing.java
catch (OutOfMemoryError oem) { Log.log(Log.ERROR, this, "Unable to load entire Killring, too low memory, increase your jvm max heap size"); String start = jEdit.getProperty("killring.start"); String deleteKillRing = jEdit.getProperty("killring.delete"); String stop = jEdit.getProperty("killring.stop"); int selected = GUIUtilities.option(null, "killring.load-memoryerror", null, JOptionPane.ERROR_MESSAGE, new Object[]{start, deleteKillRing, stop}, start); if (selected == 2) { System.exit(-1); } else if (selected == 1) { new File(MiscUtilities.constructPath( jEdit.getSettingsDirectory(),"killring.xml")).delete(); return; } }
0 0
checked (Domain) ParseException
public class ParseException extends EvalError {
// End BeanShell Modification - public, extend EvalError

	// Begin BeanShell Modification - sourceFile

	String sourceFile = "<unknown>";

	/**
		Used to add source file info to exception
	*/
	public void setErrorSourceFile( String file ) {
		this.sourceFile = file;
	}

	public String getErrorSourceFile() { 
		return sourceFile; 
	}

	// End BeanShell Modification - sourceFile

  /**
   * This constructor is used by the method "generateParseException"
   * in the generated parser.  Calling this constructor generates
   * a new object of this type with the fields "currentToken",
   * "expectedTokenSequences", and "tokenImage" set.  The boolean
   * flag "specialConstructor" is also set to true to indicate that
   * this constructor was used to create this object.
   * This constructor calls its super class with the empty string
   * to force the "toString" method of parent class "Throwable" to
   * print the error message in the form:
   *     ParseException: <result of getMessage>
   */
  public ParseException(Token currentTokenVal,
                        int[][] expectedTokenSequencesVal,
                        String[] tokenImageVal
                       )
  {
	// Begin BeanShell Modification - constructor
	this();
	// End BeanShell Modification - constructor
    specialConstructor = true;
    currentToken = currentTokenVal;
    expectedTokenSequences = expectedTokenSequencesVal;
    tokenImage = tokenImageVal;
  }

  /**
   * The following constructors are for use by you for whatever
   * purpose you can think of.  Constructing the exception in this
   * manner makes the exception behave in the normal way - i.e., as
   * documented in the class "Throwable".  The fields "errorToken",
   * "expectedTokenSequences", and "tokenImage" do not contain
   * relevant information.  The JavaCC generated code does not use
   * these constructors.
   */

  public ParseException() {
	// Begin BeanShell Modification - constructor
	this("");
	// End BeanShell Modification - constructor
    specialConstructor = false;
  }

  public ParseException(String message) {
	// Begin BeanShell Modification - super constructor args
	// null node, null callstack, ParseException knows where the error is.
	super( message, null, null );
	// End BeanShell Modification - super constructor args
    specialConstructor = false;
  }

  /**
   * This variable determines which constructor was used to create
   * this object and thereby affects the semantics of the
   * "getMessage" method (see below).
   */
  protected boolean specialConstructor;

  /**
   * This is the last token that has been consumed successfully.  If
   * this object has been created due to a parse error, the token
   * followng this token will (therefore) be the first error token.
   */
  public Token currentToken;

  /**
   * Each entry in this array is an array of integers.  Each array
   * of integers represents a sequence of tokens (by their ordinal
   * values) that is expected at this point of the parse.
   */
  public int[][] expectedTokenSequences;

  /**
   * This is a reference to the "tokenImage" array of the generated
   * parser within which the parse error occurred.  This array is
   * defined in the generated ...Constants interface.
   */
  public String[] tokenImage;

  // Begin BeanShell Modification - moved body to overloaded getMessage()
  public String	getMessage() {
	return getMessage( false );
  }
  // End BeanShell Modification - moved body to overloaded getMessage()

  /**
   * This method has the standard behavior when this object has been
   * created using the standard constructors.  Otherwise, it uses
   * "currentToken" and "expectedTokenSequences" to generate a parse
   * error message and returns it.  If this object has been created
   * due to a parse error, and you do not catch it (it gets thrown
   * from the parser), then this method is called during the printing
   * of the final stack trace, and hence the correct error message
   * gets displayed.
   */
  // Begin BeanShell Modification - added debug param
  public String getMessage( boolean debug ) {
  // End BeanShell Modification - added debug param
    if (!specialConstructor) {
      return super.getMessage();
    }
    String expected = "";
    int maxSize = 0;
    for (int i = 0; i < expectedTokenSequences.length; i++) {
      if (maxSize < expectedTokenSequences[i].length) {
        maxSize = expectedTokenSequences[i].length;
      }
      for (int j = 0; j < expectedTokenSequences[i].length; j++) {
        expected += tokenImage[expectedTokenSequences[i][j]] + " ";
      }
      if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
        expected += "...";
      }
      expected += eol + "    ";
    }
	// Begin BeanShell Modification - added sourceFile info
    String retval = "In file: "+ sourceFile +" Encountered \"";
	// End BeanShell Modification - added sourceFile info
    Token tok = currentToken.next;
    for (int i = 0; i < maxSize; i++) {
      if (i != 0) retval += " ";
      if (tok.kind == 0) {
        retval += tokenImage[0];
        break;
      }
      retval += add_escapes(tok.image);
      tok = tok.next; 
    }
    retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn + "." + eol;

	// Begin BeanShell Modification - made conditional on debug
	if ( debug )
	{
		if (expectedTokenSequences.length == 1) {
		  retval += "Was expecting:" + eol + "    ";
		} else {
		  retval += "Was expecting one of:" + eol + "    ";
		}

		retval += expected;
	}
	// End BeanShell Modification - made conditional on debug

    return retval;
  }

  /**
   * The end of line string for this machine.
   */
  protected String eol = System.getProperty("line.separator", "\n");
 
  /**
   * Used to convert raw characters to their escaped version
   * when these raw version cannot be used as part of an ASCII
   * string literal.
   */
  protected String add_escapes(String str) {
      StringBuilder retval = new StringBuilder();
      char ch;
      for (int i = 0; i < str.length(); i++) {
        switch (str.charAt(i))
        {
           case 0 :
              continue;
           case '\b':
              retval.append("\\b");
              continue;
           case '\t':
              retval.append("\\t");
              continue;
           case '\n':
              retval.append("\\n");
              continue;
           case '\f':
              retval.append("\\f");
              continue;
           case '\r':
              retval.append("\\r");
              continue;
           case '\"':
              retval.append("\\\"");
              continue;
           case '\'':
              retval.append("\\\'");
              continue;
           case '\\':
              retval.append("\\\\");
              continue;
           default:
              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
                 String s = "0000" + Integer.toString(ch, 16);
                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
              } else {
                 retval.append(ch);
              }
              continue;
        }
      }
      return retval.toString();
   }

	// Begin BeanShell Modification - override error methods and toString

	public int getErrorLineNumber() 
	{
		return currentToken.next.beginLine;
	}

	public String getErrorText() { 
		// copied from generated getMessage()
		int	maxSize	= 0;
		for	(int i = 0; i <	expectedTokenSequences.length; i++) {
		  if (maxSize < expectedTokenSequences[i].length)
			maxSize	= expectedTokenSequences[i].length;
		}

		String retval = "";
		Token tok =	currentToken.next;
		for	(int i = 0; i <	maxSize; i++) 
		{
		  if (i != 0) retval += " ";
		  if (tok.kind == 0) {
			retval += tokenImage[0];
			break;
		  }
		  retval +=	add_escapes(tok.image);
		  tok = tok.next;
		}
		
		return retval;
	}

	public String toString() {
		return getMessage();
	}

	// End BeanShell Modification - override error methods and toString

}
43
            
// in org/gjt/sp/jedit/bsh/Parser.java
final public boolean Line() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 0: jj_consume_token(0); Interpreter.debug("End of File!"); {if (true) return true;} break; default: if (jj_2_1(1)) { BlockStatement(); {if (true) return false;} } else { jj_consume_token(-1); throw new ParseException(); } } throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public Modifiers Modifiers(int context, boolean lookahead) throws ParseException { Modifiers mods = null; label_1: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ABSTRACT: case FINAL: case NATIVE: case PRIVATE: case PROTECTED: case PUBLIC: case STATIC: case STRICTFP: case SYNCHRONIZED: case TRANSIENT: case VOLATILE: ; break; default: break label_1; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PRIVATE: jj_consume_token(PRIVATE); break; case PROTECTED: jj_consume_token(PROTECTED); break; case PUBLIC: jj_consume_token(PUBLIC); break; case SYNCHRONIZED: jj_consume_token(SYNCHRONIZED); break; case FINAL: jj_consume_token(FINAL); break; case NATIVE: jj_consume_token(NATIVE); break; case TRANSIENT: jj_consume_token(TRANSIENT); break; case VOLATILE: jj_consume_token(VOLATILE); break; case ABSTRACT: jj_consume_token(ABSTRACT); break; case STATIC: jj_consume_token(STATIC); break; case STRICTFP: jj_consume_token(STRICTFP); break; default: jj_consume_token(-1); throw new ParseException(); } if ( !lookahead ) try { if ( mods == null ) mods = new Modifiers(); mods.addModifier( context, getToken(0).image ); } catch ( IllegalStateException e ) { {if (true) throw createParseException( e.getMessage() );} } } {if (true) return mods;} throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ClassDeclaration() throws ParseException { /*@bgen(jjtree) ClassDeclaration */ BSHClassDeclaration jjtn000 = new BSHClassDeclaration(JJTCLASSDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Modifiers mods; Token name; int numInterfaces; try { mods = Modifiers(Modifiers.CLASS, false); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case CLASS: jj_consume_token(CLASS); break; case INTERFACE: jj_consume_token(INTERFACE); jjtn000.isInterface=true; break; default: jj_consume_token(-1); throw new ParseException(); } name = jj_consume_token(IDENTIFIER); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case EXTENDS: jj_consume_token(EXTENDS); AmbiguousName(); jjtn000.extend = true; break; default: ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IMPLEMENTS: jj_consume_token(IMPLEMENTS); numInterfaces = NameList(); jjtn000.numInterfaces=numInterfaces; break; default: ; } Block(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.modifiers = mods; jjtn000.name = name.image; } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void MethodDeclaration() throws ParseException { /*@bgen(jjtree) MethodDeclaration */ BSHMethodDeclaration jjtn000 = new BSHMethodDeclaration(JJTMETHODDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t = null; Modifiers mods; int count; try { mods = Modifiers(Modifiers.METHOD, false); jjtn000.modifiers = mods; if (jj_2_2(2147483647)) { t = jj_consume_token(IDENTIFIER); jjtn000.name = t.image; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case SHORT: case VOID: case IDENTIFIER: ReturnType(); t = jj_consume_token(IDENTIFIER); jjtn000.name = t.image; break; default: jj_consume_token(-1); throw new ParseException(); } } FormalParameters(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case THROWS: jj_consume_token(THROWS); count = NameList(); jjtn000.numThrows=count; break; default: ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: Block(); break; case SEMICOLON: jj_consume_token(SEMICOLON); break; default: jj_consume_token(-1); throw new ParseException(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ImportDeclaration() throws ParseException { /*@bgen(jjtree) ImportDeclaration */ BSHImportDeclaration jjtn000 = new BSHImportDeclaration(JJTIMPORTDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token s = null; Token t = null; try { if (jj_2_3(3)) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STATIC: s = jj_consume_token(STATIC); break; default: ; } jj_consume_token(IMPORT); AmbiguousName(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case DOT: t = jj_consume_token(DOT); jj_consume_token(STAR); break; default: ; } jj_consume_token(SEMICOLON); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); if ( s != null ) jjtn000.staticImport = true; if ( t != null ) jjtn000.importPackage = true; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IMPORT: jj_consume_token(IMPORT); jj_consume_token(STAR); jj_consume_token(SEMICOLON); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.superImport = true; break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void VariableInitializer() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: ArrayInitializer(); break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: Expression(); break; default: jj_consume_token(-1); throw new ParseException(); } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void FormalParameter() throws ParseException { /*@bgen(jjtree) FormalParameter */ BSHFormalParameter jjtn000 = new BSHFormalParameter(JJTFORMALPARAMETER); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t; try { if (jj_2_5(2)) { Type(); t = jj_consume_token(IDENTIFIER); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.name = t.image; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENTIFIER: t = jj_consume_token(IDENTIFIER); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.name = t.image; break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Type() throws ParseException { /*@bgen(jjtree) Type */ BSHType jjtn000 = new BSHType(JJTTYPE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case SHORT: PrimitiveType(); break; case IDENTIFIER: AmbiguousName(); break; default: jj_consume_token(-1); throw new ParseException(); } label_4: while (true) { if (jj_2_6(2)) { ; } else { break label_4; } jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); jjtn000.addArrayDimension(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ReturnType() throws ParseException { /*@bgen(jjtree) ReturnType */ BSHReturnType jjtn000 = new BSHReturnType(JJTRETURNTYPE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case VOID: jj_consume_token(VOID); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.isVoid = true; break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case SHORT: case IDENTIFIER: Type(); break; default: jj_consume_token(-1); throw new ParseException(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PrimitiveType() throws ParseException { /*@bgen(jjtree) PrimitiveType */ BSHPrimitiveType jjtn000 = new BSHPrimitiveType(JJTPRIMITIVETYPE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: jj_consume_token(BOOLEAN); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Boolean.TYPE; break; case CHAR: jj_consume_token(CHAR); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Character.TYPE; break; case BYTE: jj_consume_token(BYTE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Byte.TYPE; break; case SHORT: jj_consume_token(SHORT); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Short.TYPE; break; case INT: jj_consume_token(INT); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Integer.TYPE; break; case LONG: jj_consume_token(LONG); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Long.TYPE; break; case FLOAT: jj_consume_token(FLOAT); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Float.TYPE; break; case DOUBLE: jj_consume_token(DOUBLE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Double.TYPE; break; default: jj_consume_token(-1); throw new ParseException(); } } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Expression() throws ParseException { if (jj_2_8(2147483647)) { Assignment(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: ConditionalExpression(); break; default: jj_consume_token(-1); throw new ParseException(); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public int AssignmentOperator() throws ParseException { Token t; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ASSIGN: jj_consume_token(ASSIGN); break; case STARASSIGN: jj_consume_token(STARASSIGN); break; case SLASHASSIGN: jj_consume_token(SLASHASSIGN); break; case MODASSIGN: jj_consume_token(MODASSIGN); break; case PLUSASSIGN: jj_consume_token(PLUSASSIGN); break; case MINUSASSIGN: jj_consume_token(MINUSASSIGN); break; case ANDASSIGN: jj_consume_token(ANDASSIGN); break; case XORASSIGN: jj_consume_token(XORASSIGN); break; case ORASSIGN: jj_consume_token(ORASSIGN); break; case LSHIFTASSIGN: jj_consume_token(LSHIFTASSIGN); break; case LSHIFTASSIGNX: jj_consume_token(LSHIFTASSIGNX); break; case RSIGNEDSHIFTASSIGN: jj_consume_token(RSIGNEDSHIFTASSIGN); break; case RSIGNEDSHIFTASSIGNX: jj_consume_token(RSIGNEDSHIFTASSIGNX); break; case RUNSIGNEDSHIFTASSIGN: jj_consume_token(RUNSIGNEDSHIFTASSIGN); break; case RUNSIGNEDSHIFTASSIGNX: jj_consume_token(RUNSIGNEDSHIFTASSIGNX); break; default: jj_consume_token(-1); throw new ParseException(); } t = getToken(0); {if (true) return t.kind;} throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ConditionalOrExpression() throws ParseException { Token t=null; ConditionalAndExpression(); label_7: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOL_OR: case BOOL_ORX: ; break; default: break label_7; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOL_OR: t = jj_consume_token(BOOL_OR); break; case BOOL_ORX: t = jj_consume_token(BOOL_ORX); break; default: jj_consume_token(-1); throw new ParseException(); } ConditionalAndExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ConditionalAndExpression() throws ParseException { Token t=null; InclusiveOrExpression(); label_8: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOL_AND: case BOOL_ANDX: ; break; default: break label_8; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOL_AND: t = jj_consume_token(BOOL_AND); break; case BOOL_ANDX: t = jj_consume_token(BOOL_ANDX); break; default: jj_consume_token(-1); throw new ParseException(); } InclusiveOrExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void InclusiveOrExpression() throws ParseException { Token t=null; ExclusiveOrExpression(); label_9: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_OR: case BIT_ORX: ; break; default: break label_9; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_OR: t = jj_consume_token(BIT_OR); break; case BIT_ORX: t = jj_consume_token(BIT_ORX); break; default: jj_consume_token(-1); throw new ParseException(); } ExclusiveOrExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void AndExpression() throws ParseException { Token t=null; EqualityExpression(); label_11: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_AND: case BIT_ANDX: ; break; default: break label_11; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_AND: t = jj_consume_token(BIT_AND); break; case BIT_ANDX: t = jj_consume_token(BIT_ANDX); break; default: jj_consume_token(-1); throw new ParseException(); } EqualityExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void EqualityExpression() throws ParseException { Token t = null; InstanceOfExpression(); label_12: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case EQ: case NE: ; break; default: break label_12; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case EQ: t = jj_consume_token(EQ); break; case NE: t = jj_consume_token(NE); break; default: jj_consume_token(-1); throw new ParseException(); } InstanceOfExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void RelationalExpression() throws ParseException { Token t = null; ShiftExpression(); label_13: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case GT: case GTX: case LT: case LTX: case LE: case LEX: case GE: case GEX: ; break; default: break label_13; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LT: t = jj_consume_token(LT); break; case LTX: t = jj_consume_token(LTX); break; case GT: t = jj_consume_token(GT); break; case GTX: t = jj_consume_token(GTX); break; case LE: t = jj_consume_token(LE); break; case LEX: t = jj_consume_token(LEX); break; case GE: t = jj_consume_token(GE); break; case GEX: t = jj_consume_token(GEX); break; default: jj_consume_token(-1); throw new ParseException(); } ShiftExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ShiftExpression() throws ParseException { Token t = null; AdditiveExpression(); label_14: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LSHIFT: case LSHIFTX: case RSIGNEDSHIFT: case RSIGNEDSHIFTX: case RUNSIGNEDSHIFT: case RUNSIGNEDSHIFTX: ; break; default: break label_14; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LSHIFT: t = jj_consume_token(LSHIFT); break; case LSHIFTX: t = jj_consume_token(LSHIFTX); break; case RSIGNEDSHIFT: t = jj_consume_token(RSIGNEDSHIFT); break; case RSIGNEDSHIFTX: t = jj_consume_token(RSIGNEDSHIFTX); break; case RUNSIGNEDSHIFT: t = jj_consume_token(RUNSIGNEDSHIFT); break; case RUNSIGNEDSHIFTX: t = jj_consume_token(RUNSIGNEDSHIFTX); break; default: jj_consume_token(-1); throw new ParseException(); } AdditiveExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void AdditiveExpression() throws ParseException { Token t = null; MultiplicativeExpression(); label_15: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: case MINUS: ; break; default: break label_15; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: t = jj_consume_token(PLUS); break; case MINUS: t = jj_consume_token(MINUS); break; default: jj_consume_token(-1); throw new ParseException(); } MultiplicativeExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void MultiplicativeExpression() throws ParseException { Token t = null; UnaryExpression(); label_16: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STAR: case SLASH: case MOD: ; break; default: break label_16; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STAR: t = jj_consume_token(STAR); break; case SLASH: t = jj_consume_token(SLASH); break; case MOD: t = jj_consume_token(MOD); break; default: jj_consume_token(-1); throw new ParseException(); } UnaryExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void UnaryExpression() throws ParseException { Token t = null; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: case MINUS: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: t = jj_consume_token(PLUS); break; case MINUS: t = jj_consume_token(MINUS); break; default: jj_consume_token(-1); throw new ParseException(); } UnaryExpression(); BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 1); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } } break; case INCR: PreIncrementExpression(); break; case DECR: PreDecrementExpression(); break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: UnaryExpressionNotPlusMinus(); break; default: jj_consume_token(-1); throw new ParseException(); } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void UnaryExpressionNotPlusMinus() throws ParseException { Token t = null; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BANG: case TILDE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case TILDE: t = jj_consume_token(TILDE); break; case BANG: t = jj_consume_token(BANG); break; default: jj_consume_token(-1); throw new ParseException(); } UnaryExpression(); BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 1); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } } break; default: if (jj_2_9(2147483647)) { CastExpression(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: PostfixExpression(); break; default: jj_consume_token(-1); throw new ParseException(); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void CastLookahead() throws ParseException { if (jj_2_10(2)) { jj_consume_token(LPAREN); PrimitiveType(); } else if (jj_2_11(2147483647)) { jj_consume_token(LPAREN); AmbiguousName(); jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: jj_consume_token(LPAREN); AmbiguousName(); jj_consume_token(RPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case TILDE: jj_consume_token(TILDE); break; case BANG: jj_consume_token(BANG); break; case LPAREN: jj_consume_token(LPAREN); break; case IDENTIFIER: jj_consume_token(IDENTIFIER); break; case NEW: jj_consume_token(NEW); break; case FALSE: case NULL: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: Literal(); break; default: jj_consume_token(-1); throw new ParseException(); } break; default: jj_consume_token(-1); throw new ParseException(); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PostfixExpression() throws ParseException { Token t = null; if (jj_2_12(2147483647)) { PrimaryExpression(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INCR: t = jj_consume_token(INCR); break; case DECR: t = jj_consume_token(DECR); break; default: jj_consume_token(-1); throw new ParseException(); } BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 1); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; jjtn001.postfix = true; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } } } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: PrimaryExpression(); break; default: jj_consume_token(-1); throw new ParseException(); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void CastExpression() throws ParseException { /*@bgen(jjtree) CastExpression */ BSHCastExpression jjtn000 = new BSHCastExpression(JJTCASTEXPRESSION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { if (jj_2_13(2147483647)) { jj_consume_token(LPAREN); Type(); jj_consume_token(RPAREN); UnaryExpression(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: jj_consume_token(LPAREN); Type(); jj_consume_token(RPAREN); UnaryExpressionNotPlusMinus(); break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PrimaryPrefix() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FALSE: case NULL: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: Literal(); break; case LPAREN: jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); break; case NEW: AllocationExpression(); break; default: if (jj_2_14(2147483647)) { MethodInvocation(); } else if (jj_2_15(2147483647)) { Type(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENTIFIER: AmbiguousName(); break; default: jj_consume_token(-1); throw new ParseException(); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PrimarySuffix() throws ParseException { /*@bgen(jjtree) PrimarySuffix */ BSHPrimarySuffix jjtn000 = new BSHPrimarySuffix(JJTPRIMARYSUFFIX); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t = null; try { if (jj_2_16(2)) { jj_consume_token(DOT); jj_consume_token(CLASS); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.operation = BSHPrimarySuffix.CLASS; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: jj_consume_token(LBRACKET); Expression(); jj_consume_token(RBRACKET); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.operation = BSHPrimarySuffix.INDEX; break; case DOT: jj_consume_token(DOT); t = jj_consume_token(IDENTIFIER); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: Arguments(); break; default: ; } jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.operation = BSHPrimarySuffix.NAME; jjtn000.field = t.image; break; case LBRACE: jj_consume_token(LBRACE); Expression(); jj_consume_token(RBRACE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.operation = BSHPrimarySuffix.PROPERTY; break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Literal() throws ParseException { /*@bgen(jjtree) Literal */ BSHLiteral jjtn000 = new BSHLiteral(JJTLITERAL); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token x; boolean b; String literal; char ch; try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INTEGER_LITERAL: x = jj_consume_token(INTEGER_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); literal = x.image; ch = literal.charAt(literal.length()-1); if(ch == 'l' || ch == 'L') { literal = literal.substring(0,literal.length()-1); // This really should be Long.decode, but there isn't one. As a result, // hex and octal literals ending in 'l' or 'L' don't work. jjtn000.value = new Primitive( new Long( literal ).longValue() ); } else try { jjtn000.value = new Primitive( Integer.decode( literal ).intValue() ); } catch ( NumberFormatException e ) { {if (true) throw createParseException( "Error or number too big for integer type: "+ literal );} } break; case FLOATING_POINT_LITERAL: x = jj_consume_token(FLOATING_POINT_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); literal = x.image; ch = literal.charAt(literal.length()-1); if(ch == 'f' || ch == 'F') { literal = literal.substring(0,literal.length()-1); jjtn000.value = new Primitive( new Float( literal ).floatValue() ); } else { if(ch == 'd' || ch == 'D') literal = literal.substring(0,literal.length()-1); jjtn000.value = new Primitive( new Double( literal ).doubleValue() ); } break; case CHARACTER_LITERAL: x = jj_consume_token(CHARACTER_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); try { jjtn000.charSetup( x.image.substring(1, x.image.length() - 1) ); } catch ( Exception e ) { {if (true) throw createParseException("Error parsing character: "+x.image);} } break; case STRING_LITERAL: x = jj_consume_token(STRING_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); try { jjtn000.stringSetup( x.image.substring(1, x.image.length() - 1) ); } catch ( Exception e ) { {if (true) throw createParseException("Error parsing string: "+x.image);} } break; case FALSE: case TRUE: b = BooleanLiteral(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.value = new Primitive( b ); break; case NULL: NullLiteral(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.value = Primitive.NULL; break; case VOID: VoidLiteral(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.value = Primitive.VOID; break; default: jj_consume_token(-1); throw new ParseException(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public boolean BooleanLiteral() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case TRUE: jj_consume_token(TRUE); {if (true) return true;} break; case FALSE: jj_consume_token(FALSE); {if (true) return false;} break; default: jj_consume_token(-1); throw new ParseException(); } throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void AllocationExpression() throws ParseException { /*@bgen(jjtree) AllocationExpression */ BSHAllocationExpression jjtn000 = new BSHAllocationExpression(JJTALLOCATIONEXPRESSION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { if (jj_2_18(2)) { jj_consume_token(NEW); PrimitiveType(); ArrayDimensions(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case NEW: jj_consume_token(NEW); AmbiguousName(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: ArrayDimensions(); break; case LPAREN: Arguments(); if (jj_2_17(2)) { Block(); } else { ; } break; default: jj_consume_token(-1); throw new ParseException(); } break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ArrayDimensions() throws ParseException { /*@bgen(jjtree) ArrayDimensions */ BSHArrayDimensions jjtn000 = new BSHArrayDimensions(JJTARRAYDIMENSIONS); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { if (jj_2_21(2)) { label_19: while (true) { jj_consume_token(LBRACKET); Expression(); jj_consume_token(RBRACKET); jjtn000.addDefinedDimension(); if (jj_2_19(2)) { ; } else { break label_19; } } label_20: while (true) { if (jj_2_20(2)) { ; } else { break label_20; } jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); jjtn000.addUndefinedDimension(); } } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: label_21: while (true) { jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); jjtn000.addUndefinedDimension(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: ; break; default: break label_21; } } ArrayInitializer(); break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Statement() throws ParseException { if (jj_2_22(2)) { LabeledStatement(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: Block(); break; case SEMICOLON: EmptyStatement(); break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: StatementExpression(); jj_consume_token(SEMICOLON); break; case SWITCH: SwitchStatement(); break; case IF: IfStatement(); break; case WHILE: WhileStatement(); break; case DO: DoStatement(); break; default: if (isRegularForStatement()) { ForStatement(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FOR: EnhancedForStatement(); break; case BREAK: BreakStatement(); break; case CONTINUE: ContinueStatement(); break; case RETURN: ReturnStatement(); break; case SYNCHRONIZED: SynchronizedStatement(); break; case THROW: ThrowStatement(); break; case TRY: TryStatement(); break; default: jj_consume_token(-1); throw new ParseException(); } } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void BlockStatement() throws ParseException { if (jj_2_24(2147483647)) { ClassDeclaration(); } else if (jj_2_25(2147483647)) { MethodDeclaration(); } else if (jj_2_26(2147483647)) { MethodDeclaration(); } else if (jj_2_27(2147483647)) { TypedVariableDeclaration(); jj_consume_token(SEMICOLON); } else if (jj_2_28(1)) { Statement(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IMPORT: case STATIC: ImportDeclaration(); break; case PACKAGE: PackageDeclaration(); break; case FORMAL_COMMENT: FormalComment(); break; default: jj_consume_token(-1); throw new ParseException(); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void SwitchLabel() throws ParseException { /*@bgen(jjtree) SwitchLabel */ BSHSwitchLabel jjtn000 = new BSHSwitchLabel(JJTSWITCHLABEL); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case CASE: jj_consume_token(CASE); Expression(); jj_consume_token(COLON); break; case _DEFAULT: jj_consume_token(_DEFAULT); jj_consume_token(COLON); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.isDefault = true; break; default: jj_consume_token(-1); throw new ParseException(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void EnhancedForStatement() throws ParseException { /*@bgen(jjtree) EnhancedForStatement */ BSHEnhancedForStatement jjtn000 = new BSHEnhancedForStatement(JJTENHANCEDFORSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t = null; try { if (jj_2_30(4)) { jj_consume_token(FOR); jj_consume_token(LPAREN); t = jj_consume_token(IDENTIFIER); jj_consume_token(COLON); Expression(); jj_consume_token(RPAREN); Statement(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.varName = t.image; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FOR: jj_consume_token(FOR); jj_consume_token(LPAREN); Type(); t = jj_consume_token(IDENTIFIER); jj_consume_token(COLON); Expression(); jj_consume_token(RPAREN); Statement(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.varName = t.image; break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ForInit() throws ParseException { Token t = null; if (jj_2_31(2147483647)) { TypedVariableDeclaration(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: StatementExpressionList(); break; default: jj_consume_token(-1); throw new ParseException(); } } }
0 77
            
// in org/gjt/sp/jedit/bsh/Parser.java
public static void main( String [] args ) throws IOException, ParseException { boolean print = false; int i=0; if ( args[0].equals("-p") ) { i++; print=true; } for(; i< args.length; i++) { Reader in = new FileReader(args[i]); Parser parser = new Parser(in); parser.setRetainComments(true); while( !parser.Line()/*eof*/ ) if ( print ) System.out.println( parser.popNode() ); } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public boolean Line() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 0: jj_consume_token(0); Interpreter.debug("End of File!"); {if (true) return true;} break; default: if (jj_2_1(1)) { BlockStatement(); {if (true) return false;} } else { jj_consume_token(-1); throw new ParseException(); } } throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public Modifiers Modifiers(int context, boolean lookahead) throws ParseException { Modifiers mods = null; label_1: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ABSTRACT: case FINAL: case NATIVE: case PRIVATE: case PROTECTED: case PUBLIC: case STATIC: case STRICTFP: case SYNCHRONIZED: case TRANSIENT: case VOLATILE: ; break; default: break label_1; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PRIVATE: jj_consume_token(PRIVATE); break; case PROTECTED: jj_consume_token(PROTECTED); break; case PUBLIC: jj_consume_token(PUBLIC); break; case SYNCHRONIZED: jj_consume_token(SYNCHRONIZED); break; case FINAL: jj_consume_token(FINAL); break; case NATIVE: jj_consume_token(NATIVE); break; case TRANSIENT: jj_consume_token(TRANSIENT); break; case VOLATILE: jj_consume_token(VOLATILE); break; case ABSTRACT: jj_consume_token(ABSTRACT); break; case STATIC: jj_consume_token(STATIC); break; case STRICTFP: jj_consume_token(STRICTFP); break; default: jj_consume_token(-1); throw new ParseException(); } if ( !lookahead ) try { if ( mods == null ) mods = new Modifiers(); mods.addModifier( context, getToken(0).image ); } catch ( IllegalStateException e ) { {if (true) throw createParseException( e.getMessage() );} } } {if (true) return mods;} throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ClassDeclaration() throws ParseException { /*@bgen(jjtree) ClassDeclaration */ BSHClassDeclaration jjtn000 = new BSHClassDeclaration(JJTCLASSDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Modifiers mods; Token name; int numInterfaces; try { mods = Modifiers(Modifiers.CLASS, false); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case CLASS: jj_consume_token(CLASS); break; case INTERFACE: jj_consume_token(INTERFACE); jjtn000.isInterface=true; break; default: jj_consume_token(-1); throw new ParseException(); } name = jj_consume_token(IDENTIFIER); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case EXTENDS: jj_consume_token(EXTENDS); AmbiguousName(); jjtn000.extend = true; break; default: ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IMPLEMENTS: jj_consume_token(IMPLEMENTS); numInterfaces = NameList(); jjtn000.numInterfaces=numInterfaces; break; default: ; } Block(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.modifiers = mods; jjtn000.name = name.image; } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void MethodDeclaration() throws ParseException { /*@bgen(jjtree) MethodDeclaration */ BSHMethodDeclaration jjtn000 = new BSHMethodDeclaration(JJTMETHODDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t = null; Modifiers mods; int count; try { mods = Modifiers(Modifiers.METHOD, false); jjtn000.modifiers = mods; if (jj_2_2(2147483647)) { t = jj_consume_token(IDENTIFIER); jjtn000.name = t.image; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case SHORT: case VOID: case IDENTIFIER: ReturnType(); t = jj_consume_token(IDENTIFIER); jjtn000.name = t.image; break; default: jj_consume_token(-1); throw new ParseException(); } } FormalParameters(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case THROWS: jj_consume_token(THROWS); count = NameList(); jjtn000.numThrows=count; break; default: ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: Block(); break; case SEMICOLON: jj_consume_token(SEMICOLON); break; default: jj_consume_token(-1); throw new ParseException(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PackageDeclaration() throws ParseException { /*@bgen(jjtree) PackageDeclaration */ BSHPackageDeclaration jjtn000 = new BSHPackageDeclaration(JJTPACKAGEDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(PACKAGE); AmbiguousName(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ImportDeclaration() throws ParseException { /*@bgen(jjtree) ImportDeclaration */ BSHImportDeclaration jjtn000 = new BSHImportDeclaration(JJTIMPORTDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token s = null; Token t = null; try { if (jj_2_3(3)) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STATIC: s = jj_consume_token(STATIC); break; default: ; } jj_consume_token(IMPORT); AmbiguousName(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case DOT: t = jj_consume_token(DOT); jj_consume_token(STAR); break; default: ; } jj_consume_token(SEMICOLON); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); if ( s != null ) jjtn000.staticImport = true; if ( t != null ) jjtn000.importPackage = true; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IMPORT: jj_consume_token(IMPORT); jj_consume_token(STAR); jj_consume_token(SEMICOLON); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.superImport = true; break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void VariableDeclarator() throws ParseException { /*@bgen(jjtree) VariableDeclarator */ BSHVariableDeclarator jjtn000 = new BSHVariableDeclarator(JJTVARIABLEDECLARATOR); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t; try { t = jj_consume_token(IDENTIFIER); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ASSIGN: jj_consume_token(ASSIGN); VariableInitializer(); break; default: ; } jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.name = t.image; } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void VariableInitializer() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: ArrayInitializer(); break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: Expression(); break; default: jj_consume_token(-1); throw new ParseException(); } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ArrayInitializer() throws ParseException { /*@bgen(jjtree) ArrayInitializer */ BSHArrayInitializer jjtn000 = new BSHArrayInitializer(JJTARRAYINITIALIZER); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(LBRACE); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case LBRACE: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: VariableInitializer(); label_2: while (true) { if (jj_2_4(2)) { ; } else { break label_2; } jj_consume_token(COMMA); VariableInitializer(); } break; default: ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: jj_consume_token(COMMA); break; default: ; } jj_consume_token(RBRACE); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void FormalParameters() throws ParseException { /*@bgen(jjtree) FormalParameters */ BSHFormalParameters jjtn000 = new BSHFormalParameters(JJTFORMALPARAMETERS); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(LPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case SHORT: case IDENTIFIER: FormalParameter(); label_3: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: break label_3; } jj_consume_token(COMMA); FormalParameter(); } break; default: ; } jj_consume_token(RPAREN); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void FormalParameter() throws ParseException { /*@bgen(jjtree) FormalParameter */ BSHFormalParameter jjtn000 = new BSHFormalParameter(JJTFORMALPARAMETER); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t; try { if (jj_2_5(2)) { Type(); t = jj_consume_token(IDENTIFIER); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.name = t.image; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENTIFIER: t = jj_consume_token(IDENTIFIER); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.name = t.image; break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Type() throws ParseException { /*@bgen(jjtree) Type */ BSHType jjtn000 = new BSHType(JJTTYPE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case SHORT: PrimitiveType(); break; case IDENTIFIER: AmbiguousName(); break; default: jj_consume_token(-1); throw new ParseException(); } label_4: while (true) { if (jj_2_6(2)) { ; } else { break label_4; } jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); jjtn000.addArrayDimension(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ReturnType() throws ParseException { /*@bgen(jjtree) ReturnType */ BSHReturnType jjtn000 = new BSHReturnType(JJTRETURNTYPE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case VOID: jj_consume_token(VOID); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.isVoid = true; break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case SHORT: case IDENTIFIER: Type(); break; default: jj_consume_token(-1); throw new ParseException(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PrimitiveType() throws ParseException { /*@bgen(jjtree) PrimitiveType */ BSHPrimitiveType jjtn000 = new BSHPrimitiveType(JJTPRIMITIVETYPE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: jj_consume_token(BOOLEAN); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Boolean.TYPE; break; case CHAR: jj_consume_token(CHAR); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Character.TYPE; break; case BYTE: jj_consume_token(BYTE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Byte.TYPE; break; case SHORT: jj_consume_token(SHORT); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Short.TYPE; break; case INT: jj_consume_token(INT); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Integer.TYPE; break; case LONG: jj_consume_token(LONG); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Long.TYPE; break; case FLOAT: jj_consume_token(FLOAT); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Float.TYPE; break; case DOUBLE: jj_consume_token(DOUBLE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.type = Double.TYPE; break; default: jj_consume_token(-1); throw new ParseException(); } } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void AmbiguousName() throws ParseException { /*@bgen(jjtree) AmbiguousName */ BSHAmbiguousName jjtn000 = new BSHAmbiguousName(JJTAMBIGUOUSNAME); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t; StringBuilder s; try { t = jj_consume_token(IDENTIFIER); s = new StringBuilder(t.image); label_5: while (true) { if (jj_2_7(2)) { ; } else { break label_5; } jj_consume_token(DOT); t = jj_consume_token(IDENTIFIER); s.append("."+t.image); } jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.text = s.toString(); } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public int NameList() throws ParseException { int count = 0; AmbiguousName(); ++count; label_6: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: break label_6; } jj_consume_token(COMMA); AmbiguousName(); ++count; } {if (true) return count;} throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Expression() throws ParseException { if (jj_2_8(2147483647)) { Assignment(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: ConditionalExpression(); break; default: jj_consume_token(-1); throw new ParseException(); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Assignment() throws ParseException { /*@bgen(jjtree) Assignment */ BSHAssignment jjtn000 = new BSHAssignment(JJTASSIGNMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);int op ; try { PrimaryExpression(); op = AssignmentOperator(); jjtn000.operator = op; Expression(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public int AssignmentOperator() throws ParseException { Token t; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ASSIGN: jj_consume_token(ASSIGN); break; case STARASSIGN: jj_consume_token(STARASSIGN); break; case SLASHASSIGN: jj_consume_token(SLASHASSIGN); break; case MODASSIGN: jj_consume_token(MODASSIGN); break; case PLUSASSIGN: jj_consume_token(PLUSASSIGN); break; case MINUSASSIGN: jj_consume_token(MINUSASSIGN); break; case ANDASSIGN: jj_consume_token(ANDASSIGN); break; case XORASSIGN: jj_consume_token(XORASSIGN); break; case ORASSIGN: jj_consume_token(ORASSIGN); break; case LSHIFTASSIGN: jj_consume_token(LSHIFTASSIGN); break; case LSHIFTASSIGNX: jj_consume_token(LSHIFTASSIGNX); break; case RSIGNEDSHIFTASSIGN: jj_consume_token(RSIGNEDSHIFTASSIGN); break; case RSIGNEDSHIFTASSIGNX: jj_consume_token(RSIGNEDSHIFTASSIGNX); break; case RUNSIGNEDSHIFTASSIGN: jj_consume_token(RUNSIGNEDSHIFTASSIGN); break; case RUNSIGNEDSHIFTASSIGNX: jj_consume_token(RUNSIGNEDSHIFTASSIGNX); break; default: jj_consume_token(-1); throw new ParseException(); } t = getToken(0); {if (true) return t.kind;} throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ConditionalExpression() throws ParseException { ConditionalOrExpression(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case HOOK: jj_consume_token(HOOK); Expression(); jj_consume_token(COLON); BSHTernaryExpression jjtn001 = new BSHTernaryExpression(JJTTERNARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { ConditionalExpression(); } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 3); jjtreeCloseNodeScope(jjtn001); } } break; default: ; } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ConditionalOrExpression() throws ParseException { Token t=null; ConditionalAndExpression(); label_7: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOL_OR: case BOOL_ORX: ; break; default: break label_7; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOL_OR: t = jj_consume_token(BOOL_OR); break; case BOOL_ORX: t = jj_consume_token(BOOL_ORX); break; default: jj_consume_token(-1); throw new ParseException(); } ConditionalAndExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ConditionalAndExpression() throws ParseException { Token t=null; InclusiveOrExpression(); label_8: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOL_AND: case BOOL_ANDX: ; break; default: break label_8; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOL_AND: t = jj_consume_token(BOOL_AND); break; case BOOL_ANDX: t = jj_consume_token(BOOL_ANDX); break; default: jj_consume_token(-1); throw new ParseException(); } InclusiveOrExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void InclusiveOrExpression() throws ParseException { Token t=null; ExclusiveOrExpression(); label_9: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_OR: case BIT_ORX: ; break; default: break label_9; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_OR: t = jj_consume_token(BIT_OR); break; case BIT_ORX: t = jj_consume_token(BIT_ORX); break; default: jj_consume_token(-1); throw new ParseException(); } ExclusiveOrExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ExclusiveOrExpression() throws ParseException { Token t=null; AndExpression(); label_10: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case XOR: ; break; default: break label_10; } t = jj_consume_token(XOR); AndExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void AndExpression() throws ParseException { Token t=null; EqualityExpression(); label_11: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_AND: case BIT_ANDX: ; break; default: break label_11; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_AND: t = jj_consume_token(BIT_AND); break; case BIT_ANDX: t = jj_consume_token(BIT_ANDX); break; default: jj_consume_token(-1); throw new ParseException(); } EqualityExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void EqualityExpression() throws ParseException { Token t = null; InstanceOfExpression(); label_12: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case EQ: case NE: ; break; default: break label_12; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case EQ: t = jj_consume_token(EQ); break; case NE: t = jj_consume_token(NE); break; default: jj_consume_token(-1); throw new ParseException(); } InstanceOfExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void InstanceOfExpression() throws ParseException { Token t = null; RelationalExpression(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INSTANCEOF: t = jj_consume_token(INSTANCEOF); Type(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } break; default: ; } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void RelationalExpression() throws ParseException { Token t = null; ShiftExpression(); label_13: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case GT: case GTX: case LT: case LTX: case LE: case LEX: case GE: case GEX: ; break; default: break label_13; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LT: t = jj_consume_token(LT); break; case LTX: t = jj_consume_token(LTX); break; case GT: t = jj_consume_token(GT); break; case GTX: t = jj_consume_token(GTX); break; case LE: t = jj_consume_token(LE); break; case LEX: t = jj_consume_token(LEX); break; case GE: t = jj_consume_token(GE); break; case GEX: t = jj_consume_token(GEX); break; default: jj_consume_token(-1); throw new ParseException(); } ShiftExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ShiftExpression() throws ParseException { Token t = null; AdditiveExpression(); label_14: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LSHIFT: case LSHIFTX: case RSIGNEDSHIFT: case RSIGNEDSHIFTX: case RUNSIGNEDSHIFT: case RUNSIGNEDSHIFTX: ; break; default: break label_14; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LSHIFT: t = jj_consume_token(LSHIFT); break; case LSHIFTX: t = jj_consume_token(LSHIFTX); break; case RSIGNEDSHIFT: t = jj_consume_token(RSIGNEDSHIFT); break; case RSIGNEDSHIFTX: t = jj_consume_token(RSIGNEDSHIFTX); break; case RUNSIGNEDSHIFT: t = jj_consume_token(RUNSIGNEDSHIFT); break; case RUNSIGNEDSHIFTX: t = jj_consume_token(RUNSIGNEDSHIFTX); break; default: jj_consume_token(-1); throw new ParseException(); } AdditiveExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void AdditiveExpression() throws ParseException { Token t = null; MultiplicativeExpression(); label_15: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: case MINUS: ; break; default: break label_15; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: t = jj_consume_token(PLUS); break; case MINUS: t = jj_consume_token(MINUS); break; default: jj_consume_token(-1); throw new ParseException(); } MultiplicativeExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void MultiplicativeExpression() throws ParseException { Token t = null; UnaryExpression(); label_16: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STAR: case SLASH: case MOD: ; break; default: break label_16; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STAR: t = jj_consume_token(STAR); break; case SLASH: t = jj_consume_token(SLASH); break; case MOD: t = jj_consume_token(MOD); break; default: jj_consume_token(-1); throw new ParseException(); } UnaryExpression(); BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 2); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void UnaryExpression() throws ParseException { Token t = null; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: case MINUS: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: t = jj_consume_token(PLUS); break; case MINUS: t = jj_consume_token(MINUS); break; default: jj_consume_token(-1); throw new ParseException(); } UnaryExpression(); BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 1); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } } break; case INCR: PreIncrementExpression(); break; case DECR: PreDecrementExpression(); break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: UnaryExpressionNotPlusMinus(); break; default: jj_consume_token(-1); throw new ParseException(); } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PreIncrementExpression() throws ParseException { Token t = null; t = jj_consume_token(INCR); PrimaryExpression(); BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 1); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PreDecrementExpression() throws ParseException { Token t = null; t = jj_consume_token(DECR); PrimaryExpression(); BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 1); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void UnaryExpressionNotPlusMinus() throws ParseException { Token t = null; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BANG: case TILDE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case TILDE: t = jj_consume_token(TILDE); break; case BANG: t = jj_consume_token(BANG); break; default: jj_consume_token(-1); throw new ParseException(); } UnaryExpression(); BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 1); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } } break; default: if (jj_2_9(2147483647)) { CastExpression(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: PostfixExpression(); break; default: jj_consume_token(-1); throw new ParseException(); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void CastLookahead() throws ParseException { if (jj_2_10(2)) { jj_consume_token(LPAREN); PrimitiveType(); } else if (jj_2_11(2147483647)) { jj_consume_token(LPAREN); AmbiguousName(); jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: jj_consume_token(LPAREN); AmbiguousName(); jj_consume_token(RPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case TILDE: jj_consume_token(TILDE); break; case BANG: jj_consume_token(BANG); break; case LPAREN: jj_consume_token(LPAREN); break; case IDENTIFIER: jj_consume_token(IDENTIFIER); break; case NEW: jj_consume_token(NEW); break; case FALSE: case NULL: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: Literal(); break; default: jj_consume_token(-1); throw new ParseException(); } break; default: jj_consume_token(-1); throw new ParseException(); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PostfixExpression() throws ParseException { Token t = null; if (jj_2_12(2147483647)) { PrimaryExpression(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INCR: t = jj_consume_token(INCR); break; case DECR: t = jj_consume_token(DECR); break; default: jj_consume_token(-1); throw new ParseException(); } BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jjtree.closeNodeScope(jjtn001, 1); jjtc001 = false; jjtreeCloseNodeScope(jjtn001); jjtn001.kind = t.kind; jjtn001.postfix = true; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } } } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: PrimaryExpression(); break; default: jj_consume_token(-1); throw new ParseException(); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void CastExpression() throws ParseException { /*@bgen(jjtree) CastExpression */ BSHCastExpression jjtn000 = new BSHCastExpression(JJTCASTEXPRESSION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { if (jj_2_13(2147483647)) { jj_consume_token(LPAREN); Type(); jj_consume_token(RPAREN); UnaryExpression(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: jj_consume_token(LPAREN); Type(); jj_consume_token(RPAREN); UnaryExpressionNotPlusMinus(); break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PrimaryExpression() throws ParseException { /*@bgen(jjtree) PrimaryExpression */ BSHPrimaryExpression jjtn000 = new BSHPrimaryExpression(JJTPRIMARYEXPRESSION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { PrimaryPrefix(); label_17: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: case LBRACKET: case DOT: ; break; default: break label_17; } PrimarySuffix(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void MethodInvocation() throws ParseException { /*@bgen(jjtree) MethodInvocation */ BSHMethodInvocation jjtn000 = new BSHMethodInvocation(JJTMETHODINVOCATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { AmbiguousName(); Arguments(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PrimaryPrefix() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FALSE: case NULL: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: Literal(); break; case LPAREN: jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); break; case NEW: AllocationExpression(); break; default: if (jj_2_14(2147483647)) { MethodInvocation(); } else if (jj_2_15(2147483647)) { Type(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENTIFIER: AmbiguousName(); break; default: jj_consume_token(-1); throw new ParseException(); } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void PrimarySuffix() throws ParseException { /*@bgen(jjtree) PrimarySuffix */ BSHPrimarySuffix jjtn000 = new BSHPrimarySuffix(JJTPRIMARYSUFFIX); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t = null; try { if (jj_2_16(2)) { jj_consume_token(DOT); jj_consume_token(CLASS); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.operation = BSHPrimarySuffix.CLASS; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: jj_consume_token(LBRACKET); Expression(); jj_consume_token(RBRACKET); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.operation = BSHPrimarySuffix.INDEX; break; case DOT: jj_consume_token(DOT); t = jj_consume_token(IDENTIFIER); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: Arguments(); break; default: ; } jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.operation = BSHPrimarySuffix.NAME; jjtn000.field = t.image; break; case LBRACE: jj_consume_token(LBRACE); Expression(); jj_consume_token(RBRACE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.operation = BSHPrimarySuffix.PROPERTY; break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Literal() throws ParseException { /*@bgen(jjtree) Literal */ BSHLiteral jjtn000 = new BSHLiteral(JJTLITERAL); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token x; boolean b; String literal; char ch; try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INTEGER_LITERAL: x = jj_consume_token(INTEGER_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); literal = x.image; ch = literal.charAt(literal.length()-1); if(ch == 'l' || ch == 'L') { literal = literal.substring(0,literal.length()-1); // This really should be Long.decode, but there isn't one. As a result, // hex and octal literals ending in 'l' or 'L' don't work. jjtn000.value = new Primitive( new Long( literal ).longValue() ); } else try { jjtn000.value = new Primitive( Integer.decode( literal ).intValue() ); } catch ( NumberFormatException e ) { {if (true) throw createParseException( "Error or number too big for integer type: "+ literal );} } break; case FLOATING_POINT_LITERAL: x = jj_consume_token(FLOATING_POINT_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); literal = x.image; ch = literal.charAt(literal.length()-1); if(ch == 'f' || ch == 'F') { literal = literal.substring(0,literal.length()-1); jjtn000.value = new Primitive( new Float( literal ).floatValue() ); } else { if(ch == 'd' || ch == 'D') literal = literal.substring(0,literal.length()-1); jjtn000.value = new Primitive( new Double( literal ).doubleValue() ); } break; case CHARACTER_LITERAL: x = jj_consume_token(CHARACTER_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); try { jjtn000.charSetup( x.image.substring(1, x.image.length() - 1) ); } catch ( Exception e ) { {if (true) throw createParseException("Error parsing character: "+x.image);} } break; case STRING_LITERAL: x = jj_consume_token(STRING_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); try { jjtn000.stringSetup( x.image.substring(1, x.image.length() - 1) ); } catch ( Exception e ) { {if (true) throw createParseException("Error parsing string: "+x.image);} } break; case FALSE: case TRUE: b = BooleanLiteral(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.value = new Primitive( b ); break; case NULL: NullLiteral(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.value = Primitive.NULL; break; case VOID: VoidLiteral(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.value = Primitive.VOID; break; default: jj_consume_token(-1); throw new ParseException(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public boolean BooleanLiteral() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case TRUE: jj_consume_token(TRUE); {if (true) return true;} break; case FALSE: jj_consume_token(FALSE); {if (true) return false;} break; default: jj_consume_token(-1); throw new ParseException(); } throw new Error("Missing return statement in function"); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void NullLiteral() throws ParseException { jj_consume_token(NULL); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void VoidLiteral() throws ParseException { jj_consume_token(VOID); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Arguments() throws ParseException { /*@bgen(jjtree) Arguments */ BSHArguments jjtn000 = new BSHArguments(JJTARGUMENTS); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(LPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: ArgumentList(); break; default: ; } jj_consume_token(RPAREN); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ArgumentList() throws ParseException { Expression(); label_18: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: break label_18; } jj_consume_token(COMMA); Expression(); } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void AllocationExpression() throws ParseException { /*@bgen(jjtree) AllocationExpression */ BSHAllocationExpression jjtn000 = new BSHAllocationExpression(JJTALLOCATIONEXPRESSION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { if (jj_2_18(2)) { jj_consume_token(NEW); PrimitiveType(); ArrayDimensions(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case NEW: jj_consume_token(NEW); AmbiguousName(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: ArrayDimensions(); break; case LPAREN: Arguments(); if (jj_2_17(2)) { Block(); } else { ; } break; default: jj_consume_token(-1); throw new ParseException(); } break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ArrayDimensions() throws ParseException { /*@bgen(jjtree) ArrayDimensions */ BSHArrayDimensions jjtn000 = new BSHArrayDimensions(JJTARRAYDIMENSIONS); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { if (jj_2_21(2)) { label_19: while (true) { jj_consume_token(LBRACKET); Expression(); jj_consume_token(RBRACKET); jjtn000.addDefinedDimension(); if (jj_2_19(2)) { ; } else { break label_19; } } label_20: while (true) { if (jj_2_20(2)) { ; } else { break label_20; } jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); jjtn000.addUndefinedDimension(); } } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: label_21: while (true) { jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); jjtn000.addUndefinedDimension(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: ; break; default: break label_21; } } ArrayInitializer(); break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Statement() throws ParseException { if (jj_2_22(2)) { LabeledStatement(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: Block(); break; case SEMICOLON: EmptyStatement(); break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: StatementExpression(); jj_consume_token(SEMICOLON); break; case SWITCH: SwitchStatement(); break; case IF: IfStatement(); break; case WHILE: WhileStatement(); break; case DO: DoStatement(); break; default: if (isRegularForStatement()) { ForStatement(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FOR: EnhancedForStatement(); break; case BREAK: BreakStatement(); break; case CONTINUE: ContinueStatement(); break; case RETURN: ReturnStatement(); break; case SYNCHRONIZED: SynchronizedStatement(); break; case THROW: ThrowStatement(); break; case TRY: TryStatement(); break; default: jj_consume_token(-1); throw new ParseException(); } } } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void LabeledStatement() throws ParseException { jj_consume_token(IDENTIFIER); jj_consume_token(COLON); Statement(); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void Block() throws ParseException { /*@bgen(jjtree) Block */ BSHBlock jjtn000 = new BSHBlock(JJTBLOCK); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(LBRACE); label_22: while (true) { if (jj_2_23(1)) { ; } else { break label_22; } BlockStatement(); } jj_consume_token(RBRACE); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void BlockStatement() throws ParseException { if (jj_2_24(2147483647)) { ClassDeclaration(); } else if (jj_2_25(2147483647)) { MethodDeclaration(); } else if (jj_2_26(2147483647)) { MethodDeclaration(); } else if (jj_2_27(2147483647)) { TypedVariableDeclaration(); jj_consume_token(SEMICOLON); } else if (jj_2_28(1)) { Statement(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IMPORT: case STATIC: ImportDeclaration(); break; case PACKAGE: PackageDeclaration(); break; case FORMAL_COMMENT: FormalComment(); break; default: jj_consume_token(-1); throw new ParseException(); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void FormalComment() throws ParseException { /*@bgen(jjtree) #FormalComment( retainComments) */ BSHFormalComment jjtn000 = new BSHFormalComment(JJTFORMALCOMMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t; try { t = jj_consume_token(FORMAL_COMMENT); jjtree.closeNodeScope(jjtn000, retainComments); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.text=t.image; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, retainComments); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void EmptyStatement() throws ParseException { jj_consume_token(SEMICOLON); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void StatementExpression() throws ParseException { Expression(); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void SwitchStatement() throws ParseException { /*@bgen(jjtree) SwitchStatement */ BSHSwitchStatement jjtn000 = new BSHSwitchStatement(JJTSWITCHSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(SWITCH); jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); jj_consume_token(LBRACE); label_23: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case CASE: case _DEFAULT: ; break; default: break label_23; } SwitchLabel(); label_24: while (true) { if (jj_2_29(1)) { ; } else { break label_24; } BlockStatement(); } } jj_consume_token(RBRACE); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void SwitchLabel() throws ParseException { /*@bgen(jjtree) SwitchLabel */ BSHSwitchLabel jjtn000 = new BSHSwitchLabel(JJTSWITCHLABEL); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case CASE: jj_consume_token(CASE); Expression(); jj_consume_token(COLON); break; case _DEFAULT: jj_consume_token(_DEFAULT); jj_consume_token(COLON); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.isDefault = true; break; default: jj_consume_token(-1); throw new ParseException(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void IfStatement() throws ParseException { /*@bgen(jjtree) IfStatement */ BSHIfStatement jjtn000 = new BSHIfStatement(JJTIFSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(IF); jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); Statement(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ELSE: jj_consume_token(ELSE); Statement(); break; default: ; } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void WhileStatement() throws ParseException { /*@bgen(jjtree) WhileStatement */ BSHWhileStatement jjtn000 = new BSHWhileStatement(JJTWHILESTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(WHILE); jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); Statement(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void DoStatement() throws ParseException { /*@bgen(jjtree) WhileStatement */ BSHWhileStatement jjtn000 = new BSHWhileStatement(JJTWHILESTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(DO); Statement(); jj_consume_token(WHILE); jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); jj_consume_token(SEMICOLON); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.isDoStatement=true; } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ForStatement() throws ParseException { /*@bgen(jjtree) ForStatement */ BSHForStatement jjtn000 = new BSHForStatement(JJTFORSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t = null; try { jj_consume_token(FOR); jj_consume_token(LPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ABSTRACT: case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FINAL: case FLOAT: case INT: case LONG: case NATIVE: case NEW: case NULL: case PRIVATE: case PROTECTED: case PUBLIC: case SHORT: case STATIC: case STRICTFP: case SYNCHRONIZED: case TRANSIENT: case TRUE: case VOID: case VOLATILE: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: ForInit(); jjtn000.hasForInit=true; break; default: ; } jj_consume_token(SEMICOLON); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: Expression(); jjtn000.hasExpression=true; break; default: ; } jj_consume_token(SEMICOLON); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: ForUpdate(); jjtn000.hasForUpdate=true; break; default: ; } jj_consume_token(RPAREN); Statement(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void EnhancedForStatement() throws ParseException { /*@bgen(jjtree) EnhancedForStatement */ BSHEnhancedForStatement jjtn000 = new BSHEnhancedForStatement(JJTENHANCEDFORSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t = null; try { if (jj_2_30(4)) { jj_consume_token(FOR); jj_consume_token(LPAREN); t = jj_consume_token(IDENTIFIER); jj_consume_token(COLON); Expression(); jj_consume_token(RPAREN); Statement(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.varName = t.image; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FOR: jj_consume_token(FOR); jj_consume_token(LPAREN); Type(); t = jj_consume_token(IDENTIFIER); jj_consume_token(COLON); Expression(); jj_consume_token(RPAREN); Statement(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.varName = t.image; break; default: jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ForInit() throws ParseException { Token t = null; if (jj_2_31(2147483647)) { TypedVariableDeclaration(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: StatementExpressionList(); break; default: jj_consume_token(-1); throw new ParseException(); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void TypedVariableDeclaration() throws ParseException { /*@bgen(jjtree) TypedVariableDeclaration */ BSHTypedVariableDeclaration jjtn000 = new BSHTypedVariableDeclaration(JJTTYPEDVARIABLEDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t = null; Modifiers mods; try { mods = Modifiers(Modifiers.FIELD, false); Type(); VariableDeclarator(); label_25: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: break label_25; } jj_consume_token(COMMA); VariableDeclarator(); } jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.modifiers = mods; } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void StatementExpressionList() throws ParseException { /*@bgen(jjtree) StatementExpressionList */ BSHStatementExpressionList jjtn000 = new BSHStatementExpressionList(JJTSTATEMENTEXPRESSIONLIST); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { StatementExpression(); label_26: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: break label_26; } jj_consume_token(COMMA); StatementExpression(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ForUpdate() throws ParseException { StatementExpressionList(); }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void BreakStatement() throws ParseException { /*@bgen(jjtree) ReturnStatement */ BSHReturnStatement jjtn000 = new BSHReturnStatement(JJTRETURNSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(BREAK); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENTIFIER: jj_consume_token(IDENTIFIER); break; default: ; } jj_consume_token(SEMICOLON); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.kind = BREAK; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ContinueStatement() throws ParseException { /*@bgen(jjtree) ReturnStatement */ BSHReturnStatement jjtn000 = new BSHReturnStatement(JJTRETURNSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(CONTINUE); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENTIFIER: jj_consume_token(IDENTIFIER); break; default: ; } jj_consume_token(SEMICOLON); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.kind = CONTINUE; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ReturnStatement() throws ParseException { /*@bgen(jjtree) ReturnStatement */ BSHReturnStatement jjtn000 = new BSHReturnStatement(JJTRETURNSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(RETURN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: Expression(); break; default: ; } jj_consume_token(SEMICOLON); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.kind = RETURN; } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void SynchronizedStatement() throws ParseException { /*@bgen(jjtree) Block */ BSHBlock jjtn000 = new BSHBlock(JJTBLOCK); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(SYNCHRONIZED); jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); Block(); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.isSynchronized=true; } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void ThrowStatement() throws ParseException { /*@bgen(jjtree) ThrowStatement */ BSHThrowStatement jjtn000 = new BSHThrowStatement(JJTTHROWSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(THROW); Expression(); jj_consume_token(SEMICOLON); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final public void TryStatement() throws ParseException { /*@bgen(jjtree) TryStatement */ BSHTryStatement jjtn000 = new BSHTryStatement(JJTTRYSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);boolean closed = false; try { jj_consume_token(TRY); Block(); label_27: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case CATCH: ; break; default: break label_27; } jj_consume_token(CATCH); jj_consume_token(LPAREN); FormalParameter(); jj_consume_token(RPAREN); Block(); closed = true; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FINALLY: jj_consume_token(FINALLY); Block(); closed = true; break; default: ; } jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); if ( !closed ) {if (true) throw generateParseException();} } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } }
// in org/gjt/sp/jedit/bsh/Parser.java
final private Token jj_consume_token(int kind) throws ParseException { Token oldToken; if ((oldToken = token).next != null) token = token.next; else token = token.next = token_source.getNextToken(); jj_ntk = -1; if (token.kind == kind) { return token; } token = oldToken; throw generateParseException(); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
private boolean Line() throws ParseException { return parser.Line(); }
3
            
// in org/gjt/sp/jedit/pluginmgr/InstallPanel.java
catch (ParseException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(ParseException e) { error("Parser Error: " + e.getMessage(DEBUG)); if ( DEBUG ) e.printStackTrace(); if(!interactive) eof = true; parser.reInitInput(in); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(ParseException e) { /* throw new EvalError( "Sourced file: "+sourceFileInfo+" parser Error: " + e.getMessage( DEBUG ), node, callstack ); */ if ( DEBUG ) // show extra "expecting..." info error( e.getMessage(DEBUG) ); // add the source file info and throw again e.setErrorSourceFile( sourceFileInfo ); throw e; }
1
            
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(ParseException e) { /* throw new EvalError( "Sourced file: "+sourceFileInfo+" parser Error: " + e.getMessage( DEBUG ), node, callstack ); */ if ( DEBUG ) // show extra "expecting..." info error( e.getMessage(DEBUG) ); // add the source file info and throw again e.setErrorSourceFile( sourceFileInfo ); throw e; }
0
unknown (Lib) PatternSyntaxException 0 0 16
            
// in org/gjt/sp/jedit/indent/IndentRuleFactory.java
public static IndentRule indentNextLines(String regexp) throws PatternSyntaxException { return new RegexpIndentRule("indentNextLines", regexp, null, new IndentAction.Increase(), null,false); }
// in org/gjt/sp/jedit/indent/IndentRuleFactory.java
public static IndentRule indentNextLine(String regexp) throws PatternSyntaxException { return new RegexpIndentRule("indentNextLine", regexp, new IndentAction.Decrease(), new IndentAction.Increase(), null,true); }
// in org/gjt/sp/jedit/indent/IndentRuleFactory.java
public static IndentRule unindentThisLine(String regexp) throws PatternSyntaxException { return new RegexpIndentRule("unindentThisLine", regexp, null, new IndentAction.Increase(), new IndentAction.Decrease(), false); }
// in org/gjt/sp/jedit/indent/IndentRuleFactory.java
public static IndentRule unindentNextLines(String regexp) throws PatternSyntaxException { return new RegexpIndentRule("unindentNextLines", regexp, null, new IndentAction.Decrease(), null, false); }
// in org/gjt/sp/jedit/indent/IndentRuleFactory.java
public static IndentRule indentOpenBracket(char bracket) throws PatternSyntaxException { return new OpenBracketIndentRule(bracket,true); }
// in org/gjt/sp/jedit/indent/IndentRuleFactory.java
public static IndentRule indentCloseBracket(char bracket) throws PatternSyntaxException { return new CloseBracketIndentRule(bracket,true); }
// in org/gjt/sp/jedit/indent/IndentRuleFactory.java
public static IndentRule unalignedOpenBracket(char bracket) throws PatternSyntaxException { return new OpenBracketIndentRule(bracket,false); }
// in org/gjt/sp/jedit/indent/IndentRuleFactory.java
public static IndentRule unalignedCloseBracket(char bracket) throws PatternSyntaxException { return new CloseBracketIndentRule(bracket,false); }
// in org/gjt/sp/jedit/syntax/ParserRule.java
public static ParserRule createRegexpSequenceRule( String hashChar, int posMatch, String seq, ParserRuleSet delegate, byte id, boolean ignoreCase) throws PatternSyntaxException { return new ParserRule(SEQ | REGEXP, hashChar, posMatch, null, Pattern.compile(seq,(ignoreCase ? Pattern.CASE_INSENSITIVE : 0)), 0, null, null, delegate, id, MATCH_TYPE_CONTEXT, null); }
// in org/gjt/sp/jedit/syntax/ParserRule.java
public static ParserRule createRegexpSequenceRule( int posMatch, char[] hashChars, String seq, ParserRuleSet delegate, byte id, boolean ignoreCase) throws PatternSyntaxException { return new ParserRule(hashChars, SEQ | REGEXP, posMatch, null, Pattern.compile(seq,(ignoreCase ? Pattern.CASE_INSENSITIVE : 0)), 0, null, null, delegate, id, MATCH_TYPE_CONTEXT, null); }
// in org/gjt/sp/jedit/syntax/ParserRule.java
public static ParserRule createRegexpSpanRule( String hashChar, int startPosMatch, String start, int endPosMatch, String end, ParserRuleSet delegate, byte id, byte matchType, boolean noLineBreak, boolean noWordBreak, boolean ignoreCase, String escape, boolean endRegexp) throws PatternSyntaxException { int ruleAction = SPAN | REGEXP | ((noLineBreak) ? NO_LINE_BREAK : 0) | ((noWordBreak) ? NO_WORD_BREAK : 0); Pattern endRegexpPattern; char[] endArray; if (endRegexp) { ruleAction |= END_REGEXP; endRegexpPattern = Pattern.compile(end, (ignoreCase ? Pattern.CASE_INSENSITIVE : 0)); endArray = null; } else { endRegexpPattern = null; endArray = end.toCharArray(); } return new ParserRule(ruleAction, hashChar, startPosMatch, null, Pattern.compile(start,(ignoreCase ? Pattern.CASE_INSENSITIVE : 0)), endPosMatch, endArray, endRegexpPattern, delegate, id, matchType, escape); }
// in org/gjt/sp/jedit/syntax/ParserRule.java
public static ParserRule createRegexpSpanRule( int startPosMatch, char[] hashChars, String start, int endPosMatch, String end, ParserRuleSet delegate, byte id, byte matchType, boolean noLineBreak, boolean noWordBreak, boolean ignoreCase, String escape, boolean endRegexp) throws PatternSyntaxException { int ruleAction = SPAN | REGEXP | ((noLineBreak) ? NO_LINE_BREAK : 0) | ((noWordBreak) ? NO_WORD_BREAK : 0); Pattern endRegexpPattern; char[] endArray; if (endRegexp) { ruleAction |= END_REGEXP; endRegexpPattern = Pattern.compile(end, (ignoreCase ? Pattern.CASE_INSENSITIVE : 0)); endArray = null; } else { endRegexpPattern = null; endArray = end.toCharArray(); } return new ParserRule(hashChars, ruleAction, startPosMatch, null, Pattern.compile(start,(ignoreCase ? Pattern.CASE_INSENSITIVE : 0)), endPosMatch, endArray, endRegexpPattern, delegate, id, matchType, escape); }
// in org/gjt/sp/jedit/syntax/ParserRule.java
public static ParserRule createRegexpEOLSpanRule( String hashChar, int posMatch, String seq, ParserRuleSet delegate, byte id, byte matchType, boolean ignoreCase) throws PatternSyntaxException { int ruleAction = EOL_SPAN | REGEXP | NO_LINE_BREAK; return new ParserRule(ruleAction, hashChar, posMatch, null, Pattern.compile(seq,(ignoreCase ? Pattern.CASE_INSENSITIVE : 0)), 0, null, null, delegate, id, matchType, null); }
// in org/gjt/sp/jedit/syntax/ParserRule.java
public static ParserRule createRegexpEOLSpanRule( int posMatch, char[] hashChars, String seq, ParserRuleSet delegate, byte id, byte matchType, boolean ignoreCase) throws PatternSyntaxException { int ruleAction = EOL_SPAN | REGEXP | NO_LINE_BREAK; return new ParserRule(hashChars, ruleAction, posMatch, null, Pattern.compile(seq,(ignoreCase ? Pattern.CASE_INSENSITIVE : 0)), 0, null, null, delegate, id, matchType, null); }
7
            
// in org/gjt/sp/jedit/Mode.java
catch(PatternSyntaxException re) { Log.log(Log.ERROR,this,"Invalid filename/firstline" + " globs in mode " + name); Log.log(Log.ERROR,this,re); }
// in org/gjt/sp/jedit/io/VFS.java
catch(PatternSyntaxException e) { Log.log(Log.ERROR,VFS.class,"Invalid regular expression: " + glob); Log.log(Log.ERROR,VFS.class,e); }
// in org/gjt/sp/jedit/menu/RecentFilesProvider.java
catch(PatternSyntaxException re) { Log.log(Log.ERROR,this,re.getMessage()); }
// in org/gjt/sp/jedit/syntax/XModeHandler.java
catch(PatternSyntaxException e) { error("regexp",e); }
// in org/gjt/sp/jedit/syntax/XModeHandler.java
catch(PatternSyntaxException re) { error("regexp",re); }
// in org/gjt/sp/jedit/syntax/XModeHandler.java
catch(PatternSyntaxException re) { error("regexp",re); }
// in org/gjt/sp/jedit/syntax/XModeHandler.java
catch(PatternSyntaxException re) { error("regexp",re); }
0 0
unknown (Lib) PrinterAbortException 0 0 0 1
            
// in org/gjt/sp/jedit/print/BufferPrintable.java
catch(PrinterAbortException ae) { Log.log(Log.DEBUG,this,ae); }
0 0
checked (Domain) ReflectError
class ReflectError extends Exception
{
	public ReflectError() { super(); }
	public ReflectError(String s) { super(s); }
}
14
            
// in org/gjt/sp/jedit/bsh/Reflect.java
static Object invokeMethod( Method method, Object object, Object[] args ) throws ReflectError, InvocationTargetException { if ( args == null ) args = new Object[0]; logInvokeMethod( "Invoking method (entry): ", method, args ); // Map types to assignable forms, need to keep this fast... Object [] tmpArgs = new Object [ args.length ]; Class [] types = method.getParameterTypes(); try { for (int i=0; i<args.length; i++) tmpArgs[i] = Types.castObject( args[i]/*rhs*/, types[i]/*lhsType*/, Types.ASSIGNMENT ); } catch ( UtilEvalError e ) { throw new InterpreterError( "illegal argument type in method invocation: "+e ); } // unwrap any primitives tmpArgs = Primitive.unwrap( tmpArgs ); logInvokeMethod( "Invoking method (after massaging values): ", method, tmpArgs ); try { Object returnValue = method.invoke( object, tmpArgs ); if ( returnValue == null ) returnValue = Primitive.NULL; Class returnType = method.getReturnType(); return Primitive.wrap( returnValue, returnType ); } catch( IllegalAccessException e ) { throw new ReflectError( "Cannot access method " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " in '" + method.getDeclaringClass() + "' :" + e ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getIndex(Object array, int index) throws ReflectError, UtilTargetError { if ( Interpreter.DEBUG ) Interpreter.debug("getIndex: "+array+", index="+index); try { Object val = Array.get(array, index); return Primitive.wrap( val, array.getClass().getComponentType() ); } catch( ArrayIndexOutOfBoundsException e1 ) { throw new UtilTargetError( e1 ); } catch(Exception e) { throw new ReflectError("Array access:" + e); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static void setIndex(Object array, int index, Object val) throws ReflectError, UtilTargetError { try { val = Primitive.unwrap(val); Array.set(array, index, val); } catch( ArrayStoreException e2 ) { throw new UtilTargetError( e2 ); } catch( IllegalArgumentException e1 ) { throw new UtilTargetError( new ArrayStoreException( e1.toString() ) ); } catch(Exception e) { throw new ReflectError("Array access:" + e); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
private static Object getFieldValue( Class clas, Object object, String fieldName, boolean staticOnly ) throws UtilEvalError, ReflectError { try { Field f = resolveExpectedJavaField( clas, fieldName, staticOnly ); Object value = f.get(object); Class returnType = f.getType(); return Primitive.wrap( value, returnType ); } catch( NullPointerException e ) { // shouldn't happen throw new ReflectError( "???" + fieldName + " is not a static field."); } catch(IllegalAccessException e) { throw new ReflectError("Can't access field: " + fieldName); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Field resolveExpectedJavaField( Class clas, String fieldName, boolean staticOnly ) throws UtilEvalError, ReflectError { Field field; try { if ( Capabilities.haveAccessibility() ) field = findAccessibleField( clas, fieldName ); else // Class getField() finds only public (and in interfaces, etc.) field = clas.getField(fieldName); } catch( NoSuchFieldException e) { throw new ReflectError("No such field: " + fieldName ); } catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching fields of: "+clas, e ); } if ( staticOnly && !Modifier.isStatic( field.getModifiers() ) ) throw new UtilEvalError( "Can't reach instance field: "+fieldName +" from static context: "+clas.getName() ); return field; }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Method resolveExpectedJavaMethod( BshClassManager bcm, Class clas, Object object, String name, Object[] args, boolean staticOnly ) throws ReflectError, UtilEvalError { if ( object == Primitive.NULL ) throw new UtilTargetError( new NullPointerException( "Attempt to invoke method " +name+" on null value" ) ); Class [] types = Types.getTypes(args); Method method = resolveJavaMethod( bcm, clas, name, types, staticOnly ); if ( method == null ) throw new ReflectError( ( staticOnly ? "Static method " : "Method " ) + StringUtil.methodString(name, types) + " not found in class'" + clas.getName() + "'"); return method; }
// in org/gjt/sp/jedit/bsh/Reflect.java
static Object constructObject( Class clas, Object[] args ) throws ReflectError, InvocationTargetException { if ( clas.isInterface() ) throw new ReflectError( "Can't create instance of an interface: "+clas); Object obj = null; Class[] types = Types.getTypes(args); Constructor con = null; // Find the constructor. // (there are no inherited constructors to worry about) Constructor[] constructors = Capabilities.haveAccessibility() ? clas.getDeclaredConstructors() : clas.getConstructors() ; if ( Interpreter.DEBUG ) Interpreter.debug("Looking for most specific constructor: "+clas); con = findMostSpecificConstructor(types, constructors); if ( con == null ) throw cantFindConstructor( clas, types ); if ( !isPublic( con ) ) try { ReflectManager.RMSetAccessible( con ); } catch ( UtilEvalError e ) { /*ignore*/ } args=Primitive.unwrap( args ); try { obj = con.newInstance( args ); } catch(InstantiationException e) { throw new ReflectError("The class "+clas+" is abstract "); } catch(IllegalAccessException e) { throw new ReflectError( "We don't have permission to create an instance." +"Use setAccessibility(true) to enable access." ); } catch(IllegalArgumentException e) { throw new ReflectError("The number of arguments was wrong"); } if (obj == null) throw new ReflectError("Couldn't construct the object"); return obj; }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getObjectProperty( Object obj, String propName ) throws UtilEvalError, ReflectError { Object[] args = new Object[] { }; Interpreter.debug("property access: "); Method method = null; Exception e1=null, e2=null; try { String accessorName = accessorName( "get", propName ); method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); } catch ( Exception e ) { e1 = e; } if ( method == null ) try { String accessorName = accessorName( "is", propName ); method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); if ( method.getReturnType() != Boolean.TYPE ) method = null; } catch ( Exception e ) { e2 = e; } if ( method == null ) throw new ReflectError("Error in property getter: " +e1 + (e2!=null?" : "+e2:"") ); try { return invokeMethod( method, obj, args ); } catch(InvocationTargetException e) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Class getArrayBaseType(Class arrayClass) throws ReflectError { if ( !arrayClass.isArray() ) throw new ReflectError("The class is not an array."); return arrayClass.getComponentType(); }
9
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( IllegalAccessException e ) { throw new ReflectError( "Cannot access method " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " in '" + method.getDeclaringClass() + "' :" + e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(Exception e) { throw new ReflectError("Array access:" + e); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(Exception e) { throw new ReflectError("Array access:" + e); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( NullPointerException e ) { // shouldn't happen throw new ReflectError( "???" + fieldName + " is not a static field."); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalAccessException e) { throw new ReflectError("Can't access field: " + fieldName); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( NoSuchFieldException e) { throw new ReflectError("No such field: " + fieldName ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(InstantiationException e) { throw new ReflectError("The class "+clas+" is abstract "); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalAccessException e) { throw new ReflectError( "We don't have permission to create an instance." +"Use setAccessibility(true) to enable access." ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(IllegalArgumentException e) { throw new ReflectError("The number of arguments was wrong"); }
21
            
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
private Object doName( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError, ReflectError, InvocationTargetException { try { // .length on array if ( field.equals("length") && obj.getClass().isArray() ) if ( toLHS ) throw new EvalError( "Can't assign array length", this, callstack ); else return new Primitive(Array.getLength(obj)); // field access if ( jjtGetNumChildren() == 0 ) if ( toLHS ) return Reflect.getLHSObjectField(obj, field); else return Reflect.getObjectFieldValue( obj, field ); // Method invocation // (LHS or non LHS evaluation can both encounter method calls) Object[] oa = ((BSHArguments)jjtGetChild(0)).getArguments( callstack, interpreter); // TODO: // Note: this try/catch block is copied from BSHMethodInvocation // we need to factor out this common functionality and make sure // we handle all cases ... (e.g. property style access, etc.) // maybe move this to Reflect ? try { return Reflect.invokeObjectMethod( obj, field, oa, interpreter, callstack, this ); } catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); } catch ( InvocationTargetException e ) { String msg = "Method Invocation "+field; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); } } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
private Object doIndex( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter ) throws EvalError, ReflectError { int index = getIndexAux( obj, callstack, interpreter, this ); if ( toLHS ) return new LHS(obj, index); else try { return Reflect.getIndex(obj, index); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
public Object invokeSuperclassMethod( BshClassManager bcm, Object instance, String methodName, Object [] args ) throws UtilEvalError, ReflectError, InvocationTargetException { // Delegate to the static method return invokeSuperclassMethodImpl( bcm, instance, methodName, args ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
public static Object invokeSuperclassMethodImpl( BshClassManager bcm, Object instance, String methodName, Object [] args ) throws UtilEvalError, ReflectError, InvocationTargetException { String superName = ClassGeneratorUtil.BSHSUPER+methodName; // look for the specially named super delegate method Class clas = instance.getClass(); Method superMethod = Reflect.resolveJavaMethod( bcm, clas, superName, Types.getTypes(args), false/*onlyStatic*/ ); if ( superMethod != null ) return Reflect.invokeMethod( superMethod, instance, args ); // No super method, try to invoke regular method // could be a superfluous "super." which is legal. Class superClass = clas.getSuperclass(); superMethod = Reflect.resolveExpectedJavaMethod( bcm, superClass, instance, methodName, args, false/*onlyStatic*/ ); return Reflect.invokeMethod( superMethod, instance, args ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object invokeObjectMethod( Object object, String methodName, Object[] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo ) throws ReflectError, EvalError, InvocationTargetException { // Bsh scripted object if ( object instanceof This && !This.isExposedThisMethod(methodName) ) return ((This)object).invokeMethod( methodName, args, interpreter, callstack, callerInfo, false/*delcaredOnly*/ ); // Plain Java object, find the java method try { BshClassManager bcm = interpreter == null ? null : interpreter.getClassManager(); Class clas = object.getClass(); Method method = resolveExpectedJavaMethod( bcm, clas, object, methodName, args, false ); return invokeMethod( method, object, args ); } catch ( UtilEvalError e ) { throw e.toEvalError( callerInfo, callstack ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object invokeStaticMethod( BshClassManager bcm, Class clas, String methodName, Object [] args ) throws ReflectError, UtilEvalError, InvocationTargetException { Interpreter.debug("invoke static Method"); Method method = resolveExpectedJavaMethod( bcm, clas, null, methodName, args, true ); return invokeMethod( method, null, args ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
static Object invokeMethod( Method method, Object object, Object[] args ) throws ReflectError, InvocationTargetException { if ( args == null ) args = new Object[0]; logInvokeMethod( "Invoking method (entry): ", method, args ); // Map types to assignable forms, need to keep this fast... Object [] tmpArgs = new Object [ args.length ]; Class [] types = method.getParameterTypes(); try { for (int i=0; i<args.length; i++) tmpArgs[i] = Types.castObject( args[i]/*rhs*/, types[i]/*lhsType*/, Types.ASSIGNMENT ); } catch ( UtilEvalError e ) { throw new InterpreterError( "illegal argument type in method invocation: "+e ); } // unwrap any primitives tmpArgs = Primitive.unwrap( tmpArgs ); logInvokeMethod( "Invoking method (after massaging values): ", method, tmpArgs ); try { Object returnValue = method.invoke( object, tmpArgs ); if ( returnValue == null ) returnValue = Primitive.NULL; Class returnType = method.getReturnType(); return Primitive.wrap( returnValue, returnType ); } catch( IllegalAccessException e ) { throw new ReflectError( "Cannot access method " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " in '" + method.getDeclaringClass() + "' :" + e ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getIndex(Object array, int index) throws ReflectError, UtilTargetError { if ( Interpreter.DEBUG ) Interpreter.debug("getIndex: "+array+", index="+index); try { Object val = Array.get(array, index); return Primitive.wrap( val, array.getClass().getComponentType() ); } catch( ArrayIndexOutOfBoundsException e1 ) { throw new UtilTargetError( e1 ); } catch(Exception e) { throw new ReflectError("Array access:" + e); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static void setIndex(Object array, int index, Object val) throws ReflectError, UtilTargetError { try { val = Primitive.unwrap(val); Array.set(array, index, val); } catch( ArrayStoreException e2 ) { throw new UtilTargetError( e2 ); } catch( IllegalArgumentException e1 ) { throw new UtilTargetError( new ArrayStoreException( e1.toString() ) ); } catch(Exception e) { throw new ReflectError("Array access:" + e); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getStaticFieldValue(Class clas, String fieldName) throws UtilEvalError, ReflectError { return getFieldValue( clas, null, fieldName, true/*onlystatic*/); }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getObjectFieldValue( Object object, String fieldName ) throws UtilEvalError, ReflectError { if ( object instanceof This ) return ((This)object).namespace.getVariable( fieldName ); else { try { return getFieldValue( object.getClass(), object, fieldName, false/*onlystatic*/); } catch ( ReflectError e ) { // no field, try property acces if ( hasObjectPropertyGetter( object.getClass(), fieldName ) ) return getObjectProperty( object, fieldName ); else throw e; } } }
// in org/gjt/sp/jedit/bsh/Reflect.java
static LHS getLHSStaticField(Class clas, String fieldName) throws UtilEvalError, ReflectError { Field f = resolveExpectedJavaField( clas, fieldName, true/*onlystatic*/); return new LHS(f); }
// in org/gjt/sp/jedit/bsh/Reflect.java
static LHS getLHSObjectField( Object object, String fieldName ) throws UtilEvalError, ReflectError { if ( object instanceof This ) { // I guess this is when we pass it as an argument? // Setting locally boolean recurse = false; return new LHS( ((This)object).namespace, fieldName, recurse ); } try { Field f = resolveExpectedJavaField( object.getClass(), fieldName, false/*staticOnly*/ ); return new LHS(object, f); } catch ( ReflectError e ) { // not a field, try property access if ( hasObjectPropertySetter( object.getClass(), fieldName ) ) return new LHS( object, fieldName ); else throw e; } }
// in org/gjt/sp/jedit/bsh/Reflect.java
private static Object getFieldValue( Class clas, Object object, String fieldName, boolean staticOnly ) throws UtilEvalError, ReflectError { try { Field f = resolveExpectedJavaField( clas, fieldName, staticOnly ); Object value = f.get(object); Class returnType = f.getType(); return Primitive.wrap( value, returnType ); } catch( NullPointerException e ) { // shouldn't happen throw new ReflectError( "???" + fieldName + " is not a static field."); } catch(IllegalAccessException e) { throw new ReflectError("Can't access field: " + fieldName); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Field resolveExpectedJavaField( Class clas, String fieldName, boolean staticOnly ) throws UtilEvalError, ReflectError { Field field; try { if ( Capabilities.haveAccessibility() ) field = findAccessibleField( clas, fieldName ); else // Class getField() finds only public (and in interfaces, etc.) field = clas.getField(fieldName); } catch( NoSuchFieldException e) { throw new ReflectError("No such field: " + fieldName ); } catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching fields of: "+clas, e ); } if ( staticOnly && !Modifier.isStatic( field.getModifiers() ) ) throw new UtilEvalError( "Can't reach instance field: "+fieldName +" from static context: "+clas.getName() ); return field; }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Method resolveExpectedJavaMethod( BshClassManager bcm, Class clas, Object object, String name, Object[] args, boolean staticOnly ) throws ReflectError, UtilEvalError { if ( object == Primitive.NULL ) throw new UtilTargetError( new NullPointerException( "Attempt to invoke method " +name+" on null value" ) ); Class [] types = Types.getTypes(args); Method method = resolveJavaMethod( bcm, clas, name, types, staticOnly ); if ( method == null ) throw new ReflectError( ( staticOnly ? "Static method " : "Method " ) + StringUtil.methodString(name, types) + " not found in class'" + clas.getName() + "'"); return method; }
// in org/gjt/sp/jedit/bsh/Reflect.java
static Object constructObject( Class clas, Object[] args ) throws ReflectError, InvocationTargetException { if ( clas.isInterface() ) throw new ReflectError( "Can't create instance of an interface: "+clas); Object obj = null; Class[] types = Types.getTypes(args); Constructor con = null; // Find the constructor. // (there are no inherited constructors to worry about) Constructor[] constructors = Capabilities.haveAccessibility() ? clas.getDeclaredConstructors() : clas.getConstructors() ; if ( Interpreter.DEBUG ) Interpreter.debug("Looking for most specific constructor: "+clas); con = findMostSpecificConstructor(types, constructors); if ( con == null ) throw cantFindConstructor( clas, types ); if ( !isPublic( con ) ) try { ReflectManager.RMSetAccessible( con ); } catch ( UtilEvalError e ) { /*ignore*/ } args=Primitive.unwrap( args ); try { obj = con.newInstance( args ); } catch(InstantiationException e) { throw new ReflectError("The class "+clas+" is abstract "); } catch(IllegalAccessException e) { throw new ReflectError( "We don't have permission to create an instance." +"Use setAccessibility(true) to enable access." ); } catch(IllegalArgumentException e) { throw new ReflectError("The number of arguments was wrong"); } if (obj == null) throw new ReflectError("Couldn't construct the object"); return obj; }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getObjectProperty( Object obj, String propName ) throws UtilEvalError, ReflectError { Object[] args = new Object[] { }; Interpreter.debug("property access: "); Method method = null; Exception e1=null, e2=null; try { String accessorName = accessorName( "get", propName ); method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); } catch ( Exception e ) { e1 = e; } if ( method == null ) try { String accessorName = accessorName( "is", propName ); method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); if ( method.getReturnType() != Boolean.TYPE ) method = null; } catch ( Exception e ) { e2 = e; } if ( method == null ) throw new ReflectError("Error in property getter: " +e1 + (e2!=null?" : "+e2:"") ); try { return invokeMethod( method, obj, args ); } catch(InvocationTargetException e) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static void setObjectProperty( Object obj, String propName, Object value) throws ReflectError, UtilEvalError { String accessorName = accessorName( "set", propName ); Object[] args = new Object[] { value }; Interpreter.debug("property access: "); try { Method method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); invokeMethod( method, obj, args ); } catch ( InvocationTargetException e ) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Class getArrayBaseType(Class arrayClass) throws ReflectError { if ( !arrayClass.isArray() ) throw new ReflectError("The class is not an array."); return arrayClass.getComponentType(); }
// in org/gjt/sp/jedit/bsh/Name.java
public Object invokeMethod( Interpreter interpreter, Object[] args, CallStack callstack, SimpleNode callerInfo ) throws UtilEvalError, EvalError, ReflectError, InvocationTargetException { String methodName = Name.suffix(value, 1); BshClassManager bcm = interpreter.getClassManager(); NameSpace namespace = callstack.top(); // Optimization - If classOfStaticMethod is set then we have already // been here and determined that this is a static method invocation. // Note: maybe factor this out with path below... clean up. if ( classOfStaticMethod != null ) { return Reflect.invokeStaticMethod( bcm, classOfStaticMethod, methodName, args ); } if ( !Name.isCompound(value) ) return invokeLocalMethod( interpreter, args, callstack, callerInfo ); // Note: if we want methods declared inside blocks to be accessible via // this.methodname() inside the block we could handle it here as a // special case. See also resolveThisFieldReference() special handling // for BlockNameSpace case. They currently work via the direct name // e.g. methodName(). String prefix = Name.prefix(value); // Superclass method invocation? (e.g. super.foo()) if ( prefix.equals("super") && Name.countParts(value) == 2 ) { // Allow getThis() to work through block namespaces first This ths = namespace.getThis( interpreter ); NameSpace thisNameSpace = ths.getNameSpace(); NameSpace classNameSpace = getClassNameSpace( thisNameSpace ); if ( classNameSpace != null ) { Object instance = classNameSpace.getClassInstance(); return ClassGenerator.getClassGenerator() .invokeSuperclassMethod( bcm, instance, methodName, args ); } } // Find target object or class identifier Name targetName = namespace.getNameResolver( prefix ); Object obj = targetName.toObject( callstack, interpreter ); if ( obj == Primitive.VOID ) throw new UtilEvalError( "Attempt to resolve method: "+methodName +"() on undefined variable or class name: "+targetName); // if we've got an object, resolve the method if ( !(obj instanceof ClassIdentifier) ) { if (obj instanceof Primitive) { if (obj == Primitive.NULL) throw new UtilTargetError( new NullPointerException( "Null Pointer in Method Invocation" ) ); // some other primitive // should avoid calling methods on primitive, as we do // in Name (can't treat primitive like an object message) // but the hole is useful right now. if ( Interpreter.DEBUG ) interpreter.debug( "Attempt to access method on primitive..." + " allowing bsh.Primitive to peek through for debugging"); } // found an object and it's not an undefined variable return Reflect.invokeObjectMethod( obj, methodName, args, interpreter, callstack, callerInfo ); } // It's a class // try static method if ( Interpreter.DEBUG ) Interpreter.debug("invokeMethod: trying static - " + targetName); Class clas = ((ClassIdentifier)obj).getTargetClass(); // cache the fact that this is a static method invocation on this class classOfStaticMethod = clas; if ( clas != null ) return Reflect.invokeStaticMethod( bcm, clas, methodName, args ); // return null; ??? throw new UtilEvalError("invokeMethod: unknown target: " + targetName); }
16
            
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch(ReflectError e) { throw new EvalError("reflection error: " + e, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch (ReflectError e) { throw new EvalError("No such property: " + value, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( ReflectError e ) { throw new EvalError( "Error invoking Java method: "+e, callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { // no field, try property acces if ( hasObjectPropertyGetter( object.getClass(), fieldName ) ) return getObjectProperty( object, fieldName ); else throw e; }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { // not a field, try property access if ( hasObjectPropertySetter( object.getClass(), fieldName ) ) return new LHS( object, fieldName ); else throw e; }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { return null; }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( ReflectError e ) { /*shouldn't happen*/ }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { throw new UtilEvalError("Error invoking compiled command: "+e ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( ReflectError e) { throw new EvalError( "Constructor error: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch( ReflectError e ) { if ( Interpreter.DEBUG ) Interpreter.debug("field reflect error: "+e); }
// in org/gjt/sp/jedit/bsh/Name.java
catch(ReflectError e) { /* not a field */ }
// in org/gjt/sp/jedit/bsh/Name.java
catch(ReflectError e) { throw new UtilEvalError("Field access: "+e); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(ReflectError e) { Interpreter.debug(e.getMessage()); throw new UtilEvalError("No such property: " + propName); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(ReflectError e) { Interpreter.debug("Assignment: " + e.getMessage()); throw new UtilEvalError("No such property: " + propName); }
12
            
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch(ReflectError e) { throw new EvalError("reflection error: " + e, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch (ReflectError e) { throw new EvalError("No such property: " + value, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( ReflectError e ) { throw new EvalError( "Error invoking Java method: "+e, callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { // no field, try property acces if ( hasObjectPropertyGetter( object.getClass(), fieldName ) ) return getObjectProperty( object, fieldName ); else throw e; }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { // not a field, try property access if ( hasObjectPropertySetter( object.getClass(), fieldName ) ) return new LHS( object, fieldName ); else throw e; }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { throw new UtilEvalError("Error invoking compiled command: "+e ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( ReflectError e) { throw new EvalError( "Constructor error: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch(ReflectError e) { throw new UtilEvalError("Field access: "+e); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(ReflectError e) { Interpreter.debug(e.getMessage()); throw new UtilEvalError("No such property: " + propName); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(ReflectError e) { Interpreter.debug("Assignment: " + e.getMessage()); throw new UtilEvalError("No such property: " + propName); }
0
runtime (Lib) RuntimeException 10
            
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public static byte [] readBytesFromFile( File base, String className ) { String n = className.replace( '.', File.separatorChar ) + ".class"; File file = new File( base, n ); if ( file == null || !file.exists() ) return null; byte [] bytes; try { FileInputStream fis = new FileInputStream(file); DataInputStream dis = new DataInputStream( fis ); bytes = new byte [ (int)file.length() ]; dis.readFully( bytes ); dis.close(); } catch(IOException ie ) { throw new RuntimeException("Couldn't load file: "+file); } return bytes; }
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
public static void addMappingFeedback( MappingFeedback mf ) { if ( mappingFeedbackListener != null ) throw new RuntimeException("Unimplemented: already a listener"); mappingFeedbackListener = mf; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
public void run() { if(evalOnly) throw new RuntimeException("bsh Interpreter: No stream"); /* We'll print our banner using eval(String) in order to exercise the parser and get the basic expression classes loaded... This ameliorates the delay after typing the first statement. */ if ( interactive ) try { eval("printBanner();"); } catch ( EvalError e ) { println( "BeanShell "+VERSION+" - by Pat Niemeyer (pat@pat.net)"); } // init the callstack. CallStack callstack = new CallStack( globalNameSpace ); boolean eof = false; while( !eof ) { try { // try to sync up the console System.out.flush(); System.err.flush(); Thread.yield(); // this helps a little if ( interactive ) print( getBshPrompt() ); eof = Line(); if( get_jjtree().nodeArity() > 0 ) // number of child nodes { SimpleNode node = (SimpleNode)(get_jjtree().rootNode()); if(DEBUG) node.dump(">"); Object ret = node.eval( callstack, this ); // sanity check during development if ( callstack.depth() > 1 ) throw new InterpreterError( "Callstack growing: "+callstack); if(ret instanceof ReturnControl) ret = ((ReturnControl)ret).value; if( ret != Primitive.VOID ) { setu("$_", ret); if ( showResults ) println("<" + ret + ">"); } } } catch(ParseException e) { error("Parser Error: " + e.getMessage(DEBUG)); if ( DEBUG ) e.printStackTrace(); if(!interactive) eof = true; parser.reInitInput(in); } catch(InterpreterError e) { error("Internal Error: " + e.getMessage()); e.printStackTrace(); if(!interactive) eof = true; } catch(TargetError e) { error("// Uncaught Exception: " + e ); if ( e.inNativeCode() ) e.printStackTrace( DEBUG, err ); if(!interactive) eof = true; setu("$_e", e.getTarget()); } catch (EvalError e) { if ( interactive ) error( "EvalError: "+e.toString() ); else error( "EvalError: "+e.getMessage() ); if(DEBUG) e.printStackTrace(); if(!interactive) eof = true; } catch(Exception e) { error("Unknown error: " + e); if ( DEBUG ) e.printStackTrace(); if(!interactive) eof = true; } catch(TokenMgrError e) { error("Error parsing input: " + e); /* We get stuck in infinite loops here when unicode escapes fail. Must re-init the char stream reader (ASCII_UCodeESC_CharStream.java) */ parser.reInitTokenInput( in ); if(!interactive) eof = true; } finally { get_jjtree().reset(); // reinit the callstack if ( callstack.depth() > 1 ) { callstack.clear(); callstack.push( globalNameSpace ); } } } if ( interactive && exitOnEOF ) System.exit(0); }
// in org/gjt/sp/jedit/search/SearchAndReplace.java
private static int replaceInSelection(View view, TextArea textArea, Buffer buffer, SearchMatcher matcher, boolean smartCaseReplace, Selection s) throws Exception { /* if an occurence occurs at the beginning of the selection, the selection start will get moved. this sucks, so we hack to avoid it. */ int start = s.getStart(); int returnValue; if(s instanceof Selection.Range) { returnValue = _replace(view,buffer,matcher, s.getStart(),s.getEnd(), smartCaseReplace); textArea.removeFromSelection(s); textArea.addToSelection(new Selection.Range( start,s.getEnd())); } else if(s instanceof Selection.Rect) { Selection.Rect rect = (Selection.Rect)s; int startCol = rect.getStartColumn( buffer); int endCol = rect.getEndColumn( buffer); returnValue = 0; for(int j = s.getStartLine(); j <= s.getEndLine(); j++) { returnValue += _replace(view,buffer,matcher, getColumnOnOtherLine(buffer,j,startCol), getColumnOnOtherLine(buffer,j,endCol), smartCaseReplace); } textArea.addToSelection(new Selection.Rect( start,s.getEnd())); } else throw new RuntimeException("Unsupported: " + s); return returnValue; }
// in org/gjt/sp/jedit/search/HyperSearchResults.java
Override public void actionPerformed(ActionEvent evt) { JCheckBoxMenuItem menuItem = (JCheckBoxMenuItem) evt.getSource(); boolean curState = menuItem.isSelected(); TreePath path = resultTree.getSelectionPath(); DefaultMutableTreeNode operNode = (DefaultMutableTreeNode)path.getLastPathComponent(); HyperSearchOperationNode operNodeObj = (HyperSearchOperationNode)operNode.getUserObject(); if (curState) operNodeObj.cacheResultNodes(operNode); operNode.removeAllChildren(); if (curState) { Exception excp = null; try { operNodeObj.insertTreeNodes(resultTree, operNode); } catch (Exception ex) { operNodeObj.restoreFlatNodes(resultTree, operNode); menuItem.setSelected(false); excp = ex; } finally { ((DefaultTreeModel)resultTree.getModel()).nodeStructureChanged(operNode); expandAllNodes(operNode); resultTree.scrollPathToVisible( new TreePath(operNode.getPath())); } if (excp != null) throw new RuntimeException(excp); } else operNodeObj.restoreFlatNodes(resultTree, operNode); operNodeObj.setTreeViewDisplayed(menuItem.isSelected()); }
// in org/gjt/sp/jedit/jEdit.java
private static String fontStyleToString(int style) { if(style == 0) return "PLAIN"; else if(style == Font.BOLD) return "BOLD"; else if(style == Font.ITALIC) return "ITALIC"; else if(style == (Font.BOLD | Font.ITALIC)) return "BOLDITALIC"; else throw new RuntimeException("Invalid style: " + style); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public void insert(int offset, CharSequence seq) { if(seq == null) return; int len = seq.length(); if(len == 0) return; if(isReadOnly()) throw new RuntimeException("buffer read-only"); try { writeLock(); if(offset < 0 || offset > contentMgr.getLength()) throw new ArrayIndexOutOfBoundsException(offset); contentMgr.insert(offset,seq); integerArray.clear(); for(int i = 0; i < len; i++) { if(seq.charAt(i) == '\n') integerArray.add(i + 1); } if(!undoInProgress) { undoMgr.contentInserted(offset,len, seq.toString(),!dirty); } contentInserted(offset,len,integerArray); } finally { writeUnlock(); } }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
public void remove(int offset, int length) { if(length == 0) return; if(isReadOnly()) throw new RuntimeException("buffer read-only"); try { transaction = true; writeLock(); if(offset < 0 || length < 0 || offset + length > contentMgr.getLength()) throw new ArrayIndexOutOfBoundsException(offset + ":" + length); int startLine = lineMgr.getLineOfOffset(offset); int endLine = lineMgr.getLineOfOffset(offset + length); int numLines = endLine - startLine; if(!undoInProgress && !loading) { undoMgr.contentRemoved(offset,length, getText(offset,length), !dirty); } firePreContentRemoved(startLine,offset,numLines,length); contentMgr.remove(offset,length); lineMgr.contentRemoved(startLine,offset,numLines,length); positionMgr.contentRemoved(offset,length); setDirty(true); fireContentRemoved(startLine,offset,numLines,length); /* otherwise it will be delivered later */ if(!undoInProgress && !insideCompoundEdit()) fireTransactionComplete(); } finally { transaction = false; writeUnlock(); } }
// in org/gjt/sp/jedit/textarea/TextArea.java
public int replaceSelection(String selectedText) { if(!isEditable()) throw new RuntimeException("Text component read only"); int newCaret = -1; if(getSelectionCount() == 0) { // for compatibility with older jEdit versions buffer.insert(caret,selectedText); } else { try { buffer.beginCompoundEdit(); Selection[] selection = getSelection(); for(int i = 0; i < selection.length; i++) newCaret = selection[i].setText(buffer,selectedText); } finally { buffer.endCompoundEdit(); } } return newCaret; }
// in org/gjt/sp/jedit/PluginJAR.java
boolean containsClass(String className) { try { getZipFile(); } catch (IOException ioe) { throw new RuntimeException(ioe); } Enumeration<? extends ZipEntry> itr = zipFile.entries(); while (itr.hasMoreElements()) { String entry = itr.nextElement().toString(); if (entry.endsWith(".class")) { String name = entry.substring(0, entry.length() - 6).replace('/', '.'); if (name.equals(className)) return true; } } return false; }
2
            
// in org/gjt/sp/jedit/bsh/classpath/BshClassPath.java
catch(IOException ie ) { throw new RuntimeException("Couldn't load file: "+file); }
// in org/gjt/sp/jedit/PluginJAR.java
catch (IOException ioe) { throw new RuntimeException(ioe); }
0 0 0 0
unknown (Lib) SAXException 0 0 2
            
// in org/gjt/sp/jedit/pluginmgr/InstallPanel.java
Override public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { if ("plugin".equals(localName)) { pluginSet.add(attrs.getValue("jar")); } }
// in org/gjt/sp/jedit/pluginmgr/ManagePanel.java
Override public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { if (localName.equals("plugin")) { String jarName = attrs.getValue("jar"); String name = attrs.getValue("name"); selectedPlugins.add(name); jarNames.add(jarName); } }
2
            
// in org/gjt/sp/jedit/syntax/ModeProvider.java
catch (SAXException saxe) { Log.log(Log.ERROR, this, saxe); return; }
// in org/gjt/sp/util/XMLUtilities.java
catch(SAXException e) { Log.log(Log.ERROR,XMLUtilities.class,e); return true; }
0 0
unknown (Lib) SAXParseException 0 0 0 1
            
// in org/gjt/sp/util/XMLUtilities.java
catch(SAXParseException se) { int line = se.getLineNumber(); Log.log(Log.ERROR,XMLUtilities.class, "while parsing from " + in + ": SAXParseException: line " + line + ": " , se); return true; }
0 0
unknown (Lib) SecurityException 0 0 0 7
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching fields of: "+clas, e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching methods of: "+clas, e ); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( SecurityException e ) { }
// in org/gjt/sp/jedit/bsh/Capabilities.java
catch ( SecurityException e ) { throw new Unavailable("Accessibility unavailable: "+e); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( SecurityException e ) { // applets can't see sys props setu( "bsh.cwd", "." ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( SecurityException e ) { System.err.println("Could not init static:"+e); }
// in org/gjt/sp/jedit/jEdit.java
catch(SecurityException se) { Log.log(Log.ERROR,jEdit.class,se); }
3
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching fields of: "+clas, e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching methods of: "+clas, e ); }
// in org/gjt/sp/jedit/bsh/Capabilities.java
catch ( SecurityException e ) { throw new Unavailable("Accessibility unavailable: "+e); }
0
checked (Domain) TargetError
public class TargetError extends EvalError 
{
	Throwable target;
	boolean inNativeCode;

	public TargetError(
		String msg, Throwable t, SimpleNode node, CallStack callstack, 
		boolean inNativeCode )
	{
		super( msg, node, callstack );
		target = t;
		this.inNativeCode = inNativeCode;
	}

	public TargetError( Throwable t, SimpleNode node, CallStack callstack )
	{
		this("TargetError", t, node, callstack, false);
	}

	public Throwable getTarget()
	{
		// check for easy mistake
		if(target instanceof InvocationTargetException)
			return((InvocationTargetException)target).getTargetException();
		else
			return target;
	}

	public String toString() 
	{
		return super.toString() 
			+ "\nTarget exception: " + 
			printTargetError( target );
	}

    public void printStackTrace() { 
		printStackTrace( false, System.err );
	}

    public void printStackTrace( PrintStream out ) { 
		printStackTrace( false, out );
	}

    public void printStackTrace( boolean debug, PrintStream out ) {
		if ( debug ) {
			super.printStackTrace( out );
			out.println("--- Target Stack Trace ---");
		}
		target.printStackTrace( out );
	}

	/**
		Generate a printable string showing the wrapped target exception.
		If the proxy mechanism is available, allow the extended print to
		check for UndeclaredThrowableException and print that embedded error.
	*/
	public String printTargetError( Throwable t ) 
	{
		String s = target.toString();

		if ( Capabilities.canGenerateInterfaces() )
			s += "\n" + xPrintTargetError( t );

		return s;
	}

	/**
		Extended form of print target error.
		This indirection is used to print UndeclaredThrowableExceptions 
		which are possible when the proxy mechanism is available.

		We are shielded from compile problems by using a bsh script.
		This is acceptable here because we're not in a critical path...
		Otherwise we'd need yet another dynamically loaded module just for this.
	*/
	public String xPrintTargetError( Throwable t ) 
	{
		String getTarget =
			"import java.lang.reflect.UndeclaredThrowableException;"+
			"String result=\"\";"+
			"while ( target instanceof UndeclaredThrowableException ) {"+
			"	target=target.getUndeclaredThrowable(); " +
			"	result+=\"Nested: \"+target.toString();" +
			"}"+
			"return result;";
		Interpreter i = new Interpreter();
		try {
			i.set("target", t);
			return (String)i.eval( getTarget );
		} catch ( EvalError e ) {
			throw new InterpreterError("xprintarget: "+e.toString() );
		}
	}

	/**
		Return true if the TargetError was generated from native code.
		e.g. if the script called into a compiled java class which threw
		the excpetion.  We distinguish so that we can print the stack trace
		for the native code case... the stack trace would not be useful if
		the exception was generated by the script.  e.g. if the script
		explicitly threw an exception... (the stack trace would simply point
		to the bsh internals which generated the exception).
	*/
	public boolean inNativeCode() { 
		return inNativeCode; 
	}
}
7
            
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
public Object doSuffix( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError { // Handle ".class" suffix operation // Prefix must be a BSHType if ( operation == CLASS ) if ( obj instanceof BSHType ) { if ( toLHS ) throw new EvalError("Can't assign .class", this, callstack ); NameSpace namespace = callstack.top(); return ((BSHType)obj).getType( callstack, interpreter ); } else throw new EvalError( "Attempt to use .class suffix on non class.", this, callstack ); /* Evaluate our prefix if it needs evaluating first. If this is the first evaluation our prefix mayb be a Node (directly from the PrimaryPrefix) - eval() it to an object. If it's an LHS, resolve to a value. Note: The ambiguous name construct is now necessary where the node may be an ambiguous name. If this becomes common we might want to make a static method nodeToObject() or something. The point is that we can't just eval() - we need to direct the evaluation to the context sensitive type of result; namely object, class, etc. */ if ( obj instanceof SimpleNode ) if ( obj instanceof BSHAmbiguousName ) obj = ((BSHAmbiguousName)obj).toObject(callstack, interpreter); else obj = ((SimpleNode)obj).eval(callstack, interpreter); else if ( obj instanceof LHS ) try { obj = ((LHS)obj).getValue(); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } try { switch(operation) { case INDEX: return doIndex( obj, toLHS, callstack, interpreter ); case NAME: return doName( obj, toLHS, callstack, interpreter ); case PROPERTY: return doProperty( toLHS, obj, callstack, interpreter ); default: throw new InterpreterError( "Unknown suffix type" ); } } catch(ReflectError e) { throw new EvalError("reflection error: " + e, this, callstack ); } catch(InvocationTargetException e) { throw new TargetError( "target exception", e.getTargetException(), this, callstack, true); } }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
private Object doName( Object obj, boolean toLHS, CallStack callstack, Interpreter interpreter) throws EvalError, ReflectError, InvocationTargetException { try { // .length on array if ( field.equals("length") && obj.getClass().isArray() ) if ( toLHS ) throw new EvalError( "Can't assign array length", this, callstack ); else return new Primitive(Array.getLength(obj)); // field access if ( jjtGetNumChildren() == 0 ) if ( toLHS ) return Reflect.getLHSObjectField(obj, field); else return Reflect.getObjectFieldValue( obj, field ); // Method invocation // (LHS or non LHS evaluation can both encounter method calls) Object[] oa = ((BSHArguments)jjtGetChild(0)).getArguments( callstack, interpreter); // TODO: // Note: this try/catch block is copied from BSHMethodInvocation // we need to factor out this common functionality and make sure // we handle all cases ... (e.g. property style access, etc.) // maybe move this to Reflect ? try { return Reflect.invokeObjectMethod( obj, field, oa, interpreter, callstack, this ); } catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); } catch ( InvocationTargetException e ) { String msg = "Method Invocation "+field; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); } } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
// in org/gjt/sp/jedit/bsh/BshMethod.java
Object invoke( Object[] argValues, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean overrideNameSpace ) throws EvalError { if ( argValues != null ) for (int i=0; i<argValues.length; i++) if ( argValues[i] == null ) throw new Error("HERE!"); if ( javaMethod != null ) try { return Reflect.invokeMethod( javaMethod, javaObject, argValues ); } catch ( ReflectError e ) { throw new EvalError( "Error invoking Java method: "+e, callerInfo, callstack ); } catch ( InvocationTargetException e2 ) { throw new TargetError( "Exception invoking imported object method.", e2, callerInfo, callstack, true/*isNative*/ ); } // is this a syncrhonized method? if ( modifiers != null && modifiers.hasModifier("synchronized") ) { // The lock is our declaring namespace's This reference // (the method's 'super'). Or in the case of a class it's the // class instance. Object lock; if ( declaringNameSpace.isClass ) { try { lock = declaringNameSpace.getClassInstance(); } catch ( UtilEvalError e ) { throw new InterpreterError( "Can't get class instance for synchronized method."); } } else lock = declaringNameSpace.getThis(interpreter); // ??? synchronized( lock ) { return invokeImpl( argValues, interpreter, callstack, callerInfo, overrideNameSpace ); } } else return invokeImpl( argValues, interpreter, callstack, callerInfo, overrideNameSpace ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object constructObject( Class type, Object[] args, CallStack callstack ) throws EvalError { Object obj; try { obj = Reflect.constructObject( type, args ); } catch ( ReflectError e) { throw new EvalError( "Constructor error: " + e.getMessage(), this, callstack ); } catch(InvocationTargetException e) { // No need to wrap this debug Interpreter.debug("The constructor threw an exception:\n\t" + e.getTargetException()); throw new TargetError( "Object constructor", e.getTargetException(), this, callstack, true); } String className = type.getName(); // Is it an inner class? if ( className.indexOf("$") == -1 ) return obj; // Temporary hack to support inner classes // If the obj is a non-static inner class then import the context... // This is not a sufficient emulation of inner classes. // Replace this later... // work through to class 'this' This ths = callstack.top().getThis( null ); NameSpace instanceNameSpace = Name.getClassNameSpace( ths.getNameSpace() ); // Change the parent (which was the class static) to the class instance // We really need to check if we're a static inner class here first... // but for some reason Java won't show the static modifier on our // fake inner classes... could generate a flag field. if ( instanceNameSpace != null && className.startsWith( instanceNameSpace.getName() +"$") ) { try { ClassGenerator.getClassGenerator().setInstanceNameSpaceParent( obj, className, instanceNameSpace ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } } return obj; }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
private Object arrayNewInstance( Class type, BSHArrayDimensions dimensionsNode, CallStack callstack ) throws EvalError { if ( dimensionsNode.numUndefinedDims > 0 ) { Object proto = Array.newInstance( type, new int [dimensionsNode.numUndefinedDims] ); // zeros type = proto.getClass(); } try { return Array.newInstance( type, dimensionsNode.definedDimensions); } catch( NegativeArraySizeException e1 ) { throw new TargetError( e1, this, callstack ); } catch( Exception e ) { throw new EvalError("Can't construct primitive array: " + e.getMessage(), this, callstack); } }
// in org/gjt/sp/jedit/bsh/BSHThrowStatement.java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { Object obj = ((SimpleNode)jjtGetChild(0)).eval(callstack, interpreter); // need to loosen this to any throwable... do we need to handle // that in interpreter somewhere? check first... if(!(obj instanceof Exception)) throw new EvalError("Expression in 'throw' must be Exception type", this, callstack ); // wrap the exception in a TargetException to propogate it up throw new TargetError( (Exception)obj, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { NameSpace namespace = callstack.top(); BSHAmbiguousName nameNode = getNameNode(); // Do not evaluate methods this() or super() in class instance space // (i.e. inside a constructor) if ( namespace.getParent() != null && namespace.getParent().isClass && ( nameNode.text.equals("super") || nameNode.text.equals("this") ) ) return Primitive.VOID; Name name = nameNode.getName(namespace); Object[] args = getArgsNode().getArguments(callstack, interpreter); // This try/catch block is replicated is BSHPrimarySuffix... need to // factor out common functionality... // Move to Reflect? try { return name.invokeMethod( interpreter, args, callstack, this); } catch ( ReflectError e ) { throw new EvalError( "Error in method invocation: " + e.getMessage(), this, callstack ); } catch ( InvocationTargetException e ) { String msg = "Method Invocation "+name; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
6
            
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch(InvocationTargetException e) { throw new TargetError( "target exception", e.getTargetException(), this, callstack, true); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( InvocationTargetException e ) { String msg = "Method Invocation "+field; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( InvocationTargetException e2 ) { throw new TargetError( "Exception invoking imported object method.", e2, callerInfo, callstack, true/*isNative*/ ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch(InvocationTargetException e) { // No need to wrap this debug Interpreter.debug("The constructor threw an exception:\n\t" + e.getTargetException()); throw new TargetError( "Object constructor", e.getTargetException(), this, callstack, true); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch( NegativeArraySizeException e1 ) { throw new TargetError( e1, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( InvocationTargetException e ) { String msg = "Method Invocation "+name; Throwable te = e.getTargetException(); /* Try to squeltch the native code stack trace if the exception was caused by a reflective call back into the bsh interpreter (e.g. eval() or source() */ boolean isNative = true; if ( te instanceof EvalError ) if ( te instanceof TargetError ) isNative = ((TargetError)te).inNativeCode(); else isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); }
0 5
            
// in org/gjt/sp/jedit/bsh/XThis.java
catch ( TargetError te ) { // Unwrap target exception. If the interface declares that // it throws the ex it will be delivered. If not it will be // wrapped in an UndeclaredThrowable throw te.getTarget(); }
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
catch( TargetError e ) { target = e; String stackInfo = "Bsh Stack: "; while ( callstack.depth() > callstackDepth ) stackInfo += "\t" + callstack.pop() +"\n"; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( TargetError e ) { System.out.println("Script threw exception: "+e); if ( e.inNativeCode() ) e.printStackTrace( DEBUG, System.err ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(TargetError e) { error("// Uncaught Exception: " + e ); if ( e.inNativeCode() ) e.printStackTrace( DEBUG, err ); if(!interactive) eof = true; setu("$_e", e.getTarget()); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( TargetError e ) { // failsafe, set the Line as the origin of the error. if ( e.getNode()==null ) e.setNode( node ); e.reThrow("Sourced file: "+sourceFileInfo); }
1
            
// in org/gjt/sp/jedit/bsh/XThis.java
catch ( TargetError te ) { // Unwrap target exception. If the interface declares that // it throws the ex it will be delivered. If not it will be // wrapped in an UndeclaredThrowable throw te.getTarget(); }
0
checked (Domain) TextAreaException
public class TextAreaException extends Exception
{
	public TextAreaException(String msg)
	{
		super(msg);
	}
}
2
            
// in org/gjt/sp/jedit/textarea/TextArea.java
public void addExplicitFold() throws TextAreaException { if(!buffer.isEditable()) { getToolkit().beep(); return; } if(!"explicit".equals(buffer.getStringProperty("folding"))) { throw new TextAreaException("folding-not-explicit"); } try { buffer.beginCompoundEdit(); if (getSelectionCount() == 0) { int caretBack = addExplicitFold(caret, caret, caretLine, caretLine); setCaretPosition(caret - caretBack); } else { Selection[] selections = getSelection(); Selection selection = null; int caretBack = 0; for (int i = 0; i < selections.length; i++) { selection = selections[i]; caretBack = addExplicitFold(selection.start, selection.end, selection.startLine,selection.endLine); } // Selection cannot be null because there is at least 1 selection assert selection != null; setCaretPosition(selection.start - caretBack, false); } } finally { buffer.endCompoundEdit(); } }
// in org/gjt/sp/jedit/textarea/TextArea.java
public void formatParagraph() throws TextAreaException { if(!buffer.isEditable()) { getToolkit().beep(); return; } if(maxLineLen <= 0) { throw new TextAreaException("format-maxlinelen"); } Selection[] selection = getSelection(); if(selection.length != 0) { buffer.beginCompoundEdit(); for(int i = 0; i < selection.length; i++) { Selection s = selection[i]; setSelectedText(s,TextUtilities.format( getSelectedText(s),maxLineLen, buffer.getTabSize())); } buffer.endCompoundEdit(); } else { int lineNo = getCaretLine(); int start = 0, end = buffer.getLength(); for(int i = lineNo - 1; i >= 0; i--) { if (lineContainsSpaceAndTabs(i)) { start = getLineEndOffset(i); break; } } for(int i = lineNo + 1; i < getLineCount(); i++) { if (lineContainsSpaceAndTabs(i)) { end = getLineStartOffset(i) - 1; break; } } try { buffer.beginCompoundEdit(); String text = buffer.getText(start,end - start); int offset = getCaretPosition() - start; int noSpaceOffset = TextUtilities.indexIgnoringWhitespace( text,offset); buffer.remove(start,end - start); text = TextUtilities.format( text,maxLineLen,buffer.getTabSize()); buffer.insert(start,text); int caretPos = start; if (text.length() != 0) { caretPos += Math.min(text.length(), TextUtilities.ignoringWhitespaceIndex( text,noSpaceOffset)); } moveCaretPosition(caretPos); } finally { buffer.endCompoundEdit(); } } }
0 2
            
// in org/gjt/sp/jedit/textarea/TextArea.java
public void addExplicitFold() throws TextAreaException { if(!buffer.isEditable()) { getToolkit().beep(); return; } if(!"explicit".equals(buffer.getStringProperty("folding"))) { throw new TextAreaException("folding-not-explicit"); } try { buffer.beginCompoundEdit(); if (getSelectionCount() == 0) { int caretBack = addExplicitFold(caret, caret, caretLine, caretLine); setCaretPosition(caret - caretBack); } else { Selection[] selections = getSelection(); Selection selection = null; int caretBack = 0; for (int i = 0; i < selections.length; i++) { selection = selections[i]; caretBack = addExplicitFold(selection.start, selection.end, selection.startLine,selection.endLine); } // Selection cannot be null because there is at least 1 selection assert selection != null; setCaretPosition(selection.start - caretBack, false); } } finally { buffer.endCompoundEdit(); } }
// in org/gjt/sp/jedit/textarea/TextArea.java
public void formatParagraph() throws TextAreaException { if(!buffer.isEditable()) { getToolkit().beep(); return; } if(maxLineLen <= 0) { throw new TextAreaException("format-maxlinelen"); } Selection[] selection = getSelection(); if(selection.length != 0) { buffer.beginCompoundEdit(); for(int i = 0; i < selection.length; i++) { Selection s = selection[i]; setSelectedText(s,TextUtilities.format( getSelectedText(s),maxLineLen, buffer.getTabSize())); } buffer.endCompoundEdit(); } else { int lineNo = getCaretLine(); int start = 0, end = buffer.getLength(); for(int i = lineNo - 1; i >= 0; i--) { if (lineContainsSpaceAndTabs(i)) { start = getLineEndOffset(i); break; } } for(int i = lineNo + 1; i < getLineCount(); i++) { if (lineContainsSpaceAndTabs(i)) { end = getLineStartOffset(i) - 1; break; } } try { buffer.beginCompoundEdit(); String text = buffer.getText(start,end - start); int offset = getCaretPosition() - start; int noSpaceOffset = TextUtilities.indexIgnoringWhitespace( text,offset); buffer.remove(start,end - start); text = TextUtilities.format( text,maxLineLen,buffer.getTabSize()); buffer.insert(start,text); int caretPos = start; if (text.length() != 0) { caretPos += Math.min(text.length(), TextUtilities.ignoringWhitespaceIndex( text,noSpaceOffset)); } moveCaretPosition(caretPos); } finally { buffer.endCompoundEdit(); } } }
2
            
// in org/gjt/sp/jedit/textarea/JEditTextArea.java
catch (TextAreaException e) { GUIUtilities.error(view,"folding-not-explicit",null); }
// in org/gjt/sp/jedit/textarea/JEditTextArea.java
catch (TextAreaException e) { GUIUtilities.error(view,"format-maxlinelen",null); }
0 0
checked (Lib) Throwable 0 0 1
            
// in org/gjt/sp/jedit/bsh/XThis.java
public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { try { return invokeImpl( proxy, method, args ); } catch ( TargetError te ) { // Unwrap target exception. If the interface declares that // it throws the ex it will be delivered. If not it will be // wrapped in an UndeclaredThrowable throw te.getTarget(); } catch ( EvalError ee ) { // Ease debugging... // XThis.this refers to the enclosing class instance if ( Interpreter.DEBUG ) Interpreter.debug( "EvalError in scripted interface: " + XThis.this.toString() + ": "+ ee ); throw ee; } }
79
            
// in org/jedit/options/OptionGroupPane.java
catch (Throwable t) { Log.log(Log.ERROR, this, "Error initializing option pane:"); Log.log(Log.ERROR, this, t); }
// in org/jedit/options/OptionGroupPane.java
catch (Throwable t) { Log.log(Log.ERROR, this, "Error saving options:"); Log.log(Log.ERROR, this, t); }
// in org/gjt/sp/jedit/gui/OptionsDialog.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Error initializing options:", t); }
// in org/gjt/sp/jedit/gui/OptionsDialog.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Error saving options:", t); }
// in org/gjt/sp/jedit/help/HelpIndex.java
catch(Throwable e) { Log.log(Log.ERROR,this,"Error indexing editor help"); Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/help/HelpIndex.java
catch(Throwable e) { Log.log(Log.ERROR,this,"Error indexing JAR: " + jars[i].getPath()); Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch (Throwable t) { throw new Error(t.getMessage()); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( Throwable e ) { System.err.println("Could not init static(3):"+e); }
// in org/gjt/sp/jedit/EditBus.java
catch(Throwable t) { Log.log(Log.ERROR,EditBus.class,"Exception" + " while sending message on EditBus:"); Log.log(Log.ERROR,EditBus.class,t); }
// in org/gjt/sp/jedit/BeanShellFacade.java
catch(Throwable e) { Log.log(Log.ERROR,BeanShellFacade.class,e); handleException(param,null,e); }
// in org/gjt/sp/jedit/io/FileVFS.java
catch (Throwable t) { }
// in org/gjt/sp/jedit/io/FileVFS.java
catch (Throwable t) { }
// in org/gjt/sp/jedit/Buffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer undo event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/Buffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer undo event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/Buffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer begin redo event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/Buffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer end redo event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/buffer/JEditBuffer.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Exception while sending buffer event to "+ listener +" :"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/BeanShell.java
catch(Throwable e) { Log.log(Log.ERROR,BeanShell.class,e); bsh.handleException(view,null,e); }
// in org/gjt/sp/jedit/BeanShell.java
catch(Throwable e) { Log.log(Log.ERROR,BeanShell.class,e); bsh.handleException(view,path,e); }
// in org/gjt/sp/jedit/BeanShell.java
catch(Throwable e) { Log.log(Log.ERROR,BeanShell.class,e); bsh.handleException(view,path,e); }
// in org/gjt/sp/jedit/JEditBeanShellAction.java
catch(Throwable e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/JEditBeanShellAction.java
catch(Throwable e) { Log.log(Log.ERROR,this,e); // dialogs fuck things up if a menu is visible, etc! //new BeanShellErrorDialog(view,e); // so that in the future we don't see streams of // exceptions isSelected = null; return false; }
// in org/gjt/sp/jedit/textarea/ExtensionManager.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); // remove it so editor can continue // functioning iter.remove(); }
// in org/gjt/sp/jedit/textarea/TextArea.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/textarea/TextArea.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/textarea/TextArea.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/textarea/TextArea.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/textarea/TextArea.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/menu/EnhancedCheckBoxMenuItem.java
catch(Throwable t) { Log.log(Log.ERROR,this,t); return false; }
// in org/gjt/sp/jedit/BeanShellAction.java
catch(Throwable e) { Log.log(Log.ERROR,this,e); new BeanShellErrorDialog(view,e); }
// in org/gjt/sp/jedit/BeanShellAction.java
catch(Throwable e) { Log.log(Log.ERROR,this,e); // dialogs fuck things up if a menu is visible, etc! //new BeanShellErrorDialog(view,e); // so that in the future we don't see streams of // exceptions isSelected = null; return false; }
// in org/gjt/sp/jedit/syntax/ModeProvider.java
catch (Throwable e) { error(fileName, e); }
// in org/gjt/sp/jedit/PluginJAR.java
catch (Throwable t) { breakPlugin(); Log.log(Log.ERROR,this,"Error while starting plugin " + className); Log.log(Log.ERROR,this,t); String[] args = { t.toString() }; jEdit.pluginError(path,"plugin-error.start-error",args); return; }
// in org/gjt/sp/jedit/PluginJAR.java
catch(Throwable t) { Log.log(Log.ERROR,this,"Error while " + "stopping plugin:"); Log.log(Log.ERROR,this,t); }
// in org/gjt/sp/jedit/PluginJAR.java
catch(Throwable t) { breakPlugin(); Log.log(Log.ERROR,PluginJAR.this, "Error while starting plugin " + plugin.getClassName()); Log.log(Log.ERROR,PluginJAR.this,t); String[] args = { t.toString() }; jEdit.pluginError(path, "plugin-error.start-error",args); }
// in org/gjt/sp/util/WorkThreadPool.java
catch(Throwable t) { Log.log(Log.ERROR,WorkThread.class,"Exception " + "in AWT thread:"); Log.log(Log.ERROR,WorkThread.class,t); }
// in org/gjt/sp/util/Task.java
catch (Throwable t) { Log.log(Log.ERROR, this, t); }
// in org/gjt/sp/util/WorkThread.java
catch(Throwable t) { Log.log(Log.ERROR,WorkThread.class,"Exception in work thread: ", t); }
103
            
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/Parser.java
catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} }
// in org/gjt/sp/jedit/bsh/JavaCharStream.java
catch (Throwable t) { throw new Error(t.getMessage()); }
1
runtime (Domain) TokenMgrError
public class TokenMgrError extends Error
{
   /*
    * Ordinals for various reasons why an Error of this type can be thrown.
    */

   /**
    * Lexical error occured.
    */
   static final int LEXICAL_ERROR = 0;

   /**
    * An attempt wass made to create a second instance of a static token manager.
    */
   static final int STATIC_LEXER_ERROR = 1;

   /**
    * Tried to change to an invalid lexical state.
    */
   static final int INVALID_LEXICAL_STATE = 2;

   /**
    * Detected (and bailed out of) an infinite loop in the token manager.
    */
   static final int LOOP_DETECTED = 3;

   /**
    * Indicates the reason why the exception is thrown. It will have
    * one of the above 4 values.
    */
   int errorCode;

   /**
    * Replaces unprintable characters by their espaced (or unicode escaped)
    * equivalents in the given string
    */
   protected static final String addEscapes(String str) {
	  StringBuilder retval = new StringBuilder();
      char ch;
      for (int i = 0; i < str.length(); i++) {
        switch (str.charAt(i))
        {
           case 0 :
              continue;
           case '\b':
              retval.append("\\b");
              continue;
           case '\t':
              retval.append("\\t");
              continue;
           case '\n':
              retval.append("\\n");
              continue;
           case '\f':
              retval.append("\\f");
              continue;
           case '\r':
              retval.append("\\r");
              continue;
           case '\"':
              retval.append("\\\"");
              continue;
           case '\'':
              retval.append("\\\'");
              continue;
           case '\\':
              retval.append("\\\\");
              continue;
           default:
              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
                 String s = "0000" + Integer.toString(ch, 16);
                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
              } else {
                 retval.append(ch);
              }
              continue;
        }
      }
      return retval.toString();
   }

   /**
    * Returns a detailed message for the Error when it is thrown by the
    * token manager to indicate a lexical error.
    * Parameters : 
    *    EOFSeen     : indicates if EOF caused the lexicl error
    *    curLexState : lexical state in which this error occured
    *    errorLine   : line number when the error occured
    *    errorColumn : column number when the error occured
    *    errorAfter  : prefix that was seen before this error occured
    *    curchar     : the offending character
    * Note: You can customize the lexical error message by modifying this method.
    */
   protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
      return("Lexical error at line " +
           errorLine + ", column " +
           errorColumn + ".  Encountered: " +
           (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
           "after : \"" + addEscapes(errorAfter) + "\"");
   }

   /**
    * You can also modify the body of this method to customize your error messages.
    * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
    * of end-users concern, so you can return something like : 
    *
    *     "Internal Error : Please file a bug report .... "
    *
    * from this method for such cases in the release version of your parser.
    */
   public String getMessage() {
      return super.getMessage();
   }

   /*
    * Constructors of various flavors follow.
    */

   public TokenMgrError() {
   }

   public TokenMgrError(String message, int reason) {
      super(message);
      errorCode = reason;
   }

   public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
      this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
   }
}
2
            
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
public void SwitchTo(int lexState) { if (lexState >= 1 || lexState < 0) throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); else curLexState = lexState; }
// in org/gjt/sp/jedit/bsh/ParserTokenManager.java
public Token getNextToken() { int kind; Token specialToken = null; Token matchedToken; int curPos = 0; EOFLoop : for (;;) { try { curChar = input_stream.BeginToken(); } catch(java.io.IOException e) { jjmatchedKind = 0; matchedToken = jjFillToken(); matchedToken.specialToken = specialToken; return matchedToken; } jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_0(); if (jjmatchedKind != 0x7fffffff) { if (jjmatchedPos + 1 < curPos) input_stream.backup(curPos - jjmatchedPos - 1); if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { matchedToken = jjFillToken(); matchedToken.specialToken = specialToken; return matchedToken; } else { if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { matchedToken = jjFillToken(); if (specialToken == null) specialToken = matchedToken; else { matchedToken.specialToken = specialToken; specialToken = (specialToken.next = matchedToken); } } continue EOFLoop; } } int error_line = input_stream.getEndLine(); int error_column = input_stream.getEndColumn(); String error_after = null; boolean EOFSeen = false; try { input_stream.readChar(); input_stream.backup(1); } catch (java.io.IOException e1) { EOFSeen = true; error_after = curPos <= 1 ? "" : input_stream.GetImage(); if (curChar == '\n' || curChar == '\r') { error_line++; error_column = 0; } else error_column++; } if (!EOFSeen) { input_stream.backup(1); error_after = curPos <= 1 ? "" : input_stream.GetImage(); } throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); } }
0 0 2
            
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(TokenMgrError e) { error("Error parsing input: " + e); /* We get stuck in infinite loops here when unicode escapes fail. Must re-init the char stream reader (ASCII_UCodeESC_CharStream.java) */ parser.reInitTokenInput( in ); if(!interactive) eof = true; }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(TokenMgrError e) { throw new EvalError( "Sourced file: "+sourceFileInfo+" Token Parsing Error: " + e.getMessage(), node, callstack ); }
1
            
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch(TokenMgrError e) { throw new EvalError( "Sourced file: "+sourceFileInfo+" Token Parsing Error: " + e.getMessage(), node, callstack ); }
0
unknown (Lib) TooManyListenersException 0 0 0 1
            
// in org/gjt/sp/jedit/textarea/TextArea.java
catch(TooManyListenersException e) { Log.log(Log.ERROR,this,e); }
0 0
checked (Domain) Unavailable
public static class Unavailable extends UtilEvalError
	{
		public Unavailable(String s ){ super(s); }
	}
4
            
// in org/gjt/sp/jedit/bsh/ClassGenerator.java
public static ClassGenerator getClassGenerator() throws UtilEvalError { if ( cg == null ) { try { Class clas = Class.forName( "org.gjt.sp.jedit.bsh.ClassGeneratorImpl" ); cg = (ClassGenerator)clas.newInstance(); } catch ( Exception e ) { throw new Unavailable("ClassGenerator unavailable: "+e); } } return cg; }
// in org/gjt/sp/jedit/bsh/ReflectManager.java
public static ReflectManager getReflectManager() throws Unavailable { if ( rfm == null ) { Class clas; try { clas = Class.forName( "org.gjt.sp.jedit.bsh.reflect.ReflectManagerImpl" ); rfm = (ReflectManager)clas.newInstance(); } catch ( Exception e ) { throw new Unavailable("Reflect Manager unavailable: "+e); } } return rfm; }
// in org/gjt/sp/jedit/bsh/Capabilities.java
public static void setAccessibility( boolean b ) throws Unavailable { if ( b == false ) { accessibility = false; return; } if ( !classExists( "java.lang.reflect.AccessibleObject" ) || !classExists("org.gjt.sp.jedit.bsh.reflect.ReflectManagerImpl") ) throw new Unavailable( "Accessibility unavailable" ); // test basic access try { String.class.getDeclaredMethods(); } catch ( SecurityException e ) { throw new Unavailable("Accessibility unavailable: "+e); } accessibility = true; }
3
            
// in org/gjt/sp/jedit/bsh/ClassGenerator.java
catch ( Exception e ) { throw new Unavailable("ClassGenerator unavailable: "+e); }
// in org/gjt/sp/jedit/bsh/ReflectManager.java
catch ( Exception e ) { throw new Unavailable("Reflect Manager unavailable: "+e); }
// in org/gjt/sp/jedit/bsh/Capabilities.java
catch ( SecurityException e ) { throw new Unavailable("Accessibility unavailable: "+e); }
3
            
// in org/gjt/sp/jedit/bsh/ReflectManager.java
public static ReflectManager getReflectManager() throws Unavailable { if ( rfm == null ) { Class clas; try { clas = Class.forName( "org.gjt.sp.jedit.bsh.reflect.ReflectManagerImpl" ); rfm = (ReflectManager)clas.newInstance(); } catch ( Exception e ) { throw new Unavailable("Reflect Manager unavailable: "+e); } } return rfm; }
// in org/gjt/sp/jedit/bsh/ReflectManager.java
public static boolean RMSetAccessible( Object obj ) throws Unavailable { return getReflectManager().setAccessible( obj ); }
// in org/gjt/sp/jedit/bsh/Capabilities.java
public static void setAccessibility( boolean b ) throws Unavailable { if ( b == false ) { accessibility = false; return; } if ( !classExists( "java.lang.reflect.AccessibleObject" ) || !classExists("org.gjt.sp.jedit.bsh.reflect.ReflectManagerImpl") ) throw new Unavailable( "Accessibility unavailable" ); // test basic access try { String.class.getDeclaredMethods(); } catch ( SecurityException e ) { throw new Unavailable("Accessibility unavailable: "+e); } accessibility = true; }
1
            
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( Capabilities.Unavailable e ) { throw new EvalError( "Defining classes currently requires reflective Accessibility.", block, callstack ); }
1
            
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( Capabilities.Unavailable e ) { throw new EvalError( "Defining classes currently requires reflective Accessibility.", block, callstack ); }
0
unknown (Lib) UnknownHostException 0 0 0 1
            
// in org/gjt/sp/jedit/pluginmgr/PluginList.java
catch(java.net.UnknownHostException e) { GUIUtilities.error(jEdit.getActiveView() , "plugin-manager.list-download.disconnected" , new Object[]{e.getMessage()}); Log.log (Log.ERROR, this, "CacheRemotePluginList: error", e); }
0 0
unknown (Lib) UnsupportedCharsetException 2
            
// in org/gjt/sp/jedit/io/EncodingServer.java
public static Encoding getEncoding(String name) { try { return new CharsetEncoding(name); } catch (IllegalCharsetNameException e) { // just failed } catch (UnsupportedCharsetException e) { // just failed } Object namedService = ServiceManager.getService(serviceClass, name); if (namedService != null && namedService instanceof Encoding) { return (Encoding)namedService; } // UnsupportedCharsetException is for java.nio.charset, // but throw this here too so that this can be caught as // an encoding error by catch clause for general I/O code. throw new UnsupportedCharsetException("No such encoding: \"" + name + "\""); }
0 0 3
            
// in org/gjt/sp/jedit/io/EncodingServer.java
catch (UnsupportedCharsetException e) { // just failed }
// in org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
catch(UnsupportedCharsetException e) { Log.log(Log.ERROR, this, e, e); String[] pp = { e.getCharsetName() }; VFSManager.error(view,path,"ioerror.unsupported-encoding-error",pp); buffer.setBooleanProperty(ERROR_OCCURRED,true); }
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(UnsupportedCharsetException e) { encodingError = e; }
0 0
unknown (Lib) UnsupportedEncodingException 0 0 0 1
            
// in org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
catch(UnsupportedEncodingException e) { encodingError = e; }
0 0
unknown (Lib) UnsupportedFlavorException 3
            
// in org/gjt/sp/jedit/datatransfer/ListVFSFileTransferable.java
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (jEditFileList.equals(flavor)) { return files; } else if (DataFlavor.stringFlavor.equals(flavor)) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < files.size(); i++) { VFSFile vfsFile = files.get(i); if (i != 0) builder.append('\n'); builder.append(vfsFile.getPath()); } return builder.toString(); } else if (DataFlavor.javaFileListFlavor.equals(flavor)) { List<File> files = new ArrayList<File>(this.files.size()); for (VFSFile file : this.files) { if (file.getVFS() instanceof FileVFS) files.add(new File(file.getPath())); } return files; } throw new UnsupportedFlavorException(flavor); }
// in org/gjt/sp/jedit/datatransfer/RichTextTransferable.java
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (!isDataFlavorSupported(flavor)) throw new UnsupportedFlavorException(flavor); return new JEditRichText(text, mode); }
// in org/gjt/sp/jedit/datatransfer/JEditTransferable.java
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (!isDataFlavorSupported(flavor)) throw new UnsupportedFlavorException(flavor); Transferable transferable = flavors.get(flavor); return transferable.getTransferData(flavor); }
0 5
            
// in org/gjt/sp/jedit/gui/PingPongList.java
Override public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { return data; }
// in org/gjt/sp/jedit/datatransfer/ListVFSFileTransferable.java
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (jEditFileList.equals(flavor)) { return files; } else if (DataFlavor.stringFlavor.equals(flavor)) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < files.size(); i++) { VFSFile vfsFile = files.get(i); if (i != 0) builder.append('\n'); builder.append(vfsFile.getPath()); } return builder.toString(); } else if (DataFlavor.javaFileListFlavor.equals(flavor)) { List<File> files = new ArrayList<File>(this.files.size()); for (VFSFile file : this.files) { if (file.getVFS() instanceof FileVFS) files.add(new File(file.getPath())); } return files; } throw new UnsupportedFlavorException(flavor); }
// in org/gjt/sp/jedit/datatransfer/RichTextTransferable.java
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (!isDataFlavorSupported(flavor)) throw new UnsupportedFlavorException(flavor); return new JEditRichText(text, mode); }
// in org/gjt/sp/jedit/datatransfer/JEditTransferable.java
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (!isDataFlavorSupported(flavor)) throw new UnsupportedFlavorException(flavor); Transferable transferable = flavors.get(flavor); return transferable.getTransferData(flavor); }
// in org/gjt/sp/jedit/browser/VFSBrowser.java
public void paste(VFSFile file) throws IOException, UnsupportedFlavorException { if (file == null) throw new IllegalArgumentException("file cannot be null"); String targetPath = null; switch (file.getType()) { case VFSFile.FILESYSTEM: return; case VFSFile.FILE: targetPath = MiscUtilities.getParentOfPath(file.getPath()); break; case VFSFile.DIRECTORY: targetPath = file.getPath(); break; } VFS vfs = VFSManager.getVFSForPath(targetPath); Object vfsSession = null; try { vfsSession = vfs.createVFSSession(targetPath, this); if (vfsSession == null) { Log.log(Log.ERROR, this, "Unable to create session for " + targetPath); return; } Transferable transferable = Registers.getRegister('$').getTransferable(); List<String> sources = new ArrayList<String>(); if (transferable.isDataFlavorSupported(ListVFSFileTransferable.jEditFileList)) { Iterable<VFSFile> copiedFiles = (Iterable<VFSFile>) transferable.getTransferData(ListVFSFileTransferable.jEditFileList); for (VFSFile copiedFile : copiedFiles) { sources.add(copiedFile.getPath()); } } else if (transferable.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { Iterable<File> copiedFiles = (Iterable<File>) transferable.getTransferData(DataFlavor.javaFileListFlavor); for (File copiedFile : copiedFiles) { sources.add(copiedFile.getAbsolutePath()); } } CopyFileWorker worker = new CopyFileWorker(this, sources, targetPath); ThreadUtilities.runInBackground(worker); } finally { vfs._endVFSSession(vfsSession, this); } }
5
            
// in org/gjt/sp/jedit/gui/PingPongList.java
catch (UnsupportedFlavorException e) { Log.log(Log.ERROR, this, e); }
// in org/gjt/sp/jedit/Registers.java
catch (UnsupportedFlavorException e) { }
// in org/gjt/sp/jedit/Registers.java
catch (UnsupportedFlavorException e) { Log.log(Log.ERROR, Registers.class, e); }
// in org/gjt/sp/jedit/Registers.java
catch (UnsupportedFlavorException e) { Log.log(Log.ERROR, Registers.class, e); }
// in org/gjt/sp/jedit/Registers.java
catch (UnsupportedFlavorException e) { Log.log(Log.ERROR, this, e); }
0 0
runtime (Lib) UnsupportedOperationException 1
            
// in org/gjt/sp/jedit/JARClassLoader.java
public String getResourceAsPath(String name) { // this must be fixed during plugin development if(jar == null) throw new UnsupportedOperationException( "don't call getResourceAsPath() on anonymous JARClassLoader"); if(!name.startsWith("/")) name = '/' + name; return "jeditresource:/" + MiscUtilities.getFileName( jar.getPath()) + '!' + name; }
0 0 0 0 0
checked (Domain) UtilEvalError
public class UtilEvalError extends Exception
{
    protected UtilEvalError() {
    }

    public UtilEvalError( String s ) {
        super(s);
    }

    /**
        Re-throw as an eval error, prefixing msg to the message and specifying
        the node.  If a node already exists the addNode is ignored.
        <p>
        @param msg may be null for no additional message.
    */
    public EvalError toEvalError(
        String msg, SimpleNode node, CallStack callstack  )
    {
        if ( Interpreter.DEBUG )
            printStackTrace();

        if ( msg == null )
            msg = "";
        else
            msg = msg + ": ";
        return new EvalError( msg+getMessage(), node, callstack );
    }

    public EvalError toEvalError ( SimpleNode node, CallStack callstack )
    {
        return toEvalError( null, node, callstack );
    }

}
59
            
// in org/gjt/sp/jedit/bsh/BSHUnaryExpression.java
private Object unaryOperation( Object op, int kind ) throws UtilEvalError { if (op instanceof Boolean || op instanceof Character || op instanceof Number) return primitiveWrapperUnaryOperation( op, kind ); if ( !(op instanceof Primitive) ) throw new UtilEvalError( "Unary operation " + tokenImage[kind] + " inappropriate for object" ); return Primitive.unaryOperation((Primitive)op, kind); }
// in org/gjt/sp/jedit/bsh/This.java
public Object getInterface( Class clas ) throws UtilEvalError { if ( clas.isInstance( this ) ) return this; else throw new UtilEvalError( "Dynamic proxy mechanism not available. " + "Cannot construct interface type: "+clas ); }
// in org/gjt/sp/jedit/bsh/This.java
public Object getInterface( Class [] ca ) throws UtilEvalError { for(int i=0; i<ca.length; i++) if ( !(ca[i].isInstance( this )) ) throw new UtilEvalError( "Dynamic proxy mechanism not available. " + "Cannot construct interface type: "+ca[i] ); return this; }
// in org/gjt/sp/jedit/bsh/Variable.java
public void setValue( Object value, int context ) throws UtilEvalError { // check this.value if ( hasModifier("final") && this.value != null ) throw new UtilEvalError ("Final variable, can't re-assign."); if ( value == null ) value = Primitive.getDefaultValue( type ); if ( lhs != null ) { lhs.assign( value, false/*strictjava*/ ); return; } // TODO: should add isJavaCastable() test for strictJava // (as opposed to isJavaAssignable()) if ( type != null ) value = Types.castObject( value, type, context == DECLARATION ? Types.CAST : Types.ASSIGNMENT ); this.value= value; }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Field resolveExpectedJavaField( Class clas, String fieldName, boolean staticOnly ) throws UtilEvalError, ReflectError { Field field; try { if ( Capabilities.haveAccessibility() ) field = findAccessibleField( clas, fieldName ); else // Class getField() finds only public (and in interfaces, etc.) field = clas.getField(fieldName); } catch( NoSuchFieldException e) { throw new ReflectError("No such field: " + fieldName ); } catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching fields of: "+clas, e ); } if ( staticOnly && !Modifier.isStatic( field.getModifiers() ) ) throw new UtilEvalError( "Can't reach instance field: "+fieldName +" from static context: "+clas.getName() ); return field; }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getObjectProperty( Object obj, String propName ) throws UtilEvalError, ReflectError { Object[] args = new Object[] { }; Interpreter.debug("property access: "); Method method = null; Exception e1=null, e2=null; try { String accessorName = accessorName( "get", propName ); method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); } catch ( Exception e ) { e1 = e; } if ( method == null ) try { String accessorName = accessorName( "is", propName ); method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); if ( method.getReturnType() != Boolean.TYPE ) method = null; } catch ( Exception e ) { e2 = e; } if ( method == null ) throw new ReflectError("Error in property getter: " +e1 + (e2!=null?" : "+e2:"") ); try { return invokeMethod( method, obj, args ); } catch(InvocationTargetException e) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static void setObjectProperty( Object obj, String propName, Object value) throws ReflectError, UtilEvalError { String accessorName = accessorName( "set", propName ); Object[] args = new Object[] { value }; Interpreter.debug("property access: "); try { Method method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); invokeMethod( method, obj, args ); } catch ( InvocationTargetException e ) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object invokeCompiledCommand( Class commandClass, Object [] args, Interpreter interpreter, CallStack callstack ) throws UtilEvalError { // add interpereter and namespace to args list Object[] invokeArgs = new Object[args.length + 2]; invokeArgs[0] = interpreter; invokeArgs[1] = callstack; System.arraycopy( args, 0, invokeArgs, 2, args.length ); BshClassManager bcm = interpreter.getClassManager(); try { return Reflect.invokeStaticMethod( bcm, commandClass, "invoke", invokeArgs ); } catch ( InvocationTargetException e ) { throw new UtilEvalError( "Error in compiled command: "+e.getTargetException() ); } catch ( ReflectError e ) { throw new UtilEvalError("Error invoking compiled command: "+e ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
private static void checkFoundStaticMethod( Method method, boolean staticOnly, Class clas ) throws UtilEvalError { // We're looking for a static method but found an instance method if ( method != null && staticOnly && !isStatic( method ) ) throw new UtilEvalError( "Cannot reach instance method: " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " from static context: "+ clas.getName() ); }
// in org/gjt/sp/jedit/bsh/Name.java
private Object consumeNextObjectField( CallStack callstack, Interpreter interpreter, boolean forceClass, boolean autoAllocateThis ) throws UtilEvalError { /* Is it a simple variable name? Doing this first gives the correct Java precedence for vars vs. imported class names (at least in the simple case - see tests/precedence1.bsh). It should also speed things up a bit. */ if ( (evalBaseObject == null && !isCompound(evalName) ) && !forceClass ) { Object obj = resolveThisFieldReference( callstack, namespace, interpreter, evalName, false ); if ( obj != Primitive.VOID ) return completeRound( evalName, FINISHED, obj ); } /* Is it a bsh script variable reference? If we're just starting the eval of name (no base object) or we're evaluating relative to a This type reference check. */ String varName = prefix(evalName, 1); if ( ( evalBaseObject == null || evalBaseObject instanceof This ) && !forceClass ) { if ( Interpreter.DEBUG ) Interpreter.debug("trying to resolve variable: " + varName); Object obj; // switch namespace and special var visibility if ( evalBaseObject == null ) { obj = resolveThisFieldReference( callstack, namespace, interpreter, varName, false ); } else { obj = resolveThisFieldReference( callstack, ((This)evalBaseObject).namespace, interpreter, varName, true ); } if ( obj != Primitive.VOID ) { // Resolved the variable if ( Interpreter.DEBUG ) Interpreter.debug( "resolved variable: " + varName + " in namespace: "+namespace); return completeRound( varName, suffix(evalName), obj ); } } /* Is it a class name? If we're just starting eval of name try to make it, else fail. */ if ( evalBaseObject == null ) { if ( Interpreter.DEBUG ) Interpreter.debug( "trying class: " + evalName); /* Keep adding parts until we have a class */ Class clas = null; int i = 1; String className = null; for(; i <= countParts(evalName); i++) { className = prefix(evalName, i); if ( (clas = namespace.getClass(className)) != null ) break; } if ( clas != null ) { return completeRound( className, suffix( evalName, countParts(evalName)-i ), new ClassIdentifier(clas) ); } // not a class (or variable per above) if ( Interpreter.DEBUG ) Interpreter.debug( "not a class, trying var prefix "+evalName ); } // No variable or class found in 'this' type ref. // if autoAllocateThis then create one; a child 'this'. if ( ( evalBaseObject == null || evalBaseObject instanceof This ) && !forceClass && autoAllocateThis ) { NameSpace targetNameSpace = ( evalBaseObject == null ) ? namespace : ((This)evalBaseObject).namespace; Object obj = new NameSpace( targetNameSpace, "auto: "+varName ).getThis( interpreter ); targetNameSpace.setVariable( varName, obj, false ); return completeRound( varName, suffix(evalName), obj ); } /* If we didn't find a class or variable name (or prefix) above there are two possibilities: - If we are a simple name then we can pass as a void variable reference. - If we are compound then we must fail at this point. */ if ( evalBaseObject == null ) { if ( !isCompound(evalName) ) { return completeRound( evalName, FINISHED, Primitive.VOID ); } else throw new UtilEvalError( "Class or variable not found: " + evalName); } /* -------------------------------------------------------- After this point we're definitely evaluating relative to a base object. -------------------------------------------------------- */ /* Do some basic validity checks. */ if ( evalBaseObject == Primitive.NULL) // previous round produced null throw new UtilTargetError( new NullPointerException( "Null Pointer while evaluating: " +value ) ); if ( evalBaseObject == Primitive.VOID) // previous round produced void throw new UtilEvalError( "Undefined variable or class name while evaluating: "+value); if ( evalBaseObject instanceof Primitive) throw new UtilEvalError("Can't treat primitive like an object. "+ "Error while evaluating: "+value); /* Resolve relative to a class type static field, inner class, ? */ if ( evalBaseObject instanceof ClassIdentifier ) { Class clas = ((ClassIdentifier)evalBaseObject).getTargetClass(); String field = prefix(evalName, 1); // Class qualified 'this' reference from inner class. // e.g. 'MyOuterClass.this' if ( field.equals("this") ) { // find the enclosing class instance space of the class name NameSpace ns = namespace; while ( ns != null ) { // getClassInstance() throws exception if not there if ( ns.classInstance != null && ns.classInstance.getClass() == clas ) return completeRound( field, suffix(evalName), ns.classInstance ); ns=ns.getParent(); } throw new UtilEvalError( "Can't find enclosing 'this' instance of class: "+clas); } Object obj = null; // static field? try { if ( Interpreter.DEBUG ) Interpreter.debug("Name call to getStaticFieldValue, class: " +clas+", field:"+field); obj = Reflect.getStaticFieldValue(clas, field); } catch( ReflectError e ) { if ( Interpreter.DEBUG ) Interpreter.debug("field reflect error: "+e); } // inner class? if ( obj == null ) { String iclass = clas.getName()+"$"+field; Class c = namespace.getClass( iclass ); if ( c != null ) obj = new ClassIdentifier(c); } if ( obj == null ) throw new UtilEvalError( "No static field or inner class: " + field + " of " + clas ); return completeRound( field, suffix(evalName), obj ); } /* If we've fallen through here we are no longer resolving to a class type. */ if ( forceClass ) throw new UtilEvalError( value +" does not resolve to a class name." ); /* Some kind of field access? */ String field = prefix(evalName, 1); // length access on array? if ( field.equals("length") && evalBaseObject.getClass().isArray() ) { Object obj = new Primitive(Array.getLength(evalBaseObject)); return completeRound( field, suffix(evalName), obj ); } // Check for field on object // Note: could eliminate throwing the exception somehow try { Object obj = Reflect.getObjectFieldValue(evalBaseObject, field); return completeRound( field, suffix(evalName), obj ); } catch(ReflectError e) { /* not a field */ } // if we get here we have failed throw new UtilEvalError( "Cannot access field: " + field + ", on object: " + evalBaseObject); }
// in org/gjt/sp/jedit/bsh/Name.java
Object resolveThisFieldReference( CallStack callstack, NameSpace thisNameSpace, Interpreter interpreter, String varName, boolean specialFieldsVisible ) throws UtilEvalError { if ( varName.equals("this") ) { /* Somewhat of a hack. If the special fields are visible (we're operating relative to a 'this' type already) dissallow further .this references to prevent user from skipping to things like super.this.caller */ if ( specialFieldsVisible ) throw new UtilEvalError("Redundant to call .this on This type"); // Allow getThis() to work through BlockNameSpace to the method // namespace // XXX re-eval this... do we need it? This ths = thisNameSpace.getThis( interpreter ); thisNameSpace= ths.getNameSpace(); Object result = ths; NameSpace classNameSpace = getClassNameSpace( thisNameSpace ); if ( classNameSpace != null ) { if ( isCompound( evalName ) ) result = classNameSpace.getThis( interpreter ); else result = classNameSpace.getClassInstance(); } return result; } /* Some duplication for "super". See notes for "this" above If we're in an enclsing class instance and have a superclass instance our super is the superclass instance. */ if ( varName.equals("super") ) { //if ( specialFieldsVisible ) //throw new UtilEvalError("Redundant to call .this on This type"); // Allow getSuper() to through BlockNameSpace to the method's super This ths = thisNameSpace.getSuper( interpreter ); thisNameSpace = ths.getNameSpace(); // super is now the closure's super or class instance // XXXX re-evaluate this // can getSuper work by itself now? // If we're a class instance and the parent is also a class instance // then super means our parent. if ( thisNameSpace.getParent() != null && thisNameSpace.getParent().isClass ) ths = thisNameSpace.getParent().getThis( interpreter ); return ths; } Object obj = null; if ( varName.equals("global") ) obj = thisNameSpace.getGlobal( interpreter ); if ( obj == null && specialFieldsVisible ) { if (varName.equals("namespace")) obj = thisNameSpace; else if (varName.equals("variables")) obj = thisNameSpace.getVariableNames(); else if (varName.equals("methods")) obj = thisNameSpace.getMethodNames(); else if ( varName.equals("interpreter") ) if ( lastEvalName.equals("this") ) obj = interpreter; else throw new UtilEvalError( "Can only call .interpreter on literal 'this'"); } if ( obj == null && specialFieldsVisible && varName.equals("caller") ) { if ( lastEvalName.equals("this") || lastEvalName.equals("caller") ) { // get the previous context (see notes for this class) if ( callstack == null ) throw new InterpreterError("no callstack"); obj = callstack.get( ++callstackDepth ).getThis( interpreter ); } else throw new UtilEvalError( "Can only call .caller on literal 'this' or literal '.caller'"); // early return return obj; } if ( obj == null && specialFieldsVisible && varName.equals("callstack") ) { if ( lastEvalName.equals("this") ) { // get the previous context (see notes for this class) if ( callstack == null ) throw new InterpreterError("no callstack"); obj = callstack; } else throw new UtilEvalError( "Can only call .callstack on literal 'this'"); } if ( obj == null ) obj = thisNameSpace.getVariable(varName); if ( obj == null ) throw new InterpreterError("null this field ref:"+varName); return obj; }
// in org/gjt/sp/jedit/bsh/Name.java
synchronized public LHS toLHS( CallStack callstack, Interpreter interpreter ) throws UtilEvalError { // Should clean this up to a single return statement reset(); LHS lhs; // Simple (non-compound) variable assignment e.g. x=5; if ( !isCompound(evalName) ) { if ( evalName.equals("this") ) throw new UtilEvalError("Can't assign to 'this'." ); // Interpreter.debug("Simple var LHS..."); lhs = new LHS( namespace, evalName, false/*bubble up if allowed*/); return lhs; } // Field e.g. foo.bar=5; Object obj = null; try { while( evalName != null && isCompound( evalName ) ) { obj = consumeNextObjectField( callstack, interpreter, false/*forcclass*/, true/*autoallocthis*/ ); } } catch( UtilEvalError e ) { throw new UtilEvalError( "LHS evaluation: " + e.getMessage() ); } // Finished eval and its a class. if ( evalName == null && obj instanceof ClassIdentifier ) throw new UtilEvalError("Can't assign to class: " + value ); if ( obj == null ) throw new UtilEvalError("Error in LHS: " + value ); // e.g. this.x=5; or someThisType.x=5; if ( obj instanceof This ) { // dissallow assignment to magic fields if ( evalName.equals("namespace") || evalName.equals("variables") || evalName.equals("methods") || evalName.equals("caller") ) throw new UtilEvalError( "Can't assign to special variable: "+evalName ); Interpreter.debug("found This reference evaluating LHS"); /* If this was a literal "super" reference then we allow recursion in setting the variable to get the normal effect of finding the nearest definition starting at the super scope. On any other resolution qualified by a 'this' type reference we want to set the variable directly in that scope. e.g. this.x=5; or someThisType.x=5; In the old scoping rules super didn't do this. */ boolean localVar = !lastEvalName.equals("super"); return new LHS( ((This)obj).namespace, evalName, localVar ); } if ( evalName != null ) { try { if ( obj instanceof ClassIdentifier ) { Class clas = ((ClassIdentifier)obj).getTargetClass(); lhs = Reflect.getLHSStaticField(clas, evalName); return lhs; } else { lhs = Reflect.getLHSObjectField(obj, evalName); return lhs; } } catch(ReflectError e) { throw new UtilEvalError("Field access: "+e); } } throw new InterpreterError("Internal error in lhs..."); }
// in org/gjt/sp/jedit/bsh/Name.java
public Object invokeMethod( Interpreter interpreter, Object[] args, CallStack callstack, SimpleNode callerInfo ) throws UtilEvalError, EvalError, ReflectError, InvocationTargetException { String methodName = Name.suffix(value, 1); BshClassManager bcm = interpreter.getClassManager(); NameSpace namespace = callstack.top(); // Optimization - If classOfStaticMethod is set then we have already // been here and determined that this is a static method invocation. // Note: maybe factor this out with path below... clean up. if ( classOfStaticMethod != null ) { return Reflect.invokeStaticMethod( bcm, classOfStaticMethod, methodName, args ); } if ( !Name.isCompound(value) ) return invokeLocalMethod( interpreter, args, callstack, callerInfo ); // Note: if we want methods declared inside blocks to be accessible via // this.methodname() inside the block we could handle it here as a // special case. See also resolveThisFieldReference() special handling // for BlockNameSpace case. They currently work via the direct name // e.g. methodName(). String prefix = Name.prefix(value); // Superclass method invocation? (e.g. super.foo()) if ( prefix.equals("super") && Name.countParts(value) == 2 ) { // Allow getThis() to work through block namespaces first This ths = namespace.getThis( interpreter ); NameSpace thisNameSpace = ths.getNameSpace(); NameSpace classNameSpace = getClassNameSpace( thisNameSpace ); if ( classNameSpace != null ) { Object instance = classNameSpace.getClassInstance(); return ClassGenerator.getClassGenerator() .invokeSuperclassMethod( bcm, instance, methodName, args ); } } // Find target object or class identifier Name targetName = namespace.getNameResolver( prefix ); Object obj = targetName.toObject( callstack, interpreter ); if ( obj == Primitive.VOID ) throw new UtilEvalError( "Attempt to resolve method: "+methodName +"() on undefined variable or class name: "+targetName); // if we've got an object, resolve the method if ( !(obj instanceof ClassIdentifier) ) { if (obj instanceof Primitive) { if (obj == Primitive.NULL) throw new UtilTargetError( new NullPointerException( "Null Pointer in Method Invocation" ) ); // some other primitive // should avoid calling methods on primitive, as we do // in Name (can't treat primitive like an object message) // but the hole is useful right now. if ( Interpreter.DEBUG ) interpreter.debug( "Attempt to access method on primitive..." + " allowing bsh.Primitive to peek through for debugging"); } // found an object and it's not an undefined variable return Reflect.invokeObjectMethod( obj, methodName, args, interpreter, callstack, callerInfo ); } // It's a class // try static method if ( Interpreter.DEBUG ) Interpreter.debug("invokeMethod: trying static - " + targetName); Class clas = ((ClassIdentifier)obj).getTargetClass(); // cache the fact that this is a static method invocation on this class classOfStaticMethod = clas; if ( clas != null ) return Reflect.invokeStaticMethod( bcm, clas, methodName, args ); // return null; ??? throw new UtilEvalError("invokeMethod: unknown target: " + targetName); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public void doSuperImport() throws UtilEvalError { // Should we prevent it from happening twice? try { getClassPath().insureInitialized(); // prime the lookup table getClassNameByUnqName( "" ) ; // always true now //getClassPath().setNameCompletionIncludeUnqNames(true); } catch ( ClassPathException e ) { throw new UtilEvalError("Error importing classpath "+ e ); } superImport = true; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
Object getClassInstance() throws UtilEvalError { if ( classInstance != null ) return classInstance; if ( classStatic != null //|| ( getParent()!=null && getParent().classStatic != null ) ) throw new UtilEvalError( "Can't refer to class instance from static context."); else throw new InterpreterError( "Can't resolve class instance 'this' in: "+this); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
void setVariable( String name, Object value, boolean strictJava, boolean recurse ) throws UtilEvalError { if ( variables == null ) variables = new Hashtable(); // primitives should have been wrapped // {{{ jEdit change //if ( value == null ) // throw new InterpreterError("null variable value"); if ( value == null ) { // don't break jEdit core and plugins! unsetVariable(name); return; } // }}} // Locate the variable definition if it exists. Variable existing = getVariableImpl( name, recurse ); // Found an existing variable here (or above if recurse allowed) if ( existing != null ) { try { existing.setValue( value, Variable.ASSIGNMENT ); } catch ( UtilEvalError e ) { throw new UtilEvalError( "Variable assignment: " + name + ": " + e.getMessage()); } } else // No previous variable definition found here (or above if recurse) { if ( strictJava ) throw new UtilEvalError( "(Strict Java mode) Assignment to undeclared variable: " +name ); // If recurse, set global untyped var, else set it here. //NameSpace varScope = recurse ? getGlobal() : this; // This modification makes default allocation local NameSpace varScope = this; varScope.variables.put( name, new Variable( name, value, null/*modifiers*/ ) ); // nameSpaceChanged() on new variable addition nameSpaceChanged(); } }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public void setTypedVariable( String name, Class type, Object value, Modifiers modifiers ) throws UtilEvalError { //checkVariableModifiers( name, modifiers ); if ( variables == null ) variables = new Hashtable(); // Setting a typed variable is always a local operation. Variable existing = getVariableImpl( name, false/*recurse*/ ); // Null value is just a declaration // Note: we might want to keep any existing value here instead of reset /* // Moved to Variable if ( value == null ) value = Primitive.getDefaultValue( type ); */ // does the variable already exist? if ( existing != null ) { // Is it typed? if ( existing.getType() != null ) { // If it had a different type throw error. // This allows declaring the same var again, but not with // a different (even if assignable) type. if ( existing.getType() != type ) { throw new UtilEvalError( "Typed variable: "+name +" was previously declared with type: " + existing.getType() ); } else { // else set it and return existing.setValue( value, Variable.DECLARATION ); return; } } // Careful here: // else fall through to override and install the new typed version } // Add the new typed var variables.put( name, new Variable( name, type, value, modifiers ) ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
private BshMethod loadScriptedCommand( InputStream in, String name, Class [] argTypes, String resourcePath, Interpreter interpreter ) throws UtilEvalError { try { interpreter.eval( new InputStreamReader(in), this, resourcePath ); } catch ( EvalError e ) { /* Here we catch any EvalError from the interpreter because we are using it as a tool to load the command, not as part of the execution path. */ Interpreter.debug( e.toString() ); throw new UtilEvalError( "Error loading script: "+ e.getMessage()); } // Look for the loaded command BshMethod meth = getMethod( name, argTypes ); /* if ( meth == null ) throw new UtilEvalError("Loaded resource: " + resourcePath + "had an error or did not contain the correct method" ); */ return meth; }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
private Object operation( Object lhs, Object rhs, int kind ) throws UtilEvalError { /* Implement String += value; According to the JLS, value may be anything. In BeanShell, we'll disallow VOID (undefined) values. (or should we map them to the empty string?) */ if ( lhs instanceof String && rhs != Primitive.VOID ) { if ( kind != PLUS ) throw new UtilEvalError( "Use of non + operator with String LHS" ); return (String)lhs + rhs; } if ( lhs instanceof Primitive || rhs instanceof Primitive ) if(lhs == Primitive.VOID || rhs == Primitive.VOID) throw new UtilEvalError( "Illegal use of undefined object or 'void' literal" ); else if ( lhs == Primitive.NULL || rhs == Primitive.NULL ) throw new UtilEvalError( "Illegal use of null object or 'null' literal" ); if( (lhs instanceof Boolean || lhs instanceof Character || lhs instanceof Number || lhs instanceof Primitive) && (rhs instanceof Boolean || rhs instanceof Character || rhs instanceof Number || rhs instanceof Primitive) ) { return Primitive.binaryOperation(lhs, rhs, kind); } throw new UtilEvalError("Non primitive value in operator: " + lhs.getClass() + " " + tokenImage[kind] + " " + rhs.getClass() ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
public static Object binaryOperation( Object obj1, Object obj2, int kind) throws UtilEvalError { // special primitive types if ( obj1 == NULL || obj2 == NULL ) throw new UtilEvalError( "Null value or 'null' literal in binary operation"); if ( obj1 == VOID || obj2 == VOID ) throw new UtilEvalError( "Undefined variable, class, or 'void' literal in binary operation"); // keep track of the original types Class lhsOrgType = obj1.getClass(); Class rhsOrgType = obj2.getClass(); // Unwrap primitives if ( obj1 instanceof Primitive ) obj1 = ((Primitive)obj1).getValue(); if ( obj2 instanceof Primitive ) obj2 = ((Primitive)obj2).getValue(); Object[] operands = promotePrimitives(obj1, obj2); Object lhs = operands[0]; Object rhs = operands[1]; if(lhs.getClass() != rhs.getClass()) throw new UtilEvalError("Type mismatch in operator. " + lhs.getClass() + " cannot be used with " + rhs.getClass() ); Object result; try { result = binaryOperationImpl( lhs, rhs, kind ); } catch ( ArithmeticException e ) { throw new UtilTargetError( "Arithemetic Exception in binary op", e); } // If both original args were Primitives return a Primitive result // else it was mixed (wrapper/primitive) return the wrapper type // Exception is for boolean result, return the primitive if ( (lhsOrgType == Primitive.class && rhsOrgType == Primitive.class) || result instanceof Boolean ) return new Primitive( result ); else return result; }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object binaryOperationImpl( Object lhs, Object rhs, int kind ) throws UtilEvalError { if(lhs instanceof Boolean) return booleanBinaryOperation((Boolean)lhs, (Boolean)rhs, kind); else if(lhs instanceof Integer) return intBinaryOperation( (Integer)lhs, (Integer)rhs, kind ); else if(lhs instanceof Long) return longBinaryOperation((Long)lhs, (Long)rhs, kind); else if(lhs instanceof Float) return floatBinaryOperation((Float)lhs, (Float)rhs, kind); else if(lhs instanceof Double) return doubleBinaryOperation( (Double)lhs, (Double)rhs, kind); else throw new UtilEvalError("Invalid types in binary operator" ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object doubleBinaryOperation(Double D1, Double D2, int kind) throws UtilEvalError { double lhs = D1.doubleValue(); double rhs = D2.doubleValue(); switch(kind) { // boolean case LT: case LTX: return new Boolean(lhs < rhs); case GT: case GTX: return new Boolean(lhs > rhs); case EQ: return new Boolean(lhs == rhs); case LE: case LEX: return new Boolean(lhs <= rhs); case GE: case GEX: return new Boolean(lhs >= rhs); case NE: return new Boolean(lhs != rhs); // arithmetic case PLUS: return new Double(lhs + rhs); case MINUS: return new Double(lhs - rhs); case STAR: return new Double(lhs * rhs); case SLASH: return new Double(lhs / rhs); case MOD: return new Double(lhs % rhs); // can't shift floating-point values case LSHIFT: case LSHIFTX: case RSIGNEDSHIFT: case RSIGNEDSHIFTX: case RUNSIGNEDSHIFT: case RUNSIGNEDSHIFTX: throw new UtilEvalError("Can't shift doubles"); default: throw new InterpreterError( "Unimplemented binary double operator"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object floatBinaryOperation(Float F1, Float F2, int kind) throws UtilEvalError { float lhs = F1.floatValue(); float rhs = F2.floatValue(); switch(kind) { // boolean case LT: case LTX: return new Boolean(lhs < rhs); case GT: case GTX: return new Boolean(lhs > rhs); case EQ: return new Boolean(lhs == rhs); case LE: case LEX: return new Boolean(lhs <= rhs); case GE: case GEX: return new Boolean(lhs >= rhs); case NE: return new Boolean(lhs != rhs); // arithmetic case PLUS: return new Float(lhs + rhs); case MINUS: return new Float(lhs - rhs); case STAR: return new Float(lhs * rhs); case SLASH: return new Float(lhs / rhs); case MOD: return new Float(lhs % rhs); // can't shift floats case LSHIFT: case LSHIFTX: case RSIGNEDSHIFT: case RSIGNEDSHIFTX: case RUNSIGNEDSHIFT: case RUNSIGNEDSHIFTX: throw new UtilEvalError("Can't shift floats "); default: throw new InterpreterError( "Unimplemented binary float operator"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
public static Primitive unaryOperation(Primitive val, int kind) throws UtilEvalError { if (val == NULL) throw new UtilEvalError( "illegal use of null object or 'null' literal"); if (val == VOID) throw new UtilEvalError( "illegal use of undefined object or 'void' literal"); Class operandType = val.getType(); Object operand = promoteToInteger(val.getValue()); if ( operand instanceof Boolean ) return new Primitive(booleanUnaryOperation((Boolean)operand, kind)); else if(operand instanceof Integer) { int result = intUnaryOperation((Integer)operand, kind); // ++ and -- must be cast back the original type if(kind == INCR || kind == DECR) { if(operandType == Byte.TYPE) return new Primitive((byte)result); if(operandType == Short.TYPE) return new Primitive((short)result); if(operandType == Character.TYPE) return new Primitive((char)result); } return new Primitive(result); } else if(operand instanceof Long) return new Primitive(longUnaryOperation((Long)operand, kind)); else if(operand instanceof Float) return new Primitive(floatUnaryOperation((Float)operand, kind)); else if(operand instanceof Double) return new Primitive(doubleUnaryOperation((Double)operand, kind)); else throw new InterpreterError( "An error occurred. Please call technical support."); }
// in org/gjt/sp/jedit/bsh/Primitive.java
static boolean booleanUnaryOperation(Boolean B, int kind) throws UtilEvalError { boolean operand = B.booleanValue(); switch(kind) { case BANG: return !operand; default: throw new UtilEvalError("Operator inappropriate for boolean"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
public int intValue() throws UtilEvalError { if(value instanceof Number) return((Number)value).intValue(); else throw new UtilEvalError("Primitive not a number"); }
// in org/gjt/sp/jedit/bsh/Primitive.java
public boolean booleanValue() throws UtilEvalError { if(value instanceof Boolean) return((Boolean)value).booleanValue(); else throw new UtilEvalError("Primitive not a boolean"); }
// in org/gjt/sp/jedit/bsh/Primitive.java
public Number numberValue() throws UtilEvalError { Object value = this.value; // Promote character to Number type for these purposes if (value instanceof Character) value = new Integer(((Character)value).charValue()); if (value instanceof Number) return (Number)value; else throw new UtilEvalError("Primitive not a number"); }
// in org/gjt/sp/jedit/bsh/LHS.java
public Object getValue() throws UtilEvalError { if ( type == VARIABLE ) return nameSpace.getVariable( varName ); if (type == FIELD) try { Object o = field.get( object ); return Primitive.wrap( o, field.getType() ); } catch(IllegalAccessException e2) { throw new UtilEvalError("Can't read field: " + field); } if ( type == PROPERTY ) try { return Reflect.getObjectProperty(object, propName); } catch(ReflectError e) { Interpreter.debug(e.getMessage()); throw new UtilEvalError("No such property: " + propName); } if ( type == INDEX ) try { return Reflect.getIndex(object, index); } catch(Exception e) { throw new UtilEvalError("Array access: " + e); } throw new InterpreterError("LHS type"); }
// in org/gjt/sp/jedit/bsh/LHS.java
public Object assign( Object val, boolean strictJava ) throws UtilEvalError { if ( type == VARIABLE ) { // Set the variable in namespace according to localVar flag if ( localVar ) nameSpace.setLocalVariable( varName, val, strictJava ); else nameSpace.setVariable( varName, val, strictJava ); } else if ( type == FIELD ) { try { Object fieldVal = val instanceof Primitive ? ((Primitive)val).getValue() : val; // This should probably be in Reflect.java ReflectManager.RMSetAccessible( field ); field.set( object, fieldVal ); return val; } catch( NullPointerException e) { throw new UtilEvalError( "LHS ("+field.getName()+") not a static field."); } catch( IllegalAccessException e2) { throw new UtilEvalError( "LHS ("+field.getName()+") can't access field: "+e2); } catch( IllegalArgumentException e3) { String type = val instanceof Primitive ? ((Primitive)val).getType().getName() : val.getClass().getName(); throw new UtilEvalError( "Argument type mismatch. " + (val == null ? "null" : type ) + " not assignable to field "+field.getName()); } } else if ( type == PROPERTY ) { /* if ( object instanceof Hashtable ) ((Hashtable)object).put(propName, val); */ CollectionManager cm = CollectionManager.getCollectionManager(); if ( cm.isMap( object ) ) cm.putInMap( object/*map*/, propName, val ); else try { Reflect.setObjectProperty(object, propName, val); } catch(ReflectError e) { Interpreter.debug("Assignment: " + e.getMessage()); throw new UtilEvalError("No such property: " + propName); } } else if ( type == INDEX ) try { Reflect.setIndex(object, index, val); } catch ( UtilTargetError e1 ) { // pass along target error throw e1; } catch ( Exception e ) { throw new UtilEvalError("Assignment: " + e.getMessage()); } else throw new InterpreterError("unknown lhs"); return val; }
17
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch(InvocationTargetException e) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( InvocationTargetException e ) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( InvocationTargetException e ) { throw new UtilEvalError( "Error in compiled command: "+e.getTargetException() ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( ReflectError e ) { throw new UtilEvalError("Error invoking compiled command: "+e ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch( UtilEvalError e ) { throw new UtilEvalError( "LHS evaluation: " + e.getMessage() ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch(ReflectError e) { throw new UtilEvalError("Field access: "+e); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
catch ( ClassPathException e ) { throw new UtilEvalError("Error importing classpath "+ e ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
catch ( UtilEvalError e ) { throw new UtilEvalError( "Variable assignment: " + name + ": " + e.getMessage()); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
catch ( EvalError e ) { /* Here we catch any EvalError from the interpreter because we are using it as a tool to load the command, not as part of the execution path. */ Interpreter.debug( e.toString() ); throw new UtilEvalError( "Error loading script: "+ e.getMessage()); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(IllegalAccessException e2) { throw new UtilEvalError("Can't read field: " + field); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(ReflectError e) { Interpreter.debug(e.getMessage()); throw new UtilEvalError("No such property: " + propName); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(Exception e) { throw new UtilEvalError("Array access: " + e); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( NullPointerException e) { throw new UtilEvalError( "LHS ("+field.getName()+") not a static field."); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( IllegalAccessException e2) { throw new UtilEvalError( "LHS ("+field.getName()+") can't access field: "+e2); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch( IllegalArgumentException e3) { String type = val instanceof Primitive ? ((Primitive)val).getType().getName() : val.getClass().getName(); throw new UtilEvalError( "Argument type mismatch. " + (val == null ? "null" : type ) + " not assignable to field "+field.getName()); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch(ReflectError e) { Interpreter.debug("Assignment: " + e.getMessage()); throw new UtilEvalError("No such property: " + propName); }
// in org/gjt/sp/jedit/bsh/LHS.java
catch ( Exception e ) { throw new UtilEvalError("Assignment: " + e.getMessage()); }
94
            
// in org/gjt/sp/jedit/bsh/BSHUnaryExpression.java
private Object lhsUnaryOperation( LHS lhs, boolean strictJava ) throws UtilEvalError { if ( Interpreter.DEBUG ) Interpreter.debug("lhsUnaryOperation"); Object prevalue, postvalue; prevalue = lhs.getValue(); postvalue = unaryOperation(prevalue, kind); Object retVal; if ( postfix ) retVal = prevalue; else retVal = postvalue; lhs.assign( postvalue, strictJava ); return retVal; }
// in org/gjt/sp/jedit/bsh/BSHUnaryExpression.java
private Object unaryOperation( Object op, int kind ) throws UtilEvalError { if (op instanceof Boolean || op instanceof Character || op instanceof Number) return primitiveWrapperUnaryOperation( op, kind ); if ( !(op instanceof Primitive) ) throw new UtilEvalError( "Unary operation " + tokenImage[kind] + " inappropriate for object" ); return Primitive.unaryOperation((Primitive)op, kind); }
// in org/gjt/sp/jedit/bsh/BSHUnaryExpression.java
private Object primitiveWrapperUnaryOperation(Object val, int kind) throws UtilEvalError { Class operandType = val.getClass(); Object operand = Primitive.promoteToInteger(val); if ( operand instanceof Boolean ) return new Boolean( Primitive.booleanUnaryOperation((Boolean)operand, kind)); else if ( operand instanceof Integer ) { int result = Primitive.intUnaryOperation((Integer)operand, kind); // ++ and -- must be cast back the original type if(kind == INCR || kind == DECR) { if(operandType == Byte.TYPE) return new Byte((byte)result); if(operandType == Short.TYPE) return new Short((short)result); if(operandType == Character.TYPE) return new Character((char)result); } return new Integer(result); } else if(operand instanceof Long) return new Long(Primitive.longUnaryOperation((Long)operand, kind)); else if(operand instanceof Float) return new Float(Primitive.floatUnaryOperation((Float)operand, kind)); else if(operand instanceof Double) return new Double(Primitive.doubleUnaryOperation((Double)operand, kind)); else throw new InterpreterError("An error occurred. Please call technical support."); }
// in org/gjt/sp/jedit/bsh/This.java
public Object getInterface( Class clas ) throws UtilEvalError { if ( clas.isInstance( this ) ) return this; else throw new UtilEvalError( "Dynamic proxy mechanism not available. " + "Cannot construct interface type: "+clas ); }
// in org/gjt/sp/jedit/bsh/This.java
public Object getInterface( Class [] ca ) throws UtilEvalError { for(int i=0; i<ca.length; i++) if ( !(ca[i].isInstance( this )) ) throw new UtilEvalError( "Dynamic proxy mechanism not available. " + "Cannot construct interface type: "+ca[i] ); return this; }
// in org/gjt/sp/jedit/bsh/Variable.java
public void setValue( Object value, int context ) throws UtilEvalError { // check this.value if ( hasModifier("final") && this.value != null ) throw new UtilEvalError ("Final variable, can't re-assign."); if ( value == null ) value = Primitive.getDefaultValue( type ); if ( lhs != null ) { lhs.assign( value, false/*strictjava*/ ); return; } // TODO: should add isJavaCastable() test for strictJava // (as opposed to isJavaAssignable()) if ( type != null ) value = Types.castObject( value, type, context == DECLARATION ? Types.CAST : Types.ASSIGNMENT ); this.value= value; }
// in org/gjt/sp/jedit/bsh/Variable.java
Object getValue() throws UtilEvalError { if ( lhs != null ) return lhs.getValue(); return value; }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
public Object invokeSuperclassMethod( BshClassManager bcm, Object instance, String methodName, Object [] args ) throws UtilEvalError, ReflectError, InvocationTargetException { // Delegate to the static method return invokeSuperclassMethodImpl( bcm, instance, methodName, args ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
public static Object invokeSuperclassMethodImpl( BshClassManager bcm, Object instance, String methodName, Object [] args ) throws UtilEvalError, ReflectError, InvocationTargetException { String superName = ClassGeneratorUtil.BSHSUPER+methodName; // look for the specially named super delegate method Class clas = instance.getClass(); Method superMethod = Reflect.resolveJavaMethod( bcm, clas, superName, Types.getTypes(args), false/*onlyStatic*/ ); if ( superMethod != null ) return Reflect.invokeMethod( superMethod, instance, args ); // No super method, try to invoke regular method // could be a superfluous "super." which is legal. Class superClass = clas.getSuperclass(); superMethod = Reflect.resolveExpectedJavaMethod( bcm, superClass, instance, methodName, args, false/*onlyStatic*/ ); return Reflect.invokeMethod( superMethod, instance, args ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object invokeStaticMethod( BshClassManager bcm, Class clas, String methodName, Object [] args ) throws ReflectError, UtilEvalError, InvocationTargetException { Interpreter.debug("invoke static Method"); Method method = resolveExpectedJavaMethod( bcm, clas, null, methodName, args, true ); return invokeMethod( method, null, args ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getStaticFieldValue(Class clas, String fieldName) throws UtilEvalError, ReflectError { return getFieldValue( clas, null, fieldName, true/*onlystatic*/); }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getObjectFieldValue( Object object, String fieldName ) throws UtilEvalError, ReflectError { if ( object instanceof This ) return ((This)object).namespace.getVariable( fieldName ); else { try { return getFieldValue( object.getClass(), object, fieldName, false/*onlystatic*/); } catch ( ReflectError e ) { // no field, try property acces if ( hasObjectPropertyGetter( object.getClass(), fieldName ) ) return getObjectProperty( object, fieldName ); else throw e; } } }
// in org/gjt/sp/jedit/bsh/Reflect.java
static LHS getLHSStaticField(Class clas, String fieldName) throws UtilEvalError, ReflectError { Field f = resolveExpectedJavaField( clas, fieldName, true/*onlystatic*/); return new LHS(f); }
// in org/gjt/sp/jedit/bsh/Reflect.java
static LHS getLHSObjectField( Object object, String fieldName ) throws UtilEvalError, ReflectError { if ( object instanceof This ) { // I guess this is when we pass it as an argument? // Setting locally boolean recurse = false; return new LHS( ((This)object).namespace, fieldName, recurse ); } try { Field f = resolveExpectedJavaField( object.getClass(), fieldName, false/*staticOnly*/ ); return new LHS(object, f); } catch ( ReflectError e ) { // not a field, try property access if ( hasObjectPropertySetter( object.getClass(), fieldName ) ) return new LHS( object, fieldName ); else throw e; } }
// in org/gjt/sp/jedit/bsh/Reflect.java
private static Object getFieldValue( Class clas, Object object, String fieldName, boolean staticOnly ) throws UtilEvalError, ReflectError { try { Field f = resolveExpectedJavaField( clas, fieldName, staticOnly ); Object value = f.get(object); Class returnType = f.getType(); return Primitive.wrap( value, returnType ); } catch( NullPointerException e ) { // shouldn't happen throw new ReflectError( "???" + fieldName + " is not a static field."); } catch(IllegalAccessException e) { throw new ReflectError("Can't access field: " + fieldName); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Field resolveJavaField( Class clas, String fieldName, boolean staticOnly ) throws UtilEvalError { try { return resolveExpectedJavaField( clas, fieldName, staticOnly ); } catch ( ReflectError e ) { return null; } }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Field resolveExpectedJavaField( Class clas, String fieldName, boolean staticOnly ) throws UtilEvalError, ReflectError { Field field; try { if ( Capabilities.haveAccessibility() ) field = findAccessibleField( clas, fieldName ); else // Class getField() finds only public (and in interfaces, etc.) field = clas.getField(fieldName); } catch( NoSuchFieldException e) { throw new ReflectError("No such field: " + fieldName ); } catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching fields of: "+clas, e ); } if ( staticOnly && !Modifier.isStatic( field.getModifiers() ) ) throw new UtilEvalError( "Can't reach instance field: "+fieldName +" from static context: "+clas.getName() ); return field; }
// in org/gjt/sp/jedit/bsh/Reflect.java
private static Field findAccessibleField( Class clas, String fieldName ) throws UtilEvalError, NoSuchFieldException { Field field; // Quick check catches public fields include those in interfaces try { field = clas.getField(fieldName); ReflectManager.RMSetAccessible( field ); return field; } catch ( NoSuchFieldException e ) { } // Now, on with the hunt... while ( clas != null ) { try { field = clas.getDeclaredField(fieldName); ReflectManager.RMSetAccessible( field ); return field; // Not found, fall through to next class } catch(NoSuchFieldException e) { } clas = clas.getSuperclass(); } throw new NoSuchFieldException( fieldName ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Method resolveExpectedJavaMethod( BshClassManager bcm, Class clas, Object object, String name, Object[] args, boolean staticOnly ) throws ReflectError, UtilEvalError { if ( object == Primitive.NULL ) throw new UtilTargetError( new NullPointerException( "Attempt to invoke method " +name+" on null value" ) ); Class [] types = Types.getTypes(args); Method method = resolveJavaMethod( bcm, clas, name, types, staticOnly ); if ( method == null ) throw new ReflectError( ( staticOnly ? "Static method " : "Method " ) + StringUtil.methodString(name, types) + " not found in class'" + clas.getName() + "'"); return method; }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Method resolveJavaMethod( BshClassManager bcm, Class clas, String name, Class [] types, boolean staticOnly ) throws UtilEvalError { if ( clas == null ) throw new InterpreterError("null class"); // Lookup previously cached method Method method = null; if ( bcm == null ) Interpreter.debug("resolveJavaMethod UNOPTIMIZED lookup"); else method = bcm.getResolvedMethod( clas, name, types, staticOnly ); if ( method == null ) { boolean publicOnly = !Capabilities.haveAccessibility(); // Searching for the method may, itself be a priviledged action try { method = findOverloadedMethod( clas, name, types, publicOnly ); } catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching methods of: "+clas, e ); } checkFoundStaticMethod( method, staticOnly, clas ); // This is the first time we've seen this method, set accessibility // Note: even if it's a public method, we may have found it in a // non-public class if ( method != null && !publicOnly ) { try { ReflectManager.RMSetAccessible( method ); } catch ( UtilEvalError e ) { /*ignore*/ } } // If succeeded cache the resolved method. if ( method != null && bcm != null ) bcm.cacheResolvedMethod( clas, types, method ); } return method; }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getObjectProperty( Object obj, String propName ) throws UtilEvalError, ReflectError { Object[] args = new Object[] { }; Interpreter.debug("property access: "); Method method = null; Exception e1=null, e2=null; try { String accessorName = accessorName( "get", propName ); method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); } catch ( Exception e ) { e1 = e; } if ( method == null ) try { String accessorName = accessorName( "is", propName ); method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); if ( method.getReturnType() != Boolean.TYPE ) method = null; } catch ( Exception e ) { e2 = e; } if ( method == null ) throw new ReflectError("Error in property getter: " +e1 + (e2!=null?" : "+e2:"") ); try { return invokeMethod( method, obj, args ); } catch(InvocationTargetException e) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static void setObjectProperty( Object obj, String propName, Object value) throws ReflectError, UtilEvalError { String accessorName = accessorName( "set", propName ); Object[] args = new Object[] { value }; Interpreter.debug("property access: "); try { Method method = resolveExpectedJavaMethod( null/*bcm*/, obj.getClass(), obj, accessorName, args, false ); invokeMethod( method, obj, args ); } catch ( InvocationTargetException e ) { throw new UtilEvalError("Property accessor threw exception: " +e.getTargetException() ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object invokeCompiledCommand( Class commandClass, Object [] args, Interpreter interpreter, CallStack callstack ) throws UtilEvalError { // add interpereter and namespace to args list Object[] invokeArgs = new Object[args.length + 2]; invokeArgs[0] = interpreter; invokeArgs[1] = callstack; System.arraycopy( args, 0, invokeArgs, 2, args.length ); BshClassManager bcm = interpreter.getClassManager(); try { return Reflect.invokeStaticMethod( bcm, commandClass, "invoke", invokeArgs ); } catch ( InvocationTargetException e ) { throw new UtilEvalError( "Error in compiled command: "+e.getTargetException() ); } catch ( ReflectError e ) { throw new UtilEvalError("Error invoking compiled command: "+e ); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
private static void checkFoundStaticMethod( Method method, boolean staticOnly, Class clas ) throws UtilEvalError { // We're looking for a static method but found an instance method if ( method != null && staticOnly && !isStatic( method ) ) throw new UtilEvalError( "Cannot reach instance method: " + StringUtil.methodString( method.getName(), method.getParameterTypes() ) + " from static context: "+ clas.getName() ); }
// in org/gjt/sp/jedit/bsh/Name.java
public Object toObject( CallStack callstack, Interpreter interpreter ) throws UtilEvalError { return toObject( callstack, interpreter, false ); }
// in org/gjt/sp/jedit/bsh/Name.java
synchronized public Object toObject( CallStack callstack, Interpreter interpreter, boolean forceClass ) throws UtilEvalError { reset(); Object obj = null; while( evalName != null ) obj = consumeNextObjectField( callstack, interpreter, forceClass, false/*autoalloc*/ ); if ( obj == null ) throw new InterpreterError("null value in toObject()"); return obj; }
// in org/gjt/sp/jedit/bsh/Name.java
private Object consumeNextObjectField( CallStack callstack, Interpreter interpreter, boolean forceClass, boolean autoAllocateThis ) throws UtilEvalError { /* Is it a simple variable name? Doing this first gives the correct Java precedence for vars vs. imported class names (at least in the simple case - see tests/precedence1.bsh). It should also speed things up a bit. */ if ( (evalBaseObject == null && !isCompound(evalName) ) && !forceClass ) { Object obj = resolveThisFieldReference( callstack, namespace, interpreter, evalName, false ); if ( obj != Primitive.VOID ) return completeRound( evalName, FINISHED, obj ); } /* Is it a bsh script variable reference? If we're just starting the eval of name (no base object) or we're evaluating relative to a This type reference check. */ String varName = prefix(evalName, 1); if ( ( evalBaseObject == null || evalBaseObject instanceof This ) && !forceClass ) { if ( Interpreter.DEBUG ) Interpreter.debug("trying to resolve variable: " + varName); Object obj; // switch namespace and special var visibility if ( evalBaseObject == null ) { obj = resolveThisFieldReference( callstack, namespace, interpreter, varName, false ); } else { obj = resolveThisFieldReference( callstack, ((This)evalBaseObject).namespace, interpreter, varName, true ); } if ( obj != Primitive.VOID ) { // Resolved the variable if ( Interpreter.DEBUG ) Interpreter.debug( "resolved variable: " + varName + " in namespace: "+namespace); return completeRound( varName, suffix(evalName), obj ); } } /* Is it a class name? If we're just starting eval of name try to make it, else fail. */ if ( evalBaseObject == null ) { if ( Interpreter.DEBUG ) Interpreter.debug( "trying class: " + evalName); /* Keep adding parts until we have a class */ Class clas = null; int i = 1; String className = null; for(; i <= countParts(evalName); i++) { className = prefix(evalName, i); if ( (clas = namespace.getClass(className)) != null ) break; } if ( clas != null ) { return completeRound( className, suffix( evalName, countParts(evalName)-i ), new ClassIdentifier(clas) ); } // not a class (or variable per above) if ( Interpreter.DEBUG ) Interpreter.debug( "not a class, trying var prefix "+evalName ); } // No variable or class found in 'this' type ref. // if autoAllocateThis then create one; a child 'this'. if ( ( evalBaseObject == null || evalBaseObject instanceof This ) && !forceClass && autoAllocateThis ) { NameSpace targetNameSpace = ( evalBaseObject == null ) ? namespace : ((This)evalBaseObject).namespace; Object obj = new NameSpace( targetNameSpace, "auto: "+varName ).getThis( interpreter ); targetNameSpace.setVariable( varName, obj, false ); return completeRound( varName, suffix(evalName), obj ); } /* If we didn't find a class or variable name (or prefix) above there are two possibilities: - If we are a simple name then we can pass as a void variable reference. - If we are compound then we must fail at this point. */ if ( evalBaseObject == null ) { if ( !isCompound(evalName) ) { return completeRound( evalName, FINISHED, Primitive.VOID ); } else throw new UtilEvalError( "Class or variable not found: " + evalName); } /* -------------------------------------------------------- After this point we're definitely evaluating relative to a base object. -------------------------------------------------------- */ /* Do some basic validity checks. */ if ( evalBaseObject == Primitive.NULL) // previous round produced null throw new UtilTargetError( new NullPointerException( "Null Pointer while evaluating: " +value ) ); if ( evalBaseObject == Primitive.VOID) // previous round produced void throw new UtilEvalError( "Undefined variable or class name while evaluating: "+value); if ( evalBaseObject instanceof Primitive) throw new UtilEvalError("Can't treat primitive like an object. "+ "Error while evaluating: "+value); /* Resolve relative to a class type static field, inner class, ? */ if ( evalBaseObject instanceof ClassIdentifier ) { Class clas = ((ClassIdentifier)evalBaseObject).getTargetClass(); String field = prefix(evalName, 1); // Class qualified 'this' reference from inner class. // e.g. 'MyOuterClass.this' if ( field.equals("this") ) { // find the enclosing class instance space of the class name NameSpace ns = namespace; while ( ns != null ) { // getClassInstance() throws exception if not there if ( ns.classInstance != null && ns.classInstance.getClass() == clas ) return completeRound( field, suffix(evalName), ns.classInstance ); ns=ns.getParent(); } throw new UtilEvalError( "Can't find enclosing 'this' instance of class: "+clas); } Object obj = null; // static field? try { if ( Interpreter.DEBUG ) Interpreter.debug("Name call to getStaticFieldValue, class: " +clas+", field:"+field); obj = Reflect.getStaticFieldValue(clas, field); } catch( ReflectError e ) { if ( Interpreter.DEBUG ) Interpreter.debug("field reflect error: "+e); } // inner class? if ( obj == null ) { String iclass = clas.getName()+"$"+field; Class c = namespace.getClass( iclass ); if ( c != null ) obj = new ClassIdentifier(c); } if ( obj == null ) throw new UtilEvalError( "No static field or inner class: " + field + " of " + clas ); return completeRound( field, suffix(evalName), obj ); } /* If we've fallen through here we are no longer resolving to a class type. */ if ( forceClass ) throw new UtilEvalError( value +" does not resolve to a class name." ); /* Some kind of field access? */ String field = prefix(evalName, 1); // length access on array? if ( field.equals("length") && evalBaseObject.getClass().isArray() ) { Object obj = new Primitive(Array.getLength(evalBaseObject)); return completeRound( field, suffix(evalName), obj ); } // Check for field on object // Note: could eliminate throwing the exception somehow try { Object obj = Reflect.getObjectFieldValue(evalBaseObject, field); return completeRound( field, suffix(evalName), obj ); } catch(ReflectError e) { /* not a field */ } // if we get here we have failed throw new UtilEvalError( "Cannot access field: " + field + ", on object: " + evalBaseObject); }
// in org/gjt/sp/jedit/bsh/Name.java
Object resolveThisFieldReference( CallStack callstack, NameSpace thisNameSpace, Interpreter interpreter, String varName, boolean specialFieldsVisible ) throws UtilEvalError { if ( varName.equals("this") ) { /* Somewhat of a hack. If the special fields are visible (we're operating relative to a 'this' type already) dissallow further .this references to prevent user from skipping to things like super.this.caller */ if ( specialFieldsVisible ) throw new UtilEvalError("Redundant to call .this on This type"); // Allow getThis() to work through BlockNameSpace to the method // namespace // XXX re-eval this... do we need it? This ths = thisNameSpace.getThis( interpreter ); thisNameSpace= ths.getNameSpace(); Object result = ths; NameSpace classNameSpace = getClassNameSpace( thisNameSpace ); if ( classNameSpace != null ) { if ( isCompound( evalName ) ) result = classNameSpace.getThis( interpreter ); else result = classNameSpace.getClassInstance(); } return result; } /* Some duplication for "super". See notes for "this" above If we're in an enclsing class instance and have a superclass instance our super is the superclass instance. */ if ( varName.equals("super") ) { //if ( specialFieldsVisible ) //throw new UtilEvalError("Redundant to call .this on This type"); // Allow getSuper() to through BlockNameSpace to the method's super This ths = thisNameSpace.getSuper( interpreter ); thisNameSpace = ths.getNameSpace(); // super is now the closure's super or class instance // XXXX re-evaluate this // can getSuper work by itself now? // If we're a class instance and the parent is also a class instance // then super means our parent. if ( thisNameSpace.getParent() != null && thisNameSpace.getParent().isClass ) ths = thisNameSpace.getParent().getThis( interpreter ); return ths; } Object obj = null; if ( varName.equals("global") ) obj = thisNameSpace.getGlobal( interpreter ); if ( obj == null && specialFieldsVisible ) { if (varName.equals("namespace")) obj = thisNameSpace; else if (varName.equals("variables")) obj = thisNameSpace.getVariableNames(); else if (varName.equals("methods")) obj = thisNameSpace.getMethodNames(); else if ( varName.equals("interpreter") ) if ( lastEvalName.equals("this") ) obj = interpreter; else throw new UtilEvalError( "Can only call .interpreter on literal 'this'"); } if ( obj == null && specialFieldsVisible && varName.equals("caller") ) { if ( lastEvalName.equals("this") || lastEvalName.equals("caller") ) { // get the previous context (see notes for this class) if ( callstack == null ) throw new InterpreterError("no callstack"); obj = callstack.get( ++callstackDepth ).getThis( interpreter ); } else throw new UtilEvalError( "Can only call .caller on literal 'this' or literal '.caller'"); // early return return obj; } if ( obj == null && specialFieldsVisible && varName.equals("callstack") ) { if ( lastEvalName.equals("this") ) { // get the previous context (see notes for this class) if ( callstack == null ) throw new InterpreterError("no callstack"); obj = callstack; } else throw new UtilEvalError( "Can only call .callstack on literal 'this'"); } if ( obj == null ) obj = thisNameSpace.getVariable(varName); if ( obj == null ) throw new InterpreterError("null this field ref:"+varName); return obj; }
// in org/gjt/sp/jedit/bsh/Name.java
synchronized public Class toClass() throws ClassNotFoundException, UtilEvalError { if ( asClass != null ) return asClass; reset(); // "var" means untyped, return null class if ( evalName.equals("var") ) return asClass = null; /* Try straightforward class name first */ Class clas = namespace.getClass( evalName ); if ( clas == null ) { /* Try toObject() which knows how to work through inner classes and see what we end up with */ Object obj = null; try { // Null interpreter and callstack references. // class only resolution should not require them. obj = toObject( null, null, true ); } catch ( UtilEvalError e ) { }; // couldn't resolve it if ( obj instanceof ClassIdentifier ) clas = ((ClassIdentifier)obj).getTargetClass(); } if ( clas == null ) throw new ClassNotFoundException( "Class: " + value+ " not found in namespace"); asClass = clas; return asClass; }
// in org/gjt/sp/jedit/bsh/Name.java
synchronized public LHS toLHS( CallStack callstack, Interpreter interpreter ) throws UtilEvalError { // Should clean this up to a single return statement reset(); LHS lhs; // Simple (non-compound) variable assignment e.g. x=5; if ( !isCompound(evalName) ) { if ( evalName.equals("this") ) throw new UtilEvalError("Can't assign to 'this'." ); // Interpreter.debug("Simple var LHS..."); lhs = new LHS( namespace, evalName, false/*bubble up if allowed*/); return lhs; } // Field e.g. foo.bar=5; Object obj = null; try { while( evalName != null && isCompound( evalName ) ) { obj = consumeNextObjectField( callstack, interpreter, false/*forcclass*/, true/*autoallocthis*/ ); } } catch( UtilEvalError e ) { throw new UtilEvalError( "LHS evaluation: " + e.getMessage() ); } // Finished eval and its a class. if ( evalName == null && obj instanceof ClassIdentifier ) throw new UtilEvalError("Can't assign to class: " + value ); if ( obj == null ) throw new UtilEvalError("Error in LHS: " + value ); // e.g. this.x=5; or someThisType.x=5; if ( obj instanceof This ) { // dissallow assignment to magic fields if ( evalName.equals("namespace") || evalName.equals("variables") || evalName.equals("methods") || evalName.equals("caller") ) throw new UtilEvalError( "Can't assign to special variable: "+evalName ); Interpreter.debug("found This reference evaluating LHS"); /* If this was a literal "super" reference then we allow recursion in setting the variable to get the normal effect of finding the nearest definition starting at the super scope. On any other resolution qualified by a 'this' type reference we want to set the variable directly in that scope. e.g. this.x=5; or someThisType.x=5; In the old scoping rules super didn't do this. */ boolean localVar = !lastEvalName.equals("super"); return new LHS( ((This)obj).namespace, evalName, localVar ); } if ( evalName != null ) { try { if ( obj instanceof ClassIdentifier ) { Class clas = ((ClassIdentifier)obj).getTargetClass(); lhs = Reflect.getLHSStaticField(clas, evalName); return lhs; } else { lhs = Reflect.getLHSObjectField(obj, evalName); return lhs; } } catch(ReflectError e) { throw new UtilEvalError("Field access: "+e); } } throw new InterpreterError("Internal error in lhs..."); }
// in org/gjt/sp/jedit/bsh/Name.java
public Object invokeMethod( Interpreter interpreter, Object[] args, CallStack callstack, SimpleNode callerInfo ) throws UtilEvalError, EvalError, ReflectError, InvocationTargetException { String methodName = Name.suffix(value, 1); BshClassManager bcm = interpreter.getClassManager(); NameSpace namespace = callstack.top(); // Optimization - If classOfStaticMethod is set then we have already // been here and determined that this is a static method invocation. // Note: maybe factor this out with path below... clean up. if ( classOfStaticMethod != null ) { return Reflect.invokeStaticMethod( bcm, classOfStaticMethod, methodName, args ); } if ( !Name.isCompound(value) ) return invokeLocalMethod( interpreter, args, callstack, callerInfo ); // Note: if we want methods declared inside blocks to be accessible via // this.methodname() inside the block we could handle it here as a // special case. See also resolveThisFieldReference() special handling // for BlockNameSpace case. They currently work via the direct name // e.g. methodName(). String prefix = Name.prefix(value); // Superclass method invocation? (e.g. super.foo()) if ( prefix.equals("super") && Name.countParts(value) == 2 ) { // Allow getThis() to work through block namespaces first This ths = namespace.getThis( interpreter ); NameSpace thisNameSpace = ths.getNameSpace(); NameSpace classNameSpace = getClassNameSpace( thisNameSpace ); if ( classNameSpace != null ) { Object instance = classNameSpace.getClassInstance(); return ClassGenerator.getClassGenerator() .invokeSuperclassMethod( bcm, instance, methodName, args ); } } // Find target object or class identifier Name targetName = namespace.getNameResolver( prefix ); Object obj = targetName.toObject( callstack, interpreter ); if ( obj == Primitive.VOID ) throw new UtilEvalError( "Attempt to resolve method: "+methodName +"() on undefined variable or class name: "+targetName); // if we've got an object, resolve the method if ( !(obj instanceof ClassIdentifier) ) { if (obj instanceof Primitive) { if (obj == Primitive.NULL) throw new UtilTargetError( new NullPointerException( "Null Pointer in Method Invocation" ) ); // some other primitive // should avoid calling methods on primitive, as we do // in Name (can't treat primitive like an object message) // but the hole is useful right now. if ( Interpreter.DEBUG ) interpreter.debug( "Attempt to access method on primitive..." + " allowing bsh.Primitive to peek through for debugging"); } // found an object and it's not an undefined variable return Reflect.invokeObjectMethod( obj, methodName, args, interpreter, callstack, callerInfo ); } // It's a class // try static method if ( Interpreter.DEBUG ) Interpreter.debug("invokeMethod: trying static - " + targetName); Class clas = ((ClassIdentifier)obj).getTargetClass(); // cache the fact that this is a static method invocation on this class classOfStaticMethod = clas; if ( clas != null ) return Reflect.invokeStaticMethod( bcm, clas, methodName, args ); // return null; ??? throw new UtilEvalError("invokeMethod: unknown target: " + targetName); }
// in org/gjt/sp/jedit/bsh/ExternalNameSpace.java
void setVariable( String name, Object value, boolean strictJava, boolean recurse ) throws UtilEvalError { super.setVariable( name, value, strictJava, recurse ); putExternalMap( name, value ); }
// in org/gjt/sp/jedit/bsh/ExternalNameSpace.java
protected Variable getVariableImpl( String name, boolean recurse ) throws UtilEvalError { // check the external map for the variable name Object value = externalMap.get( name ); Variable var; if ( value == null ) { // The var is not in external map and it should therefore not be // found in local scope (it may have been removed via the map). // Clear it prophalactically. super.unsetVariable( name ); // Search parent for var if applicable. var = super.getVariableImpl( name, recurse ); } else { // Var in external map may be found in local scope with type and // modifier info. Variable localVar = super.getVariableImpl( name, false ); // If not in local scope then it was added via the external map, // we'll wrap it and pass it along. Else we'll use the local // version. if ( localVar == null ) var = new Variable( name, (Class)null, value, (Modifiers)null ); else var = localVar; } return var; }
// in org/gjt/sp/jedit/bsh/ExternalNameSpace.java
public void setTypedVariable( String name, Class type, Object value, Modifiers modifiers ) throws UtilEvalError { super.setTypedVariable( name, type, value, modifiers ); putExternalMap( name, value ); }
// in org/gjt/sp/jedit/bsh/ExternalNameSpace.java
public void setMethod( String name, BshMethod method ) throws UtilEvalError { super.setMethod( name, method ); }
// in org/gjt/sp/jedit/bsh/ExternalNameSpace.java
public BshMethod getMethod( String name, Class [] sig, boolean declaredOnly ) throws UtilEvalError { return super.getMethod( name, sig, declaredOnly ); }
// in org/gjt/sp/jedit/bsh/BlockNameSpace.java
public void setVariable( String name, Object value, boolean strictJava, boolean recurse ) throws UtilEvalError { if ( weHaveVar( name ) ) // set the var here in the block namespace super.setVariable( name, value, strictJava, false ); else // set the var in the enclosing (parent) namespace getParent().setVariable( name, value, strictJava, recurse ); }
// in org/gjt/sp/jedit/bsh/BlockNameSpace.java
public void setBlockVariable( String name, Object value ) throws UtilEvalError { super.setVariable( name, value, false/*strict?*/, false ); }
// in org/gjt/sp/jedit/bsh/BlockNameSpace.java
public void setMethod(String name, BshMethod method) throws UtilEvalError { getParent().setMethod( name, method ); }
// in org/gjt/sp/jedit/bsh/Types.java
public static Object castObject( Object fromValue, Class toType, int operation ) throws UtilEvalError { if ( fromValue == null ) throw new InterpreterError("null fromValue"); Class fromType = fromValue instanceof Primitive ? ((Primitive)fromValue).getType() : fromValue.getClass(); return castObject( toType, fromType, fromValue, operation, false/*checkonly*/ ); }
// in org/gjt/sp/jedit/bsh/Types.java
private static Object castObject( Class toType, Class fromType, Object fromValue, int operation, boolean checkOnly ) throws UtilEvalError { /* Lots of preconditions checked here... Once things are running smoothly we might comment these out (That's what assertions are for). */ if ( checkOnly && fromValue != null ) throw new InterpreterError("bad cast params 1"); if ( !checkOnly && fromValue == null ) throw new InterpreterError("bad cast params 2"); if ( fromType == Primitive.class ) throw new InterpreterError("bad from Type, need to unwrap"); if ( fromValue == Primitive.NULL && fromType != null ) throw new InterpreterError("inconsistent args 1"); if ( fromValue == Primitive.VOID && fromType != Void.TYPE ) throw new InterpreterError("inconsistent args 2"); if ( toType == Void.TYPE ) throw new InterpreterError("loose toType should be null"); // assignment to loose type, void type, or exactly same type if ( toType == null || toType == fromType ) return checkOnly ? VALID_CAST : fromValue; // Casting to primitive type if ( toType.isPrimitive() ) { if ( fromType == Void.TYPE || fromType == null || fromType.isPrimitive() ) { // Both primitives, do primitive cast return Primitive.castPrimitive( toType, fromType, (Primitive)fromValue, checkOnly, operation ); } else { if ( Primitive.isWrapperType( fromType ) ) { // wrapper to primitive // Convert value to Primitive and check/cast it. //Object r = checkOnly ? VALID_CAST : Class unboxedFromType = Primitive.unboxType( fromType ); Primitive primFromValue; if ( checkOnly ) primFromValue = null; // must be null in checkOnly else primFromValue = (Primitive)Primitive.wrap( fromValue, unboxedFromType ); return Primitive.castPrimitive( toType, unboxedFromType, primFromValue, checkOnly, operation ); } else { // Cannot cast from arbitrary object to primitive if ( checkOnly ) return INVALID_CAST; else throw castError( toType, fromType, operation ); } } } // Else, casting to reference type // Casting from primitive or void (to reference type) if ( fromType == Void.TYPE || fromType == null || fromType.isPrimitive() ) { // cast from primitive to wrapper type if ( Primitive.isWrapperType( toType ) && fromType != Void.TYPE && fromType != null ) { // primitive to wrapper type return checkOnly ? VALID_CAST : Primitive.castWrapper( Primitive.unboxType(toType), ((Primitive)fromValue).getValue() ); } // Primitive (not null or void) to Object.class type if ( toType == Object.class && fromType != Void.TYPE && fromType != null ) { // box it return checkOnly ? VALID_CAST : ((Primitive)fromValue).getValue(); } // Primitive to arbitrary object type. // Allow Primitive.castToType() to handle it as well as cases of // Primitive.NULL and Primitive.VOID return Primitive.castPrimitive( toType, fromType, (Primitive)fromValue, checkOnly, operation ); } // If type already assignable no cast necessary // We do this last to allow various errors above to be caught. // e.g cast Primitive.Void to Object would pass this if ( toType.isAssignableFrom( fromType ) ) return checkOnly ? VALID_CAST : fromValue; // Can we use the proxy mechanism to cast a bsh.This to // the correct interface? if ( toType.isInterface() && org.gjt.sp.jedit.bsh.This.class.isAssignableFrom( fromType ) && Capabilities.canGenerateInterfaces() ) return checkOnly ? VALID_CAST : ((org.gjt.sp.jedit.bsh.This)fromValue).getInterface( toType ); // Both numeric wrapper types? // Try numeric style promotion wrapper cast if ( Primitive.isWrapperType( toType ) && Primitive.isWrapperType( fromType ) ) return checkOnly ? VALID_CAST : Primitive.castWrapper( toType, fromValue ); if ( checkOnly ) return INVALID_CAST; else throw castError( toType, fromType , operation ); }
// in org/gjt/sp/jedit/bsh/classpath/ClassManagerImpl.java
public void doSuperImport() throws UtilEvalError { // Should we prevent it from happening twice? try { getClassPath().insureInitialized(); // prime the lookup table getClassNameByUnqName( "" ) ; // always true now //getClassPath().setNameCompletionIncludeUnqNames(true); } catch ( ClassPathException e ) { throw new UtilEvalError("Error importing classpath "+ e ); } superImport = true; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
Object getClassInstance() throws UtilEvalError { if ( classInstance != null ) return classInstance; if ( classStatic != null //|| ( getParent()!=null && getParent().classStatic != null ) ) throw new UtilEvalError( "Can't refer to class instance from static context."); else throw new InterpreterError( "Can't resolve class instance 'this' in: "+this); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public Object get( String name, Interpreter interpreter ) throws UtilEvalError { CallStack callstack = new CallStack( this ); return getNameResolver( name ).toObject( callstack, interpreter ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public void setVariable( String name, Object value, boolean strictJava ) throws UtilEvalError { // if localscoping switch follow strictJava, else recurse boolean recurse = Interpreter.LOCALSCOPING ? strictJava : true; setVariable( name, value, strictJava, recurse ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
void setLocalVariable( String name, Object value, boolean strictJava ) throws UtilEvalError { setVariable( name, value, strictJava, false/*recurse*/ ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
void setVariable( String name, Object value, boolean strictJava, boolean recurse ) throws UtilEvalError { if ( variables == null ) variables = new Hashtable(); // primitives should have been wrapped // {{{ jEdit change //if ( value == null ) // throw new InterpreterError("null variable value"); if ( value == null ) { // don't break jEdit core and plugins! unsetVariable(name); return; } // }}} // Locate the variable definition if it exists. Variable existing = getVariableImpl( name, recurse ); // Found an existing variable here (or above if recurse allowed) if ( existing != null ) { try { existing.setValue( value, Variable.ASSIGNMENT ); } catch ( UtilEvalError e ) { throw new UtilEvalError( "Variable assignment: " + name + ": " + e.getMessage()); } } else // No previous variable definition found here (or above if recurse) { if ( strictJava ) throw new UtilEvalError( "(Strict Java mode) Assignment to undeclared variable: " +name ); // If recurse, set global untyped var, else set it here. //NameSpace varScope = recurse ? getGlobal() : this; // This modification makes default allocation local NameSpace varScope = this; varScope.variables.put( name, new Variable( name, value, null/*modifiers*/ ) ); // nameSpaceChanged() on new variable addition nameSpaceChanged(); } }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public Object getVariable( String name ) throws UtilEvalError { return getVariable( name, true ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public Object getVariable( String name, boolean recurse ) throws UtilEvalError { Variable var = getVariableImpl( name, recurse ); return unwrapVariable( var ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
protected Variable getVariableImpl( String name, boolean recurse ) throws UtilEvalError { Variable var = null; // Change import precedence if we are a class body/instance // Get imported first. if ( var == null && isClass ) var = getImportedVar( name ); if ( var == null && variables != null ) var = (Variable)variables.get(name); // Change import precedence if we are a class body/instance if ( var == null && !isClass ) var = getImportedVar( name ); // try parent if ( recurse && (var == null) && (parent != null) ) var = parent.getVariableImpl( name, recurse ); return var; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
protected Object unwrapVariable( Variable var ) throws UtilEvalError { return (var == null) ? Primitive.VOID : var.getValue(); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public void setTypedVariable( String name, Class type, Object value, boolean isFinal ) throws UtilEvalError { Modifiers modifiers = new Modifiers(); if ( isFinal ) modifiers.addModifier( Modifiers.FIELD, "final" ); setTypedVariable( name, type, value, modifiers ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public void setTypedVariable( String name, Class type, Object value, Modifiers modifiers ) throws UtilEvalError { //checkVariableModifiers( name, modifiers ); if ( variables == null ) variables = new Hashtable(); // Setting a typed variable is always a local operation. Variable existing = getVariableImpl( name, false/*recurse*/ ); // Null value is just a declaration // Note: we might want to keep any existing value here instead of reset /* // Moved to Variable if ( value == null ) value = Primitive.getDefaultValue( type ); */ // does the variable already exist? if ( existing != null ) { // Is it typed? if ( existing.getType() != null ) { // If it had a different type throw error. // This allows declaring the same var again, but not with // a different (even if assignable) type. if ( existing.getType() != type ) { throw new UtilEvalError( "Typed variable: "+name +" was previously declared with type: " + existing.getType() ); } else { // else set it and return existing.setValue( value, Variable.DECLARATION ); return; } } // Careful here: // else fall through to override and install the new typed version } // Add the new typed var variables.put( name, new Variable( name, type, value, modifiers ) ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public void setMethod( String name, BshMethod method ) throws UtilEvalError { //checkMethodModifiers( method ); if ( methods == null ) methods = new Hashtable(); Object m = methods.get(name); //{{{ jEdit version: properly handle methods with same signature. if (m == null) methods.put(name, method); else if (m instanceof BshMethod) { // is the new method overriding the old method? if (Arrays.equals(((BshMethod)m).getParameterTypes(), method.getParameterTypes())) { methods.put(name, method); } else { Vector v = new Vector(); v.addElement( m ); v.addElement( method ); methods.put( name, v ); } } else { Vector _methods = (Vector) m; for (int i = 0; i < _methods.size(); i++) { // Check whether the new method overrides some old // method in the list. BshMethod _old_m = (BshMethod) _methods.get(i); if (Arrays.equals(_old_m.getParameterTypes(), method.getParameterTypes())) { _methods.remove(i); break; } } _methods.addElement( method ); } //}}} //{{{ Original BeanShell code // if ( m == null ) // methods.put(name, method); // else // if ( m instanceof BshMethod ) { // Vector v = new Vector(); // v.addElement( m ); // v.addElement( method ); // methods.put( name, v ); // } else // Vector // ((Vector)m).addElement( method ); //}}} }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public BshMethod getMethod( String name, Class [] sig ) throws UtilEvalError { return getMethod( name, sig, false/*declaredOnly*/ ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public BshMethod getMethod( String name, Class [] sig, boolean declaredOnly ) throws UtilEvalError { BshMethod method = null; // Change import precedence if we are a class body/instance // Get import first. if ( method == null && isClass && !declaredOnly ) method = getImportedMethod( name, sig ); Object m = null; if ( method == null && methods != null ) { m = methods.get(name); // m contains either BshMethod or Vector of BshMethod if ( m != null ) { // unwrap BshMethod [] ma; if ( m instanceof Vector ) { Vector vm = (Vector)m; ma = new BshMethod[ vm.size() ]; vm.copyInto( ma ); } else ma = new BshMethod[] { (BshMethod)m }; // Apply most specific signature matching Class [][] candidates = new Class[ ma.length ][]; for( int i=0; i< ma.length; i++ ) candidates[i] = ma[i].getParameterTypes(); int match = Reflect.findMostSpecificSignature( sig, candidates ); if ( match != -1 ) method = ma[match]; } } if ( method == null && !isClass && !declaredOnly ) method = getImportedMethod( name, sig ); // try parent if ( !declaredOnly && (method == null) && (parent != null) ) return parent.getMethod( name, sig ); return method; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public Object getCommand( String name, Class [] argTypes, Interpreter interpreter ) throws UtilEvalError { if (Interpreter.DEBUG) Interpreter.debug("getCommand: "+name); BshClassManager bcm = interpreter.getClassManager(); InputStream in = getCommand( name ); if ( in != null ) return loadScriptedCommand( in, name, argTypes, name, interpreter ); /* // Chop leading "/" and change "/" to "." String className; if ( path.equals("/") ) className = name; else className = path.substring(1).replace('/','.') +"."+name; Class clas = bcm.classForName( className ); if ( clas != null ) return clas; */ if ( parent != null ) return parent.getCommand( name, argTypes, interpreter ); else return null; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
protected BshMethod getImportedMethod( String name, Class [] sig ) throws UtilEvalError { // Try object imports if ( importedObjects != null ) for(int i=0; i<importedObjects.size(); i++) { Object object = importedObjects.elementAt(i); Class clas = object.getClass(); Method method = Reflect.resolveJavaMethod( getClassManager(), clas, name, sig, false/*onlyStatic*/ ); if ( method != null ) return new BshMethod( method, object ); } // Try static imports if ( importedStatic!= null ) for(int i=0; i<importedStatic.size(); i++) { Class clas = (Class)importedStatic.elementAt(i); Method method = Reflect.resolveJavaMethod( getClassManager(), clas, name, sig, true/*onlyStatic*/ ); if ( method != null ) return new BshMethod( method, null/*object*/ ); } return null; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
protected Variable getImportedVar( String name ) throws UtilEvalError { // Try object imports if ( importedObjects != null ) for(int i=0; i<importedObjects.size(); i++) { Object object = importedObjects.elementAt(i); Class clas = object.getClass(); Field field = Reflect.resolveJavaField( clas, name, false/*onlyStatic*/ ); if ( field != null ) return new Variable( name, field.getType(), new LHS( object, field ) ); } // Try static imports if ( importedStatic!= null ) for(int i=0; i<importedStatic.size(); i++) { Class clas = (Class)importedStatic.elementAt(i); Field field = Reflect.resolveJavaField( clas, name, true/*onlyStatic*/ ); if ( field != null ) return new Variable( name, field.getType(), new LHS( field ) ); } return null; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
private BshMethod loadScriptedCommand( InputStream in, String name, Class [] argTypes, String resourcePath, Interpreter interpreter ) throws UtilEvalError { try { interpreter.eval( new InputStreamReader(in), this, resourcePath ); } catch ( EvalError e ) { /* Here we catch any EvalError from the interpreter because we are using it as a tool to load the command, not as part of the execution path. */ Interpreter.debug( e.toString() ); throw new UtilEvalError( "Error loading script: "+ e.getMessage()); } // Look for the loaded command BshMethod meth = getMethod( name, argTypes ); /* if ( meth == null ) throw new UtilEvalError("Loaded resource: " + resourcePath + "had an error or did not contain the correct method" ); */ return meth; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public Class getClass( String name ) throws UtilEvalError { Class c = getClassImpl(name); if ( c != null ) return c; else // implement the recursion for getClassImpl() if ( parent != null ) return parent.getClass( name ); else return null; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
private Class getClassImpl( String name ) throws UtilEvalError { Class c = null; // Check the cache if (classCache != null) { c = (Class)classCache.get(name); if ( c != null ) return c; } // Unqualified (simple, non-compound) name boolean unqualifiedName = !Name.isCompound(name); // Unqualified name check imported if ( unqualifiedName ) { // Try imported class if ( c == null ) c = getImportedClassImpl( name ); // if found as imported also cache it if ( c != null ) { cacheClass( name, c ); return c; } } // Try absolute c = classForName( name ); if ( c != null ) { // Cache unqualified names to prevent import check again if ( unqualifiedName ) cacheClass( name, c ); return c; } // Not found if ( Interpreter.DEBUG ) Interpreter.debug("getClass(): " + name + " not found in "+this); return null; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
private Class getImportedClassImpl( String name ) throws UtilEvalError { // Try explicitly imported class, e.g. import foo.Bar; String fullname = null; if ( importedClasses != null ) fullname = (String)importedClasses.get(name); // not sure if we should really recurse here for explicitly imported // class in parent... if ( fullname != null ) { /* Found the full name in imported classes. */ // Try to make the full imported name Class clas=classForName(fullname); // Handle imported inner class case if ( clas == null ) { // Imported full name wasn't found as an absolute class // If it is compound, try to resolve to an inner class. // (maybe this should happen in the BshClassManager?) if ( Name.isCompound( fullname ) ) try { clas = getNameResolver( fullname ).toClass(); } catch ( ClassNotFoundException e ) { /* not a class */ } else if ( Interpreter.DEBUG ) Interpreter.debug( "imported unpackaged name not found:" +fullname); // If found cache the full name in the BshClassManager if ( clas != null ) { // (should we cache info in not a class case too?) getClassManager().cacheClassInfo( fullname, clas ); return clas; } } else return clas; // It was explicitly imported, but we don't know what it is. // should we throw an error here?? return null; } /* Try imported packages, e.g. "import foo.bar.*;" in reverse order of import... (give later imports precedence...) */ if ( importedPackages != null ) for(int i=importedPackages.size()-1; i>=0; i--) { String s = ((String)importedPackages.elementAt(i)) + "." + name; Class c=classForName(s); if ( c != null ) return c; } BshClassManager bcm = getClassManager(); /* Try super import if available Note: we do this last to allow explicitly imported classes and packages to take priority. This method will also throw an error indicating ambiguity if it exists... */ if ( bcm.hasSuperImport() ) { String s = bcm.getClassNameByUnqName( name ); if ( s != null ) return classForName( s ); } return null; }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public void doSuperImport() throws UtilEvalError { getClassManager().doSuperImport(); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
public void setVariable(String name, Object value) throws UtilEvalError { setVariable(name,value,false); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
public void setClassPath( URL [] cp ) throws UtilEvalError { throw cmUnavailable(); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
public void reloadAllClasses() throws UtilEvalError { throw cmUnavailable(); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
public void reloadClasses( String [] classNames ) throws UtilEvalError { throw cmUnavailable(); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
public void reloadPackage( String pack ) throws UtilEvalError { throw cmUnavailable(); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
protected void doSuperImport() throws UtilEvalError { throw cmUnavailable(); }
// in org/gjt/sp/jedit/bsh/BshClassManager.java
protected String getClassNameByUnqName( String name ) throws UtilEvalError { throw cmUnavailable(); }
// in org/gjt/sp/jedit/bsh/ClassGenerator.java
public static ClassGenerator getClassGenerator() throws UtilEvalError { if ( cg == null ) { try { Class clas = Class.forName( "org.gjt.sp.jedit.bsh.ClassGeneratorImpl" ); cg = (ClassGenerator)clas.newInstance(); } catch ( Exception e ) { throw new Unavailable("ClassGenerator unavailable: "+e); } } return cg; }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
private Object operation( Object lhs, Object rhs, int kind ) throws UtilEvalError { /* Implement String += value; According to the JLS, value may be anything. In BeanShell, we'll disallow VOID (undefined) values. (or should we map them to the empty string?) */ if ( lhs instanceof String && rhs != Primitive.VOID ) { if ( kind != PLUS ) throw new UtilEvalError( "Use of non + operator with String LHS" ); return (String)lhs + rhs; } if ( lhs instanceof Primitive || rhs instanceof Primitive ) if(lhs == Primitive.VOID || rhs == Primitive.VOID) throw new UtilEvalError( "Illegal use of undefined object or 'void' literal" ); else if ( lhs == Primitive.NULL || rhs == Primitive.NULL ) throw new UtilEvalError( "Illegal use of null object or 'null' literal" ); if( (lhs instanceof Boolean || lhs instanceof Character || lhs instanceof Number || lhs instanceof Primitive) && (rhs instanceof Boolean || rhs instanceof Character || rhs instanceof Number || rhs instanceof Primitive) ) { return Primitive.binaryOperation(lhs, rhs, kind); } throw new UtilEvalError("Non primitive value in operator: " + lhs.getClass() + " " + tokenImage[kind] + " " + rhs.getClass() ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
public static Object binaryOperation( Object obj1, Object obj2, int kind) throws UtilEvalError { // special primitive types if ( obj1 == NULL || obj2 == NULL ) throw new UtilEvalError( "Null value or 'null' literal in binary operation"); if ( obj1 == VOID || obj2 == VOID ) throw new UtilEvalError( "Undefined variable, class, or 'void' literal in binary operation"); // keep track of the original types Class lhsOrgType = obj1.getClass(); Class rhsOrgType = obj2.getClass(); // Unwrap primitives if ( obj1 instanceof Primitive ) obj1 = ((Primitive)obj1).getValue(); if ( obj2 instanceof Primitive ) obj2 = ((Primitive)obj2).getValue(); Object[] operands = promotePrimitives(obj1, obj2); Object lhs = operands[0]; Object rhs = operands[1]; if(lhs.getClass() != rhs.getClass()) throw new UtilEvalError("Type mismatch in operator. " + lhs.getClass() + " cannot be used with " + rhs.getClass() ); Object result; try { result = binaryOperationImpl( lhs, rhs, kind ); } catch ( ArithmeticException e ) { throw new UtilTargetError( "Arithemetic Exception in binary op", e); } // If both original args were Primitives return a Primitive result // else it was mixed (wrapper/primitive) return the wrapper type // Exception is for boolean result, return the primitive if ( (lhsOrgType == Primitive.class && rhsOrgType == Primitive.class) || result instanceof Boolean ) return new Primitive( result ); else return result; }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object binaryOperationImpl( Object lhs, Object rhs, int kind ) throws UtilEvalError { if(lhs instanceof Boolean) return booleanBinaryOperation((Boolean)lhs, (Boolean)rhs, kind); else if(lhs instanceof Integer) return intBinaryOperation( (Integer)lhs, (Integer)rhs, kind ); else if(lhs instanceof Long) return longBinaryOperation((Long)lhs, (Long)rhs, kind); else if(lhs instanceof Float) return floatBinaryOperation((Float)lhs, (Float)rhs, kind); else if(lhs instanceof Double) return doubleBinaryOperation( (Double)lhs, (Double)rhs, kind); else throw new UtilEvalError("Invalid types in binary operator" ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object doubleBinaryOperation(Double D1, Double D2, int kind) throws UtilEvalError { double lhs = D1.doubleValue(); double rhs = D2.doubleValue(); switch(kind) { // boolean case LT: case LTX: return new Boolean(lhs < rhs); case GT: case GTX: return new Boolean(lhs > rhs); case EQ: return new Boolean(lhs == rhs); case LE: case LEX: return new Boolean(lhs <= rhs); case GE: case GEX: return new Boolean(lhs >= rhs); case NE: return new Boolean(lhs != rhs); // arithmetic case PLUS: return new Double(lhs + rhs); case MINUS: return new Double(lhs - rhs); case STAR: return new Double(lhs * rhs); case SLASH: return new Double(lhs / rhs); case MOD: return new Double(lhs % rhs); // can't shift floating-point values case LSHIFT: case LSHIFTX: case RSIGNEDSHIFT: case RSIGNEDSHIFTX: case RUNSIGNEDSHIFT: case RUNSIGNEDSHIFTX: throw new UtilEvalError("Can't shift doubles"); default: throw new InterpreterError( "Unimplemented binary double operator"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Object floatBinaryOperation(Float F1, Float F2, int kind) throws UtilEvalError { float lhs = F1.floatValue(); float rhs = F2.floatValue(); switch(kind) { // boolean case LT: case LTX: return new Boolean(lhs < rhs); case GT: case GTX: return new Boolean(lhs > rhs); case EQ: return new Boolean(lhs == rhs); case LE: case LEX: return new Boolean(lhs <= rhs); case GE: case GEX: return new Boolean(lhs >= rhs); case NE: return new Boolean(lhs != rhs); // arithmetic case PLUS: return new Float(lhs + rhs); case MINUS: return new Float(lhs - rhs); case STAR: return new Float(lhs * rhs); case SLASH: return new Float(lhs / rhs); case MOD: return new Float(lhs % rhs); // can't shift floats case LSHIFT: case LSHIFTX: case RSIGNEDSHIFT: case RSIGNEDSHIFTX: case RUNSIGNEDSHIFT: case RUNSIGNEDSHIFTX: throw new UtilEvalError("Can't shift floats "); default: throw new InterpreterError( "Unimplemented binary float operator"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
public static Primitive unaryOperation(Primitive val, int kind) throws UtilEvalError { if (val == NULL) throw new UtilEvalError( "illegal use of null object or 'null' literal"); if (val == VOID) throw new UtilEvalError( "illegal use of undefined object or 'void' literal"); Class operandType = val.getType(); Object operand = promoteToInteger(val.getValue()); if ( operand instanceof Boolean ) return new Primitive(booleanUnaryOperation((Boolean)operand, kind)); else if(operand instanceof Integer) { int result = intUnaryOperation((Integer)operand, kind); // ++ and -- must be cast back the original type if(kind == INCR || kind == DECR) { if(operandType == Byte.TYPE) return new Primitive((byte)result); if(operandType == Short.TYPE) return new Primitive((short)result); if(operandType == Character.TYPE) return new Primitive((char)result); } return new Primitive(result); } else if(operand instanceof Long) return new Primitive(longUnaryOperation((Long)operand, kind)); else if(operand instanceof Float) return new Primitive(floatUnaryOperation((Float)operand, kind)); else if(operand instanceof Double) return new Primitive(doubleUnaryOperation((Double)operand, kind)); else throw new InterpreterError( "An error occurred. Please call technical support."); }
// in org/gjt/sp/jedit/bsh/Primitive.java
static boolean booleanUnaryOperation(Boolean B, int kind) throws UtilEvalError { boolean operand = B.booleanValue(); switch(kind) { case BANG: return !operand; default: throw new UtilEvalError("Operator inappropriate for boolean"); } }
// in org/gjt/sp/jedit/bsh/Primitive.java
public int intValue() throws UtilEvalError { if(value instanceof Number) return((Number)value).intValue(); else throw new UtilEvalError("Primitive not a number"); }
// in org/gjt/sp/jedit/bsh/Primitive.java
public boolean booleanValue() throws UtilEvalError { if(value instanceof Boolean) return((Boolean)value).booleanValue(); else throw new UtilEvalError("Primitive not a boolean"); }
// in org/gjt/sp/jedit/bsh/Primitive.java
public Number numberValue() throws UtilEvalError { Object value = this.value; // Promote character to Number type for these purposes if (value instanceof Character) value = new Integer(((Character)value).charValue()); if (value instanceof Number) return (Number)value; else throw new UtilEvalError("Primitive not a number"); }
// in org/gjt/sp/jedit/bsh/Primitive.java
public Primitive castToType( Class toType, int operation ) throws UtilEvalError { return castPrimitive( toType, getType()/*fromType*/, this/*fromValue*/, false/*checkOnly*/, operation ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
static Primitive castPrimitive( Class toType, Class fromType, Primitive fromValue, boolean checkOnly, int operation ) throws UtilEvalError { /* Lots of preconditions checked here... Once things are running smoothly we might comment these out (That's what assertions are for). */ if ( checkOnly && fromValue != null ) throw new InterpreterError("bad cast param 1"); if ( !checkOnly && fromValue == null ) throw new InterpreterError("bad cast param 2"); if ( fromType != null && !fromType.isPrimitive() ) throw new InterpreterError("bad fromType:" +fromType); if ( fromValue == Primitive.NULL && fromType != null ) throw new InterpreterError("inconsistent args 1"); if ( fromValue == Primitive.VOID && fromType != Void.TYPE ) throw new InterpreterError("inconsistent args 2"); // can't cast void to anything if ( fromType == Void.TYPE ) if ( checkOnly ) return Types.INVALID_CAST; else throw Types.castError( Reflect.normalizeClassName(toType), "void value", operation ); // unwrap Primitive fromValue to its wrapper value, etc. Object value = null; if ( fromValue != null ) value = fromValue.getValue(); if ( toType.isPrimitive() ) { // Trying to cast null to primitive type? if ( fromType == null ) if ( checkOnly ) return Types.INVALID_CAST; else throw Types.castError( "primitive type:" + toType, "Null value", operation ); // fall through } else { // Trying to cast primitive to an object type // Primitive.NULL can be cast to any object type if ( fromType == null ) return checkOnly ? Types.VALID_CAST : Primitive.NULL; if ( checkOnly ) return Types.INVALID_CAST; else throw Types.castError( "object type:" + toType, "primitive value", operation); } // can only cast boolean to boolean if ( fromType == Boolean.TYPE ) { if ( toType != Boolean.TYPE ) if ( checkOnly ) return Types.INVALID_CAST; else throw Types.castError( toType, fromType, operation ); return checkOnly ? Types.VALID_CAST : fromValue; } // Do numeric cast // Only allow legal Java assignment unless we're a CAST operation if ( operation == Types.ASSIGNMENT && !Types.isJavaAssignable( toType, fromType ) ) { if ( checkOnly ) return Types.INVALID_CAST; else throw Types.castError( toType, fromType, operation ); } return checkOnly ? Types.VALID_CAST : new Primitive( castWrapper(toType, value) ); }
// in org/gjt/sp/jedit/bsh/LHS.java
public Object getValue() throws UtilEvalError { if ( type == VARIABLE ) return nameSpace.getVariable( varName ); if (type == FIELD) try { Object o = field.get( object ); return Primitive.wrap( o, field.getType() ); } catch(IllegalAccessException e2) { throw new UtilEvalError("Can't read field: " + field); } if ( type == PROPERTY ) try { return Reflect.getObjectProperty(object, propName); } catch(ReflectError e) { Interpreter.debug(e.getMessage()); throw new UtilEvalError("No such property: " + propName); } if ( type == INDEX ) try { return Reflect.getIndex(object, index); } catch(Exception e) { throw new UtilEvalError("Array access: " + e); } throw new InterpreterError("LHS type"); }
// in org/gjt/sp/jedit/bsh/LHS.java
public Object assign( Object val, boolean strictJava ) throws UtilEvalError { if ( type == VARIABLE ) { // Set the variable in namespace according to localVar flag if ( localVar ) nameSpace.setLocalVariable( varName, val, strictJava ); else nameSpace.setVariable( varName, val, strictJava ); } else if ( type == FIELD ) { try { Object fieldVal = val instanceof Primitive ? ((Primitive)val).getValue() : val; // This should probably be in Reflect.java ReflectManager.RMSetAccessible( field ); field.set( object, fieldVal ); return val; } catch( NullPointerException e) { throw new UtilEvalError( "LHS ("+field.getName()+") not a static field."); } catch( IllegalAccessException e2) { throw new UtilEvalError( "LHS ("+field.getName()+") can't access field: "+e2); } catch( IllegalArgumentException e3) { String type = val instanceof Primitive ? ((Primitive)val).getType().getName() : val.getClass().getName(); throw new UtilEvalError( "Argument type mismatch. " + (val == null ? "null" : type ) + " not assignable to field "+field.getName()); } } else if ( type == PROPERTY ) { /* if ( object instanceof Hashtable ) ((Hashtable)object).put(propName, val); */ CollectionManager cm = CollectionManager.getCollectionManager(); if ( cm.isMap( object ) ) cm.putInMap( object/*map*/, propName, val ); else try { Reflect.setObjectProperty(object, propName, val); } catch(ReflectError e) { Interpreter.debug("Assignment: " + e.getMessage()); throw new UtilEvalError("No such property: " + propName); } } else if ( type == INDEX ) try { Reflect.setIndex(object, index, val); } catch ( UtilTargetError e1 ) { // pass along target error throw e1; } catch ( Exception e ) { throw new UtilEvalError("Assignment: " + e.getMessage()); } else throw new InterpreterError("unknown lhs"); return val; }
// in org/gjt/sp/jedit/BeanShellFacade.java
protected void setVariable(NameSpace nameSpace, String name, Object object) throws UtilEvalError { if (nameSpace.getVariable(name) == Primitive.VOID) nameSpace.setVariable(name,object, false); }
// in org/gjt/sp/jedit/BeanShell.java
Override protected void setupDefaultVariables(NameSpace namespace, View view) throws UtilEvalError { if(view != null) { EditPane editPane = view.getEditPane(); setVariable(namespace, "view", view); setVariable(namespace, "editPane",editPane); setVariable(namespace, "buffer",editPane.getBuffer()); setVariable(namespace, "textArea",editPane.getTextArea()); setVariable(namespace, "wm",view.getDockableWindowManager()); } }
// in org/gjt/sp/jedit/BeanShell.java
Override protected void resetDefaultVariables(NameSpace namespace) throws UtilEvalError { namespace.setVariable("view",null, false); namespace.setVariable("editPane",null, false); namespace.setVariable("buffer",null, false); namespace.setVariable("textArea",null, false); namespace.setVariable("wm",null, false); }
// in org/gjt/sp/jedit/JEditBeanShellAction.java
Override protected void setupDefaultVariables(NameSpace namespace, TextArea textArea) throws UtilEvalError { if(textArea != null) { setVariable(namespace, "buffer",textArea.getBuffer()); setVariable(namespace, "textArea",textArea); } }
// in org/gjt/sp/jedit/JEditBeanShellAction.java
Override protected void resetDefaultVariables(NameSpace namespace) throws UtilEvalError { namespace.setVariable("buffer",null, false); namespace.setVariable("textArea",null, false); }
71
            
// in org/gjt/sp/jedit/gui/DockableWindowFactory.java
catch(UtilEvalError e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/bsh/BSHUnaryExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch( UtilEvalError e ) { Interpreter.debug("doIndex: "+e); throw e.toEvalError( "Arrays may only be indexed by integer types.", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e) { throw e.toEvalError( "Property: "+value, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( UtilEvalError e ) { throw new InterpreterError( "Can't get class instance for synchronized method."); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch( UtilEvalError e) { throw new EvalError( "Invalid argument: " + "`"+paramNames[i]+"'" + " for method: " + name + " : " + e.getMessage(), callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( UtilEvalError e2 ) { throw e2.toEvalError( "Typed method parameter assignment", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( UtilEvalError e3 ) { throw e3.toEvalError( callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch( UtilEvalError e ) { // Point to return statement point if we had one. // (else it was implicit return? What's the case here?) SimpleNode node = callerInfo; if ( retControl != null ) node = retControl.returnPoint; throw e.toEvalError( "Incorrect type returned from method: " + name + e.getMessage(), node, callstack ); }
// in org/gjt/sp/jedit/bsh/This.java
catch ( UtilEvalError e ) { // leave null }
// in org/gjt/sp/jedit/bsh/This.java
catch ( UtilEvalError e ) { /*leave null*/ }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( UtilEvalError e ) { throw new InterpreterError("unable to init static: "+e ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( UtilEvalError e ) { // value error shouldn't happen }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( UtilEvalError e ) { throw e.toEvalError( callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( UtilEvalError e ) { throw new InterpreterError( "illegal argument type in method invocation: "+e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( UtilEvalError e ) { /*ignore*/ }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( UtilEvalError e ) { /*ignore*/ }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( UtilEvalError e ) { //e.printStackTrace(); throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( UtilEvalError e2 ) { // ClassPathException is a type of UtilEvalError throw e2.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/XThis.java
catch ( UtilEvalError e ) {/*leave null*/ }
// in org/gjt/sp/jedit/bsh/XThis.java
catch ( UtilEvalError e ) {/*leave null*/ }
// in org/gjt/sp/jedit/bsh/BSHCastExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimaryExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHTypedVariableDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
catch( UtilEvalError e ) { /* Catch the mismatch and continue to try the next Note: this is innefficient, should have an isAssignableFrom() that doesn't throw // TODO: we do now have a way to test assignment // in castObject(), use it? */ continue; }
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
catch ( UtilEvalError e ) { throw new InterpreterError( "Unable to set var in catch block namespace." ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { }
// in org/gjt/sp/jedit/bsh/Name.java
catch( UtilEvalError e ) { throw new UtilEvalError( "LHS evaluation: " + e.getMessage() ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError("Error loading command: ", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError("Error invoking compiled command: ", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/ExternalNameSpace.java
catch ( UtilEvalError ute ) { // There should be no case for this. unwrapVariable throws // UtilEvalError in some cases where it holds an LHS or array // index. throw new InterpreterError("unexpected UtilEvalError"); }
// in org/gjt/sp/jedit/bsh/BSHBinaryExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( UtilEvalError e ) { throw new InterpreterError("can't set cons var"); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( UtilEvalError e ) { throw new InterpreterError("err setting local cons arg:"+e); }
// in org/gjt/sp/jedit/bsh/BSHSwitchStatement.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Switch value: "+switchExp.getText()+": ", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BlockNameSpace.java
catch ( UtilEvalError e ) { return false; }
// in org/gjt/sp/jedit/bsh/Types.java
catch ( UtilEvalError e ) { // This should not happen with checkOnly true throw new InterpreterError("err in cast check: "+e); }
// in org/gjt/sp/jedit/bsh/BSHImportDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
catch ( UtilEvalError e ) { throw new UtilEvalError( "Variable assignment: " + name + ": " + e.getMessage()); }
// in org/gjt/sp/jedit/bsh/BSHMethodDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError(this,callstack); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHEnhancedForStatement.java
catch ( UtilEvalError e ) { throw e.toEvalError( "for loop iterator variable:"+ varName, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
catch ( UtilEvalError e ) { throw new InterpreterError( "bad cast" ); }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Error in array initializer", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHClassDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, callstack ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw new EvalError( e.getMessage(), SimpleNode.JAVACODE, new CallStack() ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() ); }
// in org/gjt/sp/jedit/bsh/JThis.java
catch ( UtilEvalError e ) {/*squeltch*/ }
// in org/gjt/sp/jedit/bsh/JThis.java
catch ( UtilEvalError e ) { /*squeltch*/ }
// in org/gjt/sp/jedit/bsh/JThis.java
catch ( UtilEvalError e ) {/*squeltch*/ }
// in org/gjt/sp/jedit/EditServer.java
catch(org.gjt.sp.jedit.bsh.UtilEvalError e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/EditServer.java
catch(org.gjt.sp.jedit.bsh.UtilEvalError e) { Log.log(Log.ERROR,this,e); }
// in org/gjt/sp/jedit/BeanShellFacade.java
catch(UtilEvalError e) { // do nothing }
// in org/gjt/sp/jedit/jEdit.java
catch(UtilEvalError e) { Log.log(Log.ERROR,jEdit.class,e); }
// in org/gjt/sp/jedit/JEditBeanShellAction.java
catch(UtilEvalError err) { Log.log(Log.ERROR,this,err); }
// in org/gjt/sp/jedit/browser/VFSBrowser.java
catch(UtilEvalError err) { Log.log(Log.ERROR,this,err); }
// in org/gjt/sp/jedit/browser/VFSBrowser.java
catch(UtilEvalError err) { Log.log(Log.ERROR,this,err); }
// in org/gjt/sp/jedit/BeanShellAction.java
catch(UtilEvalError err) { Log.log(Log.ERROR,this,err); }
49
            
// in org/gjt/sp/jedit/bsh/BSHUnaryExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch( UtilEvalError e ) { Interpreter.debug("doIndex: "+e); throw e.toEvalError( "Arrays may only be indexed by integer types.", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimarySuffix.java
catch ( UtilEvalError e) { throw e.toEvalError( "Property: "+value, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( UtilEvalError e ) { throw new InterpreterError( "Can't get class instance for synchronized method."); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch( UtilEvalError e) { throw new EvalError( "Invalid argument: " + "`"+paramNames[i]+"'" + " for method: " + name + " : " + e.getMessage(), callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( UtilEvalError e2 ) { throw e2.toEvalError( "Typed method parameter assignment", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch ( UtilEvalError e3 ) { throw e3.toEvalError( callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/BshMethod.java
catch( UtilEvalError e ) { // Point to return statement point if we had one. // (else it was implicit return? What's the case here?) SimpleNode node = callerInfo; if ( retControl != null ) node = retControl.returnPoint; throw e.toEvalError( "Incorrect type returned from method: " + name + e.getMessage(), node, callstack ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorImpl.java
catch ( UtilEvalError e ) { throw new InterpreterError("unable to init static: "+e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( UtilEvalError e ) { throw e.toEvalError( callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( UtilEvalError e ) { throw new InterpreterError( "illegal argument type in method invocation: "+e ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( UtilEvalError e ) { //e.printStackTrace(); throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( UtilEvalError e2 ) { // ClassPathException is a type of UtilEvalError throw e2.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAmbiguousName.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHCastExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHPrimaryExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHTypedVariableDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHTryStatement.java
catch ( UtilEvalError e ) { throw new InterpreterError( "Unable to set var in catch block namespace." ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAllocationExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch( UtilEvalError e ) { throw new UtilEvalError( "LHS evaluation: " + e.getMessage() ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError("Error loading command: ", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Local method invocation", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/Name.java
catch ( UtilEvalError e ) { throw e.toEvalError("Error invoking compiled command: ", callerInfo, callstack ); }
// in org/gjt/sp/jedit/bsh/ExternalNameSpace.java
catch ( UtilEvalError ute ) { // There should be no case for this. unwrapVariable throws // UtilEvalError in some cases where it holds an LHS or array // index. throw new InterpreterError("unexpected UtilEvalError"); }
// in org/gjt/sp/jedit/bsh/BSHBinaryExpression.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( UtilEvalError e ) { throw new InterpreterError("can't set cons var"); }
// in org/gjt/sp/jedit/bsh/ClassGeneratorUtil.java
catch ( UtilEvalError e ) { throw new InterpreterError("err setting local cons arg:"+e); }
// in org/gjt/sp/jedit/bsh/BSHSwitchStatement.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Switch value: "+switchExp.getText()+": ", this, callstack ); }
// in org/gjt/sp/jedit/bsh/Types.java
catch ( UtilEvalError e ) { // This should not happen with checkOnly true throw new InterpreterError("err in cast check: "+e); }
// in org/gjt/sp/jedit/bsh/BSHImportDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/NameSpace.java
catch ( UtilEvalError e ) { throw new UtilEvalError( "Variable assignment: " + name + ": " + e.getMessage()); }
// in org/gjt/sp/jedit/bsh/BSHMethodDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError(this,callstack); }
// in org/gjt/sp/jedit/bsh/BSHMethodInvocation.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHEnhancedForStatement.java
catch ( UtilEvalError e ) { throw e.toEvalError( "for loop iterator variable:"+ varName, this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHAssignment.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
catch ( UtilEvalError e ) { throw new InterpreterError( "bad cast" ); }
// in org/gjt/sp/jedit/bsh/BSHArrayInitializer.java
catch ( UtilEvalError e ) { throw e.toEvalError( "Error in array initializer", this, callstack ); }
// in org/gjt/sp/jedit/bsh/BSHClassDeclaration.java
catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, callstack ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw new EvalError( e.getMessage(), SimpleNode.JAVACODE, new CallStack() ); }
// in org/gjt/sp/jedit/bsh/Interpreter.java
catch ( UtilEvalError e ) { throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() ); }
9
checked (Domain) UtilTargetError
public class UtilTargetError extends UtilEvalError
{
	public Throwable t;

	public UtilTargetError( String message, Throwable t ) {
		super( message );
		this.t = t;
	}

	public UtilTargetError( Throwable t ) {
		this( null, t );
	}

	/**
		Override toEvalError to throw TargetError type.
	*/
	public EvalError toEvalError( 
		String msg, SimpleNode node, CallStack callstack  ) 
	{
		if ( msg == null )
			msg = getMessage();
		else
			msg = msg + ": " + getMessage();

		return new TargetError( msg, t, node, callstack, false );
	}
}
9
            
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getIndex(Object array, int index) throws ReflectError, UtilTargetError { if ( Interpreter.DEBUG ) Interpreter.debug("getIndex: "+array+", index="+index); try { Object val = Array.get(array, index); return Primitive.wrap( val, array.getClass().getComponentType() ); } catch( ArrayIndexOutOfBoundsException e1 ) { throw new UtilTargetError( e1 ); } catch(Exception e) { throw new ReflectError("Array access:" + e); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static void setIndex(Object array, int index, Object val) throws ReflectError, UtilTargetError { try { val = Primitive.unwrap(val); Array.set(array, index, val); } catch( ArrayStoreException e2 ) { throw new UtilTargetError( e2 ); } catch( IllegalArgumentException e1 ) { throw new UtilTargetError( new ArrayStoreException( e1.toString() ) ); } catch(Exception e) { throw new ReflectError("Array access:" + e); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Field resolveExpectedJavaField( Class clas, String fieldName, boolean staticOnly ) throws UtilEvalError, ReflectError { Field field; try { if ( Capabilities.haveAccessibility() ) field = findAccessibleField( clas, fieldName ); else // Class getField() finds only public (and in interfaces, etc.) field = clas.getField(fieldName); } catch( NoSuchFieldException e) { throw new ReflectError("No such field: " + fieldName ); } catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching fields of: "+clas, e ); } if ( staticOnly && !Modifier.isStatic( field.getModifiers() ) ) throw new UtilEvalError( "Can't reach instance field: "+fieldName +" from static context: "+clas.getName() ); return field; }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Method resolveExpectedJavaMethod( BshClassManager bcm, Class clas, Object object, String name, Object[] args, boolean staticOnly ) throws ReflectError, UtilEvalError { if ( object == Primitive.NULL ) throw new UtilTargetError( new NullPointerException( "Attempt to invoke method " +name+" on null value" ) ); Class [] types = Types.getTypes(args); Method method = resolveJavaMethod( bcm, clas, name, types, staticOnly ); if ( method == null ) throw new ReflectError( ( staticOnly ? "Static method " : "Method " ) + StringUtil.methodString(name, types) + " not found in class'" + clas.getName() + "'"); return method; }
// in org/gjt/sp/jedit/bsh/Reflect.java
protected static Method resolveJavaMethod( BshClassManager bcm, Class clas, String name, Class [] types, boolean staticOnly ) throws UtilEvalError { if ( clas == null ) throw new InterpreterError("null class"); // Lookup previously cached method Method method = null; if ( bcm == null ) Interpreter.debug("resolveJavaMethod UNOPTIMIZED lookup"); else method = bcm.getResolvedMethod( clas, name, types, staticOnly ); if ( method == null ) { boolean publicOnly = !Capabilities.haveAccessibility(); // Searching for the method may, itself be a priviledged action try { method = findOverloadedMethod( clas, name, types, publicOnly ); } catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching methods of: "+clas, e ); } checkFoundStaticMethod( method, staticOnly, clas ); // This is the first time we've seen this method, set accessibility // Note: even if it's a public method, we may have found it in a // non-public class if ( method != null && !publicOnly ) { try { ReflectManager.RMSetAccessible( method ); } catch ( UtilEvalError e ) { /*ignore*/ } } // If succeeded cache the resolved method. if ( method != null && bcm != null ) bcm.cacheResolvedMethod( clas, types, method ); } return method; }
// in org/gjt/sp/jedit/bsh/Name.java
private Object consumeNextObjectField( CallStack callstack, Interpreter interpreter, boolean forceClass, boolean autoAllocateThis ) throws UtilEvalError { /* Is it a simple variable name? Doing this first gives the correct Java precedence for vars vs. imported class names (at least in the simple case - see tests/precedence1.bsh). It should also speed things up a bit. */ if ( (evalBaseObject == null && !isCompound(evalName) ) && !forceClass ) { Object obj = resolveThisFieldReference( callstack, namespace, interpreter, evalName, false ); if ( obj != Primitive.VOID ) return completeRound( evalName, FINISHED, obj ); } /* Is it a bsh script variable reference? If we're just starting the eval of name (no base object) or we're evaluating relative to a This type reference check. */ String varName = prefix(evalName, 1); if ( ( evalBaseObject == null || evalBaseObject instanceof This ) && !forceClass ) { if ( Interpreter.DEBUG ) Interpreter.debug("trying to resolve variable: " + varName); Object obj; // switch namespace and special var visibility if ( evalBaseObject == null ) { obj = resolveThisFieldReference( callstack, namespace, interpreter, varName, false ); } else { obj = resolveThisFieldReference( callstack, ((This)evalBaseObject).namespace, interpreter, varName, true ); } if ( obj != Primitive.VOID ) { // Resolved the variable if ( Interpreter.DEBUG ) Interpreter.debug( "resolved variable: " + varName + " in namespace: "+namespace); return completeRound( varName, suffix(evalName), obj ); } } /* Is it a class name? If we're just starting eval of name try to make it, else fail. */ if ( evalBaseObject == null ) { if ( Interpreter.DEBUG ) Interpreter.debug( "trying class: " + evalName); /* Keep adding parts until we have a class */ Class clas = null; int i = 1; String className = null; for(; i <= countParts(evalName); i++) { className = prefix(evalName, i); if ( (clas = namespace.getClass(className)) != null ) break; } if ( clas != null ) { return completeRound( className, suffix( evalName, countParts(evalName)-i ), new ClassIdentifier(clas) ); } // not a class (or variable per above) if ( Interpreter.DEBUG ) Interpreter.debug( "not a class, trying var prefix "+evalName ); } // No variable or class found in 'this' type ref. // if autoAllocateThis then create one; a child 'this'. if ( ( evalBaseObject == null || evalBaseObject instanceof This ) && !forceClass && autoAllocateThis ) { NameSpace targetNameSpace = ( evalBaseObject == null ) ? namespace : ((This)evalBaseObject).namespace; Object obj = new NameSpace( targetNameSpace, "auto: "+varName ).getThis( interpreter ); targetNameSpace.setVariable( varName, obj, false ); return completeRound( varName, suffix(evalName), obj ); } /* If we didn't find a class or variable name (or prefix) above there are two possibilities: - If we are a simple name then we can pass as a void variable reference. - If we are compound then we must fail at this point. */ if ( evalBaseObject == null ) { if ( !isCompound(evalName) ) { return completeRound( evalName, FINISHED, Primitive.VOID ); } else throw new UtilEvalError( "Class or variable not found: " + evalName); } /* -------------------------------------------------------- After this point we're definitely evaluating relative to a base object. -------------------------------------------------------- */ /* Do some basic validity checks. */ if ( evalBaseObject == Primitive.NULL) // previous round produced null throw new UtilTargetError( new NullPointerException( "Null Pointer while evaluating: " +value ) ); if ( evalBaseObject == Primitive.VOID) // previous round produced void throw new UtilEvalError( "Undefined variable or class name while evaluating: "+value); if ( evalBaseObject instanceof Primitive) throw new UtilEvalError("Can't treat primitive like an object. "+ "Error while evaluating: "+value); /* Resolve relative to a class type static field, inner class, ? */ if ( evalBaseObject instanceof ClassIdentifier ) { Class clas = ((ClassIdentifier)evalBaseObject).getTargetClass(); String field = prefix(evalName, 1); // Class qualified 'this' reference from inner class. // e.g. 'MyOuterClass.this' if ( field.equals("this") ) { // find the enclosing class instance space of the class name NameSpace ns = namespace; while ( ns != null ) { // getClassInstance() throws exception if not there if ( ns.classInstance != null && ns.classInstance.getClass() == clas ) return completeRound( field, suffix(evalName), ns.classInstance ); ns=ns.getParent(); } throw new UtilEvalError( "Can't find enclosing 'this' instance of class: "+clas); } Object obj = null; // static field? try { if ( Interpreter.DEBUG ) Interpreter.debug("Name call to getStaticFieldValue, class: " +clas+", field:"+field); obj = Reflect.getStaticFieldValue(clas, field); } catch( ReflectError e ) { if ( Interpreter.DEBUG ) Interpreter.debug("field reflect error: "+e); } // inner class? if ( obj == null ) { String iclass = clas.getName()+"$"+field; Class c = namespace.getClass( iclass ); if ( c != null ) obj = new ClassIdentifier(c); } if ( obj == null ) throw new UtilEvalError( "No static field or inner class: " + field + " of " + clas ); return completeRound( field, suffix(evalName), obj ); } /* If we've fallen through here we are no longer resolving to a class type. */ if ( forceClass ) throw new UtilEvalError( value +" does not resolve to a class name." ); /* Some kind of field access? */ String field = prefix(evalName, 1); // length access on array? if ( field.equals("length") && evalBaseObject.getClass().isArray() ) { Object obj = new Primitive(Array.getLength(evalBaseObject)); return completeRound( field, suffix(evalName), obj ); } // Check for field on object // Note: could eliminate throwing the exception somehow try { Object obj = Reflect.getObjectFieldValue(evalBaseObject, field); return completeRound( field, suffix(evalName), obj ); } catch(ReflectError e) { /* not a field */ } // if we get here we have failed throw new UtilEvalError( "Cannot access field: " + field + ", on object: " + evalBaseObject); }
// in org/gjt/sp/jedit/bsh/Name.java
public Object invokeMethod( Interpreter interpreter, Object[] args, CallStack callstack, SimpleNode callerInfo ) throws UtilEvalError, EvalError, ReflectError, InvocationTargetException { String methodName = Name.suffix(value, 1); BshClassManager bcm = interpreter.getClassManager(); NameSpace namespace = callstack.top(); // Optimization - If classOfStaticMethod is set then we have already // been here and determined that this is a static method invocation. // Note: maybe factor this out with path below... clean up. if ( classOfStaticMethod != null ) { return Reflect.invokeStaticMethod( bcm, classOfStaticMethod, methodName, args ); } if ( !Name.isCompound(value) ) return invokeLocalMethod( interpreter, args, callstack, callerInfo ); // Note: if we want methods declared inside blocks to be accessible via // this.methodname() inside the block we could handle it here as a // special case. See also resolveThisFieldReference() special handling // for BlockNameSpace case. They currently work via the direct name // e.g. methodName(). String prefix = Name.prefix(value); // Superclass method invocation? (e.g. super.foo()) if ( prefix.equals("super") && Name.countParts(value) == 2 ) { // Allow getThis() to work through block namespaces first This ths = namespace.getThis( interpreter ); NameSpace thisNameSpace = ths.getNameSpace(); NameSpace classNameSpace = getClassNameSpace( thisNameSpace ); if ( classNameSpace != null ) { Object instance = classNameSpace.getClassInstance(); return ClassGenerator.getClassGenerator() .invokeSuperclassMethod( bcm, instance, methodName, args ); } } // Find target object or class identifier Name targetName = namespace.getNameResolver( prefix ); Object obj = targetName.toObject( callstack, interpreter ); if ( obj == Primitive.VOID ) throw new UtilEvalError( "Attempt to resolve method: "+methodName +"() on undefined variable or class name: "+targetName); // if we've got an object, resolve the method if ( !(obj instanceof ClassIdentifier) ) { if (obj instanceof Primitive) { if (obj == Primitive.NULL) throw new UtilTargetError( new NullPointerException( "Null Pointer in Method Invocation" ) ); // some other primitive // should avoid calling methods on primitive, as we do // in Name (can't treat primitive like an object message) // but the hole is useful right now. if ( Interpreter.DEBUG ) interpreter.debug( "Attempt to access method on primitive..." + " allowing bsh.Primitive to peek through for debugging"); } // found an object and it's not an undefined variable return Reflect.invokeObjectMethod( obj, methodName, args, interpreter, callstack, callerInfo ); } // It's a class // try static method if ( Interpreter.DEBUG ) Interpreter.debug("invokeMethod: trying static - " + targetName); Class clas = ((ClassIdentifier)obj).getTargetClass(); // cache the fact that this is a static method invocation on this class classOfStaticMethod = clas; if ( clas != null ) return Reflect.invokeStaticMethod( bcm, clas, methodName, args ); // return null; ??? throw new UtilEvalError("invokeMethod: unknown target: " + targetName); }
// in org/gjt/sp/jedit/bsh/Primitive.java
public static Object binaryOperation( Object obj1, Object obj2, int kind) throws UtilEvalError { // special primitive types if ( obj1 == NULL || obj2 == NULL ) throw new UtilEvalError( "Null value or 'null' literal in binary operation"); if ( obj1 == VOID || obj2 == VOID ) throw new UtilEvalError( "Undefined variable, class, or 'void' literal in binary operation"); // keep track of the original types Class lhsOrgType = obj1.getClass(); Class rhsOrgType = obj2.getClass(); // Unwrap primitives if ( obj1 instanceof Primitive ) obj1 = ((Primitive)obj1).getValue(); if ( obj2 instanceof Primitive ) obj2 = ((Primitive)obj2).getValue(); Object[] operands = promotePrimitives(obj1, obj2); Object lhs = operands[0]; Object rhs = operands[1]; if(lhs.getClass() != rhs.getClass()) throw new UtilEvalError("Type mismatch in operator. " + lhs.getClass() + " cannot be used with " + rhs.getClass() ); Object result; try { result = binaryOperationImpl( lhs, rhs, kind ); } catch ( ArithmeticException e ) { throw new UtilTargetError( "Arithemetic Exception in binary op", e); } // If both original args were Primitives return a Primitive result // else it was mixed (wrapper/primitive) return the wrapper type // Exception is for boolean result, return the primitive if ( (lhsOrgType == Primitive.class && rhsOrgType == Primitive.class) || result instanceof Boolean ) return new Primitive( result ); else return result; }
6
            
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( ArrayIndexOutOfBoundsException e1 ) { throw new UtilTargetError( e1 ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( ArrayStoreException e2 ) { throw new UtilTargetError( e2 ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch( IllegalArgumentException e1 ) { throw new UtilTargetError( new ArrayStoreException( e1.toString() ) ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching fields of: "+clas, e ); }
// in org/gjt/sp/jedit/bsh/Reflect.java
catch ( SecurityException e ) { throw new UtilTargetError( "Security Exception while searching methods of: "+clas, e ); }
// in org/gjt/sp/jedit/bsh/Primitive.java
catch ( ArithmeticException e ) { throw new UtilTargetError( "Arithemetic Exception in binary op", e); }
2
            
// in org/gjt/sp/jedit/bsh/Reflect.java
public static Object getIndex(Object array, int index) throws ReflectError, UtilTargetError { if ( Interpreter.DEBUG ) Interpreter.debug("getIndex: "+array+", index="+index); try { Object val = Array.get(array, index); return Primitive.wrap( val, array.getClass().getComponentType() ); } catch( ArrayIndexOutOfBoundsException e1 ) { throw new UtilTargetError( e1 ); } catch(Exception e) { throw new ReflectError("Array access:" + e); } }
// in org/gjt/sp/jedit/bsh/Reflect.java
public static void setIndex(Object array, int index, Object val) throws ReflectError, UtilTargetError { try { val = Primitive.unwrap(val); Array.set(array, index, val); } catch( ArrayStoreException e2 ) { throw new UtilTargetError( e2 ); } catch( IllegalArgumentException e1 ) { throw new UtilTargetError( new ArrayStoreException( e1.toString() ) ); } catch(Exception e) { throw new ReflectError("Array access:" + e); } }
1
            
// in org/gjt/sp/jedit/bsh/LHS.java
catch ( UtilTargetError e1 ) { // pass along target error throw e1; }
1
            
// in org/gjt/sp/jedit/bsh/LHS.java
catch ( UtilTargetError e1 ) { // pass along target error throw e1; }
0
unknown (Lib) ZipException 0 0 0 1
            
// in org/gjt/sp/jedit/pluginmgr/Roster.java
catch(ZipException e) { Log.log(Log.ERROR,this,e); GUIUtilities.error(null,"plugin-error-download",new Object[]{""}); }
0 0

Miscellanous Metrics

nF = Number of Finally 226
nF = Number of Try-Finally (without catch) 126
Number of Methods with Finally (nMF) 221 / 6927 (3.2%)
Number of Finally with a Continue 0
Number of Finally with a Return 3
Number of Finally with a Throw 0
Number of Finally with a Break 0
Number of different exception types thrown 28
Number of Domain exception types thrown 11
Number of different exception types caught 55
Number of Domain exception types caught 13
Number of exception declarations in signatures 545
Number of different exceptions types declared in method signatures 23
Number of library exceptions types declared in method signatures 15
Number of Domain exceptions types declared in method signatures 8
Number of Catch with a continue 3
Number of Catch with a return 148
Number of Catch with a Break 2
nbIf = Number of If 8988
nbFor = Number of For 994
Number of Method with an if 3033 / 6927
Number of Methods with a for 772 / 6927
Number of Method starting with a try 88 / 6927 (1.3%)
Number of Expressions 93212
Number of Expressions in try 10901 (11.7%)