auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public Element render( <END> final Node node, final String domID, final Tree.Joint joint, final int depth) { final Element rootContainer = super.render(node, domID, joint, depth); final Element nodeContainer = rootContainer.getFirstChildElement(); final Element checkBoxElement = new CheckBox().getElement(); final InputElement checkBoxInputElement = (InputElement) checkBoxElement.getElementsByTagName("input").getItem(0); final Path nodePath = node instanceof ChangedFileNode ? Path.valueOf(node.getName()) : ((ChangedFolderNode) node).getPath(); if (indeterminate.contains(nodePath)) { checkBoxInputElement.setId(checkBoxInputElement.getId() + "-indeterminate"); setIndeterminate(checkBoxInputElement); } else if (!unselected.contains(nodePath)) { checkBoxInputElement.setChecked(true); checkBoxInputElement.setId(checkBoxInputElement.getId() + "-checked"); } else { checkBoxInputElement.setId(checkBoxInputElement.getId() + "-unchecked"); } Event.sinkEvents(checkBoxElement, Event.ONCLICK); Event.setEventListener( checkBoxElement, event -> { if (Event.ONCLICK == event.getTypeInt() && event.getTarget().getTagName().equalsIgnoreCase("label")) { handleCheckBoxSelection(nodePath, checkBoxInputElement.isChecked()); delegate.refreshNodes(); } }); nodeContainer.insertAfter(checkBoxElement, nodeContainer.getFirstChild()); return rootContainer; }</code><technical_language>Refactor method. Split smaller ones</technical_language>

Target:
public Element render( final Node node, final String domID, final Tree.Joint joint, final int depth) { final Element rootContainer = super.render(node, domID, joint, depth); final Element nodeContainer = rootContainer.getFirstChildElement(); final Element checkBoxElement = new CheckBox().getElement(); final InputElement checkBoxInputElement = (InputElement) checkBoxElement.getElementsByTagName("input").getItem(0); final Path nodePath = node instanceof ChangedFileNode ? Path.valueOf(node.getName()) : ((ChangedFolderNode) node).getPath(); setCheckBoxState(nodePath, checkBoxInputElement); setCheckBoxClickHandler(nodePath, checkBoxElement, checkBoxInputElement.isChecked()); nodeContainer.insertAfter(checkBoxElement, nodeContainer.getFirstChild()); return rootContainer; }
Source:
<code>public boolean isEmpty() { <START> synchronized (listeners) <END> { return listeners.size() == 0; } }</code><technical_language>listeners is atomic</technical_language>

Target:
public boolean isEmpty() { return listeners.isEmpty(); }
Source:
<code>public Comparator<Integer> getComparator() { <START> return Integer::compare; <END> }</code><technical_language>Comparator.naturalOrder()</technical_language>

Target:
public Comparator<Integer> getComparator() { return Comparator.naturalOrder(); }
Source:
<code>public void checkIPAdress() { Set<ConstraintViolation<IPAdress>> validate = validator.validate(new IPAdress(address)); <START> assertEquals(validate.isEmpty(), expectedResult); <END> }</code><technical_language>expected 1st, affects error messages junit</technical_language>

