auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Boolean visitNoScoping() { if (processNoScope) { synchronized (cleanupActions) { <START> cleanupActions.put(injectee, new UnscopedCleanupAction(context, lifecycleActions)); <END> } LOGGER.debug("predestroy action registered for unscoped instance from {}", injectee, context); } return true; }</code><technical_language>knowing injectee is, safely a key map. injectee is immutable, hash code change if injectee is mutated. I IdentityHashMap a option, hand do weak references keys</technical_language>

Target:
public Boolean visitNoScoping() { if (processNoScope) { cleanupActions.computeIfAbsent(injectee, i->{ LOGGER.debug("predestroy action registered for unscoped instance from {}", i, context); return new UnscopedCleanupAction(context, lifecycleActions); }); } return true; }
Source:
<code>public void sessionFactoryCreated(SessionFactoryImplementor sessionFactoryImplementor) { <START> this.associationQueries = initializeAssociationQueries( sessionFactoryImplementor ); <END> this.entityQueries = initializeEntityQueries( sessionFactoryImplementor, associationQueries ); }</code><technical_language>this.associationQueries = Collections.unmodifiableMap( initializeAssociationQueries( sessionFactoryImplementor ) );</technical_language>

Target:
public void sessionFactoryCreated(SessionFactoryImplementor sessionFactoryImplementor) { this.associationQueries = Collections.unmodifiableMap( initializeAssociationQueries( sessionFactoryImplementor ) ); this.entityQueries = Collections.unmodifiableMap( initializeEntityQueries( sessionFactoryImplementor, associationQueries ) ); }
Source:
<code>private void onTest() { if (!validateConnectionSettings()) { getTestResult().setEntity(ConstantsManager.getInstance().getConstants().testFailedInsufficientParams()); return; } flush(); startProgress(null); if (provider.getUrl().toLowerCase().startsWith(Uri.SCHEME_HTTPS)) { AsyncDataProvider.getInstance().getProviderCertificateChain(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { boolean ok = false; certificate = null; if (returnValue != null) { List<CertificateInfo> certs = (List<CertificateInfo>) returnValue; if (certs.size() > 0) { ConfirmationModel confirmationModel = getImportCertificateConfirmationModel(certs.get(0)); sourceListModel.setConfirmWindow(confirmationModel); <START> importProviderCertificate(); <END> ok = true; } } if (!ok) { stopProgress(); getTestResult().setEntity(ConstantsManager.getInstance() .getConstants() .testFailedUnknownErrorMsg()); } } }), provider); } else { testProviderConnectivity(); } }</code><technical_language>call this function and..</technical_language>

Target:
private void onTest() { if (!validateConnectionSettings()) { getTestResult().setEntity(ConstantsManager.getInstance().getConstants().testFailedInsufficientParams()); return; } flush(); startProgress(null); if (provider.getUrl().startsWith(Uri.SCHEME_HTTPS)) { AsyncDataProvider.getInstance().getProviderCertificateChain(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { boolean ok = false; certificate = null; if (returnValue != null) { List<CertificateInfo> certs = (List<CertificateInfo>) returnValue; if (certs.size() > 0) { certificate = certs.get(0).getPayload(); ConfirmationModel confirmationModel = getImportCertificateConfirmationModel(certs.get(0)); sourceListModel.setConfirmWindow(confirmationModel); ok = true; } } if (!ok) { stopProgress(); getTestResult().setEntity(ConstantsManager.getInstance() .getConstants() .testFailedUnknownErrorMsg()); } } }), provider); } else { testProviderConnectivity(); } }
Source:
<code>private ManifestEntry buildEntry( final Path entry, final BasicFileAttributes attributes, final boolean directory ) throws IOException { final String path = this.root.relativize(entry).toString(); final Path fileName = entry.getFileName(); final String name = fileName == null <START> ? EMPTY_STRING <END> : fileName.toString(); final Instant lastModifiedTime = attributes.lastModifiedTime().toInstant(); final Instant lastAccessTime = attributes.lastAccessTime().toInstant(); final Instant creationTime = attributes.creationTime().toInstant(); final long size = attributes.size(); String md5 = null; String mimeType = null; if (!directory) { try (InputStream data = Files.newInputStream(entry, StandardOpenOption.READ)) { md5 = DigestUtils.md5Hex(data); } catch (final IOException ioe) { log.error("Unable to create MD5 for due to error", entry, ioe); } try (TikaInputStream inputStream = TikaInputStream.get(entry)) { mimeType = this.tikaConfig.getDetector().detect(inputStream, new Metadata()).toString(); } catch (final IOException ioe) { log.error("Unable to detect mime type for due to error", entry, ioe); mimeType = MediaType.OCTET_STREAM.toString(); } } final Set<String> children = Sets.newHashSet(); if (directory) { try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(entry)) { for (final Path child : directoryStream) { children.add(this.root.relativize(child).toString()); } } } String parent = null; if (StringUtils.isNotEmpty(path)) { parent = this.root.relativize(entry.getParent()).toString(); } return new ManifestEntry( path, name, lastModifiedTime, lastAccessTime, creationTime, directory, size, md5, mimeType, parent, children ); }</code><technical_language>this error out instead of silently adding entry empty name</technical_language>

