auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void start(BundleContext context) throws Exception { super.start(context); PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, getPreferenceStore()); adapterFactory = createAdapterFactory(); descriptorsToImages = new HashMap<ImageWithDimensionDescriptor, Image>(); ressourceMissingDocumentProvider = new ResourceMissingDocumentProvider(); workspaceImageFigureRefresher = new WorkspaceImageFigureRefresher(); workspaceImageFigureRefresher.init(); imageSelectorDescriptorRegistryListener = new ImageSelectorDescriptorRegistryListener(); imageSelectorDescriptorRegistryListener.init(); workspaceImageResourceChangeListener = new WorkspaceImageResourceChangeListener(); ResourcesPlugin.getWorkspace().addResourceChangeListener(workspaceImageResourceChangeListener); layoutDataManagerRegistryListener = new LayoutDataManagerRegistryListener(); layoutDataManagerRegistryListener.init(); UIJob job = new UIJob("InitSynchronizedCommand") { @Override public IStatus runInUIThread(IProgressMonitor monitor) { ICommandService commandService = (ICommandService) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(ICommandService.class); Command command = commandService.getCommand("org.eclipse.sirius.diagram.ui.command.synchronizedDiagram"); command.isEnabled(); return new Status(IStatus.OK, ID, "Init synchronized command performed succesfully"); } }; job.schedule(); }

Target:
public void start(BundleContext context) throws Exception { super.start(context); PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, getPreferenceStore()); adapterFactory = createAdapterFactory(); descriptorsToImages = new HashMap<ImageWithDimensionDescriptor, Image>(); ressourceMissingDocumentProvider = new ResourceMissingDocumentProvider(); workspaceImageFigureRefresher = new WorkspaceImageFigureRefresher(); workspaceImageFigureRefresher.init(); imageSelectorDescriptorRegistryListener = new ImageSelectorDescriptorRegistryListener(); imageSelectorDescriptorRegistryListener.init(); layoutDataManagerRegistryListener = new LayoutDataManagerRegistryListener(); layoutDataManagerRegistryListener.init(); UIJob job = new UIJob("InitSynchronizedCommand") { @Override public IStatus runInUIThread(IProgressMonitor monitor) { ICommandService commandService = (ICommandService) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(ICommandService.class); Command command = commandService.getCommand("org.eclipse.sirius.diagram.ui.command.synchronizedDiagram"); command.isEnabled(); return new Status(IStatus.OK, ID, "Init synchronized command performed succesfully"); } }; job.schedule(); }
Source:
public void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException { ClassLoader old = pushClassLoader(name); try { NotificationListener notificationListener = new NotificationListener() { @Override public void handleNotification(Notification notification, Object handback) { ClassLoader previous = null; try { previous = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(listener.getClass().getClassLoader()); listener.handleNotification(notification, handback); } finally { Thread.currentThread().setContextClassLoader(previous); } } }; listeners.put(listener, notificationListener); delegate.addNotificationListener(name, notificationListener, filter, handback); } finally { resetClassLoader(old); } }

