auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public CharSequence getSummary () { RadioStation station = getPersistedRadioStation(); if (station != null && station.name != null && !station.name.isEmpty()) { String summary = station.name; if (station.countryCode != null || station.bitrate > 0) { summary += " ("; boolean hasCountry = false; if (station.countryCode != null) { summary += station.countryCode; hasCountry = true; } if (station.bitrate > 0) { if (hasCountry) { summary += ", "; } summary += String.valueOf(station.bitrate) + " kbps"; } summary += ")"; } return summary; } else { return super.getSummary(); } }

Target:
public CharSequence getSummary () { RadioStation station = getPersistedRadioStation(); if (station != null && station.name != null && !station.name.isEmpty()) { final boolean hasCountry = (station.countryCode != null); final boolean hasBitrate = (station.bitrate > 0); String summary; if (hasCountry && hasBitrate) { summary = String.format("%s (%s, %d kbit/s)", station.name, station.countryCode, station.bitrate); } else if (hasBitrate) { summary = String.format("%s (%d kbit/s)", station.name, station.bitrate); } else if (hasCountry){ summary = String.format("%s (%s)", station.name, station.countryCode); } else { summary = String.format("%s", station.name); } return summary; } else { return super.getSummary(); } }
Source:
instancesByIdInRegion(final Multimap<String,String> idsByRegions) { return new Function<String, Set<? extends Reservation<? extends RunningInstance>>>() { @Override public Set<? extends Reservation<? extends RunningInstance>> apply(String from) { return client.getInstanceServices() .describeInstancesInRegion(from, Iterables.toArray(idsByRegions.get(from), String.class)); } }; }

Target:
instancesByIdInRegion(final Multimap<String,String> idsByRegions) { return new Function<String, Set<? extends Reservation<? extends RunningInstance>>>() { @Override public Set<? extends Reservation<? extends RunningInstance>> apply(String from) { return client.getInstanceServices() .describeInstancesInRegion(from, toArray(idsByRegions.get(from), String.class)); } }; }
Source:
protected synchronized Object handleInvocation(Object proxy, Method method, Object[] args) { try { return method.invoke(delegate, args); } catch (TransactionLockWatchFailedException e) { throw e; } catch (Throwable t) { delegate = fallbackCache; throw new TransactionLockWatchFailedException("Unexpected failure in the lock watch cache", t); } }

Target:
protected synchronized Object handleInvocation(Object proxy, Method method, Object[] args) { try { return method.invoke(delegate, args); } catch (TransactionLockWatchFailedException e) { throw e; } catch (Throwable t) { log.warn("Unexpected failure occurred when trying to use the default cache. Switching to the fallback " + "implementation", t); fallbackCacheSelectedCounter.inc(); delegate = fallbackCache; throw new TransactionLockWatchFailedException("Unexpected failure in the lock watch cache", t); } }
Source:
private void createMaps() throws IOException { final Image map = loadImage(); if (map == null) { log.info("You need to select a map image for this to work"); log.info("Shutting down"); return; } textOptionPane.show(); for (int x = 0; x * Tile.TILE_SIZE < map.getWidth(null); x++) { for (int y = 0; y * Tile.TILE_SIZE < map.getHeight(null); y++) { final Rectangle bounds = new Rectangle(x * Tile.TILE_SIZE, y * Tile.TILE_SIZE, Tile.TILE_SIZE, Tile.TILE_SIZE); final GraphicsConfiguration localGraphicSystem = GraphicsEnvironment.getLocalGraphicsEnvironment() .getDefaultScreenDevice() .getDefaultConfiguration(); final BufferedImage relief = localGraphicSystem.createCompatibleImage( Tile.TILE_SIZE, Tile.TILE_SIZE, Transparency.TRANSLUCENT); relief .getGraphics() .drawImage( map, 0, 0, Tile.TILE_SIZE, Tile.TILE_SIZE, bounds.x, bounds.y, bounds.x + Tile.TILE_SIZE, bounds.y + Tile.TILE_SIZE, observer); final String outFileName = location + File.separator + x + "_" + y + ".png"; ImageIO.write(relief, "png", new File(outFileName)); textOptionPane.appendNewLine("wrote " + outFileName); } } textOptionPane.appendNewLine("\r\nAll Finished!"); textOptionPane.countDown(); textOptionPane.dispose(); JOptionPane.showMessageDialog(null, new JLabel("All Finished")); }

Target:
private void createMaps() throws IOException { final Image map = loadImage(); if (map == null) { log.info("You need to select a map image for this to work"); log.info("Shutting down"); return; } textOptionPane.show(); for (int x = 0; x * TILE_SIZE < map.getWidth(null); x++) { for (int y = 0; y * TILE_SIZE < map.getHeight(null); y++) { final Rectangle bounds = new Rectangle(x * TILE_SIZE, y * TILE_SIZE, TILE_SIZE, TILE_SIZE); final GraphicsConfiguration localGraphicSystem = GraphicsEnvironment.getLocalGraphicsEnvironment() .getDefaultScreenDevice() .getDefaultConfiguration(); final BufferedImage relief = localGraphicSystem.createCompatibleImage( TILE_SIZE, TILE_SIZE, Transparency.TRANSLUCENT); relief .getGraphics() .drawImage( map, 0, 0, TILE_SIZE, TILE_SIZE, bounds.x, bounds.y, bounds.x + TILE_SIZE, bounds.y + TILE_SIZE, observer); final String outFileName = location + File.separator + x + "_" + y + ".png"; ImageIO.write(relief, "png", new File(outFileName)); textOptionPane.appendNewLine("wrote " + outFileName); } } textOptionPane.appendNewLine("\r\nAll Finished!"); textOptionPane.countDown(); textOptionPane.dispose(); JOptionPane.showMessageDialog(null, new JLabel("All Finished")); }
Source:
public void setupStaticKeyspace() throws Exception { migrate(); if ( USE_VIRTUAL_KEYSPACES ) { logger.info( "Creating static application keyspace " + getApplicationKeyspace() ); cass.createColumnFamily( getApplicationKeyspace(), createColumnFamilyDefinition( getApplicationKeyspace(), APPLICATIONS_CF, ComparatorType.BYTESTYPE ) ); cass.createColumnFamilies( getApplicationKeyspace(), getCfDefs( ApplicationCF.class, getApplicationKeyspace() ) ); cass.createColumnFamilies( getApplicationKeyspace(), getCfDefs( QueuesCF.class, getApplicationKeyspace() ) ); } }

