auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private Map<StudyFilters, String> setParameters(final String programDbId, final String locationDbId, final String sortByField, final String sortOrder) { final Map<StudyFilters, String> parametersMap = new EnumMap<>(StudyFilters.class); if (!StringUtils.isBlank(programDbId)) { parametersMap.put(StudyFilters.PROGRAM_ID, programDbId); } if (!StringUtils.isBlank(locationDbId)) { parametersMap.put(StudyFilters.LOCATION_ID, locationDbId); } if (!StringUtils.isBlank(sortByField)) { <START> parametersMap.put(StudyFilters.SORT_BY_FIELD, translateNameField(sortByField)); <END> } else { parametersMap.put(StudyFilters.SORT_BY_FIELD, "projectId"); } if (StringUtils.isBlank(sortOrder) || TrialResourceBrapi.ASCENDING.equalsIgnoreCase(sortOrder)) { parametersMap.put(StudyFilters.ORDER, "asc"); } else if (!StringUtils.isBlank(sortOrder) && TrialResourceBrapi.DESCENDING.equalsIgnoreCase(sortOrder)) { parametersMap.put(StudyFilters.ORDER, "desc"); } return parametersMap; }</code><technical_language>I thinks this transformed into: java if (!StringUtils.isBlank(sortByField) && "trialName".equals(sortByField)) { parametersMap.put(StudyFilters.SORT_BY_FIELD, "name"); } else { parametersMap.put(StudyFilters.SORT_BY_FIELD, "projectId"); } remove extra method</technical_language>

Target:
private Map<StudyFilters, String> setParameters(final String programDbId, final String locationDbId, final String sortByField, final String sortOrder) { final Map<StudyFilters, String> parametersMap = new EnumMap<>(StudyFilters.class); if (!StringUtils.isBlank(programDbId)) { parametersMap.put(StudyFilters.PROGRAM_ID, programDbId); } if (!StringUtils.isBlank(locationDbId)) { parametersMap.put(StudyFilters.LOCATION_ID, locationDbId); } if (!StringUtils.isBlank(sortByField) && "trialName".equals(sortByField)) { parametersMap.put(StudyFilters.SORT_BY_FIELD, "name"); } else { parametersMap.put(StudyFilters.SORT_BY_FIELD, "projectId"); } if (StringUtils.isBlank(sortOrder) || TrialResourceBrapi.ORDER_BY_ASCENDING.equalsIgnoreCase(sortOrder)) { parametersMap.put(StudyFilters.ORDER, "asc"); } else if (!StringUtils.isBlank(sortOrder) && TrialResourceBrapi.ORDER_BY_DESCENDING.equalsIgnoreCase(sortOrder)) { parametersMap.put(StudyFilters.ORDER, "desc"); } return parametersMap; }
Source:
<code>public ScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, TypeManager typeManager, FunctionManager functionManager) { checkArgument(arity == 1, "Expected arity to be 1"); Type fromType = boundVariables.getTypeVariable("F"); Type toType = boundVariables.getTypeVariable("T"); <START> FunctionHandle functionHandle = functionManager.lookupCast(fromOperatorType(CAST), fromType.getTypeSignature(), toType.getTypeSignature()); <END> ScalarFunctionImplementation function = functionManager.getScalarFunctionImplementation(functionHandle); Class<?> castOperatorClass = generateArrayCast(typeManager, functionHandle.getSignature(), function); MethodHandle methodHandle = methodHandle(castOperatorClass, "castArray", ConnectorSession.class, Block.class); return new ScalarFunctionImplementation( false, ImmutableList.of( valueTypeArgumentProperty(RETURN_NULL_ON_NULL), valueTypeArgumentProperty(RETURN_NULL_ON_NULL)), methodHandle, isDeterministic()); }</code><technical_language>CastType.CAST here</technical_language>

Target:
public ScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, TypeManager typeManager, FunctionManager functionManager) { checkArgument(arity == 1, "Expected arity to be 1"); Type fromType = boundVariables.getTypeVariable("F"); Type toType = boundVariables.getTypeVariable("T"); FunctionHandle functionHandle = functionManager.lookupCast(CastType.CAST, fromType.getTypeSignature(), toType.getTypeSignature()); ScalarFunctionImplementation function = functionManager.getScalarFunctionImplementation(functionHandle); Class<?> castOperatorClass = generateArrayCast(typeManager, functionHandle.getSignature(), function); MethodHandle methodHandle = methodHandle(castOperatorClass, "castArray", ConnectorSession.class, Block.class); return new ScalarFunctionImplementation( false, ImmutableList.of( valueTypeArgumentProperty(RETURN_NULL_ON_NULL), valueTypeArgumentProperty(RETURN_NULL_ON_NULL)), methodHandle, isDeterministic()); }
Source:
<code>public void testExternalResourseIsSavedInCache() throws IOException { final Configuration config = new DefaultConfiguration("myName"); final String filePath = temporaryFolder.newFile().getPath(); final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); cache.load(); final Set<String> resources = new HashSet<>(); final String pathToResource = "src/test/resources/com/puppycrawl/tools/checkstyle/externalResourse.tmp"; resources.add(pathToResource); cache.putExternalResources(resources); <START> assertEquals("42BA2739D95DF52BDD2C1E50387109CE81EA60DC", <END> cache.get("module-resource*?:" + pathToResource)); }</code><technical_language>empty line assert. I more line separations big chunk of code. Separation clear distinctions groups of code varaibles, manipulation, assertions, etc</technical_language>

Target:
public void testExternalResourseIsSavedInCache() throws IOException { final Configuration config = new DefaultConfiguration("myName"); final String filePath = temporaryFolder.newFile().getPath(); final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); cache.load(); final Set<String> resources = new HashSet<>(); final String pathToResource = "src/test/resources/com/puppycrawl/tools/checkstyle/externalResourse.tmp"; resources.add(pathToResource); cache.putExternalResources(resources); assertFalse(cache.get("module-resource*?:" + pathToResource).isEmpty()); }
Source:
<code>private static CommandStatus executeSync(Command command, CommandLine commandLine) { CommandStatus commandStatus = new CommandStatus(new LinuxExitValue(0)); commandStatus.setOutputStream(command.getOutputStream()); commandStatus.setErrorStream(command.getErrorStream()); commandStatus.setInputStream(command.getInputStream()); DefaultExecutor executor = configureExecutor(command); int exitStatus = 0; logger.debug("Executing: {}", commandLine); try { Map<String, String> environment = command.getEnvironment(); if (environment != null && !environment.isEmpty()) { Map<String, String> currentEnv = EnvironmentUtils.getProcEnvironment(); currentEnv.putAll(environment); exitStatus = executor.execute(commandLine, currentEnv); } else { exitStatus = executor.execute(commandLine); } } catch (ExecuteException e) { exitStatus = e.getExitValue(); <START> logger.debug(COMMAND + commandLine + " returned error code " + exitStatus, e); <END> } catch (IOException e) { exitStatus = 1; logger.error(COMMAND + commandLine + " failed", e); } finally { commandStatus.setExitStatus(new LinuxExitValue(exitStatus)); commandStatus.setTimedout(executor.getWatchdog().killedProcess()); } return commandStatus; }</code><technical_language>rework this log message logger features</technical_language>

