auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static File fileToHtml(String infilexml, String infilexsl, String outfilename) { Document doc = null; File stylesheet = null; File datafile = null; File outfile = null; try { stylesheet = new File(infilexsl); datafile = new File(infilexml); outfile = new File(outfilename); DocumentBuilder builder = XmlUtils.newXxeDisabledDocumentBuilderFactory().newDocumentBuilder(); doc = builder.parse(datafile); TransformerFactory tFactory = TransformerFactory.newInstance(); StreamSource stylesource = new StreamSource(stylesheet); Transformer transformer = tFactory.newTransformer(stylesource); DOMSource source = new DOMSource(doc); StreamResult result = new StreamResult(outfile); transformer.transform(source, result); } catch (TransformerException | SAXException | ParserConfigurationException | IOException e) { showDialogForGUI(); logger.error(e.getMessage(), e); return outfile; } finally { } return outfile; }

Target:
public static File fileToHtml(String infilexml, String infilexsl, String outfilename) { Document doc = null; File stylesheet = null; File datafile = null; File outfile = null; try { stylesheet = new File(infilexsl); datafile = new File(infilexml); outfile = new File(outfilename); DocumentBuilder builder = XmlUtils.newXxeDisabledDocumentBuilderFactory().newDocumentBuilder(); doc = builder.parse(datafile); TransformerFactory tFactory = TransformerFactory.newInstance(); StreamSource stylesource = new StreamSource(stylesheet); Transformer transformer = tFactory.newTransformer(stylesource); DOMSource source = new DOMSource(doc); StreamResult result = new StreamResult(outfile); transformer.transform(source, result); } catch (TransformerException | SAXException | ParserConfigurationException | IOException e) { showDialogForGUI(); logger.error(e.getMessage(), e); } finally { } return outfile; }
Source:
public static boolean accept(String name) { try { getFactory(name); return true; } catch (IllegalArgumentException e) { return false; } }

Target:
public static boolean accept(String name) { return MESSAGE_FACTORIES_NAMES.contains(name); }
Source:
public void disconnect(ChatComponent reason) { NetState state = this.currentState; if (state == NetState.LOGIN) { this.sendPacket(new LoginOutDisconnect(reason)) .addListener(future -> this.channel.close()); } else if (state == NetState.PLAY) { this.sendPacket(new PlayOutDisconnect(reason)) .addListener(future -> this.channel.close()); this.player.remove(); } else { this.channel.close(); } if (name != null) { ChatComponent chat = ChatComponent.create() .setColor(ChatColor.YELLOW) .setTranslate("multiplayer.player.left") .addWith(name); TridentServer.instance().players().forEach(e -> e.sendMessage(chat, ChatType.CHAT)); } }

Target:
public void disconnect(ChatComponent reason) { NetState state = this.currentState; if (state == NetState.LOGIN) { this.sendPacket(new LoginOutDisconnect(reason)) .addListener(future -> this.channel.close()); } else if (state == NetState.PLAY) { this.sendPacket(new PlayOutDisconnect(reason)) .addListener(future -> this.channel.close()); this.player.remove(); } else { this.channel.close(); } }
Source:
public SnappyCompressor(int directBufferSize) { try { SnappyLoader.getVersion(); } catch (Throwable t) { throw new RuntimeException("native snappy library not available: " + "SnappyCompressor has not been loaded.", t); } this.directBufferSize = directBufferSize; uncompressedDirectBuf = ByteBuffer.allocateDirect(directBufferSize); compressedDirectBuf = ByteBuffer.allocateDirect(directBufferSize); compressedDirectBuf.position(directBufferSize); }

Target:
public SnappyCompressor(int directBufferSize) { this.directBufferSize = directBufferSize; uncompressedDirectBuf = ByteBuffer.allocateDirect(directBufferSize); compressedDirectBuf = ByteBuffer.allocateDirect(directBufferSize); compressedDirectBuf.position(directBufferSize); }
Source:
private List<PickerMilestone> convertToPickerMilestones(TurboIssue issue, List<TurboMilestone> milestones) { List<PickerMilestone> originalMilestones = new ArrayList<>(); for (int i = 0; i < milestones.size(); i++) { PickerMilestone convertedMilestone = new PickerMilestone(milestones.get(i)); if (isExistingMilestone(issue, convertedMilestone)) { convertedMilestone.setExisting(true); } originalMilestones.add(convertedMilestone); } Collections.sort(originalMilestones); selectExistingMilestone(originalMilestones, issue); return originalMilestones; }

Target:
private List<PickerMilestone> convertToPickerMilestones(TurboIssue issue, List<TurboMilestone> milestones) { List<PickerMilestone> originalMilestones = new ArrayList<>(); milestones.stream() .forEach(milestone -> { PickerMilestone convertedMilestone = new PickerMilestone(milestone); if (isExistingMilestone(issue, convertedMilestone)) { convertedMilestone.setExisting(true); } originalMilestones.add(convertedMilestone); }); Collections.sort(originalMilestones); return originalMilestones; }
Source:
protected AppInstallStatus doTaskBackground(Void... params) { CommCareApp app = CommCareApplication._().getCurrentApp(); app.setupSandbox(); AndroidCommCarePlatform platform = app.getCommCarePlatform(); AndroidResourceManager resourceManager = new AndroidResourceManager(platform); if (!resourceManager.isUpgradeTableStaged()) { resourceManager.recordUpdateInstallFailure(AppInstallStatus.UnknownFailure); return AppInstallStatus.UnknownFailure; } try { resourceManager.upgrade(); } catch (UnresolvedResourceException e) { resourceManager.recordUpdateInstallFailure(e); return AppInstallStatus.UnknownFailure; } ResourceInstallUtils.initAndCommitApp(app); return AppInstallStatus.Installed; }

Target:
protected AppInstallStatus doTaskBackground(Void... params) { return installStagedUpdate(); }
Source:
public void testTypes() { tEnv().executeSql(TABLE); tEnv().executeSql(SINK); tEnv().from("datagen_t").executeInsert("sink"); execInsertTableAndWaitResult( tEnv().from("datagen_t"), "sink"); }

