auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
static Option<?> getAndValidateOption(ClassLoader loader, String name) { if (!name.contains(".")) { name = "org.xnio.Options." + name; } return Option.fromString(name, loader); }

Target:
static Option<?> getAndValidateOption(ClassLoader loader, String name) throws OperationFailedException { if (!name.contains(".")) { name = "org.xnio.Options." + name; } try { return Option.fromString(name, loader); } catch (IllegalArgumentException iae) { throw RemotingLogger.ROOT_LOGGER.invalidOption(iae.getMessage()); } }
Source:
public void setDisplayValueFromModel() { if (this instanceof IntegerWidget || this instanceof ExIntegerWidget) { setDisplayIntegerValueFromModel(); } else if (this instanceof DecimalWidget || this instanceof ExDecimalWidget) { setDisplayDecimalValueFromModel(); } else { setDisplayStringValueFromModel(); } }

Target:
public void setDisplayValueFromModel() { if (this instanceof IntegerWidget || this instanceof ExIntegerWidget) { setDisplayIntegerValueFromModel(); } else if (this instanceof DecimalWidget || this instanceof ExDecimalWidget) { setDisplayDecimalValueFromModel(); } else { setDisplayStringValueFromModel(); } Selection.setSelection(answerText.getText(), answerText.getText().toString().length()); }
Source:
private void adjustKVMDataForBlockSD() { if (getVm().getOrigin() == OriginType.KVM && getActionState() == CommandActionState.EXECUTE && getStorageDomain() != null && getStorageDomain().getStorageType().isBlockDomain()) { getVm().getImages().forEach(image -> { image.setActualSizeInBytes(image.getSize()); image.setVolumeType(VolumeType.Preallocated); }); log.info("Block Storage Domains do not support Sparseness. The Importing of VM '{}' is defaulting to Preallocated.", getVm().getId()); } }

Target:
private void adjustKVMDataForBlockSD() { if (getVm().getOrigin() == OriginType.KVM && getActionState() == CommandActionState.EXECUTE && getStorageDomain() != null && getStorageDomain().getStorageType().isBlockDomain()) { getVm().getImages().forEach(image -> { image.setActualSizeInBytes(image.getSize()); image.setVolumeType(VolumeType.Preallocated); }); log.info("Block Storage Domains do not support Sparseness. The Importing of VM: '{}'({}) is defaulting to Preallocated.", getVm().getId(), getVm().getName()); } }
Source:
private JToggleButton getButtonUseTrackingSessionState() { if (useTrackingSessionState == null) { useTrackingSessionState = new JToggleButton(new ImageIcon( HttpPanelSender.class .getResource("/resource/icon/fugue/cookie.png"))); useTrackingSessionState.setToolTipText(Constant.messages .getString("manReq.checkBox.useSession")); ItemListener btnItemnListener = new ItemListener() { @Override public void itemStateChanged(ItemEvent itemEvent) { int state = itemEvent.getStateChange(); if (state == ItemEvent.SELECTED) { setUseTrackingSessionState(true); } else { setUseTrackingSessionState(false); } } }; useTrackingSessionState.addItemListener(btnItemnListener); } return useTrackingSessionState; }

Target:
private JToggleButton getButtonUseTrackingSessionState() { if (useTrackingSessionState == null) { useTrackingSessionState = new JToggleButton(new ImageIcon( HttpPanelSender.class .getResource("/resource/icon/fugue/cookie.png"))); useTrackingSessionState.setToolTipText(Constant.messages .getString("manReq.checkBox.useSession")); useTrackingSessionState.addItemListener(e -> setUseTrackingSessionState(e.getStateChange() == ItemEvent.SELECTED)); } return useTrackingSessionState; }
Source:
private void rebootUserspaceAndWaitForBootComplete() throws Exception { Duration timeout = Duration.ofMillis(getDevice().getIntProperty( "init.userspace_reboot.watchdog.timeoutmillis", 0)).plusMinutes(2); setProperty("test.userspace_reboot.requested", "1"); getDevice().rebootUserspaceUntilOnline(); assertWithMessage("Device did not boot withing 2 minutes").that( getDevice().waitForBootComplete(timeout.toMillis())).isTrue(); }

Target:
private void rebootUserspaceAndWaitForBootComplete() throws Exception { Duration timeout = Duration.ofMillis(getDevice().getIntProperty( "init.userspace_reboot.watchdog.timeoutmillis", 0)).plusMinutes(2); setProperty("test.userspace_reboot.requested", "1"); getDevice().rebootUserspaceUntilOnline(); assertWithMessage("Device did not boot within %s", timeout).that( getDevice().waitForBootComplete(timeout.toMillis())).isTrue(); }
Source:
public GraphicsConsole get() { for (GraphicsConsole graphicsConsole : parent.list().getGraphicsConsole()) { if (consoleId.equals(graphicsConsole.getId())) { return graphicsConsole; } } return null; }

Target:
public GraphicsConsole get() { List<String> supportedIds = new ArrayList<>(); for (GraphicsConsole graphicsConsole : parent.list().getGraphicsConsoles()) { if (consoleId.equals(graphicsConsole.getId())) { return graphicsConsole; } supportedIds.add(graphicsConsole.getId()); } Fault fault = new Fault(); fault.setReason("Unsupported console ID"); fault.setDetail("Supported console IDs are: " + StringUtils.join(supportedIds, ", ")); throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).entity(fault).build()); }
Source:
private long sendEligibleCalls(long now) { long pollTimeout = Long.MAX_VALUE; for (Iterator<Map.Entry<Node, List<Call>>> iter = callsToSend.entrySet().iterator(); iter.hasNext(); ) { Map.Entry<Node, List<Call>> entry = iter.next(); List<Call> calls = entry.getValue(); if (calls.isEmpty()) { iter.remove(); continue; } Node node = entry.getKey(); if (!client.ready(node, now)) { long nodeTimeout = client.pollDelayMs(node, now); pollTimeout = Math.min(pollTimeout, nodeTimeout); log.trace("Client is not ready to send to {}. Must delay ms", node, nodeTimeout); continue; } Call call = calls.remove(0); int timeoutMs = Math.min(requestTimeoutMs, calcTimeoutMsRemainingAsInt(now, call.deadlineMs)); AbstractRequest.Builder<?> requestBuilder; try { requestBuilder = call.createRequest(timeoutMs); } catch (Throwable throwable) { call.fail(now, new KafkaException(String.format( "Internal error sending %s to %s.", call.callName, node))); continue; } ClientRequest clientRequest = client.newClientRequest(node.idString(), requestBuilder, now, true); log.trace("Sending to {}. correlationId={}", requestBuilder, node, clientRequest.correlationId()); client.send(clientRequest, now); getOrCreateListValue(callsInFlight, node.idString()).add(call); correlationIdToCalls.put(clientRequest.correlationId(), call); } return pollTimeout; }