Target:
public void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException { ClassLoader old = pushClassLoader(name); try { NotificationListener notificationListener = new NotificationListener() { @Override public void handleNotification(Notification notification, Object handback) { ClassLoader previous = null; try { previous = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(listener.getClass().getClassLoader()); listener.handleNotification(notification, handback); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(previous); } } }; listeners.put(listener, notificationListener); delegate.addNotificationListener(name, notificationListener, filter, handback); } finally { resetClassLoader(old); } }
Source:
private static List<String> parsePath(String path) { String basePath; int endIndex = path.indexOf(QUERY_SEPARATOR); if (endIndex >= 0) { basePath = path.substring(0, endIndex); } else { basePath = path; } try { basePath = URLDecoder.decode(basePath, StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException exception) { throw new IllegalStateException("Cannot decode URL " + basePath, exception); } verifyRelativePath(basePath); List<String> splitList = Arrays.asList(basePath.split(PATH_SEPARATOR)); if (basePath.endsWith(PATH_SEPARATOR)) { List<String> result = new ArrayList<>(splitList.size() + 1); result.addAll(splitList); result.add(""); return result; } else { return splitList; } }

Target:
private static List<String> parsePath(String path) { String basePath; int endIndex = path.indexOf(QUERY_SEPARATOR); if (endIndex >= 0) { basePath = path.substring(0, endIndex); } else { basePath = path; } basePath = decode(basePath, "path"); verifyRelativePath(basePath); List<String> splitList = Arrays.asList(basePath.split(PATH_SEPARATOR)); if (basePath.endsWith(PATH_SEPARATOR)) { List<String> result = new ArrayList<>(splitList.size() + 1); result.addAll(splitList); result.add(""); return result; } else { return splitList; } }
Source:
public void process(Exchange exchange) throws Exception { final String minionHandle = exchange.getIn().getBody(String.class); OnmsMinion minion; if (minionDao != null) { minion = minionDao.findById(minionHandle); if (minion == null) { minion = new OnmsMinion(); minion.setId(minionHandle); minion.setLocation("localhost"); } Date lastCheckedIn = new Date(); minion.setLastCheckedIn(lastCheckedIn); minionDao.saveOrUpdate(minion); } }

Target:
public void process(Exchange exchange) throws Exception { final MinionIdentityDTO minionHandle = exchange.getIn().getBody(MinionIdentityDTO.class); String minionId = minionHandle.getId(); String minionLocation = minionHandle.getLocation(); OnmsMinion minion; if (minionDao != null) { minion = minionDao.findById(minionId); if (minion == null) { minion = new OnmsMinion(); minion.setId(minionId); minion.setLocation(minionLocation); } Date lastCheckedIn = new Date(); minion.setLastCheckedIn(lastCheckedIn); minionDao.saveOrUpdate(minion); } }
Source:
protected boolean afterCommit() { boolean inTransaction = false; try { Map<Long, Integer> delayedRemoveAttemptsMap = new HashMap<>(); while (!stressor.isTerminated()) { try { if (inTransaction || ongoingTx != null) { try { ongoingTx.rollback(); } catch (Exception e) { log.error("Failed to rollback ongoing transaction.", e); } } startTransaction(); inTransaction = true; for (DelayedRemove delayedRemove : delayedRemoves.values()) { try { if (manager.getLogLogicConfiguration().getMaxDelayedRemoveAttempts() >= 0) { Integer currentDelayedRemoveAttempts = delayedRemoveAttemptsMap.get(delayedRemove.keyId); if (currentDelayedRemoveAttempts != null && currentDelayedRemoveAttempts > manager.getLogLogicConfiguration().getMaxDelayedRemoveAttempts()) { log.errorf("Maximum number of delayed remove attempts on key %s attained, reporting.", keyGenerator.generateKey(delayedRemove.keyId)); manager.getFailureManager().reportDelayedRemoveError(); stressor.requestTerminate(); return false; } } checkedRemoveValue(delayedRemove.keyId, delayedRemove.oldValue); } catch (Exception e) { if (manager.getLogLogicConfiguration().getMaxDelayedRemoveAttempts() >= 0) { if (!delayedRemoveAttemptsMap.containsKey(delayedRemove.keyId)) { delayedRemoveAttemptsMap.put(delayedRemove.keyId, 1); } else { delayedRemoveAttemptsMap.put(delayedRemove.keyId, delayedRemoveAttemptsMap.get(delayedRemove.keyId) + 1); } } throw e; } } ongoingTx.commit(); lastSuccessfulTxTimestamp = System.currentTimeMillis(); inTransaction = false; delayedRemoves.clear(); return true; } catch (Exception e) { log.error("Error while executing delayed removes.", e); } } } finally { clearTransaction(); } return true; }

Target:
protected boolean afterCommit() { try { int delayedRemoveAttempts = 0; while (!stressor.isTerminated()) { boolean delayedRemoveError = false; try { if (ongoingTx != null) { try { ongoingTx.rollback(); } catch (Exception e) { log.error("Failed to rollback ongoing transaction", e); } } startTransaction(); for (DelayedRemove delayedRemove : delayedRemoves.values()) { try { if (manager.getLogLogicConfiguration().getMaxDelayedRemoveAttempts() >= 0 && delayedRemoveAttempts > manager.getLogLogicConfiguration().getMaxDelayedRemoveAttempts()) { log.errorf("Maximum number of delayed remove attempts on key %s attained, reporting.", keyGenerator.generateKey(delayedRemove.keyId)); manager.getFailureManager().reportDelayedRemoveError(); stressor.requestTerminate(); return false; } checkedRemoveValue(delayedRemove.keyId, delayedRemove.oldValue); } catch (Exception e) { if (manager.getLogLogicConfiguration().getMaxDelayedRemoveAttempts() >= 0) { delayedRemoveAttempts++; } delayedRemoveError = true; throw e; } } ongoingTx.commit(); lastSuccessfulTxTimestamp = System.currentTimeMillis(); delayedRemoves.clear(); return true; } catch (Exception e) { if (!delayedRemoveError && manager.getLogLogicConfiguration().getMaxDelayedRemoveAttempts() >= 0) { delayedRemoveAttempts++; } log.error("Error while executing delayed removes.", e); } finally { delayedRemoveError = false; } } } finally { clearTransaction(); } return true; }
Source:
public AdapterPatientLocationQuerySecuredResponseType adapterPatientLocationQuerySecured( AdapterPatientLocationQuerySecuredRequestType request) { context.toString(); return PatientLocationQueryImpl.getPatientLocationQuery().getAdapterPLQSecuredResponse(request); }

Target:
public AdapterPatientLocationQuerySecuredResponseType adapterPatientLocationQuerySecured( AdapterPatientLocationQuerySecuredRequestType request) { return PatientLocationQueryImpl.getPatientLocationQuery().getAdapterPLQSecuredResponse(request); }
Source:
private void notifySerialDataReceived(final String address, final byte[] data) { try { synchronized (serialDataReceiveListeners) { ScheduledExecutorService executor = Executors.newScheduledThreadPool(serialDataReceiveListeners.size()); for (final ISerialDataReceiveListener listener:serialDataReceiveListeners) { executor.execute(new Runnable() { public void run() { listener.serialDataReceived(address, data); } }); } executor.shutdown(); } } catch (Exception e) { e.printStackTrace(); } }

Target:
private void notifySerialDataReceived(final String address, final byte[] data) { try { synchronized (serialDataReceiveListeners) { ScheduledExecutorService executor = Executors.newScheduledThreadPool(Math.min(MAXIMUM_PARALLEL_LISTENER_THREADS, packetReceiveListeners.size())); for (final ISerialDataReceiveListener listener:serialDataReceiveListeners) { executor.execute(new Runnable() { public void run() { listener.serialDataReceived(address, data); } }); } executor.shutdown(); } } catch (Exception e) { e.printStackTrace(); } }
Source:
private void checkParentPermission(Package newPackage, AbstractRowLevelSecurityRepositoryDecorator.Action action) { Package parent = newPackage.getParent(); if (parent != null) { boolean checkPackage = isParentUpdated(action, newPackage); if (checkPackage && !userPermissionEvaluator.hasPermission(new PackageIdentity(parent.getId()), PackagePermission.WRITEMETA)) { throw new MolgenisDataException( String.format("No [%s] permission on package '%s'", toMessagePermission(action), parent.getLabel())); } } else { if (!currentUserIsSuOrSystem() && isParentUpdated(action, newPackage)) { throw new MolgenisDataException("Only superusers are allowed to create packages without a parent."); } } }

Target:
private void checkParentPermission(Package newPackage, AbstractRowLevelSecurityRepositoryDecorator.Action action) { Package parent = newPackage.getParent(); if (parent != null) { boolean checkPackage = isParentUpdated(action, newPackage); if (checkPackage && !userPermissionEvaluator.hasPermission(new PackageIdentity(parent.getId()), PackagePermission.WRITEMETA)) { throw new PackagePermissionException(PackagePermission.WRITEMETA, parent); } } else { if (!currentUserIsSuOrSystem() && isParentUpdated(action, newPackage)) { throw new NullParentPackageNotSuException(); } } }
Source:
public IncrementalScoreDirector(IncrementalScoreDirectorFactory scoreDirectorFactory, boolean constraintMatchEnabledPreference, IncrementalScoreCalculator<Solution_> incrementalScoreCalculator) { super(scoreDirectorFactory, constraintMatchEnabledPreference); if (constraintMatchEnabledPreference && !(incrementalScoreCalculator instanceof ConstraintMatchAwareIncrementalScoreCalculator)) { throw new IllegalStateException("The score calculator " + incrementalScoreCalculator + " must implement " + ConstraintMatchAwareIncrementalScoreCalculator.class.getSimpleName() + " when constraintMatchEnabledPreference is true."); } this.incrementalScoreCalculator = incrementalScoreCalculator; }

Target:
public IncrementalScoreDirector(IncrementalScoreDirectorFactory scoreDirectorFactory, boolean constraintMatchEnabledPreference, IncrementalScoreCalculator<Solution_> incrementalScoreCalculator) { super(scoreDirectorFactory, constraintMatchEnabledPreference); this.incrementalScoreCalculator = incrementalScoreCalculator; }
Source:
public static synchronized SpanObserver subscribe(String name, SpanObserver observer) { if (observers.containsKey(name)) { log.warn("Overwriting existing SpanObserver with name by new observer: {}", UnsafeArg.of("name", name), UnsafeArg.of("observer", observer)); } if (observers.size() >= 5) { log.warn("Five or more SpanObservers registered: {}", UnsafeArg.of("observers", observers.keySet())); } SpanObserver currentValue = observers.put(name, observer); computeObserversList(); return currentValue; }

Target:
public static synchronized SpanObserver subscribe(String name, SpanObserver observer) { if (observers.containsKey(name)) { log.warn("Overwriting existing SpanObserver with name by new observer: {}", SafeArg.of("name", name), UnsafeArg.of("observer", observer)); } if (observers.size() >= 5) { log.warn("Five or more SpanObservers registered: {}", SafeArg.of("observers", observers.keySet())); } SpanObserver currentValue = observers.put(name, observer); computeObserversList(); return currentValue; }
Source:
public synchronized void setApprovedSignatures(String[] signatures) throws IOException { Jenkins.getInstance().checkPermission(Jenkins.RUN_SCRIPTS); approvedSignatures.clear(); List<String> goodSignatures = new ArrayList<>(signatures.length); for (String signature : signatures) { try { StaticWhitelist.parse(signature); goodSignatures.add(signature); } catch (IOException e) { LOG.warning("Ignoring malformed signature: " + signature); } } approvedSignatures.addAll(goodSignatures); save(); reconfigure(); }

Target:
public synchronized void setApprovedSignatures(String[] signatures) throws IOException { Jenkins.getInstance().checkPermission(Jenkins.RUN_SCRIPTS); approvedSignatures.clear(); List<String> goodSignatures = new ArrayList<>(signatures.length); for (String signature : signatures) { try { StaticWhitelist.parse(signature); goodSignatures.add(signature); } catch (IOException e) { LOG.warning("Ignoring malformed signature: " + signature + " (Occurred exception: " + e.toString() + ")"); } } approvedSignatures.addAll(goodSignatures); save(); reconfigure(); }
Source:
public void recognizeLinkedEntitiesBatchMaxOverload() { List<TextDocumentInput> textDocumentInputs = Arrays.asList( new TextDocumentInput("1", "Old Faithful is a geyser at Yellowstone Park."), new TextDocumentInput("2", "Mount Shasta has lenticular clouds.") ); textAnalyticsClient.recognizeLinkedEntitiesBatch(textDocumentInputs, new TextAnalyticsRequestOptions().setIncludeStatistics(true), Context.NONE).iterableByPage().forEach( response -> { TextDocumentBatchStatistics batchStatistics = response.getStatistics(); System.out.printf( "A batch of documents statistics, transaction count: %s, valid document count: %s.%n", batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount()); response.getElements().forEach(recognizeLinkedEntitiesResult -> recognizeLinkedEntitiesResult.getEntities().forEach(linkedEntity -> { System.out.println("Linked Entities:"); System.out.printf("Name: %s, entity ID in data source: %s, URL: %s, data source: %s.%n", linkedEntity.getName(), linkedEntity.getDataSourceEntityId(), linkedEntity.getUrl(), linkedEntity.getDataSource()); linkedEntity.getMatches().forEach(entityMatch -> System.out.printf( "Matched entity: %s, confidence score: %.2f.%n", entityMatch.getText(), entityMatch.getConfidenceScore())); })); }); END: com.azure.ai.textanalytics.TextAnalyticsClient.recognizeLinkedEntitiesBatch#Iterable-TextAnalyticsRequestOptions-Context }

Target:
public void recognizeLinkedEntitiesBatchMaxOverload() { List<TextDocumentInput> textDocumentInputs = Arrays.asList( new TextDocumentInput("1", "Old Faithful is a geyser at Yellowstone Park.").setLanguage("en"), new TextDocumentInput("2", "Mount Shasta has lenticular clouds.").setLanguage("en") ); textAnalyticsClient.recognizeLinkedEntitiesBatch(textDocumentInputs, new TextAnalyticsRequestOptions().setIncludeStatistics(true), Context.NONE).iterableByPage().forEach( response -> { TextDocumentBatchStatistics batchStatistics = response.getStatistics(); System.out.printf( "A batch of documents statistics, transaction count: %s, valid document count: %s.%n", batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount()); response.getElements().forEach(recognizeLinkedEntitiesResult -> recognizeLinkedEntitiesResult.getEntities().forEach(linkedEntity -> { System.out.println("Linked Entities:"); System.out.printf("Name: %s, entity ID in data source: %s, URL: %s, data source: %s.%n", linkedEntity.getName(), linkedEntity.getDataSourceEntityId(), linkedEntity.getUrl(), linkedEntity.getDataSource()); linkedEntity.getMatches().forEach(entityMatch -> System.out.printf( "Matched entity: %s, confidence score: %.2f.%n", entityMatch.getText(), entityMatch.getConfidenceScore())); })); }); END: com.azure.ai.textanalytics.TextAnalyticsClient.recognizeLinkedEntitiesBatch#Iterable-TextAnalyticsRequestOptions-Context }
Source:
public void testReloadwithRedirect() throws Exception { CliProcessWrapper cliProc = new CliProcessWrapper() .addCliArgument("--connect") .addCliArgument("--controller=" + TestSuiteEnvironment.getServerAddress() + ":" + TestSuiteEnvironment.getServerPort()); try { cliProc.executeInteractive(); cliProc.clearOutput(); boolean promptFound = cliProc. pushLineAndWaitForResults("/core-service=management/" + "security-realm=ManagementRealm/" + "server-identity=ssl:add(keystore-path=management.keystore," + "keystore-relative-to=jboss.server.config.dir," + "keystore-password=password,alias=server,key-password=password," + "generate-self-signed-certificate-host=localhost)", null); assertTrue("Invalid prompt" + cliProc.getOutput(), promptFound); cliProc.clearOutput(); promptFound = cliProc.pushLineAndWaitForResults("/core-service=management/" + "management-interface=http-interface:" + "write-attribute(name=secure-socket-binding,value=management-https)", null); assertTrue("Invalid prompt" + cliProc.getOutput(), promptFound); cliProc.clearOutput(); promptFound = cliProc.pushLineAndWaitForResults("reload", "Accept certificate"); assertTrue("No certificate prompt " + cliProc.getOutput(), promptFound); } finally { cliProc.ctrlCAndWaitForClose(); cliProc.destroyProcess(); } }

Target:
public void testReloadwithRedirect() throws Exception { CliProcessWrapper cliProc = new CliProcessWrapper() .addCliArgument("--connect") .addCliArgument("--controller=" + TestSuiteEnvironment.getServerAddress() + ":" + TestSuiteEnvironment.getServerPort()); try { cliProc.executeInteractive(); cliProc.clearOutput(); boolean promptFound = cliProc. pushLineAndWaitForResults("/core-service=management/" + "security-realm=ManagementRealm/" + "server-identity=ssl:add(keystore-path=management.keystore," + "keystore-relative-to=jboss.server.config.dir," + "keystore-password=password,alias=server,key-password=password," + "generate-self-signed-certificate-host=localhost)", null); assertTrue("Invalid prompt" + cliProc.getOutput(), promptFound); cliProc.clearOutput(); promptFound = cliProc.pushLineAndWaitForResults("/core-service=management/" + "management-interface=http-interface:" + "write-attribute(name=secure-socket-binding,value=management-https)", null); assertTrue("Invalid prompt" + cliProc.getOutput(), promptFound); cliProc.clearOutput(); promptFound = cliProc.pushLineAndWaitForResults("reload", "Accept certificate"); assertTrue("No certificate prompt " + cliProc.getOutput(), promptFound); } finally { cliProc.ctrlCAndWaitForClose(); } }
Source:
public void test_restlet_base64_encoding_without_newlines_should_be_equal_jdk_base64_encoding() { String source = "Man is distinguished, not only by his reason, but by this singular passion from " + "other animals, which is a lust of the mind, that by a perseverance of delight " + "in the continued and indefatigable generation of knowledge, exceeds the short " + "vehemence of any carnal pleasure."; String expected = "TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz" + "IHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2Yg" + "dGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGlu" + "dWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRo" + "ZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4="; assertEquals(expected, Base64.encode(source.getBytes(), false)); assertEquals(expected, java.util.Base64.getEncoder().encodeToString(source.getBytes())); }

Target:
public void test_restlet_base64_encoding_without_newlines_should_be_equal_jdk_base64_encoding() { assertEquals(REFERENCE_TEXT_ENCODED, Base64.encode(REFERENCE_TEXT_AS_BYTES_ARRAY, false)); assertEquals(REFERENCE_TEXT_ENCODED, java.util.Base64.getEncoder().encodeToString(REFERENCE_TEXT_AS_BYTES_ARRAY)); }
Source:
public void prepareDatabaseForTestRun() { cleanRepoAbstractEntity(this.oslpDeviceRepo); cleanRepoAbstractEntity(this.deviceAuthorizationRepo); cleanRepoSerializable(this.smartMeterRepo); cleanRepoSerializable(this.deviceRepo); cleanRepoSerializable(this.deviceModelRepo); cleanRepoSerializable(this.manufacturerRepo); for (final Organisation org : this.organizationRepo.findAll()) { if (!org.getOrganisationIdentification().equals("test-org") && !org.getOrganisationIdentification().equals("Inforstroom") && !org.getOrganisationIdentification().equals("FlexOvlProject") && !org.getOrganisationIdentification().equals("GemeenteArnhem") && !org.getOrganisationIdentification().equals("LianderNetManagement")) { this.organizationRepo.delete(org); } } this.insertDefaultData(); }

Target:
public void prepareDatabaseForTestRun() { cleanRepoAbstractEntity(this.oslpDeviceRepo); cleanRepoAbstractEntity(this.deviceAuthorizationRepo); cleanRepoSerializable(this.smartMeterRepo); cleanRepoSerializable(this.deviceRepo); cleanRepoSerializable(this.deviceModelRepo); cleanRepoSerializable(this.manufacturerRepo); for (final Organisation org : this.organizationRepo.findAll()) { if (!org.getOrganisationIdentification().equals("test-org") && !org.getOrganisationIdentification().equals("Infostroom") && !org.getOrganisationIdentification().equals("FlexOvlProject") && !org.getOrganisationIdentification().equals("GemeenteArnhem") && !org.getOrganisationIdentification().equals("LianderNetManagement")) { this.organizationRepo.delete(org); } } this.insertDefaultData(); }
Source:
public long getSizeInBytes() { long sizeInBytes = 0; int partitionCount = partitionFunction.getPartitionCount(); for (int i = 0; i < partitionCount; i++) { sizeInBytes += partitionData[i].getSizeInBytes(); } return sizeInBytes; }

Target:
public long getSizeInBytes() { long sizeInBytes = 0; for (int i = 0; i < partitionData.length; i++) { sizeInBytes += partitionData[i].getSizeInBytes(); } return sizeInBytes; }
Source:
private void downloadPatient(Patient patient) { ToastUtil.showShortToast(mContext, ToastUtil.ToastType.NOTICE, R.string.download_started); new PatientDAO().savePatient(patient).subscribe(); new VisitApi().syncVisitsData(patient); new VisitApi().syncLastVitals(patient.getUuid()); ToastUtil.success("Patient with UUID " + patient.getUuid() + " is now available locally"); }

Target:
private void downloadPatient(Patient patient) { ToastUtil.showShortToast(mContext, ToastUtil.ToastType.NOTICE, R.string.download_started); new PatientDAO().savePatient(patient) .observeOn(AndroidSchedulers.mainThread()) .subscribe(id -> { new VisitApi().syncVisitsData(patient); new VisitApi().syncLastVitals(patient.getUuid()); ToastUtil.success("Patient with UUID " + patient.getUuid() + " is now available locally"); }); }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View layout = inflater.inflate(R.layout.fragment_settings, container, false); wifiSwitch = (Switch) layout.findViewById(R.id.wifi_setting); sdCardSwitch = (Switch) layout.findViewById(R.id.download_location_switch); sdCardSettinglayout = (LinearLayout) layout.findViewById(R.id.sd_card_setting_layout); if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) { sdCardSettinglayout.setVisibility(View.GONE); } if (!EventBus.getDefault().isRegistered(this)) EventBus.getDefault().registerSticky(this); updateWifiSwitch(); updateSDCardSwitch(); final LinearLayout settingsLayout = (LinearLayout) layout.findViewById(R.id.settings_layout); for (SettingsExtension extension : extensionRegistry.forType(SettingsExtension.class)) { extension.onCreateSettingsView(settingsLayout); } return layout; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View layout = inflater.inflate(R.layout.fragment_settings, container, false); wifiSwitch = (Switch) layout.findViewById(R.id.wifi_setting); sdCardSwitch = (Switch) layout.findViewById(R.id.download_location_switch); sdCardSettingsLayout = (LinearLayout) layout.findViewById(R.id.sd_card_setting_layout); updateWifiSwitch(); updateSDCardSwitch(); final LinearLayout settingsLayout = (LinearLayout) layout.findViewById(R.id.settings_layout); for (SettingsExtension extension : extensionRegistry.forType(SettingsExtension.class)) { extension.onCreateSettingsView(settingsLayout); } return layout; }
Source:
public ZKHelixAdmin(String zkAddress) { int timeOutInSec = Integer.parseInt(System.getProperty(CONNECTION_TIMEOUT, "30")); RealmAwareZkClient.RealmAwareZkClientConfig clientConfig = new RealmAwareZkClient.RealmAwareZkClientConfig() .setConnectInitTimeout(timeOutInSec * 1000L) .setZkSerializer(new ZNRecordSerializer()); RealmAwareZkClient zkClient; try { zkClient = new FederatedZkClient(clientConfig); } catch (IllegalStateException e) { LOG.warn("Current namespace is not registered to realm-aware ZK." + " Fallback to HelixZkClient for ZK: {}", zkAddress); zkClient = SharedZkClientFactory.getInstance() .buildZkClient(new HelixZkClient.ZkConnectionConfig(zkAddress), clientConfig.createHelixZkClientConfig()); zkClient.waitUntilConnected(timeOutInSec, TimeUnit.SECONDS); } _zkClient = zkClient; _configAccessor = new ConfigAccessor(_zkClient); _usesExternalZkClient = false; }

Target:
public ZKHelixAdmin(String zkAddress) { int timeOutInSec = Integer.parseInt(System.getProperty(CONNECTION_TIMEOUT, "30")); RealmAwareZkClient.RealmAwareZkClientConfig clientConfig = new RealmAwareZkClient.RealmAwareZkClientConfig() .setConnectInitTimeout(timeOutInSec * 1000L) .setZkSerializer(new ZNRecordSerializer()); RealmAwareZkClient zkClient; if (Boolean.getBoolean(SystemPropertyKeys.MULTI_ZK_ENABLED)) { try { zkClient = new FederatedZkClient( new RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder().build(), clientConfig); } catch (IllegalStateException | IOException | InvalidRoutingDataException e) { throw new HelixException("Not able to connect on multi-realm mode.", e); } } else { zkClient = SharedZkClientFactory.getInstance() .buildZkClient(new HelixZkClient.ZkConnectionConfig(zkAddress), clientConfig.createHelixZkClientConfig()); zkClient.waitUntilConnected(timeOutInSec, TimeUnit.SECONDS); } _zkClient = zkClient; _configAccessor = new ConfigAccessor(_zkClient); _usesExternalZkClient = false; }
Source:
public void updateRepositoryConfiguration(TaskRepository taskRepository, IProgressMonitor monitor) throws CoreException { monitorMap.put(new RepositoryKey(taskRepository), monitor != null ? OperationUtil.convert(monitor) : new NullOperationMonitor()); configurationCache.refresh(new RepositoryKey(taskRepository)); monitorMap.remove(new RepositoryKey(taskRepository)); }

Target:
public void updateRepositoryConfiguration(TaskRepository taskRepository, IProgressMonitor monitor) throws CoreException { context.set(monitor != null ? OperationUtil.convert(monitor) : new NullOperationMonitor()); configurationCache.refresh(new RepositoryKey(taskRepository)); context.remove(); }
Source:
public void close() { closed = true; }

Target:
public void close() { closed = true; sessionDeleter.shutdown(); }
Source:
static Date tryParseISO8601Date(String dateString) { if (isEmpty(dateString)) { return null; } try { SimpleDateFormat format = new SimpleDateFormat("yyyy:MM:dd:HH:mm:ss:X", US); return format.parse(dateString); } catch (ParseException e) { try { SimpleDateFormat format = new SimpleDateFormat("yyyy:MM:dd:HH:mm:ss", US); return format.parse(dateString); } catch (ParseException e1) { e1.printStackTrace(); throw new RuntimeException(e); } } }

Target:
static Date tryParseISO8601Date(String dateString) { if (isEmpty(dateString)) { return null; } String noTZ = "yyyy:MM:dd:HH:mm:ss"; if (dateString.length() == noTZ.length()) { return date(dateString, noTZ); } else if (dateString.length() == noTZ.length() + 4) { dateString = dateString + "00"; } return date(dateString, "yyyy:MM:dd:HH:mm:ss:Z"); }
Source:
public void performSearch() { BasePanel currentBasePanel = frame.getCurrentBasePanel(); if (currentBasePanel == null) { return; } if (searchField.getText().isEmpty()) { clearSearch(); return; } SearchQuery searchQuery = getSearchQuery(); if (!searchQuery.isValid()) { informUserAboutInvalidSearchQuery(); return; } Globals.stateManager.setSearchQuery(searchQuery); updateResults(Globals.stateManager.searchResultSizeProperty().get(), SearchDescribers.getSearchDescriberFor(searchQuery).getDescription(), searchQuery.isGrammarBasedSearch()); Globals.stateManager.fireSearchQueryHighlightEvent(); }

Target:
public void performSearch() { BasePanel currentBasePanel = frame.getCurrentBasePanel(); if (currentBasePanel == null) { return; } if (searchField.getText().isEmpty()) { clearSearch(); return; } SearchQuery searchQuery = getSearchQuery(); if (!searchQuery.isValid()) { informUserAboutInvalidSearchQuery(); return; } Globals.stateManager.setSearchQuery(searchQuery); }
Source:
public InstrumentedHandler(MetricRegistry registry, Handler underlying) { this(registry, underlying, underlying.getClass().getName()); }

Target:
public InstrumentedHandler(MetricRegistry registry, Handler underlying) { this(registry, underlying, name(underlying.getClass())); }
Source:
public static String getName(Channel channel, Resources res) { switch (channel) { case SYNC: return res.getString(R.string.sync_title); case GLOBAL_REMINDERS: return res.getString(R.string.widget_minimum_cards_due_notification_ticker_title); case DECK_REMINDERS: return res.getString(R.string.deck_conf_reminders); case GENERAL: default: return res.getString(R.string.app_name); } }

Target:
private static String getName(Channel channel, Resources res) { switch (channel) { case SYNC: return res.getString(R.string.sync_title); case GLOBAL_REMINDERS: return res.getString(R.string.widget_minimum_cards_due_notification_ticker_title); case DECK_REMINDERS: return res.getString(R.string.deck_conf_reminders); case GENERAL: default: return res.getString(R.string.app_name); } }
Source:
public void createWithCorrectId() throws Exception { MatcherAssert.assertThat( "Hook json returned wrong id", this.hook.json().getInt("id"), new IsEqual<Integer>( Integer.parseInt(this.xml.xpath("id/text()").get(0)) ) ); }

Target:
public void createWithCorrectId() throws Exception { final int number = 5; final MkStorage storage = new MkStorage.InFile(); final Coordinates coords = new Coordinates.Simple("user/repo"); storage.apply( this.hookDirs(number, coords) ); MatcherAssert.assertThat( "Hook json returned wrong id", new MkHook(storage, "login", coords, number).json().getString("id"), new IsEqual<String>(String.valueOf(number)) ); }
Source:
public List<? extends Module> getJacksonModules() { return ImmutableList.of( new SimpleModule("DruidCaffeineCache-" + System.identityHashCode(this)) .registerSubtypes(CaffeineCacheProvider.class) ); }

Target:
public List<? extends Module> getJacksonModules() { return ImmutableList.of( new SimpleModule("DruidCaffeineCache") .registerSubtypes(CaffeineCacheProvider.class) ); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mMapView = findViewById(R.id.mapView); ArcGISMap map = new ArcGISMap(Basemap.createImagery()); mMapView.setMap(map); List<String> wmsLayerNames = Collections.singletonList(getString(R.string.wms_layer_name_minnesota)); mWmsLayer = new WmsLayer(getString(R.string.wms_layer_url_minnesota), wmsLayerNames); mWmsLayer.loadAsync(); mWmsLayer.addDoneLoadingListener(() -> { if (mWmsLayer.getLoadStatus() == LoadStatus.LOADED) { map.getOperationalLayers().add(mWmsLayer); mMapView.setViewpoint(new Viewpoint(mWmsLayer.getFullExtent())); List<String> styles = mWmsLayer.getSublayers().get(0).getSublayerInfo().getStyles(); ToggleButton toggle = findViewById(R.id.toggleStyleButton); toggle.setOnCheckedChangeListener((buttonView, isChecked) -> { if (isChecked) { mWmsLayer.getSublayers().get(0).setCurrentStyle(styles.get(1)); } else { mWmsLayer.getSublayers().get(0).setCurrentStyle(styles.get(0)); END] } }); } else { String error = "Failed to load WMS layer: " + mWmsLayer.getLoadError().getMessage(); Log.e(TAG, error); Toast.makeText(this, error, Toast.LENGTH_LONG).show(); } }); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mMapView = findViewById(R.id.mapView); ArcGISMap map = new ArcGISMap(Basemap.createImagery()); mMapView.setMap(map); List<String> wmsLayerNames = Collections.singletonList(getString(R.string.wms_layer_name_minnesota)); WmsLayer wmsLayer = new WmsLayer(getString(R.string.wms_layer_url_minnesota), wmsLayerNames); map.getOperationalLayers().add(wmsLayer); wmsLayer.addDoneLoadingListener(() -> { if (wmsLayer.getLoadStatus() == LoadStatus.LOADED) { mMapView.setViewpoint(new Viewpoint(wmsLayer.getFullExtent())); List<String> styles = wmsLayer.getSublayers().get(0).getSublayerInfo().getStyles(); ToggleButton toggle = findViewById(R.id.toggleStyleButton); toggle.setOnCheckedChangeListener((buttonView, isChecked) -> { if (isChecked) { wmsLayer.getSublayers().get(0).setCurrentStyle(styles.get(1)); } else { wmsLayer.getSublayers().get(0).setCurrentStyle(styles.get(0)); END] } }); } else { String error = "Failed to load WMS layer: " + wmsLayer.getLoadError().getMessage(); Log.e(TAG, error); Toast.makeText(this, error, Toast.LENGTH_LONG).show(); } }); }
Source:
public List<StartIdentifiedAtlasDbTransactionResponse> startIdentifiedAtlasDbTransactionBatch(int count) { List<StartIdentifiedAtlasDbTransactionResponse> responses = executeOnTimeLock( () -> delegate.startIdentifiedAtlasDbTransactionBatch(count)); lockRefresher.registerLocks(responses .stream() .map(response -> response.immutableTimestamp().getLock()) .collect(Collectors.toList())); return responses; }

