auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void testExecute_instructorDeleteOwnRole_shouldPass() { InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); InstructorAttributes instructor2OfCourse1 = typicalBundle.instructors.get("instructor2OfCourse1"); <START> loginAsInstructor(instructor2OfCourse1.googleId); <END> String[] submissionParams = new String[] { Const.ParamsNames.INSTRUCTOR_ID, instructor2OfCourse1.googleId, Const.ParamsNames.COURSE_ID, instructor1OfCourse1.courseId, }; assertTrue(logic.getInstructorsForCourse(instructor1OfCourse1.courseId).size() > 1); DeleteInstructorAction deleteInstructorAction = getAction(submissionParams); JsonResult response = getJsonResult(deleteInstructorAction); assertEquals(HttpStatus.SC_OK, response.getStatusCode()); MessageOutput msg = (MessageOutput) response.getOutput(); assertEquals("OK", msg.getMessage()); InstructorsLogic instructorsLogic = InstructorsLogic.inst(); assertFalse(instructorsLogic.isEmailOfInstructorOfCourse(instructor2OfCourse1.email, instructor1OfCourse1.courseId)); assertTrue(instructorsLogic.isEmailOfInstructorOfCourse(instructor1OfCourse1.email, instructor1OfCourse1.courseId)); }</code><technical_language>leave testExecute empty properly name tests</technical_language>

Target:
protected void testExecute_instructorDeleteOwnRole_shouldPass() { InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); InstructorAttributes instructor2OfCourse1 = typicalBundle.instructors.get("instructor2OfCourse1"); loginAsInstructor(instructor2OfCourse1.googleId); String[] submissionParams = new String[] { Const.ParamsNames.INSTRUCTOR_ID, instructor2OfCourse1.googleId, Const.ParamsNames.COURSE_ID, instructor1OfCourse1.courseId, }; assertTrue(logic.getInstructorsForCourse(instructor1OfCourse1.courseId).size() > 1); DeleteInstructorAction deleteInstructorAction = getAction(submissionParams); JsonResult response = getJsonResult(deleteInstructorAction); assertEquals(HttpStatus.SC_OK, response.getStatusCode()); MessageOutput msg = (MessageOutput) response.getOutput(); assertEquals("Instructor is successfully deleted.", msg.getMessage()); InstructorsLogic instructorsLogic = InstructorsLogic.inst(); assertFalse(instructorsLogic.isEmailOfInstructorOfCourse(instructor2OfCourse1.email, instructor1OfCourse1.courseId)); assertTrue(instructorsLogic.isEmailOfInstructorOfCourse(instructor1OfCourse1.email, instructor1OfCourse1.courseId)); }
Source:
<code>public void foo(java.util.Properties props) { <START> try <END> { Cipher c0 = Cipher.getInstance("AES"); Cipher c100 = Cipher.getInstance("AES/ECB/NoPadding"); Cipher c101 = Cipher.getInstance("AES" + "/ECB/NoPadding"); Cipher c102 = Cipher.getInstance("AES/ECB/NoPadding", getProvider()); Cipher c103 = Cipher.getInstance("AES/ECB/NoPadding", "someProvider"); Cipher c3 = Cipher.getInstance("Blowfish/ECB/PKCS5Padding"); Cipher c4 = Cipher.getInstance("DES/ECB/PKCS5Padding"); Cipher c41 = Cipher.getInstance("RSA/ECB/OAEPWithSHA-1AndMGF1Padding"); Cipher c5 = Cipher.getInstance("AES/GCM/NoPadding"); Cipher c6 = Cipher.getInstance("AES/CBC/PKCS5Padding"); Cipher c7 = Cipher.getInstance("Blowfish/CBC/PKCS5Padding"); Cipher c8 = Cipher.getInstance("DES/CBC/PKCS5Padding"); Cipher c9 = Cipher.getInstance("AES/CBC/PKCS7Padding"); Cipher c10 = Cipher.getInstance("Blowfish/CBC/PKCS7Padding"); Cipher c11 = Cipher.getInstance("DES/CBC/PKCS7Padding"); Cipher c112 = Cipher.getInstance("DES/CBC/NoPadding"); Cipher c12 = Cipher.getInstance("AES/GCM/NoPadding"); Cipher c13 = Cipher.getInstance("Blowfish/GCM/NoPadding"); Cipher c14 = Cipher.getInstance("RSA/NONE/NoPadding"); Cipher c142 = Cipher.getInstance("RSA/GCM/NoPadding"); Cipher c15 = Cipher.getInstance("RSA/NONE/OAEPWithSHA-1AndMGF1Padding"); Cipher c16 = Cipher.getInstance("RSA/NONE/OAEPWITHSHA-256ANDMGF1PADDING"); Cipher.getInstance(null); Cipher.getInstance(""); String algo = props.getProperty("myAlgo", "AES/ECB/PKCS5Padding"); Cipher c17 = Cipher.getInstance(algo); String s = "RSA/NONE/NoPadding"; } catch(NoSuchAlgorithmException|NoSuchPaddingException e) catch (NoSuchProviderException e) }</code><technical_language>usually, in java, brackets line keyword. fix this</technical_language>

