auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<GeoFence> getTrafficAlerts() throws GeoLocationBasedServiceException { Registry registry = getGovernanceRegistry(); String registryPath = GeoServices.REGISTRY_PATH_FOR_ALERTS + GeoServices.ALERT_TYPE_STATIONARY + "/"; Resource resource; try { resource = registry.get(registryPath); } catch (RegistryException e) { log.error("Error while reading the registry path: " + registryPath); <START> return null; <END> } try { List<GeoFence> fences = new ArrayList<>(); if (resource != null) { Object contentObj = resource.getContent(); if (contentObj instanceof String[]) { String[] content = (String[]) contentObj; for (String res : content) { Resource childRes = registry.get(res); Properties props = childRes.getProperties(); GeoFence geoFence = new GeoFence(); InputStream inputStream = childRes.getContentStream(); StringWriter writer = new StringWriter(); IOUtils.copy(inputStream, writer, "UTF-8"); geoFence.setGeoJson(writer.toString()); List queryNameObj = (List) props.get(GeoServices.QUERY_NAME); geoFence.setQueryName(queryNameObj != null ? queryNameObj.get(0).toString() : null); List sNameObj = (List) props.get(GeoServices.STATIONARY_NAME); geoFence.setAreaName(sNameObj != null ? sNameObj.get(0).toString() : null); geoFence.setCreatedTime(childRes.getCreatedTime().getTime()); fences.add(geoFence); } } } return fences; } catch (RegistryException | IOException e) { throw new GeoLocationBasedServiceException( "Error occurred while getting the geo alerts", e); } }</code><technical_language>throw GeoLocationBasedServiceException wrapping RegistryException</technical_language>

Target:
public List<GeoFence> getTrafficAlerts() throws GeoLocationBasedServiceException { Registry registry = getGovernanceRegistry(); String registryPath = GeoServices.REGISTRY_PATH_FOR_ALERTS + GeoServices.ALERT_TYPE_STATIONARY + "/"; Resource resource; try { resource = registry.get(registryPath); } catch (RegistryException e) { log.error("Error while reading the registry path: " + registryPath); return Collections.emptyList(); } try { List<GeoFence> fences = new ArrayList<>(); if (resource != null) { Object contentObj = resource.getContent(); if (contentObj instanceof String[]) { String[] content = (String[]) contentObj; for (String res : content) { Resource childRes = registry.get(res); Properties props = childRes.getProperties(); GeoFence geoFence = new GeoFence(); InputStream inputStream = childRes.getContentStream(); StringWriter writer = new StringWriter(); IOUtils.copy(inputStream, writer, "UTF-8"); geoFence.setGeoJson(writer.toString()); List queryNameObj = (List) props.get(GeoServices.QUERY_NAME); geoFence.setQueryName(queryNameObj != null ? queryNameObj.get(0).toString() : null); List sNameObj = (List) props.get(GeoServices.STATIONARY_NAME); geoFence.setAreaName(sNameObj != null ? sNameObj.get(0).toString() : null); geoFence.setCreatedTime(childRes.getCreatedTime().getTime()); fences.add(geoFence); } } } return fences; } catch (RegistryException | IOException e) { throw new GeoLocationBasedServiceException( "Error occurred while getting the geo alerts", e); } }
Source:
<code>public Serializee getSerializee() { <START> return serializeeInstance.get(); <END> }</code><technical_language>this span a new serializee? I guess callers of this method want instance this class is using... want inject Serializee, Instance<Serializee></technical_language>

Target:
public Serializee getSerializee() { return serializee; }
Source:
<code>private void validateJson(String jsonInString) { try { <START> ObjectMapper mapper = new ObjectMapper(); <END> mapper.readTree(jsonInString); } catch(JsonProcessingException ex) { fail("Diagnostic string is not in json format"); } }</code><technical_language>this is test matter much. in general create a ObjectMapper method invocation, This is costly timewise</technical_language>

Target:
private void validateJson(String jsonInString) { try { OBJECT_MAPPER.readTree(jsonInString); } catch(JsonProcessingException ex) { fail("Diagnostic string is not in json format"); } }
Source:
<code>private void createImpliedDependencies(QueryModel parent) { ObjList<QueryModel> models = parent.getJoinModels(); JoinContext jc; for (int i = 0, n = models.size(); i < n; i++) { QueryModel m = models.getQuick(i); <START> if (m.getJoinType() == QueryModel.JOIN_ASOF || m.getJoinType() == QueryModel.JOIN_SPLICE || m.getJoinType() == QueryModel.JOIN_LT) { <END> linkDependencies(parent, 0, i); if (m.getContext() == null) { m.setContext(jc = contextPool.next()); jc.parents.add(0); jc.slaveIndex = i; } } } }</code><technical_language>another list lookup, feels for implied timestamp joins participate in requiredTimestamp above. Do mind checking CROSS join present here</technical_language>

Target:
private void createImpliedDependencies(QueryModel parent) { ObjList<QueryModel> models = parent.getJoinModels(); JoinContext jc; for (int i = 0, n = models.size(); i < n; i++) { QueryModel m = models.getQuick(i); if (joinsRequiringTimestamp[m.getJoinType()]) { linkDependencies(parent, 0, i); if (m.getContext() == null) { m.setContext(jc = contextPool.next()); jc.parents.add(0); jc.slaveIndex = i; } } } }
Source:
<code>public static Collection<Object[]> getRegionShortcuts() { List<Object[]> params = new ArrayList<>(); <START> params.add(new Object[] {PARTITION}); <END> params.add(new Object[] {REPLICATE}); return params; }</code><technical_language>is necessary test REPLICATE region in this test</technical_language>

Target:
public static Collection<Object[]> getRegionShortcuts() { List<Object[]> params = new ArrayList<>(); params.add(new Object[] {PARTITION}); return params; }
Source:
<code>private X509Certificate getSelfSignedCert(final List<X509Certificate> certs) throws AuthenticationException { int count = 0; X509Certificate selfSignedCert = null; for (final X509Certificate x509Certificate : certs) { if (x509Certificate.getSubjectDN().equals(x509Certificate.getIssuerDN())) { selfSignedCert = x509Certificate; <START> count ++; <END> } } if (count > 1) { throw new AuthenticationException(ADALError.BROKER_APP_VERIFICATION_FAILED); } return selfSignedCert; }</code><technical_language>nit:extra space</technical_language>

