auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void setErrorStyles(boolean validationResult) { if (validationResult) { textbox.getElement().getStyle().setBorderColor(defaultTextBoxColor); errorLabel.setText(errorMessage); } else { String errorColor = "red"; textbox.getElement().getStyle().setBorderColor(errorColor); errorLabel.setText(errorMessage); } }

Target:
private void setErrorStyles(boolean validationResult) { if (validationResult) { if (errorMessage.length() > 0) { String warningColor = "yellow"; textbox.getElement().getStyle().setBorderColor(warningColor); errorLabel.setText(errorMessage); } else { textbox.getElement().getStyle().setBorderColor(defaultTextBoxColor); errorLabel.setText(""); } } else { String errorColor = "red"; textbox.getElement().getStyle().setBorderColor(errorColor); errorLabel.setText(errorMessage); } }
Source:
protected boolean isArray(Object datum) { if (datum == null) return false; Class c = datum.getClass(); return (datum instanceof Collection) || (c.isArray() && !(c.getComponentType() == Byte.TYPE)) || isNonStringMap(datum); }

Target:
protected boolean isArray(Object datum) { if (datum == null) return false; Class c = datum.getClass(); return (datum instanceof Collection) || (c.isArray() && c.getComponentType() != Byte.TYPE) || isNonStringMap(datum); }
Source:
public void checkPendingAcks() { Date now = new Date(); for (SenderQueueItem qi : pendingAckQueue.values()) { if (now.after(qi.expiry)) { logger.error("Packet " + qi.msg.msgCount + " (" + qi.msg.msgType + ") lost - timeout"); pendingAckQueue.remove(qi.msg.msgCount); if (sequenceRegister.containsKey(qi.msg.msgCount)) { MessageSequencer msgSeq = sequenceRegister.get(qi.msg.msgCount); sequenceRegister.remove(qi.msg.msgCount); msgSeq.packetLost(qi.msg); } else if (qi.retryCount < 3) { qi.retryCount++; logger.debug("Retransmitting packet " + qi.msg.msgCount + " attempt " + qi.retryCount); sendMessage(qi.msg, qi); } else { logger.error("Transmission of packet " + qi.msg.msgCount + " failed 3 times, message was " + qi.msg.msgType + " to address " + qi.msg.dstAddrStr + " => " + qi.msg.rawMsg); } } } }

Target:
public void checkPendingAcks() { Date now = new Date(); for (SenderQueueItem qi : pendingAckQueue.values()) { if (now.after(qi.expiry)) { logger.error("Packet " + qi.msg.msgCount + " (" + qi.msg.msgType + ") lost - timeout"); pendingAckQueue.remove(qi.msg.msgCount); if (sequenceRegister.containsKey(qi.msg.msgCount)) { MessageSequencer msgSeq = sequenceRegister.get(qi.msg.msgCount); sequenceRegister.remove(qi.msg.msgCount); msgSeq.packetLost(qi.msg); } else if (qi.retryCount < 3) { qi.retryCount++; logger.debug("Retransmitting packet " + qi.msg.msgCount + " attempt " + qi.retryCount); sendMessage(qi.msg, qi); } else { logger.error("Transmission of packet failed 3 times, message was: to address => {}", qi.msg.msgCount, qi.msg.msgType, qi.msg.dstAddrStr, qi.msg.rawMsg); } } } }
Source:
DepthGenerator(DepthWalk w, Generator s) throws MissingObjectException, IncorrectObjectTypeException, IOException { pending = new FIFORevQueue(); walk = (RevWalk)w; this.depth = w.getDepth(); this.UNSHALLOW = w.getUnshallowFlag(); this.REINTERESTING = walk.newFlag("REINTERESTING"); s.shareFreeList(pending); for (;;) { final RevCommit c = s.next(); if (c == null) break; if ((c.flags & RevWalk.UNINTERESTING) == 0 && !c.has(UNSHALLOW)) { ((DepthWalk.Commit)c).depth = 0; pending.add(c); } } }

Target:
DepthGenerator(DepthWalk w, Generator s) throws MissingObjectException, IncorrectObjectTypeException, IOException { pending = new FIFORevQueue(); walk = (RevWalk)w; this.depth = w.getDepth(); this.UNSHALLOW = w.getUnshallowFlag(); this.REINTERESTING = w.getReinterestingFlag(); s.shareFreeList(pending); for (;;) { final RevCommit c = s.next(); if (c == null) break; if ((c.flags & RevWalk.UNINTERESTING) == 0 && !c.has(UNSHALLOW)) { ((DepthWalk.Commit)c).depth = 0; pending.add(c); } } }
Source:
public void aggregateGroupBySV(int length, int[] groupKeyArray, GroupByResultHolder groupByResultHolder, Map<ExpressionContext, BlockValSet> blockValSetMap) { byte[][] bytesArray = blockValSetMap.get(_expression).getBytesValuesSV(); for (int i = 0; i < length; i++) { int groupKey = groupKeyArray[i]; Geometry value = GeometrySerializer.deserialize(bytesArray[i]); groupByResultHolder.setValueForKey(groupKey, groupByResultHolder.getResult(groupKey) == null ? value : ((Geometry) groupByResultHolder.getResult(groupKey)).union(value)); } }

Target:
public void aggregateGroupBySV(int length, int[] groupKeyArray, GroupByResultHolder groupByResultHolder, Map<ExpressionContext, BlockValSet> blockValSetMap) { byte[][] bytesArray = blockValSetMap.get(_expression).getBytesValuesSV(); for (int i = 0; i < length; i++) { int groupKey = groupKeyArray[i]; Geometry value = GeometrySerializer.deserialize(bytesArray[i]); Geometry geometry = groupByResultHolder.getResult(groupKey); groupByResultHolder.setValueForKey(groupKey, geometry == null ? value : geometry.union(value)); } }
Source:
public void testListingWithFallbackLinkWithSameMountDirectories() throws Exception { fsTarget.mkdirs(new Path(targetTestRoot, "fallbackDir/user")); fsTarget.mkdirs(new Path(targetTestRoot, "fallbackDir/user1")); String clusterName = Constants.CONFIG_VIEWFS_DEFAULT_MOUNT_TABLE; URI viewFsUri = new URI(FsConstants.VIEWFS_SCHEME, clusterName, "/", null, null); int itemCount = 0; try(FileSystem vfs = FileSystem.get(viewFsUri, conf)) { itemCount = vfs.listStatus(new Path(viewFsUri.toString())).length; } ConfigUtil.addLinkFallback(conf, clusterName, new Path(targetTestRoot, "fallbackDir").toUri()); try (FileSystem vfs = FileSystem.get(viewFsUri, conf)) { FileStatus[] statuses = vfs.listStatus(new Path(viewFsUri.toString())); assertTrue("The same directory name in fallback link should be shaded", statuses.length == itemCount + 1); } }

