auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testSerde() throws Exception { WorkerBehaviorConfig config = new WorkerBehaviorConfig( new FillCapacityWithAffinityWorkerSelectStrategy( new FillCapacityWithAffinityConfig( ImmutableMap.of("foo", Arrays.asList("localhost")) ) ), new EC2AutoScaler( 7, 11, new EC2EnvironmentConfig( "us-east-1", "us-east-1a", new EC2NodeData( "amiid", "instanceType", 3, 5, Arrays.asList("securityGroupIds"), "keyNames", "subnetId", null, null ), new StringEC2UserData( "availZone", "replace", "version" ) ), null, null ) ); final ObjectMapper mapper = new DefaultObjectMapper(); mapper.setInjectableValues( new InjectableValues() { @Override public Object findInjectableValue( Object valueId, DeserializationContext ctxt, BeanProperty forProperty, Object beanInstance ) { return null; } } ); Assert.assertEquals(config, mapper.readValue(mapper.writeValueAsBytes(config), WorkerBehaviorConfig.class)); }

Target:
public void testSerde() throws Exception { WorkerBehaviorConfig config = new WorkerBehaviorConfig( new FillCapacityWithAffinityWorkerSelectStrategy( new FillCapacityWithAffinityConfig( ImmutableMap.of("foo", Arrays.asList("localhost")) ) ), new EC2AutoScaler( 7, 11, new EC2EnvironmentConfig( "us-east-1a", new EC2NodeData( "amiid", "instanceType", 3, 5, Arrays.asList("securityGroupIds"), "keyNames", "subnetId", null, null ), new StringEC2UserData( "availZone", "replace", "version" ) ), null, null ) ); final ObjectMapper mapper = new DefaultObjectMapper(); mapper.setInjectableValues( new InjectableValues() { @Override public Object findInjectableValue( Object valueId, DeserializationContext ctxt, BeanProperty forProperty, Object beanInstance ) { return null; } } ); Assert.assertEquals(config, mapper.readValue(mapper.writeValueAsBytes(config), WorkerBehaviorConfig.class)); }
Source:
public String toSubscribeMessage() { String msg = super.toSubscribeMessage(); storeMyUserId(channelData); return msg; }

Target:
public String toSubscribeMessage() { String msg = super.toSubscribeMessage(); myUserID = extractUserIdFromChannelData(channelData); return msg; }
Source:
protected void eventHandle(@NonNull ITmfEvent event) { ITmfStateSystemBuilder ss = getStateSystemBuilder(); if (ss == null) { return; } int rootGroupedQuark = ss.getQuarkAbsoluteAndAdd(CounterAnalysis.GROUPED_COUNTER_ASPECTS_ATTRIB); for (GroupedCounterAspect aspect : fGroupedCounterAspects) { handleCounterAspect(event, ss, aspect, rootGroupedQuark); } int rootUngroupedQuark = ss.getQuarkAbsoluteAndAdd(CounterAnalysis.UNGROUPED_COUNTER_ASPECTS_ATTRIB); for (ITmfCounterAspect aspect : fUngroupedCounterAspects) { handleCounterAspect(event, ss, aspect, rootUngroupedQuark); } }

Target:
protected void eventHandle(@NonNull ITmfEvent event) { ITmfStateSystemBuilder ss = getStateSystemBuilder(); if (ss == null) { return; } int rootGroupedQuark = ss.getQuarkAbsoluteAndAdd(CounterAnalysis.GROUPED_COUNTER_ASPECTS_ATTRIB); for (GroupedCounterAspect aspect : fGroupedCounterAspects) { handleGroupedCounterAspect(event, ss, aspect, rootGroupedQuark); } int rootUngroupedQuark = ss.getQuarkAbsoluteAndAdd(CounterAnalysis.UNGROUPED_COUNTER_ASPECTS_ATTRIB); for (ITmfCounterAspect aspect : fUngroupedCounterAspects) { handleCounterAspect(event, ss, aspect, rootUngroupedQuark); } }
Source:
protected AddDiskParameters buildAddDiskParameters(DiskImage image, boolean isBoot) { image.setDiskAlias(renameDiskAlias(getVm().getOrigin(), image.getDiskAlias())); AddDiskParameters diskParameters = new AddDiskParameters(new DiskVmElement(null, getVmId()), image); diskParameters.setStorageDomainId(getStorageDomainId()); diskParameters.setParentCommand(getActionType()); diskParameters.setParentParameters(getParameters()); diskParameters.setShouldRemainIllegalOnFailedExecution(true); diskParameters.setStorageDomainId(getParameters().getDestDomainId()); DiskVmElement dve = image.getDiskVmElementForVm(getVmId()) != null ? image.getDiskVmElementForVm(getVmId()) : new DiskVmElement(image.getId(), getVmId()); if (dve.getDiskInterface() == null || getVm().getOrigin() != OriginType.KVM ) { dve.setDiskInterface(DiskInterface.VirtIO); } dve.setBoot(isBoot); diskParameters.setDiskVmElement(dve); return diskParameters; }

Target:
protected AddDiskParameters buildAddDiskParameters(DiskImage image, boolean isBoot) { image.setDiskAlias(renameDiskAlias(getVm().getOrigin(), image.getDiskAlias())); AddDiskParameters diskParameters = new AddDiskParameters(new DiskVmElement(null, getVmId()), image); diskParameters.setStorageDomainId(getStorageDomainId()); diskParameters.setParentCommand(getActionType()); diskParameters.setParentParameters(getParameters()); diskParameters.setShouldRemainIllegalOnFailedExecution(true); diskParameters.setStorageDomainId(getParameters().getDestDomainId()); DiskVmElement dve = image.getDiskVmElementForVm(getVmId()); if (getVm().getOrigin() != OriginType.KVM ) { dve.setDiskInterface(DiskInterface.VirtIO); } dve.setBoot(isBoot); diskParameters.setDiskVmElement(dve); return diskParameters; }
Source:
public void unsubscribe() { if (this.transport != null) { transport.unsubscribe(); } }

Target:
public void unsubscribe() { if (transport != null) { transport.unsubscribe(); } }
Source:
public void connect() { session = new CqlSessionBuilder().build(); System.out.printf("Connected session: %s%n", session.getName()); }

