auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void checkRepMigrationEffect(DAnalysis analysis) { DRepresentation dView = analysis.getOwnedViews().get(0).getOwnedRepresentations().get(0); if (dView instanceof DDiagram) { DDiagram diagram = (DDiagram) dView; FilterVariableHistory filterVariableHistory = diagram.getFilterVariableHistory(); EList<VariableValue> ownedValues = filterVariableHistory.getOwnedValues(); VariableValue variableValue = ownedValues.get(0); assertTrue("FilterVariableHistory.ownedValues should be of type EObjectVariableValue", variableValue instanceof EObjectVariableValue); EObjectVariableValue objectValue = (EObjectVariableValue) variableValue; EObject modelElement = objectValue.getModelElement(); assertNotNull("EObjectVariableValue.modelElement is not set", modelElement); SelectModelElementVariable variableDefinition = objectValue.getVariableDefinition(); assertNotNull("EObjectVariableValue.variableDefinition is not set", variableDefinition); } }

Target:
private void checkRepMigrationEffect(DAnalysis analysis) { DRepresentation dView = analysis.getOwnedViews().get(0).getOwnedRepresentations().get(0); assertTrue("DRepresentation " + dView.getName() + " is not a DDiagram", dView instanceof DDiagram); if (dView instanceof DDiagram) { DDiagram diagram = (DDiagram) dView; FilterVariableHistory filterVariableHistory = diagram.getFilterVariableHistory(); EList<VariableValue> ownedValues = filterVariableHistory.getOwnedValues(); VariableValue variableValue = ownedValues.get(0); assertTrue("FilterVariableHistory.ownedValues should be of type EObjectVariableValue", variableValue instanceof EObjectVariableValue); EObjectVariableValue objectValue = (EObjectVariableValue) variableValue; EObject modelElement = objectValue.getModelElement(); assertNotNull("EObjectVariableValue.modelElement is not set", modelElement); SelectModelElementVariable variableDefinition = objectValue.getVariableDefinition(); assertNotNull("EObjectVariableValue.variableDefinition is not set", variableDefinition); } }
Source:
public long[] findJoinAddresses(int probePosition, Page probe, int probeGeometryChannel) { Block probeGeometryBlock = probe.getBlock(probeGeometryChannel); if (probeGeometryBlock.isNull(probePosition)) { return EMPTY_ADDRESSES; } Slice slice = probeGeometryBlock.getSlice(probePosition, 0, probeGeometryBlock.getSliceLength(probePosition)); OGCGeometry probeGeometry = deserialize(slice); if (probeGeometry.isEmpty()) { return EMPTY_ADDRESSES; } LongArrayList matchingAddresses = new LongArrayList(); Envelope envelope = getEnvelope(probeGeometry); rtree.query(envelope, o -> { GeometryWithAddress geometryWithAddress = (GeometryWithAddress) o; if (spatialRelationshipTest.test(geometryWithAddress.getOgcGeometry(), probeGeometry)) { matchingAddresses.add(geometryWithAddress.address); } }); return matchingAddresses.toLongArray(null); }

Target:
public long[] findJoinAddresses(int probePosition, Page probe, int probeGeometryChannel) { Block probeGeometryBlock = probe.getBlock(probeGeometryChannel); if (probeGeometryBlock.isNull(probePosition)) { return EMPTY_ADDRESSES; } Slice slice = probeGeometryBlock.getSlice(probePosition, 0, probeGeometryBlock.getSliceLength(probePosition)); OGCGeometry probeGeometry = deserialize(slice); verify(probeGeometry != null); if (probeGeometry.isEmpty()) { return EMPTY_ADDRESSES; } LongArrayList matchingAddresses = new LongArrayList(); Envelope envelope = getEnvelope(probeGeometry); rtree.query(envelope, item -> { GeometryWithAddress geometryWithAddress = (GeometryWithAddress) item; if (spatialRelationshipTest.test(geometryWithAddress.ogcGeometry, probeGeometry)) { matchingAddresses.add(geometryWithAddress.address); } }); return matchingAddresses.toLongArray(null); }
Source:
protected void doInitialize() { final Flow flow = getLoginFlow(); if (flow != null) { createClientActionActionState(flow); createStopWebflowViewState(flow); createSaml2ClientLogoutAction(); createAuthnFailureAction(flow); } }

Target:
protected void doInitialize() { final Flow flow = getLoginFlow(); if (flow != null) { createClientActionActionState(flow); createStopWebflowViewState(flow); createSaml2ClientLogoutAction(); createAuthnFailureActionState(flow); } }
Source:
private static boolean isConfirmedKeyword(String userInput, int keywordIndex) { return !(keywordIndex == userInput.split("\\s+").length - 1 && !userInput.endsWith(" ")); }

Target:
private static boolean isConfirmedKeyword(String userInput, int keywordIndex) { return keywordIndex != userInput.split("\\s+").length - 1 || userInput.endsWith(" "); }
Source:
private void checkJunit4AndAboveTestClass(IdentifierTree className, JavaSymbol.TypeJavaSymbol symbol, Iterable<Symbol> members) { if (symbol.name().endsWith("Test") && !runWithRunner(symbol)) { checkMethods(className, members, true); } }

Target:
private void checkJunit4AndAboveTestClass(IdentifierTree className, JavaSymbol.TypeJavaSymbol symbol, Iterable<Symbol> members) { if (symbol.name().endsWith("Test") && !runWithEnclosedOrCucumberRunner(symbol)) { checkMethods(className, members, true); } }
Source:
@Test public void ContainsNonComparableKeyReturnsFalse() { LinkedHashTreeMap<String, String> map = new LinkedHashTreeMap<>(); map.put("a", "android"); assertThat(map.containsKey(new Object())).isFalse(); }

Target:
@Test public void ContainsNonComparableKeyReturnsFalse() { LinkedHashTreeMap<Object, String> map = new LinkedHashTreeMap<>(); map.put("a", "android"); assertThat(map).doesNotContainKey(new Object()); }
Source:
public static boolean isWater(final BlockData data) { return (data instanceof Waterlogged) ? ((Waterlogged) data).isWaterlogged() : false; }

Target:
public static boolean isWater(final BlockData data) { return (data instanceof Waterlogged) ? ((Waterlogged) data).isWaterlogged() : isWater(data.getMaterial()); }
Source:
public String placeMarketOrder(MarketOrder marketOrder) throws IOException { try { LgoUnencryptedOrder lgoOrder = LgoAdapters.adaptUnencryptedMarketOrder(marketOrder); return placeLgoUnencryptedOrder(lgoOrder); } catch (LgoException e) { throw LgoErrorAdapter.adapt(e); } }

