auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public DlmsConnection connect(final DlmsDevice device, final DlmsMessageListener dlmsMessageListener) throws TechnicalException, FunctionalException { this.checkDevice(device); this.checkIpAddress(device); TcpConnectionBuilder tcpConnectionBuilder; try { tcpConnectionBuilder = new TcpConnectionBuilder(InetAddress.getByName(device.getIpAddress())) .setResponseTimeout(this.responseTimeout).setLogicalDeviceId(this.logicalDeviceAddress) .setClientId(this.clientAccessPoint) .setReferencingMethod(device.isUseSn() ? ReferencingMethod.SHORT : ReferencingMethod.LOGICAL); if (device.isUseHdlc()) { tcpConnectionBuilder.useHdlc(); } } catch (final UnknownHostException e) { throw new ConnectionException(e); } this.setOptionalValues(device, tcpConnectionBuilder); if (device.isInDebugMode()) { tcpConnectionBuilder.setRawMessageListener(dlmsMessageListener); } try { return tcpConnectionBuilder.build(); } catch (final IOException e) { final String errorMessage = String.format("Communication timeout for device %s", device.getDeviceIdentification()); LOGGER.error(errorMessage); throw new FunctionalException(FunctionalExceptionType.COMMUNICATION_TIMEOUT, ComponentType.PROTOCOL_DLMS, e); } }

Target:
public DlmsConnection connect(final DlmsDevice device, final DlmsMessageListener dlmsMessageListener) throws TechnicalException, FunctionalException { this.checkDevice(device); this.checkIpAddress(device); TcpConnectionBuilder tcpConnectionBuilder; try { tcpConnectionBuilder = new TcpConnectionBuilder(InetAddress.getByName(device.getIpAddress())) .setResponseTimeout(this.responseTimeout).setLogicalDeviceId(this.logicalDeviceAddress) .setClientId(this.clientAccessPoint) .setReferencingMethod(device.isUseSn() ? ReferencingMethod.SHORT : ReferencingMethod.LOGICAL); if (device.isUseHdlc()) { tcpConnectionBuilder.useHdlc(); } } catch (final UnknownHostException e) { LOGGER.error("The IP address is not found: {}", device.getIpAddress(), e); throw new TechnicalException(ComponentType.PROTOCOL_DLMS, "The IP address is not found: " + device.getIpAddress()); } this.setOptionalValues(device, tcpConnectionBuilder); if (device.isInDebugMode()) { tcpConnectionBuilder.setRawMessageListener(dlmsMessageListener); } try { return tcpConnectionBuilder.build(); } catch (final IOException e) { final String msg = String.format("Error creating connection for device %s with Ip address:%s Port:%d UseHdlc:%b UseSn:%b Message:%s", device.getDeviceIdentification(), device.getIpAddress(), device.getPort(), device.isUseHdlc(), device.isUseSn(), e.getMessage()); LOGGER.error(msg); throw new ConnectionException(msg, e); } }
Source:
private void newEntity() { if (getWindow() != null) { return; } VmInterfaceModel model = NewVmInterfaceModel.createInstance( getEntity().getStaticData(), getEntity().getStatus(), getEntity().getStoragePoolId(), getEntity().getCompatibilityVersion(), (ArrayList<VmNetworkInterface>) getItems(), this); setWindow(model); }

Target:
private void newEntity() { if (getWindow() != null) { return; } VmInterfaceModel model = NewVmInterfaceModel.createInstance(getEntity().getStaticData(), getEntity().getStatus(), getEntity().getStoragePoolId(), getEntity().getClusterCompatibilityVersion(), (ArrayList<VmNetworkInterface>) getItems(), this); setWindow(model); }
Source:
public void encode(ChannelHandlerContext ctx, Frame frame, List<Object> results) throws IOException { ByteBuf header = CBUtil.allocator.buffer(Header.LENGTH); Message.Type type = frame.header.type; header.writeByte(type.direction.addToVersion(frame.header.version.asInt())); header.writeByte(Header.Flag.serialize(frame.header.flags)); if (frame.header.version.isGreaterOrEqualTo(ProtocolVersion.V3)) header.writeShort(frame.header.streamId); else header.writeByte(frame.header.streamId); header.writeByte(type.opcode); header.writeInt(frame.body.readableBytes()); results.add(header); results.add(frame.body); int messageSize = header.writerIndex() + frame.body.writerIndex(); ClientRequestSizeMetrics.totalBytesWritten.inc(messageSize); ClientRequestSizeMetrics.bytesTransmittedPerFrame.update(messageSize); }

Target:
public void encode(ChannelHandlerContext ctx, Frame frame, List<Object> results) throws IOException { ByteBuf header = CBUtil.allocator.buffer(Header.LENGTH); Message.Type type = frame.header.type; header.writeByte(type.direction.addToVersion(frame.header.version.asInt())); header.writeByte(Header.Flag.serialize(frame.header.flags)); if (frame.header.version.isGreaterOrEqualTo(ProtocolVersion.V3)) header.writeShort(frame.header.streamId); else header.writeByte(frame.header.streamId); header.writeByte(type.opcode); header.writeInt(frame.body.readableBytes()); int messageSize = header.readableBytes() + frame.body.readableBytes(); ClientRequestSizeMetrics.totalBytesWritten.inc(messageSize); ClientRequestSizeMetrics.bytesTransmittedPerFrame.update(messageSize); results.add(header); results.add(frame.body); }
Source:
public void onNext(final ContextStop contextStop) { LOG.log(Level.FINE, "Wait {0} milliseconds at maximum for the PS worker to be closed", CLOSE_TIMEOUT_MS); try { parameterWorker.close(CLOSE_TIMEOUT_MS); LOG.fine("Succeed to close PS worker cleanly"); } catch (InterruptedException | TimeoutException | ExecutionException e) { LOG.log(Level.INFO, "Fail to close PS worker cleanly", e); } psNetworkSetup.unregisterConnectionFactory(); }

Target:
public void onNext(final ContextStop contextStop) { LOG.log(Level.FINE, "Wait at most {0} milliseconds for the PS worker to be closed", CLOSE_TIMEOUT_MS); try { parameterWorker.close(CLOSE_TIMEOUT_MS); LOG.fine("Succeed to close PS worker cleanly"); } catch (InterruptedException | TimeoutException | ExecutionException e) { LOG.log(Level.INFO, "Fail to close PS worker cleanly", e); } psNetworkSetup.unregisterConnectionFactory(); }
Source:
private Runnable insertNewDraft(final CodeMirror cm) { if (!Gerrit.isSignedIn()) { return new Runnable() { @Override public void run() { Gerrit.doSignIn(getToken()); } }; } return new Runnable() { public void run() { LineHandle handle = cm.getActiveLine(); int line = cm.getLineNumber(handle); CommentBox box = lineActiveBoxMap.get(handle); if (box == null) { lineActiveBoxMap.put(handle, addDraftBox(CommentInfo.createRange( path, getSideFromCm(cm), line + 1, null, null, cm.somethingSelected() ? CommentRange.fromFromTo(cm.getSelectedRange()) : null))); } else if (box instanceof DraftBox) { ((DraftBox) box).setEdit(true); } else { ((PublishedBox) box).doReply(); } } }; }

