auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private int readInt( long pageId, int pageOffset ) throws IOException { // Cross-page read? int bytesInCurentPage = pageSize - pageOffset; if ( bytesInCurentPage < 4 ) { return readPageCrossingInt( pageId, pageOffset, bytesInCurentPage ); } // Regular read moveCursorTo( pageId, pageOffset ); int val; do { val = cursor.getInt( pageOffset ); } while ( cursor.shouldRetry() ); if ( cursor.checkAndClearBoundsFlag() ) { throw newEOFException( "Cursor bounds check failed" ); } return val; }

Target:
private int readInt( long pageId, int pageOffset ) throws IOException { // 1. Optimistic fast path, relies on bounds check at checkAndClearBoundsFlag moveCursorTo( pageId, pageOffset ); int val; do { // This may totally fail, since we may be reading an int that's split // across multiple pages - meaning this call is reading more bytes than // what fits in current page. If that happens, checkAndClearBoundsFlag // saves us, and we fall back to the slow path readPageCrossingInt val = cursor.getInt( pageOffset ); } while ( cursor.shouldRetry() ); // Our savior! if ( !cursor.checkAndClearBoundsFlag() ) { // Fast path worked return val; } // 2. Slow path return readPageCrossingInt( pageId, pageOffset ); }
Source:
public IndexReader newReader() { Map<CoordinateReferenceSystem,IndexReader> indexReaders = new HashMap<>(); for ( Map.Entry<CoordinateReferenceSystem,SpatialKnownIndex> index : indexMap.entrySet() ) { try { indexReaders.put( index.getKey(), index.getValue().getOnlineAccessor(descriptor, samplingConfig).newReader() ); } catch ( IOException e ) { e.printStackTrace(); } } return new SpatialFusionIndexReader( indexReaders, descriptor ); }

Target:
public IndexReader newReader() { Map<CoordinateReferenceSystem,IndexReader> indexReaders = new HashMap<>(); for ( Map.Entry<CoordinateReferenceSystem,SpatialKnownIndex> index : indexMap.entrySet() ) { // TODO should this be populated here, or delegate to SpatialFusionIndexReader? indexReaders.put( index.getKey(), index.getValue().newReader( samplingConfig, descriptor ) ); } return new SpatialFusionIndexReader( indexReaders, descriptor ); }
Source:
public void shouldNotGenerateUpdateForMultipleExistingPropertiesAndLabels() { // When NodeUpdates updates = NodeUpdates.forNode( nodeId, labels ) .existing( propertyKeyId1, Values.of( "Neo" ) ) .existing( propertyKeyId2, Values.of( 100L ) ) .existing( propertyKeyId3, Values.of( Values.pointValue( CoordinateReferenceSystem.WGS84, 12.3, 45.6 ) ) ) .build(); // Then assertThat( updates.forIndexKeys( indexes, assertNoLoading() ), emptyIterable() ); }

Target:
public void shouldNotGenerateUpdateForMultipleExistingPropertiesAndLabels() { // When NodeUpdates updates = NodeUpdates.forNode( nodeId, labels ) .existing( propertyKeyId1, Values.of( "Neo" ) ) .existing( propertyKeyId2, Values.of( 100L ) ) .existing( propertyKeyId3, Values.pointValue( CoordinateReferenceSystem.WGS84, 12.3, 45.6 ) ) .build(); // Then assertThat( updates.forIndexKeys( indexes, assertNoLoading() ), emptyIterable() ); }
Source:
public void addToArchive( Path archiveDestination, DiagnosticsReporterProgressCallback monitor ) throws IOException { long size = fs.getFileSize( source ); InputStream in = fs.openAsInputStream( source ); // Track progress of the file reading, source might be a very large file ProgressAwareInputStream inStream = new ProgressAwareInputStream( in, size, monitor::percentChanged ); Files.copy( inStream, archiveDestination ); }

Target:
public void addToArchive( Path archiveDestination, DiagnosticsReporterProgressCallback monitor ) throws IOException { long size = fs.getFileSize( source ); InputStream in = fs.openAsInputStream( source ); // Track progress of the file reading, source might be a very large file try ( ProgressAwareInputStream inStream = new ProgressAwareInputStream( in, size, monitor::percentChanged ) ) { Files.copy( inStream, archiveDestination ); } }
Source:
protected void sharedOptimisticLock( ResourceType resource, long resourceId ) { ktx.locks().optimistic().acquireShared( ktx.lockTracer(), resource, resourceId ); }

Target:
void sharedOptimisticLock( ResourceType resource, long resourceId ) { ktx.locks().optimistic().acquireShared( ktx.lockTracer(), resource, resourceId ); }
Source:
public String getHARole() { if (true) return roles.keySet().toString(); // TODO delete this if ( roles.containsKey( HighAvailabilityModeSwitcher.MASTER ) ) { return HighAvailabilityModeSwitcher.MASTER; } if ( roles.containsKey( HighAvailabilityModeSwitcher.SLAVE ) ) { return HighAvailabilityModeSwitcher.SLAVE; } return HighAvailabilityModeSwitcher.UNKNOWN; }

Target:
public String getHARole() { if ( roles.containsKey( HighAvailabilityModeSwitcher.MASTER ) ) { return HighAvailabilityModeSwitcher.MASTER; } if ( roles.containsKey( HighAvailabilityModeSwitcher.SLAVE ) ) { return HighAvailabilityModeSwitcher.SLAVE; } return HighAvailabilityModeSwitcher.UNKNOWN; }
Source:
public void shouldFailOnMixedGroupModeInGetOrCreate() throws Exception { // given Groups groups = new Groups(); groups.getOrCreate( null ); try { // when groups.getOrCreate( "Something" ); fail( "Should fail" ); } catch ( IllegalStateException e ) { // then OK } }

Target:
public void shouldFailOnMixedGroupModeInGetOrCreate() throws Exception { // given Groups groups = new Groups(); groups.getOrCreate( null ); // when groups.getOrCreate( "Something" ); }
Source:
public void shouldCheckpointEvenIfNoChanges() throws Exception { // GIVEN CheckpointCounter checkpointCounter = new CheckpointCounter(); // WHEN try ( GBPTree<MutableLong,MutableLong> index = index().with( checkpointCounter ).build() ) { checkpointCounter.reset(); for ( int i = 0; i < 2; i++ ) { } index.checkpoint( unlimited() ); // THEN assertEquals( 1, checkpointCounter.count() ); } }

Target:
public void shouldCheckpointEvenIfNoChanges() throws Exception { // GIVEN CheckpointCounter checkpointCounter = new CheckpointCounter(); // WHEN try ( GBPTree<MutableLong,MutableLong> index = index().with( checkpointCounter ).build() ) { checkpointCounter.reset(); index.checkpoint( unlimited() ); // THEN assertEquals( 1, checkpointCounter.count() ); } }
Source:
public void release( T obj ) { // Return it locally if possible LocalSlot<T> localSlot = puddle.get(); if ( localSlot.release( obj ) ) { // It was released back into the slot } else { // Fall back to the delegate pool pool.release( obj ); } }

Target:
public void release( T obj ) { // Return it locally if possible LocalSlot<T> localSlot = puddle.get(); if ( !localSlot.release( obj ) ) { // Fall back to the delegate pool pool.release( obj ); } // else it was released back into the slot }
Source:
public GivenTransactionCursor( CommittedTransactionRepresentation... transactions ) { this.transactions = transactions; }

Target:
private GivenTransactionCursor( CommittedTransactionRepresentation... transactions ) { this.transactions = transactions; }
Source:
public TestGraphDatabaseFacadeFactory( TestGraphDatabaseFactoryState state, boolean impermanent ) { this( state, impermanent, DatabaseInfo.COMMUNITY, CommunityEditionModule::new ); }

Target:
protected TestGraphDatabaseFacadeFactory( TestGraphDatabaseFactoryState state, boolean impermanent ) { this( state, impermanent, DatabaseInfo.COMMUNITY, CommunityEditionModule::new ); }
Source:
public Stream<BooleanResult> nodeManualIndexAdd( @Name( "indexName" ) String legacyIndexName, @Name( "node" ) Node node, @Name( "key" ) String key, @Name( "value" ) Object value ) { graphDatabaseAPI.index().forNodes( legacyIndexName ).add( node, key, value ); List<BooleanResult> results = new ArrayList<>( 1 ); results.add( new BooleanResult( true ) ); return results.stream(); }

Target:
public Stream<BooleanResult> nodeManualIndexAdd( @Name( "indexName" ) String legacyIndexName, @Name( "node" ) Node node, @Name( "key" ) String key, @Name( "value" ) Object value ) { graphDatabaseAPI.index().forNodes( legacyIndexName ).add( node, key, value ); // Failures will be expressed as exceptions before the return return Stream.of( new BooleanResult( true ) ); }
Source:
public void shouldRunRecurringJob() throws Throwable { // Given long period = 100; int count = 5; life.start(); // When scheduler.scheduleRecurring( indexPopulation, countInvocationsJob, period, MILLISECONDS ); awaitFirstInvocation(); // Alright it's running now. Let's await all the invocations to take place awaitInvocationCount( count ); scheduler.shutdown(); // Then assert that the recurring job was stopped (when the scheduler was shut down) int actualInvocations = invocations.get(); sleep( period * 2 ); assertThat( invocations.get(), equalTo( actualInvocations ) ); }

Target:
public void shouldRunRecurringJob() throws Throwable { // Given long period = 100; int count = 5; life.start(); // When scheduler.scheduleRecurring( indexPopulation, countInvocationsJob, period, MILLISECONDS ); awaitInvocationCount( count ); scheduler.shutdown(); // Then assert that the recurring job was stopped (when the scheduler was shut down) int actualInvocations = invocations.get(); sleep( period * 2 ); assertThat( invocations.get(), equalTo( actualInvocations ) ); }
Source:
public void failIfUnknownSetting() throws Exception { expect.expect( new NestedThrowableMatcher( IllegalArgumentException.class ) ); expect.expectMessage( "Unknown setting: unknown.setting.indeed" ); db.execute( "CALL dbms.setConfigValue('unknown.setting.indeed', 'foo')" ); fail( "Should throw IllegalArgumentException" ); }

Target:
public void failIfUnknownSetting() throws Exception { expect.expect( new NestedThrowableMatcher( IllegalArgumentException.class ) ); expect.expectMessage( "Unknown setting: unknown.setting.indeed" ); db.execute( "CALL dbms.setConfigValue('unknown.setting.indeed', 'foo')" ); }
Source:
public LongArray newLongArray( long length, long defaultValue, long base ) { // Here we want to have the property of a dynamic array which makes some parts of the array // live on heap, some off. At the same time we want a fixed size array. Therefore first create // the array as a dynamic array and make it grow to the requested length. LongArray array = newDynamicLongArray( fractionOf( length ), defaultValue ); array.at( length - 1 ); return array; }

Target:
public LongArray newLongArray( long length, long defaultValue, long base ) { // Here we want to have the property of a dynamic array so that some parts of the array // can live on heap, some off. return newDynamicLongArray( fractionOf( length ), defaultValue ); }
Source:
public PageCacheByteArray( PagedFile pagedFile, long length, byte[] defaultValue, long base ) throws IOException { // '0' default value means we skip filling it out in super super( pagedFile, defaultValue.length, length, 0, base ); this.defaultValue = defaultValue; setDefaultValue( -1 ); }

Target:
PageCacheByteArray( PagedFile pagedFile, long length, byte[] defaultValue, long base ) throws IOException { // Default value is handled locally in this class, in contrast to its siblings, which lets the superclass // handle it. super( pagedFile, defaultValue.length, length, base ); this.defaultValue = defaultValue; setDefaultValue( -1 ); }
Source:
public final boolean equals( Object other ) { if ( other == null ) { return false; } // suppose that we will only ever call equals with Objects of AnyValue but just in case try { if ( ((AnyValue) other).isSequenceValue() && this.isSequenceValue() ) { return ((SequenceValue) this).equals( (SequenceValue) other ); } return other instanceof VirtualValue && equals( (VirtualValue) other ); } catch ( ClassCastException e ) { return false; } }

Target:
public final boolean equals( Object other ) { if ( other == null ) { return false; } if ( other instanceof SequenceValue && this.isSequenceValue() ) { return ((SequenceValue) this).equals( (SequenceValue) other ); } return other instanceof VirtualValue && equals( (VirtualValue) other ); }
Source:
public boolean equals( VirtualValue other ) { if ( other == null || !(other instanceof PathValue) ) { return false; } PathValue that = (PathValue) other; return size() == that.size() && Arrays.equals( nodes, that.nodes ) && Arrays.equals( edges, that.edges ); }

Target:
public boolean equals( VirtualValue other ) { if ( other == null || other.getClass() != PathValue.class ) { return false; } PathValue that = (PathValue) other; return size() == that.size() && Arrays.equals( nodes, that.nodes ) && Arrays.equals( edges, that.edges ); }
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; // Instantiate with high id + 1 since we need that extra slot for the ANY count 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; // Instantiate with high id + 1 since we need that extra slot for the ANY count this.labelCounts = new long[highLabelId + 1]; this.progressMonitor = progressMonitor; }
Source:
public void freeId( long id ) { idContainer.freeId( id ); }

Target:
public synchronized void freeId( long id ) { idContainer.freeId( id ); }
Source:
public static boolean tryWriteLock( long address ) { long s, n; for (; ; ) { s = getState( address ); boolean unwritablyLocked = (s & EXL_MASK) != 0; boolean writeCountOverflow = (s & CNT_MASK) == CNT_MASK; // bitwise-OR to reduce branching and allow more ILP if ( unwritablyLocked | writeCountOverflow ) { return failWriteLock( s, writeCountOverflow ); } n = s + CNT_UNIT | MOD_MASK; if ( compareAndSetState( address, s, n ) ) { UnsafeUtil.storeFence(); return true; } } }

Target:
public static boolean tryWriteLock( long address ) { long s; long n; for ( ; ; ) { s = getState( address ); boolean unwritablyLocked = (s & EXL_MASK) != 0; boolean writeCountOverflow = (s & CNT_MASK) == CNT_MASK; // bitwise-OR to reduce branching and allow more ILP if ( unwritablyLocked | writeCountOverflow ) { return failWriteLock( s, writeCountOverflow ); } n = s + CNT_UNIT | MOD_MASK; if ( compareAndSetState( address, s, n ) ) { UnsafeUtil.storeFence(); return true; } } }
Source:
public void init() throws IOException { monitor.init(); boolean storeExists = hasStore(); boolean isDirty; try { needsRebuild = !storeExists; if ( !storeExists ) { monitor.noIndex(); } isDirty = instantiateTree(); } catch ( MetadataMismatchException e ) { // GBPTree is corrupt. Try to rebuild. isDirty = true; } if ( isDirty ) { monitor.notValidIndex(); dropStrict(); instantiateTree(); } if ( isDirty || !storeExists ) { needsRebuild = true; } }

Target:
public void init() throws IOException { monitor.init(); boolean storeExists = hasStore(); boolean isDirty; try { needsRebuild = !storeExists; if ( !storeExists ) { monitor.noIndex(); } isDirty = instantiateTree(); } catch ( MetadataMismatchException e ) { // GBPTree is corrupt. Try to rebuild. isDirty = true; } if ( isDirty ) { monitor.notValidIndex(); dropStrict(); instantiateTree(); needsRebuild = true; } }
Source:
public void close() throws IOException { writerCheckpointMutex.lock(); try { if ( closed ) { return; } closed = true; // Force close on writer to not risk deadlock on pagedFile.close() writer.close(); pagedFile.close(); } finally { writerCheckpointMutex.unlock(); } }

Target:
public void close() throws IOException { writerCheckpointMutex.lock(); try { if ( closed ) { return; } // Force close on writer to not risk deadlock on pagedFile.close() writer.close(); pagedFile.close(); closed = true; } finally { writerCheckpointMutex.unlock(); } }
Source:
private NewIndexDescriptor getIndex( int labelId, int propertyKeyId, IndexSpecifier index ) throws ProcedureException { try { final int labelId1 = labelId; final int[] propertyKeyIds = new int[]{propertyKeyId}; return operations.indexGetForLabelAndPropertyKey( SchemaDescriptorFactory.forLabel( labelId1, propertyKeyIds ) ); } catch ( SchemaRuleNotFoundException e ) { throw new ProcedureException( Status.Schema.IndexNotFound, e, "No index on %s", index ); } }

Target:
private NewIndexDescriptor getIndex( int labelId, int propertyKeyId, IndexSpecifier index ) throws ProcedureException { try { return operations .indexGetForLabelAndPropertyKey( SchemaDescriptorFactory.forLabel( labelId, propertyKeyId ) ); } catch ( SchemaRuleNotFoundException e ) { throw new ProcedureException( Status.Schema.IndexNotFound, e, "No index on %s", index ); } }
Source:
public static String[] getPropertyKeys( ReadOperations readOperations, LabelSchemaDescriptor descriptor ) throws PropertyKeyIdNotFoundKernelException { int[] propertyKeyIds = false ? descriptor.getPropertyIds() : new int[]{descriptor.getPropertyId()}; String[] propertyKeys = new String[propertyKeyIds.length]; for ( int i = 0; i < propertyKeyIds.length; i++ ) { propertyKeys[i] = readOperations.propertyKeyGetName( propertyKeyIds[i] ); } return propertyKeys; }

Target:
public static String[] getPropertyKeys( ReadOperations readOperations, LabelSchemaDescriptor descriptor ) throws PropertyKeyIdNotFoundKernelException { int[] propertyKeyIds = descriptor.getPropertyIds(); String[] propertyKeys = new String[propertyKeyIds.length]; for ( int i = 0; i < propertyKeyIds.length; i++ ) { propertyKeys[i] = readOperations.propertyKeyGetName( propertyKeyIds[i] ); } return propertyKeys; }
Source:
public static String[] getPropertyKeys( TokenNameLookup tokenNameLookup, LabelSchemaDescriptor descriptor ) { int[] propertyKeyIds = false ? descriptor.getPropertyIds() : new int[]{descriptor.getPropertyId()}; String[] propertyKeys = new String[propertyKeyIds.length]; for ( int i = 0; i < propertyKeyIds.length; i++ ) { propertyKeys[i] = tokenNameLookup.propertyKeyGetName( propertyKeyIds[i] ); } return propertyKeys; }

Target:
public static String[] getPropertyKeys( TokenNameLookup tokenNameLookup, LabelSchemaDescriptor descriptor ) { int[] propertyKeyIds = descriptor.getPropertyIds(); String[] propertyKeys = new String[propertyKeyIds.length]; for ( int i = 0; i < propertyKeyIds.length; i++ ) { propertyKeys[i] = tokenNameLookup.propertyKeyGetName( propertyKeyIds[i] ); } return propertyKeys; }
Source:
private NewIndexDescriptor findAnyIndexByLabelAndProperty( ReadOperations readOps, int propertyId, int labelId ) { try { final int labelId1 = labelId; final int[] propertyKeyIds = new int[]{propertyId}; NewIndexDescriptor descriptor = readOps.indexGetForLabelAndPropertyKey( SchemaDescriptorFactory.forLabel( labelId1, propertyKeyIds ) ); if ( readOps.indexGetState( descriptor ) == InternalIndexState.ONLINE ) { // Ha! We found an index - let's use it to find matching nodes return descriptor; } } catch ( SchemaRuleNotFoundException | IndexNotFoundKernelException e ) { // If we don't find a matching index rule, we'll scan all nodes and filter manually (below) } return null; }

Target:
private NewIndexDescriptor findAnyIndexByLabelAndProperty( ReadOperations readOps, int propertyId, int labelId ) { try { NewIndexDescriptor descriptor = readOps.indexGetForLabelAndPropertyKey( SchemaDescriptorFactory.forLabel( labelId, propertyId ) ); if ( readOps.indexGetState( descriptor ) == InternalIndexState.ONLINE ) { // Ha! We found an index - let's use it to find matching nodes return descriptor; } } catch ( SchemaRuleNotFoundException | IndexNotFoundKernelException e ) { // If we don't find a matching index rule, we'll scan all nodes and filter manually (below) } return null; }
Source:
private void setValues( Object... values ) { if( values.length == 1 ) { setValue( values[0] ); return; } removeAllValueFields(); for ( int i = 0; i < values.length; i++ ) { ValueEncoding encoding = ValueEncoding.forValue( values[i] ); Field reusableField = getFieldWithValue( i, "composite", encoding, values[i] ); document.add( reusableField ); } }

Target:
private void setValues( Object... values ) { removeAllValueFields(); for ( int i = 0; i < values.length; i++ ) { ValueEncoding encoding = ValueEncoding.forValue( values[i] ); Field reusableField = getFieldWithValue( i, encoding, values[i] ); document.add( reusableField ); } }
Source:
public DirectoryComponent(String includes, String excludes, boolean defaultExcludes, int maxDepth) { setExcludes(excludes); setIncludes(includes); setDefaultExcludes(defaultExcludes); setMaxDepth(maxDepth); }

Target:
public DirectoryComponent(String includes, String excludes, boolean defaultExcludes, int maxDepth) { super(); setExcludes(excludes); setIncludes(includes); setDefaultExcludes(defaultExcludes); setMaxDepth(maxDepth); }
Source:
private static Set<String> getAllAsciiCharacters() { final int SPACE = ' '; //20 final int TILDE = '~'; //126 Set<String> singleChars = new HashSet<>(TILDE - SPACE + 1); for (int i = SPACE; i <= TILDE; i++) { singleChars.add(Character.toString((char) i)); } return singleChars; }

Target:
private static Set<String> getAllAsciiCharacters() { final int SPACE = ' '; //20 final int TILDE = '~'; //126 Set<String> singleChars = new HashSet<>(TILDE - SPACE + 1); for (char i = SPACE; i <= TILDE; i++) { singleChars.add(Character.toString(i)); } return singleChars; }
Source:
public FileSystemWatcher createFileSystemWatcher(String name, OptionMap options) { boolean useWatchService = options.get(Options.USE_WATCH_SERVICE, true); boolean daemonThread = options.get(Options.THREAD_DAEMON, true); if(useWatchService) { try { return new WatchServiceFileSystemWatcher(name, daemonThread); } catch (LinkageError e) { //ignore } } int pollInterval = options.get(Options.WATCHER_POLL_INTERVAL, 5000); return new PollingFileSystemWatcher(name, pollInterval, daemonThread); }

Target:
public FileSystemWatcher createFileSystemWatcher(String name, OptionMap options) { try { boolean daemonThread = options.get(Options.THREAD_DAEMON, true); return new WatchServiceFileSystemWatcher(name, daemonThread); } catch (LinkageError e) { //ignore } return super.createFileSystemWatcher(name, options); }
Source:
private static String urlEncode(String s) { try { return URLEncoder.encode(s, Charsets.UTF_8.name()) .replace("+", "%20").replace("*", "%2A").replace("%7E", "~"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); // should not happen } }

Target:
private static String urlEncode(String s) { try { return URLEncoder.encode(s, Charsets.UTF_8.name()) .replace("+", "%20").replace("*", "%2A"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); // should not happen } }
Source:
protected void refreshInputKinds() { List<String> basePath = new ArrayList<String>(); Set<InputKind> kinds = assembleInputKindSet(basePath); this.inputKinds.clear(); this.inputKinds.addAll(kinds); }

Target:
private void refreshInputKinds() { List<String> basePath = new ArrayList<String>(); Set<InputKind> kinds = assembleInputKindSet(basePath); this.inputKinds.clear(); this.inputKinds.addAll(kinds); }
Source:
public InputKind(String relpath, Class inputClass) { this( relpath, inputClass, Util.substringAfter(relpath, "data/inputs/", relpath) ); }

Target:
private InputKind(String relpath, Class inputClass) { this( relpath, inputClass, relpath ); }
Source:
public String getBucketRebuildMemoryHint() throws OperationNotSupportedException { if (this.service.versionCompare("5.0") < 0) { // We're on 4.x, which doesn't support this. throw new OperationNotSupportedException("bucketRebuildMemoryHint unavailable before Splunk 5.0"); } else { return getString("bucketRebuildMemoryHint"); } }

Target:
public String getBucketRebuildMemoryHint() { return getString("bucketRebuildMemoryHint"); }
Source:
private String getStoriesId() { Stories stories = getAnnotation(Stories.class); if(stories == null || stories.id().isEmpty()) { return null; } else { return stories.id(); } }

Target:
private String getStoriesId() { Stories stories = getAnnotation(Stories.class); if(stories == null || stories.id() == null || stories.id().isEmpty()) { return null; } else { return stories.id(); } }
Source:
private static void copy(JarFile jar, JarEntry from, File to) throws IOException { InputStream is = null; FileOutputStream os = null; try { is = jar.getInputStream(from); os = new FileOutputStream(to); IOUtils.copy(is, os); } finally { if (is != null) { is.close(); } if (os != null) { os.close(); } } }

Target:
private static void copy(JarFile jar, JarEntry from, File to) throws IOException { try (InputStream is = jar.getInputStream(from); FileOutputStream os = new FileOutputStream(to)) { IOUtils.copy(is, os); } }
Source:
public static String getMessageMask(String message) { return message.replaceAll("\\s\\d+\\s", " {number} ").replaceAll("\\s+", " "); }

Target:
public static String getMessageMask(String message) { return message.replaceAll("\\s+", " "); }
Source:
public void register() { if (!registered.get() && registered.compareAndSet(false, true)) { DubboShutdownHook dubboShutdownHook = getDubboShutdownHook(); Runtime.getRuntime().addShutdownHook(dubboShutdownHook); dispatch(new DubboShutdownHookRegisteredEvent(dubboShutdownHook)); ShutdownHookCallbacks.INSTANCE.addCallback(() -> { // backward compatibility: make sure shutdown logic takes effect when DubboBootstrap is not used. AbstractRegistryFactory.destroyAll(); this.destroyProtocols(); }); } }

Target:
public void register() { if (!registered.get() && registered.compareAndSet(false, true)) { DubboShutdownHook dubboShutdownHook = getDubboShutdownHook(); Runtime.getRuntime().addShutdownHook(dubboShutdownHook); dispatch(new DubboShutdownHookRegisteredEvent(dubboShutdownHook)); } }
Source:
private void log(String accessLog, AccessLogData accessLogData) { Set<AccessLogData> logSet = LOG_ENTRIES.computeIfAbsent(accessLog, k -> new ConcurrentHashSet<>()); if (logSet.size() >= LOG_MAX_BUFFER) { logSet.add(accessLogData); } else { logger.warn("AccessLog buffer is full. Do a force writing to file to clear buffer."); //just write current logSet to file. writeLogSetToFile(accessLog, logSet); //after force writing, add accessLogData to current logSet logSet.add(accessLogData); } }

Target:
private void log(String accessLog, AccessLogData accessLogData) { Set<AccessLogData> logSet = LOG_ENTRIES.computeIfAbsent(accessLog, k -> new ConcurrentHashSet<>()); if (logSet.size() < LOG_MAX_BUFFER) { logSet.add(accessLogData); } else { logger.warn("AccessLog buffer is full. Do a force writing to file to clear buffer."); //just write current logSet to file. writeLogSetToFile(accessLog, logSet); //after force writing, add accessLogData to current logSet logSet.add(accessLogData); } }
Source:
public void run(Timeout timeout) { DefaultFuture future = DefaultFuture.getFuture(requestID); if (future.isDone()) { return; } // create exception response. Response timeoutResponse = new Response(future.getId()); // set timeout status. timeoutResponse.setStatus(future.isSent() ? Response.SERVER_TIMEOUT : Response.CLIENT_TIMEOUT); timeoutResponse.setErrorMessage(future.getTimeoutMessage(true)); // handle response. DefaultFuture.received(future.getChannel(), timeoutResponse, true); }

Target:
public void run(Timeout timeout) { DefaultFuture future = DefaultFuture.getFuture(requestID); if (future == null || future.isDone()) { return; } // create exception response. Response timeoutResponse = new Response(future.getId()); // set timeout status. timeoutResponse.setStatus(future.isSent() ? Response.SERVER_TIMEOUT : Response.CLIENT_TIMEOUT); timeoutResponse.setErrorMessage(future.getTimeoutMessage(true)); // handle response. DefaultFuture.received(future.getChannel(), timeoutResponse, true); }
Source:
public void setProtocol(String protocol) { this.protocols = new ArrayList<>(Arrays.asList(new ProtocolConfig[]{new ProtocolConfig(protocol)})); }

Target:
public void setProtocol(String protocol) { this.protocols = new ArrayList<>(Arrays.asList(new ProtocolConfig(protocol))); }
Source:
public void doDestroy() { if (!destroyed.compareAndSet(false, true)) { return; } // unregister the shutdownHook unregister(); // destroy all the registries AbstractRegistryFactory.destroyAll(); // destroy all the protocols destroyProtocols(); }

Target:
public void doDestroy() { if (!destroyed.compareAndSet(false, true)) { return; } // destroy all the registries AbstractRegistryFactory.destroyAll(); // destroy all the protocols destroyProtocols(); }
Source:
public String doGetContent(String path) { try { byte[] dataBytes = client.getData().forPath(path); if (dataBytes == null || dataBytes.length == 0) { return null; } return new String(dataBytes, charset); } catch (NodeExistsException e) { } catch (NoNodeException e) { } catch (Exception e) { throw new IllegalStateException(e.getMessage(), e); } return null; }

Target:
public String doGetContent(String path) { try { byte[] dataBytes = client.getData().forPath(path); return (dataBytes == null || dataBytes.length == 0) ? null : new String(dataBytes, charset); } catch (NoNodeException e) { // ignore NoNode Exception. } catch (Exception e) { throw new IllegalStateException(e.getMessage(), e); } return null; }
Source:
public String doGetContent(String path) { try { byte[] dataBytes = client.getData().forPath(path); return (dataBytes == null || dataBytes.length == 0) ? null : new String(dataBytes, charset); } catch (NodeExistsException e) { } catch (NoNodeException e) { } catch (Exception e) { throw new IllegalStateException(e.getMessage(), e); } return null; }

Target:
public String doGetContent(String path) { try { byte[] dataBytes = client.getData().forPath(path); return (dataBytes == null || dataBytes.length == 0) ? null : new String(dataBytes, charset); } catch (NoNodeException e) { // ignore NoNode Exception. } catch (Exception e) { throw new IllegalStateException(e.getMessage(), e); } return null; }
Source:
private boolean hasProviderProtocol() { return getProvider() != null && getProvider().getProtocols() != null && getProvider().getProtocols().isEmpty(); }

Target:
private boolean hasProviderProtocol() { return getProvider() != null && getProvider().getProtocols() != null && !getProvider().getProtocols().isEmpty(); }
Source:
public void testRegister() { //test one url abstractRegistry.register(mockUrl); assert abstractRegistry.getRegistered().contains(mockUrl); //test multiple urls abstractRegistry.getRegistered().clear(); List<URL> urlList = getList(); for (URL url : urlList) { abstractRegistry.register(url); } Assert.assertThat(abstractRegistry.getRegistered().size(), Matchers.equalTo(urlList.size())); }

Target:
public void testRegister() throws Exception { //test one url abstractRegistry.register(mockUrl); assert abstractRegistry.getRegistered().contains(mockUrl); //test multiple urls abstractRegistry.getRegistered().clear(); List<URL> urlList = getList(); for (URL url : urlList) { abstractRegistry.register(url); } Assert.assertThat(abstractRegistry.getRegistered().size(), Matchers.equalTo(urlList.size())); }
Source:
private String pullRequestBaseToDisplayName(@Nullable String pullRequestBase) { return pullRequestBase != null ? pullRequestBase : "default branch"; }

Target:
private static String pullRequestBaseToDisplayName(@Nullable String pullRequestBase) { return pullRequestBase != null ? pullRequestBase : "default branch"; }
Source:
public Long getCreatedAt() { return createdAt; }

Target:
public long getCreatedAt() { return createdAt; }
Source:
private void doDefinition(WebService.NewAction action) { action.setDescription("Search for a collection of relevant rules matching a specified query.<br/>" + "Since 5.5, following fields in the response have been deprecated :" + "<ul>" + "<li>\"effortToFixDescription\" becomes \"gapDescription\"</li>" + "<li>\"debtRemFnCoeff\" becomes \"remFnGapMultiplier\"</li>" + "<li>\"defaultDebtRemFnCoeff\" becomes \"defaultRemFnGapMultiplier\"</li>" + "<li>\"debtRemFnOffset\" becomes \"remFnBaseEffort\"</li>" + "<li>\"defaultDebtRemFnOffset\" becomes \"defaultRemFnBaseEffort\"</li>" + "<li>\"debtOverloaded\" becomes \"remFnOverloaded\"</li>" + "</ul>" + "In 7.1, a new field 'scope' has been added to the response.") .setResponseExample(getClass().getResource("search-example.json")) .setSince("4.4") .setHandler(this); // Rule-specific search parameters defineRuleSearchParameters(action); }

Target:
private void doDefinition(WebService.NewAction action) { action.setDescription("Search for a collection of relevant rules matching a specified query.<br/>" + "Since 5.5, following fields in the response have been deprecated :" + "<ul>" + "<li>\"effortToFixDescription\" becomes \"gapDescription\"</li>" + "<li>\"debtRemFnCoeff\" becomes \"remFnGapMultiplier\"</li>" + "<li>\"defaultDebtRemFnCoeff\" becomes \"defaultRemFnGapMultiplier\"</li>" + "<li>\"debtRemFnOffset\" becomes \"remFnBaseEffort\"</li>" + "<li>\"defaultDebtRemFnOffset\" becomes \"defaultRemFnBaseEffort\"</li>" + "<li>\"debtOverloaded\" becomes \"remFnOverloaded\"</li>" + "</ul>") .setResponseExample(getClass().getResource("search-example.json")) .setSince("4.4") .setHandler(this); // Rule-specific search parameters defineRuleSearchParameters(action); }
Source:
private Optional<ScmInfo> getScmInfoForComponent(Component component) { ScannerReport.Changesets changesets = scannerReportReader.readChangesets(component.getReportAttributes().getRef()); if (changesets != null) { if (changesets.getChangesetCount() == 0) { return generateAndMergeDb(component, changesets.getCopyFromPrevious()); } return getScmInfoFromReport(component, changesets); } LOGGER.trace("No SCM info for file '{}'", component.getKey()); return generateAndMergeDb(component, false); }

Target:
private Optional<ScmInfo> getScmInfoForComponent(Component component) { ScannerReport.Changesets changesets = scannerReportReader.readChangesets(component.getReportAttributes().getRef()); if (changesets == null) { LOGGER.trace("No SCM info for file '{}'", component.getKey()); // SCM not available. It might have been available before - don't keep author and revision. return generateAndMergeDb(component, false); } // will be empty if the flag "copy from previous" is set, or if the file is empty. if (changesets.getChangesetCount() == 0) { return generateAndMergeDb(component, changesets.getCopyFromPrevious()); } return getScmInfoFromReport(component, changesets); }
Source:
public void setQualityGate(QualityGate g) { // fail fast requireNonNull(g); checkState(qualityGate == null, "QualityGateHolder can be initialized only once"); this.qualityGate = Optional.of(g); }

Target:
public void setQualityGate(QualityGate g) { // fail fast requireNonNull(g); checkState(qualityGate == null, "QualityGateHolder can be initialized only once"); this.qualityGate = g; }
Source:
protected void ensurePluginIsInstalled(String key) { if (!serverPluginRepository.hasPlugin(key)) { throw new IllegalArgumentException(format("Plugin [%s] is not installed", key)); } }

Target:
private void ensurePluginIsInstalled(String key) { if (!serverPluginRepository.hasPlugin(key)) { throw new IllegalArgumentException(format("Plugin [%s] is not installed", key)); } }
Source:
public Tracking<RAW, BASE> track(Collection<RAW> rawInput, Collection<BASE> baseInput) { Tracking<RAW, BASE> tracking = new Tracking<>(rawInput, baseInput); // 1. match issues with same rule, same line and same line hash, but not necessarily with same message match(tracking, LineAndLineHashKey::new, true); // 2. match issues with same rule, same message and same line hash match(tracking, LineHashAndMessageKey::new, true); return tracking; }

Target:
public Tracking<RAW, BASE> track(Collection<RAW> rawInput, Collection<BASE> baseInput) { Tracking<RAW, BASE> tracking = new Tracking<>(rawInput, baseInput); // 1. match issues with same rule, same line and same line hash, but not necessarily with same message match(tracking, LineAndLineHashKey::new); // 2. match issues with same rule, same message and same line hash match(tracking, LineHashAndMessageKey::new); return tracking; }
Source:
private void closeIssuesForDeletedComponentUuids(Set<String> deletedComponentUuids) { DiskCache<DefaultIssue>.DiskAppender cacheAppender = issueCache.newAppender(); try { for (String deletedComponentUuid : deletedComponentUuids) { List<DefaultIssue> issues = issuesLoader.loadForComponentUuid(deletedComponentUuid, false); for (DefaultIssue issue : issues) { issue.setBeingClosed(true); // TODO should be renamed issue.setOnDisabledRule(false); issueLifecycle.doAutomaticTransition(issue); cacheAppender.append(issue); } } } finally { cacheAppender.close(); } }

Target:
private void closeIssuesForDeletedComponentUuids(Set<String> deletedComponentUuids) { DiskCache<DefaultIssue>.DiskAppender cacheAppender = issueCache.newAppender(); try { for (String deletedComponentUuid : deletedComponentUuids) { List<DefaultIssue> issues = issuesLoader.loadForComponentUuid(deletedComponentUuid); for (DefaultIssue issue : issues) { issue.setBeingClosed(true); // TODO should be renamed issue.setOnDisabledRule(false); issueLifecycle.doAutomaticTransition(issue); cacheAppender.append(issue); } } } finally { cacheAppender.close(); } }
Source:
public void close() { try { hazelcastCluster.close(); } catch (HazelcastInstanceNotActiveException e) { // hazelcastCluster may be already closed by the shutdown hook LOGGER.debug("Unable to close Hazelcast cluster", e); } }

Target:
public void close() { hazelcastCluster.close(); }
Source:
private void writeResponse(Request request, Response response, OrganizationDto organization, GroupDto group) { WsUserGroups.CreateWsResponse.Builder respBuilder = WsUserGroups.CreateWsResponse.newBuilder(); respBuilder.setGroup(toProtobuf(organization, group, 0)); writeProtobuf(respBuilder.build(), request, response); }

Target:
private void writeResponse(Request request, Response response, OrganizationDto organization, GroupDto group) { WsUserGroups.CreateWsResponse.Builder respBuilder = WsUserGroups.CreateWsResponse.newBuilder(); // 'default' is always false as it's not possible to create a default group respBuilder.setGroup(toProtobuf(organization, group, 0, false)); writeProtobuf(respBuilder.build(), request, response); }
Source:
public void stop() { hzInstance.getReplicatedMap(CLIENT_UUIDS).remove(hzInstance.getLocalEndpoint().getUuid()); // Shutdown Hazelcast properly hzInstance.shutdown(); }

Target:
public void stop() { // Shutdown Hazelcast properly hzInstance.shutdown(); }
Source:
public void testLocation() { JavaPackageInfoSource packageInfo = Roaster.create(JavaPackageInfoSource.class); packageInfo.setPackage("abc"); Assert.assertThat(packageInfo.getStartPosition(), is(0)); System.out.println(packageInfo); Assert.assertThat(packageInfo.getEndPosition(), is(20)); //TODO check this Assert.assertThat(packageInfo.getColumnNumber(), is(0)); Assert.assertThat(packageInfo.getLineNumber(), is(1)); }

Target:
public void testLocation() { JavaPackageInfoSource packageInfo = Roaster.create(JavaPackageInfoSource.class); packageInfo.setPackage("abc"); Assert.assertThat(packageInfo.getStartPosition(), is(0)); Assert.assertThat(packageInfo.getEndPosition(), is(20)); // TODO check this Assert.assertThat(packageInfo.getColumnNumber(), is(0)); Assert.assertThat(packageInfo.getLineNumber(), is(1)); }
Source:
public void shouldCompileMixedJavaAndKotlinSources() throws Exception { KotlinTestAssumptions.assumeCompilerSupportsMixedSources(); ProjectWorkspace.ProcessResult buildResult = workspace.runBuckCommand("build", "//com/example/mixed:example"); buildResult.assertSuccess("Build should have succeeded."); }

Target:
public void shouldCompileMixedJavaAndKotlinSources() throws Exception { ProjectWorkspace.ProcessResult buildResult = workspace.runBuckCommand("build", "//com/example/mixed:example"); buildResult.assertSuccess("Build should have succeeded."); }
Source:
public void testAndroidKotlinLibraryMixedSourcesCompilation() throws Exception { AssumeAndroidPlatform.assumeSdkIsAvailable(); KotlinTestAssumptions.assumeCompilerAvailable(workspace.asCell().getBuckConfig()); KotlinTestAssumptions.assumeCompilerSupportsMixedSources(); ProcessResult result = workspace.runBuckBuild("//kotlin/com/sample/lib:lib_mixed_sources"); result.assertSuccess(); }

Target:
public void testAndroidKotlinLibraryMixedSourcesCompilation() throws Exception { AssumeAndroidPlatform.assumeSdkIsAvailable(); KotlinTestAssumptions.assumeCompilerAvailable(workspace.asCell().getBuckConfig()); ProcessResult result = workspace.runBuckBuild("//kotlin/com/sample/lib:lib_mixed_sources"); result.assertSuccess(); }
Source:
public Set<Locator> getLocators(RollupExecutionContext executionContext) { Set<Locator> locators = new HashSet<Locator>(); try { // get a list of all locators to rollup for a shard locators.addAll(IOContainer.fromConfig().getLocatorIO().getLocators(getShard())); locatorsPerShard.update(locators.size()); } catch (Throwable e) { executionContext.markUnsuccessful(e); log.error("Failed reading locators for slot: " + getParentSlot(), e); } return locators; }

Target:
public Set<Locator> getLocators(RollupExecutionContext executionContext) { Set<Locator> locators = new HashSet<Locator>(); try { // get a list of all locators to rollup for a shard locators.addAll(IOContainer.fromConfig().getLocatorIO().getLocators(getShard())); locatorsPerShard.update(locators.size()); } catch (Throwable e) { log.error("Failed reading locators for slot: " + getParentSlot(), e); executionContext.markUnsuccessful(e); } return locators; }
Source:
final public void run() { int sleepMillis = config.getIntegerProperty(CoreConfig.EXCESS_ENUM_READER_SLEEP); // Loop and periodically read the table from Cassandra while (true) { try { Set<Locator> excess = IOContainer.fromConfig().getExcessEnumIO().getExcessEnumMetrics(); synchronized (this) { excessEnumMetrics = excess; } readMeter.mark(); Thread.sleep(sleepMillis); } catch (Exception e) { log.error("ExcessEnumReader failed with exception " + e); readErrMeter.mark(); } } }

Target:
final public void run() { int sleepMillis = config.getIntegerProperty(CoreConfig.EXCESS_ENUM_READER_SLEEP); // Loop and periodically read the table from Cassandra while (true) { try { Set<Locator> excess = IOContainer.fromConfig().getExcessEnumIO().getExcessEnumMetrics(); excessEnumMetrics = excess; readMeter.mark(); Thread.sleep(sleepMillis); } catch (Exception e) { log.error("ExcessEnumReader failed with exception " + e); readErrMeter.mark(); } } }
Source:
public int processLocator(int rollCount, RollupExecutionContext executionContext, RollupBatchWriter rollupBatchWriter, Locator locator) { if (log.isTraceEnabled()) log.trace("Rolling up (check,metric,dimension) for (gran,slot,shard) {}", locator, parentSlotKey); try { executeRollupForLocator(executionContext, rollupBatchWriter, locator); rollCount += 1; } catch (Throwable any) { // continue on, but log the problem so that we can fix things later. executionContext.markUnsuccessful(any); executionContext.decrementReadCounter(); log.error(any.getMessage(), any); log.error("BasicRollup failed for at {}", parentSlotKey, serverTime); } return rollCount; }

Target:
protected int processLocator(int rollCount, RollupExecutionContext executionContext, RollupBatchWriter rollupBatchWriter, Locator locator) { if (log.isTraceEnabled()) log.trace("Rolling up (check,metric,dimension) for (gran,slot,shard) {}", locator, parentSlotKey); try { executeRollupForLocator(executionContext, rollupBatchWriter, locator); rollCount += 1; } catch (Throwable any) { // continue on, but log the problem so that we can fix things later. executionContext.markUnsuccessful(any); executionContext.decrementReadCounter(); log.error(any.getMessage(), any); log.error("BasicRollup failed for at {}", parentSlotKey, serverTime); } return rollCount; }
Source:
public void testNoCassandraHostsFailsValidation() { // given Configuration config = Configuration.getInstance(); config.setProperty(CoreConfig.CASSANDRA_HOSTS, ""); // when BluefloodServiceStarterException ex = null; try { BluefloodServiceStarter.validateCassandraHosts(); } catch (BluefloodServiceStarterException e) { ex = e; } // then assertNotNull(ex); assertEquals(-1, ex.getStatus()); }

Target:
public void testNoCassandraHostsFailsValidation() { // given Configuration config = Configuration.getInstance(); config.setProperty(CoreConfig.CASSANDRA_HOSTS, ""); // when BluefloodServiceStarter.validateCassandraHosts(); // then // exception was thrown }
Source:
public void testCassandraHostWithoutPortFailsValidation() { // given Configuration config = Configuration.getInstance(); config.setProperty(CoreConfig.CASSANDRA_HOSTS, "127.0.0.1"); // when BluefloodServiceStarterException ex = null; try { BluefloodServiceStarter.validateCassandraHosts(); } catch (BluefloodServiceStarterException e) { ex = e; } // then assertNotNull(ex); assertEquals(-1, ex.getStatus()); }

Target:
public void testCassandraHostWithoutPortFailsValidation() { // given Configuration config = Configuration.getInstance(); config.setProperty(CoreConfig.CASSANDRA_HOSTS, "127.0.0.1"); // when BluefloodServiceStarter.validateCassandraHosts(); // then // exception was thrown }
Source:
public void testRollupModeEnabled() { // given Configuration config = Configuration.getInstance(); config.setProperty(CoreConfig.ROLLUP_MODE, "true"); String[] args = new String[0]; // when BluefloodServiceStarterException ex = null; try { BluefloodServiceStarter.main(args); } catch (BluefloodServiceStarterException e) { ex = e; } // then assertNull(ex); }

Target:
public void testRollupModeEnabled() { // given Configuration config = Configuration.getInstance(); config.setProperty(CoreConfig.ROLLUP_MODE, "true"); // when BluefloodServiceStarter.run(); // then // no exception thrown }
Source:
public int getNumPoints() { int enumCount = 0; Set keySet = hashedEnumValues2Count.keySet(); Iterator itr = keySet.iterator(); while(itr.hasNext()){ enumCount+= hashedEnumValues2Count.get(itr.next()); } return enumCount; }

Target:
public int getNumPoints() { int enumCount = 0; for (long count : hashedEnumValues2Count.values()) { enumCount += count; } return enumCount; }
Source:
private Map<Long, String> getEnumValueFromHashes(ColumnList<Long> enumValues) { HashMap<Long,String> hash2enumValues = new HashMap<Long, String>(); for (Column<Long> col: enumValues) { hash2enumValues.put(col.getName(), col.getStringValue()); } return hash2enumValues; }

Target:
public Map<Long, String> getEnumValueFromHashes(ColumnList<Long> enumValues) { HashMap<Long,String> hash2enumValues = new HashMap<Long, String>(); for (Column<Long> col: enumValues) { hash2enumValues.put(col.getName(), col.getStringValue()); } return hash2enumValues; }
Source:
private static <T> Points<T> asPoints(Class<T> type, long initialTime, long timeDelta, T... values) { Points<T> points = new Points<T>(); long time = initialTime; for (T v : values) { points.add(new Points.Point<T>(time, v)); time += timeDelta; } return points; }

Target:
public static <T> Points<T> asPoints(Class<T> type, long initialTime, long timeDelta, T... values) { Points<T> points = new Points<T>(); long time = initialTime; for (T v : values) { points.add(new Points.Point<T>(time, v)); time += timeDelta; } return points; }
Source:
public void insertPreaggreatedMetrics(Collection<IMetric> metrics) throws Exception { try { AstyanaxWriter.getInstance().insertMetrics(metrics, CassandraModel.CF_METRICS_PREAGGREGATED_FULL); } catch (ConnectionException e) { throw new IOException(e); } }

Target:
public void insertPreaggreatedMetrics(Collection<IMetric> metrics) throws IOException { try { AstyanaxWriter.getInstance().insertMetrics(metrics, CassandraModel.CF_METRICS_PREAGGREGATED_FULL); } catch (ConnectionException e) { throw new IOException(e); } }
Source:
public ByteBuffer toByteBuffer(Object o) { try { byte type = typeOf(o); byte[] buf = new byte[sizeOf(o, type, VERSION_2_TIMER)]; serializeFullResMetric(o, buf); ByteBuffer out = ByteBuffer.wrap(buf); return out; } catch(IOException e) { throw new RuntimeException(e); } }

Target:
public ByteBuffer toByteBuffer(Object o) { try { byte type = typeOf(o); byte[] buf = new byte[sizeOf(o, type)]; serializeFullResMetric(o, buf); ByteBuffer out = ByteBuffer.wrap(buf); return out; } catch(IOException e) { throw new RuntimeException(e); } }