auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>@Test public void nullSqlWontNPE() throws SQLException { ConcurrentLinkedDeque<zipkin.Span> spans = new ConcurrentLinkedDeque<>(); Tracing tracing = ITTracingP6Factory.tracingBuilder(Sampler.ALWAYS_SAMPLE, spans).build(); when(statementInformation.getSql()).thenReturn(null); when(statementInformation.getConnectionInformation()).thenReturn(ci); when(ci.getConnection()).thenReturn(connection); when(connection.getMetaData()).thenReturn(metaData); when(metaData.getURL()).thenReturn(url); TracingJdbcEventListener listener = new TracingJdbcEventListener("", false); listener.onBeforeAnyExecute(statementInformation); listener.onAfterAnyExecute(statementInformation,1,null); <START> assertThat(spans.getFirst().name, is(equalTo(TracingJdbcEventListener.QUERY_PLACEHOLDER.trim()))); <END> }</code><technical_language>nit: prefer assertj everywhere. assertThat(...).isEqualTo( Also, string constant people :) a touch of anti DRY in tests easier understand</technical_language>

Target:
@Test public void nullSqlWontNPE() throws SQLException { ConcurrentLinkedDeque<zipkin.Span> spans = new ConcurrentLinkedDeque<>(); Tracing tracing = ITTracingP6Factory.tracingBuilder(Sampler.ALWAYS_SAMPLE, spans).build(); when(statementInformation.getSql()).thenReturn(null); when(statementInformation.getConnectionInformation()).thenReturn(ci); when(ci.getConnection()).thenReturn(connection); when(connection.getMetaData()).thenReturn(metaData); when(metaData.getURL()).thenReturn(url); TracingJdbcEventListener listener = new TracingJdbcEventListener("", false); listener.onBeforeAnyExecute(statementInformation); listener.onAfterAnyExecute(statementInformation,1,null); assertThat(spans) .extracting(s -> s.name) .containsExactly("query"); }
Source:
<code>public static void checkMinLength(String propertyName, String actualValue, int minLength) throws MinSizeExceededException{ <START> if(actualValue.length() < minLength) throw new MinSizeExceededException("Length of '" + propertyName + "' is too short! MinLength=" + minLength + ", ActualLength=" + actualValue.length()); <END> }</code><technical_language>cover case, passed is null, Candidate params titleBefore/titleAfter null empty</technical_language>

Target:
public static void checkMinLength(String propertyName, String actualValue, int minLength) throws MinSizeExceededException { if (actualValue == null) { throw new MinSizeExceededException("The property '" + propertyName + "' does not have a minimal length equal to '" + minLength + "' because it is null."); } if (actualValue.length() < minLength) { throw new MinSizeExceededException("Length of '" + propertyName + "' is too short! MinLength=" + minLength + ", ActualLength=" + actualValue.length()); } }
Source:
<code><START> private JavaCharacter parseJavaEscapeSequence(JavaCharacter backslash) { <END> unicodeProcessedCharacters.moveNext(); JavaCharacter javaCharacter = unicodeProcessedCharacters.getCurrent(); if (javaCharacter == null) { return null; } char ch = javaCharacter.getCharacter(); switch (ch) { case 'n': ch = '\n'; unicodeProcessedCharacters.moveNext(); break; case 'r': ch = '\r'; unicodeProcessedCharacters.moveNext(); break; case 'f': ch = '\f'; unicodeProcessedCharacters.moveNext(); break; case 'b': ch = '\b'; unicodeProcessedCharacters.moveNext(); break; case 't': ch = '\t'; unicodeProcessedCharacters.moveNext(); break; default: if (isOctalDigit(ch)) { StringBuilder codeUnit = new StringBuilder(3); for (int i = 0; i < 3 && javaCharacter != null && isOctalDigit(javaCharacter.getCharacter()); i++) { codeUnit.append(javaCharacter.getCharacter()); unicodeProcessedCharacters.moveNext(); javaCharacter = unicodeProcessedCharacters.getCurrent(); } ch = (char) Integer.parseInt(codeUnit.toString(), 8); } else { unicodeProcessedCharacters.moveNext(); } break; } return new JavaCharacter(source, backslash.getRange().extendTo(getCurrentStartIndex()), ch); }</code><technical_language>annotated @CheckForNull well, encountering invalid string literals</technical_language>

Target:
private JavaCharacter parseJavaEscapeSequence(JavaCharacter backslash) { unicodeProcessedCharacters.moveNext(); JavaCharacter javaCharacter = unicodeProcessedCharacters.getCurrent(); if (javaCharacter == null) { return backslash; } char ch = javaCharacter.getCharacter(); switch (ch) { case 'n': ch = '\n'; break; case 'r': ch = '\r'; break; case 'f': ch = '\f'; break; case 'b': ch = '\b'; break; case 't': ch = '\t'; break; default: if (isOctalDigit(ch)) { StringBuilder codeUnit = new StringBuilder(3); for (int i = 0; i < 3 && javaCharacter != null && isOctalDigit(javaCharacter.getCharacter()); i++) { codeUnit.append(javaCharacter.getCharacter()); unicodeProcessedCharacters.moveNext(); javaCharacter = unicodeProcessedCharacters.getCurrent(); } ch = (char) Integer.parseInt(codeUnit.toString(), 8); return new JavaCharacter(source, backslash.getRange().extendTo(getCurrentStartIndex()), ch); } break; } unicodeProcessedCharacters.moveNext(); return new JavaCharacter(source, backslash.getRange().extendTo(getCurrentStartIndex()), ch); }
Source:
<code>public Set<String> availableRoleIds() { <START> String[] configStrings = ServerConfigurationService.getStrings("access.enabledRoles"); <END> LinkedHashSet<String> availableIds = new LinkedHashSet<String>(); availableIds.addAll(Arrays.asList(configStrings)); if(!this.isPubviewPossible) { availableIds.remove(PUBVIEW_ROLE); } return availableIds; }</code><technical_language>If this defined return a null Arrays.asList(null) NPE get thrown</technical_language>

