auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void actionPerformed(ActionEvent event) { eventLogger.log(this); if (appContext.getCurrentProject() == null || appContext.getCurrentProject().getRootProject() == null) { Log.error(getClass(), "Can not run find/replace without opened project\n"); return; } if (event.getParameters() == null) { Log.error(getClass(), "Can not run find/replace without parameters"); return; } final Map<String, String> parameters = event.getParameters(); String file = parameters.get("in"); String find = parameters.get("find"); String replace = parameters.get("replace"); String mode = parameters.get("replaceMode"); final ReplacementSet replacementSet = dtoFactory.createDto(ReplacementSet.class).withFiles(Arrays.asList(file)) .withEntries(Arrays.asList(dtoFactory.createDto(Variable.class) .withFind(find) .withReplace(replace) .withReplacemode(mode))); vfsServiceClient.replaceInCurrentWorkspace(appContext.getWorkspaceId(), appContext.getCurrentProject().getRootProject().getPath(), Arrays.asList(replacementSet), new AsyncRequestCallback<Void>() { @Override protected void onSuccess(Void result) { } @Override protected void onFailure(Throwable exception) { } }); }

Target:
public void actionPerformed(ActionEvent event) { eventLogger.log(this); if (appContext.getCurrentProject() == null || appContext.getCurrentProject().getRootProject() == null) { Log.error(getClass(), "Can not run find/replace without opened project\n"); return; } if (event.getParameters() == null) { Log.error(getClass(), "Can not run find/replace without parameters"); return; } final Map<String, String> parameters = event.getParameters(); String file = parameters.get("in"); String find = parameters.get("find"); String replace = parameters.get("replace"); String mode = parameters.get("replaceMode"); final ReplacementSet replacementSet = dtoFactory.createDto(ReplacementSet.class).withFiles(Arrays.asList(file)) .withEntries(Arrays.asList(dtoFactory.createDto(Variable.class) .withFind(find) .withReplace(replace) .withReplacemode(mode))); vfsServiceClient.replace(appContext.getWorkspaceId(), appContext.getCurrentProject().getRootProject().getPath(), Arrays.asList(replacementSet), new AsyncRequestCallback<Void>() { @Override protected void onSuccess(Void result) { } @Override protected void onFailure(Throwable exception) { } }); }
Source:
public NullOperationLogger() { }

Target:
private NullOperationLogger() { }
Source:
private List<VdsNetworkInterface> nicsToInterfaces(List<HostNIC> hostNics) { List<VdsNetworkInterface> ifaces = new ArrayList<VdsNetworkInterface>(hostNics.size()); for (HostNIC nic : hostNics) { VdsNetworkInterface iface = map(nic, null); ifaces.add(iface); if (nic.isSetBonding() && nic.getBonding().isSetSlaves()) { for (HostNIC slave : nic.getBonding().getSlaves().getSlaves()) { VdsNetworkInterface slaveIface = map(lookupNic(slave.getId()), null); slaveIface.setBondName(nic.getName()); ifaces.add(slaveIface); } } } return ifaces; }

Target:
private List<VdsNetworkInterface> nicsToInterfaces(List<HostNIC> hostNics) { List<VdsNetworkInterface> ifaces = new ArrayList<VdsNetworkInterface>(hostNics.size()); for (HostNIC nic : hostNics) { VdsNetworkInterface iface = map(nic, null); ifaces.add(iface); if (nic.isSetBonding() && nic.getBonding().isSetSlaves()) { for (HostNIC slave : nic.getBonding().getSlaves().getSlaves()) { VdsNetworkInterface slaveIface = map(slave, lookupInterface(slave.getId())); slaveIface.setBondName(nic.getName()); ifaces.add(slaveIface); } } } return ifaces; }
Source:
public ListenableFuture<SegmentsAndMetadata> publish( final TransactionalSegmentPublisher publisher, final Committer committer, final Collection<String> sequenceNames ) { final List<SegmentIdentifier> theSegments = new ArrayList<>(); synchronized (segments) { sequenceNames.stream() .filter(sequenceName -> !publishingSequences.contains(sequenceName)) .forEach(sequenceName -> { if (segments.containsKey(sequenceName)) { segments.get(sequenceName) .values() .stream() .flatMap(Collection::stream) .forEach(segmentWithState -> { segmentWithState.state = SegmentState.PUBLISHING; theSegments.add(segmentWithState.getSegmentIdentifier()); }); } }); } final ListenableFuture<SegmentsAndMetadata> publishFuture = publish( publisher, wrapCommitter(committer), theSegments ); Futures.addCallback( publishFuture, new FutureCallback<SegmentsAndMetadata>() { @Override public void onSuccess(SegmentsAndMetadata result) { if (result != null) { publishingSequences.removeAll(sequenceNames); sequenceNames.forEach(segments::remove); } } @Override public void onFailure(Throwable t) { log.error("Error publishing sequences [%s]", sequenceNames); } } ); return publishFuture; }

Target:
public ListenableFuture<SegmentsAndMetadata> publish( final TransactionalSegmentPublisher publisher, final Committer committer, final Collection<String> sequenceNames ) { final List<SegmentIdentifier> theSegments = new ArrayList<>(); synchronized (segments) { sequenceNames.stream() .filter(sequenceName -> !publishingSequences.contains(sequenceName)) .forEach(sequenceName -> { if (segments.containsKey(sequenceName)) { publishingSequences.add(sequenceName); segments.get(sequenceName) .values() .stream() .flatMap(Collection::stream) .forEach(segmentWithState -> { segmentWithState.state = SegmentState.PUBLISHING; theSegments.add(segmentWithState.getSegmentIdentifier()); }); } }); } final ListenableFuture<SegmentsAndMetadata> publishFuture = publish( publisher, wrapCommitter(committer), theSegments ); Futures.addCallback( publishFuture, new FutureCallback<SegmentsAndMetadata>() { @Override public void onSuccess(SegmentsAndMetadata result) { if (result != null) { publishingSequences.removeAll(sequenceNames); sequenceNames.forEach(segments::remove); } } @Override public void onFailure(Throwable t) { log.error("Error publishing sequences [%s]", sequenceNames); } } ); return publishFuture; }
Source:
public PartitionedFile getResultFile() { return resultFile; }

