auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void scrollSelectedCellIntoView_CellSelected_WithDeltaXScroll() { when(gridData.getSelectedCellsOrigin()).thenReturn(new GridData.SelectedCell(0,0)); when(gridData.getRow(0)).thenReturn(gridRow); when(gridRow.getHeight()).thenReturn(30d); when(layer.getVisibleBounds()).thenReturn(new BaseBounds(500, 0, BOUNDS_WIDTH, BOUNDS_HEIGHT)); assertTrue(baseKeyboardOperationSpy.scrollSelectedCellIntoView(gridWidget)); verify(layer, times(1)).getViewport(); <START> verify(viewport, times(1)).getTransform(); <END> }</code><technical_language>.. able assert Transform offset X is correctly set here</technical_language>

Target:
public void scrollSelectedCellIntoView_CellSelected_WithDeltaXScroll() { when(gridData.getSelectedCellsOrigin()).thenReturn(new GridData.SelectedCell(0,0)); when(gridData.getRow(0)).thenReturn(gridRow); when(gridRow.getHeight()).thenReturn(30d); when(layer.getVisibleBounds()).thenReturn(new BaseBounds(500, 0, BOUNDS_WIDTH, BOUNDS_HEIGHT)); assertTrue(baseKeyboardOperationSpy.scrollSelectedCellIntoView(gridWidget)); verify(layer, times(1)).getViewport(); verify(viewport, times(1)).getTransform(); verify(transform, times(1)).scale(1, 1); verify(transform, times(1)).translate(500d, 0); }
Source:
<code>ClientConfiguration constructTokenClientConfig(ClientConfiguration apiClientConfiguration) { ClientConfiguration tokenClientConfiguration = new ClientConfiguration(); if (apiClientConfiguration.getClientCredentialsResolver() != null) tokenClientConfiguration.setClientCredentialsResolver(apiClientConfiguration.getClientCredentialsResolver()); <START> if (apiClientConfiguration.isCacheManagerEnabled()) <END> tokenClientConfiguration.setCacheManagerEnabled(apiClientConfiguration.isCacheManagerEnabled()); tokenClientConfiguration.setCacheManagerTti(apiClientConfiguration.getCacheManagerTti()); tokenClientConfiguration.setCacheManagerTtl(apiClientConfiguration.getCacheManagerTtl()); if (apiClientConfiguration.getCacheManagerCaches() != null) tokenClientConfiguration.setCacheManagerCaches(apiClientConfiguration.getCacheManagerCaches()); if (apiClientConfiguration.getRequestAuthenticatorFactory() != null) tokenClientConfiguration.setRequestAuthenticatorFactory(apiClientConfiguration.getRequestAuthenticatorFactory()); if (apiClientConfiguration.getBaseUrlResolver() != null) tokenClientConfiguration.setBaseUrlResolver(apiClientConfiguration.getBaseUrlResolver()); tokenClientConfiguration.setAuthenticationScheme(AuthenticationScheme.OAUTH2); tokenClientConfiguration.setAuthorizationMode(AuthorizationMode.PRIVATE_KEY); tokenClientConfiguration.setClientId(apiClientConfiguration.getClientId()); tokenClientConfiguration.setScopes(apiClientConfiguration.getScopes()); tokenClientConfiguration.setPrivateKey(apiClientConfiguration.getPrivateKey()); tokenClientConfiguration.setRetryMaxElapsed(0); tokenClientConfiguration.setRetryMaxAttempts(1); return tokenClientConfiguration; }</code><technical_language>want disabled Cache manager for token client</technical_language>

Target:
ClientConfiguration constructTokenClientConfig(ClientConfiguration apiClientConfiguration) { ClientConfiguration tokenClientConfiguration = new ClientConfiguration(); tokenClientConfiguration.setClientCredentialsResolver( new DefaultClientCredentialsResolver(() -> Optional.empty())); tokenClientConfiguration.setRequestAuthenticator(new DisabledAuthenticator()); tokenClientConfiguration.setCacheManagerEnabled(false); if (apiClientConfiguration.getBaseUrlResolver() != null) tokenClientConfiguration.setBaseUrlResolver(apiClientConfiguration.getBaseUrlResolver()); if (apiClientConfiguration.getProxy() != null) tokenClientConfiguration.setProxy(apiClientConfiguration.getProxy()); tokenClientConfiguration.setAuthenticationScheme(AuthenticationScheme.NONE); tokenClientConfiguration.setAuthorizationMode(AuthorizationMode.get(tokenClientConfiguration.getAuthenticationScheme())); tokenClientConfiguration.setClientId(apiClientConfiguration.getClientId()); tokenClientConfiguration.setScopes(apiClientConfiguration.getScopes()); tokenClientConfiguration.setPrivateKey(apiClientConfiguration.getPrivateKey()); tokenClientConfiguration.setRetryMaxElapsed(0); tokenClientConfiguration.setRetryMaxAttempts(1); return tokenClientConfiguration; }
Source:
<code>private Collection<Violation> runValidation(final String file, final boolean result) throws IOException { final Environment.Mock mock = new Environment.Mock(); final File license = this.rule.savePackageInfo( new File(mock.basedir(), CheckstyleValidatorTest.DIRECTORY) ).withLines(CheckstyleValidatorTest.LICENSE) .withEol("\n").file(); final Environment env = mock.withParam( CheckstyleValidatorTest.LICENSE_PROP, this.toUrl(license) ) .withFile( String.format("src/main/java/foo/%s", file), IOUtils.toString( <START> this.getClass().getResourceAsStream(file), <END> Charset.defaultCharset() ) ); final Collection<Violation> results = new CheckstyleValidator(env).validate( env.files(file) ); if (result) { MatcherAssert.assertThat( results, Matchers.<Violation>empty() ); } else { MatcherAssert.assertThat( results, Matchers.not(Matchers.<Violation>empty()) ); } return results; }</code><technical_language>@korthout cactoos InputStreamOf load this file</technical_language>

