auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static <T extends Resource> Flux<IDocumentQueryExecutionComponent<T>> createAsync( Function<String, Flux<IDocumentQueryExecutionComponent<T>>> createSourceComponentFunction, DistinctQueryType distinctQueryType, String continuationToken) { if (distinctQueryType == DistinctQueryType.Ordered) { <START> CosmosClientException dce = new BadRequestException("Ordered distinct queries are not supported yet"); <END> return Flux.error(dce); } Utils.ValueHolder<DistinctContinuationToken> outDistinctcontinuationtoken = new Utils.ValueHolder<>(); DistinctContinuationToken distinctContinuationToken = new DistinctContinuationToken(null , null ); if (continuationToken != null) { if (!DistinctContinuationToken.tryParse(continuationToken, outDistinctcontinuationtoken)) { return Flux.error(new BadRequestException("Invalid DistinctContinuationToken" + continuationToken)); } else { distinctContinuationToken = outDistinctcontinuationtoken.v; if (distinctQueryType != DistinctQueryType.Ordered && distinctContinuationToken.getLastHash() != null) { CosmosClientException dce = new BadRequestException("DistinctContinuationToken is malformed." + " DistinctContinuationToken can not" + " have a 'lastHash', when the query" + " type is not ordered (ex SELECT " + "DISTINCT VALUE c.blah FROM c ORDER" + " BY c.blah)."); return Flux.error(dce); } } } final String continuationTokenLastHash = distinctContinuationToken.getLastHash(); return createSourceComponentFunction.apply(distinctContinuationToken.getSourceToken()).map(component -> { return new DistinctDocumentQueryExecutionContext<T>(component, distinctQueryType, continuationTokenLastHash); }); }</code><technical_language>blocked</technical_language>

Target:
public static <T extends Resource> Flux<IDocumentQueryExecutionComponent<T>> createAsync( Function<String, Flux<IDocumentQueryExecutionComponent<T>>> createSourceComponentFunction, DistinctQueryType distinctQueryType, String continuationToken) { Utils.ValueHolder<DistinctContinuationToken> outDistinctcontinuationtoken = new Utils.ValueHolder<>(); DistinctContinuationToken distinctContinuationToken = new DistinctContinuationToken(null , null ); if (continuationToken != null) { if (!DistinctContinuationToken.tryParse(continuationToken, outDistinctcontinuationtoken)) { return Flux.error(new BadRequestException("Invalid DistinctContinuationToken" + continuationToken)); } else { distinctContinuationToken = outDistinctcontinuationtoken.v; if (distinctQueryType != DistinctQueryType.ORDERED && distinctContinuationToken.getLastHash() != null) { CosmosClientException dce = new BadRequestException("DistinctContinuationToken is malformed." + " DistinctContinuationToken can not" + " have a 'lastHash', when the query" + " type is not ordered (ex SELECT " + "DISTINCT VALUE c.blah FROM c ORDER" + " BY c.blah)."); return Flux.error(dce); } } } final String continuationTokenLastHash = distinctContinuationToken.getLastHash(); return createSourceComponentFunction.apply(distinctContinuationToken.getSourceToken()).map(component -> { return new DistinctDocumentQueryExecutionContext<T>(component, distinctQueryType, continuationTokenLastHash); }); }
Source:
<code>public static Integer getSleepScoreDurationV4(final long accountId, final float sleepDurationScoreV3, final MotionFrequency motionFrequency, final Integer timesAwake, final int agitatedSleepDuration) { final float maxMotionFreq = 0.25f; final int maxTimesAwake = 6; final int maxAgitatedSleep = 45; final float rawScore = DURATION_WEIGHTS_V4[0] + DURATION_WEIGHTS_V4[1] * sleepDurationScoreV3 + DURATION_WEIGHTS_V4[2] * Math.min(agitatedSleepDuration, maxAgitatedSleep) + DURATION_WEIGHTS_V4[3] * Math.min(motionFrequency.motionFrequencyFirstPeriod, maxMotionFreq) + DURATION_WEIGHTS_V4[4] * Math.min( motionFrequency.motionFrequencyMiddlePeriod, maxMotionFreq) + DURATION_WEIGHTS_V4[5] * Math.min(motionFrequency.motionFrequencyLastPeriod, maxMotionFreq) + DURATION_WEIGHTS_V4[6] * Math.min(timesAwake, maxTimesAwake); final int durationScorev4 = (int) Math.max(Math.min(rawScore * .95 + 21, 90), 50); <START> LOGGER.info("action=calculated-durationscore-v4 account_id={} sleep_duration_score_v3={} motion_frequency={} awake_times={} agitated_sleep_duration={} durationscore_v4={}", accountId, sleepDurationScoreV3, motionFrequency, timesAwake, agitatedSleepDuration, durationScorev4); <END> return durationScorev4; }</code><technical_language>is this spammy? If so, reduce debug trace</technical_language>

Target:
public static Integer getSleepScoreDurationV4(final long accountId, final float sleepDurationScoreV3, final MotionFrequency motionFrequency, final Integer timesAwake, final int agitatedSleepDuration) { final float maxMotionFreq = 0.25f; final int maxTimesAwake = 6; final int maxAgitatedSleep = 45; final float rawScore = DURATION_WEIGHTS_V4[0] + DURATION_WEIGHTS_V4[1] * sleepDurationScoreV3 + DURATION_WEIGHTS_V4[2] * Math.min(agitatedSleepDuration, maxAgitatedSleep) + DURATION_WEIGHTS_V4[3] * Math.min(motionFrequency.motionFrequencyFirstPeriod, maxMotionFreq) + DURATION_WEIGHTS_V4[4] * Math.min( motionFrequency.motionFrequencyMiddlePeriod, maxMotionFreq) + DURATION_WEIGHTS_V4[5] * Math.min(motionFrequency.motionFrequencyLastPeriod, maxMotionFreq) + DURATION_WEIGHTS_V4[6] * Math.min(timesAwake, maxTimesAwake); final int durationScorev4 = (int) Math.max(Math.min(rawScore * .95 + 21, 90), 50); LOGGER.trace("action=calculated-durationscore-v4 account_id={} sleep_duration_score_v3={} motion_frequency={} awake_times={} agitated_sleep_duration={} durationscore_v4={}", accountId, sleepDurationScoreV3, motionFrequency.motionFrequency, timesAwake, agitatedSleepDuration, durationScorev4); return durationScorev4; }
Source:
<code>Statistic buildAndRegister() throws IllegalStateException; <START> interface Simple extends StatisticBuilder { <END> @Override Simple translation(Translation translation); @Override Simple id(String id); Simple unit(StatisticUnit unit); Simple type(StatisticType type); }</code><technical_language>removing GroupedStatistics this subinterface is obsolete now</technical_language>

