3535public final class WhitelistLoader {
3636
3737 /**
38- * Loads and creates a {@link Whitelist} from one to many text files. The file paths are passed in as an array of
38+ * Loads and creates a {@link Whitelist} from one to many text files. The file paths are passed in as an array of
3939 * {@link String}s with a single {@link Class} to be be used to load the resources where each {@link String}
40- * is the path of a single text file. The {@link Class}'s {@link ClassLoader} will be used to lookup the Java
40+ * is the path of a single text file. The {@link Class}'s {@link ClassLoader} will be used to lookup the Java
4141 * reflection objects for each individual {@link Class}, {@link Constructor}, {@link Method}, and {@link Field}
4242 * specified as part of the whitelist in the text file.
4343 *
4444 * A single pass is made through each file to collect all the information about each class, constructor, method,
45- * and field. Most validation will be done at a later point after all whitelists have been gathered and their
45+ * and field. Most validation will be done at a later point after all whitelists have been gathered and their
4646 * merging takes place.
4747 *
4848 * A painless type name is one of the following:
@@ -52,15 +52,15 @@ public final class WhitelistLoader {
5252 * <li> fully-qualified Java type name - Any whitelisted Java class will have the equivalent name as
5353 * a Painless type name with the exception that any dollar symbols used as part of inner classes will
5454 * be replaced with dot symbols. </li>
55- * <li> short Java type name - The text after the final dot symbol of any specified Java class. A
55+ * <li> short Java type name - The text after the final dot symbol of any specified Java class. A
5656 * short type Java name may be excluded by using the 'only_fqn' token during Painless class parsing
5757 * as described later. </li>
5858 * </ul>
5959 *
6060 * The following can be parsed from each whitelist text file:
6161 * <ul>
6262 * <li> Blank lines will be ignored by the parser. </li>
63- * <li> Comments may be created starting with a pound '#' symbol and end with a newline. These will
63+ * <li> Comments may be created starting with a pound '#' symbol and end with a newline. These will
6464 * be ignored by the parser. </li>
6565 * <li> Primitive types may be specified starting with 'class' and followed by the Java type name,
6666 * an opening bracket, a newline, a closing bracket, and a final newline. </li>
@@ -93,10 +93,10 @@ public final class WhitelistLoader {
9393 *
9494 * Note there must be a one-to-one correspondence of Painless type names to Java type/class names.
9595 * If the same Painless type is defined across multiple files and the Java class is the same, all
96- * specified constructors, methods, and fields will be merged into a single Painless type. The
96+ * specified constructors, methods, and fields will be merged into a single Painless type. The
9797 * Painless dynamic type, 'def', used as part of constructor, method, and field definitions will
98- * be appropriately parsed and handled. Painless complex types must be specified with the
99- * fully-qualified Java class name. Method argument types, method return types, and field types
98+ * be appropriately parsed and handled. Painless complex types must be specified with the
99+ * fully-qualified Java class name. Method argument types, method return types, and field types
100100 * must be specified with Painless type names (def, fully-qualified, or short) as described earlier.
101101 *
102102 * The following example is used to create a single whitelist text file:
@@ -132,7 +132,7 @@ public final class WhitelistLoader {
132132 * }
133133 */
134134 public static Whitelist loadFromResourceFiles (Class <?> resource , String ... filepaths ) {
135- List <WhitelistClass > whitelistStructs = new ArrayList <>();
135+ List <WhitelistClass > whitelistClasses = new ArrayList <>();
136136
137137 // Execute a single pass through the whitelist text files. This will gather all the
138138 // constructors, methods, augmented methods, and fields for each whitelisted class.
@@ -143,7 +143,7 @@ public static Whitelist loadFromResourceFiles(Class<?> resource, String... filep
143143 try (LineNumberReader reader = new LineNumberReader (
144144 new InputStreamReader (resource .getResourceAsStream (filepath ), StandardCharsets .UTF_8 ))) {
145145
146- String whitelistStructOrigin = null ;
146+ String whitelistClassOrigin = null ;
147147 String javaClassName = null ;
148148 boolean onlyFQNJavaClassName = false ;
149149 List <WhitelistConstructor > whitelistConstructors = null ;
@@ -178,7 +178,7 @@ public static Whitelist loadFromResourceFiles(Class<?> resource, String... filep
178178 throw new IllegalArgumentException ("invalid class definition: failed to parse class name [" + line + "]" );
179179 }
180180
181- whitelistStructOrigin = "[" + filepath + "]:[" + number + "]" ;
181+ whitelistClassOrigin = "[" + filepath + "]:[" + number + "]" ;
182182 javaClassName = tokens [0 ];
183183
184184 // Reset all the constructors, methods, and fields to support a new class.
@@ -194,11 +194,11 @@ public static Whitelist loadFromResourceFiles(Class<?> resource, String... filep
194194 throw new IllegalArgumentException ("invalid class definition: extraneous closing bracket" );
195195 }
196196
197- whitelistStructs .add (new WhitelistClass (whitelistStructOrigin , javaClassName , onlyFQNJavaClassName ,
197+ whitelistClasses .add (new WhitelistClass (whitelistClassOrigin , javaClassName , onlyFQNJavaClassName ,
198198 whitelistConstructors , whitelistMethods , whitelistFields ));
199199
200200 // Set all the variables to null to ensure a new class definition is found before other parsable values.
201- whitelistStructOrigin = null ;
201+ whitelistClassOrigin = null ;
202202 javaClassName = null ;
203203 onlyFQNJavaClassName = false ;
204204 whitelistConstructors = null ;
@@ -300,7 +300,7 @@ public static Whitelist loadFromResourceFiles(Class<?> resource, String... filep
300300 }
301301 ClassLoader loader = AccessController .doPrivileged ((PrivilegedAction <ClassLoader >)resource ::getClassLoader );
302302
303- return new Whitelist (loader , whitelistStructs );
303+ return new Whitelist (loader , whitelistClasses );
304304 }
305305
306306 private WhitelistLoader () {}
0 commit comments