Target:
PartitionedFile getResultFile() { return resultFile; }
Source:
public void draw(SpriteBatch batch, Camera camera, DrawLayer layer) { if (this.getEntity().isLocalPlayer()) { colorId = ColorSets.BLUE; } else { colorId = ColorSets.RED; } if (this.getEntity().isRunning()) animationState = 2; else if (this.getEntity().isBuilding()) animationState = 1; else animationState = 0; switch (animationState) { case 0: if (lastAnimationState != 0) { lastAnimationState = 0; frameIndex = 0; } drawTexture(batch, camera, layer, standingFrames[colorId]); break; case 1: if (lastAnimationState != 1) { frameIndex = 0; lastAnimationState = 1; } drawTexture(batch, camera, layer, buildingFrames[frameIndex][colorId]); frameTimeRemaining -= (System.currentTimeMillis() - lastFrameTime); lastFrameTime = System.currentTimeMillis(); if (frameTimeRemaining < 0) { frameTimeRemaining = millisPerFrame; frameIndex = (frameIndex == buildingFrames.length - 1) ? 0 : frameIndex + 1; } break; case 2: if (lastAnimationState != 2) { frameIndex = 0; lastAnimationState = 2; } drawTexture(batch, camera, layer, runningFrames[frameIndex][colorId]); frameTimeRemaining -= (System.currentTimeMillis() - lastFrameTime); lastFrameTime = System.currentTimeMillis(); if (frameTimeRemaining < 0) { frameTimeRemaining = millisPerFrame; frameIndex = (frameIndex == runningFrames.length - 1) ? 0 : frameIndex + 1; } break; default: throw new GameLogicException( "Programming error in EngineerSprite: default case reached."); } }

Target:
public void draw(SpriteBatch batch, Camera camera, DrawLayer layer) { if (isEntityDisposed()) { Sprites.getInstance().removeSprite(this); } else { if (this.getEntity().isLocalPlayer()) { colorId = ColorSets.BLUE; } else { colorId = ColorSets.RED; } if (this.getEntity().isRunning()) { animationState = 2; } else if (this.getEntity().isBuilding()) { animationState = 1; } else { animationState = 0; } switch (animationState) { case 0: if (lastAnimationState != 0) { lastAnimationState = 0; frameIndex = 0; } drawTexture(batch, camera, layer, standingFrames[colorId]); break; case 1: if (lastAnimationState != 1) { frameIndex = 0; lastAnimationState = 1; } drawTexture(batch, camera, layer, buildingFrames[frameIndex][colorId]); frameTimeRemaining -= (System.currentTimeMillis() - lastFrameTime); lastFrameTime = System.currentTimeMillis(); if (frameTimeRemaining < 0) { frameTimeRemaining = millisPerFrame; frameIndex = (frameIndex == buildingFrames.length - 1) ? 0 : frameIndex + 1; } break; case 2: if (lastAnimationState != 2) { frameIndex = 0; lastAnimationState = 2; } drawTexture(batch, camera, layer, runningFrames[frameIndex][colorId]); frameTimeRemaining -= (System.currentTimeMillis() - lastFrameTime); lastFrameTime = System.currentTimeMillis(); if (frameTimeRemaining < 0) { frameTimeRemaining = millisPerFrame; frameIndex = (frameIndex == runningFrames.length - 1) ? 0 : frameIndex + 1; } break; default: throw new GameLogicException( "Programming error in EngineerSprite: default case reached."); } } }
Source:
public boolean isNoexcept(boolean inCalledContext) { return fPositive.isNoexcept(inCalledContext) && fNegative.isNoexcept(inCalledContext); }

Target:
public boolean isNoexcept(boolean inCalledContext) { return fCondition.isNoexcept(inCalledContext) && fPositive.isNoexcept(inCalledContext) && fNegative.isNoexcept(inCalledContext); }
Source:
public Response getByURI(@HeaderParam("Accept-Language") @ApiParam(value = "Accept-Language") String language, @PathParam("uri") @ApiParam(value = "uri") String uri) { Locale locale = LocaleUtil.getLocale(language); try { ConfigDescription configDescription = this.configDescriptionRegistry.getConfigDescription(new URI(uri), locale); return configDescription != null ? Response.ok(configDescription).build() : Response.status(404).build(); } catch (URISyntaxException e) { return Response.status(400).build(); } }

Target:
public Response getByURI(@HeaderParam("Accept-Language") @ApiParam(value = "Accept-Language") String language, @PathParam("uri") @ApiParam(value = "uri") String uri) { Locale locale = LocaleUtil.getLocale(language); try { ConfigDescription configDescription = this.configDescriptionRegistry.getConfigDescription(new URI(uri), locale); return configDescription != null ? Response.ok(ConfigDescriptionDTOMapper.map(configDescription)).build() : Response.status(404).build(); } catch (URISyntaxException e) { return Response.status(400).build(); } }
Source:
private void postFailureEvent(String extensionId, String msg) { if (eventPublisher != null) { Event event = ExtensionEventFactory.createExtensionFailureEvent(extensionId, msg); eventPublisher.post(event); } }

Target:
private void postFailureEvent(String extensionId, String msg) { Event event = ExtensionEventFactory.createExtensionFailureEvent(extensionId, msg); eventPublisher.post(event); }
Source:
BytesRef apply(long ord) throws IOException; } public GlobalOrdinalsStringTermsAggregator( String name, AggregatorFactories factories, Function<GlobalOrdinalsStringTermsAggregator, ResultStrategy<?, ?, ?>> resultStrategy, ValuesSource.Bytes.WithOrdinals valuesSource, BucketOrder order, DocValueFormat format, BucketCountThresholds bucketCountThresholds, IncludeExclude.OrdinalsFilter includeExclude, SearchContext context, Aggregator parent, boolean remapGlobalOrds, SubAggCollectionMode collectionMode, boolean showTermDocCountError, boolean collectsFromSingleBucket, Map<String, Object> metadata ) throws IOException { super(name, factories, context, parent, order, format, bucketCountThresholds, collectionMode, showTermDocCountError, metadata); this.resultStrategy = resultStrategy.apply(this); this.valuesSource = valuesSource; final IndexReader reader = context.searcher().getIndexReader(); final SortedSetDocValues values = reader.leaves().size() > 0 ? valuesSource.globalOrdinalsValues(context.searcher().getIndexReader().leaves().get(0)) : DocValues.emptySortedSet(); this.valueCount = values.getValueCount(); this.lookupGlobalOrd = values::lookupOrd; this.acceptedGlobalOrdinals = includeExclude == null ? ALWAYS_TRUE : includeExclude.acceptedGlobalOrdinals(values)::get; if (remapGlobalOrds) { this.collectionStrategy = new RemapGlobalOrds(collectsFromSingleBucket); } else { assert collectsFromSingleBucket; this.collectionStrategy = new DenseGlobalOrds(); } }