Target:
public List<StartIdentifiedAtlasDbTransactionResponse> startIdentifiedAtlasDbTransactionBatch(int count) { List<StartIdentifiedAtlasDbTransactionResponse> responses = executeOnTimeLock( () -> delegate.startIdentifiedAtlasDbTransactionBatch(count)); Set<LockToken> immutableTsLocks = responses .stream() .map(response -> response.immutableTimestamp().getLock()) .collect(Collectors.toSet()); try { lockRefresher.registerLocks(immutableTsLocks); } catch (Throwable t) { unlock(immutableTsLocks); throw Throwables.throwUncheckedException(t); } return responses; }
Source:
public void handlePost(ActionParameters params) throws ActionException { params.requireAdminUser(); try { Announcement announcement = AnnouncementsParser.parseAnnouncementParams(params); final JSONObject result = new JSONObject(); int saveId = service.saveAnnouncement(announcement); JSONHelper.putValue(result, "id", saveId); AuditLog.user(params.getClientIp(), params.getUser()) .withParam("id", announcement.getId()) .withParam("title", announcement.getTitle()) .withParam("content", announcement.getContent()) .withParam("beginDate", announcement.getBeginDate()) .withParam("endDate", announcement.getEndDate()) .withParam("active", announcement.getActive()); ResponseHelper.writeResponse(params, result); } catch (Exception e) { LOG.error("Error saving announcement", e); throw new ActionException("Cannot save announcement"); } }

