auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testIndexRowWithoutEmptyColumn() throws Exception { if (async) { return; } long scn; String dataTableName = generateUniqueName(); String indexTableName = generateUniqueName(); try (Connection conn = DriverManager.getConnection(getUrl())) { populateTable(dataTableName); <START> Thread.sleep(1000); <END> conn.createStatement().execute("CREATE INDEX " + indexTableName + " on " + dataTableName + " (val1) include (val2, val3)"); scn = EnvironmentEdgeManager.currentTimeMillis(); IndexRegionObserver.setFailDataTableUpdatesForTesting(true); conn.createStatement().execute("upsert into " + dataTableName + " values ('a', 'abc','abcc', 'abccd')"); commitWithException(conn); IndexRegionObserver.setFailDataTableUpdatesForTesting(false); TestUtil.doMajorCompaction(conn, indexTableName); } Properties props = new Properties(); props.setProperty("CurrentSCN", Long.toString(scn)); try (Connection connWithSCN = DriverManager.getConnection(getUrl(), props)) { String selectSql = "SELECT * from " + dataTableName + " WHERE val1 = 'ab'"; assertExplainPlan(connWithSCN, selectSql, dataTableName, indexTableName); ResultSet rs = connWithSCN.createStatement().executeQuery(selectSql); assertTrue(rs.next()); assertEquals("a", rs.getString(1)); assertEquals("ab", rs.getString(2)); assertEquals("abc", rs.getString(3)); assertEquals("abcd", rs.getString(4)); assertFalse(rs.next()); } }</code><technical_language>This done EnvironmentEdgeManager a sleep, faster/safer a sleep. remember increment DDL DML able read it</technical_language>

Target:
public void testIndexRowWithoutEmptyColumn() throws Exception { if (async) { return; } long scn; String dataTableName = generateUniqueName(); String indexTableName = generateUniqueName(); try (Connection conn = DriverManager.getConnection(getUrl())) { populateTable(dataTableName); conn.createStatement().execute("CREATE INDEX " + indexTableName + " on " + dataTableName + " (val1) include (val2, val3)"); scn = EnvironmentEdgeManager.currentTimeMillis(); IndexRegionObserver.setFailDataTableUpdatesForTesting(true); conn.createStatement().execute("upsert into " + dataTableName + " values ('a', 'abc','abcc', 'abccd')"); commitWithException(conn); IndexRegionObserver.setFailDataTableUpdatesForTesting(false); TestUtil.doMajorCompaction(conn, indexTableName); } Properties props = new Properties(); props.setProperty("CurrentSCN", Long.toString(scn)); try (Connection connWithSCN = DriverManager.getConnection(getUrl(), props)) { String selectSql = "SELECT * from " + dataTableName + " WHERE val1 = 'ab'"; assertExplainPlan(connWithSCN, selectSql, dataTableName, indexTableName); ResultSet rs = connWithSCN.createStatement().executeQuery(selectSql); assertTrue(rs.next()); assertEquals("a", rs.getString(1)); assertEquals("ab", rs.getString(2)); assertEquals("abc", rs.getString(3)); assertEquals("abcd", rs.getString(4)); assertFalse(rs.next()); } }
Source:
<code>protected boolean canDoAction() { boolean returnValue = canRemoveVds(getVdsId(), getReturnValue().getCanDoActionMessages()); StoragePool storagePool = getStoragePoolDAO().getForVds(getParameters().getVdsId()); if (returnValue && storagePool != null && storagePool.getstorage_pool_type() == StorageType.LOCALFS) { if (!getStorageDomainDAO().getAllForStoragePool(storagePool.getId()).isEmpty()) { addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_REMOVE_HOST_WITH_LOCAL_STORAGE); returnValue = false; } } if (returnValue && isGlusterEnabled()) { upServer = getClusterUtils().getUpServer(getVdsGroupId()); if (!getParameters().isForceAction()) { if (hasVolumeBricksOnServer()) { <START> addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME); <END> returnValue = false; } else if (upServer == null && clusterHasMultipleHosts()) { addCanDoActionMessage(String.format("$clusterName %1$s", getVdsGroup().getname())); addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NO_UP_SERVER_FOUND); returnValue = false; } } else { if (hasVolumeBricksOnServer() && upServer != null ) { addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME); returnValue = false; } } } return returnValue; }</code><technical_language>failCanDoAction? considered reordering code blocks for upServer == null upServer != null</technical_language>

