auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void shouldSetJettyHomeAndBasePropertyIfItsNotSet() { when(systemEnvironment.getPropertyImpl("jetty.home")).thenReturn(""); when(systemEnvironment.getPropertyImpl("user.dir")).thenReturn("junk"); JettyWorkDirValidator jettyWorkDirValidator = new JettyWorkDirValidator(systemEnvironment); Validation val = new Validation(); jettyWorkDirValidator.validate(val); assertThat(val.isSuccessful(), is(true)); <START> verify(systemEnvironment).setProperty("jetty.home", "junk"); <END> }</code><technical_language>verify user.dir system property is</technical_language>

Target:
public void shouldSetJettyHomeAndBasePropertyIfItsNotSet() { when(systemEnvironment.getPropertyImpl("jetty.home")).thenReturn(""); when(systemEnvironment.getPropertyImpl("user.dir")).thenReturn("junk"); Validation val = new Validation(); jettyWorkDirValidator.validate(val); assertThat(val.isSuccessful(), is(true)); verify(systemEnvironment).getPropertyImpl("user.dir"); verify(systemEnvironment).setProperty("jetty.home", "junk"); }
Source:
<code>public ObserveResponse observe(int resourceid) { <START> return ObserveResponse.notFound(); <END> }</code><technical_language>called read() default</technical_language>

Target:
public ObserveResponse observe(int resourceid) { ReadResponse readResponse = this.read(resourceid); return ObserveResponse.success(readResponse.getContent()); }
Source:
<code>public HttpServiceResponse handle(HttpServiceRequest request) throws Exception { HttpServiceResponse response = new HttpServiceResponse(); if (HttpServer.Method.GET == request.getMethod()) { Collection<BookieSocketAddress> bookies = new ArrayList<BookieSocketAddress>(); Map<String, String> params = request.getParams(); boolean readOnly = (params != null) && params.containsKey("type") && params.get("type").equals("ro"); boolean printHostname = (params != null) && params.containsKey("print_hostnames") && params.get("print_hostnames").equals("true"); ClientConfiguration clientconf = new ClientConfiguration(conf) .setZkServers(conf.getZkServers()); BookKeeperAdmin bka = new BookKeeperAdmin(clientconf); if (readOnly) { bookies.addAll(bka.getReadOnlyBookies()); } else { bookies.addAll(bka.getAvailableBookies()); } Map<String, String> output = Maps.newHashMap(); for (BookieSocketAddress b : bookies) { output.putIfAbsent(b.toString(), printHostname ? b.getHostName() : null); <START> LOG.debug("bookie: " + b.toString() + " hostname:" + b.getHostName()); <END> } String jsonResponse = JsonUtil.toJson(output); response.setBody(jsonResponse); response.setCode(HttpServer.StatusCode.OK); return response; } else { response.setCode(HttpServer.StatusCode.NOT_FOUND); response.setBody("Not found method. Should be GET method"); return response; } }</code><technical_language>Ok, string interpolation</technical_language>

Target:
public HttpServiceResponse handle(HttpServiceRequest request) throws Exception { HttpServiceResponse response = new HttpServiceResponse(); if (HttpServer.Method.GET == request.getMethod()) { Collection<BookieSocketAddress> bookies = new ArrayList<BookieSocketAddress>(); Map<String, String> params = request.getParams(); boolean readOnly = (params != null) && params.containsKey("type") && params.get("type").equals("ro"); boolean printHostname = (params != null) && params.containsKey("print_hostnames") && params.get("print_hostnames").equals("true"); if (readOnly) { bookies.addAll(bka.getReadOnlyBookies()); } else { bookies.addAll(bka.getAvailableBookies()); } Map<String, String> output = Maps.newHashMap(); for (BookieSocketAddress b : bookies) { output.putIfAbsent(b.toString(), printHostname ? b.getHostName() : null); LOG.debug("bookie: " + b.toString() + " hostname:" + b.getHostName()); } String jsonResponse = JsonUtil.toJson(output); response.setBody(jsonResponse); response.setCode(HttpServer.StatusCode.OK); return response; } else { response.setCode(HttpServer.StatusCode.NOT_FOUND); response.setBody("Not found method. Should be GET method"); return response; } }
Source:
<code>public void newGlobalEntries(final TmfPieChartViewer context) { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { <START> synchronized (context.getMutexLayoutChange()) { <END> if (!context.isDisposed()) { context.updateGlobalPieChart(); context.getGlobalPC().redraw(); } } } }); }</code><technical_language>context sync obj</technical_language>

Target:
public void newGlobalEntries(final TmfPieChartViewer context) { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { synchronized (context) { if (!context.isDisposed()) { context.updateGlobalPieChart(); context.getGlobalPC().redraw(); } } } }); }
Source:
<code>public void unretireProgram_shouldSetRetireFalseForWorkflowsAndWorkflowStates() { Program program = pws.getAllPrograms().get(0); Date lastModifiedDate = program.getDateChanged(); <START> Program program1 = pws.unretireProgram(program); <END> assertEquals(program.getRetired(), false); for (ProgramWorkflow workflow : program.getAllWorkflows()) { if (lastModifiedDate != null && lastModifiedDate.equals(workflow.getDateChanged())) { assertEquals(workflow.getRetired(), false); for (ProgramWorkflowState state : workflow.getStates()) { if (lastModifiedDate.equals(state.getDateChanged())) { assertEquals(state.getRetired(), false); } } } } }</code><technical_language>Do need this variable</technical_language>

Target:
public void unretireProgram_shouldSetRetireFalseForWorkflowsAndWorkflowStates() { Program program = pws.getAllPrograms().get(0); Date lastModifiedDate = program.getDateChanged(); assertEquals(program.getRetired(), false); for (ProgramWorkflow workflow : program.getAllWorkflows()) { if (lastModifiedDate != null && lastModifiedDate.equals(workflow.getDateChanged())) { assertEquals(workflow.getRetired(), false); for (ProgramWorkflowState state : workflow.getStates()) { if (lastModifiedDate.equals(state.getDateChanged())) { assertEquals(state.getRetired(), false); } } } } }
Source:
<code>public List<String> getPrivatePackages() { List<String> privatePackagesEntries1 = getEntries(Constants.PRIVATEPACKAGE, listConverter); List<String> privatePackagesEntries2 = getEntries(Constants.PRIVATE_PACKAGE, listConverter); Set<String> privatePackages = Stream.concat(privatePackagesEntries1.stream(), privatePackagesEntries2.stream()) <START> .collect(toSet()); <END> return new ArrayList<>(privatePackages); }</code><technical_language>a stream, need collect a set a list set. distinct() collect list remove duplicates</technical_language>

