auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void shutdown() { if (_producers.size() == 0) { return; } LOG.info("Shutting down all producers in event producer pool"); for (Map<String, EventProducer> producerMap : _producers.values()) { <START> producerMap.values().forEach(producer -> producer.shutdown()); <END> } }</code><technical_language>clear producerMap</technical_language>

Target:
public synchronized void shutdown() { if (_producers.size() == 0) { return; } LOG.info("Shutting down all producers in event producer pool"); for (Map<String, EventProducer> producerMap : _producers.values()) { producerMap.values().forEach(producer -> producer.shutdown()); } _producers.clear(); }
Source:
<code>protected void mapSecondaryIndexes(K key, V value) { if (value == null) { <START> log.trace("Attempting to build an index with a null value, skipping."); <END> return; } try { for (Index<K, V, ? extends Comparable> index : indexSpec) { String indexName = index.getName().get(); Map<Comparable, Map<K, V>> secondaryIndex = secondaryIndexes.get(indexName); for (Comparable indexKey : index.getMultiValueIndexFunction().apply(key, value)) { Map<K, V> slot = secondaryIndex.computeIfAbsent(indexKey, k -> new HashMap<>()); slot.put(key, value); } } } catch (Exception e) { log.error("Received an exception while computing the index. " + "This is most likely an issue with the client's indexing function. {}", e); clearIndex(); throw e; } }</code><technical_language>Warn level</technical_language>

Target:
protected void mapSecondaryIndexes(K key, V value) { if (value == null) { log.warn("Attempting to build an index with a null value, skipping."); return; } try { for (Index<K, V, ? extends Comparable> index : indexSpec) { String indexName = index.getName().get(); Map<Comparable, Map<K, V>> secondaryIndex = secondaryIndexes.get(indexName); for (Comparable indexKey : index.getMultiValueIndexFunction().apply(key, value)) { Map<K, V> slot = secondaryIndex.computeIfAbsent(indexKey, k -> new HashMap<>()); slot.put(key, value); } } } catch (Exception e) { log.error("Received an exception while computing the index. " + "This is most likely an issue with the client's indexing function.", e); clearIndex(); throw e; } }
Source:
<code>private Runnable makeFlyWeightTaskBuildable(final BuildableItem p){ if (p.task instanceof FlyweightTask) { Jenkins h = Jenkins.getInstance(); Map<Node, Integer> hashSource = new HashMap<Node, Integer>(h.getNodes().size()); hashSource.put(h, Math.max(h.getNumExecutors() * 100, 1)); for (Node n : h.getNodes()) { hashSource.put(n, n.getNumExecutors() * 100); } ConsistentHash<Node> hash = new ConsistentHash<Node>(NODE_HASH); hash.addAll(hashSource); Label lbl = p.getAssignedLabel(); for (Node n : hash.list(p.task.getFullDisplayName())) { final Computer c = n.toComputer(); if (c == null || c.isOffline()) { continue; } if (lbl!=null && !lbl.contains(n)) { continue; } if (n.canTake(p) != null) { continue; } <START> LOGGER.log(Level.FINE, "Creating flyweight task {0} for machine {1}", new Object[]{p.task, c.getName()}); <END> return new Runnable() { @Override public void run() { c.startFlyWeightTask(new WorkUnitContext(p).createWorkUnit(p.task)); makePending(p); } }; } } return null; }</code><technical_language>"machine". a new term... "computer", "node", "slave", etc</technical_language>

Target:
private Runnable makeFlyWeightTaskBuildable(final BuildableItem p){ if (p.task instanceof FlyweightTask) { Jenkins h = Jenkins.getInstance(); Map<Node, Integer> hashSource = new HashMap<Node, Integer>(h.getNodes().size()); hashSource.put(h, Math.max(h.getNumExecutors() * 100, 1)); for (Node n : h.getNodes()) { hashSource.put(n, n.getNumExecutors() * 100); } ConsistentHash<Node> hash = new ConsistentHash<Node>(NODE_HASH); hash.addAll(hashSource); Label lbl = p.getAssignedLabel(); for (Node n : hash.list(p.task.getFullDisplayName())) { final Computer c = n.toComputer(); if (c == null || c.isOffline()) { continue; } if (lbl!=null && !lbl.contains(n)) { continue; } if (n.canTake(p) != null) { continue; } LOGGER.log(Level.FINEST, "Creating flyweight task {0} for computer {1}", new Object[]{p.task.getFullDisplayName(), c.getName()}); return new Runnable() { @Override public void run() { c.startFlyWeightTask(new WorkUnitContext(p).createWorkUnit(p.task)); makePending(p); } }; } } return null; }
Source:
<code>public final void testWindow1() throws Exception { <START> ResultSet res = executeString("SELECT sum(l_quantity) OVER () FROM LINEITEM"); <END> assertResultSet(res); cleanupQuery(res); }</code><technical_language>Do reasons of execute SQLs instead of executing queries files in other tests</technical_language>

Target:
public final void testWindow1() throws Exception { ResultSet res = executeQuery(); assertResultSet(res); cleanupQuery(res); }
Source:
<code>private void fillJunk(SolGame game, RemoveController remover, SpaceEnvConfig conf, Vector2 chunkCenter) { if (conf == null) { return; } int count = getEntityCount(conf.junkDensity); if (count == 0) { return; } for (int i = 0; i < count; i++) { Vector2 junkPos = getRndPos(chunkCenter); <<<<<<< HEAD TextureAtlas.AtlasRegion tex = new TextureAtlas.AtlasRegion(SolRandom.randomElement(conf.junkTexs)); ======= TextureAtlas.AtlasRegion tex = new TextureAtlas.AtlasRegion(SolMath.elemRnd(conf.junkTextures)); <START> >>>>>>> 4df19c3... Some renaming and refactoring of basically everything, yet another round <END> if (SolRandom.test(.5f)) { tex.flip(!tex.isFlipX(), !tex.isFlipY()); } float sz = SolRandom.randomFloat(.3f, 1) * JUNK_MAX_SZ; float rotationSpeed = SolRandom.randomFloat(JUNK_MAX_ROT_SPD); RectSprite s = new RectSprite(tex, sz, 0, 0, new Vector2(), DrawableLevel.DECO, SolRandom.randomFloat(180), rotationSpeed, SolColor.LG, false); ArrayList<Drawable> drawables = new ArrayList<>(); drawables.add(s); Vector2 speed = new Vector2(); SolMath.fromAl(speed, SolRandom.randomFloat(180), SolRandom.randomFloat(JUNK_MAX_SPD_LEN)); FarDrawable so = new FarDrawable(drawables, junkPos, speed, remover, true); game.getObjectManager().addFarObjNow(so); } }</code><technical_language>WTH, vampy... gotta try harder</technical_language>

