auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testCleansUpItsLittleTurdlings() throws Exception { curator.start(); curator.blockUntilConnected(); NodeAnnouncer announcer = new NodeAnnouncer(curator); final byte[] billy = StringUtils.toUtf8("billy"); final String testPath = "/somewhere/test2"; <START> final String parent = ZKPaths.getPathAndNode(testPath).getPath(); <END> announcer.start(); try { Assert.assertNull(curator.checkExists().forPath(parent)); awaitAnnounce(announcer, testPath, billy, true); Assert.assertNotNull(curator.checkExists().forPath(parent)); } finally { announcer.stop(); } Assert.assertNull(curator.checkExists().forPath(parent)); }</code><technical_language>ZKPathUtils.getParentPath()</technical_language>

Target:
public void testCleansUpItsLittleTurdlings() throws Exception { curator.start(); curator.blockUntilConnected(); NodeAnnouncer announcer = new NodeAnnouncer(curator); final byte[] billy = StringUtils.toUtf8("billy"); final String testPath = "/somewhere/test2"; final String parent = ZKPathsUtils.getParentPath(testPath); announcer.start(); try { Assert.assertNull(curator.checkExists().forPath(parent)); awaitAnnounce(announcer, testPath, billy, true); Assert.assertNotNull(curator.checkExists().forPath(parent)); } finally { announcer.stop(); } Assert.assertNull(curator.checkExists().forPath(parent)); }
Source:
<code>public void loadConfigsIn(Context context) { ModuleEnvironment environment = context.get(ModuleManager.class).getEnvironment(); this.context = context; for (Class<? extends AutoConfig> configClass : environment.getSubtypesOf(AutoConfig.class)) { if (context.get(configClass) != null) { continue; } <START> SimpleUri configId = ReflectionUtil.getSimpleUriFor(configClass, environment); <END> loadConfig(configClass, configId); } this.context = null; }</code><technical_language>getSimpleUriFor derive a URI in form <module>:<className>, e.g., engine:AudioConfig. **Question:** a ReflectionUtil.getFqUriFor equivalent fully qualified class name avoid clashes in case configs of name in packages</technical_language>

Target:
public void loadConfigsIn(Context context) { ModuleEnvironment environment = context.get(ModuleManager.class).getEnvironment(); this.context = context; for (Class<? extends AutoConfig> configClass : environment.getSubtypesOf(AutoConfig.class)) { if (context.get(configClass) != null) { continue; } SimpleUri configId = ReflectionUtil.getFullyQualifiedSimpleUriFor(configClass, environment); loadConfig(configClass, configId); } this.context = null; }
Source:
<code>private void doFlush(Map<String, FileState> toRemove) { Map<String, FileState> toRestore = new HashMap<>(); boolean interrupted = false; for (Entry<String, FileState> entry : toRemove.entrySet()) { if (!interrupted && entry.getValue().close()) { if (FileWritingMessageHandler.this.logger.isDebugEnabled()) { FileWritingMessageHandler.this.logger.debug("Flushed: " + entry.getKey()); } } else { interrupted = true; toRestore.put(entry.getKey(), entry.getValue()); } } if (interrupted) { if (FileWritingMessageHandler.this.logger.isDebugEnabled()) { <START> FileWritingMessageHandler.this.logger.debug("Flushed: " + toRestore.keySet()); <END> } synchronized (this) { for (Entry<String, FileState> entry : toRestore.entrySet()) { this.fileStates.putIfAbsent(entry.getKey(), entry.getValue()); } } } }</code><technical_language>do Restored:</technical_language>

Target:
private void doFlush(Map<String, FileState> toRemove) { Map<String, FileState> toRestore = new HashMap<>(); boolean interrupted = false; for (Entry<String, FileState> entry : toRemove.entrySet()) { if (!interrupted && entry.getValue().close()) { if (FileWritingMessageHandler.this.logger.isDebugEnabled()) { FileWritingMessageHandler.this.logger.debug("Flushed: " + entry.getKey()); } } else { interrupted = true; toRestore.put(entry.getKey(), entry.getValue()); } } if (interrupted) { if (FileWritingMessageHandler.this.logger.isDebugEnabled()) { FileWritingMessageHandler.this.logger .debug("Interrupted during flush; not flushed: " + toRestore.keySet()); } synchronized (this) { for (Entry<String, FileState> entry : toRestore.entrySet()) { this.fileStates.putIfAbsent(entry.getKey(), entry.getValue()); } } } }
Source:
<code>public void processRecord(ComputationContext context, String inputStreamName, Record record) { BulkBucket bucket = BulkCodecs.getBucketCodec().decode(record.getData()); <START> LoginContext loginContext = null; <END> try { loginContext = Framework.loginAsUser("Administrator"); command = getCommand(bucket.getCommandId()); if (command != null) { startBucket(record.getKey()); for (List<String> batch : Lists.partition(bucket.getIds(), command.getBatchSize())) { processBatchOfDocuments(batch); } endBucket(context, bucket.getIds().size()); context.askForCheckpoint(); } else { if (isAbortedCommand(bucket.getCommandId())) { log.debug("Skipping aborted command: {}", bucket.getCommandId()); context.askForCheckpoint(); } else { log.error("Stopping processing, unknown command: {}, offset: {}, record: {}.", bucket.getCommandId(), context.getLastOffset(), record); context.askForTermination(); } } loginContext.logout(); } catch (LoginException e) { e.printStackTrace(); } }</code><technical_language>avoid this extra sudo for record ? This adds a new constraint actor computations AbstractBulkComputation, sounds a pitfall</technical_language>

