auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void execute(DiagnosticContext context) { try { <START> List<RestEntry> entries = new ArrayList(); <END> entries.addAll(context.getLogstashRestCalls().values()); runQueries(context.getEsRestClient(), entries, context.getTempDir(), 0, 0); String temp = context.getTempDir(); JsonNode nodeData = JsonYamlUtils.createJsonNodeFromFileName(temp, "logstash_node.json"); JsonNode jvm = nodeData.path("jvm"); String pid = jvm.path("pid").asText(); context.setPid(pid); } catch (Throwable t) { logger.log(SystemProperties.DIAG, "Logstash Query error:", t); throw new DiagnosticException(String.format("Error obtaining logstash output and/or process id - exiting. %s", Constants.CHECK_LOG)); } }</code><technical_language>suggestion List<RestEntry> entries = new ArrayList<>();</technical_language>

Target:
public void execute(DiagnosticContext context) { try { List<RestEntry> entries = new ArrayList<>(); entries.addAll(context.getLogstashRestCalls().values()); runQueries(context.getEsRestClient(), entries, context.getTempDir(), 0, 0); String temp = context.getTempDir(); JsonNode nodeData = JsonYamlUtils.createJsonNodeFromFileName(temp, "logstash_node.json"); JsonNode jvm = nodeData.path("jvm"); String pid = jvm.path("pid").asText(); context.setPid(pid); } catch (Throwable t) { logger.log(SystemProperties.DIAG, "Logstash Query error:", t); throw new DiagnosticException(String.format("Error obtaining logstash output and/or process id - exiting. %s", Constants.CHECK_LOG)); } }
Source:
<code>private void applyConfig(Map<String, Object> config) { if (config == null) { return; } final String max = Objects.toString(config.get("maxSubscriptions"), null); if (max != null) { <START> maxSubscriptions = Integer.parseInt(max); <END> } }</code><technical_language>handle NumberFormatException</technical_language>

Target:
private void applyConfig(Map<String, Object> config) { if (config == null) { return; } final String max = Objects.toString(config.get("maxSubscriptions"), null); if (max != null) { try { maxSubscriptions = Integer.parseInt(max); } catch (NumberFormatException e) { logger.debug("Setting 'maxSubscriptions' must be a number; value '{}' ignored.", max); } } }
Source:
<code>protected View onCreateAnswerView(Context context, FormEntryPrompt prompt, int answerFontSize) { <START> binding = WidgetAnswerBinding.inflate(((Activity) context).getLayoutInflater()); <END> View answerView = binding.getRoot(); if (prompt.isReadOnly()) { binding.widgetButton.setVisibility(GONE); } else { binding.widgetButton.setTextSize(TypedValue.COMPLEX_UNIT_DIP, answerFontSize); binding.widgetButton.setText(getContext().getString(R.string.open_url)); binding.widgetButton.setOnClickListener(v -> onButtonClick()); } binding.widgetAnswerText.setGravity(TEXT_ALIGNMENT_CENTER); binding.widgetAnswerText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, answerFontSize); binding.widgetAnswerText.setText(prompt.getAnswerText()); return answerView; }</code><technical_language>I this layout called button_and_answer something. I suggesting "default" answer view</technical_language>

Target:
protected View onCreateAnswerView(Context context, FormEntryPrompt prompt, int answerFontSize) { binding = UrlWidgetAnswerBinding.inflate(((Activity) context).getLayoutInflater()); binding.urlButton.setTextSize(TypedValue.COMPLEX_UNIT_DIP, answerFontSize); binding.urlButton.setOnClickListener(v -> onButtonClick()); return binding.getRoot(); }
Source:
<code>protected <S extends KeySpec> S engineGetKeySpec(final String algorithm, final Password password, final Class<S> keySpecType) throws InvalidKeySpecException { if (password instanceof AbstractPasswordImpl) { final AbstractPasswordImpl abstractPassword = (AbstractPasswordImpl) password; if (algorithm.equals(abstractPassword.getAlgorithm())) { return abstractPassword.getKeySpec(keySpecType); } } <START> switch (algorithm) { <END> case ALGORITHM_SHA256CRYPT: case ALGORITHM_SHA512CRYPT: { if (password instanceof UnixSHACryptPassword) { if (keySpecType == UnixSHACryptPasswordSpec.class) { UnixSHACryptPassword p = ((UnixSHACryptPassword) password); return keySpecType.cast(new UnixSHACryptPasswordSpec(p.getId(), p.getEncoded(), p.getSalt(), p.getIterationCount())); } } else { break; } } } throw new InvalidKeySpecException(); }</code><technical_language>This bit required. If UnixSHACryptPassword extends AbstractPasswordImpl (as should), method convert a key spec right class</technical_language>