Target:
private long sendEligibleCalls(long now) { long pollTimeout = Long.MAX_VALUE; for (Iterator<Map.Entry<Node, List<Call>>> iter = callsToSend.entrySet().iterator(); iter.hasNext(); ) { Map.Entry<Node, List<Call>> entry = iter.next(); List<Call> calls = entry.getValue(); if (calls.isEmpty()) { iter.remove(); continue; } Node node = entry.getKey(); if (!client.ready(node, now)) { long nodeTimeout = client.pollDelayMs(node, now); pollTimeout = Math.min(pollTimeout, nodeTimeout); log.trace("Client is not ready to send to {}. Must delay ms", node, nodeTimeout); continue; } Call call = calls.remove(0); int timeoutMs = Math.min(requestTimeoutMs, calcTimeoutMsRemainingAsInt(now, call.deadlineMs)); AbstractRequest.Builder<?> requestBuilder; try { requestBuilder = call.createRequest(timeoutMs); } catch (Throwable throwable) { call.fail(now, new KafkaException(String.format( "Internal error sending %s to %s.", call.callName, node))); continue; } ClientRequest clientRequest = client.newClientRequest(node.idString(), requestBuilder, now, true, timeoutMs, null); log.trace("Sending to {}. correlationId={}", requestBuilder, node, clientRequest.correlationId()); client.send(clientRequest, now); getOrCreateListValue(callsInFlight, node.idString()).add(call); correlationIdToCalls.put(clientRequest.correlationId(), call); } return pollTimeout; }
Source:
private InetSocketAddress getNativeAddressFromPeers(AdminRow row) { InetAddress native_address = row.getInetAddress("native_address"); if (native_address == null) { native_address = row.getInetAddress("rpc_address"); } if (native_address == null) { return null; } int row_port = port; if (allowPortDiscovery && row.contains("native_port")) { row_port = row.getInteger("native_port"); } return addressTranslator.translate(new InetSocketAddress(native_address, row_port)); }

Target:
private InetSocketAddress getNativeAddressFromPeers(AdminRow row) { InetAddress nativeAddress = row.getInetAddress("native_address"); if (nativeAddress == null) { nativeAddress = row.getInetAddress("rpc_address"); } if (nativeAddress == null) { return null; } int row_port = port; return addressTranslator.translate(new InetSocketAddress(nativeAddress, row_port)); }
Source:
public final void setFromDecimalDegrees(final String dd) throws ParseException { if (dd == null) { throw new ParseException("Null argument for decimal degrees parsing", 0); } if (dd.length() != "+dd.ddd+ddd.ddd".length()) { throw new ParseException("Incorrect length for decimal degrees parsing", 0); } sourceString = dd; String latPart = dd.substring(0, NitfConstants.LAT_DECIMAL_DEGREES_FORMAT_LENGTH); String lonPart = dd.substring(NitfConstants.LAT_DECIMAL_DEGREES_FORMAT_LENGTH); try { lat = Double.parseDouble(latPart); lon = Double.parseDouble(lonPart); } catch (NumberFormatException ex) { throw new ParseException(String.format("Incorrect decimal degrees format: %s", dd), 0); } }

Target:
public final void setFromDecimalDegrees(final String dd) throws ParseException { if (dd == null) { throw new ParseException("Null argument for decimal degrees parsing", 0); } if (dd.length() != "+dd.ddd+ddd.ddd".length()) { throw new ParseException("Incorrect length for decimal degrees parsing", 0); } sourceString = dd; String latPart = dd.substring(0, LAT_DECIMAL_DEGREES_FORMAT_LENGTH); String lonPart = dd.substring(LAT_DECIMAL_DEGREES_FORMAT_LENGTH); try { lat = Double.parseDouble(latPart); lon = Double.parseDouble(lonPart); } catch (NumberFormatException ex) { throw new ParseException(String.format("Incorrect decimal degrees format: %s", dd), 0); } }
Source:
private String convertToFlatJsonAsString(String path, String data, Iterator<JsonNode> acls) { StringBuilder node = new StringBuilder(); node.append("{\"path\": \""); node.append(path); node.append("\", \"data\": \""); node.append(data); node.append("\", \"acls\": ["); while(acls.hasNext()) { JsonNode aclNode = acls.next(); node.append("{\"scheme\": \""); node.append(aclNode.get("scheme").getTextValue()); node.append("\", \"id\": \""); node.append(aclNode.get("id").getTextValue()); node.append("\", \"perms\": "); node.append(aclNode.get("perms").getIntValue()); node.append("}"); if (acls.hasNext()) { node.append(", "); } } node.append("]}"); return node.toString(); }

Target:
private String convertToFlatJsonAsString(String path, String data, Iterator<JsonNode> acls) throws JsonProcessingException { ExportObject exportObject = new ExportObject() .setPath(path) .setData(data); List<Acl> aclList = new ArrayList<Acl>(); while (acls.hasNext()) { JsonNode aclNode = acls.next(); aclList.add(new Acl() .setScheme(aclNode.get("scheme").getTextValue()) .setId(aclNode.get("id").getTextValue()) .setPerms(aclNode.get("perms").getIntValue())); } exportObject.setAcls(aclList); return objectMapper.writeValueAsString(exportObject); }
Source:
public List<NamedArrayList<? extends SCMTraitDescriptor<?>>> getTraitsDescriptorLists() { GitHubSCMSource.DescriptorImpl sourceDescriptor = Jenkins.getActiveInstance().getDescriptorByType(GitHubSCMSource.DescriptorImpl.class); List<SCMTraitDescriptor<?>> all = new ArrayList<>(); all.addAll(SCMNavigatorTrait._for(this, GitHubSCMNavigatorContext.class, GitHubSCMSourceBuilder.class)); all.addAll(SCMSourceTrait._for(sourceDescriptor, GitHubSCMSourceContext.class, null)); all.addAll(SCMSourceTrait._for(sourceDescriptor, null, GitHubSCMBuilder.class)); Set<SCMTraitDescriptor<?>> dedup = new HashSet<>(); for (Iterator<SCMTraitDescriptor<?>> iterator = all.iterator(); iterator.hasNext(); ) { SCMTraitDescriptor<?> d = iterator.next(); if (dedup.contains(d) || d instanceof GitBrowserSCMSourceTrait.DescriptorImpl) { iterator.remove(); } else { dedup.add(d); } } List<NamedArrayList<? extends SCMTraitDescriptor<?>>> result = new ArrayList<>(); NamedArrayList.select(all, "Repositories", new NamedArrayList.Predicate<SCMTraitDescriptor<?>>() { @Override public boolean test(SCMTraitDescriptor<?> scmTraitDescriptor) { return scmTraitDescriptor instanceof SCMNavigatorTraitDescriptor; } }, true, result); NamedArrayList.select(all, Messages.within_repository(), NamedArrayList.anyOf(NamedArrayList.withAnnotation(Discovery.class),NamedArrayList.withAnnotation(Selection.class)), true, result); NamedArrayList.select(all, Messages.general(), null, true, result); return result; }