Target:
private static CommandStatus executeSync(Command command, CommandLine commandLine) { CommandStatus commandStatus = new CommandStatus(new LinuxExitValue(0)); commandStatus.setOutputStream(command.getOutputStream()); commandStatus.setErrorStream(command.getErrorStream()); commandStatus.setInputStream(command.getInputStream()); DefaultExecutor executor = configureExecutor(command); int exitStatus = 0; logger.debug("Executing: {}", commandLine); try { Map<String, String> environment = command.getEnvironment(); if (environment != null && !environment.isEmpty()) { Map<String, String> currentEnv = EnvironmentUtils.getProcEnvironment(); currentEnv.putAll(environment); exitStatus = executor.execute(commandLine, currentEnv); } else { exitStatus = executor.execute(commandLine); } } catch (ExecuteException e) { exitStatus = e.getExitValue(); logger.debug(COMMAND_MESSAGE + " returned error code {}", commandLine, exitStatus, e); } catch (IOException e) { exitStatus = 1; logger.error(COMMAND_MESSAGE + " failed", commandLine, e); } finally { commandStatus.setExitStatus(new LinuxExitValue(exitStatus)); commandStatus.setTimedout(executor.getWatchdog().killedProcess()); } return commandStatus; }
Source:
<code>public ColumnStatisticMetadata deserializeKey(String key, DeserializationContext ctxt) { <START> verify(key != null, "key is null"); <END> return deserialize(key); }</code><technical_language>requireNonNull</technical_language>

Target:
public ColumnStatisticMetadata deserializeKey(String key, DeserializationContext ctxt) { return deserialize(requireNonNull(key, "key is null")); }
Source:
<code><START> private Boolean hasAffinityForJvm(){ <END> return this.clConfig.getWorkerAlias().equals(this.affinity); }</code><technical_language>booleanwith small b</technical_language>

Target:
private boolean hasAffinityForJvm() throws Exception{ return (affinity.isPresent() && clConfig.getWorkerAlias().equals(affinity.get())); }
Source:
<code>protected boolean canDoAction() { <START> UserProfile dbProfile = userProfileDao.getByUserId(getUserId()); <END> if (dbProfile == null) { return failCanDoAction(EngineMessage.ACTION_TYPE_FAILED_PROFILE_NOT_EXIST); } return true; }</code><technical_language>this a class member load reuse execute</technical_language>

Target:
protected boolean canDoAction() { if (profile == null) { return failCanDoAction(EngineMessage.ACTION_TYPE_FAILED_PROFILE_NOT_EXIST); } return true; }
Source:
<code>public CloseableReference<Bitmap> decodeJPEGFromEncodedImageWithColorSpace( final EncodedImage encodedImage, Bitmap.Config bitmapConfig, @Nullable Rect regionToDecode, int length, @Nullable final ColorSpace colorSpace) { BitmapFactory.Options options = getBitmapFactoryOptions( encodedImage.getSampleSize(), bitmapConfig); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { <START> options.inPreferredColorSpace = colorSpace == null <END> ? ColorSpace.get(ColorSpace.Named.SRGB) : colorSpace; } final CloseableReference<PooledByteBuffer> bytesRef = encodedImage.getByteBufferRef(); Preconditions.checkNotNull(bytesRef); try { Bitmap bitmap = decodeJPEGByteArrayAsPurgeable(bytesRef, length, options); return pinBitmap(bitmap); } finally { CloseableReference.closeSafely(bytesRef); } }</code><technical_language>This check (and above) break DEX preverification. instead move a util class, similar this: ... if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { OreoUtils.setColorSpace(options, colorSpace); } ... } .... import com.facebook.annotations.DoNotOptimize; @DoNotOptimize private static class OreoUtils { void setColorSpace(...) { options.inPreferredColorSpace = ... } } }</technical_language>

Target:
public CloseableReference<Bitmap> decodeJPEGFromEncodedImageWithColorSpace( final EncodedImage encodedImage, Bitmap.Config bitmapConfig, @Nullable Rect regionToDecode, int length, @Nullable final ColorSpace colorSpace) { BitmapFactory.Options options = getBitmapFactoryOptions( encodedImage.getSampleSize(), bitmapConfig); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { OreoUtils.setColorSpace(options, colorSpace); } final CloseableReference<PooledByteBuffer> bytesRef = encodedImage.getByteBufferRef(); Preconditions.checkNotNull(bytesRef); try { Bitmap bitmap = decodeJPEGByteArrayAsPurgeable(bytesRef, length, options); return pinBitmap(bitmap); } finally { CloseableReference.closeSafely(bytesRef); } }
Source:
<code>public void postsListLoads() { PostsListPage postsList = new PostsListPage(driver).open(); <START> postsList.isPostListNotEmpty(); <END> }</code><technical_language>Wrap this in Assertion</technical_language>

Target:
public void postsListLoads() { PostsListPage postsList = new PostsListPage(driver).open(); Assertion.assertFalse(postsList.isPostListEmpty()); }
Source:
<code>public boolean isSubtype( final AnnotatedTypeMirror subtype, final AnnotatedTypeMirror supertype) { if (subtype.atypeFactory.ignoreUninferredTypeArguments && (subtype.containsUninferredTypeArguments() || supertype.containsUninferredTypeArguments())) { if (ignoreUninferredTypeArgument(subtype) || ignoreUninferredTypeArgument(supertype)) { return true; } for (final AnnotationMirror top : qualifierHierarchy.getTopAnnotations()) { AnnotationMirror subAnno = subtype.getAnnotationInHierarchy(top); AnnotationMirror superAnno = supertype.getAnnotationInHierarchy(top); if (subAnno != null && superAnno != null && !qualifierHierarchy.isSubtype(subAnno, superAnno)) { return false; } } <START> return true; <END> } for (final AnnotationMirror top : qualifierHierarchy.getTopAnnotations()) { if (!isSubtype(subtype, supertype, top)) { return false; } } return true; }</code><technical_language>wondering this is a bit coarse-grained. this change, if deep a generic type is uninferred type argument, primary annotations checked. a type @A M<@B C, @D ?> type argument is uninferred. this change, @A is checked. if @B is checked? type argument affected failure infer argument. if remove lines 157--159 164--174 patch? Methods isContainedBy check for uninferred type arguments, check in isSubtype missing? need new containsUninferredTypeArguments method</technical_language>

