Skip to content

Commit 6e203f1

Browse files
committed
refactor
git-svn-id: https://svn.apache.org/repos/asf/xmlbeans/trunk@1935584 13f79535-47bb-0310-9956-ffa450edef68
1 parent cab3801 commit 6e203f1

17 files changed

Lines changed: 82 additions & 81 deletions

src/main/java/org/apache/xmlbeans/QNameSet.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* <ul>
3030
* <li>A QNameSet can cover a finite set of namespaces, additionally including a finite
3131
* set of QNames outside those namespaces, and with the exception of
32-
* a finite set of QNames excluded from those namespaes:
32+
* a finite set of QNames excluded from those namespaces:
3333
* <ul>
3434
* <li>excludedQNamesInIncludedURIs == the set of excluded QNames from coveredURIs namespaces
3535
* <li>excludedURIs == null
@@ -196,7 +196,7 @@ public static QNameSet singleton(QName name) {
196196
* Constructs a QNameSetBuilder whose contents are given by
197197
* the four sets.
198198
* <p>
199-
* This constuctor is PRIVATE because it uses the given
199+
* This constructor is PRIVATE because it uses the given
200200
* sets directly, and it trusts its callers to set only immutable values.
201201
* This constructor is only called by the static builder methods on
202202
* QNameSet: those methods are all careful assign only unchanging sets.
@@ -252,7 +252,7 @@ public boolean isEmpty() {
252252
/**
253253
* Returns a new QNameSet that is the intersection of this one and another.
254254
*
255-
* @param set the set to insersect with
255+
* @param set the set to intersect with
256256
* @return the intersection
257257
*/
258258
public QNameSet intersect(QNameSetSpecification set) {

src/main/java/org/apache/xmlbeans/XmlObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ public interface XmlObject extends XmlTokenSource {
465465
* course have equal values (valueEquals(obj) == true).
466466
* <p>
467467
* Usually this method can be treated as an ordinary equivalence
468-
* relation, but actually it is not is not transitive.
468+
* relation, but actually it is not transitive.
469469
* Here is a precise specification:
470470
* <p>
471471
* There are two categories of XML object: objects with a known

src/main/java/org/apache/xmlbeans/impl/common/LoadSaveUtils.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import javax.xml.stream.XMLOutputFactory;
2929
import javax.xml.stream.XMLStreamReader;
3030
import javax.xml.stream.XMLStreamException;
31-
import java.io.File;
3231
import java.io.IOException;
3332
import java.io.OutputStream;
3433
import java.io.InputStream;

src/main/java/org/apache/xmlbeans/impl/common/Mutex.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class Mutex
2828
*/
2929
public synchronized void acquire() throws InterruptedException
3030
{
31-
while (tryToAcquire() == false)
31+
while (!tryToAcquire())
3232
{
3333
wait();
3434
}

src/main/java/org/apache/xmlbeans/impl/common/PrefixResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
public interface PrefixResolver
1919
{
2020
/**
21-
* Caled when the user has a prefix and needs to look up the corresponding
21+
* Called when the user has a prefix and needs to look up the corresponding
2222
* namespace URI. If the prefix is not defined in this context, then this
2323
* method may return null. The no-namespace is represented by the empty
2424
* string return result.

src/main/java/org/apache/xmlbeans/impl/common/SystemCache.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,20 @@ public SchemaTypeLoader getFromTypeLoaderCache(ClassLoader cl) {
5050
public void addToTypeLoaderCache(SchemaTypeLoader stl, ClassLoader cl) {
5151
}
5252

53-
private ThreadLocal<SoftReference> tl_saxLoaders = new ThreadLocal<>();
53+
private final ThreadLocal<SoftReference<Object>> tl_saxLoaders = new ThreadLocal<>();
5454

5555

5656
public void clearThreadLocals() {
5757
tl_saxLoaders.remove();
5858
}
5959

6060
public Object getSaxLoader() {
61-
SoftReference s = tl_saxLoaders.get();
61+
SoftReference<Object> s = tl_saxLoaders.get();
6262
return s == null ? null : s.get();
6363
}
6464

6565
public void setSaxLoader(Object saxLoader) {
66-
tl_saxLoaders.set(new SoftReference(saxLoader));
66+
tl_saxLoaders.set(new SoftReference<>(saxLoader));
6767
}
6868

6969

src/main/java/org/apache/xmlbeans/impl/common/XMLChar.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ public class XMLChar {
8181
// [#xE000-#xFFFD] | [#x10000-#x10FFFF]
8282
//
8383

84-
int charRange[] = {
84+
int[] charRange = {
8585
0x0009, 0x000A, 0x000D, 0x000D, 0x0020, 0xD7FF, 0xE000, 0xFFFD,
8686
};
8787

8888
//
8989
// [3] S ::= (#x20 | #x9 | #xD | #xA)+
9090
//
9191

92-
int spaceChar[] = {
92+
int[] spaceChar = {
9393
0x0020, 0x0009, 0x000D, 0x000A,
9494
};
9595

@@ -98,36 +98,36 @@ public class XMLChar {
9898
// CombiningChar | Extender
9999
//
100100

101-
int nameChar[] = {
101+
int[] nameChar = {
102102
0x002D, 0x002E, // '-' and '.'
103103
};
104104

105105
//
106106
// [5] Name ::= (Letter | '_' | ':') (NameChar)*
107107
//
108108

109-
int nameStartChar[] = {
109+
int[] nameStartChar = {
110110
0x003A, 0x005F, // ':' and '_'
111111
};
112112

113113
//
114114
// [13] PubidChar ::= #x20 | 0xD | 0xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
115115
//
116116

117-
int pubidChar[] = {
117+
int[] pubidChar = {
118118
0x000A, 0x000D, 0x0020, 0x0021, 0x0023, 0x0024, 0x0025, 0x003D,
119119
0x005F
120120
};
121121

122-
int pubidRange[] = {
122+
int[] pubidRange = {
123123
0x0027, 0x003B, 0x003F, 0x005A, 0x0061, 0x007A
124124
};
125125

126126
//
127127
// [84] Letter ::= BaseChar | Ideographic
128128
//
129129

130-
int letterRange[] = {
130+
int[] letterRange = {
131131
// BaseChar
132132
0x0041, 0x005A, 0x0061, 0x007A, 0x00C0, 0x00D6, 0x00D8, 0x00F6,
133133
0x00F8, 0x0131, 0x0134, 0x013E, 0x0141, 0x0148, 0x014A, 0x017E,
@@ -170,7 +170,7 @@ public class XMLChar {
170170
// Ideographic
171171
0x3021, 0x3029, 0x4E00, 0x9FA5,
172172
};
173-
int letterChar[] = {
173+
int[] letterChar = {
174174
// BaseChar
175175
0x0386, 0x038C, 0x03DA, 0x03DC, 0x03DE, 0x03E0, 0x0559, 0x06D5,
176176
0x093D, 0x09B2, 0x0A5E, 0x0A8D, 0x0ABD, 0x0AE0, 0x0B3D, 0x0B9C,
@@ -187,7 +187,7 @@ public class XMLChar {
187187
// [87] CombiningChar ::= ...
188188
//
189189

190-
int combiningCharRange[] = {
190+
int[] combiningCharRange = {
191191
0x0300, 0x0345, 0x0360, 0x0361, 0x0483, 0x0486, 0x0591, 0x05A1,
192192
0x05A3, 0x05B9, 0x05BB, 0x05BD, 0x05C1, 0x05C2, 0x064B, 0x0652,
193193
0x06D6, 0x06DC, 0x06DD, 0x06DF, 0x06E0, 0x06E4, 0x06E7, 0x06E8,
@@ -207,7 +207,7 @@ public class XMLChar {
207207
0x20D0, 0x20DC, 0x302A, 0x302F,
208208
};
209209

210-
int combiningCharChar[] = {
210+
int[] combiningCharChar = {
211211
0x05BF, 0x05C4, 0x0670, 0x093C, 0x094D, 0x09BC, 0x09BE, 0x09BF,
212212
0x09D7, 0x0A02, 0x0A3C, 0x0A3E, 0x0A3F, 0x0ABC, 0x0B3C, 0x0BD7,
213213
0x0D57, 0x0E31, 0x0EB1, 0x0F35, 0x0F37, 0x0F39, 0x0F3E, 0x0F3F,
@@ -218,7 +218,7 @@ public class XMLChar {
218218
// [88] Digit ::= ...
219219
//
220220

221-
int digitRange[] = {
221+
int[] digitRange = {
222222
0x0030, 0x0039, 0x0660, 0x0669, 0x06F0, 0x06F9, 0x0966, 0x096F,
223223
0x09E6, 0x09EF, 0x0A66, 0x0A6F, 0x0AE6, 0x0AEF, 0x0B66, 0x0B6F,
224224
0x0BE7, 0x0BEF, 0x0C66, 0x0C6F, 0x0CE6, 0x0CEF, 0x0D66, 0x0D6F,
@@ -229,19 +229,19 @@ public class XMLChar {
229229
// [89] Extender ::= ...
230230
//
231231

232-
int extenderRange[] = {
232+
int[] extenderRange = {
233233
0x3031, 0x3035, 0x309D, 0x309E, 0x30FC, 0x30FE,
234234
};
235235

236-
int extenderChar[] = {
236+
int[] extenderChar = {
237237
0x00B7, 0x02D0, 0x02D1, 0x0387, 0x0640, 0x0E46, 0x0EC6, 0x3005,
238238
};
239239

240240
//
241241
// SpecialChar ::= '<', '&', '\n', '\r', ']'
242242
//
243243

244-
int specialChar[] = {
244+
int[] specialChar = {
245245
'<', '&', '\n', '\r', ']',
246246
};
247247

@@ -518,11 +518,11 @@ public static boolean isValidName(String name) {
518518
if (name.isEmpty())
519519
return false;
520520
char ch = name.charAt(0);
521-
if( isNameStart(ch) == false)
521+
if(!isNameStart(ch))
522522
return false;
523523
for (int i = 1; i < name.length(); i++ ) {
524524
ch = name.charAt(i);
525-
if( isName( ch ) == false ){
525+
if(!isName(ch)){
526526
return false;
527527
}
528528
}
@@ -545,11 +545,11 @@ public static boolean isValidNCName(String ncName) {
545545
if (ncName.isEmpty())
546546
return false;
547547
char ch = ncName.charAt(0);
548-
if( isNCNameStart(ch) == false)
548+
if(!isNCNameStart(ch))
549549
return false;
550550
for (int i = 1; i < ncName.length(); i++ ) {
551551
ch = ncName.charAt(i);
552-
if( isNCName( ch ) == false ){
552+
if(!isNCName(ch)){
553553
return false;
554554
}
555555
}

src/main/java/org/apache/xmlbeans/impl/common/XmlErrorWatcher.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public XmlErrorWatcher(Collection<XmlError> underlying) {
3030
_underlying = underlying;
3131
}
3232

33+
@Override
3334
public boolean add(XmlError o) {
3435
if (_firstError == null && o != null && o.getSeverity() == XmlError.SEVERITY_ERROR) {
3536
_firstError = o;
@@ -40,6 +41,7 @@ public boolean add(XmlError o) {
4041
return _underlying.add(o);
4142
}
4243

44+
@Override
4345
public Iterator<XmlError> iterator() {
4446
if (_underlying == null) {
4547
return Collections.emptyIterator();
@@ -48,6 +50,7 @@ public Iterator<XmlError> iterator() {
4850
return _underlying.iterator();
4951
}
5052

53+
@Override
5154
public int size() {
5255
if (_underlying == null) {
5356
return 0;

src/main/java/org/apache/xmlbeans/impl/config/BindingConfigImpl.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private static void recordNamespaceSetting(Object key, String value, Map<Object,
176176
}
177177
}
178178

179-
private static void recordNamespacePrefixSetting(List list, String value, Map<Object, String> result) {
179+
private static void recordNamespacePrefixSetting(List<Object> list, String value, Map<Object, String> result) {
180180
if (value == null) {
181181
return;
182182
}
@@ -193,11 +193,10 @@ private void recordExtensionSetting(Extensionconfig ext) {
193193

194194
if (key instanceof String && "*".equals(key)) {
195195
xbeanSet = NameSet.EVERYTHING;
196-
} else if (key instanceof List) {
196+
} else if (key instanceof List<?>) {
197197
NameSetBuilder xbeanSetBuilder = new NameSetBuilder();
198-
for (Object o : (List) key) {
199-
String xbeanName = (String) o;
200-
xbeanSetBuilder.add(xbeanName);
198+
for (Object o : (List<?>) key) {
199+
xbeanSetBuilder.add(o.toString());
201200
}
202201
xbeanSet = xbeanSetBuilder.toNameSet();
203202
}

src/main/java/org/apache/xmlbeans/impl/config/InterfaceExtensionImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration;
2020
import com.github.javaparser.ast.body.MethodDeclaration;
2121
import com.github.javaparser.ast.body.Parameter;
22-
import com.github.javaparser.ast.type.ReferenceType;
2322
import com.github.javaparser.ast.type.Type;
2423
import com.github.javaparser.ast.type.TypeParameter;
2524
import com.github.javaparser.resolution.MethodUsage;

0 commit comments

Comments
 (0)