Target:
BytesRef apply(long ord) throws IOException; } public GlobalOrdinalsStringTermsAggregator( String name, AggregatorFactories factories, Function<GlobalOrdinalsStringTermsAggregator, ResultStrategy<?, ?, ?>> resultStrategy, ValuesSource.Bytes.WithOrdinals valuesSource, BucketOrder order, DocValueFormat format, BucketCountThresholds bucketCountThresholds, IncludeExclude.OrdinalsFilter includeExclude, SearchContext context, Aggregator parent, boolean remapGlobalOrds, SubAggCollectionMode collectionMode, boolean showTermDocCountError, boolean collectsFromSingleBucket, Map<String, Object> metadata ) throws IOException { super(name, factories, context, parent, order, format, bucketCountThresholds, collectionMode, showTermDocCountError, metadata); this.resultStrategy = resultStrategy.apply(this); this.valuesSource = valuesSource; final IndexReader reader = context.searcher().getIndexReader(); final SortedSetDocValues values = reader.leaves().size() > 0 ? valuesSource.globalOrdinalsValues(context.searcher().getIndexReader().leaves().get(0)) : DocValues.emptySortedSet(); this.valueCount = values.getValueCount(); this.lookupGlobalOrd = values::lookupOrd; this.acceptedGlobalOrdinals = includeExclude == null ? ALWAYS_TRUE : includeExclude.acceptedGlobalOrdinals(values)::get; if (remapGlobalOrds) { this.collectionStrategy = new RemapGlobalOrds(collectsFromSingleBucket); } else { if (false == collectsFromSingleBucket) { throw new AggregationExecutionException("Dense ords don't know how to collect from many buckets"); } this.collectionStrategy = new DenseGlobalOrds(); } }
Source:
private Future<Integer> recycleIps(final UUID devId, List<String> ips) { ArrayList<Future<Integer>> fs = new ArrayList<>(ips.size()); for (String ip : ips) { final IPv4Addr ipv4 = IPv4Addr.apply(ip); final String ipPath = paths.getNatIpPath(devId, ipv4); final Promise<Integer> p = Promise$.MODULE$.apply(); fs.add(p.future()); zk.getData(ipPath, false, new AsyncCallback.DataCallback() { @Override public void processResult(int rc, String path, Object ctx, byte[] data, Stat stat) { ArrayList<Op> deleteOps = new ArrayList<>(NatBlock.TOTAL_BLOCKS + 1); if (rc == KeeperException.Code.OK.intValue()) { deleteOps.add(Op.delete(path, stat.getVersion())); tryRecycleBlocks(devId, ipv4, 0, deleteOps, p); } else { p.success(0); } } }, null); } return sum(fs); }

Target:
private Future<Integer> recycleIps(final UUID devId, List<String> ips) { ArrayList<Future<Integer>> fs = new ArrayList<>(ips.size()); for (String ip : ips) { final IPv4Addr ipv4 = IPv4Addr.apply(ip); final String ipPath = paths.getNatIpPath(devId, ipv4); final Promise<Integer> p = Promise$.MODULE$.apply(); fs.add(p.future()); zk.getData(ipPath, false, new AsyncCallback.DataCallback() { @Override public void processResult(int rc, String path, Object ctx, byte[] data, Stat stat) { Op[] deleteOps = new Op[NatBlock.TOTAL_BLOCKS + 1]; if (rc == KeeperException.Code.OK.intValue()) { deleteOps[NatBlock.TOTAL_BLOCKS] = Op.delete(path, stat.getVersion()); tryRecycleBlocks(devId, ipv4, 0, deleteOps, p); } else { p.success(0); } } }, null); } return sum(fs); }
Source:
private void populatePositionsForEachPartition(Page page) { for (int i = 0; i < partitionData.length; i++) { PartitionData target = partitionData[i]; target.ensurePositionsCapacity(page.getPositionCount()); target.resetPositionCount(); } Page partitionFunctionArgs = getPartitionFunctionArguments(page); int positionCount = page.getPositionCount(); for (int position = 0; position < positionCount; position++) { boolean shouldReplicate = (replicatesAnyRow && !hasAnyRowBeenReplicated) || nullChannel.isPresent() && page.getBlock(nullChannel.getAsInt()).isNull(position); if (shouldReplicate) { for (int i = 0; i < partitionData.length; i++) { partitionData[i].appendPosition(position); } hasAnyRowBeenReplicated = true; } else { int partition = partitionFunction.getPartition(partitionFunctionArgs, position); partitionData[partition].appendPosition(position); } } }

Target:
private void populatePositionsForEachPartition(Page page) { int positionCount = page.getPositionCount(); for (int i = 0; i < partitionData.length; i++) { partitionData[i].ensurePositionsCapacity(positionCount); partitionData[i].resetPositionCount(); } Block nullBlock = nullChannel.isPresent() ? page.getBlock(nullChannel.getAsInt()) : null; Page partitionFunctionArgs = getPartitionFunctionArguments(page); for (int position = 0; position < positionCount; position++) { boolean shouldReplicate = (replicatesAnyRow && !hasAnyRowBeenReplicated) || nullChannel.isPresent() && nullBlock.isNull(position); if (shouldReplicate) { for (int i = 0; i < partitionData.length; i++) { partitionData[i].appendPosition(position); } hasAnyRowBeenReplicated = true; } else { int partition = partitionFunction.getPartition(partitionFunctionArgs, position); partitionData[partition].appendPosition(position); } } }
Source:
public void modifyIcon( final ModifyProjectIconParams params ) { callWithUpdateContext( ( () -> { doModifyIcon( params ); LOG.info( "Icon for project updated: " + params.getName() ); return true; } ), params.getName() ); }

Target:
public void modifyIcon( final ModifyProjectIconParams params ) { callWithUpdateContext( ( () -> { doModifyIcon( params ); LOG.debug( "Icon for project updated: " + params.getName() ); return true; } ), params.getName() ); }
Source:
public void testCreateTaskManagerPodFailedAndRetry() throws Exception { flinkKubeClient = spy(createFlinkKubeClient()); TestingKubernetesResourceManager testRM = createAndStartResourceManager(flinkConfig); registerSlotRequest(testRM); verify(flinkKubeClient, timeout(TIMEOUT.toMilliseconds()) .atLeast(2)) .createTaskManagerPod(any(KubernetesPod.class)); testRM.close(); flinkKubeClient.close(); }

Target:
public void testCreateTaskManagerPodFailedAndRetry() throws Exception { final AtomicInteger retries = new AtomicInteger(0); final int numOfFailedRetries = 3; final OneShotLatch podCreated = new OneShotLatch(); final FlinkKubeClient flinkKubeClient = createTestingFlinkKubeClientAllocatingPodsAfter(numOfFailedRetries, retries, podCreated); final TestingKubernetesResourceManager testRM = createAndStartResourceManager(flinkConfig, flinkKubeClient); registerSlotRequest(testRM); podCreated.await(); assertThat( "Creating taskmanager should fail " + numOfFailedRetries + " times and then succeed", retries.get(), is(numOfFailedRetries + 1)); testRM.close(); flinkKubeClient.close(); }
Source:
public void setContentType(String contentType) { if (contentType != null) { this.contentType = GlusterHookContentType.valueOf(contentType); } }