Target:
public void testTypes() throws Exception { tEnv().executeSql(TABLE); List<Row> results = new ArrayList<>(); try (CloseableIterator<Row> iter = tEnv().executeSql("select * from datagen_t").collect()) { while (iter.hasNext()) { results.add(iter.next()); } } Assert.assertEquals("Unexpected number of results",10, results.size()); }
Source:
public void triggerLogoutWarning() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Logging our your app"); builder.setMessage(R.string.logout_warning) .setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); installApp(); } }) .setNegativeButton("CANCEL", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); AlertDialog dialog = builder.create(); dialog.show(); }

Target:
private void triggerLogoutWarning() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.logging_out); builder.setMessage(R.string.logout_warning) .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); CommCareApplication._().expireUserSession(); installApp(); } }) .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); AlertDialog dialog = builder.create(); dialog.show(); }
Source:
public Response add(Storage storage) { validateParameters(storage, "address", "type", "host"); StorageServerConnections storageConnection = getMapper(Storage.class, StorageServerConnections.class).map(storage, null); Guid hostId = getHostId(storage.getHost()); switch (storageConnection.getstorage_type()) { case ISCSI: validateParameters(storage, "iqn", "port"); break; case NFS: case LOCALFS: validateParameters(storage, "path"); break; case POSIXFS: case GLUSTERFS: validateParameters(storage, "path", "vfsType"); break; default: break; } return performCreate(VdcActionType.AddStorageServerConnection, getAddParams(storageConnection, hostId), ENTITY_RETRIEVER); }

Target:
public Response add(Storage storage) { validateParameters(storage, "address", "type", "host.id|name"); StorageServerConnections storageConnection = getMapper(Storage.class, StorageServerConnections.class).map(storage, null); Guid hostId = getHostId(storage.getHost()); switch (storageConnection.getstorage_type()) { case ISCSI: validateParameters(storage, "iqn", "port"); break; case NFS: case LOCALFS: validateParameters(storage, "path"); break; case POSIXFS: case GLUSTERFS: validateParameters(storage, "path", "vfsType"); break; default: break; } return performCreate(VdcActionType.AddStorageServerConnection, getAddParams(storageConnection, hostId), ENTITY_RETRIEVER); }
Source:
private String expandStashURL(Run<?, ?> run, final TaskListener listener) { String url = stashServerBaseUrl; DescriptorImpl descriptor = getDescriptor(); if ("".equals(url) || url == null) { url = descriptor.getStashRootUrl(); } try { if (!(run instanceof AbstractBuild<?, ?>)) { url = TokenMacro.expandAll(run, new FilePath(run.getRootDir()), listener, url); } else { url = TokenMacro.expandAll((AbstractBuild<?, ?>) run, listener, url); } } catch (IOException | InterruptedException | MacroEvaluationException ex) { PrintStream logger = listener.getLogger(); logger.println("Unable to expand Stash Server URL"); ex.printStackTrace(logger); } return url; }

Target:
private String expandStashURL(Run<?, ?> run, final TaskListener listener) { String url = stashServerBaseUrl; DescriptorImpl descriptor = getDescriptor(); if (url == null || url.isEmpty()) { url = descriptor.getStashRootUrl(); } try { if (!(run instanceof AbstractBuild<?, ?>)) { url = TokenMacro.expandAll(run, new FilePath(run.getRootDir()), listener, url); } else { url = TokenMacro.expandAll((AbstractBuild<?, ?>) run, listener, url); } } catch (IOException | InterruptedException | MacroEvaluationException ex) { PrintStream logger = listener.getLogger(); logger.println("Unable to expand Stash Server URL"); ex.printStackTrace(logger); } return url; }
Source:
public String getUrl() { String url = type.getUrl(host, port, database); if (this.type == DBMSType.MYSQL) { url += "?allowPublicKeyRetrieval=true"; url += "&useSSL=" + this.isUseSSL(); } return url; }

Target:
public String getUrl() { String url = type.getUrl(host, port, database); return url; }
Source:
public void should_notMapTaskVariables_when_thereIsNoMapping() { ProcessInstance processInstance = processBaseRuntime.startProcessWithProcessDefinitionKey(TASK_NO_MAPPING); List<Task> tasks = taskBaseRuntime.getTasksByProcessInstanceId(processInstance.getId()); assertThat(tasks).isNotEmpty(); assertThat(tasks).hasSize(1); Task task = tasks.get(0); assertThat(task.getName()).isEqualTo("testSimpleTask"); List<VariableInstance> procVariables = processBaseRuntime.getProcessVariablesByProcessId(processInstance.getId()); assertThat(procVariables) .isNotNull() .extracting(VariableInstance::getName, VariableInstance::getValue) .containsOnly(tuple("process_variable_unmapped_1", "unmapped1Value"), tuple("process_variable_inputmap_1", "inputmap1Value"), tuple("process_variable_outputmap_1", "outputmap1Value")); List<VariableInstance> taskVariables = taskBaseRuntime.getTasksVariablesByTaskId(task.getId()); assertThat(taskVariables) .isEmpty(); Map<String, Object> variables = new HashMap<>(); variables.put("task_input_variable_name_1", "outputValue"); variables.put("task_output_variable_name_1", "outputTaskValue"); taskBaseRuntime.completeTask(task.getId(), variables); assertThat(procVariables) .isNotNull() .extracting(VariableInstance::getName, VariableInstance::getValue) .containsOnly(tuple("process_variable_unmapped_1", "unmapped1Value"), tuple("process_variable_inputmap_1", "inputmap1Value"), tuple("process_variable_outputmap_1", "outputmap1Value")); processBaseRuntime.delete(processInstance.getId()); }

