signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ToneDetection { /** * updateUserTone processes the Tone Analyzer payload to pull out the emotion , language and social tones , and identify * the meaningful tones ( i . e . , those tones that meet the specified thresholds ) . The assistantPayload json object is * updated to include these tones . * @ param context the context * @ param toneAnalyzerPayload json object returned by the Watson Tone Analyzer Service * @ param maintainHistory the maintain history * @ return the map * @ returns assistantPayload where the user object has been updated with tone information from the * toneAnalyzerPayload */ public static Map < String , Object > updateUserTone ( Map < String , Object > context , ToneAnalysis toneAnalyzerPayload , boolean maintainHistory ) { } }
List < ToneScore > emotionTone = new ArrayList < ToneScore > ( ) ; List < ToneScore > languageTone = new ArrayList < ToneScore > ( ) ; List < ToneScore > socialTone = new ArrayList < ToneScore > ( ) ; // If the context doesn ' t already contain the user object , initialize it if ( ! context . containsKey ( "user" ) ) { context . put ( "user" , initUser ( ) ) ; } // For convenience sake , define a variable for the user object to @ SuppressWarnings ( "unchecked" ) Map < String , Object > user = ( Map < String , Object > ) context . get ( "user" ) ; if ( toneAnalyzerPayload != null && toneAnalyzerPayload . getDocumentTone ( ) != null ) { List < ToneCategory > tones = toneAnalyzerPayload . getDocumentTone ( ) . getToneCategories ( ) ; for ( ToneCategory tone : tones ) { if ( tone . getCategoryId ( ) . equals ( EMOTION_TONE_LABEL ) ) { emotionTone = tone . getTones ( ) ; } if ( tone . getCategoryId ( ) . equals ( LANGUAGE_TONE_LABEL ) ) { languageTone = tone . getTones ( ) ; } if ( tone . getCategoryId ( ) . equals ( SOCIAL_TONE_LABEL ) ) { socialTone = tone . getTones ( ) ; } } updateEmotionTone ( user , emotionTone , maintainHistory ) ; updateLanguageTone ( user , languageTone , maintainHistory ) ; updateSocialTone ( user , socialTone , maintainHistory ) ; } context . put ( "user" , user ) ; return user ;
public class ReconciliationReportServiceLocator { /** * For the given interface , get the stub implementation . * If this service has no port for the given interface , * then ServiceException is thrown . */ public java . rmi . Remote getPort ( Class serviceEndpointInterface ) throws javax . xml . rpc . ServiceException { } }
try { if ( com . google . api . ads . admanager . axis . v201811 . ReconciliationReportServiceInterface . class . isAssignableFrom ( serviceEndpointInterface ) ) { com . google . api . ads . admanager . axis . v201811 . ReconciliationReportServiceSoapBindingStub _stub = new com . google . api . ads . admanager . axis . v201811 . ReconciliationReportServiceSoapBindingStub ( new java . net . URL ( ReconciliationReportServiceInterfacePort_address ) , this ) ; _stub . setPortName ( getReconciliationReportServiceInterfacePortWSDDServiceName ( ) ) ; return _stub ; } } catch ( java . lang . Throwable t ) { throw new javax . xml . rpc . ServiceException ( t ) ; } throw new javax . xml . rpc . ServiceException ( "There is no stub implementation for the interface: " + ( serviceEndpointInterface == null ? "null" : serviceEndpointInterface . getName ( ) ) ) ;
public class AbstractProxyFactory { /** * Get the real Object for already materialized Handler * @ param objectOrProxy * @ return Object or null if the Handel is not materialized */ public Object getRealObjectIfMaterialized ( Object objectOrProxy ) { } }
if ( isNormalOjbProxy ( objectOrProxy ) ) { String msg ; try { IndirectionHandler handler = getIndirectionHandler ( objectOrProxy ) ; return handler . alreadyMaterialized ( ) ? handler . getRealSubject ( ) : null ; } catch ( ClassCastException e ) { // shouldn ' t happen but still . . . msg = "The InvocationHandler for the provided Proxy was not an instance of " + IndirectionHandler . class . getName ( ) ; log . error ( msg ) ; throw new PersistenceBrokerException ( msg , e ) ; } catch ( IllegalArgumentException e ) { msg = "Could not retrieve real object for given Proxy: " + objectOrProxy ; log . error ( msg ) ; throw new PersistenceBrokerException ( msg , e ) ; } catch ( PersistenceBrokerException e ) { log . error ( "Could not retrieve real object for given Proxy: " + objectOrProxy ) ; throw e ; } } else if ( isVirtualOjbProxy ( objectOrProxy ) ) { try { VirtualProxy proxy = ( VirtualProxy ) objectOrProxy ; return proxy . alreadyMaterialized ( ) ? proxy . getRealSubject ( ) : null ; } catch ( PersistenceBrokerException e ) { log . error ( "Could not retrieve real object for VirtualProxy: " + objectOrProxy ) ; throw e ; } } else { return objectOrProxy ; }
public class RecoveryDirectorImpl { /** * Internal method to record a termination request for the supplied RecoveryAgent * and FailureScope combination . * Just prior to requesting a RecoveryAgent to " terminateRecovery " of a * FailureScope , this method is driven to record the request . When the client * service is ready and invokes RecoveryDirector . terminateComplete , * the removeTerminationRecord method is called to remove this record . * @ param recoveryAgent The RecoveryAgent that is about to be directed to terminate * recovery of a FailureScope . * @ param failureScope The FailureScope . */ private void addTerminationRecord ( RecoveryAgent recoveryAgent , FailureScope failureScope ) { } }
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "addTerminationRecord" , new Object [ ] { recoveryAgent , failureScope , this } ) ; synchronized ( _outstandingTerminationRecords ) { // Extract the set of failure scopes that the corrisponding client service is currently // processing HashSet < FailureScope > failureScopeSet = _outstandingTerminationRecords . get ( recoveryAgent ) ; // If its not handled yet any then create an empty set to hold both this and future // failure scopes . if ( failureScopeSet == null ) { failureScopeSet = new HashSet < FailureScope > ( ) ; _outstandingTerminationRecords . put ( recoveryAgent , failureScopeSet ) ; } // Add this new failure scope to the set of those currently being processed by the // client service . failureScopeSet . add ( failureScope ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "addTerminationRecord" ) ;
public class ModelsImpl { /** * Get the explicit list of the pattern . any entity . * @ param appId The application ID . * @ param versionId The version ID . * @ param entityId The Pattern . Any entity Id . * @ param itemId The explicit list item Id . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the ExplicitListItem object */ public Observable < ServiceResponse < ExplicitListItem > > getExplicitListItemWithServiceResponseAsync ( UUID appId , String versionId , UUID entityId , long itemId ) { } }
if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( appId == null ) { throw new IllegalArgumentException ( "Parameter appId is required and cannot be null." ) ; } if ( versionId == null ) { throw new IllegalArgumentException ( "Parameter versionId is required and cannot be null." ) ; } if ( entityId == null ) { throw new IllegalArgumentException ( "Parameter entityId is required and cannot be null." ) ; } String parameterizedHost = Joiner . on ( ", " ) . join ( "{Endpoint}" , this . client . endpoint ( ) ) ; return service . getExplicitListItem ( appId , versionId , entityId , itemId , this . client . acceptLanguage ( ) , parameterizedHost , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < ExplicitListItem > > > ( ) { @ Override public Observable < ServiceResponse < ExplicitListItem > > call ( Response < ResponseBody > response ) { try { ServiceResponse < ExplicitListItem > clientResponse = getExplicitListItemDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class CmsXmlContentDefinition { /** * Translates the XSD schema location . < p > * @ param schemaLocation the location to translate * @ return the translated schema location */ private static String translateSchema ( String schemaLocation ) { } }
if ( OpenCms . getRepositoryManager ( ) != null ) { return OpenCms . getResourceManager ( ) . getXsdTranslator ( ) . translateResource ( schemaLocation ) ; } return schemaLocation ;
public class JBossModuleUtils { /** * Populates a module spec builder with core dependencies on JRE , Nicobar , itself , and compiler plugins . * @ param moduleSpecBuilder builder to populate * @ param scriptArchive { @ link ScriptArchive } to copy from */ public static void populateModuleSpecWithCoreDependencies ( ModuleSpec . Builder moduleSpecBuilder , ScriptArchive scriptArchive ) throws ModuleLoadException { } }
Objects . requireNonNull ( moduleSpecBuilder , "moduleSpecBuilder" ) ; Objects . requireNonNull ( scriptArchive , "scriptArchive" ) ; Set < String > compilerPlugins = scriptArchive . getModuleSpec ( ) . getCompilerPluginIds ( ) ; for ( String compilerPluginId : compilerPlugins ) { moduleSpecBuilder . addDependency ( DependencySpec . createModuleDependencySpec ( getPluginModuleId ( compilerPluginId ) , false ) ) ; } moduleSpecBuilder . addDependency ( JRE_DEPENDENCY_SPEC ) ; // TODO : Why does a module need a dependency on Nicobar itself ? moduleSpecBuilder . addDependency ( NICOBAR_CORE_DEPENDENCY_SPEC ) ; moduleSpecBuilder . addDependency ( DependencySpec . createLocalDependencySpec ( ) ) ;
public class SingleLaneProcessor { /** * Performs the < code > SingleLaneProcessor < / code > required initialization . Subclasses overriding this method must * call < code > super . init ( ) < / code > . * @ return the list of configuration issues found during initialization , an empty list if none . */ @ Override protected List < ConfigIssue > init ( ) { } }
List < ConfigIssue > issues = super . init ( ) ; if ( getContext ( ) . getOutputLanes ( ) . size ( ) != 1 ) { issues . add ( getContext ( ) . createConfigIssue ( null , null , Errors . API_00 , getInfo ( ) . getInstanceName ( ) , 1 , getContext ( ) . getOutputLanes ( ) . size ( ) ) ) ; } else { outputLane = getContext ( ) . getOutputLanes ( ) . iterator ( ) . next ( ) ; } setSuperInitCalled ( ) ; return issues ;
public class MapModel { /** * Zoom to the bounds of the specified features . * @ param features list of features , will be lazy - loaded if necessary * @ since 1.11.0 */ @ Api public void zoomToFeatures ( List < Feature > features ) { } }
// calculate the point scale as the minimum point scale for all layers ( only relevant for zooming to multiple // points at the exact same location ) double zoomToPointScale = getMapInfo ( ) . getScaleConfiguration ( ) . getMaximumScale ( ) . getPixelPerUnit ( ) ; for ( Feature feature : features ) { double scale = feature . getLayer ( ) . getLayerInfo ( ) . getZoomToPointScale ( ) . getPixelPerUnit ( ) ; zoomToPointScale = Math . min ( zoomToPointScale , scale ) ; } ZoomToFeaturesLazyLoadCallback callback = new ZoomToFeaturesLazyLoadCallback ( features . size ( ) , zoomToPointScale ) ; for ( Feature feature : features ) { // no need to fetch if we already have the geometry ! if ( feature . isGeometryLoaded ( ) ) { callback . execute ( Arrays . asList ( feature ) ) ; } else { feature . getLayer ( ) . getFeatureStore ( ) . getFeature ( feature . getId ( ) , GeomajasConstant . FEATURE_INCLUDE_GEOMETRY , callback ) ; } }
public class Dialog { /** * Sets both details label ' s font family and size . * @ param font _ family Font family in < code > Strings < / code > * @ param font _ size Font size in < code > integer < / code > ( pixels ) */ public void setDetailsFont ( String font_family , int font_size ) { } }
this . detailsLabel . setStyle ( "-fx-font-family: \"" + font_family + "\";" + "-fx-font-size:" + Integer . toString ( font_size ) + "px;" ) ;
public class Session { /** * Adds a callback that will be called when the state of this Session changes . * @ param callback the callback */ public final void addCallback ( StatusCallback callback ) { } }
synchronized ( callbacks ) { if ( callback != null && ! callbacks . contains ( callback ) ) { callbacks . add ( callback ) ; } }
public class OAuth2SessionRef { /** * Initialise this session reference by exchanging an API token for an access _ token and refresh _ token * @ param token */ public synchronized void initialiseFromAPIToken ( final String token ) { } }
final String responseStr = authService . getToken ( UserManagerOAuthService . GRANT_TYPE_TOKEN_EXCHANGE , null , getOwnCallbackUri ( ) . toString ( ) , clientId , clientSecret , null , null , null , token ) ; loadAuthResponse ( responseStr ) ;
public class CitrusEndpoints { /** * Creates new DockerClient builder . * @ return */ @ SuppressWarnings ( "unchecked" ) public static ClientServerEndpointBuilder < DockerClientBuilder , DockerClientBuilder > docker ( ) { } }
return new ClientServerEndpointBuilder ( new DockerClientBuilder ( ) , new DockerClientBuilder ( ) ) { @ Override public EndpointBuilder < ? extends Endpoint > server ( ) { throw new UnsupportedOperationException ( "Citrus Docker stack has no support for server implementation" ) ; } } ;
public class HylaFaxJob { /** * This function sets the fax job sender name . * @ param senderName * The fax job sender name */ public void setSenderName ( String senderName ) { } }
try { this . JOB . setFromUser ( senderName ) ; } catch ( Exception exception ) { throw new FaxException ( "Error while setting job sender name." , exception ) ; }
public class AwsReader { /** * Retrieve the next page from the Twilio API . * @ param page current page * @ param client TwilioRestClient with which to make the request * @ return Next Page */ @ Override public Page < Aws > nextPage ( final Page < Aws > page , final TwilioRestClient client ) { } }
Request request = new Request ( HttpMethod . GET , page . getNextPageUrl ( Domains . ACCOUNTS . toString ( ) , client . getRegion ( ) ) ) ; return pageForRequest ( client , request ) ;
public class Utils { /** * Extract the mapping between the type parameters declared within the super types and the * type parameters arguments that are declared within the given type . * < p > For example , consider the following code : * < pre > < code > * interface X & lt ; T & gt ; { * def a ( p1 : T , p2 : U ) with U * interface Y & lt ; T & gt ; { * class Z & lt ; TT & gt ; implements X & lt ; TT & gt ; , Y & lt ; TT & gt ; { * def a ( p1 : TT , p2 : W ) with W { } * < / code > < / pre > * The mapping is : * < pre > < code > * X . T = & gt ; TT * Y . T = & gt ; TT * < / code > < / pre > * @ param type the type to analyze . * @ param mapping the map to fill with the mapping . * @ since 0.7 */ public static void getSuperTypeParameterMap ( JvmDeclaredType type , Map < String , JvmTypeReference > mapping ) { } }
for ( final JvmTypeReference superTypeReference : type . getSuperTypes ( ) ) { if ( superTypeReference instanceof JvmParameterizedTypeReference ) { final JvmParameterizedTypeReference parameterizedTypeReference = ( JvmParameterizedTypeReference ) superTypeReference ; final JvmType st = superTypeReference . getType ( ) ; if ( st instanceof JvmTypeParameterDeclarator ) { final JvmTypeParameterDeclarator superType = ( JvmTypeParameterDeclarator ) st ; int i = 0 ; for ( final JvmTypeParameter typeParameter : superType . getTypeParameters ( ) ) { mapping . put ( typeParameter . getIdentifier ( ) , parameterizedTypeReference . getArguments ( ) . get ( i ) ) ; ++ i ; } } } }
public class DefaultEventChemObjectReader { /** * Sends a frame read event to the registered ReaderListeners . */ protected void fireFrameRead ( ) { } }
for ( IChemObjectIOListener chemListener : getListeners ( ) ) { IReaderListener listener = ( IReaderListener ) chemListener ; // Lazily create the event : if ( frameReadEvent == null ) { frameReadEvent = new ReaderEvent ( this ) ; } listener . frameRead ( frameReadEvent ) ; }
public class QueryGenerator { /** * @ param column * @ param entity * @ return 上午9:51:49 */ private Object getColumnValue ( String column , ENTITY entity ) { } }
Method getter = orMapping . getGetter ( column ) ; try { return getter . invoke ( entity ) ; } catch ( Exception e ) { throw new RuntimeException ( ) ; }
public class KuteIO { /** * Copy all resource in provider over to some creator . * @ param provider The resource provider , or source location . * @ param creator The resource creator , or destination location . */ public void copyProviderToCreator ( Resource . Provider provider , Resource . Creator creator ) { } }
provider . stream ( ) . forEach ( ( ConsumerWithThrowable < Resource . Readable , IOException > ) resource -> copyResourceWithStreams ( resource , creator . create ( resource . getPath ( ) ) ) ) ;
public class BaseDestinationHandler { /** * Stop anything that needs stopping , like mediations . . etc . */ @ Override public void stop ( int mode ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "stop" , Integer . valueOf ( mode ) ) ; // Deregister the destination deregisterDestination ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "stop" ) ;
public class JobOperations { /** * Updates the specified job . * This method only replaces the properties specified with non - null values . * @ param jobId The ID of the job . * @ param poolInfo The pool on which the Batch service runs the job ' s tasks . You may change the pool for a job only when the job is disabled . If you specify an autoPoolSpecification specification in the poolInfo , only the keepAlive property can be updated , and then only if the auto pool has a poolLifetimeOption of job . If null , the job continues to run on its current pool . * @ param priority The priority of the job . Priority values can range from - 1000 to 1000 , with - 1000 being the lowest priority and 1000 being the highest priority . If null , the priority of the job is left unchanged . * @ param constraints The execution constraints for the job . If null , the existing execution constraints are left unchanged . * @ param onAllTasksComplete Specifies an action the Batch service should take when all tasks in the job are in the completed state . * @ param metadata A list of name - value pairs associated with the job as metadata . If null , the existing job metadata is left unchanged . * @ throws BatchErrorException Exception thrown when an error response is received from the Batch service . * @ throws IOException Exception thrown when there is an error in serialization / deserialization of data sent to / received from the Batch service . */ public void patchJob ( String jobId , PoolInformation poolInfo , Integer priority , JobConstraints constraints , OnAllTasksComplete onAllTasksComplete , List < MetadataItem > metadata ) throws BatchErrorException , IOException { } }
patchJob ( jobId , poolInfo , priority , constraints , onAllTasksComplete , metadata , null ) ;
public class DetachedPluginsUtil { /** * Get the list of all plugins that have ever been { @ link DetachedPlugin detached } from Jenkins core , applicable to the current Java runtime . * @ return A { @ link List } of { @ link DetachedPlugin } s . * @ see JavaUtils # getCurrentJavaRuntimeVersionNumber ( ) */ public static @ Nonnull List < DetachedPlugin > getDetachedPlugins ( ) { } }
return DETACHED_LIST . stream ( ) . filter ( plugin -> JavaUtils . getCurrentJavaRuntimeVersionNumber ( ) . isNewerThanOrEqualTo ( plugin . getMinimumJavaVersion ( ) ) ) . collect ( Collectors . toList ( ) ) ;
public class WorldMapProcessor { /** * Main method . Processes the whole dump using this processor and writes the * results to a file . To change which dump file to use and whether to run in * offline mode , modify the settings in { @ link ExampleHelpers } . * @ param args * @ throws IOException */ public static void main ( String [ ] args ) throws IOException { } }
ExampleHelpers . configureLogging ( ) ; WorldMapProcessor . printDocumentation ( ) ; int imageWidth = 8 * 360 ; double brightness = 1.0 ; WorldMapProcessor worldMapProcessor = new WorldMapProcessor ( imageWidth , brightness ) ; // worldMapProcessor . setGlobe ( GlobeCoordinatesValue . GLOBE _ MOON ) ; // using the Moon or anything else but Earth might need some brightness // adjustment above , and possibly more frequent reporting below worldMapProcessor . addSite ( null ) ; // all data , no filter // Some other sites , ranked by the number of geolocated items they had // as of June 2015: worldMapProcessor . addSite ( "enwiki" ) ; worldMapProcessor . addSite ( "dewiki" ) ; worldMapProcessor . addSite ( "frwiki" ) ; worldMapProcessor . addSite ( "plwiki" ) ; worldMapProcessor . addSite ( "nlwiki" ) ; worldMapProcessor . addSite ( "ruwiki" ) ; worldMapProcessor . addSite ( "eswiki" ) ; worldMapProcessor . addSite ( "itwiki" ) ; worldMapProcessor . addSite ( "zhwiki" ) ; worldMapProcessor . addSite ( "ptwiki" ) ; // worldMapProcessor . addSite ( " ukwiki " ) ; // worldMapProcessor . addSite ( " svwiki " ) ; // worldMapProcessor . addSite ( " viwiki " ) ; // worldMapProcessor . addSite ( " srwiki " ) ; // worldMapProcessor . addSite ( " cawiki " ) ; // worldMapProcessor . addSite ( " shwiki " ) ; // worldMapProcessor . addSite ( " mswiki " ) ; // worldMapProcessor . addSite ( " rowiki " ) ; // worldMapProcessor . addSite ( " fawiki " ) ; // worldMapProcessor . addSite ( " jawiki " ) ; // worldMapProcessor . addSite ( " vowiki " ) ; // worldMapProcessor . addSite ( " warwiki " ) ; // worldMapProcessor . addSite ( " commonswiki " ) ; // worldMapProcessor . addSite ( " arwiki " ) ; ExampleHelpers . processEntitiesFromWikidataDump ( worldMapProcessor ) ; worldMapProcessor . writeFinalData ( ) ;
public class BiFunctionBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */ @ Nonnull public static < T1 , T2 , R > BiFunctionBuilder < T1 , T2 , R > biFunction ( Consumer < BiFunction < T1 , T2 , R > > consumer ) { } }
return new BiFunctionBuilder ( consumer ) ;
public class CodedOutputStream { /** * Internal helper that writes the current buffer to the output . The * buffer position is reset to its initial value when this returns . */ private void refreshBuffer ( ) throws IOException { } }
if ( output == null ) { // We ' re writing to a single buffer . throw new OutOfSpaceException ( ) ; } // Since we have an output stream , this is our buffer // and buffer offset = = 0 output . write ( buffer , 0 , position ) ; position = 0 ;
public class ProtoBufFieldProcessor { /** * TODO : write java doc for all methods */ public static Descriptors . FieldDescriptor getFieldDescriptor ( final MessageOrBuilder builder , final int fieldNumber ) { } }
return builder . getDescriptorForType ( ) . findFieldByNumber ( fieldNumber ) ;
public class DashboardResources { /** * Returns all dashboards ' metadata filtered by owner . * @ param req The HTTP request . * @ param dashboardName The dashboard name filter . * @ param ownerName The owner name filter . * @ param shared Filter shared dashboard * @ param limit The maximum number of rows to return . * @ param version The version of the dashboard to return . It is either null or not empty * @ return The list of filtered dashboards ' metadata . */ @ GET @ Produces ( MediaType . APPLICATION_JSON ) @ Path ( "/meta" ) @ Description ( "Returns all dashboards' metadata." ) public List < DashboardDto > getDashboardsMeta ( @ Context HttpServletRequest req , @ QueryParam ( "dashboardName" ) String dashboardName , @ QueryParam ( "owner" ) String ownerName , @ QueryParam ( "shared" ) @ DefaultValue ( "true" ) boolean shared , @ QueryParam ( "limit" ) Integer limit , @ QueryParam ( "version" ) String version ) { } }
PrincipalUser owner = validateAndGetOwner ( req , ownerName ) ; List < Dashboard > result = getDashboardsObj ( dashboardName , owner , shared , true , limit , version ) ; return DashboardDto . transformToDto ( result ) ;
public class EventFilterParser { /** * EventFilter . g : 193:1 : time _ string _ function : TIME _ STRING _ FUN _ NAME ' ( ' STRING ' , ' STRING ' , ' STRING ' ) ' - > ^ ( TIME _ STRING _ FUN _ NAME STRING STRING STRING ) ; */ public final EventFilterParser . time_string_function_return time_string_function ( ) throws RecognitionException { } }
EventFilterParser . time_string_function_return retval = new EventFilterParser . time_string_function_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; Token TIME_STRING_FUN_NAME101 = null ; Token char_literal102 = null ; Token STRING103 = null ; Token char_literal104 = null ; Token STRING105 = null ; Token char_literal106 = null ; Token STRING107 = null ; Token char_literal108 = null ; CommonTree TIME_STRING_FUN_NAME101_tree = null ; CommonTree char_literal102_tree = null ; CommonTree STRING103_tree = null ; CommonTree char_literal104_tree = null ; CommonTree STRING105_tree = null ; CommonTree char_literal106_tree = null ; CommonTree STRING107_tree = null ; CommonTree char_literal108_tree = null ; RewriteRuleTokenStream stream_35 = new RewriteRuleTokenStream ( adaptor , "token 35" ) ; RewriteRuleTokenStream stream_TIME_STRING_FUN_NAME = new RewriteRuleTokenStream ( adaptor , "token TIME_STRING_FUN_NAME" ) ; RewriteRuleTokenStream stream_33 = new RewriteRuleTokenStream ( adaptor , "token 33" ) ; RewriteRuleTokenStream stream_34 = new RewriteRuleTokenStream ( adaptor , "token 34" ) ; RewriteRuleTokenStream stream_STRING = new RewriteRuleTokenStream ( adaptor , "token STRING" ) ; try { // EventFilter . g : 194:2 : ( TIME _ STRING _ FUN _ NAME ' ( ' STRING ' , ' STRING ' , ' STRING ' ) ' - > ^ ( TIME _ STRING _ FUN _ NAME STRING STRING STRING ) ) // EventFilter . g : 194:5 : TIME _ STRING _ FUN _ NAME ' ( ' STRING ' , ' STRING ' , ' STRING ' ) ' { TIME_STRING_FUN_NAME101 = ( Token ) match ( input , TIME_STRING_FUN_NAME , FOLLOW_TIME_STRING_FUN_NAME_in_time_string_function1179 ) ; stream_TIME_STRING_FUN_NAME . add ( TIME_STRING_FUN_NAME101 ) ; char_literal102 = ( Token ) match ( input , 33 , FOLLOW_33_in_time_string_function1181 ) ; stream_33 . add ( char_literal102 ) ; STRING103 = ( Token ) match ( input , STRING , FOLLOW_STRING_in_time_string_function1183 ) ; stream_STRING . add ( STRING103 ) ; char_literal104 = ( Token ) match ( input , 35 , FOLLOW_35_in_time_string_function1185 ) ; stream_35 . add ( char_literal104 ) ; STRING105 = ( Token ) match ( input , STRING , FOLLOW_STRING_in_time_string_function1187 ) ; stream_STRING . add ( STRING105 ) ; char_literal106 = ( Token ) match ( input , 35 , FOLLOW_35_in_time_string_function1189 ) ; stream_35 . add ( char_literal106 ) ; STRING107 = ( Token ) match ( input , STRING , FOLLOW_STRING_in_time_string_function1191 ) ; stream_STRING . add ( STRING107 ) ; char_literal108 = ( Token ) match ( input , 34 , FOLLOW_34_in_time_string_function1193 ) ; stream_34 . add ( char_literal108 ) ; // AST REWRITE // elements : STRING , TIME _ STRING _ FUN _ NAME , STRING , STRING // token labels : // rule labels : retval // token list labels : // rule list labels : // wildcard labels : retval . tree = root_0 ; RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream ( adaptor , "rule retval" , retval != null ? retval . tree : null ) ; root_0 = ( CommonTree ) adaptor . nil ( ) ; // 194:63 : - > ^ ( TIME _ STRING _ FUN _ NAME STRING STRING STRING ) { // EventFilter . g : 194:66 : ^ ( TIME _ STRING _ FUN _ NAME STRING STRING STRING ) { CommonTree root_1 = ( CommonTree ) adaptor . nil ( ) ; root_1 = ( CommonTree ) adaptor . becomeRoot ( new TimeStringValueTreeNode ( stream_TIME_STRING_FUN_NAME . nextToken ( ) ) , root_1 ) ; adaptor . addChild ( root_1 , new StringTreeNode ( stream_STRING . nextToken ( ) ) ) ; adaptor . addChild ( root_1 , new StringTreeNode ( stream_STRING . nextToken ( ) ) ) ; adaptor . addChild ( root_1 , new StringTreeNode ( stream_STRING . nextToken ( ) ) ) ; adaptor . addChild ( root_0 , root_1 ) ; } } retval . tree = root_0 ; } retval . stop = input . LT ( - 1 ) ; retval . tree = ( CommonTree ) adaptor . rulePostProcessing ( root_0 ) ; adaptor . setTokenBoundaries ( retval . tree , retval . start , retval . stop ) ; } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; retval . tree = ( CommonTree ) adaptor . errorNode ( input , retval . start , input . LT ( - 1 ) , re ) ; } finally { // do for sure before leaving } return retval ;
public class ReadOnlyDoublePropertyAssert { /** * Verifies that the actual observable number has a value that is close to the given one by less then the given offset . * @ param expectedValue the given value to compare the actual observables value to . * @ param offset the given positive offset . * @ return { @ code this } assertion object . * @ throws java . lang . NullPointerException if the given offset is < code > null < / code > . * @ throws java . lang . AssertionError if the actual observables value is not equal to the expected one . */ public ReadOnlyDoublePropertyAssert hasValue ( Double expectedValue , Offset offset ) { } }
new ObservableNumberValueAssertions ( actual ) . hasValue ( expectedValue , offset ) ; return this ;
public class JsonPathQuery { /** * This operation takes a reference to JSON ( in the form of a string ) and runs a specified JSON Path query on it . * It returns the results as a JSON Object . * @ param jsonObject The JSON in the form of a string . * @ param jsonPath The JSON Path query to run . * @ return A map which contains the resulted JSON from the given path . */ @ Action ( name = "JSON Path Query" , outputs = { } }
@ Output ( OutputNames . RETURN_RESULT ) , @ Output ( OutputNames . RETURN_CODE ) , @ Output ( OutputNames . EXCEPTION ) } , responses = { @ Response ( text = ResponseNames . SUCCESS , field = OutputNames . RETURN_CODE , value = ReturnCodes . SUCCESS , matchType = MatchType . COMPARE_EQUAL , responseType = ResponseType . RESOLVED ) , @ Response ( text = ResponseNames . FAILURE , field = OutputNames . RETURN_CODE , value = ReturnCodes . FAILURE , matchType = MatchType . COMPARE_EQUAL , responseType = ResponseType . ERROR , isOnFail = true ) } ) public Map < String , String > execute ( @ Param ( value = Constants . InputNames . JSON_OBJECT , required = true ) String jsonObject , @ Param ( value = Constants . InputNames . JSON_PATH , required = true ) String jsonPath ) { try { final JsonNode jsonNode = JsonService . evaluateJsonPathQuery ( jsonObject , jsonPath ) ; if ( ! jsonNode . isNull ( ) ) { return OutputUtilities . getSuccessResultsMap ( jsonNode . toString ( ) ) ; } return OutputUtilities . getSuccessResultsMap ( NULL_STRING ) ; } catch ( Exception exception ) { return OutputUtilities . getFailureResultsMap ( exception ) ; }
public class ContentSpecFilterQueryBuilder { /** * Create a Subquery to check if a Content Spec has a metadata field with the specified value . * @ param metaDataTitle The Title of the metadata to be checked . * @ return A subquery that can be used in an exists statement to see if a Content Spec has a metadata field with the specified value . */ private Subquery < CSNode > getMetaDataDoesntExistSubquery ( final String metaDataTitle ) { } }
final CriteriaBuilder criteriaBuilder = getCriteriaBuilder ( ) ; final Subquery < CSNode > subQuery = getCriteriaQuery ( ) . subquery ( CSNode . class ) ; final Root < CSNode > root = subQuery . from ( CSNode . class ) ; subQuery . select ( root ) ; // Create the Condition for the subquery final Predicate contentSpecIdMatch = criteriaBuilder . equal ( getRootPath ( ) , root . get ( "contentSpec" ) ) ; final Predicate isMetaData = criteriaBuilder . equal ( root . get ( "CSNodeType" ) . as ( Integer . class ) , CommonConstants . CS_NODE_META_DATA ) ; final Predicate metaDataTitleMatch = criteriaBuilder . equal ( ( root . get ( "CSNodeTitle" ) . as ( String . class ) ) , metaDataTitle ) ; subQuery . where ( criteriaBuilder . and ( contentSpecIdMatch , isMetaData , metaDataTitleMatch ) ) ; return subQuery ;
public class Assert { /** * Returns true if this condition is satisfied by the given test case properties . */ public boolean satisfied ( PropertySet properties ) { } }
String property = getProperty ( ) ; return property == null || properties . contains ( property ) ;
public class ThymeleafCall { /** * Render the template as the entity for a ResponseBuilder , returning the built Response * @ return the result of calling responseBuilder . */ public Response process ( ResponseBuilder responseBuilder ) { } }
Timer . Context timer = calls . time ( ) ; try { final String entity = process ( ) ; responseBuilder . entity ( entity ) ; return responseBuilder . build ( ) ; } catch ( Throwable e ) { failures . mark ( ) ; throw e ; } finally { timer . stop ( ) ; }
public class AbstractMessage { /** * / * ( non - Javadoc ) * @ see javax . jms . Message # acknowledge ( ) */ @ Override public final void acknowledge ( ) throws JMSException { } }
AbstractSession session = getSession ( ) ; int acknowledgeMode = session . getAcknowledgeMode ( ) ; if ( acknowledgeMode != Session . CLIENT_ACKNOWLEDGE ) return ; // Ignore [ JMS SPEC ] session . acknowledge ( ) ;
public class URIBuilder { /** * Sets parameter of URI query overriding existing value if set . The parameter name and value * are expected to be unescaped and may contain non ASCII characters . */ public URIBuilder setParameter ( final String param , final String value ) { } }
if ( this . queryParams == null ) { this . queryParams = new ArrayList < NameValuePair > ( ) ; } if ( ! this . queryParams . isEmpty ( ) ) { for ( Iterator < NameValuePair > it = this . queryParams . iterator ( ) ; it . hasNext ( ) ; ) { NameValuePair nvp = it . next ( ) ; if ( nvp . getName ( ) . equals ( param ) ) { it . remove ( ) ; } } } this . queryParams . add ( new BasicNameValuePair ( param , value ) ) ; this . encodedQuery = null ; this . encodedSchemeSpecificPart = null ; return this ;
public class GamessReader { /** * ( non - Javadoc ) ( Javadoc is automaticly inherited from the link below ) * @ see * org . openscience . cdk . io . ChemObjectReader # read ( org . openscience . cdk . ChemObject */ @ Override public < T extends IChemObject > T read ( T object ) throws CDKException { } }
if ( object instanceof IChemFile ) { try { return ( T ) readChemFile ( ( IChemFile ) object ) ; } catch ( IOException e ) { return null ; } } else { throw new CDKException ( "Only supported is reading of ChemFile objects." ) ; }
public class ParseCamt05200103 { /** * Erzeugt eine einzelne Umsatzbuchung . * @ param entry der Entry aus der CAMT - Datei . * @ param der aktuelle Saldo vor dieser Buchung . * @ return die Umsatzbuchung . */ private UmsLine createLine ( ReportEntry3 entry , BigDecimal currSaldo ) { } }
UmsLine line = new UmsLine ( ) ; line . isSepa = true ; line . isCamt = true ; line . other = new Konto ( ) ; List < EntryDetails2 > details = entry . getNtryDtls ( ) ; if ( details . size ( ) == 0 ) return null ; // Das Schema sieht zwar mehrere Detail - Elemente vor , ich wuesste // aber ohnehin nicht , wie man das sinnvoll mappen koennte EntryDetails2 detail = details . get ( 0 ) ; List < EntryTransaction3 > txList = detail . getTxDtls ( ) ; if ( txList . size ( ) == 0 ) return null ; // Checken , ob es Soll - oder Habenbuchung ist boolean haben = entry . getCdtDbtInd ( ) != null && entry . getCdtDbtInd ( ) == CreditDebitCode . CRDT ; // ditto EntryTransaction3 tx = txList . get ( 0 ) ; // Buchungs - ID TransactionReferences3 ref = tx . getRefs ( ) ; if ( ref != null ) { line . id = trim ( ref . getPrtry ( ) != null && ref . getPrtry ( ) . size ( ) > 0 ? ref . getPrtry ( ) . get ( 0 ) . getRef ( ) : null ) ; line . endToEndId = trim ( ref . getEndToEndId ( ) ) ; line . mandateId = trim ( ref . getMndtId ( ) ) ; } // Gegenkonto : IBAN + Name TransactionParties3 other = tx . getRltdPties ( ) ; if ( other != null ) { CashAccount24 acc = haben ? other . getDbtrAcct ( ) : other . getCdtrAcct ( ) ; AccountIdentification4Choice id = acc != null ? acc . getId ( ) : null ; line . other . iban = trim ( id != null ? id . getIBAN ( ) : null ) ; PartyIdentification43 name = haben ? other . getDbtr ( ) : other . getCdtr ( ) ; line . other . name = trim ( name != null ? name . getNm ( ) : null ) ; // Abweichender Name , falls vorhanden name = haben ? other . getUltmtDbtr ( ) : other . getUltmtCdtr ( ) ; line . other . name2 = trim ( name != null ? name . getNm ( ) : null ) ; } // Gegenkonto : BIC TransactionAgents3 banks = tx . getRltdAgts ( ) ; if ( banks != null ) { BranchAndFinancialInstitutionIdentification5 bank = haben ? banks . getDbtrAgt ( ) : banks . getCdtrAgt ( ) ; FinancialInstitutionIdentification8 bic = bank != null ? bank . getFinInstnId ( ) : null ; line . other . bic = trim ( bank != null ? bic . getBICFI ( ) : null ) ; } // Verwendungszweck List < String > usages = tx . getRmtInf ( ) != null ? tx . getRmtInf ( ) . getUstrd ( ) : null ; if ( usages != null && usages . size ( ) > 0 ) line . usage . addAll ( trim ( usages ) ) ; // Betrag ActiveOrHistoricCurrencyAndAmount amt = entry . getAmt ( ) ; BigDecimal bd = amt . getValue ( ) != null ? amt . getValue ( ) : BigDecimal . ZERO ; line . value = new Value ( this . checkDebit ( bd , entry . getCdtDbtInd ( ) ) ) ; line . value . setCurr ( amt . getCcy ( ) ) ; // Storno - Kennzeichen // Laut Spezifikation kehrt sich bei Stornobuchungen im Gegensatz zu MT940 // nicht das Vorzeichen um . Der Betrag bleibt also gleich line . isStorno = entry . isRvslInd ( ) != null && entry . isRvslInd ( ) . booleanValue ( ) ; // Buchungs - und Valuta - Datum DateAndDateTimeChoice bdate = entry . getBookgDt ( ) ; line . bdate = bdate != null ? SepaUtil . toDate ( bdate . getDt ( ) ) : null ; DateAndDateTimeChoice vdate = entry . getValDt ( ) ; line . valuta = vdate != null ? SepaUtil . toDate ( vdate . getDt ( ) ) : null ; // Wenn einer von beiden Werten fehlt , uebernehmen wir dort den jeweils anderen if ( line . bdate == null ) line . bdate = line . valuta ; if ( line . valuta == null ) line . valuta = line . bdate ; // Saldo line . saldo = new Saldo ( ) ; line . saldo . value = new Value ( currSaldo . add ( line . value . getBigDecimalValue ( ) ) ) ; line . saldo . value . setCurr ( line . value . getCurr ( ) ) ; line . saldo . timestamp = line . bdate ; // Art und Kundenreferenz line . text = trim ( entry . getAddtlNtryInf ( ) ) ; line . customerref = trim ( entry . getAcctSvcrRef ( ) ) ; // Primanota , GV - Code und GV - Code - Ergaenzung // Ich weiss nicht , ob das bei allen Banken so codiert ist . // Bei der Sparkasse ist es jedenfalls so . BankTransactionCodeStructure4 b = tx . getBkTxCd ( ) ; String code = ( b != null && b . getPrtry ( ) != null ) ? b . getPrtry ( ) . getCd ( ) : null ; if ( code != null && code . contains ( "+" ) ) { String [ ] parts = code . split ( "\\+" ) ; if ( parts . length == 4 ) { line . gvcode = parts [ 1 ] ; line . primanota = parts [ 2 ] ; line . addkey = parts [ 3 ] ; } } // Purpose - Code Purpose2Choice purp = tx . getPurp ( ) ; line . purposecode = trim ( purp != null ? purp . getCd ( ) : null ) ; return line ;
public class SimplePasswordStrengthChecker { /** * ( non - Javadoc ) * @ see org . jboss . as . domain . management . security . password . PasswordStrengthChecker # check ( java . lang . String , java . util . List ) */ @ Override public PasswordStrengthCheckResult check ( String userName , String password , List < PasswordRestriction > restictions ) { } }
try { this . userName = userName ; this . password = password ; this . passwordLength = this . password . length ( ) ; this . adHocRestrictions = restictions ; this . result = new SimplePasswordStrengthCheckResult ( ) ; this . checkRestrictions ( ) ; // positive checks result . positive ( password . length ( ) * PWD_LEN_WEIGHT ) ; this . checkSymbols ( ) ; this . checkDigits ( ) ; this . checkMiddleNonChar ( ) ; this . checkAlpha ( ) ; // negatives checks this . checkAlphaOnly ( ) ; this . checkNumbersOnly ( ) ; this . checkConsecutiveAlpha ( ) ; this . checkConsecutiveNumbers ( ) ; this . checkConsecutiveSymbols ( ) ; this . checkSequential ( ) ; // now evaluate . this . result . calculateStrength ( ) ; } finally { this . password = null ; this . passwordLength = 0 ; this . adHocRestrictions = null ; } return result ;
public class UserSettingRepository { /** * region > find */ @ Programmatic public UserSetting find ( final String user , final String key ) { } }
return queryResultsCache . execute ( new Callable < UserSetting > ( ) { @ Override public UserSetting call ( ) throws Exception { return doFind ( user , key ) ; } } , UserSettingRepository . class , "find" , user , key ) ;
public class DefaultExportationLinker { /** * Update the Target Filter of the ExporterService . * Apply the induce modifications on the links of the ExporterService * @ param serviceReference */ @ Modified ( id = "exporterServices" ) void modifiedExporterService ( ServiceReference < ExporterService > serviceReference ) { } }
try { exportersManager . modified ( serviceReference ) ; } catch ( InvalidFilterException invalidFilterException ) { LOG . error ( "The ServiceProperty \"" + TARGET_FILTER_PROPERTY + "\" of the ExporterService " + bundleContext . getService ( serviceReference ) + " doesn't provides a valid Filter." + " To be used, it must provides a correct \"" + TARGET_FILTER_PROPERTY + "\" ServiceProperty." , invalidFilterException ) ; exportersManager . removeLinks ( serviceReference ) ; return ; } if ( exportersManager . matched ( serviceReference ) ) { exportersManager . updateLinks ( serviceReference ) ; } else { exportersManager . removeLinks ( serviceReference ) ; }
public class MetaBucket { /** * { @ inheritDoc } */ @ Override public void serialize ( final DataOutput pOutput ) throws TTIOException { } }
try { pOutput . writeInt ( IConstants . METABUCKET ) ; pOutput . writeLong ( mBucketKey ) ; pOutput . writeInt ( mMetaMap . size ( ) ) ; for ( final Map . Entry < IMetaEntry , IMetaEntry > key : mMetaMap . entrySet ( ) ) { key . getKey ( ) . serialize ( pOutput ) ; key . getValue ( ) . serialize ( pOutput ) ; } } catch ( final IOException exc ) { throw new TTIOException ( exc ) ; }
public class BundleDelegatingPageMounter { /** * { @ inheritDoc } */ public void removeBundle ( ExtendedBundle bundle ) { } }
List < DefaultPageMounter > registrations ; synchronized ( mountPointRegistrations ) { registrations = mountPointRegistrations . remove ( bundle . getID ( ) ) ; } if ( registrations == null ) { return ; } for ( DefaultPageMounter pageMounter : registrations ) { pageMounter . dispose ( ) ; }
public class ConfigurationImpl { /** * Get the configuration string as a content . * @ param key the key to look for in the configuration file * @ param o1 resource argument * @ param o2 resource argument * @ return a content tree for the text */ @ Override public Content getContent ( String key , Object o1 , Object o2 ) { } }
return contents . getContent ( key , o1 , o2 ) ;
public class RaXmlGen { /** * Output inbound xml part * @ param def definition * @ param out Writer * @ param indent space number * @ throws IOException ioException */ private void writeInbound ( Definition def , Writer out , int indent ) throws IOException { } }
writeIndent ( out , indent ) ; out . write ( "<inbound-resourceadapter>" ) ; writeEol ( out ) ; writeIndent ( out , indent + 1 ) ; out . write ( "<messageadapter>" ) ; writeEol ( out ) ; writeIndent ( out , indent + 2 ) ; out . write ( "<messagelistener>" ) ; writeEol ( out ) ; writeIndent ( out , indent + 3 ) ; if ( ! def . isDefaultPackageInbound ( ) ) { out . write ( "<messagelistener-type>" + def . getMlClass ( ) + "</messagelistener-type>" ) ; } else { out . write ( "<messagelistener-type>" + def . getRaPackage ( ) + ".inflow." + def . getMlClass ( ) + "</messagelistener-type>" ) ; } writeEol ( out ) ; writeIndent ( out , indent + 3 ) ; out . write ( "<activationspec>" ) ; writeEol ( out ) ; writeIndent ( out , indent + 4 ) ; out . write ( "<activationspec-class>" + def . getRaPackage ( ) + ".inflow." + def . getAsClass ( ) + "</activationspec-class>" ) ; writeEol ( out ) ; writeAsConfigPropsXml ( def . getAsConfigProps ( ) , out , indent + 4 ) ; writeIndent ( out , indent + 3 ) ; out . write ( "</activationspec>" ) ; writeEol ( out ) ; writeIndent ( out , indent + 2 ) ; out . write ( "</messagelistener>" ) ; writeEol ( out ) ; writeIndent ( out , indent + 1 ) ; out . write ( "</messageadapter>" ) ; writeEol ( out ) ; writeIndent ( out , indent ) ; out . write ( "</inbound-resourceadapter>" ) ; writeEol ( out ) ;
public class Model { /** * A convenience method to fetch existing model from db or to create a new instance in memory initialized with * some attribute values . * @ param namesAndValues names and values . elements at indexes 0 , 2 , 4 , 8 . . . are attribute names , and elements at * indexes 1 , 3 , 5 . . . are values . Element at index 1 is a value for attribute at index 0 and so on . * @ return Model fetched from the db or newly created and initialized object . */ public static < T extends Model > T findOrInit ( Object ... namesAndValues ) { } }
return ModelDelegate . findOrInit ( modelClass ( ) , namesAndValues ) ;
public class ClaimBean { /** * { @ inheritDoc } */ @ Override public Set < Class < ? extends Annotation > > getStereotypes ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "getStereotypes" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "getStereotypes" , Collections . emptySet ( ) ) ; } return Collections . emptySet ( ) ;
public class HibernateRepositoryDao { /** * { @ inheritDoc } */ @ SuppressWarnings ( "unchecked" ) public List < Repository > getAll ( String projectName ) { } }
final Criteria crit = sessionService . getSession ( ) . createCriteria ( Repository . class ) ; if ( projectName != null ) { crit . createAlias ( "project" , "p" ) ; crit . add ( Restrictions . eq ( "p.name" , projectName ) ) ; } List < Repository > list = crit . list ( ) ; HibernateLazyInitializer . initCollection ( list ) ; return list ;
public class UtilMath { /** * Get the rounded floor or ceil value depending of the speed . * @ param speed The speed value . * @ param value The value to round . * @ return The floor value if negative speed , ceil if positive speed . */ public static double getRound ( double speed , double value ) { } }
if ( speed < 0 ) { return Math . floor ( value ) ; } return Math . ceil ( value ) ;
public class SARLLabelProvider { /** * Replies the image for the given element . * < p > This function is a Xtext dispatch function for { @ link # imageDescriptor ( Object ) } . * @ param element the element . * @ return the image descriptor . * @ see # imageDescriptor ( Object ) */ protected ImageDescriptor imageDescriptor ( SarlAgent element ) { } }
final JvmDeclaredType jvmElement = this . jvmModelAssociations . getInferredType ( element ) ; return this . images . forAgent ( element . getVisibility ( ) , this . adornments . get ( jvmElement ) ) ;
public class JobContext { /** * Clear JobContext of current thread */ public static void clear ( ) { } }
JobContext ctx = current_ . get ( ) ; if ( null != ctx ) { ctx . bag_ . clear ( ) ; JobContext parent = ctx . parent ; if ( null != parent ) { current_ . set ( parent ) ; ctx . parent = null ; } else { current_ . remove ( ) ; Act . eventBus ( ) . trigger ( new JobContextDestroyed ( ctx ) ) ; } }
public class ModelGenerator { /** * Build a list of method calls , representing each needed { @ link org . drools . model . impl . RuleBuilder # metadata ( String , Object ) } * starting from a drools - compiler { @ link RuleDescr } . */ private static List < MethodCallExpr > ruleMetaAttributes ( RuleContext context , RuleDescr ruleDescr ) { } }
List < MethodCallExpr > ruleMetaAttributes = new ArrayList < > ( ) ; for ( String metaAttr : ruleDescr . getAnnotationNames ( ) ) { MethodCallExpr metaAttributeCall = new MethodCallExpr ( METADATA_CALL ) ; metaAttributeCall . addArgument ( new StringLiteralExpr ( metaAttr ) ) ; AnnotationDescr ad = ruleDescr . getAnnotation ( metaAttr ) ; String adFqn = ad . getFullyQualifiedName ( ) ; if ( adFqn != null ) { AnnotationDefinition annotationDefinition ; try { annotationDefinition = AnnotationDefinition . build ( context . getTypeResolver ( ) . resolveType ( adFqn ) , ad . getValueMap ( ) , context . getTypeResolver ( ) ) ; } catch ( NoSuchMethodException | ClassNotFoundException e ) { throw new RuntimeException ( e ) ; } if ( annotationDefinition . getValues ( ) . size ( ) == 1 && annotationDefinition . getValues ( ) . containsKey ( AnnotationDescr . VALUE ) ) { Object annValue = annotationDefinition . getPropertyValue ( AnnotationDescr . VALUE ) ; metaAttributeCall . addArgument ( new StringLiteralExpr ( annValue . toString ( ) ) ) ; } else { Map < String , Object > map = new HashMap < > ( annotationDefinition . getValues ( ) . size ( ) ) ; for ( String key : annotationDefinition . getValues ( ) . keySet ( ) ) { map . put ( key , annotationDefinition . getPropertyValue ( key ) ) ; } metaAttributeCall . addArgument ( objectAsJPExpression ( map ) ) ; } } else { if ( ad . hasValue ( ) ) { if ( ad . getValues ( ) . size ( ) == 1 ) { metaAttributeCall . addArgument ( objectAsJPExpression ( resolveValue ( ad . getSingleValueAsString ( ) ) ) ) ; } else { metaAttributeCall . addArgument ( objectAsJPExpression ( ad . getValueMap ( ) ) ) ; } } else { metaAttributeCall . addArgument ( new NullLiteralExpr ( ) ) ; } } ruleMetaAttributes . add ( metaAttributeCall ) ; } return ruleMetaAttributes ;
public class Lexer { /** * 带参指令处于独立行时删除前后空白字符 , 并且再删除一个后续的换行符 * 处于独立行是指 : 向前看无有用内容 , 在前面情况成立的基础之上 * 再向后看如果也无可用内容 , 前一个条件成立才开执行后续动作 * 向前看时 forward 在移动 , 意味着正在删除空白字符 ( 通过 lookForwardLineFeed ( ) 方法 ) * 向后看时也会在碰到空白 + ' \ n ' 时删空白字符 ( 通过 deletePreviousTextTokenBlankTails ( ) 方法 ) */ boolean addIdParaToken ( Token idToken , Token paraToken ) { } }
tokens . add ( idToken ) ; tokens . add ( paraToken ) ; // if ( lookForwardLineFeed ( ) & & ( deletePreviousTextTokenBlankTails ( ) | | lexemeBegin = = 0 ) ) { if ( lookForwardLineFeedAndEof ( ) && deletePreviousTextTokenBlankTails ( ) ) { prepareNextScan ( peek ( ) != EOF ? 1 : 0 ) ; } else { prepareNextScan ( 0 ) ; } previousTextToken = null ; return true ;
public class Utils { /** * Used to parse the dividend dates . Returns null if the date cannot be * parsed . * @ param date String received that represents the date * @ return Calendar object representing the parsed date */ public static Calendar parseDividendDate ( String date ) { } }
if ( ! Utils . isParseable ( date ) ) { return null ; } date = date . trim ( ) ; SimpleDateFormat format = new SimpleDateFormat ( Utils . getDividendDateFormat ( date ) , Locale . US ) ; format . setTimeZone ( TimeZone . getTimeZone ( YahooFinance . TIMEZONE ) ) ; try { Calendar today = Calendar . getInstance ( TimeZone . getTimeZone ( YahooFinance . TIMEZONE ) ) ; Calendar parsedDate = Calendar . getInstance ( TimeZone . getTimeZone ( YahooFinance . TIMEZONE ) ) ; parsedDate . setTime ( format . parse ( date ) ) ; if ( parsedDate . get ( Calendar . YEAR ) == 1970 ) { // Not really clear which year the dividend date is . . . making a reasonable guess . int monthDiff = parsedDate . get ( Calendar . MONTH ) - today . get ( Calendar . MONTH ) ; int year = today . get ( Calendar . YEAR ) ; if ( monthDiff > 6 ) { year -= 1 ; } else if ( monthDiff < - 6 ) { year += 1 ; } parsedDate . set ( Calendar . YEAR , year ) ; } return parsedDate ; } catch ( ParseException ex ) { log . warn ( "Failed to parse dividend date: " + date ) ; log . debug ( "Failed to parse dividend date: " + date , ex ) ; return null ; }
public class MQMessageUtils { /** * 将 message 分区 * @ param partitionsNum 分区数 * @ param pkHashConfigs 分区库表主键正则表达式 * @ return 分区message数组 */ @ SuppressWarnings ( "unchecked" ) public static Message [ ] messagePartition ( Message message , Integer partitionsNum , String pkHashConfigs ) { } }
if ( partitionsNum == null ) { partitionsNum = 1 ; } Message [ ] partitionMessages = new Message [ partitionsNum ] ; List < Entry > [ ] partitionEntries = new List [ partitionsNum ] ; for ( int i = 0 ; i < partitionsNum ; i ++ ) { partitionEntries [ i ] = new ArrayList < > ( ) ; } List < CanalEntry . Entry > entries ; if ( message . isRaw ( ) ) { List < ByteString > rawEntries = message . getRawEntries ( ) ; entries = new ArrayList < > ( rawEntries . size ( ) ) ; for ( ByteString byteString : rawEntries ) { Entry entry ; try { entry = Entry . parseFrom ( byteString ) ; } catch ( InvalidProtocolBufferException e ) { throw new RuntimeException ( e ) ; } entries . add ( entry ) ; } } else { entries = message . getEntries ( ) ; } for ( Entry entry : entries ) { CanalEntry . RowChange rowChange ; try { rowChange = CanalEntry . RowChange . parseFrom ( entry . getStoreValue ( ) ) ; } catch ( Exception e ) { throw new RuntimeException ( e . getMessage ( ) , e ) ; } if ( rowChange . getIsDdl ( ) ) { partitionEntries [ 0 ] . add ( entry ) ; } else { if ( rowChange . getRowDatasList ( ) != null && ! rowChange . getRowDatasList ( ) . isEmpty ( ) ) { String database = entry . getHeader ( ) . getSchemaName ( ) ; String table = entry . getHeader ( ) . getTableName ( ) ; HashMode hashMode = getPartitionHashColumns ( database + "." + table , pkHashConfigs ) ; if ( hashMode == null ) { // 如果都没有匹配 , 发送到第一个分区 partitionEntries [ 0 ] . add ( entry ) ; } else if ( hashMode . tableHash ) { int hashCode = table . hashCode ( ) ; int pkHash = Math . abs ( hashCode ) % partitionsNum ; pkHash = Math . abs ( pkHash ) ; // tableHash not need split entry message partitionEntries [ pkHash ] . add ( entry ) ; } else { for ( CanalEntry . RowData rowData : rowChange . getRowDatasList ( ) ) { int hashCode = database . hashCode ( ) ; if ( hashMode . autoPkHash ) { // isEmpty use default pkNames for ( CanalEntry . Column column : rowData . getAfterColumnsList ( ) ) { if ( column . getIsKey ( ) ) { hashCode = hashCode ^ column . getValue ( ) . hashCode ( ) ; } } } else { for ( CanalEntry . Column column : rowData . getAfterColumnsList ( ) ) { if ( checkPkNamesHasContain ( hashMode . pkNames , column . getName ( ) ) ) { hashCode = hashCode ^ column . getValue ( ) . hashCode ( ) ; } } } int pkHash = Math . abs ( hashCode ) % partitionsNum ; pkHash = Math . abs ( pkHash ) ; // build new entry Entry . Builder builder = Entry . newBuilder ( entry ) ; RowChange . Builder rowChangeBuilder = RowChange . newBuilder ( rowChange ) ; rowChangeBuilder . clearRowDatas ( ) ; rowChangeBuilder . addRowDatas ( rowData ) ; builder . clearStoreValue ( ) ; builder . setStoreValue ( rowChangeBuilder . build ( ) . toByteString ( ) ) ; partitionEntries [ pkHash ] . add ( builder . build ( ) ) ; } } } else { // 针对stmt / mixed binlog格式的query事件 partitionEntries [ 0 ] . add ( entry ) ; } } } for ( int i = 0 ; i < partitionsNum ; i ++ ) { List < Entry > entriesTmp = partitionEntries [ i ] ; if ( ! entriesTmp . isEmpty ( ) ) { partitionMessages [ i ] = new Message ( message . getId ( ) , entriesTmp ) ; } } return partitionMessages ;
public class StandardTokens { /** * Adds tokens which are standardized by guacamole - ext to the given * TokenFilter using the values from the given AuthenticatedUser object , * including any associated credentials . These standardized tokens include * the current username ( GUAC _ USERNAME ) , password ( GUAC _ PASSWORD ) , and the * server date and time ( GUAC _ DATE and GUAC _ TIME respectively ) . If either * the username or password are not set within the given user or their * provided credentials , the corresponding token ( s ) will remain unset . * @ param filter * The TokenFilter to add standard tokens to . * @ param user * The AuthenticatedUser to use when populating the GUAC _ USERNAME and * GUAC _ PASSWORD tokens . */ public static void addStandardTokens ( TokenFilter filter , AuthenticatedUser user ) { } }
// Default to the authenticated user ' s username for the GUAC _ USERNAME // token filter . setToken ( USERNAME_TOKEN , user . getIdentifier ( ) ) ; // Add tokens specific to credentials addStandardTokens ( filter , user . getCredentials ( ) ) ;
public class StorableGenerator { /** * Returns an abstract implementation of the given Storable type , which is * fully thread - safe . The Storable type itself may be an interface or a * class . If it is a class , then it must not be final , and it must have a * public , no - arg constructor . The constructor signature for the returned * abstract class is defined as follows : * < pre > * * @ param support Access to triggers * * & # 047; * public & lt ; init & gt ; ( TriggerSupport support ) ; * < / pre > * < p > Subclasses must implement the following abstract protected methods , * whose exact names are defined by constants in this class : * < pre > * / / Load the object by examining the primary key . * protected abstract boolean doTryLoad ( ) throws FetchException ; * / / Insert the object into the storage layer . * protected abstract boolean doTryInsert ( ) throws PersistException ; * / / Update the object in the storage . * protected abstract boolean doTryUpdate ( ) throws PersistException ; * / / Delete the object from the storage layer by the primary key . * protected abstract boolean doTryDelete ( ) throws PersistException ; * < / pre > * A set of protected hook methods are provided which ensure that all * primary keys are initialized before performing a repository * operation . Subclasses may override them , if they are capable of filling * in unspecified primary keys . One such example is applying a sequence on * insert . * < pre > * / / Throws exception if any primary keys are uninitialized . * / / Actual method name defined by CHECK _ PK _ FOR _ INSERT _ METHOD _ NAME . * protected void checkPkForInsert ( ) throws IllegalStateException ; * / / Throws exception if any primary keys are uninitialized . * / / Actual method name defined by CHECK _ PK _ FOR _ UPDATE _ METHOD _ NAME . * protected void checkPkForUpdate ( ) throws IllegalStateException ; * / / Throws exception if any primary keys are uninitialized . * / / Actual method name defined by CHECK _ PK _ FOR _ DELETE _ METHOD _ NAME . * protected void checkPkForDelete ( ) throws IllegalStateException ; * < / pre > * Each property value is defined as a protected field whose name and type * matches the property . Subclasses should access these fields directly * during loading and storing . For loading , it bypasses constraint * checks . For both , it provides better performance . * < p > Subclasses also have access to a set of property state bits stored * in protected int fields . Subclasses are not responsible for updating * these values . The intention is that these states may be used by * subclasses to support partial updates . They may otherwise be ignored . * < p > As a convenience , protected methods are provided to test and alter * the property state bits . Subclass constructors that fill all properties * with loaded values must call loadCompleted to ensure all properties are * identified as being valid and to fire any load triggers . * < pre > * / / Returns true if all primary key properties have been set . * protected boolean isPkInitialized ( ) ; * / / Returns true if all partition key properties have been set . * protected boolean isPartitionKeyInitialized ( ) ; * / / Returns true if all required data properties are set . * / / A required data property is a non - nullable , non - primary key . * protected boolean isRequiredDataInitialized ( ) ; * / / Returns true if a version property has been set . * / / Note : This method is not generated if there is no version property . * protected boolean isVersionInitialized ( ) ; * / / Must be called after load to identify all properties as valid * / / and to fire any load triggers . * / / Actual method name defined by LOAD _ COMPLETED _ METHOD _ NAME . * protected void loadCompleted ( ) throws FetchException ; * < / pre > * Property state field names are defined by the concatenation of * { @ code PROPERTY _ STATE _ FIELD _ NAME } and a zero - based decimal * number . To determine which field holds a particular property ' s state , * the field number is computed as the property number divided by 16 . The * specific two - bit state position is the remainder of this division times 2. * @ throws com . amazon . carbonado . MalformedTypeException if Storable type is not well - formed * @ throws IllegalArgumentException if type is null */ @ SuppressWarnings ( "unchecked" ) public static < S extends Storable > Class < ? extends S > getAbstractClass ( Class < S > type ) throws IllegalArgumentException { } }
synchronized ( cAbstractCache ) { Class < ? extends S > abstractClass ; Reference < Class < ? extends Storable > > ref = cAbstractCache . get ( type ) ; if ( ref != null ) { abstractClass = ( Class < ? extends S > ) ref . get ( ) ; if ( abstractClass != null ) { return abstractClass ; } } abstractClass = new StorableGenerator < S > ( type ) . generateAndInjectClass ( ) ; cAbstractCache . put ( type , new SoftReference < Class < ? extends Storable > > ( abstractClass ) ) ; return abstractClass ; }
public class HttpPollerProcessor { /** * Gets the uuid from response . * @ param myResponse * the my response * @ return the uuid from response */ public String getUuidFromResponse ( ResponseOnSingeRequest myResponse ) { } }
String uuid = PcConstants . NA ; String responseBody = myResponse . getResponseBody ( ) ; Pattern regex = Pattern . compile ( getJobIdRegex ( ) ) ; Matcher matcher = regex . matcher ( responseBody ) ; if ( matcher . matches ( ) ) { uuid = matcher . group ( 1 ) ; } return uuid ;
public class AtlasRegistry { /** * Record the difference between the date response time and the local time on the server . * This is used to get a rough idea of the amount of skew in the environment . Ideally it * should be fairly small . The date header will only have seconds so we expect to regularly * have differences of up to 1 second . Note , that it is a rough estimate and could be * elevated because of unrelated problems like GC or network delays . */ private void recordClockSkew ( long responseTimestamp ) { } }
if ( responseTimestamp == 0L ) { logger . debug ( "no date timestamp on response, cannot record skew" ) ; } else { final long delta = clock ( ) . wallTime ( ) - responseTimestamp ; if ( delta >= 0L ) { // Local clock is running fast compared to the server . Note this should also be the // common case for if the clocks are in sync as there will be some delay for the server // response to reach this node . timer ( CLOCK_SKEW_TIMER , "id" , "fast" ) . record ( delta , TimeUnit . MILLISECONDS ) ; } else { // Local clock is running slow compared to the server . This means the response timestamp // appears to be after the current time on this node . The timer will ignore negative // values so we negate and record it with a different id . timer ( CLOCK_SKEW_TIMER , "id" , "slow" ) . record ( - delta , TimeUnit . MILLISECONDS ) ; } logger . debug ( "clock skew between client and server: {}ms" , delta ) ; }
public class AccessControlHelper { /** * TODO : check if object already exists - - if yes , modify accessType */ void createEntry ( Class < ? > objectType , Serializable id , String accessId , AccessType accessType ) { } }
if ( accessType == AccessType . None ) { return ; } Session session = sessionFactory . getCurrentSession ( ) ; AccessControlEntry accessControlEntry = new AccessControlEntry ( ) ; accessControlEntry . setObjectType ( objectType . getSimpleName ( ) ) ; accessControlEntry . setObjectId ( id . toString ( ) ) ; accessControlEntry . setAccessibleBy ( accessId ) ; accessControlEntry . setAccessType ( accessType . shortName ( ) ) ; session . save ( accessControlEntry ) ;
public class MinerAdapter { /** * Searches for the uniprot name of the given human EntityReference . * @ param pr to search for the uniprot name * @ return uniprot name */ protected String getUniprotNameForHuman ( ProteinReference pr ) { } }
for ( String name : pr . getName ( ) ) { if ( name . endsWith ( "_HUMAN" ) ) return name ; } return null ;
public class HibernateDocumentDao { /** * { @ inheritDoc } */ public void removeRequirement ( Requirement requirement ) throws GreenPepperServerException { } }
requirement = getRequirementByName ( requirement . getRepository ( ) . getUid ( ) , requirement . getName ( ) ) ; if ( requirement != null ) { requirement . getRepository ( ) . removeRequirement ( requirement ) ; sessionService . getSession ( ) . delete ( requirement ) ; }
public class Messenger { /** * Validating Confirmation Code * @ param code code * @ param transactionHash transaction hash * @ return promise of AuthCodeRes */ @ NotNull @ ObjectiveCName ( "doValidateCode:withTransaction:" ) public Promise < AuthCodeRes > doValidateCode ( String code , String transactionHash ) { } }
return modules . getAuthModule ( ) . doValidateCode ( transactionHash , code ) ;
public class InternalXbaseWithAnnotationsParser { /** * InternalXbaseWithAnnotations . g : 1061:1 : ruleXEqualityExpression returns [ EObject current = null ] : ( this _ XRelationalExpression _ 0 = ruleXRelationalExpression ( ( ( ( ( ) ( ( ruleOpEquality ) ) ) ) = > ( ( ) ( ( ruleOpEquality ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXRelationalExpression ) ) ) * ) ; */ public final EObject ruleXEqualityExpression ( ) throws RecognitionException { } }
EObject current = null ; EObject this_XRelationalExpression_0 = null ; EObject lv_rightOperand_3_0 = null ; enterRule ( ) ; try { // InternalXbaseWithAnnotations . g : 1067:2 : ( ( this _ XRelationalExpression _ 0 = ruleXRelationalExpression ( ( ( ( ( ) ( ( ruleOpEquality ) ) ) ) = > ( ( ) ( ( ruleOpEquality ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXRelationalExpression ) ) ) * ) ) // InternalXbaseWithAnnotations . g : 1068:2 : ( this _ XRelationalExpression _ 0 = ruleXRelationalExpression ( ( ( ( ( ) ( ( ruleOpEquality ) ) ) ) = > ( ( ) ( ( ruleOpEquality ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXRelationalExpression ) ) ) * ) { // InternalXbaseWithAnnotations . g : 1068:2 : ( this _ XRelationalExpression _ 0 = ruleXRelationalExpression ( ( ( ( ( ) ( ( ruleOpEquality ) ) ) ) = > ( ( ) ( ( ruleOpEquality ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXRelationalExpression ) ) ) * ) // InternalXbaseWithAnnotations . g : 1069:3 : this _ XRelationalExpression _ 0 = ruleXRelationalExpression ( ( ( ( ( ) ( ( ruleOpEquality ) ) ) ) = > ( ( ) ( ( ruleOpEquality ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXRelationalExpression ) ) ) * { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXEqualityExpressionAccess ( ) . getXRelationalExpressionParserRuleCall_0 ( ) ) ; } pushFollow ( FOLLOW_20 ) ; this_XRelationalExpression_0 = ruleXRelationalExpression ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current = this_XRelationalExpression_0 ; afterParserOrEnumRuleCall ( ) ; } // InternalXbaseWithAnnotations . g : 1077:3 : ( ( ( ( ( ) ( ( ruleOpEquality ) ) ) ) = > ( ( ) ( ( ruleOpEquality ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXRelationalExpression ) ) ) * loop19 : do { int alt19 = 2 ; switch ( input . LA ( 1 ) ) { case 31 : { int LA19_2 = input . LA ( 2 ) ; if ( ( synpred10_InternalXbaseWithAnnotations ( ) ) ) { alt19 = 1 ; } } break ; case 32 : { int LA19_3 = input . LA ( 2 ) ; if ( ( synpred10_InternalXbaseWithAnnotations ( ) ) ) { alt19 = 1 ; } } break ; case 33 : { int LA19_4 = input . LA ( 2 ) ; if ( ( synpred10_InternalXbaseWithAnnotations ( ) ) ) { alt19 = 1 ; } } break ; case 34 : { int LA19_5 = input . LA ( 2 ) ; if ( ( synpred10_InternalXbaseWithAnnotations ( ) ) ) { alt19 = 1 ; } } break ; } switch ( alt19 ) { case 1 : // InternalXbaseWithAnnotations . g : 1078:4 : ( ( ( ( ) ( ( ruleOpEquality ) ) ) ) = > ( ( ) ( ( ruleOpEquality ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXRelationalExpression ) ) { // InternalXbaseWithAnnotations . g : 1078:4 : ( ( ( ( ) ( ( ruleOpEquality ) ) ) ) = > ( ( ) ( ( ruleOpEquality ) ) ) ) // InternalXbaseWithAnnotations . g : 1079:5 : ( ( ( ) ( ( ruleOpEquality ) ) ) ) = > ( ( ) ( ( ruleOpEquality ) ) ) { // InternalXbaseWithAnnotations . g : 1089:5 : ( ( ) ( ( ruleOpEquality ) ) ) // InternalXbaseWithAnnotations . g : 1090:6 : ( ) ( ( ruleOpEquality ) ) { // InternalXbaseWithAnnotations . g : 1090:6 : ( ) // InternalXbaseWithAnnotations . g : 1091:7: { if ( state . backtracking == 0 ) { current = forceCreateModelElementAndSet ( grammarAccess . getXEqualityExpressionAccess ( ) . getXBinaryOperationLeftOperandAction_1_0_0_0 ( ) , current ) ; } } // InternalXbaseWithAnnotations . g : 1097:6 : ( ( ruleOpEquality ) ) // InternalXbaseWithAnnotations . g : 1098:7 : ( ruleOpEquality ) { // InternalXbaseWithAnnotations . g : 1098:7 : ( ruleOpEquality ) // InternalXbaseWithAnnotations . g : 1099:8 : ruleOpEquality { if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElement ( grammarAccess . getXEqualityExpressionRule ( ) ) ; } } if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXEqualityExpressionAccess ( ) . getFeatureJvmIdentifiableElementCrossReference_1_0_0_1_0 ( ) ) ; } pushFollow ( FOLLOW_9 ) ; ruleOpEquality ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { afterParserOrEnumRuleCall ( ) ; } } } } } // InternalXbaseWithAnnotations . g : 1115:4 : ( ( lv _ rightOperand _ 3_0 = ruleXRelationalExpression ) ) // InternalXbaseWithAnnotations . g : 1116:5 : ( lv _ rightOperand _ 3_0 = ruleXRelationalExpression ) { // InternalXbaseWithAnnotations . g : 1116:5 : ( lv _ rightOperand _ 3_0 = ruleXRelationalExpression ) // InternalXbaseWithAnnotations . g : 1117:6 : lv _ rightOperand _ 3_0 = ruleXRelationalExpression { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXEqualityExpressionAccess ( ) . getRightOperandXRelationalExpressionParserRuleCall_1_1_0 ( ) ) ; } pushFollow ( FOLLOW_20 ) ; lv_rightOperand_3_0 = ruleXRelationalExpression ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getXEqualityExpressionRule ( ) ) ; } set ( current , "rightOperand" , lv_rightOperand_3_0 , "org.eclipse.xtext.xbase.Xbase.XRelationalExpression" ) ; afterParserOrEnumRuleCall ( ) ; } } } } break ; default : break loop19 ; } } while ( true ) ; } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
public class MountTable { /** * Checks to see if a write operation is allowed for the specified Alluxio path , by determining * if it is under a readonly mount point . * @ param alluxioUri an Alluxio path URI * @ throws InvalidPathException if the Alluxio path is invalid * @ throws AccessControlException if the Alluxio path is under a readonly mount point */ public void checkUnderWritableMountPoint ( AlluxioURI alluxioUri ) throws InvalidPathException , AccessControlException { } }
try ( LockResource r = new LockResource ( mReadLock ) ) { // This will re - acquire the read lock , but that is allowed . String mountPoint = getMountPoint ( alluxioUri ) ; MountInfo mountInfo = mState . getMountTable ( ) . get ( mountPoint ) ; if ( mountInfo . getOptions ( ) . getReadOnly ( ) ) { throw new AccessControlException ( ExceptionMessage . MOUNT_READONLY , alluxioUri , mountPoint ) ; } }
public class ExceptionUtil { /** * 判断异常是否由某些底层的异常引起 . */ @ SuppressWarnings ( "unchecked" ) public static boolean isCausedBy ( @ Nullable Throwable throwable , Class < ? extends Exception > ... causeExceptionClasses ) { } }
Throwable cause = throwable ; while ( cause != null ) { for ( Class < ? extends Exception > causeClass : causeExceptionClasses ) { if ( causeClass . isInstance ( cause ) ) { return true ; } } cause = cause . getCause ( ) ; } return false ;
public class CommonsMultipartFormDataParser { /** * Creates a RequestContext needed by Jakarta Commons Upload . * @ param req the HTTP request * @ return a new request context */ private RequestContext createRequestContext ( final HttpServletRequest req ) { } }
return new RequestContext ( ) { @ Override public String getCharacterEncoding ( ) { return req . getCharacterEncoding ( ) ; } @ Override public String getContentType ( ) { return req . getContentType ( ) ; } @ Override @ Deprecated public int getContentLength ( ) { return req . getContentLength ( ) ; } @ Override public InputStream getInputStream ( ) throws IOException { return req . getInputStream ( ) ; } } ;
public class FTPControlChannel { /** * Block until one of the conditions are true : * < ol > * < li > a reply is available in the control channel , * < li > timeout ( maxWait ) expired * < li > aborted flag changes to true . * < / ol > * If maxWait = = WAIT _ FOREVER , never timeout * and only check conditions ( 1 ) and ( 3 ) . * @ param maxWait timeout in miliseconds * @ param ioDelay frequency of polling the control channel * and checking the conditions * @ param aborted flag indicating wait aborted . */ public void waitFor ( Flag aborted , int ioDelay , int maxWait ) throws ServerException , IOException , InterruptedException { } }
int oldTimeout = this . socket . getSoTimeout ( ) ; try { int c = 0 ; if ( maxWait != WAIT_FOREVER ) { this . socket . setSoTimeout ( maxWait ) ; } else { this . socket . setSoTimeout ( 0 ) ; } c = this . checkSocketDone ( aborted , ioDelay , maxWait ) ; /* A bug in the server causes it to append \ 0 to each reply . As the result , we receive this \ 0 before the next reply . The code below handles this case . */ if ( c != 0 ) { // if we ' re here , the server is healthy // and the reply is waiting in the buffer return ; } // if we ' re here , we deal with the buggy server . // we discarded the \ 0 and now resume wait . logger . debug ( "Server sent \\0; resume wait" ) ; try { // gotta read past the 0 we just remarked c = ftpIn . read ( ) ; c = this . checkSocketDone ( aborted , ioDelay , maxWait ) ; } catch ( SocketTimeoutException e ) { throw new ServerException ( ServerException . REPLY_TIMEOUT ) ; } catch ( EOFException e ) { throw new InterruptedException ( ) ; } } finally { this . socket . setSoTimeout ( oldTimeout ) ; }
public class DateUtil { /** * 查询时间是否在今日 * @ param time 日期对象 * @ return 如果指定日期对象在今天则返回 < code > true < / code > */ public static boolean isToday ( Date time ) { } }
String now = getFormatDate ( SHORT ) ; String target = getFormatDate ( SHORT , time ) ; return now . equals ( target ) ;
public class GraniteUi { /** * Current content page . If the current resource does not exist the content page * of the next - existing parent resource is returned . * @ param request Request * @ return Current content page or null */ @ SuppressWarnings ( "null" ) public static @ Nullable Page getContentPage ( @ NotNull HttpServletRequest request ) { } }
SlingHttpServletRequest slingRequest = ( SlingHttpServletRequest ) request ; Resource contentResource = getContentResourceOrParent ( request ) ; if ( contentResource != null ) { PageManager pageManager = slingRequest . getResourceResolver ( ) . adaptTo ( PageManager . class ) ; return pageManager . getContainingPage ( contentResource ) ; } else { return null ; }
public class PublicIpUtils { /** * Looks up the external ip address of the machine that this vm is running on . * @ return * @ throws Exception */ public static String lookup ( ) throws Exception { } }
if ( jerryParser == null ) { jerryParser = Jerry . jerry ( ) . enableHtmlMode ( ) ; jerryParser . getDOMBuilder ( ) . setCaseSensitive ( false ) ; jerryParser . getDOMBuilder ( ) . setParseSpecialTagsAsCdata ( true ) ; jerryParser . getDOMBuilder ( ) . setSelfCloseVoidTags ( false ) ; jerryParser . getDOMBuilder ( ) . setConditionalCommentExpression ( null ) ; jerryParser . getDOMBuilder ( ) . setEnableConditionalComments ( false ) ; jerryParser . getDOMBuilder ( ) . setImpliedEndTags ( false ) ; jerryParser . getDOMBuilder ( ) . setIgnoreComments ( true ) ; } HttpClient client = HttpClients . custom ( ) . setDefaultSocketConfig ( SocketConfig . custom ( ) . setSoReuseAddress ( true ) . build ( ) ) . setUserAgent ( "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0" ) . build ( ) ; HttpGet get = new HttpGet ( "http://www.whatismyip.com/" ) ; HttpResponse response = null ; String ipAddress = null ; try { response = client . execute ( get ) ; if ( response . getStatusLine ( ) . getStatusCode ( ) == HttpStatus . SC_OK ) { ipAddress = EntityUtils . toString ( response . getEntity ( ) ) ; try { Jerry html = jerryParser . parse ( ipAddress ) ; Jerry ipNode = html . $ ( "#greenip" ) ; if ( ipNode . length ( ) == 1 ) { ipAddress = ipNode . text ( ) ; } else { ipAddress = null ; } } catch ( Throwable t ) { ipAddress = null ; } } else { EntityUtils . consume ( response . getEntity ( ) ) ; } } finally { get . releaseConnection ( ) ; if ( response != null ) { try { ( ( CloseableHttpResponse ) response ) . close ( ) ; } catch ( Throwable t ) { } } if ( client != null ) { try { ( ( CloseableHttpClient ) client ) . close ( ) ; } catch ( Throwable t ) { } } } return ipAddress ;
public class AbstractSubCodeBuilderFragment { /** * Replies if the name of the given element is matching the pattern . * @ param element the element . * @ param pattern the name pattern . * @ return < code > true < / code > if the element ' s name is matching . */ protected static boolean nameMatches ( EObject element , String pattern ) { } }
if ( element instanceof RuleCall ) { return nameMatches ( ( ( RuleCall ) element ) . getRule ( ) , pattern ) ; } if ( element instanceof AbstractRule ) { final String name = ( ( AbstractRule ) element ) . getName ( ) ; final Pattern compilerPattern = Pattern . compile ( pattern ) ; final Matcher matcher = compilerPattern . matcher ( name ) ; if ( matcher . find ( ) ) { return true ; } } return false ;
public class Util { /** * Calculates a time constraint in milliseconds from a pair of time * constraint and units values in a Protege instance . * @ param instance a Protege < code > Instance < / code > object . * @ param constraint a time constraint slot name . The named slot is expected * to have an Integer value . * @ param constraintUnits a time constraint units slot name . May have the * values " Minute " , " Hour " , or " Day " . * @ return a < code > Weight < / code > object representing a time in milliseconds . */ static Integer parseTimeConstraint ( Instance instance , String constraint , ConnectionManager cm ) throws KnowledgeSourceReadException { } }
Integer constraintValue = null ; if ( instance != null && constraint != null ) { constraintValue = ( Integer ) cm . getOwnSlotValue ( instance , cm . getSlot ( constraint ) ) ; } return constraintValue ;
public class CmsGwtService { /** * Locks the given resource with a temporary , if not already locked by the current user . * Will throw an exception if the resource could not be locked for the current user . < p > * @ param sitepath the site - path of the resource to lock * @ return the assigned lock * @ throws CmsException if the resource could not be locked */ protected CmsLockActionRecord ensureLock ( String sitepath ) throws CmsException { } }
return ensureLock ( getCmsObject ( ) . readResource ( sitepath , CmsResourceFilter . IGNORE_EXPIRATION ) ) ;
public class GCBEZImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . GCBEZ__RG : return rg != null && ! rg . isEmpty ( ) ; } return super . eIsSet ( featureID ) ;
public class Analyzer { /** * Creates map of declarations assigned to each element of a DOM tree * @ param doc * DOM document * @ param media * Media type to be used for declarations * @ param inherit * Inheritance ( cascade propagation of values ) * @ return Map of elements as keys and their declarations */ protected DeclarationMap assingDeclarationsToDOM ( Document doc , MediaSpec media , final boolean inherit ) { } }
// classify the rules classifyAllSheets ( media ) ; // resulting map DeclarationMap declarations = new DeclarationMap ( ) ; // if the holder is empty skip evaluation if ( rules != null && ! rules . isEmpty ( ) ) { Traversal < DeclarationMap > traversal = new Traversal < DeclarationMap > ( doc , ( Object ) rules , NodeFilter . SHOW_ELEMENT ) { protected void processNode ( DeclarationMap result , Node current , Object source ) { assignDeclarationsToElement ( result , walker , ( Element ) current , ( Holder ) source ) ; } } ; // list traversal will be enough if ( ! inherit ) traversal . listTraversal ( declarations ) ; // we will do level traversal to economize blind returning // in tree else traversal . levelTraversal ( declarations ) ; } return declarations ;
public class Setting { /** * Constructs a setting of { @ link Integer } type , which is represented by a { @ link TextField } . * @ param description the title of this setting * @ param property to be bound , saved / loaded and used for undo / redo * @ return the constructed setting */ public static Setting of ( String description , IntegerProperty property ) { } }
return new Setting < > ( description , Field . ofIntegerType ( property ) . label ( description ) . render ( new SimpleIntegerControl ( ) ) , property ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getIfcFilterTypeEnum ( ) { } }
if ( ifcFilterTypeEnumEEnum == null ) { ifcFilterTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 837 ) ; } return ifcFilterTypeEnumEEnum ;
public class Responses { /** * Creates a response object for a failed command execution . * @ param sessionId ID of the session that executed the command . * @ param reason the failure reason . * @ return the new response object . */ public static Response failure ( SessionId sessionId , Throwable reason ) { } }
Response response = new Response ( ) ; response . setSessionId ( sessionId != null ? sessionId . toString ( ) : null ) ; response . setValue ( reason ) ; response . setStatus ( ERROR_CODES . toStatusCode ( reason ) ) ; response . setState ( ERROR_CODES . toState ( response . getStatus ( ) ) ) ; return response ;
public class UserAPI { /** * 创建分组 * @ param access _ token access _ token * @ param name name * @ return Group */ public static Group groupsCreate ( String access_token , String name ) { } }
String groupJson = String . format ( "{\"group\":{\"name\":\"%1$s\"}}" , name ) ; HttpUriRequest httpUriRequest = RequestBuilder . post ( ) . setHeader ( jsonHeader ) . setUri ( BASE_URI + "/cgi-bin/groups/create" ) . addParameter ( PARAM_ACCESS_TOKEN , API . accessToken ( access_token ) ) . setEntity ( new StringEntity ( groupJson , Charset . forName ( "utf-8" ) ) ) . build ( ) ; return LocalHttpClient . executeJsonResult ( httpUriRequest , Group . class ) ;
public class XmlDocumentReader { /** * This method creates a DocumentBuilderFactory that we will always need . * @ see < a href = " http : / / xerces . apache . org / xerces - j / features . html " > Apache XML Features < / a > * @ return the standard document builder factory we usually use */ public static DocumentBuilderFactory getStandardDocumentBuilderFactory ( boolean validating ) { } }
DocumentBuilderFactory dbf = DocumentBuilderFactory . newInstance ( ) ; try { // enable validation ( must specify a grammar ) dbf . setValidating ( validating ) ; dbf . setFeature ( "http://xml.org/sax/features/validation" , validating ) ; dbf . setFeature ( "http://apache.org/xml/features/nonvalidating/load-dtd-grammar" , validating ) ; dbf . setFeature ( "http://apache.org/xml/features/nonvalidating/load-external-dtd" , validating ) ; dbf . setFeature ( "http://apache.org/xml/features/validation/schema" , true ) ; dbf . setFeature ( "http://xml.org/sax/features/namespaces" , true ) ; dbf . setFeature ( "http://apache.org/xml/features/dom/include-ignorable-whitespace" , false ) ; } catch ( ParserConfigurationException pce ) { throw new RuntimeException ( "Cannot load standard DocumentBuilderFactory. " + pce . getMessage ( ) , pce ) ; } dbf . setNamespaceAware ( true ) ; dbf . setIgnoringComments ( true ) ; dbf . setExpandEntityReferences ( true ) ; return dbf ;
public class ParallelismConfigurationDescriptionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ParallelismConfigurationDescription parallelismConfigurationDescription , ProtocolMarshaller protocolMarshaller ) { } }
if ( parallelismConfigurationDescription == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( parallelismConfigurationDescription . getConfigurationType ( ) , CONFIGURATIONTYPE_BINDING ) ; protocolMarshaller . marshall ( parallelismConfigurationDescription . getParallelism ( ) , PARALLELISM_BINDING ) ; protocolMarshaller . marshall ( parallelismConfigurationDescription . getParallelismPerKPU ( ) , PARALLELISMPERKPU_BINDING ) ; protocolMarshaller . marshall ( parallelismConfigurationDescription . getCurrentParallelism ( ) , CURRENTPARALLELISM_BINDING ) ; protocolMarshaller . marshall ( parallelismConfigurationDescription . getAutoScalingEnabled ( ) , AUTOSCALINGENABLED_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class CqlFilterTransformation { /** * Checks whether the given input object passes the cql filter . * @ param input The object to evaluate * @ return True if the given object passes the cql filter , false otherwise . */ public Boolean transform ( T input ) throws TransformationException { } }
try { return cqlFilter . evaluate ( input ) ; } catch ( ParseException e ) { throw new TransformationException ( e , input ) ; }
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link MeasureListType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link MeasureListType } { @ code > } */ @ XmlElementDecl ( namespace = "http://www.opengis.net/gml" , name = "valueList" ) public JAXBElement < MeasureListType > createValueList ( MeasureListType value ) { } }
return new JAXBElement < MeasureListType > ( _ValueList_QNAME , MeasureListType . class , null , value ) ;
public class ListUpdatesRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListUpdatesRequest listUpdatesRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listUpdatesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listUpdatesRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( listUpdatesRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( listUpdatesRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class SkillsApi { /** * Get character skills List all trained skills for the given character - - - * This route is cached for up to 120 seconds SSO Scope : * esi - skills . read _ skills . v1 * @ param characterId * An EVE character ID ( required ) * @ param datasource * The server name you would like data from ( optional , default to * tranquility ) * @ param ifNoneMatch * ETag from a previous request . A 304 will be returned if this * matches the current ETag ( optional ) * @ param token * Access token to use if unable to set a header ( optional ) * @ return CharacterSkillsResponse * @ throws ApiException * If fail to call the API , e . g . server error or cannot * deserialize the response body */ public CharacterSkillsResponse getCharactersCharacterIdSkills ( Integer characterId , String datasource , String ifNoneMatch , String token ) throws ApiException { } }
ApiResponse < CharacterSkillsResponse > resp = getCharactersCharacterIdSkillsWithHttpInfo ( characterId , datasource , ifNoneMatch , token ) ; return resp . getData ( ) ;
public class SPVBlockStore { /** * Returns the offset from the file start where the latest block should be written ( end of prev block ) . */ private int getRingCursor ( ByteBuffer buffer ) { } }
int c = buffer . getInt ( 4 ) ; checkState ( c >= FILE_PROLOGUE_BYTES , "Integer overflow" ) ; return c ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getIfcProtectiveDeviceTypeEnum ( ) { } }
if ( ifcProtectiveDeviceTypeEnumEEnum == null ) { ifcProtectiveDeviceTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 878 ) ; } return ifcProtectiveDeviceTypeEnumEEnum ;
public class AliasDefinition { /** * Parse the alias definition rooted at the given UNode , copying its properties into * this object . * @ param aliasNode Root of an alias definition . */ public void parse ( UNode aliasNode ) { } }
assert aliasNode != null ; // Ensure the alias name is valid and save it . setName ( aliasNode . getName ( ) ) ; // The only child element we expect is " expression " . for ( String childName : aliasNode . getMemberNames ( ) ) { // All child nodes must be values . UNode childNode = aliasNode . getMember ( childName ) ; Utils . require ( childNode . isValue ( ) , "Value of alias attribute must be a string: " + childNode ) ; Utils . require ( childName . equals ( "expression" ) , "'expression' expected: " + childName ) ; Utils . require ( m_expression == null , "'expression' can only be specified once" ) ; setExpression ( childNode . getValue ( ) ) ; } // Ensure expression was specified . Utils . require ( m_expression != null , "Alias definition missing 'expression': " + aliasNode ) ;
public class EventBuilder { /** * Adds an extra property to the event . * @ param extraName name of the extra property . * @ param extraValue value of the extra property . * @ return the current { @ code EventBuilder } for chained calls . */ public EventBuilder withExtra ( String extraName , Object extraValue ) { } }
event . getExtra ( ) . put ( extraName , extraValue ) ; return this ;
public class CnvIbnDateToCv { /** * < p > Put Date object to ColumnsValues with transformation * into Long . < / p > * @ param pAddParam additional params , e . g . version algorithm or * bean source class for generic converter that consume set of subtypes . * @ param pFrom from a Date object * @ param pTo to ColumnsValues * @ param pName by a name * @ throws Exception - an exception */ @ Override public final void convert ( final Map < String , Object > pAddParam , final Date pFrom , final ColumnsValues pTo , final String pName ) throws Exception { } }
Long value ; if ( pFrom == null ) { value = null ; } else { value = pFrom . getTime ( ) ; } pTo . put ( pName , value ) ;
public class DataSourceMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DataSource dataSource , ProtocolMarshaller protocolMarshaller ) { } }
if ( dataSource == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( dataSource . getDataSourceArn ( ) , DATASOURCEARN_BINDING ) ; protocolMarshaller . marshall ( dataSource . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( dataSource . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( dataSource . getType ( ) , TYPE_BINDING ) ; protocolMarshaller . marshall ( dataSource . getServiceRoleArn ( ) , SERVICEROLEARN_BINDING ) ; protocolMarshaller . marshall ( dataSource . getDynamodbConfig ( ) , DYNAMODBCONFIG_BINDING ) ; protocolMarshaller . marshall ( dataSource . getLambdaConfig ( ) , LAMBDACONFIG_BINDING ) ; protocolMarshaller . marshall ( dataSource . getElasticsearchConfig ( ) , ELASTICSEARCHCONFIG_BINDING ) ; protocolMarshaller . marshall ( dataSource . getHttpConfig ( ) , HTTPCONFIG_BINDING ) ; protocolMarshaller . marshall ( dataSource . getRelationalDatabaseConfig ( ) , RELATIONALDATABASECONFIG_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ListVersionsByFunctionResult { /** * A list of Lambda function versions . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setVersions ( java . util . Collection ) } or { @ link # withVersions ( java . util . Collection ) } if you want to override * the existing values . * @ param versions * A list of Lambda function versions . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListVersionsByFunctionResult withVersions ( FunctionConfiguration ... versions ) { } }
if ( this . versions == null ) { setVersions ( new com . amazonaws . internal . SdkInternalList < FunctionConfiguration > ( versions . length ) ) ; } for ( FunctionConfiguration ele : versions ) { this . versions . add ( ele ) ; } return this ;
public class GetRestApisRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetRestApisRequest getRestApisRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getRestApisRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getRestApisRequest . getPosition ( ) , POSITION_BINDING ) ; protocolMarshaller . marshall ( getRestApisRequest . getLimit ( ) , LIMIT_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class PackageManagerUtils { /** * Checks if the device has a NFC . * @ param context the context . * @ return { @ code true } if the device has a NFC . */ @ TargetApi ( Build . VERSION_CODES . GINGERBREAD ) public static boolean hasNfcFeature ( Context context ) { } }
return hasNfcFeature ( context . getPackageManager ( ) ) ;
public class HttpRequestMessageImpl { /** * Check the to see if the current remote host is allowed to send a private header * @ see HttpDispatcher . usePrivateHeaders ( ) * @ param key WAS private header * @ return true if the remote host is allowed to send key */ private boolean isPrivateHeaderTrusted ( HeaderKeys key ) { } }
HttpServiceContextImpl hisc = getServiceContext ( ) ; InetAddress remoteAddr = null ; String address = null ; if ( hisc != null && ( remoteAddr = hisc . getRemoteAddr ( ) ) != null ) { address = remoteAddr . getHostAddress ( ) ; } boolean trusted = false ; if ( address != null ) { trusted = HttpDispatcher . usePrivateHeaders ( address , key . getName ( ) ) ; } if ( ! trusted ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "isPrivateHeaderTrusted: " + key . getName ( ) + " is not trusted for host " + address ) ; } return false ; } return true ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getDeviceAppearanceDevApp ( ) { } }
if ( deviceAppearanceDevAppEEnum == null ) { deviceAppearanceDevAppEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 188 ) ; } return deviceAppearanceDevAppEEnum ;
public class AbstractResultSetWrapper { /** * { @ inheritDoc } * @ see java . sql . ResultSet # updateTimestamp ( java . lang . String , java . sql . Timestamp ) */ @ Override public void updateTimestamp ( final String columnLabel , final Timestamp x ) throws SQLException { } }
wrapped . updateTimestamp ( columnLabel , x ) ;
public class JobScheduleOperations { /** * Terminates the specified job schedule . * @ param jobScheduleId The ID of the job schedule . * @ param additionalBehaviors A collection of { @ link BatchClientBehavior } instances that are applied to the Batch service request . * @ throws BatchErrorException Exception thrown when an error response is received from the Batch service . * @ throws IOException Exception thrown when there is an error in serialization / deserialization of data sent to / received from the Batch service . */ public void terminateJobSchedule ( String jobScheduleId , Iterable < BatchClientBehavior > additionalBehaviors ) throws BatchErrorException , IOException { } }
JobScheduleTerminateOptions options = new JobScheduleTerminateOptions ( ) ; BehaviorManager bhMgr = new BehaviorManager ( this . customBehaviors ( ) , additionalBehaviors ) ; bhMgr . applyRequestBehaviors ( options ) ; this . parentBatchClient . protocolLayer ( ) . jobSchedules ( ) . terminate ( jobScheduleId , options ) ;
public class Log { /** * Send a { @ link # Constants . ERROR } log message and log the exception . * @ param tag * Used to identify the source of a log message . It usually * identifies the class or activity where the log call occurs . * @ param msg * The message you would like logged . * @ param tr * An exception to log */ public static int e ( String tag , String msg , Throwable tr ) { } }
collectLogEntry ( Constants . ERROR , tag , msg , tr ) ; if ( isLoggable ( tag , Constants . ERROR ) ) { return android . util . Log . e ( tag , msg , tr ) ; } return 0 ;
public class ReviewedPagesTitles { /** * generates the next MediaWiki - request ( GetMethod ) and adds it to msgs . * @ param namespace the namespace ( s ) that will be searched for links , as a string of numbers * separated by ' | ' ; if null , this parameter is omitted * @ param rpstart Start listing at this page id * @ param rpend Stop listing at this page id */ private HttpAction generateRequest ( int [ ] namespace , String rpstart , String rpend ) { } }
RequestBuilder requestBuilder = new ApiRequestBuilder ( ) . action ( "query" ) . formatXml ( ) . param ( "list" , "reviewedpages" ) . param ( "rplimit" , LIMIT ) ; if ( namespace != null ) { String rpnamespace = MediaWiki . urlEncode ( MWAction . createNsString ( namespace ) ) ; requestBuilder . param ( "rpnamespace" , rpnamespace ) ; } if ( rpstart . length ( ) > 0 ) { requestBuilder . param ( "rpstart" , rpstart ) ; } if ( rpend . length ( ) > 0 ) { requestBuilder . param ( "rpend" , rpend ) ; } return requestBuilder . buildGet ( ) ;