auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void apply( WorkspaceConfigImpl workspaceConfig, ComponentImpl pluginComponent, @Nullable FileContentProvider contentProvider) throws DevfileException { checkArgument(workspaceConfig != null, "Workspace config must not be null"); checkArgument(pluginComponent != null, "Component must not be null"); checkArgument( PLUGIN_COMPONENT_TYPE.equals(pluginComponent.getType()), format("Plugin must have `%s` type", PLUGIN_COMPONENT_TYPE)); String workspacePluginsAttribute = workspaceConfig.getAttributes().get(WORKSPACE_TOOLING_PLUGINS_ATTRIBUTE); final String pluginId = pluginComponent.getId(); final String registryUrl = pluginComponent.getRegistryUrl(); try { URL tryUrl = new URL(pluginComponent.getId()); pluginComponent.setReference(pluginComponent.getId()); } catch (MalformedURLException e) { } final ExtendedPluginFQN fqn = componentFQNParser.evaluateFQN(pluginComponent, contentProvider); if (!isNullOrEmpty(fqn.getReference())) { workspaceConfig .getAttributes() .put( WORKSPACE_TOOLING_PLUGINS_ATTRIBUTE, append(workspacePluginsAttribute, fqn.getReference())); } else { workspaceConfig .getAttributes() .put( WORKSPACE_TOOLING_PLUGINS_ATTRIBUTE, append( workspacePluginsAttribute, componentFQNParser.getCompositeId(registryUrl, pluginId))); } for (CommandImpl command : workspaceConfig.getCommands()) { String commandComponent = command.getAttributes().get(COMPONENT_ALIAS_COMMAND_ATTRIBUTE); if (commandComponent == null) { continue; } if (!commandComponent.equals(pluginComponent.getAlias())) { continue; } command.getAttributes().put(PLUGIN_ATTRIBUTE, fqn.getId()); } pluginComponent.setId(fqn.getId()); }

Target:
public void apply( WorkspaceConfigImpl workspaceConfig, ComponentImpl pluginComponent, @Nullable FileContentProvider contentProvider) throws DevfileException { checkArgument(workspaceConfig != null, "Workspace config must not be null"); checkArgument(pluginComponent != null, "Component must not be null"); checkArgument( PLUGIN_COMPONENT_TYPE.equals(pluginComponent.getType()), format("Plugin must have `%s` type", PLUGIN_COMPONENT_TYPE)); String workspacePluginsAttribute = workspaceConfig.getAttributes().get(WORKSPACE_TOOLING_PLUGINS_ATTRIBUTE); final String pluginId = pluginComponent.getId(); final String registryUrl = pluginComponent.getRegistryUrl(); final ExtendedPluginFQN fqn = componentFQNParser.evaluateFQN(pluginComponent, contentProvider); if (!isNullOrEmpty(fqn.getReference())) { workspaceConfig .getAttributes() .put( WORKSPACE_TOOLING_PLUGINS_ATTRIBUTE, append(workspacePluginsAttribute, fqn.getReference())); } else { workspaceConfig .getAttributes() .put( WORKSPACE_TOOLING_PLUGINS_ATTRIBUTE, append( workspacePluginsAttribute, componentFQNParser.getCompositeId(registryUrl, pluginId))); } for (CommandImpl command : workspaceConfig.getCommands()) { String commandComponent = command.getAttributes().get(COMPONENT_ALIAS_COMMAND_ATTRIBUTE); if (commandComponent == null) { continue; } if (!commandComponent.equals(pluginComponent.getAlias())) { continue; } command.getAttributes().put(PLUGIN_ATTRIBUTE, fqn.getId()); } pluginComponent.setId(fqn.getId()); }
Source:
public WatcherCleaner(IDeadWatcherListener listener, int watcherCleanThreshold, int watcherCleanIntervalInSeconds, int watcherCleanThreadsNum, int maxInProcessingDeadWatchers) { this.listener = listener; this.watcherCleanThreshold = watcherCleanThreshold; this.watcherCleanIntervalInSeconds = watcherCleanIntervalInSeconds; int suggestedMaxInProcessingThreshold = watcherCleanThreshold * watcherCleanThreadsNum; if (maxInProcessingDeadWatchers > 0 && maxInProcessingDeadWatchers < suggestedMaxInProcessingThreshold) { maxInProcessingDeadWatchers = suggestedMaxInProcessingThreshold; LOG.info( "The maxInProcessingDeadWatchers config is smaller than the suggested one, change it to use {}", maxInProcessingDeadWatchers); } this.maxInProcessingDeadWatchers = maxInProcessingDeadWatchers; this.deadWatchers = new HashSet<Integer>(); this.cleaners = new WorkerService("DeadWatcherCleanner", watcherCleanThreadsNum, false); LOG.info( "watcherCleanThreshold={}, watcherCleanIntervalInSeconds={}, watcherCleanThreadsNum={}, maxInProcessingDeadWatchers={}", watcherCleanThreshold, watcherCleanIntervalInSeconds, watcherCleanThreadsNum, maxInProcessingDeadWatchers); }

Target:
public WatcherCleaner(IDeadWatcherListener listener, int watcherCleanThreshold, int watcherCleanIntervalInSeconds, int watcherCleanThreadsNum, int maxInProcessingDeadWatchers) { this.listener = listener; this.watcherCleanThreshold = watcherCleanThreshold; this.watcherCleanIntervalInSeconds = watcherCleanIntervalInSeconds; int suggestedMaxInProcessingThreshold = watcherCleanThreshold * watcherCleanThreadsNum; if (maxInProcessingDeadWatchers > 0 && maxInProcessingDeadWatchers < suggestedMaxInProcessingThreshold) { maxInProcessingDeadWatchers = suggestedMaxInProcessingThreshold; LOG.info( "The maxInProcessingDeadWatchers config is smaller than the suggested one, change it to use {}", maxInProcessingDeadWatchers); } this.maxInProcessingDeadWatchers = maxInProcessingDeadWatchers; this.deadWatchers = new HashSet<Integer>(); this.cleaners = new WorkerService("DeadWatcherCleanner", watcherCleanThreadsNum, false); LOG.info( "watcherCleanThreshold={}, watcherCleanIntervalInSeconds={}" + ", watcherCleanThreadsNum={}, maxInProcessingDeadWatchers={}", watcherCleanThreshold, watcherCleanIntervalInSeconds, watcherCleanThreadsNum, maxInProcessingDeadWatchers); }
Source:
private void pollStorageAccountCreation(AuthenticatedContext ac, StorageAccountCheckerContext checkerContext) { PollTask<Boolean> storageAccountCreationStatusCheckerTask = azurePollTaskFactory.storageAccountCheckerTask(ac, checkerContext); try { LOGGER.info("Start polling storage account creation: {}", checkerContext.getStorageAccountName()); syncPollingScheduler.schedule(storageAccountCreationStatusCheckerTask, STORAGE_ACCOUNT_CREATION_CHECKING_INTERVAL, STORAGE_ACCOUNT_CREATION_CHECKING_MAX_ATTEMPT, 1); } catch (Exception e) { LOGGER.debug("Storage account creation failed.", e); } }