Target:
private ManifestEntry buildEntry( final Path entry, final BasicFileAttributes attributes, final boolean directory ) throws IOException { final String path = this.root.relativize(entry).toString(); final Path fileName = entry.getFileName(); final String name = fileName == null ? EMPTY_STRING : fileName.toString(); final Instant lastModifiedTime = attributes.lastModifiedTime().toInstant(); final Instant lastAccessTime = attributes.lastAccessTime().toInstant(); final Instant creationTime = attributes.creationTime().toInstant(); final long size = attributes.size(); String md5 = null; String mimeType = null; if (!directory) { try (InputStream data = Files.newInputStream(entry, StandardOpenOption.READ)) { md5 = DigestUtils.md5Hex(data); } catch (final IOException ioe) { log.error("Unable to create MD5 for due to error", entry, ioe); } mimeType = this.getMimeType(name, entry); } final Set<String> children = Sets.newHashSet(); if (directory) { try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(entry)) { for (final Path child : directoryStream) { children.add(this.root.relativize(child).toString()); } } } String parent = null; if (StringUtils.isNotEmpty(path)) { parent = this.root.relativize(entry.getParent()).toString(); } return new ManifestEntry( path, name, lastModifiedTime, lastAccessTime, creationTime, directory, size, md5, mimeType, parent, children ); }
Source:
<code>public INDArray doForward(boolean training) { if (!canDoForward()) throw new IllegalStateException("Cannot do forward pass: inputs not set"); nInForwardPass = inputs.length; if (inputs.length == 1) return inputs[0]; switch (op) { case Add: INDArray sum = inputs[0].dup(); for (int i = 1; i < inputs.length; i++) { sum.addi(inputs[i]); } return sum; case Average: <START> INDArray average = inputs[0].dup(); <END> for (int i = 1; i < inputs.length; i++) { average.addi(inputs[i]); } return average.divi(inputs.length); case Subtract: if (inputs.length != 2) throw new IllegalArgumentException("ElementWise subtraction only supports 2 inputs"); return inputs[0].sub(inputs[1]); case Product: INDArray product = inputs[0].dup(); for (int i = 1; i < inputs.length; i++) { product.muli(inputs[i]); } return product; case Max: INDArray max = inputs[0].dup(); CustomOp op = DynamicCustomOp.builder("mergemax") .setInputs(inputs) .setOutputs(max) .callInplace(false) .build(); Nd4j.getExecutioner().exec(op); return max; default: throw new UnsupportedOperationException("Unknown op: " + this.op); } }</code><technical_language>Minor optimization: inputs[0].dup(inputs[0].ordering()) more get good strides add ops..</technical_language>

Target:
public INDArray doForward(boolean training) { if (!canDoForward()) throw new IllegalStateException("Cannot do forward pass: inputs not set"); nInForwardPass = inputs.length; if (inputs.length == 1) return inputs[0]; switch (op) { case Add: INDArray sum = inputs[0].dup(inputs[0].ordering()); for (int i = 1; i < inputs.length; i++) { sum.addi(inputs[i]); } return sum; case Average: INDArray average = inputs[0].dup(inputs[0].ordering()); for (int i = 1; i < inputs.length; i++) { average.addi(inputs[i]); } return average.divi(inputs.length); case Subtract: if (inputs.length != 2) throw new IllegalArgumentException("ElementWise subtraction only supports 2 inputs"); return inputs[0].sub(inputs[1]); case Product: INDArray product = inputs[0].dup(inputs[0].ordering()); for (int i = 1; i < inputs.length; i++) { product.muli(inputs[i]); } return product; case Max: INDArray max = Nd4j.createUninitialized(inputs[0].shape(), inputs[0].ordering()); CustomOp op = DynamicCustomOp.builder("mergemax") .setInputs(inputs) .setOutputs(max) .callInplace(false) .build(); Nd4j.getExecutioner().exec(op); return max; default: throw new UnsupportedOperationException("Unknown op: " + this.op); } }
Source:
<code>ScheduledProcedure(long delay, TimeUnit timeUnit, String procedure, Object... procedureParameters) { m_delayNs = Math.max(timeUnit.toNanos(delay), 0); m_procedure = procedure; <START> m_procedureParameters = procedureParameters.clone(); <END> }</code><technical_language>a clone here</technical_language>

Target:
ScheduledProcedure(long delay, TimeUnit timeUnit, String procedure, Object... procedureParameters) { m_requestedDelayNs = Math.max(timeUnit.toNanos(delay), 0); m_procedure = procedure; m_procedureParameters = procedureParameters.clone(); }
Source:
<code>private static String limit(String s, int len) { <START> return s.substring(0, Math.min(len, s.length())) + (s.length() > len ? "[...]" : ""); <END> }</code><technical_language>Call a nitpick, wondering if worth this more verbosely, stay in line clarity of code generally try achieve keeping number of operations line low? limited = substring(...); isTruncated = limited.length < str.length; if (isTruncated) {limit = limit + "[...]"};</technical_language>

Target:
protected static String limit(String s, int len) { String truncated = s.substring(0, Math.min(len, s.length())); boolean isTruncated = len < s.length(); if (isTruncated) { truncated += "[...]"; } return truncated; }
Source:
<code>public static Patient toPatient(OpenMRSPatient patient, OpenMRSPerson savedPerson, String motechPatientIdentifierTypeUuid, Map<String, String> patientIdentifiers) { Patient converted = new Patient(); Person person = new Person(); person.setUuid(savedPerson.getPersonId()); converted.setPerson(person); <START> converted.getPerson().getPreferredAddress().setPreferred("true"); <END> Location location = null; if (patient.getFacility() != null && StringUtils.isNotBlank(patient.getFacility().getFacilityId())) { location = new Location(); location.setUuid(patient.getFacility().getFacilityId()); } List<Identifier> identifiers = new ArrayList<>(); identifiers.add(createMotechPatientIdentifier(patient.getMotechId(), motechPatientIdentifierTypeUuid, location)); for (String identifierTypeUuid : patientIdentifiers.keySet()) { IdentifierType type = new IdentifierType(); type.setUuid(identifierTypeUuid); Identifier identifier = new Identifier(); identifier.setIdentifier(patientIdentifiers.get(identifierTypeUuid)); identifier.setLocation(location); identifier.setIdentifierType(type); identifiers.add(identifier); } converted.setIdentifiers(identifiers); return converted; }</code><technical_language>explain add this ? btw. setPreferred setting person in converted</technical_language>

