auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void addDepsAndFolder( IJFolderFactory folderFactory, DependencyType dependencyType, TargetNode<T, ?> targetNode, boolean wantsPackagePrefix, ModuleBuildContext context) { ImmutableMultimap<Path, Path> foldersToInputsIndex = getSourceFoldersToInputsIndex(targetNode.getInputs()); if (targetNode.getConstructorArg() instanceof JavaLibraryDescriptionArg) { JavaLibraryDescriptionArg javaLibraryArg = (JavaLibraryDescriptionArg) targetNode.getConstructorArg(); Optional<Path> resourcesRoot = javaLibraryArg.getResourcesRoot(); if (resourcesRoot.isPresent()) { ImmutableSet<Path> resources = javaLibraryArg.getResources().stream() .map(sourcePath -> (sourcePath instanceof PathSourcePath) ? ((PathSourcePath) sourcePath).getRelativePath() : null) .filter(Objects::nonNull) .filter(path -> path.startsWith(resourcesRoot.get())) .collect(MoreCollectors.toImmutableSet()); foldersToInputsIndex = foldersToInputsIndex.entries().stream() .filter(entry -> !resources.contains(entry.getValue())) .collect(MoreCollectors.toImmutableMultimap(Map.Entry::getKey, Map.Entry::getValue)); addSourceFolders( JavaResourceFolder.getFactoryWithResourcesRoot(resourcesRoot.get()), getSourceFoldersToInputsIndex(resources), wantsPackagePrefix, context); } } addSourceFolders(folderFactory, foldersToInputsIndex, wantsPackagePrefix, context); addDeps(foldersToInputsIndex, targetNode, dependencyType, context); addGeneratedOutputIfNeeded(folderFactory, targetNode, context); if (targetNode.getConstructorArg() instanceof JvmLibraryArg) { addAnnotationOutputIfNeeded(folderFactory, targetNode, context); } }

Target:
private void addDepsAndFolder( IJFolderFactory folderFactory, DependencyType dependencyType, TargetNode<T, ?> targetNode, boolean wantsPackagePrefix, ModuleBuildContext context) { addDepsAndFolder( folderFactory, dependencyType, targetNode, wantsPackagePrefix, context, ImmutableSet.of()); }
Source:
private void buildIndexItem(String deweyID, String type, String[] result, String parentPath) { IndexElement test = new IndexElement(deweyID, type, result[1]); String path = test.epath(); path = StringUtils.replace(path, parentPath, ""); parentPath = parentPath.replaceAll("/", "."); if (!type.equals("doc")) { int colon = path.indexOf("/"); path = path.replaceFirst("/", ":"); } else { parentPath = ""; } path = path.replaceAll("/", "."); String fullItem = parentPath + path + "." + test.type(); results.add(new ComplexItem(new StringField("item", fullItem, Field.Store.YES), test.id())); }

Target:
private void buildIndexItem(String deweyID, String type, String[] result, String parentPath) { IndexElement test = new IndexElement(deweyID, type, result[1]); String path = test.epath(); path = StringUtils.replace(path, parentPath, ""); String luceneParentPath = parentPath.replaceAll("/", "."); if (!type.equals("doc")) { path = path.replaceFirst("/", ":"); } else { luceneParentPath = ""; } path = path.replaceAll("/", "."); String fullItem = luceneParentPath + path + "." + test.type(); results.add(new ComplexItem(new StringField("item", fullItem, Field.Store.YES), test.id())); }
Source:
public void typeProcessingStart() { try { super.typeProcessingStart(); initChecker(); if (this.messager == null) { messager = processingEnv.getMessager(); messager.printMessage( Kind.WARNING, "You have forgotten to call super.initChecker in your " + "subclass of SourceChecker, " + this.getClass() + "! Please ensure your checker is properly initialized."); } if (shouldAddShutdownHook()) { Runtime.getRuntime() .addShutdownHook( new Thread() { @Override public void run() { shutdownHook(); } }); } if (hasOption("version")) { String version = getCheckerVersion(); if (version == null) { messager.printMessage(Kind.NOTE, "Version info not available!"); } else { messager.printMessage(Kind.NOTE, "checker-framework " + version); } } } catch (UserError ce) { logUserError(ce); } catch (TypeSystemError ce) { logTypeSystemError(ce); } catch (BugInCF ce) { logBugInCF(ce); } catch (Throwable t) { logBugInCF(wrapThrowableAsBugInCF("SourceChecker.typeProcessingStart", t, null)); } }

Target:
public void typeProcessingStart() { try { super.typeProcessingStart(); initChecker(); if (this.messager == null) { messager = processingEnv.getMessager(); messager.printMessage( Kind.WARNING, "You have forgotten to call super.initChecker in your " + "subclass of SourceChecker, " + this.getClass() + "! Please ensure your checker is properly initialized."); } if (shouldAddShutdownHook()) { Runtime.getRuntime() .addShutdownHook( new Thread() { @Override public void run() { shutdownHook(); } }); } if (hasOption("version")) { messager.printMessage(Kind.NOTE, "Checker Framework " + getCheckerVersion()); } } catch (UserError ce) { logUserError(ce); } catch (TypeSystemError ce) { logTypeSystemError(ce); } catch (BugInCF ce) { logBugInCF(ce); } catch (Throwable t) { logBugInCF(wrapThrowableAsBugInCF("SourceChecker.typeProcessingStart", t, null)); } }
Source:
public void accept(Model.Update update) { if (DEBUG) Log.d(TAG, "Received model update. Loading=" + mModel.isLoading()); mProgressBar.setVisibility(mModel.isLoading() ? View.VISIBLE : View.GONE); updateLayout(mState.derivedMode); mAdapter.notifyDataSetChanged(); if (mRestoredSelection != null) { mSelectionMgr.restoreSelection(mRestoredSelection); mRestoredSelection = null; } final SparseArray<Parcelable> container = mState.dirConfigs.remove(mLocalState.getConfigKey()); final int curSortedDimensionId = mState.sortModel.getSortedDimensionId(); final SortDimension curSortedDimension = mState.sortModel.getDimensionById(curSortedDimensionId); if (container != null && !getArguments().getBoolean(Shared.EXTRA_IGNORE_STATE, false)) { getView().restoreHierarchyState(container); } else if (mLocalState.mLastSortDimensionId != curSortedDimension.getId() || mLocalState.mLastSortDimensionId == SortModel.SORT_DIMENSION_ID_UNKNOWN || mLocalState.mLastSortDirection != curSortedDimension.getSortDirection()) { mRecView.smoothScrollToPosition(0); } mLocalState.mLastSortDimensionId = curSortedDimension.getId(); mLocalState.mLastSortDirection = curSortedDimension.getSortDirection(); if (mRefreshLayout.isRefreshing()) { new Handler().postDelayed( () -> mRefreshLayout.setRefreshing(false), REFRESH_SPINNER_TIMEOUT); } if (!mModel.isLoading()) { mActivity.notifyDirectoryLoaded( mModel.doc != null ? mModel.doc.derivedUri : null); getActivity().invalidateOptionsMenu(); } }

