signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Error { /** * Thrown when the xml configuration of the clazz doesn ' t exist . * @ param clazz class to check */ public static void classNotConfigured ( Class < ? > clazz ) { } }
throw new MappingNotFoundException ( MSG . INSTANCE . message ( Constants . mappingNotFoundException1 , clazz . getSimpleName ( ) ) ) ;
public class Monitoring { /** * < pre > * Monitoring configurations for sending metrics to the consumer project . * There can be multiple consumer destinations . A monitored resouce type may * appear in multiple monitoring destinations if different aggregations are * needed for different sets of metrics associa...
return consumerDestinations_ ;
public class GetBasePathMappingsResult { /** * The current page of elements from this collection . * @ param items * The current page of elements from this collection . */ public void setItems ( java . util . Collection < BasePathMapping > items ) { } }
if ( items == null ) { this . items = null ; return ; } this . items = new java . util . ArrayList < BasePathMapping > ( items ) ;
public class OrderList { /** * Whether all individual orders are the same * @ return */ public boolean hasCommonOrder ( ) { } }
Order lastOrder = null ; for ( OrderEntry oe : list ) { if ( lastOrder == null ) lastOrder = oe . order ; else if ( lastOrder != oe . order ) return false ; } return true ;
public class CmsContainerPageElementPanel { /** * Adds the collector edit buttons . < p > * @ param editable the marker element for an editable list element */ private void addListCollectorEditorButtons ( Element editable ) { } }
CmsListCollectorEditor editor = new CmsListCollectorEditor ( editable , m_clientId ) ; add ( editor , editable . getParentElement ( ) ) ; if ( CmsDomUtil . hasDimension ( editable . getParentElement ( ) ) ) { editor . setParentHasDimensions ( true ) ; editor . setPosition ( CmsDomUtil . getEditablePosition ( editable )...
public class Never { /** * < p > If called outside a transaction context , managed bean method execution * must then continue outside a transaction context . < / p > * < p > If called inside a transaction context , a TransactionalException with * a nested InvalidTransactionException must be thrown . < / p > */ @ ...
if ( getUOWM ( ) . getUOWType ( ) == UOWSynchronizationRegistry . UOW_TYPE_GLOBAL_TRANSACTION ) { throw new TransactionalException ( "TxType.NEVER method called within a global tx" , new InvalidTransactionException ( ) ) ; } return runUnderUOWNoEnablement ( UOWSynchronizationRegistry . UOW_TYPE_LOCAL_TRANSACTION , true...
public class GoldenGrammarError { /** * getter for error - gets * @ generated */ public String getError ( ) { } }
if ( GoldenGrammarError_Type . featOkTst && ( ( GoldenGrammarError_Type ) jcasType ) . casFeat_error == null ) jcasType . jcas . throwFeatMissing ( "error" , "cogroo.uima.GoldenGrammarError" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( GoldenGrammarError_Type ) jcasType ) . casFeatCode_error ) ;
public class RecurlyClient { /** * Update Account * Updates an existing account . * @ param accountCode recurly account id * @ param account account object * @ return the updated account object on success , null otherwise */ public Account updateAccount ( final String accountCode , final Account account ) { } }
return doPUT ( Account . ACCOUNT_RESOURCE + "/" + accountCode , account , Account . class ) ;
public class Dispatcher { void dispatch ( ServletRequest servletRequest , ServletResponse servletResponse , int type ) throws ServletException , IOException { } }
HttpServletRequest httpServletRequest = ( HttpServletRequest ) servletRequest ; HttpServletResponse httpServletResponse = ( HttpServletResponse ) servletResponse ; HttpConnection httpConnection = _servletHandler . getHttpContext ( ) . getHttpConnection ( ) ; ServletHttpRequest servletHttpRequest = ( ServletHttpRequest ...
public class InstanceClient { /** * Sets an instance ' s scheduling options . * < p > Sample code : * < pre > < code > * try ( InstanceClient instanceClient = InstanceClient . create ( ) ) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName . of ( " [ PROJECT ] " , " [ ZONE ] " , " [ INSTANCE ] " ) ;...
SetSchedulingInstanceHttpRequest request = SetSchedulingInstanceHttpRequest . newBuilder ( ) . setInstance ( instance == null ? null : instance . toString ( ) ) . setSchedulingResource ( schedulingResource ) . build ( ) ; return setSchedulingInstance ( request ) ;
public class JDBC4PreparedStatement { /** * Executes the SQL statement in this PreparedStatement object , which may be any kind of SQL statement . */ @ Override public boolean execute ( ) throws SQLException { } }
checkClosed ( ) ; boolean result = this . execute ( this . Query . getExecutableQuery ( this . parameters ) ) ; this . parameters = this . Query . getParameterArray ( ) ; return result ;
public class Matrix4f { /** * / * ( non - Javadoc ) * @ see org . joml . Matrix4fc # transformDirection ( org . joml . Vector3fc , org . joml . Vector3f ) */ public Vector3f transformDirection ( Vector3fc v , Vector3f dest ) { } }
return transformDirection ( v . x ( ) , v . y ( ) , v . z ( ) , dest ) ;
public class RecordReferenceField { /** * Make the record that this field references . * Typically , you override this method to set the referenced class if it doesn ' t exist . * < p > < pre > * For Example : * return new RecordName ( screen ) ; * < / pre > * @ param recordOwner The recordowner . * @ ret...
if ( m_recordReference != null ) return m_recordReference ; // It already exists RecordOwner recordOwner = null ; if ( this . getRecord ( ) != null ) recordOwner = Record . findRecordOwner ( this . getRecord ( ) ) ; // This way the record has access to the correct environment . this . setReferenceRecord ( this . makeRe...
public class EditAutoKeeper { /** * 找到单个Channel , 用于编辑Channel信息界面加载信息 * @ param channelId * @ param context * @ throws WebxException */ public void execute ( @ Param ( "clusterId" ) Long clusterId , Context context , Navigator nav ) throws Exception { } }
AutoKeeperCluster autoKeeperCluster = autoKeeperClusterService . findAutoKeeperClusterById ( clusterId ) ; context . put ( "autoKeeperCluster" , autoKeeperCluster ) ;
public class MarshallableTypeHints { /** * Returns whether the hint on whether a particular type is marshallable or * not is available . This method can be used to avoid attempting to marshall * a type , if the hints for the type have already been calculated . * @ param type Marshallable type to check whether an ...
MarshallingType marshallingType = typeHints . get ( type ) ; return marshallingType != null && marshallingType . isMarshallable != null ;
public class AmazonECRClient { /** * Applies a repository policy on a specified repository to control access permissions . * @ param setRepositoryPolicyRequest * @ return Result of the SetRepositoryPolicy operation returned by the service . * @ throws ServerException * These errors are usually caused by a serve...
request = beforeClientExecution ( request ) ; return executeSetRepositoryPolicy ( request ) ;
public class GetMethodCachePlugin { /** * Check if request contains header with value * @ param request request * @ param headerName header name * @ param headerValue header value to check */ private boolean headerEq ( HttpRequestBase request , String headerName , String headerValue ) { } }
Header [ ] headers = request . getAllHeaders ( ) ; if ( headers != null ) { for ( Header h : headers ) { if ( headerName . equalsIgnoreCase ( h . getName ( ) ) && headerValue . equalsIgnoreCase ( h . getValue ( ) ) ) { return true ; } } } return false ;
public class JmsBytesMessageImpl { /** * ( non - Javadoc ) * @ see javax . jms . BytesMessage # getBodyLength ( ) */ @ Override public long getBodyLength ( ) throws JMSException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getBodyLength" ) ; long bLen ; // D175063 CTS requires a MessageNotReadableException . This is entirely // pointless , so I ' ll leave the rest of the code intact , and just add a // call to checkBodyReadable . Perha...
public class HashFunctions { /** * Based on an original suggestion on Robert Jenkin ' s part in 1997 and Thomas Wang 2007 updates . < p / > < h3 > Links < / h3 > * < a href = " http : / / www . concentric . net / ~ ttwang / tech / inthash . htm " > http : / / www . concentric . net / ~ ttwang / tech / inthash . htm <...
key = ( ~ key ) + ( key << 21 ) ; // key = ( key < < 21 ) - key - 1; key = key ^ ( key >>> 24 ) ; key = ( key + ( key << 3 ) ) + ( key << 8 ) ; // key * 265 key = key ^ ( key >>> 14 ) ; key = ( key + ( key << 2 ) ) + ( key << 4 ) ; // key * 21 key = key ^ ( key >>> 28 ) ; key = key + ( key << 31 ) ; return key ;
public class DestinationManager { /** * < p > This method is used to alter an MQLink that is localised on this ME . < / p > * @ param vld * @ param uuid * @ param ld * @ throws SINotPossibleInCurrentConfigurationException * @ throws SIResourceException * @ throws SIConnectionLostException * @ throws SIExc...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "alterMQLinkLocalization" , new Object [ ] { vld , mqld , ld } ) ; // Get the destination LinkTypeFilter filter = new LinkTypeFilter ( ) ; filter . MQLINK = Boolean . TRUE ; // includeInvisible ? // filter . VISIBLE = Boolea...
public class JsonLdProcessor { /** * Converts an RDF dataset to JSON - LD , using a specific instance of * { @ link RDFParser } . * @ param input * a serialized string of RDF in a format specified by the format * option or an RDF dataset to convert . * @ param options * the options to use : [ format ] the f...
final RDFDataset dataset = parser . parse ( input ) ; // convert from RDF final Object rval = new JsonLdApi ( options ) . fromRDF ( dataset ) ; // re - process using the generated context if outputForm is set if ( options . outputForm != null ) { if ( JsonLdConsts . EXPANDED . equals ( options . outputForm ) ) { return...
public class DefList { public void add ( Element term , Element def ) { } }
terms . addElement ( term ) ; defs . addElement ( def ) ;
public class FaceDetail { /** * Indicates the location of landmarks on the face . Default attribute . * @ param landmarks * Indicates the location of landmarks on the face . Default attribute . */ public void setLandmarks ( java . util . Collection < Landmark > landmarks ) { } }
if ( landmarks == null ) { this . landmarks = null ; return ; } this . landmarks = new java . util . ArrayList < Landmark > ( landmarks ) ;
public class Unpooled { /** * Creates a new buffer whose content is a copy of the specified * { @ code buffer } ' s current slice . The new buffer ' s { @ code readerIndex } * and { @ code writerIndex } are { @ code 0 } and { @ code buffer . remaining } * respectively . */ public static ByteBuf copiedBuffer ( Byt...
int length = buffer . remaining ( ) ; if ( length == 0 ) { return EMPTY_BUFFER ; } byte [ ] copy = PlatformDependent . allocateUninitializedArray ( length ) ; // Duplicate the buffer so we not adjust the position during our get operation . // See https : / / github . com / netty / netty / issues / 3896 ByteBuffer dupli...
public class JSONObject { /** * 格式化输出JSON字符串 * @ param indentFactor 每层缩进空格数 * @ return JSON字符串 * @ throws JSONException 包含非法数抛出此异常 */ @ Override public String toJSONString ( int indentFactor ) throws JSONException { } }
final StringWriter w = new StringWriter ( ) ; return this . write ( w , indentFactor , 0 ) . toString ( ) ;
public class CommonOps_DSCC { /** * Returns the value of the element with the largest value * @ param A ( Input ) Matrix . Not modified . * @ return scalar */ public static double elementMax ( DMatrixSparseCSC A ) { } }
if ( A . nz_length == 0 ) return 0 ; // if every element is assigned a value then the first element can be a max . // Otherwise zero needs to be considered double max = A . isFull ( ) ? A . nz_values [ 0 ] : 0 ; for ( int i = 0 ; i < A . nz_length ; i ++ ) { double val = A . nz_values [ i ] ; if ( val > max ) { max = v...
public class TLSEncryptionAdapter { /** * Gather all the frames that comprise a whole Volt Message * Returns the delta between the original message byte count and encrypted message byte count . */ private int addFramesForCompleteMessage ( ) { } }
boolean added = false ; EncryptFrame frame = null ; int delta = 0 ; while ( ! added && ( frame = m_encryptedFrames . poll ( ) ) != null ) { if ( ! frame . isLast ( ) ) { // TODO : Review - I don ' t think this synchronized ( m _ partialMessages ) is required . // This is the only method with synchronized ( m _ partialM...
public class RangeStringParser { /** * Parses the threshold . * @ param range * The threshold to be parsed * @ param tc * The configuration * @ throws RangeException */ public static void parse ( final String range , final RangeConfig tc ) throws RangeException { } }
if ( range == null ) { throw new RangeException ( "Range can't be null" ) ; } ROOT_STAGE . parse ( range , tc ) ; checkBoundaries ( tc ) ;
public class StoreFactory { /** * Creates a fixed - length { @ link krati . store . ArrayStore ArrayStore } with the default parameters below . * < pre > * batchSize : 10000 * numSyncBatches : 10 * segmentCompactFactor : 0.5 * < / pre > * @ param homeDir - the store home directory * @ param length - the s...
int batchSize = StoreParams . BATCH_SIZE_DEFAULT ; int numSyncBatches = StoreParams . NUM_SYNC_BATCHES_DEFAULT ; double segmentCompactFactor = StoreParams . SEGMENT_COMPACT_FACTOR_DEFAULT ; return createStaticArrayStore ( homeDir , length , batchSize , numSyncBatches , segmentFileSizeMB , segmentFactory , segmentCompac...
public class IOGroovyMethods { /** * Transforms the lines from a reader with a Closure and * write them to a writer . Both Reader and Writer are * closed after the operation . * @ param reader Lines of text to be transformed . Reader is closed afterwards . * @ param writer Where transformed lines are written . ...
BufferedReader br = new BufferedReader ( reader ) ; BufferedWriter bw = new BufferedWriter ( writer ) ; String line ; try { while ( ( line = br . readLine ( ) ) != null ) { Object o = closure . call ( line ) ; if ( o != null ) { bw . write ( o . toString ( ) ) ; bw . newLine ( ) ; } } bw . flush ( ) ; Writer temp2 = wr...
public class VariableResponseProvider { /** * Creates a response for a variable of type { @ link ValueType # FILE } . */ protected Response responseForFileVariable ( FileValue fileValue ) { } }
String type = fileValue . getMimeType ( ) != null ? fileValue . getMimeType ( ) : MediaType . APPLICATION_OCTET_STREAM ; if ( fileValue . getEncoding ( ) != null ) { type += "; charset=" + fileValue . getEncoding ( ) ; } Object value = fileValue . getValue ( ) == null ? "" : fileValue . getValue ( ) ; return Response ....
public class CreateWebhookRequest { /** * An array of arrays of < code > WebhookFilter < / code > objects used to determine which webhooks are triggered . At least * one < code > WebhookFilter < / code > in the array must specify < code > EVENT < / code > as its < code > type < / code > . * For a build to be trigge...
setFilterGroups ( filterGroups ) ; return this ;
public class Initiator { /** * Invokes a read operation for the session < code > targetName < / code > and store the read bytes in the buffer * < code > dst < / code > . Start reading at the logical block address and request < code > transferLength < / code > blocks . * @ param targetName The name of the session to...
try { multiThreadedRead ( targetName , dst , logicalBlockAddress , transferLength ) . get ( ) ; } catch ( final InterruptedException exc ) { throw new TaskExecutionException ( exc ) ; } catch ( final ExecutionException exc ) { throw new TaskExecutionException ( exc ) ; }
public class Parser { /** * Builds a parse tree from the given source string . * @ return an { @ link AstRoot } object representing the parsed program . If * the parse fails , { @ code null } will be returned . ( The parse failure will * result in a call to the { @ link ErrorReporter } from * { @ link CompilerE...
if ( parseFinished ) throw new IllegalStateException ( "parser reused" ) ; this . sourceURI = sourceURI ; if ( compilerEnv . isIdeMode ( ) ) { this . sourceChars = sourceString . toCharArray ( ) ; } this . ts = new TokenStream ( this , null , sourceString , lineno ) ; try { return parse ( ) ; } catch ( IOException iox ...
public class QueryParsers { /** * Get the parser for the supplied language . * @ param language the language in which the query is expressed ; must case - insensitively match one of the supported * { @ link # getLanguages ( ) languages } * @ return the query parser , or null if the supplied language is not suppor...
CheckArg . isNotNull ( language , "language" ) ; return parsers . get ( language . trim ( ) . toLowerCase ( ) ) ;
public class CharUtil { /** * belongs in number utils or charutil ? */ public long parseLong ( char [ ] arr , int start , int end ) { } }
long x = 0 ; boolean negative = arr [ start ] == '-' ; for ( int i = negative ? start + 1 : start ; i < end ; i ++ ) { // If constructing the largest negative number , this will overflow // to the largest negative number . This is OK since the negation of // the largest negative number is itself in two ' s complement ....
public class MDAGNode { /** * 重新设置转移状态函数的目标 * Reassigns the target node of one of this node ' s outgoing transitions . * @ param letter the char which labels the outgoing _ transition of interest * @ param oldTargetNode the MDAGNode that is currently the target of the _ transition of interest * @ param newTarge...
oldTargetNode . incomingTransitionCount -- ; newTargetNode . incomingTransitionCount ++ ; outgoingTransitionTreeMap . put ( letter , newTargetNode ) ;
public class CmsPublishList { /** * Gets the sub - resources of a list of folders which are missing from the publish list . < p > * @ param cms the current CMS context * @ param folders the folders which should be checked * @ return a list of missing sub resources * @ throws CmsException if something goes wrong...
List < CmsResource > result = new ArrayList < CmsResource > ( ) ; CmsObject rootCms = OpenCms . initCmsObject ( cms ) ; rootCms . getRequestContext ( ) . setSiteRoot ( "" ) ; for ( CmsResource folder : folders ) { List < CmsResource > subResources = rootCms . readResources ( folder . getRootPath ( ) , CmsResourceFilter...
public class AdjustableNumberGenerator { /** * Change the value that is returned by this generator . * @ param value The new value to return . */ public void setValue ( T value ) { } }
try { lock . writeLock ( ) . lock ( ) ; this . value = value ; } finally { lock . writeLock ( ) . unlock ( ) ; }
public class JavaDoubleMultiplicationBenchmark { /** * Compute C = A * B */ private void mmuli ( int n , double [ ] A , double [ ] B , double [ ] C ) { } }
for ( int i = 0 ; i < n * n ; i ++ ) { C [ i ] = 0 ; } for ( int j = 0 ; j < n ; j ++ ) { int jn = j * n ; for ( int k = 0 ; k < n ; k ++ ) { int kn = k * n ; double bkjn = B [ k + jn ] ; for ( int i = 0 ; i < n ; i ++ ) { C [ i + jn ] += A [ i + kn ] * bkjn ; } } }
public class ExtensionLoader { /** * 根据服务别名查找扩展类 * @ param alias 扩展别名 * @ return 扩展类对象 */ public ExtensionClass < T > getExtensionClass ( String alias ) { } }
return all == null ? null : all . get ( alias ) ;
public class Discovery { /** * Update an environment . * Updates an environment . The environment ' s * * name * * and * * description * * parameters can be changed . You must specify * a * * name * * for the environment . * @ param updateEnvironmentOptions the { @ link UpdateEnvironmentOptions } containing the o...
Validator . notNull ( updateEnvironmentOptions , "updateEnvironmentOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" } ; String [ ] pathParameters = { updateEnvironmentOptions . environmentId ( ) } ; RequestBuilder builder = RequestBuilder . put ( RequestBuilder . constructHttpUrl ( getEndPoint ...
public class Matrix3x2d { /** * Store this matrix as an equivalent 3x3 matrix in column - major order into the supplied { @ link DoubleBuffer } starting at the specified * absolute buffer position / index . * This method will not increment the position of the given DoubleBuffer . * @ param index * the absolute ...
MemUtil . INSTANCE . put3x3 ( this , index , buffer ) ; return buffer ;
public class Iteration { /** * Called internally to actually process the Iteration . Loops over the frames to iterate , and performs their . perform ( . . . ) or . otherwise ( . . . ) * parts . */ public void perform ( GraphRewrite event , EvaluationContext context ) { } }
Variables variables = Variables . instance ( event ) ; Iterable < ? extends WindupVertexFrame > frames = getSelectionManager ( ) . getFrames ( event , context ) ; boolean hasCommitOperation = OperationUtil . hasCommitOperation ( operationPerform ) || OperationUtil . hasCommitOperation ( operationOtherwise ) ; boolean h...
public class CadmiumCli { /** * The main entry point to Cadmium cli . * @ param args */ public static void main ( String [ ] args ) { } }
try { jCommander = new JCommander ( ) ; jCommander . setProgramName ( "cadmium" ) ; HelpCommand helpCommand = new HelpCommand ( ) ; jCommander . addCommand ( "help" , helpCommand ) ; Map < String , CliCommand > commands = wireCommands ( jCommander ) ; try { jCommander . parse ( args ) ; } catch ( ParameterException pe ...
public class Coercions { /** * Coerces the given value to the specified class . */ public static Object coerce ( Object pValue , Class pClass , Logger pLogger ) throws ELException { } }
if ( pClass == String . class ) { return coerceToString ( pValue , pLogger ) ; } else if ( isPrimitiveNumberClass ( pClass ) ) { return coerceToPrimitiveNumber ( pValue , pClass , pLogger ) ; } else if ( pClass == Character . class || pClass == Character . TYPE ) { return coerceToCharacter ( pValue , pLogger ) ; } else...
public class AnnotationClassRef { /** * / * ( non - Javadoc ) * @ see io . github . classgraph . ScanResultObject # setScanResult ( io . github . classgraph . ScanResult ) */ @ Override void setScanResult ( final ScanResult scanResult ) { } }
super . setScanResult ( scanResult ) ; if ( typeSignature != null ) { typeSignature . setScanResult ( scanResult ) ; }
public class TransactionTopologyBuilder { /** * * * * * * build spout declarer * * * * * */ @ Override public SpoutDeclarer setSpout ( String id , IRichSpout spout , Number parallelismHint ) throws IllegalArgumentException { } }
return setSpout ( id , spout , parallelismHint , true ) ;
public class GVRAndroidResource { /** * Save the stream position , for later use with { @ link # reset ( ) } . * All { @ link GVRAndroidResource } streams support * { @ link InputStream # mark ( int ) mark ( ) } and { @ link InputStream # reset ( ) * reset ( ) . } Calling { @ link # mark ( ) } right after constru...
if ( streamState == StreamStates . OPEN ) { if ( stream . markSupported ( ) ) { stream . mark ( Integer . MAX_VALUE ) ; } else { // In case a inputStream ( e . g . , fileInputStream ) doesn ' t support // mark , throw a exception throw new IOException ( "Input stream doesn't support mark" ) ; } }
public class LeaderAppender { /** * Handles an append failure . */ protected void handleAppendResponseFailure ( MemberState member , AppendRequest request , Throwable error ) { } }
// Trigger commit futures if necessary . updateHeartbeatTime ( member , error ) ; super . handleAppendResponseFailure ( member , request , error ) ;
public class DetectModerationLabelsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DetectModerationLabelsRequest detectModerationLabelsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( detectModerationLabelsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( detectModerationLabelsRequest . getImage ( ) , IMAGE_BINDING ) ; protocolMarshaller . marshall ( detectModerationLabelsRequest . getMinConfidence ( ) , MIN...
public class Validate { /** * < p > Validate that the specified argument object fall between the two * exclusive values specified ; otherwise , throws an exception . < / p > * < pre > Validate . exclusiveBetween ( 0 , 2 , 1 ) ; < / pre > * @ param < T > the type of the argument object * @ param start the exclus...
// TODO when breaking BC , consider returning value if ( value . compareTo ( start ) <= 0 || value . compareTo ( end ) >= 0 ) { throw new IllegalArgumentException ( StringUtils . simpleFormat ( DEFAULT_EXCLUSIVE_BETWEEN_EX_MESSAGE , value , start , end ) ) ; }
public class Popups { /** * Shows the supplied popup panel near the specified target . */ public static < T extends PopupPanel > T showAbove ( T popup , Widget target ) { } }
return show ( popup , Position . ABOVE , target ) ;
public class RegxCriteria { /** * { @ inheritDoc } */ @ Override public boolean isSelected ( final Comparable < E > value , final boolean caseSensitive ) { } }
if ( pattern == null ) if ( caseSensitive ) this . pattern = Pattern . compile ( patternParm ) ; else this . pattern = Pattern . compile ( patternParm , Pattern . CASE_INSENSITIVE ) ; final Matcher m = pattern . matcher ( value . toString ( ) ) ; return m . matches ( ) ;
public class AsynchronousRequest { /** * For more info on specializations API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 2 / specializations " > here < / a > < br / > * Give user the access to { @ link Callback # onResponse ( Call , Response ) } and { @ link Callback # onFailure ( Call , Throw...
isParamValid ( new ParamChecker ( ids ) ) ; gw2API . getSpecializationInfo ( processIds ( ids ) , GuildWars2 . lang . getValue ( ) ) . enqueue ( callback ) ;
public class ListELResolver { /** * If the base object is a list , returns the value at the given index . * The index is specified by the < code > property < / code > argument , and * coerced into an integer . If the coercion could not be performed , * an < code > IllegalArgumentException < / code > is thrown . I...
if ( context == null ) { throw new NullPointerException ( ) ; } if ( base != null && base instanceof List ) { context . setPropertyResolved ( base , property ) ; List list = ( List ) base ; int index = toInteger ( property ) ; if ( index < 0 || index >= list . size ( ) ) { return null ; } return list . get ( index ) ; ...
public class KnowledgeBuilderImpl { /** * Load a rule package from DRL source . * @ throws DroolsParserException * @ throws java . io . IOException */ public void addPackageFromDrl ( final Reader reader ) throws DroolsParserException , IOException { } }
addPackageFromDrl ( reader , new ReaderResource ( reader , ResourceType . DRL ) ) ;
public class AbstractMapper { /** * / * ( non - Javadoc ) * @ see com . abubusoft . kripton . BinderMapper # parseCollection ( com . abubusoft . kripton . BinderContext , com . abubusoft . kripton . persistence . ParserWrapper , java . util . Collection ) */ @ Override public < L extends Collection < E > > L parseCol...
switch ( context . getSupportedFormat ( ) ) { case XML : { throw ( new KriptonRuntimeException ( context . getSupportedFormat ( ) + " context does not support direct collection persistance" ) ) ; } default : { JacksonWrapperParser wrapperParser = ( JacksonWrapperParser ) parserWrapper ; JsonParser parser = wrapperParse...
public class RemovePreferenceHeaderDialogBuilder { /** * Initializes the dialog ' s buttons . */ private void initializeButtons ( ) { } }
setPositiveButton ( android . R . string . ok , createRemovePreferenceHeaderClickListener ( ) ) ; setNegativeButton ( android . R . string . cancel , null ) ;
public class PropertiesReader { /** * Reads a collection of properties based on a prefix . * @ param prefix The prefix for which to read properties . * @ param factory The factory to call for each property name in the collection . * @ param < T > The collection value type . * @ return The collection . */ public...
Collection < T > collection = new ArrayList < > ( ) ; for ( String property : properties . stringPropertyNames ( ) ) { if ( property . startsWith ( prefix + "." ) ) { collection . add ( factory . apply ( property ) ) ; } } return collection ;
public class ReadaheadPool { /** * Submit a request to readahead on the given file descriptor . * @ param identifier a textual identifier used in error messages , etc . * @ param fd the file descriptor to readahead * @ param off the offset at which to start the readahead * @ param len the number of bytes to rea...
ReadaheadRequestImpl req = new ReadaheadRequestImpl ( identifier , fd , off , len ) ; pool . execute ( req ) ; if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( "submit readahead: " + req ) ; } return req ;
public class ComponentMaximiserMouseListener { /** * Convenience method that programmatically triggers the ( un ) maximisation logic . * If a component is already maximised it ' s unmaximised , otherwise it is maximised the given { @ code component } . This is the * same logic that ' s executed when a component is ...
if ( componentMaximiser == null ) { return ; } if ( componentMaximiser . isComponentMaximised ( ) ) { componentMaximiser . unmaximiseComponent ( ) ; } else if ( confirmMaximisation ( ) ) { componentMaximiser . maximiseComponent ( component ) ; }
public class SystemStatus { /** * Load average in the last 1 - minute , 5 - minute , and 15 - minute periods . For more information , see < a href = * " https : / / docs . aws . amazon . com / elasticbeanstalk / latest / dg / health - enhanced - metrics . html # health - enhanced - metrics - os " * > Operating Syst...
if ( loadAverage == null ) { loadAverage = new com . amazonaws . internal . SdkInternalList < Double > ( ) ; } return loadAverage ;
public class ParseDuration { /** * { @ inheritDoc } * @ throws SuperCsvCellProcessorException * if value is null or is not a String */ public Object execute ( final Object value , final CsvContext context ) { } }
validateInputNotNull ( value , context ) ; if ( ! ( value instanceof String ) ) { throw new SuperCsvCellProcessorException ( String . class , value , context , this ) ; } final Duration result ; try { result = Duration . parse ( ( String ) value ) ; } catch ( IllegalArgumentException e ) { throw new SuperCsvCellProcess...
public class SelfRegisteringRemote { /** * Adding the browser described by the capability , automatically finding out what platform the * node is launched from * @ param cap describing the browser * @ param instances number of times this browser can be started on the node . */ public void addBrowser ( DesiredCapa...
String s = cap . getBrowserName ( ) ; if ( s == null || "" . equals ( s ) ) { throw new InvalidParameterException ( cap + " does seems to be a valid browser." ) ; } if ( cap . getPlatform ( ) == null ) { cap . setPlatform ( Platform . getCurrent ( ) ) ; } cap . setCapability ( RegistrationRequest . MAX_INSTANCES , inst...
public class CommerceOrderPersistenceImpl { /** * Removes all the commerce orders where userId = & # 63 ; from the database . * @ param userId the user ID */ @ Override public void removeByUserId ( long userId ) { } }
for ( CommerceOrder commerceOrder : findByUserId ( userId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( commerceOrder ) ; }
public class RestClientOptions { /** * Set global headers which will be appended to every HTTP request . * The headers defined per request will override this headers . * @ param headers The headers to add * @ return a reference to this so multiple method calls can be chained together */ public RestClientOptions p...
for ( Map . Entry < String , String > header : headers ) { globalHeaders . add ( header . getKey ( ) , header . getValue ( ) ) ; } return this ;
public class Model { /** * Sets the value for the threshold of the gauge * @ param THRESHOLD */ public void setThreshold ( final double THRESHOLD ) { } }
if ( Double . compare ( THRESHOLD , minValue ) >= 0 && Double . compare ( THRESHOLD , maxValue ) <= 0 ) { threshold = THRESHOLD ; } else { if ( THRESHOLD < niceMinValue ) { threshold = niceMinValue ; } if ( THRESHOLD > niceMaxValue ) { threshold = niceMaxValue ; } } fireStateChanged ( ) ;
public class PersistenceHandler { /** * ( non - Javadoc ) * @ see io . ddf . content . IHandlePersistence # copy ( java . lang . String , java . lang . String , java . lang . String , * java . lang . String , boolean ) */ @ Override public void duplicate ( String fromNamespace , String fromName , String toNamespace...
IPersistible from = this . load ( fromNamespace , fromName ) ; if ( from instanceof DDF ) { DDF to = ( DDF ) from ; // to . setNamespace ( toNamespace ) ; to . getManager ( ) . setDDFName ( to , toName ) ; to . persist ( ) ; } else { throw new DDFException ( "Can only duplicate DDFs" ) ; }
public class VersionManager { /** * Request version information from a given JID . * @ param jid * @ return the version information or { @ code null } if not supported by JID * @ throws NoResponseException * @ throws XMPPErrorException * @ throws NotConnectedException * @ throws InterruptedException */ publ...
if ( ! isSupported ( jid ) ) { return null ; } return connection ( ) . createStanzaCollectorAndSend ( new Version ( jid ) ) . nextResultOrThrow ( ) ;
public class HintedHandoff { /** * A callback that handles requestComplete event from NIO selector manager * Will try any possible nodes and pass itself as callback util all nodes * are exhausted * @ param slopKey * @ param slopVersioned * @ param nodesToTry List of nodes to try to contact . Will become short...
Node nodeToHostHint = null ; boolean foundNode = false ; while ( nodesToTry . size ( ) > 0 ) { nodeToHostHint = nodesToTry . remove ( 0 ) ; if ( ! failedNodes . contains ( nodeToHostHint ) && failureDetector . isAvailable ( nodeToHostHint ) ) { foundNode = true ; break ; } } if ( ! foundNode ) { Slop slop = slopSeriali...
public class UserScreenRecord { /** * Add this field in the Record ' s field sequence . */ public BaseField setupField ( int iFieldSeq ) { } }
BaseField field = null ; if ( iFieldSeq == 0 ) field = new StringField ( this , NAME_SORT , 10 , null , null ) ; if ( iFieldSeq == 1 ) field = new UserGroupFilter ( this , USER_GROUP_ID , Constants . DEFAULT_FIELD_LENGTH , null , null ) ; if ( iFieldSeq == 2 ) field = new StringField ( this , HEADER_TYPE , 30 , null , ...
public class FileUtil { /** * Change the permissions on a filename . * @ param filename the name of the file to change * @ param perm the permission string * @ return the exit code from the command * @ throws IOException * @ throws InterruptedException */ public static int chmod ( String filename , String per...
return chmod ( filename , perm , false ) ;
public class OjbTagsHandler { /** * Processes the template if the property value of the current object on the specified level equals the given value . * @ param template The template * @ param attributes The attributes of the tag * @ exception XDocletException If an error occurs * @ doc . tag type = " block " ...
String value = getPropertyValue ( attributes . getProperty ( ATTRIBUTE_LEVEL ) , attributes . getProperty ( ATTRIBUTE_NAME ) ) ; String expected = attributes . getProperty ( ATTRIBUTE_VALUE ) ; if ( value == null ) { value = attributes . getProperty ( ATTRIBUTE_DEFAULT ) ; } if ( expected . equals ( value ) ) { generat...
public class SnapshotCodecProvider { /** * Retrieve the current snapshot codec , that is , the codec with the highest known version . * @ return the current codec * @ throws java . lang . IllegalStateException if no codecs are registered */ private SnapshotCodec getCurrentCodec ( ) { } }
if ( codecs . isEmpty ( ) ) { throw new IllegalStateException ( String . format ( "No codecs are registered." ) ) ; } return codecs . get ( codecs . lastKey ( ) ) ;
public class DashboardServiceImpl { /** * Get all the dashboards that have the collector items * @ param collectorItems collector items * @ param collectorType type of the collector * @ return a list of dashboards */ @ Override public List < Dashboard > getDashboardsByCollectorItems ( Set < CollectorItem > collec...
if ( org . apache . commons . collections4 . CollectionUtils . isEmpty ( collectorItems ) ) { return new ArrayList < > ( ) ; } List < ObjectId > collectorItemIds = collectorItems . stream ( ) . map ( BaseModel :: getId ) . collect ( Collectors . toList ( ) ) ; // Find the components that have these collector items List...
public class CommerceTaxFixedRatePersistenceImpl { /** * Clears the cache for all commerce tax fixed rates . * The { @ link EntityCache } and { @ link FinderCache } are both cleared by this method . */ @ Override public void clearCache ( ) { } }
entityCache . clearCache ( CommerceTaxFixedRateImpl . class ) ; finderCache . clearCache ( FINDER_CLASS_NAME_ENTITY ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITH_PAGINATION ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION ) ;
public class XMLSerializer { /** * { @ inheritDoc } */ @ Override protected void emitEndDocument ( ) { } }
try { if ( mSerializeRest ) { write ( "</rest:item></rest:sequence>" ) ; } mOut . flush ( ) ; } catch ( final IOException exc ) { exc . printStackTrace ( ) ; }
public class ExtendedBitOutput { public static int writeAscii ( final BitOutput bitOutput , final int lengthSize , final String value ) throws IOException { } }
return writeBytes ( bitOutput , lengthSize , true , 7 , value . getBytes ( "ASCII" ) ) ;
public class Docket { /** * Directly substitutes a model class with the supplied substitute * e . g * < code > directModelSubstitute ( LocalDate . class , Date . class ) < / code > * would substitute LocalDate with Date * @ param clazz class to substitute * @ param with the class which substitutes ' clazz ' ...
this . ruleBuilders . add ( newSubstitutionFunction ( clazz , with ) ) ; return this ;
public class Logger { /** * Logs message log level has been set at least to { @ link LogLevel # ERROR } . * @ param msg Message to be logged */ public void e ( final String msg ) { } }
logMgr . log ( tag , LogLevelConst . ERROR , msg , null ) ;
public class DefaultVOMSTrustStore { /** * Loads all the certificates in the local directory . Only files with the * extension matching the { @ link # CERTIFICATE _ FILENAME _ PATTERN } are * considered . * @ param directory */ private void loadCertificatesFromDirectory ( File directory ) { } }
directorySanityChecks ( directory ) ; synchronized ( listenerLock ) { listener . notifyCertficateLookupEvent ( directory . getAbsolutePath ( ) ) ; } File [ ] certFiles = directory . listFiles ( new FilenameFilter ( ) { public boolean accept ( File dir , String name ) { return name . endsWith ( CERTIFICATE_FILENAME_SUFF...
public class Timestamp { /** * Applies the local time zone offset from UTC to the applicable time field * values . Depending on the local time zone offset , adjustments * ( i . e . rollover ) will be made to the Year , Day , Hour , Minute time field * values . * @ param offset the local offset , in minutes from...
if ( offset == 0 ) return ; if ( offset < - 24 * 60 || offset > 24 * 60 ) { throw new IllegalArgumentException ( "bad offset " + offset ) ; } // To convert _ to _ UTC you must SUBTRACT the local offset offset = - offset ; int hour_offset = offset / 60 ; int min_offset = offset - ( hour_offset * 60 ) ; if ( offset < 0 )...
public class PTD1Impl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case AfplibPackage . PTD1__XPBASE : return getXPBASE ( ) ; case AfplibPackage . PTD1__YPBASE : return getYPBASE ( ) ; case AfplibPackage . PTD1__XPUNITVL : return getXPUNITVL ( ) ; case AfplibPackage . PTD1__YPUNITVL : return getYPUNITVL ( ) ; case AfplibPackage . PTD1__XPEXTENT : return getXPEXT...
public class SQLUtils { /** * Update table rows * @ param connection * connection * @ param table * table name * @ param values * content values * @ param whereClause * where clause * @ param whereArgs * where arguments * @ return updated count */ public static int update ( Connection connection ,...
StringBuilder update = new StringBuilder ( ) ; update . append ( "update " ) . append ( CoreSQLUtils . quoteWrap ( table ) ) . append ( " set " ) ; int setValuesSize = values . size ( ) ; int argsSize = ( whereArgs == null ) ? setValuesSize : ( setValuesSize + whereArgs . length ) ; Object [ ] args = new Object [ argsS...
public class UpdateRunner { /** * Run the processing queue now . This should usually be only invoked by the * UpdateSynchronizer */ public void runQueue ( ) { } }
synchronized ( sync ) { while ( ! queue . isEmpty ( ) ) { Runnable r = queue . poll ( ) ; if ( r != null ) { try { r . run ( ) ; } catch ( Exception e ) { // Alternatively , we could allow the specification of exception // handlers for each runnable in the API . For now we ' ll just log . // TODO : handle exceptions he...
public class ConvertKit { /** * string转inputStream按编码 * @ param string 字符串 * @ param charsetName 编码格式 * @ return 输入流 */ public static InputStream string2InputStream ( final String string , final String charsetName ) { } }
if ( string == null || isSpace ( charsetName ) ) return null ; try { return new ByteArrayInputStream ( string . getBytes ( charsetName ) ) ; } catch ( UnsupportedEncodingException e ) { e . printStackTrace ( ) ; return null ; }
public class SubscriptionRegistrar { /** * Method isKnownNonSelectorExpression * Checks whether a consumer without a selector has already been registered on the * specified topicexpression * @ param topicExpression * @ param isWildcarded * @ return */ public boolean isKnownNonSelectorExpression ( String topic...
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "isKnownNonSelectorExpression" , new Object [ ] { topicExpression , new Boolean ( isWildcarded ) } ) ; boolean isCategorised = false ; // No Selector expression if ( isWildcarded ) { // No selector and wildcarded isCategorised = _wildcardNonSelectorSubs . containsKey ...
public class Empty { /** * { @ inheritDoc } */ public ByteCodeElement . Token . TokenList < ParameterDescription . Token > asTokenList ( ElementMatcher < ? super TypeDescription > matcher ) { } }
return new ByteCodeElement . Token . TokenList < ParameterDescription . Token > ( ) ;
public class ViewPagerEx { /** * You can call this function yourself to have the scroll view perform * scrolling from a key event , just as if the event had been dispatched to * it by the view hierarchy . * @ param event The key event to execute . * @ return Return true if the event was handled , else false . *...
boolean handled = false ; if ( event . getAction ( ) == KeyEvent . ACTION_DOWN ) { switch ( event . getKeyCode ( ) ) { case KeyEvent . KEYCODE_DPAD_LEFT : handled = arrowScroll ( FOCUS_LEFT ) ; break ; case KeyEvent . KEYCODE_DPAD_RIGHT : handled = arrowScroll ( FOCUS_RIGHT ) ; break ; case KeyEvent . KEYCODE_TAB : if ...
public class Cnf { /** * Return refactored conjunction formed by removing superfluous terms . */ public static IConjunct refactor ( IConjunct conjunct ) { } }
// Is there a single assertion term ? Iterator < IDisjunct > disjuncts = conjunct . getDisjuncts ( ) ; IAssertion assertion = null ; while ( disjuncts . hasNext ( ) && ( assertion = toAssertion ( disjuncts . next ( ) ) ) == null ) ; return assertion == null // No , return original conjunction ? conjunct // Yes , return...
public class ProcessInitiator { /** * Starts RTS process . * @ throws IOException */ public void startRTS ( ) throws IOException { } }
List < HubDataSource > dataSources = hubDataStore . getHubDataSources ( ) ; List < String > com = Lists . newArrayList ( ) ; com . add ( getHostPort ( hubDataStore . getHubAddress ( ) ) ) ; com . add ( hubDataStore . getInstanceName ( ) ) ; for ( HubDataSource source : dataSources ) { com . add ( source . getName ( ) )...
public class IOUtils { /** * write file * @ param file the file to be opened for writing . * @ param stream the input stream * @ param append if < code > true < / code > , then bytes will be written to the end of the file rather than the beginning * @ return return true * @ throws IOException if an error occu...
OutputStream o = null ; try { makeDirs ( file . getAbsolutePath ( ) ) ; o = new FileOutputStream ( file , append ) ; byte data [ ] = new byte [ 1024 ] ; int length = - 1 ; while ( ( length = stream . read ( data ) ) != - 1 ) { o . write ( data , 0 , length ) ; } o . flush ( ) ; return true ; } finally { closeQuietly ( ...
public class JvmAnyTypeReferenceImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case TypesPackage . JVM_ANY_TYPE_REFERENCE__TYPE : if ( resolve ) return getType ( ) ; return basicGetType ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
public class Functions { /** * Increases the opacity of the given color by the given amount . * @ param generator the surrounding generator * @ param input the function call to evaluate * @ return the result of the evaluation */ public static Expression opacify ( Generator generator , FunctionCall input ) { } }
Color color = input . getExpectedColorParam ( 0 ) ; float amount = input . getExpectedFloatParam ( 1 ) ; return new Color ( color . getR ( ) , color . getG ( ) , color . getB ( ) , color . getA ( ) + amount ) ;
public class TypeReferences { /** * / * @ NotNull */ public JvmTypeReference getTypeForName ( Class < ? > clazz , Notifier context , JvmTypeReference ... params ) { } }
if ( clazz == null ) throw new NullPointerException ( "clazz" ) ; JvmType declaredType = findDeclaredType ( clazz , context ) ; if ( declaredType == null ) return getUnknownTypeReference ( clazz . getName ( ) ) ; JvmParameterizedTypeReference result = createTypeRef ( declaredType , params ) ; return result ;
public class WRadioButton { /** * This method will only process the request if the value for the group matches the button ' s value . * @ param request the request being processed . */ @ Override public void handleRequest ( final Request request ) { } }
// Protect against client - side tampering of disabled / read - only fields . if ( isDisabled ( ) || isReadOnly ( ) ) { return ; } RadioButtonGroup currentGroup = getGroup ( ) ; // Check if the group is not on the request ( do nothing ) if ( ! currentGroup . isPresent ( request ) ) { return ; } // Check if the group ha...
public class ListUserPoolsResult { /** * The user pools from the response to list users . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setUserPools ( java . util . Collection ) } or { @ link # withUserPools ( java . util . Collection ) } if you want to *...
if ( this . userPools == null ) { setUserPools ( new java . util . ArrayList < UserPoolDescriptionType > ( userPools . length ) ) ; } for ( UserPoolDescriptionType ele : userPools ) { this . userPools . add ( ele ) ; } return this ;
public class Tensor { /** * Returns an integer array of the same length as dims that matches the configIx ' th configuration * if enumerated configurations in order such that the leftmost dimension changes slowest */ public static int [ ] unravelIndex ( int configIx , int ... dims ) { } }
int numConfigs = IntArrays . prod ( dims ) ; assert configIx < numConfigs ; int [ ] strides = getStrides ( dims ) ; return unravelIndexFromStrides ( configIx , strides ) ;
public class RuleDefinitionFileConstant { /** * Get SQL statement rule definition file name . * @ param rootDir root dir * @ param databaseType database type * @ return SQL statement rule definition file name */ public static String getSQLStatementRuleDefinitionFileName ( final String rootDir , final DatabaseType...
return Joiner . on ( '/' ) . join ( rootDir , databaseType . name ( ) . toLowerCase ( ) , SQL_STATEMENT_RULE_DEFINITION_FILE_NAME ) ;