Target:
private void fillJunk(SolGame game, RemoveController remover, SpaceEnvConfig conf, Vector2 chunkCenter) { if (conf == null) { return; } int count = getEntityCount(conf.junkDensity); if (count == 0) { return; } for (int i = 0; i < count; i++) { Vector2 junkPos = getRndPos(chunkCenter); TextureAtlas.AtlasRegion tex = new TextureAtlas.AtlasRegion(SolRandom.randomElement(conf.junkTextures)); if (SolRandom.test(.5f)) { tex.flip(!tex.isFlipX(), !tex.isFlipY()); } float sz = SolRandom.randomFloat(.3f, 1) * JUNK_MAX_SZ; float rotationSpeed = SolRandom.randomFloat(JUNK_MAX_ROT_SPD); RectSprite s = new RectSprite(tex, sz, 0, 0, new Vector2(), DrawableLevel.DECO, SolRandom.randomFloat(180), rotationSpeed, SolColor.LG, false); ArrayList<Drawable> drawables = new ArrayList<>(); drawables.add(s); Vector2 speed = new Vector2(); SolMath.fromAl(speed, SolRandom.randomFloat(180), SolRandom.randomFloat(JUNK_MAX_SPD_LEN)); FarDrawable so = new FarDrawable(drawables, junkPos, speed, remover, true); game.getObjectManager().addFarObjNow(so); } }
Source:
<code>public boolean deleteFile(File file, boolean recursive) { if (recursive) { return this.deleteRecursive(file); } <START> return file.delete(); <END> }</code><technical_language>deleteFile(file)</technical_language>

Target:
public boolean deleteFile(File file, boolean recursive) { if (recursive) { return this.deleteRecursive(file); } return this.deleteFile(file); }
Source:
<code>private static InputStream inflate(final InputStream in, final long size, final ObjectId id) { final Inflater inf = InflaterCache.get(); return new InflaterInputStream(in, inf) { private long remaining = size; @Override public int read(byte[] b, int off, int cnt) throws IOException { try { int r = super.read(b, off, cnt); if (r > 0) remaining -= r; return r; } catch (ZipException badStream) { throw new CorruptObjectException(id, JGitText.get().corruptObjectBadStream); } } @Override public void close() throws IOException { try { if (remaining <= 0) checkValidEndOfStream(in, inf, id, new byte[64]); } finally { super.close(); <START> InflaterCache.release(inf); <END> } } }; }</code><technical_language>I flip order release Inflater first. basically fail, while super.close() throw some other sort of exception. cherry-pick change</technical_language>

Target:
private static InputStream inflate(final InputStream in, final long size, final ObjectId id) { final Inflater inf = InflaterCache.get(); return new InflaterInputStream(in, inf) { private long remaining = size; @Override public int read(byte[] b, int off, int cnt) throws IOException { try { int r = super.read(b, off, cnt); if (r > 0) remaining -= r; return r; } catch (ZipException badStream) { throw new CorruptObjectException(id, JGitText.get().corruptObjectBadStream); } } @Override public void close() throws IOException { try { if (remaining <= 0) checkValidEndOfStream(in, inf, id, new byte[64]); } finally { InflaterCache.release(inf); super.close(); } } }; }
Source:
<code>public void cleanUp() { if (executor != null) { executor.shutdownNow(); } if (queryCanceller != null) { <START> queryCanceller.close(); <END> } }</code><technical_language>Closer ensure complete cleanup matter</technical_language>

Target:
public void cleanUp() throws IOException { closer.close(); }
Source:
<code>public RemoveLocalProjectsFolderOnWorkspaceRemove( LocalProjectsFolderPathProvider workspaceFolderPathProvider) { this.workspaceFolderPathProvider = workspaceFolderPathProvider; executor = Executors.newCachedThreadPool( new ThreadFactoryBuilder() .setNameFormat("RemoveLocalProjectsFolderOnWorkspaceRemove-%d") .setUncaughtExceptionHandler(LoggingUncaughtExceptionHandler.getInstance()) <START> .setDaemon(true) <END> .build()); }</code><technical_language>In this case, untraced unremoved folders litter system. non-daemon threads instead</technical_language>

Target:
public RemoveLocalProjectsFolderOnWorkspaceRemove( LocalProjectsFolderPathProvider workspaceFolderPathProvider) { this.workspaceFolderPathProvider = workspaceFolderPathProvider; executor = Executors.newCachedThreadPool( new ThreadFactoryBuilder() .setNameFormat("RemoveLocalProjectsFolderOnWorkspaceRemove-%d") .setUncaughtExceptionHandler(LoggingUncaughtExceptionHandler.getInstance()) .build()); }
Source:
<code>public void equals_hashCodeTest() { TimeRange range = new TimeRange(new Date(1), new Date(100)); AirConditionerState air = new AirConditionerState(); HumidityState hum = new HumidityState(); Date createdAd = new Date(1); <START> HistoryState airHS = new HistoryState<AirConditionerState>(air, createdAd); <END> HistoryState humHS = new HistoryState<HumidityState>(hum, createdAd); List<HistoryState> list1 = new ArrayList<HistoryState>(); list1.add(airHS); List<HistoryState> list2 = new ArrayList<HistoryState>(); list2.add(humHS); GroupedHistoryStates target = new GroupedHistoryStates(range, list1); GroupedHistoryStates sameOne = new GroupedHistoryStates(range, list1); GroupedHistoryStates differentOne = new GroupedHistoryStates(range, list2); Assert.assertTrue(target.equals(sameOne)); Assert.assertEquals(target.hashCode(), sameOne.hashCode()); Assert.assertFalse(target.equals(differentOne)); Assert.assertNotSame(target.hashCode(), differentOne.hashCode()); Assert.assertFalse(target.equals(null)); Assert.assertFalse(target.equals((Object)airHS)); }</code><technical_language>Please do raw type directly. java HistoryState<AirConditionerState> airHS = new HistoryState<>(air, createdAd); HistoryState<HumidityState> humHS = new HistoryState<>(hum, createdAd); List<HistoryState<AirConditionerState>> list1 = new ArrayList<>(); list1.add(airHS); List<HistoryState<HumidityState>> list2 = new ArrayList<>(); list2.add(humHS); GroupedHistoryStates<AirConditionerState> target = new GroupedHistoryStates<>(range, list1); GroupedHistoryStates<AirConditionerState> sameOne = new GroupedHistoryStates<>(range, list1); GroupedHistoryStates<HumidityState> differentOne = new GroupedHistoryStates<>(range, list2);</technical_language>