Target:
public void testListingWithFallbackLinkWithSameMountDirectories() throws Exception { Path dir1 = new Path(targetTestRoot, "fallbackDir/user"); Path dir2 = new Path(targetTestRoot, "fallbackDir/user1"); fsTarget.mkdirs(dir1); fsTarget.mkdirs(dir2); String clusterName = Constants.CONFIG_VIEWFS_DEFAULT_MOUNT_TABLE; URI viewFsUri = new URI(FsConstants.VIEWFS_SCHEME, clusterName, "/", null, null); HashSet<Path> beforeFallback = new HashSet<>(); try(FileSystem vfs = FileSystem.get(viewFsUri, conf)) { for (FileStatus stat : vfs.listStatus(new Path(viewFsUri.toString()))) { beforeFallback.add(stat.getPath()); } } ConfigUtil.addLinkFallback(conf, clusterName, new Path(targetTestRoot, "fallbackDir").toUri()); try (FileSystem vfs = FileSystem.get(viewFsUri, conf)) { HashSet<Path> afterFallback = new HashSet<>(); for (FileStatus stat : vfs.listStatus(new Path(viewFsUri.toString()))) { afterFallback.add(stat.getPath()); } afterFallback.removeAll(beforeFallback); assertTrue("The same directory name in fallback link should be shaded", afterFallback.size() == 1); Path[] fallbackArray = new Path[afterFallback.size()]; Path expected = new Path(viewFsUri.toString(), "user1"); assertEquals("Path did not match", expected, afterFallback.toArray(fallbackArray)[0]); Path childDir = new Path(fallbackArray[0], "child"); vfs.mkdirs(childDir); FileStatus status = fsTarget.getFileStatus(new Path(dir2, "child")); assertTrue(status.isDirectory()); assertTrue(vfs.getFileStatus(childDir).isDirectory()); } }
Source:
protected void executeCommand() { int missingDiskCount = getMissingDiskCount(); if (missingDiskCount <= 0) { setOvfUpdateStep(OvfUpdateStep.OVF_UPLOAD); updateOvfStoreContent(); setSucceeded(failedOvfDisks.isEmpty()); } else { setOvfUpdateStep(OvfUpdateStep.OVF_STORES_CREATION); setSucceeded(createOvfStoreDisks(getMissingDiskCount())); } }

Target:
protected void executeCommand() { int missingDiskCount = getMissingDiskCount(); if (missingDiskCount <= 0) { setOvfUpdateStep(OvfUpdateStep.OVF_UPLOAD); setSucceeded(updateOvfStoreContent()); } else { setOvfUpdateStep(OvfUpdateStep.OVF_STORES_CREATION); setSucceeded(createOvfStoreDisks(getMissingDiskCount())); } }
Source:
public void testEnterAndDeleteOrder() { long id = sequence++; market.enter(sequence, Side.BUY, 34090, 100); market.delete(sequence); }

Target:
public void testEnterAndDeleteOrder() { long id = sequence++; market.enter(id, Side.BUY, 34090, 100); market.delete(id); }
Source:
public byte[] getCacheKey() { try { final ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); for(Map.Entry<String, String> entry : map.entrySet()){ final String key = entry.getKey(); final String val = entry.getValue(); if(!Strings.isNullOrEmpty(key)){ outputStream.write(StringUtils.toUtf8(key)); } if(!Strings.isNullOrEmpty(val)){ outputStream.write(StringUtils.toUtf8(val)); } } return outputStream.toByteArray(); }catch(IOException ex){ throw Throwables.propagate(ex); } }

Target:
public byte[] getCacheKey() { try { final ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); for (Map.Entry<String, String> entry : map.entrySet()) { final String key = entry.getKey(); final String val = entry.getValue(); if (!Strings.isNullOrEmpty(key)) { outputStream.write(StringUtils.toUtf8(key)); } outputStream.write((byte)0xFF); if (!Strings.isNullOrEmpty(val)) { outputStream.write(StringUtils.toUtf8(val)); } outputStream.write((byte)0xFF); } return outputStream.toByteArray(); } catch (IOException ex) { throw Throwables.propagate(ex); } }
Source:
public AccountServiceMetrics(MetricRegistry metricRegistry) { startupTimeInMs = metricRegistry.histogram(MetricRegistry.name(HelixAccountService.class, "StartupTimeInMs")); updateAccountTimeInMs = metricRegistry.histogram(MetricRegistry.name(HelixAccountService.class, "UpdateAccountTimeInMs")); fetchRemoteAccountTimeInMs = metricRegistry.histogram(MetricRegistry.name(HelixAccountService.class, "FetchRemoteAccountTimeInMs")); accountUpdateConsumerTimeInMs = metricRegistry.histogram(MetricRegistry.name(HelixAccountService.class, "AccountUpdateListenerTimeInMs")); unrecognizedMessageErrorCount = metricRegistry.counter(MetricRegistry.name(HelixAccountService.class, "UnrecognizedMessageErrorCount")); notifyAccountDataChangeErrorCount = metricRegistry.counter(MetricRegistry.name(HelixAccountService.class, "NotifyAccountDataChangeErrorCount")); updateAccountErrorCount = metricRegistry.counter(MetricRegistry.name(HelixAccountService.class, "UpdateAccountErrorCount")); fetchRemoteAccountErrorCount = metricRegistry.counter(MetricRegistry.name(HelixAccountService.class, "FetchRemoteAccountErrorCount")); remoteDataCorruptionErrorCount = metricRegistry.counter(MetricRegistry.name(HelixAccountService.class, "RemoteDataCorruptionErrorCount")); }

