diff
stringlengths 38
1.78k
| msg_token
stringlengths 9
190
|
|---|---|
<nb> public class ActivityShare extends Activity {
new SubmitTask ( ) . executeOnExecutor ( mExecutor , uid ) ;
} else {
Intent intent = new Intent ( ) ;
- intent . putExtra ( cErrorMessage , getString ( R . string . msg_limit , ActivityShare . cSubmitLimit ) ) ;
+ intent . putExtra ( cErrorMessage , getString ( R . string . msg_limit , ActivityShare . cSubmitLimit + NUMBER0 ) ) ;
setResult ( NUMBER0 , intent ) ;
finish ( ) ;
}
|
Fix another submit limit
|
<nb> public final class NettyDataServer implements DataServer {
@ override
public void close ( ) throws IOException {
- boolean completed ;
-
int quietPeriodSecs =
Configuration . getInt ( PropertyKey . WORKER_NETWORK_NETTY_SHUTDOWN_QUIET_PERIOD ) ;
int timeoutSecs = Configuration . getInt ( PropertyKey . WORKER_NETWORK_NETTY_SHUTDOWN_TIMEOUT ) ;
<nb> public final class NettyDataServer implements DataServer {
SINGLE
SINGLE
+ boolean completed ;
completed =
mChannelFuture . channel ( ) . close ( ) . awaitUninterruptibly ( timeoutSecs , TimeUnit . SECONDS ) ;
if ( ! completed ) {
|
Addressing review comment
|
<nb> public class MainActivity extends AppCompatActivity implements
@ override
public void onSearchError ( Throwable throwable ) {
- SINGLE
+ onSearchResults ( getErrorResult ( throwable ) ) ;
}
private void startTextToSpeech ( ) {
|
added error handling
|
<nb> public class PatternRuleHandler extends XMLRuleHandler {
case ANTIPATTERN :
String antiId = id ;
if ( inRuleGroup ) {
- id = ruleGroupId ;
+ if ( subId > NUMBER0 ) {
+ antiId = ruleGroupId + STRING0 + subId + STRING1 ;
+ } else {
+ antiId = ruleGroupId ;
+ }
}
final DisambiguationPatternRule rule = new DisambiguationPatternRule (
antiId + STRING2 + antiPatternCounter ,
|
make id a bit more informative
|
<nb> import NAMESPACE ;
public class PluginServlet extends HttpServlet {
private static Map < String , HttpServlet > servlets ;
- private static File pluginDirectory ;
private static PluginManager pluginManager ;
private static ServletConfig servletConfig ;
static {
servlets = new ConcurrentHashMap < String , HttpServlet > ( ) ;
- pluginDirectory = new File ( JiveGlobals . getHomeDirectory ( ) , STRING0 ) ;
}
public void init ( ServletConfig config ) throws ServletException {
<nb> public class PluginServlet extends HttpServlet {
response . setStatus ( HttpServletResponse . SC_NOT_FOUND ) ;
return ;
}
+ File pluginDirectory = new File ( JiveGlobals . getHomeDirectory ( ) , STRING0 ) ;
File image = new File ( pluginDirectory , parts [ NUMBER0 ] + File . separator + STRING1 +
File . separator + STRING2 + File . separator + parts [ NUMBER1 ] ) ;
if ( ! image . exists ( ) ) {
|
Removed pluginsDirectory static variable due to possible misconfiguration if JiveGlobal homeDirectory was not initialized yet
|
<nb> public class SQLInsertClause implements InsertClause < SQLInsertClause > {
return this ;
}
+ @ nullable
@ java.lang.suppresswarnings ( STRING0 )
public < T > T executeWithKey ( Path < T > path ) {
ResultSet rs = executeWithKeys ( ) ;
|
added Nullable annotation
|
<nb> public class TransportExecutor implements Executor {
COMMENT
COMMENT
COMMENT
+ COMMENT
COMMENT
- COMMENT
- COMMENT
- COMMENT
- COMMENT
- COMMENT
- COMMENT
- COMMENT
- COMMENT
- COMMENT
- COMMENT
- COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
COMMENT
- COMMENT
- COMMENT
- COMMENT
- COMMENT
- COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
COMMENT
COMMENT
COMMENT
|
Fix javadoc formatting in TransportExecutor
|
<nb> public class GitRepositoryReaderTest extends LightIdeaTestCase {
if ( file . isDirectory ( ) ) { SINGLE
return true ;
}
- String name = FileUtil . getRelativePath ( refsHeads , file ) ;
+ String relativePath = FileUtil . getRelativePath ( refsHeads , file ) ;
+ if ( relativePath == null ) {
+ return true ;
+ }
+ String name = FileUtil . toSystemIndependentName ( relativePath ) ;
GitTestBranch branch = null ;
try {
branch = new GitTestBranch ( name , FileUtil . loadFile ( file ) ) ;
|
read branch info correctly on Windows
|
<nb> import NAMESPACE ;
COMMENT
COMMENT
COMMENT
- COMMENT
+ COMMENT
COMMENT
COMMENT
COMMENT
|
Fix spelling mistake
|
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
- import NAMESPACE ;
- import NAMESPACE ;
- import NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
COMMENT
<nb> public class BugPatternIndexYamlWriter {
void dump ( Collection < Instance > patterns , Writer w )
throws IOException {
- Map < String , List < Map < String , String > > > data = new HashMap < > ( ) ;
+ Map < String , List < Map < String , String > > > data = new TreeMap < > ( ) ;
Map < String , Collection < Instance > > index = index ( patterns , new Function < Instance , String > ( ) {
@ override
|
Use a TreeMap to preserve key order
|
<nb> public abstract class Drawable {
COMMENT
COMMENT
public void draw ( Canvas canvas ) {
- if ( canvas != null && canvas . isHardwareAccelerated ( ) ) {
+ if ( canvas != null && canvas . isHardwareAccelerated ( ) && false ) { SINGLE
final HardwareCanvas hardwareCanvas = ( HardwareCanvas ) canvas ;
final DisplayList displayList = getDisplayList ( hardwareCanvas ) ;
if ( displayList != null ) {
|
Disable Drawable DisplayLists
|
<nb> public class WorkerTaskMonitorTest
workerCuratorCoordinator ,
new ThreadPoolTaskRunner (
new TaskToolboxFactory (
- new TaskConfig ( tmp . toString ( ) , null , null , NUMBER0 ) ,
+ new TaskConfig ( tmp . toString ( ) , null , null , NUMBER0 , null ) ,
null , null , null , null , null , null , null , null , null , null , null , new SegmentLoaderFactory (
new OmniSegmentLoader (
ImmutableMap . < String , DataSegmentPuller > of (
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> public class PullDependencies implements Runnable
allCoordinates . addAll ( coordinates ) ;
}
if ( ! noDefaultHadoop ) {
- allCoordinates . add ( HadoopIndexTask . DEFAULT_HADOOP_COORDINATES ) ;
+ allCoordinates . addAll ( TaskConfig . DEFAULT_DEFAULT_HADOOP_COORDINATES ) ;
}
try {
final DefaultTeslaAether aetherClient = Initialization . getAetherClient ( extensionsConfig ) ;
|
fix more test breakage
|
<nb> import NAMESPACE ;
import static NAMESPACE ;
import static NAMESPACE ;
import static NAMESPACE ;
- SINGLE
import static NAMESPACE ;
@ suppresswarnings ( STRING0 )
|
remove static import temp workaround
|
<nb>
package NAMESPACE ;
- import NAMESPACE ;
import NAMESPACE ;
<nb> public class MongoException extends RuntimeException {
}
COMMENT
- COMMENT
- COMMENT
- COMMENT
- COMMENT
- public MongoException ( final BSONObject o ) {
- this ( ServerError . getCode ( o ) , ServerError . getMsg ( o , STRING0 ) ) ;
- }
-
- COMMENT
COMMENT
COMMENT
COMMENT
<nb> public class MongoException extends RuntimeException {
public DuplicateKey ( final org . mongodb . MongoDuplicateKeyException e ) {
super ( e ) ;
}
-
- public DuplicateKey ( final CommandResult commandResult ) {
- super ( commandResult ) ;
- }
}
}
|
Removed BSONObject dependency from com mongodb MongoException
|
<nb> public class RajawaliRenderer implements GLSurfaceView . Renderer , INode {
}
protected void destroyScene ( ) {
+ mSceneInitialized = false ;
for ( BaseObject3D child : mChildren ) {
child . destroy ( ) ;
}
|
Consider scene uninitialized after destroyScene
|
<nb> public final class Util {
if ( stringUri == null ) {
return baseUri ;
}
+ if ( baseUri == null ) {
+ return Uri . parse ( stringUri ) ;
+ }
+ if ( stringUri . startsWith ( STRING0 ) ) {
+ return new Uri . Builder ( )
+ . scheme ( baseUri . getScheme ( ) )
+ . authority ( baseUri . getAuthority ( ) )
+ . appendEncodedPath ( stringUri )
+ . build ( ) ;
+ }
Uri uri = Uri . parse ( stringUri ) ;
- if ( ! uri . isAbsolute ( ) && baseUri != null ) {
- uri = Uri . withAppendedPath ( baseUri , stringUri ) ;
+ if ( uri . isAbsolute ( ) ) {
+ return uri ;
}
- return uri ;
+ return Uri . withAppendedPath ( baseUri , stringUri ) ;
}
COMMENT
|
Resolve reference Uris correctly
|
<nb>
package NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
+ import NAMESPACE ;
+
public class NetworkUtilsTest {
@ test
<nb> public class NetworkUtilsTest {
Assert . assertEquals ( NetworkUtils . resolveHostName ( null ) , null ) ;
Assert . assertEquals ( NetworkUtils . resolveHostName ( STRING0 ) , STRING0 ) ;
}
+
+ @ test
+ public void getFqdnHostTest ( ) throws UnknownHostException {
+ Assert . assertEquals ( NetworkUtils . getFqdnHost ( new InetSocketAddress ( STRING0 , NUMBER0 ) ) ,
+ STRING0 ) ;
+ Assert . assertEquals ( NetworkUtils . getFqdnHost ( new NetAddress ( STRING0 , NUMBER0 , NUMBER0 ) ) , STRING0 ) ;
+ }
}
|
add unit test to NetworkUtils
|
<nb> public class OutputChecker {
result = result . replaceAll ( STRING0 , STRING1 ) ;
result = result . replaceAll ( STRING2 , STRING3 ) ;
result = result . replaceAll ( STRING4 , STRING5 ) ;
- result = result . replaceAll ( STRING6 , STRING7 ) ;
+ result = result . replaceAll ( STRING8 , STRING7 ) ;
result = result . replaceAll ( STRING9 , STRING10 ) ;
result = result . replaceAll ( STRING11 , STRING10 ) ;
result = result . replaceAll ( STRING12 + TEST_JDK_HOME_STR + STRING13 , STRING10 ) ;
|
fixed blinking testApplet
|
<nb> public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
sb . append ( STRING0 ) ;
} else {
w . write ( next ) ;
- w . append ( STRING0 ) ;
+ w . write ( STRING0 ) ;
}
}
} catch ( IOException e ) {
|
Process consumeProcessXXX methods do not handle newline properly
|
<nb> public class SiteSettingsFragment extends PreferenceFragment
String entry = input . getText ( ) . toString ( ) ;
if ( ! TextUtils . isEmpty ( entry ) && ! mEditingList . contains ( entry ) ) {
mEditingList . add ( entry ) ;
- mAdapter = null ;
- list . setAdapter ( getAdapter ( ) ) ;
+ getAdapter ( ) . notifyItemInserted ( getAdapter ( ) . getItemCount ( ) - NUMBER0 ) ;
mSiteSettings . saveSettings ( ) ;
AnalyticsUtils . trackWithCurrentBlogDetails (
AnalyticsTracker . Stat . SITE_SETTINGS_ADDED_LIST_ITEM ) ;
|
Replace resetting adapter to null with notifyItemInserted
|
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> public class ListManagedCursorTest extends ActivityInstrumentationTestCase < ListM
COMMENT
COMMENT
@ largetest
+ @ suppress SINGLE
public void testTouchScrolling ( ) {
Instrumentation inst = getInstrumentation ( ) ;
<nb> public class ListManagedCursorTest extends ActivityInstrumentationTestCase < ListM
COMMENT
COMMENT
@ largetest
+ @ suppress SINGLE
public void testKeyScrollingToTouchMode ( ) {
Instrumentation inst = getInstrumentation ( ) ;
|
Suppress tests in ListManagedCursorTest
|
<nb>
package NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> public class EditorWebView extends EditorWebViewAbstract {
super ( context , attrs ) ;
}
+ @ suppresslint ( STRING0 )
public void execJavaScriptFromString ( String javaScript ) {
if ( Build . VERSION . SDK_INT >= NUMBER0 ) {
this . evaluateJavascript ( javaScript , null ) ;
|
Suppressed NewApi lint check for EditorWebView execJavaScriptFromString
|
<nb> public class ExtensionHttpSessions extends ExtensionAdaptor implements SessionCh
this . getHttpSessionsPanel ( ) . addSite ( site ) ;
SINGLE
- if ( param . isEnabledProxyOnly ( ) && initiator != HttpSender . PROXY_INITIATOR )
+ if ( getParam ( ) . isEnabledProxyOnly ( ) && initiator != HttpSender . PROXY_INITIATOR )
return ;
SINGLE
<nb> public class ExtensionHttpSessions extends ExtensionAdaptor implements SessionCh
this . getHttpSessionsPanel ( ) . addSite ( site ) ;
SINGLE
- if ( param . isEnabledProxyOnly ( ) && initiator != HttpSender . PROXY_INITIATOR )
+ if ( getParam ( ) . isEnabledProxyOnly ( ) && initiator != HttpSender . PROXY_INITIATOR )
return ;
SINGLE
|
Fixed issue with Param initialization
|
<nb>
package NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
- import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> import NAMESPACE ;
import static NAMESPACE ;
import static NAMESPACE ;
import static NAMESPACE ;
- import static NAMESPACE ;
- import static NAMESPACE ;
import static NAMESPACE ;
public class OkHttpClientTest {
|
Removes unused imports in OkHttpClientTest
|
<nb> public class JLanguageTool {
private static String getBuildDate ( ) {
try {
final URL res = JLanguageTool . class . getResource ( JLanguageTool . class . getSimpleName ( ) + STRING0 ) ;
+ if ( res == null ) {
+ SINGLE
+ return null ;
+ }
final Object connObj = res . openConnection ( ) ;
if ( connObj instanceof JarURLConnection ) {
final JarURLConnection conn = ( JarURLConnection ) connObj ;
|
avoid NullPointerException on Android
|
<nb> class NioClientSocketPipelineSink extends AbstractChannelSink {
channel . getCloseFuture ( ) . addListener ( new ChannelFutureListener ( ) {
public void operationComplete ( ChannelFuture f )
throws Exception {
- cf . setFailure ( new ClosedChannelException ( ) ) ;
+ if ( ! cf . isDone ( ) ) {
+ cf . setFailure ( new ClosedChannelException ( ) ) ;
+ }
}
} ) ;
cf . addListener ( ChannelFutureListener . CLOSE_ON_FAILURE ) ;
<nb> class NioClientSocketPipelineSink extends AbstractChannelSink {
} catch ( Throwable t ) {
cf . setFailure ( t ) ;
fireExceptionCaught ( channel , t ) ;
+ NioWorker . close ( channel , succeededFuture ( channel ) ) ;
}
}
|
Should close the channel explicitly on connection attempt failure
|
<nb> public class PackageManagerService extends IPackageManager . Stub {
COMMENT
COMMENT
private boolean isVerificationEnabled ( ) {
+ if ( ! DEFAULT_VERIFY_ENABLE ) {
+ return false ;
+ }
+
return android . provider . Settings . Global . getInt ( mContext . getContentResolver ( ) ,
- android . provider . Settings . Global . PACKAGE_VERIFIER_ENABLE ,
- DEFAULT_VERIFY_ENABLE ? NUMBER0 : NUMBER1 ) == NUMBER0 ? true : false ;
+ android . provider . Settings . Global . PACKAGE_VERIFIER_ENABLE , NUMBER0 ) == NUMBER0 ;
}
COMMENT
|
DEFAULT_VERIFY_ENABLE turns verification off
|
<nb> public class LineChart extends View {
++ valueIndex ;
}
}
- break ;
+ return true ;
case MotionEvent . ACTION_UP :
SINGLE
if ( mSelectedValueIndex >= NUMBER0 ) {
<nb> public class LineChart extends View {
mSelectedValueIndex = Integer . MIN_VALUE ;
invalidate ( ) ;
}
- break ;
+ return true ;
case MotionEvent . ACTION_MOVE :
SINGLE
if ( mSelectedValueIndex >= NUMBER0 ) {
<nb> public class LineChart extends View {
invalidate ( ) ;
}
}
- break ;
+ return true ;
case MotionEvent . ACTION_CANCEL :
SINGLE
if ( mSelectedValueIndex >= NUMBER0 ) {
<nb> public class LineChart extends View {
mSelectedValueIndex = Integer . MIN_VALUE ;
invalidate ( ) ;
}
- break ;
+ return true ;
default :
- break ;
+ return true ;
}
- return true ;
}
public void setData ( final ChartData rawData ) {
|
Refactored onTouch method
|
<nb> public abstract class AbstractZipalignMojo extends AbstractAndroidMojo {
getLog ( ) . info ( STRING0 + command ) ;
getLog ( ) . info ( STRING1 + parameters ) ;
executor . executeCommand ( command , parameters ) ;
+
+ SINGLE
+ File target = new File ( project . getBasedir ( ) , project . getBuild ( ) . getDirectory ( ) ) ;
+ File aligned = new File ( target , parsedOutputApk ) ;
+ if ( aligned . exists ( ) ) {
+ projectHelper . attachArtifact ( project , STRING2 , STRING3 , aligned ) ;
+ getLog ( ) . info ( STRING4 + aligned . getAbsolutePath ( ) + STRING5 ) ;
+ } else {
+ getLog ( ) . error ( STRING6 + aligned . getAbsolutePath ( ) + STRING5 +
+ STRING7 ) ;
+ }
} catch ( ExecutionException e ) {
throw new MojoExecutionException ( STRING8 , e ) ;
}
|
Attach zipaligned artifact
|
<nb> public class FrameBuffer implements Disposable {
COMMENT
COMMENT
COMMENT
- COMMENT
+ COMMENT
COMMENT
COMMENT
COMMENT
<nb> public class FrameBuffer implements Disposable {
throw new IllegalStateException ( STRING0 ) ;
if ( result == GL20 . GL_FRAMEBUFFER_UNSUPPORTED )
throw new IllegalStateException ( STRING1 ) ;
- throw new IllegalStateException ( String . format ( STRING2 , result ) ) ;
+ throw new IllegalStateException ( STRING3 + result ) ;
}
}
|
Fix compile error on GWT sorry
|
<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 ;
COMMENT
<nb> import NAMESPACE ;
COMMENT
public class JcrConverterTest extends Assert {
- protected TypeConverter converter = new DefaultTypeConverter ( new DefaultPackageScanClassResolver ( ) ,
- new ReflectionInjector ( ) , new DefaultFactoryFinderResolver ( ) . resolveDefaultFactoryFinder ( new DefaultClassResolver ( ) ) ) ;
+ protected TypeConverter converter ;
+
+ @ before
+ public void init ( ) throws Exception {
+ converter = new DefaultTypeConverter ( new DefaultPackageScanClassResolver ( ) ,
+ new ReflectionInjector ( ) , new DefaultFactoryFinderResolver ( ) . resolveDefaultFactoryFinder ( new DefaultClassResolver ( ) ) ) ;
+ ServiceHelper . startService ( converter ) ;
+ }
@ test
public void testBooleanValueConverter ( ) throws Exception {
|
Fixed unit test
|
<nb> public class LegacyGlobalConfigurationAdapter {
;
for ( AdvancedExternalizerConfig externalizerConfig : legacy . getExternalizers ( ) ) {
- builder . serialization ( ) . addAdvancedExternalizer ( externalizerConfig . getAdvancedExternalizer ( ) ) ;
+ builder . serialization ( ) . addAdvancedExternalizer ( externalizerConfig . getId ( ) , externalizerConfig . getAdvancedExternalizer ( ) ) ;
}
builder . asyncTransportExecutor ( )
|
When copying advancedexternalizer from the legacy configuration use the
|
<nb> public abstract class PollingGraphUpdater implements GraphUpdater {
@ override
final public void run ( ) {
try {
- LOG . info ( STRING0 , this . getClass ( ) . getName ( ) , this . hashCode ( ) ) ;
+ LOG . info ( STRING1 , this ) ;
SINGLE
while ( true ) {
try {
|
improve polling graph updater logging
|
<nb> public class PatternRuleHandler extends XMLRuleHandler {
regexStr = regexStr + STRING0 ;
COMMENT
}
+ if ( ruleAntiPatterns != null && ruleAntiPatterns . size ( ) > NUMBER0 ) {
+ throw new RuntimeException ( STRING1 + id ) ;
+ }
rule = new RegexPatternRule ( id , name , message . toString ( ) , suggestionsOutMsg . toString ( ) , language , Pattern . compile ( regexStr , flags ) ) ;
} else {
throw new IllegalStateException ( STRING2 ) ;
|
throw exception when regexp is used with antipattern as it s not supported yet
|
<nb>
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
package NAMESPACE ;
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
public class BackgroundExceptionEvent {
public final Throwable throwable ;
public final Object causingEvent ;
public final Object causingSubscriber ;
-
+
public BackgroundExceptionEvent ( Throwable throwable , Object causingEvent , Object causingSubscriber ) {
this . throwable = throwable ;
this . causingEvent = causingEvent ;
|
added TODO to BackgroundExceptionEvent
|
<nb>
SINGLE
SINGLE
SINGLE
+ SINGLE
+
package NAMESPACE ;
import NAMESPACE ;
<nb> public class ScannerParam extends AbstractParam {
public static final int RPC_USERDEF = NUMBER0 < < NUMBER1 ;
SINGLE
- public static final int TARGET_INJECTABLE_DEFAULT = TARGET_QUERYSTRING | TARGET_POSTDATA | TARGET_URLPATH ;
+ public static final int TARGET_INJECTABLE_DEFAULT = TARGET_QUERYSTRING | TARGET_POSTDATA ;
public static final int TARGET_ENABLED_RPC_DEFAULT = RPC_MULTIPART | RPC_XML | RPC_JSON | RPC_GWT | RPC_ODATA ;
SINGLE
|
Scan URL path elements turn off by default
|
<nb> abstract class HashSlotArrayBase {
private void markAllUnassigned ( ) {
final long capacity = capacity ( ) ;
- mem . setMemory ( baseAddress , capacity * slotLength , ( byte ) NUMBER0 ) ;
- if ( unassignedSentinel == NUMBER0 ) {
- return ;
- }
final long addrOfFirstSentinel = baseAddress + offsetOfUnassignedSentinel ;
final int stride = slotLength ;
for ( long i = NUMBER0 ; i < capacity ; i ++ ) {
|
Optimize HashSlotArrayBase markAllUnassigned
|
<nb> public final class OSSUnderFileSystem extends UnderFileSystem {
public void setConf ( Object conf ) {
}
- SINGLE
+ SINGLE
@ override
public void setOwner ( String path , String user , String group ) { }
- SINGLE
+ SINGLE
@ override
public void setMode ( String path , short mode ) throws IOException { }
- SINGLE
+ SINGLE
@ override
public String getOwner ( String path ) throws IOException {
return STRING0 ;
}
- SINGLE
+ SINGLE
@ override
public String getGroup ( String path ) throws IOException {
return STRING0 ;
}
- SINGLE
+ SINGLE
@ override
public short getMode ( String path ) throws IOException {
return Constants . DEFAULT_FILE_SYSTEM_MODE ;
|
Update oss acl comments
|
<nb> public class GLMTest extends TestUtil {
JsonObject glm = computeGLMlog ( lsms , va , true ) ; SINGLE
JsonObject jcoefs = glm . get ( STRING0 ) . getAsJsonObject ( ) ;
double icept = jcoefs . get ( STRING1 ) . getAsDouble ( ) ;
-
- assertCat ( jcoefs , icept , STRING2 , FLOAT0 ) ;
+ SINGLE
assertCat ( jcoefs , icept , STRING3 , FLOAT1 ) ;
assertCat ( jcoefs , icept , STRING4 , FLOAT2 ) ;
UKV . remove ( Key . make ( glm . get ( Constants . MODEL_KEY ) . getAsString ( ) ) ) ;
|
added missing update of GLMTest which reflects the changed in GLM to ignore first level of categoricals
|
<nb> public abstract class SSTable
return StringUtils . join ( parts , STRING0 ) ;
}
- protected String indexFilename ( )
+ public String indexFilename ( )
{
return indexFilename ( path ) ;
}
<nb> public abstract class SSTable
return StringUtils . join ( parts , STRING0 ) ;
}
- protected String filterFilename ( )
+ public String filterFilename ( )
{
return filterFilename ( path ) ;
}
|
forgot SSTable part of last
|
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
+ import static NAMESPACE ;
+ import static NAMESPACE ;
import static NAMESPACE ;
public class GetCharacterDetailsTest {
<nb> public class GetCharacterDetailsTest {
@ test public void testThatDetailUsecaseIsCalledOnce ( ) {
mGetCharacterDetailUsecase . execute ( ) ;
- Mockito . verify ( mRepository , only ( ) ) ;
+ Mockito . verify ( mRepository , only ( ) ) . getCharacter ( FAKE_CHARACTER_ID ) ;
+ }
+
+ @ test public void testThatAConcreteUsecaseImplementsAnUsecase ( ) {
+ assertThat ( mGetCharacterDetailUsecase , instanceOf ( Usecase . class ) ) ;
}
}
|
Added interface test
|
<nb> public class InputLauncher {
inputRegistry . add ( inputState ) ;
} else {
inputState = inputRegistry . getInputState ( input . getId ( ) ) ;
+ if ( inputState . getState ( ) == IOState . Type . RUNNING || inputState . getState ( ) == IOState . Type . STARTING )
+ return inputState ;
inputState . setStoppable ( input ) ;
}
|
Preventing starting running inputs to get started twice
|
<nb> public class JavaFileHighlighter extends SyntaxHighlighterBase {
XmlTokenType . XML_EMPTY_ELEMENT_END ,
XmlTokenType . TAG_WHITE_SPACE ,
XmlTokenType . XML_TAG_NAME ,
+ XmlTokenType . XML_NAME ,
XmlTokenType . XML_ATTRIBUTE_VALUE_TOKEN ,
XmlTokenType . XML_ATTRIBUTE_VALUE_START_DELIMITER ,
XmlTokenType . XML_ATTRIBUTE_VALUE_END_DELIMITER ,
|
Makes html attributes highlighter as markup in javadocs as well
|
<nb> public class VcsLogPathsIndex extends VcsLogFullDetailsIndex < Integer > {
private static class ToLowerCaseStringDescriptor implements KeyDescriptor < String > {
@ override
public int getHashCode ( String value ) {
- return CaseInsensitiveStringHashingStrategy . INSTANCE . hashCode ( ) ;
+ return CaseInsensitiveStringHashingStrategy . INSTANCE . computeHashCode ( value ) ;
}
@ override
|
vcs log fix hash code calculation
|
<nb> import NAMESPACE
}
public void invoke ( @ notnull Project project , Editor editor , PsiFile psiFile ) throws IncorrectOperationException {
- SINGLE
final GrReferenceElement newPackageReference = GroovyElementFactory . getInstance ( myPackageDefinition . getProject ( ) ) . createPackegeReferenceElementFromText ( myNewPackageName ) ;
myPackageDefinition . replacePackageReference ( newPackageReference ) ;
}
|
wrap exception fixed
|
<nb> public abstract class AbstractLuceneIndex implements Closeable
partitionsLock . lock ( ) ;
try
{
- for ( IndexPartition partition : getPartitions ( ) )
- {
- partition . maybeRefreshBlocking ( ) ;
- }
+ getPartitions ( ) . parallelStream ( ) . forEach ( this : : maybeRefreshPartition ) ;
+ }
+ catch ( UncheckedIOException e )
+ {
+ throw e . getCause ( ) ;
}
finally
{
<nb> public abstract class AbstractLuceneIndex implements Closeable
}
}
+ private void maybeRefreshPartition ( IndexPartition partition )
+ {
+ try
+ {
+ partition . maybeRefreshBlocking ( ) ;
+ }
+ catch ( IOException e )
+ {
+ throw new UncheckedIOException ( e ) ;
+ }
+ }
+
public List < IndexPartition > getPartitions ( )
{
ensureOpen ( ) ;
|
Switch partition update to be parallel
|
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
+ import NAMESPACE ;
+
import NAMESPACE ;
import NAMESPACE ;
<nb> public class PlatformAlarmService extends IntentService {
@ override
protected void onHandleIntent ( final Intent intent ) {
+ if ( intent == null ) {
+ Cat . i ( STRING0 ) ;
+ return ;
+ }
+
int jobId = intent . getIntExtra ( PlatformAlarmReceiver . EXTRA_JOB_ID , - NUMBER0 ) ;
final JobProxy . Common common = new JobProxy . Common ( this , jobId ) ;
|
Ignore null intents in PlatformAlarmService
|
<nb> public class RedisDispatcher implements IRecordDispatcher {
public void record ( HashMap < String , String > message ) {
Long msgid = jedis . incr ( STRING0 ) ;
jedis . hmset ( STRING1 + SEPARATOR_CHAR + msgid , message ) ;
- jedis . lpush ( STRING2 + SEPARATOR_CHAR + this . meeting + SEPARATOR_CHAR + STRING3 , msgid . toString ( ) ) ;
+ jedis . rpush ( STRING2 + SEPARATOR_CHAR + this . meeting + SEPARATOR_CHAR + STRING3 , msgid . toString ( ) ) ;
}
COMMENT
|
do an RPUSH instead of an LPUSH
|
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> public class Response {
public Response ( ) {
}
- public Response ( Request req ) {
- this . requestParameters = req . getParameters ( ) ;
- }
-
public Response ( ServletRequest sr ) {
this . requestParameters = new HashMap < String , String > ( ) ;
SINGLE
<nb> public class Response {
}
}
- public Response ( Request req , TripPlan plan ) {
- this ( req ) ;
- this . plan = plan ;
- }
-
SINGLE
SINGLE
|
remove unused constructors
|
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
- SINGLE
-
SINGLE
SINGLE
- SINGLE
+ SINGLE
+ SINGLE
+ SINGLE
SINGLE
<nb> public class SourceNavigation extends JavaScriptObject
public final String toDebugString ( )
{
- return getPath ( ) != null ? getPath ( ) : getDocumentId ( ) + STRING0 +
+ return ( getPath ( ) != null ? getPath ( ) : getDocumentId ( ) ) + STRING0 +
getPosition ( ) . getRow ( ) + STRING1 + getPosition ( ) . getColumn ( ) + STRING2 ;
}
}
|
improve debug diagnostics for source nav history
|
<nb> public class Constants {
public static final String FORM_USERNAME = STRING0 ;
SINGLE
- public static final String DEFAULT_KEYTAB = STRING1 ;
- public static final String DEFAULT_SPN_CLASS = STRING2 ;
public static final String KRB5_CONF_PROPERTY = STRING3 ;
public static final String DEFAULT_KRB5_CONF = STRING4 ;
public static final String JAAS_CONF_PROPERTY =
|
Removed unused code
|
<nb> public class PersistenceExtensions implements ManagedService {
}
COMMENT
- COMMENT
+ COMMENT
COMMENT
COMMENT
COMMENT
COMMENT
COMMENT
- static public HistoricItem parentState ( Item item ) {
+ static public HistoricItem previousState ( Item item ) {
if ( isDefaultServiceAvailable ( ) ) {
- return parentState ( item , defaultService ) ;
+ return previousState ( item , defaultService ) ;
} else {
return null ;
}
}
COMMENT
- COMMENT
+ COMMENT
COMMENT
COMMENT
COMMENT
COMMENT
COMMENT
COMMENT
- static public HistoricItem parentState ( Item item , String serviceName ) {
+ static public HistoricItem previousState ( Item item , String serviceName ) {
PersistenceService service = services . get ( serviceName ) ;
if ( service instanceof QueryablePersistenceService ) {
QueryablePersistenceService qService = ( QueryablePersistenceService ) service ;
|
Renamed parentState to previousState
|
<nb> public class BatchNode extends GeometryGroupNode implements Savable {
this . needsFullRebatch = needsFullRebatch ;
}
- public int getOffsetIndex ( Geometry batchedGeometry ) {
- return batchedGeometry . startIndex ;
- }
-
@ override
public Node clone ( boolean cloneMaterials ) {
BatchNode clone = ( BatchNode ) super . clone ( cloneMaterials ) ;
<nb> public class BatchNode extends GeometryGroupNode implements Savable {
}
}
clone . needsFullRebatch = true ;
- clone . batches . clear ( ) ;
- clone . batchesByGeom . clear ( ) ;
+ clone . batches = new SafeArrayList < Batch > ( Batch . class ) ;
+ clone . batchesByGeom = new HashMap < Geometry , Batch > ( ) ;
clone . batch ( ) ;
}
return clone ;
|
Fix issue where BatchNode clone would still re use the previous BatchNode s data structures
|
<nb> public final class HlsMasterPlaylistParser implements ManifestParser < HlsMasterPl
String codecsString = HlsParserUtil . parseOptionalStringAttr ( line , CODECS_ATTR_REGEX ,
CODECS_ATTR ) ;
if ( codecsString != null ) {
- codecs = codecsString . split ( STRING0 ) ;
+ codecs = codecsString . split ( STRING1 ) ;
} else {
codecs = null ;
}
|
Trim whitespace from codecs
|
<nb> public class HostConfig
COMMENT
- COMMENT
+ COMMENT
+ COMMENT
COMMENT
protected boolean deployXML = false ;
<nb> public class HostConfig
SINGLE
if ( log . isInfoEnabled ( ) ) {
- log . info ( sm . getString ( STRING0 , file ) ) ;
+ log . info ( sm . getString ( STRING0 , file ,
+ configBase . getPath ( ) ) ) ;
}
Context context = null ;
|
Improve log message when deploying from configBase to make it clearer where xml file is read from
|
<nb> public class InfiniteInputIterator implements MutableObjectIterator < PactRecord >
@ override
public boolean next ( PactRecord target ) {
target . setField ( NUMBER0 , val1 ) ;
- target . setField ( NUMBER0 , val2 ) ;
+ target . setField ( NUMBER1 , val2 ) ;
return true ;
}
}
|
Fixed Test for DataSinkTask
|
<nb> import NAMESPACE ;
COMMENT
public class PluginOptionSpecTest {
- @ test ( expected = IllegalArgumentException . class )
- public void optionalSensitiveTest ( ) {
- new PluginOptionSpec ( STRING0 , STRING1 , ValueType . STRING , false , true , null ) ;
- }
-
- @ test ( expected = IllegalArgumentException . class )
- public void optionalNoDefaultTest ( ) {
- new PluginOptionSpec ( STRING0 , STRING1 , ValueType . STRING , false , false , null ) ;
- }
-
@ test
public void nonSetMandatoryTest ( ) {
PluginOptionSpec pluginOptionSpec = new PluginOptionSpec ( STRING0 , STRING1 , ValueType . STRING , true , true , null ) ;
|
Removing no longer valid tests
|
<nb> public abstract class MavenTestCase extends UsefulTestCase {
getMavenGeneralSettings ( ) . setMavenHome ( home ) ;
}
- restoreSettingsFile ( ) ;
-
UIUtil . invokeAndWaitIfNeeded ( new Runnable ( ) {
@ override
public void run ( ) {
+ try {
+ restoreSettingsFile ( ) ;
+ }
+ catch ( IOException e ) {
+ throw new RuntimeException ( e ) ;
+ }
+
ApplicationManager . getApplication ( ) . runWriteAction ( new Runnable ( ) {
@ override
public void run ( ) {
|
read action in tests
|
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
|
Removed unused import
|
<nb> public class ConsumeDataTest extends ZooKeeperTestSupport {
delay ( NUMBER0 ) ;
client . delete ( STRING0 ) ;
- mock . assertIsSatisfied ( NUMBER1 , TimeUnit . SECONDS ) ;
+ MockEndpoint . assertIsSatisfied ( NUMBER1 , TimeUnit . SECONDS ) ;
int lastVersion = - NUMBER2 ;
for ( int i = NUMBER3 ; i < mock . getExchanges ( ) . size ( ) ; i ++ ) {
<nb> public class ConsumeDataTest extends ZooKeeperTestSupport {
createCamelNode ( ) ;
updateNode ( NUMBER4 ) ;
- mock . assertIsSatisfied ( NUMBER1 , TimeUnit . SECONDS ) ;
+ MockEndpoint . assertIsSatisfied ( NUMBER1 , TimeUnit . SECONDS ) ;
client . delete ( STRING0 ) ;
}
|
Verifying my EGit settings
|
<nb> public abstract class BaseActivity extends Activity {
@ override
protected void onPostExecute ( RootInfo homeRoot ) {
- if ( homeRoot != null && mHome != null ) {
+ if ( homeRoot != null && mHome != null && ! isDestroyed ( ) ) {
SINGLE
mState . onRootChanged ( homeRoot ) ;
mSearchManager . update ( homeRoot ) ;
|
Check isDestroyed after finishing async HandleRootsChangedTask
|
<nb> public class BackgroundPreinitializer
@ override
public void onApplicationEvent ( ApplicationStartedEvent event ) {
- ExecutorService executor = Executors . newSingleThreadExecutor ( ) ;
- submit ( executor , new MessageConverterInitializer ( ) ) ;
- submit ( executor , new MBeanFactoryInitializer ( ) ) ;
- submit ( executor , new ValidationInitializer ( ) ) ;
- executor . shutdown ( ) ;
+ try {
+ ExecutorService executor = Executors . newSingleThreadExecutor ( ) ;
+ submit ( executor , new MessageConverterInitializer ( ) ) ;
+ submit ( executor , new MBeanFactoryInitializer ( ) ) ;
+ submit ( executor , new ValidationInitializer ( ) ) ;
+ executor . shutdown ( ) ;
+ }
+ catch ( Exception ex ) {
+ SINGLE
+ SINGLE
+ SINGLE
+ }
}
private void submit ( ExecutorService executor , Runnable runnable ) {
|
Perform initialization in foreground if BackgroundPreinitializer fails
|
<nb> public class DefaultFileSystemChangeWaiterFactory implements FileSystemChangeWai
lock . lock ( ) ;
try {
long lastChangeAtValue = lastChangeAt . get ( ) ;
- while ( ! cancellationToken . isCancellationRequested ( ) && error . get ( ) == null && ( lastChangeAtValue == NUMBER0 || monotonicClockMillis ( ) - lastChangeAtValue < quietPeriodMillis ) ) {
+ while ( ! cancellationToken . isCancellationRequested ( ) && error . get ( ) == null && shouldKeepWaitingForQuietPeriod ( lastChangeAtValue ) ) {
condition . await ( quietPeriodMillis , TimeUnit . MILLISECONDS ) ;
lastChangeAtValue = lastChangeAt . get ( ) ;
}
<nb> public class DefaultFileSystemChangeWaiterFactory implements FileSystemChangeWai
return ImmutableList . copyOf ( receivedEvents ) ;
}
+ private boolean shouldKeepWaitingForQuietPeriod ( long lastChangeAtValue ) {
+ long now = monotonicClockMillis ( ) ;
+ return lastChangeAtValue == NUMBER0 SINGLE
+ || now < lastChangeAtValue SINGLE
+ || now - lastChangeAtValue < quietPeriodMillis ;
+ }
+
@ override
public boolean isWatching ( ) {
return watching ;
|
Handle case where monotic clock isn t monotonic
|
<nb> public class AndroidHarness extends Activity implements TouchListener , DialogInt
}
isGLThreadPaused = false ;
+
+ gainFocus ( ) ;
}
@ override
protected void onPause ( ) {
+ loseFocus ( ) ;
+
logger . info ( STRING0 ) ;
super . onPause ( ) ;
if ( view != null ) {
|
Add calls to loseFocus and gainFocus when activity pauses and resumes
|
<nb> public class GithubShareAction extends DumbAwareAction {
final Project project = e . getData ( PlatformDataKeys . PROJECT ) ;
final VirtualFile file = e . getData ( PlatformDataKeys . VIRTUAL_FILE ) ;
- if ( project == null || project . isDisposed ( ) ) {
+ if ( project == null || project . isDisposed ( ) || ! GithubUtil . testGitExecutable ( project ) ) {
return ;
}
|
add missing testGitExecutable
|
<nb> class InterceptedInvocation implements Invocation , VerificationAwareInvocation {
@ override
public int hashCode ( ) {
+ SINGLE
return NUMBER0 ;
}
|
Added a TODO
|
<nb> import NAMESPACE ;
COMMENT
COMMENT
COMMENT
- interface Converter < Source extends Expr < ? > , Target extends Expr < ? > > {
+ interface Converter < S extends Expr < ? > , T extends Expr < ? > > {
Converter < EString , EString > toLowerCase = new Converter < EString , EString > ( ) {
@ override
<nb> interface Converter < Source extends Expr < ? > , Target extends Expr < ? > > {
COMMENT
COMMENT
COMMENT
- Target convert ( Source arg ) ;
+ T convert ( S arg ) ;
}
|
shortened type var names
|
<nb> final class CdiCamelFactory {
return Class . class . cast ( type ) . getName ( ) ;
}
if ( type instanceof ParameterizedType ) {
- return Stream . of ( ( ( ParameterizedType ) type ) . getActualTypeArguments ( ) )
+ ParameterizedType pt = ( ParameterizedType ) type ;
+ return Stream . of ( pt . getActualTypeArguments ( ) )
. map ( CdiCamelFactory : : authorityFromType )
- . collect ( joining ( STRING0 , STRING1 , STRING2 ) ) ;
+ . collect ( joining ( STRING0 , authorityFromType ( pt . getRawType ( ) ) + STRING1 , STRING2 ) ) ;
}
if ( type instanceof GenericArrayType ) {
GenericArrayType arrayType = ( GenericArrayType ) type ;
|
Missing raw type in CDI parameterized event endpoint URI
|
<nb> package NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
+ import NAMESPACE ;
+ import NAMESPACE ;
+ import NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> public abstract class OChannelBinaryClientAbstract extends OChannelBinary {
setReadResponseTimeout ( ) ;
connected ( ) ;
} catch ( java . net . SocketTimeoutException e ) {
- throw new IOException ( STRING0 + remoteHost + STRING1 + remotePort , e ) ;
+ throw new IOException ( STRING0 + remoteHost + STRING1 + remotePort + STRING2 + socketTimeout + STRING3 , e ) ;
}
try {
inStream = new BufferedInputStream ( socket . getInputStream ( ) , socketBufferSize ) ;
|
reported the timeout in the exception
|
<nb> public abstract class GrammaticalStructure extends TreeGraph {
basicGraph . add ( parent , t , GrammaticalRelation . DEPENDENT ) ;
}
}
- StackTraceElement [ ] trace = Thread . currentThread ( ) . getStackTrace ( ) ;
- if ( trace . length > NUMBER0 ) {
- System . err . println ( STRING0 + basicGraph ) ;
- System . err . println ( Arrays . toString ( trace ) ) ;
- throw new StackOverflowError ( ) ;
- SINGLE
- }
+ SINGLE
+ SINGLE
+ SINGLE
+ SINGLE
+ SINGLE
+ SINGLE
+ SINGLE
for ( TreeGraphNode kid : t . children ( ) ) {
attachStrandedNodes ( kid , root , ( kid . headWordNode ( ) != t . headWordNode ( ) ) , puncFilter , basicGraph ) ;
}
|
commented diagnostic info
|
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> public class VolleyDraweeAdapter extends ImageListAdapter < InstrumentedDraweeView
GenericDraweeHierarchy gdh = new GenericDraweeHierarchyBuilder ( getContext ( ) . getResources ( ) )
. setPlaceholderImage ( Drawables . sPlaceholderDrawable )
. setFailureImage ( Drawables . sErrorDrawable )
- . setRoundingParams ( RoundingParams . asCircle ( ) )
. build ( ) ;
InstrumentedDraweeView view = new InstrumentedDraweeView ( getContext ( ) ) ;
view . setHierarchy ( gdh ) ;
|
Remove Volley Drawee rounded corners
|
<nb> public class TestStartTransactionDuringLogRotation
public void tearDown ( ) throws Exception
{
writerStopped . set ( true ) ;
- writerTaskFuture . get ( NUMBER0 , TimeUnit . SECONDS ) ;
+ writerTaskFuture . get ( NUMBER1 , TimeUnit . SECONDS ) ;
db . shutdown ( ) ;
executor . shutdown ( ) ;
}
|
Increased timeout for awaiting a write task in test
|
<nb> public class SocketConnector implements Runnable {
boolean connected = false ;
Exception error = null ;
int configuredTimeoutMillis = connectionManager . getSocketConnectTimeoutSeconds ( ) * MILLIS_PER_SECOND ;
- int timeoutMillis = configuredTimeoutMillis > NUMBER0 && configuredTimeoutMillis < Integer . MAX_VALUE ?
- configuredTimeoutMillis : DEFAULT_IPV6_SOCKET_CONNECT_TIMEOUT_SECONDS * MILLIS_PER_SECOND ;
+ int timeoutMillis = configuredTimeoutMillis > NUMBER0 && configuredTimeoutMillis < Integer . MAX_VALUE
+ ? configuredTimeoutMillis : DEFAULT_IPV6_SOCKET_CONNECT_TIMEOUT_SECONDS * MILLIS_PER_SECOND ;
for ( Inet6Address inetAddress : possibleInetAddresses ) {
try {
tryToConnect ( new InetSocketAddress ( inetAddress , address . getPort ( ) ) , timeoutMillis ) ;
|
Fixed checkstyle issue
|
<nb> public class PlainTransportFuture < V extends TransportResponse > extends BaseFutur
} catch ( TimeoutException e ) {
throw new ElasticsearchTimeoutException ( e . getMessage ( ) ) ;
} catch ( InterruptedException e ) {
- Thread . currentThread ( ) . interrupt ( ) ;
throw new ElasticsearchIllegalStateException ( STRING0 , e ) ;
} catch ( ExecutionException e ) {
if ( e . getCause ( ) instanceof ElasticsearchException ) {
|
PlainTransportFuture should not set currentThread
|
<nb> package NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
+ import NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
COMMENT
COMMENT
- COMMENT
+ COMMENT
COMMENT
COMMENT
public class OSQLFunctionSequence extends OSQLFunctionConfigurableAbstract {
<nb> public class OSQLFunctionSequence extends OSQLFunctionConfigurableAbstract {
else
seqName = configuredParameters [ NUMBER0 ] . toString ( ) ;
- return ODatabaseRecordThreadLocal . INSTANCE . get ( ) . getMetadata ( ) . getSequenceLibrary ( ) . getSequence ( seqName ) ;
+ OSequence result = ODatabaseRecordThreadLocal . INSTANCE . get ( ) . getMetadata ( ) . getSequenceLibrary ( ) . getSequence ( seqName ) ;
+ if ( result == null ) {
+ throw new OCommandExecutionException ( STRING0 + seqName ) ;
+ }
+ return result ;
}
@ override
|
Throw exception on SELECT sequence seqName
|
<nb> public class TextView extends View implements ViewTreeObserver . OnPreDrawListener
private boolean mSelectAllOnFocus = false ;
- private int mGravity = Gravity . TOP | Gravity . LEFT ;
+ private int mGravity = Gravity . TOP | Gravity . BEFORE ;
private boolean mHorizontallyScrolling ;
private int mAutoLinkMask ;
|
Fix default TextView gravity
|
<nb> public class VcsLogDataHolder implements Disposable {
logsToBuild . put ( root , refreshedLog . subList ( NUMBER0 , Math . min ( bottomIndex , refreshedLog . size ( ) ) ) ) ;
}
allRefs . addAll ( newRefs ) ;
- myLogData . setRefs ( root , newRefs ) ; SINGLE
- SINGLE
+
+ if ( myLogData != null ) {
+ myLogData . setRefs ( root , newRefs ) ; SINGLE
+ SINGLE
+ }
}
List < TimeCommitParents > compoundLog = myMultiRepoJoiner . join ( logsToBuild . values ( ) ) ;
|
don t set new refs to the LogData until it is ready
|
<nb> public class UnsupportedAbiVersionNotificationPanelProvider extends EditorNotifi
public EditorNotificationPanel createNotificationPanel ( @ notnull VirtualFile file , @ notnull FileEditor fileEditor ) {
try {
if ( DumbService . isDumb ( project ) ) return null ;
+ if ( ApplicationManager . getApplication ( ) . isUnitTestMode ( ) ) return null ;
if ( file . getFileType ( ) != JetFileType . INSTANCE ) return null ;
if ( CompilerManager . getInstance ( project ) . isExcludedFromCompilation ( file ) ) return null ;
|
Don t cause tests to hang because of UnsupportedAbiVersion notification
|
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
- import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> public abstract class CycledLeScanner {
SINGLE
long milliseconds = Long . MAX_VALUE ; SINGLE
AlarmManager alarmManager = ( AlarmManager ) mContext . getSystemService ( Context . ALARM_SERVICE ) ;
- alarmManager . set ( AlarmManager . RTC_WAKEUP , System . currentTimeMillis ( ) + milliseconds , getWakeUpOperation ( ) ) ;
+ alarmManager . set ( AlarmManager . RTC_WAKEUP , milliseconds , getWakeUpOperation ( ) ) ;
LogManager . d ( TAG , STRING0 , milliseconds , getWakeUpOperation ( ) ) ;
}
|
fixing canceling alarm
|
<nb> public class NotificationContentView extends FrameLayout {
}
public void reset ( ) {
+ if ( mContractedChild != null ) {
+ mContractedChild . animate ( ) . cancel ( ) ;
+ }
+ if ( mExpandedChild != null ) {
+ mExpandedChild . animate ( ) . cancel ( ) ;
+ }
removeAllViews ( ) ;
mContractedChild = null ;
mExpandedChild = null ;
<nb> public class NotificationContentView extends FrameLayout {
public void setContractedChild ( View child ) {
if ( mContractedChild != null ) {
+ mContractedChild . animate ( ) . cancel ( ) ;
removeView ( mContractedChild ) ;
}
sanitizeContractedLayoutParams ( child ) ;
<nb> public class NotificationContentView extends FrameLayout {
public void setExpandedChild ( View child ) {
if ( mExpandedChild != null ) {
+ mExpandedChild . animate ( ) . cancel ( ) ;
removeView ( mExpandedChild ) ;
}
addView ( child ) ;
|
Fix crash when reset gets called during an animation
|
<nb> public class PrettyCommentsPrinter extends JCTree . Visitor {
docComments = tree . docComments ;
printDocComment ( tree ) ;
if ( tree . pid != null ) {
+ consumeComments ( tree . pos ) ;
print ( STRING0 ) ;
printExpr ( tree . pid ) ;
print ( STRING1 ) ;
<nb>
+ COMMENT
+ Try out pretty comments .
+ COMMENT
+ package NAMESPACE ;
+
SINGLE
public class WithComments {
SINGLE
<nb>
+ COMMENT
+ Try out pretty comments .
+ COMMENT
+ package NAMESPACE ;
+
SINGLE
public class WithComments {
SINGLE
|
delombok would put copyright headers in between the package keyword and the actual package
|
<nb> public abstract class TomcatBaseTest extends TestCase {
SINGLE
System . setProperty ( STRING0 ,
STRING1 ) ;
+ System . setProperty ( STRING2 , new File (
+ getBuildDirectory ( ) , STRING3 ) . toString ( ) ) ;
tempDir = new File ( System . getProperty ( STRING4 , STRING5 ) ) ;
if ( ! tempDir . exists ( ) && ! tempDir . mkdirs ( ) ) {
|
When running the tests use log configuration specified by conf logging
|
<nb> public class AsyncDataSetIterator implements DataSetIterator {
@ override
public List < String > getLabels ( ) {
- return null ;
+ return baseIterator . getLabels ( ) ;
}
@ override
|
Fix nullptr exception
|
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
+ import NAMESPACE ;
+ import NAMESPACE ;
COMMENT
COMMENT
<nb> public class SessionAttributeMarshallerFactoryImpl implements SessionAttributeMa
public SessionAttributeMarshaller createMarshaller ( LocalDistributableSessionManager manager ) {
MarshallingConfiguration configuration = new MarshallingConfiguration ( ) ;
configuration . setClassResolver ( manager . getApplicationClassResolver ( ) ) ;
+ configuration . setSerializedCreator ( new SunReflectiveCreator ( ) ) ;
+ configuration . setExternalizerCreator ( new ReflectiveCreator ( ) ) ;
return new SessionAttributeMarshallerImpl ( new MarshallingContext ( this . factory , configuration ) ) ;
}
}
|
Use specific creators
|
<nb> public class CacheConfigReadOnly < K , V > extends CacheConfig < K , V > {
}
@ override
+ public CacheConfig setWanReplicationRef ( final WanReplicationRef wanReplicationRef ) {
+ throw new UnsupportedOperationException ( STRING0 + getName ( ) ) ;
+ }
+
+ @ override
public NearCacheConfig getNearCacheConfig ( ) {
final NearCacheConfig nearCacheConfig = super . getNearCacheConfig ( ) ;
if ( nearCacheConfig == null ) {
<nb> public class CacheConfigReadOnly < K , V > extends CacheConfig < K , V > {
}
return nearCacheConfig . getAsReadOnly ( ) ;
}
+
+ @ override
+ public WanReplicationRef getWanReplicationRef ( ) {
+ final WanReplicationRef wanReplicationRef = super . getWanReplicationRef ( ) ;
+ if ( wanReplicationRef == null ) {
+ return null ;
+ }
+ return wanReplicationRef . getAsReadOnly ( ) ;
+ }
}
|
Handle WanReplicationRef in CacheConfigReadOnly
|
<nb> public class GetDataMessage extends ListMessage {
public GetDataMessage ( NetworkParameters params ) {
super ( params ) ;
}
+
+ public void addTransaction ( Sha256Hash hash ) {
+ addItem ( new InventoryItem ( InventoryItem . Type . Transaction , hash ) ) ;
+ }
+
+ public void addBlock ( Sha256Hash hash ) {
+ addItem ( new InventoryItem ( InventoryItem . Type . Block , hash ) ) ;
+ }
}
<nb> public class Transaction extends ChildMessage implements Serializable {
maybeParse ( ) ;
return Collections . unmodifiableList ( outputs ) ;
}
+
+ COMMENT
+ public TransactionInput getInput ( int index ) {
+ maybeParse ( ) ;
+ return inputs . get ( index ) ;
+ }
+
+ public TransactionOutput getOutput ( int index ) {
+ maybeParse ( ) ;
+ return outputs . get ( index ) ;
+ }
public synchronized TransactionConfidence getConfidence ( ) {
if ( confidence == null ) {
|
Add some convenience getters to a couple of classes
|
<nb> public class AppCompatibility extends InstrumentationTestCase {
homeIntent . addFlags ( Intent . FLAG_ACTIVITY_NEW_TASK ) ;
Intent intent = mPackageManager . getLaunchIntentForPackage ( packageName ) ;
+ SINGLE
+ if ( intent == null ) {
+ return null ;
+ }
SINGLE
SINGLE
|
Skip apps without launch intent
|
<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 ;
<nb> import NAMESPACE ;
COMMENT
@ executiontestlisteners (
listeners = {
- MainServletExecutionTestListener . class
+ MainServletExecutionTestListener . class ,
+ TransactionalExecutionTestListener . class
} )
@ runwith ( LiferayIntegrationJUnitTestRunner . class )
+ @ transactional
public class CompanyLocalServiceTest {
@ before
|
Test Fixes Use Transactional because this class is dirtying database without removing its data
|
<nb> public class OCommandExecutorSQLCreateLink extends OCommandExecutorSQLPermission
public Object execute ( final Map < Object , Object > iArgs ) {
if ( destField == null )
throw new OCommandExecutionException ( STRING0 ) ;
-
+
if ( ! ( database instanceof ODatabaseDocumentTx ) )
- throw new OCommandSQLParsingException ( STRING1 ) ;
+ throw new OCommandSQLParsingException ( STRING2
+ + database . getClass ( ) + STRING3 ) ;
final ODatabaseDocumentTx db = ( ODatabaseDocumentTx ) database ;
|
changed message when db is not a document db
|
<nb> package NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> public class FilterGraphWithHiddenNodes implements LinearGraphWithHiddenNodes {
public List < Integer > getDownNodes ( int nodeIndex ) {
List < Integer > downNodes = new SmartList < Integer > ( ) ;
for ( int downNode : myDelegateGraph . getDownNodes ( nodeIndex ) ) {
- if ( nodeIsVisible ( downNode ) )
+ if ( downNode != LinearGraph . NOT_LOAD_COMMIT && nodeIsVisible ( downNode ) )
downNodes . add ( downNode ) ;
}
return downNodes ;
|
log Fix NOT_LOAD_COMMIT
|
<nb> public class TestServlet extends HttpServlet {
out . println ( STRING0 ) ;
request . getSession ( ) . invalidate ( ) ;
out . println ( STRING1 ) ;
- out . println ( STRING2 ) ;
+ out . println ( STRING3 ) ;
out . println ( STRING4 ) ;
out . println ( STRING5 ) ;
}
|
Adding more descriptive output statement
|
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
+ import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
<nb> import NAMESPACE ;
import NAMESPACE ;
import NAMESPACE ;
+ @ ignore ( STRING0 )
public class RollingUpgradeIT
{
private TargetDirectory DIR = TargetDirectory . forTest ( getClass ( ) ) ;
|
Ignores RollingUpgradeIT temporarily to get some builds through
|
<nb> public class BranchTicketService extends ITicketService implements RefsChangedLi
List < DirCacheEntry > list = new ArrayList < DirCacheEntry > ( ) ;
TreeWalk tw = null ;
try {
- tw = new TreeWalk ( db ) ;
ObjectId treeId = db . resolve ( BRANCH + STRING0 ) ;
+ if ( treeId == null ) {
+ SINGLE
+ return list ;
+ }
+ tw = new TreeWalk ( db ) ;
int hIdx = tw . addTree ( treeId ) ;
tw . setRecursive ( true ) ;
|
Fix bug in migrating to BranchTicketService
|
<nb> public abstract class TestBase
@ after
public void tearDown ( ) {
- mongo . close ( ) ;
dropDB ( ) ;
+ mongo . close ( ) ;
}
}
|
broke the build
|
<nb>
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
package NAMESPACE ;
import NAMESPACE ;
<nb>
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
+ COMMENT
package NAMESPACE ;
import static NAMESPACE ;
|
Adding missing header to Java files Jesus Camacho Rodriguez reviewed by Ashutosh Chauhan
|
<nb> public abstract class ResultSetIterator < E > implements Iterator < E > , Closeable {
private final ResultSet rs ;
private final PreparedStatement stmt ;
- SINGLE
private boolean didNext = false ;
private boolean hasNext = false ;
|
Remove useless comment in ResultSetIterator
|
<nb> public class MockitoStubber {
}
}
- public Object getResultFor ( Invocation invocation ) throws Throwable {
+ Object getResultFor ( Invocation invocation ) throws Throwable {
return findMatchFor ( invocation ) . answer ( invocation ) ;
}
|
made method default to slim the API
|
<nb> public class GroovyShell extends GroovyObjectSupport {
}
COMMENT
- COMMENT
+ COMMENT
COMMENT
COMMENT
COMMENT
<nb> public class GroovyShell extends GroovyObjectSupport {
}
COMMENT
- COMMENT
+ COMMENT
COMMENT
- COMMENT
- COMMENT
+ COMMENT
+ COMMENT
COMMENT
private boolean isUnitTestCase ( Class scriptClass ) {
SINGLE
<nb> public class GroovyShell extends GroovyObjectSupport {
boolean isUnitTestCase = false ;
try {
try {
- Class testCaseClass = this . loader . loadClass ( STRING0 ) ;
+ Class testCaseClass = this . loader . loadClass ( STRING1 ) ;
SINGLE
if ( testCaseClass . isAssignableFrom ( scriptClass ) ) {
isUnitTestCase = true ;
|
Allow junit framework TestCase to be run by groovy command
|
<nb> public class Population implements Iterable < Individual > {
for ( Individual i : this . individuals ) {
Sample s = i . sample ;
long t = Long . MAX_VALUE ;
- double birdfly = DistanceLibrary . distance ( origin . getLat ( ) , origin . getLon ( ) , i . getLat ( ) , i . getLon ( ) ) ;
+ SINGLE
if ( s != null )
t = s . eval ( spt ) ;
- csvWriter . printf ( STRING0 , i . getLat ( ) , i . getLon ( ) , i . data , t , birdfly ) ;
+ csvWriter . printf ( STRING0 , i . getLat ( ) , i . getLon ( ) , i . data , t ) ;
}
csvWriter . close ( ) ;
} catch ( Exception e ) {
|
remove static distance call
|
<nb> public class DnsDiscovery implements PeerDiscovery {
}
public InetSocketAddress [ ] getPeers ( long timeoutValue , TimeUnit timeoutUnit ) throws PeerDiscoveryException {
+ if ( hostNames == null )
+ throw new PeerDiscoveryException ( STRING0 ) ;
+
SINGLE
SINGLE
ExecutorService threadPool = Executors . newFixedThreadPool ( hostNames . length ) ;
|
Handle null hostNames in DnsDiscovery some NP have that
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.