auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static Layer buildLayer(String kerasLayerClass, Map<String,Object> kerasConfig, boolean isOutput) { Layer layer = null; switch (kerasLayerClass) { case "Dense": case "TimeDistributedDense": layer = buildDenseLayer(kerasConfig); break; case "LSTM": layer = buildGravesLstmLayer(kerasConfig); break; case "Convolution2D": layer = buildConvolutionLayer(kerasConfig); break; case "MaxPooling2D": layer = buildSubsamplingLayer(kerasConfig); break; case "Flatten": log.warn("DL4J adds reshaping layers during model compilation"); <START> break; <END> default: throw new IncompatibleKerasConfigurationException("Unsupported keras layer type " + kerasLayerClass); } return layer; }</code><technical_language>want link here</technical_language>

Target:
public static Layer buildLayer(String kerasLayerClass, Map<String,Object> kerasConfig, boolean isOutput) { Layer layer = null; switch (kerasLayerClass) { case KERAS_LAYER_DENSE: case KERAS_LAYER_TIME_DISTRIBUTED_DENSE: layer = buildDenseLayer(kerasConfig); break; case KERAS_LAYER_LSTM: layer = buildGravesLstmLayer(kerasConfig); break; case KERAS_LAYER_CONVOLUTION_2D: layer = buildConvolutionLayer(kerasConfig); break; case KERAS_LAYER_MAX_POOLING_2D: layer = buildSubsamplingLayer(kerasConfig); break; case KERAS_LAYER_FLATTEN: log.warn("DL4J adds reshaping layers during model compilation: <LINK_0>"); break; default: throw new IncompatibleKerasConfigurationException("Unsupported keras layer type " + kerasLayerClass); } return layer; }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Package that = (Package) o; if (!name.equals(that.name)) return false; return true; <START> } <END></code><technical_language>parts of this function is tested, I codecov bails out. checks needed? Specifically, check for class equality problems in case subclasses Package, right? statements written return name.equals(that.name); avoid a branch need tested</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Package)) return false; Package that = (Package) o; return name.equals(that.name); }
Source:
<code>public void testEmptyGroup() { try { MessageType t5 = new MessageType("root1", new GroupType(REQUIRED, "g1"), new GroupType(REQUIRED, "g2", <START> new PrimitiveType(OPTIONAL, BINARY, "b"))); <END> } catch (InvalidSchemaException e) { assertEquals("A group type can not be empty. Parquet does not support empty group without leaves. Empty group: g1", e.getMessage()); } }</code><technical_language>need put: fail("this throw") in this try block -- if this throws test pass</technical_language>

Target:
public void testEmptyGroup() { try { MessageType t5 = new MessageType("root1", new GroupType(REQUIRED, "g1"), new GroupType(REQUIRED, "g2", new PrimitiveType(OPTIONAL, BINARY, "b"))); fail("should throw InvalidSchemaException when GroupType contains no child"); } catch (InvalidSchemaException e) { assertEquals("A group type can not be empty. Parquet does not support empty group without leaves. Empty group: g1", e.getMessage()); } }
Source:
<code>public void testMagicConversion() { <START> String magicValue0 = KafkaPassthroughRecordMagicConverter.convertMagicToString(RecordBatch.MAGIC_VALUE_V0); <END> Assert.assertEquals(new byte[] { RecordBatch.MAGIC_VALUE_V0 }, KafkaPassthroughRecordMagicConverter.convertMagicStringToByteArray(magicValue0)); String magicValue1 = KafkaPassthroughRecordMagicConverter.convertMagicToString(RecordBatch.MAGIC_VALUE_V1); Assert.assertEquals(new byte[] { RecordBatch.MAGIC_VALUE_V1 }, KafkaPassthroughRecordMagicConverter.convertMagicStringToByteArray(magicValue1)); String magicValue2 = KafkaPassthroughRecordMagicConverter.convertMagicToString(RecordBatch.MAGIC_VALUE_V2); Assert.assertEquals(new byte[] { RecordBatch.MAGIC_VALUE_V2 }, KafkaPassthroughRecordMagicConverter.convertMagicStringToByteArray(magicValue2)); String magicValueCurrent = KafkaPassthroughRecordMagicConverter.convertMagicToString(RecordBatch.CURRENT_MAGIC_VALUE); Assert.assertEquals(new byte[] { RecordBatch.CURRENT_MAGIC_VALUE }, KafkaPassthroughRecordMagicConverter.convertMagicStringToByteArray(magicValueCurrent)); }</code><technical_language>feel free ignore, test read a for loop iterating possibly magic byte values</technical_language>

Target:
public void testMagicConversion() { byte[] magics = { RecordBatch.MAGIC_VALUE_V0, RecordBatch.MAGIC_VALUE_V1, RecordBatch.MAGIC_VALUE_V2, RecordBatch.CURRENT_MAGIC_VALUE }; for (byte magic : magics) { String magicString = KafkaPassthroughRecordMagicConverter.convertMagicToString(magic); Assert.assertEquals(new byte[] { magic }, KafkaPassthroughRecordMagicConverter.convertMagicStringToByteArray(magicString)); } }
Source:
<code>private String formatString(final long length) { <START> if (length > 1000) { <END> return (long) Math.ceil(length / 1000) + "kb"; } return length + "b"; }</code><technical_language>Magic number. Please run checkstyle/pmd/findbugs fix violations</technical_language>

Target:
private String formatString(final long length) { if (length > THOUSAND) { return (long) Math.ceil(length / THOUSAND) + "kb"; } return length + "b"; }
Source:
<code>public String email() throws IOException { final XML body = this.request.fetch().as(XmlResponse.class).xml(); <START> final List<String> lverified = body <END> .xpath("/page/alias/email/text()"); final String verified; if (lverified.isEmpty()) { verified = ""; } else { verified = lverified.get(0); } final List<String> lunverified = body .xpath("/page/alias/newEmail/text()"); final String complete; if (lunverified.isEmpty()) { complete = verified; } else { complete = String.format("%s!%s", verified, lunverified.get(0)); } return complete; }</code><technical_language>@CarlosGines get rid of lverified variable inline body.xpath() in condition</technical_language>