Target:
public void processRecord(ComputationContext context, String inputStreamName, Record record) { BulkBucket bucket = BulkCodecs.getBucketCodec().decode(record.getData()); command = getCommand(bucket.getCommandId()); if (command != null) { startBucket(record.getKey()); for (List<String> batch : Lists.partition(bucket.getIds(), command.getBatchSize())) { processBatchOfDocuments(batch); } endBucket(context, bucket.getIds().size()); context.askForCheckpoint(); } else { if (isAbortedCommand(bucket.getCommandId())) { log.debug("Skipping aborted command: {}", bucket.getCommandId()); context.askForCheckpoint(); } else { log.error("Stopping processing, unknown command: {}, offset: {}, record: {}.", bucket.getCommandId(), context.getLastOffset(), record); context.askForTermination(); } } }
Source:
<code>public CompletableFuture<ClusterOverview> requestClusterOverview(Time timeout) { CompletableFuture<ResourceOverview> taskManagerOverviewFuture = runResourceManagerCommand(resourceManagerGateway -> resourceManagerGateway.requestResourceOverview(timeout)); <START> final List<CompletableFuture<Optional<JobStatus>>> optionalJobInformation = queryJobMastersForInformation(dj -> dj.requestJobStatus(timeout)); <END> CompletableFuture<Collection<Optional<JobStatus>>> allOptionalJobsFuture = FutureUtils.combineAll(optionalJobInformation); CompletableFuture<Collection<JobStatus>> allJobsFuture = allOptionalJobsFuture.thenApply(this::flattenOptionalCollection); final JobsOverview completedJobsOverview = archivedExecutionGraphStore.getStoredJobsOverview(); return allJobsFuture.thenCombine( taskManagerOverviewFuture, (Collection<JobStatus> runningJobsStatus, ResourceOverview resourceOverview) -> { final JobsOverview allJobsOverview = JobsOverview.create(runningJobsStatus).combine(completedJobsOverview); return new ClusterOverview(resourceOverview, allJobsOverview); }); }</code><technical_language>nit: In absence of type information I mind spelling variable names out. instead of dj name dispatcherJob. This give reader of code a bit more information type of parameter</technical_language>

Target:
public CompletableFuture<ClusterOverview> requestClusterOverview(Time timeout) { CompletableFuture<ResourceOverview> taskManagerOverviewFuture = runResourceManagerCommand(resourceManagerGateway -> resourceManagerGateway.requestResourceOverview(timeout)); final List<CompletableFuture<Optional<JobStatus>>> optionalJobInformation = queryJobMastersForInformation(dispatcherJob -> dispatcherJob.requestJobStatus(timeout)); CompletableFuture<Collection<Optional<JobStatus>>> allOptionalJobsFuture = FutureUtils.combineAll(optionalJobInformation); CompletableFuture<Collection<JobStatus>> allJobsFuture = allOptionalJobsFuture.thenApply(this::flattenOptionalCollection); final JobsOverview completedJobsOverview = archivedExecutionGraphStore.getStoredJobsOverview(); return allJobsFuture.thenCombine( taskManagerOverviewFuture, (Collection<JobStatus> runningJobsStatus, ResourceOverview resourceOverview) -> { final JobsOverview allJobsOverview = JobsOverview.create(runningJobsStatus).combine(completedJobsOverview); return new ClusterOverview(resourceOverview, allJobsOverview); }); }
Source:
<code>public Double getBuckle(int bp) { <START> if (bp < 0 || bp >= getPairingParameters().length) return null; <END> return pairingParameters[bp][0]; }</code><technical_language>throw exception (IllegalArgumentException IndexOutOfBoundsException, prefer) a message describing happened. for other getters</technical_language>

Target:
public Double getBuckle(int bp) { checkArgument(bp); return pairingParameters[bp][0]; }
Source:
<code>public void endWindow() { Map<KafkaPartition, Long> carryOn = new HashMap<>(offsetStats); <START> offsetTrackHistory.add(Pair.of(currentWindowId, carryOn)); <END> if (currentWindowId > idempotentStorageManager.getLargestRecoveryWindow()) { try { idempotentStorageManager.save(currentWindowRecoveryState, operatorId, currentWindowId); } catch (IOException e) { throw new RuntimeException("saving recovery", e); } } currentWindowRecoveryState.clear(); }</code><technical_language>This done for simple consumer condition clear state in committed</technical_language>

Target:
public void endWindow() { if (getConsumer() instanceof SimpleKafkaConsumer) { Map<KafkaPartition, Long> carryOn = new HashMap<>(offsetStats); offsetTrackHistory.add(Pair.of(currentWindowId, carryOn)); } if (currentWindowId > idempotentStorageManager.getLargestRecoveryWindow()) { try { idempotentStorageManager.save(currentWindowRecoveryState, operatorId, currentWindowId); } catch (IOException e) { throw new RuntimeException("saving recovery", e); } } currentWindowRecoveryState.clear(); }
Source:
<code><START> public JobCoordinator getCurrentJobCoordinator() { <END> return jobCoordinator; }</code><technical_language>this package private if is for test</technical_language>

Target:
JobCoordinator getCurrentJobCoordinator() { return jobCoordinator; }
Source:
<code>public CompilationUnit() { <START> this(null, false, null, new NodeList<>(), new NodeList<>(), null); <END> }</code><technical_language>for boolean parameter useful enums, is more clear means</technical_language>

Target:
public CompilationUnit() { this(null, null, new NodeList<>(), new NodeList<>(), null); }
Source:
<code>public void setUp() throws Exception { super.setUp(); _conn = con; Properties props = new Properties(); PGProperty.STRING_TYPE.set(props, "unspecified"); <START> _stringTypeUnspecifiedConn = TestUtil.openDB(props); <END> TestUtil.createTable(_conn, "arrtest", "intarr int[], decarr decimal(2,1)[], strarr text[]" + (TestUtil.haveMinimumServerVersion(_conn, ServerVersion.v8_3) ? ", uuidarr uuid[]" : "") + ", floatarr float8[]" + ", intarr2 int4[][]"); TestUtil.createTable(_conn, "arrcompprnttest", "id serial, name character(10)"); TestUtil.createTable(_conn, "arrcompchldttest", "id serial, name character(10), description character varying, parent integer"); TestUtil.createTable(_conn, "\"CorrectCasing\"", "id serial"); TestUtil.createTable(_conn, "\"Evil.Table\"", "id serial"); }</code><technical_language>Please move test class BaseTest4.updateProperties: <LINK_0></technical_language>

Target:
public void setUp() throws Exception { super.setUp(); _conn = con; TestUtil.createTable(_conn, "arrtest", "intarr int[], decarr decimal(2,1)[], strarr text[]" + (TestUtil.haveMinimumServerVersion(_conn, ServerVersion.v8_3) ? ", uuidarr uuid[]" : "") + ", floatarr float8[]" + ", intarr2 int4[][]"); TestUtil.createTable(_conn, "arrcompprnttest", "id serial, name character(10)"); TestUtil.createTable(_conn, "arrcompchldttest", "id serial, name character(10), description character varying, parent integer"); TestUtil.createTable(_conn, "\"CorrectCasing\"", "id serial"); TestUtil.createTable(_conn, "\"Evil.Table\"", "id serial"); }
Source:
<code>public void initialize(SpecialTimestampsSupplier timestamps, KeyValueService kvs) { <START> Schemas.createTablesAndIndexes(TargetedSweepSchema.INSTANCE.getLatestSchema(), kvs); <END> queue = SweepQueue.create(kvs, shardsConfig); timestampsSupplier = timestamps; conservativeScheduler.scheduleBackgroundThreads(); thoroughScheduler.scheduleBackgroundThreads(); }</code><technical_language>worth asserting kvs.isInitialized() condition parameter</technical_language>