Target:
protected boolean canDoAction() { boolean returnValue = canRemoveVds(getVdsId(), getReturnValue().getCanDoActionMessages()); StoragePool storagePool = getStoragePoolDAO().getForVds(getParameters().getVdsId()); if (returnValue && storagePool != null && storagePool.getstorage_pool_type() == StorageType.LOCALFS) { if (!getStorageDomainDAO().getAllForStoragePool(storagePool.getId()).isEmpty()) { returnValue = failCanDoAction(VdcBllMessages.VDS_CANNOT_REMOVE_HOST_WITH_LOCAL_STORAGE); } } if (returnValue && isGlusterEnabled()) { upServer = getClusterUtils().getUpServer(getVdsGroupId()); if (!getParameters().isForceAction()) { if (hasVolumeBricksOnServer()) { returnValue = failCanDoAction(VdcBllMessages.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME); } else if (upServer == null && clusterHasMultipleHosts()) { addCanDoActionMessage(String.format("$clusterName %1$s", getVdsGroup().getname())); returnValue = failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_NO_UP_SERVER_FOUND); } } else { if (hasVolumeBricksOnServer() && upServer != null ) { returnValue = failCanDoAction(VdcBllMessages.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME); } } } return returnValue; }
Source:
<code>protected void writeTestFileName(String name, boolean append) throws FileNotFoundException { File outFileName = new File(m_testNamesFile); if ( ! outFileName.exists() ) { append = false; } <START> PrintStream ps = new PrintStream(new BufferedOutputStream(new FileOutputStream(outFileName, append))); <END> ps.print(name); ps.close(); }</code><technical_language>[Java-8 try-with-resource](<LINK_0> try(PrintStream ps = new PrintStream(new BufferedOutputStream(new FileOutputStream(outFileName, append)))) { ps.print(name); }</technical_language>

Target:
protected void writeTestFileName(String name, boolean append) throws FileNotFoundException { File outFileName = new File(m_testNamesFile); if ( ! outFileName.exists() ) { append = false; } try (PrintStream ps = new PrintStream(new BufferedOutputStream(new FileOutputStream(outFileName, append)))) { ps.print(name); } }
Source:
<code>public void close() { if (accumulator == null) { <START> accumulator = new SerializedListAccumulator<>(); <END> } getRuntimeContext().addAccumulator(id, accumulator); }</code><technical_language>skipt adding this accumulator context</technical_language>

Target:
public void close() { if (accumulator != null) { getRuntimeContext().addAccumulator(id, accumulator); } }
Source:
<code>protected Object serializableProxy() { boolean allowLoadOutsideTransaction = isAllowLoadOutsideTransactionForSerialization(); return new SerializableProxy( getEntityName(), persistentClass, interfaces, getIdentifier(), ( isReadOnlySettingAvailable() ? Boolean.valueOf( isReadOnly() ) : isReadOnlyBeforeAttachedToSession() ), <START> getSessionFactoryUuidForSerialization( allowLoadOutsideTransaction ), <END> allowLoadOutsideTransaction, getIdentifierMethod, setIdentifierMethod, componentIdType ); }</code><technical_language>I tested allowLoadOutsideTransaction call getSessionFactoryUuidForSerialization() parameter explained above</technical_language>

Target:
protected Object serializableProxy() { return new SerializableProxy( getEntityName(), persistentClass, interfaces, getIdentifier(), ( isReadOnlySettingAvailable() ? Boolean.valueOf( isReadOnly() ) : isReadOnlyBeforeAttachedToSession() ), getSessionFactoryUuid(), isAllowLoadOutsideTransaction(), getIdentifierMethod, setIdentifierMethod, componentIdType ); }
Source:
<code>public void initialize() { <START> initializeGameTable(gameService.getGames().filtered(game -> game.getStatus() == GameStatus.PLAYING)); <END> }</code><technical_language>move sorting filtering (here in initializeGameTable)</technical_language>

Target:
public void initialize() { initializeGameTable(gameService.getGames()); }
Source:
<code>public void manageAirVectors() { for (int i = 0; i < this.tasks.size(); i++) { if (((FireComboStream) this.tasks.get(i)).isCancelled()) { this.tasks.remove(i); i--; } } if (this.tasks.size() == 0) { this.remove(); return; } for (int i = 0; i < this.tasks.size(); i++) { final FireComboStream fstream = (FireComboStream) this.tasks.get(i); final Location loc = fstream.getLocation(); if (GeneralMethods.isRegionProtectedFromBuild(this, loc)) { fstream.remove(); return; } if (!this.isTransparent(loc.getBlock())) { if (!this.isTransparent(loc.clone().add(0, 0.2, 0).getBlock())) { fstream.remove(); return; } } if (i % 3 == 0) { for (final Entity entity : GeneralMethods.getEntitiesAroundPoint(loc, 2.5)) { if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation())) { this.remove(); return; } if (!entity.equals(this.player) && !(entity instanceof Player && Commands.invincible.contains(((Player) entity).getName()))) { if (this.knockback != 0) { final Vector force = fstream.getLocation().getDirection(); GeneralMethods.setVelocity(entity, force.clone().multiply(this.knockback)); new HorizontalVelocityTracker(entity, this.player, 200l, this); entity.setFallDistance(0); } if(!this.affectedEntities.contains(entity)) { this.affectedEntities.add(entity); if (this.damage != 0) { if (entity instanceof LivingEntity) { if (fstream.getAbility().getName().equalsIgnoreCase("AirSweep")) { DamageHandler.damageEntity(entity, this.damage, this); } else { DamageHandler.damageEntity(entity, this.damage, this); <START> } <END> } } } } } } } }</code><technical_language>Lines 206-210, get rid of redundancy? I write it, blaming you. suggesting add changes</technical_language>

Target:
public void manageAirVectors() { for (int i = 0; i < this.tasks.size(); i++) { if (((FireComboStream) this.tasks.get(i)).isCancelled()) { this.tasks.remove(i); i--; } } if (this.tasks.size() == 0) { this.remove(); return; } for (int i = 0; i < this.tasks.size(); i++) { final FireComboStream fstream = (FireComboStream) this.tasks.get(i); final Location loc = fstream.getLocation(); if (GeneralMethods.isRegionProtectedFromBuild(this, loc)) { fstream.remove(); return; } if (!this.isTransparent(loc.getBlock())) { if (!this.isTransparent(loc.clone().add(0, 0.2, 0).getBlock())) { fstream.remove(); return; } } if (i % 3 == 0) { for (final Entity entity : GeneralMethods.getEntitiesAroundPoint(loc, 2.5)) { if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation())) { this.remove(); return; } if (!entity.equals(this.player) && !(entity instanceof Player && Commands.invincible.contains(((Player) entity).getName()))) { if (this.knockback != 0) { final Vector force = fstream.getLocation().getDirection(); GeneralMethods.setVelocity(entity, force.clone().multiply(this.knockback)); new HorizontalVelocityTracker(entity, this.player, 200l, this); entity.setFallDistance(0); } if(!this.affectedEntities.contains(entity)) { this.affectedEntities.add(entity); if (this.damage != 0) { if (entity instanceof LivingEntity) { DamageHandler.damageEntity(entity, this.damage, this); } } } } } } } }
Source:
<code>protected void doHandle(CommandContext ctx) { ctx.terminateSession(); <START> System.exit(0); <END> }</code><technical_language>Calling System.exit needs carefully controlled break embedded usage. "Quitting" embedded CLI user wants embedding app exit. server side do this a SystemExiter interface, "exit" calls that. swap in impls of interface depending server is used. standard impl is server started command line calls System.exit. Others do not</technical_language>

Target:
protected void doHandle(CommandContext ctx) { ctx.terminateSession(); }
Source:
<code>public void save(OpenWorkpiece openWorkpiece) throws IOException { URI uri = openWorkpiece.getUri(); try (OutputStream out = ServiceManager.getFileService().write(uri, openWorkpiece.getLockResult())) { logger.info("Saving {}", uri.toString()); <START> metsXmlElementAccess.save(openWorkpiece.getWorkpiece(), out); <END> } }</code><technical_language>call method write</technical_language>

Target:
public void save(OpenWorkpiece openWorkpiece) throws IOException { URI uri = openWorkpiece.getUri(); try (OutputStream out = ServiceManager.getFileService().write(uri, openWorkpiece.getLockResult())) { logger.info("Saving {}", uri.toString()); write(openWorkpiece.getWorkpiece(), out); } }
Source:
<code>public int getBucket(Page page, int position) { long hash = 0; for (int i = 0; i < page.getChannelCount(); i++) { Block block = page.getBlock(i); long value = functions[i].hash(block, position); hash = (hash * 31) + value; } <START> return positiveInt(hash) % bucketCount; <END> }</code><technical_language>Consider code com.facebook.presto.spi.block.MapBlockBuilder#computePosition</technical_language>

