diff
stringlengths
38
1.78k
msg_token
stringlengths
9
190
<nb> + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + package NAMESPACE ; import NAMESPACE ; <nb> + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + package NAMESPACE ; import NAMESPACE ;
added license header to CoffeeShopService and PetShopService
<nb> public class WsSession implements Session { state = State . CLOSING ; - fireEndpointOnClose ( closeReasonLocal ) ; sendCloseMessage ( closeReasonMessage ) ; + fireEndpointOnClose ( closeReasonLocal ) ; state = State . CLOSED ; } <nb> public class WsSession implements Session { synchronized ( stateLock ) { if ( state == State . OPEN ) { - fireEndpointOnClose ( closeReason ) ; sendCloseMessage ( closeReason ) ; + fireEndpointOnClose ( closeReason ) ; state = State . CLOSED ; }
Call onClose before actually closing anything sending a close message closes the endpoint
<nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; <nb> import NAMESPACE ; import static NAMESPACE ; import static NAMESPACE ; import static NAMESPACE ; - import static NAMESPACE ; import static NAMESPACE ; public class DefaultDeployer implements Deployer { <nb> public class DefaultDeployer implements Deployer { . filter ( containsPattern ( hostFilter ) ) . toList ( ) ; + log . info ( STRING0 , + hostFilter , filteredHosts ) ; + if ( filteredHosts . isEmpty ( ) ) { fail ( format ( STRING1 , hostFilter ) ) ; } final String chosenHost = pickHost ( filteredHosts ) ; - return deploy ( job , asList ( chosenHost ) , waitPorts , prober , reportWriter ) ; + return deploy ( job , Collections . singletonList ( chosenHost ) , waitPorts , prober , reportWriter ) ; } @ visiblefortesting
Log host filter in temp jobs
<nb> public class Fillr extends JavaPlugin { public void onEnable ( ) { } + public void onLoad ( ) { + } + @ override public boolean onCommand ( CommandSender sender , Command cmd , String commandLabel , String [ ] args ) { if ( commandLabel . equalsIgnoreCase ( STRING0 ) ) { <nb> public interface Plugin extends CommandExecutor { public void onDisable ( ) ; COMMENT + COMMENT + COMMENT + COMMENT + public void onLoad ( ) ; + + COMMENT COMMENT COMMENT public void onEnable ( ) ;
Adds an onLoad method to Plugin
<nb> public class AsyncContextImpl implements AsyncContext { try { InstanceFactory < T > factory = ( ( ServletContextImpl ) this . servletRequest . getServletContext ( ) ) . getDeployment ( ) . getDeploymentInfo ( ) . getClassIntrospecter ( ) . createInstanceFactory ( clazz ) ; return factory . createInstance ( ) . getInstance ( ) ; - } catch ( NoSuchMethodException e ) { - throw new ServletException ( e ) ; - } catch ( InstantiationException e ) { + } catch ( Exception e ) { throw new ServletException ( e ) ; } }
Correctly wrap exceptions
<nb> public abstract class PerRequestRelative302Test extends AbstractBasicTest { assertNotNull ( response ) ; assertEquals ( response . getStatusCode ( ) , NUMBER0 ) ; - assertEquals ( getBaseUrl ( response . getUri ( ) ) , STRING0 ) ; + assertEquals ( getBaseUrl ( response . getUri ( ) ) , STRING1 ) ; c . close ( ) ; }
Fix the test based on provided patch
<nb> public class AppWidget extends AppWidgetProvider { } @ override - public void onCreate ( ) { - super . onCreate ( ) ; - } - - @ override public void onHandleIntent ( Intent intent ) { ComponentName me = new ComponentName ( this , AppWidget . class ) ; AppWidgetManager mgr = AppWidgetManager . getInstance ( this ) ;
Removed empty method
<nb> package NAMESPACE ; - import NAMESPACE ; - import NAMESPACE ; COMMENT COMMENT COMMENT
Remove unused imports
<nb> public class MessageManager } catch ( IllegalArgumentException e ) { + final String error = e . getMessage ( ) ; final String help = cmd . help ( ) ; - throw new BadCommandInvocationException ( msg , help , e ) ; + throw new BadCommandInvocationException ( msg , error + STRING0 + help , + e ) ; } catch ( RuntimeException e ) {
Display error first then help text in system message feedback
<nb> public class PluginClassloaders { } return realm ; } catch ( Throwable e ) { + SINGLE + SINGLE + SINGLE + SINGLE throw new SonarException ( STRING0 + plugin . getKey ( ) , e ) ; } } <nb> public class PluginClassloaders { } return true ; } catch ( Throwable e ) { + SINGLE + SINGLE + SINGLE + SINGLE throw new SonarException ( STRING1 + plugin . getBasePlugin ( ) + STRING2 + plugin . getKey ( ) , e ) ; } } <nb> public class PluginClassloaders { return ( Plugin ) claz . newInstance ( ) ; } catch ( Throwable e ) { - SINGLE - SINGLE + SINGLE + SINGLE + SINGLE + SINGLE throw new SonarException ( STRING3 + metadata . getKey ( ) , e ) ; } }
Add some comments
<nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; - import static NAMESPACE ; + import static NAMESPACE ; + import static NAMESPACE ; + import static NAMESPACE ; + import static NAMESPACE ; + import static NAMESPACE ; COMMENT COMMENT <nb> public abstract class MigrationTestCase { } flyway . setIgnoreFailedFutureMigration ( true ) ; - if ( getDbSupport ( new JdbcTemplate ( migrationDataSource ) ) . supportsDdlTransactions ( ) ) { + try { flyway . migrate ( ) ; - } else { - try { - flyway . migrate ( ) ; - fail ( ) ; - } catch ( IllegalStateException e ) { - SINGLE - } + fail ( ) ; + } catch ( IllegalStateException e ) { + SINGLE } }
Fixed testcase for postgresql
<nb> public class Observable < T > { } COMMENT - COMMENT + COMMENT COMMENT public interface OnSubscribe < T > extends Action1 < Subscriber < ? super T > > { SINGLE
Fix typo in OnSubscribe interface s Javadoc
<nb> public class BiggerThanLogTxIT { for ( GraphDatabaseService db : cluster . getAllMembers ( ) ) { + SINGLE + if ( expectedNodeCount != nodeCount ( db ) ) + { + for ( int i = NUMBER0 ; i < NUMBER1 ; i ++ ) + { + try + { + Thread . sleep ( NUMBER2 ) ; + } + catch ( InterruptedException e ) + { + throw new RuntimeException ( e ) ; + } + + int count = nodeCount ( db ) ; + if ( expectedNodeCount == count ) + break ; + + try + { + cluster . sync ( ) ; + } + catch ( InterruptedException e ) + { + throw new RuntimeException ( e ) ; + } + } + } + assertEquals ( expectedNodeCount , nodeCount ( db ) ) ; } }
Make test more resilient by retrying sync on wrong node count
<nb> public class ASMHelper { COMMENT COMMENT public static AnnotationNode getAnnotation ( List < AnnotationNode > annotations , String annotationType ) { - if ( annotations == null ) return null ; + if ( annotations == null ) { + return null ; + } for ( AnnotationNode annotation : annotations ) { if ( annotationType . equals ( annotation . desc ) ) { <nb> public class ASMHelper { SINGLE for ( Object value : annotation . values ) { - if ( getNextValue ) - return ( T ) value ; - if ( value . equals ( key ) ) - getNextValue = true ; + if ( getNextValue ) { + return ( T ) value ; + } + if ( value . equals ( key ) ) { + getNextValue = true ; + } } return null ;
Fix checkstyle on ASMHelper java
<nb> class LintPassConfig extends PassConfig . PassConfigDelegate { new CheckJSDoc ( compiler ) , new CheckMissingSemicolon ( compiler ) , new CheckRequiresAndProvidesSorted ( compiler ) , - new CheckUselessBlocks ( compiler ) ) ) ; + new CheckUselessBlocks ( compiler ) , + new ClosureCheckModule ( compiler ) ) ) ; } } ;
Add the goog module per file checks to the linter
<nb> final class DeepLinkUri { } Builder scheme ( String scheme ) { - if ( scheme == null ) { - throw new IllegalArgumentException ( STRING0 ) ; - } + if ( scheme == null ) throw new IllegalArgumentException ( STRING0 ) ; + this . scheme = scheme ; return this ; }
Fixed scheme setter in DeepLinkUri Builder
<nb> public class PreferenceGroupAdapter extends RecyclerView . Adapter < PreferenceViewH private int widgetResId ; private String name ; + public PreferenceLayout ( ) { } + + public PreferenceLayout ( PreferenceLayout other ) { + resId = other . resId ; + widgetResId = other . widgetResId ; + name = other . name ; + } + @ override public boolean equals ( Object o ) { if ( ! ( o instanceof PreferenceLayout ) ) { <nb> public class PreferenceGroupAdapter extends RecyclerView . Adapter < PreferenceViewH mTempPreferenceLayout = createPreferenceLayout ( preference , mTempPreferenceLayout ) ; - return mPreferenceLayouts . indexOf ( mTempPreferenceLayout ) ; + int viewType = mPreferenceLayouts . indexOf ( mTempPreferenceLayout ) ; + if ( viewType != - NUMBER0 ) { + return viewType ; + } else { + viewType = mPreferenceLayouts . size ( ) ; + mPreferenceLayouts . add ( new PreferenceLayout ( mTempPreferenceLayout ) ) ; + return viewType ; + } } @ override
Add missing PreferenceLayouts when querying item type
<nb> public class FrameworkDetectionManager extends AbstractProjectComponent implemen @ override public void initComponent ( ) { + doInitialize ( ) ; + } + + public void doInitialize ( ) { if ( myProject . isDefault ( ) ) return ; myDetectionQueue = new MergingUpdateQueue ( STRING0 , NUMBER0 , true , null , myProject ) ; if ( ApplicationManager . getApplication ( ) . isUnitTestMode ( ) ) { <nb> public class FrameworkDetectionManager extends AbstractProjectComponent implemen @ override public void disposeComponent ( ) { + doDispose ( ) ; + } + + public void doDispose ( ) { if ( myDetectedFrameworksData != null ) { myDetectedFrameworksData . saveDetected ( ) ; }
enable framework detection in detection tests only
<nb> public class MediaConductor extends Agent hasDoneWork |= subscribedSessions . forEach ( NUMBER0 , SubscribedSession : : scanForGaps ) ; hasDoneWork |= processClientCommandBuffer ( ) ; - hasDoneWork |= mediaCommandBuffer ( ) ; + hasDoneWork |= processMediaCommandBuffer ( ) ; hasDoneWork |= processTimers ( ) ; return hasDoneWork ; <nb> public class MediaConductor extends Agent return nioSelector ; } - private boolean mediaCommandBuffer ( ) + private boolean processMediaCommandBuffer ( ) { final int messagesRead = mediaCommandBuffer . read ( ( msgTypeId , buffer , index , length ) - >
put back process into command buffer method name
<nb> public final class ActivityStackSupervisor implements DisplayListener { } void showLockTaskToast ( ) { - mLockTaskNotify . showToast ( mLockTaskModeState ) ; + if ( mLockTaskNotify != null ) { + mLockTaskNotify . showToast ( mLockTaskModeState ) ; + } } void showLockTaskEscapeMessageLocked ( TaskRecord task ) {
Add null check in showLockTaskToast
<nb> package NAMESPACE ; public class IntegrationTestConstants { SINGLE public static final String NETTY_DATA_SERVER = STRING0 ; - public static final String NIO_DATA_SERVER = STRING1 ; SINGLE public static final String NETTY_BLOCK_READER = STRING2 ; <nb> public class RemoteBlockInStreamIntegrationTest { list . add ( new Object [ ] { IntegrationTestConstants . NETTY_DATA_SERVER , IntegrationTestConstants . FILE_CHANNEL_TRANSFER , IntegrationTestConstants . NETTY_BLOCK_READER } ) ; - SINGLE - list . add ( new Object [ ] { IntegrationTestConstants . NIO_DATA_SERVER , - IntegrationTestConstants . UNUSED_TRANSFER , IntegrationTestConstants . NETTY_BLOCK_READER } ) ; return list ; } <nb> public class DataServerIntegrationTest { list . add ( new Object [ ] { IntegrationTestConstants . NETTY_DATA_SERVER , IntegrationTestConstants . FILE_CHANNEL_TRANSFER , IntegrationTestConstants . NETTY_BLOCK_READER } ) ; - SINGLE - list . add ( new Object [ ] { IntegrationTestConstants . NIO_DATA_SERVER , - IntegrationTestConstants . UNUSED_TRANSFER , IntegrationTestConstants . NETTY_BLOCK_READER } ) ; return list ; }
Remove NIODataServer tests
<nb> public class OpenPgpSignatureResult implements Parcelable { vr . signatureOnly = source . readByte ( ) == NUMBER0 ; vr . primaryUserId = source . readString ( ) ; vr . keyId = source . readLong ( ) ; + vr . userIds = new ArrayList < String > ( ) ; source . readStringList ( vr . userIds ) ; SINGLE
Fix nullpointer with new OpenPgpSignatureResult version
<nb> public class RxLifecycle { COMMENT COMMENT COMMENT - COMMENT - COMMENT - COMMENT COMMENT COMMENT COMMENT <nb> public class RxLifecycle { COMMENT COMMENT COMMENT - COMMENT - COMMENT - COMMENT COMMENT COMMENT COMMENT <nb> public class RxLifecycle { COMMENT COMMENT COMMENT - COMMENT - COMMENT - COMMENT COMMENT COMMENT COMMENT <nb> public class RxLifecycle { COMMENT COMMENT COMMENT - COMMENT - COMMENT - COMMENT COMMENT COMMENT COMMENT
Removed unnecessary warnings from docs
<nb> package NAMESPACE ; + import NAMESPACE ; + import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; <nb> public final class DataFlow { public static < A extends AbstractValue < A > , S extends Store < S > , T extends TransferFunction < A , S > > Result < A , S , T > dataflow ( MethodTree method , TreePath path , Context context , T transfer ) { + Preconditions . checkNotNull ( method . getBody ( ) , + STRING0 , + method . getName ( ) , + path . getCompilationUnit ( ) . getSourceFile ( ) . getName ( ) ) ; + CompilationUnitTree root = path . getCompilationUnit ( ) ; ProcessingEnvironment env = JavacProcessingEnvironment . instance ( context ) ; ClassTree classTree = null ;
Add error handling to ease debugging NPEs when trying to analyze a method with
<nb> public class TextDataBuilderImpl implements TextDataFactory { if ( val instanceof DynamicType ) { DynamicType dynamicType = ( DynamicType ) val ; if ( timeInterval != null ) { - str += dynamicType . getValue ( timeInterval . getLow ( ) , timeInterval . getHigh ( ) ) ; + str += dynamicType . getValue ( timeInterval . getLow ( ) , timeInterval . getHigh ( ) , Estimator . LAST ) ; } else { str += dynamicType . getValue ( Estimator . AVERAGE ) ; }
Add Estimator to dynamic visualization of attributes
<nb> public abstract class AbstractApplicationContext extends DefaultResourceLoader } public void addApplicationListener ( ApplicationListener listener ) { - if ( isActive ( ) ) { - addListener ( listener ) ; + if ( this . applicationEventMulticaster != null ) { + this . applicationEventMulticaster . addApplicationListener ( listener ) ; } else { this . applicationListeners . add ( listener ) ; <nb> public abstract class AbstractApplicationContext extends DefaultResourceLoader COMMENT COMMENT COMMENT + COMMENT + COMMENT + COMMENT COMMENT + COMMENT COMMENT + @ deprecated protected void addListener ( ApplicationListener listener ) { getApplicationEventMulticaster ( ) . addApplicationListener ( listener ) ; }
refined addApplicationListener to work any time during the refresh phase
<nb> COMMENT package NAMESPACE ; - import NAMESPACE ; - import NAMESPACE ; - import NAMESPACE ; - import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; <nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; + import NAMESPACE ; + import NAMESPACE ; + public class OMetadataDefault implements OMetadata { public static final String CLUSTER_INTERNAL_NAME = STRING0 ; public static final String CLUSTER_INDEX_NAME = STRING1 ; <nb> public class OMetadataDefault implements OMetadata { if ( schema != null ) schema . reload ( ) ; if ( indexManager != null ) - indexManager . load ( ) ; + indexManager . reload ( ) ; if ( security != null ) security . load ( ) ; if ( functionLibrary != null )
fixed bug on metadata reload
<nb> public class MainActivity extends AppCompatActivity { . progressBarColorRes ( R . color . finestWhite ) . webViewBuiltInZoomControls ( true ) . webViewDisplayZoomControls ( true ) + . swipeRefreshColorRes ( R . color . redNavBar ) . dividerHeight ( NUMBER0 ) . gradientDivider ( false ) . setCustomAnimations ( R . anim . activity_open_enter , R . anim . activity_open_exit , R . anim . activity_close_enter , R . anim . activity_close_exit ) <nb> public class MainActivity extends AppCompatActivity { . iconDefaultColorRes ( R . color . finestWhite ) . iconSelector ( R . drawable . selector_white ) . progressBarColorRes ( R . color . finestWhite ) + . swipeRefreshColorRes ( R . color . blackNavBar ) . dividerHeight ( NUMBER0 ) . gradientDivider ( false ) SINGLE
Updated sample app swipe refresh idicator colors
<nb> final class VEventResultParser extends ResultParser { return null ; } int vEventStart = rawText . indexOf ( STRING0 ) ; + if ( vEventStart < NUMBER0 ) { + return null ; + } int vEventEnd = rawText . indexOf ( STRING1 ) ; - if ( vEventStart < NUMBER0 || vEventEnd < NUMBER0 ) { + if ( vEventEnd < NUMBER0 ) { return null ; } - rawText = rawText . substring ( vEventStart + NUMBER1 , vEventEnd ) ; SINGLE String summary = VCardResultParser . matchSingleVCardPrefixedField ( STRING2 , rawText , true ) ; String start = VCardResultParser . matchSingleVCardPrefixedField ( STRING3 , rawText , true ) ;
Made calendar event parsing more robust and also reject non calendar contents a little faster
<nb> public class PhilmMovie implements PhilmModel { Images images = movie . images ; if ( images != null ) { - if ( TextUtils . isEmpty ( fanartUrl ) ) { + SINGLE + if ( fanartType != TYPE_TMDB && ! TextUtils . isEmpty ( images . fanart ) ) { fanartUrl = images . fanart ; fanartType = TYPE_TRAKT ; } - if ( TextUtils . isEmpty ( posterUrl ) ) { + if ( posterType != TYPE_TMDB && ! TextUtils . isEmpty ( images . poster ) ) { posterUrl = images . poster ; posterType = TYPE_TRAKT ; }
Don t overwrite TMDB images with trakt ones
<nb> public final class GenericBooleanPrefDataModel extends AbstractDataModel { } result . append ( userIDs [ i ] ) ; } - if ( result . length ( ) > NUMBER0 ) { + if ( userIDs . length > NUMBER0 ) { result . append ( STRING0 ) ; } result . append ( STRING1 ) ; <nb> public final class GenericDataModel extends AbstractDataModel { } result . append ( userIDs [ i ] ) ; } - if ( result . length ( ) > NUMBER0 ) { + if ( userIDs . length > NUMBER0 ) { result . append ( STRING0 ) ; } result . append ( STRING1 ) ;
Fix dumb typo in model s toString
<nb> public class PrepareCatalogMojo extends AbstractMojo { component = STRING0 ; } String name = component + STRING1 ; - if ( ! docs . contains ( name ) ) { + if ( ! docs . contains ( name ) && ( ! component . equalsIgnoreCase ( STRING2 ) && ! component . equalsIgnoreCase ( STRING3 ) ) ) { missing . add ( name ) ; } }
Skip Validation for camel linkedin and camel salesforce since they have API and component in the same component folder
<nb> abstract class RequestArcAction extends FeatureAction { return ; } disableArcTransmission ( ) ; + finish ( ) ; } }
Add finish after timeout of Reqeust Arc operations
<nb> public interface Blueprint { COMMENT COMMENT COMMENT - COMMENT + COMMENT COMMENT String getMortarScopeName ( ) ; <nb> public interface Bundler extends Scoped { COMMENT COMMENT COMMENT - COMMENT - COMMENT + COMMENT COMMENT COMMENT COMMENT <nb> public interface Bundler extends Scoped { COMMENT COMMENT - COMMENT + COMMENT COMMENT COMMENT COMMENT <nb> import NAMESPACE ; COMMENT public interface MortarActivityScope extends MortarScope { COMMENT - COMMENT + COMMENT COMMENT COMMENT COMMENT <nb> public interface MortarScope { ObjectGraph getObjectGraph ( ) ; COMMENT - COMMENT - COMMENT + COMMENT COMMENT COMMENT COMMENT <nb> public interface MortarScope { MortarScope requireChild ( Blueprint blueprint ) ; COMMENT - COMMENT + COMMENT COMMENT COMMENT COMMENT
Fix javadoc typos
<nb> public final class SchemaMetadata extends Iced { if ( ( schema instanceof FieldMetadataV3 || schema instanceof FieldMetadataBase ) && STRING0 . equals ( field_name ) ) return STRING1 ; - if ( ( schema instanceof TwoDimTableV3 && STRING2 . equals ( field_name ) ) ) SINGLE + if ( ( ( schema instanceof TwoDimTableBase || schema instanceof TwoDimTableV3 ) && STRING2 . equals ( field_name ) ) ) SINGLE return STRING1 ; Log . warn ( STRING3 + clz . toString ( ) + STRING4 + schema . getClass ( ) + STRING5 + field_name ) ;
Fix schema warning on startup
<nb> public class BufferedRandomAccessFile extends RandomAccessFile implements FileDa throw new IllegalArgumentException ( STRING0 ) ; if ( isReadOnly ( ) && newPosition > fileLength ) - throw new EOFException ( STRING1 ) ; + throw new EOFException ( STRING2 + filePath + STRING3 ) ; current = newPosition ;
add file path to seek past eof exception
<nb> public class VerboseMockitoJUnitRunner extends Runner { Throwable throwable = ( Throwable ) Whitebox . getInternalState ( failure , STRING0 ) ; String newMessage = throwable . getMessage ( ) ; - newMessage += STRING1 + debuggingInfo . getWarnings ( ) ; + newMessage += STRING1 + debuggingInfo . getWarnings ( ) + STRING2 ; Whitebox . setInternalState ( throwable , STRING3 , newMessage ) ; }
In order to have nicer failure message adjusted the message
<nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; + import NAMESPACE ; + COMMENT COMMENT COMMENT <nb> import NAMESPACE ; @ suppresswarnings ( STRING0 ) public class DeprecatedLzoTextInputFormat extends DeprecatedLzoInputFormat < LongWritable , Text > { + private static final Logger LOG = LoggerFactory . getLogger ( DeprecatedLzoInputFormat . class ) ; @ override public RecordReader < LongWritable , Text > getRecordReader ( InputSplit split , JobConf conf , Reporter reporter ) throws IOException { reporter . setStatus ( split . toString ( ) ) ; + LOG . info ( split . toString ( ) ) ; return new DeprecatedLzoLineRecordReader ( conf , ( FileSplit ) split ) ; }
Add logging to DeprecatedLzoTextInputFormat as it starts a new split
<nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; + COMMENT + COMMENT + COMMENT + @ deprecated @ state ( name = STRING0 , storages = @ storage ( file = StoragePathMacros . MODULE_FILE )
vcs Deprecate VcsManagerPerModuleConfiguration
<nb> public class CompletionFieldMapper extends AbstractFieldMapper < String > { + STRING0 + i + STRING1 ) ; } } - - System . out . println ( names . indexName ( ) ) ; return new SuggestField ( names . indexName ( ) , input , this . fieldType , payload , analyzingSuggestLookupProvider ) ; }
remove System out println
<nb> public class TypedHandler implements TypedActionHandler { if ( ! editor . getSelectionModel ( ) . hasBlockSelection ( ) ) { if ( STRING0 == charTyped || STRING1 == charTyped || STRING2 == charTyped ) { - if ( handleRParen ( editor , fileType , charTyped ) ) return ; + if ( StdFileTypes . PLAIN_TEXT != fileType ) { + if ( handleRParen ( editor , fileType , charTyped ) ) return ; + } } else if ( STRING3 == charTyped || STRING4 == charTyped ) { if ( handleQuote ( editor , charTyped , dataContext , file ) ) return ;
no paired brace insertion no overtype in plain text
<nb> public class GithubApiUtil { try { return new JsonParser ( ) . parse ( reader ) ; } - catch ( JsonSyntaxException jse ) { + catch ( JsonParseException jse ) { throw new GithubJsonException ( STRING0 , jse ) ; } finally {
do not throw runtime exception on parse error
<nb> import NAMESPACE ; COMMENT COMMENT COMMENT - COMMENT + COMMENT COMMENT public final class LocalTime extends AbstractPartial <nb> public final class LocalTime COMMENT COMMENT COMMENT - COMMENT + COMMENT COMMENT public static final class Property extends AbstractReadableInstantFieldProperty {
Fixed since tags
<nb> public class PanelBar extends FrameLayout { } } if ( DEBUG ) LOG ( STRING0 , animate , waiting ) ; - if ( ! waiting ) { + if ( ! waiting && mState != STATE_CLOSED ) { SINGLE SINGLE go ( STATE_CLOSED ) ; <nb> public class PhoneStatusBar extends BaseStatusBar { return ; } - SINGLE - SINGLE + SINGLE + mStatusBarView . collapseAllPanels ( COMMENT false ) ; mExpandedVisible = false ; mPile . setLayoutTransitionsEnabled ( false ) ;
Lubricate a sticky notification panel
<nb> public class IdeGlassPaneImpl extends JPanel implements IdeGlassPaneEx , IdeEvent if ( pureMouse1Event && me . getClickCount ( ) <= NUMBER0 && ! me . isPopupTrigger ( ) ) { final Point point = SwingUtilities . convertPoint ( meComponent , me . getPoint ( ) , myRootPane . getContentPane ( ) ) ; - if ( myRootPane . getMenuBar ( ) != null && myRootPane . getMenuBar ( ) . isVisible ( ) ) { - point . y += myRootPane . getMenuBar ( ) . getHeight ( ) ; - } - final Component target = SwingUtilities . getDeepestComponentAt ( myRootPane . getContentPane ( ) . getParent ( ) , point . x , point . y ) ; if ( target instanceof DnDAware ) {
main menu ignores mouse clicks in presentation fullscreen mode
<nb> public class TestContextConfig extends TomcatBaseTest { @ test public void testBug53574 ( ) throws Exception { - Tomcat tomcat = getTomcatInstance ( ) ; - - File appDir = new File ( STRING0 ) ; - tomcat . addWebapp ( null , STRING1 , appDir . getAbsolutePath ( ) ) ; - - tomcat . start ( ) ; - + getTomcatInstanceTestWebapp ( false , true ) ; assertPageContains ( STRING2 , STRING3 ) ; }
Reduce boilerplate code
<nb> public class HintManager implements ApplicationComponent { if ( lookup == null ) { for ( HintInfo info : myHintsStack ) { if ( info . hint instanceof LightweightHint ) { + if ( info . hint . getClass ( ) . isInstance ( hint ) ) continue ; final Rectangle rectangle = info . hint . getBounds ( ) ; - + if ( rectangle != null ) { return getHintPositionRelativeTo ( hint , editor , constraint , rectangle , rectangle , pos ) ; }
do not affect hint position by previous same instance of the same type
<nb> package NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; + COMMENT COMMENT COMMENT <nb> import NAMESPACE ; COMMENT COMMENT COMMENT - public interface CoreMap extends TypesafeMap , PrettyLoggable { } + public interface CoreMap extends TypesafeMap , PrettyLoggable , Serializable { }
adding sentence gloss recovering codes
<nb> package NAMESPACE ; import NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; import NAMESPACE ; COMMENT <nb> import NAMESPACE ; public class SafeEncoder { public static byte [ ] encode ( final String str ) { try { + if ( str == null ) { + throw new JedisDataException ( + STRING0 ) ; + } return str . getBytes ( Protocol . CHARSET ) ; } catch ( UnsupportedEncodingException e ) { throw new JedisException ( e ) ; <nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; <nb> public class JedisTest extends JedisCommandTestBase { Thread . sleep ( NUMBER0 ) ; jedis . hmget ( STRING1 , STRING2 ) ; } + + @ test ( expected = JedisDataException . class ) + public void failWhenSendingNullValues ( ) { + jedis . set ( STRING2 , null ) ; + } }
throw JedisDataException when sending NULL values to redis as it is not a valid value in the protocol
<nb> public class ContextConfig implements LifecycleListener { COMMENT - COMMENT - COMMENT - COMMENT - @ deprecated - public String getDefaultContextXml ( ) { - if ( defaultContextXml == null ) { - defaultContextXml = Constants . DefaultContextXml ; - } - - return ( this . defaultContextXml ) ; - - } - - - COMMENT - COMMENT - COMMENT - COMMENT - COMMENT - COMMENT - @ deprecated - public void setDefaultContextXml ( String path ) { - - this . defaultContextXml = path ; - - } - - - COMMENT COMMENT COMMENT COMMENT <nb> public class ContextConfig implements LifecycleListener { } SINGLE if ( defaultContextXml == null ) { - getDefaultContextXml ( ) ; + defaultContextXml = Constants . DefaultContextXml ; } if ( ! context . getOverride ( ) ) {
Remove deprecated code
<nb> public class BitcoindComparisonTool { public static void main ( String [ ] args ) throws Exception { BriefLogFormatter . init ( ) ; - System . out . println ( STRING0 ) ; + System . out . println ( STRING1 ) ; boolean runLargeReorgs = Integer . parseInt ( args [ NUMBER0 ] ) == NUMBER0 ; params = NetworkParameters . testNet2 ( ) ; <nb> public class BitcoindComparisonTool { peers . setUserAgent ( STRING2 , STRING3 ) ; SINGLE - peers . addAddress ( new PeerAddress ( InetAddress . getByName ( STRING4 ) , NUMBER1 ) ) ; + peers . addAddress ( new PeerAddress ( InetAddress . getByName ( STRING4 ) , args . length > NUMBER2 ? Integer . parseInt ( args [ NUMBER2 ] ) : NUMBER1 ) ) ; peers . addEventListener ( new AbstractPeerEventListener ( ) { @ override
Re enable port selection as pull tester will need it
<nb> public class SimpleSSLSocketFactory extends SSLSocketFactory implements Comparat public SimpleSSLSocketFactory ( ) { try { - final SSLContext sslContext = SSLContext . getDefault ( ) ; + final SSLContext sslContext = SSLContext . getInstance ( STRING0 ) ; sslContext . init ( null , SINGLE new TrustManager [ ] { new DummyTrustManager ( ) } , new java . security . SecureRandom ( ) ) ;
Cannot re init default SSLContext
<nb> public final class Es6ToEs3Converter implements NodeTraversal . Callback , HotSwapC Preconditions . checkNotNull ( constructor ) ; - JSDocInfo classJSDoc = classNode . getJSDocInfo ( ) ; + JSDocInfo classJSDoc = NodeUtil . getBestJSDocInfo ( classNode ) ; JSDocInfoBuilder newInfo = JSDocInfoBuilder . maybeCopyFrom ( classJSDoc ) ; newInfo . recordConstructor ( ) ;
Use getBestJSDocInfo to find the JSDocInfo for a class node
<nb> public class RestPermissions { MESSAGES_READ , METRICS_READ , SYSTEM_READ , - THROUGHPUT_READ + THROUGHPUT_READ , + SAVEDSEARCHES_CREATE , + SAVEDSEARCHES_EDIT , + SAVEDSEARCHES_READ ) ; public static Set < String > readerPermissions ( String username ) {
give reader users permission to saved searches
<nb> public abstract class XValueContainerNode < ValueContainer extends XValueContainer myTemporaryMessageChildren != null ? myTemporaryMessageChildren : Collections . < MessageTreeNode > emptyList ( ) ) ; final int [ ] indices = getNodesIndices ( allMessageChildren ) ; final TreeNode [ ] nodes = getChildNodes ( indices ) ; - myMessageChildren = null ; - myTemporaryMessageChildren = null ; fireNodesRemoved ( indices , nodes ) ; if ( ! temporary ) { myMessageChildren = messages ; + myTemporaryMessageChildren = null ; } else { myTemporaryMessageChildren = messages ; + myMessageChildren = null ; } myCachedAllChildren = null ; fireNodesInserted ( messages ) ;
fixed endless loop on adding error message node cleaning message children before firing nodesRemoved causing getChildren and caluclation again
<nb> import static NAMESPACE ; import static NAMESPACE ; import static NAMESPACE ; import static NAMESPACE ; - import static NAMESPACE ; - import NAMESPACE ; - import NAMESPACE ; - import NAMESPACE ; - import NAMESPACE ; - import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; <nb> package NAMESPACE ; import NAMESPACE ; - import NAMESPACE ; - import NAMESPACE ; - import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; - import NAMESPACE ; import NAMESPACE ; COMMENT
Fix compile issues following rebase
<nb> public class DefaultRuleFinder implements RuleFinder { session . createQuery ( STRING0 + Rule . class . getSimpleName ( ) + STRING1 ) . setParameter ( STRING2 , ruleId ) . setParameter ( STRING3 , Rule . STATUS_REMOVED - ) , + ) , null ) ; } <nb> public class DefaultRuleFinder implements RuleFinder { . setParameter ( STRING4 , key ) . setParameter ( STRING5 , repositoryKey ) . setParameter ( STRING3 , Rule . STATUS_REMOVED - ) , + ) , null ) ; }
Fix quality flaws
<nb> class BaseObj { COMMENT COMMENT public void setName ( String name ) { + if ( name == null ) { + throw new RSIllegalArgumentException ( + STRING0 ) ; + } if ( name . length ( ) < NUMBER0 ) { - throw new RSIllegalArgumentException ( STRING1 ) ; + throw new RSIllegalArgumentException ( + STRING1 ) ; } if ( mName != null ) { - throw new RSIllegalArgumentException ( STRING2 ) ; + throw new RSIllegalArgumentException ( + STRING2 ) ; } try { <nb> class BaseObj { } COMMENT - COMMENT + COMMENT COMMENT - COMMENT + COMMENT COMMENT COMMENT synchronized public void destroy ( ) {
Check setName for null string typo fixes
<nb> public class PApplet implements PConstants { COMMENT public PFont createFont ( String name , float size , boolean smooth , char [ ] charset ) { + if ( g == null ) { + System . err . println ( STRING0 ) ; + throw new RuntimeException ( STRING1 ) ; + } return g . createFont ( name , size , smooth , charset ) ; }
Give helpful message when createFont called before setup
<nb> public class PortletKeys { public static final String JOURNAL_CONTENT_SEARCH = STRING0 ; + public static final String KNOWLEDGE_BASE_ADMIN = + STRING1 ; + public static final String LANGUAGE = STRING2 ; public static final String LAYOUT_CONFIGURATION = STRING3 ;
Add KB to PortletKeys constants
<nb> public class KeyguardManager { } COMMENT - COMMENT + COMMENT + COMMENT COMMENT - COMMENT + COMMENT + COMMENT + COMMENT COMMENT public boolean isKeyguardSecure ( ) { try { <nb> public class KeyguardManager { } COMMENT - COMMENT - COMMENT + COMMENT COMMENT - COMMENT - COMMENT - COMMENT COMMENT COMMENT public boolean isDeviceLocked ( int userId ) { <nb> public class KeyguardManager { COMMENT COMMENT COMMENT + COMMENT + COMMENT COMMENT COMMENT public boolean isDeviceSecure ( ) { <nb> public class KeyguardManager { } COMMENT - COMMENT - COMMENT + COMMENT COMMENT - COMMENT - COMMENT COMMENT COMMENT public boolean isDeviceSecure ( int userId ) {
Clarify javadoc of isKeyguardSecure and isDeviceSecure
<nb> public class AdminServiceFailureTest extends TestCase { default : throw new RuntimeException ( STRING0 ) ; } - - return null ; } private void putAlltoStore ( int nodeId , String storeName ) {
Fixed a compilation error returning from a void method
<nb> public class ModelImpl extends AbstractModel { } public void addRequired ( String name ) { - this . required . add ( name ) ; + if ( required == null ) { + required = new ArrayList < String > ( ) ; + } + required . add ( name ) ; Property p = properties . get ( name ) ; if ( p != null ) { p . setRequired ( true ) ;
Add null checking to addRequired
<nb> public class PythonAtTestRunConfiguration extends AbstractPythonTestRunConfigura public void checkConfiguration ( ) throws RuntimeConfigurationException { super . checkConfiguration ( ) ; if ( ! PyTestFrameworksUtil . isAtTestInstalled ( getProject ( ) , getSdkHome ( ) ) ) - throw new RuntimeConfigurationError ( STRING0 ) ; + throw new RuntimeConfigurationWarning ( STRING0 ) ; } } <nb> public class PythonNoseTestRunConfiguration extends AbstractPythonTestRunConfigu public void checkConfiguration ( ) throws RuntimeConfigurationException { super . checkConfiguration ( ) ; if ( ! PyTestFrameworksUtil . isNoseTestInstalled ( getProject ( ) , getSdkHome ( ) ) ) - throw new RuntimeConfigurationError ( STRING1 ) ; + throw new RuntimeConfigurationWarning ( STRING1 ) ; } public boolean useParam ( ) { <nb> public class PyTestRunConfiguration extends AbstractPythonTestRunConfiguration i throw new RuntimeConfigurationError ( STRING2 ) ; } if ( ! PyTestFrameworksUtil . isPyTestInstalled ( getProject ( ) , getSdkHome ( ) ) ) - throw new RuntimeConfigurationError ( STRING3 ) ; + throw new RuntimeConfigurationWarning ( STRING3 ) ; } @ override
changed error type to warning if couln t find nosetests in interpreter
<nb> public class FindByPersistentMethod extends AbstractClausedStaticPersistentMetho } } - try { - return crit . uniqueResult ( ) ; - } catch ( HibernateException e ) { - crit . setMaxResults ( NUMBER0 ) ; - return crit . uniqueResult ( ) ; - } + crit . setMaxResults ( NUMBER0 ) ; + return crit . uniqueResult ( ) ; } } ) ; }
dynamic findBy method executes sql query twice when more than one result found
<nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT abstract class AbstractConfigValue implements ConfigValue { final private ConfigOrigin origin ;
add comment about not having ConfigValue parent
<nb> public class Http11AprProcessor extends AbstractHttp11Processor < Long > { } } - } else if ( actionCode == ActionCode . AVAILABLE ) { - request . setAvailable ( inputBuffer . available ( ) ) ; } else if ( actionCode == ActionCode . COMET_BEGIN ) { comet = true ; } else if ( actionCode == ActionCode . COMET_END ) {
Remove duplicate code
<nb> public class EventCacheBroadcasterCache implements BroadcasterCache { public void setInvalidateCacheInterval ( long invalidateCacheInterval ) { this . invalidateCacheInterval = invalidateCacheInterval ; + scheduledFuture . cancel ( true ) ; + start ( ) ; } public void setClientIdleTime ( long clientIdleTime ) {
Restart the scheduler if the value change
<nb> public class Fields { for ( Field field : fields ) { String fieldName = field . getName ( ) ; + if ( fieldName . equals ( STRING0 ) ) { + continue ; + } + map . put ( fieldName , createFieldDescriptor ( field ) ) ; } <nb> public class IntrospectorTest { assertNull ( pd . getWriteMethodDescriptor ( ) ) ; } + @ test + public void testSerialUid ( ) { + ClassDescriptor cd = ClassIntrospector . lookup ( Bbean . class ) ; + + assertNull ( cd . getFieldDescriptor ( STRING0 , true ) ) ; + } + MethodDescriptor getPropertySetterDescriptor ( ClassDescriptor cd , String name , boolean declared ) { PropertyDescriptor propertyDescriptor = cd . getPropertyDescriptor ( name , true ) ; <nb> package NAMESPACE ; public class Bbean extends Abean { + + public static final long serialVersionUID = NUMBER0 ; + private Long boo ; Long getBoo ( ) {
ignore serialVersionUID as a field ah old java
<nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; - import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; <nb> public class Embedded extends StandardService { COMMENT COMMENT - COMMENT + COMMENT + COMMENT COMMENT COMMENT COMMENT <nb> public class Embedded extends StandardService { COMMENT COMMENT - COMMENT + COMMENT + COMMENT COMMENT COMMENT COMMENT
Allow Checkstyle s unused imports test to be used with the o a catalina startup package
<nb> public abstract class ObjCObject extends NativeObject { return AssociatedObjectHelper . getPeerObject ( handle ) ; } - public void addStrongRef ( ObjCObject to ) { + public < T extends ObjCObject > T addStrongRef ( T to ) { AssociatedObjectHelper . addStrongRef ( this , to ) ; + return to ; } public void removeStrongRef ( ObjCObject to ) {
Changed ObjCCobject addStrongRef o to return o
<nb> public abstract class Job { } COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + public long getScheduledAt ( ) { + return mRequest . getScheduledAt ( ) ; + } + + COMMENT COMMENT COMMENT COMMENT <nb> public final class JobRequest { mScheduledAt = timeStamp ; } - COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + public long getScheduledAt ( ) { return mScheduledAt ; }
Expose scheduling time of a job
<nb> public class LuceneSerializerTest { @ test public void various ( ) throws Exception { - MatchingFilters filters = new MatchingFilters ( Module . LUCENE , Target . LUCENE ) ; + MatchingFiltersFactory filters = new MatchingFiltersFactory ( Module . LUCENE , Target . LUCENE ) ; for ( BooleanExpression filter : filters . string ( title , StringConstant . create ( STRING0 ) ) ) { if ( unsupportedOperation ( filter ) ) { continue ;
fixed broken refactoring
<nb> public class StreetVertexIndexServiceImpl implements StreetVertexIndexService { endwiseVertex = ( StreetVertex ) edge . getToVertex ( ) ; else endwiseVertex = null ; - score = distance ; + score = distance * SphericalDistanceLibrary . RADIUS_OF_EARTH_IN_KM * NUMBER0 / FLOAT0 ; if ( endwise ( ) ) { score *= FLOAT1 ; } <nb> public class StreetVertexIndexServiceImpl implements StreetVertexIndexService { public CandidateEdge best = null ; public boolean add ( CandidateEdge ce ) { - if ( ce . endwiseVertex != null ) - this . endwiseVertex = ce . endwiseVertex ; - if ( best == null || ce . score < best . score ) + if ( best == null || ce . score < best . score ) { + endwiseVertex = ce . endwiseVertex ; best = ce ; + } return super . add ( ce ) ; }
do not wrongly favor endwise edges
<nb> public class UpgradeServletOutputStream extends ServletOutputStream { SINGLE synchronized ( fireListenerLock ) { if ( flushing ) { - socketWrapper . registerWriteInterest ( ) ; + SINGLE + SINGLE fireListener = true ; return false ; + } else if ( fireListener ) { + SINGLE + SINGLE + SINGLE + return false ; } else { boolean result = socketWrapper . isReadyForWrite ( ) ; fireListener = ! result ; <nb> public class UpgradeServletOutputStream extends ServletOutputStream { synchronized ( writeLock ) { if ( updateFlushing ) { flushing = socketWrapper . flush ( block ) ; + if ( flushing ) { + socketWrapper . registerWriteInterest ( ) ; + } } else { socketWrapper . flush ( block ) ; } <nb> public class UpgradeServletOutputStream extends ServletOutputStream { if ( flushing ) { flushInternal ( false , true ) ; if ( flushing ) { - socketWrapper . registerWriteInterest ( ) ; return ; } } else {
Fix another source of multiple write registrations
<nb> public class VizGui extends JFrame implements VertexSelectionListener , Remaining if ( transitCheckBox . isSelected ( ) ) modeSet . setTransit ( true ) ; TraverseOptions options = new TraverseOptions ( modeSet ) ; - options . speed = NUMBER0 ; SINGLE - options . walkReluctance = NUMBER0 ; SINGLE VisualTraverseVisitor visitor = new VisualTraverseVisitor ( showGraph ) ; options . aStarSearchFactory = visitor . getAStarSearchFactory ( ) ; - options . maxSlope = NUMBER0 ; SINGLE options . boardCost = Integer . parseInt ( boardingPenaltyField . getText ( ) ) * NUMBER1 ; SINGLE SINGLE options . optimizeFor = OptimizeType . QUICK ;
do not override default traverseoptions in vizgui
<nb> import NAMESPACE ; COMMENT COMMENT - COMMENT + COMMENT COMMENT COMMENT COMMENT COMMENT COMMENT COMMENT - interface Rule < VALIDATABLE > { + public interface Rule < VALIDATABLE > { COMMENT COMMENT <nb> interface Rule < VALIDATABLE > { COMMENT COMMENT COMMENT - String getMessage ( final Context context ) ; + String getMessage ( Context context ) ; }
Rule Make public
<nb> public class ResourceBundleManager implements PersistentStateComponent < ResourceB } @ override - public void childReplaced ( @ notnull PsiTreeChangeEvent event ) { - super . childReplaced ( event ) ; - } - - @ override - public void beforeChildMovement ( @ notnull PsiTreeChangeEvent event ) { - super . beforeChildMovement ( event ) ; - } - - @ override - public void propertyChanged ( @ notnull PsiTreeChangeEvent event ) { - super . propertyChanged ( event ) ; - } - - @ override - public void childRemoved ( @ notnull PsiTreeChangeEvent event ) { + public void beforeChildRemoval ( @ notnull PsiTreeChangeEvent event ) { final PsiElement child = event . getChild ( ) ; if ( ! ( child instanceof PsiFile ) ) { return ;
ResourceBundleManager mehtod childRemoved beforeChildRemoval in psi listener
<nb> public class SizeAdaptiveLayout extends ViewGroup { if ( DEBUG ) Log . d ( TAG , this + STRING0 + MeasureSpec . toString ( heightMeasureSpec ) ) ; View model = selectActiveChild ( heightMeasureSpec ) ; + if ( model == null ) { + setMeasuredDimension ( NUMBER0 , NUMBER0 ) ; + return ; + } SizeAdaptiveLayout . LayoutParams lp = ( SizeAdaptiveLayout . LayoutParams ) model . getLayoutParams ( ) ; if ( DEBUG ) Log . d ( TAG , STRING1 + lp . minHeight + STRING2 + lp . maxHeight ) ; <nb> public class SizeAdaptiveLayout extends ViewGroup { int measureSpec = View . MeasureSpec . makeMeasureSpec ( bottom - top , View . MeasureSpec . EXACTLY ) ; mActiveChild = selectActiveChild ( measureSpec ) ; + if ( mActiveChild == null ) return ; + mActiveChild . setVisibility ( View . VISIBLE ) ; if ( mLastActive != mActiveChild && mLastActive != null ) {
Fix NPE in empty SizeAdaptiveLayouts
<nb> public abstract class XMPPException extends Exception { COMMENT COMMENT public StreamErrorException ( StreamError streamError ) { - super ( streamError . toString ( ) ) ; + super ( streamError . getCondition ( ) . toString ( ) + + STRING0 + + streamError . toString ( ) ) ; this . streamError = streamError ; }
Improve message of StreamErrorException
<nb> public class DirectoryAsPackageRenameHandler implements RenameHandler , TitledHan new String [ ] { RefactoringBundle . message ( STRING0 ) , RefactoringBundle . message ( STRING1 ) , CommonBundle . getCancelButtonText ( ) } , NUMBER0 , Messages . getWarningIcon ( ) ) ; + if ( ret == - NUMBER1 ) return ; renameDirs ( project , nameSuggestionContext , editor , psiDirectory , aPackage , ret == NUMBER0 ? new PsiDirectory [ ] { psiDirectory } : projectDirectories ) ; } else {
cancel should stop renaming
<nb> public class WifiApStress fail ( STRING0 ) ; } assertTrue ( STRING1 , mAct . pingTest ( null ) ) ; - SINGLE - SINGLE - try { - Thread . sleep ( NUMBER0 * NUMBER1 * NUMBER2 ) ; - } catch ( Exception e ) { - fail ( STRING0 ) ; - } - SINGLE - assertTrue ( STRING2 , mAct . pingTest ( null ) ) ; SINGLE assertTrue ( mAct . mWifiManager . setWifiApEnabled ( config , false ) ) ; SINGLE
Remove long sleep time in WifiApStress test
<nb> public class ArquillianService implements Service < ArquillianService > { @ override public void transition ( ServiceController < ? extends Object > serviceController , ServiceController . Transition transition ) { - switch ( transition ) { - case STARTING_to_UP : { + switch ( serviceController . getState ( ) ) { + case UP : { ServiceName serviceName = serviceController . getName ( ) ; String simpleName = serviceName . getSimpleName ( ) ; if ( JBOSS_DEPLOYMENT . isParentOf ( serviceName ) && simpleName . equals ( Phase . INSTALL . toString ( ) ) ) { <nb> public class ArquillianService implements Service < ArquillianService > { } } } - case START_FAILED_to_STARTING : - case START_INITIATING_to_STARTING : { + case STARTING : { ServiceName serviceName = serviceController . getName ( ) ; String simpleName = serviceName . getSimpleName ( ) ; if ( JBOSS_DEPLOYMENT . isParentOf ( serviceName ) && simpleName . equals ( Phase . DEPENDENCIES . toString ( ) ) ) {
Change arquillian to rely on states rather than transitions
<nb> import NAMESPACE ; import NAMESPACE ; COMMENT + COMMENT + COMMENT + COMMENT COMMENT + COMMENT + COMMENT + COMMENT COMMENT COMMENT COMMENT - COMMENT + COMMENT + COMMENT + COMMENT + COMMENT COMMENT public class RealmQuery < E extends RealmObject > {
Updated RealmQuery JavaDoc
<nb> public class CRUDDocumentPhysicalTest { SINGLE for ( ODocument rec : database . browseCluster ( STRING0 ) ) - rec . delete ( ) ; + if ( rec != null ) + rec . delete ( ) ; Assert . assertEquals ( database . countClusterElements ( STRING0 ) , NUMBER0 ) ;
Fixed unit test on delete
<nb> public final class PluginManager { @ suppresswarnings ( STRING0 ) private boolean isPhoneGapPlugin ( Class c ) { if ( c != null ) { - return com . phonegap . api . Plugin . class . isAssignableFrom ( c ) ; + return com . phonegap . api . Plugin . class . isAssignableFrom ( c ) || com . phonegap . api . IPlugin . class . isAssignableFrom ( c ) ; } return false ; }
Add IPlugin to isPhoneGapPlugin check
<nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; import NAMESPACE ; import static NAMESPACE ; <nb> public class IndexTemplateFileLoadingTests extends ElasticsearchIntegrationTest @ test public void testThatLoadingTemplateFromFileWorks ( ) throws Exception { - final int iters = scaledRandomIntBetween ( NUMBER0 , NUMBER1 ) ; + final int iters = scaledRandomIntBetween ( NUMBER2 , NUMBER0 ) ; Set < String > indices = new HashSet < > ( ) ; for ( int i = NUMBER3 ; i < iters ; i ++ ) { - String indexName = STRING0 + randomRealisticUnicodeOfLengthBetween ( NUMBER3 , NUMBER0 ) ; + String indexName = STRING0 + randomAsciiOfLengthBetween ( NUMBER3 , NUMBER0 ) . toLowerCase ( Locale . ROOT ) ; if ( indices . contains ( indexName ) ) { continue ; }
TEST Use lowercase index names in test
<nb> public class SqueezeboxBinding extends AbstractBinding < SqueezeboxBindingProvider if ( command . equals ( OnOffType . ON ) ) squeezeServer . syncPlayer ( playerId , bindingConfig . getExtra ( ) ) ; else if ( command . equals ( OnOffType . OFF ) ) - squeezeServer . unSyncPlayer ( playerId ) ; + squeezeServer . unSyncPlayer ( bindingConfig . getExtra ( ) ) ; break ; default:
Sync remove players incorrect
<nb> class ActivityUtils { COMMENT private void createStackAndPushStartActivity ( ) { activityStack = new Stack < Activity > ( ) ; - activityStack . push ( activity ) ; + if ( activity != null ) + activityStack . push ( activity ) ; } COMMENT
Added a null check in createStackAndPushStartActivity
<nb> public class CalendarPickerViewTest { . inMode ( SINGLE ) SINGLE . withSelectedDate ( today . getTime ( ) ) ; Calendar jumpToCal = Calendar . getInstance ( locale ) ; + jumpToCal . setTime ( today . getTime ( ) ) ; jumpToCal . add ( MONTH , NUMBER0 ) ; jumpToCal . set ( DAY_OF_WEEK , NUMBER1 ) ; boolean wasAbleToSetDate = view . selectDate ( jumpToCal . getTime ( ) ) ;
Fix test by making its Calendar invariant
<nb> public class OperationSetPersistentPresenceMsnImpl throw new IllegalArgumentException ( status + STRING0 ) ; + if ( status . equals ( MsnStatusEnum . OFFLINE ) ) + { + msnProvider . unregister ( ) ; + return ; + } + SINGLE SINGLE SINGLE
Changing status to offline
<nb> public class MsOfficeCommActivator public void stop ( BundleContext bundleContext ) throws Exception { + SINGLE + if ( ! OSUtils . IS_WINDOWS ) + return ; + try { int hresult = OutOfProcessServer . stop ( ) ;
Disables msofficecomm plugin on other operating systems than Windows check added when service is stopped
<nb> public class GTFSPatternHopFactory { StopTime st = null ; for ( j = i + NUMBER0 ; j < lastStop + NUMBER0 ; ++ j ) { st = stopTimes . get ( j ) ; - if ( st . isDepartureTimeSet ( ) || st . isArrivalTimeSet ( ) ) { + if ( ( st . isDepartureTimeSet ( ) && st . getDepartureTime ( ) != departureTime ) + || ( st . isArrivalTimeSet ( ) && st . getArrivalTime ( ) != departureTime ) ) { break ; } }
treat stoptimes with duplicate arrival departure times as if said times were unset
<nb> class ActualProperties public boolean isPartitionedOn ( Collection < Symbol > columns ) { SINGLE - return partitioningColumns . isPresent ( ) && ImmutableSet . copyOf ( columns ) . containsAll ( partitioningColumns . get ( ) ) ; + SINGLE + return partitioningColumns . isPresent ( ) && partitioningColumns . get ( ) . stream ( ) + . filter ( symbol - > ! constants . containsKey ( symbol ) ) + . allMatch ( ImmutableSet . copyOf ( columns ) : : contains ) ; } public boolean hasKnownPartitioningScheme ( )
Improve partitionedOn property check for constants
<nb> public class JRubyBackend implements Backend { jruby . setCompatVersion ( CompatVersion . RUBY1_8 ) ; } if ( STRING0 . equals ( rubyVersion ) ) { - jruby . setCompatVersion ( CompatVersion . RUBY1_8 ) ; + jruby . setCompatVersion ( CompatVersion . RUBY1_9 ) ; } if ( STRING1 . equals ( rubyVersion ) ) { jruby . setCompatVersion ( CompatVersion . RUBY2_0 ) ;
Fixing the CompatVersion for the JrubyBackend
<nb> public class MultiFormatLoader < M > extends FilterLoadFunc { Class < ? > clazz = PigUtil . getClass ( className ) ; typeRef = new TypeRef < M > ( clazz ) { } ; - COMMENT - COMMENT - COMMENT - COMMENT - COMMENT - COMMENT - COMMENT - COMMENT + COMMENT + COMMENT + COMMENT COMMENT LoadFunc ldr ; if ( Message . class . isAssignableFrom ( clazz ) ) {
update an old comment
<nb> COMMENT - COMMENT + COMMENT COMMENT COMMENT COMMENT <nb> COMMENT package NAMESPACE ; + import NAMESPACE ; import NAMESPACE ; COMMENT <nb> public interface PsiImportStatementBase extends PsiElement { COMMENT PsiImportStatementBase [ ] EMPTY_ARRAY = new PsiImportStatementBase [ NUMBER0 ] ; + ArrayFactory < PsiImportStatementBase > ARRAY_FACTORY = new ArrayFactory < PsiImportStatementBase > ( ) { + @ override + public PsiImportStatementBase [ ] create ( final int count ) { + return count == NUMBER0 ? EMPTY_ARRAY : new PsiImportStatementBase [ count ] ; + } + } ; + COMMENT COMMENT COMMENT <nb> public class ArrayUtil { return ret ; } - COMMENT + COMMENT @ notnull public static < T > T [ ] mergeArrays ( @ notnull T [ ] a1 , @ notnull T [ ] a2 , @ notnull Class < T > aClass ) { if ( a1 . length == NUMBER0 ) {
Fix array merging
<nb> public class PathUtil { File answer = lib . getParentFile ( ) ; return answer . exists ( ) ? answer : null ; } + + File current = new File ( STRING0 ) . getAbsoluteFile ( ) ; SINGLE + + do { + File atDevHome = new File ( current , STRING1 ) ; + if ( atDevHome . exists ( ) ) return atDevHome ; + current = current . getParentFile ( ) ; + } while ( current != null ) ; return null ; }
Detect alt headers in locally built kompiler
<nb> public class DashFavoritesFragment extends DashBaseFragment { } ) ; favorites . addView ( view ) ; } - SINGLE - mainView . invalidate ( ) ; } private void updateArrows ( ) {
remove not working fix
<nb> public class DB { COMMENT - public < V > Map < String , V > makeStringMap ( ) { + public < V > BTreeMap < String , V > makeStringMap ( ) { keySerializer = BTreeKeySerializer . STRING ; return make ( ) ; } COMMENT - public < V > Map < Long , V > makeLongMap ( ) { + public < V > BTreeMap < Long , V > makeLongMap ( ) { keySerializer = BTreeKeySerializer . ZERO_OR_POSITIVE_LONG ; return make ( ) ; }
maker methods now return BTreeMap instead of Map