Skip to content

Commit f20d936

Browse files
committed
Warnings removal (synth accessor for private members [usually from static method])
1 parent 3ef1201 commit f20d936

File tree

5 files changed

+41
-43
lines changed

5 files changed

+41
-43
lines changed

src/main/java/com/fasterxml/jackson/core/io/CharTypes.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
public final class CharTypes
66
{
7-
private final static char[] HC = "0123456789ABCDEF".toCharArray();
8-
private final static byte[] HB;
7+
protected final static char[] HC = "0123456789ABCDEF".toCharArray();
8+
protected final static byte[] HB;
99
static {
1010
int len = HC.length;
1111
HB = new byte[len];
@@ -19,7 +19,7 @@ public final class CharTypes
1919
* Lookup table used for determining which input characters
2020
* need special handling when contained in text segment.
2121
*/
22-
private final static int[] sInputCodes;
22+
protected final static int[] sInputCodes;
2323
static {
2424
/* 96 would do for most cases (backslash is ASCII 94)
2525
* but if we want to do lookups by raw bytes it's better
@@ -40,7 +40,7 @@ public final class CharTypes
4040
* Additionally we can combine UTF-8 decoding info into similar
4141
* data table.
4242
*/
43-
private final static int[] sInputCodesUTF8;
43+
protected final static int[] sInputCodesUTF8;
4444
static {
4545
final int[] table = new int[sInputCodes.length];
4646
System.arraycopy(sInputCodes, 0, table, 0, table.length);
@@ -70,7 +70,7 @@ public final class CharTypes
7070
* Basically this is list of 8-bit ASCII characters that are legal
7171
* as part of Javascript identifier
7272
*/
73-
private final static int[] sInputCodesJsNames;
73+
protected final static int[] sInputCodesJsNames;
7474
static {
7575
final int[] table = new int[256];
7676
// Default is "not a name char", mark ones that are
@@ -97,7 +97,7 @@ public final class CharTypes
9797
* code as ok. They will be validated at a later point, when decoding
9898
* name
9999
*/
100-
private final static int[] sInputCodesUtf8JsNames;
100+
protected final static int[] sInputCodesUtf8JsNames;
101101
static {
102102
final int[] table = new int[256];
103103
// start with 8-bit JS names
@@ -110,7 +110,7 @@ public final class CharTypes
110110
* Decoding table used to quickly determine characters that are
111111
* relevant within comment content.
112112
*/
113-
private final static int[] sInputCodesComment;
113+
protected final static int[] sInputCodesComment;
114114
static {
115115
final int[] buf = new int[256];
116116
// but first: let's start with UTF-8 multi-byte markers:
@@ -130,7 +130,7 @@ public final class CharTypes
130130
*
131131
* @since 2.3
132132
*/
133-
private final static int[] sInputCodesWS;
133+
protected final static int[] sInputCodesWS;
134134
static {
135135
// but first: let's start with UTF-8 multi-byte markers:
136136
final int[] buf = new int[256];
@@ -153,7 +153,7 @@ public final class CharTypes
153153
* Lookup table used for determining which output characters in
154154
* 7-bit ASCII range need to be quoted.
155155
*/
156-
private final static int[] sOutputEscapes128;
156+
protected final static int[] sOutputEscapes128;
157157
static {
158158
int[] table = new int[128];
159159
// Control chars need generic escape sequence
@@ -180,7 +180,7 @@ public final class CharTypes
180180
*<p>
181181
* NOTE: before 2.10.1, was of size 128, extended for simpler handling
182182
*/
183-
private final static int[] sHexValues = new int[256];
183+
protected final static int[] sHexValues = new int[256];
184184
static {
185185
Arrays.fill(sHexValues, -1);
186186
for (int i = 0; i < 10; ++i) {

src/main/java/com/fasterxml/jackson/core/sym/ByteQuadsCanonicalizer.java

+15-15
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ public final class ByteQuadsCanonicalizer
6767
* Reference to the root symbol table, for child tables, so
6868
* that they can merge table information back as necessary.
6969
*/
70-
final private ByteQuadsCanonicalizer _parent;
70+
final protected ByteQuadsCanonicalizer _parent;
7171

7272
/**
7373
* Member that is only used by the root table instance: root
7474
* passes immutable state info child instances, and children
7575
* may return new state if they add entries to the table.
7676
* Child tables do NOT use the reference.
7777
*/
78-
final private AtomicReference<TableInfo> _tableInfo;
78+
final protected AtomicReference<TableInfo> _tableInfo;
7979

8080
/**
8181
* Seed value we use as the base to make hash codes non-static between
@@ -84,7 +84,7 @@ public final class ByteQuadsCanonicalizer
8484
* This is done for security reasons, to avoid potential DoS attack via
8585
* hash collisions.
8686
*/
87-
final private int _seed;
87+
final protected int _seed;
8888

8989
/*
9090
/**********************************************************
@@ -99,15 +99,15 @@ public final class ByteQuadsCanonicalizer
9999
* NOTE: non-final to allow disabling intern()ing in case of excessive
100100
* collisions.
101101
*/
102-
private boolean _intern;
102+
protected boolean _intern;
103103

104104
/**
105105
* Flag that indicates whether we should throw an exception if enough
106106
* hash collisions are detected (true); or just worked around (false).
107107
*
108108
* @since 2.4
109109
*/
110-
private final boolean _failOnDoS;
110+
protected final boolean _failOnDoS;
111111

112112
/*
113113
/**********************************************************
@@ -121,25 +121,25 @@ public final class ByteQuadsCanonicalizer
121121
* structure (details of which may be tweaked depending on expected rates
122122
* of collisions).
123123
*/
124-
private int[] _hashArea;
124+
protected int[] _hashArea;
125125

126126
/**
127127
* Number of slots for primary entries within {@link #_hashArea}; which is
128128
* at most <code>1/8</code> of actual size of the underlying array (4-int slots,
129129
* primary covers only half of the area; plus, additional area for longer
130130
* symbols after hash area).
131131
*/
132-
private int _hashSize;
132+
protected int _hashSize;
133133

134134
/**
135135
* Offset within {@link #_hashArea} where secondary entries start
136136
*/
137-
private int _secondaryStart;
137+
protected int _secondaryStart;
138138

139139
/**
140140
* Offset within {@link #_hashArea} where tertiary entries start
141141
*/
142-
private int _tertiaryStart;
142+
protected int _tertiaryStart;
143143

144144
/**
145145
* Constant that determines size of buckets for tertiary entries:
@@ -150,20 +150,20 @@ public final class ByteQuadsCanonicalizer
150150
* Default value is 2, for buckets of 4 slots; grows bigger with
151151
* bigger table sizes.
152152
*/
153-
private int _tertiaryShift;
153+
protected int _tertiaryShift;
154154

155155
/**
156156
* Total number of Strings in the symbol table; only used for child tables.
157157
*/
158-
private int _count;
158+
protected int _count;
159159

160160
/**
161161
* Array that contains <code>String</code> instances matching
162162
* entries in {@link #_hashArea}.
163163
* Contains nulls for unused entries. Note that this size is twice
164164
* that of {@link #_hashArea}
165165
*/
166-
private String[] _names;
166+
protected String[] _names;
167167

168168
/*
169169
/**********************************************************
@@ -176,7 +176,7 @@ public final class ByteQuadsCanonicalizer
176176
* for more spilled over entries (if any).
177177
* Spill over area is within fixed-size portion of {@link #_hashArea}.
178178
*/
179-
private int _spilloverEnd;
179+
protected int _spilloverEnd;
180180

181181
/**
182182
* Offset within {@link #_hashArea} that follows main slots and contains
@@ -186,7 +186,7 @@ public final class ByteQuadsCanonicalizer
186186
* Note that long name area follows immediately after the fixed-size
187187
* main hash area ({@link #_hashArea}).
188188
*/
189-
private int _longNameOffset;
189+
protected int _longNameOffset;
190190

191191
/*
192192
/**********************************************************
@@ -207,7 +207,7 @@ public final class ByteQuadsCanonicalizer
207207
* and when adding new collision list queues (i.e. creating a new
208208
* collision list head entry)
209209
*/
210-
private boolean _hashShared;
210+
protected boolean _hashShared;
211211

212212
/*
213213
/**********************************************************

src/main/java/com/fasterxml/jackson/core/sym/CharsToNameCanonicalizer.java

+13-13
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,15 @@ public final class CharsToNameCanonicalizer
101101
* defined, and child instance is released (call to <code>release</code>),
102102
* parent's shared tables may be updated from the child instance.
103103
*/
104-
final private CharsToNameCanonicalizer _parent;
104+
final protected CharsToNameCanonicalizer _parent;
105105

106106
/**
107107
* Member that is only used by the root table instance: root
108108
* passes immutable state info child instances, and children
109109
* may return new state if they add entries to the table.
110110
* Child tables do NOT use the reference.
111111
*/
112-
final private AtomicReference<TableInfo> _tableInfo;
112+
final protected AtomicReference<TableInfo> _tableInfo;
113113

114114
/**
115115
* Seed value we use as the base to make hash codes non-static between
@@ -120,17 +120,17 @@ public final class CharsToNameCanonicalizer
120120
*
121121
* @since 2.1
122122
*/
123-
final private int _seed;
123+
final protected int _seed;
124124

125-
final private int _flags;
125+
final protected int _flags;
126126

127127
/**
128128
* Whether any canonicalization should be attempted (whether using
129129
* intern or not.
130130
*<p>
131131
* NOTE: non-final since we may need to disable this with overflow.
132132
*/
133-
private boolean _canonicalize;
133+
protected boolean _canonicalize;
134134

135135
/*
136136
/**********************************************************
@@ -142,7 +142,7 @@ public final class CharsToNameCanonicalizer
142142
* Primary matching symbols; it's expected most match occur from
143143
* here.
144144
*/
145-
private String[] _symbols;
145+
protected String[] _symbols;
146146

147147
/**
148148
* Overflow buckets; if primary doesn't match, lookup is done
@@ -151,27 +151,27 @@ public final class CharsToNameCanonicalizer
151151
* Note: Number of buckets is half of number of symbol entries, on
152152
* assumption there's less need for buckets.
153153
*/
154-
private Bucket[] _buckets;
154+
protected Bucket[] _buckets;
155155

156156
/**
157157
* Current size (number of entries); needed to know if and when
158158
* rehash.
159159
*/
160-
private int _size;
160+
protected int _size;
161161

162162
/**
163163
* Limit that indicates maximum size this instance can hold before
164164
* it needs to be expanded and rehashed. Calculated using fill
165165
* factor passed in to constructor.
166166
*/
167-
private int _sizeThreshold;
167+
protected int _sizeThreshold;
168168

169169
/**
170170
* Mask used to get index from hash values; equal to
171171
* <code>_buckets.length - 1</code>, when _buckets.length is
172172
* a power of two.
173173
*/
174-
private int _indexMask;
174+
protected int _indexMask;
175175

176176
/**
177177
* We need to keep track of the longest collision list; this is needed
@@ -180,7 +180,7 @@ public final class CharsToNameCanonicalizer
180180
*
181181
* @since 2.1
182182
*/
183-
private int _longestCollisionList;
183+
protected int _longestCollisionList;
184184

185185
/*
186186
/**********************************************************
@@ -199,7 +199,7 @@ public final class CharsToNameCanonicalizer
199199
* and when adding new collision list queues (i.e. creating a new
200200
* collision list head entry)
201201
*/
202-
private boolean _hashShared;
202+
protected boolean _hashShared;
203203

204204
/*
205205
/**********************************************************
@@ -215,7 +215,7 @@ public final class CharsToNameCanonicalizer
215215
*
216216
* @since 2.4
217217
*/
218-
private BitSet _overflows;
218+
protected BitSet _overflows;
219219

220220
/*
221221
/**********************************************************

src/test/java/com/fasterxml/jackson/core/filter/GeneratorFiltering609Test.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
import java.io.*;
44

55
import com.fasterxml.jackson.core.*;
6-
import com.fasterxml.jackson.core.filter.FilteringGeneratorDelegate;
7-
import com.fasterxml.jackson.core.filter.TokenFilter;
86
import com.fasterxml.jackson.core.util.JsonGeneratorDelegate;
97

108
// for [core#609]
119
public class GeneratorFiltering609Test
1210
extends com.fasterxml.jackson.core.BaseTest
1311
{
1412
static class NullExcludingTokenFilter extends TokenFilter {
15-
private static final NullExcludingTokenFilter INSTANCE =
13+
static final NullExcludingTokenFilter INSTANCE =
1614
new NullExcludingTokenFilter();
1715

1816
@Override
@@ -27,7 +25,7 @@ static class StringTruncatingGeneratorDelegate
2725
{
2826
private final int maxStringLength;
2927

30-
private StringTruncatingGeneratorDelegate(
28+
StringTruncatingGeneratorDelegate(
3129
JsonGenerator jsonGenerator,
3230
int maxStringLength) {
3331
super(jsonGenerator);

src/test/java/com/fasterxml/jackson/core/json/JsonFactoryTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
public class JsonFactoryTest
1111
extends com.fasterxml.jackson.core.BaseTest
1212
{
13-
private static class BogusCodec extends ObjectCodec {
13+
static class BogusCodec extends ObjectCodec {
1414
@Override
1515
public Version version() { return null; }
1616

0 commit comments

Comments
 (0)