auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testMetricToPatterns() { PrototypeMeasurementFilterSpecification spec = new PrototypeMeasurementFilterSpecification(); spec.getInclude().put("meterA", meterSpecA); spec.getInclude().put(".+B", meterSpecB); spec.getInclude().put(".+C.*", meterSpecC); PrototypeMeasurementFilter filter = new PrototypeMeasurementFilter(spec); PrototypeMeasurementFilter.MeterFilterPattern meterPatternA = new PrototypeMeasurementFilter.MeterFilterPattern("meterA", meterSpecA); <START> PrototypeMeasurementFilter.MeterFilterPattern meterPatternB <END> = new PrototypeMeasurementFilter.MeterFilterPattern(".+B", meterSpecB); PrototypeMeasurementFilter.MeterFilterPattern meterPatternC = new PrototypeMeasurementFilter.MeterFilterPattern(".+C.*", meterSpecC); final List<PrototypeMeasurementFilter.ValueFilterPattern> emptyList = new ArrayList<PrototypeMeasurementFilter.ValueFilterPattern>(); Assert.assertEquals( filter.metricToPatterns("meterA"), new PrototypeMeasurementFilter.IncludeExcludePatterns( meterPatternA.getValues(), emptyList)); Assert.assertEquals( filter.metricToPatterns("meterBefore"), new PrototypeMeasurementFilter.IncludeExcludePatterns( emptyList, emptyList)); Assert.assertEquals( filter.metricToPatterns("meterCthing"), new PrototypeMeasurementFilter.IncludeExcludePatterns( meterPatternC.getValues(), emptyList)); }</code><technical_language>this is used. middle pattern in assert is empty list</technical_language>

Target:
public void testMetricToPatterns() { PrototypeMeasurementFilterSpecification spec = new PrototypeMeasurementFilterSpecification(); spec.getInclude().put("meterA", meterSpecA); spec.getInclude().put(".+B", meterSpecB); spec.getInclude().put(".+C.*", meterSpecC); PrototypeMeasurementFilter filter = new PrototypeMeasurementFilter(spec); PrototypeMeasurementFilter.MeterFilterPattern meterPatternA = new PrototypeMeasurementFilter.MeterFilterPattern("meterA", meterSpecA); PrototypeMeasurementFilter.MeterFilterPattern meterPatternC = new PrototypeMeasurementFilter.MeterFilterPattern(".+C.*", meterSpecC); final List<PrototypeMeasurementFilter.ValueFilterPattern> emptyList = new ArrayList<PrototypeMeasurementFilter.ValueFilterPattern>(); Assert.assertEquals( filter.metricToPatterns("meterA"), new PrototypeMeasurementFilter.IncludeExcludePatterns( meterPatternA.getValues(), emptyList)); Assert.assertEquals( filter.metricToPatterns("meterBextra"), new PrototypeMeasurementFilter.IncludeExcludePatterns( emptyList, emptyList)); Assert.assertEquals( filter.metricToPatterns("meterCthing"), new PrototypeMeasurementFilter.IncludeExcludePatterns( meterPatternC.getValues(), emptyList)); }
Source:
<code><START> public int setExtraData(int index, Vector3i pos, int value) { <END> extendExtraDataTo(index); Integer prevValue = extraData.get(index).get(pos); extraData.get(index).put(pos, value); if (prevValue == null) { return 0; } return prevValue; }</code><technical_language>Map.put returns previous value, this simplified. public int setExtraData(int index, Vector3i pos, int value) { extendExtraDataTo(index); Integer prevValue = extraData.get(index).put(pos, value); return (prevValue != null) ? prevValue : 0; }</technical_language>

Target:
public int setExtraData(int index, Vector3i pos, int value) { Integer prevValue = getExtraDataLayer(index).put(pos, value); return prevValue == null ? 0 : prevValue; }
Source:
<code>public void validationOfBusinessEventShouldAllowSpanCtxtInMetadata() { final EventType et = EventTypeTestBuilder.builder().name("some-event-type") .schema(basicSchema()).compatibilityMode(CompatibilityMode.COMPATIBLE).build(); et.setCategory(EventCategory.BUSINESS); final JSONObject event = new JSONObject("{\"metadata\":{" + "\"occurred_at\":\"1992-08-03T10:00:00Z\"," + "\"eid\":\"329ed3d2-8366-11e8-adc0-fa7ae01bbebc\"," + "\"span_ctx\": {" + " \"ot-tracer-spanid\": \"b268f901d5f2b865\"," + " \"ot-tracer-traceid\": \"e9435c17dabe8238\"," + <START> " \"ot-baggage-foo\": \"bar\"" + <END> "}}," + "\"foo\": \"bar\"}"); final Optional<ValidationError> error = EventValidation.forType(et).validate(event); assertThat(error, isAbsent()); }</code><technical_language>a test validates case a none-string field in span_ctx? (Validation fail in this case)</technical_language>

Target:
public void validationOfBusinessEventShouldAllowSpanCtxtInMetadata() { final EventType et = EventTypeTestBuilder.builder().name("some-event-type") .schema(basicSchema()).compatibilityMode(CompatibilityMode.COMPATIBLE).build(); et.setCategory(EventCategory.BUSINESS); final JSONObject validEvent = new JSONObject("{\"metadata\":{" + "\"occurred_at\":\"1992-08-03T10:00:00Z\"," + "\"eid\":\"329ed3d2-8366-11e8-adc0-fa7ae01bbebc\"," + "\"span_ctx\": {" + " \"ot-tracer-spanid\": \"b268f901d5f2b865\"," + " \"ot-tracer-traceid\": \"e9435c17dabe8238\"," + " \"ot-baggage-foo\": \"bar\"" + "}}," + "\"foo\": \"bar\"}"); final Optional<ValidationError> noError = EventValidation.forType(et).validate(validEvent); assertThat(noError, isAbsent()); final JSONObject invalidEvent = new JSONObject("{\"metadata\":{" + "\"occurred_at\":\"1992-08-03T10:00:00Z\"," + "\"eid\":\"329ed3d2-8366-11e8-adc0-fa7ae01bbebc\"," + "\"span_ctx\": {" + " \"ot-tracer-spanid\": 42," + " \"ot-tracer-traceid\": \"e9435c17dabe8238\"," + " \"ot-baggage-foo\": \"bar\"" + "}}," + "\"foo\": \"bar\"}"); final Optional<ValidationError> error = EventValidation.forType(et).validate(invalidEvent); assertThat(error.get().getMessage(), equalTo("#/metadata/span_ctx/ot-tracer-spanid: expected type: String, found: Integer")); }
Source:
<code>public void testSocket() throws Exception { Socket s = new Socket(); s.connect(server.getLocalAddress()); s.close(); assertEquals(Collections.EMPTY_MAP, <START> tagger.getLiveDescriptors()); <END> }</code><technical_language>want assert close in cases? i.e. empty</technical_language>

