auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void write(Text key, Text value) throws IOException { String solrFieldName; SolrInputDocument document = new SolrInputDocument(); Schema inputSchema = GSON.fromJson(key.toString(), SCHEMA_TYPE); StructuredRecord structuredRecord = StructuredRecordStringConverter.fromJsonString(value.toString(), inputSchema); for (Schema.Field field : structuredRecord.getSchema().getFields()) { solrFieldName = field.getName(); if (config.getOutputFieldMap().containsKey(solrFieldName)) { document.addField(config.getOutputFieldMap().get(solrFieldName), structuredRecord.get(solrFieldName)); } else { document.addField(solrFieldName, structuredRecord.get(solrFieldName)); } } documentList.add(document); try { <START> if (documentList.size() == Integer.parseInt(conf.get(BATCH_SIZE))) { <END> solrClient.add(documentList); solrClient.commit(); documentList.clear(); } } catch (SolrServerException e) { throw new IllegalArgumentException("Exception while indexing the documents to Solr. For more details, Please " + "check the logs.", e); } }</code><technical_language>get this batch size in constructor store in a variable. efficient do this for write. this batch size initial size for array list creating</technical_language>

Target:
public void write(Text key, Text value) throws IOException { String solrFieldName; SolrInputDocument document = new SolrInputDocument(); Schema inputSchema = GSON.fromJson(key.toString(), SCHEMA_TYPE); StructuredRecord structuredRecord = StructuredRecordStringConverter.fromJsonString(value.toString(), inputSchema); for (Schema.Field field : structuredRecord.getSchema().getFields()) { solrFieldName = field.getName(); if (outputFieldMap.containsKey(solrFieldName)) { document.addField(outputFieldMap.get(solrFieldName), structuredRecord.get(solrFieldName)); } else { document.addField(solrFieldName, structuredRecord.get(solrFieldName)); } } documentList.add(document); try { if (documentList.size() == batchSize) { solrClient.add(documentList); solrClient.commit(); documentList.clear(); } } catch (SolrServerException e) { throw new IllegalArgumentException("Exception while indexing the documents to Solr. For more details, Please " + "check the logs.", e); } }
Source:
<code>public void processEvent(final CloudTrailEvent event) { String roleName = getRoleName(event); String policy = policyProvider.getPolicy(roleName, getRegion(event), getAccountId(event)); String policyTemplate = policyTemplatesProvider.getPolicyTemplate(roleName); JsonNode policyJson = null; JsonNode templatePolicyJson = null; try { policyJson = objectMapper.readTree(policy); templatePolicyJson = objectMapper.readTree(policyTemplate); } catch (IOException e) { <START> LOG.warn("Could not read policy tree! For policy: and policy template: {}", policy, policyTemplate); <END> } if (policyJson != null && !policyJson.equals(templatePolicyJson)) { violationSink.put( new ViolationBuilder( format("Role: %s cannot be modified", roleName)).withEventId(getCloudTrailEventId(event)) .withRegion(getCloudTrailEventRegion(event)) .withAccountId( getCloudTrailEventAccountId( event)) .build()); } }</code><technical_language>return</technical_language>

Target:
public void processEvent(final CloudTrailEvent event) { String roleName = getRoleName(event); String policy = policyProvider.getPolicy(roleName, getRegion(event), getAccountId(event)); String policyTemplate = policyTemplatesProvider.getPolicyTemplate(roleName); JsonNode policyJson = null; JsonNode templatePolicyJson = null; try { policyJson = objectMapper.readTree(policy); templatePolicyJson = objectMapper.readTree(policyTemplate); } catch (IOException e) { LOG.warn("Could not read policy tree! For policy: and policy template: {}", policy, policyTemplate); return; } if (!policyJson.equals(templatePolicyJson)) { violationSink.put( new ViolationBuilder( format("Role: %s must not be modified", roleName)).withEventId(getCloudTrailEventId(event)) .withRegion(getCloudTrailEventRegion(event)) .withAccountId( getCloudTrailEventAccountId( event)) .build()); } }
Source:
<code>public void testSaveMany() { <START> await(store.saveMany(Flowable.fromArray(new AbstractMap.SimpleEntry(1, "adios"), <END> new AbstractMap.SimpleEntry(2, "agur"), new AbstractMap.SimpleEntry(3, "ciao")))); assertEquals("adios", await(store.get(1))); assertEquals("agur", await(store.get(2))); assertEquals("ciao", await(store.get(3))); }</code><technical_language>saveMany() broken. this test fails: public void testSaveMany2() { Map<Integer, String> map = new HashMap<>(); for (int i = 0; i < 100; ++i) { map.put(i, UUID.randomUUID().toString()); } await(store.saveMany(Flowable.fromIterable(map.entrySet()))); for (int i = 99; i >= 0; --i) { assertEquals(map.get(i), await(store.get(i))); } }</technical_language>

Target:
public void testSaveMany() { Publisher<WriteResult<Integer>> publisher = store.saveMany(Flowable.fromArray(new AbstractMap.SimpleEntry(1, "adios"), new AbstractMap.SimpleEntry(2, "agur"), new AbstractMap.SimpleEntry(3, "ciao"))); TestSubscriber<WriteResult<Integer>> testSubscriber = new TestSubscriber<>(); publisher.subscribe(testSubscriber); testSubscriber.awaitCount(3); assertEquals("adios", await(store.get(1))); assertEquals("agur", await(store.get(2))); assertEquals("ciao", await(store.get(3))); }
Source:
<code>public PostDonationCounselling updatePostDonationCounselling(long id, CounsellingStatus counsellingStatus, Date counsellingDate, String notes) { PostDonationCounselling postDonationCounselling = postDonationCounsellingRepository.findById(id); if (postDonationCounselling == null) { throw new IllegalArgumentException("Post donation counselling not found for id: " + id); } if (postDonationCounselling.getCounsellingStatus() == null) { <START> LOGGER.info("is null" + postDonationCounselling.getCounsellingStatus()); <END> } else { deletePostDonationCounselling(id); LOGGER.info("Deleted postDonationCounselling "); postDonationCounselling = createPostDonationCounsellingForDonation(postDonationCounselling.getDonation()); LOGGER.info("Created new postDonationCounselling "); } postDonationCounselling.setFlaggedForCounselling(false); postDonationCounselling.setCounsellingStatus(counsellingStatus); postDonationCounselling.setCounsellingDate(counsellingDate); postDonationCounselling.getDonation().setNotes(notes); postDonationCounselling.setLastUpdated(new Date()); postDonationCounselling.setLastUpdatedBy(utilController.getCurrentUser()); postDonationCounselling.setCreatedBy(utilController.getCurrentUser()); postDonationCounselling.setIsDeleted(false); return postDonationCounsellingRepository.update(postDonationCounselling); }</code><technical_language>this need logged? If so, please log message more useful</technical_language>

