auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Response add(SchedulingPolicy schedulingPolicy) { if (!schedulingPolicy.isSetName()){ schedulingPolicy.setName(schedulingPolicy.getPolicy()); } validateParameters(schedulingPolicy, "name"); return performCreate(VdcActionType.AddClusterPolicy, new ClusterPolicyCRUDParameters(null, map(schedulingPolicy)), queryIdResolver); }

Target:
public Response add(SchedulingPolicy schedulingPolicy) { validateParameters(schedulingPolicy, "name"); return performCreate(VdcActionType.AddClusterPolicy, new ClusterPolicyCRUDParameters(null, map(schedulingPolicy)), queryIdResolver); }
Source:
public List<MetricFamilySamples> collect() { GaugeMetricFamily availableCallsFamily = new GaugeMetricFamily( names.getAvailableConcurrentCallsMetricName(), "The number of bulkhead available concurrent calls", LabelNames.NAME ); GaugeMetricFamily maxAllowedCallsFamily = new GaugeMetricFamily( names.getMaxAllowedConcurrentCallsMetricName(), "The number of bulkhead max allowed concurrent calls", LabelNames.NAME ); for (Bulkhead bulkhead: bulkheadsSupplier.get()) { List<String> labelValues = singletonList(bulkhead.getName()); availableCallsFamily.addMetric(labelValues, bulkhead.getMetrics().getAvailableConcurrentCalls()); maxAllowedCallsFamily.addMetric(labelValues, bulkhead.getMetrics().getMaxAllowedConcurrentCalls()); } return asList(availableCallsFamily, maxAllowedCallsFamily); }

Target:
public List<MetricFamilySamples> collect() { GaugeMetricFamily availableCallsFamily = new GaugeMetricFamily( names.getAvailableConcurrentCallsMetricName(), "The number of available concurrent calls", LabelNames.NAME ); GaugeMetricFamily maxAllowedCallsFamily = new GaugeMetricFamily( names.getMaxAllowedConcurrentCallsMetricName(), "The maximum number of allowed concurrent calls", LabelNames.NAME ); for (Bulkhead bulkhead: bulkheadsSupplier.get()) { List<String> labelValues = singletonList(bulkhead.getName()); availableCallsFamily.addMetric(labelValues, bulkhead.getMetrics().getAvailableConcurrentCalls()); maxAllowedCallsFamily.addMetric(labelValues, bulkhead.getMetrics().getMaxAllowedConcurrentCalls()); } return asList(availableCallsFamily, maxAllowedCallsFamily); }
Source:
public void prepare() { configureServices(); logger.debug("Preparing kjar"); KieServices ks = KieServices.Factory.get(); ReleaseId releaseId = ks.newReleaseId(GROUP_ID, ARTIFACT_ID, VERSION); List<String> processes = new ArrayList<String>(); processes.add("repo/processes/general/SingleHumanTaskWithVarsA.bpmn2"); processes.add("repo/processes/general/SingleHumanTaskWithVarsB.bpmn2"); InternalKieModule kJar1 = createKieJar(ks, releaseId, processes); File pom = new File("target/kmodule", "pom.xml"); pom.getParentFile().mkdir(); try (FileOutputStream fs = new FileOutputStream(pom);) { fs.write(getPom(releaseId).getBytes()); } catch (Exception e) { } KieMavenRepository repository = getKieMavenRepository(); repository.deployArtifact(releaseId, kJar1, pom); assertNotNull(deploymentService); deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION); deploymentService.deploy(deploymentUnit); units.add(deploymentUnit); assertNotNull(processService); processIds = new ArrayList<>(); for (int i = 0; i < 10; i++) { Map<String, Object> inputsA1 = new HashMap<>(); inputsA1.put("var_a", "a" + (i % 3)); inputsA1.put("var_b", (i % 3)); processIds.add(processService.startProcess(deploymentUnit.getIdentifier(), "test.test_A", inputsA1)); } for (int i = 0; i < 10; i++) { Map<String, Object> inputsB1 = new HashMap<>(); inputsB1.put("var_a", "b" + (i % 3)); inputsB1.put("var_b", (i % 3)); processIds.add(processService.startProcess(deploymentUnit.getIdentifier(), "test.test_B", inputsB1)); } }

Target:
public void prepare() { configureServices(); logger.debug("Preparing kjar"); KieServices ks = KieServices.Factory.get(); ReleaseId releaseId = ks.newReleaseId(GROUP_ID, ARTIFACT_ID, VERSION); List<String> processes = new ArrayList<>(); processes.add("repo/processes/general/SingleHumanTaskWithVarsA.bpmn2"); processes.add("repo/processes/general/SingleHumanTaskWithVarsB.bpmn2"); InternalKieModule kJar1 = createKieJar(ks, releaseId, processes); File pom = new File("target/kmodule", "pom.xml"); pom.getParentFile().mkdir(); try (FileOutputStream fs = new FileOutputStream(pom);) { fs.write(getPom(releaseId).getBytes()); } catch (Exception e) { } KieMavenRepository repository = getKieMavenRepository(); repository.deployArtifact(releaseId, kJar1, pom); assertNotNull(deploymentService); deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION); deploymentService.deploy(deploymentUnit); units.add(deploymentUnit); assertNotNull(processService); processIds = new ArrayList<>(); for (int i = 0; i < 10; i++) { Map<String, Object> inputsA1 = new HashMap<>(); inputsA1.put("var_a", "a" + (i % 3)); inputsA1.put("var_b", (i % 3)); processIds.add(processService.startProcess(deploymentUnit.getIdentifier(), "test.test_A", inputsA1)); } for (int i = 0; i < 10; i++) { Map<String, Object> inputsB1 = new HashMap<>(); inputsB1.put("var_a", "b" + (i % 3)); inputsB1.put("var_b", (i % 3)); processIds.add(processService.startProcess(deploymentUnit.getIdentifier(), "test.test_B", inputsB1)); } }
Source:
protected BatchElementConfiguration collectHistoricDecisionInstanceIds(CommandContext commandContext) { BatchElementConfiguration elementConfiguration = new BatchElementConfiguration(); if (!CollectionUtil.isEmpty(historicDecisionInstanceIds)) { HistoricDecisionInstanceQueryImpl query = new HistoricDecisionInstanceQueryImpl(); query.decisionInstanceIdIn(historicDecisionInstanceIds.toArray(new String[historicDecisionInstanceIds.size()])); elementConfiguration.addDeploymentMappings( commandContext.runWithoutAuthorization(query::listDeploymentIdMappings), historicDecisionInstanceIds); } final HistoricDecisionInstanceQueryImpl decisionInstanceQuery = (HistoricDecisionInstanceQueryImpl) historicDecisionInstanceQuery; if (decisionInstanceQuery != null) { elementConfiguration.addDeploymentMappings(decisionInstanceQuery.listDeploymentIdMappings()); } return elementConfiguration; }