Target:
protected <S extends KeySpec> S engineGetKeySpec(final String algorithm, final Password password, final Class<S> keySpecType) throws InvalidKeySpecException { if (password instanceof AbstractPasswordImpl) { final AbstractPasswordImpl abstractPassword = (AbstractPasswordImpl) password; if (algorithm.equals(abstractPassword.getAlgorithm())) { return abstractPassword.getKeySpec(keySpecType); } } throw new InvalidKeySpecException(); }
Source:
<code>private void indexDown(File dir, String parent, IndexDownArgs args) throws IOException { if (isInterrupted()) { return; } if (!accept(dir)) { return; } File[] files = dir.listFiles(); if (files == null) { LOGGER.log(Level.SEVERE, "Failed to get file listing for: {0}", dir.getPath()); return; } Arrays.sort(files, FILENAME_COMPARATOR); for (File file : files) { if (accept(dir, file)) { String path = parent + '/' + file.getName(); if (file.isDirectory()) { indexDown(file, path, args); } else { args.cur_count++; if (args.count_only) continue; if (uidIter != null) { String uid = Util.path2uid(path, DateTools.timeToString(file.lastModified(), DateTools.Resolution.MILLISECOND)); BytesRef buid = new BytesRef(uid); while (uidIter != null && uidIter.term() != null && uidIter.term().compareTo(emptyBR) != 0 && uidIter.term().compareTo(buid) < 0) { String termPath = Util.uid2url(uidIter.term().utf8ToString()); removeFile(!termPath.equals(path)); BytesRef next = uidIter.next(); if (next == null) { uidIter = null; } } if (uidIter != null && uidIter.term() != null && <START> uidIter.term().bytesEquals(buid)) { <END> boolean chkres = chkFields(file, path); if (!chkres) removeFile(false); BytesRef next = uidIter.next(); if (next == null) uidIter = null; if (chkres) continue; } } args.works.add(new IndexFileWork(file, path)); } } } }</code><technical_language>Wrong indentation, code in condition mistaken for code it. be: java if (uidIter != null && uidIter.term() != null && uidIter.term().bytesEquals(buid)) {</technical_language>

Target:
private void indexDown(File dir, String parent, IndexDownArgs args) throws IOException { if (isInterrupted()) { return; } if (!accept(dir)) { return; } File[] files = dir.listFiles(); if (files == null) { LOGGER.log(Level.SEVERE, "Failed to get file listing for: {0}", dir.getPath()); return; } Arrays.sort(files, FILENAME_COMPARATOR); for (File file : files) { if (accept(dir, file)) { String path = parent + '/' + file.getName(); if (file.isDirectory()) { indexDown(file, path, args); } else { args.cur_count++; if (args.count_only) continue; if (uidIter != null) { String uid = Util.path2uid(path, DateTools.timeToString(file.lastModified(), DateTools.Resolution.MILLISECOND)); BytesRef buid = new BytesRef(uid); while (uidIter != null && uidIter.term() != null && uidIter.term().compareTo(emptyBR) != 0 && uidIter.term().compareTo(buid) < 0) { String termPath = Util.uid2url(uidIter.term().utf8ToString()); removeFile(!termPath.equals(path)); BytesRef next = uidIter.next(); if (next == null) { uidIter = null; } } if (uidIter != null && uidIter.term() != null && uidIter.term().bytesEquals(buid)) { boolean chkres = chkSettings(path); if (!chkres) { removeFile(false); } BytesRef next = uidIter.next(); if (next == null) { uidIter = null; } if (chkres) { continue; } } } args.works.add(new IndexFileWork(file, path)); } } } }
Source:
<code>public List<ActivityDetails> metadataForApiKeys(@RequestParam final Long start, @RequestParam final Long end) throws JsonParseException, IOException, ValidationException { Date startDate = new Date(start); Date endDate = new Date(end); validateActivityDatesAndDateRange(start, end); <START> return activityManager.getApiKeyActivity(startDate, endDate); <END> }</code><technical_language>new getApiKeyActivityMetdata method called here? ActivityMetadata object returned</technical_language>

Target:
public List<ActivityMetadata> metadataForApiKeys(@RequestParam final Long start, @RequestParam final Long end) throws JsonParseException, IOException, ValidationException { Date startDate = new Date(start); Date endDate = new Date(end); validateActivityDatesAndDateRange(start, end); return activityMetadataManager.getApiKeyManagementMetadata(startDate, endDate); }
Source:
<code>protected Control createControl(Composite parent) { CTConfiguration config = new CTConfiguration(parent, CTConfiguration.STYLE_TABLE); config.setHorizontalAlignment(SWT.CENTER); config.setCellSelectionEnabled(false); config.setColumnSelectionEnabled(false); config.setRowSelectionEnabled(false); config.setColumnHeaderLayout(CTConfiguration.COLUMN_HEADER_LAYOUT_FILL_EQUAL); config.setRowHeaderLayout(CTConfiguration.ROW_HEADER_LAYOUT_DEFAULT); <START> this.table = new ComponentTable(parent, SWT.FULL_SELECTION, config); <END> return this.table.getControl(); }</code><technical_language>Please here. This is a standard SWT table</technical_language>

Target:
protected Control createControl(Composite parent) { CTConfiguration config = new CTConfiguration(parent, CTConfiguration.STYLE_TABLE); config.setHorizontalAlignment(SWT.CENTER); config.setCellSelectionEnabled(false); config.setColumnSelectionEnabled(false); config.setRowSelectionEnabled(false); config.setColumnHeaderLayout(CTConfiguration.COLUMN_HEADER_LAYOUT_FILL_EQUAL); config.setRowHeaderLayout(CTConfiguration.ROW_HEADER_LAYOUT_DEFAULT); this.table = new ComponentTable(parent, SWT.NONE, config); return this.table.getControl(); }
Source:
<code>private static List<File> listFiles(File dir) { <START> if ((dir != null) && dir.isDirectory()) { <END> File[] files = dir.listFiles(); if (files != null) { return ImmutableList.copyOf(files); } } return ImmutableList.of(); }</code><technical_language>unnecessary parens dir != null</technical_language>

Target:
private static List<File> listFiles(File dir) { if (dir != null && dir.isDirectory()) { File[] files = dir.listFiles(); if (files != null) { return ImmutableList.copyOf(files); } } return ImmutableList.of(); }
Source:
<code>public void sessionClosed(IoSession session) throws Exception { TcpipClientChannel channel = (TcpipClientChannel) session.removeAttribute(TcpipClientChannel.class); Throwable cause = (Throwable) session.removeAttribute(TcpipForwardingExceptionMarker.class); if (channel != null) { if (debugEnabled) { log.debug("sessionClosed({}) closing channel={} after messages - cause={}", session, channel, messagesCounter, (cause == null) ? null : cause.getClass().getSimpleName()); } if (cause != null) { channel.close(true); } else { OpenFuture openFuture = channel.getOpenFuture(); if (!openFuture.isDone()) { openFuture.addListener(f -> { channel.close(false); }); } else { channel.close(false); } <START> } <END> } }</code><technical_language>This code is rebased latest version..</technical_language>

Target:
public void sessionClosed(IoSession session) throws Exception { TcpipClientChannel channel = (TcpipClientChannel) session.removeAttribute(TcpipClientChannel.class); Throwable cause = (Throwable) session.removeAttribute(TcpipForwardingExceptionMarker.class); if (debugEnabled) { log.debug("sessionClosed({}) closing channel={} after messages - cause={}", session, channel, messagesCounter, (cause == null) ? null : cause.getClass().getSimpleName()); } if (channel == null) { return; } if (cause != null) { channel.close(true); } else { OpenFuture f = channel.getOpenFuture(); Throwable err = f.getException(); boolean immediatly = err != null; if (immediatly) { channel.close(immediatly); } else { ClientChannelPendingMessagesQueue queue = channel.getPendingMessagesQueue(); queue.getCompletedFuture().addListener(l -> { channel.close(immediatly); }); } } }
Source:
<code>public void createFromCopy() throws ConflictException, IOException { MutableDocumentRevision update = saved.mutableCopy(); update.body = bodyTwo; update.docId = "copy"; String attachmentName = "bonsai-boston.jpg"; File f = new File("fixture", attachmentName); Attachment att = new UnsavedFileAttachment(f, "image/jpeg"); update.attachments.put(attachmentName, att); DocumentRevision updated = datastore.createDocumentFromRevision(update); Assert.assertNotNull("Updated document is null", updated); DocumentRevision retrieved = datastore.getDocument(update.docId); Assert.assertNotNull("Retrieved document is null", retrieved); Attachment retrievedAtt = datastore.getAttachment(updated, attachmentName); <START> Assert.assertNotNull("Retrieved attachment 1 is null", retrievedAtt); <END> Attachment retrievedAtt2 = datastore.getAttachment(updated, initialAtt1); Assert.assertNotNull("Retrieved attachment 2 is null", retrievedAtt2); Attachment retrievedAtt3 = datastore.getAttachment(updated, initialAtt2); Assert.assertNotNull("Retrieved attachment 3 is null", retrievedAtt3); Assert.assertEquals("Revision should have 2 attachments", 3, saved.getAttachments().size()); Assert.assertNotNull("Document attachment 1 is null", saved.getAttachments().get(initialAtt1)); Assert.assertNotNull("Document attachment 2 is null", saved.getAttachments().get(initialAtt2)); Assert.assertNotNull("Document attachment 2 is null", saved.getAttachments().get(attachmentName)); }</code><technical_language>Do need test older API here, is enough test new revision correct attachments</technical_language>

Target:
public void createFromCopy() throws ConflictException, IOException { MutableDocumentRevision update = saved.mutableCopy(); update.body = bodyTwo; update.docId = "copy"; String attachmentName = "bonsai-boston.jpg"; File f = new File("fixture", attachmentName); Attachment att = new UnsavedFileAttachment(f, "image/jpeg"); update.attachments.put(attachmentName, att); BasicDocumentRevision updated = datastore.createDocumentFromRevision(update); Assert.assertNotNull("Updated document is null", updated); BasicDocumentRevision retrieved = datastore.getDocument(update.docId); Assert.assertNotNull("Retrieved document is null", retrieved); Attachment retrievedAtt = datastore.getAttachment(updated, attachmentName); Assert.assertNotNull("Retrieved attachment 1 is null", retrievedAtt); Attachment retrievedAtt2 = datastore.getAttachment(updated, initialAtt1); Assert.assertNotNull("Retrieved attachment 2 is null", retrievedAtt2); Attachment retrievedAtt3 = datastore.getAttachment(updated, initialAtt2); Assert.assertNotNull("Retrieved attachment 3 is null", retrievedAtt3); Assert.assertEquals("Revision should have 2 attachments", 3, saved.getAttachments().size()); Assert.assertNotNull("Document attachment 1 is null", saved.getAttachments().get(initialAtt1)); Assert.assertNotNull("Document attachment 2 is null", saved.getAttachments().get(initialAtt2)); Assert.assertNotNull("Document attachment 2 is null", saved.getAttachments().get(attachmentName)); }
Source:
<code><START> private Unit(String symbol) { <END> this.symbol = symbol; }</code><technical_language>suggestion Unit(String symbol) {</technical_language>

Target:
Unit(String symbol) { this.symbol = symbol; }
Source:
<code>public void addCandidateUsers(CandidateUsersPayload candidateUsersPayload) { Task task; try { <START> task = task(candidateUsersPayload.getTaskId()); <END> } catch (IllegalStateException ex) { throw new IllegalStateException("The authenticated user cannot update the task" + candidateUsersPayload.getTaskId() + " due it is not the current assignee"); } if (candidateUsersPayload.getCandidateUsers() != null && !candidateUsersPayload.getCandidateUsers().isEmpty()) { for (String u : candidateUsersPayload.getCandidateUsers()) { taskService.addCandidateUser(task.getId(), u); } } }</code><technical_language>@CTI777 here.. check is User endpoints.. if admin execute operation matter what.</technical_language>

Target:
public void addCandidateUsers(CandidateUsersPayload candidateUsersPayload) { if (candidateUsersPayload.getCandidateUsers() != null && !candidateUsersPayload.getCandidateUsers().isEmpty()) { for (String u : candidateUsersPayload.getCandidateUsers()) { taskService.addCandidateUser(candidateUsersPayload.getTaskId(), u); } } }
Source:
<code>public static void Init() { mUpdateVmTemplate = new ObjectIdentityChecker(VmTemplateHandler.class); BlankVmTemplateId = new Guid("00000000-0000-0000-0000-000000000000"); mUpdateVmTemplate.AddPermittedFields(new String[] { "name", "description", "domain", "os", "osType", "autoSuspend", "interfaces", "memSizeMb", "numOfSockets", "cpuPerSocket", "vdsGroupId", "numOfMonitors", "allowConsoleReconnect", "usbPolicy", "timeZone", "diskMap", "defaultBootSequence", "disabled", "isoPath", "diskImageMap", "defaultDisplayType", "priority", "autoStartup", "stateless", "initrdUrl", "kernelUrl", "kernelParams", "images", "interfaces", "quotaId", "quotaName", "quotaEnforcementType", "migrationSupport", "dedicatedVmForVds", "smartcardEnabled","dbGeneration", "deleteProtected", <START> "quotaDefault", "vncKeyboardLayout", <END> }); }</code><technical_language>is extra ',' in end</technical_language>

Target:
public static void Init() { mUpdateVmTemplate = new ObjectIdentityChecker(VmTemplateHandler.class); BlankVmTemplateId = new Guid("00000000-0000-0000-0000-000000000000"); mUpdateVmTemplate.AddPermittedFields(new String[] { "name", "description", "domain", "os", "osType", "autoSuspend", "interfaces", "memSizeMb", "numOfSockets", "cpuPerSocket", "vdsGroupId", "numOfMonitors", "allowConsoleReconnect", "usbPolicy", "timeZone", "diskMap", "defaultBootSequence", "disabled", "isoPath", "diskImageMap", "defaultDisplayType", "priority", "autoStartup", "stateless", "initrdUrl", "kernelUrl", "kernelParams", "images", "interfaces", "quotaId", "quotaName", "quotaEnforcementType", "migrationSupport", "dedicatedVmForVds", "smartcardEnabled","dbGeneration", "deleteProtected", "quotaDefault", "tunnelMigration", "vncKeyboardLayout" }); }
Source:
<code>public String getInstallationID() { <START> return thingIfApi.getInstallationID(); <END> }</code><technical_language>Adding this a field is good manner</technical_language>

Target:
public String getInstallationID() { return this.thingIfApi.getInstallationID(); }
Source:
<code><START> CacheStorageImpl(){ <END> queryStateMap = new HashMap<>(); }</code><technical_language>@Inject</technical_language>

Target:
CacheStorageImpl(){ queryStateMap = new ConcurrentHashMap<>(); }
Source:
<code>public void intersect_shouldNotContainDuplicatePatientIDs() throws Exception { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date startDate = dateFormat.parse("2017-01-01 00:00:00"); Date startDate2 = dateFormat.parse("20017-02-15 00:00:00"); Cohort cohortA = new Cohort(3); Cohort cohortB = new Cohort (4); CohortMembership membershipAOne = new CohortMembership(7, startDate); CohortMembership membershipATwo = new CohortMembership(7, startDate2); CohortMembership membershipBOne = new CohortMembership(7, startDate); CohortMembership membershipBTwo = new CohortMembership(7, startDate2); <START> cohortA.addMembership(membershipAOne); <END> cohortA.addMembership(membershipATwo); cohortB.addMembership(membershipBOne); cohortB.addMembership(membershipBTwo); Cohort cohortIntersect = Cohort.intersect(cohortA,cohortB); cohortIntersect.getMemberships().forEach(m -> { assertTrue(m.getPatientId().equals(7)); assertNull(m.getStartDate()); }); assertEquals(1, cohortIntersect.getMemberships().size()); }</code><technical_language>This invalid state me. allowed in cohort twice, overlapping dates. E.g. need end membershipAOne starting membershipATwo</technical_language>

Target:
public void intersect_shouldNotContainDuplicatePatientIDs() throws Exception { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date startDate = dateFormat.parse("2017-01-01 00:00:00"); Date startDate2 = dateFormat.parse("20017-02-15 00:00:00"); Date endDate = dateFormat.parse("2017-01-15 00:00:00"); Date endDate2 = dateFormat.parse("2017-02-20 00:00:00"); Cohort cohortA = new Cohort(3); Cohort cohortB = new Cohort (4); CohortMembership membershipAOne = new CohortMembership(7, startDate); membershipAOne.setEndDate(endDate); CohortMembership membershipATwo = new CohortMembership(7, startDate2); membershipATwo.setEndDate(endDate2); CohortMembership membershipBOne = new CohortMembership(7, startDate); membershipBOne.setEndDate(endDate); CohortMembership membershipBTwo = new CohortMembership(7, startDate2); membershipBTwo.setEndDate(endDate2); cohortA.addMembership(membershipAOne); cohortA.addMembership(membershipATwo); cohortB.addMembership(membershipBOne); cohortB.addMembership(membershipBTwo); Cohort cohortIntersect = Cohort.intersect(cohortA,cohortB); cohortIntersect.getMemberships().forEach(m -> { assertTrue(m.getPatientId().equals(7)); assertNull(m.getStartDate()); }); assertEquals(1, cohortIntersect.getMemberships().size()); }
Source:
<code>protected void label(Namespace namespace, Map<String, String> ensureLabels) throws InfrastructureException { Map<String, String> currentLabels = namespace.getMetadata().getLabels(); Map<String, String> newLabels = currentLabels != null ? new HashMap<>(currentLabels) : new HashMap<>(); if (newLabels.entrySet().containsAll(ensureLabels.entrySet())) { LOG.debug( "Nothing to do, namespace already has all required labels.", namespace.getMetadata().getName()); return; } newLabels.putAll(ensureLabels); namespace.getMetadata().setLabels(newLabels); try { <START> cheClientFactory.create().namespaces().createOrReplace(namespace); <END> } catch (KubernetesClientException kce) { if (kce.getCode() == 403) { LOG.debug("Can't label the namespace due to lack of permissions ¯\\_(ツ)_/¯"); return; } throw new InfrastructureException(kce); } }</code><technical_language>I some doubts need update labels for namespace che server is running. job of operator another deployment tool</technical_language>

Target:
protected void label(Namespace namespace, Map<String, String> ensureLabels) throws InfrastructureException { Map<String, String> currentLabels = namespace.getMetadata().getLabels(); Map<String, String> newLabels = currentLabels != null ? new HashMap<>(currentLabels) : new HashMap<>(); if (newLabels.entrySet().containsAll(ensureLabels.entrySet())) { LOG.debug( "Nothing to do, namespace already has all required labels.", namespace.getMetadata().getName()); return; } try { cheSAClientFactory .create() .namespaces() .createOrReplace( new NamespaceBuilder(namespace) .editMetadata() .addToLabels(ensureLabels) .endMetadata() .build()); } catch (KubernetesClientException kce) { if (kce.getCode() == 403) { LOG.debug("Can't label the namespace due to lack of permissions ¯\\_(ツ)_/¯"); return; } throw new InfrastructureException(kce); } }
Source:
<code>synchronized TaskStatesPage getTaskPaginated(JobId jobId, int offset, int limit) throws UnknownJobException, NotConnectedException, PermissionException { <START> checkPermissions("getTaskPaginated", <END> getIdentifiedJob(jobId), YOU_DO_NOT_HAVE_PERMISSION_TO_GET_THE_STATE_OF_THIS_JOB); ClientJobState jobState = jobsMap.get(jobId); synchronized (jobState) { try { final TaskStatesPage tasksPaginated = jobState.getTasksPaginated(offset, limit); final List<TaskState> taskStatesCopy = (List<TaskState>) ProActiveMakeDeepCopy.WithProActiveObjectStream.makeDeepCopy(new ArrayList<>(tasksPaginated.getTaskStates())); return new TaskStatesPage(taskStatesCopy, tasksPaginated.getSize()); } catch (Exception e) { logger.error("Error when copying tasks page", e); throw new IllegalStateException(e); } } }</code><technical_language>getTaskState methods "getJobState" permission. If a user permission read state of a job, read state of of tasks</technical_language>

Target:
synchronized TaskStatesPage getTaskPaginated(JobId jobId, int offset, int limit) throws UnknownJobException, NotConnectedException, PermissionException { checkPermissions("getJobState", getIdentifiedJob(jobId), YOU_DO_NOT_HAVE_PERMISSION_TO_GET_THE_STATE_OF_THIS_JOB); ClientJobState jobState = jobsMap.get(jobId); synchronized (jobState) { try { final TaskStatesPage tasksPaginated = jobState.getTasksPaginated(offset, limit); final List<TaskState> taskStatesCopy = (List<TaskState>) ProActiveMakeDeepCopy.WithProActiveObjectStream.makeDeepCopy(new ArrayList<>(tasksPaginated.getTaskStates())); return new TaskStatesPage(taskStatesCopy, tasksPaginated.getSize()); } catch (Exception e) { logger.error("Error when copying tasks page", e); throw new IllegalStateException(e); } } }
Source:
<code>public CRAMFileReader(final File cramFile, final File indexFile, final CRAMReferenceSource referenceSource, final ValidationStringency validationStringency) throws IOException { this(new FileInputStream(cramFile), <START> wrapIndexFile(cramFile, indexFile), <END> referenceSource, validationStringency); this.cramFile = cramFile; initIndexFile(indexFile); }</code><technical_language>this redundant single-use static method, I cleaner remove it, instead factor out common initialization code constructor delegating to, call method constructors (this method longer delegate other one)</technical_language>

Target:
public CRAMFileReader(final File cramFile, final File indexFile, final CRAMReferenceSource referenceSource, final ValidationStringency validationStringency) throws IOException { if (cramFile == null) { throw new IllegalArgumentException("Input file can not be null for CRAM reader"); } if (referenceSource == null) { throw new IllegalArgumentException("A reference is required for CRAM readers"); } this.cramFile = cramFile; this.referenceSource = referenceSource; this.mIndexFile = findIndexForFile(indexFile, cramFile); final SeekableFileStream indexStream = this.mIndexFile == null ? null : new SeekableFileStream(this.mIndexFile); initWithStreams(new FileInputStream(cramFile), indexStream, validationStringency); }
Source:
<code>public List<DCInputSet> getInputsBySubmissionName(String name) throws DCInputsReaderException { SubmissionConfig config; try { config = new SubmissionConfigReader().getSubmissionConfigByName(name); String formName = config.getSubmissionName(); if (formName == null) { throw new DCInputsReaderException("No form designated as default"); } List<DCInputSet> results = new ArrayList<DCInputSet>(); for (int idx = 0; idx < config.getNumberOfSteps(); idx++) { SubmissionStepConfig step = config.getStep(idx); if(SubmissionStepConfig.INPUT_FORM_STEP_NAME.equals(step.getType())) { results.add(getInputsByFormName(step.getId())); } } return results; <START> } catch (ServletException e) { <END> throw new DCInputsReaderException("No form designated as default"); } }</code><technical_language>Again, ServletExceptions in DSpace API module</technical_language>

Target:
public List<DCInputSet> getInputsBySubmissionName(String name) throws DCInputsReaderException { SubmissionConfig config; try { config = new SubmissionConfigReader().getSubmissionConfigByName(name); String formName = config.getSubmissionName(); if (formName == null) { throw new DCInputsReaderException("No form designated as default"); } List<DCInputSet> results = new ArrayList<DCInputSet>(); for (int idx = 0; idx < config.getNumberOfSteps(); idx++) { SubmissionStepConfig step = config.getStep(idx); if(SubmissionStepConfig.INPUT_FORM_STEP_NAME.equals(step.getType())) { results.add(getInputsByFormName(step.getId())); } } return results; } catch (SubmissionConfigReaderException e) { throw new DCInputsReaderException("No form designated as default", e); } }
Source:
<code><START> private static boolean isPrimitiveType(Type type) { <END> return (type instanceof Class) && ((Class)type).isPrimitive(); }</code><technical_language>able avoid compiler warnings raw types phrasing as: return type instanceof Class<?> && ((Class<?>) type).isPrimitive(); straight-wildcard form of a generic type in instanceof casts issue</technical_language>

Target:
private static boolean isPrimitiveType(Type type) { return type instanceof Class<?> && ((Class<?>)type).isPrimitive(); }
Source:
<code>public void testAndNameEquals() throws Exception { ReadableBranch branch = setupNameEqualsArtifacts(); <START> <END> QueryBuilder builder = factory.fromBranch(branch); builder.andNameEquals("Folder"); ResultSet<ArtifactReadable> artifacts = builder.getResults(); assertEquals(1, artifacts.size()); assertEquals("Folder", artifacts.getExactlyOne().getName()); }</code><technical_language>i suggest clean artifacts created for this test complete</technical_language>

Target:
public void testAndNameEquals() throws Exception { ReadableBranch branch = setupNameEqualsArtifacts(); try { QueryBuilder builder = factory.fromBranch(branch); builder.andNameEquals("Folder"); ResultSet<ArtifactReadable> artifacts = builder.getResults(); assertEquals(1, artifacts.size()); assertEquals("Folder", artifacts.getExactlyOne().getName()); } finally { branchApi.purgeBranch(branch, true).call(); } }
Source:
<code>private Map<String, String> getNameMap(Node name) { Map<String, String> nameMap = new HashMap<>(); String thisDisplay = null; String thisFirstName = null; String thisSurname = null; String title = null; Node firstNameNode = name .selectSingleNode("eac:part[(@localType=\"forename\") " + "or (@localType=\"givenname\")]"); if (Objects.nonNull(firstNameNode)) { thisFirstName = firstNameNode.getText(); } Node surnameNode = name .selectSingleNode("eac:part[(@localType=\"surname\") " + "or (@localType=\"familyname\")]"); if (Objects.nonNull(surnameNode)) { thisSurname = surnameNode.getText(); } Node titleNode = name.selectSingleNode("eac:part[@localType=\"title\"]"); if (Objects.nonNull(titleNode)) { title = titleNode.getText(); } if (Objects.nonNull(thisSurname)) { thisDisplay = thisSurname; nameMap.put("surname", thisSurname); if (thisFirstName != null) { thisDisplay += ", " + thisFirstName; nameMap.put("firstName", thisFirstName); } <START> if (title != null) { <END> thisDisplay += " (" + title + ")"; } nameMap.put("displayName", thisDisplay); } if (Objects.isNull(thisDisplay)) { @SuppressWarnings("unchecked") List<Node> parts = name.selectNodes("eac:part"); for (Node part : parts) { String value = getValueFromPart((Element) part); if (Objects.isNull(thisDisplay)) { thisDisplay = value; } else { thisDisplay += ", " + value; } } nameMap.put("displayName", thisDisplay); } return nameMap; }</code><technical_language>a Objects.nonNull(title) other places changes</technical_language>

Target:
private Map<String, String> getNameMap(Node name) { Map<String, String> nameMap = new HashMap<>(); String thisDisplay = null; String thisFirstName = null; String thisSurname = null; String title = null; Node firstNameNode = name .selectSingleNode("eac:part[(@localType=\"forename\") " + "or (@localType=\"givenname\")]"); if (Objects.nonNull(firstNameNode)) { thisFirstName = firstNameNode.getText(); } Node surnameNode = name .selectSingleNode("eac:part[(@localType=\"surname\") " + "or (@localType=\"familyname\")]"); if (Objects.nonNull(surnameNode)) { thisSurname = surnameNode.getText(); } Node titleNode = name.selectSingleNode("eac:part[@localType=\"title\"]"); if (Objects.nonNull(titleNode)) { title = titleNode.getText(); } if (Objects.nonNull(thisSurname)) { thisDisplay = thisSurname; nameMap.put("surname", thisSurname); if (Objects.nonNull(thisFirstName)) { thisDisplay += ", " + thisFirstName; nameMap.put("firstName", thisFirstName); } if (Objects.nonNull(title)) { thisDisplay += " (" + title + ")"; } nameMap.put("displayName", thisDisplay); } if (Objects.isNull(thisDisplay)) { @SuppressWarnings("unchecked") List<Node> parts = name.selectNodes("eac:part"); for (Node part : parts) { String value = getValueFromPart((Element) part); if (Objects.isNull(thisDisplay)) { thisDisplay = value; } else { thisDisplay += ", " + value; } } nameMap.put("displayName", thisDisplay); } return nameMap; }
Source:
<code>public void testDisabledRelativeParsingLinksWithName() { parser.setMarkupLanguage(new ConfluenceLanguage(false)); String html = parser.parseToHtml("[abc|Title]"); <START> TestUtil.println("HTML:" + html); <END> assertTrue(Pattern.compile("<body><p>\\[abc|Title\\]</p></body>", Pattern.MULTILINE).matcher(html).find()); }</code><technical_language>Consider assertEquals html instead, - tests easier maintain if start failing. want this test class extend org.eclipse.mylyn.wikitext.tests.AbstractMarkupGenerationTest, toHtml assertMarkup methods a lot easier</technical_language>

Target:
public void testDisabledRelativeParsingLinksWithName() { setupLanguageWithRelativeLinksDisabled(); assertMarkup("<p>[abc|Title]</p>", "[abc|Title]"); }
Source:
<code>public void connectServers(final AbstractServerWebSocketHandler serv) { <START> LOG.info("Open Login..,"); <END> LOG.info("Is Connection Local? {}", isConnectionLocal()); LOG.info("Is Secure? {}", isSecure()); try { createAndAddConnection(serv, isConnectionLocal(), "srl02.tamu.edu", LOGIN_PORT, isSecure(), LoginClientWebSocket.class); } catch (ConnectionException e) { LOG.info(LoggingConstants.EXCEPTION_MESSAGE, e); } LOG.info("Open Data..."); try { createAndAddConnection(serv, isConnectionLocal(), "srl04.tamu.edu", DATABASE_PORT, isSecure(), DataClientWebSocket.class); } catch (ConnectionException e) { LOG.info(LoggingConstants.EXCEPTION_MESSAGE, e); } LOG.info("Open Answer..."); try { createAndAddConnection(serv, isConnectionLocal(), "srl04.tamu.edu", ANSWER_PORT, isSecure(), AnswerClientWebSocket.class); } catch (ConnectionException e) { LOG.info(LoggingConstants.EXCEPTION_MESSAGE, e); } }</code><technical_language>change ,</technical_language>

Target:
public void connectServers(final AbstractServerWebSocketHandler serv) { LOG.info("Open Login..."); LOG.info("Is Connection Local? {}", isConnectionLocal()); LOG.info("Is Secure? {}", isSecure()); try { createAndAddConnection(serv, isConnectionLocal(), "srl02.tamu.edu", LOGIN_PORT, isSecure(), LoginClientWebSocket.class); } catch (ConnectionException e) { LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); } LOG.info("Open Data..."); try { createAndAddConnection(serv, isConnectionLocal(), "srl04.tamu.edu", DATABASE_PORT, isSecure(), DataClientWebSocket.class); } catch (ConnectionException e) { LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); } LOG.info("Open Answer..."); try { createAndAddConnection(serv, isConnectionLocal(), "srl04.tamu.edu", ANSWER_PORT, isSecure(), AnswerClientWebSocket.class); } catch (ConnectionException e) { LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); } }
Source:
<code>public SeleniumWFieldIndicatorWebElement(final WebElement element, final WebDriver driver) { super(element, driver); String tagName = element.getTagName(); <START> if (!(TOP_LEVEL_TAG.equalsIgnoreCase(tagName))) { <END> throw new SystemException("Incorrect element selected for SeleniumWFieldIndicatorWebElement. Found: " + tagName); } loadIndicator(element); }</code><technical_language>I this I totally why. smells I get a WFieldIndicator a bogus selector long I a span this WebElement happy. This is a reflection of poor quality checking I put earlier WebElement extensions I prefer if new extensions a more strict. Please check HTML class for wc-fieldindicator well</technical_language>