Target:
public void initialize(SpecialTimestampsSupplier timestamps, KeyValueService kvs) { if (isInitialized) { return; } Preconditions.checkState(kvs.isInitialized(), "Attempted to initialize targeted sweeper with an uninitialized backing KVS."); Schemas.createTablesAndIndexes(TargetedSweepSchema.INSTANCE.getLatestSchema(), kvs); queue = SweepQueue.create(kvs, shardsConfig); timestampsSupplier = timestamps; conservativeScheduler.scheduleBackgroundThreads(); thoroughScheduler.scheduleBackgroundThreads(); isInitialized = true; }
Source:
<code>private void emitCreateExpectedObjectSchemaInfo(JavaWriter writer) throws IOException { writer.beginMethod( "OsObjectSchemaInfo", "createExpectedObjectSchemaInfo", EnumSet.of(Modifier.PRIVATE, Modifier.STATIC)); writer.emitStatement( <START> "OsObjectSchemaInfo info = new OsObjectSchemaInfo(\"%s\");", this.simpleClassName); <END> for (VariableElement field : metadata.getFields()) { String fieldName = field.getSimpleName().toString(); Constants.RealmFieldType fieldType = getRealmType(field); switch (fieldType) { case NOTYPE: break; case OBJECT: String fieldTypeSimpleName = Utils.getFieldTypeSimpleName(field); writer.emitStatement("info.add(\"%s\", RealmFieldType.OBJECT, \"%s\")", fieldName, fieldTypeSimpleName); break; case LIST: String genericTypeSimpleName = Utils.getGenericTypeSimpleName(field); writer.emitStatement("info.add(\"%s\", RealmFieldType.LIST, \"%s\")", fieldName, genericTypeSimpleName); break; default: String nullableFlag = (metadata.isNullable(field) ? "!" : "") + "Property.REQUIRED"; String indexedFlag = (metadata.isIndexed(field) ? "" : "!") + "Property.INDEXED"; String primaryKeyFlag = (metadata.isPrimaryKey(field) ? "" : "!") + "Property.PRIMARY_KEY"; writer.emitStatement("info.add(\"%s\", %s, %s, %s, %s)", fieldName, fieldType.getRealmType(), primaryKeyFlag, indexedFlag, nullableFlag); } } writer.emitStatement("return info"); writer.endMethod() .emitEmptyLine(); }</code><technical_language>need for ;</technical_language>

Target:
private void emitCreateExpectedObjectSchemaInfo(JavaWriter writer) throws IOException { writer.beginMethod( "OsObjectSchemaInfo", "createExpectedObjectSchemaInfo", EnumSet.of(Modifier.PRIVATE, Modifier.STATIC)); writer.emitStatement( "OsObjectSchemaInfo.Builder builder = new OsObjectSchemaInfo.Builder(\"%s\")", this.simpleClassName); for (VariableElement field : metadata.getFields()) { String fieldName = field.getSimpleName().toString(); Constants.RealmFieldType fieldType = getRealmType(field); switch (fieldType) { case NOTYPE: break; case OBJECT: String fieldTypeSimpleName = Utils.getFieldTypeSimpleName(field); writer.emitStatement("builder.addLinkedProperty(\"%s\", RealmFieldType.OBJECT, \"%s\")", fieldName, fieldTypeSimpleName); break; case LIST: String genericTypeSimpleName = Utils.getGenericTypeSimpleName(field); writer.emitStatement("builder.addLinkedProperty(\"%s\", RealmFieldType.LIST, \"%s\")", fieldName, genericTypeSimpleName); break; default: String nullableFlag = (metadata.isNullable(field) ? "!" : "") + "Property.REQUIRED"; String indexedFlag = (metadata.isIndexed(field) ? "" : "!") + "Property.INDEXED"; String primaryKeyFlag = (metadata.isPrimaryKey(field) ? "" : "!") + "Property.PRIMARY_KEY"; writer.emitStatement("builder.addProperty(\"%s\", %s, %s, %s, %s)", fieldName, fieldType.getRealmType(), primaryKeyFlag, indexedFlag, nullableFlag); } } writer.emitStatement("return builder.build()"); writer.endMethod() .emitEmptyLine(); }
Source:
<code>public void checkPortVisibility() throws Exception { simpleImport("resources/rt/PortModel.emx"); openEditor(); <START> rootPackage.getOwnedElements().stream() <END> .filter(Port.class::isInstance) .filter(p -> !((Port) p).isService()) .forEach(port -> assertEquals(" Port visibility Error: port should be protected", VisibilityKind.PROTECTED_LITERAL, ((Port) port).getVisibility())); }</code><technical_language>sorry, check run this test assertions ports? this version problem first. owned elements of a package packaged elements, a subset of owned elements. This test check visibility of port. I recommend TDD approach: run test product code fix test fail in absence of fix. If test fail, test is broken. Then, fix product code test passes</technical_language>

Target:
public void checkPortVisibility() throws Exception { simpleImport("resources/rt/PortModel.emx"); openEditor(); rootPackage.allOwnedElements().stream() .filter(Port.class::isInstance) .filter(p -> !((Port) p).isService()) .forEach(port -> assertEquals(" Port visibility Error: port should be protected", VisibilityKind.PROTECTED_LITERAL, ((Port) port).getVisibility())); }
Source:
<code>public boolean isCorrectMutator(MethodSource<JavaClassSource> method, PropertySource<JavaClassSource> property) { String returnType = method.getReturnType().getName(); String className = property.getOrigin().getName(); <START> return returnType.equals(className); <END> }</code><technical_language>returnType null? invert this (className.equals(returnType))</technical_language>

Target:
public boolean isCorrectMutator(MethodSource<JavaClassSource> method, PropertySource<JavaClassSource> property) { String returnType = method.getReturnType().getName(); String className = property.getOrigin().getName(); return className.equals(returnType); }
Source:
<code>public static String generateStructMemberArrayParserBlock(final String structResponseTypeName, final StructMember structMember) throws ParseException { <START> final StringBuilder outputBuilder = new StringBuilder(); <END> outputBuilder.append(indent(3)).append("GPtrArray* ").append(structMember.getName()).append("_array = _parse_").append(structResponseTypeName).append("(log, doc, child_node);\n"). append(indent(3)).append("response").append("->").append(structMember.getName()).append(" = (").append(structMember.getType()).append(")").append(structMember.getName()).append("_array->pdata;\n"). append(indent(3)).append("response").append("->num_").append(structMember.getName()).append(" = ").append(structMember.getName()).append("_array->len;\n"). append(indent(3)).append("g_ptr_array_free(").append(structMember.getName()).append("_array, FALSE);\n"); return outputBuilder.toString(); }</code><technical_language>This easier read understand if replaced plain string concatenation. I suspect intellij mention this well</technical_language>