Target:
public void equals_hashCodeTest() { TimeRange range = new TimeRange(new Date(1), new Date(100)); AirConditionerState air = new AirConditionerState(); HumidityState hum = new HumidityState(); Date createdAd = new Date(1); HistoryState<AirConditionerState> airHS = new HistoryState<>(air, createdAd); HistoryState<HumidityState> humHS = new HistoryState<>(hum, createdAd); List<HistoryState<AirConditionerState>> list1 = new ArrayList<HistoryState<AirConditionerState>>(); list1.add(airHS); List<HistoryState<HumidityState>> list2 = new ArrayList<HistoryState<HumidityState>>(); list2.add(humHS); GroupedHistoryStates<AirConditionerState> target = new GroupedHistoryStates<>(range, list1); GroupedHistoryStates<AirConditionerState> sameOne = new GroupedHistoryStates<>(range, list1); GroupedHistoryStates<HumidityState> differentOne = new GroupedHistoryStates<>(range, list2); Assert.assertTrue(target.equals(sameOne)); Assert.assertEquals(target.hashCode(), sameOne.hashCode()); Assert.assertFalse(target.equals(differentOne)); Assert.assertNotSame(target.hashCode(), differentOne.hashCode()); Assert.assertFalse(target.equals(null)); Assert.assertFalse(target.equals((Object)airHS)); }
Source:
<code>protected void deactivate() { <START> lastKnownInterfaceAddresses = null; <END> networkAddressChangeListeners = null; if (lastInterfacePollJob != null && expressionThreadPoolExecutor != null) { expressionThreadPoolExecutor.remove(lastInterfacePollJob); lastInterfacePollJob = null; expressionThreadPoolExecutor = null; } }</code><technical_language>set empty lists safe iterate in cases null checks? I this is deactivate method, still, a Collection IMHO null</technical_language>

Target:
protected void deactivate() { lastKnownInterfaceAddresses = Collections.emptyList(); networkAddressChangeListeners = ConcurrentHashMap.newKeySet(); if (networkInterfacePollFuture != null) { networkInterfacePollFuture.cancel(true); networkInterfacePollFuture = null; scheduledExecutorService = null; } }
Source:
<code>protected void assertContentEquals(IStorage storage, String expectedContents) throws Exception { Scanner scanner = null; try { scanner = new Scanner(storage.getContents()).useDelimiter("\\A"); String fileContent = ""; if (scanner.hasNext()) { fileContent = scanner.next(); } assertEquals(expectedContents, fileContent); } <START> finally { if (scanner != null) scanner.close(); } <END> }</code><technical_language>try-with-resource instead: try (Scanner scanner = new Scanner() { }</technical_language>

Target:
protected void assertContentEquals(IStorage storage, String expectedContents) throws Exception { try (Scanner scanner = new Scanner(storage.getContents())) { scanner.useDelimiter("\\A"); String fileContent = ""; if (scanner.hasNext()) { fileContent = scanner.next(); } assertEquals(expectedContents, fileContent); } }
Source:
<code>public V computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) { checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED); while (true) { Data oldValueData = toData(getInternal(key)); if (oldValueData == null) { return null; } V oldValueClone = toObject(oldValueData); V newValue = remappingFunction.apply(key, oldValueClone); if (newValue != null) { if (replaceInternal(key, oldValueData, toData(newValue))) { return newValue; } } else if (removeInternal(key, oldValueData)) { return null; } } <START> } <END></code><technical_language>I this is main issue needs resolved. problem is this implementation consume a lot of resources of retrying long latency. end in a livelock. approach is get done in a single remote call. is retrying needed operation exclusive access partition</technical_language>

Target:
public V computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) { checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED); checkNotNull(key, NULL_BIFUNCTION_IS_NOT_ALLOWED); Version clusterVersion = getNodeEngine().getClusterService().getClusterVersion(); if (SerializationUtil.isClassStaticAndSerializable(remappingFunction) && clusterVersion.isGreaterOrEqual(Versions.V4_1)) { BiFunctionExecutingEntryProcessor<K, V> ep = new BiFunctionExecutingEntryProcessor<>(remappingFunction); return executeOnKey(key, ep); } else { return computeIfPresentLocally(key, remappingFunction); } }
Source:
<code>protected android.app.Notification getNotification(@NonNull Context context, @NonNull Intent intent) { final BaseNotificationPayload payload = ParseHandleHelper.extractPayload(intent); if (null != payload && null != payload.getAction()) { switch (payload.getAction()) { case ParseHandleHelper.COURSE_ANNOUNCEMENT_ACTION: { final CourseUpdateNotificationPayload courseUpdateNotificationPayload = (CourseUpdateNotificationPayload) payload; getSegment(context).trackNotificationReceived(courseUpdateNotificationPayload.getCourseId()); return newNotificationBuilder(context, intent) .setContentTitle(context.getString(R.string.COURSE_ANNOUNCEMENT_NOTIFICATION_TITLE)) .setContentText(courseUpdateNotificationPayload.getCourseName()) <START> .build(); <END> } } } getSegment(context).trackNotificationReceived(""); return super.getNotification(context, intent); }</code><technical_language>If customize title text, change newNotificationBuilder() return a built Notification while accepting parameters. other hand, if anticipating arbitrary customizations (icon, sound, etc.), fine is</technical_language>

