auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void updateStack(AmazonCloudFormation cfn) throws IOException { String stackName = getStackName(); String cfnTemplateUrl = getCfnTemplateUrl(); List<Parameter> cfnStackParams = getCfnStackParams(); List<Tag> cfnStackTags = getCfnStackTags(); String cfnStackPolicyUrl = getCfnStackPolicyUrl(); File cfnTemplateFile = getCfnTemplateFile(); File cfnStackPolicyFile = getCfnStackPolicyFile(); getLogger().info("Update stack: {}", stackName); UpdateStackRequest req = new UpdateStackRequest() .withStackName(stackName) .withParameters(cfnStackParams) .withTags(cfnStackTags); if (Strings.isNullOrEmpty(cfnTemplateUrl) == false) { req.setTemplateURL(cfnTemplateUrl); getLogger().info("Using template url: {}", cfnTemplateUrl); } else { req.setTemplateBody(FileUtils.readFileToString(cfnTemplateFile)); getLogger().info("Using template file: {}", "$cfnTemplateFile.canonicalPath"); } if (isCapabilityIam()) { Capability selectedCapability = (getUseCapabilityIam() == null) ? Capability.CAPABILITY_IAM : getUseCapabilityIam(); <START> getLogger().info("Using IAM capability: " + selectedCapability); <END> req.setCapabilities(Arrays.asList(selectedCapability.toString())); } if (Strings.isNullOrEmpty(cfnStackPolicyUrl) == false) { req.setStackPolicyURL(cfnStackPolicyUrl); } else { req.setStackPolicyBody(FileUtils.readFileToString(cfnStackPolicyFile)); } UpdateStackResult updateStackResult = cfn.updateStack(req); getLogger().info("Update requested: {}", updateStackResult.getStackId()); }</code><technical_language>This line conflict commit 90e74664ed37232a68c675b8cf35227bd5ecd6db in pull request #89</technical_language>

Target:
private void updateStack(AmazonCloudFormation cfn) throws IOException { String stackName = getStackName(); String cfnTemplateUrl = getCfnTemplateUrl(); File cfnTemplateFile = getCfnTemplateFile(); List<Parameter> cfnStackParams = getCfnStackParams(); List<Tag> cfnStackTags = getCfnStackTags(); String cfnStackPolicyUrl = getCfnStackPolicyUrl(); File cfnStackPolicyFile = getCfnStackPolicyFile(); getLogger().info("Update stack: {}", stackName); UpdateStackRequest req = new UpdateStackRequest() .withStackName(stackName) .withParameters(cfnStackParams) .withTags(cfnStackTags); if (Strings.isNullOrEmpty(cfnTemplateUrl) == false) { req.setTemplateURL(cfnTemplateUrl); getLogger().info("Using template url: {}", cfnTemplateUrl); } else { req.setTemplateBody(FileUtils.readFileToString(cfnTemplateFile)); getLogger().info("Using template file: {}", "$cfnTemplateFile.canonicalPath"); } if (isCapabilityIam()) { Capability selectedCapability = (getUseCapabilityIam() == null) ? Capability.CAPABILITY_IAM : getUseCapabilityIam(); getLogger().info("Using IAM capability: " + selectedCapability); req.setCapabilities(Arrays.asList(selectedCapability.toString())); } if (Strings.isNullOrEmpty(cfnStackPolicyUrl) == false) { req.setStackPolicyURL(cfnStackPolicyUrl); } else if (cfnStackPolicyFile != null) { req.setStackPolicyBody( FileUtils.readFileToString(cfnStackPolicyFile)); } UpdateStackResult updateStackResult = cfn.updateStack(req); getLogger().info("Update requested: {}", updateStackResult.getStackId()); }
Source:
<code><START> private boolean spawnSnowman(Location location) { <END> if (SNOWMAN_PATTERN.matches(location, true, 0, 0)) { location.getWorld().spawnEntity(location.clone().subtract(-0.5, 2, -0.5), EntityType.SNOWMAN); return true; } return false; }</code><technical_language>is boolean for</technical_language>

Target:
private void spawnSnowman(Location location) { if (SNOWMAN_PATTERN.matches(location, true, 0, 0)) { location.getWorld().spawnEntity(location.clone().subtract(-0.5, 2, -0.5), EntityType.SNOWMAN); } }
Source:
<code>public IndexedRecord getCurrent() { <START> result.totalCount++; <END> return factory.convertToAvro(rs); }</code><technical_language>This counter incremented in advance() method getCurrent() called multiple times calling advance()</technical_language>

Target:
public IndexedRecord getCurrent() { return current; }
Source:
<code>public void close() { log.debug("Closing record collector"); maybeAbortTxn(); if (eosEnabled) { try { producer.close(); } catch (final KafkaException e) { throw new StreamsException("Caught a recoverable exception while closing", e); } <START> producer = null; <END> } checkForException(); }</code><technical_language>req: This is unnecessary</technical_language>

Target:
public void close() { log.debug("Closing record collector"); maybeAbortTxn(); if (eosEnabled) { try { producer.close(); } catch (final KafkaException e) { throw new StreamsException("Caught a recoverable exception while closing", e); } } checkForException(); }
Source:
<code>public static int getFactionID(SolShip ship){ String shipName = ship.getHull().getHullConfig().getInternalName(); String[] folderList = getFolderList(); for(int i = 0; i < folderList.length; i++) { <START> File factionFile = new File("modules/" + folderList[i] + "/assets/configs/factions.JSON"); <END> JsonParser parser = new JsonParser(); shipName = shipName.replaceFirst(folderList[i], ""); shipName = shipName.replace(":", ""); try { FileReader fileReader = new FileReader(factionFile); JsonArray factionJSON = parser.parse(fileReader).getAsJsonArray(); for(int n = 0; n < factionJSON.size(); n++) { for(int z = 0; z < factionJSON.get(n).getAsJsonObject().get("ships").getAsJsonArray().size(); z++) if(shipName.equals(factionJSON.get(n).getAsJsonObject().get("ships").getAsJsonArray().get(z).getAsString())) { return n; } } } catch (FileNotFoundException e) { e.printStackTrace(); } } return 0; }</code><technical_language>noticed this, applies in other places - capitalized filename suffixes bad idea</technical_language>