Target:
Statistic buildAndRegister() throws IllegalStateException; interface EntityStatisticBuilder extends StatisticBuilder { EntityStatisticBuilder entity(EntityType entity); @Override EntityStatisticBuilder name(String name); @Override EntityStatisticBuilder translation(Translation translation); @Override EntityStatisticBuilder format(@Nullable StatisticFormat format); @Override EntityStatisticBuilder group(StatisticGroup group); @Override EntityStatistic buildAndRegister() throws IllegalStateException; }
Source:
<code>public CommentSecurityException() { <START> super(); <END> this.statusCode = SC_FORBIDDEN; }</code><technical_language>super(SC_FORBIDDEN) similarly for other constructors</technical_language>

Target:
public CommentSecurityException() { super(SC_FORBIDDEN); }
Source:
<code>private static boolean from(final String strval) throws PSQLException { final String val = strval.trim(); if ("1".equals(val) || "true".equalsIgnoreCase(val) || "t".equalsIgnoreCase(val) || "yes".equalsIgnoreCase(val) || "y".equalsIgnoreCase(val) || "on".equalsIgnoreCase(val)) { return true; } if ("0".equals(val) || "false".equalsIgnoreCase(val) || "f".equalsIgnoreCase(val) || "no".equalsIgnoreCase(val) || "n".equalsIgnoreCase(val) || "off".equalsIgnoreCase(val)) { return false; } <START> throw cannotCastException("String"); <END> }</code><technical_language>I if adding actual "bad" error message count a security violation. I adding explicitly simplify debugging. thoughts</technical_language>

Target:
private static boolean from(final String strval) throws PSQLException { final String val = strval.trim(); if ("1".equals(val) || "true".equalsIgnoreCase(val) || "t".equalsIgnoreCase(val) || "yes".equalsIgnoreCase(val) || "y".equalsIgnoreCase(val) || "on".equalsIgnoreCase(val)) { return true; } if ("0".equals(val) || "false".equalsIgnoreCase(val) || "f".equalsIgnoreCase(val) || "no".equalsIgnoreCase(val) || "n".equalsIgnoreCase(val) || "off".equalsIgnoreCase(val)) { return false; } throw cannotCoerceException("String", val); }
Source:
<code>public void warmup() throws InterruptedException { <START> for (int k = 0; k < keyCount; k++) { <END> int id = random.nextInt(); String key = StringUtils.generateString(keyLength); String name = names[random.nextInt(names.length)]; Employee value = createEmployee(id,name); map.put(key, value); } log.info("Map size is:" + map.size()); }</code><technical_language>If need a random, create in this method. (at beginning.. loop)</technical_language>

Target:
public void warmup() throws InterruptedException { Random random = new Random(); for (int k = 0; k < keyCount; k++) { int id = random.nextInt(); String key = StringUtils.generateString(keyLength); String name = names[random.nextInt(names.length)]; Employee value = createEmployee(id,name); map.put(key, value); } log.info("Map size is:" + map.size()); }
Source:
<code>public int doWork() { if (OUTPUT.endsWith(".")) { OUTPUT = OUTPUT.substring(0, OUTPUT.length() - 1); } final List<SinglePassSamProgram> programs = new ArrayList<SinglePassSamProgram>(); for (final ProgramInterface program : new HashSet<ProgramInterface>(programsToRun)) { if (program.needsReferenceSequence() && REFERENCE_SEQUENCE==null) { <START> throw new PicardException("A program you are trying to run needs a Reference Sequence, please set REFERENCE_SEQUENCE in the command line"); <END> } final SinglePassSamProgram instance = program.makeInstance(OUTPUT, INPUT, REFERENCE_SEQUENCE); instance.INPUT = INPUT; instance.REFERENCE_SEQUENCE = REFERENCE_SEQUENCE; instance.setDefaultHeaders(getDefaultHeaders()); programs.add(instance); } SinglePassSamProgram.makeItSo(INPUT, REFERENCE_SEQUENCE, ASSUME_SORTED, STOP_AFTER, programs); return 0; }</code><technical_language>Instead of a program print program's name</technical_language>

Target:
public int doWork() { if (OUTPUT.endsWith(".")) { OUTPUT = OUTPUT.substring(0, OUTPUT.length() - 1); } final List<SinglePassSamProgram> programs = new ArrayList<SinglePassSamProgram>(); for (final ProgramInterface program : new HashSet<ProgramInterface>(programsToRun)) { if (program.needsReferenceSequence() && REFERENCE_SEQUENCE==null) { throw new PicardException("The " + program.toString() + " program needs a Reference Sequence, please set REFERENCE_SEQUENCE in the command line"); } final SinglePassSamProgram instance = program.makeInstance(OUTPUT, INPUT, REFERENCE_SEQUENCE); instance.INPUT = INPUT; instance.REFERENCE_SEQUENCE = REFERENCE_SEQUENCE; instance.setDefaultHeaders(getDefaultHeaders()); programs.add(instance); } SinglePassSamProgram.makeItSo(INPUT, REFERENCE_SEQUENCE, ASSUME_SORTED, STOP_AFTER, programs); return 0; }
Source:
<code>protected void addProcessIdentityProcessListener(final KModuleDeploymentUnit unit, final InternalKieContainer kieContainer) { final DeploymentDescriptor descriptor = getDeploymentDescriptor(unit, kieContainer); descriptor.getBuilder().addEventListener( <START> new NamedObjectModel( <END> "mvel", "processIdentity", "new org.jbpm.kie.services.impl.IdentityProviderAwareProcessListener(ksession)" ) ); unit.setDeploymentDescriptor(descriptor); }</code><technical_language>here, ObjectModel instead NamedObjectModel</technical_language>