Target:
private void pollStorageAccountCreation(AuthenticatedContext ac, StorageAccountCheckerContext checkerContext) { PollTask<Boolean> storageAccountCreationStatusCheckerTask = azurePollTaskFactory.storageAccountCheckerTask(ac, checkerContext); try { LOGGER.info("Start polling storage account creation: {}", checkerContext.getStorageAccountName()); syncPollingScheduler.schedule(storageAccountCreationStatusCheckerTask, STORAGE_ACCOUNT_CREATION_CHECKING_INTERVAL, STORAGE_ACCOUNT_CREATION_CHECKING_MAX_ATTEMPT, MAX_FAILURE_TOLERANT); } catch (Exception e) { LOGGER.debug("Storage account creation failed.", e); } }
Source:
private PlannerResult planWithDruidConvention( final SqlExplain explain, final RelRoot root ) throws RelConversionException { final RelNode wrappedRootRel = possiblyWrapRootWithOuterLimitFromContext(root); final DruidRel<?> druidRel; if (wrappedRootRel == null) { druidRel = (DruidRel<?>) planner.transform( Rules.DRUID_CONVENTION_RULES, planner.getEmptyTraitSet() .replace(DruidConvention.instance()) .plus(root.collation), root.rel ); } else { druidRel = (DruidRel<?>) planner.transform( Rules.DRUID_CONVENTION_RULES, planner.getEmptyTraitSet() .replace(DruidConvention.instance()) .plus(root.collation), wrappedRootRel ); } final Set<String> dataSourceNames = ImmutableSet.copyOf(druidRel.getDataSourceNames()); if (explain != null) { return planExplanation(druidRel, explain, dataSourceNames); } else { final Supplier<Sequence<Object[]>> resultsSupplier = new Supplier<Sequence<Object[]>>() { @Override public Sequence<Object[]> get() { if (root.isRefTrivial()) { return druidRel.runQuery(); } else { return Sequences.map( druidRel.runQuery(), new Function<Object[], Object[]>() { @Override public Object[] apply(final Object[] input) { final Object[] retVal = new Object[root.fields.size()]; for (int i = 0; i < root.fields.size(); i++) { retVal[i] = input[root.fields.get(i).getKey()]; } return retVal; } } ); } } }; return new PlannerResult(resultsSupplier, root.validatedRowType, dataSourceNames); } }

Target:
private PlannerResult planWithDruidConvention( final SqlExplain explain, final RelRoot root ) throws RelConversionException { final RelNode possiblyWrappedRootRel = possiblyWrapRootWithOuterLimitFromContext(root); final DruidRel<?> druidRel = (DruidRel<?>) planner.transform( Rules.DRUID_CONVENTION_RULES, planner.getEmptyTraitSet() .replace(DruidConvention.instance()) .plus(root.collation), possiblyWrappedRootRel ); final Set<String> dataSourceNames = ImmutableSet.copyOf(druidRel.getDataSourceNames()); if (explain != null) { return planExplanation(druidRel, explain, dataSourceNames); } else { final Supplier<Sequence<Object[]>> resultsSupplier = new Supplier<Sequence<Object[]>>() { @Override public Sequence<Object[]> get() { if (root.isRefTrivial()) { return druidRel.runQuery(); } else { return Sequences.map( druidRel.runQuery(), new Function<Object[], Object[]>() { @Override public Object[] apply(final Object[] input) { final Object[] retVal = new Object[root.fields.size()]; for (int i = 0; i < root.fields.size(); i++) { retVal[i] = input[root.fields.get(i).getKey()]; } return retVal; } } ); } } }; return new PlannerResult(resultsSupplier, root.validatedRowType, dataSourceNames); } }
Source:
String[][] extractGroupingValues(DataColumn groupsColumn, DataColumn valuesColumn) { int n = groupsColumn.getValues().size(); String[][] output = new String[n][2]; for (int i = 0; i < n; i++) { Object group = groupsColumn.getValues().get(i); Object value = valuesColumn.getValues().get(i); String groupStr = "", valueStr = ""; if (group != null) { groupStr = group.toString(); } else { } if (value != null) { valueStr = value.toString(); } output[i][0] = groupStr; output[i][1] = valueStr; } return output; }

Target:
String[][] extractGroupingValues(DataColumn groupsColumn, DataColumn valuesColumn) { int n = groupsColumn.getValues().size(); String[][] output = new String[n][2]; for (int i = 0; i < n; i++) { Object group = groupsColumn.getValues().get(i); Object value = valuesColumn.getValues().get(i); output[i][0] = columnValueToString(group); output[i][1] = columnValueToString(value); } return output; }
Source:
protected void handleGroupedCounterAspect(ITmfEvent event, ITmfStateSystemBuilder ss, CounterAspect aspect, int rootQuark) { int quark = rootQuark; for (Class<? extends ITmfEventAspect<?>> group : aspect.getGroups()) { ITmfEventAspect<?> groupAspect = (ITmfEventAspect<?>) TmfTraceUtils.resolveEventAspectOfClassForEvent(event.getTrace(), group, event); if (groupAspect != null) { quark = ss.getQuarkRelativeAndAdd(quark, group.getName()); quark = ss.getQuarkRelativeAndAdd(quark, String.valueOf(groupAspect.resolve(event))); quark = ss.getQuarkRelativeAndAdd(quark, aspect.getName()); } } Long eventContent = aspect.resolve(event); ss.modifyAttribute(event.getTimestamp().toNanos(), eventContent, quark); }

Target:
protected void handleGroupedCounterAspect(ITmfEvent event, ITmfStateSystemBuilder ss, CounterAspect aspect, int rootQuark) { int quark = rootQuark; for (Class<? extends ITmfEventAspect<?>> groupClass : aspect.getGroups()) { ITmfEventAspect<?> groupAspect = (ITmfEventAspect<?>) TmfTraceUtils.resolveEventAspectOfClassForEvent(event.getTrace(), groupClass, event); if (groupAspect != null) { quark = ss.getQuarkRelativeAndAdd(quark, groupClass.getName()); quark = ss.getQuarkRelativeAndAdd(quark, String.valueOf(groupAspect.resolve(event))); } } handleCounterAspect(event, ss, aspect, quark); }
Source:
public void startForEach(LeastRecentlyUsedCache.Predicate<Connection> handler) { nextForEach(connectionStore.iterator(), handler); }

