auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean canFlipToNextPage() { <START> boolean canFlip = !ResourcesPlugin.getWorkspace().getRoot().exists(getContainerFullPath().append(this.getFileName().toLowerCase())); <END> if (!canFlip) { this.setErrorMessage(Messages.NewModelFilePage_page_same_case_desc + getFileName().toLowerCase()); } return canFlip; }</code><technical_language>"toLowerCase" is sufficient for case-insensitive comparisons: if project AbC exists try create ABC, Eclipse comparing "AbC" "abc" consider project exist</technical_language>

Target:
public boolean canFlipToNextPage() { boolean canFlip = true; String existingModelName = ""; for (String existingName : getExistingNames()) { if (existingName.toLowerCase().equals(getFileName().toLowerCase())) { canFlip = false; existingModelName = existingName; break; } } if (!canFlip) { this.setErrorMessage(Messages.NewModelFilePage_page_same_case_desc + existingModelName); } return canFlip; }
Source:
<code>private void setSlowThresholds(Configuration c) { slowIndexPrepareThreshold = c.getLong(INDEXER_INDEX_WRITE_SLOW_THRESHOLD_KEY, INDEXER_INDEX_WRITE_SLOW_THRESHOLD_DEFAULT); slowIndexWriteThreshold = c.getLong(INDEXER_INDEX_PREPARE_SLOW_THRESHOLD_KEY, INDEXER_INDEX_PREPARE_SLOW_THREHSOLD_DEFAULT); <START> slowPostOpenThreshold = c.getLong(INDEXER_POST_OPEN_SLOW_THRESHOLD_KEY, <END> INDEXER_POST_OPEN_SLOW_THRESHOLD_DEFAULT); slowPreIncrementThreshold = c.getLong(INDEXER_PRE_INCREMENT_SLOW_THRESHOLD_KEY, INDEXER_PRE_INCREMENT_SLOW_THRESHOLD_DEFAULT); }</code><technical_language>Is goal longer index failure policies (client-visible) index failures</technical_language>

Target:
private void setSlowThresholds(Configuration c) { slowIndexPrepareThreshold = c.getLong(INDEXER_INDEX_WRITE_SLOW_THRESHOLD_KEY, INDEXER_INDEX_WRITE_SLOW_THRESHOLD_DEFAULT); slowIndexWriteThreshold = c.getLong(INDEXER_INDEX_PREPARE_SLOW_THRESHOLD_KEY, INDEXER_INDEX_PREPARE_SLOW_THREHSOLD_DEFAULT); slowPreWALRestoreThreshold = c.getLong(INDEXER_PRE_WAL_RESTORE_SLOW_THRESHOLD_KEY, INDEXER_PRE_WAL_RESTORE_SLOW_THRESHOLD_DEFAULT); slowPostOpenThreshold = c.getLong(INDEXER_POST_OPEN_SLOW_THRESHOLD_KEY, INDEXER_POST_OPEN_SLOW_THRESHOLD_DEFAULT); slowPreIncrementThreshold = c.getLong(INDEXER_PRE_INCREMENT_SLOW_THRESHOLD_KEY, INDEXER_PRE_INCREMENT_SLOW_THRESHOLD_DEFAULT); }
Source:
<code>private void setupDialog() { dialog = new Dialog<String>(); dialog.setTitle("About DNAinator"); dialog.getDialogPane().getStylesheets().add(getClass().getResource(STYLE).toString()); Stage stage = (Stage) dialog.getDialogPane().getScene().getWindow(); <START> Image icon = new Image(this.getClass().getResourceAsStream(ICON)); <END> stage.getIcons().add(icon); ImageView img = new ImageView(); img.setImage(icon); dialog.setGraphic(img); readProperties(); dialog.setHeaderText("DNAinator\nDNA network visualization tool"); dialog.setContentText(contentText()); ButtonType close = new ButtonType("Close", ButtonData.CANCEL_CLOSE); dialog.getDialogPane().getButtonTypes().add(close); }</code><technical_language>2 lines this, do. Try consistent in style</technical_language>

Target:
private void setupDialog() { this.setTitle("About DNAinator"); this.setResizable(true); this.getDialogPane().getStylesheets().add(getClass().getResource(STYLE).toString()); this.initOwner(parent.getScene().getWindow()); ImageView img = new ImageView(); img.setImage(new Image(getClass().getResourceAsStream(LOGO))); this.setGraphic(img); readProperties(); this.setHeaderText("DNAinator\nDNA network visualization tool"); this.setContentText(contentText()); ButtonType close = new ButtonType("Close", ButtonData.CANCEL_CLOSE); this.getDialogPane().getButtonTypes().add(close); }
Source:
<code><START> public void writeUrls(URI baseUri) { <END> super.writeUrls(baseUri); if (getTissueOriginId() != null) { setTissueOriginUrl( UriComponentsBuilder.fromUri(baseUri).path("/rest/tissueorigin/{id}").buildAndExpand(getTissueOriginId()).toUriString()); } if (getTissueTypeId() != null) { setTissueTypeUrl(UriComponentsBuilder.fromUri(baseUri).path("/rest/tissuetype/{id}").buildAndExpand(getTissueTypeId()).toUriString()); } }</code><technical_language>labUrl written</technical_language>

Target:
public void writeUrls(URI baseUri) { super.writeUrls(baseUri); if (getTissueOriginId() != null) { setTissueOriginUrl( UriComponentsBuilder.fromUri(baseUri).path("/rest/tissueorigin/{id}").buildAndExpand(getTissueOriginId()).toUriString()); } if (getTissueTypeId() != null) { setTissueTypeUrl(UriComponentsBuilder.fromUri(baseUri).path("/rest/tissuetype/{id}").buildAndExpand(getTissueTypeId()).toUriString()); } if (getTissueMaterialId() != null) { setTissueMaterialUrl( UriComponentsBuilder.fromUri(baseUri).path("/rest/tissuematerial/{id}").buildAndExpand(getTissueMaterialId()).toUriString()); } if (getLabId() != null) { setLabUrl(UriComponentsBuilder.fromUri(baseUri).path("/rest/lab/{id}").buildAndExpand(getLabId()).toUriString()); } }
Source:
<code>protected boolean removeVmLease(Guid leaseStorageDomainId, Guid vmId) { if (leaseStorageDomainId == null) { return true; } return <START> runInternalAction( <END> VdcActionType.RemoveVmLease, new VmLeaseParameters(getStoragePoolId(), leaseStorageDomainId, vmId) ).getSucceeded(); }</code><technical_language>runInternalAction/runInternalActionWithTasksContext</technical_language>