Target:
public boolean isSubtype( final AnnotatedTypeMirror subtype, final AnnotatedTypeMirror supertype) { for (final AnnotationMirror top : qualifierHierarchy.getTopAnnotations()) { if (!isSubtype(subtype, supertype, top)) { return false; } } return true; }
Source:
<code>private void testCodec(final int offset, final int k, final int[] values, final byte[] expected) throws IOException { try (final ByteArrayOutputStream os = new ByteArrayOutputStream(); final BitOutputStream bos = new DefaultBitOutputStream(os)) { final CRAMCodec<Integer> writeCodec = new SubexponentialIntegerCodec(null, bos, offset, k); for (final int value : values) { writeCodec.write(value); } bos.flush(); final byte[] writtenOut = os.toByteArray(); Assert.assertEquals(writtenOut, expected); final int[] readBack = new int[values.length]; <START> try (final InputStream is = new ByteArrayInputStream(writtenOut); <END> final DefaultBitInputStream dbis = new DefaultBitInputStream(is)) { final CRAMCodec<Integer> readCodec = new SubexponentialIntegerCodec(dbis, null, offset, k); for (int i = 0; i < values.length; i++) { readBack[i] = readCodec.read(); } } Assert.assertEquals(readBack, values); } }</code><technical_language>Nested try too</technical_language>

Target:
private void testCodec(final int offset, final int k, final int[] values, final byte[] expected) throws IOException { byte[] writtenOut; try (final ByteArrayOutputStream os = new ByteArrayOutputStream(); final BitOutputStream bos = new DefaultBitOutputStream(os)) { final CRAMCodec<Integer> writeCodec = new SubexponentialIntegerCodec(null, bos, offset, k); for (final int value : values) { writeCodec.write(value); } bos.flush(); writtenOut = os.toByteArray(); Assert.assertEquals(writtenOut, expected); } final int[] readBack = new int[values.length]; try (final InputStream is = new ByteArrayInputStream(writtenOut); final DefaultBitInputStream dbis = new DefaultBitInputStream(is)) { final CRAMCodec<Integer> readCodec = new SubexponentialIntegerCodec(dbis, null, offset, k); for (int i = 0; i < values.length; i++) { readBack[i] = readCodec.read(); } } Assert.assertEquals(readBack, values); }
Source:
<code>HelixAdmin getHelixAdmin(String zkAddr) { <START> return new ZKHelixAdmin(zkAddr); <END> }</code><technical_language>change this new HelixAdminFactory().getHelixAdmin(zkAddr) - thing, instantiate factory</technical_language>

Target:
HelixAdmin getHelixAdmin(String zkAddr) { return new HelixAdminFactory().getHelixAdmin(zkAddr); }
Source:
<code>public Iterable<ITmfEventAspect<?>> getEventAspects() { Collection<ITmfEventAspect<?>> <START> retval = <END> fAspects; if (retval == null && fInited) { ImmutableList.Builder<ITmfEventAspect<?>> builder = new Builder<>(); builder.addAll(LTTNG_KERNEL_ASPECTS); ImmutableSet.Builder<NumericalAspect> perfBuilder = new ImmutableSet.Builder<>(); for (CtfTmfEventType eventType : getContainedEventTypes()) { for (String fieldName : eventType.getFieldNames()) { if (fieldName != null) { if (CONTEXT_PERF_CPU.matcher(fieldName).matches()) { perfBuilder.add(new CpuPerfAspect(fieldName)); } else if (CONTEXT_PERF_THREAD.matcher(fieldName).matches()) { perfBuilder.add(new ThreadPerfAspect(fieldName)); } else if (CONTEXT_PERF_UNKNOWN.matcher(fieldName).matches()) { perfBuilder.add(new PerfCounterAspect(fieldName)); } } } } builder.addAll(perfBuilder.build()); retval = builder.build(); fAspects = retval; } return retval; }</code><technical_language>rename aspects</technical_language>

Target:
public Iterable<ITmfEventAspect<?>> getEventAspects() { Collection<ITmfEventAspect<?>> aspects = fAspects; if (aspects == null && fInited) { ImmutableList.Builder<ITmfEventAspect<?>> builder = new Builder<>(); builder.addAll(LTTNG_KERNEL_ASPECTS); builder.addAll(createCounterAspects()); aspects = builder.build(); fAspects = aspects; } return aspects != null ? aspects : Collections.emptyList(); }
Source:
<code>public SpongeSneakingData(boolean sneaking) { <START> super(SneakingData.class, Boolean.valueOf(sneaking), Keys.IS_SNEAKING); <END> }</code><technical_language>Instead of boxing Boolean.valueOf(sneaking), sneaking</technical_language>

Target:
public SpongeSneakingData(boolean sneaking) { super(SneakingData.class, sneaking, Keys.IS_SNEAKING, ImmutableSpongeSneakingData.class); }
Source:
<code>public void checkContentMergeBinaries(MergeStrategy strategy) throws Exception { Git git = Git.wrap(db); final int LINELEN = 72; byte[] binary = new byte[LINELEN * 2000]; for (int i = 0; i < binary.length; i++) { binary[i] = (byte)((i % LINELEN) == 0 ? '\n' : 'x'); } binary[LINELEN * 1000 + 1] = '\0'; writeTrashFile("file", new String(binary, <START> "UTF-8")); <END> git.add().addFilepattern("file").call(); RevCommit first = git.commit().setMessage("added file").call(); int idx = LINELEN * 1200 + 1; byte save = binary[idx]; binary[idx] = '@'; writeTrashFile("file", new String(binary, "UTF-8")); binary[idx] = save; git.add().addFilepattern("file").call(); RevCommit masterCommit = git.commit().setAll(true) .setMessage("modified file l 1200").call(); git.checkout().setCreateBranch(true).setStartPoint(first).setName("side").call(); binary[LINELEN * 1500 + 1] = '!'; writeTrashFile("file", new String(binary, "UTF-8")); git.add().addFilepattern("file").call(); RevCommit sideCommit = git.commit().setAll(true) .setMessage("modified file l 1500").call(); try (ObjectInserter ins = db.newObjectInserter()) { ResolveMerger merger = (ResolveMerger) strategy.newMerger(ins, db.getConfig()); boolean noProblems = merger.merge(masterCommit, sideCommit); assertFalse(noProblems); } }</code><technical_language>Nit: StandardCharsets.UTF_8 (optionally a static import)</technical_language>

