auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void centerOnNode(DataNode node) throws NodeNotFoundException { double x = -1; for (WrapperClone wrapperClone : graphData) { if (wrapperClone.getDataNodes().contains(node)) { x = wrapperClone.getX(); break; } } if (x != -1) { setZoomCenter(x); } else { throw new NodeNotFoundException(); } }

Target:
public void centerOnNode(DataNode node) throws NodeNotFoundException { float x = -1; for (WrapperClone wrapperClone : graphData) { if (wrapperClone.getDataNodes().contains(node)) { x = wrapperClone.getX(); break; } } if (x != -1) { setZoomCenter(x); } else { throw new NodeNotFoundException(); } }
Source:
public SourceRecord extractRecord() throws SQLException { Struct record = new Struct(schemaMapping.schema()); for (FieldSetter setter : schemaMapping.fieldSetters()) { try { setter.setField(record, resultSet); } catch (IOException e) { log.warn("Ignoring record because processing failed:", e); } catch (SQLException e) { log.warn("Ignoring record due to SQL error:", e); } } offset = criteria.extractValues(schemaMapping.schema(), record, offset); final String topic; final Map<String, String> partition; switch (mode) { case TABLE: if (useFqn) { String fqn = ExpressionBuilder.create().append(tableId, false).toString(); partition = new HashMap<>(); partition.put(JdbcSourceConnectorConstants.TABLE_NAME_KEY, fqn); partition.put(JdbcSourceConnectorConstants.OFFSET_PROTOCOL_VERSION, "1"); topic = topicPrefix + fqn; } else { String name = tableId.tableName(); partition = Collections.singletonMap(JdbcSourceConnectorConstants.TABLE_NAME_KEY, name); topic = topicPrefix + name; } break; case QUERY: partition = Collections.singletonMap(JdbcSourceConnectorConstants.QUERY_NAME_KEY, JdbcSourceConnectorConstants.QUERY_NAME_VALUE); topic = topicPrefix; break; default: throw new ConnectException("Unexpected query mode: " + mode); } return new SourceRecord(partition, offset.toMap(), topic, record.schema(), record); }

Target:
public SourceRecord extractRecord() throws SQLException { Struct record = new Struct(schemaMapping.schema()); for (FieldSetter setter : schemaMapping.fieldSetters()) { try { setter.setField(record, resultSet); } catch (IOException e) { log.warn("Ignoring record because processing failed:", e); } catch (SQLException e) { log.warn("Ignoring record due to SQL error:", e); } } offset = criteria.extractValues(schemaMapping.schema(), record, offset); return new SourceRecord(partition, offset.toMap(), topic, record.schema(), record); }
Source:
protected void decodeValue(Klv klv) { byte[] bytes = klv.getValue(); CharsetDetector charsetDetector = new CharsetDetector(); charsetDetector.setText(bytes); CharsetMatch charsetMatch = charsetDetector.detect(); Charset charset = Charset.defaultCharset(); if (charsetMatch != null) { try { charset = Charset.forName(charsetMatch.getName()); } catch (IllegalArgumentException e) { LOGGER.trace( "Unsupported encoding of %s, falling back to default encoding", charsetMatch.getName()); } } value = new String(bytes, charset); }

Target:
protected void decodeValue(Klv klv) { byte[] bytes = klv.getValue(); CharsetDetector charsetDetector = new CharsetDetector(); charsetDetector.setText(bytes); CharsetMatch charsetMatch = charsetDetector.detect(); Charset charset = Charset.defaultCharset(); if (charsetMatch != null) { try { charset = Charset.forName(charsetMatch.getName()); } catch (IllegalArgumentException e) { LOGGER.trace( "Unsupported encoding of {}, falling back to default encoding", charsetMatch.getName()); } } value = new String(bytes, charset); }
Source:
private AzureBlobStorageImpl constructImpl() { Objects.requireNonNull(blobName, "'blobName' cannot be null."); if (Objects.isNull(containerName) || containerName.isEmpty()) { containerName = BlobContainerAsyncClient.ROOT_CONTAINER_NAME; } checkValidEncryptionParameters(); HttpPipeline pipeline = super.getPipeline(); if (pipeline == null) { pipeline = buildPipeline(); } return new AzureBlobStorageBuilder() .url(String.format("%s/%s/%s", endpoint, containerName, blobName)) .pipeline(pipeline) .build(); }

Target:
private AzureBlobStorageImpl constructImpl() { Objects.requireNonNull(blobName, "'blobName' cannot be null."); if (ImplUtils.isNullOrEmpty(containerName)) { containerName = BlobContainerAsyncClient.ROOT_CONTAINER_NAME; } checkValidEncryptionParameters(); HttpPipeline pipeline = super.getPipeline(); if (pipeline == null) { pipeline = buildPipeline(); } return new AzureBlobStorageBuilder() .url(String.format("%s/%s/%s", endpoint, containerName, blobName)) .pipeline(pipeline) .build(); }
Source:
public void testLongFileNameThatDoesNotRequireEncoding() { String str = StringUtils.repeat("1", 256); assertEquals( "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111.71634944", fileManager.getFileName(TaskTestUtil.createMockTask(str), true)); }

Target:
public void testLongFileNameThatDoesNotRequireEncoding() { String str = StringUtils.repeat("1", 256); assertEquals(StringUtils.repeat("1", 242) + ".71634944", fileManager.getFileName(TaskTestUtil.createMockTask(str), false)); assertEquals(str, fileManager.getFileName(TaskTestUtil.createMockTask(str), true)); }
Source:
public boolean applyCSSProperty(Object element, String property, CSSValue value, String pseudo, CSSEngine engine) throws Exception { if (!(element instanceof ISelectionBackgroundCustomizationElement && element instanceof ElementAdapter) || !(((ElementAdapter) element).getNativeWidget() instanceof Widget) || property == null || value.getCssValueType() != CSSValue.CSS_PRIMITIVE_VALUE) { return false; } Widget widget = (Widget) ((ElementAdapter) element).getNativeWidget(); ISelectionBackgroundCustomizationElement treeElement = (ISelectionBackgroundCustomizationElement) element; Color newColor = (Color) engine.convert(value, Color.class, widget.getDisplay()); switch (property.toLowerCase()) { case SWT_SELECTION_FOREGROUND_COLOR: treeElement.setSelectionForegroundColor(newColor); break; case SWT_SELECTION_BACKGROUND_COLOR: treeElement.setSelectionBackgroundColor(newColor); break; case SWT_SELECTION_BORDER_COLOR: treeElement.setSelectionBorderColor(newColor); break; case SWT_HOT_BACKGROUND_COLOR: treeElement.setHotBackgroundColor(newColor); break; case SWT_HOT_BORDER_COLOR: treeElement.setHotBorderColor(newColor); break; } return true; }