Target:
public SeleniumWFieldIndicatorWebElement(final WebElement element, final WebDriver driver) { super(element, driver); String tagName = element.getTagName(); String aClass = element.getAttribute("class"); if (!(TOP_LEVEL_TAG.equalsIgnoreCase(tagName))) { throw new SystemException("Incorrect element selected for SeleniumWFieldIndicatorWebElement. Found: " + tagName); } else if (!StringUtils.contains(aClass, CLASS_PREFIX)) { throw new SystemException("Incorrect element selected for SeleniumWFieldIndicatorWebElement. Found: " + aClass); } loadIndicator(element); }
Source:
<code>public void testBadCallback() throws Exception { RequestAndResult req = new RequestAndResult(chunkSize * 5 + random.nextInt(chunkSize - 1) + 1); ReadableStreamChannel putChannel = new ByteBufferReadableStreamChannel(ByteBuffer.wrap(req.putContent)); router = getNonBlockingRouter(); final CountDownLatch callbackCalled = new CountDownLatch(1); router.putBlob(req.putBlobProperties, req.putUserMetadata, putChannel, new Callback<String>() { @Override public void onCompletion(String result, Exception exception) { callbackCalled.countDown(); throw new RuntimeException("Throwing an exception in the user callback"); } }).get(); Assert.assertTrue("Callback not called.", callbackCalled.await(2, TimeUnit.SECONDS)); Assert.assertEquals("All operations should be finished.", 0, router.getOperationsCount()); <START> Assert.assertTrue("Router should not be closed", router.isOpen()); <END> router.close(); }</code><technical_language>want if Router is working properly</technical_language>