Target:
public static Patient toPatient(OpenMRSPatient patient, OpenMRSPerson savedPerson, String motechPatientIdentifierTypeUuid, Map<String, String> patientIdentifiers) { Patient converted = new Patient(); Person person = new Person(); person.setUuid(savedPerson.getPersonId()); converted.setPerson(person); Location location = null; if (patient.getFacility() != null && StringUtils.isNotBlank(patient.getFacility().getFacilityId())) { location = new Location(); location.setUuid(patient.getFacility().getFacilityId()); } List<Identifier> identifiers = new ArrayList<>(); identifiers.add(createMotechPatientIdentifier(patient.getMotechId(), motechPatientIdentifierTypeUuid, location)); for (String identifierTypeUuid : patientIdentifiers.keySet()) { IdentifierType type = new IdentifierType(); type.setUuid(identifierTypeUuid); Identifier identifier = new Identifier(); identifier.setIdentifier(patientIdentifiers.get(identifierTypeUuid)); identifier.setLocation(location); identifier.setIdentifierType(type); identifiers.add(identifier); } converted.setIdentifiers(identifiers); return converted; }
Source:
<code>public void prepareRun(StageSubmitterContext context) throws Exception { super.prepareRun(context); Schema inputSchema = context.getInputSchema(); if (inputSchema == null || inputSchema.getFields() == null) { return; } List<FieldOperation> fieldOperations = new ArrayList<>(); inputSchema.getFields().forEach( field -> fieldOperations.add(new FieldTransformOperation(String.format("Error collector for field %s", field.getName()), "Error collector identity transform", Collections.singletonList(field.getName()), field.getName()))); <START> if (config.messageField != null) { <END> fieldOperations.add(new FieldTransformOperation("Error collector message field", "Generated field", Collections.emptyList(), config.messageField)); } if (config.codeField != null) { fieldOperations.add(new FieldTransformOperation("Error collector code field", "Generated field", Collections.emptyList(), config.codeField)); } if (config.stageField != null) { fieldOperations.add(new FieldTransformOperation("Error collector stage field", "Generated field", Collections.emptyList(), config.stageField)); } context.record(fieldOperations); }</code><technical_language>if input schema this field? I check inputSchema.getField(config.messageField) != null add empty string check</technical_language>

Target:
public void prepareRun(StageSubmitterContext context) throws Exception { super.prepareRun(context); Schema inputSchema = context.getInputSchema(); if (inputSchema == null || inputSchema.getFields() == null) { return; } List<FieldOperation> fieldOperations = new ArrayList<>(); inputSchema.getFields().forEach( field -> fieldOperations.add(new FieldTransformOperation(String.format("Error collector for field %s", field.getName()), "Error collector identity transform", Collections.singletonList(field.getName()), field.getName()))); if (config.messageField != null && !config.messageField.isEmpty()) { fieldOperations.add(new FieldTransformOperation("Error collector message field", "Generated field", Collections.emptyList(), config.messageField)); } if (config.codeField != null && !config.codeField.isEmpty()) { fieldOperations.add(new FieldTransformOperation("Error collector code field", "Generated field", Collections.emptyList(), config.codeField)); } if (config.stageField != null && !config.stageField.isEmpty()) { fieldOperations.add(new FieldTransformOperation("Error collector stage field", "Generated field", Collections.emptyList(), config.stageField)); } context.record(fieldOperations); }
Source:
<code>public static void validateLabelFieldForTrainer(Schema inputSchema, String labelField) { Schema.Field prediction = inputSchema.getField(labelField); <START> if (labelField == null) { <END> throw new IllegalArgumentException(String.format("Label field %s does not exists in the input schema", labelField)); } Schema predictionSchema = prediction.getSchema(); Schema.Type predictionFieldType = predictionSchema.isNullableSimple() ? predictionSchema.getNonNullable().getType() : predictionSchema.getType(); if (predictionFieldType != Schema.Type.DOUBLE) { throw new IllegalArgumentException(String.format("Prediction field must be of type Double, but was %s.", predictionFieldType)); } }</code><technical_language>Wrong condition. I check if (predication == null). Also, call variable predictionField</technical_language>

Target:
static void validateLabelFieldForTrainer(Schema inputSchema, String labelField) { Schema.Field prediction = inputSchema.getField(labelField); if (prediction == null) { throw new IllegalArgumentException(String.format("Label field %s does not exists in the input schema.", labelField)); } Schema predictionSchema = prediction.getSchema(); Schema.Type predictionFieldType = predictionSchema.isNullableSimple() ? predictionSchema.getNonNullable().getType() : predictionSchema.getType(); if (predictionFieldType != Schema.Type.DOUBLE) { throw new IllegalArgumentException(String.format("Label field must be of type Double, but was %s.", predictionFieldType)); } }
Source:
<code>public void configure(Binder binder) { binder.disableCircularProxies(); jaxrsBinder(binder).bind(JsonMapper.class); jaxrsBinder(binder).bind(SmileMapper.class); jaxrsBinder(binder).bind(TimingResourceDynamicFeature.class); jaxrsBinder(binder).bind(DisallowOptionsModelProcessor.class); jaxrsBinder(binder).bindInjectionProvider(ClientInfo.class).to(ClientInfoSupplier.class); jaxrsBinder(binder).bindAdmin(ParsingExceptionMapper.class); jaxrsBinder(binder).bindAdmin(QueryParamExceptionMapper.class); jaxrsBinder(binder).bindAdmin(OverrideMethodFilter.class); jaxrsBinder(binder).bindAdmin(ThreadDumpResource.class); <START> newSetBinder(binder, Object.class, JaxrsResource.class).permitDuplicates(); <END> newSetBinder(binder, JaxrsBinding.class, JaxrsResource.class).permitDuplicates(); newMapBinder(binder, new TypeLiteral<Class<?>>() {}, new TypeLiteral<Supplier<?>>() {}, JaxrsInjectionProvider.class); }</code><technical_language>I lines needed for a non-JAX-RS application either. least, module I implemented effectively need them</technical_language>

Target:
public void configure(Binder binder) { binder.disableCircularProxies(); jaxrsBinder(binder).bindInjectionProvider(ClientInfo.class).to(ClientInfoSupplier.class); jaxrsBinder(binder).bindAdmin(ParsingExceptionMapper.class); jaxrsBinder(binder).bindAdmin(QueryParamExceptionMapper.class); jaxrsBinder(binder).bindAdmin(OverrideMethodFilter.class); jaxrsBinder(binder).bindAdmin(ThreadDumpResource.class); newSetBinder(binder, Object.class, JaxrsResource.class).permitDuplicates(); newSetBinder(binder, JaxrsBinding.class, JaxrsResource.class).permitDuplicates(); newMapBinder(binder, new TypeLiteral<Class<?>>() {}, new TypeLiteral<Supplier<?>>() {}, JaxrsInjectionProvider.class); }
Source:
<code>public void write(@Nonnull PriorityScoreReasons entity, @Nonnull FieldWriter writer, @Nonnull OutputContext ctxt) throws IOException { writer.writeList( "positive", "positive", <START> entity.getPositive() != null ? entity.getPositive() : null, <END> ctxt ); writer.writeList( "negative", "negative", entity.getNegative() != null ? entity.getNegative() : null, ctxt ); }</code><technical_language>This is pointless, equivalent passing entity.getPositive()</technical_language>