Target:
public void foo(java.util.Properties props) { try { Cipher.getInstance("AES"); Cipher.getInstance("AES/ECB/NoPadding"); Cipher.getInstance("AES" + "/ECB/NoPadding"); Cipher.getInstance("AES/ECB/NoPadding", getProvider()); Cipher.getInstance("AES/ECB/NoPadding", "someProvider"); Cipher.getInstance("Blowfish/ECB/PKCS5Padding"); Cipher.getInstance("DES/ECB/PKCS5Padding"); Cipher.getInstance("RSA/ECB/OAEPWithSHA-1AndMGF1Padding"); Cipher.getInstance("AES/GCM/NoPadding"); Cipher.getInstance("AES/CBC/PKCS5Padding"); Cipher.getInstance("Blowfish/CBC/PKCS5Padding"); Cipher.getInstance("DES/CBC/PKCS5Padding"); Cipher.getInstance("AES/CBC/PKCS7Padding"); Cipher.getInstance("Blowfish/CBC/PKCS7Padding"); Cipher.getInstance("DES/CBC/PKCS7Padding"); Cipher.getInstance("DES/CBC/NoPadding"); Cipher.getInstance("AES/GCM/NoPadding"); Cipher.getInstance("Blowfish/GCM/NoPadding"); Cipher.getInstance("RSA/NONE/NoPadding"); Cipher.getInstance("RSA/GCM/NoPadding"); Cipher.getInstance("RSA/NONE/OAEPWithSHA-1AndMGF1Padding"); Cipher.getInstance("RSA/NONE/OAEPWITHSHA-256ANDMGF1PADDING"); Cipher.getInstance(null); Cipher.getInstance(""); String algo = props.getProperty("myAlgo", "AES/ECB/PKCS5Padding"); Cipher.getInstance(algo); String s = "RSA/NONE/NoPadding"; } catch (Exception e) { } }
Source:
<code>public <T> T getStore(final StoreQueryParameters<T> storeQueryParameters) { final String storeName = storeQueryParameters.storeName(); final QueryableStoreType<T> queryableStoreType = storeQueryParameters.queryableStoreType(); final List<T> globalStore = globalStoreProvider.stores(storeName, queryableStoreType); if (!globalStore.isEmpty()) { return queryableStoreType.create(globalStoreProvider, storeName); } final List<T> allStores = new ArrayList<>(); for (final StreamThreadStateStoreProvider storeProvider : storeProviders) { final List<T> stores = storeProvider.stores(storeQueryParameters); <START> if (stores != null && !stores.isEmpty()) { <END> allStores.addAll(stores); if (storeQueryParameters.partition() != null) { break; } } } if (allStores.isEmpty()) { if (storeQueryParameters.partition() != null) { throw new InvalidStateStoreException( String.format("The specified partition %d for store %s does not exist.", storeQueryParameters.partition(), storeName)); } throw new InvalidStateStoreException("The state store, " + storeName + ", may have migrated to another instance."); } return queryableStoreType.create( new WrappingStoreProvider(storeProviders, storeQueryParameters), storeName ); }</code><technical_language>Thinking this more, stores null? remove this check</technical_language>

Target:
public <T> T getStore(final StoreQueryParameters<T> storeQueryParameters) { final String storeName = storeQueryParameters.storeName(); final QueryableStoreType<T> queryableStoreType = storeQueryParameters.queryableStoreType(); final List<T> globalStore = globalStoreProvider.stores(storeName, queryableStoreType); if (!globalStore.isEmpty()) { return queryableStoreType.create(globalStoreProvider, storeName); } final List<T> allStores = new ArrayList<>(); for (final StreamThreadStateStoreProvider storeProvider : storeProviders) { final List<T> stores = storeProvider.stores(storeQueryParameters); if (!stores.isEmpty()) { allStores.addAll(stores); if (storeQueryParameters.partition() != null) { break; } } } if (allStores.isEmpty()) { if (storeQueryParameters.partition() != null) { throw new InvalidStateStoreException( String.format("The specified partition %d for store %s does not exist.", storeQueryParameters.partition(), storeName)); } throw new InvalidStateStoreException("The state store, " + storeName + ", may have migrated to another instance."); } return queryableStoreType.create( new WrappingStoreProvider(storeProviders, storeQueryParameters), storeName ); }
Source:
<code>public CompletableFuture<Bytes> get(Bytes row, Column column, Bytes defaultValue) { AsyncGet curAsyncGet = new AsyncGet(row, column, defaultValue); asyncGetsQueue.add(curAsyncGet); executorService.submit(() -> { List<AsyncGet> getsList = new ArrayList<>(); asyncGetsQueue.drainTo(getsList); try { Collection<RowColumn> rowColumns = Collections2.transform(getsList, ag -> ag.rc); Map<RowColumn, Bytes> getsMap = tx.get(rowColumns); for (AsyncGet asyncGet : getsList) { Bytes result = getsMap.get(asyncGet.rc); asyncGet.res.complete(result == null ? defaultValue : result); } } catch (Exception e) { for (AsyncGet asyncGet : getsList) { <START> asyncGet.res.completeExceptionally(e); <END> } } }); return curAsyncGet.res; }</code><technical_language>If exception occur in for loop try, is some of futures completed. case unexpected, if do case</technical_language>

Target:
public CompletableFuture<Bytes> get(Bytes row, Column column, Bytes defaultValue) { AsyncGet curAsyncGet = new AsyncGet(row, column, defaultValue); asyncGetsQueue.add(curAsyncGet); executorService.submit(() -> { List<AsyncGet> getsList = new ArrayList<>(); asyncGetsQueue.drainTo(getsList); try { Collection<RowColumn> rowColumns = Collections2.transform(getsList, ag -> ag.rc); Map<RowColumn, Bytes> getsMap = tx.get(rowColumns); for (AsyncGet asyncGet : getsList) { Bytes result = getsMap.get(asyncGet.rc); asyncGet.res.complete(result == null ? asyncGet.defaultValue : result); } } catch (Exception e) { for (AsyncGet asyncGet : getsList) { asyncGet.res.completeExceptionally(e); } } }); return curAsyncGet.res; }
Source:
<code>protected static boolean isAllowedAttributeValue(final Object value) { <START> if (value instanceof String || <END> value instanceof Byte || value instanceof Short || value instanceof Integer || value instanceof Character || value instanceof Float || value instanceof byte[] || value instanceof short[] || value instanceof int[] || value instanceof float[]) { return true; } if (value instanceof Long) { return SAMUtils.isValidUnsignedIntegerAttribute((Long) value) || ((Long) value >= Integer.MIN_VALUE && (Long) value <= Integer.MAX_VALUE); } return false; }</code><technical_language>I noticed order is before. Do idea relative distribution of sam attribute types? I assume common top short circuit them. I if original order carefully designed thrown together, this ordering is I original</technical_language>

Target:
protected static boolean isAllowedAttributeValue(final Object value) { if (value instanceof Byte || value instanceof Short || value instanceof Integer || value instanceof String || value instanceof Character || value instanceof Float || value instanceof byte[] || value instanceof short[] || value instanceof int[] || value instanceof float[]) { return true; } if (value instanceof Long) { return SAMUtils.isValidUnsignedIntegerAttribute((Long) value) || ((Long) value >= Integer.MIN_VALUE && (Long) value <= Integer.MAX_VALUE); } return false; }
Source:
<code>private S3StorageProvider getS3StorageProvider() { if (!storageAccountManager.isInitialized()) { throw new DuraCloudRuntimeException("storageAccountManager is not initialized!!!"); } StorageAccount account = storageAccountManager.getPrimaryStorageAccount(); StorageProviderType type = account.getType(); <START> if (!type.equals(StorageProviderType.AMAZON_S3)) { <END> throw new DuraCloudRuntimeException( "The type of primary storage provider on " + storageAccountManager.getAccountName() + " must be " + StorageProviderType.AMAZON_S3); } return new S3StorageProvider(account.getUsername(), account.getPassword(), account.getOptions()); }</code><technical_language>This type check removed. storage provider types build top of AMAZON_S3 implementation a type, work for streaming. For example, CHRONOPOLIS provider some spaces for snapshots (left in S3) support this. Also, 4Science-proposed AMAZON_ONE type fit this category</technical_language>