Target:
public int getBucket(Page page, int position) { long hash = 0; for (int i = 0; i < page.getChannelCount(); i++) { Block block = page.getBlock(i); long value = functions[i].hash(block, position); hash = (hash * 31) + value; } return computeBucket(hash, bucketCount); }
Source:
<code>public void executeTask( @NotNull final Map<String, Object> context ) throws GenieException { log.debug("Executing Command Task in the workflow."); super.executeTask(context); createEntityInstanceDirectory( this.jobExecEnv.getCommand().getId(), AdminResources.COMMAND ); createEntityInstanceConfigDirectory( this.jobExecEnv.getCommand().getId(), AdminResources.COMMAND ); createEntityInstanceDependenciesDirectory( this.jobExecEnv.getCommand().getId(), AdminResources.COMMAND ); final String commandSetupFile = jobExecEnv.getCommand().getSetupFile(); if (commandSetupFile != null && StringUtils.isNotBlank(commandSetupFile)) { final String localPath = super.buildLocalFilePath( this.jobWorkingDirectory, jobExecEnv.getCommand().getId(), commandSetupFile, FileType.SETUP, AdminResources.COMMAND ); this.fts.getFile(commandSetupFile, localPath); Utils.appendToWriter(writer, "# Sourcing setup file from command " + jobExecEnv.getCommand().getId()); Utils.appendToWriter(writer, JobConstants.SOURCE + localPath.replace(this.jobWorkingDirectory, "${" + JobConstants.GENIE_JOB_DIR_ENV_VAR + "}") + JobConstants.SEMICOLON_SYMBOL); <START> Utils.appendToWriter(writer, " "); <END> } for (final String configFile: jobExecEnv.getCommand().getConfigs()) { final String localPath = super.buildLocalFilePath( this.jobWorkingDirectory, jobExecEnv.getCommand().getId(), configFile, FileType.CONFIG, AdminResources.COMMAND ); this.fts.getFile(configFile, localPath); } }</code><technical_language>this pretty exact code is in cluster task file? factored out reusable</technical_language>

Target:
public void executeTask( @NotNull final Map<String, Object> context ) throws GenieException, IOException { log.debug("Executing Command Task in the workflow."); super.executeTask(context); createEntityInstanceDirectory( this.jobExecEnv.getCommand().getId(), AdminResources.COMMAND ); createEntityInstanceConfigDirectory( this.jobExecEnv.getCommand().getId(), AdminResources.COMMAND ); createEntityInstanceDependenciesDirectory( this.jobExecEnv.getCommand().getId(), AdminResources.COMMAND ); final String commandSetupFile = jobExecEnv.getCommand().getSetupFile(); if (commandSetupFile != null && StringUtils.isNotBlank(commandSetupFile)) { final String localPath = super.buildLocalFilePath( this.jobWorkingDirectory, jobExecEnv.getCommand().getId(), commandSetupFile, FileType.SETUP, AdminResources.COMMAND ); this.fts.getFile(commandSetupFile, localPath); super.generateSetupFileSourceSnippet( jobExecEnv.getCommand().getId(), "Command:", localPath); } for (final String configFile: jobExecEnv.getCommand().getConfigs()) { final String localPath = super.buildLocalFilePath( this.jobWorkingDirectory, jobExecEnv.getCommand().getId(), configFile, FileType.CONFIG, AdminResources.COMMAND ); this.fts.getFile(configFile, localPath); } }
Source:
<code>private boolean preUndeleteValidation(CloudBlobMetadata metadata, StoreKey key, Map<String, Object> updateFields) throws StoreException { validateAccountAndContainer(Collections.singletonMap(key.getID(), metadata), Collections.singletonList(key)); short requestedLifeVersion = (short) updateFields.get(FIELD_LIFE_VERSION); if (isVcr) { return metadata.getLifeVersion() < requestedLifeVersion; } if (metadata.isExpired()) { throw new StoreException("Id " + key + " already expired in cloud ", StoreErrorCodes.TTL_Expired); } else if (metadata.isUndeleted()) { throw new StoreException("Id " + key + " is already undeleted in cloud", StoreErrorCodes.ID_Undeleted); } else if (!metadata.isDeleted()) { throw new StoreException("Id " + key + " is not deleted yet in cloud ", StoreErrorCodes.ID_Not_Deleted); <START> } else if (metadata.getDeletionTime() + TimeUnit.DAYS.toMillis(storeConfig.storeDeletedMessageRetentionHours) <END> < System.currentTimeMillis()) { throw new StoreException("Id " + key + " already permanently deleted in cloud ", StoreErrorCodes.ID_Deleted_Permanently); } updateFields.put(FIELD_LIFE_VERSION, metadata.getLifeVersion() + 1); return true; }</code><technical_language>TimeUnit.HOURS.toMillis</technical_language>

Target:
private boolean preUndeleteValidation(CloudBlobMetadata metadata, StoreKey key, Map<String, Object> updateFields) throws StoreException { validateAccountAndContainer(Collections.singletonMap(key.getID(), metadata), Collections.singletonList(key)); short requestedLifeVersion = (short) updateFields.get(FIELD_LIFE_VERSION); if (isVcr) { return metadata.getLifeVersion() < requestedLifeVersion; } if (metadata.isExpired()) { throw new StoreException("Id " + key + " already expired in cloud ", StoreErrorCodes.TTL_Expired); } else if (metadata.isUndeleted()) { throw new StoreException("Id " + key + " is already undeleted in cloud", StoreErrorCodes.ID_Undeleted); } else if (!metadata.isDeleted()) { throw new StoreException("Id " + key + " is not deleted yet in cloud ", StoreErrorCodes.ID_Not_Deleted); } else if (metadata.getDeletionTime() + TimeUnit.HOURS.toMillis(storeConfig.storeDeletedMessageRetentionHours) < System.currentTimeMillis()) { throw new StoreException("Id " + key + " already permanently deleted in cloud ", StoreErrorCodes.ID_Deleted_Permanently); } updateFields.put(FIELD_LIFE_VERSION, metadata.getLifeVersion() + 1); return true; }
Source:
<code>private XSDTypeDefinition searchType(SchemaIndex schemaIndex, String... typesNames) { for (String typeName : typesNames) { XSDTypeDefinition type = schemaIndex.getTypeDefinition(gml.qName(typeName)); if (type != null) { return type; } } LOGGER.warning(String.format("No type definition found for types [%s].", <START> Arrays.stream(typesNames).collect(Collectors.joining(", ")))); <END> return null; }</code><technical_language>I tend "fine" for problems parsing geotools is a library. Feedback only; need change</technical_language>

