auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ListResponse listTags(final ListRequest request) throws ApiException { InfoResponse info = info(DtoFactory.getInstance() .createDto(InfoRequest.class) .withProjectPath(request.getProjectPath()) .withTarget(".") .withPassword(request.getPassword()) .withUsername(request.getUsername())); final List<String> args = defaultArgs(); args.add("list"); String repositoryRoot = getRepositoryRoot(info.getOutput()); String projectRelativeUrl = getRelativeUrl(info.getOutput()); String projectUri = recognizeProjectUri(repositoryRoot, projectRelativeUrl); String branchesPath = projectUri == null ? "^/tags" : (projectUri + "/tags"); final CommandLineResult result = runCommand(null, args, new File(request.getProjectPath()), singletonList(branchesPath), request.getUsername(), request.getPassword()); return DtoFactory.getInstance().createDto(ListResponse.class) .withCommand(result.getCommandLine().toString()) .withOutput(result.getStdout() .stream() .filter(s -> s.endsWith("/")) .map(s -> s.substring(0, s.length() - 1)) .collect(Collectors.toList())) .withErrorOutput(result.getStderr()); }

Target:
public ListResponse listTags(final ListRequest request) throws ApiException { InfoResponse info = info(newDto(InfoRequest.class).withProjectPath(request.getProjectPath()) .withTarget(".") .withPassword(request.getPassword()) .withUsername(request.getUsername())); final List<String> args = defaultArgs(); args.add("list"); String repositoryRoot = getRepositoryRoot(info.getOutput()); String projectRelativeUrl = getRelativeUrl(info.getOutput()); String projectUri = recognizeProjectUri(repositoryRoot, projectRelativeUrl); String branchesPath = projectUri == null ? "^/tags" : (projectUri + "/tags"); final CommandLineResult result = runCommand(null, args, new File(request.getProjectPath()), singletonList(branchesPath), request.getUsername(), request.getPassword()); return newDto(ListResponse.class).withCommand(result.getCommandLine().toString()) .withOutput(result.getStdout() .stream() .filter(s -> s.endsWith("/")) .map(s -> s.substring(0, s.length() - 1)) .collect(Collectors.toList())) .withErrorOutput(result.getStderr()); }
Source:
public SparkRemoteSourceOperatorFactory(int operatorId, PlanNodeId planNodeId, Iterator<PrestoSparkRow> iterator, List<Type> types) { this.operatorId = operatorId; this.planNodeId = requireNonNull(planNodeId, "planNodeId is null"); this.iterator = requireNonNull(iterator, "iterator is null"); this.types = ImmutableList.copyOf(requireNonNull(types, "serde is null")); }

Target:
public SparkRemoteSourceOperatorFactory(int operatorId, PlanNodeId planNodeId, Iterator<PrestoSparkRow> iterator, List<Type> types) { this.operatorId = operatorId; this.planNodeId = requireNonNull(planNodeId, "planNodeId is null"); this.iterator = requireNonNull(iterator, "iterator is null"); this.types = ImmutableList.copyOf(requireNonNull(types, "types is null")); }
Source:
public void combineIngredients(State state, Domain domain, IngredientRecipe recipe, ObjectInstance container, String toswap) { Set<String> traits = new HashSet<String>(recipe.getTraits()); Set<String> ings = ContainerFactory.getContentNames(container); ObjectInstance new_ing = IngredientFactory.getNewComplexIngredientObjectInstance( domain.getObjectClass(IngredientFactory.ClassNameComplex), toswap, Recipe.NO_ATTRIBUTES, true, "",new TreeSet<String>(), new TreeSet<String>(), traits, ings); Set<ObjectInstance> hidden_copies = new HashSet<ObjectInstance>(); for (String name : ings) { ObjectInstance ob = state.getObject(name); hidden_copies.add(IngredientFactory.makeHiddenObjectCopy(state, domain, ob)); } ContainerFactory.removeContents(container); for (String name : ings) { state.removeObject(state.getObject(name)); } for (ObjectInstance ob : hidden_copies) { state.addObject(ob); } ContainerFactory.addIngredient(container, toswap); IngredientFactory.changeIngredientContainer(new_ing, container.getName()); ObjectInstance receivingSpace = state.getObject(ContainerFactory.getSpaceName(container)); if (SpaceFactory.isBaking(receivingSpace) && SpaceFactory.getOnOff(receivingSpace)) { IngredientFactory.bakeIngredient(new_ing); } else if (SpaceFactory.isHeating(receivingSpace) && SpaceFactory.getOnOff(receivingSpace)) { IngredientFactory.heatIngredient(new_ing); } state.addObject(new_ing); }

Target:
public void combineIngredients(State state, Domain domain, IngredientRecipe recipe, ObjectInstance container, String toswap) { Set<String> traits = new HashSet<String>(recipe.getTraits()); Set<String> ings = ContainerFactory.getContentNames(container); ObjectInstance newIng = IngredientFactory.getNewComplexIngredientObjectInstance( domain.getObjectClass(IngredientFactory.ClassNameComplex), toswap, Recipe.NO_ATTRIBUTES, true, "",new TreeSet<String>(), new TreeSet<String>(), traits, ings); Set<ObjectInstance> hiddenCopies = new HashSet<ObjectInstance>(); for (String name : ings) { ObjectInstance ob = state.getObject(name); hiddenCopies.add(IngredientFactory.makeHiddenObjectCopy(state, domain, ob)); } ContainerFactory.removeContents(container); for (String name : ings) { state.removeObject(state.getObject(name)); } for (ObjectInstance ob : hiddenCopies) { state.addObject(ob); } ContainerFactory.addIngredient(container, toswap); IngredientFactory.changeIngredientContainer(newIng, container.getName()); ObjectInstance receivingSpace = state.getObject(ContainerFactory.getSpaceName(container)); if (SpaceFactory.isBaking(receivingSpace) && SpaceFactory.getOnOff(receivingSpace)) { IngredientFactory.bakeIngredient(newIng); } else if (SpaceFactory.isHeating(receivingSpace) && SpaceFactory.getOnOff(receivingSpace)) { IngredientFactory.heatIngredient(newIng); } state.addObject(newIng); }
Source:
private static Map<Locale, Set<String>> emailsByLocale(Set<PersistentGroup> groups, Predicate<String> emailValidator) { Map<Locale, Set<String>> emails = new HashMap<Locale, Set<String>>(); Locale defLocale = I18N.getLocale(); for (PersistentGroup group : groups) { for (User u : group.getMembers()) { UserProfile profile = u.getProfile(); Locale l = profile.getPreferredLocale(); if (l == null) { l = defLocale; } String email = profile.getEmail(); if (emailValidator.test(email)) { Set<String> localeEmails = emails.get(l); if (localeEmails == null) { localeEmails = new HashSet<>(); emails.put(l, localeEmails); } localeEmails.add(email); } } } return emails; }