Target:
public void should_notMapTaskVariables_when_thereIsNoMapping() { ProcessInstance processInstance = processBaseRuntime.startProcessWithProcessDefinitionKey(TASK_NO_MAPPING); List<Task> tasks = taskBaseRuntime.getTasksByProcessInstanceId(processInstance.getId()); assertThat(tasks).hasSize(1); Task task = tasks.get(0); assertThat(task.getName()).isEqualTo("testSimpleTask"); List<VariableInstance> procVariables = processBaseRuntime.getProcessVariablesByProcessId(processInstance.getId()); assertThat(procVariables) .isNotNull() .extracting(VariableInstance::getName, VariableInstance::getValue) .containsOnly(tuple("process_variable_unmapped_1", "unmapped1Value"), tuple("process_variable_inputmap_1", "inputmap1Value"), tuple("process_variable_outputmap_1", "outputmap1Value")); List<VariableInstance> taskVariables = taskBaseRuntime.getTasksVariablesByTaskId(task.getId()); assertThat(taskVariables) .isEmpty(); Map<String, Object> variables = new HashMap<>(); variables.put("task_input_variable_name_1", "outputValue"); variables.put("task_output_variable_name_1", "outputTaskValue"); taskBaseRuntime.completeTask(task.getId(), variables); assertThat(procVariables) .isNotNull() .extracting(VariableInstance::getName, VariableInstance::getValue) .containsOnly(tuple("process_variable_unmapped_1", "unmapped1Value"), tuple("process_variable_inputmap_1", "inputmap1Value"), tuple("process_variable_outputmap_1", "outputmap1Value")); }
Source:
public UpdateCalibrationResponse putBatchCalibration(@Auth final AccessToken accessToken, final List<Calibration> calibrations) { if (calibrations.size() > CalibrationDynamoDB.MAX_PUT_SIZE){ throw new WebApplicationException(Response.status(400).entity(new JsonError(400, String.format("Batch size shhould be less than %s", CalibrationDynamoDB.MAX_PUT_SIZE))).build()); } final Map<String, Optional<Boolean>> putBatchResponse = calibrationDAO.putBatch(calibrations); return UpdateCalibrationResponse.createFromPutBatchResponse(putBatchResponse); }

Target:
public UpdateCalibrationResponse putBatchCalibration(@Auth final AccessToken accessToken, final List<Calibration> calibrations) { if (calibrations.size() > CalibrationDynamoDB.MAX_PUT_SIZE){ throw new WebApplicationException(Response.status(400).entity(new JsonError(400, String.format("Batch size should be less than %s", CalibrationDynamoDB.MAX_PUT_SIZE))).build()); } final Map<String, Optional<Boolean>> putBatchResponse = calibrationDAO.putBatch(calibrations); return UpdateCalibrationResponse.createFromPutBatchResponse(putBatchResponse); }
Source:
public DeleteByQueryResultAssessor(JestAPIFormatter formatter) { super(); this.formatter = formatter; this.delegate = DefaultBackendRequestResultAssessor.builder( formatter ) .ignoreErrorStatuses( NOT_FOUNT_HTTP_STATUS_CODE ).build(); }

Target:
public DeleteByQueryResultAssessor(JestAPIFormatter formatter) { this.formatter = formatter; this.delegate = DefaultBackendRequestResultAssessor.builder( formatter ) .ignoreErrorStatuses( NOT_FOUND_HTTP_STATUS_CODE ).build(); }
Source:
public void testAllScriptsNotContainAPIBinding() throws InvalidScriptException { Script s = scriptWithoutApiBinding(); FlowScript fs = flowScriptWithoutApiBinding(); Mockito.when(it.getPreScript()).thenReturn(s); Mockito.when(it.getPostScript()).thenReturn(s); Mockito.when(sec.getScript()).thenReturn(s); Mockito.when(fe.getEnvScript()).thenReturn(s); Mockito.when(it.getFlowScript()).thenReturn(fs); Boolean result = new CheckEligibleTaskDescriptorScript().isTaskContainsAPIBinding(etd); assertEquals(false, result); }

Target:
public void testAllScriptsNotContainAPIBinding() throws InvalidScriptException { Script s = scriptWithoutApiBinding(); FlowScript fs = flowScriptWithoutApiBinding(); Mockito.when(it.getPreScript()).thenReturn(s); Mockito.when(it.getPostScript()).thenReturn(s); Mockito.when(sec.getScript()).thenReturn(s); Mockito.when(fe.getEnvScript()).thenReturn(s); Mockito.when(it.getFlowScript()).thenReturn(fs); assertFalse(new CheckEligibleTaskDescriptorScript().isTaskContainsAPIBinding(etd)); }
Source:
private Map<String, ?> getSystemProperties(Map<String, Object> metadata) { if (version.equals(MigrationContextImpl.SYSTEM_PROPERTIES_NOT_EXPORTED_VERSION)) { return AccessUtils.doPrivileged( () -> { ImportMigrationContext platformMigrationContext = contexts.get(MigrationContextImpl.PLATFORM_MIGRATABLE_ID); try { URL systemPropsURL = new URL( null, MigrationURLConnection.SYSTEM_PROPERTIES_URL, new URLStreamHandler() { @Override protected URLConnection openConnection(URL u) throws IOException { return new MigrationURLConnection(u, platformMigrationContext); } }); return PropertiesLoader.loadPropertiesFile(systemPropsURL, true); } catch (Exception e) { throw new MigrationException(Messages.IMPORT_SYSTEM_PROPERTIES_ERROR, e); } }); } return JsonUtils.getMapFrom( metadata, MigrationContextImpl.METADATA_EXPANDED_SYSTEM_PROPERTIES, true); }

Target:
private Map<String, ?> getSystemProperties(Map<String, Object> metadata) { if (version.equals(MigrationContextImpl.SYSTEM_PROPERTIES_NOT_EXPORTED_VERSION)) { ImportMigrationContext platformMigrationContext = contexts.get(MigrationContextImpl.PLATFORM_MIGRATABLE_ID); return AccessUtils.doPrivileged( () -> getSystemPropertiesFromContext(platformMigrationContext)); } return JsonUtils.getMapFrom( metadata, MigrationContextImpl.METADATA_EXPANDED_SYSTEM_PROPERTIES, true); }
Source:
protected CreateContainerCmd dockerCommand() { ExposedPort consulHTTPPort = ExposedPort.tcp(ConsulConfig.CONSUL_HTTP_PORT); ExposedPort consulDNSPort = ExposedPort.udp(ConsulConfig.CONSUL_DNS_PORT); Ports portBindings = new Ports(); if (getCluster().isExposedHostPorts()) { portBindings.bind(consulHTTPPort, Ports.Binding(ConsulConfig.CONSUL_HTTP_PORT)); } portBindings.bind(consulDNSPort, Ports.Binding("172.17.0.1", 53)); return dockerClient.createContainerCmd(config.getImageName() + ":" + config.getImageTag()) .withName(getName()) .withPortBindings(portBindings) .withExposedPorts(consulHTTPPort, consulDNSPort); }

