auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>default boolean validateRequest(RequestMsg req, ChannelHandlerContext ctx) { HeaderMsg requestHeader = req.getHeader(); if (!requestHeader.getIgnoreEpoch() && !epochIsValid(requestHeader)) { sendWrongEpochError(requestHeader, ctx); return false; } <START> if (!requestHeader.getIgnoreClusterId()) { <END> return getCurrentLayout() .map(layout -> { final UuidMsg currentClusterID = getUuidMsg(layout.getClusterId()); if (!clusterIdIsValid(requestHeader, currentClusterID)) { sendWrongClusterError(requestHeader, ctx, currentClusterID); return false; } return true; }).orElseGet(() -> { sendNoBootstrapError(requestHeader, ctx); return false; }); } return true; }</code><technical_language>Please invert "if" condition</technical_language>

Target:
default boolean validateRequest(RequestMsg req, ChannelHandlerContext ctx) { HeaderMsg requestHeader = req.getHeader(); if (!requestHeader.getIgnoreEpoch() && !epochIsValid(requestHeader)) { sendWrongEpochError(requestHeader, ctx); return false; } if (requestHeader.getIgnoreClusterId()) { return true; } return getCurrentLayout() .map(layout -> { final UuidMsg currentClusterID = getUuidMsg(layout.getClusterId()); if (!clusterIdIsValid(requestHeader, currentClusterID)) { sendWrongClusterError(requestHeader, ctx, currentClusterID); return false; } return true; }).orElseGet(() -> { sendNoBootstrapError(requestHeader, ctx); return false; }); }
Source:
<code>public boolean uploadInputfiles(TaskFlowJob job, String localInputFolderPath) <START> throws NotConnectedException, PermissionException { <END> try { List<String> userSpaces = getUserSpaceURIs(); List<String> inputSpaces = Arrays.asList(Tools.dataSpaceConfigPropertyToUrls(job.getInputSpace())); String remotePath = extractRemotePath(userSpaces, inputSpaces); if (remotePath == null) { throw new IllegalArgumentException("Could not extract remote path using inputSpace=" + inputSpaces + " and userSpace=" + userSpaces); } String jname = job.getName(); logger.debug("Pushing files for job " + jname + " from " + localInputFolderPath + " to " + remotePath); TaskFlowJob tfj = job; for (Task t : tfj.getTasks()) { logger.debug("Pushing files for task " + t.getName()); List<String> includes = Lists.newArrayList(); List<String> excludes = Lists.newArrayList(); List<InputSelector> inputFilesList = t.getInputFilesList(); if (inputFilesList != null) { for (InputSelector is : inputFilesList) { addfileSelection(is.getInputFiles(), includes, excludes); } } LocalDirSource source = new LocalDirSource(localInputFolderPath); source.setIncludes(includes); source.setExcludes(excludes); RemoteDestination dest = new RemoteDestination(USER, remotePath); restDataSpaceClient.upload(source, dest); } logger.debug("Finished push operation from " + localInputFolderPath + " to " + remotePath); } catch (Throwable error) { throw Throwables.propagate(error); } return true; }</code><technical_language>![MINOR](<LINK_2> 'Severity: MINOR') Remove redundant '!unknownSymbol!' thrown exception declaration(s). [![rule](<LINK_1>](<LINK_0></technical_language>

Target:
public boolean uploadInputfiles(TaskFlowJob job, String localInputFolderPath) throws NotConnectedException, PermissionException { try { List<String> userSpaces = getUserSpaceURIs(); List<String> inputSpaces = Arrays.asList(Tools.dataSpaceConfigPropertyToUrls(job.getInputSpace())); String remotePath = extractRelativePath(userSpaces, inputSpaces); if (remotePath == null) { throw new IllegalArgumentException("Could not extract remote path using inputSpace=" + inputSpaces + " and userSpace=" + userSpaces); } String jname = job.getName(); logger.debug("Pushing files for job " + jname + " from " + localInputFolderPath + " to " + remotePath); TaskFlowJob tfj = job; for (Task task : tfj.getTasks()) { uploadInputFilesForTask(localInputFolderPath, remotePath, task); } logger.debug("Finished push operation from " + localInputFolderPath + " to " + remotePath); } catch (Exception error) { throw Throwables.propagate(error); } return true; }
Source:
<code>public synchronized void connect() throws IOException { try { IDeploymentConfig dc = OpenShiftServerUtils.getDeploymentConfig(server); <START> DebuggingContext debugContext = OpenShiftDebugUtils.get().getDebuggingContext(dc); <END> HashMap<String, Object> env = new HashMap<>(); env.put(JMXConnector.CREDENTIALS, new String[] { debugContext.getAdminUsername(), debugContext.getAdminPassword() }); IPod firstPod = OpenShiftDebugUtils.get().getFirstPod(dc); if (firstPod != null) { int port = getLocalAdminPort(firstPod); String url = "service:jmx:remoting-jmx://localhost:" + port; connector = factory.newJMXConnector(new JMXServiceURL(url), env); connector.connect(); connection = connector.getMBeanServerConnection(); isConnected = true; provider.fireChanged(this); } } catch (CoreException e) { throw new IOException(e); } }</code><technical_language>if dc == null</technical_language>

Target:
public synchronized void connect() throws IOException { try { IDeploymentConfig dc = OpenShiftServerUtils.getDeploymentConfig(server); if (dc != null) { DebuggingContext debugContext = OpenShiftDebugUtils.get().getDebuggingContext(dc); HashMap<String, Object> env = new HashMap<>(); env.put(JMXConnector.CREDENTIALS, new String[] { debugContext.getAdminUsername(), debugContext.getAdminPassword() }); IPod firstPod = OpenShiftDebugUtils.get().getFirstPod(dc); if (firstPod != null) { int port = getLocalAdminPort(firstPod); String url = "service:jmx:remoting-jmx://localhost:" + port; connector = factory.newJMXConnector(new JMXServiceURL(url), env); connector.connect(); connection = connector.getMBeanServerConnection(); isConnected = true; provider.fireChanged(this); } } } catch (CoreException e) { throw new IOException(e); } }
Source:
<code>public void setLastQuestion(boolean isLast) { <START> if (SHORT_APPEARANCE.equalsIgnoreCase(mPrompt.getAppearanceHint()) || isInCompactMode()) { <END> if (isLast) { mAnswer.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_ACTION_DONE); } else { mAnswer.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_ACTION_NEXT); } } }</code><technical_language>nit: nice abstract this logic in a method</technical_language>