Target:
public Set<String> availableRoleIds() { String[] configStrings = ServerConfigurationService.getStrings("access.enabledRoles"); LinkedHashSet<String> availableIds = new LinkedHashSet<String>(); if(configStrings != null) { availableIds.addAll(Arrays.asList(configStrings)); } if(!this.isPubviewPossible) { availableIds.remove(PUBVIEW_ROLE); } return availableIds; }
Source:
<code>protected Comparator<T> getDefaultItemComparator() { if (defaultItemComparator == null) { final Comparator<T> nameComparator = new Comparator<T>() { @Override public int compare(T a, T b) { String name1 = (a instanceof Nameable) ? ((Nameable) a).getName() : null; String name2 = (b instanceof Nameable) ? ((Nameable) b).getName() : null; return LexoNumericComparator.comp(name1, name2); } }; final Comparator<T> idComparator = new Comparator<T>() { private final Comparator<Comparable> nullComparator = new Comparator<Comparable>() { <START> private final boolean nullFirst = false; <END> @Override public int compare(Comparable a, Comparable b) { if (a == null) { return (b == null) ? 0 : (nullFirst ? -1 : 1); } else if (b == null) { return nullFirst ? 1: -1; } else { return a.compareTo(b); } } }; @Override public int compare(T a, T b) { Object id1 = (a instanceof IVdcQueryable) ? ((IVdcQueryable) a).getQueryableId() : null; Object id2 = (b instanceof IVdcQueryable) ? ((IVdcQueryable) b).getQueryableId() : null; Comparable idComp1 = (id1 instanceof Comparable) ? (Comparable) id1 : null; Comparable idComp2 = (id2 instanceof Comparable) ? (Comparable) id2 : null; return nullComparator.compare(idComp1, idComp2); } }; defaultItemComparator = new Comparator<T>() { @Override public int compare(T a, T b) { int res = nameComparator.compare(a, b); return (res != 0) ? res : idComparator.compare(a, b); } }; } return defaultItemComparator; }</code><technical_language>findBugs complaining this guy. is a const, static</technical_language>

Target:
protected Comparator<T> getDefaultItemComparator() { if (defaultItemComparator == null) { final Comparator<T> nameComparator = new Comparator<T>() { @Override public int compare(T a, T b) { String name1 = (a instanceof Nameable) ? ((Nameable) a).getName() : null; String name2 = (b instanceof Nameable) ? ((Nameable) b).getName() : null; return LexoNumericComparator.comp(name1, name2); } }; final Comparator<T> idComparator = new Comparator<T>() { private final Comparator<Comparable> nullComparator = new Comparator<Comparable>() { @Override public int compare(Comparable a, Comparable b) { if (a == null) { return (b == null) ? 0 : 1; } else if (b == null) { return -1; } else { return a.compareTo(b); } } }; @Override public int compare(T a, T b) { Object id1 = (a instanceof IVdcQueryable) ? ((IVdcQueryable) a).getQueryableId() : null; Object id2 = (b instanceof IVdcQueryable) ? ((IVdcQueryable) b).getQueryableId() : null; Comparable idComp1 = (id1 instanceof Comparable) ? (Comparable) id1 : null; Comparable idComp2 = (id2 instanceof Comparable) ? (Comparable) id2 : null; return nullComparator.compare(idComp1, idComp2); } }; defaultItemComparator = new Comparator<T>() { @Override public int compare(T a, T b) { int res = nameComparator.compare(a, b); return (res != 0) ? res : idComparator.compare(a, b); } }; } return defaultItemComparator; }
Source:
<code>private void writeToDataOut(DataOutput out, Schema.Field field) throws IOException { Schema fieldSchema = getNonNullableSchema(field); Schema.Type fieldType = fieldSchema.getType(); Object fieldValue = record.get(field.getName()); if (fieldValue == null) { return; } switch (fieldType) { case NULL: break; case STRING: out.writeUTF((String) fieldValue); break; case BOOLEAN: out.writeBoolean((Boolean) fieldValue); break; case INT: out.writeInt((Integer) fieldValue); break; case LONG: out.writeLong((Long) fieldValue); break; case FLOAT: out.writeFloat((Float) fieldValue); break; case DOUBLE: out.writeDouble((Double) fieldValue); break; case BYTES: out.write((byte[]) fieldValue); break; default: <START> throw new IOException(String.format("Unsupported datatype: %s with value: %s and name: %s.", fieldType, fieldValue, field.getName())); <END> } }</code><technical_language>I fix grammar in this sentence. - Column %s %s unsupported datatype %s</technical_language>

Target:
private void writeToDataOut(DataOutput out, Schema.Field field) throws IOException { Schema fieldSchema = getNonNullableSchema(field); Schema.Type fieldType = fieldSchema.getType(); Object fieldValue = record.get(field.getName()); if (fieldValue == null) { return; } switch (fieldType) { case NULL: break; case STRING: out.writeUTF((String) fieldValue); break; case BOOLEAN: out.writeBoolean((Boolean) fieldValue); break; case INT: out.writeInt((Integer) fieldValue); break; case LONG: out.writeLong((Long) fieldValue); break; case FLOAT: out.writeFloat((Float) fieldValue); break; case DOUBLE: out.writeDouble((Double) fieldValue); break; case BYTES: out.write((byte[]) fieldValue); break; default: throw new IOException(String.format("Column %s with value %s has an unsupported datatype %s", field.getName(), fieldValue, fieldType)); } }
Source:
<code><START> public synchronized Set<Long> requestIdsSnapshot() { <END> return new HashSet<Long>(requestSent.keySet()); }</code><technical_language>avoid sync problems requestSent eliminate additional locks need synchronize a FastSyncManager instance: synchronize(FastSyncManager.this) { }</technical_language>

Target:
public Set<Long> requestIdsSnapshot() { synchronized (FastSyncManager.this) { return new HashSet<Long>(requestSent.keySet()); } }
Source:
<code>public void applySecret(KubernetesEnvironment env, RuntimeIdentity runtimeIdentity, Secret secret) throws InfrastructureException { super.applySecret(env, runtimeIdentity, secret); final String secretMountPath = secret.getMetadata().getAnnotations().get(ANNOTATION_MOUNT_PATH); Set<String> keys = secret.getData().keySet(); if (keys.size() != 1) { throw new InfrastructureException( format( "Invalid git credential secret data. It should contain only 1 data item but it have %d", keys.size())); } Path gitSecretFilePath = Paths.get(secretMountPath, keys.iterator().next()); ConfigMap gitConfigMap = env.getConfigMaps() .get( runtimeIdentity.getWorkspaceId() + GitConfigProvisioner.GIT_CONFIG_MAP_NAME_SUFFIX); if (gitConfigMap != null) { Map<String, String> gitConfigMapData = gitConfigMap.getData(); String gitConfig = gitConfigMapData.get(GitConfigProvisioner.GIT_CONFIG); if (gitConfig != null) { if (gitConfig.contains("helper = store --file ") && gitConfig.contains("[credential]")) { throw new InfrastructureException( "Multiple git credentials secrets found. Please remove duplication."); } StringBuilder gitConfigBuilder = new StringBuilder(gitConfig); gitConfigBuilder .append('\n') .append("[credential]") .append('\n') .append('\t') .append("helper = store --file ") .append(gitSecretFilePath.toString()) .append('\n'); HashMap<String, String> newGitConfigMapData = new HashMap<>(gitConfigMapData); newGitConfigMapData.put(GitConfigProvisioner.GIT_CONFIG, gitConfigBuilder.toString()); <START> LOG.info(gitConfigBuilder.toString()); <END> gitConfigMap.setData(newGitConfigMapData); } } }</code><technical_language>debug imo</technical_language>

