auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>Path(Method method, int p, String name, Converter<T, String> valueConverter, boolean encoded) { <START> this.name = checkNotNull(name, "name == null"); <END> this.valueConverter = valueConverter; this.encoded = encoded; this.method = method; this.p = p; }</code><technical_language>If impossible prefer AssertionError. I leave as-is observable users</technical_language>

Target:
Path(Method method, int p, String name, Converter<T, String> valueConverter, boolean encoded) { this.method = method; this.p = p; this.name = checkNotNull(name, "name == null"); this.valueConverter = valueConverter; this.encoded = encoded; }
Source:
<code>private void scanFile(InputFile inputFile) { PythonFile pythonFile = SonarQubePythonFile.create(inputFile); PythonVisitorContext visitorContext; try { AstNode astNode = parser.parse(pythonFile.content()); FileInput parse = new PythonTreeMaker().fileInput(astNode); visitorContext = new PythonVisitorContext(astNode, parse, pythonFile); saveMeasures(inputFile, visitorContext); } catch (RecognitionException e) { visitorContext = new PythonVisitorContext(pythonFile, e); LOG.error("Unable to parse file: " + inputFile.toString()); LOG.error(e.getMessage()); context.newAnalysisError() .onFile(inputFile) .at(inputFile.newPointer(e.getLine(), 0)) .message(e.getMessage()) .save(); } List<PythonSubscriptionCheck> checksBasedOnTree = new ArrayList<>(); for (PythonCheck check : checks.all()) { if (check instanceof PythonSubscriptionCheck) { checksBasedOnTree.add((PythonSubscriptionCheck) check); } else { check.scanFile(visitorContext); } } SubscriptionVisitor.analyze(checksBasedOnTree, visitorContext); saveIssues(inputFile, visitorContext.getIssues()); <START> visitorContext.rootTree().accept(new SymbolVisitor(context.newSymbolTable().onFile(inputFile))); <END> new PythonHighlighter(context, inputFile).scanFile(visitorContext); }</code><technical_language>tiny detail I personally more readable : new SymbolVisitor(context.newSymbolTable().onFile(inputFile)).visitFileInput(visitorContext.rootTree()); feel free discard suggestion</technical_language>

Target:
private void scanFile(InputFile inputFile) { PythonFile pythonFile = SonarQubePythonFile.create(inputFile); PythonVisitorContext visitorContext; try { AstNode astNode = parser.parse(pythonFile.content()); FileInput parse = new PythonTreeMaker().fileInput(astNode); visitorContext = new PythonVisitorContext(astNode, parse, pythonFile); saveMeasures(inputFile, visitorContext); } catch (RecognitionException e) { visitorContext = new PythonVisitorContext(pythonFile, e); LOG.error("Unable to parse file: " + inputFile.toString()); LOG.error(e.getMessage()); context.newAnalysisError() .onFile(inputFile) .at(inputFile.newPointer(e.getLine(), 0)) .message(e.getMessage()) .save(); } List<PythonSubscriptionCheck> checksBasedOnTree = new ArrayList<>(); for (PythonCheck check : checks.all()) { if (check instanceof PythonSubscriptionCheck) { checksBasedOnTree.add((PythonSubscriptionCheck) check); } else { check.scanFile(visitorContext); } } SubscriptionVisitor.analyze(checksBasedOnTree, visitorContext); saveIssues(inputFile, visitorContext.getIssues()); new SymbolVisitor(context.newSymbolTable().onFile(inputFile)).visitFileInput(visitorContext.rootTree()); new PythonHighlighter(context, inputFile).scanFile(visitorContext); }
Source:
<code>public String toString() { return MoreObjects.toStringHelper(this) <START> .add("blockId", mSrcBlockId) <END> .add("srcLocation", mSrcLocation) .add("dstLocation", mDstLocation).toString(); }</code><technical_language>srcBlockId dstBlockId</technical_language>

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("srcBlockId", mSrcBlockId) .add("dstBlockId", mDstBlockId) .add("srcLocation", mSrcLocation) .add("dstLocation", mDstLocation).toString(); }
Source:
<code>public Response deleteGroupMember(@PathParam("member") String userId) { groupService.deleteUserFromGroup(group, userId); <START> return Response.noContent().build(); <END> }</code><technical_language>right. a breaking change some users, API UI, affected this kind of changes. Please revert</technical_language>

Target:
public Response deleteGroupMember(@PathParam("member") String userId) { groupService.deleteUserFromGroup(group, userId); return Response.ok().build(); }
Source:
<code>protected synchronized void addRemoteData(RemoteServerData remoteServerData){ <START> String serverName = remoteServerData.getServerName(); <END> remoteServerDataList.add(remoteServerData); if(RemoteDescriptorProvider.DATACLOUD_SERVER_NAME.equals(serverName)){ RemoteServerState remoteServerState = checkDataCloudServerAvailability(remoteServerData); actualStateMap.put(serverName, remoteServerState); notifyAllListeners(serverName); } }</code><technical_language>final</technical_language>

Target:
protected synchronized void addRemoteData(RemoteServerData remoteServerData){ final String serverName = remoteServerData.getServerName(); remoteServerDataList.add(remoteServerData); if(RemoteDescriptorProvider.DATACLOUD_SERVER_NAME.equals(serverName)){ final RemoteServerState remoteServerState = checkDataCloudServerAvailability(remoteServerData); actualStateMap.put(serverName, remoteServerState); notifyAllListeners(serverName); } }
Source:
<code>private void loadToplist() { if (disposable != null) { disposable.dispose(); } gridView.setVisibility(View.GONE); txtvError.setVisibility(View.GONE); butRetry.setVisibility(View.GONE); txtvEmpty.setVisibility(View.GONE); progressBar.setVisibility(View.VISIBLE); ItunesTopListLoader loader = new ItunesTopListLoader(getContext()); <START> disposable = loader.loadToplist(100) <END> .subscribe(podcasts -> { progressBar.setVisibility(View.GONE); topList = podcasts; updateData(topList); }, error -> { Log.e(TAG, Log.getStackTraceString(error)); progressBar.setVisibility(View.GONE); txtvError.setText(error.toString()); txtvError.setVisibility(View.VISIBLE); butRetry.setOnClickListener(v -> loadToplist()); butRetry.setVisibility(View.VISIBLE); }); }</code><technical_language>I this discussed in #3788. a lot of traffic iTunes I want a minimum, do get locked out day</technical_language>