Target:
public void connect() { session = CqlSession.builder().build(); System.out.printf("Connected session: %s%n", session.getName()); }
Source:
public void run(final ActionContext context) throws Exception { Connection connection = new Connection(config.host); try { try { connection.connect(); } catch (IOException e) { throw new IOException(String.format("Attempt to connect to host %s failed", config.host)); } String password = Strings.isNullOrEmpty(config.password) ? null : config.password; if (!connection.authenticateWithPublicKey(config.user, new File(config.privateKeyFile), password)) { throw new IOException(String.format("SSH authentication error when connecting to %s@%s on port %d", config.user, config.host, config.port)); } LOG.debug("Connection established with the host {}", config.host); Session session = connection.openSession(); try { session.execCommand(config.command); } catch (IOException e) { throw new IOException(String.format("Exception thrown while executing command: %s", e.getMessage())); } InputStream stdout = new StreamGobbler(session.getStdout()); BufferedReader outBuffer = new BufferedReader(new InputStreamReader(stdout, Charsets.UTF_8)); InputStream stderr = new StreamGobbler(session.getStderr()); BufferedReader errBuffer = new BufferedReader(new InputStreamReader(stderr, Charsets.UTF_8)); String out = CharStreams.toString(outBuffer); String err = CharStreams.toString(errBuffer); LOG.debug("Output: {}", out); LOG.error("Errors: {}", err); Integer exitCode = session.getExitStatus(); if (exitCode != null && exitCode > 0) { throw new IOException(String.format("Error: command finished with exit code: %d", exitCode)); } if (config.output != null) { context.getArguments().set(config.output, out.replaceAll("\\s+$", "")); } } finally { connection.close(); } }

Target:
public void run(final ActionContext context) throws Exception { Connection connection = new Connection(config.host); try { connection.connect(); String password = Strings.isNullOrEmpty(config.password) ? null : config.password; if (!connection.authenticateWithPublicKey(config.user, new File(config.privateKeyFile), password)) { throw new IOException(String.format("SSH authentication error when connecting to %s@%s on port %d", config.user, config.host, config.port)); } LOG.debug("Connection established with the host {}", config.host); Session session = connection.openSession(); session.execCommand(config.command); InputStream stdout = new StreamGobbler(session.getStdout()); BufferedReader outBuffer = new BufferedReader(new InputStreamReader(stdout, Charsets.UTF_8)); InputStream stderr = new StreamGobbler(session.getStderr()); BufferedReader errBuffer = new BufferedReader(new InputStreamReader(stderr, Charsets.UTF_8)); String out = CharStreams.toString(outBuffer); String err = CharStreams.toString(errBuffer); LOG.debug("Output: {}", out); LOG.error("Errors: {}", err); Integer exitCode = session.getExitStatus(); if (exitCode != null && exitCode != 0) { throw new IOException(String.format("Error: command %s running on hostname %s finished with exit code: %d", config.command, config.host, exitCode)); } if (config.output != null) { out = out.endsWith("\n") ? out.substring(0, out.length() - 1) : out; context.getArguments().set(config.output, out); } } finally { connection.close(); } }
Source:
private void invokeServlet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.setHeader("Strict-Transport-Security", "max-age=31536000"); log.info("Request received: [" + req.getMethod() + "] " + req.getRequestURL().toString() + ": " + HttpRequestHelper.getRequestParametersAsString(req)); log.info("User agent: " + req.getHeader("User-Agent")); Action action; try { action = new ActionFactory().getAction(req); } catch (ActionMappingException e) { throwError(resp, e.getStatusCode(), e.getMessage()); return; } boolean passAccessControlCheck = action.checkAccessControl(); if (!passAccessControlCheck) { throwError(resp, 403, "Not authorized to access this resource."); return; } try { ActionResult result = action.execute(resp); result.send(resp); } catch (Throwable t) { throwError(resp, 500, t.getMessage()); } }

Target:
private void invokeServlet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.setHeader("Strict-Transport-Security", "max-age=31536000"); @SuppressWarnings("PMD.PrematureDeclaration") long startTime = System.currentTimeMillis(); log.info("Request received: [" + req.getMethod() + "] " + req.getRequestURL().toString() + ", Params: " + HttpRequestHelper.getRequestParametersAsString(req) + ", Headers: " + HttpRequestHelper.getRequestHeadersAsString(req)); Action action; try { action = new ActionFactory().getAction(req); } catch (ActionMappingException e) { throwError(resp, e.getStatusCode(), e.getMessage()); return; } boolean passAccessControlCheck = action.checkAccessControl(); if (!passAccessControlCheck) { throwError(resp, 403, "Not authorized to access this resource."); return; } try { ActionResult result = action.execute(resp); result.send(resp); long timeTaken = System.currentTimeMillis() - startTime; log.info(action.getLogMessage() + "|||" + timeTaken); } catch (Throwable t) { throwError(resp, 500, t.getMessage()); } }
Source:
public static Project getByName(String name) { RuntimeEnvironment env = RuntimeEnvironment.getInstance(); if (env.hasProjects()) { for (Project proj : env.getProjects()) { if (name.equals(proj.getName())) { return (proj); } } } return null; }

Target:
public static Project getByName(String name) { RuntimeEnvironment env = RuntimeEnvironment.getInstance(); if (env.hasProjects()) { Project proj; if ((proj = env.getProjects().get(name)) != null) { return (proj); } } return null; }
Source:
public double median(String colName) { double[] colArray = toDoubleArray(colName); double arrayMedian = StatUtils.percentile(colArray, 50); return arrayMedian; }

Target:
public double median(String colName) { return StatUtils.percentile(toDoubleArray(colName), 50); }
Source:
public void exportDescription(Class<? extends Configuration> description) { if (descriptionExported) return; for (Annotation annotaion : description.getAnnotations()) { if (annotaion instanceof GroupContainer) { for (Annotation group : ((GroupContainer) annotaion).value()) { exportGroup((Group) group); } } else if (annotaion instanceof Group) { exportGroup((Group) annotaion); } else if (annotaion instanceof Runtime) { exportRuntimeType((Runtime) annotaion); } else { warningList.add("Only Group and Runtime annotations are allowed to use."); } } if (!runtimeTypeIsPresent) { warningList.add("You haven't sepcified the runtime type!\n " + "The default runtime type is: MultiThreadedRT"); runtime = RuntimeType.THREADED; } exportDefaultConfiguration(); descriptionExported = true; }