Target:
public void testSocket() throws Exception { Socket s = new Socket(); s.connect(server.getLocalAddress()); assertEquals(1, tagger.getLiveDescriptors().size()); s.close(); assertEquals(Collections.EMPTY_MAP, tagger.getLiveDescriptors()); }
Source:
<code>public String getOpenPinName() { waitForElementByElement(pinTitle); String pinName = pinTitle.getText(); <START> return pinName; <END> }</code><technical_language>return String in line</technical_language>

Target:
public String getOpenPinName() { waitForElementByElement(pinTitle); return pinTitle.getText(); }
Source:
<code>private boolean isSameList(@NonNull List<MediaModel> mediaList) { if (mediaList.size() != mMediaList.size()) { return false; } for (MediaModel media: mediaList) { <START> int index = indexOfId(media.getId()); <END> if (index == INVALID_POSITION) { return false; } MediaModel thisMedia = mMediaList.get(index); if (!thisMedia.equals(media)) { return false; } } return true; }</code><technical_language>a routine getMediaWithID returns element null. check for null, check if states equals 2 calls get mMediaList</technical_language>

Target:
private boolean isSameList(@NonNull List<MediaModel> mediaList) { if (mediaList.size() != mMediaList.size()) { return false; } for (MediaModel media: mediaList) { MediaModel thisMedia = getMediaFromId(media.getId()); if (thisMedia == null || !thisMedia.equals(media)) { return false; } } return true; }
Source:
<code>public File mergeQueryableIndex( List<QueryableIndex> indexes, final AggregatorFactory[] metricAggs, File outDir, IndexSpec indexSpec, ProgressIndicator progress ) throws IOException { List<IndexableAdapter> indexAdapteres = new ArrayList<IndexableAdapter>(); <START> for (QueryableIndex index : indexes) { <END> indexAdapteres.add(new QueryableIndexIndexableAdapter(index)); } return merge( indexAdapteres, metricAggs, outDir, null, indexSpec, progress ); }</code><technical_language>Is this faster Lists.transform</technical_language>

Target:
public File mergeQueryableIndex( List<QueryableIndex> indexes, final AggregatorFactory[] metricAggs, File outDir, IndexSpec indexSpec, ProgressIndicator progress ) throws IOException { return merge( Lists.transform( indexes, new Function<QueryableIndex, IndexableAdapter>() { @Override public IndexableAdapter apply(final QueryableIndex input) { return new QueryableIndexIndexableAdapter(input); } } ), metricAggs, outDir, null, indexSpec, progress ); }
Source:
<code>protected void prepareProcess(ProcessBuilder pb) { List<String> args = pb.command(); args.add("-catalogUrl"); <START> args.add("\"" + CATALOG_URL.get() + "\""); <END> args.add("-refreshInterval"); args.add(CATALOG_REFRESH_INTERVAL.get()); }</code><technical_language>@prachidamle need quote string. nature of program arguments is passed a string</technical_language>

Target:
protected void prepareProcess(ProcessBuilder pb) { List<String> args = pb.command(); args.add("-catalogUrl"); args.add(CATALOG_URL.get()); args.add("-refreshInterval"); args.add(CATALOG_REFRESH_INTERVAL.get()); }
Source:
<code>private void rewriteWhereStat(ListIterator<Statement> stats) throws InvalidSpecCompileException { Statement stat = stats.next(); BinaryExpression binExpr = AstUtil.getExpression(stat, BinaryExpression.class); if (binExpr != null && binExpr.getClass() == BinaryExpression.class) <START> { <END> int type = binExpr.getOperation().getType(); if (type == Types.LEFT_SHIFT) { Expression leftExpr = binExpr.getLeftExpression(); if (leftExpr instanceof VariableExpression) rewriteSimpleParameterization(binExpr, stat); else if (leftExpr instanceof ListExpression) rewriteMultiParameterization(binExpr, stat); else notAParameterization(stat); } else if (type == Types.ASSIGN) rewriteDerivedParameterization(binExpr, stat); else if (getOrExpression(binExpr) != null) { stats.previous(); rewriteTableLikeParameterization(stats); } else notAParameterization(stat); } else if (!AstUtil.isDataTableSeparator(AstUtil.getExpression(stat, Expression.class))) { notAParameterization(stat); } }</code><technical_language>Spock Egyptian-style braces</technical_language>

Target:
private void rewriteWhereStat(ListIterator<Statement> stats) throws InvalidSpecCompileException { Statement stat = stats.next(); BinaryExpression binExpr = AstUtil.getExpression(stat, BinaryExpression.class); if (binExpr != null && binExpr.getClass() == BinaryExpression.class) { int type = binExpr.getOperation().getType(); if (type == Types.LEFT_SHIFT) { Expression leftExpr = binExpr.getLeftExpression(); if (leftExpr instanceof VariableExpression) rewriteSimpleParameterization(binExpr, stat); else if (leftExpr instanceof ListExpression) rewriteMultiParameterization(binExpr, stat); else notAParameterization(stat); } else if (type == Types.ASSIGN) rewriteDerivedParameterization(binExpr, stat); else if (getOrExpression(binExpr) != null) { stats.previous(); rewriteTableLikeParameterization(stats); } else notAParameterization(stat); } else if (!isDataTableSeparator(stat)) { notAParameterization(stat); } }
Source:
<code>public void testLogEventWithMarker() { Marker marker = SecureLogging.SECURITY_SUCCESS; String logmsg = "security log message"; this.loggerLogback.info(marker, logmsg); verify(this.mockAppender).doAppend(this.captorLoggingEvent.capture()); <START> final LoggingEvent loggingEvent = this.captorLoggingEvent.getValue(); <END> assertThat(loggingEvent.getLevel()).isEqualTo(Level.INFO); String layoutMessage = this.encoder.getLayout().doLayout(loggingEvent); System.out.println("test(): layoutMessage = " + layoutMessage); assertTrue("formatted log message must contain the original message.", layoutMessage.contains(logmsg)); assertTrue("formatted log message must contain the name of its marker.", layoutMessage.contains(marker.getName())); }</code><technical_language>2 statements same. create a private method LoggingEvent getLastLogEvent()</technical_language>

