auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Set<String> getConfiguredMetadataFields(){ final String configFields=Config.getStringProperty("INDEX_METADATA_FIELDS", null); if (UtilMethods.isSet(configFields)) { return new HashSet<>(Arrays.asList( configFields.split(","))); } <START> return Collections.EMPTY_SET; <END> }</code><technical_language>This shows yellow in IDEA of unchecked type returned. Replace Collections.emptySet()</technical_language>

Target:
public Set<String> getConfiguredMetadataFields(){ final String configFields=Config.getStringProperty("INDEX_METADATA_FIELDS", null); if (UtilMethods.isSet(configFields)) { return new HashSet<>(Arrays.asList( configFields.split(","))); } return Collections.emptySet(); }
Source:
<code>protected void updateProvidedObjectsHolder(URL url, Set<E> providedObjects) { if (providedObjects != null && !providedObjects.isEmpty()) { List<String> previousPortfolio = providerPortfolio.get(url); List<String> uids = new ArrayList<String>(); for (E providedObject : providedObjects) { String uid = getUID(providedObject); if (providedObjectsHolder.get(uid) == null) { if (checkExistence(uid)) { continue; } } else if (previousPortfolio == null || !previousPortfolio.contains(uid)) { logger.error("{} with UID \"{}\" already exists! Failed to create a second with the same UID!", <START> providedObject.getClass().getName(), uid, new IllegalArgumentException()); <END> continue; } uids.add(uid); E oldProvidedObject = providedObjectsHolder.put(uid, providedObject); notifyListeners(oldProvidedObject, providedObject); } providerPortfolio.put(url, uids); } }</code><technical_language>this is a bug code is hard read - a problem IF previousPortfolio contains this uid</technical_language>

Target:
protected void updateProvidedObjectsHolder(URL url, Set<E> providedObjects) { if (providedObjects != null && !providedObjects.isEmpty()) { List<String> previousPortfolio = providerPortfolio.get(url); List<String> uids = new ArrayList<String>(); for (E providedObject : providedObjects) { String uid = getUID(providedObject); if (providedObjectsHolder.get(uid) == null) { if (checkExistence(uid)) { logger.warn("{} with UID \"{}\" already exists! Failed to create a second with the same UID!", providedObject.getClass().getName(), uid, new IllegalArgumentException()); continue; } } else if (previousPortfolio == null || !previousPortfolio.contains(uid)) { logger.warn("{} with UID \"{}\" already exists! Failed to create a second with the same UID!", providedObject.getClass().getName(), uid, new IllegalArgumentException()); continue; } uids.add(uid); E oldProvidedObject = providedObjectsHolder.put(uid, providedObject); notifyListeners(oldProvidedObject, providedObject); } providerPortfolio.put(url, uids); } }
Source:
<code>public List<VdcBllMessages> validate() { Map<String, VdsNetworkInterface> ifaces = interfacesToMap(params.getInterfaces()); Map<String, VdsNetworkInterface> existingIfaces = extractExistingInterfaceNames(); Map<String, network> clusterNetworksMap = clusterNetworksToMap(clusterNetworks); Map<String, VdsNetworkInterface> bonds = new HashMap<String, VdsNetworkInterface>(); Map<String, List<VdsNetworkInterface>> bondSlaves = new HashMap<String, List<VdsNetworkInterface>>(); Map<String, network> networks = new HashMap<String, network>(); for (VdsNetworkInterface iface : ifaces.values()) { String name = iface.getName(); String networkName = iface.getNetworkName(); String bondName = iface.getBondName(); boolean bonded = isBond(iface); if (bonded) { extractBond(bonds, iface, name); } else { if (isNotBlank(bondName)) { extractBondSlave(bondSlaves, iface, bondName); } if (!existingIfaces.containsKey(name)) { violations.add(NETWORK_INTERFACE_NOT_EXISTS); } } <START> if (isNotBlank(networkName)) <END> extractNetwork(clusterNetworksMap, networks, iface, networkName); else { violations.add(NETWORK_NETWORK_NOT_EXISTS_IN_CLUSTER); } } validateBonds(bonds, bondSlaves); extractedData = new ExtractedData( new ArrayList<network>(networks.values()), extractRemoveNetworks(networks.keySet(), clusterNetworksMap), (new ArrayList<VdsNetworkInterface>(bonds.values())), extractRemovedBonds(bonds, existingIfaces)); return violations; }</code><technical_language>please wrap condition brackets</technical_language>

Target:
public List<VdcBllMessages> validate() { Map<String, VdsNetworkInterface> ifaces = interfacesToMap(params.getInterfaces()); Map<String, VdsNetworkInterface> existingIfaces = extractExistingInterfaceNames(); Map<String, network> clusterNetworksMap = clusterNetworksToMap(clusterNetworks); Map<String, VdsNetworkInterface> bonds = new HashMap<String, VdsNetworkInterface>(); Map<String, List<VdsNetworkInterface>> bondSlaves = new HashMap<String, List<VdsNetworkInterface>>(); Map<String, network> networks = new HashMap<String, network>(); for (VdsNetworkInterface iface : ifaces.values()) { String name = iface.getName(); String networkName = iface.getNetworkName(); String bondName = iface.getBondName(); boolean bonded = isBond(iface); if (bonded) { extractBond(bonds, iface, name); } else { if (isNotBlank(bondName)) { extractBondSlave(bondSlaves, iface, bondName); } if (!existingIfaces.containsKey(name)) { violations.add(NETWORK_INTERFACE_NOT_EXISTS); } } if (isNotBlank(networkName)) { extractNetwork(clusterNetworksMap, networks, iface, networkName); } else { violations.add(NETWORK_NOT_EXISTS_IN_CLUSTER); } } validateBonds(bonds, bondSlaves); extractedData = new ExtractedData( new ArrayList<network>(networks.values()), extractRemoveNetworks(networks.keySet(), clusterNetworksMap), (new ArrayList<VdsNetworkInterface>(bonds.values())), extractRemovedBonds(bonds, existingIfaces)); return violations; }
Source:
<code>private void scanProjects(final File dir, final String prefix, final SortedSet<Project.NameKey> names) { final File[] ls = dir.listFiles(); if (ls == null) { return; } for (File f : ls) { <START> String name = f.getName(); <END> if (FileKey.isGitRepository(f, FS.DETECTED)) { if (name.equals(Constants.DOT_GIT)) { name = prefix.substring(0, prefix.length() - 1); } else if (name.endsWith(Constants.DOT_GIT_EXT)) { int newLen = name.length() - Constants.DOT_GIT_EXT.length(); name = prefix + name.substring(0, newLen); } else { name = prefix + name; } Project.NameKey nameKey = new Project.NameKey(name); if (!isUnreasonableName(nameKey)) { names.add(nameKey); } } else if (f.isDirectory()) { scanProjects(f, prefix + f.getName() + "/", names); } } }</code><technical_language>Personally I if a variable is for semantics. 'name' contains file name contains project name. I prefer variables (fileName, projectName) in this case</technical_language>