Target:
public boolean applyCSSProperty(Object element, String property, CSSValue value, String pseudo, CSSEngine engine) throws Exception { if (!(element instanceof ISelectionBackgroundCustomizationElement && element instanceof ElementAdapter) || !(((ElementAdapter) element).getNativeWidget() instanceof Widget) || property == null || value.getCssValueType() != CSSValue.CSS_PRIMITIVE_VALUE) { return false; } Widget widget = (Widget) ((ElementAdapter) element).getNativeWidget(); ISelectionBackgroundCustomizationElement treeElement = (ISelectionBackgroundCustomizationElement) element; Color newColor = (Color) engine.convert(value, Color.class, widget.getDisplay()); switch (property) { case SWT_SELECTION_FOREGROUND_COLOR: treeElement.setSelectionForegroundColor(newColor); break; case SWT_SELECTION_BACKGROUND_COLOR: treeElement.setSelectionBackgroundColor(newColor); break; case SWT_SELECTION_BORDER_COLOR: treeElement.setSelectionBorderColor(newColor); break; case SWT_HOT_BACKGROUND_COLOR: treeElement.setHotBackgroundColor(newColor); break; case SWT_HOT_BORDER_COLOR: treeElement.setHotBorderColor(newColor); break; } return false; }
Source:
public Optional<Guid> getUserIdIfExternal() { return isInternalExecution() ? Optional.empty() : Optional.ofNullable(getUserId()); }

Target:
protected Optional<Guid> getUserIdIfExternal() { return isInternalExecution() ? Optional.empty() : Optional.ofNullable(getUserId()); }
Source:
protected DatabaseName unmarshal0( ReadableChannel channel ) throws IOException { byte nullMarker = channel.get(); if ( nullMarker == 0 ) { return null; } else { int nameLength = (int) channel.get(); byte[] nameBytes = new byte[nameLength]; channel.get( nameBytes, nameLength ); return new DatabaseName( UTF8.decode( nameBytes ) ); } }

Target:
protected DatabaseName unmarshal0( ReadableChannel channel ) throws IOException { return new DatabaseName( StringMarshal.unmarshal( channel ) ); }
Source:
protected <C, R> void doDispatch(CommandMessage<C> command, CommandCallback<? super C, R> callback) { MessageMonitor.MonitorCallback monitorCallback = messageMonitor.onMessageIngested(command); MessageHandler<? super CommandMessage<?>> handler = findCommandHandlerFor(command).orElseThrow(() -> { NoHandlerForCommandException exception = new NoHandlerForCommandException( format("No handler was subscribed to command [%s]", command.getCommandName())); monitorCallback.reportFailure(exception); return exception; }); try { Object result = doDispatch(command, handler); monitorCallback.reportSuccess(); callback.onSuccess(command, (R) result); } catch (Exception throwable) { monitorCallback.reportFailure(throwable); callback.onFailure(command, throwable); } }

Target:
protected <C, R> void doDispatch(CommandMessage<C> command, CommandCallback<? super C, R> callback) { MessageMonitor.MonitorCallback monitorCallback = messageMonitor.onMessageIngested(command); MessageHandler<? super CommandMessage<?>> handler = findCommandHandlerFor(command).orElseThrow(() -> { NoHandlerForCommandException exception = new NoHandlerForCommandException( format("No handler was subscribed to command [%s]", command.getCommandName())); monitorCallback.reportFailure(exception); return exception; }); handle(command, handler, new MonitorAwareCallback<>(callback, monitorCallback)); }
Source:
private void processNewResponses() throws InterruptedException, IOException { SocketServerResponse curr = (SocketServerResponse) channel.receiveResponse(id); while (curr != null) { curr.onDequeueFromResponseQueue(); SocketServerRequest request = (SocketServerRequest) curr.getRequest(); String connectionId = request.getConnectionId(); try { if (curr.getPayload() == null) { logger.trace("Socket server received no response and hence closing the connection"); selector.close(connectionId); } else { logger.trace("Socket server received response to send, registering for write: {}", curr); NetworkSend networkSend = new NetworkSend(connectionId, curr.getPayload(), curr.getMetrics(), time); selector.send(networkSend); } } catch (IllegalStateException e) { logger .error("Attempt to write to socket for which there is no open connection. Connection id {}", connectionId); } finally { curr = (SocketServerResponse) channel.receiveResponse(id); } } }

Target:
private void processNewResponses() throws InterruptedException, IOException { SocketServerResponse curr = (SocketServerResponse) channel.receiveResponse(id); while (curr != null) { curr.onDequeueFromResponseQueue(); SocketServerRequest request = (SocketServerRequest) curr.getRequest(); String connectionId = request.getConnectionId(); try { if (curr.getPayload() == null) { logger.trace("Socket server received no response and hence closing the connection"); selector.close(connectionId); } else { logger.trace("Socket server received response to send, registering for write: {}", curr); NetworkSend networkSend = new NetworkSend(connectionId, curr.getPayload(), curr.getMetrics(), time); selector.send(networkSend); } } catch (IllegalStateException e) { metrics.processNewResponseErrorCount.inc(); logger.debug("Error in processing new responses", e); } finally { curr = (SocketServerResponse) channel.receiveResponse(id); } } }
Source:
public static boolean postHasEdits(@Nullable PostImmutableModel oldPost, PostImmutableModel newPost) { if (oldPost == null) { return newPost != null; } return newPost == null || !(StringUtils.equals(oldPost.getTitle(), newPost.getTitle()) && StringUtils.equals(oldPost.getContent(), newPost.getContent()) && StringUtils.equals(oldPost.getExcerpt(), newPost.getExcerpt()) && StringUtils.equals(oldPost.getStatus(), newPost.getStatus()) && StringUtils.equals(oldPost.getPassword(), newPost.getPassword()) && StringUtils.equals(oldPost.getPostFormat(), newPost.getPostFormat()) && StringUtils.equals(oldPost.getDateCreated(), newPost.getDateCreated()) && StringUtils.equals(oldPost.getSlug(), newPost.getSlug()) && oldPost.getFeaturedImageId() == newPost.getFeaturedImageId() && oldPost.getTagNameList().containsAll(newPost.getTagNameList()) && newPost.getTagNameList().containsAll(oldPost.getTagNameList()) && oldPost.getCategoryIdList().containsAll(newPost.getCategoryIdList()) && newPost.getCategoryIdList().containsAll(oldPost.getCategoryIdList()) && oldPost.getLocation().equals(newPost.getLocation()) && oldPost.getChangesConfirmedContentHashcode() == newPost .getChangesConfirmedContentHashcode() ); }