Target:
protected boolean removeVmLease(Guid leaseStorageDomainId, Guid vmId) { if (leaseStorageDomainId == null) { return true; } return runInternalActionWithTasksContext( VdcActionType.RemoveVmLease, new VmLeaseParameters(getStoragePoolId(), leaseStorageDomainId, vmId) ).getSucceeded(); }
Source:
<code><START> private static void setBlobPropertiesHeaders(BlobProperties blobProperties, RestResponseChannel restResponseChannel) <END> throws RestServiceException { restResponseChannel.setHeader(RestUtils.Headers.BLOB_SIZE, blobProperties.getBlobSize()); restResponseChannel.setHeader(RestUtils.Headers.SERVICE_ID, blobProperties.getServiceId()); restResponseChannel.setHeader(RestUtils.Headers.CREATION_TIME, new Date(blobProperties.getCreationTimeInMs())); restResponseChannel.setHeader(RestUtils.Headers.PRIVATE, blobProperties.isPrivate()); if (blobProperties.getTimeToLiveInSeconds() != Utils.Infinite_Time) { restResponseChannel.setHeader(RestUtils.Headers.TTL, Long.toString(blobProperties.getTimeToLiveInSeconds())); } if (blobProperties.getContentType() != null) { restResponseChannel.setHeader(RestUtils.Headers.AMBRY_CONTENT_TYPE, blobProperties.getContentType()); } if (blobProperties.getOwnerId() != null) { restResponseChannel.setHeader(RestUtils.Headers.OWNER_ID, blobProperties.getOwnerId()); } }</code><technical_language>need static</technical_language>

Target:
private void setBlobPropertiesHeaders(BlobProperties blobProperties, RestResponseChannel restResponseChannel) throws RestServiceException { restResponseChannel.setHeader(RestUtils.Headers.BLOB_SIZE, blobProperties.getBlobSize()); restResponseChannel.setHeader(RestUtils.Headers.SERVICE_ID, blobProperties.getServiceId()); restResponseChannel.setHeader(RestUtils.Headers.CREATION_TIME, new Date(blobProperties.getCreationTimeInMs())); restResponseChannel.setHeader(RestUtils.Headers.PRIVATE, blobProperties.isPrivate()); if (blobProperties.getTimeToLiveInSeconds() != Utils.Infinite_Time) { restResponseChannel.setHeader(RestUtils.Headers.TTL, Long.toString(blobProperties.getTimeToLiveInSeconds())); } if (blobProperties.getContentType() != null) { restResponseChannel.setHeader(RestUtils.Headers.AMBRY_CONTENT_TYPE, blobProperties.getContentType()); } if (blobProperties.getOwnerId() != null) { restResponseChannel.setHeader(RestUtils.Headers.OWNER_ID, blobProperties.getOwnerId()); } }
Source:
<code>public void revive() { if (state == CLOSED) { transitionTo(CREATED); } else { <START> throw new IllegalStateException("Illegal state " + state() + " while committing standby task " + id); <END> } }</code><technical_language>Remove "standby" error message (unless this applies standbys?)</technical_language>

Target:
public void revive() { if (state == CLOSED) { transitionTo(CREATED); } else { throw new IllegalStateException("Illegal state " + state() + " while reviving task " + id); } }
Source:
<code>public void check(TopicName topicName, byte[] message) { Optional.ofNullable(topicsWithValidators.get(topicName)).ifPresent(validator -> { Timer.Context globalValidationTimerContext = hermesMetrics.timer(Timers.PRODUCER_VALIDATION_LATENCY).time(); Timer.Context topicValidationTimerContext = hermesMetrics.timer(Timers.PRODUCER_VALIDATION_LATENCY, topicName).time(); try { validator.check(message); } finally { globalValidationTimerContext.stop(); <START> topicValidationTimerContext.stop(); <END> } }); }</code><technical_language>Timer.Context managed try-with-resources..</technical_language>

Target:
public void check(TopicName topicName, byte[] message) { Optional.ofNullable(topicsWithValidators.get(topicName)).ifPresent(validator -> { try (Timer.Context globalValidationTimerContext = hermesMetrics.timer(Timers.PRODUCER_VALIDATION_LATENCY).time(); Timer.Context topicValidationTimerContext = hermesMetrics.timer(Timers.PRODUCER_VALIDATION_LATENCY, topicName).time()) { validator.check(message); } }); }
Source:
<code>public void checkElementsAreAdded(){ FormField testNullField = null; <START> Assert.assertEquals(false, testGroup.addElement(testNullField)); <END> FormField testField = mock(FormField.class); Assert.assertEquals(true, testGroup.addElement(testField)); Assert.assertTrue(testGroup.elements.contains(testField)); }</code><technical_language>Right, instances in this pull request assertEquals() is for checking boolean return values replaced assertTrue() assertFalse()</technical_language>

Target:
public void checkElementsAreAdded(){ Assert.assertFalse(testGroup.addElement(null)); FormField testField = mock(FormField.class); Assert.assertTrue(testGroup.addElement(testField)); Assert.assertTrue(testGroup.elements.contains(testField)); }
Source:
<code>public String toString() { <START> return MoreObjects.toStringHelper("InjectionPoint") <END> .add("source", this.source) .add("type", this.type) .add("annotations", Arrays.toString(this.annotations)) .toString(); }</code><technical_language>MoreObjects.toStringHelper(this)</technical_language>

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("source", this.source) .add("type", this.type) .add("annotations", Arrays.toString(this.annotations)) .toString(); }
Source:
<code>@Override public void load(Request request, int networkPolicy, Callback callback) { try { okhttp3.Request callRequest = createRequest(request, networkPolicy); Response response = callFactory.newCall(callRequest).execute(); if (!response.isSuccessful()) { callback.onError(new ResponseException(response.code(), request.networkPolicy)); } <START> <END> Picasso.LoadedFrom loadedFrom = response.cacheResponse() == null ? NETWORK : DISK; ResponseBody body = response.body(); if (loadedFrom == DISK && body.contentLength() == 0) { body.close(); callback.onError( new ContentLengthException("Received response with 0 content-length header.")); } if (loadedFrom == NETWORK && body.contentLength() > 0) { stats.dispatchDownloadFinished(body.contentLength()); } callback.onSuccess(new Result(body.source(), loadedFrom)); } catch (IOException e) { callback.onError(e); } }</code><technical_language>needs a return</technical_language>