Target:
public void accept(Model.Update update) { if (DEBUG) Log.d(TAG, "Received model update. Loading=" + mModel.isLoading()); mProgressBar.setVisibility(mModel.isLoading() ? View.VISIBLE : View.GONE); updateLayout(mState.derivedMode); mAdapter.notifyDataSetChanged(); if (mRestoredSelection != null) { mSelectionMgr.restoreSelection(mRestoredSelection); mRestoredSelection = null; } final SparseArray<Parcelable> container = mState.dirConfigs.remove(mLocalState.getConfigKey()); final int curSortedDimensionId = mState.sortModel.getSortedDimensionId(); final SortDimension curSortedDimension = mState.sortModel.getDimensionById(curSortedDimensionId); if (container != null && !getArguments().getBoolean(Shared.EXTRA_IGNORE_STATE, false)) { getView().restoreHierarchyState(container); } else if (mLocalState.mLastSortDimensionId != curSortedDimension.getId() || mLocalState.mLastSortDimensionId == SortModel.SORT_DIMENSION_ID_UNKNOWN || mLocalState.mLastSortDirection != curSortedDimension.getSortDirection()) { mRecView.smoothScrollToPosition(0); } mLocalState.mLastSortDimensionId = curSortedDimension.getId(); mLocalState.mLastSortDirection = curSortedDimension.getSortDirection(); if (mRefreshLayout.isRefreshing()) { new Handler().postDelayed( () -> mRefreshLayout.setRefreshing(false), REFRESH_SPINNER_TIMEOUT); } if (!mModel.isLoading()) { mActivity.notifyDirectoryLoaded( mModel.doc != null ? mModel.doc.derivedUri : null); if (mModel.doc == null) { mActivity.invalidateOptionsMenu(); } } }
Source:
public static float toCores(String cpuString) { final Matcher matcher; if ((matcher = HUMAN_SIZE_CPU_PATTERN.matcher(cpuString)).matches()) { final float size = Float.parseFloat(matcher.group(1)); final String suffix = matcher.group(2); if (suffix == null) { return size; } switch (suffix.toLowerCase()) { case "m": return size / K; } } throw new IllegalArgumentException("Invalid Kubernetes CPU size format provided: " + cpuString); }

Target:
public static float toCores(String cpuString) { final Matcher matcher; if ((matcher = HUMAN_SIZE_CPU_PATTERN.matcher(cpuString)).matches()) { final float size = Float.parseFloat(matcher.group(1)); final String suffix = matcher.group(2); if (suffix == null) { return size; } if (suffix.toLowerCase().equals("m")) { return size / K; } } throw new IllegalArgumentException("Invalid Kubernetes CPU size format provided: " + cpuString); }
Source:
private static Namespace of(List<String> values) { return new Namespace(values); }

Target:
public static Namespace of(List<String> values) { return new Namespace(values); }
Source:
public UsbSerialDeviceInformation generateDeviceInfo() { int i = deviceInfoCounter.getAndIncrement(); return new UsbSerialDeviceInformation(i, i, "serialNumber-" + i, "manufacturer-" + i, "product-" + i, "ttyUSB" + i); }

Target:
private UsbSerialDeviceInformation generateDeviceInfo() { return usbSerialDeviceInformationGenerator.generate(); }
Source:
long yearsUntil(final InternationalFixedDate end) { long startYear = getProlepticYear() * 512L + getDayOfYear(); long endYear = end.getProlepticYear() * 512L + end.getDayOfYear(); return (endYear - startYear) / 512L; }

Target:
long yearsUntil(final InternationalFixedDate end) { long startYear = this.prolepticYear * 512L + this.getInternalDayOfYear(); long endYear = end.prolepticYear * 512L + end.getInternalDayOfYear(); return (endYear - startYear) / 512L; }
Source:
private static ByteBuf serializeProtobuf(MessageLite msg, ByteBufAllocator allocator) { int size = msg.getSerializedSize(); ByteBuf buf = allocator.heapBuffer(size, size); try { msg.writeTo(new ByteBufOutputStream(buf)); } catch (IOException e) { throw new RuntimeException(e); } buf.writerIndex(buf.capacity()); return buf; }

Target:
private static ByteBuf serializeProtobuf(MessageLite msg, ByteBufAllocator allocator) { int size = msg.getSerializedSize(); ByteBuf buf = allocator.heapBuffer(size, size); try { msg.writeTo(new ByteBufOutputStream(buf)); } catch (IOException e) { throw new RuntimeException(e); } return buf; }
Source:
public static RangeValue parse(final String input) { final RangeValue rangeValue = new RangeValue(); if (Objects.isNull(input)) { return rangeValue; } final String _input = input.trim(); if (!(_input.startsWith(INCLUDE_START) || _input.startsWith(EXCLUDE_START))) { return rangeValue; } if (!(_input.endsWith(INCLUDE_END) || _input.endsWith(EXCLUDE_END))) { return rangeValue; } boolean inQuotes = false; boolean includeStartValue = _input.startsWith(INCLUDE_START); boolean includeEndValue = _input.endsWith(INCLUDE_END); String startValue = ""; String endValue = ""; for (int current = 0; current < _input.length(); current++) { if (_input.charAt(current) == '\"') { inQuotes = !inQuotes; } if (!inQuotes && _input.substring(current, current + 2).equals("..")) { startValue = _input.substring(1, current).trim(); endValue = _input.substring(current + 2, _input.length() - 1).trim(); break; } } if (StringUtils.isEmpty(startValue) || StringUtils.isEmpty(endValue)) { return rangeValue; } rangeValue.setIncludeStartValue(includeStartValue); rangeValue.setStartValue(startValue); rangeValue.setIncludeEndValue(includeEndValue); rangeValue.setEndValue(endValue); return rangeValue; }