Target:
public void testLogEventWithMarker() { Marker marker = SecureLogging.SECURITY_SUCCESS; String logmsg = "security log message"; LOG.info(marker, logmsg); final LoggingEvent loggingEvent = getLastLogEvent(); assertThat(loggingEvent.getLevel()).isEqualTo(Level.INFO); String layoutMessage = this.encoder.getLayout().doLayout(loggingEvent); assertThat(layoutMessage.contains(logmsg)).as("formatted log message contains original message.").isTrue(); assertThat(layoutMessage.contains(marker.getName())).as("log message contains name of marker.").isTrue(); }
Source:
<code>private void readOrthogonalPlanes() throws Exception { ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger)LoggerFactory.getLogger( Logger.ROOT_LOGGER_NAME); if (debug) { root.setLevel(Level.DEBUG); } else { root.setLevel(Level.INFO); } ImageReader reader = this.initialiseReader(this.input); reader.setSeries(0); OMETiffWriter writer = this.initialiseWriter(this.output, reader); int index; writer.setSeries(0); for (int y = 0; y < reader.getSizeY(); y++) { ByteBuffer bufferXZ = ByteBuffer.allocate( (int) (0.125 * reader.getBitsPerPixel()) * reader.getSizeX() * reader.getSizeZ()); for (int z = 0; z < reader.getSizeZ(); z++) { index = reader.getIndex(z, 0, 0); byte[] line = reader.openBytes( index, 0, y, reader.getSizeX(), 1); bufferXZ.put(line); } <START> log.info("y: {}, {}", y, bufferXZ.array().length); <END> writer.saveBytes(y, bufferXZ.array()); } writer.setSeries(1); for (int x = 0; x < reader.getSizeX(); x++) { ByteBuffer bufferYZ = ByteBuffer.allocate( (int) (0.125 * reader.getBitsPerPixel()) * reader.getSizeY() * reader.getSizeZ()); for (int z = 0; z < reader.getSizeZ(); z++) { index = reader.getIndex(z, 0, 0); byte[] line = reader.openBytes( index, x, 0, 1, reader.getSizeY()); bufferYZ.put(line); } log.info("x: {}, {}", x, bufferYZ.array().length); writer.saveBytes(x, bufferYZ.array()); } reader.close(); writer.close(); }</code><technical_language>debug is input argument, this information put log.debug level</technical_language>

Target:
private void readOrthogonalPlanes() throws Exception { ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger)LoggerFactory.getLogger( Logger.ROOT_LOGGER_NAME); if (debug) { root.setLevel(Level.DEBUG); } else { root.setLevel(Level.INFO); } ImageReader reader = this.initialiseReader(this.input); reader.setSeries(0); OMETiffWriter writer = this.initialiseWriter(this.output, reader); int index; writer.setSeries(0); for (int y = 0; y < reader.getSizeY(); y++) { ByteBuffer bufferXZ = ByteBuffer.allocate( (int) (0.125 * reader.getBitsPerPixel()) * reader.getSizeX() * reader.getSizeZ()); for (int z = 0; z < reader.getSizeZ(); z++) { index = reader.getIndex(z, 0, 0); byte[] line = reader.openBytes( index, 0, y, reader.getSizeX(), 1); bufferXZ.put(line); } log.debug("y: {}, {}", y, bufferXZ.array().length); writer.saveBytes(y, bufferXZ.array()); } writer.setSeries(1); for (int x = 0; x < reader.getSizeX(); x++) { ByteBuffer bufferYZ = ByteBuffer.allocate( (int) (0.125 * reader.getBitsPerPixel()) * reader.getSizeY() * reader.getSizeZ()); for (int z = 0; z < reader.getSizeZ(); z++) { index = reader.getIndex(z, 0, 0); byte[] line = reader.openBytes( index, x, 0, 1, reader.getSizeY()); bufferYZ.put(line); } log.debug("x: {}, {}", x, bufferYZ.array().length); writer.saveBytes(x, bufferYZ.array()); } reader.close(); writer.close(); }
Source:
<code><START> String getServerActualContextId(final String planContextId) { <END> return serverEvalIdToCtx.containsKey(planContextId) ? serverEvalIdToCtx.get(planContextId).getId() : planContextId; }</code><technical_language>this method contextId a key for serverEvalIdToCtx key is evaluator id</technical_language>

Target:
String getServerActualContextId(final String planContextId) { return ctxIdToAddedServerCtx.containsKey(planContextId) ? ctxIdToAddedServerCtx.get(planContextId).getId() : planContextId; }
Source:
<code>public void showFAQ(Activity activity, Tag origin) { if (origin == null) { origin = Tag.ORIGIN_UNKNOWN; } Map<String, Object> properties = new HashMap<String, Object>(); properties.put(HELPSHIFT_SCREEN_KEY, "faq"); properties.put(HELPSHIFT_ORIGIN_KEY, origin.toString()); AnalyticsTracker.track(Stat.SUPPORT_OPENED_HELPSHIFT_SCREEN, properties); <START> addPlanTags(); <END> addTags(new Tag[]{origin}); HashMap config = getHelpshiftConfig(activity); Support.showFAQs(activity, config); }</code><technical_language>addPlanTags() depend enclosing function parameters so, sense add once, getHelpshiftConfig(). if missing here! Thanks</technical_language>

Target:
public void showFAQ(Activity activity, Tag origin) { if (origin == null) { origin = Tag.ORIGIN_UNKNOWN; } Map<String, Object> properties = new HashMap<String, Object>(); properties.put(HELPSHIFT_SCREEN_KEY, "faq"); properties.put(HELPSHIFT_ORIGIN_KEY, origin.toString()); AnalyticsTracker.track(Stat.SUPPORT_OPENED_HELPSHIFT_SCREEN, properties); addTags(new Tag[]{origin}); HashMap config = getHelpshiftConfig(activity); Support.showFAQs(activity, config); }
Source:
<code>protected Long getAgent() { Long agentId = getRawAgentId(); if (agentId != null) { <START> log.error("getAgent(): [{}]", agentId); <END> return agentId; } String type = ApiContext.getContext().getApiRequest().getSchemaFactory().getSchemaName(Agent.class); ResourceManager rm = getLocator().getResourceManagerByType(type); List<?> list = rm.list(type, null, Pagination.limit(2)); if (list.size() != 1) { throw new ValidationErrorException(ValidationErrorCodes.MISSING_REQUIRED, "agentId"); } Object agent = list.get(0); if (!(agent instanceof Agent) || !STATES.contains(((Agent) agent).getState())) throw new ValidationErrorException(ValidationErrorCodes.MISSING_REQUIRED, "agentId"); return ((Agent) agent).getId(); }</code><technical_language>log error here</technical_language>