Target:
public Future<Void> startForEach(LeastRecentlyUsedCache.Predicate<Connection> handler) { if (handler == null) { throw new NullPointerException("handler must not be null!"); } ForEachFuture result = new ForEachFuture(); nextForEach(connectionStore.iterator(), handler, result); return result; }
Source:
public void appendWebDavMessages_sendsRequestUsingStore() throws MessagingException, IOException { List<Message> existingMessages = new ArrayList<>(); Message existingMessage = mock(Message.class); existingMessages.add(existingMessage); String messageUid = "testMessageUid"; when(existingMessage.getUid()).thenReturn(messageUid); folder.appendWebDavMessages(existingMessages); verify(mockStore).sendRequest(urlCaptor.capture(), eq("PUT"), entityCaptor.capture(), Matchers.<Map<String, String>>eq(null), eq(true)); assertTrue(urlCaptor.getValue().startsWith(storeUrl+"/"+storeName+"/"+messageUid)); assertTrue(urlCaptor.getValue().endsWith(".eml")); }

Target:
public void appendWebDavMessages_sendsRequestUsingStore() throws MessagingException, IOException { List<Message> existingMessages = new ArrayList<>(); Message existingMessage = mock(Message.class); existingMessages.add(existingMessage); String messageUid = "testMessageUid"; when(existingMessage.getUid()).thenReturn(messageUid); folder.appendWebDavMessages(existingMessages); verify(mockStore).sendRequest(urlCaptor.capture(), eq("PUT"), entityCaptor.capture(), Matchers.<Map<String, String>>eq(null), eq(true)); assertTrue(urlCaptor.getValue().startsWith(storeUrl + "/" + folderName + "/" + messageUid)); assertTrue(urlCaptor.getValue().endsWith(".eml")); }
Source:
public Response add(Quota quota) { org.ovirt.engine.core.common.businessentities.Quota entity = map(quota); entity.setStoragePoolId(dataCenterId); return performCreate(VdcActionType.AddQuota, new QuotaCRUDParameters(entity), new QueryIdResolver<Guid>(VdcQueryType.GetQuotaByQuotaId, IdQueryParameters.class)); }

Target:
public Response add(Quota quota) { validateParameters(quota, "name"); org.ovirt.engine.core.common.businessentities.Quota entity = map(quota); entity.setStoragePoolId(dataCenterId); return performCreate(VdcActionType.AddQuota, new QuotaCRUDParameters(entity), new QueryIdResolver<Guid>(VdcQueryType.GetQuotaByQuotaId, IdQueryParameters.class)); }
Source:
public List<String> getJobLinks() { return null; }

Target:
public List<String> getJobLinks() { List<String> list = new ArrayList<String>(); StringBuilder familyListcmd = new StringBuilder(); familyListcmd.append(EcsContext.composeFamilyName(config)); familyListcmd.append(EcsContext.topologyName(config)); LOG.info(String.format("final list cmd: %s", familyListcmd)); StringBuilder stdout = new StringBuilder(); StringBuilder stderr = new StringBuilder(); List<String> familyString; int status = ShellUtils.runProcess(familyListcmd.toString(), stdout); if (status != 0) { LOG.severe(String.format( "Failed to run process. Command=%s, STDOUT=%s, STDERR=%s", familyListcmd.toString(), stdout, stderr)); } else { String listjsonString = stdout.toString(); try { familyString = parseJsonName(listjsonString, EcsContext.composeListby(config)); for (String familyName : familyString) { StringBuilder listout = new StringBuilder(); StringBuilder listerr = new StringBuilder(); StringBuilder taskListcmd = new StringBuilder(); taskListcmd.append(EcsContext.composeListCmd(config)); taskListcmd.append(" "); taskListcmd.append(familyName); int jobListstatus = ShellUtils.runProcess(taskListcmd.toString(), listout); if (jobListstatus != 0) { LOG.severe(String.format( "Failed to run process. Command=%s, STDOUT=%s, STDERR=%s", taskListcmd.toString(), listout, listerr)); } else { List<String> taskString = parseJsonName(listout.toString(), EcsContext.composeTaskTag(config)); for (String taskId : taskString) { list.add(taskId); } } } } catch (JsonParseException e) { LOG.severe("Unable to get list due to Parsing issues"); } catch (IOException ioe) { LOG.severe("Unable to get list due to IO issues"); } } return list; }
Source:
public DesiredCapabilities getCapabilities(DesiredCapabilities capabilities) { logger.entering(capabilities); if (isNonSauceLabsRun()) { return capabilities; } DesiredCapabilities dc = new DesiredCapabilities(); dc = appendSauceLabsCredentials(capabilities); dc = appendSeleniumVersion(capabilities); dc = appendSauceLabsCapabilities(capabilities); logger.exiting(dc); return dc; }

Target:
public DesiredCapabilities getCapabilities(DesiredCapabilities capabilities) { logger.entering(capabilities); if (isNonSauceLabsRun()) { return capabilities; } DesiredCapabilities dc = capabilities.merge(appendSauceLabsCredentials(capabilities)) .merge(appendSeleniumVersion(capabilities)).merge(appendSauceLabsCapabilities(capabilities)); logger.exiting(dc); return dc; }
Source:
protected int doWork() { IOUtil.assertFileIsReadable(INPUT); IOUtil.assertFileIsWritable(OUTPUT); final SamReader reader = SamReaderFactory.makeDefault().referenceSequence(REFERENCE_SEQUENCE).open(INPUT); if (reader.getFileHeader().getSortOrder() != SAMFileHeader.SortOrder.coordinate) { throw new SAMException("Input must be coordinate-sorted for this program to run. Found: " + reader.getFileHeader().getSortOrder()); } final SAMFileWriter writer = new SAMFileWriterFactory().makeSAMOrBAMWriter(reader.getFileHeader(), true, OUTPUT); writer.setProgressLogger( new ProgressLogger(log, (int) 1e7, "Wrote", "records")); final ReferenceSequenceFileWalker refSeq = new ReferenceSequenceFileWalker(REFERENCE_SEQUENCE); StreamSupport.stream(reader.spliterator(), false) .peek(rec -> { if (!rec.getReadUnmappedFlag()) { if (SET_ONLY_UQ) AbstractAlignmentMerger.fixUq(rec, refSeq, IS_BISULFITE_SEQUENCE); else AbstractAlignmentMerger.fixNmMdAndUq(rec, refSeq, IS_BISULFITE_SEQUENCE); } }) .forEach(writer::addAlignment); CloserUtil.close(reader); writer.close(); return 0; }