Target:
public void applySecret(KubernetesEnvironment env, RuntimeIdentity runtimeIdentity, Secret secret) throws InfrastructureException { super.applySecret(env, runtimeIdentity, secret); final String secretMountPath = secret.getMetadata().getAnnotations().get(ANNOTATION_MOUNT_PATH); Set<String> keys = secret.getData().keySet(); if (keys.size() != 1) { throw new InfrastructureException( format( "Invalid git credential secret data. It should contain only 1 data item but it have %d", keys.size())); } Path gitSecretFilePath = Paths.get(secretMountPath, keys.iterator().next()); ConfigMap gitConfigMap = env.getConfigMaps() .get( runtimeIdentity.getWorkspaceId() + GitConfigProvisioner.GIT_CONFIG_MAP_NAME_SUFFIX); if (gitConfigMap != null) { Map<String, String> gitConfigMapData = gitConfigMap.getData(); String gitConfig = gitConfigMapData.get(GitConfigProvisioner.GIT_CONFIG); if (gitConfig != null) { if (gitConfig.contains("helper = store --file") && gitConfig.contains("[credential]")) { throw new InfrastructureException( "Multiple git credentials secrets found. Please remove duplication."); } HashMap<String, String> newGitConfigMapData = new HashMap<>(gitConfigMapData); newGitConfigMapData.put( GitConfigProvisioner.GIT_CONFIG, String.format(GIT_CREDENTIALS_FILE_STORE_PATTERN, gitSecretFilePath.toString())); gitConfigMap.setData(newGitConfigMapData); } } }
Source:
<code>public void validate() { <START> throw new CacheConfigurationException("MODULE ERROR"); <END> }</code><technical_language>throw a RuntimeException a simulation</technical_language>

Target:
public void validate() { throw new RuntimeException("MODULE ERROR"); }
Source:
<code><START> public static <END> ChangeData createForTest(Change.Id id, int currentPatchSetId) { ChangeData cd = new ChangeData(null, null, null, null, null, null, null, null, null, null, null, null, null, id); cd.currentPatchSet = new PatchSet(new PatchSet.Id(id, currentPatchSetId)); return cd; }</code><technical_language>Unneeded change. This in RegexPathPredicateTest, is in package</technical_language>

Target:
static ChangeData createForTest(Change.Id id, int currentPatchSetId) { ChangeData cd = new ChangeData(null, null, null, null, null, null, null, null, null, null, null, null, null, id); cd.currentPatchSet = new PatchSet(new PatchSet.Id(id, currentPatchSetId)); return cd; }
Source:
<code>public final String toString() { StringBuilder builder = new StringBuilder(); builder.append("Path to theme: "); builder.append(getPath()); builder.append(", User portal css: "); builder.append(getUserPortalStyleSheetName()); builder.append(", Web admin css: "); <START> builder.append(getWebadminStyleSheetName()); <END> return builder.toString(); }</code><technical_language>I a discussion this... but.... return String.format( "Path theme %1$s, User portal css: %2$s, Web admin css: %3$s", getPath(), getUserPortalStyleSheetName(), getWebadminStyleSheetName() ); more readable</technical_language>

Target:
public final String toString() { return "Path to theme: " + getPath() + ", User portal css: " + getUserPortalStyleSheetName() + ", Web admin css: " + getWebadminStyleSheetName(); }
Source:
<code>protected Iterator<Event> historyBackward() { <START> final ImmutableList<Event> events = ImmutableList.copyOf(historySinceLastSnapshot); <END> return events.iterator(); }</code><technical_language>Please encapsulate impl. details RecentHistory class, discussed vocally</technical_language>

Target:
protected Iterator<Event> historyBackward() { return recentHistory().iterator(); }
Source:
<code>protected void setupCloudClient() { try { String projectId = getProperty(PROJECT_ID_PROPERTY); GoogleCredentials credentials = GoogleCredentials.fromStream(new ByteArrayInputStream( <START> Files.readAllBytes(Paths.get(getProperty(GOOGLE_APPLICATION_CREDENTIALS))))) <END> .createScoped(GOOGLE_PLATFORM_SCOPE, GOOGLE_STORAGE_SCOPE); credentials.refreshIfExpired(); storage = StorageOptions.newBuilder() .setCredentials(GoogleCredentials.create(credentials.refreshAccessToken())) .setProjectId(projectId) .build() .getService(); bucketName = getProperty(BUCKET_NAME_PROPERTY); bucketPrefix = getProperty(BUCKET_PREFIX_PROPERTY, EMPTY); bucket = getOrCreateBucket(bucketName); if (!isBlank(bucketPrefix) && !bucketPrefix.endsWith(DELIMITER)) { log.warn(String.format("%s %s Google bucket prefix should end with '/' : added automatically.", BUCKET_PREFIX_PROPERTY, bucketPrefix)); bucketPrefix += DELIMITER; } if (isNotBlank(namespace)) { bucketPrefix += namespace; if (!bucketPrefix.endsWith(DELIMITER)) { bucketPrefix += DELIMITER; } } } catch (IOException e) { throw new NuxeoException(e); } }</code><technical_language>more flexible allow this a relative path, for instance relative nxserver/config (Environment.getDefault().getConfig())</technical_language>