Target:
public static RangeValue parse(final String input) { final RangeValue rangeValue = new RangeValue(); if (Objects.isNull(input)) { return rangeValue; } final String trimmedInput = input.trim(); if (!(trimmedInput.startsWith(INCLUDE_START) || trimmedInput.startsWith(EXCLUDE_START))) { return rangeValue; } if (!(trimmedInput.endsWith(INCLUDE_END) || trimmedInput.endsWith(EXCLUDE_END))) { return rangeValue; } boolean inQuotes = false; boolean includeStartValue = trimmedInput.startsWith(INCLUDE_START); boolean includeEndValue = trimmedInput.endsWith(INCLUDE_END); String startValue = ""; String endValue = ""; for (int current = 0; current < trimmedInput.length(); current++) { if (trimmedInput.charAt(current) == '\"') { inQuotes = !inQuotes; } if (isSeparator(current, inQuotes, trimmedInput)) { startValue = trimmedInput.substring(1, current).trim(); endValue = trimmedInput.substring(current + SEPARATOR_LENGTH, trimmedInput.length() - 1).trim(); break; } } if (StringUtils.isEmpty(startValue) || StringUtils.isEmpty(endValue)) { return rangeValue; } rangeValue.setIncludeStartValue(includeStartValue); rangeValue.setStartValue(startValue); rangeValue.setIncludeEndValue(includeEndValue); rangeValue.setEndValue(endValue); return rangeValue; }
Source:
private void cleanLRUProjects() throws IOException { if (shouldCleanup(FlowRunnerManager.this.projectDirectory)) { final List<ProjectVersion> projectVersionList = new ArrayList<>( FlowRunnerManager.this.installedProjects.values()); projectVersionList.sort((o1, o2) -> { try { final long creationTime1 = creationTime(o1.getInstalledDir()); final long creationTime2 = creationTime(o2.getInstalledDir()); if (creationTime1 < creationTime2) { return -1; } else if (creationTime1 > creationTime2) { return 1; } else { return 0; } } catch (final IOException ex) { logger.error("error reading project dir", ex); return 0; } }); for (final ProjectVersion version : projectVersionList) { if (!isActiveProject(version) && shouldKeepCleanup(FlowRunnerManager.this .projectDirectory)) { delete(version); } } } }

Target:
private void cleanLRUProjects() throws IOException { if (shouldCleanup(FlowRunnerManager.this.projectDirectory)) { final List<ProjectVersion> projectVersionList = new ArrayList<>( FlowRunnerManager.this.installedProjects.values()); projectVersionList.sort((o1, o2) -> { try { final long creationTime1 = getCreationTime(o1.getInstalledDir()); final long creationTime2 = getCreationTime(o2.getInstalledDir()); if (creationTime1 < creationTime2) { return -1; } else if (creationTime1 > creationTime2) { return 1; } else { return 0; } } catch (final IOException ex) { logger.error("error reading project dir", ex); return 0; } }); for (final ProjectVersion version : projectVersionList) { if (!isActiveProject(version) && shouldKeepCleanup(FlowRunnerManager.this .projectDirectory)) { delete(version); } } } }
Source:
public final void dispose() { for (Binding binding : bindings) { binding.dispose(); } for (ValidationStatusProvider statusProvider : validationStatusProviders) { if (!statusProvider.isDisposed()) { statusProvider.dispose(); } } }

Target:
public final void dispose() { Binding[] bindingArray = bindings.toArray(new Binding[bindings.size()]); for (Binding binding : bindingArray) { binding.dispose(); } ValidationStatusProvider[] statusProviderArray = validationStatusProviders .toArray(new ValidationStatusProvider[validationStatusProviders .size()]); for (ValidationStatusProvider statusProvider : statusProviderArray) { if (!statusProvider.isDisposed()) { statusProvider.dispose(); } } }
Source:
public List<? extends Module> getJacksonModules() { return Collections.<Module>singletonList( new SimpleModule("FirehoseModule") .registerSubtypes( new NamedType(ClippedFirehoseFactory.class, "clipped"), new NamedType(TimedShutoffFirehoseFactory.class, "timed"), new NamedType(LocalFirehoseFactory.class, "local"), new NamedType(HttpFirehoseFactory.class, "http"), new NamedType(EventReceiverFirehoseFactory.class, "receiver"), new NamedType(CombiningFirehoseFactory.class, "combining"), new NamedType(FixedCountFirehoseFactory.class, "fixedCount"), new NamedType(SqlFirehoseFactory.class, "sql"), new NamedType(InlineFirehoseFactory.class, "inline"), new NamedType(SqlInputSource.class, "sql") ) ); }

Target:
public List<? extends Module> getJacksonModules() { return Collections.<Module>singletonList( new SimpleModule("FirehoseModule") .registerSubtypes( new NamedType(ClippedFirehoseFactory.class, "clipped"), new NamedType(TimedShutoffFirehoseFactory.class, "timed"), new NamedType(LocalFirehoseFactory.class, "local"), new NamedType(HttpFirehoseFactory.class, "http"), new NamedType(EventReceiverFirehoseFactory.class, "receiver"), new NamedType(CombiningFirehoseFactory.class, "combining"), new NamedType(FixedCountFirehoseFactory.class, "fixedCount"), new NamedType(SqlFirehoseFactory.class, "sql"), new NamedType(InlineFirehoseFactory.class, "inline") ) ); }
Source:
public void run() { try { depageLock.lock(); depage(scheduleExpiry); } catch (Exception e) { ActiveMQServerLogger.LOGGER.errorDelivering(e); } finally { depageLock.unlock(); } }

Target:
public void run() { depageLock.lock(); try { depage(scheduleExpiry); } catch (Exception e) { ActiveMQServerLogger.LOGGER.errorDelivering(e); } finally { depageLock.unlock(); } }
Source:
public MessageCorrectExtension parse(XmlPullParser parser, int initialDepth) throws XmlPullParserException, IOException, SmackException { String jidMessageToReplace; jidMessageToReplace = parser.getAttributeValue("", ID_TAG); return new MessageCorrectExtension(jidMessageToReplace); }

