From 63ef313ad5820c2d6d80c57b814bd86ac905e400 Mon Sep 17 00:00:00 2001 From: Tom Page Date: Fri, 17 Nov 2023 11:42:33 +0000 Subject: [PATCH] ACS-5993 Add classpath support to PMD. (#2301) --- .github/workflows/ci.yml | 7 +- .../email/server/AliasableAspect.java | 78 +++++++++---------- 2 files changed, 45 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88cc36939d..4a1fd44b5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,7 +78,12 @@ jobs: !contains(github.event.head_commit.message, '[skip tests]') && !contains(github.event.head_commit.message, '[force]') 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: name: "Core, Data-Model, Repository - AllUnitTestsSuite - Build and test" diff --git a/repository/src/main/java/org/alfresco/email/server/AliasableAspect.java b/repository/src/main/java/org/alfresco/email/server/AliasableAspect.java index 1c35150f37..7f3631d22c 100644 --- a/repository/src/main/java/org/alfresco/email/server/AliasableAspect.java +++ b/repository/src/main/java/org/alfresco/email/server/AliasableAspect.java @@ -1,28 +1,28 @@ -/* - * #%L - * Alfresco Repository - * %% - * Copyright (C) 2005 - 2016 Alfresco Software Limited - * %% - * This file is part of the Alfresco software. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * 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 - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Alfresco is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - * #L% - */ +/* + * #%L + * Alfresco Repository + * %% + * Copyright (C) 2005 - 2016 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ package org.alfresco.email.server; import java.io.Serializable; @@ -199,26 +199,26 @@ public class AliasableAspect implements NodeServicePolicies.OnAddAspectPolicy, } return null; - } - - /** - * @see org.alfresco.repo.node.NodeServicePolicies.OnAddAspectPolicy#onAddAspect(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.namespace.QName) - * @exception AlfrescoRuntimeException Throws if the alias property is duplicated. - */ - public void onAddAspect(NodeRef nodeRef, QName aspectTypeQName) + } + + /** + * @see org.alfresco.repo.node.NodeServicePolicies.OnAddAspectPolicy#onAddAspect(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.namespace.QName) + * @exception AlfrescoRuntimeException Throws if the alias property is duplicated. + */ + public void onAddAspect(NodeRef nodeRef, QName aspectTypeQName) { Object alias = nodeService.getProperty(nodeRef, EmailServerModel.PROP_ALIAS); if (alias != null) { addAlias(nodeRef, alias.toString()); } - } - - /** - * @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 alias property is duplicated. - */ - public void onUpdateProperties(NodeRef nodeRef, Map before, Map after) + } + + /** + * @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 alias property is duplicated. + */ + public void onUpdateProperties(NodeRef nodeRef, Map before, Map after) { String oldAlias = (String)before.get(EmailServerModel.PROP_ALIAS); String newAlias = (String)after.get(EmailServerModel.PROP_ALIAS);