Target:
@Override public void load(Request request, int networkPolicy, Callback callback) { boolean signaledCallback = false; try { okhttp3.Request callRequest = createRequest(request, networkPolicy); Response response = callFactory.newCall(callRequest).execute(); if (!response.isSuccessful()) { signaledCallback = true; callback.onError(new ResponseException(response.code(), request.networkPolicy)); return; } Picasso.LoadedFrom loadedFrom = response.cacheResponse() == null ? NETWORK : DISK; ResponseBody body = response.body(); if (loadedFrom == DISK && body.contentLength() == 0) { body.close(); signaledCallback = true; callback.onError( new ContentLengthException("Received response with 0 content-length header.")); return; } if (loadedFrom == NETWORK && body.contentLength() > 0) { stats.dispatchDownloadFinished(body.contentLength()); } signaledCallback = true; callback.onSuccess(new Result(body.source(), loadedFrom)); } catch (IOException e) { if (!signaledCallback) { callback.onError(e); } } }
Source:
<code>private void setupBitmapLayout() { <START> if (cuePosition == Cue.DIMEN_UNSET) { <END> cuePosition = 0.5f; } if (cueLine == Cue.DIMEN_UNSET) { cueLineAnchor = Cue.ANCHOR_TYPE_MIDDLE; cueLine = 0.85f; } if (cueSize == Cue.DIMEN_UNSET) { cueSize = 0.5f; } int parentWidth = parentRight - parentLeft; int parentHeight = parentBottom - parentTop; float anchorX = parentLeft + (parentWidth * cuePosition); float anchorY = parentTop + (parentHeight * cueLine); int width = Math.round(parentWidth * cueSize); int height = cueBitmapHeight != Cue.DIMEN_UNSET ? Math.round(parentHeight * cueBitmapHeight) : Math.round(width * ((float) cueBitmap.getHeight() / cueBitmap.getWidth())); int x = Math.round(cueLineAnchor == Cue.ANCHOR_TYPE_END ? (anchorX - width) : cueLineAnchor == Cue.ANCHOR_TYPE_MIDDLE ? (anchorX - (width / 2)) : anchorX); int y = Math.round(cuePositionAnchor == Cue.ANCHOR_TYPE_END ? (anchorY - height) : cuePositionAnchor == Cue.ANCHOR_TYPE_MIDDLE ? (anchorY - (height / 2)) : anchorY); bitmapRect = new Rect(x, y, x + width, y + height); }</code><technical_language>add cuePositionAnchor = ANCHOR_TYPE_MIDDLE this block</technical_language>

Target:
private void setupBitmapLayout() { int parentWidth = parentRight - parentLeft; int parentHeight = parentBottom - parentTop; float anchorX = parentLeft + (parentWidth * cuePosition); float anchorY = parentTop + (parentHeight * cueLine); int width = Math.round(parentWidth * cueSize); int height = cueBitmapHeight != Cue.DIMEN_UNSET ? Math.round(parentHeight * cueBitmapHeight) : Math.round(width * ((float) cueBitmap.getHeight() / cueBitmap.getWidth())); int x = Math.round(cueLineAnchor == Cue.ANCHOR_TYPE_END ? (anchorX - width) : cueLineAnchor == Cue.ANCHOR_TYPE_MIDDLE ? (anchorX - (width / 2)) : anchorX); int y = Math.round(cuePositionAnchor == Cue.ANCHOR_TYPE_END ? (anchorY - height) : cuePositionAnchor == Cue.ANCHOR_TYPE_MIDDLE ? (anchorY - (height / 2)) : anchorY); bitmapRect = new Rect(x, y, x + width, y + height); }
Source:
<code>public Response intercept(Chain chain) throws IOException { Request request = chain.request(); if (authorizer != null) { if ((expiringSAMLAuth == null || threshold <= Instant.now().getEpochSecond()) && isCallbackExecuting.compareAndSet(false, true)) { authorizeCallback(); } } else if (renewer != null) { if (threshold <= Instant.now().getEpochSecond()) { RenewExpiry renewExpiry = new RenewExpiry(); <START> if (isCallbackExecuting.compareAndSet(false, true)) <END> Executors.defaultThreadFactory().newThread(renewExpiry).start(); } } String samlHeaderValue = RESTServices.AUTHORIZATION_TYPE_SAML + " " + RESTServices.AUTHORIZATION_PARAM_TOKEN + "=" + authorizationTokenValue; Request authenticatedRequest = request.newBuilder().header(RESTServices.HEADER_AUTHORIZATION, samlHeaderValue) .build(); return chain.proceed(authenticatedRequest); }</code><technical_language>slightly cleaner more efficient if compareAndSet() test anded threshold test line 63</technical_language>

Target:
public Response intercept(Chain chain) throws IOException { Request request = chain.request(); if (authorizer != null) { if(expiringSAMLAuth == null) { authorizeCallbackWrapper(null); } else if(threshold<=Instant.now().getEpochSecond()){ authorizeCallbackWrapper(expiringSAMLAuth.getExpiry()); } } else if (renewer != null && threshold <= Instant.now().getEpochSecond() && isCallbackExecuting.compareAndSet(false, true)) { RenewCallbackWrapper renewCallbackWrapper = new RenewCallbackWrapper(expiringSAMLAuth); Executors.defaultThreadFactory().newThread(renewCallbackWrapper).start(); } String samlHeaderValue = RESTServices.AUTHORIZATION_TYPE_SAML + " " + RESTServices.AUTHORIZATION_PARAM_TOKEN + "=" + authorizationTokenValue; Request authenticatedRequest = request.newBuilder().header(RESTServices.HEADER_AUTHORIZATION, samlHeaderValue) .build(); return chain.proceed(authenticatedRequest); }
Source:
<code>private void checkStatusMessage(){ <START> switch (servertype.getStatus()){ <END> case (1): if (testServerURL.startsWith("http")) onView(withId(R.id.server_status_text)).check(matches(withText(R.string.auth_connection_established))); else onView(withId(R.id.server_status_text)).check(matches(withText(R.string.auth_nossl_plain_ok_title))); break; case (2): onView(withId(R.id.server_status_text)).check(matches(withText(R.string.auth_secure_connection))); break; case (3): onView(withId(R.id.server_status_text)).check(matches(withText(R.string.auth_secure_connection))); break; case (4): onView(withId(R.id.server_status_text)).check(matches(withText(R.string.auth_nossl_plain_ok_title))); break; default: break; } }</code><technical_language>enum in a switch statement. need get internal value, write switch (servertype) cases case HTTP:, etc..</technical_language>