Target:
private Collection<Violation> runValidation(final String file, final boolean result) throws IOException { final Environment.Mock mock = new Environment.Mock(); final File license = this.rule.savePackageInfo( new File(mock.basedir(), CheckstyleValidatorTest.DIRECTORY) ).withLines(CheckstyleValidatorTest.LICENSE) .withEol("\n").file(); final Environment env = mock.withParam( CheckstyleValidatorTest.LICENSE_PROP, this.toUrl(license) ) .withFile( String.format("src/main/java/foo/%s", file), new TextOf( new ResourceOf( new FormattedText("com/qulice/checkstyle/%s", file) ) ).asString() ); final Collection<Violation> results = new CheckstyleValidator(env).validate( env.files(file) ); if (result) { MatcherAssert.assertThat( results, Matchers.<Violation>empty() ); } else { MatcherAssert.assertThat( results, Matchers.not(Matchers.<Violation>empty()) ); } return results; }
Source:
<code>public void prepareTestProject() throws Exception { URL resource = getClass().getResource("/projects/plugins/JavaTestRunnerPlugin/testng-tests"); testProjectServiceClient.importProject( ws.getId(), Paths.get(resource.toURI()), PROJECT, ProjectTemplates.CONSOLE_JAVA_SIMPLE); ide.open(ws); ide.waitOpenedWorkspaceIsReadyToUse(); projectExplorer.waitItem(PROJECT); notifications.waitProgressPopupPanelClose(); <START> runCompileCommand(); <END> }</code><technical_language>checking running test command pallet</technical_language>

Target:
public void prepareTestProject() throws Exception { URL resource = getClass().getResource("/projects/plugins/JavaTestRunnerPlugin/testng-tests"); CompileCommand compileCommand = new CompileCommand(); testCommandServiceClient.createCommand(DtoConverter.asDto(compileCommand), ws.getId()); testProjectServiceClient.importProject( ws.getId(), Paths.get(resource.toURI()), PROJECT, ProjectTemplates.CONSOLE_JAVA_SIMPLE); ide.open(ws); loader.waitOnClosed(); projectExplorer.waitItem(PROJECT); notifications.waitProgressPopupPanelClose(); try { runCompileCommandByPallete(compileCommand); } catch (TimeoutException ex) { fail("Known random failure <LINK_0>"); } }
Source:
<code><START> public MetricServiceExecutorConf getWorkerMetricConf() { <END> return MetricServiceExecutorConf.newBuilder() .setMetricFlushPeriodMs(serverMetricFlushPeriodMs) .build(); }</code><technical_language>I this method getServerMetricConf()</technical_language>

Target:
public MetricServiceExecutorConf getWorkerMetricConf() { return MetricServiceExecutorConf.newBuilder() .setCustomMetricCodec(ETDolphinMetricMsgCodec.class) .build(); }
Source:
<code>public void testPKCS12() throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException { System.out.println("Testing PKCS12..."); Certificate jkscert = generateCertificate(); String filename = "testks.asdf"; String alias = "alias"; char[] password = "password".toCharArray(); generateKeyStoreWithKey(filename, "pkcs12", alias, password, jkscert); <START> generateKeyStoreWithKey(filename+"b", "pkcs12", alias, password, jkscert); <END> generateKeyStoreWithKey(filename+"c", "pkcs12", alias, password, jkscert); KeyStore loadedStore = KeyStoreUtil.loadKeyStore(providerSupplier, null, new FileInputStream(new File(workingDir, filename)), filename, password); Assert.assertNotNull(loadedStore); Certificate loadedCert = loadedStore.getCertificate(alias); Assert.assertEquals(jkscert, loadedCert); }</code><technical_language>is this good for</technical_language>

Target:
public void testPKCS12() throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException { System.out.println("Testing PKCS12..."); Certificate jkscert = generateCertificate(); String filename = "testks.asdf"; String alias = "alias"; char[] password = "password".toCharArray(); generateKeyStoreWithKey(filename, "pkcs12", alias, password, jkscert); KeyStore loadedStore = KeyStoreUtil.loadKeyStore(providerSupplier, null, new FileInputStream(new File(workingDir, filename)), filename, password); Assert.assertNotNull(loadedStore); Certificate loadedCert = loadedStore.getCertificate(alias); Assert.assertEquals(jkscert, loadedCert); }
Source:
<code>public CalDavConfig(List<String> calendar, Type type, int eventNr, Value value) { <START> super(); <END> this.calendar = calendar; this.type = type; this.eventNr = eventNr; this.value = value; }</code><technical_language>CalDavConfig "implements" BindingConfig. Do need a super() here</technical_language>

Target:
public CalDavConfig(List<String> calendar, Type type, int eventNr, Value value) { this.calendar = calendar; this.type = type; this.eventNr = eventNr; this.value = value; }
Source:
<code>public void processLeftData(final MistDataEvent input) { <START> System.out.print("before processLeftData" + state.toString()); <END> final HashMap<K, V> intermediateState = updateState((Tuple2)input.getValue(), state); final HashMap<K, V> output = generateOutput(intermediateState); LOG.log(Level.FINE, "{0} updates the state {1} with input {2} to {3}, and generates {4}", new Object[]{this.getClass().getName(), state, input, intermediateState, output}); input.setValue(output); outputEmitter.emitData(input); state = intermediateState; System.out.println(", after processLeftData" + state.toString()); }</code><technical_language>Please remove this print. for testing</technical_language>

Target:
public void processLeftData(final MistDataEvent input) { final HashMap<K, V> intermediateState = updateState((Tuple2)input.getValue(), state); final HashMap<K, V> output = generateOutput(intermediateState); LOG.log(Level.FINE, "{0} updates the state {1} with input {2} to {3}, and generates {4}", new Object[]{this.getClass().getName(), state, input, intermediateState, output}); input.setValue(output); outputEmitter.emitData(input); state = intermediateState; }
Source:
<code>private void sortFormList(ArrayList<FormInfo> forms, String sortingOrder) { if (sortingOrder.equals(SORT_BY_NAME)) { Collections.sort(forms, new Comparator<FormInfo>() { @Override public int compare(FormInfo lhs, FormInfo rhs) { int cmp = lhs.formDisplayName.compareToIgnoreCase(rhs.formDisplayName); if (cmp != 0) { return cmp; } cmp = lhs.tableId.compareToIgnoreCase(rhs.tableId); if (cmp != 0) { return cmp; } cmp = lhs.formId.compareToIgnoreCase(rhs.formId); if (cmp != 0) { return cmp; } cmp = lhs.formVersion.compareToIgnoreCase(rhs.formVersion); if (cmp != 0) { return cmp; } cmp = lhs.formDisplaySubtext.compareToIgnoreCase(rhs.formDisplaySubtext); return cmp; } }); } else if (sortingOrder.equals(SORT_BY_TABLEID)) { <START> Collections.sort(mItems, new Comparator<FormInfo>() { <END> @Override public int compare(FormInfo left, FormInfo right) { int cmp = left.tableId.compareToIgnoreCase(right.tableId); if (cmp != 0) { return cmp; } cmp = left.formDisplayName.compareToIgnoreCase(right.formDisplayName); if (cmp != 0) { return cmp; } cmp = left.formId.compareToIgnoreCase(right.formId); if (cmp != 0) { return cmp; } cmp = left.formVersion.compareToIgnoreCase(right.formVersion); if (cmp != 0) { return cmp; } cmp = left.formDisplaySubtext.compareToIgnoreCase(right.formDisplaySubtext); return cmp; } }); mAdapter.swapData(mItems); } }</code><technical_language>sort method parameter forms instance variable mItems. behave identically future changes break it</technical_language>

