auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testRegexMatchesTopicsAWhenCreated() throws Exception { final String outputTopic = createTopic(topicSuffixGenerator.incrementAndGet()); final Serde<String> stringSerde = Serdes.String(); final List<String> expectedFirstAssignment = Collections.singletonList("TEST-TOPIC-1"); final List<String> expectedSecondAssignment = Arrays.asList("TEST-TOPIC-1", "TEST-TOPIC-2"); CLUSTER.createTopic("TEST-TOPIC-1"); final StreamsBuilder builder = new StreamsBuilder(); final KStream<String, String> pattern1Stream = builder.stream(Pattern.compile("TEST-TOPIC-\\d")); pattern1Stream.to(outputTopic, Produced.with(stringSerde, stringSerde)); final List<String> assignedTopics = new CopyOnWriteArrayList<>(); streams = new KafkaStreams(builder.build(), streamsConfiguration, new DefaultKafkaClientSupplier() { @Override public Consumer<byte[], byte[]> getConsumer(final Map<String, Object> config) { return new KafkaConsumer<byte[], byte[]>(config, new ByteArrayDeserializer(), new ByteArrayDeserializer()) { @Override public void subscribe(final Pattern topics, final ConsumerRebalanceListener listener) { super.subscribe(topics, new TheConsumerRebalanceListener(assignedTopics, listener)); } }; } }); streams.start(); TestUtils.waitForCondition(() -> assignedTopics.equals(expectedFirstAssignment), STREAM_TASKS_NOT_UPDATED); CLUSTER.createTopic("TEST-TOPIC-2"); TestUtils.waitForCondition(() -> assignedTopics.equals(expectedSecondAssignment), STREAM_TASKS_NOT_UPDATED); }

Target:
public void testRegexMatchesTopicsAWhenCreated() throws Exception { final Serde<String> stringSerde = Serdes.String(); final List<String> expectedFirstAssignment = Collections.singletonList("TEST-TOPIC-1"); final List<String> expectedSecondAssignment = Arrays.asList("TEST-TOPIC-1", "TEST-TOPIC-2"); CLUSTER.createTopic("TEST-TOPIC-1"); final StreamsBuilder builder = new StreamsBuilder(); final KStream<String, String> pattern1Stream = builder.stream(Pattern.compile("TEST-TOPIC-\\d")); pattern1Stream.to(outputTopic, Produced.with(stringSerde, stringSerde)); final List<String> assignedTopics = new CopyOnWriteArrayList<>(); streams = new KafkaStreams(builder.build(), streamsConfiguration, new DefaultKafkaClientSupplier() { @Override public Consumer<byte[], byte[]> getConsumer(final Map<String, Object> config) { return new KafkaConsumer<byte[], byte[]>(config, new ByteArrayDeserializer(), new ByteArrayDeserializer()) { @Override public void subscribe(final Pattern topics, final ConsumerRebalanceListener listener) { super.subscribe(topics, new TheConsumerRebalanceListener(assignedTopics, listener)); } }; } }); streams.start(); TestUtils.waitForCondition(() -> assignedTopics.equals(expectedFirstAssignment), STREAM_TASKS_NOT_UPDATED); CLUSTER.createTopic("TEST-TOPIC-2"); TestUtils.waitForCondition(() -> assignedTopics.equals(expectedSecondAssignment), STREAM_TASKS_NOT_UPDATED); }
Source:
protected Button getAddButton() { final Optional<Control> control = getControlForAction(AddRowAction.ACTION_ID); if (control.isPresent()) { return (Button) control.get(); } return null; }

Target:
protected Button getAddButton() { final Optional<Control> control = getControlForAction( org.eclipse.emfforms.spi.swt.table.action.AddRowAction.ACTION_ID); if (control.isPresent()) { return (Button) control.get(); } return null; }
Source:
public void onBackPressed() { if (referencesViewPager.getCurrentItem() > 0) { referencesViewPager.setCurrentItem(referencesViewPager.getCurrentItem() - 1, true); } }

Target:
public void onBackPressed() { if (referencesViewPager.getCurrentItem() > 0) { referencesViewPager.setCurrentItem(referencesViewPager.getCurrentItem() - 1, true); } else { super.onBackPressed(); } }
Source:
public List<FuturesPosition> getFuturesPositions() throws IOException { FuturesPositionsResponse res = okex.getFuturesPositions(apikey, digest, timestamp(), passphrase); res.checkResult(); List<List<FuturesPosition>> holding = res.getHolding(); return holding == null || holding.isEmpty() ? new ArrayList<>() : holding.get(0); }

Target:
public List<FuturesPosition> getFuturesPositions() throws IOException { FuturesPositionsResponse res = okex.getFuturesPositions(apikey, digest, timestamp(), passphrase); res.checkResult(); List<List<FuturesPosition>> holding = res.getHolding(); return holding == null || holding.isEmpty() ? Collections.emptyList() : holding.get(0); }
Source:
public void init() { post( "/list/import", (request, response) -> { MultipartConfigElement multipartConfigElement = new MultipartConfigElement(""); request.raw().setAttribute("org.eclipse.jetty.multipartConfig", multipartConfigElement); String listType = request.headers(LIST_TYPE_HEADER); if (StringUtils.isBlank(listType)) { String exceptionMessage = String.format("The header %s must be set.", LIST_TYPE_HEADER); LOGGER.info(exceptionMessage); createBadRequestResponse(exceptionMessage, response); return null; } List<Part> parts = new ArrayList<>(request.raw().getParts()); AttachmentInfo attachmentInfo = parseAttachments(parts); if (attachmentInfo == null) { String exceptionMessage = "Unable to parse the attachments."; LOGGER.debug(exceptionMessage); createBadRequestResponse(exceptionMessage, response); return null; } try (TemporaryFileBackedOutputStream temporaryFileBackedOutputStream = new TemporaryFileBackedOutputStream()) { IOUtils.copy(attachmentInfo.getStream(), temporaryFileBackedOutputStream); for (Splitter splitter : lookupSplitters(attachmentInfo.getContentType())) { try { if (attemptToSplitAndStore( response, listType, attachmentInfo, temporaryFileBackedOutputStream, splitter)) break; } catch (StopSplitterExecutionException e) { String exceptionMessage = "Attached files do not contain the correct mimetypes"; LOGGER.debug(exceptionMessage); createBadRequestResponse(exceptionMessage, response); return null; } } } IOUtils.closeQuietly(attachmentInfo.getStream()); return ""; }); }