Target:
public List<String> getPrivatePackages() { List<String> privatePackagesEntries1 = getEntries(Constants.PRIVATEPACKAGE, listConverter); List<String> privatePackagesEntries2 = getEntries(Constants.PRIVATE_PACKAGE, listConverter); return Stream.concat(privatePackagesEntries1.stream(), privatePackagesEntries2.stream()) .distinct() .collect(toList()); }
Source:
<code>public RealmObjectSchema removeField(String fieldName) { checkLegalName(fieldName); if (!hasField(fieldName)) { throw new IllegalStateException(fieldName + " does not exist."); } long columnIndex = getColumnIndex(fieldName); if (table.getPrimaryKey() == columnIndex) { table.setPrimaryKey(null); } if (columnIndex < table.getPrimaryKey()) { String pkField = getPrimaryKey(); table.removeColumn(columnIndex); table.setPrimaryKey(pkField); return this; } <START> table.removeColumn(columnIndex); <END> return this; }</code><technical_language>calling table.removeColumn() for columnIndex. risk deleting columns</technical_language>

Target:
public RealmObjectSchema removeField(String fieldName) { checkLegalName(fieldName); if (!hasField(fieldName)) { throw new IllegalStateException(fieldName + " does not exist."); } long columnIndex = getColumnIndex(fieldName); if (table.getPrimaryKey() == columnIndex) { table.setPrimaryKey(null); } table.removeColumn(columnIndex); return this; }
Source:
<code>private OutputStream addPreSteps(ProcessingStepHandler handler, IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) { ArrayList<ProcessingStep> steps = new ArrayList<ProcessingStep>(); if (IArtifactDescriptor.TYPE_ZIP.equals(descriptor.getProperty(IArtifactDescriptor.DOWNLOAD_CONTENTTYPE))) <START> steps.add(new ZipVerifierStep()); <END> List<ChecksumVerifier> checksumVerifiers = ChecksumUtilities.getChecksumVerifiers(descriptor); for (ChecksumVerifier checksumVerifier : checksumVerifiers) { steps.add(checksumVerifier); } if (steps.isEmpty()) return destination; ProcessingStep[] stepArray = steps.toArray(new ProcessingStep[steps.size()]); return handler.link(stepArray, destination, monitor); }</code><technical_language>Artifacts a download artifact checksum. In this case, I pick right distinguish. problem occurs above</technical_language>

Target:
private OutputStream addPreSteps(ProcessingStepHandler handler, IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) { ArrayList<ProcessingStep> steps = new ArrayList<ProcessingStep>(); if (IArtifactDescriptor.TYPE_ZIP.equals(descriptor.getProperty(IArtifactDescriptor.DOWNLOAD_CONTENTTYPE))) steps.add(new ZipVerifierStep()); Iterable<ChecksumVerifier> checksumVerifiers = ChecksumUtilities.getChecksumVerifiers(descriptor); for (ChecksumVerifier checksumVerifier : checksumVerifiers) { steps.add(checksumVerifier); } if (steps.isEmpty()) return destination; ProcessingStep[] stepArray = steps.toArray(new ProcessingStep[steps.size()]); return handler.link(stepArray, destination, monitor); }
Source:
<code>@Override public Schema create(SchemaPlus parentSchema, String name, Map<String, Object> operand) { final Map map = (Map) operand; final ObjectMapper mapper = new ObjectMapper(); mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true); try { List<HttpHost> hosts; if (map.containsKey("hosts")) { final List<String> configHosts = mapper.readValue((String) map.get("hosts"), new TypeReference<List<String>>() { }); hosts = configHosts .stream() .map(host -> HttpHost.create(host)) .collect(Collectors.toList()); } else if (map.containsKey("coordinates")) { final Map<String, Integer> coordinates = mapper.readValue((String) map.get("coordinates"), new TypeReference<Map<String, Integer>>() { }); hosts = coordinates .entrySet() .stream() .map(entry -> new HttpHost(entry.getKey(), entry.getValue())) .collect(Collectors.toList()); LOGGER.warn("Prefer using hosts, coordinates is deprecated."); } else { throw new IllegalArgumentException ("Both 'coordinates' and 'hosts' is missing in configuration. Provide one of them."); } final String pathPrefix = (String) map.get("pathPrefix"); <START> String jdbcUser = (String) map.get("jdbcUser"); String jdbcPassword = (String) map.get("jdbcPassword"); final RestClient client = connect(hosts, pathPrefix, jdbcUser, jdbcPassword); <END> final String index = (String) map.get("index"); return new ElasticsearchSchema(client, new ObjectMapper(), index); } catch (IOException e) { throw new RuntimeException("Cannot parse values from json", e); } }</code><technical_language>this refers username password for Elasticsearch is related JDBC, this changed username password</technical_language>

Target:
@Override public Schema create(SchemaPlus parentSchema, String name, Map<String, Object> operand) { final Map map = (Map) operand; final ObjectMapper mapper = new ObjectMapper(); mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true); try { List<HttpHost> hosts; if (map.containsKey("hosts")) { final List<String> configHosts = mapper.readValue((String) map.get("hosts"), new TypeReference<List<String>>() { }); hosts = configHosts .stream() .map(host -> HttpHost.create(host)) .collect(Collectors.toList()); } else if (map.containsKey("coordinates")) { final Map<String, Integer> coordinates = mapper.readValue((String) map.get("coordinates"), new TypeReference<Map<String, Integer>>() { }); hosts = coordinates .entrySet() .stream() .map(entry -> new HttpHost(entry.getKey(), entry.getValue())) .collect(Collectors.toList()); LOGGER.warn("Prefer using hosts, coordinates is deprecated."); } else { throw new IllegalArgumentException ("Both 'coordinates' and 'hosts' is missing in configuration. Provide one of them."); } final String pathPrefix = (String) map.get("pathPrefix"); String username = (String) map.get("username"); String password = (String) map.get("password"); final RestClient client = connect(hosts, pathPrefix, username, password); final String index = (String) map.get("index"); return new ElasticsearchSchema(client, new ObjectMapper(), index); } catch (IOException e) { throw new RuntimeException("Cannot parse values from json", e); } }
Source:
<code>public void accept(DeploymentProcessorTarget deploymentProcessorTarget) { deploymentProcessorTarget.addDeploymentProcessor(MicroProfileFaultToleranceExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, Phase.DEPENDENCIES_MICROPROFILE_OPENTRACING + 1, new MicroProfileFaultToleranceDependenciesProcessor()); <START> deploymentProcessorTarget.addDeploymentProcessor(MicroProfileFaultToleranceExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_MICROPROFILE_OPENTRACING + 1, new MicroProfileFaultToleranceDeploymentProcessor()); <END> }</code><technical_language>is a pain, add new phases in wildfly-core instead of defining phase increments in wildfly; this existing phase in wildfly-corePhase.POST_MODULE_MICROPROFILE_OPENTRACING + 1</technical_language>