Target:
public MessageCorrectExtension parse(XmlPullParser parser, int initialDepth) throws XmlPullParserException, IOException, SmackException { String idMessageToReplace = parser.getAttributeValue("", MessageCorrectExtension.ID_TAG); return new MessageCorrectExtension(idMessageToReplace); }
Source:
public void testMultipleTags() { createServer(binder -> { binder.bind(ReportedObject.class); reportBinder(binder).export(ReportedObject.class) .withNamePrefix("TestObject") .withTags(ImmutableMap.of("foo", "bar")); binder.bind(ReportedObject.class).annotatedWith(Names.named("second")).to(ReportedObject.class); reportBinder(binder).export(ReportedObject.class) .annotatedWith(Names.named("second")) .withNamePrefix("TestObject") .withTags(ImmutableMap.of("baz", "quux", "a", "b", "c", "d\"\\\n")); }); StringResponse response = client.execute( prepareGet().setUri(uriFor("/metrics")).build(), createStringResponseHandler()); assertEquals(response.getStatusCode(), 200); assertEquals(response.getBody(), "#TYPE ReportCollector_NumMetrics gauge\n" + "ReportCollector_NumMetrics 2\n" + "#TYPE TestObject_Metric gauge\n" + "TestObject_Metric{a=\"b\",baz=\"quux\",c=\"d\\\"\\\\\\n\"} 2\n" + "TestObject_Metric{foo=\"bar\"} 2\n"); }

Target:
public void testMultipleTags() { createServer(binder -> { binder.bind(ReportedObject.class); reportBinder(binder).export(ReportedObject.class) .withNamePrefix("TestObject") .withTags(ImmutableMap.of("foo", "bar")); binder.bind(ReportedObject.class).annotatedWith(Names.named("second")).to(ReportedObject.class); reportBinder(binder).export(ReportedObject.class) .annotatedWith(Names.named("second")) .withNamePrefix("TestObject") .withTags(ImmutableMap.of("baz", "quux", "a", "b", "c", "d\"\\\n")); }); StringResponse response = client.execute( prepareGet().setUri(uriFor("/metrics")).build(), createStringResponseHandler()); assertEquals(response.getStatusCode(), 200); assertEquals(response.getBody(), "#TYPE ReportCollector_NumMetrics gauge\n" + "ReportCollector_NumMetrics{" + EXPECTED_INSTANCE_TAGS + "} 2\n" + "#TYPE TestObject_Metric gauge\n" + "TestObject_Metric{a=\"b\",baz=\"quux\",c=\"d\\\"\\\\\\n\"," + EXPECTED_INSTANCE_TAGS + "} 2\n" + "TestObject_Metric{foo=\"bar\"," + EXPECTED_INSTANCE_TAGS + "} 2\n"); }
Source:
private void handleBlockExplosion(GlowBlock block) { if (block.getType() == Material.AIR) { return; } else if (block.getType() == Material.TNT) { ((BlockTNT) itemTable.getBlock(Material.TNT)).explodeTNTBlock(block); return; } block.breakNaturally(yield); }

Target:
private void handleBlockExplosion(GlowBlock block) { if (block.getType() == Material.AIR) { return; } else if (block.getType() == Material.TNT) { ((BlockTNT) itemTable.getBlock(Material.TNT)).explodeBlock(block, true); return; } block.breakNaturally(yield); }
Source:
protected void decode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, List<Object> list) throws Exception { byte msgMark = byteBuf.readByte(); if (msgMark == LEGACY_CORFU_MSG_MARK) { list.add(CorfuMsg.deserialize(byteBuf)); } else if (msgMark == PROTO_CORFU_REQUEST_MSG_MARK){ ByteBufInputStream msgInputStream = new ByteBufInputStream(byteBuf); try { RequestMsg request = RequestMsg.parseFrom(msgInputStream); list.add(request); } catch (Exception e) { log.error("decode: An exception occurred during parsing request from ByteBufInputStream of byteBuf.", e); } finally { msgInputStream.close(); } } else if (msgMark == PROTO_CORFU_RESPONSE_MSG_MARK){ ByteBufInputStream msgInputStream = new ByteBufInputStream(byteBuf); try { ResponseMsg response = ResponseMsg.parseFrom(msgInputStream); list.add(response); } catch (Exception e) { log.error("decode: An exception occurred during parsing response from ByteBufInputStream.", e); } finally { msgInputStream.close(); } } else { throw new IllegalStateException("decode: Received an incorrectly marked message."); } }

Target:
protected void decode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, List<Object> list) throws Exception { byte msgMark = byteBuf.readByte(); switch (MessageMarker.typeMap.get(msgMark)) { case LEGACY_MSG_MARK: list.add(CorfuMsg.deserialize(byteBuf)); break; case PROTO_REQUEST_MSG_MARK: try (ByteBufInputStream msgInputStream = new ByteBufInputStream(byteBuf)) { try { RequestMsg request = RequestMsg.parseFrom(msgInputStream); list.add(request); } catch (IOException e) { log.error("decode: An exception occurred during parsing request " + "from ByteBufInputStream.", e); } } break; case PROTO_RESPONSE_MSG_MARK: try (ByteBufInputStream msgInputStream = new ByteBufInputStream(byteBuf)) { try { ResponseMsg response = ResponseMsg.parseFrom(msgInputStream); list.add(response); } catch (IOException e) { log.error("decode: An exception occurred during parsing response " + "from ByteBufInputStream.", e); } } break; default: throw new IllegalStateException("decode: Received an incorrectly marked message."); } }
Source:
public User update(User user) { return performUpdate(user, new QueryIdResolver<>(QueryType.GetDbUserByUserId, IdQueryParameters.class), ActionType.AddUser, new UpdateParametersProvider()); }

Target:
public User update(User user) { return performUpdate(user, new QueryIdResolver<>(QueryType.GetDbUserByUserId, IdQueryParameters.class), ActionType.UpdateUser, new UpdateParametersProvider()); }
Source:
public String getUID() { return asString("metadata.uid"); }

Target:
public String getUID() { return asString(METADATA_UID); }
Source:
public static @NonNull Set<ITmfTrace> getTraceSetWithExperiment(ITmfTrace trace) { if (trace == null) { return new HashSet<>(); } if (trace instanceof TmfExperiment) { TmfExperiment exp = (TmfExperiment) trace; ITmfTrace[] traces = exp.getTraces(); Set<ITmfTrace> alltraces = new LinkedHashSet<>(Arrays.asList(traces)); alltraces.add(exp); return alltraces; } @SuppressWarnings("null") @NonNull Set<ITmfTrace> singleton = Collections.singleton(trace); return singleton; }

Target:
public static @NonNull Set<ITmfTrace> getTraceSetWithExperiment(ITmfTrace trace) { if (trace == null) { @SuppressWarnings("null") @NonNull Set<ITmfTrace> emptySet = Collections.EMPTY_SET; return emptySet; } if (trace instanceof TmfExperiment) { TmfExperiment exp = (TmfExperiment) trace; ITmfTrace[] traces = exp.getTraces(); Set<ITmfTrace> alltraces = new LinkedHashSet<>(Arrays.asList(traces)); alltraces.add(exp); return alltraces; } @SuppressWarnings("null") @NonNull Set<ITmfTrace> singleton = Collections.singleton(trace); return singleton; }
Source:
protected boolean isPostZero() { return false; }