Target:
public void setContentType(String contentType) { if (contentType != null) { this.contentType = GlusterHookContentType.valueOf(contentType); } else { this.contentType = null; } }
Source:
void unregister() throws JMException { try { server.unregisterMBean(instance.getObjectName()); } finally { instance = null; } }

Target:
protected void unregister() throws JMException { try { server.unregisterMBean(instance.getObjectName()); } finally { instance = null; } }
Source:
public SequencerServerCache(long cacheSize) { CacheWriter<String, Long> writer = new CacheWriter<String, Long>() { @Override public void write(@Nonnull String key, @Nonnull Long value) { } @Override public void delete(@Nonnull String key, @Nullable Long globalAddress, @Nonnull RemovalCause cause) { if (cause == RemovalCause.REPLACED) { return; } log.trace( "Updating maxConflictWildcard. Old = '{}', new ='{}' conflictParam = '{}'. Cause = '{}'", maxConflictWildcard, globalAddress, key, cause ); if (globalAddress == null) { globalAddress = Address.NOT_FOUND; } maxConflictWildcard = Math.max(globalAddress, maxConflictWildcard); } }; this.conflictToGlobalTailCache = Caffeine.newBuilder() .maximumSize(cacheSize) .executor(Runnable::run) .writer(writer) .recordStats() .build(); }

Target:
public SequencerServerCache(long cacheSize) { this.conflictCache = Caffeine.newBuilder() .maximumSize(cacheSize) .executor(Runnable::run) .writer(getDefaultCacheWriter()) .recordStats() .build(); }
Source:
private void encodeComponent(CharSequence s) { if (CharsetUtil.UTF_8.equals(charset)) { encodeUtf8Component(s); } else { encodeNonUtf8Component(s); } }

Target:
private void encodeComponent(CharSequence s) { if (charset == null) { encodeUtf8Component(s); } else { encodeNonUtf8Component(s); } }
Source:
public void scrutinize(ItemUpdate update) { Map<PropertyIdValue, Integer> propertyCount = new HashMap<>(); for (Statement statement : update.getAddedStatements()) { PropertyIdValue pid = statement.getClaim().getMainSnak().getPropertyId(); if (propertyCount.containsKey(pid)) { propertyCount.put(pid, propertyCount.get(pid) + 1); } else if (_fetcher.hasMultiValue(pid)) { propertyCount.put(pid, 1); } } if (update.isNew()) { for (PropertyIdValue pid : propertyCount.keySet()) { if (propertyCount.get(pid) == 1) { QAWarning issue = new QAWarning(new_type, pid.getId(), QAWarning.Severity.WARNING, 1); issue.setProperty("property_entity", pid); issue.setProperty("example_entity", update.getItemId()); addIssue(issue); } } } else { for (PropertyIdValue pid : propertyCount.keySet()) { if (propertyCount.get(pid) == 1) { QAWarning issue = new QAWarning(existing_type, pid.getId(), QAWarning.Severity.WARNING, 1); issue.setProperty("property_entity", pid); issue.setProperty("example_entity", update.getItemId()); addIssue(issue); } } } }

Target:
public void scrutinize(ItemUpdate update) { Map<PropertyIdValue, Integer> propertyCount = new HashMap<>(); for (Statement statement : update.getAddedStatements()) { PropertyIdValue pid = statement.getClaim().getMainSnak().getPropertyId(); if (propertyCount.containsKey(pid)) { propertyCount.put(pid, propertyCount.get(pid) + 1); } else if (_fetcher.hasMultiValue(pid)) { propertyCount.put(pid, 1); } } if (update.isNew()) { for (PropertyIdValue pid : propertyCount.keySet()) { if (propertyCount.get(pid) == 1) { QAWarning issue = new QAWarning(new_type, pid.getId(), QAWarning.Severity.WARNING, 1); issue.setProperty("property_entity", pid); issue.setProperty("example_entity", update.getItemId()); addIssue(issue); } } } else { for (PropertyIdValue pid : propertyCount.keySet()) { if (propertyCount.get(pid) == 1) { QAWarning issue = new QAWarning(existing_type, pid.getId(), QAWarning.Severity.INFO, 1); issue.setProperty("property_entity", pid); issue.setProperty("example_entity", update.getItemId()); addIssue(issue); } } } }
Source:
private CheckpointStatistics( @JsonProperty(FIELD_NAME_ID) long id, @JsonProperty(FIELD_NAME_STATUS) CheckpointStatsStatus status, @JsonProperty(FIELD_NAME_IS_SAVEPOINT) boolean savepoint, @JsonProperty(FIELD_NAME_TRIGGER_TIMESTAMP) long triggerTimestamp, @JsonProperty(FIELD_NAME_LATEST_ACK_TIMESTAMP) long latestAckTimestamp, @JsonProperty(FIELD_NAME_STATE_SIZE) long stateSize, @JsonProperty(FIELD_NAME_DURATION) long duration, @JsonProperty(FIELD_NAME_ALIGNMENT_BUFFERED) long alignmentBuffered, @JsonProperty(FIELD_NAME_PROCESSED_DATA) long processedData, @JsonProperty(FIELD_NAME_PERSISTED_DATA) long persistedData, @JsonProperty(FIELD_NAME_NUM_SUBTASKS) int numSubtasks, @JsonProperty(FIELD_NAME_NUM_ACK_SUBTASKS) int numAckSubtasks, @JsonProperty(FIELD_NAME_CHECKPOINT_TYPE) CheckpointType checkpointType, @JsonDeserialize(keyUsing = JobVertexIDKeyDeserializer.class) @JsonProperty(FIELD_NAME_TASKS) Map<JobVertexID, TaskCheckpointStatistics> checkpointStatisticsPerTask) { this.id = id; this.status = Preconditions.checkNotNull(status); this.savepoint = savepoint; this.triggerTimestamp = triggerTimestamp; this.latestAckTimestamp = latestAckTimestamp; this.stateSize = stateSize; this.duration = duration; this.alignmentBuffered = alignmentBuffered; this.processedData = processedData; this.persistedData = persistedData; this.numSubtasks = numSubtasks; this.numAckSubtasks = numAckSubtasks; this.checkpointType = checkpointType; this.checkpointStatisticsPerTask = Preconditions.checkNotNull(checkpointStatisticsPerTask); }