Target:
public void accept(DeploymentProcessorTarget deploymentProcessorTarget) { deploymentProcessorTarget.addDeploymentProcessor(MicroProfileFaultToleranceExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, Phase.DEPENDENCIES_MICROPROFILE_FAULT_TOLERANCE, new MicroProfileFaultToleranceDependenciesProcessor()); deploymentProcessorTarget.addDeploymentProcessor(MicroProfileFaultToleranceExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_MICROPROFILE_FAULT_TOLERANCE, new MicroProfileFaultToleranceDeploymentProcessor()); }
Source:
<code>public Builder centerCrop() { <START> centerCrop = true; <END> return this; }</code><technical_language>in build() method of Request.Builder</technical_language>

Target:
public Builder centerCrop() { if (centerInside) { throw new IllegalStateException("Center crop can not be used after calling centerInside"); } centerCrop = true; return this; }
Source:
<code>public static ZkChildrenCache createCache(final CuratorFramework client, final String key) { try { return executeWithRetry( () -> { <START> final ZkChildrenCache newCache = new ZkChildrenCache(client, key);; <END> try { newCache.start(); return newCache; } catch (final KeeperException.NoNodeException e) { throw e; } catch (final Exception e) { throw new NakadiRuntimeException(e); } }, new RetryForSpecifiedCountStrategy<ZkChildrenCache>(MAX_NUMBER_OF_RETRIES) .withExceptionsThatForceRetry(ImmutableList.of(KeeperException.NoNodeException.class)) .withWaitBetweenEachTry(WAIT_BETWEEN_TRIES_MS)); } catch (final Exception e) { LOG.error("Zookeeper error when creating cache for children", e); throw new NakadiRuntimeException(e); } }</code><technical_language>Haha! I redundant symbol this line</technical_language>

Target:
public static ZkChildrenCache createCache(final CuratorFramework client, final String key) { try { return executeWithRetry( () -> { final ZkChildrenCache newCache = new ZkChildrenCache(client, key); try { newCache.start(); return newCache; } catch (final KeeperException.NoNodeException e) { throw e; } catch (final Exception e) { throw new NakadiRuntimeException(e); } }, new RetryForSpecifiedCountStrategy<ZkChildrenCache>(MAX_NUMBER_OF_RETRIES) .withExceptionsThatForceRetry(ImmutableList.of(KeeperException.NoNodeException.class)) .withWaitBetweenEachTry(WAIT_BETWEEN_TRIES_MS)); } catch (final Exception e) { LOG.error("Zookeeper error when creating cache for children", e); throw new NakadiRuntimeException(e); } }
Source:
<code>private Filter adaptBinaryComparator( CompareOp compareOp, BinaryComparator comparator) { ByteString value = ByteString.copyFrom(comparator.getValue()); switch (compareOp) { case LESS: return range().endOpen(value); case LESS_OR_EQUAL: return range().endClosed(value); case EQUAL: if (comparator.getValue().length == 0) { return FILTERS.value().regex(value); } else { return range().startClosed(value).endClosed(value); } case NOT_EQUAL: if(comparator.getValue().length == 0) { return FILTERS.value().regex(".+"); } else { <START> return FILTERS.interleave().filter(range().endOpen(value)).filter(range().startOpen(value)); <END> } case GREATER_OR_EQUAL: return range().startClosed(value); case GREATER: return range().startOpen(value); case NO_OP: return FILTERS.pass(); default: throw new IllegalStateException( String.format("Cannot handle unknown compare op %s", compareOp)); } }</code><technical_language>Please formatting before</technical_language>

Target:
private Filter adaptBinaryComparator( CompareOp compareOp, BinaryComparator comparator) { ByteString value = ByteString.copyFrom(comparator.getValue()); switch (compareOp) { case LESS: return range().endOpen(value); case LESS_OR_EQUAL: return range().endClosed(value); case EQUAL: if (comparator.getValue().length == 0) { return FILTERS.value().regex(value); } else { return range().startClosed(value).endClosed(value); } case NOT_EQUAL: if(comparator.getValue().length == 0) { return FILTERS.value().regex(ReaderExpressionHelper.ANY_BYTES); } else { return FILTERS.interleave() .filter(range().endOpen(value)) .filter(range().startOpen(value)); } case GREATER_OR_EQUAL: return range().startClosed(value); case GREATER: return range().startOpen(value); case NO_OP: return FILTERS.pass(); default: throw new IllegalStateException( String.format("Cannot handle unknown compare op %s", compareOp)); } }
Source:
<code><START> public static String stripTrailingSlash(String str) { <END> if (str.charAt(str.length() - 1) == '/') { return str.substring(0, str.length() - 1); } return str; }</code><technical_language>great cover util method tests</technical_language>

Target:
public static String stripTrailingSlash(String str) { if (isNullOrEmpty(str)) { return str; } if (str.charAt(str.length() - 1) == '/') { return str.substring(0, str.length() - 1); } return str; }
Source:
<code>@Override public <T> T gauge(Id id, T obj, ToDoubleFunction<T> f) { final String name = toMetricName(id); Gauge aggrGauge = this.impl.getGauges().get(name); if (aggrGauge == null) { aggrGauge = new MetricsGaugeAggr(); <START> this.impl.register(name, aggrGauge); <END> } if (aggrGauge instanceof MetricsGaugeAggr) { final MetricsGauge<T> simpleGauge = new MetricsGauge<>(clock(), id, obj, f); register(simpleGauge); ((MetricsGaugeAggr) aggrGauge).addGauge(simpleGauge); } return obj; }</code><technical_language>is a race condition here, if threads get register takes place, get throw</technical_language>