Target:
public void write(@Nonnull PriorityScoreReasons entity, @Nonnull FieldWriter writer, @Nonnull OutputContext ctxt) throws IOException { writer.writeList( "positive", "positive", entity.getPositive(), ctxt ); writer.writeList( "negative", "negative", entity.getNegative(), ctxt ); }
Source:
<code>protected int cancelQueuedBuildByPrNumber(final int id) { Queue queue = getJenkinsInstance().getQueue(); int canceled = 0; <START> for (Queue.Item item : queue.getItems()) { <END> if (!(item.task instanceof Job)) { LOGGER.debug("Item not instanceof job", item); continue; } final Job<?, ?> jobTask = (Job<?, ?>) item.task; if (!jobTask.getDisplayName().equals(job.getDisplayName())) { LOGGER.debug("{} != {}", jobTask.getFullName(), job.getFullName()); continue; } final CauseAction action = item.getAction(CauseAction.class); if (isNull(action)) { LOGGER.debug("Cause action is null for {}", jobTask.getFullName()); continue; } Optional<Cause> cause = from(action.getCauses()) .filter(instanceOf(GitHubPRCause.class)) .firstMatch(new CauseHasPRNum(id)); if (cause.isPresent()) { LOGGER.debug("Cancelling {}", item); queue.cancel(item); canceled++; } } return canceled; }</code><technical_language>![MAJOR](<LINK_1> Reduce total number of break continue statements in this loop one. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
protected int cancelQueuedBuildByPrNumber(final int id) { int canceled = 0; SecurityContext old = impersonate(ACL.SYSTEM); try { final Queue queue = getJenkinsInstance().getQueue(); final Queue.Item[] items = queue.getItems(); for (Queue.Item item : items) { if (!(item.task instanceof Job)) { LOGGER.debug("Item not instanceof job", item); continue; } final Job<?, ?> jobTask = (Job<?, ?>) item.task; if (!jobTask.getFullName().equals(job.getFullName())) { LOGGER.debug("{} != {}", jobTask.getFullName(), job.getFullName()); continue; } final CauseAction action = item.getAction(CauseAction.class); if (isNull(action)) { LOGGER.debug("Cause action is null for {}", jobTask.getFullName()); continue; } Optional<Cause> cause = from(action.getCauses()) .filter(instanceOf(GitHubPRCause.class)) .firstMatch(new CauseHasPRNum(id)); if (cause.isPresent()) { LOGGER.debug("Cancelling {}", item); queue.cancel(item); canceled++; } } } finally { SecurityContextHolder.setContext(old); } return canceled; }
Source:
<code>public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { if (fSelection instanceof IStructuredSelection) { Object[] elems = ((IStructuredSelection) fSelection).toArray(); fSelectedModels = new ArrayList<>(elems.length); for (int i = 0; i < elems.length; i++) { if (elems[i] instanceof IFile) elems[i] = ((IFile) elems[i]).getProject(); if (elems[i] instanceof IProject && WorkspaceModelManager.isPluginProject((IProject) elems[i]) && !WorkspaceModelManager.isBinaryProject((IProject) elems[i])) fSelectedModels.add(elems[i]); } fModelChangeTable = new ModelChangeTable(); if (fExternalizeSelectedPluginsOnly) { <START> monitor.beginTask(PDEUIMessages.GetNonExternalizedStringsOperation_taskMessage, fSelectedModels.size()); <END> Iterator<Object> iterator = fSelectedModels.iterator(); while (iterator.hasNext() && !fCanceled) { IProject project = (IProject) iterator.next(); if (!WorkspaceModelManager.isBinaryProject(project)) getUnExternalizedStrings(project, SubMonitor.convert(monitor, 1)); } } else { IPluginModelBase[] pluginModels = PluginRegistry.getWorkspaceModels(); monitor.beginTask(PDEUIMessages.GetNonExternalizedStringsOperation_taskMessage, pluginModels.length); for (int i = 0; i < pluginModels.length && !fCanceled; i++) { IProject project = pluginModels[i].getUnderlyingResource().getProject(); if (!WorkspaceModelManager.isBinaryProject(project)) getUnExternalizedStrings(project, SubMonitor.convert(monitor, 1)); } } } }</code><technical_language>Replace SubMonitor.convert</technical_language>

Target:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { if (fSelection instanceof IStructuredSelection) { Object[] elems = ((IStructuredSelection) fSelection).toArray(); fSelectedModels = new ArrayList<>(elems.length); for (int i = 0; i < elems.length; i++) { if (elems[i] instanceof IFile) elems[i] = ((IFile) elems[i]).getProject(); if (elems[i] instanceof IProject && WorkspaceModelManager.isPluginProject((IProject) elems[i]) && !WorkspaceModelManager.isBinaryProject((IProject) elems[i])) fSelectedModels.add(elems[i]); } fModelChangeTable = new ModelChangeTable(); if (fExternalizeSelectedPluginsOnly) { SubMonitor subMonitor = SubMonitor.convert(monitor, PDEUIMessages.GetNonExternalizedStringsOperation_taskMessage, fSelectedModels.size()); Iterator<Object> iterator = fSelectedModels.iterator(); while (iterator.hasNext() && !fCanceled) { IProject project = (IProject) iterator.next(); if (!WorkspaceModelManager.isBinaryProject(project)) getUnExternalizedStrings(project, subMonitor.newChild(1)); } } else { IPluginModelBase[] pluginModels = PluginRegistry.getWorkspaceModels(); SubMonitor subMonitor = SubMonitor.convert(monitor, PDEUIMessages.GetNonExternalizedStringsOperation_taskMessage, pluginModels.length); for (int i = 0; i < pluginModels.length && !fCanceled; i++) { IProject project = pluginModels[i].getUnderlyingResource().getProject(); if (!WorkspaceModelManager.isBinaryProject(project)) getUnExternalizedStrings(project, subMonitor.newChild(1)); } } } }
Source:
<code><START> public static Observable<String> getTagsFromPref(String pref) { <END> Timber.d("Retuning tags for pref:%s", pref); switch (pref) { case "Author": return Observable.fromArray(TAG_ARTIST, TAG_CAMARA_OWNER_NAME); case "Copyright": return Observable.fromArray(TAG_COPYRIGHT); case "Location": return Observable.fromArray(TAG_GPS_LATITUDE, TAG_GPS_LATITUDE_REF, TAG_GPS_LONGITUDE, TAG_GPS_LONGITUDE_REF, TAG_GPS_ALTITUDE, TAG_GPS_ALTITUDE_REF); case "Camera Model": return Observable.fromArray(TAG_MAKE, TAG_MODEL); case "Lens Model": return Observable.fromArray(TAG_LENS_MAKE, TAG_LENS_MODEL, TAG_LENS_SPECIFICATION); case "Serial Numbers": return Observable.fromArray(TAG_BODY_SERIAL_NUMBER, TAG_LENS_SERIAL_NUMBER); case "Software": return Observable.fromArray(TAG_SOFTWARE); default: return null; } }</code><technical_language>add java doc for this method? :)</technical_language>

