auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void badAttributesSubgoal() { topLevelIngredient = new MashedPotatoes().topLevelIngredient; knowledgebase = new IngredientKnowledgebase(); allIngredients = knowledgebase.getPotentialIngredientObjectInstanceList(state, domain, topLevelIngredient); setUpState(); List<String> contents = Arrays.asList("butter", "potatoes", "salt", "eggs"); ObjectInstance mash = IngredientFactory.getNewComplexIngredientObjectInstance( domain.getObjectClass("complex_ingredient"), "Mashed_potatoes", Recipe.NO_ATTRIBUTES, <START> Recipe.SWAPPED, "mixing_bowl_1", new TreeSet<String>(),new TreeSet<String>(), new TreeSet<String>(), contents); <END> BakingAsserts.assertFailure(state, topLevelIngredient, mash); }</code><technical_language>Is a reason for a TreeSet, a HashSet</technical_language>

Target:
public void badAttributesSubgoal() { topLevelIngredient = new MashedPotatoes().topLevelIngredient; knowledgebase = new IngredientKnowledgebase(); allIngredients = knowledgebase.getPotentialIngredientObjectInstanceList(state, domain, topLevelIngredient); setUpState(); List<String> contents = Arrays.asList("butter", "potatoes", "salt", "eggs"); ObjectInstance mash = IngredientFactory.getNewComplexIngredientObjectInstance( domain.getObjectClass("complex_ingredient"), "Mashed_potatoes", Recipe.NO_ATTRIBUTES, Recipe.SWAPPED, "mixing_bowl_1", new HashSet<String>(),new HashSet<String>(), new HashSet<String>(), contents); BakingAsserts.assertFailure(state, topLevelIngredient, mash); }
Source:
<code>public CourseAttributes(String courseId, String name, boolean archiveStatus) { id = Sanitizer.sanitizeTitle(courseId); this.name = Sanitizer.sanitizeTitle(name); <START> isArchived = archiveStatus; <END> }</code><technical_language>In cases this, retain this. for consistency's sake. in getters return a single variable in a single line, constructors dealing more variables, class-scope benefit a shared identity starting this.. Also, redundant this.s. a PR's diff view scroll a little</technical_language>

Target:
public CourseAttributes(String courseId, String name, boolean archiveStatus) { this.id = Sanitizer.sanitizeTitle(courseId); this.name = Sanitizer.sanitizeTitle(name); this.isArchived = archiveStatus; }
Source:
<code>public void nextPreviewStyle() { <START> cyclePreview(Globals.prefs.getPreviewPreferences().getPreviewCyclePosition() + 1); <END> }</code><technical_language>Please extract Globals.prefs a constructor argument (probably replacing PreviewPreferences) want get rid of Globals possible</technical_language>

Target:
public void nextPreviewStyle() { cyclePreview(preferences.getPreviewPreferences().getPreviewCyclePosition() + 1); }
Source:
<code>public Builder withGender(GenderType gender) { <START> profileAttributes.gender = isGenderValid(gender) ? gender : GenderType.other; <END> return this; }</code><technical_language>remove GenderType.INVALID enums need isGenderValid check anymore. replace this a simple assignment remove isGenderValid method</technical_language>

Target:
public Builder withGender(GenderType gender) { if (gender != null) { profileAttributes.gender = gender; } return this; }
Source:
<code>public static synchronized void addToCache(AttestationValue value){ if (!attestationValues.containsKey(value.getHostName())) <START> attestationValues.put(value.getHostName(), value); <END> }</code><technical_language>If a concurrent map use: attestationValues.putIfAbsent(value.getHostName(), value);</technical_language>

Target:
public static synchronized void addToCache(AttestationValue value){ if (!attestationValues.containsKey(value.getHostName())) attestationValues.putIfAbsent(value.getHostName(), value); }
Source:
<code>private Set<BulkResult.BulkResultItem> retryOnlyIndexBlockItemsForever(List<Map.Entry<IndexSet, Message>> chunk, List<BulkResult.BulkResultItem> allFailedItems) { Set<BulkResult.BulkResultItem> indexBlocks = indexBlocksFrom(allFailedItems); Set<BulkResult.BulkResultItem> otherFailures = new HashSet<>(Sets.difference(new HashSet<>(allFailedItems), indexBlocks)); List<Map.Entry<IndexSet, Message>> blockedMessages = messagesForResultItems(chunk, indexBlocks); long attempt = 1; while (!indexBlocks.isEmpty()) { <START> blockExecutionForAttempt(attempt++); <END> BulkResult bulkResult = bulkIndexChunk(blockedMessages); List<BulkResult.BulkResultItem> failedItems = bulkResult.getFailedItems(); indexBlocks = indexBlocksFrom(failedItems); blockedMessages = messagesForResultItems(blockedMessages, indexBlocks); Set<BulkResult.BulkResultItem> newOtherFailures = Sets.difference(new HashSet<>(failedItems), indexBlocks); otherFailures.addAll(newOtherFailures); } return otherFailures; }</code><technical_language>I understand method is supposed do reading body. rename waitBeforeRetrying lines</technical_language>

Target:
private Set<BulkResult.BulkResultItem> retryOnlyIndexBlockItemsForever(List<Map.Entry<IndexSet, Message>> chunk, List<BulkResult.BulkResultItem> allFailedItems) { Set<BulkResult.BulkResultItem> indexBlocks = indexBlocksFrom(allFailedItems); final Set<BulkResult.BulkResultItem> otherFailures = new HashSet<>(Sets.difference(new HashSet<>(allFailedItems), indexBlocks)); List<Map.Entry<IndexSet, Message>> blockedMessages = messagesForResultItems(chunk, indexBlocks); LOG.warn("Retrying messages, because their indices are blocked with status [read-only / allow delete]", indexBlocks.size()); long attempt = 1; while (!indexBlocks.isEmpty()) { waitBeforeRetrying(attempt++); final BulkResult bulkResult = bulkIndexChunk(blockedMessages); final List<BulkResult.BulkResultItem> failedItems = bulkResult.getFailedItems(); indexBlocks = indexBlocksFrom(failedItems); blockedMessages = messagesForResultItems(blockedMessages, indexBlocks); final Set<BulkResult.BulkResultItem> newOtherFailures = Sets.difference(new HashSet<>(failedItems), indexBlocks); otherFailures.addAll(newOtherFailures); if (indexBlocks.isEmpty()) { LOG.info("Retries were successful after attempts. Ingestion will continue now.", attempt); } } return otherFailures; }
Source:
<code>public ReadOnlyBookie(ServerConfiguration conf, StatsLogger statsLogger) throws IOException, KeeperException, InterruptedException, BookieException { super(conf, statsLogger); <START> stateManager = new BookieStateManager(bookieStatus, registrationManager){ <END> @Override public void doTransitionToWritableMode() { LOG.info("Skip transition to writable mode for readonly bookie"); } @Override public void doTransitionToReadOnlyMode() { LOG.info("Skip transition to readonly mode for readonly bookie"); } }; if (conf.isReadOnlyModeEnabled()) { forceReadOnly.set(true); } else { String err = "Try to init ReadOnly Bookie, while ReadOnly mode is not enabled"; LOG.error(err); throw new IOException(err); } LOG.info("Running bookie in force readonly mode."); }</code><technical_language>space '{'</technical_language>