Target:
public static boolean postHasEdits(@Nullable PostImmutableModel oldPost, PostImmutableModel newPost) { if (oldPost == null) { return newPost != null; } return newPost == null || !(StringUtils.equals(oldPost.getTitle(), newPost.getTitle()) && StringUtils.equals(oldPost.getContent(), newPost.getContent()) && StringUtils.equals(oldPost.getExcerpt(), newPost.getExcerpt()) && StringUtils.equals(oldPost.getStatus(), newPost.getStatus()) && StringUtils.equals(oldPost.getPassword(), newPost.getPassword()) && StringUtils.equals(oldPost.getPostFormat(), newPost.getPostFormat()) && StringUtils.equals(oldPost.getDateCreated(), newPost.getDateCreated()) && StringUtils.equals(oldPost.getSlug(), newPost.getSlug()) && oldPost.getFeaturedImageId() == newPost.getFeaturedImageId() && oldPost.getTagNameList().containsAll(newPost.getTagNameList()) && newPost.getTagNameList().containsAll(oldPost.getTagNameList()) && oldPost.getCategoryIdList().containsAll(newPost.getCategoryIdList()) && newPost.getCategoryIdList().containsAll(oldPost.getCategoryIdList()) && PostLocation.Companion.equals(oldPost.getLocation(), newPost.getLocation()) && oldPost.getChangesConfirmedContentHashcode() == newPost .getChangesConfirmedContentHashcode() ); }
Source:
public void noConflictTable() throws Exception, UpdateException { long baseline = System.currentTimeMillis(); final DataBuilderProvider.DataBuilder builder = DataBuilderProvider .row(-1, true); for (int i = 0; i < 1000; i++) { builder .row(i, true); } final Object[][] end = builder.end(); long now = System.currentTimeMillis(); System.out.println("Loading of model took.. " + (now - baseline) + " ms"); baseline = now; final GuidedDecisionTable52 table52 = analyzerProvider.makeAnalyser() .withPersonAgeColumn("==") .withPersonApprovedActionSetField() .withData(end) .buildTable(); now = System.currentTimeMillis(); System.out.println("Made table.. " + (now - baseline) + " ms"); baseline = now; final Analyzer analyzer = analyzerProvider.makeAnalyser(table52); now = System.currentTimeMillis(); System.out.println("Indexing.. " + (now - baseline) + " ms"); baseline = now; analyzer.analyze(); now = System.currentTimeMillis(); System.out.println("Validated.. " + (now - baseline) + " ms"); baseline = now; table52.getData() .get(1) .get(2) .setNumericValue(3); List<Coordinate> updates = new ArrayList<>(); updates.add(new Coordinate(1, 2)); analyzerProvider.getUpdateManager(table52, analyzer) .update(table52, updates); now = System.currentTimeMillis(); System.out.println("Update.. " + (now - baseline) + " ms"); assertContains(REDUNDANT_ROWS, analyzerProvider.getAnalysisReport()); }

Target:
public void noConflictTable() throws Exception, UpdateException { long baseline = System.currentTimeMillis(); final DataBuilderProvider.DataBuilder builder = DataBuilderProvider .row(-1, true); for (int i = 0; i < 1000; i++) { builder .row(i, true); } final Object[][] data = builder.end(); table52 = new ExtendedGuidedDecisionTableBuilder("org.test", new ArrayList<Import>(), "mytable") .withConditionIntegerColumn("$p", "Person", "age", "==") .withActionSetField("$p", "approved", DataType.TYPE_BOOLEAN) .withData(data) .buildTable(); long now = System.currentTimeMillis(); logger.debug("Loading of model took.. " + (now - baseline) + " ms"); baseline = now; fireUpAnalyzer(); now = System.currentTimeMillis(); logger.debug("Analyzing took.. " + (now - baseline) + " ms"); baseline = now; setValue(1, 2, 3); now = System.currentTimeMillis(); logger.debug("Update.. " + (now - baseline) + " ms"); assertContains(REDUNDANT_ROWS, analyzerProvider.getAnalysisReport()); }
Source:
private void makeDependences(Job job, Map<String, ArrayList<String>> dependencies) throws JobCreationException { if (dependencies != null && dependencies.size() > 0 && job.getType() == JobType.TASKSFLOW) { TaskFlowJob tfj = (TaskFlowJob) job; for (Task t : tfj.getTasks()) { ArrayList<String> names = dependencies.get(t.getName()); if (names != null) { for (String name : names) { if (tfj.getTask(name) == null) { throw new JobCreationException("Unknown dependence: " + name); } else { t.addDependence(tfj.getTask(name)); } } } } } }

Target:
private void makeDependences(Job job, Map<String, ArrayList<String>> dependencies) throws JobCreationException { if (dependencies != null && !dependencies.isEmpty() && job.getType() == JobType.TASKSFLOW) { TaskFlowJob tfj = (TaskFlowJob) job; for (Task t : tfj.getTasks()) { ArrayList<String> names = dependencies.get(t.getName()); createTaskDependencies(tfj, t, names); } } }
Source:
public void doPolling(Guid cmdId, List<Guid> childCmdIds) { RebootVmCommand<P> command = getCommand(cmdId); boolean anyFailed = false; for (Guid childCmdId : childCmdIds) { CommandEntity entity = CommandCoordinatorUtil.getCommandEntity(childCmdId); switch (entity.getCommandStatus()) { case FAILED: case FAILED_RESTARTED: case UNKNOWN: anyFailed = true; break; default: break; } } if (anyFailed) { command.setCommandStatus(CommandStatus.FAILED); } else { VM vm = DbFacade.getInstance().getVmDao().get(command.getParameters().getVmId()); if (isVmDownForColdReboot(vm)) { command.proceedWithColdRun(); } } }