Target:
@Override public <T> T gauge(Id id, T obj, ToDoubleFunction<T> f) { final Gauge aggrGauge = registeredGauges.computeIfAbsent(id, idKey -> { final String name = toMetricName(id); final MetricsGaugeAggr aggr = new MetricsGaugeAggr(); try { this.impl.register(name, aggr); } catch (IllegalArgumentException e) { Throwables.propagate(e); return null; } return aggr; }); if (aggrGauge != null) { final MetricsGauge<T> simpleGauge = new MetricsGauge<>(clock(), id, obj, f); register(simpleGauge); ((MetricsGaugeAggr) aggrGauge).addGauge(simpleGauge); } return obj; }
Source:
<code>private static void seedData(MesosCluster cluster, ElasticsearchSchedulerContainer schedulerContainer) { String taskHttpAddress; try { ESTasks esTasks = new ESTasks(TEST_CONFIG, schedulerContainer.getIpAddress()); <START> new TasksResponse(esTasks, 3, "TASK_RUNNING"); <END> taskHttpAddress = esTasks.getTasks().get(0).getString("http_address"); } catch (Exception e) { throw new RuntimeException(e.getMessage()); } SeedDataContainer seedData = new SeedDataContainer(clusterArchitecture.dockerClient, "http://" + taskHttpAddress); cluster.addAndStartContainer(seedData); LOGGER.info("Elasticsearch node " + taskHttpAddress + " seeded with data"); }</code><technical_language>3 difficult understand. replaced cluster.getSlaves().length</technical_language>

Target:
private static void seedData(MesosCluster cluster, ElasticsearchSchedulerContainer schedulerContainer) { String taskHttpAddress; try { ESTasks esTasks = new ESTasks(TEST_CONFIG, schedulerContainer.getIpAddress()); new TasksResponse(esTasks, TEST_CONFIG.getElasticsearchNodesCount(), "TASK_RUNNING"); taskHttpAddress = esTasks.getTasks().get(0).getString("http_address"); } catch (Exception e) { throw new RuntimeException(e.getMessage()); } SeedDataContainer seedData = new SeedDataContainer(clusterArchitecture.dockerClient, "http://" + taskHttpAddress); cluster.addAndStartContainer(seedData); LOGGER.info("Elasticsearch node " + taskHttpAddress + " seeded with data"); }
Source:
<code>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { if (viewType == RowType.THREAD) { View discussionThreadRow = LayoutInflater. from(parent.getContext()). inflate(R.layout.discussion_responses_thread_row, parent, false); return new DiscussionThreadViewHolder(discussionThreadRow); } if (viewType == RowType.MORE_BUTTON) { View discussionThreadRow = LayoutInflater. from(parent.getContext()). inflate(R.layout.show_more_button_row, parent, false); return new ShowMoreViewHolder(discussionThreadRow); } View discussionResponseRow = LayoutInflater. from(parent.getContext()). inflate(R.layout.discussion_responses_response_row, parent, false); RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) discussionResponseRow.getLayoutParams(); params.topMargin -= discussionResponseRow.getPaddingTop(); params.leftMargin -= discussionResponseRow.getPaddingLeft(); params.rightMargin -= discussionResponseRow.getPaddingRight(); <START> discussionResponseRow.setLayoutParams(params); <END> return new DiscussionResponseViewHolder(discussionResponseRow); }</code><technical_language>Hmm, a utility method for this</technical_language>

Target:
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { if (viewType == RowType.THREAD) { View discussionThreadRow = LayoutInflater. from(parent.getContext()). inflate(R.layout.discussion_responses_thread_row, parent, false); return new DiscussionThreadViewHolder(discussionThreadRow); } if (viewType == RowType.MORE_BUTTON) { View discussionThreadRow = LayoutInflater. from(parent.getContext()). inflate(R.layout.show_more_button_row, parent, false); return new ShowMoreViewHolder(discussionThreadRow); } View discussionResponseRow = LayoutInflater. from(parent.getContext()). inflate(R.layout.discussion_responses_response_row, parent, false); UiUtil.adjustCardViewMargins(discussionResponseRow); return new DiscussionResponseViewHolder(discussionResponseRow); }
Source:
<code>public MantaObjectResponse(final String path, final MantaHttpHeaders headers, final MantaMetadata metadata) { Validate.notBlank(path, "Path must be not be blank"); Validate.notNull(headers, "Headers must not be null"); this.path = path; this.httpHeaders = headers; this.contentLength = headers.getContentLength(); this.etag = headers.getETag(); this.mtime = headers.getLastModified(); this.requestId = headers.getRequestId(); if (headers.getContentType() != null) { final String contentType = headers.getContentType(); if (contentType == null) { this.type = null; } else if (contentType.equals(DIRECTORY_RESPONSE_CONTENT_TYPE)) { this.type = "directory"; } else if (contentType.equals(BUCKET_RESPONSE_CONTENT_TYPE)) { <START> this.type = "bucket"; <END> } else if (contentType.equals(BUCKETOBJECT_RESPONSE_CONTENT_TYPE)) { this.type = "bucketobject"; } else { this.type = "object"; } } else { this.type = null; } if (metadata != null) { this.metadata = metadata; } else { this.metadata = new MantaMetadata(headers.metadataAsStrings()); } }</code><technical_language>Can/Should this constants MantaObject.java instead of writing out strings again</technical_language>