Target:
public PostDonationCounselling updatePostDonationCounselling(long id, CounsellingStatus counsellingStatus, Date counsellingDate, String notes) { PostDonationCounselling postDonationCounselling = postDonationCounsellingRepository.findById(id); if (postDonationCounselling == null) { throw new IllegalArgumentException("Post donation counselling not found for id: " + id); } postDonationCounselling.setFlaggedForCounselling(Boolean.FALSE); postDonationCounselling.setCounsellingStatus(counsellingStatus); postDonationCounselling.setCounsellingDate(counsellingDate); postDonationCounselling.getDonation().setNotes(notes); postDonationCounselling.setLastUpdated(dateGeneratorService.generateDate()); postDonationCounselling.setLastUpdatedBy(utilController.getCurrentUser()); postDonationCounselling.setIsDeleted(Boolean.FALSE); return postDonationCounsellingRepository.update(postDonationCounselling); }
Source:
<code>public void convertAutoIncrementToSequence(Session session, Schema schema, int id, boolean temporary) { if (autoIncrementOptions == null) { DbException.throwInternalError(); } if ("IDENTITY".equals(originalSQL)) { originalSQL = "BIGINT"; } else if ("SERIAL".equals(originalSQL)) { originalSQL = "INT"; } String sequenceName; do { ValueUuid uuid = ValueUuid.getNewRandom(); String s = uuid.getString(); s = StringUtils.toUpperEnglish(s.replace('-', '_')); sequenceName = "SYSTEM_SEQUENCE_" + s; } while (schema.findSequence(sequenceName) != null); Sequence seq = new Sequence(session, schema, id, sequenceName, autoIncrementOptions, true); seq.setTemporary(temporary); session.getDatabase().addSchemaObject(session, seq); setAutoIncrementOptions(null); <START> Mode mode = session.getDatabase().getMode(); <END> SequenceValue seqValue = new SequenceValue(seq); setDefaultExpression(session, seqValue); setSequence(seq); }</code><technical_language>leftover</technical_language>

Target:
public void convertAutoIncrementToSequence(Session session, Schema schema, int id, boolean temporary) { if (autoIncrementOptions == null) { DbException.throwInternalError(); } if ("IDENTITY".equals(originalSQL)) { originalSQL = "BIGINT"; } else if ("SERIAL".equals(originalSQL)) { originalSQL = "INT"; } String sequenceName; do { ValueUuid uuid = ValueUuid.getNewRandom(); String s = uuid.getString(); s = StringUtils.toUpperEnglish(s.replace('-', '_')); sequenceName = "SYSTEM_SEQUENCE_" + s; } while (schema.findSequence(sequenceName) != null); Sequence seq = new Sequence(session, schema, id, sequenceName, autoIncrementOptions, true); seq.setTemporary(temporary); session.getDatabase().addSchemaObject(session, seq); setAutoIncrementOptions(null); SequenceValue seqValue = new SequenceValue(seq); setDefaultExpression(session, seqValue); setSequence(seq); }
Source:
<code>public BooleanWrapper mapOnNodeUrlSet(Set<String> nodeUrls, Predicate<RMNode> operation, String operationName) { boolean result = true; for (String url : nodeUrls) { try { RMNode rmnode = getNodeByUrlIncludingDeployingNodes(url); if (rmnode == null) { logger.warn("Cannot " + operationName + ", unknown node: " + url); result = false; continue; } result &= operation.apply(rmnode); } catch (Exception e) { <START> logger.error("Exception during mapOnNodeUrlSet.", e); <END> result = false; } } return new BooleanWrapper(result); }</code><technical_language>suggestion logger.error("Error " + operationName + " node " + url, e);</technical_language>

Target:
public BooleanWrapper mapOnNodeUrlSet(Set<String> nodeUrls, Predicate<RMNode> operation, String operationName) { boolean result = true; for (String url : nodeUrls) { try { RMNode rmnode = getNodeByUrlIncludingDeployingNodes(url); if (rmnode == null) { logger.warn("Cannot " + operationName + ", unknown node: " + url); result = false; continue; } result &= operation.apply(rmnode); } catch (Exception e) { logger.error("Error during " + operationName + " on node " + url, e); result = false; } } return new BooleanWrapper(result); }
Source:
<code>public void work() { openUserSession(); AutomationService as = Framework.getLocalService(AutomationService.class); try (OperationContext oc = new OperationContext(session)) { oc.push("filename", StringUtils.isNotBlank(this.filename) ? this.filename : this.id); oc.setInput(blobList); Blob blob = (Blob) as.run(oc, CreateZip.ID); List<Blob> blobs = new ArrayList<Blob>(); blobs.add(blob); updateAndCompleteStoreEntry(blobs); <START> } catch (Exception e) { <END> TransientStore ts = getTransientStore(); ts.putParameter(key, DownloadService.ERROR, e); throw new NuxeoException("Exception while zipping blob list", e); } }</code><technical_language>catch Exception, a more specific exception</technical_language>