Target:
private Runnable insertNewDraft(final CodeMirror cm) { if (!Gerrit.isSignedIn()) { return new Runnable() { @Override public void run() { Gerrit.doSignIn(getToken()); } }; } return new Runnable() { public void run() { LineHandle handle = cm.getActiveLine(); int line = cm.getLineNumber(handle); CommentBox box = lineActiveBoxMap.get(handle); if (box == null) { lineActiveBoxMap.put(handle, addDraftBox(CommentInfo.createRange( path, getSideFromCm(cm), line + 1, null, null, cm.somethingSelected() ? CommentRange.create(cm.getSelectedRange()) : null))); } else if (box instanceof DraftBox) { ((DraftBox) box).setEdit(true); } else { ((PublishedBox) box).doReply(); } } }; }
Source:
private void updateIfChanged(String instance, String property, State newState) { DenonBindingProvider firstProvider = getFirstMatchingProvider(instance, property); if (firstProvider != null) { DenonBindingConfig config = firstProvider.getConfig(instance, property); ItemRegistry registry = firstProvider.getItemRegistry(); try { State oldState = registry.getItem(config.getItemName()).getState(); if (!oldState.equals(newState)) eventPublisher.postUpdate(config.getItemName(), newState); } catch (ItemNotFoundException e) { e.printStackTrace(); } } }

Target:
private void updateIfChanged(String instance, String property, State newState) { DenonBindingProvider firstProvider = getFirstMatchingProvider(instance, property); if (firstProvider != null) { DenonBindingConfig config = firstProvider.getConfig(instance, property); try { State oldState = itemRegistry.getItem(config.getItemName()).getState(); if (!oldState.equals(newState)) { eventPublisher.postUpdate(config.getItemName(), newState); } } catch (ItemNotFoundException e) { logger.debug("Cannot find item " + config.getItemName() + " in the registry", e); } } }
Source:
public HelixAccountServiceTest(boolean useNewZNodePath) throws Exception { this.useNewZNodePath = useNewZNodePath; helixConfigProps.setProperty( HelixPropertyStoreConfig.HELIX_PROPERTY_STORE_PREFIX + "zk.client.connection.timeout.ms", String.valueOf(ZK_CLIENT_CONNECTION_TIMEOUT_MS)); helixConfigProps.setProperty(HelixPropertyStoreConfig.HELIX_PROPERTY_STORE_PREFIX + "zk.client.session.timeout.ms", String.valueOf(ZK_CLIENT_SESSION_TIMEOUT_MS)); helixConfigProps.setProperty(HelixAccountServiceConfig.ZK_CLIENT_CONNECT_STRING_KEY, ZK_CONNECT_STRING); helixConfigProps.setProperty(HelixPropertyStoreConfig.HELIX_PROPERTY_STORE_PREFIX + "root.path", STORE_ROOT_PATH); accountBackupDir = Paths.get(TestUtils.getTempDir("account-backup")).toAbsolutePath(); helixConfigProps.setProperty(HelixAccountServiceConfig.BACKUP_DIRECTORY_KEY, accountBackupDir.toString()); helixConfigProps.setProperty(HelixAccountServiceConfig.USE_NEW_ZNODE_PATH, String.valueOf(useNewZNodePath)); vHelixConfigProps = new VerifiableProperties(helixConfigProps); storeConfig = new HelixPropertyStoreConfig(vHelixConfigProps); notifier = new MockNotifier<>(); mockHelixAccountServiceFactory = new MockHelixAccountServiceFactory(vHelixConfigProps, new MetricRegistry(), notifier, null); mockRouter = new MockRouter(); deleteStoreIfExists(); generateReferenceAccountsAndContainers(); }