Target:
public void setupStaticKeyspace() throws Exception { migrate(); logger.info( "Creating static application keyspace " + getApplicationKeyspace() ); cass.createColumnFamily( getApplicationKeyspace(), createColumnFamilyDefinition( getApplicationKeyspace(), APPLICATIONS_CF, ComparatorType.BYTESTYPE ) ); cass.createColumnFamilies( getApplicationKeyspace(), getCfDefs( ApplicationCF.class, getApplicationKeyspace() ) ); cass.createColumnFamilies( getApplicationKeyspace(), getCfDefs( QueuesCF.class, getApplicationKeyspace() ) ); }
Source:
public String toTosca() { if (this.toscaString != null) return this.toscaString; if (this.offeringPath != null) { try { String offeringDirectory = Discoverer.instance().offeringManager.getOfferingDirectory().getAbsolutePath(); String offeringFileName = "offer_" + this.offeringId + ".yaml"; this.toscaString = new String(Files.readAllBytes(Paths.get(offeringDirectory + File.separatorChar + offeringFileName))); return this.toscaString; } catch (IOException e) { } } this.toscaString = Offering.getPreamble() + this.getNodeTemplate(); return this.toscaString; }

Target:
public String toTosca() { if (this.toscaString != null) return this.toscaString; if (this.isStored) { try { String offeringDirectory = Discoverer.instance().offeringManager.getOfferingDirectory().getAbsolutePath(); String offeringFileName = "offer_" + this.offeringId + ".yaml"; this.toscaString = new String(Files.readAllBytes(Paths.get(offeringDirectory + File.separatorChar + offeringFileName))); return this.toscaString; } catch (IOException e) { e.printStackTrace(); } } this.toscaString = Offering.getPreamble() + this.getNodeTemplate(); return this.toscaString; }
Source:
private Stream<Map<Address, CacheEntry<K, V>>> getConflicts(LocalizedCacheTopology topology) { if (!running) return Stream.empty(); if (topology.getPhase() != CacheTopology.Phase.CONFLICT_RESOLUTION && stateConsumer.isStateTransferInProgress()) throw log.getConflictsStateTransferInProgress(cacheName); if (!streamInProgress.compareAndSet(false, true)) throw log.getConflictsAlreadyInProgress(); conflictSpliterator = new ReplicaSpliterator(topology); return StreamSupport .stream(conflictSpliterator, false) .filter(filterConsistentEntries()); }

Target:
private Stream<Map<Address, CacheEntry<K, V>>> getConflicts(LocalizedCacheTopology topology) { if (topology.getPhase() != CacheTopology.Phase.CONFLICT_RESOLUTION && stateConsumer.isStateTransferInProgress()) throw log.getConflictsStateTransferInProgress(cacheName); if (!streamInProgress.compareAndSet(false, true)) throw log.getConflictsAlreadyInProgress(); conflictSpliterator = new ReplicaSpliterator(topology); if (!running) { conflictSpliterator.stop(); return Stream.empty(); } return StreamSupport .stream(new ReplicaSpliterator(topology), false) .filter(filterConsistentEntries()); }
Source:
public String toString() { return "Subpic[" + formatName + (id != null ? (" id=" + id) : "") + (path != null ? (" path=" + path) : "") + (language == null ? "" : (" " + language)) + " forced=" + forced + "]"; }

Target:
public String toString() { return "Subpic[" + formatName + (id != null ? (" id=" + id) : "") + (path != null ? (" path=" + path) : "") + (language == null ? "" : (" " + language)) + (forced ? " forced" : "") + "]"; }
Source:
private void fireCommandExecution(final Element element, final ToolboxCommand command, final ToolboxButtonEvent event, final Context.EventType eventTypeType) { final Context _context = new AbstractContext(canvasHandler, eventTypeType, event.getX(), event.getY(), event.getAbsoluteX(), event.getAbsoluteY(), event.getClientX(), event.getClientY()) { @Override public CanvasCommandManager getCommandManager() { return CanvasToolboxControl.this.commandManagerProvider.getCommandManager(); } { } }; setCommandView(command).execute(_context, element); }

Target:
private void fireCommandExecution(final Element element, final ToolboxCommand command, final ToolboxButtonEvent event, final Context.EventType eventTypeType) { final Context _context = new AbstractContext(canvasHandler, eventTypeType, event.getX(), event.getY(), event.getAbsoluteX(), event.getAbsoluteY(), event.getClientX(), event.getClientY()) { @Override public CanvasCommandManager getCommandManager() { return CanvasToolboxControl.this.commandManagerProvider.getCommandManager(); } }; setCommandView(command).execute(_context, element); }
Source:
private boolean shouldCreateEndpoint(Annotation annotation) { Object inputChannel = AnnotationUtils.getValue(annotation, "inputChannel"); if (inputChannel == null) { inputChannel = AnnotationUtils.getValue(annotation); } return (inputChannel != null && inputChannel instanceof String && StringUtils.hasText((String) inputChannel)); }

Target:
private boolean shouldCreateEndpoint(Annotation annotation) { Object inputChannel = AnnotationUtils.getValue(annotation, "inputChannel"); if (inputChannel == null && annotation instanceof InboundChannelAdapter) { inputChannel = AnnotationUtils.getValue(annotation); } return (inputChannel != null && inputChannel instanceof String && StringUtils.hasText((String) inputChannel)); }
Source:
private static DataFetcher<IProject> getActivateViewpointDataFetcher() { return environment -> { Optional<IProject> optionalProject = SiriusGraphQLOptionalUtils.projectFromName(environment.getArgument(PROJECT_NAME_ARG)); Optional<Session> optionalSession = optionalProject.flatMap(SiriusGraphQLOptionalUtils::toSession); Optional<Viewpoint> optionalViewpoint = SiriusGraphQLOptionalUtils.viewpointFromIdentifier(environment.getArgument(VIEWPOINT_IDENTIFIER_ARG)); optionalSession.ifPresent(session -> { optionalViewpoint.ifPresent(viewpoint -> { RecordingCommand command = new RecordingCommand(session.getTransactionalEditingDomain()) { @Override protected void doExecute() { session.createView(viewpoint, new ArrayList<>(), true, new NullProgressMonitor()); } }; session.getTransactionalEditingDomain().getCommandStack().execute(command); }); }); return optionalProject.orElse(null); }; }