Target:
protected android.app.Notification getNotification(@NonNull Context context, @NonNull Intent intent) { final BaseNotificationPayload payload = ParseHandleHelper.extractPayload(intent); if (null != payload && null != payload.getAction()) { switch (payload.getAction()) { case ParseHandleHelper.COURSE_ANNOUNCEMENT_ACTION: { final CourseUpdateNotificationPayload courseUpdateNotificationPayload = (CourseUpdateNotificationPayload) payload; segment.trackNotificationReceived(courseUpdateNotificationPayload.getCourseId()); return newNotificationBuilder(context, intent) .setContentTitle(context.getString(R.string.COURSE_ANNOUNCEMENT_NOTIFICATION_TITLE)) .setContentText(courseUpdateNotificationPayload.getCourseName()) .build(); } } } segment.trackNotificationReceived(null); return super.getNotification(context, intent); }
Source:
<code>public List<String> complete(final CommandContext context) { <START> return context.getCause().first(Audience.class) <END> .map(src -> SpongePaginationService.this.getPaginationState(src, false)) .map(paginations -> ImmutableList.copyOf(Iterables.transform(paginations.keys(), Object::toString))) .orElseGet(ImmutableList::of); }</code><technical_language>first(Audience.class) -> .getAudience() (audiences do special handling in command causes)</technical_language>

Target:
public List<String> complete(final CommandContext context) { final Audience audience = context.getCause().getAudience(); final SourcePaginations paginations = SpongePaginationService.this.getPaginationState(audience, false); if (paginations != null) { return ImmutableList.copyOf(Iterables.transform(paginations.keys(), Object::toString)); } return ImmutableList.of(); }
Source:
<code>public Observable<List<CenterInfo>> saveCenterSummaryInfo(final List<CenterInfo> centerInfos, final int centerId) { <START> AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() { <END> @Override public void run() { for (CenterInfo centerInfo : centerInfos) { centerInfo.setId(centerId); centerInfo.save(); } } }); return Observable.just(centerInfos); }</code><technical_language>AsyncTask.THREAD_POOL_EXECUTOR Observable.defer()</technical_language>

Target:
public Observable<List<CenterInfo>> saveCenterSummaryInfo(final List<CenterInfo> centerInfos, final int centerId) { return Observable.defer(new Func0<Observable<List<CenterInfo>>>() { @Override public Observable<List<CenterInfo>> call() { for (CenterInfo centerInfo : centerInfos) { centerInfo.setId(centerId); centerInfo.save(); } return Observable.just(centerInfos); } }); }
Source:
<code>protected void unsetHttpClientFactory(final HttpClientFactory httpClientFactory) { <START> if (HttpUtil.httpClientFactory == httpClientFactory) { <END> HttpUtil.httpClientFactory = null; } }</code><technical_language>This if check necessary service reference is injected static policy</technical_language>

Target:
protected void unsetHttpClientFactory(final HttpClientFactory httpClientFactory) { HttpUtil.httpClientFactory = null; }
Source:
<code>public void testCreateFileUnauthorized() throws Exception { final AzureBlobFileSystem fs = this.getFileSystem(); Path testFilePath = new Path( TEST_READ_ONLY_FILE_PATH_PREFIX_0 + name.getMethodName()); <START> intercept(AbfsAuthorizationException.class, () -> { <END> fs.create(testFilePath).close(); }); }</code><technical_language>good check fails: in create in close</technical_language>

Target:
public void testCreateFileUnauthorized() throws Exception { runTest(FileSystemOperations.CreatePath, true); }
Source:
<code><START> void strAlgo() { <END> StringMatchResult matchResult = redis.stralgo(StrAlgoArgs.Builder .strings("ohmytext", "mynewtext")); assertThat(matchResult.getMatchString()).isEqualTo("mytext"); matchResult = redis.stralgo(StrAlgoArgs.Builder .strings("ohmytext", "mynewtext").justLen()); assertThat(matchResult.getLen()).isEqualTo(6); matchResult = redis.stralgo(StrAlgoArgs.Builder .strings("ohmytext", "mynewtext").minMatchLen(4)); assertThat(matchResult.getMatchString()).isEqualTo("mytext"); matchResult = redis.stralgo(StrAlgoArgs.Builder .strings("ohmytext", "mynewtext").minMatchLen(4).withIdx().withMatchLen()); assertThat(matchResult.getMatches()).hasSize(1); assertThat(matchResult.getMatches().get(0).getMatchLen()).isEqualTo(4); Position a = matchResult.getMatches().get(0).getA(); Position b = matchResult.getMatches().get(0).getB(); assertThat(a.getStart()).isEqualTo(4); assertThat(a.getEnd()).isEqualTo(7); assertThat(b.getStart()).isEqualTo(5); assertThat(b.getEnd()).isEqualTo(8); assertThat(matchResult.getLen()).isEqualTo(6); matchResult = redis.stralgo(StrAlgoArgs.Builder .strings("a", "b").minMatchLen(4).withIdx().withMatchLen()); assertThat(matchResult.getMatchString()).isNullOrEmpty(); assertThat(matchResult.getLen()).isEqualTo(0); }</code><technical_language>Please split this method multiple test methods test scenario individually</technical_language>

Target:
void strAlgo() { StringMatchResult matchResult = redis.stralgoLcs(StrAlgoArgs.Builder .strings("ohmytext", "mynewtext")); assertThat(matchResult.getMatchString()).isEqualTo("mytext"); matchResult = redis.stralgoLcs(StrAlgoArgs.Builder .strings("a", "b").minMatchLen(4).withIdx().withMatchLen()); assertThat(matchResult.getMatchString()).isNullOrEmpty(); assertThat(matchResult.getLen()).isEqualTo(0); }
Source:
<code>public void testCreateEmailMessage() throws Exception{ URL url = Resources.getResource("conf/emailtest/azkaban.properties"); InputStream inputStream = new FileInputStream(url.getFile()); Properties properties = new Properties(); <START> properties.load(inputStream); <END> Props props = new Props(); props.put(properties); props.put("server.port","114"); props.put("jetty.use.ssl","false"); props.put("server.useSSL","false"); props.put("jetty.port","8786"); Emailer emailer = new Emailer(props); EmailMessage emailMessage = emailer.createEmailMessage("subject","text/html",senderList); assert(properties.getProperty("mail.user").equals(emailer.getMailUser())); int mailport = Integer.parseInt((String)properties.getOrDefault("mail.port","25")); assert emailer.getMailPort()== mailport; assert emailMessage.getMailPort() == mailport; }</code><technical_language>advantage of loading properties resource file instead of previous approach</technical_language>