Target:
protected int doWork() { IOUtil.assertFileIsReadable(INPUT); IOUtil.assertFileIsWritable(OUTPUT); final SamReader reader = SamReaderFactory.makeDefault().referenceSequence(REFERENCE_SEQUENCE).open(INPUT); if (reader.getFileHeader().getSortOrder() != SAMFileHeader.SortOrder.coordinate) { throw new SAMException("Input must be coordinate-sorted for this program to run. Found: " + reader.getFileHeader().getSortOrder()); } final SAMFileWriter writer = new SAMFileWriterFactory().makeSAMOrBAMWriter(reader.getFileHeader(), true, OUTPUT); writer.setProgressLogger( new ProgressLogger(log, (int) 1e7, "Wrote", "records")); final ReferenceSequenceFileWalker refSeqWalker = new ReferenceSequenceFileWalker(REFERENCE_SEQUENCE); StreamSupport.stream(reader.spliterator(), false) .peek(rec -> fixRecord(rec, refSeqWalker)) .forEach(writer::addAlignment); CloserUtil.close(reader); writer.close(); return 0; }
Source:
private void checkWithVarsToResolve(boolean fromFile) throws Exception { String content = "KEY1 =${VAR1_TO_RESOLVE}\nKEY2=<LINK_0>\nKEY3=${VAR3_TO_RESOLVE}\\\\otherContent"; Map<String, String> currentEnvVars = new HashMap<String, String>(); currentEnvVars.put("VAR1_TO_RESOLVE", "NEW_VALUE1 "); currentEnvVars.put("VAR3_TO_RESOLVE", "C:\\Bench"); Map<String, String> gatherVars = gatherEnvVars(fromFile, content, currentEnvVars); assertNotNull(gatherVars); assertEquals(3, gatherVars.size()); assertEquals("NEW_VALUE1", gatherVars.get("KEY1")); assertEquals("<LINK_0>", gatherVars.get("KEY2")); assertEquals("C:\\Bench\\otherContent", gatherVars.get("KEY3")); }

Target:
private void checkWithVarsToResolve(boolean fromFile) throws Exception { String content = "KEY1 =${VAR1_TO_RESOLVE}\nKEY2=https\\://github.com\nKEY3=${VAR3_TO_RESOLVE}\\\\otherContent"; Map<String, String> currentEnvVars = new HashMap<String, String>(); currentEnvVars.put("VAR1_TO_RESOLVE", "NEW_VALUE1 "); currentEnvVars.put("VAR3_TO_RESOLVE", "C:\\Bench"); Map<String, String> gatherVars = gatherEnvVars(fromFile, content, currentEnvVars); assertNotNull(gatherVars); assertEquals(3, gatherVars.size()); assertEquals("NEW_VALUE1", gatherVars.get("KEY1")); assertEquals("<LINK_0>", gatherVars.get("KEY2")); assertEquals("C:\\Bench\\otherContent", gatherVars.get("KEY3")); }
Source:
public FunctionManager(TypeManager typeManager, BlockEncodingSerde blockEncodingSerde, FeaturesConfig featuresConfig) { operatorNamespace = new StaticFunctionNamespace(typeManager, blockEncodingSerde, featuresConfig); functionNamespaces = ImmutableMap.of(); this.typeManager = typeManager; this.blockEncodingSerde = blockEncodingSerde; this.featuresConfig = featuresConfig; }

Target:
public FunctionManager(TypeManager typeManager, BlockEncodingSerde blockEncodingSerde, FeaturesConfig featuresConfig) { functionNamespaces = ImmutableMap.of(); this.typeManager = requireNonNull(typeManager, "typeManager is null"); this.blockEncodingSerde = requireNonNull(blockEncodingSerde, "blockEncodingSerde is null"); this.featuresConfig = requireNonNull(featuresConfig, "featuresConfig is null"); operatorNamespace = new StaticFunctionNamespace(typeManager, blockEncodingSerde, featuresConfig); }
Source:
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); FifoEvictionPolicyFactory<String, String> plc = new FifoEvictionPolicyFactory<>(); plc.setMaxSize(100); plc.setBatchSize(10); plc.setMaxMemorySize(20); CacheConfiguration cache1 = defaultCacheConfiguration(); cache1.setName("cache1"); cache1.setOnheapCacheEnabled(true); cache1.setEvictionPolicyFactory(plc); NearCacheConfiguration ncf = new NearCacheConfiguration<>(); LruEvictionPolicy lep = new LruEvictionPolicy(); lep.setBatchSize(10); lep.setMaxMemorySize(500); lep.setMaxSize(40); ncf.setNearEvictionPolicy(lep); cache1.setNearConfiguration(ncf); CacheConfiguration cache2 = defaultCacheConfiguration(); lep = new LruEvictionPolicy(); lep.setBatchSize(10); lep.setMaxMemorySize(125); lep.setMaxSize(30); cache2.setEvictionPolicy(lep); cache2.setOnheapCacheEnabled(true); cache2.setName("cache2"); cfg.setCacheConfiguration(cache1,cache2); return cfg; }

Target:
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); FifoEvictionPolicyFactory<String, String> plc = new FifoEvictionPolicyFactory<>(); plc.setMaxSize(100); plc.setBatchSize(10); plc.setMaxMemorySize(20); CacheConfiguration cache1 = defaultCacheConfiguration(); cache1.setName("cache1"); cache1.setOnheapCacheEnabled(true); cache1.setEvictionPolicyFactory(plc); NearCacheConfiguration ncf = new NearCacheConfiguration<>(); ncf.setNearEvictionPolicyFactory(new LruEvictionPolicyFactory<>(40, 10, 500)); cache1.setNearConfiguration(ncf); CacheConfiguration cache2 = defaultCacheConfiguration(); cache2.setName("cache2"); cache2.setOnheapCacheEnabled(true); LruEvictionPolicy lep = new LruEvictionPolicy(); lep.setBatchSize(10); lep.setMaxMemorySize(125); lep.setMaxSize(30); cache2.setEvictionPolicy(lep); ncf = new NearCacheConfiguration<>(); lep = new LruEvictionPolicy(); lep.setBatchSize(10); lep.setMaxMemorySize(500); lep.setMaxSize(40); ncf.setNearEvictionPolicy(lep); cache2.setNearConfiguration(ncf); cfg.setCacheConfiguration(cache1, cache2); return cfg; }
Source:
private JmsTemplate jmsTemplate() { final JmsTemplate jmsTemplate = new JmsTemplate(); jmsTemplate.setDefaultDestination(this.destinationQueue); jmsTemplate.setExplicitQosEnabled(this.property(PROPERTY_EXPLICIT_QOS_ENABLED, boolean.class)); jmsTemplate.setTimeToLive(this.property(PROPERTY_TIME_TO_LIVE, int.class)); jmsTemplate.setDeliveryPersistent(this.property(PROPERTY_DELIVERY_PERSISTENT, boolean.class)); jmsTemplate.setConnectionFactory(JmsConfigurationFactory.this.pooledConnectionFactory); return jmsTemplate; }