Target:
protected void setupCloudClient() { try { String projectId = getProperty(PROJECT_ID_PROPERTY); File googleCredentials = new File(getProperty(GOOGLE_APPLICATION_CREDENTIALS)); String credentialsPath = googleCredentials.isFile() ? googleCredentials.getAbsolutePath() : new File(Environment.getDefault().getConfig(), getProperty(GOOGLE_APPLICATION_CREDENTIALS, GCP_JSON_FILE)).getAbsolutePath(); GoogleCredentials credentials = GoogleCredentials.fromStream( new ByteArrayInputStream(Files.readAllBytes(Paths.get(credentialsPath)))) .createScoped(GOOGLE_PLATFORM_SCOPE, GOOGLE_STORAGE_SCOPE); credentials.refreshIfExpired(); storage = StorageOptions.newBuilder() .setCredentials(GoogleCredentials.create(credentials.refreshAccessToken())) .setProjectId(projectId) .build() .getService(); bucketName = getProperty(BUCKET_NAME_PROPERTY); bucketPrefix = getProperty(BUCKET_PREFIX_PROPERTY, EMPTY); bucket = getOrCreateBucket(bucketName); if (!isBlank(bucketPrefix) && !bucketPrefix.endsWith(DELIMITER)) { log.warn(String.format("%s %s Google bucket prefix should end with '/' : added automatically.", BUCKET_PREFIX_PROPERTY, bucketPrefix)); bucketPrefix += DELIMITER; } if (isNotBlank(namespace)) { bucketPrefix += namespace; if (!bucketPrefix.endsWith(DELIMITER)) { bucketPrefix += DELIMITER; } } } catch (IOException e) { throw new NuxeoException(e); } }
Source:
<code>public void scanFile(AstTreeVisitorContext context) { super.scanFile(context); RandomAccessFile randomAccessFile = null; <START> try { <END> randomAccessFile = new RandomAccessFile(getContext().getFile(), "r"); if (!endsWithNewline(randomAccessFile)) { getContext().addFileIssue(this, "Add a new line at the end of this file."); } } catch (IOException e) { LOG.error("Unable to execute rule \"MissingNewlineAtEndOfFile\" for file because of error: {}", getContext().getFile().getName(), e); } finally { Closeables.closeQuietly(randomAccessFile); } }</code><technical_language>compatible java 7 a try resource</technical_language>

Target:
public void scanFile(AstTreeVisitorContext context) { super.scanFile(context); try (RandomAccessFile randomAccessFile = new RandomAccessFile(getContext().getFile(), "r")) { if (!endsWithNewline(randomAccessFile)) { getContext().addFileIssue(this, "Add a new line at the end of this file."); } } catch (IOException e) { LOG.error("Unable to execute rule \"MissingNewlineAtEndOfFile\" for file because of error: {}", getContext().getFile().getName(), e); } }
Source:
<code>public void testAllScriptsNull() throws InvalidScriptException { Script s = null; FlowScript fs = null; Mockito.when(it.getPreScript()).thenReturn(s); Mockito.when(it.getPostScript()).thenReturn(s); Mockito.when(fe.getEnvScript()).thenReturn(s); Mockito.when(sec.getScript()).thenReturn(s); Mockito.when(it.getFlowScript()).thenReturn(fs); Boolean result = new CheckEligibleTaskDescriptorScript().isTaskContainsAPIBinding(etd); <START> assertEquals(false, result); <END> }</code><technical_language>assertEquals is relevant</technical_language>

Target:
public void testAllScriptsNull() throws InvalidScriptException { Script s = null; FlowScript fs = null; Mockito.when(it.getPreScript()).thenReturn(s); Mockito.when(it.getPostScript()).thenReturn(s); Mockito.when(fe.getEnvScript()).thenReturn(s); Mockito.when(sec.getScript()).thenReturn(s); Mockito.when(it.getFlowScript()).thenReturn(fs); assertFalse(new CheckEligibleTaskDescriptorScript().isTaskContainsAPIBinding(etd)); }
Source:
<code>public void end() { try { angle = motionController.getInputSafely(); } catch (InvalidSensorException e) { angle = 0; <START> updateStatus(CHECK_NAME, SystemStatus.FAIL, e); <END> } if (Math.abs(motionController.getSetpoint() - angle) > ERROR_THRESHOLD) { updateStatus(CHECK_NAME, SystemStatus.FAIL, new Exception("ANGLE TURNED NOT WITHIN ERROR THRESHOLD")); } move.cancel(); motionController.disable(); motionController.reset(); runOnce = false; }</code><technical_language>this point, want leave function, this is error? If continue this point, angle of setpoint, error returned "ANGLE TURNED ERROR THRESHOLD", real problem is lack of input catching</technical_language>

Target:
public void end() { try { angle = motionController.getInputSafely(); } catch (InvalidSensorException e) { angle = 0; updateStatusFail(CHECK_NAME, e); } if (Math.abs(motionController.getSetpoint() - angle) > errorThreshold) { updateStatusFail(CHECK_NAME, new Exception("ANGLE TURNED NOT WITHIN ERROR THRESHOLD")); } move.cancel(); motionController.disable(); motionController.reset(); runOnce = false; outputStatuses(); }
Source:
<code>public CurrentlyPlaying createModelObject(JsonObject jsonObject) { if (jsonObject == null || jsonObject.isJsonNull()) { return null; } final Builder builder = new CurrentlyPlaying.Builder() .setContext( hasAndNotNull(jsonObject, "context") ? new Context.JsonUtil().createModelObject( jsonObject.getAsJsonObject("context")) : null) .setTimestamp( hasAndNotNull(jsonObject, "timestamp") ? jsonObject.get("timestamp").getAsLong() : null) .setProgress_ms( hasAndNotNull(jsonObject, "progress_ms") ? jsonObject.get("progress_ms").getAsInt() : null) .setIs_playing( hasAndNotNull(jsonObject, "is_playing") ? jsonObject.get("is_playing").getAsBoolean() : null) .setCurrentlyPlayingType( hasAndNotNull(jsonObject, "currently_playing_type") ? CurrentlyPlayingType.keyOf( jsonObject.get("currently_playing_type").getAsString().toLowerCase()) : null) .setActions( hasAndNotNull(jsonObject, "actions") ? new Actions.JsonUtil().createModelObject( jsonObject.getAsJsonObject("actions")) : null); <START> return builder <END> .setItem( hasAndNotNull(jsonObject, "item") && builder.currentlyPlayingType != null ? builder.currentlyPlayingType == CurrentlyPlayingType.TRACK ? new Track.JsonUtil().createModelObject(jsonObject.getAsJsonObject("item")) : builder.currentlyPlayingType == CurrentlyPlayingType.EPISODE ? new Episode.JsonUtil().createModelObject(jsonObject.getAsJsonObject("item")) : null : null) .build(); }</code><technical_language>this extra/moved return</technical_language>