Target:
public void doPolling(Guid cmdId, List<Guid> childCmdIds) { RebootVmCommand<P> command = getCommand(cmdId); boolean anyFailed = false; for (Guid childCmdId : childCmdIds) { CommandEntity entity = CommandCoordinatorUtil.getCommandEntity(childCmdId); switch (entity.getCommandStatus()) { case FAILED: case FAILED_RESTARTED: case UNKNOWN: anyFailed = true; break; default: break; } } if (anyFailed) { command.setCommandStatus(CommandStatus.FAILED); } else { VM vm = DbFacade.getInstance().getVmDao().get(command.getParameters().getVmId()); if (isVmDownForColdReboot(vm)) { command.endSuccessfully(); } } }
Source:
public void run() { if (!mServiceConnection.isBound()) { mServiceConnection.unBindService(mContext); mCallback.onError(new AuthenticationException(ADALError.BROKER_BIND_SERVICE_FAILED)); } }

Target:
public void run() { if (!mServiceConnection.isBound()) { mServiceConnection.unBindService(mContext); mCallback.onError(new AuthenticationException(ADALError.BROKER_BIND_SERVICE_FAILED, "'bindService' timeout.")); } }
Source:
public int hashCode() { return Objects.hash(machine, content); }

Target:
public int hashCode() { return Objects.hash(machineName, content); }
Source:
private Stream<Map<Address, InternalCacheEntry<K, V>>> getConflicts(LocalizedCacheTopology topology) { if (stateConsumer.isStateTransferInProgress()) throw log.getConflictsStateTransferInProgress(cacheName); if (!streamInProgress.compareAndSet(false, true)) throw log.getConflictsAlreadyInProgress(); try { return StreamSupport .stream(new ReplicaSpliterator(topology), false) .filter(filterConsistentEntries()); } finally { streamInProgress.compareAndSet(true, false); } }

Target:
private Stream<Map<Address, CacheEntry<K, V>>> getConflicts(LocalizedCacheTopology topology) { if (stateConsumer.isStateTransferInProgress()) throw log.getConflictsStateTransferInProgress(cacheName); if (!streamInProgress.compareAndSet(false, true)) throw log.getConflictsAlreadyInProgress(); return StreamSupport .stream(new ReplicaSpliterator(topology), false) .filter(filterConsistentEntries()); }
Source:
public void testMergeRunnersEnsureGroupMerging() throws Exception { GroupByQuery query = GroupByQuery .builder() .setDataSource("xx") .setQuerySegmentSpec(new LegacySegmentSpec("1970/3000")) .setGranularity(QueryGranularities.ALL) .setDimensions(Lists.<DimensionSpec>newArrayList(new DefaultDimensionSpec("tags", "tags"))) .setAggregatorSpecs( Arrays.asList( new AggregatorFactory[] { new CountAggregatorFactory("count") } ) ) .build(); final QueryRunnerFactory factory = GroupByQueryRunnerTest.makeQueryRunnerFactory(new GroupByQueryConfig()); QueryRunner mergedRunner = factory.getToolchest().mergeResults( new QueryRunner() { @Override public Sequence run(Query query, Map responseContext) { return factory.getToolchest().mergeResults( new QueryRunner() { @Override public Sequence run(Query query, Map responseContext) { try { return new MergeSequence( query.getResultOrdering(), Sequences.simple( Arrays.asList( factory.createRunner(createSegment()).run(query, responseContext), factory.createRunner(createSegment()).run(query, responseContext) ) ) ); } catch (Exception e) { Assert.fail(e.getMessage()); return null; } } } ).run(query, responseContext); } } ); Sequence<Row> result = mergedRunner.run(query, Maps.newHashMap()); List<Row> expectedResults = Arrays.asList( GroupByQueryRunnerTestHelper.createExpectedRow("1970-01-01T00:00:00.000Z", "tags", "t1", "count", 2L), GroupByQueryRunnerTestHelper.createExpectedRow("1970-01-01T00:00:00.000Z", "tags", "t2", "count", 4L) ); TestHelper.assertExpectedObjects(expectedResults, Sequences.toList(result, new ArrayList<Row>()), ""); }

Target:
public void testMergeRunnersEnsureGroupMerging() throws Exception { GroupByQuery query = GroupByQuery .builder() .setDataSource("xx") .setQuerySegmentSpec(new LegacySegmentSpec("1970/3000")) .setGranularity(QueryGranularities.ALL) .setDimensions(Lists.<DimensionSpec>newArrayList(new DefaultDimensionSpec("tags", "tags"))) .setAggregatorSpecs( Arrays.asList( new AggregatorFactory[] { new CountAggregatorFactory("count") } ) ) .build(); final QueryRunnerFactory factory = GroupByQueryRunnerTest.makeQueryRunnerFactory(new GroupByQueryConfig()); QueryRunner mergedRunner = factory.getToolchest().mergeResults( new QueryRunner() { @Override public Sequence run(Query query, Map responseContext) { return factory.getToolchest().mergeResults( new QueryRunner() { @Override public Sequence run(Query query, Map responseContext) { try { return new MergeSequence( query.getResultOrdering(), Sequences.simple( Arrays.asList( factory.createRunner(createSegment()).run(query, responseContext), factory.createRunner(createSegment()).run(query, responseContext) ) ) ); } catch (Exception e) { Throwables.propagate(e); return null; } } } ).run(query, responseContext); } } ); Sequence<Row> result = mergedRunner.run(query, Maps.newHashMap()); List<Row> expectedResults = Arrays.asList( GroupByQueryRunnerTestHelper.createExpectedRow("1970-01-01T00:00:00.000Z", "tags", "t1", "count", 2L), GroupByQueryRunnerTestHelper.createExpectedRow("1970-01-01T00:00:00.000Z", "tags", "t2", "count", 4L) ); TestHelper.assertExpectedObjects(expectedResults, Sequences.toList(result, new ArrayList<Row>()), ""); }
Source:
public WTextAreaUI() { panel.add(messages); WFieldLayout fieldLayout = new WFieldLayout(LAYOUT_FLAT); fieldLayout.setTitle("this is a bunch of fields"); WTextArea wTextField = new WTextArea(); fieldLayout.addField("this is a textarea", wTextField); wTextField.setMandatory(true); panel.add(fieldLayout); add(createWButton()); add(panel); }

