signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CmsCroppingParamBean { /** * Returns the resulting image ratio . < p > * @ return the image ratio */ public double getRatio ( ) { } }
double ratio = 1 ; if ( ( getTargetWidth ( ) == - 1 ) || ( getTargetHeight ( ) == - 1 ) ) { ratio = ( double ) getOrgWidth ( ) / getOrgHeight ( ) ; } else { ratio = ( double ) getTargetWidth ( ) / getTargetHeight ( ) ; } return ratio ;
public class ServiceManagerSparql { /** * Obtains the list of input URIs for a given Operation * @ param operationUri the operation URI * @ return a List of URIs with the inputs of the operation . If no input is necessary the List should be empty NOT null . */ @ Override public Set < URI > listInputs ( URI operatio...
if ( operationUri == null || ! operationUri . isAbsolute ( ) ) { log . warn ( "The Operation URI is either absent or relative. Provide an absolute URI" ) ; return ImmutableSet . of ( ) ; } URI graphUri ; try { graphUri = getGraphUriForElement ( operationUri ) ; } catch ( URISyntaxException e ) { log . warn ( "The names...
public class SecurityDelegating { /** * 认证 * @ param name * @ param password */ public static BaseUserInfo doAuthentication ( String name , String password ) { } }
BaseUserInfo userInfo = getInstance ( ) . decisionProvider . validateUser ( name , password ) ; UserSession session = getCurrentSession ( false ) ; session . update ( userInfo , getInstance ( ) . decisionProvider . sessionExpireIn ( ) ) ; if ( getInstance ( ) . decisionProvider . multiPointEnable ( ) ) { UserSession ot...
public class WaitMessageDialog { /** * This method initializes this */ private void initialize ( ) { } }
this . setCursor ( new java . awt . Cursor ( java . awt . Cursor . WAIT_CURSOR ) ) ; this . setContentPane ( getJPanel ( ) ) ; if ( Model . getSingleton ( ) . getOptionsParam ( ) . getViewParam ( ) . getWmUiHandlingOption ( ) == 0 ) { this . setSize ( 282 , 118 ) ; } this . setDefaultCloseOperation ( javax . swing . Wi...
public class Stream { /** * Zip together the " a " , " b " and " c " iterators until all of them runs out of values . * Each triple of values is combined into a single value using the supplied zipFunction function . * @ param a * @ param b * @ param c * @ param valueForNoneA value to fill if " a " runs out of...
return zip ( ShortIteratorEx . of ( a ) , ShortIteratorEx . of ( b ) , ShortIteratorEx . of ( c ) , valueForNoneA , valueForNoneB , valueForNoneC , zipFunction ) ;
public class SimpleLSResourceResolver { /** * Internal resource resolving * @ param sType * The type of the resource being resolved . For XML [ * < a href = ' http : / / www . w3 . org / TR / 2004 / REC - xml - 20040204 ' > XML 1.0 < / a > ] * resources ( i . e . entities ) , applications must use the value < c...
if ( DEBUG_RESOLVE ) if ( LOGGER . isInfoEnabled ( ) ) LOGGER . info ( "internalResolveResource (" + sType + ", " + sNamespaceURI + ", " + sPublicId + ", " + sSystemId + ", " + sBaseURI + ")" ) ; return DefaultResourceResolver . getResolvedResource ( sSystemId , sBaseURI , getClassLoader ( ) ) ;
public class Condition { /** * 获取属性的真实值 * @ param cls * @ param fieldName * @ param strValue * @ return */ private static Object getFieldValue ( Class < ? > cls , String fieldName , String strValue ) { } }
try { Class < ? > type = Reflections . getDeclaredField ( cls , fieldName ) . getType ( ) ; // 是数字类型 if ( Number . class . isAssignableFrom ( type ) ) { return type . getMethod ( "valueOf" , String . class ) . invoke ( null , strValue ) ; } // 字符类型 if ( Character . class . isAssignableFrom ( type ) ) { return strValue ...
public class ZWaveCommandClass { /** * Gets an instance of the right command class . * Returns null if the command class is not found . * @ param i the code to instantiate * @ param node the node this instance commands . * @ param controller the controller to send messages to . * @ return the ZWaveCommandClas...
return ZWaveCommandClass . getInstance ( i , node , controller , null ) ;
public class MustacheMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Mustache mustache , ProtocolMarshaller protocolMarshaller ) { } }
if ( mustache == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( mustache . getValue ( ) , VALUE_BINDING ) ; protocolMarshaller . marshall ( mustache . getConfidence ( ) , CONFIDENCE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientE...
public class BagObject { /** * Add an object to a BagArray stored at the requested key . The key may be a simple name , or it may be a path * ( with keys separated by " / " ) to create a hierarchical " bag - of - bags " that is indexed * recursively . If the key does not already exist a non - null value will be sto...
// separate the key into path components , the " local " key value is the first component , // so use that to conduct the search . If there is an element there , we want to get it , // otherwise we want to create it . String [ ] path = Key . split ( key ) ; Pair pair = getOrAddPair ( path [ 0 ] ) ; if ( path . length =...
public class GetUserProfile { /** * Authenticate the given user . If you are distributing an installed application , this method * should exist on your server so that the client ID and secret are not shared with the end * user . */ private static Credential authenticate ( String userId , SessionConfiguration config...
OAuth2Credentials oAuth2Credentials = createOAuth2Credentials ( config ) ; // First try to load an existing Credential . If that credential is null , authenticate the user . Credential credential = oAuth2Credentials . loadCredential ( userId ) ; if ( credential == null || credential . getAccessToken ( ) == null ) { // ...
public class OTAUpdateSummaryMarshaller { /** * Marshall the given parameter object . */ public void marshall ( OTAUpdateSummary oTAUpdateSummary , ProtocolMarshaller protocolMarshaller ) { } }
if ( oTAUpdateSummary == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( oTAUpdateSummary . getOtaUpdateId ( ) , OTAUPDATEID_BINDING ) ; protocolMarshaller . marshall ( oTAUpdateSummary . getOtaUpdateArn ( ) , OTAUPDATEARN_BINDING ) ; protoc...
public class RTFDocsSwingDisplayer { /** * * * * * * READING THE Siva FILE * * * * * */ / * / public String readFile ( String fileName , String jarName ) { } }
File file = null ; BufferedReader reader = null ; InputStream inputStream = null ; StringBuilder builder = new StringBuilder ( ) ; try { file = new File ( fileName ) ; // When we run this program from Eclipse , it doesnt need the Code // described below . // But when it is being run as a JAR File , then we cannot speci...
public class TypeQualifierResolver { /** * Resolve an annotation into AnnotationValues representing any type * qualifier ( s ) the annotation resolves to . Detects annotations which are * directly marked as TypeQualifier annotations , and also resolves the use * of TypeQualifierNickname annotations . * @ param ...
try { XClass c = Global . getAnalysisCache ( ) . getClassAnalysis ( XClass . class , value . getAnnotationClass ( ) ) ; AnnotationValue defaultAnnotation = c . getAnnotation ( typeQualifierDefault ) ; if ( defaultAnnotation == null ) { return ; } for ( Object o : ( Object [ ] ) defaultAnnotation . getValue ( "value" ) ...
public class PortableConcurrentDirectDeque { /** * Initializes head and tail , ensuring invariants hold . */ private void initHeadTail ( Node < E > h , Node < E > t ) { } }
if ( h == t ) { if ( h == null ) h = t = new Node < > ( null ) ; else { // Avoid edge case of a single Node with non - null item . Node < E > newNode = new Node < > ( null ) ; t . lazySetNext ( newNode ) ; newNode . lazySetPrev ( t ) ; t = newNode ; } } head = h ; tail = t ;
public class MtasSolrCollectionResult { /** * Rewrite . * @ param searchComponent the search component * @ return the simple ordered map * @ throws IOException Signals that an I / O exception has occurred . */ public SimpleOrderedMap < Object > rewrite ( MtasSolrSearchComponent searchComponent ) throws IOExceptio...
SimpleOrderedMap < Object > response = new SimpleOrderedMap < > ( ) ; Iterator < Entry < String , Object > > it ; switch ( action ) { case ComponentCollection . ACTION_LIST : response . add ( "now" , now ) ; response . add ( "list" , list ) ; break ; case ComponentCollection . ACTION_CREATE : case ComponentCollection ....
public class ContractsApi { /** * Get contracts Returns contracts available to a character , only if the * character is issuer , acceptor or assignee . Only returns contracts no * older than 30 days , or if the status is \ & quot ; in _ progress \ & quot ; . - - - * This route is cached for up to 300 seconds * ...
com . squareup . okhttp . Call call = getCharactersCharacterIdContractsValidateBeforeCall ( characterId , datasource , ifNoneMatch , page , token , null ) ; Type localVarReturnType = new TypeToken < List < CharacterContractsResponse > > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class ConversionResult { /** * Get all messages of a particular type * @ param messageType * @ return */ public List < ConversionMessage > getMessages ( ConversionMessageType messageType ) { } }
List < ConversionMessage > messages = new ArrayList < ConversionMessage > ( ) ; for ( ConversionMessage message : this . messages ) { if ( message . getMessageType ( ) == messageType ) { messages . add ( message ) ; } } return messages ;
public class JMPath { /** * Gets ancestor path list . * @ param startPath the start path * @ return the ancestor path list */ public static List < Path > getAncestorPathList ( Path startPath ) { } }
List < Path > ancestorPathList = new ArrayList < > ( ) ; buildPathListOfAncestorDirectory ( ancestorPathList , startPath ) ; Collections . reverse ( ancestorPathList ) ; return ancestorPathList ;
public class FragmentBundler { /** * Inserts a Boolean value into the mapping of the underlying Bundle , replacing * any existing value for the given key . Either key or value may be null . * @ param key a String , or null * @ param value a Boolean , or null * @ return this bundler instance to chain method call...
bundler . put ( key , value ) ; return this ;
public class LambdaIterable { /** * { @ inheritDoc } * @ param lazyAppFn */ @ Override public < B > Lazy < LambdaIterable < B > > lazyZip ( Lazy < ? extends Applicative < Function < ? super A , ? extends B > , LambdaIterable < ? > > > lazyAppFn ) { } }
return Empty . empty ( as ) ? lazy ( LambdaIterable . empty ( ) ) : Monad . super . lazyZip ( lazyAppFn ) . fmap ( Monad < B , LambdaIterable < ? > > :: coerce ) ;
public class VehicleManager { /** * Register to receive asynchronous updates for a specific Measurement type . * A Measurement is a specific , known VehicleMessage subtype . * Use this method to register an object implementing the * Measurement . Listener interface to receive real - time updates * whenever a ne...
Log . i ( TAG , "Adding listener " + listener + " for " + measurementType ) ; mNotifier . register ( measurementType , listener ) ;
public class AbstractCacheableLockManager { /** * Returns the number of active locks . */ @ Managed @ ManagedDescription ( "The number of active locks" ) public int getNumLocks ( ) { } }
try { return getNumLocks . run ( ) ; } catch ( LockException e ) { if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( "An exception occurred: " + e . getMessage ( ) ) ; } } return - 1 ;
public class AbstractIntegerVector { /** * { @ inheritDoc } */ public double magnitude ( ) { } }
double m = 0 ; int length = length ( ) ; for ( int i = 0 ; i < length ; ++ i ) { double d = get ( i ) ; m += d * d ; } return Math . sqrt ( m ) ;
public class JFontChooser { /** * Updates the font in the preview component according to the selected values . */ private void updateComponents ( ) { } }
updatingComponents = true ; Font font = getFont ( ) ; fontList . setSelectedValue ( font . getName ( ) , true ) ; sizeList . setSelectedValue ( font . getSize ( ) , true ) ; boldCheckBox . setSelected ( font . isBold ( ) ) ; italicCheckBox . setSelected ( font . isItalic ( ) ) ; if ( previewText == null ) { previewLabe...
public class SignalServiceMessageReceiver { /** * Creates a pipe for receiving SignalService messages . * Callers must call { @ link SignalServiceMessagePipe # shutdown ( ) } when finished with the pipe . * @ return A SignalServiceMessagePipe for receiving Signal Service messages . */ public SignalServiceMessagePip...
WebSocketConnection webSocket = new WebSocketConnection ( urls . getSignalServiceUrls ( ) [ 0 ] . getUrl ( ) , urls . getSignalServiceUrls ( ) [ 0 ] . getTrustStore ( ) , Optional . of ( credentialsProvider ) , userAgent , connectivityListener , sleepTimer ) ; return new SignalServiceMessagePipe ( webSocket , Optional ...
public class AnnotationTypeWriterImpl { /** * Add summary details to the navigation bar . * @ param subDiv the content tree to which the summary detail links will be added */ @ Override protected void addSummaryDetailLinks ( Content subDiv ) { } }
Content div = HtmlTree . DIV ( getNavSummaryLinks ( ) ) ; div . addContent ( getNavDetailLinks ( ) ) ; subDiv . addContent ( div ) ;
public class Balancer { /** * Check that this Balancer is compatible with the Block Placement Policy * used by the Namenode . * In case it is not compatible , throw IllegalArgumentException */ private void checkReplicationPolicyCompatibility ( Configuration conf ) { } }
if ( ! ( BlockPlacementPolicy . getInstance ( conf , null , null , null , null , null ) instanceof BlockPlacementPolicyDefault ) ) { throw new IllegalArgumentException ( "Configuration lacks BlockPlacementPolicyDefault" ) ; }
public class PatchSchedulesInner { /** * Gets the patching schedule of a redis cache ( requires Premium SKU ) . * @ param resourceGroupName The name of the resource group . * @ param name The name of the redis cache . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudE...
return getWithServiceResponseAsync ( resourceGroupName , name ) . toBlocking ( ) . single ( ) . body ( ) ;
public class VFSUtils { /** * Copy input stream to output stream without closing streams . Flushes output stream when done . * @ param is input stream * @ param os output stream * @ param bufferSize the buffer size to use * @ throws IOException for any error */ public static void copyStream ( InputStream is , O...
if ( is == null ) { throw MESSAGES . nullArgument ( "input stream" ) ; } if ( os == null ) { throw MESSAGES . nullArgument ( "output stream" ) ; } byte [ ] buff = new byte [ bufferSize ] ; int rc ; while ( ( rc = is . read ( buff ) ) != - 1 ) { os . write ( buff , 0 , rc ) ; } os . flush ( ) ;
public class YarnClasspathProvider { /** * Fetches the string [ ] under the given key , if it exists and contains entries ( . length > 0 ) . * @ param configuration * @ param key * @ return */ private static Optional < String [ ] > getTrimmedStrings ( final YarnConfiguration configuration , final String key ) { }...
final String [ ] result = configuration . getTrimmedStrings ( key ) ; if ( null == result || result . length == 0 ) { return Optional . empty ( ) ; } else { return Optional . of ( result ) ; }
public class ImageSprite { /** * Set the image array used to render the sprite . * @ param frames the sprite images . */ public void setFrames ( MultiFrameImage frames ) { } }
if ( frames == null ) { // log . warning ( " Someone set up us the null frames ! " , " sprite " , this ) ; return ; } // if these are the same frames we already had , no need to do a bunch of pointless business if ( frames == _frames ) { return ; } // set and init our frames _frames = frames ; _frameIdx = 0 ; layout ( ...
public class SmbFile { /** * This method will copy the file or directory represented by this * < tt > SmbFile < / tt > and it ' s sub - contents to the location specified by the * < tt > dest < / tt > parameter . This file and the destination file do not * need to be on the same host . This operation does not cop...
SmbComReadAndX req ; SmbComReadAndXResponse resp ; WriterThread w ; int bsize ; byte [ ] [ ] b ; /* Should be able to copy an entire share actually */ if ( share == null || dest . share == null ) { throw new SmbException ( "Invalid operation for workgroups or servers" ) ; } req = new SmbComReadAndX ( ) ; resp = new Smb...
public class CService { /** * Get all methods including methods declared in extended services . * @ return The list of service methods . */ public Collection < CServiceMethod > getMethodsIncludingExtended ( ) { } }
CService extended = getExtendsService ( ) ; if ( extended == null ) { return getMethods ( ) ; } List < CServiceMethod > out = new ArrayList < > ( ) ; out . addAll ( extended . getMethodsIncludingExtended ( ) ) ; out . addAll ( getMethods ( ) ) ; return ImmutableList . copyOf ( out ) ;
public class CmsDynamicFunctionParser { /** * Parses the main format from the XML content . < p > * @ param cms the current CMS context * @ param location the location from which to parse main format * @ param functionRes the dynamic function resource * @ return the parsed main format */ protected Format getMai...
I_CmsXmlContentValueLocation jspLoc = location . getSubValue ( "FunctionProvider" ) ; CmsUUID structureId = jspLoc . asId ( cms ) ; I_CmsXmlContentValueLocation containerSettings = location . getSubValue ( "ContainerSettings" ) ; Map < String , String > parameters = parseParameters ( cms , location , "Parameter" ) ; if...
public class AbstractValidate { /** * Returns the index of the first null element , or { @ code - 1 } if no null element was found . * @ param iterable * the iterable to check for null elements * @ param < T > * the type of the iterable * @ return the index of the first null element , or { @ code - 1 } if no ...
final Iterator < ? > it = iterable . iterator ( ) ; for ( int i = 0 ; it . hasNext ( ) ; i ++ ) { if ( it . next ( ) == null ) { return i ; } } return - 1 ;
public class KamImpl { /** * { @ inheritDoc } */ @ Override public KamEdge replaceEdge ( KamEdge kamEdge , FunctionEnum sourceFunction , String sourceLabel , RelationshipType relationship , FunctionEnum targetFunction , String targetLabel ) { } }
// replace source node final int sourceNodeId = kamEdge . getSourceNode ( ) . getId ( ) ; final KamNode sourceReplacement = new KamNodeImpl ( this , sourceNodeId , sourceFunction , sourceLabel ) ; // establish id to replacement node idNodeMap . put ( sourceNodeId , sourceReplacement ) ; nodeIdMap . put ( sourceReplacem...
public class BuildRun { /** * Stories and Defects completed in this Build Run . * @ param filter Filter for PrimaryWorkitems . * @ return completed Stories and Defects completed in this Build Run . */ public Collection < PrimaryWorkitem > getCompletedPrimaryWorkitems ( PrimaryWorkitemFilter filter ) { } }
filter = ( filter != null ) ? filter : new PrimaryWorkitemFilter ( ) ; filter . completedIn . clear ( ) ; filter . completedIn . add ( this ) ; return getInstance ( ) . get ( ) . primaryWorkitems ( filter ) ;
public class JCuda { /** * Gets a mipmap level of a CUDA mipmapped array . * < pre > * cudaError _ t cudaGetMipmappedArrayLevel ( * cudaArray _ t * levelArray , * cudaMipmappedArray _ const _ t mipmappedArray , * unsigned int level ) * < / pre > * < div > * < p > Gets a mipmap level of a CUDA mipmapped ...
return checkResult ( cudaGetMipmappedArrayLevelNative ( levelArray , mipmappedArray , level ) ) ;
public class Branch { /** * < p > Redeems the specified number of credits from the " default " bucket , if there are sufficient * credits within it . If the number to redeem exceeds the number available in the bucket , all of * the available credits will be redeemed instead . < / p > * @ param count A { @ link In...
redeemRewards ( Defines . Jsonkey . DefaultBucket . getKey ( ) , count , callback ) ;
public class RomanticCron4jNativeTaskExecutor { @ Override public void start ( boolean daemon ) { } }
setupLinkedLockIfNeeds ( ) ; synchronized ( linkedLock ) { registerStartTimeCurrentTime ( ) ; setupLinkedGuidIfNeeds ( ) ; final String threadName = buildThreadName ( linkedScheduler . getGuid ( ) , linkedGuid ) ; registerThreadNewCreated ( ) ; prepareThread ( daemon , threadName ) ; actuallyThreadStart ( ) ; }
public class DatatypeFactory { /** * < p > Create a < code > Duration < / code > of type < code > xdt : dayTimeDuration < / code > by parsing its < code > String < / code > representation , * " < em > PnDTnHnMnS < / em > " , < a href = " http : / / www . w3 . org / TR / xpath - datamodel # dt - dayTimeDuration " > ...
if ( lexicalRepresentation == null ) { throw new NullPointerException ( "lexicalRepresentation == null" ) ; } // The lexical representation must match the pattern [ ^ YM ] * ( T . * ) ? int pos = lexicalRepresentation . indexOf ( 'T' ) ; int length = ( pos >= 0 ) ? pos : lexicalRepresentation . length ( ) ; for ( int i...
public class DocumentImpl { /** * Returns a copy of the given node or subtree with this document as its * owner . * @ param operation either { @ link UserDataHandler # NODE _ CLONED } or * { @ link UserDataHandler # NODE _ IMPORTED } . * @ param node a node belonging to any document or DOM implementation . * ...
NodeImpl copy = shallowCopy ( operation , node ) ; if ( deep ) { NodeList list = node . getChildNodes ( ) ; for ( int i = 0 ; i < list . getLength ( ) ; i ++ ) { copy . appendChild ( cloneOrImportNode ( operation , list . item ( i ) , deep ) ) ; } } notifyUserDataHandlers ( operation , node , copy ) ; return copy ;
public class AmazonElastiCacheClient { /** * Lists all available node types that you can scale your Redis cluster ' s or replication group ' s current node type * up to . * When you use the < code > ModifyCacheCluster < / code > or < code > ModifyReplicationGroup < / code > operations to scale up * your cluster o...
request = beforeClientExecution ( request ) ; return executeListAllowedNodeTypeModifications ( request ) ;
public class InsertExtractUtils { /** * Extract read and write part values to an object for SCALAR , SPECTRUM and IMAGE * @ param da * @ return array of primitives for SCALAR , array of primitives for SPECTRUM , array of primitives array of primitives * for IMAGE * @ throws DevFailed */ public static Object ext...
if ( da == null ) { throw DevFailedUtils . newDevFailed ( ERROR_MSG_DA ) ; } return InsertExtractFactory . getAttributeExtractor ( da . getType ( ) ) . extract ( da ) ;
public class MailSessionDefinitionInjectionBinding { /** * ( non - Javadoc ) * @ see com . ibm . wsspi . injectionengine . InjectionBinding # merge ( java . lang . annotation . Annotation , java . lang . Class , java . lang . reflect . Member ) */ @ Override public void merge ( @ Sensitive MailSessionDefinition annot...
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "merge: name=" + getJndiName ( ) + ", " + super . toStringSecure ( annotation ) ) ; if ( member != null ) { // MailSessionDefinition is a class - level annotation only . throw new IllegalAr...
public class EventRepository { /** * Save { @ link Event } to DB * @ param event { @ link Event } to save */ @ Transactional public void save ( Event event ) { } }
Event merged = em . merge ( event ) ; em . flush ( ) ; event . setId ( merged . getId ( ) ) ;
public class FileSize { /** * Format a integer or long value as file size . Returns empty string if < code > value < / code > argument is null . * @ param value numeric value . * @ return numeric value represented as file size , possible empty if < code > value < / code > argument is null . * @ throws IllegalArgu...
if ( value == null ) { return "" ; } double fileSize = 0 ; if ( value instanceof Integer ) { fileSize = ( Integer ) value ; } else if ( value instanceof Long ) { fileSize = ( Long ) value ; } else { throw new IllegalArgumentException ( String . format ( "Invalid argument type |%s|." , value . getClass ( ) ) ) ; } if ( ...
public class ReflectUtils { /** * invokes the getter on the filed * @ param object * @ param field * @ return */ @ SuppressWarnings ( "unchecked" ) public static < S extends Serializable > S invokeGetter ( Object object , Field field ) { } }
Method m = ReflectionUtils . findMethod ( object . getClass ( ) , ReflectUtils . toGetter ( field . getName ( ) ) ) ; if ( null == m ) { for ( String prefix : PREFIXES ) { m = ReflectionUtils . findMethod ( object . getClass ( ) , ReflectUtils . toGetter ( field . getName ( ) , prefix ) ) ; if ( null != m ) { break ; }...
public class FastItemAdapter { /** * add a list of items at the given position within the existing items * @ param position the global position * @ param items the items to add */ public FastItemAdapter < Item > add ( int position , List < Item > items ) { } }
getItemAdapter ( ) . add ( position , items ) ; return this ;
public class NodeImpl { /** * { @ inheritDoc } */ public void update ( String srcWorkspaceName ) throws NoSuchWorkspaceException , AccessDeniedException , InvalidItemStateException , LockException , RepositoryException { } }
checkValid ( ) ; // Check pending changes if ( session . hasPendingChanges ( ) ) { throw new InvalidItemStateException ( "Session has pending changes " ) ; } // Check locking if ( ! checkLocking ( ) ) { throw new LockException ( "Node " + getPath ( ) + " is locked " ) ; } SessionChangesLog changes = new SessionChangesL...
public class InMemoryChunkAccumulator { /** * Returns the number of chunks * accumulated for a given id so far * @ param id the id to get the * number of chunks for * @ return the number of chunks accumulated * for a given id so far */ @ Override public int numChunksSoFar ( String id ) { } }
if ( ! chunks . containsKey ( id ) ) return 0 ; return chunks . get ( id ) . size ( ) ;
public class DebugSqlFilter { /** * { @ inheritDoc } * @ see jp . co . future . uroborosql . filter . AbstractSqlFilter # doUpdate ( jp . co . future . uroborosql . context . SqlContext , java . sql . PreparedStatement , int ) */ @ Override public int doUpdate ( final SqlContext sqlContext , final PreparedStatement p...
LOG . debug ( "SQL:{} executed. Count:{} items." , sqlContext . getSqlName ( ) , result ) ; return result ;
public class JoinGraph { /** * Builds { @ link JoinGraph } containing { @ code plan } node . */ public static JoinGraph buildShallowFrom ( PlanNode plan , Lookup lookup ) { } }
JoinGraph graph = plan . accept ( new Builder ( true , lookup ) , new Context ( ) ) ; return graph ;
public class CastorMarshaller { /** * Template method that allows for customizing of the given Castor { @ link Unmarshaller } . */ protected void customizeUnmarshaller ( Unmarshaller unmarshaller ) { } }
unmarshaller . setValidation ( this . validating ) ; unmarshaller . setWhitespacePreserve ( this . whitespacePreserve ) ; unmarshaller . setIgnoreExtraAttributes ( this . ignoreExtraAttributes ) ; unmarshaller . setIgnoreExtraElements ( this . ignoreExtraElements ) ; unmarshaller . setObject ( this . rootObject ) ; unm...
public class GuideTree { /** * Returns the similarity matrix used to construct this guide tree . The scores have not been normalized . * @ return the similarity matrix used to construct this guide tree */ public double [ ] [ ] getScoreMatrix ( ) { } }
double [ ] [ ] matrix = new double [ sequences . size ( ) ] [ sequences . size ( ) ] ; for ( int i = 0 , n = 0 ; i < matrix . length ; i ++ ) { matrix [ i ] [ i ] = scorers . get ( i ) . getMaxScore ( ) ; for ( int j = i + 1 ; j < matrix . length ; j ++ ) { matrix [ i ] [ j ] = matrix [ j ] [ i ] = scorers . get ( n ++...
public class SQLiteEvent { /** * Creates the insert . * @ param result * the result * @ return the SQ lite event */ public static SQLiteEvent createInsertWithUid ( String result ) { } }
return new SQLiteEvent ( SqlModificationType . INSERT , null , null , result ) ;
public class LogRepositoryBaseImpl { /** * Retrieves the timestamp from the name of the file . * @ param file to retrieve timestamp from . * @ return timestamp in millis or - 1 if name ' s pattern does not correspond * to the one used for files in the repository . */ public long getLogFileTimestamp ( File file ) ...
if ( file == null ) { return - 1L ; } String name = file . getName ( ) ; // Check name for extension if ( name == null || name . length ( ) == 0 || ! name . endsWith ( EXTENSION ) ) { return - 1L ; } try { return Long . parseLong ( name . substring ( 0 , name . indexOf ( EXTENSION ) ) ) ; } catch ( NumberFormatExceptio...
public class MongoDBUtils { /** * Create a MongoDB collection . * @ param colectionName * @ param options */ public void createMongoDBCollection ( String colectionName , DataTable options ) { } }
BasicDBObject aux = new BasicDBObject ( ) ; // Recorremos las options para castearlas y añadirlas a la collection List < List < String > > rowsOp = options . raw ( ) ; for ( int i = 0 ; i < rowsOp . size ( ) ; i ++ ) { List < String > rowOp = rowsOp . get ( i ) ; if ( rowOp . get ( 0 ) . equals ( "size" ) || rowOp . g...
public class SimpleIOHandler { /** * Serializes a ( not too large ) BioPAX model to the RDF / XML ( OWL ) formatted string . * @ param model a BioPAX object model to convert to the RDF / XML format * @ return the BioPAX data in the RDF / XML format * @ throws IllegalArgumentException if model is null * @ throws...
if ( model == null ) throw new IllegalArgumentException ( ) ; ByteArrayOutputStream outputStream = new ByteArrayOutputStream ( ) ; ( new SimpleIOHandler ( model . getLevel ( ) ) ) . convertToOWL ( model , outputStream ) ; try { return outputStream . toString ( "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { lo...
public class PrettyTime { /** * Format the given { @ link Duration } and return a non - relative ( not decorated with past or future tense ) * { @ link String } for the approximate duration of the difference between the reference { @ link Date } and the given * { @ link Duration } . If the given { @ link Duration }...
if ( duration == null ) return format ( now ( ) ) ; TimeFormat timeFormat = getFormat ( duration . getUnit ( ) ) ; return timeFormat . format ( duration ) ;
public class IndexActionRegisterServiceImpl { /** * Retrieves all { @ link EntityType } s . Queryies in pages of size ENTITY _ FETCH _ PAGE _ SIZE so that * results can be cached . Uses a { @ link Fetch } that specifies all fields needed to determine the * necessary index actions . * @ return List containing all ...
QueryImpl < EntityType > query = new QueryImpl < > ( ) ; query . setPageSize ( ENTITY_FETCH_PAGE_SIZE ) ; query . setFetch ( ENTITY_TYPE_FETCH ) ; List < EntityType > result = newArrayList ( ) ; for ( int pageNum = 0 ; result . size ( ) == pageNum * ENTITY_FETCH_PAGE_SIZE ; pageNum ++ ) { query . offset ( pageNum * ENT...
public class HSQLDBHandler { /** * executes a query on the queries inside the cld fusion enviroment * @ param pc Page Context * @ param sql * @ param maxrows * @ return result as Query * @ throws PageException * @ throws PageException */ public Query execute ( PageContext pc , SQL sql , int maxrows , int fe...
Stopwatch stopwatch = new Stopwatch ( Stopwatch . UNIT_NANO ) ; stopwatch . start ( ) ; String prettySQL = null ; Selects selects = null ; // First Chance try { SelectParser parser = new SelectParser ( ) ; selects = parser . parse ( sql . getSQLString ( ) ) ; Query q = qoq . execute ( pc , sql , selects , maxrows ) ; q...
public class Part { /** * Sets the label which first char identifies this part . * @ param labelValue * The label that identifies this part . * @ throws IllegalArgumentException if label is 0 - length */ public void setLabel ( String labelValue ) throws IllegalArgumentException { } }
if ( ( labelValue == null ) || ( labelValue . length ( ) == 0 ) ) throw new IllegalArgumentException ( "Part's label can't be null or empty!" ) ; m_label = labelValue ; m_music . setPartLabel ( m_label ) ;
public class ErrorCodesMobile { /** * Returns the exception type that corresponds to the given { @ code message } or { @ code null } if * there are no matching mobile exceptions . * @ param message message An error message returned by Appium server * @ return The exception type that corresponds to the provided er...
for ( Map . Entry < Integer , String > entry : statusToState . entrySet ( ) ) { if ( message . contains ( entry . getValue ( ) ) ) { return getExceptionType ( entry . getKey ( ) ) ; } } return null ;
public class GetAuthorizationTokenResult { /** * A list of authorization token data objects that correspond to the < code > registryIds < / code > values in the request . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setAuthorizationData ( java . util . Col...
if ( this . authorizationData == null ) { setAuthorizationData ( new java . util . ArrayList < AuthorizationData > ( authorizationData . length ) ) ; } for ( AuthorizationData ele : authorizationData ) { this . authorizationData . add ( ele ) ; } return this ;
public class SVGUtil { /** * Create a SVG element in appropriate namespace * @ param document containing document * @ param name node name * @ return new SVG element . */ public static Element svgElement ( Document document , String name ) { } }
return document . createElementNS ( SVGConstants . SVG_NAMESPACE_URI , name ) ;
public class PathTemplate { private static ImmutableList < Segment > parseTemplate ( String template ) { } }
// Skip useless leading slash . if ( template . startsWith ( "/" ) ) { template = template . substring ( 1 ) ; } // Extract trailing custom verb . Matcher matcher = CUSTOM_VERB_PATTERN . matcher ( template ) ; String customVerb = null ; if ( matcher . find ( ) ) { customVerb = matcher . group ( 1 ) ; template = templat...
public class Ocpp15RequestHandler { /** * { @ inheritDoc } */ @ Override public void handle ( StopTransactionRequestedEvent event , CorrelationToken correlationToken ) { } }
LOG . info ( "StopTransactionRequestedEvent" ) ; if ( event . getTransactionId ( ) instanceof NumberedTransactionId ) { NumberedTransactionId transactionId = ( NumberedTransactionId ) event . getTransactionId ( ) ; boolean stopTransactionAccepted = chargingStationOcpp15Client . stopTransaction ( event . getChargingStat...
public class Matrix { /** * Computes an orthographic projection matrix . * @ param m returns the result * @ param mOffset * @ param left * @ param right * @ param bottom * @ param top * @ param near * @ param far */ public static void orthoM ( float [ ] m , int mOffset , float left , float right , float...
if ( left == right ) { throw new IllegalArgumentException ( "left == right" ) ; } if ( bottom == top ) { throw new IllegalArgumentException ( "bottom == top" ) ; } if ( near == far ) { throw new IllegalArgumentException ( "near == far" ) ; } final float r_width = 1.0f / ( right - left ) ; final float r_height = 1.0f / ...
public class Elements { /** * Inserts the specified element into the parent of the before element . */ public static void insertBefore ( Element newElement , Element before ) { } }
before . parentNode . insertBefore ( newElement , before ) ;
public class HomographyInducedStereo2Line { /** * Computes the homography based on two unique lines on the plane * @ param line0 Line on the plane * @ param line1 Line on the plane */ public boolean process ( PairLineNorm line0 , PairLineNorm line1 ) { } }
// Find plane equations of second lines in the first view double a0 = GeometryMath_F64 . dot ( e2 , line0 . l2 ) ; double a1 = GeometryMath_F64 . dot ( e2 , line1 . l2 ) ; GeometryMath_F64 . multTran ( A , line0 . l2 , Al0 ) ; GeometryMath_F64 . multTran ( A , line1 . l2 , Al1 ) ; // find the intersection of the planes...
public class DefaultGroovyMethods { /** * Create a Set as a union of a Set and a Collection . * This operation will always create a new object for the result , * while the operands remain unchanged . * @ param left the left Set * @ param right the right Collection * @ return the merged Set * @ since 2.4.0 ...
return ( Set < T > ) plus ( ( Collection < T > ) left , right ) ;
public class JavaAgent { /** * an agent can be started in its own VM as the main class */ public static void main ( String [ ] args ) { } }
try { start ( args ) ; } catch ( Exception e ) { System . err . println ( "Hawkular Java Agent failed at startup" ) ; e . printStackTrace ( System . err ) ; return ; } // so main doesn ' t exit synchronized ( JavaAgent . class ) { try { JavaAgent . class . wait ( ) ; } catch ( InterruptedException e ) { } }
public class OMMapManagerOld { /** * Search for a buffer in the ordered list . * @ param fileEntries * to search necessary record . * @ param iBeginOffset * file offset to start search from it . * @ param iSize * that will be contained in founded entries . * @ return negative number means not found . The ...
if ( fileEntries == null || fileEntries . size ( ) == 0 ) return - 1 ; int high = fileEntries . size ( ) - 1 ; if ( high < 0 ) // NOT FOUND return - 1 ; int low = 0 ; int mid = - 1 ; // BINARY SEARCH OMMapBufferEntry e ; while ( low <= high ) { mid = ( low + high ) >>> 1 ; e = fileEntries . get ( mid ) ; if ( iBeginOff...
public class ContextMap { /** * { @ inheritDoc } */ @ Override public Property setProperty ( String name , Object val ) { } }
return _context . setProperty ( name , val ) ;
public class Parameters { /** * Creates new Parameters from JSON object . * @ param json a JSON string containing parameters . * @ return a new Parameters object . * @ see JsonConverter # toNullableMap ( String ) */ public static Parameters fromJson ( String json ) { } }
Map < String , Object > map = JsonConverter . toNullableMap ( json ) ; return map != null ? new Parameters ( map ) : new Parameters ( ) ;
public class OutRawH3Impl { /** * string */ @ Override public void writeString ( String value ) { } }
if ( value == null ) { writeNull ( ) ; return ; } int strlen = value . length ( ) ; writeLong ( ConstH3 . STRING , ConstH3 . STRING_BITS , strlen ) ; writeStringData ( value , 0 , strlen ) ;
public class CPAttachmentFileEntryPersistenceImpl { /** * Caches the cp attachment file entry in the entity cache if it is enabled . * @ param cpAttachmentFileEntry the cp attachment file entry */ @ Override public void cacheResult ( CPAttachmentFileEntry cpAttachmentFileEntry ) { } }
entityCache . putResult ( CPAttachmentFileEntryModelImpl . ENTITY_CACHE_ENABLED , CPAttachmentFileEntryImpl . class , cpAttachmentFileEntry . getPrimaryKey ( ) , cpAttachmentFileEntry ) ; finderCache . putResult ( FINDER_PATH_FETCH_BY_UUID_G , new Object [ ] { cpAttachmentFileEntry . getUuid ( ) , cpAttachmentFileEntry...
public class QueryCompileErrorMarshaller { /** * Marshall the given parameter object . */ public void marshall ( QueryCompileError queryCompileError , ProtocolMarshaller protocolMarshaller ) { } }
if ( queryCompileError == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( queryCompileError . getLocation ( ) , LOCATION_BINDING ) ; protocolMarshaller . marshall ( queryCompileError . getMessage ( ) , MESSAGE_BINDING ) ; } catch ( Exception...
public class VoiceApi { /** * Answer a call * Answer the specified call . * @ param id The connection ID of the call . ( required ) * @ param answerData Request parameters . ( optional ) * @ return ApiSuccessResponse * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize ...
ApiResponse < ApiSuccessResponse > resp = answerWithHttpInfo ( id , answerData ) ; return resp . getData ( ) ;
public class Util { /** * Extracts the names of the attributes from the executable elements that represents them in the given map and * returns a map keyed by those names . * I . e . while representing annotation attributes on an annotation type by executable elements is technically * correct * it is more conve...
Map < String , Map . Entry < ? extends ExecutableElement , ? extends AnnotationValue > > result = new LinkedHashMap < > ( ) ; for ( Map . Entry < ? extends ExecutableElement , ? extends AnnotationValue > e : attributes . entrySet ( ) ) { result . put ( e . getKey ( ) . getSimpleName ( ) . toString ( ) , e ) ; } return ...
public class DocumentCharacterIterator { /** * Increments the iterator ' s index by one and returns the character at the * new index . * @ return the character at the new position , or DONE if the new position is * off the end */ @ Override public char next ( ) { } }
++ docPos ; if ( docPos < segmentEnd || segmentEnd >= doc . getLength ( ) ) { return text . next ( ) ; } try { doc . getText ( segmentEnd , doc . getLength ( ) - segmentEnd , text ) ; } catch ( BadLocationException e ) { throw new RuntimeException ( e ) ; } segmentEnd += text . count ; return text . current ( ) ;
public class AnnotatedFilterRouteBuilder { /** * Executed after the bean creation . */ @ PostConstruct public void process ( ) { } }
Collection < BeanDefinition < ? > > filterDefinitions = beanContext . getBeanDefinitions ( Qualifiers . byStereotype ( Filter . class ) ) ; for ( BeanDefinition < ? > beanDefinition : filterDefinitions ) { if ( HttpClientFilter . class . isAssignableFrom ( beanDefinition . getBeanType ( ) ) ) { // ignore http client fi...
public class BigtableVeneerSettingsFactory { /** * Creates { @ link TransportChannelProvider } based on Channel Negotiation type . */ private static TransportChannelProvider buildChannelProvider ( String endpoint , BigtableOptions options ) { } }
return defaultGrpcTransportProviderBuilder ( ) . setEndpoint ( endpoint ) . setPoolSize ( options . getChannelCount ( ) ) . setChannelConfigurator ( new ApiFunction < ManagedChannelBuilder , ManagedChannelBuilder > ( ) { @ Override public ManagedChannelBuilder apply ( ManagedChannelBuilder channelBuilder ) { return cha...
public class AtomTypeModel { /** * Access to the number of lone - pairs ( specified as a property of the * atom ) . * @ param atom the atom to get the lone pairs from * @ return number of lone pairs */ private static int lonePairCount ( IAtom atom ) { } }
// XXX : LONE _ PAIR _ COUNT is not currently set ! Integer count = atom . getProperty ( CDKConstants . LONE_PAIR_COUNT ) ; return count != null ? count : - 1 ;
public class ModelsImpl { /** * Gets the utterances for the given model in the given app version . * @ param appId The application ID . * @ param versionId The version ID . * @ param modelId The ID ( GUID ) of the model . * @ param examplesMethodOptionalParameter the object representing the optional parameters ...
if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( appId == null ) { throw new IllegalArgumentException ( "Parameter appId is required and cannot be null." ) ; } if ( versionId == null ) { throw new IllegalArgu...
public class Repository { /** * < p > newInstance . < / p > * @ return a { @ link com . greenpepper . repository . DocumentRepository } object . * @ throws java . lang . Exception if any . */ public DocumentRepository newInstance ( ) throws Exception { } }
Class < ? > klass = Class . forName ( type ) ; if ( ! DocumentRepository . class . isAssignableFrom ( klass ) ) throw new IllegalArgumentException ( "Not a " + DocumentRepository . class . getName ( ) + ": " + type ) ; Constructor < ? > constructor = klass . getConstructor ( String [ ] . class ) ; return ( DocumentRepo...
public class OxygenRelaxNGSchemaReader { /** * Create a schema from an input source and a property map . */ public Schema createSchema ( SAXSource source , PropertyMap properties ) throws IOException , SAXException , IncorrectSchemaException { } }
SchemaPatternBuilder spb = new SchemaPatternBuilder ( ) ; SAXResolver resolver = ResolverFactory . createResolver ( properties ) ; ErrorHandler eh = properties . get ( ValidateProperty . ERROR_HANDLER ) ; DatatypeLibraryFactory dlf = properties . get ( RngProperty . DATATYPE_LIBRARY_FACTORY ) ; if ( dlf == null ) { // ...
public class GeographyPointValue { /** * Deserializes a point from a ByteBuffer , at an absolute offset . * @ param inBuffer The ByteBuffer from which to read the bytes for a point . * @ param offset Absolute offset of point data in buffer . * @ return A new instance of GeographyPointValue . */ public static Geog...
double lng = inBuffer . getDouble ( offset ) ; double lat = inBuffer . getDouble ( offset + BYTES_IN_A_COORD ) ; if ( lat == 360.0 && lng == 360.0 ) { // This is a null point . return null ; } return new GeographyPointValue ( lng , lat ) ;
public class TraitASTTransformation { /** * Copies annotation from the trait to the helper , excluding the trait annotation itself * @ param cNode the trait class node * @ param helper the helper class node */ private static void copyClassAnnotations ( final ClassNode cNode , final ClassNode helper ) { } }
List < AnnotationNode > annotations = cNode . getAnnotations ( ) ; for ( AnnotationNode annotation : annotations ) { if ( ! annotation . getClassNode ( ) . equals ( Traits . TRAIT_CLASSNODE ) ) { helper . addAnnotation ( annotation ) ; } }
public class CapacityManager { /** * Attempts to acquire a given amount of capacity . * If acquired , capacity will be consumed from the available pool . * @ param capacity capacity to acquire * @ return true if capacity can be acquired , false if not * @ throws IllegalArgumentException if given capacity is neg...
if ( capacity < 0 ) { throw new IllegalArgumentException ( "capacity to acquire cannot be negative" ) ; } if ( availableCapacity < 0 ) { return true ; } synchronized ( lock ) { if ( availableCapacity - capacity >= 0 ) { availableCapacity -= capacity ; return true ; } else { return false ; } }
public class System { /** * ASSET _ DESIGN role can PUT in - memory config for running tests . */ public List < String > getRoles ( String path ) { } }
List < String > roles = super . getRoles ( path ) ; roles . add ( Role . ASSET_DESIGN ) ; return roles ;
public class LdapXPathTranslateHelper { /** * ( non - Javadoc ) * @ see com . ibm . ws . wim . xpath . util . XPathTranslateHelper # genSearchString ( java . lang . StringBuffer , com . ibm . ws . wim . xpath . mapping . datatype . ParenthesisNode ) */ private void genSearchString ( StringBuffer searchExpBuffer , Par...
XPathNode child = ( XPathNode ) parenNode . getChild ( ) ; genStringChild ( searchExpBuffer , child ) ;
public class ModelCacheManager { /** * 将数据ID , Model类类型组合成Key的对应Model从缓存中取出 * @ param dataKey * @ param modelClassName * @ return */ public void removeCache2 ( Object dataKey , String modelClassName ) { } }
CacheKey cachKey = cacheKeyFactory . createCacheKey ( dataKey . toString ( ) , modelClassName ) ; cacheManager . removeObect ( cachKey ) ;
public class Field { /** * Visualize the field using the given operation and entity * @ param ctx the context * @ param operation The operation * @ param entity The entity * @ return The string visualization * @ throws PMException */ public Object visualize ( PMContext ctx , Operation operation , Entity entit...
debug ( "Converting [" + operation . getId ( ) + "]" + entity . getId ( ) + "." + getId ( ) ) ; try { Converter c = null ; if ( getConverters ( ) != null ) { c = getConverter ( operation . getId ( ) ) ; } if ( c == null ) { c = getDefaultConverter ( ) ; } final Object instance = ctx . getEntityInstance ( ) ; ctx . setF...
public class NielsenConfigurationMarshaller { /** * Marshall the given parameter object . */ public void marshall ( NielsenConfiguration nielsenConfiguration , ProtocolMarshaller protocolMarshaller ) { } }
if ( nielsenConfiguration == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( nielsenConfiguration . getBreakoutCode ( ) , BREAKOUTCODE_BINDING ) ; protocolMarshaller . marshall ( nielsenConfiguration . getDistributorId ( ) , DISTRIBUTORID_BI...
public class CallServiceManager { /** * Build and send response messages after call request * @ param message * @ param client * @ return */ @ Override public boolean sendMessageToClient ( MessageFromClient message , Session client ) { } }
MessageToClient mtc = messageToClientService . createMessageToClient ( message , client ) ; if ( mtc != null ) { client . getAsyncRemote ( ) . sendObject ( mtc ) ; return true ; } return false ;
public class Path { /** * Normalizes a path string . * @ param path * the path string to normalize * @ return the normalized path string */ private String normalizePath ( String path ) { } }
// remove double slashes & backslashes path = path . replace ( "//" , "/" ) ; path = path . replace ( "\\" , "/" ) ; return path ;
public class SequenceEntryUtils { /** * Delete duplicated qualfiier . * @ param feature * the feature * @ param qualifierName * the qualifier name */ public static boolean deleteDuplicatedQualfiier ( Feature feature , String qualifierName ) { } }
ArrayList < Qualifier > qualifiers = ( ArrayList < Qualifier > ) feature . getQualifiers ( qualifierName ) ; Set < String > qualifierValueSet = new HashSet < String > ( ) ; for ( Qualifier qual : qualifiers ) { if ( qual . getValue ( ) != null ) { if ( ! qualifierValueSet . add ( qual . getValue ( ) ) ) { feature . rem...