Target:
private static DataFetcher<IProject> getActivateViewpointDataFetcher() { return environment -> { Optional<IProject> optionalProject = SiriusGraphQLOptionalUtils.projectFromName(environment.getArgument(PROJECT_NAME_ARG)); Optional<Session> optionalSession = optionalProject.flatMap(SiriusGraphQLOptionalUtils::toSession); Optional<Viewpoint> optionalViewpoint = SiriusGraphQLOptionalUtils.viewpointFromIdentifier(environment.getArgument(VIEWPOINT_IDENTIFIER_ARG)); optionalSession.ifPresent(session -> { optionalViewpoint.ifPresent(viewpoint -> { RecordingCommand command = new RecordingCommand(session.getTransactionalEditingDomain()) { @Override protected void doExecute() { new ViewpointSelector(session).selectViewpoint(viewpoint, false, new NullProgressMonitor()); } }; session.getTransactionalEditingDomain().getCommandStack().execute(command); }); }); return optionalProject.orElse(null); }; }
Source:
public LedgerMetadata(int ensembleSize, int writeQuorumSize, int ackQuorumSize, BookKeeper.DigestType digestType, byte[] password, Map<String, byte[]> customMetadata) { this.ensembleSize = ensembleSize; this.writeQuorumSize = writeQuorumSize; this.ackQuorumSize = ackQuorumSize; this.ctime = System.currentTimeMillis(); this.length = 0; this.state = LedgerMetadataFormat.State.OPEN; this.lastEntryId = LedgerHandle.INVALID_ENTRY_ID; this.metadataFormatVersion = CURRENT_METADATA_FORMAT_VERSION; this.digestType = BookKeeper.DigestType.MAC.equals(BookKeeper.DigestType.MAC) ? LedgerMetadataFormat.DigestType.HMAC : LedgerMetadataFormat.DigestType.CRC32; this.password = Arrays.copyOf(password, password.length); this.hasPassword = true; if (customMetadata != null) { this.customMetadata = customMetadata; } }

Target:
public LedgerMetadata(int ensembleSize, int writeQuorumSize, int ackQuorumSize, BookKeeper.DigestType digestType, byte[] password, Map<String, byte[]> customMetadata) { this.ensembleSize = ensembleSize; this.writeQuorumSize = writeQuorumSize; this.ackQuorumSize = ackQuorumSize; this.ctime = System.currentTimeMillis(); this.length = 0; this.state = LedgerMetadataFormat.State.OPEN; this.lastEntryId = LedgerHandle.INVALID_ENTRY_ID; this.metadataFormatVersion = CURRENT_METADATA_FORMAT_VERSION; this.digestType = digestType.equals(BookKeeper.DigestType.MAC) ? LedgerMetadataFormat.DigestType.HMAC : LedgerMetadataFormat.DigestType.CRC32; this.password = Arrays.copyOf(password, password.length); this.hasPassword = true; if (customMetadata != null) { this.customMetadata = customMetadata; } }
Source:
private List<Path> getFilesToRetry(FileSystem sourceFs, List<ReplChangeManager.FileInfo> srcFileList, FileSystem destinationFs, Path destination, boolean isCopyError) throws IOException { List<Path> pathList = new ArrayList<Path>(); for (ReplChangeManager.FileInfo srcFile : srcFileList) { if (srcFile.isCopyDone()) { continue; } Path srcPath = srcFile.getEffectivePath(); Path destPath = new Path(destination, srcPath.getName()); if (destinationFs.exists(destPath)) { if (isSourceFileMismatch(sourceFs, srcFile)) { destinationFs.delete(destPath, true); srcFile.setIsUseSourcePath(false); } else { if (!isCopyError) { srcFile.setCopyDone(true); continue; } } } else { if (sourceFs.exists(srcPath)) { if (isSourceFileMismatch(sourceFs, srcFile)) { srcFile.setIsUseSourcePath(false); } } else { if (srcFile.isUseSourcePath()) { srcFile.setIsUseSourcePath(false); } } } srcPath = srcFile.getEffectivePath(); if (null == srcPath) { LOG.error("File copy failed and likely source file is deleted or modified. " + "Source File: " + srcFile.getSourcePath()); throw new IOException("File copy failed and likely source file is deleted or modified."); } pathList.add(srcPath); } return pathList; }

Target:
private List<Path> getFilesToRetry(FileSystem sourceFs, List<ReplChangeManager.FileInfo> srcFileList, FileSystem destinationFs, Path destination, boolean isCopyError) throws IOException { List<Path> pathList = new ArrayList<Path>(); for (ReplChangeManager.FileInfo srcFile : srcFileList) { if (srcFile.isCopyDone()) { continue; } Path srcPath = srcFile.getEffectivePath(); Path destPath = new Path(destination, srcPath.getName()); if (destinationFs.exists(destPath)) { if (isSourceFileMismatch(sourceFs, srcFile)) { destinationFs.delete(destPath, true); srcFile.setIsUseSourcePath(false); } else { if (!isCopyError) { srcFile.setCopyDone(true); continue; } } } else if (isSourceFileMismatch(sourceFs, srcFile)) { srcFile.setIsUseSourcePath(false); } srcPath = srcFile.getEffectivePath(); if (null == srcPath) { LOG.error("File copy failed and likely source file is deleted or modified. " + "Source File: " + srcFile.getSourcePath()); throw new IOException("File copy failed and likely source file is deleted or modified."); } if (!srcFile.isUseSourcePath() && !sourceFs.exists(srcFile.getCmPath())) { LOG.error("File Copy Failed. Both source and CM files are missing from source. " + "Missing Source File: " + srcFile.getSourcePath() + ", CM File: " + srcFile.getCmPath() + ". " + "Try setting higher value for hive.repl.cm.retain in source warehouse. " + "Also, bootstrap the system again to get back the consistent replicated state."); throw new IOException("Both source and CM path are missing from source."); } pathList.add(srcPath); } return pathList; }
Source:
public void supportsMultipleReporters() { this.context = new AnnotationConfigApplicationContext(); environment().setProperty("spring.zipkin.base-url", this.server.url("/").toString()); this.context.register(ZipkinAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class, TraceAutoConfiguration.class, MultipleReportersConfig.class); this.context.refresh(); then(this.context.getBeansOfType(Sender.class)).hasSize(2); then(this.context.getBeansOfType(Sender.class)).containsKeys("zipkinSender", "otherSender"); then(this.context.getBeansOfType(Reporter.class)).hasSize(2); then(this.context.getBeansOfType(Reporter.class)).containsKeys("zipkinReporter", "otherReporter"); this.context.close(); }

Target:
public void supportsMultipleReporters() throws Exception { this.context = new AnnotationConfigApplicationContext(); environment().setProperty("spring.zipkin.base-url", this.server.url("/").toString()); this.context.register(ZipkinAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class, TraceAutoConfiguration.class, Config.class, MultipleReportersConfig.class, ZipkinBackwardsCompatibilityAutoConfiguration.class); this.context.refresh(); then(this.context.getBeansOfType(Sender.class)).hasSize(2); then(this.context.getBeansOfType(Sender.class)) .containsKeys(ZipkinAutoConfiguration.SENDER_BEAN_NAME, "otherSender"); then(this.context.getBeansOfType(Reporter.class)).hasSize(2); then(this.context.getBeansOfType(Reporter.class)).containsKeys( ZipkinAutoConfiguration.REPORTER_BEAN_NAME, "otherReporter"); Span span = this.context.getBean(Tracing.class).tracer().nextSpan().name("foo") .tag("foo", "bar").start(); span.finish(); Awaitility.await().untilAsserted( () -> then(this.server.getRequestCount()).isGreaterThan(0)); RecordedRequest request = this.server.takeRequest(); then(request.getPath()).isEqualTo("/api/v2/spans"); then(request.getBody().readUtf8()).contains("localEndpoint"); MultipleReportersConfig.OtherSender sender = this.context .getBean(MultipleReportersConfig.OtherSender.class); Awaitility.await().untilAsserted(() -> then(sender.isSpanSent()).isTrue()); }
Source:
public boolean isProtected(ByteArrayWrapper key) { return redisMetaRegion.containsKey(key.toString()) && RedisDataType.REDIS_PROTECTED.equals(redisMetaRegion.get(key.toString())); }