Target:
public HelixAccountServiceTest(boolean useNewZNodePath) throws Exception { this.useNewZNodePath = useNewZNodePath; helixConfigProps.setProperty( HelixPropertyStoreConfig.HELIX_PROPERTY_STORE_PREFIX + "zk.client.connection.timeout.ms", String.valueOf(ZK_CLIENT_CONNECTION_TIMEOUT_MS)); helixConfigProps.setProperty(HelixPropertyStoreConfig.HELIX_PROPERTY_STORE_PREFIX + "zk.client.session.timeout.ms", String.valueOf(ZK_CLIENT_SESSION_TIMEOUT_MS)); helixConfigProps.setProperty(HelixAccountServiceConfig.ZK_CLIENT_CONNECT_STRING_KEY, ZK_CONNECT_STRING); helixConfigProps.setProperty(HelixPropertyStoreConfig.HELIX_PROPERTY_STORE_PREFIX + "root.path", STORE_ROOT_PATH); accountBackupDir = Paths.get(TestUtils.getTempDir("account-backup")).toAbsolutePath(); helixConfigProps.setProperty(HelixAccountServiceConfig.BACKUP_DIRECTORY_KEY, accountBackupDir.toString()); helixConfigProps.setProperty(HelixAccountServiceConfig.USE_NEW_ZNODE_PATH, String.valueOf(useNewZNodePath)); vHelixConfigProps = new VerifiableProperties(helixConfigProps); storeConfig = new HelixPropertyStoreConfig(vHelixConfigProps); notifier = new MockNotifier<>(); mockRouter = new MockRouter(); mockHelixAccountServiceFactory = new MockHelixAccountServiceFactory(vHelixConfigProps, new MetricRegistry(), notifier, null, mockRouter); deleteStoreIfExists(); generateReferenceAccountsAndContainers(); }
Source:
public void tearDown(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException { if (build.getResult() == null) { SonarUtils.addBuildInfoTo(build, installation.getName(), true); } else { SonarUtils.addBuildInfoTo(build, installation.getName(), false); } }

Target:
public void tearDown(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException { SonarUtils.addBuildInfoTo(build, installation.getName(), build.getResult() == null); }
Source:
private void checkDomElementMatches(Source source) { Document doc = Jsoup.parse(String.valueOf(source)); for (Map<String, Map<String, Map<String, AppPattern>>> map : currentApp.getDom()) { for (Map.Entry<String, Map<String, Map<String, AppPattern>>> ap : map.entrySet()) { for (Map.Entry<String, Map<String, AppPattern>> p : ap.getValue().entrySet()) { for (Map.Entry<String, AppPattern> pa : p.getValue().entrySet()) { Elements links = doc.select(ap.getKey()); for (org.jsoup.nodes.Element link : links) { if (Objects.equals(pa.getKey(), "text")) { AppPattern Ap = pa.getValue(); addIfMatches(Ap, link.text()); } if (Objects.equals(p.getKey(), "attributes")) { AppPattern Ap = pa.getValue(); if (link.hasAttr(String.valueOf(pa.getKey()))) { addIfMatches(Ap, link.attr(pa.getKey())); } } if (Objects.equals(p.getKey(), "properties")) { AppPattern Ap = pa.getValue(); if (link.hasAttr(String.valueOf(pa.getKey()))) { addIfMatches(Ap, link.attr(pa.getKey())); } } } } } } } }

Target:
private void checkDomElementMatches(Source source) { Document doc = Jsoup.parse(String.valueOf(source)); for (Map<String, Map<String, Map<String, AppPattern>>> domSelectorMap : currentApp.getDom()) { for (Map.Entry<String, Map<String, Map<String, AppPattern>>> selectorMap : domSelectorMap.entrySet()) { for (Map.Entry<String, Map<String, AppPattern>> nodeSelectorMap : selectorMap.getValue().entrySet()) { for (Map.Entry<String, AppPattern> value : nodeSelectorMap.getValue().entrySet()) { Elements selectedElements = doc.select(selectorMap.getKey()); for (org.jsoup.nodes.Element selectedElement : selectedElements) { if (Objects.equals(value.getKey(), "text")) { AppPattern ap = value.getValue(); addIfMatches(ap, selectedElement.text()); } if (Objects.equals(nodeSelectorMap.getKey(), "attributes") || Objects.equals(nodeSelectorMap.getKey(), "properties")) { AppPattern ap = value.getValue(); if (selectedElement.hasAttr(value.getKey())) { addIfMatches(ap, selectedElement.attr(value.getKey())); } } } } } } } }
Source:
protected void executeCommand() { getParameters().setEntityInfo(new EntityInfo(VdcObjectType.VmTemplate, getVmTemplateId())); setSucceeded(true); if (images != null && !images.isEmpty()) { List<DiskImage> imageToRemove = new ArrayList<>(); for (DiskImage image : images) { if (image.getStorageIds().get(0).equals(getParameters().getStorageDomainId())) { image.setStorageIds(Collections.singletonList(getParameters().getStorageDomainId())); image.setStoragePoolId(getParameters().getStoragePoolId()); imageToRemove.add(image); } } RemoveAllVmImagesParameters removeAllVmImagesParameters = new RemoveAllVmImagesParameters(getVmId(), imageToRemove); removeAllVmImagesParameters.setParentCommand(getActionType()); removeAllVmImagesParameters.setEntityInfo(getParameters().getEntityInfo()); removeAllVmImagesParameters.setForceDelete(true); removeAllVmImagesParameters.setParentParameters(getParameters()); ActionReturnValue vdcRetValue = runInternalActionWithTasksContext(ActionType.RemoveAllVmImages, removeAllVmImagesParameters); if (vdcRetValue.getSucceeded()) { getReturnValue().getVdsmTaskIdList().addAll(vdcRetValue.getInternalVdsmTaskIdList()); } else { getReturnValue().setFault(vdcRetValue.getFault()); setSucceeded(false); } } vmAndTemplatesGenerationsDao.deleteOvfGenerations(Collections.singletonList(ovfEntityData.getEntityId())); unregisteredOVFDataDao.removeEntity(ovfEntityData.getEntityId(), null); unregisteredDisksDao.removeUnregisteredDiskRelatedToVM(ovfEntityData.getEntityId(), null); }

Target:
protected void executeCommand() { getParameters().setEntityInfo(new EntityInfo(VdcObjectType.VmTemplate, getVmTemplateId())); setSucceeded(true); if (images != null && !images.isEmpty()) { List<DiskImage> imageToRemove = new ArrayList<>(); for (DiskImage image : images) { if (image.getStorageIds().get(0).equals(getParameters().getStorageDomainId())) { image.setStorageIds(Collections.singletonList(getParameters().getStorageDomainId())); image.setStoragePoolId(getParameters().getStoragePoolId()); imageToRemove.add(image); } } RemoveAllVmImagesParameters removeAllVmImagesParameters = new RemoveAllVmImagesParameters(getVmTemplateId(), imageToRemove); removeAllVmImagesParameters.setParentCommand(getActionType()); removeAllVmImagesParameters.setEntityInfo(getParameters().getEntityInfo()); removeAllVmImagesParameters.setForceDelete(true); removeAllVmImagesParameters.setParentParameters(getParameters()); ActionReturnValue vdcRetValue = runInternalActionWithTasksContext(ActionType.RemoveAllVmImages, removeAllVmImagesParameters); if (vdcRetValue.getSucceeded()) { getReturnValue().getVdsmTaskIdList().addAll(vdcRetValue.getInternalVdsmTaskIdList()); } else { getReturnValue().setFault(vdcRetValue.getFault()); setSucceeded(false); } } vmAndTemplatesGenerationsDao.deleteOvfGenerations(Collections.singletonList(ovfEntityData.getEntityId())); unregisteredOVFDataDao.removeEntity(ovfEntityData.getEntityId(), null); unregisteredDisksDao.removeUnregisteredDiskRelatedToVM(ovfEntityData.getEntityId(), null); }
Source:
private void deleteButtonAction(ActionEvent a) { try { FileUtils.deleteRecursively(new File(getDBPath())); items.remove(getDBPath()); } catch (Exception e) { e.printStackTrace(); } }

Target:
private void deleteButtonAction(ActionEvent a) { try { FileUtils.deleteRecursively(new File(getDBPath())); items.remove(getDBPath()); } catch (Exception e) { new ExceptionDialog(list.getParent(), e, "Failed to delete database."); } }
Source:
private QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr) { this.id = id; this.addr = addr; this.electionAddr = electionAddr; String checkIPReachableValue = System.getProperty("zookeeper.checkIPTimeout"); if(checkIPReachableValue != null){ this.checkIPReachableTO = Integer.parseInt(checkIPReachableValue); } }

Target:
private QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr) { this.id = id; this.addr = addr; this.electionAddr = electionAddr; }
Source:
public DataSchema( @JsonProperty("dataSource") String dataSource, @JsonProperty("parser") Map<String, Object> parser, @JsonProperty("metricsSpec") AggregatorFactory[] aggregators, @JsonProperty("granularitySpec") GranularitySpec granularitySpec, @JsonProperty("transformSpec") TransformSpec transformSpec, @JacksonInject ObjectMapper jsonMapper ) { this.jsonMapper = Preconditions.checkNotNull(jsonMapper, "null ObjectMapper."); this.parser = parser; this.transformSpec = transformSpec == null ? TransformSpec.NONE : transformSpec; Preconditions.checkArgument(dataSource != null && !dataSource.isEmpty(), "dataSource cannot be null or empty. Please provide a dataSource."); this.dataSource = dataSource; if (granularitySpec == null) { log.warn("No granularitySpec has been specified. Using UniformGranularitySpec as default."); this.granularitySpec = new UniformGranularitySpec(null, null, null); } else { this.granularitySpec = granularitySpec; } if (aggregators != null && aggregators.length != 0) { Set<String> names = new HashSet<>(); for (AggregatorFactory factory : aggregators) { if (!names.add(factory.getName())) { throw new IAE("duplicate aggregators found with name [%s].", factory.getName()); } } } else if (this.granularitySpec.isRollup()) { log.warn("No metricsSpec has been specified. Are you sure this is what you want?"); } this.aggregators = aggregators == null ? new AggregatorFactory[]{} : aggregators; }

