auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void presentIntentImportFatalError() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { Bundle args = new Bundle(); args.putBoolean("shouldShowRationale", shouldShowRequestPermissionRationale(Manifest.permission.READ_EXTERNAL_STORAGE)); PermissionAlertDialogFragment permissionDialogFragment = PermissionAlertDialogFragment.newInstance(); permissionDialogFragment.setArguments(args); navigationHandler.showDialog(permissionDialogFragment); } else { Toast.makeText(this, R.string.toast_attachment_error, Toast.LENGTH_SHORT).show(); finish(); } }

Target:
public void presentIntentImportFatalError() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { navigationHandler.showDialog(PermissionAlertDialogFragment.newInstance(this)); } else { Toast.makeText(this, R.string.toast_attachment_error, Toast.LENGTH_SHORT).show(); finish(); } }
Source:
void executeDrop(String... statements) { for (String statement : statements) { session.query("DROP " + statement, emptyMap()); } }

Target:
void executeDrop(String... statements) { for (String statement : statements) { Transaction tx = service.beginTx(); try { service.execute("DROP " + statement); tx.success(); } catch (Exception e) { logger.trace("Could not execute drop for statement (this is likely expected) {}", statement, e); tx.failure(); } tx.close(); } }
Source:
public AnyValue mapNode( VirtualNodeValue value ) { if ( value instanceof NodeValue ) { return value; } needsConversion = true; return value; }

Target:
public AnyValue mapNode( VirtualNodeValue value ) { if ( !needsConversion ) { needsConversion = value instanceof NodeReference; } return value; }
Source:
public void SignUp_validation_1() { SignUpPageObject signUpPage = new SignUpPageObject(driver); signUpPage.openSignUpPage(); signUpPage.typeInUserName(signUpPage.getTimeStamp()); String userNameEmail = Properties.emailQaart4; signUpPage.typeInEmail(userNameEmail); signUpPage.typeInPassword(signUpPage.getTimeStamp()); signUpPage.enterBirthDate( PageContent.wikiSignUpBirthMonth, PageContent.wikiSignUpBirthDay, PageContent.wikiSignUpBirthYear ); signUpPage.enterWrongBlurryWord(); signUpPage.clickCreateAccountButton(); signUpPage.verifyWrongBlurryWordValidation(); }

Target:
public void SignUp_validation_1() { SignUpPageObject signUpPage = new SignUpPageObject(driver); signUpPage.openSignUpPage(); signUpPage.typeInUserName(signUpPage.getTimeStamp()); signUpPage.typeInEmail(Properties.emailQaart4); signUpPage.typeInPassword(signUpPage.getTimeStamp()); signUpPage.enterBirthDate( PageContent.wikiSignUpBirthMonth, PageContent.wikiSignUpBirthDay, PageContent.wikiSignUpBirthYear ); signUpPage.enterWrongBlurryWord(); signUpPage.clickCreateAccountButton(); signUpPage.verifyWrongBlurryWordValidation(); }
Source:
public void onMapReady(GoogleMap gMap) { map = gMap; if (Build.VERSION.SDK_INT < 16) { View rootView = proxy.getActivity().findViewById(android.R.id.content); setBackgroundTransparent(rootView); } mMarkerManager = new MarkerManager(map); mMarkerManager.newCollection(DEFAULT_COLLECTION_ID); mMarkerManager.getCollection(DEFAULT_COLLECTION_ID).setOnMarkerClickListener(this); mClusterManager = new ClusterManager<TiClusterMarker>(TiApplication.getInstance().getApplicationContext(), map, mMarkerManager); mClusterManager.setRenderer( new TiClusterRenderer(TiApplication.getInstance().getApplicationContext(), map, mClusterManager)); processMapProperties(proxy.getProperties()); processPreloadRoutes(); processPreloadPolygons(); processPreloadCircles(); processPreloadPolylines(); processOverlaysList(); map.setOnMarkerClickListener(mMarkerManager); map.setOnMapClickListener(this); map.setOnCameraIdleListener(this); map.setOnCameraMoveStartedListener(this); map.setOnCameraMoveListener(this); map.setOnMarkerDragListener(this); map.setOnInfoWindowClickListener(this); map.setInfoWindowAdapter(this); map.setOnMapLongClickListener(this); map.setOnMapLoadedCallback(this); mClusterManager.setOnClusterClickListener(this); ((ViewProxy) proxy).clearPreloadObjects(); }

Target:
public void onMapReady(GoogleMap gMap) { map = gMap; if (Build.VERSION.SDK_INT < 16) { View rootView = proxy.getActivity().findViewById(android.R.id.content); setBackgroundTransparent(rootView); } mMarkerManager = new MarkerManager(map); mMarkerManager.newCollection(DEFAULT_COLLECTION_ID); mMarkerManager.getCollection(DEFAULT_COLLECTION_ID).setOnMarkerClickListener(this); mClusterManager = new ClusterManager<TiMarker>(TiApplication.getInstance().getApplicationContext(), map, mMarkerManager); mClusterManager.setRenderer( new TiClusterRenderer(TiApplication.getInstance().getApplicationContext(), map, mClusterManager)); processMapProperties(proxy.getProperties()); processPreloadRoutes(); processPreloadPolygons(); processPreloadCircles(); processPreloadPolylines(); processOverlaysList(); map.setOnMarkerClickListener(mMarkerManager); map.setOnMapClickListener(this); map.setOnCameraIdleListener(this); map.setOnCameraMoveStartedListener(this); map.setOnCameraMoveListener(this); map.setOnMarkerDragListener(this); map.setOnInfoWindowClickListener(this); map.setInfoWindowAdapter(this); map.setOnMapLongClickListener(this); map.setOnMapLoadedCallback(this); mClusterManager.setOnClusterClickListener(this); mClusterManager.setOnClusterItemClickListener(this); ((ViewProxy) proxy).clearPreloadObjects(); }
Source:
CucumberThreadFactory() { SecurityManager s = System.getSecurityManager(); this.group = s != null ? s.getThreadGroup() : Thread.currentThread().getThreadGroup(); }

Target:
CucumberThreadFactory() { this.namePrefix = "cucumber-runner-" + poolNumber.getAndIncrement() + "-thread-"; }
Source:
public boolean setTTL(String key, long ttl) { Document filter = new Document(ID_KEY, key); Document update; if (ttl == 0) { update = new Document(MONGODB_UNSET, new Document(TTL_KEY, ONE)); } else { Document doc = new Document(); setTTL(doc, ttl); update = new Document(MONGODB_SET, doc); } if (log.isTraceEnabled()) { log.trace("MongoDB: SETTTL " + key + " = " + ttl); } UpdateResult res = coll.updateOne(filter, update); return res.getModifiedCount() == 1; }