Target:
public void testBadCallback() throws Exception { RequestAndResult req = new RequestAndResult(chunkSize * 5 + random.nextInt(chunkSize - 1) + 1); router = getNonBlockingRouter(); final CountDownLatch callbackCalled = new CountDownLatch(1); requestAndResultsList.clear(); for (int i = 0; i < 4; i++) { requestAndResultsList.add(new RequestAndResult(chunkSize + random.nextInt(5) * random.nextInt(chunkSize))); } instantiateNewRouterForPuts = false; ReadableStreamChannel putChannel = new ByteBufferReadableStreamChannel(ByteBuffer.wrap(req.putContent)); Future future = router.putBlob(req.putBlobProperties, req.putUserMetadata, putChannel, new Callback<String>() { @Override public void onCompletion(String result, Exception exception) { callbackCalled.countDown(); throw new RuntimeException("Throwing an exception in the user callback"); } }); submitPutsAndAssertSuccess(false); future.get(); Assert.assertTrue("Callback not called.", callbackCalled.await(2, TimeUnit.SECONDS)); Assert.assertEquals("All operations should be finished.", 0, router.getOperationsCount()); Assert.assertTrue("Router should not be closed", router.isOpen()); requestAndResultsList.clear(); requestAndResultsList.add(new RequestAndResult(chunkSize + random.nextInt(5) * random.nextInt(chunkSize))); instantiateNewRouterForPuts = false; submitPutsAndAssertSuccess(true); }
Source:
<code><START> GreatestSqlAggFunction() <END> { super( NAME, null, SqlKind.GREATEST, ReturnTypes.ARG0_NULLABLE_IF_EMPTY, null, OperandTypes.SAME_VARIADIC, SqlFunctionCategory.SYSTEM, false, false ); }</code><technical_language>I noticed this constructor is deprecated. deprecated one</technical_language>