Target:
public WTextAreaUI() { panel.add(messages); WFieldLayout fieldLayout = new WFieldLayout(LAYOUT_FLAT); fieldLayout.setTitle("this is a bunch of fields"); fieldLayout.addField("this is a textarea", wTextArea); wTextArea.setMandatory(true); panel.add(fieldLayout); add(createWButton()); add(panel); }
Source:
public String toString() { StringBuilder result = new StringBuilder("[Test: \"" + m_name + \").append( verbose:").append(m_verbose); result.append("[parameters:"); for (Map.Entry<String, String> entry : m_parameters.entrySet()) { result.append(entry.getKey()).append("=>").append(entry.getValue()); } result.append("]"); result.append("[metagroups:"); for (Map.Entry<String, List<String>> entry : m_metaGroups.entrySet()) { result.append(entry.getKey()).append("="); for (String n : entry.getValue()) { result.append(n).append(","); } } result.append("] "); result.append("[included: "); for (String g : m_includedGroups) { result.append(g).append(" "); } result.append("]"); result.append("[excluded: "); for (String g : m_excludedGroups) { result.append(g).append(""); } result.append("] "); result.append(" classes:"); for (XmlClass cl : m_xmlClasses) { result.append(cl).append(" "); } result.append(" packages:"); for (XmlPackage p : m_xmlPackages) { result.append(p).append(" "); } result.append("] "); return result.toString(); }

Target:
public String toString() { StringBuilder result = new StringBuilder("[Test: \"") .append(m_name) .append("\"") .append(" verbose:") .append(m_verbose); result.append("[parameters:"); for (Map.Entry<String, String> entry : m_parameters.entrySet()) { result.append(entry.getKey()).append("=>").append(entry.getValue()); } result.append("]"); result.append("[metagroups:"); for (Map.Entry<String, List<String>> entry : m_metaGroups.entrySet()) { result.append(entry.getKey()).append("="); for (String n : entry.getValue()) { result.append(n).append(","); } } result.append("] "); result.append("[included: "); for (String g : m_includedGroups) { result.append(g).append(" "); } result.append("]"); result.append("[excluded: "); for (String g : m_excludedGroups) { result.append(g).append(" "); } result.append("] "); result.append(" classes:"); for (XmlClass cl : m_xmlClasses) { result.append(cl).append(" "); } result.append(" packages:"); for (XmlPackage p : m_xmlPackages) { result.append(p).append(" "); } result.append("] "); return result.toString(); }
Source:
public void testRename() throws Exception { typeContext = new LabelClientTypeContext(store, LabelType.METRIC, metrics, eventBus, MAX_CACHE_SIZE); final LabelId labelId = typeContext.createId("oldName").get(); ListenableFuture<Void> response = typeContext.rename("oldName", "newName"); Futures.addCallback(response, new FutureCallback<Void>() { @Override public void onSuccess(final Void result) { Futures.addCallback(typeContext.getName(labelId), new FutureCallback<Optional<String>>() { @Override public void onSuccess(final Optional<String> result) { if (!result.isPresent()) { fail(); } assertEquals("newName", result.get()); } @Override public void onFailure(final Throwable throwable) { fail(); } }); } @Override public void onFailure(final Throwable throwable) { fail(); } }); }

Target:
public void testRename() throws Exception { typeContext = new LabelClientTypeContext(store, LabelType.METRIC, metrics, eventBus, MAX_CACHE_SIZE); final LabelId labelId = typeContext.createId("oldName").get(); typeContext.rename("oldName", "newName").get(); Optional<String> optional = typeContext.getName(labelId).get(); assertEquals("newName", optional.get()); }
Source:
public void setLibraryAliasGenerator(NameGenerator<Library> generator) { this.libraryAliasGenerator = (DefaultLibraryAliasGenerator) generator; }

Target:
public void setLibraryAliasGenerator(NameGenerator<Library> generator) { this.libraryAliasGenerator = generator; }
Source:
public Set<Field> getFields() { return fields.keySet(); }

Target:
public Set<Field> getFields() { return Collections.unmodifiableSet(fields.keySet()); }
Source:
protected void deleteLog() { CommandContext commandContext = new CommandContext(); commandContext.setData("SingleRun", "true"); commandContext.setData("OlderThan", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); synchronized (this) { jobServicesClient.scheduleRequest(CONTAINER_ID, JobRequestInstance.builder().command("org.jbpm.executor.commands.LogCleanupCommand").build()); } }

Target:
protected void deleteLog() { synchronized (this) { jobServicesClient.scheduleRequest(CONTAINER_ID, JobRequestInstance.builder().command("org.jbpm.executor.commands.LogCleanupCommand").build()); } }
Source:
private ContextMenuHandler showContextMenu() { if (contextMenuHandler == null) { contextMenuHandler = event -> { event.preventDefault(); event.stopPropagation(); popup.asPopupPanel().setPopupPosition(event.getNativeEvent().getClientX(), event.getNativeEvent().getClientY()); popup.asPopupPanel().setPopupPosition(event.getNativeEvent().getClientX(), event.getNativeEvent().getClientY()); popup.asPopupPanel().show(); }; } return contextMenuHandler; }

Target:
private ContextMenuHandler showContextMenu() { if (contextMenuHandler == null) { contextMenuHandler = event -> { event.preventDefault(); event.stopPropagation(); popup.asPopupPanel().setPopupPosition(event.getNativeEvent().getClientX(), event.getNativeEvent().getClientY()); popup.asPopupPanel().show(); }; } return contextMenuHandler; }
Source:
public static void copy(File source, File dest) throws IOException { try (InputStream in = new FileInputStream(source)) { try (OutputStream out = new BufferedOutputStream(new FileOutputStream(dest))) { transferData(in, out); } } }

Target:
public static void copy(File source, File dest) throws IOException { try (InputStream in = new FileInputStream(source); OutputStream out = new BufferedOutputStream(new FileOutputStream(dest))) { transferData(in, out); } }
Source:
public boolean includeMethod( IMethodSelectorContext context, ITestNGMethod tm, boolean isTestMethod) { if (!m_isInitialized) { m_isInitialized = true; init(context); } if (script != null) { return getScriptSelector(script.getLanguage()).includeMethodFromExpression(script.getExpression(), tm); } return includeMethodFromIncludeExclude(tm, isTestMethod); }

Target:
public boolean includeMethod( IMethodSelectorContext context, ITestNGMethod tm, boolean isTestMethod) { if (!m_isInitialized) { m_isInitialized = true; init(context); } if (scriptSelector != null) { return scriptSelector.includeMethodFromExpression(tm); } return includeMethodFromIncludeExclude(tm, isTestMethod); }
Source:
public String getUpload() { Desktop desktop = getDesktop(); String upload = _auxinf != null ? _auxinf.upload : null; if (desktop != null && !Strings.isEmpty(upload) && !upload.contains("maxsize=")) upload = upload.concat(",maxsize=" + desktop.getWebApp().getConfiguration().getMaxUploadSize()); return upload; }