Target:
public boolean setTTL(String key, long ttl) { Bson filter = eq(ID_KEY, key); Bson update; if (ttl == 0) { update = unset(TTL_KEY); } else { update = set(TTL_KEY, getDateFromTTL(ttl)); } if (log.isTraceEnabled()) { log.trace("MongoDB: SETTTL " + key + " = " + ttl); } UpdateResult res = coll.updateOne(filter, update); return res.getModifiedCount() == 1; }
Source:
public static void setReindexOnConfigChange(IProject project, boolean shouldReindexOnConfigChange) { if (shouldReindexOnConfigChange != getReindexOnConfigChange(project)) { getProjectPreferences(project).putBoolean(KEY_REINDEX_ON_CONFIG_CHANGE, shouldReindexOnConfigChange); CCoreInternals.savePreferences(project, true); } }

Target:
public static void setReindexOnConfigChange(IProject project, boolean shouldReindexOnConfigChange) { if (shouldReindexOnConfigChange != getReindexOnConfigChange(project)) { getProjectPreferences(project).putBoolean(KEY_REINDEX_ON_CONFIG_CHANGE, shouldReindexOnConfigChange); } }
Source:
protected final List<Component> getAdditionalButtons() { if (mode == Mode.UNITS_TO_PLACE_VIEW_DETACHED) { return Arrays.asList(new Component[0]); } updateUnits(); return Arrays.asList(SwingComponents.leftBox(leftToPlaceLabel), add(unitsToPlacePanel)); }

Target:
protected final List<Component> getAdditionalButtons() { if (mode == Mode.UNITS_TO_PLACE_VIEW_DETACHED) { return super.getAdditionalButtons(); } updateUnits(); return Arrays.asList(SwingComponents.leftBox(leftToPlaceLabel), add(unitsToPlacePanel)); }
Source:
public void setUp() throws Exception { if (resourceFilter instanceof TaskResourceFilter) { EasyMock.expect(tsqa.getTask(EasyMock.anyString())).andReturn(Optional.of(noopTask)).anyTimes(); Field tsqaField = TaskResourceFilter.class.getDeclaredField("taskStorageQueryAdapter"); tsqaField.setAccessible(true); tsqaField.set(resourceFilter, tsqa); } setUp(resourceFilter); }

Target:
public void setUp() throws Exception { if (resourceFilter instanceof TaskResourceFilter && !mockedOnce) { tsqa = injector.getInstance(TaskStorageQueryAdapter.class); EasyMock.expect(tsqa.getTask(EasyMock.anyString())).andReturn(Optional.of(noopTask)).anyTimes(); EasyMock.replay(tsqa); mockedOnce = true; } setUp(resourceFilter); }
Source:
public synchronized void start() { try (SetThreadName ignored = new SetThreadName("Query-%s", delegate.getQueryId())) { try { if (memoryManager.preAllocateQueryMemory(delegate.getQueryId(), peakMemoryEstimate)) { delegate.addStateChangeListener(state -> { if (state.isDone()) { memoryManager.removePreAllocation(delegate.getQueryId()); } }); delegate.start(); return; } if (!startedWaiting) { memoryManager.addChangeListener(GENERAL_POOL, none -> start()); memoryManager.addChangeListener(RESERVED_POOL, none -> start()); delegate.startWaitingForResources(); startedWaiting = true; } } catch (Throwable e) { fail(e); throwIfInstanceOf(e, Error.class); } } }

Target:
public synchronized void start() { try (SetThreadName ignored = new SetThreadName("Query-%s", delegate.getQueryId())) { try { if (memoryManager.preAllocateQueryMemory(delegate.getQueryId(), peakMemoryEstimate)) { delegate.addStateChangeListener(state -> { if (state.isDone()) { memoryManager.removePreAllocation(delegate.getQueryId()); } }); delegate.start(); return; } if (!startedWaiting) { startedWaiting = true; delegate.startWaitingForResources(); memoryManager.addChangeListener(GENERAL_POOL, none -> start()); memoryManager.addChangeListener(RESERVED_POOL, none -> start()); } } catch (Throwable e) { fail(e); throwIfInstanceOf(e, Error.class); } } }
Source:
private static void verifyValidClassName(String confOption, String className, Class<?> requiredBaseClass) { try { ConfigurationTypeHelper.getClassInstance(null, className, requiredBaseClass); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IOException | NoSuchMethodException | InvocationTargetException e) { fatal(confOption + " has an invalid class name: " + className); } catch (ClassCastException e) { fatal(confOption + " must implement " + requiredBaseClass + ", but the configured class does not: " + className); } }

Target:
private static void verifyValidClassName(String confOption, String className, Class<?> requiredBaseClass) { try { ConfigurationTypeHelper.getClassInstance(null, className, requiredBaseClass); } catch (IOException | ReflectiveOperationException e) { fatal(confOption + " has an invalid class name: " + className); } catch (ClassCastException e) { fatal(confOption + " must implement " + requiredBaseClass + ", but the configured class does not: " + className); } }
Source:
public JPAInitializer(PersistService service) { service.start(); }

Target:
private JPAInitializer(PersistService service) { service.start(); }
Source:
public Jdbi setStatementLocator(StatementLocator locator) { if (locator == null) { throw new IllegalArgumentException("null statement locator"); } config.statementLocator = locator; return this; }

Target:
public Jdbi setStatementLocator(StatementLocator locator) { Objects.requireNonNull(locator, "null statement locator"); config.statementLocator = locator; return this; }
Source:
public AttachDiskToVmCommand(T parameters) { super(parameters); disk = loadDiskById((Guid) getParameters().getEntityId()); }

Target:
public AttachDiskToVmCommand(T parameters) { super(parameters); disk = getDiskDao().get((Guid) getParameters().getEntityId()); }
Source:
public AnnotationMemberDeclaration setDefaultValue(Expression defaultValue) { notifyPropertyChange("defaultValue", this.defaultValue, defaultValue); this.defaultValue = defaultValue; setAsParentNodeOf(defaultValue); return this; }

