auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static List<SimpleInterval> fixTargetSegmentStarts(final List<SimpleInterval> targetSegments, final TargetCollection<? extends Locatable> targets) { Utils.nonNull(targetSegments, "The list of target segments cannot be null."); Utils.nonNull(targets, "The collection of targets cannot be null."); final List<SimpleInterval> targetSegmentsFixed = new ArrayList<>(); for (final SimpleInterval segment : targetSegments) { try { final Locatable firstTarget = targets.targets(segment).get(0); <START> if (firstTarget.getEnd() == segment.getStart()) { <END> targetSegmentsFixed.add( new SimpleInterval(segment.getContig(), firstTarget.getStart(), segment.getEnd())); } } catch (final IndexOutOfBoundsException ex) { throw new IllegalArgumentException("List of targets and segments do not correspond."); } } return targetSegmentsFixed; }</code><technical_language>is if necessary</technical_language>

Target:
public static List<SimpleInterval> fixTargetSegmentStarts(final List<SimpleInterval> targetSegments, final TargetCollection<? extends Locatable> targets) { Utils.nonNull(targetSegments, "The list of target segments cannot be null."); Utils.nonNull(targets, "The collection of targets cannot be null."); final List<SimpleInterval> targetSegmentsFixed = new ArrayList<>(); for (final SimpleInterval segment : targetSegments) { try { final Locatable firstTarget = targets.targets(segment).get(0); if (firstTarget.getEnd() == segment.getStart()) { targetSegmentsFixed.add( new SimpleInterval(segment.getContig(), firstTarget.getStart(), segment.getEnd())); } else { throw new IllegalArgumentException("List of targets and segments do not correspond."); } } catch (final IndexOutOfBoundsException ex) { throw new IllegalArgumentException("List of targets and segments do not correspond."); } } return targetSegmentsFixed; }
Source:
<code>public static List<Part> createParts(int numParts) { <START> List<Part> result = new ArrayList<Part>(); <END> for (int i = 0; i < numParts; i++) { Part p = new Part(); p.setMd5("md5"); p.setPartNumber(i + 1); p.setPartSize(1000); result.add(p); } return result; }</code><technical_language>ImmutableList</technical_language>

Target:
public static List<Part> createParts(int numParts) { ImmutableList.Builder<Part> builder = ImmutableList.builder(); for (int i = 0; i < numParts; i++) { val p = new Part(); p.setMd5("md5"); p.setPartNumber(i + 1); p.setPartSize(1000); builder.add(p); } return builder.build(); }
Source:
<code>public void dispatch( DummyRequest dummyRequest, long commandIndex, Consumer<Result> callback ) { if ( benchmarkMachine != null ) { benchmarkMachine.applyCommand( dummyRequest, commandIndex, callback ); <START> } <END> }</code><technical_language>If benchmarkMachine null, Optional<BenchmarkMachine></technical_language>

Target:
public void dispatch( DummyRequest dummyRequest, long commandIndex, Consumer<Result> callback ) { benchmarkMachine.applyCommand( dummyRequest, commandIndex, callback ); }
Source:
<code>protected TaskManager createTaskManagerImpl(TaskConfiguration taskConfig) { WayKeyValueFilter wayKeyValueFilter; <START> if (doesArgumentExist(taskConfig, ARG_KEY_VALUE_LIST)) { <END> String keyValueList = getStringArgument(taskConfig, ARG_KEY_VALUE_LIST, "highway.motorway,highway.motorway_link,highway.trunk,highway.trunk_link"); wayKeyValueFilter = new WayKeyValueFilter(keyValueList); } else { String keyValueListFile = getStringArgument(taskConfig, ARG_KEY_VALUE_LIST_File); wayKeyValueFilter = new WayKeyValueFilter(new File(keyValueListFile)); } return new SinkSourceManager( taskConfig.getId(), wayKeyValueFilter, taskConfig.getPipeArgs() ); }</code><technical_language>logic is messed up. default if doesArgumentExist(...) evaluates true. needs done default, though</technical_language>

Target:
protected TaskManager createTaskManagerImpl(TaskConfiguration taskConfig) { WayKeyValueFilter wayKeyValueFilter; if (doesArgumentExist(taskConfig, ARG_KEY_VALUE_LIST)) { String keyValueList = getStringArgument(taskConfig, ARG_KEY_VALUE_LIST); wayKeyValueFilter = new WayKeyValueFilter(keyValueList); } else if (doesArgumentExist(taskConfig, ARG_KEY_VALUE_LIST_FILE)) { String keyValueListFile = getStringArgument(taskConfig, ARG_KEY_VALUE_LIST_FILE); wayKeyValueFilter = new WayKeyValueFilter(new File(keyValueListFile)); } else { String keyValueList = getDefaultStringArgument(taskConfig, "highway.motorway,highway.motorway_link,highway.trunk,highway.trunk_link"); wayKeyValueFilter = new WayKeyValueFilter(keyValueList); } return new SinkSourceManager( taskConfig.getId(), wayKeyValueFilter, taskConfig.getPipeArgs() ); }
Source:
<code>public void setHeaderLevel(int headerLevel) { <START> header.setHeaderLevel(headerLevel); <END> }</code><technical_language>getLable.setHeaderLevel(headerLevel)</technical_language>

Target:
public void setHeaderLevel(int headerLevel) { getLabel().setHeaderLevel(headerLevel); }
Source:
<code>public void assertBadRequestResponseIfPatchingMerchantIdWithNoGatewayAccountCredentials() throws JsonProcessingException { String accountIdWithoutGatewayAccountCredentials = extractGatewayAccountId(createAGatewayAccountFor(testContext.getPort(), "worldpay")); String payload = new ObjectMapper().writeValueAsString(ImmutableMap.of("op", "add", "path", "credentials/gateway_merchant_id", "value", "1234abc")); given().port(testContext.getPort()).contentType(JSON) .body(payload) .patch("/v1/api/accounts/" + accountIdWithoutGatewayAccountCredentials) .then() <START> .assertThat() <END> .statusCode(HttpStatus.SC_BAD_REQUEST); }</code><technical_language>need this assertThat line</technical_language>