Target:
private void checkStatusMessage(){ switch (servertype){ case HTTP: if (testServerURL.startsWith("http")) onView(withId(R.id.server_status_text)).check(matches(withText(R.string.auth_connection_established))); else onView(withId(R.id.server_status_text)).check(matches(withText(R.string.auth_nossl_plain_ok_title))); break; case HTTPS_NON_SECURE: onView(withId(R.id.server_status_text)).check(matches(withText(R.string.auth_secure_connection))); break; case HTTPS_SECURE: onView(withId(R.id.server_status_text)).check(matches(withText(R.string.auth_secure_connection))); break; case REDIRECTED_NON_SECURE: onView(withId(R.id.server_status_text)).check(matches(withText(R.string.auth_nossl_plain_ok_title))); break; default: break; } }
Source:
<code>public void init() { final GregorianCalendar gregorianCalendar = new GregorianCalendar(); try { <START> this.xmlCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar); <END> } catch (final DatatypeConfigurationException e) { e.printStackTrace(); } }</code><technical_language>put new GregorianCalander() in here, need for variable gregorianCalendar</technical_language>

Target:
public void init() { try { this.xmlCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar()); } catch (final DatatypeConfigurationException e) { e.printStackTrace(); } }
Source:
<code>public static Long convertObjectToLong(Object valObj) { if (valObj == null) { return 0L; } if (valObj instanceof Long) { return (Long) valObj; } else if (valObj instanceof Number) { return ((Number) valObj).longValue(); } else if (valObj instanceof String) { <START> Long parsedVal = DimensionHandlerUtils.getExactLongFromDecimalString((String) valObj); <END> return parsedVal == null ? 0L : parsedVal; } else { throw new ParseException("Unknown type[%s]", valObj.getClass()); } }</code><technical_language>null checks needed in checkUnsortedEncodedKeyComponentsEqual() checkUnsortedEncodedKeyComponentHashCode(), added here</technical_language>

Target:
public static Long convertObjectToLong(Object valObj) { if (valObj == null) { return LONG_ZERO; } if (valObj instanceof Long) { return (Long) valObj; } else if (valObj instanceof Number) { return ((Number) valObj).longValue(); } else if (valObj instanceof String) { Long parsedVal = DimensionHandlerUtils.getExactLongFromDecimalString((String) valObj); return parsedVal == null ? LONG_ZERO : parsedVal; } else { throw new ParseException("Unknown type[%s]", valObj.getClass()); } }
Source:
<code>private void checkQualityGateDoesNotAlreadyExist(DbSession dbSession, OrganizationDto organizationDto, String name) { QualityGateDto existingQgate = dbClient.qualityGateDao().selectByOrganizationAndName(dbSession, organizationDto, name); if (existingQgate != null) { <START> throw new IllegalArgumentException(format(IS_ALREADY_USED_MESSAGE, "Name")); <END> } }</code><technical_language>Please checkArgument instead</technical_language>

Target:
private void checkQualityGateDoesNotAlreadyExist(DbSession dbSession, OrganizationDto organizationDto, String name) { QualityGateDto existingQgate = dbClient.qualityGateDao().selectByOrganizationAndName(dbSession, organizationDto, name); checkArgument(existingQgate == null, IS_ALREADY_USED_MESSAGE, "Name"); }
Source:
<code>public Map<Group, Object> getAllGroupsWithHierarchy(PerunSession sess, Vo vo) throws InternalErrorException, PrivilegeException, VoNotExistsException { Utils.checkPerunSession(sess); <START> if (!AuthzResolver.authorizedInternal(sess, "", Collections.singletonList(vo))) { <END> throw new PrivilegeException(sess, "getAllGroupsWithHierarchy"); } getPerunBl().getVosManagerBl().checkVoExists(sess, vo); Map<Group, Object> groups = getGroupsManagerBl().getAllGroupsWithHierarchy(sess, vo); groups.keySet().removeIf(group -> !AuthzResolver.authorizedInternal(sess, "filter-getAllGroupsWithHierarchy_Vo_policy", Collections.singletonList(group))); return groups; }</code><technical_language>is missing, right</technical_language>

Target:
public Map<Group, Object> getAllGroupsWithHierarchy(PerunSession sess, Vo vo) throws InternalErrorException, PrivilegeException, VoNotExistsException { Utils.checkPerunSession(sess); getPerunBl().getVosManagerBl().checkVoExists(sess, vo); if (!AuthzResolver.authorizedInternal(sess, "getAllGroupsWithHierarchy_Vo_policy", Collections.singletonList(vo))) { throw new PrivilegeException(sess, "getAllGroupsWithHierarchy"); } Map<Group, Object> groups = getGroupsManagerBl().getAllGroupsWithHierarchy(sess, vo); groups.keySet().removeIf(group -> !AuthzResolver.authorizedInternal(sess, "filter-getAllGroupsWithHierarchy_Vo_policy", Collections.singletonList(group))); return groups; }
Source:
<code>private Bucket mockBucket(final String name, final String exists) throws IOException { final TemporaryFolder folder = new TemporaryFolder(); folder.create(); final File bucket = new File(folder.getRoot(), name); <START> assert bucket.mkdir(); <END> assert new File(bucket, exists).createNewFile(); final File sub = new File(bucket, "sub"); assert sub.mkdir(); assert new File(sub, "test").createNewFile(); return new MkBucket(folder.getRoot(), name); }</code><technical_language>asserts in project. Please, hamcrest if need check something. In this case check all. Fail fast</technical_language>