Target:
private static Map<Locale, Set<String>> emailsByLocale(Set<PersistentGroup> groups, Predicate<String> emailValidator) { Map<Locale, Set<String>> emails = new HashMap<Locale, Set<String>>(); Locale defLocale = Locale.getDefault(); for (PersistentGroup group : groups) { for (User u : group.getMembers()) { UserProfile profile = u.getProfile(); Locale l = profile.getPreferredLocale(); if (l == null) { l = defLocale; } String email = profile.getEmail(); if (emailValidator.test(email)) { emails.computeIfAbsent(l, k -> new HashSet<>()).add(email); } } } return emails; }
Source:
protected static final BenchmarksService createClient() { return AtlasDbFeignTargetFactory.createProxyWithFailover( Optional.empty(), ImmutableSet.of(BENCHMARK_SERVER), 10_000, 1_000_000, 1_000, BenchmarksService.class, "benchmarks"); }

Target:
protected static final BenchmarksService createClient() { return AtlasDbFeignTargetFactory.createProxyWithFailover( Optional.empty(), Optional.empty(), ImmutableSet.of(BENCHMARK_SERVER), 10_000, 1_000_000, 1_000, BenchmarksService.class, "benchmarks"); }
Source:
private void deactivateThroughClient() throws Exception { GridClientConfiguration clientCfg = new GridClientConfiguration(); clientCfg.setServers(Collections.singletonList("127.0.0.1:11211")); try (GridClient client = GridClientFactory.start(clientCfg)) { GridClientClusterState state = client.state(); log.info(">>> Try to deactivate ..."); state.state(ClusterState.INACTIVE, true); } }

Target:
private void deactivateThroughClient() throws Exception { GridClientConfiguration clientCfg = new GridClientConfiguration(); clientCfg.setServers(Collections.singletonList("127.0.0.1:11211")); try (GridClient client = GridClientFactory.start(clientCfg)) { GridClientClusterState state = client.state(); log.info(">>> Try to deactivate ..."); state.state(INACTIVE, true); } }
Source:
private RestResponse addCounter(RestRequest request) { try { String counterName = request.variables().get("counterName"); NettyRestResponse.Builder responseBuilder = new NettyRestResponse.Builder(); CounterConfiguration configuration = counterManager.getConfiguration(counterName); if (configuration == null) { return responseBuilder.status(HttpResponseStatus.NOT_FOUND.code()).entity("Counter not found").build(); } else { ContentSource contents = request.contents(); long delta; if (contents == null) { delta = 1; } else { String s = contents.asString(); delta = Long.parseLong(s); } switch (configuration.type()) { case WEAK: counterManager.getWeakCounter(counterName).add(delta); break; case BOUNDED_STRONG: case UNBOUNDED_STRONG: long value = counterManager.getStrongCounter(counterName).addAndGet(delta).get(1, TimeUnit.MINUTES); responseBuilder.entity(Long.toString(value)); break; } return responseBuilder.header(HttpHeaderNames.CACHE_CONTROL.toString(), CacheControl.noCache()).build(); } } catch (Exception e) { throw new RestResponseException(e); } }

Target:
private RestResponse addCounter(RestRequest request) { try { String counterName = request.variables().get("counterName"); NettyRestResponse.Builder responseBuilder = new NettyRestResponse.Builder(); CounterConfiguration configuration = counterManager.getConfiguration(counterName); if (configuration == null) { return responseBuilder.status(HttpResponseStatus.NOT_FOUND.code()).entity("Counter not found").build(); } else { ContentSource contents = request.contents(); long delta; if (contents == null) { delta = 1; } else { String s = contents.asString(); delta = Long.parseLong(s); } switch (configuration.type()) { case WEAK: counterManager.getWeakCounter(counterName).add(delta).get(1, TimeUnit.MINUTES); break; case BOUNDED_STRONG: case UNBOUNDED_STRONG: long value = counterManager.getStrongCounter(counterName).addAndGet(delta).get(1, TimeUnit.MINUTES); responseBuilder.entity(Long.toString(value)); break; } return responseBuilder.header(HttpHeaderNames.CACHE_CONTROL.toString(), CacheControl.noCache()).build(); } } catch (Exception e) { throw new RestResponseException(e); } }
Source:
public void setDynamicMdcFieldType(String fieldPattern, String type) { final Pattern pattern = Pattern.compile(fieldPattern); dynamicMdcFieldTypes.put(pattern, type); }

Target:
public void setDynamicMdcFieldType(String fieldPattern, String type) { Pattern pattern = Pattern.compile(fieldPattern); setDynamicMdcFieldType(pattern, type); }
Source:
public SubscriberIterator() { this.notifications = new LinkedBlockingQueue<Notification<? extends T>>(); this.buf = null; }

Target:
public SubscriberIterator() { this.notifications = new LinkedBlockingQueue<Notification<? extends T>>(); }
Source:
protected void verify_internal_effects() { verify(strings).assertDoesNotContainIgnoringCase(getInfo(assertions), getActual(assertions), Arrays.array("od", "do")); }

Target:
protected void verify_internal_effects() { verify(strings).assertDoesNotContainIgnoringCase(getInfo(assertions), getActual(assertions), array("od", "do")); }
Source:
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)); final String name = address.getLastElement().getValue(); final ModelNode bufferSizeModel = BUFFER_SIZE.resolveModelAttribute(context, model); final ModelNode bufferPerSliceModel = BUFFER_PER_SLICE.resolveModelAttribute(context, model); final ModelNode directModel = DIRECT_BUFFERS.resolveModelAttribute(context, model); final int bufferSize = bufferSizeModel.isDefined() ? bufferSizeModel.asInt() : defaultBufferSize; final int bufferPerSlice = bufferPerSliceModel.isDefined() ? bufferPerSliceModel.asInt() : defaultBuffersPerRegion; final boolean direct = directModel.isDefined() ? directModel.asBoolean() : defaultDirectBuffers; final BufferPoolService service = new BufferPoolService(bufferSize, bufferPerSlice, direct); context.getCapabilityServiceTarget().addCapability(IO_POOL_RUNTIME_CAPABILITY, service) .setInitialMode(ServiceController.Mode.ACTIVE) .install(); ByteBufferPoolService poolService = new ByteBufferPoolService(); context.getCapabilityServiceTarget().addCapability(IO_BYTE_BUFFER_POOL_RUNTIME_CAPABILITY, poolService) .addCapabilityRequirement(IO_POOL_RUNTIME_CAPABILITY.getDynamicName(address), Pool.class, poolService.bufferPool) .setInitialMode(ServiceController.Mode.ACTIVE) .install(); }

