signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class VectorTilePainter { /** * Delete a { @ link Paintable } object from the given { @ link MapContext } . It the object does not exist , nothing * will be done . * @ param paintable * The object to be painted . * @ param group * The group where the object resides in ( optional ) . * @ param context * The context to paint on . */ public void deleteShape ( Paintable paintable , Object group , MapContext context ) { } }
VectorTile tile = ( VectorTile ) paintable ; context . getVectorContext ( ) . deleteGroup ( tile . getFeatureContent ( ) ) ; context . getVectorContext ( ) . deleteGroup ( tile . getLabelContent ( ) ) ; context . getRasterContext ( ) . deleteGroup ( tile . getFeatureContent ( ) ) ; context . getRasterContext ( ) . deleteGroup ( tile . getLabelContent ( ) ) ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getSVI ( ) { } }
if ( sviEClass == null ) { sviEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 341 ) ; } return sviEClass ;
public class GroupListHelperImpl { /** * ( non - Javadoc ) * @ see org . apereo . portal . layout . dlm . remoting . IGroupListHelper # getEntity ( org . apereo . portal . groups . IGroupMember ) */ @ Override public JsonEntityBean getEntity ( IGroupMember member ) { } }
// get the type of this member entity EntityEnum entityEnum = getEntityType ( member ) ; // construct a new entity bean for this entity JsonEntityBean entity ; if ( entityEnum . isGroup ( ) ) { entity = new JsonEntityBean ( ( IEntityGroup ) member , entityEnum ) ; } else { entity = new JsonEntityBean ( member , entityEnum ) ; } // if the name hasn ' t been set yet , look up the entity name if ( entity . getName ( ) == null ) { entity . setName ( lookupEntityName ( entity ) ) ; } if ( EntityEnum . GROUP . equals ( entity . getEntityType ( ) ) || EntityEnum . PERSON . equals ( entity . getEntityType ( ) ) ) { IAuthorizationPrincipal principal = getPrincipalForEntity ( entity ) ; entity . setPrincipalString ( principal . getPrincipalString ( ) ) ; } return entity ;
public class Slf4jAdapter { /** * { @ inheritDoc } */ @ Override public void warn ( final MessageItem messageItem , final Throwable t ) { } }
getLogger ( ) . warn ( messageItem . getMarker ( ) , messageItem . getText ( ) , t ) ;
public class ModelsImpl { /** * Gets information about the hierarchical entity child model . * @ param appId The application ID . * @ param versionId The version ID . * @ param hEntityId The hierarchical entity extractor ID . * @ param hChildId The hierarchical entity extractor child ID . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the HierarchicalChildEntity object */ public Observable < ServiceResponse < HierarchicalChildEntity > > getHierarchicalEntityChildWithServiceResponseAsync ( UUID appId , String versionId , UUID hEntityId , UUID hChildId ) { } }
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 ( hEntityId == null ) { throw new IllegalArgumentException ( "Parameter hEntityId is required and cannot be null." ) ; } if ( hChildId == null ) { throw new IllegalArgumentException ( "Parameter hChildId is required and cannot be null." ) ; } String parameterizedHost = Joiner . on ( ", " ) . join ( "{Endpoint}" , this . client . endpoint ( ) ) ; return service . getHierarchicalEntityChild ( appId , versionId , hEntityId , hChildId , this . client . acceptLanguage ( ) , parameterizedHost , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < HierarchicalChildEntity > > > ( ) { @ Override public Observable < ServiceResponse < HierarchicalChildEntity > > call ( Response < ResponseBody > response ) { try { ServiceResponse < HierarchicalChildEntity > clientResponse = getHierarchicalEntityChildDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class DwgFile { /** * Reads a DWG file and put its objects in the dwgObjects Vector * This method is version independent * @ throws IOException If the file location is wrong */ public void read ( ) throws IOException { } }
System . out . println ( "DwgFile.read() executed ..." ) ; setDwgVersion ( ) ; if ( dwgVersion . equals ( "R13" ) ) { dwgReader = new DwgFileV14Reader ( ) ; dwgReader . read ( this ) ; } else if ( dwgVersion . equals ( "R14" ) ) { dwgReader = new DwgFileV14Reader ( ) ; dwgReader . read ( this ) ; } else if ( dwgVersion . equals ( "R15" ) ) { dwgReader = new DwgFileV15Reader ( ) ; dwgReader . read ( this ) ; } else if ( dwgVersion . equals ( "Unknown" ) ) { throw new IOException ( "DWG version of the file is not supported." ) ; }
public class NumberUtil { /** * 将10进制的String安全的转化为Double . * 当str为空或非数字字符串时抛NumberFormatException */ public static Double toDoubleObject ( @ NotNull String str ) { } }
// 统一行为 , 不要有时候抛NPE , 有时候抛NumberFormatException if ( str == null ) { throw new NumberFormatException ( "null" ) ; } return Double . valueOf ( str ) ;
public class AccountsEndpoint { /** * Removes all dependent resources of an account . Some resources like * CDRs are excluded . * @ param sid */ private void removeAccoundDependencies ( Sid sid ) { } }
logger . debug ( "removing accoutn dependencies" ) ; DaoManager daoManager = ( DaoManager ) context . getAttribute ( DaoManager . class . getName ( ) ) ; // remove dependency entities first and dependent entities last . Also , do safer operation first ( as a secondary rule ) daoManager . getAnnouncementsDao ( ) . removeAnnouncements ( sid ) ; daoManager . getNotificationsDao ( ) . removeNotifications ( sid ) ; daoManager . getShortCodesDao ( ) . removeShortCodes ( sid ) ; daoManager . getOutgoingCallerIdsDao ( ) . removeOutgoingCallerIds ( sid ) ; daoManager . getTranscriptionsDao ( ) . removeTranscriptions ( sid ) ; daoManager . getRecordingsDao ( ) . removeRecordings ( sid ) ; daoManager . getApplicationsDao ( ) . removeApplications ( sid ) ; removeIncomingPhoneNumbers ( sid , daoManager . getIncomingPhoneNumbersDao ( ) ) ; daoManager . getClientsDao ( ) . removeClients ( sid ) ; profileAssociationsDao . deleteProfileAssociationByTargetSid ( sid . toString ( ) ) ;
public class InMemoryLookupTable { /** * Inserts a word vector * @ param word the word to insert * @ param vector the vector to insert */ @ Override public void putVector ( String word , INDArray vector ) { } }
if ( word == null ) throw new IllegalArgumentException ( "No null words allowed" ) ; if ( vector == null ) throw new IllegalArgumentException ( "No null vectors allowed" ) ; int idx = vocab . indexOf ( word ) ; syn0 . slice ( idx ) . assign ( vector ) ;
public class WaveBase { /** * Retrieve the field value from wave bean * @ param waveItem the wave item to retrieve * @ return the object value */ private Object waveBeanGet ( WaveItem < ? > waveItem ) { } }
for ( final WaveBean wb : waveBeanList ( ) ) { final Object o = Stream . of ( wb . getClass ( ) . getDeclaredFields ( ) ) . filter ( f -> waveItem . name ( ) . equals ( f . getName ( ) ) ) . map ( f -> ClassUtility . getFieldValue ( f , wb ) ) . findFirst ( ) . get ( ) ; if ( o != null ) { return o ; } } return null ;
public class WindowsProcessFaxClientSpi { /** * This function creates and returns the command line arguments for the fax4j * external exe when running the submit fax job action . * @ param faxJob * The fax job object * @ return The full command line arguments line */ protected String createProcessCommandArgumentsForSubmitFaxJob ( FaxJob faxJob ) { } }
// get values from fax job String targetAddress = faxJob . getTargetAddress ( ) ; String targetName = faxJob . getTargetName ( ) ; String senderName = faxJob . getSenderName ( ) ; File file = faxJob . getFile ( ) ; String fileName = null ; try { fileName = file . getCanonicalPath ( ) ; } catch ( Exception exception ) { throw new FaxException ( "Unable to extract canonical path from file: " + file , exception ) ; } String documentName = faxJob . getProperty ( WindowsFaxClientSpi . FaxJobExtendedPropertyConstants . DOCUMENT_NAME_PROPERTY_KEY . toString ( ) , null ) ; // init buffer StringBuilder buffer = new StringBuilder ( ) ; // create command line arguments this . addCommandLineArgument ( buffer , Fax4jExeConstants . ACTION_FAX4J_EXE_COMMAND_LINE_ARGUMENT . toString ( ) , Fax4jExeConstants . SUBMIT_ACTION_FAX4J_EXE_COMMAND_LINE_ARGUMENT_VALUE . toString ( ) ) ; this . addCommandLineArgument ( buffer , Fax4jExeConstants . SERVER_FAX4J_EXE_COMMAND_LINE_ARGUMENT . toString ( ) , this . faxServerName ) ; this . addCommandLineArgument ( buffer , Fax4jExeConstants . TARGET_ADDRESS_FAX4J_EXE_COMMAND_LINE_ARGUMENT . toString ( ) , targetAddress ) ; this . addCommandLineArgument ( buffer , Fax4jExeConstants . TARGET_NAME_FAX4J_EXE_COMMAND_LINE_ARGUMENT . toString ( ) , targetName ) ; this . addCommandLineArgument ( buffer , Fax4jExeConstants . SENDER_NAME_FAX4J_EXE_COMMAND_LINE_ARGUMENT . toString ( ) , senderName ) ; this . addCommandLineArgument ( buffer , Fax4jExeConstants . FILE_NAME_FAX4J_EXE_COMMAND_LINE_ARGUMENT . toString ( ) , fileName ) ; this . addCommandLineArgument ( buffer , Fax4jExeConstants . DOCUMENT_NAME_FAX4J_EXE_COMMAND_LINE_ARGUMENT . toString ( ) , documentName ) ; // get text String commandArguments = buffer . toString ( ) ; return commandArguments ;
public class PreferenceActivity { /** * Adapts the background color of the toolbar , which is used to show the bread crumb of the * currently selected navigation preferences , when using the split screen layout . */ private void adaptBreadCrumbBackgroundColor ( ) { } }
if ( breadCrumbToolbar != null ) { GradientDrawable background = ( GradientDrawable ) ContextCompat . getDrawable ( this , R . drawable . breadcrumb_background ) ; background . setColor ( breadCrumbBackgroundColor ) ; ViewUtil . setBackground ( getBreadCrumbToolbar ( ) , background ) ; }
public class VoxbonePhoneNumberProvisioningManager { /** * ( non - Javadoc ) * @ see * PhoneNumberProvisioningManager # init ( org . apache . commons . configuration * . Configuration , boolean ) */ @ Override public void init ( Configuration phoneNumberProvisioningConfiguration , Configuration telestaxProxyConfiguration , ContainerConfiguration containerConfiguration ) { } }
this . containerConfiguration = containerConfiguration ; telestaxProxyEnabled = telestaxProxyConfiguration . getBoolean ( "enabled" , false ) ; if ( telestaxProxyEnabled ) { uri = telestaxProxyConfiguration . getString ( "uri" ) ; username = telestaxProxyConfiguration . getString ( "username" ) ; password = telestaxProxyConfiguration . getString ( "password" ) ; activeConfiguration = telestaxProxyConfiguration ; } else { Configuration voxboneConfiguration = phoneNumberProvisioningConfiguration . subset ( "voxbone" ) ; uri = voxboneConfiguration . getString ( "uri" ) ; username = voxboneConfiguration . getString ( "username" ) ; password = voxboneConfiguration . getString ( "password" ) ; activeConfiguration = voxboneConfiguration ; } searchURI = uri + "/inventory/didgroup" ; createCartURI = uri + "/ordering/cart" ; voiceURI = uri + "/configuration/voiceuri" ; updateURI = uri + "/configuration/configuration" ; cancelURI = uri + "/ordering/cancel" ; countriesURI = uri + "/inventory/country" ; listDidsURI = uri + "/inventory/did" ; Configuration callbackUrlsConfiguration = phoneNumberProvisioningConfiguration . subset ( "callback-urls" ) ; Client jerseyClient = Client . create ( ) ; jerseyClient . addFilter ( new HTTPBasicAuthFilter ( username , password ) ) ; WebResource webResource = jerseyClient . resource ( voiceURI ) ; String body = "{\"voiceUri\":{\"voiceUriProtocol\":\"SIP\",\"uri\":\"" + callbackUrlsConfiguration . getString ( "voice[@url]" ) + "\"}}" ; ClientResponse clientResponse = webResource . accept ( CONTENT_TYPE ) . type ( CONTENT_TYPE ) . put ( ClientResponse . class , body ) ; String voiceURIResponse = clientResponse . getEntity ( String . class ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "response " + voiceURIResponse ) ; JsonParser parser = new JsonParser ( ) ; JsonObject jsonVoiceURIResponse = parser . parse ( voiceURIResponse ) . getAsJsonObject ( ) ; if ( clientResponse . getClientResponseStatus ( ) == Status . OK ) { JsonObject voxVoiceURI = jsonVoiceURIResponse . get ( "voiceUri" ) . getAsJsonObject ( ) ; voiceUriId = voxVoiceURI . get ( "voiceUriId" ) . getAsString ( ) ; } else if ( clientResponse . getClientResponseStatus ( ) == Status . UNAUTHORIZED ) { JsonObject error = jsonVoiceURIResponse . get ( "errors" ) . getAsJsonArray ( ) . get ( 0 ) . getAsJsonObject ( ) ; throw new IllegalArgumentException ( error . get ( "apiErrorMessage" ) . getAsString ( ) ) ; } else { webResource = jerseyClient . resource ( voiceURI ) ; clientResponse = webResource . queryParam ( PAGE_NUMBER , "0" ) . queryParam ( PAGE_SIZE , "300" ) . accept ( CONTENT_TYPE ) . type ( CONTENT_TYPE ) . get ( ClientResponse . class ) ; String listVoiceURIResponse = clientResponse . getEntity ( String . class ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "response " + listVoiceURIResponse ) ; JsonObject jsonListVoiceURIResponse = parser . parse ( listVoiceURIResponse ) . getAsJsonObject ( ) ; // TODO go through the list of voiceURI id and check which one is matching JsonObject voxVoiceURI = jsonListVoiceURIResponse . get ( "voiceUris" ) . getAsJsonArray ( ) . get ( 0 ) . getAsJsonObject ( ) ; voiceUriId = voxVoiceURI . get ( "voiceUriId" ) . getAsString ( ) ; }
public class ProtocolDataUnitFactory { /** * This method creates a < code > ProtocolDataUnit < / code > instance , which initializes only the digests to use , and * returns it . * @ param headerDigest The name of the digest to use for the protection of the Basic Header Segment . * @ param dataDigest The name of the digest to use for the protection of the Data Segment . * @ return A new < code > ProtocolDataUnit < / code > instance . */ public final ProtocolDataUnit create ( final String headerDigest , final String dataDigest ) { } }
return new ProtocolDataUnit ( digestFactory . create ( headerDigest ) , digestFactory . create ( dataDigest ) ) ;
public class TCPInputPoller { /** * Pop the oldest command from our list and return it . * @ return the oldest unhandled command in our list */ public String getCommand ( ) { } }
String command = "" ; synchronized ( this ) { if ( commandQueue . size ( ) > 0 ) { command = commandQueue . remove ( 0 ) . command ; } } return command ;
public class GeneratePairwiseImageGraph { /** * Puts the inliers from RANSAC into the edge ' s list of associated features * @ param ransac RANSAC * @ param matches List of matches from feature association * @ param edge The edge that the inliers are to be saved to */ private void saveInlierMatches ( ModelMatcher < ? , ? > ransac , FastQueue < AssociatedIndex > matches , PairwiseImageGraph2 . Motion edge ) { } }
int N = ransac . getMatchSet ( ) . size ( ) ; edge . inliers . reset ( ) ; for ( int i = 0 ; i < N ; i ++ ) { int idx = ransac . getInputIndex ( i ) ; edge . inliers . grow ( ) . set ( matches . get ( idx ) ) ; }
public class UIComponent { /** * Sets the < code > hovered < / code > state of this { @ link UIComponent } . * @ param hovered the new state */ public void setHovered ( boolean hovered ) { } }
boolean flag = this . hovered != hovered ; flag |= MalisisGui . setHoveredComponent ( this , hovered ) ; if ( ! flag ) return ; this . hovered = hovered ; fireEvent ( new HoveredStateChange < > ( this , hovered ) ) ; if ( tooltip != null && hovered ) tooltip . animate ( ) ;
public class Spark { /** * Maps one or many filters to be executed before any matching routes * @ param path the path * @ param acceptType the accept type * @ param filters The filters */ public static void before ( String path , String acceptType , Filter ... filters ) { } }
for ( Filter filter : filters ) { getInstance ( ) . before ( path , acceptType , filter ) ; }
public class ParseTreeConstructorFragment { /** * Set the Graphviz command that is issued to paint a debugging diagram . * @ param cmd */ public void setGraphvizCommand ( String cmd ) { } }
if ( cmd != null && cmd . length ( ) == 0 ) cmd = null ; graphvizCommand = cmd ;
public class SubscribeBeanPostProcessor { /** * Unsubscribes the subscriber bean from the corresponding { @ link EventBus } . */ @ Override public void postProcessBeforeDestruction ( final Object bean , final String beanName ) throws BeansException { } }
if ( subscribers . containsKey ( beanName ) ) { Subscribe annotation = getAnnotation ( bean . getClass ( ) , beanName ) ; LOG . debug ( "Unsubscribing the event listener '{}' from event bus '{}' with topic '{}" , beanName , annotation . eventBus ( ) , annotation . topic ( ) ) ; try { EventBus eventBus = getEventBus ( annotation . eventBus ( ) , beanName ) ; eventBus . unsubscribe ( annotation . topic ( ) , ( EventSubscriber ) bean ) ; } catch ( Exception e ) { LOG . error ( "Unsubscribing the event listener '{}' failed" , beanName , e ) ; } finally { subscribers . remove ( beanName ) ; } }
public class Graphics { /** * Sets the color value , position , direction and the angle of the spotlight cone of the No . i spotLight */ public void setSpotLight ( int i , Color color , boolean enableColor , Vector3D v , float nx , float ny , float nz , float angle ) { } }
float spotColor [ ] = { ( float ) color . getRed ( ) , ( float ) color . getGreen ( ) , ( float ) color . getBlue ( ) , ( float ) color . getAlpha ( ) } ; float pos [ ] = { ( float ) v . getX ( ) , ( float ) v . getY ( ) , ( float ) v . getZ ( ) , 0.0f } ; float direction [ ] = { nx , ny , nz } ; float a [ ] = { angle } ; gl . glEnable ( GL2 . GL_LIGHTING ) ; gl . glEnable ( GL2 . GL_LIGHT0 + i ) ; gl . glLightfv ( GL2 . GL_LIGHT0 + i , GL2 . GL_POSITION , pos , 0 ) ; if ( enableColor ) gl . glLightfv ( GL2 . GL_LIGHT0 + i , GL2 . GL_DIFFUSE , spotColor , 0 ) ; gl . glLightfv ( GL2 . GL_LIGHT0 + i , GL2 . GL_SPOT_DIRECTION , direction , 0 ) ; gl . glLightfv ( GL2 . GL_LIGHT0 + i , GL2 . GL_SPOT_CUTOFF , a , 0 ) ;
public class Resolve { /** * Find an identifier in a package which matches a specified kind set . * @ param env The current environment . * @ param name The identifier ' s name . * @ param kind Indicates the possible symbol kinds * ( a nonempty subset of TYP , PCK ) . */ Symbol findIdentInPackage ( Env < AttrContext > env , TypeSymbol pck , Name name , int kind ) { } }
Name fullname = TypeSymbol . formFullName ( name , pck ) ; Symbol bestSoFar = typeNotFound ; PackageSymbol pack = null ; if ( ( kind & PCK ) != 0 ) { pack = reader . enterPackage ( fullname ) ; if ( pack . exists ( ) ) return pack ; } if ( ( kind & TYP ) != 0 ) { Symbol sym = loadClass ( env , fullname ) ; if ( sym . exists ( ) ) { // don ' t allow programs to use flatnames if ( name == sym . name ) return sym ; } else if ( sym . kind < bestSoFar . kind ) bestSoFar = sym ; } return ( pack != null ) ? pack : bestSoFar ;
public class NamecoinGetNameOperationUDF { /** * Analyzes txOutScript ( ScriptPubKey ) of an output of a Namecoin Transaction to determine the name operation ( if any ) * @ param input BytesWritable containing a txOutScript of a Namecoin Transaction * @ return Text containing the type of name operation , cf . NamecoinUtil . getNameOperation */ public Text evaluate ( BytesWritable input ) { } }
String nameOperation = NamecoinUtil . getNameOperation ( input . copyBytes ( ) ) ; return new Text ( nameOperation ) ;
public class UpdateAction { /** * Returns the attribute as a string , substituted if necessary with tokens * using the given substitution context . */ @ Override String asSubstituted ( SubstitutionContext context ) { } }
return value == null ? attribute . asSubstituted ( context ) : attribute . asSubstituted ( context ) + " " + value . asSubstituted ( context ) ;
public class AbstractAttributeDefinitionBuilder { /** * Sets the { @ link AttributeDefinition # getXmlName ( ) xml name } for the attribute , which is only needed * if the name used for the attribute is different from its ordinary * { @ link AttributeDefinition # getName ( ) name in the model } . If not set the default value is the name * passed to the builder constructor . * @ param xmlName the xml name . { @ code null } is allowed * @ return a builder that can be used to continue building the attribute definition */ public BUILDER setXmlName ( String xmlName ) { } }
// noinspection deprecation this . xmlName = xmlName == null ? this . name : xmlName ; return ( BUILDER ) this ;
public class Utils { /** * encrypts a password * protocol for authentication is like this : 1 . mysql server sends a random array of bytes ( the seed ) 2 . client * makes a sha1 digest of the password 3 . client hashes the output of 2 4 . client digests the seed 5 . client updates * the digest with the output from 3 6 . an xor of the output of 5 and 2 is sent to server 7 . server does the same * thing and verifies that the scrambled passwords match * @ param password the password to encrypt * @ param seed the seed to use * @ return a scrambled password * @ throws NoSuchAlgorithmException if SHA1 is not available on the platform we are using */ public static byte [ ] encryptPassword ( final String password , final byte [ ] seed ) throws NoSuchAlgorithmException { } }
if ( password == null || password . equals ( "" ) ) { return new byte [ 0 ] ; } final MessageDigest messageDigest = MessageDigest . getInstance ( "SHA-1" ) ; final byte [ ] stage1 = messageDigest . digest ( password . getBytes ( ) ) ; messageDigest . reset ( ) ; final byte [ ] stage2 = messageDigest . digest ( stage1 ) ; messageDigest . reset ( ) ; messageDigest . update ( seed ) ; messageDigest . update ( stage2 ) ; final byte [ ] digest = messageDigest . digest ( ) ; final byte [ ] returnBytes = new byte [ digest . length ] ; for ( int i = 0 ; i < digest . length ; i ++ ) { returnBytes [ i ] = ( byte ) ( stage1 [ i ] ^ digest [ i ] ) ; } return returnBytes ;
public class PhotosetsApi { /** * Set the order of photosets for the calling user . * < br > * This method requires authentication with ' write ' permission . * < br > * Note : This method requires an HTTP POST request . * @ param photosetIds a list containing photoset IDs , ordered with the set to show first , first in the list . Any set IDs * not given in the list will be set to appear at the end of the list , ordered by their IDs . * @ return an empty success response if it completes without error . * @ throws JinxException if the list of photoset id ' s is null or empty , or if there are any errors . * @ see < a href = " https : / / www . flickr . com / services / api / flickr . photosets . orderSets . html " > flickr . photosets . orderSets < / a > */ public Response orderSets ( List < String > photosetIds ) throws JinxException { } }
JinxUtils . validateParams ( photosetIds ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.photosets.orderSets" ) ; params . put ( "photoset_ids" , JinxUtils . buildCommaDelimitedList ( photosetIds ) ) ; return jinx . flickrPost ( params , Response . class ) ;
public class ClassPath { public Class < ? > loadClass ( String className , File classPathFile ) throws IOException , ClassFormatError { } }
byte [ ] classBytes = loadClassBytes ( classPathFile ) ; Class < ? > result = defineClass ( className , classBytes , 0 , classBytes . length , null ) ; classes . put ( className , result ) ; return result ;
public class ApplicationContext { /** * Compatibility for disparities in mdw - central hosting mechanism . */ public static String getCentralServicesUrl ( ) { } }
String centralServicesUrl = getMdwCentralUrl ( ) ; if ( centralServicesUrl != null && centralServicesUrl . endsWith ( "/central" ) ) centralServicesUrl = centralServicesUrl . substring ( 0 , centralServicesUrl . length ( ) - 8 ) ; return centralServicesUrl ;
public class WalletApi { /** * Get corporation wallet journal Retrieve the given corporation & # 39 ; s * wallet journal for the given division going 30 days back - - - This route * is cached for up to 3600 seconds - - - Requires one of the following EVE * corporation role ( s ) : Accountant , Junior _ Accountant SSO Scope : * esi - wallet . read _ corporation _ wallets . v1 * @ param corporationId * An EVE corporation ID ( required ) * @ param division * Wallet key of the division to fetch journals from ( 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 page * Which page of results to return ( optional , default to 1) * @ param token * Access token to use if unable to set a header ( optional ) * @ return List & lt ; CorporationWalletJournalResponse & gt ; * @ throws ApiException * If fail to call the API , e . g . server error or cannot * deserialize the response body */ public List < CorporationWalletJournalResponse > getCorporationsCorporationIdWalletsDivisionJournal ( Integer corporationId , Integer division , String datasource , String ifNoneMatch , Integer page , String token ) throws ApiException { } }
ApiResponse < List < CorporationWalletJournalResponse > > resp = getCorporationsCorporationIdWalletsDivisionJournalWithHttpInfo ( corporationId , division , datasource , ifNoneMatch , page , token ) ; return resp . getData ( ) ;
public class RedisClient { /** * Open a new synchronous connection to the redis server . Use the supplied * { @ link RedisCodec codec } to encode / decode keys and values . * @ param codec Use this codec to encode / decode keys and values . * @ return A new connection . */ public < K , V > RedisConnection < K , V > connect ( RedisCodec < K , V > codec ) { } }
return new RedisConnection < K , V > ( connectAsync ( codec ) ) ;
public class Range { /** * Calculate the intersection of { @ code this } and an overlapping Range . * @ param other overlapping Range * @ return range representing the intersection of { @ code this } and { @ code other } ( { @ code this } if equal ) * @ throws IllegalArgumentException if { @ code other } does not overlap { @ code this } * @ since 3.0.1 */ public Range < T > intersectionWith ( final Range < T > other ) { } }
if ( ! this . isOverlappedBy ( other ) ) { throw new IllegalArgumentException ( StringUtils . simpleFormat ( "Cannot calculate intersection with non-overlapping range %s" , other ) ) ; } if ( this . equals ( other ) ) { return this ; } final T min = getComparator ( ) . compare ( minimum , other . minimum ) < 0 ? other . minimum : minimum ; final T max = getComparator ( ) . compare ( maximum , other . maximum ) < 0 ? maximum : other . maximum ; return between ( min , max , getComparator ( ) ) ;
public class CertificateLoginModule { /** * { @ inheritDoc } */ @ Override public boolean commit ( ) throws LoginException { } }
if ( authenticatedId == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Authentication did not occur for this login module, abstaining." ) ; return false ; } setUpSubject ( ) ; return true ;
public class SipCall { /** * This basic method is used to initiate an outgoing MESSAGE . * This method returns when the request message has been sent out . Your calling program must * subsequently call the waitOutgoingMessageResponse ( ) method ( one or more times ) to get the * result ( s ) . * If a DIALOG exists the method will use it to send the MESSAGE * @ param toUri The URI ( sip : bob @ nist . gov ) to which the message should be directed * @ param viaNonProxyRoute Indicates whether to route the MESSAGE via Proxy or some other route . * If null , route the call to the Proxy that was specified when the SipPhone object was * created ( SipStack . createSipPhone ( ) ) . Else route it to the given node , which is specified * as " hostaddress : port ; parms / transport " i . e . 129.1.22.333:5060 ; lr / UDP . * @ return true if the message was successfully sent , false otherwise . */ public boolean initiateOutgoingMessage ( String toUri , String viaNonProxyRoute ) { } }
return initiateOutgoingMessage ( null , toUri , viaNonProxyRoute , null , null , null ) ;
public class Metric { /** * Construct and print a message based on the timing and checkpoints . This * will look like " 123.456ms ( checkpoint1 = 100.228ms , checkpoint2 = 23.228ms ) " * without the quotes . There will be no spaces or tabs in the output . A * value of { @ code " metricsDisabled " } will be printed if { @ code false } was * passed in the constructor . * < p > This will automatically call the done ( ) method to stop the timer if * you haven ' t already done so . < / p > * @ param buf the message will be printed to this builder * @ see # getMessage ( ) */ public void printMessage ( StringBuilder buf ) { } }
if ( enabled ) { done ( ) ; writeNanos ( buf , lastCheckpointNanos - startNanos ) ; if ( ! checkpoints . isEmpty ( ) ) { buf . append ( "(" ) ; boolean first = true ; for ( Checkpoint checkpoint : checkpoints ) { if ( first ) { first = false ; } else { buf . append ( ',' ) ; } buf . append ( checkpoint . description ) ; if ( checkpoint . args != null && checkpoint . args . length > 0 ) { buf . append ( '[' ) ; boolean firstArg = true ; for ( Object o : checkpoint . args ) { if ( firstArg ) { firstArg = false ; } else { buf . append ( ',' ) ; } buf . append ( sanitizeArg ( String . valueOf ( o ) ) ) ; } buf . append ( ']' ) ; } buf . append ( '=' ) ; writeNanos ( buf , checkpoint . durationNanos ) ; } buf . append ( ')' ) ; } } else { buf . append ( "metricsDisabled" ) ; }
public class SDMath { /** * Element - wise ( broadcastable ) power function : out = x [ i ] ^ y [ i ] * @ param x Input variable * @ param y Power * @ return Output variable */ public SDVariable pow ( SDVariable x , SDVariable y ) { } }
return pow ( null , x , y ) ;
public class AnnotationTypeBuilder { /** * Copy the doc files for the current ClassDoc if necessary . */ private void copyDocFiles ( ) { } }
PackageDoc containingPackage = annotationTypeDoc . containingPackage ( ) ; if ( ( configuration . packages == null || Arrays . binarySearch ( configuration . packages , containingPackage ) < 0 ) && ! containingPackagesSeen . contains ( containingPackage . name ( ) ) ) { // Only copy doc files dir if the containing package is not // documented AND if we have not documented a class from the same // package already . Otherwise , we are making duplicate copies . Util . copyDocFiles ( configuration , containingPackage ) ; containingPackagesSeen . add ( containingPackage . name ( ) ) ; }
public class DateTimeFormatter { /** * Prints an instant from milliseconds since 1970-01-01T00:00:00Z , * using ISO chronology in the default DateTimeZone . * @ param buf the destination to format to , not null * @ param instant millis since 1970-01-01T00:00:00Z */ public void printTo ( StringBuffer buf , long instant ) { } }
try { printTo ( ( Appendable ) buf , instant ) ; } catch ( IOException ex ) { // StringBuffer does not throw IOException }
public class Tokenizer { /** * Get the current part as substring * @ return Current value as substring . */ public String getStrippedSubstring ( ) { } }
// TODO : detect Java < 6 and make sure we only return the substring ? // With java 7 , String . substring will arraycopy the characters . int sstart = start , send = end ; while ( sstart < send ) { char c = input . charAt ( sstart ) ; if ( c != ' ' || c != '\n' || c != '\r' || c != '\t' ) { break ; } ++ sstart ; } while ( -- send >= sstart ) { char c = input . charAt ( send ) ; if ( c != ' ' || c != '\n' || c != '\r' || c != '\t' ) { break ; } } ++ send ; return ( sstart < send ) ? input . subSequence ( sstart , send ) . toString ( ) : "" ;
public class FessMessages { /** * Add the created action message for the key ' errors . failed _ to _ download _ stopwords _ file ' with parameters . * < pre > * message : Failed to download the Stopwords file . * < / pre > * @ param property The property name for the message . ( NotNull ) * @ return this . ( NotNull ) */ public FessMessages addErrorsFailedToDownloadStopwordsFile ( String property ) { } }
assertPropertyNotNull ( property ) ; add ( property , new UserMessage ( ERRORS_failed_to_download_stopwords_file ) ) ; return this ;
public class AlbumActivity { /** * Use different layouts depending on the style . * @ return layout id . */ private int createView ( ) { } }
switch ( mWidget . getUiStyle ( ) ) { case Widget . STYLE_DARK : { return R . layout . album_activity_album_dark ; } case Widget . STYLE_LIGHT : { return R . layout . album_activity_album_light ; } default : { throw new AssertionError ( "This should not be the case." ) ; } }
public class BenchmarkInliningGetSet { /** * Get by index is used here . */ public static long get1D ( DMatrixRMaj A , int n ) { } }
long before = System . currentTimeMillis ( ) ; double total = 0 ; for ( int iter = 0 ; iter < n ; iter ++ ) { int index = 0 ; for ( int i = 0 ; i < A . numRows ; i ++ ) { int end = index + A . numCols ; while ( index != end ) { total += A . get ( index ++ ) ; } } } long after = System . currentTimeMillis ( ) ; // print to ensure that ensure that an overly smart compiler does not optimize out // the whole function and to show that both produce the same results . System . out . println ( total ) ; return after - before ;
public class WaitStrategies { /** * Returns a strategy which sleeps for an exponential amount of time after the first failed attempt , * and in exponentially incrementing amounts after each failed attempt up to the maximumTime . * @ param maximumTime the maximum time to sleep * @ param maximumTimeUnit the unit of the maximum time * @ return a wait strategy that increments with each failed attempt using exponential backoff */ public static WaitStrategy exponentialWait ( long maximumTime , @ Nonnull TimeUnit maximumTimeUnit ) { } }
Preconditions . checkNotNull ( maximumTimeUnit , "The maximum time unit may not be null" ) ; return new ExponentialWaitStrategy ( 1 , maximumTimeUnit . toMillis ( maximumTime ) ) ;
public class BytesOutputStream { /** * Returns the reference to the output buffer . * @ return the reference to the < tt > byte [ ] < / tt > output buffer . */ public synchronized byte [ ] getBuffer ( ) { } }
byte [ ] dest = new byte [ buf . length ] ; System . arraycopy ( buf , 0 , dest , 0 , dest . length ) ; return dest ;
public class AgreementEvaluator { /** * Evaluate if the detected violations imply any compensation . * @ param agreement Agreement to evaluate . * @ param violationsMap Contains the list of metrics to check for each guarantee term . * @ return list of violations and compensations detected . */ public Map < IGuaranteeTerm , GuaranteeTermEvaluationResult > evaluateBusiness ( IAgreement agreement , Map < IGuaranteeTerm , List < IViolation > > violationsMap ) { } }
checkInitialized ( false ) ; Map < IGuaranteeTerm , GuaranteeTermEvaluationResult > result = new HashMap < IGuaranteeTerm , GuaranteeTermEvaluationResult > ( ) ; Date now = new Date ( ) ; for ( IGuaranteeTerm term : violationsMap . keySet ( ) ) { List < IViolation > violations = violationsMap . get ( term ) ; if ( violations . size ( ) > 0 ) { GuaranteeTermEvaluationResult aux = termEval . evaluateBusiness ( agreement , term , violations , now ) ; result . put ( term , aux ) ; } } return result ;
public class CmsErrorUI { /** * Sets the error attributes to the current session . < p > * @ param cms the cms context * @ param throwable the throwable * @ param request the current request */ private static void setErrorAttributes ( CmsObject cms , Throwable throwable , HttpServletRequest request ) { } }
String errorUri = CmsFlexController . getThrowableResourceUri ( request ) ; if ( errorUri == null ) { errorUri = cms . getRequestContext ( ) . getUri ( ) ; } // try to get the exception root cause Throwable cause = CmsFlexController . getThrowable ( request ) ; if ( cause == null ) { cause = throwable ; } request . getSession ( ) . setAttribute ( THROWABLE , cause ) ; request . getSession ( ) . setAttribute ( PATH , errorUri ) ;
public class QueryChemObject { /** * { @ inheritDoc } */ @ Override public void setFlags ( boolean [ ] flagsNew ) { } }
for ( int i = 0 ; i < flagsNew . length ; i ++ ) setFlag ( CDKConstants . FLAG_MASKS [ i ] , flagsNew [ i ] ) ;
public class Subcursor { /** * Return the next item that is deemed a match by the filter specified when the cursor * was created . Items returned by this method are locked . * @ throws SevereMessageStoreException */ public final AbstractItem next ( long lockID ) throws SevereMessageStoreException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "next" , Long . valueOf ( lockID ) ) ; final AbstractItemLink lockedMatchingLink = _next ( lockID ) ; // retrieve the item from the link AbstractItem lockedMatchingItem = null ; if ( null != lockedMatchingLink ) { lockedMatchingItem = lockedMatchingLink . getItem ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "next" , lockedMatchingItem ) ; return lockedMatchingItem ;
public class ApiPreprocessingContext { /** * Runs preprocessing on the specified object . * @ param object the object to preprocess * @ return a result object indicating whether the preprocessing chain completed successfully and * containing the errors collected during preprocessing ( note that a successful chain may * produce errors such as validation errors ) * @ throws ApiErrorsException if any of the preprocessors adds errors to the error collector */ public ApiPreprocessingContext process ( Object object ) throws ApiErrorsException { } }
if ( result != null ) { throw new IllegalStateException ( "This preprocessing context has already been used; create another one." ) ; } result = preprocessor . process ( object , this ) ; if ( failOnErrors && apiErrorResponse . hasErrors ( ) ) { throw new ApiErrorsException ( apiErrorResponse ) ; } return this ;
public class Annotations { /** * Returns a builder that can be used to construct an annotation instance . */ public static < T extends Annotation > Builder < T > builder ( Class < T > annotationType ) { } }
return new Builder < T > ( annotationType ) ;
public class XmlString { /** * Sets the string for this XML component . Sets the length of the * component to the length of the passed string . * @ param s a string of xml text * @ throws IllegalArgumentException } if { @ code s } is { @ code null } */ public void setXml ( String s ) { } }
assertNotNull ( s ) ; xml = s ; setLength ( s . length ( ) ) ;
public class SpringLoadedPreProcessor { /** * This method tries to inject the ReflectiveInterceptor methods into any system types that have been rewritten . */ private void injectReflectiveInterceptorMethods ( String slashedClassName , int bits , Class < ? > clazz ) throws NoSuchFieldException , IllegalAccessException , NoSuchMethodException { } }
// TODO log the bits if ( ( bits & Constants . JLC_GETDECLAREDFIELDS ) != 0 ) { Field f = clazz . getDeclaredField ( "__sljlcgdfs" ) ; f . setAccessible ( true ) ; f . set ( null , method_jlcgdfs ) ; } if ( ( bits & Constants . JLC_GETDECLAREDFIELD ) != 0 ) { Field f = clazz . getDeclaredField ( jlcgdf ) ; f . setAccessible ( true ) ; f . set ( null , method_jlcgdf ) ; } if ( ( bits & Constants . JLC_GETFIELD ) != 0 ) { Field f = clazz . getDeclaredField ( jlcgf ) ; f . setAccessible ( true ) ; f . set ( null , method_jlcgf ) ; } if ( ( bits & Constants . JLC_GETDECLAREDMETHODS ) != 0 ) { Field f = clazz . getDeclaredField ( jlcgdms ) ; f . setAccessible ( true ) ; f . set ( null , method_jlcgdms ) ; } if ( ( bits & Constants . JLC_GETDECLAREDMETHOD ) != 0 ) { Field f = clazz . getDeclaredField ( jlcgdm ) ; f . setAccessible ( true ) ; f . set ( null , method_jlcgdm ) ; } if ( ( bits & Constants . JLC_GETMETHOD ) != 0 ) { Field f = clazz . getDeclaredField ( jlcgm ) ; f . setAccessible ( true ) ; f . set ( null , method_jlcgm ) ; } if ( ( bits & Constants . JLC_GETDECLAREDCONSTRUCTOR ) != 0 ) { Field f = clazz . getDeclaredField ( jlcgdc ) ; f . setAccessible ( true ) ; f . set ( null , method_jlcgdc ) ; } if ( ( bits & Constants . JLC_GETMODIFIERS ) != 0 ) { Field f = clazz . getDeclaredField ( jlcgmods ) ; f . setAccessible ( true ) ; f . set ( null , method_jlcgmods ) ; } if ( ( bits & Constants . JLC_GETMETHODS ) != 0 ) { Field f = clazz . getDeclaredField ( jlcgms ) ; f . setAccessible ( true ) ; f . set ( null , method_jlcgms ) ; } if ( ( bits & Constants . JLC_GETCONSTRUCTOR ) != 0 ) { Field f = clazz . getDeclaredField ( jlcgc ) ; f . setAccessible ( true ) ; f . set ( null , method_jlcgc ) ; } if ( ( bits & Constants . JLC_GETDECLAREDCONSTRUCTORS ) != 0 ) { Field f = clazz . getDeclaredField ( jlcGetDeclaredConstructorsMember ) ; f . setAccessible ( true ) ; f . set ( null , method_jlcgdcs ) ; } if ( ( bits & Constants . JLRF_GET ) != 0 ) { Field f = clazz . getDeclaredField ( jlrfGetMember ) ; f . setAccessible ( true ) ; f . set ( null , method_jlrfg ) ; } if ( ( bits & Constants . JLRF_GETLONG ) != 0 ) { Field f = clazz . getDeclaredField ( jlrfGetLongMember ) ; f . setAccessible ( true ) ; f . set ( null , method_jlrfgl ) ; } if ( ( bits & Constants . JLRM_INVOKE ) != 0 ) { Field f = clazz . getDeclaredField ( jlrmInvokeMember ) ; f . setAccessible ( true ) ; f . set ( null , method_jlrmi ) ; } if ( ( bits & Constants . JLOS_HASSTATICINITIALIZER ) != 0 ) { Field f = clazz . getDeclaredField ( jloObjectStream_hasInitializerMethod ) ; f . setAccessible ( true ) ; f . set ( null , method_jloObjectStream_hasInitializerMethod ) ; }
public class ErrorInterceptor { /** * Intercepts chain to check for unsuccessful requests . * @ param chain provided by the framework to check * @ return the response if no error occurred * @ throws IOException will get thrown if response code is unsuccessful */ @ Override public Response intercept ( Chain chain ) throws IOException { } }
final Request request = chain . request ( ) ; final Response response = chain . proceed ( request ) ; if ( ! response . isSuccessful ( ) ) { throw new CMAHttpException ( request , response ) ; } return response ;
public class CreateWSDL { /** * GetURIValue Method . */ public String getURIValue ( String strValue ) { } }
String strBaseURI = ( ( PropertiesField ) this . getRecord ( MessageControl . MESSAGE_CONTROL_FILE ) . getField ( MessageControl . PROPERTIES ) ) . getProperty ( MessageControl . BASE_NAMESPACE_URI ) ; if ( strBaseURI == null ) { strBaseURI = this . getProperty ( DBParams . BASE_URL ) ; // Defaults to same site as wsdl if ( strBaseURI != null ) if ( strBaseURI . endsWith ( "/" ) ) strBaseURI = strBaseURI . substring ( 0 , strBaseURI . length ( ) - 1 ) ; } if ( strBaseURI != null ) if ( strBaseURI . indexOf ( "http://" ) != 0 ) strBaseURI = "http://" + strBaseURI ; if ( strBaseURI != null ) { if ( strValue == null ) strValue = strBaseURI ; else if ( ( strValue . indexOf ( "http://" ) != 0 ) || ( strValue . startsWith ( "/" ) ) ) strValue = strBaseURI + strValue ; } return strValue ;
public class Group { /** * Returns the group ' s size - internal impl */ private int get_size_i ( final boolean fwd ) { } }
int size = 0 ; final Iterator it = elements . iterator ( ) ; while ( it . hasNext ( ) ) { final GroupElement e = ( GroupElement ) it . next ( ) ; if ( e instanceof GroupDeviceElement || fwd ) { size += e . get_size ( true ) ; } } return size ;
public class SideEffectConstructor { /** * overrides the visitor to reset the state and reset the opcode stack * @ param obj * the context object of the currently parsed code */ @ Override public void visitCode ( Code obj ) { } }
state = State . SAW_NOTHING ; stack . resetForMethodEntry ( this ) ; super . visitCode ( obj ) ;
public class syslog_server { /** * < pre > * Performs generic data validation for the operation to be performed * < / pre > */ protected void validate ( String operationType ) throws Exception { } }
super . validate ( operationType ) ; MPSString name_validator = new MPSString ( ) ; name_validator . setConstraintCharSetRegEx ( MPSConstants . GENERIC_CONSTRAINT , "[a-zA-Z0-9_#.:@=-]+" ) ; name_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 128 ) ; name_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; name_validator . validate ( operationType , name , "\"name\"" ) ; MPSIPAddress ip_address_validator = new MPSIPAddress ( ) ; ip_address_validator . validate ( operationType , ip_address , "\"ip_address\"" ) ; MPSInt port_validator = new MPSInt ( ) ; port_validator . setConstraintMaxValue ( MPSConstants . GENERIC_CONSTRAINT , 65535 ) ; port_validator . validate ( operationType , port , "\"port\"" ) ; MPSBoolean log_level_all_validator = new MPSBoolean ( ) ; log_level_all_validator . validate ( operationType , log_level_all , "\"log_level_all\"" ) ; MPSBoolean log_level_none_validator = new MPSBoolean ( ) ; log_level_none_validator . validate ( operationType , log_level_none , "\"log_level_none\"" ) ; MPSBoolean log_level_emergency_validator = new MPSBoolean ( ) ; log_level_emergency_validator . validate ( operationType , log_level_emergency , "\"log_level_emergency\"" ) ; MPSBoolean log_level_alert_validator = new MPSBoolean ( ) ; log_level_alert_validator . validate ( operationType , log_level_alert , "\"log_level_alert\"" ) ; MPSBoolean log_level_critical_validator = new MPSBoolean ( ) ; log_level_critical_validator . validate ( operationType , log_level_critical , "\"log_level_critical\"" ) ; MPSBoolean log_level_error_validator = new MPSBoolean ( ) ; log_level_error_validator . validate ( operationType , log_level_error , "\"log_level_error\"" ) ; MPSBoolean log_level_warning_validator = new MPSBoolean ( ) ; log_level_warning_validator . validate ( operationType , log_level_warning , "\"log_level_warning\"" ) ; MPSBoolean log_level_notice_validator = new MPSBoolean ( ) ; log_level_notice_validator . validate ( operationType , log_level_notice , "\"log_level_notice\"" ) ; MPSBoolean log_level_info_validator = new MPSBoolean ( ) ; log_level_info_validator . validate ( operationType , log_level_info , "\"log_level_info\"" ) ; MPSBoolean log_level_debug_validator = new MPSBoolean ( ) ; log_level_debug_validator . validate ( operationType , log_level_debug , "\"log_level_debug\"" ) ; MPSString log_levels_validator = new MPSString ( ) ; log_levels_validator . validate ( operationType , log_levels , "\"log_levels\"" ) ;
public class EtcdClient { /** * Get the Store Statistics of Etcd * @ return vEtcdStoreStatsResponse */ public EtcdStoreStatsResponse getStoreStats ( ) { } }
try { return new EtcdStoreStatsRequest ( this . client , retryHandler ) . send ( ) . get ( ) ; } catch ( IOException | EtcdException | EtcdAuthenticationException | TimeoutException e ) { return null ; }
public class XmlStreamReaderUtils { /** * Returns the value of an attribute as a short . If the attribute is empty , this method returns * the default value provided . * @ param reader * < code > XMLStreamReader < / code > that contains attribute values . * @ param namespace * String * @ param localName * local name of attribute ( the namespace is ignored ) . * @ param defaultValue * default value * @ return value of attribute , or the default value if the attribute is empty . */ public static short optionalShortAttribute ( final XMLStreamReader reader , final String namespace , final String localName , final short defaultValue ) { } }
final String value = reader . getAttributeValue ( namespace , localName ) ; if ( value != null ) { return Short . parseShort ( value ) ; } return defaultValue ;
public class Normalizer { /** * Convenience method that can have faster implementation * by not allocating buffers . * @ param char32a the first code point to be checked against * @ param str2 the second string * @ param options A bit set of options */ public static int compare ( int char32a , String str2 , int options ) { } }
return internalCompare ( UTF16 . valueOf ( char32a ) , str2 , options ) ;
public class KTypeArrayList { /** * { @ inheritDoc } */ @ Override public int removeLast ( KType e1 ) { } }
final int index = lastIndexOf ( e1 ) ; if ( index >= 0 ) remove ( index ) ; return index ;
public class DefaultGroovyMethods { /** * Create an array containing elements from an original array plus those from a Collection . * < pre class = " groovyTestCase " > * Integer [ ] a = [ 1 , 2 , 3] * def additions = [ 7 , 8] * assert a + additions = = [ 1 , 2 , 3 , 7 , 8 ] as Integer [ ] * < / pre > * @ param left the array * @ param right a Collection to be appended * @ return A new array containing left with right appended to it . * @ since 1.8.7 */ @ SuppressWarnings ( "unchecked" ) public static < T > T [ ] plus ( T [ ] left , Collection < T > right ) { } }
return ( T [ ] ) plus ( ( List < T > ) toList ( left ) , ( Collection < T > ) right ) . toArray ( ) ;
public class BiInt2ObjectMap { /** * Put a value into the map . * @ param keyPartA for the key * @ param keyPartB for the key * @ param value to put into the map * @ return the previous value if found otherwise null */ @ SuppressWarnings ( "unchecked" ) public V put ( final int keyPartA , final int keyPartB , final V value ) { } }
final long key = compoundKey ( keyPartA , keyPartB ) ; V oldValue = null ; final int mask = values . length - 1 ; int index = Hashing . hash ( key , mask ) ; while ( null != values [ index ] ) { if ( key == keys [ index ] ) { oldValue = ( V ) values [ index ] ; break ; } index = ++ index & mask ; } if ( null == oldValue ) { ++ size ; keys [ index ] = key ; } values [ index ] = value ; if ( size > resizeThreshold ) { increaseCapacity ( ) ; } return oldValue ;
public class RolloutHelper { /** * Creates an RSQL Filter that matches all targets that are in the provided * group and in the provided groups . * @ param baseFilter * the base filter from the rollout * @ param groups * the rollout groups * @ param group * the target group * @ return RSQL string without base filter of the Rollout . Can be an empty * string . */ public static String getOverlappingWithGroupsTargetFilter ( final String baseFilter , final List < RolloutGroup > groups , final RolloutGroup group ) { } }
final String groupFilter = group . getTargetFilterQuery ( ) ; // when any previous group has the same filter as the target group the // overlap is 100% if ( isTargetFilterInGroups ( groupFilter , groups ) ) { return concatAndTargetFilters ( baseFilter , groupFilter ) ; } final String previousGroupFilters = getAllGroupsTargetFilter ( groups ) ; if ( ! StringUtils . isEmpty ( previousGroupFilters ) ) { if ( ! StringUtils . isEmpty ( groupFilter ) ) { return concatAndTargetFilters ( baseFilter , groupFilter , previousGroupFilters ) ; } else { return concatAndTargetFilters ( baseFilter , previousGroupFilters ) ; } } if ( ! StringUtils . isEmpty ( groupFilter ) ) { return concatAndTargetFilters ( baseFilter , groupFilter ) ; } else { return baseFilter ; }
public class WxaAPI { /** * 代码管理 < br > * 将第三方提交的代码包提交审核 ( 仅供第三方开发者代小程序调用 ) * @ since 2.8.9 * @ param access _ token access _ token * @ param submitAudit submitAudit * @ return result */ public static SubmitAuditResult submit_audit ( String access_token , SubmitAudit submitAudit ) { } }
String json = JsonUtil . toJSONString ( submitAudit ) ; HttpUriRequest httpUriRequest = RequestBuilder . post ( ) . setHeader ( jsonHeader ) . setUri ( BASE_URI + "/wxa/submit_audit" ) . addParameter ( PARAM_ACCESS_TOKEN , API . accessToken ( access_token ) ) . setEntity ( new StringEntity ( json , Charset . forName ( "utf-8" ) ) ) . build ( ) ; return LocalHttpClient . executeJsonResult ( httpUriRequest , SubmitAuditResult . class ) ;
public class OpenAPIModelFilterAdapter { /** * { @ inheritDoc } */ @ Override public Parameter visitParameter ( Context context , String key , Parameter p ) { } }
visitor . visitParameter ( context , key , p ) ; return p ;
public class HiveAvroORCQueryGenerator { /** * Generate DDL query to create a different format ( default : ORC ) Hive table for a given Avro Schema * @ param schema Avro schema to use to generate the DDL for new Hive table * @ param tblName New Hive table name * @ param tblLocation New hive table location * @ param optionalDbName Optional DB name , if not specified it defaults to ' default ' * @ param optionalPartitionDDLInfo Optional partition info in form of map of partition key , partition type pair * If not specified , the table is assumed to be un - partitioned ie of type snapshot * @ param optionalClusterInfo Optional cluster info * @ param optionalSortOrderInfo Optional sort order * @ param optionalNumOfBuckets Optional number of buckets * @ param optionalRowFormatSerde Optional row format serde , default is ORC * @ param optionalInputFormat Optional input format serde , default is ORC * @ param optionalOutputFormat Optional output format serde , default is ORC * @ param tableProperties Optional table properties * @ param isEvolutionEnabled If schema evolution is turned on * @ param destinationTableMeta Optional destination table metadata @ return Generated DDL query to create new Hive table */ public static String generateCreateTableDDL ( Schema schema , String tblName , String tblLocation , Optional < String > optionalDbName , Optional < Map < String , String > > optionalPartitionDDLInfo , Optional < List < String > > optionalClusterInfo , Optional < Map < String , COLUMN_SORT_ORDER > > optionalSortOrderInfo , Optional < Integer > optionalNumOfBuckets , Optional < String > optionalRowFormatSerde , Optional < String > optionalInputFormat , Optional < String > optionalOutputFormat , Properties tableProperties , boolean isEvolutionEnabled , Optional < Table > destinationTableMeta , Map < String , String > hiveColumns ) { } }
Preconditions . checkNotNull ( schema ) ; Preconditions . checkArgument ( StringUtils . isNotBlank ( tblName ) ) ; Preconditions . checkArgument ( StringUtils . isNotBlank ( tblLocation ) ) ; String dbName = optionalDbName . isPresent ( ) ? optionalDbName . get ( ) : DEFAULT_DB_NAME ; String rowFormatSerde = optionalRowFormatSerde . isPresent ( ) ? optionalRowFormatSerde . get ( ) : DEFAULT_ROW_FORMAT_SERDE ; String inputFormat = optionalInputFormat . isPresent ( ) ? optionalInputFormat . get ( ) : DEFAULT_ORC_INPUT_FORMAT ; String outputFormat = optionalOutputFormat . isPresent ( ) ? optionalOutputFormat . get ( ) : DEFAULT_ORC_OUTPUT_FORMAT ; tableProperties = getTableProperties ( tableProperties ) ; // Start building Hive DDL // Refer to Hive DDL manual for explanation of clauses : // https : / / cwiki . apache . org / confluence / display / Hive / LanguageManual + DDL # LanguageManualDDL - Create / Drop / TruncateTable StringBuilder ddl = new StringBuilder ( ) ; // Create statement ddl . append ( String . format ( "CREATE EXTERNAL TABLE IF NOT EXISTS `%s`.`%s` " , dbName , tblName ) ) ; // . . open bracket for CREATE ddl . append ( "( \n" ) ; // 1 . If evolution is enabled , and destination table does not exists // . . use columns from new schema // ( evolution does not matter if its new destination table ) // 2 . If evolution is enabled , and destination table does exists // . . use columns from new schema // ( alter table will be used before moving data from staging to final table ) // 3 . If evolution is disabled , and destination table does not exists // . . use columns from new schema // ( evolution does not matter if its new destination table ) // 4 . If evolution is disabled , and destination table does exists // . . use columns from destination schema if ( isEvolutionEnabled || ! destinationTableMeta . isPresent ( ) ) { log . info ( "Generating DDL using source schema" ) ; ddl . append ( generateAvroToHiveColumnMapping ( schema , Optional . of ( hiveColumns ) , true , dbName + "." + tblName ) ) ; } else { log . info ( "Generating DDL using destination schema" ) ; ddl . append ( generateDestinationToHiveColumnMapping ( Optional . of ( hiveColumns ) , destinationTableMeta . get ( ) ) ) ; } // . . close bracket for CREATE ddl . append ( ") \n" ) ; // Partition info if ( optionalPartitionDDLInfo . isPresent ( ) && optionalPartitionDDLInfo . get ( ) . size ( ) > 0 ) { ddl . append ( "PARTITIONED BY ( " ) ; boolean isFirst = true ; Map < String , String > partitionInfoMap = optionalPartitionDDLInfo . get ( ) ; for ( Map . Entry < String , String > partitionInfo : partitionInfoMap . entrySet ( ) ) { if ( isFirst ) { isFirst = false ; } else { ddl . append ( ", " ) ; } ddl . append ( String . format ( "`%s` %s" , partitionInfo . getKey ( ) , partitionInfo . getValue ( ) ) ) ; } ddl . append ( " ) \n" ) ; } if ( optionalClusterInfo . isPresent ( ) ) { if ( ! optionalNumOfBuckets . isPresent ( ) ) { throw new IllegalArgumentException ( ( String . format ( "CLUSTERED BY requested, but no NUM_BUCKETS specified for table %s.%s" , dbName , tblName ) ) ) ; } ddl . append ( "CLUSTERED BY ( " ) ; boolean isFirst = true ; for ( String clusterByCol : optionalClusterInfo . get ( ) ) { if ( ! hiveColumns . containsKey ( clusterByCol ) ) { throw new IllegalArgumentException ( String . format ( "Requested CLUSTERED BY column: %s " + "is not present in schema for table %s.%s" , clusterByCol , dbName , tblName ) ) ; } if ( isFirst ) { isFirst = false ; } else { ddl . append ( ", " ) ; } ddl . append ( String . format ( "`%s`" , clusterByCol ) ) ; } ddl . append ( " ) " ) ; if ( optionalSortOrderInfo . isPresent ( ) && optionalSortOrderInfo . get ( ) . size ( ) > 0 ) { Map < String , COLUMN_SORT_ORDER > sortOrderInfoMap = optionalSortOrderInfo . get ( ) ; ddl . append ( "SORTED BY ( " ) ; isFirst = true ; for ( Map . Entry < String , COLUMN_SORT_ORDER > sortOrderInfo : sortOrderInfoMap . entrySet ( ) ) { if ( ! hiveColumns . containsKey ( sortOrderInfo . getKey ( ) ) ) { throw new IllegalArgumentException ( String . format ( "Requested SORTED BY column: %s " + "is not present in schema for table %s.%s" , sortOrderInfo . getKey ( ) , dbName , tblName ) ) ; } if ( isFirst ) { isFirst = false ; } else { ddl . append ( ", " ) ; } ddl . append ( String . format ( "`%s` %s" , sortOrderInfo . getKey ( ) , sortOrderInfo . getValue ( ) ) ) ; } ddl . append ( " ) " ) ; } ddl . append ( String . format ( " INTO %s BUCKETS %n" , optionalNumOfBuckets . get ( ) ) ) ; } else { if ( optionalSortOrderInfo . isPresent ( ) ) { throw new IllegalArgumentException ( String . format ( "SORTED BY requested, but no CLUSTERED BY specified for table %s.%s" , dbName , tblName ) ) ; } } // Field Terminal ddl . append ( "ROW FORMAT SERDE \n" ) ; ddl . append ( String . format ( " '%s' %n" , rowFormatSerde ) ) ; // Stored as ORC ddl . append ( "STORED AS INPUTFORMAT \n" ) ; ddl . append ( String . format ( " '%s' %n" , inputFormat ) ) ; ddl . append ( "OUTPUTFORMAT \n" ) ; ddl . append ( String . format ( " '%s' %n" , outputFormat ) ) ; // Location ddl . append ( "LOCATION \n" ) ; ddl . append ( String . format ( " '%s' %n" , tblLocation ) ) ; // Table properties if ( null != tableProperties && tableProperties . size ( ) > 0 ) { ddl . append ( "TBLPROPERTIES ( \n" ) ; boolean isFirst = true ; for ( String property : tableProperties . stringPropertyNames ( ) ) { if ( isFirst ) { isFirst = false ; } else { ddl . append ( ", \n" ) ; } ddl . append ( String . format ( " '%s'='%s'" , property , tableProperties . getProperty ( property ) ) ) ; } ddl . append ( ") \n" ) ; } return ddl . toString ( ) ;
public class DescribeBundleTasksResult { /** * Information about the bundle tasks . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setBundleTasks ( java . util . Collection ) } or { @ link # withBundleTasks ( java . util . Collection ) } if you want to * override the existing values . * @ param bundleTasks * Information about the bundle tasks . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeBundleTasksResult withBundleTasks ( BundleTask ... bundleTasks ) { } }
if ( this . bundleTasks == null ) { setBundleTasks ( new com . amazonaws . internal . SdkInternalList < BundleTask > ( bundleTasks . length ) ) ; } for ( BundleTask ele : bundleTasks ) { this . bundleTasks . add ( ele ) ; } return this ;
public class LObjIntBoolPredicateBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */ @ Nonnull public static < T > LObjIntBoolPredicate < T > objIntBoolPredicateFrom ( Consumer < LObjIntBoolPredicateBuilder < T > > buildingFunction ) { } }
LObjIntBoolPredicateBuilder builder = new LObjIntBoolPredicateBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ;
public class HttpServletUtils { /** * Print all the headers * @ param req Incoming HttpServletRequest object */ public static void dumpHeaders ( final HttpServletRequest req ) { } }
Enumeration en = req . getHeaderNames ( ) ; while ( en . hasMoreElements ( ) ) { String name = ( String ) en . nextElement ( ) ; logger . debug ( name + ": " + req . getHeader ( name ) ) ; }
public class BlobContainersInner { /** * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy . The only action allowed on a Locked policy will be this action . ETag in If - Match is required for this operation . * @ param resourceGroupName The name of the resource group within the user ' s subscription . The name is case insensitive . * @ param accountName The name of the storage account within the specified resource group . Storage account names must be between 3 and 24 characters in length and use numbers and lower - case letters only . * @ param containerName The name of the blob container within the specified storage account . Blob container names must be between 3 and 63 characters in length and use numbers , lower - case letters and dash ( - ) only . Every dash ( - ) character must be immediately preceded and followed by a letter or number . * @ param ifMatch The entity state ( ETag ) version of the immutability policy to update . A value of " * " can be used to apply the operation only if the immutability policy already exists . If omitted , this operation will always be applied . * @ param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation , in days . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < ImmutabilityPolicyInner > extendImmutabilityPolicyAsync ( String resourceGroupName , String accountName , String containerName , String ifMatch , int immutabilityPeriodSinceCreationInDays , final ServiceCallback < ImmutabilityPolicyInner > serviceCallback ) { } }
return ServiceFuture . fromHeaderResponse ( extendImmutabilityPolicyWithServiceResponseAsync ( resourceGroupName , accountName , containerName , ifMatch , immutabilityPeriodSinceCreationInDays ) , serviceCallback ) ;
public class Criteria { /** * Crates new { @ link Predicate } with trailing wildcard for each entry * @ param values * @ return * @ throws InvalidDataAccessApiUsageException for strings with whitespace */ public Criteria startsWith ( Iterable < String > values ) { } }
Assert . notNull ( values , "Collection must not be null" ) ; for ( String value : values ) { startsWith ( value ) ; } return this ;
public class DateFormatDayFormatter { /** * { @ inheritDoc } */ @ Override @ NonNull public String format ( @ NonNull final CalendarDay day ) { } }
return dateFormat . format ( day . getDate ( ) ) ;
public class Tailer { /** * Creates and starts a Tailer for the given file . * @ param file * the file to follow . * @ param listener * the TailerListener to use . * @ param delayMillis * the delay between checks of the file for new content in * milliseconds . * @ param end * Set to true to tail from the end of the file , false to tail * from the beginning of the file . * @ param bufSize * buffer size . * @ return The new tailer */ public static Tailer create ( final File file , final TailerListener listener , final long delayMillis , final boolean end , final int bufSize ) { } }
return Tailer . create ( file , listener , delayMillis , end , false , bufSize ) ;
public class DiskId { /** * Returns a disk identity given the zone and disk names . The disk name must be 1-63 characters * long and comply with RFC1035 . Specifically , the name must match the regular expression { @ code * [ a - z ] ( [ - a - z0-9 ] * [ a - z0-9 ] ) ? } which means the first character must be a lowercase letter , and all * following characters must be a dash , lowercase letter , or digit , except the last character , * which cannot be a dash . * @ see < a href = " https : / / www . ietf . org / rfc / rfc1035 . txt " > RFC1035 < / a > */ public static DiskId of ( String zone , String disk ) { } }
return new DiskId ( null , zone , disk ) ;
public class ArrowButtonPainter { /** * Paint the arrow in pressed state . * @ param g the Graphics2D context to paint with . * @ param width the width . * @ param height the height . */ private void paintForegroundPressed ( Graphics2D g , int width , int height ) { } }
Shape s = decodeArrowPath ( width , height ) ; g . setPaint ( pressedColor ) ; g . fill ( s ) ;
public class ArmeriaConfigurationUtil { /** * Adds annotated HTTP services to the specified { @ link ServerBuilder } . */ public static void configureAnnotatedHttpServices ( ServerBuilder server , List < AnnotatedServiceRegistrationBean > beans , @ Nullable MeterIdPrefixFunctionFactory meterIdPrefixFunctionFactory ) { } }
requireNonNull ( server , "server" ) ; requireNonNull ( beans , "beans" ) ; beans . forEach ( bean -> { Function < Service < HttpRequest , HttpResponse > , ? extends Service < HttpRequest , HttpResponse > > decorator = Function . identity ( ) ; for ( Function < Service < HttpRequest , HttpResponse > , ? extends Service < HttpRequest , HttpResponse > > d : bean . getDecorators ( ) ) { decorator = decorator . andThen ( d ) ; } if ( meterIdPrefixFunctionFactory != null ) { decorator = decorator . andThen ( metricCollectingServiceDecorator ( bean , meterIdPrefixFunctionFactory ) ) ; } final ImmutableList < Object > exceptionHandlersAndConverters = ImmutableList . builder ( ) . addAll ( bean . getExceptionHandlers ( ) ) . addAll ( bean . getRequestConverters ( ) ) . addAll ( bean . getResponseConverters ( ) ) . build ( ) ; server . annotatedService ( bean . getPathPrefix ( ) , bean . getService ( ) , decorator , exceptionHandlersAndConverters ) ; } ) ;
public class BasicServer { /** * Ingests the given system object if it doesn ' t exist , OR if it * exists , but this instance of Fedora has never been started . * This ensures that , upon upgrade , the old system object * is replaced with the new one . */ private void preIngestIfNeeded ( boolean firstRun , DOManager doManager , RDFName objectName ) throws Exception { } }
PID pid = new PID ( objectName . uri . substring ( "info:fedora/" . length ( ) ) ) ; boolean exists = doManager . objectExists ( pid . toString ( ) ) ; if ( exists && firstRun ) { logger . info ( "Purging old system object: {}" , pid ) ; Context context = ReadOnlyContext . getContext ( null , null , null , false ) ; DOWriter w = doManager . getWriter ( USE_DEFINITIVE_STORE , context , pid . toString ( ) ) ; w . remove ( ) ; try { w . commit ( "Purged by Fedora at startup (to be re-ingested)" ) ; exists = false ; } finally { doManager . releaseWriter ( w ) ; } } if ( ! exists ) { logger . info ( "Ingesting new system object: {}" , pid ) ; InputStream xml = getStream ( "org/fcrepo/server/resources/" + pid . toFilename ( ) + ".xml" ) ; Context context = ReadOnlyContext . getContext ( null , null , null , false ) ; DOWriter w = doManager . getIngestWriter ( USE_DEFINITIVE_STORE , context , xml , Constants . FOXML1_1 . uri , "UTF-8" , null ) ; try { w . commit ( "Pre-ingested by Fedora at startup" ) ; } finally { doManager . releaseWriter ( w ) ; } }
public class Operators { /** * Fold two opcodes in a single int value ( if required ) . */ private int mergeOpcodes ( int ... opcodes ) { } }
int opcodesLen = opcodes . length ; Assert . check ( opcodesLen == 1 || opcodesLen == 2 ) ; return ( opcodesLen == 1 ) ? opcodes [ 0 ] : ( ( opcodes [ 0 ] << ByteCodes . preShift ) | opcodes [ 1 ] ) ;
public class GetFileInfoPRequest { /** * < code > optional . alluxio . grpc . file . GetFileInfoPOptions options = 2 ; < / code > */ public alluxio . grpc . GetFileInfoPOptionsOrBuilder getOptionsOrBuilder ( ) { } }
return options_ == null ? alluxio . grpc . GetFileInfoPOptions . getDefaultInstance ( ) : options_ ;
public class ResourceParametersImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EList < Parameter > getRole ( ) { } }
if ( role == null ) { role = new EObjectContainmentEList < Parameter > ( Parameter . class , this , BpsimPackage . RESOURCE_PARAMETERS__ROLE ) ; } return role ;
public class MessageDigestValue { /** * Create a new { @ link MessageDigestValue } object based on the passed source * byte array * @ param aBytes * The byte array to create the hash value from . May not be * < code > null < / code > . * @ param eAlgorithm * The algorithm to be used . May not be < code > null < / code > . * @ return Never < code > null < / code > . */ @ Nonnull public static MessageDigestValue create ( @ Nonnull final byte [ ] aBytes , @ Nonnull final EMessageDigestAlgorithm eAlgorithm ) { } }
final MessageDigest aMD = eAlgorithm . createMessageDigest ( ) ; aMD . update ( aBytes ) ; // aMD goes out of scope anyway , so no need to copy byte [ ] return new MessageDigestValue ( eAlgorithm , aMD . digest ( ) , false ) ;
public class ClassFile { /** * Returns the constant map index to reference * @ param refType * @ param fullyQualifiedname * @ param name * @ param descriptor * @ return */ protected int getRefIndex ( Class < ? extends Ref > refType , String fullyQualifiedname , String name , String descriptor ) { } }
String internalForm = fullyQualifiedname . replace ( '.' , '/' ) ; for ( ConstantInfo ci : listConstantInfo ( refType ) ) { Ref mr = ( Ref ) ci ; int classIndex = mr . getClass_index ( ) ; Clazz clazz = ( Clazz ) getConstantInfo ( classIndex ) ; String cn = getString ( clazz . getName_index ( ) ) ; if ( internalForm . equals ( cn ) ) { int nameAndTypeIndex = mr . getName_and_type_index ( ) ; NameAndType nat = ( NameAndType ) getConstantInfo ( nameAndTypeIndex ) ; int nameIndex = nat . getName_index ( ) ; String str = getString ( nameIndex ) ; if ( name . equals ( str ) ) { int descriptorIndex = nat . getDescriptor_index ( ) ; String descr = getString ( descriptorIndex ) ; if ( descriptor . equals ( descr ) ) { return constantPoolIndexMap . get ( ci ) ; } } } } return - 1 ;
public class SystemUtils { /** * < p > Gets a System property , defaulting to < code > null < / code > if the property * cannot be read . < / p > * < p > If a < code > SecurityException < / code > is caught , the return value is < code > null < / code > . < / p > * @ param name the system property name * @ return the system property value or < code > null < / code > if a security problem occurs */ public static String getProperty ( String name ) { } }
try { return System . getProperty ( name ) ; } catch ( AccessControlException ex ) { if ( log . isDebugEnabled ( ) ) { log . debug ( String . format ( "Caught AccessControlException when accessing system property [%s]; " + "its value will be returned [null]. Reason: %s" , name , ex . getMessage ( ) ) ) ; } } return null ;
public class JavaTypeToTypeSignature { /** * get the type signature corresponding to given java type * @ param type * @ return */ private FullTypeSignature getFullTypeSignature ( Type type ) { } }
if ( type instanceof Class < ? > ) { return getTypeSignature ( ( Class < ? > ) type ) ; } if ( type instanceof GenericArrayType ) { return getArrayTypeSignature ( ( GenericArrayType ) type ) ; } if ( type instanceof ParameterizedType ) { return getClassTypeSignature ( ( ParameterizedType ) type ) ; } return null ;
public class Solo { /** * Unlocks the lock screen . */ public void unlockScreen ( ) { } }
if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "unlockScreen()" ) ; } final Activity activity = activityUtils . getCurrentActivity ( false ) ; instrumentation . runOnMainSync ( new Runnable ( ) { @ Override public void run ( ) { if ( activity != null ) { activity . getWindow ( ) . addFlags ( WindowManager . LayoutParams . FLAG_DISMISS_KEYGUARD ) ; } } } ) ;
public class CommerceNotificationTemplateWrapper { /** * Returns the localized subject of this commerce notification template in the language . Uses the default language if no localization exists for the requested language . * @ param locale the locale of the language * @ return the localized subject of this commerce notification template */ @ Override public String getSubject ( java . util . Locale locale ) { } }
return _commerceNotificationTemplate . getSubject ( locale ) ;
public class RequestedModuleNames { /** * Helper routine to unfold folded module names * @ param obj * The folded path list of names , as a string or JSON object * @ param path * The reference path * @ param aPrefixes * Array of loader plugin prefixes * @ param modules * Output - the list of unfolded modlue names as a sparse array implemented * using a map with integer keys * @ throws IOException * @ throws JSONException */ protected void unfoldModulesHelper ( Object obj , String path , String [ ] aPrefixes , Map < Integer , String > modules ) throws IOException , JSONException { } }
final String sourceMethod = "unfoldModulesHelper" ; // $ NON - NLS - 1 $ if ( isTraceLogging ) { log . entering ( RequestedModuleNames . class . getName ( ) , sourceMethod , new Object [ ] { obj , path , aPrefixes != null ? Arrays . asList ( aPrefixes ) : null , modules } ) ; } if ( obj instanceof JSONObject ) { JSONObject jsonobj = ( JSONObject ) obj ; Iterator < ? > it = jsonobj . keySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { String key = ( String ) it . next ( ) ; String newpath = path + "/" + key ; // $ NON - NLS - 1 $ unfoldModulesHelper ( jsonobj . get ( key ) , newpath , aPrefixes , modules ) ; } } else if ( obj instanceof String ) { String [ ] values = ( ( String ) obj ) . split ( "-" ) ; // $ NON - NLS - 1 $ int idx = Integer . parseInt ( values [ 0 ] ) ; if ( modules . get ( idx ) != null ) { throw new BadRequestException ( ) ; } modules . put ( idx , values . length > 1 ? ( ( aPrefixes != null ? aPrefixes [ Integer . parseInt ( values [ 1 ] ) ] : values [ 1 ] ) + "!" + path ) : // $ NON - NLS - 1 $ path ) ; } else { throw new BadRequestException ( ) ; } if ( isTraceLogging ) { log . exiting ( RequestedModuleNames . class . getName ( ) , sourceMethod , modules ) ; }
public class SPX { /** * / * [ deutsch ] * < p > Implementierungsmethode des Interface { @ link Externalizable } . < / p > * @ param in input stream * @ throws IOException in case of I / O - problems * @ throws ClassNotFoundException if class - loading fails */ @ Override public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { } }
int header = in . readByte ( ) ; switch ( header ) { case NEGATIVE_DAY_OF_MONTH_PATTERN_TYPE : this . obj = readPattern ( in ) ; break ; default : throw new StreamCorruptedException ( "Unknown serialized type." ) ; }
public class SpeakUtil { /** * Send the specified system message on the specified dobj . */ protected static void sendSystem ( DObject speakObj , String bundle , String message , byte level ) { } }
sendMessage ( speakObj , new SystemMessage ( message , bundle , level ) ) ;
public class ManagementClientImpl { /** * / * ( non - Javadoc ) * @ see tuwien . auto . calimero . mgmt . ManagementClient # readDomainAddress ( boolean ) */ public synchronized List readDomainAddress ( boolean oneDomainOnly ) throws KNXLinkClosedException , KNXInvalidResponseException , KNXTimeoutException { } }
// we allow 6 bytes ASDU for RF domains return makeDOAs ( readBroadcast ( priority , DataUnitBuilder . createCompactAPDU ( DOA_READ , null ) , DOA_RESPONSE , 6 , 6 , oneDomainOnly ) ) ;
public class IdentificationSet { /** * Adds an Element to the Set * @ param x the Element * @ param identification the identification * @ return true if this set did not already contain the specified element */ public boolean add ( X x , Identification identification ) { } }
return map . put ( x , identification ) == null ;
public class JdbcExtractor { /** * Get target column name if column is not found in metadata , then name it * as unknown column If alias is not found , target column is nothing but * source column * @ param sourceColumnName * @ param alias * @ return targetColumnName */ private String getTargetColumnName ( String sourceColumnName , String alias ) { } }
String targetColumnName = alias ; Schema obj = this . getMetadataColumnMap ( ) . get ( sourceColumnName . toLowerCase ( ) ) ; if ( obj == null ) { targetColumnName = ( targetColumnName == null ? "unknown" + this . unknownColumnCounter : targetColumnName ) ; this . unknownColumnCounter ++ ; } else { targetColumnName = ( StringUtils . isNotBlank ( targetColumnName ) ? targetColumnName : sourceColumnName ) ; } targetColumnName = this . toCase ( targetColumnName ) ; return Utils . escapeSpecialCharacters ( targetColumnName , ConfigurationKeys . ESCAPE_CHARS_IN_COLUMN_NAME , "_" ) ;
public class BugLoader { /** * Create the IFindBugsEngine that will be used to analyze the application . * @ param p * the Project * @ param pcb * the PrintCallBack * @ return the IFindBugsEngine */ private static IFindBugsEngine createEngine ( @ Nonnull Project p , BugReporter pcb ) { } }
FindBugs2 engine = new FindBugs2 ( ) ; engine . setBugReporter ( pcb ) ; engine . setProject ( p ) ; engine . setDetectorFactoryCollection ( DetectorFactoryCollection . instance ( ) ) ; // Honor - effort option if one was given on the command line . engine . setAnalysisFeatureSettings ( Driver . getAnalysisSettingList ( ) ) ; return engine ;
public class DateUtils { /** * < p > Constructs an < code > Iterator < / code > over each day in a date * range defined by a focus date and range style . < / p > * < p > For instance , passing Thursday , July 4 , 2002 and a * < code > RANGE _ MONTH _ SUNDAY < / code > will return an < code > Iterator < / code > * that starts with Sunday , June 30 , 2002 and ends with Saturday , August 3, * 2002 , returning a Calendar instance for each intermediate day . < / p > * < p > This method provides an iterator that returns Calendar objects . * The days are progressed using { @ link Calendar # add ( int , int ) } . < / p > * @ param focus the date to work with , not null * @ param rangeStyle the style constant to use . Must be one of * { @ link DateUtils # RANGE _ MONTH _ SUNDAY } , * { @ link DateUtils # RANGE _ MONTH _ MONDAY } , * { @ link DateUtils # RANGE _ WEEK _ SUNDAY } , * { @ link DateUtils # RANGE _ WEEK _ MONDAY } , * { @ link DateUtils # RANGE _ WEEK _ RELATIVE } , * { @ link DateUtils # RANGE _ WEEK _ CENTER } * @ return the date iterator , not null * @ throws IllegalArgumentException if the date is < code > null < / code > * @ throws IllegalArgumentException if the rangeStyle is invalid */ public static Iterator < Calendar > iterator ( final Calendar focus , final int rangeStyle ) { } }
if ( focus == null ) { throw new IllegalArgumentException ( "The date must not be null" ) ; } Calendar start = null ; Calendar end = null ; int startCutoff = Calendar . SUNDAY ; int endCutoff = Calendar . SATURDAY ; switch ( rangeStyle ) { case RANGE_MONTH_SUNDAY : case RANGE_MONTH_MONDAY : // Set start to the first of the month start = truncate ( focus , Calendar . MONTH ) ; // Set end to the last of the month end = ( Calendar ) start . clone ( ) ; end . add ( Calendar . MONTH , 1 ) ; end . add ( Calendar . DATE , - 1 ) ; // Loop start back to the previous sunday or monday if ( rangeStyle == RANGE_MONTH_MONDAY ) { startCutoff = Calendar . MONDAY ; endCutoff = Calendar . SUNDAY ; } break ; case RANGE_WEEK_SUNDAY : case RANGE_WEEK_MONDAY : case RANGE_WEEK_RELATIVE : case RANGE_WEEK_CENTER : // Set start and end to the current date start = truncate ( focus , Calendar . DATE ) ; end = truncate ( focus , Calendar . DATE ) ; switch ( rangeStyle ) { case RANGE_WEEK_SUNDAY : // already set by default break ; case RANGE_WEEK_MONDAY : startCutoff = Calendar . MONDAY ; endCutoff = Calendar . SUNDAY ; break ; case RANGE_WEEK_RELATIVE : startCutoff = focus . get ( Calendar . DAY_OF_WEEK ) ; endCutoff = startCutoff - 1 ; break ; case RANGE_WEEK_CENTER : startCutoff = focus . get ( Calendar . DAY_OF_WEEK ) - 3 ; endCutoff = focus . get ( Calendar . DAY_OF_WEEK ) + 3 ; break ; default : break ; } break ; default : throw new IllegalArgumentException ( "The range style " + rangeStyle + " is not valid." ) ; } if ( startCutoff < Calendar . SUNDAY ) { startCutoff += 7 ; } if ( startCutoff > Calendar . SATURDAY ) { startCutoff -= 7 ; } if ( endCutoff < Calendar . SUNDAY ) { endCutoff += 7 ; } if ( endCutoff > Calendar . SATURDAY ) { endCutoff -= 7 ; } while ( start . get ( Calendar . DAY_OF_WEEK ) != startCutoff ) { start . add ( Calendar . DATE , - 1 ) ; } while ( end . get ( Calendar . DAY_OF_WEEK ) != endCutoff ) { end . add ( Calendar . DATE , 1 ) ; } return new DateIterator ( start , end ) ;
public class CPInstancePersistenceImpl { /** * Returns the first cp instance in the ordered set where groupId = & # 63 ; and status & ne ; & # 63 ; . * @ param groupId the group ID * @ param status the status * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching cp instance * @ throws NoSuchCPInstanceException if a matching cp instance could not be found */ @ Override public CPInstance findByG_NotST_First ( long groupId , int status , OrderByComparator < CPInstance > orderByComparator ) throws NoSuchCPInstanceException { } }
CPInstance cpInstance = fetchByG_NotST_First ( groupId , status , orderByComparator ) ; if ( cpInstance != null ) { return cpInstance ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "groupId=" ) ; msg . append ( groupId ) ; msg . append ( ", status=" ) ; msg . append ( status ) ; msg . append ( "}" ) ; throw new NoSuchCPInstanceException ( msg . toString ( ) ) ;
public class StringProcessChain { /** * Replaces each substring of given source string that matches the given * regular expression ignore case sensitive with the given replacement . < br > * @ param target target string want to be replaces . * @ param replacement string of replace to . * @ return a new string has been replaced each substring of given source * string that matches the given regular expression ignore case * sensitive with the given replacement . */ public StringProcessChain replacIgnoreCase ( final String target , final String replacement ) { } }
StringBuilder result = new StringBuilder ( ) ; String temp = source ; int indexOfIgnoreCase = 0 ; while ( true ) { indexOfIgnoreCase = StringUtils . indexOfIgnoreCase ( temp , target ) ; if ( indexOfIgnoreCase == StringUtils . INDEX_OF_NOT_FOUND ) { result . append ( temp ) ; break ; } result . append ( temp . substring ( 0 , indexOfIgnoreCase ) ) ; result . append ( replacement ) ; temp = temp . substring ( indexOfIgnoreCase + target . length ( ) ) ; } source = result . toString ( ) ; return this ;
public class DiscreteCosineTransform { /** * 1 - D Backward Discrete Cosine Transform . * @ param data Data . */ public static void Backward ( double [ ] data ) { } }
double [ ] result = new double [ data . length ] ; double sum ; double scale = Math . sqrt ( 2.0 / data . length ) ; for ( int t = 0 ; t < data . length ; t ++ ) { sum = 0 ; for ( int j = 0 ; j < data . length ; j ++ ) { double cos = Math . cos ( ( ( 2 * t + 1 ) * j * Math . PI ) / ( 2 * data . length ) ) ; sum += alpha ( j ) * data [ j ] * cos ; } result [ t ] = scale * sum ; } for ( int i = 0 ; i < data . length ; i ++ ) { data [ i ] = result [ i ] ; }
public class TagLibraryCache { /** * PK68590 start */ private void loadLooseLibTagFiles ( String looseLibDir , List loadedLocations , String looseKey ) { } }
// PM07608 / / PM03123 if ( logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "loadLooseLibTagFiles" , "looseLibDir {0}" , looseLibDir ) ; } File looseLibDirFile = new File ( looseLibDir ) ; String [ ] list = looseLibDirFile . list ( ) ; if ( list == null ) { // PM03123 null if not denote a directory ( i . e this is a file ) list = new String [ 1 ] ; list [ 0 ] = looseLibDir ; } // PM03123 if ( list != null ) { TagLibraryInfoImpl tli = null ; for ( int j = 0 ; j < list . length ; j ++ ) { String resourcePath = ( String ) list [ j ] ; if ( resourcePath . endsWith ( ".tld" ) ) { if ( logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "loadLooseLibTagFiles" , "tld located {0}" , resourcePath ) ; } try { URL looseLibURL = new File ( looseLibDir ) . toURL ( ) ; JspInputSource inputSource = ctxt . getJspInputSourceFactory ( ) . createJspInputSource ( looseLibURL , resourcePath ) ; tli = tldParser . parseTLD ( inputSource , "webinf" ) ; if ( logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "loadLooseLibTagFiles" , "tli {0}" , tli ) ; } } catch ( JspCoreException e ) { if ( logger . isLoggable ( Level . WARNING ) ) { logger . logp ( Level . WARNING , CLASS_NAME , "loadLooseLibTagFiles" , "jsp error failed to parse loose library tld . location = [" + looseLibDir + "]" , e ) ; } } catch ( MalformedURLException e ) { if ( logger . isLoggable ( Level . WARNING ) ) { logger . logp ( Level . WARNING , CLASS_NAME , "loadLooseLibTagFiles" , "jsp error failed to parse loose library tld . location = [" + looseLibDir + "]" , e ) ; } } if ( tli != null ) { String looseLibURN = tli . getReliableURN ( ) ; // PM07608 if ( looseLibURN == null ) { looseKey = looseKey . replace ( '\\' , '/' ) ; // use URI defined in RAD looseLibConfig xml file looseLibURN = looseKey + "/" + resourcePath ; if ( logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "loadLooseLibTagFiles" , "jsp failed to find a uri sub-element in [" + resourcePath + "], default uri to \"" + looseLibURN + "\"" ) ; } } // PM07608 if ( logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "loadLooseLibTagFiles" , "Adding TagLibraryInfoImpl for [{0}]" , looseLibURN ) ; } put ( looseLibURN , tli ) ; } } // PM03123 - start else if ( resourcePath . endsWith ( ".jar" ) ) { if ( logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "loadLooseLibTagFiles" , "looseLibDir is a jar" ) ; } loadTldsFromJar ( resourcePath , loadedLocations ) ; } // PM03123 - end else { // not a tld . . . maybe it ' s a directory StringBuffer nestedDir = new StringBuffer ( looseLibDir ) ; if ( looseLibDir . endsWith ( "/" ) || looseLibDir . endsWith ( "\\" ) ) { nestedDir . append ( resourcePath ) ; } else { nestedDir . append ( "/" ) ; nestedDir . append ( resourcePath ) ; } if ( new File ( nestedDir . toString ( ) ) . isDirectory ( ) ) { loadLooseLibTagFiles ( nestedDir . toString ( ) , loadedLocations , looseKey ) ; // PM07608 / / PM03123 } } } }
public class AgentInternalEventsDispatcher { /** * Posts an event to all registered { @ code BehaviorGuardEvaluator } . * The dispatch of this event will be done asynchronously . * This method will return successfully after the event has been posted to all { @ code BehaviorGuardEvaluator } , and regardless * of any exceptions thrown by { @ code BehaviorGuardEvaluator } . * @ param event an event to dispatch asynchronously . */ public void asyncDispatch ( Event event ) { } }
assert event != null ; this . executor . execute ( ( ) -> { Iterable < BehaviorGuardEvaluator > behaviorGuardEvaluators = null ; synchronized ( AgentInternalEventsDispatcher . this . behaviorGuardEvaluatorRegistry ) { behaviorGuardEvaluators = AgentInternalEventsDispatcher . this . behaviorGuardEvaluatorRegistry . getBehaviorGuardEvaluators ( event ) ; } if ( behaviorGuardEvaluators != null ) { final Collection < Runnable > behaviorsMethodsToExecute ; try { behaviorsMethodsToExecute = evaluateGuards ( event , behaviorGuardEvaluators ) ; } catch ( InvocationTargetException e ) { throw new RuntimeException ( e ) ; } executeAsynchronouslyBehaviorMethods ( behaviorsMethodsToExecute ) ; } } ) ;