Target:
public AccountServiceMetrics(MetricRegistry metricRegistry) { startupTimeInMs = metricRegistry.histogram(MetricRegistry.name(HelixAccountService.class, "StartupTimeInMs")); updateAccountTimeInMs = metricRegistry.histogram(MetricRegistry.name(HelixAccountService.class, "UpdateAccountTimeInMs")); fetchRemoteAccountTimeInMs = metricRegistry.histogram(MetricRegistry.name(HelixAccountService.class, "FetchRemoteAccountTimeInMs")); accountUpdateConsumerTimeInMs = metricRegistry.histogram(MetricRegistry.name(HelixAccountService.class, "AccountUpdateConsumerTimeInMs")); unrecognizedMessageErrorCount = metricRegistry.counter(MetricRegistry.name(HelixAccountService.class, "UnrecognizedMessageErrorCount")); notifyAccountDataChangeErrorCount = metricRegistry.counter(MetricRegistry.name(HelixAccountService.class, "NotifyAccountDataChangeErrorCount")); updateAccountErrorCount = metricRegistry.counter(MetricRegistry.name(HelixAccountService.class, "UpdateAccountErrorCount")); fetchRemoteAccountErrorCount = metricRegistry.counter(MetricRegistry.name(HelixAccountService.class, "FetchRemoteAccountErrorCount")); remoteDataCorruptionErrorCount = metricRegistry.counter(MetricRegistry.name(HelixAccountService.class, "RemoteDataCorruptionErrorCount")); }
Source:
private static void checkExtensionsForUnit(Unit unit) { System.out.println(); SoldierExtension soldierExtension = (SoldierExtension) unit.getUnitExtension("SoldierExtension"); SergeantExtension sergeantExtension = (SergeantExtension) unit.getUnitExtension("SergeantExtension"); CommanderExtension commanderExtension = (CommanderExtension) unit.getUnitExtension("CommanderExtension"); if (soldierExtension != null) { soldierExtension.soldierReady(); } else { System.out.println(unit.getName() + " without SoldierExtension"); } if (sergeantExtension != null) { sergeantExtension.sergeantReady(); } else { System.out.println(unit.getName() + " without SergeantExtension"); } if (commanderExtension != null) { commanderExtension.commanderReady(); } else { System.out.println(unit.getName() + " without CommanderExtension"); } }

Target:
private static void checkExtensionsForUnit(Unit unit) { final Logger logger = LoggerFactory.getLogger(App.class); SoldierExtension soldierExtension = (SoldierExtension) unit.getUnitExtension("SoldierExtension"); SergeantExtension sergeantExtension = (SergeantExtension) unit.getUnitExtension("SergeantExtension"); CommanderExtension commanderExtension = (CommanderExtension) unit.getUnitExtension("CommanderExtension"); if (soldierExtension != null) { soldierExtension.soldierReady(); } else { logger.info(unit.getName() + " without SoldierExtension"); } if (sergeantExtension != null) { sergeantExtension.sergeantReady(); } else { logger.info(unit.getName() + " without SergeantExtension"); } if (commanderExtension != null) { commanderExtension.commanderReady(); } else { logger.info(unit.getName() + " without CommanderExtension"); } }
Source:
private void impl$throwNoteBlockSoundEvent(IBlockState state, World worldIn, BlockPos pos, int id, int param, CallbackInfoReturnable<Boolean> callbackInfo) { if(worldIn.getBlockState(pos.up()).getMaterial() != Material.AIR) { return; } InstrumentProperty instrumentProperty = ((org.spongepowered.api.world.World) worldIn).getBlock(pos.getX(), pos.getY() - 1, pos.getZ()).getProperty(InstrumentProperty.class).orElse(null); if(instrumentProperty == null) { return; } TileEntity tileEntity = worldIn.getTileEntity(pos); if(!(tileEntity instanceof Note)) return; float pitch = (float) Math.pow(2.0D, (double) (param - 12) / 12.0D); if(ShouldFire.PLAY_SOUND_EVENT_NOTE_BLOCK) { try (final CauseStackManager.StackFrame frame = Sponge.getCauseStackManager().pushCauseFrame()) { final PlaySoundEvent.NoteBlock event = SpongeCommonEventFactory.callPlaySoundNoteBLockEvent(frame.getCurrentCause(), (org.spongepowered.api.world.World) worldIn, (Note) tileEntity, pos, this.getInstrument(id), instrumentProperty.getValue(), NoteUtils.getPitch((byte) param), pitch); if (event.isCancelled()) { callbackInfo.setReturnValue(true); } } } }

Target:
private void impl$throwNoteBlockSoundEvent(IBlockState state, World worldIn, BlockPos pos, int id, int param, CallbackInfoReturnable<Boolean> callbackInfo) { if (!ShouldFire.PLAY_SOUND_EVENT_NOTE_BLOCK) { return; } if (worldIn.getBlockState(pos.up()).getMaterial() != Material.AIR) { return; } InstrumentProperty instrumentProperty = ((org.spongepowered.api.world.World) worldIn).getBlock(pos.getX(), pos.getY() - 1, pos.getZ()).getProperty(InstrumentProperty.class).orElse(null); if (instrumentProperty == null) { return; } TileEntity tileEntity = worldIn.getTileEntity(pos); if (!(tileEntity instanceof Note)) { return; } float pitch = (float) Math.pow(2.0D, (double) (param - 12) / 12.0D); try (final CauseStackManager.StackFrame frame = Sponge.getCauseStackManager().pushCauseFrame()) { final PlaySoundEvent.NoteBlock event = SpongeCommonEventFactory.callPlaySoundNoteBLockEvent(frame.getCurrentCause(), (org.spongepowered.api.world.World) worldIn, (Note) tileEntity, pos, this.getInstrument(id), instrumentProperty.getValue(), NotePitchRegistryModule.getPitch((byte) param), pitch); if (event.isCancelled()) { callbackInfo.setReturnValue(true); } } }
Source:
public int run() throws IOException { Preconditions.checkArgument(input != null && output != null, "Both input and output parquet file paths are required."); Preconditions.checkArgument(codec != null, "The codec cannot be null"); Path inPath = new Path(input); Path outPath = new Path(output); CompressionCodecName codecName = CompressionCodecName.valueOf(codec); ParquetMetadata metaData = ParquetFileReader.readFooter(getConf(), inPath, NO_FILTER); MessageType schema = metaData.getFileMetaData().getSchema(); try (TransParquetFileReader reader = new TransParquetFileReader(HadoopInputFile.fromPath(inPath, getConf()), HadoopReadOptions.builder(getConf()).build())) { ParquetFileWriter writer = new ParquetFileWriter(getConf(), schema, outPath, ParquetFileWriter.Mode.CREATE); writer.start(); processBlocks(reader, writer, metaData, schema, metaData.getFileMetaData().getCreatedBy(), codecName); writer.end(metaData.getFileMetaData().getKeyValueMetaData()); } return 0; }

