idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
4,500 | public boolean checkResponseForException ( ) { if ( ! finished && rsp != null ) { Exception e ; if ( ( e = rsp . getException ( ) ) != null ) { setError ( e . getMessage ( ) ) ; setFinished ( ) ; return true ; } } return false ; } | Check response on exception . |
4,501 | private SimpleOrderedMap < Object > createOutput ( boolean detailed ) { SimpleOrderedMap < Object > output = new SimpleOrderedMap < > ( ) ; updateShardInfo ( ) ; output . add ( NAME_KEY , key ) ; output . add ( NAME_REQUEST , request ) ; if ( errorStatus ) { output . add ( NAME_ERROR , errorMessage ) ; } if ( abortStat... | Creates the output . |
4,502 | private final SimpleOrderedMap < Object > createShardsOutput ( ) { SimpleOrderedMap < Object > output = new SimpleOrderedMap < > ( ) ; if ( shardStageStatus != null && ! shardStageStatus . isEmpty ( ) ) { List < SimpleOrderedMap < Object > > list = new ArrayList < > ( ) ; for ( StageStatus stageStatus : shardStageStatu... | Creates the shards output . |
4,503 | private final Integer getInteger ( NamedList < Object > response , String ... args ) { Object objectItem = response . findRecursive ( args ) ; if ( objectItem != null && objectItem instanceof Integer ) { return ( Integer ) objectItem ; } else { return null ; } } | Gets the integer . |
4,504 | private final Map < String , Integer > getIntegerMap ( NamedList < Object > response , String ... args ) { Object objectItem = response . findRecursive ( args ) ; Map < String , Integer > result = null ; if ( objectItem != null && objectItem instanceof Map ) { result = ( Map ) objectItem ; } return result ; } | Gets the integer map . |
4,505 | private final Long getLong ( NamedList < Object > response , String ... args ) { Object objectItem = response . findRecursive ( args ) ; if ( objectItem != null && objectItem instanceof Long ) { return ( Long ) objectItem ; } else { return null ; } } | Gets the long . |
4,506 | private final Map < String , Long > getLongMap ( NamedList < Object > response , String ... args ) { Object objectItem = response . findRecursive ( args ) ; if ( objectItem != null && objectItem instanceof Map ) { return ( Map ) objectItem ; } else { return null ; } } | Gets the long map . |
4,507 | public static base_response add ( nitro_service client , vpnformssoaction resource ) throws Exception { vpnformssoaction addresource = new vpnformssoaction ( ) ; addresource . name = resource . name ; addresource . actionurl = resource . actionurl ; addresource . userfield = resource . userfield ; addresource . passwdf... | Use this API to add vpnformssoaction . |
4,508 | public static base_response update ( nitro_service client , vpnformssoaction resource ) throws Exception { vpnformssoaction updateresource = new vpnformssoaction ( ) ; updateresource . name = resource . name ; updateresource . actionurl = resource . actionurl ; updateresource . userfield = resource . userfield ; update... | Use this API to update vpnformssoaction . |
4,509 | public static base_responses update ( nitro_service client , vpnformssoaction resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { vpnformssoaction updateresources [ ] = new vpnformssoaction [ resources . length ] ; for ( int i = 0 ; i < resources . leng... | Use this API to update vpnformssoaction resources . |
4,510 | public static vpnformssoaction [ ] get ( nitro_service service ) throws Exception { vpnformssoaction obj = new vpnformssoaction ( ) ; vpnformssoaction [ ] response = ( vpnformssoaction [ ] ) obj . get_resources ( service ) ; return response ; } | Use this API to fetch all the vpnformssoaction resources that are configured on netscaler . |
4,511 | public static vpnformssoaction get ( nitro_service service , String name ) throws Exception { vpnformssoaction obj = new vpnformssoaction ( ) ; obj . set_name ( name ) ; vpnformssoaction response = ( vpnformssoaction ) obj . get_resource ( service ) ; return response ; } | Use this API to fetch vpnformssoaction resource of given name . |
4,512 | public static dnsview_dnspolicy_binding [ ] get ( nitro_service service , String viewname ) throws Exception { dnsview_dnspolicy_binding obj = new dnsview_dnspolicy_binding ( ) ; obj . set_viewname ( viewname ) ; dnsview_dnspolicy_binding response [ ] = ( dnsview_dnspolicy_binding [ ] ) obj . get_resources ( service ) ... | Use this API to fetch dnsview_dnspolicy_binding resources of given name . |
4,513 | public static base_response kill ( nitro_service client , aaasession resource ) throws Exception { aaasession killresource = new aaasession ( ) ; killresource . username = resource . username ; killresource . groupname = resource . groupname ; killresource . iip = resource . iip ; killresource . netmask = resource . ne... | Use this API to kill aaasession . |
4,514 | public static base_responses kill ( nitro_service client , aaasession resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { aaasession killresources [ ] = new aaasession [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { killreso... | Use this API to kill aaasession resources . |
4,515 | public static aaasession [ ] get ( nitro_service service ) throws Exception { aaasession obj = new aaasession ( ) ; aaasession [ ] response = ( aaasession [ ] ) obj . get_resources ( service ) ; return response ; } | Use this API to fetch all the aaasession resources that are configured on netscaler . |
4,516 | public static aaasession [ ] get ( nitro_service service , aaasession_args args ) throws Exception { aaasession obj = new aaasession ( ) ; options option = new options ( ) ; option . set_args ( nitro_util . object_to_string_withoutquotes ( args ) ) ; aaasession [ ] response = ( aaasession [ ] ) obj . get_resources ( se... | Use this API to fetch all the aaasession resources that are configured on netscaler . This uses aaasession_args which is a way to provide additional arguments while fetching the resources . |
4,517 | public static base_response add ( nitro_service client , aaakcdaccount resource ) throws Exception { aaakcdaccount addresource = new aaakcdaccount ( ) ; addresource . kcdaccount = resource . kcdaccount ; addresource . keytab = resource . keytab ; addresource . realmstr = resource . realmstr ; addresource . delegateduse... | Use this API to add aaakcdaccount . |
4,518 | public static base_responses add ( nitro_service client , aaakcdaccount resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { aaakcdaccount addresources [ ] = new aaakcdaccount [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { a... | Use this API to add aaakcdaccount resources . |
4,519 | public static base_response delete ( nitro_service client , String kcdaccount ) throws Exception { aaakcdaccount deleteresource = new aaakcdaccount ( ) ; deleteresource . kcdaccount = kcdaccount ; return deleteresource . delete_resource ( client ) ; } | Use this API to delete aaakcdaccount of given name . |
4,520 | public static base_responses delete ( nitro_service client , String kcdaccount [ ] ) throws Exception { base_responses result = null ; if ( kcdaccount != null && kcdaccount . length > 0 ) { aaakcdaccount deleteresources [ ] = new aaakcdaccount [ kcdaccount . length ] ; for ( int i = 0 ; i < kcdaccount . length ; i ++ )... | Use this API to delete aaakcdaccount resources of given names . |
4,521 | public static base_response update ( nitro_service client , aaakcdaccount resource ) throws Exception { aaakcdaccount updateresource = new aaakcdaccount ( ) ; updateresource . kcdaccount = resource . kcdaccount ; updateresource . keytab = resource . keytab ; updateresource . realmstr = resource . realmstr ; updateresou... | Use this API to update aaakcdaccount . |
4,522 | public static base_responses update ( nitro_service client , aaakcdaccount resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { aaakcdaccount updateresources [ ] = new aaakcdaccount [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++... | Use this API to update aaakcdaccount resources . |
4,523 | public static base_response unset ( nitro_service client , aaakcdaccount resource , String [ ] args ) throws Exception { aaakcdaccount unsetresource = new aaakcdaccount ( ) ; unsetresource . kcdaccount = resource . kcdaccount ; unsetresource . keytab = resource . keytab ; unsetresource . usercert = resource . usercert ... | Use this API to unset the properties of aaakcdaccount resource . Properties that need to be unset are specified in args array . |
4,524 | public static aaakcdaccount [ ] get ( nitro_service service ) throws Exception { aaakcdaccount obj = new aaakcdaccount ( ) ; aaakcdaccount [ ] response = ( aaakcdaccount [ ] ) obj . get_resources ( service ) ; return response ; } | Use this API to fetch all the aaakcdaccount resources that are configured on netscaler . |
4,525 | public static aaakcdaccount get ( nitro_service service , String kcdaccount ) throws Exception { aaakcdaccount obj = new aaakcdaccount ( ) ; obj . set_kcdaccount ( kcdaccount ) ; aaakcdaccount response = ( aaakcdaccount ) obj . get_resource ( service ) ; return response ; } | Use this API to fetch aaakcdaccount resource of given name . |
4,526 | public static aaakcdaccount [ ] get ( nitro_service service , String kcdaccount [ ] ) throws Exception { if ( kcdaccount != null && kcdaccount . length > 0 ) { aaakcdaccount response [ ] = new aaakcdaccount [ kcdaccount . length ] ; aaakcdaccount obj [ ] = new aaakcdaccount [ kcdaccount . length ] ; for ( int i = 0 ; i... | Use this API to fetch aaakcdaccount resources of given names . |
4,527 | public static base_response update ( nitro_service client , nsparam resource ) throws Exception { nsparam updateresource = new nsparam ( ) ; updateresource . httpport = resource . httpport ; updateresource . maxconn = resource . maxconn ; updateresource . maxreq = resource . maxreq ; updateresource . cip = resource . c... | Use this API to update nsparam . |
4,528 | public static base_response unset ( nitro_service client , nsparam resource , String [ ] args ) throws Exception { nsparam unsetresource = new nsparam ( ) ; return unsetresource . unset_resource ( client , args ) ; } | Use this API to unset the properties of nsparam resource . Properties that need to be unset are specified in args array . |
4,529 | public static nsparam get ( nitro_service service ) throws Exception { nsparam obj = new nsparam ( ) ; nsparam [ ] response = ( nsparam [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ; } | Use this API to fetch all the nsparam resources that are configured on netscaler . |
4,530 | public static boolean checkOffsets ( CoreMap docAnnotation ) { boolean okay = true ; String docText = docAnnotation . get ( CoreAnnotations . TextAnnotation . class ) ; String docId = docAnnotation . get ( CoreAnnotations . DocIDAnnotation . class ) ; List < CoreLabel > docTokens = docAnnotation . get ( CoreAnnotations... | Checks if offsets of doc and sentence matches |
4,531 | public static void copyUnsetAnnotations ( CoreMap src , CoreMap dest ) { Set < Class < ? > > otherKeys = src . keySet ( ) ; for ( Class key : otherKeys ) { if ( ! dest . has ( key ) ) { dest . set ( key , src . get ( key ) ) ; } } } | Copies annotation over to this coremap if not already set |
4,532 | public static Interval < Integer > getChunkOffsetsUsingCharOffsets ( List < ? extends CoreMap > chunkList , int charStart , int charEnd ) { int chunkStart = 0 ; int chunkEnd = chunkList . size ( ) ; for ( int i = 0 ; i < chunkList . size ( ) ; i ++ ) { int start = chunkList . get ( i ) . get ( CoreAnnotations . Charact... | Return chunk offsets |
4,533 | public static void annotateChunkText ( CoreMap chunk , CoreMap origAnnotation ) { String annoText = origAnnotation . get ( CoreAnnotations . TextAnnotation . class ) ; Integer annoBeginCharOffset = origAnnotation . get ( CoreAnnotations . CharacterOffsetBeginAnnotation . class ) ; if ( annoBeginCharOffset == null ) { a... | Annotates a CoreMap representing a chunk with text information TextAnnotation - String extracted from the origAnnotation using character offset information for this chunk |
4,534 | public static void annotateChunkTokens ( CoreMap chunk , Class tokenChunkKey , Class tokenLabelKey ) { List < CoreLabel > chunkTokens = chunk . get ( CoreAnnotations . TokensAnnotation . class ) ; if ( tokenLabelKey != null ) { String text = chunk . get ( CoreAnnotations . TextAnnotation . class ) ; for ( CoreLabel t :... | Annotates tokens in chunk |
4,535 | private void computeComparableValue ( ) { recomputeComparableSortValue = false ; try { int type = getCompareValueType ( ) ; switch ( type ) { case 0 : comparableSortValue = getCompareValue0 ( ) ; break ; case 1 : comparableSortValue = getCompareValue1 ( ) ; break ; case 2 : comparableSortValue = getCompareValue2 ( ) ; ... | Compute comparable value . |
4,536 | public static service_scpolicy_binding [ ] get ( nitro_service service , String name ) throws Exception { service_scpolicy_binding obj = new service_scpolicy_binding ( ) ; obj . set_name ( name ) ; service_scpolicy_binding response [ ] = ( service_scpolicy_binding [ ] ) obj . get_resources ( service ) ; return response... | Use this API to fetch service_scpolicy_binding resources of given name . |
4,537 | public static appfwpolicy_appfwglobal_binding [ ] get ( nitro_service service , String name ) throws Exception { appfwpolicy_appfwglobal_binding obj = new appfwpolicy_appfwglobal_binding ( ) ; obj . set_name ( name ) ; appfwpolicy_appfwglobal_binding response [ ] = ( appfwpolicy_appfwglobal_binding [ ] ) obj . get_reso... | Use this API to fetch appfwpolicy_appfwglobal_binding resources of given name . |
4,538 | public static transformpolicy_lbvserver_binding [ ] get ( nitro_service service , String name ) throws Exception { transformpolicy_lbvserver_binding obj = new transformpolicy_lbvserver_binding ( ) ; obj . set_name ( name ) ; transformpolicy_lbvserver_binding response [ ] = ( transformpolicy_lbvserver_binding [ ] ) obj ... | Use this API to fetch transformpolicy_lbvserver_binding resources of given name . |
4,539 | public static base_response update ( nitro_service client , systemparameter resource ) throws Exception { systemparameter updateresource = new systemparameter ( ) ; updateresource . rbaonresponse = resource . rbaonresponse ; updateresource . promptstring = resource . promptstring ; updateresource . natpcbforceflushlimi... | Use this API to update systemparameter . |
4,540 | public static base_response unset ( nitro_service client , systemparameter resource , String [ ] args ) throws Exception { systemparameter unsetresource = new systemparameter ( ) ; return unsetresource . unset_resource ( client , args ) ; } | Use this API to unset the properties of systemparameter resource . Properties that need to be unset are specified in args array . |
4,541 | public static systemparameter get ( nitro_service service ) throws Exception { systemparameter obj = new systemparameter ( ) ; systemparameter [ ] response = ( systemparameter [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ; } | Use this API to fetch all the systemparameter resources that are configured on netscaler . |
4,542 | public static auditnslogpolicy_appfwglobal_binding [ ] get ( nitro_service service , String name ) throws Exception { auditnslogpolicy_appfwglobal_binding obj = new auditnslogpolicy_appfwglobal_binding ( ) ; obj . set_name ( name ) ; auditnslogpolicy_appfwglobal_binding response [ ] = ( auditnslogpolicy_appfwglobal_bin... | Use this API to fetch auditnslogpolicy_appfwglobal_binding resources of given name . |
4,543 | public static clusterinstance_stats [ ] get ( nitro_service service ) throws Exception { clusterinstance_stats obj = new clusterinstance_stats ( ) ; clusterinstance_stats [ ] response = ( clusterinstance_stats [ ] ) obj . stat_resources ( service ) ; return response ; } | Use this API to fetch the statistics of all clusterinstance_stats resources that are configured on netscaler . |
4,544 | public static clusterinstance_stats get ( nitro_service service , Long clid ) throws Exception { clusterinstance_stats obj = new clusterinstance_stats ( ) ; obj . set_clid ( clid ) ; clusterinstance_stats response = ( clusterinstance_stats ) obj . stat_resource ( service ) ; return response ; } | Use this API to fetch statistics of clusterinstance_stats resource of given name . |
4,545 | public Arguments set ( final int index , final Fixed f ) { this . argumentRefs . add ( f ) ; this . pointer . get ( index ) . setF ( f . getRaw ( ) ) ; return this ; } | wl_fixed_t f ; fixed point |
4,546 | public static void store ( final long pointer , final Object object ) { final Object oldValue = MAPPED_OBJECTS . put ( pointer , object ) ; if ( oldValue != null ) { MAPPED_OBJECTS . put ( pointer , oldValue ) ; throw new IllegalStateException ( String . format ( "Can not re-map existing pointer.\n" + "Pointer=%s\n" + ... | Maps a native pointer to a POJO . This method should be used to easily store a POJO with a native context . |
4,547 | public static Optional < Map < QName , XMLElementReader < List < ModelNode > > > > mapParserNamespaces ( AbstractParserFactory factory ) { Map < QName , XMLElementReader < List < ModelNode > > > result = factory . create ( ) . entrySet ( ) . stream ( ) . collect ( Collectors . toMap ( e -> new QName ( e . getKey ( ) . ... | Parsers retain the namespace but the local part becomes subsystem |
4,548 | public Resource < ? > getObject ( final int id ) { return ObjectCache . from ( WaylandServerCore . INSTANCE ( ) . wl_client_get_object ( this . pointer , id ) ) ; } | Look up an object in the client name space . This looks up an object in the client object name space by its object ID . |
4,549 | public int getIndexForPosition ( int position ) { int nSections = 0 ; Set < Entry < String , Integer > > entrySet = mSections . entrySet ( ) ; for ( Entry < String , Integer > entry : entrySet ) { if ( entry . getValue ( ) < position ) { nSections ++ ; } } return position - nSections ; } | Returns the actual index of the object in the data source linked to the this list item . |
4,550 | public void init ( ProcessingEnvironment processingEnv ) { super . init ( processingEnv ) ; trees = Trees . instance ( processingEnv ) ; messager = processingEnv . getMessager ( ) ; types = processingEnv . getTypeUtils ( ) ; elements = processingEnv . getElementUtils ( ) ; try { logInvocationScanner = new LogInvocation... | flag that init method has errors |
4,551 | private < J , T extends Proxy < J > > T marshalConstructor ( final int opcode , final J implementation , final int version , final Class < T > newProxyCls , final long argsPointer ) { try { final long wlProxy = WaylandClientCore . INSTANCE ( ) . wl_proxy_marshal_array_constructor ( this . pointer , opcode , argsPointer... | called from generated proxies |
4,552 | public void destroy ( ) { WaylandClientCore . INSTANCE ( ) . wl_proxy_destroy ( this . pointer ) ; ObjectCache . remove ( this . pointer ) ; this . jObjectPointer . close ( ) ; } | Destroy a proxy object |
4,553 | public static void main ( String ... args ) throws Exception { if ( System . getProperty ( "boot.module.loader" ) == null ) { System . setProperty ( "boot.module.loader" , "org.wildfly.swarm.bootstrap.modules.BootModuleLoader" ) ; } Module bootstrap = Module . getBootModuleLoader ( ) . loadModule ( ModuleIdentifier . c... | Main entry - point . |
4,554 | public final void bindToView ( final ViewGroup parent , final View view , final T instance , final int position ) { SparseArray < Holder > holders = ( SparseArray < Holder > ) view . getTag ( mLayoutResourceId ) ; updateAnnotatedViews ( holders , view , instance , position ) ; executeViewHandlers ( holders , parent , v... | Method binds a POJO to the inflated View . |
4,555 | public final View createNewView ( final Context context , final ViewGroup parent ) { View view = mLayoutInflater . inflate ( mLayoutResourceId , parent , false ) ; SparseArray < Holder > holders = new SparseArray < Holder > ( ) ; int size = mViewIdsAndMetaCache . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { int vie... | Create a new view by inflating the associated XML layout . |
4,556 | private < T > void visitFractions ( Container container , T context , FractionProcessor < T > fn ) { OUTER : for ( ServerConfiguration eachConfig : this . configList ) { boolean found = false ; INNER : for ( Fraction eachFraction : container . fractions ( ) ) { if ( eachConfig . getType ( ) . isAssignableFrom ( eachFra... | Wraps common iteration pattern over fraction and server configurations |
4,557 | private void handle ( final JCTree . JCFieldAccess fieldAccess , final Stack < MethodAndParameter > stack , final MethodInvocationTree node , final StatementInfo statementInfo , final ScannerParams scannerParams ) { if ( fieldAccess . getExpression ( ) . getKind ( ) . equals ( Tree . Kind . MEMBER_SELECT ) ) { final Me... | checks whether fieldAccess node s expression is MEMBER_SELECT or IDENTIFIER and if so then checks that accessed field name corresponds with some declared structlogger field and if it does correspond then whole statement is handled as structlogger expression |
4,558 | private String formatWithStatementLocation ( String format , StatementInfo statementInfo , Object ... args ) { return format ( format , args ) + format ( " [%s:%s]" , statementInfo . getSourceFileName ( ) , statementInfo . getLineNumber ( ) ) ; } | System . format with string representing statement location added at the end |
4,559 | private void addVariablesToBuffer ( final java . util . List < VariableAndValue > usedVariables , final ListBuffer listBuffer ) { for ( VariableAndValue variableAndValue : usedVariables ) { listBuffer . add ( variableAndValue . getValue ( ) ) ; } } | all used variables are added to listbuffer |
4,560 | public Command [ ] toArgs ( final String line ) { if ( line == null || line . isEmpty ( ) ) { throw new IllegalArgumentException ( "Empty command." ) ; } final List < Command > commands = new ArrayList < > ( ) ; final List < String > result = new ArrayList < > ( ) ; final StringBuilder current = new StringBuilder ( ) ;... | designed as a class in case we add config |
4,561 | public static LoggingFraction createDefaultLoggingFraction ( Level level ) { return new LoggingFraction ( ) . defaultColorFormatter ( ) . consoleHandler ( level , COLOR_PATTERN ) . rootLogger ( level , CONSOLE ) ; } | Create a default logging fraction for the specified level . |
4,562 | public LoggingFraction formatter ( String name , String pattern ) { patternFormatter ( new PatternFormatter ( name ) . pattern ( pattern ) ) ; return this ; } | Add a new PatternFormatter to this Logger |
4,563 | public LoggingFraction consoleHandler ( Level level , String formatter ) { consoleHandler ( new ConsoleHandler ( CONSOLE ) . level ( level ) . namedFormatter ( formatter ) ) ; return this ; } | Add a ConsoleHandler to the list of handlers for this logger . |
4,564 | public LoggingFraction fileHandler ( String name , String path , Level level , String formatter ) { Map < Object , Object > fileProperties = new HashMap < > ( ) ; fileProperties . put ( "path" , path ) ; fileProperties . put ( "relative-to" , "jboss.server.log.dir" ) ; fileHandler ( new FileHandler ( name ) . level ( l... | Add a FileHandler to the list of handlers for this logger |
4,565 | public LoggingFraction customHandler ( String name , String module , String className , Properties properties , String formatter ) { Map < Object , Object > handlerProperties = new HashMap < > ( ) ; final Enumeration < ? > names = properties . propertyNames ( ) ; while ( names . hasMoreElements ( ) ) { final String nex... | Add a CustomHandler to this logger |
4,566 | public LoggingFraction rootLogger ( Level level , String ... handlers ) { rootLogger ( new RootLogger ( ) . level ( level ) . handlers ( handlers ) ) ; return this ; } | Add a root logger to this fraction |
4,567 | private Condition buildIdCondition ( Object argument ) { if ( argument instanceof String && ObjectId . isValid ( ( String ) argument ) ) { return new Condition ( ID_FIELD , new ObjectId ( ( String ) argument ) ) ; } else if ( Iterable . class . isAssignableFrom ( argument . getClass ( ) ) ) { List < Object > objectIds ... | Special case for id queries as it maps to _id within MongoDB . |
4,568 | public void audit ( final LoggingEvent e ) { try { logger . info ( MarkerFactory . getMarker ( AUDIT ) , serialize ( e ) ) ; } catch ( Exception ex ) { throw new RuntimeException ( "unable to serialize event" , ex ) ; } } | This implementation uses INFO level of slf4j and marks these logged messages with AUDIT marker |
4,569 | public String getUsage ( ) { String commandName = name ; Class < ? > declaringClass = method . getDeclaringClass ( ) ; Map < String , Cmd > commands = Commands . get ( declaringClass ) ; if ( commands . size ( ) == 1 && commands . values ( ) . iterator ( ) . next ( ) instanceof CmdGroup ) { final CmdGroup cmdGroup = ( ... | Returns a single line description of the command |
4,570 | public BatchFraction defaultJobRepository ( final String name , final DatasourcesFraction datasource ) { jdbcJobRepository ( name , datasource ) ; return defaultJobRepository ( name ) ; } | Adds a new JDBC job repository and sets it as the default job repository . |
4,571 | public BatchFraction jdbcJobRepository ( final String name , final DatasourcesFraction datasource ) { return jdbcJobRepository ( new JDBCJobRepository < > ( name ) . dataSource ( datasource . getKey ( ) ) ) ; } | Creates a new JDBC job repository . |
4,572 | public BatchFraction defaultThreadPool ( final String name , final int maxThreads , final int keepAliveTime , final TimeUnit keepAliveUnits ) { threadPool ( name , maxThreads , keepAliveTime , keepAliveUnits ) ; return defaultThreadPool ( name ) ; } | Creates a new thread - pool and sets the created thread - pool as the default thread - pool for batch jobs . |
4,573 | public BatchFraction threadPool ( final String name , final int maxThreads , final int keepAliveTime , final TimeUnit keepAliveUnits ) { final ThreadPool < ? > threadPool = new ThreadPool < > ( name ) ; threadPool . maxThreads ( maxThreads ) . keepaliveTime ( "time" , Integer . toBinaryString ( keepAliveTime ) ) . keep... | Creates a new thread - pool that can be used for batch jobs . |
4,574 | @ Warmup ( iterations = 5 ) @ Measurement ( iterations = 5 ) public void structLoggerLogging1Call ( ) { structLoggerNoMessageParametrization . info ( "Event with double and boolean" ) . varDouble ( 1.2 ) . varBoolean ( false ) . log ( ) ; } | structured logging with no message parametrization |
4,575 | @ Warmup ( iterations = 5 ) @ Measurement ( iterations = 5 ) public void logstashStructuredParametrizedMessageLogging1Call ( ) { loggerLogstashParametrizedMessage . info ( "Event with double={} and boolean={}" , value ( "varDouble" , 1.2 ) , value ( "varBoolean" , false ) ) ; } | structured logging with parametrization with logstash |
4,576 | @ Warmup ( iterations = 5 ) @ Measurement ( iterations = 5 ) public void logstashStructuredLogging1Calls ( ) { loggerLogstash . info ( "Event with double and boolean" , keyValue ( "varDouble" , 1.2 ) , keyValue ( "varBoolean" , false ) ) ; } | structured logging without parametrization with logstash |
4,577 | public JavaFile createPojo ( final String name , final JCTree . JCLiteral literal , final List < VariableAndValue > usedVariables ) throws PackageNameException { String eventName ; String packageName ; if ( name != null ) { final String [ ] split = name . split ( "\\." ) ; eventName = split [ split . length - 1 ] ; che... | Create JavaFile representing POJO based on String literal and usedVariables of log statement |
4,578 | private void checkStringIsValidName ( final String s ) throws PackageNameException { final boolean packageContainsJavaKeyword = javaKeywords . stream ( ) . anyMatch ( s :: equals ) ; if ( packageContainsJavaKeyword || s . matches ( "\\d.*" ) ) { throw new PackageNameException ( "string is not valid" ) ; } } | Checks that string is not java keyword and is qualified java name |
4,579 | private void addCommonLoggingEventFieldsToConstructor ( final MethodSpec . Builder constructorBuilder ) { constructorBuilder . addParameter ( TypeName . get ( String . class ) , "message" , Modifier . FINAL ) ; constructorBuilder . addParameter ( TypeName . get ( String . class ) , "sourceFile" , Modifier . FINAL ) ; c... | add common attributes to constructor |
4,580 | private void addPojoField ( final TypeSpec . Builder classBuilder , final MethodSpec . Builder constructorBuilder , final String fieldName , final TypeName fieldClass ) { classBuilder . addField ( fieldClass , fieldName , Modifier . PRIVATE , Modifier . FINAL ) ; addGetter ( classBuilder , fieldName , fieldClass ) ; ad... | adds field to POJO adds getter and adds parameter to constructor |
4,581 | private void addConstructorParameter ( final MethodSpec . Builder constructorBuilder , final String attributeName , final TypeName type ) { constructorBuilder . addParameter ( type , attributeName , Modifier . FINAL ) ; constructorBuilder . addCode ( "this." + attributeName + "=" + attributeName + ";" ) ; } | adds attribute to constructor |
4,582 | private void addGetter ( final TypeSpec . Builder classBuilder , final String attributeName , final TypeName type ) { final String getterMethodName = "get" + attributeName . substring ( 0 , 1 ) . toUpperCase ( ) + attributeName . substring ( 1 ) ; final MethodSpec . Builder getterBuilder = MethodSpec . methodBuilder ( ... | adds getter for field to class |
4,583 | private String hash ( String string ) { final String sha1Hex = DigestUtils . sha1Hex ( string ) ; return StringUtils . substring ( sha1Hex , 0 , 8 ) ; } | hash String with stable hash function |
4,584 | public T newInstance ( ) { try { return getEnhancedClass ( ) . newInstance ( ) ; } catch ( Exception e ) { logger . error ( "Could not instantiate enhanced object." , e ) ; throw ExceptionUtil . propagate ( e ) ; } } | Creates a new object that is enhanced . |
4,585 | public T enhance ( T t ) { if ( ! needsEnhancement ( t ) ) { return t ; } try { return getEnhancedClass ( ) . getConstructor ( baseClass ) . newInstance ( t ) ; } catch ( Exception e ) { throw new RuntimeException ( String . format ( "Could not enhance object %s (%s)" , t , t . getClass ( ) ) , e ) ; } } | Enhances the given object . |
4,586 | public static boolean objectIsMutable ( Object object ) { if ( object == null ) { return false ; } Class < ? > clazz = object . getClass ( ) ; return Collection . class . isAssignableFrom ( clazz ) ; } | Returns true if the given object is a mutable type that needs to be enhanced as DirtyableDBObject to prevent lost changes . Array types are ok because the default isDirty method will detect changes there . |
4,587 | public Container fraction ( Fraction fraction ) { if ( fraction != null ) { this . fractions . put ( fractionRoot ( fraction . getClass ( ) ) , fraction ) ; this . fractionsBySimpleName . put ( fraction . simpleName ( ) , fraction ) ; fraction . initialize ( new InitContext ( ) ) ; } return this ; } | Add a fraction to the container . |
4,588 | public Container iface ( String name , String expression ) { this . interfaces . add ( new Interface ( name , expression ) ) ; return this ; } | Configure a network interface . |
4,589 | public Archive createDefaultDeployment ( ) { try { Iterator < DefaultDeploymentFactory > providerIter = Module . getBootModuleLoader ( ) . loadModule ( ModuleIdentifier . create ( "swarm.application" ) ) . loadService ( DefaultDeploymentFactory . class ) . iterator ( ) ; if ( ! providerIter . hasNext ( ) ) { providerIt... | Provides access to the default ShrinkWrap deployment . |
4,590 | protected CliEnvironment createMainEnvironment ( final AtomicReference < InputReader > dynamicInputReaderRef , final AtomicReference < History > dynamicHistoryAtomicReference ) { final Map < String , ? > data = new HashMap < String , Object > ( ) ; return new CliEnv ( ) { public History history ( ) { return dynamicHist... | java 8 would have use Supplier which is cleaner |
4,591 | public Set < Explanation < OWLAxiom > > getExplanations ( OWLAxiom entailment ) throws ExplanationException { return getExplanations ( entailment , Integer . MAX_VALUE ) ; } | Gets explanations for an entailment . All explanations for the entailment will be returned . |
4,592 | private Object tryInitiatingObject ( String targetType , String initMethodName , List < Object > fieldObjects ) throws TransformationOperationException { Class < ? > targetClass = loadClassByName ( targetType ) ; try { if ( initMethodName == null ) { return initiateByConstructor ( targetClass , fieldObjects ) ; } else ... | Try to perform the actual initiating of the target class object . Returns the target class object or throws a TransformationOperationException if something went wrong . |
4,593 | private Object initiateByMethodName ( Class < ? > targetClass , String initMethodName , List < Object > objects ) throws Exception { Method method = targetClass . getMethod ( initMethodName , getClassList ( objects ) ) ; if ( Modifier . isStatic ( method . getModifiers ( ) ) ) { return method . invoke ( null , objects ... | Tries to initiate an object of the target class through the given init method name with the given object as parameter . |
4,594 | private Object initiateByConstructor ( Class < ? > targetClass , List < Object > objects ) throws Exception { Constructor < ? > constr = targetClass . getConstructor ( getClassList ( objects ) ) ; return constr . newInstance ( objects . toArray ( ) ) ; } | Tries to initiate an object of the target class through a constructor with the given object as parameter . |
4,595 | private Class < ? > [ ] getClassList ( List < Object > objects ) { Class < ? > [ ] classes = new Class < ? > [ objects . size ( ) ] ; for ( int i = 0 ; i < objects . size ( ) ; i ++ ) { classes [ i ] = objects . get ( i ) . getClass ( ) ; } return classes ; } | Returns a list containing the classes of the elements in the given object list as array . |
4,596 | private Class < ? > loadClassByName ( String className ) throws TransformationOperationException { Exception e ; if ( className . contains ( ";" ) ) { try { String [ ] parts = className . split ( ";" ) ; ModelDescription description = new ModelDescription ( ) ; description . setModelClassName ( parts [ 0 ] ) ; if ( par... | Tries to load the class with the given name . Throws a TransformationOperationException if this is not possible . |
4,597 | public void update ( Object target ) { if ( target == null ) { throw new IllegalArgumentException ( "Target to update cannot be null" ) ; } BeanWrapper bw = new BeanWrapperImpl ( target ) ; bw . registerCustomEditor ( Date . class , new CustomDateEditor ( new SimpleDateFormat ( "yyyy-MM-dd" ) , true ) ) ; for ( Map . E... | Update specified target from this object . |
4,598 | private IntervalCategoryDataset createDataset ( ) { TaskSeries ts = null ; TaskSeriesCollection collection = new TaskSeriesCollection ( ) ; if ( solver . getVariables ( ) . length == 0 ) { return collection ; } ts = new TaskSeries ( "All" ) ; for ( int i = 0 ; i < solver . getVariables ( ) . length ; i ++ ) { String la... | Creates a sample data set for a Gantt chart . |
4,599 | public void paint ( Graphics g , int p0 , int p1 , Shape bounds , JTextComponent c ) { try { Rectangle r = c . modelToView ( c . getCaretPosition ( ) ) ; g . setColor ( color ) ; g . fillRect ( 0 , r . y , c . getWidth ( ) , r . height ) ; if ( lastView == null ) lastView = r ; } catch ( BadLocationException ble ) { Sy... | Paint the background highlight |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.