signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class JmsMessageImpl { /** * This static method is a factory for producing Message objects from * JsJmsMessage objects . * It is called by JmsSharedUtilsImpl . inboundMessagePath ( . . . ) * Note that this method cannot be easily moved to the shared utils * class because it access private state of the JmsMessageImpl object . * @ param newMsg The inbound MFP message component we wish to get a JMS * representation of . * @ param newSess The session to associate with the Message objects * @ param passThruProps Session - like properties , some of which are passed to the message objects . * These properties originate in ConnectionFactory and ActivationSpec admin objects , and are relevant * to message objects . * @ return Message A JMS Message instance of the associated type to the * parameter MFP component . */ static Message inboundJmsInstance ( JsJmsMessage newMsg , JmsSessionImpl newSess , Map passThruProps ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "inboundJmsInstance" , new Object [ ] { newMsg , newSess , passThruProps } ) ; // This is where the mapping of MFP components to JMS components takes // place . The list of mappings should increase as we support more method // types . JmsMessageImpl jmsMsg = null ; JmsBodyType bt = newMsg . getBodyType ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "body type: " + bt ) ; int bodyTypeInt = - 2 ; // This is not one of the JmsBodyType constants . if ( bt != null ) { bodyTypeInt = bt . toInt ( ) ; } switch ( bodyTypeInt ) { case JmsBodyType . NULL_INT : jmsMsg = new JmsMessageImpl ( newMsg , newSess ) ; break ; case JmsBodyType . TEXT_INT : jmsMsg = new JmsTextMessageImpl ( ( JsJmsTextMessage ) newMsg , newSess ) ; break ; case JmsBodyType . MAP_INT : jmsMsg = new JmsMapMessageImpl ( ( JsJmsMapMessage ) newMsg , newSess ) ; break ; case JmsBodyType . OBJECT_INT : jmsMsg = new JmsObjectMessageImpl ( ( JsJmsObjectMessage ) newMsg , newSess ) ; break ; case JmsBodyType . BYTES_INT : jmsMsg = new JmsBytesMessageImpl ( ( JsJmsBytesMessage ) newMsg , newSess ) ; break ; case JmsBodyType . STREAM_INT : jmsMsg = new JmsStreamMessageImpl ( ( JsJmsStreamMessage ) newMsg , newSess ) ; break ; default : // Catch - all situation to translate to a JMS Message instance - we won ' t be // able to get to any of the body data , but the header fields would be visible . if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "UNKNOWN MESSAGE TYPE FOUND: " + bt ) ; jmsMsg = new JmsMessageImpl ( newMsg , newSess ) ; break ; } // Need to transfer certain performance related properties from the pass through properties // to the new message here . Only attempt this if pass thru props have been provided if ( passThruProps != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Pass through properties provided - attempting to assign to new message" ) ; // Discover the properties from the pass thru props String producerProp = ( String ) passThruProps . get ( JmsraConstants . PRODUCER_DOES_NOT_MODIFY_PAYLOAD_AFTER_SET ) ; String consumerProp = ( String ) passThruProps . get ( JmsraConstants . CONSUMER_DOES_NOT_MODIFY_PAYLOAD_AFTER_GET ) ; // Assign attributes to the message according to value of properties if ( producerProp != null ) { jmsMsg . producerWontModifyPayloadAfterSet = producerProp . equalsIgnoreCase ( ApiJmsConstants . WILL_NOT_MODIFY_PAYLOAD ) ; } if ( consumerProp != null ) { jmsMsg . consumerWontModifyPayloadAfterGet = consumerProp . equalsIgnoreCase ( ApiJmsConstants . WILL_NOT_MODIFY_PAYLOAD ) ; } } // When a JMS Message has been received , it ' s body and properties are read - only // until clearBody ( ) or clearProperties ( ) are called . jmsMsg . bodyReadOnly = true ; jmsMsg . propertiesReadOnly = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "inboundJmsInstance" ) ; return jmsMsg ;
public class RouteSelector { /** * Visible for testing */ static String getHostString ( InetSocketAddress socketAddress ) { } }
InetAddress address = socketAddress . getAddress ( ) ; if ( address == null ) { // The InetSocketAddress was specified with a string ( either a numeric IP or a host name ) . If // it is a name , all IPs for that name should be tried . If it is an IP address , only that IP // address should be tried . return socketAddress . getHostName ( ) ; } // The InetSocketAddress has a specific address : we should only try that address . Therefore we // return the address and ignore any host name that may be available . return address . getHostAddress ( ) ;
public class ScannerSupplier { /** * Returns a { @ link ScannerSupplier } with a specific list of { @ link BugChecker } classes . */ @ SafeVarargs public static ScannerSupplier fromBugCheckerClasses ( Class < ? extends BugChecker > ... checkerClasses ) { } }
return fromBugCheckerClasses ( Arrays . asList ( checkerClasses ) ) ;
public class FlowControllerFactory { /** * Create a { @ link SharedFlowController } of the given type . * @ param context a { @ link RequestContext } object which contains the current request and response . * @ param sharedFlowClassName the type name of the desired SharedFlowController . * @ return the newly - created SharedFlowController , or < code > null < / code > if none was found . */ public SharedFlowController createSharedFlow ( RequestContext context , String sharedFlowClassName ) throws ClassNotFoundException , InstantiationException , IllegalAccessException { } }
Class sharedFlowClass = getFlowControllerClass ( sharedFlowClassName ) ; return createSharedFlow ( context , sharedFlowClass ) ;
public class Tools { /** * 根据MAP的VALUE进行排序 , 升序 * @ param map * @ return */ public static < K > List < Map . Entry < K , Integer > > sortByIntegerValue ( Map < K , Integer > map ) { } }
List < Map . Entry < K , Integer > > orderList = new ArrayList < > ( map . entrySet ( ) ) ; Collections . sort ( orderList , new Comparator < Map . Entry < K , Integer > > ( ) { @ Override public int compare ( Map . Entry < K , Integer > o1 , Map . Entry < K , Integer > o2 ) { return ( o1 . getValue ( ) - o2 . getValue ( ) ) ; } } ) ; return orderList ;
public class JGTProcessingRegion { /** * Transform the current region into a { @ link GridGeometry2D } . * @ param crs the { @ link CoordinateReferenceSystem } to apply . * @ return the gridgeometry . */ public GridGeometry2D getGridGeometry ( CoordinateReferenceSystem crs ) { } }
GridGeometry2D gridGeometry = CoverageUtilities . gridGeometryFromRegionParams ( getRegionParams ( ) , crs ) ; return gridGeometry ;
public class Call { /** * Executes a method on the target object which returns Long . Parameters must match * those of the method . * @ param methodName the name of the method * @ param optionalParameters the ( optional ) parameters of the method . * @ return the result of the method execution */ public static Function < Object , Long > methodForLong ( final String methodName , final Object ... optionalParameters ) { } }
return new Call < Object , Long > ( Types . LONG , methodName , VarArgsUtil . asOptionalObjectArray ( Object . class , optionalParameters ) ) ;
public class Sets { /** * Create a unmodifiable set with contents . * @ param contents The contents of the set . * @ return A unmodifiable set containing contents . */ public static < T > Set < T > newUnmodifiableSet ( Collection < T > contents ) { } }
if ( isEmpty ( contents ) ) return Collections . emptySet ( ) ; if ( contents . size ( ) == 1 ) return Collections . singleton ( contents . iterator ( ) . next ( ) ) ; return Collections . unmodifiableSet ( dup ( contents ) ) ;
public class TmdbParameters { /** * Add an array parameter to the collection * @ param key Parameter to add * @ param value The array value to use ( will be converted into a comma separated list ) */ public void add ( final Param key , final String [ ] value ) { } }
if ( value != null && value . length > 0 ) { parameters . put ( key , toList ( value ) ) ; }
public class JDK14Logger { /** * from interface Logger . Factory */ public Logger getLogger ( String name ) { } }
return new Impl ( java . util . logging . Logger . getLogger ( name ) ) ;
public class WebDriverHelper { /** * Returns the first selected value from a drop down list . * @ param by * the method of identifying the element * @ return the first selected option from a drop - down */ public String getSelectedValue ( final By by ) { } }
Select select = new Select ( driver . findElement ( by ) ) ; String defaultSelectedValue = select . getFirstSelectedOption ( ) . getText ( ) ; return defaultSelectedValue ;
public class PusherInternal { /** * in CBL _ Pusher . m * - ( CBLMultipartWriter * ) multipartWriterForRevision : ( CBL _ Revision * ) rev */ @ InterfaceAudience . Private private boolean uploadMultipartRevision ( final RevisionInternal revision ) { } }
Map < String , Object > body = revision . getProperties ( ) ; Map < String , Object > attachments = ( Map < String , Object > ) body . get ( "_attachments" ) ; boolean attachmentsFollow = false ; for ( String attachmentKey : attachments . keySet ( ) ) { Map < String , Object > attachment = ( Map < String , Object > ) attachments . get ( attachmentKey ) ; if ( attachment . containsKey ( "follows" ) ) attachmentsFollow = true ; } if ( ! attachmentsFollow ) return false ; Log . d ( TAG , "Uploading multipart request. Revision: %s" , revision ) ; addToChangesCount ( 1 ) ; final String path = String . format ( Locale . ENGLISH , "%s?new_edits=false" , encodeDocumentId ( revision . getDocID ( ) ) ) ; CustomFuture future = sendAsyncMultipartRequest ( "PUT" , path , body , attachments , new RemoteRequestCompletion ( ) { @ Override public void onCompletion ( RemoteRequest remoteRequest , Response httpResponse , Object result , Throwable e ) { try { if ( e != null ) { if ( e instanceof RemoteRequestResponseException ) { // Server doesn ' t like multipart , eh ? Fall back to JSON . if ( ( ( RemoteRequestResponseException ) e ) . getCode ( ) == 415 ) { // status 415 = " bad _ content _ type " dontSendMultipart = true ; uploadJsonRevision ( revision ) ; } } else { Log . e ( TAG , "Exception uploading multipart request" , e ) ; setError ( e ) ; } } else { Log . v ( TAG , "Uploaded multipart request. Revision: %s" , revision ) ; removePending ( revision ) ; } } finally { addToCompletedChangesCount ( 1 ) ; } } } ) ; future . setQueue ( pendingFutures ) ; pendingFutures . add ( future ) ; return true ;
public class PathFinder { /** * Gets the absolute path . * @ param file * the file * @ param removeLastChar * the remove last char * @ return the absolute path */ public static String getAbsolutePath ( final File file , final boolean removeLastChar ) { } }
String absolutePath = file . getAbsolutePath ( ) ; if ( removeLastChar ) { absolutePath = absolutePath . substring ( 0 , absolutePath . length ( ) - 1 ) ; } return absolutePath ;
public class configstatus { /** * Use this API to fetch filtered set of configstatus resources . * filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */ public static configstatus [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } }
configstatus obj = new configstatus ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; configstatus [ ] response = ( configstatus [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class AsteriskQueueImpl { /** * Notifies all registered listener that a queue member changes its state . * @ param member the changed member . */ void fireMemberStateChanged ( AsteriskQueueMemberImpl member ) { } }
synchronized ( listeners ) { for ( AsteriskQueueListener listener : listeners ) { try { listener . onMemberStateChange ( member ) ; } catch ( Exception e ) { logger . warn ( "Exception in onMemberStateChange()" , e ) ; } } }
public class SerdesManagerImpl { /** * Register a serializer / deserializer of the given type . * @ param serdes The serializer / deserializer of T . * @ param < T > The type of the object to be serialized / deserialized . * @ return The { @ link HandlerRegistration } object , capable of cancelling this HandlerRegistration * to the { @ link SerdesManagerImpl } . */ public < T > HandlerRegistration register ( Serdes < T > serdes ) { } }
final HandlerRegistration desReg = register ( ( Deserializer < T > ) serdes ) ; final HandlerRegistration serReg = register ( ( Serializer < T > ) serdes ) ; return new HandlerRegistration ( ) { @ Override public void removeHandler ( ) { desReg . removeHandler ( ) ; serReg . removeHandler ( ) ; } } ;
public class TempByteHolder { /** * Writes efficiently part of the content to output stream . * @ param os OutputStream to write to * @ param start _ offset Offset of data fragment to be written * @ param length Length of data fragment to be written * @ throws IOException */ public void writeTo ( java . io . OutputStream os , int start_offset , int length ) throws IOException { } }
int towrite = min ( length , _write_pos - start_offset ) ; int writeoff = start_offset ; if ( towrite > 0 ) { while ( towrite >= _window_size ) { moveWindow ( writeoff ) ; os . write ( _memory_buffer , 0 , _window_size ) ; towrite -= _window_size ; writeoff += _window_size ; } if ( towrite > 0 ) { moveWindow ( writeoff ) ; os . write ( _memory_buffer , 0 , towrite ) ; } }
public class BytesUtils { /** * Method used to convert byte array to int * @ param byteArray * byte array to convert * @ param startPos * start position in array in the * @ param length * length of data * @ return int value of byte array */ public static int byteArrayToInt ( final byte [ ] byteArray , final int startPos , final int length ) { } }
if ( byteArray == null ) { throw new IllegalArgumentException ( "Parameter 'byteArray' cannot be null" ) ; } if ( length <= 0 || length > 4 ) { throw new IllegalArgumentException ( "Length must be between 1 and 4. Length = " + length ) ; } if ( startPos < 0 || byteArray . length < startPos + length ) { throw new IllegalArgumentException ( "Length or startPos not valid" ) ; } int value = 0 ; for ( int i = 0 ; i < length ; i ++ ) { value += ( byteArray [ startPos + i ] & 0xFF ) << 8 * ( length - i - 1 ) ; } return value ;
public class CompoundReentrantTypeResolver { /** * / * @ Nullable */ @ Override public JvmIdentifiableElement getLinkedFeature ( /* @ Nullable */ XAbstractFeatureCall featureCall ) { } }
if ( featureCall == null ) return null ; IResolvedTypes delegate = getDelegate ( featureCall ) ; return delegate . getLinkedFeature ( featureCall ) ;
public class HttpChannelConfig { /** * Method to handle parsing all of the persistence related configuration * values . * @ param props */ private void parsePersistence ( Map < Object , Object > props ) { } }
parseKeepAliveEnabled ( props ) ; if ( isKeepAliveEnabled ( ) ) { parseMaxPersist ( props ) ; }
public class AbstractDelete { /** * Check access for all Instances . If one does not have access an error will be thrown . * @ throws EFapsException the eFaps exception */ protected void checkAccess ( ) throws EFapsException { } }
for ( final Instance instance : getInstances ( ) ) { if ( ! instance . getType ( ) . hasAccess ( instance , AccessTypeEnums . DELETE . getAccessType ( ) , null ) ) { LOG . error ( "Delete not permitted for Person: {} on Instance: {}" , Context . getThreadContext ( ) . getPerson ( ) , instance ) ; throw new EFapsException ( getClass ( ) , "execute.NoAccess" , instance ) ; } }
public class ZooKeeper { /** * Close this client object . Once the client is closed , its session becomes * invalid . All the ephemeral nodes in the ZooKeeper server associated with * the session will be removed . The watches left on those nodes ( and on * their parents ) will be triggered . * @ throws InterruptedException */ public synchronized void close ( ) throws InterruptedException { } }
if ( ! state . isAlive ( ) ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Close called on already closed client" ) ; } return ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Closing session: 0x" + Long . toHexString ( getSessionId ( ) ) ) ; } try { cnxn . close ( ) ; } catch ( IOException e ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Ignoring unexpected exception during close" , e ) ; } } LOG . debug ( "Session: 0x" + Long . toHexString ( getSessionId ( ) ) + " closed" ) ;
public class AmazonTranscribeClient { /** * Returns a list of vocabularies that match the specified criteria . If no criteria are specified , returns the * entire list of vocabularies . * @ param listVocabulariesRequest * @ return Result of the ListVocabularies operation returned by the service . * @ throws BadRequestException * Your request didn ' t pass one or more validation tests . For example , if the transcription you ' re trying to * delete doesn ' t exist or if it is in a non - terminal state ( for example , it ' s " in progress " ) . See the * exception < code > Message < / code > field for more information . * @ throws LimitExceededException * Either you have sent too many requests or your input file is too long . Wait before you resend your * request , or use a smaller file and resend the request . * @ throws InternalFailureException * There was an internal error . Check the error message and try your request again . * @ sample AmazonTranscribe . ListVocabularies * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / transcribe - 2017-10-26 / ListVocabularies " target = " _ top " > AWS * API Documentation < / a > */ @ Override public ListVocabulariesResult listVocabularies ( ListVocabulariesRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeListVocabularies ( request ) ;
public class ByteCodeClassLoader { /** * Adds a class definition for this ClassLoader . When the class as given in the definition is * loaded for the first time , the byte code inside the definition will be used to load the class . * @ param classDef The class definition * @ param typeClass An optional class that the given class definition is generated from . This is to make sure * the type class is always loaded by the original ClassLoader when resolving the generated class * as given by the class definition . */ public final synchronized ByteCodeClassLoader addClass ( ClassDefinition classDef , @ Nullable Class < ? > typeClass ) { } }
bytecodes . put ( classDef . getClassName ( ) , classDef . getBytecode ( ) ) ; if ( typeClass != null ) { typeClasses . put ( typeClass . getName ( ) , typeClass ) ; } return this ;
public class MapCache { /** * Create or update a new rootNode child */ @ Override public void put ( String key , JSONObject value ) throws KeeperException , InterruptedException { } }
try { m_zk . create ( ZKUtil . joinZKPath ( m_rootNode , key ) , value . toString ( ) . getBytes ( Constants . UTF8ENCODING ) , Ids . OPEN_ACL_UNSAFE , CreateMode . PERSISTENT ) ; } catch ( KeeperException . NodeExistsException e ) { m_zk . setData ( ZKUtil . joinZKPath ( m_rootNode , key ) , value . toString ( ) . getBytes ( Constants . UTF8ENCODING ) , - 1 ) ; }
public class Validate { /** * Checks that the specified String is not null or empty and represents a readable file , throws exception if it is empty or * null and does not represent a path to a file . * @ param path The path to check * @ param message The exception message * @ throws IllegalArgumentException Thrown if path is empty , null or invalid */ public static void readable ( final File path , final String message ) throws IllegalArgumentException { } }
notNull ( path , message ) ; if ( ! isReadable ( path ) ) { throw new IllegalArgumentException ( message ) ; }
public class TypeUtils { /** * Append { @ code types } to { @ code buf } with separator { @ code sep } . * @ param buf destination * @ param sep separator * @ param types to append * @ return { @ code buf } * @ since 3.2 */ private static < T > StringBuilder appendAllTo ( final StringBuilder buf , final String sep , final T ... types ) { } }
Assert . requireNonNullEntries ( types , "types" ) ; Assert . requireNotEmpty ( types , "types" ) ; if ( types . length > 0 ) { buf . append ( toString ( types [ 0 ] ) ) ; for ( int i = 1 ; i < types . length ; i ++ ) { buf . append ( sep ) . append ( toString ( types [ i ] ) ) ; } } return buf ;
public class ImportHelpers { /** * Finds a specific import from the path of the instance that exports it . * @ param imports a collection of imports ( that can be null ) * @ param exportingInstancePath the path of the exporting instance * @ return an import , or null if none was found */ public static Import findImportByExportingInstance ( Collection < Import > imports , String exportingInstancePath ) { } }
Import result = null ; if ( imports != null && exportingInstancePath != null ) { for ( Import imp : imports ) { if ( exportingInstancePath . equals ( imp . getInstancePath ( ) ) ) { result = imp ; break ; } } } return result ;
public class MethodAttribUtils { /** * This utility method compares a method on the bean ' s remote * interface with a method on the bean and returns true iff they * are equal for the purpose of determining if the control * descriptor associated with the bean method applies to the * remote interface method . Equality in this case means the methods * are identical except for the abstract modifier on the remote * interface method . */ public static final boolean methodsEqual ( Method remoteMethod , Method beanMethod ) { } }
if ( ( remoteMethod == null ) || ( beanMethod == null ) ) { return false ; } // Compare method names if ( ! remoteMethod . getName ( ) . equals ( beanMethod . getName ( ) ) ) { return false ; } // Compare parameter types Class < ? > remoteMethodParamTypes [ ] = remoteMethod . getParameterTypes ( ) ; Class < ? > beanMethodParamTypes [ ] = beanMethod . getParameterTypes ( ) ; if ( remoteMethodParamTypes . length != beanMethodParamTypes . length ) { return false ; } for ( int i = 0 ; i < remoteMethodParamTypes . length ; i ++ ) { if ( ! remoteMethodParamTypes [ i ] . equals ( beanMethodParamTypes [ i ] ) ) { return false ; } } // If method names are equal and parameter types match then the // methods are equal for our purposes . Java does not allow methods // with the same name and parameter types that differ only in // return type and / or exception signature . return true ;
public class Utils { /** * Expands a template , replacing each { { param } } by the corresponding value . * Eg . " My name is { { name } } " will result in " My name is Bond " , provided that " params " contains " name = Bond " . * @ param s the template to expand * @ param params the parameters to be expanded in the template * @ return the expanded template */ public static String expandTemplate ( String s , Properties params ) { } }
String result ; if ( params == null || params . size ( ) < 1 ) { result = s ; } else { StringBuffer sb = new StringBuffer ( ) ; Pattern pattern = Pattern . compile ( "\\{\\{\\s*\\S+\\s*\\}\\}" ) ; Matcher m = pattern . matcher ( s ) ; while ( m . find ( ) ) { String raw = m . group ( ) ; String varName = m . group ( ) . replace ( '{' , ' ' ) . replace ( '}' , ' ' ) . trim ( ) ; String val = params . getProperty ( varName ) ; val = ( val == null ? raw : val . trim ( ) ) ; m . appendReplacement ( sb , val ) ; } m . appendTail ( sb ) ; result = sb . toString ( ) ; } return result ;
public class HTODDynacache { /** * delTemplate ( ) * This removes the specified template and its ValueSet ( with all of its elements ) * from the disk . */ public int delTemplate ( String template ) { } }
int returnCode = NO_EXCEPTION ; if ( ! this . disableTemplatesSupport ) { if ( delayOffload ) { auxTemplateDependencyTable . removeDependency ( template ) ; } returnCode = delValueSet ( TEMPLATE_ID_DATA , template ) ; } return returnCode ;
public class SimpleDbEntityInformationSupport { /** * Creates a { @ link SimpleDbEntityInformation } for the given domain class . * @ param domainClass * must not be { @ literal null } . * @ return */ @ SuppressWarnings ( { } }
"rawtypes" , "unchecked" } ) public static < T > SimpleDbEntityInformation < T , ? > getMetadata ( Class < T > domainClass , String simpleDbDomain ) { Assert . notNull ( domainClass ) ; Assert . notNull ( simpleDbDomain ) ; return new SimpleDbMetamodelEntityInformation ( domainClass , simpleDbDomain ) ;
public class NodeDefinitionImpl { /** * { @ inheritDoc } */ public String [ ] getRequiredPrimaryTypeNames ( ) { } }
InternalQName [ ] requiredPrimaryTypes = nodeDefinitionData . getRequiredPrimaryTypes ( ) ; String [ ] result = new String [ requiredPrimaryTypes . length ] ; try { for ( int i = 0 ; i < requiredPrimaryTypes . length ; i ++ ) { result [ i ] = locationFactory . createJCRName ( requiredPrimaryTypes [ i ] ) . getAsString ( ) ; } } catch ( RepositoryException e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } return result ;
public class CommonOps_DDRM { /** * Creates a rectangular matrix which is zero except along the diagonals . * @ param numRows Number of rows in the matrix . * @ param numCols NUmber of columns in the matrix . * @ return A matrix with diagonal elements equal to one . */ public static DMatrixRMaj identity ( int numRows , int numCols ) { } }
DMatrixRMaj ret = new DMatrixRMaj ( numRows , numCols ) ; int small = numRows < numCols ? numRows : numCols ; for ( int i = 0 ; i < small ; i ++ ) { ret . set ( i , i , 1.0 ) ; } return ret ;
public class BasicOpenDialogCommand { /** * { @ inheritDoc } */ @ Override public void openWarningDialog ( ) { } }
final Alert alert = new Alert ( AlertType . WARNING ) ; alert . setTitle ( bean . getTitle ( ) ) ; alert . setHeaderText ( bean . getHeader ( ) ) ; alert . setContentText ( bean . getMessage ( ) ) ; alert . showAndWait ( ) ;
public class TabularResult { /** * Create a tabular result set from a header definition and an ordered list of rows . * @ param headerDefinition the definition of the header row , not null * @ param rows a list of rows , not null * @ return the { @ code TabularResult } instance */ public static TabularResult of ( final HeaderDefinition headerDefinition , final List < Row > rows ) { } }
ArgumentChecker . notNull ( headerDefinition , "headerDefinition" ) ; ArgumentChecker . notNull ( rows , "rows" ) ; return new TabularResult ( headerDefinition , rows ) ;
public class CommandFactory { /** * Iterate and insert each of the elements of the Collection . * @ param objects * The objects to insert * @ param outIdentifier * Identifier to lookup the returned objects * @ param returnObject * boolean to specify whether the inserted Collection is part of the ExecutionResults * @ param entryPoint * Optional EntryPoint for the insertions * @ return */ public static Command newInsertElements ( Collection objects , String outIdentifier , boolean returnObject , String entryPoint ) { } }
return getCommandFactoryProvider ( ) . newInsertElements ( objects , outIdentifier , returnObject , entryPoint ) ;
public class DbxClientV1 { /** * Upload file contents to Dropbox , getting contents from the given { @ link DbxStreamWriter } . * < pre > * DbxClientV1 dbxClient = . . . * < b > / / Create a file on Dropbox with 100 3 - digit random numbers , one per line . < / b > * final int numRandoms = 100; * int fileSize = numRandoms * 4 ; < b > 3 digits , plus a newline < / b > * dbxClient . uploadFile ( " / Randoms . txt " , { @ link DbxWriteMode # add ( ) } , fileSize , * new DbxStreamWriter & lt ; RuntimeException & gt ; ( ) { * public void write ( OutputStream out ) throws IOException * Random rand = new Random ( ) ; * PrintWriter pw = new PrintWriter ( out ) ; * for ( int i = 0 ; i & lt ; numRandoms ; i + + ) { * pw . printf ( " % 03d \ n " , rand . nextInt ( 1000 ) ) ; * pw . flush ( ) ; * < / pre > * @ param targetPath * The path to the file on Dropbox ( see { @ link DbxPathV1 } ) . If a file at * that path already exists on Dropbox , then the { @ code writeMode } parameter * will determine what happens . * @ param writeMode * Determines what to do if there ' s already a file at the given { @ code targetPath } . * @ param numBytes * The number of bytes you ' re going to upload via the returned { @ link DbxClientV1 . Uploader } . * Use { @ code - 1 } if you don ' t know ahead of time . * @ param writer * A callback that will be called when it ' s time to actually write out the * body of the file . * @ throws E * If { @ code writer . write ( ) } throws an exception , it will propagate out of this function . */ public < E extends Throwable > DbxEntry . File uploadFile ( String targetPath , DbxWriteMode writeMode , long numBytes , DbxStreamWriter < E > writer ) throws DbxException , E { } }
Uploader uploader = startUploadFile ( targetPath , writeMode , numBytes ) ; return finishUploadFile ( uploader , writer ) ;
public class Compiler { /** * Compile a ' boolean ( . . . ) ' operation . * @ param opPos The current position in the m _ opMap array . * @ return reference to { @ link org . apache . xpath . operations . Bool } instance . * @ throws TransformerException if a error occurs creating the Expression . */ protected Expression bool ( int opPos ) throws TransformerException { } }
return compileUnary ( new org . apache . xpath . operations . Bool ( ) , opPos ) ;
public class JvmCompoundTypeReferenceImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case TypesPackage . JVM_COMPOUND_TYPE_REFERENCE__TYPE : setType ( ( JvmType ) newValue ) ; return ; case TypesPackage . JVM_COMPOUND_TYPE_REFERENCE__REFERENCES : getReferences ( ) . clear ( ) ; getReferences ( ) . addAll ( ( Collection < ? extends JvmTypeReference > ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class SecurityHelper { /** * Get the display name of the guest user in the specified locale . * @ param aDisplayLocale * The locale to be used . May not be < code > null < / code > . * @ return < code > null < / code > if no translation is present . */ @ Nullable public static String getGuestUserDisplayName ( @ Nonnull final Locale aDisplayLocale ) { } }
ValueEnforcer . notNull ( aDisplayLocale , "DisplayLocale" ) ; return ESecurityUIText . GUEST . getDisplayText ( aDisplayLocale ) ;
public class PowerOfTwoFileAllocator { /** * Internal method to remove from a subtree . * @ param x * the item to remove . * @ param t * the node that roots the tree . * @ return the new root . */ private Region remove ( Region x , Region t ) { } }
if ( t != NULL_NODE ) { // Step 1 : Search down the tree and set lastNode and deletedNode this . lastNode = t ; if ( x . orderRelativeTo ( t ) < 0 ) { t . left ( remove ( x , t . left ) ) ; } else { this . deletedNode = t ; t . right ( remove ( x , t . right ) ) ; } // Step 2 : If at the bottom of the tree and // x is present , we remove it if ( t == this . lastNode ) { if ( this . deletedNode != NULL_NODE && x . orderRelativeTo ( this . deletedNode ) == 0 ) { this . deletedNode . swap ( t ) ; this . deletedElement = t ; t = t . right ; } } else if ( t . left . level < t . level - 1 || t . right . level < t . level - 1 ) { // Step 3 : Otherwise , we are not at the bottom ; re - balance if ( t . right . level > -- t . level ) { t . right . level = t . level ; } t = skew ( t ) ; t . right ( skew ( t . right ) ) ; t . right . right ( skew ( t . right . right ) ) ; t = split ( t ) ; t . right ( split ( t . right ) ) ; } } return t ;
public class Segment { /** * Returns the coordinate of the point on this segment for the given * parameter value . */ public Point2D getCoord2D ( double t ) { } }
Point2D pt = new Point2D ( ) ; getCoord2D ( t , pt ) ; return pt ;
public class WebFragmentDescriptorImpl { /** * If not already created , a new < code > post - construct < / code > element will be created and returned . * Otherwise , the first existing < code > post - construct < / code > element will be returned . * @ return the instance defined for the element < code > post - construct < / code > */ public LifecycleCallbackType < WebFragmentDescriptor > getOrCreatePostConstruct ( ) { } }
List < Node > nodeList = model . get ( "post-construct" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new LifecycleCallbackTypeImpl < WebFragmentDescriptor > ( this , "post-construct" , model , nodeList . get ( 0 ) ) ; } return createPostConstruct ( ) ;
public class CmsLoginUserAgreement { /** * Returns if the user agreement page should be shown for the current user . < p > * @ return < code > true < / code > if the user agreement page should be shown for the current user , otherwise < code > false < / code > */ public boolean isShowUserAgreement ( ) { } }
if ( ! getSettings ( ) . isUserAgreementAccepted ( ) && ( getConfigurationContent ( ) != null ) ) { CmsXmlContent content = getConfigurationContent ( ) ; boolean enabled = false ; try { // first read the property that contains the information if the agreement is enabled at all enabled = Boolean . valueOf ( getCms ( ) . readPropertyObject ( content . getFile ( ) , CmsPropertyDefinition . PROPERTY_LOGIN_FORM , false ) . getValue ( ) ) . booleanValue ( ) ; if ( enabled ) { // user agreement is enabled , now check version and accepted count if ( content . hasLocale ( getLocale ( ) ) ) { if ( getAcceptedVersion ( ) < getRequiredVersion ( ) ) { // new user agreement version that has to be shown return true ; } else { // check how often the user accepted the user agreement String countStr = content . getStringValue ( getCms ( ) , NODE_AGREE_COUNT , getLocale ( ) ) ; int count = Integer . parseInt ( countStr ) ; if ( ( count == - 1 ) || ( getAcceptedCount ( ) < count ) ) { // user still has to accept the user agreement return true ; } } } } } catch ( Exception e ) { // error when trying to determine if user agreement should be shown LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_USERAGREEMENT_SHOW_1 , getConfigurationContent ( ) . getFile ( ) . getRootPath ( ) ) , e ) ; } } // store information that nothing has to be accepted in users session for better performance if ( ! getSettings ( ) . isUserAgreementAccepted ( ) ) { getSettings ( ) . setUserAgreementAccepted ( true ) ; } return false ;
public class ElementFilter { /** * Returns a set of types in { @ code elements } . * @ return a set of types in { @ code elements } * @ param elements the elements to filter */ public static Set < TypeElement > typesIn ( Set < ? extends Element > elements ) { } }
return setFilter ( elements , TYPE_KINDS , TypeElement . class ) ;
public class ApiApp { /** * Set the signer page secondary button hover color . * @ param color String hex color code * @ throws HelloSignException thrown if the color string is an invalid hex * string */ public void setSecondaryButtonHoverColor ( String color ) throws HelloSignException { } }
if ( white_labeling_options == null ) { white_labeling_options = new WhiteLabelingOptions ( ) ; } white_labeling_options . setSecondaryButtonHoverColor ( color ) ;
public class Controller { /** * get the original request raw data as json * @ return JSONObject * @ throws IOException */ public JSONObject getRawDataAsJson ( ) throws IOException { } }
String input = getRawDataAsString ( ) ; if ( input == null ) { return null ; } return new JSONObject ( input ) ;
public class BoundingBox { /** * give min rectangle */ public Rectangle getMinRectabgle ( ) { } }
return new Rectangle ( ( int ) xLB . min , ( int ) yLB . min , ( int ) ( xUB . min - xLB . min ) , ( int ) ( yUB . min - yLB . min ) ) ;
public class CommerceShippingMethodPersistenceImpl { /** * Clears the cache for all commerce shipping methods . * The { @ link EntityCache } and { @ link FinderCache } are both cleared by this method . */ @ Override public void clearCache ( ) { } }
entityCache . clearCache ( CommerceShippingMethodImpl . class ) ; finderCache . clearCache ( FINDER_CLASS_NAME_ENTITY ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITH_PAGINATION ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION ) ;
public class ApiOvhEmailexchange { /** * Get this object properties * REST : GET / email / exchange / { organizationName } / service / { exchangeService } / protocol * @ param organizationName [ required ] The internal name of your exchange organization * @ param exchangeService [ required ] The internal name of your exchange service */ public OvhExchangeServiceProtocol organizationName_service_exchangeService_protocol_GET ( String organizationName , String exchangeService ) throws IOException { } }
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/protocol" ; StringBuilder sb = path ( qPath , organizationName , exchangeService ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhExchangeServiceProtocol . class ) ;
public class MarkowitzModel { /** * Will add a constraint on the sum of the asset weights specified by the asset indices . Either ( but not * both ) of the limits may be null . */ public LowerUpper addConstraint ( final BigDecimal lowerLimit , final BigDecimal upperLimit , final int ... assetIndeces ) { } }
return myConstraints . put ( assetIndeces , new LowerUpper ( lowerLimit , upperLimit ) ) ;
public class FessMessages { /** * Add the created action message for the key ' errors . crud _ failed _ to _ create _ crud _ table ' with parameters . * < pre > * message : Failed to create a new data . ( { 0 } ) * < / pre > * @ param property The property name for the message . ( NotNull ) * @ param arg0 The parameter arg0 for message . ( NotNull ) * @ return this . ( NotNull ) */ public FessMessages addErrorsCrudFailedToCreateCrudTable ( String property , String arg0 ) { } }
assertPropertyNotNull ( property ) ; add ( property , new UserMessage ( ERRORS_crud_failed_to_create_crud_table , arg0 ) ) ; return this ;
public class ShrinkWrapPath { /** * { @ inheritDoc } * @ see java . nio . file . Path # toUri ( ) */ @ Override public URI toUri ( ) { } }
final URI root = ShrinkWrapFileSystems . getRootUri ( this . fileSystem . getArchive ( ) ) ; // Compose a new URI location , stripping out the extra " / " root final String location = root . toString ( ) + this . toString ( ) . substring ( 1 ) ; final URI uri = URI . create ( location ) ; return uri ;
public class StorageDescriptor { /** * A list specifying the sort order of each bucket in the table . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setSortColumns ( java . util . Collection ) } or { @ link # withSortColumns ( java . util . Collection ) } if you want to * override the existing values . * @ param sortColumns * A list specifying the sort order of each bucket in the table . * @ return Returns a reference to this object so that method calls can be chained together . */ public StorageDescriptor withSortColumns ( Order ... sortColumns ) { } }
if ( this . sortColumns == null ) { setSortColumns ( new java . util . ArrayList < Order > ( sortColumns . length ) ) ; } for ( Order ele : sortColumns ) { this . sortColumns . add ( ele ) ; } return this ;
public class TypeUtils { /** * < p > Retrieves all the type arguments for this parameterized type * including owner hierarchy arguments such as * { @ code Outer < K , V > . Inner < T > . DeepInner < E > } . * The arguments are returned in a * { @ link Map } specifying the argument type for each { @ link TypeVariable } . * @ param type specifies the subject parameterized type from which to * harvest the parameters . * @ return a { @ code Map } of the type arguments to their respective type * variables . */ private static Map < TypeVariable < ? > , Type > getTypeArguments ( final ParameterizedType type ) { } }
return getTypeArguments ( type , getRawType ( type ) , null ) ;
public class WebAppConfiguratorHelper { /** * To configure JMS ConnectionFactory * @ param jmsConnFactories */ private void configureJMSConnectionFactories ( List < JMSConnectionFactory > jmsConnFactories ) { } }
Map < String , ConfigItem < JMSConnectionFactory > > jmsCfConfigItemMap = configurator . getConfigItemMap ( JNDIEnvironmentRefType . JMSConnectionFactory . getXMLElementName ( ) ) ; for ( JMSConnectionFactory jmsConnFactory : jmsConnFactories ) { String name = jmsConnFactory . getName ( ) ; if ( name == null ) { continue ; } ConfigItem < JMSConnectionFactory > existedCF = jmsCfConfigItemMap . get ( name ) ; if ( existedCF == null ) { jmsCfConfigItemMap . put ( name , createConfigItem ( jmsConnFactory , JMS_CF_COMPARATOR ) ) ; webAppConfiguration . addRef ( JNDIEnvironmentRefType . JMSConnectionFactory , jmsConnFactory ) ; } else { if ( existedCF . getSource ( ) == ConfigSource . WEB_XML && configurator . getConfigSource ( ) == ConfigSource . WEB_FRAGMENT ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "{0}.{1} with value {2} is configured in web.xml, the value {3} from web-fragment.xml in {4} is ignored" , JNDIEnvironmentRefType . JMSConnectionFactory . getXMLElementName ( ) , "name" , existedCF . getValue ( ) , name , configurator . getLibraryURI ( ) ) ; } } else if ( existedCF . getSource ( ) == ConfigSource . WEB_FRAGMENT && configurator . getConfigSource ( ) == ConfigSource . WEB_FRAGMENT && ! existedCF . compareValue ( jmsConnFactory ) ) { configurator . addErrorMessage ( nls . getFormattedMessage ( "CONFLICT_JMS_CONNECTION_FACTORY_REFERENCE_BETWEEN_WEB_FRAGMENT_XML" , new Object [ ] { name , existedCF . getLibraryURI ( ) , this . configurator . getLibraryURI ( ) } , "Two " + JNDIEnvironmentRefType . JMSConnectionFactory . getXMLElementName ( ) + " configurations with the same name {0} found in the web-fragment.xml of {1} and {2}." ) ) ; } } }
public class DatabaseFactory { /** * Build a mock tango db with a file containing the properties * @ param dbFile * @ param devices * @ param classes * @ throws DevFailed */ public static void setDbFile ( final File dbFile , final String [ ] devices , final String className ) throws DevFailed { } }
DatabaseFactory . useDb = false ; DatabaseFactory . fileDatabase = new FileTangoDB ( dbFile , Arrays . copyOf ( devices , devices . length ) , className ) ;
public class POIProxy { /** * This method is used to get the pois from a service and return a GeoJSON * document with the data retrieved given a bounding box corners * @ param id * The id of the service * @ param minX * @ param minY * @ param maxX * @ param maxY * @ return The GeoJSON response from the original service response */ public String getPOIs ( String id , double minX , double minY , double maxX , double maxY , List < Param > optionalParams ) throws Exception { } }
DescribeService describeService = getDescribeServiceByID ( id ) ; POIProxyEvent beforeEvent = new POIProxyEvent ( POIProxyEventEnum . BeforeBrowseExtent , describeService , new Extent ( minX , minY , maxX , maxY ) , null , null , null , null , null , null , null , null , null ) ; notifyListenersBeforeRequest ( beforeEvent ) ; String geoJSON = this . getCacheData ( beforeEvent ) ; boolean fromCache = true ; if ( geoJSON == null ) { fromCache = false ; geoJSON = getResponseAsGeoJSON ( id , optionalParams , describeService , minX , minY , maxX , maxY , 0 , 0 , beforeEvent ) ; } POIProxyEvent afterEvent = new POIProxyEvent ( POIProxyEventEnum . AfterBrowseExtent , describeService , new Extent ( minX , minY , maxX , maxY ) , null , null , null , null , null , null , null , geoJSON , null ) ; if ( ! fromCache ) { storeData ( afterEvent ) ; } notifyListenersAfterParse ( afterEvent ) ; return geoJSON ;
public class MsgpackIOUtil { /** * Serializes the { @ code messages } into the generator using the given schema . */ public static < T > void writeListTo ( MessagePacker packer , List < T > messages , Schema < T > schema , boolean numeric ) throws IOException { } }
MsgpackGenerator generator = new MsgpackGenerator ( numeric ) ; MsgpackOutput output = new MsgpackOutput ( generator , schema ) ; for ( T m : messages ) { schema . writeTo ( output , m ) ; generator . writeTo ( packer ) ; generator . reset ( ) ; }
public class SheetBindingErrors { /** * 先頭のグローバルエラーを取得する 。 * @ return 存在しない場合は 、 空を返す 。 */ public Optional < ObjectError > getFirstGlobalError ( ) { } }
return errors . stream ( ) . filter ( e -> ! ( e instanceof FieldError ) ) . findFirst ( ) ;
public class RangeCondition { /** * { @ inheritDoc } */ @ Override public Query doQuery ( SingleColumnMapper < ? > mapper , Analyzer analyzer ) { } }
// Check doc values if ( docValues && ! mapper . docValues ) { throw new IndexException ( "Field '{}' does not support doc_values" , mapper . field ) ; } Class < ? > clazz = mapper . base ; Query query ; if ( clazz == String . class ) { String start = ( String ) mapper . base ( field , lower ) ; String stop = ( String ) mapper . base ( field , upper ) ; query = query ( start , stop ) ; } else if ( clazz == Integer . class ) { Integer start = ( Integer ) mapper . base ( field , lower ) ; Integer stop = ( Integer ) mapper . base ( field , upper ) ; query = query ( start , stop ) ; } else if ( clazz == Long . class ) { Long start = ( Long ) mapper . base ( field , lower ) ; Long stop = ( Long ) mapper . base ( field , upper ) ; query = query ( start , stop ) ; } else if ( clazz == Float . class ) { Float start = ( Float ) mapper . base ( field , lower ) ; Float stop = ( Float ) mapper . base ( field , upper ) ; query = query ( start , stop ) ; } else if ( clazz == Double . class ) { Double start = ( Double ) mapper . base ( field , lower ) ; Double stop = ( Double ) mapper . base ( field , upper ) ; query = query ( start , stop ) ; } else { throw new IndexException ( "Range queries are not supported by mapper '{}'" , mapper ) ; } return query ;
public class StrutsUtil { /** * Return a required property value * @ param msg MessageResources object * @ param pname name of the property * @ return String property value * @ throws Throwable on error */ public static String getReqProperty ( final MessageResources msg , final String pname ) throws Throwable { } }
String p = getProperty ( msg , pname , null ) ; if ( p == null ) { logger . error ( "No definition for property " + pname ) ; throw new Exception ( ": No definition for property " + pname ) ; } return p ;
public class MqttConnection { /** * Returns client instance * @ param settings settings * @ return client instance * @ throws MqttException thrown when MQTT client construction fails */ private static synchronized IMqttClient getClient ( MqttSettings settings ) throws MqttException { } }
if ( CLIENT == null ) { CLIENT = new MqttClient ( settings . getServerUrl ( ) , PUBLISHER_ID ) ; MqttConnectOptions options = new MqttConnectOptions ( ) ; options . setAutomaticReconnect ( true ) ; options . setCleanSession ( true ) ; options . setConnectionTimeout ( 10 ) ; CLIENT . connect ( options ) ; } return CLIENT ;
public class XPathImpl { /** * < p > Evaluate an < code > XPath < / code > expression in the specified context and return the result as the specified type . < / p > * < p > See " Evaluation of XPath Expressions " section of JAXP 1.3 spec * for context item evaluation , * variable , function and < code > QName < / code > resolution and return type conversion . < / p > * < p > If < code > returnType < / code > is not one of the types defined in { @ link XPathConstants } ( * { @ link XPathConstants # NUMBER NUMBER } , * { @ link XPathConstants # STRING STRING } , * { @ link XPathConstants # BOOLEAN BOOLEAN } , * { @ link XPathConstants # NODE NODE } or * { @ link XPathConstants # NODESET NODESET } ) * then an < code > IllegalArgumentException < / code > is thrown . < / p > * < p > If a < code > null < / code > value is provided for * < code > item < / code > , an empty document will be used for the * context . * If < code > expression < / code > or < code > returnType < / code > is < code > null < / code > , then a * < code > NullPointerException < / code > is thrown . < / p > * @ param expression The XPath expression . * @ param item The starting context ( node or node list , for example ) . * @ param returnType The desired return type . * @ return Result of evaluating an XPath expression as an < code > Object < / code > of < code > returnType < / code > . * @ throws XPathExpressionException If < code > expression < / code > cannot be evaluated . * @ throws IllegalArgumentException If < code > returnType < / code > is not one of the types defined in { @ link XPathConstants } . * @ throws NullPointerException If < code > expression < / code > or < code > returnType < / code > is < code > null < / code > . */ public Object evaluate ( String expression , Object item , QName returnType ) throws XPathExpressionException { } }
if ( expression == null ) { String fmsg = XSLMessages . createXPATHMessage ( XPATHErrorResources . ER_ARG_CANNOT_BE_NULL , new Object [ ] { "XPath expression" } ) ; throw new NullPointerException ( fmsg ) ; } if ( returnType == null ) { String fmsg = XSLMessages . createXPATHMessage ( XPATHErrorResources . ER_ARG_CANNOT_BE_NULL , new Object [ ] { "returnType" } ) ; throw new NullPointerException ( fmsg ) ; } // Checking if requested returnType is supported . returnType need to // be defined in XPathConstants if ( ! isSupported ( returnType ) ) { String fmsg = XSLMessages . createXPATHMessage ( XPATHErrorResources . ER_UNSUPPORTED_RETURN_TYPE , new Object [ ] { returnType . toString ( ) } ) ; throw new IllegalArgumentException ( fmsg ) ; } try { XObject resultObject = eval ( expression , item ) ; return getResultAsType ( resultObject , returnType ) ; } catch ( java . lang . NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ) ; } catch ( javax . xml . transform . TransformerException te ) { Throwable nestedException = te . getException ( ) ; if ( nestedException instanceof javax . xml . xpath . XPathFunctionException ) { throw ( javax . xml . xpath . XPathFunctionException ) nestedException ; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException ( te ) ; } }
public class HivePartitionVersionRetentionCleaner { /** * If simulate is set to true , this will simply return . * If version is pointing to an empty location , drop the partition and close the jdbc connection . * If version is pointing to the same location as of the dataset , then drop the partition and close the jdbc connection . * If version is pointing to the non deletable version locations , then drop the partition and close the jdbc connection . * Otherwise delete the data underneath , drop the partition and close the jdbc connection . */ @ Override public void clean ( ) throws IOException { } }
Path versionLocation = ( ( HivePartitionRetentionVersion ) this . datasetVersion ) . getLocation ( ) ; Path datasetLocation = ( ( CleanableHivePartitionDataset ) this . cleanableDataset ) . getLocation ( ) ; String completeName = ( ( HivePartitionRetentionVersion ) this . datasetVersion ) . datasetURN ( ) ; State state = new State ( this . state ) ; this . fs = ProxyUtils . getOwnerFs ( state , this . versionOwner ) ; try ( HiveProxyQueryExecutor queryExecutor = ProxyUtils . getQueryExecutor ( state , this . versionOwner ) ) { log . info ( "Trying to clean version " + completeName ) ; if ( ! this . fs . exists ( versionLocation ) ) { log . info ( "Data versionLocation doesn't exist. Metadata will be dropped for the version " + completeName ) ; } else if ( datasetLocation . toString ( ) . equalsIgnoreCase ( versionLocation . toString ( ) ) ) { log . info ( "Dataset location is same as version location. Won't delete the data but metadata will be dropped for the version " + completeName ) ; } else if ( this . nonDeletableVersionLocations . contains ( versionLocation . toString ( ) ) ) { log . info ( "This version corresponds to the non deletable version. Won't delete the data but metadata will be dropped for the version " + completeName ) ; } else if ( HadoopUtils . hasContent ( this . fs , versionLocation ) ) { if ( this . simulate ) { log . info ( "Simulate is set to true. Won't delete the partition " + completeName ) ; return ; } log . info ( "Deleting data from the version " + completeName ) ; this . fs . delete ( versionLocation , true ) ; } executeDropVersionQueries ( queryExecutor ) ; }
public class ClassDefinitionFactory { /** * Generates a bean , and adds it to the composite class loader that * everything is using . */ public ClassDefinition generateDeclaredBean ( AbstractClassTypeDeclarationDescr typeDescr , TypeDeclaration type , PackageRegistry pkgRegistry , List < TypeDefinition > unresolvedTypeDefinitions , Map < String , AbstractClassTypeDeclarationDescr > unprocesseableDescrs ) { } }
ClassDefinition def = createClassDefinition ( typeDescr , type ) ; boolean success = true ; success &= wireAnnotationDefs ( typeDescr , type , def , pkgRegistry . getTypeResolver ( ) ) ; success &= wireEnumLiteralDefs ( typeDescr , type , def ) ; success &= wireFields ( typeDescr , type , def , pkgRegistry , unresolvedTypeDefinitions ) ; if ( ! success ) { unprocesseableDescrs . put ( typeDescr . getType ( ) . getFullName ( ) , typeDescr ) ; } // attach the class definition , it will be completed later type . setTypeClassDef ( def ) ; return def ;
public class ShapeRenderer { /** * Draw the the given shape filled in . Only the vertices are set . * The colour has to be set independently of this method . * @ param shape The shape to fill . * @ param callback The callback that will be invoked for each shape point */ private static final void fill ( Shape shape , PointCallback callback ) { } }
Triangulator tris = shape . getTriangles ( ) ; GL . glBegin ( SGL . GL_TRIANGLES ) ; for ( int i = 0 ; i < tris . getTriangleCount ( ) ; i ++ ) { for ( int p = 0 ; p < 3 ; p ++ ) { float [ ] pt = tris . getTrianglePoint ( i , p ) ; float [ ] np = callback . preRenderPoint ( shape , pt [ 0 ] , pt [ 1 ] ) ; if ( np == null ) { GL . glVertex2f ( pt [ 0 ] , pt [ 1 ] ) ; } else { GL . glVertex2f ( np [ 0 ] , np [ 1 ] ) ; } } } GL . glEnd ( ) ;
public class CompositeFileSystem { /** * { @ inheritDoc } */ public Entry get ( String path ) { } }
for ( FileSystem delegate : delegates ) { Entry entry = delegate . get ( path ) ; if ( entry == null ) { continue ; } if ( entry instanceof DirectoryEntry ) { return DefaultDirectoryEntry . equivalent ( this , ( DirectoryEntry ) entry ) ; } return entry ; } return null ;
public class AtlasClient { /** * Returns all type names in the system * @ return list of type names * @ throws AtlasServiceException */ public List < String > listTypes ( ) throws AtlasServiceException { } }
final JSONObject jsonObject = callAPIWithQueryParams ( API . LIST_TYPES , null ) ; return extractResults ( jsonObject , AtlasClient . RESULTS , new ExtractOperation < String , String > ( ) ) ;
public class ImplementationGuide { /** * syntactic sugar */ public ImplementationGuideContactComponent addContact ( ) { } }
ImplementationGuideContactComponent t = new ImplementationGuideContactComponent ( ) ; if ( this . contact == null ) this . contact = new ArrayList < ImplementationGuideContactComponent > ( ) ; this . contact . add ( t ) ; return t ;
public class HeapCompactDoublesSketch { /** * Heapifies the given srcMem , which must be a Memory image of a DoublesSketch and may have data . * @ param srcMem a Memory image of a sketch , which may be in compact or not compact form . * < a href = " { @ docRoot } / resources / dictionary . html # mem " > See Memory < / a > * @ return a DoublesSketch on the Java heap . */ static HeapCompactDoublesSketch heapifyInstance ( final Memory srcMem ) { } }
final long memCapBytes = srcMem . getCapacity ( ) ; if ( memCapBytes < Long . BYTES ) { throw new SketchesArgumentException ( "Source Memory too small: " + memCapBytes + " < 8" ) ; } final int preLongs = extractPreLongs ( srcMem ) ; final int serVer = extractSerVer ( srcMem ) ; final int familyID = extractFamilyID ( srcMem ) ; final int flags = extractFlags ( srcMem ) ; final int k = extractK ( srcMem ) ; final boolean empty = ( flags & EMPTY_FLAG_MASK ) > 0 ; // Preamble flags empty state final long n = empty ? 0 : extractN ( srcMem ) ; // VALIDITY CHECKS DoublesUtil . checkDoublesSerVer ( serVer , MIN_HEAP_DOUBLES_SER_VER ) ; Util . checkHeapFlags ( flags ) ; HeapUpdateDoublesSketch . checkPreLongsFlagsSerVer ( flags , serVer , preLongs ) ; Util . checkFamilyID ( familyID ) ; final HeapCompactDoublesSketch hds = new HeapCompactDoublesSketch ( k ) ; // checks k if ( empty ) { hds . n_ = 0 ; hds . combinedBuffer_ = null ; hds . baseBufferCount_ = 0 ; hds . bitPattern_ = 0 ; hds . minValue_ = Double . NaN ; hds . maxValue_ = Double . NaN ; return hds ; } // Not empty , must have valid preamble + min , max , n . // Forward compatibility from SerVer = 1 : final boolean srcIsCompact = ( serVer == 2 ) | ( ( flags & ( COMPACT_FLAG_MASK | READ_ONLY_FLAG_MASK ) ) > 0 ) ; HeapUpdateDoublesSketch . checkHeapMemCapacity ( k , n , srcIsCompact , serVer , memCapBytes ) ; // set class members by computing them hds . n_ = n ; hds . baseBufferCount_ = computeBaseBufferItems ( k , n ) ; hds . bitPattern_ = computeBitPattern ( k , n ) ; hds . minValue_ = srcMem . getDouble ( MIN_DOUBLE ) ; hds . maxValue_ = srcMem . getDouble ( MAX_DOUBLE ) ; final int totItems = Util . computeRetainedItems ( k , n ) ; hds . srcMemoryToCombinedBuffer ( srcMem , serVer , srcIsCompact , totItems ) ; return hds ;
public class Encodings { /** * Load a list of all the supported encodings . * System property " encodings " formatted using URL syntax may define an * external encodings list . Thanks to Sergey Ushakov for the code * contribution ! * @ xsl . usage internal */ private static EncodingInfo [ ] loadEncodingInfo ( ) { } }
try { InputStream is ; SecuritySupport ss = SecuritySupport . getInstance ( ) ; is = ss . getResourceAsStream ( ObjectFactory . findClassLoader ( ) , ENCODINGS_FILE ) ; // j2objc : if resource wasn ' t found , load defaults from string . if ( is == null ) { is = new ByteArrayInputStream ( ENCODINGS_FILE_STR . getBytes ( StandardCharsets . UTF_8 ) ) ; } Properties props = new Properties ( ) ; if ( is != null ) { props . load ( is ) ; is . close ( ) ; } else { // Seems to be no real need to force failure here , let the // system do its best . . . The issue is not really very critical , // and the output will be in any case _ correct _ though maybe not // always human - friendly . . . : ) // But maybe report / log the resource problem ? // Any standard ways to report / log errors ( in static context ) ? } int totalEntries = props . size ( ) ; List encodingInfo_list = new ArrayList ( ) ; Enumeration keys = props . keys ( ) ; for ( int i = 0 ; i < totalEntries ; ++ i ) { String javaName = ( String ) keys . nextElement ( ) ; String val = props . getProperty ( javaName ) ; int len = lengthOfMimeNames ( val ) ; String mimeName ; char highChar ; if ( len == 0 ) { // There is no property value , only the javaName , so try and recover mimeName = javaName ; highChar = '\u0000' ; // don ' t know the high code point , will need to test every character } else { try { // Get the substring after the Mime names final String highVal = val . substring ( len ) . trim ( ) ; highChar = ( char ) Integer . decode ( highVal ) . intValue ( ) ; } catch ( NumberFormatException e ) { highChar = 0 ; } String mimeNames = val . substring ( 0 , len ) ; StringTokenizer st = new StringTokenizer ( mimeNames , "," ) ; for ( boolean first = true ; st . hasMoreTokens ( ) ; first = false ) { mimeName = st . nextToken ( ) ; EncodingInfo ei = new EncodingInfo ( mimeName , javaName , highChar ) ; encodingInfo_list . add ( ei ) ; _encodingTableKeyMime . put ( mimeName . toUpperCase ( ) , ei ) ; if ( first ) _encodingTableKeyJava . put ( javaName . toUpperCase ( ) , ei ) ; } } } // Convert the Vector of EncodingInfo objects into an array of them , // as that is the kind of thing this method returns . EncodingInfo [ ] ret_ei = new EncodingInfo [ encodingInfo_list . size ( ) ] ; encodingInfo_list . toArray ( ret_ei ) ; return ret_ei ; } catch ( java . net . MalformedURLException mue ) { throw new org . apache . xml . serializer . utils . WrappedRuntimeException ( mue ) ; } catch ( java . io . IOException ioe ) { throw new org . apache . xml . serializer . utils . WrappedRuntimeException ( ioe ) ; }
public class CPAttachmentFileEntryPersistenceImpl { /** * Removes all the cp attachment file entries where classNameId = & # 63 ; and classPK = & # 63 ; and type = & # 63 ; and status = & # 63 ; from the database . * @ param classNameId the class name ID * @ param classPK the class pk * @ param type the type * @ param status the status */ @ Override public void removeByC_C_T_ST ( long classNameId , long classPK , int type , int status ) { } }
for ( CPAttachmentFileEntry cpAttachmentFileEntry : findByC_C_T_ST ( classNameId , classPK , type , status , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( cpAttachmentFileEntry ) ; }
public class RepeatInterval { /** * Add this field in the Record ' s field sequence . */ public BaseField setupField ( int iFieldSeq ) { } }
BaseField field = null ; // if ( iFieldSeq = = 0) // field = new CounterField ( this , ID , Constants . DEFAULT _ FIELD _ LENGTH , null , null ) ; // field . setHidden ( true ) ; // if ( iFieldSeq = = 1) // field = new RecordChangedField ( this , LAST _ CHANGED , Constants . DEFAULT _ FIELD _ LENGTH , null , null ) ; // field . setHidden ( true ) ; // if ( iFieldSeq = = 2) // field = new BooleanField ( this , DELETED , Constants . DEFAULT _ FIELD _ LENGTH , null , new Boolean ( false ) ) ; // field . setHidden ( true ) ; if ( iFieldSeq == 3 ) field = new StringField ( this , DESCRIPTION , 30 , null , null ) ; if ( field == null ) field = super . setupField ( iFieldSeq ) ; return field ;
public class Request { /** * Creates a new Request configured to retrieve an App User ID for the app ' s Facebook user . Callers * will send this ID back to their own servers , collect up a set to create a Facebook Custom Audience with , * and then use the resultant Custom Audience to target ads . * The GraphObject in the response will include an " custom _ audience _ third _ party _ id " property , with the value * being the ID retrieved . This ID is an encrypted encoding of the Facebook user ' s ID and the * invoking Facebook app ID . Multiple calls with the same user will return different IDs , thus these IDs cannot be * used to correlate behavior across devices or applications , and are only meaningful when sent back to Facebook * for creating Custom Audiences . * The ID retrieved represents the Facebook user identified in the following way : if the specified session * ( or activeSession if the specified session is ` null ` ) is open , the ID will represent the user associated with * the activeSession ; otherwise the ID will represent the user logged into the native Facebook app on the device . * A ` null ` ID will be provided into the callback if a ) there is no native Facebook app , b ) no one is logged into * it , or c ) the app has previously called * { @ link Settings # setLimitEventAndDataUsage ( android . content . Context , boolean ) } with ` true ` for this user . * < b > You must call this method from a background thread for it to work properly . < / b > * @ param session * the Session to issue the Request on , or null ; if non - null , the session must be in an opened state . * If there is no logged - in Facebook user , null is the expected choice . * @ param context * the Application context from which the app ID will be pulled , and from which the ' attribution ID ' * for the Facebook user is determined . If there has been no app ID set , an exception will be thrown . * @ param callback * a callback that will be called when the request is completed to handle success or error conditions . * The GraphObject in the Response will contain a " custom _ audience _ third _ party _ id " property that * represents the user as described above . * @ return a Request that is ready to execute */ public static Request newCustomAudienceThirdPartyIdRequest ( Session session , Context context , Callback callback ) { } }
return newCustomAudienceThirdPartyIdRequest ( session , context , null , callback ) ;
public class ControlMessageFactoryImpl { /** * Create a new , empty ControlRequestAck Message * @ return The new ControlRequestAck * @ exception MessageCreateFailedException Thrown if such a message can not be created */ public final ControlRequestAck createNewControlRequestAck ( ) throws MessageCreateFailedException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewControlRequestAck" ) ; ControlRequestAck msg = null ; try { msg = new ControlRequestAckImpl ( MfpConstants . CONSTRUCTOR_NO_OP ) ; } catch ( MessageDecodeFailedException e ) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNewControlRequestAck" ) ; return msg ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcPositiveLengthMeasure ( ) { } }
if ( ifcPositiveLengthMeasureEClass == null ) { ifcPositiveLengthMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 767 ) ; } return ifcPositiveLengthMeasureEClass ;
public class JSType { /** * Computes the restricted type of this type knowing that the * { @ code ToBoolean } predicate has a specific value . For more information * about the { @ code ToBoolean } predicate , see * { @ link # getPossibleToBooleanOutcomes } . * @ param outcome the value of the { @ code ToBoolean } predicate * @ return the restricted type , or the Any Type if the underlying type could * not have yielded this ToBoolean value * TODO ( user ) : Move this method to the SemanticRAI and use the visit * method of types to get the restricted type . */ public JSType getRestrictedTypeGivenToBooleanOutcome ( boolean outcome ) { } }
if ( outcome && areIdentical ( this , getNativeType ( JSTypeNative . UNKNOWN_TYPE ) ) ) { return getNativeType ( JSTypeNative . CHECKED_UNKNOWN_TYPE ) ; } BooleanLiteralSet literals = getPossibleToBooleanOutcomes ( ) ; if ( literals . contains ( outcome ) ) { return this ; } else { return getNativeType ( JSTypeNative . NO_TYPE ) ; }
public class DocumentsRenderer { /** * Creates a simple content model to use in individual post navigations . * @ param document * @ return */ private Map < String , Object > getContentForNav ( Map < String , Object > document ) { } }
Map < String , Object > navDocument = new HashMap < > ( ) ; navDocument . put ( Attributes . NO_EXTENSION_URI , document . get ( Attributes . NO_EXTENSION_URI ) ) ; navDocument . put ( Attributes . URI , document . get ( Attributes . URI ) ) ; navDocument . put ( Attributes . TITLE , document . get ( Attributes . TITLE ) ) ; return navDocument ;
public class KeysAndAttributesMarshaller { /** * Marshall the given parameter object . */ public void marshall ( KeysAndAttributes keysAndAttributes , ProtocolMarshaller protocolMarshaller ) { } }
if ( keysAndAttributes == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( keysAndAttributes . getKeys ( ) , KEYS_BINDING ) ; protocolMarshaller . marshall ( keysAndAttributes . getAttributesToGet ( ) , ATTRIBUTESTOGET_BINDING ) ; protocolMarshaller . marshall ( keysAndAttributes . getConsistentRead ( ) , CONSISTENTREAD_BINDING ) ; protocolMarshaller . marshall ( keysAndAttributes . getProjectionExpression ( ) , PROJECTIONEXPRESSION_BINDING ) ; protocolMarshaller . marshall ( keysAndAttributes . getExpressionAttributeNames ( ) , EXPRESSIONATTRIBUTENAMES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Form { /** * Returns for given parameter < i > _ name < / i > the instance of class * { @ link Form } . * @ param _ name name to search in the cache * @ return instance of class { @ link Form } * @ throws CacheReloadException on error */ public static Form get ( final String _name ) throws CacheReloadException { } }
return AbstractUserInterfaceObject . < Form > get ( _name , Form . class , CIAdminUserInterface . Form . getType ( ) ) ;
public class AuditCollectorUtil { /** * Make audit api rest call and parse response */ protected static JSONObject parseObject ( String url , AuditSettings settings ) { } }
LOGGER . info ( "NFRR Audit Collector Audit API Call" ) ; RestTemplate restTemplate = new RestTemplate ( ) ; JSONObject responseObj = null ; try { ResponseEntity < String > response = restTemplate . exchange ( url , HttpMethod . GET , getHeaders ( settings ) , String . class ) ; JSONParser jsonParser = new JSONParser ( ) ; responseObj = ( JSONObject ) jsonParser . parse ( response . getBody ( ) ) ; } catch ( Exception e ) { LOGGER . error ( "Error while calling audit api for the params : " + url . substring ( url . lastIndexOf ( "?" ) ) , e ) ; } return responseObj ;
public class RecordConverter { /** * Convert a collection into a ` List < Writable > ` , i . e . a record that can be used with other datavec methods . * Uses a schema to decide what kind of writable to use . * @ return a record */ public static List < Writable > toRecord ( Schema schema , List < Object > source ) { } }
final List < Writable > record = new ArrayList < > ( source . size ( ) ) ; final List < ColumnMetaData > columnMetaData = schema . getColumnMetaData ( ) ; if ( columnMetaData . size ( ) != source . size ( ) ) { throw new IllegalArgumentException ( "Schema and source list don't have the same length!" ) ; } for ( int i = 0 ; i < columnMetaData . size ( ) ; i ++ ) { final ColumnMetaData metaData = columnMetaData . get ( i ) ; final Object data = source . get ( i ) ; if ( ! metaData . isValid ( data ) ) { throw new IllegalArgumentException ( "Element " + i + ": " + data + " is not valid for Column \"" + metaData . getName ( ) + "\" (" + metaData . getColumnType ( ) + ")" ) ; } try { final Writable writable ; switch ( metaData . getColumnType ( ) . getWritableType ( ) ) { case Float : writable = new FloatWritable ( ( Float ) data ) ; break ; case Double : writable = new DoubleWritable ( ( Double ) data ) ; break ; case Int : writable = new IntWritable ( ( Integer ) data ) ; break ; case Byte : writable = new ByteWritable ( ( Byte ) data ) ; break ; case Boolean : writable = new BooleanWritable ( ( Boolean ) data ) ; break ; case Long : writable = new LongWritable ( ( Long ) data ) ; break ; case Null : writable = new NullWritable ( ) ; break ; case Bytes : writable = new BytesWritable ( ( byte [ ] ) data ) ; break ; case NDArray : writable = new NDArrayWritable ( ( INDArray ) data ) ; break ; case Text : if ( data instanceof String ) writable = new Text ( ( String ) data ) ; else if ( data instanceof Text ) writable = new Text ( ( Text ) data ) ; else if ( data instanceof byte [ ] ) writable = new Text ( ( byte [ ] ) data ) ; else throw new IllegalArgumentException ( "Element " + i + ": " + data + " is not usable for Column \"" + metaData . getName ( ) + "\" (" + metaData . getColumnType ( ) + ")" ) ; break ; default : throw new IllegalArgumentException ( "Element " + i + ": " + data + " is not usable for Column \"" + metaData . getName ( ) + "\" (" + metaData . getColumnType ( ) + ")" ) ; } record . add ( writable ) ; } catch ( ClassCastException e ) { throw new IllegalArgumentException ( "Element " + i + ": " + data + " is not usable for Column \"" + metaData . getName ( ) + "\" (" + metaData . getColumnType ( ) + ")" , e ) ; } } return record ;
public class AdditionalAnswers { /** * Returns an answer after a delay with a defined length . * @ param < T > return type * @ param sleepyTime the delay in milliseconds * @ param answer interface to the answer which provides the intended return value . * @ return the answer object to use * @ since 2.8.44 */ @ Incubating public static < T > Answer < T > answersWithDelay ( long sleepyTime , Answer < T > answer ) { } }
return ( Answer < T > ) new AnswersWithDelay ( sleepyTime , ( Answer < Object > ) answer ) ;
public class WebhooksInner { /** * Creates a webhook for a container registry with the specified parameters . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param webhookName The name of the webhook . * @ param webhookCreateParameters The parameters for creating a webhook . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the WebhookInner object if successful . */ public WebhookInner create ( String resourceGroupName , String registryName , String webhookName , WebhookCreateParameters webhookCreateParameters ) { } }
return createWithServiceResponseAsync ( resourceGroupName , registryName , webhookName , webhookCreateParameters ) . toBlocking ( ) . last ( ) . body ( ) ;
public class CreateMojo { /** * Formats the given argument using the configured format template and locale . * @ param arguments arguments to be formatted @ @ return formatted result */ private String format ( Object [ ] arguments ) { } }
Locale l = Locale . getDefault ( ) ; if ( locale != null ) { String [ ] parts = locale . split ( "_" , 3 ) ; if ( parts . length <= 1 ) { l = new Locale ( locale ) ; } else if ( parts . length == 2 ) { l = new Locale ( parts [ 0 ] , parts [ 1 ] ) ; } else { l = new Locale ( parts [ 0 ] , parts [ 1 ] , parts [ 2 ] ) ; } } return new MessageFormat ( format , l ) . format ( arguments ) ;
public class WebAppDescriptorImpl { /** * If not already created , a new < code > filter < / code > element will be created and returned . * Otherwise , the first existing < code > filter < / code > element will be returned . * @ return the instance defined for the element < code > filter < / code > */ public FilterType < WebAppDescriptor > getOrCreateFilter ( ) { } }
List < Node > nodeList = model . get ( "filter" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new FilterTypeImpl < WebAppDescriptor > ( this , "filter" , model , nodeList . get ( 0 ) ) ; } return createFilter ( ) ;
public class ST_MakePoint { /** * Constructs POINT from two doubles . * @ param x X - coordinate * @ param y Y - coordinate * @ return The POINT constructed from the given coordinatesk * @ throws java . sql . SQLException */ public static Point createPoint ( double x , double y ) throws SQLException { } }
return createPoint ( x , y , Coordinate . NULL_ORDINATE ) ;
public class WSStartupRecoveryServiceImpl { /** * Look in the db for any partitions that this server executed with batch status of STARTING , STARTED , STOPPING * If we are starting up , and we already have jobs in on of the state above , * meaning those jobs did not finish when something happened to the server ( jvm down , hang , etc ) * Reset all those jobs to have batch status = exit status = FAILED */ public WSStartupRecoveryServiceImpl recoverLocalPartitionsInInflightStates ( ) { } }
String methodName = "recoverLocalPartitionsInInflightStates" ; try { List < RemotablePartitionEntity > remotablePartitions = persistenceManagerService . getPartitionsRunningLocalToServer ( psu ) ; for ( RemotablePartitionEntity partition : remotablePartitions ) { StepThreadExecutionEntity stepExecution = partition . getStepExecution ( ) ; RemotablePartitionKey key = new RemotablePartitionKey ( stepExecution ) ; String newExitStatus = stepExecution . getExitStatus ( ) ; if ( newExitStatus == null ) { newExitStatus = BatchStatus . FAILED . name ( ) ; } if ( logger . isLoggable ( Level . FINE ) ) { logger . fine ( methodName + ": marking [partition = " + key + ",old batchStatus=" + stepExecution . getBatchStatus ( ) . name ( ) + " to new batchStatus=FAILED, new exitStatus=" + newExitStatus + "]" ) ; } // The world is a more orderly place with these two timestamp values showing the same ! Date markFailedTime = new Date ( ) ; try { persistenceManagerService . updateStepExecutionOnRecovery ( psu , stepExecution . getStepExecutionId ( ) , BatchStatus . FAILED , newExitStatus , markFailedTime ) ; persistenceManagerService . updateRemotablePartitionOnRecovery ( psu , partition ) ; } catch ( Exception updateExc ) { logger . log ( Level . WARNING , "partition.recovery.failed" , new Object [ ] { key , updateExc } ) ; } } } catch ( Exception exception ) { logger . log ( Level . WARNING , "recovery.failed" , exception ) ; } return this ;
public class AnnotationUtils { /** * Retrieve the < em > value < / em > of a named attribute , given an annotation instance . * @ param annotation the annotation instance from which to retrieve the value * @ param attributeName the name of the attribute value to retrieve * @ return the attribute value , or { @ code null } if not found * @ see # getValue ( Annotation ) */ public static Object getValue ( Annotation annotation , String attributeName ) { } }
if ( annotation == null || ! StringUtils . hasLength ( attributeName ) ) { return null ; } try { Method method = annotation . annotationType ( ) . getDeclaredMethod ( attributeName ) ; ReflectionUtils . makeAccessible ( method ) ; return method . invoke ( annotation ) ; } catch ( Exception ex ) { return null ; }
public class FileScanner { /** * 开始搜索目录 . 当前搜索会停止之前的搜索 */ public void startSearch ( ) { } }
stopSearch ( ) ; stop = false ; MiscUtils . getExecutor ( ) . execute ( new Runnable ( ) { @ Override public void run ( ) { isSearching = true ; try { if ( finder != null ) { finder . start ( ) ; } for ( String aSrPath : srPath ) { getFile ( new File ( aSrPath ) ) ; } if ( ! stop && finder != null ) { finder . finished ( ) ; } } finally { isSearching = false ; } } } ) ;
public class WalletManager { /** * Get all wallets * @ return * @ throws BitfinexClientException */ public Collection < BitfinexWallet > getWallets ( ) throws BitfinexClientException { } }
throwExceptionIfUnauthenticated ( ) ; synchronized ( walletTable ) { return Collections . unmodifiableCollection ( walletTable . values ( ) ) ; }
public class MPP8Reader { /** * There appear to be two ways of representing task notes in an MPP8 file . * This method tries to determine which has been used . * @ param task task * @ param data task data * @ param taskExtData extended task data * @ param taskVarData task var data */ private void setTaskNotes ( Task task , byte [ ] data , ExtendedData taskExtData , FixDeferFix taskVarData ) { } }
String notes = taskExtData . getString ( TASK_NOTES ) ; if ( notes == null && data . length == 366 ) { byte [ ] offsetData = taskVarData . getByteArray ( getOffset ( data , 362 ) ) ; if ( offsetData != null && offsetData . length >= 12 ) { notes = taskVarData . getString ( getOffset ( offsetData , 8 ) ) ; // We do pick up some random stuff with this approach , and // we don ' t know enough about the file format to know when to ignore it // so we ' ll use a heuristic here to ignore anything that // doesn ' t look like RTF . if ( notes != null && notes . indexOf ( '{' ) == - 1 ) { notes = null ; } } } if ( notes != null ) { if ( m_reader . getPreserveNoteFormatting ( ) == false ) { notes = RtfHelper . strip ( notes ) ; } task . setNotes ( notes ) ; }
public class UserInterfaceApi { /** * Open New Mail Window ( asynchronously ) Open the New Mail window , according * to settings from the request if applicable - - - SSO Scope : * esi - ui . open _ window . v1 * @ param datasource * The server name you would like data from ( optional , default to * tranquility ) * @ param token * Access token to use if unable to set a header ( optional ) * @ param uiNewMail * ( optional ) * @ param callback * The callback to be executed when the API call finishes * @ return The request call * @ throws ApiException * If fail to process the API call , e . g . serializing the request * body object */ public com . squareup . okhttp . Call postUiOpenwindowNewmailAsync ( String datasource , String token , UiNewMail uiNewMail , final ApiCallback < Void > callback ) throws ApiException { } }
com . squareup . okhttp . Call call = postUiOpenwindowNewmailValidateBeforeCall ( datasource , token , uiNewMail , callback ) ; apiClient . executeAsync ( call , callback ) ; return call ;
public class PicoNetwork { /** * Called when unregistration is complete and the Connection can no * longer be interacted with . * Various error paths fall back to unregistering so it can happen multiple times and is really * annoying . Suppress it here with a flag */ void unregistered ( ) { } }
try { if ( ! m_alreadyStopped ) { try { safeStopping ( ) ; } finally { try { m_writeStream . shutdown ( ) ; } finally { m_readStream . shutdown ( ) ; } } } } finally { networkLog . debug ( "Closing channel " + m_threadName ) ; try { m_sc . close ( ) ; } catch ( IOException e ) { networkLog . warn ( e ) ; } }
public class MathBindings { /** * Binding for { @ link java . lang . Math # nextDown ( float ) } * @ param f starting floating - point value * @ return The adjacent floating - point value closer to negative * infinity . */ public static FloatBinding nextDown ( final ObservableFloatValue f ) { } }
return createFloatBinding ( ( ) -> Math . nextDown ( f . get ( ) ) , f ) ;
public class OWLDisjointUnionAxiomImpl_CustomFieldSerializer { /** * Deserializes the content of the object from the * { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } . * @ param streamReader the { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } to read the * object ' s content from * @ param instance the object instance to deserialize * @ throws com . google . gwt . user . client . rpc . SerializationException * if the deserialization operation is not * successful */ @ Override public void deserializeInstance ( SerializationStreamReader streamReader , OWLDisjointUnionAxiomImpl instance ) throws SerializationException { } }
deserialize ( streamReader , instance ) ;
public class ActionMapping { /** * o routing path of forward e . g . / member / list / - > MemberListAction */ public NextJourney createNextJourney ( PlannedJourneyProvider journeyProvider , HtmlResponse response ) { } }
// almost copied from super String path = response . getRoutingPath ( ) ; final boolean redirectTo = response . isRedirectTo ( ) ; if ( path . indexOf ( ":" ) < 0 ) { if ( ! path . startsWith ( "/" ) ) { path = buildActionPath ( getActionDef ( ) . getComponentName ( ) ) + path ; } if ( ! redirectTo && isHtmlForward ( path ) ) { path = filterHtmlPath ( path ) ; } } return newNextJourney ( journeyProvider , path , redirectTo , response . isAsIs ( ) , response . getViewObject ( ) ) ;
public class Codec { /** * Initializes the { @ code Codec } with a dictionary that may contain specific codec * parameters and a previously created codec context . * @ param avDictionary dictionary with codec parameters . * @ param avContext codec context . * @ return zero on success , a negative value on error . * @ throws JavaAVException if the codec could not be opened . */ int open ( AVDictionary avDictionary , AVCodecContext avContext ) throws JavaAVException { } }
if ( avContext == null ) throw new JavaAVException ( "Could not open codec. Codec context is null." ) ; this . avContext = avContext ; return avcodec_open2 ( avContext , avCodec , avDictionary ) ;