Target:
protected void addProcessIdentityProcessListener(final KModuleDeploymentUnit unit, final InternalKieContainer kieContainer) { final DeploymentDescriptor descriptor = getDeploymentDescriptor(unit, kieContainer); descriptor.getBuilder().addEventListener( new ObjectModel( "mvel", "new org.jbpm.kie.services.impl.IdentityProviderAwareProcessListener(ksession)" ) ); unit.setDeploymentDescriptor(descriptor); }
Source:
<code>public void jsr107WriterGetsRegistered() { MutableConfiguration<Object, Object> configuration = new MutableConfiguration<Object, Object>(); CacheWriter<Object, Object> mock = mock(CacheWriter.class); RecordingFactory<CacheWriter<Object, Object>> factory = factoryOf(mock); configuration.setWriteThrough(true).setCacheWriterFactory(factory); merger.mergeConfigurations("cache", configuration); assertThat(factory.called, is(true)); <START> verify(cacheLoaderWriterFactory).registerJsr107Loader(eq("cache"), ArgumentMatchers.<CacheLoaderWriter<Object, Object>>any()); <END> }</code><technical_language>this is a verification any(CacheLoaderWriter.class) ensure loader writer is null</technical_language>

Target:
public void jsr107WriterGetsRegistered() { MutableConfiguration<Object, Object> configuration = new MutableConfiguration<Object, Object>(); CacheWriter<Object, Object> mock = mock(CacheWriter.class); RecordingFactory<CacheWriter<Object, Object>> factory = factoryOf(mock); configuration.setWriteThrough(true).setCacheWriterFactory(factory); merger.mergeConfigurations("cache", configuration); assertThat(factory.called, is(true)); verify(cacheLoaderWriterFactory).registerJsr107Loader(eq("cache"), ArgumentMatchers.<CacheLoaderWriter<Object, Object>>isNotNull()); }
Source:
<code>public void flush() throws IOException { buffer.flip(); <START> ByteBuffer byteBuffer = java.nio.charset.StandardCharsets.UTF_8.encode( buffer ); <END> out.write( byteBuffer ); buffer.clear(); }</code><technical_language>reason FQCN here</technical_language>

Target:
public void flush() throws IOException { buffer.flip(); ByteBuffer byteBuffer = StandardCharsets.UTF_8.encode( buffer ); out.consume( byteBuffer ); buffer.clear(); }
Source:
<code>public Job loadInitalJobContent(final JobId jobId) { return executeReadOnlyTransaction(session -> { long id = jobId(jobId); Query query = session.getNamedQuery("loadJobContent").setLong("id", id); if (query.uniqueResult() == null) { throw new DatabaseManagerException("Invalid job id: " + jobId); } <START> <END> JobContent jobContent = (JobContent) query.uniqueResult(); return jobContent.getInitJobContent(); }); }</code><technical_language>catch exceptions in call robust deserialization errors (upgrade of proactive scheduler)</technical_language>

Target:
public Job loadInitalJobContent(final JobId jobId) { return executeReadOnlyTransaction(session -> { long id = jobId(jobId); Query query = session.getNamedQuery("loadJobContent").setLong("id", id); if (query.uniqueResult() == null) { throw new DatabaseManagerException("Invalid job id: " + jobId.value()); } JobContent jobContent = (JobContent) query.uniqueResult(); final TaskFlowJob initJobContent = jobContent.getInitJobContent(); if (initJobContent == null) { throw new DatabaseManagerException("Job content should not be null for job id: " + jobId.value()); } return initJobContent; }); }
Source:
<code>public static Builder builder(URL endpoint) { <START> return new Builder(endpoint, AuthSchemes.BASIC); <END> }</code><technical_language>BASIC scheme is virtually non-existent in wild, NTLM default, wdyt</technical_language>

Target:
public static Builder builder(URL endpoint) { return new Builder(endpoint, AuthSchemes.NTLM); }
Source:
<code>public void invite(final String friend) throws IOException { try { new JdbcSession(this.sql.source()) .sql("INSERT INTO friend (bout, alias, subscription) VALUES (?, ?, ?)") .set(this.bout) .set(friend) <START> .set(1) <END> .insert(Outcome.VOID); } catch (final SQLException ex) { throw new IOException(ex); } }</code><technical_language>@ekondrashev 1 means here</technical_language>

Target:
public void invite(final String friend) throws IOException { try { new JdbcSession(this.sql.source()) .sql("INSERT INTO friend (bout, alias, subscription) VALUES (?, ?, ?)") .set(this.bout) .set(friend) .set(true) .insert(Outcome.VOID); } catch (final SQLException ex) { throw new IOException(ex); } }
Source:
<code>public RecordWriter getRecordWriter(final HdfsSinkConnectorConfig conf, final String filename) { try { return new RecordWriter() { final Path path = new Path(filename); final OutputStream out = FileSystem.newInstance(path.toUri(), <START> conf.getHadoopConfiguration()).create(path); <END> final JsonGenerator writer = mapper.getFactory() .createGenerator(out) .setRootValueSeparator(null); @Override public void write(SinkRecord record) { log.trace("Sink record: {}", record.toString()); try { Object value = record.value(); if (value instanceof Struct) { byte[] rawJson = converter.fromConnectData( record.topic(), record.valueSchema(), value ); out.write(rawJson); out.write(LINE_SEPARATOR_BYTES); } else { writer.writeObject(value); writer.writeRaw(LINE_SEPARATOR); } } catch (IOException e) { throw new ConnectException(e); } } @Override public void commit() @Override public void close() { try { writer.close(); out.close(); } catch (IOException e) { throw new ConnectException(e); } } }; } catch (IOException e) { throw new ConnectException(e); } }</code><technical_language>need hold result of FileSystem.newInstance(path.toUri(), conf.getHadoopConfiguration()), is a closeable FileSystem object, close in close()? need hold close FSDataOutputStream instance, if is closed in returned JsonGenerator instance. hurt, if sure, that</technical_language>