Target:
public void exportDescription(Class<? extends Configuration> description) { if (descriptionExported) return; for (Annotation annotaion : description.getAnnotations()) { if (annotaion instanceof GroupContainer) { for (Annotation group : ((GroupContainer) annotaion).value()) { exportGroup((Group) group); } } else if (annotaion instanceof Group) { exportGroup((Group) annotaion); } else if (annotaion instanceof Runtime) { exportRuntimeType((Runtime) annotaion); } else { warningList.add("Only Group and Runtime annotations are allowed to use."); } } if (!runtimeTypeIsPresent) { warningList.add("You haven't specified the runtime type!\n " + "The default runtime type is: MultiThreadedRT"); runtime = RuntimeType.THREADED; } exportDefaultConfiguration(); descriptionExported = true; }
Source:
public static AnalyzeRequest map(com.azure.search.documents.implementation.models.AnalyzeRequest obj) { if (obj == null) { return null; } AnalyzeRequest analyzeRequest = new AnalyzeRequest(); if (obj.getCharFilters() != null) { List<CharFilterName> _charFilters = obj.getCharFilters().stream().map(CharFilterNameConverter::map).collect(Collectors.toList()); analyzeRequest.setCharFilters(_charFilters); } if (obj.getAnalyzer() != null) { LexicalAnalyzerName _analyzer = LexicalAnalyzerNameConverter.map(obj.getAnalyzer()); analyzeRequest.setAnalyzer(_analyzer); } if (obj.getTokenFilters() != null) { List<TokenFilterName> _tokenFilters = obj.getTokenFilters().stream().map(TokenFilterNameConverter::map).collect(Collectors.toList()); analyzeRequest.setTokenFilters(_tokenFilters); } String _text = obj.getText(); analyzeRequest.setText(_text); if (obj.getTokenizer() != null) { LexicalTokenizerName _tokenizer = LexicalTokenizerNameConverter.map(obj.getTokenizer()); analyzeRequest.setTokenizer(_tokenizer); } return analyzeRequest; }

Target:
public static AnalyzeRequest map(com.azure.search.documents.implementation.models.AnalyzeRequest obj) { if (obj == null) { return null; } AnalyzeRequest analyzeRequest = new AnalyzeRequest(); if (obj.getCharFilters() != null) { List<CharFilterName> charFilters = obj.getCharFilters().stream().map(CharFilterNameConverter::map).collect(Collectors.toList()); analyzeRequest.setCharFilters(charFilters); } if (obj.getAnalyzer() != null) { LexicalAnalyzerName analyzer = LexicalAnalyzerNameConverter.map(obj.getAnalyzer()); analyzeRequest.setAnalyzer(analyzer); } if (obj.getTokenFilters() != null) { List<TokenFilterName> tokenFilters = obj.getTokenFilters().stream().map(TokenFilterNameConverter::map).collect(Collectors.toList()); analyzeRequest.setTokenFilters(tokenFilters); } String text = obj.getText(); analyzeRequest.setText(text); if (obj.getTokenizer() != null) { LexicalTokenizerName tokenizer = LexicalTokenizerNameConverter.map(obj.getTokenizer()); analyzeRequest.setTokenizer(tokenizer); } return analyzeRequest; }
Source:
public String getLastLoginIpAddress() { return lastLoginIpAddress; }

Target:
public Optional<String> getLastLoginIpAddress() { return Optional.ofNullable(lastLoginIpAddress); }
Source:
public void stateUpdated(Item item, State state) { if (exposedItems != null && exposedItems.contains(item.getName())) { logger.debug("Sending item update to openhab Cloud: - {}", item.getName(), state.toString()); cloudClient.sendItemUpdate(item.getName(), state.toString()); } }

Target:
public void stateUpdated(Item item, State state) { if (exposedItems != null && exposedItems.contains(item.getName())) { logger.debug("Sending item update to openhab Cloud: - {}", item.getName(), state); cloudClient.sendItemUpdate(item.getName(), state.toString()); } }
Source:
public void testTimeToDeleteFalse() { HostAndPort address = HostAndPort.fromString("tserver1:9998"); long wait = AccumuloConfiguration.getTimeInMillis("1h"); long t1, t2; boolean ttd; do { t1 = System.nanoTime(); gcwal.clearFirstSeenDead(); gcwal.timeToDelete(address, wait); ttd = gcwal.timeToDelete(address, wait); t2 = System.nanoTime(); } while (t2 - t1 > (wait / 2) * 1000000); assertFalse(gcwal.timeToDelete(address, wait)); }

Target:
public void testTimeToDeleteFalse() { HostAndPort address = HostAndPort.fromString("tserver1:9998"); long wait = AccumuloConfiguration.getTimeInMillis("1h"); long t1, t2; boolean ttd; do { t1 = System.nanoTime(); gcwal.clearFirstSeenDead(); assertFalse("First call should be false and should store the first seen time", gcwal.timeToDelete(address, wait)); ttd = gcwal.timeToDelete(address, wait); t2 = System.nanoTime(); } while (TimeUnit.NANOSECONDS.toMillis(t2 - t1) > (wait / 2)); assertFalse(ttd); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_javaservices_directions); mapView = findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(@NonNull MapboxMap mapboxMap) { DirectionsActivity.this.mapboxMap = mapboxMap; mapboxMap.setStyle(Style.MAPBOX_STREETS, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { origin = Point.fromLngLat(-3.588098, 37.176164); destination = Point.fromLngLat(-3.601845, 37.184080); initSource(style); initLayers(style); getRoute(origin, destination); } }); } }); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_javaservices_directions); mapView = findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(@NonNull MapboxMap mapboxMap) { mapboxMap.setStyle(Style.MAPBOX_STREETS, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { origin = Point.fromLngLat(-3.588098, 37.176164); destination = Point.fromLngLat(-3.601845, 37.184080); initSource(style); initLayers(style); getRoute(mapboxMap, origin, destination); } }); } }); }
Source:
public void validateJmxMetrics() throws Exception { MetricsRegistry metricsRegistry = new MetricsRegistryMap(); CoordinatorStreamStore coordinatorStreamStore = new CoordinatorStreamStore(config, metricsRegistry); coordinatorStreamStore.init(); try { LocalityManager localityManager = new LocalityManager(new NamespaceAwareCoordinatorStreamStore(coordinatorStreamStore, SetConfig.TYPE)); validator.init(config); LocalityModel localityModel = localityManager.readLocality(); for (ContainerLocality containerLocality : localityModel.getContainerLocalities().values()) { String containerId = containerLocality.id(); String jmxUrl = containerLocality.jmxTunnelingUrl(); if (StringUtils.isNotBlank(jmxUrl)) { log.info("validate container " + containerId + " metrics with JMX: " + jmxUrl); JmxMetricsAccessor jmxMetrics = new JmxMetricsAccessor(jmxUrl); jmxMetrics.connect(); validator.validate(jmxMetrics); jmxMetrics.close(); log.info("validate container " + containerId + " successfully"); } } validator.complete(); } finally { coordinatorStreamStore.close(); } }

