auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception { List<String> tservers; String filterText = null; final InstanceOperations instanceOps = shellState.getConnector().instanceOperations(); final boolean paginate = !cl.hasOption(disablePaginationOpt.getOpt()); if (cl.hasOption(tserverOption.getOpt())) { tservers = new ArrayList<>(); tservers.add(cl.getOptionValue(tserverOption.getOpt())); } else { tservers = instanceOps.getTabletServers(); } if (cl.hasOption(filterOption.getOpt())) { filterText = cl.getOptionValue(filterOption.getOpt()); } Iterator<String> activeCompactionIterator = new ActiveCompactionIterator(tservers, instanceOps); if (filterText != null) { String finalFilterText = filterText; activeCompactionIterator = Iterators.filter(activeCompactionIterator, t -> t.contains(finalFilterText)); } shellState.printLines(activeCompactionIterator, paginate); return 0; }

Target:
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception { List<String> tservers; String filterText = null; final InstanceOperations instanceOps = shellState.getConnector().instanceOperations(); final boolean paginate = !cl.hasOption(disablePaginationOpt.getOpt()); if (cl.hasOption(tserverOption.getOpt())) { tservers = new ArrayList<>(); tservers.add(cl.getOptionValue(tserverOption.getOpt())); } else { tservers = instanceOps.getTabletServers(); } if (cl.hasOption(filterOption.getOpt())) { filterText = ".*" + cl.getOptionValue(filterOption.getOpt()) + ".*"; } Iterator<String> activeCompactionIterator = new ActiveCompactionIterator(tservers, instanceOps); if (filterText != null) { String finalFilterText = filterText; activeCompactionIterator = Iterators.filter(activeCompactionIterator, t -> t.matches(finalFilterText)); } shellState.printLines(activeCompactionIterator, paginate); return 0; }
Source:
public void shouldCreateOrderForValidTokenAndThreeDS() { OrderRequest orderRequest = createOrderRequestWithThreeDS(); orderRequest.setToken(createToken()); OrderResponse response = orderService.create(orderRequest); assertThat(response.getOrderCode(), is(notNullValue())); assertThat(response.getAmount(), is(1999)); assertThat(response.getKeyValueResponse().getCustomerIdentifiers(), is(notNullValue())); assertThat("Response code", response.getOrderCode(), is(notNullValue())); assertThat("Amount", response.getAmount(), is(1999)); assertThat("Customer identifier", response.getKeyValueResponse().getCustomerIdentifiers(), is(notNullValue())); }

Target:
public void shouldCreateOrderForValidTokenAndThreeDS() { OrderRequest orderRequest = createOrderRequestWithThreeDS(); orderRequest.setToken(createToken()); OrderResponse response = orderService.create(orderRequest); assertThat("Response code", response.getOrderCode(), is(notNullValue())); assertThat("Amount", response.getAmount(), is(1999)); assertThat("Customer identifier", response.getKeyValueResponse().getCustomerIdentifiers(), is(notNullValue())); }
Source:
public byte[] serialize(String topic, StreamlineEvent streamlineEvent) { SchemaMetadata schemaMetadata = Utils.getSchemaKey(topic, false); SchemaVersionInfo schemaVersionInfo; try { schemaMetadata = this.schemaRegistryClient.getSchemaMetadataInfo(schemaMetadata.getName()).getSchemaMetadata(); schemaVersionInfo = this.schemaRegistryClient.getLatestSchemaVersionInfo(schemaMetadata.getName()); } catch (SchemaNotFoundException e) { LOG.error("Exception occured while getting SchemaVersionInfo for " + schemaMetadata, e); throw new RuntimeException(e); } if (streamlineEvent == null || streamlineEvent.isEmpty()) { return null; } else { return avroSnapshotSerializer.serialize(getAvroGenericRecord(streamlineEvent, schemaVersionInfo.getSchemaText()), schemaMetadata); } }

Target:
public byte[] serialize(String topic, StreamlineEvent streamlineEvent) { SchemaMetadata schemaMetadata = Utils.getSchemaKey(topic, false); SchemaVersionInfo schemaVersionInfo; try { schemaMetadata = this.schemaRegistryClient.getSchemaMetadataInfo(schemaMetadata.getName()).getSchemaMetadata(); schemaVersionInfo = this.schemaRegistryClient.getLatestSchemaVersionInfo(schemaMetadata.getName()); } catch (SchemaNotFoundException e) { LOG.error("Exception occured while getting SchemaVersionInfo for " + schemaMetadata, e); throw new RuntimeException(e); } if (streamlineEvent == null || streamlineEvent.isEmpty()) { return null; } else { return avroSnapshotSerializer.serialize(getAvroRecord(streamlineEvent, new Schema.Parser().parse(schemaVersionInfo.getSchemaText())), schemaMetadata); } }
Source:
private synchronized BufferedMutator getMutator(String tableName) throws IOException { if (mutators == null) { mutators = new HashMap<>(); } BufferedMutator mutator = mutators.get(tableName); if (mutator == null) { mutator = getConnection().getBufferedMutator(TableName.valueOf(tableName)); mutators.put(tableName, mutator); } return mutator; }

Target:
private BufferedMutator getMutator(String tableName) throws IOException { BufferedMutator mutator = mutators.get(tableName); if (mutator == null) { mutator = getConnection().getBufferedMutator(TableName.valueOf(tableName)); mutators.put(tableName, mutator); } return mutator; }
Source:
public BindingProperties getBindingProperties(String channelName) { if (this.bindings.containsKey(channelName)) { return this.bindings.get(channelName); } BindingProperties bindingProperties = new BindingProperties(); this.bindings.put(channelName, bindingProperties); return bindingProperties; }

Target:
public BindingProperties getBindingProperties(String channelName) { BindingProperties bindingProperties = new BindingProperties(); if (this.bindings.containsKey(channelName)) { BeanUtils.copyProperties(this.bindings.get(channelName), bindingProperties); } if (bindingProperties.getDestination() == null) { bindingProperties.setDestination(channelName); } return bindingProperties; }
Source:
static double[] trimDistribution(final double[] distribution) { int endOfDistribution = 0; for (endOfDistribution = distribution.length - 1; endOfDistribution >= 0; endOfDistribution--) { if (distribution[endOfDistribution] != 0) { break; } } return Arrays.copyOfRange(distribution, 0, endOfDistribution); }