Target:
public void testCreateEmailMessage(){ Emailer emailer = new Emailer(props); EmailMessage em = emailer.createEmailMessage("subject","text/html",receiveAddrList); assert em.getMailPort() == mailPort; }
Source:
<code>public DataAccount restoreDataAccount(DataAccount dataAccount) throws DataAccessException { DataAccount restoredDataAccount = null; final String restoreDataAccountQuery = String .format("UPDATE `dataaccount` SET `username`='%s', `created`=NOW(), `password`=AES_ENCRYPT('%s',UNHEX('%s')), `properties`='%s', `deleted`='n' WHERE `id`='%d' AND `deleted`='y'", addslashes(dataAccount.username), addslashes(dataAccount.password), key(), addslashes(dataAccount.properties), dataAccount.id.longValue()); <START> final String restoreUserDataAccountQuery = String.format("UPDATE `userdataaccount` SET `deleted`='n' WHERE `dataaccountid`=%d AND `deleted`='y'", <END> dataAccount.id.longValue()); Connection dataAccountConnection = DatabaseServiceProvider.provide().getNamedConnection(DatabaseType.DatabaseTypeDataAccount.toString()); try { dataAccountConnection.connect(); dataAccountConnection.executeQuery(restoreDataAccountQuery); dataAccountConnection.executeQuery(restoreUserDataAccountQuery); if (dataAccountConnection.getAffectedRowCount() > 0) { restoredDataAccount = getDataAccount(dataAccount.id); } } finally { if (dataAccountConnection != null) { dataAccountConnection.disconnect(); } } if (restoredDataAccount != null) { enqueue(restoredDataAccount, 30, false); } return restoredDataAccount; }</code><technical_language>restore user data account happening here... done in user service</technical_language>

Target:
public DataAccount restoreDataAccount(DataAccount dataAccount) throws DataAccessException { DataAccount restoredDataAccount = null; final String restoreDataAccountQuery = String .format("UPDATE `dataaccount` SET `created`=NOW(), `password`=AES_ENCRYPT('%s',UNHEX('%s')), `properties`='%s', `deleted`='n' WHERE `username`='%s'", addslashes(dataAccount.password), key(), addslashes(dataAccount.properties), addslashes(dataAccount.username)); Connection dataAccountConnection = DatabaseServiceProvider.provide().getNamedConnection(DatabaseType.DatabaseTypeDataAccount.toString()); try { dataAccountConnection.connect(); dataAccountConnection.executeQuery(restoreDataAccountQuery); if (dataAccountConnection.getAffectedRowCount() > 0) { dataAccount = getDataAccount(dataAccount.username, dataAccount.source.id); restoredDataAccount = getDataAccount(dataAccount.id); } } finally { if (dataAccountConnection != null) { dataAccountConnection.disconnect(); } } if (restoredDataAccount != null) { enqueue(restoredDataAccount, 30, false); } return restoredDataAccount; }
Source:
<code>public final Object visitInvalidateCommand(InvocationContext ctx, InvalidateCommand command) throws Throwable { try { if (hasSkipLocking(command)) { return invokeNextInterceptor(ctx, command); } <START> lockAllAndRecord(ctx, Arrays.stream(command.getKeys()), getLockTimeoutMillis(command)); <END> return invokeNextInterceptor(ctx, command); } finally { if (!ctx.isInTxScope()) { lockManager.unlockAll(ctx); } } }</code><technical_language>Arrays.asList() enough here? Arrays.stream a lot of memory overhead</technical_language>

Target:
public final Object visitInvalidateCommand(InvocationContext ctx, InvalidateCommand command) throws Throwable { try { if (hasSkipLocking(command)) { return invokeNextInterceptor(ctx, command); } lockAllAndRecord(ctx, Arrays.asList(command.getKeys()), getLockTimeoutMillis(command)); return invokeNextInterceptor(ctx, command); } finally { if (!ctx.isInTxScope()) { lockManager.unlockAll(ctx); } } }
Source:
<code>public void init(Context context) { <START> Preconditions.checkNotNull(context, "Cannot pass null context"); <END> tableContexts.values().forEach(ctx -> ctx.tableProvider.init(context)); initialized = true; }</code><technical_language>"Context null". Also, this a framework guarantee? unnecessary assert this</technical_language>

Target:
public void init(Context context) { tableContexts.values().forEach(ctx -> ctx.tableProvider.init(context)); initialized = true; }
Source:
<code>private int loadIntParam(String name, FilterConfig filterConfig, int defaultValue) { int result = defaultValue; String fParam = filterConfig.getInitParameter(name); if (fParam != null) { result = parseInt(fParam); } String sParam = <START> System.getProperty("blazegraph." <END> + filterConfig.getFilterName() + "." + name); if (sParam != null) { result = parseInt(sParam); } return result; }</code><technical_language>I "wdqs" this functionality is Blazegraph one</technical_language>

Target:
private int loadIntParam(String name, FilterConfig filterConfig, int defaultValue) { String result = loadStringParam(name, filterConfig); return result != null ? parseInt(result) : defaultValue; }
Source:
<code>public static void encodeNullsAsBits(SliceOutput sliceOutput, Block block) { boolean mayHaveNull = block.mayHaveNull(); <START> sliceOutput.appendByte(mayHaveNull ? 1 : 0); <END> if (!mayHaveNull) { return; } int positionCount = block.getPositionCount(); for (int position = 0; position < (positionCount & ~0b111); position += 8) { byte value = 0; value |= block.isNull(position) ? 0b1000_0000 : 0; value |= block.isNull(position + 1) ? 0b0100_0000 : 0; value |= block.isNull(position + 2) ? 0b0010_0000 : 0; value |= block.isNull(position + 3) ? 0b0001_0000 : 0; value |= block.isNull(position + 4) ? 0b0000_1000 : 0; value |= block.isNull(position + 5) ? 0b0000_0100 : 0; value |= block.isNull(position + 6) ? 0b0000_0010 : 0; value |= block.isNull(position + 7) ? 0b0000_0001 : 0; sliceOutput.appendByte(value); } if ((positionCount & 0b111) > 0) { byte value = 0; int mask = 0b1000_0000; for (int position = positionCount & ~0b111; position < positionCount; position++) { value |= block.isNull(position) ? mask : 0; mask >>>= 1; } sliceOutput.appendByte(value); } }</code><technical_language>sliceOutput.writeBoolean(mayHaveNull)</technical_language>