Target:
public CurrentlyPlaying createModelObject(JsonObject jsonObject) { if (jsonObject == null || jsonObject.isJsonNull()) { return null; } return new CurrentlyPlaying.Builder() .setContext( hasAndNotNull(jsonObject, "context") ? new Context.JsonUtil().createModelObject( jsonObject.getAsJsonObject("context")) : null) .setTimestamp( hasAndNotNull(jsonObject, "timestamp") ? jsonObject.get("timestamp").getAsLong() : null) .setProgress_ms( hasAndNotNull(jsonObject, "progress_ms") ? jsonObject.get("progress_ms").getAsInt() : null) .setIs_playing( hasAndNotNull(jsonObject, "is_playing") ? jsonObject.get("is_playing").getAsBoolean() : null) .setItem( hasAndNotNull(jsonObject, "item") && hasAndNotNull(jsonObject, "currently_playing_type") ? (jsonObject.get("currently_playing_type").getAsString().equals("track") ? new Track.JsonUtil().createModelObject(jsonObject.getAsJsonObject("item")) : jsonObject.get("currently_playing_type").getAsString().equals("episode") ? new Episode.JsonUtil().createModelObject(jsonObject.getAsJsonObject("item")) : null) : null) .setCurrentlyPlayingType( hasAndNotNull(jsonObject, "currently_playing_type") ? CurrentlyPlayingType.keyOf( jsonObject.get("currently_playing_type").getAsString().toLowerCase()) : null) .setActions( hasAndNotNull(jsonObject, "actions") ? new Actions.JsonUtil().createModelObject( jsonObject.getAsJsonObject("actions")) : null) .build(); }
Source:
<code>private LongTaskTimer(Registry registry, Id id) { this.clock = registry.clock(); this.id = id; PolledGauge.using(registry) .withId(id) .withTag(Statistic.activeTasks) <START> .monitor(this, LongTaskTimer::activeTasks); <END> PolledGauge.using(registry) .withId(id) .withTag(Statistic.duration) .monitor(this, t -> t.duration() / NANOS_PER_SECOND); }</code><technical_language>Passing a reference this in constructor a function ultimately start a thread result in subtle problems</technical_language>

Target:
private LongTaskTimer(Registry registry, Id id) { this.clock = registry.clock(); this.id = id; }
Source:
<code>public boolean supportsCredentialType(String credentialType) { <START> return credentialType == null || credentialType.equals(CredentialModel.PASSWORD); <END> }</code><technical_language>a reviewer FYI CredentialModel.PASSWORD.equals(credentialType) in order throw a null pointer exception, constants equals accept "null" null equals function</technical_language>

Target:
public boolean supportsCredentialType(String credentialType) { return credentialType.equals(getType()); }
Source:
<code>public boolean setAlarms(final String deviceId, final long accountId, final long lastUpdatedAt, final List<Alarm> alarms, final DateTimeZone userTimeZone){ final Map<String, AttributeValueUpdate> items = generateAlarmUpdateItem(alarms, userTimeZone); <START> if(items.isEmpty() || items.containsKey(EXPECTED_RING_TIME_ATTRIBUTE_NAME) == false){ <END> return false; } final UpdateItemRequest request = generateUpdateRequest(deviceId, accountId, items); final HashMap<String, ExpectedAttributeValue> expected = new HashMap<>(); expected.put(UPDATED_AT_ATTRIBUTE_NAME, new ExpectedAttributeValue() .withComparisonOperator(ComparisonOperator.EQ) .withValue(new AttributeValue().withN(String.valueOf(lastUpdatedAt)))); expected.put(EXPECTED_RING_TIME_ATTRIBUTE_NAME, new ExpectedAttributeValue() .withComparisonOperator(ComparisonOperator.NE) .withValue(items.get(EXPECTED_RING_TIME_ATTRIBUTE_NAME).getValue()) ); request.withExpected(expected); try { final UpdateItemResult result = this.dynamoDBClient.updateItem(request); }catch (ConditionalCheckFailedException conditionalCheckFailedException){ LOGGER.warn("Cannot update alarm for device {}, account {}, last updated at {}", deviceId, accountId, lastUpdatedAt); return false; } return true; }</code><technical_language>!item.containsKey(KEY)</technical_language>

Target:
public boolean setAlarms(final String deviceId, final long accountId, final long lastUpdatedAt, final List<Alarm> alarms, final DateTimeZone userTimeZone){ final Map<String, AttributeValueUpdate> items = generateAlarmUpdateItem(alarms, userTimeZone); if(items.isEmpty() || !items.containsKey(EXPECTED_RING_TIME_ATTRIBUTE_NAME)){ return false; } final UpdateItemRequest request = generateUpdateRequest(deviceId, accountId, items); final HashMap<String, ExpectedAttributeValue> expected = new HashMap<>(); expected.put(UPDATED_AT_ATTRIBUTE_NAME, new ExpectedAttributeValue() .withComparisonOperator(ComparisonOperator.EQ) .withValue(new AttributeValue().withN(String.valueOf(lastUpdatedAt)))); expected.put(EXPECTED_RING_TIME_ATTRIBUTE_NAME, new ExpectedAttributeValue() .withComparisonOperator(ComparisonOperator.NE) .withValue(items.get(EXPECTED_RING_TIME_ATTRIBUTE_NAME).getValue()) ); request.withExpected(expected); try { final UpdateItemResult result = this.dynamoDBClient.updateItem(request); }catch (ConditionalCheckFailedException conditionalCheckFailedException){ LOGGER.warn("Cannot update alarm for device {}, account {}, last updated at {}", deviceId, accountId, lastUpdatedAt); return false; } return true; }
Source:
<code>public void loginShouldReturnDetailedUserDto() throws UserNotFoundException { given(userRepository.findByUserNameAndUserPassword(USER_NAME, USER_PASSWORD)).willReturn(userEntity); UserDTO result = userService.login(userDTO); assertThat(result, notNullValue()); assertThat(result, is(detailedUserDTO)); <START> } <END></code><technical_language>worth check mocks executed. when(modelMapper).should()...</technical_language>

Target:
public void loginShouldReturnDetailedUserDto() throws UserNotFoundException { given(userRepository.findByUserNameAndUserPassword(USER_NAME, USER_PASSWORD)).willReturn(userEntity); UserDTO result = userService.login(userDTO); then(modelMapper).should().map(userEntity, UserDTO.class); then(userRepository).should().findByUserNameAndUserPassword(USER_NAME, USER_PASSWORD); assertThat(result, is(detailedUserDTO)); }
Source:
<code>protected void cleanupTestData() throws Exception { Session s = openSession(); s.beginTransaction(); <START> try { <END> s.createQuery("delete from java.lang.Object").executeUpdate(); s.getTransaction().commit(); } finally { s.close(); } }</code><technical_language>want call s.beginTransaction() try-block add a catch-block determine if a transaction is active rollback</technical_language>

