ACS-5993 Add classpath support to PMD. (#2301)

This commit is contained in:
Tom Page
2023-11-17 11:42:33 +00:00
committed by GitHub
parent a63cfecbcc
commit 63ef313ad5
2 changed files with 45 additions and 40 deletions

View File

@@ -78,7 +78,12 @@ jobs:
!contains(github.event.head_commit.message, '[skip tests]') && !contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force]') !contains(github.event.head_commit.message, '[force]')
steps: steps:
- uses: Alfresco/ya-pmd-scan@v2.0.5 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2
- uses: Alfresco/ya-pmd-scan@v3.0.0
with:
classpath-build-command: "mvn test-compile -ntp -Pags -pl \"-:alfresco-community-repo-docker\""
all_unit_tests_suite: all_unit_tests_suite:
name: "Core, Data-Model, Repository - AllUnitTestsSuite - Build and test" name: "Core, Data-Model, Repository - AllUnitTestsSuite - Build and test"

View File

@@ -1,28 +1,28 @@
/* /*
* #%L * #%L
* Alfresco Repository * Alfresco Repository
* %% * %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited * Copyright (C) 2005 - 2016 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of * If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is * the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms: * provided under the following open source license terms:
* *
* Alfresco is free software: you can redistribute it and/or modify * Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* Alfresco is distributed in the hope that it will be useful, * Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>. * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L% * #L%
*/ */
package org.alfresco.email.server; package org.alfresco.email.server;
import java.io.Serializable; import java.io.Serializable;
@@ -199,26 +199,26 @@ public class AliasableAspect implements NodeServicePolicies.OnAddAspectPolicy,
} }
return null; return null;
} }
/** /**
* @see org.alfresco.repo.node.NodeServicePolicies.OnAddAspectPolicy#onAddAspect(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.namespace.QName) * @see org.alfresco.repo.node.NodeServicePolicies.OnAddAspectPolicy#onAddAspect(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.namespace.QName)
* @exception AlfrescoRuntimeException Throws if the <b>alias</b> property is duplicated. * @exception AlfrescoRuntimeException Throws if the <b>alias</b> property is duplicated.
*/ */
public void onAddAspect(NodeRef nodeRef, QName aspectTypeQName) public void onAddAspect(NodeRef nodeRef, QName aspectTypeQName)
{ {
Object alias = nodeService.getProperty(nodeRef, EmailServerModel.PROP_ALIAS); Object alias = nodeService.getProperty(nodeRef, EmailServerModel.PROP_ALIAS);
if (alias != null) if (alias != null)
{ {
addAlias(nodeRef, alias.toString()); addAlias(nodeRef, alias.toString());
} }
} }
/** /**
* @see org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy#onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef, java.util.Map, java.util.Map) * @see org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy#onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef, java.util.Map, java.util.Map)
* @exception AlfrescoRuntimeException Throws if the <b>alias</b> property is duplicated. * @exception AlfrescoRuntimeException Throws if the <b>alias</b> property is duplicated.
*/ */
public void onUpdateProperties(NodeRef nodeRef, Map<QName, Serializable> before, Map<QName, Serializable> after) public void onUpdateProperties(NodeRef nodeRef, Map<QName, Serializable> before, Map<QName, Serializable> after)
{ {
String oldAlias = (String)before.get(EmailServerModel.PROP_ALIAS); String oldAlias = (String)before.get(EmailServerModel.PROP_ALIAS);
String newAlias = (String)after.get(EmailServerModel.PROP_ALIAS); String newAlias = (String)after.get(EmailServerModel.PROP_ALIAS);