auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void displayCardAnswer() { Timber.d("displayCardAnswer()"); crashWebViewRenderer(); if (mCurrentCard == null) { return; } if (typeAnswer()) { InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(mAnswerField.getWindowToken(), 0); } sDisplayAnswer = true; String answer = mCurrentCard.a(); mSoundPlayer.stopSounds(); answer = getCol().getMedia().escapeImages(answer); mAnswerField.setVisibility(View.GONE); String userAnswer; if (mUseInputTag) { userAnswer = cleanTypedAnswer(mTypeInput); } else { userAnswer = cleanTypedAnswer(mAnswerField.getText().toString()); } String correctAnswer = cleanCorrectAnswer(mTypeCorrect); Timber.d("correct answer = %s", correctAnswer); Timber.d("user answer = %s", userAnswer); answer = typeAnsAnswerFilter(answer, userAnswer, correctAnswer); mIsSelecting = false; updateCard(enrichWithQADiv(answer, true)); showEaseButtons(); if (mUseTimer) { long delay = mWaitQuestionSecond * 1000 + mUseTimerDynamicMS; if (delay > 0) { mTimeoutHandler.removeCallbacks(mShowQuestionTask); mTimeoutHandler.postDelayed(mShowQuestionTask, delay); } } }

Target:
protected void displayCardAnswer() { Timber.d("displayCardAnswer()"); if (mCurrentCard == null) { return; } if (typeAnswer()) { InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(mAnswerField.getWindowToken(), 0); } sDisplayAnswer = true; String answer = mCurrentCard.a(); mSoundPlayer.stopSounds(); answer = getCol().getMedia().escapeImages(answer); mAnswerField.setVisibility(View.GONE); String userAnswer; if (mUseInputTag) { userAnswer = cleanTypedAnswer(mTypeInput); } else { userAnswer = cleanTypedAnswer(mAnswerField.getText().toString()); } String correctAnswer = cleanCorrectAnswer(mTypeCorrect); Timber.d("correct answer = %s", correctAnswer); Timber.d("user answer = %s", userAnswer); answer = typeAnsAnswerFilter(answer, userAnswer, correctAnswer); mIsSelecting = false; updateCard(enrichWithQADiv(answer, true)); showEaseButtons(); if (mUseTimer) { long delay = mWaitQuestionSecond * 1000 + mUseTimerDynamicMS; if (delay > 0) { mTimeoutHandler.removeCallbacks(mShowQuestionTask); mTimeoutHandler.postDelayed(mShowQuestionTask, delay); } } }
Source:
public synchronized void startMigration(final String operationId, final String senderId, final String receiverId, final String dataType, final Set<LongRange> ranges, final TraceInfo traceInfo) { if (ongoingMigrations.containsKey(operationId)) { notifyFailure(operationId, "Already registered id : " + operationId); } else { ongoingMigrations.put(operationId, new MigrationInfo(senderId, receiverId, dataType)); sender.get().sendCtrlMsg(senderId, dataType, receiverId, ranges, operationId, traceInfo); } }

Target:
public synchronized void startMigration(final String operationId, final String senderId, final String receiverId, final String dataType, final Set<LongRange> ranges, final TraceInfo traceInfo) { if (ongoingMigrations.containsKey(operationId)) { LOG.log(Level.WARNING, "Failed to register migration with id {0}. Already exists", operationId); return; } if (!partitionManager.checkRanges(senderId, dataType, ranges)) { final String reason = new StringBuilder() .append("The requested ranges are not movable from ").append(senderId) .append(" of type ").append(dataType) .append(". Requested ranges: ").append(Arrays.toString(ranges.toArray())) .toString(); notifyFailure(operationId, reason); return; } ongoingMigrations.put(operationId, new Migration(senderId, receiverId, dataType)); sender.get().sendCtrlMsg(senderId, dataType, receiverId, ranges, operationId, traceInfo); }
Source:
public void check(ThrowingRunnable assertion) { try { assertion.run(); } catch (AssertionError error) { proxies.collectError(error); } catch (Exception e) { throw new RuntimeException(e); } }

Target:
public void check(ThrowingRunnable assertion) throws Exception { try { assertion.run(); } catch (AssertionError error) { proxies.collectError(error); } }
Source:
public void forceLedgerComplete(int rc, long ledgerId, BookieSocketAddress addr, Object ctx) { int bookieIndex = (Integer) ctx; if (completed) { return; } if (BKException.Code.OK != rc) { lastSeenError = rc; } receivedResponseSet.clear(bookieIndex); if (rc == BKException.Code.OK) { if (ackSet.completeBookieAndCheck(bookieIndex) && !completed) { completed = true; LOG.debug("After force on ledger updating LastAddConfirmed to ", ledgerId, currentNonDurableLastAddConfirmed); lh.lastAddConfirmed = currentNonDurableLastAddConfirmed; FutureUtils.complete(cb, null); return; } } else { LOG.warn("ForceLedger did not succeed: Ledger on {}", new Object[]{ledgerId, addr}); } if (receivedResponseSet.isEmpty()) { completed = true; FutureUtils.completeExceptionally(cb, BKException.create(lastSeenError)); } }

Target:
public void forceLedgerComplete(int rc, long ledgerId, BookieSocketAddress addr, Object ctx) { int bookieIndex = (Integer) ctx; checkState(!completed, "We are waiting for all the bookies, it is not expected an early exit"); if (errored) { return; } if (BKException.Code.OK != rc) { lastSeenError = rc; } if (rc == BKException.Code.OK) { if (ackSet.completeBookieAndCheck(bookieIndex)) { completed = true; if (LOG.isDebugEnabled()) { LOG.debug("After force on ledger updating LastAddConfirmed to ", ledgerId, currentNonDurableLastAddConfirmed); } lh.updateLastConfirmed(currentNonDurableLastAddConfirmed, lh.getLength()); FutureUtils.complete(cb, null); } } else { LOG.info("ForceLedger did not succeed: Ledger on {}", ledgerId, addr); errored = true; FutureUtils.completeExceptionally(cb, BKException.create(lastSeenError)); } }
Source:
public void delete() { if (this.configurableComponent.isFactoryComponent()) { EntryClassUi.showWaitModal(); this.gwtXSRFService.generateSecurityToken(new AsyncCallback<GwtXSRFToken>() { @Override public void onFailure(Throwable ex) { EntryClassUi.hideWaitModal(); FailureHandler.handle(ex); } @Override public void onSuccess(GwtXSRFToken token) { ServicesUi.this.gwtComponentService.deleteFactoryConfiguration(token, ServicesUi.this.configurableComponent.getComponentId(), true, new AsyncCallback<Void>() { @Override public void onFailure(Throwable caught) { EntryClassUi.hideWaitModal(); errorLogger.log(Level.SEVERE, caught.getLocalizedMessage()); } @Override public void onSuccess(Void result) { ServicesUi.this.deleteModal.hide(); ServicesUi.this.apply.setEnabled(false); ServicesUi.this.reset.setEnabled(false); setDirty(false); ServicesUi.this.entryClass.fetchAvailableServices(null); EntryClassUi.hideWaitModal(); Window.Location.reload(); } }); } }); } }