Target:
public String getUpload() { return _auxinf != null ? _auxinf.upload : null; }
Source:
public void testSendCloseSession() throws Exception { assertTrue("Didn't instantiate ServerCnxnFactory with NettyServerCnxnFactory!", serverFactory instanceof NettyServerCnxnFactory); try (ZooKeeper zk = createClient()) { final ZooKeeperServer zkServer = serverFactory.getZooKeeperServer(); final String path = "/a"; zk.create(path, "test".getBytes(StandardCharsets.UTF_8), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); assertNotNull("Didn't create znode:" + path, zk.exists(path, true)); assertEquals(1, zkServer.getZKDatabase().getDataTree().getWatchCount()); Iterable<ServerCnxn> connections = serverFactory.getConnections(); assertEquals("Mismatch in number of live connections!", 1, serverFactory.getNumAliveConnections()); for (ServerCnxn serverCnxn : connections) { serverCnxn.sendCloseSession(); } LOG.info("Waiting for the channel disconnected event"); int timeout = 0; while (serverFactory.getNumAliveConnections() != 0) { Thread.sleep(1000); timeout += 1000; if (timeout > CONNECTION_TIMEOUT) { fail("The number of live connections should be 0"); } } assertEquals(0, zkServer.getZKDatabase().getDataTree().getWatchCount()); } }

Target:
public void testSendCloseSession() throws Exception { assertTrue("Didn't instantiate ServerCnxnFactory with NettyServerCnxnFactory!", serverFactory instanceof NettyServerCnxnFactory); final ZooKeeper zk = createClient(); final ZooKeeperServer zkServer = serverFactory.getZooKeeperServer(); final String path = "/a"; try { zk.create(path, "test".getBytes(StandardCharsets.UTF_8), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); assertNotNull("Didn't create znode:" + path, zk.exists(path, true)); assertEquals(1, zkServer.getZKDatabase().getDataTree().getWatchCount()); Iterable<ServerCnxn> connections = serverFactory.getConnections(); assertEquals("Mismatch in number of live connections!", 1, serverFactory.getNumAliveConnections()); for (ServerCnxn serverCnxn : connections) { serverCnxn.sendCloseSession(); } LOG.info("Waiting for the channel disconnected event"); int timeout = 0; while (serverFactory.getNumAliveConnections() != 0) { Thread.sleep(1000); timeout += 1000; if (timeout > CONNECTION_TIMEOUT) { fail("The number of live connections should be 0"); } } assertEquals(0, zkServer.getZKDatabase().getDataTree().getWatchCount()); } finally { zk.close(); } }
Source:
public static SentryStackTraceElement[] fromStackTraceElements(StackTraceElement[] stackTraceElements) { Frame[] localsCache = LocalsCache.getCache(); SentryStackTraceElement[] sentryStackTraceElements = new SentryStackTraceElement[stackTraceElements.length]; boolean mayHaveLocals = localsCache.length == stackTraceElements.length; for (int i = 0; i < stackTraceElements.length; i++) { Map<String, Object> vars = null; if (mayHaveLocals) { Frame frame = localsCache[i]; Frame.LocalVariable[] frameLocals = frame.getLocals(); if (frameLocals != null && frameLocals.length > 0) { for (Frame.LocalVariable localVariable : frameLocals) { if (localVariable != null) { if (vars == null) { vars = new HashMap<>(); } vars.put(localVariable.getName(), localVariable.getValue()); } } } } sentryStackTraceElements[i] = fromStackTraceElement(stackTraceElements[i], vars); } return sentryStackTraceElements; }

Target:
public static SentryStackTraceElement[] fromStackTraceElements(StackTraceElement[] stackTraceElements) { return fromStackTraceElements(stackTraceElements, null); }
Source:
public void runBeforeAllTests() { conceptService = Context.getConceptService(); executeDataSet(STANDARD_TEST_DATASET_XML); }

Target:
public void runBeforeAllTests() { conceptService = Context.getConceptService(); }
Source:
private void fillDriverSpecificChannelConfiguration(final Tocd mainOcd, final List<Tad> driverSpecificChannelConfiguration) { final ChannelDescriptor basicChanneldescriptor = new BaseChannelDescriptor(); final Object baseChannelDescriptor = basicChanneldescriptor.getDescriptor(); if (nonNull(baseChannelDescriptor) && baseChannelDescriptor instanceof List<?>) { List<Tad> channelConfiguration = (List<Tad>) baseChannelDescriptor; channelConfiguration.addAll(driverSpecificChannelConfiguration); for (final Tad attribute : channelConfiguration) { final Set<String> channelPrefixes = retrieveChannelPrefixes(this.assetConfiguration.getAssetChannels()); for (final String prefix : channelPrefixes) { final Tad newAttribute = cloneAd(attribute, prefix); mainOcd.addAD(newAttribute); } } } }

Target:
private void fillDriverSpecificChannelConfiguration(final Tocd mainOcd, final List<Tad> driverSpecificChannelConfiguration) { if (mainOcd == null || driverSpecificChannelConfiguration == null) { return; } final ChannelDescriptor basicChanneldescriptor = new BaseChannelDescriptor(); final Object baseChannelDescriptor = basicChanneldescriptor.getDescriptor(); if (nonNull(baseChannelDescriptor) && baseChannelDescriptor instanceof List<?>) { List<Tad> channelConfiguration = (List<Tad>) baseChannelDescriptor; channelConfiguration.addAll(driverSpecificChannelConfiguration); for (final Tad attribute : channelConfiguration) { final Set<String> channelPrefixes = retrieveChannelPrefixes(this.assetConfiguration.getAssetChannels()); for (final String prefix : channelPrefixes) { final Tad newAttribute = cloneAd(attribute, prefix); mainOcd.addAD(newAttribute); } } } }
Source:
public ArrayList<Pojo> getResults(String query) { ArrayList<Pojo> pojos = new ArrayList<>(); if (android.os.Build.VERSION.SDK_INT >= 11) { Set<String> selectedProviders = new TreeSet<>(); selectedProviders.addAll(PreferenceManager.getDefaultSharedPreferences(this).getStringSet("search-providers", new HashSet<>(Arrays.asList("Google")))); for (String searchProvider : selectedProviders) { SearchPojo pojo = new SearchPojo(); pojo.query = query; pojo.relevance = 10; pojo.url = searchProviderUrls.get(searchProvider); pojo.name = searchProvider; pojos.add(pojo); } } else { SearchPojo pojo = new SearchPojo(); pojo.query = query; pojo.relevance = 10; pojo.name="Google"; pojo.url = searchProviderUrls.get("Google"); pojos.add(pojo); } Pattern p = Pattern.compile(URL_REGEX); Matcher m = p.matcher(query); if(m.find()) { String guessedUrl = URLUtil.guessUrl(query).toString(); if(URLUtil.isValidUrl (guessedUrl)) { SearchPojo pojo = new SearchPojo(); pojo.query = ""; pojo.relevance = 50; pojo.name = guessedUrl; pojo.url = guessedUrl; pojo.direct = true; pojos.add(pojo); } } return pojos; }