Target:
public AnnotationMemberDeclaration setDefaultValue(Expression defaultValue) { notifyPropertyChange(ObservableProperty.DEFAULT_VALUE, this.defaultValue, defaultValue); this.defaultValue = defaultValue; setAsParentNodeOf(defaultValue); return this; }
Source:
private String dumpLoadVerify(List<String> tableNames, String lastReplicationId, boolean parallelLoad, boolean metadataOnly, boolean failRetry) throws Throwable { List<String> withClauseList; parallelLoad = parallelLoad && (lastReplicationId == null); if (metadataOnly) { withClauseList = Collections.singletonList("'hive.repl.dump.metadata.only'='true'"); } else { withClauseList = Collections.emptyList(); } WarehouseInstance.Tuple dumpTuple = primary.run("use " + primaryDbName) .dump(primaryDbName, lastReplicationId, withClauseList); if (parallelLoad) { replica.hiveConf.setBoolVar(HiveConf.ConfVars.EXECPARALLEL, true); } if (failRetry) { if (lastReplicationId == null) { failBootstrapLoad(dumpTuple, tableNames.size()/2); } else { failIncrementalLoad(dumpTuple, tableNames.size()/2); } } replica.load(replicatedDbName, dumpTuple.dumpLocation) .run("use " + replicatedDbName) .run("show tables") .verifyResults(tableNames.toArray(new String[1])); if (!metadataOnly) { replica.run("repl status " + replicatedDbName) .verifyResult(dumpTuple.lastReplicationId); } if (parallelLoad) { replica.hiveConf.setBoolVar(HiveConf.ConfVars.EXECPARALLEL, false); } for (String name : tableNames) { if (metadataOnly) { verifyNoStatsReplicationForMetadataOnly(name); } else { verifyReplicatedStatsForTable(name); } } return dumpTuple.lastReplicationId; }

Target:
private String dumpLoadVerify(List<String> tableNames, String lastReplicationId, boolean parallelLoad, boolean metadataOnly, boolean failRetry) throws Throwable { List<String> withClauseList; parallelLoad = parallelLoad && (lastReplicationId == null); if (metadataOnly) { withClauseList = Collections.singletonList("'hive.repl.dump.metadata.only'='true'"); } else { withClauseList = Collections.emptyList(); } WarehouseInstance.Tuple dumpTuple = primary.run("use " + primaryDbName) .dump(primaryDbName, lastReplicationId, withClauseList); if (parallelLoad) { replica.hiveConf.setBoolVar(HiveConf.ConfVars.EXECPARALLEL, true); } if (failRetry) { if (lastReplicationId == null) { failBootstrapLoad(dumpTuple, tableNames.size()/2); } else { failIncrementalLoad(dumpTuple); } } replica.load(replicatedDbName, dumpTuple.dumpLocation); if (!metadataOnly) { replica.run("repl status " + replicatedDbName) .verifyResult(dumpTuple.lastReplicationId); } if (parallelLoad) { replica.hiveConf.setBoolVar(HiveConf.ConfVars.EXECPARALLEL, false); } for (String name : tableNames) { if (metadataOnly) { verifyNoStatsReplicationForMetadataOnly(name); } else { verifyReplicatedStatsForTable(name); } } return dumpTuple.lastReplicationId; }
Source:
public void verify_with_provided_test_jar() throws IOException { String testJarsPathname = "target/my-test-jars"; File file = new File(testJarsPathname); if (file.mkdir()) { IssuableSubscriptionVisitor visitor = new IssuableSubscriptionVisitor() { @Override public List<Tree.Kind> nodesToVisit() { return ImmutableList.of(); } @Override public void scanFile(JavaFileScannerContext context) { super.scanFile(context); addIssue(1, "message"); addIssue(3, "message1"); addIssue(7, "message2"); addIssue(8, "message3"); addIssue(8, "message3"); addIssue(10, "message4"); addIssue(10, "message4"); addIssue(11, "no message"); } }; JavaCheckVerifier.verify(FILENAME_ISSUES, visitor, testJarsPathname); file.delete(); } }

Target:
public void verify_with_provided_test_jar() throws IOException { String testJarsPathname = "target/my-test-jars"; File file = new File(testJarsPathname); if (file.exists()) { file.delete(); } if (file.mkdir()) { IssuableSubscriptionVisitor visitor = new FakeVisitor().withDefaultIssues(); JavaCheckVerifier.verify(FILENAME_ISSUES, visitor, testJarsPathname); file.delete(); } else { Fail.fail(); } }
Source:
public void processEvent(final Map<String, String> dispatchMap) { super.processEvent(dispatchMap); final List eventList = getEventList(); final int size = eventList.size(); for (int i = 0; i < size; i++) { final Pair eventPair = (Pair<String, String>) eventList.get(i); final String name = (String) eventPair.first; if (name.equals(EventStrings.AUTHORITY_TYPE) || name.equals(EventStrings.API_DEPRECATED) || name.equals(EventStrings.AUTHORITY_VALIDATION) || name.equals(EventStrings.EXTENDED_EXPIRES_ON_SETTING) || name.equals(EventStrings.PROMPT_BEHAVIOR) || name.equals(EventStrings.WAS_SUCCESSFUL) || name.equals(EventStrings.IDP_NAME) || name.equals(EventStrings.TENANT_ID) || name.equals(EventStrings.USER_ID) || name.equals(EventStrings.LOGIN_HINT) || name.equals(EventStrings.RESPONSE_TIME) || name.equals(EventStrings.CORRELATION_ID) || name.equals(EventStrings.REQUEST_ID) || name.equals(EventStrings.API_ID) || name.equals(EventStrings.API_ERROR_CODE)) { dispatchMap.put(name, (String) eventPair.second); } } }

Target:
public void processEvent(final Map<String, String> dispatchMap) { super.processEvent(dispatchMap); final List<Pair<String, String>> eventList = getEventList(); for (Pair<String, String> eventPair : eventList) { final String name = eventPair.first; if (name.equals(EventStrings.AUTHORITY_TYPE) || name.equals(EventStrings.API_DEPRECATED) || name.equals(EventStrings.AUTHORITY_VALIDATION) || name.equals(EventStrings.EXTENDED_EXPIRES_ON_SETTING) || name.equals(EventStrings.PROMPT_BEHAVIOR) || name.equals(EventStrings.WAS_SUCCESSFUL) || name.equals(EventStrings.IDP_NAME) || name.equals(EventStrings.TENANT_ID) || name.equals(EventStrings.USER_ID) || name.equals(EventStrings.LOGIN_HINT) || name.equals(EventStrings.RESPONSE_TIME) || name.equals(EventStrings.CORRELATION_ID) || name.equals(EventStrings.REQUEST_ID) || name.equals(EventStrings.API_ID) || name.equals(EventStrings.API_ERROR_CODE)) { dispatchMap.put(name, eventPair.second); } } }
Source:
public boolean isDurable() { if (messageID < 0) { durable = getMessage().isDurable(); } return durable; }