Target:
public void delete() { if (this.configurableComponent.isFactoryComponent()) { EntryClassUi.showWaitModal(); this.gwtXSRFService.generateSecurityToken(new AsyncCallback<GwtXSRFToken>() { @Override public void onFailure(Throwable ex) { EntryClassUi.hideWaitModal(); FailureHandler.handle(ex); } @Override public void onSuccess(GwtXSRFToken token) { ServicesUi.this.gwtComponentService.deleteFactoryConfiguration(token, ServicesUi.this.configurableComponent.getComponentId(), true, new AsyncCallback<Void>() { @Override public void onFailure(Throwable caught) { EntryClassUi.hideWaitModal(); errorLogger.log(Level.SEVERE, caught.getLocalizedMessage()); } @Override public void onSuccess(Void result) { Window.Location.reload(); } }); } }); } }
Source:
private ResponseEntity postEventInternal(final String eventTypeName, final String eventsAsString, final NativeWebRequest nativeWebRequest, final EventTypeMetrics eventTypeMetrics, final Client client) { final long startingNanos = System.nanoTime(); try { final JSONArray eventsAsJsonObjects = new JSONArray(eventsAsString); final int eventCount = eventsAsJsonObjects.length(); eventTypeMetrics.reportSizing(eventCount, eventsAsString.getBytes(Charsets.UTF_8).length); return response(publisher.publish(eventsAsJsonObjects, eventTypeName, client)); } catch (final JSONException e) { LOG.debug("Problem parsing event", e); return processJSONException(e, nativeWebRequest); } catch (final NoSuchEventTypeException e) { LOG.debug("Event type not found.", e); return create(e.asProblem(), nativeWebRequest); } catch (final NakadiException e) { LOG.debug("Failed to publish batch", e); return create(e.asProblem(), nativeWebRequest); } finally { eventTypeMetrics.updateTiming(startingNanos, System.nanoTime()); } }

Target:
private ResponseEntity postEventInternal(final String eventTypeName, final String eventsAsString, final NativeWebRequest nativeWebRequest, final EventTypeMetrics eventTypeMetrics, final Client client) { final long startingNanos = System.nanoTime(); try { final JSONArray eventsAsJsonObjects = new JSONArray(eventsAsString); final int eventCount = eventsAsJsonObjects.length(); final EventPublishResult result = publisher.publish(eventsAsJsonObjects, eventTypeName, client); reportMetrics(eventTypeMetrics, result, eventsAsString, eventCount); final ResponseEntity response = response(result); return response; } catch (final JSONException e) { LOG.debug("Problem parsing event", e); return processJSONException(e, nativeWebRequest); } catch (final NoSuchEventTypeException e) { LOG.debug("Event type not found.", e); return create(e.asProblem(), nativeWebRequest); } catch (final NakadiException e) { LOG.debug("Failed to publish batch", e); return create(e.asProblem(), nativeWebRequest); } finally { eventTypeMetrics.updateTiming(startingNanos, System.nanoTime()); } }
Source:
public XmlUserManager(final Props props) { this.xmlPath = props.getString(XML_FILE_PARAM); parseXMLFile(); Runnable runnable = () -> { WatchService watchService; Path path; try { watchService = FileSystems.getDefault().newWatchService(); final File file = new File(this.xmlPath); final String dirPath = file.getParent(); path = Paths.get(dirPath); path.register(watchService, StandardWatchEventKinds.ENTRY_MODIFY, StandardWatchEventKinds.ENTRY_CREATE); } catch (IOException e) { logger.warn("IOException while setting up watch on conf" + e.getMessage()); return; } for (;;) { WatchKey watchKey; try { watchKey = watchService.take(); } catch (InterruptedException ie) { logger.warn(ie.getMessage()); return; } for (WatchEvent<?> event : watchKey.pollEvents()) { @SuppressWarnings("unchecked") final Path name = ((WatchEvent<Path>)event).context(); final Path child = path.resolve(name); if (!child.toString().equals(this.xmlPath)) { continue; } logger.info("Modification detected, reloading user config"); parseXMLFile(); } watchKey.reset(); } }; final Thread thread = new Thread(runnable); System.out.println("Starting thread"); thread.start(); }

Target:
public XmlUserManager(final Props props) { this.xmlPath = props.getString(XML_FILE_PARAM); parseXMLFile(); Map<String, ParseConfigFile> parseConfigFileMap = new HashMap<>(); parseConfigFileMap.put(this.xmlPath, this::parseXMLFile); UserUtils.setupWatch(parseConfigFileMap); }
Source:
public void testMinGapIsEnforcedForASyncChecks() throws Exception { final List<FsVolumeSpi> volumes = TestDatasetVolumeChecker.makeVolumes(1, VolumeCheckResult.HEALTHY); final FsDatasetSpi<FsVolumeSpi> dataset = TestDatasetVolumeChecker.makeDataset(volumes); final FakeTimer timer = new FakeTimer(); final Configuration conf = new HdfsConfiguration(); final long minGapMs = 100; conf.setTimeDuration(DFSConfigKeys.DFS_DATANODE_DISK_CHECK_MIN_GAP_KEY, minGapMs, TimeUnit.MILLISECONDS); final DatasetVolumeChecker checker = new DatasetVolumeChecker(conf, timer); checker.checkAllVolumesAsync(dataset, null); assertThat(checker.getNumAsyncDatasetChecks(), is(1L)); checker.checkAllVolumesAsync(dataset, null); assertThat(checker.getNumAsyncDatasetChecks(), is(1L)); assertThat(checker.getNumSkippedChecks(), is(1L)); timer.advance(minGapMs); checker.checkAllVolumesAsync(dataset, null); assertThat(checker.getNumAsyncDatasetChecks(), is(2L)); assertThat(checker.getNumSkippedChecks(), is(1L)); }