Target:
public void validateJmxMetrics() throws Exception { MetricsRegistry metricsRegistry = new MetricsRegistryMap(); CoordinatorStreamStore coordinatorStreamStore = new CoordinatorStreamStore(config, metricsRegistry); coordinatorStreamStore.init(); try { LocalityManager localityManager = new LocalityManager(new NamespaceAwareCoordinatorStreamStore(coordinatorStreamStore, SetConfig.TYPE)); validator.init(config); LocalityModel localityModel = localityManager.readLocality(); for (ProcessorLocality processorLocality : localityModel.getProcessorLocalities().values()) { String containerId = processorLocality.id(); String jmxUrl = processorLocality.jmxTunnelingUrl(); if (StringUtils.isNotBlank(jmxUrl)) { log.info("validate container " + containerId + " metrics with JMX: " + jmxUrl); JmxMetricsAccessor jmxMetrics = new JmxMetricsAccessor(jmxUrl); jmxMetrics.connect(); validator.validate(jmxMetrics); jmxMetrics.close(); log.info("validate container " + containerId + " successfully"); } } validator.complete(); } finally { coordinatorStreamStore.close(); } }
Source:
public int getLatestPacketFailRate() { int failure = 0; int sent = 0; int received = 0; int size = mTcpStats.size(); for (int i = 0; i < size; i++) { final long key = mTcpStats.keyAt(i); failure += (mTcpStats.get(key).lostCount + mTcpStats.get(key).retransmitCount); sent += mTcpStats.get(key).sentCount; received += mTcpStats.get(key).receivedCount; } updateSentSinceLastRecv(sent, received); if (getSentSinceLastRecv() < getMinPacketsThreshold()) return 0; int rate = ((sent != 0) ? (failure * 100 / sent) : 0); log("getLatestPacketFailRate:" + rate); return rate; }

Target:
public int getLatestPacketFailRate() { int failure = 0; int sent = 0; int received = 0; int size = mTcpStats.size(); for (int i = 0; i < size; i++) { final long key = mTcpStats.keyAt(i); failure += (mTcpStats.get(key).lostCount + mTcpStats.get(key).retransmitCount); sent += mTcpStats.get(key).sentCount; received += mTcpStats.get(key).receivedCount; } updateSentSinceLastRecv(sent, received); if (getSentSinceLastRecv() < getMinPacketsThreshold()) return 0; final int rate = ((sent != 0) ? (failure * 100 / sent) : 0); log("getLatestPacketFailRate:" + rate); return rate; }
Source:
public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException { final MutableValueInt inspected = new MutableValueInt(); return new ConstantScoreWeight(this) { @Override public Scorer scorer(final LeafReaderContext context) throws IOException { int remaining = settings.getMaxInspect() - inspected.value; if(remaining < 0) { remaining = 0; } int maxDoc = remaining > context.reader().maxDoc() ? context.reader().maxDoc() : remaining; final DocIdSetIterator approximation = DocIdSetIterator.all(maxDoc); return new ConstantScoreScorer(this, 1f, new RegexTwoPhaseIterator(approximation, context, inspected)); } }; }

Target:
public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException { return new ConstantScoreWeight(this) { private final MutableValueInt inspected = new MutableValueInt(); @Override public Scorer scorer(final LeafReaderContext context) throws IOException { int remaining = settings.getMaxInspect() - inspected.value; if(remaining < 0) { remaining = 0; } int maxDoc = remaining > context.reader().maxDoc() ? context.reader().maxDoc() : remaining; final DocIdSetIterator approximation = DocIdSetIterator.all(maxDoc); return new ConstantScoreScorer(this, 1f, new RegexTwoPhaseIterator(approximation, context, inspected)); } }; }
Source:
private void setupAttribution() { Page page = parentFragment.getPage(); pageLicenseText.setText(Html.fromHtml(activity.getString(R.string.content_license_html))); pageLicenseText.setMovementMethod(new LinkMovementMethodExt(linkHandler)); if (page.isMainPage() || page.isFilePage()) { pageLastUpdatedText.setVisibility(View.GONE); } else { String lastUpdatedHtml = "<a href=\"" + page.getTitle().getUriForAction("history") + "\">" + activity.getString(R.string.last_updated_text, formatDateRelative(page.getPageProperties().getLastModified()) + "</a>"); String discussionHtml = "<a href=\"" + page.getTitle().getPrefixedUri("Talk") + "\">" + activity.getString(R.string.talk_page_link_text) + "</a>"; pageLastUpdatedText.setText(Html.fromHtml(lastUpdatedHtml + " &mdash; " + discussionHtml)); pageLastUpdatedText.setMovementMethod(new LinkMovementMethodExt(linkHandler)); pageLastUpdatedText.setVisibility(View.VISIBLE); } }

Target:
private void setupAttribution() { Page page = parentFragment.getPage(); pageLicenseText.setText(Html.fromHtml(activity.getString(R.string.content_license_html))); pageLicenseText.setMovementMethod(new LinkMovementMethodExt(linkHandler)); if (page.isMainPage() || page.isFilePage()) { pageLastUpdatedText.setVisibility(View.GONE); } else { PageTitle title = page.getTitle(); String lastUpdatedHtml = "<a href=\"" + title.getUriForAction("history") + "\">" + activity.getString(R.string.last_updated_text, formatDateRelative(page.getPageProperties().getLastModified()) + "</a>"); PageTitle talkPageTitle = new PageTitle("Talk", title.getPrefixedText(), title.getSite()); String discussionHtml = "<a href=\"" + talkPageTitle.getCanonicalUri() + "\">" + activity.getString(R.string.talk_page_link_text) + "</a>"; pageLastUpdatedText.setText(Html.fromHtml(lastUpdatedHtml + " &mdash; " + discussionHtml)); pageLastUpdatedText.setMovementMethod(new LinkMovementMethodExt(linkHandler)); pageLastUpdatedText.setVisibility(View.VISIBLE); } }
Source:
public void testSetContentFromFile() throws Exception { TestHttpData test = new TestHttpData("test", UTF_8, 0); File tmpFile = File.createTempFile(UUID.randomUUID().toString(), ".tmp"); tmpFile.deleteOnExit(); FileOutputStream fos = new FileOutputStream(tmpFile); byte[] bytes = new byte[4096]; ThreadLocalRandom.current().nextBytes(bytes); try { fos.write(bytes); fos.flush(); } finally { fos.close(); } test.setContent(tmpFile); ByteBuf buf = test.getByteBuf(); assertEquals(buf.readerIndex(), 0); assertEquals(buf.writerIndex(), bytes.length); assertArrayEquals(bytes, test.get()); assertArrayEquals(bytes, ByteBufUtil.getBytes(buf)); }

