Skip to content

Commit bab2d23

Browse files
committed
fixed types
1 parent 57d036c commit bab2d23

23 files changed

+418
-432
lines changed

jbbp/src/main/java/com/igormaznitsa/jbbp/compiler/JBBPCompiler.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,6 @@ private static void assertTokenHasExtraData(final String fieldType, final JBBPTo
181181
}
182182
}
183183

184-
private static void assertTokenDoesntHaveExtraData(final String fieldType,
185-
final JBBPToken token) {
186-
if (token.getFieldTypeParameters().getExtraData() != null) {
187-
throw new JBBPCompilationException('\'' + fieldType + "\' has extra value", token);
188-
}
189-
}
190-
191184
/**
192185
* Compile a text script into its byte code representation/
193186
*
@@ -397,7 +390,7 @@ public static JBBPCompiledBlock compile(final String script,
397390
case CODE_RESET_COUNTER: {
398391
assertTokenNotArray("Reset counter", token);
399392
assertTokenNotNamed("Reset counter", token);
400-
assertTokenDoesntHaveExtraData("Reset counter", token);
393+
assertTokenHasNotExtraData("Reset counter", token);
401394
}
402395
break;
403396
case CODE_STRUCT_START: {
@@ -515,6 +508,13 @@ public static JBBPCompiledBlock compile(final String script,
515508
.build();
516509
}
517510

511+
private static void assertTokenHasNotExtraData(final String fieldType,
512+
final JBBPToken token) {
513+
if (token.getFieldTypeParameters().getExtraData() != null) {
514+
throw new JBBPCompilationException('\'' + fieldType + "\' has extra value", token);
515+
}
516+
}
517+
518518
/**
519519
* The Method checks a value for negative.
520520
*
@@ -715,7 +715,7 @@ private static final class StructStackItem {
715715
private final int namedFieldCounter;
716716

717717
/**
718-
* Flag shows that the structure is array which shoukd be read till end of stream
718+
* Flag shows that the structure is array which should be read till end of stream
719719
*/
720720
private final boolean arrayToReadTillEndOfStream;
721721

jbbp/src/main/java/com/igormaznitsa/jbbp/compiler/JBBPCompilerUtils.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import static com.igormaznitsa.jbbp.compiler.JBBPCompiler.FLAG_ARRAY;
2020

21-
2221
import com.igormaznitsa.jbbp.exceptions.JBBPCompilationException;
2322
import com.igormaznitsa.jbbp.utils.JBBPUtils;
2423
import java.util.List;
@@ -91,14 +90,14 @@ public static void assertFieldIsNotArrayOrInArray(final JBBPNamedFieldInfo field
9190
}
9291
if (fieldToCheck.getFieldPath().indexOf('.') >= 0) {
9392
// the field in structure, check that the structure is not an array or not in an array
94-
final String[] splittedFieldPath = JBBPUtils.splitString(fieldToCheck.getFieldPath(), '.');
93+
final String[] splitFieldPath = JBBPUtils.splitString(fieldToCheck.getFieldPath(), '.');
9594
final StringBuilder fieldPath = new StringBuilder();
9695
// process till the field name because we have already checked the field
97-
for (int i = 0; i < splittedFieldPath.length - 1; i++) {
96+
for (int i = 0; i < splitFieldPath.length - 1; i++) {
9897
if (fieldPath.length() != 0) {
9998
fieldPath.append('.');
10099
}
101-
fieldPath.append(splittedFieldPath[i]);
100+
fieldPath.append(splitFieldPath[i]);
102101
final JBBPNamedFieldInfo structureEnd =
103102
JBBPCompilerUtils.findForFieldPath(fieldPath.toString(), namedFieldList);
104103
if ((compiledScript[structureEnd.getFieldOffsetInCompiledBlock()] & FLAG_ARRAY) != 0) {

jbbp/src/main/java/com/igormaznitsa/jbbp/compiler/tokenizer/JBBPTokenizer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ private JBBPTokenizerException checkFieldName(final String name, final int posit
308308
return null;
309309
}
310310

311-
@SuppressWarnings("NullableProblems")
312311
@Override
313312
public Iterator<JBBPToken> iterator() {
314313
return this;

jbbp/src/main/java/com/igormaznitsa/jbbp/compiler/varlen/JBBPExpressionEvaluator.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import static com.igormaznitsa.jbbp.utils.JBBPUtils.ARRAY_STRING_EMPTY;
2020

21-
2221
import com.igormaznitsa.jbbp.JBBPNamedNumericFieldMap;
2322
import com.igormaznitsa.jbbp.compiler.JBBPCompiledBlock;
2423
import com.igormaznitsa.jbbp.compiler.JBBPCompilerUtils;
@@ -193,10 +192,10 @@ public JBBPExpressionEvaluator(final String expression,
193192
while (matcher.find()) {
194193
if (lastFound >= 0) {
195194
// check for skipped substring
196-
final String substr = expression.substring(lastFound, matcher.start());
197-
if (substr.trim().length() != 0) {
195+
final String subString = expression.substring(lastFound, matcher.start());
196+
if (subString.trim().length() != 0) {
198197
throw new JBBPCompilationException(
199-
"Can't recognize part of expression '" + substr + "' [" + expression + ']');
198+
"Can't recognize part of expression '" + subString + "' [" + expression + ']');
200199
}
201200
}
202201

jbbp/src/main/java/com/igormaznitsa/jbbp/io/AbstractMappedClassFieldObserver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ protected void processObject(
9999
* @param obj an object which is an instance of a mapped class, must not be null
100100
* @param field a field where the object has been found, it can be null for first call
101101
* @param binAnnotationWrapper wrapper to replace Bin annotation values for processing fields, can be null to be ignored
102-
* @param binFieldFilter filter for mapped fields, alows to exclude some of them, can be null
102+
* @param binFieldFilter filter for mapped fields, allows to exclude some of them, can be null
103103
* @param customFieldProcessor a processor for custom fields, it can be null
104104
* @see Bin
105105
* @since 2.0.4

0 commit comments

Comments
 (0)