Target:
protected Long getAgent() { Long agentId = getRawAgentId(); if (agentId != null) { return agentId; } String type = ApiContext.getContext().getApiRequest().getSchemaFactory().getSchemaName(Agent.class); ResourceManager rm = getLocator().getResourceManagerByType(type); List<?> list = rm.list(type, null, Pagination.limit(2)); if (list.size() > 0) { if (list.size() > 1) { throw new ValidationErrorException(ValidationErrorCodes.MISSING_REQUIRED, "agentId"); } Object agent = list.get(0); if ((agent instanceof Agent) || STATES.contains(((Agent) agent).getState())) { return ((Agent) agent).getId(); } } return null; }
Source:
<code>public Optional<URL> findFullText(BibEntry entry) throws IOException { Objects.requireNonNull(entry); <START> Optional<DOI> doi = entry.getDOI(); <END> if (doi.isPresent()) { String id; try { id = getId(doi.get().getDOI()); } catch (FileNotFoundException e) { return Optional.empty(); } String pdfRequest = PDF_URL + id; int code = Unirest.get(pdfRequest).asJson().getStatus(); if (code == 200) { LOGGER.info("Fulltext PDF found @ APS."); return Optional.of(new URL(pdfRequest)); } } return Optional.empty(); }</code><technical_language>do in a single statement: java return entry.getDOI().map(doi -> { ... if (code == 200) { ... } else { return Optional.empty(); } });</technical_language>

Target:
public Optional<URL> findFullText(BibEntry entry) throws IOException { Objects.requireNonNull(entry); return entry.getDOI().map(doi -> { String id; try { id = getId(doi.getDOI()); } catch (FileNotFoundException e) { return null; } catch (IOException e) { throw new UncheckedIOException(e); } String pdfRequest = PDF_URL + id; int code = Unirest.get(pdfRequest).asJson().getStatus(); if (code == 200) { LOGGER.info("Fulltext PDF found @ APS."); try { return new URL(pdfRequest); } catch (MalformedURLException e) { LOGGER.info("APS returned malformed URL, cannot find PDF."); return null; } } else { return null; } }); }
Source:
<code>public void execute() { BasePanel basePanel = jabRefFrame.getCurrentBasePanel(); List<BibEntry> selectedEntries = basePanel.getSelectedEntries(); if (selectedEntries.size() != 2) { dialogService.showInformationDialogAndWait( Localization.lang("Merge entries"), Localization.lang("You have to choose exactly two entries to merge.")); return; } BibEntry one = selectedEntries.get(0); BibEntry two = selectedEntries.get(1); MergeEntriesDialog dlg = new MergeEntriesDialog(one, two, basePanel.getBibDatabaseContext().getMode()); dlg.setTitle(Localization.lang("Merge entries")); Optional<BibEntry> mergedEntry = dlg.showAndWait(); if (mergedEntry.isPresent()) { basePanel.insertEntry(mergedEntry.get()); NamedCompound ce = new NamedCompound(Localization.lang("Merge entries")); ce.addEdit(new UndoableInsertEntry(basePanel.getDatabase(), mergedEntry.get())); List<BibEntry> entriesToRemove = new ArrayList<>(); <START> entriesToRemove.add(one); <END> entriesToRemove.add(two); ce.addEdit(new UndoableRemoveEntries(basePanel.getDatabase(), entriesToRemove)); basePanel.getDatabase().removeEntries(entriesToRemove); ce.end(); basePanel.getUndoManager().addEdit(ce); dialogService.notify(Localization.lang("Merged entries")); } else { dialogService.notify(Localization.lang("Canceled merging entries")); } }</code><technical_language>Arrays.asList(one, two)</technical_language>

Target:
public void execute() { BasePanel basePanel = jabRefFrame.getCurrentBasePanel(); List<BibEntry> selectedEntries = basePanel.getSelectedEntries(); if (selectedEntries.size() != 2) { dialogService.showInformationDialogAndWait( Localization.lang("Merge entries"), Localization.lang("You have to choose exactly two entries to merge.")); return; } BibEntry one = selectedEntries.get(0); BibEntry two = selectedEntries.get(1); MergeEntriesDialog dlg = new MergeEntriesDialog(one, two, basePanel.getBibDatabaseContext().getMode()); dlg.setTitle(Localization.lang("Merge entries")); Optional<BibEntry> mergedEntry = dlg.showAndWait(); if (mergedEntry.isPresent()) { basePanel.insertEntry(mergedEntry.get()); NamedCompound ce = new NamedCompound(Localization.lang("Merge entries")); ce.addEdit(new UndoableInsertEntry(basePanel.getDatabase(), mergedEntry.get())); List<BibEntry> entriesToRemove = Arrays.asList(one, two); ce.addEdit(new UndoableRemoveEntries(basePanel.getDatabase(), entriesToRemove)); basePanel.getDatabase().removeEntries(entriesToRemove); ce.end(); basePanel.getUndoManager().addEdit(ce); dialogService.notify(Localization.lang("Merged entries")); } else { dialogService.notify(Localization.lang("Canceled merging entries")); } }
Source:
<code>protected String[] getAllProtocols() { <START> return WolfSSL.getProtocolsMask(ssl.getOptions()); <END> }</code><technical_language>consider adding a check "ssl" for null calling "getOptions()" prevent a NullPointerException. fall "WolfSSL.getProtocols()" if "ssl" is null? call getProtocolMask(0)</technical_language>