Target:
private Bucket mockBucket(final String name, final String exists) throws IOException { final Path bucket = Files.createDirectories( Paths.get(this.folder.getRoot().getAbsolutePath(), name, name) ); Files.createFile(bucket.resolve(exists)); Files.createFile( Files.createDirectories(bucket.resolve("sub")).resolve("file") ); return new MkBucket(this.folder.getRoot(), name); }
Source:
<code>public void testSetObjectFromJavaArray() throws SQLException { String[] strArray = new String[]{"a", "b", "c"}; Object[] objCopy = new Object[strArray.length]; <START> System.arraycopy(strArray, 0, objCopy, 0, strArray.length); <END> PreparedStatement pstmt = _conn.prepareStatement("INSERT INTO arrtest(strarr) VALUES (?)"); try { pstmt.setObject(1, objCopy, Types.ARRAY); pstmt.executeUpdate(); Assert.fail("setObject() with a Java array parameter and Types.ARRAY shouldn't succeed"); } catch (org.postgresql.util.PSQLException ex) { } try { pstmt.setObject(1, objCopy); pstmt.executeUpdate(); Assert.fail("setObject() with a Java array parameter and no Types argument shouldn't succeed"); } catch (org.postgresql.util.PSQLException ex) { } pstmt.setObject(1, strArray); pstmt.executeUpdate(); pstmt.setObject(1, strArray, Types.ARRAY); pstmt.executeUpdate(); Array sqlArray = _conn.createArrayOf("text", strArray); pstmt.setArray(1, sqlArray); pstmt.executeUpdate(); pstmt.close(); }</code><technical_language>replaced Arrays.copyOf(strArray, strArray.length, Object[].class)</technical_language>

Target:
public void testSetObjectFromJavaArray() throws SQLException { String[] strArray = new String[]{"a", "b", "c"}; Object[] objCopy = Arrays.copyOf(strArray, strArray.length, Object[].class); PreparedStatement pstmt = _conn.prepareStatement("INSERT INTO arrtest(strarr) VALUES (?)"); try { pstmt.setObject(1, objCopy, Types.ARRAY); pstmt.executeUpdate(); Assert.fail("setObject() with a Java array parameter and Types.ARRAY shouldn't succeed"); } catch (org.postgresql.util.PSQLException ex) { } try { pstmt.setObject(1, objCopy); pstmt.executeUpdate(); Assert.fail("setObject() with a Java array parameter and no Types argument shouldn't succeed"); } catch (org.postgresql.util.PSQLException ex) { } pstmt.setObject(1, strArray); pstmt.executeUpdate(); pstmt.setObject(1, strArray, Types.ARRAY); pstmt.executeUpdate(); Array sqlArray = _conn.createArrayOf("text", strArray); pstmt.setArray(1, sqlArray); pstmt.executeUpdate(); pstmt.close(); }
Source:
<code>public int getDefaultWaitInSeconds() { <START> return (int) polygons.defaultData * 60; <END> }</code><technical_language>mentioned above, fractional values scaled truncated int</technical_language>

Target:
public int getDefaultWaitInSeconds() { return (int) (polygons.defaultData * 60); }
Source:
<code>public static void setUpClass() { mongoStats = new BasicDBObject(uk.ac.ebi.eva.commons.models.converters.data.DBObjectToVariantStatsConverter.MAF_FIELD, 0.1); mongoStats.append(uk.ac.ebi.eva.commons.models.converters.data.DBObjectToVariantStatsConverter.MGF_FIELD, 0.01); mongoStats.append(uk.ac.ebi.eva.commons.models.converters.data.DBObjectToVariantStatsConverter.MAFALLELE_FIELD, "A"); mongoStats.append(uk.ac.ebi.eva.commons.models.converters.data.DBObjectToVariantStatsConverter.MGFGENOTYPE_FIELD, "A/A"); mongoStats.append(uk.ac.ebi.eva.commons.models.converters.data.DBObjectToVariantStatsConverter.MISSALLELE_FIELD, 10); <START> mongoStats.append(uk.ac.ebi.eva.commons.models.converters.data.DBObjectToVariantStatsConverter.MISSGENOTYPE_FIELD, 5); <END> BasicDBObject genotypes = new BasicDBObject(); genotypes.append("0/0", 100); genotypes.append("0/1", 50); genotypes.append("1/1", 10); mongoStats.append(uk.ac.ebi.eva.commons.models.converters.data.DBObjectToVariantStatsConverter.NUMGT_FIELD, genotypes); stats = new VariantStats(null, -1, null, null, Variant.VariantType.SNV, 0.1f, 0.01f, "A", "A/A", 10, 5, -1, -1, -1, -1, -1); stats.addGenotype(new Genotype("0/0"), 100); stats.addGenotype(new Genotype("0/1"), 50); stats.addGenotype(new Genotype("1/1"), 10); }</code><technical_language>Full qualification needed</technical_language>

Target:
public static void setUpClass() { mongoStats = new BasicDBObject(DBObjectToVariantStatsConverter.MAF_FIELD, 0.1); mongoStats.append(DBObjectToVariantStatsConverter.MGF_FIELD, 0.01); mongoStats.append(DBObjectToVariantStatsConverter.MAFALLELE_FIELD, "A"); mongoStats.append(DBObjectToVariantStatsConverter.MGFGENOTYPE_FIELD, "A/A"); mongoStats.append(DBObjectToVariantStatsConverter.MISSALLELE_FIELD, 10); mongoStats.append(DBObjectToVariantStatsConverter.MISSGENOTYPE_FIELD, 5); BasicDBObject genotypes = new BasicDBObject(); genotypes.append("0/0", 100); genotypes.append("0/1", 50); genotypes.append("1/1", 10); mongoStats.append(DBObjectToVariantStatsConverter.NUMGT_FIELD, genotypes); stats = new VariantStats(null, -1, null, null, Variant.VariantType.SNV, 0.1f, 0.01f, "A", "A/A", 10, 5, -1, -1, -1, -1, -1); stats.addGenotype(new Genotype("0/0"), 100); stats.addGenotype(new Genotype("0/1"), 50); stats.addGenotype(new Genotype("1/1"), 10); }
Source:
<code>public static void setup() throws InterruptedException { zkServer = new EmbeddedZookeeper(); zkServer.setup(); <START> System.out.println("zk port=" + zkServer.getPort()); <END> }</code><technical_language>nit: Remove sop tests</technical_language>