Target:
public MantaObjectResponse(final String path, final MantaHttpHeaders headers, final MantaMetadata metadata) { Validate.notBlank(path, "Path must be not be blank"); Validate.notNull(headers, "Headers must not be null"); this.path = path; this.httpHeaders = headers; this.contentLength = headers.getContentLength(); this.etag = headers.getETag(); this.mtime = headers.getLastModified(); this.requestId = headers.getRequestId(); if (headers.getContentType() != null) { final String contentType = headers.getContentType(); if (contentType == null) { this.type = null; } else if (contentType.equals(DIRECTORY_RESPONSE_CONTENT_TYPE)) { this.type = MANTA_OBJECT_TYPE_DIRECTORY; } else if (contentType.equals(BUCKET_RESPONSE_CONTENT_TYPE)) { this.type = MANTA_OBJECT_TYPE_BUCKET; } else if (contentType.equals(BUCKETOBJECT_RESPONSE_CONTENT_TYPE)) { this.type = MANTA_OBJECT_TYPE_BUCKETOBJECT; } else { this.type = MANTA_OBJECT_TYPE_OBJECT; } } else { this.type = null; } if (metadata != null) { this.metadata = metadata; } else { this.metadata = new MantaMetadata(headers.metadataAsStrings()); } }
Source:
<code>public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) return; if (encounter.getLocation() == null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } List<Patient> patient = Collections.singletonList(encounter.getPatient()); List<Visit> candidates = visitService.getVisits(null, patient, null, null, null, when, null, null, null, true, false); if (candidates != null) { for (Visit candidate : candidates) { if (adtService.isSuitableVisit(candidate, encounter.getLocation(), when)) { candidate.addEncounter(encounter); return; } } } if (StringUtils.isNotBlank(administrationService.getGlobalProperty(EmrApiConstants.GP_VISIT_ASSIGNMENT_HANDLER_ENCOUNTER_TYPE_TO_VISIT_TYPE_MAP))) { EncounterTypetoVisitTypeMapper encounterTypetoVisitTypeMapper = Context.getRegisteredComponents(EncounterTypetoVisitTypeMapper.class).get(0); encounterTypetoVisitTypeMapper.setMappingString(administrationService.getGlobalProperty(EmrApiConstants.GP_VISIT_ASSIGNMENT_HANDLER_ENCOUNTER_TYPE_TO_VISIT_TYPE_MAP)); VisitType visitType = encounterTypetoVisitTypeMapper.getVisitTypeForEncounter(encounter); if (visitType != null) { Visit visit = new Visit(); visit.setStartDatetime(encounter.getEncounterDatetime()); visit.setLocation(encounter.getLocation()); visit.setPatient(encounter.getPatient()); visit.setVisitType(visitType); <START> visit.setStopDatetime(OpenmrsUtil.getLastMomentOfDay(encounter.getEncounterDatetime())); <END> visit.addEncounter(encounter); } } }</code><technical_language>I set stopDatetime if visit creating is for today</technical_language>

Target:
public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) return; if (encounter.getLocation() == null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } List<Patient> patient = Collections.singletonList(encounter.getPatient()); List<Visit> candidates = visitService.getVisits(null, patient, null, null, null, when, null, null, null, true, false); if (candidates != null) { for (Visit candidate : candidates) { if (adtService.isSuitableVisit(candidate, encounter.getLocation(), when)) { candidate.addEncounter(encounter); return; } } } if (StringUtils.isNotBlank(administrationService.getGlobalProperty(EmrApiConstants.GP_VISIT_ASSIGNMENT_HANDLER_ENCOUNTER_TYPE_TO_VISIT_TYPE_MAP))) { VisitType visitType = getEncounterTypetoVisitTypeMapper().getVisitTypeForEncounter(encounter); if (visitType != null) { Visit visit = new Visit(); visit.setStartDatetime(encounter.getEncounterDatetime()); visit.setLocation(adtService.getLocationThatSupportsVisits(encounter.getLocation())); visit.setPatient(encounter.getPatient()); visit.setVisitType(visitType); if (!DateUtils.isSameDay(encounter.getEncounterDatetime(), new Date())) { visit.setStopDatetime(OpenmrsUtil.getLastMomentOfDay(encounter.getEncounterDatetime())); } visit.addEncounter(encounter); } } }
Source:
<code><START> public static String chooseDriverType(String metaConnectString) throws InvalidOptionsException { <END> String scheme = metaConnectString; if (scheme.startsWith(JdbcDrivers.MYSQL.getSchemePrefix())) { return JdbcDrivers.MYSQL.getDriverClass(); } else if (scheme.startsWith(JdbcDrivers.POSTGRES.getSchemePrefix())) { return JdbcDrivers.POSTGRES.getDriverClass(); } else if (scheme.startsWith(JdbcDrivers.HSQLDB.getSchemePrefix())) { return JdbcDrivers.HSQLDB.getDriverClass(); } else if (scheme.startsWith(JdbcDrivers.ORACLE.getSchemePrefix())) { return JdbcDrivers.ORACLE.getDriverClass(); } else if (scheme.startsWith(JdbcDrivers.DB2.getSchemePrefix())) { return JdbcDrivers.DB2.getDriverClass(); } else if (scheme.startsWith(JdbcDrivers.SQLSERVER.getSchemePrefix())) { return JdbcDrivers.SQLSERVER.getDriverClass(); } else { throw new InvalidOptionsException("current meta-connect scheme not compatible with metastore"); } }</code><technical_language>This method private non-static is in this class</technical_language>

Target:
private String chooseDriverType(String metaConnectString) throws InvalidOptionsException { for (JdbcDrivers driver : SUPPORTED_DRIVERS) { if (metaConnectString.startsWith(driver.getSchemePrefix())) { return driver.getDriverClass(); } } throw new InvalidOptionsException("current meta-connect scheme not compatible with metastore"); }
Source:
<code>public void onDropItemEvent(DropItemEvent event, EntityRef itemEntity, ItemComponent itemComponent) { for (Component component : itemComponent.pickupPrefab.iterateComponents()) { Component componentCopy = library.getComponentLibrary().copy(component); if (componentCopy instanceof LocationComponent) { ((LocationComponent) componentCopy).setWorldPosition(event.getPosition()); } itemEntity.addOrSaveComponent(componentCopy); } if (!itemEntity.hasComponent(LocationComponent.class)) { itemEntity.addComponent(new LocationComponent(event.getPosition())); } itemEntity.getComponent(ItemComponent.class).pickableUp = false; long timeToPickUp = itemEntity.getComponent(ItemComponent.class).pickUpTime; <START> delayManager.addDelayedAction(itemEntity, DELAYED_PICKUP_ACTION_ID, timeToPickUp); <END> }</code><technical_language>consider setting game time this component pick-up-able. test collision if game time is greater time saved moving parts setting flag (you need delayed action anymore)</technical_language>