Target:
public void init() { post( "/list/import", (request, response) -> { MultipartConfigElement multipartConfigElement = new MultipartConfigElement(""); request.raw().setAttribute("org.eclipse.jetty.multipartConfig", multipartConfigElement); String listType = request.headers(LIST_TYPE_HEADER); if (StringUtils.isBlank(listType)) { String exceptionMessage = String.format("The header %s must be set.", LIST_TYPE_HEADER); LOGGER.info(exceptionMessage); createBadRequestResponse(exceptionMessage, response); return null; } List<Part> parts = new ArrayList<>(request.raw().getParts()); AttachmentInfo attachmentInfo = parseAttachments(parts); if (attachmentInfo == null) { String exceptionMessage = "Unable to parse the attachments."; LOGGER.debug(exceptionMessage); createBadRequestResponse(exceptionMessage, response); return null; } try (TemporaryFileBackedOutputStream temporaryFileBackedOutputStream = new TemporaryFileBackedOutputStream()) { IOUtils.copy(attachmentInfo.getStream(), temporaryFileBackedOutputStream); for (Splitter splitter : lookupSplitters(attachmentInfo.getContentType())) { try { if (attemptToSplitAndStore( response, listType, attachmentInfo, temporaryFileBackedOutputStream, splitter)) break; } catch (StopSplitterExecutionException e) { LOGGER.debug("Failed to split file.", e); createBadRequestResponse( "Attached files do not contain the correct mimetypes", response); return null; } } } IOUtils.closeQuietly(attachmentInfo.getStream()); return ""; }); }
Source:
private void declaration(@Nullable IBinding binding, Tree node) { if (binding == null) { return; } sema.declarations.put(sema.declarationBinding(binding), node); }

Target:
private void declaration(@Nullable IBinding binding, Tree node) { if (binding == null) { return; } sema.declarations.put(binding, node); }
Source:
public void adjustBaseTableCost(ResultSetNode rsn) throws StandardException { if (fetchFirst==-1 && offset ==-1) return; CostEstimate costEstimate = rsn.getFinalCostEstimate(false); long totalRowCount = costEstimate.getEstimatedRowCount(); long currentOffset = offset==-1?0:offset; long currentFetchFirst = fetchFirst==-1?totalRowCount:fetchFirst; scaleFactor = (double) currentFetchFirst/(double) totalRowCount; if (scaleFactor >= 1.0d) { } else { costEstimate.setEstimatedRowCount(currentFetchFirst); costEstimate.setSingleScanRowCount(currentFetchFirst); costEstimate.setRowCount(currentFetchFirst); costEstimate.setProjectionRows(currentFetchFirst); costEstimate.setIndexLookupRows(costEstimate.getIndexLookupRows()*scaleFactor); costEstimate.setEstimatedHeapSize((long)(costEstimate.getEstimatedHeapSize()*scaleFactor)); costEstimate.setRemoteCost((long)(costEstimate.getRemoteCost()*scaleFactor)); costEstimate.setFromBaseTableCost(costEstimate.getFromBaseTableCost()*scaleFactor); costEstimate.setFromBaseTableRows(costEstimate.getFromBaseTableRows()*scaleFactor); costEstimate.setScannedBaseTableRows(costEstimate.getScannedBaseTableRows()*scaleFactor); costEstimate.setEstimatedCost(costEstimate.getEstimatedCost()*scaleFactor); int numPartitions = costEstimate.partitionCount(); if (numPartitions <= 0) numPartitions = 1; costEstimate.setRemoteCostPerPartition(costEstimate.remoteCost()/numPartitions); } }

Target:
public void adjustBaseTableCost(ResultSetNode rsn) throws StandardException { if (fetchFirst==-1 && offset ==-1) return; CostEstimate costEstimate = rsn.getFinalCostEstimate(false); long totalRowCount = costEstimate.getEstimatedRowCount(); long currentOffset = offset==-1?0:offset; long currentFetchFirst = fetchFirst==-1?totalRowCount:fetchFirst; scaleFactor = (double) currentFetchFirst/(double) totalRowCount; if (scaleFactor >= 1.0d) { } else { costEstimate.setEstimatedRowCount(currentFetchFirst); costEstimate.setSingleScanRowCount(currentFetchFirst); costEstimate.setRowCount(currentFetchFirst); costEstimate.setProjectionRows(currentFetchFirst); costEstimate.setIndexLookupRows(costEstimate.getIndexLookupRows()*scaleFactor); costEstimate.setEstimatedHeapSize((long)(costEstimate.getEstimatedHeapSize()*scaleFactor)); costEstimate.setRemoteCost((long)(costEstimate.getRemoteCost()*scaleFactor)); costEstimate.setFromBaseTableCost(costEstimate.getFromBaseTableCost()*scaleFactor); costEstimate.setFromBaseTableRows(costEstimate.getFromBaseTableRows()*scaleFactor); costEstimate.setScannedBaseTableRows(costEstimate.getScannedBaseTableRows()*scaleFactor); costEstimate.setEstimatedCost(costEstimate.getEstimatedCost()*scaleFactor); costEstimate.setRemoteCostPerPartition(costEstimate.remoteCost(), costEstimate.partitionCount()); } }
Source:
private void onMessage(final String message, final String file, final String details, final int line) { if (message == "sourcefile") { server_.profileSources(file, new ServerRequestCallback<String>() { @Override public void onResponseReceived(String response) { selectedPath_ = file; selectedLine_ = line; hasValidPath_ = !StringUtil.isNullOrEmpty(response); commands_.gotoProfileSource().setEnabled(hasValidPath_); if (details == "open") { if (hasValidPath_) { FilePosition filePosition = FilePosition.create(line, 0); CodeNavigationTarget navigationTarget = new CodeNavigationTarget(file, filePosition); fileTypeRegistry_.editFile( FileSystemItem.createFile(navigationTarget.getFile()), filePosition); } else { globalDisplay_.showMessage(GlobalDisplay.MSG_ERROR, "Error while opening profiler source", "Could not find reference to: " + selectedPath_); } } } @Override public void onError(ServerError error) { Debug.logError(error); } }); } }

Target:
private void onMessage(final String message, final String file, final String details, final int line) { if (message == "sourcefile") { server_.profileSources(file, new ServerRequestCallback<String>() { @Override public void onResponseReceived(String response) { selectedPath_ = file; selectedLine_ = line; hasValidPath_ = !StringUtil.isNullOrEmpty(response); commands_.gotoProfileSource().setEnabled(hasValidPath_); if (details == "open") { if (hasValidPath_) { FilePosition filePosition = FilePosition.create(line, 0); CodeNavigationTarget navigationTarget = new CodeNavigationTarget(file, filePosition); fileTypeRegistry_.editFile( FileSystemItem.createFile(navigationTarget.getFile()), filePosition); } else { globalDisplay_.showMessage(GlobalDisplay.MSG_ERROR, "Error while opening profiler source", "The source file " + selectedPath_ + " does not exist."); } } } @Override public void onError(ServerError error) { Debug.logError(error); } }); } }
Source:
public final boolean preventCommit () { if (tsLogger.logger.isTraceEnabled()) { tsLogger.logger.trace("BasicAction::preventCommit( " + this + ")"); } boolean res = false; { synchronized (this) { if (actionStatus == ActionStatus.RUNNING) actionStatus = ActionStatus.ABORT_ONLY; } res = ((actionStatus == ActionStatus.ABORT_ONLY) || (actionStatus == ActionStatus.ABORTED) || (actionStatus == ActionStatus.ABORTING)); } createPreparedLists(); return res; }