Target:
public DataSchema( @JsonProperty("dataSource") String dataSource, @JsonProperty("parser") Map<String, Object> parser, @JsonProperty("metricsSpec") AggregatorFactory[] aggregators, @JsonProperty("granularitySpec") GranularitySpec granularitySpec, @JsonProperty("transformSpec") TransformSpec transformSpec, @JacksonInject ObjectMapper jsonMapper ) { this.jsonMapper = Preconditions.checkNotNull(jsonMapper, "null ObjectMapper."); this.parser = parser; this.transformSpec = transformSpec == null ? TransformSpec.NONE : transformSpec; Preconditions.checkArgument(!Strings.isNullOrEmpty(dataSource), "dataSource cannot be null or empty. Please provide a dataSource."); this.dataSource = dataSource; if (granularitySpec == null) { log.warn("No granularitySpec has been specified. Using UniformGranularitySpec as default."); this.granularitySpec = new UniformGranularitySpec(null, null, null); } else { this.granularitySpec = granularitySpec; } if (aggregators != null && aggregators.length != 0) { Set<String> names = new HashSet<>(); for (AggregatorFactory factory : aggregators) { if (!names.add(factory.getName())) { throw new IAE("duplicate aggregators found with name [%s].", factory.getName()); } } } else if (this.granularitySpec.isRollup()) { log.warn("No metricsSpec has been specified. Are you sure this is what you want?"); } this.aggregators = aggregators == null ? new AggregatorFactory[]{} : aggregators; }
Source:
public void groupMessage(final GroupDescription groupDescription) { try { groupDescription.getMessage().toString(); final Message m = Message.obtain(); m.what = ENQUEUE_GROUP; m.obj = groupDescription; mWorker.runMessage(m); } catch (AssertionError e) { MPLog.e(LOGTAG, "Could not record group update (see <LINK_0>", e); } }

Target:
public void groupMessage(final GroupDescription groupDescription) { final Message m = Message.obtain(); m.what = ENQUEUE_GROUP; m.obj = groupDescription; mWorker.runMessage(m); }
Source:
protected void postLoad(DAnalysis dAnalysis, Version loadedVersion) { if (loadedVersion.compareTo(MIGRATION_VERSION) < 0) { StringBuilder sb = new StringBuilder(Messages.DeleteMultipleConnectorMigrationParticipant_title); EList<DView> ownedViews = dAnalysis.getOwnedViews(); for (DView view : ownedViews) { List<DRepresentationDescriptor> loadedRepresentationsDescriptors = new DViewQuery(view).getLoadedRepresentationsDescriptors(); for (DRepresentationDescriptor descriptor : loadedRepresentationsDescriptors) { DRepresentation rep = descriptor.getRepresentation(); if (rep instanceof DSemanticDiagram) { DSemanticDiagram dDiagram = (DSemanticDiagram) rep; boolean isEdgeModified = false; List<Edge> edgeList = getEdgeList(dDiagram); for (Edge edge : edgeList) { isEdgeModified = checkAndDeleteMultipleConnectorStyle(edge) || isEdgeModified; } if (isEdgeModified) { migrationOccured = true; sb.append(MessageFormat.format(Messages.DeleteMultipleConnectorMigrationParticipant_edgesModified, descriptor.getName())); } if (migrationOccured) { DiagramPlugin.getDefault().logInfo(sb.toString()); migrationOccured = false; } } } } } }

Target:
protected void postLoad(DAnalysis dAnalysis, Version loadedVersion) { if (loadedVersion.compareTo(MIGRATION_VERSION) < 0) { StringBuilder sb = new StringBuilder(Messages.DeleteMultipleConnectorMigrationParticipant_title); EList<DView> ownedViews = dAnalysis.getOwnedViews(); for (DView view : ownedViews) { List<DRepresentationDescriptor> loadedRepresentationsDescriptors = new DViewQuery(view).getLoadedRepresentationsDescriptors(); for (DRepresentationDescriptor descriptor : loadedRepresentationsDescriptors) { DRepresentation rep = descriptor.getRepresentation(); if (rep instanceof DSemanticDiagram) { DSemanticDiagram dDiagram = (DSemanticDiagram) rep; boolean isEdgeModified = false; List<Edge> edgeList = getEdgeList(dDiagram); for (Edge edge : edgeList) { isEdgeModified = checkAndDeleteMultipleConnectorStyle(edge) || isEdgeModified; } if (isEdgeModified) { migrationOccured = true; sb.append(MessageFormat.format(Messages.DeleteMultipleConnectorMigrationParticipant_edgesModified, descriptor.getName())); } } } if (migrationOccured) { DiagramPlugin.getDefault().logInfo(sb.toString()); migrationOccured = false; } } } }
Source:
private void linkToSessionFormRecord(Uri instanceUri) { AndroidSessionWrapper currentState = CommCareApplication._().getCurrentSessionWrapper(); if (instanceUri == null) { raiseFormEntryError("Form Entry did not return a form", currentState); return; } Cursor c = getContext().getContentResolver().query(instanceUri, null, null, null, null); boolean complete = false; try { complete = currentState.beginRecordTransaction(instanceUri, c); } catch (IllegalArgumentException iae) { iae.printStackTrace(); raiseFormEntryError("Unrecoverable error when trying to read form|" + iae.getMessage(), currentState); return; } finally { c.close(); } FormRecord current; try { current = currentState.commitRecordTransaction(); } catch (Exception e) { FormRecordCleanupTask.wipeRecord(getContext(), currentState); ExceptionReportTask ert = new ExceptionReportTask(); ert.execute(e); raiseFormEntryError("An error occurred: " + e.getMessage() + " and your data could not be saved.", currentState); return; } Logger.log(AndroidLogger.TYPE_FORM_ENTRY, "Form Entry Completed"); if (complete) { if (FormRecord.STATUS_COMPLETE.equals(current.getStatus())) { try { new FormRecordProcessor(getContext()).process(current); } catch (Exception e) { Logger.log(AndroidLogger.TYPE_ERROR_WORKFLOW, "Error processing form. Should be recaptured during async processing: " + e.getMessage()); } } } }