Target:
public boolean isDurable() { if (durable == UNDEFINED_IS_DURABLE) { durable = getMessage().isDurable() ? IS_DURABLE : IS_NOT_DURABLE; } return durable == IS_DURABLE; }
Source:
public synchronized long getRowCount() { return rowCount.get(); }

Target:
public long getRowCount() { return rowCount.get(); }
Source:
public CreateImageRemoteCallable(BuildListener listener, Config cfgData, Descriptor<?> descriptor, String expandedDockerFolder, String expandedImageTag, String dockerFileRes, Map<String, String> buildArgsMap, boolean noCache, boolean rm) { this.expandedDockerFolder = expandedDockerFolder; this.expandedImageTag = expandedImageTag; this.dockerFileRes = dockerFileRes; this.cfgData = cfgData; this.buildArgsMap = buildArgsMap; this.noCache = noCache; this.rm = rm; this.descriptor = descriptor; }

Target:
public CreateImageRemoteCallable(BuildListener listener, Config cfgData, Descriptor<?> descriptor, String expandedDockerFolder, String expandedImageTag, String dockerFileRes, Map<String, String> buildArgsMap, boolean noCache, boolean rm) { this.expandedDockerFolder = expandedDockerFolder; this.expandedImageTag = expandedImageTag; this.dockerFileRes = dockerFileRes; this.cfgData = cfgData; this.buildArgsMap = buildArgsMap; this.noCache = noCache; this.rm = rm; this.descriptor = descriptor; this.listener = listener; }
Source:
public PentahoOrcInputFormat( NamedCluster namedCluster ) { if ( namedCluster == null ) { conf = new Configuration(); } else { conf = inClassloader( () -> { Configuration confProxy = new ConfigurationProxy(); confProxy.addResource( "hive-site.xml" ); BiConsumer<InputStream, String> consumer = ( is, filename ) -> { confProxy.addResource( is, filename ); }; ShimConfigsLoader.addConfigsAsResources( namedCluster, consumer ); return confProxy; } ); } }

Target:
public PentahoOrcInputFormat( NamedCluster namedCluster ) { if ( namedCluster == null ) { conf = new Configuration(); } else { conf = inClassloader( () -> { Configuration confProxy = new ConfigurationProxy(); confProxy.addResource( "hive-site.xml" ); BiConsumer<InputStream, String> consumer = ( is, filename ) -> confProxy.addResource( is, filename ); ShimConfigsLoader.addConfigsAsResources( namedCluster, consumer ); return confProxy; } ); } }
Source:
public static String replaceExtension(String originalName, String newExtension) { if (originalName == null | originalName == "") { return originalName; } int extensionIndex = originalName.lastIndexOf("."); if (extensionIndex != -1 ) { return originalName.substring(0, extensionIndex) + "."+newExtension ; } else if (newExtension != "") { return originalName +"."+newExtension ; } else { return originalName ; } }

Target:
public static String replaceExtension(String originalName, String newExtension) { int extensionIndex = originalName.lastIndexOf("."); if (extensionIndex != -1 ) { return originalName.substring(0, extensionIndex) + "."+newExtension ; } else { return originalName +"."+newExtension ; } }
Source:
public ZkBucketDataAccessor(String zkAddr, int bucketSize, int numVersions) { HelixZkClient zkClient = DedicatedZkClientFactory.getInstance() .buildZkClient(new HelixZkClient.ZkConnectionConfig(zkAddr)); zkClient.setZkSerializer(new ZkSerializer() { @Override public byte[] serialize(Object data) throws ZkMarshallingError { if (data instanceof byte[]) { return (byte[]) data; } throw new HelixException("ZkBucketDataAccesor only supports a byte array as an argument!"); } @Override public Object deserialize(byte[] data) throws ZkMarshallingError { return data; } }); _zkBaseDataAccessor = new ZkBaseDataAccessor(zkClient); HelixZkClient znRecordClient = DedicatedZkClientFactory.getInstance() .buildZkClient(new HelixZkClient.ZkConnectionConfig(zkAddr)); _znRecordBaseDataAccessor = new ZkBaseDataAccessor<>(znRecordClient); znRecordClient.setZkSerializer(new ZNRecordSerializer()); _zkSerializer = new ZNRecordJacksonSerializer(); _bucketSize = bucketSize; _numVersions = numVersions; }

Target:
public ZkBucketDataAccessor(String zkAddr, int bucketSize, int numVersions) { _zkClient = DedicatedZkClientFactory.getInstance() .buildZkClient(new HelixZkClient.ZkConnectionConfig(zkAddr)); _zkClient.setZkSerializer(new ZkSerializer() { @Override public byte[] serialize(Object data) throws ZkMarshallingError { if (data instanceof byte[]) { return (byte[]) data; } throw new HelixException("ZkBucketDataAccesor only supports a byte array as an argument!"); } @Override public Object deserialize(byte[] data) throws ZkMarshallingError { return data; } }); _zkBaseDataAccessor = new ZkBaseDataAccessor(_zkClient); _znRecordClient = SharedZkClientFactory.getInstance() .buildZkClient(new HelixZkClient.ZkConnectionConfig(zkAddr)); _znRecordBaseDataAccessor = new ZkBaseDataAccessor<>(_znRecordClient); _znRecordClient.setZkSerializer(new ZNRecordSerializer()); _zkSerializer = new ZNRecordJacksonSerializer(); _bucketSize = bucketSize; _numVersions = numVersions; }
Source:
public void deserialize( Block block, int index, DifferentialEntropyState state) { SliceInput input = VARBINARY.getSlice(block, index).getInput(); DifferentialEntropyStateStrategy strategy = DifferentialEntropyStateSerializer.deserializeStrategy(input); verify(strategy != null || state.getStrategy() == null, "strategy is not null for null method"); if (strategy != null) { state.setStrategy(strategy); } }