Target:
protected boolean isPostZero() { if (cachedPostZero == null) { cachedPostZero = vm.getDiskMap().values().contains(new Object() { @Override public boolean equals(Object obj) { return ((Disk) obj).isWipeAfterDelete(); } }); } return cachedPostZero; }
Source:
public void deactivate() { logger.debug("Plex binding deactived"); if (connector != null) connector.close(); }

Target:
public void deactivate() { logger.trace("Plex binding deactived"); if (connector != null) { connector.close(); } }
Source:
public void handshake( final AgentClientMetadata agentClientMetadata ) throws HandshakeException { final HandshakeRequest request; try { request = jobServiceProtoConverter.toHandshakeRequest(agentClientMetadata); } catch (final GenieConversionException e) { throw new HandshakeException("Failed to construct request from parameters", e); } final HandshakeResponse response = handleResponseFuture(this.client.handshake(request)); switch (response.getType()) { case ALLOWED: log.info("Successfully shook hand with server"); break; case REJECTED: throw new HandshakeException("Server rejected client: " + response.getMessage()); default: throw new GenieRuntimeException( "Error during handshake: " + response.getType().name() + " - " + response.getMessage() ); } }

Target:
public void handshake( final AgentClientMetadata agentClientMetadata ) throws HandshakeException { final HandshakeRequest request; try { request = jobServiceProtoConverter.toHandshakeRequest(agentClientMetadata); } catch (final GenieConversionException e) { throw new HandshakeException("Failed to construct request from parameters", e); } final HandshakeResponse response = handleResponseFuture(this.client.handshake(request)); switch (response.getType()) { case ALLOWED: log.info("Successfully shook hand with server"); break; case REJECTED: log.warn("Server rejected handshake with this agent"); throw new HandshakeException("Server rejected client: " + response.getMessage()); default: throw new GenieRuntimeException( "Error during handshake: " + response.getType().name() + " - " + response.getMessage() ); } }
Source:
public static Map<String, Symbol> readTypeShedSymbols(String fileName, String moduleName) { Map<String, Symbol> typeShedSymbols = new HashMap<>(); typeShedSymbols.put(NONE_TYPE, new ClassSymbolImpl(NONE_TYPE, NONE_TYPE)); InputStream resource = TypeShed.class.getResourceAsStream(fileName); if (resource == null) { return null; } PythonFile file = new TypeShedPythonFile(resource, moduleName); AstNode astNode = PythonParser.create().parse(file.content()); FileInput fileInput = new PythonTreeMaker().fileInput(astNode); new SymbolTableBuilder("", file, builtinGlobalSymbols).visitFileInput(fileInput); for (Symbol globalVariable : fileInput.globalVariables()) { typeShedSymbols.put(globalVariable.fullyQualifiedName(), globalVariable); } ReturnTypeVisitor visitor = new ReturnTypeVisitor(builtins); fileInput.accept(visitor); return Collections.unmodifiableMap(typeShedSymbols); }

Target:
public static Map<String, Symbol> readTypeShedSymbols(String fileName, String moduleName) { Map<String, Symbol> typeShedSymbols = new HashMap<>(); InputStream resource = TypeShed.class.getResourceAsStream(fileName); if (resource == null) { return null; } PythonFile file = new TypeShedPythonFile(resource, moduleName); AstNode astNode = PythonParser.create().parse(file.content()); FileInput fileInput = new PythonTreeMaker().fileInput(astNode); new SymbolTableBuilder("", file, builtinGlobalSymbols).visitFileInput(fileInput); for (Symbol globalVariable : fileInput.globalVariables()) { typeShedSymbols.put(globalVariable.fullyQualifiedName(), globalVariable); } fileInput.accept(new ReturnTypeVisitor()); return Collections.unmodifiableMap(typeShedSymbols); }
Source:
private void encodeStrokeDasharray( List<Expression> expressions) { if (expressions == null) return; AttributesImpl attributes = new AttributesImpl(); attributes.addAttribute("", "name", "name", "", "stroke-dasharray"); start("CssParameter", attributes); for (Expression expression : expressions) { filterTranslator.encode(expression); } end("CssParameter"); }

Target:
private void encodeStrokeDasharray(List<Expression> expressions) { if (expressions == null || expressions.isEmpty()) return; boolean isLiteral = true; for (Expression expression : expressions) { if(!(expression instanceof Literal)) isLiteral = false; } if(isLiteral) encodeLiteralStrokeDasharray(expressions); else encodeMixedStrokeDasharray(expressions); }
Source:
if (OpenCvLoader.isOpenCvLoaded()) { try { if (System.getProperty("os.arch").equals("amd64") || System.getProperty("os.arch").equals("x86_64")) { System.loadLibrary("opencv_ffmpeg2413_64"); } else { System.loadLibrary("opencv_ffmpeg2413"); } tempFfmpegLoaded = true; } catch (UnsatisfiedLinkError e) { tempFfmpegLoaded = false; LOGGER.log(Level.SEVERE, "opencv_ffmepeg code library failed to load", e); MessageNotifyUtil.Notify.show("OpenCV FFMpeg", "OpenCV FFMpeg library failed to load, see log for more details", MessageNotifyUtil.MessageType.WARNING); } }

Target:
if (OpenCvLoader.isOpenCvLoaded()) { try { if (System.getProperty("os.arch").equals("amd64") || System.getProperty("os.arch").equals("x86_64")) { System.loadLibrary("opencv_ffmpeg2413_64"); } else { System.loadLibrary("opencv_ffmpeg2413"); } tempFfmpegLoaded = true; } catch (UnsatisfiedLinkError e) { tempFfmpegLoaded = false; LOGGER.log(Level.SEVERE, Bundle.ImageUtils_ffmpegLoadedError_msg(), e); MessageNotifyUtil.Notify.show(Bundle.ImageUtils_ffmpegLoadedError_title(), Bundle.ImageUtils_ffmpegLoadedError_msg(), MessageNotifyUtil.MessageType.WARNING); } }
Source:
public void updateExecutionContext(IndexedRecord indexedRecord) { final MessageHeader messageHeader = this.messageHeaderExtractor.extractHeader(indexedRecord); this.correlationIdSetter.setCurrentCorrelationId(messageHeader.getCorrelationId()); this.tenantIdSetter.setCurrentTenantId(messageHeader.getTenantId()); this.userIdSetter.setCurrentUserId(messageHeader.getUserId()); this.securityTokenSetter.setCurrentSecurityToken(messageHeader.getSecurityToken()); }