Target:
private void linkToSessionFormRecord(Uri instanceUri) { if (getType(instanceUri) != InstanceColumns.CONTENT_ITEM_TYPE) { Log.w(t, "Tried to link a FormRecord to a URI that doesn't point " + "to a concrete instance."); return; } AndroidSessionWrapper currentState = CommCareApplication._().getCurrentSessionWrapper(); if (instanceUri == null) { raiseFormEntryError("Form Entry did not return a form", currentState); return; } Cursor c = getContext().getContentResolver().query(instanceUri, null, null, null, null); boolean complete = false; try { complete = currentState.beginRecordTransaction(instanceUri, c); } catch (IllegalArgumentException iae) { iae.printStackTrace(); raiseFormEntryError("Unrecoverable error when trying to read form|" + iae.getMessage(), currentState); return; } finally { c.close(); } FormRecord current; try { current = currentState.commitRecordTransaction(); } catch (Exception e) { FormRecordCleanupTask.wipeRecord(getContext(), currentState); ExceptionReportTask ert = new ExceptionReportTask(); ert.execute(e); raiseFormEntryError("An error occurred: " + e.getMessage() + " and your data could not be saved.", currentState); return; } Logger.log(AndroidLogger.TYPE_FORM_ENTRY, "Form Entry Completed"); if (complete) { if (FormRecord.STATUS_COMPLETE.equals(current.getStatus())) { try { new FormRecordProcessor(getContext()).process(current); } catch (Exception e) { Logger.log(AndroidLogger.TYPE_ERROR_WORKFLOW, "Error processing form. Should be recaptured during async processing: " + e.getMessage()); } } } }
Source:
public <T> Provider<T> scope(final Key<T> key, final Provider<T> unscoped) { final Provider<T> base = Scopes.SINGLETON.scope(key,unscoped); return new Provider<T>() { public T get() { try { return base.get(); } catch (Exception | LinkageError e) { error(key, e); return null; } } void error(Key<T> key, Throwable x) { if (verbose) { LOGGER.log(Level.WARNING, "Failed to instantiate " + key + "; skipping this component", x); } else { LOGGER.log(Level.FINEST, "Failed to instantiate optional component {0}; skipping", key.getTypeLiteral()); LOGGER.log(Level.FINEST, key.toString(), x); } } }; }

Target:
public <T> Provider<T> scope(final Key<T> key, final Provider<T> unscoped) { final Provider<T> base = Scopes.SINGLETON.scope(key,unscoped); return new Provider<T>() { public T get() { try { return base.get(); } catch (Exception | LinkageError e) { error(key, e); return null; } } void error(Key<T> key, Throwable x) { if (verbose) { LOGGER.log(Level.WARNING, "Failed to instantiate " + key + "; skipping this component", x); } else { LOGGER.log(Level.INFO, "Failed to instantiate optional component {0}; skipping", key.getTypeLiteral()); LOGGER.log(Level.FINEST, key.toString(), x); } } }; }
Source:
private NonNoteEntry mergeNonNotes(NonNoteEntry baseList, NonNoteEntry oursList, NonNoteEntry theirsList) throws IOException { if (baseList == null && oursList == null && theirsList == null) return null; try { ObjectId baseId = write(baseList, inserter); ObjectId oursId = write(oursList, inserter); ObjectId theirsId = write(theirsList, inserter); inserter.flush(); ThreeWayMerger m = MergeStrategy.RESOLVE.newMerger(db, true); m.setBase(baseId); if (!m.merge(oursId, theirsId)) throw new NotesMergeConflictException(baseList, oursList, theirsList); AbbreviatedObjectId none = AbbreviatedObjectId.fromString(""); return NoteParser.parse(none, m.getResultTreeId(), reader).nonNotes; } finally { inserter.release(); } }

Target:
private NonNoteEntry mergeNonNotes(NonNoteEntry baseList, NonNoteEntry oursList, NonNoteEntry theirsList) throws IOException { if (baseList == null && oursList == null && theirsList == null) return null; ObjectId baseId = write(baseList, inserter); ObjectId oursId = write(oursList, inserter); ObjectId theirsId = write(theirsList, inserter); inserter.flush(); ObjectId resultTreeId; if (nonNotesMergeStrategy instanceof ThreeWayMergeStrategy) { ThreeWayMerger m = ((ThreeWayMergeStrategy) nonNotesMergeStrategy) .newMerger(db, true); m.setBase(baseId); if (!m.merge(oursId, theirsId)) throw new NotesMergeConflictException(baseList, oursList, theirsList); resultTreeId = m.getResultTreeId(); } else { Merger m = nonNotesMergeStrategy.newMerger(db, true); if (!m.merge(new AnyObjectId[] { oursId, theirsId })) throw new NotesMergeConflictException(baseList, oursList, theirsList); resultTreeId = m.getResultTreeId(); } AbbreviatedObjectId none = AbbreviatedObjectId.fromString(""); return NoteParser.parse(none, resultTreeId, reader).nonNotes; }
Source:
public void testMultiWALFromOneDFSClient() throws Exception { fs.delete(new Path(FileUtils.directoryName(url, topicsDir, TOPIC_PARTITION)), true); @SuppressWarnings("unchecked") Class<? extends Storage> storageClass = (Class<? extends Storage>) Class.forName(connectorConfig.getString(HdfsSinkConnectorConfig.STORAGE_CLASS_CONFIG)); Storage storage = StorageFactory.createStorage(storageClass, conf, url); final WAL wal1 = storage.wal(topicsDir, TOPIC_PARTITION); final FSWAL wal2 = (FSWAL)storage.wal(topicsDir, TOPIC_PARTITION); String directory = TOPIC + "/" + String.valueOf(PARTITION); final String tempfile = FileUtils.tempFileName(url, topicsDir, directory, extension); final String commitedFile = FileUtils.committedFileName(url, topicsDir, directory, TOPIC_PARTITION, 0, 10, extension, ZERO_PAD_FMT); fs.createNewFile(new Path(tempfile)); wal1.acquireLease(); wal1.append(WAL.beginMarker, ""); wal1.append(tempfile, commitedFile); wal1.append(WAL.endMarker, ""); Thread thread = new Thread(new Runnable() { @Override public void run() { try { Thread.sleep(wal2.getSleepIntervalMs()-100); closed = true; wal1.close(); } catch (ConnectException | InterruptedException e) { } } }); thread.start(); wal2.acquireLease(); assertTrue(closed); wal2.apply(); wal2.close(); assertTrue(fs.exists(new Path(commitedFile))); assertFalse(fs.exists(new Path(tempfile))); storage.close(); }