Target:
private XSDTypeDefinition searchType(SchemaIndex schemaIndex, String... typesNames) { for (String typeName : typesNames) { XSDTypeDefinition type = schemaIndex.getTypeDefinition(gml.qName(typeName)); if (type != null) { return type; } } LOGGER.fine(String.format("No type definition found for types [%s].", Arrays.stream(typesNames).collect(Collectors.joining(", ")))); return null; }
Source:
<code>public D withSideInputs(List<String> sideInputs) { this.sideInputs = sideInputs; this.enableChangelog = false; <START> this.changelogStream = null; <END> return (D) this; }</code><technical_language>need set changelogReplicationFactor null well</technical_language>

Target:
public D withSideInputs(List<String> sideInputs) { this.sideInputs = sideInputs; this.enableChangelog = false; this.changelogStream = null; this.changelogReplicationFactor = null; return (D) this; }
Source:
<code>private void handleException(Throwable e) { <START> log.error(String.format("Failed to import certificate: %1$s", e.getMessage())); <END> log.debug("Exception", e); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__PROVIDER_CERTIFICATE); }</code><technical_language>please compare in removed this class. log.error("Failed import certificate: {}", e.getMessage());</technical_language>

Target:
private void handleException(Throwable e) { log.error(String.format("Failed to import certificate: %1$s", e.getMessage())); log.debug("Exception", e); throw new VdcBLLException(VdcBllErrors.PROVIDER_IMPORT_CERTIFICATE_ERROR, e.getMessage()); }
Source:
<code>public static Value decode( long[] valueBlocks, int offset ) { long firstBlock = valueBlocks[offset]; int gtype = getGeometryType( firstBlock ); int dimension = getDimension( firstBlock ); if ( isFloatPrecision( firstBlock ) ) { throw new UnsupportedOperationException( "Float precision is unsupported in Geometry properties" ); } if ( dimension > 3 ) { <START> throw new UnsupportedOperationException( "Points with more than 3 dimensions are not supported in the PropertyStore" ); <END> } CoordinateReferenceSystem crs = CoordinateReferenceSystem.get( getCRSTable( firstBlock ), getCRSCode( firstBlock ) ); return find( gtype ).decode( crs, dimension, valueBlocks, offset ); }</code><technical_language>i "Points more 3 dimensions supported" of supported/unsupported property format related independently type of store</technical_language>

Target:
public static Value decode( long[] valueBlocks, int offset ) { long firstBlock = valueBlocks[offset]; int gtype = getGeometryType( firstBlock ); int dimension = getDimension( firstBlock ); if ( isFloatPrecision( firstBlock ) ) { throw new UnsupportedOperationException( "Float precision is unsupported in Geometry properties" ); } if ( dimension > GeometryType.getMaxSupportedDimensions() ) { throw new UnsupportedOperationException( "Points with more than " + GeometryType.getMaxSupportedDimensions() + " dimensions are not supported" ); } CoordinateReferenceSystem crs = CoordinateReferenceSystem.get( getCRSTable( firstBlock ), getCRSCode( firstBlock ) ); return find( gtype ).decode( crs, dimension, valueBlocks, offset ); }
Source:
<code>public HdfsToTeradataJob(String jobid, Props sysProps, Props jobProps, Logger log) throws RuntimeException { super(jobid, sysProps, jobProps, log); jobProps.put(TdchConstants.LIB_JARS_KEY, sysProps.get(TdchConstants.LIB_JARS_KEY)); <START> TeraDataWalletInitializer.initialize(new File(getCwd()), new File(sysProps.get(TdchConstants.TD_WALLET_JAR))); <END> }</code><technical_language>In case /export/apps/azkaban/azkaban-exec-server/current/temp. I azkaban temp directory extract project zips, etc</technical_language>

Target:
public HdfsToTeradataJob(String jobid, Props sysProps, Props jobProps, Logger log) throws RuntimeException { super(jobid, sysProps, jobProps, log); jobProps.put(TdchConstants.LIB_JARS_KEY, sysProps.get(TdchConstants.LIB_JARS_KEY)); File tempDir = new File(sysProps.getString("azkaban.temp.dir", "temp")); TeraDataWalletInitializer.initialize(tempDir, new File(sysProps.get(TdchConstants.TD_WALLET_JAR))); }
Source:
<code><START> public boolean containsResource() { <END> return this.hasResource; }</code><technical_language>Declare this abstract a default implementation, override in subclasses. VarDeclaration contains a resource; ValDeclaration contains depending type; TypeDeclaration contains a resource</technical_language>

Target:
public boolean containsResource() { return false; }
Source:
<code>public Mono<ConfigurationSetting> deleteSetting(String key, String label) { return withContext( context -> deleteSetting(new ConfigurationSetting().setKey(key).setLabel(label), false, context)) .map(response -> response.getValue()); <START> } <END></code><technical_language>This needs justOrEmpty response null is illegal in a Reactor stream</technical_language>

Target:
public Mono<ConfigurationSetting> deleteSetting(String key, String label) { return withContext( context -> deleteSetting(new ConfigurationSetting().setKey(key).setLabel(label), false, context)) .flatMap(response -> Mono.justOrEmpty(response.getValue())); }
Source:
<code><START> public void testRequestTokenRenew() { <END> Map<String, String> userDTO = new HashMap<>(); userDTO.put("username", user.getUsername()); userDTO.put("password", userCleartextPassword); given(). when(). content(userDTO).contentType(ContentType.JSON). post("/token"). then(). statusCode(HttpStatus.SC_OK); Optional<AuthenticationToken> authenticationToken = authenticationTokenRepository.findByUserUsername(user.getUsername()); Assert.assertTrue(authenticationToken.isPresent()); }</code><technical_language>I feel this test test switched titles</technical_language>