Target:
private void loadToplist() { if (disposable != null) { disposable.dispose(); } gridView.setVisibility(View.GONE); txtvError.setVisibility(View.GONE); butRetry.setVisibility(View.GONE); txtvEmpty.setVisibility(View.GONE); progressBar.setVisibility(View.VISIBLE); ItunesTopListLoader loader = new ItunesTopListLoader(getContext()); disposable = loader.loadToplist(25) .subscribe(podcasts -> { progressBar.setVisibility(View.GONE); topList = podcasts; updateData(topList); }, error -> { Log.e(TAG, Log.getStackTraceString(error)); progressBar.setVisibility(View.GONE); txtvError.setText(error.toString()); txtvError.setVisibility(View.VISIBLE); butRetry.setOnClickListener(v -> loadToplist()); butRetry.setVisibility(View.VISIBLE); }); }
Source:
<code>public List<String> getAllStudentsSorted() { ArrayList<String> allStudents = new ArrayList<String>(); allStudents.addAll(noResponse); <START> allStudents.addAll(studentsWhoResponded); <END> allStudents.sort(compareByTeamNameStudentName); return allStudents; }</code><technical_language>java ArrayList<String> allStudents = new ArrayList<>(studentsWhoResponded); allStudents.addAll(noResponse);</technical_language>