Target:
public void checkContentMergeBinaries(MergeStrategy strategy) throws Exception { Git git = Git.wrap(db); final int LINELEN = 72; byte[] binary = new byte[LINELEN * 2000]; for (int i = 0; i < binary.length; i++) { binary[i] = (byte)((i % LINELEN) == 0 ? '\n' : 'x'); } binary[LINELEN * 1000 + 1] = '\0'; writeTrashFile("file", new String(binary, StandardCharsets.UTF_8)); git.add().addFilepattern("file").call(); RevCommit first = git.commit().setMessage("added file").call(); int idx = LINELEN * 1200 + 1; byte save = binary[idx]; binary[idx] = '@'; writeTrashFile("file", new String(binary, StandardCharsets.UTF_8)); binary[idx] = save; git.add().addFilepattern("file").call(); RevCommit masterCommit = git.commit().setAll(true) .setMessage("modified file l 1200").call(); git.checkout().setCreateBranch(true).setStartPoint(first).setName("side").call(); binary[LINELEN * 1500 + 1] = '!'; writeTrashFile("file", new String(binary, StandardCharsets.UTF_8)); git.add().addFilepattern("file").call(); RevCommit sideCommit = git.commit().setAll(true) .setMessage("modified file l 1500").call(); try (ObjectInserter ins = db.newObjectInserter()) { ResolveMerger merger = (ResolveMerger) strategy.newMerger(ins, db.getConfig()); boolean noProblems = merger.merge(masterCommit, sideCommit); assertFalse(noProblems); } }
Source:
<code>public long lockBlock(long sessionId, long blockId, BlockLockType blockLockType) { ClientRWLock blockLock = getBlockLock(blockId); Lock lock; if (blockLockType == BlockLockType.READ) { lock = blockLock.readLock(); } else { if (sessionHoldsLock(sessionId, blockId)) { throw new IllegalStateException(String .format("Session %s attempted to take a write lock on block %s, but the session already" + " holds a lock on the block", sessionId, blockId)); } lock = blockLock.writeLock(); } try { if (!lock.tryLock(1L, TimeUnit.MINUTES)) { <START> LOG.warn("tryLock block for session failed after 1 min, " <END> + "lock reference count = {}", blockLockType, blockId, sessionId, blockLock.getReferenceCount()); lock.lock(); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); lock.lock(); } try { long lockId = LOCK_ID_GEN.getAndIncrement(); try (LockResource r = new LockResource(mSharedMapsLock.writeLock())) { mLockIdToRecordMap.put(lockId, new LockRecord(sessionId, blockId, lock)); Set<Long> sessionLockIds = mSessionIdToLockIdsMap.get(sessionId); if (sessionLockIds == null) { mSessionIdToLockIdsMap.put(sessionId, Sets.newHashSet(lockId)); } else { sessionLockIds.add(lockId); } } return lockId; } catch (Throwable e) { unlock(lock, blockId); throw e; } }</code><technical_language>need log session track session correctly Alluxio 1.5</technical_language>

Target:
public long lockBlock(long sessionId, long blockId, BlockLockType blockLockType) { ClientRWLock blockLock = getBlockLock(blockId); Lock lock; if (blockLockType == BlockLockType.READ) { lock = blockLock.readLock(); } else { if (sessionHoldsLock(sessionId, blockId)) { throw new IllegalStateException(String .format("Session %s attempted to take a write lock on block %s, but the session already" + " holds a lock on the block", sessionId, blockId)); } lock = blockLock.writeLock(); } lock.lock(); try { long lockId = LOCK_ID_GEN.getAndIncrement(); try (LockResource r = new LockResource(mSharedMapsLock.writeLock())) { mLockIdToRecordMap.put(lockId, new LockRecord(sessionId, blockId, lock)); Set<Long> sessionLockIds = mSessionIdToLockIdsMap.get(sessionId); if (sessionLockIds == null) { mSessionIdToLockIdsMap.put(sessionId, Sets.newHashSet(lockId)); } else { sessionLockIds.add(lockId); } } return lockId; } catch (Throwable e) { unlock(lock, blockId); throw e; } }
Source:
<code>public void deleteVideo(){ executeScript("$('div.WikiaGrid div:nth-child(1).grid-2 .remove').show()"); <START> newestVideoDeleteIcon.click(); <END> deleteConfirmButton.click(); }</code><technical_language>'waitForElementByElement(newestVideoDeleteIcon); 'waitForElementByElement(deleteConfirmButton); click</technical_language>

Target:
public void deleteVideo(){ executeScript("$('div.WikiaGrid div:nth-child(1).grid-2 .remove').show()"); waitForElementByElement(newestVideo); newestVideoDeleteIcon.click(); waitForElementByElement(deleteConfirmButton); deleteConfirmButton.click(); }
Source:
<code>public void testCloseNoForce() throws Exception { WriteHandle lh = result(bkc.newCreateLedgerOp() .withEnsembleSize(1) .withWriteQuorumSize(1) .withAckQuorumSize(1) .withWriteFlags(WriteFlag.DEFERRED_SYNC) .withDigestType(org.apache.bookkeeper.client.api.DigestType.CRC32C) .withPassword(new byte[0]) .execute()); int n = 10; long ledgerId = lh.getId(); for (int i = 0; i < n; i++) { lh.append(("entry-" + i).getBytes()); } assertEquals(-1, lh.getLastAddConfirmed()); lh.close(); <START> restartBookies(); <END> try (ReadHandle readLh = result(bkc.newOpenLedgerOp() .withLedgerId(ledgerId) .withRecovery(true) .withPassword(new byte[0]) .execute());) { assertEquals(-1, readLh.getLastAddConfirmed()); } }</code><technical_language>restart here</technical_language>