Target:
public void testRequestTokenRenew() { Map<String, String> userDTO = new HashMap<>(); userDTO.put("username", user.getUsername()); userDTO.put("password", userCleartextPassword); given(). when(). content(userDTO).contentType(ContentType.JSON). post("/token"). then(). statusCode(HttpStatus.SC_OK); AuthenticationToken authenticationToken1 = authenticationTokenRepository.findByUserUsername(user.getUsername()).orElse(null); given(). when(). content(userDTO).contentType(ContentType.JSON). post("/token"). then(). statusCode(HttpStatus.SC_OK); AuthenticationToken authenticationToken2 = authenticationTokenRepository.findByUserUsername(user.getUsername()).orElse(null); Assert.assertFalse(authenticationToken1.equals(authenticationToken2)); }
Source:
<code>public synchronized void onEvent(TransactionEvent transactionEvent) { if (transactionEvent.getTypes().contains(EventType.ASSOCIATED)) { transactionDisassociatedFromApplication = false; } else if(transactionEvent.getTypes().contains(EventType.DISASSOCIATING)) { transactionDisassociatedFromApplication = true; } <START> safeCloseEntityManager(); <END> }</code><technical_language>Is this right? lots of code pushes pops transaction context suspend/resume. wrong close entity manager this</technical_language>

Target:
public synchronized void onEvent(TransactionEvent transactionEvent) { transactionDisassociatedFromApplication = transactionEvent.getTypes().contains(EventType.DISASSOCIATING); safeCloseEntityManager(); }
Source:
<code>private String convertFipsUsStateNameToFipsUsStateCode(String fipsStateName) { Map<String, Object> fieldValues = new HashMap(); fieldValues.put("active", true); fieldValues.put("countryCode", KFSConstants.COUNTRY_CODE_UNITED_STATES); Collection<State> allStatesForUsFipsCountryCode = businessObjectService.findMatching(State.class, fieldValues); <START> List<State> matchingStates = allStatesForUsFipsCountryCode.stream() <END> .filter(stateItem -> stateItem.getName().equalsIgnoreCase(fipsStateName)) .filter(stateItem -> stateItem.isActive()) .collect(ArrayList::new, ArrayList::add, ArrayList::addAll); LOG.info("convertFipsUsStateNameToFipsUsStateCode: matchingStates = " + matchingStates.toString()); if (matchingStates.size() == 1) { LOG.info("convertFipsUsStateNameToFipsUsStateCode: stateCode being returned = " + matchingStates.get(0).getCode()); return matchingStates.get(0).getCode(); } else { LOG.info("convertFipsUsStateNameToFipsUsStateCode: fipsStateName being returned, could not find stateCode in Rice table = " + fipsStateName); return fipsStateName; } }</code><technical_language>Log message line 343 updated longer Rice tables</technical_language>

Target:
private String convertFipsUsStateNameToFipsUsStateCode(String fipsStateName) { Map<String, Object> fieldValues = new HashMap<>(); fieldValues.put("active", true); fieldValues.put("countryCode", KFSConstants.COUNTRY_CODE_UNITED_STATES); Collection<State> allStatesForUsFipsCountryCode = businessObjectService.findMatching(State.class, fieldValues); List<State> matchingStates = allStatesForUsFipsCountryCode.stream() .filter(stateItem -> stateItem.getName().equalsIgnoreCase(fipsStateName)) .filter(stateItem -> stateItem.isActive()) .collect(ArrayList::new, ArrayList::add, ArrayList::addAll); LOG.info("convertFipsUsStateNameToFipsUsStateCode: matchingStates = " + matchingStates.toString()); if (matchingStates.size() == 1) { LOG.info("convertFipsUsStateNameToFipsUsStateCode: stateCode being returned = " + matchingStates.get(0).getCode()); return matchingStates.get(0).getCode(); } else { LOG.info("convertFipsUsStateNameToFipsUsStateCode: fipsStateName being returned, could not find stateCode = " + fipsStateName); return fipsStateName; } }
Source:
<code>private boolean validateHosts() { List<Guid> hostIds = getParameters().getAffinityGroup().getVdsIds(); if (hostIds.isEmpty()) { <START> if (getParameters().getAffinityGroup().isVdsAffinityEnabled()) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_AFFINITY_GROUP_WITH_HOST_AFFINITY_BUT_NO_HOSTS, String.format("$polarity %s", getAffinityGroup().isVdsPositive() ? "positive": "negative")); } <END> return true; } Map<Guid, VdsStatic> hosts = vdsStaticDao.getByIds(hostIds).stream() .collect(Collectors.toMap(VdsStatic::getId, host -> host)); Set<Guid> vdsSet = new HashSet<>(); for (Guid vdsId : hostIds) { VdsStatic vdsStatic = hosts.get(vdsId); if (vdsStatic == null) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_INVALID_ENTITY_FOR_AFFINITY_GROUP, String .format("$entity %s", Entity_VDS)); } if (!Objects.equals(vdsStatic.getClusterId(), getClusterId())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_ENTITY_NOT_IN_AFFINITY_GROUP_CLUSTER, String .format("$entity %s", Entity_VDS)); } if (vdsSet.contains(vdsStatic.getId())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_DUPLICATE_ENTITY_IN_AFFINITY_GROUP, String .format("$entity %s", Entity_VDS)); } vdsSet.add(vdsStatic.getId()); } return true; }</code><technical_language>I fail here. break compatibility for people expecting host affinity enabled</technical_language>

Target:
private boolean validateHosts() { List<Guid> hostIds = getParameters().getAffinityGroup().getVdsIds(); if (hostIds.isEmpty()) { return true; } Map<Guid, VdsStatic> hosts = vdsStaticDao.getByIds(hostIds).stream() .collect(Collectors.toMap(VdsStatic::getId, host -> host)); Set<Guid> vdsSet = new HashSet<>(); for (Guid vdsId : hostIds) { VdsStatic vdsStatic = hosts.get(vdsId); if (vdsStatic == null) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_INVALID_ENTITY_FOR_AFFINITY_GROUP, String .format("$entity %s", Entity_VDS)); } if (!Objects.equals(vdsStatic.getClusterId(), getClusterId())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_ENTITY_NOT_IN_AFFINITY_GROUP_CLUSTER, String .format("$entity %s", Entity_VDS)); } if (vdsSet.contains(vdsStatic.getId())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_DUPLICATE_ENTITY_IN_AFFINITY_GROUP, String .format("$entity %s", Entity_VDS)); } vdsSet.add(vdsStatic.getId()); } return true; }
Source:
<code>public void stop() throws MuleException { super.stop(); stopIfNeeded(delegate); <START> stopIfNeeded(backpressureHandler); <END> disposeIfNeeded(sink, logger); sink = null; if (reactorScheduler != null) { reactorScheduler.dispose(); reactorScheduler = null; } stopIfNeeded(processingStrategy); }</code><technical_language>this wrapped in FunctionalUtils.safely() if this fails, rest is disposed correctly</technical_language>