Target:
public RecordWriter getRecordWriter(final HdfsSinkConnectorConfig conf, final String filename) { try { return new RecordWriter() { final Path path = new Path(filename); final FileSystem fs = FileSystem.newInstance(path.toUri(), conf.getHadoopConfiguration()); final OutputStream out = fs.create(path); final JsonGenerator writer = mapper.getFactory() .createGenerator(out) .setRootValueSeparator(null); @Override public void write(SinkRecord record) { log.trace("Sink record: {}", record.toString()); try { Object value = record.value(); if (value instanceof Struct) { byte[] rawJson = converter.fromConnectData( record.topic(), record.valueSchema(), value ); out.write(rawJson); out.write(LINE_SEPARATOR_BYTES); } else { writer.writeObject(value); writer.writeRaw(LINE_SEPARATOR); } } catch (IOException e) { throw new ConnectException(e); } } @Override public void commit() @Override public void close() { IOException error = null; try { writer.close(); } catch (IOException e) { error = e; throw new ConnectException(e); } finally { try { fs.close(); } catch (IOException e) { if (error == null) { throw new ConnectException(e); } } } } }; } catch (IOException e) { throw new ConnectException(e); } }
Source:
<code>public void shouldReenrollSubject() throws IOException { try { fakeNow(newDateTime(2015, 8, 1, 0, 0, 0)); InputStream inputStream = getClass().getResourceAsStream("/enroll1.csv"); raveImportService.importCsv(new InputStreamReader(inputStream), "/enroll1.csv"); inputStream.close(); Subject subject = createSubjectWithRequireData("1"); subjectService.createOrUpdateForZetes(subject); SubjectEnrollments subjectEnrollments = subjectEnrollmentsDataService.findEnrollmentBySubjectId(subject.getSubjectId()); assertEquals(9, subjectEnrollments.getEnrollments().size()); checkEnrollmentServiceContent(subject); for(Visit visit : subjectEnrollments.getSubject().getVisits()) { <START> ebodacEnrollmentService.reenrollSubject(visit); <END> } subjectEnrollments = subjectEnrollmentsDataService.findEnrollmentBySubjectId(subject.getSubjectId()); checkEnrollmentsStatus(EnrollmentStatus.ENROLLED, EnrollmentStatus.ENROLLED, subjectEnrollments.getSubject()); } finally { stopFakingTime(); } }</code><technical_language>update motech projected date for visit reenroll</technical_language>

Target:
public void shouldReenrollSubject() throws IOException { try { fakeNow(newDateTime(2015, 8, 1, 0, 0, 0)); Subject subject = createSubjectWithRequireData("1"); InputStream inputStream = getClass().getResourceAsStream("/enrollSimple.csv"); raveImportService.importCsv(new InputStreamReader(inputStream), "/enrollSimple.csv"); inputStream.close(); List<Enrollment> enrollmentList = enrollmentDataService.findEnrollmentsBySubjectId("1"); for(Enrollment enrollment : enrollmentList) { assertEquals(new LocalDate(2015, 10, 10), enrollment.getReferenceDate()); } subject = subjectService.findSubjectBySubjectId("1"); for(Visit visit : subject.getVisits()) { visit.setMotechProjectedDate(new LocalDate(2015, 10, 11)); ebodacEnrollmentService.reenrollSubject(visit); } SubjectEnrollments subjectEnrollments = subjectEnrollmentsDataService.findEnrollmentBySubjectId("1"); for( Enrollment enrollment : subjectEnrollments.getEnrollments()) { assertEquals(new LocalDate(2015, 10, 11), enrollment.getReferenceDate()); } } finally { stopFakingTime(); } }
Source:
<code>private void checkIndex(int index) { <START> if ((index - offset) < 0 || (index - offset) >= array.length) { <END> throw new ArrayIndexOutOfBoundsException("The requested index is out of counter bounds."); } }</code><technical_language>I array access perform this check for throw identical exception...so of purpose of performing this test here. unless, is show more information in exception method. (I'm happy way)</technical_language>

Target:
private void checkIndex(int index) { if ((index - offset) < 0 || (index - offset) >= array.length) { throw new ArrayIndexOutOfBoundsException("The requested index " + index + " is out of counter bounds. " + "Possible cause of exception can be wrong READ_LENGTH parameter (much smaller than actual read length)"); } }
Source:
<code>private void fillValues(final Repository repository) throws IOException { gitDir.setText(repository.getDirectory().getAbsolutePath()); branch.setText(repository.getBranch()); workDir.setText(repository.getWorkTree().getAbsolutePath()); state.setText(repository.getRepositoryState().getDescription()); final ObjectId objectId = repository .resolve(repository.getFullBranch()); if (objectId == null) { if (repository.getAllRefs().size() == 0) <START> headLink.setText(UIText.GitProjectPropertyPage_ValueEmptyRepository); <END> else headLink.setText(UIText.GitProjectPropertyPage_ValueUnbornBranch); } else { headLink.setText(objectId.name()); headLink.setUnderlined(true); headLink.setFont(JFaceResources.getDialogFont()); headLink.setForeground(JFaceColors.getHyperlinkText(headLink .getDisplay())); headLink.addHyperlinkListener(new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent e) { RepositoryCommit commit = getCommit(repository, objectId); if(commit != null) { CommitEditor.openQuiet(commit); } } }); } }</code><technical_language>link is selectable cases occur</technical_language>

Target:
private void fillValues(final Repository repository) throws IOException { gitDir.setText(repository.getDirectory().getAbsolutePath()); branch.setText(repository.getBranch()); workDir.setText(repository.getWorkTree().getAbsolutePath()); state.setText(repository.getRepositoryState().getDescription()); }
Source:
<code>public void formFinishedLoading() { <START> if (currentState == BackgroundLocationState.NOT_APPLICABLE) { <END> if (helper.currentFormCollectsBackgroundLocation()) { currentState = BackgroundLocationState.APPLICABLE; } } }</code><technical_language>diving deep state machine pattern feel more consistent methods a switch. In head easy skim states method cares in default case</technical_language>

Target:
public void formFinishedLoading() { switch (currentState) { case NO_BACKGROUND_LOCATION_NEEDED: if (helper.currentFormCollectsBackgroundLocation()) { currentState = BackgroundLocationState.PENDING_PRECONDITION_CHECKS; } } }
Source:
<code>public void getAllChannelsShouldReturnEmptyListWhenThereAreNoChannels() { given(channelRepository.findAll()).willReturn(EMPTY_CHANNEL_ENTITY_LIST); given(modelMapper.map(EMPTY_CHANNEL_ENTITY_LIST, CHANNEL_DTO_LIST_TYPE)) .willReturn(EMPTY_CHANNEL_DTO_LIST); Collection<ChannelDTO> channels = channelService.getAllChannels(); assertThat(channels, notNullValue()); assertTrue(channels.isEmpty()); <START> then(channelRepository).should(times(1)).findAll(); <END> }</code><technical_language>modelMapper invocation is verified</technical_language>