Target:
private X509Certificate getSelfSignedCert(final List<X509Certificate> certs) throws AuthenticationException { int count = 0; X509Certificate selfSignedCert = null; for (final X509Certificate x509Certificate : certs) { if (x509Certificate.getSubjectDN().equals(x509Certificate.getIssuerDN())) { selfSignedCert = x509Certificate; count++; } } if (count > 1 || selfSignedCert == null) { throw new AuthenticationException(ADALError.BROKER_APP_VERIFICATION_FAILED, "Multiple self signed certs found or no self signed cert existed."); } return selfSignedCert; }
Source:
<code>public void addDownloadedRecord(ServerReadingListRecord down) { final Boolean deleted = down.fields.getBoolean("deleted"); if (deleted == null || !deleted.booleanValue()) { additionsOrChanges.add(down); } <START> addDeletion(down.getGUID()); <END> }</code><technical_language>Do want else? (I'll reading.)</technical_language>

Target:
public void addDownloadedRecord(ServerReadingListRecord down) { final Boolean deleted = down.fields.getBoolean("deleted"); if (deleted != null && deleted.booleanValue()) { addDeletion(down.getGUID()); } else { additionsOrChanges.add(down); } }
Source:
<code>private Position decodePosition(DeviceSession deviceSession, ChannelBuffer buf, int length, Date time) { final Position position = new Position(); position.setProtocol(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); position.setTime(time); int readBytes = 0; while (readBytes < length) { short tag = buf.readUnsignedByte(); switch (tag) { case TAG_LATITUDE: position.setLatitude(buf.readFloat()); position.setValid(true); break; case TAG_LONGITUDE: position.setLongitude(buf.readFloat()); position.setValid(true); break; case TAG_COORD_PARAMS: position.setCourse(buf.readUnsignedByte() * 2.0); position.setAltitude(buf.readUnsignedByte() * 10.0); byte satellites = buf.readByte(); position.set(Position.KEY_SATELLITES, satellites & 0x0F + (satellites >> 4) & 0x0F); <START> position.setSpeed(buf.readUnsignedByte() * 1.852); <END> break; default: buf.readBytes(4); break; } readBytes += 5; } return position; }</code><technical_language>is a utility class convert units</technical_language>

Target:
private Position decodePosition(DeviceSession deviceSession, ChannelBuffer buf, int length, Date time) { final Position position = new Position(); position.setProtocol(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); position.setTime(time); int readBytes = 0; while (readBytes < length) { short tag = buf.readUnsignedByte(); switch (tag) { case TAG_LATITUDE: position.setLatitude(buf.readFloat()); position.setValid(true); break; case TAG_LONGITUDE: position.setLongitude(buf.readFloat()); position.setValid(true); break; case TAG_COORD_PARAMS: position.setCourse(buf.readUnsignedByte() * 2); position.setAltitude(buf.readUnsignedByte() * 10); byte satellites = buf.readByte(); position.set(Position.KEY_SATELLITES, satellites & 0x0F + (satellites >> 4) & 0x0F); position.setSpeed(buf.readUnsignedByte()); break; default: buf.readBytes(4); break; } readBytes += 5; } return position; }
Source:
<code>private void commit(boolean recovering) throws IOException, StoreException { List<String> logSegmentNames = getTargetLogSegmentNames(); renameLogSegments(logSegmentNames); commitLogSegments(logSegmentNames, recovering); if (!recovering) { commitIndexSegments(logSegmentNames); if (srcIndex.hardDeleter != null) { <START> srcIndex.hardDeleter.resume(); <END> } } }</code><technical_language>resume hard delete completing compaction</technical_language>

Target:
private void commit(boolean recovering) throws IOException, StoreException { List<String> logSegmentNames = getTargetLogSegmentNames(); renameLogSegments(logSegmentNames); addNewLogSegmentsToSrcLog(logSegmentNames, recovering); if (!recovering) { updateSrcIndex(logSegmentNames); } }
Source:
<code>public void run() { GerritTrigger trigger = getGerritTrigger(); if (trigger == null) { return; } if (StringUtils.isEmpty(trigger.getTriggerConfigURL())) { return; } <START> if (!trigger.getJob().isBuildable()) { <END> return; } trigger.updateTriggerConfigURL(); }</code><technical_language>safe, check gerritTrigger.getJob() != null first</technical_language>

Target:
public void run() { GerritTrigger trigger = getGerritTrigger(); if (trigger == null) { return; } if (StringUtils.isEmpty(trigger.getTriggerConfigURL())) { return; } if (trigger.getJob() != null && !trigger.getJob().isBuildable()) { return; } trigger.updateTriggerConfigURL(); }
Source:
<code>private static Optional<org.spongepowered.api.profile.GameProfile> getProfileFromServer(UUID uuid) { CompletableFuture<org.spongepowered.api.profile.GameProfile> gameProfile = Sponge.getServer().getGameProfileManager().get(uuid); try { <START> if (gameProfile.get() != null) { <END> return Optional.of(gameProfile.get()); } else { return Optional.empty(); } } catch (InterruptedException | ExecutionException e) { return Optional.empty(); } }</code><technical_language>Store of gameProfile.get() instead of calling</technical_language>

Target:
private static Optional<org.spongepowered.api.profile.GameProfile> getProfileFromServer(UUID uuid) { CompletableFuture<org.spongepowered.api.profile.GameProfile> gameProfile = Sponge.getServer().getGameProfileManager().get(uuid); try { org.spongepowered.api.profile.GameProfile profile = gameProfile.get(); if (profile != null) { return Optional.of(profile); } else { return Optional.empty(); } } catch (InterruptedException | ExecutionException e) { SpongeHooks.logWarning("Error while getting profile for {}. {}", uuid, e); return Optional.empty(); } }
Source:
<code>private void closeFile() throws Exception { TRACE.log(TraceLevel.DEBUG, "Close File"); if (fFileTimerThread != null) { if (Thread.currentThread() != fFileTimerThread) { TRACE.log(TraceLevel.DEBUG, "Stop file timer thread"); fFileTimerThread.interrupt(); } fFileTimerThread = null; } TRACE.log(TraceLevel.DEBUG, "Close file"); synchronized (this) { if (fFileToWrite != null) { boolean alreadyClosed = fFileToWrite.isClosed(); fFileToWrite.setExpired(); fFileToWrite.close(); if ( ! alreadyClosed) { String target = fFileToWrite.getPath(); boolean success = true; if ( ! tempFile.isEmpty() ) { target = currentFileName; if (getHdfsClient().exists(target)) { if (getHdfsClient().delete(target, false)) { <START> TRACE.log(TraceLevel.DEBUG, "Sucessfully removed file: " + target); <END> } else { TRACE.log(TraceLevel.ERROR, "Failed to removed file: " + target); } } if (getHdfsClient().rename(currentTempFileName, target)) { TRACE.log(TraceLevel.DEBUG, "Sucessfully renamed file: " + currentTempFileName +" to: " + target); } else { success = false; TRACE.log(TraceLevel.ERROR, "Failed to rename file: " + currentTempFileName +" to: " + target); } } if (hasOutputPort && success) { submitOnOutputPort(target, fFileToWrite.getSizeFromHdfs()); } } } } }</code><technical_language>Successfully is spelled wrong</technical_language>

Target:
private void closeFile() throws Exception { TRACE.log(TraceLevel.DEBUG, "closeFile()"); if (fFileTimerThread != null) { if (Thread.currentThread() != fFileTimerThread) { TRACE.log(TraceLevel.DEBUG, "Stop file timer thread"); fFileTimerThread.interrupt(); } fFileTimerThread = null; } synchronized (this) { if (fFileToWrite != null) { boolean alreadyClosed = fFileToWrite.isClosed(); fFileToWrite.setExpired(); fFileToWrite.close(); if ( ! alreadyClosed) { String target = fFileToWrite.getPath(); boolean success = true; if ( ! tempFile.isEmpty() ) { target = currentFileName; if (getHdfsClient().exists(target)) { if (getHdfsClient().delete(target, false)) { TRACE.log(TraceLevel.DEBUG, "Successfully removed file: " + target); } else { TRACE.log(TraceLevel.ERROR, "Failed to removed file: " + target); } } if (getHdfsClient().rename(currentTempFileName, target)) { TRACE.log(TraceLevel.DEBUG, "Successfully renamed file: " + currentTempFileName +" to: " + target); } else { success = false; TRACE.log(TraceLevel.ERROR, "Failed to rename file: " + currentTempFileName +" to: " + target); } } if (hasOutputPort && success) { submitOnOutputPort(target, fFileToWrite.getSizeFromHdfs()); } } } } }
Source:
<code>public Integer createUser(final UserDto userDto) { Integer idUserSaved = null; try { final Integer currentDate = Util.getCurrentDateAsIntegerValue(); final Person person = this.createPersonFromDto(userDto, new Person()); final WorkbenchUser user = new WorkbenchUser(); user.setPerson(person); user.setName(userDto.getUsername()); user.setPassword(userDto.getPassword()); user.setAccess(0); user.setAssignDate(currentDate); user.setCloseDate(currentDate); user.setInstalid(0); user.setStatus(userDto.getStatus()); user.setType(0); final List<UserRole> userRoles = new ArrayList<>(); if (userDto.getUserRoles() != null) { for (final UserRoleDto userRoleDto : userDto.getUserRoles()) { userRoles.add(this.buildNewUserRole(user, userRoleDto)); } } user.setRoles(userRoles); final Set<CropType> crops = new HashSet<>(); for (final CropDto crop : userDto.getCrops()) { final CropType cropType = new CropType(crop.getCropName()); crops.add(cropType); } person.setCrops(crops); final WorkbenchUser recordSaved = this.workbenchDaoFactory.getWorkbenchUserDAO().saveOrUpdate(user); <START> idUserSaved = recordSaved.getUserid(); <END> final UserInfo userInfo = new UserInfo(); userInfo.setUserId(user.getUserid()); userInfo.setLoginCount(0); this.workbenchDaoFactory.getUserInfoDAO().insertOrUpdateUserInfo(userInfo); } catch (final Exception e) { LOG.error(e.getMessage(), e); throw new MiddlewareRequestException("", "user.create.error", new String[] {userDto.getUsername()}); } return idUserSaved; }</code><technical_language>@lik-83 dont need this variable right? return recordSaved.getUserid() end of try block</technical_language>

Target:
public Integer createUser(final UserDto userDto) { try { final Integer currentDate = Util.getCurrentDateAsIntegerValue(); final Person person = this.createPersonFromDto(userDto, new Person()); final WorkbenchUser user = new WorkbenchUser(); user.setPerson(person); user.setName(userDto.getUsername()); user.setPassword(userDto.getPassword()); user.setAccess(0); user.setAssignDate(currentDate); user.setCloseDate(currentDate); user.setInstalid(0); user.setStatus(userDto.getStatus()); user.setType(0); final List<UserRole> userRoles = new ArrayList<>(); if (userDto.getUserRoles() != null) { for (final UserRoleDto userRoleDto : userDto.getUserRoles()) { userRoles.add(this.buildNewUserRole(user, userRoleDto)); } } user.setRoles(userRoles); final Set<CropType> crops = new HashSet<>(); for (final CropDto crop : userDto.getCrops()) { final CropType cropType = new CropType(crop.getCropName()); crops.add(cropType); } person.setCrops(crops); final WorkbenchUser recordSaved = this.workbenchDaoFactory.getWorkbenchUserDAO().saveOrUpdate(user); final UserInfo userInfo = new UserInfo(); userInfo.setUserId(user.getUserid()); userInfo.setLoginCount(0); this.workbenchDaoFactory.getUserInfoDAO().insertOrUpdateUserInfo(userInfo); return recordSaved.getUserid(); } catch (final Exception e) { LOG.error(e.getMessage(), e); throw new MiddlewareRequestException("", "user.create.error", new String[] {userDto.getUsername()}); } }
Source:
<code>public boolean validate() { getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new AsciiNameValidation() }); <START> <END> setIsValid(getIsValid() && getName().getIsValid()); return getIsValid(); }</code><technical_language>I description needs validation: getDescription().validateEntity(new IValidation[] { new AsciiOrNoneValidation() });</technical_language>