Target:
public void stop() throws MuleException { super.stop(); stopIfNeeded(delegate); safely(() -> stopIfNeeded(backpressureHandler)); disposeIfNeeded(sink, logger); sink = null; if (reactorScheduler != null) { reactorScheduler.dispose(); reactorScheduler = null; } stopIfNeeded(processingStrategy); }
Source:
<code>protected void loadConfigFile(String filename, Map<String, byte[]> configs) { if (filename != null) { try { InputStream is = getClass().getClassLoader().getResourceAsStream(filename); <START> ByteArrayOutputStream bos = new ByteArrayOutputStream(); <END> int length; byte[] content = new byte[1024]; while ((length = is.read(content, 0, content.length)) != -1) { bos.write(content, 0, length); } configs.put(filename, bos.toByteArray()); } catch (Exception e) { log.error("Error while reading configuration file (" + filename + ")", e); } } }</code><technical_language>org.radargun.utils.Utils.readAsBytes() here</technical_language>

Target:
private void loadConfigFile(String filename, Map<String, byte[]> configs) { if (filename != null) { try { InputStream is = getClass().getClassLoader().getResourceAsStream(filename); configs.put(filename, Utils.readAsBytes(is)); } catch (Exception e) { log.error("Error while reading configuration file (" + filename + ")", e); } } }
Source:
<code>private static Response responseWithHeaders(ResponseBuilder builder, ProxyResponse response) { <START> response.getHeaders().asMap().forEach((headerName, values) -> { <END> String name = headerName.toString(); if (isPrestoHeader(name) || name.equalsIgnoreCase(SET_COOKIE)) { values.forEach(value -> builder.header(name, value)); } }); return builder.build(); }</code><technical_language>response.getHeaders().forEach((headerName, value) work? remove asMap()</technical_language>

Target:
private static Response responseWithHeaders(ResponseBuilder builder, ProxyResponse response) { response.getHeaders().forEach((headerName, value) -> { String name = headerName.toString(); if (isPrestoHeader(name) || name.equalsIgnoreCase(SET_COOKIE)) { builder.header(name, value); } }); return builder.build(); }
Source:
<code>public static void openInEditor(Location location, IWorkbenchPage page) { IEditorPart part = null; IDocument targetDocument = null; IResource targetResource = LSPEclipseUtils.findResourceFor(location.getUri()); try { if (targetResource != null && targetResource.getType() == IResource.FILE) { part = IDE.openEditor(page, (IFile) targetResource); targetDocument = FileBuffers.getTextFileBufferManager() .getTextFileBuffer(targetResource.getFullPath(), LocationKind.IFILE).getDocument(); } else { URI fileUri = URI.create(location.getUri()); <START> part = IDE.openEditor(page, fileUri, getEditorId(page, location.getUri()), true); <END> targetDocument = FileBuffers.getTextFileBufferManager() .getTextFileBuffer(new Path(fileUri.getPath()), LocationKind.LOCATION).getDocument(); } } catch (PartInitException e) { e.printStackTrace(); } try { if (part instanceof AbstractTextEditor) { AbstractTextEditor editor = (AbstractTextEditor) part; int offset = LSPEclipseUtils.toOffset(location.getRange().getStart(), targetDocument); int endOffset = LSPEclipseUtils.toOffset(location.getRange().getEnd(), targetDocument); editor.getSelectionProvider() .setSelection(new TextSelection(offset, endOffset > offset ? endOffset - offset : 0)); } } catch (BadLocationException e) { e.printStackTrace(); } }</code><technical_language>I mimic behaviour of "OpenLocalFileAction" EFS IDE.openEditorOnFileStore()). WDYT</technical_language>

Target:
public static void openInEditor(Location location, IWorkbenchPage page) { IEditorPart part = null; IDocument targetDocument = null; IResource targetResource = LSPEclipseUtils.findResourceFor(location.getUri()); try { if (targetResource != null && targetResource.getType() == IResource.FILE) { part = IDE.openEditor(page, (IFile) targetResource); targetDocument = FileBuffers.getTextFileBufferManager() .getTextFileBuffer(targetResource.getFullPath(), LocationKind.IFILE).getDocument(); } else { URI fileUri = URI.create(location.getUri()).normalize(); IFileStore fileStore = EFS.getLocalFileSystem().getStore(fileUri); IFileInfo fetchInfo = fileStore.fetchInfo(); if (!fetchInfo.isDirectory() && fetchInfo.exists()) { part = IDE.openEditorOnFileStore(page, fileStore); ITextFileBuffer fileStoreTextFileBuffer = FileBuffers.getTextFileBufferManager() .getFileStoreTextFileBuffer(fileStore); targetDocument = fileStoreTextFileBuffer.getDocument(); } } } catch (PartInitException e) { e.printStackTrace(); } try { if (part instanceof AbstractTextEditor) { AbstractTextEditor editor = (AbstractTextEditor) part; int offset = LSPEclipseUtils.toOffset(location.getRange().getStart(), targetDocument); int endOffset = LSPEclipseUtils.toOffset(location.getRange().getEnd(), targetDocument); editor.getSelectionProvider() .setSelection(new TextSelection(offset, endOffset > offset ? endOffset - offset : 0)); } } catch (BadLocationException e) { e.printStackTrace(); } }
Source:
<code>private void setCoordinates(long start, long end) { if (start < 0 || end < 0) { <START> throw new IllegalArgumentException("Variant co-ordinate cannot be negative: " + this.toString()); <END> } if (end < start) { throw new IllegalArgumentException("End position must be equal or greater than the start position"); } this.start = start; this.end = end; }</code><technical_language>'coordinate' is a single word. calling toString a constructor lead unexpected information displayed, object partially constructed point. preferable show negative coordinate instead</technical_language>

Target:
private void setCoordinates(long start, long end) { if (start < 0) { throw new IllegalArgumentException(VARIANT_START_COORDINATE_CANNOT_BE_NEGATIVE); } if (end < 0) { throw new IllegalArgumentException(VARIANT_END_COORDINATE_CANNOT_BE_NEGATIVE); } if (end < start) { throw new IllegalArgumentException(END_POSITION_MUST_BE_EQUAL_OR_GREATER_THAN_THE_START_POSITION); } this.start = start; this.end = end; }
Source:
<code>public void shouldDeserializeValues(Object memoryLimit, Object parsedLimit) throws ValidationException { <START> ComposeRecipe service = <END> factory.doParse(String.format(RECIPE_WITHOUT_COMMAND_VALUE, memoryLimit)); assertEquals(service.getServices().get("machine1").getMemLimit(), parsedLimit); }</code><technical_language>Name of var is misleading - is a recipe a number of services</technical_language>