Target:
private S3StorageProvider getS3StorageProvider() { if (!storageAccountManager.isInitialized()) { throw new DuraCloudRuntimeException("storageAccountManager is not initialized!!!"); } StorageAccount account = storageAccountManager.getPrimaryStorageAccount(); StorageProviderType type = account.getType(); return new S3StorageProvider(account.getUsername(), account.getPassword(), account.getOptions()); }
Source:
<code>public static Set<String> getPluginsWithFilesystem(@NotNull Project project) { CachedValue<Set<String>> cachedPluginFilesystem = project.getUserData(PLUGIN_FILESYSTEM_KEY); if (cachedPluginFilesystem != null && cachedPluginFilesystem.hasUpToDateValue()) { return cachedPluginFilesystem.getValue(); } CachedValue<Set<String>> cachedValue = CachedValuesManager.getManager(project).createCachedValue(() -> { Set<String> plugins = new HashSet<>(); <START> Collection<PhpClass> prefixFilesystem = PhpIndex.getInstance(project).getClassesByFQN("\\Shopware\\Components\\Filesystem\\PrefixFilesystem"); <END> if (!prefixFilesystem.isEmpty()) { for(PhpClass phpClass: PhpIndex.getInstance(project).getAllSubclasses("\\Shopware\\Components\\Plugin")) { plugins.add(phpClass.getName()); } } return CachedValueProvider.Result.create(plugins, PsiModificationTracker.MODIFICATION_COUNT); }, false); project.putUserData(PLUGIN_FILESYSTEM_KEY, cachedValue); return cachedValue.getValue(); }</code><technical_language>I suggest a constant for important FQNs</technical_language>

Target:
public static Set<String> getPluginsWithFilesystem(@NotNull Project project) { CachedValue<Set<String>> cachedPluginFilesystem = project.getUserData(PLUGIN_FILESYSTEM_KEY); if (cachedPluginFilesystem != null && cachedPluginFilesystem.hasUpToDateValue()) { return cachedPluginFilesystem.getValue(); } CachedValue<Set<String>> cachedValue = CachedValuesManager.getManager(project).createCachedValue(() -> { Set<String> plugins = new HashSet<>(); Collection<PhpClass> prefixFilesystem = PhpIndex.getInstance(project).getClassesByFQN(ShopwareFQDN.PREFIX_FILESYSTEM); if (!prefixFilesystem.isEmpty()) { for(PhpClass phpClass: PhpIndex.getInstance(project).getAllSubclasses(ShopwareFQDN.PLUGIN_BOOTSTRAP)) { plugins.add(phpClass.getName()); } } return CachedValueProvider.Result.create(plugins, PsiModificationTracker.MODIFICATION_COUNT); }, false); project.putUserData(PLUGIN_FILESYSTEM_KEY, cachedValue); return cachedValue.getValue(); }
Source:
<code>private void fetchSiteSettingsAndUpdateDefaultPostFormatIfNecessary() { if (!TextUtils.isEmpty(getEditPostRepository().getPostFormat())) { return; } mSiteSettings = SiteSettingsInterface.getInterface( getActivity(), getSite(), new SiteSettingsListener() { @Override public void onSaveError(Exception error) { } @Override public void onFetchError(Exception error) { } @Override public void onSettingsUpdated() { if (getEditPostActivityHook() != null) { <START> mAnalyticsTrackerWrapper.track(Stat.EDITOR_POST_FORMAT_CHANGED); <END> updatePostFormat( mSiteSettings.getDefaultPostFormat()); } } @Override public void onSettingsSaved() { } @Override public void onCredentialsValidated(Exception error) { } }); if (mSiteSettings != null) { mSiteSettings.init(true); } }</code><technical_language>Ideally track events due user action. try of a placement</technical_language>

Target:
private void fetchSiteSettingsAndUpdateDefaultPostFormatIfNecessary() { if (!TextUtils.isEmpty(getEditPostRepository().getPostFormat())) { return; } mSiteSettings = SiteSettingsInterface.getInterface( getActivity(), getSite(), new SiteSettingsListener() { @Override public void onSaveError(Exception error) { } @Override public void onFetchError(Exception error) { } @Override public void onSettingsUpdated() { if (getEditPostActivityHook() != null) { updatePostFormat( mSiteSettings.getDefaultPostFormat()); } } @Override public void onSettingsSaved() { } @Override public void onCredentialsValidated(Exception error) { } }); if (mSiteSettings != null) { mSiteSettings.init(true); } }
Source:
<code>public static void updateToTable(Connection connection, String tableName, Persistable persistable, int id) { String query = "UPDATE " + tableName + " SET " + DatabaseHelper.DATA_COL + " = ? " + " WHERE " + DatabaseHelper.ID_COL + " = ?;"; PreparedStatement preparedStatement = null; try { preparedStatement = connection.prepareStatement(query); byte[] blob = org.commcare.modern.database.TableBuilder.toBlob(persistable); preparedStatement.setBinaryStream(1, new ByteArrayInputStream(blob), blob.length); preparedStatement.setInt(2, id); preparedStatement.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } finally { if (preparedStatement != null) { try { preparedStatement.close(); } catch (SQLException e) { <START> e.printStackTrace(); <END> } } } }</code><technical_language>Swallowed exception</technical_language>