Target:
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)); final String name = address.getLastElement().getValue(); final ModelNode bufferSizeModel = BUFFER_SIZE.resolveModelAttribute(context, model); final ModelNode bufferPerSliceModel = BUFFER_PER_SLICE.resolveModelAttribute(context, model); final ModelNode directModel = DIRECT_BUFFERS.resolveModelAttribute(context, model); final int bufferSize = bufferSizeModel.isDefined() ? bufferSizeModel.asInt() : defaultBufferSize; final int bufferPerSlice = bufferPerSliceModel.isDefined() ? bufferPerSliceModel.asInt() : defaultBuffersPerRegion; final boolean direct = directModel.isDefined() ? directModel.asBoolean() : defaultDirectBuffers; final BufferPoolService service = new BufferPoolService(bufferSize, bufferPerSlice, direct); context.getCapabilityServiceTarget().addCapability(IO_POOL_RUNTIME_CAPABILITY, service) .setInitialMode(ServiceController.Mode.ON_DEMAND) .install(); ByteBufferPoolService poolService = new ByteBufferPoolService(); context.getCapabilityServiceTarget().addCapability(IO_BYTE_BUFFER_POOL_RUNTIME_CAPABILITY, poolService) .addCapabilityRequirement(IO_POOL_RUNTIME_CAPABILITY.getDynamicName(address), Pool.class, poolService.bufferPool) .setInitialMode(ServiceController.Mode.ON_DEMAND) .install(); }
Source:
public String getListTransactions(int limit) throws Exception { String region = SPLICE_PREFIX + HBaseConfiguration.TRANSACTION_TABLE; Utils.Tabular tabular = new Utils.Tabular(Utils.Tabular.SortHint.AsInteger, TBL_TXN_COL0, TBL_TXN_COL1, TBL_TXN_COL2, TBL_TXN_COL3, TBL_TXN_COL4, TBL_TXN_COL5, TBL_TXN_COL6, TBL_TXN_COL7, TBL_TXN_COL8, TBL_TXN_COL9); TxnTableRowPrinter rowVisitor = new TxnTableRowPrinter(); int scanLimit = limit == 0 ? 0 : limit+1, count = 0; ConnectionWrapper c = getCachedConnection().withRegion(region); try(final ResultScanner rs = c.scanVersions(scanLimit, 0 ) ) { for (Result row : rs) { if( count++ == limit ) { break; } List<String> rowString = rowVisitor.processRow(row); tabular.addRow(rowString.toArray(new String[0])); } } String result = Utils.printTabularResults(tabular); if(count > limit) result = result + Utils.limitString(limit); return result; }

Target:
public String getListTransactions(int limit) throws Exception { String region = SPLICE_PREFIX + HBaseConfiguration.TRANSACTION_TABLE; Utils.Tabular tabular = new Utils.Tabular(Utils.Tabular.SortHint.AsInteger, TBL_TXN_COL0, TBL_TXN_COL1, TBL_TXN_COL2, TBL_TXN_COL3, TBL_TXN_COL4, TBL_TXN_COL5, TBL_TXN_COL6, TBL_TXN_COL7, TBL_TXN_COL8, TBL_TXN_COL9); TxnTableRowPrinter rowVisitor = new TxnTableRowPrinter(); int scanLimit = limit == 0 ? 0 : limit+1; int count = 0; ConnectionWrapper c = getCachedConnection().withRegion(region); try(final ResultScanner rs = c.scanVersions(scanLimit, 0 ) ) { for (Result row : rs) { if( count++ == limit ) { break; } List<String> rowString = rowVisitor.processRow(row); tabular.addRow(rowString.toArray(new String[0])); } } String result = Utils.printTabularResults(tabular); if(count > limit) result = result + Utils.limitString(limit); return result; }
Source:
private Callable<Trace> thatSetsTraceInCurrentThreadLocalWithInitialTrace() { return new Callable<Trace>() { @Override public Trace call() throws Exception { TraceContextHolder.setCurrentTrace(Mockito.mock(Trace.class)); return TraceContextHolder.getCurrentTrace(); } }; }

Target:
private Callable<Trace> thatSetsTraceInCurrentThreadLocalWithInitialTrace() { return new Callable<Trace>() { @Override public Trace call() throws Exception { return TraceContextHolder.getCurrentTrace(); } }; }
Source:
private Mono<CosmosConflictResponse> readInternal(RequestOptions options, Context context) { String spanName = "readConflict." + getId(); Mono<CosmosConflictResponse> responseMono = this.readInternal(options); return this.container.getDatabase().getClient().getTracerProvider().traceEnabledCosmosResponsePublisher(responseMono, context, spanName, this.container.getDatabase().getId(), this.container.getDatabase().getClient().getServiceEndpoint()); }

Target:
private Mono<CosmosConflictResponse> readInternal(RequestOptions options, Context context) { String spanName = "readConflict." + getId(); Mono<CosmosConflictResponse> responseMono = this.container.getDatabase().getDocClientWrapper().readConflict(getLink(), options) .map(response -> ModelBridgeInternal.createCosmosConflictResponse(response)).single(); return this.container.getDatabase().getClient().getTracerProvider().traceEnabledCosmosResponsePublisher(responseMono, context, spanName, this.container.getDatabase().getId(), this.container.getDatabase().getClient().getServiceEndpoint()); }
Source:
static Result emptyResult() { DeliveryErrors noErrors = DeliveryErrors.newBuilder() .build(); return new Result(0, noErrors); }

Target:
static Result emptyResult() { return EMPTY_RESULT; }
Source:
public ArrayList<Class<? extends Player>> getProfiles() { PMS r = PMS.get(); PMS r1 = PMS.get(); PMS r2 = PMS.get(); if (PMS.getConfiguration().getEnginesAsList(r.getRegistry()) == null || PMS.getConfiguration().getEnginesAsList(r1.getRegistry()).isEmpty() || PMS.getConfiguration().getEnginesAsList(r2.getRegistry()).contains("none")) { return null; } ArrayList<Class<? extends Player>> a = new ArrayList<Class<? extends Player>>(); PMS r3 = PMS.get(); for (String engine : PMS.getConfiguration().getEnginesAsList(r3.getRegistry())) { if(engine.equals(VLCVideo.ID)) a.add(VLCVideo.class); else if (engine.equals(MEncoderVideo.ID)) { a.add(MEncoderVideo.class); } else if (engine.equals(MEncoderAviSynth.ID) && PMS.get().getRegistry().isAvis()) { a.add(MEncoderAviSynth.class); } else if (engine.equals(FFMpegVideo.ID)) { a.add(FFMpegVideo.class); } else if (engine.equals(FFMpegAviSynthVideo.ID) && PMS.get().getRegistry().isAvis()) { a.add(FFMpegAviSynthVideo.class); } else if (engine.equals(TSMuxerVideo.ID) ) { a.add(TSMuxerVideo.class); } } return a; }