Target:
static double[] trimDistribution(final double[] distribution) { int endOfDistribution = distribution.length - 1; while(distribution[endOfDistribution] == 0) { endOfDistribution--; } return Arrays.copyOfRange(distribution, 0, endOfDistribution); }
Source:
public Map<String, Object> consume(String jwt) throws InvalidJwtException { JwtConsumer jwtConsumer = new JwtConsumerBuilder().setRequireExpirationTime() .setAllowedClockSkewInSeconds(Integer.parseInt(env.getProperty("jwtAllowedClockSkew"))) .setRequireSubject() .setExpectedIssuer(env.getProperty("jwtIssuer")) .setExpectedAudience(env.getProperty("jwtAudience")) .setVerificationKey(jwk.getKey()) .build(); try { JwtClaims jwtClaims = jwtConsumer.processToClaims(jwt); return jwtClaims.getClaimsMap(); } catch (InvalidJwtException e) { logger.error("Invalid JWT", e); throw new InvalidJwtException("Invalid JWT - failed in JWTConsumerRsaJoseJImpl."); } }

Target:
public Map<String, Object> consume(String jwt) throws InvalidJwtException { JwtConsumer jwtConsumer = new JwtConsumerBuilder().setRequireExpirationTime() .setAllowedClockSkewInSeconds(Integer.parseInt(env.getProperty("jwtAllowedClockSkew"))) .setRequireSubject() .setExpectedIssuer(env.getProperty("jwtIssuer")) .setExpectedAudience(env.getProperty("jwtAudience")) .setVerificationKey(jwk.getKey()) .build(); try { JwtClaims jwtClaims = jwtConsumer.processToClaims(jwt); return jwtClaims.getClaimsMap(); } catch (InvalidJwtException e) { logger.error("Invalid JWT - " + e.getMessage()); throw new InvalidJwtException("Invalid JWT - failed in JWTConsumerRsaJoseJImpl."); } }
Source:
private void setProductsHref(Brand brand) { String nameToken = NameTokens.PRODUCT; if (localeHelper.isFrench()) { nameToken = NameTokens.translate(nameToken); } PlaceRequest newPlaceRequest = new PlaceRequest.Builder() .nameToken(nameToken) .with(NameTokens.PARAM_BRAND, brand.getValue()) .with(NameTokens.PARAM_ID, String.valueOf(Product.SHIRT.getId())) .build(); productsAnchor.setHref("#" + placeManager.buildHistoryToken(newPlaceRequest)); }

Target:
private void setProductsHref(Brand brand) { PlaceRequest newPlaceRequest = new PlaceRequest.Builder() .nameToken(nameTokensConstants.PRODUCT()) .with(NameTokens.PARAM_BRAND, brand.getValue()) .with(NameTokens.PARAM_ID, String.valueOf(Product.SHIRT.getId())) .build(); productsAnchor.setHref("#" + placeManager.buildHistoryToken(newPlaceRequest)); }
Source:
public void perform(GraphRewrite event, EvaluationContext context) { checkVariableName(event, context); WindupVertexFrame payload = resolveVariable(event, getVariableName()); if (payload instanceof FileReferenceModel) { perform(event, context, ((FileReferenceModel) payload).getFile()); } else { perform(event, context); } }

Target:
public void perform(GraphRewrite event, EvaluationContext context) { checkVariableName(event, context); WindupVertexFrame payload = resolveVariable(event, getVariableName()); if (payload instanceof FileReferenceModel) { perform(event, context, ((FileReferenceModel) payload).getFile()); } else { super.perform(event, context); } }
Source:
public void visitFile(@Nullable AstNode astNode) { newHighlighting = context.newHighlighting(); System.out.println("high = " + newHighlighting); System.out.println("fs = " + context.fileSystem()); InputFile inputFile = context.fileSystem().inputFile(context.fileSystem().predicates().is(getContext().getFile().getAbsoluteFile())); newHighlighting.onFile(inputFile); }

Target:
public void visitFile(@Nullable AstNode astNode) { newHighlighting = context.newHighlighting(); InputFile inputFile = context.fileSystem().inputFile(context.fileSystem().predicates().is(getContext().getFile().getAbsoluteFile())); newHighlighting.onFile(inputFile); }
Source:
private String getBinaryPath(DebugConfiguration debugConfiguration) { Map<String, String> connectionProperties = debugConfiguration.getConnectionProperties(); String binaryPath = connectionProperties.get(BIN_PATH_CONNECTION_PROPERTY); return binaryPath == null ? currentProjectPathProvider.getKey() + "/" + DEFAULT_EXECUTABLE_TARGET_NAME : binaryPath; }

Target:
private String getBinaryPath(DebugConfiguration debugConfiguration) { if (debugConfiguration == null) { return getDefaultBinaryPath(); } Map<String, String> connectionProperties = debugConfiguration.getConnectionProperties(); String binaryPath = connectionProperties.get(BIN_PATH_CONNECTION_PROPERTY); return binaryPath == null ? getDefaultBinaryPath() : binaryPath; }
Source:
public TilesetManager(BoardView1 bv) throws IOException { boardview = bv; hexTileset = new HexTileset(boardview.game); tracker = new MediaTracker(boardview); try { camos = new DirectoryItems( Configuration.camoDir(), "", ImageFileFactory.getInstance() ); } catch (Exception e) { camos = null; } mechTileset.loadFromFile("mechset.txt"); wreckTileset.loadFromFile("wreckset.txt"); try { hexTileset.incDepth = 0; hexTileset.loadFromFile(PreferenceManager.getClientPreferences().getMapTileset()); } catch (Exception FileNotFoundException) { System.out.println("Error loading tileset, " + "reverting to default hexset! " + "Could not find file: " + PreferenceManager.getClientPreferences().getMapTileset()); if (new MegaMekFile(Configuration.hexesDir(), FILENAME_DEFAULT_HEX_SET).getFile().exists()){ hexTileset.loadFromFile(FILENAME_DEFAULT_HEX_SET); } else { System.err.println("Critical Error loading default tileset!"); } } PreferenceManager.getClientPreferences().addPreferenceChangeListener(this); GUIPreferences.getInstance().addPreferenceChangeListener(this); }