Target:
public List<NamedArrayList<? extends SCMTraitDescriptor<?>>> getTraitsDescriptorLists() { GitHubSCMSource.DescriptorImpl sourceDescriptor = Jenkins.getActiveInstance().getDescriptorByType(GitHubSCMSource.DescriptorImpl.class); List<SCMTraitDescriptor<?>> all = new ArrayList<>(); all.addAll(SCMNavigatorTrait._for(this, GitHubSCMNavigatorContext.class, GitHubSCMSourceBuilder.class)); all.addAll(SCMSourceTrait._for(sourceDescriptor, GitHubSCMSourceContext.class, null)); all.addAll(SCMSourceTrait._for(sourceDescriptor, null, GitHubSCMBuilder.class)); Set<SCMTraitDescriptor<?>> dedup = new HashSet<>(); for (Iterator<SCMTraitDescriptor<?>> iterator = all.iterator(); iterator.hasNext(); ) { SCMTraitDescriptor<?> d = iterator.next(); if (dedup.contains(d) || d instanceof GitBrowserSCMSourceTrait.DescriptorImpl) { iterator.remove(); } else { dedup.add(d); } } List<NamedArrayList<? extends SCMTraitDescriptor<?>>> result = new ArrayList<>(); NamedArrayList.select(all, "Repositories", new NamedArrayList.Predicate<SCMTraitDescriptor<?>>() { @Override public boolean test(SCMTraitDescriptor<?> scmTraitDescriptor) { return scmTraitDescriptor instanceof SCMNavigatorTraitDescriptor; } }, true, result); NamedArrayList.select(all, Messages.GitHubSCMNavigator_withinRepository(), NamedArrayList.anyOf(NamedArrayList.withAnnotation(Discovery.class),NamedArrayList.withAnnotation(Selection.class)), true, result); NamedArrayList.select(all, Messages.GitHubSCMNavigator_general(), null, true, result); return result; }
Source:
public void testCreateColumnWithDefaultExpression() throws Exception { execute("create table test (col1 text default 'foo')"); ensureYellow(); String expectedMapping = "{\"default\":{" + "\"dynamic\":\"strict\",\"_meta\":{}," + "\"dynamic_templates\":[{\"strings\":{\"match_mapping_type\":\"string\",\"mapping\":{\"doc_values\":true,\"store\":false,\"type\":\"keyword\"}}}]," + "\"properties\":{\"col1\":{\"type\":\"keyword\",\"position\":1,\"default_expr\":\"'foo'\"}}}}"; assertEquals(expectedMapping, getIndexMapping("test")); }

Target:
public void testCreateColumnWithDefaultExpression() throws Exception { execute("create table test (col1 text default 'foo')"); String expectedMapping = "{\"default\":{" + "\"dynamic\":\"strict\",\"_meta\":{}," + "\"dynamic_templates\":[{\"strings\":{\"match_mapping_type\":\"string\",\"mapping\":{\"doc_values\":true,\"store\":false,\"type\":\"keyword\"}}}]," + "\"properties\":{\"col1\":{\"type\":\"keyword\",\"position\":1,\"default_expr\":\"'foo'\"}}}}"; assertEquals(expectedMapping, getIndexMapping("test")); }
Source:
public static BundleGroupDocAdapter create(BundleGroup bundleGroup, CoreSession session, String containerPath) { DocumentModel doc = session.createDocumentModel(TYPE_NAME); String name = computeDocumentName("bg-" + bundleGroup.getId()); String targetPath = new Path(containerPath).append(name).toString(); boolean exist = false; if (session.exists(new PathRef(targetPath))) { exist = true; doc = session.getDocument(new PathRef(targetPath)); } doc.setPathInfo(containerPath, name); doc.setPropertyValue(NuxeoArtifact.TITLE_PROPERTY_PATH, bundleGroup.getName()); doc.setPropertyValue(PROP_GROUP_NAME, bundleGroup.getName()); doc.setPropertyValue(PROP_KEY, bundleGroup.getId()); ArrayList<Map<String, Serializable>> files = new ArrayList<>(); for (Blob blob : bundleGroup.getReadmes()) { Map<String, Serializable> item = new HashMap<>(); item.put("file", (Serializable) blob); files.add(item); } doc.setPropertyValue(PROP_READMES, files); if (exist) { doc = session.saveDocument(doc); } else { doc = session.createDocument(doc); } return new BundleGroupDocAdapter(doc); }

Target:
public static BundleGroupDocAdapter create(BundleGroup bundleGroup, CoreSession session, String containerPath) { DocumentModel doc = session.createDocumentModel(TYPE_NAME); String name = computeDocumentName("bg-" + bundleGroup.getId()); String targetPath = new Path(containerPath).append(name).toString(); boolean exist = false; if (session.exists(new PathRef(targetPath))) { exist = true; doc = session.getDocument(new PathRef(targetPath)); } doc.setPathInfo(containerPath, name); doc.setPropertyValue(NuxeoArtifact.TITLE_PROPERTY_PATH, bundleGroup.getName()); doc.setPropertyValue(PROP_GROUP_NAME, bundleGroup.getName()); doc.setPropertyValue(PROP_KEY, bundleGroup.getId()); var files = new ArrayList<Map<String, Serializable>>(); for (Blob blob : bundleGroup.getReadmes()) { Map<String, Serializable> item = new HashMap<>(); item.put("file", (Serializable) blob); files.add(item); } doc.setPropertyValue(PROP_READMES, files); if (exist) { doc = session.saveDocument(doc); } else { doc = session.createDocument(doc); } return new BundleGroupDocAdapter(doc); }
Source:
public void unsuccessfulBackupsAreNotPruned() throws CommandFailed { when( firstStrategy.doBackup( any() ) ).thenReturn( new Fallible<>( BackupStrategyOutcome.INCORRECT_STRATEGY, new RuntimeException() ) ); when( secondStrategy.doBackup( any() ) ).thenReturn( new Fallible<>( BackupStrategyOutcome.INCORRECT_STRATEGY, new RuntimeException() ) ); try { subject.performBackup( onlineBackupContext ); fail( "Both strategies failed so the command should have failed" ); } catch ( CommandFailed e ) { } verify( forceCheckpointBackupService, never() ).forceCheckpoint(); verify( forceCheckpointBackupService, never() ).forcePrune(); verify( forceCheckpointBackupService, never() ).forceRotation(); }