Target:
private JmsTemplate jmsTemplate() { final JmsTemplate jmsTemplate = new JmsTemplate(); jmsTemplate.setDefaultDestination(this.destinationQueue); jmsTemplate.setExplicitQosEnabled(this.property(PROPERTY_EXPLICIT_QOS_ENABLED, boolean.class)); jmsTemplate.setTimeToLive(this.property(PROPERTY_TIME_TO_LIVE, long.class)); jmsTemplate.setDeliveryPersistent(this.property(PROPERTY_DELIVERY_PERSISTENT, boolean.class)); jmsTemplate.setConnectionFactory(JmsConfigurationFactory.this.pooledConnectionFactory); return jmsTemplate; }
Source:
private AccountAttributes createInvalidAccountAttributesObject() { String googleId = "invalid google id"; String name = ""; boolean isInstructor = false; String email = "invalid@email@com"; String institute = StringHelperExtension.generateStringOfLength(FieldValidator.INSTITUTE_NAME_MAX_LENGTH + 1); StudentProfileAttributes studentProfile = StudentProfileAttributes.builder().build(); return AccountAttributes.builder() .withGoogleId(googleId) .withName(name) .withEmail(email) .withInstitute(institute) .withIsInstructor(isInstructor) .withStudentProfileAttributes(studentProfile) .build(); }

Target:
private AccountAttributes createInvalidAccountAttributesObject() { String googleId = "invalid google id"; String name = ""; boolean isInstructor = false; String email = "invalid@email@com"; String institute = StringHelperExtension.generateStringOfLength(FieldValidator.INSTITUTE_NAME_MAX_LENGTH + 1); StudentProfileAttributes studentProfile = StudentProfileAttributes.builder(googleId).build(); return AccountAttributes.builder() .withGoogleId(googleId) .withName(name) .withEmail(email) .withInstitute(institute) .withIsInstructor(isInstructor) .withStudentProfileAttributes(studentProfile) .build(); }
Source:
public LeadViewDetail(WebDriver driver) { super.driver = driver; super.wait = DriverManager.getInstance().getWait(); PageFactory.initElements(driver, this); try { wait.withTimeout(10, TimeUnit.SECONDS) .until(ExpectedConditions.visibilityOf(viewSelected)); } catch (WebDriverException e) { throw new WebDriverException(e); } finally { wait.withTimeout(15, TimeUnit.SECONDS); } }

Target:
public LeadViewDetail(WebDriver driver) { super.driver = driver; super.wait = DriverManager.getInstance().getWait(); PageFactory.initElements(driver, this); try { wait.withTimeout(DriverManager.getInstance().getTimeoutNormal(), TimeUnit.SECONDS) .until(ExpectedConditions.visibilityOf(viewSelected)); } catch (WebDriverException e) { throw new WebDriverException(e); } finally { wait.withTimeout(DriverManager.getInstance().getTimeoutNormal(), TimeUnit.SECONDS); } }
Source:
public int hashCode() { return Objects.hash(name, code, offsetAsDouble); }

Target:
public int hashCode() { return HashUtil.combineHashCodes(Objects.hash(name), Objects.hash(code), Objects.hash(offsetAsString)); }
Source:
private static MetaDataMutationResult checkSchemaKeyInRegion(byte[] key, Region region) { byte[] startKey = region.getRegionInfo().getStartKey(); byte[] endKey = region.getRegionInfo().getEndKey(); if (Bytes.compareTo(startKey, key) <= 0 && (Bytes.compareTo(HConstants.LAST_ROW, endKey) == 0 || Bytes.compareTo(key, endKey) < 0)) { return null; } return new MetaDataMutationResult(MutationCode.SCHEMA_NOT_IN_REGION, EnvironmentEdgeManager.currentTimeMillis(), null); }

Target:
private static MetaDataMutationResult checkSchemaKeyInRegion(byte[] key, Region region) { return checkKeyInRegion(key, region, MutationCode.SCHEMA_NOT_IN_REGION); }
Source:
@Test public void givesAllArgsAChanceToShrink() { assertThat(testResult(GivesAllArgsAChanceToShrink.class), failureCountIs(2)); assertThat(Others.shrinkAttempts, greaterThan(0)); }

Target:
@Test public void givesAllArgsAChanceToShrink() { assertThat(testResult(GivesAllArgsAChanceToShrink.class), failureCountIs(2)); assertThat(Others.shrinkAttempts, greaterThan(1)); }
Source:
public synchronized void unsubscribe(String tenant, String metricId, Set<Subscription.SubscriptionOwner> subscriptionOwners) { TenantsSubscriptionsHolder tenantSubscriptions = subscriptions.get(tenant); if (tenantSubscriptions == null) { throw new SubscriptionNotFoundException(tenant, metricId); } Subscription model = tenantSubscriptions.getSubscriptions().get(metricId); if (model == null) { throw new SubscriptionNotFoundException(tenant, metricId); } subscriptionOwners.forEach(model::removeSubscriptionOwner); if (model.getSubscriptionOwners().isEmpty()) { tenantSubscriptions.getSubscriptions().remove(metricId); Logger.LOGGER.debugf("Unsubscribed tenant: %s, metric: %s", tenant, metricId); } }

Target:
public void unsubscribe(String tenant, String metricId, Set<Subscription.SubscriptionOwner> subscriptionOwners) { TenantsSubscriptionsHolder tenantSubscriptions = subscriptions.get(tenant); if (tenantSubscriptions == null) { throw new SubscriptionNotFoundException(tenant, metricId); } Subscription subscription = tenantSubscriptions.getSubscriptions().get(metricId); if (subscription == null) { throw new SubscriptionNotFoundException(tenant, metricId); } subscriptionOwners.forEach(subscription::removeSubscriptionOwner); if (subscription.getSubscriptionOwners().isEmpty()) { tenantSubscriptions.getSubscriptions().remove(metricId); Logger.LOGGER.debugf("Unsubscribed tenant: %s, metric: %s", tenant, metricId); } }
Source:
protected DiskImage getImage() { switch (getActionState()) { case END_SUCCESS: case END_FAILURE: if (_diskImage == null) { if (getVm() != null) { VmHandler.updateDisksFromDb(getVm()); _diskImage = LinqUtils.firstOrNull(getVm().getDiskMap().values(), new Predicate<DiskImage>() { @Override public boolean eval(DiskImage a) { return a.getimage_group_id().equals(getImageGroupId()); } }); } else if (getVmTemplate() != null) { VmTemplateHandler.UpdateDisksFromDb(getVmTemplate()); Collection<DiskImage> templateDisks = getVmTemplate().getDiskMap().values(); _diskImage = LinqUtils.firstOrNull(templateDisks, new Predicate<DiskImage>() { @Override public boolean eval(DiskImage a) { return a.getimage_group_id().equals(getImageGroupId()); } }); } } return _diskImage; default: return super.getImage(); } }