Target:
public ArrayList<Class<? extends Player>> getProfiles() { PMS r = PMS.get(); PMS r1 = PMS.get(); PMS r2 = PMS.get(); if (PMS.getConfiguration().getEnginesAsList(r.getRegistry()) == null || PMS.getConfiguration().getEnginesAsList(r1.getRegistry()).isEmpty() || PMS.getConfiguration().getEnginesAsList(r2.getRegistry()).contains("none")) { return null; } ArrayList<Class<? extends Player>> a = new ArrayList<Class<? extends Player>>(); PMS r3 = PMS.get(); for (String engine : PMS.getConfiguration().getEnginesAsList(r3.getRegistry())) { if (engine.equals(VLCVideo.ID)) { a.add(VLCVideo.class); } else if (engine.equals(MEncoderVideo.ID)) { a.add(MEncoderVideo.class); } else if (engine.equals(MEncoderAviSynth.ID) && PMS.get().getRegistry().isAvis()) { a.add(MEncoderAviSynth.class); } else if (engine.equals(FFMpegVideo.ID)) { a.add(FFMpegVideo.class); } else if (engine.equals(FFMpegAviSynthVideo.ID) && PMS.get().getRegistry().isAvis()) { a.add(FFMpegAviSynthVideo.class); } else if (engine.equals(TSMuxerVideo.ID) ) { a.add(TSMuxerVideo.class); } } return a; }
Source:
public MysqlConnector(Properties config) throws DatastreamException { _defaultUserName = config.getProperty(CFG_MYSQL_USERNAME); _defaultPassword = config.getProperty(CFG_MYSQL_PASSWORD); String strServerId = config.getProperty(CFG_MYSQL_SERVER_ID); _sourceType = SourceType.valueOf(config.getProperty(CFG_MYSQL_SOURCE_TYPE, DEFAULT_MYSQL_SOURCE_TYPE)); if (strServerId == null) { throw new DatastreamException("Missing serverId property."); } if (_sourceType == SourceType.MYSQLSERVER && (_defaultUserName == null || _defaultPassword == null)) { throw new DatastreamException("Missing mysql username or password."); } _defaultServerId = Integer.valueOf(strServerId); _mysqlProducers = new ConcurrentHashMap<>(); _numDatastreamTasks = () -> _numTasks; }

Target:
public MysqlConnector(Properties config) throws DatastreamException { _defaultUserName = config.getProperty(CFG_MYSQL_USERNAME); _defaultPassword = config.getProperty(CFG_MYSQL_PASSWORD); String strServerId = config.getProperty(CFG_MYSQL_SERVER_ID); _sourceType = SourceType.valueOf(config.getProperty(CFG_MYSQL_SOURCE_TYPE, DEFAULT_MYSQL_SOURCE_TYPE)); if (strServerId == null) { throw new DatastreamRuntimeException("Missing serverId property."); } if (_sourceType == SourceType.MYSQLSERVER && (_defaultUserName == null || _defaultPassword == null)) { throw new DatastreamRuntimeException("Missing mysql username or password."); } _defaultServerId = Integer.valueOf(strServerId); _mysqlProducers = new ConcurrentHashMap<>(); _numDatastreamTasks = () -> _numTasks; }
Source:
public static ExceptionThrowingSubTest expectThrowable(Runnable runnable) { return expectException( runnable.toString(), runnable ); }

Target:
public static ExceptionThrowingSubTest expectThrowable(Runnable runnable) { return expectThrowable( runnable.toString(), runnable ); }
Source:
public boolean isInstanceOf(Object o) { if ( o == null || !(o instanceof Map) ) { return false; } Map<?, ?> instance = (Map<?, ?>) o; for ( Entry<String, Type> f : fields.entrySet() ) { Object instanceValueForKey = instance.get(f.getKey()); if ( instance.get(f.getKey()) == null || !f.getValue().isInstanceOf(instanceValueForKey) ) { return false; } } return true; }

Target:
public boolean isInstanceOf(Object o) { if ( o == null || !(o instanceof Map) ) { return false; } Map<?, ?> instance = (Map<?, ?>) o; for ( Entry<String, Type> f : fields.entrySet() ) { if ( !instance.containsKey(f.getKey()) ) { return false; } Object instanceValueForKey = instance.get(f.getKey()); if ( instanceValueForKey != null && !f.getValue().isInstanceOf(instanceValueForKey) ) { return false; } } return true; }
Source:
public ElasticsearchColumn( @JsonProperty("name") String name, @JsonProperty("type") Type type, @JsonProperty("jsonPath") String jsonPath, @JsonProperty("jsonType") String jsonType, @JsonProperty("isList") boolean isList, @JsonProperty("ordinalPosition") int ordinalPosition) { checkArgument(!isNullOrEmpty(name), "name is null or is empty"); this.name = name; this.type = requireNonNull(type, "type is null"); this.jsonPath = requireNonNull(jsonPath, "jsonPath is null"); this.jsonType = requireNonNull(jsonType, "jsonType is null"); this.isList = isList; this.ordinalPosition = ordinalPosition; }

Target:
public ElasticsearchColumn( @JsonProperty("name") String name, @JsonProperty("type") Type type, @JsonProperty("jsonPath") String jsonPath, @JsonProperty("jsonType") String jsonType, @JsonProperty("isList") boolean isList, @JsonProperty("ordinalPosition") int ordinalPosition) { checkArgument(!isNullOrEmpty(name), "name is null or empty"); this.name = name; this.type = requireNonNull(type, "type is null"); this.jsonPath = requireNonNull(jsonPath, "jsonPath is null"); this.jsonType = requireNonNull(jsonType, "jsonType is null"); this.isList = isList; this.ordinalPosition = ordinalPosition; }
Source:
private void enqueueThrownExceptionalPaths(Symbol symbol) { if (symbol.isMethodSymbol()) { ProgramState ps = programState.clearStack(); ((Symbol.MethodSymbol) symbol).thrownTypes().stream() .map(constraintManager::createExceptionalSymbolicValue) .forEach(exceptionSV -> enqueueExceptionalPaths(ps, exceptionSV)); } }