Target:
public void setLastQuestion(boolean isLast) { if (shouldSupportIMEAction()) { if (isLast) { mAnswer.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_ACTION_DONE); } else { mAnswer.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_ACTION_NEXT); } } }
Source:
<code>void addMismatchReadFeatures(final int alignmentStart, final List<ReadFeature> features, final int fromPosInRead, final int alignmentStartOffset, final int nofReadBases, final byte[] bases, final byte[] qualityScore) { int oneBasedPositionInRead = fromPosInRead + 1; int refIndex = alignmentStart + alignmentStartOffset - 1; byte refBase; for (int i = 0; i < nofReadBases; i++, oneBasedPositionInRead++, refIndex++) { <START> if (refIndex >= refBases.length) refBase = 'N'; <END> else refBase = refBases[refIndex]; refBase = SequenceUtil.upperCase(refBase); final byte readBase = SequenceUtil.upperCase(bases[i + fromPosInRead]); if (readBase != refBase) { final boolean isSubstitution = SequenceUtil.isACGTN(readBase) && SequenceUtil.isACGTN(refBase); if (isSubstitution) { features.add(new Substitution(oneBasedPositionInRead, readBase, refBase)); } else { final byte score = qualityScore[i + fromPosInRead]; features.add(new ReadBase(oneBasedPositionInRead, readBase, score)); } } } }</code><technical_language>Is a legitimate case (other clipped bases, I represented non-substitution features) read is mapped, cigar extends end of reference</technical_language>

Target:
void addMismatchReadFeatures(final int alignmentStart, final List<ReadFeature> features, final int fromPosInRead, final int alignmentStartOffset, final int nofReadBases, final byte[] bases, final byte[] qualityScore) { int oneBasedPositionInRead = fromPosInRead + 1; int refIndex = alignmentStart + alignmentStartOffset - 1; byte refBase; for (int i = 0; i < nofReadBases; i++, oneBasedPositionInRead++, refIndex++) { if (refIndex >= refBases.length) refBase = 'N'; else refBase = refBases[refIndex]; final byte readBase = bases[i + fromPosInRead]; if (readBase != refBase) { final boolean isSubstitution = SequenceUtil.isUpperACGTN(readBase) && SequenceUtil.isUpperACGTN(refBase); if (isSubstitution) { features.add(new Substitution(oneBasedPositionInRead, readBase, refBase)); } else { final byte score = qualityScore[i + fromPosInRead]; features.add(new ReadBase(oneBasedPositionInRead, readBase, score)); } } } }
Source:
<code>private boolean isValidVersion(Tag tag) { <START> SortedSet<VersionValidation> versionValidations = tag.getValidations(); <END> boolean validDockerfile = isVersionTypeValidated(versionValidations, SourceFile.FileType.DOCKERFILE); boolean validCwl = isVersionTypeValidated(versionValidations, SourceFile.FileType.DOCKSTORE_CWL); boolean validWdl = isVersionTypeValidated(versionValidations, SourceFile.FileType.DOCKSTORE_WDL); boolean validCwlTestParameters = isVersionTypeValidated(versionValidations, SourceFile.FileType.CWL_TEST_JSON); boolean validWdlTestParameters = isVersionTypeValidated(versionValidations, SourceFile.FileType.WDL_TEST_JSON); boolean hasCwl = tag.getSourceFiles().stream().anyMatch(file -> file.getType() == SourceFile.FileType.DOCKSTORE_CWL); boolean hasWdl = tag.getSourceFiles().stream().anyMatch(file -> file.getType() == SourceFile.FileType.DOCKSTORE_WDL); return validDockerfile && ((hasCwl && validCwl && validCwlTestParameters) || (hasWdl && validWdl && validWdlTestParameters)); }</code><technical_language>Worth experiment, this stop people able launch previously valid workflows</technical_language>

Target:
private boolean isValidVersion(Tag tag) { SortedSet<Validation> versionValidations = tag.getValidations(); boolean validDockerfile = isVersionTypeValidated(versionValidations, SourceFile.FileType.DOCKERFILE); boolean validCwl = isVersionTypeValidated(versionValidations, SourceFile.FileType.DOCKSTORE_CWL); boolean validWdl = isVersionTypeValidated(versionValidations, SourceFile.FileType.DOCKSTORE_WDL); boolean validCwlTestParameters = isVersionTypeValidated(versionValidations, SourceFile.FileType.CWL_TEST_JSON); boolean validWdlTestParameters = isVersionTypeValidated(versionValidations, SourceFile.FileType.WDL_TEST_JSON); boolean hasCwl = tag.getSourceFiles().stream().anyMatch(file -> file.getType() == SourceFile.FileType.DOCKSTORE_CWL); boolean hasWdl = tag.getSourceFiles().stream().anyMatch(file -> file.getType() == SourceFile.FileType.DOCKSTORE_WDL); return validDockerfile && ((hasCwl && validCwl && validCwlTestParameters) || (hasWdl && validWdl && validWdlTestParameters)); }
Source:
<code>public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); <START> WikipediaApp.getInstance().checkCrashes(this); <END> ActivityUtil.requestFullUserOrientation(this); setTheme(WikipediaApp.getInstance().getCurrentTheme().getResourceId()); removeSplashBackground(); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); } forceOverflowMenuIcon(this); }</code><technical_language>Do need this in ThemedActionBarActivity is PageActivity enough</technical_language>