Target:
public void testMinGapIsEnforcedForASyncChecks() throws Exception { final List<FsVolumeSpi> volumes = TestDatasetVolumeChecker.makeVolumes(1, VolumeCheckResult.HEALTHY); final FsDatasetSpi<FsVolumeSpi> dataset = TestDatasetVolumeChecker.makeDataset(volumes); final DatasetVolumeChecker checker = new DatasetVolumeChecker(conf, timer); checker.checkAllVolumesAsync(dataset, null); assertThat(checker.getNumAsyncDatasetChecks(), is(1L)); checker.checkAllVolumesAsync(dataset, null); assertThat(checker.getNumAsyncDatasetChecks(), is(1L)); assertThat(checker.getNumSkippedChecks(), is(1L)); timer.advance(MIN_DISK_CHECK_GAP_MS); checker.checkAllVolumesAsync(dataset, null); assertThat(checker.getNumAsyncDatasetChecks(), is(2L)); assertThat(checker.getNumSkippedChecks(), is(1L)); }
Source:
private Optional<VirtualMachineCustomImage> handleCustomImageCreationException(AzureImageInfo azureImageInfo, AuthenticatedContext ac, AzureClient client, AzureManagedImageCreationCheckerContext checkerContext, CloudException originalException) { Optional<VirtualMachineCustomImage> customImage; Optional<Throwable> errorResult = azureManagedImageCreationPoller.startPolling(ac, checkerContext, false); customImage = findImage(azureImageInfo, client); if (customImage.isEmpty()) { updateImageStatus(ac, azureImageInfo.getImageNameWithRegion(), azureImageInfo.getImageId(), CommonStatus.FAILED); if (errorResult.isPresent() && !(errorResult.get() instanceof TimeoutException)) { LOGGER.error("Failed to create custom image: ", errorResult.get()); throw new CloudConnectorException(errorResult.get()); } LOGGER.error("Failed to create custom image: ", originalException); throw new CloudConnectorException(originalException); } return customImage; }

Target:
private Optional<VirtualMachineCustomImage> handleCustomImageCreationException(AzureImageInfo azureImageInfo, AuthenticatedContext ac, AzureClient client, AzureManagedImageCreationCheckerContext checkerContext, CloudException originalException) { Exception onError = originalException; try { azureManagedImageCreationPoller.startPolling(ac, checkerContext); } catch (TimeoutException e) { LOGGER.warn("Timeout during polling for image creation: ", e); } catch (Exception e) { LOGGER.warn("Exception during polling for image creation: ", e); onError = e; } finally { Optional<VirtualMachineCustomImage> customImage; customImage = findImage(azureImageInfo, client); if (customImage.isEmpty()) { updateImageStatus(ac, azureImageInfo.getImageNameWithRegion(), azureImageInfo.getImageId(), CommonStatus.FAILED); LOGGER.error("Failed to create custom image, throwing: ", onError); throw new CloudConnectorException(onError); } return customImage; } }
Source:
public static void main(String[] args) { try { JNISetup.setupJNI(); } catch (NoSuchFieldException e1) { e1.printStackTrace(); } catch (SecurityException e1) { e1.printStackTrace(); } catch (IllegalArgumentException e1) { e1.printStackTrace(); } catch (IllegalAccessException e1) { e1.printStackTrace(); } List<String> ports = getAvailablePorts(); System.out.println(ports); Robot.getInstance(); Gui.getInstance(); if (RobobuggyConfigFile.DATA_PLAY_BACK) { final SensorPlayer sp = new SensorPlayer("logs/sensor.txt"); new Thread(new Runnable() { @Override public void run() { sp.run(); } }).start(); } else { Robot.getInstance().startNodes(); try { Thread.sleep(3000); } catch (InterruptedException e) { e.printStackTrace(); } new RobobuggyLogicNotification("Robobuggy Logic Notfication started", RobobuggyMessageLevel.NOTE); } }

Target:
public static void main(String[] args) { try { JNISetup.setupJNI(); } catch (NoSuchFieldException e1) { e1.printStackTrace(); } catch (SecurityException e1) { e1.printStackTrace(); } catch (IllegalArgumentException e1) { e1.printStackTrace(); } catch (IllegalAccessException e1) { e1.printStackTrace(); } List<String> ports = getAvailablePorts(); System.out.println(ports); Robot.getInstance(); Gui.getInstance(); if (RobobuggyConfigFile.DATA_PLAY_BACK) { final SensorPlayer sp = new SensorPlayer("logs/sensors_2016-02-05-20-03-47.txt"); new Thread(new Runnable() { @Override public void run() { sp.run(); } }).start(); } else { Robot.getInstance().startNodes(); try { Thread.sleep(3000); } catch (InterruptedException e) { e.printStackTrace(); } new RobobuggyLogicNotification("Robobuggy Logic Notfication started", RobobuggyMessageLevel.NOTE); } }
Source:
public Comparator<DoublesSketch> getComparator() { return new Comparator<DoublesSketch>() { @Override public int compare(final DoublesSketch a, final DoublesSketch b) { return Long.compare(a.getN(), b.getN()); } }; }

Target:
public Comparator<DoublesSketch> getComparator() { return DoublesSketchAggregatorFactory.COMPARATOR; }
Source:
protected void setup(Binder binder) { newSetBinder(binder, Filter.class, TheServlet.class).addBinding() .to(AuthenticationFilter.class).in(Scopes.SINGLETON); List<AuthenticationType> authTypes = buildConfigObject(SecurityConfig.class).getAuthenticationTypes(); MapBinder<AuthenticationType, Authenticator> authBinder = newMapBinder(binder, AuthenticationType.class, Authenticator.class); if (authTypes.contains(CERTIFICATE)) { authBinder.addBinding(CERTIFICATE).to(CertificateAuthenticator.class).in(Scopes.SINGLETON); } if (authTypes.contains(KERBEROS)) { configBinder(binder).bindConfig(KerberosConfig.class); authBinder.addBinding(KERBEROS).to(KerberosAuthenticator.class).in(Scopes.SINGLETON); } if (authTypes.contains(LDAP)) { configBinder(binder).bindConfig(LdapConfig.class); authBinder.addBinding(LDAP).to(LdapAuthenticator.class).in(Scopes.SINGLETON); } binder.bind(new TypeLiteral<List<AuthenticationType>>() {}).toInstance(authTypes); }