Target:
public void assertBadRequestResponseIfPatchingMerchantIdWithNoGatewayAccountCredentials() throws JsonProcessingException { String accountIdWithoutGatewayAccountCredentials = extractGatewayAccountId(createAGatewayAccountFor(testContext.getPort(), "worldpay")); String payload = new ObjectMapper().writeValueAsString(ImmutableMap.of("op", "add", "path", "credentials/gateway_merchant_id", "value", "1234abc")); given().port(testContext.getPort()).contentType(JSON) .body(payload) .patch("/v1/api/accounts/" + accountIdWithoutGatewayAccountCredentials) .then() .body("message", is("Account Credentials are required to set a Gateway Merchant ID")) .and() .statusCode(HttpStatus.SC_BAD_REQUEST); }
Source:
<code>private String formConflictsMessage(List<String> conflicts) { if (conflicts != null && conflicts.size() > 0) { StringBuilder conflictsMessage = new StringBuilder(constant.revertedConflicts()); for (String conflict : conflicts) { <START> conflictsMessage.append(" " + conflict + "\n"); <END> } return conflictsMessage.toString(); } return ""; }</code><technical_language>conflictsMessage.append(" ").append(conflict).append("\n");</technical_language>

Target:
private String formConflictsMessage(List<String> conflicts) { if (conflicts != null && conflicts.size() > 0) { StringBuilder conflictsMessage = new StringBuilder(constant.revertedConflicts()); for (String conflict : conflicts) { conflictsMessage.append(" ").append(conflict).append("\n"); } return conflictsMessage.toString(); } return ""; }
Source:
<code>BugsnagException(@NonNull Throwable exc) { super(exc.getMessage()); if (exc instanceof BugsnagException) { this.message = ((BugsnagException) exc).getMessage(); this.name = ((BugsnagException) exc).getName(); this.type = ((BugsnagException) exc).getType(); <START> } else if (exc instanceof JsonStream.Streamable) { <END> this.streamable = (JsonStream.Streamable) exc; } else { this.name = exc.getClass().getName(); } setStackTrace(exc.getStackTrace()); initCause(exc.getCause()); this.customStackframes = null; }</code><technical_language>conditional case lossy. If exc instanceof BugsnagException wraps a streamable, streamable content lost. However, BugsnagException is instance of Streamable directly</technical_language>

Target:
BugsnagException(@NonNull Throwable exc) { super(exc.getMessage()); if (exc instanceof JsonStream.Streamable) { this.streamable = (JsonStream.Streamable) exc; this.name = ""; } else { this.name = exc.getClass().getName(); } setStackTrace(exc.getStackTrace()); initCause(exc.getCause()); this.customStackframes = null; }
Source:
<code>public String getReportFileNamePrefix() { if (ObjectUtils.isNull(reportFileNamePrefix)) { setReportFileNamePrefix(getPaymentWorksBatchUtilityService().retrievePaymentWorksParameterValue(PaymentWorksParameterConstants.PAYMENTWORKS_PAYEE_ACH_REPORT_FILE_NAME_PREFIX)); <START> LOG.info("getReportFileNamePrefix just set reportFileNamePrefix to param value=" +getPaymentWorksBatchUtilityService().retrievePaymentWorksParameterValue(PaymentWorksParameterConstants.PAYMENTWORKS_PAYEE_ACH_REPORT_FILE_NAME_PREFIX)+ "="); <END> } else { LOG.info("getReportFileNamePrefix sees reportFileNamePrefix as null =" + reportFileNamePrefix + "="); } return reportFileNamePrefix; }</code><technical_language>Some spacing is needed signs. Also, replace literal "=" a reference CUKFSConstants.EQUALS_SIGN instead. (Alternatively, do need trailing "=", removed?)</technical_language>

Target:
public String getReportFileNamePrefix() { if (ObjectUtils.isNull(reportFileNamePrefix)) { setReportFileNamePrefix(getPaymentWorksBatchUtilityService().retrievePaymentWorksParameterValue(PaymentWorksParameterConstants.PAYMENTWORKS_PAYEE_ACH_REPORT_FILE_NAME_PREFIX)); LOG.info("getReportFileNamePrefix: just set reportFileNamePrefix to param value = " + getPaymentWorksBatchUtilityService().retrievePaymentWorksParameterValue(PaymentWorksParameterConstants.PAYMENTWORKS_PAYEE_ACH_REPORT_FILE_NAME_PREFIX)); } else { LOG.info("getReportFileNamePrefix: sees reportFileNamePrefix as = " + reportFileNamePrefix); } return reportFileNamePrefix; }
Source:
<code>public WARCRecordInfo buildRecord(CrawlURI curi, URI concurrentTo) throws IOException { final String timestamp = ArchiveUtils.getLog14Date(curi.getFetchBeginTime()); WARCRecordInfo recordInfo = new WARCRecordInfo(); recordInfo.setRecordId(generateRecordID()); recordInfo.addExtraHeader(HEADER_KEY_CONCURRENT_TO, <START> '<' + concurrentTo.toString() + '>'); <END> recordInfo.setType(WARCRecordType.response); recordInfo.setUrl(curi.toString()); recordInfo.setCreate14DigitDate(timestamp); recordInfo.setMimetype(curi.getContentType()); recordInfo.setContentLength(curi.getRecorder().getRecordedInput().getSize()); recordInfo.setEnforceLength(true); String ip = (String)curi.getData().get(A_DNS_SERVER_IP_LABEL); if (ip != null && ip.length() > 0) { recordInfo.addExtraHeader(HEADER_KEY_IP, ip); } ReplayInputStream ris = curi.getRecorder().getRecordedInput().getReplayInputStream(); recordInfo.setContentStream(ris); return recordInfo; }</code><technical_language>I this throw NullPointerException if config is changed remove FtpControlRecord</technical_language>