Target:
public void updateExecutionContext(IndexedRecord indexedRecord) { final MessageHeader messageHeader = this.messageHeaderExtractor.extractHeader(indexedRecord); if (this.correlationIdSetter != null) { this.correlationIdSetter.setCurrentCorrelationId(messageHeader.getCorrelationId()); } if (this.tenantIdSetter != null) { this.tenantIdSetter.setCurrentTenantId(messageHeader.getTenantId()); } if (this.userIdSetter != null) { this.userIdSetter.setCurrentUserId(messageHeader.getUserId()); } if (this.securityTokenSetter != null) { this.securityTokenSetter.setCurrentSecurityToken(messageHeader.getSecurityToken()); } }
Source:
List<Map<String, Object>> parseDisks(XmlDocument document, List<VmDevice> devices) { List<VmDevice> dbDevices = filterDevices(devices, VmDeviceGeneralType.DISK, VmDeviceGeneralType.HOSTDEV); MemoizingSupplier<Map<Guid, String>> diskToLunSupplier = new MemoizingSupplier<>( () -> diskLunMapDao.getAll().stream().collect(Collectors.toMap( DiskLunMap::getDiskId, DiskLunMap::getLunId))); List<Map<String, Object>> result = new ArrayList<>(); for (XmlNode node : selectNodes(document, VmDeviceGeneralType.DISK)) { Map<String, Object> dev = new HashMap<>(); dev.put(VdsProperties.Type, VmDeviceGeneralType.DISK.getValue()); String diskType = DomainXmlUtils.parseAttribute(node, DEVICE); dev.put(VdsProperties.Device, diskType); dev.put(VdsProperties.Address, DomainXmlUtils.parseAddress(node)); dev.put(VdsProperties.Alias, parseAlias(node)); String path = DomainXmlUtils.parseDiskPath(node); Optional<VmDevice> dbDev = correlate(dev, dbDevices); if (!dbDev.isPresent()) { log.warn("unmanaged disk with path '{}' is ignored", path); continue; } dbDevices.remove(dbDev.get()); dev.put(VdsProperties.ImageId, parseImageIdFromPath(path)); dev.put(VdsProperties.DeviceId, dbDev.get().getDeviceId().toString()); dev.put(VdsProperties.SpecParams, dbDev.get().getSpecParams()); List<Map<String, Object>> volumeChain = parseVolumeChain(node); if (!volumeChain.isEmpty()) { dev.put(VdsProperties.VolumeChain, volumeChain.toArray()); } result.add(dev); } return result; }

Target:
List<Map<String, Object>> parseDisks(XmlDocument document, List<VmDevice> devices) { List<VmDevice> dbDevices = filterDevices(devices, VmDeviceGeneralType.DISK, VmDeviceGeneralType.HOSTDEV); List<Map<String, Object>> result = new ArrayList<>(); for (XmlNode node : selectNodes(document, VmDeviceGeneralType.DISK)) { Map<String, Object> dev = new HashMap<>(); dev.put(VdsProperties.Type, VmDeviceGeneralType.DISK.getValue()); String diskType = DomainXmlUtils.parseAttribute(node, DEVICE); dev.put(VdsProperties.Device, diskType); dev.put(VdsProperties.Address, DomainXmlUtils.parseAddress(node)); dev.put(VdsProperties.Alias, parseAlias(node)); String path = DomainXmlUtils.parseDiskPath(node); Optional<VmDevice> dbDev = correlate(dev, dbDevices); if (!dbDev.isPresent()) { log.warn("unmanaged disk with path '{}' is ignored", path); continue; } dbDevices.remove(dbDev.get()); dev.put(VdsProperties.ImageId, parseImageIdFromPath(path)); dev.put(VdsProperties.DeviceId, dbDev.get().getDeviceId().toString()); dev.put(VdsProperties.SpecParams, dbDev.get().getSpecParams()); List<Map<String, Object>> volumeChain = parseVolumeChain(node); if (!volumeChain.isEmpty()) { dev.put(VdsProperties.VolumeChain, volumeChain.toArray()); } result.add(dev); } return result; }
Source:
public void testConsistentIdConfiguredInJvmProp() throws Exception { String specificConsistentId = "JvmProp consistent id"; System.setProperty(IgniteSystemProperties.IGNITE_CONSISTENT_ID, specificConsistentId); Ignite ignite = startGrid(0); assertEquals(specificConsistentId, ignite.configuration().getConsistentId()); assertEquals(specificConsistentId, ignite.cluster().localNode().consistentId()); info("Consistent id in that case: " + ignite.cluster().localNode().consistentId()); }

Target:
public void testConsistentIdConfiguredInJvmProp() throws Exception { String specificConsistentId = "JvmProp consistent id"; System.setProperty(IgniteSystemProperties.IGNITE_OVERRIDE_CONSISTENT_ID, specificConsistentId); Ignite ignite = startGrid(0); assertEquals(specificConsistentId, ignite.configuration().getConsistentId()); assertEquals(specificConsistentId, ignite.cluster().localNode().consistentId()); info("Consistent ID: " + ignite.cluster().localNode().consistentId()); }
Source:
public Result runMain(JUnitSystem system, String... args) { system.out().println("JUnit version " + Version.id()); List<Class<?>> classes = new ArrayList<Class<?>>(); List<Failure> failures = new ArrayList<Failure>(); FilterFactoryFactory filterFactoryFactory = new FilterFactoryFactory(); for (String each : args) { try { if (each.startsWith("--")) { if (each.startsWith("--filter")) { String filterSpec = each.substring(each.indexOf('=') + 1); Filter filter = filterFactoryFactory.apply(filterSpec); addFilter(filter); } else { system.out().println("JUnit knows nothing about the " + each + " option"); return new Result() { @Override public boolean wasSuccessful() { return false; } }; } } else { classes.add(Class.forName(each)); } } catch (FilterFactory.FilterNotFoundException e) { system.out().println("Could not find filter: " + e.getMessage()); Description description = Description.createSuiteDescription(each); Failure failure = new Failure(description, e); failures.add(failure); } catch (FilterFactoryFactory.FilterFactoryNotFoundException e) { system.out().println("Could not find filter factory: " + e.getMessage()); Description description = Description.createSuiteDescription(each); Failure failure = new Failure(description, e); failures.add(failure); } catch (ClassNotFoundException e) { system.out().println("Could not find class: " + each); Description description = Description.createSuiteDescription(each); Failure failure = new Failure(description, e); failures.add(failure); } } RunListener listener = new TextListener(system); addListener(listener); Result result = run(classes.toArray(new Class<?>[0])); for (Failure each : failures) { result.getFailures().add(each); } return result; }