Target:
public boolean isProtected(ByteArrayWrapper key) { return RedisDataType.REDIS_PROTECTED.equals(redisMetaRegion.get(key.toString())); }
Source:
public void testZookeeperFramework_differentPath() throws UnirestException { scheduler.setZookeeperFrameworkUrl("zk://" + zookeeper.getIpAddress() + ":2181/framework"); CONTAINER_LIFECYCLE_MANAGEMENT.addAndStart(scheduler); ESTasks esTasks = new ESTasks(TEST_CONFIG, scheduler.getIpAddress()); new TasksResponse(esTasks, 3); ElasticsearchNodesResponse nodesResponse = new ElasticsearchNodesResponse(esTasks, 3); assertTrue("Elasticsearch nodes did not discover each other within 5 minutes", nodesResponse.isDiscoverySuccessful()); ElasticsearchZookeeperResponse elasticsearchZookeeperResponse = new ElasticsearchZookeeperResponse(new ESTasks(TEST_CONFIG, scheduler.getIpAddress())); assertEquals("zk://" + zookeeper.getIpAddress() + ":2181", elasticsearchZookeeperResponse.getHost()); }

Target:
public void testZookeeperFramework_differentPath() throws UnirestException { scheduler.setZookeeperFrameworkUrl("zk://" + zookeeper.getIpAddress() + ":2181/framework"); CONTAINER_LIFECYCLE_MANAGEMENT.addAndStart(scheduler); ESTasks esTasks = new ESTasks(TEST_CONFIG, scheduler.getIpAddress()); new TasksResponse(esTasks, TEST_CONFIG.getElasticsearchNodesCount()); ElasticsearchNodesResponse nodesResponse = new ElasticsearchNodesResponse(esTasks, TEST_CONFIG.getElasticsearchNodesCount()); assertTrue("Elasticsearch nodes did not discover each other within 5 minutes", nodesResponse.isDiscoverySuccessful()); ElasticsearchZookeeperResponse elasticsearchZookeeperResponse = new ElasticsearchZookeeperResponse(new ESTasks(TEST_CONFIG, scheduler.getIpAddress())); assertEquals("zk://" + zookeeper.getIpAddress() + ":2181", elasticsearchZookeeperResponse.getHost()); }
Source:
public static CourseUnitYoutubeVideoFragment newInstance(VideoBlockModel unit, boolean hasNextUnit, boolean hasPreviousUnit) { CourseUnitYoutubeVideoFragment f = new CourseUnitYoutubeVideoFragment(); Bundle args = new Bundle(); args.putSerializable(Router.EXTRA_COURSE_UNIT, unit); args.putBoolean(HAS_NEXT_UNIT_ID, hasNextUnit); args.putBoolean(HAS_PREV_UNIT_ID, hasPreviousUnit); f.setArguments(args); return f; }

Target:
public static CourseUnitYoutubeVideoFragment newInstance(VideoBlockModel unit, boolean hasNextUnit, boolean hasPreviousUnit) { CourseUnitYoutubeVideoFragment fragment = new CourseUnitYoutubeVideoFragment(); fragment.setArguments(getCourseUnitBundle(unit, hasNextUnit, hasPreviousUnit)); return fragment; }
Source:
public void should_skip_vue_script_with_lang_ts() { ActiveRules activeRules = (new ActiveRulesBuilder()) .create(RuleKey.of(CheckList.REPOSITORY_KEY, "VariableDeclarationAfterUsage")) .activate() .build(); checkFactory = new CheckFactory(activeRules); context.setActiveRules(activeRules); inputFile("vue/tsScript.vue"); createSensor().execute(context); assertThat(context.allAnalysisErrors()).isEmpty(); }

Target:
public void should_skip_vue_script_with_lang_ts() { analyseFile("vue/tsScript.vue"); assertThat(context.allIssues()).isEmpty(); }
Source:
private static <OUT> RecordWriter<SerializationDelegate<StreamRecord<OUT>>> createRecordWriter( StreamEdge edge, int outputIndex, Environment environment, String taskName, long bufferTimeout) { @SuppressWarnings("unchecked") StreamPartitioner<OUT> outputPartitioner = (StreamPartitioner<OUT>) edge.getPartitioner(); LOG.debug("Using partitioner for output of task {}", outputPartitioner, outputIndex, taskName); ResultPartitionWriter bufferWriter = environment.getWriter(outputIndex); if (outputPartitioner instanceof ConfigurableStreamPartitioner) { int numKeyGroups = bufferWriter.getNumTargetKeyGroups(); if (0 < numKeyGroups) { ((ConfigurableStreamPartitioner) outputPartitioner).configure(numKeyGroups); } } try { outputPartitioner = InstantiationUtil.clone(outputPartitioner, Thread.currentThread().getContextClassLoader()); } catch (Exception e) { ExceptionUtils.rethrow(e); } RecordWriter<SerializationDelegate<StreamRecord<OUT>>> output = new RecordWriterBuilder<SerializationDelegate<StreamRecord<OUT>>>() .setChannelSelector(outputPartitioner) .setTimeout(bufferTimeout) .setTaskName(taskName) .build(bufferWriter); output.setMetricGroup(environment.getMetricGroup().getIOMetricGroup()); return output; }