Target:
public WARCRecordInfo buildRecord(CrawlURI curi, URI concurrentTo) throws IOException { final String timestamp = ArchiveUtils.getLog14Date(curi.getFetchBeginTime()); WARCRecordInfo recordInfo = new WARCRecordInfo(); recordInfo.setRecordId(generateRecordID()); if (concurrentTo != null) { recordInfo.addExtraHeader(HEADER_KEY_CONCURRENT_TO, '<' + concurrentTo.toString() + '>'); } recordInfo.setType(WARCRecordType.response); recordInfo.setUrl(curi.toString()); recordInfo.setCreate14DigitDate(timestamp); recordInfo.setMimetype(curi.getContentType()); recordInfo.setContentLength(curi.getRecorder().getRecordedInput().getSize()); recordInfo.setEnforceLength(true); String ip = (String)curi.getData().get(A_DNS_SERVER_IP_LABEL); if (ip != null && ip.length() > 0) { recordInfo.addExtraHeader(HEADER_KEY_IP, ip); } ReplayInputStream ris = curi.getRecorder().getRecordedInput().getReplayInputStream(); recordInfo.setContentStream(ris); return recordInfo; }
Source:
<code>private SweepResults runInternal( TableReference tableRef, SweepBatchConfig batchConfig, byte[] startRow, RunType runType) { <START> Stopwatch watch = Stopwatch.createStarted(); <END> Preconditions.checkNotNull(tableRef, "tableRef cannot be null"); Preconditions.checkState(!AtlasDbConstants.hiddenTables.contains(tableRef)); if (tableRef.getQualifiedName().startsWith(AtlasDbConstants.NAMESPACE_PREFIX)) { log.warn("The sweeper should not be run on tables passed through namespace mapping."); return SweepResults.createEmptySweepResult(); } if (keyValueService.getMetadataForTable(tableRef).length == 0) { log.warn("The sweeper tried to sweep table '{}', but the table does not exist. Skipping table.", LoggingArgs.tableRef("tableRef", tableRef)); return SweepResults.createEmptySweepResult(); } SweepStrategy sweepStrategy = sweepStrategyManager.get().getOrDefault(tableRef, SweepStrategy.CONSERVATIVE); Optional<Sweeper> sweeper = Sweeper.of(sweepStrategy); if (!sweeper.isPresent()) { return SweepResults.createEmptySweepResult(); } return doRun(tableRef, batchConfig, startRow, runType, sweeper.get(), watch); }</code><technical_language>happy push this doRun beside logging starting. This is actual sweep work is done means start stop StopWatch match end of a single method</technical_language>

Target:
private SweepResults runInternal( TableReference tableRef, SweepBatchConfig batchConfig, byte[] startRow, RunType runType) { Preconditions.checkNotNull(tableRef, "tableRef cannot be null"); Preconditions.checkState(!AtlasDbConstants.hiddenTables.contains(tableRef)); if (tableRef.getQualifiedName().startsWith(AtlasDbConstants.NAMESPACE_PREFIX)) { log.warn("The sweeper should not be run on tables passed through namespace mapping."); return SweepResults.createEmptySweepResultWithNoMoreToSweep(); } if (keyValueService.getMetadataForTable(tableRef).length == 0) { log.warn("The sweeper tried to sweep table '{}', but the table does not exist. Skipping table.", LoggingArgs.tableRef("tableRef", tableRef)); return SweepResults.createEmptySweepResultWithNoMoreToSweep(); } SweepStrategy sweepStrategy = sweepStrategyManager.get().getOrDefault(tableRef, SweepStrategy.CONSERVATIVE); Optional<Sweeper> sweeper = Sweeper.of(sweepStrategy); if (!sweeper.isPresent()) { return SweepResults.createEmptySweepResultWithNoMoreToSweep(); } return doRun(tableRef, batchConfig, startRow, runType, sweeper.get()); }
Source:
<code>public void onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); <START> mOptionsMenu = menu; <END> if (!isAdded() || getPageActivity().isSearching()) { return; } MenuItem otherLangItem = menu.findItem(R.id.menu_page_other_languages); MenuItem findInPageItem = menu.findItem(R.id.menu_page_find_in_page); MenuItem contentIssues = menu.findItem(R.id.menu_page_content_issues); MenuItem similarTitles = menu.findItem(R.id.menu_page_similar_titles); MenuItem themeChooserItem = menu.findItem(R.id.menu_page_font_and_theme); if (otherLangItem == null) { L.logRemoteErrorIfProd(new RuntimeException("onPrepareOptionsMenu called with empty menu.")); return; } if (pageLoadStrategy.isLoading() || errorState) { otherLangItem.setEnabled(false); findInPageItem.setEnabled(false); contentIssues.setEnabled(false); similarTitles.setEnabled(false); themeChooserItem.setEnabled(false); } else { otherLangItem.setVisible(model.getPage() != null && model.getPage().getPageProperties().getLanguageCount() != 0); otherLangItem.setEnabled(true); findInPageItem.setEnabled(true); updateMenuPageInfo(menu); themeChooserItem.setEnabled(true); } }</code><technical_language>I a similar means update menu dbrant pointed out I invalidate menu. I recommend approach avoid NullPointerExceptions, device quirks, extra state. Add a method like: private void invalidateOptionsMenu() { if (getActivity() != null) { getActivity().supportInvalidateOptionsMenu(); } } call toggling play state. If another method calls tts.speak / stop invalidateOptionsMenu, UI state audio state in sync</technical_language>

Target:
public void onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); if (!isAdded() || getPageActivity().isSearching()) { return; } MenuItem otherLangItem = menu.findItem(R.id.menu_page_other_languages); MenuItem findInPageItem = menu.findItem(R.id.menu_page_find_in_page); MenuItem contentIssues = menu.findItem(R.id.menu_page_content_issues); MenuItem similarTitles = menu.findItem(R.id.menu_page_similar_titles); MenuItem themeChooserItem = menu.findItem(R.id.menu_page_font_and_theme); if (otherLangItem == null) { L.logRemoteErrorIfProd(new RuntimeException("onPrepareOptionsMenu called with empty menu.")); return; } if (pageLoadStrategy.isLoading() || errorState) { otherLangItem.setEnabled(false); findInPageItem.setEnabled(false); contentIssues.setEnabled(false); similarTitles.setEnabled(false); themeChooserItem.setEnabled(false); } else { otherLangItem.setVisible(model.getPage() != null && model.getPage().getPageProperties().getLanguageCount() != 0); otherLangItem.setEnabled(true); findInPageItem.setEnabled(true); updateMenuPageInfo(menu); themeChooserItem.setEnabled(true); } }
Source:
<code>void shouldFailOnDeleteByEntityWithWrongVersion(@Autowired VersionedThingWithAssignedIdRepository repository) { try (Session session = driver.session()) { session.writeTransaction(tx -> { <START> tx.run("CREATE (v:VersionedThingWithAssignedId {id:1, myVersion:2})").consume(); return null; <END> }); } StepVerifier.create(repository.findById(1L) .flatMap(thing -> { thing.setMyVersion(3L); return repository.delete(thing); })).verifyError(OptimisticLockingFailureException.class); }</code><technical_language>suggestion return tx.run("CREATE (v:VersionedThingWithAssignedId {id:1, myVersion:2})").consume();</technical_language>