Target:
GreatestSqlAggFunction() { super( NAME, null, SqlKind.GREATEST, ReturnTypes.cascade(ReturnTypes.LEAST_RESTRICTIVE, SqlTypeTransforms.TO_NULLABLE), InferTypes.RETURN_TYPE, OperandTypes.ONE_OR_MORE, SqlFunctionCategory.SYSTEM, false, false, Optionality.FORBIDDEN ); }
Source:
<code>public void update(ActionEvent e) { CurrentProject currentProject = appContext.getCurrentProject(); if (currentProject == null) { e.getPresentation().setVisible(false); } <START> e.getPresentation().setVisible("javac".equals(currentProject.getProjectConfig().getType())); <END> }</code><technical_language>contants PlainJavaProjectConstants</technical_language>

Target:
public void update(ActionEvent e) { CurrentProject currentProject = appContext.getCurrentProject(); if (currentProject == null) { e.getPresentation().setVisible(false); } e.getPresentation().setVisible(JAVAC.equals(currentProject.getProjectConfig().getType())); }
Source:
<code>public Resource retrieveResource(URL url) { <START> return cache.get(url.toString(), () -> resourceRetriever.retrieveResource(url)); <END> }</code><technical_language>This work some caches Resource Serializable. recommend closer suggestion String jwks = cache.get(url.toString(), () -> resourceRetreiver.retreiveResource(url).getContent()); return new Resource(jwks, "UTF-8"); return cache.get(url.toString(), () -> resourceRetriever.retrieveResource(url));</technical_language>