Target:
public ArrayList<Pojo> getResults(String query) { ArrayList<Pojo> pojos = new ArrayList<>(); if (android.os.Build.VERSION.SDK_INT >= 11) { Set<String> selectedProviders = new TreeSet<>(); selectedProviders.addAll(PreferenceManager.getDefaultSharedPreferences(this).getStringSet("search-providers", new HashSet<>(Arrays.asList("Google")))); for (String searchProvider : selectedProviders) { SearchPojo pojo = new SearchPojo(); pojo.query = query; pojo.relevance = 10; pojo.url = searchProviderUrls.get(searchProvider); pojo.name = searchProvider; pojos.add(pojo); } } else { SearchPojo pojo = new SearchPojo(); pojo.query = query; pojo.relevance = 10; pojo.name="Google"; pojo.url = searchProviderUrls.get("Google"); pojos.add(pojo); } Matcher m = p.matcher(query); if(m.find()) { String guessedUrl = URLUtil.guessUrl(query); if(URLUtil.isValidUrl (guessedUrl)) { SearchPojo pojo = new SearchPojo(); pojo.query = ""; pojo.relevance = 50; pojo.name = guessedUrl; pojo.url = guessedUrl; pojo.direct = true; pojos.add(pojo); } } return pojos; }
Source:
public AutoRegisterModules discover() throws InvalidPluginException { sysSingletons = Sets.newHashSet(); sysListen = LinkedListMultimap.create(); if (sshGen != null) { sshGen.setPluginName(pluginName); } if (httpGen != null) { httpGen.setPluginName(pluginName); } scan(); if (!sysSingletons.isEmpty() || !sysListen.isEmpty()) { sysModule = makeSystemModule(); } if (sshGen != null) { sshModule = sshGen.create(); } if (httpGen != null) { httpModule = httpGen.create(); } return this; }

Target:
AutoRegisterModules discover() throws InvalidPluginException { sysSingletons = Sets.newHashSet(); sysListen = LinkedListMultimap.create(); if (sshGen != null) { sshGen.setPluginName(pluginName); } if (httpGen != null) { httpGen.setPluginName(pluginName); } scan(); if (!sysSingletons.isEmpty() || !sysListen.isEmpty()) { sysModule = makeSystemModule(); } if (sshGen != null) { sshModule = sshGen.create(); } if (httpGen != null) { httpModule = httpGen.create(); } return this; }
Source:
public <K, V> MessageStream<KV<K, V>> partitionBy(Function<? super M, ? extends K> keyExtractor, Function<? super M, ? extends V> valueExtractor, KVSerde<K, V> serde) { int opId = this.graph.getNextOpId(); String opName = String.format("%s-%s", OperatorSpec.OpCode.PARTITION_BY.name().toLowerCase(), opId); IntermediateMessageStreamImpl<KV<K, V>> intermediateStream = this.graph.getIntermediateStream(opName, serde); PartitionByOperatorSpec<M, K, V> partitionByOperatorSpec = OperatorSpecs.createRepartitionOperatorSpec( intermediateStream.getOutputStream(), keyExtractor, valueExtractor, opId); this.operatorSpec.registerNextOperatorSpec(partitionByOperatorSpec); return intermediateStream; }

Target:
public <K, V> MessageStream<KV<K, V>> partitionBy(Function<? super M, ? extends K> keyExtractor, Function<? super M, ? extends V> valueExtractor, KVSerde<K, V> serde) { int opId = this.graph.getNextOpId(); String opName = String.format("%s-%s", OperatorSpec.OpCode.PARTITION_BY.name().toLowerCase(), opId); IntermediateMessageStreamImpl<KV<K, V>> intermediateStream = this.graph.getIntermediateStream(opName, serde); PartitionByOperatorSpec<M, K, V> partitionByOperatorSpec = OperatorSpecs.createPartitionByOperatorSpec( intermediateStream.getOutputStream(), keyExtractor, valueExtractor, opId); this.operatorSpec.registerNextOperatorSpec(partitionByOperatorSpec); return intermediateStream; }
Source:
public RealmIdentity getRealmIdentity(final Principal principal) throws RealmUnavailableException { boolean ok = false; final RealmIdentity authenticationIdentity = authenticationRealm.getRealmIdentity(principal); Principal authorizationPrincipal = principal; if(principalTransformer != null) { authorizationPrincipal = principalTransformer.apply(authorizationPrincipal); if (authorizationPrincipal == null) return null; } final RealmIdentity[] authorizationIdentities = new RealmIdentity[authorizationRealms.length]; try { for (int i = 0; i < authorizationIdentities.length; i++) { SecurityRealm authorizationRealm = authorizationRealms[i]; authorizationIdentities[i] = authorizationRealm == authenticationRealm && principalTransformer == null ? authenticationIdentity : authorizationRealm.getRealmIdentity(authorizationPrincipal); } final Identity identity = new Identity(authenticationIdentity, authorizationIdentities); ok = true; return identity; } finally { if (!ok) { authenticationIdentity.dispose(); for (RealmIdentity current : authorizationIdentities) { if (current != null) current.dispose(); } } } }