Target:
public void shouldDeserializeValues(Object memoryLimit, Object parsedLimit) throws ValidationException { ComposeRecipe recipe = factory.doParse(String.format(RECIPE_WITHOUT_MEMORY_LIMIT, memoryLimit)); assertEquals(recipe.getServices().get("machine1").getMemLimit(), parsedLimit); }
Source:
<code>private Long createProviderTestTask() { TaskTriggerInformation triggerInformation = new TaskTriggerInformation("CREATE SettingsRecord", "data-services", MDS_CHANNEL_NAME, VERSION, TRIGGER_SUBJECT, TRIGGER_SUBJECT); TaskActionInformation actionInformation = new TaskActionInformation("Create Patient [" + DEFAULT_CONFIG_NAME + "]", OPENMRS_CHANNEL_NAME, OPENMRS_CHANNEL_NAME, VERSION, TEST_INTERFACE, "createPatient"); actionInformation.setSubject("validate"); SortedSet<TaskConfigStep> taskConfigStepSortedSet = new TreeSet<>(); taskConfigStepSortedSet.add(createProviderDataSource()); TaskConfig taskConfig = new TaskConfig(); taskConfig.addAll(taskConfigStepSortedSet); Map<String, String> values = new HashMap<>(); values.put(Keys.GIVEN_NAME, "GivenName"); values.put(Keys.FAMILY_NAME, "FamilyName"); values.put(Keys.ADDRESS_1, "{{ad.openMRS.Provider-" + DEFAULT_CONFIG_NAME + "#0.uuid}}"); values.put(Keys.ADDRESS_2, "{{ad.openMRS.Provider-" + DEFAULT_CONFIG_NAME + "#0.identifier}}"); values.put(Keys.ADDRESS_3, "{{ad.openMRS.Provider-" + DEFAULT_CONFIG_NAME + "#0.person.uuid}}"); values.put(Keys.GENDER, "M"); values.put(Keys.MOTECH_ID, TEST_MOTECH_ID); values.put(Keys.CONFIG_NAME, DEFAULT_CONFIG_NAME); actionInformation.setValues(values); <START> Task task = new Task("OpenMRSProviderTestTask", triggerInformation, Arrays.asList(actionInformation), taskConfig, true, true); <END> getTaskService().save(task); getTriggerHandler().registerHandlerFor(task.getTrigger().getEffectiveListenerSubject()); return task.getId(); }</code><technical_language>singletonList</technical_language>

Target:
private Long createProviderTestTask() { TaskTriggerInformation triggerInformation = new TaskTriggerInformation("CREATE SettingsRecord", "data-services", MDS_CHANNEL_NAME, VERSION, TRIGGER_SUBJECT, TRIGGER_SUBJECT); TaskActionInformation actionInformation = new TaskActionInformation("Create Patient [" + DEFAULT_CONFIG_NAME + "]", OPENMRS_CHANNEL_NAME, OPENMRS_CHANNEL_NAME, VERSION, TEST_INTERFACE, "createPatient"); actionInformation.setSubject("validate"); SortedSet<TaskConfigStep> taskConfigStepSortedSet = new TreeSet<>(); taskConfigStepSortedSet.add(createProviderDataSource()); TaskConfig taskConfig = new TaskConfig(); taskConfig.addAll(taskConfigStepSortedSet); Map<String, String> values = new HashMap<>(); values.put(Keys.GIVEN_NAME, "GivenName"); values.put(Keys.FAMILY_NAME, "FamilyName"); values.put(Keys.ADDRESS_1, "{{ad.openMRS.Provider-" + DEFAULT_CONFIG_NAME + "#0.uuid}}"); values.put(Keys.ADDRESS_2, "{{ad.openMRS.Provider-" + DEFAULT_CONFIG_NAME + "#0.identifier}}"); values.put(Keys.ADDRESS_3, "{{ad.openMRS.Provider-" + DEFAULT_CONFIG_NAME + "#0.person.uuid}}"); values.put(Keys.GENDER, "M"); values.put(Keys.MOTECH_ID, TEST_MOTECH_ID); values.put(Keys.CONFIG_NAME, DEFAULT_CONFIG_NAME); actionInformation.setValues(values); Task task = new Task("OpenMRSProviderTestTask", triggerInformation, Collections.singletonList(actionInformation), taskConfig, true, true); getTaskService().save(task); getTriggerHandler().registerHandlerFor(task.getTrigger().getEffectiveListenerSubject()); return task.getId(); }
Source:
<code>private void init() throws Exception { mOffsetTracker = new OffsetTracker(); mMessageReader = new MessageReader(mConfig, mOffsetTracker); FileRegistry fileRegistry = new FileRegistry(mConfig); UploadManager uploadManager = ReflectionUtil.createUploadManager(mConfig.getUploadManagerClass(), mConfig); <START> mUploader = ReflectionUtil.createUploader(mConfig.getUploaderClass(), mConfig, mOffsetTracker, fileRegistry, uploadManager); <END> mMessageWriter = new MessageWriter(mConfig, mOffsetTracker, fileRegistry); mMessageParser = ReflectionUtil.createMessageParser(mConfig.getMessageParserClass(), mConfig); mMessageTransformer = ReflectionUtil.createMessageTransformer(mConfig.getMessageTransformerClass(), mConfig); mUnparsableMessages = 0.; }</code><technical_language>If reflection create instance, standard is create object no-arg constructor reflection, call a configure method rest of arguments</technical_language>

Target:
private void init() throws Exception { mOffsetTracker = new OffsetTracker(); mMessageReader = new MessageReader(mConfig, mOffsetTracker); FileRegistry fileRegistry = new FileRegistry(mConfig); UploadManager uploadManager = ReflectionUtil.createUploadManager(mConfig.getUploadManagerClass(), mConfig); mUploader = ReflectionUtil.createUploader(mConfig.getUploaderClass()); mUploader.init(mConfig, mOffsetTracker, fileRegistry, uploadManager); mMessageWriter = new MessageWriter(mConfig, mOffsetTracker, fileRegistry); mMessageParser = ReflectionUtil.createMessageParser(mConfig.getMessageParserClass(), mConfig); mMessageTransformer = ReflectionUtil.createMessageTransformer(mConfig.getMessageTransformerClass(), mConfig); mUnparsableMessages = 0.; }
Source:
<code>public void setUp() { registry = new CollectorRegistry(); noLabels = Summary.build().name("nolabels").help("help").register(registry); labels = Summary.build().name("labels").help("help").labelNames("l").register(registry); noLabelsAndQuantiles = Summary.build() .quantile(0.5, 0.05) .quantile(0.9, 0.01) .quantile(0.99, 0.001) <START> .name("noLabelsAndQuantiles").help("help").register(registry); <END> labelsAndQuantiles = Summary.build() .quantile(0.5, 0.05) .quantile(0.9, 0.01) .quantile(0.99, 0.001) .labelNames("l") .name("labelsAndQuantiles").help("help").register(registry); }</code><technical_language>underscores convention for metric names</technical_language>