Target:
public String placeMarketOrder(MarketOrder marketOrder) throws IOException { if (shouldEncryptOrders) { return placeEncryptedMarketOrder(marketOrder); } return placeUnencryptedMarketOrder(marketOrder); }
Source:
private String encodedPayload(String payload, String payloadId, ClaimSet claimSet) throws Exception { ObjectNode _claimSet = JsonNodeFactory.instance.objectNode(); ObjectNode _payload = JsonNodeFactory.instance.objectNode();; _payload.put(payloadId, payload); if(claimSet != null) { if(claimSet.getExp() > 0) { _claimSet.put("exp", claimSet.getExp()); } _payload.putAll(_claimSet); } return base64UrlEncode(_payload.toString().getBytes()); }

Target:
private String encodedPayload(String payload, String payloadId, ClaimSet claimSet) throws Exception { ObjectNode localClaimSet = JsonNodeFactory.instance.objectNode(); ObjectNode localPayload = JsonNodeFactory.instance.objectNode(); localPayload.put(payloadId, payload); if(claimSet != null) { if(claimSet.getExp() > 0) { localClaimSet.put("exp", claimSet.getExp()); } localPayload.putAll(localClaimSet); } return base64UrlEncode(localPayload.toString().getBytes()); }
Source:
private void fullTest(int size, int[] fuzz, String distributionName) { PerformanceMeter pMinsertion = fPerf.createPerformanceMeter(distributionName + " Insertion: " + fName); PerformanceMeter pMiterateStart = fPerf.createPerformanceMeter(distributionName + " Iterate sorted by start: " + fName); PerformanceMeter pMiterateEnd = fPerf.createPerformanceMeter(distributionName + " Iterate sorted by end: " + fName); PerformanceMeter pMiterateDuration = fPerf.createPerformanceMeter(distributionName + " Iterate sorted by length: " + fName); for (int i = 0; i < DEFAULT_LOOP_COUNT; i++) { fSegStore.clear(); pMinsertion.start(); populate(size, fuzz, fSegStore, 0, getSegmentStoreSize()); pMinsertion.stop(); pMiterateStart.start(); int count = sortedIterate(fSegStore, SegmentComparators.INTERVAL_START_COMPARATOR); pMiterateStart.stop(); assertEquals(fSegStore.size(), count); pMiterateEnd.start(); count = sortedIterate(fSegStore, SegmentComparators.INTERVAL_END_COMPARATOR); pMiterateEnd.stop(); assertEquals(fSegStore.size(), count); pMiterateDuration.start(); count = sortedIterate(fSegStore, SegmentComparators.INTERVAL_LENGTH_COMPARATOR); pMiterateDuration.stop(); assertEquals(fSegStore.size(), count); } pMinsertion.commit(); pMiterateStart.commit(); pMiterateEnd.commit(); pMiterateDuration.commit(); assertOrder(fSegStore, SegmentComparators.INTERVAL_START_COMPARATOR); assertOrder(fSegStore, SegmentComparators.INTERVAL_END_COMPARATOR); assertOrder(fSegStore, SegmentComparators.INTERVAL_LENGTH_COMPARATOR); }

Target:
private void fullTest(int size, int[] fuzz, String distributionName) { PerformanceMeter pMinsertion = fPerf.createPerformanceMeter(distributionName + " Insertion: " + fName); PerformanceMeter pMiterateStart = fPerf.createPerformanceMeter(distributionName + " Iterate sorted by start: " + fName); PerformanceMeter pMiterateEnd = fPerf.createPerformanceMeter(distributionName + " Iterate sorted by end: " + fName); PerformanceMeter pMiterateDuration = fPerf.createPerformanceMeter(distributionName + " Iterate sorted by length: " + fName); for (int i = 0; i < DEFAULT_LOOP_COUNT; i++) { fSegStore.clear(); pMinsertion.start(); populate(size, fuzz, fSegStore, 0, getSegmentStoreSize()); pMinsertion.stop(); if (i == 0) { assertOrder(fSegStore, SegmentComparators.INTERVAL_START_COMPARATOR); assertOrder(fSegStore, SegmentComparators.INTERVAL_END_COMPARATOR); assertOrder(fSegStore, SegmentComparators.INTERVAL_LENGTH_COMPARATOR); } pMiterateStart.start(); int count = sortedIterate(fSegStore, SegmentComparators.INTERVAL_START_COMPARATOR); pMiterateStart.stop(); assertEquals(fSegStore.size(), count); pMiterateEnd.start(); count = sortedIterate(fSegStore, SegmentComparators.INTERVAL_END_COMPARATOR); pMiterateEnd.stop(); assertEquals(fSegStore.size(), count); pMiterateDuration.start(); count = sortedIterate(fSegStore, SegmentComparators.INTERVAL_LENGTH_COMPARATOR); pMiterateDuration.stop(); assertEquals(fSegStore.size(), count); } pMinsertion.commit(); pMiterateStart.commit(); pMiterateEnd.commit(); pMiterateDuration.commit(); }
Source:
public void readData(ObjectDataInput in) throws IOException { port = in.readInt(); type = in.readByte(); host = in.readUTF(); socketAddr = new InetSocketAddress(InetAddress.getByName(host), port); }

Target:
public void readData(ObjectDataInput in) throws IOException { port = in.readInt(); type = in.readByte(); host = in.readUTF(); inetAddress = InetAddress.getByAddress(in.readByteArray()); }
Source:
public String getInput(String input) { String content = HttpUtil.executeUrl(GET, createURL() + "/" + XML_PATH + "?" + SUFFIX_PASSWORD + getPassword(), this.timeOut); content = XmlUtils.getContentOfElement(content, input); int status = Integer.parseInt(XmlUtils.getContentOfElement(content, "Value")); if(status == 1) { return "OPEN"; } else { return "CLOSED"; } }