Target:
public void getAllChannelsShouldReturnEmptyListWhenThereAreNoChannels() { given(channelRepository.findAll()).willReturn(EMPTY_CHANNEL_ENTITY_LIST); given(modelMapper.map(EMPTY_CHANNEL_ENTITY_LIST, CHANNEL_DTO_LIST_TYPE)) .willReturn(EMPTY_CHANNEL_DTO_LIST); Collection<ChannelDTO> channels = channelService.getAllChannels(); assertThat(channels, notNullValue()); assertTrue(channels.isEmpty()); then(channelRepository).should().findAll(); then(modelMapper).should().map(EMPTY_CHANNEL_ENTITY_LIST, CHANNEL_DTO_LIST_TYPE); }
Source:
<code>public abstract Item doCreateItem( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException; <START> public Categories doCategories(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { <END> return ItemGroupMixIn.getCategories(Jenkins.getAuthentication(), Jenkins.getInstance()); }</code><technical_language>Good candidate for @Restricted(DoNotUse.class)</technical_language>

Target:
public abstract Item doCreateItem( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException; @Restricted(DoNotUse.class) public Categories doCategories(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { Categories categories = new Categories(); int order = 0; for (TopLevelItemDescriptor descriptor : DescriptorVisibilityFilter.apply(getOwnerItemGroup(), Items.all(Jenkins.getAuthentication(), getOwnerItemGroup()))) { ItemCategory ic = ItemCategory.getCategory(descriptor); Map<String, Serializable> metadata = new HashMap<String, Serializable>(); metadata.put("class", descriptor.getId()); metadata.put("order", ++order); metadata.put("displayName", descriptor.getDisplayName()); metadata.put("description", descriptor.getDescription()); metadata.put("iconFilePathPattern", descriptor.getIconFilePathPattern()); Category category = categories.getItem(ic.getId()); if (category != null) { category.getItems().add(metadata); } else { List<Map<String, Serializable>> temp = new ArrayList<Map<String, Serializable>>(); temp.add(metadata); category = new Category(ic.getId(), ic.getDisplayName(), ic.getDescription(), ic.getOrder(), ic.getMinToShow(), temp); categories.getItems().add(category); } } return categories; }
Source:
<code>@Test public void showRedaction() throws Exception { ScopedSpan span = tracing.tracer().startScopedSpan("auditor"); try { span.tag("a", "1"); span.tag("b", "912-23-1433"); span.annotate("SSN=912-23-1433"); span.tag("c", "3"); } finally { span.finish(); } Span finished = spans.take(); assertThat(finished.tags()).containsExactly( entry("a", "1"), entry("c", "3") ); assertThat(finished.annotations()).flatExtracting(Annotation::value).containsExactly( "SSN=xxx-xx-xxxx" ); tracing.tracer().toSpan(span.context()).tag("d", "SSN=912-23-1433"); span = null; blockOnGC(); tracing.tracer().nextSpan().start().finish(); Span leaked = spans.take(); assertThat(leaked.tags()).containsExactly( entry("d", "SSN=xxx-xx-xxxx") ); <START> assertThat(leaked.annotations()).flatExtracting(Annotation::value).containsExactly( <END> "brave.flush" ); }</code><technical_language>new method</technical_language>

Target:
@Test public void showRedaction() throws Exception { ScopedSpan span = tracing.tracer().startScopedSpan("auditor"); try { span.tag("a", "1"); span.tag("b", "4121-2319-1483-3421"); span.annotate("cc=4121-2319-1483-3421"); span.tag("c", "3"); } finally { span.finish(); } Span finished = spans.take(); assertThat(finished.tags()).containsExactly( entry("a", "1"), entry("c", "3") ); assertThat(finished.annotations()).flatExtracting(Annotation::value).containsExactly( "cc=xxxx-xxxx-xxxx-xxxx" ); tracing.tracer().toSpan(span.context()).tag("d", "cc=4121-2319-1483-3421"); span = null; blockOnGC(); tracing.tracer().nextSpan().abandon(); Span leaked = spans.take(); assertThat(leaked.tags()).containsExactly( entry("d", "cc=xxxx-xxxx-xxxx-xxxx") ); assertThat(leaked.annotations()).flatExtracting(Annotation::value).containsExactly( "brave.flush" ); }
Source:
<code>public void writePacket(byte[] buf, int pos, int len) throws IOException { formatLength(len + 4); out.write(lenbuffer, 0, 4); out.write(buf, pos, len); <START> log.debug("git> " + <END> RawParseUtils.decode(Constants.CHARSET, buf, pos, len)); }</code><technical_language>Jonathan noted in side: > skip this step debug logging is disabled: if (log.isDebugEnabled()) { ... I is relevant constructing string passing logger. input side constructed / called decode anyway, do for purpose of logging. check if logging is on</technical_language>

Target:
public void writePacket(byte[] buf, int pos, int len) throws IOException { formatLength(len + 4); out.write(lenbuffer, 0, 4); out.write(buf, pos, len); if (log.isDebugEnabled()) { String s = RawParseUtils.decode(Constants.CHARSET, buf, pos, len); log.debug("git> " + s); } }
Source:
<code>public void forward() { <START> content.setConstraintX(SizeValue.px(content.getConstraintX().getValueAsInt(1.f) + 64)); <END> }</code><technical_language>If work, need call layoutElements(), "content"'s parent</technical_language>

Target:
public void forward() { int cX = content.getConstraintX().getValueAsInt(1.f); if (cX < 0) { content.setConstraintX(SizeValue.px(cX + stepSize)); content.getParent().layoutElements(); } }
Source:
<code>private void replicateDiskFinish(Guid srcDomain, Guid dstDomain) { <START> DiskImage diskImage = diskImageDao.get(getParameters().getDestinationImageId()); StorageType storageType = diskImage.getStorageTypes().get(0); String diskType = null; if (storageType == StorageType.GLUSTERFS && FeatureSupported.libgfApiSupported(getVm().getCompatibilityVersion())) { diskType = VdsProperties.NETWORK; } <END> VmReplicateDiskParameters migrationStartParams = new VmReplicateDiskParameters(getParameters().getVdsId(), getParameters().getVmId(), getParameters().getStoragePoolId(), srcDomain, dstDomain, getParameters().getImageGroupID(), getParameters().getDestinationImageId(), diskType); VDSReturnValue ret = resourceManager.runVdsCommand( VDSCommandType.VmReplicateDiskFinish, migrationStartParams); if (!ret.getSucceeded()) { throw new EngineException(ret.getVdsError().getCode(), ret.getVdsError().getMessage()); } }</code><technical_language>This block is replicated in replicateDiskStart below. extract a method</technical_language>

Target:
private void replicateDiskFinish(Guid srcDomain, Guid dstDomain) { VmReplicateDiskParameters migrationStartParams = new VmReplicateDiskParameters(getParameters().getVdsId(), getParameters().getVmId(), getParameters().getStoragePoolId(), srcDomain, dstDomain, getParameters().getImageGroupID(), getParameters().getDestinationImageId(), null); VDSReturnValue ret = resourceManager.runVdsCommand( VDSCommandType.VmReplicateDiskFinish, migrationStartParams); if (!ret.getSucceeded()) { throw new EngineException(ret.getVdsError().getCode(), ret.getVdsError().getMessage()); } }
Source:
<code>public String getOSRecommendedFolder() { try { return _get_os_recommended_folder(); } catch (UnsatisfiedLinkError e) { if (!libraryLoaded) { loadLibrary(); <START> return _get_os_recommended_folder(); <END> } return null; } }</code><technical_language>I effect is consistent rest of code in this class, this statement changed 'return getOSRecommendedFolder()' - wdyt? fine if want change decided ask anyway..</technical_language>

Target:
public String getOSRecommendedFolder() { try { return _get_os_recommended_folder(); } catch (UnsatisfiedLinkError e) { if (!libraryLoaded) { loadLibrary(); return getOSRecommendedFolder(); } return null; } }
Source:
<code>public void refreshConditionsWidget(final List<CompositeColumn<? extends BaseColumn>> conditionColumns) { getConditionsConfigWidget().clear(); if (conditionColumns == null || conditionColumns.isEmpty()) { getAccordion().getItem(GuidedDecisionTableAccordionItem.Type.CONDITION).setOpen(false); getConditionsConfigWidget().add(blankSlate()); return; } getConditionsConfigWidget().add(getConditionsPanel()); final Map<String, List<BaseColumn>> columnGroups = conditionColumns.stream().collect( Collectors.groupingBy( <START> column -> DecisionTableColumnViewUtils.getColumnManagementGroupTitle(column), <END> Collectors.toList() ) ); getConditionsPanel().renderColumns(columnGroups); }</code><technical_language>Personally, I replaced a method reference: java Collectors.groupingBy( DecisionTableColumnViewUtils::getColumnManagementGroupTitle, Collectors.toList() )</technical_language>

Target:
public void refreshConditionsWidget(final List<CompositeColumn<? extends BaseColumn>> conditionColumns) { getConditionsConfigWidget().clear(); if (conditionColumns == null || conditionColumns.isEmpty()) { getAccordion().getItem(GuidedDecisionTableAccordionItem.Type.CONDITION).setOpen(false); getConditionsConfigWidget().add(blankSlate()); return; } getConditionsConfigWidget().add(getConditionsPanel()); final Map<String, List<BaseColumn>> columnGroups = conditionColumns.stream().collect( Collectors.groupingBy( DecisionTableColumnViewUtils::getColumnManagementGroupTitle, Collectors.toList() ) ); getConditionsPanel().renderColumns(columnGroups); }
Source:
<code>private void fullTest(int size, int[] fuzz, String distributionName) { PerformanceMeter pMinsertion = perf.createPerformanceMeter(distributionName + " Insertion: " + fName); PerformanceMeter pMiterate = perf.createPerformanceMeter(distributionName + " Iterate: " + fName); <START> PerformanceMeter pMiterateStart = perf.createPerformanceMeter(distributionName + " Iterate Start: " + fName); <END> PerformanceMeter pMiterateEnd = perf.createPerformanceMeter(distributionName + " Iterate End: " + fName); PerformanceMeter pMiterateDuration = perf.createPerformanceMeter(distributionName + " Iterate Length: " + fName); for (int i = 0; i < DEFAULT_LOOP_COUNT; i++) { fSegStore.clear(); pMinsertion.start(); populate(size, fuzz, fSegStore, getSegmentStoreSize()); pMinsertion.stop(); pMiterate.start(); iterate(fSegStore); pMiterate.stop(); pMiterateStart.start(); iterate(fSegStore.iterator(SegmentComparators.INTERVAL_START_COMPARATOR)); pMiterateStart.stop(); pMiterateEnd.start(); iterate(fSegStore.iterator(SegmentComparators.INTERVAL_END_COMPARATOR)); pMiterateEnd.stop(); pMiterateDuration.start(); iterate(fSegStore.iterator(SegmentComparators.INTERVAL_LENGTH_COMPARATOR)); pMiterateDuration.stop(); } pMinsertion.commit(); pMiterate.commit(); pMiterateStart.commit(); pMiterateEnd.commit(); pMiterateDuration.commit(); }</code><technical_language>Call "Iterate sorted start",</technical_language>

Target:
private void fullTest(int size, int[] fuzz, String distributionName) { PerformanceMeter pMinsertion = perf.createPerformanceMeter(distributionName + " Insertion: " + fName); PerformanceMeter pMiterateStart = perf.createPerformanceMeter(distributionName + " Iterate sorted by start: " + fName); PerformanceMeter pMiterateEnd = perf.createPerformanceMeter(distributionName + " Iterate sorted by end: " + fName); PerformanceMeter pMiterateDuration = perf.createPerformanceMeter(distributionName + " Iterate sorted by length: " + fName); for (int i = 0; i < DEFAULT_LOOP_COUNT; i++) { fSegStore.clear(); pMinsertion.start(); populate(size, fuzz, fSegStore, getSegmentStoreSize()); pMiterateStart.start(); sortedIterate(fSegStore, SegmentComparators.INTERVAL_START_COMPARATOR); pMiterateStart.stop(); pMiterateEnd.start(); sortedIterate(fSegStore, SegmentComparators.INTERVAL_END_COMPARATOR); pMiterateEnd.stop(); pMiterateDuration.start(); sortedIterate(fSegStore, SegmentComparators.INTERVAL_LENGTH_COMPARATOR); pMiterateDuration.stop(); } pMinsertion.commit(); pMiterateStart.commit(); pMiterateEnd.commit(); pMiterateDuration.commit(); }
Source:
<code>public void name_requires_either_component_or_defaults() throws Exception { <START> thrown.expect(BadRequestException.class); <END> thrown.expectMessage("The name parameter requires either projectKey or defaults to be set."); SearchWsRequest request = new SearchWsRequest() .setProfileName("bla"); SearchDataLoader.validateRequest(request); }</code><technical_language>if exception is thrown validateRequest, thrown configuration done right validateRequest is called</technical_language>

Target:
public void name_requires_either_component_or_defaults() throws Exception { SearchWsRequest request = new SearchWsRequest() .setProfileName("bla"); thrown.expect(BadRequestException.class); thrown.expectMessage("The name parameter requires either projectKey or defaults to be set."); SearchDataLoader.validateRequest(request); }
Source:
<code>protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) { EObject objectToControl = getRequest().getTargetObject(); <START> EMFHelper.getUsages(objectToControl); <END> Resource newNotationResource = getRequest().getTargetResource(NotationModel.NOTATION_FILE_EXTENSION); if (newNotationResource == null) { return CommandResult.newErrorCommandResult(CREATION_RESOURCE_ERROR); } List<Diagram> diagrams = getDiagrams(); if (!diagrams.isEmpty()) { newNotationResource.getContents().addAll(diagrams); addMovedDiagramToRequest(diagrams); } Collection<Setting> crossReferences = EMFHelper.getUsages(objectToControl); if (!crossReferences.isEmpty()) { Resource oldNotationResource = getOldNotationResource(); if (oldNotationResource != null && !oldNotationResource.isModified()) { oldNotationResource.setModified(true); } if (!newNotationResource.isModified()) { newNotationResource.setModified(true); } } return CommandResult.newOKCommandResult(newNotationResource); }</code><technical_language>Suspicious call getUsages() is (And is recalculated instead)</technical_language>

Target:
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) { EObject objectToControl = getRequest().getTargetObject(); Resource newNotationResource = getRequest().getTargetResource(NotationModel.NOTATION_FILE_EXTENSION); if (newNotationResource == null) { return CommandResult.newErrorCommandResult(CREATION_RESOURCE_ERROR); } List<Diagram> diagrams = getDiagrams(); if (!diagrams.isEmpty()) { newNotationResource.getContents().addAll(diagrams); addMovedDiagramToRequest(diagrams); } Collection<Setting> crossReferences = EMFHelper.getUsages(objectToControl); if (!crossReferences.isEmpty()) { Resource oldNotationResource = getOldNotationResource(); if (oldNotationResource != null && !oldNotationResource.isModified()) { oldNotationResource.setModified(true); } if (!newNotationResource.isModified()) { newNotationResource.setModified(true); } } return CommandResult.newOKCommandResult(newNotationResource); }
Source:
<code><START> public PatternMatcher(TermContext context) { <END> this.termContext = context; multiSubstitutions = new ArrayList<java.util.Collection<Map<Variable, Term>>>(); }</code><technical_language>this done</technical_language>

Target:
private PatternMatcher(TermContext context) { this.termContext = context; multiSubstitutions = new ArrayList<Collection<Map<Variable, Term>>>(); }
Source:
<code>public void InteractiveMaps_032_PalantirSetAndRemovePlayerPosition() { InteractiveMapPageObject selectedMap = new InteractiveMapPageObject(driver); <START> selectedMap.openMap(wikiURL, 3); <END> selectedMap.verifyMapOpened(); PalantirComponentObject poi = new PalantirComponentObject(driver); PalantirContent handle = new PalantirContent(); handle = poi.setAndVerifyPlayerPosition(-40, -10, 3, true); poi.verifyCorrectPlayerPos(handle.success, handle.responseCode, handle.message); poi.verifyPoiAppearOnMap(); handle = poi.deletePlayerPosition(); poi.verifyPlayerPosDeleted(handle.success, handle.responseCode, handle.message); poi.verifyPoiNotAppearOnMap(); }</code><technical_language>Suggest move 2nd param a class variable I other tests value</technical_language>

Target:
public void InteractiveMaps_032_PalantirSetAndRemovePlayerPosition() { InteractiveMapsPageObject specialMap = new InteractiveMapsPageObject(driver); InteractiveMapPageObject selectedMap = specialMap.openMap(wikiURL, PalantirContent.PALANTIR_MAP); selectedMap.verifyMapOpened(); PalantirComponentObject poi = new PalantirComponentObject(driver); PalantirContent handle = poi.setAndVerifyPlayerPosition(-40, -10, 3, true); poi.verifyCorrectPlayerPos(handle); poi.verifyPoiAppearOnMap(); handle = poi.deletePlayerPosition(); poi.verifyPlayerPosDeleted(handle); poi.verifyPoiNotAppearOnMap(); }
Source:
<code>private UpdateMavenConfigurationJob() { super("Update Maven projects configuration"); this.toProcess = new <START> HashSet<IProject>(); <END> this.setUser(true); }</code><technical_language>a synchronized set</technical_language>

Target:
private UpdateMavenConfigurationJob() { super("Update Maven projects configuration"); this.toProcess = Collections.synchronizedSet(new HashSet<IProject>()); this.setUser(true); }
Source:
<code>static void deleteStaleTestDatabases(String instanceId, String baseDbId) { Timestamp now = Timestamp.now(); Pattern pattern = getTestDbIdPattern(baseDbId); for (Database db : dbClient.listDatabases(instanceId).iterateAll()) { if (db.getCreateTime().getSeconds() > 0 && TimeUnit.HOURS .convert(now.getSeconds() - db.getCreateTime().getSeconds(), TimeUnit.SECONDS) > 24) { <START> if (pattern.matcher(toComparableId(baseDbId, db.getId().getDatabase())).matches()) { <END> db.drop(); } } } }</code><technical_language>fragile use: if db.getId.getDatabase().startsWith(baseDbID)? adjustments formatForTest UUID break this feedback</technical_language>

Target:
static void deleteStaleTestDatabases(String instanceId, String baseDbId) { Timestamp now = Timestamp.now(); Pattern samplePattern = getTestDbIdPattern(baseDbId); Pattern restoredPattern = getTestDbIdPattern("restored"); for (Database db : dbClient.listDatabases(instanceId).iterateAll()) { if (TimeUnit.HOURS.convert(now.getSeconds() - db.getCreateTime().getSeconds(), TimeUnit.SECONDS) > 24) { if (db.getId().getDatabase().length() >= DBID_LENGTH) { if (samplePattern.matcher(toComparableId(baseDbId, db.getId().getDatabase())).matches()) { db.drop(); } if (restoredPattern.matcher(toComparableId("restored", db.getId().getDatabase())) .matches()) { db.drop(); } } } } }
Source:
<code>public void save(StoragePool pool) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() .addValue("description", pool.getdescription()) .addValue("free_text_comment", pool.getComment()) .addValue("id", pool.getId()) <START> .addValue("is_local", pool.isLocal()) <END> .addValue("name", pool.getName()) .addValue("status", pool.getStatus()) .addValue("master_domain_version", pool.getmaster_domain_version()) .addValue("spm_vds_id", pool.getspm_vds_id()) .addValue("quota_enforcement_type", pool.getQuotaEnforcementType()) .addValue("compatibility_version", pool.getcompatibility_version()); getCallsHandler().executeModification("Insertstorage_pool", parameterSource); }</code><technical_language>order before? (which consistent save update)</technical_language>

Target:
public void save(StoragePool pool) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() .addValue("description", pool.getdescription()) .addValue("free_text_comment", pool.getComment()) .addValue("id", pool.getId()) .addValue("name", pool.getName()) .addValue("is_local", pool.isLocal()) .addValue("status", pool.getStatus()) .addValue("master_domain_version", pool.getmaster_domain_version()) .addValue("spm_vds_id", pool.getspm_vds_id()) .addValue("quota_enforcement_type", pool.getQuotaEnforcementType()) .addValue("compatibility_version", pool.getcompatibility_version()); getCallsHandler().executeModification("Insertstorage_pool", parameterSource); }
Source:
<code>private Properties loadDefaultProperties() throws IOException { Properties merged = new Properties(); try { PGProperty.USER.set(merged, System.getProperty("user.name")); } catch (SecurityException se) { } ClassLoader cl = getClass().getClassLoader(); if (cl == null) { cl = ClassLoader.getSystemClassLoader(); } if (cl == null) { <START> LOGGER.log(Level.FINE, "Can't find a classloader for the Driver; not loading driver configuration"); <END> return merged; } LOGGER.log(Level.FINE, "Loading driver configuration via classloader {0}", cl); ArrayList<URL> urls = new ArrayList<URL>(); Enumeration<URL> urlEnum = cl.getResources("org/postgresql/driverconfig.properties"); while (urlEnum.hasMoreElements()) { urls.add(urlEnum.nextElement()); } for (int i = urls.size() - 1; i >= 0; i--) { URL url = urls.get(i); LOGGER.log(Level.FINE, "Loading driver configuration from: {0}", url); InputStream is = url.openStream(); merged.load(is); is.close(); } return merged; }</code><technical_language>+1 this case. top of that, sense add a word org/postgresql/driverconfig.properties is clear configuration skipped</technical_language>

Target:
private Properties loadDefaultProperties() throws IOException { Properties merged = new Properties(); try { PGProperty.USER.set(merged, System.getProperty("user.name")); } catch (SecurityException se) { } ClassLoader cl = getClass().getClassLoader(); if (cl == null) { LOGGER.log(Level.FINE, "Can't find our classloader for the Driver; " + "attempt to use the system class loader"); cl = ClassLoader.getSystemClassLoader(); } if (cl == null) { LOGGER.log(Level.WARNING, "Can't find a classloader for the Driver; not loading driver " + "configuration from org/postgresql/driverconfig.properties"); return merged; } LOGGER.log(Level.FINE, "Loading driver configuration via classloader {0}", cl); ArrayList<URL> urls = new ArrayList<URL>(); Enumeration<URL> urlEnum = cl.getResources("org/postgresql/driverconfig.properties"); while (urlEnum.hasMoreElements()) { urls.add(urlEnum.nextElement()); } for (int i = urls.size() - 1; i >= 0; i--) { URL url = urls.get(i); LOGGER.log(Level.FINE, "Loading driver configuration from: {0}", url); InputStream is = url.openStream(); merged.load(is); is.close(); } return merged; }
Source:
<code>public Set<String> upgrade(Map<String, Object> settings) { K9.Theme messageViewTheme = (K9.Theme) settings.get("message_view_theme"); K9.Theme theme = (K9.Theme) settings.get("theme"); if (theme != null && messageViewTheme != null && theme == messageViewTheme) { <START> settings.put("message_view_theme", K9.Theme.USE_GLOBAL); <END> } return null; }</code><technical_language>for changes in GlobalSettings: I changing is correct</technical_language>

Target:
public Set<String> upgrade(Map<String, Object> settings) { K9.Theme messageViewTheme = (K9.Theme) settings.get("messageViewTheme"); K9.Theme theme = (K9.Theme) settings.get("theme"); if (theme != null && messageViewTheme != null && theme == messageViewTheme) { settings.put("messageViewTheme", K9.Theme.USE_GLOBAL); } return null; }
Source:
<code>public boolean configure(StaplerRequest req, JSONObject json) throws FormException { ignoredWarnings.clear(); if (json.has("ignoredWarnings")) { JSONArray warnings = json.optJSONArray("ignoredWarnings"); if (warnings != null) { for (int i = 0; i < warnings.size(); i++) { <START> ignore(warnings.getString(i)); <END> } } else { ignore(json.getString("ignoredWarnings")); } } return true; }</code><technical_language>IMHO a bad implementation. run save() iteration thread-unsafe. proposals: 1) Get rid of ignore() method 2) In this cycle create a new collection 3) Replace save collection end of method approach prevent original data corruption if JSON operation throws exception</technical_language>