Target:
private void sortFormList(ArrayList<FormInfo> forms, String sortingOrder) { if (sortingOrder.equals(SORT_BY_NAME)) { Collections.sort(forms, new Comparator<FormInfo>() { @Override public int compare(FormInfo lhs, FormInfo rhs) { int cmp = lhs.formDisplayName.compareToIgnoreCase(rhs.formDisplayName); if (cmp != 0) { return cmp; } cmp = lhs.tableId.compareToIgnoreCase(rhs.tableId); if (cmp != 0) { return cmp; } cmp = lhs.formId.compareToIgnoreCase(rhs.formId); if (cmp != 0) { return cmp; } cmp = lhs.formVersion.compareToIgnoreCase(rhs.formVersion); if (cmp != 0) { return cmp; } cmp = lhs.formDisplaySubtext.compareToIgnoreCase(rhs.formDisplaySubtext); return cmp; } }); } else if (sortingOrder.equals(SORT_BY_TABLEID)) { Collections.sort(forms, new Comparator<FormInfo>() { @Override public int compare(FormInfo left, FormInfo right) { int cmp = left.tableId.compareToIgnoreCase(right.tableId); if (cmp != 0) { return cmp; } cmp = left.formDisplayName.compareToIgnoreCase(right.formDisplayName); if (cmp != 0) { return cmp; } cmp = left.formId.compareToIgnoreCase(right.formId); if (cmp != 0) { return cmp; } cmp = left.formVersion.compareToIgnoreCase(right.formVersion); if (cmp != 0) { return cmp; } cmp = left.formDisplaySubtext.compareToIgnoreCase(right.formDisplaySubtext); return cmp; } }); mAdapter.swapData(mItems); } }
Source:
<code>public String getSysprepFileName(int osId, Version version) { <START> return EngineLocalConfig.getInstance().expandString(getValueByVersion(idToUnameLookup.get(osId), "sysprepFileName", version)); <END> }</code><technical_language>remove of EngineLocalConfig.getInstance().expandString. return getValueByVersion..</technical_language>

Target:
public String getSysprepFileName(int osId, Version version) { return getValueByVersion(idToUnameLookup.get(osId), "sysprepFileName", version); }
Source:
<code>protected String getQueryString() throws IOException { String condition = null; if (properties.manualQuery.getValue()) { return properties.query.getStringValue(); } else { condition = properties.condition.getStringValue(); } StringBuilder sb = new StringBuilder(); boolean isUpperCase = properties.convertColumnsAndTableToUppercase.getValue(); sb.append("select "); int count = 0; for (Schema.Field se : getSchema().getFields()) { if (count++ > 0) { sb.append(", "); } <START> String fName = isUpperCase ? se.name() : "\"" + se.name() + "\""; <END> sb.append(fName); } sb.append(" from "); String tableName = isUpperCase ? properties.getTableName() : "\"" + properties.getTableName() + "\""; sb.append(tableName); if (condition != null && condition.trim().length() > 0) { sb.append(" where "); sb.append(condition); } return sb.toString(); }</code><technical_language>prevent creation of unneccessary Strings "\" " surrounded. opinion condition for appending " \"" name. Dmytro, do think</technical_language>