Target:
public void handlePost(ActionParameters params) throws ActionException { params.requireAdminUser(); try { Announcement announcement = AnnouncementsParser.parseAnnouncementParams(params); final JSONObject result = new JSONObject(); int saveId = service.saveAnnouncement(announcement); JSONHelper.putValue(result, "id", saveId); AuditLog.user(params.getClientIp(), params.getUser()) .withParam("id", announcement.getId()) .withParam("title", announcement.getTitle()) .withParam("content", announcement.getContent()) .withParam("beginDate", announcement.getBeginDate()) .withParam("endDate", announcement.getEndDate()) .withParam("active", announcement.getActive()); ResponseHelper.writeResponse(params, result); } catch (Exception e) { throw new ActionException("Cannot save announcement", e); } }
Source:
public List<String> generate() { final List<DetailAST> matchingAstElements = getMatchingAstElements(rootAst); final List<String> generated = new ArrayList<>(); for (DetailAST ast : matchingAstElements) { String xpathQuery = getXpathQuery(null, ast); if (!isUniqueAst(ast)) { final DetailAST child = findChildWithIdent(ast); if (child != null) { xpathQuery = xpathQuery + "[." + getXpathQuery(ast, child) + "]"; } } generated.add(xpathQuery); } return generated; }

Target:
public List<String> generate() { return getMatchingAstElements(rootAst, lineNumber, columnNumber) .stream() .map(XpathQueryGenerator::generateXpathQuery) .collect(Collectors.toList()); }
Source:
public void execute(final Credentials credentials, final Callback loginCallback) { mAuthenticationManager.login(credentials, new IAuthenticationManager.Callback<UserAccount>() { @Override public void onSuccess(UserAccount userAccount) { if (credentials == null && !credentials.isDemoCredentials()) { logoutAndHardcodedLogin(credentials, loginCallback); } else { loginCallback.onLoginSuccess(); } } @Override public void onError(Throwable throwable) { onErrorCallback(loginCallback, throwable); } }); }

