Diff
stringlengths
10
2k
Message
stringlengths
28
159
RangesFilter(SortedKeyValueIterator<Key,Value> iterator, List<Range> ranges) { setSource(iterator);
Remove the literal "true" boolean value.
import org.apache.accumulo.core.iterators.user.RegExFilter; IteratorSetting more = new IteratorSetting(20 + i, "ii" + i, RegExFilter.class); RegExFilter.setRegexs(more, null, null, null, "(^|(.*\\s))" + words[i] + "($|(\\s.*))", false);
Define a constant instead of duplicating this literal "org.apache.accumulo.core.iterators.WholeRowIterator" 4 times.
if (defered.get(tid) < System.currentTimeMillis()) defered.remove(tid); else continue; if (!reserved.contains(tid)) reserved.add(tid); else continue; if (waitTime > 0) this.wait(Math.min(waitTime, 5000)); } else this.wait(5000); if (!reserved.remove(tid)) throw new IllegalStateException("Tried to unreserve id that was not reserved " + String.format("%016x", tid)); if (reservationsWaiting > 0) this.notifyAll(); if (deferTime < 0) throw new IllegalArgumentException("deferTime < 0 : " + deferTime); if (!reserved.remove(tid)) throw new IllegalStateException("Tried to unreserve id that was not reserved " + String.format("%016x", tid)); if (deferTime > 0) defered.put(tid, System.currentTimeMillis() + deferTime); if (!reserved.contains(tid)) throw new IllegalStateException("Tried to operate on unreserved transaction " + String.format("%016x", tid)); if (top == null) return null; if (child.startsWith("repo_") && child.compareTo(max) > 0) max = child; if (max.equals("")) return null; if (top == null) throw new IllegalStateException("Tried to pop when empty " + tid); if (expected.contains(status)) return status;
Remove this call to "exit" or ensure it is really required.
* Autogenerated by Thrift Compiler (0.8.0) * @generated
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
package org.apache.accumulo.core.client.mapreduce.lib.util;
Either log or rethrow this exception.
state.set("bulkImportSuccess", "true");
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
import org.apache.accumulo.fate.zookeeper.ZooReader;
Remove this call to "exit" or ensure it is really required.
import org.apache.accumulo.core.client.security.tokens.PasswordToken; prop.put("org.apache.accumulo.proxy.ProxyServer.tokenClass", PasswordToken.class.getName());
Remove the redundant '!unknownSymbol!' thrown exception declaration(s).
* @see org.apache.accumulo.core.iterators.user.SummingCombiner with SummingCombiner.Type.VARLEN
1 duplicated blocks of code must be removed.
org.apache.accumulo.core.data.thrift.TKeyExtent _elem64; // required org.apache.accumulo.core.data.thrift.TKeyExtent _elem69; // required
Remove this unused method parameter "table".
import java.util.Arrays; import org.apache.accumulo.core.util.StringUtil; String[] paths = { "$ACCUMULO_HOME/lib/.*.jar", "$ZOOKEEPER_HOME/zookeeper[^.].*.jar", "$HADOOP_PREFIX/[^.].*.jar", "$HADOOP_PREFIX/lib/[^.].*.jar", "$HADOOP_PREFIX/share/hadoop/common/.*.jar", "$HADOOP_PREFIX/share/hadoop/common/lib/.*.jar", "$HADOOP_PREFIX/share/hadoop/hdfs/.*.jar", "$HADOOP_PREFIX/share/hadoop/mapreduce/.*.jar" }; String classpath = StringUtil.join(Arrays.asList(paths), ","); mergePropWithRandomPort(Property.MONITOR_PORT.getKey());
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
* Autogenerated by Thrift Compiler (0.8.0) * @generated
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
/* * 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. */
Replace all tab characters in this file by sequences of white-spaces.
import static org.junit.Assert.*; final SortedMap<Long,byte[]> locks = new TreeMap<Long,byte[]>(); assertEquals(counter, data[i]); final Lock readLock = locker.readLock(); final Lock writeLock = locker.writeLock(); final Lock wl = locker.writeLock(); final Lock rl = locker.readLock();
Remove this unused private "appendProp" method.
import java.util.Properties; import org.apache.accumulo.core.security.handler.Authenticator; @Deprecated @Deprecated @Deprecated @Override public Connector getConnector(String principal, Properties props) throws AccumuloException, AccumuloSecurityException { throw new UnsupportedOperationException(); } @Override public Authenticator getAuthenticator() throws AccumuloException, AccumuloSecurityException { throw new UnsupportedOperationException(); }
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
i = shellState.getConnector().tableOperations().addConstraint(tableName, constraint); shellState.getConnector().tableOperations().removeConstraint(tableName, i); for (Entry<String,Integer> property : shellState.getConnector().tableOperations().listConstraints(tableName).entrySet()) shellState.getReader().printString(property.toString() + "\n");
Either log or rethrow this exception.
* Autogenerated by Thrift Compiler (0.9.0) import org.apache.thrift.protocol.TProtocolException; import org.apache.thrift.EncodingUtils; import org.apache.thrift.TException; public static class span<I extends Iface> extends org.apache.thrift.ProcessFunction<I, span_args> { public span_args getEmptyArgsInstance() { protected boolean isOneway() { return true; } public org.apache.thrift.TBase getResult(I iface, span_args args) throws org.apache.thrift.TException { @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { // check for sub-struct validity if (span != null) { span.validate(); }
Rename this class name to match the regular expression '^[A-Z][a-zA-Z0-9]*$'.
package org.apache.accumulo.server.test.randomwalk.multitable; import java.util.Properties; import org.apache.accumulo.server.test.randomwalk.State; import org.apache.accumulo.server.test.randomwalk.Test; public class Commit extends Test { @Override public void visit(State state, Properties props) throws Exception { state.getMultiTableBatchWriter().flush(); Integer numWrites = state.getInteger("numWrites"); Integer totalWrites = state.getInteger("totalWrites") + numWrites; log.debug("Committed "+numWrites+" writes. Total writes: "+totalWrites); state.set("totalWrites", totalWrites); state.set("numWrites", new Integer(0)); } }
Return empty string instead.
import org.apache.accumulo.core.iterators.SortedKeyValueIterator; /** * A scanner that instantiates iterators on the client side instead of on the tablet server. This can be useful for testing iterators or in cases where you * don't want iterators affecting the performance of tablet servers. * Suggested usage: Scanner scanner = new ClientSideIteratorScanner(connector.createScanner(tableName, authorizations))
1 duplicated blocks of code must be removed.
package org.apache.accumulo.cloudtrace.instrument.thrift; import org.apache.accumulo.cloudtrace.instrument.Span; import org.apache.accumulo.cloudtrace.instrument.Trace; import org.apache.accumulo.cloudtrace.instrument.Tracer; import org.apache.accumulo.cloudtrace.thrift.TInfo;
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
if (!failure.getPath().getName().endsWith(".seq")) fs.rename(failure.getPath(), new Path(new Path(bulkDir), failure.getPath().getName())); else log.debug("Ignoring " + failure.getPath()); } else break;
Remove this call to "exit" or ensure it is really required.
import org.apache.accumulo.core.util.format.DefaultFormatter; import org.apache.accumulo.core.util.format.Formatter; import org.apache.accumulo.start.classloader.AccumuloClassLoader; private Option createTableOptFormatter; TableNotFoundException, IOException, ClassNotFoundException { // Load custom formatter if set if (cl.hasOption(createTableOptFormatter.getOpt())) { String formatterClass = cl.getOptionValue(createTableOptFormatter.getOpt()); shellState.setFormatterClass(tableName, AccumuloClassLoader.loadClass(formatterClass, Formatter.class)); shellState.getConnector().tableOperations().setProperty(tableName, Property.TABLE_FORMATTER_CLASS.toString(), formatterClass); } createTableOptFormatter = new Option("f", "formatter", false, "default formatter to set"); o.addOption(createTableOptFormatter);
Remove this unused "tableFormatters" private field.
import org.apache.accumulo.server.zookeeper.IZooReaderWriter; IZooReaderWriter zoo = ZooReaderWriter.getRetryingInstance(); IZooReaderWriter zk = ZooReaderWriter.getRetryingInstance(); IZooReaderWriter zk = ZooReaderWriter.getRetryingInstance(); ZooReservation.release(ZooReaderWriter.getRetryingInstance(), resvPath, String.format("%016x", tid));
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
package org.apache.accumulo.core.iterators.aggregation; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import org.apache.accumulo.core.data.Value; import org.apache.hadoop.io.WritableUtils; public class NumArraySummation implements Aggregator { long[] sum = new long[0]; public Value aggregate() { try { return new Value(NumArraySummation.longArrayToBytes(sum)); } catch (IOException e) { throw new RuntimeException(e); } } public void collect(Value value) { long[] la; try { la = NumArraySummation.bytesToLongArray(value.get()); } catch (IOException e) { throw new RuntimeException(e); } if (la.length > sum.length) { for (int i=0; i < sum.length; i++) { la[i] = NumSummation.safeAdd(la[i],sum[i]); } sum = la; } else { for (int i=0; i < la.length; i++) { sum[i] = NumSummation.safeAdd(sum[i],la[i]); } } } public static byte[] longArrayToBytes(long[] la) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); WritableUtils.writeVInt(dos, la.length); for (int i = 0; i < la.length; i++) { WritableUtils.writeVLong(dos, la[i]); } return baos.toByteArray(); } public static long[] bytesToLongArray(byte[] b) throws IOException { DataInputStream dis = new DataInputStream(new ByteArrayInputStream(b)); int len = WritableUtils.readVInt(dis); long[] la = new long[len]; for (int i = 0; i < len; i++) { la[i] = WritableUtils.readVLong(dis); } return la; } public void reset() { sum = new long[0]; } }
Return empty string instead.
if (getMasterState() == MasterState.HAVE_LOCK) { setMasterState(MasterState.SAFE_MODE); }
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
AccumuloFileOutputFormat.setBlockSize(job.getConfiguration(), 300); AccumuloFileOutputFormat.handleBlockSize(job.getConfiguration());
This block of commented-out lines of code should be removed.
import java.util.HashSet; import org.apache.accumulo.core.data.Range; int first = 0; else first = Integer.parseInt(k.getRow().toString(), 16) - 1; assertEquals(k.getRow(), new Text(String.format("%09x", first + count + 1))); assertEquals(new String(v.get()), String.format("%09x", first + count)); HashSet<Range> ranges = new HashSet<Range>(); ranges.add(new Range("000000000", "000000010")); ranges.add(new Range("000000100", "000000110")); AccumuloInputFormat.setRanges(job.getConfiguration(), ranges); assertEquals(splits.size(), 2); assertEquals(mapper.count, 16); List<InputSplit> splits = input.getSplits(job); assertEquals(splits.size(), 1); RangeInputSplit ris = (RangeInputSplit) splits.get(0); assertEquals(mapper.count, 100);
Return empty string instead.
import org.apache.accumulo.core.client.BatchWriterConfig; BatchWriter writer = getConnector().createBatchWriter(TEST_TABLE, new BatchWriterConfig()); writer = test_user_conn.createBatchWriter(TEST_TABLE, new BatchWriterConfig()); writer = test_user_conn.createBatchWriter(TEST_TABLE, new BatchWriterConfig());
Remove this unused method parameter "e".
private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(LogSpans.class); private static final DateFormat fmt = new SimpleDateFormat("HH:mm:ss.SSS"); static public class SpanLevel extends Level { private static final long serialVersionUID = 1L; protected SpanLevel() { super(Level.DEBUG_INT + 150, "SPAN", Level.DEBUG_INT + 150); static public Level toLevel(int val) { if (val == Level.DEBUG_INT + 150) return Level.DEBUG; return Level.toLevel(val); } public final static Level SPAN = new SpanLevel(); public static String format(long traceId, long spanId, long parentId, long start, long stop, String description, Map<String,String> data) { String parentStr = ""; if (parentId > 0) parentStr = " parent:" + parentId; String startStr = fmt.format(new Date(start)); return String.format("%20s:%x id:%d%s start:%s ms:%d", description, traceId, spanId, parentStr, startStr, stop - start); } @Override public void span(long traceId, long spanId, long parentId, long start, long stop, String description, Map<String,String> data) { log.log(SPAN, format(traceId, spanId, parentId, start, stop, description, data)); } @Override public void flush() {}
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
* 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. */ protected Encoder<V> encoder; private static class VIterator<V> implements Iterator<V> { private Iterator<Value> source; private Encoder<V> encoder; VIterator(Iterator<Value> iter, Encoder<V> encoder) { this.source = iter; this.encoder = encoder; } @Override public boolean hasNext() { return source.hasNext(); } @Override public V next() { if (!source.hasNext()) throw new NoSuchElementException(); return encoder.decode(source.next().get()); } @Override public void remove() { source.remove(); } } public static interface Encoder<V> { public byte[] encode(V v); public V decode(byte[] b); } @Override public Value reduce(Key key, Iterator<Value> iter) { return new Value(encoder.encode(typedReduce(key, new VIterator<V>(iter, encoder)))); } public abstract V typedReduce(Key key, Iterator<V> iter);
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
/* * 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. */
Replace all tab characters in this file by sequences of white-spaces.
* <li>{@link AccumuloOutputFormat#setConnectorInfo(Job, String, AuthenticationToken)} * @deprecated since 1.5.0; Use {@link #setConnectorInfo(Job, String, AuthenticationToken)}, {@link #setCreateTables(Job, boolean)}, and * {@link #setDefaultTableName(Job, String)} instead.
3 duplicated blocks of code must be removed.
import org.apache.accumulo.core.conf.Property; import org.apache.accumulo.core.tabletserver.thrift.TabletClientService; import org.apache.thrift.transport.TTransport; TTransport transport = null; transport = ThriftUtil.createTransport(tserver, instance.getConfiguration().getPort(Property.TSERV_CLIENTPORT), instance.getConfiguration()); TabletClientService.Client client = ThriftUtil.createClient(new TabletClientService.Client.Factory(), transport); if (transport != null) { transport.close();
Remove the literal "true" boolean value.
/* * 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. */ /** * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.accumulo.core.tabletserver.thrift; import java.util.Map; import java.util.HashMap; import org.apache.thrift.TEnum; @SuppressWarnings("all") public enum CompactionType implements org.apache.thrift.TEnum { MINOR(0), MERGE(1), MAJOR(2), FULL(3); private final int value; private CompactionType(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ public static CompactionType findByValue(int value) { switch (value) { case 0: return MINOR; case 1: return MERGE; case 2: return MAJOR; case 3: return FULL; default: return null; } } }
Return empty string instead.
final boolean valid = shellState.getConnector().securityOperations().authenticateUser(user, password);
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
/** * 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. */ package org.apache.accumulo.core.client; import java.util.ArrayList; import java.util.Collections; import java.util.Set; /** * */ public class TimedOutException extends RuntimeException { private Set<String> timedoutServers; private static final long serialVersionUID = 1L; private static String shorten(Set<String> set) { if (set.size() < 10) { return set.toString(); } return new ArrayList<String>(set).subList(0, 10).toString() + " ... " + (set.size() - 10) + " servers not shown"; } public TimedOutException(Set<String> timedoutServers) { super("Servers timed out " + shorten(timedoutServers)); this.timedoutServers = timedoutServers; } public Set<String> getTimedOutSevers() { return Collections.unmodifiableSet(timedoutServers); } }
Remove this unused method parameter "e".
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
1 duplicated blocks of code must be removed.
private Option outputFileOpt, maxSplitsOpt, base64Opt, verboseOpt; String tableName = OptUtil.configureTableOpt(cl, shellState); opts.addOption(OptUtil.tableOpt("table to get splits for"));
Reduce this switch case number of lines from 8 to at most 5, for example by extracting code into methods.
import org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException; synchronized static ZooCache getZooCache(Instance instance) {
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
package org.apache.accumulo.examples.wikisearch.parser;
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
Connector connector = instance.getConnector(args[2], args[3].getBytes());
Remove this unused method parameter "ex".
import org.apache.accumulo.core.util.shell.Token;
2 duplicated blocks of code must be removed.
import org.apache.accumulo.core.security.tokens.SecurityToken; * <li>{@link AccumuloInputFormat#setConnectorInfo(Job, SecurityToken)} OR {@link AccumuloInputFormat#setConnectorInfo(Job, Path)}
Either log or rethrow this exception.
disablePaginationOpt = new Option("np", "no-pagination", false, "disable pagination of output"); noWrapOpt = new Option("nw", "no-wrap", false, "disable wrapping of output");
2 duplicated blocks of code must be removed.
/* * 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. */
Replace all tab characters in this file by sequences of white-spaces.
if (aHome == null) fail("ACCUMULO_HOME must be set"); if (!tmpDir.exists()) tmpDir.mkdirs(); if (log.isDebugEnabled()) log.debug("Test with Jar A"); if (log.isDebugEnabled()) log.debug("Test with Jar B"); if (log.isDebugEnabled()) log.debug("Test with Jar C"); if (log.isDebugEnabled()) log.debug("Deleting jar"); if (log.isDebugEnabled()) log.debug("Test with Jar C"); if (exists) { if (oldConf.exists()) { d = db.parse(siteBkp); d = db.parse(new File(SITE_CONF + ".example")); cvalue.setTextContent(randomFolder + "/.*"); cvalue.setTextContent(randomFolder + "/.*");
Remove this call to "exit" or ensure it is really required.
@Deprecated @Deprecated
Immediately return this expression instead of assigning it to the temporary variable "onlineTabletsForTable".
import org.apache.accumulo.trace.thrift.RemoteSpan;
Remove the redundant '!unknownSymbol!' thrown exception declaration(s).
import org.apache.accumulo.core.Constants; filenames = createMapFiles(args[0], args[1] + "/" + Constants.MAPFILE_EXTENSION + "_" + blocksize, blocksize, num);
Either log or rethrow this exception.
/* * 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. */
Replace all tab characters in this file by sequences of white-spaces.
import org.apache.accumulo.core.client.security.tokens.PasswordToken; Connector connector = inst.getConnector("user", new PasswordToken("pass"));
Rename "connector" which hides the field declared at line 67.
import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; import org.junit.Assert; public void testBadMutations() throws Exception { Connector c = new MockConnector("root", new MockInstance()); c.tableOperations().create("test"); BatchWriter bw = c.createBatchWriter("test", new BatchWriterConfig().setMaxMemory(10000L).setMaxLatency(1000L, TimeUnit.MILLISECONDS).setMaxWriteThreads(4)); try { bw.addMutation(null); Assert.fail("addMutation should throw IAE for null mutation"); } catch (IllegalArgumentException iae) {} try { bw.addMutations(null); Assert.fail("addMutations should throw IAE for null iterable"); } catch (IllegalArgumentException iae) {} bw.addMutations(Collections.<Mutation>emptyList()); Mutation bad = new Mutation("bad"); try { bw.addMutation(bad); Assert.fail("addMutation should throw IAE for empty mutation"); } catch (IllegalArgumentException iae) {} Mutation good = new Mutation("good"); good.put(asText(random.nextInt()), asText(random.nextInt()), new Value("good".getBytes())); List<Mutation> mutations = new ArrayList<Mutation>(); mutations.add(good); mutations.add(bad); try { bw.addMutations(mutations); Assert.fail("addMutations should throw IAE if it contains empty mutation"); } catch (IllegalArgumentException iae) {} bw.close(); } @Test
Remove the declaration of thrown exception 'java.lang.NumberFormatException' which is a runtime exception.
import org.apache.accumulo.server.zookeeper.IZooReaderWriter; IZooReaderWriter zoo = ZooReaderWriter.getInstance(); static void upgradeSecurity(IZooReaderWriter zoo) throws Exception { static void upgradeZooKeeper(IZooReaderWriter zoo) throws IOException, KeeperException, InterruptedException { private static SortedSet<String> getOldTableNames(IZooReaderWriter zoo) throws IOException, KeeperException, InterruptedException { private static void move(IZooReaderWriter zoo, String source, String destination) throws KeeperException, InterruptedException { private static void validateConfig(String tableId, IZooReaderWriter zoo) throws KeeperException, InterruptedException {
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
final int start; final int end; public Node(NodeType type, int start) { this.start = start; this.end = start + 1; result = new Node(NodeType.AND, index - 1); result = new Node(NodeType.OR, index - 1);
Return empty string instead.
package org.apache.accumulo.core.util.shell.commands; public class QuestionCommand extends HelpCommand { @Override public String getName() { return "?"; } }
Return empty string instead.
@Deprecated
Return empty string instead.
if (!rowIterator.hasNext()) return false;
Remove this call to "exit" or ensure it is really required.
package org.apache.accumulo.cloudtrace.instrument.impl; import org.apache.accumulo.cloudtrace.instrument.Span; import org.apache.accumulo.cloudtrace.instrument.Tracer;
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
import org.apache.accumulo.core.security.tokens.AuthenticationToken; public AuthenticationToken login(Properties properties) throws AccumuloSecurityException { return new PasswordToken(properties.getProperty("password"));
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
/** * @deprecated since 1.4 */
1 duplicated blocks of code must be removed.
import org.apache.accumulo.server.security.SecurityOperation; import org.apache.accumulo.server.security.SecurityOperationImpl; private static SecurityOperation security = SecurityOperationImpl.getInstance(); return security.authenticateUser(credentials, user, password); security.changeAuthorizations(credentials, user, new Authorizations(authorizations)); security.changePassword(credentials, user, ByteBufferUtil.toBytes(password)); security.createUser(credentials, user, ByteBufferUtil.toBytes(password), new Authorizations(authorizations)); security.dropUser(credentials, user); return security.getUserAuthorizations(credentials, user).getAuthorizationsBB(); security.grantSystemPermission(credentials, user, SystemPermission.getPermissionById(permission)); security.grantTablePermission(credentials, user, tableId, TablePermission.getPermissionById(permission)); security.revokeSystemPermission(credentials, user, SystemPermission.getPermissionById(permission)); security.revokeTablePermission(credentials, user, tableId, TablePermission.getPermissionById(permission)); return security.hasSystemPermission(credentials, user, SystemPermission.getPermissionById(sysPerm)); return security.hasTablePermission(credentials, user, tableId, TablePermission.getPermissionById(tblPerm)); return security.listUsers(credentials); if (!security.hasSystemPermission(credentials, credentials.getUser(), SystemPermission.SYSTEM))
Remove this unused method parameter "ex".
private static final String PREFIX = AccumuloOutputFormatTest.class.getSimpleName(); private static final String INSTANCE_NAME = PREFIX + "_mapreduce_instance"; private static final String TEST_TABLE_1 = PREFIX + "_mapreduce_table_1"; private static final String TEST_TABLE_2 = PREFIX + "_mapreduce_table_2"; AccumuloInputFormat.setMockInstance(job, INSTANCE_NAME); AccumuloOutputFormat.setMockInstance(job, INSTANCE_NAME); MockInstance mockInstance = new MockInstance(INSTANCE_NAME); c.tableOperations().create(TEST_TABLE_1); c.tableOperations().create(TEST_TABLE_2); BatchWriter bw = c.createBatchWriter(TEST_TABLE_1, new BatchWriterConfig()); MRTester.main(new String[] {"root", "", TEST_TABLE_1, TEST_TABLE_2}); Scanner scanner = c.createScanner(TEST_TABLE_2, new Authorizations());
Either log or rethrow this exception.
import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode; return getInstance().getConnector(getCredentials()); if (this.principal == null || this.getToken() == null) throw new AccumuloSecurityException("You must provide a user (-u) and password (-p)", SecurityErrorCode.BAD_CREDENTIALS);
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
import org.apache.accumulo.core.security.CredentialHelper; import org.apache.accumulo.core.security.thrift.Credential; Credential auths = SecurityConstants.getSystemCredentials(); conn = HdfsZooInstance.getInstance().getConnector(auths.getPrincipal(), CredentialHelper.extractToken(auths)); Credential creds = SecurityConstants.getSystemCredentials(); Credential creds = SecurityConstants.getSystemCredentials();
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
ranges.add(new Range(String.format("%016x", (rand.nextLong() & 0x7fffffffffffffffl))));
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
@Override public IteratorOptions describeOptions() { IteratorOptions io = super.describeOptions(); io.setName("min"); io.setDescription("MinCombiner interprets Values as Longs and finds their minimum. A variety of encodings (variable length, fixed length, or string) are available"); return io; }
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
import org.apache.accumulo.core.security.thrift.SecurityErrorCode; import org.apache.accumulo.core.security.tokens.AuthenticationToken;
1 duplicated blocks of code must be removed.
if (!shellState.getConnector().tableOperations().exists(tableName)) throw new TableNotFoundException(null, tableName, null);
Remove this call to "exit" or ensure it is really required.
package org.apache.accumulo.start; public class Platform { public static void main(String[] args) { System.out.println(getPlatform()); } public static String getPlatform() { return (System.getProperty("os.name") + "-" + System.getProperty("os.arch") + "-" + System.getProperty("sun.arch.data.model")).replace(' ', '_'); } }
Return empty string instead.
import org.apache.accumulo.server.security.SystemCredentials; MetaDataTableScanner rootScanner = new MetaDataTableScanner(instance, SystemCredentials.get().getAsThrift(), MetadataSchema.TabletsSection.getRange()); MetaDataTableScanner metaScanner = new MetaDataTableScanner(instance, SystemCredentials.get().getAsThrift(), MetadataSchema.TabletsSection.getRange());
Move this constructor to comply with Java Code Conventions.
/* * 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. */ package org.apache.accumulo.start.classloader.vfs; import org.apache.commons.vfs2.impl.DefaultFileSystemManager; public class FinalCloseDefaultFileSystemManager extends DefaultFileSystemManager { public void finalize() { close(); } }
Do not override the Object.finalize() method.
import java.lang.reflect.Method; if (!isInSafeMode(fs)) private static boolean isInSafeMode(FileSystem fs) throws IOException { if (!(fs instanceof DistributedFileSystem)) return false; DistributedFileSystem dfs = (DistributedFileSystem) FileSystem.get(CachedConfiguration.getInstance()); // So this: if (!dfs.setSafeMode(SafeModeAction.SAFEMODE_GET)) // Becomes this: Class<?> constantClass; try { // hadoop 2.0 constantClass = Class.forName("org.apache.hadoop.hdfs.protocol.HdfsConstants"); } catch (ClassNotFoundException ex) { // hadoop 1.0 try { constantClass = Class.forName("org.apache.hadoop.hdfs.protocol.FSConstants"); } catch (ClassNotFoundException e) { throw new RuntimeException("Cannot figure out the right class for Constants"); } } Class<?> safeModeAction = null; for (Class<?> klass : constantClass.getDeclaredClasses()) { if (klass.getSimpleName().equals("SafeModeAction")) { safeModeAction = klass; break; } } if (safeModeAction == null) { throw new RuntimeException("Cannot find SafeModeAction in constants class"); } Object get = null; for (Object obj : safeModeAction.getEnumConstants()) { if (obj.toString().equals("SAFEMODE_GET")) get = obj; } if (get == null) { throw new RuntimeException("cannot find SAFEMODE_GET"); } try { Method setSafeMode = dfs.getClass().getMethod("setSafeMode", safeModeAction); return (Boolean)setSafeMode.invoke(dfs, get); } catch (Exception ex) { throw new RuntimeException("cannot find method setSafeMode"); } }
Either log or rethrow this exception.
@Override public String description() { return "starts the process of putting a table online"; } protected void doTableOp(Shell shellState, String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { if (tableName.equals(Constants.METADATA_TABLE_NAME)) { Shell.log.info(" The " + Constants.METADATA_TABLE_NAME + " is always online."); } else { Shell.log.info("Attempting to begin bringing " + tableName + " online"); shellState.getConnector().tableOperations().online(tableName); }
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
import org.apache.accumulo.core.cli.ClientOnRequiredTable; import com.beust.jcommander.Parameter; static class Opts extends ClientOnRequiredTable { @Parameter(names="--start-row") int startRow = 0; @Parameter(names="--count", required=true, description="number of rows to verify") int numRows = 0; } Opts opts = new Opts(); opts.parseArgs(VerifyIngest.class.getName(), args); Connector connector = opts.getConnector(); Scanner scanner = connector.createScanner(opts.tableName, opts.auths); scanner.setRange(new Range(new Text(String.format("row_%08d", opts.startRow)), null)); for (int i = opts.startRow; i < opts.numRows; i++) {
Remove this unused private "appendProp" method.
Map<String,Set<SecurityErrorCode>> errorMap = new HashMap<String,Set<SecurityErrorCode>>(); for (KeyExtent ke : hashMap.keySet()) { if (!errorMap.containsKey(tableInfo)) { @Deprecated
Immediately return this expression instead of assigning it to the temporary variable "onlineTabletsForTable".
package org.apache.accumulo.server.master.balancer; import java.util.Collections; import java.util.Set; import org.apache.accumulo.core.master.thrift.TabletServerStatus; import org.apache.accumulo.server.master.state.TServerInstance; public class TServerUsesLoggers implements LoggerUser { private TabletServerStatus status; private TServerInstance instance; public TServerUsesLoggers(TServerInstance instance, TabletServerStatus status) { this.instance = instance; this.status = status; } @Override public Set<String> getLoggers() { return Collections.unmodifiableSet(status.loggers); } @Override public int compareTo(LoggerUser o) { if (o instanceof TServerUsesLoggers) return instance.compareTo( ((TServerUsesLoggers)o).instance); return -1; } @Override public int hashCode() { return instance.hashCode(); } public TServerInstance getInstance() { return instance; } }
Return empty string instead.
/* * 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. */ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
fs.copyFromLocalFile(new Path(System.getProperty("user.dir") + "/system/auto/TestCombinerX.jar"), jarPath); fs.copyFromLocalFile(new Path(System.getProperty("user.dir") + "/system/auto/TestCombinerY.jar"), jarPath);
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
/* * 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. */
Replace all tab characters in this file by sequences of white-spaces.
try { Boolean.parseBoolean(options.get(NEGATE)); } catch (Exception e) { throw new IllegalArgumentException("bad boolean " + NEGATE + ":" + options.get(NEGATE)); }
Return empty string instead.
import org.apache.accumulo.server.cli.ClientOpts; ClientOpts opts = new ClientOpts(); opts.parseArgs(FindOfflineTablets.class.getName(), args); Instance instance = opts.getInstance(); MetaDataTableScanner scanner = new MetaDataTableScanner(instance, opts.getAuthInfo(), new Range()); LiveTServerSet tservers = new LiveTServerSet(instance, DefaultConfiguration.getDefaultConfiguration(), new Listener() {
Remove this unused private "appendProp" method.
import org.apache.accumulo.server.cli.ClientOpts; @Parameter(description = "<logfile> { <logfile> ...}") AccumuloOutputFormat.setZooKeeperInstance(job, opts.instance, opts.zookeepers); AccumuloOutputFormat.setConnectorInfo(job, opts.getAccumuloToken()); AccumuloOutputFormat.setCreateTables(job, false);
Return empty string instead.
final TabletGroupWatcher dependentWatcher; TabletGroupWatcher(TabletStateStore store, TabletGroupWatcher dependentWatcher) { this.dependentWatcher = dependentWatcher; // if we are shutting down all the tabletservers, we have to do it in order if (goal == TabletGoalState.UNASSIGNED && state == TabletState.HOSTED) { if (serversToShutdown.equals(currentTServers.keySet())) { if (dependentWatcher != null && dependentWatcher.assignedOrHosted() > 0) { goal = TabletGoalState.HOSTED; } } } private int assignedOrHosted() { int result = 0; for (TableCounts counts : stats.getLast().values()) { result += counts.assigned() + counts.hosted(); } return result; } watchers.add(new TabletGroupWatcher(stores[2], null)); watchers.add(new TabletGroupWatcher(stores[1], watchers.get(0))); watchers.add(new TabletGroupWatcher(stores[0], watchers.get(1)));
Either log or rethrow this exception.
import org.apache.accumulo.trace.instrument.Tracer;
Remove the redundant '!unknownSymbol!' thrown exception declaration(s).
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken.AuthenticationTokenSerializer; this.conn = getInstance(context).getConnector(getPrincipal(context), AuthenticationTokenSerializer.deserialize(getTokenClass(context), getToken(context))); Connector c = getInstance(job).getConnector(getPrincipal(job), AuthenticationTokenSerializer.deserialize(getTokenClass(job), getToken(job))); if (!c.securityOperations().authenticateUser(getPrincipal(job), AuthenticationTokenSerializer.deserialize(getTokenClass(job), getToken(job))))
Immediately return this expression instead of assigning it to the temporary variable "onlineTabletsForTable".
boolean transactionComplete(String type, long tid) throws Exception;
Replace all tab characters in this file by sequences of white-spaces.
private FSDataOutputStream logout; public static final byte MUTATION_EVENT = 1; public static final byte CLOSE_EVENT = 2; public MutationLog(Path logfile) throws IOException { Configuration conf = CachedConfiguration.getInstance(); FileSystem fs = TraceFileSystem.wrap(FileUtil.getFileSystem(conf, ServerConfiguration.getSiteConfiguration())); if (!fs.exists(logfile)) logout = fs.create(logfile); } public void log(Mutation m) throws IOException { // write event type logout.writeByte(MUTATION_EVENT); // write event m.write(logout); logout.flush(); } public void close() throws IOException { logout.writeByte(CLOSE_EVENT); logout.close(); } public static Iterator<Mutation> replay(Path logfile, Tablet t, long min_timestamp) throws IOException { Configuration conf = CachedConfiguration.getInstance(); FileSystem fs = TraceFileSystem.wrap(FileUtil.getFileSystem(conf, ServerConfiguration.getSiteConfiguration())); final FSDataInputStream login = fs.open(logfile); final Mutation mutation = new Mutation(); return new Iterator<Mutation>() { byte eventType; { eventType = login.readByte(); } public boolean hasNext() { return eventType != CLOSE_EVENT; } public Mutation next() { try { mutation.readFields(login); eventType = login.readByte(); } catch (IOException e) { throw new RuntimeException(e); } return mutation; } public void remove() { throw new UnsupportedOperationException(); } }; }
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, protected void setTableProperties(final CommandLine cl, final Shell shellState, final String tableName, final int priority, final Map<String,String> options, final String classname, final String name) if (!shellState.getConnector().instanceOperations().testClassLoad(classname, SortedKeyValueIterator.class.getName())) { } final IteratorSetting setting = new IteratorSetting(priority, name, classname); final String user = shellState.getConnector().whoami(); final Authorizations auths = shellState.getConnector().securityOperations().getUserAuthorizations(user); final Scanner scanner = shellState.getConnector().createScanner(tableName, auths); final HashSet<OptionGroup> groups = new HashSet<OptionGroup>(); final Options parentOptions = super.getOptions(); final Options modifiedOptions = new Options();
Remove the redundant '!unknownSymbol!' thrown exception declaration(s).
package org.apache.accumulo.server.tabletserver.metrics; public interface TabletServerMinCMetricsMBean { public static final String minc = "minc"; public static final String queue = "queue"; public long getMinorCompactionCount(); public long getMinorCompactionAvgTime(); public long getMinorCompactionMinTime(); public long getMinorCompactionMaxTime(); public long getMinorCompactionQueueCount(); public long getMinorCompactionQueueAvgTime(); public long getMinorCompactionQueueMinTime(); public long getMinorCompactionQueueMaxTime(); public void reset(); }
Return empty string instead.
try { systemTime = System.currentTimeMillis(); Thread.sleep(time); } catch (InterruptedException ie) { return; runningLong.set(true);
Do not forget to remove this deprecated code someday.
import org.apache.accumulo.core.security.tokens.AccumuloToken; public FileDataQuery(String instanceName, String zooKeepers, AccumuloToken<?,?> token, String tableName, Authorizations auths) throws AccumuloException, conn = instance.getConnector(token);
Return empty string instead.
FileSystem hadoopFs = FileUtil.getFileSystem(conf, AccumuloConfiguration.getSiteConfiguration()); FileSystem localFs = FileSystem.getLocal(conf); FileSystem fs = hadoopFs.exists(path) ? hadoopFs : localFs; // fall back to local
Return empty string instead.
@Override public String toString() { return getClass().getName(); }
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
public long currentTime();
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
import org.apache.accumulo.core.security.tokens.SecurityToken; public void initializeSecurity(InstanceTokenWrapper credentials, SecurityToken rootToken) throws AccumuloSecurityException, ThriftSecurityException { public boolean authenticateUser(InstanceTokenWrapper credentials, SecurityToken token) throws ThriftSecurityException { public void changePassword(InstanceTokenWrapper credentials, SecurityToken token) throws ThriftSecurityException { public void createUser(InstanceTokenWrapper credentials, SecurityToken token, Authorizations authorizations) throws ThriftSecurityException {
Either log or rethrow this exception.
* Advances to the next K,V pair. Note that in minor compaction scope and in non-full major compaction scopes the iterator may see deletion entries. These * entries should be preserved by all iterators except ones that are strictly scan-time iterators that will never be configured for the minc or majc scopes. * Deletion entries are only removed during full major compactions. * Returns top key. Can be called 0 or more times without affecting behavior of next() or hasTop(). Note that in minor compaction scope and in non-full major * compaction scopes the iterator may see deletion entries. These entries should be preserved by all iterators except ones that are strictly scan-time * iterators that will never be configured for the minc or majc scopes. Deletion entries are only removed during full major compactions.
1 duplicated blocks of code must be removed.
if (value != null) log.error("Using parent value for " + key + " due to improperly formatted " + property.getType() + ": " + value); if (v != null) value = new String(v); if (child != null && value != null) entries.put(child, value);
Remove this call to "exit" or ensure it is really required.
/** * 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. */ package org.apache.accumulo.core.client.lexicoder; import org.apache.accumulo.core.util.TextUtil; import org.apache.hadoop.io.Text; public class TextLexicoder implements Lexicoder<Text> { @Override public byte[] encode(Text data) { return TextUtil.getBytes(data); } @Override public Text decode(byte[] data) { return new Text(data); } }
Rename this generic name to match the regular expression '^[A-Z]$'.
import org.apache.accumulo.core.util.shell.commands.ExtensionCommand; import org.apache.accumulo.core.util.shell.commands.ScriptCommand; Command[] execCommands = {new ExecfileCommand(), new HistoryCommand(), new ExtensionCommand(), new ScriptCommand()}; public boolean isTabCompletion() { return tabCompletion; }
Complete the task associated to this TODO comment.
* 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. */ final String[] parts = address.split(":", 2); if (parts.length == 2) { if (parts[1].isEmpty()) return new InetSocketAddress(parts[0], defaultPort); return new InetSocketAddress(parts[0], Integer.parseInt(parts[1])); } return new InetSocketAddress(address, defaultPort); } return parseAddress(address.toString(), defaultPort); } InetSocketAddress addr = parseAddress(address, defaultPort); return new TSocket(addr.getHostName(), addr.getPort()); } return addr.getAddress().getHostAddress() + ":" + addr.getPort(); }
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.