Target:
public static String generateStructMemberArrayParserBlock(final String structResponseTypeName, final StructMember structMember) throws ParseException { return indent(3) + "GPtrArray* " + structMember.getName() + "_array = _parse_" + structResponseTypeName + "(log, doc, child_node);\n" + indent(3) + "response->" + structMember.getName() + " = (" + structMember.getType() + ")" + structMember.getName() + "_array->pdata;\n" + indent(3) + "response->num_" + structMember.getName() + " = " + structMember.getName() + "_array->len;\n" + indent(3) + "g_ptr_array_free(" + structMember.getName() + "_array, FALSE);\n"; }
Source:
<code>public void test2() throws IOException { Text colf = new Text("a"); Text colq = new Text("b"); Value dv = new Value(); TreeMap<Key,Value> tm = new TreeMap<>(); for (int i = 0; i < 1000; i++) { Key k = new Key(new Text(String.format("%03d", i)), colf, colq); k.setTimestamp(i); tm.put(k, dv); } assertTrue(tm.size() == 1000); SortedKeyValueIterator<Key,Value> a = new AgeOffFilter(); IteratorSetting is = new IteratorSetting(1, AgeOffFilter.class); AgeOffFilter.setTTL(is, 101l); AgeOffFilter.setCurrentTime(is, 1001l); AgeOffFilter.setNegate(is, true); assertTrue(((AgeOffFilter) a).validateOptions(is.getOptions())); try { ((AgeOffFilter) a).validateOptions(EMPTY_OPTS); assertTrue(false); } catch (IllegalArgumentException e) a.init(new SortedMapIterator(tm), is.getOptions(), null); a = a.deepCopy(null); SortedKeyValueIterator<Key,Value> copy = a.deepCopy(null); a.seek(new Range(), EMPTY_COL_FAMS, false); <START> assertEquals(900, size(a)); <END> copy.seek(new Range(), EMPTY_COL_FAMS, false); assertEquals(900, size(copy)); }</code><technical_language>Separating out test fixes a separate commit (with a separate JIRA) happy changeset easier comprehend if need in history, -1 if don't</technical_language>

Target:
public void test2() throws IOException { Text colf = new Text("a"); Text colq = new Text("b"); Value dv = new Value(); TreeMap<Key,Value> tm = new TreeMap<>(); for (int i = 0; i < 1000; i++) { Key k = new Key(new Text(String.format("%03d", i)), colf, colq); k.setTimestamp(i); tm.put(k, dv); } assertTrue(tm.size() == 1000); SortedKeyValueIterator<Key,Value> a = new AgeOffFilter(); IteratorSetting is = new IteratorSetting(1, AgeOffFilter.class); AgeOffFilter.setTTL(is, 101l); AgeOffFilter.setCurrentTime(is, 1001l); AgeOffFilter.setNegate(is, true); assertTrue(((AgeOffFilter) a).validateOptions(is.getOptions())); try { ((AgeOffFilter) a).validateOptions(EMPTY_OPTS); assertTrue(false); } catch (IllegalArgumentException e) a.init(new SortedMapIterator(tm), is.getOptions(), null); a = a.deepCopy(null); SortedKeyValueIterator<Key,Value> copy = a.deepCopy(null); a.seek(new Range(), EMPTY_COL_FAMS, false); assertEquals(size(a), 900); copy.seek(new Range(), EMPTY_COL_FAMS, false); assertEquals(size(copy), 900); }
Source:
<code>public static RegionInfo parseRegionInfoFromRegionName(byte[] regionName) throws IOException { byte[][] fields = RegionInfo.parseRegionName(regionName); long regionId = Long.parseLong(Bytes.toString(fields[2])); int replicaId = fields.length > 3 ? Integer.parseInt(Bytes.toString(fields[3]), 16) : 0; return RegionInfoBuilder.newBuilder(TableName.valueOf(fields[0])).setStartKey(fields[1]) <START> .setSplit(false).setRegionId(regionId).setReplicaId(replicaId).build(); <END> }</code><technical_language>Add ut for this</technical_language>

Target:
public static RegionInfo parseRegionInfoFromRegionName(byte[] regionName) throws IOException { byte[][] fields = RegionInfo.parseRegionName(regionName); long regionId = Long.parseLong(Bytes.toString(fields[2])); int replicaId = fields.length > 3 ? Integer.parseInt(Bytes.toString(fields[3]), 16) : 0; return RegionInfoBuilder.newBuilder(TableName.valueOf(fields[0])).setStartKey(fields[1]) .setRegionId(regionId).setReplicaId(replicaId).build(); }
Source:
<code>public void testCopy() { final DSLVariableValue original = new DSLVariableValue("value"); final DSLVariableValue copy = original.copy(); assertEquals(original, copy); <START> assertNotSame(original, <END> copy); }</code><technical_language>possibly check values (but I guess, if equals() method is broken screwed!)</technical_language>

Target:
public void testCopy() { final DSLVariableValue original = new DSLVariableValue("value"); final DSLVariableValue copy = original.copy(); assertEquals(original.getValue(), copy.getValue()); assertEquals(original, copy); assertNotSame(original, copy); }
Source:
<code>public void testCountStar33() { List<AbstractPlanNode> pn = compileToFragments("SELECT COUNT(*) FROM T_ENG_11096 WHERE a = 1 AND b IS NOT DISTINCT FROM CAST(NULL AS INT) AND c > 1"); checkIndexCounter(pn, true); pn = compileToFragments("SELECT COUNT(1) FROM T_ENG_11096 WHERE a = 1 AND b IS NOT DISTINCT FROM CAST(NULL AS INT) AND c > 1"); checkIndexCounter(pn, true); pn = compileToFragments("SELECT COUNT(*) FROM T_ENG_11096 WHERE a = 1 AND b IS NOT DISTINCT FROM CAST(NULL AS INT)"); for ( AbstractPlanNode nd : pn) System.out.println("PlanNode Explain string:\n" + nd.toExplainPlanString()); AbstractPlanNode p = pn.get(0).getChild(0); <START> assertTrue(p instanceof IndexScanPlanNode); <END> assertNotNull(p.getInlinePlanNode(PlanNodeType.AGGREGATE)); }</code><technical_language>lock boolean flag in plan consider nulls equal</technical_language>