Target:
public static String[] getTagsFromPref(String pref) { Timber.d("Retuning tags for pref:%s", pref); switch (pref) { case "Author": return new String[]{TAG_ARTIST, TAG_CAMARA_OWNER_NAME}; case "Copyright": return new String[]{TAG_COPYRIGHT}; case "Location": return new String[]{TAG_GPS_LATITUDE, TAG_GPS_LATITUDE_REF, TAG_GPS_LONGITUDE, TAG_GPS_LONGITUDE_REF, TAG_GPS_ALTITUDE, TAG_GPS_ALTITUDE_REF}; case "Camera Model": return new String[]{TAG_MAKE, TAG_MODEL}; case "Lens Model": return new String[]{TAG_LENS_MAKE, TAG_LENS_MODEL, TAG_LENS_SPECIFICATION}; case "Serial Numbers": return new String[]{TAG_BODY_SERIAL_NUMBER, TAG_LENS_SERIAL_NUMBER}; case "Software": return new String[]{TAG_SOFTWARE}; default: return new String[]{}; } }
Source:
<code>public void testGetGeoJsonResponseWfs20() throws Exception { JSON response = getAsJSON( "wfs?request=GetFeature&version=2.0" + "&typenames=st_gml32:Station_gml32&outputFormat=application/json"); <START> print(response); <END> checkStation1Exists(response); }</code><technical_language>A miss</technical_language>

Target:
public void testGetGeoJsonResponseWfs20() throws Exception { JSON response = getAsJSON( "wfs?request=GetFeature&version=2.0" + "&typenames=st_gml32:Station_gml32&outputFormat=application/json"); checkStation1Exists(response); }
Source:
<code>private void build(Tree tree) { if (tree.is(Kind.IF_STATEMENT)) { visitIfStatement((IfStatementTree) tree); } else if (tree.is(Kind.BLOCK)) { visitBlock((BlockTree) tree); } else if (tree.is(Kind.EXPRESSION_STATEMENT)) { buildExpression((ExpressionStatementTree) tree); <START> } <END> }</code><technical_language>throw in else miss end</technical_language>

Target:
private void build(Tree tree) { if (tree.is(Kind.IF_STATEMENT)) { visitIfStatement((IfStatementTree) tree); } else if (tree.is(Kind.BLOCK)) { visitBlock((BlockTree) tree); } else if (tree.is(Kind.EXPRESSION_STATEMENT)) { currentBlock.addElement(tree); } else { throw new UnsupportedOperationException("Not supported tree kind " + tree.getKind()); } }
Source:
<code>private synchronized void closeContext() throws IOException { if (!mClosed.get()) { mClosed.set(true); mFileSystemMasterClientPool.close(); mFileSystemMasterClientPool = null; mBlockMasterClientPool.close(); mBlockMasterClientPool = null; for (BlockWorkerClientPool pool : mBlockWorkerClientPoolMap.values()) { pool.close(); } <START> mWorkerGroup.shutdownGracefully(1L, 10L, TimeUnit.SECONDS); <END> mBlockWorkerClientPoolMap = null; mLocalWorkerInitialized = false; mLocalWorker = null; if (mMetricsEnabled) { MetricsHeartbeatContext.removeHeartbeat(getClientContext()); } } else { LOG.warn("Attempted to close FileSystemContext which has already been closed or not " + "initialized."); } }</code><technical_language>want clear anymore</technical_language>

Target:
private synchronized void closeContext() throws IOException { if (!mClosed.get()) { mClosed.set(true); mFileSystemMasterClientPool.close(); mFileSystemMasterClientPool = null; mBlockMasterClientPool.close(); mBlockMasterClientPool = null; for (BlockWorkerClientPool pool : mBlockWorkerClientPoolMap.values()) { pool.close(); } mWorkerGroup.shutdownGracefully(1L, 10L, TimeUnit.SECONDS); mBlockWorkerClientPoolMap.clear(); mBlockWorkerClientPoolMap = null; mLocalWorkerInitialized = false; mLocalWorker = null; if (mMetricsEnabled) { MetricsHeartbeatContext.removeHeartbeat(getClientContext()); } } else { LOG.warn("Attempted to close FileSystemContext which has already been closed or not " + "initialized."); } }
Source:
<code>public MockMethodAdvice(WeakConcurrentMap<Object, MockMethodInterceptor> interceptors, String identifier) { this.interceptors = interceptors; this.identifier = identifier; try { Field field = WeakConcurrentMap.class.getDeclaredField("target"); field.setAccessible(true); backingMap = field.get(interceptors); } catch (Exception e) { <START> throw new MockitoException("Could not resolve backing map from concurrent hash map", e); <END> } }</code><technical_language>message more actionable? Is user do? File a ticket</technical_language>

Target:
public MockMethodAdvice(WeakConcurrentMap<Object, MockMethodInterceptor> interceptors, String identifier) { this.interceptors = interceptors; this.identifier = identifier; }
Source:
<code>public Map<MultiKey, Map<String, String>> getAllMaps() { final Lock readLock = startStopSync.readLock(); readLock.lock(); try { <START> if (!started) { <END> throw new ISE("Factory [%s] not started", extractorID); } String preVersion = null, postVersion = null; Map<MultiKey, Map<String, String>> mapMap = null; do { preVersion = manager.getVersion(extractorID); if (preVersion == null) { throw new ISE("Namespace vanished for [%s]", extractorID); } mapMap = manager.getCacheMap(extractorID); postVersion = manager.getVersion(extractorID); if (postVersion == null) { manager.delete(extractorID); throw new ISE("Lookup [%s] is deleting", extractorID); } } while (!preVersion.equals(postVersion)); return mapMap; } finally { readLock.unlock(); } }</code><technical_language>copypasted code get, this shared in a helper method</technical_language>