Target:
public ReadOnlyBookie(ServerConfiguration conf, StatsLogger statsLogger) throws IOException, KeeperException, InterruptedException, BookieException { super(conf, statsLogger); stateManager = new BookieStateManager(conf, statsLogger, registrationManager, getLedgerDirsManager()) { @Override public void doTransitionToWritableMode() { LOG.info("Skip transition to writable mode for readonly bookie"); } @Override public void doTransitionToReadOnlyMode() { LOG.info("Skip transition to readonly mode for readonly bookie"); } }; if (conf.isReadOnlyModeEnabled()) { stateManager.forceToReadOnly(); } else { String err = "Try to init ReadOnly Bookie, while ReadOnly mode is not enabled"; LOG.error(err); throw new IOException(err); } LOG.info("Running bookie in force readonly mode."); }
Source:
<code>@Override public boolean active() { kernal.context().gateway().readLock(); try { <START> return kernal.context().state().publicApiActiveState(true); <END> } finally { kernal.context().gateway().readUnlock(); } }</code><technical_language>Lets kernal.active()</technical_language>

Target:
@Override public boolean active() { return kernal.active(); }
Source:
<code><START> public boolean syphonAndDamage(EntityPlayer user, SoulTicket ticket) { <END> if (user.getEntityWorld().isRemote) return false; SoulNetworkEvent.Syphon.User event = new SoulNetworkEvent.Syphon.User(this, ticket, user); if (MinecraftForge.EVENT_BUS.post(event)) return false; int drainAmount = syphon(event.getTicket(), true); if (drainAmount <= 0 || event.shouldDamage()) hurtPlayer(user, event.getTicket().getAmount()); if (ticketHistory.contains(ticket)) ticketHistory.remove(ticket); ticketHistory.add(ticket); return BooleanResult.newResult(true, event.getTicket().getAmount()).isSuccess(); }</code><technical_language>..why</technical_language>

Target:
public BooleanResult<Integer> syphonAndDamage(EntityPlayer user, SoulTicket ticket) { if (user.getEntityWorld().isRemote) return BooleanResult.newResult(false, 0); SoulNetworkEvent.Syphon.User event = new SoulNetworkEvent.Syphon.User(this, ticket, user); if (MinecraftForge.EVENT_BUS.post(event)) return BooleanResult.newResult(false, 0); int drainAmount = syphon(event.getTicket(), true); if (drainAmount <= 0 || event.shouldDamage()) hurtPlayer(user, event.getTicket().getAmount()); if (ticketHistory.contains(ticket)) ticketHistory.remove(ticket); ticketHistory.add(ticket); return BooleanResult.newResult(true, event.getTicket().getAmount()); }
Source:
<code>public String acceptCommand(String commandString) { if (commandString.startsWith(C5ServerConstants.START_META)) { HTableDescriptor metaDesc = HTableDescriptor.META_TABLEDESC; HRegionInfo metaRegion = new HRegionInfo( metaDesc.getTableName(), new byte[]{0}, new byte[]{}, false, 1); String peerString = commandString.substring(commandString.indexOf(":") + 1); List<Long> peers = new ArrayList<>(); for (String s : peerString.split(",")) { peers.add(new Long(s)); } openRegion0(metaRegion, metaDesc, ImmutableList.copyOf(peers), tabletRegistry); return "OK"; <START> } else if (commandString.startsWith(C5ServerConstants.CREATE_TABLE)) { <END> BASE64Decoder decoder = new BASE64Decoder(); String createString = commandString.substring(commandString.indexOf(":") + 1); String[] tableCreationStrings = createString.split(","); try { HTableDescriptor hTableDescriptor = HTableDescriptor.parseFrom(decoder.decodeBuffer(tableCreationStrings[0])); HRegionInfo hRegionInfo = HRegionInfo.parseFrom(decoder.decodeBuffer(tableCreationStrings[1])); List<Long> peers = new ArrayList<>(); for (String s : Arrays.copyOfRange(tableCreationStrings, 2, tableCreationStrings.length)) { s = StringUtils.strip(s); peers.add(new Long(s)); } openRegion0(hRegionInfo, hTableDescriptor, ImmutableList.copyOf(peers), tabletRegistry); return "OK"; } catch (IOException | DeserializationException e) { e.printStackTrace(); System.exit(0); } } return "NOTOK"; }</code><technical_language>this entire function is in extreme need of refactoring testing</technical_language>