Target:
public void testCountStar33() { List<AbstractPlanNode> pn = compileToFragments("SELECT COUNT(*) FROM T_ENG_11096 WHERE a = 1 AND b IS NOT DISTINCT FROM CAST(NULL AS INT) AND c > 1"); checkIndexCounter(pn, true); checkCompareNotDistinctFlags(pn.get(0).getChild(0), false, true, false); pn = compileToFragments("SELECT COUNT(1) FROM T_ENG_11096 WHERE a = 1 AND b IS NOT DISTINCT FROM CAST(NULL AS INT) AND c > 1"); checkIndexCounter(pn, true); checkCompareNotDistinctFlags(pn.get(0).getChild(0), false, true, false); pn = compileToFragments("SELECT COUNT(*) FROM T_ENG_11096 WHERE a = 1 AND b IS NOT DISTINCT FROM CAST(NULL AS INT)"); for ( AbstractPlanNode nd : pn) System.out.println("PlanNode Explain string:\n" + nd.toExplainPlanString()); AbstractPlanNode p = pn.get(0).getChild(0); checkCompareNotDistinctFlags(p, false, true); assertNotNull(p.getInlinePlanNode(PlanNodeType.AGGREGATE)); }
Source:
<code>public void onListItemClick(ListView listView, View view, int position, long id) { super.onListItemClick(listView, view, position, id); ATMItem item = (ATMItem) <START> getListView().getItemAtPosition(position); <END> mOnItemSelectedListener.onItemSelected(item); }</code><technical_language>listView parameter, need call "getListView()"</technical_language>

Target:
public void onListItemClick(ListView listView, View view, int position, long id) { super.onListItemClick(listView, view, position, id); ATMItem item = (ATMItem) getListView().getItemAtPosition(position); if(!mSelectedItems.contains(item)) { mSelectedItems.add(item); }else{ mSelectedItems.remove(item); } }
Source:
<code>public ValidationResult isBackupStorageDomainUpdatedWithRunningVmAndNoVmLease() { List<VM> vms = vmDao.getAllActiveForStorageDomain(storageDomain.getId()); List<String> invalidVmsForBackupStorageDomain = vms.stream() .filter(vm -> vm.getDiskMap() .values() .stream() .filter(DisksFilter.ONLY_IMAGES) .filter(DisksFilter.ONLY_PLUGGED) .map(DiskImage.class::cast) .anyMatch(vmDisk -> vmDisk.getStorageIds().get(0).equals(storageDomain.getId()))) .map(vm -> vm.getName()) .collect(Collectors.toList()); QueryReturnValue ret = getBackend().runInternalQuery( QueryType.GetEntitiesWithLeaseByStorageId, new IdQueryParameters(storageDomain.getId())); if <START> (ret != null && ret.getReturnValue() != null && <END> ret.getSucceeded()) { for (VmBase vmBase : ret.<List<VmBase>> getReturnValue()) { invalidVmsForBackupStorageDomain.add(vmBase.getName()); } } if (invalidVmsForBackupStorageDomain.isEmpty()) { return ValidationResult.VALID; } else { return new ValidationResult( EngineMessage.ACTION_TYPE_FAILED_RUNNING_VM_OR_VM_LEASES_PRESENT_ON_STORAGE_DOMAIN); } }</code><technical_language>get null here, check get removed</technical_language>

Target:
public ValidationResult isBackupStorageDomainUpdatedWithRunningVmAndNoVmLease() { List<VM> vms = vmDao.getAllActiveForStorageDomain(storageDomain.getId()); List<String> invalidVmsForBackupStorageDomain = vms.stream() .filter(vm -> vm.getDiskMap() .values() .stream() .filter(DisksFilter.ONLY_IMAGES) .filter(DisksFilter.ONLY_PLUGGED) .map(DiskImage.class::cast) .anyMatch(vmDisk -> vmDisk.getStorageIds().get(0).equals(storageDomain.getId()))) .map(vm -> vm.getName()) .collect(Collectors.toList()); QueryReturnValue ret = getBackend().runInternalQuery( QueryType.GetEntitiesWithLeaseByStorageId, new IdQueryParameters(storageDomain.getId())); if (ret.getSucceeded()) { for (VmBase vmBase : ret.<List<VmBase>> getReturnValue()) { invalidVmsForBackupStorageDomain.add(vmBase.getName()); } } if (invalidVmsForBackupStorageDomain.isEmpty()) { return ValidationResult.VALID; } log.info("All VMS in given domain is ", invalidVmsForBackupStorageDomain); return new ValidationResult( EngineMessage.ACTION_TYPE_FAILED_RUNNING_VM_OR_VM_LEASES_PRESENT_ON_STORAGE_DOMAIN); }
Source:
<code><START> public int readLimit(String client) { <END> QosClientLimitsConfig qosClientLimitsConfig = config.get().clientLimits().getOrDefault(client, ImmutableQosClientLimitsConfig.builder().build()); return Ints.saturatedCast((long) getClientLimitMultiplier(qosClientLimitsConfig.clientPriority()) * qosClientLimitsConfig.limits().readBytesPerSecond()); }</code><technical_language>this a long</technical_language>

Target:
public long readLimit(String client) { QosClientLimitsConfig qosClientLimitsConfig = qosClientConfigLoader.getConfigForClient(client); return (long) (clientLimitMultiplier.getClientLimitMultiplier(qosClientLimitsConfig.clientPriority()) * qosClientLimitsConfig.limits().readBytesPerSecond()); }
Source:
<code>public void getObs_shouldGetADateObs() throws Exception { SimpleDateFormat ymd = new SimpleDateFormat("yyyy-MM-dd"); MockHttpServletRequest req = request(RequestMethod.GET, getURI() + "/" + getUuid()); SimpleObject result = deserialize(handle(req)); Assert.assertNotNull(result); Util.log("Obs fetched (default)", result); <START> Assert.assertEquals(Context.getObsService().getObsByUuid(getUuid()), PropertyUtils.getProperty(result, "uuid")); <END> Assert.assertEquals(ConversionUtil.convertToRepresentation(ymd.parse("2008-08-14"), Representation.DEFAULT), PropertyUtils.getProperty(result, "value")); }</code><technical_language>getUuid() instead of Context.getObsService().getObsByUuid(getUuid())</technical_language>