Target:
public void testMultiWALFromOneDFSClient() throws Exception { setUp(); fs.delete(new Path(FileUtils.directoryName(url, topicsDir, TOPIC_PARTITION)), true); @SuppressWarnings("unchecked") Class<? extends HdfsStorage> storageClass = (Class<? extends HdfsStorage>) connectorConfig .getClass(StorageCommonConfig.STORAGE_CLASS_CONFIG); storage = io.confluent.connect.storage.StorageFactory.createStorage( storageClass, HdfsSinkConnectorConfig.class, connectorConfig, url ); final WAL wal1 = storage.wal(topicsDir, TOPIC_PARTITION); final FSWAL wal2 = (FSWAL) storage.wal(topicsDir, TOPIC_PARTITION); String directory = TOPIC + "/" + String.valueOf(PARTITION); final String tempfile = FileUtils.tempFileName(url, topicsDir, directory, extension); final String committedFile = FileUtils.committedFileName( url, topicsDir, directory, TOPIC_PARTITION, 0, 10, extension, ZERO_PAD_FMT ); fs.createNewFile(new Path(tempfile)); wal1.acquireLease(); wal1.append(WAL.beginMarker, ""); wal1.append(tempfile, committedFile); wal1.append(WAL.endMarker, ""); Thread thread = new Thread(new Runnable() { @Override public void run() { try { Thread.sleep(WALConstants.INITIAL_SLEEP_INTERVAL_MS - 100); closed = true; wal1.close(); } catch (ConnectException | InterruptedException e) { } } }); thread.start(); wal2.acquireLease(); assertTrue(closed); wal2.apply(); wal2.close(); assertTrue(fs.exists(new Path(committedFile))); assertFalse(fs.exists(new Path(tempfile))); storage.close(); }
Source:
public void validateCantLiveMigrateToBackupDomain() { StorageDomain dstStorageDomain = initStorageDomain(srcStorageId); dstStorageDomain.setStatus(StorageDomainStatus.Active); dstStorageDomain.setBackup(true); initDiskImage(diskImageGroupId, diskImageId); initVm(VMStatus.Up, Guid.newGuid(), diskImageGroupId); ValidateTestUtils.runAndAssertValidateFailure(command, EngineMessage.ACTION_TYPE_FAILED_VM_DISKS_ON_BACKUP_STORAGE); }

Target:
public void validateCantLiveMigrateToBackupDomain() { StorageDomain srcStorageDomain = initStorageDomain(srcStorageId); srcStorageDomain.setStatus(StorageDomainStatus.Active); srcStorageDomain.setBackup(true); initDiskImage(diskImageGroupId, diskImageId); initVm(VMStatus.Up, Guid.newGuid(), diskImageGroupId); ValidateTestUtils.runAndAssertValidateFailure(command, EngineMessage.ACTION_TYPE_FAILED_VM_DISKS_ON_BACKUP_STORAGE); }
Source:
public void validate(Class<?> originalType, MirrorList<Method> methods) { boolean hasAfterMethod = notNull(AfterCall.class, originalType, methods); boolean hasAroundMethod = notNull(AroundCall.class, originalType, methods); boolean hasBeforeMethod = notNull(BeforeCall.class, originalType, methods); if (!hasAfterMethod && !hasAroundMethod && !hasBeforeMethod) { throw new InterceptionException(format("Interceptor %s must " + "declare at least one method whith @%s, @%s or @%s annotation", originalType.getCanonicalName(), AfterCall.class.getSimpleName(), AroundCall.class.getSimpleName(), BeforeCall.class.getSimpleName())); } }

Target:
public void validate(Class<?> originalType, MirrorList<Method> methods) { boolean hasAfterMethod = hasAnnotatedMethod(AfterCall.class, originalType, methods); boolean hasAroundMethod = hasAnnotatedMethod(AroundCall.class, originalType, methods); boolean hasBeforeMethod = hasAnnotatedMethod(BeforeCall.class, originalType, methods); if (!hasAfterMethod && !hasAroundMethod && !hasBeforeMethod) { throw new InterceptionException(format("Interceptor %s must " + "declare at least one method whith @AfterCall, @AroundCall " + "or @BeforeCall annotation", originalType.getCanonicalName())); } }
Source:
public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException { CommonHelper.assertNotNull("config", config); SAML2Client client = (SAML2Client) config.getClients().findClient("SAML2Client").get(); if (client != null) { client.init(); servletResponse.getWriter().write(client.getServiceProviderMetadataResolver().getMetadata()); servletResponse.getWriter().flush(); } else { throw new TechnicalException("No SAML2Client"); } }

Target:
public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException { CommonHelper.assertNotNull("config", config); CommonHelper.assertNotNull("client", client); SAML2Client client = (SAML2Client) config.getClients().findClient(this.client).get(); if (client != null) { client.init(); servletResponse.getWriter().write(client.getServiceProviderMetadataResolver().getMetadata()); servletResponse.getWriter().flush(); } else { throw new TechnicalException("No SAML2Client: " + this.client); } }
Source:
private ClientResponse makeRemoteCall(Action action) throws Throwable { if (lastRedirect.get() != null && isQueryAction(action)) { String serviceUrl = lastRedirect.get(); try { ClientResponse clientResponse = makeRemoteCall(action, serviceUrl); int status = clientResponse.getStatus(); if (status >= 200 && status < 300) { return clientResponse; } SERVER_RETRY_COUNTER.increment(); lastRedirect.compareAndSet(serviceUrl, null); } catch (Throwable ignored) { logger.warn("Remote call to last redirect address failed; retrying from configured service URL list"); SERVER_RETRY_COUNTER.increment(); lastRedirect.compareAndSet(serviceUrl, null); } } return makeRemoteCall(action, 0); }