Target:
protected void cleanupTestData() throws Exception { doInHibernate(this::sessionFactory, s -> { s.createQuery("delete from java.lang.Object").executeUpdate(); }); }
Source:
<code>protected void initWorkspacePluginsState(ILaunchConfiguration configuration) throws CoreException { Map<IPluginModelBase, String> map = BundleLauncherHelper.getWorkspaceBundleMap(configuration, null, IPDELauncherConstants.SELECTED_WORKSPACE_PLUGINS); fPluginTreeViewer.setSubtreeChecked(fWorkspacePlugins, false); for (Entry<IPluginModelBase, String> entry : map.entrySet()) { IPluginModelBase model = entry.getKey(); if (fPluginTreeViewer.setChecked(model, true)) { setText(model, <START> entry.getValue().toString()); <END> } } fNumWorkspaceChecked = map.size(); resetGroup(fWorkspacePlugins); fPluginTreeViewer.setChecked(fWorkspacePlugins, fNumWorkspaceChecked > 0); fPluginTreeViewer.setGrayed(fWorkspacePlugins, fNumWorkspaceChecked > 0 && fNumWorkspaceChecked < getWorkspaceModels().length); }</code><technical_language>remove</technical_language>

Target:
protected void initWorkspacePluginsState(ILaunchConfiguration configuration) throws CoreException { Map<IPluginModelBase, String> map = BundleLauncherHelper.getWorkspaceBundleMap(configuration, null, IPDELauncherConstants.SELECTED_WORKSPACE_PLUGINS); fPluginTreeViewer.setSubtreeChecked(fWorkspacePlugins, false); for (Entry<IPluginModelBase, String> entry : map.entrySet()) { IPluginModelBase model = entry.getKey(); if (fPluginTreeViewer.setChecked(model, true)) { setText(model, entry.getValue()); } } fNumWorkspaceChecked = map.size(); resetGroup(fWorkspacePlugins); fPluginTreeViewer.setChecked(fWorkspacePlugins, fNumWorkspaceChecked > 0); fPluginTreeViewer.setGrayed(fWorkspacePlugins, fNumWorkspaceChecked > 0 && fNumWorkspaceChecked < getWorkspaceModels().length); }
Source:
<code>private String printAllProperties() { StringBuilder s = new StringBuilder(); String[] propertyKeys = ref.getPropertyKeys(); List<String> mimeTypes = getTransformerMimeTypes(); String id = getTransformerPropertyString(Constants.SERVICE_ID); String value; for (String key : propertyKeys) { if (key.equals(MIME_TYPE)) continue; if (key.equals(Constants.SERVICE_ID)) continue; value = getTransformerPropertyString(key); s.append(MessageFormat.format("\n\t{0}: {1}", key, value)); } <START> s.insert(0, MessageFormat.format("{0}: {1}\n\n\t", Constants.SERVICE_ID, id)); <END> s.append(MessageFormat.format("\n\t{0}: {1}\n", MIME_TYPE, mimeTypes.remove(0))); s.append(printMimeTypes(mimeTypes)); return s.toString(); }</code><technical_language>append id StringBuilder for loop</technical_language>

Target:
private String printAllProperties() { StringBuilder s = new StringBuilder(); String[] propertyKeys = ref.getPropertyKeys(); List<String> mimeTypes = getTransformerMimeTypes(); String id = getTransformerPropertyString(Constants.SERVICE_ID); String value; s.append(MessageFormat.format("{0}: {1}\n\n\t", Constants.SERVICE_ID, id)); for (String key : propertyKeys) { if (key.equals(MIME_TYPE) || key.equals(Constants.SERVICE_ID)) { continue; } value = getTransformerPropertyString(key); s.append(MessageFormat.format("\n\t{0}: {1}", key, value)); } s.append(MessageFormat.format("\n\t{0}s: {1}\n", MIME_TYPE, mimeTypes.remove(0))); s.append(printMimeTypes(mimeTypes)); return s.toString(); }
Source:
<code>protected Void doInBackground(Void... arg0) { if (!Utils.isNetworkAvailable(contextWeakReference.get())) { message = contextWeakReference.get().getString(R.string.error_internet_connection); userRegistered = false; return null; } String language = Locale.getDefault().getLanguage(); String country = DeviceSettingsProvider.getUserCountryCode(); <START> SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(contextWeakReference.get()); <END> String token = sharedPreferences.getString(Constants.TOKEN, Constants.NO_TOKEN); ServerAuthenticator authenticator = new ServerAuthenticator(username, password, token, CatrobatWebClient.INSTANCE.getClient(), FlavoredConstants.BASE_URL_HTTPS, (status, errorMessage) -> { message = errorMessage; userRegistered = false; }); authenticator.performCatrobatRegister(email, language, country, sharedPreferences.edit()); return null; }</code><technical_language>login task, default false</technical_language>

Target:
protected Void doInBackground(Void... arg0) { Context context = contextWeakReference.get(); if (context == null) { return null; } if (!Utils.isNetworkAvailable(context)) { message = context.getString(R.string.error_internet_connection); userRegistered = false; return null; } String language = Locale.getDefault().getLanguage(); String country = DeviceSettingsProvider.getUserCountryCode(); SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); String token = sharedPreferences.getString(Constants.TOKEN, Constants.NO_TOKEN); ServerAuthenticator authenticator = new ServerAuthenticator(username, password, token, CatrobatWebClient.INSTANCE.getClient(), FlavoredConstants.BASE_URL_HTTPS, sharedPreferences.edit(), new ServerAuthenticator.TaskListener() { @Override public void onError(int statusCode, String errorMessage) { message = context.getString(R.string.error_internet_connection); userRegistered = false; } @Override public void onSuccess() { userRegistered = true; } }); authenticator.performCatrobatRegister(email, language, country); return null; }
Source:
<code>public void start(final BundleContext context) throws Exception { super.start(context); <START> ResourcesPlugin.getWorkspace().addResourceChangeListener(SONARLINT_PROJECT_EVENT_LISTENER); <END> ResourcesPlugin.getWorkspace().addResourceChangeListener(SONARLINT_CHANGE_LISTENER, IResourceChangeEvent.POST_CHANGE); logListener = new SonarLintConsoleLogger(); SonarLintLogger.get().addLogListener(logListener); prefListener = event -> { if (event.getProperty().equals(PreferencesUtils.PREF_MARKER_SEVERITY)) { try { MarkerUtils.updateAllSonarMarkerSeverity(); } catch (CoreException e) { SonarLintLogger.get().error("Unable to update marker severity", e); } } }; getPreferenceStore().addPropertyChangeListener(prefListener); SonarLintLogger.get().info("Starting SonarLint for Eclipse " + SonarLintUtils.getPluginVersion()); checkServersStatus(); new CheckForUpdatesJob().schedule((long) 10 * 1000); analyzeOpenedFiles(); }</code><technical_language>remove listener plugin is stopped</technical_language>