Target:
public final boolean preventCommit () { if (tsLogger.logger.isTraceEnabled()) { tsLogger.logger.trace("BasicAction::preventCommit( " + this + ")"); } boolean res = false; { synchronized (this) { if (actionStatus == ActionStatus.RUNNING) actionStatus = ActionStatus.ABORT_ONLY; } res = ((actionStatus == ActionStatus.ABORT_ONLY) || (actionStatus == ActionStatus.ABORTED) || (actionStatus == ActionStatus.ABORTING)); } return res; }
Source:
public void onMultipleActionsTest() { assertEquals(0, receiver.multipleActionCall); Intent intent = new Intent("ACTION_MULTIPLE_TEST_1"); receiver.onReceive(Robolectric.application, intent); assertEquals(1, receiver.multipleActionCall); intent = new Intent("ACTION_MULTIPLE_TEST_2"); receiver.onReceive(Robolectric.application, intent); assertEquals(2, receiver.multipleActionCall); }

Target:
public void onMultipleActionsTest() { assertEquals(0, receiver.multipleActionCall); Intent intent = new Intent(ReceiverWithActions.ACTION_MULTIPLE_TEST_1); receiver.onReceive(Robolectric.application, intent); assertEquals(1, receiver.multipleActionCall); intent = new Intent(ReceiverWithActions.ACTION_MULTIPLE_TEST_2); receiver.onReceive(Robolectric.application, intent); assertEquals(2, receiver.multipleActionCall); }
Source:
private void postDescription(@NonNull String editToken) { final String description = StringUtil.emptyIfNull(editView.getDescription()); descriptionEditCall = new DescriptionEditClient().request(wikiData, pageTitle, description, editToken, new DescriptionEditClient.Callback() { @Override @SuppressWarnings("checkstyle:magicnumber") public void success(@NonNull Call<DescriptionEdit> call) { if (getActivity() == null) { return; } DeviceUtil.hideSoftKeyboard(getActivity()); editView.setSaveState(false); startActivityForResult(DescriptionEditSuccessActivity.newIntent(getContext(), description), Constants.ACTIVITY_REQUEST_DESCRIPTION_EDIT_SUCCESS); } @Override public void abusefilter(@NonNull Call<DescriptionEdit> call, String info) { editView.setSaveState(false); editView.setError(info); } @Override public void failure(@NonNull Call<DescriptionEdit> call, @NonNull Throwable caught) { editFailed(caught); } }); }

Target:
private void postDescription(@NonNull String editToken) { final String description = StringUtil.emptyIfNull(editView.getDescription()); descriptionEditCall = new DescriptionEditClient().request(wikiData, pageTitle, description, editToken, new DescriptionEditClient.Callback() { @Override public void success(@NonNull Call<DescriptionEdit> call) { if (getActivity() == null) { return; } DeviceUtil.hideSoftKeyboard(getActivity()); editView.setSaveState(false); startActivityForResult(DescriptionEditSuccessActivity.newIntent(getContext(), description), Constants.ACTIVITY_REQUEST_DESCRIPTION_EDIT_SUCCESS); } @Override public void abusefilter(@NonNull Call<DescriptionEdit> call, String info) { editView.setSaveState(false); editView.setError(info); } @Override public void failure(@NonNull Call<DescriptionEdit> call, @NonNull Throwable caught) { editFailed(caught); } }); }
Source:
public void init() throws IOException { final Properties producerConfig = new Properties(); final Dictionary<String, Object> properties = configAdmin.getConfiguration(KAFKA_CLIENT_PID).getProperties(); if (properties != null) { final Enumeration<String> keys = properties.keys(); while (keys.hasMoreElements()) { final String key = keys.nextElement(); producerConfig.put(key, properties.get(key)); } } producerConfig.put("key.serializer", StringSerializer.class.getCanonicalName()); producerConfig.put("value.serializer", ByteArraySerializer.class.getCanonicalName()); final ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(null); producer = new KafkaProducer<>(producerConfig); } finally { Thread.currentThread().setContextClassLoader(currentClassLoader); } if(kafkaSendQueueCapacity <= 0) { kafkaSendQueueCapacity = 1000; Log.info("Defaulted the 'kafkaSendQueueCapacity' to 1000 since no property was set"); } kafkaSendQueue = new LinkedBlockingQueue<>(kafkaSendQueueCapacity); kafkaSendQueueExecutor.execute(this::processKafkaSendQueue); if (forwardEvents) { eventSubscriptionService.addEventListener(this); } }

Target:
public void init() throws IOException { final Properties producerConfig = new Properties(); final Dictionary<String, Object> properties = configAdmin.getConfiguration(KAFKA_CLIENT_PID).getProperties(); if (properties != null) { final Enumeration<String> keys = properties.keys(); while (keys.hasMoreElements()) { final String key = keys.nextElement(); producerConfig.put(key, properties.get(key)); } } producerConfig.put("key.serializer", StringSerializer.class.getCanonicalName()); producerConfig.put("value.serializer", ByteArraySerializer.class.getCanonicalName()); final ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(null); producer = new KafkaProducer<>(producerConfig); } finally { Thread.currentThread().setContextClassLoader(currentClassLoader); } if(kafkaSendQueueCapacity <= 0) { kafkaSendQueueCapacity = 1000; LOG.info("Defaulted the 'kafkaSendQueueCapacity' to 1000 since no property was set"); } kafkaSendQueue = new LinkedBlockingQueue<>(kafkaSendQueueCapacity); kafkaSendQueueExecutor.execute(this::processKafkaSendQueue); if (forwardEvents) { eventSubscriptionService.addEventListener(this); } }
Source:
OrientDB orientDB() throws IOException { OrientDB orientDB = new OrientDB(StringUtils.substringBeforeLast(connectionConfig.getUrl(), "/"), connectionConfig.getUsername(), connectionConfig.getPassword(), getOrientDBConfig()); String database = connectionConfig.getDatabase(); if (!orientDB.exists(database)) { logger.info(String.format("Unpacking database from snapshot [%s]...", database)); try (InputStream is = new ClassPathResource("db/snapshot/strongbox-db-snapshot.zip").getInputStream()) { ZipUtil.unpack(is, new File(EmbeddedOrientDbServer.getDatabasePath() + "/strongbox")); } } else { logger.info("Re-using existing database " + database + "."); } return orientDB; }