Target:
public List<String> getAllStudentsSorted() { ArrayList<String> allStudents = new ArrayList<String>(studentsWhoDidNotRespond); allStudents.addAll(studentsWhoResponded); allStudents.sort(compareByTeamNameStudentName); return allStudents; }
Source:
<code>private Optional<InputWithData<InputChannel, BufferAndAvailability>> waitAndGetNextData(boolean blocking) throws IOException, InterruptedException { while (true) { Optional<InputChannel> inputChannelOpt = getChannel(blocking); if (!inputChannelOpt.isPresent()) { return Optional.empty(); } final InputChannel inputChannel = inputChannelOpt.get(); <START> Optional<BufferAndAvailability> bufferAndAvailabilityOpt = inputChannel.getNextBuffer(); synchronized (inputChannelsWithData) { <END> if (!bufferAndAvailabilityOpt.isPresent()) { if (inputChannelsWithData.isEmpty()) { availabilityHelper.resetUnavailable(); } continue; } final BufferAndAvailability bufferAndAvailability = bufferAndAvailabilityOpt.get(); if (bufferAndAvailability.moreAvailable()) { queueChannelUnsafe(inputChannel, bufferAndAvailability.morePriorityEvents()); } final boolean morePriorityEvents = inputChannelsWithData.getNumPriorityElements() > 0; if (bufferAndAvailability.hasPriority() && !morePriorityEvents) { priorityAvailabilityHelper.resetUnavailable(); } if (inputChannelsWithData.isEmpty()) { availabilityHelper.resetUnavailable(); } return Optional.of(new InputWithData<>( inputChannel, bufferAndAvailability, !inputChannelsWithData.isEmpty(), morePriorityEvents)); } } }</code><technical_language>if result variable rename adding continue branch happened in independent "refactor" commit, saved a couple of minutes while reading this code while I understand change :( not, I changes a bit interconnected</technical_language>

Target:
private Optional<InputWithData<InputChannel, BufferAndAvailability>> waitAndGetNextData(boolean blocking) throws IOException, InterruptedException { while (true) { synchronized (inputChannelsWithData) { Optional<InputChannel> inputChannelOpt = getChannel(blocking); if (!inputChannelOpt.isPresent()) { return Optional.empty(); } final InputChannel inputChannel = inputChannelOpt.get(); Optional<BufferAndAvailability> bufferAndAvailabilityOpt = inputChannel.getNextBuffer(); if (!bufferAndAvailabilityOpt.isPresent()) { checkUnavailability(); continue; } final BufferAndAvailability bufferAndAvailability = bufferAndAvailabilityOpt.get(); if (bufferAndAvailability.moreAvailable()) { queueChannelUnsafe(inputChannel, bufferAndAvailability.morePriorityEvents()); } final boolean morePriorityEvents = inputChannelsWithData.getNumPriorityElements() > 0; if (bufferAndAvailability.hasPriority()) { lastPrioritySequenceNumber[inputChannel.getChannelIndex()] = bufferAndAvailability.getSequenceNumber(); if (!morePriorityEvents) { priorityAvailabilityHelper.resetUnavailable(); } } checkUnavailability(); return Optional.of(new InputWithData<>( inputChannel, bufferAndAvailability, !inputChannelsWithData.isEmpty(), morePriorityEvents)); } } }
Source:
<code>private void setRingerModeInt(int ringerMode, boolean persist) { mRingerMode = ringerMode; <START> AudioSystem.setRingerMode(ringerMode, 0); <END> int numStreamTypes = AudioSystem.getNumStreamTypes(); for (int streamType = numStreamTypes - 1; streamType >= 0; streamType--) { if (isStreamMutedByRingerMode(streamType)) { if (!isStreamAffectedByRingerMode(streamType) || mRingerMode == AudioManager.RINGER_MODE_NORMAL || (streamType == AudioSystem.STREAM_RING && (mConnectedDevices.containsKey(AudioSystem.DEVICE_OUT_WIRED_HEADSET) || mConnectedDevices.containsKey(AudioSystem.DEVICE_OUT_WIRED_HEADPHONE)))) { mStreamStates[streamType].mute(null, false); mRingerModeMutedStreams &= ~(1 << streamType); } } else { if (isStreamAffectedByRingerMode(streamType) && mRingerMode != AudioManager.RINGER_MODE_NORMAL && (streamType != AudioSystem.STREAM_RING || (!mConnectedDevices.containsKey(AudioSystem.DEVICE_OUT_WIRED_HEADSET) && !mConnectedDevices.containsKey(AudioSystem.DEVICE_OUT_WIRED_HEADPHONE)))) { mStreamStates[streamType].mute(null, true); mRingerModeMutedStreams |= (1 << streamType); } } } if (persist) { sendMsg(mAudioHandler, MSG_PERSIST_RINGER_MODE, SHARED_MSG, SENDMSG_REPLACE, 0, 0, null, PERSIST_DELAY); } }</code><technical_language>setRingerMode() in native code. Do a special need for it</technical_language>

Target:
private void setRingerModeInt(int ringerMode, boolean persist) { mRingerMode = ringerMode; AudioSystem.setRingerMode(ringerMode, 0); int numStreamTypes = AudioSystem.getNumStreamTypes(); for (int streamType = numStreamTypes - 1; streamType >= 0; streamType--) { if (isStreamMutedByRingerMode(streamType)) { if (!isStreamAffectedByRingerMode(streamType) || mRingerMode == AudioManager.RINGER_MODE_NORMAL || isStreamRoutedToWiredHeadset(streamType)) { if (mVoiceCapable && STREAM_VOLUME_ALIAS[streamType] == AudioSystem.STREAM_RING && mStreamStates[streamType].mLastAudibleIndex == 0) { mStreamStates[streamType].mLastAudibleIndex = 10; } mStreamStates[streamType].mute(null, false); mRingerModeMutedStreams &= ~(1 << streamType); } } else { if (isStreamAffectedByRingerMode(streamType) && mRingerMode != AudioManager.RINGER_MODE_NORMAL && !isStreamRoutedToWiredHeadset(streamType)) { mStreamStates[streamType].mute(null, true); mRingerModeMutedStreams |= (1 << streamType); } else if (mVoiceCapable && mRingerMode == AudioManager.RINGER_MODE_NORMAL && mStreamStates[streamType].mLastAudibleIndex == 0 && isStreamRoutedToWiredHeadset(streamType)) { mStreamStates[streamType].mLastAudibleIndex = 10; mStreamStates[streamType].mIndex = 10; } } } if (persist) { sendMsg(mAudioHandler, MSG_PERSIST_RINGER_MODE, SHARED_MSG, SENDMSG_REPLACE, 0, 0, null, PERSIST_DELAY); } }
Source:
<code>public int getItemCount() { <START> Log.isLoggable("dhjjy", mItems.size()); <END> return mItems.size(); }</code><technical_language>is purpose of this line? isLoggable for logging console. Log.d instead</technical_language>

Target:
public int getItemCount() { return mItems.size(); }
Source:
<code>public <T extends Method> List<SelectedMethod<T>> getMatchingMethods(Method mappingMethod, List<SelectedMethod<T>> methods, List<Type> sourceTypes, Type targetType, SelectionCriteria criteria) { if ( methods.isEmpty() ) { return methods; } List<SelectedMethod<T>> result = new ArrayList<>(); List<ParameterBinding> availableBindings; if ( sourceTypes.isEmpty() ) { availableBindings = getAvailableParameterBindingsFromMethod( mappingMethod, targetType, criteria.getSourceRHS() ); } else { availableBindings = getAvailableParameterBindingsFromSourceTypes( sourceTypes, targetType, mappingMethod ); } for ( SelectedMethod<T> method : methods ) { List<List<ParameterBinding>> parameterBindingPermutations = getCandidateParameterBindingPermutations( availableBindings, method.getMethod().getParameters() ); <START> <END> SelectedMethod<T> matchingMethod = getMatchingParameterBinding( targetType, mappingMethod, method, parameterBindingPermutations ); if ( matchingMethod != null ) { result.add( matchingMethod ); } } return result; }</code><technical_language>This sense a programming perspective. However, in case getMatchingParameterBinding is a complex method execute complex logic based parameterBindingPermutations. I revert changes TypeSelector class</technical_language>

Target:
public <T extends Method> List<SelectedMethod<T>> getMatchingMethods(Method mappingMethod, List<SelectedMethod<T>> methods, List<Type> sourceTypes, Type targetType, SelectionCriteria criteria) { if ( methods.isEmpty() ) { return methods; } List<SelectedMethod<T>> result = new ArrayList<>(); List<ParameterBinding> availableBindings; if ( sourceTypes.isEmpty() ) { availableBindings = getAvailableParameterBindingsFromMethod( mappingMethod, targetType, criteria.getSourceRHS() ); } else { availableBindings = getAvailableParameterBindingsFromSourceTypes( sourceTypes, targetType, mappingMethod ); } for ( SelectedMethod<T> method : methods ) { List<List<ParameterBinding>> parameterBindingPermutations = getCandidateParameterBindingPermutations( availableBindings, method.getMethod().getParameters() ); if ( parameterBindingPermutations != null ) { SelectedMethod<T> matchingMethod = getMatchingParameterBinding( targetType, mappingMethod, method, parameterBindingPermutations ); if ( matchingMethod != null ) { result.add( matchingMethod ); } } } return result; }
Source:
<code>public List<SampleDTO> getSamples(final String plotId) { final List<SampleDTO> listSampleDto = new ArrayList<>(); final List<Sample> samples = this.sampleDao.getByPlotId(plotId); for (Sample sample : samples) { SampleDTO dto = new SampleDTO(); dto.setSampleName(sample.getSampleName()); dto.setSampleBusinessKey(sample.getSampleBusinessKey()); User takenBy = sample.getTakenBy(); if (takenBy != null) { Person person = takenBy.getPerson(); dto.setTakenBy(person.getFirstName() + " " + person.getLastName()); } dto.setSamplingDate(sample.getSamplingDate()); <START> SampleList sampleList = sample.getSampleList(); <END> if (sampleList != null) { dto.setSampleList(sampleList.getListName()); } Plant plant = sample.getPlant(); dto.setPlantNumber(plant.getPlantNumber()); dto.setPlantBusinessKey(plant.getPlantBusinessKey()); listSampleDto.add(dto); } return listSampleDto; }</code><technical_language>@vmaletta add final</technical_language>

Target:
public List<SampleDTO> getSamples(final String plotId) { final List<Sample> samples = this.sampleDao.getByPlotId(plotId); return mapSampleToSampleDTO(samples); }
Source:
<code>private Set<SitemapEvent> constructSitemapEvents(Item item, List<Widget> widgets) { Set<SitemapEvent> events = new HashSet<>(); for (Widget w : widgets) { if (w instanceof Frame) { events.addAll(constructSitemapEvents(item, itemUIRegistry.getChildren((Frame) w))); } if ((w.getItem() != null && w.getItem().equals(item.getName())) || definesVisibility(w, item.getName())) { SitemapWidgetEvent event = new SitemapWidgetEvent(); event.sitemapName = sitemapName; event.pageId = pageId; event.label = itemUIRegistry.getLabel(w); event.labelcolor = itemUIRegistry.getLabelColor(w); event.valuecolor = itemUIRegistry.getValueColor(w); event.widgetId = itemUIRegistry.getWidgetId(w); event.visibility = itemUIRegistry.getVisiblity(w); event.item = EnrichedItemDTOMapper.map(item, false, null, null); <START> String state = itemUIRegistry.getState(w).toFullString(); <END> if (state.equals(event.item.state)) { event.state = "#item.state#"; } else { event.state = state; } events.add(event); } } return events; }</code><technical_language>this change break API of sitemap REST interface. event.item.state is a widget specific conversion more raw state. turning this provide raw state in event.state (in case is event.item.state leave widget specific state item</technical_language>

Target:
private Set<SitemapEvent> constructSitemapEvents(Item item, List<Widget> widgets) { Set<SitemapEvent> events = new HashSet<>(); for (Widget w : widgets) { if (w instanceof Frame) { events.addAll(constructSitemapEvents(item, itemUIRegistry.getChildren((Frame) w))); } if ((w.getItem() != null && w.getItem().equals(item.getName())) || definesVisibility(w, item.getName())) { SitemapWidgetEvent event = new SitemapWidgetEvent(); event.sitemapName = sitemapName; event.pageId = pageId; event.label = itemUIRegistry.getLabel(w); event.labelcolor = itemUIRegistry.getLabelColor(w); event.valuecolor = itemUIRegistry.getValueColor(w); event.widgetId = itemUIRegistry.getWidgetId(w); event.visibility = itemUIRegistry.getVisiblity(w); event.item = EnrichedItemDTOMapper.map(item, false, null, null); event.state = itemUIRegistry.getState(w).toFullString(); if (event.state != null && event.state.equals(event.item.state)) { event.state = null; } events.add(event); } } return events; }
Source:
<code>private static TypeUrl doParse(String typeUrl) { final String[] parts = typeUrlSeparatorPattern.split(typeUrl); if (parts.length != 2) { throw malformedTypeUrl(typeUrl); } final String prefix = parts[0]; if (prefix.isEmpty()) { throw malformedTypeUrl(typeUrl); } <START> final String typeName = parts[1]; <END> if (typeName.isEmpty()) { throw malformedTypeUrl(typeUrl); } return create(prefix, typeName); }</code><technical_language>trim parts anymore? " " part a malformed URL</technical_language>

Target:
private static TypeUrl doParse(String typeUrl) { final List<String> strings = splitter.splitToList(typeUrl); if (strings.size() != 2) { throw malformedTypeUrl(typeUrl); } final String prefix = strings.get(0); final String typeName = strings.get(1); return create(prefix, typeName); }
Source:
<code>private static ConsumerConfig createConsumerConfig(String zookeeper, String groupId, String optionalConfigs) { try { Properties props = new Properties(); props.put(KafkaEventAdapterConstants.ADAPTOR_SUSCRIBER_ZOOKEEPER_CONNECT, zookeeper); props.put(KafkaEventAdapterConstants.ADAPTOR_SUSCRIBER_GROUP_ID, groupId); if (optionalConfigs != null) { String[] optionalProperties = optionalConfigs.split(","); if (optionalProperties != null && optionalProperties.length > 0) { for (String header : optionalProperties) { String[] configPropertyWithValue = header.split(":"); if (configPropertyWithValue.length == 2) { props.put(configPropertyWithValue[0], configPropertyWithValue[1]); } else { log.warn("Optional configuration property not defined in the correct format.\nRequired - property_name1:property_value1,property_name2:property_value2\nFound - " + optionalConfigs); } } } } return new ConsumerConfig(props); } catch (Throwable t) { <START> throw new InputEventAdapterRuntimeException("Cannot access kafka context due to missing jars", t); <END> } }</code><technical_language>exception occurs of missing jars</technical_language>

Target:
private static ConsumerConfig createConsumerConfig(String zookeeper, String groupId, String optionalConfigs) { try { Properties props = new Properties(); props.put(KafkaEventAdapterConstants.ADAPTOR_SUSCRIBER_ZOOKEEPER_CONNECT, zookeeper); props.put(KafkaEventAdapterConstants.ADAPTOR_SUSCRIBER_GROUP_ID, groupId); if (optionalConfigs != null) { String[] optionalProperties = optionalConfigs.split(","); if (optionalProperties != null && optionalProperties.length > 0) { for (String header : optionalProperties) { String[] configPropertyWithValue = header.split(":", 2); if (configPropertyWithValue.length == 2) { props.put(configPropertyWithValue[0], configPropertyWithValue[1]); } else { log.warn("Optional configuration property not defined in the correct format.\nRequired - property_name1:property_value1,property_name2:property_value2\nFound - " + optionalConfigs); } } } } return new ConsumerConfig(props); } catch (NoClassDefFoundError e) { throw new InputEventAdapterRuntimeException("Cannot access kafka context due to missing jars", e); } }
Source:
<code>private void updateRequirements(IRepository parent, IReview review, ChangeDetailX detail, Map<String, IApprovalType> typeForName) { review.getRequirements().clear(); if (detail.getSubmitRecords() != null) { for (SubmitRecord record : detail.getSubmitRecords()) { for (Label label : record.getLabels()) { IApprovalType approvalType = typeForName.get(label.getLabel()); if (approvalType == null) { <START> throw new RuntimeException("Internal Error, no approval type found for: " + label.getLabel()); END> } IRequirementEntry requirementEntry = IReviewsFactory.INSTANCE.createRequirementEntry(); if (label.getStatus().equals("OK")) { requirementEntry.setStatus(RequirementStatus.SATISFIED); } else if (label.getStatus().equals("NEED")) { requirementEntry.setStatus(RequirementStatus.NOT_SATISFIED); } else if (label.getStatus().equals("REJECT")) { requirementEntry.setStatus(RequirementStatus.REJECTED); } else if (label.getStatus().equals("MAY")) { requirementEntry.setStatus(RequirementStatus.OPTIONAL); } else if (label.getStatus().equals("IMPOSSIBLE")) { requirementEntry.setStatus(RequirementStatus.ERROR); } if (label.getAppliedBy() != null) { IUser approver = getGerritProvider().createUser(parent, detail.getAccounts(), label.getAppliedBy()); requirementEntry.setBy(approver); } review.getRequirements().put(approvalType, requirementEntry); } } } }</code><technical_language>check state of review handle case appropriately</technical_language>

Target:
private void updateRequirements(IRepository parent, IReview review, ChangeDetailX detail, Map<String, IApprovalType> typeForName) { review.getRequirements().clear(); if (detail.getSubmitRecords() != null) { for (SubmitRecord record : detail.getSubmitRecords()) { for (Label label : record.getLabels()) { IApprovalType approvalType = typeForName.get(label.getLabel()); if (approvalType == null) { if (detail.getChange().getStatus() == Status.ABANDONED) { continue; } throw new RuntimeException("Internal Error, no approval type found for: " + label.getLabel()); } IRequirementEntry requirementEntry = IReviewsFactory.INSTANCE.createRequirementEntry(); if (label.getStatus().equals("OK")) { requirementEntry.setStatus(RequirementStatus.SATISFIED); } else if (label.getStatus().equals("NEED")) { requirementEntry.setStatus(RequirementStatus.NOT_SATISFIED); } else if (label.getStatus().equals("REJECT")) { requirementEntry.setStatus(RequirementStatus.REJECTED); } else if (label.getStatus().equals("MAY")) { requirementEntry.setStatus(RequirementStatus.OPTIONAL); } else if (label.getStatus().equals("IMPOSSIBLE")) { requirementEntry.setStatus(RequirementStatus.ERROR); } if (label.getAppliedBy() != null) { IUser approver = getGerritProvider().createUser(parent, detail.getAccounts(), label.getAppliedBy()); requirementEntry.setBy(approver); } review.getRequirements().put(approvalType, requirementEntry); } } } }
Source:
<code>public void configure(final Map<String, ?> configs) { final AssignorConfiguration assignorConfiguration = new AssignorConfiguration(configs); <START> logPrefix = assignorConfiguration.getLogPrefix(); <END> log = new LogContext(logPrefix).logger(getClass()); usedSubscriptionMetadataVersion = assignorConfiguration .getConfiguredMetadataVersion(usedSubscriptionMetadataVersion); taskManager = assignorConfiguration.getTaskManager(); streamsMetadataState = assignorConfiguration.getStreamsMetadataState(); assignmentErrorCode = assignorConfiguration.getAssignmentErrorCode(); nextScheduledRebalanceMs = assignorConfiguration.getNextScheduledRebalanceMs(); time = assignorConfiguration.getTime(); assignmentConfigs = assignorConfiguration.getAssignmentConfigs(); partitionGrouper = assignorConfiguration.getPartitionGrouper(); userEndPoint = assignorConfiguration.getUserEndPoint(); adminClient = assignorConfiguration.getAdminClient(); adminClientTimeout = assignorConfiguration.getAdminClientTimeout(); internalTopicManager = assignorConfiguration.getInternalTopicManager(); copartitionedTopicsEnforcer = assignorConfiguration.getCopartitionedTopicsEnforcer(); rebalanceProtocol = assignorConfiguration.getRebalanceProtocol(); taskAssignorSupplier = assignorConfiguration::getTaskAssignor; assignmentListener = assignorConfiguration.getAssignmentListener(); }</code><technical_language>do getLogPrefix() -- code style _always_ omit get prefix -- logPrefix() (Similar for other methods)</technical_language>

Target:
public void configure(final Map<String, ?> configs) { final AssignorConfiguration assignorConfiguration = new AssignorConfiguration(configs); logPrefix = assignorConfiguration.logPrefix(); log = new LogContext(logPrefix).logger(getClass()); usedSubscriptionMetadataVersion = assignorConfiguration .configuredMetadataVersion(usedSubscriptionMetadataVersion); taskManager = assignorConfiguration.taskManager(); streamsMetadataState = assignorConfiguration.streamsMetadataState(); assignmentErrorCode = assignorConfiguration.assignmentErrorCode(); nextScheduledRebalanceMs = assignorConfiguration.nextScheduledRebalanceMs(); time = assignorConfiguration.time(); assignmentConfigs = assignorConfiguration.assignmentConfigs(); partitionGrouper = assignorConfiguration.partitionGrouper(); userEndPoint = assignorConfiguration.userEndPoint(); adminClient = assignorConfiguration.adminClient(); adminClientTimeout = assignorConfiguration.adminClientTimeout(); internalTopicManager = assignorConfiguration.internalTopicManager(); copartitionedTopicsEnforcer = assignorConfiguration.copartitionedTopicsEnforcer(); rebalanceProtocol = assignorConfiguration.rebalanceProtocol(); taskAssignorSupplier = assignorConfiguration::taskAssignor; assignmentListener = assignorConfiguration.assignmentListener(); }
Source:
<code>public Object[][] invalidEncodingCharsData() { final char[] testCases = new char[] {'c', '\t', '\n', (char) -1, 'p', 'n', 'x' }; return IntStream.range(0, testCases.length) <START> .mapToObj(i -> testCases[i]) <END> .map(c -> new Object[] { c }) .toArray(Object[][]::new); }</code><technical_language>Do need IntStream here? Stream.of() do for string data</technical_language>

Target:
public Object[][] invalidEncodingCharsData() { final Character[] testCases = new Character[] {(char) 0, 'c', '\t', '\n', (char) -1, 'p', 'n', 'x', '!'}; return Stream.of(testCases) .map(c -> new Object[] { c }) .toArray(Object[][]::new); }
Source:
<code>public void initialize(DirectoryProviderInitializationContext context) { ConfigurationPropertySource propertySource = context.getConfigurationPropertySource(); this.directoryRoot = ROOT.get( propertySource ).toAbsolutePath(); FileSystemAccessStrategyName accessStrategyName = FILESYSTEM_ACCESS_STRATEGY.get( propertySource ); this.accessStrategy = FileSystemAccessStrategy.get( accessStrategyName ); <START> this.lockFactory = context.createConfiguredLockFactory().orElseGet( () -> FSLockFactory::getDefault ).get(); <END> try { FileSystemUtils.initializeWriteableDirectory( directoryRoot ); } catch (Exception e) { throw log.unableToInitializeRootDirectory( directoryRoot, e.getMessage(), e ); } }</code><technical_language>do call get here? end exact problem local heap directory, if user selects single-instance lock factory explicitly configuration</technical_language>

Target:
public void initialize(DirectoryProviderInitializationContext context) { ConfigurationPropertySource propertySource = context.getConfigurationPropertySource(); this.directoryRoot = ROOT.get( propertySource ).toAbsolutePath(); FileSystemAccessStrategyName accessStrategyName = FILESYSTEM_ACCESS_STRATEGY.get( propertySource ); this.accessStrategy = FileSystemAccessStrategy.get( accessStrategyName ); this.lockFactorySupplier = context.createConfiguredLockFactorySupplier().orElseGet( () -> FSLockFactory::getDefault ); try { FileSystemUtils.initializeWriteableDirectory( directoryRoot ); } catch (Exception e) { throw log.unableToInitializeRootDirectory( directoryRoot, e.getMessage(), e ); } }
Source:
<code>public void lookupDataSet(final Integer offset, final DataSetReadyCallback callback) { try { <START> if (!allowMultipleColumnSorting) { <END> if (lastOrderedColumn == null) { String defaultSortColumn = currentTableSetting.getTableDefaultSortColumnId(); if (!StringUtils.isBlank(defaultSortColumn)) { lastOrderedColumn = defaultSortColumn; lastSortOrder = currentTableSetting.getTableDefaultSortOrder(); } } if (lastOrderedColumn != null) { dataSetHandler.sort(lastOrderedColumn, lastSortOrder); } } dataSetHandler.limitDataSetRows(offset, currentTableSetting.getTablePageSize()); dataSetHandler.lookupDataSet( new DataSetReadyCallback() { public void callback(DataSet dataSet) { DataSetQueryHelper.this.dataSet = dataSet; callback.callback(dataSet); event.fire(new DataSetReadyEvent(currentTableSetting)); } public void notFound() { callback.notFound(); } @Override public boolean onError(final ClientRuntimeError error) { callback.onError(error); return false; } } ); } catch (Exception e) { callback.onError(new ClientRuntimeError(e.getMessage())); } }</code><technical_language>If simply set sorting order in table settings this change _allowMultipleColumnSorting_ avoided right</technical_language>

Target:
public void lookupDataSet(final Integer offset, final DataSetReadyCallback callback) { try { if (lastOrderedColumn == null) { String defaultSortColumn = currentTableSetting.getTableDefaultSortColumnId(); if (!StringUtils.isBlank(defaultSortColumn)) { lastOrderedColumn = defaultSortColumn; lastSortOrder = currentTableSetting.getTableDefaultSortOrder(); } } if (lastOrderedColumn != null) { dataSetHandler.sort(lastOrderedColumn, lastSortOrder); } dataSetHandler.limitDataSetRows(offset, currentTableSetting.getTablePageSize()); dataSetHandler.lookupDataSet( new DataSetReadyCallback() { public void callback(DataSet dataSet) { DataSetQueryHelper.this.dataSet = dataSet; callback.callback(dataSet); event.fire(new DataSetReadyEvent(currentTableSetting)); } public void notFound() { callback.notFound(); } @Override public boolean onError(final ClientRuntimeError error) { callback.onError(error); return false; } } ); } catch (Exception e) { callback.onError(new ClientRuntimeError(e.getMessage())); } }
Source:
<code>public void author() { TurboIssue issue = new TurboIssue(REPO, 1, "", "bob", null, false); assertEquals(true, matches("creator:BOB", issue)); assertEquals(true, matches("creator:bob", issue)); assertEquals(false, matches("creator:alice", issue)); assertEquals(true, matches("creator:o", issue)); assertEquals(false, matches("creator:lic", issue)); assertEquals(true, matches("author:BOB", issue)); assertEquals(true, matches("author:bob", issue)); assertEquals(false, matches("author:alice", issue)); assertEquals(true, matches("author:o", issue)); assertEquals(false, matches("author:lic", issue)); assertEquals(true, matches("au:BOB", issue)); assertEquals(true, matches("au:bob", issue)); assertEquals(false, matches("au:alice", issue)); assertEquals(true, matches("au:o", issue)); <START> assertEquals(false, matches("au:lic", issue)); <END> }</code><technical_language>Instead of duplicating lines, abstract a method call twice</technical_language>

Target:
public void author() { testAuthorParsing("author"); }
Source:
<code>public AnalyzedStatement analyze(SetStatement<Expression> node, ParamTypeHints typeHints, CoordinatorTxnCtx txnCtx) { boolean isPersistent = node.settingType().equals(SetStatement.SettingType.PERSISTENT); Map<String, List<Symbol>> settings = new HashMap<>(); var exprAnalyzer = new ExpressionAnalyzer( functions, txnCtx, typeHints, FieldProvider.FIELDS_AS_LITERAL, null ); SetStatement<Symbol> statement = node.map(x -> exprAnalyzer.convert(x, new ExpressionAnalysisContext())); switch (node.scope()) { case LICENSE: if (node.assignments().size() != AnalyzedSetLicenseStatement.LICENSE_TOKEN_NUM) { throw new IllegalArgumentException("Invalid number of arguments for SET LICENSE. " + "Please provide only the license key"); } return new AnalyzedSetLicenseStatement(statement.assignments().get(0).expression()); case GLOBAL: for (Assignment<Symbol> a : statement.assignments()) { <START> String settingName = a.columnName().representation(); <END> settings.put(settingName, ImmutableList.of(a.expression())); } break; default: Assignment<Symbol> assignment = statement.assignments().get(0); String settingName = assignment.columnName().representation(); List<String> nameParts = CrateSettings.settingNamesByPrefix(settingName); if (nameParts.size() != 0) { throw new IllegalArgumentException(String.format(Locale.ENGLISH, "GLOBAL Cluster setting '%s' cannot be used with SET SESSION / LOCAL", settingName)); } settings.put(settingName, assignment.expressions()); break; } return new AnalyzedSetStatement(node.scope(), settings, isPersistent); }</code><technical_language>representation() valid here. symbol evaluated binding</technical_language>

Target:
public AnalyzedStatement analyze(SetStatement<Expression> node, ParamTypeHints typeHints, CoordinatorTxnCtx txnCtx) { boolean isPersistent = node.settingType().equals(SetStatement.SettingType.PERSISTENT); var exprAnalyzer = new ExpressionAnalyzer( functions, txnCtx, typeHints, FieldProvider.FIELDS_AS_LITERAL, null ); SetStatement<Symbol> statement = node.map(x -> exprAnalyzer.convert(x, new ExpressionAnalysisContext())); if (node.scope() == SetStatement.Scope.LICENSE) { if (node.assignments().size() != AnalyzedSetLicenseStatement.LICENSE_TOKEN_NUM) { throw new IllegalArgumentException("Invalid number of arguments for SET LICENSE. " + "Please provide only the license key"); } return new AnalyzedSetLicenseStatement(statement.assignments().get(0).expression()); } return new AnalyzedSetStatement(node.scope(), statement.assignments(), isPersistent); }
Source:
<code>public static String hashpw(String password, String salt) { BCrypt B; String real_salt; byte passwordb[], saltb[], hashed[]; char minor = (char) 0; int rounds, off = 0; StringBuffer rs = new StringBuffer(); if (salt.charAt(0) != '$' || salt.charAt(1) != '2') { throw new IllegalArgumentException("Invalid salt version"); } if (salt.charAt(2) == '$') { off = 3; } else { minor = salt.charAt(2); if (minor != 'a' || salt.charAt(3) != '$') { throw new IllegalArgumentException("Invalid salt revision"); } off = 4; } if (salt.charAt(off + 2) > '$') { throw new IllegalArgumentException("Missing salt rounds"); } rounds = Integer.parseInt(salt.substring(off, off + 2)); real_salt = salt.substring(off + 3, off + 25); try { passwordb = (password + (minor >= 'a' ? "\000" : "")).getBytes("UTF-8"); } catch (UnsupportedEncodingException uee) { throw new AssertionError("UTF-8 is not supported"); } saltb = decode_base64(real_salt, BCRYPT_SALT_LEN); B = new BCrypt(); hashed = B.crypt_raw(passwordb, saltb, rounds, (int[]) bf_crypt_ciphertext.clone()); rs.append("$2"); if (minor >= 'a') { rs.append(minor); } rs.append("$"); if (rounds < 10) { rs.append("0"); } if (rounds > 30) { throw new IllegalArgumentException( "rounds exceeds maximum (30)"); } <START> rs.append(Integer.toString(rounds)) <END> .append("$") .append(encode_base64(saltb, saltb.length)) .append(encode_base64(hashed, bf_crypt_ciphertext.length * 4 - 1)); return rs.toString(); }</code><technical_language>bad: StringBuilder.append(int) exists is optimized</technical_language>

Target:
public static String hashpw(String password, String salt) { BCrypt B; String real_salt; byte passwordb[], saltb[], hashed[]; char minor = (char) 0; int rounds, off = 0; StringBuffer rs = new StringBuffer(); if (salt.charAt(0) != '$' || salt.charAt(1) != '2') { throw new IllegalArgumentException("Invalid salt version"); } if (salt.charAt(2) == '$') { off = 3; } else { minor = salt.charAt(2); if (minor != 'a' || salt.charAt(3) != '$') { throw new IllegalArgumentException("Invalid salt revision"); } off = 4; } if (salt.charAt(off + 2) > '$') { throw new IllegalArgumentException("Missing salt rounds"); } rounds = Integer.parseInt(salt.substring(off, off + 2)); real_salt = salt.substring(off + 3, off + 25); try { passwordb = (password + (minor >= 'a' ? "\000" : "")).getBytes("UTF-8"); } catch (UnsupportedEncodingException uee) { throw new AssertionError("UTF-8 is not supported"); } saltb = decode_base64(real_salt, BCRYPT_SALT_LEN); B = new BCrypt(); hashed = B.crypt_raw(passwordb, saltb, rounds, (int[]) bf_crypt_ciphertext.clone()); rs.append("$2"); if (minor >= 'a') { rs.append(minor); } rs.append("$"); if (rounds < 10) { rs.append("0"); } if (rounds > 30) { throw new IllegalArgumentException( "rounds exceeds maximum (30)"); } rs.append(rounds) .append("$") .append(encode_base64(saltb, saltb.length)) .append(encode_base64(hashed, bf_crypt_ciphertext.length * 4 - 1)); return rs.toString(); }
Source:
<code>static void registerTransformers_1_3_0(ResourceTransformationDescriptionBuilder parentBuilder) { final String defaultModuleName = ModuleName.PICKETBOX.getName(); ResourceTransformationDescriptionBuilder builder = parentBuilder.addChildResource(PATH_PROVIDER_MODULE); builder.getAttributeBuilder() <START> .setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, false, <END> new ModelNode( ), new ModelNode(defaultModuleName)), MODULE) .addRejectCheck(new RejectAttributeChecker.DefaultRejectAttributeChecker() { @Override public String getRejectionLogMessage(Map<String, ModelNode> attributes) { return SecurityLogger.ROOT_LOGGER.rejectAttributeMustBeUndefinedOrDefault(Constants.MODULE, defaultModuleName); } @Override protected boolean rejectAttribute(PathAddress address, String attributeName, ModelNode attributeValue, TransformationContext context) { return true; } }, MODULE).end(); }</code><technical_language>Pass in true for param (discardUndefined), remove undefined model node values</technical_language>