Target:
public void getObs_shouldGetADateObs() throws Exception { String uuid = "99b92980-db62-40cd-8bca-733357c48126"; SimpleDateFormat ymd = new SimpleDateFormat("yyyy-MM-dd"); MockHttpServletRequest req = request(RequestMethod.GET, getURI() + "/" + uuid); SimpleObject result = deserialize(handle(req)); Assert.assertNotNull(result); Util.log("Obs fetched (default)", result); Assert.assertEquals(uuid, PropertyUtils.getProperty(result, "uuid")); Assert.assertEquals(ConversionUtil.convertToRepresentation(ymd.parse("2008-08-14"), Representation.DEFAULT), PropertyUtils.getProperty(result, "value")); }
Source:
<code>public void onResume() { Log.d(TAG, "onResume()"); hideSystemUI(); settings.reload(); vibrantColor = 0; vibrantColorDark = 0; this.locked = settings.isUIlocked; removeCallbacks(backgroundChange); background_images[background_image_active].clearAnimation(); background_images[ (background_image_active + 1) % 2].clearAnimation(); <START> load_files(); <END> handler.postDelayed(backgroundChange, 15000 * settings.backgroundImageDuration); setScreenOrientation(settings.screenOrientation); initSidePanel(); bottomPanelLayout.setAlarmUseLongPress(settings.stopAlarmOnLongPress); bottomPanelLayout.setAlarmUseSingleTap(settings.stopAlarmOnTap); bottomPanelLayout.setShowAlarmsPersistently(settings.showAlarmsPersistently); bottomPanelLayout.setUseAlarmSwipeGesture(settings.useAlarmSwipeGesture); bottomPanelLayout.setup(); setupScreenAnimation(); lockUI(this.locked); clockLayoutContainer.post(initClockLayout); Utility.registerEventBus(this); broadcastReceiver = registerBroadcastReceiver(); initLightSensor(); if (settings.useAmbientNoiseDetection()){ soundmeter = new SoundMeter(isDebuggable); } else { soundmeter = null; } }</code><technical_language>list is loaded in onResume anyway. is currently done twice</technical_language>