Target:
protected String getQueryString() throws IOException { String condition = null; if (properties.manualQuery.getValue()) { return properties.query.getStringValue(); } else { condition = properties.condition.getStringValue(); } StringBuilder sb = new StringBuilder(); boolean isUpperCase = properties.convertColumnsAndTableToUppercase.getValue(); sb.append("select "); int count = 0; for (Schema.Field se : getSchema().getFields()) { if (count++ > 0) { sb.append(", "); } String fName = isUpperCase ? se.name() : StringUtils.wrap(se.name(), '"'); sb.append(fName); } sb.append(" from "); String tableName = isUpperCase ? properties.getTableName() : StringUtils.wrap(properties.getTableName(), '"'); sb.append(tableName); if (condition != null && condition.trim().length() > 0) { sb.append(" where "); sb.append(condition); } return sb.toString(); }
Source:
<code>public static RawText load(ObjectLoader ldr, int threshold) throws IOException, BinaryBlobException { long sz = ldr.getSize(); if (threshold < FIRST_FEW_BYTES) { threshold = FIRST_FEW_BYTES; } if (sz > threshold) { throw new BinaryBlobException(); <START> } <END> if (sz <= FIRST_FEW_BYTES) { byte []data = ldr.getCachedBytes(FIRST_FEW_BYTES); if (isBinary(data)) { throw new BinaryBlobException(); } return new RawText(data); } byte head[] = new byte[FIRST_FEW_BYTES]; try (InputStream stream = ldr.openStream()) { int off = 0; int left = head.length; while (left > 0) { int n = stream.read(head, off, left); if (n < 0) { throw new IllegalStateException("negative read"); } left -= n; off += n; } if (isBinary(head)) { throw new BinaryBlobException(); } byte data[]; try { data = new byte[(int)sz]; } catch (OutOfMemoryError e) { throw new LargeObjectException.OutOfMemory(e); } System.arraycopy(head, 0, data, 0, head.length); IO.readFully(stream, data, off, (int) (sz-off)); return new RawText(data); } }</code><technical_language>Optional: save some casting if do: if (ldr.getSize() > threshold) { throw } int sz = (int) ldr.getSize(); (It'd a stronger recommendation if more 1 2 int arithmetic operations sz.)</technical_language>

Target:
public static RawText load(ObjectLoader ldr, int threshold) throws IOException, BinaryBlobException { long sz = ldr.getSize(); if (threshold < FIRST_FEW_BYTES) { threshold = FIRST_FEW_BYTES; } if (sz > threshold) { throw new BinaryBlobException(); } if (sz <= FIRST_FEW_BYTES) { byte[] data = ldr.getCachedBytes(FIRST_FEW_BYTES); if (isBinary(data)) { throw new BinaryBlobException(); } return new RawText(data); } byte[] head = new byte[FIRST_FEW_BYTES]; try (InputStream stream = ldr.openStream()) { int off = 0; int left = head.length; while (left > 0) { int n = stream.read(head, off, left); if (n < 0) { throw new EOFException(); } left -= n; off += n; } if (isBinary(head)) { throw new BinaryBlobException(); } byte data[]; try { data = new byte[(int)sz]; } catch (OutOfMemoryError e) { throw new LargeObjectException.OutOfMemory(e); } System.arraycopy(head, 0, data, 0, head.length); IO.readFully(stream, data, off, (int) (sz-off)); return new RawText(data); } }
Source:
<code>public static String hash(File remoteFsRoot) { StringBuilder buf = new StringBuilder(); try { buf.append(remoteFsRoot.getCanonicalPath()).append('\n'); } catch (IOException e) { buf.append(remoteFsRoot.getAbsolutePath()).append('\n'); } try { for (NetworkInterface ni : Collections.list(NetworkInterface.getNetworkInterfaces())) { for (InetAddress ia : Collections.list(ni.getInetAddresses())) { if (ia instanceof Inet4Address) { buf.append(ia.getHostAddress()).append('\n'); } } <START> byte[] hardwareAddress = ni.getHardwareAddress(); <END> if (hardwareAddress != null) { buf.append(Arrays.toString(hardwareAddress)); } } } catch (SocketException e) { } return getDigestOf(buf.toString()).substring(0, 8); }</code><technical_language>for IPv6 hosts a machine is cloned this is break</technical_language>

Target:
public static String hash(File remoteFsRoot) { StringBuilder buf = new StringBuilder(); try { buf.append(remoteFsRoot.getCanonicalPath()).append('\n'); } catch (IOException e) { buf.append(remoteFsRoot.getAbsolutePath()).append('\n'); } try { for (NetworkInterface ni : Collections.list(NetworkInterface.getNetworkInterfaces())) { for (InetAddress ia : Collections.list(ni.getInetAddresses())) { if (ia instanceof Inet4Address) { buf.append(ia.getHostAddress()).append('\n'); } else if (ia instanceof Inet6Address) { buf.append(ia.getHostAddress()).append('\n'); } } byte[] hardwareAddress = ni.getHardwareAddress(); if (hardwareAddress != null) { buf.append(Arrays.toString(hardwareAddress)); } } } catch (SocketException e) { } return DigestUtils.md5Hex(buf.toString()).substring(0, 8); }
Source:
<code>public static Map<String,Object> sanitize(ConfigBag input) { <START> return Sanitizer.sanitize(input.getAllConfig()); <END> }</code><technical_language>call Sanitizer.sanitize(input)</technical_language>

Target:
public static Map<String,Object> sanitize(ConfigBag input) { return Sanitizer.sanitize(input ); }
Source:
<code>protected List<GroupModel> getLDAPGroupMappingsConverted() { if (cachedLDAPGroupMappings != null) { return new ArrayList<>(cachedLDAPGroupMappings); } List<LDAPObject> ldapGroups = getLDAPGroupMappings(ldapUser); <START> List<GroupModel> result = new ArrayList<>(); <END> for (LDAPObject ldapGroup : ldapGroups) { GroupModel kcGroup = findKcGroupOrSyncFromLDAP(realm, ldapGroup, this); if (kcGroup != null) { result.add(kcGroup); } } cachedLDAPGroupMappings = new HashSet<>(result); return result; }</code><technical_language>LinkedHashSet instead of ArrayList</technical_language>

Target:
protected Set<GroupModel> getLDAPGroupMappingsConverted() { if (cachedLDAPGroupMappings != null) { return new HashSet<>(cachedLDAPGroupMappings); } List<LDAPObject> ldapGroups = getLDAPGroupMappings(ldapUser); Set<GroupModel> result = new HashSet<>(); for (LDAPObject ldapGroup : ldapGroups) { GroupModel kcGroup = findKcGroupOrSyncFromLDAP(realm, ldapGroup, this); if (kcGroup != null) { result.add(kcGroup); } } cachedLDAPGroupMappings = new HashSet<>(result); return result; }
Source:
<code>private Map<String, DbParameterAccessor> readIntoParams( String[] queryParameters, String query) throws SQLException { <START> <END> try (CallableStatement dc = currentConnection.prepareCall(query)) { for (int i = 0; i < queryParameters.length; i++) { dc.setString(i + 1, queryParameters[i].toUpperCase()); } ResultSet rs = dc.executeQuery(); Map<String, DbParameterAccessor> allParams = new HashMap<String, DbParameterAccessor>(); int position = 0; while (rs.next()) { String paramName = rs.getString(1); if (paramName == null) { paramName = ""; } if (paramName.equals("")) { paramName = ""; } String dataType = rs.getString(2); String direction = rs.getString(4); Direction paramDirection; if (paramName.trim().toUpperCase().equals("")) { paramDirection = Direction.RETURN_VALUE; } else { paramDirection = getParameterDirection(direction); } int intSqlType = getSqlType(dataType); Class<?> clsJavaClass = getJavaClass(dataType); DbParameterAccessor dbp = new DbParameterAccessor(paramName, paramDirection, intSqlType, clsJavaClass, paramDirection == Direction.RETURN_VALUE ? -1 : position++); allParams.put(NameNormaliser.normaliseName(paramName), dbp); } return allParams; } }</code><technical_language>Trailing space too</technical_language>

Target:
private Map<String, DbParameterAccessor> readIntoParams( String[] queryParameters, String query) throws SQLException { try (CallableStatement dc = currentConnection.prepareCall(query)) { for (int i = 0; i < queryParameters.length; i++) { dc.setString(i + 1, queryParameters[i]); } ResultSet rs = dc.executeQuery(); Map<String, DbParameterAccessor> allParams = new HashMap<String, DbParameterAccessor>(); int position = 0; while (rs.next()) { String paramName = rs.getString(1); if (paramName == null) { paramName = ""; } if (paramName.equals("")) { paramName = ""; } String dataType = rs.getString(2); String direction = rs.getString(4); Direction paramDirection; if (paramName.trim().equals("")) { paramDirection = Direction.RETURN_VALUE; } else { paramDirection = getParameterDirection(direction); } int intSqlType = getSqlType(dataType); Class<?> clsJavaClass = getJavaClass(dataType); DbParameterAccessor dbp = new DbParameterAccessor(paramName, paramDirection, intSqlType, clsJavaClass, paramDirection == Direction.RETURN_VALUE ? -1 : position++); allParams.put(NameNormaliser.normaliseName(paramName), dbp); } return allParams; } }
Source:
<code>public FlowIdentifier updatePillarConfiguration(NameOrCrn nameOrCrn, Long workspaceId) { <START> Stack stack = stackService.getByNameOrCrnInWorkspace(nameOrCrn, workspaceId); <END> return clusterOperationService.updatePillarConfiguration(stack); }</code><technical_language>please add MDCBuilder.buildMdcContext(stack); this line. I missed in case of updateSalt, add</technical_language>

Target:
public FlowIdentifier updatePillarConfiguration(NameOrCrn nameOrCrn, Long workspaceId) { Stack stack = stackService.getByNameOrCrnInWorkspace(nameOrCrn, workspaceId); MDCBuilder.buildMdcContext(stack); if (!stack.isAvailable()) { throw new BadRequestException(String.format( "Stack '%s' is currently in '%s' state. Updates to the Pillar Configuration can " + "only be made when the underlying stack is 'AVAILABLE'.", stack.getName(), stack.getStatus())); } return clusterOperationService.updatePillarConfiguration(stack); }
Source:
<code>public void createBundleJar(File manifestFile) { Jar jarTask = (Jar) project.getTasks().findByName(JAR_TASK_NAME); <START> <END> jarTask.manifest( (Manifest mf) -> { mf.from(manifestFile); }); SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); jarTask.from(sourceSets.getByName(JAVA_MAIN_SOURCE_SET_NAME).getOutput()); jarTask.into( JAR_LIB_DESTINATION, (CopySpec cs) -> { cs.from(project.getConfigurations().getByName(RELEASE_CONFIG_NAME)); }); }</code><technical_language>nan</technical_language>