Target:
public void testSetContentFromFile() throws Exception { TestHttpData test = new TestHttpData("test", UTF_8, 0); try { File tmpFile = File.createTempFile(UUID.randomUUID().toString(), ".tmp"); tmpFile.deleteOnExit(); FileOutputStream fos = new FileOutputStream(tmpFile); byte[] bytes = new byte[4096]; PlatformDependent.threadLocalRandom().nextBytes(bytes); try { fos.write(bytes); fos.flush(); } finally { fos.close(); } test.setContent(tmpFile); ByteBuf buf = test.getByteBuf(); assertEquals(buf.readerIndex(), 0); assertEquals(buf.writerIndex(), bytes.length); assertArrayEquals(bytes, test.get()); assertArrayEquals(bytes, ByteBufUtil.getBytes(buf)); } finally { test.delete(); } }
Source:
public void setWebClient(WebClient webClient){ Assert.notNull(webClient, "Custom WebClient must not be null"); this.webClient = webClient; }

Target:
public void setWebClient(WebClient webClient){ Assert.notNull(webClient, "webClient cannot be null"); this.webClient = webClient; }
Source:
String getEndpointURLForService(String serviceName) { String endpointURL = null; try { endpointURL = invokeConnectionManager(serviceName); LOG.debug("Retrieved endpoint URL for service " + serviceName + ": " + endpointURL); } catch (ConnectionManagerException ex) { LOG.error( "Error getting url for " + serviceName + " from the connection manager. Error: " + ex.getMessage(), ex); } return endpointURL; }

Target:
String getEndpointURLForService(String serviceName) { String endpointURL = null; try { endpointURL = invokeConnectionManager(serviceName); LOG.debug("Retrieved endpoint URL: for service : ", endpointURL, serviceName); } catch (ConnectionManagerException ex) { LOG.error( "Error getting url for : from the connection manager. Error: {}" , serviceName, ex.getMessage(), ex); } return endpointURL; }
Source:
private void configureParameterServiceForSuspensionCheck(Boolean value) { Mockito.when(parameterService.getParameterValueAsBoolean(ArConstants.AR_NAMESPACE_CODE, ArConstants.CONTRACTS_GRANTS_INVOICE_COMPONENT, CuArConstants.CG_INVOICE_AMT_BILLED_SUSPENSION_BY_BUDGET_TOTAL, Boolean.TRUE.booleanValue())).thenReturn(value); suspensionCategory.setParameterService(parameterService); }

Target:
private void configureParameterServiceForSuspensionCheck(Boolean value) { Mockito.when(parameterService.getParameterValueAsBoolean(ArConstants.AR_NAMESPACE_CODE, ArConstants.CONTRACTS_GRANTS_INVOICE_COMPONENT, CuArConstants.CG_INVOICE_AMT_BILLED_SUSPENSION_BY_BUDGET_TOTAL, Boolean.TRUE)).thenReturn(value); suspensionCategory.setParameterService(parameterService); }
Source:
public final Optional<U> getUserProfile(final C credentials, final WebContext context) { init(); logger.debug("credentials : {}", credentials); if (credentials == null) { return Optional.empty(); } U profile = retrieveUserProfile(credentials, context); if (profile != null) { profile.setClientName(getName()); if (this.authorizationGenerators != null) { for (AuthorizationGenerator<U> authorizationGenerator : this.authorizationGenerators) { profile = authorizationGenerator.generate(context, profile); } } } return Optional.of(profile); }

Target:
public final Optional<U> getUserProfile(final C credentials, final WebContext context) { init(); logger.debug("credentials : {}", credentials); if (credentials == null) { return Optional.empty(); } Optional<U> profile = retrieveUserProfile(credentials, context); if (profile.isPresent()) { profile.get().setClientName(getName()); if (this.authorizationGenerators != null) { for (AuthorizationGenerator<U> authorizationGenerator : this.authorizationGenerators) { profile = Optional.of( authorizationGenerator.generate(context, profile.get()) ); } } } return profile; }
Source:
public static Builder newBuilder( AwsSecurityCredentials awsSecurityCredentials, String httpMethod, String url, String region) { return new Builder(awsSecurityCredentials, httpMethod, url, region); }

Target:
static Builder newBuilder( AwsSecurityCredentials awsSecurityCredentials, String httpMethod, String url, String region) { return new Builder(awsSecurityCredentials, httpMethod, url, region); }
Source:
void changePos(int delta) { this.pos += delta; }

Target:
void changePos(int delta) { int newPos = this.pos + delta; if (newPos < 0 || newPos > this.buf.length) { throw new IllegalArgumentException("New position not in buffer pos=" + this.pos + ", delta=" + delta); } this.pos = newPos; }
Source:
public boolean getRequiredSignatures() throws IOException { return requester().method("GET").withUrlPath(url + REQUIRE_SIGNATURES_URI).to(RequiredSignatures.class).enabled; }

Target:
public boolean getRequiredSignatures() throws IOException { return requester().withUrlPath(url + REQUIRE_SIGNATURES_URI).fetch(RequiredSignatures.class).enabled; }
Source:
public void stop() { if (isStarted()) { transportFactory.destroy(); asyncExecutorService.shutdownNow(); listenerNotifier.stop(); } started = false; }