Target:
public String acceptCommand(String commandString) throws InterruptedException { if (commandString.startsWith(C5ServerConstants.START_META)) { HTableDescriptor metaDesc = HTableDescriptor.META_TABLEDESC; HRegionInfo metaRegion = new HRegionInfo( metaDesc.getTableName(), new byte[]{0}, new byte[]{}, false, 1); String peerString = commandString.substring(commandString.indexOf(":") + 1); List<Long> peers = new ArrayList<>(); for (String s : peerString.split(",")) { peers.add(new Long(s)); } try { openRegion0(metaRegion, metaDesc, ImmutableList.copyOf(peers)); } catch (IOException e) { e.printStackTrace(); System.exit(1); } return "OK"; } else if (commandString.startsWith(C5ServerConstants.CREATE_TABLE)) { BASE64Decoder decoder = new BASE64Decoder(); String createString = commandString.substring(commandString.indexOf(":") + 1); String[] tableCreationStrings = createString.split(","); HTableDescriptor hTableDescriptor = null; try { hTableDescriptor = HTableDescriptor.parseFrom(decoder.decodeBuffer(tableCreationStrings[0])); HRegionInfo hRegionInfo = HRegionInfo.parseFrom(decoder.decodeBuffer(tableCreationStrings[1])); List<Long> peers = new ArrayList<>(); for (String s : Arrays.copyOfRange(tableCreationStrings, 2, tableCreationStrings.length)) { s = StringUtils.strip(s); peers.add(new Long(s)); } openRegion0(hRegionInfo, hTableDescriptor, ImmutableList.copyOf(peers)); } catch (IOException | DeserializationException e) { e.printStackTrace(); System.exit(1); } return "OK"; } return "NOTOK"; }
Source:
<code>public void handleEvent(ITmfStateSystemBuilder ss, ITmfEvent event) throws AttributeNotFoundException { ITmfEventField content = event.getContent(); long ts = event.getTimestamp().getValue(); <START> Integer sector = ((Long) content.getField(getLayout().fieldBlockSector()).getValue()).intValue(); <END> Integer rqSector = ((Long) content.getField(getLayout().fieldBlockRqSector()).getValue()).intValue(); Integer nrSector = ((Long) content.getField(getLayout().fieldBlockNrSector()).getValue()).intValue(); Integer dev = ((Long) content.getField(getLayout().fieldBlockDeviceId()).getValue()).intValue(); Integer rwbs = ((Long) content.getField(getLayout().fieldBlockRwbs()).getValue()).intValue(); DiskWriteModel disk = fStateProvider.getDisk(dev); Request request = disk.getWaitingRequest(rqSector); if (request == null) { Bio bio = new Bio(rqSector, sector - rqSector, disk, rwbs); request = new Request(bio); } Bio bio = new Bio(sector, nrSector, disk, rwbs); request.insertBio(bio); disk.updateWaitingRequest(ts, request, rqSector); }</code><technical_language>ints</technical_language>

Target:
public void handleEvent(ITmfStateSystemBuilder ss, ITmfEvent event) throws AttributeNotFoundException { ITmfEventField content = event.getContent(); long ts = event.getTimestamp().getValue(); Long sector = NonNullUtils.checkNotNull((Long) content.getField(getLayout().fieldBlockSector()).getValue()); Long rqSector = NonNullUtils.checkNotNull((Long) content.getField(getLayout().fieldBlockRqSector()).getValue()); int nrSector = ((Long) content.getField(getLayout().fieldBlockNrSector()).getValue()).intValue(); int dev = ((Long) content.getField(getLayout().fieldBlockDeviceId()).getValue()).intValue(); int rwbs = ((Long) content.getField(getLayout().fieldBlockRwbs()).getValue()).intValue(); DiskWriteModel disk = fStateProvider.getDisk(dev); Request request = disk.getWaitingRequest(rqSector); if (request == null) { BlockIO bio = new BlockIO(rqSector, Long.valueOf(sector - rqSector).intValue(), disk, rwbs); request = new Request(bio); } BlockIO bio = new BlockIO(sector, nrSector, disk, rwbs); request.insertBio(bio); disk.updateWaitingRequest(ts, request, rqSector); }
Source:
<code>public T put(String key, T value) { StorageEntry val = new StorageEntry(value.getClass().getName(), entityMapper.toJsonTree(value)); <START> StorageEntry previousValue = map.get(key); <END> map.put(key, val); deferredCommit(); if (previousValue == null) { return null; } return deserialize(previousValue); }</code><technical_language>put return previous value? So, use: Java final StorageEntry previousValue = map.put(key, val);</technical_language>

Target:
public T put(String key, T value) { StorageEntry val = new StorageEntry(value.getClass().getName(), entityMapper.toJsonTree(value)); StorageEntry previousValue = map.put(key, val); deferredCommit(); if (previousValue == null) { return null; } return deserialize(previousValue); }
Source:
<code>private JvmConnectionWrapperLabelProvider findProvider(IActiveJvm jvm) { for( int i = 0; i < jvmConnectionLabelProviders.length; i++ ) { if( jvmConnectionLabelProviders[i].accepts(jvm)) <START> return jvmConnectionLabelProviders[i]; <END> } return null; }</code><technical_language>this iterating a fixed set ...should extension point provided</technical_language>

Target:
private JVMLabelProviderDelegate findProvider(IActiveJvm jvm) { for( int i = 0; i < jvmConnectionLabelProviders.length; i++ ) { if( jvmConnectionLabelProviders[i].accepts(jvm)) return jvmConnectionLabelProviders[i]; } return null; }
Source:
<code>private String getOutput() { <START> int outputIndex = arguments.indexOf(toArg(IOptionKeys.OUTPUT)) + 1; <END> String output = arguments.get(outputIndex); System.out.println(output); return String.valueOf(output); }</code><technical_language>if argument expected doesnt exist code another argument for Input argument. check complain default</technical_language>

Target:
private String getOutput() { int index = arguments.indexOf(toArg(IOptionKeys.OUTPUT)) + 1; List<String> values = this.getValues(index); return values.size() == 1 ? values.get(0) : null; }
Source:
<code>public static synchronized PrivateKey getRSAPrivateKey(String name, int length) { PrivateKey privateKey = null; createRSAKeys(name, length); try { <START> KeyStore.Entry entry = loadKeyStore().getEntry(name, null); <END> if (entry == null) { return null; } privateKey = ((KeyStore.PrivateKeyEntry) entry).getPrivateKey(); } catch (Exception e) { SalesforceSDKLogger.e(TAG, "Security exception thrown", e); } return privateKey; }</code><technical_language>try call getEntry(name, null) call createRSAKeys? If created keys exist in KeyStore. However, if call returns null throws Exception, call createRSAKeys. If createRSAKeys returns KeyPair plug in in this case</technical_language>