Target:
protected BatchElementConfiguration collectHistoricDecisionInstanceIds(CommandContext commandContext) { BatchElementConfiguration elementConfiguration = new BatchElementConfiguration(); if (!CollectionUtil.isEmpty(historicDecisionInstanceIds)) { HistoricDecisionInstanceQueryImpl query = new HistoricDecisionInstanceQueryImpl(); query.decisionInstanceIdIn(historicDecisionInstanceIds.toArray(new String[0])); elementConfiguration.addDeploymentMappings( commandContext.runWithoutAuthorization(query::listDeploymentIdMappings), historicDecisionInstanceIds); } final HistoricDecisionInstanceQueryImpl decisionInstanceQuery = (HistoricDecisionInstanceQueryImpl) historicDecisionInstanceQuery; if (decisionInstanceQuery != null) { elementConfiguration.addDeploymentMappings(decisionInstanceQuery.listDeploymentIdMappings()); } return elementConfiguration; }
Source:
private <T extends Serializable> void sendMessageToLocalRegionAsync(final T body ) throws IOException { if ( sqsAsync == null ) { logger.error( "SQS client is null, perhaps it failed to initialize successfully" ); return; } final String stringBody = toString( body ); String url = getReadQueue().getUrl(); if ( logger.isTraceEnabled() ) { logger.trace( "Publishing Message...{} to url: {}", stringBody, url ); } SendMessageRequest request = new SendMessageRequest( url, stringBody ); sqsAsync.sendMessageAsync( request, new AsyncHandler<SendMessageRequest, SendMessageResult>() { @Override public void onError( final Exception e ) { logger.error("Failed to send this message {}. To this address {}. Error was ", stringBody, url, e); } @Override public void onSuccess( final SendMessageRequest request, final SendMessageResult sendMessageResult ) { if ( logger.isTraceEnabled() ) { logger.trace( "Successfully send... messageBody=[{}], url=[{}]", request.getMessageBody(), request.getQueueUrl() ); } } } ); }

Target:
private <T extends Serializable> void sendMessageToLocalRegionAsync(final T body ) throws IOException { if ( sqsAsync == null ) { logger.error( "SQS client is null, perhaps it failed to initialize successfully" ); return; } final String stringBody = toString( body ); String url = getReadQueue().getUrl(); if ( logger.isTraceEnabled() ) { logger.trace( "Publishing Message...{} to url: {}", stringBody, url ); } SendMessageRequest request = new SendMessageRequest( url, stringBody ); sqsAsync.sendMessageAsync( request, new AsyncHandler<SendMessageRequest, SendMessageResult>() { @Override public void onError( final Exception e ) { logger.error(FAILED_TO_SEND_MESSAGE, stringBody, url, e); } @Override public void onSuccess( final SendMessageRequest request, final SendMessageResult sendMessageResult ) { if ( logger.isTraceEnabled() ) { logger.trace( "Successfully send... messageBody=[{}], url=[{}]", request.getMessageBody(), request.getQueueUrl() ); } } } ); }
Source:
public void canBuildFromSingleClientLimit() { Map<String, Long> clientLimits = new HashMap<>(1); clientLimits.put("test_client", 10L); assertThat(ImmutableQosServiceRuntimeConfig.builder().clientLimits(clientLimits).build()) .isInstanceOf(QosServiceRuntimeConfig.class); }

Target:
public void canBuildFromSingleClientLimit() { ImmutableQosServiceRuntimeConfig.builder() .clientLimits(ImmutableMap.of("test_client", 10L)) .build(); }
Source:
public static File createBundle(File workDir, String actual, String basis) throws IOException, NullPointerException { Git user = Git.open(workDir); Repository repo = user.getRepository(); Ref actualRef = repo.exactRef(actual); if (actualRef == null) throw new IOException(); BundleWriter bundlewriter = new BundleWriter(repo); File bundle = File.createTempFile("file", ".bundle"); OutputStream fos = new FileOutputStream(bundle); ProgressMonitor monitor = NullProgressMonitor.INSTANCE; bundlewriter.include(actualRef); if (basis != "") { RevWalk walk = new RevWalk(repo); try { RevCommit basisCommit = walk.parseCommit(repo.resolve(basis)); bundlewriter.assume(basisCommit); } catch (Exception e) { throw new IOException(); } } bundlewriter.writeBundle(monitor, fos); return bundle; }

Target:
public static File createBundle(File workDir, String actual, String basis) throws IllegalArgumentException, IOException { Git git; try { git = Git.open(workDir); } catch (IOException e) { throw new IllegalArgumentException("workDir can't be resolved", e); } Repository repo = git.getRepository(); BundleWriter bundlewriter = new BundleWriter(repo); Ref actualRef; try { actualRef = repo.exactRef(actual); } catch (IOException e) { throw new IllegalArgumentException("actual can't be resolved", e); } if (actualRef == null) throw new IllegalArgumentException("actual can't be resolved"); bundlewriter.include("refs/heads/bundle", actualRef.getObjectId()); if (basis != "") { try { RevWalk walk = new RevWalk(repo); RevCommit basisCommit = walk.parseCommit(repo.resolve(basis)); bundlewriter.assume(basisCommit); } catch (Exception e) { throw new IllegalArgumentException("basis can't be resolved", e); } } File bundle; try { bundle = File.createTempFile("file", ".bundle"); OutputStream fos = new FileOutputStream(bundle); ProgressMonitor monitor = NullProgressMonitor.INSTANCE; bundlewriter.writeBundle(monitor, fos); } catch (Exception e) { throw new IOException("failed to write bundle", e); } return bundle; }
Source:
synchronized public <T> Action getAction(T subject) { if (!(subject instanceof Source)) { return null; } Source source = (Source) subject; return sourceIdToAction.get(source.getId()); }

Target:
public synchronized <T> Action getAction(T subject) { if (!(subject instanceof Source)) { return null; } Source source = (Source) subject; if (source.getId().equals(sourceId)) { return toAction(); } return null; }
Source:
public void setMold(String mold) { if (this._indeterminate && ("switch".equals(mold) || "toggle".equals(mold))) throw new UiException("Checkbox switch/toggle mold not support indeterminate yet." + this); if (mold.equals("tristate") && _init) { super.setMold(mold); setIndeterminate(true); } else { super.setMold(mold); } }