Target:
public Map<Pair, Map<String, String>> getAllMaps() { final Lock readLock = startStopSync.readLock(); readLock.lock(); try { if (!started) { throw new ISE("Factory [%s] not started", extractorID); } String preVersion = null, postVersion = null; Map<Pair, Map<String, String>> mapMap = null; do { preVersion = manager.getVersion(extractorID); if (preVersion == null) { throw new ISE("Namespace vanished for [%s]", extractorID); } mapMap = manager.getCacheMap(extractorID); postVersion = manager.getVersion(extractorID); if (postVersion == null) { manager.delete(extractorID); throw new ISE("Lookup [%s] is deleting", extractorID); } } while (!preVersion.equals(postVersion)); return mapMap; } finally { readLock.unlock(); } }
Source:
<code>public static void testExistsEmployee(DataStore<String, Employee> dataStore) throws Exception { <START> dataStore.createSchema(); <END> Employee employee = DataStoreTestUtil.createEmployee(); String ssn = employee.getSsn().toString(); dataStore.put(ssn, employee); dataStore.flush(); assertTrue(dataStore.exists(ssn)); dataStore.delete(ssn); dataStore.flush(); assertFalse(dataStore.exists(ssn)); }</code><technical_language>UUID</technical_language>

Target:
public static void testExistsEmployee(DataStore<String, Employee> dataStore) throws Exception { dataStore.createSchema(); Employee employee = DataStoreTestUtil.createEmployee(); String uuid = UUID.randomUUID().toString(); dataStore.put(uuid, employee); dataStore.flush(); assertTrue(dataStore.exists(uuid)); dataStore.delete(uuid); dataStore.flush(); assertFalse(dataStore.exists(uuid)); }
Source:
<code>public void resetUsbPlug() throws IOException, JadbException { try (InputStream stream = device.executeShell("dumpsys", "battery", "reset")) { Stream.flushRead(stream); <START> stream.close(); <END> } }</code><technical_language>No, need for close try-with-resource</technical_language>