Target:
public String email() throws IOException { return this.request.fetch() .as(XmlResponse.class) .xml() .xpath("/page/alias/email/text()") .get(0); }
Source:
<code>public void newTsConfig() { Request request = new Request.Builder() <START> .url("http://localhost:" + port + "/new-tsconfig") <END> .post(RequestBody.create(null, "")) .build(); try (Response response = client.newCall(request).execute()) { } catch (IOException e) { LOG.error("Failed to post new-tsconfig", e); } }</code><technical_language>define a class member for "http://localhost:" + port this expression appears twice</technical_language>

Target:
public boolean newTsConfig() { Request request = new Request.Builder() .url(url("new-tsconfig")) .post(RequestBody.create(null, "")) .build(); try (Response response = client.newCall(request).execute()) { String body = response.body().string(); return "OK!".equals(body); } catch (IOException e) { LOG.error("Failed to post new-tsconfig", e); } return false; }
Source:
<code>private <T> Collection<PluginDesc<T>> getPluginDesc( Reflections reflections, Class<T> klass, ClassLoader loader ) throws InstantiationException, IllegalAccessException { Collection<PluginDesc<T>> result = new ArrayList<>(); Set<Class<? extends T>> plugins; try { plugins = reflections.getSubTypesOf(klass); } catch (ReflectionsException e) { <START> log.debug("Reflection scanner could not find any classes for URLs {}", <END> reflections.getConfiguration().getUrls()); return result; } for (Class<? extends T> plugin : plugins) { if (PluginUtils.isConcrete(plugin)) { result.add(new PluginDesc<>(plugin, versionFor(plugin), loader)); } else { log.debug("Skipping as it is not concrete implementation", plugin); } } return result; }</code><technical_language>nit: plural (Reflections) more refers library/class</technical_language>

Target:
private <T> Collection<PluginDesc<T>> getPluginDesc( Reflections reflections, Class<T> klass, ClassLoader loader ) throws InstantiationException, IllegalAccessException { Set<Class<? extends T>> plugins; try { plugins = reflections.getSubTypesOf(klass); } catch (ReflectionsException e) { log.debug("Reflections scanner could not find any classes for URLs: " + reflections.getConfiguration().getUrls(), e); return Collections.emptyList(); } Collection<PluginDesc<T>> result = new ArrayList<>(); for (Class<? extends T> plugin : plugins) { if (PluginUtils.isConcrete(plugin)) { result.add(new PluginDesc<>(plugin, versionFor(plugin), loader)); } else { log.debug("Skipping as it is not concrete implementation", plugin); } } return result; }
Source:
<code>public <T> TypeAdapter<T> getFieldAdapter(Field field) { <START> if (fieldAdapterFactories == null || fieldAdapterFactories.isEmpty()) { <END> return null; } for (Annotation fieldAnnotation : field.getAnnotations()) { Class<? extends Annotation> annotationType = fieldAnnotation.annotationType(); if (fieldAdapterFactories.containsKey(annotationType)) { FieldAdapterFactory fieldAdapterFactory = fieldAdapterFactories.get(annotationType); return fieldAdapterFactory.create(fieldAnnotation, field); } } for (Annotation classAnnotation : field.getDeclaringClass().getAnnotations()) { Class<? extends Annotation> annotationType = classAnnotation.annotationType(); if (fieldAdapterFactories.containsKey(annotationType)) { FieldAdapterFactory fieldAdapterFactory = fieldAdapterFactories.get(annotationType); return fieldAdapterFactory.create(classAnnotation, field); } } return null; }</code><technical_language>I do this shortcut</technical_language>

Target:
public <T> TypeAdapter<T> getFieldAdapter(Field field) { if (fieldAdapterFactories == null || fieldAdapterFactories.isEmpty()) { return null; } Class<?> clazz = field.getDeclaringClass(); for (Map.Entry<Class<? extends Annotation>, FieldAdapterFactory> entry : fieldAdapterFactories.entrySet()) { Class<? extends Annotation> annotationType = entry.getKey(); if (field.isAnnotationPresent(annotationType)) { FieldAdapterFactory fieldAdapterFactory = entry.getValue(); return fieldAdapterFactory.create(this, field.getAnnotation(annotationType), field); } if (clazz.isAnnotationPresent(annotationType)) { FieldAdapterFactory fieldAdapterFactory = entry.getValue(); return fieldAdapterFactory.create(this, clazz.getAnnotation(annotationType), field); } } return null; }
Source:
<code>public void probeAndRun(String id) { MigrationStatus status = getStatus(id); if (status == null) { probeAndSetState(id); } var steps = Migration.from(getDescriptor(XP_CONFIG, id), status).getSteps(); if (steps.size() != 1) { throw new IllegalStateException(String.format( <START> "Migration %s must have only one runnable step from state: %s", id, status.getState())); END> } runStep(id, steps.get(0).getId()); }</code><technical_language>suggestion "Migration: %s runnable step state: %s", id, status.getState())); // NOSONAR</technical_language>

Target:
public void probeAndRun(String id) { MigrationStatus status = getStatus(id); if (status == null) { probeAndSetState(id); } var steps = Migration.from(getDescriptor(XP_CONFIG, id), status).getSteps(); if (steps.size() != 1) { throw new IllegalStateException(String.format( "Migration: %s must have only one runnable step from state: %s", id, status.getState())); } runStep(id, steps.get(0).getId()); }
Source:
<code>public void testArraySize() throws Exception { <START> String sqlString = generateThreeElementArrayString((int) MAX_FUNCTION_MEMORY.toBytes() + 1); <END> assertInvalidFunction(sqlString, EXCEEDED_FUNCTION_MEMORY_LIMIT); }</code><technical_language>Ints.checkedCast remove SuppressWarnings</technical_language>

