signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class LibUtils { /** * Returns the extension for dynamically linked libraries on the
* current OS . That is , returns < code > " dylib " < / code > on Apple ,
* < code > " so " < / code > on Linux and Sun , and < code > " dll " < / code >
* on Windows .
* @ return The library extension */
private static String createLibraryExtension ( ) { } } | OSType osType = calculateOS ( ) ; switch ( osType ) { case APPLE : return "dylib" ; case ANDROID : case LINUX : case SUN : return "so" ; case WINDOWS : return "dll" ; default : break ; } return "" ; |
public class Context { /** * Retrieve container mapping .
* @ param property
* The Property to get a container mapping for .
* @ return The container mapping if any , else null */
public String getContainer ( String property ) { } } | if ( property == null ) { return null ; } if ( JsonLdConsts . GRAPH . equals ( property ) ) { return JsonLdConsts . SET ; } if ( ! property . equals ( JsonLdConsts . TYPE ) && JsonLdUtils . isKeyword ( property ) ) { return property ; } final Map < String , Object > td = ( Map < String , Object > ) termDefinitions . get ( property ) ; if ( td == null ) { return null ; } return ( String ) td . get ( JsonLdConsts . CONTAINER ) ; |
public class Clock { /** * Defines the Paint object that will be used to fill the foreground of the clock .
* This could be used to visualize glass effects etc . and is only rarely used .
* @ param PAINT */
public void setForegroundPaint ( final Paint PAINT ) { } } | if ( null == foregroundPaint ) { _foregroundPaint = PAINT ; fireUpdateEvent ( REDRAW_EVENT ) ; } else { foregroundPaint . set ( PAINT ) ; } |
public class KuberntesServiceUrlResourceProvider { /** * Find the path to use .
* Uses java annotations first and if not found , uses kubernetes annotations on the service object .
* @ param service
* The target service .
* @ param qualifiers
* The set of qualifiers .
* @ return Returns the resolved path of ' / ' as a fallback . */
private static String getPath ( Service service , Annotation ... qualifiers ) { } } | for ( Annotation q : qualifiers ) { if ( q instanceof Scheme ) { return ( ( Scheme ) q ) . value ( ) ; } } if ( service . getMetadata ( ) != null && service . getMetadata ( ) . getAnnotations ( ) != null ) { String s = service . getMetadata ( ) . getAnnotations ( ) . get ( SERVICE_SCHEME ) ; if ( s != null && s . isEmpty ( ) ) { return s ; } } return DEFAULT_PATH ; |
public class ExternalEventHandlerBase { /** * This method is used to start a regular process .
* You should use invokeProcessAsService for invoking service processes .
* Documents must be passed as DocumentReferences .
* @ see { @ link # invokeProcess ( Long , Long , String , Map < String , String > ) }
* @ param processId Process definition ID of the process
* @ param eventInstId The ID of the external message triggering the handler
* @ param masterRequestId Master request ID to be assigned to the process instance
* @ param parameters Input parameter bindings for the process instance to be created
* @ param headers request headers */
protected Long launchProcess ( Long processId , Long eventInstId , String masterRequestId , Map < String , Object > parameters , Map < String , String > headers ) throws Exception { } } | Map < String , String > stringParams = translateParameters ( processId , parameters ) ; ProcessEngineDriver driver = new ProcessEngineDriver ( ) ; return driver . startProcess ( processId , masterRequestId , OwnerType . DOCUMENT , eventInstId , stringParams , headers ) ; |
public class AbstractHeaderDialogBuilder { /** * Obtains , whether the divider of the dialog ' s header should be shown , or not , from a specific
* theme .
* @ param themeResourceId
* The resource id of the theme , the visibility should be obtained from , as an { @ link
* Integer } value */
private void obtainShowHeaderDivider ( @ StyleRes final int themeResourceId ) { } } | TypedArray typedArray = getContext ( ) . getTheme ( ) . obtainStyledAttributes ( themeResourceId , new int [ ] { R . attr . materialDialogShowHeaderDivider } ) ; showHeaderDivider ( typedArray . getBoolean ( 0 , true ) ) ; |
public class PersistentExecutorImpl { /** * Declarative Services method for setting the ApplicationTracker reference
* @ param ref reference to the service */
@ Reference ( service = ApplicationTracker . class ) protected void setApplicationTracker ( ServiceReference < ApplicationTracker > ref ) { } } | appTrackerRef . setReference ( ref ) ; |
public class JsJmsObjectMessageImpl { /** * Get the byte array containing the serialized object which forms the
* payload of the message .
* The default value is null .
* Javadoc description supplied by JsJmsObjectMessage interface .
* @ throws ObjectFailedToSerializeException if there are problems serializing the real object */
@ Override public byte [ ] getSerializedObject ( ) throws ObjectFailedToSerializeException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getSerializedObject" ) ; byte [ ] bytes ; if ( hasRealObject && ! hasSerializedRealObject ) { // If we have a real object but it has not yet been serialized we have to serialize it into
// the message payload .
serializeRealObject ( ) ; } // Get the bytes from the payload
bytes = getDataFromPayload ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getSerializedObject" ) ; return bytes ; |
public class MortarDemoActivity { /** * Configure the action bar menu as required by { @ link ActionBarOwner . Activity } . */
@ Override public boolean onCreateOptionsMenu ( Menu menu ) { } } | if ( actionBarMenuAction != null ) { menu . add ( actionBarMenuAction . title ) . setShowAsActionFlags ( SHOW_AS_ACTION_ALWAYS ) . setOnMenuItemClickListener ( new MenuItem . OnMenuItemClickListener ( ) { @ Override public boolean onMenuItemClick ( MenuItem menuItem ) { actionBarMenuAction . action . call ( ) ; return true ; } } ) ; } menu . add ( "Log Scope Hierarchy" ) . setOnMenuItemClickListener ( new MenuItem . OnMenuItemClickListener ( ) { @ Override public boolean onMenuItemClick ( MenuItem item ) { Log . d ( "DemoActivity" , MortarScopeDevHelper . scopeHierarchyToString ( activityScope ) ) ; return true ; } } ) ; return true ; |
public class TreePrint { /** * For the input tree , collapse any collocations in it that exist in
* WordNet and are contiguous in the tree into a single node .
* A single static Wordnet connection is used by all instances of this
* class . Reflection to check that a Wordnet connection exists . Otherwise
* we print an error and do nothing .
* @ param tree The input tree . NOTE : This tree is mangled by this method
* @ param hf The head finder to use
* @ return The collocation collapsed tree */
private static synchronized Tree getCollocationProcessedTree ( Tree tree , HeadFinder hf ) { } } | if ( wnc == null ) { try { Class < ? > cl = Class . forName ( "edu.stanford.nlp.trees.WordNetInstance" ) ; wnc = ( WordNetConnection ) cl . newInstance ( ) ; } catch ( Exception e ) { System . err . println ( "Couldn't open WordNet Connection. Aborting collocation detection." ) ; e . printStackTrace ( ) ; wnc = null ; } } if ( wnc != null ) { CollocationFinder cf = new CollocationFinder ( tree , wnc , hf ) ; tree = cf . getMangledTree ( ) ; } else { System . err . println ( "ERROR: WordNetConnection unavailable for collocations." ) ; } return tree ; |
public class ClassUtils { /** * < p > isBeforeJava5 . < / p >
* @ param javaVersion a { @ link java . lang . String } object .
* @ return a boolean . */
public static boolean isBeforeJava5 ( String javaVersion ) { } } | return ( StringUtils . isEmpty ( javaVersion ) || "1.0" . equals ( javaVersion ) || "1.1" . equals ( javaVersion ) || "1.2" . equals ( javaVersion ) || "1.3" . equals ( javaVersion ) || "1.4" . equals ( javaVersion ) ) ; |
public class UnicodeSetSpanner { /** * Delete all the matching spans in sequence , using SpanCondition . SIMPLE
* The code alternates spans ; see the class doc for { @ link UnicodeSetSpanner } for a note about boundary conditions .
* @ param sequence
* charsequence to replace matching spans in .
* @ return modified string . */
public String deleteFrom ( CharSequence sequence ) { } } | return replaceFrom ( sequence , "" , CountMethod . WHOLE_SPAN , SpanCondition . SIMPLE ) ; |
public class Message { /** * estimate the byte / char length for a field and its value */
static long sizeForField ( @ Nonnull String key , @ Nonnull Object value ) { } } | return key . length ( ) + sizeForValue ( value ) ; |
public class AnnotationUtil { /** * 获取指定注解
* @ param < A > 注解类型
* @ param annotationEle { @ link AnnotatedElement } , 可以是Class 、 Method 、 Field 、 Constructor 、 ReflectPermission
* @ param annotationType 注解类型
* @ return 注解对象 */
public static < A extends Annotation > A getAnnotation ( AnnotatedElement annotationEle , Class < A > annotationType ) { } } | return ( null == annotationEle ) ? null : toCombination ( annotationEle ) . getAnnotation ( annotationType ) ; |
public class sslparameter { /** * Use this API to unset the properties of sslparameter resource .
* Properties that need to be unset are specified in args array . */
public static base_response unset ( nitro_service client , sslparameter resource , String [ ] args ) throws Exception { } } | sslparameter unsetresource = new sslparameter ( ) ; return unsetresource . unset_resource ( client , args ) ; |
public class Monetary { /** * Access a { @ link MonetaryRounding } using a possibly complex query .
* @ param roundingQuery The { @ link javax . money . RoundingQuery } that may contains arbitrary parameters to be
* evaluated .
* @ return the corresponding { @ link javax . money . MonetaryRounding } , never { @ code null } .
* @ throws IllegalArgumentException if no such rounding is registered using a
* { @ link javax . money . spi . RoundingProviderSpi } instance . */
public static MonetaryRounding getRounding ( RoundingQuery roundingQuery ) { } } | return Optional . ofNullable ( monetaryRoundingsSingletonSpi ( ) ) . orElseThrow ( ( ) -> new MonetaryException ( "No MonetaryRoundingsSpi loaded, query functionality is not available." ) ) . getRounding ( roundingQuery ) ; |
public class Message { /** * Reads the message ' s contents from an input stream , but skips the buffer and instead returns the
* position ( offset ) at which the buffer starts */
public int readFromSkipPayload ( ByteArrayDataInputStream in ) throws IOException , ClassNotFoundException { } } | // 1 . read the leading byte first
byte leading = in . readByte ( ) ; // 2 . the flags
flags = in . readShort ( ) ; // 3 . dest _ addr
if ( Util . isFlagSet ( leading , DEST_SET ) ) dest = Util . readAddress ( in ) ; // 4 . src _ addr
if ( Util . isFlagSet ( leading , SRC_SET ) ) sender = Util . readAddress ( in ) ; // 5 . headers
int len = in . readShort ( ) ; headers = createHeaders ( len ) ; for ( int i = 0 ; i < len ; i ++ ) { short id = in . readShort ( ) ; Header hdr = readHeader ( in ) . setProtId ( id ) ; this . headers [ i ] = hdr ; } // 6 . buf
if ( ! Util . isFlagSet ( leading , BUF_SET ) ) return - 1 ; length = in . readInt ( ) ; return in . position ( ) ; |
public class DefaultJobDefinition { /** * Create a JobDefinition that is using a cron expression to specify , when and how often the job should be triggered .
* @ param jobType The type of the Job
* @ param jobName A human readable name of the Job
* @ param description A human readable description of the Job .
* @ param cron The cron expression . Must conform to { @ link CronSequenceGenerator } s cron expressions .
* @ param restarts The number of restarts if the job failed because of errors or exceptions
* @ param retries Specifies how often a job trigger should retry to start the job if triggering fails for some reason .
* @ param retryDelay The optional delay between retries .
* @ param maxAge Optional maximum age of a job . When the job is not run for longer than this duration ,
* a warning is displayed on the status page
* @ return JobDefinition
* @ throws IllegalArgumentException if cron expression is invalid . */
public static JobDefinition retryableCronJobDefinition ( final String jobType , final String jobName , final String description , final String cron , final int restarts , final int retries , final Duration retryDelay , final Optional < Duration > maxAge ) { } } | return new DefaultJobDefinition ( jobType , jobName , description , maxAge , Optional . empty ( ) , Optional . of ( cron ) , restarts , retries , Optional . of ( retryDelay ) ) ; |
public class TreeMessage { /** * Convenience method to cast data to a map .
* and create a map if one doesn ' t exist .
* @ return The data map . */
private Node getNode ( boolean bDataRoot ) { } } | if ( m_data == null ) { DocumentBuilder db = Util . getDocumentBuilder ( ) ; synchronized ( db ) { m_data = ( Node ) db . newDocument ( ) ; String rootTag = ROOT_TAG ; if ( this . getMessageDataDesc ( null ) != null ) if ( this . getMessageDataDesc ( null ) . getKey ( ) != null ) rootTag = this . getMessageDataDesc ( null ) . getKey ( ) ; ( ( Document ) m_data ) . appendChild ( ( ( Document ) m_data ) . createElement ( rootTag ) ) ; } } if ( bDataRoot ) if ( m_data instanceof Document ) return ( ( Document ) m_data ) . getDocumentElement ( ) ; return ( Node ) m_data ; |
public class NetUtil { /** * 获取本机网卡IP地址 , 这个地址为所有网卡中非回路地址的第一个 < br >
* 如果获取失败调用 { @ link InetAddress # getLocalHost ( ) } 方法获取 。 < br >
* 此方法不会抛出异常 , 获取失败将返回 < code > null < / code > < br >
* 参考 : http : / / stackoverflow . com / questions / 9481865 / getting - the - ip - address - of - the - current - machine - using - java
* @ return 本机网卡IP地址 , 获取失败返回 < code > null < / code >
* @ since 3.0.7 */
public static String getLocalhostStr ( ) { } } | InetAddress localhost = getLocalhost ( ) ; if ( null != localhost ) { return localhost . getHostAddress ( ) ; } return null ; |
public class WSRdbOnePhaseXaResourceImpl { /** * if rollback succeeds , then return XA _ RBROLLBACK , if rollback failed , then return XAER _ RMERR */
public void commit ( Xid xid , boolean onePhase ) throws XAException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "commit" , new Object [ ] { ivManagedConnection , AdapterUtil . toString ( xid ) , onePhase ? "ONE PHASE" : "TWO PHASE" } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { String cId = null ; try { cId = ivManagedConnection . mcf . getCorrelator ( ivManagedConnection ) ; } catch ( SQLException x ) { // will just log the exception here and ignore it since its in trace
Tr . debug ( this , tc , "got an exception trying to get the correlator in commit, exception is: " , x ) ; } if ( cId != null ) { StringBuffer stbuf = new StringBuffer ( 200 ) ; stbuf . append ( "Correlator: DB2, ID: " ) ; stbuf . append ( cId ) ; if ( xid != null ) { stbuf . append ( "Transaction ID : " ) ; stbuf . append ( xid ) ; } stbuf . append ( " COMMIT" ) ; Tr . debug ( this , tc , stbuf . toString ( ) ) ; } } if ( dsConfig . get ( ) . enableMultithreadedAccessDetection ) ivManagedConnection . detectMultithreadedAccess ( ) ; if ( ! onePhase ) { XAException xaX = new XAException ( XAException . XA_RBPROTO ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "commit" , xaX ) ; throw xaX ; } boolean commitFailed = false ; boolean rollbackFailed = false ; boolean setStateFailed = false ; // Reset so we can deferred enlist in a future global transaction .
ivManagedConnection . wasLazilyEnlistedInGlobalTran = false ; try { // If no work was done during the transaction , the autoCommit value may still
// be on . In this case , just no - op , since some drivers like ConnectJDBC 3.1
// don ' t allow commit / rollback when autoCommit is on .
ivSqlConn . commit ( ) ; ivStateManager . setState ( WSStateManager . XA_COMMIT ) ; } catch ( SQLException sqeC ) { FFDCFilter . processException ( sqeC , "com.ibm.ws.rsadapter.spi.WSRdbOnePhaseXaResourceImpl.commit" , "105" , this ) ; commitFailed = true ; Tr . error ( tc , "DSA_INTERNAL_ERROR" , new Object [ ] { "Exception caught during commit on the OnePhaseXAResource" , sqeC } ) ; // If no work was done during the transaction , the autoCommit value may still
// be on . In this case , just no - op , since some drivers like ConnectJDBC 3.1
// don ' t allow commit / rollback when autoCommit is on .
try { // autoCommit is off
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "issue a rollback due to commit failure" ) ; ivSqlConn . rollback ( ) ; } catch ( SQLException sqeR ) { FFDCFilter . processException ( sqeR , "com.ibm.ws.rsadapter.spi.WSRdbOnePhaseXaResourceImpl.commit" , "197" , this ) ; rollbackFailed = true ; Tr . error ( tc , "DSA_INTERNAL_ERROR" , new Object [ ] { "Exception caught during rollback on the OnePhaseXAResource after a commit failed" , sqeR } ) ; } catch ( java . lang . RuntimeException x ) { FFDCFilter . processException ( x , "com.ibm.ws.rsadapter.spi.WSRdbOnePhaseXaResourceImpl.commit" , "204" , this ) ; rollbackFailed = true ; Tr . error ( tc , "DSA_INTERNAL_ERROR" , new Object [ ] { "Exception caught during rollback on the OnePhaseXAResource after a commit failed" , x } ) ; } } catch ( TransactionException te ) { // Exception means setState failed because it was invalid to set the state in this case
FFDCFilter . processException ( te , "com.ibm.ws.rsadapter.spi.WSRdbOnePhaseXaResourceImpl.commit" , "123" , this ) ; Tr . error ( tc , "INVALID_TX_STATE" , new Object [ ] { "OnePhaseXAResource.commit()" , ivManagedConnection . getTransactionStateAsString ( ) } ) ; setStateFailed = false ; } catch ( java . lang . RuntimeException x ) { FFDCFilter . processException ( x , "com.ibm.ws.rsadapter.spi.WSRdbOnePhaseXaResourceImpl.commit" , "221" , this ) ; Tr . error ( tc , "DSA_INTERNAL_ERROR" , new Object [ ] { "Exception caught during commit on the OnePhaseXAResource" , x } ) ; XAException xae = new XAException ( XAException . XA_HEURHAZ ) ; // throwing Heurhaz sine we don ' t really know f the commit failed or not .
traceXAException ( xae , currClass ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "commit" , "Exception" ) ; throw xae ; } if ( rollbackFailed ) { XAException xae = new XAException ( XAException . XAER_RMERR ) ; traceXAException ( xae , currClass ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "commit" , "Exception" ) ; throw xae ; } else if ( commitFailed ) { XAException xae = new XAException ( XAException . XA_HEURHAZ ) ; // we don ' t know if the commit really failed , or the failure in communication after the commit succeeded
traceXAException ( xae , currClass ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "commit" , "Exception" ) ; throw xae ; } else if ( setStateFailed ) { XAException xae = new XAException ( XAException . XAER_RMERR ) ; traceXAException ( xae , currClass ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "commit" , "Exception" ) ; throw xae ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "commit" ) ; |
public class Stream { /** * Returns { @ code Stream } with first { @ code maxSize } elements .
* < p > This is a short - circuiting stateful intermediate operation .
* < p > Example :
* < pre >
* maxSize : 3
* stream : [ 1 , 2 , 3 , 4 , 5]
* result : [ 1 , 2 , 3]
* maxSize : 10
* stream : [ 1 , 2]
* result : [ 1 , 2]
* < / pre >
* @ param maxSize the number of elements to limit
* @ return the new stream
* @ throws IllegalArgumentException if { @ code maxSize } is negative */
@ NotNull public Stream < T > limit ( final long maxSize ) { } } | if ( maxSize < 0 ) { throw new IllegalArgumentException ( "maxSize cannot be negative" ) ; } if ( maxSize == 0 ) { return Stream . empty ( ) ; } return new Stream < T > ( params , new ObjLimit < T > ( iterator , maxSize ) ) ; |
public class Tetrahedral2DParity { /** * { @ inheritDoc } */
@ Override public int parity ( ) { } } | double x1 = coordinates [ 0 ] . x ; double x2 = coordinates [ 1 ] . x ; double x3 = coordinates [ 2 ] . x ; double x4 = coordinates [ 3 ] . x ; double y1 = coordinates [ 0 ] . y ; double y2 = coordinates [ 1 ] . y ; double y3 = coordinates [ 2 ] . y ; double y4 = coordinates [ 3 ] . y ; double det = ( elevations [ 0 ] * det ( x2 , y2 , x3 , y3 , x4 , y4 ) ) - ( elevations [ 1 ] * det ( x1 , y1 , x3 , y3 , x4 , y4 ) ) + ( elevations [ 2 ] * det ( x1 , y1 , x2 , y2 , x4 , y4 ) ) - ( elevations [ 3 ] * det ( x1 , y1 , x2 , y2 , x3 , y3 ) ) ; return ( int ) Math . signum ( det ) ; |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getPEC ( ) { } } | if ( pecEClass == null ) { pecEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 310 ) ; } return pecEClass ; |
public class ExamplesImpl { /** * Adds a labeled example to the application .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param exampleLabelObject An example label with the expected intent and entities .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the LabelExampleResponse object */
public Observable < LabelExampleResponse > addAsync ( UUID appId , String versionId , ExampleLabelObject exampleLabelObject ) { } } | return addWithServiceResponseAsync ( appId , versionId , exampleLabelObject ) . map ( new Func1 < ServiceResponse < LabelExampleResponse > , LabelExampleResponse > ( ) { @ Override public LabelExampleResponse call ( ServiceResponse < LabelExampleResponse > response ) { return response . body ( ) ; } } ) ; |
public class ModelsImpl { /** * Gets the utterances for the given model in the given app version .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param modelId The ID ( GUID ) of the model .
* @ param examplesMethodOptionalParameter the object representing the optional parameters to be set before calling this API
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the List & lt ; LabelTextObject & gt ; object */
public Observable < List < LabelTextObject > > examplesMethodAsync ( UUID appId , String versionId , String modelId , ExamplesMethodOptionalParameter examplesMethodOptionalParameter ) { } } | return examplesMethodWithServiceResponseAsync ( appId , versionId , modelId , examplesMethodOptionalParameter ) . map ( new Func1 < ServiceResponse < List < LabelTextObject > > , List < LabelTextObject > > ( ) { @ Override public List < LabelTextObject > call ( ServiceResponse < List < LabelTextObject > > response ) { return response . body ( ) ; } } ) ; |
public class MetadataClient { /** * Retrieve the task definition of a given task type
* @ param taskType type of task for which to retrieve the definition
* @ return Task Definition for the given task type */
public TaskDef getTaskDef ( String taskType ) { } } | Preconditions . checkArgument ( StringUtils . isNotBlank ( taskType ) , "Task type cannot be blank" ) ; return protoMapper . fromProto ( stub . getTask ( MetadataServicePb . GetTaskRequest . newBuilder ( ) . setTaskType ( taskType ) . build ( ) ) . getTask ( ) ) ; |
public class InternalSimpleAntlrParser { /** * InternalSimpleAntlr . g : 1318:1 : rulePredicated returns [ EObject current = null ] : ( this _ OPEN _ 0 = RULE _ OPEN this _ OPEN _ 1 = RULE _ OPEN ( ( lv _ predicate _ 2_0 = ruleAlternatives ) ) otherlv _ 3 = ' ) ' otherlv _ 4 = ' = > ' ( ( lv _ element _ 5_0 = ruleOtherElement ) ) otherlv _ 6 = ' ) ' ) ; */
public final EObject rulePredicated ( ) throws RecognitionException { } } | EObject current = null ; Token this_OPEN_0 = null ; Token this_OPEN_1 = null ; Token otherlv_3 = null ; Token otherlv_4 = null ; Token otherlv_6 = null ; EObject lv_predicate_2_0 = null ; EObject lv_element_5_0 = null ; enterRule ( ) ; try { // InternalSimpleAntlr . g : 1321:28 : ( ( this _ OPEN _ 0 = RULE _ OPEN this _ OPEN _ 1 = RULE _ OPEN ( ( lv _ predicate _ 2_0 = ruleAlternatives ) ) otherlv _ 3 = ' ) ' otherlv _ 4 = ' = > ' ( ( lv _ element _ 5_0 = ruleOtherElement ) ) otherlv _ 6 = ' ) ' ) )
// InternalSimpleAntlr . g : 1322:1 : ( this _ OPEN _ 0 = RULE _ OPEN this _ OPEN _ 1 = RULE _ OPEN ( ( lv _ predicate _ 2_0 = ruleAlternatives ) ) otherlv _ 3 = ' ) ' otherlv _ 4 = ' = > ' ( ( lv _ element _ 5_0 = ruleOtherElement ) ) otherlv _ 6 = ' ) ' )
{ // InternalSimpleAntlr . g : 1322:1 : ( this _ OPEN _ 0 = RULE _ OPEN this _ OPEN _ 1 = RULE _ OPEN ( ( lv _ predicate _ 2_0 = ruleAlternatives ) ) otherlv _ 3 = ' ) ' otherlv _ 4 = ' = > ' ( ( lv _ element _ 5_0 = ruleOtherElement ) ) otherlv _ 6 = ' ) ' )
// InternalSimpleAntlr . g : 1322:2 : this _ OPEN _ 0 = RULE _ OPEN this _ OPEN _ 1 = RULE _ OPEN ( ( lv _ predicate _ 2_0 = ruleAlternatives ) ) otherlv _ 3 = ' ) ' otherlv _ 4 = ' = > ' ( ( lv _ element _ 5_0 = ruleOtherElement ) ) otherlv _ 6 = ' ) '
{ this_OPEN_0 = ( Token ) match ( input , RULE_OPEN , FOLLOW_24 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( this_OPEN_0 , grammarAccess . getPredicatedAccess ( ) . getOPENTerminalRuleCall_0 ( ) ) ; } this_OPEN_1 = ( Token ) match ( input , RULE_OPEN , FOLLOW_14 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( this_OPEN_1 , grammarAccess . getPredicatedAccess ( ) . getOPENTerminalRuleCall_1 ( ) ) ; } // InternalSimpleAntlr . g : 1330:1 : ( ( lv _ predicate _ 2_0 = ruleAlternatives ) )
// InternalSimpleAntlr . g : 1331:1 : ( lv _ predicate _ 2_0 = ruleAlternatives )
{ // InternalSimpleAntlr . g : 1331:1 : ( lv _ predicate _ 2_0 = ruleAlternatives )
// InternalSimpleAntlr . g : 1332:3 : lv _ predicate _ 2_0 = ruleAlternatives
{ if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getPredicatedAccess ( ) . getPredicateAlternativesParserRuleCall_2_0 ( ) ) ; } pushFollow ( FOLLOW_27 ) ; lv_predicate_2_0 = ruleAlternatives ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getPredicatedRule ( ) ) ; } set ( current , "predicate" , lv_predicate_2_0 , "org.eclipse.xtext.generator.parser.antlr.debug.SimpleAntlr.Alternatives" ) ; afterParserOrEnumRuleCall ( ) ; } } } otherlv_3 = ( Token ) match ( input , 34 , FOLLOW_23 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_3 , grammarAccess . getPredicatedAccess ( ) . getRightParenthesisKeyword_3 ( ) ) ; } otherlv_4 = ( Token ) match ( input , 30 , FOLLOW_18 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_4 , grammarAccess . getPredicatedAccess ( ) . getEqualsSignGreaterThanSignKeyword_4 ( ) ) ; } // InternalSimpleAntlr . g : 1356:1 : ( ( lv _ element _ 5_0 = ruleOtherElement ) )
// InternalSimpleAntlr . g : 1357:1 : ( lv _ element _ 5_0 = ruleOtherElement )
{ // InternalSimpleAntlr . g : 1357:1 : ( lv _ element _ 5_0 = ruleOtherElement )
// InternalSimpleAntlr . g : 1358:3 : lv _ element _ 5_0 = ruleOtherElement
{ if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getPredicatedAccess ( ) . getElementOtherElementParserRuleCall_5_0 ( ) ) ; } pushFollow ( FOLLOW_27 ) ; lv_element_5_0 = ruleOtherElement ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getPredicatedRule ( ) ) ; } set ( current , "element" , lv_element_5_0 , "org.eclipse.xtext.generator.parser.antlr.debug.SimpleAntlr.OtherElement" ) ; afterParserOrEnumRuleCall ( ) ; } } } otherlv_6 = ( Token ) match ( input , 34 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_6 , grammarAccess . getPredicatedAccess ( ) . getRightParenthesisKeyword_6 ( ) ) ; } } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ; |
public class ApiOvhCloud { /** * Enable or disable rescue mode
* REST : POST / cloud / project / { serviceName } / instance / { instanceId } / rescueMode
* @ param imageId [ required ] Image to boot on
* @ param instanceId [ required ] Instance id
* @ param rescue [ required ] Enable rescue mode
* @ param serviceName [ required ] Service name */
public OvhRescueAdminPassword project_serviceName_instance_instanceId_rescueMode_POST ( String serviceName , String instanceId , String imageId , Boolean rescue ) throws IOException { } } | String qPath = "/cloud/project/{serviceName}/instance/{instanceId}/rescueMode" ; StringBuilder sb = path ( qPath , serviceName , instanceId ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "imageId" , imageId ) ; addBody ( o , "rescue" , rescue ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhRescueAdminPassword . class ) ; |
public class SpringELProcessor { /** * Setup the context for spring EL . Will add all properties from an optional properties file as
* $ { property [ ' propKey ' ] } , the request parameters as $ { requestParam . xxx } , the
* PortletRequest as $ { request . xxx } and user info as $ { user } . Examples
* $ { protocol } : / / $ { server } : $ { port } / $ { contextPath } / view ? param = $ { requestParam . param }
* $ { protocol } : / / $ { server } : $ { port } / $ { contextPath } / view / $ { requestParam [ ' form . itemId ' ] }
* $ { protocol } : / / $ { server } : $ { port } / $ { contextPath } / view ? userId = $ { user [ ' user . login . id ' ] }
* $ { protocol } : / / $ { server } : $ { port } / $ { contextPath } / view ? action = $ { property [ ' proxy . action . key ' ] }
* $ { server } , $ { port } , $ { protocol } , and $ { contextPath } are also available which are the
* values for accessing the particular portlet ( contextPath in particular is the portlet webapp ' s
* context path name ) .
* The Spring EL context will include all properties from app - launcher . properties , all request
* parameters namespaced as " request " and all properties from the user - info map namespaced as " user " . Examples :
* @ param request the portlet request to read params from
* @ return a map of properties */
private Map < String , Object > getContext ( PortletRequest request ) { } } | Map < String , Object > context = new HashMap < String , Object > ( ) ; context . put ( "property" , properties ) ; Map < String , String > requestMap = new HashMap < String , String > ( ) ; Enumeration < String > names = request . getParameterNames ( ) ; while ( names . hasMoreElements ( ) ) { String name = names . nextElement ( ) ; requestMap . put ( name , request . getParameter ( name ) ) ; } context . put ( "server" , request . getServerName ( ) ) ; context . put ( "port" , request . getServerPort ( ) ) ; context . put ( "protocol" , request . getScheme ( ) ) ; context . put ( "contextPath" , request . getContextPath ( ) ) ; context . put ( "request" , request ) ; context . put ( "requestParam" , requestMap ) ; Map < String , String > userInfo = ( Map < String , String > ) request . getAttribute ( PortletRequest . USER_INFO ) ; context . put ( "user" , userInfo ) ; return context ; |
public class FNIRGImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . FNIRG__GCGID : return GCGID_EDEFAULT == null ? gcgid != null : ! GCGID_EDEFAULT . equals ( gcgid ) ; case AfplibPackage . FNIRG__CHAR_INC : return CHAR_INC_EDEFAULT == null ? charInc != null : ! CHAR_INC_EDEFAULT . equals ( charInc ) ; case AfplibPackage . FNIRG__ASCEND_HT : return ASCEND_HT_EDEFAULT == null ? ascendHt != null : ! ASCEND_HT_EDEFAULT . equals ( ascendHt ) ; case AfplibPackage . FNIRG__DESCEND_DP : return DESCEND_DP_EDEFAULT == null ? descendDp != null : ! DESCEND_DP_EDEFAULT . equals ( descendDp ) ; case AfplibPackage . FNIRG__RESERVED : return RESERVED_EDEFAULT == null ? reserved != null : ! RESERVED_EDEFAULT . equals ( reserved ) ; case AfplibPackage . FNIRG__FNM_CNT : return FNM_CNT_EDEFAULT == null ? fnmCnt != null : ! FNM_CNT_EDEFAULT . equals ( fnmCnt ) ; case AfplibPackage . FNIRG__ASPACE : return ASPACE_EDEFAULT == null ? aSpace != null : ! ASPACE_EDEFAULT . equals ( aSpace ) ; case AfplibPackage . FNIRG__BSPACE : return BSPACE_EDEFAULT == null ? bSpace != null : ! BSPACE_EDEFAULT . equals ( bSpace ) ; case AfplibPackage . FNIRG__CSPACE : return CSPACE_EDEFAULT == null ? cSpace != null : ! CSPACE_EDEFAULT . equals ( cSpace ) ; case AfplibPackage . FNIRG__RESERVED2 : return RESERVED2_EDEFAULT == null ? reserved2 != null : ! RESERVED2_EDEFAULT . equals ( reserved2 ) ; case AfplibPackage . FNIRG__BASE_OSET : return BASE_OSET_EDEFAULT == null ? baseOset != null : ! BASE_OSET_EDEFAULT . equals ( baseOset ) ; } return super . eIsSet ( featureID ) ; |
public class BulkheadExports { /** * { @ inheritDoc } */
@ Override public List < MetricFamilySamples > collect ( ) { } } | final GaugeMetricFamily stats = new GaugeMetricFamily ( name , "Bulkhead Stats" , asList ( "name" , "param" ) ) ; for ( Bulkhead bulkhead : bulkheadsSupplier . get ( ) ) { final Bulkhead . Metrics metrics = bulkhead . getMetrics ( ) ; stats . addMetric ( asList ( bulkhead . getName ( ) , "available_concurrent_calls" ) , metrics . getAvailableConcurrentCalls ( ) ) ; } return singletonList ( stats ) ; |
public class ExpressionUtils { /** * Create the intersection of the given arguments
* @ param left lhs of expression
* @ param right rhs of expression
* @ return left and right */
public static Predicate and ( Predicate left , Predicate right ) { } } | left = ( Predicate ) extract ( left ) ; right = ( Predicate ) extract ( right ) ; if ( left == null ) { return right ; } else if ( right == null ) { return left ; } else { return predicate ( Ops . AND , left , right ) ; } |
public class MethodHandleUtil { /** * JDK 7及以上的方法句柄方式调用
* @ throws Throwable */
protected void demo ( ) throws Throwable { } } | MethodHandles . Lookup lookup = MethodHandles . lookup ( ) ; MethodType type = MethodType . methodType ( String . class , int . class , int . class ) ; MethodHandle mh = lookup . findVirtual ( String . class , "substring" , type ) ; String str = ( String ) mh . invokeExact ( "Hello World" , 1 , 3 ) ; System . out . println ( str ) ; |
public class AbstractCasBanner { /** * Collect environment info with
* details on the java and os deployment
* versions .
* @ param environment the environment
* @ param sourceClass the source class
* @ return environment info */
private String collectEnvironmentInfo ( final Environment environment , final Class < ? > sourceClass ) { } } | val properties = System . getProperties ( ) ; if ( properties . containsKey ( "CAS_BANNER_SKIP" ) ) { try ( val formatter = new Formatter ( ) ) { formatter . format ( "CAS Version: %s%n" , CasVersion . getVersion ( ) ) ; return formatter . toString ( ) ; } } try ( val formatter = new Formatter ( ) ) { val sysInfo = SystemUtils . getSystemInfo ( ) ; sysInfo . forEach ( ( k , v ) -> { if ( k . startsWith ( SEPARATOR_CHAR ) ) { formatter . format ( "%s%n" , LINE_SEPARATOR ) ; } else { formatter . format ( "%s: %s%n" , k , v ) ; } } ) ; formatter . format ( "%s%n" , LINE_SEPARATOR ) ; injectEnvironmentInfoIntoBanner ( formatter , environment , sourceClass ) ; return formatter . toString ( ) ; } |
public class ComponentUtils { /** * Finds appropriate converter for a given value holder
* @ param context FacesContext instance
* @ param component ValueHolder instance to look converter for
* @ return Converter */
public static Converter getConverter ( FacesContext context , UIComponent component ) { } } | if ( ! ( component instanceof ValueHolder ) ) { return null ; } Converter converter = ( ( ValueHolder ) component ) . getConverter ( ) ; if ( converter != null ) { return converter ; } ValueExpression valueExpression = component . getValueExpression ( "value" ) ; if ( valueExpression == null ) { return null ; } Class < ? > converterType = valueExpression . getType ( context . getELContext ( ) ) ; if ( converterType == null || converterType == Object . class ) { // no conversion is needed
return null ; } if ( converterType == String . class && ! PrimeApplicationContext . getCurrentInstance ( context ) . getConfig ( ) . isStringConverterAvailable ( ) ) { return null ; } return context . getApplication ( ) . createConverter ( converterType ) ; |
public class FixDrawTextItem { /** * ( non - Javadoc )
* @ see com . alibaba . simpleimage . render . DrawTextItem # drawText ( java . awt . Graphics2D , int , int ) */
@ Override public void drawText ( Graphics2D graphics , int width , int height ) { } } | if ( StringUtils . isBlank ( text ) ) { return ; } int x = 0 , y = 0 ; int fontsize = 1 ; if ( position == Position . CENTER ) { // 计算水印文字总长度
int textLength = ( int ) ( width * textWidthPercent ) ; // 计算水印字体大小
fontsize = textLength / text . length ( ) ; // 太小了 . . . . . 不显示
if ( fontsize < minFontSize ) { return ; } float fsize = ( float ) fontsize ; Font font = defaultFont . deriveFont ( fsize ) ; graphics . setFont ( font ) ; FontRenderContext context = graphics . getFontRenderContext ( ) ; int sw = ( int ) font . getStringBounds ( text , context ) . getWidth ( ) ; // 计算字体的坐标
x = ( width - sw ) / 2 ; y = height / 2 + fontsize / 2 ; } else if ( position == Position . TOP_LEFT ) { fontsize = ( ( int ) ( width * textWidthPercent ) ) / text . length ( ) ; if ( fontsize < minFontSize ) { return ; } float fsize = ( float ) fontsize ; Font font = defaultFont . deriveFont ( fsize ) ; graphics . setFont ( font ) ; x = fontsize ; y = fontsize * 2 ; } else if ( position == Position . TOP_RIGHT ) { fontsize = ( ( int ) ( width * textWidthPercent ) ) / text . length ( ) ; if ( fontsize < minFontSize ) { return ; } float fsize = ( float ) fontsize ; Font font = defaultFont . deriveFont ( fsize ) ; graphics . setFont ( font ) ; FontRenderContext context = graphics . getFontRenderContext ( ) ; int sw = ( int ) font . getStringBounds ( text , context ) . getWidth ( ) ; x = width - sw - fontsize ; y = fontsize * 2 ; } else if ( position == Position . BOTTOM_LEFT ) { fontsize = ( ( int ) ( width * textWidthPercent ) ) / text . length ( ) ; if ( fontsize < minFontSize ) { return ; } float fsize = ( float ) fontsize ; Font font = defaultFont . deriveFont ( fsize ) ; graphics . setFont ( font ) ; x = fontsize / 2 ; y = height - fontsize ; } else if ( position == Position . BOTTOM_RIGHT ) { fontsize = ( ( int ) ( width * textWidthPercent ) ) / text . length ( ) ; if ( fontsize < minFontSize ) { return ; } float fsize = ( float ) fontsize ; Font font = defaultFont . deriveFont ( fsize ) ; graphics . setFont ( font ) ; FontRenderContext context = graphics . getFontRenderContext ( ) ; int sw = ( int ) font . getStringBounds ( text , context ) . getWidth ( ) ; x = width - sw - fontsize ; y = height - fontsize ; } else { throw new IllegalArgumentException ( "Unknown position : " + position ) ; } if ( x <= 0 || y <= 0 ) { return ; } if ( fontShadowColor != null ) { graphics . setColor ( fontShadowColor ) ; graphics . drawString ( text , x + getShadowTranslation ( fontsize ) , y + getShadowTranslation ( fontsize ) ) ; } graphics . setColor ( fontColor ) ; graphics . drawString ( text , x , y ) ; |
public class AppServiceEnvironmentsInner { /** * Get metrics for a specific instance of a worker pool of an App Service Environment .
* Get metrics for a specific instance of a worker pool of an App Service Environment .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param name Name of the App Service Environment .
* @ param workerPoolName Name of the worker pool .
* @ param instance Name of the instance in the worker pool .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the PagedList & lt ; ResourceMetricInner & gt ; object if successful . */
public PagedList < ResourceMetricInner > listWorkerPoolInstanceMetrics ( final String resourceGroupName , final String name , final String workerPoolName , final String instance ) { } } | ServiceResponse < Page < ResourceMetricInner > > response = listWorkerPoolInstanceMetricsSinglePageAsync ( resourceGroupName , name , workerPoolName , instance ) . toBlocking ( ) . single ( ) ; return new PagedList < ResourceMetricInner > ( response . body ( ) ) { @ Override public Page < ResourceMetricInner > nextPage ( String nextPageLink ) { return listWorkerPoolInstanceMetricsNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) . body ( ) ; } } ; |
public class PolicyTaskFutureImpl { /** * Invoked to abort a task .
* @ param removeFromQueue indicates whether we should first remove the task from the executor ' s queue .
* @ param cause the cause of the abort .
* @ return true if the future transitioned to ABORTED state . */
final boolean abort ( boolean removeFromQueue , Throwable cause ) { } } | if ( removeFromQueue && executor . queue . remove ( this ) ) executor . maxQueueSizeConstraint . release ( ) ; if ( nsAcceptEnd == nsAcceptBegin - 1 ) // currently unset
nsRunEnd = nsQueueEnd = nsAcceptEnd = System . nanoTime ( ) ; boolean aborted = result . compareAndSet ( state , cause ) ; if ( aborted ) try { state . releaseShared ( ABORTED ) ; if ( nsQueueEnd == nsAcceptBegin - 2 ) // currently unset
nsRunEnd = nsQueueEnd = System . nanoTime ( ) ; if ( callback != null ) callback . onEnd ( task , this , null , true , 0 , cause ) ; } finally { if ( latch != null ) latch . countDown ( ) ; if ( cancellableStage != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "completion stage to complete exceptionally: " + cancellableStage ) ; cancellableStage . completeExceptionally ( cause ) ; } } else { // Prevent premature return from abort that would allow subsequent getState ( ) to indicate
// that the task is still in SUBMITTED state .
while ( state . get ( ) < RUNNING ) Thread . yield ( ) ; } return aborted ; |
public class JobClient { /** * Display the information about a job ' s tasks , of a particular type and
* in a particular state
* @ param jobId the ID of the job
* @ param type the type of the task ( map / reduce / setup / cleanup )
* @ param state the state of the task
* ( pending / running / completed / failed / killed ) */
public void displayTasks ( JobID jobId , String type , String state ) throws IOException { } } | TaskReport [ ] reports = new TaskReport [ 0 ] ; if ( type . equals ( "map" ) ) { reports = getMapTaskReports ( jobId ) ; } else if ( type . equals ( "reduce" ) ) { reports = getReduceTaskReports ( jobId ) ; } else if ( type . equals ( "setup" ) ) { reports = getSetupTaskReports ( jobId ) ; } else if ( type . equals ( "cleanup" ) ) { reports = getCleanupTaskReports ( jobId ) ; } for ( TaskReport report : reports ) { TIPStatus status = report . getCurrentStatus ( ) ; if ( ( state . equals ( "pending" ) && status == TIPStatus . PENDING ) || ( state . equals ( "running" ) && status == TIPStatus . RUNNING ) || ( state . equals ( "completed" ) && status == TIPStatus . COMPLETE ) || ( state . equals ( "failed" ) && status == TIPStatus . FAILED ) || ( state . equals ( "killed" ) && status == TIPStatus . KILLED ) ) { printTaskAttempts ( report ) ; } } |
public class DataDistributionManagerImpl { /** * { @ inheritDoc } */
public DataDistributionType getDataDistributionType ( DataDistributionMode mode ) { } } | if ( mode == DataDistributionMode . READABLE ) { return readable ; } else if ( mode == DataDistributionMode . OPTIMIZED ) { return optimized ; } else if ( mode == DataDistributionMode . NONE ) { return none ; } return null ; |
public class WSManRemoteShellService { /** * Deletes the remote shell .
* @ param csHttpClient
* @ param httpClientInputs
* @ param shellId
* @ param wsManRequestInputs
* @ throws RuntimeException
* @ throws IOException
* @ throws URISyntaxException
* @ throws TransformerException
* @ throws XPathExpressionException
* @ throws SAXException
* @ throws ParserConfigurationException */
private void deleteShell ( HttpClientService csHttpClient , HttpClientInputs httpClientInputs , String shellId , WSManRequestInputs wsManRequestInputs ) throws RuntimeException , IOException , URISyntaxException , TransformerException , XPathExpressionException , SAXException , ParserConfigurationException { } } | String documentStr = ResourceLoader . loadAsString ( DELETE_SHELL_REQUEST_XML ) ; documentStr = createDeleteShellRequestBody ( documentStr , httpClientInputs . getUrl ( ) , shellId , String . valueOf ( wsManRequestInputs . getMaxEnvelopeSize ( ) ) , wsManRequestInputs . getWinrmLocale ( ) , String . valueOf ( wsManRequestInputs . getOperationTimeout ( ) ) ) ; Map < String , String > deleteShellResult = executeRequestWithBody ( csHttpClient , httpClientInputs , documentStr ) ; if ( WSManUtils . isSpecificResponseAction ( deleteShellResult . get ( RETURN_RESULT ) , DELETE_RESPONSE_ACTION ) ) { return ; } else if ( WSManUtils . isFaultResponse ( deleteShellResult . get ( RETURN_RESULT ) ) ) { throw new RuntimeException ( WSManUtils . getResponseFault ( deleteShellResult . get ( RETURN_RESULT ) ) ) ; } else { throw new RuntimeException ( UNEXPECTED_SERVICE_RESPONSE + deleteShellResult . get ( RETURN_RESULT ) ) ; } |
public class ReflectUtil { /** * Returns { @ code true } if the given class has a non - private default
* constructor , or has no constructor at all . */
public static boolean hasAccessibleDefaultConstructor ( Class < ? > clazz ) { } } | Constructor < ? > constructor ; try { constructor = clazz . getDeclaredConstructor ( ) ; } catch ( NoSuchMethodException e ) { return clazz . getDeclaredConstructors ( ) . length == 0 ; } return ! isPrivate ( constructor ) ; |
public class ResourceRecordSets { /** * evaluates to true if the input { @ link ResourceRecordSet } exists with { @ link
* ResourceRecordSet # name ( ) name } corresponding to the { @ code name } parameter and { @ link
* ResourceRecordSet # type ( ) type } corresponding to the { @ code type } parameter .
* @ param name the { @ link ResourceRecordSet # name ( ) name } of the desired record set
* @ param type the { @ link ResourceRecordSet # type ( ) type } of the desired record set */
public static Filter < ResourceRecordSet < ? > > nameAndTypeEqualTo ( final String name , final String type ) { } } | checkNotNull ( name , "name" ) ; checkNotNull ( type , "type" ) ; return new Filter < ResourceRecordSet < ? > > ( ) { @ Override public boolean apply ( ResourceRecordSet < ? > in ) { return in != null && name . equals ( in . name ( ) ) && type . equals ( in . type ( ) ) ; } @ Override public String toString ( ) { return "nameAndTypeEqualTo(" + name + "," + type + ")" ; } } ; |
public class Options { /** * Return a short name for the specified type for use in messages . This is usually the lowercase
* simple name of the type , but there are special cases ( for files , regular expressions , enums ,
* @ param type the type whoso short name to return
* @ return a short name for the specified type for use in messages */
private static String typeShortName ( Class < ? > type ) { } } | if ( type . isPrimitive ( ) ) { return type . getName ( ) ; } else if ( type == File . class || type == Path . class ) { return "filename" ; } else if ( type == Pattern . class ) { return "regex" ; } else if ( type . isEnum ( ) ) { return "enum" ; } else { return type . getSimpleName ( ) . toLowerCase ( ) ; } |
public class HttpClientUtils { /** * Creates a simple default http client
* @ return HttpAsyncClient */
public static CloseableHttpAsyncClient defaultClient ( ) { } } | RequestConfig requestConfig = RequestConfig . custom ( ) . setConnectionRequestTimeout ( 0 ) . setConnectTimeout ( 10000 ) . setSocketTimeout ( 20000 ) . setCookieSpec ( CookieSpecs . STANDARD ) . build ( ) ; HttpAsyncClientBuilder httpClientBuilder = HttpAsyncClients . custom ( ) ; httpClientBuilder . setDefaultRequestConfig ( requestConfig ) ; CloseableHttpAsyncClient asyncHttpClient = httpClientBuilder . build ( ) ; asyncHttpClient . start ( ) ; return asyncHttpClient ; |
public class SimpleDataWriterBuilder { /** * Build a { @ link org . apache . gobblin . writer . DataWriter } .
* @ return the built { @ link org . apache . gobblin . writer . DataWriter }
* @ throws java . io . IOException if there is anything wrong building the writer */
@ Override public DataWriter < Object > build ( ) throws IOException { } } | return new MetadataWriterWrapper < byte [ ] > ( new SimpleDataWriter ( this , this . destination . getProperties ( ) ) , byte [ ] . class , this . branches , this . branch , this . destination . getProperties ( ) ) ; |
public class AWSWAFRegionalClient { /** * Creates an < a > GeoMatchSet < / a > , which you use to specify which web requests you want to allow or block based on
* the country that the requests originate from . For example , if you ' re receiving a lot of requests from one or more
* countries and you want to block the requests , you can create an < code > GeoMatchSet < / code > that contains those
* countries and then configure AWS WAF to block the requests .
* To create and configure a < code > GeoMatchSet < / code > , perform the following steps :
* < ol >
* < li >
* Use < a > GetChangeToken < / a > to get the change token that you provide in the < code > ChangeToken < / code > parameter of a
* < code > CreateGeoMatchSet < / code > request .
* < / li >
* < li >
* Submit a < code > CreateGeoMatchSet < / code > request .
* < / li >
* < li >
* Use < code > GetChangeToken < / code > to get the change token that you provide in the < code > ChangeToken < / code >
* parameter of an < a > UpdateGeoMatchSet < / a > request .
* < / li >
* < li >
* Submit an < code > UpdateGeoMatchSetSet < / code > request to specify the countries that you want AWS WAF to watch for .
* < / li >
* < / ol >
* For more information about how to use the AWS WAF API to allow or block HTTP requests , see the < a
* href = " https : / / docs . aws . amazon . com / waf / latest / developerguide / " > AWS WAF Developer Guide < / a > .
* @ param createGeoMatchSetRequest
* @ return Result of the CreateGeoMatchSet operation returned by the service .
* @ throws WAFStaleDataException
* The operation failed because you tried to create , update , or delete an object by using a change token
* that has already been used .
* @ throws WAFInternalErrorException
* The operation failed because of a system problem , even though the request was valid . Retry your request .
* @ throws WAFInvalidAccountException
* The operation failed because you tried to create , update , or delete an object by using an invalid account
* identifier .
* @ throws WAFDisallowedNameException
* The name specified is invalid .
* @ throws WAFInvalidParameterException
* The operation failed because AWS WAF didn ' t recognize a parameter in the request . For example : < / p >
* < ul >
* < li >
* You specified an invalid parameter name .
* < / li >
* < li >
* You specified an invalid value .
* < / li >
* < li >
* You tried to update an object ( < code > ByteMatchSet < / code > , < code > IPSet < / code > , < code > Rule < / code > , or
* < code > WebACL < / code > ) using an action other than < code > INSERT < / code > or < code > DELETE < / code > .
* < / li >
* < li >
* You tried to create a < code > WebACL < / code > with a < code > DefaultAction < / code > < code > Type < / code > other than
* < code > ALLOW < / code > , < code > BLOCK < / code > , or < code > COUNT < / code > .
* < / li >
* < li >
* You tried to create a < code > RateBasedRule < / code > with a < code > RateKey < / code > value other than
* < code > IP < / code > .
* < / li >
* < li >
* You tried to update a < code > WebACL < / code > with a < code > WafAction < / code > < code > Type < / code > other than
* < code > ALLOW < / code > , < code > BLOCK < / code > , or < code > COUNT < / code > .
* < / li >
* < li >
* You tried to update a < code > ByteMatchSet < / code > with a < code > FieldToMatch < / code > < code > Type < / code > other
* than HEADER , METHOD , QUERY _ STRING , URI , or BODY .
* < / li >
* < li >
* You tried to update a < code > ByteMatchSet < / code > with a < code > Field < / code > of < code > HEADER < / code > but no
* value for < code > Data < / code > .
* < / li >
* < li >
* Your request references an ARN that is malformed , or corresponds to a resource with which a web ACL
* cannot be associated .
* < / li >
* @ throws WAFLimitsExceededException
* The operation exceeds a resource limit , for example , the maximum number of < code > WebACL < / code > objects
* that you can create for an AWS account . For more information , see < a
* href = " https : / / docs . aws . amazon . com / waf / latest / developerguide / limits . html " > Limits < / a > in the < i > AWS WAF
* Developer Guide < / i > .
* @ sample AWSWAFRegional . CreateGeoMatchSet
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / waf - regional - 2016-11-28 / CreateGeoMatchSet " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public CreateGeoMatchSetResult createGeoMatchSet ( CreateGeoMatchSetRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeCreateGeoMatchSet ( request ) ; |
public class NodeImpl { /** * { @ inheritDoc } */
public Node getNode ( String relPath ) throws PathNotFoundException , RepositoryException { } } | checkValid ( ) ; JCRPath itemPath = locationFactory . parseRelPath ( relPath ) ; ItemImpl node = dataManager . getItem ( nodeData ( ) , itemPath . getInternalPath ( ) . getEntries ( ) , true , ItemType . NODE ) ; if ( node == null || ! node . isNode ( ) ) { throw new PathNotFoundException ( "Node not found " + ( isRoot ( ) ? "" : getLocation ( ) . getAsString ( false ) ) + "/" + itemPath . getAsString ( false ) ) ; } return ( NodeImpl ) node ; |
public class MkTreeHeader { /** * Writes this header to the specified file .
* Calls { @ link de . lmu . ifi . dbs . elki . index . tree . TreeIndexHeader # writeHeader ( java . io . RandomAccessFile ) }
* and writes additionally the integer value of
* { @ link # k _ max }
* to the file . */
@ Override public void writeHeader ( RandomAccessFile file ) throws IOException { } } | super . writeHeader ( file ) ; file . writeInt ( this . k_max ) ; |
public class HdfsFileStatus { /** * Convert an HdfsFileStatus and its block locations to a LocatedFileStatus
* @ param stat an HdfsFileStatus
* @ param locs the file ' s block locations
* @ param src parent path in string representation
* @ return a FileStatus object */
public static LocatedFileStatus toLocatedFileStatus ( HdfsFileStatus stat , LocatedBlocks locs , String src ) { } } | if ( stat == null ) { return null ; } return new LocatedFileStatus ( stat . getLen ( ) , stat . isDir ( ) , stat . getReplication ( ) , stat . getBlockSize ( ) , stat . getModificationTime ( ) , stat . getAccessTime ( ) , stat . getPermission ( ) , stat . getOwner ( ) , stat . getGroup ( ) , stat . getFullPath ( new Path ( src ) ) , // full path
DFSUtil . locatedBlocks2Locations ( locs ) ) ; |
public class RunResults { /** * returns null if not found */
public RootMethodRunResult getRunResultByRootMethodKey ( String key ) { } } | if ( key == null ) { throw new NullPointerException ( ) ; } for ( RootMethodRunResult rootMethodRunResult : rootMethodRunResults ) { if ( ( rootMethodRunResult . getRootMethod ( ) != null ) && key . equals ( rootMethodRunResult . getRootMethod ( ) . getKey ( ) ) ) { return rootMethodRunResult ; } } return null ; |
public class ListApi { /** * Get map value by path .
* @ param < A > map key type
* @ param < B > map value type
* @ param list subject
* @ param path nodes to walk in map
* @ return value */
public static < A , B > Optional < Map < A , B > > getMap ( final List list , final Integer ... path ) { } } | return get ( list , Map . class , path ) . map ( m -> ( Map < A , B > ) m ) ; |
public class SerializerCore { /** * ! @ internal This should be probably private . */
void _emitJcc ( INST_CODE code , Label label , final int hint ) { } } | if ( hint == 0 ) { emitX86 ( code , label ) ; } else { emitX86 ( code , label , Immediate . imm ( hint ) ) ; } |
public class CmsSearchResultView { /** * Returns the resource uri to the search page with respect to the
* optionally configured value < code > { @ link # setSearchRessourceUrl ( String ) } < / code >
* with the request parameters of the given argument . < p >
* This is a workaround for Tomcat bug 35775
* ( http : / / issues . apache . org / bugzilla / show _ bug . cgi ? id = 35775 ) . After it has been
* fixed the version 1.1 should be restored ( or at least this codepath should be switched back . < p >
* @ param link the suggestion of the search result bean ( a previous , next or page number url )
* @ param search the search bean
* @ return the resource uri to the search page with respect to the
* optionally configured value < code > { @ link # setSearchRessourceUrl ( String ) } < / code >
* with the request parameters of the given argument */
private String getSearchPageLink ( String link , CmsSearch search ) { } } | if ( m_searchRessourceUrl != null ) { // for the form to generate we need params .
String pageParams = "" ; int paramIndex = link . indexOf ( '?' ) ; if ( paramIndex > 0 ) { pageParams = link . substring ( paramIndex ) ; } StringBuffer formurl = new StringBuffer ( m_searchRessourceUrl ) ; if ( m_searchRessourceUrl . indexOf ( '?' ) != - 1 ) { // the search page url already has a query string , don ' t start params of search - generated link
// with ' ? '
pageParams = new StringBuffer ( "&" ) . append ( pageParams . substring ( 1 ) ) . toString ( ) ; } formurl . append ( pageParams ) . toString ( ) ; String formname = toPostParameters ( formurl . toString ( ) , search ) ; link = new StringBuffer ( "javascript:document.forms['" ) . append ( formname ) . append ( "'].submit()" ) . toString ( ) ; } return link ; |
public class LinePositionReader { /** * After calling readLine , calling getLineNumber returns the next line
* number . */
public String readLine ( ) throws IOException { } } | StringBuffer buf = new StringBuffer ( 80 ) ; int line = mLineNumber ; int c ; while ( line == mLineNumber && ( c = read ( ) ) >= 0 ) { buf . append ( ( char ) c ) ; } return buf . toString ( ) ; |
public class ObjectUtil { /** * Convert the PrimitiveObject from Hadoop { @ link Writable } .
* @ param object
* @ return PrimitiveObject */
public static PrimitiveObject hadoop2Primitive ( Writable object ) { } } | if ( object instanceof NullWritable ) { return new PrimitiveObject ( NULL , null ) ; } if ( object instanceof ByteWritable ) { return new PrimitiveObject ( BYTE , ( ( ByteWritable ) object ) . get ( ) ) ; } else if ( object instanceof IntWritable ) { return new PrimitiveObject ( INTEGER , ( ( IntWritable ) object ) . get ( ) ) ; } else if ( object instanceof LongWritable ) { return new PrimitiveObject ( LONG , ( ( LongWritable ) object ) . get ( ) ) ; } else if ( object instanceof DoubleWritable ) { return new PrimitiveObject ( DOUBLE , ( ( DoubleWritable ) object ) . get ( ) ) ; } else if ( object instanceof FloatWritable ) { return new PrimitiveObject ( FLOAT , ( ( FloatWritable ) object ) . get ( ) ) ; } else if ( object instanceof BooleanWritable ) { return new PrimitiveObject ( BOOLEAN , ( ( BooleanWritable ) object ) . get ( ) ) ; } else if ( object instanceof Text ) { return new PrimitiveObject ( STRING , ( ( Text ) object ) . toString ( ) ) ; } else if ( object instanceof ArrayWritable ) { ArrayWritable aw = ( ArrayWritable ) object ; if ( aw . get ( ) . length == 0 ) { return new PrimitiveObject ( ARRAY , true , STRING , new ArrayList < String > ( ) ) ; } int type = NULL ; List < Object > l = new ArrayList < Object > ( ) ; for ( Writable w : aw . get ( ) ) { PrimitiveObject no = hadoop2Primitive ( w ) ; type = no . getType ( ) ; l . add ( no . getObject ( ) ) ; } return new PrimitiveObject ( ARRAY , true , type , l ) ; } else if ( object instanceof MapWritable ) { MapWritable mw = ( MapWritable ) object ; if ( mw . size ( ) == 0 ) { return new PrimitiveObject ( MAP , true , STRING , STRING , new HashMap < String , String > ( ) ) ; } int keyType = NULL ; int valueType = NULL ; Map < Object , Object > m = new HashMap < Object , Object > ( ) ; for ( Entry < Writable , Writable > entry : mw . entrySet ( ) ) { PrimitiveObject keyNo = hadoop2Primitive ( entry . getKey ( ) ) ; PrimitiveObject valueNo = hadoop2Primitive ( entry . getValue ( ) ) ; keyType = keyNo . getType ( ) ; valueType = valueNo . getType ( ) ; m . put ( keyNo . getObject ( ) , valueNo . getObject ( ) ) ; } return new PrimitiveObject ( MAP , true , keyType , valueType , m ) ; } throw new ClassCastException ( "cast object not found" ) ; |
public class AtomSymbol { /** * Access the java . awt . Shape outlines of each annotation adjunct .
* @ return annotation outlines */
List < Shape > getAnnotationOutlines ( ) { } } | List < Shape > shapes = new ArrayList < Shape > ( ) ; for ( TextOutline adjunct : annotationAdjuncts ) shapes . add ( adjunct . getOutline ( ) ) ; return shapes ; |
public class PersonBuilderImpl { /** * { @ inheritDoc } */
@ Override public Name addNameToPerson ( final Person person , final String string ) { } } | if ( person == null || string == null ) { return new Name ( ) ; } final Name name = new Name ( person , string ) ; person . insert ( name ) ; return name ; |
public class InMemoryStorage { /** * region Storage Implementation */
@ Override public void initialize ( long epoch ) { } } | // InMemoryStorage does not use epochs ; we don ' t do anything with it .
Preconditions . checkArgument ( epoch > 0 , "epoch must be a positive number. Given %s." , epoch ) ; Preconditions . checkState ( this . initialized . compareAndSet ( false , true ) , "InMemoryStorage is already initialized." ) ; |
public class CpuUsageStrategyFactory { /** * Initializes strategy instance .
* @ param broker
* parent ServiceBroker */
@ Override public void started ( ServiceBroker broker ) throws Exception { } } | super . started ( broker ) ; // Get components
transporter = broker . getConfig ( ) . getTransporter ( ) ; if ( transporter == null ) { logger . warn ( CommonUtils . nameOf ( this , true ) + " can't work without transporter. Switched to Round-Robin mode." ) ; } |
public class SqlBuilderHelper { /** * Count parameter of type .
* @ param method
* the method
* @ param parameter
* the parameter
* @ return the int */
public static int countParameterOfType ( ModelMethod method , TypeName parameter ) { } } | int counter = 0 ; for ( Pair < String , TypeName > item : method . getParameters ( ) ) { if ( item . value1 . equals ( parameter ) ) { counter ++ ; } } return counter ; |
public class AbstractAppender { /** * Fails an attempt to contact a member . */
protected void failAttempt ( MemberState member , Throwable error ) { } } | // Reset the connection to the given member to ensure failed connections are reconstructed upon retries .
context . getConnections ( ) . resetConnection ( member . getMember ( ) . serverAddress ( ) ) ; // If any append error occurred , increment the failure count for the member . Log the first three failures ,
// and thereafter log 1 % of the failures . This keeps the log from filling up with annoying error messages
// when attempting to send entries to down followers .
int failures = member . incrementFailureCount ( ) ; if ( failures <= 3 || failures % 100 == 0 ) { logger . warn ( "{} - AppendRequest to {} failed: {}" , context . getCluster ( ) . member ( ) . address ( ) , member . getMember ( ) . address ( ) , error . getMessage ( ) ) ; } |
public class HadoopUtils { /** * Returns { @ link ParameterTool } for the arguments parsed by { @ link GenericOptionsParser } .
* @ param args Input array arguments . It should be parsable by { @ link GenericOptionsParser }
* @ return A { @ link ParameterTool }
* @ throws IOException If arguments cannot be parsed by { @ link GenericOptionsParser }
* @ see GenericOptionsParser */
public static ParameterTool paramsFromGenericOptionsParser ( String [ ] args ) throws IOException { } } | Option [ ] options = new GenericOptionsParser ( args ) . getCommandLine ( ) . getOptions ( ) ; Map < String , String > map = new HashMap < String , String > ( ) ; for ( Option option : options ) { String [ ] split = option . getValue ( ) . split ( "=" ) ; map . put ( split [ 0 ] , split [ 1 ] ) ; } return ParameterTool . fromMap ( map ) ; |
public class DescribeApplicationSnapshotRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeApplicationSnapshotRequest describeApplicationSnapshotRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeApplicationSnapshotRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeApplicationSnapshotRequest . getApplicationName ( ) , APPLICATIONNAME_BINDING ) ; protocolMarshaller . marshall ( describeApplicationSnapshotRequest . getSnapshotName ( ) , SNAPSHOTNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class JsUtils { /** * Call via jsni any arbitrary function present in a Javascript object .
* It ' s thought for avoiding to create jsni methods to call external functions and
* facilitate the writing of js wrappers .
* Example
* < pre >
* / / Create a svg node in our document .
* Element svg = runJavascriptFunction ( document , " createElementNS " , " http : / / www . w3 . org / 2000 / svg " , " svg " ) ;
* / / Append it to the dom
* $ ( svg ) . appendTo ( document ) ;
* < / pre >
* @ param o the javascript object where the function is , it it is null we use window .
* @ param meth the literal name of the function to call , dot separators are allowed .
* @ param args an array with the arguments to pass to the function .
* @ return the java ready boxed object returned by the jsni method or null , if the
* call return a number we will get a Double , if it returns a boolean we get a java
* Boolean , strings comes as java String , otherwise we get the javascript object .
* @ deprecated use jsni instead . */
public static < T > T runJavascriptFunction ( JavaScriptObject o , String meth , Object ... args ) { } } | return runJavascriptFunctionImpl ( o , meth , JsObjectArray . create ( ) . add ( args ) . < JsArrayMixed > cast ( ) ) ; |
public class MercatorProjection { /** * Get LatLong from Pixels . */
public static LatLong fromPixelsWithScaleFactor ( double pixelX , double pixelY , double scaleFactor , int tileSize ) { } } | return new LatLong ( pixelYToLatitudeWithScaleFactor ( pixelY , scaleFactor , tileSize ) , pixelXToLongitudeWithScaleFactor ( pixelX , scaleFactor , tileSize ) ) ; |
public class AppTimeZone { /** * Returns the display name of the timezone .
* @ return The display name of the timezone */
private String getDisplayName ( ) { } } | long hours = TimeUnit . MILLISECONDS . toHours ( tz . getRawOffset ( ) ) ; long minutes = Math . abs ( TimeUnit . MILLISECONDS . toMinutes ( tz . getRawOffset ( ) ) - TimeUnit . HOURS . toMinutes ( hours ) ) ; return String . format ( "(GMT%+d:%02d) %s" , hours , minutes , tz . getID ( ) ) ; |
public class AbstractParamContainerPanel { /** * Gets the headline panel , that shows the name of the ( selected ) panel and has the help button .
* @ return the headline panel , never { @ code null } .
* @ see # getTxtHeadline ( )
* @ see # getHelpButton ( ) */
private JPanel getPanelHeadline ( ) { } } | if ( panelHeadline == null ) { panelHeadline = new JPanel ( ) ; panelHeadline . setLayout ( new BorderLayout ( 0 , 0 ) ) ; txtHeadline = getTxtHeadline ( ) ; panelHeadline . add ( txtHeadline , BorderLayout . CENTER ) ; JButton button = getHelpButton ( ) ; panelHeadline . add ( button , BorderLayout . EAST ) ; } return panelHeadline ; |
public class UnderFileSystemWithLogging { /** * TODO ( calvin ) : General tag logic should be in getMetricName */
private String getQualifiedMetricName ( String metricName ) { } } | try { if ( SecurityUtils . isAuthenticationEnabled ( mConfiguration ) && AuthenticatedClientUser . get ( mConfiguration ) != null ) { return Metric . getMetricNameWithTags ( metricName , CommonMetrics . TAG_USER , AuthenticatedClientUser . get ( mConfiguration ) . getName ( ) , WorkerMetrics . TAG_UFS , MetricsSystem . escape ( new AlluxioURI ( mPath ) ) , WorkerMetrics . TAG_UFS_TYPE , mUnderFileSystem . getUnderFSType ( ) ) ; } } catch ( IOException e ) { // fall through
} return Metric . getMetricNameWithTags ( metricName , WorkerMetrics . TAG_UFS , MetricsSystem . escape ( new AlluxioURI ( mPath ) ) , WorkerMetrics . TAG_UFS_TYPE , mUnderFileSystem . getUnderFSType ( ) ) ; |
public class IteratorHelper { /** * Retrieve the size of the passed { @ link Iterator } .
* @ param aIterator
* Iterator to check . May be < code > null < / code > .
* @ return The number objects or 0 if the passed parameter is
* < code > null < / code > . */
@ Nonnegative public static int getSize ( @ Nullable final Iterator < ? > aIterator ) { } } | int ret = 0 ; if ( aIterator != null ) while ( aIterator . hasNext ( ) ) { aIterator . next ( ) ; ++ ret ; } return ret ; |
public class SamplingRatiosRGImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case AfplibPackage . SAMPLING_RATIOS_RG__HSAMPLE : return getHSAMPLE ( ) ; case AfplibPackage . SAMPLING_RATIOS_RG__VSAMPLE : return getVSAMPLE ( ) ; } return super . eGet ( featureID , resolve , coreType ) ; |
public class JobsInner { /** * Update Job .
* Update is only supported for description and priority . Updating Priority will take effect when the Job state is Queued or Scheduled and depending on the timing the priority update may be ignored .
* @ param resourceGroupName The name of the resource group within the Azure subscription .
* @ param accountName The Media Services account name .
* @ param transformName The Transform name .
* @ param jobName The Job name .
* @ param parameters The request parameters
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the JobInner object */
public Observable < JobInner > updateAsync ( String resourceGroupName , String accountName , String transformName , String jobName , JobInner parameters ) { } } | return updateWithServiceResponseAsync ( resourceGroupName , accountName , transformName , jobName , parameters ) . map ( new Func1 < ServiceResponse < JobInner > , JobInner > ( ) { @ Override public JobInner call ( ServiceResponse < JobInner > response ) { return response . body ( ) ; } } ) ; |
public class AnnotatedString { /** * Some test code */
private static void addButton ( JFrame frame , String s ) { } } | AnnotatedString as = new AnnotatedString ( s ) ; JButton button = new JButton ( as . toString ( ) ) ; button . setMnemonic ( as . getMnemonic ( ) ) ; button . setDisplayedMnemonicIndex ( as . getMnemonicIndex ( ) ) ; frame . getContentPane ( ) . add ( button ) ; System . out . println ( "\"" + s + "\" \"" + as + "\" '" + as . getMnemonic ( ) + "' " + as . getMnemonicIndex ( ) ) ; |
public class PatternCriteria { /** * / * ( non - Javadoc )
* @ see org . talend . esb . sam . server . persistence . criterias . Criteria # getFilterClause ( ) */
@ Override public StringBuilder getFilterClause ( ) { } } | StringBuilder builder = new StringBuilder ( ) ; builder . append ( columnName ) ; builder . append ( " LIKE " ) ; builder . append ( ':' ) . append ( name ) ; if ( condition != null ) { builder . append ( " AND " ) ; builder . append ( condition ) ; } return builder ; |
public class ExecutionServiceImpl { /** * check if the execution should be Paused , and pause it if needed */
protected boolean handlePausedFlow ( Execution execution ) throws InterruptedException { } } | String branchId = execution . getSystemContext ( ) . getBranchId ( ) ; PauseReason reason = findPauseReason ( execution . getExecutionId ( ) , branchId ) ; if ( reason != null ) { // need to pause the execution
pauseFlow ( reason , execution ) ; return true ; } return false ; |
public class AWSSecurityHubClient { /** * Lists all Security Hub membership invitations that were sent to the current AWS account .
* @ param listInvitationsRequest
* @ return Result of the ListInvitations operation returned by the service .
* @ throws InternalException
* Internal server error .
* @ throws InvalidInputException
* The request was rejected because an invalid or out - of - range value was supplied for an input parameter .
* @ throws InvalidAccessException
* AWS Security Hub is not enabled for the account used to make this request .
* @ throws LimitExceededException
* The request was rejected because it attempted to create resources beyond the current AWS account limits .
* The error code describes the limit exceeded .
* @ sample AWSSecurityHub . ListInvitations
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / securityhub - 2018-10-26 / ListInvitations " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public ListInvitationsResult listInvitations ( ListInvitationsRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeListInvitations ( request ) ; |
public class WebContainerLogger { /** * If last object in argument is a throwable , then the full stack trace is used to replace the throwable .
* This is because Throwable . toString ( ) method would only output the title of the exception .
* Then the parent Logger . logp ( ) method is called . */
public void logp ( Level level , String sourceClass , String sourceMethod , String msg , Object params [ ] ) { } } | // PK86423 Start
// int lastParam = params . length - 1;
// if ( params . length > 0 & & params [ lastParam ] instanceof Throwable ) {
// params [ lastParam ] = throwableToString ( ( Throwable ) params [ lastParam ] ) ;
if ( params != null && params . length > 0 && params [ params . length - 1 ] instanceof Throwable ) { params [ params . length - 1 ] = throwableToString ( ( Throwable ) params [ params . length - 1 ] ) ; } // PK86423 End
delegateLogger . logp ( level , sourceClass , sourceMethod , msg , params ) ; |
public class SREutils { /** * Replies the internal skill of an agent .
* @ param < S > the type of the capacity .
* @ param agent the agent .
* @ param type the type of the capacity .
* @ return the skill .
* @ throws UnimplementedCapacityException if the agent has not a skill for the given capacity .
* @ since 0.6 */
@ Pure public static < S extends Capacity > S getInternalSkill ( Agent agent , Class < S > type ) { } } | return agent . getSkill ( type ) ; |
public class FillEntityFromReq { /** * < p > Fill entity from pequest . < / p >
* @ param T entity type
* @ param pAddParam additional param
* @ param pEntity Entity to fill
* @ param pReq - request
* @ throws Exception - an exception */
@ Override public final < T > void fill ( final Map < String , Object > pAddParam , final T pEntity , final IRequestData pReq ) throws Exception { } } | boolean isDbgSh = this . logger . getDbgSh ( this . getClass ( ) ) && this . logger . getDbgFl ( ) < 7010 && this . logger . getDbgCl ( ) > 7015 ; if ( isDbgSh ) { this . logger . debug ( null , FillEntityFromReq . class , "Default charset = " + Charset . defaultCharset ( ) ) ; } @ SuppressWarnings ( "unchecked" ) IFillerObjectFields < T > filler = ( IFillerObjectFields < T > ) this . fillersFieldsFactory . lazyGet ( pAddParam , pEntity . getClass ( ) ) ; for ( String fieldName : filler . getFieldsNames ( ) ) { try { String valStr = pReq . getParameter ( pEntity . getClass ( ) . getSimpleName ( ) + "." + fieldName ) ; // standard
if ( valStr != null ) { // e . g . Boolean checkbox or none - editable
String convName = this . fieldConverterNamesHolder . getFor ( pEntity . getClass ( ) , fieldName ) ; if ( isDbgSh ) { this . logger . debug ( null , FillEntityFromReq . class , "Try fill field/inClass/converterName/value: " + fieldName + "/" + pEntity . getClass ( ) . getCanonicalName ( ) + "/" + convName + "/" + valStr ) ; } IConverterToFromString conv = this . convertersFieldsFatory . lazyGet ( pAddParam , convName ) ; Object fieldVal = conv . fromString ( pAddParam , valStr ) ; if ( fieldVal != null && isDbgSh ) { this . logger . debug ( null , FillEntityFromReq . class , "Converted fieldClass/toString: " + fieldVal . getClass ( ) . getCanonicalName ( ) + "/" + fieldVal ) ; } filler . fill ( pAddParam , pEntity , fieldVal , fieldName ) ; } } catch ( Exception ex ) { String msg = "Can't fill field/class: " + fieldName + "/" + pEntity . getClass ( ) . getCanonicalName ( ) ; throw new ExceptionWithCode ( ExceptionWithCode . SOMETHING_WRONG , msg , ex ) ; } } |
public class EngineConfiguration { /** * Compares { @ code Integer } types , taking into account possible { @ code null }
* values . When { @ code null } , then the return value will be such that the
* other value will come first in a comparison . If both values are { @ code null } ,
* then they are effectively equal .
* @ param o1 The first value to compare .
* @ param o2 The second value to compare .
* @ return - 1 , 0 , or 1 if the first value should come before , equal to , or
* after the second . */
private static int nullSafeIntegerComparison ( Integer o1 , Integer o2 ) { } } | return o1 != null ? o2 != null ? o1 . compareTo ( o2 ) : - 1 : o2 != null ? 1 : 0 ; |
public class DsParser { /** * Parse validation
* @ param reader The reader
* @ return The result
* @ exception XMLStreamException XMLStreamException
* @ exception ParserException ParserException
* @ exception ValidateException ValidateException */
protected Validation parseValidationSetting ( XMLStreamReader reader ) throws XMLStreamException , ParserException , ValidateException { } } | Boolean validateOnMatch = Defaults . VALIDATE_ON_MATCH ; Boolean useFastFail = Defaults . USE_CCM ; Long backgroundValidationMillis = null ; Extension staleConnectionChecker = null ; Boolean backgroundValidation = Defaults . BACKGROUND_VALIDATION ; String checkValidConnectionSql = null ; Extension validConnectionChecker = null ; Extension exceptionSorter = null ; Map < String , String > expressions = new HashMap < String , String > ( ) ; while ( reader . hasNext ( ) ) { switch ( reader . nextTag ( ) ) { case END_ELEMENT : { if ( XML . ELEMENT_VALIDATION . equals ( reader . getLocalName ( ) ) ) { return new ValidationImpl ( backgroundValidation , backgroundValidationMillis , useFastFail , validConnectionChecker , checkValidConnectionSql , validateOnMatch , staleConnectionChecker , exceptionSorter , ! expressions . isEmpty ( ) ? expressions : null ) ; } else { switch ( reader . getLocalName ( ) ) { case XML . ELEMENT_BACKGROUND_VALIDATION : case XML . ELEMENT_BACKGROUND_VALIDATION_MILLIS : case XML . ELEMENT_CHECK_VALID_CONNECTION_SQL : case XML . ELEMENT_EXCEPTION_SORTER : case XML . ELEMENT_STALE_CONNECTION_CHECKER : case XML . ELEMENT_USE_FAST_FAIL : case XML . ELEMENT_VALIDATE_ON_MATCH : case XML . ELEMENT_VALID_CONNECTION_CHECKER : break ; default : throw new ParserException ( bundle . unexpectedEndTag ( reader . getLocalName ( ) ) ) ; } } break ; } case START_ELEMENT : { switch ( reader . getLocalName ( ) ) { case XML . ELEMENT_BACKGROUND_VALIDATION : { backgroundValidation = elementAsBoolean ( reader , XML . ELEMENT_BACKGROUND_VALIDATION , expressions ) ; break ; } case XML . ELEMENT_BACKGROUND_VALIDATION_MILLIS : { backgroundValidationMillis = elementAsLong ( reader , XML . ELEMENT_BACKGROUND_VALIDATION_MILLIS , expressions ) ; break ; } case XML . ELEMENT_CHECK_VALID_CONNECTION_SQL : { checkValidConnectionSql = elementAsString ( reader , XML . ELEMENT_CHECK_VALID_CONNECTION_SQL , expressions ) ; break ; } case XML . ELEMENT_EXCEPTION_SORTER : { exceptionSorter = parseExtension ( reader , XML . ELEMENT_EXCEPTION_SORTER ) ; break ; } case XML . ELEMENT_STALE_CONNECTION_CHECKER : { staleConnectionChecker = parseExtension ( reader , XML . ELEMENT_STALE_CONNECTION_CHECKER ) ; break ; } case XML . ELEMENT_USE_FAST_FAIL : { useFastFail = elementAsBoolean ( reader , XML . ELEMENT_USE_FAST_FAIL , expressions ) ; break ; } case XML . ELEMENT_VALIDATE_ON_MATCH : { validateOnMatch = elementAsBoolean ( reader , XML . ELEMENT_VALIDATE_ON_MATCH , expressions ) ; break ; } case XML . ELEMENT_VALID_CONNECTION_CHECKER : { validConnectionChecker = parseExtension ( reader , XML . ELEMENT_VALID_CONNECTION_CHECKER ) ; break ; } default : throw new ParserException ( bundle . unexpectedElement ( reader . getLocalName ( ) ) ) ; } break ; } } } throw new ParserException ( bundle . unexpectedEndOfDocument ( ) ) ; |
public class druidGLexer { /** * $ ANTLR start " LCURLY " */
public final void mLCURLY ( ) throws RecognitionException { } } | try { int _type = LCURLY ; int _channel = DEFAULT_TOKEN_CHANNEL ; // druidG . g : 575:8 : ( ' { ' )
// druidG . g : 575:11 : ' { '
{ match ( '{' ) ; } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving
} |
public class ContainersInner { /** * Executes a command in a specific container instance .
* Executes a command for a specific container instance in a specified resource group and container group .
* @ param resourceGroupName The name of the resource group .
* @ param containerGroupName The name of the container group .
* @ param containerName The name of the container instance .
* @ param containerExecRequest The request for the exec command .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < ContainerExecResponseInner > executeCommandAsync ( String resourceGroupName , String containerGroupName , String containerName , ContainerExecRequest containerExecRequest , final ServiceCallback < ContainerExecResponseInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( executeCommandWithServiceResponseAsync ( resourceGroupName , containerGroupName , containerName , containerExecRequest ) , serviceCallback ) ; |
public class UnsafeMapData { /** * Update this UnsafeMapData to point to different backing data .
* @ param baseObject the base object
* @ param baseOffset the offset within the base object
* @ param sizeInBytes the size of this map ' s backing data , in bytes */
public void pointTo ( Object baseObject , long baseOffset , int sizeInBytes ) { } } | // Read the numBytes of key array from the first 8 bytes .
final long keyArraySize = Platform . getLong ( baseObject , baseOffset ) ; assert keyArraySize >= 0 : "keyArraySize (" + keyArraySize + ") should >= 0" ; assert keyArraySize <= Integer . MAX_VALUE : "keyArraySize (" + keyArraySize + ") should <= Integer.MAX_VALUE" ; final int valueArraySize = sizeInBytes - ( int ) keyArraySize - 8 ; assert valueArraySize >= 0 : "valueArraySize (" + valueArraySize + ") should >= 0" ; keys . pointTo ( baseObject , baseOffset + 8 , ( int ) keyArraySize ) ; values . pointTo ( baseObject , baseOffset + 8 + keyArraySize , valueArraySize ) ; assert keys . numElements ( ) == values . numElements ( ) ; this . baseObject = baseObject ; this . baseOffset = baseOffset ; this . sizeInBytes = sizeInBytes ; |
public class PutBackupVaultNotificationsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( PutBackupVaultNotificationsRequest putBackupVaultNotificationsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( putBackupVaultNotificationsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( putBackupVaultNotificationsRequest . getBackupVaultName ( ) , BACKUPVAULTNAME_BINDING ) ; protocolMarshaller . marshall ( putBackupVaultNotificationsRequest . getSNSTopicArn ( ) , SNSTOPICARN_BINDING ) ; protocolMarshaller . marshall ( putBackupVaultNotificationsRequest . getBackupVaultEvents ( ) , BACKUPVAULTEVENTS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class Mapper { /** * Return the results of mapping all objects with the mapper .
* @ param mapper an Mapper
* @ param c a Collection
* @ param allowNull allow null values
* @ return a Collection of the results . */
public static Collection map ( Mapper mapper , Collection c , boolean allowNull ) { } } | return map ( mapper , c . iterator ( ) , allowNull ) ; |
public class AlreadyExistsException { /** * @ param arn */
@ com . fasterxml . jackson . annotation . JsonProperty ( "Arn" ) public void setArn ( String arn ) { } } | this . arn = arn ; |
public class OSGiInjectionScopeData { /** * Add java : comp / env bindings . */
public void addCompEnvBindings ( Map < String , InjectionBinding < ? > > newBindings ) { } } | if ( ! compLock . writeLock ( ) . isHeldByCurrentThread ( ) ) { throw new IllegalStateException ( ) ; } if ( compEnvBindings == null ) { compEnvBindings = new JavaColonNamespaceBindings < InjectionBinding < ? > > ( NamingConstants . JavaColonNamespace . COMP_ENV , InjectionBindingClassNameProvider . instance ) ; } for ( Map . Entry < String , InjectionBinding < ? > > entry : newBindings . entrySet ( ) ) { compEnvBindings . bind ( entry . getKey ( ) , entry . getValue ( ) ) ; } |
public class JdbcConnectionSupplierImpl { /** * transactionIsolationオプションの指定
* @ see Connection # TRANSACTION _ READ _ UNCOMMITTED
* @ see Connection # TRANSACTION _ READ _ COMMITTED
* @ see Connection # TRANSACTION _ REPEATABLE _ READ
* @ see Connection # TRANSACTION _ SERIALIZABLE
* @ param transactionIsolation transactionIsolationオプション */
public void setDefaultTransactionIsolation ( final int transactionIsolation ) { } } | if ( Connection . TRANSACTION_READ_UNCOMMITTED == transactionIsolation || Connection . TRANSACTION_READ_COMMITTED == transactionIsolation || Connection . TRANSACTION_REPEATABLE_READ == transactionIsolation || Connection . TRANSACTION_SERIALIZABLE == transactionIsolation ) { props . put ( PROPS_TRANSACTION_ISOLATION , String . valueOf ( transactionIsolation ) ) ; } else { throw new IllegalArgumentException ( "Unsupported level [" + transactionIsolation + "]" ) ; } |
public class ST_Graph { /** * Edges direction according the slope ( start and end z )
* @ param st
* @ param nodesName
* @ param edgesName
* @ throws SQLException */
private static void orientBySlope ( Statement st , TableLocation nodesName , TableLocation edgesName ) throws SQLException { } } | LOGGER . info ( "Orienting edges by slope..." ) ; st . execute ( "UPDATE " + edgesName + " c " + "SET START_NODE=END_NODE, " + " END_NODE=START_NODE " + "WHERE (SELECT ST_Z(A.THE_GEOM) < ST_Z(B.THE_GEOM) " + "FROM " + nodesName + " A, " + nodesName + " B " + "WHERE C.START_NODE=A.NODE_ID AND C.END_NODE=B.NODE_ID);" ) ; |
public class Tetrahedron { /** * Returns the vertices of an n - fold polygon of given radius and center
* @ param n
* @ param radius
* @ param center
* @ return */
@ Override public Point3d [ ] getVertices ( ) { } } | double x = getSideLengthFromCircumscribedRadius ( circumscribedRadius ) / 2 ; double z = x / Math . sqrt ( 2 ) ; Point3d [ ] tetrahedron = new Point3d [ 4 ] ; tetrahedron [ 0 ] = new Point3d ( - x , 0 , - z ) ; tetrahedron [ 1 ] = new Point3d ( x , 0 , - z ) ; tetrahedron [ 2 ] = new Point3d ( 0 , - x , z ) ; tetrahedron [ 3 ] = new Point3d ( 0 , x , z ) ; Point3d centroid = CalcPoint . centroid ( tetrahedron ) ; // rotate tetrahedron to align one vertex with the + z axis
Matrix3d m = new Matrix3d ( ) ; m . rotX ( 0.5 * TETRAHEDRAL_ANGLE ) ; for ( Point3d p : tetrahedron ) { p . sub ( centroid ) ; m . transform ( p ) ; } return tetrahedron ; |
public class ElementUI { /** * Returns the UI element that registered the CWF component .
* @ param component The CWF component of interest .
* @ return The associated UI element . */
public static ElementUI getAssociatedElement ( BaseComponent component ) { } } | return component == null ? null : ( ElementUI ) component . getAttribute ( ASSOC_ELEMENT ) ; |
public class StaticArrayEntryList { /** * The integer metaDataSchema is considered as an array of 4bit blocks . If a block equals 0 , that means that there is no further
* meta - data attached . Otherwise , the value translates to the specific meta data as { @ code EntryMetaData . values ( ) [ value - 1 ] } .
* This means that
* 1 ) metaDataSchema = 0 = > there is no meta data attached to these entries and
* 2 ) We can accommodate at most 15 enum instances in EntryMetaData and at most 8 can be attached to entries . */
private static EntryMetaData [ ] parseMetaDataSchema ( int metaDataSchema ) { } } | assert EntryMetaData . values ( ) . length < 15 ; if ( metaDataSchema == 0 ) return StaticArrayEntry . EMPTY_SCHEMA ; int size = 8 - Integer . numberOfLeadingZeros ( metaDataSchema ) / 4 ; assert size > 0 ; EntryMetaData [ ] meta = new EntryMetaData [ size ] ; for ( int i = 0 ; i < size ; i ++ ) { int index = metaDataSchema & 0x0F ; assert index > 0 ; EntryMetaData md = EntryMetaData . values ( ) [ index - 1 ] ; assert md != null ; meta [ i ] = md ; } return meta ; |
public class InternalXbaseParser { /** * InternalXbase . g : 454:1 : ruleXAndExpression returns [ EObject current = null ] : ( this _ XEqualityExpression _ 0 = ruleXEqualityExpression ( ( ( ( ( ) ( ( ruleOpAnd ) ) ) ) = > ( ( ) ( ( ruleOpAnd ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXEqualityExpression ) ) ) * ) ; */
public final EObject ruleXAndExpression ( ) throws RecognitionException { } } | EObject current = null ; EObject this_XEqualityExpression_0 = null ; EObject lv_rightOperand_3_0 = null ; enterRule ( ) ; try { // InternalXbase . g : 460:2 : ( ( this _ XEqualityExpression _ 0 = ruleXEqualityExpression ( ( ( ( ( ) ( ( ruleOpAnd ) ) ) ) = > ( ( ) ( ( ruleOpAnd ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXEqualityExpression ) ) ) * ) )
// InternalXbase . g : 461:2 : ( this _ XEqualityExpression _ 0 = ruleXEqualityExpression ( ( ( ( ( ) ( ( ruleOpAnd ) ) ) ) = > ( ( ) ( ( ruleOpAnd ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXEqualityExpression ) ) ) * )
{ // InternalXbase . g : 461:2 : ( this _ XEqualityExpression _ 0 = ruleXEqualityExpression ( ( ( ( ( ) ( ( ruleOpAnd ) ) ) ) = > ( ( ) ( ( ruleOpAnd ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXEqualityExpression ) ) ) * )
// InternalXbase . g : 462:3 : this _ XEqualityExpression _ 0 = ruleXEqualityExpression ( ( ( ( ( ) ( ( ruleOpAnd ) ) ) ) = > ( ( ) ( ( ruleOpAnd ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXEqualityExpression ) ) ) *
{ if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXAndExpressionAccess ( ) . getXEqualityExpressionParserRuleCall_0 ( ) ) ; } pushFollow ( FOLLOW_10 ) ; this_XEqualityExpression_0 = ruleXEqualityExpression ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current = this_XEqualityExpression_0 ; afterParserOrEnumRuleCall ( ) ; } // InternalXbase . g : 470:3 : ( ( ( ( ( ) ( ( ruleOpAnd ) ) ) ) = > ( ( ) ( ( ruleOpAnd ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXEqualityExpression ) ) ) *
loop6 : do { int alt6 = 2 ; int LA6_0 = input . LA ( 1 ) ; if ( ( LA6_0 == 23 ) ) { int LA6_2 = input . LA ( 2 ) ; if ( ( synpred3_InternalXbase ( ) ) ) { alt6 = 1 ; } } switch ( alt6 ) { case 1 : // InternalXbase . g : 471:4 : ( ( ( ( ) ( ( ruleOpAnd ) ) ) ) = > ( ( ) ( ( ruleOpAnd ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXEqualityExpression ) )
{ // InternalXbase . g : 471:4 : ( ( ( ( ) ( ( ruleOpAnd ) ) ) ) = > ( ( ) ( ( ruleOpAnd ) ) ) )
// InternalXbase . g : 472:5 : ( ( ( ) ( ( ruleOpAnd ) ) ) ) = > ( ( ) ( ( ruleOpAnd ) ) )
{ // InternalXbase . g : 482:5 : ( ( ) ( ( ruleOpAnd ) ) )
// InternalXbase . g : 483:6 : ( ) ( ( ruleOpAnd ) )
{ // InternalXbase . g : 483:6 : ( )
// InternalXbase . g : 484:7:
{ if ( state . backtracking == 0 ) { current = forceCreateModelElementAndSet ( grammarAccess . getXAndExpressionAccess ( ) . getXBinaryOperationLeftOperandAction_1_0_0_0 ( ) , current ) ; } } // InternalXbase . g : 490:6 : ( ( ruleOpAnd ) )
// InternalXbase . g : 491:7 : ( ruleOpAnd )
{ // InternalXbase . g : 491:7 : ( ruleOpAnd )
// InternalXbase . g : 492:8 : ruleOpAnd
{ if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElement ( grammarAccess . getXAndExpressionRule ( ) ) ; } } if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXAndExpressionAccess ( ) . getFeatureJvmIdentifiableElementCrossReference_1_0_0_1_0 ( ) ) ; } pushFollow ( FOLLOW_4 ) ; ruleOpAnd ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { afterParserOrEnumRuleCall ( ) ; } } } } } // InternalXbase . g : 508:4 : ( ( lv _ rightOperand _ 3_0 = ruleXEqualityExpression ) )
// InternalXbase . g : 509:5 : ( lv _ rightOperand _ 3_0 = ruleXEqualityExpression )
{ // InternalXbase . g : 509:5 : ( lv _ rightOperand _ 3_0 = ruleXEqualityExpression )
// InternalXbase . g : 510:6 : lv _ rightOperand _ 3_0 = ruleXEqualityExpression
{ if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXAndExpressionAccess ( ) . getRightOperandXEqualityExpressionParserRuleCall_1_1_0 ( ) ) ; } pushFollow ( FOLLOW_10 ) ; lv_rightOperand_3_0 = ruleXEqualityExpression ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getXAndExpressionRule ( ) ) ; } set ( current , "rightOperand" , lv_rightOperand_3_0 , "org.eclipse.xtext.xbase.Xbase.XEqualityExpression" ) ; afterParserOrEnumRuleCall ( ) ; } } } } break ; default : break loop6 ; } } while ( true ) ; } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ; |
public class QueryUtil { /** * Returns a query string .
* @ param parameters the map of query string keys and values
* @ return the query string */
protected static String generateQueryString ( Map < String , Object > parameters ) { } } | if ( parameters == null || parameters . size ( ) == 0 ) { return "" ; } StringBuilder result = new StringBuilder ( ) ; try { for ( Map . Entry < String , Object > entry : parameters . entrySet ( ) ) { // Check to see if the key / value isn ' t null or empty string
if ( entry . getKey ( ) != null && ( entry . getValue ( ) != null && ! entry . getValue ( ) . toString ( ) . equals ( "" ) ) ) { result . append ( '&' ) . append ( URLEncoder . encode ( entry . getKey ( ) , "utf-8" ) ) . append ( "=" ) . append ( URLEncoder . encode ( entry . getValue ( ) . toString ( ) , "utf-8" ) ) ; } } } catch ( UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } return result . length ( ) == 0 ? "" : "?" + result . substring ( 1 ) ; |
public class SeaGlassLookAndFeel { /** * Initialize the internal frame close button settings .
* @ param d the UI defaults map . */
private void defineInternalFrameCloseButtons ( UIDefaults d ) { } } | String p = "InternalFrame:InternalFrameTitlePane:\"InternalFrameTitlePane.closeButton\"" ; String c = PAINTER_PREFIX + "TitlePaneCloseButtonPainter" ; // Set the multiplicity of states for the Close button .
d . put ( p + ".States" , "Enabled,MouseOver,Pressed,Disabled,Focused,Selected,WindowNotFocused" ) ; d . put ( p + ".WindowNotFocused" , new TitlePaneCloseButtonWindowNotFocusedState ( ) ) ; d . put ( p + ".contentMargins" , new InsetsUIResource ( 0 , 0 , 0 , 0 ) ) ; d . put ( p + "[Disabled].backgroundPainter" , new LazyPainter ( c , TitlePaneCloseButtonPainter . Which . BACKGROUND_DISABLED ) ) ; d . put ( p + "[Enabled].backgroundPainter" , new LazyPainter ( c , TitlePaneCloseButtonPainter . Which . BACKGROUND_ENABLED ) ) ; d . put ( p + "[MouseOver].backgroundPainter" , new LazyPainter ( c , TitlePaneCloseButtonPainter . Which . BACKGROUND_MOUSEOVER ) ) ; d . put ( p + "[Pressed].backgroundPainter" , new LazyPainter ( c , TitlePaneCloseButtonPainter . Which . BACKGROUND_PRESSED ) ) ; d . put ( p + "[Enabled+WindowNotFocused].backgroundPainter" , new LazyPainter ( c , TitlePaneCloseButtonPainter . Which . BACKGROUND_ENABLED_WINDOWNOTFOCUSED ) ) ; d . put ( p + "[MouseOver+WindowNotFocused].backgroundPainter" , new LazyPainter ( c , TitlePaneCloseButtonPainter . Which . BACKGROUND_MOUSEOVER ) ) ; d . put ( p + "[Pressed+WindowNotFocused].backgroundPainter" , new LazyPainter ( c , TitlePaneCloseButtonPainter . Which . BACKGROUND_PRESSED_WINDOWNOTFOCUSED ) ) ; d . put ( p + ".icon" , new SeaGlassIcon ( p , "iconPainter" , 43 , 18 ) ) ; |
public class ApiOvhCloud { /** * Get this object properties
* REST : GET / cloud / { serviceName } / pca / { pcaServiceName } / sessions / { sessionId }
* @ param serviceName [ required ] The internal name of your public cloud passport
* @ param pcaServiceName [ required ] The internal name of your PCA offer
* @ param sessionId [ required ] Session ID
* @ deprecated */
public net . minidev . ovh . api . pca . OvhSession serviceName_pca_pcaServiceName_sessions_sessionId_GET ( String serviceName , String pcaServiceName , String sessionId ) throws IOException { } } | String qPath = "/cloud/{serviceName}/pca/{pcaServiceName}/sessions/{sessionId}" ; StringBuilder sb = path ( qPath , serviceName , pcaServiceName , sessionId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , net . minidev . ovh . api . pca . OvhSession . class ) ; |
public class XQuery { /** * Selects values based on the XPath expression that is applied to the tree
* represented by this { @ link XQuery } .
* @ param xpath
* XPath expression
* @ return Stream of strings containing the node values */
public @ Nonnull Stream < String > value ( String xpath ) { } } | return select ( xpath ) . map ( XQuery :: text ) ; |
public class IOUtil { /** * Copy the specified number of bytes from an input stream to an output
* stream . It is up to the caller to close the streams .
* @ param in
* input stream
* @ param out
* output stream
* @ param count
* number of bytes to copy
* @ throws IOException
* on any error */
public static void copy ( InputStream in , OutputStream out , long count ) throws IOException { } } | copy ( in , out , count , BUFFER_SIZE ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.