Target:
public String getInput(String input) { String URL = createURL() + "/" + XML_PATH + "?" + SUFFIX_PASSWORD + getPassword(); String content = HttpUtil.executeUrl(GET, URL, this.timeOut); content = XmlUtils.getContentOfElement(content, input); int status = Integer.parseInt(XmlUtils.getContentOfElement(content, "Value")); if(status == 1) { return "OPEN"; } else { return "CLOSED"; } }
Source:
protected Optional<SecretSeries> getSecretSeriesFor(Client client, String name) { Record r = dslContext .select(SECRETS.ID, SECRETS.NAME, SECRETS.DESCRIPTION, SECRETS.CREATEDAT, SECRETS.CREATEDBY, SECRETS.UPDATEDAT, SECRETS.UPDATEDBY, SECRETS.TYPE, SECRETS.OPTIONS) .from(SECRETS) .join(SECRETS_CONTENT).on(SECRETS.ID.eq(SECRETS_CONTENT.SECRETID)) .join(ACCESSGRANTS).on(SECRETS.ID.eq(ACCESSGRANTS.SECRETID)) .join(MEMBERSHIPS).on(ACCESSGRANTS.GROUPID.eq(MEMBERSHIPS.GROUPID)) .join(CLIENTS).on(CLIENTS.ID.eq(MEMBERSHIPS.CLIENTID)) .where(SECRETS.NAME.eq(name).and(CLIENTS.NAME.eq(client.getName()))) .fetchOne(); if (r != null) { return Optional.of(r.map(new SecretSeriesJooqMapper())); } return Optional.empty(); }

Target:
protected Optional<SecretSeries> getSecretSeriesFor(Client client, String name) { Record r = dslContext .select(SECRETS.ID, SECRETS.NAME, SECRETS.DESCRIPTION, SECRETS.CREATEDAT, SECRETS.CREATEDBY, SECRETS.UPDATEDAT, SECRETS.UPDATEDBY, SECRETS.TYPE, SECRETS.OPTIONS) .from(SECRETS) .join(SECRETS_CONTENT).on(SECRETS.ID.eq(SECRETS_CONTENT.SECRETID)) .join(ACCESSGRANTS).on(SECRETS.ID.eq(ACCESSGRANTS.SECRETID)) .join(MEMBERSHIPS).on(ACCESSGRANTS.GROUPID.eq(MEMBERSHIPS.GROUPID)) .join(CLIENTS).on(CLIENTS.ID.eq(MEMBERSHIPS.CLIENTID)) .where(SECRETS.NAME.eq(name).and(CLIENTS.NAME.eq(client.getName()))) .fetchOne(); return Optional.ofNullable(r).map( (rec) -> rec.map(new SecretSeriesJooqMapper())); }
Source:
protected Set<Value.Immutable<?>> api$getVanillaValues() { final Set<Value.Immutable<?>> vanillaValues = super.api$getVanillaValues(); if (this.closestEnderCrystal != null) { this.healingCrystal().map(Value::asImmutable).ifPresent(vanillaValues::add); } return vanillaValues; }

Target:
protected Set<Value.Immutable<?>> api$getVanillaValues() { final Set<Value.Immutable<?>> values = super.api$getVanillaValues(); values.add(this.bossBar().asImmutable()); this.healingCrystal().map(Value::asImmutable).ifPresent(values::add); return values; }
Source:
public String toString() { return String.format( "%s %d @ %d for %s located at %s", props.getCheckpointType(), checkpointID, timestamp, job, externalPointer); }

Target:
public String toString() { return String.format( "%s %d @ %d for %s located at %s", props.getCheckpointType().getName(), checkpointID, timestamp, job, externalPointer); }
Source:
AllProjectsCreator( GitRepositoryManager mgr, AllProjectsName allProjectsName, @GerritPersonIdent PersonIdent serverUser) { this.mgr = mgr; this.allProjectsName = allProjectsName; this.serverUser = serverUser; this.anonymous = new GroupReference( AccountGroup.ANONYMOUS_USERS, "Anonymous Users"); this.anonymous = new GroupReference( AccountGroup.REGISTERED_USERS, "Registered Users"); this.owners = new GroupReference( AccountGroup.PROJECT_OWNERS, "Project Owners"); }

Target:
AllProjectsCreator( GitRepositoryManager mgr, AllProjectsName allProjectsName, @GerritPersonIdent PersonIdent serverUser) { this.mgr = mgr; this.allProjectsName = allProjectsName; this.serverUser = serverUser; this.anonymous = new GroupReference( AccountGroup.ANONYMOUS_USERS, "Anonymous Users"); this.registered = new GroupReference( AccountGroup.REGISTERED_USERS, "Registered Users"); this.owners = new GroupReference( AccountGroup.PROJECT_OWNERS, "Project Owners"); }
Source:
public void beginTree(DetailAST rootAST) { classes = new ArrayDeque<>(); superClasses = new HashSet<>(); packageName = ""; }

Target:
public void beginTree(DetailAST rootAST) { classes.clear(); superClasses.clear(); packageName = ""; }
Source:
public List<VDS> filter(List<VDS> hosts, VM vm, Map<String, String> parameters, List<String> messages) { List<VDS> toRemoveHostList = new ArrayList<VDS>(); List<VmNetworkInterface> vmNICs; List<Network> clusterNetworks; Map<String, Network> networksByName; if (hosts != null && hosts.size() > 0) { clusterNetworks = getNetworkDAO().getAllForCluster(hosts.get(0).getVdsGroupId()); networksByName = Entities.entitiesByName(clusterNetworks); vmNICs = getVmNetworkInterfaceDao().getAllForVm(vm.getId()); } else { return null; } Map<Guid, List<String>> hostNics = getInterfaceDAO().getHostNetworksByCluster(hosts.get(0).getVdsGroupId()); for (VDS host : hosts) { VdcBllMessages returnValue = validateRequiredNetworksAvailable(host, vm, vmNICs, clusterNetworks, networksByName, hostNics.get(host.getId())); if (VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_NETWORKS == returnValue) { StringBuilder sbBuilder = new StringBuilder(); sbBuilder.append(Entities.vmInterfacesByNetworkName(vmNICs).keySet()); log.debugFormat("host {0} is missing networks required by VM nics {1}", host.getName(), sbBuilder.toString()); } else if (VdcBllMessages.ACTION_TYPE_FAILED_MISSING_DISPLAY_NETWORK == returnValue) { log.debugFormat("host {0} is missing the cluster's display network", host.getName()); } if (returnValue != null) { messages.add(returnValue.toString()); toRemoveHostList.add(host); } } hosts.removeAll(toRemoveHostList); return hosts; }