Target:
public TilesetManager(BoardView1 bv) throws IOException { boardview = bv; hexTileset = new HexTileset(boardview.game); tracker = new MediaTracker(boardview); try { camos = new DirectoryItems( Configuration.camoDir(), "", ScaledImageFileFactory.getInstance() ); } catch (Exception e) { camos = null; } mechTileset.loadFromFile("mechset.txt"); wreckTileset.loadFromFile("wreckset.txt"); try { hexTileset.incDepth = 0; hexTileset.loadFromFile(PreferenceManager.getClientPreferences().getMapTileset()); } catch (Exception FileNotFoundException) { DefaultMmLogger.getInstance().error(getClass(), "TilesetManager()", "Error loading tileset " + PreferenceManager.getClientPreferences().getMapTileset() + " Reverting to default hexset! "); if (new MegaMekFile(Configuration.hexesDir(), FILENAME_DEFAULT_HEX_SET).getFile().exists()){ hexTileset.loadFromFile(FILENAME_DEFAULT_HEX_SET); } else { DefaultMmLogger.getInstance().fatal(getClass(), "TilesetManager()", "Could not load default tileset " + FILENAME_DEFAULT_HEX_SET); } } PreferenceManager.getClientPreferences().addPreferenceChangeListener(this); GUIPreferences.getInstance().addPreferenceChangeListener(this); }
Source:
public Option<Command> localChangesAboutToCommit(Collection<Notification> notifications) { final Set<EObject> allDetachedObjects = getChangedEObjectsAndChildren(Iterables.filter(notifications, IS_DETACHMENT)); if (allDetachedObjects.size() > 0) { final Set<EObject> allAttachedObjects = getChangedEObjectsAndChildren(Iterables.filter(notifications, IS_ATTACHMENT)); final Set<EObject> toRemoveXRefFrom = Sets.difference(allDetachedObjects, allAttachedObjects); if (toRemoveXRefFrom.size() > 0) { Command removeDangling = new RecordingCommand(domain) { @Override protected void doExecute() { DslCommonPlugin.PROFILER.startWork(SiriusTasksKey.CLEANING_REMOVEDANGLING_KEY); for (EObject eObject : toRemoveXRefFrom) { accessor.eDelete(eObject, xRef, Predicates.or(DSEMANTICDECORATOR_REFERENCE_T0_IGNORE_PREDICATE, VIEW_ELEMENT_REFERENCE_TO_IGNORE_PREDICATE)); } DslCommonPlugin.PROFILER.stopWork(SiriusTasksKey.CLEANING_REMOVEDANGLING_KEY); } }; return Options.newSome(removeDangling); } } return Options.newNone(); }

Target:
public Option<Command> localChangesAboutToCommit(Collection<Notification> notifications) { final Set<EObject> allDetachedObjects = getChangedEObjectsAndChildren(Iterables.filter(notifications, IS_DETACHMENT), null); if (allDetachedObjects.size() > 0) { Predicate<EObject> ignoreNotifierInDetachedObjects = Predicates.in(allDetachedObjects); final Set<EObject> allAttachedObjects = getChangedEObjectsAndChildren(Iterables.filter(notifications, IS_ATTACHMENT), ignoreNotifierInDetachedObjects); final Set<EObject> toRemoveXRefFrom = Sets.difference(allDetachedObjects, allAttachedObjects); if (toRemoveXRefFrom.size() > 0) { Predicate<EReference> refToIgnore = Predicates.or(DSEMANTICDECORATOR_REFERENCE_T0_IGNORE_PREDICATE, VIEW_ELEMENT_REFERENCE_TO_IGNORE_PREDICATE, EPACKAGE_EFACTORYINSTANCE_REFERENCE_TO_IGNORE_PREDICATE); Command removeDangling = new RemoveDanglingReferencesCommand(domain, toRemoveXRefFrom, refToIgnore); return Options.newSome(removeDangling); } } return Options.newNone(); }
Source:
private static void setupLogger(Map<String, Object> args) throws IOException{ String logfile = (String)args.get("log-file"); Logger logger = Logger.getLogger(""); logger.setLevel((Level)args.get("log-level")); logger.addHandler(new ConsoleHandler()); if(logfile != null) { FileHandler fh = new FileHandler(logfile); fh.setFormatter(new SimpleFormatter()); logger.addHandler(fh); } }

Target:
private void setupLogger(Map<String, Object> args) throws IOException{ Logger logger = Logger.getLogger(""); logger.setLevel((Level)args.get("log-level")); String logfile = (String)args.get("log-file"); if(logfile != null) { FileHandler fh = new FileHandler(logfile); fh.setFormatter(new SimpleFormatter()); logger.addHandler(fh); } }
Source:
private static String resolveSibling(String path1, String path2) { List<String> path1Parts = new ArrayList(Arrays.asList(path1.split("/"))); List<String> path2Parts = new ArrayList(Arrays.asList(path2.split("/"))); if (path1Parts.size() > 0) { path1Parts.remove(path1Parts.size() - 1); } int path1Pos = path1Parts.size() - 1; int path2Pos = 0; while (path1Pos >= 0 && path2Pos < path2Parts.size()) { if (path2Parts.get(path2Pos).equals(".")) { path2Parts.remove(path2Pos); } else if (path2Parts.get(path2Pos).equals("..")) { path2Parts.remove(path2Pos); path1Parts.remove(path1Parts.size() - 1); } else { break; } } path1Parts.addAll(path2Parts); return String.join("/", path1Parts); }

Target:
private static String resolveSibling(String path1, String path2) { List<String> path1Parts = new ArrayList<>(Arrays.asList(path1.split("/"))); List<String> path2Parts = new ArrayList<>(Arrays.asList(path2.split("/"))); if (path1Parts.size() > 0) { path1Parts.remove(path1Parts.size() - 1); } while (path1Parts.size() > 0 && path2Parts.size() > 0) { if (path2Parts.get(0).equals(".")) { path2Parts.remove(0); } else if (path2Parts.get(0).equals("..")) { path2Parts.remove(0); path1Parts.remove(path1Parts.size() - 1); } else { break; } } path1Parts.addAll(path2Parts); return String.join("/", path1Parts); }
Source:
public DataTransactionResult offerToStore(ValueContainer<?> container, Boolean value) { final ImmutableValue<Boolean> proposedValue = ImmutableDataCachingUtil.getValue(ImmutableSpongeValue.class, Keys.IS_FLYING, value, false); if (supports(container)) { final DataTransactionBuilder builder = DataTransactionBuilder.builder(); final ImmutableValue<Boolean> newFlyingValue = ImmutableDataCachingUtil.getValue(ImmutableSpongeValue.class, Keys.IS_FLYING, value, false); final ImmutableValue<Boolean> oldFlyingData = getApiValueFromContainer(container).get().asImmutable(); if (value == null) { return DataTransactionBuilder.errorResult(newFlyingValue); } try { net.minecraft.entity.Entity entity = ((net.minecraft.entity.Entity) container); if (entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) entity; player.capabilities.allowFlying = newFlyingValue.get(); } else { entity.isAirBorne = newFlyingValue.get(); } return builder.success(newFlyingValue).replace(oldFlyingData).result(DataTransactionResult.Type.SUCCESS).build(); } catch (Exception e) { return DataTransactionBuilder.errorResult(newFlyingValue); } } return DataTransactionBuilder.failResult(proposedValue); }