Target:
public void unsuccessfulBackupsAreNotPruned() throws CommandFailed { when( firstStrategy.doBackup( any() ) ).thenReturn( new Fallible<>( BackupStrategyOutcome.INCORRECT_STRATEGY, new RuntimeException() ) ); when( secondStrategy.doBackup( any() ) ).thenReturn( new Fallible<>( BackupStrategyOutcome.INCORRECT_STRATEGY, new RuntimeException() ) ); try { subject.performBackup( onlineBackupContext ); fail( "Both strategies failed so the command should have failed" ); } catch ( CommandFailed e ) { } fail(); }
Source:
void doOnProcessorChange(List<String> processors) { List<String> currentProcessorIds = getActualProcessorIds(processors); List<String> uniqueProcessorIds = currentProcessorIds.stream() .distinct() .collect(Collectors.toList()); if (currentProcessorIds.size() != uniqueProcessorIds.size()) { LOG.info("Processors: has duplicates. Not generating job model.", currentProcessorIds); return; } JobModel jobModel = generateNewJobModel(currentProcessorIds); String currentJMVersion = zkUtils.getJobModelVersion(); String nextJMVersion; if (currentJMVersion == null) { nextJMVersion = "1"; } else { nextJMVersion = Integer.toString(Integer.valueOf(currentJMVersion) + 1); } LOG.info("pid=" + processorId + "Generated new Job Model. Version = " + nextJMVersion); zkUtils.publishJobModel(nextJMVersion, jobModel); barrier.create(nextJMVersion, currentProcessorIds); zkUtils.publishJobModelVersion(currentJMVersion, nextJMVersion); LOG.info("pid=" + processorId + "Published new Job Model. Version = " + nextJMVersion); }

Target:
void doOnProcessorChange(List<String> processors) { List<String> currentProcessorIds = getActualProcessorIds(processors); Set<String> uniqueProcessorIds = new HashSet<String>(currentProcessorIds); if (currentProcessorIds.size() != uniqueProcessorIds.size()) { LOG.info("Processors: has duplicates. Not generating job model.", currentProcessorIds); return; } JobModel jobModel = generateNewJobModel(currentProcessorIds); String currentJMVersion = zkUtils.getJobModelVersion(); String nextJMVersion; if (currentJMVersion == null) { nextJMVersion = "1"; } else { nextJMVersion = Integer.toString(Integer.valueOf(currentJMVersion) + 1); } LOG.info("pid=" + processorId + "Generated new Job Model. Version = " + nextJMVersion); zkUtils.publishJobModel(nextJMVersion, jobModel); barrier.create(nextJMVersion, currentProcessorIds); zkUtils.publishJobModelVersion(currentJMVersion, nextJMVersion); LOG.info("pid=" + processorId + "Published new Job Model. Version = " + nextJMVersion); }
Source:
private void showSyncOptionDialogWhenLogin() { ReadingListCheckSetupStatusTask checkSetupStatusTask = new ReadingListCheckSetupStatusTask() { @Override public void onFinish(@Nullable Void result) { Prefs.setReadingListSyncEnabled(true); if (ReadingListDbHelper.instance().getRandomPage() != null) { ReadingListSyncBehaviorDialogs.mergeAndSyncDialog(LoginActivity.this, () -> manualSyncAndFinish()); } else { manualSyncAndFinish(); } } @Override public void onCatch(Throwable caught) { Prefs.setReadingListSyncEnabled(false); if (Prefs.isShowDialogPromptOptInSyncReadingListsEnabled()) { ReadingListSyncBehaviorDialogs.promptTurnSyncOnDialog(LoginActivity.this, getLayoutInflater(), !loginSource.equals(LoginFunnel.SOURCE_SETTING), () -> finish()); } } }; checkSetupStatusTask.execute(); }

Target:
private void showSyncOptionDialogWhenLogin() { ReadingListCheckSetupStatusTask checkSetupStatusTask = new ReadingListCheckSetupStatusTask() { @Override public void onFinish(@Nullable Void result) { if (isDestroyed()) { return; } Prefs.setReadingListSyncEnabled(true); if (ReadingListDbHelper.instance().getRandomPage() != null) { ReadingListSyncBehaviorDialogs.mergeAndSyncDialog(LoginActivity.this, () -> manualSyncAndFinish()); } else { manualSyncAndFinish(); } } @Override public void onCatch(Throwable caught) { if (isDestroyed()) { return; } Prefs.setReadingListSyncEnabled(false); if (Prefs.isShowDialogPromptOptInSyncReadingListsEnabled()) { ReadingListSyncBehaviorDialogs.promptTurnSyncOnDialog(LoginActivity.this, getLayoutInflater(), !loginSource.equals(LoginFunnel.SOURCE_SETTING), () -> finish()); } } }; checkSetupStatusTask.execute(); }
Source:
public void deleteAll() { stateHolder.getState().getEventHolder().deleteAll(); }

Target:
public void deleteAll() { readWriteLock.writeLock().lock(); try { stateHolder.getState().getEventHolder().deleteAll(); } finally { readWriteLock.writeLock().unlock(); } }
Source:
private void refreshTargetForm(TargetBean data) { String value = _targetType.getValue(); if (value != null && !value.equals("")) { TargetType type = TargetType.value(value); _panel.clear(); if (type != null) { switch (type) { case MAVEN: _targetPanel = this._addMavenForm.get(); break; case RHQ: _targetPanel = this._addRhqForm.get(); break; case CLI: _targetPanel = this._addCliForm.get(); break; case COPY: _targetPanel = this._addCopyForm.get(); break; } if (_targetPanel != null) { if (data != null) { _targetPanel.initialize(data); } _panel.add(_targetPanel); } } else { _panel.clear(); } } }