Target:
private void scanProjects(final File dir, final String prefix, final SortedSet<Project.NameKey> names) { final File[] ls = dir.listFiles(); if (ls == null) { return; } for (File f : ls) { String fileName = f.getName(); if (FileKey.isGitRepository(f, FS.DETECTED)) { String projectName; if (fileName.equals(Constants.DOT_GIT)) { projectName = prefix.substring(0, prefix.length() - 1); } else if (fileName.endsWith(Constants.DOT_GIT_EXT)) { int newLen = fileName.length() - Constants.DOT_GIT_EXT.length(); projectName = prefix + fileName.substring(0, newLen); } else { projectName = prefix + fileName; } Project.NameKey nameKey = new Project.NameKey(projectName); if (isUnreasonableName(nameKey)) { log.warn("Ignoring unreasonably named repository " + f.getAbsolutePath()); } else { names.add(nameKey); } } else if (f.isDirectory()) { scanProjects(f, prefix + f.getName() + "/", names); } } }
Source:
<code>public void testLinuxNode() throws RunNodesException { final String groupName = String.format("ubu%s", System.getProperty("user.name").substring(0, 3)); final TemplateBuilder templateBuilder = view.getComputeService().templateBuilder(); templateBuilder.osFamily(OsFamily.UBUNTU); templateBuilder.osVersionMatches("14.04"); templateBuilder.hardwareId("Standard_A0"); templateBuilder.locationId("westus"); final Template template = templateBuilder.build(); final TemplateOptions options = template.getOptions(); <START> options.inboundPorts(5985); <END> try { Set<? extends NodeMetadata> nodes = view.getComputeService().createNodesInGroup(groupName, 1, template); assertThat(nodes).hasSize(1); } finally { view.getComputeService().destroyNodesMatching(inGroup(groupName)); } }</code><technical_language>Is this relevant for this test</technical_language>

