diff
stringlengths 38
1.78k
| msg_token
stringlengths 9
190
|
|---|---|
<nb> public class CodegenTestsOnAndroidRunner {
downloader . downloadAll ( ) ;
downloader . unzipAll ( ) ;
- PermissionManager . setPermissions ( pathManager ) ;
-
String platformPrefixProperty = System . setProperty ( PlatformUtils . PLATFORM_PREFIX_KEY , STRING0 ) ;
try {
+ PermissionManager . setPermissions ( pathManager ) ;
+
antRunner . packLibraries ( ) ;
emulator . createEmulator ( ) ;
|
Fix Android tests
|
<nb> public class ColumnSnapshotGenerator extends JdbcSnapshotGenerator {
SINGLE
} else if ( dataType . equalsIgnoreCase ( STRING0 ) || dataType . equalsIgnoreCase ( STRING1 ) ) {
SINGLE
- type . setColumnSize ( type . getColumnSize ( ) / NUMBER0 ) ;
+ type . setColumnSize ( columnMetadataResultSet . getInt ( STRING2 ) ) ;
type . setColumnSizeUnit ( DataType . ColumnSizeUnit . CHAR ) ;
} else {
String charUsed = columnMetadataResultSet . getString ( STRING3 ) ;
|
Fix size retrieval for NCHAR and NVARCHAR
|
<nb> public class SwitchStatementDensityInspection extends StatementInspection {
public int m_limit = DEFAULT_DENSITY_LIMIT ; SINGLE
public String getDisplayName ( ) {
- return STRING0 ;
+ return STRING1 ;
}
public String getGroupDisplayName ( ) {
<nb> public class SwitchStatementDensityInspection extends StatementInspection {
final PsiSwitchStatement statement = ( PsiSwitchStatement ) location . getParent ( ) ;
final double density = calculateDensity ( statement ) ;
final int intDensity = ( int ) ( density * FLOAT0 ) ;
- return STRING2 + intDensity + STRING3 ;
+ return STRING4 + intDensity + STRING3 ;
}
public BaseInspectionVisitor buildVisitor ( ) {
<nb> public class SwitchStatementDensityInspection extends StatementInspection {
private class SwitchStatementWithTooFewBranchesVisitor extends StatementInspectionVisitor {
-
public void visitSwitchStatement ( @ notnull PsiSwitchStatement statement ) {
final PsiCodeBlock body = statement . getBody ( ) ;
if ( body == null ) {
|
Change wording for switch branch density inspection
|
<nb> public class TestQueryDriversOperator
}
}
- @ test
+ @ test ( enabled = false ) SINGLE
public void testCancel ( )
throws Exception
{
|
Disable broken test
|
<nb> public final class StringDeserializer extends StdScalarDeserializer < String >
if ( p . hasToken ( JsonToken . VALUE_STRING ) ) {
return p . getText ( ) ;
}
+ JsonToken t = p . getCurrentToken ( ) ;
SINGLE
- if ( p . isExpectedStartArrayToken ( ) && ctxt . isEnabled ( DeserializationFeature . UNWRAP_SINGLE_VALUE_ARRAYS ) ) {
+ if ( ( t == JsonToken . START_ARRAY ) && ctxt . isEnabled ( DeserializationFeature . UNWRAP_SINGLE_VALUE_ARRAYS ) ) {
p . nextToken ( ) ;
final String parsed = _parseString ( p , ctxt ) ;
if ( p . nextToken ( ) != JsonToken . END_ARRAY ) {
<nb> public final class StringDeserializer extends StdScalarDeserializer < String >
}
return parsed ;
}
- SINGLE
- if ( p . hasToken ( JsonToken . VALUE_EMBEDDED_OBJECT ) ) {
+ SINGLE
+ if ( t == JsonToken . VALUE_EMBEDDED_OBJECT ) {
Object ob = p . getEmbeddedObject ( ) ;
if ( ob == null ) {
return null ;
|
Undo part of change done for StringDeserializer caused issues with XML handling
|
<nb> public class ApkMojo extends AbstractAndroidMojo {
COMMENT
COMMENT
private String renameManifestPackage ;
+
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ private String renameInstrumentationTargetPackage ;
COMMENT
COMMENT
<nb> public class ApkMojo extends AbstractAndroidMojo {
}
if ( StringUtils . isNotBlank ( renameManifestPackage ) ) {
- commands . add ( STRING0 ) ;
- commands . add ( renameManifestPackage ) ;
+ commands . add ( STRING0 ) ;
+ commands . add ( renameManifestPackage ) ;
+ }
+
+ if ( StringUtils . isNotBlank ( renameInstrumentationTargetPackage ) ) {
+ commands . add ( STRING1 ) ;
+ commands . add ( renameInstrumentationTargetPackage ) ;
}
commands . add ( STRING2 ) ;
|
Adding support for rename instrumentation target package
|
<nb> public class View implements Drawable . Callback , KeyEvent . Callback , Accessibility
}
mPrivateFlags |= FORCE_LAYOUT ;
+ mPrivateFlags |= INVALIDATED ;
if ( mParent != null && ! mParent . isLayoutRequested ( ) ) {
mParent . requestLayout ( ) ;
<nb> public class View implements Drawable . Callback , KeyEvent . Callback , Accessibility
COMMENT
public void forceLayout ( ) {
mPrivateFlags |= FORCE_LAYOUT ;
+ mPrivateFlags |= INVALIDATED ;
}
COMMENT
|
Fix bug with display lists and layout
|
<nb>
package NAMESPACE ;
import NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
|
Fix missing Date import in Restore java
|
<nb> public class HttpRequest {
Log . d ( ACRA . LOG_TAG , STRING0 + url ) ;
+ SINGLE
+ SINGLE
+ SINGLE
final HttpResponse response = httpClient . execute ( httpPost , localContext ) ;
if ( response != null ) {
final StatusLine statusLine = response . getStatusLine ( ) ;
|
Added comment to HttpRequest may have found cause of multiple report notifications
|
<nb> public class H2ODriver extends Configured implements Tool {
conf . set ( STRING0 , STRING1 ) ;
conf . set ( STRING2 , STRING1 ) ;
+ conf . set ( STRING3 , jobtrackerName ) ;
SINGLE
SINGLE
Job job = new Job ( conf , jobtrackerName ) ;
- conf . set ( STRING4 , jobtrackerName ) ;
job . setJarByClass ( getClass ( ) ) ;
job . setInputFormatClass ( H2OInputFormat . class ) ;
job . setMapperClass ( H2OMapper . class ) ;
<nb> public class H2OMapper extends Mapper < Text , Text , Text , Text > {
counterThread . start ( ) ;
String ice_root = conf . get ( STRING5 ) ;
- String jobtrackerName = conf . get ( STRING4 ) ;
+ String jobtrackerName = conf . get ( STRING3 ) ;
context . write ( textId , new Text ( STRING6 + ice_root ) ) ;
String [ ] args = {
|
Fix setting of jobtrackername
|
<nb> public class CredentialsAPI implements
. setPasswordLoginSupported ( true ) ;
if ( ! onlyPasswords ) {
- crBuilder . setAccountTypes ( IdentityProviders . GOOGLE ) ;
+ crBuilder . setAccountTypes (
+ IdentityProviders . GOOGLE ,
+ IdentityProviders . TWITTER ,
+ IdentityProviders . FACEBOOK ) ;
}
showProgress ( ) ;
|
Add Twitter and Facebook IDP SmartLock support
|
<nb> public class DesktopSharingButton
JMenuItem shareRegion = new JMenuItem ( GuiActivator . getResources ( )
. getI18NString ( STRING0 ) ) ;
- shareRegion . setEnabled ( false ) ;
-
popupMenu . add ( shareFullScreen ) ;
popupMenu . add ( shareRegion ) ;
<nb> public class DesktopSharingButton
return popupMenu ;
}
- }
+ }
<nb> public class MetaContactRightButtonMenu
{
add ( multiContactFullShareMenu ) ;
add ( multiContactRegionShareMenu ) ;
-
- multiContactRegionShareMenu . setEnabled ( false ) ;
}
else
{
<nb> public class MetaContactRightButtonMenu
. getI18NString ( STRING0 ) ,
STRING1 ,
null ) ;
- menuItem . setEnabled ( false ) ;
+
contactDesktopSharingMenu . add ( menuItem ) ;
add ( contactDesktopSharingMenu ) ;
|
Enables zone desktop sharing
|
<nb> public class App extends CordovaPlugin {
COMMENT
COMMENT
public void clearHistory ( ) {
- this . webView . clearHistory ( ) ;
+ cordova . getActivity ( ) . runOnUiThread ( new Runnable ( ) {
+ public void run ( ) {
+ webView . clearHistory ( ) ;
+ }
+ } ) ;
}
COMMENT
|
Wrapping this so it runs on the UI thread
|
<nb> public static class SyntaxQuoteReader extends AFn {
throw new IllegalStateException ( STRING0 ) ;
else if ( form instanceof IPersistentCollection )
{
- if ( form instanceof IPersistentMap )
+ if ( form instanceof IRecord )
+ ret = form ;
+ else if ( form instanceof IPersistentMap )
{
IPersistentVector keyvals = flattenMap ( form ) ;
ret = RT . list ( APPLY , HASHMAP , RT . list ( SEQ , RT . cons ( CONCAT , sqExpandList ( keyvals . seq ( ) ) ) ) ) ;
|
syntax quote was walking records returning maps
|
<nb> import NAMESPACE ;
import 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 ;
- import NAMESPACE ;
- import NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> final class TestNodeRegistry {
final Packet packet = ( Packet ) socketWritable ;
if ( nodeEngine . getNode ( ) . isActive ( ) ) {
packet . setConn ( thisConnection ) ;
+ MemberImpl member = nodeEngine . getClusterService ( ) . getMember ( thisAddress ) ;
+ if ( member != null ) {
+ member . didRead ( ) ;
+ }
nodeEngine . handlePacket ( packet ) ;
return true ;
}
|
Test framework should set MemberImpl lastRead time when a packet is sent
|
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> public abstract class AbstractVcsTestCase {
}
Collections . addAll ( arguments , commandLine ) ;
if ( myTraceClient ) {
- System . out . println ( STRING0 + StringUtil . join ( arguments , STRING1 ) ) ;
+ System . out . println ( STRING0 + arguments ) ;
}
final ProcessBuilder builder = new ProcessBuilder ( ) . command ( arguments ) ;
if ( workingDir != null ) {
|
further debugging blinking perforce tests
|
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
- import NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
+ import NAMESPACE ;
public abstract class MultiTenantConfigBase {
|
fix wrong imports in MultiTenantConfigBase
|
<nb> public class TaskListFragment extends ListFragment implements OnScrollListener ,
}
case CONTEXT_MENU_DELETE_TASK_ID : {
itemId = item . getGroupId ( ) ;
- Task task = new Task ( ) ;
- task . setId ( itemId ) ;
+ Task task = taskService . fetchById ( itemId , Task . ID , Task . UUID ) ;
deleteTask ( task ) ;
return true ;
}
|
Fixed a bug that could mess up order hierarchy when deleting tasks
|
<nb> public class TupleImpl extends IndifferentAccessMap implements Seqable , Indexed ,
}
public boolean isTick ( ) {
- return this . getSourceComponent ( ) . equals ( Constants . SYSTEM_COMPONENT_ID ) &&
- this . getSourceStreamId ( ) . equals ( Constants . SYSTEM_TICK_STREAM_ID ) ;
+ return Constants . SYSTEM_COMPONENT_ID . equals ( this . getSourceComponent ( ) ) &&
+ Constants . SYSTEM_TICK_STREAM_ID . equals ( this . getSourceStreamId ( ) ) ;
}
public MessageId getMessageId ( ) {
|
Resolve NPE that can occur if there is no SourceComponent in a Tuple
|
<nb> public class ODocument extends ORecordSchemaAwareAbstract < Object > implements Ite
return ( ODocument ) this ;
}
- @ override
- public void unsetDirty ( ) {
- _fieldOriginalValues = null ;
- _fieldCollectionChangeTimeLines = null ;
- super . unsetDirty ( ) ;
- }
-
COMMENT
COMMENT
COMMENT
<nb> public class DocumentTrackingTest {
document . unsetDirty ( ) ;
- Assert . assertEquals ( document . getDirtyFields ( ) , new String [ ] { } ) ;
+ SINGLE
Assert . assertFalse ( document . isDirty ( ) ) ;
- Assert . assertNull ( document . getCollectionTimeLine ( STRING0 ) ) ;
+ SINGLE
}
public void testReload ( ) {
|
once a hook changed the document the unsetDirty method was called that reset tracked collection
|
<nb> public class DefaultGroovyStaticMethods {
COMMENT
COMMENT
COMMENT
- COMMENT
+ COMMENT
COMMENT
protected static void sleepImpl ( Object object , long millis , Closure closure ) {
long start = System . currentTimeMillis ( ) ;
<nb> public class DefaultGroovyStaticMethods {
COMMENT
COMMENT
COMMENT
- COMMENT
+ COMMENT
COMMENT
public static void sleep ( Object object , long milliseconds , Closure onInterrupt ) {
sleepImpl ( object , milliseconds , onInterrupt ) ;
|
Corrected javadoc for sleep
|
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
+ COMMENT
+ COMMENT
+ COMMENT
public class ListManageDialogFragment extends DialogFragment {
public static ListManageDialogFragment newInstance ( String listId ) {
<nb> public class ListManageDialogFragment extends DialogFragment {
@ override
public void onStart ( ) {
super . onStart ( ) ;
- EasyTracker . getTracker ( ) . trackView ( STRING0 ) ;
+ EasyTracker . getTracker ( ) . sendView ( STRING0 ) ;
}
@ override
|
Properly send view for list manage dialog add description
|
<nb> public class JavaSourceCodehausPackagesSuite {
suite . addTestSuite ( ForTest . class ) ;
suite . addTestSuite ( GetPropertyTest . class ) ;
suite . addTestSuite ( GroovyTest . class ) ;
- suite . addTestSuite ( GroovycTest . class ) ;
+ SINGLE
suite . addTestSuite ( GroovyClassLoaderTest . class ) ;
suite . addTestSuite ( GroovyDocToolTest . class ) ;
suite . addTestSuite ( GroovySourceASTTest . class ) ;
|
Temporarily remove the Groovyc test to avoid a broken build
|
<nb> public interface RequestSpec {
URI getUrl ( ) ;
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
default RequestSpec connectTimeoutSeconds ( int seconds ) {
return connectTimeout ( Duration . of ( seconds , SECONDS ) ) ;
}
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
RequestSpec connectTimeout ( Duration duration ) ;
default RequestSpec readTimeoutSeconds ( int seconds ) {
|
Javadoc for http client connect timeout
|
<nb> public class Ouya {
try {
Class < ? > buildClass = Class . forName ( STRING0 ) ;
Field deviceField = buildClass . getDeclaredField ( STRING1 ) ;
- isOuya = STRING2 . equals ( deviceField . get ( null ) ) ;
+ Object device = deviceField . get ( null ) ;
+ isOuya = STRING3 . equals ( device ) || STRING2 . equals ( device ) ;
} catch ( Exception e ) {
}
runningOnOuya = isOuya ;
<nb> public class Ouya {
AXIS_RIGHT_TRIGGER = NUMBER0 ;
}
}
- }
+ }
|
Added check for new OUYA device name
|
<nb> public class PeerGroup extends AbstractIdleService implements TransactionBroadca
SINGLE
SINGLE
@ guardedby ( STRING0 ) private int maxConnections ;
+ SINGLE
+ private volatile int vMinRequiredProtocolVersion = FilteredBlock . MIN_PROTOCOL_VERSION ;
SINGLE
SINGLE
<nb> public class PeerGroup extends AbstractIdleService implements TransactionBroadca
Peer peer = new Peer ( params , chain , ver , memoryPool ) ;
peer . addLifecycleListener ( startupListener ) ;
+ peer . setMinProtocolVersion ( vMinRequiredProtocolVersion ) ;
pendingPeers . add ( peer ) ;
TCPNetworkConnection codec = new TCPNetworkConnection ( params , peer . getVersionMessage ( ) ) ;
p . addLast ( STRING1 , codec . getHandler ( ) ) ;
<nb> public class PeerGroup extends AbstractIdleService implements TransactionBroadca
}
COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ public void setMinRequiredProtocolVersion ( int minRequiredProtocolVersion ) {
+ this . vMinRequiredProtocolVersion = minRequiredProtocolVersion ;
+ }
+
+ COMMENT
+ public int getMinRequiredProtocolVersion ( ) {
+ return vMinRequiredProtocolVersion ;
+ }
+
+ COMMENT
COMMENT
COMMENT
COMMENT
|
Require Bloom filtering capable peers by default
|
<nb> public class YoutubeVideoUrlIdHandler implements VideoUrlIdHandler {
throw new ParsingException ( STRING0 , uee ) ;
}
} else {
- id = Parser . matchGroup1 ( STRING1 , url ) ;
+ id = Parser . matchGroup1 ( STRING2 , url ) ;
}
}
else if ( url . contains ( STRING3 ) ) {
|
fixed another pattern problem
|
<nb> public class TestResultAnalyzer {
TestSize expectedSize = TestSize . getTestSize ( expectedTimeout ) ;
if ( verbose ) {
StringBuilder builder = new StringBuilder ( String . format (
- STRING0
+ STRING1
+ STRING2 ,
+ target . getLabel ( ) ,
maxTimeOfShard / FLOAT0 ,
specifiedTimeout . prettyPrint ( ) ,
expectedTimeout ) ) ;
if ( expectedSize != null ) {
builder . append ( STRING3 ) . append ( expectedSize ) . append ( STRING4 ) ;
}
- builder . append ( STRING5 ) ;
+ builder . append ( STRING6 ) ;
warnings . add ( builder . toString ( ) ) ;
return false ;
}
|
Test execution time warning contains target name
|
<nb> public final class DirectCandidateGeneratorBuilder implements CandidateGenerator
DirectCandidateGeneratorBuilder tempGenerator = new DirectCandidateGeneratorBuilder ( STRING0 ) ;
SINGLE
Set < String > tmpFieldName = new HashSet < > ( NUMBER0 ) ;
- PARSER . parse ( parseContext . parser ( ) , new Tuple < Set < String > , DirectCandidateGeneratorBuilder > ( tmpFieldName , tempGenerator ) ,
+ PARSER . parse ( parseContext . parser ( ) , new Tuple < > ( tmpFieldName , tempGenerator ) ,
parseContext ) ;
if ( tmpFieldName . size ( ) != NUMBER0 ) {
throw new IllegalArgumentException ( STRING1 + TYPE + STRING2 + tmpFieldName ) ;
|
Remove redundant generics type declaration
|
<nb> public class ODocument extends ORecordSchemaAwareAbstract < Object > implements Ite
cloned . _fieldTypes = new HashMap < String , OType > ( _fieldTypes ) ;
cloned . _fieldOriginalValues = null ;
+ cloned . _dirty = _dirty ;
return cloned ;
}
<nb> public class SQLSelectTest {
}
@ test
+ public void queryNoDirtyResultset ( ) {
+ database . open ( STRING0 , STRING0 ) ;
+
+ List < ODocument > result = database . command ( new OSQLSynchQuery < ODocument > ( STRING1 ) ) . execute ( ) ;
+
+ Assert . assertTrue ( result . size ( ) != NUMBER0 ) ;
+
+ for ( ODocument d : result ) {
+ Assert . assertFalse ( d . isDirty ( ) ) ;
+ }
+
+ database . close ( ) ;
+ }
+
+ @ test
public void queryNoWhere ( ) {
database . open ( STRING0 , STRING0 ) ;
|
Fixed dirty flag on ODocument cloning
|
<nb> import NAMESPACE ;
COMMENT
COMMENT
@ incubating
- public interface JvmTestSuiteSpec extends TestSuiteSpec {
+ public interface JvmTestSuiteSpec extends TestSuiteSpec , JvmComponentSpec {
@ override
JvmComponentSpec getTestedComponent ( ) ;
}
|
Make JvmTestSuiteSpec extend JvmComponentSpec
|
<nb> public class ConfigureMapMenu {
AccessibleToast . makeText ( app , R . string . renderer_load_exception , Toast . LENGTH_SHORT ) . show ( ) ;
}
adapter . setItemDescription ( pos , getRenderDescr ( activity ) ) ;
+ activity . getDashboard ( ) . refreshContent ( true ) ;
dialog . dismiss ( ) ;
}
|
Fix refresh issue
|
<nb> public abstract class Model < M extends Model < M , P , O > , P extends Model . Parameters ,
public double score ( double [ ] data ) { return ArrayUtils . maxIndex ( score0 ( data , new float [ _output . nclasses ( ) ] ) ) ; }
@ override protected Futures remove_impl ( Futures fs ) {
- for ( Key k : _output . _model_metrics )
- k . remove ( fs ) ;
+ if ( _output . _model_metrics != null )
+ for ( Key k : _output . _model_metrics )
+ k . remove ( fs ) ;
return fs ;
}
|
Add NPE check
|
<nb> public abstract class AsynchronousProcessor implements AsyncSupport < AtmosphereRe
}
if ( config . handlers ( ) . isEmpty ( ) ) {
- logger . error ( STRING0 ) ;
- throw new AtmosphereMappingException ( STRING1 ) ;
+ logger . error ( STRING2 ) ;
+ throw new AtmosphereMappingException ( STRING2 ) ;
}
if ( supportSession ( ) ) {
|
Improve error message
|
<nb>
package NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
- import NAMESPACE ;
- import NAMESPACE ;
- import NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> public class DefaultFileHttpTransmitter implements FileHttpTransmitter {
return ;
}
- channel . write ( response ) ; SINGLE
+ HttpResponse minimalResponse = new DefaultHttpResponse ( response . getProtocolVersion ( ) , response . getStatus ( ) ) ;
+ minimalResponse . headers ( ) . set ( response . headers ( ) ) ;
+ channel . write ( minimalResponse ) ; SINGLE
FileRegion message = new DefaultFileRegion ( fileChannel , NUMBER0 , length ) ;
ChannelFuture writeFuture = channel . writeAndFlush ( message ) ;
|
Don t send a full http response if we are sending a file
|
<nb> public class PojoProduceProxyInterceptEndpointTest extends TestCase {
context . stop ( ) ;
}
- public static interface EchoService {
- public String echo ( String word ) ;
+ public interface EchoService {
+ String echo ( String word ) ;
}
public static class MyBean {
|
Fixed the CS error of camel core
|
<nb> public class RenderTank extends TileEntitySpecialRenderer {
GL11 . glBlendFunc ( GL11 . GL_SRC_ALPHA , GL11 . GL_ONE_MINUS_SRC_ALPHA ) ;
func_110628_a ( FluidRenderer . getFluidSheet ( liquid ) ) ;
-
+ FluidRenderer . colorFluid ( liquid ) ;
+
GL11 . glTranslatef ( ( float ) x + FLOAT0 , ( float ) y , ( float ) z + FLOAT0 ) ;
GL11 . glScalef ( FLOAT1 , FLOAT2 , FLOAT1 ) ;
|
Adds FluidStack color to tank Render
|
<nb> public class SASLAuthentication {
SINGLE
final Map < String , Object > props = new HashMap < > ( ) ;
- props . put ( LocalClientSession . class . getCanonicalName ( ) , session ) ;
+ props . put ( LocalSession . class . getCanonicalName ( ) , session ) ;
props . put ( Sasl . POLICY_NOANONYMOUS , Boolean . toString ( ! JiveGlobals . getBooleanProperty ( STRING0 ) ) ) ;
SaslServer saslServer = Sasl . createSaslServer ( mechanismName , STRING1 , session . getServerName ( ) , props , new XMPPCallbackHandler ( ) ) ;
<nb> public class SaslServerFactoryImpl implements SaslServerFactory
public SaslServerFactoryImpl ( )
{
allMechanisms = new HashSet < > ( ) ;
+ allMechanisms . add ( new Mechanism ( STRING2 , true , true ) ) ;
allMechanisms . add ( new Mechanism ( STRING3 , false , true ) ) ;
allMechanisms . add ( new Mechanism ( STRING4 , false , false ) ) ;
allMechanisms . add ( new Mechanism ( STRING5 , true , false ) ) ;
|
Fix ANONYMOUS Sasl mechanism
|
<nb> public class RealmList < E extends RealmObject > extends AbstractList < E > {
}
COMMENT
- COMMENT
- COMMENT
+ COMMENT
+ COMMENT
COMMENT
- COMMENT
+ COMMENT
COMMENT
public boolean isValid ( ) {
SINGLE
|
Fix RealmList isValid Javadoc
|
<nb> public class TouchUtils {
float xStep = ( toX - fromX ) / stepCount ;
MotionEvent event = MotionEvent . obtain ( downTime , eventTime ,
- MotionEvent . ACTION_DOWN , fromX , y , NUMBER0 ) ;
+ MotionEvent . ACTION_DOWN , x , y , NUMBER0 ) ;
inst . sendPointerSync ( event ) ;
inst . waitForIdleSync ( ) ;
<nb> public class TouchUtils {
}
eventTime = SystemClock . uptimeMillis ( ) ;
- event = MotionEvent . obtain ( downTime , eventTime , MotionEvent . ACTION_UP , fromX , y , NUMBER0 ) ;
+ event = MotionEvent . obtain ( downTime , eventTime , MotionEvent . ACTION_UP , x , y , NUMBER0 ) ;
inst . sendPointerSync ( event ) ;
inst . waitForIdleSync ( ) ;
}
|
Fix x coordinate of the ACTION_UP event in TouchUtils drag method
|
<nb> public class GeoPointFieldMapperTests extends ESSingleNodeTestCase {
final int numHashes = hashes . size ( ) ;
for ( int i = NUMBER0 ; i < numHashes ; ++ i ) {
String hash = STRING0 . substring ( NUMBER0 , numHashes - i ) ;
- Object expected = version . before ( Version . V_5_0_0_alpha1 ) ? hash : new BytesRef ( hash ) ;
- assertEquals ( expected , hashes . get ( i ) ) ;
+ assertEquals ( hash , hashes . get ( i ) ) ;
}
}
|
Fix expectations of GeoPointFieldMapperTests
|
<nb> import NAMESPACE ;
import NAMESPACE ;
public class MetricsServlet extends HttpServlet implements MetricProcessor < MetricsServlet . Context > {
+ private static final long serialVersionUID = NUMBER0 ;
private static final Logger LOGGER = LoggerFactory . getLogger ( MetricsServlet . class ) ;
public static final String ATTR_NAME_METRICS_REGISTRY = MetricsServlet . class . getSimpleName ( ) + STRING0 + MetricsRegistry . class . getSimpleName ( ) ;
public static final String ATTR_NAME_HEALTHCHECK_REGISTRY = MetricsServlet . class . getSimpleName ( ) + STRING0 + HealthCheckRegistry . class . getSimpleName ( ) ;
|
Add a serialVersionUID to MetricsServlet
|
<nb> public class ContactsActivity extends XmppActivity {
}
private boolean isMuc ( Contact contact ) {
- String server = contact . getJid ( ) . split ( STRING0 ) [ NUMBER0 ] ;
- return getMucServers ( ) . contains ( server ) ;
+ String [ ] parts = contact . getJid ( ) . split ( STRING0 ) ;
+ if ( parts . length != NUMBER1 ) {
+ return false ;
+ }
+ return getMucServers ( ) . contains ( parts [ NUMBER0 ] ) ;
}
public void startConversation ( Contact contact , Account account , boolean muc ) {
|
fixed array out of bounds in isMuc
|
<nb> public class SimpleIndicesWarmerTests extends ElasticsearchIntegrationTest {
@ test
public void deleteNonExistentIndexWarmerTest ( ) {
createIndex ( STRING0 ) ;
-
try {
- client ( ) . admin ( ) . indices ( ) . prepareDeleteWarmer ( ) . setIndices ( STRING0 ) . setNames ( STRING1 ) . execute ( ) . actionGet ( NUMBER0 ) ;
+ client ( ) . admin ( ) . indices ( ) . prepareDeleteWarmer ( ) . setIndices ( STRING0 ) . setNames ( STRING1 ) . execute ( ) . actionGet ( ) ;
fail ( STRING2 ) ;
} catch ( IndexWarmerMissingException ex ) {
assertThat ( ex . names ( ) [ NUMBER1 ] , equalTo ( STRING1 ) ) ;
|
Test remove timeout from deleteWarmer call with many shards that might just take a while
|
<nb> import NAMESPACE ;
COMMENT
COMMENT
+ COMMENT
COMMENT
+ @ deprecated
public abstract class AbstractContextualMonitor < T , M extends Monitor < T > >
implements CompositeMonitor < T > {
<nb> import NAMESPACE ;
COMMENT
COMMENT
COMMENT
+ COMMENT
COMMENT
+ @ deprecated
public class ContextualCounter extends AbstractContextualMonitor < Number , Counter >
implements Counter {
<nb> import NAMESPACE ;
COMMENT
COMMENT
COMMENT
+ COMMENT
COMMENT
+ @ deprecated
public class ContextualTimer extends AbstractContextualMonitor < Long , Timer > implements Timer {
COMMENT
<nb> package NAMESPACE ;
COMMENT
COMMENT
COMMENT
+ COMMENT
COMMENT
+ @ deprecated
public interface TaggingContext {
COMMENT
TagList getTags ( ) ;
<nb> package NAMESPACE ;
COMMENT
COMMENT
COMMENT
+ COMMENT
COMMENT
+ @ deprecated
public final class ThreadLocalTaggingContext implements TaggingContext {
private final ThreadLocal < TagList > context = new ThreadLocal < TagList > ( ) ;
|
Deprecated contextual monitor
|
<nb> package NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
- import NAMESPACE ;
+ import NAMESPACE ;
public class Agent implements IRef {
volatile Object state ;
<nb> boolean busy = false ;
volatile ISeq errors = null ;
SINGLE
- final static Executor executor = Executors . newFixedThreadPool ( NUMBER0 * Runtime . getRuntime ( ) . availableProcessors ( ) ) ;
+ final public static ThreadPoolExecutor executor =
+ new ThreadPoolExecutor ( NUMBER0 * Runtime . getRuntime ( ) . availableProcessors ( ) ,
+ NUMBER0 * Runtime . getRuntime ( ) . availableProcessors ( ) ,
+ NUMBER1 L , TimeUnit . MILLISECONDS ,
+ new LinkedBlockingQueue < Runnable > ( ) ) ;
+ SINGLE
SINGLE
final static ThreadLocal < PersistentVector > nested = new ThreadLocal < PersistentVector > ( ) ;
|
made executor public
|
<nb> public class NeuralNetConfiguration implements Serializable , Cloneable {
@ deprecated
private DefaultRandom rng = null ;
private long seed = System . currentTimeMillis ( ) ;
- @ deprecated
private Distribution dist = new NormalDistribution ( FLOAT0 , NUMBER0 ) ;
private LossFunctions . LossFunction lossFunction = LossFunctions . LossFunction . RECONSTRUCTION_CROSSENTROPY ;
private int nIn ;
|
Remove incorrect deprecated annotation
|
<nb> public class JsonHttpResponseHandler extends AsyncHttpResponseHandler {
onSuccess ( ( JSONObject ) jsonResponse ) ;
} else if ( jsonResponse instanceof JSONArray ) {
onSuccess ( ( JSONArray ) jsonResponse ) ;
+ } else {
+ throw new JSONException ( STRING0 + jsonResponse . getClass ( ) . getName ( ) ) ;
}
} catch ( JSONException e ) {
onFailure ( e , responseBody ) ;
|
Call onFailure when response is not valid JSON
|
<nb> public class Moco {
}
public static Resource version ( final String version ) {
- return version ( text ( checkNotNullOrEmpty ( version , STRING0 ) ) ) ;
+ return version ( HttpProtocolVersion . versionOf ( checkNotNullOrEmpty ( version , STRING0 ) ) ) ;
}
public static Resource version ( final HttpProtocolVersion version ) {
|
checked http version in publish api
|
<nb> class MountService extends IMountService . Stub
}
public boolean hasExternalStorage ( int uid , String packageName ) {
+ SINGLE
+ SINGLE
+ if ( uid == Process . SYSTEM_UID ) {
+ return true ;
+ }
SINGLE
for ( ExternalStorageMountPolicy policy : mPolicies ) {
final boolean policyHasStorage = policy . hasExternalStorage ( uid , packageName ) ;
|
Avoid a deadlock between PMS and AppOpsService
|
<nb> public final class CellSignalStrengthLte extends CellSignalStrength implements P
COMMENT
COMMENT
public void initialize ( SignalStrength ss , int timingAdvance ) {
- mSignalStrength = ss . getLteSignalStrenght ( ) ;
+ mSignalStrength = ss . getLteSignalStrength ( ) ;
mRsrp = ss . getLteRsrp ( ) ;
mRsrq = ss . getLteRsrq ( ) ;
mRssnr = ss . getLteRssnr ( ) ;
<nb> public class SignalStrength implements Parcelable {
}
COMMENT
- public int getLteSignalStrenght ( ) {
+ public int getLteSignalStrength ( ) {
return mLteSignalStrength ;
}
|
Fix misspelling of getLteSignalStrenght
|
<nb> public class CameraWidgetFrame extends KeyguardWidgetFrame implements View . OnCli
return iv ;
}
+ @ override
+ public void setPivotX ( float pivotX ) {
+ SINGLE
+ }
+
+ @ override
+ public void setPivotY ( float pivotY ) {
+ SINGLE
+ }
+
public void render ( ) {
final Throwable [ ] thrown = new Throwable [ NUMBER0 ] ;
final Bitmap [ ] offscreen = new Bitmap [ NUMBER0 ] ;
|
Fix regression in camera transition
|
<nb> public class ServerTimeRejectionPolicyFactory implements RejectionPolicyFactory
@ override
public boolean accept ( long timestamp )
{
- return timestamp >= ( System . currentTimeMillis ( ) - windowMillis ) ;
+ long now = System . currentTimeMillis ( ) ;
+
+ boolean notTooOld = timestamp >= ( now - windowMillis ) ;
+ boolean notTooYoung = timestamp <= ( now + windowMillis ) ;
+
+ return notTooOld && notTooYoung ;
}
@ override
<nb> public class ServerTimeRejectionPolicyFactoryTest
DateTime now = new DateTime ( ) ;
DateTime past = now . minus ( period ) . minus ( NUMBER0 ) ;
+ DateTime future = now . plus ( period ) . plus ( NUMBER0 ) ;
Assert . assertTrue ( rejectionPolicy . accept ( now . getMillis ( ) ) ) ;
Assert . assertFalse ( rejectionPolicy . accept ( past . getMillis ( ) ) ) ;
+ Assert . assertFalse ( rejectionPolicy . accept ( future . getMillis ( ) ) ) ;
}
}
|
make ServerTimeRejectionPolicy also reject timestamps AHEAD of server time
|
<nb> public class BlockingQueueConsumer < T > implements QueueConsumer < T >
COMMENT
public BlockingQueueConsumer ( )
{
- items = new LinkedBlockingQueue < T > ( ) ;
+ this ( new LinkedBlockingQueue < T > ( ) ) ;
}
COMMENT
<nb> public class BlockingQueueConsumer < T > implements QueueConsumer < T >
COMMENT
public BlockingQueueConsumer ( int capacity )
{
- items = new ArrayBlockingQueue < T > ( capacity ) ;
+ this ( new ArrayBlockingQueue < T > ( capacity ) ) ;
+ }
+
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ public BlockingQueueConsumer ( BlockingQueue < T > queue )
+ {
+ this . items = queue ;
}
@ override
|
Added a ctor to wrap a given queue
|
<nb> public class HueBinding extends AbstractBinding < HueBindingProvider > implements M
}
SINGLE
- activeBridge = new HueBridge ( bridgeIP , bridgeSecret ) ;
- activeBridge . pairBridgeIfNecessary ( ) ;
+ if ( this . bridgeIP != null ) {
+ activeBridge = new HueBridge ( bridgeIP , bridgeSecret ) ;
+ activeBridge . pairBridgeIfNecessary ( ) ;
+ }
}
}
<nb> public class SsdpDiscovery {
private String scanResposesForKeywords ( MulticastSocket socket ,
String . . . keywords ) throws IOException {
SINGLE
+ socket . setSoTimeout ( NUMBER0 ) ;
do {
logger . debug ( STRING0 ) ;
byte [ ] rxbuf = new byte [ NUMBER1 ] ;
|
improved startup behavior if no Hue bridge is found
|
<nb> public final class Tools {
public static InputStream getInputStream ( final String resourcePath ) throws IOException {
try {
- SINGLE
+ SINGLE
URL url = new URL ( resourcePath ) ;
SINGLE
InputStream is = url . openStream ( ) ;
<nb> public final class Tools {
} catch ( MalformedURLException e ) {
SINGLE
}
-
- SINGLE
+ SINGLE
File f = new File ( resourcePath ) ;
if ( f . exists ( ) && f . isFile ( ) && f . canRead ( ) ) {
return new FileInputStream ( f ) ;
} else
- throw new IOException ( STRING0 + resourcePath ) ;
+ throw new IOException ( STRING1 + f . getAbsolutePath ( ) ) ;
}
COMMENT
|
improve exception message
|
<nb> import NAMESPACE ;
COMMENT
public abstract class CommonXml implements XMLElementReader < List < ModelNode > > , XMLElementWriter < ModelMarshallingContext > {
+ SINGLE
+ protected static final Logger log = Logger . getLogger ( STRING0 ) ;
+
COMMENT
protected static final Set < String > RESTRICTED_PATHS ;
|
Make logger visible
|
<nb> public class HueSettings {
settingsData = new SettingsTree ( mapper . readValue ( settings ,
Map . class ) ) ;
} catch ( Exception e ) {
- logger . error ( STRING0 ) ;
+ logger . error ( STRING0 , e ) ;
}
}
<nb> public class HueBridge {
+ response . getStatus ( ) ) ;
return null ;
}
+ logger . trace ( STRING1 , settingsString ) ;
return settingsString ;
} catch ( ClientHandlerException e ) {
logger . warn ( STRING2 ) ;
|
Improve logging output for HueBinding when retrieving settings from Bridge
|
<nb> public class ScheduledJob
}
} ;
- public void runEvery_Seconds ( int seconds )
+ public void runEveryXSeconds ( int seconds )
{
}
|
Renamed a method for better readability
|
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> public class SettingsGeneralActivity extends SettingsBaseActivity {
} , new Runnable ( ) {
@ override
public void run ( ) {
+ Toast . makeText ( SettingsGeneralActivity . this , getString ( R . string . application_dir_change_warning ) ,
+ Toast . LENGTH_LONG ) . show ( ) ;
reloadIndexes ( ) ;
-
}
} ) ;
return false ;
|
Fix small issues
|
<nb> public class FileFilters {
private FileFilters ( ) {
}
+ COMMENT
+ COMMENT
+ COMMENT
public static FileFilter withExtension ( @ notnull final String extension ) {
return new FileFilter ( ) {
@ override
|
add isFile check to filtering by extension in non performance critical places
|
<nb> public class EmbeddedMojo extends AbstractExecMojo {
COMMENT
COMMENT
COMMENT
- COMMENT
- COMMENT
+ COMMENT
+ COMMENT
COMMENT
protected String duration ;
|
Fixed the NPE when using the embedded goal of camel maven plugin
|
<nb> public class DeskShareStream implements NewScreenListener {
this . frameRate = frameRate ;
this . timestampBase = NUMBER0 / this . frameRate ;
this . changedTileProcessor = new ChangedTileProcessor ( width , height ) ;
- SINGLE
- SINGLE
- calculateEncodingDimensions ( ) ;
+ encodingHeight = height ;
+ encodingWidth = width ;
+ SINGLE
changedTileProcessor . addNewScreenListener ( this ) ;
changedTileProcessor . start ( ) ;
|
don t resize screen capture size
|
<nb> public enum AndroidExcludedRefs {
}
} ,
+ ACTIVITY_MANAGER_MCONTEXT ( SAMSUNG . equals ( MANUFACTURER ) && SDK_INT == LOLLIPOP_MR1 ) {
+ @ override void add ( ExcludedRefs . Builder excluded ) {
+ excluded . staticField ( STRING0 , STRING1 )
+ . reason ( STRING2
+ + STRING3
+ + STRING4
+ + STRING5 ) ;
+ }
+ } ,
+
SINGLE
SOFT_REFERENCES {
|
Ignore Samsung ActivityManager context leak on L
|
<nb> public abstract class PropertyProviderFinder extends AntDomRecursiveVisitor {
private Map < String , List < String > > myDependenciesMap = new HashMap < String , List < String > > ( ) ; SINGLE
private Set < String > myProcessedTargets = new HashSet < String > ( ) ;
+ private Set < AntDomProject > myVisitedProjects = new HashSet < AntDomProject > ( ) ;
protected PropertyProviderFinder ( DomElement contextElement ) {
myContextElement = contextElement != null ? contextElement . getParentOfType ( AntDomElement . class , false ) : null ;
<nb> public abstract class PropertyProviderFinder extends AntDomRecursiveVisitor {
processFileInclusion ( importTag , InclusionKind . IMPORT ) ;
}
+ public void visitProject ( AntDomProject project ) {
+ if ( ! myVisitedProjects . contains ( project ) ) {
+ myVisitedProjects . add ( project ) ;
+ super . visitProject ( project ) ;
+ }
+ }
+
private void processFileInclusion ( AntDomIncludingDirective directive , final InclusionKind kind ) {
if ( directive . equals ( myContextElement ) ) {
stop ( ) ;
|
fix stack overflow
|
<nb> public class EndpointWebMvcAutoConfigurationTests {
EmbeddedServletContainerAutoConfiguration . class ,
DispatcherServletAutoConfiguration . class , WebMvcAutoConfiguration . class ,
ManagementServerPropertiesAutoConfiguration . class ,
- EndpointWebMvcAutoConfiguration . class ) ;
+ EndpointWebMvcAutoConfiguration . class , ErrorMvcAutoConfiguration . class ) ;
this . applicationContext . refresh ( ) ;
assertContent ( STRING0 , NUMBER0 , STRING1 ) ;
assertContent ( STRING2 , NUMBER0 , null ) ;
<nb> public class EndpointWebMvcAutoConfigurationTests {
ServerPropertiesAutoConfiguration . class ,
EmbeddedServletContainerAutoConfiguration . class ,
DispatcherServletAutoConfiguration . class , WebMvcAutoConfiguration . class ,
- EndpointWebMvcAutoConfiguration . class ) ;
+ EndpointWebMvcAutoConfiguration . class , ErrorMvcAutoConfiguration . class ) ;
this . applicationContext . refresh ( ) ;
assertContent ( STRING0 , NUMBER1 , STRING1 ) ;
assertContent ( STRING2 , NUMBER1 , null ) ;
|
Fix broken test
|
<nb> public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto
public boolean isPoweredTile ( TileEntity tile , ForgeDirection side ) {
if ( tile == null ) {
return false ;
- } else if ( tile instanceof IPowerReceptor ) {
- return ( ( IPowerReceptor ) tile ) . getPowerReceiver ( side . getOpposite ( ) ) != null ;
} else if ( tile instanceof IEnergyHandler ) {
return ( ( IEnergyHandler ) tile ) . canConnectEnergy ( side . getOpposite ( ) ) ;
+ } else if ( tile instanceof IPowerReceptor ) {
+ return ( ( IPowerReceptor ) tile ) . getPowerReceiver ( side . getOpposite ( ) ) != null ;
} else {
return false ;
}
|
fixed powered tile detection for engines following RF migration
|
<nb> public class StatsSearchTermsFragment extends StatsAbstractListFragment {
COMMENT
COMMENT
COMMENT
- COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
COMMENT
COMMENT
|
Better commenting a part of the new code that could seem a little obscure
|
<nb> public class PlanGeneratorTest {
COMMENT
COMMENT
COMMENT
- class CalendarServiceDataStub extends CalendarServiceData {
+ private static final class CalendarServiceDataStub extends CalendarServiceData {
private static final long serialVersionUID = NUMBER0 ;
final Set < AgencyAndId > serviceIds ;
<nb> public class PlanGeneratorTest {
COMMENT
COMMENT
COMMENT
- class TransitIndexServiceStub implements TransitIndexService {
+ private static final class TransitIndexServiceStub implements TransitIndexService {
final Agency train ;
final Agency ferry ;
<nb> public class PlanGeneratorTest {
COMMENT
COMMENT
COMMENT
- class FareServiceStub implements FareService {
+ private static final class FareServiceStub implements FareService {
@ override
public Fare getCost ( GraphPath path ) {
Fare fare = new Fare ( ) ;
<nb> public class PlanGeneratorTest {
COMMENT
COMMENT
COMMENT
- class TimetableSnapshotSourceStub implements TimetableSnapshotSource {
+ private static final class TimetableSnapshotSourceStub implements TimetableSnapshotSource {
final TimetableResolver timetableResolver = new TimetableResolver ( ) ;
@ override
|
Make inner classes in PlanGeneratorTest private static and final
|
<nb> public class Unifier {
if ( tokSequence . size ( ) == readingsCounter ) {
tokSequence . add ( new AnalyzedTokenReadings ( aToken , NUMBER0 ) ) ;
} else {
- tokSequence . get ( readingsCounter ) . addReading ( aToken ) ;
+ if ( readingsCounter < tokSequence . size ( ) ) {
+ tokSequence . get ( readingsCounter ) . addReading ( aToken ) ;
+ COMMENT
}
tmpFeaturesFound = tokenFeaturesFound ;
}
|
fix a problem with a Unifier thanks to Jaume Ortola i Font
|
<nb> public abstract class GrammaticalStructure extends TreeGraph {
continue ;
int parentId = Integer . parseInt ( parentIdStr ) - NUMBER0 ;
String grelString = tokenFields . get ( i ) . get ( CoNLLX_RelnField ) ;
- if ( grelString . equals ( STRING0 ) )
+ if ( grelString . equals ( STRING0 ) || grelString . equals ( STRING1 ) )
continue ;
GrammaticalRelation grel = shortNameToGRel . get ( grelString . toLowerCase ( ) ) ;
TypedDependency tdep ;
|
Allow skipping of erased dependencies as well as null dependencies when reading in conll dependency trees
|
<nb> public class JacksonAutoConfigurationTests {
ObjectMapper mapper = this . context . getBean ( ObjectMapper . class ) ;
DateTime dateTime = new DateTime ( NUMBER0 , NUMBER1 , NUMBER2 , NUMBER3 , NUMBER4 , DateTimeZone . UTC ) ;
assertEquals ( STRING0 , mapper . writeValueAsString ( dateTime ) ) ;
- Date date = new DateTime ( NUMBER0 , NUMBER1 , NUMBER2 , NUMBER3 , NUMBER4 ) . toDate ( ) ;
+ Date date = dateTime . toDate ( ) ;
assertEquals ( STRING1 , mapper . writeValueAsString ( date ) ) ;
}
|
Fix customJodaDateTimeFormat to specify time zone when creating Date
|
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> public class ParseAndMarshalModelsTestCase {
@ after
public void cleanup ( ) throws Exception {
ManagementFactory . getPlatformMBeanServer ( ) . unregisterMBean ( new ObjectName ( STRING0 ) ) ;
+ if ( serviceContainer != null ) {
+ serviceContainer . shutdown ( ) ;
+ try {
+ serviceContainer . awaitTermination ( NUMBER0 , TimeUnit . SECONDS ) ;
+ } catch ( InterruptedException e ) {
+ e . printStackTrace ( ) ;
+ }
+ finally {
+ serviceContainer = null ;
+ }
+ }
}
@ test
|
Don t leak MSC thread pools in test case
|
<nb> public class SearchManager
COMMENT
COMMENT
public final static String SUGGEST_URI_PATH_QUERY = STRING0 ;
+
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ public final static String SUGGEST_URI_PATH_SHORTCUT = STRING1 ;
COMMENT
COMMENT
<nb> public class SearchManager
public final static String SUGGEST_COLUMN_QUERY = STRING2 ;
COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ public final static String SUGGEST_COLUMN_SHORTCUT_ID = STRING3 ;
+
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ public final static String SUGGEST_NEVER_MAKE_SHORTCUT = STRING4 ;
+
+ COMMENT
COMMENT
COMMENT
COMMENT
|
Define the URI path columns and constants for shortcut validation
|
<nb> public class EclipseModelBuilder implements ToolingModelBuilder {
}
eclipseProject . setTasks ( tasks ) ;
- List < String > natures = new ArrayList < String > ( ) ;
- for ( String n : eclipseModel . getProject ( ) . getNatures ( ) ) {
- natures . add ( n ) ;
- }
- eclipseProject . setProjectNatures ( natures ) ;
+ eclipseProject . setProjectNatures ( new ArrayList < String > ( eclipseModel . getProject ( ) . getNatures ( ) ) ) ;
List < DefaultEclipseBuildCommand > buildCommands = new ArrayList < DefaultEclipseBuildCommand > ( ) ;
for ( BuildCommand b : eclipseModel . getProject ( ) . getBuildCommands ( ) ) {
|
In EclipseModelBuilder pass new collection instead of iterating
|
<nb> public class MessageDispatcher {
long currentTime = getCurrentTime ( ) ;
telegram . setTimestamp ( currentTime + ( long ) ( delay * NANOS_PER_SEC ) , timeGranularity ) ;
- SINGLE
- queue . add ( telegram ) ;
+ SINGLE
+ if ( ! queue . add ( telegram ) ) pool . free ( telegram ) ;
if ( debugEnabled ) {
Gdx . app . log ( LOG_TAG , STRING0 + sender + STRING1 + getCurrentTime ( ) + STRING2 + receiver
|
Put the telegram back to the pool if it s rejected by the queue
|
<nb> public class AccountSettingsFragment extends PreferenceFragment implements OnPre
mEmailPreference . getEditText ( ) . setInputType ( InputType . TYPE_TEXT_VARIATION_EMAIL_ADDRESS ) ;
mEmailPreference . setValidationType ( EditTextPreferenceWithValidation . ValidationType . EMAIL ) ;
+ mWebAddressPreference . getEditText ( ) . setInputType ( InputType . TYPE_TEXT_VARIATION_URI ) ;
mWebAddressPreference . setValidationType ( EditTextPreferenceWithValidation . ValidationType . URL ) ;
mEmailPreference . setOnPreferenceChangeListener ( this ) ;
|
Web address preference now has an input type of URI
|
<nb>
COMMENT
package NAMESPACE ;
+ import NAMESPACE ;
+
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
-
COMMENT
COMMENT
COMMENT
<nb> public class StatefulInitMethodInterceptorFactory implements InterceptorFactory
public Interceptor create ( final InterceptorFactoryContext context ) {
final Method method = SessionBeanHomeInterceptorFactory . INIT_METHOD . get ( ) ;
final Object [ ] params = SessionBeanHomeInterceptorFactory . INIT_PARAMETERS . get ( ) ;
+ SINGLE
+ SINGLE
+ SessionBeanHomeInterceptorFactory . INIT_METHOD . remove ( ) ;
+ SessionBeanHomeInterceptorFactory . INIT_PARAMETERS . remove ( ) ;
return new AbstractEJBInterceptor ( ) {
@ override
public Object processInvocation ( final InterceptorContext context ) throws Exception {
|
Fix issue with stateful init methods
|
<nb> public abstract class ByteToMessageDecoder < O >
ByteBuf in = ctx . inboundByteBuffer ( ) ;
boolean decoded = false ;
- for ( ; ; ) {
+ while ( in . readable ( ) ) {
try {
int oldInputLength = in . readableBytes ( ) ;
O o = decode ( ctx , in ) ;
|
Only call ByteToMessageDecoder decode
|
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
+ import NAMESPACE ;
COMMENT
COMMENT
<nb> public interface Entity {
COMMENT
public EntityDamageEvent getLastDamageCause ( ) ;
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ public UUID getUniqueId ( ) ;
}
|
Added UniqueId to entities
|
<nb> public class DependencyManager implements InstallShinyEvent . Handler
STRING0 ,
userAction ,
new Dependency [ ] {
- Dependency . embeddedPackage ( STRING1 )
+ Dependency . embeddedPackage ( STRING1 ) ,
+ Dependency . cranPackage ( STRING2 , STRING3 ) ,
+ Dependency . cranPackage ( STRING4 , STRING3 )
} ,
false ,
new CommandWithArg < Boolean > ( )
|
add additional dependencies required by profvis htmlwidgets and stringr
|
<nb> public class TagViewFragment extends TaskListFragment {
SINGLE
switch ( item . getItemId ( ) ) {
case MENU_REFRESH_ID :
- if ( actFmPreferenceService . isLoggedIn ( ) ) {
refreshData ( true ) ;
return true ;
- }
}
return super . onOptionsItemSelected ( item ) ;
|
Removed conditions since we fixed this an alternate path
|
<nb> public class ProtocolProviderServiceJabberImpl
{
synchronized ( initializationLock )
{
+ SINGLE
+ SINGLE
+ SINGLE
+ SINGLE
+ if ( isRegistered ( ) )
+ return ;
+
JabberLoginStrategy loginStrategy = createLoginStrategy ( ) ;
userCredentials = loginStrategy . prepareLogin ( authority , reasonCode ) ;
if ( ! loginStrategy . loginPreparationSuccessful ( ) )
|
Avoids second attempt to initialize a xmpp connection if several threads call register method
|
<nb> public class ApkBuilder {
try {
addResourcesFromJarMethod . invoke ( builder , new Object [ ] { jarFile } ) ;
} catch ( InvocationTargetException e ) {
- log . error ( STRING0 + jarFile . getAbsolutePath ( ) , e . getCause ( ) ) ;
- throw new MojoExecutionException ( STRING0 + jarFile . getAbsolutePath ( ) ,
- e . getCause ( ) ) ;
+ final String message = STRING0 + jarFile . getAbsolutePath ( ) ;
+ log . error ( message , e . getCause ( ) ) ;
+ throw new MojoExecutionException ( message , e . getCause ( ) ) ;
} catch ( Exception e ) {
log . error ( STRING1 , e ) ;
throw new MojoExecutionException ( STRING2 , e ) ;
|
build error message only once
|
<nb> public class SecurityRulesDocIT extends ExclusiveServerTestBase
COMMENT
COMMENT
COMMENT
- COMMENT
- COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
COMMENT
COMMENT
COMMENT
<nb> public class SecurityRulesDocIT extends ExclusiveServerTestBase
COMMENT
COMMENT
COMMENT
- COMMENT
- COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
COMMENT
COMMENT
COMMENT
<nb> public class SecurityRulesDocIT extends ExclusiveServerTestBase
COMMENT
COMMENT
COMMENT
- COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
COMMENT
COMMENT
@ test
|
Fixes broken syntax in docs
|
<nb> public class KillJobsRequest extends TransportRequest {
out . writeLong ( job . getLeastSignificantBits ( ) ) ;
}
}
-
- @ override
- public boolean equals ( Object o ) {
- if ( this == o ) return true ;
- if ( o == null || getClass ( ) != o . getClass ( ) ) return false ;
- KillJobsRequest that = ( KillJobsRequest ) o ;
- return that . toKill ( ) . equals ( this . toKill ( ) ) ;
- }
}
<nb> public class KillJobsRequestTest extends CrateUnitTest {
KillJobsRequest r2 = new KillJobsRequest ( ) ;
r2 . readFrom ( in ) ;
- assertThat ( r , equalTo ( r2 ) ) ;
assertThat ( r . toKill ( ) , equalTo ( r2 . toKill ( ) ) ) ;
}
}
|
remove equals implementation from KillJobsRequest
|
<nb> public class TestPaymentHelper {
}
}
- public Account addTestExternalPaymentMethod ( final Account account , final PaymentMethodPlugin paymentMethodInfo ) throws Exception {
- final UUID paymentMethodId = paymentApi . addPaymentMethod ( account , paymentMethodInfo . getExternalPaymentMethodId ( ) , ExternalPaymentProviderPlugin . PLUGIN_NAME , true , paymentMethodInfo , ImmutableList . < PluginProperty > of ( ) , context ) ;
- if ( isFastTest ( ) ) {
- Mockito . when ( account . getPaymentMethodId ( ) ) . thenReturn ( paymentMethodId ) ;
- return account ;
- } else {
- SINGLE
- return accountApi . getAccountById ( account . getId ( ) , context ) ;
- }
- }
-
SINGLE
private boolean isFastTest ( ) {
return Mockito . mockingDetails ( accountInternalApi ) . isMock ( ) ;
|
removing method from testhelper and keep it in test
|
<nb> class OutMessage extends BasicBSONEncoder {
}
void doneWithMessage ( ) {
- if ( _buffer != null && _mongo != null )
+ if ( _buffer != null && _mongo != null ) {
_buffer . reset ( ) ;
_mongo . _bufferPool . done ( _buffer ) ;
+ }
_buffer = null ;
_mongo = null ;
|
Added missing braces to conditional
|
<nb> public class ClassLoaderUtil {
COMMENT
COMMENT
public static void addURL ( URL u ) throws IOException {
+ if ( ! ( ClassLoader . getSystemClassLoader ( ) instanceof URLClassLoader ) ) {
+ return ;
+ }
URLClassLoader sysLoader = ( URLClassLoader ) ClassLoader . getSystemClassLoader ( ) ;
URL [ ] urls = sysLoader . getURLs ( ) ;
|
Fix ClassCastException in ClassLoaderUtil
|
<nb>
package NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> import NAMESPACE ;
public class SinglePageItemRecyclerViewAdapter
extends ItemRecyclerViewAdapter < ToggleItemViewHolder > {
private final ArrayList < ItemManager . Item > mList ;
- private Map < String , ItemManager . Item > mExpanded = new HashMap < > ( ) ;
+ private SimpleArrayMap < String , ItemManager . Item > mExpanded = new SimpleArrayMap < > ( ) ;
private Set < String > mCollapsed = new HashSet < > ( ) ;
private int mLevelIndicatorWidth = NUMBER0 ;
private int mDefaultItemVerticalMargin = NUMBER0 ;
|
Replace HashMap with SimpleArrayMap
|
<nb> public interface OryxRecommender {
throws NoSuchItemException , NotReadyException ;
COMMENT
- COMMENT
COMMENT
COMMENT
void refresh ( ) ;
<nb> public interface OryxRecommender {
COMMENT
COMMENT
COMMENT
- COMMENT
- COMMENT
- COMMENT
+ COMMENT
+ COMMENT
COMMENT
COMMENT
COMMENT
<nb> public final class ServerRecommender implements OryxRecommender , Closeable {
public void ingest ( Reader reader ) {
for ( CharSequence line : new FileLineIterable ( reader ) ) {
String [ ] columns = DelimitedDataUtils . decode ( line ) ;
+ if ( columns . length < NUMBER0 ) {
+ throw new IllegalArgumentException ( STRING0 + line + STRING1 ) ;
+ }
String userID = columns [ NUMBER1 ] ;
String itemID = columns [ NUMBER2 ] ;
if ( columns . length > NUMBER0 ) {
|
Throw exception on ingest if there are too few columns
|
<nb> public class ResourceExtractor {
}
public String getResourceName ( int resourceId ) {
- return resourceIdToString . get ( resourceId ) ;
+ String ret = resourceIdToString . get ( resourceId ) ;
+ if ( ret == null )
+ throw new RuntimeException ( STRING0 + resourceId ) ;
+ return ret ;
}
- }
+ }
|
Throw RuntimeException if getResourceName fails
|
<nb> public class DemoApplication extends Application {
}
protected List < Object > getModules ( ) {
- return Arrays . < Object > asList (
- new AndroidModule ( this )
+ return Arrays . asList (
+ new AndroidModule ( this ) ,
+ new DemoModule ( )
) ;
}
|
Include DemoModule in module list for simple Android example
|
<nb> public class IntSet {
}
public void clear ( ) {
+ if ( size == NUMBER0 ) return ;
int [ ] keyTable = this . keyTable ;
for ( int i = capacity + stashSize ; i -- > NUMBER0 ; )
keyTable [ i ] = EMPTY ;
<nb> public class ObjectSet < T > implements Iterable < T > {
}
public void clear ( ) {
+ if ( size == NUMBER0 ) return ;
T [ ] keyTable = this . keyTable ;
for ( int i = capacity + stashSize ; i -- > NUMBER0 ; )
keyTable [ i ] = null ;
|
Don t do the work to clear if the set is empty
|
<nb> public final class ActivityManagerService extends ActivityManagerNative
checkedGrants = true ;
}
userId = handleIncomingUser ( callingPid , callingUid , userId ,
- false , ALLOW_NON_FULL_IN_PROFILE ,
+ false , ALLOW_NON_FULL ,
STRING0 + cpi . authority , null ) ;
if ( userId != tmpTargetUserId ) {
SINGLE
|
Allow content provider access across users
|
<nb> public abstract class BlockOutStream extends OutStream {
public static BlockOutStream get ( TachyonFile tachyonFile , WriteType opType , int blockIndex ,
long initialBytes , TachyonConf tachyonConf ) throws IOException {
- if ( tachyonFile . mTachyonFS . hasLocalWorker ( ) ) {
+ if ( tachyonFile . mTachyonFS . hasLocalWorker ( )
+ && tachyonConf . getBoolean ( Constants . USER_ENABLE_LOCAL_WRITE ,
+ Constants . DEFAULT_USER_ENABLE_LOCAL_WRITE ) ) {
LOG . info ( STRING0 ) ;
return new LocalBlockOutStream ( tachyonFile , opType , blockIndex , initialBytes , tachyonConf ) ;
}
|
examine the local write config option
|
<nb> public class Base {
SINGLE
SINGLE
SINGLE
-
+ toolsMenu . removeAll ( ) ;
for ( Tool tool : internalTools ) {
toolsMenu . add ( createToolItem ( tool ) ) ;
}
|
Removing all items before adding all
|
<nb> public class XmppConnectionService extends Service {
databaseBackend . updateAccount ( account ) ;
}
}
+ mNotificationService . updateErrorNotification ( ) ;
}
private void dismissErrorNotifications ( ) {
|
refresh error notification after try again
|
<nb> public class LockPatternView extends View {
mInProgressY = y ;
if ( mPatternInProgress ) {
+ if ( mPattern . isEmpty ( ) ) return false ;
+
final ArrayList < Cell > pattern = mPattern ;
final float radius = mSquareWidth * mDiameterFactor * FLOAT0 ;
|
Fix android application platform will crash problem
|
<nb> public class SourceFormatter {
_processErrorMessage (
fileName , STRING0 + fileName + STRING1 + lineCount ) ;
}
+
+ if ( line . endsWith ( StringPool . PERIOD ) &&
+ line . contains ( StringPool . EQUAL ) ) {
+
+ _processErrorMessage (
+ fileName , STRING0 + fileName + STRING1 + lineCount ) ;
+ }
}
if ( line . contains ( STRING2 ) && ! line . matches ( STRING3 ) ) {
|
SourceFormatter check for incorrect line break
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.