Target:
protected CreateContainerCmd dockerCommand() { ExposedPort consulHTTPPort = ExposedPort.tcp(ConsulConfig.CONSUL_HTTP_PORT); ExposedPort consulDNSPort = ExposedPort.udp(ConsulConfig.CONSUL_DNS_PORT); Ports portBindings = new Ports(); if (getCluster().isExposedHostPorts()) { portBindings.bind(consulHTTPPort, Ports.Binding(ConsulConfig.CONSUL_HTTP_PORT)); } String gatewayIpAddress = DockerContainersUtil.getGatewayIpAddress(dockerClient); portBindings.bind(consulDNSPort, Ports.Binding(gatewayIpAddress, DNS_PORT)); return dockerClient.createContainerCmd(config.getImageName() + ":" + config.getImageTag()) .withName(getName()) .withPortBindings(portBindings) .withExposedPorts(consulHTTPPort, consulDNSPort); }
Source:
protected void cleanup(IProgressMonitor monitor, Map<String, IProject> projectMapping) { addProjectsToSession(projectMapping); for (IProject project : projectMapping.values()) activityQueuer.disableQueuing(project); super.cleanup(monitor, projectMapping); }

Target:
protected void cleanup(IProgressMonitor monitor, Map<String, IProject> projectMapping) { for (IProject project : projectMapping.values()) activityQueuer.disableQueuing(project); super.cleanup(monitor, projectMapping); }
Source:
private void extractDataSourceMetadata(GraphRewrite event, JavaTypeReferenceModel javaTypeReference) { javaTypeReference.getFile().setGenerateSourceReport(true); JavaAnnotationTypeReferenceModel annotationTypeReference = (JavaAnnotationTypeReferenceModel) javaTypeReference; JavaClassModel datasourceClass = getJavaClass(javaTypeReference); String dataSourceName = getAnnotationLiteralValue(annotationTypeReference, "name"); if (Strings.isNullOrEmpty(dataSourceName)) { dataSourceName = datasourceClass.getClassName(); } String isXaString = getAnnotationLiteralValue(annotationTypeReference, "transactional"); boolean isXa = isXaString == null || Boolean.getBoolean(isXaString); Service<DataSourceModel> dataSourceService = new GraphService<>(event.getGraphContext(), DataSourceModel.class); DataSourceModel dataSourceModel = dataSourceService.create(); Set<ProjectModel> applications = ProjectTraversalCache.getApplicationsForProject(event.getGraphContext(), javaTypeReference.getFile().getProjectModel()); dataSourceModel.setApplications(applications); dataSourceModel.setName(dataSourceName); dataSourceModel.setXa(isXa); }

Target:
private void extractDataSourceMetadata(GraphRewrite event, JavaTypeReferenceModel javaTypeReference) { javaTypeReference.getFile().setGenerateSourceReport(true); JavaAnnotationTypeReferenceModel annotationTypeReference = (JavaAnnotationTypeReferenceModel) javaTypeReference; JavaClassModel datasourceClass = getJavaClass(javaTypeReference); String dataSourceName = getAnnotationLiteralValue(annotationTypeReference, "name"); if (Strings.isNullOrEmpty(dataSourceName)) { dataSourceName = datasourceClass.getClassName(); } String isXaString = getAnnotationLiteralValue(annotationTypeReference, "transactional"); boolean isXa = isXaString == null || Boolean.getBoolean(isXaString); Service<DataSourceModel> dataSourceService = new GraphService<>(event.getGraphContext(), DataSourceModel.class); DataSourceModel dataSourceModel = dataSourceService.create(); Set<ProjectModel> applications = ProjectTraversalCache.getApplicationsForProject(event.getGraphContext(), javaTypeReference.getFile().getProjectModel()); dataSourceModel.setApplications(applications); dataSourceModel.setName(dataSourceName); dataSourceModel.setXa(isXa); dataSourceModel.setJndiLocation(dataSourceName); }
Source:
public ScanStatus getScanStatus() { if (scanStatus == null) { scanStatus = new ScanStatus( new ImageIcon( ExtensionPassiveScan.class.getResource("/resource/icon/16/pscan.png")), Constant.messages.getString("pscan.footer.label")); } return scanStatus; }

Target:
protected ScanStatus getScanStatus() { if (scanStatus == null) { scanStatus = new ScanStatus( new ImageIcon( ExtensionPassiveScan.class.getResource("/resource/icon/16/pscan.png")), Constant.messages.getString("pscan.footer.label")); } return scanStatus; }
Source:
public SamplingDistribution(Operator child, float samplePercentage, SamplingType sampleType, Long randomSeed) { this(child, sampleType, randomSeed); this.isPercentageSample = true; this.samplePercentage = samplePercentage; Preconditions.checkState(samplePercentage >= 0 && samplePercentage <= 100, "Sample Percentage must be >= 0 && <= 100: %s", samplePercentage); }

Target:
public SamplingDistribution(Operator child, float samplePercentage, SamplingType sampleType, Long randomSeed) { this(child, sampleType, randomSeed); this.isPercentageSample = true; this.samplePercentage = samplePercentage; Preconditions.checkArgument(samplePercentage >= 0 && samplePercentage <= 100, "Sample Percentage must be >= 0 && <= 100: %s", samplePercentage); }
Source:
public void initialise() { playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); refractiveReflectiveFbo = requiresFBO(new FBOConfig(REFRACTIVE_REFLECTIVE, FULL_SCALE, FBO.Type.HDR).useNormalBuffer(), displayResolutionDependentFBOs); addDesiredStateChange(new BindFBO(REFRACTIVE_REFLECTIVE, displayResolutionDependentFBOs)); readOnlyGBufferFbo = displayResolutionDependentFBOs.get(READONLY_GBUFFER); addDesiredStateChange(new EnableMaterial(CHUNK_SHADER.toString())); chunkShader = getMaterial(CHUNK_SHADER); displayResolutionDependentFBOs.subscribe(this); }

Target:
public void initialise() { playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); requiresFBO(new FBOConfig(REFRACTIVE_REFLECTIVE, FULL_SCALE, FBO.Type.HDR).useNormalBuffer(), displayResolutionDependentFBOs); addDesiredStateChange(new BindFBO(REFRACTIVE_REFLECTIVE, displayResolutionDependentFBOs)); update(); displayResolutionDependentFBOs.subscribe(this); addDesiredStateChange(new EnableMaterial(CHUNK_SHADER.toString())); chunkShader = getMaterial(CHUNK_SHADER); }
Source:
public void shutdownRevisionExecutor() throws InterruptedException { getRevisionExecutor().shutdownNow(); getRevisionExecutor().awaitTermination(0, TimeUnit.SECONDS); }