Target:
public void testCloseNoForce() throws Exception { testClose(true); }
Source:
<code><START> final public boolean equals(Object obj) { <END> if (obj == this) { return true; } else if (obj instanceof ModuleAdapter<?>) { ModuleAdapter<?> that = (ModuleAdapter<?>) obj; return this.moduleClass.equals(that.moduleClass); } else { return false; } }</code><technical_language>JLS order is public final boolean for consistency other methods</technical_language>

Target:
public final boolean equals(Object obj) { if (obj == this) { return true; } else if (obj instanceof ModuleAdapter<?>) { ModuleAdapter<?> that = (ModuleAdapter<?>) obj; return this.moduleClass.equals(that.moduleClass); } else { return false; } }
Source:
<code>public void resendVerification(Study study, ChannelType type, String userId) { checkNotNull(study); checkArgument(isNotBlank(userId)); StudyParticipant participant = getParticipant(study, userId, false); if (type == ChannelType.EMAIL && participant.getEmail() != null) { AccountId accountId = AccountId.forEmail(study.getIdentifier(), participant.getEmail()); accountWorkflowService.resendVerificationToken(type, accountId); } else if (type == ChannelType.PHONE && participant.getPhone() != null) { AccountId accountId = AccountId.forPhone(study.getIdentifier(), participant.getPhone()); accountWorkflowService.resendVerificationToken(type, accountId); } <START> } <END></code><technical_language>problem throwing this exception? If passing in a channel, this is a bug in server. If this happens, fast-fail request a 500 Internal Server Error do mask error</technical_language>

Target:
public void resendVerification(Study study, ChannelType type, String userId) { checkNotNull(study); checkArgument(isNotBlank(userId)); StudyParticipant participant = getParticipant(study, userId, false); if (type == ChannelType.EMAIL) { if (participant.getEmail() != null) { AccountId accountId = AccountId.forEmail(study.getIdentifier(), participant.getEmail()); accountWorkflowService.resendVerificationToken(type, accountId); } } else if (type == ChannelType.PHONE) { if (participant.getPhone() != null) { AccountId accountId = AccountId.forPhone(study.getIdentifier(), participant.getPhone()); accountWorkflowService.resendVerificationToken(type, accountId); } } else { throw new UnsupportedOperationException("Channel type not implemented"); } }
Source:
<code>public String convert(final BindingSet bindingSet, final VariableOrder varOrder) { requireNonNull(bindingSet); requireNonNull(varOrder); if(bindingSet.getBindingNames().isEmpty()) { return ""; } <START> <END> final List<String> bindingStrings = new ArrayList<>(); for(final String varName : varOrder) { if(bindingSet.hasBinding(varName)) { final Value value = bindingSet.getBinding(varName).getValue(); final RyaType ryaValue = RdfToRyaConversions.convertValue(value); final String bindingString = ryaValue.getData() + TYPE_DELIM + ryaValue.getDataType(); bindingStrings.add(bindingString); } else { bindingStrings.add(NULL_VALUE_STRING); } } return Joiner.on(BINDING_DELIM).join(bindingStrings); }</code><technical_language>throw exception user bindingSetString built a subset of variables in varOrder in event variables in varOrder variables in BindingSet</technical_language>

Target:
public String convert(final BindingSet bindingSet, final VariableOrder varOrder) { requireNonNull(bindingSet); requireNonNull(varOrder); final List<String> bindingStrings = new ArrayList<>(); for(final String varName : varOrder) { if(bindingSet.hasBinding(varName)) { final Value value = bindingSet.getBinding(varName).getValue(); final RyaType ryaValue = RdfToRyaConversions.convertValue(value); final String bindingString = ryaValue.getData() + TYPE_DELIM + ryaValue.getDataType(); bindingStrings.add(bindingString); } else { bindingStrings.add(NULL_VALUE_STRING); } } return Joiner.on(BINDING_DELIM).join(bindingStrings); }
Source:
<code>public Object[] getUserAndServerUrl(RealmConfiguration config) { if (config instanceof SyncConfiguration) { SyncConfiguration syncConfig = (SyncConfiguration) config; SyncUser user = syncConfig.getUser(); if (!user.isValid()) { <START> if (user.isLoggedOut()) { <END> throw new IllegalStateException("The SyncUser is already logged out and can not use the provided configuration to open a Realm."); } else { RealmLog.warn("Can not use the provided configuration to open a Realm, the SyncUser is no longer valid."); } } String rosServerUrl = syncConfig.getServerUrl().toString(); String rosUserIdentity = user.getIdentity(); String syncRealmAuthUrl = user.getAuthenticationUrl().toString(); String rosSerializedUser = user.toJson(); return new Object[]{rosUserIdentity, rosServerUrl, syncRealmAuthUrl, rosSerializedUser, syncConfig.syncClientValidateSsl(), syncConfig.getServerCertificateFilePath()}; } else { return new Object[6]; } }</code><technical_language>get branch line 100 this change</technical_language>

Target:
public Object[] getUserAndServerUrl(RealmConfiguration config) { if (config instanceof SyncConfiguration) { SyncConfiguration syncConfig = (SyncConfiguration) config; SyncUser user = syncConfig.getUser(); if (!user.isValid()) { if (!SyncManager.getUserStore().isActive(user.getIdentity())) { throw new IllegalStateException("The SyncUser is already logged out and can not use the provided configuration to open a Realm."); } else { RealmLog.warn("The provided configuration uses an expired SyncUser token, this Realm instance will work offline."); } } String rosServerUrl = syncConfig.getServerUrl().toString(); String rosUserIdentity = user.getIdentity(); String syncRealmAuthUrl = user.getAuthenticationUrl().toString(); String rosSerializedUser = user.toJson(); return new Object[]{rosUserIdentity, rosServerUrl, syncRealmAuthUrl, rosSerializedUser, syncConfig.syncClientValidateSsl(), syncConfig.getServerCertificateFilePath()}; } else { return new Object[6]; } }
Source:
<code>public static List<IdNamePair> getSortedListOfYearsThatBelongToSeveralGeoAreas( Map<Integer, Integer> countOfAreaCodesForYear) { return (List<IdNamePair>) (countOfAreaCodesForYear.entrySet().stream().filter(e -> e.getValue() > 1) <START> .map(e -> new IdNamePair(String.valueOf(e.getKey()), null))).sorted().collect(Collectors.toList()); <END> }</code><technical_language>split map() separate phases. mapping Entry Integer, sorting Stream<Integer> mapping years IdNamePairs, e.g. .stream() .filter(e -> e.getValue() > 1) .map(e -> e.getKey()) .sorted() .map(year -> new IdNamePair(String.valueOf(year), null)) .collect(Collectors.toList())</technical_language>

