ACS-6188 Remove usage of deprecated constructors (#2295)

* Apply org.openrewrite.staticanalysis.PrimitiveWrapperClassConstructorToValueOf recipe

* ACS-6188 Update copyright headers

* ACS-6188 Update copyright header

* ACS-6188 Clean-up

---------

Co-authored-by: dsibilio <24280982+dsibilio@users.noreply.github.com>
Co-authored-by: Domenico Sibilio <domenicosibilio@gmail.com>
This commit is contained in:
Alfresco Build
2023-11-08 13:05:00 +01:00
committed by GitHub
parent a386dacce1
commit 19840563e4
92 changed files with 274 additions and 275 deletions

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2023 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -57,7 +57,7 @@ public class ServerStatusWebScript extends AbstractWebScript implements Applicat
// hence providing ability for subsystem to be disabled (whilst still supporting ability to check status and/or dynamically start via JMX)
String isEnabled = (String)subsystem.getProperty("imap.server.enabled");
if (new Boolean(isEnabled).booleanValue())
if (Boolean.valueOf(isEnabled).booleanValue())
{
res.getWriter().write("enabled");
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2023 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -109,7 +109,7 @@ public class KeywordSearch extends DeclarativeWebScript
int startPage = 1;
try
{
startPage = new Integer(startPageArg);
startPage = Integer.valueOf(startPageArg);
}
catch(NumberFormatException e)
{
@@ -119,7 +119,7 @@ public class KeywordSearch extends DeclarativeWebScript
int itemsPerPage = DEFAULT_ITEMS_PER_PAGE;
try
{
itemsPerPage = new Integer(itemsPerPageArg);
itemsPerPage = Integer.valueOf(itemsPerPageArg);
}
catch(NumberFormatException e)
{

View File

@@ -133,7 +133,7 @@ public class QuickShareThumbnailContentGet extends QuickShareContentGet
String phString = req.getParameter("ph");
if (phString != null)
{
ph = new Boolean(phString);
ph = Boolean.valueOf(phString);
}
Scriptable scope = new BaseScopableProcessorExtension().getScope(); // note: required for ValueConverter (collection)

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2023 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -149,7 +149,7 @@ public class PatchThumbnailsAsRenditionsGet extends DeclarativeWebScript
}
Map<String, Object> model = new HashMap<String, Object>();
model.put("patchedNodeCount", new Long(patchedNodeRefs));
model.put("patchedNodeCount", Long.valueOf(patchedNodeRefs));
return model;
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2023 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -165,7 +165,7 @@ public class Paging
{
try
{
pageNo = new Integer(strPageNo);
pageNo = Integer.valueOf(strPageNo);
}
catch(NumberFormatException e) {};
}
@@ -177,7 +177,7 @@ public class Paging
{
try
{
pageSize = new Integer(strPageSize);
pageSize = Integer.valueOf(strPageSize);
}
catch(NumberFormatException e) {};
}
@@ -189,7 +189,7 @@ public class Paging
{
try
{
skipCount = new Integer(strSkipCount);
skipCount = Integer.valueOf(strSkipCount);
}
catch(NumberFormatException e) {};
}
@@ -201,7 +201,7 @@ public class Paging
{
try
{
maxItems = new Integer(strMaxItems);
maxItems = Integer.valueOf(strMaxItems);
}
catch(NumberFormatException e) {};
}

View File

@@ -351,7 +351,7 @@ public class WebDAV
}
else if (davPropName.equals(WebDAV.XML_GET_CONTENT_LENGTH))
{
value = new Long(contentData.getSize());
value = Long.valueOf(contentData.getSize());
}
}
return value;

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2023 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -56,7 +56,7 @@ public class SearchSQLQuery
this.stmt = stmt;
this.format = format != null ? format : "default";
this.locales = locales != null ? locales : Collections.emptyList();
this.itemLimit = itemLimit == null || itemLimit < 1 ? new Integer(1000) : itemLimit;
this.itemLimit = itemLimit == null || itemLimit < 1 ? Integer.valueOf(1000) : itemLimit;
this.includeMetadata = includeMetadata;
this.timezone = timezone;
this.filterQueries = filterQueries != null ? filterQueries : Collections.emptyList();

View File

@@ -72,7 +72,7 @@ public class CORSContextListener implements ServletContextListener
WebApplicationContext wc = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
Properties gP = (Properties) wc.getBean(BEAN_GLOBAL_PROPERTIES);
Boolean corsEnabled = new Boolean(gP.getProperty(CORS_ENABLED));
Boolean corsEnabled = Boolean.valueOf(gP.getProperty(CORS_ENABLED));
if(logger.isDebugEnabled())
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* Copyright (C) 2005 - 2023 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -146,7 +146,7 @@ public class AdminWebScriptTest extends BaseWebScriptTest
RepoUsage usage = usageStatus.getUsage();
LicenseDescriptor licenseDescriptor = descriptorService.getLicenseDescriptor();
Date validUntil = (licenseDescriptor == null) ? null : licenseDescriptor.getValidUntil(); // might be null
Integer checkLevel = new Integer(usageStatus.getLevel().ordinal());
Integer checkLevel = Integer.valueOf(usageStatus.getLevel().ordinal());
String url = "/api/admin/usage";
TestWebScriptServer.GetRequest req = new TestWebScriptServer.GetRequest(url);

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2023 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -445,7 +445,7 @@ public class AuditWebScriptTest extends BaseWebScriptTest
Thread.sleep(1000);
}
assertTrue("Expected at least one entry", jsonEntries.length() > 0);
assertEquals("Entry count and physical count don't match", new Long(jsonEntries.length()), entryCount);
assertEquals("Entry count and physical count don't match", Long.valueOf(jsonEntries.length()), entryCount);
JSONObject jsonEntry = jsonEntries.getJSONObject(0);
Long entryId = jsonEntry.getLong(AbstractAuditWebScript.JSON_KEY_ENTRY_ID);
assertNotNull("No entry ID", entryId);
@@ -483,7 +483,7 @@ public class AuditWebScriptTest extends BaseWebScriptTest
assertTrue("Should have found entries", jsonEntries.length() > 0);
// Now login with failure using a GUID and ensure that we can find it
String missingUser = new Long(System.currentTimeMillis()).toString();
String missingUser = Long.valueOf(System.currentTimeMillis()).toString();
// Query for event that has not happened
url = "/api/audit/query/" + APP_REPOTEST_NAME + "/repositorytest/login/error/user" + "?value=" + missingUser;

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2023 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -147,7 +147,7 @@ public class QuickShareRestApiTest extends BaseWebScriptTest
userOneHome = repositoryHelper.getUserHome(personService.getPerson(USER_ONE));
// no pun intended
quickFile = AbstractContentTransformerTest.loadQuickTestFile("jpg");
TEST_CONTENT = new byte[new Long(quickFile.length()).intValue()];
TEST_CONTENT = new byte[Long.valueOf(quickFile.length()).intValue()];
new FileInputStream(quickFile).read(TEST_CONTENT);
testNode = createTestFile(userOneHome, TEST_NAME, quickFile);

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* Copyright (C) 2005 - 2023 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -913,8 +913,8 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
{
String[] parts = currentVersionLabel.split("\\.");
int majorVer = new Integer(parts[0]).intValue();
int minorVer = new Integer(parts[1]).intValue();
int majorVer = Integer.valueOf(parts[0]).intValue();
int minorVer = Integer.valueOf(parts[1]).intValue();
Map<String, String> params = new HashMap<>();
params.put(Nodes.PARAM_OVERWRITE, "true");

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* Copyright (C) 2005 - 2023 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -520,8 +520,8 @@ public class NodeVersionsApiTest extends AbstractSingleNetworkSiteTest
}
String[] parts = currentVersionLabel.split("\\.");
int majorVer = new Integer(parts[0]).intValue();
int minorVer = new Integer(parts[1]).intValue();
int majorVer = Integer.valueOf(parts[0]).intValue();
int minorVer = Integer.valueOf(parts[1]).intValue();
if (expectedMajorVersion)
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* Copyright (C) 2005 - 2023 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -209,7 +209,7 @@ public class SharedLinkApiTest extends AbstractBaseApiTest
assertEquals(file1_MimeType, resp.getContent().getMimeType());
assertEquals("Adobe PDF Document", resp.getContent().getMimeTypeName());
assertEquals(new Long(file1_originalBytes.length), resp.getContent().getSizeInBytes());
assertEquals(Long.valueOf(file1_originalBytes.length), resp.getContent().getSizeInBytes());
assertEquals("UTF-8", resp.getContent().getEncoding());
// assertEquals(docModifiedAt.getTime(), resp.getModifiedAt().getTime()); // not changed