Target:
public void onDropItemEvent(DropItemEvent event, EntityRef itemEntity, ItemComponent itemComponent) { for (Component component : itemComponent.pickupPrefab.iterateComponents()) { Component componentCopy = library.getComponentLibrary().copy(component); if (componentCopy instanceof LocationComponent) { ((LocationComponent) componentCopy).setWorldPosition(event.getPosition()); } itemEntity.addOrSaveComponent(componentCopy); } if (!itemEntity.hasComponent(LocationComponent.class)) { itemEntity.addComponent(new LocationComponent(event.getPosition())); } }
Source:
<code>@NonNull private String processLinkTextWithAlphaReferences(@NonNull String linkText) { boolean isLowercase = linkText.contains("lower"); if <START> (linkText.contains("alpha")) <END> { String[] strings = linkText.split(" "); String alphaReference = StringUtil.getAlphaStringForNumber(Integer.valueOf(strings[strings.length - 1].replace("]", ""))); alphaReference = isLowercase ? alphaReference.toLowerCase() : alphaReference; return getContext().getString(R.string.add_square_brackets_to_string, alphaReference); } return linkText; }</code><technical_language>If check for "alpha " (with a space), automatically avoid a crash relying a space for splitting string below</technical_language>

Target:
@NonNull private String processLinkTextWithAlphaReferences(@NonNull String linkText) { boolean isLowercase = linkText.contains("lower"); if (linkText.contains("alpha ")) { String[] strings = linkText.split(" "); String alphaReference = StringUtil.getBase26String(Integer.valueOf(strings[strings.length - 1].replace("]", "")) - 1); alphaReference = isLowercase ? alphaReference.toLowerCase() : alphaReference; return getContext().getString(R.string.add_square_brackets_to_string, alphaReference); } return linkText; }
Source:
<code>private StorageDevice getStorageDevices(Map<String, Object> map) { StorageDevice storageDevice = new StorageDevice(); storageDevice.setName(map.get(NAME).toString()); storageDevice.setSize((long) (map.containsKey(SIZE) ? Double.valueOf(map.get(SIZE).toString()) : 0)); storageDevice.setDevPath(map.containsKey(DEV_PATH) ? map.get(DEV_PATH).toString() : null); storageDevice.setCanCreateBrick(map.containsKey(CREATE_BRICK) ? Boolean.valueOf(map.get(CREATE_BRICK).toString()) : Boolean.FALSE); <START> storageDevice.setFsType(map.containsKey(FILE_SYSTEM_TYPE) && !map.get(FILE_SYSTEM_TYPE).toString().isEmpty() ? map.get(FILE_SYSTEM_TYPE) <END> .toString() : null); storageDevice.setMountPoint(map.containsKey(MOUNT_POINT) && !map.get(MOUNT_POINT).toString().isEmpty() ? map.get(MOUNT_POINT) .toString() : null); storageDevice.setDevUuid(map.containsKey(DEV_UUID) && !map.get(DEV_UUID).toString().isEmpty() ? map.get(DEV_UUID) .toString() : null); storageDevice.setFsUuid(map.containsKey(UUID) && !map.get(UUID).toString().isEmpty() ? map.get(UUID) .toString() : null); storageDevice.setDescription(map.containsKey(MODEL) ? map.get(MODEL).toString() : null); storageDevice.setDevType(map.containsKey(BUS) && !map.get(BUS).toString().isEmpty() ? map.get(BUS).toString() : null); return storageDevice; }</code><technical_language>StringUtils.isBlank</technical_language>

Target:
private StorageDevice getStorageDevices(Map<String, Object> map) { StorageDevice storageDevice = new StorageDevice(); storageDevice.setName(map.get(NAME).toString()); storageDevice.setSize((long) (map.containsKey(SIZE) ? Double.valueOf(map.get(SIZE).toString()) : 0)); storageDevice.setDevPath(map.containsKey(DEV_PATH) ? map.get(DEV_PATH).toString() : null); storageDevice.setCanCreateBrick(map.containsKey(CREATE_BRICK) ? Boolean.valueOf(map.get(CREATE_BRICK).toString()) : Boolean.FALSE); storageDevice.setFsType(map.containsKey(FILE_SYSTEM_TYPE) && !StringUtils.isBlank(map.get(FILE_SYSTEM_TYPE).toString()) ? map.get(FILE_SYSTEM_TYPE) .toString() : null); storageDevice.setMountPoint(map.containsKey(MOUNT_POINT) && !StringUtils.isBlank(map.get(MOUNT_POINT).toString()) ? map.get(MOUNT_POINT) .toString() : null); storageDevice.setDevUuid(map.containsKey(DEV_UUID) && !StringUtils.isBlank(map.get(DEV_UUID).toString()) ? map.get(DEV_UUID) .toString() : null); storageDevice.setFsUuid(map.containsKey(UUID) && !StringUtils.isBlank(map.get(UUID).toString()) ? map.get(UUID) .toString() : null); storageDevice.setDescription(map.containsKey(MODEL) ? map.get(MODEL).toString() : null); storageDevice.setDevType(map.containsKey(BUS) && !StringUtils.isBlank(map.get(BUS).toString()) ? map.get(BUS) .toString() : null); return storageDevice; }
Source:
<code>public void onBeforeWrite(RepositoryStreamWriteContext ctx) throws IOException { RepositoryPath repositoryPath = (RepositoryPath) ctx.getPath(); logger.debug(String.format("Writing [%s]", repositoryPath)); if (!RepositoryFiles.isArtifact(repositoryPath)) { return; } <START> RepositoryData repository = repositoryPath.getRepository(); <END> String storageId = repository.getStorage().getId(); String repositoryId = repository.getId(); ArtifactEntry artifactEntry = provideArtifactEntry(repositoryPath); if (!shouldStoreArtifactEntry(artifactEntry)) { return; } artifactEntry.setStorageId(storageId); artifactEntry.setRepositoryId(repositoryId); ArtifactCoordinates coordinates = RepositoryFiles.readCoordinates(repositoryPath); artifactEntry.setArtifactCoordinates(coordinates); Date now = new Date(); artifactEntry.setCreated(now); artifactEntry.setLastUpdated(now); artifactEntry.setLastUsed(now); repositoryPath.artifactEntry = artifactEntry; }</code><technical_language>This sort of breaks naming convention, if I mean, in a I get it..</technical_language>