Target:
public int run() throws IOException { Preconditions.checkArgument(input != null && output != null, "Both input and output parquet file paths are required."); Preconditions.checkArgument(codec != null, "The codec cannot be null"); Path inPath = new Path(input); Path outPath = new Path(output); CompressionCodecName codecName = CompressionCodecName.valueOf(codec); ParquetMetadata metaData = ParquetFileReader.readFooter(getConf(), inPath, NO_FILTER); MessageType schema = metaData.getFileMetaData().getSchema(); ParquetFileWriter writer = new ParquetFileWriter(getConf(), schema, outPath, ParquetFileWriter.Mode.CREATE); writer.start(); try (TransParquetFileReader reader = new TransParquetFileReader(HadoopInputFile.fromPath(inPath, getConf()), HadoopReadOptions.builder(getConf()).build())) { compressionConverter.processBlocks(reader, writer, metaData, schema, metaData.getFileMetaData().getCreatedBy(), codecName); } finally { writer.end(metaData.getFileMetaData().getKeyValueMetaData()); } return 0; }
Source:
public void testOptionalNonNull() { OptionalModel expected = new OptionalModel(); expected.field = 1; OptionalModel result = unmarshal(OptionalModel.class, marshal(expected)); assertThat(result, is(expected)); }

Target:
public void testOptionalNonNull() { OptionalModel expected = new OptionalModel(); expected.field = 1; OptionalModel result = unmarshal(gson, OptionalModel.class, marshal(gson, expected)); assertThat(result, is(expected)); }
Source:
public static void resetAllMetrics() { if (sIsResetting) { return; } sIsResetting = true; for (Counter counter : METRIC_REGISTRY.getCounters().values()) { counter.dec(counter.getCount()); } for (String meterName : METRIC_REGISTRY.getMeters().keySet()) { METRIC_REGISTRY.remove(meterName); METRIC_REGISTRY.meter(meterName); } for (String timerName : METRIC_REGISTRY.getTimers().keySet()) { METRIC_REGISTRY.remove(timerName); METRIC_REGISTRY.timer(timerName); } sIsResetting = false; }

Target:
public static synchronized void resetAllMetrics() { for (Counter counter : METRIC_REGISTRY.getCounters().values()) { counter.dec(counter.getCount()); } for (String meterName : METRIC_REGISTRY.getMeters().keySet()) { METRIC_REGISTRY.remove(meterName); METRIC_REGISTRY.meter(meterName); } for (String timerName : METRIC_REGISTRY.getTimers().keySet()) { METRIC_REGISTRY.remove(timerName); METRIC_REGISTRY.timer(timerName); } }
Source:
protected void initChannel(final Channel channel) { checkNotNull(channel, "expected non-null channel"); final RntbdRequestManager requestManager = new RntbdRequestManager( this.healthChecker, this.config.maxRequestsPerChannel()); final ChannelPipeline pipeline = channel.pipeline(); pipeline.addFirst( new RntbdContextNegotiator(requestManager, this.config.userAgent()), new RntbdResponseDecoder(), new RntbdRequestEncoder(), requestManager ); if (this.config.wireLogLevel() != null) { pipeline.addFirst(new LoggingHandler(this.config.wireLogLevel())); } pipeline.addFirst( new SslHandler(this.config.sslContext().newEngine(channel.alloc()))); final long idleConnectionTimerResolutionInNanos = config.idleConnectionTimerResolutionInNanos(); pipeline.addFirst( new IdleStateHandler( idleConnectionTimerResolutionInNanos, idleConnectionTimerResolutionInNanos, 0, TimeUnit.NANOSECONDS)); channel.attr(REQUEST_MANAGER).set(requestManager); }

Target:
protected void initChannel(final Channel channel) { checkNotNull(channel, "expected non-null channel"); final RntbdRequestManager requestManager = new RntbdRequestManager( this.healthChecker, this.config.maxRequestsPerChannel()); final long idleConnectionTimerResolutionInNanos = config.idleConnectionTimerResolutionInNanos(); final ChannelPipeline pipeline = channel.pipeline(); pipeline.addFirst( new RntbdContextNegotiator(requestManager, this.config.userAgent()), new RntbdResponseDecoder(), new RntbdRequestEncoder(), requestManager ); if (this.config.wireLogLevel() != null) { pipeline.addFirst(new LoggingHandler(this.config.wireLogLevel())); } pipeline.addFirst( new SslHandler(this.config.sslContext().newEngine(channel.alloc())), new IdleStateHandler( idleConnectionTimerResolutionInNanos, idleConnectionTimerResolutionInNanos, 0, TimeUnit.NANOSECONDS)); channel.attr(REQUEST_MANAGER).set(requestManager); }
Source:
public AbstractImporter create(ImporterConfig config) { return new KafkaStreamImporterVersion2((KafkaStreamImporterConfig) config); }

Target:
public AbstractImporter create(ImporterConfig config) { return new KafkaTopicPartitionImporter((KafkaStreamImporterConfig) config); }
Source:
public default double yearFraction(LocalDate firstDate, LocalDate secondDate) { return yearFraction(firstDate, secondDate, SIMPLE); }

Target:
public default double yearFraction(LocalDate firstDate, LocalDate secondDate) { return yearFraction(firstDate, secondDate, DayCounts.SIMPLE_SCHEDULE_INFO); }
Source:
public NodeCountsProcessor( NodeStore nodeStore, NodeLabelsCache cache, int highLabelId, CountsAccessor.Updater counts, MigrationProgressMonitor.Section progressMonitor ) { this.nodeStore = nodeStore; this.cache = cache; this.anyLabel = highLabelId; this.counts = counts; this.labelCounts = new long[highLabelId + 1]; this.progressMonitor = progressMonitor; }

Target:
NodeCountsProcessor( NodeStore nodeStore, NodeLabelsCache cache, int highLabelId, CountsAccessor.Updater counts, MigrationProgressMonitor.Section progressMonitor ) { this.nodeStore = nodeStore; this.cache = cache; this.anyLabel = highLabelId; this.counts = counts; this.labelCounts = new long[highLabelId + 1]; this.progressMonitor = progressMonitor; }
Source:
protected String getLocalPackageFileId(File pkgFile) { PackageDefinition packageDefinition = null; try { if (pkgFile.isFile()) { packageDefinition = service.loadPackageFromZip(pkgFile); } else if (pkgFile.isDirectory()) { File manifest = new File(pkgFile, LocalPackage.MANIFEST); packageDefinition = service.loadPackage(manifest); } } catch (PackageException e) { return null; } if (packageDefinition != null) { return packageDefinition.getId(); } return null; }