Target:
public void resetUsbPlug() throws IOException, JadbException { try (InputStream stream = device.executeShell("dumpsys", "battery", "reset")) { Stream.flushRead(stream); } }
Source:
<code>public double avgTimePerElem() { return sum / elemCount / 1000.0D; <START> } <END></code><technical_language>change lost in avgTimePerRecord andavgTimePerElem methods (#614). - public double avg() { - if (count == 0) { - return Double.POSITIVE_INFINITY; - } - - return sum / count / 1000.0D; - } - - public double avgElement() { - if (elemCount == 0) { - return Double.POSITIVE_INFINITY; - } - - return sum / elemCount / 1000.0D; - }</technical_language>

Target:
public double avgTimePerElem() { if (elemCount == 0) { return Double.POSITIVE_INFINITY; } return sum / elemCount / 1000.0D; }
Source:
<code>private static Response invalid_request(final String message) { <START> return Response.status(Response.Status.BAD_REQUEST).entity(message).build(); <END> }</code><technical_language>throw a WebApplication exception a JsonError entity for client receive a valid JSON</technical_language>

Target:
private static Response invalid_request(final String message) { return Response.status(Response.Status.BAD_REQUEST) .entity(new JsonError(400, message)) .type(MediaType.APPLICATION_JSON_TYPE) .build(); }
Source:
<code><START> public boolean visitEnter(ComparisonParseNode node) throws SQLException { <END> return true; }</code><technical_language>Is this throw req'd</technical_language>

Target:
public boolean visitEnter(ComparisonParseNode node) { return true; }
Source:
<code>private static boolean isAloneOnLine(Details details, String targetSrcLine) { final DetailAST rcurly = details.rcurly; final DetailAST nextToken = details.nextToken; return rcurly.getLineNo() != nextToken.getLineNo() <START> && CommonUtils.hasWhitespaceBefore(details.rcurly.getColumnNo(), targetSrcLine); <END> }</code><technical_language>@ps-sp do need pass targetSrcLine methods? methods static? information in details get source line</technical_language>

Target:
private static boolean isAloneOnLine(Details details, String targetSrcLine) { final DetailAST rcurly = details.rcurly; final DetailAST nextToken = details.nextToken; return (rcurly.getLineNo() != nextToken.getLineNo() || skipDoubleBraceInstInit(details)) && CommonUtil.hasWhitespaceBefore(details.rcurly.getColumnNo(), targetSrcLine); }
Source:
<code>static BookKeeper createBookKeeperClient(ServerConfiguration conf) throws InterruptedException, IOException { ClientConfiguration clientConfiguration = new ClientConfiguration(conf); clientConfiguration.setClientRole(ClientConfiguration.CLIENT_ROLE_SYSTEM); <START> LOG.info("AuthProvider used by the Auditor is {}", <END> clientConfiguration.getClientAuthProviderFactoryClass()); try { return BookKeeper.forConfig(clientConfiguration).build(); } catch (BKException e) { throw new IOException("Failed to create bookkeeper client", e); } }</code><technical_language>I this logging belong this method. initialize method</technical_language>

Target:
static BookKeeper createBookKeeperClient(ServerConfiguration conf) throws InterruptedException, IOException { ClientConfiguration clientConfiguration = new ClientConfiguration(conf); clientConfiguration.setClientRole(ClientConfiguration.CLIENT_ROLE_SYSTEM); try { return BookKeeper.forConfig(clientConfiguration).build(); } catch (BKException e) { throw new IOException("Failed to create bookkeeper client", e); } }
Source:
<code><START> public void setTag(@NonNull String key, @NonNull Object tag) { <END> if (mTag == null) { mTag = new SessionConfigTagMap(); } ((SessionConfigTagMap) mTag).setTagMap(key, tag); }</code><technical_language>Consider provide a compatile interface public void setTag(@NonNull Object tag). Extensions is releasing Core. change break previous version of Extensions restricted LIBRARY_GROUP</technical_language>

Target:
public void setTag(@NonNull String key, @NonNull Object tag) { if (mTag == null) { mTag = new TagBundle(); } mTag.putTag(key, tag); }
Source:
<code>public static void udpateUserRoleMappingWithExactParams(Connection dbConnection, String sqlStmt, String[] roles, String userName, Integer[] tenantIds, int currentTenantId) throws UserStoreException { boolean localConnection = false; try (PreparedStatement ps = dbConnection.prepareStatement(sqlStmt)){ byte count = 0; byte index = 0; for (String role : roles) { count = 0; ps.setString(++count, role); ps.setInt(++count, tenantIds[index]); ps.setString(++count, userName); ps.setInt(++count, currentTenantId); ps.setInt(++count, currentTenantId); ps.setInt(++count, tenantIds[index]); ps.addBatch(); ++index; } int[] cnt = ps.executeBatch(); if (log.isDebugEnabled()) { log.debug("Executed a batch update. Query is : " + sqlStmt + ": and result is" + Arrays.toString(cnt)); } if (localConnection) { dbConnection.commit(); } } catch (SQLException e) { String errorMessage = "Using sql : " + sqlStmt + " " + e.getMessage(); if (log.isDebugEnabled()) { log.debug(errorMessage, e); } throw new UserStoreException(errorMessage, e); } finally { <START> close(dbConnection); <END> } }</code><technical_language>connection passed a parameter this method, close connection this method. Need close connection in original place originally (create )close dbConnection</technical_language>

Target:
public static void udpateUserRoleMappingWithExactParams(Connection dbConnection, String sqlStmt, String[] roles, String userName, Integer[] tenantIds, int currentTenantId) throws UserStoreException { boolean localConnection = false; try (PreparedStatement ps = dbConnection.prepareStatement(sqlStmt)){ byte count = 0; byte index = 0; for (String role : roles) { count = 0; ps.setString(++count, role); ps.setInt(++count, tenantIds[index]); ps.setString(++count, userName); ps.setInt(++count, currentTenantId); ps.setInt(++count, currentTenantId); ps.setInt(++count, tenantIds[index]); ps.addBatch(); ++index; } int[] cnt = ps.executeBatch(); if (log.isDebugEnabled()) { log.debug("Executed a batch update. Query is : " + sqlStmt + ": and result is" + Arrays.toString(cnt)); } if (localConnection) { dbConnection.commit(); } } catch (SQLException e) { String errorMessage = "Using sql : " + sqlStmt + " " + e.getMessage(); if (log.isDebugEnabled()) { log.debug(errorMessage, e); } throw new UserStoreException(errorMessage, e); } finally { if(localConnection){ close(dbConnection); } } }
Source:
<code>public void testRangeRequestCompositeBlob() throws Exception { for (int i = 0; i < 5; i++) { blobSize = random.nextInt(maxChunkSize) + maxChunkSize * random.nextInt(10); int randomOne = random.nextInt(blobSize); int randomTwo = random.nextInt(blobSize); testRangeRequestClosedRange(Math.min(randomOne, randomTwo), Math.max(randomOne, randomTwo), true); } blobSize = random.nextInt(maxChunkSize) + maxChunkSize * random.nextInt(10); testRangeRequestClosedRange(0, blobSize - 1, true); testRangeRequestOpenRange(random.nextInt(blobSize), true); testRangeRequestLastNBytes(random.nextInt(blobSize) + 1, true); testRangeRequestLastNBytes(blobSize + 1, false); testRangeRequestClosedRange(random.nextInt(blobSize), blobSize + 5, false); testRangeRequestOpenRange(blobSize, false); testRangeRequestClosedRange(blobSize, blobSize + 20, false); testRangeRequestLastNBytes(0, true); blobSize = maxChunkSize * 2 + random.nextInt(maxChunkSize); testRangeRequestClosedRange(0, maxChunkSize - 1, true); testRangeRequestClosedRange(maxChunkSize, maxChunkSize * 2 - 1, true); testRangeRequestClosedRange(maxChunkSize * 2, blobSize - 1, true); <START> } <END></code><technical_language>test cases for ranges chunk boundaries? Start in middle etc? While random test is good, guarantee testing cases I</technical_language>

Target:
public void testRangeRequestCompositeBlob() throws Exception { for (int i = 0; i < 5; i++) { blobSize = random.nextInt(maxChunkSize) + maxChunkSize * random.nextInt(10); int randomOne = random.nextInt(blobSize); int randomTwo = random.nextInt(blobSize); testRangeRequestOffsetRange(Math.min(randomOne, randomTwo), Math.max(randomOne, randomTwo), true); } blobSize = random.nextInt(maxChunkSize) + maxChunkSize * random.nextInt(10); testRangeRequestOffsetRange(0, blobSize - 1, true); testRangeRequestFromStartOffset(random.nextInt(blobSize), true); testRangeRequestLastNBytes(random.nextInt(blobSize) + 1, true); testRangeRequestLastNBytes(blobSize + 1, false); testRangeRequestOffsetRange(random.nextInt(blobSize), blobSize + 5, false); testRangeRequestFromStartOffset(blobSize, false); testRangeRequestOffsetRange(blobSize, blobSize + 20, false); testRangeRequestLastNBytes(0, true); testRangeRequestOffsetRange(0, 0, true); testRangeRequestOffsetRange(blobSize - 1, blobSize - 1, true); testRangeRequestFromStartOffset(blobSize - 1, true); testRangeRequestLastNBytes(1, true); blobSize = maxChunkSize * 2 + random.nextInt(maxChunkSize); testRangeRequestOffsetRange(0, maxChunkSize - 1, true); testRangeRequestOffsetRange(maxChunkSize, maxChunkSize * 2 - 1, true); testRangeRequestOffsetRange(maxChunkSize * 2, blobSize - 1, true); testRangeRequestOffsetRange(maxChunkSize / 2, maxChunkSize + maxChunkSize / 2, true); testRangeRequestFromStartOffset(maxChunkSize + maxChunkSize / 2, true); }
Source:
<code>public void test_add_1() { <START> HuffmanParamsCalculator c = new HuffmanParamsCalculator(); <END> c.add(1); c.calculate(); int[] values = c.getValues(); int[] bitLens = c.getBitLens(); Assert.assertEquals(1, values.length); Assert.assertEquals(1, bitLens.length); Assert.assertEquals(1, values[0]); Assert.assertEquals(0, bitLens[0]); }</code><technical_language>final for fields change value</technical_language>

Target:
public void test_add_1() { final HuffmanParamsCalculator c = new HuffmanParamsCalculator(); c.addOne(1); c.calculate(); final int[] values = c.getValues(); final int[] bitLens = c.getBitLens(); Assert.assertEquals(1, values.length); Assert.assertEquals(1, bitLens.length); Assert.assertEquals(1, values[0]); Assert.assertEquals(0, bitLens[0]); }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; <START> if (o == null || getClass() != o.getClass()) <END> return false; Condition condition = (Condition) o; return Objects.equals(cf, condition.cf) && Objects.equals(cq, condition.cq) && Objects.equals(cv, condition.cv) && Objects.equals(val, condition.val) && Objects.equals(ts, condition.ts) && Arrays.equals(iterators, condition.iterators); }</code><technical_language>This changed instanceof of getClass(), is same. is more narrow. I changed instanceof, check for null redundant, instanceof is false if null</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || !(o instanceof Condition)) return false; Condition condition = (Condition) o; return Objects.equals(cf, condition.cf) && Objects.equals(cq, condition.cq) && Objects.equals(cv, condition.cv) && Objects.equals(val, condition.val) && Objects.equals(ts, condition.ts) && Arrays.equals(iterators, condition.iterators); }
Source:
<code>public static CatalogDto newDtoFromUrl(String url) { log.debug("Retrieving catalog from: "+url); try { InputStream source = new ResourceUtils(null).getResourceFromUrl(url); return (CatalogDto) new CatalogXmlSerializer().deserialize(new InputStreamReader(source)); } catch (Throwable t) { log.debug("Unable to retrieve catalog from: "+url+" ("+t+")"); throw Exceptions.propagate(t); } finally { <START> log.debug("Retrieved catalog from: "+url); <END> } }</code><technical_language>this want in a finally block (e.g. log "unable retrieve..." immediately "retrieved catalog from...")</technical_language>