Target:
protected DiskImage getImage() { switch (getActionState()) { case END_SUCCESS: case END_FAILURE: if (_diskImage == null) { List<DiskImage> diskImages = DbFacade.getInstance().getDiskImageDAO().getAllSnapshotsForImageGroup(getImageGroupId()); _diskImage = (diskImages.isEmpty()) ? null:diskImages.get(0); } return _diskImage; default: return super.getImage(); } }
Source:
public String getText(final Object element) { String returnedValue = ""; final ILabelProviderContextElementWrapper wrapper = (ILabelProviderContextElementWrapper) element; final Object value = getWrappedValue(wrapper); if (value instanceof IAxis && !((IAxis) value).getAlias().isEmpty()) { returnedValue = ((IAxis) value).getAlias(); } else { String axisValue = (String) AxisUtils.getRepresentedElement(value); String axisId = axisValue.substring(StereotypeDisplayTreeTableConstants.PREFIX.length()); switch (axisId) { case StereotypeDisplayTreeTableConstants.IN_BRACE: returnedValue = "in Brace"; break; case StereotypeDisplayTreeTableConstants.IN_COMMENT: returnedValue = "In Comment"; break; case StereotypeDisplayTreeTableConstants.IN_COMPARTMENT: returnedValue = "In Compartment"; break; case StereotypeDisplayTreeTableConstants.IS_DISPLAYED: returnedValue = "Visible"; break; case StereotypeDisplayTreeTableConstants.NAME_DEPTH: returnedValue = "Name Depth"; break; default: break; } } return returnedValue; }

Target:
public String getText(final Object element) { String returnedValue = ""; final ILabelProviderContextElementWrapper wrapper = (ILabelProviderContextElementWrapper) element; final Object value = getWrappedValue(wrapper); if (value instanceof IAxis && !((IAxis) value).getAlias().isEmpty()) { returnedValue = ((IAxis) value).getAlias(); } else { String axisValue = (String) AxisUtils.getRepresentedElement(value); String axisId = axisValue.substring(StereotypeDisplayTreeTableConstants.PREFIX.length()); switch (axisId) { case StereotypeDisplayTreeTableConstants.IN_BRACE: returnedValue = StereotypeDisplayTreeTableConstants.IN_BRACE_LABEL; break; case StereotypeDisplayTreeTableConstants.IN_COMMENT: returnedValue = StereotypeDisplayTreeTableConstants.IN_COMMENT_LABEL; break; case StereotypeDisplayTreeTableConstants.IN_COMPARTMENT: returnedValue = StereotypeDisplayTreeTableConstants.IN_COMPARTMENT_LABEL; break; case StereotypeDisplayTreeTableConstants.IS_DISPLAYED: returnedValue = StereotypeDisplayTreeTableConstants.IS_DISPLAYED_LABEL; break; case StereotypeDisplayTreeTableConstants.NAME_DEPTH: returnedValue = StereotypeDisplayTreeTableConstants.NAME_DEPTH_LABEL; break; default: break; } } return returnedValue; }
Source:
void updateMetricsStore(boolean memstoreRead) { if (memstoreRead) { getRequestsFromMemstore.increment(); } else { getRequestsFromFile.increment(); } if (metricsStore != null) { if (memstoreRead) { metricsStore.updateMemstoreGet(); } metricsStore.updateFileGet(); } }

Target:
void updateMetricsStore(boolean memstoreRead) { if (memstoreRead) { memstoreOnlyRowReadsCount.increment(); } else { mixedRowReadsCount.increment(); } }
Source:
public static Object convertToCorrectClass(Class<?> type, Object value) { if (type.isInstance(value)) { return value; } if (type.isEnum()) { type.getEnumConstants(); for (Object object : type.getEnumConstants()) { if (object.toString().equals(value)) { return object; } } } if (type.equals(Date.class) && String.class.isInstance(value)) { try { DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); return formatter.parse((String) value); } catch (ParseException e) { throw new RuntimeException(e); } } if (type.equals(Boolean.class) && String.class.isInstance(value)) { return Boolean.parseBoolean((String) value); } if (String.class.isInstance(value)) { Constructor<?> constructor = getStringOnlyConstructor(type); if (constructor != null) { try { return constructor.newInstance(value); } catch (IllegalArgumentException e) { throw new RuntimeException(e); } catch (InstantiationException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { throw new RuntimeException(e); } } } return null; }

