Fix 6 instances of 'scary' findbugs issue: "Method creates local variable-based synchronized collection "

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@113198 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Neil McErlean
2015-09-28 11:49:20 +00:00
parent 9d7f3c2b36
commit bb9e6a473b
6 changed files with 6 additions and 6 deletions

View File

@@ -374,7 +374,7 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JS
String displayPath = getDisplayPath(originatingLocation);
String[] displayPathElements = displayPath.split(pathSeparator);
Object[] subPath = ArrayUtils.subarray(displayPathElements, 5, displayPathElements.length);
StringBuffer originatingLocationPath = new StringBuffer();
StringBuilder originatingLocationPath = new StringBuilder();
for (int i = 0; i < subPath.length; i++)
{
originatingLocationPath.append(pathSeparator).append(subPath[i]);

View File

@@ -307,7 +307,7 @@ public class DeclarativeReportGenerator extends BaseReportGenerator
String typePrefixName = reportType.getPrefixedQName(namespaceService).getPrefixString().replace(":", "_");
String extension = mimetypeService.getExtension(mimetype);
StringBuffer sb = new StringBuffer(128)
StringBuilder sb = new StringBuilder(128)
.append("report_")
.append(typePrefixName)
.append(".")

View File

@@ -153,7 +153,7 @@ public class RmActionPost extends DeclarativeWebScript
}
// Check that all the nodes provided exist and build report string
StringBuffer targetNodeRefsString = new StringBuffer(30);
StringBuilder targetNodeRefsString = new StringBuilder(30);
boolean firstTime = true;
for (NodeRef targetNodeRef : targetNodeRefs)
{

View File

@@ -334,7 +334,7 @@ public class RMSearchGet extends DeclarativeWebScript
NodeRef person = personService.getPerson(userName);
if (person != null)
{
StringBuffer displayName = new StringBuffer(128);
StringBuilder displayName = new StringBuilder(128);
displayName.append(nodeService.getProperty(person, ContentModel.PROP_FIRSTNAME))
.append(" ")
.append(nodeService.getProperty(person, ContentModel.PROP_LASTNAME));

View File

@@ -200,7 +200,7 @@ public class RMMethodSecurityInterceptor extends MethodSecurityInterceptor
if (!capabilities.isEmpty())
{
StringBuffer buffer = new StringBuffer("\n");
StringBuilder buffer = new StringBuilder("\n");
for (CapabilityReport capability : capabilities)
{
buffer.append(" ").append(capability.name).append(" (").append(capability.status).append(")\n");

View File

@@ -189,7 +189,7 @@ public class RMMethodSecurityPostProcessor implements BeanFactoryPostProcessor
*/
private String convertToString(Map<String, String> map)
{
StringBuffer buffer = new StringBuffer(256);
StringBuilder buffer = new StringBuilder(256);
for (Map.Entry<String, String> entry : map.entrySet())
{
buffer.append(entry.getKey()).append("=").append(entry.getValue()).append("\n");