Target:
public void createBundleJar(File manifestFile) { Jar jarTask = (Jar) project.getTasks().findByName(JAR_TASK_NAME); if (jarTask == null) throw new GradleException("Unable to find the gradle task: " + JAR_TASK_NAME); jarTask.manifest((Manifest mf) -> mf.from(manifestFile)); SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); jarTask.from(sourceSets.getByName(JAVA_MAIN_SOURCE_SET_NAME).getOutput()); jarTask.into( JAR_LIB_DESTINATION, (CopySpec cs) -> cs.from(project.getConfigurations().getByName(RELEASE_CONFIG_NAME))); }
Source:
<code>protected void setIsExecuting(boolean value) { <START> synchronized (DefaultSchedulerMessageSource.this) { <END> executing = value; } }</code><technical_language>this</technical_language>

Target:
protected void setIsExecuting(boolean value) { synchronized (this) { executing = value; } }
Source:
<code>public CliCommand init(final Arguments args) throws Exception { this.bucketName = args.getBucket(); if (this.bucketName == null) { throw new MissingOptionException("The get physical placement command requires '-b' to be set."); } this.objectName = args.getObjectName(); if (this.objectName == null) { <START> throw new MissingOptionException("The get physical placement command requires '-o' to be set."); <END> } return this; }</code><technical_language>limiting a single object</technical_language>

Target:
public CliCommand init(final Arguments args) throws Exception { if (args.getDirectory() != null) { throw new UnrecognizedOptionException("The get_physical_placement command does not work with '-d' as it only applies to a single object."); } this.bucketName = args.getBucket(); if (this.bucketName == null) { throw new MissingOptionException("The get_physical_placement command requires '-b' to be set."); } this.objectName = args.getObjectName(); if (this.objectName == null) { throw new MissingOptionException("The get_physical_placement command requires '-o' to be set."); } return this; }
Source:
<code>Date getDateFromSeconds(Map<String, JsonNode> tree, String claimName) { JsonNode node = tree.get(claimName); if (node == null || node.isNull()) { return null; } if (!node.canConvertToLong()) { <START> throw new JWTDecodeException(String.format("The claim '%s' contained an unexpected value.", claimName)); <END> } final long ms = node.asLong() * 1000; return new Date(ms); }</code><technical_language>non-numeric</technical_language>

Target:
Date getDateFromSeconds(Map<String, JsonNode> tree, String claimName) { JsonNode node = tree.get(claimName); if (node == null || node.isNull()) { return null; } if (!node.canConvertToLong()) { throw new JWTDecodeException(String.format("The claim '%s' contained a non-numeric date value.", claimName)); } final long ms = node.asLong() * 1000; return new Date(ms); }
Source:
<code>public int compare(T o1, T o2) { for (int i = 0; i < propertyId.length; i++) { String currentProperty = propertyId[i].toString(); Comparator underlyingComparator = getUnderlyingComparator(currentProperty); Comparator currentComparator = underlyingComparator != null ? underlyingComparator : ComparableComparator.getInstance(); if (!ascending[i]) { <START> currentComparator = currentComparator.reversed(); <END> } Object o1Prop = getContainerProperty(o1, currentProperty).getValue(); Object o2Prop = getContainerProperty(o2, currentProperty).getValue(); int compare = currentComparator.compare(o1Prop, o2Prop); if (compare != 0) { return compare; } } return 0; }</code><technical_language>reversed is default method JDK8? change this in ReverseComparator Viritin supports JDK7</technical_language>

Target:
public int compare(T o1, T o2) { for (int i = 0; i < propertyId.length; i++) { String currentProperty = propertyId[i].toString(); Comparator underlyingComparator = getUnderlyingComparator(currentProperty); Comparator currentComparator = underlyingComparator != null ? underlyingComparator : ComparableComparator.getInstance(); if (!ascending[i]) { currentComparator = new ReverseComparator(currentComparator); } Object o1Prop = getContainerProperty(o1, currentProperty).getValue(); Object o2Prop = getContainerProperty(o2, currentProperty).getValue(); int compare = currentComparator.compare(o1Prop, o2Prop); if (compare != 0) { return compare; } } return 0; }
Source:
<code>public static void main(String[] argv) { log.info("Cleaning up asset store"); CommandLineParser parser = new PosixParser(); CommandLine line = null; Options options = new Options(); options.addOption("l", "leave", false, "Leave database records but delete file from assetstore"); options.addOption("b", "batchSize", true, "commitBatches, default 100"); options.addOption("v", "verbose", false, "Provide verbose output"); options.addOption("h", "help", false, "Help"); try { line = parser.parse(options, argv); if (line.hasOption('h')) { printHelp(options); } else { boolean deleteDbRecords = !line.hasOption('l'); boolean verbose = line.hasOption('v'); int commitBatch = 100; if (line.hasOption('b')) { try { commitBatch = Integer.parseInt(line.getOptionValue('b')); } catch (NumberFormatException ne) { throw new ParseException("batchSize must be greater equal 1"); } if (commitBatch < 1) { <START> throw new ParseException("batchSize must be greater equal 1"); <END> } } if (log.isDebugEnabled()) { log.debug("leave db records = " + deleteDbRecords); log.debug("batchSize = " + commitBatch); } if (verbose) { System.out.println("leave db records = " + deleteDbRecords); System.out.println("batchSize = " + commitBatch); } StorageServiceFactory.getInstance().getBitstreamStorageService().cleanup(deleteDbRecords, commitBatch, verbose); } } catch (Exception e) { log.fatal("Caught exception:", e); printHelp(options); System.exit(1); } }</code><technical_language>Nitpicking: 'batchsize greater equal 1"</technical_language>