Target:
public boolean validate() { getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new AsciiNameValidation() }); getDescription().validateEntity(new IValidation[] { new AsciiOrNoneValidation() }); setIsValid(getIsValid() && getName().getIsValid() && getDescription().getIsValid()); return getIsValid(); }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ClientSecurityConfig other = (ClientSecurityConfig) obj; <START> if (identityConfig == null) { if (other.identityConfig != null) { return false; } } else if (!identityConfig.equals(other.identityConfig)) { return false; } <END> return true; }</code><technical_language>Objects.equals()</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ClientSecurityConfig other = (ClientSecurityConfig) obj; return Objects.equals(identityConfig, other.identityConfig); }
Source:
<code>public void updateScanner() throws IOException { if (LOG.isDebugEnabled()) { SpliceLogUtils.debug(LOG, "updateScanner with hregionInfo=%s, tableName=%s, rootDir=%s, scan=%s", hri, htd.getNameAsString(), rootDir, scan); } if (flushed) { if (LOG.isDebugEnabled()) SpliceLogUtils.debug(LOG, "Flush occurred"); if (this.topCell != null) { if (LOG.isDebugEnabled()) SpliceLogUtils.debug(LOG, "setting start row to %s", topCell); <START> scan.setStartRow(Bytes.add(CellUtil.cloneRow(topCell), Bytes.toBytes(0))); <END> } } memScannerList.add(getMemStoreScanner()); this.region = openHRegion(); RegionScanner regionScanner = new CountingRegionScanner(HRegionUtil.getScanner(region, scan, memScannerList), region, scan); if (flushed) { if (scanner != null) scanner.close(); } scanner = regionScanner; }</code><technical_language>This is correct, this appends 4 NULL bytes instead of a single NULL byte</technical_language>