Target:
public static void setup() throws InterruptedException { zkServer = new EmbeddedZookeeper(); zkServer.setup(); }
Source:
<code>public <R> CompletableFuture<R> eval(K key, V value, BiFunction<V, ReadWriteEntryView<K, V>, R> f) { log.tracef("Invoked eval(k=%s, v=%s, %s)", key, value, params); Object keyEncoded = keyDataConversion.toStorage(key); <START> ReadWriteKeyValueCommand cmd = fmap.commandsFactory.buildReadWriteKeyValueCommand(keyEncoded, value, (BiFunction) f, params, keyDataConversion, valueDataConversion); <END> InvocationContext ctx = getInvocationContext(true, 1); if (ctx.getLockOwner() == null) { ctx.setLockOwner(cmd.getKeyLockOwner()); } return invokeAsync(ctx, cmd); }</code><technical_language>IRC discussed encode (and decode applying function ofc), user type serializable</technical_language>

Target:
public <R> CompletableFuture<R> eval(K key, V value, BiFunction<V, ReadWriteEntryView<K, V>, R> f) { log.tracef("Invoked eval(k=%s, v=%s, %s)", key, value, params); Object keyEncoded = keyDataConversion.toStorage(key); Object valueEncoded = valueDataConversion.toStorage(value); ReadWriteKeyValueCommand cmd = fmap.commandsFactory.buildReadWriteKeyValueCommand(keyEncoded, valueEncoded, (BiFunction) f, params, keyDataConversion, valueDataConversion); InvocationContext ctx = getInvocationContext(true, 1); if (ctx.getLockOwner() == null) { ctx.setLockOwner(cmd.getKeyLockOwner()); } return invokeAsync(ctx, cmd); }
Source:
<code>public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (source == null) { return null; } <START> if (source instanceof List) { <END> List<?> sourceList = (List<?>) source; if (!sourceList.isEmpty() && sourceList.get(0) instanceof String) { return new ArrayList<String>((List<? extends String>) sourceList); } } if (source instanceof Collection) { Collection<String> results = new ArrayList<>(); for (Object object : ((Collection<?>) source)) { if (object != null) { results.add(object.toString()); } } return results; } return Collections.singletonList(source.toString()); }</code><technical_language>current code cover case of a List<Object> element is a String other elements not. If this code block is removed handled correctly if (source instanceof Collection) block converts elements a String</technical_language>

Target:
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (source == null) { return null; } if (source instanceof Collection) { Collection<String> results = new ArrayList<>(); for (Object object : ((Collection<?>) source)) { if (object != null) { results.add(object.toString()); } } return results; } return Collections.singletonList(source.toString()); }
Source:
<code>public FactModelTuple retrieveFactModelTuple(Path path, String dmnPath) { DMNModel dmnModel = getDMNModel(path, dmnPath); SortedMap<String, FactModelTree> visibleFacts = new TreeMap<>(); SortedMap<String, FactModelTree> hiddenFacts = new TreeMap<>(); ErrorHolder errorHolder = new ErrorHolder(); for (InputDataNode input : dmnModel.getInputs()) { DMNType type = input.getType(); <START> checkTypeSupport(type, errorHolder, input.getName()); <END> try { visibleFacts.put(input.getName(), createTopLevelFactModelTree(input.getName(), type, hiddenFacts, FactModelTree.Type.INPUT)); } catch (WrongDMNTypeException e) { throw ExceptionUtilities.handleException(e); } } for (DecisionNode decision : dmnModel.getDecisions()) { DMNType type = decision.getResultType(); checkTypeSupport(type, errorHolder, decision.getName()); try { visibleFacts.put(decision.getName(), createTopLevelFactModelTree(decision.getName(), type, hiddenFacts, FactModelTree.Type.DECISION)); } catch (WrongDMNTypeException e) { throw ExceptionUtilities.handleException(e); } } FactModelTuple factModelTuple = new FactModelTuple(visibleFacts, hiddenFacts); errorHolder.getMultipleNestedCollection().forEach(factModelTuple::addMultipleNestedCollectionError); errorHolder.getMultipleNestedObject().forEach(factModelTuple::addMultipleNestedObjectError); return factModelTuple; }</code><technical_language>@yesamer please explain remove this visitCompositeType? I thought in review discuss HashSet TreeSet</technical_language>

Target:
public FactModelTuple retrieveFactModelTuple(Path path, String dmnPath) { DMNModel dmnModel = getDMNModel(path, dmnPath); SortedMap<String, FactModelTree> visibleFacts = new TreeMap<>(); SortedMap<String, FactModelTree> hiddenFacts = new TreeMap<>(); ErrorHolder errorHolder = new ErrorHolder(); for (InputDataNode input : dmnModel.getInputs()) { DMNType type = input.getType(); checkTypeSupport(type, false, errorHolder, input.getName()); try { visibleFacts.put(input.getName(), createTopLevelFactModelTree(input.getName(), type, hiddenFacts, FactModelTree.Type.INPUT)); } catch (WrongDMNTypeException e) { throw ExceptionUtilities.handleException(e); } } for (DecisionNode decision : dmnModel.getDecisions()) { DMNType type = decision.getResultType(); checkTypeSupport(type, false, errorHolder, decision.getName()); try { visibleFacts.put(decision.getName(), createTopLevelFactModelTree(decision.getName(), type, hiddenFacts, FactModelTree.Type.DECISION)); } catch (WrongDMNTypeException e) { throw ExceptionUtilities.handleException(e); } } FactModelTuple factModelTuple = new FactModelTuple(visibleFacts, hiddenFacts); errorHolder.getMultipleNestedCollection().forEach(factModelTuple::addMultipleNestedCollectionError); errorHolder.getMultipleNestedObject().forEach(factModelTuple::addMultipleNestedObjectError); return factModelTuple; }
Source:
<code>public V execute() throws IOException { try { call = delegate.get(); Future<V> future = executor.submit(() -> { try (AutoCloseable nameReverter = updateThreadName(call.toString())) { return call.execute(); } }); V result = future.get(); limitListener.onSuccess(); return result; } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof RejectedExecutionException) { limitListener.onDropped(); } else { limitListener.onIgnore(); } <START> throw new ThrottleException(cause); <END> } catch (RuntimeException e) { limitListener.onIgnore(); throw e; } catch (Exception e) { limitListener.onIgnore(); throw new ThrottleException(e); } }</code><technical_language>similar message elsewhere.. idea call is throttle related, is fine propagate error/runtimeexception/ioexception wrapping</technical_language>