Target:
protected void setup(Binder binder) { newSetBinder(binder, Filter.class, TheServlet.class).addBinding() .to(AuthenticationFilter.class).in(Scopes.SINGLETON); List<AuthenticationType> authTypes = buildConfigObject(SecurityConfig.class).getAuthenticationTypes(); Multibinder<Authenticator> authBinder = newSetBinder(binder, Authenticator.class); for (AuthenticationType authType : authTypes) { if (authType == CERTIFICATE) { authBinder.addBinding().to(CertificateAuthenticator.class).in(Scopes.SINGLETON); } if (authType == KERBEROS) { configBinder(binder).bindConfig(KerberosConfig.class); authBinder.addBinding().to(KerberosAuthenticator.class).in(Scopes.SINGLETON); } if (authType == LDAP) { configBinder(binder).bindConfig(LdapConfig.class); authBinder.addBinding().to(LdapAuthenticator.class).in(Scopes.SINGLETON); } } }
Source:
void assertChildrenIntegrity(AbstractHistoryTree<E, N> tree, N node) { try { if (node.getNbChildren() > 0) { N childNode = tree.getNode(node.getChild(0)); assertEquals("Equals start time of parent " + node.getSequenceNumber() + " and first child " + childNode.getSequenceNumber(), node.getNodeStart(), childNode.getNodeStart()); if (node.isOnDisk()) { childNode = tree.getNode(node.getLatestChild()); assertEquals("Equals end time of parent " + node.getSequenceNumber() + " and last child " + childNode.getSequenceNumber(), node.getNodeEnd(), childNode.getNodeEnd()); } } for (int i = 0; i < node.getNbChildren(); i++) { N childNode = tree.getNode(node.getChild(i)); assertTrue("Child at index " + i + " of parent " + node.getSequenceNumber() + " has valid start time", node.getNodeStart() <= childNode.getNodeStart()); if (node.isOnDisk() && childNode.isOnDisk()) { assertTrue("Child at index " + i + " of parent " + node.getSequenceNumber() + " has valid end time", childNode.getNodeEnd() <= node.getNodeEnd()); } assertTrue(tree.verifyChildrenSpecific(node, i, childNode)); assertTrue(tree.verifyIntersectingChildren(node, childNode)); } } catch (ClosedChannelException e) { fail(e.getMessage()); } }

Target:
void assertChildrenIntegrity(AbstractHistoryTree<E, N> tree, N node) { try { if (node.getNbChildren() > 0) { N childNode = tree.getNode(node.getChild(0)); assertEquals("Equals start time of parent " + node.getSequenceNumber() + " and first child " + childNode.getSequenceNumber(), node.getNodeStart(), childNode.getNodeStart()); if (node.isOnDisk()) { childNode = tree.getNode(node.getLatestChild()); assertEquals("Equals end time of parent " + node.getSequenceNumber() + " and last child " + childNode.getSequenceNumber(), node.getNodeEnd(), childNode.getNodeEnd()); } } for (int i = 0; i < node.getNbChildren(); i++) { N childNode = tree.getNode(node.getChild(i)); assertTrue("Child at index " + i + " of parent " + node.getSequenceNumber() + " has valid start time", node.getNodeStart() <= childNode.getNodeStart()); if (node.isOnDisk() && childNode.isOnDisk()) { assertTrue("Child at index " + i + " of parent " + node.getSequenceNumber() + " has valid end time", childNode.getNodeEnd() <= node.getNodeEnd()); } assertTrue("Child at index " + i + " of parent " + node.getSequenceNumber() + " specific children", tree.verifyChildrenSpecific(node, i, childNode)); assertTrue("Child at index " + i + " of parent " + node.getSequenceNumber() + " intersecting children", tree.verifyIntersectingChildren(node, childNode)); } } catch (ClosedChannelException e) { fail(e.getMessage()); } }
Source:
public double getSystemWideCpuUsage() { try { if (operatingSystemMXBean != null) { return operatingSystemMXBean.getSystemCpuLoad(); } return Double.NaN; } catch (Throwable t) { logger.error("Failed to get System CPU", t); return Double.NaN; } }

Target:
public double getSystemWideCpuUsage() { try { if (operatingSystemMXBean != null) { double val = operatingSystemMXBean.getSystemCpuLoad(); if (val > 0) { return val; } } return Double.NaN; } catch (Throwable t) { logger.error("Failed to get System CPU", t); return Double.NaN; } }
Source:
public MethodConstraintMappingContext method(String name, Class<?>... parameterTypes) { Contracts.assertNotNull( name, MESSAGES.methodNameMustNotBeNull() ); Method method = run( GetDeclaredMethod.action( beanClass, name, parameterTypes ) ); if ( method == null || method.getDeclaringClass() != beanClass ) { throw LOG.getBeanDoesNotContainMethodException( beanClass, name, Arrays.asList( parameterTypes ) ); } Callable callable = JavaBeanExecutable.of( method ); if ( configuredMembers.contains( callable ) ) { throw LOG.getMethodHasAlreadyBeConfiguredViaProgrammaticApiException( beanClass, ExecutableHelper.getExecutableAsString( name, parameterTypes ) ); } MethodConstraintMappingContextImpl context = new MethodConstraintMappingContextImpl( this, callable ); configuredMembers.add( callable ); executableContexts.add( context ); return context; }

Target:
public MethodConstraintMappingContext method(String name, Class<?>... parameterTypes) { Contracts.assertNotNull( name, MESSAGES.methodNameMustNotBeNull() ); Optional<Callable> method = javaBean.getCallableByNameAndParameters( name, parameterTypes ); if ( !method.isPresent() || method.get().getDeclaringClass() != beanClass ) { throw LOG.getBeanDoesNotContainMethodException( javaBean, name, parameterTypes ); } Callable callable = method.get(); if ( configuredMembers.contains( callable ) ) { throw LOG.getMethodHasAlreadyBeenConfiguredViaProgrammaticApiException( beanClass, ExecutableHelper.getExecutableAsString( name, parameterTypes ) ); } MethodConstraintMappingContextImpl context = new MethodConstraintMappingContextImpl( this, callable ); configuredMembers.add( callable ); executableContexts.add( context ); return context; }
Source:
public void connectSensors() { super.connectSensors(); ConfigToAttributes.apply(this); String accessibleRootUrl = inferUrl(true); httpFeed = HttpFeed.builder() .entity(this) .period(getConfig(HTTP_POLL_PERIOD)) .baseUri(accessibleRootUrl) .baseUriVars(ImmutableMap.of("include-runtime", "true")) .poll(new HttpPollConfig<Boolean>(NGINX_URL_ANSWERS_NICELY) .checkSuccess(Predicates.alwaysTrue()) .onResult(new Function<HttpToolResponse, Boolean>() { @Override public Boolean apply(HttpToolResponse input) { List<String> actual = input.getHeaderLists().get("Server"); return actual != null && actual.size() == 1; }}) .setOnException(false)) .build(); addEnricher(Enrichers.builder().updatingMap(Attributes.SERVICE_NOT_UP_INDICATORS) .from(NGINX_URL_ANSWERS_NICELY) .computing(Functionals.ifNotEquals(true).value("URL where nginx listens is not answering correctly") ) .build()); connectServiceUpIsRunning(); Group urlMappings = getConfig(URL_MAPPINGS); if (urlMappings != null) { subscribeToMembers(urlMappings, UrlMapping.TARGET_ADDRESSES, new SensorEventListener<Collection<String>>() { @Override public void onEvent(SensorEvent<Collection<String>> event) { updateNeeded(); } }); urlMappingsMemberTrackerPolicy = addPolicy(PolicySpec.create(UrlMappingsMemberTrackerPolicy.class) .configure("group", urlMappings)); } }