Target:
public void updateScanner() throws IOException { if (LOG.isDebugEnabled()) { SpliceLogUtils.debug(LOG, "updateScanner with hregionInfo=%s, tableName=%s, rootDir=%s, scan=%s", hri, htd.getNameAsString(), rootDir, scan); } if (flushed) { if (LOG.isDebugEnabled()) SpliceLogUtils.debug(LOG, "Flush occurred"); if (this.topCell != null) { if (LOG.isDebugEnabled()) SpliceLogUtils.debug(LOG, "setting start row to %s", topCell); scan.setStartRow(Bytes.add(CellUtil.cloneRow(topCell), new byte[]{0})); } } memScannerList.add(getMemStoreScanner()); this.region = openHRegion(); RegionScanner regionScanner = new CountingRegionScanner(HRegionUtil.getScanner(region, scan, memScannerList), region, scan); if (flushed) { if (scanner != null) scanner.close(); } scanner = regionScanner; }
Source:
<code>public Term parse(NonTerminal nt, int position) { <START> NonTerminal startNt = new NonTerminal(new NonTerminalId("<start>"), <END> new StateId("<start-entry>"), new StateId("<start-exit>")); NonTerminalState state = new NonTerminalState(new StateId("<start>"), startNt, nt, false); startNt.entryState.next.add(state); state.next.add(startNt.exitState); startNt.entryState.orderingInfo = new State.OrderingInfo(Integer.MIN_VALUE); startNt.exitState.orderingInfo = new State.OrderingInfo(Integer.MAX_VALUE); state.orderingInfo = new State.OrderingInfo(Integer.MAX_VALUE - 1); activateStateCall(s.getStateCall(new StateCall.Key(s.getNtCall( new NonTerminalCall.Key(startNt, position)), position, startNt.entryState)), Function.IDENTITY); for (StateReturn stateReturn = null; (stateReturn = s.stateReturnWorkList.dequeue()) != null;) { this.workListStep(stateReturn); } Ambiguity result = new Ambiguity(KSorts.K, new ArrayList<Term>()); for(StateReturn stateReturn : s.getNtCall(new NonTerminalCall.Key(nt,position)).exitStateReturns) { if (stateReturn.key.stateEnd == s.input.length()) { result.getContents().add(new KList(new Ambiguity( KSorts.K, stateReturn.function.applyToNull()))); } } return result; }</code><technical_language>is this needed? want remove it, added in place? stopping trivially removed</technical_language>

Target:
public Term parse(NonTerminal nt, int position) { NonTerminal startNt = new NonTerminal("<start>"); NonTerminalState state = new NonTerminalState("<start>", startNt, nt, false); startNt.entryState.next.add(state); state.next.add(startNt.exitState); startNt.entryState.orderingInfo = new State.OrderingInfo(Integer.MIN_VALUE); startNt.exitState.orderingInfo = new State.OrderingInfo(Integer.MAX_VALUE); state.orderingInfo = new State.OrderingInfo(Integer.MAX_VALUE - 1); activateStateCall(s.stateCalls.get(new StateCall.Key(s.ntCalls.get( new NonTerminalCall.Key(startNt, position)), position, startNt.entryState)), Function.IDENTITY); for (StateReturn stateReturn; (stateReturn = s.stateReturnWorkList.dequeue()) != null;) { this.workListStep(stateReturn); } Ambiguity result = new Ambiguity(KSorts.K, new ArrayList<Term>()); for(StateReturn stateReturn : s.ntCalls.get(new NonTerminalCall.Key(nt,position)).exitStateReturns) { if (stateReturn.key.stateEnd == s.input.length()) { result.getContents().add(new KList(new Ambiguity( KSorts.K, stateReturn.function.applyToNull()))); } } return result; }
Source:
<code>protected void internalUpdateItem(String slaveName, InputRegister[] registers, String itemName) { for (ModbusBindingProvider provider : providers) { if ( !provider.providesBindingFor(itemName) ) { continue; } ModbusBindingConfig config = provider.getConfig(itemName); if ( !config.slaveName.equals(slaveName)) { continue; } String slaveValueType = modbusSlaves.get(slaveName).getValueType(); double rawDataMultiplier = modbusSlaves.get(slaveName).getRawDataMultiplier(); State newState = extractStateFromRegisters(registers, config.readRegister, slaveValueType); if (config.getItem() instanceof SwitchItem) { newState = newState.equals(DecimalType.ZERO) ? OnOffType.OFF : OnOffType.ON; } if (( rawDataMultiplier != 1 ) && (config.getItem() instanceof NumberItem)) { double tmpValue = (double)((DecimalType)newState).doubleValue() * rawDataMultiplier; newState = new DecimalType( String.valueOf(tmpValue) ); } State currentState = config.getItemState(); if (! newState.equals(currentState)) <START> eventPublisher.postUpdate(itemName, newState); <END> } }</code><technical_language>please add curly braces (although this is a One-Liner)</technical_language>