Target:
public void testLinuxNode() throws RunNodesException { final String groupName = this.azureGroup; final TemplateBuilder templateBuilder = view.getComputeService().templateBuilder(); templateBuilder.osFamily(OsFamily.UBUNTU); templateBuilder.osVersionMatches("14.04"); templateBuilder.hardwareId("Standard_A0"); templateBuilder.locationId("westus"); final Template template = templateBuilder.build(); try { Set<? extends NodeMetadata> nodes = view.getComputeService().createNodesInGroup(groupName, 1, template); assertThat(nodes).hasSize(1); } finally { view.getComputeService().destroyNodesMatching(inGroup(groupName)); } }
Source:
<code><START> Promise loadDefinitionFromFile(final String file, <END> final Map<String, JSITDefinitions> otherDefinitions) { return contentService.loadFile(file) .then((IThenable.ThenOnFulfilledCallbackFn<String, Void>) xml -> promises.create((success, failure) -> { if (!StringUtils.isEmpty(xml)) { final ServiceCallback<Object> callback = getCallback(file, otherDefinitions, success); diagramService.getDefinitions(xml, callback); } else { success.onInvoke(promises.resolve()); } })); }</code><technical_language>IntelliJ is warning this method, I solve using: suggestion Promise<Void> loadDefinitionFromFile(final String file,</technical_language>

Target:
Promise<Void> loadDefinitionFromFile(final String file, final Map<String, JSITDefinitions> otherDefinitions) { return contentService.loadFile(file) .then(xml -> promises.create((success, failure) -> { if (!StringUtils.isEmpty(xml)) { final ServiceCallback<Object> callback = getCallback(file, otherDefinitions, success); diagramService.getDefinitions(xml, callback); } else { success.onInvoke(promises.resolve()); } })); }
Source:
<code>public void retireProgram_shouldSetRetiredStateToFalseAndSetAReason() { <START> Program programTest = pws.getAllPrograms().get(0); <END> Program program = pws.retireProgram(programTest, "expired"); for (ProgramWorkflow workflow : program.getWorkflows()) { assertEquals(workflow.getRetired(), true); for (ProgramWorkflowState state : workflow.getStates()) { assertNotNull(workflow.getStates()); assertEquals(state.getRetired(), true); assertEquals(state.getRetired(), true); } } assertEquals(program.getRetireReason(), "expired"); }</code><technical_language>This program ProgramWorkflows. find for this test</technical_language>

Target:
public void retireProgram_shouldSetRetiredStateToFalseAndSetAReason() { Concept concept = Context.getConceptService().getConcept(12); ProgramWorkflow programWorkflow = dao.getProgramWorkflowsByConcept(concept).get(1); ArrayList<ProgramWorkflow> programWorkflows = new ArrayList<>(); programWorkflows.add(programWorkflow); Set<ProgramWorkflow> allWorkflows = new HashSet<>(programWorkflows); Program programTest = pws.getAllPrograms().get(1); programTest.setAllWorkflows(allWorkflows); Program program = pws.retireProgram(programTest, "expired"); for (ProgramWorkflow workflow : program.getWorkflows()) { assertTrue(workflow.getRetired()); assertNotNull(workflow.getStates()); for (ProgramWorkflowState state : workflow.getStates()) { assertTrue(state.getRetired()); } } assertEquals(program.getRetireReason(), "expired"); }
Source:
<code>public void init() throws MessagingException { <START> subjectPrefix = getInitParameter("subjectPrefix", String.class); <END> if (Strings.isNullOrEmpty(subjectPrefix)) { throw new MessagingException("Please configure a valid subjectPrefix"); } }</code><technical_language>'stick' previous String version, is type want</technical_language>

Target:
public void init() throws MessagingException { subjectPrefix = getInitParameter("subjectPrefix"); if (Strings.isNullOrEmpty(subjectPrefix)) { throw new MessagingException("Please configure a valid subjectPrefix"); } }
Source:
<code>public void testSetFallbackToNull() { testSetFallbackTo.setFallbackTo(null); <START> testSetFallbackTo.afterPropertiesSet(); <END> }</code><technical_language>[x] Test cases implemented independently. change state of bean testSetFallbackTo. 2 ways. * Create bean instance in test case. java @Test public void testSetFallbackToNull2() { SimpleI18nCodeList codeList = new SimpleI18nCodeList(); try { codeList.setFallbackTo(null); } catch (IllegalArgumentException e) { assertThat(e.getMessage(), is("fallbackTo null")); } } * Define lazy-init bean get ApplicationObjectSupport. xml <bean id="CL_testSetFallbackToNull" class="org.terasoluna.gfw.common.codelist.i18n.SimpleI18nCodeList" lazy-init="true"> .... <property name="fallbackTo"> <null /> </property> </bean> java public class SimpleI18nCodeListTest extends ApplicationObjectSupport { .... @Test public void testSetFallbackToNull() { try { super.getApplicationContext().getBean("CL_testSetFallbackToNull"); fail("BeanCreationException occered."); } catch (BeanCreationException e) { Throwable = e.getCause(); assertThat(cause, instanceOf(PropertyBatchUpdateException.class)); PropertyAccessException[] propertyAccessExceptions = ((PropertyBatchUpdateException) cause).getPropertyAccessExceptions(); assertThat(propertyAccessExceptions, notNullValue()); assertThat(propertyAccessExceptions.length, is(1)); Throwable rootCause = propertyAccessExceptions[0].getCause(); assertThat(rootCause, instanceOf(IllegalArgumentException.class)); assertThat(rootCause.getMessage(), is("fallbackTo null")); } } if need assert exception other type, consider introducing ExpectedException rule</technical_language>

Target:
public void testSetFallbackToNull() { SimpleI18nCodeList codeList = new SimpleI18nCodeList(); try { codeList.setFallbackTo(null); } catch (IllegalArgumentException e) { assertThat(e.getMessage(), is("fallbackTo must not be null")); } }
Source:
<code>public void testRemoveRedundantSemicolons () throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); StringBuffer buf= new StringBuffer(); buf.append("package test; ;\n"); buf.append("public class Foo {\n"); buf.append(" int a= 3;; ;\n"); buf.append(" int b= 7; buf.append(" int c= 10; \n"); buf.append(" public int foo () {\n"); buf.append(" ;\n"); buf.append(" for (;;)\n"); buf.append(" ;;\n"); buf.append(" ;\n"); buf.append(" while (a++ < 1000) ;\n"); buf.append(" };\n"); buf.append("};\n"); ICompilationUnit cu1= pack1.createCompilationUnit("Foo.java", buf.toString(), false, null); buf= new StringBuffer(); buf.append("package test;\n"); buf.append("public class Foo {\n"); buf.append(" int a= 3;\n"); buf.append(" int b= 7; buf.append(" int c= 10; \n"); buf.append(" public int foo () {\n"); buf.append(" \n"); buf.append(" for (;;)\n"); buf.append(" ;\n"); buf.append(" \n"); buf.append(" while (a++ < 1000) ;\n"); buf.append(" }\n"); <START> buf.append("};\n"); <END> String expected1 = buf.toString(); enable(CleanUpConstants.REMOVE_REDUNDANT_SEMICOLONS); assertRefactoringResultAsExpected(new ICompilationUnit[] { cu1 }, new String[] { expected1 }); }</code><technical_language>is this kept</technical_language>

Target:
public void testRemoveRedundantSemicolons () throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); StringBuffer buf= new StringBuffer(); buf.append("package test; ;\n"); buf.append("enum cars { sedan, coupe };\n"); buf.append("public class Foo {\n"); buf.append(" int add(int a, int b) {return a+b;};\n"); buf.append(" int a= 3;; ;\n"); buf.append(" int b= 7; buf.append(" int c= 10; \n"); buf.append(" public int foo () {\n"); buf.append(" ;\n"); buf.append(" for (;;)\n"); buf.append(" ;;\n"); buf.append(" ;\n"); buf.append(" while (a++ < 1000) ;\n"); buf.append(" };\n"); buf.append("};\n"); ICompilationUnit cu1= pack1.createCompilationUnit("Foo.java", buf.toString(), false, null); buf= new StringBuffer(); buf.append("package test;\n"); buf.append("enum cars { sedan, coupe }\n"); buf.append("public class Foo {\n"); buf.append(" int add(int a, int b) {return a+b;}\n"); buf.append(" int a= 3;\n"); buf.append(" int b= 7; buf.append(" int c= 10; \n"); buf.append(" public int foo () {\n"); buf.append(" \n"); buf.append(" for (;;)\n"); buf.append(" ;\n"); buf.append(" \n"); buf.append(" while (a++ < 1000) ;\n"); buf.append(" }\n"); buf.append("}\n"); String expected1 = buf.toString(); enable(CleanUpConstants.REMOVE_REDUNDANT_SEMICOLONS); assertRefactoringResultAsExpected(new ICompilationUnit[] { cu1 }, new String[] { expected1 }); }
Source:
<code>private boolean checkPlayerName(final String name) { <START> return !(name.contains(".") | name.contains("/") | name.contains("\\")); <END> }</code><technical_language>Findbugs complains here, earlier in this PR. (dangerous of non-short-circuit logic) <review,bug</technical_language>

Target:
private boolean checkPlayerName(final String name) { return !(name.contains(".") || name.contains("/") || name.contains("\\")); }
Source:
<code>public PhoenixConnection(ConnectionQueryServices services, String url, Properties info, PMetaData metaData) throws SQLException { this.url = url; this.info = info == null ? new Properties() : new Properties(info); HashMap<String, String> tmpAugmentedProps = new HashMap(); for (Entry<String, String> kv : services.getProps()) { tmpAugmentedProps.put(kv.getKey(), kv.getValue()); } for (Enumeration e = info.propertyNames(); e.hasMoreElements();) { String key = (String)e.nextElement(); tmpAugmentedProps.put(key, info.getProperty(key)); } <START> this.augmentedProps = new ReadOnlyProps(tmpAugmentedProps.entrySet().iterator()); <END> this.services = new DelegateConnectionQueryServices(services) { @Override public ReadOnlyProps getProps() { return augmentedProps; } }; this.scn = JDBCUtil.getCurrentSCN(url, this.info); this.tenantId = JDBCUtil.getTenantId(url, this.info); this.mutateBatchSize = JDBCUtil.getMutateBatchSize(url, this.info, services.getProps()); datePattern = services.getProps().get(QueryServices.DATE_FORMAT_ATTRIB, DateUtil.DEFAULT_DATE_FORMAT); int maxSize = services.getProps().getInt(QueryServices.MAX_MUTATION_SIZE_ATTRIB,QueryServicesOptions.DEFAULT_MAX_MUTATION_SIZE); Format dateTimeFormat = DateUtil.getDateFormatter(datePattern); formatters[PDataType.DATE.ordinal()] = dateTimeFormat; formatters[PDataType.TIME.ordinal()] = dateTimeFormat; this.metaData = metaData; this.mutationState = new MutationState(maxSize, this); }</code><technical_language>add a member variable, instead declare this final here, this: final ReadOnlyProps augmentedProps = new ReadOnlyProps(tmpAugmentedProps);</technical_language>