Target:
public void onResume() { Log.d(TAG, "onResume()"); hideSystemUI(); settings.reload(); vibrantColor = 0; vibrantColorDark = 0; this.locked = settings.isUIlocked; removeCallbacks(backgroundChange); background_images[0].clearAnimation(); background_images[0].setImageDrawable(bgblack); background_images[1].clearAnimation(); background_images[1].setImageDrawable(bgblack); lastAnimationTime = 0L; if (settings.getBackgroundMode() == Settings.BACKGROUND_SLIDESHOW) { loadBackgroundImageFiles(); handler.postDelayed(backgroundChange, 15000 * settings.backgroundImageDuration); } setScreenOrientation(settings.screenOrientation); initSidePanel(); bottomPanelLayout.setAlarmUseLongPress(settings.stopAlarmOnLongPress); bottomPanelLayout.setAlarmUseSingleTap(settings.stopAlarmOnTap); bottomPanelLayout.setShowAlarmsPersistently(settings.showAlarmsPersistently); bottomPanelLayout.setUseAlarmSwipeGesture(settings.useAlarmSwipeGesture); bottomPanelLayout.setup(); setupScreenAnimation(); lockUI(this.locked); clockLayoutContainer.post(initClockLayout); Utility.registerEventBus(this); broadcastReceiver = registerBroadcastReceiver(); initLightSensor(); if (settings.useAmbientNoiseDetection()){ soundmeter = new SoundMeter(isDebuggable); } else { soundmeter = null; } }
Source:
<code>public void setEntity(EntityLocal entity) { super.setEntity(entity); setEntityLoadingConfig(); if (fromHardcodedProducers == null && producer == null) producer = entity; checkState(fromHardcodedProducers != null ^ producer != null, "must specify one of %s (%s) or %s (%s)", PRODUCER.getName(), producer, FROM_HARDCODED_PRODUCERS.getName(), fromHardcodedProducers); <START> checkState(producer != null ? (Boolean.TRUE.equals(fromMembers) || Boolean.TRUE.equals(fromChildren)) : true, <END> "when specifying producer, must specify at least one of fromMembers (%s) or fromChildren (%s)", fromMembers, fromChildren); if (fromHardcodedProducers != null) { for (Entity producer : Iterables.filter(fromHardcodedProducers, entityFilter)) { addProducerHardcoded(producer); } } if (Boolean.TRUE.equals(fromMembers)) { setEntityBeforeSubscribingProducerMemberEvents(entity); setEntitySubscribeProducerMemberEvents(); setEntityAfterSubscribingProducerMemberEvents(); } if (Boolean.TRUE.equals(fromChildren)) { setEntityBeforeSubscribingProducerChildrenEvents(); setEntitySubscribingProducerChildrenEvents(); setEntityAfterSubscribingProducerChildrenEvents(); } onUpdated(); }</code><technical_language>boolean expression: producer == null || (Boolean.TRUE.equals(fromMembers) || Boolean.TRUE.equals(fromChildren)</technical_language>

Target:
public void setEntity(EntityLocal entity) { super.setEntity(entity); setEntityLoadingConfig(); if (fromHardcodedProducers == null && producer == null) producer = entity; checkState(fromHardcodedProducers != null ^ producer != null, "must specify one of %s (%s) or %s (%s)", PRODUCER.getName(), producer, FROM_HARDCODED_PRODUCERS.getName(), fromHardcodedProducers); checkState(producer == null || Boolean.TRUE.equals(fromMembers) || Boolean.TRUE.equals(fromChildren), "when specifying producer, must specify at least one of fromMembers (%s) or fromChildren (%s)", fromMembers, fromChildren); if (fromHardcodedProducers != null) { for (Entity producer : Iterables.filter(fromHardcodedProducers, entityFilter)) { addProducerHardcoded(producer); } } if (Boolean.TRUE.equals(fromMembers)) { setEntityBeforeSubscribingProducerMemberEvents(entity); setEntitySubscribeProducerMemberEvents(); setEntityAfterSubscribingProducerMemberEvents(); } if (Boolean.TRUE.equals(fromChildren)) { setEntityBeforeSubscribingProducerChildrenEvents(); setEntitySubscribingProducerChildrenEvents(); setEntityAfterSubscribingProducerChildrenEvents(); } onUpdated(); }
Source:
<code>protected File getFile(HandlerRequest<EmptyRequestBody, FileMessageParameters> handlerRequest) { final String logDir = logFileLocation.logFile.getParent(); <START> if (logFileLocation.logFile == null || StringUtils.isNullOrWhitespaceOnly(logFileLocation.logFile.getParent())) { <END> throw new CompletionException(new RestHandlerException("Can not get JobManager log dir.", HttpResponseStatus.NOT_FOUND)); } String filename = handlerRequest.getPathParameter(LogFileNamePathParameter.class); return new File(logDir, filename); }</code><technical_language>If logFileLocation.logFile == null, line throw NPE. In addition, need call logFileLocation.logFile.getParent() twice</technical_language>

Target:
protected File getFile(HandlerRequest<EmptyRequestBody, FileMessageParameters> handlerRequest) { if (logDir == null) { return null; } String filename = handlerRequest.getPathParameter(LogFileNamePathParameter.class); return new File(logDir.getPath(), filename); }
Source:
<code>protected void findAndProcess(final Annotation ann, final Object message) { <START> try { <END> httpsession.getCreationTime(); } catch (IllegalStateException ex) { httpsession = null; } catch (NullPointerException ex2) { httpsession = null; } try { final WebModules modules = WebModules.get(context); final WsFunction func = modules.find(this, ann); if(func == null) throw new Exception(Util.info(WS_MISSING_X, ann.toString())); else if(response != null) func.process(this, message); } catch(final RuntimeException ex) { throw ex; } catch(final Exception ex) { Util.debug(ex); throw new CloseException(StatusCode.ABNORMAL, ex.getMessage()); } }</code><technical_language>here: Avoid calling a function of httpsession if null (Reason: catching exceptions is more expensive, NullPointerExceptions occur places)</technical_language>

Target:
protected void findAndProcess(final Annotation ann, final Object message) { try { if(httpsession != null) httpsession.getCreationTime(); } catch (IllegalStateException ex) { httpsession = null; } try { final WebModules modules = WebModules.get(context); final WsFunction func = modules.find(this, ann); if(func == null) throw new Exception(Util.info(WS_MISSING_X, ann)); else if(response != null) func.process(this, message); } catch(final RuntimeException ex) { throw ex; } catch(final Exception ex) { Util.debug(ex); throw new CloseException(StatusCode.ABNORMAL, ex.getMessage()); } }
Source:
<code>public PrivateChannel subscribePrivate(final String channelName, final PrivateChannelEventListener listener, final String... eventNames) { throwExceptionIfNoAuthorizerHasBeenSet(); final PrivateChannelImpl channel = factory.newPrivateChannel(connection, channelName, pusherOptions.getAuthorizer()); channelManager.subscribeTo(channel, listener, eventNames); <START> privateChannels.add(channel); <END> return channel; }</code><technical_language>channels removed list ? leak memory otherwise</technical_language>

Target:
public PrivateChannel subscribePrivate(final String channelName, final PrivateChannelEventListener listener, final String... eventNames) { throwExceptionIfNoAuthorizerHasBeenSet(); final PrivateChannelImpl channel = factory.newPrivateChannel(connection, channelName, pusherOptions.getAuthorizer()); channelManager.subscribeTo(channel, listener, eventNames); return channel; }
Source:
<code>public void processElement(PipelineOptions po) { long timestampDiff = System.currentTimeMillis() - START_TIME; long minutes = (timestampDiff / 1000) / 60; int timeOffsetIndex = Math.toIntExact(minutes / KEY_VIZ_WINDOW_MINUTES); ReadDataOptions options = po.as(ReadDataOptions.class); long count = 0; List<RowRange> ranges = getRangesForTimeIndex(timeOffsetIndex, getNumRows(options)); if (ranges.size() == 0) { return; } try { Filter rangeFilters = new MultiRowRangeFilter(ranges); FilterList firstKeyFilterWithRanges = new FilterList(new FirstKeyOnlyFilter(), rangeFilters); Scan scan = new Scan() .addFamily(Bytes.toBytes(COLUMN_FAMILY)) .setFilter(firstKeyFilterWithRanges); Table table = getConnection().getTable(TableName.valueOf(options.getBigtableTableId())); ResultScanner imageData = table.getScanner(scan); <START> for (Result row : imageData) { count++; } <END> } catch (Exception e) { System.out.println("Error reading."); e.printStackTrace(); } System.out.printf("got %d rows\n", count); }</code><technical_language>a do this? If not, explanation of useful</technical_language>

Target:
public void processElement(PipelineOptions po) { long timestampDiff = System.currentTimeMillis() - START_TIME; long minutes = (timestampDiff / 1000) / 60; int timeOffsetIndex = Math.toIntExact(minutes / KEY_VIZ_WINDOW_MINUTES); ReadDataOptions options = po.as(ReadDataOptions.class); long count = 0; List<RowRange> ranges = getRangesForTimeIndex(timeOffsetIndex, getNumRows(options)); if (ranges.size() == 0) { return; } try { Filter rangeFilters = new MultiRowRangeFilter(ranges); FilterList firstKeyFilterWithRanges = new FilterList( rangeFilters, new FirstKeyOnlyFilter(), new KeyOnlyFilter()); Scan scan = new Scan() .addFamily(Bytes.toBytes(COLUMN_FAMILY)) .setFilter(firstKeyFilterWithRanges); Table table = getConnection().getTable(TableName.valueOf(options.getBigtableTableId())); ResultScanner imageData = table.getScanner(scan); for (Result row : imageData) { count++; } } catch (Exception e) { System.out.println("Error reading."); e.printStackTrace(); } System.out.printf("got %d rows\n", count); }
Source:
<code>public void checkAttributeValue(PerunSessionImpl perunSession, Resource resource, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { try { List<String> vomRoles = (List<String>) attribute.getValue(); for (String vomRole : vomRoles) { <START> Matcher matcher = pattern.matcher(vomRole); <END> if(!matcher.matches()) { throw new WrongAttributeValueException(attribute, "Bad resource vomsRoles value. It should not contain '<>&' characters."); } } } catch (ClassCastException e) { throw new WrongAttributeValueException(attribute, "Value should be a list of Strings."); } }</code><technical_language>Please if (attribute.getValue() == null) return;. sure, matcher.matches() work null value, for cycle fail NullPointerException. Also, do catch ClassCastException, you</technical_language>

Target:
public void checkAttributeValue(PerunSessionImpl perunSession, Resource resource, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { if(attribute.getValue() == null) { return; } try { List<String> vomRoles = (List<String>) attribute.getValue(); for (String vomRole : vomRoles) { Matcher matcher = pattern.matcher(vomRole); if(!matcher.matches()) { throw new WrongAttributeValueException(attribute, "Bad resource vomsRoles value. It should not contain '<>&' characters."); } } } catch (ClassCastException e) { throw new WrongAttributeValueException(attribute, "Value should be a list of Strings."); } }
Source:
<code>public String toString() { <START> return "InvocationId:" + Objects.toString(address, "local") + ":" + id; <END> }</code><technical_language>CommandInvocationId</technical_language>

Target:
public String toString() { return "CommandInvocation:" + Objects.toString(address, "local") + ":" + id; }
Source:
<code>public static HBaseMetadataService newInstance(Configuration hbaseConfig, SecurityContext securityContext, Subject subject, Component hbaseMaster, Collection<ComponentProcess> hbaseMasterProcesses) throws IOException, EntityNotFoundException { if (SecurityUtil.isKerberosAuthenticated(securityContext)) { UserGroupInformation.setConfiguration(hbaseConfig); final UserGroupInformation ugiFromSubject = UserGroupInformation.getUGIFromSubject(subject); final UserGroupInformation proxyUserForImpersonation = UserGroupInformation .createProxyUser(securityContext.getUserPrincipal().getName(), ugiFromSubject); final User user = User.create(proxyUserForImpersonation); return new HBaseMetadataService(ConnectionFactory.createConnection(hbaseConfig, user) .getAdmin(), securityContext, subject, user, hbaseMaster, hbaseMasterProcesses); } else { <START> return new HBaseMetadataService(ConnectionFactory.createConnection(hbaseConfig).getAdmin(), <END> null, null, null, hbaseMaster, hbaseMasterProcesses); } }</code><technical_language>passing securityContext subject is fetched this method? user is guard null. remove 1 arg constructor remove unused static newInstance() mistake again. need modify test code though</technical_language>

Target:
public static HBaseMetadataService newInstance(Configuration hbaseConfig, SecurityContext securityContext, Subject subject, Component hbaseMaster, Collection<ComponentProcess> hbaseMasterProcesses) throws IOException, EntityNotFoundException { if (SecurityUtil.isKerberosAuthenticated(securityContext)) { UserGroupInformation.setConfiguration(hbaseConfig); final UserGroupInformation ugiFromSubject = UserGroupInformation.getUGIFromSubject(subject); final UserGroupInformation proxyUserForImpersonation = UserGroupInformation .createProxyUser(securityContext.getUserPrincipal().getName(), ugiFromSubject); final User user = User.create(proxyUserForImpersonation); return new HBaseMetadataService(ConnectionFactory.createConnection(hbaseConfig, user) .getAdmin(), securityContext, subject, user, hbaseMaster, hbaseMasterProcesses); } else { return new HBaseMetadataService(ConnectionFactory.createConnection(hbaseConfig).getAdmin(), securityContext, subject, null, hbaseMaster, hbaseMasterProcesses); } }
Source:
<code>public DeferredItem(Rectangle bounds, RGBAColor backgroundColor, RGBAColor foregroundColor, int alpha, int lineWidth) { fBounds = bounds; fLineWidth = lineWidth; <START> fBgColor = backgroundColor == null ? null : RGBAUtil.fromRGBAColor(backgroundColor); <END> if (fBgColor != null) { fBgColor.alpha = alpha; } fFgColor = foregroundColor == null ? null : RGBAUtil.fromRGBAColor(foregroundColor); }</code><technical_language>Converting RGBAColor RGBA, RGBA int. store RGBAColor</technical_language>

Target:
public DeferredItem(Rectangle bounds, RGBAColor backgroundColor, RGBAColor foregroundColor, int alpha, int lineWidth) { fBounds = bounds; fLineWidth = lineWidth; if (backgroundColor == null) { fBgColor = OPAQUE; } else if (backgroundColor.getAlpha() != alpha) { fBgColor = new RGBAColor(backgroundColor.getRed(), backgroundColor.getGreen(), backgroundColor.getBlue(), alpha); } else { fBgColor = backgroundColor; } fFgColor = foregroundColor; }
Source:
<code>public boolean getFlagDown() { if (flagdown == true) { return true; } else{ return false; } <START> } <END></code><technical_language>return flagdown;</technical_language>

Target:
public boolean getFlagDown() { return this.flagdown; }
Source:
<code>public String[] getServerIDs() { ArrayList<String> serverIDs = new ArrayList<String>(); SQLiteDatabase db = mContext.openOrCreateDatabase( DatabaseUtils.getDBName("base", category), Context.MODE_PRIVATE, null); try { Cursor cursor = db.rawQuery("select serverID from words", null); while (cursor.moveToNext()) { serverIDs.add(cursor.getString(0)); } return serverIDs.toArray(new String[0]); <START> } catch (Exception e) { <END> return serverIDs.toArray(new String[0]); } finally { db.close(); } }</code><technical_language>this catch? I feel related category feature. write some doc more</technical_language>

Target:
public String[] getServerIDs() { ArrayList<String> serverIDs = new ArrayList<String>(); SQLiteDatabase db = mContext.openOrCreateDatabase( DatabaseUtils.getDBName("base", category), Context.MODE_PRIVATE, null); try { Cursor cursor = db.rawQuery("select serverID from words", null); while (cursor.moveToNext()) { serverIDs.add(cursor.getString(0)); } return serverIDs.toArray(new String[0]); } finally { db.close(); } }
Source:
<code>private void addPairs(TaggedValuePointable tvp1) throws IOException, SystemException { op = (ObjectPointable) ObjectPointable.FACTORY.createPointable(); tvp1.getValue(op); op.getKeys(tvp1); if (tvp1.getTag() == ValueTag.XS_STRING_TAG) { addPair(tvp1); } else if (tvp1.getTag() == ValueTag.SEQUENCE_TAG) { tvp1.getValue(sp1); for (int j = 0; j < sp1.getEntryCount(); ++j) { <START> key = ppool.takeOne(TaggedValuePointable.class); <END> sp1.getEntry(j, tvp1); addPair(tvp1); } } }</code><technical_language>key is used</technical_language>

Target:
private void addPairs(TaggedValuePointable tvp1) throws IOException, SystemException { ObjectPointable op = (ObjectPointable) ObjectPointable.FACTORY.createPointable(); tvp1.getValue(op); op.getKeys(tvp1); if (tvp1.getTag() == ValueTag.XS_STRING_TAG) { addPair(tvp1, op); } else if (tvp1.getTag() == ValueTag.SEQUENCE_TAG) { tvp1.getValue(sp1); for (int j = 0; j < sp1.getEntryCount(); ++j) { sp1.getEntry(j, tvp1); addPair(tvp1, op); } } }