Target:
public void testArraySize() throws Exception { int size = toIntExact(MAX_FUNCTION_MEMORY.toBytes() + 1); assertInvalidFunction( "array_distinct(ARRAY['" + Strings.repeat("x", size) + "', '" + Strings.repeat("y", size) + "', '" + Strings.repeat("z", size) + "'])", EXCEEDED_FUNCTION_MEMORY_LIMIT); }
Source:
<code>private void runAutodefineForOneProvider(Guid providerId, int index) { <START> try (EngineLock lock = acquireLockForProvider(providerId)) { <END> Network externalNetwork = createExternalNetwork(calcExternalNetworkName(index), providerId); AddNetworkStoragePoolParameters storagePoolParameters = new AddNetworkStoragePoolParameters(getNetwork().getStoragePoolId(), externalNetwork); storagePoolParameters.setVnicProfileRequired(false); ActionReturnValue returnValue = runInternalAction(ActionType.AddNetworkOnProvider, storagePoolParameters); if (returnValue.getSucceeded()) { Guid externalNetworkId = returnValue.getActionReturnValue(); networkHelper.attachNetworkToClusters(externalNetworkId, clustersByProvider.get(providerId)); externalNetwork.setId(externalNetworkId); networkHelper.addVnicProfileWithoutFilter(externalNetwork, true); } } catch (Exception e) { log.error("Exception occurred while acquiring lock for provider: {}", providerId.toString()); log.debug("Exception", e); } }</code><technical_language>command locking mechanism? (overriding 'getExclusiveLocks' 'applyLockProperties'). 'lockProperties.withWait(true)' create a waiting lock</technical_language>

Target:
private void runAutodefineForOneProvider(Guid providerId, int index) { try (EngineLock lock = acquireLockForProvider(providerId)) { Network externalNetwork = createExternalNetwork(calcExternalNetworkName(index), providerId); AddNetworkStoragePoolParameters storagePoolParameters = new AddNetworkStoragePoolParameters(getNetwork().getStoragePoolId(), externalNetwork); storagePoolParameters.setNetworkClusterList(networkHelper.createNetworkClusters(clustersByProvider.get( providerId))); runInternalAction(ActionType.AddNetworkOnProvider, storagePoolParameters); } }
Source:
<code>protected void reject(final Diff diff, boolean rightToLeft) { ReferenceChange referenceChange = (ReferenceChange)diff; DifferenceSource source = referenceChange.getSource(); switch (referenceChange.getKind()) { case ADD: removeFromTarget(referenceChange, rightToLeft); break; case DELETE: addInTarget(referenceChange, rightToLeft); break; case MOVE: moveElement(referenceChange, rightToLeft); break; case CHANGE: EObject container = null; if (source == DifferenceSource.LEFT) { container = referenceChange.getMatch().getLeft(); } else { container = referenceChange.getMatch().getRight(); } if (container != null) { <START> final EObject leftValue = (EObject)safeEGet(container, referenceChange.getReference()); <END> if (leftValue == null) { addInTarget(referenceChange, rightToLeft); } else { resetInTarget(referenceChange, rightToLeft); } } else { addInTarget(referenceChange, rightToLeft); } break; default: break; } }</code><technical_language>please, split changes in another review</technical_language>

Target:
protected void reject(final Diff diff, boolean rightToLeft) { ReferenceChange referenceChange = (ReferenceChange)diff; DifferenceSource source = referenceChange.getSource(); switch (referenceChange.getKind()) { case ADD: removeFromTarget(referenceChange, rightToLeft); break; case DELETE: addInTarget(referenceChange, rightToLeft); break; case MOVE: moveElement(referenceChange, rightToLeft); break; case CHANGE: EObject container = null; if (source == DifferenceSource.LEFT) { container = referenceChange.getMatch().getLeft(); } else { container = referenceChange.getMatch().getRight(); } if (container != null) { final EObject leftValue = (EObject)container.eGet(referenceChange.getReference()); if (leftValue == null) { addInTarget(referenceChange, rightToLeft); } else { resetInTarget(referenceChange, rightToLeft); } } else { addInTarget(referenceChange, rightToLeft); } break; default: break; } }
Source:
<code>public String getApplet() { <START> String templateUri = "..?branch={branch-id}&selected_types={selected-types}"; <END> OseeAppletPage pageUtil = new OseeAppletPage(orcsApi.getQueryFactory(null).branchQuery()); ArtifactTypeOptionsRule selectRule = new ArtifactTypeOptionsRule(orcsApi); String toReturn = pageUtil.realizeApplet(resourceRegistry, "publishLowHighReport.html", getClass(), selectRule); toReturn = toReturn.replaceAll(REQ_REPORT__PUBLISH_TEMPLATE_URI_TAG, templateUri); toReturn = toReturn.replaceAll(REQ_REPORT__BRANCH_PARAM_TAG, "{branch-id}"); toReturn = toReturn.replaceAll(REQ_REPORT__SELECTED_TYPES_TAG, "{selected-types}"); return toReturn; }</code><technical_language>apply 'tweak' done SRSPublish well</technical_language>

Target:
public String getApplet() { String templateUri = "..?branch={branch-id}&selected_types={selected-types}"; OseeAppletPage pageUtil = new OseeAppletPage(orcsApi.getQueryFactory(null).branchQuery()); ArtifactTypeOptionsRule selectRule = new ArtifactTypeOptionsRule("artifactTypeSelect", getTypes(), new HashSet<String>()); String toReturn = pageUtil.realizeApplet(resourceRegistry, "publishLowHighReport.html", getClass(), selectRule); toReturn = toReturn.replaceAll(REQ_REPORT__PUBLISH_TEMPLATE_URI_TAG, templateUri); toReturn = toReturn.replaceAll(REQ_REPORT__BRANCH_PARAM_TAG, "{branch-id}"); toReturn = toReturn.replaceAll(REQ_REPORT__SELECTED_TYPES_TAG, "{selected-types}"); return toReturn; }
Source:
<code>public void init( String clientName, Map<String,Value> authToken ) { Collector.InitCollector initCollector = new Collector.InitCollector(); queueMessage( new InitMessage( clientName, authToken ), initCollector ); sync(); <START> this.serverInfo = new InternalServerInfo( socket.address(), initCollector.server() ); <END> }</code><technical_language>InternalServerInfo constructor's arg is called String version pass initCollector.server() for it. This is a bit confusing. InitCollector#server() renamed #serverVersion()</technical_language>