Target:
public RealmIdentity getRealmIdentity(final Principal principal) throws RealmUnavailableException { boolean ok = false; final RealmIdentity authenticationIdentity = authenticationRealm.getRealmIdentity(principal); Principal authorizationPrincipal = principal; if (principalTransformer != null) { authorizationPrincipal = principalTransformer.apply(authorizationPrincipal); if (authorizationPrincipal == null) throw ElytronMessages.log.transformedPrincipalCannotBeNull(); } final RealmIdentity[] authorizationIdentities = new RealmIdentity[authorizationRealms.length]; try { for (int i = 0; i < authorizationIdentities.length; i++) { SecurityRealm authorizationRealm = authorizationRealms[i]; authorizationIdentities[i] = (authorizationRealm == authenticationRealm) && (principalTransformer == null) ? authenticationIdentity : authorizationRealm.getRealmIdentity(authorizationPrincipal); } final Identity identity = new Identity(authenticationIdentity, authorizationIdentities); ok = true; return identity; } finally { if (!ok) { authenticationIdentity.dispose(); for (RealmIdentity current : authorizationIdentities) { if (current != null) current.dispose(); } } } }
Source:
protected void doStart() throws Exception { super.doStart(); if (!Files.exists(baseDirectory)) { if (getEndpoint().isAutoCreate()) { baseDirectory = Files.createDirectories(baseDirectory); } else { throw new RuntimeCamelException("Path must exists when autoCreate = false"); } } if (!Files.isDirectory(baseDirectory)) { throw new RuntimeCamelException(String.format("Parameter path must be directory, %s given", baseDirectory.toString())); } DirectoryWatcher.Builder watcherBuilder = DirectoryWatcher.builder() .path(this.baseDirectory) .logger(log) .listener(new FileWatchDirectoryChangeListener()); if (!System.getProperty("os.name").toLowerCase().contains("mac")) { watcherBuilder.watchService(this.baseDirectory.getFileSystem().newWatchService()); } watcherBuilder.fileHashing(getEndpoint().isUseFileHashing()); if (getEndpoint().getFileHasher() != null && getEndpoint().isUseFileHashing()) { watcherBuilder.fileHasher(getEndpoint().getFileHasher()); } this.watcher = watcherBuilder.build(); watchDirExecutorService = getEndpoint().getCamelContext().getExecutorServiceManager() .newFixedThreadPool(this, "CamelFileWatchService", getEndpoint().getPollThreads()); pollExecutorService = getEndpoint().getCamelContext().getExecutorServiceManager() .newFixedThreadPool(this, "CamelFileWatchPoll", getEndpoint().getConcurrentConsumers()); for (int i = 0; i < getEndpoint().getPollThreads(); i++) { this.watcher.watchAsync(watchDirExecutorService); } for (int i = 0; i < getEndpoint().getConcurrentConsumers(); i++) { pollExecutorService.submit(new PollRunnable()); } }

Target:
protected void doStart() throws Exception { super.doStart(); if (!Files.exists(baseDirectory)) { if (getEndpoint().isAutoCreate()) { baseDirectory = Files.createDirectories(baseDirectory); } else { throw new IllegalArgumentException("Path must exists when autoCreate = false"); } } if (!Files.isDirectory(baseDirectory)) { throw new IllegalArgumentException(String.format("Parameter path must be directory, %s given", baseDirectory.toString())); } DirectoryWatcher.Builder watcherBuilder = DirectoryWatcher.builder() .path(this.baseDirectory) .logger(log) .listener(new FileWatchDirectoryChangeListener()); if (!System.getProperty("os.name").toLowerCase().contains("mac")) { watcherBuilder.watchService(this.baseDirectory.getFileSystem().newWatchService()); } watcherBuilder.fileHashing(getEndpoint().isUseFileHashing()); if (getEndpoint().getFileHasher() != null && getEndpoint().isUseFileHashing()) { watcherBuilder.fileHasher(getEndpoint().getFileHasher()); } this.watcher = watcherBuilder.build(); watchDirExecutorService = getEndpoint().getCamelContext().getExecutorServiceManager() .newFixedThreadPool(this, "CamelFileWatchService", getEndpoint().getPollThreads()); pollExecutorService = getEndpoint().getCamelContext().getExecutorServiceManager() .newFixedThreadPool(this, "CamelFileWatchPoll", getEndpoint().getConcurrentConsumers()); for (int i = 0; i < getEndpoint().getPollThreads(); i++) { this.watcher.watchAsync(watchDirExecutorService); } for (int i = 0; i < getEndpoint().getConcurrentConsumers(); i++) { pollExecutorService.submit(new PollRunnable()); } }
Source:
public String getDescription() { return Localization.lang( "Removes all brackets around words."); }

Target:
public String getDescription() { return Localization.lang( "Removes all balanced braces around words."); }
Source:
public ClientConfiguration getClientConfiguration() throws ConfigurationException, FileNotFoundException { ClientConfiguration clientConfig = clientConfigFile == null ? ClientConfiguration.loadDefault() : new ClientConfiguration(getClientConfigFile()); if (useSsl()) { clientConfig.setProperty(ClientProperty.INSTANCE_RPC_SSL_ENABLED, "true"); } if (useSasl()) { clientConfig.setProperty(ClientProperty.INSTANCE_RPC_SASL_ENABLED, "true"); } if (getZooKeeperInstance().size() > 0) { List<String> zkOpts = getZooKeeperInstance(); String instanceName = zkOpts.get(0); String hosts = zkOpts.get(1); clientConfig.setProperty(ClientProperty.INSTANCE_ZK_HOST, hosts); clientConfig.setProperty(ClientProperty.INSTANCE_NAME, instanceName); } if (!clientConfig.containsKey(ClientProperty.INSTANCE_ZK_HOST.getKey())) { AccumuloConfiguration siteConf = SiteConfiguration.getInstance(ClientContext.convertClientConfig(clientConfig)); clientConfig.withZkHosts(siteConf.get(Property.INSTANCE_ZK_HOST)); } if (null != zooKeeperHosts) { clientConfig.setProperty(ClientProperty.INSTANCE_ZK_HOST, zooKeeperHosts); } return clientConfig; }

Target:
public ClientConfiguration getClientConfiguration() throws ConfigurationException, FileNotFoundException { ClientConfiguration clientConfig = clientConfigFile == null ? ClientConfiguration.loadDefault() : new ClientConfiguration(getClientConfigFile()); if (useSsl()) { clientConfig.setProperty(ClientProperty.INSTANCE_RPC_SSL_ENABLED, "true"); } if (useSasl()) { clientConfig.setProperty(ClientProperty.INSTANCE_RPC_SASL_ENABLED, "true"); } if (!getZooKeeperInstance().isEmpty()) { List<String> zkOpts = getZooKeeperInstance(); String instanceName = zkOpts.get(0); String hosts = zkOpts.get(1); clientConfig.setProperty(ClientProperty.INSTANCE_ZK_HOST, hosts); clientConfig.setProperty(ClientProperty.INSTANCE_NAME, instanceName); } if (!clientConfig.containsKey(ClientProperty.INSTANCE_ZK_HOST.getKey())) { AccumuloConfiguration siteConf = SiteConfiguration.getInstance(ClientContext.convertClientConfig(clientConfig)); clientConfig.withZkHosts(siteConf.get(Property.INSTANCE_ZK_HOST)); } if (null != zooKeeperHosts) { clientConfig.setProperty(ClientProperty.INSTANCE_ZK_HOST, zooKeeperHosts); } return clientConfig; }