Target:
public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); ActivityUtil.requestFullUserOrientation(this); setTheme(WikipediaApp.getInstance().getCurrentTheme().getResourceId()); removeSplashBackground(); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); } forceOverflowMenuIcon(this); }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { <START> <END> RepositoryTreeNode selectedNode = getSelectedNodes(event).get(0); final String configName; if (selectedNode instanceof RemoteNode) { configName = ((RemoteNode) selectedNode).getObject(); } else if (selectedNode instanceof FetchNode) { configName = ((RemoteNode) selectedNode.getParent()).getObject(); } else { return null; } WizardDialog dlg = new WizardDialog( getView(event).getSite().getShell(), new ConfigureRemoteWizard( selectedNode.getRepository(), configName, false)); dlg.open(); return null; }</code><technical_language>unnecessary blank line</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { RepositoryTreeNode selectedNode = getSelectedNodes(event).get(0); final String configName; if (selectedNode instanceof RemoteNode) configName = ((RemoteNode) selectedNode).getObject(); else if (selectedNode instanceof FetchNode) configName = ((RemoteNode) selectedNode.getParent()).getObject(); else return null; WizardDialog dlg = new WizardDialog( getView(event).getSite().getShell(), new ConfigureRemoteWizard( selectedNode.getRepository(), configName, false)); dlg.open(); return null; }
Source:
<code>public static Intent createExternalIntent(Context context, Uri uri) { CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder() <START> .setToolbarColor(context.getResources().getColor(R.color.theme_primary)) <END> .setShowTitle(true) .build(); Intent intent = customTabsIntent.intent; intent.setData(uri); intent.putExtra(ShareCompat.EXTRA_CALLING_PACKAGE, context.getPackageName()); if (context instanceof Activity) { intent.putExtra(ShareCompat.EXTRA_CALLING_ACTIVITY, ((Activity) context).getComponentName()); } intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); return intent; }</code><technical_language>this access real primaryColor of theme. I is best. colorPrimary for DevFest, StudyJams etc. ThemeUtils.getThemeAttrColor(context, R.attr.colorPrimary);</technical_language>

Target:
public static Intent createExternalIntent(Context context, Uri uri) { CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder() .setToolbarColor(context.getResources().getColor(R.color.theme_primary)) .setShowTitle(true) .build(); Intent intent = customTabsIntent.intent; intent.setData(uri); return intent; }
Source:
<code>public AttributeSet(String name, AttributeSet attributeSet, AttributeDefinition<?>[] attributeDefinitions) { this.name = name; this.attributes = new LinkedHashMap<>(attributeDefinitions.length + attributeSet.attributes.size()); <START> for (Attribute<? extends Object> attribute : attributeSet.attributes.values()) { <END> this.attributes.put(attribute.name(), attribute.getAttributeDefinition().toAttribute()); } for (AttributeDefinition<?> def : attributeDefinitions) { Attribute<Object> attribute = (Attribute<Object>) def.toAttribute(); if (!attribute.isImmutable()) attribute.addListener(this); this.attributes.put(def.name(), attribute); } }</code><technical_language>here, ? is enough. Time a modern IDE shows this right in screen? :tongue: :wink:</technical_language>

Target:
public AttributeSet(String name, AttributeSet attributeSet, AttributeDefinition<?>[] attributeDefinitions) { this.name = name; this.attributes = new HashMap<>(attributeDefinitions.length + attributeSet.attributes.size()); for (Attribute<? extends Object> attribute : attributeSet.attributes.values()) { this.attributes.put(attribute.name(), attribute.getAttributeDefinition().toAttribute()); } for (AttributeDefinition<?> def : attributeDefinitions) { Attribute<Object> attribute = (Attribute<Object>) def.toAttribute(); if (!attribute.isImmutable()) attribute.addListener(this); this.attributes.put(def.name(), attribute); } }
Source:
<code>private void start() throws IOException { long now = 0; reportManager.init(); initCommandHandlerThread(conf); jvmPauseMonitor = new JvmPauseMonitor(); jvmPauseMonitor.init(conf); jvmPauseMonitor.start(); while (context.getState() != DatanodeStates.SHUTDOWN) { try { LOG.debug("Executing cycle Number : {}", context.getExecutionCount()); long heartbeatFrequency = context.getHeartbeatFrequency(); nextHB.set(Time.monotonicNow() + heartbeatFrequency); context.execute(executorService, heartbeatFrequency, TimeUnit.MILLISECONDS); now = Time.monotonicNow(); if (now < nextHB.get()) { if(!Thread.interrupted()) { Thread.sleep(nextHB.get() - now); } } } catch (InterruptedException e) { } catch (Exception e) { LOG.error("Unable to finish the execution.", e); } } <START> if (context.getShutdownStateMachine()) { <END> LOG.error("DatanodeStateMachine Shutdown due to an critical error"); hddsDatanodeService.terminateDatanode(); } }</code><technical_language>if transition shutdown state this check? Is process shutdown done then</technical_language>

Target:
private void start() throws IOException { long now = 0; reportManager.init(); initCommandHandlerThread(conf); jvmPauseMonitor = new JvmPauseMonitor(); jvmPauseMonitor.init(conf); jvmPauseMonitor.start(); while (context.getState() != DatanodeStates.SHUTDOWN) { try { LOG.debug("Executing cycle Number : {}", context.getExecutionCount()); long heartbeatFrequency = context.getHeartbeatFrequency(); nextHB.set(Time.monotonicNow() + heartbeatFrequency); context.execute(executorService, heartbeatFrequency, TimeUnit.MILLISECONDS); now = Time.monotonicNow(); if (now < nextHB.get()) { if(!Thread.interrupted()) { Thread.sleep(nextHB.get() - now); } } } catch (InterruptedException e) { } catch (Exception e) { LOG.error("Unable to finish the execution.", e); } } if (context.getShutdownOnError()) { LOG.error("DatanodeStateMachine Shutdown due to an critical error"); hddsDatanodeStopService.stopService(); } }
Source:
<code>public boolean assign(final Map<UUID, ClientState> clients, final Set<TaskId> allTaskIds, final Set<TaskId> statefulTaskIds, final AssignmentConfigs configs) { final SortedSet<TaskId> statefulTasks = new TreeSet<>(statefulTaskIds); final TreeMap<UUID, ClientState> clientStates = new TreeMap<>(clients); <START> final SortedMap<TaskId, SortedSet<RankedClient>> statefulTasksToRankedCandidates = <END> buildClientRankingsByTask(statefulTasks, clients, configs.acceptableRecoveryLag); final Map<TaskId, SortedSet<UUID>> tasksToCaughtUpClients = tasksToCaughtUpClients(statefulTasksToRankedCandidates); final Map<TaskId, Integer> tasksToRemainingStandbys = statefulTasks.stream().collect(Collectors.toMap(task -> task, t -> configs.numStandbyReplicas)); assignActiveStatefulTasks(clientStates, statefulTasks); assignStandbyReplicaTasks( tasksToRemainingStandbys, clientStates, statefulTasksToRankedCandidates, configs.numStandbyReplicas ); final boolean probingRebalanceNeeded = assignTaskMovements( tasksToCaughtUpClients, clientStates, configs.maxWarmupReplicas ); assignStatelessActiveTasks(clientStates, diff(TreeSet::new, allTaskIds, statefulTasks)); log.info("Decided on assignment: " + clientStates + " with " + (probingRebalanceNeeded ? "" : "no") + " followup probing rebalance."); return probingRebalanceNeeded; }</code><technical_language>prop: do need statefulTasksToRankedCandidates anymore. build tasksToCaughtUpClients statefulTasks, clients, configs.acceptableRecoveryLag. in assignStandbyReplicaTasks(), keySet() of statefulTasksToRankedCandidates. So, remove statefulTasksToRankedCandidates</technical_language>