Target:
public static void main(String[] argv) { log.info("Cleaning up asset store"); CommandLineParser parser = new PosixParser(); CommandLine line = null; Options options = new Options(); boolean deleteDbRecords = true; boolean verbose = false; int commitBatch = 100; options.addOption("l", "leave", false, "Leave database records but delete file from assetstore"); options.addOption("b", "batchSize", true, "commitBatches, default " + commitBatch); options.addOption("v", "verbose", false, "Provide verbose output"); options.addOption("h", "help", false, "Help"); try { line = parser.parse(options, argv); if (line.hasOption('h')) { printHelp(options); return; } else { deleteDbRecords = !line.hasOption('l'); verbose = line.hasOption('v'); if (line.hasOption('b')) { try { commitBatch = Integer.parseInt(line.getOptionValue('b')); } catch (NumberFormatException ne) { throw new RuntimeException( "'" + line.getOptionValue('b') + "' is not a positive integer"); } if (commitBatch < 1) { throw new RuntimeException( "batchSize must be greater or equal 1"); } } } } catch (Exception e) { System.err.println(e.getMessage()); printHelp(options); System.exit(1); } if (log.isDebugEnabled()) { log.debug("leave db records = " + !deleteDbRecords); log.debug("batchSize = " + commitBatch); } if (verbose) { System.out.println("leave db records = " + !deleteDbRecords); System.out.println("batchSize = " + commitBatch); } try { StorageServiceFactory.getInstance().getBitstreamStorageService().cleanup(deleteDbRecords, commitBatch, verbose); } catch (Exception e) { System.err.println(e.getMessage()); log.fatal("Caught exception:", e); System.exit(1); } }
Source:
<code>protected void executeCommand() { <START> vds_spm_id_map newMap = new vds_spm_id_map(getVds().getstorage_pool_id(), getVdsId(), 0); <END> DbFacade.getInstance().getVdsSpmIdMapDAO().save(newMap); if (getParameters().isCompensationEnabled()) { getCompensationContext().snapshotNewEntity(newMap); getCompensationContext().stateChanged(); } setSucceeded(true); }</code><technical_language>please add a constructor out spm_id</technical_language>

Target:
protected void executeCommand() { vds_spm_id_map newMap = new vds_spm_id_map(getVds().getstorage_pool_id(), getVdsId()); DbFacade.getInstance().getVdsSpmIdMapDAO().save(newMap); if (getParameters().isCompensationEnabled()) { getCompensationContext().snapshotNewEntity(newMap); getCompensationContext().stateChanged(); } setSucceeded(true); }
Source:
<code>public void addTraceMarker(ITmfTrace trace, long startTime, @ScriptParameter(defaultValue = DEFAULT_ENDTIME) long endTime, @ScriptParameter(defaultValue = DEFAULT_LABEL) @Nullable String label, @ScriptParameter(defaultValue = DEFAULT_CATEGORY) @Nullable String category, @ScriptParameter(defaultValue = DEFAULT_COLOR) @Nullable String color) throws NullPointerException, IllegalArgumentException { ScriptingMarkerSource source = getMarkerSource(trace); if (source == null) { try { source = findMarkerSourceFromAdapters(trace); if (source == null) { source = createMarkerSource(trace); } } <START> catch (NullPointerException e) { throw new NullPointerException(INVALID_TRACE); } <END> } try { TraceMarker traceMarker = createTraceMarker(trace, label, category, startTime, endTime, color); source.configureMarker(traceMarker); } catch (IllegalArgumentException e) { String markerName = label == null ? DEFAULT_LABEL : label; String exceptionMessage = e + " for marker : " + markerName + " at " + startTime; throw new IllegalArgumentException(exceptionMessage); } }</code><technical_language>Catching a runtime exception odd, especially rethrow it. on</technical_language>

Target:
public void addTraceMarker(ITmfTrace trace, long startTime, @ScriptParameter(defaultValue = DEFAULT_ENDTIME) long endTime, @ScriptParameter(defaultValue = DEFAULT_LABEL) @Nullable String label, @ScriptParameter(defaultValue = DEFAULT_CATEGORY) @Nullable String category, @ScriptParameter(defaultValue = DEFAULT_COLOR) @Nullable String color) throws NullPointerException, IllegalArgumentException { ScriptingMarkerSource source = getMarkerSource(trace); if (source == null) { try { source = findMarkerSourceFromAdapters(trace); if (source == null) { source = createMarkerSource(trace); } } catch (NullPointerException e) { throw new NullPointerException(INVALID_TRACE); } } try { TraceMarker traceMarker = createTraceMarker(trace, label, category, startTime, endTime, color); source.configureMarker(traceMarker); } catch (IllegalArgumentException e) { String markerName = label == null ? DEFAULT_LABEL : label; String exceptionMessage = e + " for marker : " + markerName + " at " + startTime; throw new IllegalArgumentException(exceptionMessage, e); } }
Source:
<code>public void testFailQuery() throws Exception { QueryManager queryManager = queryRunner.getCoordinator().getQueryManager(); QueryId queryId = queryManager.createQuery(new TestingSessionContext(TEST_SESSION), "SELECT * FROM lineitem").getQueryId(); while (true) { QueryInfo queryInfo = queryManager.getQueryInfo(queryId); if (queryInfo.getState().isDone()) { <START> assertEquals(queryInfo.getState(), FAILED); <END> throw queryInfo.getFailureInfo().toException(); } if (queryInfo.getState() == RUNNING) { break; } Thread.sleep(100); } queryManager.failQuery(queryId, new PrestoException(GENERIC_INTERNAL_ERROR, "mock exception")); QueryInfo queryInfo = queryManager.getQueryInfo(queryId); assertEquals(queryInfo.getState(), QueryState.FAILED); assertEquals(queryInfo.getErrorCode(), GENERIC_INTERNAL_ERROR.toErrorCode()); assertNotNull(queryInfo.getFailureInfo()); assertEquals(queryInfo.getFailureInfo().getMessage(), "mock exception"); }</code><technical_language>I find confusing assert state unexpected test is fail anyway. java fail("unexpected query state: " + query.getState()); This clear this is unexpected</technical_language>