Target:
public void connectSensors() { super.connectSensors(); ConfigToAttributes.apply(this); String accessibleRootUrl = inferUrl(true); httpFeed = HttpFeed.builder() .entity(this) .period(getConfig(HTTP_POLL_PERIOD)) .baseUri(accessibleRootUrl) .baseUriVars(ImmutableMap.of("include-runtime", "true")) .poll(new HttpPollConfig<Boolean>(NGINX_URL_ANSWERS_NICELY) .checkSuccess(Predicates.alwaysTrue()) .onResult(new Function<HttpToolResponse, Boolean>() { @Override public Boolean apply(HttpToolResponse input) { List<String> actual = input.getHeaderLists().get("Server"); return actual != null && actual.size() == 1; }}) .setOnException(false)) .build(); addEnricher(Enrichers.builder().updatingMap(Attributes.SERVICE_NOT_UP_INDICATORS) .from(NGINX_URL_ANSWERS_NICELY) .computing(Functionals.ifNotEquals(true).value("URL where nginx listens is not answering correctly (with expected header)") ) .build()); connectServiceUpIsRunning(); Group urlMappings = getConfig(URL_MAPPINGS); if (urlMappings != null) { subscribeToMembers(urlMappings, UrlMapping.TARGET_ADDRESSES, new SensorEventListener<Collection<String>>() { @Override public void onEvent(SensorEvent<Collection<String>> event) { updateNeeded(); } }); urlMappingsMemberTrackerPolicy = addPolicy(PolicySpec.create(UrlMappingsMemberTrackerPolicy.class) .configure("group", urlMappings)); } }
Source:
private void setOverlayPlayPauseImage() { boolean playing = player != null && player.getPlayer().getPlayWhenReady(); int attr = playing ? R.attr.pause : R.attr.play; overlayPlayPauseButton.setImageResource(ThemeHelper.resolveResourceIdFromAttr(activity, attr)); }

Target:
private void setOverlayPlayPauseImage() { final int attr = player != null && player.isPlaying() ? R.attr.ic_pause : R.attr.ic_play_arrow; overlayPlayPauseButton.setImageResource( ThemeHelper.resolveResourceIdFromAttr(activity, attr)); }
Source:
public JSONObject changeLibraryIdBarcode(HttpSession session, JSONObject json) { Long libraryId = json.getLong("libraryId"); String idBarcode = json.getString("identificationBarcode"); try { if (!"".equals(idBarcode)) { Library library = requestManager.getLibraryById(libraryId); library.setIdentificationBarcode(idBarcode); requestManager.saveLibrary(library); } else { return JSONUtils.SimpleJSONError("New identification barcode not recognized"); } } catch (IOException e) { e.printStackTrace(); return JSONUtils.SimpleJSONError(e.getMessage()); } return JSONUtils.SimpleJSONResponse("New identification barcode successfully assigned."); }

Target:
public JSONObject changeLibraryIdBarcode(HttpSession session, JSONObject json) { Long libraryId = json.getLong("libraryId"); String idBarcode = json.getString("identificationBarcode"); try { if (!isStringEmptyOrNull(idBarcode)) { Library library = requestManager.getLibraryById(libraryId); library.setIdentificationBarcode(idBarcode); requestManager.saveLibrary(library); } else { return JSONUtils.SimpleJSONError("New identification barcode not recognized"); } } catch (IOException e) { log.debug("Could not change Library identificationBarcode: " + e.getMessage()); e.printStackTrace(); return JSONUtils.SimpleJSONError(e.getMessage()); } return JSONUtils.SimpleJSONResponse("New identification barcode successfully assigned."); }
Source:
public StreamExecLimit( long limitStart, long limitEnd, boolean generateUpdateBefore, boolean insertOnly, ExecEdge inputEdge, LogicalType outputType, String description) { super( RankType.ROW_NUMBER, getRankStrategy(insertOnly), new ConstantRankRange(limitStart + 1, limitEnd), generateUpdateBefore, false, new int[0], new int[0], new boolean[0], new boolean[0], inputEdge, outputType, description); }

Target:
public StreamExecLimit( long limitStart, long limitEnd, boolean generateUpdateBefore, boolean insertOnly, ExecEdge inputEdge, LogicalType outputType, String description) { super( RankType.ROW_NUMBER, getRankStrategy(insertOnly), new ConstantRankRange(limitStart + 1, limitEnd), generateUpdateBefore, false, new int[0], new int[0], new boolean[0], new boolean[0], inputEdge, outputType, description); this.limitEnd = limitEnd; }
Source:
private Artifact resolveJLine(final VersionNumber scalaVersion, final Artifact defaultFallback) throws Exception { final Artifact compilerArtifact = super.scalaCompilerArtifact(scalaVersion.toString()); final Set<Artifact> compilerDeps = super.resolveArtifactDependencies(compilerArtifact); for (final Artifact a : compilerDeps) { super.getLog().warn(a.toString()); if (this.filterForJline(a)) { return a; } else { continue; } } super.getLog().warn("Unable to determine the required Jline dependency from the POM. Falling back to hard-coded defaults."); super.getLog().warn("If you get an InvocationTargetException, then this probably means we guessed the wrong version for JLine"); super.getLog().warn(String.format("Guessed JLine: %s", defaultFallback.toString())); return defaultFallback; }