Target:
public boolean assign(final Map<UUID, ClientState> clients, final Set<TaskId> allTaskIds, final Set<TaskId> statefulTaskIds, final AssignmentConfigs configs) { final SortedSet<TaskId> statefulTasks = new TreeSet<>(statefulTaskIds); final TreeMap<UUID, ClientState> clientStates = new TreeMap<>(clients); assignActiveStatefulTasks(clientStates, statefulTasks); assignStandbyReplicaTasks( clientStates, statefulTasks, configs.numStandbyReplicas ); final boolean probingRebalanceNeeded = assignTaskMovements( tasksToCaughtUpClients(statefulTasks, clientStates, configs.acceptableRecoveryLag), clientStates, configs.maxWarmupReplicas ); assignStatelessActiveTasks(clientStates, diff(TreeSet::new, allTaskIds, statefulTasks)); log.info("Decided on assignment: " + clientStates + " with " + (probingRebalanceNeeded ? "" : "no") + " followup probing rebalance."); return probingRebalanceNeeded; }
Source:
<code>public void close() { lastUsed.set(System.currentTimeMillis()); <START> useCnt.decrementAndGet(); <END> if (RepositoryCache.isCached(this)) { evict(0); } }</code><technical_language>This line check in line 885 atomic more. In worst case this code skip calling doClose() line 888. For example, if useCnt == 1, threads call close() time decrementAndGet of reaches line 885 useCnt -1 doClose skipped</technical_language>

Target:
public void close() { lastUsed.set(System.currentTimeMillis()); useCnt.decrementAndGet(); if (!RepositoryCache.isCached(this)) { evict(0); } }
Source:
<code>public void updated(Provider<Rule> provider, Rule oldElement, Rule element) { String uid = element.getUID(); if (oldElement != null && uid.equals(oldElement.getUID())) { try { Rule resolvedRule = resolveRuleByTemplate(element); super.updated(provider, oldElement, resolvedRule); postRuleUpdatedEvent(resolvedRule, oldElement); if (resolvedRule.getTemplateUID() == null) { RuleStatusInfo statusInfo = disabledRulesStorage != null && disabledRulesStorage.get(uid) == null ? new RuleStatusInfo(RuleStatus.INITIALIZING) : new RuleStatusInfo(RuleStatus.DISABLED); addToRuleEngine(resolvedRule, statusInfo); } <START> } catch (Exception e) { <END> logger.error("The rule '{}' is not updated, the new version is invalid", uid, e); } } else { throw new IllegalArgumentException( String.format("The rule '%s' is not updated, not matching with any existing rule", uid)); } }</code><technical_language>catch generic Exceptions. this more specific</technical_language>

Target:
public void updated(Provider<Rule> provider, Rule oldElement, Rule element) { String uid = element.getUID(); if (oldElement != null && uid.equals(oldElement.getUID())) { Rule resolvedRule = element; try { resolvedRule = resolveRuleByTemplate(element); } catch (IllegalArgumentException e) { logger.error("The rule '{}' is not updated, the new version is invalid", uid, e); } if (element != resolvedRule && provider instanceof ManagedRuleProvider) { update(resolvedRule); } else { super.updated(provider, oldElement, resolvedRule); } } else { throw new IllegalArgumentException( String.format("The rule '%s' is not updated, not matching with any existing rule", uid)); } }
Source:
<code>private void doBgSearch(ITmfStateSystem ss, int resolution, @NonNull IProgressMonitor monitor, Map<TimeGraphEntry, List<ITimeEvent>> gaps, @NonNull Map<@NonNull Integer, @NonNull Predicate<@NonNull Map<@NonNull String, @NonNull String>>> predicates) { <START> for (Map.Entry<TimeGraphEntry, List<ITimeEvent>> entryGap: gaps.entrySet()) { <END> List<ITimeEvent> gapEvents = entryGap.getValue(); TimeGraphEntry entry = entryGap.getKey(); for (ITimeEvent event : gapEvents) { queryFullStates(ss, event.getTime(), event.getTime() + event.getDuration(), resolution, monitor, new IQueryHandler() { @Override public void handle(@NonNull List<List<ITmfStateInterval>> fullStates, @Nullable List<ITmfStateInterval> prevFullState) { List<ITimeEvent> eventList = getEventList(Objects.requireNonNull(entry), ss, fullStates, prevFullState, monitor); if (eventList != null && !eventList.isEmpty() && !monitor.isCanceled()) { doFilterEvents(entry, eventList, predicates, true); for (ITimeEvent e : eventList) { if ((e.getActiveProperties() & IFilterProperty.DIMMED) == 0) { event.setProperty(IFilterProperty.DIMMED, false); } if ((e.getActiveProperties() & IFilterProperty.EXCLUDE) == 0) { event.setProperty(IFilterProperty.EXCLUDE, false); applyResults(() -> { entry.updateZoomedEvent(event); }); } } } } }); } refresh(); } }</code><technical_language>trace</technical_language>