Target:
public void work() { openUserSession(); AutomationService as = Framework.getLocalService(AutomationService.class); try (OperationContext oc = new OperationContext(session)) { Blob blob; if (blobList.size() == 1) { blob = blobList.get(0); } else { oc.push("filename", StringUtils.isNotBlank(this.filename) ? this.filename : this.id); oc.setInput(new BlobList(blobList)); blob = (Blob) as.run(oc, CreateZip.ID); } updateAndCompleteStoreEntry(Collections.singletonList(blob)); } catch (OperationException e) { TransientStore ts = getTransientStore(); ts.putParameter(key, DownloadService.TRANSIENT_STORE_PARAM_ERROR, e.getMessage()); throw new NuxeoException("Exception while zipping blob list", e); } }
Source:
<code>public boolean equals(Object o) { <START> if (this == o) return true; <END> if (o == null || getClass() != o.getClass()) return false; BackgroundRepository that = (BackgroundRepository) o; return delegatedRepository != null ? delegatedRepository.equals(that.delegatedRepository) : that.delegatedRepository == null; }</code><technical_language>forget symbols, please EqualsBuilder HashcodeBuilder</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } BackgroundRepository that = (BackgroundRepository) o; EqualsBuilder builder = new EqualsBuilder(); builder.append(delegatedRepository, that.delegatedRepository); return builder.isEquals(); }
Source:
<code>public void setUpFuseki() throws Exception { <START> final String fusekiBase = "http://localhost:" + FUSEKI_PORT + "/test"; <END> final FcrepoClient client = new FcrepoClient(null, null, null, true); final FcrepoResponse res = client.post( URI.create("http://localhost:" + FCREPO_PORT + "/fcrepo/rest"), ObjectHelper.loadResourceAsStream("container.ttl"), "text/turtle"); fullPath = res.getLocation().toString(); logger.info("Starting EmbeddedFusekiServer on port {}", FUSEKI_PORT); server = EmbeddedFusekiServer.mem(Integer.parseInt(FUSEKI_PORT, 10), "/test") ; server.start(); }</code><technical_language>fusekiBase used</technical_language>

Target:
public void setUpFuseki() throws Exception { final FcrepoClient client = new FcrepoClient(null, null, null, true); final FcrepoResponse res = client.post( URI.create("http://localhost:" + FCREPO_PORT + "/fcrepo/rest"), ObjectHelper.loadResourceAsStream("container.ttl"), "text/turtle"); fullPath = res.getLocation().toString(); logger.info("Starting EmbeddedFusekiServer on port {}", FUSEKI_PORT); server = EmbeddedFusekiServer.mem(Integer.parseInt(FUSEKI_PORT, 10), "/test") ; server.start(); }
Source:
<code>public void testWeakCounter() throws Exception { String url = String.format("http://localhost:%d/rest/v2/counters/weak", restServer().getPort()); <START> ContentResponse response = client.newRequest(url) <END> .method(HttpMethod.DELETE).send(); ResponseAssertion.assertThat(response).isOk(); response = client.newRequest(url) .method(HttpMethod.GET).send(); ResponseAssertion.assertThat(response).isOk(); assertEquals(0, Long.parseLong(response.getContentAsString())); response = client.newRequest(url) .method(HttpMethod.POST).content(new StringContentProvider("10")).send(); ResponseAssertion.assertThat(response).isOk(); for(int i = 0; i < 10; i++) { response = client.newRequest(url) .method(HttpMethod.GET).send(); ResponseAssertion.assertThat(response).isOk(); long value = Long.parseLong(response.getContentAsString()); if (value == 10) return; assertEquals(0, value); Thread.sleep(100); } }</code><technical_language>if sense test "reset" beginning. if works is change in counter's value</technical_language>

Target:
public void testWeakCounter() throws Exception { String url = String.format("http://localhost:%d/rest/v2/counters/weak", restServer().getPort()); ContentResponse response = client.newRequest(url) .method(HttpMethod.POST).content(new StringContentProvider("10")).send(); ResponseAssertion.assertThat(response).isOk(); eventually(() -> { ContentResponse r = client.newRequest(url) .method(HttpMethod.GET).send(); ResponseAssertion.assertThat(r).isOk(); long value = Long.parseLong(r.getContentAsString()); return value == 10; }); response = client.newRequest(url) .method(HttpMethod.DELETE).send(); ResponseAssertion.assertThat(response).isOk(); response = client.newRequest(url) .method(HttpMethod.GET).send(); ResponseAssertion.assertThat(response).isOk(); assertEquals(0, Long.parseLong(response.getContentAsString())); }
Source:
<code><START> public String toString() { <END> return "CopyRatioCallingMetadata{" + "sampleName='" + sampleName + '\'' + ", sampleIndex=" + sampleIndex + ", sampleSexGenotypeData=" + sampleSexGenotypeData + ", sampleCoverageDepth=" + sampleCoverageDepth + ", emissionCalculationStrategy=" + emissionCalculationStrategy + '}'; }</code><technical_language>String.format("CopyRatioCallingMetadata{sampleName=%s, sampleIndex=%d, sampleSexGenotypeData=%s, sampleCoverageDepth=%d, emissionCalculationStrategy=%s", sampleName, sampleIndex, sampleSexGenotypeData, sampleCoverageDepth, emissionCalculationStrategy)</technical_language>

Target:
public String toString() { return "CopyRatioCallingMetadata{" + "sampleName='" + sampleName + '\'' + ", sampleSexGenotypeData=" + sampleSexGenotypeData + ", sampleCoverageDepth=" + sampleCoverageDepth + ", emissionCalculationStrategy=" + emissionCalculationStrategy + ", sampleAverageMappingErrorProbability=" + sampleAverageMappingErrorProbability + '}'; }
Source:
<code>public void testImporterDeploymentChanges() throws Exception { System.out.println("Removing and re-adding importers should cause them to restart"); ImporterConnector testConnector = new ImporterConnector("localhost", 7001, '\t'); testConnector.tryPush(5); updateDeploymentFile(false, false); Thread.sleep(1000); try { testConnector.tryPush(5); fail("Importer is still running even though it is no longer configured"); } catch (IOException expected) { } updateDeploymentFile(true, false); <START> Thread.sleep(1000); <END> testConnector.tryPush(5); }</code><technical_language>sleep here</technical_language>

Target:
public void testImporterDeploymentChanges() throws Exception { System.out.println("Removing and re-adding importers should cause them to restart"); ImporterConnector testConnector = new ImporterConnector(SERVER, SOCKET_IMPORTER_PORT, DELIMITER); testConnector.tryPush(5); updateDeploymentFile(false, false); try { testConnector.tryPush(5); fail("Importer is still running even though it is no longer configured"); } catch (IOException expected) { } updateDeploymentFile(true, false); testConnector.tryPush(5); }
Source:
<code>private static PrepareCallback preparePaxos(Commit toPrepare, ReplicaList replicas, int requiredParticipants, ConsistencyLevel consistencyForPaxos, long queryStartNanoTime) throws WriteTimeoutException { PrepareCallback callback = new PrepareCallback(toPrepare.update.partitionKey(), toPrepare.update.metadata(), requiredParticipants, consistencyForPaxos, queryStartNanoTime); MessageOut<Commit> message = new MessageOut<Commit>(MessagingService.Verb.PAXOS_PREPARE, toPrepare, Commit.serializer); <START> for (InetAddressAndPort target : replicas.asEndpoints()) <END> { if (canDoLocalRequest(target)) { StageManager.getStage(MessagingService.verbStages.get(MessagingService.Verb.PAXOS_PREPARE)).execute(new Runnable() { public void run() { try { MessageIn<PrepareResponse> message = MessageIn.create(FBUtilities.getBroadcastAddressAndPort(), PrepareVerbHandler.doPrepare(toPrepare), Collections.emptyMap(), MessagingService.Verb.INTERNAL_RESPONSE, MessagingService.current_version); callback.response(message); } catch (Exception ex) { logger.error("Failed paxos prepare locally", ex); } } }); } else { MessagingService.instance().sendRR(message, target, callback); } } callback.await(); return callback; }</code><technical_language>This is a candidate for manually unwrapping in loop</technical_language>