Target:
private void enqueueThrownExceptionalPaths(Symbol symbol) { if (!symbol.isMethodSymbol()) { return; } ProgramState ps = programState.clearStack(); ((Symbol.MethodSymbol) symbol).thrownTypes().stream() .map(constraintManager::createExceptionalSymbolicValue) .forEach(exceptionSV -> enqueueExceptionalPaths(ps, exceptionSV)); }
Source:
public int read() throws IOException { if (++count < maxcount) { if (count % ((maxcount / 2) / maxlines) == 0) { return '\n'; } else { return letters.charAt((int) (Math.random() % letters.length())); } } return -1; }

Target:
public int read() throws IOException { int ret; if (charCount < maxCharCount) { if (charCount > 0 && lines < maxLines - 1 && charCount == lineBreaks[lines]) { ret = '\n'; lines++; } else { ret = letters.charAt(ThreadLocalRandom.current().nextInt(0, letters.length())); } result += String.format("%c", ret); charCount++; return ret; } return -1; }
Source:
public List<TaskSummary> findTasksAssignedAsPotentialOwner(String userId, String filter, List<String> status, Integer page, Integer pageSize) { TaskSummaryList taskSummaryList = null; if( config.isRest() ) { Map<String, Object> valuesMap = new HashMap<String, Object>(); String userQuery = getUserQueryStr(userId); String statusQuery = getAdditionalParams(userQuery, "status", status); String queryString = getPagingQueryString(statusQuery, page, pageSize)+"&filter="+filter; taskSummaryList = makeHttpGetRequestAndCreateCustomResponse( build(loadBalancer.getUrl(), QUERY_URI + "/" + TASKS_ASSIGN_POT_OWNERS_GET_URI, valuesMap) + queryString , TaskSummaryList.class); } else { CommandScript script = new CommandScript( Collections.singletonList( (KieServerCommand) new DescriptorCommand( "QueryService", "getTasksAssignedAsPotentialOwner", new Object[]{status, new ArrayList(), userId, page, pageSize, "", true, filter}) ) ); ServiceResponse<TaskSummaryList> response = (ServiceResponse<TaskSummaryList>) executeJmsCommand( script, DescriptorCommand.class.getName(), "BPM" ).getResponses().get(0); throwExceptionOnFailure(response); if (shouldReturnWithNullResponse(response)) { return null; } taskSummaryList = response.getResult(); } if (taskSummaryList != null && taskSummaryList.getTasks() != null) { return Arrays.asList(taskSummaryList.getTasks()); } return Collections.emptyList(); }

Target:
public List<TaskSummary> findTasksAssignedAsPotentialOwner(String userId, String filter, List<String> status, Integer page, Integer pageSize) { return findTasksAssignedAsPotentialOwner(userId, filter, status, page, pageSize, "", true); }
Source:
private String getParentArticleDoiFromComment(Map<String, Object> comment) { return (String) ((Map<String, Object>) ((Map<String, Object>) comment.get("parentArticle")).get("doi")).get("doiName"); }

Target:
private static String getParentArticleDoiFromComment(Map<String, Object> comment) { return (String) (((Map<String, Object>) comment.get("parentArticle")).get("doi")); }
Source:
private void closeJMSResources() { if (clientCaching) { sessionPool.clear(); connections.forEach(connection -> { try { connection.getConnection().close(); } catch (JMSException e) { logger.error("Error closing the connection" + e); } }); connections.clear(); } }

Target:
public void closeJMSResources() throws JMSConnectorException { if (clientCaching) { sessionPool.clear(); sessionPool.close(); for (int i = 0; i < connections.size(); i++) { try { closeConnection(connections.get(i).getConnection()); } catch (JMSException e) { throw new JMSConnectorException("Error closing the connection.", e); } } } }
Source:
protected String getUnitTestFileName(String className) { String fileName = getUnitTestClassName(className); fileName = fileName.replace('.', File.separator.charAt(0)); fileName = fileName + ".js"; return fileName; }

Target:
protected String getUnitTestFileName(String className) { String fileName = getUnitTestClassName(className); fileName = fileName.replace('.', File.separatorChar); fileName = fileName + ".js"; return fileName; }
Source:
protected Map<String, Pair<String, String>> getSharedLocks() { final Map<String, Pair<String, String>> result = new HashMap<>(super.getSharedLocks()); result.put(getVmId().toString(), LockMessagesMatchUtil.makeLockingPair( LockingGroup.VM, new LockMessage(EngineMessage.ACTION_TYPE_FAILED_CLUSTER_IS_BEING_UPDATED) .with("vmName", getVmName()))); return result; }

Target:
protected Map<String, Pair<String, String>> getSharedLocks() { final Map<String, Pair<String, String>> result = new HashMap<>(super.getSharedLocks()); result.put(getVmId().toString(), LockMessagesMatchUtil.makeLockingPair( LockingGroup.VM, new LockMessage(EngineMessage.ACTION_TYPE_FAILED_MEMORY_DEVICE_IS_BEING_HOT_UNPLUGGED) .with("vmName", getVmName()))); return result; }
Source:
private void sendEmailReportingTheException(Exception exp) { StringBuffer bodyMsg = new StringBuffer(); bodyMsg.append("Background Polling has some Exceptions due to "+exp.getMessage()); bodyMsg.append(Utils.CONSTANT_LINE_FEED); StringWriter errors = new StringWriter(); exp.printStackTrace(new PrintWriter(errors)); bodyMsg.append(errors.toString()); M_log.debug(bodyMsg.toString()); Properties properties = getMailProperties(); Session session = Session.getInstance(properties); MimeMessage message = new MimeMessage(session); try { String ccmSupportAddress = appExtPropertiesFile.getProperty(Utils.SIS_REPORT_CCM_SUPPORT_ADDRESS); String fromAddress = appExtPropertiesFile.getProperty(Utils.FRIEND_CONTACT_EMAIL); message.addRecipient(Message.RecipientType.TO, new InternetAddress(ccmSupportAddress)); message.setFrom(new InternetAddress(fromAddress)); message.setSubject("Polling Thread Exceptions"); Multipart multipart = new MimeMultipart(); BodyPart body = new MimeBodyPart(); body.setText(bodyMsg.toString()); multipart.addBodyPart(body); message.setContent(multipart); Transport.send(message); } catch (MessagingException e) { M_log.error("Email failed due to " + e.getMessage()); } catch (Exception e) { M_log.error("Email failed due to " + e.getMessage()); } }