Target:
public void deserialize( Block block, int index, DifferentialEntropyState state) { SliceInput input = VARBINARY.getSlice(block, index).getInput(); int method = input.readInt(); switch (method) { case 0: verify(state.getStrategy() == null, "strategy is not null for null method"); return; case 1: state.setStrategy(UnweightedReservoirSampleStateStrategy.deserialize(input)); return; case 2: state.setStrategy(WeightedReservoirSampleStateStrategy.deserialize(input)); return; case 3: state.setStrategy(FixedHistogramMleStateStrategy.deserialize(input)); return; case 4: state.setStrategy(FixedHistogramJacknifeStateStrategy.deserialize(input)); return; default: verify(false, format("Unknown method code when deserializing: %s", method)); } }
Source:
private String formatFilePath(int siteId, String projectName, String revisionName) { Preconditions.checkArgument(!Strings.isNullOrEmpty(projectName), "projectName"); Preconditions.checkArgument(!Strings.isNullOrEmpty(revisionName), "revisionName"); String encodedProjectName = Base64.getEncoder().encodeToString(projectName.getBytes(UTF_8)).replace("=", "_"); return String.format(ENGLISH, "%s%d/%s/%s.%s.tar.gz", pathPrefix, siteId, encodedProjectName, revisionName, DATE_TIME_SUFFIX_FORMAT.format(Instant.now())); }

Target:
private String formatFilePath(int siteId, String projectName, String revisionName) { Preconditions.checkArgument(!Strings.isNullOrEmpty(projectName), "projectName"); Preconditions.checkArgument(!Strings.isNullOrEmpty(revisionName), "revisionName"); String encodedProjectName = BaseEncoding.base64Url().omitPadding().encode(projectName.getBytes(UTF_8)); return String.format(ENGLISH, "%s%d/%s/%s.%s.tar.gz", pathPrefix, siteId, encodedProjectName, revisionName, UUID.randomUUID().toString()); }
Source:
public static RangeSet fromString(String list, boolean skipError) { RangeSet rs = new RangeSet(); for (String s : Util.tokenize(list,",")) { s = s.trim(); try { if(s.contains("-")) { String[] tokens = Util.tokenize(s,"-"); if (tokens.length == 2) { rs.ranges.add(new Range(Integer.parseInt(tokens[0]), Integer.parseInt(tokens[1]) + 1)); } else { if (!skipError) throw new IllegalArgumentException("Unable to parse " + list); } } else { int n = Integer.parseInt(s); rs.ranges.add(new Range(n,n+1)); } } catch (NumberFormatException e) { if (!skipError) throw new IllegalArgumentException("Unable to parse "+list); } } return rs; }

Target:
public static RangeSet fromString(String list, boolean skipError) { RangeSet rs = new RangeSet(); for (String s : Util.tokenize(list,",")) { s = s.trim(); try { if(s.contains("-")) { String[] tokens = Util.tokenize(s,"-"); if (tokens.length == 2) { rs.ranges.add(new Range(Integer.parseInt(tokens[0]), Integer.parseInt(tokens[1]) + 1)); } else { if (!skipError) { throw new IllegalArgumentException( String.format("Unable to parse %s, expected string with a range M-N", list)); } } } else { int n = Integer.parseInt(s); rs.ranges.add(new Range(n,n+1)); } } catch (NumberFormatException e) { if (!skipError) throw new IllegalArgumentException( String.format("Unable to parse %s, expected number", list)); } } return rs; }
Source:
public byte[] encrypt(byte[] plaintext, byte[] associatedData) throws GeneralSecurityException { if (this.encryptPath == null || this.encryptPath.equals("")) { throw new GeneralSecurityException("malformed keyUri provided"); } Map<String, Object> request = Map.of( "plaintext", Base64.getEncoder().encodeToString(plaintext), "context", associatedData == null ? "" : Base64.getEncoder().encodeToString(associatedData) ); try { LogicalResponse response = this.vault.logical().write(this.encryptPath, request); Map<String, String> data = response.getData(); String error = data.get("errors"); if (error != null) { throw new GeneralSecurityException(String.format("Failed to encrypt: %s", error)); } String ciphertext = data.get("ciphertext"); if (ciphertext == null) { throw new GeneralSecurityException("encryption failed"); } return ciphertext.getBytes(); } catch (VaultException e) { throw new GeneralSecurityException("vault error", e); } }

Target:
public byte[] encrypt(byte[] plaintext, byte[] associatedData) throws GeneralSecurityException { Map<String, Object> request = Map.of( "plaintext", Base64.getEncoder().encodeToString(plaintext), "context", associatedData == null ? "" : Base64.getEncoder().encodeToString(associatedData) ); try { LogicalResponse response = this.vault.logical().write(this.encryptPath, request); Map<String, String> data = response.getData(); String error = data.get("errors"); if (error != null) { throw new GeneralSecurityException("failed to encrypt"); } String ciphertext = data.get("ciphertext"); if (ciphertext == null) { throw new GeneralSecurityException("encryption failed"); } return ciphertext.getBytes(); } catch (VaultException e) { throw new GeneralSecurityException("vault error"); } }
Source:
public boolean createSymLink(URI homeUri, URI targetUri, boolean onlyRead, String userLogin) { File imagePath = new File(fileMapper.mapAccordingToMappingType(homeUri)); File userHome = new File(getDecodedPath(targetUri)); if (userHome.exists()) { System.out.println("Got here!"); return false; } String command = Config.getParameter("script_createSymLink"); CommandService commandService = new CommandService(); List<String> parameters = new ArrayList<>(); parameters.add(imagePath.getAbsolutePath()); parameters.add(userHome.getAbsolutePath()); if (onlyRead) { parameters.add(Config.getParameter("UserForImageReading", "root")); } else { parameters.add(userLogin); } try { return commandService.runCommand(new File(command), parameters).isSuccessful(); } catch (FileNotFoundException e) { logger.error("FileNotFoundException in createSymLink", e); return false; } catch (IOException e) { logger.error("IOException in createSymLink", e); return false; } }

Target:
public boolean createSymLink(URI homeUri, URI targetUri, boolean onlyRead, String userLogin) { File imagePath = new File(fileMapper.mapAccordingToMappingType(homeUri)); File userHome = new File(getDecodedPath(targetUri)); if (userHome.exists()) { return false; } String command = Config.getParameter("script_createSymLink"); CommandService commandService = new CommandService(); List<String> parameters = new ArrayList<>(); parameters.add(imagePath.getAbsolutePath()); parameters.add(userHome.getAbsolutePath()); if (onlyRead) { parameters.add(Config.getParameter("UserForImageReading", "root")); } else { parameters.add(userLogin); } try { return commandService.runCommand(new File(command), parameters).isSuccessful(); } catch (FileNotFoundException e) { logger.error("FileNotFoundException in createSymLink", e); return false; } catch (IOException e) { logger.error("IOException in createSymLink", e); return false; } }
Source:
public EventData(ByteBuffer body) { this.body = Objects.requireNonNull(body, "'body' cannot be null.").array(); this.context = Context.NONE; this.properties = new HashMap<>(); this.systemProperties = new SystemProperties(); }