Target:
public void setMold(String mold) { if (this._indeterminate && ("switch".equals(mold) || "toggle".equals(mold))) throw new UiException("Checkbox switch/toggle mold does not support indeterminate yet." + this); super.setMold(mold); }
Source:
private WifiConfiguration[] loadConfiguredNetworksSorted() { WifiManager wifiManager = (WifiManager) getContext().getSystemService(Context.WIFI_SERVICE); if (wifiManager != null) { List<WifiConfiguration> configuredNetworks = wifiManager.getConfiguredNetworks(); if (configuredNetworks != null) { WifiConfiguration[] result = configuredNetworks.toArray(new WifiConfiguration[configuredNetworks.size()]); Arrays.sort(result, new Comparator<WifiConfiguration>() { @Override public int compare(WifiConfiguration lhs, WifiConfiguration rhs) { String l = lhs != null && lhs.SSID != null ? lhs.SSID : ""; String r = rhs != null && rhs.SSID != null ? rhs.SSID : ""; return l.compareToIgnoreCase(r); } }); return result; } } return null; }

Target:
private WifiConfiguration[] loadConfiguredNetworksSorted() { WifiManager wifiManager = (WifiManager) getContext().getSystemService(Context.WIFI_SERVICE); if (wifiManager != null) { List<WifiConfiguration> configuredNetworks = wifiManager.getConfiguredNetworks(); if (configuredNetworks != null) { WifiConfiguration[] result = configuredNetworks.toArray(new WifiConfiguration[configuredNetworks.size()]); Arrays.sort(result, new Comparator<WifiConfiguration>() { @Override public int compare(WifiConfiguration lhs, WifiConfiguration rhs) { String l = lhs.SSID != null ? lhs.SSID : ""; String r = rhs.SSID != null ? rhs.SSID : ""; return l.compareToIgnoreCase(r); } }); return result; } } return null; }
Source:
public Map<String, String> getOptions() { Map<String, String> options = new LinkedHashMap<>(); ResourceResolver resourceResolver = getHelper().getRequest().getResourceResolver(); if (null != resourceResolver) { PageManager pageManager = resourceResolver.adaptTo(PageManager.class); if (pageManager == null) { LOGGER.debug("Page manager is null, hence exiting the process and returning empty map"); return Collections.emptyMap(); } if (!hasOption(GENERIC_LIST_PATH)) { LOGGER.debug("Generic list path is null, hence exiting the process and returning empty map"); return Collections.emptyMap(); } Optional<String> listPath = getOption(GENERIC_LIST_PATH); Page genericListPage = pageManager.getPage(listPath.get()); if (genericListPage == null) { LOGGER.debug("Generic List Page is null, hence exiting the select options process and returning empty map"); return Collections.emptyMap(); } GenericList itemList = genericListPage.adaptTo(GenericList.class); if (itemList == null) { return Collections.emptyMap(); } options.put(StringUtils.EMPTY, "Select the Option"); itemList.getItems().forEach(item -> options.put(item.getValue(), item.getTitle())); } else { LOGGER.error("Exception occurred while initiating the deck generation"); } return options; }

Target:
public Map<String, String> getOptions() { Map<String, String> options = new LinkedHashMap<>(); if (null != getHelper() && null != getHelper().getRequest() && null != getHelper().getRequest().getResourceResolver()) { ResourceResolver resourceResolver = getHelper().getRequest().getResourceResolver(); PageManager pageManager = resourceResolver.adaptTo(PageManager.class); if (pageManager == null) { LOGGER.debug("Page manager is null, hence exiting the process and returning empty map"); return Collections.emptyMap(); } if (!hasOption(GENERIC_LIST_PATH)) { LOGGER.debug("Generic list path is null, hence exiting the process and returning empty map"); return Collections.emptyMap(); } Optional<String> listPath = getOption(GENERIC_LIST_PATH); if (!listPath.isPresent()){ LOGGER.debug("Generic list path under getOption is null, hence exiting the select options process and returning empty map"); return Collections.emptyMap(); } Page genericListPage = pageManager.getPage(listPath.get()); if (genericListPage == null) { LOGGER.debug("Generic List Page is null, hence exiting the select options process and returning empty map"); return Collections.emptyMap(); } GenericList itemList = genericListPage.adaptTo(GenericList.class); if (itemList == null) { return Collections.emptyMap(); } options.put(StringUtils.EMPTY, "Select the Option"); itemList.getItems().forEach(item -> options.put(item.getValue(), item.getTitle())); } else { LOGGER.error("Resource resolver is null while getting the generic list"); } return options; }
Source:
public String toString() { return "Element [" + timestamp + "/" + offset + "]"; }

Target:
public String toString() { return "Element [" + timestamp + '/' + offset + ']'; }
Source:
@Inject public DebugIntentFactory(@IsMockMode boolean isMockMode, @UseExternalApps BooleanPreference useExternalApps) { super(); this.isMockMode = isMockMode; this.useExternalApps = useExternalApps; }

Target:
@Inject public DebugIntentFactory(@IsMockMode boolean isMockMode, @UseExternalApps BooleanPreference useExternalApps) { this.isMockMode = isMockMode; this.useExternalApps = useExternalApps; }
Source:
private static boolean doIsTest(IType iType) { ITestContent testContent = TypeParser.parseType(iType); if (testContent.hasTestMethods()) { return true; } IType[] superclasses; try { superclasses = iType.newSupertypeHierarchy(null).getAllSuperclasses(iType); } catch (JavaModelException e) { TestNGPlugin.log("Could not resolve supertype of "+iType.getFullyQualifiedName()); return false; } for (IType superclass : superclasses) { ITestContent superContent = TypeParser.parseType(superclass); if (superContent.hasTestMethods()) { return true; } } return false; }