Target:
private void doBgSearch(ITmfStateSystem ss, int resolution, @NonNull IProgressMonitor monitor, Map<TimeGraphEntry, List<ITimeEvent>> gaps, @NonNull Map<@NonNull Integer, @NonNull Predicate<@NonNull Map<@NonNull String, @NonNull String>>> predicates) { try (TraceCompassLogUtils.ScopeLog poc = new TraceCompassLogUtils.ScopeLog(LOGGER, Level.INFO, "TimegraphBgSearch")) { for (Map.Entry<TimeGraphEntry, List<ITimeEvent>> entryGap : gaps.entrySet()) { List<ITimeEvent> gapEvents = entryGap.getValue(); TimeGraphEntry entry = entryGap.getKey(); for (ITimeEvent event : gapEvents) { queryFullStates(ss, event.getTime(), event.getTime() + event.getDuration(), resolution, monitor, new IQueryHandler() { @Override public void handle(@NonNull List<List<ITmfStateInterval>> fullStates, @Nullable List<ITmfStateInterval> prevFullState) { List<ITimeEvent> eventList = getEventList(Objects.requireNonNull(entry), ss, fullStates, prevFullState, monitor); TimeEventFilterDialog timeEventFilterDialog = getTimeEventFilterDialog(); boolean hasActiveSavedFilters = timeEventFilterDialog.hasActiveSavedFilters(); if (eventList != null && !eventList.isEmpty() && !monitor.isCanceled()) { doFilterEvents(entry, eventList, predicates); boolean dimmed = (event.getActiveProperties() & IFilterProperty.DIMMED) == 1; boolean exclude = hasActiveSavedFilters; for (ITimeEvent e : eventList) { if (dimmed && (e.getActiveProperties() & IFilterProperty.DIMMED) == 0) { event.setProperty(IFilterProperty.DIMMED, false); dimmed = false; } if (exclude && (e.getActiveProperties() & IFilterProperty.EXCLUDE) == 0) { event.setProperty(IFilterProperty.EXCLUDE, false); applyResults(() -> { entry.updateZoomedEvent(event); }); exclude = false; } } } } }); } refresh(); } } }
Source:
<code>public Info getInfo(ObjectNode node, String location, ParseResult result) { if (node == null) return null; Info info = new Info(); String value = getString("title", node, true, location, result); <START> info.setTitle(value); <END> value = getString("description", node, false, location, result); info.setDescription(value); value = getString("termsOfService", node, false, location, result); info.setTermsOfService(value); ObjectNode obj = getObject("contact", node, false, "contact", result); Contact contact = getContact(obj, location, result); info.setContact(contact); obj = getObject("license", node, false, location, result); License license = getLicense(obj, location, result); info.setLicense(license); value = getString("version", node, true, location, result); info.setVersion(value); info.setExtensions(new LinkedHashMap<>()); Set<String> keys = getKeys(node); for(String key : keys) { if(key.startsWith("x-")) { info.getExtensions().put(key, Json.mapper().convertValue(node.get(key), Object.class)); } else if (!INFO_KEYS.contains(key)) { result.extra(location, key, node.get(key)); } } return info; }</code><technical_language>do a StringUtils.isNotBlank(...) check setting</technical_language>

Target:
public Info getInfo(ObjectNode node, String location, ParseResult result) { if (node == null) return null; Info info = new Info(); String value = getString("title", node, true, location, result); if(StringUtils.isNotBlank(value)) { info.setTitle(value); } value = getString("description", node, false, location, result); if(StringUtils.isNotBlank(value)) { info.setDescription(value); } value = getString("termsOfService", node, false, location, result); if(StringUtils.isNotBlank(value)) { info.setTermsOfService(value); } ObjectNode obj = getObject("contact", node, false, "contact", result); Contact contact = getContact(obj, location, result); if(obj != null) { info.setContact(contact); } obj = getObject("license", node, false, location, result); License license = getLicense(obj, location, result); if(obj != null) { info.setLicense(license); } value = getString("version", node, true, location, result); if(StringUtils.isNotBlank(value)) { info.setVersion(value); } Map <String,Object> extensions = getExtensions(node,location,result); if(extensions != null && extensions.size() > 0) { info.setExtensions(extensions); } return info; }
Source:
<code>protected List<IOseeBranch> innerCall() throws Exception { Conditions.checkNotNull(branchToken, "branchToPurge"); BranchQuery branchQuery = queryFactory.branchQuery(); branchQuery.andIds(branchToken); if (isRecursive) { branchQuery.andIsChildOf(branchToken); } ResultSet<BranchReadable> branches = branchQuery.getResults(); <START> Assert.isTrue(!branches.isEmpty(), "branchesToPurge"); <END> List<IOseeBranch> purged = new LinkedList<IOseeBranch>(); List<BranchReadable> orderedBranches = BranchUtil.orderByParentReadable(queryFactory, branches); for (BranchReadable aBranch : orderedBranches) { checkForCancelled(); checkForChildBranches(aBranch); Callable<Void> callable = getBranchStore().purgeBranch(getSession(), aBranch); callAndCheckForCancel(callable); purged.add(aBranch); } return purged; }</code><technical_language>is this here</technical_language>

Target:
protected List<IOseeBranch> innerCall() throws Exception { Conditions.checkNotNull(branchToken, "branchToPurge"); BranchQuery branchQuery = queryFactory.branchQuery(); branchQuery.andIds(branchToken); if (isRecursive) { branchQuery.andIsChildOf(branchToken); } ResultSet<BranchReadable> branches = branchQuery.getResults(); List<IOseeBranch> purged = new LinkedList<IOseeBranch>(); List<BranchReadable> orderedBranches = BranchUtil.orderByParentReadable(queryFactory, branches); for (BranchReadable aBranch : orderedBranches) { checkForCancelled(); checkForChildBranches(aBranch); Callable<Void> callable = getBranchStore().purgeBranch(getSession(), aBranch); callAndCheckForCancel(callable); purged.add(aBranch); } return purged; }
Source:
<code>public void setUp() { SimpleDependecyInjector.getInstance().bind(OsRepository.class, osRepository); <START> final int osId = 0; <END> Map<Integer, Map<Version, List<DisplayType>>> displayTypeMap = new HashMap<>(); displayTypeMap.put(osId, new HashMap<Version, List<DisplayType>>()); displayTypeMap.get(osId).put(null, Arrays.asList(DisplayType.qxl)); when(osRepository.getDisplayTypes()).thenReturn(displayTypeMap); setupTest(); }</code><technical_language>final? variable redundant way</technical_language>