Target:
@Override public V execute() throws IOException { try { delegate = supplier.get(); Future<V> future = executor.submit(() -> { String oldName = setCurrentThreadName(delegate.toString()); try { return delegate.execute(); } finally { setCurrentThreadName(oldName); } }); V result = future.get(); limitListener.onSuccess(); return result; } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof RejectedExecutionException) { limitListener.onDropped(); } else { limitListener.onIgnore(); } if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } else if (cause instanceof IOException) { throw (IOException) cause; } else { throw new RuntimeException("Issue while executing on a throttled call", cause); } } catch (InterruptedException e) { limitListener.onIgnore(); throw new RuntimeException("Interrupted while blocking on a throttled call", e); } catch (RuntimeException | Error e) { propagateIfFatal(e); limitListener.onIgnore(); throw e; } }
Source:
<code>public AnsiLogger(Log log, boolean useColor, String verbose, boolean batchMode, String prefix) { this.log = log; <START> this.isVerbose = checkBackwardVersionValues(verbose); END> if (isVerbose == null) { this.verboseModes = getVerboseModesFromStr(verbose); isVerbose = Boolean.TRUE; } else { this.verboseModes = Collections.singletonList(LogVerboseCategory.BUILD); } this.prefix = prefix; this.batchMode = batchMode; initializeColor(useColor); }</code><technical_language>"verbose" is null ? code checks this case. in this case verbose logging disabled</technical_language>

Target:
public AnsiLogger(Log log, boolean useColor, String verbose, boolean batchMode, String prefix) { this.log = log; this.prefix = prefix; this.batchMode = batchMode; checkVerboseLoggingEnabled(verbose); initializeColor(useColor); }
Source:
<code>protected boolean isLightStreamer(Instrumentation instrumentation) { for (String name : System.getProperties().stringPropertyNames()) { if (name.contains("com.lightstreamer")) { return true; } } <START> for (Class loadedClass : instrumentation.getAllLoadedClasses()) { <END> if (loadedClass.getCanonicalName().contains("com.lightstreamer")) { return true; } } return false; }</code><technical_language>this a bit heavy weight iterate loaded classes ? This slow startup running lightstream</technical_language>

Target:
protected boolean isLightStreamer(Instrumentation instrumentation) { Properties systemProperties = System.getProperties(); for (String expectedPropertyName : SYSTEM_PROERTY_NAMES) { if (systemProperties.containsKey(expectedPropertyName)) { return true; } } return false; }
Source:
<code>private static String getString(LiteralTree literal) { Optional<String> string = literal.asConstant(String.class); if (string.isPresent()) { return string.get(); } else { <START> throw new IllegalArgumentException("Only string literals allowed"); <END> } }</code><technical_language>*are* this beginning of constructor (that's getString is called)</technical_language>

Target:
private static String getString(LiteralTree literal) { return literal.asConstant(String.class) .orElseThrow(() -> new IllegalArgumentException("Only string literals allowed")); }
Source:
<code>public ColumnMatchResult validate(Column column, ChecksumResult controlResult, ChecksumResult testResult) { String checksumColumnAlias = getChecksumColumnAlias(column); Object controlChecksum = controlResult.getChecksum(checksumColumnAlias); Object testChecksum = testResult.getChecksum(checksumColumnAlias); String cardinalityColumnAlias = getCardinalityColumnAlias(column); <START> long controlCardinalitySum = (long) controlResult.getChecksum(cardinalityColumnAlias); <END> long testCardinalitySum = (long) testResult.getChecksum(cardinalityColumnAlias); return new ColumnMatchResult( Objects.equals(controlChecksum, testChecksum) && controlCardinalitySum == testCardinalitySum, format("control(checksum: %s, cardinality: %s) test(checksum: %s, cardinality: %s)", controlChecksum, controlCardinalitySum, testChecksum, testCardinalitySum)); }</code><technical_language>@ShenYi This cast result in NullPointerException. arrays null, sum(cardinality(a)) null casting null long throw NPE. drop this cast altogether. Object controlCardinalitySum = controlResult.getChecksum(cardinalityColumnAlias); Object testCardinalitySum = testResult.getChecksum(cardinalityColumnAlias);</technical_language>

Target:
public ColumnMatchResult validate(Column column, ChecksumResult controlResult, ChecksumResult testResult) { String checksumColumnAlias = getChecksumColumnAlias(column); Object controlChecksum = controlResult.getChecksum(checksumColumnAlias); Object testChecksum = testResult.getChecksum(checksumColumnAlias); String cardinalitySumColumnAlias = getCardinalitySumColumnAlias(column); Object controlCardinalitySum = controlResult.getChecksum(cardinalitySumColumnAlias); Object testCardinalitySum = testResult.getChecksum(cardinalitySumColumnAlias); return new ColumnMatchResult( Objects.equals(controlChecksum, testChecksum) && Objects.equals(controlCardinalitySum, testCardinalitySum), format( "control(checksum: %s, cardinality_sum: %s) test(checksum: %s, cardinality_sum: %s)", controlChecksum, controlCardinalitySum, testChecksum, testCardinalitySum)); }
Source:
<code>private void setupFocusHandling() { focusListener = new IWindowListener() { public void windowOpened(IWorkbenchWindow window) { } public void windowDeactivated(IWorkbenchWindow window) { } public void windowClosed(IWorkbenchWindow window) { } public void windowActivated(IWorkbenchWindow window) { if (rcs.doReschedule) rcs.schedule(); refreshJob.triggerRefresh(); } }; <START> Job job = new Job(UIText.ConfigurationChecker_checkConfiguration) { <END> @Override protected IStatus run(IProgressMonitor monitor) { if (PlatformUI.isWorkbenchRunning()) PlatformUI.getWorkbench().addWindowListener(focusListener); else schedule(1000L); return Status.OK_STATUS; } }; job.schedule(); }</code><technical_language>is this this text</technical_language>

Target:
private void setupFocusHandling() { focusListener = new IWindowListener() { public void windowOpened(IWorkbenchWindow window) { } public void windowDeactivated(IWorkbenchWindow window) { } public void windowClosed(IWorkbenchWindow window) { } public void windowActivated(IWorkbenchWindow window) { if (rcs.doReschedule) rcs.schedule(); refreshJob.triggerRefresh(); } }; Job job = new Job(UIText.Activator_setupFocusListener) { @Override protected IStatus run(IProgressMonitor monitor) { if (PlatformUI.isWorkbenchRunning()) PlatformUI.getWorkbench().addWindowListener(focusListener); else schedule(1000L); return Status.OK_STATUS; } }; job.schedule(); }
Source:
<code>private void endCommandActions() { getBackend().endAction(getImagesActionType(), getParameters(), <START> getContext().duplicate().resetCompensationContext().resetExecutionContext().resetLock()); <END> setSucceeded(true); }</code><technical_language>need reset execution-context? child commands need close steps in end-action in move/copy disk related flows</technical_language>

Target:
private void endCommandActions() { getBackend().endAction(getImagesActionType(), getParameters(), getContext().duplicate().withoutCompensationContext().withoutExecutionContext().withoutLock()); setSucceeded(true); }
Source:
<code>public void testGetPreferredNameNullInput() { DoorsTableRowCollector dtc = new DoorsTableRowCollector(extractor); dtc.getPreferredName(null); <START> Assert.fail(); <END> }</code><technical_language>fail is unecesary if exception happen test fail</technical_language>

Target:
public void testGetPreferredNameNullInput() { DoorsTableRowCollector dtc = new DoorsTableRowCollector(extractor); dtc.getPreferredName(null); }
Source:
<code>private void scheduleHsErrCheck(LogListener logListener) { try { File installDir = getInstallDir().orNull(); if (installDir == null) { return; } <START> Job job = new Job("Check hs_err_pid* files") { <END> @Override protected IStatus run(IProgressMonitor monitor) { new EclipseCrashLogCheck(installDir, logListener).run(); return Status.OK_STATUS; } }; job.schedule(TimeUnit.SECONDS.toMillis(15)); } catch (Exception e) { Logs.log(LogMessages.ERROR_HS_ERR_CHECK_FAILED, e); } }</code><technical_language>I reduce priority of this Job. Lots of stuff start-up. This is time critical</technical_language>

Target:
private void scheduleHsErrCheck(LogListener logListener) { try { File installDir = getInstallDir().orNull(); if (installDir == null) { return; } Job job = new JvmCrashLogCheck(installDir, logListener); job.setPriority(Job.DECORATE); job.schedule(TimeUnit.SECONDS.toMillis(15)); } catch (Exception e) { Logs.log(LogMessages.ERROR_HS_ERR_CHECK_FAILED, e); } }
Source:
<code>public <X> GridValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) { return new BasicGridBinder<X>( javaTypeDescriptor, this ) { @Override protected void doBind(Tuple resultset, X value, String[] names, WrapperOptions options) { Proxy proxy = (Proxy) value; InvocationHandler handler = Proxy.getInvocationHandler( proxy ); log.info( "handler:" + handler ); BinaryStream stream = null; try { Method getUnderlyingStreamMethod = getUnderlyingStreamMethod(); stream = (BinaryStream) handler.invoke( proxy, getUnderlyingStreamMethod, new Object[0] ); } catch (Throwable th) { <START> throw new HibernateError( "Cannot get input stream!", th ); <END> } resultset.put( names[0], stream ); } }; }</code><technical_language>this is in Log interface? a HibernateException</technical_language>

