Skip to content

Commit a20bd60

Browse files
committed
[4/5][platform] Remove deprecated Integer constructor usage.
1 parent 77f173f commit a20bd60

File tree

51 files changed

+122
-151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+122
-151
lines changed

platform/core.multiview/src/org/netbeans/core/multiview/MultiViewPeer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ void initComponents() {
217217
input = peer.getInputMap(JComponent.WHEN_FOCUSED);
218218
input.put(stroke, "accesstoggles"); //NOI18N
219219

220-
peer.putClientProperty("MultiViewBorderHack.topOffset", new Integer(tabs.getPreferredSize().height - 1));
220+
peer.putClientProperty("MultiViewBorderHack.topOffset", tabs.getPreferredSize().height - 1);
221221
}
222222

223223
private void assignLookup(MultiViewElement el, MultiViewTopComponentLookup lkp) {
@@ -633,9 +633,9 @@ void peerWriteExternal (ObjectOutput out) throws IOException {
633633
currIndexSplit = i;
634634
}
635635
}
636-
out.writeObject(new Integer(currIndex));
637-
out.writeObject(new Integer(currIndexSplit));
638-
out.writeObject(new Integer(splitOrientation));
636+
out.writeObject(currIndex);
637+
out.writeObject(currIndexSplit);
638+
out.writeObject(splitOrientation);
639639
String htmlDisplayName = peer.getHtmlDisplayName();
640640
if( null != htmlDisplayName )
641641
out.writeObject(htmlDisplayName);

platform/core.output2/src/org/netbeans/core/output2/NbIO.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ public PositionImpl(int pos) {
522522
}
523523

524524
public void scrollTo() {
525-
post(NbIO.this, IOEvent.CMD_SCROLL, new Integer(pos));
525+
post(NbIO.this, IOEvent.CMD_SCROLL, pos);
526526
}
527527
}
528528

platform/core.ui/src/org/netbeans/core/ui/notifications/BalloonManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public void windowStateChanged(WindowEvent e) {
121121
}
122122
currentPane.addComponentListener( listener );
123123
configureBalloon( currentBalloon, currentPane, owner );
124-
currentPane.add( currentBalloon, new Integer(JLayeredPane.POPUP_LAYER-1) );
124+
currentPane.add(currentBalloon, Integer.valueOf(JLayeredPane.POPUP_LAYER-1));
125125
}
126126