Target:
private void refreshTargetForm(TargetBean data) { String value = _targetType.getValue(); if (value != null && !value.equals("")) { TargetType type = TargetType.value(value); _panel.clear(); if (type != null) { switch (type) { case MAVEN: _targetPanel = this._addMavenForm.get(); break; case RHQ: _targetPanel = this._addRhqForm.get(); break; case CLI: _targetPanel = this._addCliForm.get(); break; case COPY: _targetPanel = this._addCopyForm.get(); break; } if (_targetPanel != null) { if (data != null) { _targetPanel.initialize(data); } _panel.add(_targetPanel); } } } }
Source:
public void onFailure(Throwable t) { log.error("Unable to RefreshCapabilities: {}", ExceptionUtils.getRootCauseMessage(t)); log.debug("Exception", t); postProcessRefresh(false, releaseLock.getAndSet(false)); }

Target:
public void onFailure(Throwable t) { log.error("Unable to RefreshCapabilities: {}", ExceptionUtils.getRootCauseMessage(t)); log.debug("Exception", t); postProcessRefresh(false); }
Source:
public void getProductsByAllergen(final String allergen, final int page, final OnAllergensCallback onAllergensCallback) { apiService.getProductsByAllergen(allergen, page).enqueue(new Callback<Search>() { @Override public void onResponse(Call<Search> call, Response<Search> response) { if (!response.isSuccessful()) { onAllergensCallback.onAllergensResponse(false, null); return; } if (Integer.valueOf(response.body().getCount()) == 0) { onAllergensCallback.onAllergensResponse(false, null); } else { onAllergensCallback.onAllergensResponse(true, response.body()); } } @Override public void onFailure(Call<Search> call, Throwable t) { } }); }

Target:
public void getProductsByAllergen(final String allergen, final int page, final OnAllergensCallback onAllergensCallback) { apiService.getProductsByAllergen(allergen, page).enqueue(new Callback<Search>() { @Override public void onResponse(Call<Search> call, Response<Search> response) { if (!response.isSuccessful()) { onAllergensCallback.onAllergensResponse(false, null); return; } if (Integer.valueOf(response.body().getCount()) == 0) { onAllergensCallback.onAllergensResponse(false, null); } else { onAllergensCallback.onAllergensResponse(true, response.body()); } } @Override public void onFailure(Call<Search> call, Throwable t) { onAllergensCallback.onAllergensResponse(false, null); } }); }
Source:
private Collection<Resource> collectTopLevelSemanticResources() { Collection<Resource> semanticResources = new LinkedHashSet<Resource>(); for (DAnalysis analysis : session.allAnalyses()) { for (ResourceDescriptor resourceDesc : analysis.getSemanticResources()) { try { Resource resource = session.getTransactionalEditingDomain().getResourceSet().getResource(resourceDesc.getResourceURI(), true); if (resource != null) { semanticResources.add(resource); } } catch (IllegalStateException e) { if (SiriusPlugin.getDefault().isDebugging()) { SiriusPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, SiriusPlugin.ID, e.getMessage(), e)); } } } } semanticResources.removeAll(session.getControlledResources()); return semanticResources; }

Target:
private Collection<Resource> collectTopLevelSemanticResources() { Collection<Resource> semanticResources = new LinkedHashSet<Resource>(); for (DAnalysis analysis : session.allAnalyses()) { for (ResourceDescriptor resourceDesc : analysis.getSemanticResources()) { try { Resource resource = session.getTransactionalEditingDomain().getResourceSet().getResource(resourceDesc.getResourceURI(), true); if (resource != null) { semanticResources.add(resource); } } catch (WrappedException e) { if (SiriusPlugin.getDefault().isDebugging()) { SiriusPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, SiriusPlugin.ID, e.getMessage(), e)); } } } } semanticResources.removeAll(session.getControlledResources()); return semanticResources; }
Source:
private void migrateBGAlerts() { AlertType.CreateStaticAlerts(); if(prefs.getBoolean("bg_notifications", true)){ double highMark = Double.parseDouble(prefs.getString("highValue", "170")); double lowMark = Double.parseDouble(prefs.getString("lowValue", "70")); boolean doMgdl = (prefs.getString("units", "mgdl").compareTo("mgdl") == 0); if(!doMgdl) { highMark = highMark * Constants.MMOLL_TO_MGDL; lowMark = lowMark * Constants.MMOLL_TO_MGDL; } boolean bg_sound_in_silent = prefs.getBoolean("bg_sound_in_silent", false); String bg_notification_sound = prefs.getString("bg_notification_sound", "content://settings/system/notification_sound"); AlertType.add_alert(null, "High Alert", true, highMark, true, 1, bg_notification_sound, 0, 0, bg_sound_in_silent, SnoozeActivity.getDefaultSnooze(true)); AlertType.add_alert(null, "Low Alert", false, lowMark, true, 1, bg_notification_sound, 0, 0, bg_sound_in_silent, SnoozeActivity.getDefaultSnooze(false)); prefs.edit().putBoolean("bg_notifications", false).apply(); } }

Target:
private void migrateBGAlerts() { AlertType.CreateStaticAlerts(); if(prefs.getBoolean("bg_notifications", true)){ double highMark = Double.parseDouble(prefs.getString("highValue", "170")); double lowMark = Double.parseDouble(prefs.getString("lowValue", "70")); boolean doMgdl = (prefs.getString("units", "mgdl").compareTo("mgdl") == 0); if(!doMgdl) { highMark = highMark * Constants.MMOLL_TO_MGDL; lowMark = lowMark * Constants.MMOLL_TO_MGDL; } boolean bg_sound_in_silent = prefs.getBoolean("bg_sound_in_silent", false); String bg_notification_sound = prefs.getString("bg_notification_sound", "content://settings/system/notification_sound"); int bg_high_snooze = Integer.parseInt(prefs.getString("bg_snooze", Integer.toString(SnoozeActivity.getDefaultSnooze(true)))); int bg_low_snooze = Integer.parseInt(prefs.getString("bg_snooze", Integer.toString(SnoozeActivity.getDefaultSnooze(false)))); AlertType.add_alert(null, "High Alert", true, highMark, true, 1, bg_notification_sound, 0, 0, bg_sound_in_silent, bg_high_snooze); AlertType.add_alert(null, "Low Alert", false, lowMark, true, 1, bg_notification_sound, 0, 0, bg_sound_in_silent, bg_low_snooze); prefs.edit().putBoolean("bg_notifications", false).apply(); } }
Source:
public boolean select(Viewer viewer, Object parentElement, Object element) { if (!fEnabled || !(element instanceof ControlFlowEntry)) { return true; } ControlFlowEntry cfe = (ControlFlowEntry) element; if (fCpuRangesBasedFiltering && fCachedOnCpusThreadForTimeRange.contains(cfe.getThreadId())) { return true; } else if (fCachedActiveThreadForTimeRange.contains(cfe.getThreadId())) { return true; } for (@NonNull TimeGraphEntry child : cfe.getChildren()) { if (select(viewer, cfe, child)) { return true; } } return false; }