Target:
private static <OUT> RecordWriter<SerializationDelegate<StreamRecord<OUT>>> createRecordWriter( StreamEdge edge, int outputIndex, Environment environment, String taskName, long bufferTimeout) { StreamPartitioner<OUT> outputPartitioner = null; try { outputPartitioner = InstantiationUtil.clone( (StreamPartitioner<OUT>) edge.getPartitioner(), environment.getUserClassLoader()); } catch (Exception e) { ExceptionUtils.rethrow(e); } LOG.debug("Using partitioner for output of task {}", outputPartitioner, outputIndex, taskName); ResultPartitionWriter bufferWriter = environment.getWriter(outputIndex); if (outputPartitioner instanceof ConfigurableStreamPartitioner) { int numKeyGroups = bufferWriter.getNumTargetKeyGroups(); if (0 < numKeyGroups) { ((ConfigurableStreamPartitioner) outputPartitioner).configure(numKeyGroups); } } RecordWriter<SerializationDelegate<StreamRecord<OUT>>> output = new RecordWriterBuilder<SerializationDelegate<StreamRecord<OUT>>>() .setChannelSelector(outputPartitioner) .setTimeout(bufferTimeout) .setTaskName(taskName) .build(bufferWriter); output.setMetricGroup(environment.getMetricGroup().getIOMetricGroup()); return output; }
Source:
public static void dump(EhcacheStateService clusterTierManagerState, StateDumpCollector clusterTierManagerStateDump) { clusterTierManagerStateDump.addState("defaultServerResource", String.valueOf(clusterTierManagerState.getDefaultServerResource())); clusterTierManagerStateDump.addState("configured", String.valueOf(clusterTierManagerState.isConfigured())); StateDumpCollector poolsDump = clusterTierManagerStateDump.subStateDumpCollector("pools"); for (Map.Entry<String, ServerSideConfiguration.Pool> poolEntry : clusterTierManagerState.getSharedResourcePools().entrySet()) { StateDumpCollector poolDump = poolsDump.subStateDumpCollector(poolEntry.getKey()); poolDump.addState("serverResource", poolEntry.getValue().getServerResource()); poolDump.addState("size", String.valueOf(poolEntry.getValue().getSize())); } clusterTierManagerStateDump.addState("stores", clusterTierManagerState.getStores()); }

Target:
public static void dump(EhcacheStateService clusterTierManagerState, StateDumpCollector clusterTierManagerStateDump) { clusterTierManagerStateDump.addState("defaultServerResource", String.valueOf(clusterTierManagerState.getDefaultServerResource())); clusterTierManagerStateDump.addState("configured", String.valueOf(clusterTierManagerState.isConfigured())); StateDumpCollector poolsDump = clusterTierManagerStateDump.subStateDumpCollector("pools"); for (Map.Entry<String, ServerSideConfiguration.Pool> poolEntry : clusterTierManagerState.getSharedResourcePools().entrySet()) { StateDumpCollector poolDump = poolsDump.subStateDumpCollector(poolEntry.getKey()); poolDump.addState("serverResource", poolEntry.getValue().getServerResource()); poolDump.addState("size", String.valueOf(poolEntry.getValue().getSize())); } Set<String> stores = new HashSet<>(clusterTierManagerState.getStores()); clusterTierManagerStateDump.addState("stores", stores); }
Source:
public void testForceDeleteJobFromJobQueue() throws InterruptedException { String jobQueueName = TestHelper.getTestMethodName(); JobConfig.Builder jobBuilder = JobConfig.Builder.fromMap(WorkflowGenerator.DEFAULT_JOB_CONFIG) .setMaxAttemptsPerTask(1).setWorkflow(jobQueueName) .setJobCommandConfigMap(ImmutableMap.of(MockTask.JOB_DELAY, "10")); JobConfig.Builder jobBuilder2 = JobConfig.Builder.fromMap(WorkflowGenerator.DEFAULT_JOB_CONFIG) .setMaxAttemptsPerTask(1).setWorkflow(jobQueueName) .setJobCommandConfigMap(ImmutableMap.of(MockTask.JOB_DELAY, "100000")).setTimeout(100000); JobQueue.Builder jobQueue = TaskTestUtil.buildJobQueue(jobQueueName); jobQueue.enqueueJob("job1", jobBuilder); jobQueue.enqueueJob("job2", jobBuilder2); _driver.start(jobQueue.build()); _driver.pollForJobState(jobQueueName, TaskUtil.getNamespacedJobName(jobQueueName, "job2"), TaskState.IN_PROGRESS); try { _driver.deleteJob(jobQueueName, "job2"); Assert.fail("Regular, non-force deleteJob should fail since the workflow is in progress!"); } catch (IllegalStateException e) { } Assert.assertNotNull(_driver.getJobConfig(TaskUtil.getNamespacedJobName(jobQueueName, "job2"))); Assert .assertNotNull(_driver.getJobContext(TaskUtil.getNamespacedJobName(jobQueueName, "job2"))); try { _driver.deleteJob(jobQueueName, "job2", true); Assert.assertNull(_driver.getJobConfig(TaskUtil.getNamespacedJobName(jobQueueName, "job2"))); Assert.assertNull(_driver.getJobContext(TaskUtil.getNamespacedJobName(jobQueueName, "job2"))); } catch (HelixException e) { System.out.println("failed to delete the job forcefully"); } }

Target:
public void testForceDeleteJobFromJobQueue() throws InterruptedException { String jobQueueName = TestHelper.getTestMethodName(); JobConfig.Builder jobBuilder = JobConfig.Builder.fromMap(WorkflowGenerator.DEFAULT_JOB_CONFIG) .setMaxAttemptsPerTask(1).setWorkflow(jobQueueName) .setJobCommandConfigMap(ImmutableMap.of(MockTask.JOB_DELAY, "10")); JobConfig.Builder jobBuilder2 = JobConfig.Builder.fromMap(WorkflowGenerator.DEFAULT_JOB_CONFIG) .setMaxAttemptsPerTask(1).setWorkflow(jobQueueName) .setJobCommandConfigMap(ImmutableMap.of(MockTask.JOB_DELAY, "100000")).setTimeout(100000); JobQueue.Builder jobQueue = TaskTestUtil.buildJobQueue(jobQueueName); jobQueue.enqueueJob("job1", jobBuilder); jobQueue.enqueueJob("job2", jobBuilder2); _driver.start(jobQueue.build()); _driver.pollForJobState(jobQueueName, TaskUtil.getNamespacedJobName(jobQueueName, "job2"), TaskState.IN_PROGRESS); try { _driver.deleteJob(jobQueueName, "job2"); Assert.fail("Regular, non-force deleteJob should fail since the workflow is in progress!"); } catch (IllegalStateException e) { } Assert.assertNotNull(_driver.getJobConfig(TaskUtil.getNamespacedJobName(jobQueueName, "job2"))); Assert .assertNotNull(_driver.getJobContext(TaskUtil.getNamespacedJobName(jobQueueName, "job2"))); _gSetupTool.getClusterManagementTool().enableCluster(CLUSTER_NAME, false); Thread.sleep(3000); _driver.deleteJob(jobQueueName, "job2", true); Assert.assertNull(_driver.getJobConfig(TaskUtil.getNamespacedJobName(jobQueueName, "job2"))); Assert.assertNull(_driver.getJobContext(TaskUtil.getNamespacedJobName(jobQueueName, "job2"))); }
Source:
protected void executeCommand() { setQuotaParameter(); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getQuotaDAO().save(getQuota()); copyQuotaPermissions(); getReturnValue().setSucceeded(true); return null; } }); }