Target:
OrientDB orientDB() throws IOException { OrientDB orientDB = new OrientDB(StringUtils.substringBeforeLast(connectionConfig.getUrl(), "/"), connectionConfig.getUsername(), connectionConfig.getPassword(), getOrientDBConfig()); String database = connectionConfig.getDatabase(); if (!orientDB.exists(database)) { logger.info(String.format("Database does not exist. Copying fresh database snapshot from [%s]...", databaseSnapshotResource.getURI())); Path snapshotPath = Paths.get(databaseSnapshotResource.getURI()); FileSystemUtils.copyRecursively(snapshotPath, Paths.get(databasePath)); } else { logger.info("Re-using existing database " + database + "."); } return orientDB; }
Source:
public void singleAtomicCallFieldTest() { String functionName = "singleAtomic"; CallManager.CallableEndpoint callableEndpoint = endpointUtil.makeCallableEndpoint(functionName); CallManager.OneCaller<Double> caller = endpointUtil.makeOneCaller(callableEndpoint, Double.class); class Output { Double expectedOutput = 0.0; } final Output output = new Output(); CallBatcher<CallArgs, OneCallEvent<Double>> batcher = caller .batcher() .forArgs() .withDefaultArgs(caller.args().param("param1", 1.2)) .onCallSuccess(event -> { output.expectedOutput = event.getItem(); }) .onCallFailure((event, throwable) -> { throwable.printStackTrace(); fail("atomic batcher failed"); }); batcher.getDataMovementManager().startJob(batcher); batcher.add(caller.args()); batcher.flushAndWait(); batcher.getDataMovementManager().stopJob(batcher); assertEquals("for single atomic callField, output not equal to input", Double.valueOf(1.2), output.expectedOutput); }

Target:
public void singleAtomicCallFieldTest() { String functionName = "singleAtomic"; CallManager.CallableEndpoint callableEndpoint = endpointUtil.makeCallableEndpoint(functionName); CallManager.OneCaller<Double> caller = endpointUtil.makeOneCaller(callableEndpoint, Double.class); class Output { Double expectedOutput = 0.0; } final Output output = new Output(); CallBatcher<CallArgs, OneCallEvent<Double>> batcher = caller .batcher() .forArgs() .withDefaultArgs(caller.args().param("param1", 1.2)) .onCallSuccess(event -> { output.expectedOutput = event.getItem(); }) .onCallFailure((event, throwable) -> { throwable.printStackTrace(); fail("atomic batcher failed"); }); batcher.add(caller.args()); batcher.flushAndWait(); assertEquals("for single atomic callField, output not equal to input", Double.valueOf(1.2), output.expectedOutput); batcher.add(caller.args().param("param1", 1.1)); batcher.flushAndWait(); assertEquals("for single atomic callField, output not equal to input", Double.valueOf(1.1), output.expectedOutput); batcher.getDataMovementManager().stopJob(batcher); }
Source:
public static void runBlockingActionWithMessageBoxDefaultResult(IRunnable runnable, int messageBoxResult) { ClientRunContexts.copyCurrent() .withThreadLocal(ClientSessionProviderWithCache.MESSAGE_BOX_HANDLER_STRATEGY, (t) -> messageBoxResult) .run(runnable); }

Target:
public static void runBlockingActionWithMessageBoxDefaultResult(IRunnable runnable, int messageBoxResult) { ClientRunContexts.copyCurrent() .withThreadLocal(ClientSessionProviderWithCache.MESSAGE_BOX_HANDLER_STRATEGY, mBox -> messageBoxResult) .run(runnable); }
Source:
private void pushUpstream(final RevCommit commit, final PushMode pushTo) { RemoteConfig config = SimpleConfigurePushDialog .getConfiguredRemote(repository); if (pushTo == PushMode.GERRIT) { final Wizard pushWizard = new PushToGerritWizard(repository); openPushWizard(pushWizard); } else { if (config == null) { try { Wizard pushWizard = null; String fullBranch = repository.getFullBranch(); if (fullBranch != null && fullBranch.startsWith(Constants.R_HEADS)) { Ref ref = repository.getRef(fullBranch); pushWizard = new PushBranchWizard(repository, ref); } else { pushWizard = new PushBranchWizard(repository, commit.getId()); } openPushWizard(pushWizard); } catch (IOException e) { Activator.handleError( NLS.bind(UIText.CommitUI_pushFailedMessage, e), e, true); } } else { PushOperationUI op = new PushOperationUI(repository, config.getName(), false); op.start(); } } }

Target:
private void pushUpstream(final RevCommit commit, final PushMode pushTo) { RemoteConfig config = SimpleConfigurePushDialog .getConfiguredRemote(repository); if (pushTo == PushMode.GERRIT) { final Wizard pushWizard = new PushToGerritWizard(repository); openPushWizard(pushWizard); } else if (config == null) { try { Wizard pushWizard = null; String fullBranch = repository.getFullBranch(); if (fullBranch != null && fullBranch.startsWith(Constants.R_HEADS)) { Ref ref = repository.getRef(fullBranch); pushWizard = new PushBranchWizard(repository, ref); } else { pushWizard = new PushBranchWizard(repository, commit.getId()); } openPushWizard(pushWizard); } catch (IOException e) { Activator.handleError( NLS.bind(UIText.CommitUI_pushFailedMessage, e), e, true); } } else { PushOperationUI op = new PushOperationUI(repository, config.getName(), false); op.start(); } }
Source:
public static boolean isValidEmailFormat ( String email ) { return isValidEmailFormat(email, VALID_EMAIL_ADDRESS_REGEX); }

Target:
public static boolean isValidEmailFormat ( String email ) { boolean isValid = false; try { InternetAddress emailAddress = new InternetAddress(email); emailAddress.validate(); isValid = true; } catch (AddressException ex) { isValid = false; logger.warn("Email " + email + " is invalid"); } return isValid; }
Source:
private void initialiseAndValidateDefaultErrorHandler() { String defaultErrorHandler = getDefaultErrorHandlerName(); if (defaultErrorHandler != null) { FlowExceptionHandler messagingExceptionHandler = registry.<FlowExceptionHandler>lookupByName(defaultErrorHandler) .orElseThrow(() -> new MuleRuntimeException(createStaticMessage(format("No global error handler defined with name '%s'.", defaultErrorHandler)))); if (messagingExceptionHandler instanceof MessagingExceptionHandlerAcceptor) { MessagingExceptionHandlerAcceptor messagingExceptionHandlerAcceptor = (MessagingExceptionHandlerAcceptor) messagingExceptionHandler; if (!messagingExceptionHandlerAcceptor.acceptsAll()) { throw new MuleRuntimeException(createStaticMessage("Default exception strategy must not have expression attribute. It must accept any message.")); } } } }