Target:
public void init( String clientName, Map<String,Value> authToken ) { Collector.InitCollector initCollector = new Collector.InitCollector(); queueMessage( new InitMessage( clientName, authToken ), initCollector ); sync(); this.serverInfo = new InternalServerInfo( socket.address(), initCollector.serverVersion() ); }
Source:
<code>public Set<IType> getType(Call call, ValidationServices services, IValidationResult validationResult, IReadOnlyQueryEnvironment queryEnvironment, List<IType> argTypes) { <START> if (returnTypes == null) { <END> returnTypes = new LinkedHashSet<IType>(); Type returnType = method.getGenericReturnType(); returnTypes.addAll(getIType(queryEnvironment, returnType)); } return returnTypes; }</code><technical_language>If call this query environments, need replace cached returnTypes a new one. This account here</technical_language>

Target:
public Set<IType> getType(Call call, ValidationServices services, IValidationResult validationResult, IReadOnlyQueryEnvironment queryEnvironment, List<IType> argTypes) { if (knwonEnvironment != queryEnvironment || returnTypes == null) { knwonEnvironment = queryEnvironment; returnTypes = new LinkedHashSet<IType>(); Type returnType = method.getGenericReturnType(); returnTypes.addAll(getIType(queryEnvironment, returnType)); } return returnTypes; }
Source:
<code>public int hashCode() { final int prime = 31; int result = 1; <START> result = prime * result + ((id == null) ? 0 : id.hashCode()); <END> result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((version == null) ? 0 : version.hashCode()); result = prime * result + ((description == null) ? 0 : description.hashCode()); result = prime * result + ((category == null) ? 0 : category.hashCode()); return result; }</code><technical_language>please java.util.Objects.hash() simplifies this method</technical_language>

Target:
public int hashCode() { return Objects.hash(id, name, version, description, category); }
Source:
<code>public ServiceMayNotContinueException(String msg, Throwable cause) { <START> super(msg); <END> initCause(cause); }</code><technical_language>unrelated: this do 'super(msg, cause)' require Java 7</technical_language>

Target:
public ServiceMayNotContinueException(String msg, Throwable cause) { super(msg, cause); statusCode = HttpServletResponse.SC_FORBIDDEN; }
Source:
<code><START> public Mono<Response<Key>> getKey() { <END> return withContext(context -> getKey(context)); }</code><technical_language>If returning Mono<Response<T>>, method name end *WithResponse. In this case, getKeyWithResponse</technical_language>

Target:
public Mono<Key> getKey() { return getKeyWithResponse().flatMap(FluxUtil::toMono); }
Source:
<code><START> private boolean recoverConnection() throws IOException, InterruptedException { <END> while (!manuallyClosed) { try { RecoveryAwareAMQConnection newConn = this.cf.newConnection(); synchronized(recoveryLock) { if (!manuallyClosed) { this.delegate = newConn; return true; } } try { newConn.close(); } catch (Exception e) { } return false; } catch (Exception e) { Thread.sleep(this.params.getNetworkRecoveryInterval()); this.getExceptionHandler().handleConnectionRecoveryException(this, e); } } return false; }</code><technical_language>I disagree decision turn a side-effecting method a boolean. a separate method (or a condition manuallyClosed)</technical_language>

Target:
private boolean recoverConnection() throws IOException, InterruptedException { while (!manuallyClosed) { try { RecoveryAwareAMQConnection newConn = this.cf.newConnection(); synchronized(recoveryLock) { if (!manuallyClosed) { this.delegate = newConn; return true; } } newConn.abort(); return false; } catch (Exception e) { Thread.sleep(this.params.getNetworkRecoveryInterval()); this.getExceptionHandler().handleConnectionRecoveryException(this, e); } } return false; }
Source:
<code>public GarbageCollectorCycle() { <START> started = finished = candidates = inUse = deleted = errors = 0l; <END> }</code><technical_language>line, do this declare variables remove default constructor. This match existing style</technical_language>

Target:
public GarbageCollectorCycle()
Source:
<code>private Item getBasicFilmWithoutBroadcast(ProgData progData) { ImmutableList.Builder<String> uris = ImmutableList.builder(); Optional<String> rtFilmIdentifier = rtFilmIdentifierFor(progData); <START> rtFilmIdentifier.transform(rt -> uris.add(PaHelper.getFilmRtAlias(rt))); <END> uris.add(PaHelper.getAlias(progData.getProgId())); uris.add(PaHelper.getFilmUri(identifierFor(progData))); Map<String, Identified> resolvedContent = contentResolver.findByUris( uris.build() ).asResolvedMap(); Film film = getFilmFromResolvedContent(progData, rtFilmIdentifier, resolvedContent); if (progData.getFilmYear() != null && MoreStrings.containsOnlyAsciiDigits(progData.getFilmYear())) { film.setYear(Integer.parseInt(progData.getFilmYear())); } return film; }</code><technical_language>getFilmRtAlias? getLegacyFilmUri no</technical_language>

Target:
private Item getBasicFilmWithoutBroadcast(ProgData progData) { ImmutableList.Builder<String> uris = ImmutableList.builder(); Optional<String> rtFilmIdentifier = rtFilmIdentifierFor(progData); Optional<String> legacyFilmUri = rtFilmIdentifier.transform(PaHelper::getLegacyFilmUri); legacyFilmUri.transform(uris::add); uris.add(PaHelper.getAlias(progData.getProgId())); uris.add(PaHelper.getFilmUri(identifierFor(progData))); Map<String, Identified> resolvedContent = contentResolver.findByUris( uris.build() ).asResolvedMap(); Film film = getFilmFromResolvedContent(progData, resolvedContent, legacyFilmUri); if (progData.getFilmYear() != null && MoreStrings.containsOnlyAsciiDigits(progData.getFilmYear())) { film.setYear(Integer.parseInt(progData.getFilmYear())); } return film; }
Source:
<code>static RNMGLAnnotationOptions markerOptionsFromJS(ReadableMap annotation, Context context) { MarkerOptions marker = new MarkerOptions(); double latitude = annotation.getArray("coordinates").getDouble(0); double longitude = annotation.getArray("coordinates").getDouble(1); LatLng markerCenter = new LatLng(latitude, longitude); marker.position(markerCenter); if (annotation.hasKey("title")) { String title = annotation.getString("title"); marker.title(title); } if (annotation.hasKey("subtitle")) { String subtitle = annotation.getString("subtitle"); marker.snippet(subtitle); } if (annotation.hasKey("annotationImage")) { ReadableMap annotationImage = annotation.getMap("annotationImage"); String annotationURL = annotationImage.getString("url"); try { int width = -1; <START> int height = -1; <END> if (annotationImage.hasKey("height") && annotationImage.hasKey("width")) { float scale = context.getResources().getDisplayMetrics().density; height = Math.round((float)annotationImage.getInt("height") * scale); width = Math.round((float)annotationImage.getInt("width") * scale); } marker.icon(iconFromPathAndSize(context, annotationURL, width, height)); } catch (Exception e) { e.printStackTrace(); } } return new RNMGLMarkerOptions(marker); }</code><technical_language>Curious, -1 defaults</technical_language>

