signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Op { /** * Creates an < i > operation expression < / i > on the specified target object . * @ param target the target object on which the expression will execute * @ return an operator , ready for chaining */ public static < T > Level0IndefiniteArrayOperator < T [ ] , T > onArray ( final T [ ] target ) { } }
return new Level0IndefiniteArrayOperator < T [ ] , T > ( ExecutionTarget . forOp ( target , Normalisation . NONE ) ) ;
public class StateMachine { /** * Add this state to the queue so that the client thread can process the state transition when it is next in control . < br > * We only allow the client thread to transition the state . * @ param state the state to transition to . */ public void queueStateChange ( IState state ) { } }
synchronized ( this . stateQueue ) { if ( this . stateQueue . size ( ) != 0 ) { // The queue is only a method for ensuring the transition is carried out on the correct thread - transitions should // never happen so quickly that we end up with more than one state in the queue . System . out . println ( "STATE ERROR - multiple states in the queue." ) ; } this . stateQueue . add ( state ) ; System . out . println ( getName ( ) + " request state: " + state ) ; TCPUtils . Log ( Level . INFO , "-------- " + getName ( ) + " request state: " + state + " --------" ) ; }
public class ClassReader { /** * Extract a double at position bp from buf . */ double getDouble ( int bp ) { } }
DataInputStream bufin = new DataInputStream ( new ByteArrayInputStream ( buf , bp , 8 ) ) ; try { return bufin . readDouble ( ) ; } catch ( IOException e ) { throw new AssertionError ( e ) ; }
public class ConnectionDAODefaultImpl { protected void throwNotAuthorizedException ( String desc , String origin ) throws DevFailed { } }
Except . throw_connection_failed ( "TangoApi_READ_ONLY_MODE" , desc + " is not authorized for:\n" + ApiUtilDAODefaultImpl . getUser ( ) + " on " + ApiUtil . getHostName ( ) , // + " ( " + ApiUtil . getHostAddress ( ) + " ) " , origin ) ;
public class Solver { /** * Ends subSolvers data collection . */ protected void end ( ) { } }
if ( subSolver != null && subSolver . subSolver == null ) { if ( type == OperatorDescrType . AND ) { if ( possibilityLists . isEmpty ( ) ) { possibilityLists . add ( new HashSet < VerifierComponent > ( ) ) ; } List < Set < VerifierComponent > > newPossibilities = new ArrayList < Set < VerifierComponent > > ( ) ; List < Set < VerifierComponent > > sets = subSolver . getPossibilityLists ( ) ; for ( Set < VerifierComponent > possibilityList : possibilityLists ) { for ( Set < VerifierComponent > set : sets ) { Set < VerifierComponent > newSet = new HashSet < VerifierComponent > ( ) ; newSet . addAll ( possibilityList ) ; newSet . addAll ( set ) ; newPossibilities . add ( newSet ) ; } } possibilityLists = newPossibilities ; } else if ( type == OperatorDescrType . OR ) { possibilityLists . addAll ( subSolver . getPossibilityLists ( ) ) ; } subSolver = null ; } else if ( subSolver != null && subSolver . subSolver != null ) { subSolver . end ( ) ; }
public class JMTimeCalculator { /** * Gets timestamp minus parameters . * @ param targetTimestamp the target timestamp * @ param numOfWeeks the num of weeks * @ param numOfDays the num of days * @ param numOfHours the num of hours * @ param numOfMinutes the num of minutes * @ param numOfSeconds the num of seconds * @ return the timestamp minus parameters */ public static long getTimestampMinusParameters ( long targetTimestamp , int numOfWeeks , int numOfDays , int numOfHours , int numOfMinutes , int numOfSeconds ) { } }
long sumOfParameters = numOfWeeks * aWeek + numOfDays * aDay + numOfHours * anHour + numOfMinutes * aMinute + numOfSeconds * aSecond ; return targetTimestamp - sumOfParameters ;
public class WebSockets { /** * Sends a complete ping message , invoking the callback when complete * Automatically frees the pooled byte buffer when done . * @ param pooledData The data to send , it will be freed when done * @ param wsChannel The web socket channel * @ param callback The callback to invoke on completion * @ param context The context object that will be passed to the callback on completion */ public static < T > void sendPing ( final PooledByteBuffer pooledData , final WebSocketChannel wsChannel , final WebSocketCallback < T > callback , T context ) { } }
sendInternal ( pooledData , WebSocketFrameType . PING , wsChannel , callback , context , - 1 ) ;
public class AppServiceEnvironmentsInner { /** * Get a diagnostics item for an App Service Environment . * Get a diagnostics item for an App Service Environment . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the App Service Environment . * @ param diagnosticsName Name of the diagnostics item . * @ 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 HostingEnvironmentDiagnosticsInner object if successful . */ public HostingEnvironmentDiagnosticsInner getDiagnosticsItem ( String resourceGroupName , String name , String diagnosticsName ) { } }
return getDiagnosticsItemWithServiceResponseAsync ( resourceGroupName , name , diagnosticsName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class GUIHierarchyConcatenationProperties { /** * Searches over the group of { @ code GUIProperties } for a property list * corresponding to the given name . * @ param propertyName * property name to be found * @ return the first property list found associated with a concatenation of * the given names * @ throws MissingGUIPropertyException */ public List < String > getPropertyValueAsList ( String propertyName ) { } }
String [ ] propertyNames = new String [ 1 ] ; propertyNames [ 0 ] = propertyName ; return getPropertyValueAsList ( propertyNames ) ;
public class Optimizer { /** * The true matcher is sometimes used as a placeholder while parsing . For sequences it isn ' t * needed and it is faster to leave them out . */ static Matcher removeTrueInSequence ( Matcher matcher ) { } }
if ( matcher instanceof SeqMatcher ) { List < Matcher > matchers = matcher . < SeqMatcher > as ( ) . matchers ( ) ; List < Matcher > ms = new ArrayList < > ( ) ; for ( Matcher m : matchers ) { if ( ! ( m instanceof TrueMatcher ) ) { ms . add ( m ) ; } } return SeqMatcher . create ( ms ) ; } return matcher ;
public class AbstractSphere3F { /** * Replies if the given point is inside the given sphere . * @ param cx is the center of the sphere . * @ param cy is the center of the sphere . * @ param cz is the center of the sphere . * @ param radius is the radius of the sphere . * @ param px is the point to test . * @ param py is the point to test . * @ param pz is the point to test . * @ return < code > true < / code > if the point is inside the circle ; * < code > false < / code > if not . */ @ Pure public static boolean containsSpherePoint ( double cx , double cy , double cz , double radius , double px , double py , double pz ) { } }
return FunctionalPoint3D . distanceSquaredPointPoint ( px , py , pz , cx , cy , cz ) <= ( radius * radius ) ;
public class BufferedServletOutputStream { /** * Initializes the output stream with the specified raw output stream . * @ param out the raw output stream */ public void init ( OutputStream out , int bufSize ) { } }
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { // 306998.15 logger . logp ( Level . FINE , CLASS_NAME , "init" , "init" , out ) ; } // make sure that we don ' t have anything hanging around between // init ( ) s - - this is the fix for the broken pipe error being // returned to the browser initNewBuffer ( out , bufSize ) ;
public class DoubleArrayTrie { /** * Load Stored data * @ param input input stream to read the double array trie from * @ return double array trie , not null * @ throws IOException if an IO error occured during reading the double array trie */ public static DoubleArrayTrie read ( InputStream input ) throws IOException { } }
DoubleArrayTrie trie = new DoubleArrayTrie ( ) ; DataInputStream dis = new DataInputStream ( new BufferedInputStream ( input ) ) ; trie . compact = dis . readBoolean ( ) ; int baseCheckSize = dis . readInt ( ) ; // Read size of baseArr and checkArr int tailSize = dis . readInt ( ) ; // Read size of tailArr ReadableByteChannel channel = Channels . newChannel ( dis ) ; ByteBuffer tmpBaseBuffer = ByteBuffer . allocate ( baseCheckSize * 4 ) ; channel . read ( tmpBaseBuffer ) ; tmpBaseBuffer . rewind ( ) ; trie . baseBuffer = tmpBaseBuffer . asIntBuffer ( ) ; ByteBuffer tmpCheckBuffer = ByteBuffer . allocate ( baseCheckSize * 4 ) ; channel . read ( tmpCheckBuffer ) ; tmpCheckBuffer . rewind ( ) ; trie . checkBuffer = tmpCheckBuffer . asIntBuffer ( ) ; ByteBuffer tmpTailBuffer = ByteBuffer . allocate ( tailSize * 2 ) ; channel . read ( tmpTailBuffer ) ; tmpTailBuffer . rewind ( ) ; trie . tailBuffer = tmpTailBuffer . asCharBuffer ( ) ; input . close ( ) ; return trie ;
public class JsonAssert { /** * Asserts that given node is present and is of type string . * @ return */ public StringAssert isString ( ) { } }
Node node = assertType ( STRING ) ; return new StringAssert ( ( String ) node . getValue ( ) ) . as ( "Different value found in node \"%s\"" , path ) ;
public class ConfigClient { /** * Changes one or more properties of an existing exclusion . * < p > Sample code : * < pre > < code > * try ( ConfigClient configClient = ConfigClient . create ( ) ) { * ExclusionName name = ProjectExclusionName . of ( " [ PROJECT ] " , " [ EXCLUSION ] " ) ; * LogExclusion exclusion = LogExclusion . newBuilder ( ) . build ( ) ; * FieldMask updateMask = FieldMask . newBuilder ( ) . build ( ) ; * LogExclusion response = configClient . updateExclusion ( name . toString ( ) , exclusion , updateMask ) ; * < / code > < / pre > * @ param name Required . The resource name of the exclusion to update : * < p > " projects / [ PROJECT _ ID ] / exclusions / [ EXCLUSION _ ID ] " * " organizations / [ ORGANIZATION _ ID ] / exclusions / [ EXCLUSION _ ID ] " * " billingAccounts / [ BILLING _ ACCOUNT _ ID ] / exclusions / [ EXCLUSION _ ID ] " * " folders / [ FOLDER _ ID ] / exclusions / [ EXCLUSION _ ID ] " * < p > Example : ` " projects / my - project - id / exclusions / my - exclusion - id " ` . * @ param exclusion Required . New values for the existing exclusion . Only the fields specified in * ` update _ mask ` are relevant . * @ param updateMask Required . A nonempty list of fields to change in the existing exclusion . New * values for the fields are taken from the corresponding fields in the * [ LogExclusion ] [ google . logging . v2 . LogExclusion ] included in this request . Fields not * mentioned in ` update _ mask ` are not changed and are ignored in the request . * < p > For example , to change the filter and description of an exclusion , specify an * ` update _ mask ` of ` " filter , description " ` . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ public final LogExclusion updateExclusion ( String name , LogExclusion exclusion , FieldMask updateMask ) { } }
UpdateExclusionRequest request = UpdateExclusionRequest . newBuilder ( ) . setName ( name ) . setExclusion ( exclusion ) . setUpdateMask ( updateMask ) . build ( ) ; return updateExclusion ( request ) ;
public class JsonTranscoder { /** * Converts a { @ link ByteBuf } representing a valid JSON entity to a generic { @ link Object } , * < b > without releasing the buffer < / b > . The entity can either be a JSON object , array or scalar value , potentially with leading whitespace ( which gets ignored ) . * Detection of JSON objects and arrays is attempted in order not to incur an * additional conversion step ( JSON to Map to JsonObject for example ) , but if a * Map or List is produced , it will be transformed to { @ link JsonObject } or * { @ link JsonArray } ( with a warning logged ) . * @ param input the buffer to convert . It won ' t be cleared ( contrary to * { @ link # doDecode ( String , ByteBuf , long , int , int , ResponseStatus ) classical decode } ) * @ return a Object decoded from the buffer * @ throws Exception */ public Object byteBufJsonValueToObject ( ByteBuf input ) throws Exception { } }
return TranscoderUtils . byteBufToGenericObject ( input , JacksonTransformers . MAPPER ) ;
public class WasHttpAppSessionGlobalObserver { /** * Method sessionDidActivate * @ see com . ibm . wsspi . session . ISessionObserver # sessionDidActivate ( com . ibm . wsspi . session . ISession ) */ public void sessionDidActivate ( ISession session ) { } }
HttpSession httpsession = ( HttpSessionImpl ) _adapter . adapt ( session ) ; HttpSessionEvent event = new HttpSessionEvent ( httpsession ) ; Enumeration enum1 = session . getAttributeNames ( ) ; String attrName ; Object attr ; while ( enum1 . hasMoreElements ( ) ) { attrName = ( String ) enum1 . nextElement ( ) ; attr = session . getAttribute ( attrName ) ; if ( attr instanceof HttpSessionActivationListener ) { ( ( HttpSessionActivationListener ) attr ) . sessionDidActivate ( event ) ; } }
public class ListTagsForResourceResult { /** * A list of cost allocation tags as key - value pairs . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setTagList ( java . util . Collection ) } or { @ link # withTagList ( java . util . Collection ) } if you want to override * the existing values . * @ param tagList * A list of cost allocation tags as key - value pairs . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListTagsForResourceResult withTagList ( Tag ... tagList ) { } }
if ( this . tagList == null ) { setTagList ( new com . amazonaws . internal . SdkInternalList < Tag > ( tagList . length ) ) ; } for ( Tag ele : tagList ) { this . tagList . add ( ele ) ; } return this ;
public class BifurcatedConsumerSessionProxy { /** * Actually performs the read and delete . * @ param msgHandles * @ param tran * @ return Returns the requested messages . * @ throws SISessionUnavailableException * @ throws SISessionDroppedException * @ throws SIConnectionUnavailableException * @ throws SIConnectionDroppedException * @ throws SIResourceException * @ throws SIConnectionLostException * @ throws SILimitExceededException * @ throws SIIncorrectCallException * @ throws SIMessageNotLockedException * @ throws SIErrorException */ private SIBusMessage [ ] _readAndDeleteSet ( SIMessageHandle [ ] msgHandles , SITransaction tran ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SILimitExceededException , SIIncorrectCallException , SIMessageNotLockedException , SIErrorException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "_readAndDeleteSet" , new Object [ ] { msgHandles . length + " msg ids" , tran } ) ; // 531458 Allow minimal tracing to include message ids and tran id if ( TraceComponent . isAnyTracingEnabled ( ) ) { CommsLightTrace . traceMessageIds ( tc , "ReadAndDeleteSetMsgTrace" , msgHandles ) ; } SIBusMessage [ ] messages = null ; CommsByteBuffer request = getCommsByteBuffer ( ) ; request . putShort ( getConnectionObjectID ( ) ) ; request . putShort ( getProxyID ( ) ) ; request . putSITransaction ( tran ) ; request . putSIMessageHandles ( msgHandles ) ; CommsByteBuffer reply = jfapExchange ( request , JFapChannelConstants . SEG_READ_AND_DELETE_SET , JFapChannelConstants . PRIORITY_MEDIUM , true ) ; try { short err = reply . getCommandCompletionCode ( JFapChannelConstants . SEG_READ_AND_DELETE_SET_R ) ; if ( err != CommsConstants . SI_NO_EXCEPTION ) { checkFor_SISessionUnavailableException ( reply , err ) ; checkFor_SISessionDroppedException ( reply , err ) ; checkFor_SIConnectionUnavailableException ( reply , err ) ; checkFor_SIConnectionDroppedException ( reply , err ) ; checkFor_SIResourceException ( reply , err ) ; checkFor_SIConnectionLostException ( reply , err ) ; checkFor_SILimitExceededException ( reply , err ) ; checkFor_SIIncorrectCallException ( reply , err ) ; checkFor_SIMessageNotLockedException ( reply , err ) ; checkFor_SIErrorException ( reply , err ) ; defaultChecker ( reply , err ) ; } int numberOfMessages = reply . getInt ( ) ; messages = new SIBusMessage [ numberOfMessages ] ; for ( int x = 0 ; x < numberOfMessages ; x ++ ) { messages [ x ] = reply . getMessage ( getCommsConnection ( ) ) ; } } finally { reply . release ( false ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "_readAndDeleteSet" , messages ) ; return messages ;
public class SerializerBase { /** * Before this call m _ elementContext . m _ elementURI is null , * which means it is not yet known . After this call it * is non - null , but possibly " " meaning that it is in the * default namespace . * @ return The URI of the element , never null , but possibly " " . */ private String getElementURI ( ) { } }
String uri = null ; // At this point in processing we have received all the // namespace mappings // As we still don ' t know the elements namespace , // we now figure it out . String prefix = getPrefixPart ( m_elemContext . m_elementName ) ; if ( prefix == null ) { // no prefix so lookup the URI of the default namespace uri = m_prefixMap . lookupNamespace ( "" ) ; } else { uri = m_prefixMap . lookupNamespace ( prefix ) ; } if ( uri == null ) { // We didn ' t find the namespace for the // prefix . . . ouch , that shouldn ' t happen . // This is a hack , we really don ' t know // the namespace uri = EMPTYSTRING ; } return uri ;
public class AnnotatedTypeImpl { /** * Builds the annotated fields of this annotated type . */ private void initAnnotatedFields ( ) { } }
final Set < Field > hiddenFields = Reflections . getHiddenFields ( beanClass ) ; inject ( hiddenFields ) ; final Set < Field > inheritedFields = Reflections . getInheritedFields ( beanClass ) ; inject ( inheritedFields ) ; final Set < Field > ownFields = Reflections . getOwnFields ( beanClass ) ; inject ( ownFields ) ;
public class SizeLimitableBlockingQueue { /** * / * ( non - Javadoc ) * @ see java . util . Collection # removeAll ( java . util . Collection ) */ @ Override public boolean removeAll ( Collection < ? > c ) { } }
boolean b = queue . removeAll ( c ) ; if ( b ) { signalSizeReduced ( ) ; } return b ;
public class Scs_norm { /** * Computes the 1 - norm of a sparse matrix = max ( sum ( abs ( A ) ) ) , largest * column sum . * @ param A * column - compressed matrix * @ return the 1 - norm if successful , - 1 on error */ public static float cs_norm ( Scs A ) { } }
int p , j , n , Ap [ ] ; float Ax [ ] , norm = 0 , s ; if ( ! Scs_util . CS_CSC ( A ) || A . x == null ) return ( - 1 ) ; /* check inputs */ n = A . n ; Ap = A . p ; Ax = A . x ; for ( j = 0 ; j < n ; j ++ ) { for ( s = 0 , p = Ap [ j ] ; p < Ap [ j + 1 ] ; p ++ ) s += Math . abs ( Ax [ p ] ) ; norm = Math . max ( norm , s ) ; } return ( norm ) ;
public class LessParser { /** * { @ inheritDoc } */ @ Override public void add ( Formattable formattable ) { } }
if ( formattable . getClass ( ) == Rule . class && ( ( Rule ) formattable ) . isMixin ( ) ) { return ; } rules . add ( rulesIdx ++ , formattable ) ;
public class AbstractGlobalEntityManagerFactory { /** * Called when the global scope is destroyed ( e . g . upon servlet context * shutdown ) * @ throws Exception * if closing fails */ @ Override @ OverridingMethodsMustInvokeSuper protected void onDestroy ( @ Nonnull final IScope aScopeInDestruction ) throws Exception { } }
// Destroy factory if ( m_aFactory != null ) { if ( m_aFactory . isOpen ( ) ) { // Clear cache try { m_aFactory . getCache ( ) . evictAll ( ) ; } catch ( final PersistenceException ex ) { // May happen if now database connection is available } // Close m_aFactory . close ( ) ; } m_aFactory = null ; } LOGGER . info ( "Closed EntityManagerFactory for persistence unit '" + m_sPersistenceUnitName + "'" ) ;
public class OcrClient { /** * Gets the idcard recognition properties of specific image resource . * The caller < i > must < / i > authenticate with a valid BCE Access Key / Private Key pair . * @ param request The request wrapper object containing all options . * @ return The idcard recognition properties of the image resource */ public IdcardRecognitionResponse idcardRecognition ( IdcardRecognitionRequest request ) { } }
checkNotNull ( request , "request should not be null." ) ; checkStringNotEmpty ( request . getImage ( ) , "Image should not be null or empty!" ) ; InternalRequest internalRequest = createRequest ( HttpMethodName . POST , request , PARA_ID ) ; return invokeHttpClient ( internalRequest , IdcardRecognitionResponse . class ) ;
public class ServerCommandListener { /** * Creates a single thread to wait for * the command to complete then respond . */ private synchronized void asyncResponse ( String command , SocketChannel sc ) { } }
if ( closed ) { Utils . tryToClose ( sc ) ; } else { Thread thread = new Thread ( new ResponseThread ( command , sc ) , "kernel-" + command + "-command-response" ) ; // We allow a maximum of one outstanding status start or stop command Thread oldThread = responseThread . getAndSet ( thread ) ; if ( oldThread != null ) { oldThread . interrupt ( ) ; } thread . start ( ) ; }
public class MethodRef { /** * Writes an invoke instruction for this method to the given adapter . Useful when the expression * is not useful for representing operations . For example , explicit dup operations are awkward in * the Expression api . */ public void invokeUnchecked ( CodeBuilder cb ) { } }
cb . visitMethodInsn ( opcode ( ) , owner ( ) . internalName ( ) , method ( ) . getName ( ) , method ( ) . getDescriptor ( ) , // This is for whether the methods owner is an interface . This is mostly to handle java8 // default methods on interfaces . We don ' t care about those currently , but ASM requires // this . opcode ( ) == Opcodes . INVOKEINTERFACE ) ;
public class StopwatchTimeline { /** * Main method used to insert the split on the timeline : < ol > * < li > Split start is used to determine in which time - range it should be split . A new time range may be created if needed . < / li > * < li > Split duration is added to time range statistics . * < / ol > * The split might be drop if it ' s too old . * @ param split Split */ public void addSplit ( Split split ) { } }
final long timestamp = split . getStartMillis ( ) ; StopwatchTimeRange timeRange ; synchronized ( this ) { timeRange = getOrCreateTimeRange ( timestamp ) ; } if ( timeRange != null ) { // noinspection SynchronizationOnLocalVariableOrMethodParameter synchronized ( timeRange ) { timeRange . addSplit ( timestamp , split . runningFor ( ) ) ; } }
public class DatabaseFullPrunedBlockStore { /** * < p > If there isn ' t a connection on the { @ link ThreadLocal } then create and store it . < / p > * < p > This will also automatically set up the schema if it does not exist within the DB . < / p > * @ throws BlockStoreException if successful connection to the DB couldn ' t be made . */ protected synchronized final void maybeConnect ( ) throws BlockStoreException { } }
try { if ( conn . get ( ) != null && ! conn . get ( ) . isClosed ( ) ) return ; if ( username == null || password == null ) { conn . set ( DriverManager . getConnection ( connectionURL ) ) ; } else { Properties props = new Properties ( ) ; props . setProperty ( "user" , this . username ) ; props . setProperty ( "password" , this . password ) ; conn . set ( DriverManager . getConnection ( connectionURL , props ) ) ; } allConnections . add ( conn . get ( ) ) ; Connection connection = conn . get ( ) ; // set the schema if one is needed if ( schemaName != null ) { Statement s = connection . createStatement ( ) ; for ( String sql : getCreateSchemeSQL ( ) ) { s . execute ( sql ) ; } } log . info ( "Made a new connection to database " + connectionURL ) ; } catch ( SQLException ex ) { throw new BlockStoreException ( ex ) ; }
public class TunnelRequest { /** * Returns the value of the parameter having the given name , throwing an * exception if the parameter is missing . * @ param name * The name of the parameter to return . * @ return * The value of the parameter having the given name . * @ throws GuacamoleException * If the parameter is not present in the request . */ public String getRequiredParameter ( String name ) throws GuacamoleException { } }
// Pull requested parameter , aborting if absent String value = getParameter ( name ) ; if ( value == null ) throw new GuacamoleClientException ( "Parameter \"" + name + "\" is required." ) ; return value ;
public class ScalebarGraphic { /** * Reduce the given value to the nearest smaller 1 significant digit number starting with 1 , 2 or 5. * @ param value the value to find a nice number for . * @ param scaleUnit the unit of the value . * @ param lockUnits if set , the values are not scaled to a " nicer " unit . */ @ VisibleForTesting protected static double getNearestNiceValue ( final double value , final DistanceUnit scaleUnit , final boolean lockUnits ) { } }
DistanceUnit bestUnit = bestUnit ( scaleUnit , value , lockUnits ) ; double factor = scaleUnit . convertTo ( 1.0 , bestUnit ) ; // nearest power of 10 lower than value int digits = ( int ) Math . floor ( ( Math . log ( value * factor ) / Math . log ( 10 ) ) ) ; double pow10 = Math . pow ( 10 , digits ) ; // ok , find first character double firstChar = value * factor / pow10 ; // right , put it into the correct bracket int barLen ; if ( firstChar >= 10.0 ) { barLen = 10 ; } else if ( firstChar >= 5.0 ) { barLen = 5 ; } else if ( firstChar >= 2.0 ) { barLen = 2 ; } else { barLen = 1 ; } // scale it up the correct power of 10 return barLen * pow10 / factor ;
public class FractionNumber { /** * 分母の指定した桁の値を取得する 。 * @ param digit 1から始まる * @ return 存在しない桁の場合は空文字を返す 。 */ public String getDenominatorPart ( final int digit ) { } }
final int length = denominatorPart . length ( ) ; if ( length < digit || digit <= 0 ) { return "" ; } return String . valueOf ( denominatorPart . charAt ( length - digit ) ) ;
public class EntityManagerFactory { /** * Creates and returns an { @ link EntityManager } that allows working with the local Datastore * ( a . k . a Datastore Emulator ) . Specified project ID will be used . * @ param serviceURL * Service URL for the Datastore Emulator . ( e . g . http : / / localhost : 9999) * @ param projectId * the project ID . The specified project need not exist in Google Cloud . If * < code > null < / code > , default project ID is used , if it can be determined . * @ param namespace * the namespace ( for multi - tenant datastore ) to use . * @ return an { @ link EntityManager } that allows working with the local Datastore ( a . k . a Datastore * Emulator ) . If < code > null < / code > , default namespace is used . */ public EntityManager createLocalEntityManager ( String serviceURL , String projectId , String namespace ) { } }
ConnectionParameters parameters = new ConnectionParameters ( ) ; parameters . setServiceURL ( serviceURL ) ; parameters . setProjectId ( projectId ) ; parameters . setNamespace ( namespace ) ; return createEntityManager ( parameters ) ;
public class Session { /** * Adds a Task to the outstandingTasks Hashmap . * @ param connection The Connection where the Task will be started * @ param task The Task which was started . */ public final void addOutstandingTask ( final Connection connection , final ITask task ) { } }
outstandingTasks . put ( task , connection ) ; LOGGER . debug ( "Added a Task to the outstandingTasks Queue" ) ;
public class Op { /** * Creates an array with the specified elements and an < i > operation expression < / i > on it . * @ param elements the elements of the array being created * @ return an operator , ready for chaining */ public static < T > Level0ArrayOperator < String [ ] , String > onArrayFor ( final String ... elements ) { } }
return onArrayOf ( Types . STRING , VarArgsUtil . asRequiredObjectArray ( elements ) ) ;
public class GraphHopper { /** * Internal method to clean up the graph . */ protected void cleanUp ( ) { } }
int prevNodeCount = ghStorage . getNodes ( ) ; PrepareRoutingSubnetworks preparation = new PrepareRoutingSubnetworks ( ghStorage , encodingManager . fetchEdgeEncoders ( ) ) ; preparation . setMinNetworkSize ( minNetworkSize ) ; preparation . setMinOneWayNetworkSize ( minOneWayNetworkSize ) ; preparation . doWork ( ) ; int currNodeCount = ghStorage . getNodes ( ) ; logger . info ( "edges: " + Helper . nf ( ghStorage . getAllEdges ( ) . length ( ) ) + ", nodes " + Helper . nf ( currNodeCount ) + ", there were " + Helper . nf ( preparation . getMaxSubnetworks ( ) ) + " subnetworks. removed them => " + Helper . nf ( prevNodeCount - currNodeCount ) + " less nodes" ) ;
public class AttachAction { /** * Performs this action on the section state . * @ param handler ? ? ? * @ param state The section state . */ void perform ( ContentHandler handler , SectionState state ) { } }
final ModeUsage modeUsage = getModeUsage ( ) ; if ( handler != null ) state . addActiveHandler ( handler , modeUsage ) ; else state . addAttributeValidationModeUsage ( modeUsage ) ; state . addChildMode ( modeUsage , handler ) ;
public class SubCurrentFilter { /** * Setup the target key field . * Restore the original value if this is called for initial or end ( ie . , boolSetModified us TRUE ) . * @ oaram bDisplayOption If true , display changes . * @ param boolSetModified - If not null , set this field ' s modified flag to this value * @ return false If this key was set to all nulls . */ public boolean setMainKey ( boolean bDisplayOption , Boolean boolSetModified , boolean bSetIfModified ) { } }
super . setMainKey ( bDisplayOption , boolSetModified , bSetIfModified ) ; boolean bNonNulls = false ; // Default to yes , all keys are null . if ( Boolean . TRUE . equals ( boolSetModified ) ) { // Only restore the key value when setting the starting or ending key , not when adding a record . KeyArea keyArea = this . getOwner ( ) . getKeyArea ( - 1 ) ; m_buffer . resetPosition ( ) ; keyArea . reverseKeyBuffer ( m_buffer , DBConstants . FILE_KEY_AREA ) ; for ( int i = 0 ; i < keyArea . getKeyFields ( ) ; i ++ ) { keyArea . getField ( i ) . setModified ( false ) ; if ( ( i <= m_iLastModifiedToSet ) || ( m_iLastModifiedToSet == - 1 ) ) { keyArea . getField ( i ) . setModified ( true ) ; if ( ! keyArea . getField ( i ) . isNull ( ) ) bNonNulls = true ; // Non null . } } } return bNonNulls ;
public class ListTaskDefinitionsResult { /** * The list of task definition Amazon Resource Name ( ARN ) entries for the < code > ListTaskDefinitions < / code > request . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setTaskDefinitionArns ( java . util . Collection ) } or { @ link # withTaskDefinitionArns ( java . util . Collection ) } if * you want to override the existing values . * @ param taskDefinitionArns * The list of task definition Amazon Resource Name ( ARN ) entries for the < code > ListTaskDefinitions < / code > * request . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListTaskDefinitionsResult withTaskDefinitionArns ( String ... taskDefinitionArns ) { } }
if ( this . taskDefinitionArns == null ) { setTaskDefinitionArns ( new com . amazonaws . internal . SdkInternalList < String > ( taskDefinitionArns . length ) ) ; } for ( String ele : taskDefinitionArns ) { this . taskDefinitionArns . add ( ele ) ; } return this ;
public class SystemPropertiesUtils { /** * Get system property * @ param dKey * - D parameter * @ param shellKey * shell defined system environment property * @ param defautValue * @ return system property */ public static String getSystemProperty ( String dKey , String shellKey , String defautValue ) { } }
String value = System . getProperty ( dKey ) ; if ( value == null || value . length ( ) == 0 ) { value = System . getenv ( shellKey ) ; if ( value == null || value . length ( ) == 0 ) { value = defautValue ; } } return value ;
public class FlowTypeCheck { @ Override public boolean check ( WyilFile wf ) { } }
for ( Decl decl : wf . getModule ( ) . getUnits ( ) ) { checkDeclaration ( decl ) ; } return status ;
public class Context { /** * Remove a connection listener * @ param cm The connection manager * @ param cl The connection listener */ void removeConnectionListener ( ConnectionManager cm , ConnectionListener cl ) { } }
if ( cmToCl != null && cmToCl . get ( cm ) != null ) { cmToCl . get ( cm ) . remove ( cl ) ; clToC . remove ( cl ) ; }
public class LineItemSummary { /** * Sets the startDateTimeType value for this LineItemSummary . * @ param startDateTimeType * Specifies whether to start serving to the { @ code LineItem } * right away , in * an hour , etc . This attribute is optional and defaults * to * { @ link StartDateTimeType # USE _ START _ DATE _ TIME } . */ public void setStartDateTimeType ( com . google . api . ads . admanager . axis . v201902 . StartDateTimeType startDateTimeType ) { } }
this . startDateTimeType = startDateTimeType ;
public class StylesContainer { /** * Add a child style that mixes the cell style with a data style to the container * @ param style the cell style * @ param dataStyle the data style * @ return the mixed cell style */ public TableCellStyle addChildCellStyle ( final TableCellStyle style , final DataStyle dataStyle ) { } }
final ChildCellStyle childKey = new ChildCellStyle ( style , dataStyle ) ; TableCellStyle anonymousStyle = this . anonymousStyleByChildCellStyle . get ( childKey ) ; if ( anonymousStyle == null ) { this . addDataStyle ( dataStyle ) ; if ( ! style . hasParent ( ) ) { // here , the style may already be a child style this . addContentFontFaceContainerStyle ( style ) ; } final String name = style . getRealName ( ) + "-_-" + dataStyle . getName ( ) ; final TableCellStyleBuilder anonymousStyleBuilder = TableCellStyle . builder ( name ) . parentCellStyle ( style ) . dataStyle ( dataStyle ) ; if ( dataStyle . isHidden ( ) ) { anonymousStyleBuilder . hidden ( ) ; } anonymousStyle = anonymousStyleBuilder . build ( ) ; this . addContentFontFaceContainerStyle ( anonymousStyle ) ; this . anonymousStyleByChildCellStyle . put ( childKey , anonymousStyle ) ; } return anonymousStyle ;
public class DescribeRouteTablesRequest { /** * One or more route table IDs . * Default : Describes all your route tables . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setRouteTableIds ( java . util . Collection ) } or { @ link # withRouteTableIds ( java . util . Collection ) } if you want * to override the existing values . * @ param routeTableIds * One or more route table IDs . < / p > * Default : Describes all your route tables . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeRouteTablesRequest withRouteTableIds ( String ... routeTableIds ) { } }
if ( this . routeTableIds == null ) { setRouteTableIds ( new com . amazonaws . internal . SdkInternalList < String > ( routeTableIds . length ) ) ; } for ( String ele : routeTableIds ) { this . routeTableIds . add ( ele ) ; } return this ;
public class FileUtil { /** * 获得一个带缓存的写入对象 * @ param file 输出文件 * @ param charsetName 字符集 * @ param isAppend 是否追加 * @ return BufferedReader对象 * @ throws IORuntimeException IO异常 */ public static BufferedWriter getWriter ( File file , String charsetName , boolean isAppend ) throws IORuntimeException { } }
return getWriter ( file , Charset . forName ( charsetName ) , isAppend ) ;
public class TypeComparator { /** * Calculate the intersection of two types . * @ param a * @ param b * @ return */ public PType intersect ( PType a , PType b ) { } }
Set < PType > tsa = new HashSet < PType > ( ) ; Set < PType > tsb = new HashSet < PType > ( ) ; // Obtain the fundamental type of BracketTypes , NamedTypes and OptionalTypes . boolean resolved = false ; while ( ! resolved ) { if ( a instanceof ABracketType ) { a = ( ( ABracketType ) a ) . getType ( ) ; continue ; } if ( b instanceof ABracketType ) { b = ( ( ABracketType ) b ) . getType ( ) ; continue ; } if ( a instanceof ANamedInvariantType ) { ANamedInvariantType nt = ( ANamedInvariantType ) a ; if ( nt . getInvDef ( ) == null ) { a = nt . getType ( ) ; continue ; } } if ( b instanceof ANamedInvariantType ) { ANamedInvariantType nt = ( ANamedInvariantType ) b ; if ( nt . getInvDef ( ) == null ) { b = nt . getType ( ) ; continue ; } } if ( a instanceof AOptionalType && b instanceof AOptionalType ) { a = ( ( AOptionalType ) a ) . getType ( ) ; b = ( ( AOptionalType ) b ) . getType ( ) ; continue ; } resolved = true ; } if ( a instanceof AUnionType ) { AUnionType uta = ( AUnionType ) a ; tsa . addAll ( uta . getTypes ( ) ) ; } else { tsa . add ( a ) ; } if ( b instanceof AUnionType ) { AUnionType utb = ( AUnionType ) b ; tsb . addAll ( utb . getTypes ( ) ) ; } else { tsb . add ( b ) ; } // Keep largest types which are compatible ( eg . nat and int choses int ) Set < PType > result = new HashSet < PType > ( ) ; for ( PType atype : tsa ) { for ( PType btype : tsb ) { if ( isSubType ( atype , btype ) ) { result . add ( btype ) ; } else if ( isSubType ( btype , atype ) ) { result . add ( atype ) ; } } } if ( result . isEmpty ( ) ) { return null ; } else { List < PType > list = new Vector < PType > ( ) ; list . addAll ( result ) ; return AstFactory . newAUnionType ( a . getLocation ( ) , list ) ; }
public class LogRepositoryConfiguration { /** * update all info for Trace Repository */ private void updateTraceConfiguration ( TraceState state ) { } }
if ( DIRECTORY_TYPE . equals ( state . ivStorageType ) ) { LogRepositoryComponent . setTraceDirectoryDestination ( state . ivDataDirectory , state . ivPurgeBySizeEnabled , state . ivPurgeByTimeEnabled , state . ivFileSwitchEnabled , state . ivBufferingEnabled , state . ivPurgeMaxSize * ONE_MEG , state . ivPurgeMinTime * MILLIS_IN_HOURS , state . ivFileSwitchTime , state . ivOutOfSpaceAction ) ; } else if ( MEMORYBUFFER_TYPE . equals ( state . ivStorageType ) ) { LogRepositoryComponent . setTraceMemoryDestination ( state . ivDataDirectory , state . ivMemoryBufferSize * ONE_MEG ) ; } else { throw new IllegalArgumentException ( "Unknown value for trace storage type: " + state . ivStorageType ) ; }
public class ElasticSearchDAOV5 { /** * Initializes the index with required templates and mappings . */ private void initIndex ( ) throws Exception { } }
// 0 . Add the tasklog template GetIndexTemplatesResponse result = elasticSearchClient . admin ( ) . indices ( ) . prepareGetTemplates ( "tasklog_template" ) . execute ( ) . actionGet ( ) ; if ( result . getIndexTemplates ( ) . isEmpty ( ) ) { logger . info ( "Creating the index template 'tasklog_template'" ) ; InputStream stream = ElasticSearchDAOV5 . class . getResourceAsStream ( "/template_tasklog.json" ) ; byte [ ] templateSource = IOUtils . toByteArray ( stream ) ; try { elasticSearchClient . admin ( ) . indices ( ) . preparePutTemplate ( "tasklog_template" ) . setSource ( templateSource , XContentType . JSON ) . execute ( ) . actionGet ( ) ; } catch ( Exception e ) { logger . error ( "Failed to init tasklog_template" , e ) ; } }
public class BlackBoxExplanationGenerator { /** * Orders the axioms in a single MUPS by the frequency of which they appear * in all MUPS . * @ param mups The MUPS containing the axioms to be ordered * @ param allJustifications The set of all justifications which is used to calculate the ordering * @ return The ordered axioms */ private static < E > List < OWLAxiom > getOrderedJustifications ( List < OWLAxiom > mups , final Set < Explanation < E > > allJustifications ) { } }
Comparator < OWLAxiom > mupsComparator = new Comparator < OWLAxiom > ( ) { public int compare ( OWLAxiom o1 , OWLAxiom o2 ) { // The checker that appears in most MUPS has the lowest index // in the list int occ1 = getOccurrences ( o1 , allJustifications ) ; int occ2 = getOccurrences ( o2 , allJustifications ) ; return - occ1 + occ2 ; } } ; Collections . sort ( mups , mupsComparator ) ; return mups ;
public class IotHubResourcesInner { /** * Get a list of all the jobs in an IoT hub . For more information , see : https : / / docs . microsoft . com / azure / iot - hub / iot - hub - devguide - identity - registry . * Get a list of all the jobs in an IoT hub . For more information , see : https : / / docs . microsoft . com / azure / iot - hub / iot - hub - devguide - identity - registry . * ServiceResponse < PageImpl < JobResponseInner > > * @ param resourceGroupName The name of the resource group that contains the IoT hub . * ServiceResponse < PageImpl < JobResponseInner > > * @ param resourceName The name of the IoT hub . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the PagedList & lt ; JobResponseInner & gt ; object wrapped in { @ link ServiceResponse } if successful . */ public Observable < ServiceResponse < Page < JobResponseInner > > > listJobsSinglePageAsync ( final String resourceGroupName , final String resourceName ) { } }
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( resourceName == null ) { throw new IllegalArgumentException ( "Parameter resourceName is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } return service . listJobs ( this . client . subscriptionId ( ) , resourceGroupName , resourceName , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < Page < JobResponseInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < JobResponseInner > > > call ( Response < ResponseBody > response ) { try { ServiceResponse < PageImpl < JobResponseInner > > result = listJobsDelegate ( response ) ; return Observable . just ( new ServiceResponse < Page < JobResponseInner > > ( result . body ( ) , result . response ( ) ) ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class Tag { /** * Clones a Map < String , Tag > * @ param map the map * @ return a clone of the map */ public static Map < String , Tag < ? > > cloneMap ( Map < String , Tag < ? > > map ) { } }
if ( map == null ) { return null ; } Map < String , Tag < ? > > newMap = new HashMap < String , Tag < ? > > ( ) ; for ( Entry < String , Tag < ? > > entry : map . entrySet ( ) ) { newMap . put ( entry . getKey ( ) , entry . getValue ( ) . clone ( ) ) ; } return newMap ;
public class ClientRequestExecutorPool { /** * Reset the pool of resources for a specific destination . Idle resources * will be destroyed . Checked out resources that are subsequently checked in * will be destroyed . Newly created resources can be checked in to * reestablish resources for the specific destination . */ @ Override public void close ( SocketDestination destination ) { } }
factory . setLastClosedTimestamp ( destination ) ; queuedPool . reset ( destination ) ;
public class IndustrialClockSkin { /** * * * * * * Graphics * * * * * */ private void createHourPointer ( ) { } }
double width = size ; double height = size ; hour . setCache ( false ) ; hour . getElements ( ) . clear ( ) ; hour . getElements ( ) . add ( new MoveTo ( 0.4930555555555556 * width , 0.28541666666666665 * height ) ) ; hour . getElements ( ) . add ( new CubicCurveTo ( 0.4930555555555556 * width , 0.28125 * height , 0.49583333333333335 * width , 0.27847222222222223 * height , 0.5 * width , 0.27847222222222223 * height ) ) ; hour . getElements ( ) . add ( new CubicCurveTo ( 0.5041666666666667 * width , 0.27847222222222223 * height , 0.5069444444444444 * width , 0.28125 * height , 0.5069444444444444 * width , 0.28541666666666665 * height ) ) ; hour . getElements ( ) . add ( new CubicCurveTo ( 0.5069444444444444 * width , 0.28541666666666665 * height , 0.5069444444444444 * width , 0.39375 * height , 0.5069444444444444 * width , 0.39375 * height ) ) ; hour . getElements ( ) . add ( new LineTo ( 0.4930555555555556 * width , 0.39375 * height ) ) ; hour . getElements ( ) . add ( new CubicCurveTo ( 0.4930555555555556 * width , 0.39375 * height , 0.4930555555555556 * width , 0.28541666666666665 * height , 0.4930555555555556 * width , 0.28541666666666665 * height ) ) ; hour . getElements ( ) . add ( new ClosePath ( ) ) ; hour . getElements ( ) . add ( new MoveTo ( 0.4847222222222222 * width , 0.28541666666666665 * height ) ) ; hour . getElements ( ) . add ( new CubicCurveTo ( 0.4847222222222222 * width , 0.28541666666666665 * height , 0.4847222222222222 * width , 0.49722222222222223 * height , 0.4847222222222222 * width , 0.49722222222222223 * height ) ) ; hour . getElements ( ) . add ( new CubicCurveTo ( 0.4847222222222222 * width , 0.5055555555555555 * height , 0.49166666666666664 * width , 0.5125 * height , 0.5 * width , 0.5125 * height ) ) ; hour . getElements ( ) . add ( new CubicCurveTo ( 0.5083333333333333 * width , 0.5125 * height , 0.5152777777777777 * width , 0.5055555555555555 * height , 0.5152777777777777 * width , 0.49722222222222223 * height ) ) ; hour . getElements ( ) . add ( new CubicCurveTo ( 0.5152777777777777 * width , 0.49722222222222223 * height , 0.5152777777777777 * width , 0.28541666666666665 * height , 0.5152777777777777 * width , 0.28541666666666665 * height ) ) ; hour . getElements ( ) . add ( new CubicCurveTo ( 0.5152777777777777 * width , 0.27708333333333335 * height , 0.5083333333333333 * width , 0.2701388888888889 * height , 0.5 * width , 0.2701388888888889 * height ) ) ; hour . getElements ( ) . add ( new CubicCurveTo ( 0.49166666666666664 * width , 0.2701388888888889 * height , 0.4847222222222222 * width , 0.27708333333333335 * height , 0.4847222222222222 * width , 0.28541666666666665 * height ) ) ; hour . getElements ( ) . add ( new ClosePath ( ) ) ; hour . setCache ( true ) ; hour . setCacheHint ( CacheHint . ROTATE ) ;
public class HtmlTemplateCompiler { /** * TESTING jsoup . nodes . Node */ public List < Node > findSiblings ( Node node ) { } }
Preconditions . checkNotNull ( node ) ; Node parent = node . parent ( ) ; if ( null == parent ) return null ; return parent . childNodes ( ) ;
public class TemplateUtils { /** * create a complete property file based on the given template */ public static Properties mergeTemplateWithUserCustomizedFile ( Properties template , Properties userCustomized ) { } }
Properties cleanedTemplate = new Properties ( ) ; cleanedTemplate . putAll ( template ) ; if ( cleanedTemplate . containsKey ( ConfigurationKeys . REQUIRED_ATRRIBUTES_LIST ) ) { cleanedTemplate . remove ( ConfigurationKeys . REQUIRED_ATRRIBUTES_LIST ) ; } Properties cleanedUserCustomized = new Properties ( ) ; cleanedUserCustomized . putAll ( userCustomized ) ; if ( cleanedUserCustomized . containsKey ( ConfigurationKeys . JOB_TEMPLATE_PATH ) ) { cleanedUserCustomized . remove ( ConfigurationKeys . JOB_TEMPLATE_PATH ) ; } return PropertiesUtils . combineProperties ( cleanedTemplate , cleanedUserCustomized ) ;
public class FastaWriterHelper { /** * Write a sequence to OutputStream * @ param outputStream * @ param sequence * @ throws Exception */ public static void writeSequence ( OutputStream outputStream , Sequence < ? > sequence ) throws Exception { } }
writeSequences ( outputStream , singleSeqToCollection ( sequence ) ) ;
public class FilterMatcher { /** * Check that getLeft ( ) and getRight ( ) of the two expressions match . * @ param e1 first expression * @ param e2 second expression * @ return whether first ' s getLeft ( ) matches with second ' s getLeft ( ) , and first ' s getRight ( ) matches second ' s * getRight ( ) . */ private static boolean childrenMatch ( AbstractExpression e1 , AbstractExpression e2 ) { } }
return new FilterMatcher ( e1 . getLeft ( ) , e2 . getLeft ( ) ) . match ( ) && new FilterMatcher ( e1 . getRight ( ) , e2 . getRight ( ) ) . match ( ) ;
public class Parameters { /** * Convenience method to call { @ link # getExistingFile ( String ) } and then apply { @ link * FileUtils # loadSymbolSet ( CharSource ) } on it , if the param is present . If the param is missing , * { @ link Optional # absent ( ) } is returned . */ public Optional < ImmutableSet < Symbol > > getOptionalFileAsSymbolSet ( String param ) throws IOException { } }
if ( isPresent ( param ) ) { return Optional . of ( FileUtils . loadSymbolSet ( Files . asCharSource ( getExistingFile ( param ) , Charsets . UTF_8 ) ) ) ; } else { return Optional . absent ( ) ; }
public class CmsPropertyResourceComparator { /** * Creates a new instance of this comparator key . < p > * @ param resource the resource to create the key for * @ param cms the current OpenCms user context * @ param property the name of the sort property ( case sensitive ) * @ return a new instance of this comparator key */ private static CmsPropertyResourceComparator create ( CmsResource resource , CmsObject cms , String property ) { } }
CmsPropertyResourceComparator result = new CmsPropertyResourceComparator ( null , null , false ) ; result . init ( resource , cms , property ) ; return result ;
public class MicroServiceTemplateSupport { /** * add by ning 20190430 */ public Map getInfoList4PageServiceByRep ( String countSql , String sql , Map paramMap , Map pageMap ) throws Exception { } }
List countPlaceList = new ArrayList ( ) ; List placeList = new ArrayList ( ) ; String realCountSql = sqlTemplateService ( countSql , paramMap , countPlaceList ) ; String realSql = sqlTemplateService ( sql , paramMap , placeList ) ; return getInfoList4PageServiceInnerExBySql ( realCountSql , countPlaceList , realSql , placeList , pageMap ) ;
public class DataReader { /** * Parse day period information ( AM , PM ) . */ private Variants parseDayPeriods ( JsonObject calendar , String group ) { } }
JsonObject node = resolve ( calendar , "dayPeriods" , group ) ; JsonObject abbr = resolve ( node , "abbreviated" ) ; JsonObject narrow = resolve ( node , "narrow" ) ; JsonObject wide = resolve ( node , "wide" ) ; return new Variants ( new String [ ] { string ( abbr , "am" ) , string ( abbr , "pm" ) } , new String [ ] { string ( narrow , "am" ) , string ( narrow , "pm" ) } , new String [ ] { } , new String [ ] { string ( wide , "am" ) , string ( wide , "pm" ) } ) ;
public class CommerceWarehouseItemUtil { /** * Returns the first commerce warehouse item in the ordered set where commerceWarehouseId = & # 63 ; . * @ param commerceWarehouseId the commerce warehouse ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching commerce warehouse item * @ throws NoSuchWarehouseItemException if a matching commerce warehouse item could not be found */ public static CommerceWarehouseItem findByCommerceWarehouseId_First ( long commerceWarehouseId , OrderByComparator < CommerceWarehouseItem > orderByComparator ) throws com . liferay . commerce . exception . NoSuchWarehouseItemException { } }
return getPersistence ( ) . findByCommerceWarehouseId_First ( commerceWarehouseId , orderByComparator ) ;
public class FuncCurrent { /** * Execute the function . The function must return * a valid object . * @ param xctxt The current execution context . * @ return A valid XObject . * @ throws javax . xml . transform . TransformerException */ public XObject execute ( XPathContext xctxt ) throws javax . xml . transform . TransformerException { } }
SubContextList subContextList = xctxt . getCurrentNodeList ( ) ; int currentNode = DTM . NULL ; if ( null != subContextList ) { if ( subContextList instanceof PredicatedNodeTest ) { LocPathIterator iter = ( ( PredicatedNodeTest ) subContextList ) . getLocPathIterator ( ) ; currentNode = iter . getCurrentContextNode ( ) ; } else if ( subContextList instanceof StepPattern ) { throw new RuntimeException ( XSLMessages . createMessage ( XSLTErrorResources . ER_PROCESSOR_ERROR , null ) ) ; } } else { // not predicate = > ContextNode = = CurrentNode currentNode = xctxt . getContextNode ( ) ; } return new XNodeSet ( currentNode , xctxt . getDTMManager ( ) ) ;
public class SupportProgressDialogFragment { /** * Create a new instance of the { @ link com . amalgam . app . SupportProgressDialogFragment } . * @ param title the title text , can be null * @ param message the message text , must not be null . * @ param indeterminate indeterminate progress or not . * @ return the instance of the { @ link com . amalgam . app . SupportProgressDialogFragment } . */ public static final SupportProgressDialogFragment newInstance ( String title , String message , boolean indeterminate ) { } }
SupportProgressDialogFragment fragment = new SupportProgressDialogFragment ( ) ; Bundle args = new Bundle ( ) ; args . putString ( ARGS_TITLE , title ) ; args . putString ( ARGS_MESSAGE , message ) ; args . putBoolean ( ARGS_INDETERMINATE , indeterminate ) ; fragment . setArguments ( args ) ; return fragment ;
public class NameExtractor { /** * This method detects if the word has more than one character which is capital sized . * @ return true if there are more than one character upper cased ; return false if less than one character is upper cased . */ private static boolean hasManyCaps ( final String word ) { } }
if ( "i" . equalsIgnoreCase ( word ) ) return false ; int capCharCount = 0 ; for ( int i = 0 ; i < word . length ( ) ; i ++ ) { if ( isUpperCase ( word . charAt ( i ) ) ) capCharCount ++ ; if ( capCharCount == 2 ) return true ; } return false ;
public class CommercePriceListAccountRelLocalServiceUtil { /** * Returns the commerce price list account rel with the primary key . * @ param commercePriceListAccountRelId the primary key of the commerce price list account rel * @ return the commerce price list account rel * @ throws PortalException if a commerce price list account rel with the primary key could not be found */ public static com . liferay . commerce . price . list . model . CommercePriceListAccountRel getCommercePriceListAccountRel ( long commercePriceListAccountRelId ) throws com . liferay . portal . kernel . exception . PortalException { } }
return getService ( ) . getCommercePriceListAccountRel ( commercePriceListAccountRelId ) ;
public class AbstractContextSource { /** * Default implementation of setting the environment up to be authenticated . * This method should typically NOT be overridden ; any customization to the * authentication mechanism should be managed by setting a different * { @ link DirContextAuthenticationStrategy } on this instance . * @ param env the environment to modify . * @ param principal the principal to authenticate with . * @ param credentials the credentials to authenticate with . * @ see DirContextAuthenticationStrategy * @ see # setAuthenticationStrategy ( DirContextAuthenticationStrategy ) */ protected void setupAuthenticatedEnvironment ( Hashtable < String , Object > env , String principal , String credentials ) { } }
try { authenticationStrategy . setupEnvironment ( env , principal , credentials ) ; } catch ( NamingException e ) { throw LdapUtils . convertLdapException ( e ) ; }
public class SoyTypeRegistry { /** * Look up a type by name . Returns null if there is no such type . * @ param typeName The fully - qualified name of the type . * @ return The type object , or { @ code null } . */ @ Nullable public SoyType getType ( String typeName ) { } }
SoyType result = BUILTIN_TYPES . get ( typeName ) ; if ( result != null ) { return result ; } synchronized ( lock ) { result = protoTypeCache . get ( typeName ) ; if ( result == null ) { GenericDescriptor descriptor = descriptors . get ( typeName ) ; if ( descriptor == null ) { return null ; } if ( descriptor instanceof EnumDescriptor ) { result = new SoyProtoEnumType ( ( EnumDescriptor ) descriptor ) ; } else { result = new SoyProtoType ( this , ( Descriptor ) descriptor , extensions . get ( typeName ) ) ; } protoTypeCache . put ( typeName , result ) ; } } return result ;
public class CacheElement { public String getInstanceId ( ) { } }
String rc = toString ( ) ; int i = rc . indexOf ( "@" ) ; if ( i > 0 ) { rc = rc . substring ( i + 1 ) ; } return rc ;
public class TeamServiceImpl { /** * Retrieves the team information for a given collectorId , teamName , pageable * @ param collectorId , teamName , pageable * @ return teams */ @ Override public Page < Team > getTeamByCollectorWithFilter ( ObjectId collectorId , String teamName , Pageable pageable ) { } }
Page < Team > teams = teamRepository . findAllByCollectorIdAndNameContainingIgnoreCase ( collectorId , teamName , pageable ) ; return teams ;
public class GeometryTools { /** * Calculates the center of mass for the < code > Atom < / code > s in the * AtomContainer for the 2D coordinates . * See comment for center ( IAtomContainer atomCon , Dimension areaDim , HashMap renderingCoordinates ) for details on coordinate sets * @ param ac AtomContainer for which the center of mass is calculated * @ return Description of the Return Value * @ cdk . keyword center of mass * @ cdk . dictref blue - obelisk : calculate3DCenterOfMass */ public static Point3d get3DCentreOfMass ( IAtomContainer ac ) { } }
double xsum = 0.0 ; double ysum = 0.0 ; double zsum = 0.0 ; double totalmass = 0.0 ; Iterator < IAtom > atoms = ac . atoms ( ) . iterator ( ) ; while ( atoms . hasNext ( ) ) { IAtom a = ( IAtom ) atoms . next ( ) ; Double mass = a . getExactMass ( ) ; // some sanity checking if ( a . getPoint3d ( ) == null ) return null ; if ( mass == null ) return null ; totalmass += mass ; xsum += mass * a . getPoint3d ( ) . x ; ysum += mass * a . getPoint3d ( ) . y ; zsum += mass * a . getPoint3d ( ) . z ; } return new Point3d ( xsum / totalmass , ysum / totalmass , zsum / totalmass ) ;
public class MariaDbDatabaseMetaData { /** * Retrieves a description of the given catalog ' s system or user function parameters and return * type . * < P > Only descriptions matching the schema , function and parameter name criteria are returned . * They are ordered by < code > FUNCTION _ CAT < / code > , * < code > FUNCTION _ SCHEM < / code > , < code > FUNCTION _ NAME < / code > and < code > SPECIFIC _ NAME < / code > . * Within this , the return value , if any , is first . Next are the parameter descriptions in call * order . The column descriptions follow in column number order . < / p > * < P > Each row in the < code > ResultSet < / code > is a parameter description , column description or * return type description with the following fields : < / p > * < OL > < LI > < B > FUNCTION _ CAT < / B > String { @ code = > } function catalog ( may be < code > null < / code > ) * < LI > < B > FUNCTION _ SCHEM < / B > String { @ code = > } function * schema ( may be < code > null < / code > ) < LI > < B > FUNCTION _ NAME < / B > String { @ code = > } function name . * This is the name used to invoke the function * < LI > < B > COLUMN _ NAME < / B > String { @ code = > } column / parameter name < LI > < B > COLUMN _ TYPE < / B > Short * { @ code = > } kind of column / parameter : < UL > < LI > functionColumnUnknown - nobody knows < LI > * functionColumnIn - IN parameter < LI > functionColumnInOut - INOUT parameter < LI > * functionColumnOut - OUT parameter < LI > functionColumnReturn - function return value < LI > * functionColumnResult - Indicates that the parameter or column is a column in the * < code > ResultSet < / code > < / UL > < LI > < B > DATA _ TYPE < / B > int { @ code = > } SQL type from java . sql . Types * < LI > < B > TYPE _ NAME < / B > String { @ code = > } SQL type name , for a UDT type the type name is fully * qualified < LI > < B > PRECISION < / B > int { @ code = > } precision * < LI > < B > LENGTH < / B > int { @ code = > } length in bytes of data < LI > < B > SCALE < / B > short { @ code = > } * scale - null is returned for data types where SCALE is not applicable . * < LI > < B > RADIX < / B > short { @ code = > } radix < LI > < B > NULLABLE < / B > short { @ code = > } can it contain * NULL . < UL > < LI > functionNoNulls - does not allow NULL values < LI > functionNullable - allows * NULL values < LI > functionNullableUnknown - nullability unknown < / UL > < LI > < B > REMARKS < / B > String * { @ code = > } comment describing column / parameter < LI > < B > CHAR _ OCTET _ LENGTH < / B > int { @ code = > } the * maximum length of binary and character based parameters or columns . For any other datatype the * returned value is a NULL * < LI > < B > ORDINAL _ POSITION < / B > int { @ code = > } the ordinal position , starting from 1 , for the * input and output parameters . A value of 0 is returned if this row describes the function ' s * return value . For result set columns , it is the ordinal position of the column in the result * set starting from 1 . < LI > < B > IS _ NULLABLE < / B > String { @ code = > } ISO rules are used to determine * the nullability for a parameter or column . < UL > < LI > YES - - - if the parameter or * column can include NULLs < LI > NO - - - if the parameter or column cannot include * NULLs < LI > empty string - - - if the nullability for the parameter or column is unknown < / UL > * < LI > < B > SPECIFIC _ NAME < / B > String { @ code = > } the name which uniquely identifies this function * within its schema . This is a user specified , or DBMS generated , name that may be different * then the < code > FUNCTION _ NAME < / code > for example with overload functions < / OL > * < p > The PRECISION column represents the specified column size for the given parameter or * column . For numeric data , this is the maximum precision . For character data , this is the * length in characters . For datetime datatypes , this is the length in characters of the String * representation ( assuming the maximum allowed precision of the fractional seconds component ) . * For binary data , this is the length in bytes . For the ROWID datatype , this is the length in * bytes . Null is returned for data types where the column size is not applicable . < / p > * @ param catalog a catalog name ; must match the catalog name as it is stored in the * database ; " " retrieves those without a catalog ; * < code > null < / code > means that the catalog name should not be used to * narrow the search * @ param schemaPattern a schema name pattern ; must match the schema name as it is stored in * the database ; " " retrieves those without a schema ; * < code > null < / code > means that the schema name should not be used to * narrow the search * @ param functionNamePattern a procedure name pattern ; must match the function name as it is * stored in the database * @ param columnNamePattern a parameter name pattern ; must match the parameter or column name as * it is stored in the database * @ return < code > ResultSet < / code > - each row describes a user function parameter , column or * return type * @ throws SQLException if a database access error occurs * @ see # getSearchStringEscape * @ since 1.6 */ public ResultSet getFunctionColumns ( String catalog , String schemaPattern , String functionNamePattern , String columnNamePattern ) throws SQLException { } }
String sql ; if ( haveInformationSchemaParameters ( ) ) { sql = "SELECT SPECIFIC_SCHEMA `FUNCTION_CAT`, NULL `FUNCTION_SCHEM`, SPECIFIC_NAME FUNCTION_NAME," + " PARAMETER_NAME COLUMN_NAME, " + " CASE PARAMETER_MODE " + " WHEN 'IN' THEN " + functionColumnIn + " WHEN 'OUT' THEN " + functionColumnOut + " WHEN 'INOUT' THEN " + functionColumnInOut + " ELSE " + functionReturn + " END COLUMN_TYPE," + dataTypeClause ( "DTD_IDENTIFIER" ) + " DATA_TYPE," + "DATA_TYPE TYPE_NAME,NUMERIC_PRECISION `PRECISION`,CHARACTER_MAXIMUM_LENGTH LENGTH,NUMERIC_SCALE SCALE,10 RADIX," + procedureNullableUnknown + " NULLABLE,NULL REMARKS," + "CHARACTER_OCTET_LENGTH CHAR_OCTET_LENGTH ,ORDINAL_POSITION, '' IS_NULLABLE, SPECIFIC_NAME " + " FROM INFORMATION_SCHEMA.PARAMETERS " + " WHERE " + catalogCond ( "SPECIFIC_SCHEMA" , catalog ) + " AND " + patternCond ( "SPECIFIC_NAME" , functionNamePattern ) + " AND " + patternCond ( "PARAMETER_NAME" , columnNamePattern ) + " AND ROUTINE_TYPE='FUNCTION'" + " ORDER BY FUNCTION_CAT, SPECIFIC_NAME, ORDINAL_POSITION" ; } else { /* * No information _ schema . parameters * TODO : figure out what to do with older versions ( get info via mysql . proc ) * For now , just a dummy result set is returned . */ sql = "SELECT '' FUNCTION_CAT, NULL FUNCTION_SCHEM, '' FUNCTION_NAME," + " '' COLUMN_NAME, 0 COLUMN_TYPE, 0 DATA_TYPE," + " '' TYPE_NAME,0 `PRECISION`,0 LENGTH, 0 SCALE,0 RADIX," + " 0 NULLABLE,NULL REMARKS, 0 CHAR_OCTET_LENGTH , 0 ORDINAL_POSITION, " + " '' IS_NULLABLE, '' SPECIFIC_NAME " + " FROM DUAL WHERE 1=0 " ; } return executeQuery ( sql ) ;
public class HttpClient { /** * Initializes a POST request to the given URL . * @ param url String url * @ return HttpClient * @ throws HelloSignException thrown if the url is invalid */ public HttpClient post ( String url ) throws HelloSignException { } }
if ( getParams != null ) { logger . warn ( "GET parameters set for a POST request, they will be ignored" ) ; } request = new HttpPostRequest ( url , postFields , auth ) ; request . execute ( ) ; return this ;
public class ns_device_profile { /** * < pre > * Use this operation to add device profile . * < / pre > */ public static ns_device_profile add ( nitro_service client , ns_device_profile resource ) throws Exception { } }
resource . validate ( "add" ) ; return ( ( ns_device_profile [ ] ) resource . perform_operation ( client , "add" ) ) [ 0 ] ;
public class NotificationHubsInner { /** * Gets the authorization rules for a NotificationHub . * @ param resourceGroupName The name of the resource group . * @ param namespaceName The namespace name * @ param notificationHubName The notification hub name . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; SharedAccessAuthorizationRuleResourceInner & gt ; object */ public Observable < ServiceResponse < Page < SharedAccessAuthorizationRuleResourceInner > > > listAuthorizationRulesWithServiceResponseAsync ( final String resourceGroupName , final String namespaceName , final String notificationHubName ) { } }
return listAuthorizationRulesSinglePageAsync ( resourceGroupName , namespaceName , notificationHubName ) . concatMap ( new Func1 < ServiceResponse < Page < SharedAccessAuthorizationRuleResourceInner > > , Observable < ServiceResponse < Page < SharedAccessAuthorizationRuleResourceInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < SharedAccessAuthorizationRuleResourceInner > > > call ( ServiceResponse < Page < SharedAccessAuthorizationRuleResourceInner > > page ) { String nextPageLink = page . body ( ) . nextPageLink ( ) ; if ( nextPageLink == null ) { return Observable . just ( page ) ; } return Observable . just ( page ) . concatWith ( listAuthorizationRulesNextWithServiceResponseAsync ( nextPageLink ) ) ; } } ) ;
public class AuthorizationImpl { /** * Answers if the owner has given the principal ( or any of its parents ) permission to perform * the activity on the target . Params < code > owner < / code > and < code > activity < / code > must be * non - null . If < code > target < / code > is null , then target is not checked . * @ return boolean * @ param principal IAuthorizationPrincipal * @ param owner java . lang . String * @ param activity java . lang . String * @ param target java . lang . String * @ exception AuthorizationException indicates authorization information could not be retrieved . */ @ Override @ RequestCache public boolean doesPrincipalHavePermission ( IAuthorizationPrincipal principal , String owner , String activity , String target ) throws AuthorizationException { } }
return doesPrincipalHavePermission ( principal , owner , activity , target , getDefaultPermissionPolicy ( ) ) ;
public class XsdEmitter { /** * Create an XML schema pattern facet . * @ param pattern the value to set * @ return an XML schema pattern facet */ protected XmlSchemaPatternFacet createPatternFacet ( final String pattern ) { } }
XmlSchemaPatternFacet xmlSchemaPatternFacet = new XmlSchemaPatternFacet ( ) ; xmlSchemaPatternFacet . setValue ( pattern ) ; return xmlSchemaPatternFacet ;
public class SnapshotStore { /** * Returns the current snapshot . * @ return the current snapshot */ public Snapshot getCurrentSnapshot ( ) { } }
Map . Entry < Long , Snapshot > entry = snapshots . lastEntry ( ) ; return entry != null ? entry . getValue ( ) : null ;
public class ApiModelToGedObjectVisitor { /** * { @ inheritDoc } */ @ Override public void visit ( final ApiObject baseObject ) { } }
gedObject = builder . createEvent ( parent , baseObject . getType ( ) , baseObject . getString ( ) ) ; addAttributes ( baseObject ) ;
public class SarlcConfigModule { /** * $ NON - NLS - 1 $ */ @ Override protected void configure ( ) { } }
VariableDecls . extend ( binder ( ) ) . declareVar ( OUTPUT_PATH_NAME ) ; extend ( binder ( ) ) . addOption ( OptionMetadata . builder ( Constants . SARL_OUTPUT_DIRECTORY_OPTION , MessageFormat . format ( Messages . SarlcConfigModule_0 , Constants . PROGRAM_NAME , Constants . SARL_OUTPUT_DIRECTORY_OPTION , Path . fromPortableString ( SARLConfig . FOLDER_SOURCE_GENERATED ) . toFile ( ) . getPath ( ) ) ) . configPath ( OUTPUT_PATH_NAME ) . valueRequired ( Messages . SarlcConfigModule_1 ) . build ( ) ) ; VariableDecls . extend ( binder ( ) ) . declareVar ( CLASS_OUTPUT_PATH_NAME ) ; extend ( binder ( ) ) . addOption ( OptionMetadata . builder ( Constants . JAVA_OUTPUT_DIRECTORY_OPTION , MessageFormat . format ( Messages . SarlcConfigModule_6 , Constants . PROGRAM_NAME , Constants . JAVA_OUTPUT_DIRECTORY_OPTION , Path . fromPortableString ( SARLConfig . FOLDER_BIN ) . toFile ( ) . getPath ( ) ) ) . configPath ( CLASS_OUTPUT_PATH_NAME ) . valueRequired ( Messages . SarlcConfigModule_1 ) . build ( ) ) ; VariableDecls . extend ( binder ( ) ) . declareVar ( WORKING_PATH_NAME ) ; extend ( binder ( ) ) . addOption ( OptionMetadata . builder ( "workingdir" , Messages . SarlcConfigModule_2 ) // $ NON - NLS - 1 $ . configPath ( WORKING_PATH_NAME ) . valueRequired ( Messages . SarlcConfigModule_1 ) . build ( ) ) ; VariableDecls . extend ( binder ( ) ) . declareVar ( CLASSPATH_NAME ) ; final String cpDescription = MessageFormat . format ( Messages . SarlcConfigModule_3 , VariableNames . toEnvironmentVariableName ( CLASSPATH_NAME ) , CLASSPATH_SHORT_OPTION , CLASSPATH_LONG_OPTION ) ; extend ( binder ( ) ) . addOptions ( OptionMetadata . builder ( CLASSPATH_LONG_OPTION , cpDescription ) . configPath ( CLASSPATH_NAME ) . valueRequired ( Messages . SarlcConfigModule_4 ) . build ( ) , OptionMetadata . builder ( CLASSPATH_SHORT_OPTION , cpDescription ) . configPath ( CLASSPATH_NAME ) . valueRequired ( Messages . SarlcConfigModule_4 ) . build ( ) ) ; VariableDecls . extend ( binder ( ) ) . declareVar ( BOOT_CLASSPATH_NAME ) ; extend ( binder ( ) ) . addOption ( OptionMetadata . builder ( "bootclasspath" , // $ NON - NLS - 1 $ MessageFormat . format ( Messages . SarlcConfigModule_5 , File . pathSeparator ) ) . configPath ( BOOT_CLASSPATH_NAME ) . valueRequired ( Messages . SarlcConfigModule_4 ) . build ( ) ) ; VariableDecls . extend ( binder ( ) ) . declareVar ( EXTRA_GENERATOR_NAME ) ; extend ( binder ( ) ) . addOption ( OptionMetadata . builder ( "generator" , // $ NON - NLS - 1 $ MessageFormat . format ( Messages . SarlcConfigModule_7 , ExtraLanguageListCommand . EXTRA_LANGUAGE_LIST_OPTION_SHORT_NAME , File . pathSeparator ) ) . configPath ( EXTRA_GENERATOR_NAME ) . valueRequired ( Messages . SarlcConfigModule_8 ) . build ( ) ) ;
public class CircuitBreaker { /** * Transitions to the { @ code newState } if not already in that state and calls any associated event listener . */ private void transitionTo ( State newState , CheckedRunnable listener ) { } }
boolean transitioned = false ; synchronized ( this ) { if ( ! getState ( ) . equals ( newState ) ) { switch ( newState ) { case CLOSED : state . set ( new ClosedState ( this ) ) ; break ; case OPEN : state . set ( new OpenState ( this , state . get ( ) ) ) ; break ; case HALF_OPEN : state . set ( new HalfOpenState ( this ) ) ; break ; } transitioned = true ; } } if ( transitioned && listener != null ) { try { listener . run ( ) ; } catch ( Exception ignore ) { } }
public class Entry { /** * Returns the child of this { @ code Entry } with the given name . * @ param pName the name of the child { @ code Entry } * @ return the child { @ code Entry } or { @ code null } if thee is no such * child * @ throws java . io . IOException if an I / O exception occurs */ public Entry getChildEntry ( final String pName ) throws IOException { } }
if ( isFile ( ) || rootNodeDId == - 1 ) { return null ; } Entry dummy = new Entry ( ) ; dummy . name = pName ; dummy . parent = this ; SortedSet child = getChildEntries ( ) . tailSet ( dummy ) ; return ( Entry ) child . first ( ) ;
public class BlobContainersInner { /** * Gets properties of a specified container . * @ 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 . * @ 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 BlobContainerInner object if successful . */ public BlobContainerInner get ( String resourceGroupName , String accountName , String containerName ) { } }
return getWithServiceResponseAsync ( resourceGroupName , accountName , containerName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class ValidationDataIndexMap { /** * Add index . * @ param data the data */ public void addIndex ( ValidationData data ) { } }
for ( ValidationDataIndex idx : this . idxs ) { ValidationIndexUtil . addIndexData ( data , idx ) ; }
public class CmsCopyMoveDialog { /** * Initializes the form fields . < p > * @ return the form component */ private FormLayout initForm ( ) { } }
FormLayout form = new FormLayout ( ) ; form . setWidth ( "100%" ) ; m_targetPath = new CmsPathSelectField ( ) ; m_targetPath . setCaption ( CmsVaadinUtils . getMessageText ( org . opencms . workplace . commons . Messages . GUI_COPY_MOVE_TARGET_0 ) ) ; m_targetPath . setFileSelectCaption ( CmsVaadinUtils . getMessageText ( Messages . GUI_COPY_MOVE_SELECT_TARGET_CAPTION_0 ) ) ; m_targetPath . setResourceFilter ( CmsResourceFilter . ONLY_VISIBLE_NO_DELETED . addRequireFolder ( ) ) ; m_targetPath . setWidth ( "100%" ) ; form . addComponent ( m_targetPath ) ; if ( m_dialogMode != DialogMode . move ) { m_actionCombo = new ComboBox ( ) ; m_actionCombo . setCaption ( CmsVaadinUtils . getMessageText ( org . opencms . ui . Messages . GUI_COPYPAGE_COPY_MODE_0 ) ) ; m_actionCombo . setNullSelectionAllowed ( false ) ; m_actionCombo . setNewItemsAllowed ( false ) ; m_actionCombo . setWidth ( "100%" ) ; if ( m_context . getResources ( ) . size ( ) == 1 ) { if ( m_context . getResources ( ) . get ( 0 ) . isFile ( ) ) { m_actionCombo . addItem ( Action . copy_all ) ; m_actionCombo . setItemCaption ( Action . copy_all , CmsVaadinUtils . getMessageText ( org . opencms . workplace . commons . Messages . GUI_COPY_AS_NEW_0 ) ) ; m_actionCombo . addItem ( Action . copy_sibling_all ) ; m_actionCombo . setItemCaption ( Action . copy_sibling_all , CmsVaadinUtils . getMessageText ( org . opencms . workplace . commons . Messages . GUI_CREATE_SIBLING_0 ) ) ; if ( m_dialogMode == DialogMode . copy_and_move ) { m_actionCombo . addItem ( Action . move ) ; m_actionCombo . setItemCaption ( Action . move , CmsVaadinUtils . getMessageText ( org . opencms . workplace . commons . Messages . GUI_COPY_MOVE_MOVE_FILE_0 ) ) ; } } else { CmsResource folder = m_context . getResources ( ) . get ( 0 ) ; m_hasContainerPageDefaultFile = hasContainerPageDefaultFile ( folder ) ; if ( m_hasContainerPageDefaultFile ) { m_actionCombo . addItem ( Action . container_page_automatic ) ; m_actionCombo . setItemCaption ( Action . container_page_automatic , CmsVaadinUtils . getMessageText ( Messages . GUI_COPY_MOVE_AUTOMATIC_0 ) ) ; m_actionCombo . addItem ( Action . container_page_copy ) ; m_actionCombo . setItemCaption ( Action . container_page_copy , CmsVaadinUtils . getMessageText ( Messages . GUI_COPY_MOVE_CONTAINERPAGE_COPY_0 ) ) ; m_actionCombo . addItem ( Action . container_page_reuse ) ; m_actionCombo . setItemCaption ( Action . container_page_reuse , CmsVaadinUtils . getMessageText ( Messages . GUI_COPY_MOVE_CONTAINERPAGE_REUSE_0 ) ) ; } if ( CmsResourceTypeFolderSubSitemap . isSubSitemap ( folder ) ) { m_actionCombo . addItem ( Action . sub_sitemap ) ; m_actionCombo . setItemCaption ( Action . sub_sitemap , CmsVaadinUtils . getMessageText ( Messages . GUI_COPY_MOVE_SUBSITEMAP_0 ) ) ; } m_actionCombo . addItem ( Action . copy_sibling_mixed ) ; m_actionCombo . setItemCaption ( Action . copy_sibling_mixed , CmsVaadinUtils . getMessageText ( org . opencms . workplace . commons . Messages . GUI_COPY_ALL_NO_SIBLINGS_0 ) ) ; m_actionCombo . addItem ( Action . copy_all ) ; m_actionCombo . setItemCaption ( Action . copy_all , CmsVaadinUtils . getMessageText ( org . opencms . workplace . commons . Messages . GUI_COPY_ALL_0 ) ) ; m_actionCombo . addItem ( Action . copy_sibling_all ) ; m_actionCombo . setItemCaption ( Action . copy_sibling_all , CmsVaadinUtils . getMessageText ( org . opencms . workplace . commons . Messages . GUI_COPY_MULTI_CREATE_SIBLINGS_0 ) ) ; if ( m_dialogMode == DialogMode . copy_and_move ) { m_actionCombo . addItem ( Action . move ) ; m_actionCombo . setItemCaption ( Action . move , CmsVaadinUtils . getMessageText ( org . opencms . workplace . commons . Messages . GUI_COPY_MOVE_MOVE_FOLDER_0 ) ) ; } } } else { m_actionCombo . addItem ( Action . copy_sibling_mixed ) ; m_actionCombo . setItemCaption ( Action . copy_sibling_mixed , CmsVaadinUtils . getMessageText ( org . opencms . workplace . commons . Messages . GUI_COPY_ALL_NO_SIBLINGS_0 ) ) ; m_actionCombo . addItem ( Action . copy_all ) ; m_actionCombo . setItemCaption ( Action . copy_all , CmsVaadinUtils . getMessageText ( org . opencms . workplace . commons . Messages . GUI_COPY_ALL_0 ) ) ; m_actionCombo . addItem ( Action . copy_sibling_all ) ; m_actionCombo . setItemCaption ( Action . copy_sibling_all , CmsVaadinUtils . getMessageText ( org . opencms . workplace . commons . Messages . GUI_COPY_MULTI_CREATE_SIBLINGS_0 ) ) ; if ( m_dialogMode == DialogMode . copy_and_move ) { m_actionCombo . addItem ( Action . move ) ; m_actionCombo . setItemCaption ( Action . move , CmsVaadinUtils . getMessageText ( org . opencms . workplace . commons . Messages . GUI_COPY_MOVE_MOVE_RESOURCES_0 ) ) ; } } m_actionCombo . setItemStyleGenerator ( new ItemStyleGenerator ( ) { private static final long serialVersionUID = 1L ; public String getStyle ( ComboBox source , Object itemId ) { String style = null ; if ( m_defaultActions . contains ( itemId ) ) { style = "bold" ; } return style ; } } ) ; form . addComponent ( m_actionCombo ) ; m_actionCombo . addValueChangeListener ( event -> updateOverwriteExisting ( ) ) ; } if ( m_context . getResources ( ) . size ( ) > 1 ) { m_overwriteExisting = new CheckBox ( CmsVaadinUtils . getMessageText ( org . opencms . workplace . commons . Messages . GUI_COPY_MULTI_OVERWRITE_0 ) ) ; m_overwriteExisting . setValue ( Boolean . FALSE ) ; form . addComponent ( m_overwriteExisting ) ; updateOverwriteExisting ( ) ; } return form ;
public class AllValuesCollector { /** * Generator method for numeric type bindings . * @ param min * the minimum number * @ param max * the maximum number * @ param ctxt * current context * @ return the newly generated list of values between min and max , including . * @ throws ValueException */ protected ValueList generateNumbers ( int min , int max , Context ctxt ) throws ValueException { } }
ValueList list = new ValueList ( ) ; for ( int i = min ; i < max + 1 ; i ++ ) { list . add ( NumericValue . valueOf ( i , ctxt ) ) ; } return list ;
public class JarConfigurationProvider { /** * Scans the class path and returns a Set containing all structr * modules . * @ return a Set of active module names */ private Set < String > getResourcesToScan ( ) { } }
final String classPath = System . getProperty ( "java.class.path" ) ; final Set < String > modules = new TreeSet < > ( ) ; final Pattern pattern = Pattern . compile ( ".*(structr).*(war|jar)" ) ; final Matcher matcher = pattern . matcher ( "" ) ; for ( final String jarPath : classPath . split ( "[" . concat ( pathSep ) . concat ( "]+" ) ) ) { final String lowerPath = jarPath . toLowerCase ( ) ; if ( lowerPath . endsWith ( classesDir ) || lowerPath . endsWith ( testClassesDir ) ) { modules . add ( jarPath ) ; } else { final String moduleName = lowerPath . substring ( lowerPath . lastIndexOf ( pathSep ) + 1 ) ; matcher . reset ( moduleName ) ; if ( matcher . matches ( ) ) { modules . add ( jarPath ) ; } } } for ( final String resource : Services . getInstance ( ) . getResources ( ) ) { final String lowerResource = resource . toLowerCase ( ) ; if ( lowerResource . endsWith ( ".jar" ) || lowerResource . endsWith ( ".war" ) ) { modules . add ( resource ) ; } } return modules ;
public class JLanguageTool { /** * Get the alphabetically sorted list of unknown words in the latest run of one of the { @ link # check ( String ) } methods . * @ throws IllegalStateException if { @ link # setListUnknownWords ( boolean ) } has been set to { @ code false } */ public List < String > getUnknownWords ( ) { } }
if ( ! listUnknownWords ) { throw new IllegalStateException ( "listUnknownWords is set to false, unknown words not stored" ) ; } List < String > words = new ArrayList < > ( unknownWords ) ; Collections . sort ( words ) ; return words ;
public class FuncRound { /** * { @ inheritDoc } * The round function uses two operands . The second one is the number of * decimal places in which to round to . */ @ Override public void resolve ( final ValueStack values ) throws Exception { } }
if ( values . size ( ) < 2 ) throw new Exception ( "missing operands for " + toString ( ) ) ; try { final double multiplier = Math . pow ( 10 , values . popDouble ( ) ) ; values . push ( new Double ( Math . round ( values . popDouble ( ) * multiplier ) / multiplier ) ) ; } catch ( final ParseException e ) { e . fillInStackTrace ( ) ; throw new Exception ( toString ( ) + "; " + e . getMessage ( ) , e ) ; }
public class AmazonSageMakerClient { /** * Gets information about a labeling job . * @ param describeLabelingJobRequest * @ return Result of the DescribeLabelingJob operation returned by the service . * @ throws ResourceNotFoundException * Resource being access is not found . * @ sample AmazonSageMaker . DescribeLabelingJob * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / sagemaker - 2017-07-24 / DescribeLabelingJob " target = " _ top " > AWS * API Documentation < / a > */ @ Override public DescribeLabelingJobResult describeLabelingJob ( DescribeLabelingJobRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDescribeLabelingJob ( request ) ;
public class FlexibleFileWriter { /** * making this once to be efficient and avoid manipulating strings in switch * operators */ private void compileColumns ( ) { } }
log . debug ( "Compiling columns string: " + getColumns ( ) ) ; String [ ] chunks = JMeterPluginsUtils . replaceRNT ( getColumns ( ) ) . split ( "\\|" ) ; log . debug ( "Chunks " + chunks . length ) ; compiledFields = new int [ chunks . length ] ; compiledVars = new int [ chunks . length ] ; compiledConsts = new ByteBuffer [ chunks . length ] ; for ( int n = 0 ; n < chunks . length ; n ++ ) { int fieldID = availableFieldNames . indexOf ( chunks [ n ] ) ; if ( fieldID >= 0 ) { // log . debug ( chunks [ n ] + " field id : " + fieldID ) ; compiledFields [ n ] = fieldID ; } else { compiledFields [ n ] = - 1 ; compiledVars [ n ] = - 1 ; if ( chunks [ n ] . contains ( VAR_PREFIX ) ) { log . debug ( chunks [ n ] + " is sample variable" ) ; String varN = chunks [ n ] . substring ( VAR_PREFIX . length ( ) ) ; try { compiledVars [ n ] = Integer . parseInt ( varN ) ; } catch ( NumberFormatException e ) { log . error ( "Seems it is not variable spec: " + chunks [ n ] ) ; compiledConsts [ n ] = ByteBuffer . wrap ( chunks [ n ] . getBytes ( ) ) ; } } else { log . debug ( chunks [ n ] + " is const" ) ; if ( chunks [ n ] . length ( ) == 0 ) { // log . debug ( " Empty const , treated as | " ) ; chunks [ n ] = "|" ; } compiledConsts [ n ] = ByteBuffer . wrap ( chunks [ n ] . getBytes ( ) ) ; } } }
public class MappingFilterLexer { /** * $ ANTLR start " STRING _ WITH _ QUOTE " */ public final void mSTRING_WITH_QUOTE ( ) throws RecognitionException { } }
try { int _type = STRING_WITH_QUOTE ; int _channel = DEFAULT_TOKEN_CHANNEL ; // C : \ \ Project \ \ Obdalib \ \ obdalib - parent \ \ obdalib - core \ \ src \ \ main \ \ java \ \ it \ \ unibz \ \ inf \ \ obda \ \ gui \ \ swing \ \ utils \ \ MappingFilter . g : 149:3 : ( ' \ \ ' ' ( options { greedy = false ; } : ~ ( ' \ \ u0027 ' | ' \ \ u005C ' | ' \ \ u000A ' | ' \ \ u000D ' ) | ECHAR ) * ' \ \ ' ' ) // C : \ \ Project \ \ Obdalib \ \ obdalib - parent \ \ obdalib - core \ \ src \ \ main \ \ java \ \ it \ \ unibz \ \ inf \ \ obda \ \ gui \ \ swing \ \ utils \ \ MappingFilter . g : 149:5 : ' \ \ ' ' ( options { greedy = false ; } : ~ ( ' \ \ u0027 ' | ' \ \ u005C ' | ' \ \ u000A ' | ' \ \ u000D ' ) | ECHAR ) * ' \ \ ' ' { match ( '\'' ) ; // C : \ \ Project \ \ Obdalib \ \ obdalib - parent \ \ obdalib - core \ \ src \ \ main \ \ java \ \ it \ \ unibz \ \ inf \ \ obda \ \ gui \ \ swing \ \ utils \ \ MappingFilter . g : 149:10 : ( options { greedy = false ; } : ~ ( ' \ \ u0027 ' | ' \ \ u005C ' | ' \ \ u000A ' | ' \ \ u000D ' ) | ECHAR ) * loop2 : do { int alt2 = 3 ; int LA2_0 = input . LA ( 1 ) ; if ( ( ( LA2_0 >= '\u0000' && LA2_0 <= '\t' ) || ( LA2_0 >= '\u000B' && LA2_0 <= '\f' ) || ( LA2_0 >= '\u000E' && LA2_0 <= '&' ) || ( LA2_0 >= '(' && LA2_0 <= '[' ) || ( LA2_0 >= ']' && LA2_0 <= '\uFFFF' ) ) ) { alt2 = 1 ; } else if ( ( LA2_0 == '\\' ) ) { alt2 = 2 ; } else if ( ( LA2_0 == '\'' ) ) { alt2 = 3 ; } switch ( alt2 ) { case 1 : // C : \ \ Project \ \ Obdalib \ \ obdalib - parent \ \ obdalib - core \ \ src \ \ main \ \ java \ \ it \ \ unibz \ \ inf \ \ obda \ \ gui \ \ swing \ \ utils \ \ MappingFilter . g : 149:40 : ~ ( ' \ \ u0027 ' | ' \ \ u005C ' | ' \ \ u000A ' | ' \ \ u000D ' ) { if ( ( input . LA ( 1 ) >= '\u0000' && input . LA ( 1 ) <= '\t' ) || ( input . LA ( 1 ) >= '\u000B' && input . LA ( 1 ) <= '\f' ) || ( input . LA ( 1 ) >= '\u000E' && input . LA ( 1 ) <= '&' ) || ( input . LA ( 1 ) >= '(' && input . LA ( 1 ) <= '[' ) || ( input . LA ( 1 ) >= ']' && input . LA ( 1 ) <= '\uFFFF' ) ) { input . consume ( ) ; } else { MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; case 2 : // C : \ \ Project \ \ Obdalib \ \ obdalib - parent \ \ obdalib - core \ \ src \ \ main \ \ java \ \ it \ \ unibz \ \ inf \ \ obda \ \ gui \ \ swing \ \ utils \ \ MappingFilter . g : 149:87 : ECHAR { mECHAR ( ) ; } break ; default : break loop2 ; } } while ( true ) ; match ( '\'' ) ; } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving }
public class DbPro { /** * Delete record . * < pre > * Example : * boolean succeed = Db . use ( ) . delete ( " user " , " id " , user ) ; * < / pre > * @ param tableName the table name of the table * @ param primaryKey the primary key of the table , composite primary key is separated by comma character : " , " * @ param record the record * @ return true if delete succeed otherwise false */ public boolean delete ( String tableName , String primaryKey , Record record ) { } }
String [ ] pKeys = primaryKey . split ( "," ) ; if ( pKeys . length <= 1 ) { Object t = record . get ( primaryKey ) ; // 引入中间变量避免 JDK 8 传参有误 return deleteByIds ( tableName , primaryKey , t ) ; } config . dialect . trimPrimaryKeys ( pKeys ) ; Object [ ] idValue = new Object [ pKeys . length ] ; for ( int i = 0 ; i < pKeys . length ; i ++ ) { idValue [ i ] = record . get ( pKeys [ i ] ) ; if ( idValue [ i ] == null ) throw new IllegalArgumentException ( "The value of primary key \"" + pKeys [ i ] + "\" can not be null in record object" ) ; } return deleteByIds ( tableName , primaryKey , idValue ) ;
public class CClassLoader { /** * add a class to known class * @ param className * class name * @ param urlToClass * url to class file */ public final void addClass ( final String className , final URL urlToClass ) { } }
if ( ( className == null ) || ( urlToClass == null ) ) { return ; } if ( ! this . classesMap . containsKey ( className ) ) { this . classesMap . put ( className , urlToClass ) ; }
public class SoapServiceClient { /** * Unwraps a SOAP remote call return such that if there was an exception , it is * thrown and if it was a successful call , the return value of the SOAP call * is returned . * @ param remoteCallReturn the { @ link RemoteCallReturn } to unwrap * @ return the { @ link RemoteCallReturn # getReturnValue ( ) } if the call was * successful * @ throws Throwable the exception captured in the * { @ link RemoteCallReturn # getException ( ) } if present */ protected Object unwrapRemoteCallReturn ( RemoteCallReturn remoteCallReturn ) throws Throwable { } }
if ( remoteCallReturn . getException ( ) != null ) { throw handleException ( remoteCallReturn . getException ( ) ) ; } else { return remoteCallReturn . getReturnValue ( ) ; }
public class LineParser { /** * Returns an string of all tokens that can be considered being command arguments , using the current token position . * @ return argument string */ public String getArgs ( ) { } }
int count = ( this . tokenPosition == 0 ) ? 1 : this . tokenPosition + 1 ; String [ ] ar = StringUtils . split ( this . line , null , count ) ; if ( ar != null && ar . length > ( this . tokenPosition ) ) { return StringUtils . trim ( ar [ this . tokenPosition ] ) ; } return null ;
public class SimpleRestClient { /** * Attempts to extract a useful Canvas error message from a response object . * Sometimes Canvas API errors come back with a JSON body containing something like * < pre > { " errors " : [ { " message " : " Human readable message here . " } ] , " error _ report _ id " : 123456 } < / pre > . * This method will attempt to extract the message . If parsing fails , it will return * the raw JSON string without trying to parse it . Returns null if all attempts fail . * @ param response HttpResponse object representing the error response from Canvas * @ return The Canvas human - readable error string or null if unable to extract it */ private String extractErrorMessageFromResponse ( HttpResponse response ) { } }
String contentType = response . getEntity ( ) . getContentType ( ) . getValue ( ) ; if ( contentType . contains ( "application/json" ) ) { Gson gson = GsonResponseParser . getDefaultGsonParser ( false ) ; String responseBody = null ; try { responseBody = EntityUtils . toString ( response . getEntity ( ) ) ; LOG . error ( "Body of error response from Canvas: " + responseBody ) ; CanvasErrorResponse errorResponse = gson . fromJson ( responseBody , CanvasErrorResponse . class ) ; List < ErrorMessage > errors = errorResponse . getErrors ( ) ; if ( errors != null ) { // I have only ever seen a single error message but it is an array so presumably there could be more . return errors . stream ( ) . map ( e -> e . getMessage ( ) ) . collect ( Collectors . joining ( ", " ) ) ; } else { return responseBody ; } } catch ( Exception e ) { // Returned JSON was not in expected format . Fall back to returning the whole response body , if any if ( StringUtils . isNotBlank ( responseBody ) ) { return responseBody ; } } } return null ;
public class Tokenizer { /** * scan symbol . * @ return symbol token */ public Token scanSymbol ( ) { } }
int length = 0 ; while ( CharType . isSymbol ( charAt ( offset + length ) ) ) { length ++ ; } String literals = input . substring ( offset , offset + length ) ; Symbol symbol ; while ( null == ( symbol = Symbol . literalsOf ( literals ) ) ) { literals = input . substring ( offset , offset + -- length ) ; } return new Token ( symbol , literals , offset + length ) ;