Target:
private static boolean doIsTest(IType iType) throws JavaModelException { if (Flags.isAbstract(iType.getFlags())) { return false; } ITestContent testContent = TypeParser.parseType(iType); if (testContent.hasTestMethods()) { return true; } IType[] superclasses; try { superclasses = iType.newSupertypeHierarchy(null).getAllSuperclasses(iType); } catch (JavaModelException e) { TestNGPlugin.log("Could not resolve supertype of "+iType.getFullyQualifiedName()); return false; } for (IType superclass : superclasses) { ITestContent superContent = TypeParser.parseType(superclass); if (superContent.hasTestMethods()) { return true; } } return false; }
Source:
private static Map<String, ModuleService> loadModules(Class cls) { Map<String, ModuleService> modules = new HashMap<>(); if(cls != null) { Map<String, ExtensionProxy> proxies = new HashMap<>(); ExtMap context = new ExtMap() .mput(ModuleService.EXTENSIONS_MAP, proxies) .mput(ModuleService.PROGRAM_NAME, PROGRAM_NAME); ServiceLoader<ModuleService> loader = ServiceLoader.load(cls); for (ModuleService module : loader) { modules.put(module.getName(), module); module.setContext(context); } } logger.debug("Loaded modules: {}", StringUtils.join(modules.keySet(), ",")); return modules; }

Target:
private static Map<String, ModuleService> loadModules(Class cls) { Map<String, ModuleService> modules = new HashMap<>(); if(cls != null) { Map<String, ExtensionProxy> proxies = new HashMap<>(); ExtMap context = new ExtMap() .mput(ModuleService.EXTENSIONS_MAP, proxies) .mput(ModuleService.PROGRAM_NAME, PROGRAM_NAME); ServiceLoader<ModuleService> loader = ServiceLoader.load(cls); for (ModuleService module : loader) { modules.put(module.getName(), module); module.setContext(context); } } logger.debug("Loaded modules: {}", modules.keySet()); return modules; }
Source:
public void updateLinksPosition(ServoData data) { if (noUpdatePosition) return; for (DHLink l : arm.getLinks()) { if (l.getName().equals(data.name)) { l.addPositionValue(data.pos); l.setVelocity(data.speed); l.setTargetPos(data.targetPos); l.setCurrentPos(data.pos); } } }

Target:
public void updateLinksPosition(ServoData data) { if (noUpdatePosition) return; for (DHLink l : arm.getLinks()) { if (l.getName().equals(data.name)) { l.addPositionValue(data.pos); l.setCurrentPos(data.pos); } } }
Source:
private void filterPeaksTemp2(DataPointStream Rpeak_temp2, DataPointStream Rpeak_temp1, double frequency) { Rpeak_temp2.data.addAll(Rpeak_temp1.data); boolean difference = false; while (!difference) { int length_Rpeak_temp2 = Rpeak_temp2.data.size(); List<Long> diffRpeak = new ArrayList<Long>(); for (int j = 1; j < Rpeak_temp2.data.size(); j++) { diffRpeak.add(Rpeak_temp2.data.get(j).timestamp - Rpeak_temp2.data.get(j - 1).timestamp); } List<Integer> eli_index = new ArrayList<Integer>(); for (int j = 0; j < diffRpeak.size(); j++) { if (diffRpeak.get(j) < (AUTOSENSE.RPEAK_INTERPEAK_MULTIPLIER*1000)) { if (Rpeak_temp2.data.get(j).value < Rpeak_temp2.data.get(j + 1).value) { eli_index.add(0); } else { eli_index.add(1); } } else { eli_index.add(-999999); } } for (int j = 0; j < diffRpeak.size(); j++) { if (diffRpeak.get(j) < (AUTOSENSE.RPEAK_INTERPEAK_MULTIPLIER*1000)) { Rpeak_temp2.data.set(j + eli_index.get(j), new DataPoint(0, -999999)); } } for (Iterator<DataPoint> it = Rpeak_temp2.data.iterator(); it.hasNext(); ) { if (it.next().value == -999999) { it.remove(); } } difference = (length_Rpeak_temp2 == Rpeak_temp2.data.size()); } }

Target:
private void filterPeaksTemp2(DataPointStream Rpeak_temp2, DataPointStream Rpeak_temp1, double frequency) { Rpeak_temp2.data.addAll(Rpeak_temp1.data); boolean difference = false; while (!difference) { int length_Rpeak_temp2 = Rpeak_temp2.data.size(); List<Long> diffRpeak = new ArrayList<Long>(); for (int j = 1; j < Rpeak_temp2.data.size(); j++) { diffRpeak.add(Rpeak_temp2.data.get(j).timestamp - Rpeak_temp2.data.get(j - 1).timestamp); } List<Integer> eli_index = new ArrayList<Integer>(); for (int j = 0; j < diffRpeak.size(); j++) { if (diffRpeak.get(j) < (AUTOSENSE.RPEAK_INTERPEAK_LIMIT)) { if (Rpeak_temp2.data.get(j).value < Rpeak_temp2.data.get(j + 1).value) { eli_index.add(0); } else { eli_index.add(1); } } else { eli_index.add(-999999); } } for (int j = 0; j < diffRpeak.size(); j++) { if (diffRpeak.get(j) < (AUTOSENSE.RPEAK_INTERPEAK_LIMIT)) { Rpeak_temp2.data.set(j + eli_index.get(j), new DataPoint(0, -999999)); } } for (Iterator<DataPoint> it = Rpeak_temp2.data.iterator(); it.hasNext(); ) { if (it.next().value == -999999) { it.remove(); } } difference = (length_Rpeak_temp2 == Rpeak_temp2.data.size()); } }
Source:
public ImmutableValue unpackValue() throws IOException { MessageFormat mf = getNextFormat(); switch(mf.getValueType()) { case NIL: unpackNil(); return ValueFactory.newNilValue(); case BOOLEAN: return ValueFactory.newBooleanValue(unpackBoolean()); case INTEGER: switch (mf) { case UINT64: return ValueFactory.newIntegerValue(unpackBigInteger()); default: return ValueFactory.newIntegerValue(unpackLong()); } case FLOAT: return ValueFactory.newFloatValue(unpackDouble()); case STRING: { int length = unpackRawStringHeader(); return ValueFactory.newStringValue(readPayload(length)); } case BINARY: { int length = unpackBinaryHeader(); return ValueFactory.newBinaryValue(readPayload(length)); } case ARRAY: { int size = unpackArrayHeader(); Value[] array = new Value[size]; for (int i=0; i < size; i++) { array[i] = unpackValue(); } return ValueFactory.newArrayValue(array); } case MAP: { int size = unpackMapHeader(); Value[] kvs = new Value[size * 2]; for (int i=0; i < size * 2; ) { kvs[i] = unpackValue(); i++; kvs[i] = unpackValue(); i++; } return ValueFactory.newMapValue(kvs); } case EXTENDED: { ExtendedTypeHeader extHeader = unpackExtendedTypeHeader(); return ValueFactory.newExtendedValue(extHeader.getType(), readPayload(extHeader.getLength())); } default: throw new MessageFormatException("Unknown value type"); } }