Target:
private CheckpointStatistics( @JsonProperty(FIELD_NAME_ID) long id, @JsonProperty(FIELD_NAME_STATUS) CheckpointStatsStatus status, @JsonProperty(FIELD_NAME_IS_SAVEPOINT) boolean savepoint, @JsonProperty(FIELD_NAME_TRIGGER_TIMESTAMP) long triggerTimestamp, @JsonProperty(FIELD_NAME_LATEST_ACK_TIMESTAMP) long latestAckTimestamp, @JsonProperty(FIELD_NAME_STATE_SIZE) long stateSize, @JsonProperty(FIELD_NAME_DURATION) long duration, @JsonProperty(FIELD_NAME_ALIGNMENT_BUFFERED) long alignmentBuffered, @JsonProperty(FIELD_NAME_PROCESSED_DATA) long processedData, @JsonProperty(FIELD_NAME_PERSISTED_DATA) long persistedData, @JsonProperty(FIELD_NAME_NUM_SUBTASKS) int numSubtasks, @JsonProperty(FIELD_NAME_NUM_ACK_SUBTASKS) int numAckSubtasks, @JsonProperty(FIELD_NAME_CHECKPOINT_TYPE) CheckpointType checkpointType, @JsonDeserialize(keyUsing = JobVertexIDKeyDeserializer.class) @JsonProperty(FIELD_NAME_TASKS) Map<JobVertexID, TaskCheckpointStatistics> checkpointStatisticsPerTask) { this.id = id; this.status = Preconditions.checkNotNull(status); this.savepoint = savepoint; this.triggerTimestamp = triggerTimestamp; this.latestAckTimestamp = latestAckTimestamp; this.stateSize = stateSize; this.duration = duration; this.alignmentBuffered = alignmentBuffered; this.processedData = processedData; this.persistedData = persistedData; this.numSubtasks = numSubtasks; this.numAckSubtasks = numAckSubtasks; this.checkpointType = Preconditions.checkNotNull(checkpointType); this.checkpointStatisticsPerTask = Preconditions.checkNotNull(checkpointStatisticsPerTask); }
Source:
protected C retrieveCredentials(final WebContext context) throws HttpAction { CommonHelper.assertNotNull("credentialsExtractor", this.credentialsExtractor); CommonHelper.assertNotNull("authenticator", this.authenticator); try { final C credentials = this.credentialsExtractor.extract(context); if (credentials == null) { return null; } this.authenticator.validate(credentials, context); return credentials; } catch (CredentialsException e) { if (e instanceof MultipleAccountsFoundException) { throw e; } if (logger.isDebugEnabled()) { logger.info("Failed to retrieve or validate credentials", e); } else { logger.info("Failed to retrieve or validate credentials: {}", e.getMessage()); } return null; } }

Target:
protected C retrieveCredentials(final WebContext context) throws HttpAction { CommonHelper.assertNotNull("credentialsExtractor", this.credentialsExtractor); CommonHelper.assertNotNull("authenticator", this.authenticator); try { final C credentials = this.credentialsExtractor.extract(context); if (credentials == null) { return null; } this.authenticator.validate(credentials, context); return credentials; } catch (CredentialsException e) { logger.info("Failed to retrieve or validate credentials: {}", e.getMessage()); logger.debug("Failed to retrieve or validate credentials", e); return null; } }
Source:
private boolean isNestedCopyfile(CopyFile copyfile) { if (copyfile.dest.indexOf('/') == -1) return false; for (RepoProject proj : filteredProjects) { if (proj.getPath().compareTo(copyfile.dest) > 0) return false; if (proj.isAncestorOf(copyfile.dest)) { return true; } } return false; }

Target:
private boolean isNestedCopyfile(CopyFile copyfile) { if (copyfile.dest.indexOf('/') == -1) { return false; } for (RepoProject proj : filteredProjects) { if (proj.getPath().compareTo(copyfile.dest) > 0) { return false; } if (proj.isAncestorOf(copyfile.dest)) { return true; } } return false; }
Source:
public void createProjectFromXMLWithSpaces() throws IOException { final String xml = "<?xml version='1.0' encoding='UTF-8'?>\n" + "<!DOCTYPE project[\n" + " <!ENTITY foo SYSTEM \"file:/ "]>\n" + "<project>\n" + " <actions/>\n" + " <description>&foo;</description>\n" + " <keepDependencies>false</keepDependencies>\n" + " <properties/>\n" + " <scm class=\"hudson.scm.NullSCM\"/>\n" + " <canRoam>true</canRoam>\n" + " <triggers/>\n" + " <builders/>\n" + " <publishers/>\n" + " <buildWrappers/>\n" + "</project>"; Item foo = r.jenkins.createProjectFromXML("foo bar", new ByteArrayInputStream(xml.getBytes())); assertThat(Items.getConfigFile(foo).asString(), containsString("<description/>")); }

Target:
public void createProjectFromXMLWithSpaces() throws IOException { final String xml = "<?xml version='1.0' encoding='UTF-8'?>\n" + "<project>\n" + " <actions/>\n" + " <description>JENKINS-35638</description>\n" + " <keepDependencies>false</keepDependencies>\n" + " <properties/>\n" + " <scm class=\"hudson.scm.NullSCM\"/>\n" + " <canRoam>true</canRoam>\n" + " <triggers/>\n" + " <builders/>\n" + " <publishers/>\n" + " <buildWrappers/>\n" + "</project>"; Item foo = r.jenkins.createProjectFromXML("foo bar", new ByteArrayInputStream(xml.getBytes())); assertNotNull(foo); }
Source:
public boolean removeAllRps() { try { List<RpObject> rps = this.persistenceEntryManager.findEntries(String.format("%s,%s", new Object[]{getRpOu(), getOxdDn()}), RpObject.class, null); for (RpObject rp : rps) { this.persistenceEntryManager.remove(rp); } LOG.debug("Removed all Rps successfully. "); return true; } catch (Exception e) { if (((e instanceof EntryPersistenceException)) && (e.getMessage().contains("Failed to find entries"))) { LOG.warn("Failed to fetch RpObjects. ", e.getMessage()); return true; } LOG.error("Failed to remove all Rps", e); } return false; }

Target:
public boolean removeAllRps() { try { this.persistenceEntryManager.remove(String.format("%s,%s", new Object[]{getRpOu(), getOxdDn()}), RpObject.class, null, this.configuration.getPersistenceManagerRemoveCount()); LOG.debug("Removed all Rps successfully. "); return true; } catch (Exception e) { LOG.error("Failed to remove all Rps", e); } return false; }
Source:
public void slicesIncludeDuplicates() { Series series = new Series("777777"); List<List<Integer>> expected = Arrays.asList( Arrays.asList(7, 7, 7), Arrays.asList(7, 7, 7), Arrays.asList(7, 7, 7), Arrays.asList(7, 7, 7) ); List<List<Integer>> actual = series.slices(3); assertNotNull(actual); assertFalse(actual.isEmpty()); assertEquals(expected, actual); }