Target:
public static synchronized PrivateKey getRSAPrivateKey(String name, int length) { PrivateKey privateKey = null; createRSAKeysIfNecessary(name, length); try { KeyStore.Entry entry = loadKeyStore().getEntry(name, null); if (entry == null) { return null; } privateKey = ((KeyStore.PrivateKeyEntry) entry).getPrivateKey(); } catch (Exception e) { SalesforceSDKLogger.e(TAG, "Security exception thrown", e); } return privateKey; }
Source:
<code>public void testMoreLikeThisOnEmbeddedFields() { boolean outputLogs = true; Transaction transaction = fullTextSession.beginTransaction(); Query mltQuery; List<Object[]> entityResults; try { QueryBuilder qb = getCoffeeQueryBuilder(); Coffee decaffInstance = getDecaffInstance( qb ); mltQuery = qb .moreLikeThis() .comparingField( "brand.name" ) .toEntityWithId( decaffInstance.getId() ) .createQuery(); entityResults = (List<Object[]>) fullTextSession .createFullTextQuery( mltQuery, Coffee.class ) .setProjection( ProjectionConstants.THIS, ProjectionConstants.SCORE ) .list(); assertThat( entityResults ).isNotEmpty(); Long matchingElements = (Long) fullTextSession.createQuery( "select count(*) from Coffee c where c.brand.name like '%pony'" ).uniqueResult(); assertThat( entityResults ).hasSize( matchingElements.intValue() ); float score = -1; for ( Object[] element : entityResults ) { if ( score == -1 ) { score = (Float) element[1]; } assertThat( element[1] ).as( "All scores should be equal as the same brand is used" ).isEqualTo( score ); } outputQueryAndResults( outputLogs, decaffInstance, mltQuery, entityResults ); } finally { <START> transaction.commit(); <END> } }</code><technical_language>remove this test? throwing NPE guts of Search engine, I previously thrown _SearchException_ better</technical_language>

Target:
public void testMoreLikeThisOnEmbeddedFields() { boolean outputLogs = true; Transaction transaction = fullTextSession.beginTransaction(); Query mltQuery; List<Object[]> entityResults; try { QueryBuilder qb = getCoffeeQueryBuilder(); Coffee decaffInstance = getDecaffInstance( qb ); mltQuery = qb .moreLikeThis() .comparingField( "brand.name" ) .toEntityWithId( decaffInstance.getId() ) .createQuery(); entityResults = (List<Object[]>) fullTextSession .createFullTextQuery( mltQuery, Coffee.class ) .setProjection( ProjectionConstants.THIS, ProjectionConstants.SCORE ) .list(); assertThat( entityResults ).isNotEmpty(); Long matchingElements = (Long) fullTextSession.createQuery( "select count(*) from Coffee c where c.brand.name like '%pony'" ).uniqueResult(); assertThat( entityResults ).hasSize( matchingElements.intValue() ); float score = -1; for ( Object[] element : entityResults ) { if ( score == -1 ) { score = (Float) element[1]; } assertThat( element[1] ).as( "All scores should be equal as the same brand is used" ).isEqualTo( score ); } outputQueryAndResults( outputLogs, decaffInstance, mltQuery, entityResults ); try { qb .moreLikeThis() .comparingField( "brand.id" ) .toEntityWithId( decaffInstance.getId() ) .createQuery(); } catch (SearchException e) { assertThat( e.getMessage() ) .as( "Field cannot be used" ) .contains( "brand.id" ); } } finally { transaction.commit(); } }
Source:
<code>public void testEnumObjectItems() { if (AbstractWin32TestSupport.isEnglishLocale) { <START> String processorStr = "Process"; <END> String processorTimeStr = "% Processor Time"; List<List<String>> objectItems = PdhUtil.PdhEnumObjectItems(null, null, processorStr, 100); List<String> counters = objectItems.get(0); List<String> instances = objectItems.get(1); assertTrue(instances.contains("0")); assertTrue(instances.contains("_Total")); assertTrue(counters.contains(processorTimeStr)); } else { System.err.println("testEnumObjectItems test can only be run with english locale."); } }</code><technical_language>Is this tested? I tested a german locale translation of "Process" german "Prozess" gave performance counters processes machine, processor. I switched "Prozessor" (I translate "processor") (the CPU), I expected values for single processor I expose VirtualBox "_Total" . This match original code</technical_language>

Target:
public void testEnumObjectItems() { if (AbstractWin32TestSupport.isEnglishLocale) { String processorStr = "Processor"; String processorTimeStr = "% Processor Time"; List<String> instances = PdhUtil.PdhEnumObjectItemInstances(null, null, processorStr, 100); assertTrue(instances.contains("0")); assertTrue(instances.contains("_Total")); List<String> counters = PdhUtil.PdhEnumObjectItemCounters(null, null, processorStr, 100); assertTrue(counters.contains(processorTimeStr)); } else { System.err.println("testEnumObjectItems test can only be run with english locale."); } }
Source:
<code>private void loginSuccess(LoginResponse response) { fabProgressCircle.hide(); if (viewModel.isEditExisting()) { <START> startActivity(new Intent(getApplicationContext(), MainActivity.class)); <END> finish(); } else if (userManager.userExists(response.url, response.username)) { Snackbar.make(binding.getRoot(), R.string.login_account_error, Snackbar.LENGTH_LONG) .show(); } else { Account account = userManager.createUser(response.url, response.statusResponse.result.username, response.password, response.pwgId, response.statusResponse.result.pwgToken); userManager.setActiveAccount(account); setResultIntent(account); startActivity(new Intent(getApplicationContext(), MainActivity.class)); finish(); } }</code><technical_language>this start MainActivity top of backstack instead of navigating MainActivity instance there? I add onActivityResult in ManageAccountsActivity call finish there, fully rewind stack. start MainActivity a new task? e.g. Intent intent = new Intent(getApplicationContext(), MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); startActivity(intent);</technical_language>

Target:
private void loginSuccess(LoginResponse response) { fabProgressCircle.hide(); if (viewModel.isEditExisting()) { finish(); } else if (userManager.userExists(response.url, response.username)) { Snackbar.make(binding.getRoot(), R.string.login_account_error, Snackbar.LENGTH_LONG) .show(); } else { Account account = userManager.createUser(response.url, response.statusResponse.result.username, response.password, response.pwgId, response.statusResponse.result.pwgToken); userManager.setActiveAccount(account); setResultIntent(account); finish(); } }
Source:
<code>public void resetPassword(PasswordReset passwordReset) { checkNotNull(passwordReset); String emailCacheKey = passwordReset.getSptoken() + ":email:" + passwordReset.getStudyIdentifier(); <START> String phoneCacheKey = passwordReset.getSptoken() + ":phone:" + passwordReset.getStudyIdentifier(); <END> String email = cacheProvider.getString(emailCacheKey); String phoneJson = cacheProvider.getString(phoneCacheKey); if (email == null && phoneJson == null) { throw new BadRequestException(PASSWORD_RESET_TOKEN_EXPIRED); } cacheProvider.removeString(emailCacheKey); cacheProvider.removeString(phoneCacheKey); Study study = studyService.getStudy(passwordReset.getStudyIdentifier()); AccountId accountId = null; if (email != null) { accountId = AccountId.forEmail(study.getIdentifier(), email); } else if (phoneJson != null) { accountId = AccountId.forPhone(study.getIdentifier(), getPhone(phoneJson)); } else { throw new BridgeServiceException("Could not reset password"); } Account account = accountDao.getAccount(accountId); if (account == null) { throw new EntityNotFoundException(Account.class); } accountDao.changePassword(account, passwordReset.getPassword()); }</code><technical_language>This side effect if requests a password reset deploy, deploy, password reset token is effectively invalidated. Is this acceptable scenario? potential workaround is "grandfather in" sptoken:study implicitly meaning email, migrate token</technical_language>