Target:
public ImmutableValue unpackValue() throws IOException { MessageFormat mf = getNextFormat(); switch(mf.getValueType()) { case NIL: unpackNil(); return ValueFactory.newNil(); case BOOLEAN: return ValueFactory.newBoolean(unpackBoolean()); case INTEGER: switch (mf) { case UINT64: return ValueFactory.newInteger(unpackBigInteger()); default: return ValueFactory.newInteger(unpackLong()); } case FLOAT: return ValueFactory.newFloat(unpackDouble()); case STRING: { int length = unpackRawStringHeader(); return ValueFactory.newString(readPayload(length)); } case BINARY: { int length = unpackBinaryHeader(); return ValueFactory.newBinary(readPayload(length)); } case ARRAY: { int size = unpackArrayHeader(); Value[] array = new Value[size]; for (int i=0; i < size; i++) { array[i] = unpackValue(); } return ValueFactory.newArray(array); } case MAP: { int size = unpackMapHeader(); Value[] kvs = new Value[size * 2]; for (int i=0; i < size * 2; ) { kvs[i] = unpackValue(); i++; kvs[i] = unpackValue(); i++; } return ValueFactory.newMap(kvs); } case EXTENSION: { ExtensionTypeHeader extHeader = unpackExtensionTypeHeader(); return ValueFactory.newExtension(extHeader.getType(), readPayload(extHeader.getLength())); } default: throw new MessageFormatException("Unknown value type"); } }
Source:
public RegistryEvent(Type type, ServiceReference serviceReference) { this.serviceReference = serviceReference; this.type = type; }

Target:
private RegistryEvent(Type type, ServiceReference serviceReference) { this.serviceReference = serviceReference; this.type = type; }
Source:
public static long getTxnLowWatermark(Store store) throws IOException { long lowTxnWatermark = TransactionsWatcher.getLowWatermarkTransaction(); Long minRetentionPeriod = SpliceCompactionUtils.minRetentionPeriod(store); if(minRetentionPeriod == null || minRetentionPeriod == 0L) { return lowTxnWatermark; } long minRetentionTs = System.currentTimeMillis() - minRetentionPeriod * 1000; long minRetentionTxnId = SIDriver.driver().getTxnStore().getTxnAt(minRetentionTs); if(minRetentionTxnId == -1) { return lowTxnWatermark; } return Math.min(lowTxnWatermark, minRetentionTxnId); }

Target:
public static long getTxnLowWatermark(Store store) throws IOException { if(SIDriver.driver() == null || !SIDriver.driver().isEngineStarted()) { return SIConstants.OLDEST_TIME_TRAVEL_TX; } long lowTxnWatermark = TransactionsWatcher.getLowWatermarkTransaction(); Long minRetentionPeriod = SpliceCompactionUtils.minRetentionPeriod(store); if(minRetentionPeriod == null || minRetentionPeriod == 0L) { return lowTxnWatermark; } long minRetentionTs = System.currentTimeMillis() - minRetentionPeriod * 1000; long minRetentionTxnId = SIDriver.driver().getTxnStore().getTxnAt(minRetentionTs); if(minRetentionTxnId == -1) { return SIConstants.OLDEST_TIME_TRAVEL_TX; } return Math.min(lowTxnWatermark, minRetentionTxnId); }
Source:
public void show(final Object o) { final UserInterface defaultUI = getDefaultUI(); if (defaultUI == null) { return; } defaultUI.show(o); }

Target:
public void show(final Object o) { getDefaultUI().show(o); }
Source:
private LocalDateTime toDateTime(Integer v) { v = (v > 0 ? v : -v) % 10000; return LocalDateTime.now().plusNanos(v).plusSeconds(v); }

Target:
private LocalDateTime toDateTime(Integer v) { v = (v > 0 ? v : -v) % 1000; return LocalDateTime.now().plusNanos(v).plusSeconds(v); }
Source:
public static Path getConfigurationFileLocation(String filename) { return Paths.get(org.wso2.carbon.kernel.utils.Utils.getCarbonConfigHome().toString(), filename); }

Target:
public static Path getConfigurationFileLocation(String filename) { return org.wso2.carbon.kernel.utils.Utils.getCarbonConfigHome().resolve(filename); }
Source:
public static SegmentIdentifierParts valueOf(String dataSource, String identifier) { if (!identifier.startsWith(String.format("%s_", dataSource))) { LOGGER.info("Invalid identifier %s", identifier); return null; } String remaining = identifier.substring(dataSource.length() + 1); String[] splits = remaining.split(DataSegment.delimiter); if (splits.length < 3) { LOGGER.info("Invalid identifier %s", identifier); return null; } DateTimeFormatter formatter = ISODateTimeFormat.dateTime(); try { DateTime start = formatter.parseDateTime(splits[0]); DateTime end = formatter.parseDateTime(splits[1]); String version = splits[2]; String trail = splits.length > 3 ? join(splits, DataSegment.delimiter, 3, splits.length) : null; return new SegmentIdentifierParts( dataSource, new Interval(start.getMillis(), end.getMillis()), version, trail ); } catch (IllegalArgumentException e) { LOGGER.warn(e, "Failed to parse identifier [%s]", identifier); return null; } }

Target:
public static SegmentIdentifierParts valueOf(String dataSource, String identifier) { if (!identifier.startsWith(String.format("%s_", dataSource))) { return null; } String remaining = identifier.substring(dataSource.length() + 1); String[] splits = remaining.split(DataSegment.delimiter); if (splits.length < 3) { return null; } DateTimeFormatter formatter = ISODateTimeFormat.dateTime(); try { DateTime start = formatter.parseDateTime(splits[0]); DateTime end = formatter.parseDateTime(splits[1]); String version = splits[2]; String trail = splits.length > 3 ? join(splits, DataSegment.delimiter, 3, splits.length) : null; return new SegmentIdentifierParts( dataSource, new Interval(start.getMillis(), end.getMillis()), version, trail ); } catch (IllegalArgumentException e) { return null; } }
Source:
private Future<TaskResult> checkAndSubmitNextTask(List<Shard> latestShards) { Future<TaskResult> submittedTaskFuture = null; if ((future == null) || future.isCancelled() || future.isDone()) { if ((future != null) && future.isDone()) { try { TaskResult result = future.get(); if (result.getException() != null) { LOG.error("Caught exception running " + currentTask.getTaskType() + " task: ", result.getException()); } } catch (InterruptedException | ExecutionException e) { LOG.warn(currentTask.getTaskType() + " task encountered exception.", e); } } currentTask = new MetricsCollectingTaskDecorator( new ShardSyncTask(kinesisProxy, leaseManager, initialPositionInStream, cleanupLeasesUponShardCompletion, ignoreUnexpectedChildShards, shardSyncIdleTimeMillis, shardSyncer, latestShards), metricsFactory); future = CompletableFuture.supplyAsync(() -> currentTask.call(), executorService) .whenComplete((taskResult, exception) -> { if (exception != null) { LOG.error("Caught exception running " + currentTask.getTaskType() + " task: ", exception); } try { lock.lock(); if (shardSyncRequestPending.get()) { shardSyncRequestPending.set(false); future = null; checkAndSubmitNextTask(latestShards); } } finally { lock.unlock(); } }); if (LOG.isDebugEnabled()) { LOG.debug("Submitted new " + currentTask.getTaskType() + " task."); } submittedTaskFuture = future; } else { if (LOG.isDebugEnabled()) { LOG.debug("Previous " + currentTask.getTaskType() + " task still pending. Not submitting new task. " + "Enqueued a request that will be executed when the current request completes."); } shardSyncRequestPending.compareAndSet(false , true ); } return submittedTaskFuture; }