Target:
Result runMain(JUnitSystem system, String... args) { system.out().println("JUnit version " + Version.id()); JUnitCommandLineParseResult jUnitCommandLineParseResult = JUnitCommandLineParseResult.parse(args); RunListener listener = new TextListener(system); addListener(listener); return run(jUnitCommandLineParseResult.createRequest(defaultComputer())); }
Source:
public SymbolResolver getSymbolResolver() { return symbolResolver; }

Target:
public Optional<SymbolResolver> getSymbolResolver() { return Optional.ofNullable(symbolResolver); }
Source:
public static PurgeConfiguration newDefaultPurgeConfiguration(Configuration config, IdUuidPair idUuidPair, Collection<String> disabledComponentUuids) { Collection<String> qualifiersWithoutHistoricalData = asList(Qualifiers.FILE, Qualifiers.UNIT_TEST_FILE); if (config.getBoolean(PurgeConstants.PROPERTY_CLEAN_DIRECTORY).orElse(false)) { qualifiersWithoutHistoricalData = asList(Qualifiers.DIRECTORY, Qualifiers.FILE, Qualifiers.UNIT_TEST_FILE); } return new PurgeConfiguration(idUuidPair, qualifiersWithoutHistoricalData, config.getInt(PurgeConstants.DAYS_BEFORE_DELETING_CLOSED_ISSUES).get(), config.getInt(PurgeConstants.DAYS_BEFORE_DELETING_INACTIVE_SHORT_LIVING_BRANCHES), System2.INSTANCE, disabledComponentUuids); }

Target:
public static PurgeConfiguration newDefaultPurgeConfiguration(Configuration config, IdUuidPair idUuidPair, Collection<String> disabledComponentUuids) { Collection<String> scopesWithoutHistoricalData = singletonList(Scopes.FILE); if (config.getBoolean(PurgeConstants.PROPERTY_CLEAN_DIRECTORY).orElse(false)) { scopesWithoutHistoricalData = asList(Scopes.FILE, Scopes.DIRECTORY); } return new PurgeConfiguration(idUuidPair, scopesWithoutHistoricalData, config.getInt(PurgeConstants.DAYS_BEFORE_DELETING_CLOSED_ISSUES).get(), config.getInt(PurgeConstants.DAYS_BEFORE_DELETING_INACTIVE_SHORT_LIVING_BRANCHES), System2.INSTANCE, disabledComponentUuids); }
Source:
public void list(FluoConfiguration config) { try (CuratorFramework curator = CuratorUtil.newFluoCurator(config)) { curator.start(); try { List<String> children = curator.getChildren().forPath("/"); if (children.isEmpty()) { System.out.println("Fluo instance (" + config.getInstanceZookeepers() + ") does not " + " contain any applications"); } else { System.out.println("Fluo instance (" + config.getInstanceZookeepers() + ") contains " + children.size() + " applications\n"); System.out.println("Application Status"); System.out.println("----------- ------"); for (String path : children) { System.out.format("%-20s", path); FluoConfiguration appConfig = new FluoConfiguration(config); appConfig.setApplicationName(path); if (!twillIdExists(appConfig)) { System.out.println("STOPPED"); } else { String twillId = getTwillId(appConfig); TwillController controller = getTwillRunner(appConfig).lookup( getYarnApplicationName(appConfig.getApplicationName()), RunIds.fromString(twillId)); if (controller == null) { System.out.println("STOPPED"); } else { System.out.println(controller.state()); } } } } } catch (Exception e) { throw new FluoException(e); } } }

Target:
public void list(FluoConfiguration config) { try (CuratorFramework curator = CuratorUtil.newFluoCurator(config)) { curator.start(); try { if (curator.checkExists().forPath("/") == null) { System.out.println("Fluo instance (" + config.getInstanceZookeepers() + ") has not been " + "created yet in Zookeeper. It will be created when the first Fluo application is " + "initialized for this instance."); return; } List<String> children = curator.getChildren().forPath("/"); if (children.isEmpty()) { System.out.println("Fluo instance (" + config.getInstanceZookeepers() + ") does not " + "contain any Fluo applications."); return; } Collections.sort(children); System.out.println("Fluo instance (" + config.getInstanceZookeepers() + ") contains " + children.size() + " application(s)\n"); System.out.println("Application Status YarnAppName YarnAppId"); System.out.println("----------- ------ ----------- ---------"); for (String path : children) { FluoConfiguration appConfig = new FluoConfiguration(config); appConfig.setApplicationName(path); String state = "INITIALIZED"; String yarnId = "not started yet"; String yarnAppName = getYarnApplicationName(path); if (twillIdExists(appConfig)) { String twillId = getTwillId(appConfig); yarnId = getAppId(appConfig); TwillController controller = getTwillRunner(appConfig).lookup( getYarnApplicationName(appConfig.getApplicationName()), RunIds.fromString(twillId)); if (controller == null) { state = "STOPPED"; } else { state = controller.state().toString(); } } System.out.format("%-15s %-11s %-20s %s\n", path, state, yarnAppName, yarnId); } } catch (Exception e) { throw new FluoException(e); } } }
Source:
public void handle(Willie bot, Channel channel, User sender, String[] args) { if (args.length == 0) { channel.sendMessage(Colors.RED + "Please specify a subreddit!"); } else { if (!args[0].matches("^[a-zA-Z0-9]*$")) { channel.sendMessage(Colors.RED + "Only subreddits with letters and numbers are valid!"); } else { channel.sendMessage(Colors.BOLD + "<LINK_1>" + args[0]); } } }

Target:
public void handle(Willie bot, Channel channel, User sender, String[] args) { if (args.length == 0) { channel.sendMessage(Colors.RED + "Please specify a subreddit!"); } else { if (!args[0].matches("^[A-Za-z0-9][A-Za-z0-9_]{2,20}$")) { channel.sendMessage(Colors.RED + "Only subreddits with letters and numbers are valid!"); } else { channel.sendMessage(Colors.BOLD + "<LINK_1>" + args[0]); } } }
Source:
public void sendMessage(String message) { buffer.append(message); }