Target:
private ClientResponse makeRemoteCall(Action action) throws Throwable { ClientResponse response; if(isQueryAction(action)) { response = makeRemoteCallToRedirectedServer(lastQueryRedirect, action); } else { response = makeRemoteCallToRedirectedServer(lastRegisterRedirect, action); } if (response == null) { response = makeRemoteCall(action, 0); } return response; }
Source:
protected DeploymentGroupStatus awaitDeploymentGroupStatus( final HeliosClient client, final String name, final DeploymentGroupStatus.State expected) throws Exception { return Polling.await(LONG_WAIT_SECONDS, SECONDS, new Callable<DeploymentGroupStatus>() { @Override public DeploymentGroupStatus call() throws Exception { final DeploymentGroupStatusResponse response = getOrNull( client.deploymentGroupStatus(name)); if (response != null) { final DeploymentGroupStatus status = response.getDeploymentGroupStatus(); final DeploymentGroupStatus.State actual = status.getState(); if (expected.equals(actual)) { return status; } if (FAILED.equals(actual) && !expected.equals(actual)) { throw new AssertionError("Deployment group " + name + " failed unexpectedly: " + status.getError()); } } return null; } }); }

Target:
protected DeploymentGroupStatus awaitDeploymentGroupStatus( final HeliosClient client, final String name, final DeploymentGroupStatus.State expected) throws Exception { return Polling.await(LONG_WAIT_SECONDS, SECONDS, new Callable<DeploymentGroupStatus>() { @Override public DeploymentGroupStatus call() throws Exception { final DeploymentGroupStatusResponse response = getOrNull( client.deploymentGroupStatus(name)); if (response != null) { final DeploymentGroupStatus status = response.getDeploymentGroupStatus(); final DeploymentGroupStatus.State actual = status.getState(); if (actual == FAILED && actual != expected) { throw new AssertionError("Deployment group " + name + " failed unexpectedly: " + status.getError()); } if (actual == expected) { return status; } } return null; } }); }
Source:
ConditionParamPresenter mockParamPresenter() { ConditionParamPresenter paramPresenter = mock(ConditionParamPresenter.class); ConditionParamPresenter.View paramPresenterView = mock(ConditionParamPresenter.View.class); HTMLElement element = mock(HTMLElement.class); when(paramPresenter.getView()).thenReturn(paramPresenterView); when(paramPresenterView.getElement()).thenReturn(element); return paramPresenter; }

Target:
private ConditionParamPresenter mockParamPresenter() { ConditionParamPresenter paramPresenter = mock(ConditionParamPresenter.class); ConditionParamPresenter.View paramPresenterView = mock(ConditionParamPresenter.View.class); HTMLElement element = mock(HTMLElement.class); when(paramPresenter.getView()).thenReturn(paramPresenterView); when(paramPresenterView.getElement()).thenReturn(element); return paramPresenter; }
Source:
public Map<Integer, List<Name>> getNamesByGidsAndNTypeIdsInMap(final List<Integer> gids, final List<Integer> ntypeIds) { final Map<Integer, List<Name>> map = new HashMap<Integer, List<Name>>(); if (gids == null || gids.isEmpty()) { return map; } try { final Criteria criteria = this.getSession().createCriteria(Name.class); criteria.add(Restrictions.in("germplasmId", gids)); criteria.add(Restrictions.in("typeId", ntypeIds)); final List<Name> list = criteria.list(); if (list == null) { return map; } for (final Name name : list) { List<Name> names = map.get(name.getGermplasmId()); if (names == null) { names = new ArrayList<Name>(); map.put(name.getGermplasmId(), names); } names.add(name); } } catch (final HibernateException e) { this.logAndThrowException("Error with getNamesByGidsInMap(gids=" + gids + ") query from Name " + e.getMessage(), e); } return map; }

Target:
public Map<Integer, List<Name>> getNamesByGidsAndNTypeIdsInMap(final List<Integer> gids, final List<Integer> ntypeIds) { final Map<Integer, List<Name>> map = new HashMap<Integer, List<Name>>(); if (gids == null || gids.isEmpty()) { return map; } try { final Criteria criteria = this.getSession().createCriteria(Name.class); criteria.add(Restrictions.in("germplasmId", gids)); criteria.add(Restrictions.in("typeId", ntypeIds)); final List<Name> list = criteria.list(); if (list == null) { return map; } for (final Name name : list) { List<Name> names = map.get(name.getGermplasmId()); if (names == null) { names = new ArrayList<Name>(); map.put(name.getGermplasmId(), names); } names.add(name); } } catch (final HibernateException e) { String message = "Error with getNamesByGidsInMap(gids=" + gids + ") query from Name " + e.getMessage(); NameDAO.LOG.error(message); throw new MiddlewareQueryException(message, e); } return map; }
Source:
public void testUnhandledExceptionNotStoredOnPreviousExceptionStored() { assertTrue(sharedPreferences.getString(CrashReporter.EXCEPTION_FOR_REPORT, "").isEmpty()); exception = new RuntimeException("Error 1"); CrashReporter.storeUnhandledException(exception); assertTrue(!sharedPreferences.getString(CrashReporter.EXCEPTION_FOR_REPORT, "").isEmpty()); String error1Data = sharedPreferences.getString(CrashReporter.EXCEPTION_FOR_REPORT, ""); exception = new RuntimeException("Error 2"); CrashReporter.storeUnhandledException(exception); assertTrue(!sharedPreferences.getString(CrashReporter.EXCEPTION_FOR_REPORT, "").isEmpty()); assertTrue(sharedPreferences.getString(CrashReporter.EXCEPTION_FOR_REPORT, "").equals(error1Data)); }

Target:
public void testUnhandledExceptionNotStoredOnPreviousExceptionStored() { assertTrue(sharedPreferences.getString(CrashReporter.EXCEPTION_FOR_REPORT, "").isEmpty()); exception = new RuntimeException("Error 1"); CrashReporter.storeUnhandledException(exception); assertFalse(sharedPreferences.getString(CrashReporter.EXCEPTION_FOR_REPORT, "").isEmpty()); String error1Data = sharedPreferences.getString(CrashReporter.EXCEPTION_FOR_REPORT, ""); exception = new RuntimeException("Error 2"); CrashReporter.storeUnhandledException(exception); assertFalse(sharedPreferences.getString(CrashReporter.EXCEPTION_FOR_REPORT, "").isEmpty()); assertTrue(sharedPreferences.getString(CrashReporter.EXCEPTION_FOR_REPORT, "").equals(error1Data)); }
Source:
public static FeedRangeInternal fromJsonString(String json) { FeedRangeInternal parsedRange; try { parsedRange = FeedRangeInternal.tryParse(json); } catch (IOException e) { throw new IllegalArgumentException( String.format("Unable to parse JSON %s", json), e); } if (parsedRange == null) { throw new IllegalArgumentException( String.format( "The provided string '%s' does not represent any known format.", json)); } return parsedRange; }