Target:
public void setUp() { SimpleDependecyInjector.getInstance().bind(OsRepository.class, osRepository); final int osId = 0; Map<Integer, Map<Version, List<DisplayType>>> displayTypeMap = new HashMap<>(); displayTypeMap.put(osId, new HashMap<Version, List<DisplayType>>()); displayTypeMap.get(osId).put(null, Arrays.asList(DisplayType.qxl)); when(osRepository.getDisplayTypes()).thenReturn(displayTypeMap); mockVdsGroup(); try { xmlOvfData = new String(Files.readAllBytes(Paths.get(VM_OVF_XML_DATA))); } catch (IOException e) { e.printStackTrace(); } }
Source:
<code>@Override public void cancel() { if (isCancelled()) return; nodes.forEach(nodeId -> { <START> try { <END> exchange.cancelOutbox(nodeId, queryId(), srcFragmentId, exchangeId); } catch (IgniteCheckedException e) { e.printStackTrace(); } }); close(); super.cancel(); }</code><technical_language>move a specific method of Buffer class</technical_language>

Target:
@Override public void cancel() { if (isCancelled()) return; buffers.forEach(Buffer::cancel); close(); super.cancel(); }
Source:
<code>private void handleJson(HttpServerRequest request) { request.response().putHeader(CONTENT_TYPE, RESPONSE_TYPE_JSON).putHeader(SERVER, VERTX) <START> .putHeader(DATE, dateString).putHeader(CONTENT_LENGTH, JSON_HELLO_WORLD_CONTENT_LENGTH).end(JSON_HELLO_WORLD_BUFFER); <END> }</code><technical_language>Hi, check test rules JSON test: <LINK_0> IMO this is violation of rules 1 3 for JSON test</technical_language>

Target:
private void handleJson(HttpServerRequest request) { Buffer buff = Buffer.buffer(Json.encode(Collections.singletonMap(MESSAGE, HELLO_WORLD))); request.response().putHeader(CONTENT_TYPE, RESPONSE_TYPE_JSON).putHeader(SERVER, VERTX) .putHeader(DATE, dateString).end(buff); }
Source:
<code>public void testChargeRetrieveNullId() throws StripeException { try { Charge.retrieve(null); assertTrue(false); } catch (InvalidRequestException e) { String requestId = e.getRequestId(); <START> assertTrue(requestId != null); <END> assertTrue(e.toString().contains(requestId)); } }</code><technical_language>check empty string</technical_language>

Target:
public void testChargeRetrieveNullId() throws StripeException { try { Charge.retrieve(null); assertTrue(false); } catch (InvalidRequestException e) { String requestId = e.getRequestId(); assertFalse(requestId == null); assertFalse(requestId.equals("")); assertTrue(e.toString().contains(requestId)); } }
Source:
<code>public void setUp() throws Exception { <START> tearDown(); <END> final Props props = new Props(); storageManager = mock(StorageManager.class); projectLoader = mock(ProjectLoader.class); azkabanProjectLoader = new AzkabanProjectLoader(props, projectLoader, storageManager); }</code><technical_language>azkabanProjectLoader non-null delete happen</technical_language>

Target:
public void setUp() throws Exception { final Props props = new Props(); props.put(PROJECT_TEMP_DIR, this.TEMP_DIR.getRoot().getAbsolutePath()); this.storageManager = mock(StorageManager.class); this.projectLoader = mock(ProjectLoader.class); this.azkabanProjectLoader = new AzkabanProjectLoader(props, this.projectLoader, this.storageManager); }
Source:
<code><START> public Chapter getChapter(int chapterNumber) { <END> try { ChunkPlugin chunks = project.getChunkPlugin(new ChunkPluginLoader(context)); List<Chapter> chapters = chunks.getChapters(); for (Chapter chapter: chapters) { if(chapter.getNumber() == chapterNumber) { return chapter; } } } catch (IOException e) { e.printStackTrace(); } return null; }</code><technical_language>this a public API for a progress case object</technical_language>

Target:
private Chapter getChapter(int chapterNumber) { for (Chapter chapter: chapters) { if(chapter.getNumber() == chapterNumber) { return chapter; } } return null; }
Source:
<code>public void create() { if (!isKerberosAuth()) { return; } String engineEtc = System.getenv("ENGINE_ETC"); if (engineEtc == null) { engineEtc = "/etc/ovirt-engine"; } File krb5File = new File(engineEtc, "krb5.conf"); if (krb5File.exists()) { if (log.isDebugEnabled()) { log.debug("Loading kerberos settings from " + krb5File.getAbsolutePath()); } System.setProperty("java.security.krb5.conf", krb5File.getAbsolutePath()); } else { log.error("Failed loading kerberos setting. File " + krb5File + " not found."); } <START> System.setProperty("sun.security.krb5.msinterop.kstring","true"); <END> }</code><technical_language>Ravi, of all, congrants finding this out. - I while process of working KerberosManager, I making a mistake throwing exception if krb5 conf file in case do want kerberos auth. Regardless, I system property discovered. set if krb5File exists</technical_language>

