Skip to content

Commit 5a8c9a3

Browse files
committed
Remove AndroidStudio format for bsh.*
Falling back to use Google format since test faiure Cannot constructure bsh.Interpreter()
1 parent 6abe53b commit 5a8c9a3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2045
-2353
lines changed

app/src/main/java/bsh/BSHAllocationExpression.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
import java.lang.reflect.Array;
44
import java.lang.reflect.InvocationTargetException;
55

6-
/**
7-
* New object, new array, or inner class style allocation with body.
8-
*/
6+
/** New object, new array, or inner class style allocation with body. */
97
class BSHAllocationExpression extends SimpleNode {
10-
private static int innerClassCount = 0;
11-
128
BSHAllocationExpression(int id) {
139
super(id);
1410
}
1511

12+
private static int innerClassCount = 0;
13+
1614
public Object eval(CallStack callstack, Interpreter interpreter) throws EvalError {
1715
// type is either a class name or a primitive type
1816
SimpleNode type = (SimpleNode) jjtGetChild(0);
@@ -210,7 +208,7 @@ when VOID the prescribed array dimensions (defined and undefined)
210208
/**
211209
* Create an array of the dimensions specified in dimensionsNode. dimensionsNode may contain a
212210
* number of "undefined" as well as "defined" dimensions.
213-
* <p>
211+
*
214212
* <p>Background: in Java arrays are implemented in arrays-of-arrays style where, for example, a
215213
* two dimensional array is a an array of arrays of some base type. Each dimension-type has a
216214
* Java class type associated with it... so if foo = new int[5][5] then the type of foo is int
@@ -219,7 +217,7 @@ when VOID the prescribed array dimensions (defined and undefined)
219217
* if foo = new int [5][]; then foo[0] == null //true; and can later be assigned with the
220218
* appropriate type, e.g. foo[0] = new int[5]; (See Learning Java, O'Reilly & Associates more
221219
* background).
222-
* <p>
220+
*
223221
* <p>To create an array with undefined trailing dimensions using the reflection API we must use
224222
* an array type to represent the lower order (undefined) dimensions as the "base" type for the
225223
* array creation... Java will then create the correct type by adding the dimensions of the base

app/src/main/java/bsh/BSHArguments.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class BSHArguments extends SimpleNode {
77

88
/**
99
* This node holds a set of arguments for a method invocation or constructor call.
10-
* <p>
10+
*
1111
* <p>Note: arguments are not currently allowed to be VOID.
1212
*/
1313
/*

app/src/main/java/bsh/BSHArrayDimensions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ public Object eval(Class type, CallStack callstack, Interpreter interpreter) thr
3636

3737
/**
3838
* Evaluate the structure of the array in one of two ways:
39-
* <p>
39+
*
4040
* <p>a) an initializer exists, evaluate it and return the fully constructed array object, also
4141
* record the dimensions of that array
42-
* <p>
42+
*
4343
* <p>b) evaluate and record the lengths in each dimension and return void.
44-
* <p>
44+
*
4545
* <p>The structure of the array dims is maintained in dimensions.
4646
*/
4747
public Object eval(CallStack callstack, Interpreter interpreter) throws EvalError {

app/src/main/java/bsh/BSHArrayInitializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public Object eval(CallStack callstack, Interpreter interpreter) throws EvalErro
1414
/**
1515
* Construct the array from the initializer syntax.
1616
*
17-
* @param baseType the base class type of the array (no dimensionality)
17+
* @param baseType the base class type of the array (no dimensionality)
1818
* @param dimensions the top number of dimensions of the array e.g. 2 for a String [][];
1919
*/
2020
public Object eval(Class baseType, int dimensions, CallStack callstack, Interpreter interpreter)

app/src/main/java/bsh/BSHAssignment.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public Object eval(CallStack callstack, Interpreter interpreter) throws EvalErro
2121
// e.g. i=1; i+=i++; // should be 2 not 3
2222
Object lhsValue = null;
2323
if (operator != ASSIGN) // assign doesn't need the pre-value
24-
try {
24+
try {
2525
lhsValue = lhs.getValue();
2626
} catch (UtilEvalError e) {
2727
throw e.toEvalError(this, callstack);
@@ -110,13 +110,13 @@ else if (lhs == Primitive.NULL || rhs == Primitive.NULL)
110110
throw new UtilEvalError("对空对象或'null'字面的非法使用");
111111

112112
if ((lhs instanceof Boolean
113-
|| lhs instanceof Character
114-
|| lhs instanceof Number
115-
|| lhs instanceof Primitive)
113+
|| lhs instanceof Character
114+
|| lhs instanceof Number
115+
|| lhs instanceof Primitive)
116116
&& (rhs instanceof Boolean
117-
|| rhs instanceof Character
118-
|| rhs instanceof Number
119-
|| rhs instanceof Primitive)) {
117+
|| rhs instanceof Character
118+
|| rhs instanceof Number
119+
|| rhs instanceof Primitive)) {
120120
return Primitive.binaryOperation(lhs, rhs, kind);
121121
}
122122

app/src/main/java/bsh/BSHBlock.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ public Object eval(CallStack callstack, Interpreter interpreter) throws EvalErro
1414

1515
/**
1616
* @param overrideNamespace if set to true the block will be executed in the current namespace
17-
* (not a subordinate one).
18-
* <p>If true *no* new BlockNamespace will be swapped onto the stack and the eval will
19-
* happen in the current top namespace. This is used by BshMethod, TryStatement, etc. which
20-
* must intialize the block first and also for those that perform multiple passes in the
21-
* same block.
17+
* (not a subordinate one).
18+
* <p>If true *no* new BlockNamespace will be swapped onto the stack and the eval will
19+
* happen in the current top namespace. This is used by BshMethod, TryStatement, etc. which
20+
* must intialize the block first and also for those that perform multiple passes in the
21+
* same block.
2222
*/
2323
public Object eval(CallStack callstack, Interpreter interpreter, boolean overrideNamespace)
2424
throws EvalError {
@@ -31,7 +31,7 @@ public Object eval(CallStack callstack, Interpreter interpreter, boolean overrid
3131

3232
Object ret;
3333
if (isSynchronized) // Do the actual synchronization
34-
synchronized (syncValue) {
34+
synchronized (syncValue) {
3535
ret = evalBlock(callstack, interpreter, overrideNamespace, null);
3636
}
3737
else ret = evalBlock(callstack, interpreter, overrideNamespace, null);

app/src/main/java/bsh/BSHCastExpression.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* Implement casts.
5-
* <p>
5+
*
66
* <p>I think it should be possible to simplify some of the code here by using the
77
* Types.getAssignableForm() method, but I haven't looked into it.
88
*/
@@ -12,9 +12,7 @@ public BSHCastExpression(int id) {
1212
super(id);
1313
}
1414

15-
/**
16-
* @return the result of the cast.
17-
*/
15+
/** @return the result of the cast. */
1816
public Object eval(CallStack callstack, Interpreter interpreter) throws EvalError {
1917
NameSpace namespace = callstack.top();
2018
Class toType = ((BSHType) jjtGetChild(0)).getType(callstack, interpreter);

app/src/main/java/bsh/BSHForStatement.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package bsh;
22

3-
/**
4-
* Implementation of the for(;;) statement.
5-
*/
3+
/** Implementation of the for(;;) statement. */
64
class BSHForStatement extends SimpleNode implements ParserConstants {
75
public boolean hasForInit;
86
public boolean hasExpression;
@@ -25,7 +23,7 @@ public Object eval(CallStack callstack, Interpreter interpreter) throws EvalErro
2523
if (hasExpression) expression = ((SimpleNode) jjtGetChild(i++));
2624
if (hasForUpdate) forUpdate = ((SimpleNode) jjtGetChild(i++));
2725
if (i < jjtGetNumChildren()) // should normally be
28-
statement = ((SimpleNode) jjtGetChild(i));
26+
statement = ((SimpleNode) jjtGetChild(i));
2927

3028
NameSpace enclosingNameSpace = callstack.top();
3129
BlockNameSpace forNameSpace = new BlockNameSpace(enclosingNameSpace);

app/src/main/java/bsh/BSHFormalParameter.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package bsh;
22

3-
/**
4-
* A formal parameter declaration. For loose variable declaration type is null.
5-
*/
3+
/** A formal parameter declaration. For loose variable declaration type is null. */
64
class BSHFormalParameter extends SimpleNode {
75
public static final Class UNTYPED = null;
86
public String name;
@@ -23,9 +21,7 @@ public String getTypeDescriptor(
2321
return "Ljava/lang/Object;"; // Object type
2422
}
2523

26-
/**
27-
* Evaluate the type.
28-
*/
24+
/** Evaluate the type. */
2925
public Object eval(CallStack callstack, Interpreter interpreter) throws EvalError {
3026
if (jjtGetNumChildren() > 0)
3127
type = ((BSHType) jjtGetChild(0)).getType(callstack, interpreter);

app/src/main/java/bsh/BSHFormalParameters.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
package bsh;
22

33
class BSHFormalParameters extends SimpleNode {
4-
/**
5-
* For loose type parameters the paramTypes are null.
6-
*/
4+
private String[] paramNames;
5+
/** For loose type parameters the paramTypes are null. */
76
// unsafe caching of types
87
Class[] paramTypes;
8+
99
int numArgs;
1010
String[] typeDescriptors;
11-
private String[] paramNames;
1211

1312
BSHFormalParameters(int id) {
1413
super(id);
@@ -49,9 +48,7 @@ public String[] getTypeDescriptors(
4948
return typeDesc;
5049
}
5150

52-
/**
53-
* Evaluate the types. Note that type resolution does not require the interpreter instance.
54-
*/
51+
/** Evaluate the types. Note that type resolution does not require the interpreter instance. */
5552
public Object eval(CallStack callstack, Interpreter interpreter) throws EvalError {
5653
if (paramTypes != null) return paramTypes;
5754

0 commit comments

Comments
 (0)