Target:
protected String getLocalPackageFileId(File pkgFile) { PackageDefinition packageDefinition = null; try { if (pkgFile.isFile()) { packageDefinition = service.loadPackageFromZip(pkgFile); } else if (pkgFile.isDirectory()) { File manifest = new File(pkgFile, LocalPackage.MANIFEST); packageDefinition = service.loadPackage(manifest); } else { throw new PackageException("Unknown file type (not a file and not a directory) for " + pkgFile); } } catch (PackageException e) { log.error("Error trying to load package id from " + pkgFile, e); return null; } return packageDefinition == null ? null : packageDefinition.getId(); }
Source:
public Object instantiateItem(ViewGroup container, int position) { Fragment fragment = (Fragment) super.instantiateItem(container, position); switch (position) { case 0: mEditorFragment = (EditorFragmentAbstract) fragment; mEditorFragment.setImageLoader(mImageLoader); mEditorFragment.getTitleOrContentChanged().observe(EditPostActivity.this, new Observer<Editable>() { @Override public void onChanged(@Nullable Editable editable) { mHandler.removeCallbacks(mSave); mHandler.postDelayed(mSave, 500); } }); if (mEditorFragment instanceof EditorMediaUploadListener) { mEditorMediaUploadListener = (EditorMediaUploadListener) mEditorFragment; mEditorFragment.setCustomHttpHeader("User-Agent", WordPress.getUserAgent()); reattachUploadingMedia(); } break; case 1: mEditPostSettingsFragment = (EditPostSettingsFragment) fragment; break; case 2: mEditPostPreviewFragment = (EditPostPreviewFragment) fragment; break; } return fragment; }

Target:
public Object instantiateItem(ViewGroup container, int position) { Fragment fragment = (Fragment) super.instantiateItem(container, position); switch (position) { case 0: mEditorFragment = (EditorFragmentAbstract) fragment; mEditorFragment.setImageLoader(mImageLoader); mEditorFragment.getTitleOrContentChanged().observe(EditPostActivity.this, new Observer<Editable>() { @Override public void onChanged(@Nullable Editable editable) { mHandler.removeCallbacks(mSave); if (mDebounceCounter < MAX_UNSAVED_POSTS) { mDebounceCounter++; mHandler.postDelayed(mSave, CHANGE_SAVE_DELAY); } else { mHandler.post(mSave); } } }); if (mEditorFragment instanceof EditorMediaUploadListener) { mEditorMediaUploadListener = (EditorMediaUploadListener) mEditorFragment; mEditorFragment.setCustomHttpHeader("User-Agent", WordPress.getUserAgent()); reattachUploadingMedia(); } break; case 1: mEditPostSettingsFragment = (EditPostSettingsFragment) fragment; break; case 2: mEditPostPreviewFragment = (EditPostPreviewFragment) fragment; break; } return fragment; }
Source:
public void mountCamera() { ClientComponent clientComponent = localPlayer.getClientEntity().getComponent(ClientComponent.class); EntityRef targetEntityForCamera = GazeAuthoritySystem.getGazeEntityForCharacter(clientComponent.character); LocationComponent cameraLocation = clientComponent.camera.getComponent(LocationComponent.class); Vector3f cameraPosition; if (cameraLocation == null) { cameraPosition = Vector3f.zero(); } else { cameraPosition = cameraLocation.getLocalPosition(); } Location.attachChild(targetEntityForCamera, clientComponent.camera, cameraPosition, new Quat4f(Quat4f.IDENTITY)); }

Target:
private void mountCamera() { ClientComponent clientComponent = localPlayer.getClientEntity().getComponent(ClientComponent.class); EntityRef targetEntityForCamera = GazeAuthoritySystem.getGazeEntityForCharacter(clientComponent.character); LocationComponent cameraLocation = clientComponent.camera.getComponent(LocationComponent.class); if (cameraLocation != null) { Location.attachChild(targetEntityForCamera, clientComponent.camera, cameraLocation.getLocalPosition(), new Quat4f(Quat4f.IDENTITY)); } else { Location.attachChild(targetEntityForCamera, clientComponent.camera, Vector3f.zero(), new Quat4f(Quat4f.IDENTITY)); } }
Source:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((this.rootNode == null) ? 0 : this.rootNode.hashCode()); return result; }

Target:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + this.jsonAsString.hashCode(); return result; }
Source:
private void addWorkspaceHandler(final ResolveFunction<Void> readAllMarkerResolveFunc) { eventBus.addHandler(WorkspaceReadyEvent.getType(), new WorkspaceReadyEvent.WorkspaceReadyHandler() { @Override public void onWorkspaceReady(WorkspaceReadyEvent event) { BreakpointStorageImpl.this.onWorkspaceReady(readAllMarkerResolveFunc); } }); }

Target:
private void addWorkspaceHandler(final ResolveFunction<Void> readAllMarkerResolveFunc) { eventBus.addHandler(WorkspaceReadyEvent.getType(), event -> BreakpointStorageImpl.this.onWorkspaceReady(readAllMarkerResolveFunc)); }
Source:
private static Set<String> getDefaultStopWords() { return new HashSet<>(Arrays.asList( "jenkins", "node", "master", "computer", "item", "label", "view", "all", "unknown", "user", "anonymous", "authenticated" )); }

Target:
private static Set<String> getDefaultStopWords() { return new HashSet<>(Arrays.asList( "jenkins", "node", "master", "computer", "item", "label", "view", "all", "unknown", "user", "anonymous", "authenticated", "everyone", "system", "admin" )); }
Source:
public void onWikipediaZeroInterstitialEvent(final WikipediaZeroInterstitialEvent event) { alert = new AlertDialog.Builder(this); alert.setTitle(getString(R.string.zero_interstitial_title)); alert.setMessage(getString(R.string.zero_interstitial_leave_app)); alert.setPositiveButton(getString(R.string.zero_interstitial_continue), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Utils.visitInExternalBrowser(PageActivity.this, event.getUri()); } }); alert.setNegativeButton(getString(R.string.zero_interstitial_cancel), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.dismiss(); } }); alert.setNeutralButton(getString(R.string.nav_item_preferences), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { visitSettings(); } }); final AlertDialog ad = alert.create(); ad.setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface d) { ad.getButton(DialogInterface.BUTTON_NEGATIVE).setTypeface(Typeface.DEFAULT, Typeface.BOLD); } }); ad.show(); }