Target:
public List<VDS> filter(List<VDS> hosts, VM vm, Map<String, String> parameters, List<String> messages) { List<VDS> toRemoveHostList = new ArrayList<VDS>(); List<VmNetworkInterface> vmNICs; List<Network> clusterNetworks; Map<String, Network> networksByName; Guid clusterId = null; if (hosts != null && hosts.size() > 0) { clusterId = hosts.get(0).getVdsGroupId(); clusterNetworks = getNetworkDAO().getAllForCluster(clusterId); networksByName = Entities.entitiesByName(clusterNetworks); vmNICs = getVmNetworkInterfaceDao().getAllForVm(vm.getId()); } else { return null; } Map<Guid, List<String>> hostNics = getInterfaceDAO().getHostNetworksByCluster(clusterId); for (VDS host : hosts) { VdcBllMessages returnValue = validateRequiredNetworksAvailable(host, vm, vmNICs, clusterNetworks, networksByName, hostNics.get(host.getId())); if (VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_NETWORKS == returnValue) { StringBuilder sbBuilder = new StringBuilder(); sbBuilder.append(Entities.vmInterfacesByNetworkName(vmNICs).keySet()); log.debugFormat("host {0} is missing networks required by VM nics {1}", host.getName(), sbBuilder.toString()); } else if (VdcBllMessages.ACTION_TYPE_FAILED_MISSING_DISPLAY_NETWORK == returnValue) { log.debugFormat("host {0} is missing the cluster's display network", host.getName()); } if (returnValue != null) { messages.add(returnValue.toString()); toRemoveHostList.add(host); } } hosts.removeAll(toRemoveHostList); return hosts; }
Source:
public Fragment getItem(int position) { return fragments[position]; }

Target:
public Fragment getItem(int position) { if (position == 0) { return new PlaybackStatisticsFragment(); } else { return new DownloadStatisticsFragment(); } }
Source:
private void getQueryQuotaEnabledFlagFromInstanceConfig() { Map<String, String> instanceConfigsMap = HelixHelper.getInstanceConfigsMapFor(_instanceId, _helixManager.getClusterName(), _helixManager.getClusterManagmentTool()); String queryQuotaEnabled = instanceConfigsMap.getOrDefault(CommonConstants.Helix.QUERY_QUOTA_STATE_ENABLED, "true"); _enabled = Boolean.parseBoolean(queryQuotaEnabled); LOGGER.info("Set query quota state to: for tables in the current broker.", _enabled ? "ENABLE" : "DISABLE", _rateLimiterMap.size()); }

Target:
private void getQueryQuotaEnabledFlagFromInstanceConfig() { try { Map<String, String> instanceConfigsMap = HelixHelper.getInstanceConfigsMapFor(_instanceId, _helixManager.getClusterName(), _helixManager.getClusterManagmentTool()); String queryRateLimitDisabled = instanceConfigsMap.getOrDefault(CommonConstants.Helix.QUERY_RATE_LIMIT_DISABLED, "false"); _queryRateLimitDisabled = Boolean.parseBoolean(queryRateLimitDisabled); LOGGER.info("Set query rate limiting to: for all tables in this broker.", _queryRateLimitDisabled ? "DISABLED" : "ENABLED", _rateLimiterMap.size()); } catch (ZkNoNodeException e) { _queryRateLimitDisabled = false; } _brokerMetrics.setValueOfGlobalGauge(BrokerGauge.QUERY_RATE_LIMIT_DISABLED, _queryRateLimitDisabled ? 1L : 0L); }
Source:
public Reply<?> assignServiceProviders(@Named("id")Object id, Request request) { List<Object> dtos = request.read(new TypeLiteral<List<Object>>() {}).as(Json.class); List<ID> spIDs = adaptToIDs(dtos); repository.assignServiceProviders(new ID(id), spIDs); return Reply.saying().ok(); }

Target:
public Reply<?> assignServiceProviders(@Named("id")Object id, Request request) { List dtos = request.read(List.class).as(Json.class); List<ID> spIDs = adaptToIDs(dtos); repository.assignServiceProviders(new ID(id), spIDs); return Reply.saying().ok(); }
Source:
private static void execute(WorkCenter workCenter, TaskSet taskSet) throws InterruptedException { List<Worker> workers = workCenter.getWorkers(); var exec = Executors.newFixedThreadPool(workers.size()); for (var worker : workers) { exec.submit(worker); } Thread.sleep(1000); addTasks(taskSet); exec.awaitTermination(2, TimeUnit.SECONDS); exec.shutdownNow(); }

Target:
private static void execute(WorkCenter workCenter, TaskSet taskSet) throws InterruptedException { var workers = workCenter.getWorkers(); var exec = Executors.newFixedThreadPool(workers.size()); workers.forEach(exec::submit); Thread.sleep(1000); addTasks(taskSet); exec.awaitTermination(2, TimeUnit.SECONDS); exec.shutdownNow(); }
Source:
public boolean preFinish(TaskRepository repository) { TaskRepository newRepository = createTaskRepository(); boolean propertiesUnchanged = false; if (validatedTaskRepository != null) { propertiesUnchanged = equalsProperties(validatedTaskRepository.getProperties(), newRepository.getProperties()); if (propertiesUnchanged) { for (AuthenticationType authenticationType : AuthenticationType.values()) { AuthenticationCredentials credentialsOld = validatedAuthenticationCredentials.get(authenticationType); AuthenticationCredentials credentialsNew = newRepository.getCredentials(authenticationType); if (credentialsOld != null) { propertiesUnchanged = credentialsOld.equals(credentialsNew); if (!propertiesUnchanged) { break; } } else if (credentialsNew != null) { propertiesUnchanged = false; break; } } } } if (validateOnFinishButton != null && validateOnFinishButton.getSelection() && !propertiesUnchanged) { isValid = false; validateSettings(); } else { isValid = true; } if (isValid) { isValid = super.preFinish(repository); } return isValid; }

Target:
public boolean preFinish(TaskRepository repository) { if (validateOnFinishButton != null && validateOnFinishButton.getSelection() && !propertiesUnchanged()) { isValid = false; validateSettings(); } else { isValid = true; } if (isValid) { isValid = super.preFinish(repository); } return isValid; }
Source:
private void createChildren() { DetailAST currentChild = detailAst.getFirstChild(); while (currentChild != null) { final ElementNode child = new ElementNode(root, this, currentChild); addChild(child); currentChild = currentChild.getNextSibling(); } }