Target:
private static PrepareCallback preparePaxos(Commit toPrepare, ReplicaList replicas, int requiredParticipants, ConsistencyLevel consistencyForPaxos, long queryStartNanoTime) throws WriteTimeoutException { PrepareCallback callback = new PrepareCallback(toPrepare.update.partitionKey(), toPrepare.update.metadata(), requiredParticipants, consistencyForPaxos, queryStartNanoTime); MessageOut<Commit> message = new MessageOut<Commit>(MessagingService.Verb.PAXOS_PREPARE, toPrepare, Commit.serializer); for (Replica replica: replicas) { if (canDoLocalRequest(replica.getEndpoint())) { StageManager.getStage(MessagingService.verbStages.get(MessagingService.Verb.PAXOS_PREPARE)).execute(new Runnable() { public void run() { try { MessageIn<PrepareResponse> message = MessageIn.create(FBUtilities.getBroadcastAddressAndPort(), PrepareVerbHandler.doPrepare(toPrepare), Collections.emptyMap(), MessagingService.Verb.INTERNAL_RESPONSE, MessagingService.current_version); callback.response(message); } catch (Exception ex) { logger.error("Failed paxos prepare locally", ex); } } }); } else { MessagingService.instance().sendRR(message, replica.getEndpoint(), callback); } } callback.await(); return callback; }
Source:
<code>public void setUp() { super.setUp(); <START> try { <END> calculation = calcFactory.create(); } catch (Throwable ex) { Logger.getLogger(CalculateInstallmentsTest.class.getName()).log(Level.SEVERE, null, ex); } }</code><technical_language>Is this try...catch necessary</technical_language>

Target:
public void setUp() { super.setUp(); calculation = new Calculation(); }
Source:
<code>public void delete() { <START> String sharePath = getPathOnShare(); <END> try { if (isFile()) { logger.debug("deleting file {}", sharePath); getShare().rm(sharePath); } else { logger.debug("deleting directory {}", sharePath); getShare().rmdir(sharePath, false); } } catch (TransportException e) { throw new RuntimeIOException(format("Cannot delete %s: %s", sharePath, e.toString()), e); } catch (SMBApiException e) { throw new RuntimeIOException(format("Cannot delete %s: %s", sharePath, e.toString()), e); } }</code><technical_language>extract a private method delete(boolean recursive) reuse deleteRecursive method below. implementation is similar to</technical_language>

Target:
public void delete() { delete(false); }
Source:
<code>public static TailsResponse getAllTails(RuntimeLayout runtimeLayout) { Set<String> segmentsHeadNodes = getChainHeadFromAllSegments(runtimeLayout.getLayout()); long[] globalTail = {Address.NON_EXIST}; final Map<UUID, Long> streamTails = new HashMap<>(); <START> segmentsHeadNodes.stream() <END> .map(node -> runtimeLayout .getLogUnitClient(node) .getAllTails()) .map(CFUtils::getUninterruptibly) .forEach(resp -> { checkArgument(resp.getEpoch() == runtimeLayout.getLayout().getEpoch()); globalTail[0] = Long.max(resp.getLogTail(), globalTail[0]); resp.getStreamTails().forEach((k, v) -> streamTails.merge(k, v, Long::max)); }); log.debug("getAllTails: nodes selected stream tails {}", segmentsHeadNodes, streamTails); return new TailsResponse(runtimeLayout.getLayout().getEpoch(), globalTail[0], streamTails); }</code><technical_language>AtomicLong is cleaner array</technical_language>

Target:
public static TailsResponse getAllTails(RuntimeLayout runtimeLayout) { Set<String> segmentsHeadNodes = getChainHeadFromAllSegments(runtimeLayout.getLayout()); AtomicLong globalTail = new AtomicLong(Address.NON_EXIST); final Map<UUID, Long> streamTails = new HashMap<>(); List<CompletableFuture<TailsResponse>> cfs = segmentsHeadNodes.stream() .map(node -> runtimeLayout.getLogUnitClient(node).getAllTails()) .collect(Collectors.toList()); cfs.stream() .map(CFUtils::getUninterruptibly) .forEach( resp -> { epochCheck(resp.getEpoch(), runtimeLayout.getLayout().getEpoch()); globalTail.set(Long.max(resp.getLogTail(), globalTail.get())); resp.getStreamTails().forEach((k, v) -> streamTails.merge(k, v, Long::max)); }); log.debug("getAllTails: nodes selected stream tails {}", segmentsHeadNodes, streamTails); return new TailsResponse(runtimeLayout.getLayout().getEpoch(), globalTail.get(), streamTails); }
Source:
<code><START> public synchronized Boolean addEventListener(final TimeyEventListener timeyEventListener) { <END> this.listener.add(timeyEventListener); return Boolean.TRUE; }</code><technical_language>Warum Boolean und nicht boolean</technical_language>

Target:
public synchronized boolean addEventListener(final TimeyEventListener timeyEventListener) { boolean result = false; try { this.listener.add(timeyEventListener); result = true; } catch (final Exception e) { } return result; }
Source:
<code>public void read( PropertyRecord record, PageCursor cursor, RecordLoad mode, int recordSize ) throws IOException { int offset = cursor.getOffset(); byte headerByte = cursor.getByte(); boolean inUse = isInUse( headerByte ); if ( mode.shouldLoad( inUse ) ) { int blockCount = headerByte >>> 4; long recordId = record.getId(); record.initialize( inUse, toAbsolute( Reference.decode( cursor ), recordId ), toAbsolute( Reference.decode( cursor ), recordId ) ); <START> if ( (blockCount > record.getBlockCapacity()) || (RECORD_SIZE - (cursor.getOffset() - offset) < blockCount * Long.BYTES) ) <END> { cursor.setCursorException( "PropertyRecord claims to contain more blocks than can fit in a record" ); return; } while ( blockCount-- > 0 ) { record.addLoadedBlock( cursor.getLong() ); } } }</code><technical_language>please touch formats, do do</technical_language>

