From b4c14ab27bf46de4609ca57772a5f133aa061096 Mon Sep 17 00:00:00 2001 From: Suresh Srinivas Date: Thu, 5 Aug 2021 15:49:59 -0700 Subject: [PATCH] Checkstyle; Include test files for checkstyle, removed AvoidWildcard, StaticVariableName, MemberVariableNameCheck --- .../catalog/jdbi3/TableRepository.java | 1 - .../catalog/resources/CatalogResource.java | 1 - .../resources/config/ConfigResource.java | 1 - .../resources/databases/TableResource.java | 5 ++-- .../catalog/resources/teams/TeamResource.java | 4 +-- .../catalog/resources/teams/UserResource.java | 2 +- .../security/AuthenticationConfiguration.java | 4 ++- checkstyle/checkstyle.xml | 15 +++++------ .../openmetadata/common/utils/CipherText.java | 25 +++++++++---------- .../openmetadata/common/utils/CommonUtil.java | 25 +++++++++---------- .../common/utils/JsonSchemaUtil.java | 25 +++++++++---------- pom.xml | 1 + 12 files changed, 54 insertions(+), 55 deletions(-) diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/jdbi3/TableRepository.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/jdbi3/TableRepository.java index 7f4034602f1..a0d743e26db 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/jdbi3/TableRepository.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/jdbi3/TableRepository.java @@ -35,7 +35,6 @@ import org.openmetadata.catalog.resources.databases.TableResource; import org.openmetadata.catalog.type.Column; import org.openmetadata.catalog.type.DailyCount; import org.openmetadata.catalog.type.EntityReference; -import org.openmetadata.catalog.type.TableJoins; import org.openmetadata.catalog.type.TagLabel; import org.openmetadata.catalog.util.EntityUtil; import org.openmetadata.catalog.util.EntityUtil.Fields; diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/CatalogResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/CatalogResource.java index d135d25d88c..bc045a56f72 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/CatalogResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/CatalogResource.java @@ -17,7 +17,6 @@ package org.openmetadata.catalog.resources; import com.fasterxml.jackson.core.JsonProcessingException; -import org.openmetadata.catalog.resources.databases.TableResource.TableList; import org.openmetadata.catalog.type.CollectionDescriptor; import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.Operation; diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/config/ConfigResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/config/ConfigResource.java index 6416ce02b3c..5bdf3087375 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/config/ConfigResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/config/ConfigResource.java @@ -24,7 +24,6 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import org.openmetadata.catalog.CatalogApplicationConfig; import org.openmetadata.catalog.resources.Collection; import org.openmetadata.catalog.security.AuthenticationConfiguration; -import org.openmetadata.catalog.type.CollectionDescriptor; import javax.ws.rs.GET; import javax.ws.rs.Path; diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/databases/TableResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/databases/TableResource.java index c4fa9e8a3a9..e47647f8f3d 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/databases/TableResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/databases/TableResource.java @@ -147,7 +147,8 @@ public class TableResource { @QueryParam("before") String before, @Parameter(description = "Returns list of tables after this curor", schema = @Schema(type = "string")) - @QueryParam("after") String after) throws IOException, ParseException, GeneralSecurityException { + @QueryParam("after") String after) + throws IOException, ParseException, GeneralSecurityException { RestUtil.validateCursors(before, after); Fields fields = new Fields(FIELD_LIST, fieldsParam); @@ -350,7 +351,7 @@ public class TableResource { @PUT @Path("/{id}/sampleData") @Operation(summary = "Add sample data", tags = "tables", - description = "Add sample data to the table." ) + description = "Add sample data to the table.") public Table addSampleData(@Context UriInfo uriInfo, @Context SecurityContext securityContext, @Parameter(description = "Id of the table", schema = @Schema(type = "string")) diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/teams/TeamResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/teams/TeamResource.java index a203c61aff1..76a7efb9e6b 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/teams/TeamResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/teams/TeamResource.java @@ -99,9 +99,9 @@ public class TeamResource { static class TeamList extends ResultList { @SuppressWarnings("unused") /* Required for tests */ - public TeamList() {} + TeamList() {} - public TeamList(List teams, int limitParam, String beforeCursor, String afterCursor) + TeamList(List teams, int limitParam, String beforeCursor, String afterCursor) throws GeneralSecurityException, UnsupportedEncodingException { super(teams, limitParam, beforeCursor, afterCursor); } diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/teams/UserResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/teams/UserResource.java index 934b2e5c2b3..e5e1417e2b9 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/teams/UserResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/teams/UserResource.java @@ -104,7 +104,7 @@ public class UserResource { @SuppressWarnings("unused") // Used for deserialization UserList() {} - public UserList(List users, int limitParam, String beforeCursor, String afterCursor) + UserList(List users, int limitParam, String beforeCursor, String afterCursor) throws GeneralSecurityException, UnsupportedEncodingException { super(users, limitParam, beforeCursor, afterCursor); } diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/security/AuthenticationConfiguration.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/security/AuthenticationConfiguration.java index e1717eb76db..c437beeb52b 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/security/AuthenticationConfiguration.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/security/AuthenticationConfiguration.java @@ -35,7 +35,9 @@ public class AuthenticationConfiguration { this.provider = provider; } - public String getPublicKey() { return publicKey; } + public String getPublicKey() { + return publicKey; + } public void setPublicKey(String publicKey) { this.publicKey = publicKey; diff --git a/checkstyle/checkstyle.xml b/checkstyle/checkstyle.xml index 6422b7e3d09..5fd275ba6ee 100644 --- a/checkstyle/checkstyle.xml +++ b/checkstyle/checkstyle.xml @@ -15,10 +15,9 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" + "https://checkstyle.org/dtds/configuration_1_3.dtd"> + + + + - @@ -129,7 +131,6 @@ - diff --git a/common/src/main/java/org/openmetadata/common/utils/CipherText.java b/common/src/main/java/org/openmetadata/common/utils/CipherText.java index 9c7034a25e1..fee2694fe4c 100644 --- a/common/src/main/java/org/openmetadata/common/utils/CipherText.java +++ b/common/src/main/java/org/openmetadata/common/utils/CipherText.java @@ -1,18 +1,17 @@ /* - * 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 + * 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. + * 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. */ package org.openmetadata.common.utils; diff --git a/common/src/main/java/org/openmetadata/common/utils/CommonUtil.java b/common/src/main/java/org/openmetadata/common/utils/CommonUtil.java index 5220835cb3d..e21ebb77507 100644 --- a/common/src/main/java/org/openmetadata/common/utils/CommonUtil.java +++ b/common/src/main/java/org/openmetadata/common/utils/CommonUtil.java @@ -1,18 +1,17 @@ /* - * 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 + * 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. + * 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. */ package org.openmetadata.common.utils; diff --git a/common/src/main/java/org/openmetadata/common/utils/JsonSchemaUtil.java b/common/src/main/java/org/openmetadata/common/utils/JsonSchemaUtil.java index 70270ad32ab..32abf5be51f 100644 --- a/common/src/main/java/org/openmetadata/common/utils/JsonSchemaUtil.java +++ b/common/src/main/java/org/openmetadata/common/utils/JsonSchemaUtil.java @@ -1,18 +1,17 @@ /* - * 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 + * 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. + * 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. */ package org.openmetadata.common.utils; diff --git a/pom.xml b/pom.xml index 8c926f3e37a..7bd118b1814 100644 --- a/pom.xml +++ b/pom.xml @@ -435,6 +435,7 @@ 3.1.2 ./checkstyle/checkstyle.xml + true