Target:
private void createChildren() { DetailAST currentChild = detailAst.getFirstChild(); while (currentChild != null) { final AbstractNode child = new ElementNode(root, this, currentChild); addChild(child); currentChild = currentChild.getNextSibling(); } }
Source:
public void onDone() { if (ReadText.getmQuestionAnswer() == Sound.SOUNDS_QUESTION) { long delay = mWaitAnswerSecond * 1000; if (delay > 0) { mTimeoutHandler.postDelayed(mShowAnswerTask, delay); } } else if (ReadText.getmQuestionAnswer() == Sound.SOUNDS_ANSWER) { long delay = mWaitQuestionSecond * 1000; if (delay > 0) { mTimeoutHandler.postDelayed(mShowQuestionTask, delay); } } }

Target:
public void onDone() { if(!mUseTimer) { return; } if (ReadText.getmQuestionAnswer() == Sound.SOUNDS_QUESTION) { long delay = mWaitAnswerSecond * 1000; if (delay > 0) { mTimeoutHandler.postDelayed(mShowAnswerTask, delay); } } else if (ReadText.getmQuestionAnswer() == Sound.SOUNDS_ANSWER) { long delay = mWaitQuestionSecond * 1000; if (delay > 0) { mTimeoutHandler.postDelayed(mShowQuestionTask, delay); } } }
Source:
public static void validateResourcePools(Collection<? extends ResourcePool> pools) { List<SizedResourcePool> ordered = new ArrayList<SizedResourcePool>(pools.size()); for(ResourcePool pool : pools) { if (pool instanceof SizedResourcePool) { ordered.add((SizedResourcePool)pool); } } Collections.sort(ordered, new Comparator<SizedResourcePool>() { @Override public int compare(final SizedResourcePool o1, final SizedResourcePool o2) { int retVal = o2.getType().getTierHeight() - o1.getType().getTierHeight(); if(retVal == 0) { String s1 = o1.toString(); String s2 = o2.toString(); if(s1.compareToIgnoreCase(s2) < 1) { throw new IllegalArgumentException("Tiering Ambiguity: '" + s1 + "' has tier height equal to '" + s2 + "'"); } else { throw new IllegalArgumentException("Tiering Ambiguity: '" + s2 + "' has tier height equal to '" + s1 + "'"); } } else { return retVal; } } }); for (int i = 0; i < ordered.size(); i++) { for (int j = 0; j < i; j++) { SizedResourcePool upper = ordered.get(j); SizedResourcePool lower = ordered.get(i); boolean inversion; try { inversion = (upper.getUnit().compareTo(upper.getSize(), lower.getSize(), lower.getUnit()) >= 0) || (lower.getUnit().compareTo(lower.getSize(), upper.getSize(), upper.getUnit()) <= 0); } catch (IllegalArgumentException e) { inversion = false; } if (inversion) { throw new IllegalArgumentException("Tiering Inversion: '" + upper + "' is not smaller than '" + lower + "'"); } } } }

Target:
public static void validateResourcePools(Collection<? extends ResourcePool> pools) { List<SizedResourcePool> ordered = new ArrayList<SizedResourcePool>(pools.size()); for(ResourcePool pool : pools) { if (pool instanceof SizedResourcePool) { ordered.add((SizedResourcePool)pool); } } Collections.sort(ordered, new Comparator<SizedResourcePool>() { @Override public int compare(final SizedResourcePool o1, final SizedResourcePool o2) { int retVal = o2.getType().getTierHeight() - o1.getType().getTierHeight(); if(retVal == 0) { return o1.toString().compareTo(o2.toString()); } else { return retVal; } } }); for (int i = 0; i < ordered.size(); i++) { for (int j = 0; j < i; j++) { SizedResourcePool upper = ordered.get(j); SizedResourcePool lower = ordered.get(i); boolean inversion; boolean ambiguity; try { ambiguity = upper.getType().getTierHeight() == lower.getType().getTierHeight(); inversion = (upper.getUnit().compareTo(upper.getSize(), lower.getSize(), lower.getUnit()) >= 0) || (lower.getUnit().compareTo(lower.getSize(), upper.getSize(), upper.getUnit()) <= 0); } catch (IllegalArgumentException e) { ambiguity = false; inversion = false; } if (ambiguity) { throw new IllegalArgumentException("Tiering Ambiguity: '" + upper + "' has the same tier height as '" + lower + "'"); } if (inversion) { throw new IllegalArgumentException("Tiering Inversion: '" + upper + "' is not smaller than '" + lower + "'"); } } } }
Source:
private Integer getMemory(Plan plan) { if (plan.specs() == null || plan.specs().drives() == null) return -1; String total = plan.specs().memory().total(); if (total.endsWith("GB")) { return Integer.valueOf(total.substring(0, total.length() - 2)) * 1024; } else { throw new IllegalArgumentException("Cannot parse memory: " + plan.specs().memory()); } }

Target:
private Integer getMemory(Plan plan) { if (plan.specs() == null || plan.specs().drives() == null) return 0; String total = plan.specs().memory().total(); if (total.endsWith("GB")) { return Integer.valueOf(total.substring(0, total.length() - 2)) * 1024; } else { throw new IllegalArgumentException("Cannot parse memory: " + plan.specs().memory()); } }
Source:
private synchronized void initContext(ClientContext ctx, MasterInquireClient masterInquireClient) { mClosed.set(false); mMasterClientContext = MasterClientContext.newBuilder(ctx) .setMasterInquireClient(masterInquireClient).build(); try { InetSocketAddress masterAddr = masterInquireClient.getPrimaryRpcAddress(); mMasterClientContext.loadConf(masterAddr, true, true); } catch (UnavailableException e) { LOG.error("Failed to get master address during initialization", e); } catch (AlluxioStatusException ae) { LOG.error("Failed to load configuration from " + "meta master during initialization", ae); } mFileSystemMasterClientPool = new FileSystemMasterClientPool(mMasterClientContext); mBlockMasterClientPool = new BlockMasterClientPool(mMasterClientContext); mWorkerGroup = NettyUtils.createEventLoop(NettyUtils.getUserChannel(getClusterConf()), getClusterConf().getInt(PropertyKey.USER_NETWORK_NETTY_WORKER_THREADS), String.format("alluxio-client-nettyPool-%s-%%d", mId), true); mMetricsEnabled = getClusterConf().getBoolean(PropertyKey.USER_METRICS_COLLECTION_ENABLED); if (mMetricsEnabled) { MetricsSystem.startSinks(getClusterConf().get(PropertyKey.METRICS_CONF_FILE)); MetricsHeartbeatContext.addHeartbeat(getClientContext(), masterInquireClient); } mUriValidationEnabled = ctx.getUriValidationEnabled(); }