Target:
public void sendMessage(String message) { buffer.append(message).append("\n"); }
Source:
public List<Double> execute() throws XMLStreamException, IOException, MSDKException { List<Double> mzValuesResult = new ArrayList<Double>(); createTempFeatureXMLFile(); XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance(); XMLEventReader xmlEventReader = xmlInputFactory.createXMLEventReader(new FileReader(FEATURE_XML_FILE)); while (xmlEventReader.hasNext()) { XMLEvent xmlEvent = xmlEventReader.nextEvent(); if (xmlEvent.isStartElement()) { StartElement startElement = xmlEvent.asStartElement(); if (startElement.getName().getLocalPart().equals("position")) { xmlEvent = xmlEventReader.nextEvent(); Attribute idAttr = startElement.getAttributeByName(new QName("dim")); if (idAttr.getValue().equals("1")) { Characters characters = xmlEvent.asCharacters(); mzValuesResult.add(Double.valueOf(characters.getData())); } } } } return mzValuesResult; }

Target:
public List<Double> execute() throws XMLStreamException, IOException, MSDKException { List<Double> mzValuesResult = new ArrayList<Double>(); createTempFeatureXMLFile(); XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance(); XMLEventReader xmlEventReader = xmlInputFactory.createXMLEventReader(new FileReader(FEATURE_XML_FILE)); while (xmlEventReader.hasNext()) { XMLEvent xmlEvent = xmlEventReader.nextEvent(); if (xmlEvent.isStartElement()) { StartElement startElement = xmlEvent.asStartElement(); if (startElement.getName().getLocalPart().equals("position") && xmlEventReader.hasNext()) { xmlEvent = xmlEventReader.nextEvent(); Attribute idAttr = startElement.getAttributeByName(new QName("dim")); if (idAttr.getValue().equals("1")) { Characters characters = xmlEvent.asCharacters(); try { mzValuesResult.add(Double.valueOf(characters.getData())); } catch (NumberFormatException e) { throw new MSDKException("The featureXML contains an invalid m/z value.\n" + e.getMessage()); } } } } } return mzValuesResult; }
Source:
private void assignUniquePrefix(final Waypoint waypoint) { final Set<String> assignedPrefixes = new HashSet<>(); for (final Waypoint wp : waypoints) { assignedPrefixes.add(wp.getPrefix()); } int a = 0; int b = 6; while (a < WP_PREFIX_CHARS.length()) { a++; while (b < WP_PREFIX_CHARS.length()) { b++; final String prefixCandidate = "" + WP_PREFIX_CHARS.charAt(a) + WP_PREFIX_CHARS.charAt(b); if (!assignedPrefixes.contains(prefixCandidate)) { waypoint.setPrefix(prefixCandidate); return; } } b = 0; } throw new IllegalStateException("too many waypoints, unable to assign unique prefix"); }

Target:
private void assignUniquePrefix(final Waypoint waypoint) { final Set<String> assignedPrefixes = new HashSet<>(); for (final Waypoint wp : waypoints) { assignedPrefixes.add(wp.getPrefix()); } final int length = WP_PREFIX_CHARS.length(); for (int i = 0; i < length * length; i++) { final String prefixCandidate = "" + WP_PREFIX_CHARS.charAt(i / length) + WP_PREFIX_CHARS.charAt(i % length); if (!assignedPrefixes.contains(prefixCandidate)) { waypoint.setPrefix(prefixCandidate); return; } } throw new IllegalStateException("too many waypoints, unable to assign unique prefix"); }
Source:
public Object getValue(ELContext ctx, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { if (ctx == null) { throw new NullPointerException(); } Integer numOfKids; Path path; if (base == null) { numOfKids = (Integer) ctx.getContext(AstIdentifier.class); path = new Path(); } else { numOfKids = (!_numOfKids.isEmpty()) ? _numOfKids.removeFirst() : null; path = (!_paths.isEmpty()) ? _paths.removeFirst() : new Path(); } if (numOfKids != null) { int nums = numOfKids.intValue() - 1; numOfKids = new Integer(nums); ctx.putContext(Integer.class, numOfKids); path.add(toNodeString(ctx), Objects.toString(property)); ctx.putContext(Path.class, path); if (nums > 0) { _numOfKids.addFirst(numOfKids); _paths.addFirst(path); } } return null; }

Target:
public Object getValue(ELContext ctx, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { if (ctx == null) { throw new NullPointerException(); } Integer numOfKids; Path path; if (base == null) { numOfKids = (Integer) ctx.getContext(AstIdentifier.class); path = new Path(); } else { numOfKids = !_numOfKids.isEmpty() ? _numOfKids.removeFirst() : null; path = !_paths.isEmpty() ? _paths.removeFirst() : new Path(); } if (numOfKids != null) { int nums = numOfKids.intValue() - 1; numOfKids = new Integer(nums); ctx.putContext(Integer.class, numOfKids); path.add(toNodeString(ctx), Objects.toString(property)); ctx.putContext(Path.class, path); if (nums > 0) { _numOfKids.addFirst(numOfKids); _paths.addFirst(path); } } return null; }
Source:
public void clientCallback(ClientResponse clientResponse) throws Exception { if (clientResponse.getStatus() == ClientResponse.SUCCESS) { try { synchronized (Distributer.this) { VoltTable results[] = clientResponse.getResults(); if (results != null && results.length > 0) { updatePartitioning(results[0]); } } } catch (Exception e) { e.printStackTrace(); } } if (m_latch != null) { m_latch.countDown(); } }

Target:
public void clientCallback(ClientResponse clientResponse) throws Exception { if (clientResponse.getStatus() == ClientResponse.SUCCESS) { VoltTable results[] = clientResponse.getResults(); if (results != null && results.length > 0) { updatePartitioning(results[0]); } } m_partitionUpdateStatus.set(clientResponse); if (m_latch != null) { m_latch.countDown(); } }
Source:
public final boolean isReadOnly() { return this.isReadOnly; }

Target:
public final boolean isReadOnly() { return cache().isReadOnly(); }
Source:
public void removeSelectionListener(SelectionListener listener) { if (this.dropdownTableViewer != null && !this.dropdownTable.isDisposed()) this.dropdownTable.removeSelectionListener(listener); }

Target:
public void removeSelectionListener(SelectionListener listener) { if (this.dropdownTable != null && !this.dropdownTable.isDisposed()) this.dropdownTable.removeSelectionListener(listener); }