Target:
public static void updateToTable(Connection connection, String tableName, Persistable persistable, int id) { String query = "UPDATE " + tableName + " SET " + DatabaseHelper.DATA_COL + " = ? " + " WHERE " + DatabaseHelper.ID_COL + " = ?;"; PreparedStatement preparedStatement = null; try { preparedStatement = connection.prepareStatement(query); byte[] blob = org.commcare.modern.database.TableBuilder.toBlob(persistable); preparedStatement.setBinaryStream(1, new ByteArrayInputStream(blob), blob.length); preparedStatement.setInt(2, id); preparedStatement.executeUpdate(); } catch (SQLException e) { throw new RuntimeException(e); } finally { if (preparedStatement != null) { try { preparedStatement.close(); } catch (SQLException e) { e.printStackTrace(); } } } }
Source:
<code><START> public InternalSinkRecord(ConsumerRecord<byte[], byte[]> originalRecord, String topic, <END> int partition, Schema keySchema, Object key, Schema valueSchema, Object value, long kafkaOffset, Long timestamp, TimestampType timestampType, Iterable<Header> headers) { super(topic, partition, keySchema, key, valueSchema, value, kafkaOffset, timestamp, timestampType, headers); this.originalRecord = originalRecord; }</code><technical_language>this protected. suggestion protected InternalSinkRecord(ConsumerRecord<byte[], byte[]> originalRecord, String topic,</technical_language>

Target:
protected InternalSinkRecord(ConsumerRecord<byte[], byte[]> originalRecord, String topic, int partition, Schema keySchema, Object key, Schema valueSchema, Object value, long kafkaOffset, Long timestamp, TimestampType timestampType, Iterable<Header> headers) { super(topic, partition, keySchema, key, valueSchema, value, kafkaOffset, timestamp, timestampType, headers); this.originalRecord = originalRecord; }
Source:
<code>public void cancelReservation() { Part replacement = findReplacement(false); <START> if (hasReplacementPart() && null != replacement) { <END> setReplacementPart(null); replacement.setReserveId(null); if (replacement.isSpare()) { Part spare = campaign.checkForExistingSparePart(replacement); if (null != spare) { spare.incrementQuantity(); campaign.removePart(replacement); } } } }</code><technical_language>suggestion if (hasReplacementPart() && (null != replacement)) {</technical_language>

Target:
public void cancelReservation() { Part replacement = findReplacement(false); if (hasReplacementPart() && (null != replacement)) { setReplacementPart(null); replacement.setReserveId(null); if (replacement.isSpare()) { Part spare = campaign.checkForExistingSparePart(replacement); if (null != spare) { spare.incrementQuantity(); campaign.removePart(replacement); } } } }
Source:
<code>private void deleteAllElements(BreakpointContainer container, ModelDelta containerDelta) { for (Object <START> element : <END> container.getChildren()) { if (element instanceof BreakpointContainer) { BreakpointContainer.removeAll((BreakpointContainer) element, containerDelta); } else { BreakpointContainer.removeBreakpoint(container, (IBreakpoint) element, containerDelta); } } }</code><technical_language>childElement better</technical_language>

Target:
private void deleteAllElements(BreakpointContainer container, ModelDelta containerDelta) { for (Object childElement : container.getChildren()) { if (childElement instanceof BreakpointContainer) { BreakpointContainer.removeAll((BreakpointContainer) childElement, containerDelta); } else { BreakpointContainer.removeBreakpoint(container, (IBreakpoint) childElement, containerDelta); } } }
Source:
<code>public String getCommandUsage(ICommandSender sender) { <START> return "Displays the version of this SpongeModded server"; <END> }</code><technical_language>"SpongeModded" no...please</technical_language>

Target:
public String getCommandUsage(ICommandSender sender) { return "Displays the Sponge and Minecraft version of this server."; }
Source:
<code>void put(SystemStreamPartition ssp, Object key, Object message) { List<IncomingMessageEnvelope> messages = bufferedMessages.get(ssp); String offset = String.valueOf(messages.size()); if (message instanceof EndOfStreamMessage) { offset = IncomingMessageEnvelope.END_OF_STREAM_OFFSET; } IncomingMessageEnvelope messageEnvelope = new IncomingMessageEnvelope(ssp, offset, key, message, <START> 0, Instant.now().toEpochMilli(), 0L); <END> bufferedMessages.get(ssp) .add(messageEnvelope); }</code><technical_language>I event arrival time current time</technical_language>

Target:
void put(SystemStreamPartition ssp, Object key, Object message) { List<IncomingMessageEnvelope> messages = bufferedMessages.get(ssp); String offset = String.valueOf(messages.size()); if (message instanceof EndOfStreamMessage) { offset = IncomingMessageEnvelope.END_OF_STREAM_OFFSET; } IncomingMessageEnvelope messageEnvelope = new IncomingMessageEnvelope(ssp, offset, key, message, 0, 0L, Instant.now().toEpochMilli()); bufferedMessages.get(ssp) .add(messageEnvelope); }
Source:
<code>public void before() throws IOException,TimeoutException,InterruptedException { dispatcher = new Dispatcher(); statementContext = new DefaultContext(); ResourceAddress addressStats = ADDRESS_TEMPLATE_STATISTICS.resolve(statementContext); dispatcher.execute(new Operation.Builder(ModelDescriptionConstants.WRITE_ATTRIBUTE_OPERATION, addressStats).param("name", "statistics-enabled").param("value", "true").build()); if (cliClient.reloadRequired()) { cliClient.reload(); <START> Library.letsSleep(5000); END> } if (ConfigUtils.isDomain()) { navigation = new FinderNavigation(browser, DomainRuntimeEntryPoint.class) .addAddress(FinderNames.BROWSE_DOMAIN_BY, FinderNames.HOSTS) .addAddress(FinderNames.HOST, "master") .addAddress(FinderNames.SERVER,"server-one") .addAddress(FinderNames.MONITOR, FinderNames.SUBSYSTEMS) .addAddress(FinderNames.SUBSYSTEM, "Undertow"); } else{ navigation = new FinderNavigation(browser, StandaloneRuntimeEntryPoint.class) .addAddress(FinderNames.SERVER, FinderNames.STANDALONE_SERVER) .addAddress(FinderNames.MONITOR, FinderNames.SUBSYSTEMS) .addAddress(FinderNames.SUBSYSTEM,"HTTP"); } navigation.selectRow().invoke("View"); Application.waitUntilVisible(); wmPage.getResourceManager().viewByName("default-server"); Console.withBrowser(browser).waitUntilLoaded(); }</code><technical_language>This done need hardcoding sleeps. minimize impact for now, I suggest move sleep for case running test in domain. Note: is plan update hal testsuite creaper (<LINK_0>, is done release community. Creaper support for waiting for servers in domain running host reload</technical_language>

Target:
public void before() throws IOException, TimeoutException, InterruptedException { dispatcher = new Dispatcher(); statementContext = new DefaultContext(); ResourceAddress addressStats = ADDRESS_TEMPLATE_STATISTICS.resolve(statementContext); dispatcher.execute(new Operation.Builder(ModelDescriptionConstants.WRITE_ATTRIBUTE_OPERATION, addressStats).param("name", "statistics-enabled").param("value", "true").build()); if (ConfigUtils.isDomain()) { new DomainManager(cliClient).reloadAndWaitUntilRunning(60000); navigation = new FinderNavigation(browser, DomainRuntimeEntryPoint.class) .addAddress(FinderNames.BROWSE_DOMAIN_BY, FinderNames.HOSTS) .addAddress(FinderNames.HOST, "master") .addAddress(FinderNames.SERVER, "server-one") .addAddress(FinderNames.MONITOR, FinderNames.SUBSYSTEMS) .addAddress(FinderNames.SUBSYSTEM, "Undertow"); } else { navigation = new FinderNavigation(browser, StandaloneRuntimeEntryPoint.class) .addAddress(FinderNames.SERVER, FinderNames.STANDALONE_SERVER) .addAddress(FinderNames.MONITOR, FinderNames.SUBSYSTEMS) .addAddress(FinderNames.SUBSYSTEM, "HTTP"); } navigation.selectRow().invoke("View"); Application.waitUntilVisible(); wmPage.getResourceManager().viewByName("default-server"); Console.withBrowser(browser).waitUntilLoaded(); }
Source:
<code>private void deleteFrom(SqlDatabaseWrapper database, List<Migration> migrations) { for (Migration migration : migrations) { Batch batch = migration.batch(); <START> database.rawQuery(DELETE_QUERY, batch.getDownloadBatchId().stringValue()); <END> } }</code><technical_language>DELETE_BY_ID_QUERY</technical_language>

Target:
private void deleteFrom(SqlDatabaseWrapper database, List<Migration> migrations) { for (Migration migration : migrations) { Batch batch = migration.batch(); database.rawQuery(DELETE_BY_ID_QUERY, batch.getDownloadBatchId().stringValue()); } }
Source:
<code><START> private static String createWorkflowTrsUrl(Workflow workflow, WorkflowVersion workflowVersion, String dockstoreGA4GHBaseUrl) { <END> final String sourceControl = workflow.getSourceControl().toString(); final String organization = workflow.getOrganization(); final String repository = workflow.getRepository(); final String workflowName = workflow.getWorkflowName(); final String versionOfWorkflow = workflowVersion.getName(); final String sourceControlPathPrefix = sourceControl + "/" + organization + "/" + repository; final String sourceControlPath = StringUtils.isEmpty(workflowName) ? sourceControlPathPrefix : sourceControlPathPrefix + "/" + workflowName; final String workflowVersionPrimaryDescriptorPath = "#workflow/" + sourceControlPath; final String workflowVersionPrimaryDescriptorPathPlainText; try { workflowVersionPrimaryDescriptorPathPlainText = ToolsImplCommon.getUrl(workflowVersionPrimaryDescriptorPath, dockstoreGA4GHBaseUrl); } catch (UnsupportedEncodingException e) { LOG.error("Could not create Zenodo related identifier." + " Error is " + e.getMessage(), e); throw new CustomWebApplicationException("Could not create Zenodo related identifier", HttpStatus.SC_INTERNAL_SERVER_ERROR); } final String workflowVersionType = workflow.getDescriptorType().toString(); final String workflowDescriptorName = workflowVersion.getWorkflowPath(); Path p = Paths.get(workflowDescriptorName); final String descriptorFile = p.getFileName().toString(); final String workflowVersionTrsUrl = workflowVersionPrimaryDescriptorPathPlainText + "/versions/" + versionOfWorkflow + "/PLAIN-" + workflowVersionType + "/descriptor/" + descriptorFile; return workflowVersionTrsUrl; }</code><technical_language>I feel this deserves a unit test. If needs tweaked, hard ensure a change break something</technical_language>

Target:
protected static String createWorkflowTrsUrl(Workflow workflow, WorkflowVersion workflowVersion, String dockstoreGA4GHBaseUrl) { final String sourceControlPath = workflow.getWorkflowPath(); final String workflowVersionPrimaryDescriptorPath = WORKFLOW_PREFIX + "/" + sourceControlPath; final String workflowVersionPrimaryDescriptorPathPlainText; try { workflowVersionPrimaryDescriptorPathPlainText = ToolsImplCommon.getUrl(workflowVersionPrimaryDescriptorPath, dockstoreGA4GHBaseUrl); } catch (UnsupportedEncodingException e) { LOG.error("Could not create Zenodo related identifier." + " Error is " + e.getMessage(), e); throw new CustomWebApplicationException("Could not create Zenodo related identifier", HttpStatus.SC_INTERNAL_SERVER_ERROR); } final String workflowVersionType = workflow.getDescriptorType().toString(); final String workflowDescriptorName = workflowVersion.getWorkflowPath(); Path p = Paths.get(workflowDescriptorName); final String descriptorFile = p.getFileName().toString(); final String versionOfWorkflow = workflowVersion.getName(); final String workflowVersionTrsUrl = workflowVersionPrimaryDescriptorPathPlainText + "/versions/" + versionOfWorkflow + "/PLAIN-" + workflowVersionType + "/descriptor/" + descriptorFile; return workflowVersionTrsUrl; }
Source:
<code>public void testGetStudies() { String url = "/v2/studies?species=mmusculus&assembly=grcm38&pageNumber=0&pageSize=1"; ResponseEntity<String> response = restTemplate.getForEntity(url, String.class); assertEquals(HttpStatus.OK, response.getStatusCode()); Configuration configuration = Configuration.defaultConfiguration() .jsonProvider(new JacksonJsonProvider()) .mappingProvider(new JacksonMappingProvider(objectMapper)) .addOptions(Option.SUPPRESS_EXCEPTIONS); List<VariantStudySummary> variantList = JsonPath.using(configuration).parse(response.getBody()) .read("$['_embedded']['variantStudySummaryList']", new TypeRef<List<VariantStudySummary>>() { }); assertEquals("PRJX00001", variantList.get(0).getStudyId()); assertEquals("Human Variation Data From dbSNP build 144", variantList.get(0).getStudyName()); assertEquals(1, variantList.size()); Integer totalNumberOfElements = JsonPath.using(configuration).parse(response.getBody()) .read("$['page']['totalElements']", Integer.class); Integer pageNumber = JsonPath.using(configuration).parse(response.getBody()) .read("$['page']['number']", Integer.class); Integer size = JsonPath.using(configuration).parse(response.getBody()) .read("$['page']['size']", Integer.class); <START> Integer totalPages = JsonPath.using(configuration).parse(response.getBody()) <END> .read("$['page']['totalPages']", Integer.class); assertEquals(2, totalNumberOfElements.intValue()); assertEquals(0, pageNumber.intValue()); assertEquals(1, size.intValue()); }</code><technical_language>totalPages is used, add validation for it</technical_language>

Target:
public void testGetStudies() { String url = "/v2/studies?species=mmusculus&assembly=grcm38&pageNumber=0&pageSize=1"; ResponseEntity<String> response = restTemplate.getForEntity(url, String.class); assertEquals(HttpStatus.OK, response.getStatusCode()); Configuration configuration = Configuration.defaultConfiguration() .jsonProvider(new JacksonJsonProvider()) .mappingProvider(new JacksonMappingProvider(objectMapper)) .addOptions(Option.SUPPRESS_EXCEPTIONS); List<VariantStudySummary> variantList = JsonPath.using(configuration).parse(response.getBody()) .read("$['_embedded']['variantStudySummaryList']", new TypeRef<List<VariantStudySummary>>() { }); assertEquals("PRJX00001", variantList.get(0).getStudyId()); assertEquals("Human Variation Data From dbSNP build 144", variantList.get(0).getStudyName()); assertEquals(1, variantList.size()); Integer totalNumberOfElements = JsonPath.using(configuration).parse(response.getBody()) .read("$['page']['totalElements']", Integer.class); Integer pageNumber = JsonPath.using(configuration).parse(response.getBody()) .read("$['page']['number']", Integer.class); Integer size = JsonPath.using(configuration).parse(response.getBody()) .read("$['page']['size']", Integer.class); Integer totalPages = JsonPath.using(configuration).parse(response.getBody()) .read("$['page']['totalPages']", Integer.class); assertEquals(2, totalNumberOfElements.intValue()); assertEquals(0, pageNumber.intValue()); assertEquals(1, size.intValue()); assertEquals(2, totalPages.intValue()); }
Source:
<code><START> protected String generateCommandKey(Method method) { <END> return method.toString(); }</code><technical_language>type is final need talk difference default impl actual impl (nor protected). nit.. uhh.. I forgot call this method :) ps LOVE sentences of docs.. rest needed this viewed authors</technical_language>

Target:
private String generateCommandKey(Method method) { return "feign#" + method.toString(); }
Source:
<code>public VoltTable[] run(SystemProcedureExecutionContext ctx, byte[] payload) { ByteBuffer buffer = ByteBuffer.wrap(payload); int taskId = buffer.getInt(); TaskType taskType = TaskType.values()[taskId]; switch (taskType) { case SP_JAVA_GET_DRID_TRACKER: ParameterSet params = ParameterSet.fromArrayNoCopy(new Object[] { payload }); int producerClusterId = (int)params.getParam(1); <START> Integer producerPartitionId = (int)params.getParam(2); <END> DRConsumerDrIdTracker tracker; Map<Integer, Map<Integer, DRConsumerDrIdTracker>> drIdTrackers = ctx.getDrAppliedTrackers(); Map<Integer, DRConsumerDrIdTracker> producerPartitionMap = drIdTrackers.get(producerClusterId); if (producerPartitionMap != null) { tracker = producerPartitionMap.get(producerPartitionId); if (tracker == null) { tracker = new DRConsumerDrIdTracker(-1L, Long.MIN_VALUE, Long.MIN_VALUE); } } else { tracker = new DRConsumerDrIdTracker(-1L, Long.MIN_VALUE, Long.MIN_VALUE); } JSONStringer stringer = new JSONStringer(); try { ExtensibleSnapshotDigestData.serializeConsumerDrIdTrackerToJSON(stringer, producerPartitionId, tracker); } catch (JSONException e) { throw new VoltAbortException("DRConsumerDrIdTracker could not be converted to JSON"); } setAppStatusString(stringer.toString()); default: throw new VoltAbortException("Unable to find the task associated with the given task id"); } }</code><technical_language>producerPartitionId null here</technical_language>

Target:
public VoltTable[] run(SystemProcedureExecutionContext ctx, byte[] payload) { ByteBuffer buffer = ByteBuffer.wrap(payload); int taskId = buffer.getInt(); TaskType taskType = TaskType.values()[taskId]; switch (taskType) { case SP_JAVA_GET_DRID_TRACKER: ParameterSet params = ParameterSet.fromArrayNoCopy(new Object[] { payload }); int producerClusterId = (int)params.getParam(1); Integer producerPartitionId = (int)params.getParam(2); DRConsumerDrIdTracker tracker; Map<Integer, Map<Integer, DRConsumerDrIdTracker>> drIdTrackers = ctx.getDrAppliedTrackers(); Map<Integer, DRConsumerDrIdTracker> producerPartitionMap = drIdTrackers.get(producerClusterId); if (producerPartitionMap != null) { tracker = producerPartitionMap.get(producerPartitionId); if (tracker == null) { tracker = new DRConsumerDrIdTracker(DRLogSegmentId.makeEmptyDRId(producerClusterId), Long.MIN_VALUE, Long.MIN_VALUE); } } else { tracker = new DRConsumerDrIdTracker(DRLogSegmentId.makeEmptyDRId(producerClusterId), Long.MIN_VALUE, Long.MIN_VALUE); } JSONStringer stringer = new JSONStringer(); try { ExtensibleSnapshotDigestData.serializeConsumerDrIdTrackerToJSON(stringer, producerPartitionId, tracker); } catch (JSONException e) { throw new VoltAbortException("DRConsumerDrIdTracker could not be converted to JSON"); } setAppStatusString(stringer.toString()); default: throw new VoltAbortException("Unable to find the task associated with the given task id"); } }
Source:
<code>private List<List<String>> verifySubtotalsSpec(List<List<String>> subtotalsSpec, List<DimensionSpec> dimensions) { if (subtotalsSpec != null) { for (List<String> subtotalSpec : subtotalsSpec) { int i = 0; for (String s : subtotalSpec) { boolean found = false; for (; i < dimensions.size(); i++) { if (s.equals(dimensions.get(i).getOutputName())) { found = true; break; } } if (!found) { throw new IAE( <START> "Subtotal spec %s is either not a subset or items are in different order than in dimensiosn spec.", <END> subtotalSpec ); } } } } return subtotalsSpec; }</code><technical_language>Spelling: dimensions. call dimensionsSpec identical is in query</technical_language>

Target:
private List<List<String>> verifySubtotalsSpec(List<List<String>> subtotalsSpec, List<DimensionSpec> dimensions) { if (subtotalsSpec != null) { for (List<String> subtotalSpec : subtotalsSpec) { int i = 0; for (String s : subtotalSpec) { boolean found = false; for (; i < dimensions.size(); i++) { if (s.equals(dimensions.get(i).getOutputName())) { found = true; break; } } if (!found) { throw new IAE( "Subtotal spec %s is either not a subset or items are in different order than in dimensions.", subtotalSpec ); } } } } return subtotalsSpec; }
Source:
<code>public PersonalFavouritePoint(@NonNull Context ctx, @NonNull String typeName, double latitude, double longitude) throws IllegalArgumentException { <START> this(ctx, PointType.valueOf(typeName), latitude, longitude); <END> }</code><technical_language>Introduce method for returning PointType typeName</technical_language>

Target:
PersonalFavouritePoint(@NonNull Context ctx, @NonNull String typeName, double latitude, double longitude) throws IllegalArgumentException { this(ctx, PointType.valueOfTypeName(typeName), latitude, longitude); }
Source:
<code>public void testContinuousQuery() throws Exception { try(IgniteEx g0 = startGrid(0); IgniteEx g1 = startGrid(1)) { IgniteCache<Integer, Integer> cache = g0.createCache("cache-1"); <START> QueryCursor qry = cache.query(new ContinuousQuery<>() <END> .setInitialQuery(new ScanQuery<>()) .setPageSize(100) .setTimeInterval(1000) .setLocalListener(evts -> { }) .setRemoteFilterFactory(() -> evt -> true) ); for (int i=0; i<100; i++) cache.put(i, i); SystemView<ContinuousQueryView> qrys = g0.context().systemView().view(CQ_SYS_VIEW); assertEquals(1, qrys.size()); for (ContinuousQueryView cq : qrys) { assertEquals("cache-1", cq.cacheName()); assertEquals(100, cq.bufferSize()); assertEquals(1000, cq.interval()); assertEquals(g0.localNode().id(), cq.nodeId()); assertTrue(cq.localListener().startsWith(getClass().getName())); assertTrue(cq.remoteFilter().startsWith(getClass().getName())); assertNull(cq.localTransformedListener()); assertNull(cq.remoteTransformer()); } qrys = g1.context().systemView().view(CQ_SYS_VIEW); assertEquals(1, qrys.size()); for (ContinuousQueryView cq : qrys) { assertEquals("cache-1", cq.cacheName()); assertEquals(100, cq.bufferSize()); assertEquals(1000, cq.interval()); assertEquals(g0.localNode().id(), cq.nodeId()); assertNull(cq.localListener()); assertTrue(cq.remoteFilter().startsWith(getClass().getName())); assertNull(cq.localTransformedListener()); assertNull(cq.remoteTransformer()); } } }</code><technical_language>qry is used</technical_language>

Target:
public void testContinuousQuery() throws Exception { try(IgniteEx originNode = startGrid(0); IgniteEx remoteNode = startGrid(1)) { IgniteCache<Integer, Integer> cache = originNode.createCache("cache-1"); SystemView<ContinuousQueryView> origQrys = originNode.context().systemView().view(CQ_SYS_VIEW); SystemView<ContinuousQueryView> remoteQrys = remoteNode.context().systemView().view(CQ_SYS_VIEW); assertEquals(0, origQrys.size()); assertEquals(0, remoteQrys.size()); try(QueryCursor qry = cache.query(new ContinuousQuery<>() .setInitialQuery(new ScanQuery<>()) .setPageSize(100) .setTimeInterval(1000) .setLocalListener(evts -> { }) .setRemoteFilterFactory(() -> evt -> true) )) { for (int i=0; i<100; i++) cache.put(i, i); checkContinuousQueryView(originNode, origQrys, true); checkContinuousQueryView(originNode, remoteQrys, false); } assertEquals(0, origQrys.size()); assertEquals(0, remoteQrys.size()); } }
Source:
<code>public SpaceReference getTagSpaceRef() { String centralFileBaseName = getCentralFileBaseFullName() + "."; String spaceName = centralFileBaseName.substring(0, centralFileBaseName.indexOf('.')); <START> return new SpaceReference(spaceName, new WikiReference(getContext().getDatabase())); <END> }</code><technical_language>this statements throws IAE if getCentralFileBaseFullName() returns default empty string</technical_language>

Target:
public SpaceReference getTagSpaceRef() { String centralFileBaseName = getCentralFileBaseFullName() + "."; String spaceName = centralFileBaseName.substring(0, centralFileBaseName.indexOf('.')); if (Strings.isNullOrEmpty(spaceName)) { spaceName = modelConfig.getDefaultReferenceValue(EntityType.SPACE) + "_attachments"; } return new SpaceReference(spaceName, new WikiReference(getContext().getDatabase())); }
Source:
<code>public ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload) throws IOException { <START> String bundleName = toBundleName(baseName, locale); String resourceName = toResourceName(bundleName, "properties"); <END> ResourceBundle bundle = null; InputStream stream = null; if (reload) { URL url = loader.getResource(resourceName); if (url != null) { URLConnection connection = url.openConnection(); if (connection != null) { connection.setUseCaches(false); stream = connection.getInputStream(); } } } else { stream = loader.getResourceAsStream(resourceName); } if (stream != null) { try { bundle = new PropertyResourceBundle(new InputStreamReader(stream, StandardCharsets.UTF_8)); } finally { stream.close(); } } return bundle; }</code><technical_language>suggestion String resourceName = toResourceName(toBundleName(baseName, locale), "properties");</technical_language>

Target:
public ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload) throws IOException { String resourceName = toResourceName(toBundleName(baseName, locale), "properties"); ResourceBundle bundle = null; InputStream stream = null; if (reload) { URL url = loader.getResource(resourceName); if (url != null) { URLConnection connection = url.openConnection(); if (connection != null) { connection.setUseCaches(false); stream = connection.getInputStream(); } } } else { stream = loader.getResourceAsStream(resourceName); } if (stream != null) { try { bundle = new PropertyResourceBundle(new InputStreamReader(stream, StandardCharsets.UTF_8)); } finally { stream.close(); } } return bundle; }
Source:
<code>public void processBarrier(CheckpointBarrier barrier, InputChannelInfo channelInfo) throws IOException { long barrierId = barrier.getId(); if (currentCheckpointId > barrierId || (currentCheckpointId == barrierId && !isCheckpointPending())) { return; } if (currentCheckpointId < barrierId) { if (isCheckpointPending()) { cancelSubsumedCheckpoint(barrierId); } markCheckpointStart(barrier.getTimestamp()); currentCheckpointId = barrierId; numBarriersReceived = 0; allBarriersReceivedFuture = new CompletableFuture<>(); checkpointCoordinator.initCheckpoint(barrierId, barrier.getCheckpointOptions()); for (final CheckpointableInput input : inputs) { input.checkpointStarted(barrier); } notifyCheckpoint(barrier); } if (currentCheckpointId == barrierId) { LOG.debug("{}: Received barrier from channel @ {}.", taskName, channelInfo, barrierId); if (++numBarriersReceived == numOpenChannels) { if (getNumOpenChannels() > 1) { markAlignmentEnd(); } else { <START> markAlignmentEnd(0); <END> } allBarriersReceivedFuture.complete(null); resetPendingCheckpoint(barrierId); } } }</code><technical_language>While this is technically correct way, overengineered. impact a ns alignment has? render ms anyways</technical_language>