Target:
public static CatalogDto newDtoFromUrl(String url) { if (log.isDebugEnabled()) log.debug("Retrieving catalog from: {}", url); try { InputStream source = new ResourceUtils(null).getResourceFromUrl(url); CatalogDto result = (CatalogDto) new CatalogXmlSerializer().deserialize(new InputStreamReader(source)); if (log.isDebugEnabled()) log.debug("Retrieved catalog from: {}", url); return result; } catch (Throwable t) { log.debug("Unable to retrieve catalog from: "+url+" ("+t+")"); throw Exceptions.propagate(t); } }
Source:
<code>Canvas build() { VLayout vl = new VLayout(); this.treeGrid = new TreeGrid(); treeGrid.setWidth100(); treeGrid.setHeight100(); treeGrid.setShowHeader(false); treeGrid.setSelectionType(SelectionStyle.SINGLE); TreeGridField field = new TreeGridField("name"); field.setCanSort(true); field.setSortByDisplayField(true); treeGrid.setFields(field); treeGrid.setSortField("name"); this.tree = new Tree(); tree.setModelType(TreeModelType.PARENT); tree.setNameProperty("name"); tree.setIdField(NODE_ID); this.treeGrid.setData(this.tree); this.treeGrid.addNodeClickHandler(event -> { TreeNode n = event.getNode(); if (n instanceof TNode) { TNode tn = (TNode) n; ignoreNodeSelectedEvent = true; TreeView.this.controller.selectNode(tn.rmNode); } else if (n instanceof TNS) { TNS tn = (TNS) n; ignoreNodeSelectedEvent = true; TreeView.this.controller.selectNodeSource(tn.rmNS); } else if (n instanceof THost) { THost tn = (THost) n; ignoreNodeSelectedEvent = true; TreeView.this.controller.selectHost(tn.rmHost); } }); this.treeGrid.addNodeContextClickHandler(event -> { <START> Object releated = null; <END> final TreeNode treeNode = event.getNode(); if (treeNode instanceof TNode) { TNode tn = (TNode) treeNode; releated = tn.rmNode; } else if (treeNode instanceof TNS) { TNS tn = (TNS) treeNode; releated = tn.rmNS; } else if (treeNode instanceof THost) { THost tn = (THost) treeNode; releated = tn.rmHost; } final Menu menu = ContextMenu.createContextMenuFromTreeView(controller, releated, tree); treeGrid.setContextMenu(menu); }); vl.addMember(treeGrid); return vl; }</code><technical_language>releated -> related</technical_language>

Target:
Canvas build() { VLayout vl = new VLayout(); this.treeGrid = new TreeGrid(); treeGrid.setWidth100(); treeGrid.setHeight100(); treeGrid.setShowHeader(false); treeGrid.setSelectionType(SelectionStyle.SINGLE); TreeGridField field = new TreeGridField("name"); field.setCanSort(true); field.setSortByDisplayField(true); treeGrid.setFields(field); treeGrid.setSortField("name"); this.tree = new Tree(); tree.setModelType(TreeModelType.PARENT); tree.setNameProperty("name"); tree.setIdField(NODE_ID); this.treeGrid.setData(this.tree); this.treeGrid.addNodeClickHandler(event -> { TreeNode n = event.getNode(); if (n instanceof TNode) { TNode tn = (TNode) n; ignoreNodeSelectedEvent = true; TreeView.this.controller.selectNode(tn.rmNode); } else if (n instanceof TNS) { TNS tn = (TNS) n; ignoreNodeSelectedEvent = true; TreeView.this.controller.selectNodeSource(tn.rmNS); } else if (n instanceof THost) { THost tn = (THost) n; ignoreNodeSelectedEvent = true; TreeView.this.controller.selectHost(tn.rmHost); } }); this.treeGrid.addNodeContextClickHandler(event -> { Object related = null; final TreeNode treeNode = event.getNode(); if (treeNode instanceof TNode) { TNode tn = (TNode) treeNode; related = tn.rmNode; } else if (treeNode instanceof TNS) { TNS tn = (TNS) treeNode; related = tn.rmNS; } else if (treeNode instanceof THost) { THost tn = (THost) treeNode; related = tn.rmHost; } final Menu menu = ContextMenu.createContextMenuFromTreeView(controller, related, tree); treeGrid.setContextMenu(menu); }); vl.addMember(treeGrid); return vl; }