Target:
public DataTransactionResult offerToStore(ValueContainer<?> container, Boolean value) { final ImmutableValue<Boolean> proposedValue = ImmutableDataCachingUtil.getValue(ImmutableSpongeValue.class, Keys.IS_FLYING, value, false); if (supports(container)) { final ImmutableValue<Boolean> oldFlyingData = getApiValueFromContainer(container).get().asImmutable(); try { if (container instanceof EntityPlayer) { ((EntityPlayer) container).capabilities.isFlying = proposedValue.get(); } else { ((Entity) container).isAirBorne = proposedValue.get(); } return DataTransactionBuilder.successReplaceResult(oldFlyingData, proposedValue); } catch (Exception e) { return DataTransactionBuilder.errorResult(proposedValue); } } return DataTransactionBuilder.failResult(proposedValue); }
Source:
public void setUp() throws Exception { Constant.getInstance(); I18N i18n = Mockito.mock(I18N.class, withSettings().lenient()); given(i18n.getString(anyString())).willReturn(""); given(i18n.getString(anyString(), any())).willReturn(""); given(i18n.getLocal()).willReturn(Locale.getDefault()); Constant.messages = i18n; Control.initSingletonForTesting(Model.getSingleton()); session = new Session(Model.getSingleton()); }

Target:
public void setUp() throws Exception { Constant.getInstance(); I18N i18n = Mockito.mock(I18N.class, withSettings().lenient()); given(i18n.getString(anyString())).willReturn(""); given(i18n.getString(anyString(), any())).willReturn(""); given(i18n.getLocal()).willReturn(Locale.getDefault()); Constant.messages = i18n; factory = new VariantFactory(); Model model = mock(Model.class); given(model.getVariantFactory()).willReturn(factory); Control.initSingletonForTesting(model); session = new Session(model); given(model.getSession()).willReturn(session); }
Source:
protected Tuple<I> doForward(E entity) { final Any stateAny = pack(entity.getState()); final EntityRecord.Builder builder = EntityRecord.newBuilder() .setState(stateAny); if (entity instanceof AbstractVersionableEntity) { AbstractVersionableEntity versionable = (AbstractVersionableEntity) entity; builder.setVersion(versionable.getVersion()) .setVisibility(versionable.getVisibility()); } final Tuple<I> result = tuple(entity.getId(), builder.build()); return result; }

Target:
protected Tuple<I> doForward(E entity) { final Any stateAny = pack(entity.getState()); final EntityRecord.Builder builder = EntityRecord.newBuilder() .setState(stateAny); if (entity instanceof AbstractVersionableEntity) { final AbstractVersionableEntity versionable = (AbstractVersionableEntity) entity; builder.setVersion(versionable.getVersion()) .setVisibility(versionable.getVisibility()); } final Tuple<I> result = tuple(entity.getId(), builder.build()); return result; }
Source:
private void sendExtraRateAmount(InvestExtraRateModel investExtraRateModel, long actualInterest, long actualFee) { InvestModel investModel = investMapper.findById(investExtraRateModel.getInvestId()); AccountModel accountModel = accountMapper.findByLoginName(investModel.getLoginName()); if (accountModel == null) { logger.debug(MessageFormat.format("user has no account, investId={0} loginName={1} amount={3}", String.valueOf(investModel.getId()), investModel.getLoginName(), String.valueOf(investModel.getAmount()))); return; } long amount = actualInterest - actualFee; if (amount <= 0) { return; } long orderId = idGenerator.generate(); try { TransferRequestModel requestModel = TransferRequestModel.newRequest(String.valueOf(orderId), accountModel.getPayUserId(), String.valueOf(amount)); TransferResponseModel responseModel = paySyncClient.send(TransferMapper.class, requestModel, TransferResponseModel.class); if (responseModel.isSuccess()) { this.updateExtraRateData(investExtraRateModel, investModel, accountModel, actualInterest, actualFee, amount, orderId); } } catch (Exception e) { logger.error(MessageFormat.format("extra rate is failed, investId={0} loginName={1} amount={3}", String.valueOf(investModel.getId()), investModel.getLoginName(), String.valueOf(investModel.getAmount())), e); return; } }

Target:
private void sendExtraRateAmount(InvestExtraRateModel investExtraRateModel, long actualInterest, long actualFee) throws Exception{ InvestModel investModel = investMapper.findById(investExtraRateModel.getInvestId()); AccountModel accountModel = accountMapper.findByLoginName(investModel.getLoginName()); if (accountModel == null) { logger.debug(MessageFormat.format("user has no account, investId={0} loginName={1} amount={3}", String.valueOf(investModel.getId()), investModel.getLoginName(), String.valueOf(investModel.getAmount()))); return; } long amount = actualInterest - actualFee; boolean isSuccess = false; if (amount > 0) { String orderId = investExtraRateModel.getInvestId() + "X" + System.currentTimeMillis(); TransferRequestModel requestModel = TransferRequestModel.newRequest(orderId, accountModel.getPayUserId(), String.valueOf(amount)); TransferResponseModel responseModel = paySyncClient.send(TransferMapper.class, requestModel, TransferResponseModel.class); isSuccess = responseModel.isSuccess(); } if (isSuccess || amount == 0) { investRateService.updateExtraRateData(investExtraRateModel, actualInterest, actualFee); } }
Source:
public void reset() { opcodeList = null; direction = null; if(payloadFilter != null){ payloadFilter = null; } }

Target:
public void reset() { opcodeList = null; direction = null; payloadFilter = null; }
Source:
public ScopedPreferenceProvider getPreferenceProvider() { if (preferenceProvider == null) { preferenceProvider = new ScopedPreferenceProvider(getBundle().getSymbolicName()); } return preferenceProvider; }

Target:
public EMFComparePreferences getPreferenceProvider() { if (preferenceProvider == null) { preferenceProvider = new EMFComparePreferences(getBundle().getSymbolicName()); } return preferenceProvider; }
Source:
public String getClassName() { String canonicalName = clazz.getCanonicalName(); if (canonicalName != null && getPackageName() != null) { return canonicalName.substring(getPackageName().length() + 1, canonicalName.length()); } return null; }