Target:
public static int getFactionID(SolShip ship) { String shipName = ship.getHull().getHullConfig().getInternalName(); for(String modulePath: getModuleSet()) { Json factionJson = Assets.getJson(modulePath); Validator.validate(factionJson.getJsonValue(), modulePath); JSONArray factionJsonArray = factionJson.getJsonValue().getJSONArray("factions"); shipName = shipName.replaceAll(".*:", ""); for(int n = 0; n < factionJsonArray.length(); n++) { for(int z = 0; z < factionJsonArray.getJSONObject(n).getJSONArray("ships").length(); z++) { if(shipName.equals(factionJsonArray.getJSONObject(n).getJSONArray("ships").get(z))) { return n; } } } } return 0; }
Source:
<code>public void onLoad() { INSTANCE = this; getDataFolder().mkdirs(); WorldEdit worldEdit = WorldEdit.getInstance(); server = new BukkitServerInterface(this, getServer()); worldEdit.getPlatformManager().register(server); <START> final File delChunks = Paths.get(getDataFolder().getPath(), "startup_delete_chunks.txt").toFile(); <END> if (delChunks.exists()) { ChunkDeleter.runFromFile(delChunks, true); } }</code><technical_language>prefer system here. new File(parent, child) convert nio, I prefer latter</technical_language>

Target:
public void onLoad() { INSTANCE = this; getDataFolder().mkdirs(); WorldEdit worldEdit = WorldEdit.getInstance(); server = new BukkitServerInterface(this, getServer()); worldEdit.getPlatformManager().register(server); Path delChunks = Paths.get(getDataFolder().getPath(), DELCHUNKS_FILE_NAME); if (Files.exists(delChunks)) { ChunkDeleter.runFromFile(delChunks, true); } }
Source:
<code>public String getAppFolderToMonitor() { <START> if (folder == null) { <END> File f = new File("Applications"); folder = f.getAbsolutePath(); } return folder; }</code><technical_language>If this is null, null? disable folder watching if interested in it. startMonitor method checks for return of this method null. I guess null default</technical_language>

Target:
public String getAppFolderToMonitor() { return folder; }
Source:
<code>public void truncateToSequenceNumber(final long truncationSeqNo) throws IOException { assert(m_memoryDeque.isEmpty()); m_persistentDeque.parseAndTruncate(new BinaryDequeTruncator() { @Override public TruncatorResponse parse(BBContainer bbc, boolean firstObject) { ByteBuffer b = bbc.b(); b.order(ByteOrder.LITTLE_ENDIAN); <START> if (firstObject) { <END> byte version = b.get(); assert(version == EXPORT_BUFFER_VERSION); b.getLong(); int skipSchema = b.getInt() + b.position(); b.position(skipSchema); } final long startSequenceNumber = b.getLong(); if (startSequenceNumber > truncationSeqNo) { return PersistentBinaryDeque.fullTruncateResponse(); } final int tupleCountPos = b.position(); final int tupleCount = b.getInt(); final long lastSequenceNumber = startSequenceNumber + tupleCount - 1; if (lastSequenceNumber <= truncationSeqNo) { return null; } b.getLong(); int offset = 0; while (b.hasRemaining()) { if (startSequenceNumber + offset > truncationSeqNo) { b.limit(b.position()); b.putInt(tupleCountPos, offset - 1); b.position(0); return new ByteBufferTruncatorResponse(b); } offset++; final int rowLength = b.getInt(); if (b.position() + rowLength > b.limit()) { System.out.println(rowLength); } b.position(b.position() + rowLength); } return null; } }); m_persistentDeque.close(); m_persistentDeque = new PersistentBinaryDeque(m_nonce, new VoltFile(m_path), exportLog); m_reader = m_persistentDeque.openForRead(m_nonce); exportLog.info("After truncate, PBD size is " + (m_reader.sizeInBytes() - (8 * m_reader.getNumObjects()))); }</code><technical_language>firstObject --> firstBuffer</technical_language>

Target:
public void truncateToSequenceNumber(final long truncationSeqNo) throws IOException { assert(m_memoryDeque.isEmpty()); m_persistentDeque.parseAndTruncate(new BinaryDequeTruncator() { @Override public TruncatorResponse parse(BBContainer bbc) { ByteBuffer b = bbc.b(); ByteOrder endianness = b.order(); b.order(ByteOrder.LITTLE_ENDIAN); try { final long startSequenceNumber = b.getLong(); if (startSequenceNumber > truncationSeqNo) { return PersistentBinaryDeque.fullTruncateResponse(); } final int tupleCountPos = b.position(); final int tupleCount = b.getInt(); final long lastSequenceNumber = startSequenceNumber + tupleCount - 1; if (lastSequenceNumber <= truncationSeqNo) { return null; } b.getLong(); int offset = 0; while (b.hasRemaining()) { if (startSequenceNumber + offset > truncationSeqNo) { b.limit(b.position()); b.putInt(tupleCountPos, offset - 1); b.position(0); return new ByteBufferTruncatorResponse(b); } offset++; final int rowLength = b.getInt(); if (b.position() + rowLength > b.limit()) { System.out.println(rowLength); } b.position(b.position() + rowLength); } return null; } finally { b.order(endianness); } } }); m_persistentDeque.close(); StreamTableSchemaSerializer ds = new StreamTableSchemaSerializer( VoltDB.instance().getCatalogContext(), m_streamName); m_persistentDeque = new PersistentBinaryDeque(m_nonce, ds, new VoltFile(m_path), exportLog); m_reader = m_persistentDeque.openForRead(m_nonce); exportLog.info("After truncate, PBD size is " + (m_reader.sizeInBytes() - (8 * m_reader.getNumObjects()))); }
Source:
<code>public void updateProjectAction(ActionEvent e) { CurrentProject project = appContext.getCurrentProject(); <START> if (project == null || !"maven".equals(project.getRootProject().getType())) { <END> e.getPresentation().setEnabledAndVisible(false); return; } Selection<?> selection = projectExplorer.getSelection(); if (selection == null) { e.getPresentation().setEnabledAndVisible(false); return; } e.getPresentation().setVisible(true); e.getPresentation().setEnabled(selection.isSingleSelection() && (selection.getHeadElement() instanceof SourceFolderNode || selection.getHeadElement() instanceof PackageNode)); }</code><technical_language>special constant for Maven PType ID: <LINK_0></technical_language>