Target:
public void slicesIncludeDuplicates() { Series series = new Series("777777"); List<List<String>> expected = Arrays.asList( Arrays.asList("7", "7", "7"), Arrays.asList("7", "7", "7"), Arrays.asList("7", "7", "7"), Arrays.asList("7", "7", "7") ); List<List<String>> actual = series.slices(3); assertEquals(expected, actual); }
Source:
public RuntimeException convert(PersistenceException exception, Object entity) { if (exception instanceof OptimisticLockException) { return new ConcurrentModificationException( "Account has the wrong version number; it may have been saved in the background."); } if (exception.getCause() instanceof org.hibernate.exception.ConstraintViolationException) { Throwable cause = Throwables.getRootCause(exception); String message = cause.getMessage(); if (message != null && entity != null) { HibernateAccount account = (HibernateAccount)entity; EntityAlreadyExistsException eae = null; if (message.matches("Duplicate entry.*for key 'Accounts-StudyId-ExternalId-Index'")) { eae = createEntityAlreadyExistsException("External ID", AccountId.forExternalId(account.getStudyId(), account.getExternalId())); } else if (message.matches("Duplicate entry.*for key 'Accounts-StudyId-Email-Index'")) { eae = createEntityAlreadyExistsException("Email address", AccountId.forEmail(account.getStudyId(), account.getEmail())); } else if (message.matches("Duplicate entry.*for key 'Accounts-StudyId-Phone-Index'")) { eae = createEntityAlreadyExistsException("Phone number", AccountId.forPhone(account.getStudyId(), account.getPhone())); } if (eae != null) { return eae; } } ConstraintViolationException.Builder cveBuilder = new ConstraintViolationException.Builder(); if (message != null) { cveBuilder.withMessage(cause.getMessage()); } return cveBuilder.build(); } return exception; }

Target:
public RuntimeException convert(PersistenceException exception, Object entity) { if (exception instanceof OptimisticLockException) { return new ConcurrentModificationException( "Account has the wrong version number; it may have been saved in the background."); } if (exception.getCause() instanceof org.hibernate.exception.ConstraintViolationException) { Throwable cause = Throwables.getRootCause(exception); String message = cause.getMessage(); if (message != null && entity != null) { HibernateAccount account = (HibernateAccount)entity; EntityAlreadyExistsException eae = null; if (message.matches("Duplicate entry.*for key 'Accounts-StudyId-ExternalId-Index'")) { eae = createEntityAlreadyExistsException("External ID", AccountId.forExternalId(account.getStudyId(), account.getExternalId())); } else if (message.matches("Duplicate entry.*for key 'Accounts-StudyId-Email-Index'")) { eae = createEntityAlreadyExistsException("Email address", AccountId.forEmail(account.getStudyId(), account.getEmail())); } else if (message.matches("Duplicate entry.*for key 'Accounts-StudyId-Phone-Index'")) { eae = createEntityAlreadyExistsException("Phone number", AccountId.forPhone(account.getStudyId(), account.getPhone())); } if (eae != null) { return eae; } } return new ConstraintViolationException.Builder() .withMessage("Accounts table constraint prevented save or update.").build(); } return exception; }
Source:
public void OnRestore() { importModel = (ImportVmModel) getWindow(); if (importModel.getProgress() != null) { return; } if (!importModel.Validate()) { return; } cloneVmMap = new HashMap<Guid, VM>(); vmsInSetupMap = new HashMap<Guid, VM>(); if (importModel.hasVmInSystem()) { for (VM vm : (ArrayList<VM>) importModel.getItems()) { if (importModel.isObjectInSetup(vm)) { vmsInSetupMap.put(vm.getId(), vm); } } } excuteImportClone(); }

Target:
public void OnRestore() { importModel = (ImportVmModel) getWindow(); if (importModel.getProgress() != null) { return; } if (!importModel.Validate()) { return; } cloneVmMap = new HashMap<Guid, VM>(); vmsInSetupMap = new HashMap<Guid, VM>(); for (VM vm : (ArrayList<VM>) importModel.getItems()) { if (importModel.isObjectInSetup(vm)) { vmsInSetupMap.put(vm.getId(), vm); } } executeImportClone(); }
Source:
public List<TaskDTO> findOpenTasksWithoutCorrectionForCurrentUser(String sort) throws DataException { LoginForm login = (LoginForm) Helper.getManagedBeanValue("#{LoginForm}"); if (login == null) { return new ArrayList<>(); } List<JSONObject> results = findByProcessingStatusUserAndPriority(TaskStatus.INWORK, login.getMyBenutzer().getId(), 10, sort); return convertJSONObjectsToDTOs(results, false); }

Target:
public List<TaskDTO> findOpenTasksWithoutCorrectionForCurrentUser(String sort) throws DataException { User user = Helper.getCurrentUser(); if (user == null) { return new ArrayList<>(); } List<JSONObject> results = findByProcessingStatusUserAndPriority(TaskStatus.INWORK, user.getId(), 10, sort); return convertJSONObjectsToDTOs(results, false); }
Source:
public void execute(Object message) throws Exception { for (final ActorRef call : calls) { final Leave leave = new Leave(); call.tell(leave, super.source); } conferenceApiClient = conferenceApiClient(); conferenceApiClient.tell(message, self()); }

Target:
public void execute(Object message) throws Exception { for (final ActorRef call : calls) { final Leave leave = new Leave(); call.tell(leave, super.source); } kickoutRemoteParticipants(); }
Source:
private static Object handleBootstrapSequencerResponse(ResponseMsg msg, ChannelHandlerContext ctx, IClientRouter r) { BootstrapSequencerResponseMsg responseMsg = msg.getPayload().getBootstrapSequencerResponse(); BootstrapSequencerResponseMsg.Type type = responseMsg.getRespType(); switch (type) { case ACK: return true; case NACK: return false; default: throw new UnsupportedOperationException("Response handler not provided"); } }

Target:
private static Object handleBootstrapSequencerResponse(ResponseMsg msg, ChannelHandlerContext ctx, IClientRouter r) { BootstrapSequencerResponseMsg responseMsg = msg.getPayload().getBootstrapSequencerResponse(); return responseMsg.getIsBootstrapped(); }
Source:
private void buildNewArrayInvocation(BlockBuilder blockBuilder, IdentifierGenerator idGenerator, NewArrayTree tree) { Expression.Variable newArray = variableWithId(idGenerator.newIdFor(tree)); blockBuilder.newObject(newArray, tree.symbolType().fullyQualifiedName(), location(tree)); idGenerator.varForExpression(tree, newArray.id()); List<ExpressionTree> initializers = tree.initializers(); if (!initializers.isEmpty() && isObject(initializers.get(0).symbolType())) { initializers.forEach(i -> { Expression argument = idGenerator.lookupExpressionFor(i); blockBuilder.assignTo(variableWithId(idGenerator.newId()), arraySet(newArray, argument), location(tree)); }); } }