Target:
public static void encodeNullsAsBits(SliceOutput sliceOutput, Block block) { boolean mayHaveNull = block.mayHaveNull(); sliceOutput.writeBoolean(mayHaveNull); if (!mayHaveNull) { return; } int positionCount = block.getPositionCount(); for (int position = 0; position < (positionCount & ~0b111); position += 8) { byte value = 0; value |= block.isNull(position) ? 0b1000_0000 : 0; value |= block.isNull(position + 1) ? 0b0100_0000 : 0; value |= block.isNull(position + 2) ? 0b0010_0000 : 0; value |= block.isNull(position + 3) ? 0b0001_0000 : 0; value |= block.isNull(position + 4) ? 0b0000_1000 : 0; value |= block.isNull(position + 5) ? 0b0000_0100 : 0; value |= block.isNull(position + 6) ? 0b0000_0010 : 0; value |= block.isNull(position + 7) ? 0b0000_0001 : 0; sliceOutput.appendByte(value); } if ((positionCount & 0b111) > 0) { byte value = 0; int mask = 0b1000_0000; for (int position = positionCount & ~0b111; position < positionCount; position++) { value |= block.isNull(position) ? mask : 0; mask >>>= 1; } sliceOutput.appendByte(value); } }
Source:
<code>private boolean isLocationOutdated() { if (locationProvider.getLastKnownLocation() != null) { <START> return System.currentTimeMillis() - locationProvider.getLastKnownLocation().getTime() > <END> OsmAndLocationProvider.LOCATION_SHELF_LIFE_FOR_ICON; } return false; }</code><technical_language>Do need call time ? System.currentTimeMillis() ? Practically 60 times a second</technical_language>

Target:
private boolean isLocationOutdated() { if (locationProvider.getLastKnownLocation() != null && updatesCounter == 0) { updatesCounter++; return System.currentTimeMillis() - locationProvider.getLastKnownLocation().getTime() > OsmAndLocationProvider.STALE_LOCATION_TIMEOUT_FOR_ICON; } else { if (updatesCounter == UPDATES_BEFORE_CHECK_LOCATION) { updatesCounter = 0; } else { updatesCounter++; } } return locationOutdated; }
Source:
<code>public ValidationResult canRebalance(GlusterVolumeEntity volumeEntity) { int replicaCount = 0; List<GlusterBrickEntity> bricks = volumeEntity.getBricks(); if (volumeEntity.getVolumeType().isReplicatedType()) { replicaCount = volumeEntity.getReplicaCount(); } else { <START> replicaCount = 1; <END> } int brickIndex = 0, replicaIndex = 0; while (brickIndex < bricks.size()) { for (replicaIndex = 0; replicaIndex < replicaCount; replicaIndex++) { if (bricks.get(brickIndex + replicaIndex).isOnline()) { brickIndex = brickIndex + replicaCount; break; } } if (replicaIndex == replicaCount) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_ONE_OR_MORE_BRICKS_ARE_DOWN); } } return ValidationResult.VALID; }</code><technical_language>avoid this, if replicaCount = 1 in declaration</technical_language>

Target:
public ValidationResult canRebalance(GlusterVolumeEntity volumeEntity) { int replicaCount = 1; List<GlusterBrickEntity> bricks = volumeEntity.getBricks(); if (volumeEntity.getVolumeType().isReplicatedType()) { replicaCount = volumeEntity.getReplicaCount(); } int brickIndex = 0, replicaIndex = 0; while (brickIndex < bricks.size()) { for (replicaIndex = 0; replicaIndex < replicaCount; replicaIndex++) { if (bricks.get(brickIndex + replicaIndex).isOnline()) { brickIndex = brickIndex + replicaCount; break; } } if (replicaIndex == replicaCount) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_ONE_OR_MORE_BRICKS_ARE_DOWN); } } return ValidationResult.VALID; }
Source:
<code>private void performDiscardChanges() { for (final IResource res : getSelectedResources()) { final Repository repository = getRepository(true); String workingDirPath = repository.getWorkDir().getAbsolutePath().toString(); String resPath = res.getLocation().toOSString(); resPath = resPath.replaceFirst(workingDirPath, ""); resPath = resPath.substring(1); try { Entry e = repository.getIndex().getEntry(resPath); repository.getIndex().checkoutEntry(repository.getWorkDir(), e); res.refreshLocal(0, new NullProgressMonitor()); } catch (IOException e1) { ErrorDialog .openError( getShell(), <START> "Error during checkout", <END> "Some of the selected resources could not be checked out", new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, TeamUIMessages.TeamAction_internal, e1)); } catch (CoreException e) { ErrorDialog .openError( getShell(), "Error during refresh", "Some of the selected resources could not be refreshed", new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, TeamUIMessages.TeamAction_internal, e)); } } }</code><technical_language>needs internatoinalized</technical_language>

Target:
private void performDiscardChanges() { for (final IResource res : getSelectedResources()) { final Repository repository = getRepository(true); String workingDirPath = repository.getWorkDir().getAbsolutePath().toString(); String resPath = res.getLocation().toOSString(); resPath = resPath.replaceFirst(workingDirPath, ""); resPath = resPath.substring(1); try { Entry e = repository.getIndex().getEntry(resPath); repository.getIndex().checkoutEntry(repository.getWorkDir(), e); res.refreshLocal(0, new NullProgressMonitor()); } catch (IOException e1) { ErrorDialog .openError( getShell(), UIText.DiscardChangesAction_confirmActionTitle, UIText.DiscardChangesAction_confirmActionMessage, new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, TeamUIMessages.TeamAction_internal, e1)); } catch (CoreException e) { ErrorDialog .openError( getShell(), UIText.DiscardChangesAction_refreshErrorTitle, UIText.DiscardChangesAction_refreshErrorMessage, new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, TeamUIMessages.TeamAction_internal, e)); } } }
Source:
<code>public Long countByChannelModuleName(String moduleName) { DynamicChannelProvider provider = getChannelProvider(moduleName); <START> if (provider != null) { <END> return provider.countTriggers(); } return null; }</code><technical_language>log if provider. This save some debugging time</technical_language>