Target:
public boolean select(Viewer viewer, Object parentElement, Object element) { if (!fEnabled || !(element instanceof ControlFlowEntry)) { return true; } ControlFlowEntry cfe = (ControlFlowEntry) element; if (fCpuRangesBasedFiltering && fCachedOnCpusThreadForTimeRange.contains(cfe.getThreadId())) { return true; } else if (fCachedActiveThreadForTimeRange.contains(cfe.getThreadId())) { return true; } for (TimeGraphEntry child : cfe.getChildren()) { if (select(viewer, cfe, child)) { return true; } } return false; }
Source:
public Dollars balance() { try { return Dollars.valueOf( new JdkRequest(UriBuilder.fromUri(this.home).build()) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .header(HttpHeaders.AUTHORIZATION, this.token) .method(Request.GET) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .xml() .xpath("/page/balance/text()") .get(0) ); } catch (IOException ex) { throw new IllegalStateException(ex); } }

Target:
public Dollars balance() { try { return Dollars.valueOf( new JdkRequest(this.home) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .header(HttpHeaders.AUTHORIZATION, this.token) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .xml() .xpath("/page/balance/text()") .get(0) ); } catch (IOException ex) { throw new IllegalStateException(ex); } }
Source:
public void sortShowInPartIds(ArrayList<?> partIds) { Collections.sort(partIds, new Comparator<Object>() { @Override public int compare(Object ob1, Object ob2) { if (mruPartIds.contains(ob1) && !mruPartIds.contains(ob2)) return -1; if (!mruPartIds.contains(ob1) && mruPartIds.contains(ob2)) return 1; return mruPartIds.indexOf(ob1) - mruPartIds.indexOf(ob2); } }); }

Target:
public void sortShowInPartIds(ArrayList<?> partIds) { Collections.sort(partIds, new Comparator<Object>() { @Override public int compare(Object ob1, Object ob2) { int index1 = mruPartIds.indexOf(ob1); int index2 = mruPartIds.indexOf(ob2); if (index1 != -1 && index2 == -1) return -1; if (index1 == -1 && index2 != -1) return 1; return index1 - index2; } }); }
Source:
public List<BlockedItem> getBlockedItems() { return new ArrayList<BlockedItem>(snapshot.blockedProjects); }

Target:
protected List<BlockedItem> getBlockedItems() { return new ArrayList<BlockedItem>(snapshot.blockedProjects); }
Source:
public Long poisonStoreAndGetLastAllocatedTimestamp(Connection connection, Limits limits, TableStatus tableStatus) throws SQLException { long lastAllocated; if (tableStatus == TableStatus.NO_DATA) { lastAllocated = AtlasDbFactory.NO_OP_FAST_FORWARD_TIMESTAMP; } else { lastAllocated = limits.upperLimit().get().value(); } poisonTable(connection); return lastAllocated; }

Target:
private Long poisonStoreAndGetLastAllocatedTimestamp(Connection connection, Limits limits, TableStatus tableStatus) throws SQLException { long lastAllocated; if (tableStatus == TableStatus.NO_DATA) { lastAllocated = AtlasDbFactory.NO_OP_FAST_FORWARD_TIMESTAMP; } else { lastAllocated = limits.upperLimit().get().value(); } poisonTable(connection); return lastAllocated; }
Source:
private static String[] provideCorrectFormats() { String[] data = new String[] {"", "Knuth", "Donald E. Knuth and Kurt Cobain and A. Einstein"}; return data; }

Target:
private static Stream<String> provideCorrectFormats() { return Stream.of("", "Knuth", "Donald E. Knuth and Kurt Cobain and A. Einstein"); }
Source:
public boolean isApplicable(String requestPath) { return requestPath.startsWith("druid/coordinator/v1/rules/"); }

Target:
public boolean isApplicable(String requestPath) { List<String> applicablePaths = ImmutableList.of("druid/coordinator/v1/rules/"); for (String path : applicablePaths) { if(requestPath.startsWith(path) && !requestPath.equals(path)) { return true; } } return false; }
Source:
public void verifyFollowedBlog(String userName, String blogTitle){ boolean isPresent = false; for (WebElement elem:blogList) { String title = elem.getAttribute("title"); if (title.contains(userName) && title.contains(blogTitle)){ isPresent = true; } } Assertion.assertTrue(isPresent, "blog "+blogTitle+" is not present on the following list"); PageObjectLogging.log("verifyFollowedArticle", userName + " blog is visible on followed list", true); }

Target:
public void verifyFollowedBlog(String userName, String blogTitle) { boolean isPresent = false; for (WebElement elem:blogList) { String title = elem.getAttribute("title"); if (title.contains(userName) && title.contains(blogTitle)) { isPresent = true; } } Assertion.assertTrue(isPresent, "blog " + blogTitle + " is not present on the following list"); PageObjectLogging.log("verifyFollowedBlog", userName + " blog is visible on followed list", true); }
Source:
private boolean generateAdaptorInterface(EObject self, String targetFolder) { try { File folder = new File(targetFolder); List<String> arguments = new ArrayList<String>(); Generate generator = new Generate(self, folder, arguments); generator.doGenerate(new BasicMonitor()); } catch (IOException e) { IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); Activator.getDefault().getLog().log(status); DialogInputServices dialogInputServices = new DialogInputServices(); dialogInputServices.showMessage(self, "Exception!", "an Exception occurred during the generation process. Please see the error log."); return false; } return true; }

