diff stringlengths 38 1.78k | msg_token stringlengths 9 190 |
|---|---|
<nb> public class FavoriteManager {
@ override
public String toString ( ) {
- return String . format ( STRING0 , title , url ) ;
+ return String . format ( STRING1 , title , url , String . format ( HackerNewsClient . WEB_ITEM_PATH , itemId ) ) ;
}
@ override
<nb> public class FavoriteManagerTest {
a... | Add HN item URL to email export |
<nb> public abstract class SharedTree < M extends SharedTreeModel < M , P , O > , P extends Sha
super . init ( expensive ) ;
if ( _nclass > SharedTreeModel . SharedTreeParameters . MAX_SUPPORTED_LEVELS )
- throw new IllegalArgumentException ( STRING0 ) ;
+ error ( STRING1 , STRING0 ) ;
+
+ if ( _parms . _... | Fixed error conditions |
<nb> public class HealthIndicatorAutoConfiguration {
@ bean
@ conditionalonmissingbean ( name = STRING0 )
- public HealthIndicator rabbitHealthIndicator ( ) {
+ public HealthIndicator solrHealthIndicator ( ) {
if ( this . solrServers . size ( ) == NUMBER0 ) {
return new SolrHealthIndicator ( this . solrSe... | Fix name of solr health indicator |
<nb> public final class ActivityStackSupervisor implements DisplayListener {
}
final ActivityRecord r = stack . topRunningActivityLocked ( null ) ;
- final TaskRecord topTask = r . task ;
- if ( ! topTask . mResizeable ) {
- Slog . w ( TAG , STRING0 + topTask + STRING1 ) ;
+ if ( r != null && ! r . task .... | Fixed NPE when trying to resize stack with no running activity |
<nb> public final class HikariPool implements HikariPoolMBean , IBagStateListener
{
timeoutMs = Math . max ( NUMBER0 , timeoutMs ) ;
- boolean valid ;
+ boolean valid = true ;
if ( isJdbc4ConnectionTest )
{
valid = connection . isValid ( ( int ) TimeUnit . MILLISECONDS . toSeconds ( timeoutMs ) ) ;
<n... | Remove redundant assignment |
<nb> public class MyActivities extends ProcessBuilder {
. expectWithin ( seconds ( NUMBER0 ) )
. errorIfOver ( seconds ( NUMBER1 ) ) . to ( STRING0 ) ;
}
- } ;
+ }
SINGLE | tidied up the code for the BAM Example |
<nb> public class MessageChannelHandler extends SimpleChannelUpstreamHandler {
SINGLE
SINGLE
- SINGLE
- SINGLE
+
+ SINGLE
+ SINGLE
@ override
public void messageReceived ( ChannelHandlerContext ctx , MessageEvent e ) throws Exception { | improve comment on usage also FrameDecoder usage of cumalation was fixed |
<nb> public abstract class ActivatableNotificationView extends ExpandableOutlineView
if ( mDrawingAppearAnimation ) {
startAppearAnimation ( false COMMENT , translationDirection ,
NUMBER0 , duration , onFinishedRunnable ) ;
+ } else if ( onFinishedRunnable != null ) {
+ onFinishedRunnable . run ( ) ;
}
} ... | Fixed a bug where notifications could remain in the overlay |
<nb> public class ConfigObject extends GroovyObjectSupport implements Writable , Map ,
private Map doMerge ( Map config , Map other ) {
for ( Object o : other . entrySet ( ) ) {
Map . Entry next = ( Map . Entry ) o ;
- String key = ( String ) next . getKey ( ) ;
+ Object key = next . getKey ( ) ;
Object val... | Removed two explicit casts that may fail at runtime |
<nb> public class FlatWelcomeFrameProvider implements WelcomeFrameProvider {
}
public static boolean isAvailable ( ) {
- return Registry . is ( STRING0 ) || PlatformUtils . isJetBrainsProduct ( ) ;
+ return Registry . is ( STRING0 ) || ( PlatformUtils . isJetBrainsProduct ( ) && ! PlatformUtils . isDatabaseID... | DataGrip shows WelcomeScreen on frame close |
<nb> public class Align {
static public final int bottom = NUMBER0 < < NUMBER1 ;
static public final int left = NUMBER0 < < NUMBER2 ;
static public final int right = NUMBER0 < < NUMBER3 ;
+
+ static public final int topLeft = top | left ;
+ static public final int topRight = top | right ;
+ static public ... | Added combinations for convenience |
<nb> public class InternalOsmAndAPIImpl implements InternalOsmAndAPI {
@ override
public TargetPointsHelper getTargetPointsHelper ( ) {
- SINGLE
- return null ;
+ return app . getTargetPointsHelper ( ) ;
}
@ override | Fix an issue |
<nb> public final class Main {
eventListener . outputTrace ( buildId ) ;
} catch ( RuntimeException e ) {
PrintStream stdErr = console . getStdErr ( ) ;
- stdErr . println ( STRING0 ) ;
+ stdErr . println ( STRING1 ) ;
e . printStackTrace ( stdErr ) ;
}
} | Provide a better message when skipping over non fatal errors |
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> public class ClusterCommandsTest extends JedisTestBase {
node2 . clusterDelSlots ( NUMBER0 , NUMBER1 , NUMBER2 , NUMBER3 , NUMBER4 , NUMBER5 , NUMBER6 , NUMBER7 ) ;
node1 . c... | Fix ClusterCommandTest AfterClass handling as it may leave the cluster inconsistent |
<nb> public final class JSONScanner extends JSONLexerBase {
private final String text ;
- private boolean isAndroid = ASMUtils . isAndroid ( ) ;
+ private static boolean isAndroid = ASMUtils . isAndroid ( ) ;
public JSONScanner ( String input ) {
this ( input , JSON . DEFAULT_PARSER_FEATURE ) ;
<nb> i... | optimized for isAndroid call |
<nb>
COMMENT
package NAMESPACE ;
- public class GenTest {
+ import NAMESPACE ;
+ import NAMESPACE ;
+
+ import NAMESPACE ;
- SINGLE
+ import static NAMESPACE ;
+
+ public class GenTest {
+ @ test
+ public void shouldUseCustomRandomNumberGenerator ( ) {
+ SINGLE
+ final Random rng = n... | Tests a custom random number generator |
<nb> public class StreamConfig implements Serializable {
public void setOutputSelectors ( List < OutputSelector < ? > > outputSelector ) {
try {
- if ( outputSelector != null ) {
+ if ( outputSelector != null && ! outputSelector . isEmpty ( ) ) {
setDirectedEmit ( true ) ;
config . setBytes ( OUTPUT_SELEC... | streaming Proper exception propagation for udf exception collector bugfix |
<nb> public class ExecuteQueryPersistentMethod
Query q = session . createQuery ( query ) ;
SINGLE
if ( paginateParams . containsKey ( GrailsHibernateUtil . ARGUMENT_MAX ) ) {
- Integer maxParam = ( Integer ) converter . convertIfNecessary ( paginateParams . get ( GrailsHibernateUtil . ARGUMENT_MAX ) , Integer .... | remove extraneous cast |
<nb> import NAMESPACE ;
import NAMESPACE ;
COMMENT
- COMMENT
- COMMENT
+ COMMENT
COMMENT
public class MovieHistoryAdapter extends SectionedHistoryAdapter { | Fix invalid reference |
<nb> public class Index extends GraphDatabaseApp
@ override
public void shutdown ( )
{
- System . out . println ( STRING0 ) ;
for ( Object indexService : this . indexServices . values ( ) )
{
try | Removed a System out println |
<nb> public class AnimationSet extends Animation {
for ( int i = count - NUMBER0 ; i >= NUMBER1 ; -- i ) {
final Animation a = animations . get ( i ) ;
-
- temp . clear ( ) ;
- final Interpolator interpolator = a . mInterpolator ;
- a . applyTransformation ( interpolator != null ? interpolator . getInterp... | Fix behavior of AnimationSet and fillBefore |
<nb> public class Node implements Serializable {
return first ;
}
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
public Node getFirstFirstChild ( ) {
- return first == null ? null : first . first ;
+ return first . first ;
}
public Node getSecondChild ( ) { | Remove the null check in getFirstFirstChild |
<nb> public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
checkSuper ( receiver , resultingDescriptor , context . trace , selectorExpression ) ;
return resultingDescriptor . getType ( ) ;
}
- if ( resolutionResult . isAmbiguity ( ) || resolutionResult . isSingleResult ( ) ) {
+ if ( res... | returned right type if there was only one failed candidate property |
<nb> public class NewBlogFragment extends AbstractFragment implements TextWatcher {
String blogId = details . getString ( STRING0 ) ;
final SharedPreferences settings = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ;
String username = settings . getString ( WordPress . WPCOM_USERNAME_PREFERE... | Don t store the password after creating a blog |
<nb> class ConvertedCode implements TextBlockTransferableData {
@ override
public int getOffsets ( int [ ] offsets , int index ) {
- return NUMBER0 ;
+ return index ;
}
@ override
public int setOffsets ( int [ ] offsets , int index ) {
- return NUMBER0 ;
+ return index ;
}
public String getD... | Fix returned indices from TextBlockTransferableData |
<nb> final class Tracer {
COMMENT
static void clearThreadTrace ( ) {
- traces . set ( null ) ;
+ traces . remove ( ) ;
}
COMMENT | Remove Tracer thread local storage when cleaning up |
<nb> public class Ctx
try {
int tid = socket . getTid ( ) ;
emptySlots . add ( tid ) ;
- slots [ tid ] . close ( ) ;
slots [ tid ] = null ;
SINGLE
<nb> public class Ctx
reaper . stop ( ) ;
}
}
- catch ( IOException e ) {
- throw new RuntimeException ( e ) ;
- }
finally {
slotSync . unloc... | don t revert this fix would cause shutdown to hang |
<nb> public class AnalyticsTrackerMixpanel extends Tracker {
break ;
case PUSH_NOTIFICATION_TAPPED :
instructions = AnalyticsTrackerMixpanelInstructionsForStat .
- mixpanelInstructionsForEventName ( STRING0 ) ;
+ mixpanelInstructionsForEventName ( STRING1 ) ;
break ;
case SUPPORT_OPENED_HELPSHIFT_SCREEN :... | Use the same event name of the iOS platform for the Push Notification Tapped event |
<nb> public class PlatformFrameTitleBuilder extends FrameTitleBuilder {
public String getProjectTitle ( final Project project ) {
final VirtualFile baseDir = project . getBaseDir ( ) ;
if ( baseDir != null ) {
- if ( baseDir . getName ( ) . equals ( project . getName ( ) ) ) {
+ if ( SystemInfo . isMac && bas... | show project name project path even if dir name equals project name for non mac oses |
<nb> public final class FileSystemMaster extends AbstractMaster {
String ufsUri = resolution . getUri ( ) . toString ( ) ;
if ( CommonUtils . isUfsObjectStorage ( ufsUri ) ) {
throw new UnsupportedOperationException (
- STRING0 + ufsUri ) ;
+ STRING1 + ufsUri ) ;
}
UnderFileSystem ufs = resolution . getUf... | Reduce line length |
<nb> import NAMESPACE ;
COMMENT
COMMENT
COMMENT
- @ bugpattern ( name = STRING0 ,
+ @ bugpattern ( name = STRING1 ,
summary = STRING2 , explanation =
STRING3
+ STRING4
<nb> public class InjectJavaxInjectOnAbstractMethodNegativeCases {
@ com.google.inject.inject
abstract void abstractMethod ( ) ;
... | Added Suppression test and removed prefix from suppression string |
<nb> public class TabletStatusBar extends StatusBar implements
SINGLE
SINGLE
if ( mWindowManager . hasNavigationBar ( ) ) {
- throw new RuntimeException (
- STRING0 ) ;
+ Slog . e ( TAG , STRING0 ) ;
}
} catch ( RemoteException ex ) {
} | Log an error instead of throwing an exception if navigation bar is enabled in tablet UI |
<nb> public class ProtoUtilsTest {
@ test
public void marshallerShouldNotLimitProtoSize ( ) throws Exception {
- byte [ ] bigName = new byte [ NUMBER0 * NUMBER1 * NUMBER1 ] ;
+ SINGLE
+ byte [ ] bigName = new byte [ NUMBER2 * NUMBER1 * NUMBER1 ] ;
new Random ( ) . nextBytes ( bigName ) ;
proto = Type ... | Reducing the size of the large proto in ProtoUtilsTest |
<nb> public class MediaType extends MimeType implements Serializable {
public final static String TEXT_HTML_VALUE = STRING0 ;
COMMENT
+ COMMENT
+ COMMENT
+ public final static MediaType TEXT_MARKDOWN ;
+
+ COMMENT
+ COMMENT
+ COMMENT
+ public final static String TEXT_MARKDOWN_VALUE = STRING1 ;
+... | Add text markdown MediaType constant |
<nb> public class Configuration
return mIgnoreBraces ;
}
- COMMENT
+ COMMENT
public boolean isIgnorePublicInInterface ( )
{
return mIgnorePublicInInterface ; | Fixed a copy paste error |
<nb> public class Synctex implements CompilePdfStartedEvent . Handler ,
SINGLE
if ( event . getResult ( ) . getSucceeded ( ) && handleDesktopSynctex ( ) )
{
+ int page = NUMBER0 ;
+ if ( event . getResult ( ) . isSynctexAvailable ( ) )
+ page = event . getResult ( ) . getPdfLocation ( ) . getPage ( ) ;
De... | correctly invoke pdf viewer even when concordance isn t available |
<nb> class PrivacyItem implements Cacheable , Comparable {
}
private boolean verifyJID ( JID jid , Roster roster ) {
+ if ( jid == null ) {
+ return false ;
+ }
if ( type == Type . jid ) {
if ( jidValue . getResource ( ) != null ) {
SINGLE | Fixed possible NPE |
<nb> public class DefaultCometSupportResolver implements CometSupportResolver {
}
} ;
- if ( l . isEmpty ( ) && ! testClassExists ( TOMCAT ) ) {
+ if ( l . isEmpty ( ) ) {
return detectContainersPresent ( ) ;
}
return l ; | Remove special warning for Tomcat as it cause more confusion than it helps |
<nb> public class Ir
}
COMMENT
- COMMENT
+ COMMENT
COMMENT
COMMENT
COMMENT | Fix typo in javadoc |
<nb> public class Portuguese extends Language {
return tagger ;
}
+ COMMENT
+ COMMENT
+ COMMENT
@ override
public Disambiguator getDisambiguator ( ) {
if ( disambiguator == null ) {
<nb> public class Portuguese extends Language {
return disambiguator ;
}
+ COMMENT
+ COMMENT
+ COMMENT
@... | pt add since tags |
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> public abstract class ModuleType < T extends ModuleBuilder > {
return true ;
}
- public static ModuleType get ( Module module ) {
+ public static Mod... | code cleanup added annotation to show that ModuleType get needs non null module |
<nb> public class Reference extends ValueSymbol {
return Objects . equal ( info . ident ( ) , o . info . ident ( ) ) ;
}
+ @ override
+ public int hashCode ( ) {
+ return info . hashCode ( ) ;
+ }
} | fixed hashcode in reference |
<nb> public final class LineageMasterTest {
}
}
+ @ test
+ public void reinitializeFileTest ( ) throws Exception {
+ mLineageMaster . createLineage ( Lists . < TachyonURI > newArrayList ( ) ,
+ Lists . newArrayList ( new TachyonURI ( STRING0 ) ) , mJob ) ;
+ mLineageMaster . reinitializeFile ( STRING0 ,... | Added tests for file operations |
<nb> public class ClusterImpl implements Cluster {
int size = oldListeners . size ( ) - NUMBER0 ;
Set < MembershipListener > newListeners = new LinkedHashSet < MembershipListener > ( size ) ;
for ( MembershipListener existingListener : oldListeners ) {
- if ( existingListener . equals ( listener ) )
+ if ( ! ... | removeMembershipListener method has wrong code |
<nb> public class AppOpsService extends IAppOpsService . Stub {
}
private static String [ ] getPackagesForUid ( int uid ) {
+ String [ ] packageNames = null ;
try {
- return AppGlobals . getPackageManager ( ) . getPackagesForUid ( uid ) ;
+ packageNames = AppGlobals . getPackageManager ( ) . getPackagesFo... | Fix NPE in AppOpsService |
<nb> public class AdaptedConnection implements ConsumerConnection {
return delegate . getMetaData ( ) ;
}
+ @ suppresswarnings ( { STRING0 } )
public < T > T getModel ( Class < T > type , BuildOperationParametersVersion1 operationParameters ) throws UnsupportedOperationException , IllegalStateException {
if... | Added explicit deprecation for better clarity |
<nb> public class SimplifyStreamApiCallChainsInspection extends BaseJavaBatchLocalIns
final Project project = methodCall . getProject ( ) ;
final PsiExpression newMethodExpression = JavaPsiFacade . getElementFactory ( project ) . createExpressionFromText ( myMethodFQN , methodCall ) ;
- final PsiElement shortMe... | shorten refs on physical element |
<nb> import NAMESPACE ;
public class FluxMain {
private static Logger LOG = LoggerFactory . getLogger ( FluxMain . class ) ;
+
public static void main ( String [ ] args ) throws Exception {
+ SINGLE
TopologyDef topologyDef = FluxParser . parse ( args [ NUMBER0 ] ) ;
<nb> public class FluxMain {
SI... | add TODO items |
<nb> public class AudioTrack
COMMENT
COMMENT
public int setPlaybackRate ( int sampleRateInHz ) {
- if ( mState == STATE_UNINITIALIZED ) {
+ if ( mState != STATE_INITIALIZED ) {
return ERROR_INVALID_OPERATION ;
}
if ( sampleRateInHz <= NUMBER0 ) { | Fix AudioTrack setPlaybackRate error handling |
<nb> public class TimeoutTest extends TestBase {
try {
t . verify ( data ) ;
+ fail ( ) ;
} catch ( MockitoAssertionError e ) { } ;
verify ( mode , times ( NUMBER0 ) ) . verify ( data ) ; | Fixed PMD violation should also fix the build |
<nb> public class OSchemaShared extends ODocumentWrapperNoClass implements OSchema , O
getDatabase ( ) . command ( new OCommandSQL ( cmd . toString ( ) ) ) . execute ( ) ;
+ SINGLE
+ getDatabase ( ) . reload ( ) ;
+ reload ( ) ;
+
SINGLE
rwLock . writeLock ( ) . lock ( ) ;
try { | Revert Revert Improved creation of class from remote |
<nb> class Annotation {
}
public void method ( @ suppresswarnings ( STRING0 ) int x ) {
}
- }
+ public void method2 ( @ suppresswarnings ( value = { STRING0 } ) int y ) {
+ }
+ public void method3 ( @ suppresswarnings ( { STRING0 , STRING1 } ) int z ) {
+ }
+ }
<nb> class Annotation {
}
public v... | Now also testing value as well as arrays in annotation params |
<nb> public class ArrayUtils {
}
return false ;
}
+
+ public static boolean deepEquals ( int [ ] arr1 , int [ ] arr2 ) {
+ if ( arr1 . length != arr2 . length )
+ return false ;
+ for ( int i = NUMBER0 ; i < arr1 . length ; i ++ )
+ if ( arr1 [ i ] != arr2 [ i ] )
+ return false ;
+ return true ; ... | Add ArrayUtils deepEquals for int arrays |
<nb> public class Watchdog extends Thread {
SINGLE
public static final String [ ] NATIVE_STACKS_OF_INTEREST = new String [ ] {
STRING0 ,
+ STRING1 ,
+ STRING2 ,
+ STRING3 ,
STRING4 ,
STRING5 ,
STRING6 ,
- STRING7
+ STRING8 , SINGLE
+ STRING9 , SINGLE
} ;
static Watchdog sWatchdog ; | Unify dumped native stack traces |
<nb> public final class NioEventLoop extends SingleThreadEventLoop {
private static final int CLEANUP_INTERVAL = NUMBER0 ; SINGLE
+ private static final int MIN_PREMATURE_SELECTOR_RETURNS = NUMBER1 ;
private static final int SELECTOR_AUTO_REBUILD_THRESHOLD ;
SINGLE
<nb> public final class NioEventLoop e... | Log prematurly returning select at DEBUG level and increase the minimum required consecutive premature returns to log |
<nb> public class ServerTester extends ExternalResource {
private Platform platform ;
private File tempDir ;
private Object [ ] components ;
+ private Properties initialProps = new Properties ( ) ;
COMMENT
COMMENT
<nb> public class ServerTester extends ExternalResource {
}
tempDir = createTempDir ( ... | Add ServerTester setProperty |
<nb> public class KotlinLightClassForExplicitDeclaration extends KotlinWrappingLightC
protected PsiFile compute ( ) {
VirtualFile virtualFile = classOrObject . getContainingFile ( ) . getVirtualFile ( ) ;
assert virtualFile != null : STRING0 + classOrObject . getText ( ) ;
- return new ClsFileImpl ( ( PsiManage... | Fix deprecated warning |
<nb> public class MockingRealObjectsTest extends TestBase {
}
@ test
+ public void shouldStubWithDoReturnAndVerify ( ) {
+ doReturn ( STRING0 )
+ . doReturn ( STRING1 )
+ . when ( spy ) . get ( NUMBER0 ) ;
+
+ assertEquals ( STRING0 , spy . get ( NUMBER0 ) ) ;
+ assertEquals ( STRING1 , spy . get ( ... | added a test for doReturn for spies |
<nb> public class CacheBuilder {
setDefaultImplementations ( ) ;
Cache cache = newBaseCacheInstance ( implementation , id ) ;
setCacheProperties ( cache ) ;
- SINGLE
- if ( cache . getClass ( ) . getName ( ) . startsWith ( STRING0 ) ) {
+ if ( PerpetualCache . class . equals ( cache . getClass ( ) ) ) { SIN... | Check the class object not its name |
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> public class IndexStore
private Integer tryToReadVersion ( ReadableByteChannel channel ) throws IOException
{
byte [ ] array = IoPrimi... | Fixed a problem upgrading from old store format |
<nb> public class NoopSearchRequestBuilder extends ActionRequestBuilder < SearchRequest
}
COMMENT
- COMMENT
- COMMENT
- public NoopSearchRequestBuilder setNoStoredFields ( ) {
- sourceBuilder ( ) . noStoredFields ( ) ;
- return this ;
- }
-
- COMMENT
COMMENT
COMMENT
public NoopSearchRequestB... | Remove obsolete NoopSearchRequestBuilder setNoStoredFields |
<nb> public class OperationSetMessageWaitingSipImpl
= Logger . getLogger ( OperationSetMessageWaitingSipImpl . class ) ;
COMMENT
- COMMENT
+ COMMENT
COMMENT
private final ProtocolProviderServiceSipImpl provider ;
<nb> public class OperationSetMessageWaitingSipImpl
. getAddressOfRecord ( ) ;
else
... | Fix exception with registrarless SIP account |
<nb> public abstract class CompletionConfidence {
COMMENT
COMMENT
@ notnull
- public abstract ThreeState shouldFocusLookup ( @ notnull CompletionParameters parameters ) ;
+ public ThreeState shouldFocusLookup ( @ notnull CompletionParameters parameters ) {
+ return ThreeState . UNSURE ;
+ }
COMMENT
... | don t force API users to implement unused method |
<nb> public class TreeVisitorCacheExpirationStrategy implements Stoppable {
}
}
cumulatedInputsAndOutputs . addAll ( inputPaths ) ;
- } else if ( ! task . getInputs ( ) . getHasInputs ( ) ) {
+ } else if ( ! task . getInputs ( ) . getHasInputs ( ) && ! task . getActions ( ) . isEmpty ( ) ) {
tasksWithUnknow... | Consider inputs outputs unknown only when the task contains actions |
<nb> public class ProxyPeerAddressHandler implements HttpHandler {
if ( index == - NUMBER0 ) {
value = forwardedFor ;
} else {
- value = forwardedFor . substring ( NUMBER1 , index - NUMBER0 ) ;
+ value = forwardedFor . substring ( NUMBER1 , index ) ;
}
InetAddress address = InetAddress . getByName ( value... | Fixing substring index in ProxyPeerAddress Handler |
<nb> public class Getopt {
options = new ArrayList < Option > ( ) ;
current = - NUMBER0 ;
optind = - NUMBER0 ;
- this . argv = argv ;
+ this . argv = new String [ argv . length ] ;
+ System . arraycopy ( argv , NUMBER1 , this . argv , NUMBER1 , argv . length ) ;
this . opts = opts ;
} | Don t store externally mutable object in Getopt argv findbugs |
<nb> public class VectorScalarProductTest {
vectorScalarProduct . calculateScalarProduct ( v1 , v2 ) ;
}
+ @ test ( expected = IllegalArgumentException . class ) public void nullVectorsShouldThrowException ( ) {
+ Vector v1 = new Vector ( NUMBER0 , NUMBER1 , NUMBER2 , NUMBER3 ) ;
+
+ vectorScalarProduct .... | Add a new test case and fix one test checking if the algorithm is working with negative numbers |
<nb>
SINGLE
SINGLE
SINGLE
+ SINGLE
package NAMESPACE ;
<nb> public class Session {
SINGLE
+ if ( View . isInitialised ( ) ) {
+ SINGLE
+ View . getSingleton ( ) . getSiteTreePanel ( ) . getTreeSite ( ) . setModel ( new SiteMap ( null , null ) ) ;
+ }
+
if ( ! Constant . isLowMemoryOpti... | Detach Sites tree model when loading the session |
<nb> public abstract class AbstractXmlBlock extends AbstractBlock {
}
- protected static WrapType getWrapType ( final int type ) {
+ public static WrapType getWrapType ( final int type ) {
if ( type == CodeStyleSettings . DO_NOT_WRAP ) return WrapType . NONE ;
if ( type == CodeStyleSettings . WRAP_ALWAYS ... | Fixed Django formatting inside attributes wrapping and formatting of whitespaces |
<nb> public class LoadTestsAutoTest extends ActivityInstrumentationTestCase2 < TestShel
final VMRuntime runtime = VMRuntime . getRuntime ( ) ;
runtime . gcSoftReferences ( ) ;
- runtime . runFinalizationSync ( ) ;
runtime . gcSoftReferences ( ) ;
- runtime . runFinalizationSync ( ) ;
runtime . gcSoftRefer... | remove runFinalizationSync calls |
<nb> import NAMESPACE ;
COMMENT
COMMENT
- COMMENT
- COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
COMMENT
- COMMENT
- COMMENT
- COMMENT
- COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
COMMENT
- COMMENT
- COMMENT
+ COMMENT
+ COMMENT
COMMENT
- COMMENT
- COMMENT
- ... | Added more code examples in the dependency substitution DSL and ensure they are auto tested |
<nb> public class ResolverDrawerLayout extends ViewGroup {
}
}
+ final int oldCollapsibleHeight = mCollapsibleHeight ;
mCollapsibleHeight = Math . max ( NUMBER0 ,
heightUsed - alwaysShowHeight - getMaxCollapsedHeight ( ) ) ;
mUncollapsibleHeight = heightUsed - mCollapsibleHeight ;
if ( isLaidOut ( ) )... | Preserve ResolverDrawerLayout fully collapsed state across relayout |
<nb> public abstract class AuthenticationException extends AcegiSecurityException {
SINGLE
- public void setAuthentication ( Authentication authentication ) {
+ void setAuthentication ( Authentication authentication ) {
this . authentication = authentication ;
} | Reduce setAuthentication scope now that it should only be called by AbstractAuthenticationManager |
<nb> public class NodeTaskMap
{
if ( remoteTasks . add ( task ) ) {
task . addStateChangeListener ( taskInfo - > {
- if ( task . getTaskInfo ( ) . getState ( ) . isDone ( ) ) {
+ if ( taskInfo . getState ( ) . isDone ( ) ) {
remoteTasks . remove ( task ) ;
}
} ) ; | Use new state parameter instead of looking up state |
<nb> class ASTAssign extends AST {
Frame ary = env . frId ( id . _depth , id . _num ) ;
SINGLE
Frame ary_rhs = null ; double d = Double . NaN ;
- if ( env . isDbl ( ) ) d = env . popDbl ( ) ; else ary_rhs = env . popAry ( ) ;
+ if ( env . isDbl ( ) )
+ d = env . popDbl ( ) ;
+ else
+ ary_rhs = env . pop... | Tweak formatting of a couple of places to enable breakpoints |
<nb> import NAMESPACE ;
COMMENT
COMMENT
COMMENT
- COMMENT
+ COMMENT
COMMENT
COMMENT
final class HierarchicalUriComponents extends UriComponents {
<nb> final class HierarchicalUriComponents extends UriComponents {
if ( this == obj ) {
return true ;
}
- if ( ! ( obj instanceof OpaqueUriComponent... | Fixed HierarchicalUriComponents equals implementation |
<nb> public class DirectoryManager {
COMMENT
COMMENT
COMMENT
- protected static boolean testFileExists ( String name ) {
+ public static boolean testFileExists ( String name ) {
boolean status ;
SINGLE
<nb> public class DirectoryManager {
COMMENT
COMMENT
COMMENT
- protected static long getFree... | Made some functions in DirectoryManager public |
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> public class UpsertTest {
@ parameterized.parameters ( name = STRING0 )
public static Collection < Platform > data ( ) {
return Arrays... | Fix upsert tests on CI |
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
+ import NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
- import NAMESPACE ;
import NAMESPACE ;
- import NA... | Might improve static files performance a tiny bit |
<nb> public class EventBus {
}
private synchronized void register ( Object subscriber , boolean sticky , int priority ) {
- List < SubscriberMethod > subscriberMethods = subscriberMethodFinder . findSubscriberMethods ( subscriber . getClass ( ) ) ;
+ Class < ? > subscriberClass = subscriber . getClass ( ) ;
... | We cannot get Subscribe annotations from anonymous classes so fail fast |
<nb> public abstract class BaseWriteOperation implements AsyncWriteOperation < WriteRes
protected abstract WriteRequest . Type getType ( ) ;
- protected abstract int getCount ( final BulkWriteResult bulkWriteResult ) ;
+ protected abstract int getCount ( BulkWriteResult bulkWriteResult ) ;
protected boole... | Remove unnecessary final keyword |
<nb> public class StructuralReplaceTest extends IdeaTestCase {
}
public void testReplace ( ) {
- if ( ! IdeaTestUtil . bombExplodes ( NUMBER0 , Calendar . MARCH , NUMBER1 , NUMBER2 , NUMBER3 , STRING0 , STRING1 ) ) return ;
String str = STRING2 +
STRING3 +
STRING4 + | Inline included jsp refactoring |
<nb>
package NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> public class ChangeType {
highlighter . setLineSeparatorPlacement ( SeparatorPlacement . TOP ) ;
highlighter . setLineSeparatorColor ( separatorColor ) ;
highlighter . set... | merge Don t draw these weird horizontal lines at the gutter |
<nb> import NAMESPACE ;
COMMENT
# import " NAMESPACE / lang / Throwable . h STRING0 . level = SEVERE \ nhandlers = java . util . logging . IOSLogHandler \ n STRING1 IOSLogHandler - aslclient STRING2 % s STRING3 % s " , [ logMessage UTF8String ] ) ;
] - * / ;
+
+ public static native String getDefaultPropertie... | Define aslclient to support multi threaded logging correctly |
<nb> public class TransitToStreetNetworkGraphBuilderImpl implements GraphBuilder {
}
public List < String > getPrerequisites ( ) {
- return Arrays . asList ( STRING0 , STRING1 ) ;
+ return Arrays . asList ( STRING0 ) ;
}
@ override | remove linker transit prerequisite |
<nb>
package NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> import NAMESPACE ;
COMMENT
COMMENT
COMMENT
- @ threadsafe
public final class HdfsUnderFileSystemFactory implements UnderFileSystemFactory {
COMMENT
COMMENT | Fixing the build |
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
- public abstract class PsiElementBase extends ElementBase implements PsiElement {
+ public abstract class PsiElementBase extends ElementBase implements NavigatablePsiElement {
private static final Logger LOG = Logger . getInstance ( STRING0 ) ; ... | PsiElementBase implements NavigatablePsiElement |
<nb> public class JSONUtil {
AppLog . e ( T . UTILS , STRING0 + defaultObject . getClass ( ) . getName ( ) , e ) ;
return defaultObject ;
} catch ( JSONException e ) {
- AppLog . e ( T . UTILS , STRING1 + query , e ) ;
return defaultObject ;
}
}
<nb> public class JSONUtil {
AppLog . e ( T . UTILS , ST... | Removed aggressive JSONUtil logging |
<nb> public class GCalControlSet extends PopupControlSet {
calendar . setText ( R . string . gcal_TEA_none_selected ) ;
}
} else {
- int index = calendars . defaultIndex + NUMBER0 ;
+ int index = calendars . defaultIndex ;
if ( ! TextUtils . isEmpty ( model . getValue ( Task . CALENDAR_URI ) ) ) {
calenda... | Fixed a display bug where the wrong default calendar would be displayed |
<nb>
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
package NAMESPACE ;
import NAMESPACE ; | Adding license header for TimeRetentionStrategyTest |
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> public class MoviesWatchListFragment extends SherlockFragment implements
public void onCreateContextMenu ( ContextMenu menu , View v , Con... | Don t show watchlist menu if not connected to trakt |
<nb>
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+
package NAMESPACE ;
import NAMESPACE ; | Make checkstyle happy by adding the missing license header |
<nb> public class UnscrambleDialog extends DialogWrapper {
inAuxInfo = true ;
}
if ( inAuxInfo ) {
- builder . append ( line ) . append ( STRING0 ) ;
+ builder . append ( line . trim ( ) ) . append ( STRING0 ) ;
continue ;
}
if ( ! first && mustHaveNewLineBefore ( line ) ) {
<nb> public class Unscramb... | trim trailing spaces for wrapped lines to overcome wrapping done by Mac s Mail program |
<nb> public interface MethodLookupEngine {
MethodLookupEngine make ( ClassFileVersion classFileVersion ) ;
}
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
static interface Finding {
TypeDescription getLookedUpType ( ) ; | Added missing javadoc |
<nb> import NAMESPACE
public class IntegerIntegerStringReturner implements IntegerStringReturner {
public String getIntegerReturnString ( int theInteger ) {
- final Integer myInteger = new Integer ( theInteger ) ;
- final StringBuilder myStringBuilder = new StringBuilder ( myInteger . toString ( ) ) ;
- fin... | Improve temporaries naming |
<nb> public class TieredBlockStore implements BlockStore {
try {
BlockMeta blockMeta = mMetaManager . getBlockMeta ( blockId ) ;
BlockStoreLocation oldLocation = blockMeta . getBlockLocation ( ) ;
+ SINGLE
freeSpaceInternal ( userId , blockMeta . getBlockSize ( ) , newLocation ) ;
moveBlockNoLock ( blockId ... | Move moveBlock before really moving data |
<nb> import NAMESPACE ;
COMMENT
COMMENT
COMMENT
+ COMMENT
COMMENT
public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport { | Add getBytes to InputStream URL and File patch thanks to jeremi Joslin |
<nb> public class RoutePointsPlugin extends OsmandPlugin {
private OsmandApplication app ;
private TextInfoWidget routeStepsControl ;
private SelectedRouteGpxFile currentRoute ;
- MapActivity map ;
private View deliveredView ;
private MapActivity mapActivity ;
<nb> public class RoutePointsPlugin extends... | Removed unused variable |
<nb> package NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
- public abstract class ASeq extends Obj implements ISeq , Collection {
+ public abstract class ASeq extends Obj implements ISeq , Collection , Sequential {
transient int _hash = - NUMBER0 ; | Made ASeq Sequential |
<nb> public class PeerGroup {
SINGLE
SINGLE
if ( maxConnections == NUMBER0 ) {
+ synchronized ( PeerGroup . this ) {
+ for ( Wallet wallet : wallets ) {
+ try {
+ wallet . receivePending ( pinnedTx ) ;
+ } catch ( Throwable t ) {
+ future . setException ( t ) ;
+ return ;
+ }
+ }
+ }
future ... | Also inform the wallet in the single peer case in broadcastTransaction |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.