auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void addInodeDirectoryFromJournal(InodeDirectoryEntry entry) throws AccessControlException { InodeDirectory directory = InodeDirectory.fromJournalEntry(entry); if (directory.getName().equals(ROOT_INODE_NAME)) { // This is the root inode. Clear all the state, and set the root. reset(); setRoot(directory); // If journal entry has no security enabled, change the replayed inode permission to be 0777 // for backwards-compatibility. if (SecurityUtils.isSecurityEnabled() && entry.hasMode()) { mRoot.setMode(Constants.DEFAULT_FILE_SYSTEM_MODE); } } else { addInodeFromJournalInternal(directory, entry.hasMode()); } }

Target:
public void addInodeDirectoryFromJournal(InodeDirectoryEntry entry) throws AccessControlException { InodeDirectory directory = InodeDirectory.fromJournalEntry(entry); if (directory.getName().equals(ROOT_INODE_NAME)) { // This is the root inode. Clear all the state, and set the root. reset(); setRoot(directory); } else { addInodeFromJournalInternal(directory); } }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof FreeOptions)) { return false; } FreeOptions that = (FreeOptions) o; return Objects.equal(mForced, that.mForced) && Objects.equal(mCommonOptions, that.mCommonOptions) && Objects.equal(mRecursive, that.mRecursive); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof FreeOptions)) { return false; } FreeOptions that = (FreeOptions) o; return Objects.equal(mCommonOptions, that.mCommonOptions) && Objects.equal(mForced, that.mForced) && Objects.equal(mRecursive, that.mRecursive); }
Source:
public int hashCode() { return Objects.hashCode(mLoadMetadataType, mCommonOptions); }

Target:
public int hashCode() { return Objects.hashCode(mCommonOptions, mLoadMetadataType); }
Source:
public int hashCode() { return Objects .hashCode(mAllowExists, mMode, mRecursive, mTtl, mTtlAction, mWriteType, mCommonOptions); }

Target:
public int hashCode() { return Objects .hashCode(mAllowExists, mCommonOptions, mMode, mRecursive, mTtl, mTtlAction, mWriteType); }
Source:
public static void printHelp(String message) { System.err.println(message); HelpFormatter formatter = new HelpFormatter(); formatter.printHelp(USAGE, null, OPTIONS, null, true); }

Target:
public static void printHelp(String message) { System.err.println(message); HelpFormatter formatter = new HelpFormatter(); formatter.printHelp(USAGE, OPTIONS, true); }
Source:
protected void updateStreams() throws IOException { long blockId = mPositionState.getBlockId(); if (blockId == mCurrentBlockId && mCurrentBlockInStream != null && mCurrentBlockInStream.remaining() != 0) { return; } checkCacheStreamInSync(); updateBlockInStream(blockId); if (PASSIVE_CACHE_ENABLED) { updateCacheStream(blockId); } mCurrentBlockId = blockId; mCurrentBlockStartPos = mPositionState.getBlockStartPos(); mCurrentBlockEndPos = mPositionState.getNextBlockStartPos(); }

Target:
private void updateStreams() throws IOException { long blockId = mPositionState.getBlockId(); if (mCurrentBlockInStream != null && mCurrentBlockInStream.getId() == blockId && mCurrentBlockInStream.remaining() != 0) { return; } checkCacheStreamInSync(); updateBlockInStream(blockId); if (PASSIVE_CACHE_ENABLED) { updateCacheStream(blockId); } }
Source:
public void operationComplete(ChannelFuture future) { if (!future.isSuccess()) { future.channel().close(); } try (LockResource lr = new LockResource(mLock)) { if (future.cause() != null) { updateException(future.cause()); mDoneOrFailed.signal(); mBufferNotFullOrFailed.signal(); mBufferEmptyOrFailed.signal(); } } }

Target:
public void operationComplete(ChannelFuture future) { if (!future.isSuccess()) { future.channel().close(); try (LockResource lr = new LockResource(mLock)) { updateException(future.cause()); mDoneOrFailed.signal(); mBufferNotFullOrFailed.signal(); mBufferEmptyOrFailed.signal(); } } }
Source:
public void zookeeper() throws Exception { mCluster = MultiProcessCluster.newBuilder() .setClusterName("zookeeper") .addProperty(PropertyKey.ZOOKEEPER_ENABLED, "true") .setNumMasters(3) .setNumWorkers(2) .build(); boolean success = false; try { mCluster.start(); FileSystem fs = mCluster.getFileSystemClient(); createAndOpenFile(fs); mSuccess = true; } finally { cleanup(); } }

Target:
public void zookeeper() throws Exception { mCluster = MultiProcessCluster.newBuilder() .setClusterName("zookeeper") .addProperty(PropertyKey.ZOOKEEPER_ENABLED, "true") .setNumMasters(3) .setNumWorkers(2) .build(); try { mCluster.start(); FileSystem fs = mCluster.getFileSystemClient(); createAndOpenFile(fs); mSuccess = true; } finally { cleanup(); } }
Source:
public JvmPauseMonitor reset() { mJvmMonitorThread = null; mThreadStarted = true; return this; }

Target:
public void reset() { mJvmMonitorThread = null; }
Source:
private boolean shouldCachePartiallyReadBlock() throws IOException { return mShouldCache && mCachePartiallyReadBlock; }

Target:
private boolean shouldCachePartiallyReadBlock() { return mShouldCache && mCachePartiallyReadBlock; }
Source:
public void getNonExistingBucket() throws Exception { final String bucketName = "non-existing-bucket"; try { // Delete a non-existing bucket should fail. new TestCase(mHostname, mPort, S3_SERVICE_PREFIX + AlluxioURI.SEPARATOR + bucketName, NO_PARAMS, HttpMethod.GET, null, TestCaseOptions.defaults().setContentType(TestCaseOptions.XML_CONTENT_TYPE)).run(); Assert.fail("get a non-existing bucket should fail"); } catch (AssertionError e) { // expected } }

Target:
public void getNonExistingBucket() throws Exception { final String bucketName = "non-existing-bucket"; try { // Delete a non-existing bucket should fail. new TestCase(mHostname, mPort, S3_SERVICE_PREFIX + AlluxioURI.SEPARATOR + bucketName, NO_PARAMS, HttpMethod.GET, null, TestCaseOptions.defaults().setContentType(TestCaseOptions.XML_CONTENT_TYPE)).run(); } catch (AssertionError e) { // expected return; } Assert.fail("get a non-existing bucket should fail"); }
Source:
private UserLimitValidationTask(String name, String command, Integer lowerBound, Integer upperBound) { mName = name; mCommand = new String[] {"bash", "-c", command}; mLowerBound = lowerBound; mUpperBound = upperBound; }

Target:
private UserLimitValidationTask(String name, String command, Integer lowerBound, Integer upperBound) { mName = name; mCommand = command; mLowerBound = lowerBound; mUpperBound = upperBound; }
Source:
public static void stopProcessOnShutdown(final Process process) { Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { try { process.stop(); } catch (Exception e) { LOG.error("Failed to shutdown process."); System.exit(0); } } }); }

Target:
public static void stopProcessOnShutdown(final Process process) { Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { try { process.stop(); } catch (Exception e) { LOG.error("Failed to shutdown process.", e); System.exit(0); } } }); }
Source:
public void stop() { synchronized (this) { if (!mStopped) { mLoggingWorkerThread.interrupt(); try { mLoggingWorkerThread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } finally { mStopped = true; mLoggingWorkerThread = null; LOG.info("AsyncUserAccessAuditLogWriter thread stopped."); } } } }

Target:
public synchronized void stop() { if (!mStopped) { mLoggingWorkerThread.interrupt(); try { mLoggingWorkerThread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } finally { mStopped = true; mLoggingWorkerThread = null; LOG.info("AsyncUserAccessAuditLogWriter thread stopped."); } } }
Source:
public synchronized Inode getLastExistingInode() { Inode<?> inode = mInodes.get(mInodes.size() - 1); return inode; }

Target:
public synchronized Inode getLastExistingInode() { return mInodes.get(mInodes.size() - 1); }
Source:
public static boolean isValid(String input) { // Check if input matches any default keys if (DEFAULT_KEYS_MAP.containsKey(input)) { return true; } // Check if the input matches any alias if (DEFAULT_ALIAS_MAP.containsKey(input)) { return true; } // Check if input matches any parameterized keys for (Template template : Template.values()) { Matcher matcher = template.mPattern.matcher(input); if (matcher.matches()) { return true; } } return false; }

Target:
public static boolean isValid(String input) { // Check if input matches any default keys or aliases if (DEFAULT_KEYS_MAP.containsKey(input) || DEFAULT_ALIAS_MAP.containsKey(input)) { return true; } // Check if input matches any parameterized keys for (Template template : Template.values()) { Matcher matcher = template.mPattern.matcher(input); if (matcher.matches()) { return true; } } return false; }
Source:
private void init() { mMasterInquireClient = MasterInquireClient.Factory.create(); mFileSystemMasterClientPool = new FileSystemMasterClientPool(mParentSubject, mMasterInquireClient); mBlockMasterClientPool = new BlockMasterClientPool(mParentSubject, mMasterInquireClient); }

Target:
private synchronized void init() { mMasterInquireClient = MasterInquireClient.Factory.create(); mFileSystemMasterClientPool = new FileSystemMasterClientPool(mParentSubject, mMasterInquireClient); mBlockMasterClientPool = new BlockMasterClientPool(mParentSubject, mMasterInquireClient); }
Source:
public String getDescription() { return mDescription != null ? mDescription : "N/A"; }

Target:
public String getDescription() { return mDescription; }
Source:
public void tailFileWithUserSpecifiedBytesWithUnit() throws Exception { FileSystemTestUtils.createByteFile(mFileSystem, "/testFile", WriteType.MUST_CACHE, 10000); mFsShell.run("tail", "-c", "2KB", "/testFile"); byte[] expect = BufferUtils.getIncreasingByteArray(0, 2048); Assert.assertArrayEquals(expect, mOutput.toByteArray()); }

Target:
public void tailFileWithUserSpecifiedBytesWithUnit() throws Exception { FileSystemTestUtils.createByteFile(mFileSystem, "/testFile", WriteType.MUST_CACHE, 10000); mFsShell.run("tail", "-c", "2KB", "/testFile"); byte[] expect = BufferUtils.getIncreasingByteArray(10000 - 2048, 2048); Assert.assertArrayEquals(expect, mOutput.toByteArray()); }
Source:
public LineageMaster create(MasterRegistry registry, JournalFactory journalFactory) { Preconditions.checkArgument(journalFactory != null, "journal factory may not be null"); LOG.info("Creating ", DefaultLineageMaster.class.getName()); FileSystemMaster fileSystemMaster = registry.get(FileSystemMaster.class); LineageMaster lineageMaster = new DefaultLineageMaster(fileSystemMaster, journalFactory); registry.add(DefaultLineageMaster.class, lineageMaster); return lineageMaster; }

Target:
public LineageMaster create(MasterRegistry registry, JournalFactory journalFactory) { Preconditions.checkArgument(journalFactory != null, "journal factory may not be null"); LOG.info("Creating ", LineageMaster.class.getName()); FileSystemMaster fileSystemMaster = registry.get(FileSystemMaster.class); LineageMaster lineageMaster = new DefaultLineageMaster(fileSystemMaster, journalFactory); registry.add(LineageMaster.class, lineageMaster); return lineageMaster; }
Source:
static PropertyKey create(String name, Object defaultValue, String[] aliases) { PropertyKey key = new PropertyKey(name); for (String alias : aliases) { DEFAULT_KEYS_MAP.put(alias, key); } DEFAULT_KEYS_MAP.put(name, key); DEFAULT_VALUES.put(key, defaultValue); return key; }

Target:
static PropertyKey create(String name, Object defaultValue, String[] aliases) { PropertyKey key = create(name, defaultValue); if (aliases != null) { for (String alias : aliases) { DEFAULT_KEYS_MAP.put(alias, key); } } return key; }
Source:
public static void createFile(String filePath) throws IOException { Path storagePath = Paths.get(filePath); Files.createDirectories(storagePath.getParent()); try { Files.createFile(storagePath); } catch (FileAlreadyExistsException e) { throw new IOException("File already exist " + filePath); } }

Target:
public static void createFile(String filePath) throws IOException { Path storagePath = Paths.get(filePath); Files.createDirectories(storagePath.getParent()); Files.createFile(storagePath); }
Source:
public static void createDir(String path) throws IOException { try { Files.createDirectories(Paths.get(path)); } catch (AccessDeniedException e) { throw new IOException("Fail to create folder " + path); } }

Target:
public static void createDir(String path) throws IOException { Files.createDirectories(Paths.get(path)); }
Source:
public void start(Boolean isLeader) throws IOException { super.start(isLeader); mGlobalStorageTierAssoc = new MasterStorageTierAssoc(); if (isLeader) { LOG.info("I am blockmaster. I have blocks", mBlocks.size()); mLostWorkerDetectionService = getExecutorService().submit(new HeartbeatThread( HeartbeatContext.MASTER_LOST_WORKER_DETECTION, new LostWorkerDetectionHeartbeatExecutor(), (int) Configuration.getMs(PropertyKey.MASTER_HEARTBEAT_INTERVAL_MS))); } }

Target:
public void start(Boolean isLeader) throws IOException { super.start(isLeader); mGlobalStorageTierAssoc = new MasterStorageTierAssoc(); if (isLeader) { mLostWorkerDetectionService = getExecutorService().submit(new HeartbeatThread( HeartbeatContext.MASTER_LOST_WORKER_DETECTION, new LostWorkerDetectionHeartbeatExecutor(), (int) Configuration.getMs(PropertyKey.MASTER_HEARTBEAT_INTERVAL_MS))); } }
Source:
private ObjectListing getObjectListingChunkV1(ListObjectsRequest request) { ObjectListing result; try { // Query S3 for the next batch of objects result = mClient.listObjects(request); // Advance the request continuation token to the next set of objects request.setMarker(result.getNextMarker()); } catch (AmazonClientException e) { LOG.error("Failed to list path {}", request.getPrefix(), e); result = null; } return result; }

Target:
private ObjectListing getObjectListingChunkV1(ListObjectsRequest request) throws IOException { ObjectListing result; try { // Query S3 for the next batch of objects result = mClient.listObjects(request); // Advance the request continuation token to the next set of objects request.setMarker(result.getNextMarker()); } catch (AmazonClientException e) { throw new IOException(e); } return result; }
Source:
S3AObjectListingChunkV1(ListObjectsRequest request, ObjectListing result) throws IOException { Preconditions.checkNotNull(result, "result"); mRequest = request; mResult = result; }

Target:
S3AObjectListingChunkV1(ListObjectsRequest request, ObjectListing result) { Preconditions.checkNotNull(result, "result"); mRequest = request; mResult = result; }
Source:
private ListObjectsV2Result getObjectListingChunk(ListObjectsV2Request request) throws IOException { ListObjectsV2Result result; try { // Query S3 for the next batch of objects result = mClient.listObjectsV2(request); // Advance the request continuation token to the next set of objects request.setContinuationToken(result.getNextContinuationToken()); } catch (AmazonClientException e) { throw new IOException(e.getMessage()); } return result; }

Target:
private ListObjectsV2Result getObjectListingChunk(ListObjectsV2Request request) throws IOException { ListObjectsV2Result result; try { // Query S3 for the next batch of objects result = mClient.listObjectsV2(request); // Advance the request continuation token to the next set of objects request.setContinuationToken(result.getNextContinuationToken()); } catch (AmazonClientException e) { throw new IOException(e); } return result; }
Source:
public void cancel() { if (mClosed) { return; } mClosed = true; mOutStream.cancel(); mOutStream.close(); }

Target:
public void cancel() throws IOException { if (mClosed) { return; } mClosed = true; mOutStream.cancel(); }
Source:
public HdfsUnderFileSystem(AlluxioURI ufsUri, UnderFileSystemConfiguration conf, Configuration hdfsConf) { super(ufsUri); mUfsConf = conf; Path path = new Path(ufsUri.toString()); try { // Set Hadoop UGI configuration to ensure UGI can be initialized by the shaded classes for // group service. UserGroupInformation.setConfiguration(hdfsConf); mFileSystem = path.getFileSystem(hdfsConf); } catch (IOException e) { LOG.warn("Exception thrown when trying to get FileSystem for : {}", ufsUri, e.getMessage()); throw new RuntimeException("Failed to create Hadoop FileSystem", e); } }

Target:
HdfsUnderFileSystem(AlluxioURI ufsUri, UnderFileSystemConfiguration conf, Configuration hdfsConf) { super(ufsUri); mUfsConf = conf; Path path = new Path(ufsUri.toString()); try { // Set Hadoop UGI configuration to ensure UGI can be initialized by the shaded classes for // group service. UserGroupInformation.setConfiguration(hdfsConf); mFileSystem = path.getFileSystem(hdfsConf); } catch (IOException e) { LOG.warn("Exception thrown when trying to get FileSystem for : {}", ufsUri, e.getMessage()); throw new RuntimeException("Failed to create Hadoop FileSystem", e); } }
Source:
public void channelRead(ChannelHandlerContext ctx, Object msg) { if (!acceptMessage(msg)) { ctx.fireChannelRead(msg); return; } ProtoMessage message = ((RPCProtoMessage) msg).getMessage(); if (message.isLocalBlockOpenRequest()) { handleBlockOpenRequest(ctx, message.asLocalBlockOpenRequest()); } else { Preconditions.checkState(message.isLocalBlockCloseRequest()); handleBlockCloseRequest(ctx, message.asLocalBlockCloseRequest()); } }

Target:
public void channelRead(ChannelHandlerContext ctx, Object msg) { if (!(msg instanceof RPCProtoMessage)) { ctx.fireChannelRead(msg); return; } ProtoMessage message = ((RPCProtoMessage) msg).getMessage(); if (message.isLocalBlockOpenRequest()) { handleBlockOpenRequest(ctx, message.asLocalBlockOpenRequest()); } else if (message.isLocalBlockCloseRequest()) { handleBlockCloseRequest(ctx, message.asLocalBlockCloseRequest()); } else { ctx.fireChannelRead(msg); } }
Source:
public DataBuffer readPacket() { if (mPos >= mEnd) { return null; } initIfNot(); ByteBuffer buffer = mReader.read(mPos, Math.min(LOCAL_READ_PACKET_SIZE, mEnd - mPos)); DataBuffer dataBuffer = new DataByteBuffer(buffer, buffer.remaining()); mPos += dataBuffer.getLength(); return dataBuffer; }

Target:
public DataBuffer readPacket() { if (mPos >= mEnd) { return null; } ByteBuffer buffer = mReader.read(mPos, Math.min(LOCAL_READ_PACKET_SIZE, mEnd - mPos)); DataBuffer dataBuffer = new DataByteBuffer(buffer, buffer.remaining()); mPos += dataBuffer.getLength(); return dataBuffer; }
Source:
private CompleteUfsFileOptions() { if (SecurityUtils.isSecurityEnabled()) { mOwner = SecurityUtils.getOwnerFromLoginModule(); mGroup = SecurityUtils.getGroupFromLoginModule(); } else { mOwner = ""; mGroup = ""; } mMode = Mode.defaults().applyFileUMask(); // TODO(chaomin): set permission based on the alluxio file. Not needed for now since the // file is always created with default permission. }

Target:
private CompleteUfsFileOptions() { mOwner = SecurityUtils.getOwnerFromLoginModule(); mGroup = SecurityUtils.getGroupFromLoginModule(); mMode = Mode.defaults().applyFileUMask(); // TODO(chaomin): set permission based on the alluxio file. Not needed for now since the // file is always created with default permission. }
Source:
protected void stopServing() throws Exception { LOG.info("Alluxio master version stop serving @ (was serving: {})", RuntimeConstants.VERSION, mRpcAddress, mIsServing); if (mThriftServer != null) { mThriftServer.stop(); mThriftServer = null; } if (mWebServer != null) { mWebServer.stop(); mWebServer = null; } MetricsSystem.stopSinks(); mIsServing = false; }

Target:
protected void stopServing() throws Exception { if (mThriftServer != null) { mThriftServer.stop(); mThriftServer = null; } if (mWebServer != null) { mWebServer.stop(); mWebServer = null; } MetricsSystem.stopSinks(); mIsServing = false; }
Source:
public final void after() throws Exception { if (HadoopClientTestUtils.isHadoop1x()) { return; } mMultiMasterLocalAlluxioCluster.stop(); }

Target:
public final void after() throws Exception { mMultiMasterLocalAlluxioCluster.stop(); }
Source:
public void start() throws Exception { LOG.info("Starting Alluxio master @{}", mRpcAddress); startMasters(true); startServing(); }

Target:
public void start() throws Exception { startMasters(true); startServing(); }
Source:
public static void run(Process process) { try { LOG.info("Starting {}.", process); process.start(); System.exit(0); } catch (Exception e) { LOG.error("Uncaught exception while running {}, stopping it and exiting.", process, e); try { LOG.info("Stopping {}.", process); process.stop(); } catch (Exception e2) { // continue to exit LOG.error("Uncaught exception while stopping {}, simply exiting.", process, e2); } System.exit(-1); } }

Target:
public static void run(Process process) { try { LOG.info("Starting {}.", process); process.start(); LOG.info("Stopping {}.", process); System.exit(0); } catch (Exception e) { LOG.error("Uncaught exception while running {}, stopping it and exiting.", process, e); try { process.stop(); } catch (Exception e2) { // continue to exit LOG.error("Uncaught exception while stopping {}, simply exiting.", process, e2); } System.exit(-1); } }
Source:
public void release(T resource) { if (resource != null) { mResources.add(resource); mCurrentCapacity.incrementAndGet(); try (LockResource r = new LockResource(mTakeLock)) { mNotEmpty.signal(); } } }

Target:
public void release(T resource) { if (resource != null) { mResources.add(resource); try (LockResource r = new LockResource(mTakeLock)) { mNotEmpty.signal(); } } }
Source:
public void run() { FileSystemMasterClient client = null; try { client = FileSystemContext.INSTANCE.acquireMasterClient(); } catch (IOException e) { Assert.fail("Failed to acquire a master client due to interruption occured."); } finally { FileSystemContext.INSTANCE.releaseMasterClient(client); } }

Target:
public void run() { FileSystemMasterClient client = FileSystemContext.INSTANCE.acquireMasterClient(); FileSystemContext.INSTANCE.releaseMasterClient(client); }
Source:
public T acquire() throws IOException { return acquire(WAIT_INDEFINITELY, null); }

Target:
public T acquire() { return acquire(WAIT_INDEFINITELY, null); }
Source:
public DataBuffer readPacket() throws IOException { if (mPos >= mEnd) { return null; } ByteBuffer buffer = ByteBuffer.wrap(mData, (int) mPos, (int) (Math.min(mPacketSize, mEnd) - mPos)); DataBuffer dataBuffer = new DataByteBuffer(buffer, buffer.remaining()); mPos += dataBuffer.getLength(); return dataBuffer; }

Target:
public DataBuffer readPacket() throws IOException { if (mPos >= mEnd) { return null; } ByteBuffer buffer = ByteBuffer.wrap(mData, (int) mPos, (int) (Math.min(mPacketSize, mEnd - mPos))); DataBuffer dataBuffer = new DataByteBuffer(buffer, buffer.remaining()); mPos += dataBuffer.getLength(); return dataBuffer; }
Source:
public void equalsTest() throws Exception { Assert.assertEquals(PropertyKey.Template.MASTER_MOUNT_TABLE_ENTRY_ALLUXIO.format("foo"), PropertyKey.Template.MASTER_MOUNT_TABLE_ENTRY_ALLUXIO.format("foo")); Assert.assertNotEquals(PropertyKey.HOME, PropertyKey.HOME); }

Target:
public void equalsTest() throws Exception { Assert.assertEquals(PropertyKey.Template.MASTER_MOUNT_TABLE_ENTRY_ALLUXIO.format("foo"), PropertyKey.Template.MASTER_MOUNT_TABLE_ENTRY_ALLUXIO.format("foo")); Assert.assertEquals(PropertyKey.HOME, PropertyKey.HOME); }
Source:
public void fields() { Random random = new Random(); boolean isPrimary = random.nextBoolean(); long sequenceNumber = random.nextLong(); JournalReaderOptions options = JournalReaderOptions.defaults(); options.setPrimary(isPrimary); Assert.assertEquals(isPrimary, options.isPrimary()); options.setNextSequenceNumber(sequenceNumber); Assert.assertEquals(sequenceNumber, options.getNextSequenceNumber()); }

Target:
public void fields() throws Exception { Random random = new Random(); boolean isPrimary = random.nextBoolean(); long sequenceNumber = random.nextLong(); JournalReaderOptions options = JournalReaderOptions.defaults(); options.setPrimary(isPrimary); Assert.assertEquals(isPrimary, options.isPrimary()); options.setNextSequenceNumber(sequenceNumber); Assert.assertEquals(sequenceNumber, options.getNextSequenceNumber()); }
Source:
public void run() { try { runInternal(); } catch (RuntimeException e) { LOG.error("{}: Failed to run journal checkpoint thread, crashing.", mMaster.getName(), e); System.exit(-1); } finally { if (mJournalReader != null) { try { mJournalReader.close(); } catch (IOException e) { LOG.warn("{}: Failed to close the journal reader with error {}.", mMaster.getName(), e.getMessage()); } } } }

Target:
public void run() { try { runInternal(); } catch (RuntimeException e) { LOG.error("{}: Failed to run journal checkpoint thread, crashing.", mMaster.getName(), e); throw e; } }
Source:
public JournalReader getReader(JournalReaderOptions options) { if (options.getLocation() != null) { return new UfsJournalFileReader(options); } else { return new UfsJournalReader(this, options); } }

Target:
public JournalReader getReader(JournalReaderOptions options) { return new UfsJournalReader(this, options); }
Source:
public Master create(MasterRegistry registry, JournalFactory journalFactory) { Preconditions.checkArgument(journalFactory != null, "journal factory may not be null"); LOG.info("Creating ", FileSystemMaster.class.getName()); return new DefaultFileSystemMaster(registry, journalFactory); }

Target:
public FileSystemMaster create(MasterRegistry registry, JournalFactory journalFactory) { Preconditions.checkArgument(journalFactory != null, "journal factory may not be null"); LOG.info("Creating ", FileSystemMaster.class.getName()); return new DefaultFileSystemMaster(registry, journalFactory); }
Source:
protected File generateRelativeFileContent(String path, byte[] toWrite) throws IOException, FileNotFoundException { File testFile = new File(System.getProperty("user.dir") + path); testFile.createNewFile(); FileOutputStream fos = new FileOutputStream(testFile); fos.write(toWrite); fos.close(); return testFile; }

Target:
protected File generateRelativeFileContent(String path, byte[] toWrite) throws IOException, FileNotFoundException { File testFile = new File(path); testFile.createNewFile(); FileOutputStream fos = new FileOutputStream(testFile); fos.write(toWrite); fos.close(); return testFile; }
Source:
public String getDescription() { return "Displays information for all files and directories directly under the specified path." + " Specify -R to display files and directories recursively." + " Specify -d to list directories as plain files." + " Specify -f to force loading files in the directory." + " Specify -raw to print raw sizes." + " Specify -p to list all the pinned files."; }

Target:
public String getDescription() { return "Displays information for all files and directories directly under the specified path." + " Specify -d to list directories as plain files." + " Specify -f to force loading files in the directory." + " Specify -p to list all the pinned files." + " Specify -R to display files and directories recursively." + " Specify -raw to print raw sizes."; }
Source:
public Collection<Master> getMasters() { List<Map.Entry<Class<?>, Master>> entries = new ArrayList<>(mRegistry.entrySet()); Collections.sort(entries, new DependencyComparator()); List<Master> masters = new ArrayList<>(); for (Map.Entry<Class<?>, Master> entry : entries) { masters.add(entry.getValue()); } return masters; }

Target:
public List<Master> getMasters() { List<Master> masters = new ArrayList<>(mRegistry.values()); Collections.sort(masters, new DependencyComparator()); return masters; }
Source:
public void processJournalCheckpoint(boolean applyToMaster) throws IOException { // Load the checkpoint. LOG.info("{}: Loading checkpoint.", mMaster.getName()); // The checkpoint stream must be retrieved before retrieving any log streams, because the // journal reader verifies that the checkpoint was read before the log streams. JournalInputStream is = mReader.getCheckpointInputStream(); if (applyToMaster) { // Only apply the checkpoint to the master, if specified. mMaster.processJournalCheckpoint(is); } // update the latest sequence number seen. mLatestSequenceNumber = is.getLatestSequenceNumber(); is.close(); }

Target:
public void processJournalCheckpoint(boolean applyToMaster) throws IOException { // Load the checkpoint. LOG.info("{}: Loading checkpoint.", mMaster.getName()); // The checkpoint stream must be retrieved before retrieving any log streams, because the // journal reader verifies that the checkpoint was read before the log streams. try (JournalInputStream is = mReader.getCheckpointInputStream()) { if (applyToMaster) { // Only apply the checkpoint to the master, if specified. mMaster.processJournalCheckpoint(is); } // update the latest sequence number seen. mLatestSequenceNumber = is.getLatestSequenceNumber(); } }
Source:
public void unknownException() { try { final String testMessage = "testMessage"; AlluxioTException tException = new AlluxioTException("testType", testMessage, "testClass"); AlluxioException exception = AlluxioException.fromThrift(tException); Assert.assertEquals(testMessage, exception.getMessage()); } catch (Exception e) { // this should never happen Assert.fail("unexpected exception" + e.getMessage()); } }

Target:
public void unknownException() { final String testMessage = "testMessage"; AlluxioTException tException = new AlluxioTException("testType", testMessage, "testClass"); AlluxioException exception = AlluxioException.fromThrift(tException); Assert.assertEquals(testMessage, exception.getMessage()); }
Source:
public UfsBlockReadRequestInternal(Protocol.ReadRequest request) throws Exception { mBlockReader = mWorker .readUfsBlock(request.getSessionId(), request.getId(), request.getOffset(), request.getNoCache()); mId = request.getId(); mStart = request.getOffset(); mEnd = mStart + request.getLength(); // Note that we do not need to seek to offset since the block worker is created at the offset. }

Target:
public UfsBlockReadRequestInternal(Protocol.ReadRequest request) throws Exception { mId = request.getId(); mStart = request.getOffset(); mEnd = mStart + request.getLength(); mBlockReader = mWorker.readUfsBlock(request.getSessionId(), mId, mStart, request.getNoCache()); // Note that we do not need to seek to offset since the block worker is created at the offset. }
Source:
private void createBlockFile(String blockPath) throws IOException { FileUtils.createBlockPath(blockPath); FileUtils.createFile(blockPath); FileUtils.changeLocalFileToFullPermission(blockPath); LOG.debug("Created new file block, block path: {}", blockPath); }

Target:
private static void createBlockFile(String blockPath) throws IOException { FileUtils.createBlockPath(blockPath); FileUtils.createFile(blockPath); FileUtils.changeLocalFileToFullPermission(blockPath); LOG.debug("Created new file block, block path: {}", blockPath); }
Source:
private BlockInfo getBlockInfo(long sessionId, long blockId) throws BlockDoesNotExistException { Key key = new Key(sessionId, blockId); BlockInfo blockInfo = mBlocks.get(key); if (blockInfo == null) { try { throw new BlockDoesNotExistException(ExceptionMessage.UFS_BLOCK_DOES_NOT_EXIST_FOR_SESSION, blockId, sessionId); } catch (Throwable e) { LOG.error("UFS Block does not exist.", e); throw e; } } return blockInfo; }

Target:
private BlockInfo getBlockInfo(long sessionId, long blockId) throws BlockDoesNotExistException { Key key = new Key(sessionId, blockId); BlockInfo blockInfo = mBlocks.get(key); if (blockInfo == null) { throw new BlockDoesNotExistException(ExceptionMessage.UFS_BLOCK_DOES_NOT_EXIST_FOR_SESSION, blockId, sessionId); } return blockInfo; }
Source:
public String toString() { return Objects.toStringHelper(this) .add("ufsPath", mUfsPath) .add("offset", mOffset) .add("blockSize", mBlockSize) .add("maxUfsReadConcurrency", mMaxUfsReadConcurrency).toString(); }

Target:
public String toString() { return Objects.toStringHelper(this) .add("blockSize", mBlockSize) .add("maxUfsReadConcurrency", mMaxUfsReadConcurrency) .add("offset", mOffset) .add("ufsPath", mUfsPath).toString(); }
Source:
public long getServiceVersion() { LOG.debug("Enter GetServiceVersion."); long ret = Constants.FILE_SYSTEM_MASTER_CLIENT_SERVICE_VERSION; LOG.debug("Exit GetServiceVersion."); return ret; }

Target:
public long getServiceVersion() { return Constants.FILE_SYSTEM_MASTER_CLIENT_SERVICE_VERSION; }
Source:
public static BlockMasterClient create(InetSocketAddress masterAddress) { return new RetryHandlingBlockMasterClient(null, masterAddress); }

Target:
public static BlockMasterClient create(InetSocketAddress masterAddress) { return create(null, masterAddress); }
Source:
protected FileSystemMasterClient createNewResource() { FileSystemMasterClient client = new RetryHandlingFileSystemMasterClient(mSubject, mMasterAddress); mClientList.add(client); return client; }

Target:
protected FileSystemMasterClient createNewResource() { FileSystemMasterClient client = RetryHandlingFileSystemMasterClient.create(mSubject, mMasterAddress); mClientList.add(client); return client; }
Source:
public void workerReRegister() throws Exception { AlluxioBlockStore store = AlluxioBlockStore.create(); Assert.assertEquals(WORKER_CAPACITY_BYTES, store.getCapacityBytes()); for (int kills = 0; kills < MASTERS - 1; kills++) { Assert.assertTrue(mMultiMasterLocalAlluxioCluster.stopLeader()); mMultiMasterLocalAlluxioCluster.waitForNewMaster(CLUSTER_WAIT_TIMEOUT_MS); waitForWorkerRegistration(store, 1, Constants.SECOND_MS); // If worker is successfully re-registered, the capacity bytes should not change. Assert.assertEquals(WORKER_CAPACITY_BYTES, store.getCapacityBytes()); } }

Target:
public void workerReRegister() throws Exception { AlluxioBlockStore store = AlluxioBlockStore.create(); Assert.assertEquals(WORKER_CAPACITY_BYTES, store.getCapacityBytes()); for (int kills = 0; kills < MASTERS - 1; kills++) { Assert.assertTrue(mMultiMasterLocalAlluxioCluster.stopLeader()); mMultiMasterLocalAlluxioCluster.waitForNewMaster(CLUSTER_WAIT_TIMEOUT_MS); waitForWorkerRegistration(store, 1, 5 * Constants.SECOND_MS); // If worker is successfully re-registered, the capacity bytes should not change. Assert.assertEquals(WORKER_CAPACITY_BYTES, store.getCapacityBytes()); } }
Source:
public void equalsTest() throws Exception { CommonTestUtils.testEquals(RenameOptions.class, "mOperationTimeMs"); }

Target:
public void equalsTest() throws Exception { CommonTestUtils.testEquals(RenameOptions.class); }
Source:
private JournalContext() { mFlushCounter = AsyncJournalWriter.INVALID_FLUSH_COUNTER; }

Target:
private JournalContext() { mFlushCounter = INVALID_FLUSH_COUNTER; }
Source:
public long getAutoSavePrefs() { int delay = preferences.getInt(UIConstants.Preferences.AUTO_SAVE_FILE, 15); if (delay > 0) { long delayInMilliseconds = 1000 * 60 * delay; return delayInMilliseconds; } return 0L; }

Target:
private long getAutoSavePrefs() { int delay = preferences.getInt(UIConstants.Preferences.AUTO_SAVE_FILE, 15); if (delay > 0) { long delayInMilliseconds = 1000 * 60 * delay; return delayInMilliseconds; } return 0L; }
Source:
public String getOriginalFilePath() { Object path = tuples.get(FILE_PATH_LABEL); return path != null ? path.toString() : PATH_DEFAULT; }

Target:
public String getOriginalFilePath() { Object path = tuples.get(FILE_PATH_LABEL); return path != null ? path.toString() : null; }
Source:
public int getVersion() { Object version = tuples.get(VERSION_LABEL); return version != null ? Integer.parseInt(version.toString()) : VERSION_DEFAULT; }

Target:
public int getVersion() { Object version = tuples.get(VERSION_LABEL); return version != null ? Integer.parseInt(version.toString()) : 1; }
Source:
public final void setPrimaryType( final UnitOfWork uow, final String typeName ) throws UnsupportedOperationException { throw new UnsupportedOperationException(); }

Target:
public final void setPrimaryType( final UnitOfWork uow, final String typeName ) { throw new UnsupportedOperationException(); }
Source:
public int getMode(File file) { //noinspection OctalInteger return 0664; }

Target:
private int getMode(File file) { //noinspection OctalInteger return 0664; }
Source:
public void remove(RemoteFile file) throws IOException, JadbException { try (InputStream stream = device.executeShell("rm", "-f", Bash.quote(file.getPath()))) { Stream.flushRead(stream); stream.close(); } }

Target:
public void remove(RemoteFile file) throws IOException, JadbException { try (InputStream stream = device.executeShell("rm", "-f", Bash.quote(file.getPath()))) { Stream.flushRead(stream); } }
Source:
public void launch(Package name) throws IOException, JadbException { try (InputStream stream = device.executeShell("monkey", "-p", name.toString(), "-c", "android.intent.category.LAUNCHER", "1")) { Stream.flushRead(stream); stream.close(); } }

Target:
public void launch(Package name) throws IOException, JadbException { try (InputStream stream = device.executeShell("monkey", "-p", name.toString(), "-c", "android.intent.category.LAUNCHER", "1")) { Stream.flushRead(stream); } }
Source:
public List<EntryDTO> getNotificationsBySourceAndCustomAttribute(String source, String attributeName, String attributeValue) { Validate.notBlank(source, "Argument 'source' cannot be blank"); Validate.notBlank(source, "Argument 'attributeName' cannot be blank"); // Does it make sense to allow blank attributeValue? logger.debug("Invoking getNotificationsBySourceAndCustomAttribute with " + "source='{}', attributeName='{}', attributeValue='{}'", source, attributeName, attributeValue); final List<JpaEntry> entries = notificationDao.getNotificationsBySourceAndCustomAttribute(source, attributeName, attributeValue); logger.debug("Found the following entries: {}", entries.size(), entries); return notificationMapper.toEntryList(entries); }

Target:
public List<EntryDTO> getNotificationsBySourceAndCustomAttribute(String source, String attributeName, String attributeValue) { Validate.notBlank(source, "Argument 'source' cannot be blank"); Validate.notBlank(attributeName, "Argument 'attributeName' cannot be blank"); // Does it make sense to allow blank attributeValue? logger.debug("Invoking getNotificationsBySourceAndCustomAttribute with " + "source='{}', attributeName='{}', attributeValue='{}'", source, attributeName, attributeValue); final List<JpaEntry> entries = notificationDao.getNotificationsBySourceAndCustomAttribute(source, attributeName, attributeValue); logger.debug("Found the following entries: {}", entries.size(), entries); return notificationMapper.toEntryList(entries); }
Source:
public Response reliableRequest(final Request request, final int[] retryCodes, int retries, final long delayMillis) { Response response = null; while (retries > 0) { response = makeRequest(request); if (!shouldRetry(response, retryCodes)) { break; } try { Thread.sleep(delayMillis); } catch (final InterruptedException e) { // Delay failed, continue } // Decrement retries retries--; } lastRequest = request; lastResponse = response; return response; }

Target:
public Response reliableRequest(final Request request, final int[] retryCodes, int retries, final long delayMillis) { lastRequest = request; Response response = null; while (retries > 0) { response = makeRequest(request); if (!shouldRetry(response, retryCodes)) { break; } try { Thread.sleep(delayMillis); } catch (final InterruptedException e) { // Delay failed, continue } // Decrement retries retries--; } lastResponse = response; return response; }
Source:
public Map<String, Object> getLocals() { if (locals == null || locals.length == 0) { return Collections.emptyMap(); } Map<String, Object> localsMap = null; for (Frame.LocalVariable localVariable : locals) { if (localVariable != null) { if (localsMap == null) { localsMap = new HashMap<>(); } localsMap.put(localVariable.getName(), localVariable.getValue()); } } return localsMap; }

Target:
public Map<String, Object> getLocals() { if (locals == null || locals.length == 0) { return Collections.emptyMap(); } Map<String, Object> localsMap = new HashMap<>(); for (Frame.LocalVariable localVariable : locals) { if (localVariable != null) { localsMap.put(localVariable.getName(), localVariable.getValue()); } } return localsMap; }
Source:
public Raven createRavenInstance(Dsn dsn) { Raven raven = new Raven(); raven.setConnection(createConnection(dsn)); try { // `ServletRequestListener` was added in the Servlet 2.4 API, and // is used as part of the `HttpEventBuilderHelper`, see: // https://tomcat.apache.org/tomcat-5.5-doc/servletapi/ Class.forName("javax.servlet.ServletRequestListener", false, this.getClass().getClassLoader()); raven.addBuilderHelper(new HttpEventBuilderHelper()); raven.addBuilderHelper(new ContextBuilderHelper(raven)); } catch (ClassNotFoundException e) { logger.debug("The current environment doesn't provide access to servlets," + "or provides an unsupported version."); } return raven; }

Target:
public Raven createRavenInstance(Dsn dsn) { Raven raven = new Raven(); raven.setConnection(createConnection(dsn)); try { // `ServletRequestListener` was added in the Servlet 2.4 API, and // is used as part of the `HttpEventBuilderHelper`, see: // https://tomcat.apache.org/tomcat-5.5-doc/servletapi/ Class.forName("javax.servlet.ServletRequestListener", false, this.getClass().getClassLoader()); raven.addBuilderHelper(new HttpEventBuilderHelper()); } catch (ClassNotFoundException e) { logger.debug("The current environment doesn't provide access to servlets," + "or provides an unsupported version."); } raven.addBuilderHelper(new ContextBuilderHelper(raven)); return raven; }
Source:
void addStreamingIngestFiles(List<Long> fileObjIds) { if (stage.equals(Stages.FIRST_STAGE_FILES_ONLY) || stage.equals(Stages.FIRST_STAGE_FILES_AND_DATASOURCE)) { IngestJobPipeline.taskScheduler.scheduleStreamedFileIngestTasks(this, fileObjIds); } else { logErrorMessage(Level.SEVERE, "Adding streaming files to job during stage " + stage.toString() + " not supported"); } }

Target:
void addStreamingIngestFiles(List<Long> fileObjIds) { if (stage.equals(Stages.FIRST_STAGE_FILES_ONLY)) { IngestJobPipeline.taskScheduler.scheduleStreamedFileIngestTasks(this, fileObjIds); } else { logErrorMessage(Level.SEVERE, "Adding streaming files to job during stage " + stage.toString() + " not supported"); } }
Source:
public boolean isSupported() { // get the MIME type String mimeType = file.getMIMEType(); // if it is not present, attempt to use the FileTypeDetector to determine if (StringUtils.isEmpty(mimeType)) { FileTypeDetector fileTypeDetector = null; try { fileTypeDetector = new FileTypeDetector(); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { logger.log(Level.SEVERE, "Unable to create file type detector for determining MIME type."); return false; } mimeType = fileTypeDetector.getMIMEType(file); // if able to determine mime type, if (!StringUtils.isEmpty(mimeType)) file.setMIMEType(mimeType); } return PLAIN_TEXT_MIME_TYPE.equals(mimeType); }

Target:
public boolean isSupported() { // get the MIME type String mimeType = file.getMIMEType(); // if it is not present, attempt to use the FileTypeDetector to determine if (StringUtils.isEmpty(mimeType)) { FileTypeDetector fileTypeDetector = null; try { fileTypeDetector = new FileTypeDetector(); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { logger.log(Level.SEVERE, "Unable to create file type detector for determining MIME type."); return false; } mimeType = fileTypeDetector.getMIMEType(file); } return PLAIN_TEXT_MIME_TYPE.equals(mimeType); }
Source:
public ResultSet runQuery(String queryStr) throws TskCoreException { ResultSet resultSet = null; try { resultSet = statement.executeQuery(queryStr); //NON-NLS } catch (SQLException ex) { throw new TskCoreException("Error running app SQLite query. " + ex.getMessage(), ex); } return resultSet; }

Target:
public ResultSet runQuery(String queryStr) throws SQLException { ResultSet resultSet = null; if (null != queryStr) { resultSet = statement.executeQuery(queryStr); //NON-NLS } return resultSet; }
Source:
private void deleteDataSource(Long dsObjId) { String dataSourceId = Long.toString(dsObjId); String deleteQuery = "image_id:" + dataSourceId; try { // Get the first result. UpdateResponse updateResponse = solrCore.deleteByQuery(deleteQuery); } catch (SolrServerException | IOException ex) { logger.log(Level.SEVERE, "Error deleting content from Solr. Solr image id " + dataSourceId, ex); //NON-NLS } }

Target:
private void deleteDataSource(Long dsObjId) throws IOException, SolrServerException { String dataSourceId = Long.toString(dsObjId); String deleteQuery = "image_id:" + dataSourceId; solrCore.deleteByQuery(deleteQuery); }
Source:
private AddEditCentralRepoCommentAction(AbstractFile file, String title) throws EamDbException, NoCurrentCaseException, TskCoreException { super(title); this.title = title; correlationAttribute = EamArtifactUtil.getCorrelationAttributeFromContent(file); if (correlationAttribute == null) { addToDatabase = true; correlationAttribute = EamArtifactUtil.makeCorrelationAttributeFromContent(file); } }

Target:
private AddEditCentralRepoCommentAction(AbstractFile file, String title) { super(title); this.title = title; correlationAttribute = EamArtifactUtil.getCorrelationAttributeFromContent(file); if (correlationAttribute == null) { addToDatabase = true; correlationAttribute = EamArtifactUtil.makeCorrelationAttributeFromContent(file); } }
Source:
} catch (UnsatisfiedLinkError e) { tempOpenCvLoaded = false; System.out.println("OpenCV native library failed to load " + e.toString()); }

Target:
} catch (UnsatisfiedLinkError e) { tempOpenCvLoaded = false; exception = e; //save relevant error for throwing at appropriate time }
Source:
public void tearDown() { try { Case.closeCurrentCase(); //Seems like we need some time to close the case. try { Thread.sleep(2000); } catch (InterruptedException ex) { } FileUtils.deleteDirectory(CASE_DIR); } catch (CaseActionException | IOException ex) { Exceptions.printStackTrace(ex); } assertFalse(CASE_DIR.exists()); }

Target:
public void tearDown() { try { Case.closeCurrentCase(); } catch (CaseActionException ex) { Exceptions.printStackTrace(ex); } }
Source:
public PListViewer() { // Create an Outlineview and add to the panel outlineView = new org.openide.explorer.view.OutlineView(); initComponents(); outline = outlineView.getOutline(); ((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel("Key"); Bundle.PListNode_KeyCol(); outlineView.setPropertyColumns( "Type", Bundle.PListNode_TypeCol(), "Value", Bundle.PListNode_ValueCol()); customize(); }

Target:
public PListViewer() { // Create an Outlineview and add to the panel outlineView = new org.openide.explorer.view.OutlineView(); initComponents(); outline = outlineView.getOutline(); ((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel("Key"); outlineView.setPropertyColumns( "Type", Bundle.PListNode_TypeCol(), "Value", Bundle.PListNode_ValueCol()); customize(); }
Source:
public void shouldTimeout() { exception.expect(ReadTimeoutException.class); webTestClient.get() .uri("/timeout/{timeout}", 3) .exchange(); Assert.fail(); }

Target:
public void shouldTimeout() { exception.expect(ReadTimeoutException.class); webTestClient.get() .uri("/timeout/{timeout}", 3) .exchange(); }
Source:
protected Supplier<?> putSupplier(Map<String,String> map, int key) { return (()-> { try { lock.lock(); map.put("key" + key, "value" + key); } catch (Exception e) { this.putSupplier(map, key); } finally { try { lock.unlock(); } catch (Exception e) } return null; }); }

Target:
protected Supplier<?> putSupplier(Map<String,String> map, int key) { return (()-> { lock.lock(); try { return map.put("key" + key, "value" + key); } finally { lock.unlock(); } }); }
Source:
public void traverseList() { // Start traversing from the head Node currentNode = head; if (head != null) { do { System.out.print(currentNode.value + " "); currentNode = currentNode.nextNode; } while (currentNode != head); } }

Target:
public void traverseList() { Node currentNode = head; if (head != null) { do { LOGGER.info(currentNode.value + " "); currentNode = currentNode.nextNode; } while (currentNode != head); } }
Source:
public void clientIdmultipleConnection() { Jedis client2 = new Jedis(hnp.getHost(), hnp.getPort(), 500); client2.auth("foobared"); client2.clientSetname("fancy_jedis_another_name"); long clientId1 = client.clientId(); long clientId2 = client2.clientId(); ///client-id is monotonically increasing Assert.assertTrue(clientId1 < clientId2); client2.close(); }

Target:
public void clientIdmultipleConnection() { Jedis client2 = new Jedis(hnp.getHost(), hnp.getPort(), 500); client2.auth("foobared"); client2.clientSetname("fancy_jedis_another_name"); long clientId1 = client.clientId(); long clientId2 = client2.clientId(); ///client-id is monotonically increasing assertTrue(clientId1 < clientId2); client2.close(); }