Target:
public void stop() { if (isStarted()) { listenerNotifier.stop(); transportFactory.destroy(); asyncExecutorService.shutdownNow(); } started = false; }
Source:
@Test public void testFilterAndSortWithTrim() { Tester tester = new TesterImpl(getDiffRepos(), false, true, true, false, null, null) { @Override public RelOptPlanner createPlanner() { return new MockRelOptPlanner(Contexts.empty()) { @Override public List<RelTraitDef> getRelTraitDefs() { return ImmutableList.<RelTraitDef>of(RelCollationTraitDef.INSTANCE); } @Override public RelTraitSet emptyTraitSet() { return RelTraitSet.createEmpty().plus( RelCollationTraitDef.INSTANCE.getDefault()); } }; } }; final String sql = "select count(a.EMPNO)\n" + "from (select * from emp order by sal limit 3) a\n" + "where a.EMPNO > 10 group by 2"; RelNode afterTrim = tester.convertSqlToRel(sql).rel; final List<RelNode> rels = new ArrayList<>(); final RelShuttleImpl visitor = new RelShuttleImpl() { @Override public RelNode visit(LogicalSort sort) { rels.add(sort); return super.visit(sort); } @Override public RelNode visit(LogicalFilter filter) { rels.add(filter); return super.visit(filter); } }; visitor.visit(afterTrim); assert rels.size() == 2; RelTrait filterCollation = rels.get(0).getTraitSet() .getTrait(RelCollationTraitDef.INSTANCE); RelTrait sortCollation = rels.get(1).getTraitSet() .getTrait(RelCollationTraitDef.INSTANCE); assert filterCollation.satisfies(sortCollation); }

Target:
@Test public void testFilterAndSortWithTrim() { Tester tester = new TesterImpl(getDiffRepos(), false, true, true, false, null, null) { @Override public RelOptPlanner createPlanner() { return new MockRelOptPlanner(Contexts.empty()) { @Override public List<RelTraitDef> getRelTraitDefs() { return ImmutableList.<RelTraitDef>of(RelCollationTraitDef.INSTANCE); } @Override public RelTraitSet emptyTraitSet() { return RelTraitSet.createEmpty().plus( RelCollationTraitDef.INSTANCE.getDefault()); } }; } }; final String sql = "select count(a.EMPNO)\n" + "from (select * from emp order by sal limit 3) a\n" + "where a.EMPNO > 10 group by 2"; RelNode afterTrim = tester.convertSqlToRel(sql).rel; final List<RelNode> rels = new ArrayList<>(); final RelShuttleImpl visitor = new RelShuttleImpl() { @Override public RelNode visit(LogicalSort sort) { rels.add(sort); return super.visit(sort); } @Override public RelNode visit(LogicalFilter filter) { rels.add(filter); return super.visit(filter); } }; visitor.visit(afterTrim); assertThat(rels.size(), is(2)); RelTrait filterCollation = rels.get(0).getTraitSet() .getTrait(RelCollationTraitDef.INSTANCE); RelTrait sortCollation = rels.get(1).getTraitSet() .getTrait(RelCollationTraitDef.INSTANCE); assertTrue(filterCollation.satisfies(sortCollation)); }
Source:
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { String filesStudyIdField = String.format("%s.%s", FILES_FIELD, STUDYID_FIELD); Query query = new Query( new Criteria(filesStudyIdField).is(inputParameters.getStudyId()) .and(FILES_FIELD).size(1)); logger.info("removing single study variants. used query: {}", query); WriteResult writeResult = mongoOperations.remove(query, dbParameters.getCollectionVariantsName()); logger.info("result: {}", writeResult.toString()); return RepeatStatus.FINISHED; }

Target:
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { String filesStudyIdField = String.format("%s.%s", FILES_FIELD, STUDYID_FIELD); Query query = new Query( new Criteria(filesStudyIdField).is(inputParameters.getStudyId()) .and(FILES_FIELD).size(1)); logger.info("Deleting variants reported only in study {}", inputParameters.getStudyId()); logger.trace("Query used: {}", query); WriteResult writeResult = mongoOperations.remove(query, dbParameters.getCollectionVariantsName()); logger.info("Result: {}", writeResult.toString()); return RepeatStatus.FINISHED; }
Source:
public synchronized boolean next(LongWritable key, Text value) { while (true) { int bytes = readLine(value); if (bytes > 0) { recordsFromS3++; } else { return false; } if (recordsFromS3 > processedRecords) { pos += bytes; processedRecords++; key.set(processedRecords); return true; } else { value.clear(); } } }

Target:
public synchronized boolean next(LongWritable key, Text value) throws IOException { while (true) { int bytes = readLine(value); if (bytes <= 0) { if (!selectClient.isRequestComplete()) { throw new RuntimeException("S3 Select request was incomplete as End Event was not received."); } return false; } if (++recordsFromS3 > processedRecords) { position += bytes; processedRecords++; key.set(processedRecords); return true; } } }
Source:
public void botVSPlayer() { int size = tiles.size(); int pairs = size / 2; int mode = (int) Math.sqrt(size); GameState.setPairs(pairs); GameState.setGameState(0); for (int i = 0; i < mode; i++) { for (int j = 0; j < mode; j++) { int n = i; int m = j; massiveTiles[i][j].setOnMouseClicked(event -> { if (GameState.getGameState() == 0) { if (massiveTiles[n][m].isSelected() || event.getClickCount() > 1 || !event.isStillSincePress()) { return; } if (firstselected == null) { firstselected = massiveTiles[n][m]; massiveTiles[n][m].open(() -> { }); } else { massiveTiles[n][m].open(() -> { if (!massiveTiles[n][m].hasSameValue(firstselected)) { firstselected.close(); massiveTiles[n][m].close(); } else { firstselected.setOpen(); massiveTiles[n][m].setOpen(); } GameState.setGameState(1); BotHod(); firstselected = null; secondselected = null; }); } } }); } } }