Target:
public void execute(final Credentials credentials, final Callback loginCallback) { if (credentials == null) { onErrorCallback(loginCallback, new IllegalArgumentException("Credentials could not be null")); } else { mAuthenticationManager.login(credentials, new IAuthenticationManager.Callback<UserAccount>() { @Override public void onSuccess(UserAccount userAccount) { if (!credentials.isDemoCredentials()) { logoutAndHardcodedLogin(credentials, loginCallback); } else { loginCallback.onLoginSuccess(); } } @Override public void onError(Throwable throwable) { onErrorCallback(loginCallback, throwable); } }); } }
Source:
private void downloading( String fileURL, OutputStream out ) { InputStream in = null; try { URL url = new URL( fileURL ); in = new BufferedInputStream( url.openStream() ); int count; byte[] buffer = new byte[ 4096 ]; while( ( count = in.read( buffer ) ) > 0 ) { out.write( buffer, 0, count ); } } catch( MalformedURLException e ) { throw new IllegalArgumentException( FILE_DOWNLOAD_ERROR, e ); } catch( IOException e ) { throw new BackendlessException( FILE_DOWNLOAD_ERROR, e.getMessage() ); } finally { if( in != null ) { try { in.close(); } catch( IOException e ) { throw new BackendlessException( FILE_DOWNLOAD_ERROR, e.getMessage() ); } } if( out != null ) { try { out.close(); } catch( IOException e ) { throw new BackendlessException( FILE_DOWNLOAD_ERROR, e.getMessage() ); } } } }