Target:
private boolean generateAdaptorInterface(EObject self, String targetFolder) { try { File folder = new File(targetFolder); List<String> arguments = new ArrayList<String>(); Generate generator = new Generate(self, folder, arguments); generator.doGenerate(new BasicMonitor()); } catch (IOException e) { IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); logger.log(status); DialogInputServices dialogInputServices = new DialogInputServices(); dialogInputServices.showMessage(self, "Exception!", "an Exception occurred during the generation process. Please see the error log."); return false; } return true; }
Source:
public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) { String documentation = null; try { String keyword = textViewer.getDocument().get(hoverRegion.getOffset(), hoverRegion.getLength()); documentation = TapsetLibrary.getDocumentationNoCache("function::" + keyword); if (documentation != null){ return documentation; } documentation = TapsetLibrary.getDocumentationNoCache("probe::" + keyword); if (documentation != null){ return documentation; } documentation = TapsetLibrary.getDocumentationNoCache("tapset::" + keyword); if (documentation != null){ return documentation; } documentation = TapsetLibrary.getDocumentationNoCache("tapset::" + keyword); if (documentation != null){ return documentation; } if (keyword.indexOf('.') > 0){ keyword = keyword.split("\\.")[0]; documentation = TapsetLibrary.getDocumentationNoCache("tapset::" + keyword); } } catch (BadLocationException e) { } return documentation; }

Target:
public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) { String documentation = null; try { String keyword = textViewer.getDocument().get(hoverRegion.getOffset(), hoverRegion.getLength()); documentation = TapsetLibrary.getDocumentationNoCache("function::" + keyword); if (documentation != null){ return documentation; } documentation = TapsetLibrary.getDocumentationNoCache("probe::" + keyword); if (documentation != null){ return documentation; } documentation = TapsetLibrary.getDocumentationNoCache("tapset::" + keyword); if (documentation != null){ return documentation; } if (keyword.indexOf('.') > 0){ keyword = keyword.split("\\.")[0]; documentation = TapsetLibrary.getDocumentationNoCache("tapset::" + keyword); } } catch (BadLocationException e) { } return documentation; }
Source:
public void putBulkObjectWithSync() throws Exception { assumeThat(Util.getBlackPearlVersion(client), greaterThan(3.0)); final String bucketName = "test_put_bulk_object"; try { Util.createBucket(client, bucketName); final Arguments args = new Arguments(new String[]{"--http", "-c", "put_bulk", "-b", bucketName, "-d", Util.RESOURCE_BASE_NAME, "--sync"}); CommandResponse response = Util.command(client, args); assertThat(response.getMessage(), is(String.format("SUCCESS: Wrote all the files in %s to bucket %s", ".\\src\\test\\resources\\books", bucketName))); response = Util.command(client, args); assertThat(response.getMessage(), is("SUCCESS: All files are up to date")); } finally { Util.deleteBucket(client, bucketName); } }

Target:
public void putBulkObjectWithSync() throws Exception { assumeThat(Util.getBlackPearlVersion(client), greaterThan(1.2)); final String bucketName = "test_put_bulk_object"; try { Util.createBucket(client, bucketName); final Arguments args = new Arguments(new String[]{"--http", "-c", "put_bulk", "-b", bucketName, "-d", Util.RESOURCE_BASE_NAME, "--sync"}); CommandResponse response = Util.command(client, args); assertThat(response.getMessage(), is(String.format("SUCCESS: Wrote all the files in %s to bucket %s", ".\\src\\test\\resources\\books", bucketName))); response = Util.command(client, args); assertThat(response.getMessage(), is("SUCCESS: All files are up to date")); } finally { Util.deleteBucket(client, bucketName); } }
Source:
protected abstract Object[] readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException; protected abstract boolean resolveAnalysisSegments(ISegmentStore<ISegment> segments, IProgressMonitor monitor) throws TmfAnalysisException; @Override public @Nullable ISegmentStore<ISegment> getSegmentStore() { return fSegmentStore; }

Target:
protected abstract Object[] readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException; protected abstract boolean buildAnalysisSegments(ISegmentStore<ISegment> segments, IProgressMonitor monitor) throws TmfAnalysisException; @Override public @Nullable ISegmentStore<ISegment> getSegmentStore() { return fSegmentStore; }
Source:
public static InputStream getContactPhotoStream(ContentResolver contentResolver, Uri uri) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) { final Uri contactUri = uri.toString().startsWith( ContactsContract.Contacts.CONTENT_LOOKUP_URI.toString()) ? ContactsContract.Contacts.lookupContact(contentResolver, uri) : uri; return openContactPhotoInputStream(contentResolver, contactUri); } else { return ContactPhotoStreamIcs.get(contentResolver, uri); } }

Target:
public static InputStream getContactPhotoStream(ContentResolver contentResolver, Uri uri) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) { if (uri.toString().startsWith(ContactsContract.Contacts.CONTENT_LOOKUP_URI.toString())) uri = ContactsContract.Contacts.lookupContact(contentResolver, uri); return openContactPhotoInputStream(contentResolver, uri); } else { return ContactPhotoStreamIcs.get(contentResolver, uri); } }
Source:
protected void validate() throws AxonConfigurationException { assertNonNull(retryExecutor, "The ScheduledExecutorService is a hard requirement and should be provided"); assertStrictPositive(maxRetryCount, "The maxRetryCount is a hard requirement and should be provided"); }

Target:
protected void validate() throws AxonConfigurationException { assertNonNull(retryExecutor, "The ScheduledExecutorService is a hard requirement and should be provided"); assertStrictPositive(maxRetryCount, "The maxRetryCount is a hard requirement and must be at least 1"); }
Source:
public void testAwsV4Failure() throws Exception { BasicAWSCredentials awsCreds = new BasicAWSCredentials(s3Identity, s3Credential); AmazonS3 client = new AmazonS3Client(awsCreds); client.setEndpoint(s3Endpoint.toString()); try { client.getObject(containerName, "foo"); } catch (AmazonS3Exception e) { assertThat(e.getErrorCode()).isEqualToIgnoringCase( "InvalidArgument"); assertThat(e.getStatusCode()).isEqualTo(400); } }

Target:
public void testAwsV4Failure() throws Exception { BasicAWSCredentials awsCreds = new BasicAWSCredentials(s3Identity, s3Credential); AmazonS3 client = new AmazonS3Client(awsCreds); client.setEndpoint(s3Endpoint.toString()); thrown.expect(AmazonS3Exception.class); thrown.expectMessage("Status Code: 400; Error Code: InvalidArgument"); client.getObject(containerName, "foo"); }
Source:
public <T> Collection<ValidationMessage> validateForSave( final Path path, final T content ) { return (Collection<ValidationMessage>) saveValidators.stream().filter( v -> v.accept( path ) ).flatMap( c -> c.validate( path, content ).stream().filter( r -> r != null ) ).collect( Collectors.toList() ); }