Target:
public void shutdownRevisionExecutor() throws InterruptedException { getRevisionExecutor().shutdownNow(); getRevisionExecutor().awaitTermination(getCommandTimeout(), TimeUnit.SECONDS); }
Source:
private void testGetInsertion() throws Exception { String url = "/ats/program/" + getSawProgram().getArtId() + "/insertion"; JsonArray array = getAndCheck(url); JsonObject obj = getObjectNamed("JAX Insertion", array); Assert.assertNotNull("Did not find value Jax Insertion", obj); }

Target:
private void testGetInsertion() throws Exception { String url = "/ats/program/" + getSawProgram().getUuid() + "/insertion"; JsonArray array = getAndCheck(url); JsonObject obj = getObjectNamed("JAX Insertion", array); Assert.assertNotNull("Did not find value Jax Insertion", obj); }
Source:
public void testFilterSortingMigration() { ResourceSet set = new ResourceSetImpl(); DAnalysis analysis = null; try { analysis = (DAnalysis) ModelUtils.load(URI.createPlatformResourceURI(TEMPORARY_PROJECT_NAME + "/" + SESSION_RESOURCE_NAME, true), set); } catch (IOException e) { failCheckData(); } assertNotNull("Check the representation file test data.", analysis); String version = analysis.getVersion(); assertTrue("Before save, the migration framework will return true even if the migration has been done during load.", RepresentationsFileMigrationService.getInstance().isMigrationNeeded(Version.parseVersion(version))); try { analysis.eResource().save(Collections.emptyMap()); } catch (IOException e) { failCheckData(); } version = analysis.getVersion(); DDiagram diagram = (DDiagram) analysis.getOwnedViews().get(0).getOwnedRepresentationDescriptors().get(0).getRepresentation(); assertEquals("Activated filters have not been sorted.", "ClassFilter", diagram.getActivatedFilters().get(0).getName()); assertEquals("Activated filters have not been sorted.", "ClassFilter2", diagram.getActivatedFilters().get(1).getName()); assertFalse(getErrorLoggersMessage(), doesAnErrorOccurs()); }

Target:
public void testFilterSortingMigration() { ResourceSet set = new ResourceSetImpl(); DAnalysis analysis = null; try { analysis = (DAnalysis) ModelUtils.load(URI.createPlatformResourceURI(TEMPORARY_PROJECT_NAME + "/" + SESSION_RESOURCE_NAME, true), set); } catch (IOException e) { failCheckData(); } assertNotNull("Check the representation file test data.", analysis); String version = analysis.getVersion(); assertTrue("Before save, the migration framework will return true even if the migration has been done during load.", RepresentationsFileMigrationService.getInstance().isMigrationNeeded(Version.parseVersion(version))); try { analysis.eResource().save(Collections.emptyMap()); } catch (IOException e) { failCheckData(); } version = analysis.getVersion(); assertFalse("The version tag should now be set telling that the migration was done.", RepresentationsFileMigrationService.getInstance().isMigrationNeeded(Version.parseVersion(version))); DDiagram diagram = (DDiagram) analysis.getOwnedViews().get(0).getOwnedRepresentationDescriptors().get(0).getRepresentation(); assertEquals("Activated filters have not been sorted.", "ClassFilter", diagram.getActivatedFilters().get(0).getName()); assertEquals("Activated filters have not been sorted.", "ClassFilter2", diagram.getActivatedFilters().get(1).getName()); assertFalse(getErrorLoggersMessage(), doesAnErrorOccurs()); }
Source:
private ChannelPool getDataChannelPool() throws IOException { String host = options.getDataHost(); int channelCount = options.getChannelCount(); if (options.useCachedChannel() && !CredentialOptions.nullCredential().equals(options.getCredentialOptions())) { synchronized (BigtableSession.class) { if (cachedDataChannelPool == null) { cachedDataChannelPool = createChannelPool(host, channelCount); } return cachedDataChannelPool; } } return createManagedPool(host, channelCount); }

Target:
private ChannelPool getDataChannelPool() throws IOException { String host = options.getDataHost(); int channelCount = options.getChannelCount(); if (options.useCachedChannel()) { synchronized (BigtableSession.class) { if (cachedDataChannelPool == null) { cachedDataChannelPool = createChannelPool(host, channelCount); } return cachedDataChannelPool; } } return createManagedPool(host, channelCount); }
Source:
public double getValueByName(String row, String column) { if (!inited) init(); Integer rowIndex = rowMap.get(row); Integer columnIndex = columnMap.get(column); if (rowIndex == null) throw new MolgenisDataException("Unknown row name [" + row + "]"); if (rowIndex == null) throw new MolgenisDataException("Unknown column name [" + column + "]"); return getValueByIndex(rowIndex, columnIndex); }

Target:
public double getValueByName(String row, String column) { if (!inited) init(); Integer rowIndex = rowMap.get(row); Integer columnIndex = columnMap.get(column); if (rowIndex == null) throw new MolgenisDataException("Unknown row name [" + row + "]"); if (columnIndex == null) throw new MolgenisDataException("Unknown column name [" + column + "]"); return getValueByIndex(rowIndex, columnIndex); }
Source:
private void mkdirsAllWorkingDirs(DefaultInputModule module) { for (DefaultInputModule sub : moduleHierarchy.children(module)) { mkdirsAllWorkingDirs(sub); } try { org.apache.commons.io.FileUtils.forceMkdir(module.getWorkDir().toFile()); } catch (Exception e) { throw new IllegalStateException("Fail to create working dir: " + module.getWorkDir(), e); } }