Target:
public EventData(ByteBuffer body) { this(Objects.requireNonNull(body, "'body' cannot be null.").array()); }
Source:
private String findHostLang(String hostId) throws DotDataException{ DotConnect dc = new DotConnect(); dc.setSQL(SELECT_HOSTLANG_BY_ID_QUERY); dc.addParam(hostId); List<Map<String,String>> hostLang = dc.loadResults(); return hostLang.get(0).get("language_id").toString(); }

Target:
private String findHostLang(String hostId) throws DotDataException { DotConnect dc = new DotConnect(); dc.setSQL(SELECT_HOSTLANG_BY_ID_QUERY); dc.addParam(hostId); List<Map<String, String>> hostLang = dc.loadResults(); return hostLang.get(0).get("language_id"); }
Source:
protected Query createCountQuery(ParametersParameterAccessor accessor) { return (createQuery(accessor)); }

Target:
protected Query createCountQuery(ParametersParameterAccessor accessor) { return applyQueryMetaAttributesWhenPresent(createQuery(accessor)); }
Source:
public void addToMap(SignedWitness signedWitness) { P2PDataStorage.ByteArray hash = signedWitness.getHashAsByteArray(); signedWitnessMap.putIfAbsent(hash, signedWitness); getSignedWitnessSetCache.remove(new P2PDataStorage.ByteArray(signedWitness.getAccountAgeWitnessHash())); getSignedWitnessSetCache.remove(hash); }

Target:
public void addToMap(SignedWitness signedWitness) { signedWitnessMap.putIfAbsent(signedWitness.getHashAsByteArray(), signedWitness); P2PDataStorage.ByteArray accountAgeWitnessHash = new P2PDataStorage.ByteArray(signedWitness.getAccountAgeWitnessHash()); signedWitnessSetByAccountAgeWitnessHash.putIfAbsent(accountAgeWitnessHash, new HashSet<>()); signedWitnessSetByAccountAgeWitnessHash.get(accountAgeWitnessHash).add(signedWitness); }
Source:
public Mono<Void> delete(DeleteOrganizationQuotaDefinitionRequest request) { return delete(request, Void.class, builder -> builder.pathSegment("v2", "quota_definitions", request.getOrganizationQuotaDefinitionId())); }

Target:
public Mono<DeleteOrganizationQuotaDefinitionResponse> delete(DeleteOrganizationQuotaDefinitionRequest request) { return delete(request, DeleteOrganizationQuotaDefinitionResponse.class, builder -> { builder.pathSegment("v2", "quota_definitions", request.getOrganizationQuotaDefinitionId()); QueryBuilder.augment(builder, request); }); }
Source:
private void getTagline(){ Call<ArrayList<TaglineLanguageModel>> call = apiClient.getTagline(); call.enqueue(new Callback<ArrayList<TaglineLanguageModel>>() { @Override public void onResponse(Call<ArrayList<TaglineLanguageModel>> call, Response<ArrayList<TaglineLanguageModel>> response) { if(response != null){ String locale = String.valueOf(Resources.getSystem().getConfiguration().locale); boolean isLanguageFound = false; for (int i = 0; i < response.body().size(); i++){ if (response.body().get(i).getLanguage().equals(locale)){ taglineURL = response.body().get(i).getTaglineModel().getUrl(); tvDailyFoodFact.setText(response.body().get(i).getTaglineModel().getMessage()); tvDailyFoodFact.setVisibility(View.VISIBLE); isLanguageFound = true; } } if (!isLanguageFound){ taglineURL = response.body().get(response.body().size() -1).getTaglineModel().getUrl(); tvDailyFoodFact.setText(response.body().get(response.body().size() -1).getTaglineModel().getMessage()); tvDailyFoodFact.setVisibility(View.VISIBLE); } } } @Override public void onFailure(Call<ArrayList<TaglineLanguageModel>> call, Throwable t) { } }); }

Target:
private void getTagline(){ Call<ArrayList<TaglineLanguageModel>> call = apiClient.getTagline(); call.enqueue(new Callback<ArrayList<TaglineLanguageModel>>() { @Override public void onResponse(Call<ArrayList<TaglineLanguageModel>> call, Response<ArrayList<TaglineLanguageModel>> response) { if(response.isSuccessful()){ String locale = String.valueOf(Resources.getSystem().getConfiguration().locale); boolean isLanguageFound = false; for (int i = 0; i < response.body().size(); i++){ if (response.body().get(i).getLanguage().equals(locale)){ taglineURL = response.body().get(i).getTaglineModel().getUrl(); tvDailyFoodFact.setText(response.body().get(i).getTaglineModel().getMessage()); tvDailyFoodFact.setVisibility(View.VISIBLE); isLanguageFound = true; } } if (!isLanguageFound){ taglineURL = response.body().get(response.body().size() -1).getTaglineModel().getUrl(); tvDailyFoodFact.setText(response.body().get(response.body().size() -1).getTaglineModel().getMessage()); tvDailyFoodFact.setVisibility(View.VISIBLE); } } } @Override public void onFailure(Call<ArrayList<TaglineLanguageModel>> call, Throwable t) { } }); }
Source:
public void tearDown() { closeAllRuntimeException(queryRunner); queryRunner = null; }

Target:
public void tearDown() { queryRunner.close(); }
Source:
private synchronized boolean onTransactions(List<Transaction> txs) { if (txs.isEmpty()) return false; long[] gasPrices = new long[txs.size()]; for (int i = 0; i < txs.size(); ++i) { gasPrices[i] = ByteUtil.byteArrayToLong(txs.get(i).getGasPrice()); } while (blockGasPrices.size() >= getMinBlocks() && (calcGasPricesSize() - blockGasPrices.get(0).length + gasPrices.length) >= getMinTransactions()) { blockGasPrices.remove(blockGasPrices.get(0)); } blockGasPrices.add(gasPrices); return true; }