Target:
protected void internalUpdateItem(String slaveName, InputRegister[] registers, String itemName) { for (ModbusBindingProvider provider : providers) { if ( !provider.providesBindingFor(itemName) ) { continue; } ModbusBindingConfig config = provider.getConfig(itemName); if ( !config.slaveName.equals(slaveName)) { continue; } String slaveValueType = modbusSlaves.get(slaveName).getValueType(); double rawDataMultiplier = modbusSlaves.get(slaveName).getRawDataMultiplier(); State newState = extractStateFromRegisters(registers, config.readRegister, slaveValueType); if (config.getItem() instanceof SwitchItem) { newState = newState.equals(DecimalType.ZERO) ? OnOffType.OFF : OnOffType.ON; } if (( rawDataMultiplier != 1 ) && (config.getItem() instanceof NumberItem)) { double tmpValue = (double)((DecimalType)newState).doubleValue() * rawDataMultiplier; newState = new DecimalType( String.valueOf(tmpValue) ); } State currentState = config.getItemState(); if (! newState.equals(currentState)) { eventPublisher.postUpdate(itemName, newState); } } }
Source:
<code>public void beforeMethod() throws Exception { file = File.createTempFile("file", ".tmp"); concurrentFileLineConsumer = new ConcurrentFileLineConsumer(file); injectWriterMock(concurrentFileLineConsumer, writer); <START> executor = Executors.newFixedThreadPool(5); <END> }</code><technical_language>Do 5 threadds here</technical_language>

Target:
public void beforeMethod() throws Exception { file = File.createTempFile("file", ".tmp"); concurrentFileLineConsumer = new ConcurrentFileLineConsumer(file); injectWriterMock(concurrentFileLineConsumer, writer); executor = Executors.newFixedThreadPool(3); }
Source:
<code>public void testNestedDependencyChangeAndApplyCompletes() throws Exception { <START> final AtomicBoolean hasRun = new AtomicBoolean(); <END> WritableValue<Object> invalidator = new WritableValue<Object>(new Object(), null); final SideEffect innerSideEffect = SideEffect.createPaused(() -> { invalidator.getValue(); }).resume(); SideEffect.createPaused(() -> { assertFalse(hasRun.get()); hasRun.set(true); invalidator.setValue(new Object()); innerSideEffect.runIfDirty(); }).resume(); runAsync(); assertTrue(hasRun.get()); }</code><technical_language>final keyword is necessary more in Java 8, removed in occurrences</technical_language>

Target:
public void testNestedDependencyChangeAndApplyCompletes() throws Exception { AtomicBoolean hasRun = new AtomicBoolean(); WritableValue<Object> invalidator = new WritableValue<Object>(new Object(), null); ISideEffect innerSideEffect = SideEffect.create(() -> { invalidator.getValue(); }); SideEffect.createPaused(() -> { assertFalse(hasRun.get()); hasRun.set(true); invalidator.setValue(new Object()); innerSideEffect.runIfDirty(); }).resume(); runAsync(); assertTrue(hasRun.get()); }
Source:
<code>public void connect() { connection = new WinrsConnection(options, mapper, workingDirectory); connection.connectToWinrsProxy(options); <START> if (connection.getWinrsProxyConnection().getHostOperatingSystem() != WINDOWS) { <END> connection.disconnectFromWinrsProxy(); throw new IllegalArgumentException(format("Cannot create a " + CIFS_PROTOCOL + ":%s connection with a winrs proxy that is not running Windows", cifsConnectionType.toString().toLowerCase())); } connected(); }</code><technical_language>connect, check disconnect</technical_language>

Target:
public void connect() { super.connect(); }
Source:
<code>private List<RealWorldTestingUpload> parseCsvFile(MultipartFile file) throws ValidationException { try (BufferedReader reader = new BufferedReader(new InputStreamReader(file.getInputStream())); CSVParser parser = new CSVParser(reader, CSVFormat.EXCEL)) { List<CSVRecord> records = parser.getRecords(); if (records.size() <= 1 && doesHeaderRowExist(records)) { throw new ValidationException("The file appears to have a header line with no other information. " + "Please make sure there are at least two rows in the CSV file."); } <START> records = removeEmptyRows(records); <END> records = removeHeaderRow(records); List<RealWorldTestingUpload> rwts = records.stream().map(rec -> createRwtUploadFromCsvRecord(rec)) .collect(Collectors.toList()); return rwts; } catch (final IOException ioEx) { throw new ValidationException("Could not get input stream for uploaded file " + file.getName()); } }</code><technical_language>this previous check? If uploads a file a header a bunch of blank lines pass previous check. Unless, if rows left removing blank headers do anything? kind of report generate? I reasonable for a validation exception upload opposed output email</technical_language>

Target:
private List<RealWorldTestingUpload> parseCsvFile(MultipartFile file) throws ValidationException { try (BufferedReader reader = new BufferedReader(new InputStreamReader(file.getInputStream())); CSVParser parser = new CSVParser(reader, CSVFormat.EXCEL)) { List<CSVRecord> records = parser.getRecords(); if (records.size() <= 1 && doesHeaderRowExist(records)) { throw new ValidationException(errorMessageUtil.getMessage("realWorldTesting.upload.headerOnly")); } records = removeHeaderRow(records); records = removeEmptyRows(records); if (records.size() == 0) { throw new ValidationException(errorMessageUtil.getMessage("realWorldTesting.upload.emptyFile")); } List<RealWorldTestingUpload> rwts = records.stream() .map(rec -> createRwtUploadFromCsvRecord(rec)) .collect(Collectors.toList()); return rwts; } catch (final IOException ioEx) { throw new ValidationException("Could not get input stream for uploaded file " + file.getName()); } }
Source:
<code><START> public static String getBaseSecId(String secId) { <END> if (secId == null) { return null; } if (!secId.contains(INTERNAL_SECONDARY_ID_SEPARATOR)) { if (isUUID(secId)) { return null; } return secId; } int lastIndexSepartor = secId.lastIndexOf(INTERNAL_SECONDARY_ID_SEPARATOR); String potentialUUID = secId.substring(lastIndexSepartor + 1); if (!isUUID(potentialUUID)) { return secId; } return secId.substring(0, lastIndexSepartor); }</code><technical_language>this method simpler if UUID suffix is prefixed a '&', is base secondaryId, like: primary_id:&uuid</technical_language>