127127
/**

platform/core.windows/src/org/netbeans/core/windows/model/ModesSubModel.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public Map<TopComponent, Integer> getSlideInSizes(ModeImpl mode) {
255255
public void setSlideInSize(String side, TopComponent tc, int size) {
256256
if( null != tc && null != side ) {
257257
String tcId = WindowManagerImpl.getInstance().findTopComponentID(tc);
258-
slideInSizes.put( side+tcId, new Integer(size) );
258+
slideInSizes.put(side+tcId, size);
259259
}
260260
}
261261

@@ -348,7 +348,6 @@ public String toString() {
348348
+ "\n" + editorSplitSubModel; // NOI18N
349349
}
350350

351-
/////////////////////////////////////////////
352351
// used when creating snapshot of this model.
353352
public ModeStructureSnapshot.ElementSnapshot createSplitSnapshot() {
354353
return editorSplitSubModel.createSplitSnapshot();
@@ -403,10 +402,6 @@ public void dock( ModeImpl prevMode, ModeImpl floatingMode ) {
403402
}
404403
}
405404

406-
////////////////////////////////////////////
407-
408-
409-
//////////////////////////////
410405
// Controller updates >>
411406

412407
public ModeImpl getModeForOriginator(ModelElement originator) {
@@ -420,7 +415,6 @@ public ModeImpl getModeForOriginator(ModelElement originator) {
420415
}
421416

422417
// Controller updates <<
423-
///////////////////////////////
424418

425419
}
426420

platform/javahelp/src/org/netbeans/modules/javahelp/BrowserDisplayer.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,10 @@ public void setViewData(View v) {
158158
textAttribs.removeAttribute(StyleConstants.FontSize);
159159
textAttribs.removeAttribute(StyleConstants.Bold);
160160
textAttribs.removeAttribute(StyleConstants.Italic);
161-
textAttribs.addAttribute(StyleConstants.FontFamily,
162-
font.getName());
163-
textAttribs.addAttribute(StyleConstants.FontSize,
164-
new Integer(font.getSize()));
165-
textAttribs.addAttribute(StyleConstants.Bold,
166-
Boolean.valueOf(font.isBold()));
167-
textAttribs.addAttribute(StyleConstants.Italic,
168-
Boolean.valueOf(font.isItalic()));
161+
textAttribs.addAttribute(StyleConstants.FontFamily, font.getName());
162+
textAttribs.addAttribute(StyleConstants.FontSize, font.getSize());
163+
textAttribs.addAttribute(StyleConstants.Bold, font.isBold());
164+
textAttribs.addAttribute(StyleConstants.Italic, font.isItalic());
169165
}
170166

171167
/**
@@ -338,8 +334,7 @@ public void setTextFontSize(String size) {
338334
return;
339335
}
340336
textAttribs.removeAttribute(StyleConstants.FontSize);
341-
textAttribs.addAttribute(StyleConstants.FontSize,
342-
new Integer(newsize));
337+
textAttribs.addAttribute(StyleConstants.FontSize, Integer.valueOf(newsize));
343338
setFont(getAttributeSetFont(textAttribs));
344339
Font font = getFont();
345340
}

platform/masterfs/src/org/netbeans/modules/masterfs/filebasedfs/children/ChildrenCache.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
import java.util.Set;
2727

2828
public interface ChildrenCache {
29-
Integer ADDED_CHILD = new Integer(0);
30-
Integer REMOVED_CHILD = new Integer(1);
29+
Integer ADDED_CHILD = 0;
30+
Integer REMOVED_CHILD = 1;
3131

3232
/**
3333
* Get child. If some computation or I/O is needed to be performed off the

platform/masterfs/src/org/netbeans/modules/masterfs/filebasedfs/fileobjects/FileObjectFactory.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,6 @@ private boolean checkCacheState(boolean expectedExists, File file, Caller caller
243243
return true;
244244
}
245245

246-
private Integer initRealExists(int initTouch) {
247-
final Integer retval = new Integer(initTouch);
248-
return retval;
249-
}
250-
251246
private void printWarning(File file) {
252247
StringBuilder sb = new StringBuilder("WARNING(please REPORT): Externally ");
253248
sb.append(file.exists() ? "created " : "deleted "); //NOI18N
@@ -263,7 +258,7 @@ private void printWarning(File file) {
263258
private BaseFileObj issueIfExist(File file, Caller caller, final FileObject parent, FileNaming child, int initTouch, boolean asyncFire, boolean onlyExisting) {
264259
boolean exist = false;
265260
BaseFileObj foForFile = null;
266-
Integer realExists = initRealExists(initTouch);
261+
Integer realExists = initTouch;
267262
final FileChangedManager fcb = FileChangedManager.getInstance();
268263

269264
//use cached info as much as possible + do refresh if something is wrong

platform/masterfs/src/org/netbeans/modules/masterfs/filebasedfs/fileobjects/FolderObj.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,12 +465,12 @@ public void refreshImpl(final boolean expected, boolean fire) {
465465
final FileNaming child = entry.getKey();
466466
final Integer operationId = entry.getValue();
467467

468-
BaseFileObj newChild = (operationId == ChildrenCache.ADDED_CHILD) ?
468+
BaseFileObj newChild = (ChildrenCache.ADDED_CHILD.equals(operationId)) ?
469469
factory.getFileObject(new FileInfo(child.getFile()), FileObjectFactory.Caller.Refresh, true)
470470
:
471471
factory.getCachedOnly(child.getFile());
472472
newChild = (BaseFileObj) ((newChild != null) ? newChild : getFileObject(child.getName()));
473-
if (operationId == ChildrenCache.ADDED_CHILD && newChild != null) {
473+
if (ChildrenCache.ADDED_CHILD.equals(operationId) && newChild != null) {
474474

475475
if (newChild.isFolder()) {
476476
if (fire) {
@@ -484,7 +484,7 @@ public void refreshImpl(final boolean expected, boolean fire) {
484484
}
485485
}
486486

487-
} else if (operationId == ChildrenCache.REMOVED_CHILD) {
487+
} else if (ChildrenCache.REMOVED_CHILD.equals(operationId)) {
488488
if (newChild != null) {
489489
if (newChild.isValid()) {
490490
if (newChild instanceof FolderObj) {

platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/children/ChildrenSupportTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,10 @@ public void testRefresh () throws Exception {
443443
Map.Entry entry = (Map.Entry) it.next();
444444
FileNaming pItem = (FileNaming)entry.getKey();
445445
Integer type = (Integer)entry.getValue();
446-
if (type == ChildrenCache.ADDED_CHILD) {
446+
if (ChildrenCache.ADDED_CHILD.equals(type)) {
447447
assertTrue (added.contains(pItem.getName()));
448448
}
449-
if (type == ChildrenCache.REMOVED_CHILD) {
449+
if (ChildrenCache.REMOVED_CHILD.equals(type)) {
450450
assertTrue (removed.contains(pItem.getName()));
451451
}
452452
}

platform/o.n.core/src/org/netbeans/beaninfo/editors/ArrayOfIntSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public void setAsText(String text) throws IllegalArgumentException {
153153
badFormat(null);
154154

155155
try {
156-
newVal[nextNumber] = new Integer(token).intValue();
156+
newVal[nextNumber] = Integer.parseInt(token);
157157
nextNumber++;
158158
}
159159
catch (NumberFormatException e) {

0 commit comments

Comments
 (0)