Target:
private void downloading( String fileURL, OutputStream out ) { try( InputStream in = new BufferedInputStream( new URL( fileURL ).openStream() ) ) { int count; byte[] buffer = new byte[ 4096 ]; while( ( count = in.read( buffer ) ) > 0 ) { if( Thread.currentThread().isInterrupted() ) { break; } out.write( buffer, 0, count ); } } catch( IOException e ) { throw new BackendlessException( FILE_DOWNLOAD_ERROR, e.getMessage() ); } }
Source:
private void checkContextValidity(Context context) { K body = context.body(); new VisitK() { int cntHoles = 0; int cntRewrites = 0; public void check(K k) { apply(k); if (cntHoles < 1) { throw KEMException.compilerError("Contexts must have at least one HOLE.", context); } if (cntRewrites > 1) { throw KEMException.compilerError("Cannot compile a context with multiple rewrites.", context); } } @Override public void apply(KVariable k) { if (k.name().equals("HOLE")) { cntHoles++; } super.apply(k); } @Override public void apply(KRewrite k) { cntRewrites++; if (!isHOLE(k.left())) { throw KEMException.compilerError("Only the HOLE can be rewritten in a context definition", context); } super.apply(k); } private boolean isHOLE(K k) { if (k instanceof KApply) { KApply kapp = (KApply) k; return kapp.klabel().name().startsWith("#SemanticCastTo") && kapp.klist().size() == 1 && isHOLEVar(kapp.klist().items().get(0)); } else { return isHOLEVar(k); } } private boolean isHOLEVar(K k) { return k instanceof KVariable && ((KVariable) k).name().equals("HOLE"); } }.check(body); }