Target:
public void botVSPlayer() { int size = tiles.size(); int pairs = size / 2; int mode = (int) Math.sqrt(size); GameState.setPairs(pairs); GameState.setBotMode(BOT_OFF); for (int i = 0; i < mode; i++) { for (int j = 0; j < mode; j++) { int n = i; int m = j; massiveTiles[i][j].setOnMouseClicked(event -> { if (GameState.getBotMode() == BOT_OFF) { if (massiveTiles[n][m].isSelected() || event.getClickCount() > 1 || !event.isStillSincePress()) { return; } if (firstselected == null) { firstselected = massiveTiles[n][m]; massiveTiles[n][m].open(() -> { }); } else { massiveTiles[n][m].open(() -> { if (!massiveTiles[n][m].hasSameValue(firstselected)) { firstselected.close(); massiveTiles[n][m].close(); } else { firstselected.setOpen(); massiveTiles[n][m].setOpen(); } GameState.setBotMode(BOT_ON); BotTurn(); firstselected = null; secondselected = null; }); } } }); } } }
Source:
public Parts createPartialAggregations(SymbolAllocator symbolAllocator, FunctionRegistry functionRegistry) { ImmutableMap.Builder<Symbol, Aggregation> partialAggregation = ImmutableMap.builder(); ImmutableMap.Builder<Symbol, Aggregation> finalAggregation = ImmutableMap.builder(); for (Map.Entry<Symbol, Aggregation> entry : aggregations.entrySet()) { Aggregation originalAggregation = entry.getValue(); Signature signature = originalAggregation.getSignature(); InternalAggregationFunction function = functionRegistry.getAggregateFunctionImplementation(signature); Symbol partialSymbol = symbolAllocator.newSymbol(signature.getName(), function.getIntermediateType()); partialAggregation.put(partialSymbol, new Aggregation(originalAggregation.getCall(), signature, originalAggregation.getMask())); finalAggregation.put(entry.getKey(), new Aggregation( new FunctionCall(QualifiedName.of(signature.getName()), ImmutableList.of(partialSymbol.toSymbolReference())), signature, Optional.empty())); } return new Parts( new StatisticAggregations(partialAggregation.build(), groupingSymbols), new StatisticAggregations(finalAggregation.build(), groupingSymbols)); }

Target:
public Parts createPartialAggregations(SymbolAllocator symbolAllocator, FunctionRegistry functionRegistry) { ImmutableMap.Builder<Symbol, Aggregation> partialAggregation = ImmutableMap.builder(); ImmutableMap.Builder<Symbol, Aggregation> finalAggregation = ImmutableMap.builder(); ImmutableMap.Builder<Symbol, Symbol> mappings = ImmutableMap.builder(); for (Map.Entry<Symbol, Aggregation> entry : aggregations.entrySet()) { Aggregation originalAggregation = entry.getValue(); Signature signature = originalAggregation.getSignature(); InternalAggregationFunction function = functionRegistry.getAggregateFunctionImplementation(signature); Symbol partialSymbol = symbolAllocator.newSymbol(signature.getName(), function.getIntermediateType()); mappings.put(entry.getKey(), partialSymbol); partialAggregation.put(partialSymbol, new Aggregation(originalAggregation.getCall(), signature, originalAggregation.getMask())); finalAggregation.put(entry.getKey(), new Aggregation( new FunctionCall(QualifiedName.of(signature.getName()), ImmutableList.of(partialSymbol.toSymbolReference())), signature, Optional.empty())); } groupingSymbols.forEach(symbol -> mappings.put(symbol, symbol)); return new Parts( new StatisticAggregations(partialAggregation.build(), groupingSymbols), new StatisticAggregations(finalAggregation.build(), groupingSymbols), mappings.build()); }
Source:
void close() throws IOException { client.close(); }

Target:
public void close() throws IOException { client.close(); }
Source:
private synchronized void stopRunningThread(long endTime) { if (!shtThread.isAlive()) { return; } try { Collection<HTInterval> pill = Collections.singletonList(new HTInterval(-1, endTime, -1, TmfStateValue.nullValue())); if (!fCurrentChunk.isEmpty()) { intervalQueue.put(fCurrentChunk); } intervalQueue.put(pill); shtThread.join(); } catch (TimeRangeException e) { Activator.getDefault().logError("Error closing state system", e); } catch (InterruptedException e) { Activator.getDefault().logError("State system interrupted", e); } }

Target:
private void stopRunningThread(long endTime) { if (!shtThread.isAlive()) { return; } try { Collection<HTInterval> pill = Collections.singletonList(new HTInterval(-1, endTime, -1, TmfStateValue.nullValue())); if (!fCurrentChunk.isEmpty()) { intervalQueue.put(fCurrentChunk); } intervalQueue.put(pill); shtThread.join(); } catch (TimeRangeException e) { Activator.getDefault().logError("Error closing state system", e); } catch (InterruptedException e) { Activator.getDefault().logError("State system interrupted", e); } }
Source:
private MoveValidationResultWithDependents chooseSubsetOfUnitsThatCanMove( final List<Unit> units, final Collection<Unit> transportsToLoad, final MoveValidationResultWithDependents initialResult) { if (!transportsToLoad.isEmpty()) { final List<Unit> allUnits = addMustMoveWith(units); final Collection<Unit> loadedUnits = TransportUtils.mapTransports(route, allUnits, transportsToLoad).keySet(); return validateMoveWithDependents(loadedUnits, transportsToLoad); } MoveValidationResultWithDependents lastResult = initialResult; List<Unit> best = units; if (isInvading()) { best = CollectionUtils.getMatches(best, Matches.unitCanInvade()); lastResult = validateMoveWithDependents(best, List.of()); } final boolean hasLandTransports = hasLandTransports(units); final Predicate<Unit> isLandTransportable = Matches.unitIsLandTransportable(); best.sort(getUnitComparator(best).reversed()); while (!best.isEmpty() && !lastResult.getResult().isMoveValid()) { final Unit firstSkipUnit = best.get(0); int startIndex = 1; while (startIndex < best.size() && (!hasLandTransports || !isLandTransportable.test(best.get(startIndex))) && unitsAreEquivalentWithSameMovementLeft(firstSkipUnit, best.get(startIndex))) { startIndex++; } best = best.subList(startIndex, best.size()); lastResult = validateMoveWithDependents(best, transportsToLoad); } return lastResult; }

Target:
private MoveValidationResultWithDependents chooseSubsetOfUnitsThatCanMove( final List<Unit> units, final Collection<Unit> transportsToLoad, final MoveValidationResultWithDependents initialResult) { if (!transportsToLoad.isEmpty()) { final List<Unit> allUnits = addMustMoveWith(units); final Collection<Unit> loadedUnits = TransportUtils.mapTransports(route, allUnits, transportsToLoad).keySet(); return validateMoveWithDependents(loadedUnits, transportsToLoad); } MoveValidationResultWithDependents lastResult = initialResult; List<Unit> best = units; if (isInvading()) { best = CollectionUtils.getMatches(best, Matches.unitCanInvade()); lastResult = validateMoveWithDependents(best, List.of()); } final boolean hasLandTransports = hasLandTransports(units); best.sort(getUnitComparator(best).reversed()); while (!best.isEmpty() && !lastResult.getResult().isMoveValid()) { best = nextSublist(best, hasLandTransports); lastResult = validateMoveWithDependents(best, List.of()); } return lastResult; }
Source:
public List<Expression> typeDependencies() { return Arrays.asList(leftOperand, rightOperand); }