Target:
static RNMGLAnnotationOptions markerOptionsFromJS(ReadableMap annotation, Context context) { MarkerOptions marker = new MarkerOptions(); double latitude = annotation.getArray("coordinates").getDouble(0); double longitude = annotation.getArray("coordinates").getDouble(1); LatLng markerCenter = new LatLng(latitude, longitude); marker.position(markerCenter); if (annotation.hasKey("title")) { String title = annotation.getString("title"); marker.title(title); } if (annotation.hasKey("subtitle")) { String subtitle = annotation.getString("subtitle"); marker.snippet(subtitle); } if (annotation.hasKey("annotationImage")) { ReadableMap annotationImage = annotation.getMap("annotationImage"); ReadableMap annotationSource = annotationImage.getMap("source"); try { int width = -1; int height = -1; if (annotationImage.hasKey("height") && annotationImage.hasKey("width")) { float scale = context.getResources().getDisplayMetrics().density; height = Math.round((float)annotationImage.getInt("height") * scale); width = Math.round((float)annotationImage.getInt("width") * scale); } marker.icon(iconFromSourceAndSize(context, annotationSource, width, height)); } catch (Exception e) { e.printStackTrace(); } } return new RNMGLMarkerOptions(marker); }
Source:
<code>public void doNotSweepAnythingAfterEntryWithCommitTsAfterSweepTs() { immutableTs = 1000L; enqueueWrite(TABLE_CONS, 900); enqueueWrite(TABLE_CONS, 910); enqueueWriteCommitedAt(TABLE_CONS, 950, 1000); enqueueWrite(TABLE_CONS, 970); enqueueWrite(TABLE_CONS, 920); sweepQueue.sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD)); assertThat(progress.getLastSweptTimestamp(ShardAndStrategy.conservative(CONS_SHARD))).isEqualTo(920L); ArgumentCaptor<Map> argument = ArgumentCaptor.forClass(Map.class); verify(spiedKvs, times(1)).deleteAllTimestamps(eq(TABLE_CONS), argument.capture(), eq(false)); assertThat(argument.getValue()).containsValue(920L); sweepQueue.sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD)); assertThat(progress.getLastSweptTimestamp(ShardAndStrategy.conservative(CONS_SHARD))).isEqualTo(920L); verify(spiedKvs, times(1)).deleteAllTimestamps(any(TableReference.class), anyMap(), eq(false)); <START> immutableTs = 1101L; <END> sweepQueue.sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD)); assertThat(progress.getLastSweptTimestamp(ShardAndStrategy.conservative(CONS_SHARD))).isEqualTo(1101L - 1L); verify(spiedKvs, times(2)).deleteAllTimestamps(eq(TABLE_CONS), argument.capture(), eq(false)); assertThat(argument.getValue()).containsValue(970L); }</code><technical_language>1001L more sense catch errors more precisely check logic</technical_language>

Target:
public void doNotSweepAnythingAfterEntryWithCommitTsAfterSweepTs() { immutableTs = 1000L; enqueueWriteCommitted(TABLE_CONS, 900); enqueueWriteCommitted(TABLE_CONS, 910); enqueueWriteCommitted(TABLE_CONS, 920); enqueueWriteCommitedAt(TABLE_CONS, 950, immutableTs); enqueueWriteCommitted(TABLE_CONS, 970); sweepQueue.sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD)); assertThat(progress.getLastSweptTimestamp(ShardAndStrategy.conservative(CONS_SHARD))).isEqualTo(920L); ArgumentCaptor<Map> argument = ArgumentCaptor.forClass(Map.class); verify(spiedKvs, times(1)).deleteAllTimestamps(eq(TABLE_CONS), argument.capture(), eq(false)); assertThat(argument.getValue()).containsValue(920L); sweepQueue.sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD)); assertThat(progress.getLastSweptTimestamp(ShardAndStrategy.conservative(CONS_SHARD))).isEqualTo(920L); verify(spiedKvs, times(1)).deleteAllTimestamps(any(TableReference.class), anyMap(), eq(false)); immutableTs = 1001L; sweepQueue.sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD)); assertThat(progress.getLastSweptTimestamp(ShardAndStrategy.conservative(CONS_SHARD))).isEqualTo(1001L - 1L); verify(spiedKvs, times(2)).deleteAllTimestamps(eq(TABLE_CONS), argument.capture(), eq(false)); assertThat(argument.getValue()).containsValue(970L); }
Source:
<code>protected void publishMetrics(Latency latency, String prefix, String partition, String stream, String group) { if (verbose) { log.info(latency.toString()); } long metricTime = latency.upper() / 1000; <START> String host = ""; <END> List<String> mTags = new ArrayList<>(tags.size() + 3); mTags.addAll(tags); mTags.add("stream:" + stream); mTags.add("consumer:" + group); mTags.add("partition:" + partition); try { Transport.Request request = transport.prepare(); request.addGauge(new DatadogGauge(prefix + ".lag", latency.lag().lag(), metricTime, host, mTags)); request.addGauge(new DatadogGauge(prefix + ".end", latency.lag().upper(), metricTime, host, mTags)); request.addGauge(new DatadogGauge(prefix + ".pos", latency.lag().lower(), metricTime, host, mTags)); request.addGauge(new DatadogGauge(prefix + ".latency", latency.latency(), metricTime, host, mTags)); request.send(); } catch (IOException e) { log.error("Fail to prepare metric to datadog " + prefix + " " + latency, e); } catch (Exception e) { log.error("Fail to send metric to datadog " + prefix + " " + latency, e); } }</code><technical_language>Is expected empty string here</technical_language>