Target:
private void buildNewArrayInvocation(BlockBuilder blockBuilder, IdentifierGenerator idGenerator, NewArrayTree tree) { if (tree.type() != null && !isObject(tree.type().symbolType())) { return; } Expression.Variable newArray = variableWithId(idGenerator.newIdFor(tree)); blockBuilder.newObject(newArray, tree.symbolType().fullyQualifiedName(), location(tree)); idGenerator.varForExpression(tree, newArray.id()); tree.initializers().stream().filter(i -> isObject(i.symbolType())).forEach(i -> { Expression argument = idGenerator.lookupExpressionFor(i); blockBuilder.assignTo(variableWithId(idGenerator.newId()), arraySet(newArray, argument), location(tree)); }); }
Source:
public CommandLineParser getCommandLineParser() { if (commandLineParser == null) { commandLineParser = useLegacyParser(getClass()) ? new LegacyCommandLineArgumentParser(this) : new CommandLineArgumentParser(this, Collections.EMPTY_LIST, new HashSet<>(Arrays.asList(CommandLineParserOptions.APPEND_TO_COLLECTIONS))); } return commandLineParser; }

Target:
public CommandLineParser getCommandLineParser() { if (commandLineParser == null) { commandLineParser = useLegacyParser(getClass()) ? new LegacyCommandLineArgumentParser(this) : new CommandLineArgumentParser(this, Collections.EMPTY_LIST, new HashSet<>(Collections.singleton(CommandLineParserOptions.APPEND_TO_COLLECTIONS))); } return commandLineParser; }
Source:
public static InferredAxiomGenerator<? extends OWLAxiom> getInferredAxiomGenerator( String axGenerator) throws Exception { switch (axGenerator.toLowerCase()) { case "subclass": case "": return new InferredSubClassAxiomGenerator(); case "disjointclasses": return new InferredDisjointClassesAxiomGenerator(); case "equivalentclass": return new InferredEquivalentClassAxiomGenerator(); case "datapropertycharacteristic": return new InferredDataPropertyCharacteristicAxiomGenerator(); case "equivalentdataproperty": return new InferredEquivalentDataPropertiesAxiomGenerator(); case "subdataproperty": return new InferredSubDataPropertyAxiomGenerator(); case "classassertion": return new InferredClassAssertionAxiomGenerator(); case "propertyassertion": return new InferredPropertyAssertionGenerator(); case "equivalentobjectproperty": return new InferredEquivalentObjectPropertyAxiomGenerator(); case "inverseobjectproperties": return new InferredInverseObjectPropertiesAxiomGenerator(); case "objectpropertycharacteristic": return new InferredObjectPropertyCharacteristicAxiomGenerator(); case "subobjectproperty": return new InferredSubObjectPropertyAxiomGenerator(); default: throw new Exception(String.format(axiomGeneratorError, axGenerator)); } }

Target:
public static InferredAxiomGenerator<? extends OWLAxiom> getInferredAxiomGenerator( String axGenerator) { switch (axGenerator.toLowerCase()) { case "subclass": case "": return new InferredSubClassAxiomGenerator(); case "disjointclasses": return new InferredDisjointClassesAxiomGenerator(); case "equivalentclass": return new InferredEquivalentClassAxiomGenerator(); case "datapropertycharacteristic": return new InferredDataPropertyCharacteristicAxiomGenerator(); case "equivalentdataproperties": return new InferredEquivalentDataPropertiesAxiomGenerator(); case "subdataproperty": return new InferredSubDataPropertyAxiomGenerator(); case "classassertion": return new InferredClassAssertionAxiomGenerator(); case "propertyassertion": return new InferredPropertyAssertionGenerator(); case "equivalentobjectproperty": return new InferredEquivalentObjectPropertyAxiomGenerator(); case "inverseobjectproperties": return new InferredInverseObjectPropertiesAxiomGenerator(); case "objectpropertycharacteristic": return new InferredObjectPropertyCharacteristicAxiomGenerator(); case "subobjectproperty": return new InferredSubObjectPropertyAxiomGenerator(); default: throw new IllegalArgumentException(String.format(axiomGeneratorError, axGenerator)); } }
Source:
private void createSearchMenu(Menu menuBar) { MenuItem item = new MenuItem(menuBar, SWT.CASCADE); item.setText(resAddressBook.getString("Search_menu_title")); Menu searchMenu = new Menu(shell, SWT.DROP_DOWN); item.setMenu(searchMenu); item = new MenuItem(searchMenu, SWT.NONE); item.setText(resAddressBook.getString("Find")); item.setAccelerator(SWT.MOD1 + 'F'); item.addSelectionListener(widgetSelectedAdapter( e -> { searchDialog.setMatchCase(false); searchDialog.setMatchWord(false); searchDialog.setSearchDown(true); searchDialog.setSearchString(""); searchDialog.setSelectedSearchArea(0); searchDialog.open(); })); item = new MenuItem(searchMenu, SWT.NONE); item.setText(resAddressBook.getString("Find_next")); item.setAccelerator(SWT.F3); item.addSelectionListener(widgetSelectedAdapter( e -> { searchDialog.open(); })); }

Target:
private void createSearchMenu(Menu menuBar) { MenuItem item = new MenuItem(menuBar, SWT.CASCADE); item.setText(resAddressBook.getString("Search_menu_title")); Menu searchMenu = new Menu(shell, SWT.DROP_DOWN); item.setMenu(searchMenu); item = new MenuItem(searchMenu, SWT.NONE); item.setText(resAddressBook.getString("Find")); item.setAccelerator(SWT.MOD1 + 'F'); item.addSelectionListener(widgetSelectedAdapter( e -> { searchDialog.setMatchCase(false); searchDialog.setMatchWord(false); searchDialog.setSearchDown(true); searchDialog.setSearchString(""); searchDialog.setSelectedSearchArea(0); searchDialog.open(); })); item = new MenuItem(searchMenu, SWT.NONE); item.setText(resAddressBook.getString("Find_next")); item.setAccelerator(SWT.F3); item.addSelectionListener(widgetSelectedAdapter( e -> searchDialog.open())); }
Source:
public void testSizeInExplicitTxWithNonExistent() throws SystemException, NotSupportedException { assertEquals(0, cache.size()); cache.put("k", "v"); TransactionManager tm1 = TestingUtil.getTransactionManager(cache); tm1.begin(); try { cache.get("no-exist"); assertEquals(1, cache.size()); cache.put("no-exist", "value"); assertEquals(2, cache.size()); } finally { tm1.rollback(); } }