Target:
private synchronized void initContext(ClientContext ctx, MasterInquireClient masterInquireClient) { mClosed.set(false); mMasterClientContext = MasterClientContext.newBuilder(ctx) .setMasterInquireClient(masterInquireClient).build(); mMetricsEnabled = getClusterConf().getBoolean(PropertyKey.USER_METRICS_COLLECTION_ENABLED); if (mMetricsEnabled) { try { InetSocketAddress masterAddr = masterInquireClient.getPrimaryRpcAddress(); mMasterClientContext.loadConf(masterAddr, true, true); } catch (UnavailableException e) { LOG.error("Failed to get master address during initialization", e); } catch (AlluxioStatusException ae) { LOG.error("Failed to load configuration from " + "meta master during initialization", ae); } MetricsSystem.startSinks(getClusterConf().get(PropertyKey.METRICS_CONF_FILE)); MetricsHeartbeatContext.addHeartbeat(getClientContext(), masterInquireClient); } mFileSystemMasterClientPool = new FileSystemMasterClientPool(mMasterClientContext); mBlockMasterClientPool = new BlockMasterClientPool(mMasterClientContext); mWorkerGroup = NettyUtils.createEventLoop(NettyUtils.getUserChannel(getClusterConf()), getClusterConf().getInt(PropertyKey.USER_NETWORK_NETTY_WORKER_THREADS), String.format("alluxio-client-nettyPool-%s-%%d", mId), true); mUriValidationEnabled = ctx.getUriValidationEnabled(); }
Source:
public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); switch (id) { case R.id.actionSettings: Intent i = new Intent(this, SettingsActivity.class); startActivity(i); return true; case R.id.actionSearchLocal: return true; case R.id.actionLogout: this.showLogoutDialog(); return true; case R.id.syncbutton: boolean syncState = OpenMRS.getInstance().getSyncState(); if (syncState) { OpenMRS.getInstance().setSyncState(false); setSyncButtonState(false); } else if(NetworkUtils.hasNetwork()){ OpenMRS.getInstance().setSyncState(true); setSyncButtonState(true); Intent intent = new Intent("org.openmrs.mobile.intent.action.SYNC_PATIENTS"); getApplicationContext().sendBroadcast(intent); } else { showNoInternetConnectionSnackbar(); } return true; case R.id.actionLocation: ArrayList<Location> list = (ArrayList<Location>) new LocationDAO().getLocationList(); String[] items = new String[list.size()]; String selected = mOpenMRS.getLocation(); int checkedItem = -1; for (int j = 0; j < list.size(); j++) { items[j] = list.get(j).getName(); if (items[j].equals(selected)) checkedItem = j; } new AlertDialog.Builder(this) .setSingleChoiceItems(items, checkedItem, (dialog, which) -> { mOpenMRS.setLocation(list.get(which).getName()); dialog.dismiss(); }) .show(); return true; default: return super.onOptionsItemSelected(item); } }

Target:
public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); switch (id) { case R.id.actionSettings: Intent i = new Intent(this, SettingsActivity.class); startActivity(i); return true; case R.id.actionSearchLocal: return true; case R.id.actionLogout: this.showLogoutDialog(); return true; case R.id.syncbutton: boolean syncState = OpenMRS.getInstance().getSyncState(); if (syncState) { OpenMRS.getInstance().setSyncState(false); setSyncButtonState(false); } else if(NetworkUtils.hasNetwork()){ OpenMRS.getInstance().setSyncState(true); setSyncButtonState(true); Intent intent = new Intent("org.openmrs.mobile.intent.action.SYNC_PATIENTS"); getApplicationContext().sendBroadcast(intent); } else { showNoInternetConnectionSnackbar(); } return true; case R.id.actionLocation: List<String> list = new LocationDAO().getLocationList(); new AlertDialog.Builder(this) .setSingleChoiceItems( new ArrayAdapter<>(this, android.R.layout.simple_list_item_single_choice, list), list.indexOf(mOpenMRS.getLocation()), (dialog, which) -> { mOpenMRS.setLocation(list.get(which)); dialog.dismiss(); }) .show(); return true; default: return super.onOptionsItemSelected(item); } }
Source:
public void setIdentifiers(List<Identifier> identifiers) { Identifiers = identifiers; }

Target:
public void setIdentifiers(List<Identifier> identifiers) { this.identifiers = identifiers; }
Source:
private void executeOperation(final DataOperation operation) { final long dataKey = operation.getDataKey(); final Pair<Boolean, String> routingResult = router.route(dataKey); if (routingResult.getFirst()) { executeLocalOperation(operation); } else { final String targetEvalId = routingResult.getSecond(); remoteSender.sendOperation(targetEvalId, operation); } }

Target:
private void executeOperation(final DataOperation operation) { final long dataKey = operation.getDataKey(); final Pair<Boolean, String> routingResult = router.route(dataKey); final boolean isLocal = routingResult.getFirst(); if (isLocal) { executeLocalOperation(operation); } else { final String targetEvalId = routingResult.getSecond(); remoteSender.sendOperation(targetEvalId, operation); } }
Source:
public static double getContrastRatio(final int rgb1, final int rgb2) { final double lumi1 = getLuminance(Color.red(rgb1), Color.green(rgb1), Color.blue(rgb1)) + 0.05; final double lumi2 = getLuminance(Color.red(rgb2), Color.green(rgb2), Color.blue(rgb2)) + 0.05; if (lumi1 > lumi2) { return lumi1 / lumi2; } return lumi2 / lumi1; }

Target:
public static double getContrastRatio(final int rgb1, final int rgb2) { final double lumi1 = getLuminance(Color.red(rgb1), Color.green(rgb1), Color.blue(rgb1)) + 0.05; final double lumi2 = getLuminance(Color.red(rgb2), Color.green(rgb2), Color.blue(rgb2)) + 0.05; return Math.max(lumi1, lumi2) / Math.min(lumi1, lumi2); }
Source:
static String readSymlink(File path) throws IOException { Path nioPath = path.toPath(); Path target = Files.readSymbolicLink(nioPath); String targetString = target.toString(); if (SystemReader.getInstance().isWindows()) targetString = targetString.replace('\\', '/'); else if (SystemReader.getInstance().isMacOS()) { targetString = Normalizer.normalize(targetString, Form.NFC); } return targetString; }