Target:
protected void executeCommand() { setQuotaParameter(); if (getParameters().isCopyPermissions()) { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { return executeAddQutoa(); } }); } else { executeAddQutoa(); } }
Source:
public static String[] trim(String[] stringsToTrim) { String stringsAfterTrim[] = new String[stringsToTrim.length]; int m = 0; for (String a : stringsToTrim) { stringsAfterTrim[m++] = a.trim(); } return stringsAfterTrim; }

Target:
public static String[] trim(String[] stringsToTrim) { String[] stringsAfterTrim = new String[stringsToTrim.length]; int i = 0; for (String stringToTrim : stringsToTrim) { stringsAfterTrim[i++] = stringToTrim.trim(); } return stringsAfterTrim; }
Source:
public XMLInformation getXMLInformation() { MasterMonitorInfo mmi = Monitor.getMmi(); if (null == mmi) { throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR); } XMLInformation xml = new XMLInformation(mmi.tServerInfo.size(), new MasterResource().getTables(), new TablesResource().getTables()); for (TabletServerStatus status : mmi.tServerInfo) { xml.addTablet(new TabletServer(status)); } return xml; }

Target:
public XMLInformation getXMLInformation() { MasterMonitorInfo mmi = Monitor.getMmi(); if (null == mmi) { throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR); } new MasterResource(); new TablesResource(); XMLInformation xml = new XMLInformation(mmi.tServerInfo.size(), MasterResource.getTables(), TablesResource.getTables()); for (TabletServerStatus status : mmi.tServerInfo) { xml.addTabletServer(new TabletServer(status)); } return xml; }
Source:
public boolean isConversionSupported(MediaType mediaType) { if (encoderRegistry == null) return false; return encoderRegistry.isConversionSupported(storageMediaType, mediaType); }

Target:
public boolean isConversionSupported(MediaType mediaType) { return storageMediaType == null || encoderRegistry.isConversionSupported(storageMediaType, mediaType); }
Source:
public boolean shouldAllowFeedbackPrompt() { boolean result = true; if (installTimeEventCheck != null) { final long installTime = applicationInfoProvider.getInstallTime(); boolean installResult = installTimeEventCheck.shouldAllowFeedbackPrompt(installTime); if (!installResult) { logger.d("Blocking prompt based on install time check"); } result = result && installResult; } if (lastUpdateTimeTimeEventCheck != null) { final long lastUpdateTime = applicationInfoProvider.getLastUpdateTime(); boolean lastUpdateResult = lastUpdateTimeTimeEventCheck.shouldAllowFeedbackPrompt(lastUpdateTime); if (!lastUpdateResult) { logger.d("Blocking prompt based on last update check"); } result = result && lastUpdateResult; } if (lastCrashTimeManager != null) { boolean lastCrashResult = lastCrashTimeManager.shouldAllowFeedbackPrompt(); if (!lastCrashResult) { logger.d("Blocking prompt based on last crash check"); } result = result && lastCrashResult; } return result; }

Target:
public boolean shouldAllowFeedbackPrompt() { boolean result = true; if (installTimeEventCheck != null) { final long installTime = applicationInfoProvider.getInstallTime(); boolean installResult = installTimeEventCheck.shouldAllowFeedbackPrompt(installTime); if (!installResult) { logger.d("Blocking prompt based on install time check"); } result = result && installResult; } if (lastUpdateTimeEventCheck != null) { final long lastUpdateTime = applicationInfoProvider.getLastUpdateTime(); boolean lastUpdateResult = lastUpdateTimeEventCheck.shouldAllowFeedbackPrompt(lastUpdateTime); if (!lastUpdateResult) { logger.d("Blocking prompt based on last update check"); } result = result && lastUpdateResult; } if (lastCrashTimeManager != null) { boolean lastCrashResult = lastCrashTimeManager.shouldAllowFeedbackPrompt(); if (!lastCrashResult) { logger.d("Blocking prompt based on last crash check"); } result = result && lastCrashResult; } return result; }
Source:
public void start() { log.debugf("Async cache loader starting %s", this); state.set(newState(false, null)); stopped = false; stateLock = new BufferLock(asyncConfiguration.modificationQueueSize()); int poolSize = asyncConfiguration.threadPoolSize(); DefaultThreadFactory processorThreadFactory = new DefaultThreadFactory(null, Thread.NORM_PRIORITY, DefaultThreadFactory.DEFAULT_PATTERN, nodeName, "AsyncStoreProcessor"); executor = new ThreadPoolExecutor(poolSize, poolSize, 120L, TimeUnit.SECONDS, new LinkedBlockingQueue<>(), processorThreadFactory); ((ThreadPoolExecutor) executor).allowCoreThreadTimeOut(true); DefaultThreadFactory coordinatorThreadFactory = new DefaultThreadFactory(null, Thread.NORM_PRIORITY, DefaultThreadFactory.DEFAULT_PATTERN, nodeName, "AsyncStoreCoordinator"); coordinator = coordinatorThreadFactory.newThread(new AsyncStoreCoordinator(asyncConfiguration.failSilently())); coordinator.start(); long interval = ctx.getCache().getCacheConfiguration().persistence().availabilityInterval(); Observable.interval(interval, TimeUnit.MILLISECONDS, Schedulers.from(ctx.getExecutor())) .map(t -> actual.isAvailable()) .doOnError(err -> log.debugf("Error encountered when calling isAvailable on %s: %s", actual, err)) .retry() .subscribe(available -> { availabilityLock.lock(); try { if (available != delegateAvailable) { if (available) { delegateAvailable = true; availability.signalAll(); } else { delegateAvailable = false; } } } finally { availabilityLock.unlock(); } }); }

Target:
public void start() { log.debugf("Async cache loader starting %s", this); state.set(newState(false, null)); stopped = false; stateLock = new BufferLock(asyncConfiguration.modificationQueueSize()); int poolSize = asyncConfiguration.threadPoolSize(); DefaultThreadFactory processorThreadFactory = new DefaultThreadFactory(null, Thread.NORM_PRIORITY, DefaultThreadFactory.DEFAULT_PATTERN, nodeName, "AsyncStoreProcessor"); executor = new ThreadPoolExecutor(poolSize, poolSize, 120L, TimeUnit.SECONDS, new LinkedBlockingQueue<>(), processorThreadFactory); ((ThreadPoolExecutor) executor).allowCoreThreadTimeOut(true); DefaultThreadFactory coordinatorThreadFactory = new DefaultThreadFactory(null, Thread.NORM_PRIORITY, DefaultThreadFactory.DEFAULT_PATTERN, nodeName, "AsyncStoreCoordinator"); coordinator = coordinatorThreadFactory.newThread(new AsyncStoreCoordinator(asyncConfiguration.failSilently())); coordinator.start(); }
Source:
public void close(String connectionId) { try { SelectionKey key = keyForId(connectionId); close(key); } catch (IllegalStateException e) { logger.error("Attempt to close socket for which there is no open connection. Connection id {}", connectionId); } }