Target:
private synchronized boolean onTransactions(List<Transaction> txs) { if (txs.isEmpty()) return false; long[] gasPrices = new long[txs.size()]; for (int i = 0; i < txs.size(); ++i) { gasPrices[i] = ByteUtil.byteArrayToLong(txs.get(i).getGasPrice()); } blockGasPrices.add(gasPrices); while (blockGasPrices.size() > getMinBlocks() && (calcGasPricesSize() - blockGasPrices.getFirst().length) >= getMinTransactions()) { blockGasPrices.removeFirst(); } return true; }
Source:
public HttpEntity<PassThroughHeadersResource> getPassThroughHeaders() { Require.that(yonaProperties.isTestServer(), () -> InvalidDataException.onlyAllowedOnTestServers("Endpoint /passThrougHeaders is not available")); passBarrier(); PassThroughHeadersDto passThroughHeaders = PassThroughHeadersDto.createInstance(headersHolder.export()); return createOkResponse(passThroughHeaders, createPassThroughHeadersResourceAssembler()); }

Target:
public HttpEntity<PassThroughHeadersResource> getPassThroughHeaders() { Require.that(yonaProperties.isTestServer(), () -> InvalidDataException.onlyAllowedOnTestServers("Endpoint /passThroughHeaders is not available")); passBarrier(); PassThroughHeadersDto passThroughHeaders = PassThroughHeadersDto.createInstance(headersHolder.export()); return createOkResponse(passThroughHeaders, createPassThroughHeadersResourceAssembler()); }
Source:
AbstractInternalQueryCache(String cacheId, String cacheName, QueryCacheConfig queryCacheConfig, IMap delegate, QueryCacheContext context) { this.cacheId = cacheId; this.cacheName = cacheName; this.queryCacheConfig = queryCacheConfig; this.mapName = delegate.getName(); this.delegate = delegate; this.context = context; this.serializationService = context.getSerializationService(); this.indexes = Indexes.newBuilder(serializationService, COPY_ON_READ).build(); this.includeValue = isIncludeValue(); this.partitioningStrategy = getPartitioningStrategy(); this.extractors = Extractors.newBuilder(serializationService).build(); this.recordStore = new DefaultQueryCacheRecordStore(serializationService, indexes, queryCacheConfig, getEvictionListener(), extractors); StoreAdapter recordStoreAdapter = indexes.isGlobal() ? null : new QueryCacheRecordStoreAdapter(recordStore); for (MapIndexConfig indexConfig : queryCacheConfig.getIndexConfigs()) { indexes.addOrGetIndex(indexConfig.getAttribute(), indexConfig.isOrdered(), recordStoreAdapter); } }

Target:
AbstractInternalQueryCache(String cacheId, String cacheName, QueryCacheConfig queryCacheConfig, IMap delegate, QueryCacheContext context) { this.cacheId = cacheId; this.cacheName = cacheName; this.queryCacheConfig = queryCacheConfig; this.mapName = delegate.getName(); this.delegate = delegate; this.context = context; this.serializationService = context.getSerializationService(); this.indexes = Indexes.newBuilder(serializationService, COPY_ON_READ).build(); this.includeValue = isIncludeValue(); this.partitioningStrategy = getPartitioningStrategy(); this.extractors = Extractors.newBuilder(serializationService).build(); this.recordStore = new DefaultQueryCacheRecordStore(serializationService, indexes, queryCacheConfig, getEvictionListener(), extractors); assert indexes.isGlobal(); for (MapIndexConfig indexConfig : queryCacheConfig.getIndexConfigs()) { indexes.addOrGetIndex(indexConfig.getAttribute(), indexConfig.isOrdered(), null); } }
Source:
protected void childCommandsExecutionEnded(CommandBase<?> command, boolean anyFailed, List<Guid> childCmdIds, CommandExecutionStatus status, int completedChildren) { Guid cmdId = command.getCommandId(); if (status == CommandExecutionStatus.EXECUTED) { SerialChildExecutingCommand serialChildExecutingCommand = (SerialChildExecutingCommand) command; if (!anyFailed || serialChildExecutingCommand.ignoreChildCommandFailure()) { try { boolean endCommand = !serialChildExecutingCommand.performNextOperation(completedChildren); if (!endCommand) { return; } } catch (Exception e) { log.error("Command '{}' id: '{}' children failed when attempting to perform the next operation, marking as FAILED '{}'", command.getActionType(), cmdId, childCmdIds, command.getCommandStatus()); log.error(e.getMessage(), e); serialChildExecutingCommand.handleFailure(); anyFailed = true; } } else { serialChildExecutingCommand.handleFailure(); } } else { log.info("Command '{}' id: '{}' execution didn't complete, not proceeding to perform the next operation", command.getActionType(), cmdId); } setCommandEndStatus(command, anyFailed, status, childCmdIds); }

Target:
protected void childCommandsExecutionEnded(CommandBase<?> command, boolean anyFailed, List<Guid> childCmdIds, CommandExecutionStatus status, int completedChildren) { Guid cmdId = command.getCommandId(); if (status == CommandExecutionStatus.EXECUTED) { SerialChildExecutingCommand serialChildExecutingCommand = (SerialChildExecutingCommand) command; if (!anyFailed || serialChildExecutingCommand.ignoreChildCommandFailure()) { try { boolean endCommand = !serialChildExecutingCommand.performNextOperation(completedChildren); if (!endCommand) { return; } } catch (Exception e) { log.error("Command '{}' id: '{}' with children failed when attempting to perform the next operation, marking as '{}'", command.getActionType(), cmdId, childCmdIds, command.getCommandStatus()); log.error(e.getMessage(), e); serialChildExecutingCommand.handleFailure(); anyFailed = true; } } else { serialChildExecutingCommand.handleFailure(); } } else { log.info("Command '{}' id: '{}' execution didn't complete, not proceeding to perform the next operation", command.getActionType(), cmdId); } setCommandEndStatus(command, anyFailed, status, childCmdIds); }
Source:
public SomeValuesFromVisitor(RdfCloudTripleStoreConfiguration conf, InferenceEngine inferenceEngine) { super(conf, inferenceEngine); include = true; }

Target:
public SomeValuesFromVisitor(RdfCloudTripleStoreConfiguration conf, InferenceEngine inferenceEngine) { super(conf, inferenceEngine); include = conf.isInferSomeValuesFrom(); }
Source:
public GetUsersResult(final SpectraUser user) { this.SpectraUserListResult = new SpectraUserList(); List<SpectraUser> listOfOne = new ArrayList<SpectraUser>(); listOfOne.add(user); this.SpectraUserListResult.setSpectraUsers(listOfOne); }