Target:
protected String[] getAllProtocols() { if(ssl != null) return WolfSSL.getProtocolsMask(ssl.getOptions()); else return WolfSSL.getProtocols(); }
Source:
<code>public Future<File> submit(Topology app, Map<String, Object> config) throws Exception { <START> if (config == null) <END> config = new HashMap<>(); if (!config.containsKey(ContextProperties.TOOLKIT_DIR)) { config.put(ContextProperties.TOOLKIT_DIR, Files .createTempDirectory(Paths.get(""), "tk").toAbsolutePath().toString()); } File toolkitRoot = super.submit(app, config).get(); Path zipOutPath = Paths.get(toolkitRoot.getAbsolutePath() + ".zip"); pack(toolkitRoot.toPath(), zipOutPath); return new CompletedFuture<File>(zipOutPath.toFile()); }</code><technical_language>lines 28 3^ needed, super.submit() call does? need repeat them</technical_language>

Target:
public Future<File> submit(Topology app, Map<String, Object> config) throws Exception { File toolkitRoot = super.submit(app, config).get(); Path zipOutPath = pack(toolkitRoot.toPath()); JSONObject jso = new OrderedJSONObject(); addConfigToJSON(jso, config); return deleteToolkitAndProduceCompletedFuture(toolkitRoot, jso, zipOutPath); }
Source:
<code>private List<CellTsPairInfo> loadNextPage() { try (ConnectionSupplier conns = new ConnectionSupplier(connectionPool); AgnosticLightResultSet resultSet = selectNextPage(conns)) { List<CellTsPairInfo> ret = new ArrayList<>(); for (AgnosticLightResultRow row : resultSet) { Preconditions.checkState(AgnosticLightResultRowImpl.class.isInstance(row), "Expected row to be of type AgnosticLightResultRowImpl, but found unknown type : " <START> + row.getClass().toString()); <END> byte[] rowName = row.getBytes("row_name"); byte[] colName = row.getBytes("col_name"); if (request.shouldCheckIfLatestValueIsEmpty()) { long[] sortedTimestamps = castAndSortTimestamps( (Object[]) ((AgnosticLightResultRowImpl) row).getArray("timestamps")); boolean isLatestValEmpty = row.getBoolean("latest_val_empty"); for (int i = 0; i < sortedTimestamps.length - 1; ++i) { ret.add(new CellTsPairInfo(rowName, colName, sortedTimestamps[i], false)); } ret.add(new CellTsPairInfo( rowName, colName, sortedTimestamps[sortedTimestamps.length - 1], isLatestValEmpty)); } else { long ts = row.getLong("ts"); ret.add(new CellTsPairInfo(rowName, colName, ts, false)); } } return ret; } }</code><technical_language>nit: preconditions %s style formatting</technical_language>