Target:
public PhoenixConnection(ConnectionQueryServices services, String url, Properties info, PMetaData metaData) throws SQLException { this.url = url; this.info = info == null ? new Properties() : new Properties(info); Map<String, String> existingProps = services.getProps().asMap(); Map<String, String> tmpAugmentedProps = Maps.newHashMapWithExpectedSize(existingProps.size() + info.size()); tmpAugmentedProps.putAll(existingProps); tmpAugmentedProps.putAll((Map)info); final ReadOnlyProps augmentedProps = new ReadOnlyProps(tmpAugmentedProps); this.services = new DelegateConnectionQueryServices(services) { @Override public ReadOnlyProps getProps() { return augmentedProps; } }; this.scn = JDBCUtil.getCurrentSCN(url, this.info); this.tenantId = JDBCUtil.getTenantId(url, this.info); this.mutateBatchSize = JDBCUtil.getMutateBatchSize(url, this.info, services.getProps()); datePattern = services.getProps().get(QueryServices.DATE_FORMAT_ATTRIB, DateUtil.DEFAULT_DATE_FORMAT); int maxSize = services.getProps().getInt(QueryServices.MAX_MUTATION_SIZE_ATTRIB,QueryServicesOptions.DEFAULT_MAX_MUTATION_SIZE); Format dateTimeFormat = DateUtil.getDateFormatter(datePattern); formatters[PDataType.DATE.ordinal()] = dateTimeFormat; formatters[PDataType.TIME.ordinal()] = dateTimeFormat; this.metaData = metaData; this.mutationState = new MutationState(maxSize, this); }
Source:
<code>public void appThemeDefined_getsLumoAsTheme() { Mockito.when(classFinder.getSubTypesOf(AppShellConfigurator.class)) .thenReturn(Collections.singleton(MyAppThemeShell.class)); <START> FrontendDependencies dependencies = new FrontendDependencies(classFinder, false);; <END> Assert.assertEquals("Faulty default theme received", FakeLumo.class, dependencies.getThemeDefinition().getTheme()); }</code><technical_language>suggestion FrontendDependencies dependencies = new FrontendDependencies(classFinder, false);</technical_language>

Target:
public void appThemeDefined_getsLumoAsTheme() { Mockito.when(classFinder.getSubTypesOf(AppShellConfigurator.class)) .thenReturn(Collections.singleton(MyAppThemeShell.class)); FrontendDependencies dependencies = new FrontendDependencies(classFinder, false); Assert.assertEquals("Faulty default theme received", FakeLumo.class, dependencies.getThemeDefinition().getTheme()); }
Source:
<code>private List<Object> readList() { if (readChar() != '[') throw new AssertionError(); List<Object> result = new ArrayList<Object>(); while (true) { if (peekChar() == ']') { pos++; return result; } result.add(readValue()); char c = peekChar(); if (c == ',') { pos++; } else if (c != ']') { <START> throw unexpected("expected ',' or '" + ']' + "'"); <END> } } }</code><technical_language>nit: simplify this (no need do string concatenation)</technical_language>

Target:
private List<Object> readList() { if (readChar() != '[') throw new AssertionError(); List<Object> result = new ArrayList<Object>(); while (true) { if (peekChar() == ']') { pos++; return result; } result.add(readValue()); char c = peekChar(); if (c == ',') { pos++; } else if (c != ']') { throw unexpected("expected ',' or ']'"); } } }
Source:
<code>private void writeMetrics(ch.qos.logback.classic.Logger logger, RollingFileAppender appender, String currentDate) { LOG.debug("Start writing metric with date to file ..", currentDate); String metric = new StringBuilder(currentDate).append(",") .append(flowName).append(",") .append(fileName).append(",") .append(totalEventsReadPerFile.get()).append(",") .append(totalEventsIngestedPerFile.get()).append(",") .append(minEventSizePerFile.get()).append(",") .append(calculateAverage(totalEventSizePerFile.get(), eventsPerFile.get())).append(",") .append(maxEventSizePerFile.get()).append(",") .append(minWriteLatencyPerStream.get()).append(",") .append(calculateAverage(totalWriteLatencyPerStream.get(), writesPerStream.get())).append(",") .append(maxWriteLatencyPerStream.get()).toString(); appender.doAppend(new LoggingEvent(loggerClass, logger, null, metric, null, null)); <START> LOG.debug("Successfully write metric with date: {}", currentDate); <END> }</code><technical_language>"Successfully wrote metric date: {}"</technical_language>

Target:
private void writeMetrics(ch.qos.logback.classic.Logger logger, RollingFileAppender appender, String currentDate) { LOG.debug("Start writing metric with date to file ..", currentDate); String metric = new StringBuilder(currentDate).append(",") .append(flowName).append(",") .append(fileName).append(",") .append(totalEventsReadPerFile.get()).append(",") .append(totalEventsIngestedPerFile.get()).append(",") .append(minEventSizePerFile.get()).append(",") .append(calculateAverage(totalEventSizePerFile.get(), eventsPerFile.get())).append(",") .append(maxEventSizePerFile.get()).append(",") .append(minWriteLatencyPerStream.get()).append(",") .append(calculateAverage(totalWriteLatencyPerStream.get(), writesPerStream.get())).append(",") .append(maxWriteLatencyPerStream.get()).toString(); appender.doAppend(new LoggingEvent(loggerClass, logger, null, metric, null, null)); LOG.debug("Successfully wrote metric with date: {}", currentDate); }
Source:
<code>private static List<android.icu.util.TimeZone> getIcuTimeZones(String countryIso) { if (countryIso == null) { if (DBG) Log.d(TAG, "getTimeZones(null): return empty list"); return Collections.emptyList(); } List<android.icu.util.TimeZone> timeZones = TimeZoneFinder.getInstance().lookupTimeZonesByCountry(countryIso); if (timeZones == null) { if (DBG) { Log.d(TAG, "getTimeZones(" + countryIso + "): returned null, converting to empty list"); } return Collections.emptyList(); } return <START> timeZones; <END> }</code><technical_language>if Lists unmodifiable for private functions, this converted for consistency</technical_language>