Target:
public static FeedRangeInternal fromJsonString(String json) { FeedRangeInternal parsedRange = FeedRangeInternal.tryParse(json); if (parsedRange == null) { throw new IllegalArgumentException( String.format( "The provided string '%s' does not represent any known format.", json)); } return parsedRange; }
Source:
private RowFilter createSingleRowFilter(byte[] first, byte[] second) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(first.length * 2); QuoteMetaOutputStream quotingStream = new QuoteMetaOutputStream(baos); for (int i = 0; i < first.length; i++) { if (first[i] == 0) { quotingStream.write(second[i]); } else { baos.write(ReaderExpressionHelper.ANY_BYTE_BYTES); } } ByteString quotedValue = ByteString.copyFrom(baos.toByteArray()); return RowFilter.newBuilder().setRowKeyRegexFilter(quotedValue).build(); }

Target:
private static RowFilter createSingleRowFilter(byte[] first, byte[] second) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(first.length * 2); QuoteMetaOutputStream quotingStream = new QuoteMetaOutputStream(baos); for (int i = 0; i < first.length; i++) { if (first[i] == 0) { quotingStream.write(second[i]); } else { baos.write(ReaderExpressionHelper.ANY_BYTE_BYTES); } } ByteString quotedValue = ByteString.copyFrom(baos.toByteArray()); return RowFilter.newBuilder().setRowKeyRegexFilter(quotedValue).build(); }
Source:
public void buildNonconformityTypeStatistics() { SecurityContextHolder.getContext().setAuthentication(adminUser); List<NonconformityTypeStatisticsDTO> dtos = statisticsDAO.getAllNonconformitiesByCriterion(null); assertNotNull(dtos); assertEquals(6, dtos.size()); for(NonconformityTypeStatisticsDTO dto : dtos){ nonconformStatDAO.create(dto); } List<NonconformityTypeStatisticsDTO> created = nonconformStatDAO.getAllNonconformityStatistics(null); assertNotNull(created); assertEquals(6, created.size()); }

Target:
public void buildNonconformityTypeStatistics() { NonconformityTypeChartCalculator calc = new NonconformityTypeChartCalculator(statisticsDAO, nonconformStatDAO, txnManager); List<NonconformityTypeStatisticsDTO> dtos = calc.getCounts(); assertNotNull(dtos); assertEquals(1, dtos.size()); }
Source:
public int hashCode() { int result1 = this.result.hashCode(); long temp = Double.doubleToLongBits(this.experience); result1 = 31 * result1 + (int) (temp ^ (temp >>> 32)); return result1; }

Target:
public int hashCode() { return Objects.hash(this.result, this.experience); }
Source:
protected String getExpiryKey(Object event) { if (getterExpiry == null) { Class<?> fqcn = event.getClass(); Getter<Object, Object> getterObj = PojoUtils.createGetter(fqcn, expiryExpression, Object.class); getterExpiry = getterObj; } return getterExpiry.get(event).toString(); }

Target:
protected String getExpiryKey(Object event) { return getterExpiry.get(event).toString(); }
Source:
public void setMigrationMode(MigrationSupport value) { for (Object migrationModeEntityModel : getMigrationMode().getItems()) { if (((EntityModel)migrationModeEntityModel).getEntity() == value) { getMigrationMode().setSelectedItem(migrationModeEntityModel); break; } } }

Target:
public void setMigrationMode(MigrationSupport value) { getMigrationMode().setSelectedItem(value); }
Source:
void setSucceeded() { this.succeeded = true; this.done = true; }

Target:
void setSucceeded() { succeeded = true; done = true; }
Source:
protected String getTaskUsageName() { return "rt_upload"; }

Target:
protected String getTaskUsageName() { return "generic_deploy"; }
Source:
protected final void sessionEstablished() throws HandshakeException { amendPeerPrincipal(); if (!sessionEstablished) { sessionEstablished = true; for (SessionListener sessionListener : sessionListeners) { sessionListener.sessionEstablished(this, this.getSession()); } } }

Target:
protected final void sessionEstablished() throws HandshakeException { if (!sessionEstablished) { amendPeerPrincipal(); sessionEstablished = true; for (SessionListener sessionListener : sessionListeners) { sessionListener.sessionEstablished(this, this.getSession()); } } }
Source:
public String getFunctionName() { return "jiraFindIssuesAtCommitLogs"; }

Target:
public String getFunctionName() { return "jiraFindInChangeSets"; }
Source:
public void sortingShouldWorkForEasyStrings() { assertSortedLike(new String(""), new String("")); assertSortedLike("", "a"); assertSortedLike("a", "asdf"); assertSortedLike("aaa", "bbb"); assertSortedLike("1", "2"); }

Target:
public void sortingShouldWorkForEasyStrings() { assertSortedLike("", ""); assertSortedLike("", "a"); assertSortedLike("a", "asdf"); assertSortedLike("aaa", "bbb"); assertSortedLike("1", "2"); }
Source:
public static CsvReader create(AlluxioURI uri) throws IOException { Path inputPath = new Path(uri.getScheme(), uri.getAuthority().toString(), uri.getPath()); Configuration conf = ReadWriterUtils.readNoCacheConf(); FileSystem fs = inputPath.getFileSystem(conf); return new CsvReader(fs, inputPath); }

Target:
public static CsvReader create(AlluxioURI uri) throws IOException { return new CsvReader(new Path(uri.getScheme(), uri.getAuthority().toString(), uri.getPath())); }
Source:
public void initSelectedMacPool() { Collection<MacPool> allMacPools = getMacPoolListModel().getItems(); StoragePool dc = getEntity(); if (allMacPools != null && dc != null) { Guid macPoolId = dc.getMacPoolId(); if (macPoolId != null) { for (MacPool macPool : allMacPools) { if (macPoolId.equals(macPool.getId())) { getMacPoolListModel().setSelectedItem(macPool); break; } } } } }

Target:
public void initSelectedMacPool() { Collection<MacPool> allMacPools = getMacPoolListModel().getItems(); StoragePool dc = getEntity(); if (allMacPools != null && dc != null) { Guid macPoolId = dc.getMacPoolId(); for (MacPool macPool : allMacPools) { if (macPool.getId().equals(macPoolId)) { getMacPoolListModel().setSelectedItem(macPool); break; } } } }