Target:
private List<CellTsPairInfo> loadNextPage() { try (ConnectionSupplier conns = new ConnectionSupplier(connectionPool); AgnosticLightResultSet resultSet = selectNextPage(conns)) { List<CellTsPairInfo> ret = new ArrayList<>(); for (AgnosticLightResultRow row : resultSet) { Preconditions.checkState(AgnosticLightResultRowImpl.class.isInstance(row), "Expected row to be of type AgnosticLightResultRowImpl, but found unknown type %s", row.getClass().toString()); byte[] rowName = row.getBytes("row_name"); byte[] colName = row.getBytes("col_name"); if (request.shouldCheckIfLatestValueIsEmpty()) { long[] sortedTimestamps = castAndSortTimestamps( (Object[]) ((AgnosticLightResultRowImpl) row).getArray("timestamps")); boolean isLatestValEmpty = row.getBoolean("latest_val_empty"); for (int i = 0; i < sortedTimestamps.length - 1; ++i) { ret.add(new CellTsPairInfo(rowName, colName, sortedTimestamps[i], false)); } ret.add(new CellTsPairInfo( rowName, colName, sortedTimestamps[sortedTimestamps.length - 1], isLatestValEmpty)); } else { long ts = row.getLong("ts"); ret.add(new CellTsPairInfo(rowName, colName, ts, false)); } } return ret; } }
Source:
<code>public void close() throws IOException { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Closing backingStream and response {}", this.backingStream, httpResponse); } if (backingStream instanceof EofSensorInputStream) { ((EofSensorInputStream) backingStream).close(); closeHttpResponse(); } else { try { if (backingStream != null) { backingStream.close(); } } catch (IOException e) { <START> closeHttpResponse(); <END> } finally { closeHttpResponse(); } } }</code><technical_language>this call superfluous closeHttpResponse called in finally block regardless</technical_language>

Target:
public void close() throws IOException { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Closing backingStream and response {}", this.backingStream, httpResponse); } if (backingStream instanceof EofSensorInputStream) { ((EofSensorInputStream) backingStream).close(); closeHttpResponse(); } else { try { if (backingStream != null) { backingStream.close(); } } catch (IOException e) { MantaIOException mio = new MantaResourceCloseException(e); LOGGER.error("Unable to close backing stream", mio); } finally { closeHttpResponse(); } } }
Source:
<code>public boolean onPrepareActionMode(ActionMode mode, Menu menu) { mode.setTag(TAB_ACTION_MODE_TAG); <START> parentActivity.getContext().findViewById(R.id.action_mode_bar).setClickable(true); <END> return false; }</code><technical_language>This dependency difficult track Activities implement findViewById() Activities a View action_mode_bar ID. I recommend adding another callback, getActionBar(), that</technical_language>

Target:
public boolean onPrepareActionMode(ActionMode mode, Menu menu) { mode.setTag(TAB_ACTION_MODE_TAG); getActionBar().setClickable(true); return false; }
Source:
<code>void hideLoadingPopup() { <START> @SuppressWarnings("GwtToHtmlReferences") <END> final Element e = RootPanel.get( "loading" ).getElement(); new Animation() { @Override protected void onUpdate( double progress ) { e.getStyle().setOpacity( 1.0 - progress ); } @Override protected void onComplete() { e.getStyle().setVisibility( Style.Visibility.HIDDEN ); } }.run( 500 ); }</code><technical_language>@paulovmr in future move this uberfire</technical_language>

Target:
public void hideLoadingPopup() { @SuppressWarnings("GwtToHtmlReferences") final Element e = RootPanel.get( "loading" ).getElement(); new Animation() { @Override protected void onUpdate( double progress ) { e.getStyle().setOpacity( 1.0 - progress ); } @Override protected void onComplete() { e.getStyle().setVisibility( Style.Visibility.HIDDEN ); } }.run( 500 ); }
Source:
<code>public void catchesExceptionThrownByResponse() throws Exception { final Take take = <START> request -> new RsOf( <END> () -> new RsEmpty().head(), () -> { throw new RsForward("/b"); } ); MatcherAssert.assertThat( new RsPrint( new TkForward(take).act(new RqFake()) ).print(), Matchers.startsWith("HTTP/1.1 303") ); }</code><technical_language>@fanifieiev above</technical_language>

Target:
public void catchesExceptionThrownByResponse() throws Exception { final Take take = request -> new ResponseOf( () -> new RsEmpty().head(), () -> { throw new RsForward("/b"); } ); MatcherAssert.assertThat( new RsPrint( new TkForward(take).act(new RqFake()) ).print(), Matchers.startsWith("HTTP/1.1 303") ); }
Source:
<code>public final FunctionDesc getFunction(final String signature, FunctionType funcType, DataType... paramTypes) throws UndefinedFunctionException { final GetFunctionMetaRequest.Builder builder = GetFunctionMetaRequest.newBuilder(); builder.setSignature(signature); if (funcType != null) { builder.setFunctionType(funcType); } for (DataType type : paramTypes) { builder.addParameterTypes(type); } FunctionDescResponse response = null; try { final BlockingInterface stub = getStub(); response = stub.getFunctionMeta(null, builder.build()); } catch (ServiceException se) { throw new RuntimeException(se); } if (isThisError(response.getState(), ResultCode.UNDEFINED_FUNCTION)) { throw new UndefinedFunctionException(signature, paramTypes); <START> } else if (isThisError(response.getState(), ResultCode.AMBIGUOUS_FUNCTION)) { <END> throw new DuplicateFunctionException(signature, paramTypes); } ensureOk(response.getState()); try { return new FunctionDesc(response.getFunction()); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } }</code><technical_language>ResultCode DUPLICATE_FUNCTION</technical_language>

Target:
public final FunctionDesc getFunction(final String signature, FunctionType funcType, DataType... paramTypes) throws UndefinedFunctionException { final GetFunctionMetaRequest.Builder builder = GetFunctionMetaRequest.newBuilder(); builder.setSignature(signature); if (funcType != null) { builder.setFunctionType(funcType); } for (DataType type : paramTypes) { builder.addParameterTypes(type); } FunctionResponse response = null; try { final BlockingInterface stub = getStub(); response = stub.getFunctionMeta(null, builder.build()); } catch (ServiceException se) { throw new RuntimeException(se); } if (isThisError(response.getState(), ResultCode.UNDEFINED_FUNCTION)) { throw new UndefinedFunctionException(signature, paramTypes); } else if (isThisError(response.getState(), ResultCode.AMBIGUOUS_FUNCTION)) { throw new AmbiguousFunctionException(signature, paramTypes); } ensureOk(response.getState()); try { return new FunctionDesc(response.getFunction()); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } }
Source:
<code>public UploadDirectoryToCDN(String username, String apiKey) { Iterable<Module> modules = ImmutableSet.<Module> of(new SLF4JLoggingModule()); BlobStoreContext context = ContextBuilder.newBuilder(PROVIDER) .credentials(username, apiKey) .modules(modules) .buildView(BlobStoreContext.class); storage = context.getBlobStore(); <START> rackspace = context.unwrap(CloudFilesApiMetadata.CONTEXT_TOKEN).getApi(); <END> }</code><technical_language>unwrapApi work for some reason? curious...it a nice example of new call, I ask..</technical_language>

Target:
public UploadDirectoryToCDN(String username, String apiKey) { BlobStoreContext context = ContextBuilder.newBuilder(PROVIDER) .credentials(username, apiKey) .buildView(BlobStoreContext.class); storage = context.getBlobStore(); rackspace = context.unwrap(CloudFilesApiMetadata.CONTEXT_TOKEN).getApi(); }
Source:
<code>private void updateData(TextView textBox, int meassuredValue) { if (meassuredValue == distanceID) { textBox.setText(String.format("%.3f", distance / 1000)); } else if (meassuredValue == paceID) { if (pace < 30) { double rest = pace - (int) pace; rest = rest * 60; String secondsZero = (rest < 10) ? "0" : ""; textBox.setText(String.format("%.0f:%s%.0f", pace, secondsZero, rest)); } else { <START> textBox.setText("--------"); <END> } } else if (meassuredValue == avgPaceID) { if (avgPace < 30) { double rest = avgPace - (int) avgPace; rest = rest * 60; String secondsZero = (rest < 10) ? "0" : ""; textBox.setText(String.format("%.0f:%s%.0f", avgPace, secondsZero, rest)); } else { textBox.setText("--------"); } } else if (meassuredValue == timeID) { long hours = time / 3600000; long minutes = (time / 60000) - hours * 60; long seconds = (time / 1000) - hours * 3600 - minutes * 60; String hourZero = (hours < 10) ? "0" : ""; String minutesZero = (minutes < 10) ? "0" : ""; String secondsZero = (seconds < 10) ? "0" : ""; textBox.setText(String.format("%s%d:%s%d:%s%d", hourZero, hours, minutesZero, minutes, secondsZero, seconds)); } }</code><technical_language>String resources</technical_language>

Target:
private void updateData(TextView textBox, int meassuredValue) { switch (meassuredValue) { case distanceID: textBox.setText(String.format("%.3f", distance / 1000)); break; case paceID: if (pace < 30) { double rest = pace - (int) pace; rest = rest * 60; String secondsZero = (rest < 10) ? "0" : ""; textBox.setText(String.format("%.0f:%s%.0f", pace, secondsZero, rest)); } else { textBox.setText(getResources().getString(R.string.dashes)); } break; case avgPaceID: if (avgPace < 30) { double rest = avgPace - (int) avgPace; rest = rest * 60; String secondsZero = (rest < 10) ? "0" : ""; textBox.setText(String.format("%.0f:%s%.0f", avgPace, secondsZero, rest)); } else { textBox.setText(getResources().getString(R.string.dashes)); } break; case timeID: long hours = time / 3600000; long minutes = (time / 60000) - hours * 60; long seconds = (time / 1000) - hours * 3600 - minutes * 60; String hourZero = (hours < 10) ? "0" : ""; String minutesZero = (minutes < 10) ? "0" : ""; String secondsZero = (seconds < 10) ? "0" : ""; textBox.setText(String.format("%s%d:%s%d:%s%d", hourZero, hours, minutesZero, minutes, secondsZero, seconds)); break; } }
Source:
<code>public static void registerTerminated(String name, Collection<LogPartition> partitions, LogOffset logOffset, RetryPolicy retryPolicy, long timestamp) { <START> contextes.add(new ComputationRunnerTerminatedContext(name, logOffset, timestamp, retryPolicy, partitions)); <END> }</code><technical_language>I plural of context is contexts LinkedList thread safe</technical_language>

Target:
public static void registerTerminated(String name, Collection<LogPartition> partitions, LogOffset logOffset, RetryPolicy retryPolicy, long timestamp) { contexts.add(new ComputationRunnerTerminatedContext(name, logOffset, timestamp, retryPolicy, partitions)); }
Source:
<code>public synchronized <M extends Externalizable> LogAppender<M> getAppender(String name, Codec<M> codec) { LogAppender<M> ret = (LogAppender<M>) appenders.computeIfAbsent(name, n -> { if (exists(n)) { return createAppender(n, codec); } throw new IllegalArgumentException("Unknown Log name: " + n); }); if (codec == null) { return ret; } if (ret.getCodec() == null) { throw new IllegalArgumentException(String.format( "The appender for Log %s exists with a default codec, cannot use a different codec: %s", name, codec.getClass())); } <START> if (!ret.getCodec().getClass().getName().equals(codec.getClass().getName())) { <END> throw new IllegalArgumentException( String.format("The appender for Log %s exists with a %s codec, cannot use a different codec: %s", name, codec.getClass(), ret.getCodec().getClass())); } return ret; }</code><technical_language>check for class equality directly</technical_language>

Target:
public synchronized <M extends Externalizable> LogAppender<M> getAppender(String name, Codec<M> codec) { LogAppender<M> ret = (LogAppender<M>) appenders.computeIfAbsent(name, n -> { if (exists(n)) { return createAppender(n, codec); } throw new IllegalArgumentException("Unknown Log name: " + n); }); if (NO_CODEC.equals(codec) || sameCodec(ret.getCodec(), codec)) { return ret; } throw new IllegalArgumentException(String.format( "The appender for Log %s exists and expecting codec: %s, cannot use a different codec: %s", name, ret.getCodec(), codec)); }
Source:
<code>public synchronized ResourceRequest getNextResourceRequest() { for (ResourceRequest rr: resourceRequestMap.get(schedulerKeys.first()).values()) { <START> return rr; <END> } return null; }</code><technical_language>please exit point</technical_language>

Target:
public synchronized ResourceRequest getNextResourceRequest() { for (ResourceRequest rr: resourceRequestMap.get(schedulerKeys.firstKey()).values()) { return rr; } return null; }
Source:
<code>public void makeAPIKeysForwardCompatible(API api) throws APIManagementException { String provider = api.getId().getProviderName(); String apiName = api.getId().getApiName(); Set<String> versions = getAPIVersions(provider, apiName); APIVersionComparator comparator = new APIVersionComparator(); List<API> sortedAPIs = new ArrayList<API>(); for (String version : versions) { API otherApi = getAPI(new APIIdentifier(provider, apiName, version)); if (comparator.compare(otherApi, api) < 0 && !APIConstants.RETIRED.equals(otherApi.getStatus())) { sortedAPIs.add(otherApi); } } Collections.sort(sortedAPIs, comparator); for (int i = sortedAPIs.size() - 1; i >= 0; i--) { String oldVersion = sortedAPIs.get(i).getId().getVersion(); apiMgtDAO.makeKeysForwardCompatible(new ApiTypeWrapper(api), oldVersion ); } int apiId = apiMgtDAO.getAPIID(api.getId(), null); <START> APIEvent apiEvent = new APIEvent(UUID.randomUUID().toString(), System.currentTimeMillis(), <END> APIConstants.EventType.API_UPDATE.name(), tenantId, api.getId().getApiName(), apiId, api.getId().getVersion(), api.getType(), api.getContext(), api.getId().getProviderName(), api.getStatus()); APIUtil.sendNotification(apiEvent, APIConstants.NotifierType.API.name()); }</code><technical_language>hv send subscription related events</technical_language>

Target:
public void makeAPIKeysForwardCompatible(API api) throws APIManagementException { String provider = api.getId().getProviderName(); String apiName = api.getId().getApiName(); Set<String> versions = getAPIVersions(provider, apiName); APIVersionComparator comparator = new APIVersionComparator(); List<API> sortedAPIs = new ArrayList<API>(); for (String version : versions) { API otherApi = getAPI(new APIIdentifier(provider, apiName, version)); if (comparator.compare(otherApi, api) < 0 && !APIConstants.RETIRED.equals(otherApi.getStatus())) { sortedAPIs.add(otherApi); } } Collections.sort(sortedAPIs, comparator); for (int i = sortedAPIs.size() - 1; i >= 0; i--) { String oldVersion = sortedAPIs.get(i).getId().getVersion(); apiMgtDAO.makeKeysForwardCompatible(new ApiTypeWrapper(api), oldVersion); } }
Source:
<code>public void pruneCandidateFactSet(CubeTableCause pruneCause) { for (Iterator<Set<CandidateFact>> i = candidateFactSets.iterator(); i.hasNext();) { Set<CandidateFact> cfacts = i.next(); if (!candidateFacts.containsAll(cfacts)) { <START> LOG.info("Not considering fact table set:" + cfacts + <END> " as they have non candidate tables and cause:" + pruneCause); i.remove(); } } }</code><technical_language>Confusing log message</technical_language>

Target:
public void pruneCandidateFactSet(CubeTableCause pruneCause) { for (Iterator<Set<CandidateFact>> i = candidateFactSets.iterator(); i.hasNext();) { Set<CandidateFact> cfacts = i.next(); if (!candidateFacts.containsAll(cfacts)) { LOG.info("Not considering fact table set:" + cfacts + " as they have non candidate tables and facts missing because of" + pruneCause); i.remove(); } } }
Source:
<code>JMXAttribute(MBeanAttributeInfo attribute, ObjectInstance jmxInstance, String instanceName, Connection connection, HashMap<String, String> instanceTags) { this.attribute = attribute; this.jmxInstance = jmxInstance; this.matchingConf = null; this.connection = connection; this.beanName = jmxInstance.getObjectName().toString(); this.attributeName = attribute.getName(); String[] splitBeanName = this.beanName.split(":"); String domain = splitBeanName[0]; String beanParameters = splitBeanName[1]; <START> LinkedList<String> beanParametersList = beanParametersToTagsList(instanceName, domain, beanParameters, instanceTags); <END> HashMap<String, String> beanParametersHash = beanParameterstoHash(beanParametersList); this.domain = domain; this.beanParameters = beanParametersHash; this.defaultTagsList = beanParametersList; }</code><technical_language>This called defaultTags</technical_language>

Target:
JMXAttribute(MBeanAttributeInfo attribute, ObjectInstance jmxInstance, String instanceName, Connection connection, HashMap<String, String> instanceTags) { this.attribute = attribute; this.jmxInstance = jmxInstance; this.matchingConf = null; this.connection = connection; this.beanName = jmxInstance.getObjectName().toString(); this.attributeName = attribute.getName(); String[] splitBeanName = this.beanName.split(":"); String domain = splitBeanName[0]; String beanParameters = splitBeanName[1]; LinkedList<String> defaultTags = getBeanTags(instanceName, domain, beanParameters, instanceTags); HashMap<String, String> beanParametersHash = getBeanParametersHash(defaultTags); this.domain = domain; this.beanParameters = beanParametersHash; this.defaultTagsList = defaultTags; }
Source:
<code>protected void addVmCinderDisks(List<CinderDisk> templateDisks) { List<CinderDisk> cinderDisks = ImagesHandler.filterDisksBasedOnCinder(templateDisks); Future<VdcReturnValueBase> future = CommandCoordinatorUtil.executeAsyncCommand( VdcActionType.CloneCinderDisks, buildCinderChildCommandParameters(cinderDisks, getVmSnapshotId()), cloneContextAndDetachFromParent()); try { Map<Guid, Guid> diskImageMap = future.get().getActionReturnValue(); srcDiskIdToTargetDiskIdMapping.putAll(diskImageMap); } catch <START> (InterruptedException | ExecutionException e) { log.debug("Exception", <END> e); } }</code><technical_language>error debug, please add a logical explenation</technical_language>

Target:
protected void addVmCinderDisks(List<CinderDisk> templateDisks) { List<CinderDisk> cinderDisks = ImagesHandler.filterDisksBasedOnCinder(templateDisks); Future<VdcReturnValueBase> future = CommandCoordinatorUtil.executeAsyncCommand( VdcActionType.CloneCinderDisks, buildCinderChildCommandParameters(cinderDisks, getVmSnapshotId()), cloneContextAndDetachFromParent()); try { Map<Guid, Guid> diskImageMap = future.get().getActionReturnValue(); srcDiskIdToTargetDiskIdMapping.putAll(diskImageMap); } catch (InterruptedException | ExecutionException e) { log.error("Error cloning Cinder disks from template disks.", e); } }
Source:
<code>public Asset() { <START> super(); <END> getAttributes().setType("Asset"); }</code><technical_language>Nitpicking suggestion</technical_language>

Target:
public Asset() { getAttributes().setType("Asset"); }
Source:
<code>public static void displayOpi(OpiTarget opiTarget, String id) throws OPIViewCreationException { IWorkbenchPage workbenchPage = null; IViewPart view = null; try { workbenchPage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); view = workbenchPage.showView(id, opiTarget.name(), IWorkbenchPage.VIEW_ACTIVATE); OpiTargetView viewAsOPITarget = (OpiTargetView) view; viewAsOPITarget.setOpi(opiTarget); viewAsOPITarget.setPartName(opiTarget.name()); openOPIs.add(view); openOPIsWorkbenchPage.add(workbenchPage.getPerspective()); } catch (PartInitException e) { LOG.catching(e); <START> e.printStackTrace(); <END> } catch (OPIViewCreationException e) { workbenchPage.hideView(view); throw e; } }</code><technical_language>Is this required</technical_language>

Target:
public static void displayOpi(OpiTarget opiTarget, String id) throws OPIViewCreationException { IWorkbenchPage workbenchPage = null; IViewPart view = null; try { workbenchPage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); view = workbenchPage.showView(id, opiTarget.name(), IWorkbenchPage.VIEW_ACTIVATE); OpiTargetView viewAsOPITarget = (OpiTargetView) view; viewAsOPITarget.setOpi(opiTarget); viewAsOPITarget.setPartName(opiTarget.name()); openOPIs.add(view); openOPIsWorkbenchPage.add(workbenchPage.getPerspective()); } catch (PartInitException e) { LOG.catching(e); } catch (OPIViewCreationException e) { workbenchPage.hideView(view); throw e; } }
Source:
<code><START> public String toString() <END> { return toStringHelper(this) .add("count", count) .add("orderingScheme", orderingScheme) .toString(); }</code><technical_language>I understand this change. surprising me, commit is replacing fields in TopNNode single equivalent composite</technical_language>