Target:
public List<Expression> typeDependencies() { if (is(Kind.AND, Kind.OR, Kind.PLUS)) { return Arrays.asList(leftOperand, rightOperand); } return Collections.emptyList(); }
Source:
private void setAccount() throws OrmException, IOException, UnloggedFailure { final Account account = db.accounts().get(id); if (!addEmails.isEmpty()) { for (String email : addEmails) { link(id, email); } } if (!deleteEmails.isEmpty()) { for (String email : deleteEmails) { deleteMail(id, email); } } if (fullName != null) { if (realm.allowsEdit(FieldName.FULL_NAME)) { account.setFullName(fullName); } else { throw new UnloggedFailure(1, "The realm doesn't allow editing names"); } } if (active) { account.setActive(true); } else if (inactive) { account.setActive(false); } addSshKeys = readSshKey(addSshKeys); if (!addSshKeys.isEmpty()) { for (String sshKey : addSshKeys) { addSshKey(sshKey, account); } } deleteSshKeys = readSshKey(deleteSshKeys); if (!deleteSshKeys.isEmpty()) { for (String sshKey : deleteSshKeys) { deleteSshKey(sshKey, account); } } db.accounts().update(Collections.singleton(account)); byIdCache.evict(id); db.close(); }

Target:
private void setAccount() throws OrmException, IOException, UnloggedFailure { final Account account = db.accounts().get(id); for (String email : addEmails) { link(id, email); } for (String email : deleteEmails) { deleteMail(id, email); } if (fullName != null) { if (realm.allowsEdit(FieldName.FULL_NAME)) { account.setFullName(fullName); } else { throw new UnloggedFailure(1, "The realm doesn't allow editing names"); } } if (active) { account.setActive(true); } else if (inactive) { account.setActive(false); } addSshKeys = readSshKey(addSshKeys); for (String sshKey : addSshKeys) { addSshKey(sshKey, account); } deleteSshKeys = readSshKey(deleteSshKeys); for (String sshKey : deleteSshKeys) { deleteSshKey(sshKey, account); } db.accounts().update(Collections.singleton(account)); byIdCache.evict(id); db.close(); }
Source:
public Set<Stream> apply(String config, Stream inputStream) throws BadComponentConfigException { try { Map<String, Object> componentConfig = objectMapper.readValue(config, Map.class); Map<String, Object> parserConfig = (Map<String, Object>) componentConfig.get( TopologyLayoutConstants.JSON_KEY_CONFIG); String parsedTuplesStream = (String) parserConfig.get("parsedTuplesStream"); Long parserId; try { parserId = (Long) parserConfig.get("parserId"); } catch (ClassCastException e) { parserId = Long.valueOf((Integer) parserConfig.get("parserId")); } ParserInfo parserInfo = catalogService.getParserInfo(parserId); if (parserInfo == null) { throw new RuntimeException("Parser ID " + parserId + " not found from catalog"); } return Sets.newHashSet(new Stream(parsedTuplesStream, parserInfo.getParserSchema())); } catch (Exception e) { throw new BadComponentConfigException("Exception while simulating evolution of parser schema", e); } }

Target:
public Set<Stream> apply(String config, Stream inputStream) throws BadComponentConfigException { try { Map<String, Object> componentConfig = objectMapper.readValue(config, Map.class); Map<String, Object> parserConfig = (Map<String, Object>) componentConfig.get( TopologyLayoutConstants.JSON_KEY_CONFIG); String parsedTuplesStream = (String) parserConfig.get("parsedTuplesStream"); Long parserId = getParserId(parserConfig); ParserInfo parserInfo = catalogService.getParserInfo(parserId); if (parserInfo == null) { throw new RuntimeException("Parser ID " + parserId + " not found from catalog"); } return Sets.newHashSet(new Stream(parsedTuplesStream, parserInfo.getParserSchema())); } catch (Exception e) { throw new BadComponentConfigException("Exception while simulating evolution of parser schema", e); } }
Source:
private static void addDiskLockedMessage(List<String> lockedDisksAliases, List<String> messages) { int numOfDisks = lockedDisksAliases.size(); if (numOfDisks > 0) { VdcBllMessages message = (numOfDisks == 1 ? VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_LOCKED : VdcBllMessages.ACTION_TYPE_FAILED_DISKS_ARE_LOCKED); ListUtils.nullSafeAdd(messages, message.toString()); String aliases = (numOfDisks == 1 ? "diskAlias" : "diskAliases"); messages.add(String.format("$%1$s %2$s", aliases, StringUtils.join(lockedDisksAliases, ", "))); } }

Target:
private static void addDiskLockedMessage(List<String> lockedDisksAliases, List<String> messages) { int numOfDisks = lockedDisksAliases.size(); if (numOfDisks > 0) { VdcBllMessages message = VdcBllMessages.ACTION_TYPE_FAILED_DISKS_ARE_LOCKED; String aliases = "diskAliases"; if (numOfDisks == 1) { message = VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_LOCKED; aliases = "diskAlias"; } ListUtils.nullSafeAdd(messages, message.toString()); messages.add(String.format("$%1$s %2$s", aliases, StringUtils.join(lockedDisksAliases, ", "))); } }
Source:
public void stop() { if (isRunning()) { LOGGER.info("Kill interpreter process"); try { callRemoteFunction(new RemoteFunction<Void>() { @Override public Void call(RemoteInterpreterService.Client client) throws Exception { client.shutdown(); return null; } }); } catch (Exception e) { LOGGER.warn("ignore the exception when shutting down"); } this.interpreterProcessLauncher.stop(); } interpreterProcessLauncher = null; LOGGER.info("Remote process terminated"); }

Target:
public void stop() { if (isRunning()) { LOGGER.info("Kill interpreter process"); try { callRemoteFunction(new RemoteFunction<Void>() { @Override public Void call(RemoteInterpreterService.Client client) throws Exception { client.shutdown(); return null; } }); } catch (Exception e) { LOGGER.warn("ignore the exception when shutting down", e); } this.interpreterProcessLauncher.stop(); } interpreterProcessLauncher = null; LOGGER.info("Remote process terminated"); }