Target:
public void read( PropertyRecord record, PageCursor cursor, RecordLoad mode, int recordSize ) { int offset = cursor.getOffset(); byte headerByte = cursor.getByte(); boolean inUse = isInUse( headerByte ); if ( mode.shouldLoad( inUse ) ) { int blockCount = headerByte >>> 4; long recordId = record.getId(); record.initialize( inUse, toAbsolute( Reference.decode( cursor ), recordId ), toAbsolute( Reference.decode( cursor ), recordId ) ); if ( (blockCount > record.getBlockCapacity()) | (RECORD_SIZE - (cursor.getOffset() - offset) < blockCount * Long.BYTES) ) { cursor.setCursorException( "PropertyRecord claims to contain more blocks than can fit in a record" ); return; } while ( blockCount-- > 0 ) { record.addLoadedBlock( cursor.getLong() ); } } }
Source:
<code>public String getText() { if (this.textElements.size() == 0) { return ""; } StringBuilder sb = new StringBuilder(); for (TextElement te: this.textElements) { sb.append(te.getText()); } <START> return Normalizer.normalize(sb.toString(), Normalizer.Form.NFKD); <END> }</code><technical_language>TextChunk.getText is method called emitting a table, IMO place normalize text</technical_language>

Target:
public String getText() { if (this.textElements.size() == 0) { return ""; } StringBuilder sb = new StringBuilder(); for (TextElement te: this.textElements) { sb.append(te.getText()); } return Normalizer.normalize(sb.toString(), Normalizer.Form.NFKC).trim(); }
Source:
<code>private int getGeneratedJSONObjectsCount(int amountOfConfigs) { List<Config> simpleConfigs = new ArrayList<>(); for(int i = 0; i < amountOfConfigs; i++) { Config simpleConfig = new Config(); simpleConfig.setName("simpleConfiguration" + Integer.toString(i)); simpleConfigs.add(simpleConfig); } when(configService.getConfigs()).thenReturn(simpleConfigs); openMRSTaskDataProviderBuilder.setOpenMRSConfigService(configService); VelocityEngineFactoryBean vefb = new VelocityEngineFactoryBean(); Map<String, Object> velocityPropertiesMap = new HashMap<String, Object>(); velocityPropertiesMap.put("resource.loader", "class"); velocityPropertiesMap.put("class.resource.loader.class", "org.motechproject.openmrs19.tasks.VelocityResourceLoader"); vefb.setVelocityPropertiesMap(velocityPropertiesMap); VelocityEngine velocityEngine = null; try { <START> velocityEngine = vefb.createVelocityEngine(); <END> } catch (IOException e) { e.printStackTrace(); } assertNotNull(velocityEngine); openMRSTaskDataProviderBuilder.setVelocityEngine(velocityEngine); String generatedJSON = openMRSTaskDataProviderBuilder.generateDataProvider(); JSONObject jsonResult = new JSONObject(generatedJSON); JSONArray objects = jsonResult.getJSONArray("objects"); return objects.length(); }</code><technical_language>Remove this try block simply add "throws" clause methods</technical_language>

Target:
private int getGeneratedJSONObjectsCount(int amountOfConfigs) throws IOException { List<Config> simpleConfigs = new ArrayList<>(); for(int i = 0; i < amountOfConfigs; i++) { Config simpleConfig = new Config(); simpleConfig.setName("simpleConfiguration" + Integer.toString(i)); simpleConfigs.add(simpleConfig); } when(configService.getConfigs()).thenReturn(simpleConfigs); openMRSTaskDataProviderBuilder.setOpenMRSConfigService(configService); VelocityEngineFactoryBean vefb = new VelocityEngineFactoryBean(); Map<String, Object> velocityPropertiesMap = new HashMap<String, Object>(); velocityPropertiesMap.put("resource.loader", "class"); velocityPropertiesMap.put("class.resource.loader.class", "org.motechproject.openmrs19.tasks.VelocityResourceLoader"); vefb.setVelocityPropertiesMap(velocityPropertiesMap); VelocityEngine velocityEngine = vefb.createVelocityEngine(); assertNotNull(velocityEngine); openMRSTaskDataProviderBuilder.setVelocityEngine(velocityEngine); String generatedJSON = openMRSTaskDataProviderBuilder.generateDataProvider(); JSONObject jsonResult = new JSONObject(generatedJSON); JSONArray objects = jsonResult.getJSONArray("objects"); return objects.length(); }
Source:
<code>public static void output(SpatialPartitioningState state, BlockBuilder out) { if (state.getCount() == 0) { <START> throw new PrestoException(INVALID_SPATIAL_PARTITIONING, "No rows supplied to spatial partition."); <END> } List<Rectangle> samples = state.getSamples(); int partitionCount = state.getPartitionCount(); int maxItemsPerNode = (samples.size() + partitionCount - 1) / partitionCount; Rectangle envelope = state.getExtent(); Rectangle paddedExtent = new Rectangle(envelope.getXMin(), envelope.getYMin(), Math.nextUp(envelope.getXMax()), Math.nextUp(envelope.getYMax())); VARCHAR.writeString(out, KdbTreeUtils.toJson(buildKdbTree(maxItemsPerNode, paddedExtent, samples))); }</code><technical_language>@jagill I realized this error code means provided spatial partitioning is valid. Hence, here. else? For example, INVALID_FUNCTION_ARGUMENT</technical_language>