Target:
public void testFailQuery() throws Exception { QueryManager queryManager = queryRunner.getCoordinator().getQueryManager(); QueryId queryId = queryManager.createQuery(new TestingSessionContext(TEST_SESSION), "SELECT * FROM lineitem").getQueryId(); while (true) { QueryInfo queryInfo = queryManager.getQueryInfo(queryId); if (queryInfo.getState().isDone()) { fail("unexpected query state: " + queryInfo.getState()); } if (queryInfo.getState() == RUNNING) { break; } Thread.sleep(100); } queryManager.failQuery(queryId, new PrestoException(GENERIC_INTERNAL_ERROR, "mock exception")); QueryInfo queryInfo = queryManager.getQueryInfo(queryId); assertEquals(queryInfo.getState(), QueryState.FAILED); assertEquals(queryInfo.getErrorCode(), GENERIC_INTERNAL_ERROR.toErrorCode()); assertNotNull(queryInfo.getFailureInfo()); assertEquals(queryInfo.getFailureInfo().getMessage(), "mock exception"); }
Source:
<code><START> public static int countLines(String str) { <END> String lineSeparator = System.lineSeparator(); if (str == null || str.isEmpty()) { return 0; } int lines = 1; int pos = 0; while ((pos = str.indexOf(lineSeparator, pos) + 1) != 0) { lines++; } return lines; }</code><technical_language>is CharMatcher.count</technical_language>

Target:
public static int countLines(String str) { return Lists.newArrayList(Splitter.on(System.lineSeparator()).split(str)).size(); }
Source:
<code>public void testSuccess() throws Exception { TransactionsGetRequest request = new TransactionsGetRequest(accessToken, startDate, endDate) .withCount(100); Response<TransactionsGetResponse> response = null; for (int i = 0; i < 5; i++) { response = client().service().transactionsGet(request).execute(); if (response.isSuccessful()) { break; } else { ErrorResponse errorResponse = client().parseError(response); assertEquals(errorResponse.getErrorCode(), "PRODUCT_NOT_READY"); <START> Thread.sleep(5000); <END> } } assertSuccessResponse(response); assertNotNull(response.body().getTotalTransactions()); assertNotNull(response.body().getItem()); assertNotNull(response.body().getAccounts()); assertFalse(response.body().getAccounts().isEmpty()); assertTrue(response.body().getTransactions().size() > 0); for (TransactionsGetResponse.Transaction txn : response.body().getTransactions()) { assertNotNull(txn.getTransactionId()); assertNotNull(txn.getAccountId()); assertNotNull(txn.getPending()); assertNotNull(txn.getTransactionType()); assertNotNull(txn.getPaymentMeta()); assertNotNull(txn.getDate()); assertNotNull(txn.getName()); assertNotNull(txn.getAmount()); assertNotNull(txn.getLocation()); assertNotNull(txn.getIsoCurrencyCode()); } }</code><technical_language>this number</technical_language>

Target:
public void testSuccess() throws Exception { TransactionsGetRequest request = new TransactionsGetRequest(accessToken, startDate, endDate) .withCount(100); Response<TransactionsGetResponse> response = null; for (int i = 0; i < 5; i++) { response = client().service().transactionsGet(request).execute(); if (response.isSuccessful()) { break; } else { ErrorResponse errorResponse = client().parseError(response); assertEquals(errorResponse.getErrorCode(), "PRODUCT_NOT_READY"); Thread.sleep(3000); } } assertSuccessResponse(response); assertNotNull(response.body().getTotalTransactions()); assertNotNull(response.body().getItem()); assertNotNull(response.body().getAccounts()); assertFalse(response.body().getAccounts().isEmpty()); assertTrue(response.body().getTransactions().size() > 0); for (TransactionsGetResponse.Transaction txn : response.body().getTransactions()) { assertNotNull(txn.getTransactionId()); assertNotNull(txn.getAccountId()); assertNotNull(txn.getPending()); assertNotNull(txn.getTransactionType()); assertNotNull(txn.getPaymentMeta()); assertNotNull(txn.getDate()); assertNotNull(txn.getName()); assertNotNull(txn.getAmount()); assertNotNull(txn.getLocation()); assertNotNull(txn.getIsoCurrencyCode()); } }
Source:
<code>public void stopGracefully() { try { synchronized (this) { if (!stopped) { stopped = true; if (isFirehoseDrainableByClosing(spec.getIOConfig().getFirehoseFactory())) { firehose.close(); <START> } <END> } } } catch (Exception e) { throw Throwables.propagate(e); } }</code><technical_language>add a debug log else case</technical_language>