Target:
public String getClassName() { String qualifiedName = getQualifiedName(); if(qualifiedName.contains(".")) { return qualifiedName.substring(qualifiedName.lastIndexOf("."), qualifiedName.length()); } else { return qualifiedName; } }
Source:
private void toolsIdTool() throws Exception { Response response = checkedResponse(basePath + "tools/quay.io%2Ftest_org%2Ftest6"); ToolV1 responseObject = response.readEntity(ToolV1.class); assertTool(SUPPORT.getObjectMapper().writeValueAsString(responseObject), true); response = checkedResponse(basePath + "tools?id=quay.io%2Ftest_org%2Ftest6"); List<ToolV1> responseList = response.readEntity(List.class); assertTool(SUPPORT.getObjectMapper().writeValueAsString(responseList), false); }

Target:
private void toolsIdTool() throws Exception { Response response = checkedResponse(basePath + "tools/quay.io%2Ftest_org%2Ftest6"); ToolV1 responseObject = response.readEntity(ToolV1.class); assertTool(SUPPORT.getObjectMapper().writeValueAsString(responseObject), true); response = checkedResponse(basePath + "tools?id=quay.io%2Ftest_org%2Ftest6"); List<ToolV1> responseList = response.readEntity(List.class); assertTool(SUPPORT.getObjectMapper().writeValueAsString(responseList), true); }
Source:
public void setLocaleProvider(LocaleProvider localeProvider) { this.locale = localeProvider.getLocale(); }

Target:
public void setLocaleProvider(LocaleProvider localeProvider) { this.localeProvider = localeProvider; }
Source:
public int compare(String s, String s2) { if(s == s2) { return 0; } if (s == null) { return -1; } if (s2 == null) { return 1; } int res = Ints.compare(s.length(), s2.length()); if (res == 0) { res = s.compareTo(s2); } return res; }

Target:
public int compare(String s, String s2) { if (s == s2) { return 0; } return ORDERING.compare(s, s2); }
Source:
public void testNoAvailabilitiesSetsActivelyPublishedToFalse() throws IOException { LoveFilmDataRow row = rowFromFile("battle-royale-no-availability.csv"); Optional<Content> extracted = extractor.extract(row); assertTrue(extracted.isPresent()); Content content = extracted.get(); Film film = (Film) content; assertFalse(film.isActivelyPublished()); }

Target:
public void testNoAvailabilitiesSetsActivelyPublishedToFalse() throws IOException { LoveFilmDataRow row = rowFromFile("battle-royale-no-availability.csv"); Optional<Content> extracted = extractor.extract(row); Content content = extracted.get(); Film film = (Film) content; assertFalse(film.isActivelyPublished()); }
Source:
public Ref call() throws IOException { checkCallable(); Ref r; RevCommit commit; try { boolean merging = false; if (repo.getRepositoryState().equals(RepositoryState.MERGING) || repo.getRepositoryState().equals( RepositoryState.MERGING_RESOLVED)) merging = true; final ObjectId commitId; try { commitId = repo.resolve(ref); } catch (IOException e) { throw e; } RevWalk rw = new RevWalk(repo); try { commit = rw.parseCommit(commitId); } catch (IOException e) { throw e; } finally { rw.release(); } final RefUpdate ru = repo.updateRef(Constants.HEAD); ru.setNewObjectId(commitId); String refName = Repository.shortenRefName(ref); String message = "reset --" + mode.toString().toLowerCase() + " " + refName; ru.setRefLogMessage(message, false); if (ru.forceUpdate() == RefUpdate.Result.LOCK_FAILURE) throw new IOException(); switch (mode) { case HARD: checkoutIndex(commit); break; case MIXED: resetIndex(commit); break; case SOFT: case KEEP: case MERGE: } if (mode != ResetType.SOFT && merging) resetMerge(); setCallable(false); r = ru.getRef(); } catch (IOException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfResetCommand, e); } return r; }

Target:
public Ref call() throws IOException { checkCallable(); Ref r; RevCommit commit; try { boolean merging = false; if (repo.getRepositoryState().equals(RepositoryState.MERGING) || repo.getRepositoryState().equals( RepositoryState.MERGING_RESOLVED)) merging = true; final ObjectId commitId; try { commitId = repo.resolve(ref); } catch (IOException e) { throw new JGitInternalException( MessageFormat.format(JGitText.get().cannotRead, ref), e); } RevWalk rw = new RevWalk(repo); try { commit = rw.parseCommit(commitId); } catch (IOException e) { throw new JGitInternalException( MessageFormat.format( JGitText.get().cannotReadCommit, commitId.toString()), e); } finally { rw.release(); } final RefUpdate ru = repo.updateRef(Constants.HEAD); ru.setNewObjectId(commitId); String refName = Repository.shortenRefName(ref); String message = "reset --" + mode.toString().toLowerCase() + " " + refName; ru.setRefLogMessage(message, false); if (ru.forceUpdate() == RefUpdate.Result.LOCK_FAILURE) throw new JGitInternalException(MessageFormat.format( JGitText.get().cannotLock, ru.getName())); switch (mode) { case HARD: checkoutIndex(commit); break; case MIXED: resetIndex(commit); break; case SOFT: break; case KEEP: case MERGE: throw new UnsupportedOperationException(); } if (mode != ResetType.SOFT && merging) resetMerge(); setCallable(false); r = ru.getRef(); } catch (IOException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfResetCommand, e); } return r; }
Source:
private static List<RequiredFeatures> getClassRequiredFeatures(Class<?> testClass) { assertNull(testClass.getEnclosingClass(), "Add support (and tests!) if you need it"); Class<?>[] interfaces = testClass.getInterfaces(); Optional<RequiredFeatures> requiredFeatures = Optional.ofNullable(testClass.getAnnotation(RequiredFeatures.class)); return Stream.concat( requiredFeatures.map(Stream::of).orElse(Stream.empty()), Arrays.stream(interfaces) .map(SupportedTestCondition::getClassRequiredFeatures) .flatMap(List::stream)) .collect(toImmutableList()); }

Target:
private static List<ConnectorFeature> getClassRequiredFeatures(Class<?> testClass) { Preconditions.checkState(testClass.getEnclosingClass() == null, "Inner classes not supported as test classes. Add support (and tests!) if you need it"); Class<?>[] interfaces = testClass.getInterfaces(); return Streams.concat( streamOfRequired(testClass), stream(interfaces) .map(SupportedTestCondition::getClassRequiredFeatures) .flatMap(List::stream)) .collect(toImmutableList()); }
Source:
protected Map<ComponentType, String> buildCustomVersionDisplayNames() { Map<ComponentType, String> result = new HashMap<>(); result.put(ComponentType.HIVE, "Qubole Hadoop2 (Hive 2.1.1 Beta)"); result.put(ComponentType.PIG, "Qubole Hadoop2"); result.put(ComponentType.PIGOUTPUT, "Qubole Hadoop2"); result.put(ComponentType.SPARKBATCH, "Qubole Hadoop2"); return result; }