Target:
public static List<IdNamePair> getSortedListOfYearsThatBelongToSeveralGeoAreas( Map<Integer, Integer> countOfAreaCodesForYear) { return (List<IdNamePair>) (countOfAreaCodesForYear.entrySet().stream().filter(e -> e.getValue() > 1) .map(e -> e.getKey()).sorted().map(year -> new IdNamePair(String.valueOf(year), null))).collect(Collectors.toList()); }
Source:
<code>public void play() { if (state != PlayerState.READY) { throw new IllegalStateException("Track processor is not ready yet."); } synchronized (skipProcessor) { <START> System.out.println("notify skipper"); <END> skipProcessor.notify(); } setState(PlayerState.PLAYING); }</code><technical_language>this</technical_language>

Target:
public void play() { if (state != PlayerState.READY) { throw new IllegalStateException("Track processor is not ready yet."); } synchronized (skipProcessor) { skipProcessor.notify(); } setState(PlayerState.PLAYING); }
Source:
<code>String heading(NamedResource resource, String kind) { if (resource instanceof DeployableResource) { DeployableResource deployable = (DeployableResource) resource; <START> if (DeploymentUnitStatus.State.undeployed.toString().equals(deployable.getStatus())) { <END> return String.format("Undeployed %s", kind); } return String.format("Deployed %s", kind); } return null; }</code><technical_language>I context in this is used, this return a string indicating is deployed if is in state other undeployed - in other words if status is failed show deployed. Is this intentional</technical_language>

Target:
String heading(NamedResource resource, String kind) { return null; }
Source:
<code>protected void registerSecureVault(SecureVault secureVault) { <START> ConfigProviderDataHolder.getInstance().setOptSecureVault(Optional.ofNullable(secureVault)); <END> }</code><technical_language>fix ConfigProviderDataHolder API accept Optiona<> values, this call change</technical_language>

Target:
protected void registerSecureVault(SecureVault secureVault) { ConfigProviderDataHolder.getInstance().setSecureVault(secureVault); }
Source:
<code>public InputStream lookupFileStrict(URI uri, ClassLoader cl) throws FileNotFoundException { int startIndex = uri.toString().lastIndexOf(':'); String fileName = uri.toString().substring(startIndex + 1); <START> InputStream in = cl.getResourceAsStream(fileName); <END> if(in != null){ return in; } else { return null; } }</code><technical_language>return cl.getResourceAsStream(fileName);</technical_language>

Target:
public InputStream lookupFileStrict(URI uri, ClassLoader cl) throws FileNotFoundException { int startIndex = uri.toString().lastIndexOf(':'); String fileName = uri.toString().substring(startIndex + 1); return cl.getResourceAsStream(fileName); }
Source:
<code>public static ByteBuf copiedBuffer(CharSequence string, Charset charset) { ObjectUtil.checkNotNull(string, "string"); if (CharsetUtil.UTF_8.equals(charset)) { <START> return copiedBufferUtf8(string, 0, string.length()); <END> } if (CharsetUtil.US_ASCII.equals(charset)) { return copiedBufferAscii(string, 0, string.length()); } if (string instanceof CharBuffer) { return copiedBuffer((CharBuffer) string, charset); } return copiedBuffer(CharBuffer.wrap(string), charset); }</code><technical_language>I modified, 'ByteBufUtil.writeAscii' perform vector optimization understand: new version in this PR trigger auto-vectorization here? Or, gonna change this part I reviewed happen, instead</technical_language>

Target:
public static ByteBuf copiedBuffer(CharSequence string, Charset charset) { ObjectUtil.checkNotNull(string, "string"); if (CharsetUtil.UTF_8.equals(charset)) { return copiedBufferUtf8(string, 0, string.length()); } if (CharsetUtil.US_ASCII.equals(charset)) { return copiedBufferAscii(string); } if (string instanceof CharBuffer) { return copiedBuffer((CharBuffer) string, charset); } return copiedBuffer(CharBuffer.wrap(string), charset); }
Source:
<code>FSMountPoint(String workspaceId, java.io.File ioRoot, EventService eventService, SearcherProvider searcherProvider) { this.workspaceId = workspaceId; this.ioRoot = ioRoot; this.eventService = eventService; this.searcherProvider = searcherProvider; root = new VirtualFileImpl(ioRoot, Path.ROOT, pathToId(Path.ROOT), this); pathLockFactory = new PathLockFactory(FILE_LOCK_MAX_THREADS); locksSerializer = new FileLockSerializer(); lockTokensCache = new Cache[CACHE_PARTITIONS_NUM]; metadataSerializer = new FileMetadataSerializer(); metadataCache = new Cache[CACHE_PARTITIONS_NUM]; for (int i = 0; i < CACHE_PARTITIONS_NUM; i++) { lockTokensCache[i] = new SynchronizedCache(new FileLockCache()); metadataCache[i] = new SynchronizedCache(new FileMetadataCache()); } userContext = VirtualFileSystemUserContext.newInstance(); List<AccessControlEntry> acl = new ArrayList<>(2); acl.add(newDto(AccessControlEntry.class) .withPrincipal(newDto(Principal.class) .withName("user") .withType(Principal.Type.GROUP)) .withPermissions(singletonList("all"))); acl.add(newDto(AccessControlEntry.class) .withPrincipal(newDto(Principal.class) .withName("temp_user") .withType(Principal.Type.GROUP)) .withPermissions(singletonList("all"))); DEFAULT_ACL.update(acl, true); <START> <END> }</code><technical_language>4 empty lines</technical_language>