Target:
public void create() { if (!isKerberosAuth()) { return; } String engineEtc = System.getenv("ENGINE_ETC"); if (engineEtc == null) { engineEtc = "/etc/ovirt-engine"; } File krb5File = new File(engineEtc, "krb5.conf"); if (krb5File.exists()) { if (log.isDebugEnabled()) { log.debug("Loading kerberos settings from " + krb5File.getAbsolutePath()); } System.setProperty("java.security.krb5.conf", krb5File.getAbsolutePath()); System.setProperty("sun.security.krb5.msinterop.kstring","true"); } else { log.error("Failed loading kerberos setting. File " + krb5File + " not found."); throw new RuntimeException("Failed loading kerberos setting. File " + krb5File + " not found. Kerberos file requied for Kerberos authentication."); } }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; LazyArrayIntTags that = (LazyArrayIntTags) o; <START> return Objects.equals(this.getVal(), that.getVal()); <END> }</code><technical_language>Please change this.getVal() == that.getVal(). This reduce number of throwaway return objects (TaintedBooleanWithObjTag) creating - call instrumented method (like Objects.equals) Phosphor code result in a new of made. Please add wrappers for equals hashCode for of modes (for int, returns TaintedBooleanWithIntTag, for obj, returns TaintedBooleanWithObjTag, for obj *also* takes a ControlTaintTagStack)</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof LazyArrayIntTags)) return false; LazyArrayIntTags that = (LazyArrayIntTags) o; return this.getVal() == that.getVal(); }
Source:
<code>public void onShowDiagnosticsProject() { final ProgressIndicator indicator = globalDisplay_.getProgressIndicator("Lint"); <START> indicator.onProgress("Linting..."); <END> projServer_.analyzeProject(new ServerRequestCallback<Void>() { @Override public void onResponseReceived(Void response) { indicator.onCompleted(); } @Override public void onError(ServerError error) { Debug.logError(error); indicator.onCompleted(); } }); }</code><technical_language>change this "Analyzing project sources..."</technical_language>

Target:
public void onShowDiagnosticsProject() { final ProgressIndicator indicator = globalDisplay_.getProgressIndicator("Lint"); indicator.onProgress("Analyzing project sources..."); projServer_.analyzeProject(new ServerRequestCallback<Void>() { @Override public void onResponseReceived(Void response) { indicator.onCompleted(); } @Override public void onError(ServerError error) { Debug.logError(error); indicator.onCompleted(); } }); }
Source:
<code>public MegaMekLabMainUI() { EquipmentType.initializeTypes(); MechSummaryCache.getInstance(); new CConfig(); UnitUtil.loadFonts(); System.out.println("Starting MegaMekLab version: " + MegaMekLab.VERSION); <START> setLookAndFeel(); <END> setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent evt) { exit(); } }); setResizable(true); setExtendedState(CConfig.getIntParam("WINDOWSTATE")); }</code><technical_language>This get called main splash screen, means click button load unit, unit selector dialog a feel rest of ui. I belongs in place, need run time unit type changes, needs move startup splash screen</technical_language>

Target:
public MegaMekLabMainUI() { EquipmentType.initializeTypes(); MechSummaryCache.getInstance(); new CConfig(); UnitUtil.loadFonts(); setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent evt) { exit(); } }); setResizable(true); setExtendedState(CConfig.getIntParam("WINDOWSTATE")); }
Source:
<code>private void initializationTask() { log.info("Start initialization task"); try { while (!shutdown && serverContext.getManagementLayout() == null) { log.warn("initializationTask: Management Server waiting to be bootstrapped"); Sleep.MILLISECONDS.sleepRecoverably(CHECK_BOOTSTRAP_INTERVAL.toMillis()); } } catch (InterruptedException e) { <START> log.debug("initializationTask: Initialization task interrupted without " + <END> "management server bootstrapped"); return; } long recoveryAttempts = 0; while (!shutdown && !recovered) { try { Layout layout = serverContext.copyManagementLayout(); if (runRecoveryReconfiguration(layout, getCorfuRuntime())) { serverContext.saveManagementLayout(getCorfuRuntime().getLayoutView().getLayout()); log.info("initializationTask: Recovery completed"); recovered = true; } log.error("initializationTask: Recovery failed times. Retrying in {}s.", ++recoveryAttempts, RECOVERY_RETRY_INTERVAL); Sleep.MILLISECONDS.sleepRecoverably(RECOVERY_RETRY_INTERVAL.toMillis()); } catch (InterruptedException e) { log.debug("initializationTask: Initialization task interrupted without recovered"); return; } catch (Exception e) { log.error("initializationTask: exception happened during layout recovery, {}", e); } } if (!shutdown) { localMonitoringService.start(METRICS_POLL_INTERVAL); remoteMonitoringService.start(METRICS_POLL_INTERVAL); } }</code><technical_language>throw UnrcoverableCorfuException</technical_language>

Target:
private void initializationTask() { log.info("Start initialization task"); try { while (!shutdown && serverContext.getManagementLayout() == null) { log.warn("initializationTask: Management Server waiting to be bootstrapped"); Sleep.MILLISECONDS.sleepRecoverably(CHECK_BOOTSTRAP_INTERVAL.toMillis()); } } catch (InterruptedException e) { log.debug("initializationTask: Initialization task interrupted without " + "management server bootstrapped"); return; } long recoveryAttempts = 0; while (!shutdown && !recovered) { try { Layout layout = serverContext.copyManagementLayout(); if (runRecoveryReconfiguration(layout, getCorfuRuntime())) { serverContext.saveManagementLayout(getCorfuRuntime().getLayoutView().getLayout()); log.info("initializationTask: Recovery completed"); recovered = true; continue; } log.error("initializationTask: Recovery failed times. Retrying in {}s.", ++recoveryAttempts, RECOVERY_RETRY_INTERVAL); Sleep.MILLISECONDS.sleepRecoverably(RECOVERY_RETRY_INTERVAL.toMillis()); } catch (InterruptedException e) { log.debug("initializationTask: Initialization task interrupted without being recovered"); return; } catch (Exception e) { log.error("initializationTask: exception happened during layout recovery, {}", e); } } if (!shutdown) { localMonitoringService.start(METRICS_POLL_INTERVAL); remoteMonitoringService.start(METRICS_POLL_INTERVAL); } }
Source:
<code>private void nextForEach(final Iterator<Connection> iterator, final LeastRecentlyUsedCache.Predicate<Connection> handler, final ForEachFuture result) { if (!result.isCancelled() && iterator.hasNext()) { final Connection next = iterator.next(); try { next.getExecutor().execute(new Runnable() { @Override public void run() { <START> boolean done = true; <END> try { if (!handler.accept(next)) { done = false; nextForEach(iterator, handler, result); } } finally { if (done) { result.done(); } } } }); return; } catch (RejectedExecutionException ex) { if (!handler.accept(next)) { while (iterator.hasNext()) { if (handler.accept(iterator.next())) { break; } if (result.isCancelled()) { break; } } } } } result.done(); }</code><technical_language>test result.isCancelled in this runnable</technical_language>