Target:
public void onWikipediaZeroInterstitialEvent(final WikipediaZeroInterstitialEvent event) { alert = new AlertDialog.Builder(this); alert.setTitle(getString(R.string.zero_interstitial_title)); alert.setMessage(getString(R.string.zero_interstitial_leave_app)); alert.setPositiveButton(getString(R.string.zero_interstitial_continue), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Utils.visitInExternalBrowser(PageActivity.this, event.getUri()); } }); alert.setNegativeButton(getString(R.string.zero_interstitial_cancel), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.dismiss(); } }); AlertDialog ad = alert.create(); ad.show(); }
Source:
public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + fChannels.hashCode(); result = prime * result + (fDomain.equals(DomainEnum.KERNEL) ? 1231 : 1237); result = prime * result + ((fBufferType == null) ? 0 : (fBufferType.ordinal() + 1)); return result; }

Target:
public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + fChannels.hashCode(); result = prime * result + ((fDomain == null) ? 0 : (fDomain.ordinal() + 1)); result = prime * result + ((fBufferType == null) ? 0 : (fBufferType.ordinal() + 1)); return result; }
Source:
private String cookiePath(String rawCookiePath, String requestPath) { if (rawCookiePath != null && !rawCookiePath.isEmpty() && rawCookiePath.charAt(0) == '/') { return rawCookiePath; } else { if (!requestPath.isEmpty() && requestPath.charAt(0) == '/' && requestPath.chars().filter(value -> value == '/').count() > 1) return requestPath.substring(0, requestPath.lastIndexOf('/')); else return "/"; } }

Target:
private String cookiePath(String rawCookiePath, String requestPath) { if (MiscUtils.isNonEmpty(rawCookiePath) && rawCookiePath.charAt(0) == '/') { return rawCookiePath; } else { int indexOfLastSlash = requestPath.lastIndexOf('/'); if (!requestPath.isEmpty() && requestPath.charAt(0) == '/' && indexOfLastSlash > 0) return requestPath.substring(0, indexOfLastSlash); else return "/"; } }
Source:
public void testClose() throws IOException { final LineIterator lineIterator = new LineIterator(new Reader() { @Override public int read(char[] cbuf, int off, int len) throws IOException { final char[] chs = "\n".toCharArray(); System.arraycopy(chs, 0, cbuf, 0, chs.length); return chs.length; } @Override public void close() throws IOException { throw new RuntimeException("close test for FileIteratingFirehose"); } }); final TestCloseable closeable = new TestCloseable(); final FileIteratingFirehose firehose = new FileIteratingFirehose( ImmutableList.of(lineIterator).iterator(), parser, closeable ); firehose.hasMore(); firehose.close(); Assert.assertTrue(closeable.closed); }

Target:
public void testClose() throws IOException { final LineIterator lineIterator = new LineIterator(new Reader() { @Override public int read(char[] cbuf, int off, int len) throws IOException { System.arraycopy(LINE_CHARS, 0, cbuf, 0, LINE_CHARS.length); return LINE_CHARS.length; } @Override public void close() throws IOException { throw new RuntimeException("close test for FileIteratingFirehose"); } }); final TestCloseable closeable = new TestCloseable(); final FileIteratingFirehose firehose = new FileIteratingFirehose( ImmutableList.of(lineIterator).iterator(), parser, closeable ); firehose.hasMore(); firehose.close(); Assert.assertTrue(closeable.closed); }
Source:
public String getShortName() { if (isStringBlankOrNull(shortName)) { return alias; } return shortName; }

Target:
public String getShortName() { if (isStringBlankOrNull(shortName)) { String syntheticShortName = alias.toUpperCase().replaceAll("[^A-Z0-9]", ""); if (syntheticShortName.length() > 5) { syntheticShortName = syntheticShortName.substring(0, 5); } return syntheticShortName; } return shortName; }
Source:
public static OWLOntology getInputOntology( IOHelper ioHelper, CommandLine line, String catalogPath) throws IOException { List<String> inputOntologyPaths = getOptionalValues(line, "input"); List<String> inputOntologyIRIs = getOptionalValues(line, "input-iri"); int check = inputOntologyPaths.size() + inputOntologyIRIs.size(); if (check > 1) { throw new IllegalArgumentException(multipleInputsError); } if (!inputOntologyPaths.isEmpty()) { if (catalogPath != null) { return ioHelper.loadOntology(inputOntologyPaths.get(0), catalogPath); } else { return ioHelper.loadOntology(inputOntologyPaths.get(0)); } } else if (!inputOntologyIRIs.isEmpty()) { if (catalogPath != null) { return ioHelper.loadOntology(IRI.create(inputOntologyIRIs.get(0)), catalogPath); } else { return ioHelper.loadOntology(IRI.create(inputOntologyIRIs.get(0))); } } else { throw new IllegalArgumentException(missingInputError); } }

Target:
public static OWLOntology getInputOntology( IOHelper ioHelper, CommandLine line, String catalogPath) throws IllegalArgumentException, IOException { List<String> inputOntologyPaths = getOptionalValues(line, "input"); List<String> inputOntologyIRIs = getOptionalValues(line, "input-iri"); int check = inputOntologyPaths.size() + inputOntologyIRIs.size(); if (check > 1) { throw new IllegalArgumentException(multipleInputsError); } if (!inputOntologyPaths.isEmpty()) { if (catalogPath != null) { return ioHelper.loadOntology(inputOntologyPaths.get(0), catalogPath); } else { return ioHelper.loadOntology(inputOntologyPaths.get(0)); } } else if (!inputOntologyIRIs.isEmpty()) { if (catalogPath != null) { return ioHelper.loadOntology(IRI.create(inputOntologyIRIs.get(0)), catalogPath); } else { return ioHelper.loadOntology(IRI.create(inputOntologyIRIs.get(0))); } } else { throw new IllegalArgumentException(missingInputError); } }
Source:
public static BlockData getWaterData(final int level) { return Material.WATER.createBlockData(d -> ((Levelled) d).setLevel((level < 0 || level > 15) ? 0 : level)); }