Target:
public void start(final BundleContext context) throws Exception { super.start(context); ResourcesPlugin.getWorkspace().addResourceChangeListener(SONARLINT_CHANGE_LISTENER, IResourceChangeEvent.POST_CHANGE); ResourcesPlugin.getWorkspace().addResourceChangeListener(SONARLINT_PROJECT_EVENT_LISTENER); logListener = new SonarLintConsoleLogger(); SonarLintLogger.get().addLogListener(logListener); prefListener = event -> { if (event.getProperty().equals(PreferencesUtils.PREF_MARKER_SEVERITY)) { try { MarkerUtils.updateAllSonarMarkerSeverity(); } catch (CoreException e) { SonarLintLogger.get().error("Unable to update marker severity", e); } } }; getPreferenceStore().addPropertyChangeListener(prefListener); SonarLintLogger.get().info("Starting SonarLint for Eclipse " + SonarLintUtils.getPluginVersion()); checkServersStatus(); new CheckForUpdatesJob().schedule((long) 10 * 1000); analyzeOpenedFiles(); subscribeToNotifications(); }
Source:
<code>public Optional<? extends ConnectorPageSource> createPageSource( Configuration configuration, ConnectorSession session, Path path, long start, long length, long fileSize, Storage storage, Map<String, String> tableParameters, List<HiveColumnHandle> columns, TupleDomain<HiveColumnHandle> effectivePredicate, DateTimeZone hiveStorageTimeZone, HiveFileContext hiveFileContext) { if (!PageInputFormat.class.getSimpleName().equals(storage.getStorageFormat().getInputFormat())) { return Optional.empty(); } FSDataInputStream inputStream; try { inputStream = hdfsEnvironment.getFileSystem(session.getUser(), path, configuration).openFile(path, hiveFileContext); } catch (Exception e) { if (nullToEmpty(e.getMessage()).trim().equals("Filesystem closed") || e instanceof FileNotFoundException) { throw new PrestoException(HIVE_CANNOT_OPEN_SPLIT, e); } throw new PrestoException(HIVE_CANNOT_OPEN_SPLIT, splitError(e, path, start, length), e); } try { PageFilePageSource pageFilePageSource = new PageFilePageSource(inputStream, start, length, fileSize, blockEncodingSerde, columns); return Optional.of(pageFilePageSource); } catch (Throwable e) { try { inputStream.close(); } catch (IOException ignored) { } if (e instanceof PrestoException) { throw (PrestoException) e; } String message = splitError(e, path, start, length); if (e instanceof PageFileCorruptionException) { <START> throw new PrestoException(HIVE_BAD_DATA, message, e); <END> } throw new PrestoException(HIVE_CANNOT_OPEN_SPLIT, message, e); } }</code><technical_language>throw this exception directly</technical_language>

Target:
public Optional<? extends ConnectorPageSource> createPageSource( Configuration configuration, ConnectorSession session, Path path, long start, long length, long fileSize, Storage storage, Map<String, String> tableParameters, List<HiveColumnHandle> columns, TupleDomain<HiveColumnHandle> effectivePredicate, DateTimeZone hiveStorageTimeZone, HiveFileContext hiveFileContext) { if (!PageInputFormat.class.getSimpleName().equals(storage.getStorageFormat().getInputFormat())) { return Optional.empty(); } FSDataInputStream inputStream; try { inputStream = hdfsEnvironment.getFileSystem(session.getUser(), path, configuration).openFile(path, hiveFileContext); } catch (Exception e) { if (nullToEmpty(e.getMessage()).trim().equals("Filesystem closed") || e instanceof FileNotFoundException) { throw new PrestoException(HIVE_CANNOT_OPEN_SPLIT, e); } throw new PrestoException(HIVE_CANNOT_OPEN_SPLIT, splitError(e, path, start, length), e); } try { PageFilePageSource pageFilePageSource = new PageFilePageSource(inputStream, start, length, fileSize, blockEncodingSerde, columns); return Optional.of(pageFilePageSource); } catch (Throwable e) { try { inputStream.close(); } catch (IOException ignored) { } propagateIfPossible(e, PrestoException.class); throw new PrestoException(HIVE_CANNOT_OPEN_SPLIT, splitError(e, path, start, length), e); } }
Source:
<code>protected ToStringHelper string() { <START> return Objects.toStringHelper(this) <END> .add("id", id).add("account", account).add("displayText", displayText) .add("domain", domain).add("domainId", domainId).add("name", name).add("state", state); }</code><technical_language>Omit nulls not</technical_language>

Target:
protected ToStringHelper string() { return Objects.toStringHelper(this).omitNullValues() .add("id", id).add("account", account).add("displayText", displayText) .add("domain", domain).add("domainId", domainId).add("name", name).add("state", state); }
Source:
<code>private int getFlexFecHeaderOffset() { <START> return this.getHeaderLength(); <END> }</code><technical_language>I need add offset</technical_language>

Target:
public int getFlexFecHeaderOffset() { return getOffset() + this.getHeaderLength(); }
Source:
<code>void flushOnLaunch(final ErrorReportApiClient errorReportApiClient) { final List<File> crashReports = findLaunchCrashReports(); if (crashReports.isEmpty() && config.getLaunchCrashThresholdMs() > 0) { flushAsync(errorReportApiClient); } else { completed = false; HandlerThread handlerThread = new HandlerThread("Bugsnag Launch Crash Thread"); handlerThread.start(); <START> Handler handler = new Handler(handlerThread.getLooper()); <END> handler.post(new Runnable() { @Override public void run() { Logger.info("Attempting to send launch crash reports"); for (File crashReport : crashReports) { flushErrorReport(crashReport, errorReportApiClient); } Logger.info("Delivered all launch crash reports"); completed = true; } }); long waitMs = 0; while (!completed && waitMs < LAUNCH_CRASH_TIMEOUT_MS) { try { Thread.sleep(LAUNCH_CRASH_POLL_MS); waitMs += LAUNCH_CRASH_POLL_MS; } catch (InterruptedException e) { Logger.warn("Interrupted while waiting for launch crash report request"); } } handlerThread.quit(); Logger.info("Continuing with Bugsnag initialisation"); } }</code><technical_language>is this a looper? I tell, runs once</technical_language>