Target:
protected Map<ComponentType, String> buildCustomVersionDisplayNames() { Map<ComponentType, String> result = new HashMap<>(); result.put(ComponentType.HIVE, "Qubole Hadoop2 (Hive 2.1.1 Beta)"); result.put(ComponentType.PIG, "Qubole Hadoop2"); result.put(ComponentType.PIGOUTPUT, "Qubole Hadoop2"); result.put(ComponentType.SPARKBATCH, "Qubole Spark 2.2"); return result; }
Source:
protected ParsedSql getParsedSql(String sql) { if (getCacheLimit() <= 0) { return NamedParameterUtils.parseSqlStatement(sql); } ParsedSql parsedSql = this.parsedSqlCache.get(sql); if (parsedSql == null) { synchronized (this.parsedSqlCache) { parsedSql = this.parsedSqlCache.get(sql); if(parsedSql==null) { parsedSql = NamedParameterUtils.parseSqlStatement(sql); this.parsedSqlCache.put(sql, parsedSql); } } } return parsedSql; }

Target:
protected ParsedSql getParsedSql(String sql) { if (getCacheLimit() <= 0) { return NamedParameterUtils.parseSqlStatement(sql); } synchronized (this.parsedSqlCache) { return this.parsedSqlCache.computeIfAbsent(sql, NamedParameterUtils::parseSqlStatement); } }
Source:
public static Object[][] extraMarker() { return new Object[][]{ { "adtest", "SyntheticTests/Async/Hop/ExtraMarker?log_level=9&log_group=Wikia.Tracker", "TOP_RIGHT_BOXAD", "test-marker=42" } }; }

Target:
public static Object[][] extraMarker() { return new Object[][]{ { "adtest", "SyntheticTests/Async/Hop/ExtraMarker?log_level=9&log_group=Wikia.Tracker", "adType=async;method=hop;pos=TOP_RIGHT_BOXAD;", "test-marker=42" } }; }
Source:
public Entity checkIfEnemyNear(double radius, Class<? extends Entity> c, boolean isEnemyCheck) { Set<Entity> entities = level.getEntities(pos.x - radius, pos.y - radius, pos.x + radius, pos.y + radius, c); Entity closest = null; double closestDist = 99999999.0f; for (Entity e : entities) { final double dist = e.pos.distSqr(pos); if (dist < closestDist && !isTargetBehindWall(e.pos.x, e.pos.y, e)) { if (isEnemyCheck) { if (!(e instanceof Mob)) continue; if (!((Mob)e).isNotFriendOf(this)) continue; } closestDist = dist; closest = e; } } return closest; }

Target:
public Entity checkIfEnemyNear(double radius, Class<? extends Entity> c, boolean isEnemyCheck) { Set<Entity> entities = level.getEntities(pos.x - radius, pos.y - radius, pos.x + radius, pos.y + radius, c); Entity closest = null; double closestDist = Double.MAX_VALUE; for (Entity e : entities) { final double dist = e.pos.distSqr(pos); if (dist < closestDist && !isTargetBehindWall(e.pos.x, e.pos.y, e)) { if (isEnemyCheck) { if (!(e instanceof Mob)) continue; if (!((Mob)e).isNotFriendOf(this)) continue; } closestDist = dist; closest = e; } } return closest; }
Source:
public static String printSuppressions(File file, String suppressionLineColumnNumber, int tabWidth) throws IOException, CheckstyleException { if (VALID_SUPPRESSION_LINE_COLUMN_NUMBER_REGEX.matcher(suppressionLineColumnNumber) .matches()) { final FileText fileText = new FileText(file.getAbsoluteFile(), System.getProperty("file.encoding", StandardCharsets.UTF_8.name())); final DetailAST detailAST = parseFileText(fileText); final int lineNumber = extractLineNumber(suppressionLineColumnNumber); final int columnNumber = extractColumnNumber(suppressionLineColumnNumber); return generate(fileText, detailAST, lineNumber, columnNumber, tabWidth); } else { final String exceptionMsg = String.format(Locale.ROOT, "%s does not match valid format.", suppressionLineColumnNumber); throw new IllegalStateException(exceptionMsg); } }

Target:
public static String printSuppressions(File file, String suppressionLineColumnNumber, int tabWidth) throws IOException, CheckstyleException { final Matcher matcher = VALID_SUPPRESSION_LINE_COLUMN_NUMBER_REGEX.matcher(suppressionLineColumnNumber); if (matcher.matches()) { final FileText fileText = new FileText(file.getAbsoluteFile(), System.getProperty("file.encoding", StandardCharsets.UTF_8.name())); final DetailAST detailAST = JavaParser.parseFileText(fileText, JavaParser.Options.WITH_COMMENTS); final int lineNumber = Integer.parseInt(matcher.group(1)); final int columnNumber = Integer.parseInt(matcher.group(2)); return generate(fileText, detailAST, lineNumber, columnNumber, tabWidth); } else { final String exceptionMsg = String.format(Locale.ROOT, "%s does not match valid format 'line:column'.", suppressionLineColumnNumber); throw new IllegalStateException(exceptionMsg); } }
Source:
public static List<LookupDto> changeLookupFieldsForDay8AndDay57Report(List<LookupDto> lookups) { List<String> availableVisitTypes = Arrays.asList(VisitType.PRIME_VACCINATION_FIRST_FOLLOW_UP_VISIT.toString() + ":" + VisitType.PRIME_VACCINATION_FIRST_FOLLOW_UP_VISIT.getValue(), VisitType.BOOST_VACCINATION_DAY.toString() + ":" + VisitType.BOOST_VACCINATION_DAY.getValue()); for(LookupDto lookup : lookups) { for(LookupFieldDto lookupFieldDto : lookup.getLookupFields()) { if(lookupFieldDto.getDisplayName().equals("Visit Type")) { for(SettingDto settingDto : lookupFieldDto.getSettings()) { if(settingDto.getName().equals("mds.form.label.values")) { settingDto.setValue(availableVisitTypes); } break; } } break; } } return lookups; }