Target:
public static BlockData getWaterData(final int level) { return Material.WATER.createBlockData(d -> ((Levelled) d).setLevel((level < 0 || level > ((Levelled) d).getMaximumLevel()) ? 0 : level)); }
Source:
private static ResourceNode generateCoreRootResourceNode() { ResourceNode node = new ResourceNode(); node.setContent(new IRootResource() { @Override public ITransactionBehavior getTransactionBehaviour() { return null; } @Override public ILockingBehaviour getLockingBehaviour() { return null; } @Override public Specification getSpecification() { return new Specification(Type.CORE, "MQNaaS Core", "0.0.1"); } @Override public Collection<Endpoint> getEndpoints() { return null; } }); return node; }

Target:
private static ResourceNode generateCoreRootResourceNode() { ResourceNode node = new ResourceNode(); node.setContent(generateRootResource(new Specification(Type.CORE, "MQNaaS Core", "0.0.1"), null)); return node; }
Source:
public void executeTask() throws MojoExecutionException, MojoFailureException { boolean projectDetected = false; boolean buildExecuted = false; if(serverId == null){ File configFile = new File("webpack.config.js"); if (configFile.exists()) { projectDetected = true; boolean buildOwa = wizard.promptYesNo("OWA Project found in this directory, do you want to build it?"); if (buildOwa) { buildOwaProject(); buildExecuted = true; } } File userDir = new File(System.getProperty("user.dir")); if(Project.hasProject(userDir)) { Project config = Project.loadProject(userDir); String artifactId = config.getArtifactId(); String groupId = config.getGroupId(); String version = config.getVersion(); if ((artifactId != null) && (groupId != null) && version != null) { projectDetected = true; boolean buildMavenProject = wizard.promptYesNo(String.format( "Maven artifact %s:%s:%s detected in this directory, would you like to build it?", groupId, artifactId, version) ); if(buildMavenProject){ try { cleanInstallServerProject(userDir); buildExecuted = true; } catch (Exception e) { throw new RuntimeException("Failed to build project"); } } } } } if(!projectDetected){ buildWatchedProjects(); } else if(!buildExecuted) { boolean buildWatched = wizard.promptYesNo("Do you want to build all watched projects instead?"); if(buildWatched){ buildWatchedProjects(); } else { wizard.showMessage("Task aborted"); } } }

Target:
public void executeTask() throws MojoExecutionException, MojoFailureException { boolean projectDetected = false; boolean buildExecuted = false; if(StringUtils.isBlank(serverId)){ File configFile = new File("webpack.config.js"); if (configFile.exists()) { projectDetected = true; boolean buildOwa = wizard.promptYesNo("OWA Project found in this directory, do you want to build it?"); if (buildOwa) { buildOwaProject(); buildExecuted = true; } } File userDir = new File(System.getProperty("user.dir")); if(Project.hasProject(userDir)) { Project config = Project.loadProject(userDir); String artifactId = config.getArtifactId(); String groupId = config.getGroupId(); String version = config.getVersion(); if ((artifactId != null) && (groupId != null) && version != null) { projectDetected = true; boolean buildMavenProject = wizard.promptYesNo(String.format( "Maven artifact %s:%s:%s detected in this directory, would you like to build it?", groupId, artifactId, version) ); if(buildMavenProject){ try { cleanInstallServerProject(userDir); buildExecuted = true; } catch (Exception e) { throw new RuntimeException("Failed to build project"); } } } } } if(!projectDetected){ buildWatchedProjects(); } else if(!buildExecuted) { boolean buildWatched = wizard.promptYesNo("Do you want to build all watched projects instead?"); if(buildWatched){ buildWatchedProjects(); } else { wizard.showMessage("Task aborted"); } } }
Source:
public void write( final int b ) throws IOException { if ( (int) b == -1 ) { currBlock.setEOF(); doFlush( true ); } if ( !currBlock.full() ) { currBlock.writeToBuffer( (byte) b ); } else { UUID newBlockID = UUID.randomUUID(); FileBlock block = new FileBlock( metadata.getFilePath(), newBlockID ); currBlock.setNextBlockID( newBlockID ); prevBlock = currBlock; currBlock = block; flush(); currBlock.writeToBuffer( (byte) b ); } }

Target:
public void write( final int b ) throws IOException { if ( (int) b == -1 ) { currBlock.setEOF(); doFlush( true ); } if ( currBlock.full() ) { String newBlockID = UUID.randomUUID().toString(); FileBlock block = new FileBlock( metadata.getFilePath(), newBlockID ); currBlock.setNextBlockID( newBlockID ); prevBlock = currBlock; currBlock = block; flush(); } currBlock.writeToBuffer( (byte) b ); }
Source:
public void write(byte[] data, int offset, int len) { if(!this.running) { return; } requestObserver.onNext(StreamingRecognizeRequest.newBuilder().setAudioContent(ByteString.copyFrom(data)).build()); }

Target:
public void write(byte[] data, int offset, int len) { if(!this.running.get()) { return; } requestObserver.onNext(StreamingRecognizeRequest.newBuilder().setAudioContent(ByteString.copyFrom(data, offset, len)).build()); }
Source:
public Table getAugmentedTableForInTransactionRead() { if (!table.getPartitionColumns().isEmpty()) { return table; } Table table = this.table; String currentLocation = this.currentLocation.get().toString(); if (!currentLocation.equals(table.getStorage().getLocation())) { table = Table.builder(table) .withStorage(storage -> storage.setLocation(currentLocation)) .build(); } return table; }

Target:
public Table getAugmentedTableForInTransactionRead() { if (!table.getPartitionColumns().isEmpty()) { return table; } if (!currentLocation.isPresent()) { return table; } String currentLocation = this.currentLocation.get().toString(); if (!currentLocation.equals(table.getStorage().getLocation())) { return Table.builder(table) .withStorage(storage -> storage.setLocation(currentLocation)) .build(); } return table; }
Source:
private String getVpnMsgOrLinkToBrowser() { final Network network = mCm.getActiveNetwork(); final NetworkCapabilities cap = mCm.getNetworkCapabilities(network); if (cap != null && cap.hasTransport(NetworkCapabilities.TRANSPORT_VPN)) { final String vpnMsg = getString(R.string.ssl_error_vpn); return " <div class=example>" + vpnMsg + "</div><br>"; } final String continueMsg = getString(R.string.ssl_error_continue); return " <a href=" + mBrowserBailOutToken + ">" + continueMsg + "</a><br>"; }