Target:
protected void publishMetrics(Latency latency, String prefix, String partition, String stream, String group) { if (verbose) { log.info(latency.toString()); } long metricTime = latency.upper() / 1000; List<String> mTags = new ArrayList<>(tags.size() + 3); mTags.addAll(tags); mTags.add("stream:" + stream); mTags.add("consumer:" + group); mTags.add("partition:" + partition); try { Transport.Request request = transport.prepare(); request.addGauge(new DatadogGauge(prefix + ".lag", latency.lag().lag(), metricTime, hostname, mTags)); request.addGauge(new DatadogGauge(prefix + ".end", latency.lag().upper(), metricTime, hostname, mTags)); request.addGauge(new DatadogGauge(prefix + ".pos", latency.lag().lower(), metricTime, hostname, mTags)); request.addGauge(new DatadogGauge(prefix + ".latency", latency.latency(), metricTime, hostname, mTags)); request.send(); } catch (IOException e) { log.error("Fail to prepare metric to datadog " + prefix + " " + latency, e); } catch (Exception e) { log.error("Fail to send metric to datadog " + prefix + " " + latency, e); } }
Source:
<code>public void openCloseUpdate() { OpenCloseValue v = new OpenCloseValue("fancyON", "fancyOff"); assertThat(v.update(OpenClosedType.CLOSED), is("fancyOff")); assertThat(v.getValue(), is(OpenClosedType.CLOSED)); assertThat(v.update(OpenClosedType.OPEN), is("fancyON")); assertThat(v.getValue(), is(OpenClosedType.OPEN)); assertThat(v.update(new StringType("CLOSED")), is("fancyOff")); assertThat(v.getValue(), is(OpenClosedType.CLOSED)); assertThat(v.update(new StringType("OPEN")), is("fancyON")); assertThat(v.getValue(), is(OpenClosedType.OPEN)); <START> assertThat(v.update(new StringType("CLOSED")), is("fancyOff")); <END> assertThat(v.getValue(), is(OpenClosedType.CLOSED)); assertThat(v.update(new StringType("OPEN")), is("fancyON")); assertThat(v.getValue(), is(OpenClosedType.OPEN)); }</code><technical_language>this block a copy of previous block. intend test else here</technical_language>

Target:
public void openCloseUpdate() { OpenCloseValue v = new OpenCloseValue("fancyON", "fancyOff"); assertThat(v.update(OpenClosedType.CLOSED), is("fancyOff")); assertThat(v.getValue(), is(OpenClosedType.CLOSED)); assertThat(v.update(OpenClosedType.OPEN), is("fancyON")); assertThat(v.getValue(), is(OpenClosedType.OPEN)); assertThat(v.update(new StringType("CLOSED")), is("fancyOff")); assertThat(v.getValue(), is(OpenClosedType.CLOSED)); assertThat(v.update(new StringType("OPEN")), is("fancyON")); assertThat(v.getValue(), is(OpenClosedType.OPEN)); assertThat(v.update(new StringType("fancyOff")), is("fancyOff")); assertThat(v.getValue(), is(OpenClosedType.CLOSED)); assertThat(v.update(new StringType("fancyON")), is("fancyON")); assertThat(v.getValue(), is(OpenClosedType.OPEN)); }
Source:
<code>public void testUnmarshallTopLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateEscalationEvent emptyEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_OUTGOING_EDGE_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); <START> assertEscalationEventExecutionSet(emptyEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, ""); <END> assertDataIOSet(emptyEvent.getDataIOSet(), EMPTY_VALUE); }</code><technical_language>suggestion assertEscalationEventExecutionSet(emptyEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, EMPTY_VALUE);</technical_language>

Target:
public void testUnmarshallTopLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateEscalationEvent emptyEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_OUTGOING_EDGE_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertEscalationEventExecutionSet(emptyEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, EMPTY_VALUE); assertDataIOSet(emptyEvent.getDataIOSet(), EMPTY_VALUE); }
Source:
<code>public FeatureEditorListPanel(String aId, IModel<AnnotatorState> aModel, AnnotationDetailEditorPanel aOwner) { super(aId, aModel); setOutputMarkupPlaceholderTag(true); owner = aOwner; featureEditorContainer = new WebMarkupContainer("featureEditorContainer"); featureEditorContainer.setOutputMarkupPlaceholderTag(true); featureEditorContainer.add(featureEditorPanelContent = new FeatureEditorPanelContent("featureEditors")); featureEditorContainer.add(createFocusResetHelper()); <START> featureEditorContainer.add(visibleWhen(() -> selectedLayerHasFeatures())); <END> add(featureEditorContainer); noFeaturesWarning = new WebMarkupContainer("noFeaturesWarning"); noFeaturesWarning.setOutputMarkupPlaceholderTag(true); noFeaturesWarning.add(visibleWhen(() -> selectedLayerHasNoFeatures())); add(noFeaturesWarning); }</code><technical_language>rename layerIsSelectedAndHasFeatures() layerIsSelectedButHasNoFeatures() - clearer widget is shown layer is selected</technical_language>

Target:
public FeatureEditorListPanel(String aId, IModel<AnnotatorState> aModel, AnnotationDetailEditorPanel aOwner) { super(aId, aModel); setOutputMarkupPlaceholderTag(true); owner = aOwner; featureEditorContainer = new WebMarkupContainer("featureEditorContainer"); featureEditorContainer.setOutputMarkupPlaceholderTag(true); featureEditorContainer.add(featureEditorPanelContent = new FeatureEditorPanelContent("featureEditors")); featureEditorContainer.add(createFocusResetHelper()); featureEditorContainer.add(visibleWhen(() -> layerIsSelectedAndHasFeatures())); add(featureEditorContainer); noFeaturesWarning = new WebMarkupContainer("noFeaturesWarning"); noFeaturesWarning.setOutputMarkupPlaceholderTag(true); noFeaturesWarning.add(visibleWhen(() -> layerIsSelectedButHasNoFeatures())); add(noFeaturesWarning); }
Source:
<code>protected void postComment(PullRequest pull, String comment) { System.out.println("Posting '" + comment + "' to pullrequest '" + pull.getNumber() + "'"); if (!DRY_RUN) { <START> helper.githubHelper.postGithubComment(pull, comment); <END> } }</code><technical_language>helper.getGithubHelper()</technical_language>