Target:
private static List<android.icu.util.TimeZone> getIcuTimeZones(String countryIso) { if (countryIso == null) { if (DBG) Log.d(TAG, "getIcuTimeZones(null): return empty list"); return Collections.emptyList(); } List<android.icu.util.TimeZone> timeZones = TimeZoneFinder.getInstance().lookupTimeZonesByCountry(countryIso); if (timeZones == null) { if (DBG) { Log.d(TAG, "getIcuTimeZones(" + countryIso + "): returned null, converting to empty list"); } return Collections.emptyList(); } return timeZones; }
Source:
<code>public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { try { <START> String inputValue = getInputValue(tuple, ptr); <END> String localeISOCode = getLocaleISOCode(tuple, ptr); Boolean useSpecialUpperCaseCollator = getUseSpecialUpperCaseCollator(tuple, ptr); Integer collatorStrength = getCollatorStrength(tuple, ptr); Integer collatorDecomposition = getCollatorDecomposition(tuple, ptr); Locale locale = LocaleUtils.get().getLocaleByIsoCode(localeISOCode); if(LOG.isDebugEnabled()) { LOG.debug(String.format("Locale: " + locale.toLanguageTag())); } LinguisticSort linguisticSort = LinguisticSort.get(locale); Collator collator = BooleanUtils.isTrue(useSpecialUpperCaseCollator) ? linguisticSort.getUpperCaseCollator(false) : linguisticSort.getCollator(); if (collatorStrength != null) { collator.setStrength(collatorStrength); } if (collatorDecomposition != null) { collator.setDecomposition(collatorDecomposition); } if(LOG.isDebugEnabled()) { LOG.debug(String.format("Collator: [strength: %d, decomposition: %d], Special-Upper-Case: %s", collator.getStrength(), collator.getDecomposition(), BooleanUtils.isTrue(useSpecialUpperCaseCollator))); } byte[] collationKeyByteArray = collator.getCollationKey(inputValue).toByteArray(); if(LOG.isDebugEnabled()) { LOG.debug("Collation key bytes: " + VarBinaryFormatter.INSTANCE.format(collationKeyByteArray)); } ptr.set(collationKeyByteArray); return true; } catch (ExpressionEvaluationException e) { LOG.debug("ExpressionEvaluationException caught: " + e.getMessage()); return false; } }</code><technical_language>evaluate method is called for row processing, want code possible. create a Collator local variable move code sets init() method. call init() method in CollationKeyFunction(List<Expression> children) constructor in overridden readFields method this (see InstrFunction for example): @Override public void readFields(DataInput input) throws IOException { super.readFields(input); init(); }</technical_language>

Target:
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { try { String inputValue = getInputString(tuple, ptr); byte[] collationKeyByteArray = collator.getCollationKey(inputValue).toByteArray(); if (LOG.isDebugEnabled()) { LOG.debug("Collation key bytes: " + VarBinaryFormatter.INSTANCE.format(collationKeyByteArray)); } ptr.set(collationKeyByteArray); return true; } catch (ExpressionEvaluationException e) { LOG.debug("ExpressionEvaluationException caught: " + e.getMessage()); return false; } }
Source:
<code>public double getCurrentSafely(int channel) throws InvalidSensorException { if (channel < 0) { return 0.0; } else if (channel <= 5) { readStatus(1); } else if (channel <= 11) { readStatus(2); } else if (channel <= 15) { readStatus(3); } else { <START> return 0.0; <END> } if (System.currentTimeMillis() - lastRead > PDP.MAX_AGE) { throw new InvalidSensorException("Can not read current for port " + channel + " from PDP"); } return cachedChannelCurrents[channel]; }</code><technical_language>log a warning here</technical_language>

Target:
public double getCurrentSafely(int channel) throws InvalidSensorException { if (channel < 0) { return 0.0; } else if (channel <= 5) { readStatus(1); } else if (channel <= 11) { readStatus(2); } else if (channel <= 15) { readStatus(3); } else { LogKitten.w("Trying to read PDP channel " + channel + ", which does not exist!"); return 0.0; } if (System.currentTimeMillis() - lastRead > PDP.MAX_AGE) { throw new InvalidSensorException("Can not read current for port " + channel + " from PDP"); } return cachedChannelCurrents[channel]; }
Source:
<code>public void testMinusBefore() throws IOException { <START> BundleFilterTimeRange filter = Configs.decodeObject(BundleFilterTimeRange.class, "time:TIME, before:-20160923, timeFormat:YYYYMMdd"); <END> assertFalse(filter.filter(bundle)); }</code><technical_language>before:-20160923, timeFormat:YYYYMMdd is misleading reader for match timeFormat, while in reality a starting a - number of days timeFormat is parse it. before:-10000 better</technical_language>

Target:
public void testMinusBefore() throws IOException { BundleFilterTimeRange filter = Configs.decodeObject(BundleFilterTimeRange.class, "time:TIME, before:-100000"); assertFalse(filter.filter(bundle)); }
Source:
<code>public final AbstractAuthenticationToken convert(Jwt jwt) { Collection<GrantedAuthority> authorities = extractAuthorities(jwt); if (this.principalClaimName == null) { return new JwtAuthenticationToken(jwt, authorities); } <START> Object principalClaimValue = jwt.getClaim(this.principalClaimName); <END> Assert.isInstanceOf(String.class, principalClaimValue, "Value of principalClaimName must be of type String"); return new JwtAuthenticationToken(jwt, authorities, (String) principalClaimValue); }</code><technical_language>call jwt.getClaimAsString(this.principalClaimName)? benefit is converter work for principals of other types. I this aligns AbstractAuthenticationToken#getName coerces principal a string. cc @jgrandja</technical_language>