Target:
private void mkdirsAllWorkingDirs(DefaultInputModule module) { for (DefaultInputModule sub : moduleHierarchy.children(module)) { mkdirsAllWorkingDirs(sub); } try { Files.createDirectories(module.getWorkDir()); } catch (Exception e) { throw new IllegalStateException("Fail to create working dir: " + module.getWorkDir(), e); } }
Source:
private void visit(Tree tree, Tree terminator) { LOG.debug("visiting node " + tree.kind().name() + " at line " + ((JavaTree) tree).getLine()); switch (tree.kind()) { case LABELED_STATEMENT: case SWITCH_STATEMENT: case EXPRESSION_STATEMENT: case PARENTHESIZED_EXPRESSION: throw new IllegalStateException("Cannot appear in CFG: " + tree.kind().name()); case VARIABLE: VariableTree variableTree = (VariableTree) tree; ExpressionTree initializer = variableTree.initializer(); if (initializer == null) { if (terminator != null && terminator.is(Tree.Kind.FOR_EACH_STATEMENT)) { setSymbolicValueForEachValue(variableTree); } else if (variableTree.type().symbolType().is("boolean")) { setSymbolicValueFalseValue(variableTree); } else if (!variableTree.type().symbolType().isPrimitive()) { setSymbolicValueNullValue(variableTree); } } else { setSymbolicValueValueFromInitializer(variableTree, initializer); } break; case ASSIGNMENT: AssignmentExpressionTree assignmentExpressionTree = ((AssignmentExpressionTree) tree); if (assignmentExpressionTree.variable().is(Tree.Kind.IDENTIFIER)) { SymbolicValue value = getVal(assignmentExpressionTree.expression()); programState = put(programState, ((IdentifierTree) assignmentExpressionTree.variable()).symbol(), value); } break; case METHOD_INVOCATION: setSymbolicValueOnFields((MethodInvocationTree) tree); break; case IDENTIFIER: if (terminator != null && terminator.is(Tree.Kind.SYNCHRONIZED_STATEMENT)) { resetConstraintsOnFields(); } default: } checkerDispatcher.executeCheckPreStatement(tree); }

Target:
private void visit(Tree tree, Tree terminator) { LOG.debug("visiting node " + tree.kind().name() + " at line " + ((JavaTree) tree).getLine()); switch (tree.kind()) { case LABELED_STATEMENT: case SWITCH_STATEMENT: case EXPRESSION_STATEMENT: case PARENTHESIZED_EXPRESSION: throw new IllegalStateException("Cannot appear in CFG: " + tree.kind().name()); case VARIABLE: VariableTree variableTree = (VariableTree) tree; ExpressionTree initializer = variableTree.initializer(); if (initializer == null) { if (terminator != null && terminator.is(Tree.Kind.FOR_EACH_STATEMENT)) { setSymbolicValueForEachValue(variableTree); } else if (variableTree.type().symbolType().is("boolean")) { setSymbolicValueFalseValue(variableTree); } else if (!variableTree.type().symbolType().isPrimitive()) { setSymbolicValueNullValue(variableTree); } } else { setSymbolicValueValueFromInitializer(variableTree, initializer); } break; case ASSIGNMENT: AssignmentExpressionTree assignmentExpressionTree = (AssignmentExpressionTree) tree; if (assignmentExpressionTree.variable().is(Tree.Kind.IDENTIFIER)) { SymbolicValue value = getVal(assignmentExpressionTree.expression()); programState = put(programState, ((IdentifierTree) assignmentExpressionTree.variable()).symbol(), value); } break; case METHOD_INVOCATION: setSymbolicValueOnFields((MethodInvocationTree) tree); break; case IDENTIFIER: if (terminator != null && terminator.is(Tree.Kind.SYNCHRONIZED_STATEMENT)) { resetConstraintsOnFields(); } break; default: } checkerDispatcher.executeCheckPreStatement(tree); }
Source:
public boolean isStarted() { return isStarted; }

Target:
boolean isStarted() { return isStarted; }
Source:
private void cleanupChunks(ShardCommitCleanerDao shard, long now, List<TableChunk> chunks, Set<Long> droppedTableIds) { deletedChunksDao.insertDeletedChunks(now, chunks); chunks.stream() .filter(chunk -> !droppedTableIds.contains(chunk.getTableId())) .collect(groupingBy(TableChunk::getTableId)) .forEach((tableId, tableChunks) -> shard.deleteIndexChunks(chunkIndexTable(tableId), toChunkIds(tableChunks))); shard.deleteChunks(toChunkIds(chunks)); }

Target:
private void cleanupChunks(ShardCommitCleanerDao shard, long now, List<TableChunk> chunks, Set<Long> droppedTableIds) { deletedChunksDao.insertDeletedChunks(now, now, chunks); chunks.stream() .filter(chunk -> !droppedTableIds.contains(chunk.getTableId())) .collect(groupingBy(TableChunk::getTableId)) .forEach((tableId, tableChunks) -> shard.deleteIndexChunks(chunkIndexTable(tableId), toChunkIds(tableChunks))); shard.deleteChunks(toChunkIds(chunks)); }
Source:
public HttpRequest setMethod(HttpMethod method) { ObjectUtil.checkNotNull(method, "method"); this.method = method; return this; }

Target:
public HttpRequest setMethod(HttpMethod method) { this.method = ObjectUtil.checkNotNull(method, "method"); return this; }
Source:
private void testGetInsertionFeature() throws Exception { String url = "/ats/program/" + getSawProgram().getArtId() + "/insertion/1234567800/feature"; JsonArray array = getAndCheck(url); Assert.assertEquals(1, array.size()); JsonObject obj = getObjectNamed("JAX Insertion Feature", array); Assert.assertNotNull("Did not find value Jax Insertion Feature", obj); }

Target:
private void testGetInsertionFeature() throws Exception { String url = "/ats/program/" + getSawProgram().getUuid() + "/insertion/1234567800/feature"; JsonArray array = getAndCheck(url); Assert.assertEquals(1, array.size()); JsonObject obj = getObjectNamed("JAX Insertion Feature", array); Assert.assertNotNull("Did not find value Jax Insertion Feature", obj); }
Source:
private List<Repository> getRepositories() { List<Repository> reposList = new LinkedList<Repository>(); Iterator<RepositoryTreeNode> it = ((IStructuredSelection) repositoryTableViewer.getSelection()).iterator(); while (it.hasNext()) { reposList.add(it.next().getRepository()); } return reposList; }