Target:
public void updateProjectAction(ActionEvent e) { CurrentProject project = appContext.getCurrentProject(); if (project == null || !MAVEN.equals(project.getRootProject().getType())) { e.getPresentation().setEnabledAndVisible(false); return; } Selection<?> selection = projectExplorer.getSelection(); if (selection == null) { e.getPresentation().setEnabledAndVisible(false); return; } e.getPresentation().setVisible(true); e.getPresentation().setEnabled(selection.isSingleSelection() && (selection.getHeadElement() instanceof SourceFolderNode || selection.getHeadElement() instanceof PackageNode)); }
Source:
<code>private void createTooltipShell(Shell parent) { final Display display = parent.getDisplay(); if (fTipShell != null && !fTipShell.isDisposed()) { fTipShell.dispose(); } fTipShell = new Shell(parent, SWT.ON_TOP | SWT.TOOL); fTipShell.addDisposeListener(e -> e.display.removeFilter(SWT.MouseMove, fListener)); fTipShell.addDisposeListener(e -> e.display.removeFilter(SWT.FocusOut, fFocusLostListener)); fTipShell.addListener(SWT.Deactivate, e -> { <START> if (fTipShell.isDisposed()) { <END> fTipShell.dispose(); } }); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; gridLayout.marginWidth = 2; gridLayout.marginHeight = 2; fTipShell.setLayout(gridLayout); fTipShell.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND)); fTipComposite = new Composite(fTipShell, SWT.NONE); fTipComposite.setLayout(new GridLayout(3, false)); setupControl(fTipComposite); }</code><technical_language>do twice</technical_language>

Target:
private void createTooltipShell(Shell parent) { final Display display = parent.getDisplay(); if (fTipShell != null && !fTipShell.isDisposed()) { fTipShell.dispose(); } fTipShell = new Shell(parent, SWT.ON_TOP | SWT.TOOL); fTipShell.addDisposeListener(e -> e.display.removeFilter(SWT.MouseMove, fListener)); fTipShell.addDisposeListener(e -> e.display.removeFilter(SWT.FocusOut, fFocusLostListener)); fTipShell.addListener(SWT.Deactivate, e -> { if (!fTipShell.isDisposed()) { fTipShell.dispose(); } }); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; gridLayout.marginWidth = 2; gridLayout.marginHeight = 2; fTipShell.setLayout(gridLayout); fTipShell.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND)); fTipComposite = new Composite(fTipShell, SWT.NONE); fTipComposite.setLayout(new GridLayout(3, false)); setupControl(fTipComposite); }
Source:
<code>public Single<Optional<java.io.File>> getDriveFileAsJavaFile(String fileId, java.io.File downloadLocationFile) { try (InputStream is = driveService.files().get(fileId).setFields("*").executeMediaAsInputStream()) { try (FileOutputStream fileOutputStream = new FileOutputStream(downloadLocationFile)) { byte[] buffer = new byte[BYTE_BUFFER_SIZE]; int read; while ((read = is.read(buffer)) != -1) { fileOutputStream.write(buffer, 0, read); } return Single.just(Optional.of(downloadLocationFile)); } catch (FileNotFoundException e) { Logger.error(DriveServiceHelper.this, "Failed write file with FileNotFoundException: ", e); return Single.error(e); } <START> } catch (GoogleJsonResponseException e) { <END> Logger.error(DriveServiceHelper.this, "Failed write file with GoogleJsonResponseException: ", e); return Single.just(Optional.absent()); } catch (IOException e) { Logger.error(DriveServiceHelper.this, "Failed write file with IOException: ", e); return Single.error(e); } }</code><technical_language>confirm - this is type of error planning ignore, right? If so, update Logger in a logger.warn statement instead</technical_language>

Target:
public Single<Optional<java.io.File>> getDriveFileAsJavaFile(String fileId, java.io.File downloadLocationFile) { try (InputStream is = driveService.files().get(fileId).setFields("*").executeMediaAsInputStream()) { try (FileOutputStream fileOutputStream = new FileOutputStream(downloadLocationFile)) { byte[] buffer = new byte[BYTE_BUFFER_SIZE]; int read; while ((read = is.read(buffer)) != -1) { fileOutputStream.write(buffer, 0, read); } return Single.just(Optional.of(downloadLocationFile)); } catch (FileNotFoundException e) { Logger.error(DriveServiceHelper.this, "Failed write file with FileNotFoundException: ", e); return Single.error(e); } } catch (GoogleJsonResponseException e) { Logger.warn(DriveServiceHelper.this, "Failed write file with GoogleJsonResponseException: ", e); return Single.just(Optional.absent()); } catch (IOException e) { Logger.error(DriveServiceHelper.this, "Failed write file with IOException: ", e); return Single.error(e); } }
Source:
<code>private ApplicationManager createSourceAndDeployApp(String appName, File file, String format, String outputDatasetName, Schema schema) throws Exception { String schemaString = null; if (schema != null) { schemaString = schema.toString(); } ETLStage source = new ETLStage( "source", new ETLPlugin("File", BatchSource.PLUGIN_TYPE, ImmutableMap.<String, String>builder() .put(Constants.Reference.REFERENCE_NAME, "TestFile") .put(Properties.File.FILESYSTEM, "Text") .put(Properties.File.PATH, file.getAbsolutePath()) .put(Properties.File.FORMAT, format) .put(Properties.File.IGNORE_NON_EXISTING_FOLDERS, "false") .put("pathField", "file") .put(Properties.File.SCHEMA, schemaString) .build(), null)); ETLStage sink = new ETLStage("sink", MockSink.getPlugin(outputDatasetName)); ETLBatchConfig etlConfig = ETLBatchConfig.builder("* * * * *") .addStage(source) .addStage(sink) .addConnection(source.getName(), sink.getName()) .build(); AppRequest<ETLBatchConfig> appRequest = new AppRequest<>(BATCH_ARTIFACT, etlConfig); <START> ApplicationId appId = NamespaceId.DEFAULT.app(appName + format + "Format"); <END> ApplicationManager appManager = deployApplication(appId, appRequest); return appManager; }</code><technical_language>need append format + "Format"</technical_language>