Target:
public final AbstractAuthenticationToken convert(Jwt jwt) { Collection<GrantedAuthority> authorities = extractAuthorities(jwt); if (this.principalClaimName == null) { return new JwtAuthenticationToken(jwt, authorities); } String principalClaimValue = jwt.getClaimAsString(this.principalClaimName); return new JwtAuthenticationToken(jwt, authorities, principalClaimValue); }
Source:
<code>public void onGitReferenceUpdated(Event event) { Project.NameKey p = new Project.NameKey(event.getProjectName()); if (event.getRefName().equals(RefNames.REFS_CONFIG)) { try { ProjectConfig oldCfg = parseConfig(p, event.getOldObjectId()); ProjectConfig newCfg = parseConfig(p, event.getNewObjectId()); if (oldCfg != null && newCfg != null) { for (Entry<ProjectConfigEntry> e : pluginConfigEntries) { ProjectConfigEntry configEntry = e.getProvider().get(); String newValue = getValue(newCfg, e); String oldValue = getValue(oldCfg, e); if <START> ((newValue == null && oldValue != null) || !newValue.equals(oldValue)) { <END> switch (configEntry.getType()) { case BOOLEAN: configEntry.onUpdate(p, oldValue != null ? Boolean.parseBoolean(oldValue) : null, newValue != null ? Boolean.parseBoolean(newValue) : null); break; case INT: configEntry.onUpdate(p, oldValue != null ? Integer.parseInt(oldValue) : null, newValue != null ? Integer.parseInt(newValue) : null); break; case LONG: configEntry.onUpdate(p, oldValue != null ? Long.parseLong(oldValue) : null, newValue != null ? Long.parseLong(newValue) : null); break; case LIST: case STRING: default: configEntry.onUpdate(p, oldValue, newValue); } } } } } catch (IOException | ConfigInvalidException e) { log.error(String.format( "Failed to check if plugin config of project %s was updated.", p.get()), e); } } }</code><technical_language>here: reverse condition logic continue</technical_language>

Target:
public void onGitReferenceUpdated(Event event) { Project.NameKey p = new Project.NameKey(event.getProjectName()); if (!event.getRefName().equals(RefNames.REFS_CONFIG)) { return; } try { ProjectConfig oldCfg = parseConfig(p, event.getOldObjectId()); ProjectConfig newCfg = parseConfig(p, event.getNewObjectId()); if (oldCfg != null && newCfg != null) { for (Entry<ProjectConfigEntry> e : pluginConfigEntries) { ProjectConfigEntry configEntry = e.getProvider().get(); String newValue = getValue(newCfg, e); String oldValue = getValue(oldCfg, e); if ((newValue == null && oldValue == null) || (newValue != null && newValue.equals(oldValue))) { return; } switch (configEntry.getType()) { case BOOLEAN: configEntry.onUpdate(p, toBoolean(oldValue), toBoolean(newValue)); break; case INT: configEntry.onUpdate(p, toInt(oldValue), toInt(newValue)); break; case LONG: configEntry.onUpdate(p, toLong(oldValue), toLong(newValue)); break; case LIST: case STRING: default: configEntry.onUpdate(p, oldValue, newValue); } } } } catch (IOException | ConfigInvalidException e) { log.error(String.format( "Failed to check if plugin config of project %s was updated.", p.get()), e); } }
Source:
<code><START> public void testBidirectionalSearch() { <END> Assert.assertEquals(Arrays.asList((String) null), searchForActions(ProblemFactory.getBidirectionalSearch( SimplifiedRoadMapOfPartOfRomania.ARAD, SimplifiedRoadMapOfPartOfRomania.ARAD))); Assert.assertEquals( Arrays.asList(new GoAction(SimplifiedRoadMapOfPartOfRomania.SIBIU), new GoAction(SimplifiedRoadMapOfPartOfRomania.FAGARAS)), searchForActions(ProblemFactory.getBidirectionalSearch( SimplifiedRoadMapOfPartOfRomania.ARAD, SimplifiedRoadMapOfPartOfRomania.BUCHAREST))); }</code><technical_language>unittest tests 2 things, split "start is goal" test "from sibiu fagaras" test</technical_language>

Target:
public void testBidirectionalSearch() { Pair<Problem<GoAction, InState>, Problem<GoAction, InState>> problemPairtest1 = ProblemFactory.getSimpleBidirectionalSearchProblem( SimplifiedRoadMapOfPartOfRomania.ARAD, SimplifiedRoadMapOfPartOfRomania.ARAD); Assert.assertEquals(Arrays.asList((String) null), searchForActions(problemPairtest1.getFirst(), problemPairtest1.getSecond())); Pair<Problem<GoAction, InState>, Problem<GoAction, InState>> problemPairtest2 = ProblemFactory.getSimpleBidirectionalSearchProblem( SimplifiedRoadMapOfPartOfRomania.ARAD, SimplifiedRoadMapOfPartOfRomania.BUCHAREST); Assert.assertEquals( Arrays.asList(new GoAction(SimplifiedRoadMapOfPartOfRomania.SIBIU), new GoAction(SimplifiedRoadMapOfPartOfRomania.FAGARAS)), searchForActions(problemPairtest2.getFirst(), problemPairtest2.getSecond())); Pair<Problem<GoAction, InState>, Problem<GoAction, InState>> problemPairtest3 = ProblemFactory.getSimpleBidirectionalSearchProblem( SimplifiedRoadMapOfPartOfRomania.SIBIU, SimplifiedRoadMapOfPartOfRomania.TIMISOARA); Assert.assertEquals( Arrays.asList(new GoAction(SimplifiedRoadMapOfPartOfRomania.ARAD)), searchForActions(problemPairtest3.getFirst(), problemPairtest3.getSecond())); }
Source:
<code>public void purge(Publisher publisher, Set<Publisher> equivalencesToRetainAsAliases) { Iterator<Content> content = contentLister.listContent( new ContentListingCriteria.Builder() .forPublisher(publisher) .build() ); while (content.hasNext()) { <START> Content c = (Content) content.next(); <END> retainEquivalencesAsAliases(c, equivalencesToRetainAsAliases); removeAllEquivalences(c); deleteContent(c); } }</code><technical_language>Is this Content</technical_language>

