signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class RpcLookout { /** * Collect the thread pool information * @ param serverConfig ServerConfig * @ param threadPoolExecutor ThreadPoolExecutor */ public void collectThreadPool ( ServerConfig serverConfig , final ThreadPoolExecutor threadPoolExecutor ) { } }
try { int coreSize = serverConfig . getCoreThreads ( ) ; int maxSize = serverConfig . getMaxThreads ( ) ; int queueSize = serverConfig . getQueues ( ) ; final ThreadPoolConfig threadPoolConfig = new ThreadPoolConfig ( coreSize , maxSize , queueSize ) ; Lookout . registry ( ) . info ( rpcLookoutId . fetchServerThreadCon...
public class TrainModule { /** * Display , for given session : session ID , start time , number of workers , last update * @ param sessionId session ID * @ return info for session as JSON */ private Result sessionInfoForSession ( String sessionId ) { } }
Map < String , Object > dataEachSession = new HashMap < > ( ) ; StatsStorage ss = knownSessionIDs . get ( sessionId ) ; if ( ss != null ) { Map < String , Object > dataThisSession = sessionData ( sessionId , ss ) ; dataEachSession . put ( sessionId , dataThisSession ) ; } return Results . ok ( asJson ( dataEachSession ...
public class CompromisedCredentialsRiskConfigurationTypeMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CompromisedCredentialsRiskConfigurationType compromisedCredentialsRiskConfigurationType , ProtocolMarshaller protocolMarshaller ) { } }
if ( compromisedCredentialsRiskConfigurationType == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( compromisedCredentialsRiskConfigurationType . getEventFilter ( ) , EVENTFILTER_BINDING ) ; protocolMarshaller . marshall ( compromisedCredent...
public class BBCImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . BBC__BCDO_NAME : setBCdoName ( ( String ) newValue ) ; return ; case AfplibPackage . BBC__TRIPLETS : getTriplets ( ) . clear ( ) ; getTriplets ( ) . addAll ( ( Collection < ? extends Triplet > ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class PropositionUtil { /** * Binary search for a primitive parameter by timestamp , optimized for when * the parameters are stored in a list that implements * < code > java . util . RandomAccess < / code > . * @ param list * a < code > List < / code > of < code > PrimitiveParameter < / code > * object...
int low = 0 ; int high = list . size ( ) - 1 ; while ( low <= high ) { /* * We use > > > instead of > > or / 2 to avoid overflow . Sun ' s * implementation of binary search actually doesn ' t do this ( bug * # 5045582 ) . */ int mid = ( low + high ) >>> 1 ; TemporalProposition midVal = list . get ( mid ) ; Long max...
public class BooleanList { /** * Operates exactly as { @ link # remove ( int ) } * @ param index the index to remove * @ return the value removed */ public boolean removeB ( int index ) { } }
boundsCheck ( index ) ; boolean ret = array [ index ] ; for ( int i = index ; i < end - 1 ; i ++ ) array [ i ] = array [ i + 1 ] ; decreaseSize ( 1 ) ; return ret ;
public class SubscriptionService { /** * Changes the amount of a subscription . < br > * < br > * The new amount is valid until the end of the subscription . If you want to set a temporary one - time amount use * { @ link SubscriptionService # changeAmountTemporary ( String , Integer ) } * @ param subscription ...
return changeAmount ( subscription , amount , 1 , currency , interval ) ;
public class FileLogOutput { /** * When enabled , writes to the log will throw LogFileFullException . * Unless objectManagerState . logFullTriggerCheckpointThreshold is set to 1.0 * calling simulateLogOutputFull ( true ) ; will cause the ObjectManager to continually * take checkpoints in order to free up space in...
if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "simulateLogOutputFull" , new Object [ ] { new Boolean ( isFull ) } ) ; synchronized ( logFullReservedLock ) { if ( isFull ) { // Clear as much space as we can . objectManagerState . waitForCheckpoint ( true ) ; // Re...
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getIfcConnectionTypeEnum ( ) { } }
if ( ifcConnectionTypeEnumEEnum == null ) { ifcConnectionTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 798 ) ; } return ifcConnectionTypeEnumEEnum ;
public class diff_match_patch { /** * Increase the context until it is unique , but don ' t let the pattern expand * beyond Match _ MaxBits . * @ param patch * The patch to grow . * @ param text * Source text . */ protected void patch_addContext ( Patch patch , String text ) { } }
if ( text . length ( ) == 0 ) { return ; } String pattern = text . substring ( patch . start2 , patch . start2 + patch . length1 ) ; int padding = 0 ; // Look for the first and last matches of pattern in text . If two // different // matches are found , increase the pattern length . while ( text . indexOf ( pattern ) !...
public class SqlParserImpl { /** * { @ inheritDoc } * @ see jp . co . future . uroborosql . parser . SqlParser # parse ( ) */ @ Override public ContextTransformer parse ( ) { } }
push ( new ContainerNode ( 0 , 0 ) ) ; while ( TokenType . EOF != tokenizer . next ( ) ) { parseToken ( ) ; } return new ContextTransformer ( pop ( ) ) ;
public class HostInfo { private static String toStaticString ( ) { } }
String str = "" ; try { if ( name == null ) new HostInfo ( ) ; str += "name: " + name + "\n" ; str += "address: " + address + "\n" ; } catch ( DevFailed e ) { str = e . errors [ 0 ] . desc ; } return str ;
public class UserRepository { /** * Looks up a user by a session identifier . * @ return the user associated with the specified session or null of no session exists with the * supplied identifier . */ public User loadUserBySession ( String sessionKey ) throws PersistenceException { } }
User user = load ( _utable , "sessions" , "where authcode = '" + sessionKey + "' " + "AND sessions.userId = users.userId" ) ; if ( user != null ) { user . setDirtyMask ( _utable . getFieldMask ( ) ) ; } return user ;
public class SqlValidatorImpl { /** * Registers a query in a parent scope . * @ param parentScope Parent scope which this scope turns to in order to * resolve objects * @ param usingScope Scope whose child list this scope should add itself to * @ param node Query node * @ param alias Name of this query within...
Preconditions . checkArgument ( usingScope == null || alias != null ) ; registerQuery ( parentScope , usingScope , node , enclosingNode , alias , forceNullable , true ) ;
public class LogConfigMarshaller { /** * Marshall the given parameter object . */ public void marshall ( LogConfig logConfig , ProtocolMarshaller protocolMarshaller ) { } }
if ( logConfig == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( logConfig . getFieldLogLevel ( ) , FIELDLOGLEVEL_BINDING ) ; protocolMarshaller . marshall ( logConfig . getCloudWatchLogsRoleArn ( ) , CLOUDWATCHLOGSROLEARN_BINDING ) ; } cat...
public class SniffyRequestProcessor { /** * Generates following HTML snippet * < pre > * { @ code * < data id = " sniffy " data - sql - queries = " 5 " / > * < / pre > * @ param executedQueries number of executed queries * @ return StringBuilder with generated HTML */ protected StringBuilder generateFooterH...
return new StringBuilder ( ) . append ( "<data id=\"sniffy\" data-sql-queries=\"" ) . append ( executedQueries ) . append ( "\" data-server-time=\"" ) . append ( serverTime ) . append ( "\"/>" ) ;
public class MessageFactory { /** * < p > Creates and returns a FacesMessage for the specified Locale . < / p > * @ param locale - the target < code > Locale < / code > * @ param messageId - the key of the message in the resource bundle * @ param params - substittion parameters * @ return a localized < code > F...
String summary = null ; String detail = null ; ResourceBundle bundle ; String bundleName ; // see if we have a user - provided bundle Application app = getApplication ( ) ; Class appClass = app . getClass ( ) ; if ( null != ( bundleName = app . getMessageBundle ( ) ) ) { if ( null != ( bundle = ResourceBundle . getBund...
public class CmsResultsBackwardsScrollHandler { /** * Loads a page with a given index . < p > * @ param pageNum the index of the page to load */ protected void loadPage ( int pageNum ) { } }
int start = ( pageNum - 1 ) * m_pageSize ; List < CmsResultItemBean > results = m_resultBeans ; int end = start + m_pageSize ; if ( end > results . size ( ) ) { end = results . size ( ) ; } List < CmsResultItemBean > page = results . subList ( start , end ) ; boolean showPath = SortParams . path_asc . name ( ) . equals...
public class UploadWorkerThread { /** * This function is called when a media file was added on a different * node , such as a mobile device . In that case , the media is marked * as ' submitted _ inline ' since the media is already attached to the document * but as not yet gone through the process that the robot ...
String attachmentName = work . getAttachmentName ( ) ; FileConversionContext conversionContext = new FileConversionContextImpl ( work , documentDbDesign , mediaDir ) ; DocumentDescriptor docDescriptor = conversionContext . getDocument ( ) ; AttachmentDescriptor attDescription = null ; if ( docDescriptor . isAttachmentD...
public class MMAXAnnotation { /** * setter for pointerList - sets The list of MMAX pointers of the MMAX annotation . * @ generated * @ param v value to set into the feature */ public void setPointerList ( FSArray v ) { } }
if ( MMAXAnnotation_Type . featOkTst && ( ( MMAXAnnotation_Type ) jcasType ) . casFeat_pointerList == null ) jcasType . jcas . throwFeatMissing ( "pointerList" , "de.julielab.jules.types.mmax.MMAXAnnotation" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( MMAXAnnotation_Type ) jcasType ) . casFeatCode_pointerList ,...
public class CanonicalIterator { /** * See if the decomposition of cp2 is at segment starting at segmentPos * ( with canonical rearrangment ! ) * If so , take the remainder , and return the equivalents */ private Set < String > extract ( int comp , String segment , int segmentPos , StringBuffer buf ) { } }
if ( PROGRESS ) System . out . println ( " extract: " + Utility . hex ( UTF16 . valueOf ( comp ) ) + ", " + Utility . hex ( segment . substring ( segmentPos ) ) ) ; String decomp = nfcImpl . getDecomposition ( comp ) ; if ( decomp == null ) { decomp = UTF16 . valueOf ( comp ) ; } // See if it matches the start of segme...
public class BccClient { /** * Starting the instance owned by the user . * You can start the instance only when the instance is Stopped , * otherwise , it ' s will get < code > 409 < / code > errorCode . * This is an asynchronous interface , * you can get the latest status by invoke { @ link # getInstance ( Get...
checkNotNull ( request , "request should not be null." ) ; checkStringNotEmpty ( request . getInstanceId ( ) , "request instanceId should not be empty." ) ; InternalRequest internalRequest = this . createRequest ( request , HttpMethodName . PUT , INSTANCE_PREFIX , request . getInstanceId ( ) ) ; internalRequest . addPa...
public class ArrayBlockingQueue { /** * Inserts the specified element at the tail of this queue , waiting * up to the specified wait time for space to become available if * the queue is full . * @ throws InterruptedException { @ inheritDoc } * @ throws NullPointerException { @ inheritDoc } */ public boolean off...
Objects . requireNonNull ( e ) ; long nanos = unit . toNanos ( timeout ) ; final ReentrantLock lock = this . lock ; lock . lockInterruptibly ( ) ; try { while ( count == items . length ) { if ( nanos <= 0L ) return false ; nanos = notFull . awaitNanos ( nanos ) ; } enqueue ( e ) ; return true ; } finally { lock . unloc...
public class FileObjectReaderImpl { /** * { @ inheritDoc } */ public long readLong ( ) throws IOException { } }
ByteBuffer dst = ByteBuffer . allocate ( 8 ) ; readFully ( dst ) ; return dst . asLongBuffer ( ) . get ( ) ;
public class DefaultEmailModel { /** * converts an email address and a name to an { @ link InternetAddress } * @ param address a valid email address * @ param personal the real world name of the sender ( can be null ) * @ return the converted InternetAddress * @ throws AddressException in case of an invalid ema...
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Creating InternetAddress from address [{}] and personal [{}]" , address , personal ) ; } InternetAddress internetAddress ; try { internetAddress = new InternetAddress ( address , true ) ; } catch ( AddressException e ) { logger . error ( String . format ( "Cannot p...
public class FilesOutputStream { /** * Add manifest entry to this files output stream . This method reset { @ link # manifest } to null signaling manifest was * processed . * @ throws IOException if manifest entry write fails . */ private void addManifestEntry ( ) throws IOException { } }
ZipEntry entry = new ZipEntry ( JarFile . MANIFEST_NAME ) ; filesArchive . putNextEntry ( entry ) ; try { manifest . write ( this ) ; } finally { filesArchive . closeEntry ( ) ; manifest = null ; }
public class CommerceCurrencyUtil { /** * Returns all the commerce currencies where groupId = & # 63 ; and primary = & # 63 ; and active = & # 63 ; . * @ param groupId the group ID * @ param primary the primary * @ param active the active * @ return the matching commerce currencies */ public static List < Comme...
return getPersistence ( ) . findByG_P_A ( groupId , primary , active ) ;
public class JSONUtils { /** * Constructs ES bulk header for the document . * @ param event * data event * @ param index * index name * @ param type * document type * @ return ES bulk header */ public static String getElasticSearchBulkHeader ( SimpleDataEvent event , String index , String type ) { } }
StringBuilder builder = new StringBuilder ( ) ; builder . append ( "{\"index\":{\"_index\":\"" ) ; builder . append ( index ) ; builder . append ( "\",\"_type\":\"" ) ; builder . append ( type ) ; builder . append ( "\",\"_id\":\"" ) ; builder . append ( event . getId ( ) ) ; builder . append ( "\"}}" ) ; return builde...
public class FastAggregation { /** * Compute overall XOR between bitmaps two - by - two . * This function runs in linear time with respect to the number of bitmaps . * @ param bitmaps input bitmaps * @ return aggregated bitmap */ public static RoaringBitmap naive_xor ( RoaringBitmap ... bitmaps ) { } }
RoaringBitmap answer = new RoaringBitmap ( ) ; for ( int k = 0 ; k < bitmaps . length ; ++ k ) { answer . xor ( bitmaps [ k ] ) ; } return answer ;
public class UsersApi { /** * Search for users . * Search for users with the specified filters . * @ param searchTerm The text to search . ( optional ) * @ param groupId The ID of the group where the user belongs . ( optional ) * @ param sort The sort order , either & # x60 ; asc & # x60 ; ( ascending ) or & # ...
com . squareup . okhttp . Call call = getUsersValidateBeforeCall ( searchTerm , groupId , sort , sortBy , limit , offset , channels , null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class DOMHelper { /** * Returns the local name of the given node . If the node ' s name begins * with a namespace prefix , this is the part after the colon ; otherwise * it ' s the full node name . * @ param n the node to be examined . * @ return String containing the Local Name */ public String getLocal...
String qname = n . getNodeName ( ) ; int index = qname . indexOf ( ':' ) ; return ( index < 0 ) ? qname : qname . substring ( index + 1 ) ;
public class FuzzyActivityDomain { /** * Sets all { @ link Variable } s underlying a { @ link MetaVariable } to the UNJUSTIFIED state . * @ param metaVariable */ public void setUnjustified ( ConstraintNetwork metaVariable ) { } }
for ( Variable v : metaVariable . getVariables ( ) ) v . setMarking ( markings . UNJUSTIFIED ) ;
public class Data { /** * Read tst data . * @ param dataFile the data file */ public void readTstData ( String dataFile ) { } }
if ( tstData != null ) { tstData . clear ( ) ; } else { tstData = new ArrayList ( ) ; } // open data file BufferedReader fin = null ; try { fin = new BufferedReader ( new InputStreamReader ( new FileInputStream ( dataFile ) , "UTF-8" ) ) ; System . out . println ( "Reading testing data ..." ) ; String line ; while ( ( ...
public class JsonArrayFormat { /** * Defines array format for serialized entities with ObjectMapper , without actually * including the schema */ @ Override public JsonFormat . Value findFormat ( Annotated ann ) { } }
// If the entity contains JsonFormat annotation , give it higher priority . JsonFormat . Value precedenceFormat = super . findFormat ( ann ) ; if ( precedenceFormat != null ) { return precedenceFormat ; } return ARRAY_FORMAT ;
public class QueueListener { /** * 取得按表达式的方式订阅的消息后的处理 */ @ Override public void onPMessage ( String pattern , String channel , String message ) { } }
System . out . println ( pattern + "=" + channel + "=" + message ) ;
public class GeneratePySanitizeEscapingDirectiveCode { /** * A non Ant interface for this class . */ public static void main ( String [ ] args ) throws IOException { } }
GeneratePySanitizeEscapingDirectiveCode generator = new GeneratePySanitizeEscapingDirectiveCode ( ) ; generator . configure ( args ) ; generator . execute ( ) ;
public class ServerAttribute { /** * Do the applyChange without creating commands that are sent to the client */ public void silently ( final Runnable applyChange ) { } }
boolean temp = notifyClient ; notifyClient = false ; try { applyChange . run ( ) ; } finally { notifyClient = temp ; }
public class PreconditionUtil { /** * Asserts that a condition is true . If it isn ' t it throws an * { @ link AssertionError } with the given message . * @ param message the identifying message for the { @ link AssertionError } ( * < code > null < / code > okay ) * @ param condition condition to be checked */ ...
verify ( condition , message , args ) ;
public class Node { /** * remove element */ protected void moveElementsLeft ( final Object [ ] elements , final int srcPos ) { } }
if ( log . isDebugEnabled ( ) ) { log . debug ( "moveElementsLeft(" + srcPos + ") allocated=" + allocated + ":" + keys . length + ":" + ( allocated - srcPos - 1 ) + ":" + ( keys . length - srcPos - 1 ) ) ; } System . arraycopy ( elements , srcPos + 1 , elements , srcPos , allocated - srcPos - 1 ) ;
public class Constraint { /** * VoltDB added method to get a non - catalog - dependent * representation of this HSQLDB object . * @ param session The current Session object may be needed to resolve * some names . * @ return XML , correctly indented , representing this object . */ VoltXMLElement voltGetConstrain...
// Skip " MAIN " constraints , as they are a side effect of foreign key constraints and add no new info . if ( this . constType == MAIN ) { return null ; } VoltXMLElement constraint = new VoltXMLElement ( "constraint" ) ; // WARNING : the name attribute setting is tentative , subject to reset in the // calling function...
public class ExpandedExample { /** * Print out the Log for specific Pods * @ param namespace * @ param podName * @ throws ApiException */ public static void printLog ( String namespace , String podName ) throws ApiException { } }
// https : / / github . com / kubernetes - client / java / blob / master / kubernetes / docs / CoreV1Api . md # readNamespacedPodLog String readNamespacedPodLog = COREV1_API . readNamespacedPodLog ( podName , namespace , null , Boolean . FALSE , Integer . MAX_VALUE , null , Boolean . FALSE , Integer . MAX_VALUE , 40 , ...
public class FunctionConfigurationEnvironment { /** * A list of the resources , with their permissions , to which the Lambda function will be granted access . A Lambda * function can have at most 10 resources . ResourceAccessPolicies apply only when you run the Lambda function in a * Greengrass container . * < b ...
if ( this . resourceAccessPolicies == null ) { setResourceAccessPolicies ( new java . util . ArrayList < ResourceAccessPolicy > ( resourceAccessPolicies . length ) ) ; } for ( ResourceAccessPolicy ele : resourceAccessPolicies ) { this . resourceAccessPolicies . add ( ele ) ; } return this ;
public class UserTransactionImpl { /** * unregister users who want notification on UserTransaction Begin and End * @ param callback */ public void unregisterCallback ( UOWScopeCallback callback ) { } }
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "unregisterCallback" , new Object [ ] { callback , this } ) ; _callbackManager . removeCallback ( callback ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "unregisterCallback" ) ;
public class ExpressionTree { /** * Helper to create the original expression ( or at least a nested expression * without the parameters included ) * @ return A string representing the full expression . */ public String writeStringField ( ) { } }
final List < String > strs = Lists . newArrayList ( ) ; if ( sub_expressions != null ) { for ( ExpressionTree sub : sub_expressions ) { strs . add ( sub . toString ( ) ) ; } } if ( sub_metric_queries != null ) { final String sub_metrics = clean ( sub_metric_queries . values ( ) ) ; if ( sub_metrics != null && sub_metri...
public class AbstractGitFlowMojo { /** * Executes git branch - D . * @ param branchName * Branch name to delete . * @ throws MojoFailureException * @ throws CommandLineException */ protected void gitBranchDeleteForce ( final String branchName ) throws MojoFailureException , CommandLineException { } }
getLog ( ) . info ( "Deleting (-D) '" + branchName + "' branch." ) ; executeGitCommand ( "branch" , "-D" , branchName ) ;
public class CmsUIServlet { /** * Checks whether the given request was referred from the login page . < p > * @ param request the request * @ return < code > true < / code > in case of login ui requests */ static boolean isLoginUIRequest ( VaadinRequest request ) { } }
String referrer = request . getHeader ( "referer" ) ; return ( referrer != null ) && referrer . contains ( CmsWorkplaceLoginHandler . LOGIN_HANDLER ) ;
public class Depiction { /** * Write the depiction to the provided output stream . * @ param fmt format * @ param out output stream * @ throws IOException depiction could not be written , low level IO problem * @ see # listFormats ( ) */ public final void writeTo ( String fmt , OutputStream out ) throws IOExcep...
if ( fmt . equalsIgnoreCase ( SVG_FMT ) ) { out . write ( toSvgStr ( ) . getBytes ( Charsets . UTF_8 ) ) ; } else if ( fmt . equalsIgnoreCase ( PS_FMT ) ) { out . write ( toEpsStr ( ) . getBytes ( Charsets . UTF_8 ) ) ; } else if ( fmt . equalsIgnoreCase ( PDF_FMT ) ) { out . write ( toPdfStr ( ) . getBytes ( Charsets ...
public class MuzeiArtSource { /** * Convenience method for accessing preferences specific to the source ( with the given name * within this package . The source name must be the one provided in the * { @ link # MuzeiArtSource ( String ) } constructor . This static method is useful for exposing source * preference...
return context . getSharedPreferences ( "muzeiartsource_" + sourceName , 0 ) ;
public class FastqBuilder { /** * Build and return a new FASTQ formatted sequence configured from the properties of this builder . * @ return a new FASTQ formatted sequence configured from the properties of this builder * @ throws IllegalStateException if the configuration of this builder results in an illegal stat...
if ( description == null ) { throw new IllegalStateException ( "description must not be null" ) ; } if ( sequence == null ) { throw new IllegalStateException ( "sequence must not be null" ) ; } if ( quality == null ) { throw new IllegalStateException ( "quality must not be null" ) ; } if ( ! sequenceAndQualityLengthsMa...
public class TransactionIntegrationImpl { /** * { @ inheritDoc } */ public XAResourceWrapper createConnectableXAResourceWrapper ( XAResource xares , boolean pad , Boolean override , String productName , String productVersion , String jndiName , ManagedConnection mc , XAResourceStatistics xastat ) { } }
if ( mc instanceof org . ironjacamar . core . spi . transaction . FirstResource || mc instanceof org . jboss . tm . FirstResource ) { if ( xastat != null && xastat . isEnabled ( ) ) { return new FirstResourceConnectableXAResourceWrapperStatImpl ( xares , pad , override , productName , productVersion , jndiName , ( org ...
public class JavaTokenizer { /** * Read next character in character or string literal and copy into sbuf . */ private void scanLitChar ( int pos ) { } }
if ( reader . ch == '\\' ) { if ( reader . peekChar ( ) == '\\' && ! reader . isUnicode ( ) ) { reader . skipChar ( ) ; reader . putChar ( '\\' , true ) ; } else { reader . scanChar ( ) ; switch ( reader . ch ) { case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : char leadch = reade...
public class Drawer { /** * Format a nav drawer item based on current selected states * @ param item * @ param selected */ private void formatNavDrawerItem ( DrawerItem item , boolean selected ) { } }
if ( item instanceof SeperatorDrawerItem || item instanceof SwitchDrawerItem ) { // not applicable return ; } // Get the associated view View view = mNavDrawerItemViews . get ( item . getId ( ) ) ; ImageView iconView = ( ImageView ) view . findViewById ( R . id . icon ) ; TextView titleView = ( TextView ) view . findVi...
public class ApiOvhOrder { /** * Get prices and contracts information * REST : GET / order / router / new / { duration } * @ param vrack [ required ] The name of your vrack * @ param duration [ required ] Duration */ public OvhOrder router_new_duration_GET ( String duration , String vrack ) throws IOException { }...
String qPath = "/order/router/new/{duration}" ; StringBuilder sb = path ( qPath , duration ) ; query ( sb , "vrack" , vrack ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhOrder . class ) ;
public class VersionRange { /** * ( non - Javadoc ) * @ see net . ossindex . version . impl . IVersionRange # toMavenString ( ) */ @ Override public String toMavenString ( ) { } }
String mavenString = "" ; switch ( operator ) { case "<=" : mavenString = "(,%s]" ; break ; case "<" : mavenString = "(,%s)" ; break ; case "==" : mavenString = "[%s]" ; break ; case ">=" : mavenString = "[%s,)" ; break ; case ">" : mavenString = "(%s,)" ; break ; default : toString ( ) ; } return String . format ( mav...
public class JsonUtils { /** * 指定泛型 , JSON串转对象 * @ param text JSON串 * @ param clazz 对象类型 * @ param < T > 对象泛型 * @ return 转换得到的对象 */ public static < T > T toBean ( String text , Class < T > clazz ) { } }
return JSON . parseObject ( text , clazz ) ;
public class CmsGlobalConfigurationCacheEventHandler { /** * Removes a resource from the online caches . < p > * @ param resource the resource to remove */ protected void onlineCacheRemove ( CmsPublishedResource resource ) { } }
for ( CachePair cachePair : m_caches ) { try { cachePair . getOnlineCache ( ) . remove ( resource ) ; } catch ( Throwable e ) { LOG . error ( e . getLocalizedMessage ( ) ) ; } }
public class StorableGenerator { /** * Defines a toString method , which assumes that the ClassFile is targeting * version 1.5 of Java . * @ param keyOnly when true , generate a toStringKeyOnly method instead */ private void addToStringMethod ( boolean keyOnly ) { } }
TypeDesc stringBuilder = TypeDesc . forClass ( StringBuilder . class ) ; Modifiers modifiers = Modifiers . PUBLIC . toSynchronized ( true ) ; MethodInfo mi = addMethodIfNotFinal ( modifiers , keyOnly ? TO_STRING_KEY_ONLY_METHOD_NAME : TO_STRING_METHOD_NAME , TypeDesc . STRING , null ) ; if ( mi == null ) { return ; } C...
public class BDDImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case AfplibPackage . BDD__UBASE : return getUBASE ( ) ; case AfplibPackage . BDD__RESERVED : return getReserved ( ) ; case AfplibPackage . BDD__XUPUB : return getXUPUB ( ) ; case AfplibPackage . BDD__YUPUB : return getYUPUB ( ) ; case AfplibPackage . BDD__XEXTENT : return getXEXTENT ( ) ; case Af...
public class SessionManager { /** * This method rebuilds members related to the SessionManager instance , * which were not directly persisted themselves . */ public void restoreAfterSafeModeRestart ( ) { } }
if ( ! clusterManager . safeMode ) { return ; } for ( Session session : sessions . values ( ) ) { for ( ResourceRequestInfo resourceRequestInfo : session . idToRequest . values ( ) ) { // The helper method to restore the ResourceRequestInfo instances // is placed in NodeManager because it makes use of other members // ...
public class Matrix4 { /** * Sets this to a reflection across the specified plane . * @ return a reference to this matrix , for chaining . */ public Matrix4 setToReflection ( float x , float y , float z , float w ) { } }
float x2 = - 2f * x , y2 = - 2f * y , z2 = - 2f * z ; float xy2 = x2 * y , xz2 = x2 * z , yz2 = y2 * z ; float x2y2z2 = x * x + y * y + z * z ; return set ( 1f + x2 * x , xy2 , xz2 , x2 * w * x2y2z2 , xy2 , 1f + y2 * y , yz2 , y2 * w * x2y2z2 , xz2 , yz2 , 1f + z2 * z , z2 * w * x2y2z2 , 0f , 0f , 0f , 1f ) ;
public class Selectable { /** * Selector that matches any child element that satisfies the specified constraints . If no * constraints are provided , accepts all child elements . * @ param constraints element constraints * @ return element selector */ public final ChildSelector < T > child ( ElementConstraint ......
return new ChildSelector < T > ( getContext ( ) , getCurrentSelector ( ) , Arrays . asList ( constraints ) ) ;
public class MarkdownParser { /** * Outer parsing method : Processing code blocks first * @ param cursor text cursor * @ param paragraphs current paragraphs * @ return is code block found */ private boolean handleCodeBlock ( TextCursor cursor , ArrayList < MDSection > paragraphs ) { } }
if ( mode != MODE_ONLY_LINKS ) { int blockStart = findCodeBlockStart ( cursor ) ; if ( blockStart >= 0 ) { int blockEnd = findCodeBlockEnd ( cursor , blockStart ) ; if ( blockEnd >= 0 ) { // Adding Text Block if there are some elements before code block if ( cursor . currentOffset < blockStart ) { handleTextBlock ( cur...
public class Subscription { /** * Retrieves the subscription with the given ID . */ public static Subscription retrieve ( String subscriptionExposedId ) throws StripeException { } }
return retrieve ( subscriptionExposedId , ( Map < String , Object > ) null , ( RequestOptions ) null ) ;
public class CmsResourceTypeStatsView { /** * Sets the click listener for the ok button . < p > */ private void setClickListener ( ) { } }
m_ok . addClickListener ( new Button . ClickListener ( ) { private static final long serialVersionUID = 6621475980210242125L ; public void buttonClick ( com . vaadin . ui . Button . ClickEvent event ) { try { CmsResourceFilter filter = getType ( ) == null ? CmsResourceFilter . ALL : CmsResourceFilter . requireType ( ge...
public class Operand { /** * Sets the sharedSet value for this Operand . * @ param sharedSet */ public void setSharedSet ( com . google . api . ads . adwords . axis . v201809 . cm . SharedSet sharedSet ) { } }
this . sharedSet = sharedSet ;
public class AbstractPlayMojo { /** * used by " war " and " war - support " mojos */ protected File filterWebXml ( File webXml , File outputDirectory , String applicationName , String playWarId ) throws IOException { } }
if ( ! outputDirectory . exists ( ) ) { if ( ! outputDirectory . mkdirs ( ) ) { throw new IOException ( String . format ( "Cannot create \"%s\" directory" , outputDirectory . getCanonicalPath ( ) ) ) ; } } File result = new File ( outputDirectory , "filtered-web.xml" ) ; BufferedReader reader = createBufferedFileReader...
public class KDTree { /** * Finds the closest point in the hyper rectangle to a given point . Change the * given point to this closest point by clipping of at all the dimensions to * be clipped of . If the point is inside the rectangle it stays unchanged . The * return value is true if the point was not changed ,...
boolean inside = true ; for ( int i = 0 ; i < m_Instances . numAttributes ( ) ; i ++ ) { // TODO treat nominals differently ! ? ? if ( x . value ( i ) < node . m_NodeRanges [ i ] [ MIN ] ) { x . setValue ( i , node . m_NodeRanges [ i ] [ MIN ] ) ; inside = false ; } else if ( x . value ( i ) > node . m_NodeRanges [ i ]...
public class OrderBy { /** * Gets the sortOrder value for this OrderBy . * @ return sortOrder * The order to sort the results on . The default sort order is * { @ link SortOrder # ASCENDING } . */ public com . google . api . ads . adwords . axis . v201809 . cm . SortOrder getSortOrder ( ) { } }
return sortOrder ;
public class TermOfUsePanel { /** * Factory method for creating the new { @ link Component } for the modifications clause . This * method is invoked in the constructor from the derived classes and can be overridden so users * can provide their own version of a new { @ link Component } for the modifications clause ....
return new ModificationsClausePanel ( id , Model . of ( model . getObject ( ) ) ) ;
public class InnerNodeImpl { /** * Removes { @ code oldChild } and adds { @ code newChild } in its place . This * is not atomic . */ public Node replaceChild ( Node newChild , Node oldChild ) throws DOMException { } }
int index = ( ( LeafNodeImpl ) oldChild ) . index ; removeChild ( oldChild ) ; insertChildAt ( newChild , index ) ; return oldChild ;
public class ReportMessageConverterImpl { /** * Given a Report Message property , this method performs a conversion between * the MQC and MFP constants and then returns the object result . * @ param propName Name of property to convert * @ param coreMsg The message on which to perform the conversion * @ return ...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getReportOption" , new Object [ ] { propName , coreMsg } ) ; Object result = null ; if ( propName . equals ( ApiJmsConstants . REPORT_EXCEPTION_PROPERTY ) ) { Byte value = coreMsg . getReportException ( ) ; if ( Trac...
public class TimeRangeChecker { /** * Checks if a specified time is on a day that is specified the a given { @ link List } of acceptable days , and that the * hours + minutes of the specified time fall into a range defined by startTimeStr and endTimeStr . * @ param days is a { @ link List } of days , if the specifi...
if ( ! Iterables . any ( days , new AreDaysEqual ( DAYS_OF_WEEK . get ( currentTime . getDayOfWeek ( ) ) ) ) ) { return false ; } DateTime startTime = null ; DateTime endTime = null ; try { startTime = HOUR_MINUTE_FORMATTER . withZone ( DATE_TIME_ZONE ) . parseDateTime ( startTimeStr ) ; } catch ( IllegalArgumentExcept...
public class IntegratedBitPacking { /** * Pack 32 integers as deltas with an initial value * @ param initoffset initial value ( used to compute first delta ) * @ param in input array * @ param inpos initial position in input array * @ param out output array * @ param outpos initial position in output array ...
switch ( bit ) { case 0 : integratedpack0 ( initoffset , in , inpos , out , outpos ) ; break ; case 1 : integratedpack1 ( initoffset , in , inpos , out , outpos ) ; break ; case 2 : integratedpack2 ( initoffset , in , inpos , out , outpos ) ; break ; case 3 : integratedpack3 ( initoffset , in , inpos , out , outpos ) ;...
public class HawkularMetrics { /** * Process the next item in the queue . */ protected void processQueue ( ) { } }
try { QueueItem item = queue . take ( ) ; client . addMultipleCounterDataPoints ( item . tenantId , item . data ) ; } catch ( InterruptedException e ) { // TODO better logging of this unlikely error e . printStackTrace ( ) ; return ; }
public class AbstractCommonShapeFileWriter { /** * Force this writer to write the memory buffer inside the temporary file . * @ throws IOException in case of error . */ protected void flush ( ) throws IOException { } }
if ( this . tempStream != null && this . buffer . position ( ) > 0 ) { final int pos = this . buffer . position ( ) ; this . buffer . rewind ( ) ; this . buffer . limit ( pos ) ; this . tempStream . write ( this . buffer ) ; this . buffer . rewind ( ) ; this . buffer . limit ( this . buffer . capacity ( ) ) ; this . bu...
public class DeleteVpcRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < DeleteVpcRequest > getDryRunRequest ( ) { } }
Request < DeleteVpcRequest > request = new DeleteVpcRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class VerboseFormatter { /** * Append function location . * @ param message The message builder . * @ param event The log record . */ private static void appendFunction ( StringBuilder message , LogRecord event ) { } }
final String clazz = event . getSourceClassName ( ) ; if ( clazz != null ) { message . append ( IN ) . append ( clazz ) ; } final String function = event . getSourceMethodName ( ) ; if ( function != null ) { message . append ( AT ) . append ( function ) . append ( Constant . DOUBLE_DOT ) ; }
public class GitLabApiClient { /** * Sets up Jersey client to ignore certificate errors . * @ return true if successful at setting up to ignore certificate errors , otherwise returns false . */ private boolean setupIgnoreCertificateErrors ( ) { } }
// Create a TrustManager that trusts all certificates TrustManager [ ] trustAllCerts = new TrustManager [ ] { new X509ExtendedTrustManager ( ) { @ Override public X509Certificate [ ] getAcceptedIssuers ( ) { return null ; } @ Override public void checkServerTrusted ( X509Certificate [ ] chain , String authType ) throws...
public class BeanUtils { private static void checkBeanFactory ( long waitTime , String bean ) { } }
if ( beanFactory != null ) { return ; } // Jeśli czas oczekiwania jest określony , to wstrzymujemy bieżący wątek // do momentu ustawienia fabryki bean ' ów . Dla ujemnej wartości czasu // oczekiwania - do skutku . Jeśli wartość jest dodatnia - aż upłynie // zdana ilość sekund : if ( waitTime != 0 ) { long ...
public class LingoSimilarity { /** * Evaluate the LINGO similarity between two key , value sty ; e fingerprints . * The value will range from 0.0 to 1.0. * @ param features1 * @ param features2 * @ return similarity */ public static float calculate ( Map < String , Integer > features1 , Map < String , Integer >...
TreeSet < String > keys = new TreeSet < String > ( features1 . keySet ( ) ) ; keys . addAll ( features2 . keySet ( ) ) ; float sum = 0.0f ; for ( String key : keys ) { Integer c1 = features1 . get ( key ) ; Integer c2 = features2 . get ( key ) ; c1 = c1 == null ? 0 : c1 ; c2 = c2 == null ? 0 : c2 ; sum += 1.0 - Math . ...
public class Expressions { /** * Create a new Path expression * @ param type type of expression * @ param parent parent path * @ param property property name * @ return property path */ public static < T > SimplePath < T > simplePath ( Class < ? extends T > type , Path < ? > parent , String property ) { } }
return new SimplePath < T > ( type , PathMetadataFactory . forProperty ( parent , property ) ) ;
public class WButtonExample { /** * Examples showing how to set a WButton as the default submit button for an input control . */ private void addDefaultSubmitButtonExample ( ) { } }
add ( new WHeading ( HeadingLevel . H3 , "Default submit button" ) ) ; add ( new ExplanatoryText ( "This example shows how to use an image as the only content of a WButton. " + "In addition this text field submits the entire screen using the image button to the right of the field." ) ) ; // We use WFieldLayout to lay o...
public class ASN1Dump { /** * dump a DER object as a formatted string with indentation * @ param obj the DERObject to be dumped out . */ static String _dumpAsString ( String indent , DERObject obj ) { } }
if ( obj instanceof ASN1Sequence ) { StringBuilder buf = new StringBuilder ( ) ; Enumeration e = ( ( ASN1Sequence ) obj ) . getObjects ( ) ; String tab = indent + TAB ; buf . append ( indent ) ; if ( obj instanceof BERConstructedSequence ) { buf . append ( "BER ConstructedSequence" ) ; } else if ( obj instanceof DERCon...
public class Component { /** * Evaluates the OGNL stack to find an Object value . * Function just like < code > findValue ( String ) < / code > except that if the given expression is * < tt > null < / tt / > a error is logged and a < code > RuntimeException < / code > is thrown constructed with * a messaged based...
if ( expr == null ) { throw fieldError ( field , errorMsg , null ) ; } else { Object value = null ; Exception problem = null ; try { value = findValue ( expr ) ; } catch ( Exception e ) { problem = e ; } if ( value == null ) { throw fieldError ( field , errorMsg , problem ) ; } return value ; }
public class SessionApi { /** * Activate channels * Activate the specified channels using the provided resources . If the channels are successfully activated , Workspace sends additional information about the state of active resources ( DNs , channels ) via events . The resources you provide are associated with the a...
ApiResponse < ApiSuccessResponse > resp = activateChannelsWithHttpInfo ( channelsData ) ; return resp . getData ( ) ;
public class FollowerRunnable { /** * sets up blobstore state for all current keys */ private void setupBlobstore ( ) throws Exception { } }
BlobStore blobStore = data . getBlobStore ( ) ; StormClusterState clusterState = data . getStormClusterState ( ) ; Set < String > localSetOfKeys = Sets . newHashSet ( blobStore . listKeys ( ) ) ; Set < String > allKeys = Sets . newHashSet ( clusterState . active_keys ( ) ) ; Set < String > localAvailableActiveKeys = Se...
public class ResourceGroovyMethods { /** * Converts this File to a { @ link groovy . lang . Writable } or delegates to default * { @ link DefaultGroovyMethods # asType ( java . lang . Object , java . lang . Class ) } . * @ param f a File * @ param c the desired class * @ return the converted object * @ since ...
if ( c == Writable . class ) { return ( T ) asWritable ( f ) ; } return DefaultGroovyMethods . asType ( ( Object ) f , c ) ;
public class DescriptionBuilder { /** * Returns a new { @ link PropertyBuilder } preconfigured with an existing property or a new one to add a new property . * Be sure to call { @ link # property ( com . dtolabs . rundeck . core . plugins . configuration . Property ) } to add the result of * the final call to { @ l...
final Property found = findProperty ( name ) ; if ( null != found ) { return PropertyBuilder . builder ( found ) ; } else { return PropertyBuilder . builder ( ) . name ( name ) ; }
public class CPAttachmentFileEntryLocalServiceBaseImpl { /** * Returns the cp attachment file entry with the matching external reference code and company . * @ param companyId the primary key of the company * @ param externalReferenceCode the cp attachment file entry ' s external reference code * @ return the mat...
return cpAttachmentFileEntryPersistence . fetchByC_ERC ( companyId , null ) ;
public class AccountManager { /** * Returns true if the server supports creating new accounts . Many servers require * that you not be currently authenticated when creating new accounts , so the safest * behavior is to only create new accounts before having logged in to a server . * @ return true if the server su...
// TODO : Replace this body with isSupported ( ) and possible deprecate this method . // Check if we already know that the server supports creating new accounts if ( accountCreationSupported ) { return true ; } // No information is known yet ( e . g . no stream feature was received from the server // indicating that it...
public class CsvOpenCSV { /** * - - - IMPLEMENTED PARSER METHOD - - - */ @ SuppressWarnings ( "resource" ) @ Override public Object parse ( String source ) throws Exception { } }
return new CSVReader ( new StringReader ( source ) , defaultSeparatorChar , defaultQuoteChar , defaultEscapeChar , defaultSkipLines , defaultStrictQuotes , defaultIgnoreLeadingWhiteSpace ) . readAll ( ) ;
public class RecoveryPointsInner { /** * Lists the backup copies for the backed up item . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; Recover...
return listNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < RecoveryPointResourceInner > > , Page < RecoveryPointResourceInner > > ( ) { @ Override public Page < RecoveryPointResourceInner > call ( ServiceResponse < Page < RecoveryPointResourceInner > > response ) { return resp...
public class HtmlUnitRegExpProxy { /** * { @ inheritDoc } */ @ Override public int find_split ( final Context cx , final Scriptable scope , final String target , final String separator , final Scriptable re , final int [ ] ip , final int [ ] matchlen , final boolean [ ] matched , final String [ ] [ ] parensp ) { } }
return wrapped_ . find_split ( cx , scope , target , separator , re , ip , matchlen , matched , parensp ) ;
public class RefList { /** * Gets the value of the addressOrAlternativesOrArray property . * This accessor method returns a reference to the live list , * not a snapshot . Therefore any modification you make to the * returned list will be present inside the JAXB object . * This is why there is not a < CODE > se...
if ( addressOrAlternativesOrArray == null ) { addressOrAlternativesOrArray = new ArrayList < Object > ( ) ; } return this . addressOrAlternativesOrArray ;
public class SettingsModule { /** * Common */ public boolean getBooleanValue ( String key , boolean defaultVal ) { } }
String sValue = readValue ( key ) ; boolean res = defaultVal ; if ( sValue != null ) { if ( "true" . equals ( sValue ) ) { res = true ; } else if ( "false" . equals ( sValue ) ) { res = false ; } } return res ;
public class ShardingRule { /** * Find binding table rule via logic table name . * @ param logicTableName logic table name * @ return binding table rule */ public Optional < BindingTableRule > findBindingTableRule ( final String logicTableName ) { } }
for ( BindingTableRule each : bindingTableRules ) { if ( each . hasLogicTable ( logicTableName ) ) { return Optional . of ( each ) ; } } return Optional . absent ( ) ;
public class CoronaJobTracker { /** * Executes actions that can be executed after asking commit permission * authority * @ param actions list of actions to execute * @ throws IOException */ private void dispatchCommitActions ( List < CommitTaskAction > commitActions ) throws IOException { } }
if ( ! commitActions . isEmpty ( ) ) { TaskAttemptID [ ] wasCommitting ; try { wasCommitting = commitPermissionClient . getAndSetCommitting ( commitActions ) ; } catch ( IOException e ) { LOG . error ( "Commit permission client is faulty - killing this JT" ) ; try { close ( false ) ; } catch ( InterruptedException e1 )...
public class ClearExpiredRecordsTask { /** * see { @ link # partitionLost } */ private boolean lostPartitionDetected ( ) { } }
int currentLostPartitionCount = lostPartitionCounter . get ( ) ; if ( currentLostPartitionCount == lastKnownLostPartitionCount ) { return false ; } lastKnownLostPartitionCount = currentLostPartitionCount ; return true ;
public class JobsClientImpl { /** * { @ inheritDoc } */ public List < Job > getJobsForHistory ( String historyId ) { } }
return get ( getWebResource ( ) . queryParam ( "history_id" , historyId ) , new TypeReference < List < Job > > ( ) { } ) ;
public class MessageFactory { /** * Creates a new < code > MessageFactory < / code > object that is an instance * of the default implementation ( SOAP 1.1 ) , * This method uses the following ordered lookup procedure to determine the MessageFactory implementation class to load : * < UL > * < LI > Use the javax ...
try { MessageFactory factory = ( MessageFactory ) FactoryFinder . find ( MESSAGE_FACTORY_PROPERTY ) ; if ( factory != null ) return factory ; return newInstance ( SOAPConstants . SOAP_1_1_PROTOCOL ) ; } catch ( Exception ex ) { throw new SOAPException ( "Unable to create message factory for SOAP: " + ex . getMessage ( ...