Target:
void shouldFailOnDeleteByEntityWithWrongVersion(@Autowired VersionedThingWithAssignedIdRepository repository) { try (Session session = driver.session()) { session.writeTransaction(tx -> tx.run("CREATE (v:VersionedThingWithAssignedId {id:1, myVersion:2})").consume()); } StepVerifier.create(repository.findById(1L) .flatMap(thing -> { thing.setMyVersion(3L); return repository.delete(thing); })).verifyError(OptimisticLockingFailureException.class); }
Source:
<code><START> public Mono<String[]> getPartitionIds() { <END> return getProperties().map(EventHubProperties::partitionIds); }</code><technical_language>I if this is more convenient a Flux<String> - people more easily convert a stream iterable</technical_language>

Target:
public Flux<String> getPartitionIds() { return getProperties().flatMapMany(properties -> Flux.fromArray(properties.partitionIds())); }
Source:
<code>public static boolean matches(String refName, String refPattern) { <START> return Pattern.matches(refPattern.replace("*", "(.*)"), refName); <END> }</code><technical_language>entire point of a pattern start ^ write logic this: if (refPattern.startsWith("^")) { return Pattern.matches(refPattern, refName); } if (refPattern.endsWith("/*")) { String prefix = refPattern.substring(0, refPattern.length() - 1); return refName.startsWith(prefix); } else { return refName.equals(refPattern); } is, regex feature is enabled if pattern starts ^, glob suffix style behavior. existing ref rules named "refs/tags/1.3/*" suddenly start matching "refs/tags/1a3/foo"</technical_language>

Target:
public static boolean matches(String refName, String refPattern) { if (refPattern.startsWith(RefRight.REGEX_PREFIX)) { return Pattern.matches(refPattern, refName); } if (refPattern.endsWith("/*")) { String prefix = refPattern.substring(0, refPattern.length() - 1); return refName.startsWith(prefix); } else { return refName.equals(refPattern); } }
Source:
<code>public float getFloat() { <START> return beNull.getAsBoolean() ? 0L : baseSelector.getFloat(); <END> }</code><technical_language>return float 0 avoid runtime conversion</technical_language>

Target:
public float getFloat() { return beNull.getAsBoolean() ? NullHandling.ZERO_FLOAT : baseSelector.getFloat(); }
Source:
<code>private void reset() { <START> allHistograms.forEach(AbstractHistogram::reset); <END> threadPool.reset(); start.set(0L); end.set(0L); responses.set(0L); messages.set(0L); minLatency.set(Long.MAX_VALUE); maxLatency.set(0L); totLatency.set(0L); maxTime.set(null, 0); sendTimes.clear(); arrivalTimes.clear(); }</code><technical_language>Histogram everywhere, replace AbstractHistogram::reset Histogram::reset</technical_language>

Target:
private void reset() { allHistograms.forEach(Histogram::reset); threadPool.reset(); start.set(0L); end.set(0L); responses.set(0L); messages.set(0L); minLatency.set(Long.MAX_VALUE); maxLatency.set(0L); totLatency.set(0L); maxTime.set(null, 0); sendTimes.clear(); arrivalTimes.clear(); }
Source:
<code>public Builder mergeFrom(io.netty.example.worldclock.WorldClockProtocol.LocalTimes other) { if (other == io.netty.example.worldclock.WorldClockProtocol.LocalTimes.getDefaultInstance()) { <START> return this; <END> } if (localTimeBuilder_ == null) { if (!other.localTime_.isEmpty()) { if (localTime_.isEmpty()) { localTime_ = other.localTime_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureLocalTimeIsMutable(); localTime_.addAll(other.localTime_); } onChanged(); } } else { if (!other.localTime_.isEmpty()) { if (localTimeBuilder_.isEmpty()) { localTimeBuilder_.dispose(); localTimeBuilder_ = null; localTime_ = other.localTime_; bitField0_ = (bitField0_ & ~0x00000001); localTimeBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getLocalTimeFieldBuilder() : null; } else { localTimeBuilder_.addAllMessages(other.localTime_); } } } this.mergeUnknownFields(other.getUnknownFields()); return this; }</code><technical_language>4 spaces</technical_language>

Target:
public Builder mergeFrom(io.netty.example.worldclock.WorldClockProtocol.LocalTimes other) { if (other == io.netty.example.worldclock.WorldClockProtocol.LocalTimes.getDefaultInstance()) return this; if (localTimeBuilder_ == null) { if (!other.localTime_.isEmpty()) { if (localTime_.isEmpty()) { localTime_ = other.localTime_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureLocalTimeIsMutable(); localTime_.addAll(other.localTime_); } onChanged(); } } else { if (!other.localTime_.isEmpty()) { if (localTimeBuilder_.isEmpty()) { localTimeBuilder_.dispose(); localTimeBuilder_ = null; localTime_ = other.localTime_; bitField0_ = (bitField0_ & ~0x00000001); localTimeBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getLocalTimeFieldBuilder() : null; } else { localTimeBuilder_.addAllMessages(other.localTime_); } } } this.mergeUnknownFields(other.getUnknownFields()); return this; }
Source:
<code><START> private ModuleMeta getModuleMeta(String moduleName, LogicalPlan dag) <END> { ModuleMeta logicalModule = dag.getModuleMeta(moduleName); if (logicalModule != null) { return logicalModule; } for (ModuleMeta m : dag.getAllModules()) { return getModuleMeta(moduleName, m.getDag()); } return null; }</code><technical_language>This logic suspect. separate private method</technical_language>

Target:
private ModuleMeta getModuleMeta(String moduleName, LogicalPlan dag) { for (ModuleMeta m : dag.getAllModules()) { if (m.getFullName().equals(moduleName)) { return m; } ModuleMeta res = getModuleMeta(moduleName, m.getDag()); if (res != null) return res; } return null; }
Source:
<code>public void initialize() throws NotificationQueueAlreadyExists { retryQueue = notificationQueueService.createNotificationQueue(DefaultServerService.SERVER_SERVICE, QUEUE_NAME, new NotificationQueueHandler() { @Override public void handleReadyNotification(final NotificationEvent notificationKey, final DateTime eventDateTime, final UUID userToken, final Long accountRecordId, final Long tenantRecordId) { if (!(notificationKey instanceof PushNotificationKey)) { log.error("Push Notification service got an unexpected notification type {}", notificationKey.getClass().getName()); return; } final PushNotificationKey key = (PushNotificationKey) notificationKey; final InternalCallContext callContext = internalCallContextFactory.createInternalCallContext(tenantRecordId, accountRecordId, retryService, CallOrigin.INTERNAL, UserType.SYSTEM, userToken); try { <START> pushNotificationListener.resendPushNotification(key, callContext); <END> } catch (JsonProcessingException e) { log.error("Failed to push notification url='{}', tenantId='{}'", key.getUrl(), key.getTenantId(), e); } } } ); }</code><technical_language>re-use doPost avoid duplicating sending code</technical_language>