Target:
public <X> GridValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) { return new BasicGridBinder<X>( javaTypeDescriptor, this ) { @Override protected void doBind(Tuple resultset, X value, String[] names, WrapperOptions options) { Proxy proxy = (Proxy) value; InvocationHandler handler = Proxy.getInvocationHandler( proxy ); BinaryStream stream = null; try { Method getUnderlyingStreamMethod = getUnderlyingStreamMethod(); stream = (BinaryStream) handler.invoke( proxy, getUnderlyingStreamMethod, new Object[0] ); } catch (Throwable th) { throw new HibernateException( "Cannot get input stream!", th ); } resultset.put( names[0], stream ); } }; }
Source:
<code>public Response remove() { Provider provider = BackendExternalProviderHelper.getProvider(this, id); ProviderParameters parameters = new ProviderParameters(provider); <START> parameters.setForce(isForce()); <END> return performAction(ActionType.RemoveProvider, parameters); }</code><technical_language>add this ctor please</technical_language>

Target:
public Response remove() { Provider provider = BackendExternalProviderHelper.getProvider(this, id); ProviderParameters parameters = new ProviderParameters(provider, isForce()); return performAction(ActionType.RemoveProvider, parameters); }
Source:
<code>private String getProcessName(String tid) { String execName = fProcessNameMap.get(tid); if (execName != null) { return execName; } ITmfTrace trace = getTrace(); if (trace == null) { return tid; } ITmfStateSystem kernelSs = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysisModule.ID); if (kernelSs == null) { return tid; } int execNameQuark = kernelSs.optQuarkAbsolute(Attributes.THREADS, tid, Attributes.EXEC_NAME); if (execNameQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { return tid; } Iterator<ITmfStateInterval> iterator = new StateSystemUtils.QuarkIterator(kernelSs, execNameQuark, getStartTime()); while (iterator.hasNext()) { ITmfStateInterval execNameInterval = iterator.next(); <START> if (execNameInterval.getStartTime() > getEndTime()) { <END> break; } if (execNameInterval.getStateValue().getType() == ITmfStateValue.Type.STRING) { execName = execNameInterval.getStateValue().unboxStr(); fProcessNameMap.put(tid, execName); return execName; } } return tid; }</code><technical_language>I need this check. end time, there? end time range needs end time</technical_language>

Target:
private String getProcessName(String tid) { String execName = fProcessNameMap.get(tid); if (execName != null) { return execName; } ITmfTrace trace = getTrace(); if (trace == null) { return tid; } ITmfStateSystem kernelSs = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysisModule.ID); if (kernelSs == null) { return tid; } int execNameQuark = kernelSs.optQuarkAbsolute(Attributes.THREADS, tid, Attributes.EXEC_NAME); if (execNameQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { return tid; } Iterator<ITmfStateInterval> iterator = new StateSystemUtils.QuarkIterator(kernelSs, execNameQuark, getStartTime()); while (iterator.hasNext()) { ITmfStateInterval execNameInterval = iterator.next(); if (execNameInterval.getStateValue().getType() == ITmfStateValue.Type.STRING) { execName = execNameInterval.getStateValue().unboxStr(); fProcessNameMap.put(tid, execName); return execName; } } return tid; }