Target:
public void resetPassword(PasswordReset passwordReset) { checkNotNull(passwordReset); String emailCacheKey = passwordReset.getSptoken() + ":" + passwordReset.getStudyIdentifier(); String phoneCacheKey = passwordReset.getSptoken() + ":phone:" + passwordReset.getStudyIdentifier(); String email = cacheProvider.getString(emailCacheKey); String phoneJson = cacheProvider.getString(phoneCacheKey); if (email == null && phoneJson == null) { throw new BadRequestException(PASSWORD_RESET_TOKEN_EXPIRED); } cacheProvider.removeString(emailCacheKey); cacheProvider.removeString(phoneCacheKey); Study study = studyService.getStudy(passwordReset.getStudyIdentifier()); AccountId accountId = null; if (email != null) { accountId = AccountId.forEmail(study.getIdentifier(), email); } else if (phoneJson != null) { accountId = AccountId.forPhone(study.getIdentifier(), getPhone(phoneJson)); } else { throw new BridgeServiceException("Could not reset password"); } Account account = accountDao.getAccount(accountId); if (account == null) { throw new EntityNotFoundException(Account.class); } accountDao.changePassword(account, passwordReset.getPassword()); }
Source:
<code>protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException, MaxMoneyException { Trade charge = getTrade(sign, 1, 2, player, ess); Trade money = getTrade(sign, 3, ess); if (ess.getSettings().isAllowBulkBuySell() && player.getBase().isSneaking()) { ItemStack heldItem = player.getItemInHand(); if (charge.getItemStack().isSimilar(heldItem)) { int initialItemAmount = charge.getItemStack().getAmount(); int newItemAmount = heldItem.getAmount(); ItemStack item = charge.getItemStack(); item.setAmount(newItemAmount); charge = new Trade(item, ess); BigDecimal chargeAmount = money.getMoney(); <START> BigDecimal pricePerSingleItem = chargeAmount.divide(new BigDecimal(initialItemAmount), RoundingMode.HALF_EVEN); <END> pricePerSingleItem = pricePerSingleItem.multiply(new BigDecimal(newItemAmount)); money = new Trade(pricePerSingleItem, ess); } } charge.isAffordableFor(player); money.pay(player, OverflowType.DROP); charge.charge(player); Trade.log("Sign", "Sell", "Interact", username, charge, username, money, sign.getBlock().getLocation(), ess); return true; }</code><technical_language>This introduces rounding errors change amount signs give - this function change</technical_language>