Target:
FSMountPoint(String workspaceId, java.io.File ioRoot, EventService eventService, SearcherProvider searcherProvider) { this.workspaceId = workspaceId; this.ioRoot = ioRoot; this.eventService = eventService; this.searcherProvider = searcherProvider; root = new VirtualFileImpl(ioRoot, Path.ROOT, pathToId(Path.ROOT), this); pathLockFactory = new PathLockFactory(FILE_LOCK_MAX_THREADS); locksSerializer = new FileLockSerializer(); lockTokensCache = new Cache[CACHE_PARTITIONS_NUM]; metadataSerializer = new FileMetadataSerializer(); metadataCache = new Cache[CACHE_PARTITIONS_NUM]; for (int i = 0; i < CACHE_PARTITIONS_NUM; i++) { lockTokensCache[i] = new SynchronizedCache(new FileLockCache()); metadataCache[i] = new SynchronizedCache(new FileMetadataCache()); } userContext = VirtualFileSystemUserContext.newInstance(); List<AccessControlEntry> acl = new ArrayList<>(2); acl.add(newDto(AccessControlEntry.class) .withPrincipal(newDto(Principal.class) .withName("user") .withType(Principal.Type.GROUP)) .withPermissions(singletonList("all"))); acl.add(newDto(AccessControlEntry.class) .withPrincipal(newDto(Principal.class) .withName("temp_user") .withType(Principal.Type.GROUP)) .withPermissions(singletonList("all"))); defaultAcl.update(acl, true); }
Source:
<code>public void noCrossClientPollution() throws IOException { int round = 200; int otherRound = 100; PaxosStateLog<PaxosValue> fileBasedLog = createFileSystemLog(CLIENT); fileBasedLog.writeRound(round, valueForRound(round)); PaxosLearner learner = paxosComponents.learner(CLIENT); Client otherClient = Client.of("other"); PaxosStateLog<PaxosValue> otherFileBasedLog = createFileSystemLog(otherClient); otherFileBasedLog.writeRound(otherRound, valueForRound(otherRound)); <START> fileBasedLog.writeRound(round, valueForRound(round)); <END> PaxosLearner otherLearner = paxosComponents.learner(otherClient); PaxosStorageParameters otherParameters = getParametersForClient(otherClient); PaxosStateLog<PaxosValue> otherSqliteLog = createSqliteLog(otherParameters); assertValueAbsent(round, otherSqliteLog); assertValuePresent(otherRound, otherSqliteLog); assertValueLearned(round, learner); assertValueNotLearned(otherRound, learner); assertValueNotLearned(round, otherLearner); assertValueLearned(otherRound, otherLearner); }</code><technical_language>I done in 162</technical_language>

Target:
public void noCrossClientPollution() throws IOException { int round = 200; int otherRound = 100; PaxosStateLog<PaxosValue> fileBasedLog = createFileSystemLog(CLIENT); fileBasedLog.writeRound(round, valueForRound(round)); PaxosLearner learner = paxosComponents.learner(CLIENT); Client otherClient = Client.of("other"); PaxosStateLog<PaxosValue> otherFileBasedLog = createFileSystemLog(otherClient); otherFileBasedLog.writeRound(otherRound, valueForRound(otherRound)); PaxosLearner otherLearner = paxosComponents.learner(otherClient); PaxosStorageParameters otherParameters = paxosComponents.getLearnerParameters(otherClient); PaxosStateLog<PaxosValue> otherSqliteLog = createSqliteLog(otherParameters); assertValueAbsent(round, otherSqliteLog); assertValuePresent(otherRound, otherSqliteLog); assertValueLearned(round, learner); assertValueNotLearned(otherRound, learner); assertValueNotLearned(round, otherLearner); assertValueLearned(otherRound, otherLearner); }
Source:
<code>private Pair<JobInfo.Status, String> orchestrateStart(final VmWorkStart work) throws Exception { final VMInstanceVO vm = _entityMgr.findById(VMInstanceVO.class, work.getVmId()); if (vm == null) { s_logger.info("Unable to find vm " + work.getVmId()); } assert vm != null; try{ orchestrateStart(vm.getUuid(), work.getParams(), work.getPlan(), _dpMgr.getDeploymentPlannerByName(work.getDeploymentPlanner())); } catch (CloudRuntimeException e){ s_logger.info("Caught CloudRuntimeException, returning job failed"); CloudRuntimeException ex = new CloudRuntimeException("Unable to start VM instance : " + e); <START> return new Pair<JobInfo.Status, String>(JobInfo.Status.FAILED, JobSerializerHelper.toObjectSerializedString(ex)); <END> } return new Pair<JobInfo.Status, String>(JobInfo.Status.SUCCEEDED, null); }</code><technical_language>return e instead of creating a new ex</technical_language>

Target:
private Pair<JobInfo.Status, String> orchestrateStart(final VmWorkStart work) throws Exception { final VMInstanceVO vm = _entityMgr.findById(VMInstanceVO.class, work.getVmId()); if (vm == null) { s_logger.info("Unable to find vm " + work.getVmId()); } assert vm != null; try{ orchestrateStart(vm.getUuid(), work.getParams(), work.getPlan(), _dpMgr.getDeploymentPlannerByName(work.getDeploymentPlanner())); } catch (CloudRuntimeException e){ s_logger.info("Caught CloudRuntimeException, returning job failed " + e); CloudRuntimeException ex = new CloudRuntimeException("Unable to start VM instance"); return new Pair<JobInfo.Status, String>(JobInfo.Status.FAILED, JobSerializerHelper.toObjectSerializedString(ex)); } return new Pair<JobInfo.Status, String>(JobInfo.Status.SUCCEEDED, null); }
Source:
<code>private void sendCommand(AirConditioner aircon, CommandEnum property, String value, String hostName) { int i = 1; boolean commandSent = false; while (i < 5 && !commandSent) { try { logger.debug("[" + i + "/5] Sending command: " + value + " to property:" + property + " with ip:" + aircon.getIpAddress()); Map<CommandEnum, String> status = aircon.sendCommand(property, value); if (status != null) { commandSent = true; <START> logger.debug("Command[" + value + "] sent on try number " + i); <END> updateAllItemsFromStatusMap(status, hostName); } } catch (Exception e) { logger.warn("Could not send value: '" + value + "' to property:'" + property + "', try " + i + "/5"); e.printStackTrace(); } finally { i++; } } }</code><technical_language>parameterize logging in binding, in order avoid lots of unnecessary object creation garbage collection</technical_language>

Target:
private void sendCommand(AirConditioner aircon, CommandEnum property, String value, String hostName) { int i = 1; boolean commandSent = false; while (i < 5 && !commandSent) { try { logger.debug("[{}/5] Sending command: to property:{} with ip:{}", i, value, property, aircon.getIpAddress()); Map<CommandEnum, String> status = aircon.sendCommand(property, value); if (status != null) { commandSent = true; logger.debug("Command[{}] sent on try number {}", value, i); updateAllItemsFromStatusMap(status, hostName); } } catch (Exception e) { logger.warn("Could not send value: '{}' to property:'{}', try {}/5", value, property, i); e.printStackTrace(); } finally { i++; } } }
Source:
<code>ThreadNameChangeHandler() { boolean isEnabled = <START> System.getProperty("org.eclipse.jdt.internal.debug.core.model.ThreadNameChangeListener.disable") == <END> null; if (isEnabled) { createRequest(); } }</code><technical_language>please move a constant</technical_language>