Target:
public void stopGracefully() { try { synchronized (this) { if (!stopped) { stopped = true; log.info("Gracefully stopping."); if (isFirehoseDrainableByClosing(spec.getIOConfig().getFirehoseFactory())) { firehose.close(); } else { log.debug("Cannot drain firehose[%s] by closing, so skipping closing.", firehose); } } } } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
<code><START> public void setEnabledProtocols(String[] protocols) { <END> protocolsVerified = verifyEnabledProtocols(protocols); }</code><technical_language>I agree rationale this change, I improves test quality. thinking TestSSLSocket capture protocols passed setEnabledProtocols test code query assertions based that. a bit more flexibility assert moves assertion out of this mock object respective tests. TestSSLSocket socket = ... f.prepareSocket(socket) Assert.arrayEquals(socket.getCapturedProtocols(), expectedProtocols);</technical_language>

Target:
public void setEnabledProtocols(String[] protocols) { capturedProtocols = protocols; protocolsEnabled = true; }
Source:
<code>public void registerRenderers() { Block block; block = blockExperienceObelisk.getBlock(); if (block != null) { ObeliskSpecialRenderer<TileExperienceObelisk> eor = new ObeliskSpecialRenderer<TileExperienceObelisk>(new ItemStack(itemXpTransfer.getItem()), block); registerRenderer(block, TileExperienceObelisk.class, eor); } block = blockAttractorObelisk.getBlock(); if (block != null) { ObeliskSpecialRenderer<TileAttractor> eor = new ObeliskSpecialRenderer<TileAttractor>( <START> new ItemStack(ModObject.itemMaterial.getItem(), 1, Material.ATTRACTOR_CRYSTAL.ordinal()), block); <END> registerRenderer(block, TileAttractor.class, eor); } block = blockAversionObelisk.getBlock(); if (block != null) { AversionObeliskRenderer eor = new AversionObeliskRenderer(); registerRenderer(block, TileAversionObelisk.class, eor); } block = blockRelocatorObelisk.getBlock(); if (block != null) { RelocatorObeliskRenderer eor = new RelocatorObeliskRenderer(); registerRenderer(block, TileRelocatorObelisk.class, eor); } block = blockWeatherObelisk.getBlock(); if (block != null) { ObeliskSpecialRenderer<TileWeatherObelisk> eor = new WeatherObeliskSpecialRenderer(new ItemStack(Items.FIREWORKS)); registerRenderer(block, TileWeatherObelisk.class, eor); } block = blockInhibitorObelisk.getBlock(); if (block != null) { ObeliskSpecialRenderer<TileInhibitorObelisk> eor = new ObeliskSpecialRenderer<TileInhibitorObelisk>(new ItemStack(Items.ENDER_PEARL), block); registerRenderer(block, TileInhibitorObelisk.class, eor); } }</code><technical_language>need ordinal() for itemstack creation. item enums stack getters for enum: Material.ATTRACTOR_CRYSTAL.getStack()</technical_language>

Target:
public void registerRenderers() { Block block; block = blockExperienceObelisk.getBlock(); if (block != null) { ObeliskSpecialRenderer<TileExperienceObelisk> eor = new ObeliskSpecialRenderer<TileExperienceObelisk>(new ItemStack(ModObject.itemXpTransfer.getItem()), block); registerRenderer(block, TileExperienceObelisk.class, eor); } block = blockAttractorObelisk.getBlock(); if (block != null) { ObeliskSpecialRenderer<TileAttractor> eor = new ObeliskSpecialRenderer<TileAttractor>( Material.ATTRACTOR_CRYSTAL.getStack(), block); registerRenderer(block, TileAttractor.class, eor); } block = blockAversionObelisk.getBlock(); if (block != null) { AversionObeliskRenderer eor = new AversionObeliskRenderer(); registerRenderer(block, TileAversionObelisk.class, eor); } block = blockRelocatorObelisk.getBlock(); if (block != null) { RelocatorObeliskRenderer eor = new RelocatorObeliskRenderer(); registerRenderer(block, TileRelocatorObelisk.class, eor); } block = blockWeatherObelisk.getBlock(); if (block != null) { ObeliskSpecialRenderer<TileWeatherObelisk> eor = new WeatherObeliskSpecialRenderer(new ItemStack(Items.FIREWORKS)); registerRenderer(block, TileWeatherObelisk.class, eor); } block = blockInhibitorObelisk.getBlock(); if (block != null) { ObeliskSpecialRenderer<TileInhibitorObelisk> eor = new ObeliskSpecialRenderer<TileInhibitorObelisk>(new ItemStack(Items.ENDER_PEARL), block); registerRenderer(block, TileInhibitorObelisk.class, eor); } }
Source:
<code>public final void retrievesSingleKey() throws Exception { final PublicKeys keys = this.keys(); MatcherAssert.assertThat( <START> keys.get(1).toString(), <END> Matchers.endsWith("/keys/1") ); }</code><technical_language>if absent? In account absent, for example</technical_language>

Target:
public final void retrievesSingleKey() throws Exception { final PublicKeys keys = this.keys(); final PublicKey key = keys.create("Title", "Key"); MatcherAssert.assertThat( keys.get(key.number()), Matchers.equalTo(key) ); keys.remove(key.number()); }
Source:
<code>public Set<String> getAgents() throws AgentException { <START> return unmodifiableSet(agents.keySet()); <END> }</code><technical_language>agents map is modifiable all, do instance of ImmutableMap instead, need wrap keySet() a new unmodifiableSet instance time getAgents() is called</technical_language>

Target:
public List<String> getAgents() throws AgentException { return agentNames; }
Source:
<code>private static boolean hasError(MavenExecutionResult mavenExecutionResult) { return <START> mavenExecutionResult.getExceptions().stream().allMatch(ProjectBuildingException.class::isInstance) <END> && mavenExecutionResult.getExceptions().stream() .map(ProjectBuildingException.class::cast) .flatMap(ex -> ex.getResults().stream()) .flatMap(result -> result.getProblems().stream()) .map(ModelProblem::getSeverity) .allMatch(ModelProblem.Severity.WARNING::equals); }</code><technical_language>thinking more this: other exceptions treated errors, ...stream().anyMatch(e-> !(e instanceof ProjectBuildingException)) || !(all warnings)</technical_language>

Target:
private static boolean hasError(MavenExecutionResult mavenExecutionResult) { return mavenExecutionResult.getExceptions().stream().anyMatch(ex -> !(ex instanceof ProjectBuildingException)) || mavenExecutionResult.getExceptions().stream() .map(ProjectBuildingException.class::cast) .flatMap(ex -> ex.getResults().stream()) .flatMap(result -> result.getProblems().stream()) .map(ModelProblem::getSeverity) .anyMatch(severity -> severity != Severity.WARNING); }
Source:
<code><START> public static void map(VmPlacementPolicy placementPolicy, VmStatic staticVm) { <END> if (placementPolicy.isSetHost() && placementPolicy.getHost().isSetId()) { staticVm.setDedicatedVmForVds(GuidUtils.asGuid(placementPolicy.getHost().getId())); } if (placementPolicy.isSetAffinity()) { MigrationSupport migrationSupport = map(VmAffinity.fromValue(placementPolicy.getAffinity()), null); if (migrationSupport != null) { staticVm.setMigrationSupport(migrationSupport); } } }</code><technical_language>reuse mappings form VmMapper</technical_language>

Target:
public static void map(VmPlacementPolicy placementPolicy, VmStatic staticVm) { if (placementPolicy.isSetHost() && placementPolicy.getHost().isSetId()) { staticVm.setDedicatedVmForVds(GuidUtils.asGuid(placementPolicy.getHost().getId())); } if (placementPolicy.isSetAffinity()) { MigrationSupport migrationSupport = VmMapper.map(VmAffinity.fromValue(placementPolicy.getAffinity()), null); if (migrationSupport != null) { staticVm.setMigrationSupport(migrationSupport); } } }