Target:
public static String getBaseSecId(String secId) { if (secId == null) { return null; } int uuidSeparator = secId.lastIndexOf(INTERNAL_SECONDARY_ID_SEPARATOR); if (uuidSeparator == -1) { if (isUUID(secId)) { return null; } return secId; } String potentialUUID = secId.substring(uuidSeparator + 1); if (!isUUID(potentialUUID)) { return secId; } return secId.substring(0, uuidSeparator); }
Source:
<code>public static MutableVirtualFile safeCreate(@Nonnull VirtualFile parent, @Nullable String name) { if (Strings.isEmpty(name)) { return null; } <START> return new MutableVirtualFile(parent, name.replace('/', '_')); <END> }</code><technical_language>Do need file names Windows-compatible? If so, include a more characters list. - Linux/Unix: / (forward slash) - Windows: < (less than) > (greater than) : (colon - works, is NTFS Alternate Data Streams) " (double quote) / (forward slash) \ (backslash) | (vertical bar pipe) ? ( question mark) * (asterisk)</technical_language>

Target:
public static MutableVirtualFile safeCreate(@Nonnull VirtualFile parent, @Nullable String name) { if (Strings.isEmpty(name)) { return null; } return new MutableVirtualFile(parent, name.replaceAll(REGEX_ILLEGAL_FILE_CHARS, "_")); }
Source:
<code>public RemoteATCommandWifiPacket(int frameID, IP32BitAddress destAddress, int transmitOptions, String command, String parameter) { <START> this(frameID, destAddress, transmitOptions, command, parameter.getBytes()); <END> }</code><technical_language>need check if parameter is null: if (parameter == null) this(frameID, destAddress, transmitOptions, command, null); else this(frameID, destAddress, transmitOptions, command, parameter.getBytes());</technical_language>

Target:
public RemoteATCommandWifiPacket(int frameID, IP32BitAddress destAddress, int transmitOptions, String command, String parameter) { this(frameID, destAddress, transmitOptions, command, parameter == null ? null : parameter.getBytes()); }
Source:
<code><START> public void testLayoutSyncDownFromConfig() throws JSONException { <END> MobileSyncSDKManager.getInstance().setupUserSyncsFromDefaultConfig(); SyncState sync = syncManager.getSyncStatus("layoutSyncDown"); Assert.assertEquals("Wrong soup name", ACCOUNTS_SOUP, sync.getSoupName()); checkStatus(sync, SyncState.Type.syncDown, sync.getId(), new LayoutSyncDownTarget("Account", null, "Compact", null, null), SyncOptions.optionsForSyncDown(MergeMode.OVERWRITE), SyncState.Status.NEW, 0); }</code><technical_language>update: - schema <LINK_2> - example syncs configs: <LINK_0> <LINK_0> <LINK_1></technical_language>

Target:
public void testLayoutSyncDownFromConfig() throws JSONException { MobileSyncSDKManager.getInstance().setupUserSyncsFromDefaultConfig(); SyncState sync = syncManager.getSyncStatus("layoutSyncDown"); Assert.assertEquals("Wrong soup name", ACCOUNTS_SOUP, sync.getSoupName()); checkStatus(sync, SyncState.Type.syncDown, sync.getId(), new LayoutSyncDownTarget("Account", "Medium", "Compact", "Edit", null), SyncOptions.optionsForSyncDown(MergeMode.OVERWRITE), SyncState.Status.NEW, 0); }
Source:
<code>public int place(World world, BlockPos pos, @Nonnull FluidStack fluidStack, boolean doPlace) { if (fluidStack.amount < Fluid.BUCKET_VOLUME) { return 0; } if (doPlace) { FluidUtil.destroyBlockOnFluidPlacement(world, pos); <START> world.setBlockState(pos, this.getDefaultState(), Constants.BlockFlags.DEFAULT | Constants.BlockFlags.RERENDER_MAIN_THREAD); <END> } return Fluid.BUCKET_VOLUME; }</code><technical_language>DEFAULT_AND_RERENDER</technical_language>

Target:
public int place(World world, BlockPos pos, @Nonnull FluidStack fluidStack, boolean doPlace) { if (fluidStack.amount < Fluid.BUCKET_VOLUME) { return 0; } if (doPlace) { FluidUtil.destroyBlockOnFluidPlacement(world, pos); world.setBlockState(pos, this.getDefaultState(), Constants.BlockFlags.DEFAULT_AND_RERENDER); } return Fluid.BUCKET_VOLUME; }
Source:
<code>public void announce( @NotNull(message = "body can't be NULL") final String body) { final AmazonSimpleEmailService aws = this.client.get(); <START> String[] parts = new String[2]; <END> Message message = null; if (body.startsWith("<html>") && body.endsWith("</html>")) { try { final InputSource source = new InputSource(new StringReader(body)); final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); final DocumentBuilder dbuilder = dbf.newDocumentBuilder(); final Document document = dbuilder.parse(source); final XPathFactory xpathFactory = XPathFactory.newInstance(); final XPath xpath = xpathFactory.newXPath(); final String title = xpath .evaluate("/html/head/title", document); message = new Message() .withSubject(new Content().withData(title)) .withBody( new Body().withHtml(new Content().withData(body)) ); } catch (Exception ex) { throw new RuntimeException(ex.getMessage()); } } else { parts = body.split("\n", 2); message = new Message() .withSubject(new Content().withData(parts[0])) .withBody( new Body().withText(new Content().withData(parts[1])) ); } try { final SendEmailResult result = aws.sendEmail( new SendEmailRequest() .withSource(this.sender) .withReturnPath(this.sender) .withDestination( new Destination().withToAddresses(this.recipients) ) .withMessage(message) ); Logger.info( this, "#announce(..): sent SES email %s from %s to %s", result.getMessageId(), this.sender, this.recipients ); } finally { aws.shutdown(); } }</code><technical_language>parts declared here? for HTML part of if/then/else</technical_language>