Target:
private Future<TaskResult> checkAndSubmitNextTask(List<Shard> latestShards) { Future<TaskResult> submittedTaskFuture = null; if ((future == null) || future.isCancelled() || future.isDone()) { if ((future != null) && future.isDone()) { try { TaskResult result = future.get(); if (result.getException() != null) { LOG.error("Caught exception running " + currentTask.getTaskType() + " task: ", result.getException()); } } catch (InterruptedException | ExecutionException e) { LOG.warn(currentTask.getTaskType() + " task encountered exception.", e); } } currentTask = new MetricsCollectingTaskDecorator( new ShardSyncTask(kinesisProxy, leaseManager, initialPositionInStream, cleanupLeasesUponShardCompletion, ignoreUnexpectedChildShards, shardSyncIdleTimeMillis, shardSyncer, latestShards), metricsFactory); future = CompletableFuture.supplyAsync(() -> currentTask.call(), executorService) .whenComplete((taskResult, exception) -> handlePendingShardSyncs(latestShards, exception)); if (LOG.isDebugEnabled()) { LOG.debug("Submitted new " + currentTask.getTaskType() + " task."); } submittedTaskFuture = future; } else { if (LOG.isDebugEnabled()) { LOG.debug("Previous " + currentTask.getTaskType() + " task still pending. Not submitting new task. " + "Enqueued a request that will be executed when the current request completes."); } shardSyncRequestPending.compareAndSet(false , true ); } return submittedTaskFuture; }
Source:
public void programmaticTimeout(TimerConfig config) { Guid glusterJobId = Guid.createGuidFromString(config.getInfo().toString()); GlusterJobDetails job = scheduleDao.getGlusterJobById(glusterJobId); List<GlusterJobParams> params = jobParamsDao.getJobParamsById(glusterJobId); List<Class<?>> parameterTypes = new ArrayList<>(); List<Object> parameterValues = new ArrayList<>(); Method methodToRun = null; Class clazz = null; try { for (GlusterJobParams param : params) { Class paramsclazz = Class.forName(param.getParamsClassName()); parameterTypes.add(clazz); parameterValues.add(param.getParamsClassValue()); } clazz = Class.forName(job.getJobClassName()); methodToRun = clazz.getDeclaredMethod(job.getJobName(), (Class[]) parameterTypes.toArray()); if(methodToRun == null) { log.error("could not find the required method '{}' on instance of {}", job.getJobName(), clazz.getClass().getSimpleName()); return; } log.info("Preparing to run method: of Class: {}", methodToRun.getName(), clazz.getSimpleName()); methodToRun.invoke(clazz.newInstance(), parameterValues); } catch (Throwable t) { log.error("Exception in performing Job: {}", clazz.getClass().getSimpleName(), ExceptionUtils.getRootCauseMessage(t)); log.debug("Exception", t); } }

Target:
public void programmaticTimeout(TimerConfig config) { Guid glusterJobId = (Guid) config.getInfo(); GlusterJobDetails job = scheduleDao.getGlusterJobById(glusterJobId); List<GlusterJobParams> params = jobParamsDao.getJobParamsById(glusterJobId); List<Class<?>> parameterTypes = new ArrayList<>(); List<Object> parameterValues = new ArrayList<>(); Method methodToRun = null; Class clazz = null; try { for (GlusterJobParams param : params) { Class paramsclazz = Class.forName(param.getParamsClassName()); parameterTypes.add(paramsclazz); parameterValues.add(param.getParamsClassValue()); } clazz = Class.forName(job.getJobClassName()); methodToRun = clazz.getDeclaredMethod(job.getJobName(), (Class[]) parameterTypes.toArray()); if(methodToRun == null) { log.error("could not find the required method '{}' on instance of {}", job.getJobName(), clazz.getClass().getSimpleName()); return; } log.info("Preparing to run method: of Class: {}", methodToRun.getName(), clazz.getSimpleName()); methodToRun.invoke(clazz.getDeclaredConstructor().newInstance(), parameterValues); } catch (Throwable t) { log.error("Exception in performing Job: {}", clazz.getClass().getSimpleName(), ExceptionUtils.getRootCauseMessage(t)); log.debug("Exception", t); } }
Source:
protected final OperatorFactory createHashProjectOperator(int operatorId, PlanNodeId planNodeId, List<Type> types) { ImmutableMap.Builder<Symbol, Type> symbolTypes = ImmutableMap.builder(); ImmutableMap.Builder<Symbol, Integer> symbolToInputMapping = ImmutableMap.builder(); ImmutableList.Builder<PageProjection> projections = ImmutableList.builder(); for (int channel = 0; channel < types.size(); channel++) { Symbol symbol = new Symbol("h" + channel); symbolTypes.put(symbol, types.get(channel)); symbolToInputMapping.put(symbol, channel); projections.add(new InputPageProjection(channel, types.get(channel))); } Optional<Expression> hashExpression = HashGenerationOptimizer.getHashExpression(ImmutableList.copyOf(symbolTypes.build().keySet())); verify(hashExpression.isPresent()); projections.add(new InterpretedPageProjection( hashExpression.get(), TypeProvider.from(symbolTypes.build()), symbolToInputMapping.build(), localQueryRunner.getMetadata(), localQueryRunner.getSqlParser(), session)); return new FilterAndProjectOperator.FilterAndProjectOperatorFactory( operatorId, planNodeId, () -> new PageProcessor(Optional.empty(), projections.build()), ImmutableList.copyOf(Iterables.concat(types, ImmutableList.of(BIGINT))), getFilterAndProjectMinOutputPageSize(session), getFilterAndProjectMinOutputPageRowCount(session)); }