Target:
private Artifact resolveJLine(final VersionNumber scalaVersion, final Artifact defaultFallback) throws Exception { final Artifact compilerArtifact = super.scalaCompilerArtifact(scalaVersion.toString()); final Set<Artifact> compilerDeps = super.resolveArtifactDependencies(compilerArtifact); for (final Artifact a : compilerDeps) { super.getLog().warn(a.toString()); if (this.filterForJline(a)) { return a; } } super.getLog().warn("Unable to determine the required Jline dependency from the POM. Falling back to hard-coded defaults."); super.getLog().warn("If you get an InvocationTargetException, then this probably means we guessed the wrong version for JLine"); super.getLog().warn(String.format("Guessed JLine: %s", defaultFallback.toString())); return defaultFallback; }
Source:
protected int delete(String urlS) throws IOException { URL url = new URL(urlS); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(true); conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded" ); conn.setRequestProperty("Authorization", "key=" + variant.getGoogleKey()); conn.setRequestMethod("DELETE"); conn.connect(); return conn.getResponseCode(); }

Target:
private int delete(String urlS) throws IOException { URL url = new URL(urlS); HttpURLConnection conn = prepareAuthorizedConnection(url); conn.setRequestMethod("DELETE"); conn.connect(); return conn.getResponseCode(); }
Source:
public JobProcessResult waitFor() throws InterruptedException { if (!launched.get()) { throw new IllegalStateException("Process not launched"); } final Process process = processReference.get(); int exitCode = 0; if (process != null) { exitCode = process.waitFor(); UserConsole.getLogger().info("Job process terminated with exit code: {}", exitCode); } try { Thread.sleep(100); } catch (final InterruptedException e) { } if (killed.get()) { return new JobProcessResult.Builder(JobStatus.KILLED, JobStatusMessages.JOB_KILLED_BY_USER).build(); } else if (exitCode == SUCCESS_EXIT_CODE) { return new JobProcessResult.Builder( JobStatus.SUCCEEDED, JobStatusMessages.JOB_FINISHED_SUCCESSFULLY ).build(); } else { return new JobProcessResult.Builder(JobStatus.FAILED, JobStatusMessages.JOB_FAILED).build(); } }

Target:
public JobProcessResult waitFor() throws InterruptedException { if (!this.launched.get()) { throw new IllegalStateException("Process not launched"); } final Process process = this.processReference.get(); int exitCode = 0; if (process != null) { exitCode = process.waitFor(); UserConsole.getLogger().info("Job process terminated with exit code: {}", exitCode); } try { Thread.sleep(100); } catch (final InterruptedException e) { } final ScheduledFuture timeoutThreadFuture = this.timeoutKillThread.get(); if (timeoutThreadFuture != null) { timeoutThreadFuture.cancel(true); } if (this.killed.get()) { final KillService.KillSource source = this.killSource.get() != null ? this.killSource.get() : KillService.KillSource.API_KILL_REQUEST; switch (source) { case TIMEOUT: return new JobProcessResult .Builder(JobStatus.KILLED, JobStatusMessages.JOB_EXCEEDED_TIMEOUT, exitCode) .build(); case API_KILL_REQUEST: case SYSTEM_SIGNAL: default: return new JobProcessResult .Builder(JobStatus.KILLED, JobStatusMessages.JOB_KILLED_BY_USER, exitCode) .build(); } } else if (exitCode == SUCCESS_EXIT_CODE) { return new JobProcessResult.Builder( JobStatus.SUCCEEDED, JobStatusMessages.JOB_FINISHED_SUCCESSFULLY, exitCode ).build(); } else { return new JobProcessResult.Builder(JobStatus.FAILED, JobStatusMessages.JOB_FAILED, exitCode).build(); } }
Source:
public void updateConfig(EntityConfigUpdateCommand command, Username currentUser) { LOGGER.info("Config update for entity request by is in queue - {}", currentUser, command); synchronized (GoConfigWriteLock.class) { try { LOGGER.info("Config update for entity request by is being processed", currentUser); if (!command.canContinue(cachedConfigService.currentConfig()) || !command.isUserAuthorized()) { throw new ConfigUpdateCheckFailedException(); } cachedConfigService.writeEntityWithLock(command, currentUser); } catch (Exception e) { LOGGER.error("Config update for entity failed", e); throw e; } finally { LOGGER.info("Entity update for request by is completed", currentUser); } } }

Target:
public void updateConfig(EntityConfigUpdateCommand command, Username currentUser) { LOGGER.info("Config update for entity request by is in queue - {}", currentUser, command); synchronized (GoConfigWriteLock.class) { try { LOGGER.info("Config update for entity request by is being processed", currentUser); if (!command.isUserAuthorized() || !command.canContinue(cachedConfigService.currentConfig())) { throw new ConfigUpdateCheckFailedException(); } cachedConfigService.writeEntityWithLock(command, currentUser); } catch (Exception e) { LOGGER.error("Config update for entity failed", e); throw e; } finally { LOGGER.info("Entity update for request by is completed", currentUser); } } }
Source:
public int processLineContent(String line, int offset) { String key = matcher.group(1); if (key.endsWith("!")) { key = key.substring(0, key.length() - 1).trim(); ((AsciiDocContentState) getState()).removeAttribute(key); } else { String value = matcher.group(2).trim(); key = key.trim(); ((AsciiDocContentState) getState()).putAttribute(key, value); } setClosed(true); return -1; }

Target:
public int processLineContent(String line, int offset) { if (key.endsWith("!")) { key = key.substring(0, key.length() - 1).trim(); ((AsciiDocContentState) getState()).removeAttribute(key); } else { String newKey = key.trim(); String newValue = (value == null) ? "" : value.trim(); ((AsciiDocContentState) getState()).putAttribute(newKey, newValue); } setClosed(true); return -1; }
Source:
public final B withMinTermMatch(int minTermMatch) { if (minTermMatch > 0) { optionsBuilder.put(OptionKey.MIN_TERM_MATCH, minTermMatch); } return getSelf(); }

Target:
public final B withMinTermMatch(int minTermMatch) { if (minTermMatch <= 0) { throw new BadRequestException("Min number of terms to match should be greater than 0. It was: '%s'.", minTermMatch); } optionsBuilder.put(OptionKey.MIN_TERM_MATCH, minTermMatch); return getSelf(); }
Source:
private void doUpdateTimeZone(final String selectedTimeZone) { TimeZoneModel.withLoadedTimeZones(getTimeZoneType(), new Runnable() { @Override public void run() { final Iterable<TimeZoneModel> timeZones = TimeZoneModel.getTimeZones(getTimeZoneType()); getModel().getTimeZone().setItems(timeZones); getModel().getTimeZone().setSelectedItem(Linq.firstOrDefault(timeZones, new Linq.TimeZonePredicate(selectedTimeZone))); if (getModel().getIsLinuxOS()) { getModel().getTimeZone().setIsChangable(false); getModel().getTimeZone().setTitle(constants.timeZoneNotEditableForLinuxVms()); } else { getModel().getTimeZone().setIsChangable(true); getModel().getTimeZone().setTitle(""); } } }); }

Target:
private void doUpdateTimeZone(final String selectedTimeZone) { TimeZoneModel.withLoadedTimeZones(getTimeZoneType(), new Runnable() { @Override public void run() { final Iterable<TimeZoneModel> timeZones = TimeZoneModel.getTimeZones(getTimeZoneType()); getModel().getTimeZone().setItems(timeZones); getModel().getTimeZone().setSelectedItem(Linq.firstOrDefault(timeZones, new Linq.TimeZonePredicate(selectedTimeZone))); getModel().getTimeZone().setIsChangable(!getModel().getIsLinuxOS()); getModel().getTimeZone().setTitle(getModel().getIsLinuxOS() ? constants.timeZoneNotChangeableForLinuxVms() : ""); } }); }
Source:
public int assignedTaskCount() { return assignedTasks().size(); }

Target:
public int assignedTaskCount() { return activeTaskCount() + standbyTaskCount(); }
Source:
private synchronized void removeServer(ServerInformation serverInformation, boolean externalize) { final List<ServerInformation> userServers = _userPreferences.getUserServers(); if (userServers.remove(serverInformation)) { for (ServerInformationChangeListener listener : _listeners) { listener.onRemove(serverInformation); } } if (externalize) { _configurationWriter.removeServerInformation(serverInformation.getName()); _userPreferences.save(); } }

Target:
private synchronized void removeServer(ServerInformation serverInformation, boolean externalize) { if (_updatedServerInformationList.remove(serverInformation)) { for (ServerInformationChangeListener listener : _listeners) { listener.onRemove(serverInformation); } } if (externalize) { _configurationWriter.removeServerInformation(serverInformation.getName()); } }
Source:
public ServerToServerWithExternalIp(DimensionDataCloudControlApi api) { this.api = checkNotNull(api, "api"); }

Target:
ServerToServerWithExternalIp(DimensionDataCloudControlApi api) { this.api = checkNotNull(api, "api"); }
Source:
public void populateDAG(DAG dag, Configuration configuration) { FileSplitterInput fileSplitter = dag.addOperator("FileSplitter", createFileSplitter()); FSRecordReader recordReader = dag.addOperator("BlockReader", createBlockReader()); dag.addStream("BlockMetadata", fileSplitter.blocksMetadataOutput, recordReader.blocksMetadataInput); if (sequentialFileRead) { dag.setInputPortAttribute(recordReader.blocksMetadataInput, Context.PortContext.STREAM_CODEC, new SequentialFileBlockMetadataCodec()); } FileSplitterInput.TimeBasedDirectoryScanner fileScanner = fileSplitter.getScanner(); fileScanner.setFiles(files); if (scanIntervalMillis != 0) { fileScanner.setScanIntervalMillis(scanIntervalMillis); } fileScanner.setRecursive(recursive); if (filePatternRegularExp != null) { fileSplitter.getScanner().setFilePatternRegularExp(filePatternRegularExp); } recordReader.setBasePath(files); if (readersCount != 0) { dag.setAttribute(recordReader, Context.OperatorContext.PARTITIONER, new StatelessPartitioner<FSSliceReader>(readersCount)); } fileSplitter.setBlocksThreshold(blocksThreshold); records.set(recordReader.records); }

Target:
public void populateDAG(DAG dag, Configuration configuration) { FileSplitterInput fileSplitter = dag.addOperator("FileSplitter", createFileSplitter()); FSRecordReader recordReader = dag.addOperator("BlockReader", createRecordReader()); dag.addStream("BlockMetadata", fileSplitter.blocksMetadataOutput, recordReader.blocksMetadataInput); if (sequentialFileRead) { dag.setInputPortAttribute(recordReader.blocksMetadataInput, Context.PortContext.STREAM_CODEC, new SequentialFileBlockMetadataCodec()); } FileSplitterInput.TimeBasedDirectoryScanner fileScanner = fileSplitter.getScanner(); fileScanner.setFiles(files); if (scanIntervalMillis != 0) { fileScanner.setScanIntervalMillis(scanIntervalMillis); } fileScanner.setRecursive(recursive); if (filePatternRegularExp != null) { fileSplitter.getScanner().setFilePatternRegularExp(filePatternRegularExp); } recordReader.setBasePath(files); if (readersCount != 0) { dag.setAttribute(recordReader, Context.OperatorContext.PARTITIONER, new StatelessPartitioner<FSSliceReader>(readersCount)); } fileSplitter.setBlocksThreshold(blocksThreshold); records.set(recordReader.records); }
Source:
public ArrayList<VDSDomainsData> getDomains() { return privateDomains; }

Target:
public ArrayList<VDSDomainsData> getDomains() { return domains; }
Source:
public void checkFactoryAcceptingWithSincePolicy() throws Exception { dashboard.open(); testFactory.open(seleniumWebDriver); seleniumWebDriver.switchFromDashboardIframeToIde(); if (System.currentTimeMillis() > initTime + ADDITIONAL_TIME) { Assert.fail( "Factory started longer then additional time and next test steps does not make sense"); } warningDialog.waitWaitWarnDialogWindowWithSpecifiedTextMess(EXPIRE_MESSAGE); while (System.currentTimeMillis() <= initTime + ADDITIONAL_TIME + 10000) { WaitUtils.sleepQuietly(1); } testFactory.open(seleniumWebDriver); seleniumWebDriver.switchFromDashboardIframeToIde(); projectExplorer.waitProjectExplorer(); warningDialog.waitWaitClosingWarnDialogWindow(); }

Target:
public void checkFactoryAcceptingWithSincePolicy() throws Exception { dashboard.open(); testFactory.open(seleniumWebDriver); seleniumWebDriver.switchFromDashboardIframeToIde(); if (System.currentTimeMillis() > initTime + FACTORY_INACTIVITY_TIME) { Assert.fail( "Factory started longer then additional time and next test steps does not make sense"); } warningDialog.waitWaitWarnDialogWindowWithSpecifiedTextMess(EXPIRE_MESSAGE); while (System.currentTimeMillis() <= initTime + FACTORY_INACTIVITY_TIME + ADDITIONAL_TIME) { WaitUtils.sleepQuietly(1); } testFactory.open(seleniumWebDriver); seleniumWebDriver.switchFromDashboardIframeToIde(); projectExplorer.waitProjectExplorer(); warningDialog.waitWaitClosingWarnDialogWindow(); }
Source:
protected boolean canDoAddVmCommand() { boolean returnValue = false; returnValue = areParametersLegal(getReturnValue().getCanDoActionMessages()); returnValue = returnValue && checkNumberOfMonitors(getParameters().graphicsTypesToBeSet()) && checkSingleQxlDisplay(); returnValue = returnValue && checkPciAndIdeLimit(getParameters().getVm().getOs(), getVdsGroup().getcompatibility_version(), getParameters().getVmStaticData().getNumOfMonitors(), getVmInterfaces(), getVmDisks(), isVirtioScsiEnabled(), hasWatchdog(), isBalloonEnabled(), getParameters().isSoundDeviceEnabled(), getReturnValue().getCanDoActionMessages()) && canAddVm(getReturnValue().getCanDoActionMessages(), destStorages.values()) && hostToRunExist(); return returnValue; }

Target:
protected boolean canDoAddVmCommand() { boolean returnValue = false; returnValue = areParametersLegal(getReturnValue().getCanDoActionMessages()); returnValue = returnValue && checkNumberOfMonitors(getResultingVmGraphics()) && checkSingleQxlDisplay(); returnValue = returnValue && checkPciAndIdeLimit(getParameters().getVm().getOs(), getVdsGroup().getcompatibility_version(), getParameters().getVmStaticData().getNumOfMonitors(), getVmInterfaces(), getVmDisks(), isVirtioScsiEnabled(), hasWatchdog(), isBalloonEnabled(), getParameters().isSoundDeviceEnabled(), getReturnValue().getCanDoActionMessages()) && canAddVm(getReturnValue().getCanDoActionMessages(), destStorages.values()) && hostToRunExist(); return returnValue; }
Source:
private void playerDies() { Track.getInstance().getPlayer().die(); OBSERVABLE.notify( GameObserver.Category.PLAYER, GameObserver.Player.COLLISION, AbstractObstacle.class.getSimpleName()); sleep(SLEEP_FACTOR * InternalTicker.NANOS_PER_TICK / InternalTicker.E6); letPlayerSurvive(); sleep(LONG); }

Target:
private void playerDies() { Track.getInstance().getPlayer().die(); OBSERVABLE.notify( GameObserver.Category.PLAYER, GameObserver.Player.COLLISION, AbstractObstacle.class.getSimpleName()); sleep(SLEEP_FACTOR * InternalTicker.NANOS_PER_TICK / InternalTicker.E6); }
Source:
private void updateTreeForLanguages(ICResourceDescription rcDes) { treeLanguages.removeAll(); currentLanguageId = null; List<String> languageIds = LanguageSettingsManager.getLanguages(rcDes); if (languageIds.size() > 1) { languageIds.remove(null); } else if (languageIds.isEmpty()) { languageIds.add(null); } Map<String, List<String>> map = new TreeMap<String, List<String>>(); for (String langId : languageIds) { ILanguage language = LanguageManager.getInstance().getLanguage(langId); String langName = language != null ? language.getName() : Messages.LanguageSettingsEntriesTab_UnspecifiedLanguage; if (langName == null || langName.length() == 0) continue; List<String> langIds = map.get(langName); if (langIds == null) { langIds = new ArrayList<String>(); map.put(langName, langIds); } langIds.add(langId); } for (String langName : map.keySet()) { List<String> langIds = map.get(langName); for (String langId : langIds) { TreeItem t = new TreeItem(treeLanguages, SWT.NONE); if (langIds.size() == 1) { t.setText(0, langName); } else { StringBuilder uniqueLangName = new StringBuilder(); uniqueLangName.append(langName).append(" [") .append(langId).append("]"); t.setText(0, uniqueLangName.toString()); } t.setData(langId); if (currentLanguageIdGlobal != null && currentLanguageIdGlobal.equals(langId)) { currentLanguageId = currentLanguageIdGlobal; treeLanguages.setSelection(t); } else if (currentLanguageId == null) { currentLanguageId = langId; } } } }

Target:
private void updateTreeForLanguages(ICResourceDescription rcDes) { treeLanguages.removeAll(); currentLanguageId = null; List<String> languageIds = LanguageSettingsManager.getLanguages(rcDes); if (languageIds.size() > 1) { languageIds.remove(null); } else if (languageIds.isEmpty()) { languageIds.add(null); } Map<String, List<String>> map = new TreeMap<String, List<String>>(); for (String langId : languageIds) { ILanguage language = LanguageManager.getInstance().getLanguage(langId); String langName = language != null ? language.getName() : Messages.LanguageSettingsEntriesTab_UnspecifiedLanguage; if (langName == null || langName.length() == 0) continue; List<String> langIds = map.get(langName); if (langIds == null) { langIds = new ArrayList<String>(); map.put(langName, langIds); } langIds.add(langId); } for (String langName : map.keySet()) { List<String> langIds = map.get(langName); for (String langId : langIds) { TreeItem t = new TreeItem(treeLanguages, SWT.NONE); if (langIds.size() == 1) { t.setText(0, langName); } else { StringBuilder uniqueLangName = new StringBuilder(); uniqueLangName.append(langName).append(" [id=") .append(langId).append("]"); t.setText(0, uniqueLangName.toString()); } t.setData(langId); if (currentLanguageIdGlobal != null && currentLanguageIdGlobal.equals(langId)) { currentLanguageId = currentLanguageIdGlobal; treeLanguages.setSelection(t); } else if (currentLanguageId == null) { currentLanguageId = langId; } } } }
Source:
protected Object doTransform(Message<?> message) throws Exception { Assert.notNull(message, "message must not be null"); Assert.notNull(message.getHeaders().getId(), "ID header must not be null"); Message<?> storedMessage = this.messageStore.addMessage(message); AbstractIntegrationMessageBuilder<?> responseBuilder = getMessageBuilderFactory() .withPayload(storedMessage.getHeaders().getId()); responseBuilder.copyHeaders(message.getHeaders()); return responseBuilder.build(); }

Target:
protected Object doTransform(Message<?> message) throws Exception { Assert.notNull(message, "message must not be null"); UUID id = message.getHeaders().getId(); Assert.notNull(id, "ID header must not be null"); this.messageStore.addMessage(message); AbstractIntegrationMessageBuilder<?> responseBuilder = getMessageBuilderFactory().withPayload(id); responseBuilder.copyHeaders(message.getHeaders()); return responseBuilder.build(); }