Target:
public static void output(SpatialPartitioningState state, BlockBuilder out) { if (state.getCount() == 0) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "No rows supplied to spatial partition."); } List<Rectangle> samples = state.getSamples(); int partitionCount = state.getPartitionCount(); int maxItemsPerNode = (samples.size() + partitionCount - 1) / partitionCount; Rectangle envelope = state.getExtent(); Rectangle paddedExtent = new Rectangle(envelope.getXMin(), envelope.getYMin(), Math.nextUp(envelope.getXMax()), Math.nextUp(envelope.getYMax())); VARCHAR.writeString(out, KdbTreeUtils.toJson(buildKdbTree(maxItemsPerNode, paddedExtent, samples))); }
Source:
<code>public void returnedRealmResultsOfModelIsNotNull() { <START> RealmResults<AllTypesRealmModel> alltypes = looperThread.realm.where(AllTypesRealmModel.class).findAll(); <END> alltypes.addChangeListener(new RealmChangeListener<RealmResults<AllTypesRealmModel>>() { @Override public void onChange(RealmResults<AllTypesRealmModel> result) { assertEquals("data 1", result.first().columnString); looperThread.testComplete(); } }); looperThread.realm.beginTransaction(); AllTypesRealmModel model = looperThread.realm.createObject(AllTypesRealmModel.class); model.columnString = "data 1"; looperThread.realm.commitTransaction(); }</code><technical_language>refactor looperThread.realm variable: Realm realm = looperThread.realm; ... tests easier read</technical_language>

Target:
public void returnedRealmResultsOfModelIsNotNull() { Realm realm = looperThread.realm; RealmResults<AllTypesRealmModel> alltypes = realm.where(AllTypesRealmModel.class).findAll(); alltypes.addChangeListener(new RealmChangeListener<RealmResults<AllTypesRealmModel>>() { @Override public void onChange(RealmResults<AllTypesRealmModel> result) { assertEquals("data 1", result.first().columnString); looperThread.testComplete(); } }); realm.beginTransaction(); AllTypesRealmModel model = realm.createObject(AllTypesRealmModel.class); model.columnString = "data 1"; realm.commitTransaction(); }
Source:
<code>private void setSelectionFromEditor(IWorkbenchPart part, ISelection selection) { if (part instanceof IEditorPart) { IJavaElement element= null; if (selection instanceof IStructuredSelection) { Object obj= getSingleElementFromSelection(selection); if (obj instanceof IJavaElement) element= (IJavaElement)obj; } IEditorInput ei; if (part instanceof AbstractMultiEditor) ei= ((AbstractMultiEditor)part).getActiveEditor().getEditorInput(); else ei= ((IEditorPart)part).getEditorInput(); if (selection instanceof ITextSelection) { int offset= ((ITextSelection)selection).getOffset(); element= getElementAt(ei, offset); } if (element != null) { adjustInputAndSetSelection(element); return; } if (ei instanceof IFileEditorInput) { IFile file= ((IFileEditorInput)ei).getFile(); IJavaElement je= file.getAdapter(IJavaElement.class); IContainer container= null; if (je == null) { container= ((IFileEditorInput)ei).getFile().getParent(); if (container != null) je= container.getAdapter(IJavaElement.class); } if (je == null && container == null) { setSelection(null, false); return; } adjustInputAndSetSelection(je); } else if (ei instanceof IClassFileEditorInput) { <START> ITypeRoot cf= ((IClassFileEditorInput)ei).getClassFile(); <END> adjustInputAndSetSelection(cf); } } }</code><technical_language>I need for this</technical_language>

Target:
private void setSelectionFromEditor(IWorkbenchPart part, ISelection selection) { if (part instanceof IEditorPart) { IJavaElement element= null; if (selection instanceof IStructuredSelection) { Object obj= getSingleElementFromSelection(selection); if (obj instanceof IJavaElement) element= (IJavaElement)obj; } IEditorInput ei; if (part instanceof AbstractMultiEditor) ei= ((AbstractMultiEditor)part).getActiveEditor().getEditorInput(); else ei= ((IEditorPart)part).getEditorInput(); if (selection instanceof ITextSelection) { int offset= ((ITextSelection)selection).getOffset(); element= getElementAt(ei, offset); } if (element != null) { adjustInputAndSetSelection(element); return; } if (ei instanceof IFileEditorInput) { IFile file= ((IFileEditorInput)ei).getFile(); IJavaElement je= file.getAdapter(IJavaElement.class); IContainer container= null; if (je == null) { container= ((IFileEditorInput)ei).getFile().getParent(); if (container != null) je= container.getAdapter(IJavaElement.class); } if (je == null && container == null) { setSelection(null, false); return; } adjustInputAndSetSelection(je); } else if (ei instanceof IClassFileEditorInput) { IClassFile cf= ((IClassFileEditorInput)ei).getClassFile(); adjustInputAndSetSelection(cf); } } }
Source:
<code>public void testIterableSliceExpectedMulti() throws IOException { PayloadSlicer slicer = new BasePayloadSlicer(); Payload payload = new InputStreamPayload(new ByteArrayInputStream("aaaaaaaaaabbbbbbbbbbccccc".getBytes(Charsets.US_ASCII))); Iterator<Payload> iter = slicer.slice(payload, 10).iterator(); assertTrue(iter.hasNext(), "Not enough results"); <START> assertEquals(new String(ByteStreams.toByteArray(iter.next())), "aaaaaaaaaa"); <END> assertTrue(iter.hasNext(), "Not enough results"); assertEquals(new String(ByteStreams.toByteArray(iter.next())), "bbbbbbbbbb"); assertTrue(iter.hasNext(), "Not enough results"); assertEquals(new String(ByteStreams.toByteArray(iter.next())), "ccccc"); assertFalse(iter.hasNext()); }</code><technical_language>Call Strings2.toStringAndClose</technical_language>

