signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CollectionUtils { /** * Samples with replacement from a collection * @ param c * The collection to be sampled from * @ param n * The number of samples to take * @ return a new collection with the sample */ public static < E > Collection < E > sampleWithReplacement ( Collection < E > c , int n ) {...
return sampleWithReplacement ( c , n , new Random ( ) ) ;
public class VirtualNetworkRulesInner { /** * Creates or updates an existing virtual network rule . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * ...
return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , serverName , virtualNetworkRuleName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ;
public class Diff { /** * Override the < code > MatchTracker < / code > used to track * successfully matched nodes . * @ param delegate the MatchTracker instance to delegate handling to . */ public void overrideMatchTracker ( MatchTracker delegate ) { } }
this . matchTrackerDelegate = delegate ; if ( differenceEngine != null ) { differenceEngine . setMatchTracker ( delegate ) ; }
public class DownloadManager { /** * region Messages */ @ Override public void onReceive ( Object message ) { } }
if ( message instanceof BindDownload ) { BindDownload requestDownload = ( BindDownload ) message ; bindDownload ( requestDownload . getFileReference ( ) , requestDownload . isAutostart ( ) , requestDownload . getCallback ( ) ) ; } else if ( message instanceof CancelDownload ) { CancelDownload cancelDownload = ( CancelD...
public class Java8CompositeHandler { /** * Returns handler that delegates update execution to | h | function . * Given function will be used only if executed statement is not detected * as a query by withQueryDetection . * @ param h the new update handler * < pre > * { @ code * import acolyte . jdbc . Updat...
final UpdateHandler uh = new UpdateHandler ( ) { public UpdateResult apply ( String sql , List < Parameter > ps ) { return new UpdateResult ( h . apply ( sql , ps ) ) ; } } ; return withUpdateHandler ( uh ) ;
public class ValidatorBuilderBigDecimal { /** * @ see # range ( Range ) * @ param min the minimum { @ link Collection # size ( ) size } allowed . * @ param max the maximum { @ link Collection # size ( ) size } allowed . * @ return this build instance for fluent API calls . */ public ValidatorBuilderBigDecimal < P...
return range ( new Range < > ( min , max ) ) ;
public class ChainedSMTPClientFutureListener { /** * Set the DeliveryStatus and notify the { @ link SMTPClientFuture } if needed * @ param session * @ throws SMTPException */ @ SuppressWarnings ( "unchecked" ) protected void setDeliveryStatus ( SMTPClientSession session ) throws SMTPException { } }
SMTPClientFutureImpl < Collection < FutureResult < Iterator < DeliveryRecipientStatus > > > > future = ( SMTPClientFutureImpl < Collection < FutureResult < Iterator < DeliveryRecipientStatus > > > > ) session . getAttribute ( FUTURE_KEY ) ; List < DeliveryRecipientStatus > statusList = ( List < DeliveryRecipientStatus ...
public class MessageMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Message message , ProtocolMarshaller protocolMarshaller ) { } }
if ( message == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( message . getMessageId ( ) , MESSAGEID_BINDING ) ; protocolMarshaller . marshall ( message . getPayload ( ) , PAYLOAD_BINDING ) ; } catch ( Exception e ) { throw new SdkClientEx...
public class DefaultDOManager { /** * Adds a minimal DC datastream if one isn ' t already present . * If there is already a DC datastream , ensure one of the dc : identifier * values is the PID of the object . */ private static void populateDC ( Context ctx , DigitalObject obj , DOWriter w , Date nowUTC ) throws IO...
logger . debug ( "Adding/Checking default DC datastream" ) ; Datastream dc = w . GetDatastream ( "DC" , null ) ; DCFields dcf ; XMLDatastreamProcessor dcxml = null ; if ( dc == null ) { dcxml = new XMLDatastreamProcessor ( "DC" ) ; dc = dcxml . getDatastream ( ) ; // dc . DSMDClass = DatastreamXMLMetadata . DESCRIPTIVE...
public class Supplier { /** * The predefined Supplier selects all values and does not perform any kind of data * transformation . Input value types need to match the aggregations expected value * type to make this Supplier work . * @ param < KeyIn > the input key type * @ param < ValueIn > the input value type ...
return new AcceptAllSupplier ( null ) ;
public class FileLogOutput { /** * Reserve space in the log file . * We don ' t have to account for sector bytes because those were reserved at startup . * @ param reservedDelta the change to the number of reserved bytes if this write is successful . * @ throws ObjectManagerException */ protected void reserve ( l...
if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "reserve" , new Object [ ] { new Long ( reservedDelta ) } ) ; long unavailable = reserveLogFileSpace ( reservedDelta ) ; if ( unavailable != 0 ) { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) )...
public class Sneaky { /** * Wrap a { @ link CheckedToIntFunction } in a { @ link ToIntFunction } . * Example : * < code > < pre > * map . computeIfAbsent ( " key " , Unchecked . toIntFunction ( k - > { * if ( k . length ( ) > 10) * throw new Exception ( " Only short strings allowed " ) ; * return 42; * < ...
return Unchecked . toIntFunction ( function , Unchecked . RETHROW_ALL ) ;
public class EndpointBuilder { /** * { @ inheritDoc } */ @ Override public Endpoint buildObject ( ) { } }
return new EndpointImpl ( Endpoint . DEFAULT_ELEMENT_NAME . getNamespaceURI ( ) , Endpoint . DEFAULT_ELEMENT_LOCAL_NAME , Endpoint . DEFAULT_ELEMENT_NAME . getPrefix ( ) ) ;
public class DefaultPlaceholderConnector { /** * 是否包含占位符 * @ param format 格式化 * @ return 是否包含 */ private boolean isContainsPlaceholder ( final String format ) { } }
if ( StringUtil . isEmpty ( format ) ) { return false ; } return format . contains ( PlaceholderConstant . PLACEHOLDER ) ;
public class HolderRapiFields { /** * < p > Get thing for given class and thing name . < / p > * @ param pClass a Class * @ param pFieldName Thing Name * @ return a thing */ @ Override public final Field getFor ( final Class < ? > pClass , final String pFieldName ) { } }
Map < String , Field > fldMap = this . rapiFieldsMap . get ( pClass ) ; if ( fldMap == null ) { // There is no way to get from Map partially initialized bean // in this double - checked locking implementation // cause putting to the Map fully initialized bean synchronized ( this . rapiFieldsMap ) { fldMap = this . rapi...
public class ModbusClient { /** * 子设备 */ public DeviceResponse createDevice ( CreateDevice request ) { } }
InternalRequest internalRequest = createRequest ( request , HttpMethodName . POST , DEVICE ) ; return this . invokeHttpClient ( internalRequest , DeviceResponse . class ) ;
public class EvaluationErrorPrinter { /** * Auxiliary method to print tag errors * @ param filteredDoc * the document tokens which were tagged wrong * @ param filteredRefs * the reference tags * @ param filteredPreds * the predicted tags */ private void printErrors ( final List < String > filteredDoc , fina...
this . printStream . println ( "Errors: {" ) ; this . printStream . println ( "Tok: Ref | Pred" ) ; this . printStream . println ( "---------------" ) ; for ( int i = 0 ; i < filteredDoc . size ( ) ; i ++ ) { this . printStream . println ( filteredDoc . get ( i ) + ": " + filteredRefs . get ( i ) + " | " + filteredPred...
public class ReflectUtil { /** * 按照方法名查找指定方法名的方法 , 只返回匹配到的第一个方法 , 如果找不到对应的方法则返回 < code > null < / code > * 此方法只检查方法名是否一致 , 并不检查参数的一致性 。 * @ param clazz 类 , 如果为 { @ code null } 返回 { @ code null } * @ param ignoreCase 是否忽略大小写 * @ param methodName 方法名 , 如果为空字符串返回 { @ code null } * @ return 方法 * @ throws Securi...
if ( null == clazz || StrUtil . isBlank ( methodName ) ) { return null ; } final Method [ ] methods = getMethods ( clazz ) ; if ( ArrayUtil . isNotEmpty ( methods ) ) { for ( Method method : methods ) { if ( StrUtil . equals ( methodName , method . getName ( ) , ignoreCase ) ) { return method ; } } } return null ;
public class SSLReadServiceContext { /** * Handle common activity of read and readAsynch involving the decryption of the * current buffers . The caller will have the responsibility of informing the app * side channels once complete . * @ param async if called from an async read ( true ) or sync read ( false ) *...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "decryptMessage" ) ; } Exception exception = null ; // Storage for the result of calling the SSL engine SSLEngineResult result = null ; // Status of the SSL engine . Status status = null ; // Access output buffer to give to S...
public class Event { /** * indexed setter for themes _ event - sets an indexed value - * @ generated * @ param i index in the array to set * @ param v value to set into the array */ public void setThemes_event ( int i , Event v ) { } }
if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_themes_event == null ) jcasType . jcas . throwFeatMissing ( "themes_event" , "ch.epfl.bbp.uima.genia.Event" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_themes_event ) ,...
public class Node { /** * Get the subscriptions currently associated with this node . * { @ code additionalExtensions } can be used e . g . to add a " Result Set Management " extension . * { @ code returnedExtensions } will be filled with the stanza extensions found in the answer . * @ param additionalExtensions ...
return getSubscriptions ( SubscriptionsNamespace . basic , additionalExtensions , returnedExtensions ) ;
public class Directory { /** * Sets a < code > java . util . Date < / code > value for the specified tag . * @ param tagType the tag ' s value as an int * @ param value the value for the specified tag as a java . util . Date */ public void setDate ( int tagType , @ NotNull java . util . Date value ) { } }
setObject ( tagType , value ) ;
public class JobStreamsInner { /** * Retrieve the job stream identified by job stream id . * @ param resourceGroupName Name of an Azure Resource group . * @ param automationAccountName The name of the automation account . * @ param jobId The job id . * @ param jobStreamId The job stream id . * @ throws Illega...
return getWithServiceResponseAsync ( resourceGroupName , automationAccountName , jobId , jobStreamId ) . toBlocking ( ) . single ( ) . body ( ) ;
public class SocialAuthenticationFilter { /** * The URL to redirect to if authentication fails or if authorization is denied by the user . * @ param postFailureUrl The failure URL . Defaults to " / signin " ( relative to the servlet context ) . */ public void setPostFailureUrl ( String postFailureUrl ) { } }
AuthenticationFailureHandler failureHandler = getFailureHandler ( ) ; if ( failureHandler instanceof SocialAuthenticationFailureHandler ) { failureHandler = ( ( SocialAuthenticationFailureHandler ) failureHandler ) . getDelegate ( ) ; } if ( failureHandler instanceof SimpleUrlAuthenticationFailureHandler ) { SimpleUrlA...
public class AbstractSingleGateway { /** * 调用命令 * @ param request * @ param response * @ return */ @ RequestMapping ( value = "/invoke" , method = { } }
RequestMethod . POST } ) @ ResponseBody public ResponseMessage invoke ( HttpServletRequest request , HttpServletResponse response ) { ResponseMessage res = new ResponseMessage ( ) ; try { JSONObject json = tgtools . web . util . RequestHelper . parseRequest ( request ) ; ValidMessage rm = ( ValidMessage ) tgtools . uti...
public class PrimaveraReader { /** * Process resources . * @ param rows resource data */ public void processResources ( List < Row > rows ) { } }
for ( Row row : rows ) { Resource resource = m_project . addResource ( ) ; processFields ( m_resourceFields , row , resource ) ; resource . setResourceCalendar ( getResourceCalendar ( row . getInteger ( "clndr_id" ) ) ) ; // Even though we ' re not filling in a rate , filling in a time unit can still be useful // so th...
public class SecurityAccessControl { /** * / * ( non - Javadoc ) * @ see nyla . solutions . core . security . data . AccessControl # addPermissions ( java . util . Collection ) */ @ Override public void addPermissions ( Collection < Permission > aPermssions ) { } }
if ( aPermssions == null ) throw new IllegalArgumentException ( "aPermssions required in SecurityAccessControl" ) ; // SecurityPermission element = null ; for ( Iterator < Permission > i = aPermssions . iterator ( ) ; i . hasNext ( ) ; ) { addPermission ( ( SecurityPermission ) i . next ( ) ) ; }
public class Transaction { /** * Returns the witness transaction id ( aka witness id ) as per BIP144 . For transactions without witness , this is the * same as { @ link # getTxId ( ) } . */ public Sha256Hash getWTxId ( ) { } }
if ( cachedWTxId == null ) { if ( ! hasWitnesses ( ) && cachedTxId != null ) { cachedWTxId = cachedTxId ; } else { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; try { bitcoinSerializeToStream ( baos , hasWitnesses ( ) ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; // cannot happen } c...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link WaterClosureSurfaceType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link WaterClosureSurfaceType ...
return new JAXBElement < WaterClosureSurfaceType > ( _WaterClosureSurface_QNAME , WaterClosureSurfaceType . class , null , value ) ;
public class DefaultNodeExtension { /** * otherwise , if not overridden , use current node ' s codebase version */ private Version getClusterOrNodeVersion ( ) { } }
if ( node . getClusterService ( ) != null && ! node . getClusterService ( ) . getClusterVersion ( ) . isUnknown ( ) ) { return node . getClusterService ( ) . getClusterVersion ( ) ; } else { String overriddenClusterVersion = node . getProperties ( ) . getString ( GroupProperty . INIT_CLUSTER_VERSION ) ; return ( overri...
public class LogPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getPasswordReset ( ) { } }
if ( passwordResetEClass == null ) { passwordResetEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( LogPackage . eNS_URI ) . getEClassifiers ( ) . get ( 19 ) ; } return passwordResetEClass ;
public class AbucoinsTradeServiceRaw { /** * Corresponds to < code > POST orders < / delete > * @ return * @ throws IOException */ public AbucoinsCreateOrderResponse createAbucoinsOrder ( AbucoinsBaseCreateOrderRequest req ) throws IOException { } }
AbucoinsCreateOrderResponse resp = abucoinsAuthenticated . createOrder ( exchange . getExchangeSpecification ( ) . getApiKey ( ) , signatureCreator , exchange . getExchangeSpecification ( ) . getPassword ( ) , timestamp ( ) , req ) ; if ( resp . getMessage ( ) != null ) throw new ExchangeException ( resp . getMessage (...
public class DatabaseProperties { /** * Saves the key value pair to the properties store . * @ param key the property key * @ param value the property value * @ throws UpdateException is thrown if there is an update exception */ public synchronized void save ( String key , String value ) throws UpdateException { ...
properties . put ( key , value ) ; cveDB . saveProperty ( key , value ) ;
public class SingleValueAssignExtension { /** * Assigns one variable to one value * @ param action an Assign Action * @ param possibleStateList a current list of possible states produced so far from expanding a model state * @ return the same list , with every possible state augmented with an assigned variable , ...
for ( Map < String , String > possibleState : possibleStateList ) { possibleState . put ( action . getName ( ) , action . getExpr ( ) ) ; } return possibleStateList ;
public class TypeCache { /** * Inserts a new type into the cache . If a type with the same class loader and key was inserted previously , the cache is not updated . * @ param classLoader The class loader for which this type is stored . * @ param key The key for the type in question . * @ param type The type to in...
ConcurrentMap < T , Reference < Class < ? > > > storage = cache . get ( new LookupKey ( classLoader ) ) ; if ( storage == null ) { storage = new ConcurrentHashMap < T , Reference < Class < ? > > > ( ) ; ConcurrentMap < T , Reference < Class < ? > > > previous = cache . putIfAbsent ( new StorageKey ( classLoader , this ...
public class Round { /** * < p > Static factory method that creates a round from the * given < tt > identifier < / tt > . < / p > * @ param identifier Round id to use . * @ param cookie Cookie value to use for retrieving contest . * @ return Created round . * @ throws IOException If any error occurs while ret...
final StringBuilder builder = new StringBuilder ( ) ; builder . append ( CODEJAM_PATH ) . append ( identifier ) . append ( ROUND_PREFIX ) ; return fromURL ( builder . toString ( ) , cookie ) ;
public class CrossAppClient { /** * Delete blacklist whose users belong to another app from a given user . * @ param username The owner of the blacklist * @ param blacklists CrossBlacklist array * @ return No content * @ throws APIConnectionException connect exception * @ throws APIRequestException request ex...
StringUtils . checkUsername ( username ) ; CrossBlacklistPayload payload = new CrossBlacklistPayload . Builder ( ) . setCrossBlacklists ( blacklists ) . build ( ) ; return _httpClient . sendDelete ( _baseUrl + crossUserPath + "/" + username + "/blacklist" , payload . toString ( ) ) ;
public class TelnetConnection { /** * Handle option parameters call back . The implementation will try to find a matching option * via the { @ code Option # values ( ) } and invoke it ' s { @ link Option # handleParameters ( TelnetConnection , byte [ ] ) } method . * This method can be subclassed to handle an optio...
for ( Option option : Option . values ( ) ) { if ( option . code == optionCode ) { option . handleParameters ( this , parameters ) ; return ; } }
public class CommerceWishListUtil { /** * Returns the commerce wish list with the primary key or throws a { @ link NoSuchWishListException } if it could not be found . * @ param commerceWishListId the primary key of the commerce wish list * @ return the commerce wish list * @ throws NoSuchWishListException if a c...
return getPersistence ( ) . findByPrimaryKey ( commerceWishListId ) ;
public class HtmlSource { /** * Initialize class fields . */ public void init ( Reader reader , Record record , SaxHtmlHandler handler ) { } }
m_handler = null ; m_handler = handler ; super . init ( reader , record ) ;
public class QRColPivDecompositionHouseholderColumn_DDRM { /** * Performs an efficient update of each columns ' norm */ protected void updateNorms ( int j ) { } }
boolean foundNegative = false ; for ( int col = j ; col < numCols ; col ++ ) { double e = dataQR [ col ] [ j - 1 ] ; double v = normsCol [ col ] -= e * e ; if ( v < 0 ) { foundNegative = true ; break ; } } // if a negative sum has been found then clearly too much precision has been lost // and it should recompute the c...
public class MailSessionService { /** * The createResource uses the sessionProperties to create a javax . mail . Session * object and return it to the caller . The caller uses JNDI look up with the * JNDI name defined in the server . xml . */ @ Override public Object createResource ( ResourceInfo info ) throws Exce...
Properties propertyNames = createPropertyNames ( ) ; Properties props = createProperties ( propertyNames ) ; // The listOfPropMap is how the nested properties ( name , value pairs ) are // pulled from the Nester class . This iterates the map and stores them in the // props object if ( listOfPropMap != null ) { for ( Ma...
public class WsFrameEncodingSupport { /** * Encode a WebSocket opcode onto a byte that might have some high bits set . * @ param b * @ param message * @ return */ private static byte doEncodeOpcode ( byte b , WsMessage message ) { } }
Kind kind = message . getKind ( ) ; switch ( kind ) { case CONTINUATION : b |= Opcode . CONTINUATION . getCode ( ) ; break ; case TEXT : { b |= Opcode . TEXT . getCode ( ) ; break ; } case BINARY : { b |= Opcode . BINARY . getCode ( ) ; break ; } case PING : { b |= Opcode . PING . getCode ( ) ; break ; } case PONG : { ...
public class MultisetUtils { /** * An ordering of { @ link Multiset } elements by descending order of count , with ties broken * according to the supplied { @ code itemComparator } . */ public static < E > Ordering < Multiset . Entry < E > > byCountDescendingThenItemAscendingOrdering ( Comparator < ? super E > itemCo...
final Ordering < Multiset . Entry < E > > byCount = byCountOrdering ( ) ; final Ordering < Multiset . Entry < E > > byCountReversed = byCount . reverse ( ) ; final Ordering < Multiset . Entry < E > > byElement = byElementOrdering ( itemComparator ) ; return byCountReversed . compound ( byElement ) ;
public class CommerceNotificationAttachmentLocalServiceUtil { /** * Returns the commerce notification attachment matching the UUID and group . * @ param uuid the commerce notification attachment ' s UUID * @ param groupId the primary key of the group * @ return the matching commerce notification attachment , or <...
return getService ( ) . fetchCommerceNotificationAttachmentByUuidAndGroupId ( uuid , groupId ) ;
public class ElementMatchers { /** * Exactly matches a given field as a { @ link FieldDescription } in its defined shape . * @ param field The field to match by its description * @ param < T > The type of the matched object . * @ return An element matcher that exactly matches the given field in its defined shape ...
return is ( new FieldDescription . ForLoadedField ( field ) ) ;
public class CommandLine { /** * Sets whether the value of boolean flag options should be " toggled " when the option is matched . The default is { @ code true } . * < p > The specified setting will be registered with this { @ code CommandLine } and the full hierarchy of its * subcommands and nested sub - subcomman...
getCommandSpec ( ) . parser ( ) . toggleBooleanFlags ( newValue ) ; for ( CommandLine command : getCommandSpec ( ) . subcommands ( ) . values ( ) ) { command . setToggleBooleanFlags ( newValue ) ; } return this ;
public class DynamicByteArray { /** * Read the entire stream into this array . * @ param in the stream to read from * @ throws IOException */ public void readAll ( InputStream in ) throws IOException { } }
int read = 0 ; do { grow ( length ) ; read = data . setBytes ( length , in , data . length ( ) - length ) ; if ( read > 0 ) { length += read ; } } while ( in . available ( ) > 0 ) ;
public class PdfCell { /** * Calculates what the height of the first line should be so that the content will be * flush with the top . For text , this is the height of the ascender . For an image , * it is the actual height of the image . * @ return the real height of the first line */ private float firstLineReal...
float firstLineRealHeight = 0f ; if ( firstLine != null ) { PdfChunk chunk = firstLine . getChunk ( 0 ) ; if ( chunk != null ) { Image image = chunk . getImage ( ) ; if ( image != null ) { firstLineRealHeight = firstLine . getChunk ( 0 ) . getImage ( ) . getScaledHeight ( ) ; } else { firstLineRealHeight = useAscender ...
public class FacebookRestClient { /** * Publishes a Mini - Feed story describing an action taken by the logged - in user , and * publishes aggregating News Feed stories to their friends . * Stories are identified as being combinable if they have matching templates and substituted values . * @ param titleTemplate ...
return feed_publishTemplatizedAction ( titleTemplate , null , null , null , null , null , null , /* pageActorId */ null ) ;
public class CacheEntry { /** * Compare the time . * @ param other other entry to compare to * @ return results */ private int compareToLRU ( CacheEntry other ) { } }
int cmp = compareTime ( other ) ; if ( cmp != 0 ) { return cmp ; } cmp = compareOrder ( other ) ; if ( cmp != 0 ) { return cmp ; } return compareReadCount ( other ) ;
public class ChangesHolder { /** * { @ inheritDoc } */ public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { } }
int length = in . readInt ( ) ; this . remove = new ArrayList < String > ( length ) ; for ( int i = 0 ; i < length ; i ++ ) { remove . add ( in . readUTF ( ) ) ; } this . add = new LinkedList < Document > ( ) ; while ( in . readBoolean ( ) ) { Document doc = new Document ( ) ; doc . setBoost ( in . readFloat ( ) ) ; in...
public class MaterialSuggestionOracle { /** * Autocomplete with Image item selection . */ public void add ( String text , Image image ) { } }
this . imageElem = image . getElement ( ) . toString ( ) ; add ( text + image ) ;
public class JsJmsMapMessageImpl { /** * Helper method used by the JMO to rewrite any transient data back into the * underlying JMF message . * @ param why The reason for the update * @ see com . ibm . ws . sib . mfp . MfpConstants */ void updateDataFields ( int why ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "updateDataFields" ) ; super . updateDataFields ( why ) ; if ( bodyMap != null && bodyMap . isChanged ( ) ) { getPayload ( ) . setField ( JmsMapBodyAccess . BODY_DATA_ENTRY_NAME , bodyMap . getKeyList ( ) ) ; getPaylo...
public class ApiOvhOrder { /** * Get allowed durations for ' account ' option * REST : GET / order / email / exchange / { organizationName } / service / { exchangeService } / account * @ param storageQuota [ required ] The storage quota for the account ( s ) in GB ( default = 50) * @ param number [ required ] Num...
String qPath = "/order/email/exchange/{organizationName}/service/{exchangeService}/account" ; StringBuilder sb = path ( qPath , organizationName , exchangeService ) ; query ( sb , "licence" , licence ) ; query ( sb , "number" , number ) ; query ( sb , "storageQuota" , storageQuota ) ; String resp = exec ( qPath , "GET"...
public class VideoSampleActivity { /** * Initialize the Activity with some injected data . */ @ Override protected void onCreate ( Bundle savedInstanceState ) { } }
super . onCreate ( savedInstanceState ) ; setContentView ( R . layout . activity_video_sample ) ; ButterKnife . inject ( this ) ; initializeVideoView ( ) ; initializePoster ( ) ; hookDraggableViewListener ( ) ;
public class AppServiceEnvironmentsInner { /** * Get properties of a worker pool . * Get properties of a worker pool . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the App Service Environment . * @ param workerPoolName Name of the worker pool . ...
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( name == null ) { throw new IllegalArgumentException ( "Parameter name is required and cannot be null." ) ; } if ( workerPoolName == null ) { throw new IllegalArgumentException...
public class Assembler { /** * Branch always * @ param target * @ throws IOException */ public void goto_n ( String target ) throws IOException { } }
if ( wideIndex ) { goto_w ( target ) ; } else { boolean ok = optimizeGoto ( target ) ; if ( ! ok ) { Branch branch = createBranch ( target ) ; int addr = branch . getLabel ( ) . getAddress ( ) ; if ( addr != - 1 ) { int offset = addr - ( position ( ) ) ; if ( offset < Short . MIN_VALUE || offset > Short . MAX_VALUE ) {...
public class JournalConsumer { /** * Reject API calls from outside while we are in recovery mode . */ public Date modifyDatastreamByReference ( Context context , String pid , String datastreamID , String [ ] altIDs , String dsLabel , String mimeType , String formatURI , String dsLocation , String checksumType , String ...
throw rejectCallsFromOutsideWhileInRecoveryMode ( ) ;
public class DatalogNormalizer { /** * Adds a trivial equality to a LeftJoin in case the left join doesn ' t have * at least one boolean condition . This is necessary to have syntactically * correct LeftJoins in SQL . */ public void addMinimalEqualityToLeftOrNestedInnerJoin ( CQIE query ) { } }
for ( Function f : query . getBody ( ) ) { if ( f . isAlgebraFunction ( ) ) { addMinimalEqualityToLeftOrNestedInnerJoin ( f ) ; } }
public class RePairFactory { /** * Builds a grammar given a string of terminals delimeted by space . * @ param inputString the input string . * @ return the RePair grammar . */ public static RePairGrammar buildGrammar ( String inputString ) { } }
RePairGrammar grammar = NewRepair . parse ( inputString ) ; return grammar ;
public class EditableResourceBundleSet { /** * The constructor of EditableResourceBundle adds itself here . */ void addBundle ( EditableResourceBundle bundle ) { } }
Locale locale = bundle . getBundleLocale ( ) ; if ( ! locales . contains ( locale ) ) throw new AssertionError ( "locale not in locales: " + locale ) ; bundles . put ( locale , bundle ) ;
public class CommsByteBuffer { /** * This method returns a < String , String > Map object built from the recived transmission buffer */ public Map < String , String > getMap ( ) { } }
// SIB0163 . comms . 1 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getMap" ) ; final short len = getShort ( ) ; final Map < String , String > rc = new HashMap < String , String > ( ) ; for ( int i = 0 ; i < len ; i ++ ) { rc . put ( getString ( ) , getString (...
public class Smushing { /** * Add a char to another char using { @ link FigletFont # smushingRulesToApply } where applicable . * @ param figletFont Font details * @ param char1 Message so far * @ param char2 Char to add * @ return Array ( lines ) of char arrays */ private static char [ ] [ ] addChar ( FigletFon...
char [ ] [ ] result = new char [ figletFont . height ] [ ] ; int overlay = calculateOverlay ( figletFont , char1 , char2 ) ; for ( int l = 0 ; l < figletFont . height ; l ++ ) { if ( char1 [ l ] == null ) { char1 [ l ] = new char [ 0 ] ; } char [ ] cs1 = char1 [ l ] ; char [ ] cs2 = char2 [ l ] ; int char1Length = cs1 ...
public class CodeGenerator { /** * generate < code > readFrom < / code > method source code * @ return */ private String getReadFromMethodCode ( ) { } }
StringBuilder code = new StringBuilder ( ) ; code . append ( "public " ) . append ( ClassHelper . getInternalName ( cls . getCanonicalName ( ) ) ) . append ( " readFrom(CodedInputStream input) throws IOException {" ) . append ( LINE_BREAK ) ; getParseBytesMethodCode ( code ) ; return code . toString ( ) ;
public class CssImageUrlRewriter { /** * Sets the context path * @ param contextPath * the contextPath to set */ public void setContextPath ( String contextPath ) { } }
if ( StringUtils . isNotEmpty ( contextPath ) ) { if ( contextPath . charAt ( 0 ) != '/' ) { contextPath = '/' + contextPath ; } if ( contextPath . charAt ( contextPath . length ( ) - 1 ) != '/' ) { contextPath = contextPath + '/' ; } this . contextPath = contextPath ; } else { this . contextPath = null ; }
public class RecordDetail { /** * The errors that occurred . * @ param recordErrors * The errors that occurred . */ public void setRecordErrors ( java . util . Collection < RecordError > recordErrors ) { } }
if ( recordErrors == null ) { this . recordErrors = null ; return ; } this . recordErrors = new java . util . ArrayList < RecordError > ( recordErrors ) ;
public class OperaWebElement { /** * Click the middle mouse button at the top left corner of the element . * Will not verify whether element is available for interaction first . * @ deprecated */ @ Deprecated @ SuppressWarnings ( "unused" ) public void middleClick ( ) { } }
// TODO ( andreastt ) : Add this to Actions Point point = coordinates . inViewPort ( ) ; exec . mouseAction ( point . x , point . y , OperaMouseKeys . MIDDLE ) ;
public class BasicImpl { /** * If not already created , a new < code > column < / code > element with the given value will be created . * Otherwise , the existing < code > column < / code > element will be returned . * @ return a new or existing instance of < code > Column < Basic < T > > < / code > */ public Colum...
Node node = childNode . getOrCreate ( "column" ) ; Column < Basic < T > > column = new ColumnImpl < Basic < T > > ( this , "column" , childNode , node ) ; return column ;
public class BasicKiller { /** * { @ inheritDoc } * This implementation uses { @ link Set # removeAll ( Collection ) } to remove the selected * organisms from the population . The new population will be returned * @ param arguments { @ inheritDoc } * @ param population { @ inheritDoc } * @ param selected { @ ...
Set < O > organisms = new HashSet < > ( population . getAll ( ) ) ; organisms . removeAll ( selected ) ; return new Population . Default < > ( organisms ) ;
public class TileManager { /** * Returns the tileset with the specified name . * @ throws NoSuchTileSetException if no tileset with the specified name is available via our * configured tile set repository . */ public TileSet getTileSet ( String name ) throws NoSuchTileSetException { } }
// make sure we have a repository configured if ( _setrep == null ) { throw new NoSuchTileSetException ( name ) ; } try { return _setrep . getTileSet ( name ) ; } catch ( PersistenceException pe ) { log . warning ( "Failure loading tileset" , "name" , name , "error" , pe ) ; throw new NoSuchTileSetException ( name ) ; ...
public class MonitoringAspect { /** * Common class profiling entry - point . * @ param pjp * { @ link ProceedingJoinPoint } * @ param monitor * { @ link Monitor } * @ return call result * @ throws Throwable * in case of error during { @ link ProceedingJoinPoint # proceed ( ) } */ @ Around ( value = "execu...
return doProfiling ( pjp , monitor . producerId ( ) , monitor . subsystem ( ) , monitor . category ( ) ) ;
public class ListBulkDeploymentDetailedReportsResult { /** * A list of the individual group deployments in the bulk deployment operation . * @ param deployments * A list of the individual group deployments in the bulk deployment operation . */ public void setDeployments ( java . util . Collection < BulkDeploymentRe...
if ( deployments == null ) { this . deployments = null ; return ; } this . deployments = new java . util . ArrayList < BulkDeploymentResult > ( deployments ) ;
public class ClientUtils { /** * Used for debugging * @ param instream * @ return */ protected String writeInputStreamAsString ( InputStream instream ) { } }
String value = null ; try { value = IOUtils . toString ( instream , "UTF-8" ) ; System . out . println ( value ) ; } catch ( IOException ioe ) { // Do nothing } return value ;
public class JobsInner { /** * Terminates a job . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param workspaceName The name of the workspace . Workspace names can only contain a combination of alphanumeric characters along with dash ( - ) and underscore ( _ ) . The name...
return terminateWithServiceResponseAsync ( resourceGroupName , workspaceName , experimentName , jobName ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class XBELValidatingConverter { /** * { @ inheritDoc } */ @ Override public XBELDocument unmarshal ( File f ) throws JAXBException , IOException { } }
try { validator . validate ( f ) ; } catch ( SAXException e ) { throw new JAXBException ( e ) ; } return super . unmarshal ( f ) ;
public class CPOptionValuePersistenceImpl { /** * Returns the cp option value where uuid = & # 63 ; and groupId = & # 63 ; or returns < code > null < / code > if it could not be found . Uses the finder cache . * @ param uuid the uuid * @ param groupId the group ID * @ return the matching cp option value , or < co...
return fetchByUUID_G ( uuid , groupId , true ) ;
public class LittleEndianDataInputStream { /** * Reads a four byte signed { @ code int } from the underlying * input stream in little endian order , low byte first . * @ return the { @ code int } read . * @ throws EOFException if the end of the underlying input stream * has been reached * @ throws IOException...
int byte1 = in . read ( ) ; int byte2 = in . read ( ) ; int byte3 = in . read ( ) ; int byte4 = in . read ( ) ; if ( byte4 < 0 ) { throw new EOFException ( ) ; } return ( byte4 << 24 ) | ( ( byte3 << 24 ) >>> 8 ) | ( ( byte2 << 24 ) >>> 16 ) | ( ( byte1 << 24 ) >>> 24 ) ;
public class MtasSolrSearchComponent { /** * ( non - Javadoc ) * @ see * org . apache . solr . handler . component . SearchComponent # distributedProcess ( org . * apache . solr . handler . component . ResponseBuilder ) */ @ Override public int distributedProcess ( ResponseBuilder rb ) throws IOException { } }
// System . out . println ( System . nanoTime ( ) + " - " // + Thread . currentThread ( ) . getId ( ) + " - " // + rb . req . getParams ( ) . getBool ( ShardParams . IS _ SHARD , false ) // + " DISTIRBUTEDPROCESS " + rb . stage + " " + rb . req . getParamString ( ) ) ; MtasSolrStatus solrStatus = Objects . requireNonNu...
public class JDBCWorkspaceDataContainer { /** * { @ inheritDoc } */ public boolean isSame ( WorkspaceDataContainer another ) { } }
if ( another == this ) { return true ; } if ( another instanceof JDBCWorkspaceDataContainer ) { JDBCWorkspaceDataContainer anotherJdbc = ( JDBCWorkspaceDataContainer ) another ; return getDbSourceName ( ) . equals ( anotherJdbc . getDbSourceName ( ) ) ; } return false ;
public class DiagnosticsInner { /** * List Hosting Environment Detector Responses . * List Hosting Environment Detector Responses . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return th...
return listHostingEnvironmentDetectorResponsesNextSinglePageAsync ( nextPageLink ) . concatMap ( new Func1 < ServiceResponse < Page < DetectorResponseInner > > , Observable < ServiceResponse < Page < DetectorResponseInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < DetectorResponseInner > > > ...
public class ListByteMatchSetsResult { /** * An array of < a > ByteMatchSetSummary < / a > objects . * @ param byteMatchSets * An array of < a > ByteMatchSetSummary < / a > objects . */ public void setByteMatchSets ( java . util . Collection < ByteMatchSetSummary > byteMatchSets ) { } }
if ( byteMatchSets == null ) { this . byteMatchSets = null ; return ; } this . byteMatchSets = new java . util . ArrayList < ByteMatchSetSummary > ( byteMatchSets ) ;
public class HtmlOutcomeTargetLink { /** * < p > Set the value of the < code > charset < / code > property . < / p > */ public void setCharset ( java . lang . String charset ) { } }
getStateHelper ( ) . put ( PropertyKeys . charset , charset ) ; handleAttribute ( "charset" , charset ) ;
public class OverviewMap { /** * Determine whether or not a rectangle that shows the target map ' s maximum extent should be shown . * @ param drawTargetMaxExtent * should the max extent be marked on the map ? * @ since 1.8.0 */ @ Api public void setDrawTargetMaxExtent ( boolean drawTargetMaxExtent ) { } }
this . drawTargetMaxExtent = drawTargetMaxExtent ; // Immediately draw or remove the max extent rectangle : if ( drawTargetMaxExtent ) { targetMaxExtentRectangle = new GfxGeometry ( "targetMaxExtentRectangle" ) ; targetMaxExtentRectangle . setStyle ( targetMaxExtentRectangleStyle ) ; Bbox targetMaxExtent = getOverviewM...
public class Builder { /** * Ends this builder and returns a Body . Checks about the closing * tags throwing and { @ link IllegalStateException } if there are any pending . * The HTML version gets the < em > body < / em > and < em > html < / em > closing tags * and both receive a final new line . * @ return the...
if ( ! ends . isEmpty ( ) ) throw new IllegalStateException ( "Pending some closing. Some end() missing. ends=" + ends ) ; html . a ( POST_HTML ) ; return new Body ( html , text ) ;
public class AggregationResource { /** * / * ( non - Javadoc ) * @ see com . ibm . jaggr . core . resource . IResource # lastModified ( ) */ @ Override public long lastModified ( ) { } }
// return the latest of each of the resources in this aggregated // resource long result = - 1 ; for ( IResource resource : resources ) { result = Math . max ( result , resource . lastModified ( ) ) ; } return result ;
public class SchedulerUtils { /** * Curl a package , extract it to working directory * @ param workingDirectory the working directory to setup * @ param packageURI the URL of core release package * @ param packageDestination the destination of the core release package fetched * @ param isDeletePackage delete th...
// curl the package to the working directory and extract it LOG . log ( Level . FINE , "Fetching package {0}" , packageURI ) ; LOG . fine ( "Fetched package can overwrite old one." ) ; if ( ! ShellUtils . curlPackage ( packageURI , packageDestination , isVerbose , false ) ) { LOG . severe ( "Failed to fetch package." )...
public class HistoryTable { /** * Updates the selection in the table whenever the current { @ link Change } * in the { @ link History } changes . * @ param currentChange the property which contains the current { @ link Change } * in the { @ link History } */ void addSelectionBinding ( ReadOnlyObjectProperty < Cha...
currentChange . addListener ( ( observable , oldValue , newValue ) -> getSelectionModel ( ) . select ( newValue ) ) ;
public class Event { /** * Sets the repository . * @ param repository * the new repository */ public void setRepository ( String repository ) { } }
if ( meta == null ) { meta = new EventMeta ( ) ; } meta . setRepository ( repository ) ;
public class MapReader { /** * Define the output data object . The output data object is the kind of result that the reader * will give . This can be for example : * < ul > * < li > when you need to elaborate the data , a double matrix , so the odo would be < b > new * double [ ] [ ] < / b > < / li > * < li >...
dataObject = outputDataObject ; if ( outputDataObject instanceof Vector ) { if ( ( ( Vector ) outputDataObject ) . capacity ( ) == 0 ) dataObject = new Vector ( ) ; }
public class LongTuples { /** * Compute the < i > element - wise < / i > minimum of the the given input * tuples , and store the result in the given * result tuple . * @ param t0 The first input tuple * @ param t1 The second input tuple * @ param result The tuple that will store the result * @ return The re...
return LongTupleFunctions . apply ( t0 , t1 , Math :: min , result ) ;
public class Determinize { /** * residual primitive weight early in the path ) */ private void expandDeferredFinalStates ( Deque < DetElement > finalQueue ) { } }
HashBiMap < Integer , GallicWeight > outputStateIdToFinalSuffix = HashBiMap . create ( ) ; while ( ! finalQueue . isEmpty ( ) ) { DetElement element = finalQueue . removeFirst ( ) ; for ( GallicWeight gallicWeight : element . residual . getWeights ( ) ) { // factorization is like a simple version of the divisor / divid...
public class UserServiceImpl { /** * { @ inheritDoc } * 安全考虑 , password 属性为 null 。 < / p > */ public User get ( int id ) { } }
Connection conn = null ; User user = null ; try { conn = ConnectionUtils . getConnection ( ) ; user = userDAO . get ( conn , id ) ; } catch ( SQLException e ) { logger . error ( e . getMessage ( ) ) ; } finally { DbUtils . closeQuietly ( conn ) ; } return user ;
public class MessageBuilder { /** * Removes all mentions and replaces them with the closest looking textual representation . * < p > Use this over { @ link # stripMentions ( Guild ) } if { @ link net . dv8tion . jda . core . entities . User User } mentions * should be replaced with their { @ link net . dv8tion . jd...
// Note : Users can rename to " everyone " or " here " , so those // should be stripped after the USER mention is stripped . return this . stripMentions ( jda , null , Message . MentionType . values ( ) ) ;
public class AbstractDataIndexer { /** * Sorts and uniques the array of comparable events . This method * will alter the eventsToCompare array - - it does an in place * sort , followed by an in place edit to remove duplicates . * @ param eventsToCompare a < code > ComparableEvent [ ] < / code > value * @ since ...
Collections . sort ( eventsToCompare ) ; int numEvents = eventsToCompare . size ( ) ; int numUniqueEvents = 1 ; // assertion : eventsToCompare . length > = 1 if ( numEvents <= 1 ) { return ; // nothing to do ; edge case ( see assertion ) } ComparableEvent ce = ( ComparableEvent ) eventsToCompare . get ( 0 ) ; for ( int...
public class OneShotSQLGeneratorEngine { /** * Returns a string with boolean conditions formed with the boolean atoms * found in the atoms list . */ private Set < String > getBooleanConditions ( List < Function > atoms , AliasIndex index ) { } }
Set < String > conditions = new LinkedHashSet < > ( ) ; for ( Function atom : atoms ) { if ( atom . isOperation ( ) ) { // Boolean expression if ( atom . getFunctionSymbol ( ) == ExpressionOperation . AND ) { // flatten ANDs for ( Term t : atom . getTerms ( ) ) { Set < String > arg = getBooleanConditions ( ImmutableLis...
public class StringExpressions { /** * Create a { @ code ltrim ( str ) } expression * < p > Returns a character expression after it removes leading blanks . < / p > * @ param str string * @ return ltrim ( str ) */ public static StringExpression ltrim ( Expression < String > str ) { } }
return Expressions . stringOperation ( Ops . StringOps . LTRIM , str ) ;
public class URLProtectedEditor { /** * 把字符串转成Pattern和UrlType * @ param perl5RegExp * @ return */ private URLPatternHolder convertStringToPattern ( String line ) { } }
URLPatternHolder holder = new URLPatternHolder ( ) ; Pattern compiledPattern ; Perl5Compiler compiler = new Perl5Compiler ( ) ; String perl5RegExp = line ; try { compiledPattern = compiler . compile ( perl5RegExp , Perl5Compiler . READ_ONLY_MASK ) ; holder . setCompiledPattern ( compiledPattern ) ; } catch ( MalformedP...
public class JavacState { /** * Load a javac _ state file . */ public static JavacState load ( Options options ) { } }
JavacState db = new JavacState ( options , false ) ; Module lastModule = null ; Package lastPackage = null ; Source lastSource = null ; boolean noFileFound = false ; boolean foundCorrectVerNr = false ; boolean newCommandLine = false ; boolean syntaxError = false ; Log . debug ( "Loading javac state file: " + db . javac...
public class ObjectReader { /** * Reads the object with the given id from the database , using the given * mapping . * This is the most general form of readObject ( ) . * @ param id An object uniquely identifying the object to read * @ param objClass The class of the object to read * @ param mapping The hasht...
ObjectMapper om = new ObjectMapper ( pObjClass , pMapping ) ; return readObject0 ( pId , pObjClass , om , pWhere ) ;