Target:
public void initialize() throws NotificationQueueAlreadyExists { retryQueue = notificationQueueService.createNotificationQueue(DefaultServerService.SERVER_SERVICE, QUEUE_NAME, new NotificationQueueHandler() { @Override public void handleReadyNotification(final NotificationEvent notificationKey, final DateTime eventDateTime, final UUID userToken, final Long accountRecordId, final Long tenantRecordId) { if (!(notificationKey instanceof PushNotificationKey)) { log.error("Push Notification service got an unexpected notification type {}", notificationKey.getClass().getName()); return; } final PushNotificationKey key = (PushNotificationKey) notificationKey; try { pushNotificationListener.resendPushNotification(key); } catch (JsonProcessingException e) { log.error("Failed to push notification url='{}', tenantId='{}'", key.getUrl(), key.getTenantId(), e); } } } ); }
Source:
<code>public MoveDescription( final Collection<Unit> units, final Route route, final Map<Unit, Unit> unitsToTransports, <START> final Map<Unit, Collection<Unit>> dependentUnits) { <END> super(units); this.route = route; this.unitsToTransports = unitsToTransports; if (dependentUnits != null && !dependentUnits.isEmpty()) { this.dependentUnits = new HashMap<>(); for (final Entry<Unit, Collection<Unit>> entry : dependentUnits.entrySet()) { this.dependentUnits.put(entry.getKey(), new HashSet<>(entry.getValue())); } } else { this.dependentUnits = null; } }</code><technical_language>fault, try annotate nullable fields parameters @Nullable in new code/refactored code, nice if do explicity pass null</technical_language>

Target:
public MoveDescription( final Collection<Unit> units, final Route route, final Map<Unit, Unit> unitsToTransports, final Map<Unit, Collection<Unit>> dependentUnits) { super(units); this.route = route; this.unitsToTransports = unitsToTransports; if (!dependentUnits.isEmpty()) { this.dependentUnits = new HashMap<>(); for (final Entry<Unit, Collection<Unit>> entry : dependentUnits.entrySet()) { this.dependentUnits.put(entry.getKey(), new HashSet<>(entry.getValue())); } } else { this.dependentUnits = Map.of(); } }
Source:
<code>public HttpResponse setStatus(HttpResponseStatus status) { ObjectUtil.checkNotNull(status, "status"); <START> this.status = status; <END> return this; }</code><technical_language>nit: merge lines checkNotNull return argument</technical_language>

Target:
public HttpResponse setStatus(HttpResponseStatus status) { this.status = ObjectUtil.checkNotNull(status, "status"); return this; }
Source:
<code>public void afterCommit(final Transaction tx) { for (MessageReference ref : refsToAck) { <START> clearLingerRef(ref); <END> synchronized (ref.getQueue()) { queue.postAcknowledge(ref, reason); } } if (pagedMessagesToPostACK != null) { for (MessageReference refmsg : pagedMessagesToPostACK) { ((PagedReference)refmsg).removePendingFlag(); if (((PagedReference) refmsg).isLargeMessage()) { decrementRefCount(refmsg); } } } }</code><technical_language>dont need do this iterator. operation queue need done</technical_language>

Target:
public void afterCommit(final Transaction tx) { for (MessageReference ref : refsToAck) { clearLingerRef(ref); synchronized (ref.getQueue()) { ref.getQueue().postAcknowledge(ref, reason); } } if (pagedMessagesToPostACK != null) { for (MessageReference refmsg : pagedMessagesToPostACK) { ((PagedReference)refmsg).removePendingFlag(); if (((PagedReference) refmsg).isLargeMessage()) { decrementRefCount(refmsg); } } } }
Source:
<code>protected void onOffline() { super.onOffline(); showOfflineBar(); invalidateOptionsMenu(); <START> if(singleFragment!=null && singleFragment instanceof CourseHandoutFragment){ <END> ((CourseHandoutFragment) singleFragment).showHandoutsOffline(); } }</code><technical_language>This is a generic base class. need specific case. put this in CourseHandoutActivity</technical_language>