Target:
private ApplicationManager createSourceAndDeployApp(String appName, File file, String format, String outputDatasetName, Schema schema) throws Exception { String schemaString = null; if (schema != null) { schemaString = schema.toString(); } ETLStage source = new ETLStage( "source", new ETLPlugin("File", BatchSource.PLUGIN_TYPE, ImmutableMap.<String, String>builder() .put(Constants.Reference.REFERENCE_NAME, "TestFile") .put(Properties.File.FILESYSTEM, "Text") .put(Properties.File.PATH, file.getAbsolutePath()) .put(Properties.File.FORMAT, format) .put(Properties.File.IGNORE_NON_EXISTING_FOLDERS, "false") .put("pathField", "file") .put(Properties.File.SCHEMA, schemaString) .build(), null)); ETLStage sink = new ETLStage("sink", MockSink.getPlugin(outputDatasetName)); ETLBatchConfig etlConfig = ETLBatchConfig.builder("* * * * *") .addStage(source) .addStage(sink) .addConnection(source.getName(), sink.getName()) .build(); AppRequest<ETLBatchConfig> appRequest = new AppRequest<>(BATCH_ARTIFACT, etlConfig); ApplicationId appId = NamespaceId.DEFAULT.app(appName); ApplicationManager appManager = deployApplication(appId, appRequest); return appManager; }
Source:
<code>public void alertFound(Alert alert) { parentScanner.notifyAlertFound(alert); PluginStats pluginStats = mapPluginStats.get(alert.getPluginId()); if (pluginStats != null) { pluginStats.incAlertCount(); } alertCount++; ExtensionAlert extensionAlertRef = Control.getSingleton().getExtensionLoader().getExtension(ExtensionAlert.class); <START> if (extensionAlertRef != null) { <END> if (extensionAlertRef.isNewAlert(alert) == true) { newAlertCount++; } } }</code><technical_language>ExtensionActiveScan depends ExtensionAlert assume loaded/enabled here</technical_language>

Target:
public void alertFound(Alert alert) { ExtensionAlert extensionAlertRef = Control.getSingleton().getExtensionLoader().getExtension(ExtensionAlert.class); if (extensionAlertRef.isNewAlert(alert)) { newAlertCount++; } parentScanner.notifyAlertFound(alert); PluginStats pluginStats = mapPluginStats.get(alert.getPluginId()); if (pluginStats != null) { pluginStats.incAlertCount(); } alertCount++; }
Source:
<code>protected void createRawDataHeader(Workbook wb, Sheet baseSheet, Map<QuestionGroupDto, List<QuestionDto>> questionMap ) { int columnIdx = addMetaDataHeaders(baseSheet, !makeRepSheets); addComment(baseSheet); if (questionMap != null) { int offset = ++columnIdx; <START> for (QuestionGroupDto group : orderedGroupList) { <END> if (questionMap.get(group) != null) { if (qgSheetMap.containsKey(group.getKeyId())) { Sheet groupSheet = qgSheetMap.get(group.getKeyId()); int metaEnd = addMetaDataHeaders(groupSheet, true); addComment(groupSheet); writeRawDataGroupHeaders(groupSheet, group, questionMap.get(group), metaEnd + 1); } else { offset = writeRawDataGroupHeaders(baseSheet, group, questionMap.get(group), offset); } } } columnIndexMap.put(DIGEST_COLUMN, offset); } }</code><technical_language>warned loops! if I read this, I feel a cleaner approach extract common logic is involved in creating header row, a createRawDataHeader() a generic function takes a sheet a list of questions belonging groups in sheet in order create headers. alternatively a list of question groups contains a list of questions. this sense for base sheet for sheets for repeat question groups</technical_language>

Target:
protected void createRawDataHeader(Workbook wb, Sheet baseSheet, Map<QuestionGroupDto, List<QuestionDto>> questionMap ) { int columnIdx = addMetaDataHeaders(baseSheet, !separateSheetsForRepeatableGroups); addComment(baseSheet); if (questionMap != null) { int offset = ++columnIdx; for (QuestionGroupDto group : orderedGroupList) { if (questionMap.get(group) != null) { if (qgSheetMap.containsKey(group.getKeyId())) { Sheet groupSheet = qgSheetMap.get(group.getKeyId()); int metaEnd = addMetaDataHeaders(groupSheet, true); addComment(groupSheet); writeRawDataGroupHeaders(groupSheet, group, questionMap.get(group), metaEnd + 1); } else { offset = writeRawDataGroupHeaders(baseSheet, group, questionMap.get(group), offset); } } } columnIndexMap.put(DIGEST_COLUMN, offset); } }
Source:
<code>public static boolean basesEqual(byte lhs, byte rhs) { if (lhs == rhs) return true; if (lhs > 90) lhs -= 32; if (rhs > 90) rhs -= 32; if ((isValidBase(lhs, VALID_BASES_WITH_N_UPPER) && (isValidBase(rhs, VALID_BASES_WITH_N_UPPER)))) { return lhs == rhs; } final Set<Byte> rightSide = iupacBaseMappings.get(rhs); <START> for (byte b : iupacBaseMappings.get(lhs)) { <END> if (rightSide.contains(b)) { return true; } } return false; }</code><technical_language>byte b 'final'</technical_language>

Target:
public static boolean basesEqual(byte lhs, byte rhs) { return (bases[lhs] & bases[rhs]) > 0; }
Source:
<code>public CreateOnlyResourceOperationsImpl(OkHttpClient client, Config config, String apiGroupName, String apiGroupVersion, String plural, Class<T> subjectAccessRequestClass) { this(new OperationContext().withOkhttpClient(client).withConfig(config), apiGroupName, apiGroupVersion, plural, subjectAccessRequestClass); <START> this.subjectAccessRequestClass = subjectAccessRequestClass; <END> }</code><technical_language>Sames as: <LINK_0></technical_language>