Target:
protected final OperatorFactory createHashProjectOperator(int operatorId, PlanNodeId planNodeId, List<Type> types) { ImmutableMap.Builder<Symbol, Type> symbolTypes = ImmutableMap.builder(); ImmutableMap.Builder<Symbol, Integer> symbolToInputMapping = ImmutableMap.builder(); ImmutableList.Builder<PageProjection> projections = ImmutableList.builder(); for (int channel = 0; channel < types.size(); channel++) { Symbol symbol = new Symbol("h" + channel); symbolTypes.put(symbol, types.get(channel)); symbolToInputMapping.put(symbol, channel); projections.add(new InputPageProjection(channel, types.get(channel))); } Optional<Expression> hashExpression = HashGenerationOptimizer.getHashExpression(ImmutableList.copyOf(symbolTypes.build().keySet())); verify(hashExpression.isPresent()); projections.add(new InterpretedPageProjection( hashExpression.get(), TypeProvider.copyOf(symbolTypes.build()), symbolToInputMapping.build(), localQueryRunner.getMetadata(), localQueryRunner.getSqlParser(), session)); return new FilterAndProjectOperator.FilterAndProjectOperatorFactory( operatorId, planNodeId, () -> new PageProcessor(Optional.empty(), projections.build()), ImmutableList.copyOf(Iterables.concat(types, ImmutableList.of(BIGINT))), getFilterAndProjectMinOutputPageSize(session), getFilterAndProjectMinOutputPageRowCount(session)); }
Source:
public void use_AnalysisWarningsWrapper_before_SQ_7_4_and_sonarlint() { SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(Version.create(7, 3), SonarQubeSide.SCANNER); Plugin.Context context = new Plugin.Context(runtime); javaPlugin.define(context); assertThat(context.getExtensions()).doesNotContain(AnalysisWarningsWrapper.class); runtime = SonarRuntimeImpl.forSonarQube(ANALYSIS_WARNINGS_MIN_SUPPORTED_SQ_VERSION, SonarQubeSide.SCANNER); context = new Plugin.Context(runtime); javaPlugin.define(context); assertThat(context.getExtensions()).contains(AnalysisWarningsWrapper.class); runtime = SonarRuntimeImpl.forSonarLint(ANALYSIS_WARNINGS_MIN_SUPPORTED_SQ_VERSION); context = new Plugin.Context(runtime); javaPlugin.define(context); assertThat(context.getExtensions()).doesNotContain(AnalysisWarningsWrapper.class); }

Target:
public void use_AnalysisWarningsWrapper_before_SQ_7_4_and_sonarlint() { Version unsupportedVersion = Version.create(7, 3); Version minSupportedVersion = Version.create(7, 4); SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(unsupportedVersion, SonarQubeSide.SCANNER); Plugin.Context context = new Plugin.Context(runtime); javaPlugin.define(context); assertThat(context.getExtensions()).doesNotContain(AnalysisWarningsWrapper.class); runtime = SonarRuntimeImpl.forSonarQube(minSupportedVersion, SonarQubeSide.SCANNER); context = new Plugin.Context(runtime); javaPlugin.define(context); assertThat(context.getExtensions()).contains(AnalysisWarningsWrapper.class); runtime = SonarRuntimeImpl.forSonarLint(minSupportedVersion); context = new Plugin.Context(runtime); javaPlugin.define(context); assertThat(context.getExtensions()).doesNotContain(AnalysisWarningsWrapper.class); }
Source:
private void resolveErrorTypes(SpringComponentModel componentModel, Set<String> syntheticErrorNamespaces) { List<ComponentModel> innerComponents = componentModel.getInnerComponents(); if (!innerComponents.isEmpty()) { for (ComponentModel innerComponent : innerComponents) { processRaiseError(innerComponent, syntheticErrorNamespaces); resolveErrorTypes((SpringComponentModel) innerComponent, syntheticErrorNamespaces); } } componentBuildingDefinitionRegistry.getBuildingDefinition(componentModel.getIdentifier()) .ifPresent(componentBuildingDefinition -> { List<ComponentModel> errorMappingComponents = componentModel.getInnerComponents().stream() .filter(innerComponent -> ERROR_MAPPING_IDENTIFIER.equals(innerComponent.getIdentifier())).collect(toList()); if (!errorMappingComponents.isEmpty()) { addAnnotation(ANNOTATION_ERROR_MAPPINGS, errorMappingComponents.stream().map(innerComponent -> { Map<String, String> parameters = innerComponent.getRawParameters(); ComponentIdentifier source = parameters.containsKey(SOURCE_TYPE) ? buildFromStringRepresentation(parameters.get(SOURCE_TYPE)) : ANY; ErrorType errorType = muleContext.getErrorTypeRepository() .lookupErrorType(source) .orElseThrow(() -> new MuleRuntimeException(createStaticMessage("Could not find error '%s'.", source))); ErrorTypeMatcher errorTypeMatcher = new SingleErrorTypeMatcher(errorType); ErrorType targetValue = resolveErrorType(parameters.get(TARGET_TYPE), syntheticErrorNamespaces); return new ErrorMapping(errorTypeMatcher, targetValue); }).collect(toList()), componentModel); } }); }

Target:
private void resolveErrorTypes(SpringComponentModel componentModel, Set<String> syntheticErrorNamespaces) { List<ComponentModel> innerComponents = componentModel.getInnerComponents(); if (!innerComponents.isEmpty()) { for (ComponentModel innerComponent : innerComponents) { processRaiseError(innerComponent, syntheticErrorNamespaces); resolveErrorTypes((SpringComponentModel) innerComponent, syntheticErrorNamespaces); } } componentBuildingDefinitionRegistry.getBuildingDefinition(componentModel.getIdentifier()) .ifPresent(componentBuildingDefinition -> registerErrorMappings(componentModel, syntheticErrorNamespaces)); }
Source:
protected PollingResult compareRemoteRevisionWith(AbstractProject<?, ?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState _baseline) throws IOException, InterruptedException { MercurialTagAction baseline = (MercurialTagAction)_baseline; PrintStream output = listener.getLogger(); Set<String> changedFileNames = new HashSet<String>(); FilePath tmpFile = workspace.createTextTempFile("tmp", "style", FILES_STYLE); try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); AbstractProject<?,?> _project = project; Node node = _project.getLastBuiltOn(); ArgumentListBuilder cmd = findHgExe(node, listener, false); cmd.add(forest ? "fincoming" : "incoming", "--style", tmpFile.getRemote()); cmd.add("--no-merges"); cmd.add("--branch", getBranch()); cmd.add("--newest-first"); String cachedSource = cachedSource(node, launcher, listener, true); if (cachedSource != null) { cmd.add(cachedSource); } joinWithPossibleTimeout( launch(launcher).cmds(cmd).stdout(new ForkOutputStream(baos, output)).pwd(workspace2Repo(workspace)), true, listener); MercurialTagAction cur = parseIncomingOutput(baos, baseline, changedFileNames); return new PollingResult(baseline,cur,computeDegreeOfChanges(changedFileNames,output)); } finally { tmpFile.delete(); } }