Target:
public Resource retrieveResource(URL url) throws IOException { String jwkSet; try { jwkSet = cache.get(url.toString(), () -> resourceRetriever.retrieveResource(url).getContent()); } catch (Exception ex) { throw new IOException(ex); } return new Resource(jwkSet, "UTF-8"); }
Source:
<code>public int hashCode() { if (hash == 0) { <START> hash = (HashCodeUtil.hash1(x + 1337) ^ HashCodeUtil.hash1(y + 97331)) & 0x7FFFFFFF; <END> } return hash; }</code><technical_language>Objects.hash(x, y)</technical_language>

Target:
public int hashCode() { if (hash == 0) { hash = Objects.hash(x, y); } return hash; }
Source:
<code>public void measures_on_project_accessors_handled_as_methods() throws Exception { initAndScan(false); <START> ArgumentCaptor<Measure> captor = ArgumentCaptor.forClass(Measure.class); <END> ArgumentCaptor<org.sonar.api.resources.File> files = ArgumentCaptor.forClass(org.sonar.api.resources.File.class); verify(context, atLeastOnce()).saveMeasure(files.capture(), captor.capture()); Map<String, Double> metrics = new HashMap<String, Double>(); for (Measure measure : captor.getAllValues()) { if (measure.getValue() != null) { if (metrics.get(measure.getMetricKey()) == null) { metrics.put(measure.getMetricKey(), measure.getValue()); } else { metrics.put(measure.getMetricKey(), metrics.get(measure.getMetricKey()) + measure.getValue()); } } } assertThat(metrics.get("classes").intValue()).isEqualTo(412); assertThat(metrics.get("functions").intValue()).isEqualTo(3762); assertThat(metrics.get("lines").intValue()).isEqualTo(64125); assertThat(metrics.get("ncloc").intValue()).isEqualTo(26323); assertThat(metrics.get("statements").intValue()).isEqualTo(12047); assertThat(metrics.get("complexity").intValue()).isEqualTo(8462); assertThat(metrics.get("comment_lines").intValue()).isEqualTo(17908); assertThat(metrics.get("public_api").intValue()).isEqualTo(3221); double density = 1.0; if (metrics.get("public_api").intValue() != 0) { density = (metrics.get("public_api") - metrics.get("public_undocumented_api")) / metrics.get("public_api"); } assertThat(density).isEqualTo(0.64, Delta.delta(0.01)); }</code><technical_language>capture of metrics some assertions factorized duplicated</technical_language>