Target:
public static void checkContextValidity(Context context) { K body = context.body(); int cntHoles = new FindK() { @Override public scala.collection.Set<K> apply(KVariable k) { if (k.name().equals("HOLE")) { return org.kframework.Collections.Set(k); } else { return super.apply(k); } } }.apply(body).size(); if (cntHoles < 1) { throw KEMException.compilerError("Contexts must have at least one HOLE.", context); } int cntRewrites = new FindK() { @Override public scala.collection.Set<K> apply(KRewrite k) { return this.merge(org.kframework.Collections.Set(k), super.apply(k)); } }.apply(body).size(); if (cntRewrites > 1) { throw KEMException.compilerError("Cannot compile a context with multiple rewrites.", context); } new VisitK() { @Override public void apply(KRewrite k) { if (!isHOLE(k.left())) { throw KEMException.compilerError("Only the HOLE can be rewritten in a context definition", context); } super.apply(k); } private boolean isHOLE(K k) { if (k instanceof KApply) { KApply kapp = (KApply) k; return kapp.klabel().name().startsWith("#SemanticCastTo") && kapp.klist().size() == 1 && isHOLEVar(kapp.klist().items().get(0)); } else { return isHOLEVar(k); } } private boolean isHOLEVar(K k) { return k instanceof KVariable && ((KVariable) k).name().equals("HOLE"); } }.apply(body); }
Source:
private Map<?, ?> getCollectionIssues(Map<?, ?> articleMetadata, final Site site) { Predicate<Map.Entry<String,Map<String, Object>>> collectionsJournalFilter = new Predicate<Map.Entry<String,Map<String, Object>>>() { public boolean apply(Map.Entry<String,Map<String, Object>> entry) { Map<String, String> parentJournal = ((Map<String, String>) entry.getValue().get("parentJournal")); if (parentJournal != null) { String journalKey = parentJournal.get("journalKey"); if (journalKey != null){ Site publishedSite; try { publishedSite = site.getTheme().resolveForeignJournalKey(siteSet, journalKey); return (boolean) publishedSite.getTheme().getConfigMap("journal").get("isCollection"); } catch (Exception e) { return false; } } } return false; } }; Map<String, Map<String, Object>> articleIssues = (Map<String, Map<String, Object>>)articleMetadata.get("issues"); return Maps.filterEntries(articleIssues, collectionsJournalFilter); }