Target:
public Long countByChannelModuleName(String moduleName) { DynamicChannelProvider provider = getChannelProvider(moduleName); if (provider != null) { return provider.countTriggers(); } else { LOGGER.debug(PROVIDER_NOT_FOUND, moduleName); } return null; }
Source:
<code>protected void addResponseHeaderForDownload(HttpCacheObject httpCacheObject, String originalFilename) { if (StringUtility.isNullOrEmpty(originalFilename)) { originalFilename = DEFAULT_FILENAME; } <START> originalFilename = originalFilename.replaceAll("[\\x00-\\x1F]", ""); <END> String isoFilename = getIsoFilename(originalFilename); isoFilename = StringUtility.replace(isoFilename, "\"", ""); if (StringUtility.isNullOrEmpty(isoFilename)) { isoFilename = DEFAULT_FILENAME; } httpCacheObject.addHttpResponseInterceptor(new HttpResponseHeaderContributor( "Content-Disposition", "attachment; filename=\"" + isoFilename + "\"; filename*=utf-8''" + IOUtility.urlEncode(originalFilename))); }</code><technical_language>move this line of code L100, default file name is remaining string is empty (see L120)</technical_language>

Target:
protected void addResponseHeaderForDownload(HttpCacheObject httpCacheObject, String originalFilename) { httpCacheObject.addHttpResponseInterceptor(new HttpResponseHeaderContributor( "Content-Disposition", getContentDispositionHeaderValue(originalFilename))); }
Source:
<code>public Collection<Ref> call() throws GitAPIException, JGitInternalException { checkCallable(); Transport transport = null; FetchConnection fc = null; try { transport = Transport.open(repo, remote); transport.setOptionUploadPack(uploadPack); configure(transport); Collection<RefSpec> refSpecs = new ArrayList<RefSpec>(1); if (tags) refSpecs.add(new RefSpec( "refs/tags/*:refs/remotes/origin/tags/*")); if (heads) refSpecs.add(new RefSpec("refs/heads/*:refs/remotes/origin/*")); Collection<Ref> refs; Map<String, Ref> refmap = new HashMap<String, Ref>(); fc = transport.openFetch(); refs = fc.getRefs(); if (refSpecs.isEmpty()) for (Ref r : refs) refmap.put(r.getName(), r); else for (Ref r : refs) for (RefSpec rs : refSpecs) if (rs.matchSource(r)) { refmap.put(r.getName(), r); break; } return refmap.values(); } catch (URISyntaxException e) { throw new InvalidRemoteException(MessageFormat.format( JGitText.get().invalidRemote, remote)); } catch (NotSupportedException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfLsRemoteCommand, e); } catch (TransportException e) { <START> Throwable cause = e.getCause(); <END> if (cause != null) throw new org.eclipse.jgit.api.errors.TransportException( e.getMessage(), cause); else throw new org.eclipse.jgit.api.errors.TransportException( e.getMessage()); } finally { if (fc != null) fc.close(); if (transport != null) transport.close(); } }</code><technical_language>TransportException is a wrapper for other exceptions, is thrown (sub)class is important, pass new cause</technical_language>

Target:
public Collection<Ref> call() throws GitAPIException, JGitInternalException { checkCallable(); Transport transport = null; FetchConnection fc = null; try { transport = Transport.open(repo, remote); transport.setOptionUploadPack(uploadPack); configure(transport); Collection<RefSpec> refSpecs = new ArrayList<RefSpec>(1); if (tags) refSpecs.add(new RefSpec( "refs/tags/*:refs/remotes/origin/tags/*")); if (heads) refSpecs.add(new RefSpec("refs/heads/*:refs/remotes/origin/*")); Collection<Ref> refs; Map<String, Ref> refmap = new HashMap<String, Ref>(); fc = transport.openFetch(); refs = fc.getRefs(); if (refSpecs.isEmpty()) for (Ref r : refs) refmap.put(r.getName(), r); else for (Ref r : refs) for (RefSpec rs : refSpecs) if (rs.matchSource(r)) { refmap.put(r.getName(), r); break; } return refmap.values(); } catch (URISyntaxException e) { throw new InvalidRemoteException(MessageFormat.format( JGitText.get().invalidRemote, remote)); } catch (NotSupportedException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfLsRemoteCommand, e); } catch (TransportException e) { throw new org.eclipse.jgit.api.errors.TransportException( JGitText.get().exceptionCaughtDuringExecutionOfLsRemoteCommand, e); } finally { if (fc != null) fc.close(); if (transport != null) transport.close(); } }
Source:
<code>public void testUpdateWithNoNetwork() throws Exception { VmNetworkInterface entity = getEntity(1, null); setUpGetEntityExpectations(2, entity); setUriInfo(setUpActionExpectations(VdcActionType.UpdateVmInterface, AddVmInterfaceParameters.class, new String[] { "VmId", "Interface.Id" }, new Object[] { PARENT_ID, GUIDS[1] }, true, true)); <START> NIC nic = getNic(false); <END> nic.setPortMirroring(null); nic = resource.update(nic); assertNotNull(nic); }</code><technical_language>Instead of null network, send empty network - test want</technical_language>

Target:
public void testUpdateWithNoNetwork() throws Exception { VmNetworkInterface entity = getEntity(1, null); setUpGetEntityExpectations(3, entity); setUriInfo(setUpActionExpectations(VdcActionType.UpdateVmInterface, AddVmInterfaceParameters.class, new String[] { "VmId", "Interface.Id" }, new Object[] { PARENT_ID, GUIDS[1] }, true, true)); NIC nic = getNic(false); nic.setNetwork(new Network()); nic.setPortMirroring(null); nic = resource.update(nic); assertNotNull(nic); }
Source:
<code>public Optional<ConnectorNewTableLayout> getNewTableLayout(ConnectorSession session, ConnectorTableMetadata metadata) { ImmutableMap.Builder<String, RaptorColumnHandle> map = ImmutableMap.builder(); long columnId = 1; <START> StorageTypeConverter storageTypeConverter = new StorageTypeConverter(typeManager); <END> for (ColumnMetadata column : metadata.getColumns()) { requireNonNull(storageTypeConverter.toStorageType(column.getType()), "storage type cannot be null"); map.put(column.getName(), new RaptorColumnHandle(connectorId, column.getName(), columnId, column.getType())); columnId++; } Optional<DistributionInfo> distribution = getOrCreateDistribution(map.build(), metadata.getProperties()); if (!distribution.isPresent()) { return Optional.empty(); } List<String> partitionColumns = distribution.get().getBucketColumns().stream() .map(RaptorColumnHandle::getColumnName) .collect(toList()); ConnectorPartitioningHandle partitioning = getPartitioningHandle(distribution.get().getDistributionId()); return Optional.of(new ConnectorNewTableLayout(partitioning, partitionColumns)); }</code><technical_language>FMHO, extract a small private function checks if a column's type is valid</technical_language>