Target:
protected PollingResult compareRemoteRevisionWith(AbstractProject<?, ?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState _baseline) throws IOException, InterruptedException { MercurialTagAction baseline = (MercurialTagAction)_baseline; PrintStream output = listener.getLogger(); Set<String> changedFileNames = new HashSet<String>(); FilePath tmpFile = workspace.createTextTempFile("tmp", "style", FILES_STYLE); try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); AbstractProject<?,?> _project = project; Node node = _project.getLastBuiltOn(); ArgumentListBuilder cmd = findHgExe(node, listener, false); cmd.add(forest ? "fincoming" : "incoming", "--style", tmpFile.getRemote()); cmd.add("--no-merges"); cmd.add("--rev", getBranch()); cmd.add("--newest-first"); String cachedSource = cachedSource(node, launcher, listener, true); if (cachedSource != null) { cmd.add(cachedSource); } joinWithPossibleTimeout( launch(launcher).cmds(cmd).stdout(new ForkOutputStream(baos, output)).pwd(workspace2Repo(workspace)), true, listener); MercurialTagAction cur = parseIncomingOutput(baos, baseline, changedFileNames); return new PollingResult(baseline,cur,computeDegreeOfChanges(changedFileNames,output)); } finally { tmpFile.delete(); } }
Source:
public Secret inspectSecret(final String secretId) throws DockerException, InterruptedException { assertApiVersionIsAbove("1.25"); final WebTarget resource = resource().path("secrets").path(secretId); try { return request(GET, Secret.class, resource, resource.request(APPLICATION_JSON_TYPE)); } catch (final DockerRequestException ex) { switch (ex.status()) { case 404: throw new NotFoundException("Secret " + secretId + " not found.", ex); case 406: throw new DockerException("Server not part of swarm.", ex); default: throw ex; } } }

Target:
public Secret inspectSecret(final String secretId) throws DockerException, InterruptedException { assertApiVersionIsAbove("1.25"); final WebTarget resource = resource().path("secrets").path(secretId); try { return request(GET, Secret.class, resource, resource.request(APPLICATION_JSON_TYPE)); } catch (final DockerRequestException ex) { switch (ex.status()) { case 404: throw new NotFoundException("Secret " + secretId + " not found.", ex); case 406: throw new NonSwarmNodeException("Server not part of swarm.", ex); default: throw ex; } } }
Source:
public void setUp() throws Exception { super.setUp(); IProject iProject = project.project; if (!gitDir.exists()) new FileRepository(gitDir).create(); new ConnectProviderOperation(iProject, gitDir).execute(null); testRepo = new TestRepository(gitDir); testRepo.connect(iProject); repo = RepositoryMapping.getMapping(iProject).getRepository(); GitSynchronizeData data = new GitSynchronizeData(repo, "", "", true); GitSynchronizeDataSet dataSet = new GitSynchronizeDataSet(data); comparator = new GitResourceVariantComparator(dataSet); }

Target:
public void setUp() throws Exception { super.setUp(); iProject = project.project; testRepo = new TestRepository(gitDir); testRepo.connect(iProject); repo = RepositoryMapping.getMapping(iProject).getRepository(); GitSynchronizeData data = new GitSynchronizeData(repo, "", "", true); GitSynchronizeDataSet dataSet = new GitSynchronizeDataSet(data); comparator = new GitResourceVariantComparator(dataSet); }
Source:
public void initialize() { super.initialize(); nameField.setAttribute("placeHolder", translationService.getTranslation(StunnerWidgetsConstants.NameEditBoxWidgetViewImp_name)); }

Target:
public void initialize() { super.initialize(); nameField.setAttribute("data-text", translationService.getTranslation(StunnerWidgetsConstants.NameEditBoxWidgetViewImp_name)); nameField.addEventListener("input", event -> onInputChange()); }
Source:
public Response activate(Action action) { validateParameters(action, "bricks"); validateBrickNames(action); GlusterVolumeEntity volume = getEntity(GlusterVolumeEntity.class, VdcQueryType.GetGlusterVolumeById, new IdQueryParameters(asGuid(getVolumeId())), ""); if (volume.getAsyncTask() != null && volume.getAsyncTask().getType() == GlusterTaskType.REMOVE_BRICK && volume.getAsyncTask().getStatus() == JobExecutionStatus.FINISHED) { return stopMigrate(action); } else { Fault fault = new Fault(); fault.setReason(localize(Messages.INVALID_ENUM_DETAIL)); throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST) .entity(fault) .build()); } }

Target:
public Response activate(Action action) { validateParameters(action, "bricks"); validateBrickNames(action); GlusterVolumeEntity volume = getEntity(GlusterVolumeEntity.class, VdcQueryType.GetGlusterVolumeById, new IdQueryParameters(asGuid(getVolumeId())), ""); if (volume.getAsyncTask() != null && volume.getAsyncTask().getType() == GlusterTaskType.REMOVE_BRICK && volume.getAsyncTask().getStatus() == JobExecutionStatus.FINISHED) { return stopMigrate(action); } else { Fault fault = new Fault(); fault.setReason(localize(Messages.CANNOT_ACTIVATE_UNLESS_MIGRATION_COMPLETED)); throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST) .entity(fault) .build()); } }
Source:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append("MarkerCategory [name="); builder.append(name); builder.append(", severity="); builder.append(severity); builder.append(", start="); builder.append(start); builder.append(", end="); builder.append(end); builder.append("]"); return builder.toString(); }

Target:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append("MarkerCategory [name="); builder.append(name); builder.append(", severity="); builder.append(severity); builder.append(", start="); builder.append(start); builder.append(", end="); builder.append(end); builder.append(']'); return builder.toString(); }