Target:
public String toString() { return toStringHelper(this) .add("count", count) .add("orderBy", orderBy) .toString(); }
Source:
<code>public void waitForInitialStateTransferToComplete() throws Exception { if (configuration.clustering().stateTransfer().awaitInitialTransfer()) { if (!localTopologyManager.isCacheRebalancingEnabled(cacheName)) { initialStateTransferComplete.countDown(); } if (trace) log.tracef("Waiting for initial state transfer to finish for cache %s on %s", cacheName, rpcManager.getAddress()); <START> boolean success = initialStateTransferComplete.await(100 * configuration.clustering().stateTransfer().timeout(), TimeUnit.MILLISECONDS); <END> if (!success) { throw new CacheException(String.format("Initial state transfer timed out for cache %s on %s", cacheName, rpcManager.getAddress())); } } }</code><technical_language>Need undo? Guessing this for testing purposes</technical_language>

Target:
public void waitForInitialStateTransferToComplete() throws Exception { if (configuration.clustering().stateTransfer().awaitInitialTransfer()) { if (!localTopologyManager.isCacheRebalancingEnabled(cacheName)) { initialStateTransferComplete.countDown(); } if (trace) log.tracef("Waiting for initial state transfer to finish for cache %s on %s", cacheName, rpcManager.getAddress()); boolean success = initialStateTransferComplete.await(configuration.clustering().stateTransfer().timeout(), TimeUnit.MILLISECONDS); if (!success) { throw new CacheException(String.format("Initial state transfer timed out for cache %s on %s", cacheName, rpcManager.getAddress())); } } }