diff
stringlengths
38
1.78k
msg_token
stringlengths
9
190
<nb> public class PVector implements Serializable { COMMENT COMMENT - COMMENT + COMMENT COMMENT COMMENT public static PVector lerp ( PVector v1 , PVector v2 , float amt ) {
Clarified reference for PVector lerp
<nb> public class PreviewWorldScreen extends CoreScreenLayer { image . setVisible ( true ) ; } catch ( Exception ex ) { image . setVisible ( false ) ; + logger . info ( STRING0 + layerDropdown . getSelection ( ) ) ; } currentSettings = newSettings ; }
Add logging for cases where world preview generation fails on a specific layer
<nb> public class MinecraftForgeClient { } public static void onGameStart ( ) { - System . out . println ( STRING0 ) ; - ModLoader . getMinecraftInstance ( ) . effectRenderer = new MinecraftForgeEffectRenderer ( ModLoader . getMinecraftInstance ( ) . theWorld , ModLoader . getMinecraftInstance ( ) . renderEngine ) ; + } }
fixed compilation errors
<nb> public class ImageHelper { SINGLE return null ; } + + if ( bm == null ) + return null ; float percentage = ( float ) finalWidth / bm . getWidth ( ) ; float proportionateHeight = bm . getHeight ( ) * percentage ;
Adding null check in bitmap creation
<nb> public class PackageManagerService extends IPackageManager . Stub { for ( int curUser : users ) { long timeout = SystemClock . uptimeMillis ( ) + NUMBER0 ; synchronized ( conn ) { - long now = SystemClock . uptimeMillis ( ) ; - while ( conn . mContainerService == null && now < timeout ) { + long now ; + while ( conn . mContainerService == null && + ( now = SystemClock . uptimeMillis ( ) ) < timeout ) { try { conn . wait ( timeout - now ) ; } catch ( InterruptedException e ) {
Solve the infinite loop on clearExternalStorageDataSync
<nb> public final class Service { if ( other instanceof Service ) { Service that = ( Service ) other ; return name . equals ( that . name ) - && fqname . equals ( that . fqname ) && documentation . equals ( that . documentation ) && methods . equals ( that . methods ) ; }
Revert Include fully qualified service name in equals check
<nb> import NAMESPACE ; public enum WorldType { NORMAL ( STRING0 ) , FLAT ( STRING1 ) , - VERSION_1_1 ( STRING2 ) ; + VERSION_1_1 ( STRING2 ) , + LARGE_BIOMES ( STRING3 ) ; private final static Map < String , WorldType > BY_NAME = Maps . newHashMap ( ) ; private final String name ;
Add LargeBiomes WorldType
<nb> public class SlidingUpPanelLayout extends ViewGroup { boolean result ; final int save = canvas . save ( Canvas . CLIP_SAVE_FLAG ) ; - if ( mSlideableView != child ) { SINGLE + if ( mSlideableView != null && mSlideableView != child ) { SINGLE SINGLE SINGLE canvas . getClipBounds ( mTmpRect ) ;
Fix NPE in drawChild when returning to Fragment with animation
<nb> public class RingtoneManager { SINGLE SINGLE - final ContentResolver cr = context . getContentResolver ( ) ; - final Uri cacheUri = getCacheForType ( type ) ; - try ( InputStream in = cr . openInputStream ( ringtoneUri ) ; - OutputStream out = cr . openOutputStream ( cacheUri ) ) { - Streams . copy ( in , out ) ; - } catch ( IOException e ) { - Log . w ( TAG , STRING0 + e ) ; + if ( ringtoneUri != null ) { + final ContentResolver cr = context . getContentResolver ( ) ; + final Uri cacheUri = getCacheForType ( type ) ; + try ( InputStream in = cr . openInputStream ( ringtoneUri ) ; + OutputStream out = cr . openOutputStream ( cacheUri ) ) { + Streams . copy ( in , out ) ; + } catch ( IOException e ) { + Log . w ( TAG , STRING0 + e ) ; + } } }
Don t try caching null ringtones
<nb> class PackageManagerService extends IPackageManager . Stub { } String external = parser . getAttributeValue ( null , STRING0 ) ; if ( external != null ) { - mInternalSdkPlatform = Integer . parseInt ( external ) ; + mExternalSdkPlatform = Integer . parseInt ( external ) ; } } catch ( NumberFormatException e ) { } <nb> class PackageManagerService extends IPackageManager . Stub { android . provider . Settings . Secure . DEFAULT_INSTALL_LOCATION , PackageHelper . APP_INSTALL_AUTO ) ; } } -
Fix typo when parsing external platform version from Settings
<nb> public class VoiceInteractionService extends Service { if ( curComp == null ) { return false ; } - return curComp . equals ( cur ) ; + return curComp . equals ( service ) ; } COMMENT <nb> package NAMESPACE ; import NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; <nb> public class TestInteractionActivity extends Activity implements View . OnClickLis return ; } + if ( ! VoiceInteractionService . isActiveService ( this , + new ComponentName ( this , MainInteractionService . class ) ) ) { + Log . w ( TAG , STRING0 ) ; + finish ( ) ; + return ; + } + setContentView ( R . layout . test_interaction ) ; mAbortButton = ( Button ) findViewById ( R . id . abort ) ; mAbortButton . setOnClickListener ( this ) ;
Fix VoiceInteractionService isActiveService
<nb> public final class ParsedReaderResultTestCase extends Assert { STRING0 , STRING0 , ParsedResultType . TEXT ) ; - doTestResult ( STRING1 , STRING1 , ParsedResultType . TEXT ) ; } @ test
Cancel one old test case
<nb> public final class Realm implements Closeable { COMMENT COMMENT public static synchronized boolean compactRealmFile ( Context context , String fileName , byte [ ] key ) { - if ( key != null || key . length > NUMBER0 ) { + if ( key != null ) { throw new IllegalArgumentException ( STRING0 ) ; }
Removing unneeded check
<nb> public class Client { conf . getBoolean ( CommonConfigurationKeys . IPC_CLIENT_PING_KEY , true ) ; return new ConnectionId ( addr , protocol , ticket , rpcTimeout , remotePrincipal , - conf . getInt ( - CommonConfigurationKeysPublic . IPC_CLIENT_CONNECT_MAX_RETRIES_ON_SOCKET_TIMEOUTS_KEY , - CommonConfigurationKeysPublic . IPC_CLIENT_CONNECT_MAX_RETRIES_ON_SOCKET_TIMEOUTS_DEFAULT ) , conf . getInt ( CommonConfigurationKeysPublic . IPC_CLIENT_CONNECTION_MAXIDLETIME_KEY , CommonConfigurationKeysPublic . IPC_CLIENT_CONNECTION_MAXIDLETIME_DEFAULT ) , conf . getInt ( CommonConfigurationKeysPublic . IPC_CLIENT_CONNECT_MAX_RETRIES_KEY , CommonConfigurationKeysPublic . IPC_CLIENT_CONNECT_MAX_RETRIES_DEFAULT ) , + conf . getInt ( + CommonConfigurationKeysPublic . IPC_CLIENT_CONNECT_MAX_RETRIES_ON_SOCKET_TIMEOUTS_KEY , + CommonConfigurationKeysPublic . IPC_CLIENT_CONNECT_MAX_RETRIES_ON_SOCKET_TIMEOUTS_DEFAULT ) , conf . getBoolean ( CommonConfigurationKeysPublic . IPC_CLIENT_TCPNODELAY_KEY , CommonConfigurationKeysPublic . IPC_CLIENT_TCPNODELAY_DEFAULT ) , doPing ,
Fix bad merge which mixed up two configuration options
<nb> public class DefaultBuildSuccessResult extends AbstractBuildResult implements In public DefaultBuildSuccessResult ( long startTime , long endTime ) { super ( startTime , endTime , STRING0 ) ; } - } <nb> package NAMESPACE ; import NAMESPACE ; public class DefaultTaskSuccessResult extends AbstractTaskResult implements InternalTaskSuccessResult { - public DefaultTaskSuccessResult ( long startTime , long endTime , String outcomeDescription ) { super ( startTime , endTime , outcomeDescription ) ; } - } <nb> package NAMESPACE ; import NAMESPACE ; public class DefaultTestSkippedResult extends AbstractTestResult implements InternalTestSkippedResult { - public DefaultTestSkippedResult ( long startTime , long endTime ) { super ( startTime , endTime , STRING1 ) ; } - } <nb> package NAMESPACE ; import NAMESPACE ; public class DefaultTestSuccessResult extends AbstractTestResult implements InternalTestSuccessResult { - public DefaultTestSuccessResult ( long startTime , long endTime ) { super ( startTime , endTime , STRING0 ) ; } - }
Remove blank lines
<nb> public abstract class DocumentFile { COMMENT COMMENT - COMMENT + COMMENT COMMENT COMMENT COMMENT
Fix minor doc bug on DocumentFile
<nb> public class DashFavoritesFragment extends DashBaseFragment implements Favourite @ override public void updateFavourites ( ) { - if ( getActivity ( ) == null ) { - return ; - } getActivity ( ) . runOnUiThread ( new Runnable ( ) { @ override public void run ( ) {
Removed bad code
<nb> public abstract class AbstractJPATest { @ test @ noopenjpa + @ nobatoojpa SINGLE public void Offset1 ( ) { List < String > names2 = Arrays . asList ( STRING0 , STRING1 , STRING2 , STRING3 , STRING4 ) ; assertEquals ( names2 , query ( ) . from ( cat ) . orderBy ( cat . name . asc ( ) ) . offset ( NUMBER0 ) . list ( cat . name ) ) ; <nb> public abstract class AbstractJPATest { @ test @ noopenjpa + @ nobatoojpa SINGLE public void Offset2 ( ) { List < String > names2 = Arrays . asList ( STRING1 , STRING2 , STRING3 , STRING4 ) ; assertEquals ( names2 , query ( ) . from ( cat ) . orderBy ( cat . name . asc ( ) ) . offset ( NUMBER1 ) . list ( cat . name ) ) ;
Add Batoo exclusions
<nb> public class WebFilter implements Filter { private HazelcastHttpSession getSessionWithId ( final String sessionId ) { HazelcastHttpSession session = mapSessions . get ( sessionId ) ; if ( session != null && ! session . isValid ( ) ) { - session = null ; destroySession ( session , true ) ; + session = null ; } return session ; }
set session to null after invalidating it
<nb> public interface Builders { public interface IF < A extends IF < ? > > extends ImageViewBuilder < A > , ImageViewFutureBuilder { } - public interface BF < A extends BF < ? > > extends BitmapBuilder < A > , BitmapFutureBuilder , IF < IF < ? > > { + public interface BF < A extends BF < ? > > extends BitmapBuilder < A > , BitmapFutureBuilder , IF < A > { } public interface F extends FutureBuilder , ImageViewFutureBuilder {
fix build break
<nb> public class CoverageListNode extends AbstractTreeNode { } @ override - public Object getValue ( ) { - return ApplicationManager . getApplication ( ) . runReadAction ( new Computable < Object > ( ) { - @ override - public Object compute ( ) { - return CoverageListNode . super . getValue ( ) ; - } - } ) ; - } - - @ override public int getWeight ( ) { return ApplicationManager . getApplication ( ) . runReadAction ( new Computable < Integer > ( ) { @ override
revert changes in api
<nb> public final class BeanConverter { } @ fallbackconverter - @ suppresswarnings ( STRING0 ) public static Object convertTo ( Class < ? > type , Exchange exchange , Object value , TypeConverterRegistry registry ) { SINGLE if ( BeanInvocation . class . isAssignableFrom ( value . getClass ( ) ) ) { <nb> public class DefaultUnitOfWork implements UnitOfWork , Service { } } } - - @ suppresswarnings ( STRING0 ) + public void done ( Exchange exchange ) { if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( STRING1 + exchange . getExchangeId ( ) + STRING2 + exchange ) ; <nb> public class DefaultManagementAgent extends ServiceSupport implements Management LOG . warn ( STRING3 , ioe ) ; } } - - @ suppresswarnings ( STRING0 ) + protected MBeanServer findOrCreateMBeanServer ( ) { SINGLE
Removed the useless SuppressWarnings
<nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; <nb> public class KotlinBuiltIns { } SINGLE + String text = FileUtil . loadTextAndClose ( new InputStreamReader ( stream ) ) ; JetFile file = ( JetFile ) PsiFileFactory . getInstance ( project ) . createFileFromText ( path , - JetFileType . INSTANCE , FileUtil . loadTextAndClose ( new InputStreamReader ( stream ) ) ) ; + JetFileType . INSTANCE , StringUtil . convertLineSeparators ( text ) ) ; files . add ( file ) ; } return files ;
Convert line separators when loading files with builtins
<nb> COMMENT package NAMESPACE ; - import NAMESPACE ; - import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; <nb> import static NAMESPACE ; SINGLE public class Javac { + public static class CompilationError extends Error + { + public CompilationError ( String message ) + { + super ( message ) ; + } + } public static Class < InternalExecutionResult > compile ( String className , String classBody ) throws ClassNotFoundException <nb> public class Javac sb . append ( format ( STRING0 , diagnostic . getLineNumber ( ) , System . lineSeparator ( ) ) ) ; number ++ ; } - throw new CompilerError ( sb . toString ( ) ) ; + throw new CompilationError ( sb . toString ( ) ) ; } Class < InternalExecutionResult > clazz = ( Class < InternalExecutionResult > ) manager . getClassLoader ( null ) . loadClass ( className ) ;
Use custom exception to report compilation failure in Birk
<nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; import NAMESPACE ; COMMENT <nb> public abstract class PyTestCase extends UsefulTestCase { PythonLanguageLevelPusher . setForcedLanguageLevel ( myFixture . getProject ( ) , languageLevel ) ; } + protected void runWithLanguageLevel ( @ notnull LanguageLevel languageLevel , @ notnull Runnable action ) { + setLanguageLevel ( languageLevel ) ; + try { + action . run ( ) ; + } + finally { + setLanguageLevel ( null ) ; + } + } + protected static void assertNotParsed ( PyFile file ) { assertNull ( PARSED_ERROR_MSG , ( ( PyFileImpl ) file ) . getTreeElement ( ) ) ; }
Added runWithLanguageLevel for Python testes
<nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; COMMENT COMMENT <nb> public class DiskLruCacheWrapper implements DiskCache { SINGLE SINGLE if ( editor != null ) { - writer . write ( editor . newOutputStream ( NUMBER0 ) ) ; + OutputStream os = editor . newOutputStream ( NUMBER0 ) ; + writer . write ( os ) ; editor . commit ( ) ; + os . close ( ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ;
Fix unclosed OutputStream in DiskLruCacheWrapper reported by StrictMode
<nb> public class Tool { new Option ( STRING0 , STRING1 , STRING2 ) , new Option ( STRING3 , STRING4 , STRING5 ) , new Option ( STRING3 , STRING6 , STRING7 ) , - new Option ( STRING8 , STRING9 , STRING10 ) , + new Option ( STRING8 , STRING9 , STRING11 ) , new Option ( STRING12 , STRING13 , STRING14 ) ,
set help msg
<nb> public class DirectoryFragment extends Fragment { mRecView . setLayoutManager ( layout ) ; SINGLE SINGLE - mSelectionManager . handleLayoutChanged ( ) ; + mModel . mSelectionManager . handleLayoutChanged ( ) ; SINGLE mThumbSize = new Point ( thumbSize , thumbSize ) ; }
Fix broken build
<nb> public class TestDatastore extends TestBase { @ test public void testExists ( ) throws Exception { - final Key < FacebookUser > k = getDs ( ) . save ( new FacebookUser ( NUMBER0 , STRING0 ) ) ; + int id = NUMBER1 ; + final Key < FacebookUser > k = getDs ( ) . save ( new FacebookUser ( id , STRING0 ) ) ; assertEquals ( NUMBER0 , getDs ( ) . getCount ( FacebookUser . class ) ) ; - assertNotNull ( getDs ( ) . get ( FacebookUser . class , NUMBER0 ) ) ; + assertNotNull ( getDs ( ) . get ( FacebookUser . class , id ) ) ; assertNotNull ( getDs ( ) . exists ( k ) ) ; assertNotNull ( getAds ( ) . exists ( k , ReadPreference . secondaryPreferred ( ) ) ) ;
use a different key for clarity
<nb> public class SortedComboBoxModel < E extends Comparable < E > > extends DefaultComboBo public void insertElementAt ( E element , int index ) { addElement ( element ) ; } + + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + public void elementChanged ( E element ) { + int idx = getIndexOf ( element ) ; + if ( idx < NUMBER0 ) { + return ; + } + super . fireContentsChanged ( this , idx , idx ) ; + } }
Changed SortedComboBoxModel to allow to notify the listeners that an element of the model was changed
<nb> public class ZooClient implements Watcher private final long storeCreationTime ; private final long storeId ; private final int machineId ; - private final String sequenceNr ; + private String sequenceNr ; private long committedTx ; SINGLE <nb> public class ZooClient implements Watcher { System . out . println ( STRING0 ) ; instantiateZooKeeper ( ) ; + sequenceNr = setup ( ) ; } }
Writes machine tx id when reconnecting
<nb> public class CodeStyleManager extends FileEditorManagerAdapter implements Window private boolean applyIndentSize ( final CommonCodeStyleSettings . IndentOptions indentOptions , final String indentSize ) { try { - indentOptions . INDENT_SIZE = Integer . parseInt ( indentSize ) ; + int indent = Integer . parseInt ( indentSize ) ; + indentOptions . INDENT_SIZE = indent ; + indentOptions . CONTINUATION_INDENT_SIZE = indent ; return true ; } catch ( NumberFormatException e ) { return false ;
set CONTINUATION_INDENT_SIZE equal to INDENT_SIZE
<nb> public class InputMethodManagerService extends IInputMethodManager . Stub screenOnOffFilt . addAction ( Intent . ACTION_CLOSE_SYSTEM_DIALOGS ) ; mContext . registerReceiver ( new ScreenOnOffReceiver ( ) , screenOnOffFilt ) ; + mStatusBar = statusBar ; + mInputMethodData = IconData . makeIcon ( STRING0 , null , NUMBER0 , NUMBER0 , NUMBER0 ) ; + mInputMethodIcon = statusBar . addIcon ( mInputMethodData , null ) ; + statusBar . setIconVisibility ( mInputMethodIcon , false ) ; + buildInputMethodListLocked ( mMethodList , mMethodMap ) ; final String enabledStr = Settings . Secure . getString ( <nb> public class InputMethodManagerService extends IInputMethodManager . Stub } } - mStatusBar = statusBar ; - mInputMethodData = IconData . makeIcon ( STRING0 , null , NUMBER0 , NUMBER0 , NUMBER0 ) ; - mInputMethodIcon = statusBar . addIcon ( mInputMethodData , null ) ; - statusBar . setIconVisibility ( mInputMethodIcon , false ) ; - mSettingsObserver = new SettingsObserver ( mHandler ) ; updateFromSettingsLocked ( ) ; }
Fix acore crash on boot up
<nb> public class EntityRobot extends EntityRobotBase implements ItemStack robotStack = new ItemStack ( BuildCraftSilicon . robotItem ) ; NBTUtils . getItemData ( robotStack ) . setTag ( STRING0 , originalBoardNBT ) ; entityDropItem ( robotStack , NUMBER0 ) ; + if ( itemInUse != null ) { + entityDropItem ( itemInUse , NUMBER0 ) ; + } + for ( ItemStack element : inv ) { + if ( element != null ) { + entityDropItem ( element , NUMBER0 ) ; + } + } getRegistry ( ) . killRobot ( this ) ; }
robots drop their inventory when destroyed
<nb> public class Processor { SINGLE - return env . getFiler ( ) . getResource ( StandardLocation . SOURCE_PATH , - packageElement . getQualifiedName ( ) , - sourceElement . getSimpleName ( ) + STRING0 ) ; + try { + return env . getFiler ( ) . getResource ( StandardLocation . SOURCE_PATH , + packageElement . getQualifiedName ( ) , + sourceElement . getSimpleName ( ) + STRING0 ) ; + } catch ( NullPointerException e ) { + throw new IllegalStateException ( + STRING1 , e ) ; + } + } }
added NPE handling for missing sourcepath
<nb> public final class OSGiSubsystemState implements Serializable { return properties . isEmpty ( ) && modules . isEmpty ( ) ; } - public static class OSGiModule { + public static class OSGiModule implements Serializable { + private static final long serialVersionUID = - NUMBER0 ; + private final ModuleIdentifier identifier ; private final boolean start ;
Fix serialization problem
<nb> COMMENT package NAMESPACE ; + import NAMESPACE ; + import NAMESPACE ; import NAMESPACE ; public class OsgiCamelContextNameStrategy implements CamelContextNameStrategy { + private final AtomicInteger counter = new AtomicInteger ( NUMBER0 ) ; private final String name ; public OsgiCamelContextNameStrategy ( BundleContext context ) { - name = STRING0 + context . getBundle ( ) . getBundleId ( ) ; + name = STRING0 + context . getBundle ( ) . getBundleId ( ) + STRING1 + counter . incrementAndGet ( ) ; } public String getName ( ) {
OSGi CamelContext name strategy is only using bundle id and returns a JMX friendly name
<nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; + COMMENT COMMENT COMMENT <nb> public class SimpleQueryAdapter < T > implements SimpleQuery < SimpleQueryAdapter < T > > private final Projectable projectable ; private final Expr < T > projection ; - + + @ suppresswarnings ( STRING0 ) public < Q extends Query < ? > & Projectable > SimpleQueryAdapter ( Q query , Expr < T > projection ) { + SINGLE this ( query , query , projection ) ; }
added findbugs annotations
<nb> public class Mockito extends Matchers { COMMENT COMMENT COMMENT - public static VerificationAfterDelay after ( int millis ) { + public static VerificationAfterDelay after ( long millis ) { return new After ( millis , VerificationModeFactory . times ( NUMBER0 ) ) ; }
Align Mockito after with Mockito timeout to take a long instead of int
<nb> public class CompileDriver { if ( message != null ) { compileContext . addMessage ( message ) ; } - + if ( isRebuild ) { + CompilerUtil . runInContext ( compileContext , STRING0 , new ThrowableRunnable < Throwable > ( ) { + @ override + public void run ( ) throws Throwable { + CompilerCacheManager . getInstance ( myProject ) . clearCaches ( compileContext ) ; + } + } ) ; + } final boolean beforeTasksOk = executeCompileTasks ( compileContext , true ) ; final int errorCount = compileContext . getMessageCount ( CompilerMessageCategory . ERROR ) ;
on rebuild clear system caches for compilers run internally in IDEA
<nb> public class IssueIndex extends BaseIndex < Issue , FakeIssueDto , String > { if ( createdAfter != null ) { filters . put ( STRING0 , FilterBuilders . rangeFilter ( IssueIndexDefinition . FIELD_ISSUE_FUNC_CREATED_AT ) - . gte ( createdAfter ) ) ; + . gte ( createdAfter ) + . cache ( false ) ) ; } Date createdBefore = query . createdBefore ( ) ; if ( createdBefore != null ) { filters . put ( STRING1 , FilterBuilders . rangeFilter ( IssueIndexDefinition . FIELD_ISSUE_FUNC_CREATED_AT ) - . lte ( createdBefore ) ) ; + . lte ( createdBefore ) + . cache ( false ) ) ; } Date createdAt = query . createdAt ( ) ; if ( createdAt != null ) { - filters . put ( STRING2 , FilterBuilders . termFilter ( IssueIndexDefinition . FIELD_ISSUE_FUNC_CREATED_AT , createdAt ) ) ; + filters . put ( STRING2 , FilterBuilders . termFilter ( IssueIndexDefinition . FIELD_ISSUE_FUNC_CREATED_AT , createdAt ) . cache ( false ) ) ; } }
Disable ES cache on date related filters
<nb> public class DiffContentFactory { @ notnull public static DocumentContent create ( @ notnull String text , @ nullable FileType type ) { Document document = EditorFactory . getInstance ( ) . createDocument ( text ) ; + document . setReadOnly ( true ) ; return new DocumentContentImpl ( document , type , null , null , null ) ; }
create read only documents from string
<nb> public abstract class TrackRenderer implements ExoPlayerComponent { COMMENT COMMENT protected final boolean isSourceReady ( ) { - return stream . isReady ( ) ; + return readEndOfStream ? streamIsFinal : stream . isReady ( ) ; } SINGLE
Handle TrackStream transitions in isSourceReady
<nb> public class NPNModuleTest static { COMMENT + KNOWN_GOOD_NPN_URLS . add ( STRING0 ) ; KNOWN_GOOD_NPN_URLS . add ( STRING1 ) ; KNOWN_GOOD_NPN_URLS . add ( STRING2 ) ; KNOWN_GOOD_NPN_URLS . add ( STRING3 ) ;
Added URL for new NPN version
<nb> public class ByteBufferList { } public ByteBuffer getAll ( ) { + if ( remaining ( ) == NUMBER0 ) + return EMPTY_BYTEBUFFER ; read ( remaining ( ) ) ; return remove ( ) ; }
Fix bug in ByteBuffer getAll if the list is empty
<nb> public abstract class AbstractVcsTestCase { @ override protected void run ( ) throws Throwable { try { - file . setBinaryContent ( newContent . getBytes ( ) ) ; + final long newModTs = Math . max ( System . currentTimeMillis ( ) , file . getModificationStamp ( ) + NUMBER0 ) ; + final long newTs = Math . max ( System . currentTimeMillis ( ) , file . getTimeStamp ( ) + NUMBER0 ) ; + file . setBinaryContent ( newContent . getBytes ( ) , newModTs , newTs ) ; + final File file1 = new File ( file . getPath ( ) ) ; + file1 . setLastModified ( newModTs ) ; } catch ( IOException ex ) { throw new RuntimeException ( ex ) ;
write modification ts when changing files
<nb> public class Pop3Store extends Store private HashMap < String , Folder > mFolders = new HashMap < String , Folder > ( ) ; private Pop3Capabilities mCapabilities ; - SINGLE - SINGLE - SINGLE - SINGLE - SINGLE - SINGLE - SINGLE - SINGLE - SINGLE - COMMENT - SINGLE - SINGLE - SINGLE - SINGLE - SINGLE - SINGLE - SINGLE - SINGLE - SINGLE - SINGLE - SINGLE - SINGLE - COMMENT - SINGLE - COMMENT COMMENT COMMENT <nb> public class Pop3Store extends Store } } - SINGLE - SINGLE - SINGLE - SINGLE - SINGLE - SINGLE - private String readLine ( ) throws IOException { StringBuffer sb = new StringBuffer ( ) ;
Remove commented out code
<nb> public class MessageListFragment extends SherlockFragment implements OnItemClick } case ACTION_RESTORE_LIST_POSITION : { mListView . onRestoreInstanceState ( ( Parcelable ) msg . obj ) ; - mSavedListState = null ; break ; } case ACTION_OPEN_MESSAGE : {
Remove useless assignment
<nb> public interface RobolectricPackageManager { void setNameForUid ( int uid , String name ) ; - void setPackagesForCallingUid ( String [ ] packagesForCallingUid ) ; + void setPackagesForCallingUid ( String . . . packagesForCallingUid ) ; - void setPackagesForUid ( int uid , String [ ] packagesForCallingUid ) ; + void setPackagesForUid ( int uid , String . . . packagesForCallingUid ) ; class ComponentState { public int newState ;
Fix varargs on RobolectricPackageManager
<nb> public class ApkMojo extends AbstractAndroidMojo { SINGLE File destinationDirectory = new File ( outputDirectory . getAbsolutePath ( ) ) ; - if ( destinationDirectory . exists ( ) ) - { - SINGLE - } - else - { - if ( ! destinationDirectory . mkdir ( ) ) ; - { - getLog ( ) . debug ( STRING0 + outputDirectory ) ; - } - } + destinationDirectory . mkdirs ( ) ; SINGLE commands . add ( STRING1 ) ;
Create the directory and any needed parent directories simpler
<nb> public final class InodeFile extends Inode < InodeFile > { COMMENT private InodeFile ( long id ) { super ( NUMBER0 ) ; - mBlocks = new ArrayList < Long > ( NUMBER1 ) ; + mBlocks = new ArrayList < Long > ( NUMBER2 ) ; mBlockContainerId = id ; mBlockSizeBytes = NUMBER0 ; mCacheable = false ;
Use smaller default array size in InodeFile
<nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; <nb> public class TaskContainer extends ComponentContainer { private void addCoreComponents ( ) { SINGLE if ( ! getParent ( ) . getComponentByType ( AnalysisMode . class ) . isSensorMode ( ) ) { - add ( DeprecatedMetricFinder . class ) ; + SINGLE + add ( DeprecatedMetricFinder . class , + PastMeasuresLoader . class ) ; } add ( DefaultMetricFinder . class ) ; <nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; - import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; <nb> public class ProjectScanContainer extends ComponentContainer { SINGLE MeasureCache . class , - PastMeasuresLoader . class , SINGLE new RulesProvider ( ) ,
Move PastMeasureLoader as it is used by dev cockpit
<nb> + 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 package NAMESPACE ; import NAMESPACE ; <nb> + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT package NAMESPACE ; import NAMESPACE ;
Fixed the CS errors of camel cxf
<nb> public final class UpgradeService { StringBuilder changeLog = new StringBuilder ( ) ; if ( from >= V4_4 && from < V4_4_1 ) { - newVersionString ( changeLog , STRING0 , new String [ ] { + newVersionString ( changeLog , STRING1 , new String [ ] { STRING2 , STRING3 } ) ;
Fixed typo in upgrade message
<nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; <nb> public class Utils { COMMENT COMMENT public static boolean isSupporterChannel ( Context context ) { - if ( getChannel ( context ) != SGChannel . STABLE ) { + if ( getChannel ( context ) != SGChannel . STABLE || hasXinstalled ( context ) + || AdvancedSettings . hasPurchasedX ( context ) ) { return true ; } else { return false ; <nb> public class Utils { COMMENT COMMENT COMMENT - public static boolean isSupportingUser ( Context context ) { + public static boolean hasXinstalled ( Context context ) { try { SINGLE PackageManager manager = context . getPackageManager ( ) ;
Also use last upgraded state to enable supporter features
<nb> public class MyRoutes extends RouteBuilder { @ uri ( STRING0 ) private Endpoint resultEndpoint ; - @ inject - private SomeBean someBean ; - @ override public void configure ( ) throws Exception { SINGLE from ( inputEndpoint ) - . bean ( someBean ) + . beanRef ( STRING1 ) . to ( resultEndpoint ) ; } <nb> # # -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- package $ { NAMESPACE } ; + import NAMESPACE ; import NAMESPACE ; @ singleton + @ named ( STRING1 ) public class SomeBean { private int counter ;
Improved the cdi archetype to let the bean be looked up by name
<nb> public abstract class BreakpointWithHighlighter extends Breakpoint { if ( ! isVerified ) { return getInvalidIcon ( ) ; } - return getVerifiedWarningsIcon ( ) ; SINGLE + return getVerifiedWarningsIcon ( ) ; } if ( isVerified ) {
remove obsolete todo message
<nb> package NAMESPACE ; COMMENT public class Runtime { public static Runtime getRuntime ( ) { - throw new UnsupportedOperationException ( STRING0 ) ; + return new Runtime ( ) ; } public long totalMemory ( ) { - throw new UnsupportedOperationException ( STRING1 ) ; + return NUMBER0 ; } public long freeMemory ( ) { - throw new UnsupportedOperationException ( STRING2 ) ; + return NUMBER0 ; } }
Have Runtime return values rather than throwing for the no op GWT version
<nb> public class Ray implements Serializable { public final Vector3 origin = new Vector3 ( ) ; public final Vector3 direction = new Vector3 ( ) ; + public Ray ( ) { } + COMMENT COMMENT COMMENT
Add no arg constructor
<nb> public class Person { private long personID ; private int localTableBlogId ; - - private String username ; private String displayName ; private String avatarUrl ; + private PersonType personType ; + + SINGLE private String role ; + + SINGLE + private String username ; + + SINGLE private String subscribed ; - private PersonType personType ; public Person ( long personID , int localTableBlogId ) { this . personID = personID ;
Adds comments to Person properties to explain which belong to which type
<nb> package NAMESPACE ; import NAMESPACE ; - import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; <nb> public class TablePropertyManager SINGLE BlockBuilder blockBuilder = expectedType . createBlockBuilder ( new BlockBuilderStatus ( ) , NUMBER0 ) ; - BlockUtils . appendObject ( expectedType , blockBuilder , value ) ; + blockBuilder . write ( expectedType , value ) ; Object objectValue = expectedType . getObjectValue ( session . toConnectorSession ( ) , blockBuilder , NUMBER1 ) ; if ( objectValue == null ) {
Fix BlockUtils merge issue
<nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; <nb> public class TraitASTTransformation extends AbstractASTTransformation implements if ( Traits . isTrait ( superClass ) ) { SINGLE cNode . setSuperClass ( ClassHelper . OBJECT_TYPE ) ; - cNode . addInterface ( superClass ) ; + SINGLE + cNode . addInterface ( GenericsUtils . nonGeneric ( superClass ) ) ; resolveScope ( cNode ) ; } }
Cannot extend trait with generic parameter
<nb> public class TestNGRunnableState extends JavaCommandLineState LOGGER . info ( STRING0 + is15 ) ; SINGLE - javaParameters . getClassPath ( ) . add ( new File ( PathManager . getPluginsPath ( ) , - STRING1 ) . getPath ( ) ) ; - javaParameters . getClassPath ( ) . add ( new File ( PathManager . getPluginsPath ( ) , is15 - ? STRING2 - : STRING3 ) . getPath ( ) ) ; + javaParameters . getClassPath ( ) . add ( new File ( PathManager . getPreinstalledPluginsPath ( ) , + STRING4 ) . getPath ( ) ) ; + javaParameters . getClassPath ( ) . add ( new File ( PathManager . getPreinstalledPluginsPath ( ) , is15 + ? STRING5 + : STRING6 ) . getPath ( ) ) ; SINGLE JavaParametersUtil . configureConfiguration ( javaParameters , config ) ;
Use the internal plugin path to lookup testng jar files
<nb> public class MBeanCpuUsageReporter { } if ( currentSafePointCount > NUMBER0 ) { if ( currentSafePointCount == lastSafePointCount ) { - sb . append ( String . format ( STRING0 ) ) ; + sb . append ( String . format ( STRING1 ) ) ; } else { double spRate = ( TimeUnit . SECONDS . toNanos ( NUMBER1 ) * ( double ) ( currentSafePointCount - lastSafePointCount ) ) / timeSplit ;
Missed line end in ttop report
<nb> public class TestExchangeClient assertStatus ( exchangeClient . getStatus ( ) . getPageBufferClientStatuses ( ) . get ( NUMBER0 ) , location , STRING0 , NUMBER1 , NUMBER2 , NUMBER2 , STRING1 ) ; } - @ test + @ test ( timeOut = NUMBER3 ) public void testAddLocation ( ) throws Exception { <nb> public class TestExchangeClient assertEquals ( exchangeClient . isClosed ( ) , false ) ; exchangeClient . noMoreLocations ( ) ; - assertEquals ( exchangeClient . isClosed ( ) , true ) ; + SINGLE + SINGLE + while ( ! exchangeClient . isClosed ( ) ) { + Thread . sleep ( NUMBER4 ) ; + } ImmutableMap < URI , PageBufferClientStatus > statuses = uniqueIndex ( exchangeClient . getStatus ( ) . getPageBufferClientStatuses ( ) , PageBufferClientStatus : : getUri ) ; assertStatus ( statuses . get ( location1 ) , location1 , STRING0 , NUMBER1 , NUMBER2 , NUMBER2 , STRING1 ) ;
Fix race condition in TestExchangeClient
<nb> public class GLM2 extends Job . ModelJobWithoutClassificationField { if ( _lbs [ i ] > NUMBER0 ) throw new IllegalArgumentException ( STRING0 ) ; if ( _srcDinfo . _normMul != null ) { for ( int i = numoff ; i < _srcDinfo . fullN ( ) ; ++ i ) { - if ( Double . isInfinite ( _ubs [ i ] ) ) continue ; + if ( Double . isInfinite ( _lbs [ i ] ) ) continue ; _lbs [ i ] /= _srcDinfo . _normMul [ i - numoff ] ; } }
Fix omitted in my latest commit
<nb> public class FindPath implements SingleSourceSingleSinkShortestPath < Integer > { dijkstra . setStartNode ( startNode ) ; } + + public void limitMaxCostToTraverse ( MaxCostEvaluator < Integer > evaluator ) + { + dijkstra . limitMaxCostToTraverse ( evaluator ) ; + } + COMMENT COMMENT COMMENT
Exposed the cost limit
<nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; <nb> public enum FileSystemContext { } catch ( AlluxioException e ) { throw new IOException ( e ) ; } + if ( infos . isEmpty ( ) ) { + throw new IOException ( ExceptionMessage . NO_WORKER_AVAILABLE . getMessage ( ) ) ; + } SINGLE List < WorkerNetAddress > workerNetAddresses = new ArrayList < > ( ) ;
Throw an exception if there are no workers available when requesting workers
<nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; + import NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; @ path ( STRING0 ) public class GeocoderResource { + @ injectparam @ setter private Geocoder geocoder ; - public void setGeocoder ( Geocoder geocoder ) { - this . geocoder = geocoder ; - } - @ get - @ produces ( { MediaType . APPLICATION_XML + STRING1 , MediaType . APPLICATION_JSON + STRING1 } ) + @ produces ( { MediaType . APPLICATION_JSON + STRING1 } ) public GeocoderResults geocode ( @ queryparam ( STRING2 ) String address , @ queryparam ( STRING3 ) String bbox ) {
inject specific handler remove XML support
<nb> public class CxfEndpointBeanBusSettingTest extends AbstractSpringBeanTestSupport assertEquals ( cxf2 , endpoint . getBus ( ) ) ; assertEquals ( STRING0 , endpoint . getBus ( ) . getProperty ( STRING1 ) ) ; + + } + + @ test + public void testBusInjectionOnURI ( ) throws Exception { + CamelContext camelContext = ( CamelContext ) ctx . getBean ( STRING2 ) ; + CxfEndpoint endpoint = camelContext . getEndpoint ( STRING3 , CxfEndpoint . class ) ; + assertEquals ( ctx . getBean ( STRING4 ) , endpoint . getBus ( ) ) ; + + endpoint = camelContext . getEndpoint ( STRING5 + port1 + STRING6 , CxfEndpoint . class ) ; + assertEquals ( ctx . getBean ( STRING4 ) , endpoint . getBus ( ) ) ; }
Added an unit test to verify the bus setting of camel cxf endpoint
<nb> public class LineageFileSystem extends BaseFileSystem { COMMENT COMMENT public static synchronized LineageFileSystem get ( ) { - return new LineageFileSystem ( ) ; + return new LineageFileSystem ( FileSystemContext . INSTANCE , LineageContext . INSTANCE ) ; } - protected LineageFileSystem ( ) { - super ( FileSystemContext . INSTANCE ) ; - mLineageContext = LineageContext . INSTANCE ; + protected LineageFileSystem ( FileSystemContext fileSystemContext , LineageContext lineageContext ) { + super ( fileSystemContext ) ; + mLineageContext = lineageContext ; } COMMENT
Dependency inject a bit more
<nb> public class BaseBulletTest extends BulletTest { public ModelBuilder modelBuilder = new ModelBuilder ( ) ; public ModelBatch modelBatch ; public Array < Disposable > disposables = new Array < Disposable > ( ) ; - private int debugMode = DebugDrawModes . DBG_DrawFeaturesText ; + private int debugMode = DebugDrawModes . DBG_NoDebug ; protected final static Vector3 tmpV1 = new Vector3 ( ) , tmpV2 = new Vector3 ( ) ;
Fix bullet tests
<nb> public class ProducteevSyncProvider extends SyncProvider < ProducteevTaskContainer SINGLE if ( remote . task . hasDueDate ( ) && remote . task . getValue ( Task . DUE_DATE ) < DateUtilities . now ( ) ) remote . task . setFlag ( Task . REMINDER_FLAGS , Task . NOTIFY_AFTER_DEADLINE , false ) ; - boolean foundLocal = dataService . findLocalMatch ( remote ) ; - - SINGLE - if ( userId != remote . pdvTask . getValue ( ProducteevTask . CREATOR_ID ) && - userId != remote . pdvTask . getValue ( ProducteevTask . RESPONSIBLE_ID ) ) - remote . task . setFlag ( Task . FLAGS , Task . FLAG_IS_READONLY , true ) ; - else - remote . task . setFlag ( Task . FLAGS , Task . FLAG_IS_READONLY , false ) ; remoteTasks . add ( remote ) ; }
fix reference to read only patch that we haven t pulled yet
<nb> public final class Iterables { COMMENT COMMENT - COMMENT + COMMENT + COMMENT COMMENT COMMENT COMMENT <nb> public final class Iterables { COMMENT COMMENT - COMMENT + COMMENT + COMMENT COMMENT COMMENT COMMENT
Document the advantages of Iterables frequency
<nb> public class NetworkUtils COMMENT private static final Random random = new Random ( ) ; + static + { + String prefer6 = System . getProperty ( STRING0 ) ; + String prefer4 = System . getProperty ( STRING1 ) ; + logger . info ( STRING2 + prefer6 ) ; + logger . info ( STRING3 + prefer4 ) ; + } + COMMENT COMMENT COMMENT
Log Java IP stack properties
<nb> public class GremlinPluginFunctionalTest implements GraphHolder public void setVariables ( ) throws UnsupportedEncodingException { String payload = STRING0 - + STRING1 ; + + STRING2 ; String response = gen . get ( ) . expectedStatus ( Status . OK . getStatusCode ( ) ) . payload ( JSONPrettifier . parse ( payload ) ) . payloadType ( MediaType . APPLICATION_JSON_TYPE ) . post ( ENDPOINT ) . entity ( ) ; - assertTrue ( response . contains ( STRING3 ) ) ; + assertTrue ( response . contains ( STRING4 ) ) ; }
choosing a longer number to fool the HTML manual formatter
<nb> public class MixinTransformation implements ASTTransformation { } } - List < PropertyNode > properties = mixinClassNode . getProperties ( ) ; - System . out . println ( STRING0 + properties ) ; - for ( PropertyNode property : properties ) { - System . out . println ( STRING1 + property ) ; - } - mixinClassNode = mixinClassNode . getSuperClass ( ) ; } }
remove println statements from new Mixin impl
<nb> public class FakeVertxMetrics implements VertxMetrics { } public void verticleDeployed ( Verticle verticle ) { - throw new UnsupportedOperationException ( ) ; } public void verticleUndeployed ( Verticle verticle ) { - throw new UnsupportedOperationException ( ) ; } public void timerCreated ( long id ) {
Remove UnsupportedOperationException from verticle life cycle FakeMetrics SPI
<nb> public class ConsoleViewImpl extends JPanel implements ConsoleView , ObservableCo } if ( myFlushAlarm . isDisposed ( ) ) return ; cancelAllFlushRequests ( ) ; - addFlushRequest ( new MyClearRunnable ( ) ) ; + UIUtil . invokeLaterIfNeeded ( new MyClearRunnable ( ) ) ; cancelHeavyAlarm ( ) ; }
fixed the Analyze stacktrace race condition differently
<nb> public abstract class IntentBuilder < I extends IntentBuilder < I > > extends Builder return ( I ) this ; } + public I type ( String type ) { + intent . setType ( type ) ; + return ( I ) this ; + } + public I extra ( String name , boolean value ) { intent . putExtra ( name , value ) ; return ( I ) this ;
Added type method to IntentBuilder class
<nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; - import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; <nb> public class AggregateOperation < T > extends BaseOperation < MongoCursor < T > > { this . pipeline = pipeline ; this . options = options ; command = asCommandDocument ( ) ; - ReadPreferenceServerSelector serverSelector = new ReadPreferenceServerSelector ( readPreference ) ; - connectionProvider = session . createServerConnectionProvider ( new ServerConnectionProviderOptions ( false , serverSelector ) ) ; + connectionProvider = getConnectionProvider ( readPreference ) ; serverAddress = connectionProvider . getServerDescription ( ) . getAddress ( ) ; }
Updated AggregateOperation to use the new read preference selector helper
<nb> public class ListsDialogFragment extends DialogFragment implements SINGLE throw new RuntimeException ( STRING0 , e ) ; } + + getActivity ( ) . getContentResolver ( ) . notifyChange ( ListItems . CONTENT_WITH_DETAILS_URI , null ) ; dismiss ( ) ; }
Notify content provider on correct uri
<nb> public class MetricsManager return nameSanitizationRegex . matcher ( name ) . replaceAll ( STRING0 ) ; SINGLE } - public MetricRegistry getRegistry ( ) + protected MetricRegistry getRegistry ( ) { return registry ; }
Fix accessibility of getRegistry
<nb> public class ReaderPostAdapter extends RecyclerView . Adapter < RecyclerView . ViewHol } private boolean hasTagHeader ( ) { - return mCurrentTag != null && mCurrentTag . isTagTopic ( ) ; + return mCurrentTag != null && mCurrentTag . isTagTopic ( ) && ! isEmpty ( ) ; } private boolean isDiscover ( ) {
Don t show tag header when no posts
<nb> public class SSHMain implements GitExternalApp { @ override public String toString ( ) { return String - . format ( STRING0 , myHost , myHandlerNo , myCommand , + . format ( STRING1 , myHost , myHandlerNo , myCommand , myExitCode , myLastError ) ; }
Malformed format string warning fixed
<nb> public final class Posix implements Os { } ] - * / ; - public native void close ( FileDescriptor javaFd ) throws ErrnoException ; + public native void close ( FileDescriptor javaFd ) throws ErrnoException COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT + COMMENT ; public native FileDescriptor dup ( FileDescriptor oldFd ) throws ErrnoException / * - [ int nativeFd = TEMP_FAILURE_RETRY ( dup ( ( int ) oldFd - > descriptor_ ) ) ;
Fixed repository sync error
<nb> public class DateUtils implements DateConstants { Date retVal = null ; try { - String newString = input . replace ( STRING0 , STRING1 ) . replace ( STRING2 , STRING1 ) . replace ( STRING3 , STRING1 ) . replace ( + String newString = input . trim ( ) . replace ( STRING0 , STRING1 ) . replace ( STRING2 , STRING1 ) . replace ( STRING3 , STRING1 ) . replace ( STRING4 , STRING1 ) ; if ( newString != null ) { List < String > dl = DF_LIST ; <nb> public class DateUtils implements DateConstants { } public synchronized static Date parseDate ( SimpleDateFormat sdf , String string ) { - sdf . setLenient ( true ) ; + sdf . setLenient ( false ) ; try { return sdf . parse ( string ) ; } catch ( Exception e ) {
turn off lenient date parsing so yyyy mm dd is not parsed as mm dd yyyy
<nb> public class XmlTagInsertHandler implements InsertHandler < LookupElement > { } } } - else if ( attributeDecl . isFixed ( ) && attributeDecl . getDefaultValue ( ) != null && ! htmlCode ) { + else if ( attributeDecl . isRequired ( ) && attributeDecl . isFixed ( ) && attributeDecl . getDefaultValue ( ) != null && ! htmlCode ) { template . addTextSegment ( STRING0 + attributeName + STRING1 + attributeDecl . getDefaultValue ( ) + STRING2 ) ; } }
do not complete fixed attributes if they are optional
<nb> public class LocalStore extends Store { if ( isOpen ( ) ) { return ; } - if ( ! exists ( ) ) { - } Cursor cursor = null ; try { cursor = mDb . rawQuery ( STRING0
removing that empty call to the heavy query helps performance even more
<nb> public class StructuralReplaceTest extends StructuralReplaceTestCase { actualResult ) ; - String s55 = STRING0 + + String s55 = STRING1 + STRING2 + STRING3 + STRING4 ;
replace LOG assert with NotNull cleanup
<nb> public final class BluetoothGatt implements BluetoothProfile { COMMENT for ( BluetoothGattService svc : mServices ) { for ( BluetoothGattCharacteristic charac : svc . getCharacteristics ( ) ) { - Log . w ( TAG , STRING0 + charac . getInstanceId ( ) + STRING1 + instanceId ) ; if ( charac . getInstanceId ( ) == instanceId ) return charac ; }
Fix log spam in getCharacteristicById
<nb> public abstract class TerasologyTestingEnvironment { private static ModuleManager moduleManager ; private static AssetManager assetManager ; - private static DisplayEnvironment env ; + private static HeadlessEnvironment env ; private EngineEntityManager engineEntityManager ; private ComponentSystemManager componentSystemManager ; <nb> public abstract class TerasologyTestingEnvironment { if ( ! setup ) { setup = true ; - env = new DisplayEnvironment ( ) ; + env = new HeadlessEnvironment ( ) ; assetManager = CoreRegistry . get ( AssetManager . class ) ; blockManager = CoreRegistry . get ( BlockManager . class ) ; config = CoreRegistry . get ( Config . class ) ;
Use headless env
<nb> public class AnnotationSetRefPool { public int getOffset ( @ nonnull Method method ) { Key annotationSetRefKey = new Key ( method ) ; - Integer offset = internedAnnotationSetRefItems . put ( annotationSetRefKey , NUMBER0 ) ; + Integer offset = internedAnnotationSetRefItems . get ( annotationSetRefKey ) ; if ( offset == null ) { throw new ExceptionWithContext ( STRING0 ) ; }
Fix AnnotationSetRefPool getOffset
<nb> import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; public class WelcomeScreen extends Activity implements Eula . EulaCallback { <nb> public class WelcomeScreen extends Activity implements Eula . EulaCallback { requestWindowFeature ( Window . FEATURE_NO_TITLE ) ; super . onCreate ( savedInstanceState ) ; + new StartupService ( ) . onStartupApplication ( this ) ; setContentView ( R . layout . welcome_screen ) ; if ( Preferences . getBoolean ( Eula . PREFERENCE_EULA_ACCEPTED , false ) ) {
Call startup service from welcome screen
<nb> public class GestureLibrary { return mOrientationStyle ; } - public void setGestureType ( int type ) { + COMMENT + COMMENT + COMMENT + public void setSequenceType ( int type ) { mSequenceType = type ; } - public int getGestureType ( ) { + COMMENT + COMMENT + COMMENT + public int getSequenceType ( ) { return mSequenceType ; } <nb> public class LetterRecognizer { public void enablePersonalization ( boolean enable ) { if ( enable ) { mGestureLibrary = new GestureLibrary ( GESTURE_FILE_NAME ) ; - mGestureLibrary . setGestureType ( GestureLibrary . SEQUENCE_INVARIANT ) ; + mGestureLibrary . setSequenceType ( GestureLibrary . SEQUENCE_INVARIANT ) ; mGestureLibrary . load ( ) ; } else { mGestureLibrary = null ;
Renamed setGestureType in GestureLibrary
<nb> class LwjglGLDebugOutputHandler implements ARBDebugOutputCallback . Handler { String severityStr = constMap . get ( severity ) ; System . err . println ( String . format ( MESSAGE_FORMAT , id , sourceStr , typeStr , severityStr , message ) ) ; + Thread . dumpStack ( ) ; } }
dump stack on debug messages
<nb> public class Main { for ( int i = NUMBER0 ; i < elem . length ; i ++ ) { msg += elem [ i ] . toString ( ) + STRING0 ; } - JOptionPane . showMessageDialog ( null , msg , STRING1 , JOptionPane . ERROR_MESSAGE ) ; + DialogThread dt = new DialogThread ( msg ) ; + dt . start ( ) ; e . printStackTrace ( ) ; throw new RuntimeException ( e ) ; }
put error message in its own thread to avoid focus problems mouse click on OK button didn t work
<nb> package NAMESPACE ; import static NAMESPACE ; import NAMESPACE ; + import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; import NAMESPACE ; <nb> public class MergeAndroidResourcesStep implements Step { if ( uberRDotTxtIds . isPresent ( ) ) { Preconditions . checkNotNull ( finalIds ) ; if ( ! finalIds . containsKey ( resource ) ) { - context . logError ( - new RuntimeException ( ) , - STRING0 , resource ) ; + context . postEvent ( ConsoleEvent . warning ( + STRING0 , resource ) ) ; continue ; } resource = resource . copyWithNewIdValue ( finalIds . get ( resource ) ) ;
Change the log level from SEVERE to WARNING for resource not found error
<nb> public class ConfigurationProperty { return Integer . valueOf ( ( String ) value ) ; } else if ( type . equals ( BigDecimal . class ) ) { return new BigDecimal ( ( String ) value ) ; + } else if ( type . equals ( Long . class ) ) { + return new Long ( ( String ) value ) ; } else { throw new UnexpectedLiquibaseException ( STRING0 + type . getSimpleName ( ) + STRING1 + type . getSimpleName ( ) ) ; }
When using the system property
<nb> import NAMESPACE ; public class Settings { public static final float MAX_ZOOM = FLOAT0 ; - public static final float OVERZOOM_FACTOR = FLOAT1 ; + public static final float OVERZOOM_FACTOR = FLOAT0 ; COMMENT COMMENT
Increasing default overzoom factor