Target:
private List<Repository> getRepositories() { List<Repository> reposList = new LinkedList<Repository>(); Iterator<RepositoryTreeNode> it = ((IStructuredSelection) repositoryTableViewer.getSelection()).iterator(); while (it.hasNext()) reposList.add(it.next().getRepository()); return reposList; }
Source:
public E take() throws InterruptedException { ThroughputElement<E> e = this.underlyingQueue.take(); this.elementsRemoved.incrementAndGet(); Long queueTime = e.getWaited(); this.totalQueueTime.addAndGet(queueTime); boolean unlocked = false; try { this.maxQueueTimeLock.readLock().lock(); if (this.maxQueuedTime < queueTime) { this.maxQueueTimeLock.readLock().unlock(); unlocked = true; try { this.maxQueueTimeLock.writeLock().lock(); this.maxQueuedTime = queueTime; } finally { this.maxQueueTimeLock.writeLock().unlock(); } } } finally { if(!unlocked) this.maxQueueTimeLock.readLock().unlock(); } return e.getElement(); }

Target:
public E take() throws InterruptedException { ThroughputElement<E> e = this.underlyingQueue.take(); internalRemoveElement(e); return e.getElement(); }
Source:
public void testService() throws Exception { final CloseableHttpClient client = create().build(); final String baseUrl = "http://localhost:" + System.getProperty("fcrepo.port") + "/fcrepo/rest"; final CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.name=FcrepoService)", 10000); assertNotNull(ctx); final MockEndpoint resultEndpoint = (MockEndpoint) ctx.getEndpoint("mock:result"); final String url1 = post(baseUrl).replace(baseUrl, ""); final String url2 = post(baseUrl).replace(baseUrl, ""); final ProducerTemplate template = ctx.createProducerTemplate(); final Map<String, Object> headers = new HashMap<>(); headers.put(FCREPO_BASE_URL, baseUrl); headers.put(FCREPO_IDENTIFIER, url1); template.sendBodyAndHeaders(ctx.getEndpoint("direct:start"), null, headers); headers.put(FCREPO_IDENTIFIER, url2); template.sendBodyAndHeaders(ctx.getEndpoint("direct:start"), null, headers); resultEndpoint.expectedMinimumMessageCount(2); assertIsSatisfied(resultEndpoint); }

Target:
public void testService() throws Exception { final String baseUrl = "http://localhost:" + System.getProperty("fcrepo.port") + "/fcrepo/rest"; final CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.name=FcrepoService)", 10000); assertNotNull(ctx); final MockEndpoint resultEndpoint = (MockEndpoint) ctx.getEndpoint("mock:result"); final String url1 = post(baseUrl).replace(baseUrl, ""); final String url2 = post(baseUrl).replace(baseUrl, ""); final ProducerTemplate template = ctx.createProducerTemplate(); final Map<String, Object> headers = new HashMap<>(); headers.put(FCREPO_BASE_URL, baseUrl); headers.put(FCREPO_IDENTIFIER, url1); template.sendBodyAndHeaders(ctx.getEndpoint("direct:start"), null, headers); headers.put(FCREPO_IDENTIFIER, url2); template.sendBodyAndHeaders(ctx.getEndpoint("direct:start"), null, headers); resultEndpoint.expectedMinimumMessageCount(2); assertIsSatisfied(resultEndpoint); }
Source:
public Proxy getProxy() { if (this.proxy == null) { return Proxy.NO_PROXY; } else { return this.proxy; } }

Target:
public Proxy getProxy() { return this.proxy; }
Source:
public Map<String, ApiClusterTemplateService> getAdditionalServices(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source) { if (isConfigurationNeeded(cmTemplateProcessor, source)) { ApiClusterTemplateService coreSettings = createTemplate(); Set<HostgroupView> hostgroupViews = source.getHostgroupViews(); return hostgroupViews.stream() .filter(hg -> hg.getName().toLowerCase().equals("master") || hg.getName().toLowerCase().equals("main")) .collect(Collectors.toMap(HostgroupView::getName, v -> coreSettings)); } return Map.of(); }

Target:
public Map<String, ApiClusterTemplateService> getAdditionalServices(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source) { if (isConfigurationNeeded(cmTemplateProcessor, source)) { ApiClusterTemplateService coreSettings = createTemplate(); Set<HostgroupView> hostgroupViews = source.getHostgroupViews(); return hostgroupViews.stream() .filter(hg -> hg.getName().toLowerCase().equals("master")) .collect(Collectors.toMap(HostgroupView::getName, v -> coreSettings)); } return Map.of(); }
Source:
public void testUseNonExistingCatalog() throws Exception { TestingExecutor executor = new TestingExecutorBuilder() .setExecuteSqlConsumer((ignored1, ignored2) -> { throw new SqlExecutionException("mocked exception"); }) .build(); InputStream inputStream = new ByteArrayInputStream("use catalog cat;\n".getBytes()); SessionContext sessionContext = new SessionContext("test-session", new Environment()); String sessionId = executor.openSession(sessionContext); try (Terminal terminal = new DumbTerminal(inputStream, new MockOutputStream()); CliClient client = new CliClient(terminal, sessionId, executor, File.createTempFile("history", "tmp").toPath())) { client.open(); assertThat(executor.getNumExecuteSqlCalls(), is(1)); } }

Target:
public void testUseNonExistingCatalog() throws Exception { TestingExecutor executor = new TestingExecutorBuilder() .setExecuteSqlConsumer((ignored1, ignored2) -> { throw new SqlExecutionException("mocked exception"); }) .build(); InputStream inputStream = new ByteArrayInputStream("use catalog cat;\n".getBytes()); SessionContext sessionContext = new SessionContext("test-session", new Environment()); String sessionId = executor.openSession(sessionContext); try (Terminal terminal = new DumbTerminal(inputStream, new MockOutputStream()); CliClient client = new CliClient(terminal, sessionId, executor, historyTempFile())) { client.open(); assertThat(executor.getNumExecuteSqlCalls(), is(1)); } }
Source:
public void createTraceFile() throws Throwable { startRemoteSession(); setTracepoints(); MIBreakpointDMContext bptDMC = setBreakpointAtEndLine(); startTracing(); MIStoppedEvent stoppedEvent = SyncUtil.resumeUntilStopped(); Assert.assertTrue(stoppedEvent instanceof MIBreakpointHitEvent && ((MIBreakpointHitEvent)stoppedEvent).getNumber() == bptDMC.getReference()); stopTracing(); saveTraceData(); shutdownRemoteSession(); }