Target:
public void setUp() { registry = new CollectorRegistry(); noLabels = Summary.build().name("nolabels").help("help").register(registry); labels = Summary.build().name("labels").help("help").labelNames("l").register(registry); noLabelsAndQuantiles = Summary.build() .quantile(0.5, 0.05) .quantile(0.9, 0.01) .quantile(0.99, 0.001) .name("no_labels_and_quantiles").help("help").register(registry); labelsAndQuantiles = Summary.build() .quantile(0.5, 0.05) .quantile(0.9, 0.01) .quantile(0.99, 0.001) .labelNames("l") .name("labels_and_quantiles").help("help").register(registry); }
Source:
<code><START> public Single<String> getCaptionByWikibaseIdentifier(String wikibaseIdentifier) { <END> return mediaDetailInterface.getCaptionForImage(Locale.getDefault().getLanguage(), wikibaseIdentifier) .map(mediaDetailResponse -> { if (mediaDetailResponse != null && mediaDetailResponse.getSuccess() != null && mediaDetailResponse.getSuccess() == 1 && mediaDetailResponse.getEntities() != null) { Map<String, CommonsWikibaseItem> entities = mediaDetailResponse.getEntities(); try { Map.Entry<String, CommonsWikibaseItem> entry = entities.entrySet().iterator().next(); CommonsWikibaseItem commonsWikibaseItem = entry.getValue(); Map<String, Caption> labels = commonsWikibaseItem.getLabels(); Map.Entry<String, Caption> captionEntry = labels.entrySet().iterator().next(); Caption caption = captionEntry.getValue(); return caption.getValue(); } catch (Exception e) { return NO_CAPTION; } } return NO_CAPTION; }) .singleOrError(); }</code><technical_language>Wow this method scary. I guess simplified</technical_language>

Target:
public Single<String> getCaptionByWikibaseIdentifier(String wikibaseIdentifier) { return mediaDetailInterface.getCaptionForImage(Locale.getDefault().getLanguage(), wikibaseIdentifier) .map(mediaDetailResponse -> { if (isSuccess(mediaDetailResponse)) { for (Entity wikibaseItem : mediaDetailResponse.entities().values()) { for (Label label : wikibaseItem.labels().values()) { return label.value(); } } } return NO_CAPTION; }) .singleOrError(); }
Source:
<code>public static void beforeClass() { String envId = StringUtils.defaultIfBlank(System.getenv(SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR), System.getenv(SDKGlobalConfiguration.ALTERNATE_ACCESS_KEY_ENV_VAR)); String envSecret = StringUtils.defaultIfBlank(System.getenv(SDKGlobalConfiguration.SECRET_KEY_ENV_VAR), System.getenv(SDKGlobalConfiguration.ALTERNATE_SECRET_KEY_ENV_VAR)); String envToken = StringUtils.defaultIfBlank(System.getenv(SDKGlobalConfiguration.AWS_SESSION_TOKEN_ENV_VAR), ""); <START> String envBucketName = StringUtils.defaultIfBlank(System.getenv("AWS_BUCKET_NAME_ENV_VAR"),"nuxeo-s3-directupload"); <END> String envBucketPrefix = StringUtils.defaultIfBlank(System.getenv("AWS_BUCKET_PREFIX_ENV_VAR"),"testfolder/"); String envBucketRegion = StringUtils.defaultIfBlank(System.getenv("AWS_BUCKET_REGION_ENV_VAR"),"eu-west-3"); assumeTrue("AWS Credentials not set in the environment variables", StringUtils.isNoneBlank(envId, envSecret)); PROPERTIES = new HashMap<>(); PROPERTIES.put(AWS_ID_PROPERTY, envId); PROPERTIES.put(AWS_SECRET_PROPERTY, envSecret); PROPERTIES.put(AWS_SESSION_TOKEN_PROPERTY, envToken); PROPERTIES.put(BUCKET_NAME_PROPERTY, envBucketName); PROPERTIES.put(BUCKET_PREFIX_PROPERTY, envBucketPrefix); PROPERTIES.put(S3BinaryManager.BUCKET_REGION_PROPERTY, envBucketRegion); }</code><technical_language>Add a space ,</technical_language>

Target:
public static void beforeClass() { String envId = StringUtils.defaultIfBlank(System.getenv(SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR), System.getenv(SDKGlobalConfiguration.ALTERNATE_ACCESS_KEY_ENV_VAR)); String envSecret = StringUtils.defaultIfBlank(System.getenv(SDKGlobalConfiguration.SECRET_KEY_ENV_VAR), System.getenv(SDKGlobalConfiguration.ALTERNATE_SECRET_KEY_ENV_VAR)); String envToken = StringUtils.defaultIfBlank(System.getenv(SDKGlobalConfiguration.AWS_SESSION_TOKEN_ENV_VAR), ""); String envBucketName = StringUtils.defaultIfBlank(System.getenv(BUCKET_NAME_NUXEO_TEST), "nuxeo-s3-directupload"); String envBucketPrefix = StringUtils.defaultIfBlank(System.getenv(BUCKET_PREFIX_NUXEO_TEST), "testfolder/"); String envBucketRegion = StringUtils.defaultIfBlank(System.getenv(BUCKET_REGION_NUXEO_TEST), "eu-west-3"); assumeTrue("AWS Credentials not set in the environment variables", StringUtils.isNoneBlank(envId, envSecret)); PROPERTIES = new HashMap<>(); PROPERTIES.put(AWS_ID_PROPERTY, envId); PROPERTIES.put(AWS_SECRET_PROPERTY, envSecret); PROPERTIES.put(AWS_SESSION_TOKEN_PROPERTY, envToken); PROPERTIES.put(BUCKET_NAME_PROPERTY, envBucketName); PROPERTIES.put(BUCKET_PREFIX_PROPERTY, envBucketPrefix); PROPERTIES.put(S3BinaryManager.BUCKET_REGION_PROPERTY, envBucketRegion); }
Source:
<code>public boolean hasInflightRequests() { <START> return !pendingOperationsWithSize.isEmpty(); <END> }</code><technical_language>needs lock reading? (synchronized)</technical_language>

Target:
public synchronized boolean hasInflightRequests() { return !pendingOperationsWithSize.isEmpty(); }