Target:
private void initialiseAndValidateDefaultErrorHandler() throws InitialisationException { String defaultErrorHandler = getDefaultErrorHandlerName(); if (defaultErrorHandler != null) { FlowExceptionHandler messagingExceptionHandler = registry.<FlowExceptionHandler>lookupByName(defaultErrorHandler) .orElseThrow(() -> new InitialisationException(createStaticMessage(format("No global error handler defined with name '%s'.", defaultErrorHandler)), this)); if (messagingExceptionHandler instanceof MessagingExceptionHandlerAcceptor) { MessagingExceptionHandlerAcceptor messagingExceptionHandlerAcceptor = (MessagingExceptionHandlerAcceptor) messagingExceptionHandler; if (!messagingExceptionHandlerAcceptor.acceptsAll()) { throw new InitialisationException(createStaticMessage("Default exception strategy must not have expression attribute. It must accept any message."), this); } } } }
Source:
public Call<Captcha> request(@NonNull WikiSite wiki, @NonNull Callback cb) { Service service = new MwCachedService<>(Service.class).service(wiki); return request(service, cb); }

Target:
public Call<Captcha> request(@NonNull WikiSite wiki, @NonNull Callback cb) { Service service = cachedService.service(wiki); return request(service, cb); }
Source:
public void deleteAllAllergies() throws Exception { handle(newDeleteRequest(getURI(), new Parameter("reason", "unit test"))); Allergy allergy = Context.getPatientService().getAllergy(AALLERGY_ID); Assert.assertTrue(allergy.isVoided()); Assert.assertEquals("unit test", allergy.getVoidReason()); }

Target:
public void deleteAllAllergies() throws Exception { handle(newDeleteRequest(getURI(), new Parameter("reason", "unit test"))); Allergy allergy = Context.getPatientService().getAllergyByUuid(getUuid()); Allergies allergies = Context.getPatientService().getAllergies(allergy.getPatient()); Assert.assertTrue(allergy.isVoided()); Assert.assertEquals("unit test", allergy.getVoidReason()); Assert.assertEquals(Allergies.UNKNOWN, allergies.getAllergyStatus()); }
Source:
public void setSpacing(int spacing) { this.spacing = spacing; }

Target:
public void setSpacing(int spacing) { if(spacing < 0 || spacing > 3) SWT.error(SWT.ERROR_INVALID_ARGUMENT); this.spacing = spacing; updateFolder(REDRAW_TABS); }
Source:
public void setSummaries(@NonNull Activity activity, @NonNull SuggestedEditsSummary sourceSummary, SuggestedEditsSummary targetSummary) { this.activity = activity; suggestedEditsSummary = isTranslationEdit ? targetSummary : sourceSummary; pageSummaryContainer.setVisibility(View.VISIBLE); labelText.setText(getLabelText(sourceSummary.getLang())); pageSummaryText.setText(StringUtil.strip(StringUtils.capitalize(StringUtil.removeHTMLTags(isTranslationEdit || invokeSource == SUGGESTED_EDITS_ADD_CAPTION || invokeSource == FEED_CARD_SUGGESTED_EDITS_IMAGE_CAPTION ? sourceSummary.getDescription() : sourceSummary.getExtractHtml())))); if (pageSummaryText.getText().equals(getContext().getString(R.string.suggested_edits_no_description))) { pageSummaryContainer.setVisibility(GONE); } setConditionalLayoutDirection(pageSummaryContainer, (isTranslationEdit) ? sourceSummary.getLang() : pageTitle.getWikiSite().languageCode()); setUpBottomBar(); }

Target:
public void setSummaries(@NonNull Activity activity, @NonNull SuggestedEditsSummary sourceSummary, SuggestedEditsSummary targetSummary) { this.activity = activity; suggestedEditsSummary = isTranslationEdit ? targetSummary : sourceSummary; pageSummaryContainer.setVisibility(View.VISIBLE); labelText.setText(getLabelText(sourceSummary.getLang())); pageSummaryText.setText(StringUtil.strip(StringUtils.capitalize(StringUtil.removeHTMLTags(isTranslationEdit || invokeSource == SUGGESTED_EDITS_ADD_CAPTION || invokeSource == FEED_CARD_SUGGESTED_EDITS_IMAGE_CAPTION ? sourceSummary.getDescription() : sourceSummary.getExtractHtml())))); if (pageSummaryText.getText().toString().isEmpty()) { pageSummaryContainer.setVisibility(GONE); } setConditionalLayoutDirection(pageSummaryContainer, (isTranslationEdit) ? sourceSummary.getLang() : pageTitle.getWikiSite().languageCode()); setUpBottomBar(); }
Source:
public Event(CompletionTime completionTime, String eventSource) { if (null == eventSource || eventSource.isEmpty()) { throw new IllegalStateException("Cannot determine the event source"); } this.context = new HashMap<>(1); this.context.put("id", completionTime.getId()); this.tags = new HashMap<>(); if (null != completionTime.getUri()) { this.tags.put("uri", completionTime.getUri()); } this.tags.put("operation", completionTime.getOperation()); Set<Property> properties = completionTime.getProperties(); if (properties != null && properties.size() > 0) { properties.forEach(p -> { String value = this.tags.get(p.getName()); this.tags.put(p.getName(), value == null ? p.getValue() : String.format("%s,%s", value, p.getValue())); }); } this.dataId = eventSource; this.category = "APM"; this.dataSource = completionTime.getHostName(); this.id = UUID.randomUUID().toString(); this.ctime = completionTime.getTimestamp(); this.text = Long.toString(completionTime.getDuration()); }