Target:
public void measures_on_project_accessors_handled_as_methods() throws Exception { initAndScan(false); Map<String, Double> metrics = getMetrics(); verifySameResults(metrics); assertThat(metrics.get("functions").intValue()).isEqualTo(3762); assertThat(metrics.get("public_api").intValue()).isEqualTo(3221); assertThat(metrics.get("complexity").intValue()).isEqualTo(8462); }
Source:
<code>public void onLoadFinished(final Loader<SearchResult> arg0, final SearchResult searchIn) { if (searchIn != null) { cacheList.clear(); final Set<Geocache> cachesFromSearchResult = searchIn.getCachesFromSearchResult(LoadFlags.LOAD_CACHE_OR_DB); cacheList.addAll(cachesFromSearchResult); search = searchIn; updateAdapter(); updateTitle(); showFooterMoreCaches(); } showProgress(false); hideLoading(); invalidateOptionsMenuCompatible(); <START> if( arg0 instanceof AbstractSearchLoader) { <END> AbstractSearchLoader abstractSearchLoader = (AbstractSearchLoader) arg0; switch (abstractSearchLoader.getAfterLoadAction()) { case CHECK_IF_EMPTY: checkIfEmptyAndRemoveAfterConfirm(); break; case NO_ACTION: default: } } }</code><technical_language>Space opening parenthesis, after</technical_language>