Target:
public <T> Collection<ValidationMessage> validateForSave( final Path path, final T content ) { return (Collection<ValidationMessage>) saveValidators.stream().filter( v -> v.accept( path ) ).flatMap( c -> c.validate( path, content ).stream() ).collect( Collectors.toList() ); }
Source:
public void verifyPageUnfollowed() { waitForTextToBePresentInElementByElement(followButton, "Follow"); }

Target:
public void verifyPageUnfollowed() { waitForTextToBePresentInElementByElement(followButton, "Follow"); PageObjectLogging.log("verifyPageUnfollowed", "page is not followed", true); }
Source:
private String escapeValue(String value) { if (value.contains("'")) { value = value.replace("'", "''"); } if (value.contains(COMMA)) { value = SINGLE_QUOTE + value + SINGLE_QUOTE; } return value; }

Target:
private static String escapeValue(String value) { if (value.contains("'")) { value = value.replace("'", "''"); } if (value.contains(COMMA)) { value = SINGLE_QUOTE + value + SINGLE_QUOTE; } return value; }
Source:
public List<FileChunk> get() throws IOException { return pullServerService != null ? getDirect() : getFromFetchURI(); }

Target:
public List<FileChunk> get() throws IOException { this.startTime = System.currentTimeMillis(); return pullServerService != null ? getWithInternalPullServer() : getWithExternalPullServer(); }
Source:
public void handle(CacheRpcCommand command, Reply reply, DeliverOrder order) { if (order == DeliverOrder.TOTAL) { unexpectedDeliverMode(command, order); } try { final int commandTopologyId = extractCommandTopologyId(command); if (isCommandSentBeforeFirstTopology(commandTopologyId)) { reply.reply(CacheNotFoundResponse.INSTANCE); return; } final boolean waitTransactionalData = command.getCommandId() != StateRequestCommand.COMMAND_ID; final boolean onExecutorService = executeOnExecutorService(order, command); switch (command.getCommandId()) { case PrepareCommand.COMMAND_ID: case VersionedPrepareCommand.COMMAND_ID: case TotalOrderNonVersionedPrepareCommand.COMMAND_ID: case TotalOrderVersionedPrepareCommand.COMMAND_ID: case CommitCommand.COMMAND_ID: case VersionedCommitCommand.COMMAND_ID: case TotalOrderCommitCommand.COMMAND_ID: case TotalOrderVersionedCommitCommand.COMMAND_ID: case RollbackCommand.COMMAND_ID: case TotalOrderRollbackCommand.COMMAND_ID: case LockControlCommand.COMMAND_ID: throw new IllegalArgumentException("Illegal Command ID: " + command.getCommandId() + ". Transactional commands are not allowed."); } handleRunnable(createDefaultRunnable(command, reply, commandTopologyId, waitTransactionalData, onExecutorService), onExecutorService); } catch (Throwable throwable) { reply.reply(exceptionHandlingCommand(command, throwable)); } }

Target:
public void handle(CacheRpcCommand command, Reply reply, DeliverOrder order) { if (order == DeliverOrder.TOTAL) { unexpectedDeliverMode(command, order); } try { final int commandTopologyId = extractCommandTopologyId(command); final boolean waitTransactionalData = command.getCommandId() != StateRequestCommand.COMMAND_ID; final boolean onExecutorService = executeOnExecutorService(order, command); handleRunnable(createDefaultRunnable(command, reply, commandTopologyId, waitTransactionalData, onExecutorService), onExecutorService); } catch (Throwable throwable) { reply.reply(exceptionHandlingCommand(command, throwable)); } }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { Repository repository = getRepository(event); if (repository == null) { return null; } PushToGerritWizard wiz = new PushToGerritWizard(repository); WizardDialog dlg = new WizardDialog(HandlerUtil .getActiveShellChecked(event), wiz); dlg.setHelpAvailable(false); dlg.open(); return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { Repository repository = getRepository(event); if (repository == null) return null; PushToGerritWizard wiz = new PushToGerritWizard(repository); WizardDialog dlg = new WizardDialog(HandlerUtil .getActiveShellChecked(event), wiz); dlg.setHelpAvailable(false); dlg.open(); return null; }
Source:
public MSPTest() { super(); getAttributes().setType("MSPTest"); }

Target:
public MSPTest() { getAttributes().setType("MSPTest"); }
Source:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } CompilationUnitTree cut = (CompilationUnitTree) tree; cut.types().stream().filter(NOT_EMPTY_STATEMENT).map(t -> ((ClassTree) t).symbol()).forEach(this::checkSymbol); List<ImportTree> imports = cut.imports().stream().filter(NOT_EMPTY_STATEMENT).map(t -> (ImportTree) t).collect(Collectors.toList()); boolean fileContainsStarImport = false; for (ImportTree importTree : imports) { if (importTree.qualifiedIdentifier().is(Kind.MEMBER_SELECT)) { IdentifierTree identifier = ((MemberSelectExpressionTree) importTree.qualifiedIdentifier()).identifier(); if ("*".equals(identifier.name())) { fileContainsStarImport = true; break; } } } if(!fileContainsStarImport) { checkImports(imports); } }

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } CompilationUnitTree cut = (CompilationUnitTree) tree; cut.types().stream().filter(NOT_EMPTY_STATEMENT).map(t -> ((ClassTree) t).symbol()).forEach(this::checkSymbol); List<ImportTree> imports = cut.imports().stream().filter(NOT_EMPTY_STATEMENT).map(t -> (ImportTree) t).collect(Collectors.toList()); boolean fileContainsStarImport = imports.stream() .filter(it -> it.qualifiedIdentifier().is(Kind.MEMBER_SELECT)) .map(it -> ((MemberSelectExpressionTree) it.qualifiedIdentifier()).identifier()) .anyMatch(i -> "*".equals(i.name())); if(!fileContainsStarImport) { checkImports(imports); } }
Source:
private HashUtil() { throw new UnsupportedOperationException(); }

Target:
private HashUtil() { }
Source:
public AssociationLnListTypeBuilder withEmptyLists() { return this; }

Target:
public AssociationLnListTypeBuilder withEmptyLists() { this.associationLnListElement = new ArrayList<>(); return this; }