Target:
private Map<?, ?> getCollectionIssues(Map<?, ?> articleMetadata, final Site site) { Map<String, Map<String, Object>> articleIssues = (Map<String, Map<String, Object>>)articleMetadata.get("issues"); for (Iterator<Map.Entry<String, Map<String, Object>>> iter = articleIssues.entrySet().iterator(); iter.hasNext();) { Map.Entry<String, Map<String, Object>> entry = iter.next(); Map<String, String> parentJournal = ((Map<String, String>) entry.getValue().get("parentJournal")); if (parentJournal != null) { String journalKey = parentJournal.get("journalKey"); if (journalKey != null){ Site publishedSite; try { publishedSite = site.getTheme().resolveForeignJournalKey(siteSet, journalKey); if ((boolean) publishedSite.getTheme().getConfigMap("journal").get("isCollection")) { continue; }; } catch (UnmatchedSiteException use) { throw new RuntimeException("Could not resolve collections pub site using journalKey: " + journalKey, use); } catch (Exception e) { throw new RuntimeException(e); } } } iter.remove(); } return articleIssues; }
Source:
SqlBatchImpl(String sqlBlock, Object[] userParams, Context context) throws SqlParseException, PlannerFallbackException { List<String> sqlList = SQLLexer.splitStatements(sqlBlock).getCompletelyParsedStmts(); if (sqlList.size() == 0) { throw new RuntimeException("Failed to plan, no SQL statement provided."); } if (userParams != null && userParams.length > 0 && sqlList.size() != 1) { throw new UnsupportedOperationException(ADHOC_ERROR_RESPONSE); } ImmutableList.Builder<SqlTask> taskBuilder = new ImmutableList.Builder<>(); Boolean isDDLBatch = null; for (final String sql : sqlList) { if (! CALCITE_CHECKS.check(sql)) { throw new PlannerFallbackException(); } SqlTask sqlTask = SqlTask.from(sql); if (isDDLBatch == null) { isDDLBatch = sqlTask.isDDL(); } else if (isDDLBatch ^ sqlTask.isDDL()) { throw new UnsupportedOperationException("Mixing DDL with DML/DQL queries is unsupported."); } taskBuilder.add(sqlTask); } m_tasks = taskBuilder.build(); if (userParams != null) { m_userParams = ImmutableList.copyOf(userParams); } else { m_userParams = null; } m_isDDLBatch = isDDLBatch; m_context = context; }

Target:
SqlBatchImpl(String sqlBlock, Object[] userParams, Context context) throws SqlParseException, PlannerFallbackException { List<String> sqlList = SQLLexer.splitStatements(sqlBlock).getCompletelyParsedStmts(); if (sqlList.size() == 0) { throw new RuntimeException("Failed to plan, no SQL statement provided."); } if (userParams != null && userParams.length > 0 && sqlList.size() != 1) { throw new UnsupportedOperationException(ADHOC_ERROR_RESPONSE); } ImmutableList.Builder<SqlTask> taskBuilder = new ImmutableList.Builder<>(); Boolean isDDLBatch = null; for (final String sql : sqlList) { if (! CALCITE_CHECKS.check(sql)) { throw new PlannerFallbackException(); } SqlTask sqlTask = SqlTask.from(sql); if (isDDLBatch == null) { isDDLBatch = sqlTask.isDDL(); } else if (isDDLBatch != sqlTask.isDDL()) { throw new UnsupportedOperationException("Mixing DDL with DML/DQL queries is unsupported."); } taskBuilder.add(sqlTask); } m_tasks = taskBuilder.build(); if (userParams != null) { m_userParams = ImmutableList.copyOf(userParams); } else { m_userParams = null; } m_isDDLBatch = isDDLBatch; m_context = context; }
Source:
private List<String> getListOfIsoFiles(File directory, OVirtNodeInfo info) { List<String> isoFileList = new ArrayList<String>(); File[] filterOvirtFiles = filterOvirtFiles(directory, getIsoPattern(info)); for (File file : filterOvirtFiles) { isoFileList.add(file.getName()); } return isoFileList; }

Target:
private static List<String> getListOfIsoFiles(File directory, OVirtNodeInfo info) { List<String> isoFileList = new ArrayList<String>(); File[] filterOvirtFiles = filterOvirtFiles(directory, getIsoPattern(info)); for (File file : filterOvirtFiles) { isoFileList.add(file.getName()); } return isoFileList; }
Source:
private void handleDisconnected() { removeAllChildren(); setTargetNodeState(TargetNodeState.DISCONNECTED); fService = null; }

Target:
private void handleDisconnected() { fService = null; setTargetNodeState(TargetNodeState.DISCONNECTED); removeAllChildren(); }