Skip to content

Commit cb9852d

Browse files
committed
Remove unneeded Auto boxing / unboxing
1 parent 19dd7e7 commit cb9852d

16 files changed

+29
-29
lines changed

exist-core/src/main/java/org/exist/client/ClientFrame.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,7 @@ public static int showErrorMessageQuery(final String message, final Throwable t)
16871687
if (result == null) {
16881688
return 2;
16891689
}
1690-
return ((Integer) optionPane.getValue()).intValue();
1690+
return (Integer) optionPane.getValue();
16911691
}
16921692

16931693
/*

exist-core/src/main/java/org/exist/client/ConnectionDialog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ private void lstFavouritesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIR
577577
tpConnectionType.setSelectedIndex(cmbConnectionType.getSelectedIndex());
578578

579579
txtServerUri.setText(favourite.getUri());
580-
chkSsl.setSelected(Boolean.valueOf(favourite.isSsl()));
580+
chkSsl.setSelected(favourite.isSsl());
581581

582582
txtConfiguration.setText(favourite.getConfiguration());
583583

exist-core/src/main/java/org/exist/client/InteractiveClient.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -847,8 +847,8 @@ protected boolean process(final String line) {
847847
String p1;
848848
String p2;
849849
while (true) {
850-
p1 = console.readLine("password: ", Character.valueOf('*'));
851-
p2 = console.readLine("re-enter password: ", Character.valueOf('*'));
850+
p1 = console.readLine("password: ", '*');
851+
p2 = console.readLine("re-enter password: ", '*');
852852
if (p1.equals(p2)) {
853853
break;
854854
}
@@ -914,8 +914,8 @@ protected boolean process(final String line) {
914914
String p1;
915915
String p2;
916916
while (true) {
917-
p1 = console.readLine("password: ", Character.valueOf('*'));
918-
p2 = console.readLine("re-enter password: ", Character.valueOf('*'));
917+
p1 = console.readLine("password: ", '*');
918+
p2 = console.readLine("re-enter password: ", '*');
919919
if (p1.equals(p2)) {
920920
break;
921921
}
@@ -2193,7 +2193,7 @@ public boolean run(final String args[]) throws Exception {
21932193

21942194
} else if (options.username.isPresent() && !options.password.isPresent()) {
21952195
try {
2196-
properties.setProperty(PASSWORD, console.readLine("password: ", Character.valueOf('*')));
2196+
properties.setProperty(PASSWORD, console.readLine("password: ", '*'));
21972197
} catch (final Exception e) {
21982198
}
21992199
}

exist-core/src/main/java/org/exist/client/TriggersDialog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ public Component getTableCellRendererComponent(final JTable table, final Object
274274
}
275275

276276
// Set the state
277-
setSelected((value != null && ((Boolean) value).booleanValue()));
277+
setSelected((value != null && (Boolean) value));
278278
return this;
279279
}
280280
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ public Boolean getPropertyBoolean(final String name) {
298298

299299
public Boolean getPropertyBoolean(String name, boolean defaultValue) {
300300
Boolean value = getPropertyBoolean(name);
301-
if(value == null) return Boolean.valueOf(defaultValue);
301+
if(value == null) return defaultValue;
302302

303303
return value;
304304
}
@@ -340,7 +340,7 @@ public Long getPropertyLong(final String name, final Long defaultValue, final bo
340340
}
341341
final long result = Long.parseLong(value);
342342
if ((positive) && (result < 0)) {
343-
return defaultValue.longValue();
343+
return defaultValue;
344344
}
345345
return result;
346346
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public void sendRedirect(String url) throws IOException {
212212
* @param value the header value
213213
*/
214214
public void setDateHeader(String name, long value) {
215-
dateHeaders.put(name, Long.valueOf(value) );
215+
dateHeaders.put(name, value);
216216
response.setDateHeader(name, value);
217217
}
218218

@@ -227,7 +227,7 @@ public long getDateHeader(String name) {
227227
long ret = 0;
228228
final Long val = dateHeaders.get(name);
229229
if ( val != null )
230-
{ret = val.longValue();}
230+
{ret = val;}
231231
return ret;
232232
}
233233