Target:
public void createTraceFile() throws Throwable { deleteOldTraceFile(); startRemoteSession(); setTracepoints(); MIBreakpointDMContext bptDMC = setBreakpointAtEndLine(); startTracing(); MIStoppedEvent stoppedEvent = SyncUtil.resumeUntilStopped(); assertTrue(stoppedEvent instanceof MIBreakpointHitEvent && ((MIBreakpointHitEvent)stoppedEvent).getNumber() == bptDMC.getReference()); stopTracing(); saveTraceData(); }
Source:
private static void addParseTransforms(GeneralCommandLine commandLine, JpsModule module) throws ProjectBuildException { JpsErlangModuleExtension extension = JpsErlangModuleExtension.getExtension(module); LinkedHashSet<String> parseTransforms = extension != null ? extension.getParseTransforms() : null; if (parseTransforms == null || parseTransforms.isEmpty()) return; for (String ptModule : parseTransforms) { commandLine.addParameter("+{parse_transform, " + ptModule + "}"); } }

Target:
private static void addParseTransforms(GeneralCommandLine commandLine, JpsModule module) throws ProjectBuildException { JpsErlangModuleExtension extension = JpsErlangModuleExtension.getExtension(module); List<String> parseTransforms = extension != null ? extension.getParseTransforms() : Collections.<String>emptyList(); if (parseTransforms.isEmpty()) return; for (String ptModule : parseTransforms) { commandLine.addParameter("+{parse_transform, " + ptModule + "}"); } }
Source:
public void testOpenRemoteXBeeAlreadyOpen() throws XBeeException { Mockito.when(connectionInterface.isOpen()).thenReturn(true); remoteXBeeDevice.open(); assertTrue(remoteXBeeDevice.isOpen()); remoteXBeeDevice.close(); assertFalse(remoteXBeeDevice.isOpen()); }

Target:
public void testOpenRemoteXBeeAlreadyOpen() { Mockito.when(connectionInterface.isOpen()).thenReturn(true); try { remoteXBeeDevice.open(); fail("Device shouldn't have connected"); } catch (Exception e) { assertEquals(InterfaceAlreadyOpenException.class, e.getClass()); } assertTrue(remoteXBeeDevice.isOpen()); remoteXBeeDevice.close(); assertFalse(remoteXBeeDevice.isOpen()); }
Source:
public static JSONObject objectToObject(org.json.JSONObject obj){ assert(obj instanceof JSONObject); return (JSONObject) obj; }

Target:
public static JSONObject objectToObject(org.json.JSONObject obj){ Assert.that(obj == null || (obj instanceof JSONObject), "Object "+ obj+" should have been an instance of our JSONObject."); return (JSONObject) obj; }
Source:
public void execute(LifeCycleHookBinding.Operation operation, AsyncQuery query, RequestScope requestScope, Optional<ChangeSpec> changes) { if (query.getStatus() == QueryStatus.QUEUED && query.getResult() == null) { asyncExecutorService.executeQuery(query, requestScope.getUser(), requestScope.getApiVersion()); query.prePersist(); } }

Target:
public void execute(LifeCycleHookBinding.Operation operation, AsyncQuery query, RequestScope requestScope, Optional<ChangeSpec> changes) { if (query.getStatus() == QueryStatus.QUEUED && query.getResult() == null) { asyncExecutorService.executeQuery(query, requestScope.getUser(), requestScope.getApiVersion()); } }
Source:
private String getMetacardId(String resultId, QueryResponse response) { if (!StringUtils.isBlank(mappedMetacardIdField)) { Optional<SolrDocument> document = getResponseDocument(resultId, response); if (document.isPresent()) { Object val = document.get().getFirstValue(mappedMetacardIdField); if (val != null) { return val.toString(); } } } return resultId; }

Target:
private String getMetacardId(String resultId, QueryResponse response) { if (StringUtils.isNotBlank(mappedMetacardIdField)) { Optional<SolrDocument> document = getResponseDocument(resultId, response); if (document.isPresent()) { Object val = document.get().getFirstValue(mappedMetacardIdField); if (val != null) { return val.toString(); } } } return resultId; }
Source:
@Test public void test() { for (IClass iClass:cha) { for (IField field:iClass.getAllFields()) { TypeSignature sig = ((FieldImpl) field) .getGenericSignature(); if (sig == null) { continue; } if (sig.isClassTypeSignature()) { ((ClassTypeSignature)sig).getTypeArguments(); } } } }

Target:
@Test public void test() { TypeArgument.make("<Lorg/apache/hadoop/io/Text;[B>"); TypeArgument.make("<[TP_OUT;>"); }
Source:
public boolean equals(Object obj) { if(obj == this) return true; if(obj instanceof EquipmentType) { if(((EquipmentType) obj).getId().equals("ANY")) return true; if(((EquipmentType) obj).getId().equals(getId())) return true; } return false; }

Target:
public boolean equals(Object obj) { if (obj == this) { return true; } if (obj == null) { return false; } if (obj instanceof EquipmentType) { if (((EquipmentType) obj).getId().equals("ANY")) { return true; } if (((EquipmentType) obj).getId().equals(getId())) { return true; } } return false; }
Source:
public void onKeyPress(KeyPressEvent event) { if (event.getSource() == newTopic && event.getCharCode() == KeyCodes.KEY_ENTER) { doTopicEdit(); } }

Target:
public void onKeyPress(KeyPressEvent event) { if (event.getSource() == newTopic && event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) { doTopicEdit(); } }
Source:
public boolean isMothballing() { if (!isTech()) { return false; } for (UUID unitId : techUnitIds) { Unit u = campaign.getUnit(unitId); if (u != null && u.isMothballing()) { return true; } } return false; }

Target:
public boolean isMothballing() { if (!isTech()) { return false; } for (UUID unitId : techUnitIds) { Unit u = campaign.getUnit(unitId); if ((u != null) && u.isMothballing()) { return true; } } return false; }
Source:
public ContainerHeartbeatClient(String coordinatorUrl, String executionEnvContainerId) { this.heartbeatEndpoint = String.format("%s%s?%s=%s", coordinatorUrl, CoordinationConstants.CLUSTERBASED_CONTAINER_HEARTBEAT_SERVELET, CoordinationConstants.CLUSTERBASED_EXECUTION_ENVIRONMENT_CONTAINER_ID, executionEnvContainerId); }

Target:
public ContainerHeartbeatClient(String coordinatorUrl, String executionEnvContainerId) { this.heartbeatEndpoint = String.format(CoordinationConstants.YARN_CONTAINER_HEARTBEAT_ENDPOINT_FORMAT, coordinatorUrl, executionEnvContainerId); }