Target:
public static Object convertToCorrectClass(Class<?> type, Object value) { if (type.isInstance(value)) { return value; } if (type.isEnum()) { type.getEnumConstants(); for (Object object : type.getEnumConstants()) { if (object.toString().equals(value)) { return object; } } } if (type.equals(Date.class) && String.class.isInstance(value)) { try { return dateFormatter.parse((String) value); } catch (ParseException e) { throw new RuntimeException(e); } } if (type.equals(Boolean.class) && String.class.isInstance(value)) { return Boolean.parseBoolean((String) value); } if (String.class.isInstance(value)) { Constructor<?> constructor = getStringOnlyConstructor(type); if (constructor != null) { try { return constructor.newInstance(value); } catch (IllegalArgumentException e) { throw new RuntimeException(e); } catch (InstantiationException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { throw new RuntimeException(e); } } } return null; }
Source:
public void visitToken(DetailAST token) { if (!hasServiceClientAnnotation) { return; } switch (token.getType()) { case TokenTypes.CLASS_DEF: hasServiceClientAnnotation = hasServiceClientAnnotation(token); checkServiceClientNaming(token); break; case TokenTypes.CTOR_DEF: checkConstructor(token); break; case TokenTypes.METHOD_DEF: checkMethodName(token); break; case TokenTypes.OBJBLOCK: checkClassField(token); break; default: break; } }

Target:
public void visitToken(DetailAST token) { if (isImplPackage) { return; } switch (token.getType()) { case TokenTypes.PACKAGE_DEF: String packageName = FullIdent.createFullIdent(token.findFirstToken(TokenTypes.DOT)).getText(); isImplPackage = packageName.contains(".implementation"); break; case TokenTypes.CLASS_DEF: hasServiceClientAnnotation = hasServiceClientAnnotation(token); if (hasServiceClientAnnotation) { checkServiceClientNaming(token); } break; case TokenTypes.CTOR_DEF: if (hasServiceClientAnnotation) { checkConstructor(token); } break; case TokenTypes.METHOD_DEF: if (hasServiceClientAnnotation) { checkMethodName(token); } break; case TokenTypes.OBJBLOCK: if (hasServiceClientAnnotation) { checkClassField(token); } break; default: break; } }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.photos); setTitle(R.string.photos_view_name); LinearLayout lView = (LinearLayout) findViewById(R.id.photos_list); Person user = new Person(); user.put("points", 0); user.put("levelAt", 1); user.put("stateAt", 0); user.put("puzzleID", 101); user.put("currentItem", "coffee"); user.put("currentIngredient", "water"); ArrayList<String> characters = new ArrayList<String>(Arrays.asList("BeachBoy", "Granny")); user.put("charactersCollected", characters); user.saveInBackground(); user.add("charactersCollected", "Pusheen"); user.add("charactersCollected", "Baby"); user.saveInBackground(); ArrayList<String> charactersCollected = user.getCollectedCharacters(); for (int i = 0; i < charactersCollected.size(); i++){ currentCharacter = new TextView(this); currentCharacter.setText(charactersCollected.get(i)); lView.addView(currentCharacter); } addListenerOnMainMenuButton(); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.photos); setTitle(R.string.photos_view_name); LinearLayout lView = (LinearLayout) findViewById(R.id.photos_list); ParseUser currentUser = ParseUser.getCurrentUser(); ArrayList<String> charactersCollected = null; if (currentUser != null) { charactersCollected = (ArrayList<String>) currentUser.get("charactersCollected"); } else { Intent i = new Intent(this, SignUpOrLogInActivity.class); startActivity(i); } for (int i = 0; i < charactersCollected.size(); i++){ currentCharacter = new TextView(this); currentCharacter.setText(charactersCollected.get(i)); lView.addView(currentCharacter); } addListenerOnMainMenuButton(); addListenerOnTrophiesButton(); }
Source:
public SliceInput getDelegate() { if (delegate == null) { delegate = requireNonNull(loader.get(), "loader returned a null stream"); verify(delegate.length() == globalLength, "loader returned stream of length %s, but length %s was expected", delegate.length(), globalLength); delegate.setPosition(initialPosition); } return delegate; }

Target:
private SliceInput getDelegate() { if (delegate == null) { delegate = requireNonNull(loader.get(), "loader returned a null stream"); verify(delegate.length() == globalLength, "loader returned stream of length %s, but length %s was expected", delegate.length(), globalLength); delegate.setPosition(initialPosition); } return delegate; }
Source:
private boolean updateCost(AppAggregationKey appAggKey, HTable aggTable, JobDetails jobDetails) throws IOException { byte[] rowKey = aggConv.toBytes(appAggKey); Get g = new Get(rowKey); g.addColumn(AggregationConstants.INFO_FAM_BYTES, AggregationConstants.JOBCOST_BYTES); Result r = aggTable.get(g); Double existingCost = 0.0; byte[] existingCostBytes = null; KeyValue columnLatest = r.getColumnLatest(AggregationConstants.INFO_FAM_BYTES, AggregationConstants.JOBCOST_BYTES); if (columnLatest != null) { existingCost = Bytes.toDouble(columnLatest.getValue()); existingCostBytes = Bytes.toBytes(existingCost); } Double newCost = existingCost + jobDetails.getCost(); LOG.trace(" total app aggregated cost " + newCost); return executeCheckAndPut(aggTable, rowKey, existingCostBytes, Bytes.toBytes(newCost), AggregationConstants.INFO_FAM_BYTES, AggregationConstants.JOBCOST_BYTES); }

Target:
private boolean updateCost(AppAggregationKey appAggKey, HTable aggTable, JobDetails jobDetails) throws IOException { byte[] rowKey = aggConv.toBytes(appAggKey); Get g = new Get(rowKey); g.addColumn(AggregationConstants.INFO_FAM_BYTES, AggregationConstants.JOBCOST_BYTES); Result r = aggTable.get(g); double existingCost = 0.0; byte[] existingCostBytes = null; KeyValue columnLatest = r.getColumnLatest(AggregationConstants.INFO_FAM_BYTES, AggregationConstants.JOBCOST_BYTES); if (columnLatest != null) { existingCost = Bytes.toDouble(columnLatest.getValue()); existingCostBytes = Bytes.toBytes(existingCost); } double newCost = existingCost + jobDetails.getCost(); if (LOG.isTraceEnabled()) { LOG.trace(" total app aggregated cost " + newCost); } return executeCheckAndPut(aggTable, rowKey, existingCostBytes, Bytes.toBytes(newCost), AggregationConstants.INFO_FAM_BYTES, AggregationConstants.JOBCOST_BYTES); }
Source:
public MongoClient getConnection() throws UnknownHostException{ return new MongoClient("localhost", immsAnnotation.port()); }

Target:
public MongoClient getConnection() throws UnknownHostException{ if(client == null){ client = new MongoClient("localhost", immsAnnotation.port()); } return client; }
Source:
public void testMultithreadPutSingle() throws InterruptedException { final int numThreads = 8; final int putsPerThread = 100000; final int totalNumberOfObjects = numThreads * putsPerThread; final CountDownLatch countDownLatch = new CountDownLatch(numThreads); final Runnable[] threads = new Runnable[numThreads]; for (int index = 0; index < numThreads; index++) { threads[index] = new PutThread( countDownLatch, memoryStore, index, numThreads, putsPerThread, 1, IndexParity.ALL_INDEX); } ThreadUtils.runConcurrently(threads); final boolean allThreadsFinished = countDownLatch.await(90, TimeUnit.SECONDS); assertTrue(MSG_THREADS_NOT_FINISHED, allThreadsFinished); assertEquals(MSG_SIZE_ASSERTION, totalNumberOfObjects, memoryStore.getAll(DATA_TYPE).size()); }