Target:
public static List<LookupDto> changeLookupFieldsForDay8AndDay57Report(List<LookupDto> lookups) { List<String> availableVisitTypes = Arrays.asList(VisitType.PRIME_VACCINATION_FIRST_FOLLOW_UP_VISIT.toString() + ":" + VisitType.PRIME_VACCINATION_FIRST_FOLLOW_UP_VISIT.getValue(), VisitType.BOOST_VACCINATION_DAY.toString() + ":" + VisitType.BOOST_VACCINATION_DAY.getValue()); for(LookupDto lookup : lookups) { for(LookupFieldDto lookupFieldDto : lookup.getLookupFields()) { if(lookupFieldDto.getDisplayName().equals("Visit Type")) { for(SettingDto settingDto : lookupFieldDto.getSettings()) { if(settingDto.getName().equals("mds.form.label.values")) { settingDto.setValue(availableVisitTypes); break; } } break; } } } return lookups; }
Source:
String catalogMatchesCompilerFunctionSet(Client client) throws NoConnectionsException, IOException, ProcCallException { StringBuffer success = new StringBuffer(); Set<String> dfns = FunctionForVoltDB.getAllUserDefinedFunctionNamesForDebugging(); VoltTable vt = client.callProcedure("@SystemCatalog", "functions").getResults()[0]; if (!(dfns.size() - 1 == vt.getRowCount() && dfns.contains("FORMAT_TIMESTAMP"))) { success.append(String.format("Compiler set has %d elements, catalog has %d functions\n", dfns.size(), vt.getRowCount())); } else { return ""; } success.append("Catalog:\n"); while (vt.advanceRow()) { String name = vt.getString("FUNCTION_NAME"); success.append(" ") .append(name); if ( ! dfns.contains(name)) { success.append("(*)"); } success.append("\n"); } success.append("FunctionForVolt:\n"); for (String dfn : dfns) { success.append(" " + dfn + "\n"); } return success.toString(); }

Target:
String catalogMatchesCompilerFunctionSet(Client client) throws NoConnectionsException, IOException, ProcCallException { StringBuffer success = new StringBuffer(); Set<String> dfns = FunctionForVoltDB.getAllUserDefinedFunctionNamesForDebugging(); VoltTable vt = client.callProcedure("@SystemCatalog", "functions").getResults()[0]; if (dfns.size() != vt.getRowCount()) { success.append(String.format("Compiler set has %d elements, catalog has %d functions\n", dfns.size(), vt.getRowCount())); } else { return ""; } success.append("Catalog:\n"); while (vt.advanceRow()) { String name = vt.getString("FUNCTION_NAME"); success.append(" ") .append(name); if ( ! dfns.contains(name)) { success.append("(*)"); } success.append("\n"); } success.append("FunctionForVolt:\n"); for (String dfn : dfns) { success.append(" " + dfn + "\n"); } return success.toString(); }
Source:
public ProfileLaunchShortcut getProfilingProvider(String type) { IExtensionPoint extPoint = Platform.getExtensionRegistry() .getExtensionPoint(ProfileLaunchPlugin.PLUGIN_ID, "launchProvider"); IConfigurationElement[] configs = extPoint.getConfigurationElements(); ArrayList<IConfigurationElement> configList = new ArrayList<IConfigurationElement>(); for (IConfigurationElement config : configs) { if (config.getName().equals("provider")) { String currentType = config.getAttribute("type"); String shortcut = config.getAttribute("shortcut"); if (currentType != null && shortcut != null && currentType.equals(type)) { String priority = config.getAttribute("priority"); if (priority != null) { try { Integer.parseInt(priority); configList.add(config); } catch (Exception e) { } } } } } Collections.sort(configList, new Comparator<IConfigurationElement>() { public int compare(IConfigurationElement c1, IConfigurationElement c2) { int p1, p2; try { p1 = Integer.parseInt(c1.getAttribute("priority")); if (p1 <= 0) { return 1; } } catch (NumberFormatException e) { return 1; } try { p2 = Integer.parseInt(c2.getAttribute("priority")); if (p2 <= 0) { return -1; } } catch (NumberFormatException e) { return -1; } return p1 < p2 ? -1 : 1; } }); for (IConfigurationElement config : configList) { try { Object obj = config.createExecutableExtension("shortcut"); if (obj instanceof ProfileLaunchShortcut) { return (ProfileLaunchShortcut) obj; } } catch (CoreException e) { } } return null; }

Target:
public ProfileLaunchShortcut getProfilingProvider(String type) { IExtensionPoint extPoint = Platform.getExtensionRegistry() .getExtensionPoint(ProfileLaunchPlugin.PLUGIN_ID, "launchProvider"); IConfigurationElement[] configs = extPoint.getConfigurationElements(); ArrayList<IConfigurationElement> configList = new ArrayList<IConfigurationElement>(); for (IConfigurationElement config : configs) { if (config.getName().equals("provider")) { String currentType = config.getAttribute("type"); String shortcut = config.getAttribute("shortcut"); if (currentType != null && shortcut != null && currentType.equals(type)) { String priority = config.getAttribute("priority"); if (priority != null) { try { Integer.parseInt(priority); configList.add(config); } catch (NumberFormatException e) { } } } } } Collections.sort(configList, new Comparator<IConfigurationElement>() { public int compare(IConfigurationElement c1, IConfigurationElement c2) { int p1, p2; try { p1 = Integer.parseInt(c1.getAttribute("priority")); if (p1 <= 0) { return 1; } } catch (NumberFormatException e) { return 1; } try { p2 = Integer.parseInt(c2.getAttribute("priority")); if (p2 <= 0) { return -1; } } catch (NumberFormatException e) { return -1; } return p1 < p2 ? -1 : 1; } }); for (IConfigurationElement config : configList) { try { Object obj = config.createExecutableExtension("shortcut"); if (obj instanceof ProfileLaunchShortcut) { return (ProfileLaunchShortcut) obj; } } catch (CoreException e) { } } return null; }
Source:
public ElasticPool(int sizeLimit) { elements = new ConcurrentLinkedQueue<>(); semaphore = new Semaphore(sizeLimit); }

Target:
public ElasticPool(int sizeLimit) { elements = new ConcurrentLinkedQueue<>(); semaphore = new Semaphore(sizeLimit, true); }
Source:
public TabbarArrangeMenuManager(IDiagramWorkbenchPart iDiagramWorkbenchPart) { this.representationPart = iDiagramWorkbenchPart; ISelectionService selectionService = (ISelectionService) representationPart.getSite().getService(ISelectionService.class); if (selectionService != null) { selectionService.addSelectionListener(this); } }