Target:
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException, MaxMoneyException { Trade charge = getTrade(sign, 1, 2, player, ess); Trade money = getTrade(sign, 3, ess); if (ess.getSettings().isAllowBulkBuySell() && player.getBase().isSneaking()) { ItemStack heldItem = player.getItemInHand(); if (charge.getItemStack().isSimilar(heldItem)) { int initialItemAmount = charge.getItemStack().getAmount(); int newItemAmount = heldItem.getAmount(); ItemStack item = charge.getItemStack(); item.setAmount(newItemAmount); charge = new Trade(item, ess); BigDecimal chargeAmount = money.getMoney(); BigDecimal pricePerSingleItem = chargeAmount.divide(new BigDecimal(initialItemAmount)); pricePerSingleItem = pricePerSingleItem.multiply(new BigDecimal(newItemAmount)); money = new Trade(pricePerSingleItem, ess); } } charge.isAffordableFor(player); money.pay(player, OverflowType.DROP); charge.charge(player); Trade.log("Sign", "Sell", "Interact", username, charge, username, money, sign.getBlock().getLocation(), ess); return true; }
Source:
<code>public synchronized PMML4Result submitRequest(PMMLRequestData request) throws InvalidParameterException, IllegalStateException { if (request == null) { throw new InvalidParameterException("PMML model cannot be applied to a null request"); } if (ruleUnitClass == null) { throw new IllegalStateException("PMML model cannot be applied. Missing ruleUnitClass."); } if (used) { used = false; initRuleUnitExecutor(); } KieRuntimeLogger logger = loggerFileName != null ? ((InternalRuleUnitExecutor)executor).addFileLogger(loggerFileName) : null; try { requestData.insert(request); baseResultHolder = new PMML4Result(request.getCorrelationId()); resultData.insert(baseResultHolder); executor.run(ruleUnitClass); } finally { <START> if (logger != null) <END> logger.close(); } used = true; return baseResultHolder; }</code><technical_language>nitpicking: missing {</technical_language>

Target:
public synchronized PMML4Result submitRequest(PMMLRequestData request) throws InvalidParameterException, IllegalStateException { if (request == null) { throw new InvalidParameterException("PMML model cannot be applied to a null request"); } if (ruleUnitClass == null) { throw new IllegalStateException("PMML model cannot be applied. Missing ruleUnitClass."); } if (used) { used = false; initRuleUnitExecutor(); } KieRuntimeLogger logger = loggerFileName != null ? ((InternalRuleUnitExecutor)executor).addFileLogger(loggerFileName) : null; try { requestData.insert(request); baseResultHolder = new PMML4Result(request.getCorrelationId()); resultData.insert(baseResultHolder); executor.run(ruleUnitClass); } finally { if (logger != null) { logger.close(); } } used = true; return baseResultHolder; }
Source:
<code>public <T> List<T> stores(final String storeName, final QueryableStoreType<T> queryableStoreType) { final List<T> allStores = new ArrayList<>(); for (final StreamThreadStateStoreProvider provider : storeProviders) { final List<T> stores = provider.stores(storeQueryParameters); if (stores != null && !stores.isEmpty()) { allStores.addAll(stores); <START> } <END> } if (allStores.isEmpty()) { throw new InvalidStateStoreException("The state store, " + storeName + ", may have migrated to another instance."); } return allStores; }</code><technical_language>above: stores null, need this change? check for isEmpty give much, call addAll stores is empty</technical_language>

Target:
public <T> List<T> stores(final String storeName, final QueryableStoreType<T> queryableStoreType) { final List<T> allStores = new ArrayList<>(); for (final StreamThreadStateStoreProvider provider : storeProviders) { final List<T> stores = provider.stores(storeQueryParameters); allStores.addAll(stores); } if (allStores.isEmpty()) { throw new InvalidStateStoreException("The state store, " + storeName + ", may have migrated to another instance."); } return allStores; }
Source:
<code>public void testAddModifiedBy() throws Exception { URL resource = PomIOTest.class.getResource( filename ); assertNotNull( resource ); File pom = new File( resource.getFile() ); assertTrue( pom.exists() ); File targetFile = folder.newFile( "target.xml" ); FileUtils.copyFile( pom, targetFile ); List<Project> projects = pomIO.parseProject( targetFile ); projects.get( 0 ).setExecutionRoot(); HashSet<Project> changed = new HashSet<>(); changed.add( projects.get( 0 ) ); pomIO.rewritePOMs( changed ); <START> String s = FileUtils.readFileToString( targetFile, Charset.defaultCharset() ); <END> assertEquals( StringUtils.countMatches(s, "Modified by POM Manipulation Extension" ), 1); pomIO.rewritePOMs( changed ); s = FileUtils.readFileToString( targetFile, Charset.defaultCharset() ); assertEquals( StringUtils.countMatches(s, "Modified by POM Manipulation Extension" ), 1); }</code><technical_language>more accurate if get charset pom: Charset.forName( projects.get( 0 ).getModel().getModelEncoding() )</technical_language>

Target:
public void testAddModifiedBy() throws Exception { URL resource = PomIOTest.class.getResource( filename ); assertNotNull( resource ); File pom = new File( resource.getFile() ); assertTrue( pom.exists() ); File targetFile = folder.newFile( "target.xml" ); FileUtils.copyFile( pom, targetFile ); Project project = pomIO.parseProject( targetFile ).get( 0 ); project.setExecutionRoot(); HashSet<Project> changed = new HashSet<>(); changed.add( project ); pomIO.rewritePOMs( changed ); String s = FileUtils.readFileToString( targetFile, StandardCharsets.UTF_8 ); assertEquals( 1, StringUtils.countMatches(s, "Modified by POM Manipulation Extension" ) ); pomIO.rewritePOMs( changed ); s = FileUtils.readFileToString( targetFile, StandardCharsets.UTF_8 ); assertEquals( 1, StringUtils.countMatches(s, "Modified by POM Manipulation Extension" ) ); }
Source:
<code>public void testServiceStart() throws Exception { String basedir = System.getProperty("basedir"); if (basedir == null) { basedir = new File(".").getCanonicalPath(); } GatewayConfig config = EasyMock.createMock(GatewayConfig.class); EasyMock.expect(config.getGatewayKeystoreDir()).andReturn(basedir + "/target/test-classes/keystores").atLeastOnce(); EasyMock.expect(config.getSigningKeystorePath()).andReturn(basedir + "/target/test-classes/keystores/server-keystore.jks").atLeastOnce(); EasyMock.expect(config.getSigningKeystoreType()).andReturn("jks").atLeastOnce(); EasyMock.expect(config.getSigningKeystorePasswordAlias()).andReturn(GatewayConfig.DEFAULT_SIGNING_KEYSTORE_PASSWORD_ALIAS).anyTimes(); EasyMock.expect(config.getSigningKeyAlias()).andReturn("server").anyTimes(); MasterService ms = EasyMock.createMock(MasterService.class); EasyMock.expect(ms.getMasterSecret()).andReturn("horton".toCharArray()).atLeastOnce(); AliasService as = EasyMock.createMock(AliasService.class); EasyMock.expect(as.getSigningKeyPassphrase()).andReturn("horton".toCharArray()).atLeastOnce(); EasyMock.replay(config, ms, as); DefaultKeystoreService ks = new DefaultKeystoreService(); ks.setMasterService(ms); ks.init(config, new HashMap<>()); ks.start(); DefaultTokenAuthorityService ta = new DefaultTokenAuthorityService(); ta.setAliasService(as); ta.setKeystoreService(ks); ta.init(config, new HashMap<>()); ta.start(); <START> EasyMock.verify(config, ms, as); <END> }</code><technical_language>stop ks ts follow rest of lifecycle</technical_language>

Target:
public void testServiceStart() throws Exception { String basedir = System.getProperty("basedir"); if (basedir == null) { basedir = new File(".").getCanonicalPath(); } GatewayConfig config = EasyMock.createMock(GatewayConfig.class); EasyMock.expect(config.getGatewayKeystoreDir()).andReturn(basedir + "/target/test-classes/keystores").atLeastOnce(); EasyMock.expect(config.getSigningKeystorePath()).andReturn(basedir + "/target/test-classes/keystores/server-keystore.jks").atLeastOnce(); EasyMock.expect(config.getSigningKeystoreType()).andReturn("jks").atLeastOnce(); EasyMock.expect(config.getSigningKeystorePasswordAlias()).andReturn(GatewayConfig.DEFAULT_SIGNING_KEYSTORE_PASSWORD_ALIAS).anyTimes(); EasyMock.expect(config.getSigningKeyAlias()).andReturn("server").anyTimes(); MasterService ms = EasyMock.createMock(MasterService.class); EasyMock.expect(ms.getMasterSecret()).andReturn("horton".toCharArray()).atLeastOnce(); AliasService as = EasyMock.createMock(AliasService.class); EasyMock.expect(as.getSigningKeyPassphrase()).andReturn("horton".toCharArray()).atLeastOnce(); EasyMock.replay(config, ms, as); DefaultKeystoreService ks = new DefaultKeystoreService(); ks.setMasterService(ms); ks.init(config, new HashMap<>()); ks.start(); DefaultTokenAuthorityService ta = new DefaultTokenAuthorityService(); ta.setAliasService(as); ta.setKeystoreService(ks); ta.init(config, new HashMap<>()); ta.start(); ta.stop(); ks.stop(); EasyMock.verify(config, ms, as); }
Source:
<code>private void init(Config config, URIish uri) { int postBufferSize = config.getInt(HTTP, POST_BUFFER_KEY, 1 * 1024 * 1024); boolean sslVerifyFlag = config.getBoolean(HTTP, SSL_VERIFY_KEY, true); HttpRedirectMode followRedirectsMode = config.getEnum( HttpRedirectMode.values(), HTTP, null, FOLLOW_REDIRECTS_KEY, HttpRedirectMode.INITIAL); int redirectLimit = config.getInt(HTTP, MAX_REDIRECTS_KEY, MAX_REDIRECTS); if (redirectLimit < 0) { redirectLimit = MAX_REDIRECTS; } String match = findMatch(config.getSubsections(HTTP), uri); if (match != null) { postBufferSize = config.getInt(HTTP, match, POST_BUFFER_KEY, postBufferSize); sslVerifyFlag = config.getBoolean(HTTP, match, SSL_VERIFY_KEY, sslVerifyFlag); followRedirectsMode = config.getEnum(HttpRedirectMode.values(), HTTP, match, FOLLOW_REDIRECTS_KEY, followRedirectsMode); int newMaxRedirects = config.getInt(HTTP, match, MAX_REDIRECTS_KEY, redirectLimit); if (newMaxRedirects >= 0) { redirectLimit = newMaxRedirects; } cookieFile = config.getString(HTTP, match, COOKIE_FILE_KEY); saveCookies = config.getBoolean(HTTP, match, SAVE_COOKIES_KEY, false); } else { cookieFile = config.getString(HTTP, null, COOKIE_FILE_KEY); <START> saveCookies = config.getBoolean(HTTP, SAVE_COOKIES_KEY, false); <END> } postBuffer = postBufferSize; sslVerify = sslVerifyFlag; followRedirects = followRedirectsMode; maxRedirects = redirectLimit; }</code><technical_language>if is a http.<url> section, a http.<url>.cookieFile setting, a possibly existing http.cookieFile setting is ignored. Is correct? For other keys logic absent a URL-specific setting, existing global setting taken</technical_language>

Target:
private void init(Config config, URIish uri) { int postBufferSize = config.getInt(HTTP, POST_BUFFER_KEY, 1 * 1024 * 1024); boolean sslVerifyFlag = config.getBoolean(HTTP, SSL_VERIFY_KEY, true); HttpRedirectMode followRedirectsMode = config.getEnum( HttpRedirectMode.values(), HTTP, null, FOLLOW_REDIRECTS_KEY, HttpRedirectMode.INITIAL); int redirectLimit = config.getInt(HTTP, MAX_REDIRECTS_KEY, MAX_REDIRECTS); if (redirectLimit < 0) { redirectLimit = MAX_REDIRECTS; } cookieFile = config.getString(HTTP, null, COOKIE_FILE_KEY); saveCookies = config.getBoolean(HTTP, SAVE_COOKIES_KEY, false); String match = findMatch(config.getSubsections(HTTP), uri); if (match != null) { postBufferSize = config.getInt(HTTP, match, POST_BUFFER_KEY, postBufferSize); sslVerifyFlag = config.getBoolean(HTTP, match, SSL_VERIFY_KEY, sslVerifyFlag); followRedirectsMode = config.getEnum(HttpRedirectMode.values(), HTTP, match, FOLLOW_REDIRECTS_KEY, followRedirectsMode); int newMaxRedirects = config.getInt(HTTP, match, MAX_REDIRECTS_KEY, redirectLimit); if (newMaxRedirects >= 0) { redirectLimit = newMaxRedirects; } String urlSpecificCookieFile = config.getString(HTTP, match, COOKIE_FILE_KEY); if (urlSpecificCookieFile != null) { cookieFile = urlSpecificCookieFile; } saveCookies = config.getBoolean(HTTP, match, SAVE_COOKIES_KEY, saveCookies); } postBuffer = postBufferSize; sslVerify = sslVerifyFlag; followRedirects = followRedirectsMode; maxRedirects = redirectLimit; }
Source:
<code>public void messageConsumerTests() { final String url = "tcp://123.123.123.123"; final String name = "TestName12@!"; MqttBrokerConnection a; try { a = new MqttBrokerConnection(name, url, false); <START> } catch (ConfigurationException e) { <END> fail(); return; } assertFalse(a.isConsumers()); MqttMessageSubscriber subscriber = new MqttMessageSubscriber() { @Override public void processMessage(String topic, byte[] payload) { } @Override public String getTopic() { return "topic"; } }; try { a.addConsumer(subscriber); } catch (MqttException e) { fail("addConsumer failed"); } assertTrue(a.isConsumers()); a.removeConsumer(subscriber); assertFalse(a.isConsumers()); }</code><technical_language>declare test throws Exception call constructor here. This clean test fail if exception occurs</technical_language>

Target:
public void messageConsumerTests() throws ConfigurationException, MqttException { final String url = "tcp://123.123.123.123"; final String name = "TestName12@!"; MqttBrokerConnection a = new MqttBrokerConnection(name, url, false); assertFalse(a.isConsumers()); MqttMessageSubscriber subscriber = mock(MqttMessageSubscriber.class); when(subscriber.getTopic()).thenAnswer(i -> "topic"); a.addConsumer(subscriber); assertTrue(a.isConsumers()); a.removeConsumer(subscriber); assertFalse(a.isConsumers()); }
Source:
<code>public void run() { if (getConfig().getProjectListRefreshInterval() <= 0) { return; } boolean loadProjectList = getConfig().isLoadProjectListOnStartup(); while (!shutdown) { try { if (loadProjectList) { if (isConnected()) { IGerritHudsonTriggerConfig activeConfig = getConfig(); SshConnection sshConnection = SshConnectionFactory.getConnection( activeConfig.getGerritHostName(), activeConfig.getGerritSshPort(), activeConfig.getGerritProxy(), activeConfig.getGerritAuthentication() ); setGerritProjects(readProjects(sshConnection.executeCommandReader(GERRIT_LS_PROJECTS))); sshConnection.disconnect(); } } else { loadProjectList = true; } } catch (SshException ex) { logger.warn("Could not connect to Gerrit server when updating Gerrit project list: ", ex); } catch (IOException ex) { logger.error("Could not read stream with Gerrit projects: ", ex); } try { synchronized (this) { <START> wait(TimeUnit.SECONDS.toMillis(getConfig().getProjectListRefreshInterval())); <END> } } catch (InterruptedException ex) { logger.warn("InterruptedException: ", ex); break; } } GerritServer server = PluginImpl.getServer_(serverName); if (server != null) { server.removeListener(this); } else { logger.error("Could not find server {}", serverName); } }</code><technical_language>This changed runtime 0 abort it, thread sleep. a change 0 >0 handled? I guess admins clicking reconnect button</technical_language>

Target:
public void run() { if (getConfig().getProjectListRefreshInterval() <= 0) { return; } boolean loadProjectList = getConfig().isLoadProjectListOnStartup(); while (!shutdown) { try { if (loadProjectList) { if (isConnected()) { IGerritHudsonTriggerConfig activeConfig = getConfig(); SshConnection sshConnection = SshConnectionFactory.getConnection( activeConfig.getGerritHostName(), activeConfig.getGerritSshPort(), activeConfig.getGerritProxy(), activeConfig.getGerritAuthentication() ); setGerritProjects(readProjects(sshConnection.executeCommandReader(GERRIT_LS_PROJECTS))); sshConnection.disconnect(); } } else { loadProjectList = true; } } catch (SshException ex) { logger.warn("Could not connect to Gerrit server when updating Gerrit project list: ", ex); } catch (IOException ex) { logger.error("Could not read stream with Gerrit projects: ", ex); } try { synchronized (this) { long startTime = System.nanoTime(); while (System.nanoTime() - startTime < TimeUnit.SECONDS.toNanos(getConfig().getProjectListRefreshInterval()) && !shutdown) { wait(TimeUnit.SECONDS.toMillis(1)); } } } catch (InterruptedException ex) { logger.warn("InterruptedException: ", ex); break; } } GerritServer server = PluginImpl.getServer_(serverName); if (server != null) { server.removeListener(this); } else { logger.error("Could not find server {}", serverName); } }
Source:
<code>protected Object computeServiceProblems() { Map<Entity, Lifecycle> values = getValues(SERVICE_STATE_ACTUAL); int numRunning=0; List<Entity> onesNotHealthy=MutableList.of(); Set<Lifecycle> ignoreStates = getConfig(IGNORE_ENTITIES_WITH_THESE_SERVICE_STATES); for (Map.Entry<Entity,Lifecycle> state: values.entrySet()) { if (state.getValue()==Lifecycle.RUNNING) numRunning++; else if (!ignoreStates.contains(state.getValue())) onesNotHealthy.add(state.getKey()); } QuorumCheck qc = getConfig(RUNNING_QUORUM_CHECK); if (qc!=null) { if (qc.isQuorate(numRunning, onesNotHealthy.size()+numRunning)) return null; if (onesNotHealthy.size()==0) return "Not enough entities running to be quorate"; } else { <START> if (onesNotHealthy.size()==0) <END> return null; } return "Required entit"+Strings.ies(onesNotHealthy.size())+" not healthy: "+ (onesNotHealthy.size()>3 ? onesNotHealthy.get(0)+" and "+(onesNotHealthy.size()-1)+" others" : Strings.join(onesNotHealthy, ", ")); }</code><technical_language>isEmpty()</technical_language>

Target:
protected Object computeServiceProblems() { Map<Entity, Lifecycle> values = getValues(SERVICE_STATE_ACTUAL); int numRunning=0; List<Entity> onesNotHealthy=MutableList.of(); Set<Lifecycle> ignoreStates = getConfig(IGNORE_ENTITIES_WITH_THESE_SERVICE_STATES); for (Map.Entry<Entity,Lifecycle> state: values.entrySet()) { if (state.getValue()==Lifecycle.RUNNING) numRunning++; else if (!ignoreStates.contains(state.getValue())) onesNotHealthy.add(state.getKey()); } QuorumCheck qc = getConfig(RUNNING_QUORUM_CHECK); if (qc!=null) { if (qc.isQuorate(numRunning, onesNotHealthy.size()+numRunning)) return null; if (onesNotHealthy.isEmpty()) return "Not enough entities running to be quorate"; } else { if (onesNotHealthy.isEmpty()) return null; } return "Required entit"+Strings.ies(onesNotHealthy.size())+" not healthy: "+ (onesNotHealthy.size()>3 ? onesNotHealthy.get(0)+" and "+(onesNotHealthy.size()-1)+" others" : Strings.join(onesNotHealthy, ", ")); }
Source:
<code>public static Map<String, Properties> getImportProcessorConfig(ImportType importType) { Map<String, Properties> processorConfig = new HashMap<String, Properties>(); if (importType == null) { return processorConfig; } List<String> streamList = new ArrayList<String>(); int i = 0; for (ImportConfigurationType importConfiguration : importType.getConfiguration()) { boolean connectorEnabled = importConfiguration.isEnabled(); if (!connectorEnabled) continue; if (!streamList.contains(importConfiguration.getModule())) { streamList.add(importConfiguration.getModule()); } Properties processorProperties = checkImportProcessorConfiguration(importConfiguration); <START> String transformer = importConfiguration.getFormat(); <END> if (transformer != null && !transformer.isEmpty()) { processorProperties.put(ImportDataProcessor.IMPORT_TRANSFORMER, transformer); } processorConfig.put(importConfiguration.getModule() + i++, processorProperties); } return processorConfig; }</code><technical_language>call formatter</technical_language>

Target:
public static Map<String, Properties> getImportProcessorConfig(ImportType importType) { Map<String, Properties> processorConfig = new HashMap<String, Properties>(); if (importType == null) { return processorConfig; } List<String> streamList = new ArrayList<String>(); int i = 0; for (ImportConfigurationType importConfiguration : importType.getConfiguration()) { boolean connectorEnabled = importConfiguration.isEnabled(); if (!connectorEnabled) continue; if (!streamList.contains(importConfiguration.getModule())) { streamList.add(importConfiguration.getModule()); } Properties processorProperties = checkImportProcessorConfiguration(importConfiguration); String formatter = importConfiguration.getFormat(); if (formatter != null && !formatter.isEmpty()) { processorProperties.put(ImportDataProcessor.IMPORT_FORMATTER, formatter); } processorConfig.put(importConfiguration.getModule() + i++, processorProperties); } return processorConfig; }