Target:
public void testMultithreadPutSingle() throws InterruptedException { final int numThreads = 8; final int putsPerThread = 100000; final int totalNumberOfObjects = numThreads * putsPerThread; final CountDownLatch countDownLatch = new CountDownLatch(numThreads); final Runnable[] threads = new Runnable[numThreads]; for (int index = 0; index < numThreads; index++) { threads[index] = new PutThread( countDownLatch, memoryStore, index, numThreads, putsPerThread, 1, IndexParity.ALL_INDEX); } ThreadUtils.runConcurrently(threads); final boolean allThreadsFinished = countDownLatch.await(60, TimeUnit.SECONDS); assertTrue(MSG_THREADS_NOT_FINISHED, allThreadsFinished); assertEquals(MSG_SIZE_ASSERTION, totalNumberOfObjects, memoryStore.getAll(DATA_TYPE).size()); }
Source:
private static void createAndAddDocumentIdsForClient(ClientExpanded clientExpanded) throws MambuApiException { boolean areOtherDocIdsAllowed = getOtherDocumentTemplateIdsEnabeled(); if (areOtherDocIdsAllowed) { List<IdentificationDocument> idDocs = new ArrayList<IdentificationDocument>(); IdentificationDocument doc = new IdentificationDocument(); doc.setDocumentId("DFG1234"); doc.setDocumentType("Passport"); doc.setIssuingAuthority("Vancouver"); idDocs.add(doc); clientExpanded.setIdDocuments(idDocs); } }

Target:
private static void createAndAddDocumentIdsForClient(ClientExpanded clientExpanded) throws MambuApiException { boolean areOtherDocIdsAllowed = getOtherDocumentTemplateIdsEnabeled(); if (areOtherDocIdsAllowed) { List<IdentificationDocument> idDocs = new ArrayList<>(); IdentificationDocument doc = new IdentificationDocument(); doc.setDocumentId("DFG1234"); doc.setDocumentType("Passport"); doc.setIssuingAuthority("Vancouver"); idDocs.add(doc); clientExpanded.setIdDocuments(idDocs); } }
Source:
protected synchronized void persist( final TimelineRecord... records ) throws IOException { verify( records ); OutputStream out = null; try { out = new FileOutputStream( getDataFile(), true ); for ( TimelineRecord record : records ) { toProto( record ).writeDelimitedTo( out ); } out.flush(); } finally { IOUtil.close( out ); } }

Target:
protected synchronized void persist( final TimelineRecord... records ) throws IOException { verify( records ); OutputStream out = null; try { out = new BufferedOutputStream( new FileOutputStream( getDataFile(), true ) ); for ( TimelineRecord record : records ) { toProto( record ).writeDelimitedTo( out ); } out.flush(); } finally { IOUtil.close( out ); } }
Source:
public List<Condition> getConditions() { return conditions == null ? new ArrayList<>() : conditions; }

Target:
public List<Condition> getConditions() { return conditions == null ? Collections.emptyList() : conditions; }
Source:
public void testNotClosing() throws Exception { h.createStatement("insert into something (id, name) values (1, 'eric')").execute(); h.createStatement("insert into something (id, name) values (2, 'brian')").execute(); List<Map<String, Object>> results = h.createQuery("select * from something order by id").list(); assertThat(results).hasSize(2); assertThat(results.get(0).get("name")).isEqualTo("eric"); assertThat(h.isClosed()).isFalse(); }

Target:
public void testNotClosing() throws Exception { h.createStatement("insert into something (id, name) values (1, 'eric')").execute(); h.createStatement("insert into something (id, name) values (2, 'brian')").execute(); List<Map<String, Object>> results = h.createQuery("select * from something order by id").list(); assertThat(results).hasSize(2); assertThat(results.get(0)).containsEntry("name", "eric"); assertThat(h.isClosed()).isFalse(); }
Source:
public void marshal(ITypeMarshalBuffer buffer, boolean includeValue) throws CoreException { buffer.putShort(ITypeMarshalBuffer.EXEC_IF); buffer.putByte((byte) (isConstexpr ? 1 : 0)); buffer.marshalExecution(initStmtExec, includeValue); buffer.marshalEvaluation(conditionExprEval, includeValue); buffer.marshalExecution(conditionDeclExec, includeValue); buffer.marshalExecution(thenClauseExec, includeValue); buffer.marshalExecution(elseClauseExec, includeValue); }

Target:
public void marshal(ITypeMarshalBuffer buffer, boolean includeValue) throws CoreException { short firstBytes = ITypeMarshalBuffer.EXEC_IF; if (isConstexpr) { firstBytes |= ITypeMarshalBuffer.FLAG1; } buffer.putShort(firstBytes); buffer.marshalExecution(initStmtExec, includeValue); buffer.marshalEvaluation(conditionExprEval, includeValue); buffer.marshalExecution(conditionDeclExec, includeValue); buffer.marshalExecution(thenClauseExec, includeValue); buffer.marshalExecution(elseClauseExec, includeValue); }
Source:
public static EnvironmentDto asDto(EnvironmentState environment) { final List<MachineConfigDto> machineConfigs = environment.getMachineConfigs() .stream() .map(org.eclipse.che.api.machine.server.DtoConverter::asDto) .collect(toList()); return newDto(EnvironmentDto.class).withName(environment.getName()).withMachineConfigs(machineConfigs); }

Target:
public static EnvironmentDto asDto(EnvironmentState environment) { return newDto(EnvironmentDto.class).withName(environment.getName()) .withMachineConfigs(environment.getMachineConfigs().stream() .map(org.eclipse.che.api.machine.server.DtoConverter::asDto) .collect(toList())); }
Source:
public static List<URL> parseURLs(String address, Map<String, String> defaults) { return UrlUtils.parseURLs(address, defaults).stream().map(e -> new URL(e)).collect(Collectors.toList()); }

Target:
public static List<URL> parseURLs(String address, Map<String, String> defaults) { return org.apache.dubbo.common.utils.UrlUtils.parseURLs(address, defaults).stream().map(e -> new URL(e)).collect(Collectors.toList()); }
Source:
private void injectTestId(Xpp3Dom config) { Xpp3Dom properties = config.getChild("properties"); String propertyName = "liberty.dev.test.run.id"; if (properties == null || properties.getChild(propertyName) == null) { Element e = element(name("properties"), element(name(propertyName), String.valueOf(runId++))); config.addChild(e.toDom()); } else { properties.getChild(propertyName).setValue(String.valueOf(runId++)); } }

Target:
private void injectTestId(Xpp3Dom config) { Xpp3Dom properties = config.getChild("properties"); if (properties == null || properties.getChild(TEST_RUN_ID_PROPERTY_NAME) == null) { Element e = element(name("properties"), element(name(TEST_RUN_ID_PROPERTY_NAME), String.valueOf(runId++))); config.addChild(e.toDom()); } else { properties.getChild(TEST_RUN_ID_PROPERTY_NAME).setValue(String.valueOf(runId++)); } }
Source:
public boolean equals(Object o) { return o == this; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null) return false; if (getClass() != o.getClass()) return false; ScoreValueSource other = (ScoreValueSource) o; return Objects.equals(query, other.query); }