Target:
public void processBarrier(CheckpointBarrier barrier, InputChannelInfo channelInfo) throws IOException { long barrierId = barrier.getId(); if (currentCheckpointId > barrierId || (currentCheckpointId == barrierId && !isCheckpointPending())) { return; } if (currentCheckpointId < barrierId) { if (isCheckpointPending()) { cancelSubsumedCheckpoint(barrierId); } if (getNumOpenChannels() == 1) { markAlignmentStartAndEnd(barrier.getTimestamp()); } else { markAlignmentStart(barrier.getTimestamp()); } currentCheckpointId = barrierId; numBarriersReceived = 0; allBarriersReceivedFuture = new CompletableFuture<>(); checkpointCoordinator.initCheckpoint(barrierId, barrier.getCheckpointOptions()); for (final CheckpointableInput input : inputs) { input.checkpointStarted(barrier); } notifyCheckpoint(barrier); } if (currentCheckpointId == barrierId) { LOG.debug("{}: Received barrier from channel @ {}.", taskName, channelInfo, barrierId); if (++numBarriersReceived == numOpenChannels) { if (getNumOpenChannels() > 1) { markAlignmentEnd(); } allBarriersReceivedFuture.complete(null); resetPendingCheckpoint(barrierId); } } }
Source:
<code>private void setTexts() { mAnchorLikely.setText(mSettings.getAnchorLikely()); mAnchorNotLikely.setText(mSettings.getAnchorNotLikely()); mBtnSubmit.setText(mSettings.getBtnSubmit()); mBtnDismiss.setText(mSettings.getBtnDismiss()); <START> mBtnEditScore.setText("BACK"); <END> mEtFeedback.setHint(mSettings.getFollowupPlaceholder(mRatingBar.getSelectedScore())); }</code><technical_language>Remove this. Leave mBtnEditScore.setText(mSettings.getBtnEditScore()); change this eligibility server</technical_language>