Target:
public void onBeforeWrite(RepositoryStreamWriteContext ctx) throws IOException { RepositoryPath repositoryPath = (RepositoryPath) ctx.getPath(); logger.debug(String.format("Writing [%s]", repositoryPath)); if (!RepositoryFiles.isArtifact(repositoryPath)) { return; } Repository repository = repositoryPath.getRepository(); String storageId = repository.getStorage().getId(); String repositoryId = repository.getId(); ArtifactEntry artifactEntry = provideArtifactEntry(repositoryPath); if (!shouldStoreArtifactEntry(artifactEntry)) { return; } artifactEntry.setStorageId(storageId); artifactEntry.setRepositoryId(repositoryId); ArtifactCoordinates coordinates = RepositoryFiles.readCoordinates(repositoryPath); artifactEntry.setArtifactCoordinates(coordinates); Date now = new Date(); artifactEntry.setCreated(now); artifactEntry.setLastUpdated(now); artifactEntry.setLastUsed(now); repositoryPath.artifactEntry = artifactEntry; }
Source:
<code>protected void executeCommand() { for (Guid templateGuid : getTemplatesList()) { <START> if (getTagId() != null <END> && DbFacade.getInstance().getTagDao().getTagTemplateByTagIdAndByTemplateId(getTagId(), templateGuid) != null) { VmTemplate template = DbFacade.getInstance().getVmTemplateDao().get(templateGuid); if (template != null) { appendCustomValue("TemplatesNames", template.getName(), ", "); } DbFacade.getInstance().getTagDao().detachTemplateFromTag(getTagId(), templateGuid); setSucceeded(true); } } }</code><technical_language>check getTagId() != null</technical_language>

Target:
protected void executeCommand() { for (Guid templateGuid : getTemplatesList()) { if (DbFacade.getInstance().getTagDao().getTagTemplateByTagIdAndByTemplateId(getTagId(), templateGuid) != null) { VmTemplate template = DbFacade.getInstance().getVmTemplateDao().get(templateGuid); if (template != null) { appendCustomValue("TemplatesNames", template.getName(), ", "); DbFacade.getInstance().getTagDao().detachTemplateFromTag(getTagId(), templateGuid); } } } setSucceeded(true); }
Source:
<code>public SWTBotTreeItem select(final String... items) { new <START> SWTBotTree(tree).waitForEnabled(); <END> if (items.length > 1) { assertMultiSelect(); } final List<String> nodes = Arrays.asList(items); Assert.isTrue(getNodes().containsAll(nodes)); syncExec(new VoidResult() { public void run() { ArrayList<TreeItem> selection = new ArrayList<TreeItem>(); for (String item : items) { SWTBotTreeItem si = getTreeItem(item); selection.add(si.widget); } tree.setFocus(); tree.setSelection(selection.toArray(new TreeItem[selection.size()])); } }); notifySelect(); return this; }</code><technical_language>other widgets waitForEnabled(), I change for methods. worth changing in SWTBotTableItem time..</technical_language>

Target:
public SWTBotTreeItem select(final String... items) { waitForEnabled(); if (items.length > 1) { assertMultiSelect(); } final List<String> nodes = Arrays.asList(items); Assert.isTrue(getNodes().containsAll(nodes)); syncExec(new VoidResult() { public void run() { ArrayList<TreeItem> selection = new ArrayList<TreeItem>(); for (String item : items) { SWTBotTreeItem si = getTreeItem(item); selection.add(si.widget); } tree.setFocus(); tree.setSelection(selection.toArray(new TreeItem[selection.size()])); } }); notifySelect(); return this; }
Source:
<code>public static IProject[] getProjectsContaining(Repository repository, Collection<String> fileList) throws CoreException { <START> Set<IProject> result = new HashSet<IProject>(); <END> Set<File> handledPaths = new TreeSet<File>(); for (String member : fileList) { File file = new File(repository.getWorkTree(), member); if (handledPaths.contains(file)) continue; IContainer container = findContainerFast(file); if (container != null && container instanceof IProject) result.add((IProject) container); handledPaths.add(file); } return result.toArray(new IProject[result.size()]); }</code><technical_language>a LinkedHashSet get predictable order (useful result of this is shown user)</technical_language>

Target:
public static IProject[] getProjectsContaining(Repository repository, Collection<String> fileList) throws CoreException { Set<IProject> result = new LinkedHashSet<IProject>(); File workTree = repository.getWorkTree(); for (String member : fileList) { File file = new File(workTree, member); IContainer container = findContainerFast(file); if (container instanceof IProject) result.add((IProject) container); } return result.toArray(new IProject[result.size()]); }
Source:
<code>public void addToEmitMsgs(long offset) { this.emittedOffsets.add(offset); <START> this.latestEmittedOffset = offset; <END> }</code><technical_language>I this works. This set latest emitted offset offset emitted. I want highest offset emitted</technical_language>

Target:
public void addToEmitMsgs(long offset) { this.emittedOffsets.add(offset); this.latestEmittedOffset = Math.max(latestEmittedOffset, offset); }
Source:
<code>private void initMethods(Module moduleObject, JavaScriptModule module) throws ScriptException { String name = null; String className = null; String attribute; JavaScriptMethod method; List methodsList = moduleObject.getMethods(); Iterator itr = methodsList.iterator(); while (itr.hasNext()) { try { Method methodObject = (Method) itr.next(); name = methodObject.getName(); className = methodObject.getClassName(); attribute = methodObject.getReadOnly(); method = new JavaScriptMethod(name); method.setClazz(Class.forName(className)); method.setMethodName(name); if (attribute != null) { <START> method.setAttribute(("true".equals(attribute)) ? <END> ScriptableObject.READONLY : ScriptableObject.PERMANENT); } module.addMethod(method); } catch (ClassNotFoundException e) { String msg = "Error registering method. Class cannot be found, name : " + name + ", class : " + className; log.error(msg, e); } } }</code><technical_language>string equals evaluate a boolean</technical_language>

