id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
116,200
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.getAllNamesAux
protected void getAllNamesAux(final List<String> vec) { vec.addAll(this.variables.keySet()); if ( methods != null ) vec.addAll(this.methods.keySet()); if (this.parent != null) this.parent.getAllNamesAux(vec); }
java
protected void getAllNamesAux(final List<String> vec) { vec.addAll(this.variables.keySet()); if ( methods != null ) vec.addAll(this.methods.keySet()); if (this.parent != null) this.parent.getAllNamesAux(vec); }
[ "protected", "void", "getAllNamesAux", "(", "final", "List", "<", "String", ">", "vec", ")", "{", "vec", ".", "addAll", "(", "this", ".", "variables", ".", "keySet", "(", ")", ")", ";", "if", "(", "methods", "!=", "null", ")", "vec", ".", "addAll", ...
Helper for implementing NameSource. @param vec the vec
[ "Helper", "for", "implementing", "NameSource", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L1118-L1124
116,201
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.clear
public void clear() { this.variables.clear(); this.methods.clear(); this.importedClasses.clear(); this.importedPackages.clear(); this.importedCommands.clear(); this.importedObjects.clear(); if (this.parent == null) this.loadDefaultImports(); th...
java
public void clear() { this.variables.clear(); this.methods.clear(); this.importedClasses.clear(); this.importedPackages.clear(); this.importedCommands.clear(); this.importedObjects.clear(); if (this.parent == null) this.loadDefaultImports(); th...
[ "public", "void", "clear", "(", ")", "{", "this", ".", "variables", ".", "clear", "(", ")", ";", "this", ".", "methods", ".", "clear", "(", ")", ";", "this", ".", "importedClasses", ".", "clear", "(", ")", ";", "this", ".", "importedPackages", ".", ...
Clear all variables, methods, and imports from this namespace. If this namespace is the root, it will be reset to the default imports. @see #loadDefaultImports()
[ "Clear", "all", "variables", "methods", "and", "imports", "from", "this", "namespace", ".", "If", "this", "namespace", "is", "the", "root", "it", "will", "be", "reset", "to", "the", "default", "imports", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L1317-L1328
116,202
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.importStatic
public void importStatic(final Class<?> clas) { this.importedStatic.remove(clas); this.importedStatic.add(0, clas); this.nameSpaceChanged(); }
java
public void importStatic(final Class<?> clas) { this.importedStatic.remove(clas); this.importedStatic.add(0, clas); this.nameSpaceChanged(); }
[ "public", "void", "importStatic", "(", "final", "Class", "<", "?", ">", "clas", ")", "{", "this", ".", "importedStatic", ".", "remove", "(", "clas", ")", ";", "this", ".", "importedStatic", ".", "add", "(", "0", ",", "clas", ")", ";", "this", ".", ...
Import static. @param clas the clas
[ "Import", "static", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L1345-L1349
116,203
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.getPackage
String getPackage() { if (this.packageName != null) return this.packageName; if (this.parent != null) return this.parent.getPackage(); return null; }
java
String getPackage() { if (this.packageName != null) return this.packageName; if (this.parent != null) return this.parent.getPackage(); return null; }
[ "String", "getPackage", "(", ")", "{", "if", "(", "this", ".", "packageName", "!=", "null", ")", "return", "this", ".", "packageName", ";", "if", "(", "this", ".", "parent", "!=", "null", ")", "return", "this", ".", "parent", ".", "getPackage", "(", ...
Gets the package. @return the package
[ "Gets", "the", "package", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L1360-L1366
116,204
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.attemptSetPropertyValue
boolean attemptSetPropertyValue(final String propName, final Object value, final Interpreter interp) throws UtilEvalError { final String accessorName = Reflect.accessorName(Reflect.SET_PREFIX, propName); Object val = Primitive.unwrap(value); final Class<?>[] classArray = new Class<?>...
java
boolean attemptSetPropertyValue(final String propName, final Object value, final Interpreter interp) throws UtilEvalError { final String accessorName = Reflect.accessorName(Reflect.SET_PREFIX, propName); Object val = Primitive.unwrap(value); final Class<?>[] classArray = new Class<?>...
[ "boolean", "attemptSetPropertyValue", "(", "final", "String", "propName", ",", "final", "Object", "value", ",", "final", "Interpreter", "interp", ")", "throws", "UtilEvalError", "{", "final", "String", "accessorName", "=", "Reflect", ".", "accessorName", "(", "Ref...
If a writable property exists for the given name, set it and return true, otherwise do nothing and return false. @param propName the prop name @param value the value @param interp the interp @return true, if successful @throws UtilEvalError the util eval error
[ "If", "a", "writable", "property", "exists", "for", "the", "given", "name", "set", "it", "and", "return", "true", "otherwise", "do", "nothing", "and", "return", "false", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L1375-L1393
116,205
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.getPropertyValue
Object getPropertyValue(final String propName, final Interpreter interp) throws UtilEvalError { String accessorName = Reflect.accessorName(Reflect.GET_PREFIX, propName); final Class<?>[] classArray = Reflect.ZERO_TYPES; BshMethod m = this.getMethod(accessorName, classArray); ...
java
Object getPropertyValue(final String propName, final Interpreter interp) throws UtilEvalError { String accessorName = Reflect.accessorName(Reflect.GET_PREFIX, propName); final Class<?>[] classArray = Reflect.ZERO_TYPES; BshMethod m = this.getMethod(accessorName, classArray); ...
[ "Object", "getPropertyValue", "(", "final", "String", "propName", ",", "final", "Interpreter", "interp", ")", "throws", "UtilEvalError", "{", "String", "accessorName", "=", "Reflect", ".", "accessorName", "(", "Reflect", ".", "GET_PREFIX", ",", "propName", ")", ...
Get a property from a scripted object or Primitive.VOID if no such property exists. @param propName the prop name @param interp the interp @return the property value @throws UtilEvalError the util eval error
[ "Get", "a", "property", "from", "a", "scripted", "object", "or", "Primitive", ".", "VOID", "if", "no", "such", "property", "exists", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L1401-L1418
116,206
beanshell/beanshell
src/main/java/bsh/BSHMethodInvocation.java
BSHMethodInvocation.eval
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { NameSpace namespace = callstack.top(); BSHAmbiguousName nameNode = getNameNode(); // get caller info for assert fail if ("fail".equals(nameNode.text)) interpreter.getNameSpace().setNo...
java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { NameSpace namespace = callstack.top(); BSHAmbiguousName nameNode = getNameNode(); // get caller info for assert fail if ("fail".equals(nameNode.text)) interpreter.getNameSpace().setNo...
[ "public", "Object", "eval", "(", "CallStack", "callstack", ",", "Interpreter", "interpreter", ")", "throws", "EvalError", "{", "NameSpace", "namespace", "=", "callstack", ".", "top", "(", ")", ";", "BSHAmbiguousName", "nameNode", "=", "getNameNode", "(", ")", ...
Evaluate the method invocation with the specified callstack and interpreter
[ "Evaluate", "the", "method", "invocation", "with", "the", "specified", "callstack", "and", "interpreter" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BSHMethodInvocation.java#L48-L98
116,207
beanshell/beanshell
src/main/java/bsh/ClassGenerator.java
ClassGenerator.generateClass
public Class<?> generateClass(String name, Modifiers modifiers, Class<?>[] interfaces, Class<?> superClass, BSHBlock block, Type type, CallStack callstack, Interpreter interpreter) throws EvalError { // Delegate to the static method return generateClassImpl(name, modifiers, interfaces, superClass, block...
java
public Class<?> generateClass(String name, Modifiers modifiers, Class<?>[] interfaces, Class<?> superClass, BSHBlock block, Type type, CallStack callstack, Interpreter interpreter) throws EvalError { // Delegate to the static method return generateClassImpl(name, modifiers, interfaces, superClass, block...
[ "public", "Class", "<", "?", ">", "generateClass", "(", "String", "name", ",", "Modifiers", "modifiers", ",", "Class", "<", "?", ">", "[", "]", "interfaces", ",", "Class", "<", "?", ">", "superClass", ",", "BSHBlock", "block", ",", "Type", "type", ",",...
Parse the BSHBlock for the class definition and generate the class.
[ "Parse", "the", "BSHBlock", "for", "the", "class", "definition", "and", "generate", "the", "class", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/ClassGenerator.java#L53-L56
116,208
beanshell/beanshell
src/main/java/bsh/ClassGenerator.java
ClassGenerator.generateClassImpl
public static Class<?> generateClassImpl(String name, Modifiers modifiers, Class<?>[] interfaces, Class<?> superClass, BSHBlock block, Type type, CallStack callstack, Interpreter interpreter) throws EvalError { NameSpace enclosingNameSpace = callstack.top(); String packageName = enclosingNameSpace.getPa...
java
public static Class<?> generateClassImpl(String name, Modifiers modifiers, Class<?>[] interfaces, Class<?> superClass, BSHBlock block, Type type, CallStack callstack, Interpreter interpreter) throws EvalError { NameSpace enclosingNameSpace = callstack.top(); String packageName = enclosingNameSpace.getPa...
[ "public", "static", "Class", "<", "?", ">", "generateClassImpl", "(", "String", "name", ",", "Modifiers", "modifiers", ",", "Class", "<", "?", ">", "[", "]", "interfaces", ",", "Class", "<", "?", ">", "superClass", ",", "BSHBlock", "block", ",", "Type", ...
Parse the BSHBlock for for the class definition and generate the class using ClassGenerator.
[ "Parse", "the", "BSHBlock", "for", "for", "the", "class", "definition", "and", "generate", "the", "class", "using", "ClassGenerator", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/ClassGenerator.java#L72-L142
116,209
beanshell/beanshell
src/main/java/bsh/Operators.java
Operators.bigIntegerBinaryOperation
static Object bigIntegerBinaryOperation(BigInteger lhs, BigInteger rhs, int kind) { switch(kind) { // arithmetic case PLUS: return lhs.add(rhs); case MINUS: return lhs.subtract(rhs); case STAR: return ...
java
static Object bigIntegerBinaryOperation(BigInteger lhs, BigInteger rhs, int kind) { switch(kind) { // arithmetic case PLUS: return lhs.add(rhs); case MINUS: return lhs.subtract(rhs); case STAR: return ...
[ "static", "Object", "bigIntegerBinaryOperation", "(", "BigInteger", "lhs", ",", "BigInteger", "rhs", ",", "int", "kind", ")", "{", "switch", "(", "kind", ")", "{", "// arithmetic", "case", "PLUS", ":", "return", "lhs", ".", "add", "(", "rhs", ")", ";", "...
returns Object covering both Integer and Boolean return types
[ "returns", "Object", "covering", "both", "Integer", "and", "Boolean", "return", "types" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Operators.java#L311-L371
116,210
beanshell/beanshell
src/main/java/bsh/Operators.java
Operators.doubleBinaryOperation
static Object doubleBinaryOperation(double lhs, double rhs, int kind) throws UtilEvalError { switch(kind) { // arithmetic case PLUS: if ( lhs > 0d && (Double.MAX_VALUE - lhs) < rhs ) break; return lhs + rhs; ...
java
static Object doubleBinaryOperation(double lhs, double rhs, int kind) throws UtilEvalError { switch(kind) { // arithmetic case PLUS: if ( lhs > 0d && (Double.MAX_VALUE - lhs) < rhs ) break; return lhs + rhs; ...
[ "static", "Object", "doubleBinaryOperation", "(", "double", "lhs", ",", "double", "rhs", ",", "int", "kind", ")", "throws", "UtilEvalError", "{", "switch", "(", "kind", ")", "{", "// arithmetic", "case", "PLUS", ":", "if", "(", "lhs", ">", "0d", "&&", "(...
returns Object covering both Double and Boolean return types
[ "returns", "Object", "covering", "both", "Double", "and", "Boolean", "return", "types" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Operators.java#L374-L424
116,211
beanshell/beanshell
src/main/java/bsh/Operators.java
Operators.promoteToInteger
static Number promoteToInteger(Object wrapper ) { if ( wrapper instanceof Character ) return Integer.valueOf(((Character) wrapper).charValue()); if ( wrapper instanceof Byte || wrapper instanceof Short ) return Integer.valueOf(((Number) wrapper).intValue()); return (...
java
static Number promoteToInteger(Object wrapper ) { if ( wrapper instanceof Character ) return Integer.valueOf(((Character) wrapper).charValue()); if ( wrapper instanceof Byte || wrapper instanceof Short ) return Integer.valueOf(((Number) wrapper).intValue()); return (...
[ "static", "Number", "promoteToInteger", "(", "Object", "wrapper", ")", "{", "if", "(", "wrapper", "instanceof", "Character", ")", "return", "Integer", ".", "valueOf", "(", "(", "(", "Character", ")", "wrapper", ")", ".", "charValue", "(", ")", ")", ";", ...
Promote primitive wrapper type to Integer wrapper type
[ "Promote", "primitive", "wrapper", "type", "to", "Integer", "wrapper", "type" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Operators.java#L470-L478
116,212
beanshell/beanshell
src/main/java/bsh/org/objectweb/asm/SymbolTable.java
SymbolTable.addConstant
Symbol addConstant(final Object value) { if (value instanceof Integer) { return addConstantInteger(((Integer) value).intValue()); } else if (value instanceof Byte) { return addConstantInteger(((Byte) value).intValue()); } else if (value instanceof Character) { return addConstantInteger(((C...
java
Symbol addConstant(final Object value) { if (value instanceof Integer) { return addConstantInteger(((Integer) value).intValue()); } else if (value instanceof Byte) { return addConstantInteger(((Byte) value).intValue()); } else if (value instanceof Character) { return addConstantInteger(((C...
[ "Symbol", "addConstant", "(", "final", "Object", "value", ")", "{", "if", "(", "value", "instanceof", "Integer", ")", "{", "return", "addConstantInteger", "(", "(", "(", "Integer", ")", "value", ")", ".", "intValue", "(", ")", ")", ";", "}", "else", "i...
Adds a number or string constant to the constant pool of this symbol table. Does nothing if the constant pool already contains a similar item. @param value the value of the constant to be added to the constant pool. This parameter must be an {@link Integer}, {@link Byte}, {@link Character}, {@link Short}, {@link Boole...
[ "Adds", "a", "number", "or", "string", "constant", "to", "the", "constant", "pool", "of", "this", "symbol", "table", ".", "Does", "nothing", "if", "the", "constant", "pool", "already", "contains", "a", "similar", "item", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/org/objectweb/asm/SymbolTable.java#L321-L361
116,213
beanshell/beanshell
src/main/java/bsh/org/objectweb/asm/SymbolTable.java
SymbolTable.addConstantInteger
private void addConstantInteger(final int index, final int tag, final int value) { add(new Entry(index, tag, value, hash(tag, value))); }
java
private void addConstantInteger(final int index, final int tag, final int value) { add(new Entry(index, tag, value, hash(tag, value))); }
[ "private", "void", "addConstantInteger", "(", "final", "int", "index", ",", "final", "int", "tag", ",", "final", "int", "value", ")", "{", "add", "(", "new", "Entry", "(", "index", ",", "tag", ",", "value", ",", "hash", "(", "tag", ",", "value", ")",...
Adds a new CONSTANT_Integer_info or CONSTANT_Float_info to the constant pool of this symbol table. @param index the constant pool index of the new Symbol. @param tag one of {@link Symbol#CONSTANT_INTEGER_TAG} or {@link Symbol#CONSTANT_FLOAT_TAG}. @param value an int or float.
[ "Adds", "a", "new", "CONSTANT_Integer_info", "or", "CONSTANT_Float_info", "to", "the", "constant", "pool", "of", "this", "symbol", "table", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/org/objectweb/asm/SymbolTable.java#L516-L518
116,214
beanshell/beanshell
src/main/java/bsh/org/objectweb/asm/SymbolTable.java
SymbolTable.addConstantLong
private void addConstantLong(final int index, final int tag, final long value) { add(new Entry(index, tag, value, hash(tag, value))); }
java
private void addConstantLong(final int index, final int tag, final long value) { add(new Entry(index, tag, value, hash(tag, value))); }
[ "private", "void", "addConstantLong", "(", "final", "int", "index", ",", "final", "int", "tag", ",", "final", "long", "value", ")", "{", "add", "(", "new", "Entry", "(", "index", ",", "tag", ",", "value", ",", "hash", "(", "tag", ",", "value", ")", ...
Adds a new CONSTANT_Double_info to the constant pool of this symbol table. @param index the constant pool index of the new Symbol. @param tag one of {@link Symbol#CONSTANT_LONG_TAG} or {@link Symbol#CONSTANT_DOUBLE_TAG}. @param value a long or double.
[ "Adds", "a", "new", "CONSTANT_Double_info", "to", "the", "constant", "pool", "of", "this", "symbol", "table", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/org/objectweb/asm/SymbolTable.java#L572-L574
116,215
beanshell/beanshell
src/main/java/bsh/org/objectweb/asm/SymbolTable.java
SymbolTable.addType
int addType(final String value) { int hashCode = hash(Symbol.TYPE_TAG, value); Entry entry = get(hashCode); while (entry != null) { if (entry.tag == Symbol.TYPE_TAG && entry.hashCode == hashCode && entry.value.equals(value)) { return entry.index; } entry = entry.next; } ret...
java
int addType(final String value) { int hashCode = hash(Symbol.TYPE_TAG, value); Entry entry = get(hashCode); while (entry != null) { if (entry.tag == Symbol.TYPE_TAG && entry.hashCode == hashCode && entry.value.equals(value)) { return entry.index; } entry = entry.next; } ret...
[ "int", "addType", "(", "final", "String", "value", ")", "{", "int", "hashCode", "=", "hash", "(", "Symbol", ".", "TYPE_TAG", ",", "value", ")", ";", "Entry", "entry", "=", "get", "(", "hashCode", ")", ";", "while", "(", "entry", "!=", "null", ")", ...
Adds a type in the type table of this symbol table. Does nothing if the type table already contains a similar type. @param value an internal class name. @return the index of a new or already existing type Symbol with the given value.
[ "Adds", "a", "type", "in", "the", "type", "table", "of", "this", "symbol", "table", ".", "Does", "nothing", "if", "the", "type", "table", "already", "contains", "a", "similar", "type", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/org/objectweb/asm/SymbolTable.java#L992-L1002
116,216
beanshell/beanshell
src/main/java/bsh/classpath/BshClassLoader.java
BshClassLoader.findClass
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 = (ClassManager...
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 = (ClassManager...
[ "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", "ClassMana...
add some caching for not found classes?
[ "add", "some", "caching", "for", "not", "found", "classes?" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/classpath/BshClassLoader.java#L125-L164
116,217
beanshell/beanshell
src/main/java/bsh/BSHBinaryExpression.java
BSHBinaryExpression.getVariableAtNode
private Variable getVariableAtNode(int index, CallStack callstack) throws UtilEvalError { Node nameNode = null; if (jjtGetChild(index).jjtGetNumChildren() > 0 && (nameNode = jjtGetChild(index).jjtGetChild(0)) instanceof BSHAmbiguousName) return callstack.t...
java
private Variable getVariableAtNode(int index, CallStack callstack) throws UtilEvalError { Node nameNode = null; if (jjtGetChild(index).jjtGetNumChildren() > 0 && (nameNode = jjtGetChild(index).jjtGetChild(0)) instanceof BSHAmbiguousName) return callstack.t...
[ "private", "Variable", "getVariableAtNode", "(", "int", "index", ",", "CallStack", "callstack", ")", "throws", "UtilEvalError", "{", "Node", "nameNode", "=", "null", ";", "if", "(", "jjtGetChild", "(", "index", ")", ".", "jjtGetNumChildren", "(", ")", ">", "...
Get Variable for value at specified index. @param index 0 for lhs val1 else 1 @param callstack the evaluation call stack @return the variable in call stack name space for the ambiguous node text @throws UtilEvalError thrown by getVariableImpl.
[ "Get", "Variable", "for", "value", "at", "specified", "index", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BSHBinaryExpression.java#L133-L141
116,218
beanshell/beanshell
src/main/java/bsh/BSHBinaryExpression.java
BSHBinaryExpression.checkNullValues
private Object checkNullValues(Object val1, Object val2, int index, CallStack callstack) throws EvalError { if ( Primitive.NULL == val1 && Primitive.VOID != val2 && jjtGetChild(index).jjtGetChild(0) instanceof BSHAmbiguousName) try { Variable var = nul...
java
private Object checkNullValues(Object val1, Object val2, int index, CallStack callstack) throws EvalError { if ( Primitive.NULL == val1 && Primitive.VOID != val2 && jjtGetChild(index).jjtGetChild(0) instanceof BSHAmbiguousName) try { Variable var = nul...
[ "private", "Object", "checkNullValues", "(", "Object", "val1", ",", "Object", "val2", ",", "int", "index", ",", "CallStack", "callstack", ")", "throws", "EvalError", "{", "if", "(", "Primitive", ".", "NULL", "==", "val1", "&&", "Primitive", ".", "VOID", "!...
Apply null rules to operator values. @param val1 value to inspect for null @param val2 value to compare to @param index 0 for lhs val1 else 1 @param callstack the evaluation call stack @return the value modified or not @throws EvalError if operation cause an error
[ "Apply", "null", "rules", "to", "operator", "values", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BSHBinaryExpression.java#L150-L196
116,219
beanshell/beanshell
src/main/java/bsh/BSHBinaryExpression.java
BSHBinaryExpression.isWrapper
private boolean isWrapper( Class<?> cls ) { if ( null == cls ) return false; if ( Boolean.class.isAssignableFrom(cls) ) switch ( kind ) { case EQ: case NE: case BOOL_OR: case BOOL_ORX: case BOOL_AND: case BOOL_ANDX: case BIT_AND: case BIT_ANDX: case BIT_OR: ...
java
private boolean isWrapper( Class<?> cls ) { if ( null == cls ) return false; if ( Boolean.class.isAssignableFrom(cls) ) switch ( kind ) { case EQ: case NE: case BOOL_OR: case BOOL_ORX: case BOOL_AND: case BOOL_ANDX: case BIT_AND: case BIT_ANDX: case BIT_OR: ...
[ "private", "boolean", "isWrapper", "(", "Class", "<", "?", ">", "cls", ")", "{", "if", "(", "null", "==", "cls", ")", "return", "false", ";", "if", "(", "Boolean", ".", "class", ".", "isAssignableFrom", "(", "cls", ")", ")", "switch", "(", "kind", ...
Is the class a wrapper type. Also apply valid operator type to response. @param cls the type to inspect @return is a wrapper type with valid operators
[ "Is", "the", "class", "a", "wrapper", "type", ".", "Also", "apply", "valid", "operator", "type", "to", "response", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BSHBinaryExpression.java#L218-L237
116,220
beanshell/beanshell
src/main/java/bsh/BSHAllocationExpression.java
BSHAllocationExpression.arrayFillDefaultValue
private void arrayFillDefaultValue(Object arr) { if (null == arr) return; Class<?> clas = arr.getClass(); Class<?> comp = Types.arrayElementType(clas); if ( !comp.isPrimitive() ) if ( Types.arrayDimensions(clas) > 1 ) for ( int i = 0; i < Array.get...
java
private void arrayFillDefaultValue(Object arr) { if (null == arr) return; Class<?> clas = arr.getClass(); Class<?> comp = Types.arrayElementType(clas); if ( !comp.isPrimitive() ) if ( Types.arrayDimensions(clas) > 1 ) for ( int i = 0; i < Array.get...
[ "private", "void", "arrayFillDefaultValue", "(", "Object", "arr", ")", "{", "if", "(", "null", "==", "arr", ")", "return", ";", "Class", "<", "?", ">", "clas", "=", "arr", ".", "getClass", "(", ")", ";", "Class", "<", "?", ">", "comp", "=", "Types"...
Fill boxed numeric types with default numbers instead of nulls. @param arr the array to fill.
[ "Fill", "boxed", "numeric", "types", "with", "default", "numbers", "instead", "of", "nulls", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BSHAllocationExpression.java#L317-L329
116,221
beanshell/beanshell
src/main/java/bsh/Variable.java
Variable.setValue
public void setValue( Object value, int context ) throws UtilEvalError { // prevent final variable re-assign if (hasModifier("final")) { if (this.value != null) throw new UtilEvalError("Cannot re-assign final variable "+name+"."); if (value == null) ...
java
public void setValue( Object value, int context ) throws UtilEvalError { // prevent final variable re-assign if (hasModifier("final")) { if (this.value != null) throw new UtilEvalError("Cannot re-assign final variable "+name+"."); if (value == null) ...
[ "public", "void", "setValue", "(", "Object", "value", ",", "int", "context", ")", "throws", "UtilEvalError", "{", "// prevent final variable re-assign", "if", "(", "hasModifier", "(", "\"final\"", ")", ")", "{", "if", "(", "this", ".", "value", "!=", "null", ...
Set the value of the typed variable. @param value should be an object or wrapped bsh Primitive type. if value is null the appropriate default value will be set for the type: e.g. false for boolean, zero for integer types.
[ "Set", "the", "value", "of", "the", "typed", "variable", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Variable.java#L82-L111
116,222
beanshell/beanshell
src/main/java/bsh/servlet/Remote.java
Remote.eval
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 ...
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 ...
[ "public", "static", "int", "eval", "(", "String", "url", ",", "String", "text", ")", "throws", "IOException", "{", "String", "returnValue", "=", "null", ";", "if", "(", "url", ".", "startsWith", "(", "\"http:\"", ")", ")", "{", "returnValue", "=", "doHtt...
Evaluate text in the interpreter at url, returning a possible integer return value.
[ "Evaluate", "text", "in", "the", "interpreter", "at", "url", "returning", "a", "possible", "integer", "return", "value", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/servlet/Remote.java#L70-L85
116,223
beanshell/beanshell
src/main/java/bsh/SimpleNode.java
SimpleNode.eval
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { throw new InterpreterError( "Unimplemented or inappropriate for " + getClass().getName() ); }
java
public Object eval( CallStack callstack, Interpreter interpreter ) throws EvalError { throw new InterpreterError( "Unimplemented or inappropriate for " + getClass().getName() ); }
[ "public", "Object", "eval", "(", "CallStack", "callstack", ",", "Interpreter", "interpreter", ")", "throws", "EvalError", "{", "throw", "new", "InterpreterError", "(", "\"Unimplemented or inappropriate for \"", "+", "getClass", "(", ")", ".", "getName", "(", ")", ...
This is the general signature for evaluation of a node.
[ "This", "is", "the", "general", "signature", "for", "evaluation", "of", "a", "node", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/SimpleNode.java#L169-L174
116,224
beanshell/beanshell
src/main/java/bsh/SimpleNode.java
SimpleNode.getText
public String getText() { StringBuilder text = new StringBuilder(); Token t = firstToken; while ( t!=null ) { text.append(t.image); if ( !t.image.equals(".") ) text.append(" "); if ( t==lastToken || t.image.equals("{") || t....
java
public String getText() { StringBuilder text = new StringBuilder(); Token t = firstToken; while ( t!=null ) { text.append(t.image); if ( !t.image.equals(".") ) text.append(" "); if ( t==lastToken || t.image.equals("{") || t....
[ "public", "String", "getText", "(", ")", "{", "StringBuilder", "text", "=", "new", "StringBuilder", "(", ")", ";", "Token", "t", "=", "firstToken", ";", "while", "(", "t", "!=", "null", ")", "{", "text", ".", "append", "(", "t", ".", "image", ")", ...
Get the text of the tokens comprising this node.
[ "Get", "the", "text", "of", "the", "tokens", "comprising", "this", "node", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/SimpleNode.java#L218-L233
116,225
beanshell/beanshell
src/main/java/bsh/util/JConsole.java
JConsole.actionPerformed
public void actionPerformed(ActionEvent event) { String cmd = event.getActionCommand(); if (cmd.equals(CUT)) { text.cut(); } else if (cmd.equals(COPY)) { text.copy(); } else if (cmd.equals(PASTE)) { text.paste(); } }
java
public void actionPerformed(ActionEvent event) { String cmd = event.getActionCommand(); if (cmd.equals(CUT)) { text.cut(); } else if (cmd.equals(COPY)) { text.copy(); } else if (cmd.equals(PASTE)) { text.paste(); } }
[ "public", "void", "actionPerformed", "(", "ActionEvent", "event", ")", "{", "String", "cmd", "=", "event", ".", "getActionCommand", "(", ")", ";", "if", "(", "cmd", ".", "equals", "(", "CUT", ")", ")", "{", "text", ".", "cut", "(", ")", ";", "}", "...
handle cut, copy and paste
[ "handle", "cut", "copy", "and", "paste" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/util/JConsole.java#L734-L743
116,226
beanshell/beanshell
src/main/java/bsh/org/objectweb/asm/TypePath.java
TypePath.put
static void put(final TypePath typePath, final ByteVector output) { if (typePath == null) { output.putByte(0); } else { int length = typePath.typePathContainer[typePath.typePathOffset] * 2 + 1; output.putByteArray(typePath.typePathContainer, typePath.typePathOffset, length); } }
java
static void put(final TypePath typePath, final ByteVector output) { if (typePath == null) { output.putByte(0); } else { int length = typePath.typePathContainer[typePath.typePathOffset] * 2 + 1; output.putByteArray(typePath.typePathContainer, typePath.typePathOffset, length); } }
[ "static", "void", "put", "(", "final", "TypePath", "typePath", ",", "final", "ByteVector", "output", ")", "{", "if", "(", "typePath", "==", "null", ")", "{", "output", ".", "putByte", "(", "0", ")", ";", "}", "else", "{", "int", "length", "=", "typeP...
Puts the type_path JVMS structure corresponding to the given TypePath into the given ByteVector. @param typePath a TypePath instance, or <tt>null</tt> for empty paths. @param output where the type path must be put.
[ "Puts", "the", "type_path", "JVMS", "structure", "corresponding", "to", "the", "given", "TypePath", "into", "the", "given", "ByteVector", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/org/objectweb/asm/TypePath.java#L193-L200
116,227
beanshell/beanshell
src/main/java/bsh/Invocable.java
Invocable.getParamTypeDescriptors
public String [] getParamTypeDescriptors() { return methodType().parameterList().stream() .map(BSHType::getTypeDescriptor).toArray(String[]::new); }
java
public String [] getParamTypeDescriptors() { return methodType().parameterList().stream() .map(BSHType::getTypeDescriptor).toArray(String[]::new); }
[ "public", "String", "[", "]", "getParamTypeDescriptors", "(", ")", "{", "return", "methodType", "(", ")", ".", "parameterList", "(", ")", ".", "stream", "(", ")", ".", "map", "(", "BSHType", "::", "getTypeDescriptor", ")", ".", "toArray", "(", "String", ...
Retrieve a bytecode descriptor representation of the parameter types. @return the bytecode type descriptor
[ "Retrieve", "a", "bytecode", "descriptor", "representation", "of", "the", "parameter", "types", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Invocable.java#L152-L155
116,228
beanshell/beanshell
src/main/java/bsh/Invocable.java
Invocable.collectParamaters
public List<Object> collectParamaters(Object base, Object[] params) throws Throwable { parameters.clear(); for (int i = 0; i < getLastParameterIndex(); i++) parameters.add(coerceToType(params[i], getParameterTypes()[i])); return parameters; }
java
public List<Object> collectParamaters(Object base, Object[] params) throws Throwable { parameters.clear(); for (int i = 0; i < getLastParameterIndex(); i++) parameters.add(coerceToType(params[i], getParameterTypes()[i])); return parameters; }
[ "public", "List", "<", "Object", ">", "collectParamaters", "(", "Object", "base", ",", "Object", "[", "]", "params", ")", "throws", "Throwable", "{", "parameters", ".", "clear", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "getLast...
Basic parameter collection with pulling inherited cascade chaining.
[ "Basic", "parameter", "collection", "with", "pulling", "inherited", "cascade", "chaining", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Invocable.java#L164-L170
116,229
beanshell/beanshell
src/main/java/bsh/Invocable.java
Invocable.coerceToType
protected Object coerceToType(Object param, Class<?> type) throws Throwable { if (type != Object.class) param = Types.castObject(param, type, Types.CAST); return Primitive.unwrap(param); }
java
protected Object coerceToType(Object param, Class<?> type) throws Throwable { if (type != Object.class) param = Types.castObject(param, type, Types.CAST); return Primitive.unwrap(param); }
[ "protected", "Object", "coerceToType", "(", "Object", "param", ",", "Class", "<", "?", ">", "type", ")", "throws", "Throwable", "{", "if", "(", "type", "!=", "Object", ".", "class", ")", "param", "=", "Types", ".", "castObject", "(", "param", ",", "typ...
Coerce parameter values to parameter type and unwrap primitives. @param param the parameter value @param type the parameter type @return unwrapped coerced value @throws Throwable on cast errors
[ "Coerce", "parameter", "values", "to", "parameter", "type", "and", "unwrap", "primitives", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Invocable.java#L177-L182
116,230
beanshell/beanshell
src/main/java/bsh/Invocable.java
Invocable.invokeTarget
private synchronized Object invokeTarget(Object base, Object[] pars) throws Throwable { Reflect.logInvokeMethod("Invoking method (entry): ", this, pars); List<Object> params = collectParamaters(base, pars); Reflect.logInvokeMethod("Invoking method (after): ", this, params); i...
java
private synchronized Object invokeTarget(Object base, Object[] pars) throws Throwable { Reflect.logInvokeMethod("Invoking method (entry): ", this, pars); List<Object> params = collectParamaters(base, pars); Reflect.logInvokeMethod("Invoking method (after): ", this, params); i...
[ "private", "synchronized", "Object", "invokeTarget", "(", "Object", "base", ",", "Object", "[", "]", "pars", ")", "throws", "Throwable", "{", "Reflect", ".", "logInvokeMethod", "(", "\"Invoking method (entry): \"", ",", "this", ",", "pars", ")", ";", "List", "...
All purpose MethodHandle invoke implementation, with or without args. @param base represents the base object instance. @param pars parameter arguments @return invocation result @throws Throwable combined exceptions
[ "All", "purpose", "MethodHandle", "invoke", "implementation", "with", "or", "without", "args", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Invocable.java#L189-L199
116,231
beanshell/beanshell
src/main/java/bsh/Invocable.java
Invocable.invoke
public synchronized Object invoke(Object base, Object... pars) throws InvocationTargetException { if (null == pars) pars = Reflect.ZERO_ARGS; try { return Primitive.wrap( invokeTarget(base, pars), getReturnType()); } catch (Throwabl...
java
public synchronized Object invoke(Object base, Object... pars) throws InvocationTargetException { if (null == pars) pars = Reflect.ZERO_ARGS; try { return Primitive.wrap( invokeTarget(base, pars), getReturnType()); } catch (Throwabl...
[ "public", "synchronized", "Object", "invoke", "(", "Object", "base", ",", "Object", "...", "pars", ")", "throws", "InvocationTargetException", "{", "if", "(", "null", "==", "pars", ")", "pars", "=", "Reflect", ".", "ZERO_ARGS", ";", "try", "{", "return", "...
Abstraction to cleanly apply the primitive result wrapping. @param base represents the base object instance. @param pars parameter arguments @return invocation result @throws InvocationTargetException wrapped target exceptions
[ "Abstraction", "to", "cleanly", "apply", "the", "primitive", "result", "wrapping", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Invocable.java#L206-L217
116,232
beanshell/beanshell
src/main/java/bsh/util/NameCompletionTable.java
NameCompletionTable.add
public void add( NameSource source ) { /* Unimplemented - Need to add an inner class util here that holds the source and monitors it by registering a listener */ if ( sources == null ) sources = new ArrayList(); sources.add( source ); ...
java
public void add( NameSource source ) { /* Unimplemented - Need to add an inner class util here that holds the source and monitors it by registering a listener */ if ( sources == null ) sources = new ArrayList(); sources.add( source ); ...
[ "public", "void", "add", "(", "NameSource", "source", ")", "{", "/*\n Unimplemented -\n Need to add an inner class util here that holds the source and\n monitors it by registering a listener\n */", "if", "(", "sources", "==", "null", ")", "source...
Add a NameSource which is monitored for names. Unimplemented - behavior is broken... no updates
[ "Add", "a", "NameSource", "which", "is", "monitored", "for", "names", ".", "Unimplemented", "-", "behavior", "is", "broken", "...", "no", "updates" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/util/NameCompletionTable.java#L68-L78
116,233
beanshell/beanshell
src/main/java/bsh/CollectionManager.java
CollectionManager.emptyIt
private <T> Iterator<T> emptyIt() { return new Iterator<T>() { @Override public boolean hasNext() { return false; } @Override public T next() { return null; } }; }
java
private <T> Iterator<T> emptyIt() { return new Iterator<T>() { @Override public boolean hasNext() { return false; } @Override public T next() { return null; } }; }
[ "private", "<", "T", ">", "Iterator", "<", "T", ">", "emptyIt", "(", ")", "{", "return", "new", "Iterator", "<", "T", ">", "(", ")", "{", "@", "Override", "public", "boolean", "hasNext", "(", ")", "{", "return", "false", ";", "}", "@", "Override", ...
An empty iterator with hasNext always false. @param <T> generic type, since java can't infer it will be Object @return the null iterator
[ "An", "empty", "iterator", "with", "hasNext", "always", "false", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/CollectionManager.java#L54-L65
116,234
beanshell/beanshell
src/main/java/bsh/CollectionManager.java
CollectionManager.arrayIt
private Iterator<Object> arrayIt(final Object array) { return new Iterator<Object>() { private int index = 0; private final int length = Array.getLength(array); @Override public boolean hasNext() { return this.index < this.length; } ...
java
private Iterator<Object> arrayIt(final Object array) { return new Iterator<Object>() { private int index = 0; private final int length = Array.getLength(array); @Override public boolean hasNext() { return this.index < this.length; } ...
[ "private", "Iterator", "<", "Object", ">", "arrayIt", "(", "final", "Object", "array", ")", "{", "return", "new", "Iterator", "<", "Object", ">", "(", ")", "{", "private", "int", "index", "=", "0", ";", "private", "final", "int", "length", "=", "Array"...
Obfuscated Object type or primitive array iterator. @param array the object array @return the iterator
[ "Obfuscated", "Object", "type", "or", "primitive", "array", "iterator", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/CollectionManager.java#L70-L87
116,235
beanshell/beanshell
src/main/java/bsh/CollectionManager.java
CollectionManager.reflectNames
private Stream<String> reflectNames(Object obj) { Class<?> type = obj.getClass(); if (obj instanceof Class<?>) type = (Class<?>) obj; if (obj instanceof ClassIdentifier) type = ((ClassIdentifier)obj).getTargetClass(); if (Reflect.isGeneratedClass(type)) ...
java
private Stream<String> reflectNames(Object obj) { Class<?> type = obj.getClass(); if (obj instanceof Class<?>) type = (Class<?>) obj; if (obj instanceof ClassIdentifier) type = ((ClassIdentifier)obj).getTargetClass(); if (Reflect.isGeneratedClass(type)) ...
[ "private", "Stream", "<", "String", ">", "reflectNames", "(", "Object", "obj", ")", "{", "Class", "<", "?", ">", "type", "=", "obj", ".", "getClass", "(", ")", ";", "if", "(", "obj", "instanceof", "Class", "<", "?", ">", ")", "type", "=", "(", "C...
Apply reflection to supplied value returning an iterable stream of strings. Allows iteration over true string representations of the class and member definitions. For generated classes the true or bsh definitions are retrieved and not the java reflection of the mock instances. @param obj the type to reflect @return an ...
[ "Apply", "reflection", "to", "supplied", "value", "returning", "an", "iterable", "stream", "of", "strings", ".", "Allows", "iteration", "over", "true", "string", "representations", "of", "the", "class", "and", "member", "definitions", ".", "For", "generated", "c...
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/CollectionManager.java#L97-L123
116,236
beanshell/beanshell
src/main/java/bsh/CollectionManager.java
CollectionManager.getBshIterator
public <T> Iterator<T> getBshIterator(final Enumeration<T> obj) { return Collections.list(obj).iterator(); }
java
public <T> Iterator<T> getBshIterator(final Enumeration<T> obj) { return Collections.list(obj).iterator(); }
[ "public", "<", "T", ">", "Iterator", "<", "T", ">", "getBshIterator", "(", "final", "Enumeration", "<", "T", ">", "obj", ")", "{", "return", "Collections", ".", "list", "(", "obj", ")", ".", "iterator", "(", ")", ";", "}" ]
Gets iterator for enumerated elements. @param obj the enumerated elements @return the bsh iterator
[ "Gets", "iterator", "for", "enumerated", "elements", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/CollectionManager.java#L128-L130
116,237
beanshell/beanshell
src/main/java/bsh/CollectionManager.java
CollectionManager.getBshIterator
public Iterator<Integer> getBshIterator(final Number obj) { int number = obj.intValue(); if (number == 0) return this.emptyIt(); if (number > 0) return IntStream.rangeClosed(0, number).iterator(); return IntStream.rangeClosed(number, 0).map(i -> number - i).iterat...
java
public Iterator<Integer> getBshIterator(final Number obj) { int number = obj.intValue(); if (number == 0) return this.emptyIt(); if (number > 0) return IntStream.rangeClosed(0, number).iterator(); return IntStream.rangeClosed(number, 0).map(i -> number - i).iterat...
[ "public", "Iterator", "<", "Integer", ">", "getBshIterator", "(", "final", "Number", "obj", ")", "{", "int", "number", "=", "obj", ".", "intValue", "(", ")", ";", "if", "(", "number", "==", "0", ")", "return", "this", ".", "emptyIt", "(", ")", ";", ...
Gets iterator for Number range from 0. Range from 0 up to number or 0 down to number inclusive. Empty Iterator if number is 0. @param obj the top range number value @return the bsh iterator
[ "Gets", "iterator", "for", "Number", "range", "from", "0", ".", "Range", "from", "0", "up", "to", "number", "or", "0", "down", "to", "number", "inclusive", ".", "Empty", "Iterator", "if", "number", "is", "0", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/CollectionManager.java#L174-L181
116,238
beanshell/beanshell
src/main/java/bsh/CollectionManager.java
CollectionManager.getBshIterator
public Iterator<String> getBshIterator(final Character obj) { Integer value = Integer.valueOf(obj.charValue()); int check = 33, start = 0; for (int i : unicodeBlockStarts) if (check <= value) { start = check; check = i; } else break; return IntStream.range...
java
public Iterator<String> getBshIterator(final Character obj) { Integer value = Integer.valueOf(obj.charValue()); int check = 33, start = 0; for (int i : unicodeBlockStarts) if (check <= value) { start = check; check = i; } else break; return IntStream.range...
[ "public", "Iterator", "<", "String", ">", "getBshIterator", "(", "final", "Character", "obj", ")", "{", "Integer", "value", "=", "Integer", ".", "valueOf", "(", "obj", ".", "charValue", "(", ")", ")", ";", "int", "check", "=", "33", ",", "start", "=", ...
Gets iterator for character range from highest unicode block set starting position. Range from highest starting position which is less than supplied value code point. @param obj the top of the character range @return the bsh iterator
[ "Gets", "iterator", "for", "character", "range", "from", "highest", "unicode", "block", "set", "starting", "position", ".", "Range", "from", "highest", "starting", "position", "which", "is", "less", "than", "supplied", "value", "code", "point", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/CollectionManager.java#L205-L215
116,239
beanshell/beanshell
src/main/java/bsh/CollectionManager.java
CollectionManager.getBshIterator
public Iterator<?> getBshIterator(final Object obj) { if (obj == null) return this.emptyIt(); if (obj instanceof Primitive) return this.getBshIterator(Primitive.unwrap(obj)); if (obj.getClass().isArray()) return this.arrayIt(obj); if (obj instanceof It...
java
public Iterator<?> getBshIterator(final Object obj) { if (obj == null) return this.emptyIt(); if (obj instanceof Primitive) return this.getBshIterator(Primitive.unwrap(obj)); if (obj.getClass().isArray()) return this.arrayIt(obj); if (obj instanceof It...
[ "public", "Iterator", "<", "?", ">", "getBshIterator", "(", "final", "Object", "obj", ")", "{", "if", "(", "obj", "==", "null", ")", "return", "this", ".", "emptyIt", "(", ")", ";", "if", "(", "obj", "instanceof", "Primitive", ")", "return", "this", ...
Inspect the supplied object and cast type to delegates. @param obj the value to iterate of unknown type. @return the bsh iterator
[ "Inspect", "the", "supplied", "object", "and", "cast", "type", "to", "delegates", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/CollectionManager.java#L220-L242
116,240
beanshell/beanshell
src/main/java/bsh/TargetError.java
TargetError.printTargetError
private synchronized String printTargetError( Throwable t ) { StringBuilder msgs = new StringBuilder(t.toString()); while ( null != (t = t.getCause()) ) msgs.append("\n").append(t.toString()); return msgs.toString(); }
java
private synchronized String printTargetError( Throwable t ) { StringBuilder msgs = new StringBuilder(t.toString()); while ( null != (t = t.getCause()) ) msgs.append("\n").append(t.toString()); return msgs.toString(); }
[ "private", "synchronized", "String", "printTargetError", "(", "Throwable", "t", ")", "{", "StringBuilder", "msgs", "=", "new", "StringBuilder", "(", "t", ".", "toString", "(", ")", ")", ";", "while", "(", "null", "!=", "(", "t", "=", "t", ".", "getCause"...
Generate a printable string showing the wrapped target exceptions. @param t wrapped target exception @return messages unwrapped
[ "Generate", "a", "printable", "string", "showing", "the", "wrapped", "target", "exceptions", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/TargetError.java#L93-L98
116,241
beanshell/beanshell
src/main/java/bsh/EvalError.java
EvalError.getMessage
public String getMessage() { String trace; if ( node != null ) trace = " : at Line: "+ node.getLineNumber() + " : in file: "+ node.getSourceFile() + " : "+node.getText(); else // Users should not normally see this. trace = "...
java
public String getMessage() { String trace; if ( node != null ) trace = " : at Line: "+ node.getLineNumber() + " : in file: "+ node.getSourceFile() + " : "+node.getText(); else // Users should not normally see this. trace = "...
[ "public", "String", "getMessage", "(", ")", "{", "String", "trace", ";", "if", "(", "node", "!=", "null", ")", "trace", "=", "\" : at Line: \"", "+", "node", ".", "getLineNumber", "(", ")", "+", "\" : in file: \"", "+", "node", ".", "getSourceFile", "(", ...
Print the error with line number and stack trace.
[ "Print", "the", "error", "with", "line", "number", "and", "stack", "trace", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/EvalError.java#L64-L79
116,242
beanshell/beanshell
src/main/java/bsh/EvalError.java
EvalError.prependMessage
private void prependMessage( String s ) { if ( s == null ) return; if ( message == null ) message = s; else message = s + " : "+ message; }
java
private void prependMessage( String s ) { if ( s == null ) return; if ( message == null ) message = s; else message = s + " : "+ message; }
[ "private", "void", "prependMessage", "(", "String", "s", ")", "{", "if", "(", "s", "==", "null", ")", "return", ";", "if", "(", "message", "==", "null", ")", "message", "=", "s", ";", "else", "message", "=", "s", "+", "\" : \"", "+", "message", ";"...
Prepend the message if it is non-null.
[ "Prepend", "the", "message", "if", "it", "is", "non", "-", "null", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/EvalError.java#L153-L162
116,243
beanshell/beanshell
src/main/java/bsh/servlet/SimpleTemplate.java
SimpleTemplate.replace
public void replace( String param, String value ) { int [] range; while ( (range = findTemplate( param )) != null ) buff.replace( range[0], range[1], value ); }
java
public void replace( String param, String value ) { int [] range; while ( (range = findTemplate( param )) != null ) buff.replace( range[0], range[1], value ); }
[ "public", "void", "replace", "(", "String", "param", ",", "String", "value", ")", "{", "int", "[", "]", "range", ";", "while", "(", "(", "range", "=", "findTemplate", "(", "param", ")", ")", "!=", "null", ")", "buff", ".", "replace", "(", "range", ...
Substitute the specified text for the parameter
[ "Substitute", "the", "specified", "text", "for", "the", "parameter" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/servlet/SimpleTemplate.java#L147-L151
116,244
beanshell/beanshell
src/main/java/bsh/BlockNameSpace.java
BlockNameSpace.getNonBlockParent
private NameSpace getNonBlockParent() { NameSpace parent = super.getParent(); if ( parent instanceof BlockNameSpace ) return ((BlockNameSpace)parent).getNonBlockParent(); else return parent; }
java
private NameSpace getNonBlockParent() { NameSpace parent = super.getParent(); if ( parent instanceof BlockNameSpace ) return ((BlockNameSpace)parent).getNonBlockParent(); else return parent; }
[ "private", "NameSpace", "getNonBlockParent", "(", ")", "{", "NameSpace", "parent", "=", "super", ".", "getParent", "(", ")", ";", "if", "(", "parent", "instanceof", "BlockNameSpace", ")", "return", "(", "(", "BlockNameSpace", ")", "parent", ")", ".", "getNon...
do we need this?
[ "do", "we", "need", "this?" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BlockNameSpace.java#L139-L146
116,245
beanshell/beanshell
src/main/java/bsh/BSHFormalParameter.java
BSHFormalParameter.eval
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { if ( jjtGetNumChildren() > 0 ) type = ((BSHType)jjtGetChild(0)).getType( callstack, interpreter ); else type = UNTYPED; if (isVarArgs) type = Array.newInstance(ty...
java
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { if ( jjtGetNumChildren() > 0 ) type = ((BSHType)jjtGetChild(0)).getType( callstack, interpreter ); else type = UNTYPED; if (isVarArgs) type = Array.newInstance(ty...
[ "public", "Object", "eval", "(", "CallStack", "callstack", ",", "Interpreter", "interpreter", ")", "throws", "EvalError", "{", "if", "(", "jjtGetNumChildren", "(", ")", ">", "0", ")", "type", "=", "(", "(", "BSHType", ")", "jjtGetChild", "(", "0", ")", "...
Evaluate the type.
[ "Evaluate", "the", "type", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BSHFormalParameter.java#L61-L73
116,246
beanshell/beanshell
src/main/java/bsh/UtilEvalError.java
UtilEvalError.toEvalError
public EvalError toEvalError( String msg, SimpleNode node, CallStack callstack ) { if ( Interpreter.DEBUG.get() ) printStackTrace(); if ( msg == null ) msg = ""; else msg += ": "; return new EvalError( msg + this.getMessage(), node, calls...
java
public EvalError toEvalError( String msg, SimpleNode node, CallStack callstack ) { if ( Interpreter.DEBUG.get() ) printStackTrace(); if ( msg == null ) msg = ""; else msg += ": "; return new EvalError( msg + this.getMessage(), node, calls...
[ "public", "EvalError", "toEvalError", "(", "String", "msg", ",", "SimpleNode", "node", ",", "CallStack", "callstack", ")", "{", "if", "(", "Interpreter", ".", "DEBUG", ".", "get", "(", ")", ")", "printStackTrace", "(", ")", ";", "if", "(", "msg", "==", ...
Re-throw as an eval error, prefixing msg to the message and specifying the node. If a node already exists the addNode is ignored. @see #setNode( bsh.SimpleNode ) <p> @param msg may be null for no additional message.
[ "Re", "-", "throw", "as", "an", "eval", "error", "prefixing", "msg", "to", "the", "message", "and", "specifying", "the", "node", ".", "If", "a", "node", "already", "exists", "the", "addNode", "is", "ignored", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/UtilEvalError.java#L73-L84
116,247
beanshell/beanshell
src/main/java/bsh/StringUtil.java
StringUtil.typeString
public static String typeString(Object value) { return null == value || Primitive.NULL == value ? "null" : value instanceof Primitive ? ((Primitive) value).getType().getSimpleName() : typeString(value.getClass()); }
java
public static String typeString(Object value) { return null == value || Primitive.NULL == value ? "null" : value instanceof Primitive ? ((Primitive) value).getType().getSimpleName() : typeString(value.getClass()); }
[ "public", "static", "String", "typeString", "(", "Object", "value", ")", "{", "return", "null", "==", "value", "||", "Primitive", ".", "NULL", "==", "value", "?", "\"null\"", ":", "value", "instanceof", "Primitive", "?", "(", "(", "Primitive", ")", "value"...
Type from value to string. @param value for type @return string type
[ "Type", "from", "value", "to", "string", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/StringUtil.java#L50-L56
116,248
beanshell/beanshell
src/main/java/bsh/StringUtil.java
StringUtil.typeString
public static String typeString(Class<?> clas) { if (Map.class.isAssignableFrom(clas)) clas = Map.class; else if (List.class.isAssignableFrom(clas)) if (Queue.class.isAssignableFrom(clas)) clas = Queue.class; else clas = List.class; ...
java
public static String typeString(Class<?> clas) { if (Map.class.isAssignableFrom(clas)) clas = Map.class; else if (List.class.isAssignableFrom(clas)) if (Queue.class.isAssignableFrom(clas)) clas = Queue.class; else clas = List.class; ...
[ "public", "static", "String", "typeString", "(", "Class", "<", "?", ">", "clas", ")", "{", "if", "(", "Map", ".", "class", ".", "isAssignableFrom", "(", "clas", ")", ")", "clas", "=", "Map", ".", "class", ";", "else", "if", "(", "List", ".", "class...
Type from class to string. @param clas for type @return string type
[ "Type", "from", "class", "to", "string", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/StringUtil.java#L61-L78
116,249
beanshell/beanshell
src/main/java/bsh/StringUtil.java
StringUtil.typeValueString
public static String typeValueString(final Object value) { StringBuilder sb = new StringBuilder(valueString(value)); return sb.append(" :").append(typeString(value)).toString(); }
java
public static String typeValueString(final Object value) { StringBuilder sb = new StringBuilder(valueString(value)); return sb.append(" :").append(typeString(value)).toString(); }
[ "public", "static", "String", "typeValueString", "(", "final", "Object", "value", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "valueString", "(", "value", ")", ")", ";", "return", "sb", ".", "append", "(", "\" :\"", ")", ".", "append...
Generate string of value and type. @param value to inspect @return string of value :type
[ "Generate", "string", "of", "value", "and", "type", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/StringUtil.java#L83-L86
116,250
beanshell/beanshell
src/main/java/bsh/BSHPrimarySuffix.java
BSHPrimarySuffix.doProperty
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 ); ...
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 ); ...
[ "private", "Object", "doProperty", "(", "boolean", "toLHS", ",", "Object", "obj", ",", "CallStack", "callstack", ",", "Interpreter", "interpreter", ")", "throws", "EvalError", "{", "if", "(", "obj", "==", "Primitive", ".", "VOID", ")", "throw", "new", "EvalE...
Property access. Must handle toLHS case.
[ "Property", "access", ".", "Must", "handle", "toLHS", "case", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BSHPrimarySuffix.java#L353-L385
116,251
beanshell/beanshell
src/main/java/bsh/LHS.java
LHS.writeObject
private synchronized void writeObject(final ObjectOutputStream s) throws IOException { if ( null != field ) { this.object = field.getDeclaringClass(); this.varName = field.getName(); this.field = null; } s.defaultWriteObject(); }
java
private synchronized void writeObject(final ObjectOutputStream s) throws IOException { if ( null != field ) { this.object = field.getDeclaringClass(); this.varName = field.getName(); this.field = null; } s.defaultWriteObject(); }
[ "private", "synchronized", "void", "writeObject", "(", "final", "ObjectOutputStream", "s", ")", "throws", "IOException", "{", "if", "(", "null", "!=", "field", ")", "{", "this", ".", "object", "=", "field", ".", "getDeclaringClass", "(", ")", ";", "this", ...
Reflect Field is not serializable, hide it. @param s serializer @throws IOException mandatory throwing exception
[ "Reflect", "Field", "is", "not", "serializable", "hide", "it", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/LHS.java#L327-L334
116,252
beanshell/beanshell
src/main/java/bsh/LHS.java
LHS.readObject
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); if ( null == this.object ) return; Class<?> cls = this.object.getClass(); if ( this.object instanceof Class ) cls = (Class<?>) this.object; t...
java
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); if ( null == this.object ) return; Class<?> cls = this.object.getClass(); if ( this.object instanceof Class ) cls = (Class<?>) this.object; t...
[ "private", "void", "readObject", "(", "ObjectInputStream", "in", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "in", ".", "defaultReadObject", "(", ")", ";", "if", "(", "null", "==", "this", ".", "object", ")", "return", ";", "Class", "<"...
Fetch field removed from serializer. @param in secializer. @throws IOException mandatory throwing exception @throws ClassNotFoundException mandatory throwing exception
[ "Fetch", "field", "removed", "from", "serializer", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/LHS.java#L340-L348
116,253
beanshell/beanshell
src/main/java/bsh/BshArray.java
BshArray.getIndex
public static Object getIndex(Object array, int index) throws UtilTargetError { Interpreter.debug("getIndex: ", array, ", index=", index); try { if ( array instanceof List ) return ((List<?>) array).get(index); Object val = Array.get(array, index); ...
java
public static Object getIndex(Object array, int index) throws UtilTargetError { Interpreter.debug("getIndex: ", array, ", index=", index); try { if ( array instanceof List ) return ((List<?>) array).get(index); Object val = Array.get(array, index); ...
[ "public", "static", "Object", "getIndex", "(", "Object", "array", ",", "int", "index", ")", "throws", "UtilTargetError", "{", "Interpreter", ".", "debug", "(", "\"getIndex: \"", ",", "array", ",", "\", index=\"", ",", "index", ")", ";", "try", "{", "if", "...
Get object from array or list at index. @param array to retrieve from @param index of the element to retrieve @return Array.get for array or List.get for list @throws UtilTargetError wrapped Index out of bounds
[ "Get", "object", "from", "array", "or", "list", "at", "index", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BshArray.java#L35-L50
116,254
beanshell/beanshell
src/main/java/bsh/BshArray.java
BshArray.setIndex
@SuppressWarnings("unchecked") public static void setIndex(Object array, int index, Object val) throws ReflectError, UtilTargetError { try { val = Primitive.unwrap(val); if ( array instanceof List ) ((List<Object>) array).set(index, val); else ...
java
@SuppressWarnings("unchecked") public static void setIndex(Object array, int index, Object val) throws ReflectError, UtilTargetError { try { val = Primitive.unwrap(val); if ( array instanceof List ) ((List<Object>) array).set(index, val); else ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "void", "setIndex", "(", "Object", "array", ",", "int", "index", ",", "Object", "val", ")", "throws", "ReflectError", ",", "UtilTargetError", "{", "try", "{", "val", "=", "Primitive", "....
Set element value of array or list at index. Array.set for array or List.set for list. @param array to set value for. @param index of the element to set @param val the value to set @throws UtilTargetError wrapped target exceptions
[ "Set", "element", "value", "of", "array", "or", "list", "at", "index", ".", "Array", ".", "set", "for", "array", "or", "List", ".", "set", "for", "list", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BshArray.java#L58-L79
116,255
beanshell/beanshell
src/main/java/bsh/BshArray.java
BshArray.slice
public static Object slice(List<Object> list, int from, int to, int step) { int length = list.size(); if ( to > length ) to = length; if ( 0 > from ) from = 0; length = to - from; if ( 0 >= length ) return list.subList(0, 0); if ( step == 0 || step == 1 ) ...
java
public static Object slice(List<Object> list, int from, int to, int step) { int length = list.size(); if ( to > length ) to = length; if ( 0 > from ) from = 0; length = to - from; if ( 0 >= length ) return list.subList(0, 0); if ( step == 0 || step == 1 ) ...
[ "public", "static", "Object", "slice", "(", "List", "<", "Object", ">", "list", ",", "int", "from", ",", "int", "to", ",", "int", "step", ")", "{", "int", "length", "=", "list", ".", "size", "(", ")", ";", "if", "(", "to", ">", "length", ")", "...
Slice the supplied list for range and step. @param list to slice @param from start index inclusive @param to to index exclusive @param step size of step or 0 if no step @return a sliced view of the supplied list
[ "Slice", "the", "supplied", "list", "for", "range", "and", "step", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BshArray.java#L87-L101
116,256
beanshell/beanshell
src/main/java/bsh/BshArray.java
BshArray.slice
public static Object slice(Object arr, int from, int to, int step) { Class<?> toType = Types.arrayElementType(arr.getClass()); int length = Array.getLength(arr); if ( to > length ) to = length; if ( 0 > from ) from = 0; length = to - from; if ( 0 >= length ) r...
java
public static Object slice(Object arr, int from, int to, int step) { Class<?> toType = Types.arrayElementType(arr.getClass()); int length = Array.getLength(arr); if ( to > length ) to = length; if ( 0 > from ) from = 0; length = to - from; if ( 0 >= length ) r...
[ "public", "static", "Object", "slice", "(", "Object", "arr", ",", "int", "from", ",", "int", "to", ",", "int", "step", ")", "{", "Class", "<", "?", ">", "toType", "=", "Types", ".", "arrayElementType", "(", "arr", ".", "getClass", "(", ")", ")", ";...
Slice the supplied array for range and step. @param arr to slice @param from start index inclusive @param to to index exclusive @param step size of step or 0 if no step @return a new array instance sliced
[ "Slice", "the", "supplied", "array", "for", "range", "and", "step", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BshArray.java#L109-L129
116,257
beanshell/beanshell
src/main/java/bsh/BshArray.java
BshArray.repeat
public static Object repeat(List<Object> list, int times) { if ( times < 1 ) if (list instanceof Queue) return new LinkedList<>(); else return new ArrayList<>(0); List<Object> lst = list instanceof Queue ? new LinkedList...
java
public static Object repeat(List<Object> list, int times) { if ( times < 1 ) if (list instanceof Queue) return new LinkedList<>(); else return new ArrayList<>(0); List<Object> lst = list instanceof Queue ? new LinkedList...
[ "public", "static", "Object", "repeat", "(", "List", "<", "Object", ">", "list", ",", "int", "times", ")", "{", "if", "(", "times", "<", "1", ")", "if", "(", "list", "instanceof", "Queue", ")", "return", "new", "LinkedList", "<>", "(", ")", ";", "e...
Repeat the contents of a list a number of times. @param list the list to repeat @param times number of repetitions @return a new list instance with repeated contents
[ "Repeat", "the", "contents", "of", "a", "list", "a", "number", "of", "times", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BshArray.java#L135-L149
116,258
beanshell/beanshell
src/main/java/bsh/BshArray.java
BshArray.repeat
public static Object repeat(Object arr, int times) { Class<?> toType = Types.arrayElementType(arr.getClass()); if ( times < 1 ) return Array.newInstance(toType, 0); int[] dims = dimensions(arr); int length = dims[0]; dims[0] *= times; int i = 0, total = dims[0...
java
public static Object repeat(Object arr, int times) { Class<?> toType = Types.arrayElementType(arr.getClass()); if ( times < 1 ) return Array.newInstance(toType, 0); int[] dims = dimensions(arr); int length = dims[0]; dims[0] *= times; int i = 0, total = dims[0...
[ "public", "static", "Object", "repeat", "(", "Object", "arr", ",", "int", "times", ")", "{", "Class", "<", "?", ">", "toType", "=", "Types", ".", "arrayElementType", "(", "arr", ".", "getClass", "(", ")", ")", ";", "if", "(", "times", "<", "1", ")"...
Repeat the contents of an array a number of times. @param arr the array object to repeat @param times number of repetitions @return a new array instance with repeated contents
[ "Repeat", "the", "contents", "of", "an", "array", "a", "number", "of", "times", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BshArray.java#L155-L169
116,259
beanshell/beanshell
src/main/java/bsh/BshArray.java
BshArray.concat
public static Object concat(List<?> lhs, List<?> rhs) { List<Object> list = lhs instanceof Queue ? new LinkedList<>(lhs) : new ArrayList<>(lhs); list.addAll(rhs); return list; }
java
public static Object concat(List<?> lhs, List<?> rhs) { List<Object> list = lhs instanceof Queue ? new LinkedList<>(lhs) : new ArrayList<>(lhs); list.addAll(rhs); return list; }
[ "public", "static", "Object", "concat", "(", "List", "<", "?", ">", "lhs", ",", "List", "<", "?", ">", "rhs", ")", "{", "List", "<", "Object", ">", "list", "=", "lhs", "instanceof", "Queue", "?", "new", "LinkedList", "<>", "(", "lhs", ")", ":", "...
Concatenate two lists. @param lhs 1st list @param rhs 2nd list @return a new list instance of concatenated contents.
[ "Concatenate", "two", "lists", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BshArray.java#L175-L181
116,260
beanshell/beanshell
src/main/java/bsh/BshArray.java
BshArray.dimensions
public static int[] dimensions(Object arr) { int[] dims = new int[Types.arrayDimensions(arr.getClass())]; if ( 0 == dims.length || 0 == (dims[0] = Array.getLength(arr)) ) return dims; for ( int i = 1; i < dims.length; i++ ) if ( null != (arr = Array.get(arr, 0)) ) ...
java
public static int[] dimensions(Object arr) { int[] dims = new int[Types.arrayDimensions(arr.getClass())]; if ( 0 == dims.length || 0 == (dims[0] = Array.getLength(arr)) ) return dims; for ( int i = 1; i < dims.length; i++ ) if ( null != (arr = Array.get(arr, 0)) ) ...
[ "public", "static", "int", "[", "]", "dimensions", "(", "Object", "arr", ")", "{", "int", "[", "]", "dims", "=", "new", "int", "[", "Types", ".", "arrayDimensions", "(", "arr", ".", "getClass", "(", ")", ")", "]", ";", "if", "(", "0", "==", "dims...
Collect dimensions array of supplied array object. Returns the integer array used for Array.newInstance. @param arr to inspect @return int array of dimensions
[ "Collect", "dimensions", "array", "of", "supplied", "array", "object", ".", "Returns", "the", "integer", "array", "used", "for", "Array", ".", "newInstance", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BshArray.java#L209-L218
116,261
beanshell/beanshell
src/main/java/bsh/BshArray.java
BshArray.mapOfEntries
private static Map<?, ?> mapOfEntries( Entry<?, ?>... entries ) { Map<Object, Object> looseTypedMap = new LinkedHashMap<>( entries.length ); for (Entry<?, ?> entry : entries) looseTypedMap.put(entry.getKey(), entry.getValue()); return looseTypedMap; }
java
private static Map<?, ?> mapOfEntries( Entry<?, ?>... entries ) { Map<Object, Object> looseTypedMap = new LinkedHashMap<>( entries.length ); for (Entry<?, ?> entry : entries) looseTypedMap.put(entry.getKey(), entry.getValue()); return looseTypedMap; }
[ "private", "static", "Map", "<", "?", ",", "?", ">", "mapOfEntries", "(", "Entry", "<", "?", ",", "?", ">", "...", "entries", ")", "{", "Map", "<", "Object", ",", "Object", ">", "looseTypedMap", "=", "new", "LinkedHashMap", "<>", "(", "entries", ".",...
Relaxed implementation of the java 9 Map.ofEntries. LinkedHashMap ensures element order remains as supplied. @param entries array of Map.Entry elements @return a mutable, type relaxed LinkedHashMap
[ "Relaxed", "implementation", "of", "the", "java", "9", "Map", ".", "ofEntries", ".", "LinkedHashMap", "ensures", "element", "order", "remains", "as", "supplied", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BshArray.java#L292-L297
116,262
beanshell/beanshell
src/main/java/bsh/BshArray.java
BshArray.commonType
public static Class<?> commonType(Class<?> baseType, Object fromValue, IntSupplier length) { if ( Object.class != baseType ) return baseType; Class<?> common = null; int len = length.getAsInt(); for (int i = 0; i < len; i++) if ( Object.class == (common = Types.ge...
java
public static Class<?> commonType(Class<?> baseType, Object fromValue, IntSupplier length) { if ( Object.class != baseType ) return baseType; Class<?> common = null; int len = length.getAsInt(); for (int i = 0; i < len; i++) if ( Object.class == (common = Types.ge...
[ "public", "static", "Class", "<", "?", ">", "commonType", "(", "Class", "<", "?", ">", "baseType", ",", "Object", "fromValue", ",", "IntSupplier", "length", ")", "{", "if", "(", "Object", ".", "class", "!=", "baseType", ")", "return", "baseType", ";", ...
Find a more specific type if the element type is Object.class. @param baseType the element type @param fromValue the array to inspect @param length the length of the array @return baseType unless baseType is Object.class and common is not
[ "Find", "a", "more", "specific", "type", "if", "the", "element", "type", "is", "Object", ".", "class", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BshArray.java#L388-L400
116,263
beanshell/beanshell
src/main/java/bsh/Name.java
Name.toObject
public Object toObject( CallStack callstack, Interpreter interpreter ) throws UtilEvalError { return toObject( callstack, interpreter, false ); }
java
public Object toObject( CallStack callstack, Interpreter interpreter ) throws UtilEvalError { return toObject( callstack, interpreter, false ); }
[ "public", "Object", "toObject", "(", "CallStack", "callstack", ",", "Interpreter", "interpreter", ")", "throws", "UtilEvalError", "{", "return", "toObject", "(", "callstack", ",", "interpreter", ",", "false", ")", ";", "}" ]
Resolve possibly complex name to an object value. Throws EvalError on various failures. A null object value is indicated by a Primitive.NULL. A return type of Primitive.VOID comes from attempting to access an undefined variable. Some cases: myVariable myVariable.foo myVariable.foo.bar java.awt.GridBagConstraints.BOTH...
[ "Resolve", "possibly", "complex", "name", "to", "an", "object", "value", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Name.java#L174-L178
116,264
beanshell/beanshell
src/main/java/bsh/Name.java
Name.resolveThisFieldReference
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 fi...
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 fi...
[ "Object", "resolveThisFieldReference", "(", "CallStack", "callstack", ",", "NameSpace", "thisNameSpace", ",", "Interpreter", "interpreter", ",", "String", "varName", ",", "boolean", "specialFieldsVisible", ")", "throws", "UtilEvalError", "{", "if", "(", "varName", "."...
Resolve a variable relative to a This reference. This is the general variable resolution method, accommodating special fields from the This context. Together the namespace and interpreter comprise the This context. The callstack, if available allows for the this.caller construct. Optionally interpret special "magic"...
[ "Resolve", "a", "variable", "relative", "to", "a", "This", "reference", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Name.java#L462-L586
116,265
beanshell/beanshell
src/main/java/bsh/servlet/BshServlet.java
BshServlet.escape
public static String escape(String value) { String search = "&<>"; String[] replace = {"&amp;", "&lt;", "&gt;"}; StringBuilder buf = new StringBuilder(); for (int i = 0; i < value.length(); i++) { char c = value.charAt(i); int pos = search.indexOf(c)...
java
public static String escape(String value) { String search = "&<>"; String[] replace = {"&amp;", "&lt;", "&gt;"}; StringBuilder buf = new StringBuilder(); for (int i = 0; i < value.length(); i++) { char c = value.charAt(i); int pos = search.indexOf(c)...
[ "public", "static", "String", "escape", "(", "String", "value", ")", "{", "String", "search", "=", "\"&<>\"", ";", "String", "[", "]", "replace", "=", "{", "\"&amp;\"", ",", "\"&lt;\"", ",", "\"&gt;\"", "}", ";", "StringBuilder", "buf", "=", "new", "Stri...
Convert special characters to entities for XML output
[ "Convert", "special", "characters", "to", "entities", "for", "XML", "output" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/servlet/BshServlet.java#L295-L313
116,266
beanshell/beanshell
src/main/java/bsh/util/ReferenceCache.java
ReferenceCache.get
public V get(K key) { if (null == key) return null; CacheReference<K> refKey = lookupFactory.createKey(key, queue); if (cache.containsKey(refKey)) { V value = dereferenceValue(cache.get(refKey)); if (null != value) return value; cac...
java
public V get(K key) { if (null == key) return null; CacheReference<K> refKey = lookupFactory.createKey(key, queue); if (cache.containsKey(refKey)) { V value = dereferenceValue(cache.get(refKey)); if (null != value) return value; cac...
[ "public", "V", "get", "(", "K", "key", ")", "{", "if", "(", "null", "==", "key", ")", "return", "null", ";", "CacheReference", "<", "K", ">", "refKey", "=", "lookupFactory", ".", "createKey", "(", "key", ",", "queue", ")", ";", "if", "(", "cache", ...
Get a value from the cache for associated with the supplied key. New entries will be initialized if they don't exist or if they were cleared and will block to wait for a value to return. For asynchronous non blocking value creation use init. @param key associated with cache value @return value associated with the key
[ "Get", "a", "value", "from", "the", "cache", "for", "associated", "with", "the", "supplied", "key", ".", "New", "entries", "will", "be", "initialized", "if", "they", "don", "t", "exist", "or", "if", "they", "were", "cleared", "and", "will", "block", "to"...
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/util/ReferenceCache.java#L78-L90
116,267
beanshell/beanshell
src/main/java/bsh/util/ReferenceCache.java
ReferenceCache.init
public void init(K key) { if (null == key) return; CacheReference<K> refKey = keyFactory.createKey(key, queue); if (cache.containsKey(refKey)) return; FutureTask<CacheReference<V>> task = new FutureTask<>(()-> { V created = requireNonNull(create(key));...
java
public void init(K key) { if (null == key) return; CacheReference<K> refKey = keyFactory.createKey(key, queue); if (cache.containsKey(refKey)) return; FutureTask<CacheReference<V>> task = new FutureTask<>(()-> { V created = requireNonNull(create(key));...
[ "public", "void", "init", "(", "K", "key", ")", "{", "if", "(", "null", "==", "key", ")", "return", ";", "CacheReference", "<", "K", ">", "refKey", "=", "keyFactory", ".", "createKey", "(", "key", ",", "queue", ")", ";", "if", "(", "cache", ".", ...
Asynchronously initialize a new cache value to associate with key. If key is null or key already exist will do nothing. Wraps the create method in a future task and starts a new process. @param key associated with cache value
[ "Asynchronously", "initialize", "a", "new", "cache", "value", "to", "associate", "with", "key", ".", "If", "key", "is", "null", "or", "key", "already", "exist", "will", "do", "nothing", ".", "Wraps", "the", "create", "method", "in", "a", "future", "task", ...
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/util/ReferenceCache.java#L96-L108
116,268
beanshell/beanshell
src/main/java/bsh/util/ReferenceCache.java
ReferenceCache.remove
public boolean remove(K key) { if (null == key) return false; CacheReference<K> keyRef = lookupFactory.createKey(key, queue); return CacheKey.class.cast(keyRef).removeCacheEntry(); }
java
public boolean remove(K key) { if (null == key) return false; CacheReference<K> keyRef = lookupFactory.createKey(key, queue); return CacheKey.class.cast(keyRef).removeCacheEntry(); }
[ "public", "boolean", "remove", "(", "K", "key", ")", "{", "if", "(", "null", "==", "key", ")", "return", "false", ";", "CacheReference", "<", "K", ">", "keyRef", "=", "lookupFactory", ".", "createKey", "(", "key", ",", "queue", ")", ";", "return", "C...
Remove cache entry associated with the given key. @param key associated with cache value @return true if there was an entry to remove
[ "Remove", "cache", "entry", "associated", "with", "the", "given", "key", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/util/ReferenceCache.java#L113-L118
116,269
beanshell/beanshell
src/main/java/bsh/util/ReferenceCache.java
ReferenceCache.toFactory
private final ReferenceFactory<K,V> toFactory(Type type) { switch (type) { case Hard : return new HardReferenceFactory(); case Weak : return new WeakReferenceFactory(); case Soft : return new SoftReferenceFactory(); default : return null; } }
java
private final ReferenceFactory<K,V> toFactory(Type type) { switch (type) { case Hard : return new HardReferenceFactory(); case Weak : return new WeakReferenceFactory(); case Soft : return new SoftReferenceFactory(); default : return null; } }
[ "private", "final", "ReferenceFactory", "<", "K", ",", "V", ">", "toFactory", "(", "Type", "type", ")", "{", "switch", "(", "type", ")", "{", "case", "Hard", ":", "return", "new", "HardReferenceFactory", "(", ")", ";", "case", "Weak", ":", "return", "n...
Create a reference factory of the given type. @param type type of reference factory @return a reference factory
[ "Create", "a", "reference", "factory", "of", "the", "given", "type", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/util/ReferenceCache.java#L132-L139
116,270
beanshell/beanshell
src/main/java/bsh/util/ReferenceCache.java
ReferenceCache.dereferenceValue
private V dereferenceValue(Future<CacheReference<V>> futureValue) { try { return dereferenceValue(futureValue.get()); } catch (final Throwable e) { return null; } }
java
private V dereferenceValue(Future<CacheReference<V>> futureValue) { try { return dereferenceValue(futureValue.get()); } catch (final Throwable e) { return null; } }
[ "private", "V", "dereferenceValue", "(", "Future", "<", "CacheReference", "<", "V", ">", ">", "futureValue", ")", "{", "try", "{", "return", "dereferenceValue", "(", "futureValue", ".", "get", "(", ")", ")", ";", "}", "catch", "(", "final", "Throwable", ...
Retrieve a referenced value from a future and dereference it. @param futureValue a future value @return dereferenced value
[ "Retrieve", "a", "referenced", "value", "from", "a", "future", "and", "dereference", "it", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/util/ReferenceCache.java#L151-L157
116,271
beanshell/beanshell
src/main/java/bsh/Types.java
Types.getTypes
public static Class<?>[] getTypes( Object[] args ) { if ( args == null ) return Reflect.ZERO_TYPES; Class<?>[] types = new Class[ args.length ]; for( int i=0; i < args.length; i++ ) types[i] = getType(args[i]); return types; }
java
public static Class<?>[] getTypes( Object[] args ) { if ( args == null ) return Reflect.ZERO_TYPES; Class<?>[] types = new Class[ args.length ]; for( int i=0; i < args.length; i++ ) types[i] = getType(args[i]); return types; }
[ "public", "static", "Class", "<", "?", ">", "[", "]", "getTypes", "(", "Object", "[", "]", "args", ")", "{", "if", "(", "args", "==", "null", ")", "return", "Reflect", ".", "ZERO_TYPES", ";", "Class", "<", "?", ">", "[", "]", "types", "=", "new",...
Get the Java types of the arguments. @param args object array of argument values. @return class array of argument types.
[ "Get", "the", "Java", "types", "of", "the", "arguments", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Types.java#L148-L159
116,272
beanshell/beanshell
src/main/java/bsh/Types.java
Types.getType
public static Class<?> getType( Object arg, boolean boxed ) { if ( null == arg || Primitive.NULL == arg ) return null; if ( arg instanceof Primitive && !boxed ) return ((Primitive) arg).getType(); return Primitive.unwrap(arg).getClass(); }
java
public static Class<?> getType( Object arg, boolean boxed ) { if ( null == arg || Primitive.NULL == arg ) return null; if ( arg instanceof Primitive && !boxed ) return ((Primitive) arg).getType(); return Primitive.unwrap(arg).getClass(); }
[ "public", "static", "Class", "<", "?", ">", "getType", "(", "Object", "arg", ",", "boolean", "boxed", ")", "{", "if", "(", "null", "==", "arg", "||", "Primitive", ".", "NULL", "==", "arg", ")", "return", "null", ";", "if", "(", "arg", "instanceof", ...
Find the type of an object boxed or not. @param arg the object to query. @param boxed whether to get a primitive or boxed type. @return null if arg null, type of Primitive or getClass.
[ "Find", "the", "type", "of", "an", "object", "boxed", "or", "not", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Types.java#L172-L178
116,273
beanshell/beanshell
src/main/java/bsh/Types.java
Types.areSignaturesEqual
static boolean areSignaturesEqual(Class[] from, Class[] to) { if (from.length != to.length) return false; for (int i = 0; i < from.length; i++) if (from[i] != to[i]) return false; return true; }
java
static boolean areSignaturesEqual(Class[] from, Class[] to) { if (from.length != to.length) return false; for (int i = 0; i < from.length; i++) if (from[i] != to[i]) return false; return true; }
[ "static", "boolean", "areSignaturesEqual", "(", "Class", "[", "]", "from", ",", "Class", "[", "]", "to", ")", "{", "if", "(", "from", ".", "length", "!=", "to", ".", "length", ")", "return", "false", ";", "for", "(", "int", "i", "=", "0", ";", "i...
Are the two signatures exactly equal? This is checked for a special case in overload resolution.
[ "Are", "the", "two", "signatures", "exactly", "equal?", "This", "is", "checked", "for", "a", "special", "case", "in", "overload", "resolution", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Types.java#L220-L230
116,274
beanshell/beanshell
src/main/java/bsh/Types.java
Types.arrayElementType
public static Class<?> arrayElementType(Class<?> arrType) { if ( null == arrType ) return null; while ( arrType.isArray() ) arrType = arrType.getComponentType(); return arrType; }
java
public static Class<?> arrayElementType(Class<?> arrType) { if ( null == arrType ) return null; while ( arrType.isArray() ) arrType = arrType.getComponentType(); return arrType; }
[ "public", "static", "Class", "<", "?", ">", "arrayElementType", "(", "Class", "<", "?", ">", "arrType", ")", "{", "if", "(", "null", "==", "arrType", ")", "return", "null", ";", "while", "(", "arrType", ".", "isArray", "(", ")", ")", "arrType", "=", ...
Find array element type for class. Roll back component type until class is not an array anymore. @param arrType the class to inspect @return null if type is null or the class when class not array
[ "Find", "array", "element", "type", "for", "class", ".", "Roll", "back", "component", "type", "until", "class", "is", "not", "an", "array", "anymore", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Types.java#L387-L393
116,275
beanshell/beanshell
src/main/java/bsh/Types.java
Types.arrayDimensions
public static int arrayDimensions(Class<?> arrType) { if ( null == arrType || !arrType.isArray() ) return 0; return arrType.getName().lastIndexOf('[') + 1; }
java
public static int arrayDimensions(Class<?> arrType) { if ( null == arrType || !arrType.isArray() ) return 0; return arrType.getName().lastIndexOf('[') + 1; }
[ "public", "static", "int", "arrayDimensions", "(", "Class", "<", "?", ">", "arrType", ")", "{", "if", "(", "null", "==", "arrType", "||", "!", "arrType", ".", "isArray", "(", ")", ")", "return", "0", ";", "return", "arrType", ".", "getName", "(", ")"...
Find the number of array dimensions for class. By counting the number of [ prefixing the class name. @param arrType the class to inspect @return number of [ name prefixes
[ "Find", "the", "number", "of", "array", "dimensions", "for", "class", ".", "By", "counting", "the", "number", "of", "[", "prefixing", "the", "class", "name", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Types.java#L399-L403
116,276
beanshell/beanshell
src/main/java/bsh/Types.java
Types.getCommonType
public static Class<?> getCommonType(Class<?> common, Class<?> compare) { if ( null == common ) return compare; if ( null == compare || common.isAssignableFrom(compare) ) return common; // pick the largest number type based on NUMBER_ORDER definitions if ( NUMBER...
java
public static Class<?> getCommonType(Class<?> common, Class<?> compare) { if ( null == common ) return compare; if ( null == compare || common.isAssignableFrom(compare) ) return common; // pick the largest number type based on NUMBER_ORDER definitions if ( NUMBER...
[ "public", "static", "Class", "<", "?", ">", "getCommonType", "(", "Class", "<", "?", ">", "common", ",", "Class", "<", "?", ">", "compare", ")", "{", "if", "(", "null", "==", "common", ")", "return", "compare", ";", "if", "(", "null", "==", "compar...
Find the common type between two classes. @param common most likely common class @param compare class compared with @return the class representing the most common type.
[ "Find", "the", "common", "type", "between", "two", "classes", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Types.java#L409-L431
116,277
beanshell/beanshell
src/main/java/bsh/Types.java
Types.castError
static UtilEvalError castError( Class lhsType, Class rhsType, int operation ) { return castError( StringUtil.typeString(lhsType), StringUtil.typeString(rhsType), operation ); }
java
static UtilEvalError castError( Class lhsType, Class rhsType, int operation ) { return castError( StringUtil.typeString(lhsType), StringUtil.typeString(rhsType), operation ); }
[ "static", "UtilEvalError", "castError", "(", "Class", "lhsType", ",", "Class", "rhsType", ",", "int", "operation", ")", "{", "return", "castError", "(", "StringUtil", ".", "typeString", "(", "lhsType", ")", ",", "StringUtil", ".", "typeString", "(", "rhsType",...
Return a UtilEvalError or UtilTargetError wrapping a ClassCastException describing an illegal assignment or illegal cast, respectively.
[ "Return", "a", "UtilEvalError", "or", "UtilTargetError", "wrapping", "a", "ClassCastException", "describing", "an", "illegal", "assignment", "or", "illegal", "cast", "respectively", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Types.java#L675-L681
116,278
beanshell/beanshell
src/main/java/bsh/Types.java
Types.getBaseName
public static String getBaseName(String className) { int i = className.indexOf("$"); if (i == -1) return className; return className.substring(i + 1); }
java
public static String getBaseName(String className) { int i = className.indexOf("$"); if (i == -1) return className; return className.substring(i + 1); }
[ "public", "static", "String", "getBaseName", "(", "String", "className", ")", "{", "int", "i", "=", "className", ".", "indexOf", "(", "\"$\"", ")", ";", "if", "(", "i", "==", "-", "1", ")", "return", "className", ";", "return", "className", ".", "subst...
Return the baseName of an inner class. This should live in utilities somewhere. @param className the class name to modify @return the name before $ of a class
[ "Return", "the", "baseName", "of", "an", "inner", "class", ".", "This", "should", "live", "in", "utilities", "somewhere", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Types.java#L699-L705
116,279
beanshell/beanshell
src/main/java/bsh/BSHFormalParameters.java
BSHFormalParameters.eval
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 par...
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 par...
[ "public", "Object", "eval", "(", "CallStack", "callstack", ",", "Interpreter", "interpreter", ")", "throws", "EvalError", "{", "if", "(", "paramTypes", "!=", "null", ")", "return", "paramTypes", ";", "insureParsed", "(", ")", ";", "Class", "[", "]", "paramTy...
Evaluate the types. Note that type resolution does not require the interpreter instance.
[ "Evaluate", "the", "types", ".", "Note", "that", "type", "resolution", "does", "not", "require", "the", "interpreter", "instance", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BSHFormalParameters.java#L101-L119
116,280
beanshell/beanshell
src/main/java/bsh/org/objectweb/asm/MethodWriter.java
MethodWriter.computeMethodInfoSize
int computeMethodInfoSize() { // If this method_info must be copied from an existing one, the size computation is trivial. if (sourceOffset != 0) { // sourceLength excludes the first 6 bytes for access_flags, name_index and descriptor_index. return 6 + sourceLength; } // 2 bytes each for acc...
java
int computeMethodInfoSize() { // If this method_info must be copied from an existing one, the size computation is trivial. if (sourceOffset != 0) { // sourceLength excludes the first 6 bytes for access_flags, name_index and descriptor_index. return 6 + sourceLength; } // 2 bytes each for acc...
[ "int", "computeMethodInfoSize", "(", ")", "{", "// If this method_info must be copied from an existing one, the size computation is trivial.", "if", "(", "sourceOffset", "!=", "0", ")", "{", "// sourceLength excludes the first 6 bytes for access_flags, name_index and descriptor_index.", ...
Returns the size of the method_info JVMS structure generated by this MethodWriter. Also add the names of the attributes of this method in the constant pool. @return the size in bytes of the method_info JVMS structure.
[ "Returns", "the", "size", "of", "the", "method_info", "JVMS", "structure", "generated", "by", "this", "MethodWriter", ".", "Also", "add", "the", "names", "of", "the", "attributes", "of", "this", "method", "in", "the", "constant", "pool", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/org/objectweb/asm/MethodWriter.java#L1830-L1904
116,281
beanshell/beanshell
src/main/java/bsh/engine/ScriptContextEngineView.java
ScriptContextEngineView.put
@Override public Object put(String key, Object value) { Object oldValue = context.getAttribute(key, ENGINE_SCOPE); context.setAttribute(key, value, ENGINE_SCOPE); return oldValue; }
java
@Override public Object put(String key, Object value) { Object oldValue = context.getAttribute(key, ENGINE_SCOPE); context.setAttribute(key, value, ENGINE_SCOPE); return oldValue; }
[ "@", "Override", "public", "Object", "put", "(", "String", "key", ",", "Object", "value", ")", "{", "Object", "oldValue", "=", "context", ".", "getAttribute", "(", "key", ",", "ENGINE_SCOPE", ")", ";", "context", ".", "setAttribute", "(", "key", ",", "va...
Set the key, value binding in the ENGINE_SCOPE of the context. @param key key with which the specified value is to be associated. @param value value to be associated with the specified key. @return previous value associated with specified key, or <tt>null</tt> if there was no mapping for key. A <tt>null</tt> return...
[ "Set", "the", "key", "value", "binding", "in", "the", "ENGINE_SCOPE", "of", "the", "context", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/engine/ScriptContextEngineView.java#L131-L136
116,282
beanshell/beanshell
src/main/java/bsh/engine/ScriptContextEngineView.java
ScriptContextEngineView.putAll
@Override public void putAll(Map<? extends String, ? extends Object> t) { context.getBindings(ENGINE_SCOPE).putAll(t); }
java
@Override public void putAll(Map<? extends String, ? extends Object> t) { context.getBindings(ENGINE_SCOPE).putAll(t); }
[ "@", "Override", "public", "void", "putAll", "(", "Map", "<", "?", "extends", "String", ",", "?", "extends", "Object", ">", "t", ")", "{", "context", ".", "getBindings", "(", "ENGINE_SCOPE", ")", ".", "putAll", "(", "t", ")", ";", "}" ]
Put the bindings into the ENGINE_SCOPE of the context. @param t Mappings to be stored in this map. @throws UnsupportedOperationException if the <tt>putAll</tt> method is not supported by this map. @throws ClassCastException if the class of a key or value in the specified map prevents it from being stored in ...
[ "Put", "the", "bindings", "into", "the", "ENGINE_SCOPE", "of", "the", "context", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/engine/ScriptContextEngineView.java#L153-L156
116,283
beanshell/beanshell
src/main/java/bsh/org/objectweb/asm/Type.java
Type.getDescriptor
public String getDescriptor() { if (sort == OBJECT) { return valueBuffer.substring(valueBegin - 1, valueEnd + 1); } else if (sort == INTERNAL) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append('L'); stringBuilder.append(valueBuffer, valueBegin, valueEnd); st...
java
public String getDescriptor() { if (sort == OBJECT) { return valueBuffer.substring(valueBegin - 1, valueEnd + 1); } else if (sort == INTERNAL) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append('L'); stringBuilder.append(valueBuffer, valueBegin, valueEnd); st...
[ "public", "String", "getDescriptor", "(", ")", "{", "if", "(", "sort", "==", "OBJECT", ")", "{", "return", "valueBuffer", ".", "substring", "(", "valueBegin", "-", "1", ",", "valueEnd", "+", "1", ")", ";", "}", "else", "if", "(", "sort", "==", "INTER...
Returns the descriptor corresponding to this type. @return the descriptor corresponding to this type.
[ "Returns", "the", "descriptor", "corresponding", "to", "this", "type", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/org/objectweb/asm/Type.java#L579-L591
116,284
beanshell/beanshell
src/main/java/bsh/org/objectweb/asm/Type.java
Type.appendDescriptor
private static void appendDescriptor(final StringBuilder stringBuilder, final Class<?> clazz) { Class<?> currentClass = clazz; while (currentClass.isArray()) { stringBuilder.append('['); currentClass = currentClass.getComponentType(); } if (currentClass.isPrimitive()) { char descriptor...
java
private static void appendDescriptor(final StringBuilder stringBuilder, final Class<?> clazz) { Class<?> currentClass = clazz; while (currentClass.isArray()) { stringBuilder.append('['); currentClass = currentClass.getComponentType(); } if (currentClass.isPrimitive()) { char descriptor...
[ "private", "static", "void", "appendDescriptor", "(", "final", "StringBuilder", "stringBuilder", ",", "final", "Class", "<", "?", ">", "clazz", ")", "{", "Class", "<", "?", ">", "currentClass", "=", "clazz", ";", "while", "(", "currentClass", ".", "isArray",...
Appends the descriptor of the given class to the given string builder. @param stringBuilder the string builder to which the descriptor must be appended. @param clazz the class whose descriptor must be computed.
[ "Appends", "the", "descriptor", "of", "the", "given", "class", "to", "the", "given", "string", "builder", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/org/objectweb/asm/Type.java#L696-L736
116,285
beanshell/beanshell
src/main/java/bsh/org/objectweb/asm/Frame.java
Frame.setInputFrameFromApiFormat
final void setInputFrameFromApiFormat( final SymbolTable symbolTable, final int nLocal, final Object[] local, final int nStack, final Object[] stack) { int inputLocalIndex = 0; for (int i = 0; i < nLocal; ++i) { inputLocals[inputLocalIndex++] = getAbstractTypeFromApiFormat(sy...
java
final void setInputFrameFromApiFormat( final SymbolTable symbolTable, final int nLocal, final Object[] local, final int nStack, final Object[] stack) { int inputLocalIndex = 0; for (int i = 0; i < nLocal; ++i) { inputLocals[inputLocalIndex++] = getAbstractTypeFromApiFormat(sy...
[ "final", "void", "setInputFrameFromApiFormat", "(", "final", "SymbolTable", "symbolTable", ",", "final", "int", "nLocal", ",", "final", "Object", "[", "]", "local", ",", "final", "int", "nStack", ",", "final", "Object", "[", "]", "stack", ")", "{", "int", ...
Sets the input frame from the given public API frame description. @param symbolTable the type table to use to lookup and store type {@link Symbol}. @param nLocal the number of local variables. @param local the local variable types, described using the same format as in {@link MethodVisitor#visitFrame}. @param nStack t...
[ "Sets", "the", "input", "frame", "from", "the", "given", "public", "API", "frame", "description", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/org/objectweb/asm/Frame.java#L425-L457
116,286
beanshell/beanshell
src/main/java/bsh/Reflect.java
Reflect.invokeStaticMethod
public static Object invokeStaticMethod( BshClassManager bcm, Class<?> clas, String methodName, Object [] args, SimpleNode callerInfo ) throws ReflectError, UtilEvalError, InvocationTargetException { Interpreter.debug("invoke static Method")...
java
public static Object invokeStaticMethod( BshClassManager bcm, Class<?> clas, String methodName, Object [] args, SimpleNode callerInfo ) throws ReflectError, UtilEvalError, InvocationTargetException { Interpreter.debug("invoke static Method")...
[ "public", "static", "Object", "invokeStaticMethod", "(", "BshClassManager", "bcm", ",", "Class", "<", "?", ">", "clas", ",", "String", "methodName", ",", "Object", "[", "]", "args", ",", "SimpleNode", "callerInfo", ")", "throws", "ReflectError", ",", "UtilEval...
Invoke a method known to be static. No object instance is needed and there is no possibility of the method being a bsh scripted method.
[ "Invoke", "a", "method", "known", "to", "be", "static", ".", "No", "object", "instance", "is", "needed", "and", "there", "is", "no", "possibility", "of", "the", "method", "being", "a", "bsh", "scripted", "method", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Reflect.java#L115-L127
116,287
beanshell/beanshell
src/main/java/bsh/Reflect.java
Reflect.getObjectFieldValue
public static Object getObjectFieldValue( Object object, String fieldName ) throws UtilEvalError, ReflectError { if ( object instanceof This ) { return ((This) object).namespace.getVariable( fieldName ); } else if( object == Primitive.NULL ) { throw new UtilTargetErro...
java
public static Object getObjectFieldValue( Object object, String fieldName ) throws UtilEvalError, ReflectError { if ( object instanceof This ) { return ((This) object).namespace.getVariable( fieldName ); } else if( object == Primitive.NULL ) { throw new UtilTargetErro...
[ "public", "static", "Object", "getObjectFieldValue", "(", "Object", "object", ",", "String", "fieldName", ")", "throws", "UtilEvalError", ",", "ReflectError", "{", "if", "(", "object", "instanceof", "This", ")", "{", "return", "(", "(", "This", ")", "object", ...
Check for a field with the given name in a java object or scripted object if the field exists fetch the value, if not check for a property value. If neither is found return Primitive.VOID.
[ "Check", "for", "a", "field", "with", "the", "given", "name", "in", "a", "java", "object", "or", "scripted", "object", "if", "the", "field", "exists", "fetch", "the", "value", "if", "not", "check", "for", "a", "property", "value", ".", "If", "neither", ...
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Reflect.java#L139-L158
116,288
beanshell/beanshell
src/main/java/bsh/Reflect.java
Reflect.getLHSObjectField
static LHS getLHSObjectField( Object object, String fieldName ) throws UtilEvalError, ReflectError { if ( object instanceof This ) return new LHS( ((This)object).namespace, fieldName, false ); try { Invocable f = resolveExpectedJavaField( object.getCla...
java
static LHS getLHSObjectField( Object object, String fieldName ) throws UtilEvalError, ReflectError { if ( object instanceof This ) return new LHS( ((This)object).namespace, fieldName, false ); try { Invocable f = resolveExpectedJavaField( object.getCla...
[ "static", "LHS", "getLHSObjectField", "(", "Object", "object", ",", "String", "fieldName", ")", "throws", "UtilEvalError", ",", "ReflectError", "{", "if", "(", "object", "instanceof", "This", ")", "return", "new", "LHS", "(", "(", "(", "This", ")", "object",...
Get an LHS reference to an object field. This method also deals with the field style property access. In the field does not exist we check for a property setter.
[ "Get", "an", "LHS", "reference", "to", "an", "object", "field", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Reflect.java#L189-L211
116,289
beanshell/beanshell
src/main/java/bsh/Reflect.java
Reflect.staticMethodImport
static BshMethod staticMethodImport(Class<?> baseClass, String methodName) { Invocable method = BshClassManager.memberCache.get(baseClass) .findStaticMethod(methodName); if (null != method) return new BshMethod(method, null); return null; }
java
static BshMethod staticMethodImport(Class<?> baseClass, String methodName) { Invocable method = BshClassManager.memberCache.get(baseClass) .findStaticMethod(methodName); if (null != method) return new BshMethod(method, null); return null; }
[ "static", "BshMethod", "staticMethodImport", "(", "Class", "<", "?", ">", "baseClass", ",", "String", "methodName", ")", "{", "Invocable", "method", "=", "BshClassManager", ".", "memberCache", ".", "get", "(", "baseClass", ")", ".", "findStaticMethod", "(", "m...
Find a static method member of baseClass, for the given name. @param baseClass class to query @param methodName method name to find @return a BshMethod wrapped Method.
[ "Find", "a", "static", "method", "member", "of", "baseClass", "for", "the", "given", "name", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Reflect.java#L365-L371
116,290
beanshell/beanshell
src/main/java/bsh/Reflect.java
Reflect.getClassStaticThis
public static This getClassStaticThis(Class<?> clas, String className) { try { return (This) getStaticFieldValue(clas, BSHSTATIC + className); } catch (Exception e) { throw new InterpreterError("Unable to get class static space: " + e, e); } }
java
public static This getClassStaticThis(Class<?> clas, String className) { try { return (This) getStaticFieldValue(clas, BSHSTATIC + className); } catch (Exception e) { throw new InterpreterError("Unable to get class static space: " + e, e); } }
[ "public", "static", "This", "getClassStaticThis", "(", "Class", "<", "?", ">", "clas", ",", "String", "className", ")", "{", "try", "{", "return", "(", "This", ")", "getStaticFieldValue", "(", "clas", ",", "BSHSTATIC", "+", "className", ")", ";", "}", "c...
Get the static bsh namespace field from the class. @param className may be the name of clas itself or a superclass of clas.
[ "Get", "the", "static", "bsh", "namespace", "field", "from", "the", "class", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Reflect.java#L728-L734
116,291
beanshell/beanshell
src/main/java/bsh/Reflect.java
Reflect.getClassInstanceThis
public static This getClassInstanceThis(Object instance, String className) { try { Object o = getObjectFieldValue(instance, BSHTHIS + className); return (This) Primitive.unwrap(o); // unwrap Primitive.Null to null } catch (Exception e) { throw new InterpreterError("Ge...
java
public static This getClassInstanceThis(Object instance, String className) { try { Object o = getObjectFieldValue(instance, BSHTHIS + className); return (This) Primitive.unwrap(o); // unwrap Primitive.Null to null } catch (Exception e) { throw new InterpreterError("Ge...
[ "public", "static", "This", "getClassInstanceThis", "(", "Object", "instance", ",", "String", "className", ")", "{", "try", "{", "Object", "o", "=", "getObjectFieldValue", "(", "instance", ",", "BSHTHIS", "+", "className", ")", ";", "return", "(", "This", ")...
Get the instance bsh namespace field from the object instance. @return the class instance This object or null if the object has not been initialized.
[ "Get", "the", "instance", "bsh", "namespace", "field", "from", "the", "object", "instance", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Reflect.java#L741-L748
116,292
beanshell/beanshell
src/main/java/bsh/BshClassManager.java
BshClassManager.createClassManager
public static BshClassManager createClassManager( Interpreter interpreter ) { BshClassManager manager; // Do we have the optional package? if ( Capabilities.classExists("bsh.classpath.ClassManagerImpl") ) try { // Try to load the module // don't r...
java
public static BshClassManager createClassManager( Interpreter interpreter ) { BshClassManager manager; // Do we have the optional package? if ( Capabilities.classExists("bsh.classpath.ClassManagerImpl") ) try { // Try to load the module // don't r...
[ "public", "static", "BshClassManager", "createClassManager", "(", "Interpreter", "interpreter", ")", "{", "BshClassManager", "manager", ";", "// Do we have the optional package?", "if", "(", "Capabilities", ".", "classExists", "(", "\"bsh.classpath.ClassManagerImpl\"", ")", ...
Create a new instance of the class manager. Class manager instnaces are now associated with the interpreter. @see bsh.Interpreter.getClassManager() @see bsh.Interpreter.setClassLoader( ClassLoader )
[ "Create", "a", "new", "instance", "of", "the", "class", "manager", ".", "Class", "manager", "instnaces", "are", "now", "associated", "with", "the", "interpreter", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BshClassManager.java#L361-L380
116,293
beanshell/beanshell
src/main/java/bsh/BshClassManager.java
BshClassManager.cacheClassInfo
public void cacheClassInfo( String name, Class<?> value ) { if ( value != null ) { absoluteClassCache.put(name, value); // eagerly start the member cache memberCache.init(value); } else absoluteNonClasses.add( name ); }
java
public void cacheClassInfo( String name, Class<?> value ) { if ( value != null ) { absoluteClassCache.put(name, value); // eagerly start the member cache memberCache.init(value); } else absoluteNonClasses.add( name ); }
[ "public", "void", "cacheClassInfo", "(", "String", "name", ",", "Class", "<", "?", ">", "value", ")", "{", "if", "(", "value", "!=", "null", ")", "{", "absoluteClassCache", ".", "put", "(", "name", ",", "value", ")", ";", "// eagerly start the member cache...
Cache info about whether name is a class or not. @param value if value is non-null, cache the class if value is null, set the flag that it is *not* a class to speed later resolution
[ "Cache", "info", "about", "whether", "name", "is", "a", "class", "or", "not", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BshClassManager.java#L498-L506
116,294
beanshell/beanshell
src/main/java/bsh/BshClassManager.java
BshClassManager.getClassBeingDefined
protected String getClassBeingDefined( String className ) { String baseName = Name.suffix(className,1); return definingClassesBaseNames.get( baseName ); }
java
protected String getClassBeingDefined( String className ) { String baseName = Name.suffix(className,1); return definingClassesBaseNames.get( baseName ); }
[ "protected", "String", "getClassBeingDefined", "(", "String", "className", ")", "{", "String", "baseName", "=", "Name", ".", "suffix", "(", "className", ",", "1", ")", ";", "return", "definingClassesBaseNames", ".", "get", "(", "baseName", ")", ";", "}" ]
This method is a temporary workaround used with definingClass. It is to be removed at some point.
[ "This", "method", "is", "a", "temporary", "workaround", "used", "with", "definingClass", ".", "It", "is", "to", "be", "removed", "at", "some", "point", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BshClassManager.java#L669-L672
116,295
beanshell/beanshell
src/main/java/bsh/BshClassManager.java
BshClassManager.doneDefiningClass
protected void doneDefiningClass( String className ) { String baseName = Name.suffix(className,1); definingClasses.remove( className ); definingClassesBaseNames.remove( baseName ); }
java
protected void doneDefiningClass( String className ) { String baseName = Name.suffix(className,1); definingClasses.remove( className ); definingClassesBaseNames.remove( baseName ); }
[ "protected", "void", "doneDefiningClass", "(", "String", "className", ")", "{", "String", "baseName", "=", "Name", ".", "suffix", "(", "className", ",", "1", ")", ";", "definingClasses", ".", "remove", "(", "className", ")", ";", "definingClassesBaseNames", "....
Indicate that the specified class name has been defined and may be loaded normally.
[ "Indicate", "that", "the", "specified", "class", "name", "has", "been", "defined", "and", "may", "be", "loaded", "normally", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BshClassManager.java#L678-L682
116,296
beanshell/beanshell
src/main/java/bsh/BSHPrimaryExpression.java
BSHPrimaryExpression.setArrayExpression
void setArrayExpression(BSHArrayInitializer init) { this.isArrayExpression = true; if (parent instanceof BSHAssignment) { BSHAssignment ass = (BSHAssignment) parent; if ( null != ass.operator && ass.operator == ParserConstants.ASSIGN ) this.isM...
java
void setArrayExpression(BSHArrayInitializer init) { this.isArrayExpression = true; if (parent instanceof BSHAssignment) { BSHAssignment ass = (BSHAssignment) parent; if ( null != ass.operator && ass.operator == ParserConstants.ASSIGN ) this.isM...
[ "void", "setArrayExpression", "(", "BSHArrayInitializer", "init", ")", "{", "this", ".", "isArrayExpression", "=", "true", ";", "if", "(", "parent", "instanceof", "BSHAssignment", ")", "{", "BSHAssignment", "ass", "=", "(", "BSHAssignment", ")", "parent", ";", ...
Called from BSHArrayInitializer during node creation informing us that we are an array expression. If parent BSHAssignment has an ASSIGN operation then this is a map expression. If the initializer reference has multiple dimensions it gets configure as being a map in array. @param init reference to the calling array ini...
[ "Called", "from", "BSHArrayInitializer", "during", "node", "creation", "informing", "us", "that", "we", "are", "an", "array", "expression", ".", "If", "parent", "BSHAssignment", "has", "an", "ASSIGN", "operation", "then", "this", "is", "a", "map", "expression", ...
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BSHPrimaryExpression.java#L45-L56
116,297
beanshell/beanshell
src/main/java/bsh/BSHPrimaryExpression.java
BSHPrimaryExpression.toLHS
public LHS toLHS( CallStack callstack, Interpreter interpreter) throws EvalError { // loosely typed map expression new {a=1, b=2} are treated // as non assignment (LHS) to retrieve Map.Entry key values // then wrapped in a MAP_ENTRY type LHS for value assignment. return (LHS)...
java
public LHS toLHS( CallStack callstack, Interpreter interpreter) throws EvalError { // loosely typed map expression new {a=1, b=2} are treated // as non assignment (LHS) to retrieve Map.Entry key values // then wrapped in a MAP_ENTRY type LHS for value assignment. return (LHS)...
[ "public", "LHS", "toLHS", "(", "CallStack", "callstack", ",", "Interpreter", "interpreter", ")", "throws", "EvalError", "{", "// loosely typed map expression new {a=1, b=2} are treated", "// as non assignment (LHS) to retrieve Map.Entry key values", "// then wrapped in a MAP_ENTRY type...
Evaluate to a value object.
[ "Evaluate", "to", "a", "value", "object", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BSHPrimaryExpression.java#L70-L78
116,298
beanshell/beanshell
src/main/java/bsh/org/objectweb/asm/TypeReference.java
TypeReference.putTarget
static void putTarget(final int targetTypeAndInfo, final ByteVector output) { switch (targetTypeAndInfo >>> 24) { case CLASS_TYPE_PARAMETER: case METHOD_TYPE_PARAMETER: case METHOD_FORMAL_PARAMETER: output.putShort(targetTypeAndInfo >>> 16); break; case FIELD: case METH...
java
static void putTarget(final int targetTypeAndInfo, final ByteVector output) { switch (targetTypeAndInfo >>> 24) { case CLASS_TYPE_PARAMETER: case METHOD_TYPE_PARAMETER: case METHOD_FORMAL_PARAMETER: output.putShort(targetTypeAndInfo >>> 16); break; case FIELD: case METH...
[ "static", "void", "putTarget", "(", "final", "int", "targetTypeAndInfo", ",", "final", "ByteVector", "output", ")", "{", "switch", "(", "targetTypeAndInfo", ">>>", "24", ")", "{", "case", "CLASS_TYPE_PARAMETER", ":", "case", "METHOD_TYPE_PARAMETER", ":", "case", ...
Puts the given target_type and target_info JVMS structures into the given ByteVector. @param targetTypeAndInfo a target_type and a target_info structures encoded as in {@link #targetTypeAndInfo}. LOCAL_VARIABLE and RESOURCE_VARIABLE target types are not supported. @param output where the type reference must be put.
[ "Puts", "the", "given", "target_type", "and", "target_info", "JVMS", "structures", "into", "the", "given", "ByteVector", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/org/objectweb/asm/TypeReference.java#L402-L435
116,299
beanshell/beanshell
bsh-bsf-engine/src/main/java/bsh/util/BeanShellBSFEngine.java
BeanShellBSFEngine.call
public Object call( Object object, String name, Object[] args ) throws BSFException { /* If object is null use the interpreter's global scope. */ if ( object == null ) try { object = interpreter.get("global"); } catch ( EvalError e ...
java
public Object call( Object object, String name, Object[] args ) throws BSFException { /* If object is null use the interpreter's global scope. */ if ( object == null ) try { object = interpreter.get("global"); } catch ( EvalError e ...
[ "public", "Object", "call", "(", "Object", "object", ",", "String", "name", ",", "Object", "[", "]", "args", ")", "throws", "BSFException", "{", "/*\n If object is null use the interpreter's global scope.\n */", "if", "(", "object", "==", "null", ")"...
Invoke method name on the specified bsh scripted object. The object may be null to indicate the global namespace of the interpreter. @param object may be null for the global namespace.
[ "Invoke", "method", "name", "on", "the", "specified", "bsh", "scripted", "object", ".", "The", "object", "may", "be", "null", "to", "indicate", "the", "global", "namespace", "of", "the", "interpreter", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/bsh-bsf-engine/src/main/java/bsh/util/BeanShellBSFEngine.java#L76-L111