Target:
private void sendEmailReportingTheException(Exception exp) { StringBuffer bodyMsg = new StringBuffer(); bodyMsg.append("Background Polling has some Exceptions due to "+exp.getMessage()); bodyMsg.append(Utils.CONSTANT_LINE_FEED); StringWriter errors = new StringWriter(); exp.printStackTrace(new PrintWriter(errors)); bodyMsg.append(errors.toString()); M_log.debug(bodyMsg.toString()); Properties properties = getMailProperties(); Session session = Session.getInstance(properties); MimeMessage message = new MimeMessage(session); try { String ccmSupportAddress = appExtPropertiesFile.getProperty(Utils.SIS_REPORT_CCM_SUPPORT_ADDRESS); String fromAddress = appExtPropertiesFile.getProperty(Utils.FRIEND_CONTACT_EMAIL); message.addRecipient(Message.RecipientType.TO, new InternetAddress(ccmSupportAddress)); message.setFrom(new InternetAddress(fromAddress)); message.setSubject("Canvas Course Manage: Polling Thread Exceptions"); Multipart multipart = new MimeMultipart(); BodyPart body = new MimeBodyPart(); body.setText(bodyMsg.toString()); multipart.addBodyPart(body); message.setContent(multipart); Transport.send(message); } catch (MessagingException e) { M_log.error("Email failed due to " + e.getMessage()); } catch (Exception e) { M_log.error("Email failed due to " + e.getMessage()); } }
Source:
private static byte[] serialize(Metadata metadata) { try { return new ObjectMapper().writeValueAsBytes(metadata); } catch (IOException e) { throw new RuntimeException(e); } }

Target:
private static byte[] serialize(Metadata metadata) { try { return MAPPER.writeValueAsBytes(metadata); } catch (IOException e) { throw new RuntimeException(e); } }
Source:
public OafBodyWithOrderedUpdates(List<QualifiedOafJsonRecord> infoSpaceRecords) { Preconditions.checkNotNull(infoSpaceRecords); SortedMap<String, String> updatesOrderedByQualifier = null; for (QualifiedOafJsonRecord record : infoSpaceRecords) { if (BODY_QUALIFIER_NAME.equals(record.getQualifier().toString())) { this.body = record.getOafJson().toString(); } else { if (updatesOrderedByQualifier==null) { updatesOrderedByQualifier = Maps.newTreeMap(); } updatesOrderedByQualifier.put(record.getQualifier().toString(), record.getOafJson().toString()); } } this.orderedUpdates = updatesOrderedByQualifier!=null?updatesOrderedByQualifier.values():Collections.emptyList(); }

Target:
public OafBodyWithOrderedUpdates(List<QualifiedOafJsonRecord> infoSpaceRecords) { Preconditions.checkNotNull(infoSpaceRecords); SortedMap<String, String> updatesOrderedByQualifier = null; for (QualifiedOafJsonRecord record : infoSpaceRecords) { if (BODY_QUALIFIER_NAME.equals(record.getQualifier())) { this.body = record.getOafJson(); } else { if (updatesOrderedByQualifier==null) { updatesOrderedByQualifier = Maps.newTreeMap(); } updatesOrderedByQualifier.put(record.getQualifier(), record.getOafJson()); } } this.orderedUpdates = updatesOrderedByQualifier!=null?updatesOrderedByQualifier.values():Collections.emptyList(); }
Source:
protected void updateLeaseStorageDomains(final Guid selectedStorageDomainId) { AsyncDataProvider.getInstance().getStorageDomainList(new AsyncQuery<>( returnValue -> { List<StorageDomain> domains = new ArrayList<>(); domains.add(null); returnValue.stream() .filter(d -> d.getStorageDomainType().isDataDomain()) .filter(d -> d.getStatus() == StorageDomainStatus.Active) .forEach(d -> domains.add(d)); getModel().getLease().setItems(domains); if (selectedStorageDomainId != null) { returnValue.stream() .filter(d -> d.getStorageDomainType().isDataDomain()) .filter(d -> selectedStorageDomainId.equals(d.getId())) .findFirst().ifPresent(d -> getModel().getLease().setSelectedItem(d)); } setVmLeasesAvailability(); }), getModel().getSelectedDataCenter().getId()); }

Target:
protected void updateLeaseStorageDomains(final Guid selectedStorageDomainId) { AsyncDataProvider.getInstance().getStorageDomainList(new AsyncQuery<>( returnValue -> { List<StorageDomain> domains = new ArrayList<>(); domains.add(null); for (StorageDomain domain : returnValue) { if (domain.getStorageDomainType().isDataDomain() && domain.getStatus() == StorageDomainStatus.Active) { domains.add(domain); } } getModel().getLease().setItems(domains); if (selectedStorageDomainId != null) { returnValue.stream() .filter(d -> d.getStorageDomainType().isDataDomain()) .filter(d -> selectedStorageDomainId.equals(d.getId())) .findFirst().ifPresent(d -> getModel().getLease().setSelectedItem(d)); } setVmLeasesAvailability(); }), getModel().getSelectedDataCenter().getId()); }
Source:
private boolean init(StreamConfig config) throws NotFoundException { URL url = null; if (config.getURL().isPresent()) { url = config.getURL().get(); } else if (config.getStreamFile().isPresent()) { try { url = config.getStreamFile().get().toURI().toURL(); } catch (MalformedURLException e) { throw new NotFoundException(e); } } else { throw new NotFoundException("StreamConfig requires either a URL or File to be specified"); } Map<String, Stream> streamsMap = StreamsJsonParser.parse(url); Set<String> toRetainMap = new HashSet<String>(streamsMap.keySet()); toRetainMap.retainAll(streamMap.keySet()); if (toRetainMap.size() > 0) { throw new IllegalArgumentException( "URL '" + url + "' contain entires that overlap: " + Arrays.toString(toRetainMap.toArray())); } this.streamMap.putAll(streamsMap); this.urlToStreamsMap.put(url, streamsMap.values()); return true; }

Target:
private boolean init(StreamConfig config) throws NotFoundException { URL url = null; if (config.getURL().isPresent()) { url = config.getURL().get(); } else if (config.getStreamFile().isPresent()) { try { url = config.getStreamFile().get().toURI().toURL(); } catch (MalformedURLException e) { throw new NotFoundException(e); } } else { throw new NotFoundException("StreamConfig requires either a URL or File to be specified"); } Map<String, Stream> streamsMap = StreamsJsonParser.parse(url); Set<String> toRetainMap = new HashSet<String>(streamsMap.keySet()); toRetainMap.retainAll(parsedStreamsMap.keySet()); if (toRetainMap.size() > 0) { throw new IllegalArgumentException( "URL '" + url + "' contain entires that overlap: " + Arrays.toString(toRetainMap.toArray())); } this.parsedStreamsMap.putAll(streamsMap); this.urlToParsedStreams.put(url, streamsMap.values()); return true; }
Source:
public FindInfo findEntriesSince(FindToken token, long maxSizeOfEntries) throws StoreException { MockFindToken tokenmock = (MockFindToken) token; List<MessageInfo> entriesToReturn = new ArrayList<MessageInfo>(); long currentSizeOfEntries = 0; int index = 0; while (currentSizeOfEntries < maxSizeOfEntries && index < messageInfoList.size()) { entriesToReturn.add(messageInfoList.get(tokenmock.getIndex() + index)); index++; } return new FindInfo(entriesToReturn, new MockFindToken(tokenmock.getIndex() + entriesToReturn.size()), entriesToReturn.size()); }