Target:
String getVpnMsgOrLinkToBrowser() { final Network network = mCm.getActiveNetwork(); final NetworkCapabilities cap = mCm.getNetworkCapabilities(network); if (cap != null && cap.hasTransport(NetworkCapabilities.TRANSPORT_VPN)) { final String vpnWarning = getString(R.string.ssl_error_vpnwarning); return " <div class=vpnwarning>" + vpnWarning + "</div><br>"; } final String continueMsg = getString(R.string.ssl_error_continue); return " <a href=" + mBrowserBailOutToken + ">" + continueMsg + "</a><br>"; }
Source:
String checkForError() { if (dateFilterCheckBox.isSelected()) { if (!(rangeRadioButton.isSelected() || mostRecentRadioButton.isSelected())) { return "Range or Only Last must be selected"; } else if (rangeRadioButton.isSelected() && !(startCheckBox.isSelected() || endCheckBox.isSelected())) { return "A start or end date must be specified to use the range filter"; } } return ""; }

Target:
String checkForError() { if (dateFilterCheckBox.isSelected()) { if (!(rangeRadioButton.isSelected() || mostRecentRadioButton.isSelected())) { return Bundle.DateFilterPanel_invalidRange_text(); } else if (rangeRadioButton.isSelected() && !(startCheckBox.isSelected() || endCheckBox.isSelected())) { return Bundle.DateFilterPanel_startOrEndNeeded_text(); } } return ""; }
Source:
public void write(OutboundFrame frame) { if (frame.isUrgent()) { priorityWriteQueue.offer(frame); } else { writeQueue.offer(frame); } for (; ; ) { State state = scheduled.get(); if (state == State.UNSCHEDULED) { if (!scheduled.compareAndSet(State.UNSCHEDULED, State.SCHEDULED)) { continue; } if (writeThroughEnabled && !concurrencyDetection.isDetected()) { try { process(); } catch (Throwable t) { onError(t); } } else { registerOp(OP_WRITE); selectionKey.selector().wakeup(); } return; } else if (state == State.SCHEDULED || state == State.RESCHEDULE) { if (writeThroughEnabled) { concurrencyDetection.onDetected(); } return; } else if (state == State.BLOCKED) { return; } else { throw new IllegalStateException("Unexpected state:" + state); } } }

Target:
public void write(OutboundFrame frame) { if (frame.isUrgent()) { priorityWriteQueue.offer(frame); } else { writeQueue.offer(frame); } for (; ; ) { State state = scheduled.get(); if (state == State.UNSCHEDULED) { if (!scheduled.compareAndSet(State.UNSCHEDULED, State.SCHEDULED)) { continue; } executePipeline(); return; } else if (state == State.SCHEDULED || state == State.RESCHEDULE) { if (writeThroughEnabled) { concurrencyDetection.onDetected(); } return; } else if (state == State.BLOCKED) { return; } else { throw new IllegalStateException("Unexpected state:" + state); } } }
Source:
private void dumpWebAuthnCredentialModel(WebAuthnCredentialModel auth) { logger.debugv(" Context Credential Info::"); String id = auth.getAuthenticatorId(); AttestationStatement attrStatement = auth.getAttestationStatement(); AttestedCredentialData attrCredData = auth.getAttestedCredentialData(); WebAuthnAuthenticationContext context = auth.getAuthenticationContext(); if (id != null) logger.debugv(" Authenticator Id = {0}", id); if (attrStatement != null) logger.debugv(" Attestation Statement Format = {0}", attrStatement.getFormat()); if (attrCredData != null) { CredentialPublicKey credPubKey = attrCredData.getCredentialPublicKey(); byte[] keyId = credPubKey.getKeyId(); logger.debugv(" AAGUID = {0}", attrCredData.getAaguid().toString()); logger.debugv(" CREDENTIAL_ID = {0}", Base64.encodeBytes(attrCredData.getCredentialId())); if (keyId != null) logger.debugv(" CREDENTIAL_PUBLIC_KEY.key_id = {0}", Base64.encodeBytes(keyId)); logger.debugv(" CREDENTIAL_PUBLIC_KEY.algorithm = {0}", credPubKey.getAlgorithm().name()); logger.debugv(" CREDENTIAL_PUBLIC_KEY.key_type = {0}", credPubKey.getKeyType().name()); } if (context != null) { logger.infov(" Credential Id = {0}", Base64.encodeBytes(context.getCredentialId())); } }

Target:
private void dumpWebAuthnCredentialModel(WebAuthnCredentialModel auth) { logger.debug(" Context Credential Info::"); logger.debug(auth); }
Source:
public synchronized void stop() { if (started) { try { lock.release(); rw.close(); if (!lockFile.delete()) { LOGGER.info("Lock file was not deleted {}.", lockFile.getPath()); } } catch (IOException e) { throw new RuntimeException("Couldn't unlock rootDir: " + rootDirectory.getAbsolutePath(), e); } started = false; LOGGER.debug("RootDirectory Unlocked"); } }

Target:
public synchronized void stop() { if (started) { try { lock.release(); rw.close(); if (!lockFile.delete()) { LOGGER.debug("Lock file was not deleted {}.", lockFile.getPath()); } } catch (IOException e) { throw new RuntimeException("Couldn't unlock rootDir: " + rootDirectory.getAbsolutePath(), e); } started = false; LOGGER.debug("RootDirectory Unlocked"); } }
Source:
private void assertMessages(Batch expected, Batch actual) { assertNotNull(actual); assertEquals(expected.getMessages().get(0).getSequence(), actual.getMessages().get(0).getSequence()); assertEquals(expected.getMessages().get(1).getSequence(), actual.getMessages().get(1).getSequence()); assertEquals(expected.getMessages().get(0).getData().get("line"), actual.getMessages().get(0).getData().get("line")); assertEquals(expected.getMessages().get(1).getData().get("line"), actual.getMessages().get(1).getData().get("line")); assertEquals(expected.getMessages().get(0).getData().get("from"), actual.getMessages().get(0).getData().get("from")); assertEquals(expected.getMessages().get(1).getData().get("from"), actual.getMessages().get(1).getData().get("from")); assertEquals(expected.size(), actual.size()); }

Target:
private void assertMessages(Batch expected, Batch actual) { assertNotNull(actual); assertEquals(expected.size(), actual.size()); for(int i=0; i < expected.size(); i++) { assertEquals(expected.getMessages().get(i).getSequence(), actual.getMessages().get(i).getSequence()); assertEquals(expected.getMessages().get(i).getData().get("line"), actual.getMessages().get(i).getData().get("line")); assertEquals(expected.getMessages().get(i).getData().get("from"), actual.getMessages().get(i).getData().get("from")); } }