Target:
public void close(String connectionId) { SelectionKey key = keyForId(connectionId); if (key == null) { metrics.selectorCloseKeyErrorCount.inc(); logger.error("Attempt to close socket for which there is no open connection. Connection id {}", connectionId); } else { close(key); } }
Source:
public ScatterStringConsumer(IStringResolver<Object> resolver) { fResolver = resolver; fMap = checkNotNull(HashBiMap.create()); }

Target:
public ScatterStringConsumer(IStringResolver<Object> resolver) { fResolver = resolver; fMap = HashBiMap.create(); }
Source:
public Options getOptions() { final Options o = new Options(); setPropsOption = new Option("s", "set", true, "set initial properties" + " before the table comes online. Expects <prop>=<value>{,<prop>=<value>}"); o.addOption(setPropsOption); excludePropsOption = new Option("e", "exclude", true, "exclude properties that should not be copied from source table. Expects <prop>{,<prop>}"); o.addOption(excludePropsOption); noFlushOption = new Option("nf", "noFlush", false, "do not flush table data in memory before cloning."); o.addOption(noFlushOption); keepOfflineOption = new Option("k", "keepOffline", false, "do not bring the table online after cloning."); return o; }

Target:
public Options getOptions() { final Options o = new Options(); setPropsOption = new Option("s", "set", true, "set initial properties" + " before the table comes online. Expects <prop>=<value>{,<prop>=<value>}"); o.addOption(setPropsOption); excludePropsOption = new Option("e", "exclude", true, "exclude properties that should not be copied from source table. Expects <prop>{,<prop>}"); o.addOption(excludePropsOption); noFlushOption = new Option("nf", "noFlush", false, "do not flush table data in memory before cloning."); o.addOption(noFlushOption); keepOfflineOption = new Option("o", "offline", false, "do not bring the table online after cloning."); o.addOption(keepOfflineOption); return o; }
Source:
private void normalizeProperties() { this.hostNameBindingsToDelete = new ArrayList<>(); this.appSettingsToAdd = new HashMap<>(); this.appSettingsToRemove = new ArrayList<>(); this.appSettingStickiness = new HashMap<>(); this.connectionStringsToAdd = new HashMap<>(); this.connectionStringsToRemove = new ArrayList<>(); this.connectionStringStickiness = new HashMap<>(); this.sourceControl = null; this.sourceControlToDelete = false; this.authenticationToUpdate = false; this.diagnosticLogsToUpdate = false; this.sslBindingsToCreate = new TreeMap<>(); this.msiHandler = null; this.webSiteBase = new WebSiteBaseImpl(inner()); this.hostNameSslStateMap = new HashMap<>(this.webSiteBase.hostnameSslStates()); this.webAppMsiHandler.clear(); }

Target:
private void normalizeProperties() { this.hostNameBindingsToCreate = new TreeMap<>(); this.hostNameBindingsToDelete = new ArrayList<>(); this.appSettingsToAdd = new HashMap<>(); this.appSettingsToRemove = new ArrayList<>(); this.appSettingStickiness = new HashMap<>(); this.connectionStringsToAdd = new HashMap<>(); this.connectionStringsToRemove = new ArrayList<>(); this.connectionStringStickiness = new HashMap<>(); this.sourceControl = null; this.sourceControlToDelete = false; this.authenticationToUpdate = false; this.diagnosticLogsToUpdate = false; this.sslBindingsToCreate = new TreeMap<>(); this.msiHandler = null; this.webSiteBase = new WebSiteBaseImpl(inner()); this.hostNameSslStateMap = new HashMap<>(this.webSiteBase.hostnameSslStates()); this.webAppMsiHandler.clear(); }
Source:
public Object onTraversalSuccess() { logger.info("Tagging whether genotypes are in one of the artifact modes."); double fdrThresh = 0.01; final List<VariantContext> finalVariants = OrientationBiasFilterer.annotateVariantContextsWithFilterResults(fdrThresh, relevantArtifactModes, firstPassVariants, artifactModeToPreAdapterScoreMap); logger.info("Writing variants to VCF..."); for (final VariantContext vc: finalVariants) { vcfWriter.add(vc); } logger.info("Writing a simple summary table..."); final List<String> sampleNames = finalVariants.get(0).getSampleNamesOrderedByName(); final List<Pair<String, ArtifactMode>> sampleArtifactModeCombinations = new ArrayList<>(); for (ArtifactMode relevantArtifactMode : relevantArtifactModes) { for (String sampleName : sampleNames) { sampleArtifactModeCombinations.add(Pair.of(sampleName, relevantArtifactMode)); } } OrientationBiasUtils.writeOrientationBiasSummaryTable(sampleArtifactModeCombinations, finalVariants, artifactModeToPreAdapterScoreMap, new File(outputFile.getAbsolutePath() + ".summary")); return null; }

Target:
public Object onTraversalSuccess() { logger.info("Tagging whether genotypes are in one of the artifact modes."); double fdrThreshold = 0.01; final List<VariantContext> finalVariants = OrientationBiasFilterer.annotateVariantContextsWithFilterResults(fdrThreshold, relevantTransitions, firstPassVariants, transitionToPreAdapterScoreMap); logger.info("Writing variants to VCF..."); finalVariants.forEach(vcfWriter::add); logger.info("Writing a simple summary table..."); final List<String> sampleNames = finalVariants.get(0).getSampleNamesOrderedByName(); final List<Pair<String, Transition>> sampleTransitionCombinations = new ArrayList<>(); for (Transition relevantTransition : relevantTransitions) { for (String sampleName : sampleNames) { sampleTransitionCombinations.add(Pair.of(sampleName, relevantTransition)); } } OrientationBiasUtils.writeOrientationBiasSummaryTable(sampleTransitionCombinations, finalVariants, transitionToPreAdapterScoreMap, new File(outputFile.getAbsolutePath() + ".summary")); return null; }
Source:
public DateTime (Composite parent, int style) { super (parent, checkStyle (style)); if (isDate() || isTime()) { createText(); } if (isDateWithDropDownButton()) { createDropDownButton(); createPopupShell(-1, -1, -1); addListener(SWT.Resize, new Listener() { public void handleEvent(Event event) { setDropDownButtonSize(); } }); } initAccessible (); if (isDateWithDropDownButton()) { Point size = computeSize(SWT.DEFAULT, SWT.DEFAULT); setBounds(0, 0, size.x, size.y); } }