Target:
public void purge(Publisher publisher, Set<Publisher> equivalencesToRetainAsAliases) { Iterator<Content> contentIterator = contentLister.listContent( new ContentListingCriteria.Builder() .forPublisher(publisher) .build() ); while (contentIterator.hasNext()) { Content c = contentIterator.next(); retainEquivalencesAsAliases(c, equivalencesToRetainAsAliases); removeAllEquivalences(c); deleteContent(c); } }
Source:
<code>public static RyaStatement readFromKryo(Kryo kryo, Input input, Class<RyaStatement> type){ String subject = input.readString(); String predicate = input.readString(); String objectType = input.readString(); String objectValue = input.readString(); RyaType value; if (objectType.equals("<LINK_0>")){ value = new RyaURI(objectValue); } else { value = new RyaType(new URIImpl(objectType), objectValue); } RyaStatement statement = new RyaStatement(new RyaURI(subject), new RyaURI(predicate), value); int length = 0; boolean hasNextValue = input.readBoolean(); if (hasNextValue){ statement.setContext(new RyaURI(input.readString())); } hasNextValue = input.readBoolean(); if (hasNextValue){ length = input.readInt(); statement.setColumnVisibility(input.readBytes(length)); } hasNextValue = input.readBoolean(); if (hasNextValue){ statement.setQualifer(input.readString()); } hasNextValue = input.readBoolean(); if (hasNextValue){ <START> statement.setTimestamp(input.readLong()); <END> } hasNextValue = input.readBoolean(); if (hasNextValue){ length = input.readInt(); statement.setValue(input.readBytes(length)); } return statement; }</code><technical_language>This method public static RyaStatement read(Input input) identical. delegate other I ignoring kryo type parameters</technical_language>

Target:
public static RyaStatement readFromKryo(Kryo kryo, Input input, Class<RyaStatement> type){ return read(input); }
Source:
<code>protected Diagram createSubdiagram() { View contextView = getContextObject(); State contextElement = (State) contextView.getElement(); Diagram subdiagram = ViewService.createDiagram(contextElement, StatechartDiagramEditor.ID, preferencesHint); View figureCompartment = ViewUtil.getChildBySemanticHint(contextView, SemanticHints.STATE_FIGURE_COMPARTMENT); getResource().getContents().add(subdiagram); boolean isHorizontal = isHorizontal(figureCompartment); int offset = 0; int subregions = figureCompartment.getChildren().size(); while (figureCompartment.getChildren().size() > 0) { Node child = (Node) figureCompartment.getChildren().get(0); if (subregions > 1) { Rectangle actualBounds = getActualBounds(child); if (actualBounds != Rectangle.SINGLETON) { Bounds modelBounds = (Bounds) child.getLayoutConstraint(); modelBounds.setWidth(actualBounds.width()); modelBounds.setHeight(actualBounds.height()); if (isHorizontal) { modelBounds.setX(offset); offset += actualBounds.width(); } else { modelBounds.setY(offset); offset += actualBounds.height(); } } } subdiagram.insertChild(child); } @SuppressWarnings("unchecked") List<Edge> edges = figureCompartment.getDiagram().getEdges(); List<Edge> moveEdges = edges.stream().filter( (edge) -> edge.getSource().getDiagram() == subdiagram && edge.getTarget().getDiagram() == subdiagram) .collect(Collectors.toList()); for (Edge edge2 : moveEdges) { subdiagram.insertEdge(edge2); } <START> <END> return subdiagram; }</code><technical_language>put in line forEach filter</technical_language>

Target:
protected Diagram createSubdiagram() { View contextView = getContextObject(); State contextElement = (State) contextView.getElement(); Diagram subdiagram = ViewService.createDiagram(contextElement, StatechartDiagramEditor.ID, preferencesHint); View figureCompartment = ViewUtil.getChildBySemanticHint(contextView, SemanticHints.STATE_FIGURE_COMPARTMENT); getResource().getContents().add(subdiagram); boolean isHorizontal = isHorizontal(figureCompartment); int offset = 0; int subregions = figureCompartment.getChildren().size(); while (figureCompartment.getChildren().size() > 0) { Node child = (Node) figureCompartment.getChildren().get(0); if (subregions > 1) { Rectangle actualBounds = getActualBounds(child); if (actualBounds != Rectangle.SINGLETON) { Bounds modelBounds = (Bounds) child.getLayoutConstraint(); modelBounds.setWidth(actualBounds.width()); modelBounds.setHeight(actualBounds.height()); if (isHorizontal) { modelBounds.setX(offset); offset += actualBounds.width(); } else { modelBounds.setY(offset); offset += actualBounds.height(); } } } subdiagram.insertChild(child); } @SuppressWarnings("unchecked") List<Edge> edges = figureCompartment.getDiagram().getEdges(); edges.stream().filter( (edge) -> edge.getSource().getDiagram() == subdiagram && edge.getTarget().getDiagram() == subdiagram) .forEach((edge) -> subdiagram.insertEdge(edge)); return subdiagram; }
Source:
<code>public void deleteTask(TaskDefinition task) throws SchedulerException { <START> if (Context.getSchedulerService().getTaskByName(task.getName()).getStarted()) { <END> Context.getSchedulerService().shutdownTask(task); } Context.getSchedulerService().deleteTask(task.getId()); }</code><technical_language>is of this logic? care of service layer? Context.getSchedulerService().deleteTask</technical_language>

Target:
public void deleteTask(TaskDefinition task) throws SchedulerException { Context.getSchedulerService().deleteTask(task.getId()); }
Source:
<code>public void askingForANonExistingEventTypeResultsIn404() throws Exception { when(repo.findByName(anyString())).thenThrow(new NoSuchEventTypeException("no such event type")); final MockHttpServletRequestBuilder requestBuilder = get("/event-types/" + EVENT_TYPE_NAME) .accept(APPLICATION_JSON); mockMvc.perform(requestBuilder) <START> .andExpect(status().is(404)); <END> }</code><technical_language>good check content matches problem expect</technical_language>

Target:
public void askingForANonExistingEventTypeResultsIn404() throws Exception { when(repo.findByName(anyString())).thenThrow(new NoSuchEventTypeException("no such event type")); final MockHttpServletRequestBuilder requestBuilder = get("/event-types/" + EVENT_TYPE_NAME) .accept(APPLICATION_JSON); final ThrowableProblem expectedProblem = Problem.valueOf(NOT_FOUND, "EventType '" + EVENT_TYPE_NAME + "' does not exist."); mockMvc.perform(requestBuilder) .andExpect(status().is(404)) .andExpect(content().contentTypeCompatibleWith("application/problem+json")) .andExpect(content().string(matchesProblem(expectedProblem))); }
Source:
<code>default void addLore(int index, String... lore) { List<String> curr = lore(); if (curr.isEmpty() || index == curr.size()) { curr.addAll(Arrays.asList(lore)); } else { curr.addAll(index, Arrays.asList(lore)); } <START> setLore(curr); <END> }</code><technical_language>forgotten return, this results in writes setLore</technical_language>

