-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-23623 Reduced the number of Checkstyle violations in hbase-rest #1046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
4ef791e
53d9772
df8b99a
6d91e24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| /* | ||
| * | ||
| /** | ||
|
||
| * 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 | ||
|
|
@@ -18,6 +17,9 @@ | |
| */ | ||
| package org.apache.hadoop.hbase.rest; | ||
|
|
||
| import static org.junit.Assert.assertEquals; | ||
| import static org.junit.Assert.assertFalse; | ||
|
|
||
| import java.io.ByteArrayInputStream; | ||
| import java.io.IOException; | ||
|
|
||
|
|
@@ -36,8 +38,6 @@ | |
| import org.apache.hadoop.hbase.testclassification.MediumTests; | ||
| import org.apache.hadoop.hbase.util.Bytes; | ||
|
|
||
| import static org.junit.Assert.*; | ||
|
|
||
| import org.junit.AfterClass; | ||
| import org.junit.BeforeClass; | ||
| import org.junit.Test; | ||
|
|
@@ -79,8 +79,8 @@ private static NamespacesModel fromXML(byte[] content) throws JAXBException { | |
|
|
||
| private boolean doesNamespaceExist(Admin admin, String namespaceName) throws IOException { | ||
| NamespaceDescriptor[] nd = admin.listNamespaceDescriptors(); | ||
| for(int i = 0; i < nd.length; i++) { | ||
| if(nd[i].getName().equals(namespaceName)) { | ||
| for (NamespaceDescriptor namespaceDescriptor : nd) { | ||
| if (namespaceDescriptor.getName().equals(namespaceName)) { | ||
| return true; | ||
| } | ||
| } | ||
|
|
@@ -152,7 +152,7 @@ public void testNamespaceListXMLandJSON() throws IOException, JAXBException { | |
| } | ||
|
|
||
| @Test | ||
| public void testNamespaceListPBandDefault() throws IOException, JAXBException { | ||
| public void testNamespaceListPBandDefault() throws IOException { | ||
| String schemaPath = "/namespaces/"; | ||
| NamespacesModel model; | ||
| Response response; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| /* | ||
| /** | ||
|
||
| * 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 | ||
|
|
@@ -14,7 +14,8 @@ | |
| * 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.apache.hadoop.hbase.rest; | ||
| */ | ||
| package org.apache.hadoop.hbase.rest; | ||
|
|
||
| import static org.junit.Assert.assertEquals; | ||
| import static org.junit.Assert.assertNotNull; | ||
|
|
@@ -91,7 +92,8 @@ public class TestScannersWithLabels { | |
| private static Unmarshaller unmarshaller; | ||
| private static Configuration conf; | ||
|
|
||
| private static int insertData(TableName tableName, String column, double prob) throws IOException { | ||
| private static int insertData(TableName tableName, String column, double prob) | ||
| throws IOException { | ||
| byte[] k = new byte[3]; | ||
| byte[][] famAndQf = KeyValue.parseColumn(Bytes.toBytes(column)); | ||
|
|
||
|
|
@@ -177,6 +179,7 @@ public VisibilityLabelsResponse run() throws Exception { | |
| }; | ||
| SUPERUSER.runAs(action); | ||
| } | ||
|
|
||
| private static void setAuths() throws Exception { | ||
| String[] labels = { SECRET, CONFIDENTIAL, PRIVATE, PUBLIC, TOPSECRET }; | ||
| try (Connection conn = ConnectionFactory.createConnection(conf)) { | ||
|
|
@@ -185,6 +188,7 @@ private static void setAuths() throws Exception { | |
| throw new IOException(t); | ||
| } | ||
| } | ||
|
|
||
| @Test | ||
| public void testSimpleScannerXMLWithLabelsThatReceivesNoData() throws IOException, JAXBException { | ||
| final int BATCH_SIZE = 5; | ||
|
|
@@ -237,5 +241,4 @@ public void testSimpleScannerXMLWithLabelsThatReceivesData() throws IOException, | |
| .getBody())); | ||
| assertEquals(5, countCellSet(cellSet)); | ||
| } | ||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a file header and not a javadoc. shouldn't we be doing
/*instead of/**?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed