Skip to content

Commit 53b5deb

Browse files
committed
Avoid more auto (un)boxing
1 parent cb9852d commit 53b5deb

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

exist-core/src/main/java/org/exist/config/Configurator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ private static Configuration configureByCurrent(final Configurable instance, fin
302302

303303
try {
304304
if (settingKey == SettingKey.RADIX) {
305-
final int radix = Integer.valueOf(settingKey.extractValueFromSettings(settings));
305+
final int radix = Integer.parseInt(settingKey.extractValueFromSettings(settings));
306306
value = Integer.valueOf(configuration.getProperty(property), radix);
307307
} else if (settingKey == SettingKey.OCTAL_STRING) {
308308
value = Integer.valueOf(configuration.getProperty(property), 8);
@@ -896,7 +896,7 @@ private static String extractFieldValue(final Field field, final Configurable in
896896

897897
if (settingKey == SettingKey.RADIX) {
898898
try {
899-
final int radix = Integer.valueOf(settingKey.extractValueFromSettings(settings));
899+
final int radix = Integer.parseInt(settingKey.extractValueFromSettings(settings));
900900
return Integer.toString((Integer) field.get(instance), radix);
901901
} catch (final Exception e) {
902902
LOG.error(e);

exist-core/src/main/java/org/exist/http/servlets/AbstractExistHttpServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ private void doGeneralExistServletConfig(ServletConfig config) {
209209

210210
final String param = config.getInitParameter("hidden");
211211
if(param != null) {
212-
internalOnly = Boolean.valueOf(param);
212+
internalOnly = Boolean.parseBoolean(param);
213213
}
214214
}
215215

exist-core/src/main/java/org/exist/storage/BackupSystemTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public void configure(final Configuration config, final Properties properties) t
9090
collection = XmldbURI.create(collName);
9191
LOG.debug("Collection to backup: " + collection.toString() + ". User: " + user);
9292

93-
deduplicateBlobs = Boolean.valueOf(properties.getProperty("deduplucate-blobs", "false"));
93+
deduplicateBlobs = Boolean.parseBoolean(properties.getProperty("deduplucate-blobs", "false"));
9494

9595
suffix = properties.getProperty("suffix", "");
9696
prefix = properties.getProperty("prefix", "");

exist-core/src/main/java/org/exist/util/Configuration.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -917,19 +917,19 @@ private void configureBackend( final Optional<Path> dbHome, Element con ) throws
917917
try {
918918
final int collectionCacheBytes;
919919
if(collectionCache.endsWith("k")) {
920-
collectionCacheBytes = 1024 * Integer.valueOf(collectionCache.substring(0, collectionCache.length() - 1));
920+
collectionCacheBytes = 1024 * Integer.parseInt(collectionCache.substring(0, collectionCache.length() - 1));
921921
} else if(collectionCache.endsWith("kb")) {
922-
collectionCacheBytes = 1024 * Integer.valueOf(collectionCache.substring(0, collectionCache.length() - 2));
922+
collectionCacheBytes = 1024 * Integer.parseInt(collectionCache.substring(0, collectionCache.length() - 2));
923923
} else if(collectionCache.endsWith("m")) {
924-
collectionCacheBytes = 1024 * 1024 * Integer.valueOf(collectionCache.substring(0, collectionCache.length() - 1));
924+
collectionCacheBytes = 1024 * 1024 * Integer.parseInt(collectionCache.substring(0, collectionCache.length() - 1));
925925
} else if(collectionCache.endsWith("mb")) {
926-
collectionCacheBytes = 1024 * 1024 * Integer.valueOf(collectionCache.substring(0, collectionCache.length() - 2));
926+
collectionCacheBytes = 1024 * 1024 * Integer.parseInt(collectionCache.substring(0, collectionCache.length() - 2));
927927
} else if(collectionCache.endsWith("g")) {
928-
collectionCacheBytes = 1024 * 1024 * 1024 * Integer.valueOf(collectionCache.substring(0, collectionCache.length() - 1));
928+
collectionCacheBytes = 1024 * 1024 * 1024 * Integer.parseInt(collectionCache.substring(0, collectionCache.length() - 1));
929929
} else if(collectionCache.endsWith("gb")) {
930-
collectionCacheBytes = 1024 * 1024 * 1024 * Integer.valueOf(collectionCache.substring(0, collectionCache.length() - 2));
930+
collectionCacheBytes = 1024 * 1024 * 1024 * Integer.parseInt(collectionCache.substring(0, collectionCache.length() - 2));
931931
} else {
932-
collectionCacheBytes = Integer.valueOf(collectionCache);
932+
collectionCacheBytes = Integer.parseInt(collectionCache);
933933
}
934934

935935
config.put(CollectionCache.PROPERTY_CACHE_SIZE_BYTES, collectionCacheBytes);
@@ -1005,7 +1005,7 @@ private void configureBackend( final Optional<Path> dbHome, Element con ) throws
10051005
if(posixChownRestrictedStr == null) {
10061006
posixChownRestricted = true; // default
10071007
} else {
1008-
if(Boolean.valueOf(posixChownRestrictedStr)) {
1008+
if(Boolean.parseBoolean(posixChownRestrictedStr)) {
10091009
posixChownRestricted = true;
10101010
} else {
10111011
// configuration explicitly specifies that posix chown should NOT be restricted
@@ -1019,7 +1019,7 @@ private void configureBackend( final Optional<Path> dbHome, Element con ) throws
10191019
if(preserveOnCopyStr == null) {
10201020
preserveOnCopy = DBBroker.PreserveType.NO_PRESERVE; // default
10211021
} else {
1022-
if(Boolean.valueOf(preserveOnCopyStr)) {
1022+
if(Boolean.parseBoolean(preserveOnCopyStr)) {
10231023
// configuration explicitly specifies that attributes should be preserved on copy
10241024
preserveOnCopy = DBBroker.PreserveType.PRESERVE;
10251025
} else {

exist-core/src/main/java/org/exist/xmldb/RemoteRestoreService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public void restore(final String backup, @Nullable final String newAdminPassword
140140
// dispatch event to the listener
141141
switch (RpcAPI.RestoreTaskEvent.fromCode(event.charAt(0))) {
142142
case STARTED:
143-
restoreListener.started(Long.valueOf(event.substring(1)));
143+
restoreListener.started(Long.parseLong(event.substring(1)));
144144
break;
145145

146146
case PROCESSING_DESCRIPTOR:

exist-core/src/main/java/org/exist/xmldb/RemoteUserManagementService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ public Account getAccount(final String name) throws XMLDBException {
513513
u.addGroup((String) group);
514514
}
515515

516-
u.setEnabled(Boolean.valueOf((String) tab.get("enabled")));
516+
u.setEnabled(Boolean.parseBoolean((String) tab.get("enabled")));
517517
u.setUserMask((Integer) tab.get("umask"));
518518

519519
final Map<String, String> metadata = (Map<String, String>) tab.get("metadata");
@@ -552,7 +552,7 @@ public Account[] getAccounts() throws XMLDBException {
552552
u[i].addGroup((String) group);
553553
}
554554

555-
u[i].setEnabled(Boolean.valueOf((String) tab.get("enabled")));
555+
u[i].setEnabled(Boolean.parseBoolean((String) tab.get("enabled")));
556556
u[i].setUserMask((Integer) tab.get("umask"));
557557

558558
final Map<String, String> metadata = (Map<String, String>) tab.get("metadata");

0 commit comments

Comments
 (0)