Target:
default void addLore(int index, String... lore) { List<String> curr = lore(); if (curr == null) curr = Lists.newArrayList(); if (curr.isEmpty() || index == curr.size()) { curr.addAll(Arrays.asList(lore)); } else { curr.addAll(index, Arrays.asList(lore)); } setLore(curr); }
Source:
<code>public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj != null && obj.getClass() == getClass()) { IntermediateResultPartitionID that = (IntermediateResultPartitionID) obj; <START> return that.intermediateDataSetID.getLowerPart() == this.intermediateDataSetID.getLowerPart() <END> && that.intermediateDataSetID.getUpperPart() == this.intermediateDataSetID.getUpperPart() && that.partitionNum == this.partitionNum; } else { return false; } }</code><technical_language>consider implement IntermediateResultPartitionID#equals(...)</technical_language>

Target:
public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj != null && obj.getClass() == getClass()) { IntermediateResultPartitionID that = (IntermediateResultPartitionID) obj; return that.intermediateDataSetID.equals(this.intermediateDataSetID) && that.partitionNum == this.partitionNum; } else { return false; } }
Source:
<code>protected ScenarioResultMetadata extractResultMetadata(Map<String, Object> requestContext, ScenarioWithIndex scenarioWithIndex) { CoverageAgendaListener coverageAgendaListener = (CoverageAgendaListener) requestContext.get(COVERAGE_LISTENER); Map<String, Integer> ruleExecuted = coverageAgendaListener.getRuleExecuted(); Set<String> availableRules = (Set<String>) requestContext.get(RULES_AVAILABLE); ScenarioResultMetadata scenarioResultMetadata = new ScenarioResultMetadata(scenarioWithIndex); scenarioResultMetadata.addAllAvailable(availableRules); scenarioResultMetadata.addAllExecuted(ruleExecuted); final AtomicInteger counter = new AtomicInteger(0); coverageAgendaListener .getAuditsMessages().forEach(auditMessage -> { <START> String message = "Execution # " + counter.addAndGet(1) + " - " + auditMessage; <END> scenarioResultMetadata.addAuditMessage(message, "INFO"); }); return scenarioResultMetadata; }</code><technical_language>question here, this ID</technical_language>

Target:
protected ScenarioResultMetadata extractResultMetadata(Map<String, Object> requestContext, ScenarioWithIndex scenarioWithIndex) { CoverageAgendaListener coverageAgendaListener = (CoverageAgendaListener) requestContext.get(COVERAGE_LISTENER); Map<String, Integer> ruleExecuted = coverageAgendaListener.getRuleExecuted(); Set<String> availableRules = (Set<String>) requestContext.get(RULES_AVAILABLE); ScenarioResultMetadata scenarioResultMetadata = new ScenarioResultMetadata(scenarioWithIndex); scenarioResultMetadata.addAllAvailable(availableRules); scenarioResultMetadata.addAllExecuted(ruleExecuted); final AtomicInteger counter = new AtomicInteger(0); coverageAgendaListener .getAuditsMessages().forEach(auditMessage -> scenarioResultMetadata.addAuditMessage(counter.addAndGet(1), auditMessage, "INFO")); return scenarioResultMetadata; }
Source:
<code>protected void removeToken(final String token) { validateToken(token); try { aliasService.removeAliasForCluster(AliasService.NO_CLUSTER_NAME, token); aliasService.removeAliasForCluster(AliasService.NO_CLUSTER_NAME,token + "TOKEN_MAX_LIFETIME_POSTFIX"); } catch (AliasServiceException e) { <START> log.errorAccessingTokenState(e); <END> } }</code><technical_language>this log message change</technical_language>

Target:
protected void removeToken(final String token) { validateToken(token); try { aliasService.removeAliasForCluster(AliasService.NO_CLUSTER_NAME, token); aliasService.removeAliasForCluster(AliasService.NO_CLUSTER_NAME,token + TOKEN_MAX_LIFETIME_POSTFIX); log.removedTokenState(getTokenDisplayText(token)); } catch (AliasServiceException e) { log.failedToRemoveTokenState(getTokenDisplayText(token), e); } }
Source:
<code>private void syncCollapses(final List<String> expandedCollapses) { final Form currentForm = renderer.getCurrentForm(); if (!expandedCollapses.isEmpty()) { currentForm.getFields() .stream() <START> .filter(formField -> expandedCollapses.contains(formField.getFieldName()) && formField.getContainer() instanceof CollapsibleFormGroup) <END> .map(formField -> (CollapsibleFormGroup) formField.getContainer()) .forEach(CollapsibleFormGroup::expand); } else { currentForm.getFields() .stream() .filter(formField -> formField.getContainer() instanceof CollapsibleFormGroup) .findFirst() .map(formField -> (CollapsibleFormGroup)formField.getContainer()) .ifPresent(CollapsibleFormGroup::expand); } }</code><technical_language>part of filter formField.getContainer() instanceof CollapsibleFormGroup is needed, this is ensured part of condition (expandedCollapses populated fields fullfill this condition - filter in doRender method)</technical_language>

Target:
private void syncCollapses(final List<String> expandedCollapses) { final Stream<FormField> formFields = renderer.getCurrentForm().getFields().stream() .filter(this::checkCollapsibleGroup); if (!expandedCollapses.isEmpty()) { formFields.filter(formField -> expandedCollapses.contains(formField.getFieldName())) .map(this::toFormGroup) .forEach(CollapsibleFormGroup::expand); } else { formFields.findFirst() .map(this::toFormGroup) .ifPresent(CollapsibleFormGroup::expand); } }
Source:
<code>protected Object handleResumeOperation(HttpRequest httpRequest, OperationDescription operationDescription, SwaggerMethodParser methodParser, Type returnType, Context context) <START> throws Exception { <END> throw logger.logExceptionAsError(new RuntimeException("The resume operation is not available in the base RestProxy class.")); }</code><technical_language>If change throwing RuntimeException need remove this checked throw RuntimeExceptions unchecked</technical_language>

Target:
protected Object handleResumeOperation(HttpRequest httpRequest, OperationDescription operationDescription, SwaggerMethodParser methodParser, Type returnType, Context context) throws Exception { throw new Exception("The resume operation is not available in the base RestProxy class."); }