From 46bd94c6a206c6ccc8832369d4726b5b17620208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Aur=C3=A8le=20Brothier?= Date: Thu, 26 Apr 2018 15:32:08 +0200 Subject: [PATCH] [CLOUDSTACK-10254] checkstyle: add package name declaration validation (#2422) * checktyle: verify package name matches directory structure * fix new checkstyle findings on directory with package name mismatch --- .../subsystem/api/storage/disktype/QCOW2.java | 16 ---------------- .../subsystem/api/storage/disktype/Unknown.java | 16 ---------------- .../subsystem/api/storage/disktype/VHD.java | 16 ---------------- .../subsystem/api/storage/disktype/VHDX.java | 16 ---------------- .../subsystem/api/storage/disktype/VMDK.java | 16 ---------------- .../api/storage/disktype/VolumeDiskType.java | 16 ---------------- .../api/storage/disktype/VolumeDiskTypeBase.java | 16 ---------------- .../storage/disktype/VolumeDiskTypeHelper.java | 16 ---------------- .../org/apache/cloudstack/storage/EndPoint.java | 16 ---------------- .../cloudstack/storage/datastore/DataStore.java | 16 ---------------- .../storage/datastore/TemplateInDataStore.java | 16 ---------------- pom.xml | 14 +++++++++++--- tools/checkstyle/pom.xml | 2 +- .../src/main/resources/cloud-style.xml | 4 ++-- 14 files changed, 14 insertions(+), 182 deletions(-) delete mode 100644 engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/QCOW2.java delete mode 100644 engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/Unknown.java delete mode 100644 engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VHD.java delete mode 100644 engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VHDX.java delete mode 100644 engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VMDK.java delete mode 100644 engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskType.java delete mode 100644 engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskTypeBase.java delete mode 100644 engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskTypeHelper.java delete mode 100644 engine/storage/src/main/java/org/apache/cloudstack/storage/EndPoint.java delete mode 100644 engine/storage/src/main/java/org/apache/cloudstack/storage/datastore/DataStore.java delete mode 100644 engine/storage/src/main/java/org/apache/cloudstack/storage/datastore/TemplateInDataStore.java diff --git a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/QCOW2.java b/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/QCOW2.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/QCOW2.java +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. diff --git a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/Unknown.java b/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/Unknown.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/Unknown.java +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. diff --git a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VHD.java b/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VHD.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VHD.java +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. diff --git a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VHDX.java b/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VHDX.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VHDX.java +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. diff --git a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VMDK.java b/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VMDK.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VMDK.java +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. diff --git a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskType.java b/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskType.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskType.java +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. diff --git a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskTypeBase.java b/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskTypeBase.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskTypeBase.java +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. diff --git a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskTypeHelper.java b/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskTypeHelper.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskTypeHelper.java +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. diff --git a/engine/storage/src/main/java/org/apache/cloudstack/storage/EndPoint.java b/engine/storage/src/main/java/org/apache/cloudstack/storage/EndPoint.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/storage/src/main/java/org/apache/cloudstack/storage/EndPoint.java +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. diff --git a/engine/storage/src/main/java/org/apache/cloudstack/storage/datastore/DataStore.java b/engine/storage/src/main/java/org/apache/cloudstack/storage/datastore/DataStore.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/storage/src/main/java/org/apache/cloudstack/storage/datastore/DataStore.java +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. diff --git a/engine/storage/src/main/java/org/apache/cloudstack/storage/datastore/TemplateInDataStore.java b/engine/storage/src/main/java/org/apache/cloudstack/storage/datastore/TemplateInDataStore.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/storage/src/main/java/org/apache/cloudstack/storage/datastore/TemplateInDataStore.java +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. diff --git a/pom.xml b/pom.xml index 6c4f828bef9..2e61773623e 100644 --- a/pom.xml +++ b/pom.xml @@ -108,7 +108,8 @@ target 1.1.0 4.0.0 - 2.17 + 3.0.0 + 8.7 2.11 3.0.3 2.10.3 @@ -619,6 +620,11 @@ checkstyle ${project.version} + + com.puppycrawl.tools + checkstyle + ${cs.checkstyle-lib.version} + @@ -634,9 +640,11 @@ cloud-style.xml true true - ${project.basedir} + + ${project.basedir} + **\/*.java - **\/deps\/,**\/test\/,**\/target\/,**\/bin\/,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat,**\/apidoc\/ + **\/deps\/,**\/test\/,**\/target\/,**\/bin\/,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat,**\/XmlToHtmlConverter*,**\/generated-sources\/**\/* diff --git a/tools/checkstyle/pom.xml b/tools/checkstyle/pom.xml index 10fcda94ec2..a763994abf9 100644 --- a/tools/checkstyle/pom.xml +++ b/tools/checkstyle/pom.xml @@ -31,7 +31,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 2.13 + 3.0.0 none diff --git a/tools/checkstyle/src/main/resources/cloud-style.xml b/tools/checkstyle/src/main/resources/cloud-style.xml index 47ea1fb706e..6aaef17b926 100644 --- a/tools/checkstyle/src/main/resources/cloud-style.xml +++ b/tools/checkstyle/src/main/resources/cloud-style.xml @@ -21,7 +21,6 @@ - @@ -36,12 +35,13 @@ - + +