Target:
static String readSymlink(File path) throws IOException { Path nioPath = path.toPath(); Path target = Files.readSymbolicLink(nioPath); String targetString = target.toString(); if (SystemReader.getInstance().isWindows()) targetString = targetString.replace('\\', '/'); else if (SystemReader.getInstance().isMacOS()) targetString = Normalizer.normalize(targetString, Form.NFC); return targetString; }
Source:
public void send(DatastreamProducerRecord record, SendCallback sendCallback) { try { validateEventRecord(record); record.serializeEvents(_datastreamTask.getDestinationSerDes()); _transportProvider.send(_datastreamTask.getDatastreamDestination().getConnectionString(), record, (metadata, exception) -> onSendCallback(metadata, exception, sendCallback, record)); } catch (Exception e) { if (_skipBadMessagesEnabled) { _logger.error("Skipping Message. task: ; error: {}", _datastreamTask, e.toString()); _skippedBadMessagesRate.mark(); } else { String errorMessage = String.format("Failed send the event %s exception %s", record, e); _logger.warn(errorMessage, e); throw new DatastreamRuntimeException(errorMessage, e); } } if (Instant.now().isAfter(_lastFlushTime.plus(_flushInterval))) { flush(); } }

Target:
public void send(DatastreamProducerRecord record, SendCallback sendCallback) { try { validateEventRecord(record); record.serializeEvents(_datastreamTask.getDestinationSerDes()); _transportProvider.send(_datastreamTask.getDatastreamDestination().getConnectionString(), record, (metadata, exception) -> onSendCallback(metadata, exception, sendCallback, record)); } catch (Exception e) { if (_skipBadMessagesEnabled) { _logger.error("Skipping Message. task: ; error: {}", _datastreamTask, e); _skippedBadMessagesRate.mark(); } else { String errorMessage = String.format("Failed send the event %s exception %s", record, e); _logger.warn(errorMessage, e); throw new DatastreamRuntimeException(errorMessage, e); } } if (Instant.now().isAfter(_lastFlushTime.plus(_flushInterval))) { flush(); } }
Source:
private List<Method> getAnnotateMethods(Class<T> annotationClass, Class<?> vmClass) { List<Method> methods = null; synchronized (annoMethodCache) { methods = annoMethodCache.get(vmClass); if (methods != null) return methods; methods = new ArrayList<Method>(); Class<?> curr = vmClass; String sign = null; Set<String> signs = new HashSet<String>(); while (curr != null && !curr.equals(Object.class)) { Method currm = null; T annotation = curr.getAnnotation(annotationClass); for (Method m : curr.getDeclaredMethods()) { final T i = m.getAnnotation(annotationClass); if (i == null) continue; if (annotation != null) { throw new UiException( "more than one [@" + annotationClass.getSimpleName() + "] in the class " + curr); } annotation = i; currm = m; } if (currm != null) { sign = MiscUtil.toSimpleMethodSignature(currm); if (signs.contains(sign)) { _log.warn("more than one method that has same signature '{}' " + "in the hierarchy of '{}', the method in extended class will be call " + "more than once ", annotationClass.getSimpleName(), sign, vmClass); } else { signs.add(sign); } if (annotation.annotationType().getName().equals("org.zkoss.bind.annotation.Destroy")) { methods.add(currm); } else { methods.add(0, currm); } } curr = (annotation != null && shouldLookupSuperclass(annotation)) ? curr.getSuperclass() : null; } methods = Collections.unmodifiableList(methods); annoMethodCache.put(vmClass, methods); } return methods; }

Target:
private List<Method> getAnnotateMethods(Class<T> annotationClass, Class<?> vmClass) { List<Method> methods = null; synchronized (annoMethodCache) { methods = annoMethodCache.get(vmClass); if (methods != null) return methods; methods = new ArrayList<Method>(); Class<?> curr = vmClass; String sign = null; Set<String> signs = new HashSet<String>(); while (curr != null && !curr.equals(Object.class)) { Method currm = null; T annotation = curr.getAnnotation(annotationClass); for (Method m : curr.getDeclaredMethods()) { final T i = m.getAnnotation(annotationClass); if (i == null) continue; if (annotation != null) { throw new UiException( "more than one [@" + annotationClass.getSimpleName() + "] in the class " + curr); } annotation = i; currm = m; } if (currm != null) { sign = MiscUtil.toSimpleMethodSignature(currm); if (signs.contains(sign)) { _log.warn("more than one method that has same signature '{}' " + "in the hierarchy of '{}', the method in extended class will be call " + "more than once ", annotationClass.getSimpleName(), sign, vmClass); } else { signs.add(sign); } if (annotation.annotationType() == Destroy.class) { methods.add(currm); } else { methods.add(0, currm); } } curr = (annotation != null && shouldLookupSuperclass(annotation)) ? curr.getSuperclass() : null; } methods = Collections.unmodifiableList(methods); annoMethodCache.put(vmClass, methods); } return methods; }
Source:
public void toXmlFile(File xmlFile) throws Exception { createDocument("archive"); if (!dirs.isEmpty()) { for(Map.Entry<String, String> entry : dirs.entrySet()){ Element child = doc.createElement("dir"); child.setAttribute("sourceOnDisk", entry.getKey()); child.setAttribute("targetInArchive", entry.getValue()); doc.getDocumentElement().appendChild(child); } } if (!files.isEmpty()) { for(Map.Entry<String, String> entry : files.entrySet()){ Element child = doc.createElement("file"); child.setAttribute("sourceOnDisk", entry.getKey()); child.setAttribute("targetInArchive", entry.getValue()); doc.getDocumentElement().appendChild(child); } } if (!archives.isEmpty()) { for(Map.Entry<String, String> entry : archives.entrySet()){ Element child = doc.createElement("archive"); child.setAttribute("targetInArchive", entry.getValue()); doc.getDocumentElement().appendChild(child); Element grandChild = doc.createElement("dir"); child.setAttribute("sourceOnDisk", entry.getKey()); child.setAttribute("targetInArchive", "/"); doc.getDocumentElement().appendChild(grandChild); } } writeXMLDocument(xmlFile); }