Target:
public void announce( @NotNull(message = "body can't be NULL") final String body) { final AmazonSimpleEmailService aws = this.client.get(); final Message message; if (body.startsWith("<html>") && body.endsWith("</html>")) { message = new Message() .withSubject(new Content() .withData(new SimpleXml(body) .xpath("/html/head/title/text()").get(0) ) ) .withBody(new Body() .withHtml(new Content().withData(body)) ); } else { final String[] parts = body.split("\n", 2); message = new Message() .withSubject(new Content().withData(parts[0])) .withBody( new Body().withText(new Content().withData(parts[1])) ); } try { final SendEmailResult result = aws.sendEmail( new SendEmailRequest() .withSource(this.sender) .withReturnPath(this.sender) .withDestination( new Destination().withToAddresses(this.recipients) ) .withMessage(message) ); Logger.info( this, "#announce(..): sent SES email %s from %s to %s", result.getMessageId(), this.sender, this.recipients ); } finally { aws.shutdown(); } }
Source:
<code>public List<QualifiedObjectName> listViews(Session session, QualifiedTablePrefix prefix) { requireNonNull(prefix, "prefix is null"); Optional<CatalogMetadata> catalog = getOptionalCatalogMetadata(session, prefix.getCatalogName()); Set<QualifiedObjectName> views = new LinkedHashSet<>(); if (catalog.isPresent()) { CatalogMetadata catalogMetadata = catalog.get(); <START> Optional<String> schemaName = prefix.getSchemaName(); <END> for (ConnectorId connectorId : catalogMetadata.listConnectorIds()) { ConnectorMetadata metadata = catalogMetadata.getMetadataFor(connectorId); ConnectorSession connectorSession = session.toConnectorSession(connectorId); metadata.listViews(connectorSession, schemaName).stream() .map(convertFromSchemaTableName(prefix.getCatalogName())::apply) .forEach(views::add); } } return ImmutableList.copyOf(views); }</code><technical_language>Inline</technical_language>

Target:
public List<QualifiedObjectName> listViews(Session session, QualifiedTablePrefix prefix) { requireNonNull(prefix, "prefix is null"); Optional<CatalogMetadata> catalog = getOptionalCatalogMetadata(session, prefix.getCatalogName()); Set<QualifiedObjectName> views = new LinkedHashSet<>(); if (catalog.isPresent()) { CatalogMetadata catalogMetadata = catalog.get(); for (ConnectorId connectorId : catalogMetadata.listConnectorIds()) { ConnectorMetadata metadata = catalogMetadata.getMetadataFor(connectorId); ConnectorSession connectorSession = session.toConnectorSession(connectorId); metadata.listViews(connectorSession, prefix.getSchemaName()).stream() .map(convertFromSchemaTableName(prefix.getCatalogName())) .filter(prefix::matches) .forEach(views::add); } } return ImmutableList.copyOf(views); }
Source:
<code>public static Set<DistributionModuleGroup> getModuleGroups(String distribution, String version) { Set<DistributionModuleGroup> hs = new HashSet<>(); DistributionModuleGroup dmgSpark16 = new DistributionModuleGroup( CDH5100Constant.SPARK_KINESIS_MRREQUIRED_MODULE_GROUP.getModuleName(), true, new NestedComponentCondition(new MultiComponentCondition( new SparkStreamingLinkedNodeCondition(distribution, version).getCondition(), BooleanOperator.AND, spark16Condition))); DistributionModuleGroup dmgSpark21 = new DistributionModuleGroup( CDH5100Constant.SPARK2_KINESIS_MRREQUIRED_MODULE_GROUP.getModuleName(), true, new NestedComponentCondition(new MultiComponentCondition( new SparkStreamingLinkedNodeCondition(distribution, version).getCondition(), BooleanOperator.AND, spark21Condition))); <START> hs.add(dmgSpark16); <END> hs.add(dmgSpark21); return hs; }</code><technical_language>put this line spark 1.6 part. (5 line above.)</technical_language>

Target:
public static Set<DistributionModuleGroup> getModuleGroups(String distribution, String version) { Set<DistributionModuleGroup> hs = new HashSet<>(); DistributionModuleGroup dmgSpark16 = new DistributionModuleGroup( CDH5100Constant.SPARK_KINESIS_MRREQUIRED_MODULE_GROUP.getModuleName(), true, new NestedComponentCondition(new MultiComponentCondition( new SparkStreamingLinkedNodeCondition(distribution, version).getCondition(), BooleanOperator.AND, spark16Condition))); hs.add(dmgSpark16); DistributionModuleGroup dmgSpark21 = new DistributionModuleGroup( CDH5100Constant.SPARK2_KINESIS_MRREQUIRED_MODULE_GROUP.getModuleName(), true, new NestedComponentCondition(new MultiComponentCondition( new SparkStreamingLinkedNodeCondition(distribution, version).getCondition(), BooleanOperator.AND, spark21Condition))); hs.add(dmgSpark21); return hs; }
Source:
<code>public static List<String> extractValues(Collection<StructuredProperty> source, FieldApprover fieldApprover) { <START> if (CollectionUtils.isNotEmpty(source)) { List<String> results = new ArrayList<String>(source.size()); for (StructuredProperty current : source) { if (fieldApprover.approve(current.getDataInfo())) { results.add(current.getValue()); } } return results; } else { return Collections.emptyList(); } <END> }</code><technical_language>I streams fit in java return source.stream() .filter(x -> fieldApprover.approve(x.getDataInfo())) .map(StructuredProperty::getValue) .collect(Collectors.toList());</technical_language>

Target:
public static List<String> extractValues(Collection<StructuredProperty> source, FieldApprover fieldApprover) { return source.stream() .filter(x -> fieldApprover.approve(x.getDataInfo())) .map(StructuredProperty::getValue) .collect(Collectors.toList()); }
Source:
<code>protected void addAttribute(Composite composite, FormToolkit toolkit, TaskAttribute attribute) { <START> if (peopleAttributes.contains(attribute)) { <END> return; } AbstractAttributeEditor editor = createAttributeEditor(attribute); if (editor != null) { editor.createLabelControl(composite, toolkit); GridDataFactory.defaultsFor(editor.getLabelControl()) .indent(COLUMN_MARGIN, 0) .applyTo(editor.getLabelControl()); editor.createControl(composite, toolkit); getTaskEditorPage().getAttributeEditorToolkit().adapt(editor); GridDataFactory gridDataFactory = GridDataFactory.fillDefaults() .grab(true, false) .align(SWT.FILL, SWT.TOP) .indent(3, 0); if (editor instanceof MultiSelectionAttributeEditor) { gridDataFactory.hint(SWT.DEFAULT, 95); } gridDataFactory.applyTo(editor.getControl()); } }</code><technical_language>is added this. I needed checked in getAttributes</technical_language>

