Skip to content

Commit 5496ae9

Browse files
committed
[5/5][ide, javafx, misc] Remove deprecated Integer constructor usage.
1 parent a20bd60 commit 5496ae9

File tree

19 files changed

+31
-39
lines changed

19 files changed

+31
-39
lines changed

apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/BasicInfoVisualPanel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ private void setProjectName(String formater, int counter) {
260260

261261
// stolen (then adjusted) from j2seproject
262262
private String validFreeModuleName(String formater, int index) {
263-
String name = MessageFormat.format(formater, new Object[]{ new Integer(index) });
263+
String name = MessageFormat.format(formater, index);
264264
File file = new File(getLocationValue(), name);
265265
return file.exists() ? null : name;
266266
}

contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/ui/wizards/GrailsArtifactWizardIterator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ public void initialize(WizardDescriptor wiz) {
265265
if (c instanceof JComponent) { // assume Swing components
266266
JComponent jc = (JComponent) c;
267267
// Step #.
268-
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, new Integer(i));
268+
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i);
269269
// Step name (actually the whole list for reference).
270270
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps);
271271
}

ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/newproject/FeatureOnDemandWizardIterator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ private List<WizardDescriptor.Panel<WizardDescriptor>> getPanels () {
116116
if (c instanceof JComponent) { // assume Swing components
117117
JComponent jc = (JComponent) c;
118118
// Sets step number of a component
119-
jc.putClientProperty ("WizardPanel_contentSelectedIndex", new Integer (i));
119+
jc.putClientProperty ("WizardPanel_contentSelectedIndex", i);
120120
// Sets steps names for a panel
121121
jc.putClientProperty ("WizardPanel_contentData", steps);
122122
}
@@ -148,7 +148,7 @@ private void createPanelsForEnable () {
148148
if (c instanceof JComponent) { // assume Swing components
149149
JComponent jc = (JComponent) c;
150150
// Sets step number of a component
151-
jc.putClientProperty ("WizardPanel_contentSelectedIndex", new Integer (i));
151+
jc.putClientProperty ("WizardPanel_contentSelectedIndex", i);
152152
// Sets steps names for a panel
153153
jc.putClientProperty ("WizardPanel_contentData", steps);
154154
}

groovy/groovy.samples/src/org/netbeans/modules/groovy/samples/gjdemo/GroovyJavaDemoWizardIterator.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public void initialize(WizardDescriptor wiz) {
119119
JComponent jc = (JComponent) c;
120120
// Step #.
121121
// TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
122-
jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
122+
jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
123123
// Step name (actually the whole list for reference).
124124
jc.putClientProperty("WizardPanel_contentData", steps);
125125
}
@@ -134,8 +134,7 @@ public void uninitialize(WizardDescriptor wiz) {
134134
}
135135

136136
public String name() {
137-
return MessageFormat.format("{0} of {1}",
138-
new Object[]{new Integer(index + 1), new Integer(panels.length)});
137+
return MessageFormat.format("{0} of {1}", index + 1, panels.length);
139138
}
140139

141140
public boolean hasNext() {

groovy/groovy.samples/src/org/netbeans/modules/groovy/samples/nbprojectgen/NBProjectGeneratorsWizardIterator.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public void initialize(WizardDescriptor wiz) {
119119
JComponent jc = (JComponent) c;
120120
// Step #.
121121
// TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
122-
jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
122+
jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
123123
// Step name (actually the whole list for reference).
124124
jc.putClientProperty("WizardPanel_contentData", steps);
125125
}
@@ -134,8 +134,7 @@ public void uninitialize(WizardDescriptor wiz) {
134134
}
135135

136136
public String name() {
137-
return MessageFormat.format("{0} of {1}",
138-
new Object[]{new Integer(index + 1), new Integer(panels.length)});
137+
return MessageFormat.format("{0} of {1}", index + 1, panels.length);
139138
}
140139

141140
public boolean hasNext() {

harness/o.n.insane/src/org/netbeans/insane/model/XmlHeapModel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public Item getObjectAt(String staticRefName) {
6666
}
6767

6868
public Item getItem(int id) {
69-
Item itm = items.get(new java.lang.Integer(id));
69+
Item itm = items.get(id);
7070
if (itm == null) throw new IllegalArgumentException("Bad ID");
7171
return itm;
7272
}

ide/editor.lib/src/org/netbeans/editor/GlyphGutter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,8 @@ private void putDimensionForPrinting() {
765765
if (isMouseOverCycleButton(e) && annos.getNumberOfAnnotations(line) > 1) {
766766
return java.text.MessageFormat.format (
767767
NbBundle.getBundle(BaseKit.class).getString ("cycling-glyph_tooltip"), //NOI18N
768-
new Object[] { new Integer (annos.getNumberOfAnnotations(line)) });
768+
annos.getNumberOfAnnotations(line)
769+
);
769770
}
770771
else if (isMouseOverGlyph(e)) {
771772
AnnotationDesc activeAnnotation = annos.getActiveAnnotation(line);

ide/languages/src/org/netbeans/api/languages/ASTItem.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ ASTPath findPath (List<ASTItem> path, int offset) {
212212

213213
private ASTPath findPath2 (List<ASTItem> path, int offset) {
214214
TreeMap<Integer,ASTItem> childrenMap = getChildrenMap ();
215-
SortedMap<Integer,ASTItem> headMap = childrenMap.headMap (new Integer (offset + 1));
215+
SortedMap<Integer,ASTItem> headMap = childrenMap.headMap(offset + 1);
216216
if (headMap.isEmpty ())
217217
return ASTPath.create (path);
218218
Integer key = headMap.lastKey ();
@@ -231,7 +231,7 @@ private TreeMap<Integer,ASTItem> getChildrenMap () {
231231
Iterator<ASTItem> it = getChildren ().iterator ();
232232
while (it.hasNext ()) {
233233
ASTItem item = it.next ();
234-
childrenMap.put (new Integer (item.getOffset ()), item);
234+
childrenMap.put(item.getOffset(), item);
235235
}
236236
}
237237
return childrenMap;

ide/languages/src/org/netbeans/modules/languages/dataobject/MimeLookupInitializerImpl.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,10 @@ private Lookup _lookup () {
107107
if (LanguagesManager.getDefault ().isSupported (mimeTypes [0])) {
108108
lookup = Lookups.fixed (
109109
new Integer[] {
110-
new Integer (1),
111-
new Integer (2),
112-
// new Integer (3),
113-
// new Integer (4),
114-
new Integer (5),
115-
new Integer (6),
116-
new Integer (7)
117-
},
110+
1, 2,
111+
// 3,
112+
// 4,
113+
5, 6, 7},
118114
new InstanceContent.Convertor<Integer,Object> () {
119115
public Object convert (Integer i) {
120116
switch (i.intValue ()) {

ide/languages/src/org/netbeans/modules/languages/lexer/SLexer.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import java.util.List;
2525
import java.util.Map;
2626
import org.netbeans.api.languages.CharInput;
27-
import org.netbeans.api.languages.ASTToken;
2827
import org.netbeans.api.lexer.PartType;
2928
import org.netbeans.api.languages.ParseException;
3029
import org.netbeans.api.lexer.Token;
@@ -170,7 +169,7 @@ public int getState () {
170169
}
171170

172171
public void setState (int state) {
173-
this.state = new Integer (state);
172+
this.state = state;
174173
}
175174

176175
public void setProperties (Feature tokenProperties) {
@@ -327,8 +326,8 @@ static class TokenProperties implements TokenPropertyProvider {
327326

328327
public Object getValue (Token token, Object key) {
329328
if ("type".equals (key)) return type;
330-
if ("startSkipLength".equals (key)) return new Integer (startSkipLength);
331-
if ("endSkipLength".equals (key)) return new Integer (endSkipLength);
329+
if ("startSkipLength".equals (key)) return startSkipLength;
330+
if ("endSkipLength".equals (key)) return endSkipLength;
332331
return null;
333332
}
334333

0 commit comments

Comments
 (0)