Target:
protected void postComment(PullRequest pull, String comment) { System.out.println("Posting '" + comment + "' to pullrequest '" + pull.getNumber() + "'"); if (!DRY_RUN) { helper.getGHHelper().postGithubComment(pull, comment); } }
Source:
<code>public List<Optional<PartitionStatistics>> loadPartitionStatistics( final Collection<TimelinePartition> partitions) throws ServiceTemporarilyUnavailableException { try { return Retryer.executeWithRetry(() -> { return loadPartitionStatisticsInternal(partitions); }, new RetryForSpecifiedCountStrategy(3) .withWaitBetweenEachTry(5000) .withExceptionsThatForceRetry(org.apache.kafka.common.errors.TimeoutException.class)); <START> } catch (final Exception e) { <END> throw new ServiceTemporarilyUnavailableException("Error occurred when fetching partitions offsets", e); } }</code><technical_language>RuntimeException</technical_language>

Target:
public List<Optional<PartitionStatistics>> loadPartitionStatistics( final Collection<TimelinePartition> partitions) throws ServiceTemporarilyUnavailableException { try { return Retryer.executeWithRetry(() -> { return loadPartitionStatisticsInternal(partitions); }, new RetryForSpecifiedCountStrategy(3) .withWaitBetweenEachTry(5000) .withExceptionsThatForceRetry(org.apache.kafka.common.errors.TimeoutException.class)); } catch (final RuntimeException e) { throw new ServiceTemporarilyUnavailableException("Error occurred when fetching partitions offsets", e); } }
Source:
<code>public WebSocketResponse processTokenCreate(JsonObject request, WebSocketSession session) { JwtPayload payload = gson.fromJson(request.get(Constants.PAYLOAD), JwtPayload.class); if (payload == null) { String msg = "JwtToken: payload was not found"; logger.warn(msg); throw new HiveException(msg); } UserVO user = userService.findById(payload.getUserId()); if (user == null) { String msg = String.format("JwtToken: User with specified id %s was not found", payload.getUserId()); logger.warn(msg); <START> throw new HiveException(msg); <END> } if (!user.getStatus().equals(UserStatus.ACTIVE)) { String msg = String.format("JwtToken: User with specified id %s is not active", payload.getUserId()); logger.warn(msg); throw new HiveException(msg); } logger.debug("JwtToken: generate access and refresh token"); JwtPayload refreshPayload = JwtPayload.newBuilder().withPayload(payload) .buildPayload(); WebSocketResponse response = new WebSocketResponse(); response.addValue("accessToken", tokenService.generateJwtAccessToken(payload, true)); response.addValue("refreshToken", tokenService.generateJwtRefreshToken(refreshPayload, true)); return response; }</code><technical_language>error code in HiveException. shown in user response. "throw new HiveException(String.format(Messages.DEVICE_NOT_FOUND, deviceId), SC_NOT_FOUND)" in places. 404 is good here. sense extract message message.properties</technical_language>

Target:
public WebSocketResponse processTokenCreate(JsonObject request, WebSocketSession session) { JwtPayload payload = gson.fromJson(request.get(Constants.PAYLOAD), JwtPayload.class); if (payload == null) { logger.warn("JwtToken: payload was not found"); throw new HiveException(Messages.PAYLOAD_NOT_FOUND, SC_BAD_REQUEST); } UserVO user = userService.findById(payload.getUserId()); if (user == null) { logger.warn(String.format("JwtToken: User with specified id %s was not found", payload.getUserId())); throw new HiveException(Messages.USER_NOT_FOUND, SC_NOT_FOUND); } if (!user.getStatus().equals(UserStatus.ACTIVE)) { logger.warn(String.format("JwtToken: User with specified id %s is not active", payload.getUserId())); throw new HiveException(Messages.USER_NOT_ACTIVE, SC_NOT_FOUND); } logger.debug("JwtToken: generate access and refresh token"); JwtPayload refreshPayload = JwtPayload.newBuilder().withPayload(payload) .buildPayload(); WebSocketResponse response = new WebSocketResponse(); response.addValue("accessToken", tokenService.generateJwtAccessToken(payload, true)); response.addValue("refreshToken", tokenService.generateJwtRefreshToken(refreshPayload, true)); return response; }
Source:
<code><START> private List<StoragePool> getCandidateStoragePoolsToMigrateLocalVolume(VirtualMachineProfile profile, Host targetHost, Volume volume) { <END> List<StoragePool> poolList = new ArrayList<>(); DiskOfferingVO diskOffering = _diskOfferingDao.findById(volume.getDiskOfferingId()); DiskProfile diskProfile = new DiskProfile(volume, diskOffering, profile.getHypervisorType()); DataCenterDeployment plan = new DataCenterDeployment(targetHost.getDataCenterId(), targetHost.getPodId(), targetHost.getClusterId(), targetHost.getId(), null, null); ExcludeList avoid = new ExcludeList(); StoragePoolVO volumeStoragePool = _storagePoolDao.findById(volume.getPoolId()); if (volumeStoragePool.isLocal()) { diskProfile.setUseLocalStorage(true); } for (StoragePoolAllocator allocator : _storagePoolAllocators) { List<StoragePool> poolListFromAllocator = allocator.allocateToPool(diskProfile, profile, plan, avoid, StoragePoolAllocator.RETURN_UPTO_ALL); if (CollectionUtils.isEmpty(poolListFromAllocator)) { continue; } for (StoragePool pool : poolListFromAllocator) { if (pool.isLocal() || isStorageCrossClusterMigration(targetHost, volumeStoragePool)) { poolList.add(pool); } } } return poolList; }</code><technical_language>if want word "Local" in this volume name</technical_language>