Target:
public void testIterableSliceExpectedMulti() throws IOException { PayloadSlicer slicer = new BasePayloadSlicer(); Payload payload = new InputStreamPayload(new ByteArrayInputStream("aaaaaaaaaabbbbbbbbbbccccc".getBytes(Charsets.US_ASCII))); Iterator<Payload> iter = slicer.slice(payload, 10).iterator(); assertTrue(iter.hasNext(), "Not enough results"); assertEquals(Strings2.toStringAndClose(iter.next().getInput()), "aaaaaaaaaa"); assertTrue(iter.hasNext(), "Not enough results"); assertEquals(Strings2.toStringAndClose(iter.next().getInput()), "bbbbbbbbbb"); assertTrue(iter.hasNext(), "Not enough results"); assertEquals(Strings2.toStringAndClose(iter.next().getInput()), "ccccc"); assertFalse(iter.hasNext()); }
Source:
<code>public static void writeToFile(InputStream source, String destination) throws IOException { File f = new File(destination); Timber.d("Creating new file... = %s", destination); final int retries = 5; int retryCnt = 0; boolean created = false; <START> while (!created && retryCnt++ < retries) { <END> try { created = f.createNewFile(); } catch (IOException e) { e.printStackTrace(); if (retryCnt == retries) { throw new IOException(f.getName() + ": " + e.getLocalizedMessage(), e); } else { Timber.e("IOException while creating file, retrying..."); try { Thread.sleep(200); } catch (InterruptedException e1) { e1.printStackTrace(); } } } } long startTimeMillis = System.currentTimeMillis(); OutputStream output = new BufferedOutputStream(new FileOutputStream(destination)); byte[] buf = new byte[CHUNK_SIZE]; long sizeBytes = 0; int len; if (source == null) { Timber.e("writeToFile :: source is null!"); } while ((len = source.read(buf)) >= 0) { output.write(buf, 0, len); sizeBytes += len; } long endTimeMillis = System.currentTimeMillis(); Timber.d("Finished writeToFile!"); long durationSeconds = (endTimeMillis - startTimeMillis) / 1000; long sizeKb = sizeBytes / 1024; long speedKbSec = 0; if (endTimeMillis != startTimeMillis) { speedKbSec = sizeKb * 1000 / (endTimeMillis - startTimeMillis); } Timber.d("Utils.writeToFile: Size: %d Kb, Duration: %d s, Speed: %d Kb/s", sizeKb, durationSeconds, speedKbSec); output.close(); }</code><technical_language>Is leave existing function is handle retry logic a separate function? I easier maintain. E.g. split functions c++ public static void writeToFile(InputStream source, String destination) throws IOException { // call writeToFileImpl() in a while loop } c++ public static void writeToFileImpl(InputStream source, String destination) throws IOException { // current code in master }</technical_language>

Target:
public static void writeToFile(InputStream source, String destination) throws IOException { final int retries = 5; int retryCnt = 0; boolean success = false; while (!success && retryCnt++ < retries) { try { writeToFileImpl(source, destination); success = true; } catch (IOException e) { if (retryCnt == retries) { throw e; } else { Timber.e("IOException while writing to file, retrying..."); try { Thread.sleep(200); } catch (InterruptedException e1) { e1.printStackTrace(); } } } } }
Source:
<code>private String getContentWDL(File tempMainDescriptor, Type type) { Bridge bridge = new Bridge(); Map<String, Seq> callToTask = (LinkedHashMap)bridge.getCallsAndDocker(tempMainDescriptor); Map<String, Pair<String, String>> taskContent = new HashMap<>(); ArrayList<Pair<String, String>> nodePairs = new ArrayList<>(); String result = null; for (Map.Entry<String, Seq> entry : callToTask.entrySet()) { String taskID = entry.getKey(); Seq taskDocker = entry.getValue(); <START> if(type.equals(Type.TOOLS)){ <END> if (taskDocker != null){ String dockerName = taskDocker.head().toString(); taskContent.put(taskID, new MutablePair<>(dockerName, getURLFromEntry(dockerName))); } else{ taskContent.put(taskID, new MutablePair<>("Not Specified", "Not Specified")); } }else{ if (taskDocker != null){ String dockerName = taskDocker.head().toString(); nodePairs.add(new MutablePair<>(taskID, getURLFromEntry(dockerName))); } else{ nodePairs.add(new MutablePair<>(taskID, "")); } } } if(type.equals(Type.TOOLS)){ result = getJSONTableToolContentWDL(taskContent); }else if(type.equals(Type.DAG)){ result = setupJSONDAG(nodePairs); } return result; }</code><technical_language>== equals comparing enums Occurs a number of times</technical_language>

Target:
private String getContentWDL(File tempMainDescriptor, Type type) { Bridge bridge = new Bridge(); Map<String, Seq> callToTask = (LinkedHashMap)bridge.getCallsAndDocker(tempMainDescriptor); Map<String, Pair<String, String>> taskContent = new HashMap<>(); ArrayList<Pair<String, String>> nodePairs = new ArrayList<>(); String result = null; for (Map.Entry<String, Seq> entry : callToTask.entrySet()) { String taskID = entry.getKey(); Seq taskDocker = entry.getValue(); if(type == Type.TOOLS){ if (taskDocker != null){ String dockerName = taskDocker.head().toString(); taskContent.put(taskID, new MutablePair<>(dockerName, getURLFromEntry(dockerName))); } else{ taskContent.put(taskID, new MutablePair<>("Not Specified", "Not Specified")); } }else{ if (taskDocker != null){ String dockerName = taskDocker.head().toString(); nodePairs.add(new MutablePair<>(taskID, getURLFromEntry(dockerName))); } else{ nodePairs.add(new MutablePair<>(taskID, "")); } } } if(type == Type.TOOLS){ result = getJSONTableToolContentWDL(taskContent); }else if(type == Type.DAG){ result = setupJSONDAG(nodePairs); } return result; }
Source:
<code><START> private VmTemplate createVmTemplate() { <END> VmTemplate template = new VmTemplate(); template.setname("test-template"); template.setorigin(OriginType.OVIRT); template.setId(new Guid()); template.setdescription("test-description"); template.setDbGeneration(2L); return template; }</code><technical_language>static</technical_language>

Target:
private static VmTemplate createVmTemplate() { VmTemplate template = new VmTemplate(); template.setname("test-template"); template.setorigin(OriginType.OVIRT); template.setId(new Guid()); template.setdescription("test-description"); template.setDbGeneration(2L); return template; }
Source:
<code>private void compareCaseDbState(String inputTransactions, String caseDbState) throws IOException { MockDataUtils.parseIntoSandbox(this.getClass().getResourceAsStream(inputTransactions), sandbox); byte[] parsedDb = dumpInstance("jr://instance/casedb"); Document parsed = XmlComparator.getDocumentFromStream(new ByteArrayInputStream(parsedDb)); Document loaded = XmlComparator.getDocumentFromStream(this.getClass().getResourceAsStream(caseDbState)); try { XmlComparator.compareXmlDOMs(parsed, loaded); } catch (Exception e) { System.out.print(new String(parsedDb)); <START> assertEquals("CaseDB output did not match expected structure(" + e.getMessage() + ")", new String(dumpStream(caseDbState)), new String(parsedDb)); <END> } }</code><technical_language>This moved body of try</technical_language>

Target:
private void compareCaseDbState(String inputTransactions, String caseDbState) throws IOException { MockDataUtils.parseIntoSandbox(this.getClass().getResourceAsStream(inputTransactions), sandbox); byte[] parsedDb = dumpInstance("jr://instance/casedb"); Document parsed = XmlComparator.getDocumentFromStream(new ByteArrayInputStream(parsedDb)); Document loaded = XmlComparator.getDocumentFromStream(this.getClass().getResourceAsStream(caseDbState)); try { XmlComparator.isDOMEqual(parsed, loaded); } catch(Exception e) { System.out.print(new String(parsedDb)); assertEquals("CaseDB output did not match expected structure(" + e.getMessage()+ ")",new String(dumpStream(caseDbState)), new String(parsedDb)); } }
Source:
<code>public void testCompanionAdLink() throws Exception { Log.v(TAG, "Beginning testCompanionAdLink"); super.playVideo(); <START> assertTrue("Ad Break did not begin within given time.", adText.waitForExists(5000)); <END> UiObject companionAdUrl = new UiObject(new UiSelector().textContains("starbucks.com")); if (companionCheck()) { companionAd.clickAndWaitForNewWindow(); } else { fail("Companion ad not found."); } assertTrue("Companion ad did not link to correct url.", companionAdUrl.waitForExists(15000)); Log.v(TAG, "Finished testCompanionAdLink"); }</code><technical_language>Replace "5000" a constant integer top of class</technical_language>

Target:
public void testCompanionAdLink() throws Exception { Log.v(TAG, "Beginning testCompanionAdLink"); super.playVideo(); assertTrue("Ad Break did not begin within given time.", adTextView.waitForExists(msecToPreroll)); UiObject companionAdUrl = new UiObject(new UiSelector().textContains("starbucks.com")); if (companionCheck()) { companionAd.clickAndWaitForNewWindow(); } else { fail("Companion ad not found."); } assertTrue("Companion ad did not link to correct url.", companionAdUrl.waitForExists(15000)); Log.v(TAG, "Finished testCompanionAdLink"); }
Source:
<code>private boolean areEqualIgnoringWhitespace(CharSequence actual, CharSequence expected) { <START> if (actual == null) { <END> return expected == null; } return stripSpace(actual).equals(stripSpace(expected)); }</code><technical_language>this handle case actual is null expected is, leads a NPE, this case unit tested</technical_language>

Target:
private boolean areEqualIgnoringWhitespace(CharSequence actual, CharSequence expected) { if (actual == null) { return expected == null; } checkCharSequenceIsNotNull(expected); return removeAllWhitespaces(actual).equals(removeAllWhitespaces(expected)); }
Source:
<code>public RevCommit call() throws NoHeadException, NoMessageException, UnmergedPathException, JGitInternalException { processOptions(); Ref head; ObjectId parentID; try { head = repo.getRef(Constants.HEAD); if (head == null) throw new NoHeadException( <START> "Commit on repo without HEAD currently not supported"); <END> parentID = repo.resolve(Constants.HEAD + "^{commit}"); DirCache index = DirCache.lock(repo); try { ObjectWriter repoWriter = new ObjectWriter(repo); ObjectId indexTreeId = index.writeTree(repoWriter); Commit commit = new Commit(repo); commit.setCommitter(committer); commit.setAuthor(author); commit.setMessage(message); if (parentID != null) commit.setParentIds(new ObjectId[] { parentID }); commit.setTreeId(indexTreeId); ObjectId commitId = repoWriter.writeCommit(commit); RevCommit revCommit = new RevWalk(repo).parseCommit(commitId); RefUpdate ru = repo.updateRef(Constants.HEAD); ru.setNewObjectId(commitId); ru.setRefLogMessage("commit : " + revCommit.getShortMessage(), false); ru.setExpectedOldObjectId(parentID); switch (ru.update()) { case NEW: case FAST_FORWARD: return revCommit; default: throw new IllegalStateException("Updating the ref " + Constants.HEAD + " to " + commitId.toString() + " failed"); } } finally { index.unlock(); } } catch (UnmergedPathException e) { throw e; } catch (IOException e) { throw new JGitInternalException( "Exception caught during execution of commit command", e); } }</code><technical_language>"currently"? support this. I sense commit HEAD this API. If want a commit touching HEAD, lower-level library</technical_language>

Target:
public RevCommit call() throws NoHeadException, NoMessageException, UnmergedPathException, ConcurrentRefUpdateException, JGitInternalException { checkState(); processOptions(); Ref head; ObjectId parentID; try { head = repo.getRef(Constants.HEAD); if (head == null) throw new NoHeadException( "Commit on repo without HEAD currently not supported"); parentID = repo.resolve(Constants.HEAD + "^{commit}"); DirCache index = DirCache.lock(repo); try { ObjectWriter repoWriter = new ObjectWriter(repo); ObjectId indexTreeId = index.writeTree(repoWriter); Commit commit = new Commit(repo); commit.setCommitter(committer); commit.setAuthor(author); commit.setMessage(message); if (parentID != null) commit.setParentIds(new ObjectId[] { parentID }); commit.setTreeId(indexTreeId); ObjectId commitId = repoWriter.writeCommit(commit); RevCommit revCommit = new RevWalk(repo).parseCommit(commitId); RefUpdate ru = repo.updateRef(Constants.HEAD); ru.setNewObjectId(commitId); ru.setRefLogMessage("commit : " + revCommit.getShortMessage(), false); ru.setExpectedOldObjectId(parentID); switch (ru.update()) { case NEW: case FAST_FORWARD: setState(false); return revCommit; case LOCK_FAILURE: throw new ConcurrentRefUpdateException( "Could lock HEAD during commit"); default: throw new JGitInternalException("Updating the ref " + Constants.HEAD + " to " + commitId.toString() + " failed"); } } finally { index.unlock(); } } catch (UnmergedPathException e) { throw e; } catch (IOException e) { throw new JGitInternalException( "Exception caught during execution of commit command", e); } }
Source:
<code>public PListViewer() { outlineView = new org.openide.explorer.view.OutlineView(); initComponents(); outline = outlineView.getOutline(); ((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel("Key"); Bundle.PListNode_KeyCol(); <START> outlineView.setPropertyColumns( <END> "Type", Bundle.PListNode_TypeCol(), "Value", Bundle.PListNode_ValueCol()); customize(); }</code><technical_language>for this line is extra: Bundle.PListNode_KeyCol();</technical_language>

Target:
public PListViewer() { outlineView = new org.openide.explorer.view.OutlineView(); initComponents(); outline = outlineView.getOutline(); ((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel("Key"); outlineView.setPropertyColumns( "Type", Bundle.PListNode_TypeCol(), "Value", Bundle.PListNode_ValueCol()); customize(); }