Target:
public void onLoadFinished(final Loader<SearchResult> arg0, final SearchResult searchIn) { if (searchIn != null) { cacheList.clear(); final Set<Geocache> cachesFromSearchResult = searchIn.getCachesFromSearchResult(LoadFlags.LOAD_CACHE_OR_DB); cacheList.addAll(cachesFromSearchResult); search = searchIn; updateAdapter(); updateTitle(); showFooterMoreCaches(); } showProgress(false); hideLoading(); invalidateOptionsMenuCompatible(); if (arg0 instanceof AbstractSearchLoader) { switch (((AbstractSearchLoader) arg0).getAfterLoadAction()) { case CHECK_IF_EMPTY: checkIfEmptyAndRemoveAfterConfirm(); break; case NO_ACTION: default: } } }
Source:
<code>protected Command doGetCommand(Request request, EditPart targetEditPart) { boolean canHandle = false; if (targetEditPart instanceof GraphicalEditPart) { dropTarget = (GraphicalEditPart) targetEditPart; if ((targetEditPart instanceof CompartmentEditPart)) { targetEditPart = targetEditPart.getParent(); <START> if (request instanceof DropObjectsRequest && !((DropObjectsRequest) request).getObjects().isEmpty()) { <END> Object droppedObject = ((DropObjectsRequest) request).getObjects().get(0); if (droppedObject instanceof Collaboration) { Collaboration collaboration = (Collaboration) droppedObject; if (!SystemElementsUtils.isBaseProtocol(collaboration)) { canHandle = true; } } } } } return canHandle ? super.doGetCommand(request, targetEditPart) : null; }</code><technical_language>Asma, do need this code edit policy change</technical_language>

Target:
protected Command doGetCommand(Request request, EditPart targetEditPart) { boolean canHandle = false; if (targetEditPart instanceof GraphicalEditPart) { dropTarget = (GraphicalEditPart) targetEditPart; if ((targetEditPart instanceof CompartmentEditPart)) { targetEditPart = targetEditPart.getParent(); if (request instanceof DropObjectsRequest && !getSourceEObjects(request).isEmpty()) { List<Collaboration> droppedProtocols = getSourceEObjects(request).stream().filter(Collaboration.class::isInstance) .map(Collaboration.class::cast) .collect(Collectors.toList()); if (droppedProtocols != null && !droppedProtocols.isEmpty()) { canHandle = canDrop(droppedProtocols); } } } } return canHandle ? super.doGetCommand(request, targetEditPart) : null; }
Source:
<code>public KafkaSourceEmbeddedKafka(Properties properties) { zookeeper = new KafkaSourceEmbeddedZookeeper(zkPort); dir = new File(System.getProperty("java.io.tmpdir"), "kafka_log-" + UUID.randomUUID()); try { FileUtils.deleteDirectory(dir); } catch (IOException e) { e.printStackTrace(); } Properties props = new Properties(); props.put("zookeeper.connect",zookeeper.getConnectString()); props.put("broker.id","1"); <START> props.put("offsets.topic.replication.factor", "1"); <END> props.put("host.name", "localhost"); props.put("port", String.valueOf(serverPort)); props.put("log.dir", dir.getAbsolutePath()); if (properties != null) { props.putAll(properties); } KafkaConfig config = new KafkaConfig(props); kafkaServer = new KafkaServerStartable(config); kafkaServer.startup(); initProducer(); }</code><technical_language>Please remove if req'd</technical_language>

Target:
public KafkaSourceEmbeddedKafka(Properties properties) { zookeeper = new KafkaSourceEmbeddedZookeeper(zkPort); dir = new File(System.getProperty("java.io.tmpdir"), "kafka_log-" + UUID.randomUUID()); try { FileUtils.deleteDirectory(dir); } catch (IOException e) { e.printStackTrace(); } Properties props = new Properties(); props.put("zookeeper.connect",zookeeper.getConnectString()); props.put("broker.id","-1"); props.put("offsets.topic.replication.factor", "1"); props.put("host.name", "localhost"); props.put("port", String.valueOf(serverPort)); props.put("log.dir", dir.getAbsolutePath()); if (properties != null) { props.putAll(properties); } KafkaConfig config = new KafkaConfig(props); kafkaServer = new KafkaServerStartable(config); kafkaServer.startup(); initProducer(); }
Source:
<code>public Map<String, String> getIdAttrsMap() { <START> return ImmutableMap.of("fileSystemPath", this.getFileSystemPath()); <END> }</code><technical_language>compute entity id source id? Also, please "fileSystemPath" a constant</technical_language>

Target:
public Map<String, String> getIdAttrsMap() { return ImmutableMap.of(FILE_SYSTEM_PATH, this.getFileSystemPath()); }
Source:
<code>public void channelRead0(ChannelHandlerContext ctx, Object msg) { if (msg instanceof FullHttpRequest) { handleHttpRequest(ctx, (FullHttpRequest) msg); } else if (msg instanceof WebSocketFrame) { handleWebSocketFrame(ctx, (WebSocketFrame) msg); } <START> globalStats.mark(Command.WEB_SOCKETS); <END> }</code><technical_language>I is move counter handleWebSocketFrame method for BinaryWebSocketFrame</technical_language>

Target:
public void channelRead0(ChannelHandlerContext ctx, Object msg) { if (msg instanceof FullHttpRequest) { handleHttpRequest(ctx, (FullHttpRequest) msg); } else if (msg instanceof WebSocketFrame) { handleWebSocketFrame(ctx, (WebSocketFrame) msg); } }