Skip to content

Commit

Permalink
[eclipse-mylyn#254] java.lang.Boolean constructor is deprecated
Browse files Browse the repository at this point in the history
Replaced all other constructors of primitive wrappers

Signed-off-by: Vasily Fedorov <[email protected]>
  • Loading branch information
sovesti committed Jul 21, 2023
1 parent 9d74945 commit 94bde75
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ private static Character parseReference(String s) {
// Decimal reference
value = Integer.parseInt(s.substring(1));
}
return new Character((char) value);
return Character.valueOf((char) value);
} catch (NumberFormatException e) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public Float getFloat(String key) {
}
String strValue = attr.getValue();
try {
return new Float(strValue);
return Float.valueOf(strValue);
} catch (NumberFormatException e) {
StatusHandler.log(new Status(IStatus.ERROR, ICommonsCoreConstants.ID_PLUGIN,
"Memento problem - Invalid float for key: " //$NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ private static Character parseReference(String s) {
// Decimal reference
value = Integer.parseInt(s.substring(1));
}
return new Character((char) value);
return Character.valueOf((char) value);
} catch (NumberFormatException e) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public int compare(String o1, String o2) {
if (index1 != -1 && index2 != -1) {
String s1 = o1.substring(0, index1);
String s2 = o2.substring(0, index2);
return (-1) * new Float(s1).compareTo(new Float(s2));
return (-1) * Float.valueOf(s1).compareTo(Float.valueOf(s2));
} else {
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public int hashCode() {
hashCode += delta.hashCode();
}
// TODO: could this lose precision?
hashCode += new Float(interestContribution).hashCode();
hashCode += Float.valueOf(interestContribution).hashCode();
return hashCode;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,17 @@ public int compare(Viewer viewer, Object item1, Object item2) {
val1 = task1.getAttribute(GerritTask.REVIEW_STATE);
val2 = task2.getAttribute(GerritTask.REVIEW_STATE);
if (val1 != null && val2 != null) {
Integer v1 = new Integer(val1);
Integer v2 = new Integer(val2);
Integer v1 = Integer.valueOf(val1);
Integer v2 = Integer.valueOf(val2);
result = v2 - v1;
}
break;
case 9: // Verify
val1 = task1.getAttribute(GerritTask.VERIFY_STATE);
val2 = task2.getAttribute(GerritTask.VERIFY_STATE);
if (val1 != null && val2 != null) {
Integer v1 = new Integer(val1);
Integer v2 = new Integer(val2);
Integer v1 = Integer.valueOf(val1);
Integer v2 = Integer.valueOf(val2);
result = v2 - v1;
}
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class ApprovalValueMap extends EObjectImpl implements BasicEMap.Entry<IAp
* @generated
* @ordered
*/
protected static final Integer VALUE_EDEFAULT = new Integer(0);
protected static final Integer VALUE_EDEFAULT = Integer.valueOf(0);

/**
* The cached value of the '{@link #getTypedValue() <em>Value</em>}' attribute. <!-- begin-user-doc --> <!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ public void endElement(String uri, String localName, String qName) throws SAXExc
attachmentAttribute = repositoryTaskData.getRoot()
.createAttribute(TaskAttribute.PREFIX_ATTACHMENT + parsedText);
attachment = BugzillaAttachmentMapper.createFrom(attachmentAttribute);
attachment.setLength(new Long(-1));
attachment.setLength(Long.valueOf(-1));
attachment.setAttachmentId(parsedText);
attachment.setPatch(isPatch);
attachment.setDeprecated(isDeprecated);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ public void getTaskData(Set<String> taskIds, final TaskDataCollector collector,
int x = 0;
for (; itr.hasNext(); x++) {
String taskId = itr.next();
formData[x] = new Integer(taskId);
formData[x] = Integer.valueOf(taskId);

TaskData taskData = new TaskData(mapper, getConnectorKind(), getLocation().getUrl(), taskId);
bugzillaClient.setupExistingBugAttributes(getLocation().getUrl(), taskData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ public void testMilestoneDate() throws XmlRpcException, IOException {
call("ticket.milestone.create", "foo", attributes);

Map<?, ?> values = (Map<?, ?>) call("ticket.milestone.get", "foo");
assertEquals(new Integer(due), values.get("due"));
assertEquals(new Integer(completed), values.get("completed"));
assertEquals(Integer.valueOf(due), values.get("due"));
assertEquals(Integer.valueOf(completed), values.get("completed"));

call("ticket.milestone.delete", "foo");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public void addWorkingSetElapsedTime(String workingSetName, Date startDate, Date
}
Long daysActivity = noTaskActiveMap.get(hourOfDay);
if (daysActivity == null) {
daysActivity = new Long(0);
daysActivity = Long.valueOf(0);
}

daysActivity = daysActivity.longValue() + attentionSpan;
Expand Down Expand Up @@ -328,7 +328,7 @@ public void addElapsedTime(AbstractTask task, Date startDate, Date endDate) {
snapToStartOfHour(hourOfDay);
Long daysActivity = activityMap.get(hourOfDay);
if (daysActivity == null) {
daysActivity = new Long(0);
daysActivity = Long.valueOf(0);
}

daysActivity = daysActivity.longValue() + attentionSpan;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public TaskRepository(String kind, String serverUrl, Map<String, String> propert
setProperty(IRepositoryConstants.PROPERTY_URL, serverUrl);
this.properties.putAll(properties);
// use platform proxy by default (headless will need to set this to false)
this.setProperty(TaskRepository.PROXY_USEDEFAULT, new Boolean(true).toString());
this.setProperty(TaskRepository.PROXY_USEDEFAULT, Boolean.valueOf(true).toString());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public SortedMap<Long, File> getBackupFiles() {
continue;
}
if (date != null && date.getTime() > 0) {
filesMap.put(new Long(date.getTime()), file);
filesMap.put(Long.valueOf(date.getTime()), file);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public void focusGained(FocusEvent e) {

/** Configures annotation model for spell checking. */
private void updateDocument(SourceViewer viewer, Document document, boolean readOnly) {
if (new Integer(this.textVersion).equals(viewer.getData(KEY_TEXT_VERSION))) {
if (Integer.valueOf(this.textVersion).equals(viewer.getData(KEY_TEXT_VERSION))) {
// already up-to-date, skip re-loading of the document
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ public void keyPressed(KeyEvent e) {
filteredTree.getFilterControl().setFocus();
} else if (e.stateMask == 0) {
if (Character.isLetter((char) e.keyCode) || Character.isDigit((char) e.keyCode)) {
String string = new Character((char) e.keyCode).toString();
String string = Character.valueOf((char) e.keyCode).toString();
filteredTree.getFilterControl().setFocus();
filteredTree.getFilterControl().setText(string);
filteredTree.getFilterControl().setSelection(1, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class SubclipseConnector extends ScmConnector {

private final Map<IProject, SubclipseRepository> mapProjToRepo = new HashMap<IProject, SubclipseRepository>();

private Integer threadBookNum = new Integer(0);
private Integer threadBookNum = Integer.valueOf(0);

/**
* allow mapping from local url project folders to works space project
Expand Down

0 comments on commit 94bde75

Please sign in to comment.