Target:
ThreadNameChangeHandler() { boolean isEnabled = System.getProperty(DISABLE_THREAD_NAME_CHANGE_LISTENER) == null; if (isEnabled) { createRequest(); } }
Source:
<code>public DelegatingResourceDescription getRepresentationDescription(Representation rep) { DelegatingResourceDescription description = new DelegatingResourceDescription(); <START> description.addProperty("reaction", rep); <END> description.addProperty("reactionNonCoded", rep); return description; }</code><technical_language>want do depending is default full representation do for other resources</technical_language>

Target:
public DelegatingResourceDescription getRepresentationDescription(Representation rep) { DelegatingResourceDescription description = new DelegatingResourceDescription(); if (rep instanceof DefaultRepresentation) { description.addProperty("reaction", Representation.REF); description.addProperty("reactionNonCoded"); } else if (rep instanceof FullRepresentation) { description.addProperty("reaction", Representation.DEFAULT); description.addProperty("reactionNonCoded"); } return description; }
Source:
<code><START> public void setVmId(Guid value) { <END> privateVmId = value; }</code><technical_language>change public</technical_language>

Target:
private void setVmId(Guid value) { privateVmId = value; }
Source:
<code><START> default Set<MessageHandlerInterceptor<? super EventMessage<?>>> getHandlerInterceptors() { <END> throw new UnsupportedOperationException("No implementation found to get the HandlerInterceptors"); }</code><technical_language>This method return a List, interceptors order</technical_language>

Target:
default List<MessageHandlerInterceptor<? super EventMessage<?>>> getHandlerInterceptors() { throw new UnsupportedOperationException("No implementation found to get the HandlerInterceptors"); }
Source:
<code>@Override public Set<Entry<Integer, GridDhtPartitionState>> entrySet() { return new AbstractSet<Entry<Integer, GridDhtPartitionState>>() { @Override public Iterator<Entry<Integer, GridDhtPartitionState>> iterator() { return new Iterator<Entry<Integer, GridDhtPartitionState>>() { private int idx; private int cur; <START> @Override public boolean hasNext() { <END> idx = states.nextSetBit(idx); return idx != -1; } @Override public Entry<Integer, GridDhtPartitionState> next() { if (!hasNext()) throw new NoSuchElementException(); cur = idx / BITS; int bitN = idx % BITS; int st = 1 << bitN; for (int i = 1; i < BITS - bitN; i++) st |= (states.get(idx + i) ? 1 : 0) << i + bitN; final int ordinal = st - 1; idx += (BITS - bitN); return new Entry<Integer, GridDhtPartitionState>() { int p = cur; int state = ordinal; @Override public Integer getKey() { return p; } @Override public GridDhtPartitionState getValue() { return GridDhtPartitionState.fromOrdinal(state); } @Override public GridDhtPartitionState setValue(GridDhtPartitionState val) { return setState(p, val); } }; } @Override public void remove() { setState(cur, null); } }; } @Override public int size() { return GridPartitionStateMap.this.size(); } }; }</code><technical_language>next called change iterarot state</technical_language>

Target:
@Override public Set<Entry<Integer, GridDhtPartitionState>> entrySet() { return new AbstractSet<Entry<Integer, GridDhtPartitionState>>() { @Override public Iterator<Entry<Integer, GridDhtPartitionState>> iterator() { return new Iterator<Entry<Integer, GridDhtPartitionState>>() { private int idx; private int cur; @Override public boolean hasNext() { idx = states.nextSetBit(idx); return idx != -1; } @Override public Entry<Integer, GridDhtPartitionState> next() { if (!hasNext()) throw new NoSuchElementException(); cur = idx / BITS; int bitN = idx % BITS; int st = 1 << bitN; for (int i = 1; i < BITS - bitN; i++) st |= (states.get(idx + i) ? 1 : 0) << i + bitN; final int ordinal = st - 1; idx += (BITS - bitN); return new Entry<Integer, GridDhtPartitionState>() { int p = cur; @Override public Integer getKey() { return p; } @Override public GridDhtPartitionState getValue() { return GridDhtPartitionState.fromOrdinal(ordinal); } @Override public GridDhtPartitionState setValue(GridDhtPartitionState val) { return setState(p, val); } }; } @Override public void remove() { setState(cur, null); } }; } @Override public int size() { return GridPartitionStateMap.this.size(); } }; }
Source:
<code>public Set<Locator> getExcessEnumMetrics() throws IOException { <START> Timer.Context ctx = Instrumentation.getBatchReadTimerContext(CassandraModel.CF_METRICS_EXCESS_ENUMS_NAME); <END> Session session = DatastaxIO.getSession(); final Set<Locator> excessEnumMetrics = new HashSet<Locator>(); try { BoundStatement bs = getValue.bind(); List<Row> results = session.execute(bs).all(); for ( Row row : results ) { if ( LOG.isTraceEnabled() ) { LOG.trace( "Read metrics_excess_enums: " + row.getString( KEY )); } excessEnumMetrics.add(Locator.createLocatorFromDbKey(row.getString(KEY))); } return excessEnumMetrics; } finally { ctx.stop(); } }</code><technical_language>I if this BatchReadTimer.... I Astyanax Batch, Datastax doesn't.. so..</technical_language>

Target:
public Set<Locator> getExcessEnumMetrics() throws IOException { Timer.Context ctx = Instrumentation.getReadTimerContext(CassandraModel.CF_METRICS_EXCESS_ENUMS_NAME); Session session = DatastaxIO.getSession(); final Set<Locator> excessEnumMetrics = new HashSet<Locator>(); try { BoundStatement bs = getValue.bind(); List<Row> results = session.execute(bs).all(); for ( Row row : results ) { if ( LOG.isTraceEnabled() ) { LOG.trace( "Read metrics_excess_enums: " + row.getString( KEY )); } excessEnumMetrics.add(Locator.createLocatorFromDbKey(row.getString(KEY))); } return excessEnumMetrics; } finally { ctx.stop(); } }