Target:
public void toXmlFile(File xmlFile) throws Exception { createDocument("archive"); if (!dirs.isEmpty()) { for(Map.Entry<String, String> entry : dirs.entrySet()){ Element child = doc.createElement("dir"); addElement(doc.getDocumentElement(), child, entry.getValue(), entry.getKey()); } } if (!files.isEmpty()) { for(Map.Entry<String, String> entry : files.entrySet()){ Element child = doc.createElement("file"); addElement(doc.getDocumentElement(), child, entry.getValue(), entry.getKey()); } } if (!archives.isEmpty()) { for(Map.Entry<String, String> entry : archives.entrySet()){ Element child = doc.createElement("archive"); addElement(doc.getDocumentElement(), child, entry.getValue()); addElement(child, doc.createElement("dir"), "/", entry.getKey()); } } writeXMLDocument(xmlFile); }
Source:
private void openErrorLogView() { SWTBotMenu windowMenuBot = bot.menu("Window"); String showView = "Show View"; SWTBotMenu showViewMenuBot = windowMenuBot.menu(showView); SWTBotMenu otherMenuBot = showViewMenuBot.menu("Other..."); otherMenuBot.click(); bot.shell(showView).activate(); SWTBotTree viewsTreeBot = bot.tree(); bot.text().setText("Error"); SWTBotTreeItem expandNode = viewsTreeBot.expandNode("General"); bot.waitUntil(new TreeItemExpanded(expandNode, expandNode.getText())); expandNode.getNode("Error Log").doubleClick(); }

Target:
private void openErrorLogView() { bot.menu("Window").menu("Show View").menu("Other...").click(); SWTBotTree viewsTreeBot = bot.tree(); bot.text().setText("Error"); SWTBotTreeItem expandNode = viewsTreeBot.expandNode("General"); bot.waitUntil(new TreeItemExpanded(expandNode, expandNode.getText())); expandNode.getNode("Error Log").doubleClick(); }
Source:
protected void doGet(final HttpServletRequest req, final HttpServletResponse rsp) throws IOException { final Page.Content page = get().get(select(req)); final byte[] raw; final CurrentUser user = currentUser.get(); if (user instanceof IdentifiedUser) { final StringWriter w = new StringWriter(); w.write(HPD_ID + ".account="); json(((IdentifiedUser) user).getAccount(), w); w.write(";"); w.write(HPD_ID + ".xsrfToken="); json(session.get().getToken(), w); w.write(";"); w.write(HPD_ID + ".accountDiffPref="); json(((IdentifiedUser) user).getAccountDiffPreference(), w); w.write(";"); w.write(HPD_ID + ".theme="); json(signedInTheme, w); w.write(";"); final byte[] userData = w.toString().getBytes("UTF-8"); raw = concat(page.part1, userData, page.part2); } else { raw = page.full; } final byte[] tosend; if (RPCServletUtils.acceptsGzipEncoding(req)) { rsp.setHeader("Content-Encoding", "gzip"); tosend = raw == page.full ? page.full_gz : HtmlDomUtil.compress(raw); } else { tosend = raw; } rsp.setHeader("Expires", "Fri, 01 Jan 1980 00:00:00 GMT"); rsp.setHeader("Pragma", "no-cache"); rsp.setHeader("Cache-Control", "no-cache, must-revalidate"); rsp.setContentType("text/html"); rsp.setCharacterEncoding(HtmlDomUtil.ENC); rsp.setContentLength(tosend.length); final OutputStream out = rsp.getOutputStream(); try { out.write(tosend); } finally { out.close(); } }

Target:
protected void doGet(final HttpServletRequest req, final HttpServletResponse rsp) throws IOException { final Page.Content page = get().get(select(req)); final CurrentUser user = currentUser.get(); final StringWriter w = new StringWriter(); if (user instanceof IdentifiedUser) { w.write(HPD_ID + ".account="); json(((IdentifiedUser) user).getAccount(), w); w.write(";"); w.write(HPD_ID + ".xsrfToken="); json(session.get().getToken(), w); w.write(";"); w.write(HPD_ID + ".accountDiffPref="); json(((IdentifiedUser) user).getAccountDiffPreference(), w); w.write(";"); w.write(HPD_ID + ".theme="); json(signedInTheme, w); w.write(";"); } else { w.write(HPD_ID + ".theme="); json(signedOutTheme, w); w.write(";"); } w.write(HPD_ID + ".plugnisUrls="); json(getPluginUrls(), w); w.write(";"); final byte[] userData = w.toString().getBytes("UTF-8"); final byte[] raw = concat(page.part1, userData, page.part2); final byte[] tosend; if (RPCServletUtils.acceptsGzipEncoding(req)) { rsp.setHeader("Content-Encoding", "gzip"); tosend = HtmlDomUtil.compress(raw); } else { tosend = raw; } rsp.setHeader("Expires", "Fri, 01 Jan 1980 00:00:00 GMT"); rsp.setHeader("Pragma", "no-cache"); rsp.setHeader("Cache-Control", "no-cache, must-revalidate"); rsp.setContentType("text/html"); rsp.setCharacterEncoding(HtmlDomUtil.ENC); rsp.setContentLength(tosend.length); final OutputStream out = rsp.getOutputStream(); try { out.write(tosend); } finally { out.close(); } }
Source:
public RowExpression pushNegationToLeaves(RowExpression expression) { if (isNotCallExpression(expression)) { RowExpression argument = ((CallExpression) expression).getArguments().get(0); if (isNotCallExpression(argument)) { return pushNegationToLeaves(((CallExpression) argument).getArguments().get(0)); } if (isConjunctionOrDisjunction(argument)) { SpecialFormExpression specialForm = ((SpecialFormExpression) argument); if (specialForm.getForm() == AND) { return or(pushNegationToLeaves(notCallExpression(specialForm.getArguments().get(0))), pushNegationToLeaves(notCallExpression(specialForm.getArguments().get(1)))); } return and(pushNegationToLeaves(notCallExpression(specialForm.getArguments().get(0))), pushNegationToLeaves(notCallExpression(specialForm.getArguments().get(1)))); } return expression; } if (isConjunctionOrDisjunction(expression)) { SpecialFormExpression specialForm = ((SpecialFormExpression) expression); if (specialForm.getForm() == AND) { return and(pushNegationToLeaves(specialForm.getArguments().get(0)), pushNegationToLeaves(specialForm.getArguments().get(1))); } return or(pushNegationToLeaves(specialForm.getArguments().get(0)), pushNegationToLeaves(specialForm.getArguments().get(1))); } return expression; }

Target:
public RowExpression pushNegationToLeaves(RowExpression expression) { return expression.accept(new PushNegationVisitor(), null); }