Target:
private void initMethods(Module moduleObject, JavaScriptModule module) throws ScriptException { String name = null; String className = null; String attribute; JavaScriptMethod method; List methodsList = moduleObject.getMethods(); Iterator itr = methodsList.iterator(); while (itr.hasNext()) { try { Method methodObject = (Method) itr.next(); name = methodObject.getName(); className = methodObject.getClassName(); attribute = methodObject.getReadOnly(); method = new JavaScriptMethod(name); method.setClazz(Class.forName(className)); method.setMethodName(name); if (attribute != null) { method.setAttribute((Boolean.parseBoolean(attribute) == true) ? ScriptableObject.READONLY : ScriptableObject.PERMANENT); } module.addMethod(method); } catch (ClassNotFoundException e) { String msg = "Error registering method. Class cannot be found, name : " + name + ", class : " + className; log.error(msg, e); } } }
Source:
<code>private String generateExceptionMessage(Throwable error) { String message = error.getMessage(); while (error.getCause() != null) { if (error.getCause() instanceof SSLHandshakeException) { <START> message = "SAP Web IDE is not configured to trust the security certificate provided by the Git server."; <END> break; } else if (error.getCause() instanceof IOException) { if (message != null && message.startsWith(FILE_NAME_TOO_LONG)) { try { String repoPath = repository.getWorkTree().getCanonicalPath(); int startIndex = message.indexOf(repoPath); int endIndex = message.indexOf(","); if (startIndex > -1 && endIndex > -1) { message = FILE_NAME_TOO_LONG + " " + message.substring(startIndex + repoPath.length(), endIndex); } break; } catch (IOException e1) { } } } error = error.getCause(); } return message; }</code><technical_language>"SAP Web IDE is configured</technical_language>

Target:
private String generateExceptionMessage(Throwable error) { String message = error.getMessage(); while (error.getCause() != null) { if (error.getCause() instanceof SSLHandshakeException) { message = "The system is not configured to trust the security certificate provided by the Git server"; break; } else if (error.getCause() instanceof IOException) { if (message != null && message.startsWith(FILE_NAME_TOO_LONG_ERROR_PREFIX)) { try { String repoPath = repository.getWorkTree().getCanonicalPath(); int startIndex = message.indexOf(repoPath); int endIndex = message.indexOf(","); if (startIndex > -1 && endIndex > -1) { message = FILE_NAME_TOO_LONG_ERROR_PREFIX + " " + message.substring(startIndex + repoPath.length(), endIndex); } break; } catch (IOException e) { } } } error = error.getCause(); } return message; }
Source:
<code>public static void main(String[] args) throws Exception { Crypto crypto = Crypto.initJava(); NetworkAccess network = NetworkAccess.buildJava(new URL("<LINK_0>")).get(); String username = args[0]; String fromPath = args[1]; String toPath = args[2]; Console console = System.console(); String password = new String(console.readPassword("Enter password for " + username + ":")); UserContext context = UserContext.signIn(username, password, network, crypto).get(); ForkJoinPool pool = new ForkJoinPool(50); long t1 = System.currentTimeMillis(); uploadTo(context, Paths.get(fromPath), toPath, context.fragmenter(), props -> true, pool); long t2 = System.currentTimeMillis(); <START> LOG.info("Upload took " + (t2-t1) + " mS"); <END> }</code><technical_language>cmd app</technical_language>

Target:
public static void main(String[] args) throws Exception { Crypto crypto = Crypto.initJava(); NetworkAccess network = NetworkAccess.buildJava(new URL("<LINK_0>")).get(); String username = args[0]; String fromPath = args[1]; String toPath = args[2]; Console console = System.console(); String password = new String(console.readPassword("Enter password for " + username + ":")); UserContext context = UserContext.signIn(username, password, network, crypto).get(); ForkJoinPool pool = new ForkJoinPool(50); long t1 = System.currentTimeMillis(); uploadTo(context, Paths.get(fromPath), toPath, context.fragmenter(), props -> true, pool); long t2 = System.currentTimeMillis(); System.out.println("Upload took " + (t2-t1) + " mS"); }
Source:
<code>public void refreshStorageDevicesFromServers(List<VDS> upServers) { List<Callable<Pair<VDS, List<StorageDevice>>>> storageDevicesListCalls = new ArrayList<>(); for (final VDS server : upServers) { storageDevicesListCalls.add(new Callable<Pair<VDS, List<StorageDevice>>>() { @Override public Pair<VDS, List<StorageDevice>> call() throws Exception { List<StorageDevice> storageDevices = getStorageDevicesFromServer(server); return new Pair<VDS, List<StorageDevice>>(server, storageDevices); } }); } <START> if (storageDevicesListCalls != null) { <END> List<Pair<VDS, List<StorageDevice>>> storageDevices = ThreadPoolUtil.invokeAll(storageDevicesListCalls); for (Pair<VDS, List<StorageDevice>> pair : storageDevices) { if (pair.getSecond() != null) { updateStorageDevices(pair.getFirst(), pair.getSecond()); } } } }</code><technical_language>if (!storageDevicesListCalls.isEmpty()) storageDevices != null</technical_language>

Target:
public void refreshStorageDevicesFromServers(List<VDS> upServers) { List<Callable<Pair<VDS, List<StorageDevice>>>> storageDevicesListCalls = new ArrayList<>(); for (final VDS server : upServers) { storageDevicesListCalls.add(new Callable<Pair<VDS, List<StorageDevice>>>() { @Override public Pair<VDS, List<StorageDevice>> call() throws Exception { List<StorageDevice> storageDevices = getStorageDevicesFromServer(server); return new Pair<VDS, List<StorageDevice>>(server, storageDevices); } }); } if (!storageDevicesListCalls.isEmpty()) { List<Pair<VDS, List<StorageDevice>>> storageDevices = ThreadPoolUtil.invokeAll(storageDevicesListCalls); for (Pair<VDS, List<StorageDevice>> pair : storageDevices) { if (pair.getSecond() != null) { updateStorageDevices(pair.getFirst(), pair.getSecond()); } } } }
Source:
<code>public void postImport(IProgressMonitor monitor, ResourcesManager resManager, ImportItem[] importedItemRecords) { if (importedItemRecords == null) { return; } <START> for (final ImportItem importItem : importedItemRecords) { <END> try { getItem(importItem).ifPresent(processItem -> { migrateItem(processItem); }); } catch (Exception e) { ExceptionHandler.process(e); } } }</code><technical_language>I job migrations moved TaCoKitImportHandler.java? need add RepositoryUpdateManager.updateDBConnection(connectionItem, version, false, false); here</technical_language>

Target:
public void postImport(IProgressMonitor monitor, ResourcesManager resManager, ImportItem[] importedItemRecords) { if (importedItemRecords == null) { return; } for (final ImportItem importItem : importedItemRecords) { try { Optional<ProcessItem> processItem = getItem(importItem); if (processItem.isPresent()) { manager.checkProcessItemMigration(processItem.get(), monitor); } } catch (Exception e) { ExceptionHandler.process(e); } } }