Target:
private void nextForEach(final Iterator<Connection> iterator, final LeastRecentlyUsedCache.Predicate<Connection> handler, final ForEachFuture result) { if (!result.isStopped() && iterator.hasNext()) { final Connection next = iterator.next(); try { next.getExecutor().execute(new Runnable() { @Override public void run() { boolean done = true; try { if (!result.isStopped() && !handler.accept(next)) { done = false; nextForEach(iterator, handler, result); } } catch (Exception exception) { result.failed(exception); } finally { if (done) { result.done(); } } } }); return; } catch (RejectedExecutionException ex) { if (!handler.accept(next)) { while (iterator.hasNext()) { if (handler.accept(iterator.next())) { break; } if (result.isStopped()) { break; } } } } } result.done(); }
Source:
<code>void writeInfoFromNode(ITmfStateIntervalList stateInfo) { assert (this.isDone); <START> if (intervals.size() == 0) { <END> return; } for (int i = 0; i < intervals.size(); i++) { stateInfo.add(intervals.get(i)); } return; }</code><technical_language>This is common in code base, I dislike it. size() == 0 -> isEmpty() assume List operator implements size() a huge cost (linear constant time)</technical_language>

Target:
void writeInfoFromNode(ITmfStateIntervalList stateInfo) { assert (this.isDone); if (intervals.isEmpty()) { return; } for (int i = 0; i < intervals.size(); i++) { stateInfo.add(intervals.get(i)); } return; }
Source:
<code>public void init() { int numberOfListeners = systemEnvironment.getNumberOfPluginNotificationListener(); for (int i = 0; i < numberOfListeners; i++) { <START> PluginNotificationService pluginNotificationService = new PluginNotificationService(notificationExtension, serverHealthService); <END> pluginNotificationQueue.addListener(new PluginNotificationListener(pluginNotificationService)); } }</code><technical_language>PluginNotificationService is a component, initialize again. pass autowired constructor of PluginNotificationListenerFactory</technical_language>

Target:
public void init() { int numberOfListeners = systemEnvironment.getNumberOfPluginNotificationListener(); for (int i = 0; i < numberOfListeners; i++) { pluginNotificationQueue.addListener(new PluginNotificationListener(pluginNotificationService)); } }
Source:
<code>private String capitalizeSyllabicR(String word) { return <START> word.replaceAll("(^|[^aeiou])r($|[^aeiou])", "$1R$2"); <END> }</code><technical_language>Compiling this a Pattern initalisation is more efficient</technical_language>

Target:
private String capitalizeSyllabicR(String word) { return syllabicRPattern.matcher(word).replaceAll("$1R$2"); }
Source:
<code>public void onSuccess(SendMessageRequest request, SendMessageResult result) { if (logger.isDebugEnabled()) { logger.debug("-> Message id:" + result.getMessageId() + ", sequence number:" + result.getSequenceNumber()); logger.debug(" " + json); logger.debug(" " + position); <START> logger.debug(""); <END> } cc.markCompleted(); }</code><technical_language>log debug message in line? multiline messages interleaved multiple processes</technical_language>

Target:
public void onSuccess(SendMessageRequest request, SendMessageResult result) { if (logger.isDebugEnabled()) { logger.debug("-> Message id:" + result.getMessageId() + ", sequence number:" + result.getSequenceNumber()+" "+json+" "+position); } cc.markCompleted(); }
Source:
<code>public JavaType[] getOperationParameterClasses(Operation operation, Map<String, Schema> definitions) { TypeFactory tf = Json.mapper().getTypeFactory(); if (operation.getParameters() == null){ operation.setParameters(new ArrayList<Parameter>()); } int body = 0; JavaType[] bodyArgumentClass = null; if (operation.getRequestBody() != null){ bodyArgumentClass = getTypeFromRequestBody(operation.getRequestBody(), definitions); if (bodyArgumentClass != null) { body = bodyArgumentClass.length; } } JavaType[] jt = new JavaType[operation.getParameters().size() + 1 + body]; int i = 0; jt[i] = tf.constructType(RequestContext.class); i += 1; for (Parameter parameter : operation.getParameters()) { JavaType argumentClass = getTypeFromParameter(parameter, definitions); jt[i] = argumentClass; i += 1; } <START> if (operation.getRequestBody() != null && bodyArgumentClass != null) { <END> for(int y = 0; y < bodyArgumentClass.length; y++) { jt[i] = bodyArgumentClass[y]; i += 1; } } return jt; }</code><technical_language>do need a null check for request-body if used</technical_language>

Target:
public JavaType[] getOperationParameterClasses(Operation operation, Map<String, Schema> definitions) { TypeFactory tf = Json.mapper().getTypeFactory(); if (operation.getParameters() == null){ operation.setParameters(new ArrayList<Parameter>()); } int body = 0; JavaType[] bodyArgumentClasses = null; if (operation.getRequestBody() != null){ bodyArgumentClasses = getTypeFromRequestBody(operation.getRequestBody(), definitions); if (bodyArgumentClasses != null) { body = bodyArgumentClasses.length; } } JavaType[] jt = new JavaType[operation.getParameters().size() + 1 + body]; int i = 0; jt[i] = tf.constructType(RequestContext.class); i += 1; for (Parameter parameter : operation.getParameters()) { JavaType argumentClasses = getTypeFromParameter(parameter, definitions); jt[i] = argumentClasses; i += 1; } if (operation.getRequestBody() != null && bodyArgumentClasses != null) { for (JavaType argument :bodyArgumentClasses) { jt[i] = argument; i += 1; } } return jt; }
Source:
<code><START> public static <T> T checkNotNull(T reference, @Nullable Object message) { <END> try { return Preconditions.checkNotNull(reference, message); } catch (NullPointerException e) { throw new BadRequestException(e.getMessage(), e); } }</code><technical_language>redundant below</technical_language>

Target:
public static <T> T checkNotNull(T reference, @Nullable Object message) { checkArgument(reference != null, message); return reference; }