Target:
static void registerTransformers_1_3_0(ResourceTransformationDescriptionBuilder parentBuilder) { ResourceTransformationDescriptionBuilder builder = parentBuilder.addChildResource(PATH_PROVIDER_MODULE); builder.getAttributeBuilder() .setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, true, new ModelNode(ModuleName.PICKETBOX.getName())), MODULE) .addRejectCheck(RejectAttributeChecker.DEFINED, MODULE).end(); }
Source:
<code>private IntIterator newIterator() { if (!descending) { return bitmapIndex.iterator(); } if (bitmapIndex instanceof WrappedImmutableRoaringBitmap) { return ((WrappedImmutableRoaringBitmap) bitmapIndex).getBitmap().getReverseIntIterator(); } int i = bitmapIndex.size(); <START> int[] back = new int[bitmapIndex.size()]; <END> IntIterator iterator = bitmapIndex.iterator(); while (iterator.hasNext()) { back[--i] = iterator.next(); } return new ArrayIntIterator(back, 0); }</code><technical_language>I notice this earlier, materializing integer array create a lot of heap pressure. Instead, copy bitmap a temporary roaring bitmap reverse iterator</technical_language>

Target:
private IntIterator newIterator() { if (!descending) { return bitmapIndex.iterator(); } ImmutableBitmap roaringBitmap = bitmapIndex; if (!(bitmapIndex instanceof WrappedImmutableRoaringBitmap)) { final BitmapFactory factory = RoaringBitmapSerdeFactory.bitmapFactory; final MutableBitmap bitmap = factory.makeEmptyMutableBitmap(); final IntIterator iterator = bitmapIndex.iterator(); while (iterator.hasNext()) { bitmap.add(iterator.next()); } roaringBitmap = factory.makeImmutableBitmap(bitmap); } return ((WrappedImmutableRoaringBitmap) roaringBitmap).getBitmap().getReverseIntIterator(); }
Source:
<code>private String getWindupHome() { <START> int homeIndex = arguments.indexOf(toArg(IOptionKeys.HOME)) + 1; <END> String home = arguments.get(homeIndex); System.out.println(home); return String.valueOf(home); }</code><technical_language>if argument expected doesnt exist code another argument for Input argument. check complain default</technical_language>