Target:
protected void onOffline() { super.onOffline(); showOfflineBar(); invalidateOptionsMenu(); }
Source:
<code>private void assertSavedContainer(String id) { long timeout = System.currentTimeMillis() + 15000; boolean foundContainer = false; while (!foundContainer && System.currentTimeMillis() < timeout) { try { Thread.sleep(200); <START> if (containerRepository.findOne(id2) != null) { <END> foundContainer = true; } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } assertTrue("Container repository is not updated with the test containers", foundContainer); }</code><technical_language>this "id" (the passed in)</technical_language>

Target:
private void assertSavedContainer(String id) { long timeout = System.currentTimeMillis() + 15000; boolean foundContainer = false; while (!foundContainer && System.currentTimeMillis() < timeout) { try { Thread.sleep(200); if (containerRepository.findOne(id) != null) { foundContainer = true; } } catch (InterruptedException e) { Thread.currentThread().interrupt(); break; } } assertTrue("Container repository is not updated with the test containers", foundContainer); }
Source:
<code>public List<String> getPorts() { <START> return EnvUtil.removeEmpties(ports); <END> }</code><technical_language>minor nitpick: rename removeNullEntries()</technical_language>

Target:
public List<String> getPorts() { return EnvUtil.removeEmptyEntries(ports); }
Source:
<code>int getLineHeight(int lineIndex) { LineSizeInfo line = getLineSize(lineIndex); if (line.needsRecalculateHeight()) { if (isVariableHeight(lineIndex)) { <START> return Math.round(averageLineHeight); <END> } else { line.height = getLineHeight() + getLineSpacing(lineIndex); } } return line.height; }</code><technical_language>If do that, this method return actual line height more, estimation. IMO want do this method is expected return correct in multiple places. If want deal average height, please introduce a new method suitable</technical_language>

Target:
int getLineHeight(int lineIndex) { return getLineHeight(lineIndex, true); }
Source:
<code>List<URIish> getURIs(Project.NameKey project, String urlMatch) { List<URIish> r = Lists.newArrayListWithCapacity(remote.getURIs().size()); for (URIish uri : remote.getURIs()) { if (matches(uri, urlMatch)) { String name = project.get(); if (needsUrlEncoding(uri)) { name = encode(name); } if (remoteNameStyle.equals("dash")) { name = name.replace("/", "-"); } else if(remoteNameStyle.equals("underscore")) { name = name.replace("/", "_"); } else if (remoteNameStyle.equals("basenameOnly")) { <START> int basenameStart = name.lastIndexOf("/") + 1; <END> if (name.length() > basenameStart) { name = name.substring(basenameStart); } } else if (!remoteNameStyle.equals("slash")) { ReplicationQueue.log.debug(String.format( "Unknown remoteNameStyle: %s, falling back to slash", remoteNameStyle)); } String replacedPath = ReplicationQueue.replaceName(uri.getPath(), name, isSingleProjectMatch()); if (replacedPath != null) { uri = uri.setPath(replacedPath); r.add(uri); } } } return r; }</code><technical_language>Is getBaseName org.apache.commons.io.FilenameUtils</technical_language>

Target:
List<URIish> getURIs(Project.NameKey project, String urlMatch) { List<URIish> r = Lists.newArrayListWithCapacity(remote.getURIs().size()); for (URIish uri : remote.getURIs()) { if (matches(uri, urlMatch)) { String name = project.get(); if (needsUrlEncoding(uri)) { name = encode(name); } if (remoteNameStyle.equals("dash")) { name = name.replace("/", "-"); } else if(remoteNameStyle.equals("underscore")) { name = name.replace("/", "_"); } else if (remoteNameStyle.equals("basenameOnly")) { name = FilenameUtils.getBaseName(name); } else if (!remoteNameStyle.equals("slash")) { ReplicationQueue.log.debug(String.format( "Unknown remoteNameStyle: %s, falling back to slash", remoteNameStyle)); } String replacedPath = ReplicationQueue.replaceName(uri.getPath(), name, isSingleProjectMatch()); if (replacedPath != null) { uri = uri.setPath(replacedPath); r.add(uri); } } } return r; }
Source:
<code>public void checkCommandMetadata() throws Exception { <START> try (CommandController controller = uiTestHarness.createCommandController(JPANewEntityCommandImpl.class, <END> project.getRoot())) { controller.initialize(); assertTrue(controller.getCommand() instanceof JPANewEntityCommandImpl); UICommandMetadata metadata = controller.getMetadata(); assertEquals("JPA: New Entity", metadata.getName()); assertEquals("Java EE", metadata.getCategory().getName()); assertEquals("JPA", metadata.getCategory().getSubCategory().getName()); assertFalse("Project is created, shouldn't have targetLocation", controller.hasInput("targetLocation")); assertEquals(7, controller.getInputs().size()); assertTrue(controller.hasInput("named")); assertTrue(controller.hasInput("targetPackage")); assertTrue(controller.hasInput("idStrategy")); assertTrue(controller.hasInput("tableName")); assertTrue(controller.hasInput("overwrite")); assertTrue(controller.hasInput("extends")); assertTrue(controller.hasInput("implements")); assertTrue(controller.getValueFor("targetPackage").toString().endsWith(DEFAULT_ENTITY_PACKAGE)); } }</code><technical_language>This test need changed</technical_language>

Target:
public void checkCommandMetadata() throws Exception { try (CommandController controller = uiTestHarness.createCommandController(JPANewEntityCommand.class, project.getRoot())) { controller.initialize(); assertTrue(controller.getCommand() instanceof JPANewEntityCommand); UICommandMetadata metadata = controller.getMetadata(); assertEquals("JPA: New Entity", metadata.getName()); assertEquals("Java EE", metadata.getCategory().getName()); assertEquals("JPA", metadata.getCategory().getSubCategory().getName()); assertFalse("Project is created, shouldn't have targetLocation", controller.hasInput("targetLocation")); assertEquals(7, controller.getInputs().size()); assertTrue(controller.hasInput("named")); assertTrue(controller.hasInput("targetPackage")); assertTrue(controller.hasInput("idStrategy")); assertTrue(controller.hasInput("tableName")); assertTrue(controller.hasInput("overwrite")); assertTrue(controller.hasInput("extends")); assertTrue(controller.hasInput("implements")); assertTrue(controller.getValueFor("targetPackage").toString().endsWith(DEFAULT_ENTITY_PACKAGE)); } }
Source:
<code>int process(String oid) { val entity = getEntity(oid); if (!entity.isPresent()) { throw new RuntimeException("That ain't no thang. Literally"); } val resource = createInputResource(entity); <START> SamFileBuilder bob = new SamFileBuilder(). <END> containedOnly(containedOnly). useOriginalHeader(useOriginalHeader). outputFormat(outputFormat). queries(query). outputDir(outputDir). outputIndex(outputIndex). entity(entity.get()). samInput(resource); if (headerOnly) { bob.buildHeaderOnly(); } else { switch (outputType) { case TRIMMED: bob.buildTrimmed(); break; case MINI: case CROSS: terminal.printError("Output type '%s' not implemented", outputType.toString()); break; } } return SUCCESS_STATUS; }</code><technical_language>val</technical_language>

Target:
int process(String oid) { val entity = getEntity(oid); if (!entity.isPresent()) { val msg = String.format("Metadata not found for object id %s", oid); log.error(msg); session.info(msg); throw new RuntimeException(msg); } val resource = createInputResource(entity); val bob = new SamFileBuilder(). programName(ICGC_STORAGE_CLIENT). version(VersionUtils.getScmInfo().get("git.commit.id.describe")). programId(ICGC). commandLine(getCommandLine()). containedOnly(containedOnly). useOriginalHeader(useOriginalHeader). outputFormat(outputFormat). queries(query). outputDir(outputDir). bedFile(bedFile). outputIndex(outputIndex). entity(entity.get()). stdout(stdout). samInput(resource); log.info("Constructed SamFileBuilder: " + bob.toString()); if (headerOnly) { bob.buildHeaderOnly(); } else { switch (outputType) { case TRIMMED: bob.buildTrimmed(); break; case MERGED: terminal.printError("Output type '%s' not implemented", outputType.toString()); break; case CROSS: terminal.printError("Output type '%s' not implemented", outputType.toString()); break; } } return SUCCESS_STATUS; }
Source:
<code>private void refreshHomeAndLogoutButtons() { <START> if (startButton != null) { <END> startButton.setText(Localization.get(homeMessageKey)); } if (logoutButton != null) { logoutButton.setText(Localization.get(logoutMessageKey)); } }</code><technical_language>I feel able out a lot of nullity checks. this in mind for a future refactor</technical_language>

Target:
private void refreshHomeAndLogoutButtons() { if (startButton != null) { startButton.setText(Localization.get(homeMessageKey)); } else { Logger.log(AndroidLogger.SOFT_ASSERT, "startButton was null in refreshHomeAndLogoutButtons()"); } if (logoutButton != null) { logoutButton.setText(Localization.get(logoutMessageKey)); } else { Logger.log(AndroidLogger.SOFT_ASSERT, "logoutButton was null in refreshHomeAndLogoutButtons()"); } }
Source:
<code>public void yacht() { int expected = 50; <START> assertEquals(expected, new Yacht(new int[]{ 5, 5, 5, 5, 5 }, YachtCategory.YACHT).score()); <END> }</code><technical_language>I puttting this line a bit difficult read. declaring Yacht variable line a bit easier</technical_language>

Target:
public void yacht() { Yacht yacht = new Yacht(new int[]{ 5, 5, 5, 5, 5 }, YachtCategory.YACHT); assertEquals(50, yacht.score()); }
Source:
<code>private int setEthernetTethering(boolean enable) { if (VDBG) Log.d(TAG, "setEthernetTethering(" + enable + ")"); if (mEthernetManager.isEthernetTethering()) { if (VDBG) Log.d(TAG, "Ethernet Tethering mode is on"); <START> updateConfiguration(); <END> synchronized (mPublicSync) { tetherMatchingInterfaces(enable ? IpServer.STATE_TETHERED : IpServer.STATE_AVAILABLE, TETHERING_ETHERNET); } } return TETHER_ERROR_NO_ERROR; }</code><technical_language>is purpose of updateConfiguration ?? call updateConfiguration here. updateConfiguration() is thread-safe function. mLooper thread</technical_language>

Target:
private int setEthernetTethering(boolean enable) { if (VDBG) Log.d(TAG, "setEthernetTethering(" + enable + ")"); final ContentResolver cr = mContext.getContentResolver(); if (enable && mEthernetManager.isEthernetTethering()) { Log.d(TAG, "Ethernet Tethering mode is on"); synchronized (mPublicSync) { tetherMatchingInterfaces(IpServer.STATE_TETHERED, TETHERING_ETHERNET); } } else { synchronized (mPublicSync) { tetherMatchingInterfaces(IpServer.STATE_AVAILABLE, TETHERING_ETHERNET); } } return TETHER_ERROR_NO_ERROR; }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_email_sign_up); <START> findViewById(R.id.home).setOnClickListener(new View.OnClickListener() { <END> @Override public void onClick(View v) { Intent i = new Intent(SignUpEmailActivity.this, LoginActivity.class); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(i); } }); Bundle extras = getIntent().getExtras(); KeyBoardSupport.helperHideKeyboard(findViewById(R.id.signUp), this); if (extras != null) { userAns = extras.getString("userAns"); } }</code><technical_language>please factor out a wrapper method activity</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_email_sign_up); Bundle extras = getIntent().getExtras(); KeyBoardSupport.helperHideKeyboard(findViewById(R.id.signUp), this); if (extras != null) { userAns = extras.getString("userAns"); } }
Source:
<code>public void init(){ UI ui = TestController.getUI(); panelControl = ui.getPanelControl(); testPref = UI.prefs; <START> } <END></code><technical_language>need variables all. this line 41? java List<String> boardNames = TestController.getUI().getPanelControl().getAllBoardNames(); follow this (not sure) java assertEquals(boardNames, Arrays.asList(new String[]{SAMPLE_BOARD})</technical_language>

Target:
public void init(){ panelControl = TestController.getUI().getPanelControl(); }
Source:
<code>public void test_findAllPortlets() throws LanguageException, DotDataException, SystemException { Portlet portlet = null; try { Collection<Portlet> portlets = portletApi.findAllPortlets(); portlet = createCustomPortlet("testCustomPortlet", "testCustomPortlet", "Persona", ""); <START> Assert.assertNotEquals(portlets.size(),portletApi.findAllPortlets().size()); <END> Assert.assertEquals(portlets.size()+1,portletApi.findAllPortlets().size()); }finally { if(portlet!=null){ portletApi.deletePortlet(portlet.getPortletId()); } } }</code><technical_language>This assert redundant in next line is Assert.assertEquals</technical_language>

Target:
public void test_findAllPortlets() throws LanguageException, DotDataException, SystemException { Portlet portlet = null; try { Collection<Portlet> portlets = portletApi.findAllPortlets(); portlet = createCustomPortlet("testCustomPortlet", "testCustomPortlet", "Persona", ""); Assert.assertEquals(portlets.size()+1,portletApi.findAllPortlets().size()); }finally { if(portlet!=null){ portletApi.deletePortlet(portlet.getPortletId()); } } }
Source:
<code>public synchronized List<TableId> tables() { final long timeout = 10000L; long started = System.currentTimeMillis(); long now = started; while (tables == null && now - started < timeout) { try { wait(timeout - (now - started)); } catch (InterruptedException e) { } now = System.currentTimeMillis(); } if (tables == null) { throw new ConnectException("Tables could not be updated quickly enough."); } if (!duplicates.isEmpty()) { log.info("The filtered tables are ", tables); <START> throw new ConnectException(configErrorMsg + duplicates); <END> } return tables; }</code><technical_language>do printing pairs of TableIds (e.g., a.b.Foo / a.c.Foo) dumping map. worried people map output means end of long error message</technical_language>

Target:
public synchronized List<TableId> tables() { final long timeout = 10000L; long started = System.currentTimeMillis(); long now = started; while (tables == null && now - started < timeout) { try { wait(timeout - (now - started)); } catch (InterruptedException e) { } now = System.currentTimeMillis(); } if (tables == null) { throw new ConnectException("Tables could not be updated quickly enough."); } if (!duplicates.isEmpty()) { String configText; if (whitelist != null) { configText = "'" + JdbcSourceConnectorConfig.TABLE_WHITELIST_CONFIG + "'"; } else if (blacklist != null) { configText = "'" + JdbcSourceConnectorConfig.TABLE_BLACKLIST_CONFIG + "'"; } else { configText = "'" + JdbcSourceConnectorConfig.TABLE_WHITELIST_CONFIG + "' or '" + JdbcSourceConnectorConfig.TABLE_BLACKLIST_CONFIG + "'"; } String msg = "The connector uses the unqualified table name as the topic name and has " + "detected duplicate unqualified table names. This could lead to mixed data types in " + "the topic and downstream processing errors. To prevent such processing errors, the " + "JDBC Source connector fails to start when it detects duplicate table name " + "configurations. Update the connector's " + configText + " config to include exactly " + "one table in each of the tables listed below.\n\t"; throw new ConnectException(msg + duplicates.values()); } return tables; }
Source:
<code>public KubernetesResourceManagerDriver( Configuration flinkConfig, FlinkKubeClient kubeClient, KubernetesResourceManagerDriverConfiguration configuration) { super(flinkConfig, GlobalConfiguration.loadConfiguration()); this.clusterId = configuration.getClusterId(); this.podCreationRetryInterval = configuration.getPodCreationRetryInterval(); <START> this.kubeClient = kubeClient; <END> requestResourceFutures = new HashMap<>(); podCreationCoolDown = FutureUtils.completedVoidFuture(); }</code><technical_language>add a null check here</technical_language>

Target:
public KubernetesResourceManagerDriver( Configuration flinkConfig, FlinkKubeClient kubeClient, KubernetesResourceManagerDriverConfiguration configuration) { super(flinkConfig, GlobalConfiguration.loadConfiguration()); this.clusterId = Preconditions.checkNotNull(configuration.getClusterId()); this.podCreationRetryInterval = Preconditions.checkNotNull(configuration.getPodCreationRetryInterval()); this.kubeClient = Preconditions.checkNotNull(kubeClient); this.requestResourceFutures = new HashMap<>(); this.podCreationCoolDown = FutureUtils.completedVoidFuture(); }
Source:
<code>void dumpTable(String dbName, String tblName, String validTxnList, Path dbRoot, long lastReplId, Hive hiveDb, HiveWrapper.Tuple<Table> tuple) throws Exception { TableSpec tableSpec = new TableSpec(tuple.object); TableExport.Paths exportPaths = new TableExport.Paths(work.astRepresentationForErrorMsg, dbRoot, tblName, conf, true); String distCpDoAsUser = conf.getVar(HiveConf.ConfVars.HIVE_DISTCP_DOAS_USER); tuple.replicationSpec.setIsReplace(true); if (AcidUtils.isTransactionalTable(tableSpec.tableHandle)) { tuple.replicationSpec.setValidWriteIdList(getValidWriteIdList(dbName, tblName, validTxnList)); tuple.replicationSpec.setCurrentReplicationState(String.valueOf(lastReplId)); } MmContext mmCtx = MmContext.createIfNeeded(tableSpec.tableHandle); new TableExport( exportPaths, tableSpec, tuple.replicationSpec, hiveDb, distCpDoAsUser, conf, mmCtx).write(); replLogger.tableLog(tblName, tableSpec.tableHandle.getTableType()); <START> } <END></code><technical_language>I this change, refactoring related external table replication. a separate commit, list in this pull request</technical_language>

Target:
void dumpTable(String dbName, String tblName, String validTxnList, Path dbRoot, long lastReplId, Hive hiveDb, HiveWrapper.Tuple<Table> tuple) throws Exception { TableSpec tableSpec = new TableSpec(tuple.object); TableExport.Paths exportPaths = new TableExport.Paths(work.astRepresentationForErrorMsg, dbRoot, tblName, conf, true); String distCpDoAsUser = conf.getVar(HiveConf.ConfVars.HIVE_DISTCP_DOAS_USER); tuple.replicationSpec.setIsReplace(true); if (AcidUtils.isTransactionalTable(tableSpec.tableHandle)) { tuple.replicationSpec.setValidTxnList(validTxnList); tuple.replicationSpec.setValidWriteIdList(getValidWriteIdList(dbName, tblName, validTxnList)); tuple.replicationSpec.setCurrentReplicationState(String.valueOf(lastReplId)); } MmContext mmCtx = MmContext.createIfNeeded(tableSpec.tableHandle); new TableExport( exportPaths, tableSpec, tuple.replicationSpec, hiveDb, distCpDoAsUser, conf, mmCtx).write(); replLogger.tableLog(tblName, tableSpec.tableHandle.getTableType()); }
Source:
<code>static public void cantSaveAttributeValueDialogBox(Attribute object) { String text = ""; String name = object.getDisplayName(); <START> if (object.getType().equalsIgnoreCase("java.lang.String") || object.getType().equalsIgnoreCase("java.lang.LargeString")) { <END> text = WidgetTranslation.INSTANCE.cantSaveAttributeValueDialogBoxWrongString(name); } else if (object.getType().equalsIgnoreCase("java.lang.Integer")) { text = WidgetTranslation.INSTANCE.cantSaveAttributeValueDialogBoxWrongInteger(name); } else if (object.getType().equalsIgnoreCase("java.util.ArrayList") || object.getType().equalsIgnoreCase("java.util.LargeArrayList")) { text = WidgetTranslation.INSTANCE.cantSaveAttributeValueDialogBoxWrongList(name); } else { text = WidgetTranslation.INSTANCE.cantSaveAttributeValueDialogBoxGeneral(name); } generateAlert(WidgetTranslation.INSTANCE.cantSaveAttributeValueDialogBoxHeader(), text); }</code><technical_language>I prefer constant there</technical_language>

Target:
static public void cantSaveAttributeValueDialogBox(Attribute object) { String text = ""; String name = object.getDisplayName(); if (object.getType().equalsIgnoreCase("java.lang.String") || object.getType().equalsIgnoreCase(Utils.largeStringClassName)) { text = WidgetTranslation.INSTANCE.cantSaveAttributeValueDialogBoxWrongString(name); } else if (object.getType().equalsIgnoreCase("java.lang.Integer")) { text = WidgetTranslation.INSTANCE.cantSaveAttributeValueDialogBoxWrongInteger(name); } else if (object.getType().equalsIgnoreCase("java.util.ArrayList") || object.getType().equalsIgnoreCase(Utils.largeArrayListClassName)) { text = WidgetTranslation.INSTANCE.cantSaveAttributeValueDialogBoxWrongList(name); } else { text = WidgetTranslation.INSTANCE.cantSaveAttributeValueDialogBoxGeneral(name); } generateAlert(WidgetTranslation.INSTANCE.cantSaveAttributeValueDialogBoxHeader(), text); }