signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ServerTransform { /** * Merges the transform and its parameters with other parameters * of the request . * Ordinarily , and application does not need to call this method . * @ param currentParamsthe other parameters * @ returnthe union of the other parameters and the transform parameters */ public ...
Map < String , List < String > > params = ( currentParams != null ) ? currentParams : new RequestParameters ( ) ; params . put ( "transform" , Arrays . asList ( getName ( ) ) ) ; for ( Map . Entry < String , List < String > > entry : entrySet ( ) ) { params . put ( "trans:" + entry . getKey ( ) , entry . getValue ( ) )...
public class Matrices { /** * Creates a sum matrix accumulator that calculates the sum of all elements in the matrix . * @ param neutral the neutral value * @ return a sum accumulator */ public static MatrixAccumulator asSumAccumulator ( final double neutral ) { } }
return new MatrixAccumulator ( ) { private BigDecimal result = BigDecimal . valueOf ( neutral ) ; @ Override public void update ( int i , int j , double value ) { result = result . add ( BigDecimal . valueOf ( value ) ) ; } @ Override public double accumulate ( ) { double value = result . setScale ( Matrices . ROUND_FA...
public class Iterables { /** * Gets the element from an array with given index . * @ param array the array * @ param index the index * @ return null if the array doesn ' t have the element at index , otherwise , return the element */ public static Object getElementFromArrary ( Object array , int index ) { } }
try { return Array . get ( array , index ) ; } catch ( ArrayIndexOutOfBoundsException e ) { return null ; }
public class Logger { /** * Logs a formatted message and stack trace if DEBUG logging is enabled * or a formatted message and exception description if WARN logging is enabled . * @ param cause an exception to print stack trace of if DEBUG logging is enabled * @ param message a < a href = " http : / / download . o...
logDebugf ( Level . WARN , cause , message , args ) ;
public class AVObject { /** * changable operations . */ public void add ( String key , Object value ) { } }
validFieldName ( key ) ; ObjectFieldOperation op = OperationBuilder . gBuilder . create ( OperationBuilder . OperationType . Add , key , value ) ; addNewOperation ( op ) ;
public class ClassWriterImpl { /** * Get links to the given classes . * @ param context the id of the context where the link will be printed * @ param list the list of classes * @ return a content tree for the class list */ private Content getClassLinks ( LinkInfoImpl . Kind context , Collection < ? > list ) { } ...
Content dd = new HtmlTree ( HtmlTag . DD ) ; boolean isFirst = true ; for ( Object type : list ) { if ( ! isFirst ) { Content separator = new StringContent ( ", " ) ; dd . addContent ( separator ) ; } else { isFirst = false ; } // TODO : should we simply split this method up to avoid instanceof ? if ( type instanceof T...
public class GroovyRunnerRegistry { /** * Returns the number of registered runners . * @ return number of registered runners */ @ Override public int size ( ) { } }
Map < String , GroovyRunner > map = getMap ( ) ; readLock . lock ( ) ; try { return map . size ( ) ; } finally { readLock . unlock ( ) ; }
public class Stylesheet { /** * Set the location information for this element . * @ param locator SourceLocator object with location information */ public void setLocaterInfo ( SourceLocator locator ) { } }
if ( null != locator ) { m_publicId = locator . getPublicId ( ) ; m_systemId = locator . getSystemId ( ) ; if ( null != m_systemId ) { try { m_href = SystemIDResolver . getAbsoluteURI ( m_systemId , null ) ; } catch ( TransformerException se ) { // Ignore this for right now } } super . setLocaterInfo ( locator ) ; }
public class FixedLengthInputFormat { /** * { @ inheritDoc } * @ throws IOException */ @ Override public FileBaseStatistics getStatistics ( BaseStatistics cachedStats ) throws IOException { } }
final FileBaseStatistics stats = super . getStatistics ( cachedStats ) ; return stats == null ? null : new FileBaseStatistics ( stats . getLastModificationTime ( ) , stats . getTotalInputSize ( ) , this . recordLength ) ;
public class PortalSessionScope { /** * / * ( non - Javadoc ) * @ see org . springframework . beans . factory . config . Scope # registerDestructionCallback ( java . lang . String , java . lang . Runnable ) */ @ Override public void registerDestructionCallback ( String name , Runnable callback ) { } }
final HttpSession session = this . getPortalSesion ( true ) ; final DestructionCallbackBindingListener callbackListener = new DestructionCallbackBindingListener ( callback ) ; session . setAttribute ( DESTRUCTION_CALLBACK_NAME_PREFIX + name , callbackListener ) ;
public class FileSystemLayout { /** * Derived form ' user . dir ' * @ return a FileSystemLayout instance */ public static FileSystemLayout create ( ) { } }
String userDir = System . getProperty ( USER_DIR ) ; if ( null == userDir ) { throw SwarmMessages . MESSAGES . systemPropertyNotFound ( USER_DIR ) ; } return create ( userDir ) ;
public class Hex { /** * Gets hex string corresponding to the given byte array from " < tt > from < / tt > " position to " < tt > to ' s < / tt > " * @ param bytes bytes . * @ param from from position . * @ param to to position . * @ return hex string . */ public static String get ( byte [ ] bytes , int from , ...
final StringBuilder bld = new StringBuilder ( ) ; for ( int i = from ; i < to ; i ++ ) { bld . append ( Hex . get ( bytes [ i ] ) ) ; } return bld . toString ( ) ;
public class StaticPageUtil { /** * Given the specified components , render them to a stand - alone HTML page ( which is returned as a String ) * @ param components Components to render * @ return Stand - alone HTML page , as a String */ public static String renderHTML ( Component ... components ) { } }
try { return renderHTMLContent ( components ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
public class CmsWebdavServlet { /** * Process a DELETE WebDAV request for the specified resource . < p > * @ param req the servlet request we are processing * @ param resp the servlet response we are creating * @ throws IOException if an input / output error occurs */ @ Override protected void doDelete ( HttpServ...
// Get the path to delete String path = getRelativePath ( req ) ; // Check if webdav is set to read only if ( m_readOnly ) { resp . setStatus ( CmsWebdavStatus . SC_FORBIDDEN ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_WEBDAV_READ_ONLY_0 ) ) ; } return ;...
public class WsByteBufferImpl { /** * @ see java . io . Externalizable # writeExternal ( java . io . ObjectOutput ) */ @ Override public void writeExternal ( ObjectOutput s ) throws IOException { } }
if ( ! removedFromLeakDetection ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Buffer being serialized but removeFromLeakDetection has not been called: " + this ) ; } } if ( oByteBuffer . isDirect ( ) ) { // hard code as local strings to help performance . // Strings...
public class RequestContextAssembly { /** * Enable { @ link RequestContext } during operators . */ @ SuppressWarnings ( { } }
"rawtypes" , "unchecked" } ) public static synchronized void enable ( ) { if ( enabled ) { return ; } oldOnObservableAssembly = RxJavaPlugins . getOnObservableAssembly ( ) ; RxJavaPlugins . setOnObservableAssembly ( compose ( oldOnObservableAssembly , new ConditionalOnCurrentRequestContextFunction < Observable > ( ) { ...
public class Compiler { /** * Marks the end of a pass . */ void endPass ( String passName ) { } }
checkState ( currentTracer != null , "Tracer should not be null at the end of a pass." ) ; stopTracer ( currentTracer , currentPassName ) ; afterPass ( passName ) ; currentPassName = null ; currentTracer = null ; maybeRunValidityCheck ( ) ;
public class EnvironmentsInner { /** * Get environment . * @ param resourceGroupName The name of the resource group . * @ param labAccountName The name of the lab Account . * @ param labName The name of the lab . * @ param environmentSettingName The name of the environment Setting . * @ param environmentName ...
return getWithServiceResponseAsync ( resourceGroupName , labAccountName , labName , environmentSettingName , environmentName , expand ) . map ( new Func1 < ServiceResponse < EnvironmentInner > , EnvironmentInner > ( ) { @ Override public EnvironmentInner call ( ServiceResponse < EnvironmentInner > response ) { return r...
public class ImmutableLightMetaProperty { /** * Creates an instance from a derived { @ code Method } . * @ param < P > the property type * @ param metaBean the meta bean , not null * @ param method the method , not null * @ param constructorIndex the index of the property * @ return the property , not null */...
PropertyGetter getter = new PropertyGetter ( ) { @ Override public Object get ( Bean bean ) { try { return method . invoke ( bean ) ; } catch ( IllegalArgumentException | IllegalAccessException ex ) { throw new UnsupportedOperationException ( "Property cannot be read: " + propertyName , ex ) ; } catch ( InvocationTarge...
public class KeyVaultClientCustomImpl { /** * Retrieves a list of individual key versions with the same key name . The full * key identifier , attributes , and tags are provided in the response . * Authorization : Requires the keys / list permission . * @ param vaultBaseUrl * The vault name , e . g . https : / ...
return getKeyVersions ( vaultBaseUrl , keyName , maxresults ) ;
public class JDBC4ClientConnectionPool { /** * Releases a connection . This method ( or connection . close ( ) must be called by the user thread * once the connection is no longer needed to release it back into the pool where other threads * can pick it up . Failure to do so will cause a memory leak as more and mor...
synchronized ( ClientConnections ) { connection . dispose ( ) ; if ( connection . users == 0 ) ClientConnections . remove ( connection . key ) ; }
public class JCECrypto { /** * Get an RSA public key utilizing the provided provider and PEM formatted string * @ param provider Provider to generate the key * @ param pem PEM formatted key string * @ return RSA public key */ public static RSAPublicKey getRSAPublicKeyFromPEM ( Provider provider , String pem ) { }...
try { KeyFactory keyFactory = KeyFactory . getInstance ( "RSA" , provider ) ; return ( RSAPublicKey ) keyFactory . generatePublic ( new X509EncodedKeySpec ( getKeyBytesFromPEM ( pem ) ) ) ; } catch ( NoSuchAlgorithmException e ) { throw new IllegalArgumentException ( "Algorithm SHA256withRSA is not available" , e ) ; }...
public class JvmTypesBuilder { /** * Attaches the given compile strategy to the given { @ link JvmExecutable } such that the compiler knows how to * implement the { @ link JvmExecutable } when it is translated to Java source code . * @ param executable the operation or constructor to add the method body to . If < c...
removeExistingBody ( executable ) ; setCompilationStrategy ( executable , strategy ) ;
public class ServerReadyEventHandler { /** * / * ( non - Javadoc ) * @ see com . tvd12 . ezyfox . sfs2x . serverhandler . ServerBaseEventHandler # notifyHandler ( com . tvd12 . ezyfox . core . structure . ServerHandlerClass ) */ @ Override protected void notifyHandler ( ServerHandlerClass handler ) { } }
Object instance = handler . newInstance ( ) ; assignDataToHandler ( handler , instance ) ; ReflectMethodUtil . invokeHandleMethod ( handler . getHandleMethod ( ) , instance , context ) ;
public class WebFluxTags { /** * Creates an { @ code outcome } tag based on the response status of the given * { @ code exchange } . * @ param exchange the exchange * @ return the outcome tag derived from the response status * @ since 2.1.0 */ public static Tag outcome ( ServerWebExchange exchange ) { } }
HttpStatus status = exchange . getResponse ( ) . getStatusCode ( ) ; if ( status != null ) { if ( status . is1xxInformational ( ) ) { return OUTCOME_INFORMATIONAL ; } if ( status . is2xxSuccessful ( ) ) { return OUTCOME_SUCCESS ; } if ( status . is3xxRedirection ( ) ) { return OUTCOME_REDIRECTION ; } if ( status . is4x...
public class MimeType { /** * Loads a file from a input stream containing all known mime types . The InputStream is a resource mapped from the * project resource directory . * @ param in InputStream */ private static void loadFile ( @ NotNull InputStream in ) { } }
try ( BufferedReader br = new BufferedReader ( new InputStreamReader ( in ) ) ) { String l ; while ( ( l = br . readLine ( ) ) != null ) { if ( l . length ( ) > 0 && l . charAt ( 0 ) != '#' ) { String [ ] tokens = l . split ( "\\s+" ) ; for ( int i = 1 ; i < tokens . length ; i ++ ) { mimes . put ( tokens [ i ] , token...
public class AuditLogWritingProcessor { /** * / * ( non - Javadoc ) * @ see org . duracloud . mill . workman . TaskProcessorBase # executeImpl ( ) */ @ Override protected void executeImpl ( ) throws TaskExecutionFailedException { } }
try { String account = task . getAccount ( ) ; String storeId = task . getStoreId ( ) ; String spaceId = task . getSpaceId ( ) ; String contentId = task . getContentId ( ) ; String action = task . getAction ( ) ; Map < String , String > props = task . getContentProperties ( ) ; String acls = task . getSpaceACLs ( ) ; D...
public class FactoryDetectPoint { /** * Detects Harris corners . * @ param configDetector Configuration for feature detector . * @ param configCorner Configuration for corner intensity computation . If null radius will match detector radius * @ param derivType Type of derivative image . * @ see boofcv . alg . f...
if ( configDetector == null ) configDetector = new ConfigGeneralDetector ( ) ; if ( configCorner == null ) { configCorner = new ConfigHarrisCorner ( ) ; configCorner . radius = configDetector . radius ; } GradientCornerIntensity < D > cornerIntensity = FactoryIntensityPointAlg . harris ( configCorner . radius , ( float...
public class Database { public DbAttribute get_device_attribute_property ( String devname , String attname ) throws DevFailed { } }
return databaseDAO . get_device_attribute_property ( this , devname , attname ) ;
public class PojoDescriptorGenerator { /** * This method determines the property descriptors of the { @ link net . sf . mmm . util . pojo . api . Pojo } identified * by { @ code inputType } . * @ param inputType is the { @ link JClassType } reflecting the input - type that triggered the generation via * { @ link ...
PojoDescriptorBuilder descriptorBuilder = PojoDescriptorBuilderFactoryImpl . getInstance ( ) . createPublicMethodDescriptorBuilder ( ) ; Class < ? > inputClass ; try { inputClass = Class . forName ( inputType . getQualifiedSourceName ( ) ) ; } catch ( ClassNotFoundException e ) { throw new TypeNotFoundException ( input...
public class BaseDestinationHandler { /** * Return the itemstream representing a transmit queue to a remote ME * @ param meUuid * @ return */ PtoPXmitMsgsItemStream getXmitQueuePoint ( SIBUuid8 meUuid ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getXmitQueuePoint" , meUuid ) ; PtoPXmitMsgsItemStream stream = getLocalisationManager ( ) . getXmitQueuePoint ( meUuid ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "get...
public class Params { /** * Test if numeric parameter is less than or equal to given threshold value . * @ param parameter invocation numeric parameter , * @ param value threshold value , * @ param name the name of invocation parameter . * @ throws IllegalArgumentException if < code > parameter < / code > is no...
if ( parameter > value ) { throw new IllegalArgumentException ( String . format ( "%s is not less than or equal %d." , name , value ) ) ; }
public class Languages { /** * Returns the language for the request . This process considers Request & * Response cookies , the Request ACCEPT _ LANGUAGE header , and finally the * application default language . * @ param routeContext * @ return the language for the request */ public String getLanguageOrDefault...
final String cookieName = generateLanguageCookie ( defaultLanguage ) . getName ( ) ; // Step 1 : Look for a Response cookie . // The Response always has priority over the Request because it may have // been set earlier in the HandlerChain . Cookie cookie = routeContext . getResponse ( ) . getCookie ( cookieName ) ; if ...
public class InstanceGroupManagerClient { /** * Creates a managed instance group using the information that you specify in the request . After * the group is created , instances in the group are created using the specified instance template . * This operation is marked as DONE when the group is created even if the ...
InsertInstanceGroupManagerHttpRequest request = InsertInstanceGroupManagerHttpRequest . newBuilder ( ) . setZone ( zone ) . setInstanceGroupManagerResource ( instanceGroupManagerResource ) . build ( ) ; return insertInstanceGroupManager ( request ) ;
public class Introspector { /** * Gets the < code > BeanInfo < / code > object which contains the information of * the properties , events and methods of the specified bean class . It will * not introspect the " stopclass " and its super class . * The < code > Introspector < / code > will cache the < code > BeanI...
if ( stopClass == null ) { // try to use cache return getBeanInfo ( beanClass ) ; } return getBeanInfoImplAndInit ( beanClass , stopClass , USE_ALL_BEANINFO ) ;
public class JsApiMessageImpl { /** * copyOf * This method has pretty much the same spec as the Java 1.6 Arrays . copyOf ( byte [ ] . . . ) * method , which can ' t be used because the Thin Client has to be able to run on v1.5. * There is no checking or error - throwing in this method , as it is expected to be ...
byte [ ] copy = new byte [ length ] ; if ( length <= original . length ) { System . arraycopy ( original , 0 , copy , 0 , length ) ; } else { System . arraycopy ( original , 0 , copy , 0 , original . length ) ; } return copy ;
public class YarnDriverRuntimeRestartManager { /** * Determines the number of times the Driver has been submitted based on the container ID environment * variable provided by YARN . If that fails , determine whether the application master is a restart * based on the number of previous containers reported by YARN . ...
final String containerIdString = YarnUtilities . getContainerIdString ( ) ; final ApplicationAttemptId appAttemptID = YarnUtilities . getAppAttemptId ( containerIdString ) ; if ( containerIdString == null || appAttemptID == null ) { LOG . log ( Level . WARNING , "Was not able to fetch application attempt, container ID ...
public class Client { /** * Delete the proxy history for the active profile * @ throws Exception exception */ public void clearHistory ( ) throws Exception { } }
String uri ; try { uri = HISTORY + uriEncode ( _profileName ) ; doDelete ( uri , null ) ; } catch ( Exception e ) { throw new Exception ( "Could not delete proxy history" ) ; }
public class DefaultPropertyPlaceholderResolver { /** * Resolves a single expression . * @ param context The context of the expression * @ param expression The expression * @ param type The class * @ param < T > The type the expression should be converted to * @ return The resolved and converted expression */...
if ( environment . containsProperty ( expression ) ) { return environment . getProperty ( expression , type ) . orElseThrow ( ( ) -> new ConfigurationException ( "Could not resolve expression: [" + expression + "] in placeholder ${" + context + "}" ) ) ; } if ( NameUtils . isEnvironmentName ( expression ) ) { String en...
public class Settings { /** * Reset Gosu Lab application - level settings to defaults . */ public static Map < String , ISettings > makeDefaultSettings ( ) { } }
Map < String , ISettings > settings = new TreeMap < > ( ) ; AppearanceSettings appearanceSettings = new AppearanceSettings ( ) ; appearanceSettings . resetToDefaultSettings ( null ) ; settings . put ( appearanceSettings . getPath ( ) , appearanceSettings ) ; return settings ;
public class DoubleUtils { /** * Is { @ code value } within { @ code tolerance } of being an integer ? */ public static boolean isCloseToIntegral ( final double value , final double tolerance ) { } }
return Math . abs ( value - Math . round ( value ) ) <= tolerance ;
public class TopicsInner { /** * List topic event types . * List event types for a topic . * @ param resourceGroupName The name of the resource group within the user ' s subscription . * @ param providerNamespace Namespace of the provider of the topic * @ param resourceTypeName Name of the topic type * @ para...
return listEventTypesWithServiceResponseAsync ( resourceGroupName , providerNamespace , resourceTypeName , resourceName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class CollectionJsonLinkDiscoverer { /** * ( non - Javadoc ) * @ see org . springframework . hateoas . core . JsonPathLinkDiscoverer # findLinksWithRel ( org . springframework . hateoas . LinkRelation , java . io . InputStream ) */ @ Override public Links findLinksWithRel ( LinkRelation relation , InputStream ...
return relation . isSameAs ( IanaLinkRelations . SELF ) ? addSelfLink ( super . findLinksWithRel ( relation , representation ) , representation ) : super . findLinksWithRel ( relation , representation ) ;
public class XPathContext { /** * Stringifies the XPath of the current node ' s parent . */ public String getParentXPath ( ) { } }
Iterator < Level > levelIterator = path . descendingIterator ( ) ; if ( levelIterator . hasNext ( ) ) { levelIterator . next ( ) ; } return getXPath ( levelIterator ) ;
public class ChemSequence { /** * Grows the chemModel array by a given size . * @ see growArraySize */ protected void growChemModelArray ( ) { } }
ChemModel [ ] newchemModels = new ChemModel [ chemModels . length + growArraySize ] ; System . arraycopy ( chemModels , 0 , newchemModels , 0 , chemModels . length ) ; chemModels = newchemModels ;
public class TemplateMatcher { /** * / * - - - - - [ Character Streams ] - - - - - */ public void replace ( Reader reader , Writer writer , VariableResolver resolver ) throws IOException { } }
BufferedReader breader = reader instanceof BufferedReader ? ( BufferedReader ) reader : new BufferedReader ( reader ) ; BufferedWriter bwriter = writer instanceof BufferedWriter ? ( BufferedWriter ) writer : new BufferedWriter ( writer ) ; try { boolean firstLine = true ; for ( String line ; ( line = breader . readLine...
public class AmfWriter { /** * Encodes an object in amf3 as an object of * the specified type * @ param obj The object to encode * @ param marker The type marker for this object * @ throws IOException */ public void encodeAmf3 ( Object obj , Amf3Type marker ) throws IOException { } }
out . write ( marker . ordinal ( ) ) ; if ( marker == Amf3Type . NULL ) { return ; // Null marker is enough } serializeAmf3 ( obj , marker ) ;
public class ReplaceableService { /** * Creates a service collection and starts it . * @ see AbstractLifecycle # onStart */ @ Override protected void onStart ( ) { } }
m_serviceCollection = new ServiceCollection < T > ( m_context , m_serviceClass , new CollectionListener ( ) ) ; m_serviceCollection . start ( ) ;
public class Day { /** * Compare this day to the specified day . If object is * not of type Day a ClassCastException is thrown . * @ param object Day object to compare to . * @ return @ see Comparable # compareTo ( Object ) * @ throws IllegalArgumentException If day is null . */ public int compareTo ( Day objec...
if ( object == null ) throw new IllegalArgumentException ( "day cannot be null" ) ; Day day = ( Day ) object ; return localDate . compareTo ( day . localDate ) ;
public class SynchronizedPDUSender { /** * ( non - Javadoc ) * @ see org . jsmpp . PDUSender # sendDataSmResp ( java . io . OutputStream , int , * java . lang . String , org . jsmpp . bean . OptionalParameter [ ] ) */ public byte [ ] sendDataSmResp ( OutputStream os , int sequenceNumber , String messageId , Optiona...
synchronized ( os ) { return pduSender . sendDataSmResp ( os , sequenceNumber , messageId , optionalParameters ) ; }
public class JGroupsSubsystemXMLWriter { /** * { @ inheritDoc } * @ see org . jboss . staxmapper . XMLElementWriter # writeContent ( org . jboss . staxmapper . XMLExtendedStreamWriter , java . lang . Object ) */ @ Override public void writeContent ( XMLExtendedStreamWriter writer , SubsystemMarshallingContext context...
context . startSubsystemElement ( JGroupsSchema . CURRENT . getNamespaceUri ( ) , false ) ; ModelNode model = context . getModelNode ( ) ; if ( model . isDefined ( ) ) { if ( model . hasDefined ( ChannelResourceDefinition . WILDCARD_PATH . getKey ( ) ) ) { writer . writeStartElement ( Element . CHANNELS . getLocalName ...
public class SARLValidator { /** * Check if the supertype of the given capacity is a subtype of Capacity . * @ param capacity the type to test . */ @ Check ( CheckType . FAST ) public void checkSuperTypes ( SarlCapacity capacity ) { } }
checkSuperTypes ( capacity , SARL_CAPACITY__EXTENDS , capacity . getExtends ( ) , Capacity . class , false ) ;
public class ns_image { /** * Use this API to fetch filtered set of ns _ image resources . * set the filter parameter values in filtervalue object . */ public static ns_image [ ] get_filtered ( nitro_service service , filtervalue [ ] filter ) throws Exception { } }
ns_image obj = new ns_image ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; ns_image [ ] response = ( ns_image [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class GradientActivity { /** * Override the default behavior and colorize gradient instead of converting input image . */ @ Override protected void renderBitmapImage ( BitmapMode mode , ImageBase image ) { } }
switch ( mode ) { case UNSAFE : { // this application is configured to use double buffer and could ignore all other modes VisualizeImageData . colorizeGradient ( derivX , derivY , - 1 , bitmap , bitmapTmp ) ; } break ; case DOUBLE_BUFFER : { VisualizeImageData . colorizeGradient ( derivX , derivY , - 1 , bitmapWork , b...
public class Config { /** * Returns a read - only { @ link com . hazelcast . core . ILock } configuration for * the given name . * The name is matched by pattern to the configuration and by stripping the * partition ID qualifier from the given { @ code name } . * If there is no config found by the name , it wil...
name = getBaseName ( name ) ; final LockConfig config = lookupByPattern ( configPatternMatcher , lockConfigs , name ) ; if ( config != null ) { return config . getAsReadOnly ( ) ; } return getLockConfig ( "default" ) . getAsReadOnly ( ) ;
public class AWSIotClient { /** * Lists the role aliases registered in your account . * @ param listRoleAliasesRequest * @ return Result of the ListRoleAliases operation returned by the service . * @ throws InvalidRequestException * The request is not valid . * @ throws ThrottlingException * The rate exceed...
request = beforeClientExecution ( request ) ; return executeListRoleAliases ( request ) ;
public class TaskRunner { /** * Runs a list of tasks starting from the input file as input to the first task , the following tasks use the preceding result * as input . The final result is written to the output . * @ param input the input file * @ param output the output file * @ param tasks the list of tasks ...
Progress progress = new Progress ( ) ; logger . info ( name + " started on " + progress . getStart ( ) ) ; int i = 0 ; NumberFormat nf = NumberFormat . getPercentInstance ( ) ; // FIXME : implement temp file handling as per issue # 47 TempFileWriter tempWriter = writeTempFiles ? tempFileWriter != null ? tempFileWriter ...
public class SpecializedOps_ZDRM { /** * Computes the quality of a triangular matrix , where the quality of a matrix * is defined in { @ link LinearSolverDense # quality ( ) } . In * this situation the quality is the magnitude of the product of * each diagonal element divided by the magnitude of the largest diago...
int N = Math . min ( T . numRows , T . numCols ) ; double max = elementDiagMaxMagnitude2 ( T ) ; if ( max == 0.0 ) return 0.0 ; max = Math . sqrt ( max ) ; int rowStride = T . getRowStride ( ) ; double qualityR = 1.0 ; double qualityI = 0.0 ; for ( int i = 0 ; i < N ; i ++ ) { int index = i * rowStride + i * 2 ; double...
public class NativeRSACoreEngine { /** * initialise the RSA engine . * @ param forEncryption true if we are encrypting , false otherwise . * @ param param the necessary RSA key parameters . */ public void init ( boolean forEncryption , CipherParameters param ) { } }
if ( param instanceof ParametersWithRandom ) { ParametersWithRandom rParam = ( ParametersWithRandom ) param ; key = ( RSAKeyParameters ) rParam . getParameters ( ) ; } else { key = ( RSAKeyParameters ) param ; } this . forEncryption = forEncryption ; if ( key instanceof RSAPrivateCrtKeyParameters ) { isPrivate = true ;...
public class C3P0PooledDataSourceProvider { /** * get the pooled datasource from c3p0 pool * @ param aDbType a supported database type . * @ param aDbUrl a connection url * @ param aUsername a username for the database * @ param aPassword a password for the database connection * @ return a DataSource a pooled...
final DataSource unPooledDS = DataSources . unpooledDataSource ( aDbUrl , aUsername , aPassword ) ; // override the default properties with ours final Map < String , String > props = this . getPoolingProperties ( aDbType ) ; return DataSources . pooledDataSource ( unPooledDS , props ) ;
public class PersistedHttpMessagesList { /** * { @ inheritDoc } * < strong > Note : < / strong > The returned message will be { @ code null } if an error occurred while loading the message from the * database ( for example , no longer exists ) . */ @ Override public HttpMessage get ( int index ) { } }
try { return historyReferences . get ( index ) . getHttpMessage ( ) ; } catch ( HttpMalformedHeaderException | DatabaseException e ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Failed to get the message from DB: " + e . getMessage ( ) , e ) ; } } return null ;
public class CPRuleAssetCategoryRelLocalServiceWrapper { /** * Returns the cp rule asset category rel with the primary key . * @ param CPRuleAssetCategoryRelId the primary key of the cp rule asset category rel * @ return the cp rule asset category rel * @ throws PortalException if a cp rule asset category rel wit...
return _cpRuleAssetCategoryRelLocalService . getCPRuleAssetCategoryRel ( CPRuleAssetCategoryRelId ) ;
public class ParserRegistry { /** * Returns all warning parsers registered by extension points * { @ link WarningsParser } and { @ link AbstractWarningsParser } . * @ return the extension list */ @ SuppressWarnings ( "javadoc" ) private static List < AbstractWarningsParser > all ( ) { } }
Hudson instance = Hudson . getInstance ( ) ; if ( instance == null ) { return Lists . newArrayList ( ) ; } List < AbstractWarningsParser > parsers = Lists . newArrayList ( instance . getExtensionList ( AbstractWarningsParser . class ) ) ; addParsersWithDeprecatedApi ( instance , parsers ) ; return parsers ;
public class CUDA_MEMCPY2D { /** * Creates and returns a string representation of this object , * using the given separator for the fields * @ param f Separator * @ return A String representation of this object */ private String createString ( String f ) { } }
return "srcXInBytes=" + srcXInBytes + f + "srcY=" + srcY + f + "srcMemoryType=" + CUmemorytype . stringFor ( srcMemoryType ) + f + "srcHost =" + srcHost + f + "srcDevice =" + srcDevice + f + "srcArray =" + srcArray + f + "srcPitch=" + srcPitch + f + "dstXInBytes=" + dstXInBytes + f + "dstY=" + dstY + f + "dstMemoryType...
public class Cluster { /** * A list of cluster security group that are associated with the cluster . Each security group is represented by an * element that contains < code > ClusterSecurityGroup . Name < / code > and < code > ClusterSecurityGroup . Status < / code > * subelements . * Cluster security groups are ...
if ( this . clusterSecurityGroups == null ) { setClusterSecurityGroups ( new com . amazonaws . internal . SdkInternalList < ClusterSecurityGroupMembership > ( clusterSecurityGroups . length ) ) ; } for ( ClusterSecurityGroupMembership ele : clusterSecurityGroups ) { this . clusterSecurityGroups . add ( ele ) ; } return...
public class ParallelIndexSupervisorTask { /** * { @ link ParallelIndexSubTask } s call this API to report the segments they ' ve generated and pushed . */ @ POST @ Path ( "/report" ) @ Consumes ( SmileMediaTypes . APPLICATION_JACKSON_SMILE ) public Response report ( PushedSegmentsReport report , @ Context final HttpSe...
ChatHandlers . authorizationCheck ( req , Action . WRITE , getDataSource ( ) , authorizerMapper ) ; if ( runner == null ) { return Response . status ( Response . Status . SERVICE_UNAVAILABLE ) . entity ( "task is not running yet" ) . build ( ) ; } else { runner . collectReport ( report ) ; return Response . ok ( ) . bu...
public class ChildFirst { /** * Loads a given set of class descriptions and their binary representations using a child - first class loader . * @ param classLoader The parent class loader . * @ param types The unloaded types to be loaded . * @ param protectionDomain The protection domain to apply where { @ code n...
Map < String , byte [ ] > typesByName = new HashMap < String , byte [ ] > ( ) ; for ( Map . Entry < TypeDescription , byte [ ] > entry : types . entrySet ( ) ) { typesByName . put ( entry . getKey ( ) . getName ( ) , entry . getValue ( ) ) ; } classLoader = new ChildFirst ( classLoader , sealed , typesByName , protecti...
public class Locale { /** * Replies the text that corresponds to the specified resource . * < p > This function assumes the classname of the caller as the * resource provider . * @ param key is the name of the resource into the specified file * @ param params is the the list of parameters which will * replace...
final Class < ? > resource = detectResourceClass ( null ) ; return getString ( ClassLoaderFinder . findClassLoader ( ) , resource , key , params ) ;
public class Genotype { /** * Create a new { @ code Genotype } which consists of { @ code n } chromosomes , * which are created by the given { @ code factory } . This method can be used * for easily creating a < i > gene matrix < / i > . The following example will * create a 10x5 { @ code DoubleGene } < i > matri...
final ISeq < Chromosome < G > > ch = ISeq . of ( factory :: newInstance , n ) ; return new Genotype < > ( ch ) ;
public class ManagedDatabasesInner { /** * Creates a new database or updates an existing database . * @ 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 managedInstanceName The name of the mana...
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , managedInstanceName , databaseName , parameters ) . map ( new Func1 < ServiceResponse < ManagedDatabaseInner > , ManagedDatabaseInner > ( ) { @ Override public ManagedDatabaseInner call ( ServiceResponse < ManagedDatabaseInner > response ) { return res...
public class Stylesheet { /** * Add a stylesheet to the " import " list . * @ see < a href = " http : / / www . w3 . org / TR / xslt # import " > import in XSLT Specification < / a > * @ param v Stylesheet to add to the import list */ public void setImport ( StylesheetComposed v ) { } }
if ( null == m_imports ) m_imports = new Vector ( ) ; // I ' m going to insert the elements in backwards order , // so I can walk them 0 to n . m_imports . addElement ( v ) ;
public class NaetherImpl { /** * / * ( non - Javadoc ) * @ see com . tobedevoured . naether . api . Naether # addRemoteRepositoryByUrl ( java . lang . String ) */ public void addRemoteRepositoryByUrl ( String url ) throws NaetherException { } }
try { addRemoteRepository ( RepoBuilder . remoteRepositoryFromUrl ( url ) ) ; } catch ( MalformedURLException e ) { log . error ( "Malformed url: {}" , url , e ) ; throw new NaetherException ( e ) ; }
public class GraphicUtils { /** * Draws a circle with the specified diameter using the given point coordinates as center * and fills it with the current color of the graphics context . * @ param g Graphics context * @ param centerX X coordinate of circle center * @ param centerY Y coordinate of circle center ...
g . fillOval ( ( int ) ( centerX - diam / 2 ) , ( int ) ( centerY - diam / 2 ) , diam , diam ) ;
public class CollectionUtil { /** * / * - - - - - [ To Primitive Array ] - - - - - */ public static boolean [ ] toBooleanArray ( Collection < Boolean > c ) { } }
boolean arr [ ] = new boolean [ c . size ( ) ] ; int i = 0 ; for ( Boolean item : c ) arr [ i ++ ] = item ; return arr ;
public class DDLCompiler { /** * Checks whether or not the start of the given identifier is java ( and * thus DDL ) compliant . An identifier may start with : _ [ a - zA - Z ] $ * @ param identifier the identifier to check * @ param statement the statement where the identifier is * @ return the given identifier...
assert identifier != null && ! identifier . trim ( ) . isEmpty ( ) ; assert statement != null && ! statement . trim ( ) . isEmpty ( ) ; int loc = 0 ; do { if ( ! Character . isJavaIdentifierStart ( identifier . charAt ( loc ) ) ) { String msg = "Unknown indentifier in DDL: \"" + statement . substring ( 0 , statement . ...
public class Reader { /** * A comma - separated list of paths pointing to a folder , jar or zip which contains EMF resources . * Example use ( MWE2 ) : * < code > * path = " . / foo / bar . jar , . / src / main / model " * < / code > * Example use ( MWE1 ) : * < code > * & lt ; path value = " . / foo / ba...
for ( String p : path . split ( "," ) ) { this . pathes . add ( p . trim ( ) ) ; }
public class SimonUtils { /** * Returns multi - line string containing Simon tree starting with the specified Simon . * Root Simon can be used to obtain tree with all Simons . Returns { @ code null } for * input value of null or for NullSimon or any Simon with name equal to null ( anonymous * Simons ) - this is a...
if ( simon == null || simon . getName ( ) == null ) { return null ; } StringBuilder sb = new StringBuilder ( ) ; printSimonTree ( 0 , simon , sb ) ; return sb . toString ( ) ;
public class Closeables { /** * Closes the given { @ link Reader } , logging any { @ code IOException } that ' s thrown rather than * propagating it . * < p > While it ' s not safe in the general case to ignore exceptions that are thrown when closing * an I / O resource , it should generally be safe in the case o...
try { close ( reader , true ) ; } catch ( IOException impossible ) { throw new AssertionError ( impossible ) ; }
public class IteratorStream { @ Override public < K , V , C extends Collection < V > , M extends Multimap < K , V , C > > M toMultimap ( Function < ? super T , ? extends K > keyMapper , Function < ? super T , ? extends V > valueMapper , Supplier < ? extends M > mapFactory ) { } }
assertNotClosed ( ) ; try { final M result = mapFactory . get ( ) ; T next = null ; while ( elements . hasNext ( ) ) { next = elements . next ( ) ; result . put ( keyMapper . apply ( next ) , valueMapper . apply ( next ) ) ; } return result ; } finally { close ( ) ; }
public class RandomLong { /** * Generates a random sequence of longs starting from 0 like : [ 0,1,2,3 . . . ? ? ] * @ param min minimum value of the long that will be generated . If ' max ' is * omitted , then ' max ' is set to ' min ' and ' min ' is set to 0. * @ param max ( optional ) maximum value of the long ...
long count = nextLong ( min , max ) ; List < Long > result = new ArrayList < Long > ( ) ; for ( long i = 0 ; i < count ; i ++ ) result . add ( i ) ; return result ;
public class ObjectManagerState { /** * Create a checkpoint of this ObjectManagerState and all active transactions in the Log , sufficient to restart from . * @ param persistentTransactions true if we checkpoint both persistent ( logged ) and non persistent objects * otherwise we only checkpoint the non persistent ...
final String methodName = "performCheckpoint" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Boolean ( persistentTransactions ) ) ; if ( gatherStatistics ) { long now = System . currentTimeMillis ( ) ; waitingBetweenCheckpointsMilliseconds += no...
public class EncryptUtil { /** * md5加密 < / br > * @ praram str 需要进行md5加密的字符 * @ return 已进行md5的加密的字符 */ public static String md5 ( String str ) { } }
String md5 = encode ( str , "MD5" ) . toLowerCase ( ) ; return md5 ;
public class MapModel { /** * Add layer selection handler . * @ param handler * the handler to be registered * @ return handler registration * @ since 1.6.0 */ @ Api public HandlerRegistration addLayerSelectionHandler ( final LayerSelectionHandler handler ) { } }
return handlerManager . addHandler ( LayerSelectionHandler . TYPE , handler ) ;
public class AmortizedPQueue { /** * / * These 2 methods not guaranteed to be fast . */ public PCollection < E > minus ( Object e ) { } }
return Empty . < E > vector ( ) . plusAll ( this ) . minus ( e ) ;
public class BuyerPriceCategory { /** * < p > Setter for buyer . < / p > * @ param pBuyer reference */ public final void setBuyer ( final OnlineBuyer pBuyer ) { } }
this . buyer = pBuyer ; if ( this . itsId == null ) { this . itsId = new BuyerPriceCategoryId ( ) ; } this . itsId . setBuyer ( this . buyer ) ;
public class GenericsUtils { /** * For a given classnode , fills in the supplied map with the parameterized * types it defines . * @ param node the class node to check * @ param map the generics type information collector */ public static void extractPlaceholders ( ClassNode node , Map < GenericsTypeName , Generi...
if ( node == null ) return ; if ( node . isArray ( ) ) { extractPlaceholders ( node . getComponentType ( ) , map ) ; return ; } if ( ! node . isUsingGenerics ( ) || ! node . isRedirectNode ( ) ) return ; GenericsType [ ] parameterized = node . getGenericsTypes ( ) ; if ( parameterized == null || parameterized . length ...
public class Delay { /** * Creates a new { @ link ExponentialDelay } on with custom boundaries and factor ( eg . with upper 9000 , lower 0 , powerOf 10 : 1, * 10 , 100 , 1000 , 9000 , 9000 , 9000 , . . . ) . * @ param lower the lower boundary , must be non - negative * @ param upper the upper boundary , must be g...
LettuceAssert . notNull ( lower , "Lower boundary must not be null" ) ; LettuceAssert . isTrue ( lower . toNanos ( ) >= 0 , "Lower boundary must be greater or equal to 0" ) ; LettuceAssert . notNull ( upper , "Upper boundary must not be null" ) ; LettuceAssert . isTrue ( upper . toNanos ( ) > lower . toNanos ( ) , "Upp...
public class ReferenceCollectingCallback { /** * Updates block stack . */ @ Override public boolean shouldTraverse ( NodeTraversal nodeTraversal , Node n , Node parent ) { } }
// We automatically traverse a hoisted function body when that function // is first referenced , so that the reference lists are in the right order . // TODO ( nicksantos ) : Maybe generalize this to a continuation mechanism // like in RemoveUnusedCode . if ( NodeUtil . isHoistedFunctionDeclaration ( n ) ) { Node nameN...
public class FileHandlerUtil { /** * Generate file name . * @ param date the date * @ return the string */ public static String generateAuditArchiveFileName ( Date date ) { } }
StringBuffer name = new StringBuffer ( ) ; name . append ( "Audit_Archive-" ) . append ( AuditUtil . dateToString ( date , "yyyy-MM-dd" ) ) . append ( CoreConstants . AUDIT_ARCHIVE_EXTENTION ) ; return name . toString ( ) ;
public class Caster { /** * cast a Object to a boolean value ( primitive value type ) * @ param str String to cast * @ return casted boolean value * @ throws PageException */ public static boolean toBooleanValue ( String str ) throws PageException { } }
Boolean b = toBoolean ( str , null ) ; if ( b != null ) return b . booleanValue ( ) ; throw new CasterException ( "Can't cast String [" + CasterException . crop ( str ) + "] to a boolean" ) ;
public class CmsUploadDialogImpl { /** * Adds the given file input field to this dialog . < p > * @ param fileInput the file input field to add */ @ Override protected void addFileInput ( CmsFileInput fileInput ) { } }
// add the files selected by the user to the list of files to upload if ( fileInput != null ) { m_inputsToUpload . put ( fileInput . getFiles ( ) [ 0 ] . getFileName ( ) , fileInput ) ; } super . addFileInput ( fileInput ) ;
public class FileUtil { /** * 从文件中读取每一行数据 * @ param url 文件的URL * @ param charset 字符集 * @ return 文件中的每行内容的集合List * @ throws IORuntimeException IO异常 */ public static List < String > readLines ( URL url , String charset ) throws IORuntimeException { } }
return readLines ( url , charset , new ArrayList < String > ( ) ) ;
public class TraceStep { /** * Returns the last step in this execution . * @ return this step if it has no chidlren or the last step from the children . */ public TraceStep getLastStep ( ) { } }
TraceStep result = this ; while ( true ) { if ( result . children == null || result . children . size ( ) == 0 ) return result ; result = result . children . get ( result . children . size ( ) - 1 ) ; }
public class DefaultRedirectResolver { /** * Compares two strings but treats empty string or null equal * @ param str1 * @ param str2 * @ return true if strings are equal , false otherwise */ private boolean isEqual ( String str1 , String str2 ) { } }
if ( StringUtils . isEmpty ( str1 ) && StringUtils . isEmpty ( str2 ) ) { return true ; } else if ( ! StringUtils . isEmpty ( str1 ) ) { return str1 . equals ( str2 ) ; } else { return false ; }
public class ApiOvhEmailexchange { /** * Get this object properties * REST : GET / email / exchange / { organizationName } / service / { exchangeService } / domain / { domainName } / disclaimer * @ param organizationName [ required ] The internal name of your exchange organization * @ param exchangeService [ requ...
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/domain/{domainName}/disclaimer" ; StringBuilder sb = path ( qPath , organizationName , exchangeService , domainName ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhDisclaimer . class ) ;
public class HeaderedArchiveRecord { /** * Read header if present . Technique borrowed from HttpClient HttpParse * class . Using http parser code for now . Later move to more generic header * parsing code if there proves a need . * @ return ByteArrayInputStream with the http header in it or null if no * http he...
// If judged a record that doesn ' t have an http header , return // immediately . if ( ! hasContentHeaders ( ) ) { return null ; } byte [ ] statusBytes = LaxHttpParser . readRawLine ( getIn ( ) ) ; int eolCharCount = getEolCharsCount ( statusBytes ) ; if ( eolCharCount <= 0 ) { throw new IOException ( "Failed to read ...
public class Iterate { /** * Flip the keys and values of the multimap . */ public static < K , V > HashBagMultimap < V , K > flip ( ListMultimap < K , V > listMultimap ) { } }
final HashBagMultimap < V , K > result = new HashBagMultimap < V , K > ( ) ; listMultimap . forEachKeyMultiValues ( new Procedure2 < K , Iterable < V > > ( ) { public void value ( final K key , Iterable < V > values ) { Iterate . forEach ( values , new Procedure < V > ( ) { public void value ( V value ) { result . put ...
public class StringUtils { /** * Trim all occurrences of the supplied trailing character from the given { @ code String } . * @ param str the { @ code String } to check * @ param trailingCharacter the trailing character to be trimmed * @ return the trimmed { @ code String } */ public static String trimTrailingCha...
if ( ! StringUtils . hasLength ( str ) ) { return str ; } final StringBuilder sb = new StringBuilder ( str ) ; while ( sb . length ( ) > 0 && sb . charAt ( sb . length ( ) - 1 ) == trailingCharacter ) { sb . deleteCharAt ( sb . length ( ) - 1 ) ; } return sb . toString ( ) ;
public class DeferredReleaser { /** * Schedules deferred release . * The object will be released after the current Looper ' s loop , * unless { @ code cancelDeferredRelease } is called before then . * @ param releasable Object to release . */ public void scheduleDeferredRelease ( Releasable releasable ) { } }
ensureOnUiThread ( ) ; if ( ! mPendingReleasables . add ( releasable ) ) { return ; } // Posting to the UI queue is an O ( n ) operation , so we only do it once . // The one runnable does all the releases . if ( mPendingReleasables . size ( ) == 1 ) { mUiHandler . post ( releaseRunnable ) ; }
public class systemglobal_authenticationlocalpolicy_binding { /** * Use this API to fetch filtered set of systemglobal _ authenticationlocalpolicy _ binding resources . * filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */ public static systemglobal_authenticationlocalpolicy_binding ...
systemglobal_authenticationlocalpolicy_binding obj = new systemglobal_authenticationlocalpolicy_binding ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; systemglobal_authenticationlocalpolicy_binding [ ] response = ( systemglobal_authenticationlocalpolicy_binding [ ] ) obj . getfiltered ( servi...