Target:
private String getWindupHome() { int index = arguments.indexOf(toArg(IOptionKeys.HOME)) + 1; List<String> values = this.getValues(index); return values.size() == 1 ? values.get(0) : null; }
Source:
<code>public ResteasyClient build() { final HttpClient client = createHttpClient(factoryCustomizers); client.setIdleTimeout(config.getIdleTimeout().toMillis()); client.setAddressResolutionTimeout(config.getConnectTimeout().toMillis()); client.setConnectTimeout(config.getConnectTimeout().toMillis()); client.setMaxConnectionsPerDestination(config.getHttpClientDefaultMaxPerRoute()); client.setRemoveIdleDestinations(true); <START> client.setUserAgentField(new HttpField(HttpHeader.USER_AGENT, config.getUserAgent())); <END> if(StringUtils.isNotBlank(config.getProxyHost()) && config.getProxyPort() != 0) { HttpProxy proxy = new HttpProxy(config.getProxyHost(), config.getProxyPort()); client.getProxyConfiguration().getProxies().add(proxy); } if (config.isCookieHandlingEnabled()) { client.setCookieStore(new HttpCookieStore()); } final ClientConfiguration cc = new ClientConfiguration(getProviderFactory()); properties.forEach(cc::property); return new ResteasyClient(new JettyClientEngine(client), asyncExecutor, true, scheduledExecutorService, cc); }</code><technical_language>Log explicitly</technical_language>