Target:
public DateTime (Composite parent, int style) { super (parent, checkStyle (style)); if (isDate() || isTime()) { createText(); } if (isCalendar()) { OS.gtk_calendar_mark_day(calendarHandler, Calendar.getInstance().get(Calendar.DAY_OF_MONTH)); } if (isDateWithDropDownButton()) { createDropDownButton(); createPopupShell(-1, -1, -1); addListener(SWT.Resize, new Listener() { public void handleEvent(Event event) { setDropDownButtonSize(); } }); } initAccessible (); if (isDateWithDropDownButton()) { Point size = computeSize(SWT.DEFAULT, SWT.DEFAULT); setBounds(0, 0, size.x, size.y); } }
Source:
private void init() { reset(fileListener); Mockito.doAnswer(this::mockitoDoTest) .when(fileListener) .onFileCreate(any(File.class), any(Synchronization.class)); Mockito.doAnswer(this::mockitoDoTest) .when(fileListener) .onFileChange(any(File.class), any(Synchronization.class)); Mockito.doAnswer(this::mockitoDoTest) .when(fileListener) .onFileDelete(any(File.class), any(Synchronization.class)); timesToFail.set(0); failures = 0; }

Target:
private void init() { reset(fileListener); doAnswer(this::mockitoDoTest) .when(fileListener) .onFileCreate(any(File.class), any(Synchronization.class)); doAnswer(this::mockitoDoTest) .when(fileListener) .onFileChange(any(File.class), any(Synchronization.class)); doAnswer(this::mockitoDoTest) .when(fileListener) .onFileDelete(any(File.class), any(Synchronization.class)); timesToFail.set(0); failures = 0; }
Source:
public Runtime.NoneType extend( Object items, Location loc, Environment env) throws EvalException { addAll((Collection<? extends E>) EvalUtils.toCollection(items, loc, env), loc, env.mutability()); return Runtime.NONE; }

Target:
public Runtime.NoneType extend( Object items, Location loc, Environment env) throws EvalException { addAll(new ArrayList(EvalUtils.toCollection(items, loc, env)), loc, env.mutability()); return Runtime.NONE; }
Source:
public void testDefaults() { Assert.assertEquals(FluoConfiguration.CONNECTION_ZOOKEEPERS_DEFAULT, base.getInstanceZookeepers()); Assert.assertEquals(FluoConfiguration.CONNECTION_ZOOKEEPER_TIMEOUT_DEFAULT, base.getZookeeperTimeout()); Assert.assertEquals(FluoConfiguration.CONNECTION_RETRY_TIMEOUT_MS_DEFAULT, base.getConnectionRetryTimeout()); Assert .assertEquals(FluoConfiguration.ACCUMULO_ZOOKEEPERS_DEFAULT, base.getAccumuloZookeepers()); Assert.assertEquals(FluoConfiguration.ADMIN_ACCUMULO_CLASSPATH_DEFAULT, base.getAccumuloClasspath()); Assert.assertEquals(FluoConfiguration.WORKER_NUM_THREADS_DEFAULT, base.getWorkerThreads()); Assert.assertEquals(FluoConfiguration.TRANSACTION_ROLLBACK_TIME_DEFAULT, base.getTransactionRollbackTime()); Assert.assertEquals(FluoConfiguration.LOADER_NUM_THREADS_DEFAULT, base.getLoaderThreads()); Assert.assertEquals(FluoConfiguration.LOADER_QUEUE_SIZE_DEFAULT, base.getLoaderQueueSize()); Assert.assertEquals(FluoConfiguration.MINI_START_ACCUMULO_DEFAULT, base.getMiniStartAccumulo()); Assert.assertTrue(base.getMiniDataDir().endsWith("/mini")); Assert.assertEquals(FluoConfiguration.OBSERVER_INIT_DIR_DEFAULT, base.getObserverInitDir()); Assert.assertEquals(FluoConfiguration.OBSERVER_JARS_URL_DEFAULT, base.getObserverJarsUrl()); Assert.assertEquals(FluoConfiguration.HDFS_ROOT_DEFAULT, base.getHdfsRoot()); }

Target:
public void testDefaults() { Assert.assertEquals(FluoConfiguration.CONNECTION_ZOOKEEPERS_DEFAULT, base.getInstanceZookeepers()); Assert.assertEquals(FluoConfiguration.CONNECTION_ZOOKEEPER_TIMEOUT_DEFAULT, base.getZookeeperTimeout()); Assert.assertEquals(FluoConfiguration.CONNECTION_RETRY_TIMEOUT_MS_DEFAULT, base.getConnectionRetryTimeout()); Assert .assertEquals(FluoConfiguration.ACCUMULO_ZOOKEEPERS_DEFAULT, base.getAccumuloZookeepers()); Assert.assertEquals(FluoConfiguration.ADMIN_ACCUMULO_CLASSPATH_DEFAULT, base.getAccumuloClasspath()); Assert.assertEquals(FluoConfiguration.WORKER_NUM_THREADS_DEFAULT, base.getWorkerThreads()); Assert.assertEquals(FluoConfiguration.TRANSACTION_ROLLBACK_TIME_DEFAULT, base.getTransactionRollbackTime()); Assert.assertEquals(FluoConfiguration.LOADER_NUM_THREADS_DEFAULT, base.getLoaderThreads()); Assert.assertEquals(FluoConfiguration.LOADER_QUEUE_SIZE_DEFAULT, base.getLoaderQueueSize()); Assert.assertEquals(FluoConfiguration.MINI_START_ACCUMULO_DEFAULT, base.getMiniStartAccumulo()); Assert.assertTrue(base.getMiniDataDir().endsWith("/mini")); Assert.assertEquals(FluoConfiguration.OBSERVER_INIT_DIR_DEFAULT, base.getObserverInitDir()); Assert.assertEquals(FluoConfiguration.OBSERVER_JARS_URL_DEFAULT, base.getObserverJarsUrl()); Assert.assertEquals(FluoConfiguration.DFS_ROOT_DEFAULT, base.getDfsRoot()); }
Source:
public void invalidateUpTo(long trimMark) { log.debug("Invalidate sequencer cache. Trim mark: {}", trimMark); AtomicLong entries = new AtomicLong(); long first; while((first = firstAddress()) != Address.NOT_FOUND && first <= trimMark) { invalidateFirst(); entries.incrementAndGet(); } log.info("Invalidated entries: {}", entries.get()); }

Target:
public void invalidateUpTo(long trimMark) { log.debug("Invalidate sequencer cache. Trim mark: {}", trimMark); int entries = 0; int pqEntries = 0; while (Address.isAddress(firstAddress()) && firstAddress() < trimMark) { pqEntries += invalidateSmallestTxVersion(); entries++; } log.info("Invalidated entries addresses {}", pqEntries, entries); }