exist-core/src/main/java/org/exist/launcher/ConfigurationDialog.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ public ConfigurationDialog(Consumer<Boolean> callback) {
6161
try {
6262
Configuration existConfig = new Configuration();
6363
final int cacheSizeProp = existConfig.getInteger(DefaultCacheManager.PROPERTY_CACHE_SIZE);
64-
cacheSize.setValue(Integer.valueOf(cacheSizeProp));
64+
cacheSize.setValue(cacheSizeProp);
6565

6666
final int collectionCacheProp = existConfig.getInteger(CollectionCache.PROPERTY_CACHE_SIZE_BYTES);
67-
collectionCache.setValue(Integer.valueOf(collectionCacheProp / 1024 / 1024)); // show in MB
67+
collectionCache.setValue(collectionCacheProp / 1024 / 1024); // show in MB
6868

6969
final Path dir = (Path)existConfig.getProperty(BrokerPool.PROPERTY_DATA_DIR);
7070
dataDir.setText(dir.toAbsolutePath().toString());
@@ -190,7 +190,7 @@ private void initComponents() {
190190
gridBagConstraints.insets = new java.awt.Insets(0, 22, 0, 0);
191191
getContentPane().add(jLabel2, gridBagConstraints);
192192

193-
maxMemory.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(1024), Integer.valueOf(512), null, Integer.valueOf(64)));
193+
maxMemory.setModel(new javax.swing.SpinnerNumberModel(1024, 512, null, 64));
194194
maxMemory.addChangeListener(this::maxMemoryChanged);
195195
gridBagConstraints = new java.awt.GridBagConstraints();
196196
gridBagConstraints.gridx = 3;

exist-core/src/main/java/org/exist/protocolhandler/xmlrpc/XmlrpcUpload.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public void stream(XmldbURL xmldbURL, InputStream is) throws IOException {
9696
params.add(handle);
9797
}
9898
params.add(buf);
99-
params.add(Integer.valueOf(len));
99+
params.add(len);
100100
handle = (String)client.execute("upload", params);
101101
}
102102

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ private void configureRecovery( final Optional<Path> dbHome, Element recovery )
11141114
if( option != null ) {
11151115
value = "yes".equals(option);
11161116
}
1117-
setProperty( BrokerPool.PROPERTY_RECOVERY_FORCE_RESTART, Boolean.valueOf( value ) );
1117+
setProperty( BrokerPool.PROPERTY_RECOVERY_FORCE_RESTART, value);
11181118
LOG.debug( BrokerPool.PROPERTY_RECOVERY_FORCE_RESTART + ": " + config.get( BrokerPool.PROPERTY_RECOVERY_FORCE_RESTART ) );
11191119

11201120
option = getConfigAttributeValue( recovery, BrokerPool.RECOVERY_POST_RECOVERY_CHECK );
@@ -1123,7 +1123,7 @@ private void configureRecovery( final Optional<Path> dbHome, Element recovery )
11231123
if( option != null ) {
11241124
value = "yes".equals(option);
11251125
}
1126-
setProperty( BrokerPool.PROPERTY_RECOVERY_CHECK, Boolean.valueOf( value ) );
1126+
setProperty( BrokerPool.PROPERTY_RECOVERY_CHECK, value);
11271127
LOG.debug( BrokerPool.PROPERTY_RECOVERY_CHECK + ": " + config.get( BrokerPool.PROPERTY_RECOVERY_CHECK ) );
11281128
}
11291129

@@ -1375,7 +1375,7 @@ private void configureIndexer( final Optional<Path> dbHome, Document doc, Elemen
13751375
LOG.warn( "parameter index-depth should be >= 3 or you will experience a severe " + "performance loss for node updates (XUpdate or XQuery update extensions)" );
13761376
depth = 3;
13771377
}
1378-
config.put( NativeBroker.PROPERTY_INDEX_DEPTH, Integer.valueOf(depth) );
1378+
config.put( NativeBroker.PROPERTY_INDEX_DEPTH, depth);
13791379
LOG.debug( NativeBroker.PROPERTY_INDEX_DEPTH + ": " + config.get( NativeBroker.PROPERTY_INDEX_DEPTH ) );
13801380
}
13811381
catch( final NumberFormatException e ) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ protected void getRemoteContentIntoLocalFile(final OutputStream os, final boolea
287287
method = "getNextChunk";
288288
}
289289

290-
long offset = ((Integer) table.get("offset")).intValue();
290+
long offset = (Integer) table.get("offset");
291291
byte[] data = (byte[]) table.get("data");
292292
final boolean isCompressed = "yes".equals(properties.getProperty(EXistOutputKeys.COMPRESS_OUTPUT, "no"));
293293

@@ -361,7 +361,7 @@ protected final int getInMemorySize(Properties properties) {
361361
if (inMemoryBufferSize == null) {
362362
inMemoryBufferSize = new LazyVal<>(() -> Integer.parseInt(properties.getProperty("in-memory-buffer-size", Integer.toString(VirtualTempPath.DEFAULT_IN_MEMORY_SIZE))));
363363
}
364-
return inMemoryBufferSize.get().intValue();
364+
return inMemoryBufferSize.get();
365365
}
366366

367367
protected static InputStream getAnyStream(final Object obj)

0 commit comments

Comments
 (0)