signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CommerceAddressRestrictionLocalServiceUtil { /** * Returns the commerce address restriction with the primary key . * @ param commerceAddressRestrictionId the primary key of the commerce address restriction * @ return the commerce address restriction * @ throws PortalException if a commerce address re...
return getService ( ) . getCommerceAddressRestriction ( commerceAddressRestrictionId ) ;
public class SimpleStatistics { /** * Get the minimum value in the series . * @ return the minimum value , or 0.0 if the { @ link # getCount ( ) count } is 0 */ public T getMinimum ( ) { } }
Lock lock = this . lock . readLock ( ) ; lock . lock ( ) ; try { return this . minimum != null ? this . minimum : ( T ) this . math . createZeroValue ( ) ; } finally { lock . unlock ( ) ; }
public class JSMessageData { /** * if an unassemble occurs in between them . The call to getFieldDef ( ) needs the lock held too . */ @ Override public boolean isPresent ( int accessor ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) JmfTr . entry ( this , tc , "isPresent" , new Object [ ] { Integer . valueOf ( accessor ) } ) ; boolean result ; checkIndex ( accessor ) ; synchronized ( getMessageLockArtefact ( ) ) { if ( cache [ accessor ] != null ) { if ( TraceComponent . is...
public class ApkBuilder { /** * Constructor init method . * @ see # ApkBuilder ( File , File , File , String , PackagingOptions , PrintStream ) * @ see # ApkBuilder ( String , String , String , String , PackagingOptions , PrintStream ) * @ see # ApkBuilder ( File , File , File , PrivateKey , X509Certificate , Pac...
try { checkOutputFile ( mApkFile = apkFile ) ; checkInputFile ( mResFile = resFile ) ; if ( dexFile != null ) { checkInputFile ( mDexFile = dexFile ) ; } else { mDexFile = null ; } mVerboseStream = verboseStream ; mBuilder = new SignedJarBuilder ( new FileOutputStream ( mApkFile , false /* append */ ) , key , certifica...
public class JobOperatorImpl { /** * Helper method to publish event * @ param jobEx * @ param topicToPublish * @ param correlationId */ private void publishEvent ( WSJobExecution jobEx , String topicToPublish , String correlationId ) { } }
if ( eventsPublisher != null ) { eventsPublisher . publishJobExecutionEvent ( jobEx , topicToPublish , correlationId ) ; }
public class ApiOvhMe { /** * Create an order in order to pay this order ' s debt * REST : POST / me / debtAccount / debt / { debtId } / pay * @ param debtId [ required ] */ public OvhOrder debtAccount_debt_debtId_pay_POST ( Long debtId ) throws IOException { } }
String qPath = "/me/debtAccount/debt/{debtId}/pay" ; StringBuilder sb = path ( qPath , debtId ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhOrder . class ) ;
public class CMMClassifier { /** * Classify a List of { @ link CoreLabel } s without using sequence information * ( i . e . no Viterbi algorithm , just distribution over next class ) . * @ param document a List of { @ link CoreLabel } s to be classified */ private void classifyNoSeq ( List < IN > document ) { } }
if ( flags . useReverse ) { Collections . reverse ( document ) ; } if ( flags . lowerNewgeneThreshold ) { // Used to raise recall for task 1B System . err . println ( "Using NEWGENE threshold: " + flags . newgeneThreshold ) ; for ( int i = 0 , docSize = document . size ( ) ; i < docSize ; i ++ ) { CoreLabel wordInfo = ...
public class AbstractResourceBundleHandler { /** * Resolves the file path of the bundle from the root directory . * @ param rootDir * the rootDir * @ param bundleName * the bundle name * @ return the file path */ private String getStoredBundlePath ( String rootDir , String bundleName ) { } }
if ( bundleName . indexOf ( '/' ) != - 1 ) { bundleName = bundleName . replace ( '/' , File . separatorChar ) ; } if ( ! bundleName . startsWith ( File . separator ) ) { rootDir += File . separator ; } return rootDir + PathNormalizer . escapeToPhysicalPath ( bundleName ) ;
public class SolutionListUtils { /** * This methods takes a list of solutions , removes a percentage of its solutions , and it is filled * with new random generated solutions * @ param solutionList * @ param problem * @ param percentageOfSolutionsToRemove */ public static < S > void restart ( List < S > solutio...
if ( solutionList == null ) { throw new NullSolutionListException ( ) ; } else if ( problem == null ) { throw new JMetalException ( "The problem is null" ) ; } else if ( ( percentageOfSolutionsToRemove < 0 ) || ( percentageOfSolutionsToRemove > 100 ) ) { throw new JMetalException ( "The percentage of solutions to remov...
public class AbstractDynamoDbStore { /** * Creates the schemata for the DynamoDB table or tables each store requires . * Implementations should override and reuse this logic * @ return a create table request appropriate for the schema of the selected implementation . */ public CreateTableRequest getTableSchema ( ) ...
return new CreateTableRequest ( ) . withTableName ( tableName ) . withProvisionedThroughput ( new ProvisionedThroughput ( client . readCapacity ( tableName ) , client . writeCapacity ( tableName ) ) ) ;
public class ValidationPane { /** * update the size of error container and its clip * @ param w * @ param errorContainerHeight */ private void updateErrorContainerSize ( double w , double errorContainerHeight ) { } }
errorContainerClip . setWidth ( w ) ; errorContainerClip . setHeight ( errorContainerHeight ) ; resize ( w , errorContainerHeight ) ;
public class ExtractRegular { /** * 将json格式的URL模式转换为JAVA对象表示 * @ param json URL模式的JSON表示 * @ return URL模式的JAVA对象表示 */ private List < UrlPattern > parseJson ( String json ) { } }
List < UrlPattern > urlPatterns = new ArrayList < > ( ) ; try { List < Map < String , Object > > ups = MAPPER . readValue ( json , List . class ) ; for ( Map < String , Object > up : ups ) { try { UrlPattern urlPattern = new UrlPattern ( ) ; urlPatterns . add ( urlPattern ) ; urlPattern . setUrlPattern ( up . get ( "ur...
public class XMLElement { /** * Get the value specified for a given attribute on this element * @ param name The name of the attribute whose value should be retrieved * @ param def The default value to return if the attribute is specified * @ return The value given for the attribute */ public String getAttribute ...
String value = dom . getAttribute ( name ) ; if ( ( value == null ) || ( value . length ( ) == 0 ) ) { return def ; } return value ;
public class Cache { /** * 查看哈希表 key 中 , 给定域 field 是否存在 。 */ public boolean hexists ( Object key , Object field ) { } }
Jedis jedis = getJedis ( ) ; try { return jedis . hexists ( keyToBytes ( key ) , fieldToBytes ( field ) ) ; } finally { close ( jedis ) ; }
public class FloatingActionButton { /** * Initializes the animation , which is used while hiding or dismissing * < b > Action Button < / b > * @ deprecated since 1.0.2 and will be removed in version 2.0.0 * Use < b > show _ animation < / b > and < b > hide _ animation < / b > in XML instead * @ param attrs attr...
if ( attrs . hasValue ( R . styleable . ActionButton_animation_onHide ) ) { final int animResId = attrs . getResourceId ( R . styleable . ActionButton_animation_onHide , Animations . NONE . animResId ) ; setHideAnimation ( Animations . load ( getContext ( ) , animResId ) ) ; }
public class Converters { /** * 尝试获取属性 * 不会抛出异常 , 不存在则返回null * @ param clazz * @ param itemName * @ return */ private static Field tryGetFieldWithoutExp ( Class < ? > clazz , String itemName ) { } }
try { return clazz . getDeclaredField ( itemName ) ; } catch ( Exception e ) { return null ; }
public class ChronoIterator { /** * Returns the next revision . * @ return next revision */ public Revision next ( ) throws Exception { } }
// Checks whether the next revision has already been reconstructed . Revision revision ; if ( chronoStorage . isTop ( revisionIndex ) ) { // If this is the case the revision will removed from the storage return chronoStorage . remove ( ) ; } // Otherwise the chronological order counter will be mapped to the // revsisio...
public class Compiler { /** * Compile string . * @ param string The input string . * @ param inputPath The input path . * @ param outputPath The output path . * @ param options The compile options . * @ return The compilation output . * @ throws CompilationException If the compilation failed . */ public Out...
StringContext context = new StringContext ( string , inputPath , outputPath , options ) ; return compile ( context ) ;
public class PutIntegrationResponseRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PutIntegrationResponseRequest putIntegrationResponseRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( putIntegrationResponseRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( putIntegrationResponseRequest . getRestApiId ( ) , RESTAPIID_BINDING ) ; protocolMarshaller . marshall ( putIntegrationResponseRequest . getResourceId ( ) ...
public class KeyDecoder { /** * Decodes a boolean from exactly 1 byte , as encoded for descending order . * @ param src source of encoded bytes * @ param srcOffset offset into source array * @ return boolean value */ public static boolean decodeBooleanDesc ( byte [ ] src , int srcOffset ) throws CorruptEncodingEx...
try { return src [ srcOffset ] == 127 ; } catch ( IndexOutOfBoundsException e ) { throw new CorruptEncodingException ( null , e ) ; }
public class Group { /** * Gets a list of all supported properties for this model object , < b > Group < / b > * @ param entityTypeName * allowed object is { @ link String } * @ return * returned object is { @ link List } */ public static synchronized List getPropertyNames ( String entityTypeName ) { } }
if ( propertyNames != null ) { return propertyNames ; } else { { List names = new ArrayList ( ) ; names . add ( PROP_CN ) ; names . add ( PROP_MEMBERS ) ; names . add ( PROP_DISPLAY_NAME ) ; names . add ( PROP_DESCRIPTION ) ; names . add ( PROP_BUSINESS_CATEGORY ) ; names . add ( PROP_SEE_ALSO ) ; if ( extendedProperti...
public class CacheingMatcher { /** * Remove just delegates */ public ContentMatcher remove ( Conjunction selector , MatchTarget object , InternTable subExpr , OrdinalPosition parentId ) throws MatchingException { } }
if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "remove" , "selector: " + selector + ", object: " + object ) ; vacantChild = vacantChild . remove ( selector , object , subExpr , ordinalPosition ) ; ContentMatcher result = this ; if ( vacantChild == null ) result = null ; if ( tc . isEntryEnabled ( ) ) tc . ...
public class JwtSSOTokenImpl { /** * ( non - Javadoc ) * @ see * com . ibm . ws . security . sso . cookie . JwtSSOToken # createSSOToken ( javax . security . * auth . Subject ) */ @ Override // @ FFDCIgnore ( Exception . class ) public void createJwtSSOToken ( Subject subject ) throws WSLoginFailedException { } }
// TODO Auto - generated method stub if ( subject != null ) { if ( isSubjectUnauthenticated ( subject ) || subjectHasJwtPrincipal ( subject ) ) { return ; } JwtSsoTokenUtils tokenUtil = getJwtSsoTokenBuilderUtils ( ) ; if ( tokenUtil != null ) { JsonWebToken ssotoken = null ; try { ssotoken = tokenUtil . buildTokenFrom...
public class PoolsImpl { /** * Disables automatic scaling for a pool . * @ param poolId The ID of the pool on which to disable automatic scaling . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceResponseWithHeaders } object if successful . */ public Obse...
if ( this . client . batchUrl ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.batchUrl() is required and cannot be null." ) ; } if ( poolId == null ) { throw new IllegalArgumentException ( "Parameter poolId is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) ...
public class CSVImporter { /** * This method returns the files found in the given directory matching the given regular * expression . * @ param dirName - ex . " . / path / to / directory / " * make sure you have the ' / ' on the end * @ param regex - ex . " . * . csv " * @ return File [ ] - an array of files */...
File [ ] allFiles = getAllFiles ( dirName ) ; List < File > matchingFiles = new ArrayList < File > ( ) ; for ( File allFile : allFiles ) { if ( allFile . getName ( ) . matches ( regex ) ) { matchingFiles . add ( allFile ) ; } } return matchingFiles . toArray ( new File [ matchingFiles . size ( ) ] ) ;
public class ByteUtils { /** * This function converts the bytes in a byte array at the specified index to its * corresponding double value . * @ param buffer The byte array containing the double . * @ param index The index for the first byte in the byte array . * @ return The corresponding double value . */ sta...
double real ; long bits = bytesToLong ( buffer , index ) ; real = Double . longBitsToDouble ( bits ) ; return real ;
public class FileListUtils { /** * Get any data file , which is not hidden or a directory , from the given path */ public static FileStatus getAnyNonHiddenFile ( FileSystem fs , Path path ) throws IOException { } }
HiddenFilter hiddenFilter = new HiddenFilter ( ) ; FileStatus root = fs . getFileStatus ( path ) ; if ( ! root . isDirectory ( ) ) { return hiddenFilter . accept ( path ) ? root : null ; } // DFS to get the first data file Stack < FileStatus > folders = new Stack < > ( ) ; folders . push ( root ) ; while ( ! folders . ...
public class BNFHeadersImpl { /** * Clear all traces of the headers from storage . */ private void clearAllHeaders ( ) { } }
final boolean bTrace = TraceComponent . isAnyTracingEnabled ( ) ; if ( bTrace && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "clearAllHeaders()" ) ; } HeaderElement elem = this . hdrSequence ; while ( null != elem ) { final HeaderElement next = elem . nextSequence ; final HeaderKeys key = elem . getKey ( ) ; final in...
public class TerminateClientVpnConnectionsResult { /** * The current state of the client connections . * @ param connectionStatuses * The current state of the client connections . */ public void setConnectionStatuses ( java . util . Collection < TerminateConnectionStatus > connectionStatuses ) { } }
if ( connectionStatuses == null ) { this . connectionStatuses = null ; return ; } this . connectionStatuses = new com . amazonaws . internal . SdkInternalList < TerminateConnectionStatus > ( connectionStatuses ) ;
public class PollingMonitoredValue { /** * Convenient factory method to create pollers you don ' t care about keeping * – that is , pollers which should be registered and start updating their * value , but which you don ' t need to hold a reference to ( because you will * presumably just be modifying the polled s...
new PollingMonitoredValue < T > ( name , description , registry , updateInterval , poller , semantics , unit ) ;
public class UnitResponse { /** * Create a rolling back response object with the given message . * @ param errMsg the error message . * @ return An response object which will indicate a transactional rolling back . */ @ SuppressWarnings ( "all" ) public static UnitResponse createRollingBack ( String errMsg ) { } }
return UnitResponse . createUnknownError ( null , errMsg ) . setContext ( Context . create ( ) . setRollback ( true ) ) ;
public class NewChunk { /** * Compute a compressed double buffer */ private Chunk chunkD ( ) { } }
if ( H2O . SINGLE_PRECISION ) { final byte [ ] bs = MemoryManager . malloc1 ( _len * 4 , true ) ; int j = 0 ; for ( int i = 0 ; i < _len ; ++ i ) { float f = 0 ; if ( _id == null || _id . length == 0 || ( j < _id . length && _id [ j ] == i ) ) { f = _ds != null ? ( float ) _ds [ j ] : ( isNA2 ( j ) || isEnum ( j ) ) ? ...
public class Report { /** * Adds the log entries to the report . * @ throws JSONException if the log entries cannot be added */ private void buildLog ( ) throws JSONException { } }
logs = new JSONObject ( ) ; List < String > list = Log . getReportedEntries ( ) ; if ( list != null ) { logs . put ( "numberOfEntry" , list . size ( ) ) ; JSONArray array = new JSONArray ( ) ; for ( String s : list ) { array . put ( s ) ; } logs . put ( "log" , array ) ; }
public class DirectoryBasedOverlayContainerImpl { /** * Little recursive routine to collect all the files present within a ArtifactContainer . < p > * @ param c The ArtifactContainer to process * @ param s The set to add paths to . */ private void collectPaths ( ArtifactContainer c , Set < String > s ) { } }
if ( ! "/" . equals ( c . getPath ( ) ) ) { s . add ( c . getPath ( ) ) ; } for ( ArtifactEntry e : c ) { s . add ( e . getPath ( ) ) ; ArtifactContainer n = e . convertToContainer ( ) ; if ( n != null && ! n . isRoot ( ) ) { collectPaths ( n , s ) ; } }
public class DeviceManagerClient { /** * Deletes a device registry configuration . * < p > Sample code : * < pre > < code > * try ( DeviceManagerClient deviceManagerClient = DeviceManagerClient . create ( ) ) { * RegistryName name = RegistryName . of ( " [ PROJECT ] " , " [ LOCATION ] " , " [ REGISTRY ] " ) ; ...
DeleteDeviceRegistryRequest request = DeleteDeviceRegistryRequest . newBuilder ( ) . setName ( name ) . build ( ) ; deleteDeviceRegistry ( request ) ;
public class XmlPrintStream { /** * Translate reserved XML characters to XML entities . * @ param in Input string . */ public String escape ( String in ) { } }
StringBuffer out = new StringBuffer ( ) ; for ( char c : in . toCharArray ( ) ) { switch ( c ) { case '<' : out . append ( "&lt;" ) ; break ; case '>' : out . append ( "&gt;" ) ; break ; case '&' : out . append ( "&amp;" ) ; break ; case '"' : out . append ( "&quot;" ) ; break ; default : out . append ( c ) ; } } retur...
public class AbstractSlideModel { /** * Return the default content or null . * @ return the default SlideContent */ public SlideContent getDefaultContent ( ) { } }
SlideContent res = null ; if ( getSlide ( ) . getContent ( ) != null && ! getSlide ( ) . getContent ( ) . isEmpty ( ) ) { res = getSlide ( ) . getContent ( ) . get ( 0 ) ; } return res ;
public class MultimediaAppender { /** * { @ inheritDoc } */ @ Override public void appendString ( final String appendage ) { } }
owner . setTail ( owner . getTail ( ) . concat ( appendage ) ) ;
public class XBinaryOperationImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setReassignFirstArgument ( boolean newReassignFirstArgument ) { } }
boolean oldReassignFirstArgument = reassignFirstArgument ; reassignFirstArgument = newReassignFirstArgument ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , XbasePackage . XBINARY_OPERATION__REASSIGN_FIRST_ARGUMENT , oldReassignFirstArgument , reassignFirstArgument ) ) ;
public class ExecutorResource { /** * instance details */ @ ApiOperation ( value = "Returns information about a specified job." , response = RequestInfoInstance . class , code = 200 ) @ ApiResponses ( value = { } }
@ ApiResponse ( code = 500 , message = "Unexpected error" ) , @ ApiResponse ( code = 200 , message = "Successfull response" , examples = @ Example ( value = { @ ExampleProperty ( mediaType = JSON , value = GET_REQUEST_RESPONSE_JSON ) } ) ) } ) @ GET @ Path ( JOB_INSTANCE_GET_URI ) @ Produces ( { MediaType . APPLICATION...
public class VirtualFile { /** * Get all the children recursively < p > * This always uses { @ link VisitorAttributes # RECURSE } * @ param filter to filter the children * @ return the children * @ throws IOException for any problem accessing the virtual file system * @ throws IllegalStateException if the fil...
// isDirectory does the read security check if ( ! isDirectory ( ) ) { return Collections . emptyList ( ) ; } if ( filter == null ) { filter = MatchAllVirtualFileFilter . INSTANCE ; } FilterVirtualFileVisitor visitor = new FilterVirtualFileVisitor ( filter , VisitorAttributes . RECURSE ) ; visit ( visitor ) ; return vi...
public class HttpUrl { /** * Returns this URL ' s query , like { @ code " abc " } for { @ code http : / / host / ? abc } . Most callers should * prefer { @ link # queryParameterName } and { @ link # queryParameterValue } because these methods offer * direct access to individual query parameters . * < p > < table ...
if ( queryNamesAndValues == null ) return null ; // No query . StringBuilder result = new StringBuilder ( ) ; namesAndValuesToQueryString ( result , queryNamesAndValues ) ; return result . toString ( ) ;
public class ReduceOperatorBase { @ Override protected List < T > executeOnCollections ( List < T > inputData , RuntimeContext ctx , ExecutionConfig executionConfig ) throws Exception { } }
// make sure we can handle empty inputs if ( inputData . isEmpty ( ) ) { return Collections . emptyList ( ) ; } ReduceFunction < T > function = this . userFunction . getUserCodeObject ( ) ; UnaryOperatorInformation < T , T > operatorInfo = getOperatorInfo ( ) ; TypeInformation < T > inputType = operatorInfo . getInputT...
public class VelocityEngineFactory { /** * Set Velocity properties as Map , to allow for non - String values * like " ds . resource . loader . instance " . * @ see # setVelocityProperties */ public void setVelocityPropertiesMap ( Map < String , Object > velocityPropertiesMap ) { } }
if ( velocityPropertiesMap != null ) { this . velocityProperties . putAll ( velocityPropertiesMap ) ; }
public class CPCImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setVSFlags ( Integer newVSFlags ) { } }
Integer oldVSFlags = vsFlags ; vsFlags = newVSFlags ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . CPC__VS_FLAGS , oldVSFlags , vsFlags ) ) ;
public class OpsRegistrar { /** * Return the OpsAgent for the specified selector . */ public OpsAgent getAgent ( OpsSelector selector ) { } }
OpsAgent agent = m_agents . get ( selector ) ; assert ( agent != null ) ; return agent ;
public class WebUtils { /** * Gets the ticket granting ticket id from the request and flow scopes . * @ param context the context * @ return the ticket granting ticket id */ public static String getTicketGrantingTicketId ( final RequestContext context ) { } }
val tgtFromRequest = getTicketGrantingTicketIdFrom ( context . getRequestScope ( ) ) ; val tgtFromFlow = getTicketGrantingTicketIdFrom ( context . getFlowScope ( ) ) ; return tgtFromRequest != null ? tgtFromRequest : tgtFromFlow ;
public class WaitSet { /** * see javadoc */ public void park ( BlockingOperation op ) { } }
long timeout = op . getWaitTimeout ( ) ; WaitSetEntry entry = new WaitSetEntry ( queue , op ) ; entry . setNodeEngine ( nodeEngine ) ; queue . offer ( entry ) ; if ( timeout > - 1 && timeout < TIMEOUT_UPPER_BOUND ) { delayQueue . offer ( entry ) ; }
public class ExtendedByteBuf { /** * Reads a range of bytes if possible . If not present the reader index is reset to the last mark . * @ param bf * @ return */ public static Optional < byte [ ] > readMaybeRangedBytes ( ByteBuf bf ) { } }
Optional < Integer > length = readMaybeVInt ( bf ) ; if ( length . isPresent ( ) ) { int l = length . get ( ) ; if ( bf . readableBytes ( ) >= l ) { if ( l > 0 ) { byte [ ] array = new byte [ l ] ; bf . readBytes ( array ) ; return Optional . of ( array ) ; } else { return Optional . of ( Util . EMPTY_BYTE_ARRAY ) ; } ...
public class ValidationUtilities { /** * Validate the given value against a regular expression pattern * @ param pattern Regular expression pattern * @ param value Value to test * @ return boolean { @ code true } if { @ code value } matches { @ code pattern } * @ throws PatternSyntaxException * if the given p...
Pattern re = patternCache . get ( pattern ) ; if ( re == null ) { re = compile ( pattern , MULTILINE | DOTALL ) ; patternCache . put ( pattern , re ) ; } return ( re . matcher ( value ) . matches ( ) ) ;
public class Bits { /** * / * J2ObjC : unused . * Copy from source address into given destination array . * @ param srcAddr source address * @ param dst destination array * @ param dstBaseOffset offset of first element of storage in destination array * @ param dstPos offset within destination array of the fir...
copyFromShortArray ( src , srcPos , dstAddr , length ) ;
public class BinaryJedis { /** * Sort a Set or a List accordingly to the specified parameters . * < b > examples : < / b > * Given are the following sets and key / values : * < pre > * x = [ 1 , 2 , 3] * y = [ a , b , c ] * k1 = z * k2 = y * k3 = x * w1 = 9 * w2 = 8 * w3 = 7 * < / pre > * Sort...
checkIsInMultiOrPipeline ( ) ; client . sort ( key , sortingParameters ) ; return client . getBinaryMultiBulkReply ( ) ;
public class ClientProcessor { /** * ( non - Javadoc ) * @ see net . timewalker . ffmq4 . remote . transport . PacketTransportListener # packetReceived ( net . timewalker . ffmq4 . remote . transport . packet . AbstractPacket ) */ @ Override public boolean packetReceived ( AbstractPacket packet ) { } }
AbstractQueryPacket query = ( AbstractQueryPacket ) packet ; AbstractResponsePacket response = null ; // Process packet try { try { response = process ( query ) ; } catch ( JMSException e ) { log . debug ( "#" + id + " process() failed with " + e . toString ( ) ) ; response = new ErrorResponse ( e ) ; } } catch ( Excep...
public class HashIntSet { /** * { @ inheritDoc } */ @ Override public HashIntSet convert ( Collection < Integer > c ) { } }
HashIntSet res = new HashIntSet ( ( int ) ( c . size ( ) / LOAD_FACTOR ) + 1 ) ; for ( int e : c ) { res . add ( e ) ; } return res ;
public class JmxMetricReporter { /** * The JMX Reporter is activated only if the jmxEnabled property is set . If the jmxAutoStart property is enabled , * the JMX Reporter will start automatically . * @ param configurationProperties configuration properties * @ param metricRegistry metric registry * @ return { @...
if ( configurationProperties . isJmxEnabled ( ) ) { jmxReporter = JmxReporter . forRegistry ( metricRegistry ) . inDomain ( MetricRegistry . name ( getClass ( ) , configurationProperties . getUniqueName ( ) ) ) . build ( ) ; } if ( configurationProperties . isJmxAutoStart ( ) ) { start ( ) ; } return this ;
public class MotionEventUtils { /** * Calculate the vertical move motion direction . * @ param delta moved delta . * @ param threshold threshold to detect the motion . * @ return the motion direction for the vertical axis . */ public static MotionDirection getVerticalMotionDirection ( float delta , float threshol...
if ( threshold < 0 ) { throw new IllegalArgumentException ( "threshold should be positive or zero." ) ; } return delta < - threshold ? MotionDirection . DOWN : delta > threshold ? MotionDirection . UP : MotionDirection . FIX ;
public class StreamGraph { /** * Adds a new virtual node that is used to connect a downstream vertex to only the outputs * with the selected names . * < p > When adding an edge from the virtual node to a downstream node the connection will be made * to the original node , only with the selected names given here ....
if ( virtualSelectNodes . containsKey ( virtualId ) ) { throw new IllegalStateException ( "Already has virtual select node with id " + virtualId ) ; } virtualSelectNodes . put ( virtualId , new Tuple2 < Integer , List < String > > ( originalId , selectedNames ) ) ;
public class Envelope2D { /** * Queries a corner of the envelope . * @ param index * Indicates a corner of the envelope . * 0 means lower left or ( xmin , ymin ) * 1 means upper left or ( xmin , ymax ) * 2 means upper right or ( xmax , ymax ) * 3 means lower right or ( xmax , ymin ) * @ return Point at a ...
switch ( index ) { case 0 : return Point2D . construct ( xmin , ymin ) ; case 1 : return Point2D . construct ( xmin , ymax ) ; case 2 : return Point2D . construct ( xmax , ymax ) ; case 3 : return Point2D . construct ( xmax , ymin ) ; default : throw new IndexOutOfBoundsException ( ) ; }
public class AmazonRoute53ResolverClient { /** * Gets the IP addresses for a specified resolver endpoint . * @ param listResolverEndpointIpAddressesRequest * @ return Result of the ListResolverEndpointIpAddresses operation returned by the service . * @ throws ResourceNotFoundException * The specified resource d...
request = beforeClientExecution ( request ) ; return executeListResolverEndpointIpAddresses ( request ) ;
public class Timex2 { /** * getter for comment - gets * @ generated * @ return value of the feature */ public String getComment ( ) { } }
if ( Timex2_Type . featOkTst && ( ( Timex2_Type ) jcasType ) . casFeat_comment == null ) jcasType . jcas . throwFeatMissing ( "comment" , "de.julielab.jules.types.ace.Timex2" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Timex2_Type ) jcasType ) . casFeatCode_comment ) ;
public class CssScanner { /** * SUBSTRINGMATCH * = */ private void _substringmatch ( ) throws IOException { } }
if ( debug ) { checkState ( reader . curChar == '*' ) ; } builder . type = Type . SUBSTRINGMATCH ; builder . append ( "*=" ) ; reader . next ( ) ; if ( debug ) { checkState ( reader . curChar == '=' ) ; }
public class CollectionUtils { /** * Merge the given Properties instance into the given Map , copying all properties ( key - value pairs ) over . < p > Uses * { @ code Properties . propertyNames ( ) } to even catch default properties linked into the original Properties * instance . * @ param props the Properties ...
if ( map == null ) { throw new IllegalArgumentException ( "Map must not be null" ) ; } if ( props != null ) { for ( Enumeration < ? > en = props . propertyNames ( ) ; en . hasMoreElements ( ) ; ) { String key = ( String ) en . nextElement ( ) ; Object value = props . get ( key ) ; if ( value == null ) { // Allow for de...
public class ExtendedProperties { /** * Returns a set of Entries representing property key - value pairs . The returned set is a view to * the internal data structures and reflects changes to this instance . Potential defaults are * included in the returned set . * @ return The entry set */ @ Override public Set ...
if ( entrySet == null ) { entrySet = new EntrySet ( ) ; } return entrySet ;
public class CheckArg { /** * Check that the array is not empty * @ param argument Array * @ param name The name of the argument * @ throws IllegalArgumentException If array is null or empty */ public static void isNotEmpty ( Object [ ] argument , String name ) { } }
isNotNull ( argument , name ) ; if ( argument . length == 0 ) { throw new IllegalArgumentException ( CommonI18n . argumentMayNotBeEmpty . text ( name ) ) ; }
public class PTDImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . PTD__XPBASE : setXPBASE ( ( Integer ) newValue ) ; return ; case AfplibPackage . PTD__YPBASE : setYPBASE ( ( Integer ) newValue ) ; return ; case AfplibPackage . PTD__XPUNITVL : setXPUNITVL ( ( Integer ) newValue ) ; return ; case AfplibPackage . PTD__YPUNITVL : setYPUNITVL (...
public class SparkIntegrationChecker { /** * Saves Spark with Alluixo integration checker results . * @ param resultStatus Spark job result status * @ param reportWriter save user - facing messages to a generated file */ private void printResultInfo ( Status resultStatus , PrintWriter reportWriter ) { } }
switch ( resultStatus ) { case FAIL_TO_FIND_CLASS : reportWriter . println ( FAIL_TO_FIND_CLASS_MESSAGE ) ; reportWriter . println ( TEST_FAILED_MESSAGE ) ; break ; case FAIL_TO_FIND_FS : reportWriter . println ( FAIL_TO_FIND_FS_MESSAGE ) ; reportWriter . println ( TEST_FAILED_MESSAGE ) ; break ; case FAIL_TO_SUPPORT_H...
public class GetTypeRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetTypeRequest getTypeRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getTypeRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getTypeRequest . getApiId ( ) , APIID_BINDING ) ; protocolMarshaller . marshall ( getTypeRequest . getTypeName ( ) , TYPENAME_BINDING ) ; protocolMarshaller . marshall ( ...
public class Money { /** * ( non - Javadoc ) * @ see org . javamoney . moneta . AbstractMoney # multiply ( java . lang . Number ) */ @ Override public Money multiply ( Number multiplicand ) { } }
NumberVerifier . checkNoInfinityOrNaN ( multiplicand ) ; BigDecimal multiplicandBD = MoneyUtils . getBigDecimal ( multiplicand ) ; if ( multiplicandBD . equals ( BigDecimal . ONE ) ) { return this ; } MathContext mc = MoneyUtils . getMathContext ( monetaryContext , RoundingMode . HALF_EVEN ) ; BigDecimal dec = this . n...
public class UrlEncoded { /** * Decode String with % encoding . * This method makes the assumption that the majority of calls * will need no decoding and uses the 8859 encoding . */ public static String decodeString ( String encoded ) { } }
return decodeString ( encoded , 0 , encoded . length ( ) , StringUtil . __ISO_8859_1 ) ;
public class ValidatorVault { /** * Validate the find methods . */ private void findValidation ( Class < ? > vaultClass , Class < ? > assetClass , Class < ? > idClass ) { } }
for ( Method method : vaultClass . getMethods ( ) ) { if ( ! method . getName ( ) . startsWith ( "find" ) ) { continue ; } if ( ! Modifier . isAbstract ( method . getModifiers ( ) ) ) { continue ; } TypeRef resultRef = findResult ( method . getParameters ( ) ) ; if ( resultRef == null ) { continue ; } TypeRef typeRef =...
public class WaveformDetail { /** * Color waveforms are represented by a series of sixteen bit integers into which color and height information are * packed . This function returns the integer corresponding to a particular half - frame in the waveform . * @ param waveBytes the raw data making up the waveform * @ ...
final int base = ( segment * 2 ) ; final int big = Util . unsign ( waveBytes . get ( base ) ) ; final int small = Util . unsign ( waveBytes . get ( base + 1 ) ) ; return big * 256 + small ;
public class RoundingQueryBuilder { /** * Sets the rounding names of the { @ link MonetaryRounding } instances . This method allows to * access the { @ link MonetaryRounding } instances by passing a name , which most of the time * identifies a certain rounding instance . Each entry is first matched as name on equal...
Objects . requireNonNull ( roundingName ) ; set ( RoundingQuery . KEY_QUERY_ROUNDING_NAME , roundingName ) ; return this ;
public class XHTMLParser { /** * Interpret the passed XHTML fragment as HTML and retrieve a result container * with all body elements . * @ param sXHTML * The XHTML text fragment . This fragment is parsed as an HTML body and * may therefore not contain the & lt ; body & gt ; tag . * @ return < code > null < /...
// Ensure that the content is surrounded by a single tag final IMicroDocument aDoc = parseXHTMLFragment ( sXHTML ) ; if ( aDoc != null && aDoc . getDocumentElement ( ) != null ) { // Find " body " case insensitive final IMicroElement eBody = aDoc . getDocumentElement ( ) . getFirstChildElement ( EHTMLElement . BODY . g...
public class FullList { /** * Builds a new full list , with null as blank element * @ param capacity the initial capacity of the list * @ param elements the elements * @ param < F > the type of the elements * @ return the full list */ public static < F > FullList < F > newListWithCapacity ( final int capacity ,...
final FullList < F > l = new FullList < F > ( null , capacity ) ; l . addAll ( Arrays . asList ( elements ) ) ; return l ;
public class BinaryFormatUtils { /** * Write message to writer . * @ param writer The binary writer . * @ param message The message to write . * @ param < Message > The message type . * @ param < Field > The field type . * @ return The number of bytes written . * @ throws IOException If write failed . */ pu...
if ( message instanceof BinaryWriter ) { return ( ( BinaryWriter ) message ) . writeBinary ( writer ) ; } int len = 0 ; if ( message instanceof PUnion ) { if ( ( ( PUnion ) message ) . unionFieldIsSet ( ) ) { PField field = ( ( PUnion ) message ) . unionField ( ) ; len += writeFieldSpec ( writer , forType ( field . get...
public class BDBRepositoryBuilder { /** * Sets the repository environment home directory , which is required . */ public void setEnvironmentHomeFile ( File envHome ) { } }
try { // Switch to canonical for more detailed error messages . envHome = envHome . getCanonicalFile ( ) ; } catch ( IOException e ) { } mEnvHome = envHome ;
public class CapacityTaskScheduler { /** * called when a job completes */ synchronized void jobCompleted ( JobInProgress job ) { } }
QueueSchedulingInfo qsi = queueInfoMap . get ( job . getProfile ( ) . getQueueName ( ) ) ; // qsi shouldn ' t be null // update numJobsByUser LOG . debug ( "JOb to be removed for user " + job . getProfile ( ) . getUser ( ) ) ; Integer i = qsi . numJobsByUser . get ( job . getProfile ( ) . getUser ( ) ) ; i -- ; if ( 0 ...
public class SecurityServiceImpl { /** * Method will be called for each UserRegistryService that is unregistered * in the OSGi service registry . We must remove this instance from our * internal map . * @ param ref Reference to an unregistered UserRegistryService */ protected Map < String , Object > unsetUserRegi...
userRegistry . removeReference ( ( String ) ref . getProperty ( KEY_ID ) , ref ) ; userRegistry . removeReference ( String . valueOf ( ref . getProperty ( KEY_SERVICE_ID ) ) , ref ) ; // determine a new user registry service userRegistryService . set ( null ) ; return getServiceProperties ( ) ;
public class StringGroovyMethods { /** * Iterates through this CharSequence line by line . Each line is passed * to the given 1 or 2 arg closure . If a 2 arg closure is found * the line count is passed as the second argument . * @ param self a CharSequence * @ param closure a closure * @ return the last value...
"String" , "String,Integer" } ) Closure < T > closure ) throws IOException { return eachLine ( self . toString ( ) , 0 , closure ) ;
public class DefaultNumberValue { /** * ( non - Javadoc ) * @ see javax . money . NumberValue # getDoubleValueExact ( ) */ @ Override public double doubleValueExact ( ) { } }
double d = this . number . doubleValue ( ) ; if ( d == Double . NEGATIVE_INFINITY || d == Double . POSITIVE_INFINITY ) { throw new ArithmeticException ( "Unable to convert to double: " + this . number ) ; } return d ;
public class Stream { /** * Returns the last element wrapped by { @ code Optional } class . * If stream is empty , returns { @ code Optional . empty ( ) } . * < p > This is a short - circuiting terminal operation . * @ return an { @ code Optional } with the last element * or { @ code Optional . empty ( ) } if t...
return reduce ( new BinaryOperator < T > ( ) { @ Override public T apply ( T left , T right ) { return right ; } } ) ;
public class MediaClient { /** * Get information of thumbnail job . * @ param request The request object containing all options for creating new water mark . * @ return The information of the thumbnail job . */ public GetThumbnailJobResponse getThumbnailJob ( GetThumbnailJobRequest request ) { } }
checkStringNotEmpty ( request . getJobId ( ) , "The parameter jobId should NOT be null or empty string." ) ; InternalRequest internalRequest = createRequest ( HttpMethodName . GET , request , THUMBNAIL , request . getJobId ( ) ) ; return invokeHttpClient ( internalRequest , GetThumbnailJobResponse . class ) ;
public class DataUtil { /** * Read the input stream into a byte buffer . To deal with slow input streams , you may interrupt the thread this * method is executing on . The data read until being interrupted will be available . * @ param inStream the input stream to read from * @ param maxSize the maximum size in b...
Validate . isTrue ( maxSize >= 0 , "maxSize must be 0 (unlimited) or larger" ) ; final ConstrainableInputStream input = ConstrainableInputStream . wrap ( inStream , bufferSize , maxSize ) ; return input . readToByteBuffer ( maxSize ) ;
public class SheetResourcesImpl { /** * Sort a sheet according to the sort criteria . * It mirrors to the following Smartsheet REST API method : POST / sheet / { sheetId } / sort * Exceptions : * - IllegalArgumentException : if any argument is null * - InvalidRequestException : if there is any problem with the ...
return this . sortSheet ( sheetId , sortSpecifier , null ) ;
public class CommercePriceEntryPersistenceImpl { /** * Caches the commerce price entry in the entity cache if it is enabled . * @ param commercePriceEntry the commerce price entry */ @ Override public void cacheResult ( CommercePriceEntry commercePriceEntry ) { } }
entityCache . putResult ( CommercePriceEntryModelImpl . ENTITY_CACHE_ENABLED , CommercePriceEntryImpl . class , commercePriceEntry . getPrimaryKey ( ) , commercePriceEntry ) ; finderCache . putResult ( FINDER_PATH_FETCH_BY_UUID_G , new Object [ ] { commercePriceEntry . getUuid ( ) , commercePriceEntry . getGroupId ( ) ...
public class CommerceAccountUserRelPersistenceImpl { /** * Clears the cache for all commerce account user rels . * The { @ link EntityCache } and { @ link FinderCache } are both cleared by this method . */ @ Override public void clearCache ( ) { } }
entityCache . clearCache ( CommerceAccountUserRelImpl . class ) ; finderCache . clearCache ( FINDER_CLASS_NAME_ENTITY ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITH_PAGINATION ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION ) ;
public class WorkQueue { /** * Start worker threads with a shared log . * @ param executorService * the executor service * @ param numTasks * the number of worker tasks to start */ private void startWorkers ( final ExecutorService executorService , final int numTasks ) { } }
for ( int i = 0 ; i < numTasks ; i ++ ) { workerFutures . add ( executorService . submit ( new Callable < Void > ( ) { @ Override public Void call ( ) throws Exception { runWorkLoop ( ) ; return null ; } } ) ) ; }
public class ClassWriter { /** * Puts one byte and two shorts into the constant pool . * @ param b a byte . * @ param s1 a short . * @ param s2 another short . */ private void put122 ( final int b , final int s1 , final int s2 ) { } }
pool . putBS ( b , s1 ) . putShort ( s2 ) ;
public class CreateSpatialIndexGeneratorOracle { /** * Generates the SQL for deleting any existing record from the * < code > USER _ SDO _ GEOM _ METADATA < / code > table . Typically this record shouldn ' t be present but we * must ensure that it does not already exist . * @ param statement * the create spatia...
final StringBuilder sql = new StringBuilder ( ) ; sql . append ( "DELETE FROM user_sdo_geom_metadata " ) ; final String tableName = statement . getTableName ( ) . trim ( ) ; sql . append ( "WHERE table_name = '" ) . append ( database . correctObjectName ( tableName , Table . class ) ) ; final String columnName = statem...
public class PowerAdapter { /** * Concatenates the specified views with this adapter , and returns the result . * @ param views The views to be prepended . * @ return The resulting composite adapter . * @ see # prepend ( PowerAdapter . . . ) * @ see # concat ( PowerAdapter . . . ) */ @ CheckResult @ NonNull pub...
checkNotNull ( views , "views" ) ; if ( views . length == 0 ) { return this ; } return prepend ( asAdapter ( views ) ) ;
public class OmdbBuilder { /** * The type of video to return : Movie , Series or Episode . * @ param resultType [ OPTIONAL ] The type to limit the build to * @ return */ public OmdbBuilder setResultType ( final ResultType resultType ) { } }
if ( ! ResultType . isDefault ( resultType ) ) { params . add ( Param . RESULT , resultType ) ; } return this ;
public class CmsUserDriver { /** * Returns the organizational unit represented by the given resource . < p > * @ param dbc the current db context * @ param resource the resource that represents an organizational unit * @ return the organizational unit represented by the given resource * @ throws CmsException if...
if ( ! resource . getRootPath ( ) . startsWith ( ORGUNIT_BASE_FOLDER ) ) { throw new CmsDataAccessException ( Messages . get ( ) . container ( Messages . ERR_READ_ORGUNIT_1 , resource . getRootPath ( ) ) ) ; } // get the data String name = resource . getRootPath ( ) . substring ( ORGUNIT_BASE_FOLDER . length ( ) ) ; if...
public class HtmlUtil { /** * 清除指定HTML标签 , 不包括内容 < br > * 不区分大小写 * @ param content 文本 * @ param tagNames 要清除的标签 * @ return 去除标签后的文本 */ public static String unwrapHtmlTag ( String content , String ... tagNames ) { } }
return removeHtmlTag ( content , false , tagNames ) ;
public class streamselector { /** * Use this API to fetch filtered set of streamselector resources . * filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */ public static streamselector [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } }
streamselector obj = new streamselector ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; streamselector [ ] response = ( streamselector [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class JavaLexer { /** * $ ANTLR start " OctalLiteral " */ public final void mOctalLiteral ( ) throws RecognitionException { } }
try { int _type = OctalLiteral ; int _channel = DEFAULT_TOKEN_CHANNEL ; // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1306:14 : ( ' 0 ' ( ' 0 ' . . ' 7 ' ) + ( IntegerTypeSuffix ) ? ) // src / main / resources / org / drools / compiler / semantics / java / parser / Java . ...
public class CommonOps_ZDRM { /** * Returns the magnitude squared of the complex element with the largest magnitude < br > * < br > * Max { | a < sub > ij < / sub > | ^ 2 } for all i and j < br > * @ param a A matrix . Not modified . * @ return The max magnitude squared */ public static double elementMaxMagnitu...
final int size = a . getDataLength ( ) ; double max = 0 ; for ( int i = 0 ; i < size ; ) { double real = a . data [ i ++ ] ; double imaginary = a . data [ i ++ ] ; double m = real * real + imaginary * imaginary ; if ( m > max ) { max = m ; } } return max ;
public class CmsJspContentAccessValueWrapper { /** * Turn on macro resolving for the wrapped value . < p > * Macro resolving is turned off by default . * When turned on , a macro resolver is initialized with * the current OpenCms user context and the URI of the current resource . * This means known macros conta...
if ( m_macroResolver == null ) { CmsMacroResolver macroResolver = CmsMacroResolver . newInstance ( ) ; macroResolver . setCmsObject ( m_cms ) ; macroResolver . setKeepEmptyMacros ( true ) ; return new CmsJspContentAccessValueWrapper ( this , macroResolver ) ; } // macro resolving is already turned on return this ;
public class Executor { /** * Returns when this executor started or should start being idle . */ public long getIdleStartMilliseconds ( ) { } }
if ( isIdle ( ) ) return Math . max ( creationTime , owner . getConnectTime ( ) ) ; else { return Math . max ( startTime + Math . max ( 0 , executableEstimatedDuration ) , System . currentTimeMillis ( ) + 15000 ) ; }
public class ResourceLoader { /** * Given a class or resource name , returns a patch to that resource . * @ param name the class or resource name . * @ return the path representing the class or resource . */ @ Override public PathImpl getPath ( String name ) { } }
if ( name . startsWith ( "/" ) ) return _path . lookup ( "." + name ) ; else return _path . lookup ( name ) ;
public class AppConfigChecker { /** * F743-6605 */ static void validateStatefulTimeoutOnSFSB ( BeanMetaData bmd , TraceComponent tc ) { } }
StatefulTimeout statefulTimeout = bmd . enterpriseBeanClass . getAnnotation ( javax . ejb . StatefulTimeout . class ) ; if ( statefulTimeout != null ) { if ( bmd . type != InternalConstants . TYPE_STATEFUL_SESSION ) { Tr . warning ( tc , "STATEFUL_TIMEOUT_ON_NON_SFSB_CNTR0304W" , new Object [ ] { bmd . getName ( ) , bm...