Target:
public GetUsersResult(final SpectraUser user) { this.spectraUserListResult = new SpectraUserList(); final ImmutableList<SpectraUser> listOfOne = ImmutableList.of(user); this.spectraUserListResult.setSpectraUsers(listOfOne); }
Source:
public Mapper process(ProcessorContext context, TypeElement mapperTypeElement, Mapper mapper) { this.typeFactory = context.getTypeFactory(); String componentModel = MapperConfiguration.getInstanceOn( mapperTypeElement ).componentModel(); String effectiveComponentModel = OptionsHelper.getEffectiveComponentModel( context.getOptions(), componentModel ); if ( !getComponentModelIdentifier().equalsIgnoreCase( effectiveComponentModel ) ) { return mapper; } mapper.removeDecorator(); mapper.addAnnotation( getTypeAnnotation() ); ListIterator<MapperReference> iterator = mapper.getReferencedMappers().listIterator(); while ( iterator.hasNext() ) { MapperReference reference = iterator.next(); iterator.remove(); iterator.add( replacementMapperReference( reference ) ); } return mapper; }

Target:
public Mapper process(ProcessorContext context, TypeElement mapperTypeElement, Mapper mapper) { this.typeFactory = context.getTypeFactory(); String componentModel = MapperConfiguration.getInstanceOn( mapperTypeElement ).componentModel(); String effectiveComponentModel = OptionsHelper.getEffectiveComponentModel( context.getOptions(), componentModel ); if ( !getComponentModelIdentifier().equalsIgnoreCase( effectiveComponentModel ) ) { return mapper; } if ( shouldDecoratorBeRemoved() ) { mapper.removeDecorator(); } mapper.addAnnotation( getTypeAnnotation() ); ListIterator<MapperReference> iterator = mapper.getReferencedMappers().listIterator(); while ( iterator.hasNext() ) { MapperReference reference = iterator.next(); iterator.remove(); iterator.add( replacementMapperReference( reference ) ); } return mapper; }
Source:
public SweepableCells(KeyValueService kvs, WriteInfoPartitioner partitioner) { super(kvs, TargetedSweepTableFactory.of().getSweepableCellsTable(null).getTableRef(), partitioner); commitTsLoader = CommitTsLoader.create(TransactionServices.createTransactionService(kvs), new TLongHashSet()); }

Target:
public SweepableCells(KeyValueService kvs, WriteInfoPartitioner partitioner) { super(kvs, TargetedSweepTableFactory.of().getSweepableCellsTable(null).getTableRef(), partitioner); this.commitTsLoader = CommitTsLoader .create(TransactionServices.createTransactionService(kvs), new TLongHashSet()); }
Source:
protected void executeVmCommand() { AddCustomValue("InterfaceType", (VmInterfaceType.forValue(getInterface().getType()).getDescription()).toString()); boolean succeeded = false; try { getInterface().setSpeed(VmInterfaceType.forValue(getInterface().getType()).getSpeed()); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntity(oldIface); getVmNetworkInterfaceDao().update(getInterface()); if (macAddressChanged) { MacPoolManager.getInstance().freeMac(oldIface.getMacAddress()); } getCompensationContext().stateChanged(); return null; } }); succeeded = updateHost(); } finally { setSucceeded(succeeded); if (!succeeded && macAddressChanged) { MacPoolManager.getInstance().addMac(oldIface.getMacAddress()); MacPoolManager.getInstance().freeMac(getInterface()); } } }

Target:
protected void executeVmCommand() { AddCustomValue("InterfaceType", (VmInterfaceType.forValue(getInterface().getType()).getDescription()).toString()); boolean succeeded = false; boolean macAddedToPool = false; try { if (macShouldBeChanged) { macAddedToPool = addMacToPool(getMacAddress()); } getInterface().setSpeed(VmInterfaceType.forValue(getInterface().getType()).getSpeed()); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntity(oldIface); getVmNetworkInterfaceDao().update(getInterface()); getCompensationContext().stateChanged(); return null; } }); succeeded = updateHost(); } finally { setSucceeded(succeeded); if (macAddedToPool) { if (succeeded) { MacPoolManager.getInstance().freeMac(oldIface.getMacAddress()); } else { MacPoolManager.getInstance().freeMac(getInterface().getMacAddress()); } } } }
Source:
public Node visit(final Term term) { if (term.isGenerated()) { return null; } ComparableCharSequence token = term.getValue(); matchSeq.addLast(token); ComparableCharSequence seqForMatching = new CompoundCharSequence(TOKEN_SEPARATOR, matchSeq); State<List<ComparableCharSequence>> match = replaceRules.get( ignoreCase ? new LowerCaseCharSequence(seqForMatching) : seqForMatching).getStateForCompleteSequence(); if (!match.isKnown) { if (priorMatch.isFinal()) { hasReplacement = true; querySeq.addAll(priorMatch.value); matchSeq.clear(); } else { matchSeq.removeLast(); if (!matchSeq.isEmpty()) { querySeq.addAll(matchSeq); matchSeq.clear(); } } priorMatch = replaceRules.get(token).getStateForCompleteSequence(); if (priorMatch.isKnown) { matchSeq.addLast(token); } else { querySeq.addLast(token); } } else { priorMatch = match; } return null; }

Target:
public Node visit(final Term term) { if (term.isGenerated()) { return null; } ComparableCharSequence token = term.getValue(); matchSeq.addLast(token); ComparableCharSequence seqForMatching = new CompoundCharSequence(TOKEN_SEPARATOR, matchSeq); State<List<CharSequence>> match = replaceRules.get( ignoreCase ? new LowerCaseCharSequence(seqForMatching) : seqForMatching).getStateForCompleteSequence(); if (!match.isKnown) { if (priorMatch.isFinal()) { hasReplacement = true; querySeq.addAll(priorMatch.value); matchSeq.clear(); } else { matchSeq.removeLast(); if (!matchSeq.isEmpty()) { querySeq.addAll(matchSeq); matchSeq.clear(); } } priorMatch = replaceRules.get(token).getStateForCompleteSequence(); if (priorMatch.isKnown) { matchSeq.addLast(token); } else { querySeq.addLast(token); } } else { priorMatch = match; } return null; }
Source:
public void setClassLoader(ClassLoader externalCL) { externalClassLoader = externalCL; forceExternalClassLoader = false; classLoaderChanged(); }

Target:
public void setClassLoader(ClassLoader externalCL) { externalClassLoader = externalCL; classLoaderChanged(); }