Target:
public ResteasyClient build() { final HttpClient client = createHttpClient(factoryCustomizers); client.setIdleTimeout(config.getIdleTimeout().toMillis()); client.setAddressResolutionTimeout(config.getConnectTimeout().toMillis()); client.setConnectTimeout(config.getConnectTimeout().toMillis()); client.setMaxConnectionsPerDestination(config.getHttpClientDefaultMaxPerRoute()); client.setRemoveIdleDestinations(true); LOG.info("Setting User-Agent for the HTTP client to {}", clientName, config.getUserAgent()); client.setUserAgentField(new HttpField(HttpHeader.USER_AGENT, config.getUserAgent())); if(StringUtils.isNotBlank(config.getProxyHost()) && config.getProxyPort() != 0) { HttpProxy proxy = new HttpProxy(config.getProxyHost(), config.getProxyPort()); client.getProxyConfiguration().getProxies().add(proxy); } if (config.isCookieHandlingEnabled()) { client.setCookieStore(new HttpCookieStore()); } final ClientConfiguration cc = new ClientConfiguration(getProviderFactory()); properties.forEach(cc::property); return new ResteasyClient(new JettyClientEngine(client), asyncExecutor, true, scheduledExecutorService, cc); }
Source:
<code>protected boolean createAndOpenPapyrusModel(URI newURI, String diagramCategoryId) { if (newURI == null) { return false; } ServicesRegistry registry = createServicesRegistry(); if (registry == null) { return false; } try { ModelSet modelSet = registry.getService(ModelSet.class); createPapyrusModels(modelSet, newURI); initServicesRegistry(registry); initDomainModel(modelSet, newURI, diagramCategoryId); initDiagramModel(modelSet, diagramCategoryId); initProfile(modelSet); initTemplate(modelSet); openDiagram(newURI); } catch (ServiceException e) { <START> Activator.log.error(e); <END> return false; } finally { try { registry.disposeRegistry(); } catch (ServiceException ex) { } } return true; }</code><technical_language>If unanticipated error occurs, reported user. Activator.log is sufficient here, this displayed in error log. error message displayed in wizard, user wizard do pressing "Finish"</technical_language>