Target:
public TabbarArrangeMenuManager(IDiagramWorkbenchPart iDiagramWorkbenchPart) { this.representationPart = iDiagramWorkbenchPart; EclipseUIUtil.addSelectionListener(this.representationPart, this); }
Source:
@Test public void tesEventOnRegistrationWithSameEmailAsExistingUser() { DocumentModel userInfo = buildSampleUserInfo(); userInfo.setPropertyValue("userinfo:login", "vdu-" + userInfo.getPropertyValue("userinfo:login")); userInfo.setPropertyValue("userinfo:email", "vdu-" + userInfo.getPropertyValue("userinfo:email")); DocumentModel user1 = userManager.getBareUserModel(); user1.setPropertyValue(userManager.getUserIdField(), userInfo.getPropertyValue("userinfo:login") + "2"); user1.setPropertyValue(userManager.getUserEmailField(), userInfo.getPropertyValue("userinfo:email")); userManager.createUser(user1); try { userRegistrationService.submitRegistrationRequest(userInfo, buildAdditionalInfo(), UserInvitationService.ValidationMethod.NONE, true); fail("submitRegistrationRequest() should have thrown an exception as the email address is already used."); } catch (UserAlreadyExistsException e) { e.printStackTrace(); DocumentModelList regDocs = session.query("SELECT * FROM Document WHERE ecm:primaryType='TestRegistration'" + " AND userinfo:login='" + userInfo.getPropertyValue("userinfo:login") + "'" ); assertTrue("A 'TestRegistration' document should not have been created as the email address is already used. (" + (!regDocs.isEmpty() ? regDocs.get(0).getProperties("userinfo") + ")" : ""), regDocs.isEmpty()); } }

Target:
@Test public void tesEventOnRegistrationWithSameEmailAsExistingUser() { DocumentModel userInfo = buildSampleUserInfo(); userInfo.setPropertyValue("userinfo:login", "vdu-" + userInfo.getPropertyValue("userinfo:login")); userInfo.setPropertyValue("userinfo:email", "vdu-" + userInfo.getPropertyValue("userinfo:email")); DocumentModel user1 = userManager.getBareUserModel(); user1.setPropertyValue(userManager.getUserIdField(), userInfo.getPropertyValue("userinfo:login") + "2"); user1.setPropertyValue(userManager.getUserEmailField(), userInfo.getPropertyValue("userinfo:email")); userManager.createUser(user1); try { userRegistrationService.submitRegistrationRequest(userInfo, buildAdditionalInfo(), UserInvitationService.ValidationMethod.NONE, true); fail("submitRegistrationRequest() should have thrown an exception as the email address is already used."); } catch (UserAlreadyExistsException e) { DocumentModelList regDocs = session.query("SELECT * FROM TestRegistration WHERE " + "userinfo:login='" + userInfo.getPropertyValue("userinfo:login") + "'" ); assertTrue("A 'TestRegistration' document should not have been created as the email address is already used. (" + (!regDocs.isEmpty() ? regDocs.get(0).getProperties("userinfo") + ")" : ""), regDocs.isEmpty()); } }
Source:
public void saveCurrentProperty() { List<Property> ppList = getProperties(); for (Property pp : ppList) { this.property = pp; Process currentProcess = this.currentProcess; List<Property> propertyList = currentProcess.getProperties(); for (Property processProperty : propertyList) { if (processProperty.getTitle() == null) { currentProcess.getProperties().remove(processProperty); } } for (Process process : this.property.getProcesses()) { if (!process.getProperties().contains(this.property)) { process.getProperties().add(this.property); } } try { serviceManager.getProcessService().save(this.currentProcess); Helper.setMeldung("propertySaved"); } catch (DataException e) { logger.error(e.getMessage(), e); Helper.setFehlerMeldung("propertyNotSaved"); } } }

Target:
public void saveCurrentProperty() { List<Property> ppList = getProperties(); for (Property pp : ppList) { this.property = pp; Process currentProcess = this.currentProcess; List<Property> propertyList = currentProcess.getProperties(); for (Property processProperty : propertyList) { if (processProperty.getTitle() == null) { currentProcess.getProperties().remove(processProperty); } } for (Process process : this.property.getProcesses()) { if (!process.getProperties().contains(this.property)) { process.getProperties().add(this.property); } } try { serviceManager.getProcessService().save(this.currentProcess); Helper.setMeldung("propertySaved"); } catch (DataException e) { Helper.setErrorMessage("propertyNotSaved", logger, e); } } }
Source:
public Map<String, Serializable> getAllNonTaskVariablesInjectNodesFile(TaskContext taskContext, String nodesFile) { Map<String, Serializable> variables = new HashMap<>(); Map<String, Serializable> dictionary = new HashMap<>(); try { if (taskContext != null) { variables.putAll(extractSystemVariables(taskContext, nodesFile)); variables.putAll(extractJobVariables(taskContext)); variables.putAll(extractInheritedVariables(taskContext)); } dictionary = extractAllVariables(taskContext, null, nodesFile); } catch (IOException | ClassNotFoundException e) { logger.error("Error reading variables from task context!"); } return resolveVariables(variables, dictionary); }

Target:
public Map<String, Serializable> getAllNonTaskVariablesInjectNodesFile(TaskContext taskContext, String nodesFile) { Map<String, Serializable> variables = new HashMap<>(); Map<String, Serializable> dictionary = new HashMap<>(); try { variables.putAll(extractJobVariables(taskContext)); variables.putAll(extractInheritedVariables(taskContext)); variables.putAll(extractSystemVariables(taskContext, nodesFile)); dictionary = extractAllVariables(taskContext, null, nodesFile); } catch (IOException | ClassNotFoundException e) { logger.error(ERROR_READING_VARIABLES, e); } return resolveVariables(variables, dictionary); }
Source:
private void flush() { Thread thread = Thread.currentThread(); boolean queued = false; while (true) { ControlEntry entry = null; synchronized (this) { if (flushing != null && flushing != thread) return; flushing = thread; Slot slot = slots.peek(); if (slot != null) entry = slot.entry; if (entry == null) { flushing = null; break; } slots.poll(); } queued |= flusher.append(entry); } if (queued) flusher.iterate(); }

Target:
private void flush() { Thread thread = Thread.currentThread(); boolean queued = false; while (true) { ControlEntry entry; synchronized (this) { if (flushing == null) flushing = thread; else if (flushing != thread) return; Slot slot = slots.peek(); entry = slot == null ? null : slot.entry; if (entry == null) { flushing = null; break; } slots.poll(); } queued |= flusher.append(entry); } if (queued) flusher.iterate(); }
Source:
public SiteIsolationHeaderScanner(Supplier<AlertBuilder> newAlert) { this.newAlert = newAlert; }

Target:
SiteIsolationHeaderScanner(Supplier<AlertBuilder> newAlert) { this.newAlert = newAlert; }