Target:
public void testSizeInExplicitTxWithNonExistent() throws Exception { assertEquals(0, cache.size()); cache.put("k", "v"); TransactionManager tm = TestingUtil.getTransactionManager(cache); withTx(tm, () -> { assertNull(cache.get("no-exist")); assertEquals(1, cache.size()); assertNull(cache.put("no-exist", "value")); assertEquals(2, cache.size()); tm.setRollbackOnly(); return null; }); }
Source:
public void returnsNormallyWhenGivenNoMeasurementObjects() throws Exception { when(this.source.getXObjects(any(EntityReference.class))).thenReturn(null); NullPointerException exceptionWhenListIsNull = null; try { this.mocker.getComponentUnderTest().onEvent(event, source, data); } catch(NullPointerException e){ exceptionWhenListIsNull = e; } Assert.assertNull(exceptionWhenListIsNull); }

Target:
public void returnsNormallyWhenGivenNoMeasurementObjects() throws Exception { when(this.source.getXObjects(any(EntityReference.class))).thenReturn(null); this.mocker.getComponentUnderTest().onEvent(event, source, data); }
Source:
public WebDataHandler( Config config, IdentityManager identityManager, ObjectMapper objectMapper, Client client) { this.identityManager = identityManager; this.objectMapper = objectMapper; this.client = client; this.url = config.getString(Keys.FORWARD_URL); this.header = config.getString(Keys.FORWARD_HEADER); this.json = config.getBoolean(Keys.FORWARD_JSON); this.retryEnabled = config.getBoolean(Keys.FORWARD_RETRY_ENABLE); Integer retryDelayMin = config.getInteger(Keys.FORWARD_RETRY_DELAY_MIN, 1); this.retryDelayMin = (retryDelayMin > 0 && retryDelayMin < 3600) ? retryDelayMin : 1; Integer retryDelayMax = config.getInteger(Keys.FORWARD_RETRY_DELAY_MAX, 10); this.retryDelayMax = (retryDelayMax > retryDelayMin && retryDelayMax < 3600) ? retryDelayMax : retryDelayMin; Integer deliveryPendingLimit = config.getInteger(Keys.FORWARD_RETRY_PENDING_LIMIT, 100); this.deliveryPendingLimit = (retryDelayMax > 0) ? deliveryPendingLimit : 100; this.deliveryFaliuresInRow = new AtomicInteger(0); this.deliveryPendingCurrent = new AtomicInteger(0); }

Target:
public WebDataHandler( Config config, IdentityManager identityManager, ObjectMapper objectMapper, Client client) { this.identityManager = identityManager; this.objectMapper = objectMapper; this.client = client; this.url = config.getString(Keys.FORWARD_URL); this.header = config.getString(Keys.FORWARD_HEADER); this.json = config.getBoolean(Keys.FORWARD_JSON); this.retryEnabled = config.getBoolean(Keys.FORWARD_RETRY_ENABLE); this.retryDelay = config.getInteger(Keys.FORWARD_RETRY_DELAY, 100); this.retryCount = config.getInteger(Keys.FORWARD_RETRY_COUNT, 10); this.retryLimit = config.getInteger(Keys.FORWARD_RETRY_LIMIT, 100); this.deliveryPending = new AtomicInteger(0); }
Source:
public String toHaskell() { StringBuilder out = new StringBuilder(); if (this.expr.isPresent()) { out.append("\\"); for (FunctionArgument argument : this.arguments) { out.append(" ").append(argument.toHaskell()); } out.append(" = "); out.append(this.expr.get().toHaskell()); } return out.toString(); }

Target:
public String toHaskell() { StringBuilder out = new StringBuilder(); if (!this.arguments.isEmpty()) { out.append("\\"); for (FunctionArgument argument : this.arguments) { out.append(" ").append(argument.toHaskell()); } out.append(" -> "); out.append(this.expr.toHaskell()); } else { out.append(this.expr.toHaskell()); } return out.toString(); }
Source:
protected Node copyGraph(Node start) { Node copiedNode = new Node(); if (start instanceof Relation) copiedNode = new Relation(); copiedNode.setConcept(start.getConcept()); copiedNode.setId(start.getId()); copiedNode.setEventId(start.getEventId()); copiedNode.setType(start.getType()); copiedNode.setTerms(start.getTerms()); if (start instanceof Relation) { Node subject = ((Relation) start).getSubject(); Node predicate = ((Relation) start).getPredicate(); Node object = ((Relation) start).getObject(); ((Relation) copiedNode).setSubject(copyGraph(subject)); ((Relation) copiedNode).setPredicate(copyGraph(predicate)); ((Relation) copiedNode).setObject(copyGraph(object)); } else { copiedNode.setAlternativeIds(start.getAlternativeIds()); } return copiedNode; }

Target:
protected Node copyGraph(Node start) { Node copiedNode = new Node(); if (start instanceof Relation) copiedNode = new Relation(); copiedNode.setConcept(start.getConcept()); copiedNode.setId(start.getId()); copiedNode.setEventId(start.getEventId()); copiedNode.setType(start.getType()); copiedNode.setTerms(start.getTerms()); copiedNode.setAlternativeIds(start.getAlternativeIds()); if (start instanceof Relation) { Node subject = ((Relation) start).getSubject(); Node predicate = ((Relation) start).getPredicate(); Node object = ((Relation) start).getObject(); ((Relation) copiedNode).setSubject(copyGraph(subject)); ((Relation) copiedNode).setPredicate(copyGraph(predicate)); ((Relation) copiedNode).setObject(copyGraph(object)); } return copiedNode; }
Source:
public void broadcastState() { Runtime.broadcastStates(); }

Target:
public void broadcastState() { topStom.broadcastState(); midStom.broadcastState(); lowStom.broadcastState(); }
Source:
public String toString() { return "KeepaliveInfo [" + " network=" + mNai.network + " startedState=" + startedStateString(mStartedState) + " " + IpUtils.addressAndPortToString(mPacket.srcAddress, mPacket.srcPort) + "->" + IpUtils.addressAndPortToString(mPacket.dstAddress, mPacket.dstPort) + " interval=" + mInterval + " packetData=" + HexDump.toHexString(mPacket.getPacket()) + " uid=" + mUid + " pid=" + mPid + " ]"; }

Target:
public String toString() { return "KeepaliveInfo [" + " network=" + mNai.network + " startedState=" + startedStateString(mStartedState) + " " + IpUtils.addressAndPortToString(mPacket.srcAddress, mPacket.srcPort) + "->" + IpUtils.addressAndPortToString(mPacket.dstAddress, mPacket.dstPort) + " interval=" + mInterval + " uid=" + mUid + " pid=" + mPid + " packetData=" + HexDump.toHexString(mPacket.getPacket()) + " ]"; }