Target:
public FindInfo findEntriesSince(FindToken token, long maxSizeOfEntries) throws StoreException { MockFindToken tokenmock = (MockFindToken) token; List<MessageInfo> entriesToReturn = new ArrayList<MessageInfo>(); long currentSizeOfEntriesInBytes = 0; int index = 0; while (currentSizeOfEntriesInBytes < maxSizeOfEntries && index < messageInfoList.size()) { entriesToReturn.add(messageInfoList.get(tokenmock.getIndex() + index)); currentSizeOfEntriesInBytes += messageInfoList.get(tokenmock.getIndex() + index).getSize(); index++; } int startIndex = tokenmock.getIndex(); int totalSizeRead = 0; for (int i = 0; i < startIndex; i++) { totalSizeRead += messageInfoList.get(i).getSize(); } totalSizeRead += currentSizeOfEntriesInBytes; return new FindInfo(entriesToReturn, new MockFindToken(tokenmock.getIndex() + entriesToReturn.size(), totalSizeRead)); }
Source:
public void initColumnValues(ColumnValueSelector selector, int columnIndex, Object[] valuess) { final DimensionSelector dimSelector = (DimensionSelector) selector; final IndexedInts row = dimSelector.getRow(); final int[] newIds = new int[row.size()]; for (int i = 0; i < row.size(); i++) { final String value = dimSelector.lookupName(row.get(i)); final int dictId = reverseDictionary.getInt(value); if (dictId < 0) { dictionary.add(value); reverseDictionary.put(value, nextId); newIds[i] = nextId; nextId++; } else { newIds[i] = dictId; } } valuess[columnIndex] = ArrayBasedIndexedInts.of(newIds, newIds.length); }

Target:
public void initColumnValues(ColumnValueSelector selector, int columnIndex, Object[] valuess) { final DimensionSelector dimSelector = (DimensionSelector) selector; final IndexedInts row = dimSelector.getRow(); final int[] newIds = new int[row.size()]; for (int i = 0; i < row.size(); i++) { final String value = dimSelector.lookupName(row.get(i)); final int dictId = reverseDictionary.getInt(value); if (dictId < 0) { dictionary.add(value); reverseDictionary.put(value, nextId); newIds[i] = nextId; nextId++; } else { newIds[i] = dictId; } } valuess[columnIndex] = ArrayBasedIndexedInts.of(newIds); }
Source:
public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof Pair)) { return false; } Pair<?, ?> other = (Pair<?, ?>)obj; return Objects.equals(first, other.first) && Objects.equals(second, other.second); }

Target:
public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (getClass() != obj.getClass()) { return false; } Pair<?, ?> other = (Pair<?, ?>)obj; return Objects.equals(getFirst(), other.getFirst()) && Objects.equals(getSecond(), other.getSecond()); }
Source:
private static Stream<Arguments> baosFactories() { final BAOSFactory syncBaosFactory = size -> new ByteArrayOutputStream(size); final BAOSFactory nonSyncBaos = size -> new FastByteArrayOutputStream(size); return Stream.of( Arguments.of(ByteArrayOutputStream.class.getSimpleName(), syncBaosFactory), Arguments.of(FastByteArrayOutputStream.class.getSimpleName(), nonSyncBaos) ); }

Target:
private static Stream<Arguments> baosFactories() { return Stream.of( Arguments.of(ByteArrayOutputStream.class.getSimpleName(), new ByteArrayOutputStreamFactory()), Arguments.of(UnsynchronizedByteArrayOutputStream.class.getSimpleName(), new UnsynchronizedByteArrayOutputStreamFactory()) ); }
Source:
default void onCheckpoint(Map<SystemStreamPartition, String> offsets) { }

Target:
default void onCheckpoint(Map<SystemStreamPartition, String> offsets) { afterCheckpoint(offsets); }
Source:
private long periodNumber() { return DateTime.now().getMillis() / 1000 / periodInSeconds; }

Target:
private long periodNumber() { return currentTimeMillis() / 1000 / periodInSeconds; }
Source:
public void testConvertToAvroMutation() { ByteBuf buffer = Mockito.mock(ByteBuf.class); Mockito.when(buffer.getByte(0)).thenReturn((byte)0x80); Mockito.when(buffer.getByte(1)).thenReturn((byte)0x57); Mockito.when(buffer.getByte(4)).thenReturn((byte)0x05); Mockito.when(buffer.getShort(2)).thenReturn((short)10); ByteBuf key = Mockito.mock(ByteBuf.class); Mockito.when(key.readableBytes()).thenReturn(4); Mockito.when(buffer.slice(29, 10)).thenReturn(key); Mockito.when(buffer.getByte(4)).thenReturn((byte)0x05); Mockito.when(buffer.getShort(2)).thenReturn((short)10); Mockito.when(buffer.getInt(8)).thenReturn(100); ByteBuf content = Mockito.mock(ByteBuf.class); Mockito.when(content.readableBytes()).thenReturn(85); Mockito.when(buffer.slice(39, 85)).thenReturn(content); IndexedRecord record = converter.convertToAvro(buffer); Assert.assertEquals(schema, record.getSchema()); assertIndexedRecordResult(record, "mutation", new byte[85]); }

Target:
public void testConvertToAvroMutation() { ByteBuf buffer = Mockito.mock(ByteBuf.class); Mockito.when(buffer.getByte(0)).thenReturn(MessageUtil.MAGIC_REQ); Mockito.when(buffer.getByte(1)).thenReturn(MessageUtil.DCP_MUTATION_OPCODE); Mockito.when(buffer.getByte(4)).thenReturn(OFFSET); Mockito.when(buffer.getShort(2)).thenReturn(LENGTH); ByteBuf key = Mockito.mock(ByteBuf.class); Mockito.when(key.readableBytes()).thenReturn(4); Mockito.when(buffer.slice(29, 10)).thenReturn(key); Mockito.when(buffer.getByte(4)).thenReturn(OFFSET); Mockito.when(buffer.getShort(2)).thenReturn(LENGTH); Mockito.when(buffer.getInt(8)).thenReturn(100); ByteBuf content = Mockito.mock(ByteBuf.class); Mockito.when(content.readableBytes()).thenReturn(85); Mockito.when(buffer.slice(39, 85)).thenReturn(content); IndexedRecord record = converter.convertToAvro(buffer); Assert.assertEquals(schema, record.getSchema()); assertIndexedRecordResult(record, "mutation", new byte[85]); }
Source:
private void applyStringFilter(String filterString) { try { FilterExpression filter = Parser.parse(filterString); if (filter != null) { this.applyFilterExpression(filter); } else { this.applyFilterExpression(Qualifier.EMPTY); } } catch (FilterException ex) { this.applyFilterExpression(Qualifier.EMPTY); UI.status.displayMessage("Panel " + (panelIndex + 1) + ": " + ex.getMessage()); } }

