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 - mu...
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 <...
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 s...
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 ...
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...
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 ...
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 . * ...
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 e...
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 IOExce...
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 ReadableByte...
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 exclu...
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...
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 ...
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...
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 S...
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...
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 " " . */ priv...
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 namespa...
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...
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 Exce...
// 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 ( "C...
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...
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 ) ...
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 . o...
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 > * ...
final long timestamp = split . getStartMillis ( ) ; StopwatchTimeRange timeRange ; synchronized ( this ) { timeRange = getOrCreateTimeRange ( timestamp ) ; } if ( timeRange != null ) { // noinspection SynchronizationOnLocalVariableOrMethodParameter synchronized ( timeRange ) { timeRange . addSplit ( timestamp , split ....
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...
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 ( "passwo...
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 ...
// 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 . */ ...
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 f...
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) *...
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 ....
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 ( ) ; ...
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 ...
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 . ...
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 . Col...
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 _ STA...
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...
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 ( jav...
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 ...
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 ...
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'" ) ; InputSt...
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 ...
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 ...
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...
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 ( resourc...
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 destinatio...
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.49...
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 ( ) ; cleanedU...
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 ( ) . */ ...
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 < Sym...
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 comp...
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 , p...
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 [ ] {...
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 > ) * @ retu...
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 . transfo...
SubContextList subContextList = xctxt . getCurrentNodeList ( ) ; int currentNode = DTM . NULL ; if ( null != subContextList ) { if ( subContextList instanceof PredicatedNodeTest ) { LocPathIterator iter = ( ( PredicatedNodeTest ) subContextList ) . getLocPathIterator ( ) ; currentNode = iter . getCurrentContextNode ( )...
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...
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...
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 thi...
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 instanceo...
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 w...
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 nul...
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 > , * < ...
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' T...
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 paramete...
return listAuthorizationRulesSinglePageAsync ( resourceGroupName , namespaceName , notificationHubName ) . concatMap ( new Func1 < ServiceResponse < Page < SharedAccessAuthorizationRuleResourceInner > > , Observable < ServiceResponse < Page < SharedAccessAuthorizationRuleResourceInner > > > > ( ) { @ Override public Ob...
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 check...
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 . fromP...
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 ( th...
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 g...
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...
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 . getMessageTex...
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 */ protect...
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 )...
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 . fillInS...
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 . Desc...
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 ByteBu...
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 ; } : ~ ( ' \...
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 : " ...
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 < pKe...
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 RemoteCal...
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 } < ...
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...
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 T...