Target:
public Event(CompletionTime completionTime, String eventSource) { if (null == eventSource || eventSource.isEmpty()) { throw new IllegalStateException("Cannot determine the event source"); } this.context = new HashMap<>(1); this.context.put("id", completionTime.getId()); this.tags = new HashMap<>(); if (null != completionTime.getUri()) { this.tags.put("uri", completionTime.getUri()); } if (null != completionTime.getOperation()) { this.tags.put("operation", completionTime.getOperation()); } Set<Property> properties = completionTime.getProperties(); if (properties != null && properties.size() > 0) { properties.forEach(p -> { String value = this.tags.get(p.getName()); this.tags.put(p.getName(), value == null ? p.getValue() : String.format("%s,%s", value, p.getValue())); }); } this.dataId = eventSource; this.category = "APM"; this.dataSource = completionTime.getHostName(); this.id = UUID.randomUUID().toString(); this.ctime = completionTime.getTimestamp(); this.text = Long.toString(completionTime.getDuration()); }
Source:
private void execute() { if (fFinishedLatch.getCount() == 0) { return; } synchronized (syncObj) { if (fStarted) { return; } fStarted = true; } if (fTrace != null) { fTrace.notifyPendingRequest(true); setNotifyRequestNeeded(true); } fJob = new Job(NLS.bind(Messages.TmfAbstractAnalysisModule_RunningAnalysis, getName())) { @Override protected IStatus run(final IProgressMonitor monitor) { try { monitor.beginTask("", IProgressMonitor.UNKNOWN); broadcast(new TmfStartAnalysisSignal(TmfAbstractAnalysisModule.this, TmfAbstractAnalysisModule.this)); fAnalysisCancelled = !executeAnalysis(monitor); if ((fTrace != null) && isNotifyRequestNeeded()) { fTrace.notifyPendingRequest(false); setNotifyRequestNeeded(false); } } catch (TmfAnalysisException e) { Activator.logError("Error executing analysis with trace " + getTrace().getName(), e); } finally { synchronized (syncObj) { monitor.done(); setAnalysisCompleted(); } } if (!fAnalysisCancelled) { return Status.OK_STATUS; } return Status.CANCEL_STATUS; } @Override protected void canceling() { TmfAbstractAnalysisModule.this.canceling(); } }; fJob.schedule(); }

Target:
private void execute() { if (fFinishedLatch.getCount() == 0) { return; } synchronized (syncObj) { if (fStarted) { return; } fStarted = true; } if (fTrace != null) { fTrace.notifyPendingRequest(true); setNotifyPendingReqNeeded(true); } fJob = new Job(NLS.bind(Messages.TmfAbstractAnalysisModule_RunningAnalysis, getName())) { @Override protected IStatus run(final IProgressMonitor monitor) { try { monitor.beginTask("", IProgressMonitor.UNKNOWN); broadcast(new TmfStartAnalysisSignal(TmfAbstractAnalysisModule.this, TmfAbstractAnalysisModule.this)); fAnalysisCancelled = !executeAnalysis(monitor); if ((fTrace != null) && isNotifyPendingReqNeeded()) { fTrace.notifyPendingRequest(false); setNotifyPendingReqNeeded(false); } } catch (TmfAnalysisException e) { Activator.logError("Error executing analysis with trace " + getTrace().getName(), e); } finally { synchronized (syncObj) { monitor.done(); setAnalysisCompleted(); } } if (!fAnalysisCancelled) { return Status.OK_STATUS; } return Status.CANCEL_STATUS; } @Override protected void canceling() { TmfAbstractAnalysisModule.this.canceling(); } }; fJob.schedule(); }
Source:
private FileSystem getInternal(URI uri, Configuration conf, Key key) throws IOException{ FileSystem fs; synchronized (this) { fs = map.get(key); } if (fs != null) { return fs; } try (DurationInfo d = new DurationInfo(LOGGER, false, "Acquiring creator semaphore for %s", uri)) { creatorPermits.acquire(); } catch (InterruptedException e) { throw (IOException)new InterruptedIOException(e.toString()) .initCause(e); } FileSystem fsToClose = null; try { synchronized (this) { fs = map.get(key); } if (fs != null) { LOGGER.debug("Filesystem created while awaiting semaphore", uri); return fs; } fs = createFileSystem(uri, conf); final long timeout = conf.getTimeDuration(SERVICE_SHUTDOWN_TIMEOUT, SERVICE_SHUTDOWN_TIMEOUT_DEFAULT, ShutdownHookManager.TIME_UNIT_DEFAULT); synchronized (this) { FileSystem oldfs = map.get(key); if (oldfs != null) { fsToClose = fs; fs = oldfs; } else { if (map.isEmpty() && !ShutdownHookManager.get().isShutdownInProgress()) { ShutdownHookManager.get().addShutdownHook(clientFinalizer, SHUTDOWN_HOOK_PRIORITY, timeout, ShutdownHookManager.TIME_UNIT_DEFAULT); } fs.key = key; map.put(key, fs); if (conf.getBoolean( FS_AUTOMATIC_CLOSE_KEY, FS_AUTOMATIC_CLOSE_DEFAULT)) { toAutoClose.add(key); } } } } finally { creatorPermits.release(); } if (fsToClose != null) { LOGGER.debug("Duplicate FS created for {}; discarding {}", uri, fs); discardedInstances.incrementAndGet(); fsToClose.close(); } return fs; }

Target:
private FileSystem getInternal(URI uri, Configuration conf, Key key) throws IOException{ FileSystem fs; synchronized (this) { fs = map.get(key); } if (fs != null) { return fs; } try (DurationInfo d = new DurationInfo(LOGGER, false, "Acquiring creator semaphore for %s", uri)) { creatorPermits.acquire(); } catch (InterruptedException e) { throw (IOException)new InterruptedIOException(e.toString()) .initCause(e); } FileSystem fsToClose = null; try { synchronized (this) { fs = map.get(key); } if (fs != null) { LOGGER.debug("Filesystem created while awaiting semaphore", uri); return fs; } fs = createFileSystem(uri, conf); final long timeout = conf.getTimeDuration(SERVICE_SHUTDOWN_TIMEOUT, SERVICE_SHUTDOWN_TIMEOUT_DEFAULT, ShutdownHookManager.TIME_UNIT_DEFAULT); synchronized (this) { FileSystem oldfs = map.get(key); if (oldfs != null) { fsToClose = fs; fs = oldfs; } else { if (map.isEmpty() && !ShutdownHookManager.get().isShutdownInProgress()) { ShutdownHookManager.get().addShutdownHook(clientFinalizer, SHUTDOWN_HOOK_PRIORITY, timeout, ShutdownHookManager.TIME_UNIT_DEFAULT); } fs.key = key; map.put(key, fs); if (conf.getBoolean( FS_AUTOMATIC_CLOSE_KEY, FS_AUTOMATIC_CLOSE_DEFAULT)) { toAutoClose.add(key); } } } } finally { creatorPermits.release(); } if (fsToClose != null) { LOGGER.debug("Duplicate FS created for {}; discarding {}", uri, fs); discardedInstances.incrementAndGet(); IOUtils.cleanupWithLogger(LOGGER, fsToClose); } return fs; }
Source:
protected void map( Object key, Object value, Context context ) throws IOException, InterruptedException { try { final InputRow inputRow = parseInputRow(value, parser); if (!granularitySpec.bucketIntervals().isPresent() || granularitySpec.bucketInterval(new DateTime(inputRow.getTimestampFromEpoch())) .isPresent()) { innerMap(inputRow, value, context); } } catch (ParseException e) { if (config.isIgnoreInvalidRows()) { log.debug(e, "Ignoring invalid row [%s] due to parsing error", value.toString()); context.getCounter(HadoopDruidIndexerConfig.IndexJobCounters.INVALID_ROW_COUNTER).increment(1); return; } else { throw e; } } catch (RuntimeException e) { throw new RE(e, "Failure on row[%s]", value); } }