Target:
private void setTexts() { mAnchorLikely.setText(mSettings.getAnchorLikely()); mAnchorNotLikely.setText(mSettings.getAnchorNotLikely()); mBtnSubmit.setText(mSettings.getBtnSubmit()); mBtnDismiss.setText(mSettings.getBtnDismiss()); mBtnEditScore.setText(mSettings.getBtnEditScore()); mEtFeedback.setHint(mSettings.getFollowupPlaceholder(mRatingBar.getSelectedScore())); }
Source:
<code>protected String visitFunctionCall(FunctionCall node, @Nullable List<Expression> parameters) { StringBuilder builder = new StringBuilder(); String arguments = joinExpressions(node.getArguments()); if (node.getArguments().isEmpty() && "count".equalsIgnoreCase(node.getName().getSuffix())) { arguments = "*"; } if (node.isDistinct()) { arguments = "DISTINCT " + arguments; } builder.append(node.getName()); if (!FUNCTION_CALLS_WITHOUT_PARENTHESIS.contains(node.getName().toString())) { builder.append('(').append(arguments).append(')'); } node.filter() <START> .map(filter -> builder <END> .append(" FILTER (WHERE ") .append(formatExpression(filter)) .append(")")); node.getWindow() .map(window -> builder .append(" OVER ") .append(visitWindow(window, parameters))); return builder.toString(); }</code><technical_language>I ifPresent instead of map more sense reslt of mapping function is used</technical_language>