Target:
protected boolean createAndOpenPapyrusModel(URI newURI, String diagramCategoryId) { if (newURI == null) { return false; } ServicesRegistry registry = createServicesRegistry(); if (registry == null) { return false; } try { ModelSet modelSet = registry.getService(ModelSet.class); createPapyrusModels(modelSet, newURI); initServicesRegistry(registry); initDomainModel(modelSet, newURI, diagramCategoryId); initDiagramModel(modelSet, diagramCategoryId); initProfile(modelSet); initTemplate(modelSet); openDiagram(newURI); } catch (ServiceException e) { Activator.log.error(e); this.selectDiagramKindPage.setErrorMessage(e.getMessage()); return false; } finally { try { registry.disposeRegistry(); } catch (ServiceException ex) { } } return true; }
Source:
<code>public JettyIoPoolManager(String name, Class<? extends Annotation> annotation) { <START> this.name = name; <END> this.annotation = annotation; }</code><technical_language>Name is longer</technical_language>

Target:
public JettyIoPoolManager(String name, Class<? extends Annotation> annotation) { this.name = requireNonNull(name, "name is null");; this.annotation = requireNonNull(annotation, "annotation is null");; }
Source:
<code>public S3AInputStream(S3ObjectAttributes s3Attributes, long contentLength, AmazonS3 client, FileSystem.Statistics stats, S3AInstrumentation instrumentation, long readahead, S3AInputPolicy inputPolicy) { <START> Preconditions.checkArgument( <END> StringUtils.isNotEmpty(s3Attributes.getBucket() ), "No Bucket"); Preconditions.checkArgument( StringUtils.isNotEmpty(s3Attributes.getKey() ), "No Key"); Preconditions.checkArgument(contentLength >= 0, "Negative content length"); this.bucket = s3Attributes.getBucket(); this.key = s3Attributes.getKey(); this.contentLength = contentLength; this.client = client; this.stats = stats; this.uri = "s3a://" + this.bucket + "/" + this.key; this.streamStatistics = instrumentation.newInputStreamStatistics(); this.serverSideEncryptionAlgorithm = s3Attributes.getServerSideEncryptionAlgorithm(); this.serverSideEncryptionKey = s3Attributes.getServerSideEncryptionKey(); this.inputPolicy = inputPolicy; setReadahead(readahead); }</code><technical_language>lines reverted previous ones, if > 80 chars long. is a soft limit style checks: break if code nice</technical_language>

Target:
public S3AInputStream(S3ObjectAttributes s3Attributes, long contentLength, AmazonS3 client, FileSystem.Statistics stats, S3AInstrumentation instrumentation, long readahead, S3AInputPolicy inputPolicy) { Preconditions.checkArgument(isNotEmpty(s3Attributes.getBucket()), "No Bucket"); Preconditions.checkArgument(isNotEmpty(s3Attributes.getKey()), "No Key"); Preconditions.checkArgument(contentLength >= 0, "Negative content length"); this.bucket = s3Attributes.getBucket(); this.key = s3Attributes.getKey(); this.contentLength = contentLength; this.client = client; this.stats = stats; this.uri = "s3a://" + this.bucket + "/" + this.key; this.streamStatistics = instrumentation.newInputStreamStatistics(); this.serverSideEncryptionAlgorithm = s3Attributes.getServerSideEncryptionAlgorithm(); this.serverSideEncryptionKey = s3Attributes.getServerSideEncryptionKey(); this.inputPolicy = inputPolicy; setReadahead(readahead); }