Target:
public Optional<ConnectorNewTableLayout> getNewTableLayout(ConnectorSession session, ConnectorTableMetadata metadata) { ImmutableMap.Builder<String, RaptorColumnHandle> map = ImmutableMap.builder(); long columnId = 1; StorageTypeConverter storageTypeConverter = new StorageTypeConverter(typeManager); for (ColumnMetadata column : metadata.getColumns()) { checkState(storageTypeConverter.toStorageType(column.getType()) != null, "storage type cannot be null"); map.put(column.getName(), new RaptorColumnHandle(connectorId, column.getName(), columnId, column.getType())); columnId++; } Optional<DistributionInfo> distribution = getOrCreateDistribution(map.build(), metadata.getProperties()); if (!distribution.isPresent()) { return Optional.empty(); } List<String> partitionColumns = distribution.get().getBucketColumns().stream() .map(RaptorColumnHandle::getColumnName) .collect(toList()); ConnectorPartitioningHandle partitioning = getPartitioningHandle(distribution.get().getDistributionId()); return Optional.of(new ConnectorNewTableLayout(partitioning, partitionColumns)); }
Source:
<code><START> public Annotation() { <END> }</code><technical_language>code empty constructors (Annotation(), Video(), OptimizedVideo()...) is entities package. sense mark empty constructors package-private clear in way</technical_language>

Target:
Annotation() { }
Source:
<code>public void testCheckpointingInflightData() throws Exception { SingleInputGate inputGate = new SingleInputGateBuilder().build(); List<Buffer> receivedBuffers = new ArrayList<>(); inputGate.registerBufferReceivedListener(new BufferReceivedListener() { @Override public void notifyBufferReceived(Buffer buffer, InputChannelInfo channelInfo) { receivedBuffers.add(buffer); } @Override public void notifyBarrierReceived(CheckpointBarrier barrier, InputChannelInfo channelInfo) }); <START> ResultSubpartitionView subpartitionView = createResultSubpartitionView(true); <END> TestingResultPartitionManager partitionManager = new TestingResultPartitionManager(subpartitionView); LocalInputChannel channel = createLocalInputChannel(inputGate, partitionManager); channel.requestSubpartition(0); channel.spillInflightBuffers(0L, ChannelStateWriter.NO_OP); assertEquals(receivedBuffers, Collections.emptyList()); Optional<InputChannel.BufferAndAvailability> bufferAndAvailability = channel.getNextBuffer(); assertTrue(bufferAndAvailability.isPresent()); assertEquals(receivedBuffers, Collections.singletonList(bufferAndAvailability.get().buffer())); }</code><technical_language>add more buffer some events, EndOfPartitionEvent end</technical_language>

Target:
public void testCheckpointingInflightData() throws Exception { SingleInputGate inputGate = new SingleInputGateBuilder().build(); List<Buffer> receivedBuffers = new ArrayList<>(); inputGate.registerBufferReceivedListener(new BufferReceivedListener() { @Override public void notifyBufferReceived(Buffer buffer, InputChannelInfo channelInfo) { receivedBuffers.add(buffer); } @Override public void notifyBarrierReceived(CheckpointBarrier barrier, InputChannelInfo channelInfo) }); ResultPartition parent = PartitionTestUtils.createPartition( ResultPartitionType.PIPELINED, NoOpFileChannelManager.INSTANCE); ResultSubpartition subpartition = parent.getAllPartitions()[0]; ResultSubpartitionView subpartitionView = subpartition.createReadView(() -> {}); TestingResultPartitionManager partitionManager = new TestingResultPartitionManager(subpartitionView); LocalInputChannel channel = createLocalInputChannel(inputGate, partitionManager); channel.requestSubpartition(0); channel.spillInflightBuffers(0L, ChannelStateWriter.NO_OP); assertEquals(receivedBuffers, Collections.emptyList()); subpartition.add(BufferBuilderTestUtils.createFilledFinishedBufferConsumer(1)); Optional<InputChannel.BufferAndAvailability> bufferAndAvailability = channel.getNextBuffer(); assertTrue(bufferAndAvailability.isPresent()); subpartition.add(BufferBuilderTestUtils.createEventBufferConsumer(33, Buffer.DataType.EVENT_BUFFER)); assertTrue(channel.getNextBuffer().isPresent()); assertEquals(receivedBuffers, Collections.singletonList(bufferAndAvailability.get().buffer())); }
Source:
<code>private static boolean isVoltTypePresent(VoltXMLElement tableNode, VoltType lookupType, StringBuffer msg) { assert tableNode.name.equals("table"); String valueTypeStr; VoltType type; String columnName; for (VoltXMLElement subNode : tableNode.children) { if (subNode.name.equals("columns")) { for (VoltXMLElement columnNode : subNode.children) { if (columnNode.name.equals("column")) { valueTypeStr = columnNode.attributes.get("valuetype"); columnName = columnNode.attributes.get("name"); type = VoltType.typeFromString(valueTypeStr); if (lookupType == type) { msg.append("column name: '" + columnName + "', type: '" + valueTypeStr + "'"); return true; } } } <START> } END> } return false; }</code><technical_language>Is return false loop falls out? If find a "columns" element, one</technical_language>

Target:
private static boolean isVoltTypePresent(VoltXMLElement tableNode, VoltType lookupType, StringBuffer msg) { assert(tableNode.name.equals("table")); String valueTypeStr; VoltType type; String columnName; boolean typeDetected = false; String separatorStr; for (VoltXMLElement subNode : tableNode.children) { if (subNode.name.equals("columns")) { for (VoltXMLElement columnNode : subNode.children) { if (columnNode.name.equals("column")) { valueTypeStr = columnNode.attributes.get("valuetype"); columnName = columnNode.attributes.get("name"); type = VoltType.typeFromString(valueTypeStr); if (lookupType == type) { if (msg != null) { separatorStr = (typeDetected == true)? ", " : " "; msg.append(separatorStr + "column name: '" + columnName + "' type: '" + valueTypeStr + "'"); } typeDetected = true; } } } } } return typeDetected; }