Target:
protected String visitFunctionCall(FunctionCall node, @Nullable List<Expression> parameters) { StringBuilder builder = new StringBuilder(); String arguments = joinExpressions(node.getArguments()); if (node.getArguments().isEmpty() && "count".equalsIgnoreCase(node.getName().getSuffix())) { arguments = "*"; } if (node.isDistinct()) { arguments = "DISTINCT " + arguments; } builder.append(node.getName()); if (!FUNCTION_CALLS_WITHOUT_PARENTHESIS.contains(node.getName().toString())) { builder.append('(').append(arguments).append(')'); } node.filter() .ifPresent(filter -> builder .append(" FILTER (WHERE ") .append(formatExpression(filter)) .append(")")); node.getWindow() .ifPresent(window -> builder .append(" OVER ") .append(visitWindow(window, parameters))); return builder.toString(); }
Source:
<code>private static Properties calcEnvironment(IConfiguration cfg){ Properties envProps = new Properties(); ICConfigurationDescription cfgDes = ManagedBuildManager.getDescriptionForConfiguration(cfg); IEnvironmentVariableManager mngr = CCorePlugin.getDefault().getBuildEnvironmentManager(); IEnvironmentVariable[] vars = mngr.getVariables(cfgDes, true); for(int i = 0; i < vars.length; i++){ String key = vars[i].getName(); String value = vars[i].getValue(); if (key != null && value != null) envProps.setProperty(key, value); else { if (key != null) envProps.setProperty(key, ""); String varStr = null; try { varStr = " var.toString:" + vars[i].toString(); <START> } catch(NullPointerException e) { <END> } ManagedBuilderCorePlugin.log( new Status( IStatus.INFO, ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.OK, "ScannerConfigBuilder.calcEnvironment(" + String.valueOf(cfg) + ')' + (varStr == null ? "" : varStr) + " class:" + vars[i].getClass().getName() + " name:" + String.valueOf(key) + " value:" + String.valueOf(value), null)); } } return envProps; }</code><technical_language>This try/catch exception rewinding is replaced a simple null check</technical_language>

Target:
private static Properties calcEnvironment(IConfiguration cfg){ Properties envProps = new Properties(); ICConfigurationDescription cfgDes = ManagedBuildManager.getDescriptionForConfiguration(cfg); IEnvironmentVariableManager mngr = CCorePlugin.getDefault().getBuildEnvironmentManager(); IEnvironmentVariable[] vars = mngr.getVariables(cfgDes, true); for(int i = 0; i < vars.length; i++){ String key = vars[i].getName(); String value = vars[i].getValue(); if (key != null) envProps.setProperty(key, value == null ? "" : value); } return envProps; }