Target:
public boolean configure(StaplerRequest req, JSONObject json) throws FormException { HashSet<String> newIgnoredWarnings = new HashSet<>(); for (Object key : json.keySet()) { String warningKey = key.toString(); if (!json.getBoolean(warningKey)) { newIgnoredWarnings.add(warningKey); } } this.ignoredWarnings = newIgnoredWarnings; this.save(); return true; }
Source:
<code>public String docs() { return "{clicked: the type of entity being clicked | x: <expression> | y: <expression> | z: <expression> }" <START> + " Fires when a player right clicks an entity. Only cancels Armor Stand interactions." <END> + " {player: the player clicking | clicked | id: the id of the entity" + " | data: if a player is clicked, this will contain their name" + " | position: relative location of the click on the entity}" + " {}" + " {player|clicked|id|data}"; }</code><technical_language>want state "_Cancelling this_ cancels"</technical_language>

Target:
public String docs() { return "{clicked: the type of entity being clicked | x: <expression> offset of clicked location" + " from entity location on the x axis. | y: <expression> | z: <expression> }" + " Fires when a player right clicks an entity. This event is like player_interact_entity but also" + " has the click position, and when cancelled only cancels interactions with Armor Stand entities." + " {player: the player clicking | clicked | id: the id of the entity" + " | data: if a player is clicked, this will contain their name" + " | position: offset of clicked location from entity location in an xyz array.}" + " {}" + " {player|clicked|id|data}"; }