Target:
protected List<StoragePool> getCandidateStoragePoolsToMigrateLocalVolume(VirtualMachineProfile profile, Host targetHost, Volume volume) { List<StoragePool> poolList = new ArrayList<>(); DiskOfferingVO diskOffering = _diskOfferingDao.findById(volume.getDiskOfferingId()); DiskProfile diskProfile = new DiskProfile(volume, diskOffering, profile.getHypervisorType()); DataCenterDeployment plan = new DataCenterDeployment(targetHost.getDataCenterId(), targetHost.getPodId(), targetHost.getClusterId(), targetHost.getId(), null, null); ExcludeList avoid = new ExcludeList(); StoragePoolVO volumeStoragePool = _storagePoolDao.findById(volume.getPoolId()); if (volumeStoragePool.isLocal()) { diskProfile.setUseLocalStorage(true); } for (StoragePoolAllocator allocator : _storagePoolAllocators) { List<StoragePool> poolListFromAllocator = allocator.allocateToPool(diskProfile, profile, plan, avoid, StoragePoolAllocator.RETURN_UPTO_ALL); if (CollectionUtils.isEmpty(poolListFromAllocator)) { continue; } for (StoragePool pool : poolListFromAllocator) { if (pool.isLocal() || isStorageCrossClusterMigration(targetHost, volumeStoragePool)) { poolList.add(pool); } } } return poolList; }
Source:
<code>public void sendCommand(String eiscpCmd) { String data = getEiscpMessage(eiscpCmd).toString(); if (in == null || out == null) { connectSocket(); } try { if (in.markSupported()) { in.reset(); } else { while (in.available() > 0) { int availableBytes = in.available(); if (availableBytes > 0) { byte[] tmpData = new byte[availableBytes]; in.read(tmpData, 0, availableBytes); } } } String response = sendMmsg(data, timeout); <START> if (response!=null) <END> notifier.notifyMessage(new OnkyoStatusUpdateEvent(this), response.getBytes(), 8); } catch (IOException e) { logger.debug("IO error occured...reconnect and resend ones"); closeSocket(); connectSocket(); try { String response = sendMmsg(data, timeout); if (response!=null) notifier.notifyMessage(new OnkyoStatusUpdateEvent(this), response.getBytes(), 8); } catch (IOException e1) { logger.error("Send failed.."+e1); }catch(EiscpException ee){ logger.error("Unable to notify "+ee); } } catch (Exception e) { logger.error("Send failed.."+e); } }</code><technical_language>curly braces, for one-line statements</technical_language>

Target:
public void sendCommand(String eiscpCmd) { String data = getEiscpMessage(eiscpCmd).toString(); if (in == null || out == null) { connectSocket(); } try { if (in.markSupported()) { in.reset(); } else { while (in.available() > 0) { int availableBytes = in.available(); if (availableBytes > 0) { byte[] tmpData = new byte[availableBytes]; in.read(tmpData, 0, availableBytes); } } } String response = sendMessage(data, timeout); if (response != null) { notifier.notifyMessage(new OnkyoStatusUpdateEvent(this), response.getBytes(), 8); } } catch (IOException e) { logger.debug("IO error occured...reconnect and resend ones"); closeSocket(); connectSocket(); try { String response = sendMessage(data, timeout); if (response != null) { notifier.notifyMessage(new OnkyoStatusUpdateEvent(this), response.getBytes(), 8); } } catch (IOException e1) { logger.error("Send failed..{}", e1); } catch (EiscpException ee) { logger.error("Unable to notify {}", ee); } } catch (Exception e) { logger.error("Send failed..{}", e); } }
Source:
<code>public void testNoCassandraHostsFailsValidation() { Configuration config = Configuration.getInstance(); config.setProperty(CoreConfig.CASSANDRA_HOSTS, ""); BluefloodServiceStarterException ex = null; try { BluefloodServiceStarter.validateCassandraHosts(); } catch (BluefloodServiceStarterException e) { <START> ex = e; <END> } assertNotNull(ex); assertEquals(-1, ex.getStatus()); }</code><technical_language>do @Test(expected = BluefloodServiceStarterException.class) I checking for exit code equals -1 is important do</technical_language>

Target:
public void testNoCassandraHostsFailsValidation() { Configuration config = Configuration.getInstance(); config.setProperty(CoreConfig.CASSANDRA_HOSTS, ""); BluefloodServiceStarter.validateCassandraHosts(); }
Source:
<code>public String getBranch() throws IOException { String name = getFullBranch(); if (name != null) return shortenRefName(name); <START> return name; <END> }</code><technical_language>return null this more explicit</technical_language>

Target:
public String getBranch() throws IOException { String name = getFullBranch(); if (name != null) return shortenRefName(name); return null; }
Source:
<code>private boolean evaluateDeterministicFilterFunctionsWithConstantInputs(List<FilterFunction> filterFunctions) { for (FilterFunction function : filterFunctions) { <START> if (function.isDeterministic() && hasInputs(function) && allConstantInputs(function)) { <END> if (!evaluateDeterministicFilterFunctionWithConstantInputs(function)) { return false; } } } return true; }</code><technical_language>java if (function.isDeterministic() && hasInputs(function) && allConstantInputs(function) && !evaluateDeterministicFilterFunctionWithConstantInputs(function)) { return false; }</technical_language>

Target:
private boolean evaluateDeterministicFilterFunctionsWithConstantInputs(List<FilterFunction> filterFunctions) { for (FilterFunction function : filterFunctions) { if (function.isDeterministic() && hasInputs(function) && allConstantInputs(function) && !evaluateDeterministicFilterFunctionWithConstantInputs(function)) { return false; } } return true; }
Source:
<code>public void onSuccess(final Message<Tuple<K, V>> message) { <START> if (tupleLinkListener != null) { <END> tupleLinkListener.onSuccess(message); } }</code><technical_language>making a basic TupleLinkListener</technical_language>

Target:
public void onSuccess(final Message<Tuple<K, V>> message) { if (tupleLinkListener == null) { throw new RuntimeException("The tuple link listener should be set first through TupleMessageSetup " + " before sending tuples."); } tupleLinkListener.onSuccess(message); }