Skip to content

Commit 7064d21

Browse files
committed
refactoring
1 parent e8aa8e2 commit 7064d21

File tree

6 files changed

+8
-11
lines changed

6 files changed

+8
-11
lines changed

jbbp/src/main/java/com/igormaznitsa/jbbp/compiler/conversion/JBBPToJavaConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ public ExpressionEvaluatorVisitor visitEnd() {
10431043

10441044
class ExprTreeItem {
10451045

1046-
Operator op;
1046+
final Operator op;
10471047
Object left;
10481048
Object right;
10491049

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,8 @@ public JBBPOut Skip(int numberOfBytes) throws IOException {
258258
*
259259
* @param value the byte outOrder to be used in next operations, must not be null
260260
* @return the DSL session
261-
* @throws IOException it will be thrown for transport errors
262261
*/
263-
public JBBPOut ByteOrder(final JBBPByteOrder value) throws IOException {
262+
public JBBPOut ByteOrder(final JBBPByteOrder value) {
264263
assertNotEnded();
265264
JBBPUtils.assertNotNull(value, "Byte order must not be null");
266265
if (this.processCommands) {
@@ -1021,12 +1020,11 @@ public JBBPOut Bin(final Object object) throws IOException {
10211020
* @param customFieldWriter a custom field writer to be used for saving of
10221021
* custom fields of the object, it can be null
10231022
* @return the context
1024-
* @throws IOException it will be thrown for any transport error
10251023
* @see JBBPMapper#clearFieldCache()
10261024
* @see Bin
10271025
* @since 1.1
10281026
*/
1029-
public JBBPOut Bin(final Object object, final JBBPCustomFieldWriter customFieldWriter) throws IOException {
1027+
public JBBPOut Bin(final Object object, final JBBPCustomFieldWriter customFieldWriter) {
10301028
if (this.processCommands) {
10311029
this.processObject(object, null, customFieldWriter);
10321030
}

jbbp/src/main/java/com/igormaznitsa/jbbp/mapper/MappedFieldRecord.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ static void setFieldValue(final Object classInstance, final Method setter, final
445445
}
446446
}
447447

448+
@SuppressWarnings("TryWithIdenticalCatches")
448449
private static <T> T tryMakeInstance(
449450
final Class<T> type,
450451
final JBBPAbstractField binField,

jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2071,7 +2071,7 @@ protected static class BinFieldContainer extends BinField {
20712071
final List<BinField> fields = new ArrayList<>();
20722072
final Class<?> klazz;
20732073

2074-
static BinFieldContainer END_STRUCT = new BinFieldContainer(null, null);
2074+
static final BinFieldContainer END_STRUCT = new BinFieldContainer(null, null);
20752075

20762076
BinFieldContainer(final Class<?> klazz, final Bin bin, final boolean fieldLocalAnnotation, final Field field) {
20772077
super(bin, fieldLocalAnnotation, field);

jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPTextWriter.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
import com.igormaznitsa.jbbp.model.JBBPFieldUByte;
4949
import com.igormaznitsa.jbbp.model.JBBPFieldUShort;
5050
import com.igormaznitsa.jbbp.model.JBBPNumericField;
51-
5251
import java.io.FilterWriter;
5352
import java.io.IOException;
5453
import java.io.StringWriter;
@@ -1058,9 +1057,8 @@ public JBBPTextWriter Int(final int[] values, int off, int len) throws IOExcepti
10581057
* Increase indent.
10591058
*
10601059
* @return the context
1061-
* @throws IOException it will be thrown for transport error
10621060
*/
1063-
public JBBPTextWriter IndentInc() throws IOException {
1061+
public JBBPTextWriter IndentInc() {
10641062
this.indent += this.spacesInTab;
10651063
return this;
10661064
}
@@ -1083,9 +1081,8 @@ public JBBPTextWriter IndentInc(final int count) throws IOException {
10831081
* Decrease indent.
10841082
*
10851083
* @return the context
1086-
* @throws IOException it will be thrown for transport error
10871084
*/
1088-
public JBBPTextWriter IndentDec() throws IOException {
1085+
public JBBPTextWriter IndentDec() {
10891086
if (this.indent > 0) {
10901087
this.indent = Math.max(0, this.indent - this.spacesInTab);
10911088
}

jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public final class JBBPUtils {
4141
public static final JBBPAbstractField[] ARRAY_FIELD_EMPTY = new JBBPAbstractField[0];
4242

4343
// Don't replace by StandardCharsets for Android compatibility!
44+
@SuppressWarnings("CharsetObjectCanBeUsed")
4445
private static final Charset CHARSET_UTF8 = Charset.forName("UTF-8");
4546

4647
private JBBPUtils() {

0 commit comments

Comments
 (0)