Target:
public void checkIPAdress() { Set<ConstraintViolation<IPAdress>> validate = validator.validate(new IPAdress(address)); assertEquals(expectedResult, validate.isEmpty()); }
Source:
<code>private boolean shouldCommit() { if (isChanged()) { if (trace) <START> log.tracef("Updating entry (key=%s removed=%s changed=%s created=%s value=%s metadata=%s)", <END> toStr(getKey()), isRemoved(), isChanged(), isCreated(), isCommitted(), toStr(value), getMetadata()); return true; } return false; }</code><technical_language>missing committed suggestion log.tracef("Updating entry (key=%s removed=%s changed=%s created=%s committed=%s value=%s metadata=%s)",</technical_language>

Target:
private boolean shouldCommit() { if (isChanged()) { if (trace) log.tracef("Updating entry (key=%s removed=%s changed=%s created=%s committed=%s value=%s metadata=%s internalMetadata=%s)", toStr(getKey()), isRemoved(), isChanged(), isCreated(), isCommitted(), toStr(value), getMetadata(), internalMetadata); return true; } return false; }
Source:
<code>RulesProfileDto getOrCreateCustom(DbSession dbSession, OrganizationDto organization, QProfileName name) { requireNonNull(organization); RulesProfileDto profile = db.qualityProfileDao().selectByNameAndLanguage(organization, name.getName(), name.getLanguage(), dbSession); if (profile == null) { profile = doCreate(dbSession, organization, name, false, false); } else { <START> checkArgument(!profile.isBuiltIn(), "Operation forbidden for built-in Quality Profile '%s'", profile.getKey()); <END> } return profile; }</code><technical_language>error message profile name language. key, is a UUID, is human-readable</technical_language>

Target:
RulesProfileDto getOrCreateCustom(DbSession dbSession, OrganizationDto organization, QProfileName name) { requireNonNull(organization); RulesProfileDto profile = db.qualityProfileDao().selectByNameAndLanguage(organization, name.getName(), name.getLanguage(), dbSession); if (profile == null) { profile = doCreate(dbSession, organization, name, false, false); } else { checkArgument(!profile.isBuiltIn(), "Operation forbidden for built-in Quality Profile '%s' with language '%s'", profile.getName(), profile.getLanguage()); } return profile; }
Source:
<code>private void copyJarInJarLoader(File targetFile) throws IOException { try (InputStream is= JavaPlugin.getDefault().getBundle().getEntry(FatJarRsrcUrlBuilder.JAR_RSRC_LOADER_ZIP).openStream()) { <START> OutputStream os= new FileOutputStream(targetFile); <END> byte[] buf= new byte[1024]; while (true) { int cnt= is.read(buf); if (cnt <= 0) break; os.write(buf, 0, cnt); } os.close(); } }</code><technical_language>OutputStream try-with clause</technical_language>

Target:
private void copyJarInJarLoader(File targetFile) throws IOException { try (InputStream is= JavaPlugin.getDefault().getBundle().getEntry(FatJarRsrcUrlBuilder.JAR_RSRC_LOADER_ZIP).openStream(); OutputStream os= new FileOutputStream(targetFile);) { byte[] buf= new byte[1024]; while (true) { int cnt= is.read(buf); if (cnt <= 0) break; os.write(buf, 0, cnt); } } }
Source:
<code>private void showMessage(String messageData, boolean remote) { <START> ChatMessage message = ChatMessage.fromData(messageData); <END> message.setRemote(remote); mMessageHistory.add(message); }</code><technical_language>create a new ChatMessage messageData remote</technical_language>

Target:
private void showMessage(String messageData, boolean remote) { ChatMessage message = ChatMessage.fromData(messageData, remote); mMessageHistory.add(message); }
Source:
<code>public List<FileAsset> findFileAssetsByFolder( final Folder parentFolder, final User user, final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { List<Contentlet> contentlets = null; try{ contentlets = contAPI.search( "+structureType:" + Structure.STRUCTURE_TYPE_FILEASSET + " +conFolder:" + parentFolder.getInode(), -1, 0, null, user, respectFrontendRoles); } catch (DotRuntimeException e) { <START> if (e.getCause() instanceof ConnectException) { <END> contentlets = this.fileAssetFactory.findFileAssetsByFolderInDB(parentFolder, user, respectFrontendRoles); } else { throw e; } } catch (DotSecurityException | DotDataException e) { throw e; } catch (Exception e) { Logger.error(this.getClass(), e.getMessage(), e); throw new DotRuntimeException(e.getMessage(), e); } return fromContentlets(perAPI.filterCollection(contentlets, PermissionAPI.PERMISSION_READ, respectFrontendRoles, user)); }</code><technical_language>this handle ExceptionUtil.causedBy a wrapper of real one, in deep</technical_language>

Target:
public List<FileAsset> findFileAssetsByFolder( final Folder parentFolder, final User user, final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { List<Contentlet> contentlets = null; try{ contentlets = contAPI.search( "+structureType:" + Structure.STRUCTURE_TYPE_FILEASSET + " +conFolder:" + parentFolder.getInode(), -1, 0, null, user, respectFrontendRoles); } catch (DotRuntimeException e) { if ( ExceptionUtil.causedBy(e, ConnectException.class)) { Logger.warnEveryAndDebug(FileAssetAPIImpl.class, e.getMessage(), e, 5000); contentlets = getFileAssetsByFolderInDB(parentFolder, user, respectFrontendRoles); } else { throw e; } } catch (DotSecurityException | DotDataException e) { throw e; } catch (Exception e) { Logger.error(this.getClass(), e.getMessage(), e); throw new DotRuntimeException(e.getMessage(), e); } return fromContentlets(perAPI.filterCollection(contentlets, PermissionAPI.PERMISSION_READ, respectFrontendRoles, user)); }
Source:
<code><START> public boolean validate(Collection<FormField> fields) { <END> boolean isAllValid = true; for (FormField field : fields) { isAllValid = validate(field) && isAllValid; } return isAllValid; }</code><technical_language>In Java 8, is a implement this method: return fields.stream().allMatch(f -> validate(f));</technical_language>

Target:
public boolean validate(Collection<FormField> fields) { boolean isValid = true; for (FormField field : fields) { isValid = validate(field) && isValid; } return isValid; }
Source:
<code>public void addInvalidMimetype() throws Exception { <START> String mockBody = "{\"message\":{\"data\":\"dGVzdA==\"," + "\"attributes\":{},\"messageId\":\"91010751788941\"" + ",\"publishTime\":\"2017-09-25T23:16:42.302Z\"}}"; <END> mockMvc .perform(post("/").contentType(MediaType.TEXT_HTML).content(mockBody)) .andExpect(status().isUnsupportedMediaType()); }</code><technical_language>Ok, in future, consider constructing w/ JSONObject GSON</technical_language>

Target:
public void addInvalidMimetype() throws Exception { mockMvc .perform(post("/").contentType(MediaType.TEXT_HTML).content(mockBody)) .andExpect(status().isUnsupportedMediaType()); }
Source:
<code>private SyncProcess newSyncProcess(BiPredicate<Meta, Map<String, Object>> predicate) { checkNotNull(predicate, "predicate parameter must not be null"); <START> return new SyncProcess(client, deviceUUID, sessionManager, predicate); <END> }</code><technical_language>pass timeout another param here. I need alter existing ctor (no need add another one)</technical_language>

Target:
private SyncProcess newSyncProcess(BiPredicate<Meta, Map<String, Object>> predicate) { checkNotNull(predicate, "predicate parameter must not be null"); return new SyncProcess(client, deviceUUID, sessionManager, predicate, timeToRunInMillis); }
Source:
<code>public ExportConfiguration setPemFile(Path path) { if (Files.isRegularFile(path) && Files.isReadable(path)) { this.pemFile = Optional.ofNullable(path); <START> } <END> return this; }</code><technical_language>if want set it? UI this happened</technical_language>

Target:
public ExportConfiguration setPemFile(Path path) { this.pemFile = Optional.ofNullable(path) .filter(PrivateKeyUtils::isValidPrivateKey); return this; }
Source:
<code>public String[] extractPartitions(Message message) { JSONObject jsonObject = (JSONObject) JSONValue.parse(message.getPayload()); String result[] = { defaultDate }; if (jsonObject != null) { Object fieldValue = getJsonFieldValue(jsonObject); <START> if (fieldValue != null) { <END> try { Date dateFormat = DatatypeConverter.parseDateTime(fieldValue.toString()).getTime(); SimpleDateFormat outputFormatter = new SimpleDateFormat(defaultFormatter); result[0] = "dt=" + outputFormatter.format(dateFormat); } catch (Exception e) { LOG.warn("Impossible to convert date = as ISO-8601. Using date default = {}", fieldValue.toString(), result[0]); } } } return result; }</code><technical_language>fieldValue is present, default, this error prone. need a warning logging here. introduce a config parameter decide fallback default error out. This applies field is available, parsed</technical_language>

Target:
public String[] extractPartitions(Message message) throws Exception { JSONObject jsonObject = (JSONObject) JSONValue.parse(message.getPayload()); String result[] = { defaultDate }; if (jsonObject != null) { Object fieldValue = getJsonFieldValue(jsonObject); if (fieldValue == null) { LOG.warn("Missing field value. Using default partition = {}", defaultDate); } else { try { Date dateFormat = DatatypeConverter.parseDateTime(fieldValue.toString()).getTime(); result[0] = "dt=" + outputFormatter.format(dateFormat); } catch (Exception e) { LOG.warn("Impossible to convert date = as ISO-8601. Using date default = {}", fieldValue.toString(), result[0]); } } } return result; }
Source:
<code>public void refresh() { try { if (this.consumer == null) { SustainedConnectionWorker.this.totalConsumerConnections.incrementAndGet(); this.consumer = new KafkaConsumer<>(this.props, new ByteArrayDeserializer(), new ByteArrayDeserializer()); List<TopicPartition> partitions = this.consumer.partitionsFor(this.topicName).stream() .map(partitionInfo -> new TopicPartition(partitionInfo.topic(), partitionInfo.partition())) .collect(Collectors.toList()); this.activePartition = partitions.get(this.rand.nextInt(partitions.size())); this.consumer.assign(Collections.singletonList(this.activePartition)); } this.consumer.seekToEnd(Collections.emptyList()); this.consumer.poll(Duration.ofMillis(50)); } catch (Throwable e) { this.closeQuietly(); SustainedConnectionWorker.this.totalConsumerConnections.decrementAndGet(); SustainedConnectionWorker.this.totalConsumerFailedConnections.incrementAndGet(); <START> SustainedConnectionWorker.log.error("Error while refreshing sustained KafkaConsumer connection", e.getMessage()); <END> } this.nextUpdate = System.currentTimeMillis() + this.refreshRate; this.inUse = false; }</code><technical_language>This log error. want public void error(String msg, Throwable t); overload, need change e.getMessage() -> e</technical_language>

Target:
public void refresh() { try { if (this.consumer == null) { SustainedConnectionWorker.this.totalConsumerConnections.incrementAndGet(); this.consumer = new KafkaConsumer<>(this.props, new ByteArrayDeserializer(), new ByteArrayDeserializer()); List<TopicPartition> partitions = this.consumer.partitionsFor(this.topicName).stream() .map(partitionInfo -> new TopicPartition(partitionInfo.topic(), partitionInfo.partition())) .collect(Collectors.toList()); this.activePartition = partitions.get(this.rand.nextInt(partitions.size())); this.consumer.assign(Collections.singletonList(this.activePartition)); } this.consumer.seekToEnd(Collections.emptyList()); this.consumer.poll(Duration.ofMillis(50)); } catch (Throwable e) { this.closeQuietly(); SustainedConnectionWorker.this.totalConsumerConnections.decrementAndGet(); SustainedConnectionWorker.this.totalConsumerFailedConnections.incrementAndGet(); SustainedConnectionWorker.log.error("Error while refreshing sustained KafkaConsumer connection", e); } this.completeRefresh(); }
Source:
<code><START> public void dialogOnAddButtonPressed(String time, String date, String reading, String type, String notes, long oldId) { <END> if (validateDate(date) && validateTime(time) && validateGlucose(reading) && validateType(type)) { Date finalDateTime = getReadingTime(); Number number = parseReading(reading); if (number == null) { activity.showErrorMessage(); return; } boolean isReadingAdded; if ("mg/dL".equals(getUnitMeasuerement())) { int finalReading = number.intValue(); GlucoseReading gReading = new GlucoseReading(finalReading, type, finalDateTime, notes); isReadingAdded = dB.editGlucoseReading(oldId, gReading); } else { converter = new GlucosioConverter(); int convertedReading = converter.glucoseToMgDl(number.doubleValue()); GlucoseReading gReading = new GlucoseReading(convertedReading, type, finalDateTime, notes); isReadingAdded = dB.editGlucoseReading(oldId, gReading); } if (!isReadingAdded) { activity.showDuplicateErrorMessage(); } else { activity.finishActivity(); } } else { activity.showErrorMessage(); } }</code><technical_language>remove duplication in similar methods? (I changes touch nice remove duplication)</technical_language>

Target:
public void dialogOnAddButtonPressed(String time, String date, String reading, String type, String notes, long oldId) { if (validateDate(date) && validateTime(time) && validateGlucose(reading) && validateType(type)) { Date finalDateTime = getReadingTime(); Number number = ReadingTools.parseReading(reading); if (number == null) { activity.showErrorMessage(); } else { boolean isReadingAdded = createReading(type, notes, oldId, finalDateTime, number); if (!isReadingAdded) { activity.showDuplicateErrorMessage(); } else { activity.finishActivity(); } } } else { activity.showErrorMessage(); } }
Source:
<code>protected void displayLnpResults() throws IOException { <START> LNPResultsStatistics reportAnalysis = getResultsStatistics(); <END> reportAnalysis.setTestName(getClass().getSimpleName()); reportAnalysis.generateResultsStatistics(); reportAnalysis.displayLnpResultsStatistics(getErrorRateLimit(), getMeanRespTimeLimit()); }</code><technical_language>~reportAnalysis~ resultsStats</technical_language>

Target:
protected void displayLnpResults() throws IOException { LNPResultsStatistics resultsStats = getResultsStatistics(); resultsStats.displayLnpResultsStatistics(); resultsStats.verifyLnpTestSuccess(getErrorRateLimit(), getMeanRespTimeLimit()); }
Source:
<code>public void boardCreation_firstTimeUser_sampleBoardCreated(){ login("dummy", "dummy", "test", "test"); <START> teardown(); <END> assertEquals(testPref.getAllBoardNames().size(), 1); assertEquals(testPref.getAllBoardNames().get(0), SAMPLE_BOARD); verifyBoard(panelControl, BoardAutoCreator.getSamplePanelDetails()); }</code><technical_language>call teardown here? teardown is supposed happen end of test. Instead of calling teardown, a junit annotation for teardown method</technical_language>

Target:
public void boardCreation_firstTimeUser_sampleBoardCreated(){ login("dummy", "dummy", "test", "test"); TestUtils.awaitCondition(() -> BoardAutoCreator.getSamplePanelDetails().size() == countPanelsShown()); List<String> boardNames = panelControl.getAllBoardNames(); assertEquals(boardNames, Arrays.asList(new String[] {SAMPLE_BOARD})); verifyBoard(panelControl, BoardAutoCreator.getSamplePanelDetails()); }
Source:
<code>public void run() { Object value = this.recordStore.get(this.dataKey, false, getCallerAddress()); <START> this.result = (value instanceof com.hazelcast.map.Immutable) ? value : this.mapServiceContext.toData(value); <END> }</code><technical_language>replace full class name import</technical_language>

Target:
public void run() { Object currentValue = recordStore.get(dataKey, false, getCallerAddress()); result = (currentValue instanceof Immutable) ? currentValue : mapServiceContext.toData(currentValue); }
Source:
<code>public void testApply() { Vector[] data = new Vector[] { new DenseVector(new Serializable[] {"1", "Moscow", "A"}), new DenseVector(new Serializable[] {"2", "Moscow", "B"}), new DenseVector(new Serializable[] {"3", "Moscow", "B"}), }; Vectorizer<Integer, Vector, Integer, Double> vectorizer = new DummyVectorizer<>(0, 1, 2); TargetEncoderPreprocessor<Integer, Vector> preprocessor = new TargetEncoderPreprocessor<Integer, Vector>( new TargetEncodingMeta[]{ new TargetEncodingMeta( 0.5, new HashMap() { { put("1", 1.0); put("2", 0.0); } } ), new TargetEncodingMeta( 0.1, new HashMap() ), new TargetEncodingMeta( 0.1, new HashMap() { { put("A", 1.0); put("B", 2.0); } } ), }, vectorizer, new HashSet() { { add(0); add(1); add(2); } }); double[][] postProcessedData = new double[][] { <START> {1.0, 0.1, 1.0}, <END> {0.0, 0.1, 2.0}, {0.5, 0.1, 2.0}, }; for (int i = 0; i < data.length; i++) assertArrayEquals(postProcessedData[i], preprocessor.apply(i, data[i]).features().asArray(), 1e-8); }</code><technical_language>explain please numbers in columns: 1.0 2.0? 0.33 0.66</technical_language>

Target:
public void testApply() { Vector[] data = new Vector[] { new DenseVector(new Serializable[] {"1", "Moscow", "A"}), new DenseVector(new Serializable[] {"2", "Moscow", "B"}), new DenseVector(new Serializable[] {"3", "Moscow", "B"}), }; Vectorizer<Integer, Vector, Integer, Double> vectorizer = new DummyVectorizer<>(0, 1, 2); TargetEncoderPreprocessor<Integer, Vector> preprocessor = new TargetEncoderPreprocessor<>( new TargetEncodingMeta[]{ new TargetEncodingMeta() .withGlobalMean(0.5) .withCategoryMean(new HashMap<String, Double>() { { put("1", 1.0); put("2", 0.0); } }), new TargetEncodingMeta() .withGlobalMean(0.1) .withCategoryMean(new HashMap<String, Double>() {}), new TargetEncodingMeta() .withGlobalMean(0.1) .withCategoryMean(new HashMap<String, Double>() { { put("A", 1.0); put("B", 2.0); } }) }, vectorizer, new HashSet<Integer>() { { add(0); add(1); add(2); } }); double[][] postProcessedData = new double[][] { { 1.0, 0.1, 1.0 }, { 0.0, 0.1, 2.0 }, { 0.5, 0.1, 2.0 }, }; for (int i = 0; i < data.length; i++) assertArrayEquals(postProcessedData[i], preprocessor.apply(i, data[i]).features().asArray(), 1e-8); }
Source:
<code>ClientExport(final GoodDataEndpoint endpoint, final String projectUri, final String dashboardUri, final String tabId) { this(notNull(endpoint, "endpoint").toUri() + DASHBOARD_EXPORT_TEMPLATE .expand( notNull(projectUri, "projectUri"), notNull(dashboardUri, "dashboardUri"), notNull(tabId, "tabId") ).toString(), <START> "foo"); <END> }</code><technical_language>do want here</technical_language>

Target:
ClientExport(final GoodDataEndpoint endpoint, final String projectUri, final String dashboardUri, final String tabId) { this(notNull(endpoint, "endpoint").toUri() + DASHBOARD_EXPORT_TEMPLATE .expand( notNull(projectUri, "projectUri"), notNull(dashboardUri, "dashboardUri"), notNull(tabId, "tabId") ).toString(), "export.pdf"); }
Source:
<code>protected final void internalRenderJavaScriptReference(Response response, String url, String id, boolean defer, String charset, String condition, boolean async) { Args.notEmpty(url, "url"); boolean hasCondition = Strings.isEmpty(condition) == false; if (hasCondition) { response.write("<!--[if "); response.write(condition); response.write("]>"); } boolean isAjax = RequestCycle.get().find(IPartialPageRequestHandler.class).isPresent(); CharSequence escapedUrl = isAjax ? Strings.escapeMarkup(url): url; AttributeMap attributes = AttributeMap.of( HeaderItemAttribute.TYPE, "text/javascript", HeaderItemAttribute.SCRIPT_SRC, String.valueOf(escapedUrl) ); if (id != null) { attributes.add(HeaderItemAttribute.ID, id); } if (defer) { attributes.add(HeaderItemAttribute.SCRIPT_DEFER, "defer"); } if (charset != null) { attributes.add("charset", charset); } if (async) { attributes.add(HeaderItemAttribute.SCRIPT_ASYNC, "async"); } <START> attributes.compute(HeaderItemAttribute.CSP_NONCE, this::getNonce); <END> JavaScriptUtils.writeScript(response, attributes); if (hasCondition) { response.write("<![endif]-->\n"); } }</code><technical_language>hassle lambdas? A lines a simple not-null check works fine too. prefer a method in AttributeMap (what good is class anyway), ignores attribute if a null is given</technical_language>

Target:
protected final void internalRenderJavaScriptReference(Response response, String url, String id, boolean defer, String charset, String condition, boolean async) { Args.notEmpty(url, "url"); boolean hasCondition = Strings.isEmpty(condition) == false; if (hasCondition) { response.write("<!--[if "); response.write(condition); response.write("]>"); } AttributeMap attributes = new AttributeMap(); attributes.put(JavaScriptUtils.ATTR_TYPE, "text/javascript"); attributes.putIfNotNull(JavaScriptUtils.ATTR_ID, id); if (defer) { attributes.put(JavaScriptUtils.ATTR_SCRIPT_DEFER, "defer"); } attributes.putIfNotNull("charset", charset); if (async) { attributes.put(JavaScriptUtils.ATTR_SCRIPT_ASYNC, "async"); } attributes.put(JavaScriptUtils.ATTR_SCRIPT_SRC, UrlEncoder.FULL_URL_INSTANCE.encode(url, "UTF-8")); attributes.putIfNotNull(JavaScriptUtils.ATTR_CSP_NONCE, getNonce()); JavaScriptUtils.writeScript(response, attributes); if (hasCondition) { response.write("<![endif]-->\n"); } }
Source:
<code>private void startAuthMethodChoice() { FlowParameters flowParams = getFlowParams(); List<AuthUI.IdpConfig> idpConfigs = flowParams.providerInfo; if (idpConfigs.size() == 1) { String firstProvider = idpConfigs.get(0).getProviderId(); switch (firstProvider) { case EmailAuthProvider.PROVIDER_ID: startActivityForResult( RegisterEmailActivity.createIntent(getContext(), flowParams), RC_EMAIL_FLOW); break; case PhoneAuthProvider.PROVIDER_ID: String phone = idpConfigs .get(0) .getParams() .getString(AuthUI.PHONE_VERIFICATION_DEFAULT_PHONE_EXTRA); startActivityForResult( <START> PhoneVerificationActivity.createIntent(getContext(), flowParams, phone), <END> RC_PHONE_FLOW); break; default: redirectToIdpSignIn(null, providerIdToAccountType(firstProvider)); break; } } else { startActivityForResult( AuthMethodPickerActivity.createIntent( getContext(), flowParams), RC_AUTH_METHOD_PICKER); } getDialogHolder().dismissDialog(); }</code><technical_language>This createIntent call ExtraConstants.EXTRA_PHONE. unify values this AuthUI.PHONE_VERIFICATION_DEFAULT_PHONE_EXTRA. suggest: java class AuthUI { // ... public static final String EXTRA_DEFAULT_PHONE = ExtraConstants.EXTRA_PHONE; // ... }</technical_language>

Target:
private void startAuthMethodChoice() { FlowParameters flowParams = getFlowParams(); List<AuthUI.IdpConfig> idpConfigs = flowParams.providerInfo; if (idpConfigs.size() == 1) { AuthUI.IdpConfig firstIdpConfig = idpConfigs.get(0); String firstProvider = firstIdpConfig.getProviderId(); switch (firstProvider) { case EmailAuthProvider.PROVIDER_ID: startActivityForResult( RegisterEmailActivity.createIntent(getContext(), flowParams), RC_EMAIL_FLOW); break; case PhoneAuthProvider.PROVIDER_ID: String phone = firstIdpConfig.getParams().getString(AuthUI.EXTRA_DEFAULT_PHONE); startActivityForResult( PhoneVerificationActivity.createIntent(getContext(), flowParams, phone), RC_PHONE_FLOW); break; default: redirectToIdpSignIn(null, providerIdToAccountType(firstProvider)); break; } } else { startActivityForResult( AuthMethodPickerActivity.createIntent( getContext(), flowParams), RC_AUTH_METHOD_PICKER); } getDialogHolder().dismissDialog(); }
Source:
<code>public FastaReferenceWriter startSequence(final String sequenceName, final String description, final int basesPerLine) throws IOException { assertIsNotClosed(); checkSequenceName(sequenceName); final String nonNullDescription = checkDescription(description); checkBasesPerLine(basesPerLine); closeSequence(); if (sequenceNamesAndSizes.containsKey(sequenceName)) { throw new IllegalStateException("the input sequence name '" + sequenceName + "' has already been added"); } currentSequenceName = sequenceName; currentBasesPerLine = basesPerLine; <START> final StringBuilder builder = new StringBuilder(sequenceName.length() + nonNullDescription.length() + 10); <END> builder.append(HEADER_START_CHAR).append(sequenceName); if (!nonNullDescription.isEmpty()) { builder.append(HEADER_NAME_AND_DESCRIPTION_SEPARATOR).append(nonNullDescription); } fastaStream.write(builder.toString().getBytes(CHARSET)); fastaStream.write(LINE_SEPARATOR); currentSequenceOffset = fastaStream.getBytesWritten(); return this; }</code><technical_language>want is sequenceName.length() + nonNullDescription.length() + 2. In practice difference (regarding code performance) preallocate here</technical_language>

Target:
public FastaReferenceWriter startSequence(final String sequenceName, final String description, final int basesPerLine) throws IOException { assertIsNotClosed(); checkSequenceName(sequenceName); final String nonNullDescription = checkDescription(description); FastaReferenceWriterBuilder.checkBasesPerLine(basesPerLine); closeSequence(); if (sequenceNames.contains(sequenceName)) { throw new IllegalStateException("the input sequence name '" + sequenceName + "' has already been added"); } currentSequenceName = sequenceName; currentBasesPerLine = basesPerLine; final StringBuilder builder = new StringBuilder(sequenceName.length() + nonNullDescription.length() + 2); builder.append(HEADER_START_CHAR).append(sequenceName); if (!nonNullDescription.isEmpty()) { builder.append(HEADER_NAME_AND_DESCRIPTION_SEPARATOR).append(nonNullDescription); } fastaStream.write(builder.toString().getBytes(CHARSET)); fastaStream.write(LINE_SEPARATOR); currentSequenceOffset = fastaStream.getBytesWritten(); return this; }
Source:
<code>private EList<Diff> getInverseReferences(Match match) { final Collection<EStructuralFeature.Setting> leftInverseReference = safGetNonNavigableInverseReferences( match.getLeft(), diffCrossReferencer); final Collection<EStructuralFeature.Setting> rightInverseReference = safGetNonNavigableInverseReferences( match.getRight(), diffCrossReferencer); final Collection<EStructuralFeature.Setting> originInverseReference = safGetNonNavigableInverseReferences( match.getOrigin(), diffCrossReferencer); List<ResourceAttachmentChange> resourceAttachmentChanges = newArrayList(filter( match.getDifferences(), ResourceAttachmentChange.class)); <START> EList<Diff> result = new BasicEList<Diff>(leftInverseReference.size() + rightInverseReference.size() <END> + originInverseReference.size() + resourceAttachmentChanges.size()); addSettingEObjectsTo(result, leftInverseReference); addSettingEObjectsTo(result, rightInverseReference); addSettingEObjectsTo(result, originInverseReference); addAll(result, resourceAttachmentChanges.iterator()); return result; }</code><technical_language>Pass a Set beforehand; do wish for duplicates</technical_language>

Target:
private EList<Diff> getInverseReferences(Match match) { final Collection<EStructuralFeature.Setting> leftInverseReference = safGetNonNavigableInverseReferences( match.getLeft(), diffCrossReferencer); final Collection<EStructuralFeature.Setting> rightInverseReference = safGetNonNavigableInverseReferences( match.getRight(), diffCrossReferencer); final Collection<EStructuralFeature.Setting> originInverseReference = safGetNonNavigableInverseReferences( match.getOrigin(), diffCrossReferencer); List<ResourceAttachmentChange> resourceAttachmentChanges = newArrayList(filter( match.getDifferences(), ResourceAttachmentChange.class)); final int maxExpectedSize = leftInverseReference.size() + rightInverseReference.size() + originInverseReference.size() + resourceAttachmentChanges.size(); EList<Diff> result = new UniqueEList.FastCompare<Diff>(maxExpectedSize); addSettingEObjectsTo(result, leftInverseReference); addSettingEObjectsTo(result, rightInverseReference); addSettingEObjectsTo(result, originInverseReference); addAll(result, resourceAttachmentChanges.iterator()); return result; }
Source:
<code>public void send(ReqT request) throws IOException { if (mClosed || mCanceled || mClosedFromRemote) { LOG.debug("Failed to send request {}: stream is already closed or canceled. ({})", <START> LogUtils.truncateMessageLines(request), mDescription); <END> return; } try (LockResource lr = new LockResource(mLock)) { checkError(); } mRequestObserver.onNext(request); }</code><technical_language>LogUtils.truncateMessagelines(request) is called of debug level, serializing payload allocating a string. I do a LOG.isDebugEnabled statement this message if intend log call</technical_language>

Target:
public void send(ReqT request) throws IOException { if (mClosed || mCanceled || mClosedFromRemote) { if (LOG.isDebugEnabled()) { LOG.debug("Failed to send request {}: stream is already closed or cancelled. ({})", LogUtils.truncateMessageLineLength(request), mDescription); } return; } try (LockResource lr = new LockResource(mLock)) { checkError(); } mRequestObserver.onNext(request); }
Source:
<code>public void testQueueCleanWhenConnectionSynExeConnectAndDisconnect() throws Exception { Random random = new Random(); Set<MQTTClientProvider> clientProviders = new HashSet<>(11); int repeatCount = 0; String address = "clean/test"; String clientId = "sameClientId"; String queueName = "::sameClientId.clean.test"; while (repeatCount < 100) { repeatCount++; int subConnectionCount = random.nextInt(50) + 1; int sC = 0; try { while (sC < subConnectionCount) { sC++; MQTTClientProvider clientProvider = getMQTTClientProvider(); clientProvider.setClientId(clientId); initializeConnection(clientProvider); clientProviders.add(clientProvider); clientProvider.subscribe(address, AT_LEAST_ONCE); } } finally { for (MQTTClientProvider clientProvider : clientProviders) { clientProvider.disconnect(); } clientProviders.clear(); <START> assertTrue(waitForBindings(server, queueName, false, 0, 0, 10000)); <END> } } }</code><technical_language>I overridden version of waitForBindings necessary. like: assertTrue(Wait.waitFor(() -> server.locateQueue(SimpleString.toSimpleString(queueName)) == null));</technical_language>

Target:
public void testQueueCleanWhenConnectionSynExeConnectAndDisconnect() throws Exception { Random random = new Random(); Set<MQTTClientProvider> clientProviders = new HashSet<>(11); int repeatCount = 0; String address = "clean/test"; String clientId = "sameClientId"; String queueName = "::sameClientId.clean.test"; while (repeatCount < 100) { repeatCount++; int subConnectionCount = random.nextInt(50) + 1; int sC = 0; try { while (sC < subConnectionCount) { sC++; MQTTClientProvider clientProvider = getMQTTClientProvider(); clientProvider.setClientId(clientId); initializeConnection(clientProvider); clientProviders.add(clientProvider); clientProvider.subscribe(address, AT_LEAST_ONCE); } } catch (Throwable e) { LOG.error(e.getMessage(), e); } finally { for (MQTTClientProvider clientProvider : clientProviders) { clientProvider.disconnect(); } clientProviders.clear(); assertTrue(Wait.waitFor(() -> server.locateQueue(SimpleString.toSimpleString(queueName)) == null, 5000, 10)); } } }
Source:
<code>private void handleAudioFocusGain() { if (isAudioPlaying()) { setUpAudioVolume(); } <START> this.audioFocus = AudioFocus.GAIN; <END> }</code><technical_language>Removing this break functionality. Suppose a song playing receive a call, due focus loss song paused. soon call ends, song resume playing. This happen if remove this line</technical_language>

Target:
private void handleAudioFocusGain() { if (isAudioPlaying()) { setUpAudioVolume(); } else { if (audioFocus == AudioFocus.LOSS) { playAudio(); } } this.audioFocus = AudioFocus.GAIN; }
Source:
<code>private MetadataPointer parsePointer(XmlPullParser parser) throws XmlPullParserException, IOException { int pointerDepth = parser.getDepth(); String namespace = null; HashMap<String, Object> fields = null; while (true) { <START> XmlPullParser.Event eventType2 = parser.next(); <END> if (eventType2 == XmlPullParser.Event.START_ELEMENT) { if (parser.getName().equals("x")) { namespace = parser.getNamespace(); } else { if (fields == null) { fields = new HashMap<>(); } String name = parser.getName(); Object value = parser.nextText(); fields.put(name, value); } } else if (eventType2 == XmlPullParser.Event.END_ELEMENT) { if (parser.getDepth() == pointerDepth) { break; } } } return new MetadataPointer(namespace, fields); }</code><technical_language>nextTag() switch-case instead</technical_language>

Target:
private static MetadataPointer parsePointer(XmlPullParser parser) throws XmlPullParserException, IOException { int pointerDepth = parser.getDepth(); String namespace = null; HashMap<String, Object> fields = null; outperloop: while (true) { XmlPullParser.TagEvent tag = parser.nextTag(); switch (tag) { case START_ELEMENT: if (parser.getName().equals("x")) { namespace = parser.getNamespace(); } else { if (fields == null) { fields = new HashMap<>(); } String name = parser.getName(); Object value = parser.nextText(); fields.put(name, value); } break; case END_ELEMENT: if (parser.getDepth() == pointerDepth) { break outperloop; } } } return new MetadataPointer(namespace, fields); }
Source:
<code>private String getThreeWayOverlay(final Diff diff) { final Conflict conflict = diff.getConflict(); final DifferenceKind diffKind = diff.getKind(); final DifferenceSource source = diff.getSource(); ConflictKind conflictKind = null; if (hasDirectOrIndirectConflict(REAL).apply(diff)) { conflictKind = REAL; <START> } else if (canBeConsideredAsPseudoConflicting().apply(diff)) { <END> conflictKind = PSEUDO; } String path = ""; if (conflict != null || conflictKind != null) { if ((conflict != null && conflict.getKind() == PSEUDO) || conflictKind == PSEUDO) { path += "p"; } path += "conf"; if (source == DifferenceSource.RIGHT) { path += "r_"; } } else { switch (source) { case LEFT: path += "r_out"; break; case RIGHT: path += "r_in"; break; default: break; } } switch (diffKind) { case ADD: path += ADD_OV; break; case DELETE: path += DEL_OV; break; case CHANGE: case MOVE: path += CHG_OV; break; default: break; } return path; }</code><technical_language>Please mutualized method introduced in EMFComparePredicates check if diff is either: - refined in pseudo-conflict, - refined atomic diffs in pseudo-conflicts way, enforce coherence location of diff node, write complex ifs below, conflictKind usable decide prefix for image name</technical_language>

Target:
private String getThreeWayOverlay(final Diff diff) { final DifferenceKind diffKind = diff.getKind(); final DifferenceSource source = diff.getSource(); String path = ""; if (hasDirectOrIndirectConflict(REAL).apply(diff)) { path += "conf"; if (source == DifferenceSource.RIGHT) { path += "r_"; } } else if (canBeConsideredAsPseudoConflicting().apply(diff)) { path += "pconf"; if (source == DifferenceSource.RIGHT) { path += "r_"; } } else { switch (source) { case LEFT: path += "r_out"; break; case RIGHT: path += "r_in"; break; default: break; } } switch (diffKind) { case ADD: path += ADD_OV; break; case DELETE: path += DEL_OV; break; case CHANGE: case MOVE: path += CHG_OV; break; default: break; } return path; }
Source:
<code>private void forwardEvent(Event event) throws InvocationTargetException { if (EDBEvent.class.isAssignableFrom(event.getClass())) { <START> LOGGER.info("Forwarding event to edb service"); <END> try { edbService.processEvent(event); } catch (EDBException e) { throw new InvocationTargetException(e); } } else { LOGGER.info("Forwarding event to workflow service"); try { workflowService.processEvent(event); } catch (WorkflowException e) { throw new InvocationTargetException(e); } } }</code><technical_language>need more generic handle forwarding of events</technical_language>

Target:
private void forwardEvent(Event event) throws InvocationTargetException { if (EDBEvent.class.isAssignableFrom(event.getClass())) { LOGGER.info("Forwarding event to edb service"); try { if (event instanceof EDBInsertEvent) { edbService.processEDBInsertEvent((EDBInsertEvent) event); } else if (event instanceof EDBDeleteEvent) { edbService.processEDBDeleteEvent((EDBDeleteEvent) event); } else if (event instanceof EDBUpdateEvent) { edbService.processEDBUpdateEvent((EDBUpdateEvent) event); } else if (event instanceof EDBBatchEvent) { edbService.processEDBBatchEvent((EDBBatchEvent) event); } } catch (EDBException e) { throw new InvocationTargetException(e); } } else { LOGGER.info("Forwarding event to workflow service"); try { workflowService.processEvent(event); } catch (WorkflowException e) { throw new InvocationTargetException(e); } } }
Source:
<code>public static void putObject_test2() throws Exception { if (!mintEnv) { System.out.println("Test: multipart: putObject(String bucketName, String objectName, String filename)"); } long startTime = System.currentTimeMillis(); try { String filename = createFile6Mb(); <START> client.putObject(bucketName, filename, filename, null, null,(ServerSideEncryption)null , null); <END> Files.delete(Paths.get(filename)); client.removeObject(bucketName, filename); mintSuccessLog("putObject(String bucketName, String objectName, String filename)", "filename: 6MB", startTime); } catch (Exception e) { mintFailedLog("putObject(String bucketName, String objectName, String filename)", "filename: 6MB", startTime, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } }</code><technical_language>is required type cast null here</technical_language>

Target:
public static void putObject_test2() throws Exception { if (!mintEnv) { System.out.println("Test: multipart: putObject(String bucketName, String objectName, String filename)"); } long startTime = System.currentTimeMillis(); try { String filename = createFile6Mb(); client.putObject(bucketName, filename, filename, null, null, null , null); Files.delete(Paths.get(filename)); client.removeObject(bucketName, filename); mintSuccessLog("putObject(String bucketName, String objectName, String filename)", "filename: 6MB", startTime); } catch (Exception e) { mintFailedLog("putObject(String bucketName, String objectName, String filename)", "filename: 6MB", startTime, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } }
Source:
<code>public List<Container> getContainersOnPage(final IHTMLPage page) throws DotStateException, DotDataException, DotSecurityException { final List<Container> containers = new ArrayList<>(); <START> List<Identifier> identifiers = new ArrayList<>(); <END> DotConnect dc = new DotConnect(); dc.setSQL("select * from identifier where id in (select distinct(parent2) as containers from multi_tree where parent1=?)"); dc.addParam(page.getIdentifier()); identifiers = ConvertToPOJOUtil.convertDotConnectMapToIdentifier(dc.loadResults()); final List<Container> pageContainers = new ArrayList<>(); for (Identifier id : identifiers) { final Container cont = (Container) APILocator.getVersionableAPI() .findWorkingVersion(id, APILocator.getUserAPI().getSystemUser(), false); pageContainers.add(cont); } return containers; }</code><technical_language>![MAJOR](<LINK_0> 'Severity: MAJOR') Remove this useless assignment local variable "identifiers". [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public List<Container> getContainersOnPage(final IHTMLPage page) throws DotStateException, DotDataException, DotSecurityException { final List<Container> containers = new ArrayList<>(); List<Identifier> identifiers = new ArrayList<>(); DotConnect dc = new DotConnect(); dc.setSQL("select * from identifier where id in (select distinct(parent2) as containers from multi_tree where parent1=?)"); dc.addParam(page.getIdentifier()); identifiers = TransformerLocator.createIdentifierTransformer(dc.loadObjectResults()).asList(); final List<Container> pageContainers = new ArrayList<>(); for (Identifier id : identifiers) { final Container cont = (Container) APILocator.getVersionableAPI() .findWorkingVersion(id, APILocator.getUserAPI().getSystemUser(), false); pageContainers.add(cont); } return containers; }
Source:
<code>public void pushLatest() throws Exception { CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd("true").exec(); LOG.info("Created container {}", container.toString()); assertThat(container.getId(), not(isEmptyString())); LOG.info("Committing container: {}", container.toString()); String imageId = dockerRule.getClient().commitCmd(container.getId()).withRepository(username + "/busybox").exec(); <START> dockerRule.getClient().pushImageCmd(username + "/busybox").exec(new PushImageResultCallback()).awaitCompletion(); <END> LOG.info("Removing image: {}", imageId); dockerRule.getClient().removeImageCmd(imageId).exec(); dockerRule.getClient().pullImageCmd(username + "/busybox").exec(new PullImageResultCallback()).awaitCompletion(); }</code><technical_language>complete pushed r tests needs awaitSuccess() clear success of operation</technical_language>

Target:
public void pushLatest() throws Exception { CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd("true").exec(); LOG.info("Created container {}", container.toString()); assertThat(container.getId(), not(isEmptyString())); LOG.info("Committing container: {}", container.toString()); String imageId = dockerRule.getClient().commitCmd(container.getId()).withRepository(username + "/busybox").exec(); dockerRule.getClient().pushImageCmd(username + "/busybox").exec(new PushImageResultCallback()) .awaitCompletion(30, TimeUnit.SECONDS); LOG.info("Removing image: {}", imageId); dockerRule.getClient().removeImageCmd(imageId).exec(); dockerRule.getClient().pullImageCmd(username + "/busybox").exec(new PullImageResultCallback()) .awaitCompletion(30, TimeUnit.SECONDS); }
Source:
<code>public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) { if (entity instanceof Comment) { Comment comment = (Comment) entity; <START> KafkaJsonOutput output = new KafkaJsonOutput(comment.getCommentUri(), KafkaEventType.DELETE); <END> sendMessage("ambra-comment", output); } super.onDelete(entity, id, state, propertyNames, types); }</code><technical_language>do of moving creation of KafkaJsonOutput sendMessage</technical_language>

Target:
public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) { if (entity instanceof Comment) { Comment comment = (Comment) entity; sendMessage("ambra-comment", comment.getCommentUri(), KafkaEventType.DELETE); } super.onDelete(entity, id, state, propertyNames, types); }
Source:
<code><START> static boolean isValidVersion(String version) { <END> for (Pattern p : VERSION_REGEX) { if (p.matcher(version).matches()) { return true; } } log.warn("Encountered invalid user agent version", SafeArg.of("version", version)); return false; }</code><technical_language>is this used</technical_language>

Target:
static boolean isValidVersion(String version) { if (VERSION_REGEX.matcher(version).matches()) { return true; } log.warn("Encountered invalid user agent version", SafeArg.of("version", version)); return false; }
Source:
<code>public MergeCommand include(Ref commit) { <START> return include(commit.getName(), commit.getObjectId()); <END> }</code><technical_language>oops, I missed merge Stefans fix for annotated tags (calling getPeeledObjectID()). add again</technical_language>

Target:
public MergeCommand include(Ref commit) { checkCallable(); commits.add(commit); return this; }
Source:
<code>public static void startDedicatedScheduler() throws Exception { schedulerHelper.log("Start Scheduler in non-fork mode."); schedulerHelper = new SchedulerTHelper(false, <START> new File(SchedulerFunctionalTest.class <END> .getResource("/functionaltests/config/functionalTSchedulerProperties-rampolicy.ini") .toURI()).getAbsolutePath()); }</code><technical_language>correct class get resource</technical_language>

Target:
public static void startDedicatedScheduler() throws Exception { schedulerHelper.log("Start Scheduler in non-fork mode."); schedulerHelper = new SchedulerTHelper(false, new File(SchedulerFunctionalTestRamPolicy.class .getResource("/functionaltests/config/functionalTSchedulerProperties-rampolicy.ini") .toURI()).getAbsolutePath()); }
Source:
<code>public ConsoleConfigurationRepository httpConsoleConfigurationRepository() { HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(); requestFactory.setConnectTimeout((int) properties.getHttpClient().getConnectTimeout().getSeconds()); <START> requestFactory.setReadTimeout((int) properties.getHttpClient().getReadTimeout().getSeconds()); <END> RestTemplate restTemplate = new RestTemplate(requestFactory); return new HttpConsoleConfigurationRepository(restTemplate); }</code><technical_language>setReadTimeout setConnecTimeout accept values in milliseconds, putting seconds I see. :)</technical_language>

Target:
public ConsoleConfigurationRepository httpConsoleConfigurationRepository() { HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(); requestFactory.setConnectTimeout((int) properties.getHttpClient().getConnectTimeout().toMillis()); requestFactory.setReadTimeout((int) properties.getHttpClient().getReadTimeout().toMillis()); RestTemplate restTemplate = new RestTemplate(requestFactory); return new HttpConsoleConfigurationRepository(properties, restTemplate); }
Source:
<code>private boolean isRealWorklog(final EveritWorklog worklog) { boolean isRealWorklog = true; if (issuesRegex != null) { <START> for (final Pattern issuePattern : issuesRegex) { <END> final boolean issueMatches = issuePattern.matcher(worklog.getIssue()).matches(); if (issueMatches) { isRealWorklog = false; break; } } } return isRealWorklog; }</code><technical_language>Remove of unnecessary final modifier local variables of modified classes</technical_language>

Target:
private boolean isRealWorklog(final EveritWorklog worklog) { boolean isRealWorklog = true; if (issuesRegex != null) { for (Pattern issuePattern : issuesRegex) { boolean issueMatches = issuePattern.matcher(worklog.getIssue()).matches(); if (issueMatches) { isRealWorklog = false; break; } } } return isRealWorklog; }