Target:
public CreateOnlyResourceOperationsImpl(OkHttpClient client, Config config, String apiGroupName, String apiGroupVersion, String plural, Class<T> subjectAccessRequestClass) { this(new OperationContext().withOkhttpClient(client).withConfig(config), apiGroupName, apiGroupVersion, plural, subjectAccessRequestClass); }
Source:
<code>public TreeWsResponse tree(TreeWsRequest request) { GetRequest get = new GetRequest(path(ACTION_TREE)) <START> .setParam(PARAM_COMPONENT_ID, request.getBaseComponentId()) <END> .setParam(PARAM_COMPONENT, request.getComponent()) .setParam(PARAM_BRANCH, request.getBranch()) .setParam(PARAM_QUALIFIERS, inlineMultipleParamValue(request.getQualifiers())) .setParam(PARAM_STRATEGY, request.getStrategy()) .setParam(Param.PAGE, request.getPage()) .setParam(Param.PAGE_SIZE, request.getPageSize()) .setParam(Param.TEXT_QUERY, request.getQuery()) .setParam(Param.SORT, inlineMultipleParamValue(request.getSort())); return call(get, TreeWsResponse.parser()); }</code><technical_language>![MINOR](<LINK_2> 'Severity: MINOR') Remove this of "getBaseComponentId"; is deprecated. [![rule](<LINK_1>](<LINK_0></technical_language>

Target:
public TreeWsResponse tree(TreeWsRequest request) { GetRequest get = new GetRequest(path(ACTION_TREE)) .setParam(PARAM_COMPONENT_ID, request.getBaseComponentId()) .setParam("baseComponentKey", request.getBaseComponentKey()) .setParam(PARAM_COMPONENT, request.getComponent()) .setParam(PARAM_BRANCH, request.getBranch()) .setParam(PARAM_QUALIFIERS, inlineMultipleParamValue(request.getQualifiers())) .setParam(PARAM_STRATEGY, request.getStrategy()) .setParam(Param.PAGE, request.getPage()) .setParam(Param.PAGE_SIZE, request.getPageSize()) .setParam(Param.TEXT_QUERY, request.getQuery()) .setParam(Param.SORT, inlineMultipleParamValue(request.getSort())); return call(get, TreeWsResponse.parser()); }
Source:
<code>public CoupleMbusDeviceByChannelResponseDto execute(final DlmsConnectionHolder conn, final DlmsDevice device, final CoupleMbusDeviceByChannelRequestDataDto requestDto) throws ProtocolAdapterException { <START> LOGGER.info("Retrieving values for mbus channel on meter {}", requestDto.getChannel(), <END> device.getDeviceIdentification()); final List<GetResult> resultList = this.coupleMBusDeviceCommandExecutor.getMBusClientAttributeValues(conn, device, requestDto.getChannel()); return new CoupleMbusDeviceByChannelResponseDto( this.coupleMBusDeviceCommandExecutor.makeChannelElementValues(requestDto.getChannel(), resultList)); }</code><technical_language>Write 'device' instead of 'meter'</technical_language>

Target:
public CoupleMbusDeviceByChannelResponseDto execute(final DlmsConnectionHolder conn, final DlmsDevice device, final CoupleMbusDeviceByChannelRequestDataDto requestDto) throws ProtocolAdapterException { LOGGER.info("Retrieving values for mbus channel on device {}", requestDto.getChannel(), device.getDeviceIdentification()); final List<GetResult> resultList = this.coupleMBusDeviceCommandExecutor.getMBusClientAttributeValues(conn, device, requestDto.getChannel()); return new CoupleMbusDeviceByChannelResponseDto( this.coupleMBusDeviceCommandExecutor.makeChannelElementValues(requestDto.getChannel(), resultList)); }
Source:
<code>public Map<String, String> getUserConfig(String loggedInUser) { HashMap<String, String> userConfig = new HashMap<String, String>(); userConfig.put(GrillConfConstants.GRILL_SESSION_CLUSTER_USER, userMap.get(loggedInUser) == null ? <START> hiveConf.get(GrillConfConstants.GRILL_SESSION_USER_RESOLVER_FIXED_VALUE, "grill") : <END> userMap.get(loggedInUser)); return userConfig; }</code><technical_language>return loggedinuser if loaded config? thinking user properties loaded follow a pattern? changes done too</technical_language>

Target:
public Map<String, String> getUserConfig(String loggedInUser) { return userMap.get(loggedInUser) == null ? userMap.get("*") : userMap.get(loggedInUser); }
Source:
<code>public ZLoop(Context context) { assert (context != null); <START> context = context; <END> pollers = new ArrayList<SPoller>(); timers = new ArrayList<STimer>(); zombies = new ArrayList<Object>(); newTimers = new ArrayList<STimer>(); }</code><technical_language>this.context = context;</technical_language>

Target:
public ZLoop(Context context) { assert (context != null); this.context = context; pollers = new ArrayList<SPoller>(); timers = new ArrayList<STimer>(); zombies = new ArrayList<Object>(); newTimers = new ArrayList<STimer>(); }
Source:
<code>public AccessControlPolicy[] getEffectivePolicies(String path) throws PathNotFoundException, AccessDeniedException, RepositoryException { if (session.isReadOnly()) { throw new AccessDeniedException("Session is read only"); <START> } <END> AccessControlPolicy[] policies = getPolicies(path); if (policies.length == 0) { return new AccessControlPolicy[]{(AccessControlPolicy) this.getApplicablePolicies(path).next()}; } return policies; }</code><technical_language>explain this check is used? is a read-only session able get of effective policies</technical_language>

Target:
public AccessControlPolicy[] getEffectivePolicies(String path) throws PathNotFoundException, AccessDeniedException, RepositoryException { AccessControlPolicy[] policies = getPolicies(path); if (policies.length == 0) { return new AccessControlPolicy[]{(AccessControlPolicy) this.getApplicablePolicies(path).next()}; } return policies; }
Source:
<code>public ComponentBuilder append(BaseComponent component, FormatRetention retention) { <START> BaseComponent previous = parts.get( parts.size() - 1 ); <END> if ( previous == null ) { previous = dummy; dummy = null; } if ( previous != null ) { component.copyFormatting( previous, retention, false ); } parts.add( component ); resetCursor(); return this; }</code><technical_language>throw exception created args constructor</technical_language>

Target:
public ComponentBuilder append(BaseComponent component, FormatRetention retention) { BaseComponent previous = ( parts.isEmpty() ) ? null : parts.get( parts.size() - 1 ); if ( previous == null ) { previous = dummy; dummy = null; } if ( previous != null ) { component.copyFormatting( previous, retention, false ); } parts.add( component ); resetCursor(); return this; }
Source:
<code>public void testLoadAddresses() { Collection<Address> addresses = provider.loadAddresses(); <START> assertTrue("Expected that at least one address is loaded", addresses.size() > 0); <END> for (Address address : addresses) { assertEquals(PRIVATE_IP_ADDRESS, address.getHost()); } }</code><technical_language>address</technical_language>

Target:
public void testLoadAddresses() { Collection<Address> addresses = provider.loadAddresses(); assertEquals(3, addresses.size()); for (Address address : expectedAddresses.keySet()) { addresses.remove(address); } assertTrue(addresses.isEmpty()); }
Source:
<code>private Boolean isMobile() { final String aClass = driver.findElement(slotSelector).getAttribute("class"); <START> return aClass.contains("is-mobile-device") || aClass.contains("theme-mobile-layout"); <END> }</code><technical_language>Please remove .theme-mobile-layout. remove this class. is-mobile-layout instead of is-mobile-device</technical_language>

Target:
private Boolean isMobile() { final String aClass = driver.findElement(slotSelector).getAttribute("class"); return aClass.contains("is-mobile-layout"); }
Source:
<code>protected DefaultDataContainer(int concurrencyLevel, long thresholdSize, EvictionStrategy strategy, EvictionThreadPolicy policy, Equivalence<? super K> keyEquivalence, EntrySizeCalculator<? super K, ? super V> sizeCalculator) { DefaultEvictionListener evictionListener; switch (policy) { case PIGGYBACK: case DEFAULT: evictionListener = new DefaultEvictionListener(); break; default: throw new IllegalArgumentException("No such eviction thread policy " + policy); } EntrySizeCalculator<K, InternalCacheEntry<K, V>> calc = new CacheEntrySizeCalculator<>(sizeCalculator); com.github.benmanes.caffeine.cache.Cache<K, InternalCacheEntry<K, V>> cache = applyListener(Caffeine.newBuilder() <START> .<K, InternalCacheEntry<K, V>>weigher((k, v) -> (int) calc.calculateSize(k, v)) <END> .maximumWeight(thresholdSize), evictionListener) .build(); entries = new CaffeineConcurrentMap<>(cache); }</code><technical_language>java .weigher((K k, InternalCacheEntry<K, V> v) -> (int) calc.calculateSize(k, v))</technical_language>

Target:
protected DefaultDataContainer(int concurrencyLevel, long thresholdSize, EvictionStrategy strategy, EvictionThreadPolicy policy, Equivalence<? super K> keyEquivalence, EntrySizeCalculator<? super K, ? super V> sizeCalculator) { DefaultEvictionListener evictionListener; switch (policy) { case PIGGYBACK: case DEFAULT: evictionListener = new DefaultEvictionListener(); break; default: throw new IllegalArgumentException("No such eviction thread policy " + policy); } EntrySizeCalculator<K, InternalCacheEntry<K, V>> calc = new CacheEntrySizeCalculator<>(sizeCalculator); com.github.benmanes.caffeine.cache.Cache<K, InternalCacheEntry<K, V>> cache = applyListener(Caffeine.newBuilder() .weigher((K k, InternalCacheEntry<K, V> v) -> (int) calc.calculateSize(k, v)) .maximumWeight(thresholdSize), evictionListener) .build(); entries = new CaffeineConcurrentMap<>(cache); }
Source:
<code>public void newProfile() { if (getWindow() != null) { return; } SystemTreeItemModel treeSelectedItem = (SystemTreeItemModel) CommonModel.getInstance().getSystemTree().getSelectedItem(); SystemTreeItemModel treeSelectedDc = <START> treeSelectedItem.getType() == SystemTreeItemType.DataCenter ? treeSelectedItem : null; <END> final VnicProfileModel profileModel = new NewVnicProfileModel(this, ((StoragePool) treeSelectedDc.getEntity()).getcompatibility_version()); setWindow(profileModel); initNetworkList(profileModel); }</code><technical_language>missing case selected item is a network, search tree for DC ancestor? a method especially for in SystemTreeItemModel, if I recall correctly</technical_language>

Target:
public void newProfile() { if (getWindow() != null) { return; } SystemTreeItemModel treeSelectedItem = (SystemTreeItemModel) CommonModel.getInstance().getSystemTree().getSelectedItem(); SystemTreeItemModel treeSelectedDc = SystemTreeItemModel.findAncestor(SystemTreeItemType.DataCenter, treeSelectedItem); final VnicProfileModel profileModel = new NewVnicProfileModel(this, ((StoragePool) treeSelectedDc.getEntity()).getcompatibility_version()); setWindow(profileModel); initNetworkList(profileModel); }
Source:
<code>public void initialise() { this.playerCamera = worldRenderer.getActiveCamera(); this.shadowMapShader = worldRenderer.getMaterial("engine:prog.shadowMap"); this.renderingConfig = config.getRendering(); renderableWorld.setShadowMapCamera(shadowMapCamera); <START> requireFBO(new FBOConfig(SHADOW_MAP_URN, FBO.Type.NO_COLOR).useDepthBuffer(), shadowMapResolutionDependentFBM); <END> addDesiredStateChange(new BindFBO(SHADOW_MAP_URN, shadowMapResolutionDependentFBM)); addDesiredStateChange(new SetViewportSizeOf(SHADOW_MAP_URN, shadowMapResolutionDependentFBM)); }</code><technical_language>rename shadowMapResolutionDependentFBOs</technical_language>

Target:
public void initialise() { this.playerCamera = worldRenderer.getActiveCamera(); this.shadowMapShader = worldRenderer.getMaterial("engine:prog.shadowMap"); this.renderingConfig = config.getRendering(); renderableWorld.setShadowMapCamera(shadowMapCamera); requiresFBO(new FBOConfig(SHADOW_MAP, FBO.Type.NO_COLOR).useDepthBuffer(), shadowMapResolutionDependentFBOs); addDesiredStateChange(new BindFBO(SHADOW_MAP, shadowMapResolutionDependentFBOs)); addDesiredStateChange(new SetViewportSizeOf(SHADOW_MAP, shadowMapResolutionDependentFBOs)); }
Source:
<code>public void setUp() throws Exception { <START> strWords = "Foo"; <END> BrickTestUtils.createProjectAndGetStartScript("SpeakAndWaitBrickTest").addBrick(new SpeakAndWaitBrick(strWords)); brickPosition = 1; baseActivityTestRule.launchActivity(null); }</code><technical_language>please abbreviations in variable names. give some meaningful name</technical_language>

Target:
public void setUp() throws Exception { String testSpeakString = "Foo Baar"; BrickTestUtils.createProjectAndGetStartScript("SpeakAndWaitBrickTest").addBrick(new SpeakAndWaitBrick(testSpeakString)); brickPosition = 1; baseActivityTestRule.launchActivity(null); }
Source:
<code>private Xpp3Dom getPluginConfig(Plugin plugin, Xpp3Dom overrides) { Xpp3Dom config = (overrides != null) ? overrides : configuration(); if (plugin.getConfiguration() == null) { return config; } else { <START> return Xpp3Dom.mergeXpp3Dom(config, (Xpp3Dom)plugin.getConfiguration()); <END> } }</code><technical_language>call getConfiguration() twice. Save result a variable if statement, variable in if/else</technical_language>

Target:
private Xpp3Dom getPluginConfig(Plugin plugin, Xpp3Dom overrides) { Xpp3Dom config = (overrides != null) ? overrides : configuration(); Xpp3Dom pluginConfig = (Xpp3Dom)plugin.getConfiguration(); if (pluginConfig != null) { config = Xpp3Dom.mergeXpp3Dom(config, pluginConfig); } return config; }
Source:
<code>public static void ensureWritableDir(Path directory) throws IOException { if (!Files.exists(directory)) { Files.createDirectories(directory); } if (!Files.isDirectory(directory)) { throw new IOException("Not a directory: " + directory); } if (!Files.isReadable(directory) || !Files.isWritable(directory)) { <START> throw new IOException("No read or write permissions: " + directory); <END> } }</code><technical_language>suggestion throw new IOException("Missing read write permissions: " + directory);</technical_language>

Target:
public static void ensureWritableDir(Path directory) throws IOException { if (!Files.exists(directory)) { Files.createDirectories(directory); } if (!Files.isDirectory(directory)) { throw new IOException("Not a directory: " + directory); } if (!Files.isReadable(directory) || !Files.isWritable(directory)) { throw new IOException("Missing read or write permissions: " + directory); } }
Source:
<code>private Response processResponse(Response directDebitResponse) { try { DirectDebitSearchResponse response = directDebitResponse.readEntity(DirectDebitSearchResponse.class); List<DirectDebitPaymentForSearch> paymentFromResponse = response <START> .getPayments() <END> .stream() .map(payment -> DirectDebitPaymentForSearch.valueOf( payment, publicApiUriGenerator.getPaymentURI(payment.getPaymentId()) )).collect(Collectors.toList()); HalRepresentation.HalRepresentationBuilder halRepresentation = HalRepresentation.builder() .addProperty("results", paymentFromResponse); return Response.ok().entity(paginationDecorator.decoratePagination(halRepresentation, response, PAYMENT_PATH).build().toString()).build(); } catch (ProcessingException ex) { throw new SearchPaymentsException(ex); } }</code><technical_language>catch connectorResponse.readEntity(DirectDebitSearchResponse.class) please</technical_language>

Target:
private Response processResponse(Response directDebitResponse) { DirectDebitSearchResponse response; try { response = directDebitResponse.readEntity(DirectDebitSearchResponse.class); } catch (ProcessingException ex) { throw new SearchPaymentsException(ex); } List<DirectDebitPaymentForSearch> paymentFromResponse = response .getPayments() .stream() .map(payment -> DirectDebitPaymentForSearch.valueOf( payment, publicApiUriGenerator.getPaymentURI(payment.getPaymentId()) )).collect(Collectors.toList()); HalRepresentation.HalRepresentationBuilder halRepresentation = HalRepresentation.builder() .addProperty("results", paymentFromResponse); return Response.ok().entity(paginationDecorator.decoratePagination(halRepresentation, response, PAYMENT_PATH).build().toString()).build(); }
Source:
<code>public static Entry deserializeEntry(byte[] data) { <START> ByteBuffer b = ByteBuffer.wrap(data); <END> int version = b.getInt(); int classNameLength = b.getInt(); byte[] classNameBytes = new byte[classNameLength]; b.get(classNameBytes); String className = new String(classNameBytes, StandardCharsets.UTF_8); byte[] encrypted = new byte[data.length - (8 + classNameLength)]; b.get(encrypted); return new Entry(version, className, encrypted); }</code><technical_language>CodePointIterator a choice here</technical_language>

Target:
public static Entry deserializeEntry(byte[] data) { ByteIterator bi = ByteIterator.ofBytes(data); int version = bi.getBE32(); int classNameLength = bi.getBE32(); String className = bi.drainToUtf8(classNameLength); byte[] encrypted = bi.drain(); return new Entry(version, className, encrypted); }
Source:
<code>public void shouldFormatAsDesigned() throws IOException { StringBuilder featureBuilder = new StringBuilder(); featureBuilder.append("# language: pt\n"); featureBuilder.append("Funcionalidade: formatar no Cucumber\n"); featureBuilder.append("Cenário: O Cucumber consegue formatar uma tabela incompleta.\n"); featureBuilder.append("Quando eu monto uma tabela como esta:\n"); featureBuilder.append("\t|nome|valor|\n"); featureBuilder.append("\t|a|b|\n"); featureBuilder.append("Então deve formatar corretamente.\n"); <START> String feature = featureBuilder.toString(); <END> List<String> lines = doFormatter(feature); assertEquals("Formatter produces unexpected quantity of lines. ", 8, lines.size()); assertEquals("# language: pt", lines.get(0)); assertEquals("Funcionalidade: formatar no Cucumber", lines.get(1)); assertEquals("", lines.get(2)); assertEquals(" Cenário: O Cucumber consegue formatar uma tabela incompleta.", lines.get(3)); assertEquals(" Quando eu monto uma tabela como esta:", lines.get(4)); assertEquals(" | nome | valor |", lines.get(5)); assertEquals(" | a | b |", lines.get(6)); assertEquals(" Então deve formatar corretamente.", lines.get(7)); }</code><technical_language>I understand problem is Portuguese specific. I right? If so, please write test in English, this is language is Gherkin's developers, more convenient work test in future</technical_language>

Target:
public void shouldFormatAsDesigned() throws IOException { StringBuilder featureBuilder = new StringBuilder(); featureBuilder.append("Feature: PrettyFormatter\n"); featureBuilder.append("Scenario: Formmat beautifully\n"); featureBuilder.append("When I have this table:\n"); featureBuilder.append("\t|name|value|\n"); featureBuilder.append("\t|a|b|\n"); featureBuilder.append("Then should formatt beautifully.\n"); String feature = featureBuilder.toString(); List<String> lines = doFormatter(feature); assertEquals("Formatter produces unexpected quantity of lines. ", 7, lines.size()); assertEquals("Feature: PrettyFormatter", lines.get(0)); assertEquals("", lines.get(1)); assertEquals(" Scenario: Formmat beautifully", lines.get(2)); assertEquals(" When I have this table:", lines.get(3)); assertEquals(" | name | value |", lines.get(4)); assertEquals(" | a | b |", lines.get(5)); assertEquals(" Then should formatt beautifully.", lines.get(6)); }
Source:
<code>private InputStream open() throws Exception { URLConnection conn; InputStream in; <START> if (client != null && !"jrt".equals(url.getProtocol())) { <END> TaggedData tag = client.connectTagged(url); conn = tag.getConnection(); in = tag.getInputStream(); } else { conn = url.openConnection(); conn.connect(); in = conn.getInputStream(); } lastModified = conn.getLastModified(); int length = conn.getContentLength(); if (length != -1) { size = length; } return in; }</code><technical_language>I instead suggest moving test constructor: java this.client = "jrt".equals(url.getProtocol()) ? null : client; test is done open call object hold a HttpClient reference use</technical_language>

Target:
private InputStream open() throws Exception { URLConnection conn; InputStream in; if (client != null) { TaggedData tag = client.connectTagged(url); conn = tag.getConnection(); in = tag.getInputStream(); } else { conn = url.openConnection(); conn.connect(); in = conn.getInputStream(); } lastModified = conn.getLastModified(); int length = conn.getContentLength(); if (length != -1) { size = length; } return in; }
Source:
<code>public void testSetGetXAttrCreateReplace() throws Exception { byte[] attributeValue = "one".getBytes(StandardCharsets.UTF_8); String attributeName = "user.someAttribute"; Path testFile = methodPath(); createEmptyFile(testFile, FsPermission.createImmutable(READ_WRITE_PERMISSIONS)); fs.setXAttr(testFile, attributeName, attributeValue, CREATE_FLAG); assertArrayEquals(attributeValue, fs.getXAttr(testFile, attributeName)); try { fs.setXAttr(testFile, attributeName, attributeValue, CREATE_FLAG); <START> fail("Creating an existing xAttr should fail"); <END> } catch (IOException ex) { assertExceptionContains("XAttr: " + attributeName + " already exists.", ex); } }</code><technical_language>"org.apache.hadoop.test.LambdaTestUtils.intercept" for exception check, in other files</technical_language>

Target:
public void testSetGetXAttrCreateReplace() throws Exception { byte[] attributeValue = "one".getBytes(StandardCharsets.UTF_8); String attributeName = "user.someAttribute"; Path testFile = methodPath(); createEmptyFile(testFile, FsPermission.createImmutable(READ_WRITE_PERMISSIONS)); fs.setXAttr(testFile, attributeName, attributeValue, CREATE_FLAG); assertArrayEquals(attributeValue, fs.getXAttr(testFile, attributeName)); intercept(IOException.class, () -> fs.setXAttr(testFile, attributeName, attributeValue, CREATE_FLAG)); }
Source:
<code>protected boolean handleSelectionExpending( int keyEventKeyCode, InputConnection ic, int globalSelectionStartPosition, int globalCursorPosition) { if (mArrowSelectionState && ic != null) { switch (keyEventKeyCode) { case KeyEvent.KEYCODE_DPAD_LEFT: <START> final String toLeft = ic.getTextBeforeCursor(8, 0).toString(); <END> if (toLeft.length() == 0) { ic.setSelection(globalSelectionStartPosition, globalCursorPosition); } else { ic.setSelection( globalSelectionStartPosition - Character.charCount( toLeft.codePointBefore(toLeft.length())), globalCursorPosition); } return true; case KeyEvent.KEYCODE_DPAD_RIGHT: final String toRight = ic.getTextAfterCursor(8, 0).toString(); if (toRight.length() == 0) { ic.setSelection(globalSelectionStartPosition, globalCursorPosition); } else { ic.setSelection( globalSelectionStartPosition, globalCursorPosition + Character.charCount(toRight.codePointAt(0))); } return true; default: mArrowSelectionState = false; } } return false; }</code><technical_language>8? Is this longest multi-codepoints? In case, extract a const? protected static final int MAX_MULTI_CODEPOINTS_COUNT = 8; 8</technical_language>

Target:
protected boolean handleSelectionExpending( int keyEventKeyCode, InputConnection ic, int globalSelectionStartPosition, int globalCursorPosition) { if (mArrowSelectionState && ic != null) { switch (keyEventKeyCode) { case KeyEvent.KEYCODE_DPAD_LEFT: final String toLeft = ic.getTextBeforeCursor(MAX_CHARS_PER_CODEPOINT, 0).toString(); if (toLeft.length() == 0) { ic.setSelection(globalSelectionStartPosition, globalCursorPosition); } else { ic.setSelection( globalSelectionStartPosition - Character.charCount( toLeft.codePointBefore(toLeft.length())), globalCursorPosition); } return true; case KeyEvent.KEYCODE_DPAD_RIGHT: final String toRight = ic.getTextAfterCursor(MAX_CHARS_PER_CODEPOINT, 0).toString(); if (toRight.length() == 0) { ic.setSelection(globalSelectionStartPosition, globalCursorPosition); } else { ic.setSelection( globalSelectionStartPosition, globalCursorPosition + Character.charCount(toRight.codePointAt(0))); } return true; default: mArrowSelectionState = false; } } return false; }
Source:
<code>public void toJson(JsonNodeFactory factory, ObjectNode node) { if (query != null) { node.set("query", query.toJson()); } if (projection != null) { node.set("projection", projection.toJson()); } if (sort != null) { node.set("sort", sort.toJson()); } if (from != null && to != null) { ArrayNode arr = factory.arrayNode(); arr.add(from); if(to>0) <START> arr.add(to); <END> node.set("range", arr); } }</code><technical_language>else arr.addNull() range array element</technical_language>

Target:
public void toJson(JsonNodeFactory factory, ObjectNode node) { if (query != null) { node.set("query", query.toJson()); } if (projection != null) { node.set("projection", projection.toJson()); } if (sort != null) { node.set("sort", sort.toJson()); } if (from != null) { ArrayNode arr = factory.arrayNode(); arr.add(from); if( to != null) arr.add(to); else arr.addNull(); node.set("range", arr); } }
Source:
<code>public InputStream getInputStream(long lobId, long byteCount) throws IOException { MVStore.TxCounter txCounter = initialize(); try { Object[] value = lobMap.get(lobId); if (value == null) { throw DbException.get(ErrorCode.LOB_CLOSED_ON_TIMEOUT_1, "" + lobId); } byte[] streamStoreId = (byte[]) value[0]; InputStream inputStream = streamStore.get(streamStoreId); <START> return new FilterInputStream(inputStream) { @Override public int read(byte[] b, int off, int len) throws IOException { <END> MVStore.TxCounter txCounter = initialize(); try { return super.read(b, off, len); } finally { deregisterVersionUsage(txCounter); } } }; } finally { deregisterVersionUsage(txCounter); } }</code><technical_language>read(byte[]), read(), skip()? JDBC, more, JDBC layer skip() itself</technical_language>

Target:
public InputStream getInputStream(long lobId, long byteCount) throws IOException { MVStore.TxCounter txCounter = mvStore.registerVersionUsage(); try { Object[] value = lobMap.get(lobId); if (value == null) { throw DbException.get(ErrorCode.LOB_CLOSED_ON_TIMEOUT_1, "" + lobId); } byte[] streamStoreId = (byte[]) value[0]; InputStream inputStream = streamStore.get(streamStoreId); return new FilterInputStream(inputStream) { @Override public int read(byte[] b, int off, int len) throws IOException { MVStore.TxCounter txCounter = mvStore.registerVersionUsage(); try { return super.read(b, off, len); } finally { mvStore.deregisterVersionUsage(txCounter); } } @Override public int read() throws IOException { MVStore.TxCounter txCounter = mvStore.registerVersionUsage(); try { return super.read(); } finally { mvStore.deregisterVersionUsage(txCounter); } } }; } finally { mvStore.deregisterVersionUsage(txCounter); } }