Target:
protected void addAttribute(Composite composite, FormToolkit toolkit, TaskAttribute attribute) { AbstractAttributeEditor editor = createAttributeEditor(attribute); if (editor != null) { editor.createLabelControl(composite, toolkit); GridDataFactory.defaultsFor(editor.getLabelControl()) .indent(COLUMN_MARGIN, 0) .applyTo(editor.getLabelControl()); editor.createControl(composite, toolkit); getTaskEditorPage().getAttributeEditorToolkit().adapt(editor); GridDataFactory gridDataFactory = GridDataFactory.fillDefaults() .grab(true, false) .align(SWT.FILL, SWT.TOP) .indent(3, 0); if (editor instanceof MultiSelectionAttributeEditor) { gridDataFactory.hint(SWT.DEFAULT, 95); } gridDataFactory.applyTo(editor.getControl()); } }
Source:
<code><START> public java.util.Optional<String> getUrlOverride(@Nonnull String service, @Nonnull Link quickLink) { <END> return Optional.ofNullable( urlOverrides.get(Pair.of(service, quickLink.getName())) ); }</code><technical_language>suggestion public Optional<String> getUrlOverride(@Nonnull String service, @Nonnull Link quickLink) {</technical_language>

Target:
public Optional<String> getUrlOverride(@Nonnull String service, @Nonnull Link quickLink) { return Optional.ofNullable( urlOverrides.get(Pair.of(service, quickLink.getName())) ); }
Source:
<code>public void testConstructorWithBuiltInTypeParameter() { final QName qname = new QName(BuiltInType.STRING); <START> assertEquals(qname.getLocalPart(), BuiltInType.STRING.getName()); <END> }</code><technical_language>assert namespaceURI is NULL_NS_URI</technical_language>

Target:
public void testConstructorWithBuiltInTypeParameter() { final QName qname = new QName(BuiltInType.STRING); assertEquals(qname.getLocalPart(), BuiltInType.STRING.getName()); assertEquals(qname.getNamespaceURI(), QName.NULL_NS_URI); }
Source:
<code>public Response specPost(final SupervisorSpec spec, @Context final HttpServletRequest req) { return asLeaderWithSupervisorManager( new Function<SupervisorManager, Response>() { @Override public Response apply(SupervisorManager manager) { if (authConfig.isEnabled()) { Preconditions.checkArgument( spec.getDataSources() != null && spec.getDataSources().size() > 0, "No dataSources found to perform authorization checks" ); <START> <END> Access authResult = AuthorizationUtils.authorizeAllResourceActions( req, spec.getDataSources(), AuthorizationUtils.DATASOURCE_WRITE_RA_GENERATOR, authorizationManager ); if (!authResult.isAllowed()) { return Response.status(Response.Status.FORBIDDEN).header("Access-Check-Result", authResult).build(); } } manager.createOrUpdateAndStartSupervisor(spec); return Response.ok(ImmutableMap.of("id", spec.getId())).build(); } } ); }</code><technical_language>This checked if block</technical_language>

Target:
public Response specPost(final SupervisorSpec spec, @Context final HttpServletRequest req) { return asLeaderWithSupervisorManager( new Function<SupervisorManager, Response>() { @Override public Response apply(SupervisorManager manager) { Preconditions.checkArgument( spec.getDataSources() != null && spec.getDataSources().size() > 0, "No dataSources found to perform authorization checks" ); Access authResult = AuthorizationUtils.authorizeAllResourceActions( req, Iterables.transform(spec.getDataSources(), AuthorizationUtils.DATASOURCE_WRITE_RA_GENERATOR), authorizerMapper ); if (!authResult.isAllowed()) { throw new ForbiddenException(authResult.toString()); } manager.createOrUpdateAndStartSupervisor(spec); return Response.ok(ImmutableMap.of("id", spec.getId())).build(); } } ); }
Source:
<code>public BackgroundHiveSplitLoader( Table table, Iterable<HivePartitionMetadata> partitions, TupleDomain<? extends ColumnHandle> compactEffectivePredicate, Optional<BucketSplitInfo> bucketSplitInfo, ConnectorSession session, HdfsEnvironment hdfsEnvironment, NamenodeStats namenodeStats, DirectoryLister directoryLister, Executor executor, int loaderConcurrency, boolean recursiveDirWalkerEnabled) { this.table = table; this.compactEffectivePredicate = compactEffectivePredicate; this.bucketSplitInfo = bucketSplitInfo; this.loaderConcurrency = loaderConcurrency; this.session = session; this.hdfsEnvironment = hdfsEnvironment; this.namenodeStats = namenodeStats; this.directoryLister = directoryLister; this.recursiveDirWalkerEnabled = recursiveDirWalkerEnabled; this.executor = executor; this.partitions = new ConcurrentLazyQueue<>(partitions); this.hdfsContext = new HdfsContext(session, table.getDatabaseName(), table.getTableName()); <START> this.corruptBucketing = "Hive table (" + table + ") is corrupt. It is declared as being bucketed, but the files do not match the bucketing declaration."; <END> }</code><technical_language>Please do construct exception message for some pessimistic case in class constructor. If want message twice, a method formatting message</technical_language>

Target:
public BackgroundHiveSplitLoader( Table table, Iterable<HivePartitionMetadata> partitions, TupleDomain<? extends ColumnHandle> compactEffectivePredicate, Optional<BucketSplitInfo> bucketSplitInfo, ConnectorSession session, HdfsEnvironment hdfsEnvironment, NamenodeStats namenodeStats, DirectoryLister directoryLister, Executor executor, int loaderConcurrency, boolean recursiveDirWalkerEnabled) { this.table = table; this.compactEffectivePredicate = compactEffectivePredicate; this.bucketSplitInfo = bucketSplitInfo; this.loaderConcurrency = loaderConcurrency; this.session = session; this.hdfsEnvironment = hdfsEnvironment; this.namenodeStats = namenodeStats; this.directoryLister = directoryLister; this.recursiveDirWalkerEnabled = recursiveDirWalkerEnabled; this.executor = executor; this.partitions = new ConcurrentLazyQueue<>(partitions); this.hdfsContext = new HdfsContext(session, table.getDatabaseName(), table.getTableName()); }