Target:
private void applyStringFilter(String filterString) { try { FilterExpression filter = Parser.parse(filterString); if (filter != null) { this.applyFilterExpression(filter); } else { this.applyFilterExpression(Qualifier.EMPTY); } } catch (FilterException ex) { this.applyFilterExpression(Qualifier.EMPTY); UI.status.displayMessage(getUniquePanelName( panelMenuBar.getPanelName()) + ": " + ex.getMessage()); } }
Source:
public <T extends RealType<T>> RandomAccessibleInterval<T> realTransform( final RandomAccessibleInterval<T> in, final InvertibleRealTransform transform) { final RandomAccessibleInterval<T> result = (RandomAccessibleInterval<T>) ops().run( net.imagej.ops.transform.realTransform.DefaultTransformView.class, in, transform); return result; }

Target:
public <T extends RealType<T>> RandomAccessibleInterval<T> realTransform( final RandomAccessibleInterval<T> in, final InvertibleRealTransform transform) { final RandomAccessibleInterval<T> result = (RandomAccessibleInterval<T>) ops().run( Ops.Transform.RealTransform.class, in, transform); return result; }
Source:
public NettyServerFactory(VerifiableProperties verifiableProperties, MetricRegistry metricRegistry, RequestResponseHandlerController requestResponseHandlerController) throws InstantiationException { if (verifiableProperties != null && metricRegistry != null && requestResponseHandlerController != null) { this.nettyConfig = new NettyConfig(verifiableProperties); this.nettyMetrics = new NettyMetrics(metricRegistry); this.requestResponseHandlerController = requestResponseHandlerController; } else { StringBuilder errorMessage = new StringBuilder("Null arg(s) received during instantiation of NettyServerFactory -"); if (verifiableProperties == null) { errorMessage.append(" [VerifiableProperties] "); } if (metricRegistry == null) { errorMessage.append(" [MetricRegistry] "); } if (requestResponseHandlerController == null) { errorMessage.append(" [RequestResponseHandlerController] "); } throw new InstantiationException(errorMessage.toString()); } logger.trace("Instantiated NettyServerFactory"); }

Target:
public NettyServerFactory(VerifiableProperties verifiableProperties, MetricRegistry metricRegistry, RequestResponseHandlerController requestResponseHandlerController) { if (verifiableProperties != null && metricRegistry != null && requestResponseHandlerController != null) { this.nettyConfig = new NettyConfig(verifiableProperties); this.nettyMetrics = new NettyMetrics(metricRegistry); this.requestResponseHandlerController = requestResponseHandlerController; } else { StringBuilder errorMessage = new StringBuilder("Null arg(s) received during instantiation of NettyServerFactory -"); if (verifiableProperties == null) { errorMessage.append(" [VerifiableProperties] "); } if (metricRegistry == null) { errorMessage.append(" [MetricRegistry] "); } if (requestResponseHandlerController == null) { errorMessage.append(" [RequestResponseHandlerController] "); } throw new IllegalArgumentException(errorMessage.toString()); } logger.trace("Instantiated NettyServerFactory"); }
Source:
public boolean moveCellsDown() { boolean dirty = false; if (moveCellsDownLoop()) dirty = true; for (int i = 0; i < GRID_WIDTH; i++) { for (int j = GRID_WIDTH - 1; j > 0; j--) { int previousJ = j - 1; dirty = combineCells(i, previousJ, i, j, dirty); } } if (moveCellsDownLoop()) dirty = true; return dirty; }

Target:
public boolean moveCellsDown() { boolean dirty = false; if (moveCellsDownLoop()) { dirty = true; } for (int i = 0; i < GRID_WIDTH; i++) { for (int j = GRID_WIDTH - 1; j > 0; j--) { int previousJ = j - 1; dirty = combineCells(i, previousJ, i, j, dirty); } } if (moveCellsDownLoop()) { dirty = true; } return dirty; }
Source:
protected int run() { String prelude = Kompile.REQUIRE_PRELUDE_K; if (options.noPrelude) { prelude = ""; } List<org.kframework.kil.Module> modules = null; modules = parser.slurp(prelude + FileUtil.load(options.mainDefinitionFile()), Source.apply(options.mainDefinitionFile().getAbsolutePath()), options.mainDefinitionFile().getParentFile(), ListUtils.union(options.includes.stream() .map(files::resolveWorkingDirectory).collect(Collectors.toList()), Lists.newArrayList(Kompile.BUILTIN_DIRECTORY))); Set<File> allFiles = modules.stream().map(m -> new File(m.getSource().source())).collect(Collectors.toSet()); System.out.println(files.resolveWorkingDirectory(".").toURI().relativize(files.resolveKompiled("timestamp").toURI()).getPath() + " : \\"); for (File file : allFiles) { System.out.println(" " + file.getAbsolutePath() + " \\"); } System.out.println(); return 0; }

Target:
protected int run() { String prelude = Kompile.REQUIRE_PRELUDE_K; if (options.noPrelude) { prelude = ""; } List<org.kframework.kil.Module> modules = null; modules = parser.slurp(prelude + FileUtil.load(options.mainDefinitionFile(files)), Source.apply(options.mainDefinitionFile(files).getAbsolutePath()), options.mainDefinitionFile(files).getParentFile(), ListUtils.union(options.includes.stream() .map(files::resolveWorkingDirectory).collect(Collectors.toList()), Lists.newArrayList(Kompile.BUILTIN_DIRECTORY))); Set<File> allFiles = modules.stream().map(m -> new File(m.getSource().source())).collect(Collectors.toSet()); System.out.println(files.resolveWorkingDirectory(".").toURI().relativize(files.resolveKompiled("timestamp").toURI()).getPath() + " : \\"); for (File file : allFiles) { System.out.println(" " + file.getAbsolutePath() + " \\"); } System.out.println(); return 0; }