Target:
void flushOnLaunch(final ErrorReportApiClient errorReportApiClient) { final List<File> crashReports = findLaunchCrashReports(); if (crashReports.isEmpty() && config.getLaunchCrashThresholdMs() > 0) { flushAsync(errorReportApiClient); } else { flushOnLaunchCompleted = false; Async.run(new Runnable() { @Override public void run() { Logger.info("Attempting to send launch crash reports"); for (File crashReport : crashReports) { flushErrorReport(crashReport, errorReportApiClient); } Logger.info("Delivered all launch crash reports"); flushOnLaunchCompleted = true; } }); long waitMs = 0; while (!flushOnLaunchCompleted && waitMs < LAUNCH_CRASH_TIMEOUT_MS) { try { Thread.sleep(LAUNCH_CRASH_POLL_MS); waitMs += LAUNCH_CRASH_POLL_MS; } catch (InterruptedException e) { Logger.warn("Interrupted while waiting for launch crash report request"); } } Logger.info("Continuing with Bugsnag initialisation"); } }
Source:
<code>public void setUpPerTest() { userAnonymizedRepository.deleteAll(); <START> JUnitUtil.setUpRepositoryMock(mockUserRepository); <END> JUnitUtil.setUpRepositoryMock(mockMessageSourceRepository); Map<Class<?>, Repository<?, ?>> repositoriesMap = new HashMap<>(); repositoriesMap.put(User.class, mockUserRepository); repositoriesMap.put(MessageSource.class, mockMessageSourceRepository); repositoriesMap.put(UserAnonymized.class, userAnonymizedRepository); JUnitUtil.setUpRepositoryProviderMock(repositoriesMap); try (CryptoSession cryptoSession = CryptoSession.start(password)) { richard = JUnitUtil.createRichard(); } when(mockUserRepository.findOne(richard.getId())).thenReturn(richard); }</code><technical_language>convert mocks too</technical_language>

Target:
public void setUpPerTest() { try (CryptoSession cryptoSession = CryptoSession.start(password)) { richard = JUnitUtil.createRichard(); } reset(userRepository); }
Source:
<code>private synchronized void refreshSockets() { refreshAperture(); int n = pendingSockets + activeSockets.holder.size(); if (n < targetAperture && !activeFactories.holder.isEmpty()) { logger.debug("aperture is below target {}, adding sockets", n, targetAperture, targetAperture - n); addSockets(targetAperture - n); } else if (targetAperture < activeSockets.holder.size()) { logger.debug("aperture is above target {}, quicking 1 socket", n, targetAperture); quickSlowestRS(); } long now = Clock.now(); if (now - lastRefresh >= refreshPeriod) { if (eventListener != null) { eventListener.socketsRefreshStart(); } long prev = refreshPeriod; refreshPeriod = (long) Math.min(refreshPeriod * 1.5, maxRefreshPeriod); logger.debug("Bumping refresh period, {}->{}", prev / 1000, refreshPeriod / 1000); if (prev != refreshPeriod && eventListener != null) { eventListener.socketRefreshPeriodChanged(prev, refreshPeriod, Clock.unit()); } lastRefresh = now; addSockets(1); if (eventListener != null) { <START> eventListener.socketsRefreshCompleted(Clock.elapsedSince(now), Clock.unit()); <END> } } }</code><technical_language>I this moved addSocket, addSocket action is asynchronous</technical_language>

Target:
private synchronized void refreshSockets() { refreshAperture(); int n = pendingSockets + activeSockets.size(); if (n < targetAperture && !activeFactories.holder.isEmpty()) { logger.debug("aperture is below target {}, adding sockets", n, targetAperture, targetAperture - n); addSockets(targetAperture - n); } else if (targetAperture < activeSockets.size()) { logger.debug("aperture is above target {}, quicking 1 socket", n, targetAperture); quickSlowestRS(); } long now = Clock.now(); if (now - lastRefresh >= refreshPeriod) { if (eventListener != null) { eventListener.socketsRefreshStart(); } long prev = refreshPeriod; refreshPeriod = (long) Math.min(refreshPeriod * 1.5, maxRefreshPeriod); logger.debug("Bumping refresh period, {}->{}", prev / 1000, refreshPeriod / 1000); if (prev != refreshPeriod && eventListener != null) { eventListener.socketRefreshPeriodChanged(prev, refreshPeriod, Clock.unit()); } lastRefresh = now; addSockets(1); if (eventListener != null) { eventListener.socketsRefreshCompleted(Clock.elapsedSince(now), Clock.unit()); } } }
Source:
<code>private String getPriceProviderTooltipString() { String selectedCurrencyCode = model.getPriceFeedService().getCurrencyCode(); MarketPrice selectedMarketPrice = model.getPriceFeedService().getMarketPrice(selectedCurrencyCode); <START> if (selectedMarketPrice == null) { <END> return ""; } return Res.get("mainView.marketPrice.tooltip", "Bisq Price Index for " + selectedCurrencyCode, "", DisplayUtils.formatTime(new Date(selectedMarketPrice.getTimestampSec())), model.getPriceFeedService().getProviderNodeAddress()); }</code><technical_language>I is better: private String getPriceProviderTooltipString() { String selectedCurrencyCode = model.getPriceFeedService().getCurrencyCode(); MarketPrice selectedMarketPrice = model.getPriceFeedService().getMarketPrice(selectedCurrencyCode); return Res.get("mainView.marketPrice.tooltip", "Bisq Price Index for " + selectedCurrencyCode, "", selectedMarketPrice != null ? DisplayUtils.formatTime(new Date(selectedMarketPrice.getTimestampSec())) : Res.get("shared.na"), model.getPriceFeedService().getProviderNodeAddress()); }</technical_language>

Target:
private String getPriceProviderTooltipString() { String selectedCurrencyCode = model.getPriceFeedService().getCurrencyCode(); MarketPrice selectedMarketPrice = model.getPriceFeedService().getMarketPrice(selectedCurrencyCode); return Res.get("mainView.marketPrice.tooltip", "Bisq Price Index for " + selectedCurrencyCode, "", selectedMarketPrice != null ? DisplayUtils.formatTime(new Date(selectedMarketPrice.getTimestampSec())) : Res.get("shared.na"), model.getPriceFeedService().getProviderNodeAddress()); }
Source:
<code><START> private void addSuggestion(Map<Account.Id, AccountInfo> map, Account account, <END> AccountInfo info, VisibilityControl visibilityControl) throws OrmException { if (map.containsKey(account.getId())) { return; } if (!account.isActive()) { return; } if (visibilityControl.isVisible(account)) { map.put(account.getId(), info); } }</code><technical_language>This needs filter AccountVisibility. tests apply: * suggestion change? * caller suggested user</technical_language>

Target:
private void addSuggestion(Map<Account.Id, AccountInfo> map, Account account, AccountInfo info, VisibilityControl visibilityControl) throws OrmException { if (!map.containsKey(account.getId()) && account.isActive() && visibilityControl.isVisibleTo(account)) { map.put(account.getId(), info); } }