Target:
protected void map( Object key, Object value, Context context ) throws IOException, InterruptedException { try { final InputRow inputRow; try { inputRow = parseInputRow(value, parser); } catch (ParseException e) { if (reportParseExceptions) { throw e; } log.debug(e, "Ignoring invalid row [%s] due to parsing error", value.toString()); context.getCounter(HadoopDruidIndexerConfig.IndexJobCounters.INVALID_ROW_COUNTER).increment(1); return; } if (!granularitySpec.bucketIntervals().isPresent() || granularitySpec.bucketInterval(new DateTime(inputRow.getTimestampFromEpoch())) .isPresent()) { innerMap(inputRow, value, context, reportParseExceptions); } } catch (RuntimeException e) { throw new RE(e, "Failure on row[%s]", value); } }
Source:
public DefaultUsage(final Usage in, UsagePriceOverride override, Currency currency) { this.name = in.getName(); this.usageType = in.getUsageType(); this.billingPeriod = in.getBillingPeriod(); this.billingMode = in.getBillingMode(); this.limits = (DefaultLimit[]) in.getLimits(); this.blocks = (DefaultBlock[]) in.getBlocks(); this.tiers = new DefaultTier[in.getTiers().length]; for (int i = 0; i < in.getTiers().length; i++) { if(override != null && override.getTierPriceOverrides().get(i)!=null) tiers[i] = new DefaultTier(in.getTiers()[i], override.getTierPriceOverrides().get(i), currency); else tiers[i] = (DefaultTier) in.getTiers()[i]; } }

Target:
public DefaultUsage(final Usage in, UsagePriceOverride override, Currency currency) { this.name = in.getName(); this.usageType = in.getUsageType(); this.billingPeriod = in.getBillingPeriod(); this.billingMode = in.getBillingMode(); this.limits = (DefaultLimit[]) in.getLimits(); this.blocks = (DefaultBlock[]) in.getBlocks(); this.tiers = new DefaultTier[in.getTiers().length]; for (int i = 0; i < in.getTiers().length; i++) { if(override != null && override.getTierPriceOverrides()!=null) { final TieredBlock[] curTieredBlocks = in.getTiers()[i].getTieredBlocks(); final TierPriceOverride overriddenTier = Iterables.tryFind(override.getTierPriceOverrides(), new Predicate<TierPriceOverride>() { @Override public boolean apply(final TierPriceOverride input) { if(input !=null) { final List<TieredBlockPriceOverride> blockPriceOverrides = input.getTieredBlockPriceOverrides(); for (TieredBlockPriceOverride blockDef : blockPriceOverrides) { String unitName = blockDef.getUnitName(); Double max = blockDef.getMax(); Double size = blockDef.getSize(); for (TieredBlock curTieredBlock : curTieredBlocks) if (unitName.equals(curTieredBlock.getUnit().getName()) && Double.compare(size, curTieredBlock.getSize()) == 0 && Double.compare(max, curTieredBlock.getMax()) == 0) { return true; } } } return false; } }).orNull(); tiers[i] = (overriddenTier != null) ? new DefaultTier(in.getTiers()[i], overriddenTier, currency) : (DefaultTier)in.getTiers()[i] ; } else { tiers[i] = (DefaultTier) in.getTiers()[i]; } } }
Source:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } ArrayList<String> actionMessages = getReturnValue().getCanDoActionMessages(); actionMessages.add(VdcBllMessages.VAR__ACTION__UPDATE.toString()); VdsGroupDAO vdsGroupDAO = DbFacade.getInstance().getVdsGroupDAO(); VDSGroup vdsGroup = getVdsGroup(); VDSGroup oldGroup = vdsGroupDAO.get(vdsGroup.getId()); if (!validateCluster(oldGroup)) { return false; } if (!validateGroupNameChange(oldGroup)) { return false; } if (!validateCpuChange(oldGroup)) { return false; } if (!validateCompatibilityVersionChange(oldGroup)) { return false; } if (!validateCpuFlagsChange(oldGroup)) { return false; } if (!validateSameStoragePool(oldGroup)) { return false; } if (!validateMemberVmsState(oldGroup)) { return false; } if (vdsGroup.getstorage_pool_id() != null && oldGroup.getstorage_pool_id() == null) { storage_pool storagePool = DbFacade.getInstance().getStoragePoolDAO().get( getVdsGroup().getstorage_pool_id().getValue()); if (storagePool.getstorage_pool_type() == StorageType.LOCALFS) { if (!validateLocalfsSpecificRequirements()) { return false; } } } if (!validateMetrics()) { return false; } return true; }

Target:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } ArrayList<String> actionMessages = getReturnValue().getCanDoActionMessages(); actionMessages.add(VdcBllMessages.VAR__ACTION__UPDATE.toString()); VDSGroup vdsGroup = getVdsGroup(); VDSGroup oldGroup = getVdsGroupDAO().get(vdsGroup.getId()); if (!validateCluster(oldGroup)) { return false; } if (!validateGroupNameChange(oldGroup)) { return false; } if (!validateCpuChange(oldGroup)) { return false; } if (!validateCompatibilityVersionChange(oldGroup)) { return false; } if (!validateCpuFlagsChange(oldGroup)) { return false; } if (!validateSameStoragePool(oldGroup)) { return false; } if (!validateMemberVmsState(oldGroup)) { return false; } if (vdsGroup.getstorage_pool_id() != null && oldGroup.getstorage_pool_id() == null) { storage_pool storagePool = DbFacade.getInstance().getStoragePoolDAO().get( getVdsGroup().getstorage_pool_id().getValue()); if (storagePool.getstorage_pool_type() == StorageType.LOCALFS) { if (!validateLocalfsSpecificRequirements()) { return false; } } } if (!validateMetrics()) { return false; } return true; }
Source:
CLIRegistries() { }

Target:
private CLIRegistries() { }
Source:
public static int getTextColorResId(int buttonType) { switch (buttonType) { case BUTTON_RETRY: return R.color.alert_red; default: return R.color.blue_wordpress; } }

Target:
public static @ColorRes int getTextColorResId(int buttonType) { switch (buttonType) { case BUTTON_RETRY: return R.color.alert_red; default: return R.color.blue_wordpress; } }
Source:
public void testHandshakeTimeoutWithValueSet() throws Exception { JMSServerManager jmsServer; FileConfiguration fc = new FileConfiguration(); FileJMSConfiguration fileConfiguration = new FileJMSConfiguration(); FileDeploymentManager deploymentManager = new FileDeploymentManager("server-start-stop-config1.xml"); deploymentManager.addDeployable(fc); deploymentManager.addDeployable(fileConfiguration); deploymentManager.readConfiguration(); ActiveMQJAASSecurityManager sm = new ActiveMQJAASSecurityManager(InVMLoginModule.class.getName(), new SecurityConfiguration()); ActiveMQServer server = addServer(new ActiveMQServerImpl(fc, sm)); server.start(); jmsServer = new JMSServerManagerImpl(server, fileConfiguration); TransportConfiguration tc = jmsServer.getActiveMQServer().getConfiguration().getAcceptorConfigurations().iterator().next(); String host = (String) tc.getParams().get(TransportConstants.HOST_PROP_NAME); String port = (String) tc.getParams().get(TransportConstants.PORT_PROP_NAME); int handshakeTimeout = Integer.parseInt(tc.getParams().get(TransportConstants.HANDSHAKE_TIMEOUT).toString()); jmsServer.setRegistry(null); assertEquals(5, handshakeTimeout); NettyTransport transport = NettyTransportFactory.createTransport(new URI("tcp://" + host + ":" + port)); transport.setTransportListener(new NettyTransportListener() { @Override public void onData(ByteBuf incoming) { } @Override public void onTransportClosed() { } @Override public void onTransportError(Throwable cause) { } }); try { transport.connect(); assertTrue("Connection should be closed now", Wait.waitFor(() -> !transport.isConnected(), TimeUnit.SECONDS.toMillis(handshakeTimeout + 1))); } finally { transport.close(); tearDown(); } }

Target:
public void testHandshakeTimeoutWithValueSet() throws Exception { SecurityConfiguration securityConfig = new SecurityConfiguration(); securityConfig.addUser("guest", "guest"); securityConfig.addRole("guest", "guest"); securityConfig.setDefaultUser("guest"); ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager(InVMLoginModule.class.getName(), securityConfig); ActiveMQServer server = ActiveMQServers.newActiveMQServer("server-start-stop-config1.xml", null, securityManager); server.start(); TransportConfiguration tc = server.getConfiguration().getAcceptorConfigurations().iterator().next(); String host = (String) tc.getParams().get(TransportConstants.HOST_PROP_NAME); String port = (String) tc.getParams().get(TransportConstants.PORT_PROP_NAME); int handshakeTimeout = Integer.parseInt(tc.getParams().get(TransportConstants.HANDSHAKE_TIMEOUT).toString()); assertEquals(5, handshakeTimeout); NettyTransport transport = NettyTransportFactory.createTransport(new URI("tcp://" + host + ":" + port)); transport.setTransportListener(new NettyTransportListener() { @Override public void onData(ByteBuf incoming) { } @Override public void onTransportClosed() { } @Override public void onTransportError(Throwable cause) { } }); try { transport.connect(); assertTrue("Connection should be closed now", Wait.waitFor(() -> !transport.isConnected(), TimeUnit.SECONDS.toMillis(handshakeTimeout + 1))); } finally { transport.close(); server.stop(); } }
Source:
public JPanel getPanel() { JPanel ajaxSpiderPanel = new JPanel(new GridBagLayout()); ajaxSpiderPanel.setBackground(Color.WHITE); ajaxSpiderPanel.add(getSelectCheckBox(), LayoutHelper.getGBC(0, 0, 1, 0.0D, DisplayUtils.getScaledInsets(5, 5, 5, 5))); ajaxSpiderPanel.add(new JLabel(Constant.messages.getString("quickstart.label.withbrowser")), LayoutHelper.getGBC(1, 0, 1, 0.0D, DisplayUtils.getScaledInsets(5, 5, 5, 5))); ajaxSpiderPanel.add(getBrowserComboBox(), LayoutHelper.getGBC(2, 0, 1, 0.0D, DisplayUtils.getScaledInsets(5, 5, 5, 5))); ajaxSpiderPanel.add(new JLabel(""), LayoutHelper.getGBC(3, 0, 1, 1.0D, DisplayUtils.getScaledInsets(5, 5, 5, 5))); ajaxSpiderPanel.add(Box.createHorizontalGlue()); return ajaxSpiderPanel; }

Target:
public JPanel getPanel() { if (panel == null) { panel = new JPanel(new GridBagLayout()); panel.setBackground(Color.WHITE); panel.add(getSelectCheckBox(), LayoutHelper.getGBC(0, 0, 1, 0.0D, DisplayUtils.getScaledInsets(5, 5, 5, 5))); panel.add(new JLabel(Constant.messages.getString("quickstart.label.withbrowser")), LayoutHelper.getGBC(1, 0, 1, 0.0D, DisplayUtils.getScaledInsets(5, 5, 5, 5))); panel.add(getBrowserComboBox(), LayoutHelper.getGBC(2, 0, 1, 0.0D, DisplayUtils.getScaledInsets(5, 5, 5, 5))); panel.add(new JLabel(""), LayoutHelper.getGBC(3, 0, 1, 1.0D, DisplayUtils.getScaledInsets(5, 5, 5, 5))); panel.add(Box.createHorizontalGlue()); } return panel; }
Source:
private static List<AvailableService> getAvailableServiceBy(EndpointType endpoint) { List<AvailableService> services = new ArrayList<>(); if (null != endpoint) { for (String serviceName : endpoint.getName()) { for (EndpointConfigurationType url : getEndpointConfigurationTypeBy(endpoint)) { if (url != null) { AvailableService aService = new AvailableService(); aService.setServiceName(MessageFormat.format("{0} - {1}", serviceName, url.getVersion())); aService.setAvailable(PING_SERVICE.ping(url.getUrl())); services.add(aService); } } } } return services; }

Target:
private static List<AvailableService> getAvailableServiceBy(EndpointType endpoint) { List<AvailableService> services = new ArrayList<>(); if (null != endpoint) { for (String serviceName : endpoint.getName()) { for (EndpointConfigurationType url : getEndpointConfigurationTypeBy(endpoint)) { AvailableService aService = new AvailableService(); aService.setServiceName(MessageFormat.format("{0} - {1}", serviceName, url.getVersion())); aService.setAvailable(PING_SERVICE.ping(url.getUrl())); services.add(aService); } } } return services; }
Source:
protected void setupQueue() throws IOException { if (queueName != null) { channel.queueDeclare(queueName, true, false, false, null); } }

Target:
protected void setupQueue() throws IOException { if (queueName != null) { Util.declareQueueDefaults(channel, queueName); } }