signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class BaseSparseNDArrayCOO { /** * Create a DataBuffer for indices of given arrays of indices . * @ param indices * @ param shape * @ return */ protected static DataBuffer createIndiceBuffer ( long [ ] [ ] indices , long [ ] shape ) { } }
checkNotNull ( indices ) ; checkNotNull ( shape ) ; if ( indices . length == 0 ) { return Nd4j . getDataBufferFactory ( ) . createLong ( shape . length ) ; } if ( indices . length == shape . length ) { return Nd4j . createBuffer ( ArrayUtil . flattenF ( indices ) ) ; } return Nd4j . createBuffer ( ArrayUtil . flatten (...
public class FilePickerFragment { /** * Name is validated to be non - null , non - empty and not containing any * slashes . * @ param name The name of the folder the user wishes to create . */ @ Override public void onNewFolder ( @ NonNull final String name ) { } }
File folder = new File ( mCurrentPath , name ) ; if ( folder . mkdir ( ) ) { refresh ( folder ) ; } else { Toast . makeText ( getActivity ( ) , R . string . nnf_create_folder_error , Toast . LENGTH_SHORT ) . show ( ) ; }
public class InsightClient { /** * Perform an Advanced Insight Request with a number . * @ param number A single phone number that you need insight about in national or international format . * @ return A { @ link AdvancedInsightResponse } representing the response from the Nexmo Number Insight API . * @ throws I...
return getAdvancedNumberInsight ( AdvancedInsightRequest . withNumber ( number ) ) ;
public class OrganizationHandler { /** * Returns an Organization * @ param organizationId String * @ return DbOrganization */ public DbOrganization getOrganization ( final String organizationId ) { } }
final DbOrganization dbOrganization = repositoryHandler . getOrganization ( organizationId ) ; if ( dbOrganization == null ) { throw new WebApplicationException ( Response . status ( Response . Status . NOT_FOUND ) . entity ( "Organization " + organizationId + " does not exist." ) . build ( ) ) ; } return dbOrganizatio...
public class LdapTemplate { /** * { @ inheritDoc } */ @ Override public < T > List < T > findAll ( Class < T > clazz ) { } }
return findAll ( LdapUtils . emptyLdapName ( ) , getDefaultSearchControls ( defaultSearchScope , RETURN_OBJ_FLAG , ALL_ATTRIBUTES ) , clazz ) ;
public class WstxEventFactory { /** * Must override this method to use a more efficient StartElement * implementation */ @ SuppressWarnings ( "unchecked" ) @ Override protected StartElement createStartElement ( QName name , Iterator < ? > attr , Iterator < ? > ns , NamespaceContext ctxt ) { } }
return SimpleStartElement . construct ( mLocation , name , ( Iterator < Attribute > ) attr , ( Iterator < Namespace > ) ns , ctxt ) ;
public class VarSetBuilder { /** * Adds a variable set annotation if the given value is non - null */ public VarSetBuilder hasIf ( String name , Object value ) { } }
return value != null ? has ( name , value ) : this ;
public class LogoutRequestState { /** * { @ inheritDoc } */ public final void execute ( ) throws InternetSCSIException { } }
final ProtocolDataUnit protocolDataUnit = protocolDataUnitFactory . create ( true , true , OperationCode . LOGOUT_REQUEST , connection . getSetting ( OperationalTextKey . HEADER_DIGEST ) , connection . getSetting ( OperationalTextKey . DATA_DIGEST ) ) ; final LogoutRequestParser logoutRequest = ( LogoutRequestParser ) ...
public class AmazonRedshiftClient { /** * Deletes a snapshot schedule . * @ param deleteSnapshotScheduleRequest * @ return Result of the DeleteSnapshotSchedule operation returned by the service . * @ throws InvalidClusterSnapshotScheduleStateException * The cluster snapshot schedule state is not valid . * @ t...
request = beforeClientExecution ( request ) ; return executeDeleteSnapshotSchedule ( request ) ;
public class OWLObjectMaxCardinalityImpl_CustomFieldSerializer { /** * Deserializes the content of the object from the * { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } . * @ param streamReader the { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } to rea...
deserialize ( streamReader , instance ) ;
public class Discovery { /** * List collections . * Lists existing collections for the service instance . * @ param listCollectionsOptions the { @ link ListCollectionsOptions } containing the options for the call * @ return a { @ link ServiceCall } with a response type of { @ link ListCollectionsResponse } */ pub...
Validator . notNull ( listCollectionsOptions , "listCollectionsOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "collections" } ; String [ ] pathParameters = { listCollectionsOptions . environmentId ( ) } ; RequestBuilder builder = RequestBuilder . get ( RequestBuilder . constructHttpUrl ( ge...
public class DefaultGroovyMethods { /** * Returns the first non - null closure result found by passing each map entry to the closure , otherwise the defaultResult is returned . * If the closure takes two parameters , the entry key and value are passed . * If the closure takes one parameter , the Map . Entry object ...
T result = findResult ( self , closure ) ; if ( result == null ) return defaultResult ; return result ;
public class PrimaryBackupServerContext { /** * Handles a close request . */ private CompletableFuture < CloseResponse > close ( CloseRequest request ) { } }
return getService ( request ) . thenCompose ( service -> service . close ( request ) ) ;
public class JPAPUnitInfo { /** * d510184 */ JPAEMPool getEntityManagerPool ( J2EEName j2eeName , String refName , Map < ? , ? > properties ) { } }
JPAEMPool emPool = null ; String poolKey = j2eeName . toString ( ) + "#" + refName ; synchronized ( ivEMPoolMap ) { emPool = ivEMPoolMap . get ( poolKey ) ; if ( emPool == null ) { EntityManagerFactory emf = getEntityManagerFactory ( j2eeName ) ; emPool = new JPAEMPool ( emf , properties , ivEMPoolCapacity , this , get...
public class JShell { /** * Returns the active import snippets . * This convenience method is equivalent to { @ code snippets ( ) } filtered for * { @ link jdk . jshell . Snippet . Status # isActive ( ) status ( snippet ) . isActive ( ) } * { @ code & & snippet . kind ( ) = = Kind . IMPORT } * and cast to Impor...
return snippets ( ) . filter ( sn -> status ( sn ) . isActive ( ) && sn . kind ( ) == Snippet . Kind . IMPORT ) . map ( sn -> ( ImportSnippet ) sn ) ;
public class PackageDocImpl { /** * Get included enum types in this package . * @ return included enum types in this package . */ public ClassDoc [ ] enums ( ) { } }
ListBuffer < ClassDocImpl > ret = new ListBuffer < ClassDocImpl > ( ) ; for ( ClassDocImpl c : getClasses ( true ) ) { if ( c . isEnum ( ) ) { ret . append ( c ) ; } } return ret . toArray ( new ClassDocImpl [ ret . length ( ) ] ) ;
public class CompositeArtifactStore { /** * { @ inheritDoc } */ public long getMetadataLastModified ( String path ) throws IOException , MetadataNotFoundException { } }
boolean found = false ; long lastModified = 0 ; for ( int i = 0 ; i < stores . length ; i ++ ) { try { if ( ! found ) { lastModified = stores [ i ] . getMetadataLastModified ( path ) ; found = true ; } else { lastModified = Math . max ( lastModified , stores [ i ] . getMetadataLastModified ( path ) ) ; } } catch ( Meta...
public class RoleAssignmentsInner { /** * Get the specified role assignment . * @ param scope The scope of the role assignment . * @ param roleAssignmentName The name of the role assignment to get . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws Illega...
return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( scope , roleAssignmentName ) , serviceCallback ) ;
public class SanitizedContent { /** * Creates a SanitizedContent object with default direction . */ static SanitizedContent create ( String content , ContentKind kind ) { } }
checkArgument ( kind != ContentKind . TEXT , "Use UnsanitizedString for SanitizedContent with a kind of TEXT" ) ; if ( Flags . stringIsNotSanitizedContent ( ) ) { return new SanitizedContent ( content , kind , kind . getDefaultDir ( ) ) ; } return SanitizedCompatString . create ( content , kind , kind . getDefaultDir (...
public class FatJarBuilder { /** * builds war with classes inside * @ param classPathEntries class path entries as ArtifactSpec or URLs * @ return the war file */ private File buildWar ( List < ArtifactOrFile > classPathEntries ) { } }
try { List < String > classesUrls = classPathEntries . stream ( ) . map ( ArtifactOrFile :: file ) . filter ( this :: isDirectory ) . filter ( url -> url . contains ( "classes" ) ) . collect ( Collectors . toList ( ) ) ; List < File > classpathJars = classPathEntries . stream ( ) . map ( ArtifactOrFile :: file ) . filt...
public class TransformationAction { /** * Applies the instrumentation . * @ param root The root folder that contains all class files . * @ param classPath An iterable over all class path elements . * @ throws IOException If an I / O exception occurs . */ @ SuppressWarnings ( "unchecked" ) private void apply ( Fil...
if ( ! root . isDirectory ( ) ) { throw new GradleException ( "Not a directory: " + root ) ; } ClassLoaderResolver classLoaderResolver = new ClassLoaderResolver ( ) ; try { List < Plugin . Factory > factories = new ArrayList < Plugin . Factory > ( byteBuddyExtension . getTransformations ( ) . size ( ) ) ; for ( Transfo...
public class ProtocolConfig { /** * Sets a positive number indicating how many < code > unacked < / code > or < code > unordered < / code > packaged user - datas should be * queued maximally until they can be resolved . Defaults to { @ link ProtocolConfig # MAX _ PACKET _ QUEUE _ LIMIT } . * @ param packetQueueLimi...
packetQueueLimit = packetQueueLimit < MAX_PACKET_QUEUE_LIMIT ? packetQueueLimit : MAX_PACKET_QUEUE_LIMIT ; packetQueueLimit = packetQueueLimit >= 0 ? packetQueueLimit : 0 ; this . packetQueueLimit = packetQueueLimit ;
public class UserApi { /** * Get a list of currently authenticated user ' s SSH keys . * < pre > < code > GitLab Endpoint : GET / user / keys < / code > < / pre > * @ return a list of currently authenticated user ' s SSH keys * @ throws GitLabApiException if any exception occurs */ public List < SshKey > getSshKe...
Response response = get ( Response . Status . OK , getDefaultPerPageParam ( ) , "user" , "keys" ) ; return ( response . readEntity ( new GenericType < List < SshKey > > ( ) { } ) ) ;
public class InMemoryOutput { /** * Returns a list of lists where the outer list has one element for each * reduce shard , which is a list of the values emitted by that shard , in * order . */ @ Override public List < List < O > > finish ( Collection < ? extends OutputWriter < O > > writers ) { } }
ImmutableList . Builder < List < O > > out = ImmutableList . builder ( ) ; for ( OutputWriter < O > w : writers ) { InMemoryOutputWriter < O > writer = ( InMemoryOutputWriter < O > ) w ; out . add ( ImmutableList . copyOf ( writer . getResult ( ) ) ) ; } return out . build ( ) ;
public class Util { /** * Creates a Predicate that returns false if source contains an associated class that is a super * type of the class associated with the tested T . * @ param < T > the type to test * @ param source the set of & lt ; T & gt ; to look for class matches . * @ param toClass Function from T to...
return input -> { final Class < ? > inputClass = toClass . apply ( input ) ; for ( final Class < ? > match : Iterables . transform ( source , toClass ) ) { if ( ! inputClass . equals ( match ) && inputClass . isAssignableFrom ( match ) ) { return false ; } } return true ; } ;
public class Path { /** * Checks if the directory of this path is absolute . * @ return < code > true < / code > if the directory of this path is absolute , < code > false < / code > otherwise */ public boolean isAbsolute ( ) { } }
final int start = hasWindowsDrive ( uri . getPath ( ) , true ) ? 3 : 0 ; return uri . getPath ( ) . startsWith ( SEPARATOR , start ) ;
public class ElementFilter { /** * Returns a list of constructors in { @ code elements } . * @ return a list of constructors in { @ code elements } * @ param elements the elements to filter */ public static List < ExecutableElement > constructorsIn ( Iterable < ? extends Element > elements ) { } }
return listFilter ( elements , CONSTRUCTOR_KIND , ExecutableElement . class ) ;
public class TreeRule { /** * Attempts to delete the specified rule from storage * @ param tsdb The TSDB to use for storage access * @ param tree _ id ID of the tree the rule belongs to * @ param level Level where the rule resides * @ param order Order where the rule resides * @ return A deferred without mean...
if ( tree_id < 1 || tree_id > 65535 ) { throw new IllegalArgumentException ( "Invalid Tree ID" ) ; } if ( level < 0 ) { throw new IllegalArgumentException ( "Invalid rule level" ) ; } if ( order < 0 ) { throw new IllegalArgumentException ( "Invalid rule order" ) ; } final DeleteRequest delete = new DeleteRequest ( tsdb...
public class Tracer { /** * Pop CCM context * @ param key The frame key * @ param callstack The call stack */ public static synchronized void popCCMContext ( String key , Throwable callstack ) { } }
log . tracef ( "%s" , new TraceEvent ( "CachedConnectionManager" , "NONE" , TraceEvent . POP_CCM_CONTEXT , "NONE" , key , callstack != null ? toString ( callstack ) : "" ) ) ;
public class MimeUtils { /** * Creates a new { @ link javax . activation . MimeType } from a string , but issues a * { @ link RuntimeException } instead of a checked { @ link MimeTypeParseException } * in case the string cannot be parsed . Useful when creating constants for which * we are certain that no exceptio...
try { return new MimeType ( type ) ; } catch ( MimeTypeParseException ex ) { throw new RuntimeException ( ex ) ; }
public class VueGWTObserverManager { /** * Customize the VueObserver instance . We get in between to be warned whenever an object is * observed and observe it using our Java observers if necessary . * @ param vueObserver A { @ link VueObserver } */ public void customizeVueObserverPrototype ( VueObserver vueObserver...
vueObserveArrayFunction = vueObserver . getObserveArray ( ) ; vueWalkFunction = vueObserver . getWalk ( ) ; vueObserver . setWalk ( toObserve -> { if ( observeJavaObject ( toObserve ) ) { return ; } vueWalkFunction . call ( this , toObserve ) ; } ) ;
public class FileModeMapper { /** * Utility method to create a FileModeMapper for the given entry , and use it to map the file mode onto the given * file . * @ param entry the archive entry that holds the mode * @ param file the file to apply the mode onto */ public static void map ( ArchiveEntry entry , File fil...
create ( entry ) . map ( file ) ;
public class TFDictionary { /** * 按照频率从高到低排序的条目 * @ return */ public TreeSet < TermFrequency > values ( ) { } }
TreeSet < TermFrequency > set = new TreeSet < TermFrequency > ( Collections . reverseOrder ( ) ) ; for ( Map . Entry < String , TermFrequency > entry : entrySet ( ) ) { set . add ( entry . getValue ( ) ) ; } return set ;
public class CloudDirectoryUtils { /** * Gets object ref by path . * @ param path the path * @ return the object ref by path */ public static ObjectReference getObjectRefByPath ( final String path ) { } }
if ( path == null ) { return null ; } return new ObjectReference ( ) . withSelector ( path ) ;
public class CouchDBSchemaManager { /** * Creates the view for max . * @ param views * the views */ private void createViewForMax ( Map < String , MapReduce > views ) { } }
if ( views . get ( CouchDBConstants . MAX ) == null ) { MapReduce mapr = new MapReduce ( ) ; mapr . setMap ( "function(doc){for(field in doc){var o = doc[field];if(typeof(o)==\"number\")emit(field+\"_\"+doc." + CouchDBConstants . ENTITYNAME + ", o);}}" ) ; mapr . setReduce ( "function(keys, values){return Math.max.appl...
public class FileLogOutput { /** * Add some data from a LogRecord to the logBuffer if there is room . * @ param logRecord from which to write the next part . * @ param setMark true if fileMark is to be set . * @ param checkSpace true is we should check that log file space is available before * filling the buffe...
final String methodName = "addBuffers" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Object [ ] { logRecord , new Boolean ( setMark ) , new Boolean ( checkSpace ) , new Boolean ( flush ) } ) ; // Where we will put the data to be logged . int re...
public class EntityDataModelUtil { /** * Gets the OData type for a Java type and checks if the OData type is a structured type ; throws an exception if the * OData type is not a structured type . * @ param entityDataModel The entity data model . * @ param javaType The Java type . * @ return The OData structured...
return checkIsStructuredType ( getAndCheckType ( entityDataModel , javaType ) ) ;
public class RsaUtil { /** * 使用密钥解包密钥 * @ param key * @ param unwrapKey * @ return */ public PrivateKey unwrapPrivateKeyByKey ( byte [ ] key , Key unwrapKey ) { } }
try { if ( key == null || key . length <= 0 || unwrapKey == null ) { return null ; } Cipher cipher = Cipher . getInstance ( algorithm ) ; // 使用私钥包裹模式 cipher . init ( Cipher . UNWRAP_MODE , unwrapKey ) ; return ( PrivateKey ) cipher . unwrap ( key , algorithm , Cipher . PRIVATE_KEY ) ; } catch ( Exception e ) { log . er...
public class MongoDBDialect { /** * do ' Map Reduce ' operation * @ param queryDescriptor descriptor of MongoDB map reduce query * @ param collection collection on which operation will be performed * @ return result iterator * @ see < a href = " https : / / docs . mongodb . com / manual / reference / method / d...
MapReduceIterable < Document > mapReduceIterable = collection . mapReduce ( queryDescriptor . getMapFunction ( ) , queryDescriptor . getReduceFunction ( ) ) ; Document options = queryDescriptor . getOptions ( ) ; if ( options != null ) { Document query = ( Document ) options . get ( "query" ) ; Document sort = ( Docume...
public class Context { /** * Create a new context with the given key value set . The new context will cascade cancellation * from its parent . */ public < V1 , V2 > Context withValues ( Key < V1 > k1 , V1 v1 , Key < V2 > k2 , V2 v2 ) { } }
PersistentHashArrayMappedTrie < Key < ? > , Object > newKeyValueEntries = keyValueEntries . put ( k1 , v1 ) . put ( k2 , v2 ) ; return new Context ( this , newKeyValueEntries ) ;
public class DavUtil { /** * Add a namespace * @ param val * @ throws Throwable */ protected void addNs ( final XmlEmit xml , final String val ) throws Throwable { } }
if ( xml . getNameSpace ( val ) == null ) { xml . addNs ( new NameSpace ( val , null ) , false ) ; }
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcEllipse ( ) { } }
if ( ifcEllipseEClass == null ) { ifcEllipseEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 203 ) ; } return ifcEllipseEClass ;
public class OfficeReader { /** * Parses the input stream and generates an in - memory representation of the document . In most cases ( depending on the parser ) the full document needs to be represented in - memory . * @ throws org . zuinnote . hadoop . office . format . common . parser . FormatNotUnderstoodExceptio...
// do content detection of document if ( this . hocr . getMimeType ( ) . contains ( OfficeReader . FORMAT_EXCEL ) ) { // check if low footprint if ( ! this . hocr . getLowFootprint ( ) ) { LOG . info ( "Using standard API to parse Excel file" ) ; // if it contains Excel then use default MSExcelParser this . currentPars...
public class TransmissionData { /** * Attempts to build a transmission into the specified buffer . The type of * transmission built will depend on the values passed into this object by * the reset ( ) method and also the setLayoutToXXX ( ) method . If there is * insufficient space in the supplied buffer , then mu...
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "buildTransmission" , xmitBuffer ) ; SIErrorException error = null ; while ( ! exhausedXmitBuffer && ! transmissionBuilt && ( error == null ) ) { if ( tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "state=" + state + " layout=" + layout ) ; switch ( stat...
public class tools { /** * Converts an array of bytes in a hex string ; Taken from * org . apache . commons . codec . binary . Hex . * @ param bytes array of bytes * @ return concatenated hex representation of input byte array */ public static String toHexString ( byte [ ] bytes ) { } }
final int l = bytes . length ; final char [ ] out = new char [ l << 1 ] ; for ( int i = 0 , j = 0 ; i < l ; i ++ ) { out [ j ++ ] = hexDigits [ ( 0xF0 & bytes [ i ] ) >>> 4 ] ; out [ j ++ ] = hexDigits [ 0x0F & bytes [ i ] ] ; } return new String ( out ) ;
public class CmsPropertyCustom { /** * Performs the edit properties action , will be called by the JSP page . < p > * @ param request the HttpServletRequest * @ throws JspException if problems including sub - elements occur */ @ Override public void actionEdit ( HttpServletRequest request ) throws JspException { } ...
// save initialized instance of this class in request attribute for included sub - elements getJsp ( ) . getRequest ( ) . setAttribute ( SESSION_WORKPLACE_CLASS , this ) ; try { // save the changes only if resource is properly locked if ( isEditable ( ) ) { performEditOperation ( request ) ; } } catch ( Throwable e ) {...
public class SamplingCollector { /** * / * ( non - Javadoc ) * @ see com . oath . cyclops . react . collectors . lazy . LazyResultConsumer # withResults ( java . util . Collection ) */ @ Override public LazyResultConsumer < T > withResults ( final Collection < FastFuture < T > > t ) { } }
return this . withConsumer ( consumer . withResults ( t ) ) ;
public class LogTemplates { /** * Produces a log template which logs something every N split . * @ param delegateLogger Concrete log template * @ param period N value , period * @ return Logger */ public static < C > LogTemplate < C > everyNSplits ( LogTemplate < C > delegateLogger , int period ) { } }
return new CounterLogTemplate < > ( delegateLogger , period ) ;
public class CommerceNotificationTemplatePersistenceImpl { /** * Returns the first commerce notification template in the ordered set where uuid = & # 63 ; . * @ param uuid the uuid * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching ...
CommerceNotificationTemplate commerceNotificationTemplate = fetchByUuid_First ( uuid , orderByComparator ) ; if ( commerceNotificationTemplate != null ) { return commerceNotificationTemplate ; } StringBundler msg = new StringBundler ( 4 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . ap...
public class DialogRootView { /** * Adds spacing to the view of a specific area . The spacing is added to the view ' s current * bottom padding . * @ param previousArea * The area , the view , the spacing should be applied to , corresponds to , as an instance * of the class { @ link Area } . The area may not be...
int scrollViewPaddingTop = 0 ; int scrollViewMarginBottom = 0 ; int padding = - 1 ; if ( previousArea == Area . TITLE ) { padding = getResources ( ) . getDimensionPixelSize ( R . dimen . dialog_title_bottom_padding ) ; } else if ( previousArea == Area . MESSAGE ) { padding = getResources ( ) . getDimensionPixelSize ( R...
public class Application { /** * Get the connection to the server for this applet . * Optionally create the server connection . * @ param localTaskOwner The task that will own this remote task ( or application ) server ) [ If null , get the app server ] . * @ param strUserID The user id ( or name ) to initialize ...
return this . getRemoteTask ( localTaskOwner , strUserID , null , bCreateIfNotFound ) ;
public class StringUtilities { /** * Checks to see if a string entered is alpha numeric * @ param input The string to be tested * @ return True if the string is alpha numeric otherwise false */ public static boolean isAlphanumeric ( final String input ) { } }
for ( int i = 0 ; i < input . length ( ) ; i ++ ) { if ( ! Character . isLetterOrDigit ( input . charAt ( i ) ) ) return false ; } return true ;
public class AbstractAWSStorageGatewayAsync { /** * Simplified method form for invoking the RemoveTagsFromResource operation with an AsyncHandler . * @ see # removeTagsFromResourceAsync ( RemoveTagsFromResourceRequest , com . amazonaws . handlers . AsyncHandler ) */ @ Override public java . util . concurrent . Future...
return removeTagsFromResourceAsync ( new RemoveTagsFromResourceRequest ( ) , asyncHandler ) ;
public class HillClimberWindowTinyLfuPolicy { /** * Promotes the entry to the protected region ' s MRU position , demoting an entry if necessary . */ private void onProbationHit ( Node node ) { } }
node . remove ( ) ; node . queue = PROTECTED ; node . appendToTail ( headProtected ) ; protectedSize ++ ; demoteProtected ( ) ;
public class DatagramUtil { /** * 将四个字节转换为一个int类型的数字 * @ param data data数据 * @ param start 四个字节长度开始的位置 * @ return 四个byte转换为的一个int */ public static int convert ( byte [ ] data , int start ) { } }
return ( Byte . toUnsignedInt ( data [ start ] ) << 24 ) | ( Byte . toUnsignedInt ( data [ start + 1 ] ) << 16 ) | ( Byte . toUnsignedInt ( data [ start + 2 ] ) << 8 ) | Byte . toUnsignedInt ( data [ start + 3 ] ) ;
public class JsonPath { /** * Creates a new JsonPath and applies it to the provided Json string * @ param json a json string * @ param jsonPath the json path * @ param filters filters to be applied to the filter place holders [ ? ] in the path * @ param < T > expected return type * @ return list of objects ma...
"unchecked" } ) public static < T > T read ( String json , String jsonPath , Predicate ... filters ) { return new ParseContextImpl ( ) . parse ( json ) . read ( jsonPath , filters ) ;
public class ArgTokenizer { /** * Consume the remainder of the input . This is useful to sure all options * have been encountered and to check to unexpected additional non - option * input . * @ return the string - separated concatenation of all remaining non - option * arguments . */ String remainder ( ) { } }
List < String > rem = new ArrayList < > ( ) ; while ( next ( ) != null ) { rem . add ( sval ) ; } return String . join ( " " , rem ) ;
public class StepExecution { /** * Returned values from the execution of the step . * @ param outputs * Returned values from the execution of the step . * @ return Returns a reference to this object so that method calls can be chained together . */ public StepExecution withOutputs ( java . util . Map < String , j...
setOutputs ( outputs ) ; return this ;
public class Cluster { /** * A map of the cluster ' s subnets and their corresponding Availability Zones . * @ param subnetMapping * A map of the cluster ' s subnets and their corresponding Availability Zones . * @ return Returns a reference to this object so that method calls can be chained together . */ public ...
setSubnetMapping ( subnetMapping ) ; return this ;
public class DateUtility { /** * Converts an instance of < code > Date < / code > into the canonical lexical * representation of an XSD dateTime with the following exceptions : - Dates * before 1 CE ( i . e . 1 AD ) are handled according to ISO 8601:2000 Second * Edition : " 0000 " is the lexical representation o...
if ( date == null ) { return null ; } String dateTime = convertDateToString ( date , true ) ; if ( date . before ( ONE_CE ) ) { // fix the format for lexical representation of the year // e . g . 1 BCE : 0000-01.01 ( 1BCE is year 0) int pos = dateTime . indexOf ( '-' , 1 ) ; int year = Integer . parseInt ( dateTime . s...
public class FineUploader5Session { /** * Any parameters you would like passed with the associated GET request to * your server . * @ param aParams * New parameters to be added . * @ return this */ @ Nonnull public FineUploader5Session addParams ( @ Nullable final Map < String , String > aParams ) { } }
m_aSessionParams . addAll ( aParams ) ; return this ;
public class ProvFactory { /** * A factory method to create an instance of a specialization { @ link SpecializationOf } * @ param specific an identifier ( { @ link QualifiedName } ) for the specific { @ link Entity } * @ param general an identifier ( { @ link QualifiedName } ) for the general { @ link Entity } * ...
SpecializationOf res = of . createSpecializationOf ( ) ; res . setSpecificEntity ( specific ) ; res . setGeneralEntity ( general ) ; return res ;
public class DeletingWhileIterating { /** * implements the visitor to setup the opcode stack , collectionGroups , groupToIterator and loops * @ param classContext * the context object of the currently parsed class */ @ Override public void visitClassContext ( ClassContext classContext ) { } }
if ( ( collectionClass == null ) || ( iteratorClass == null ) ) { return ; } try { collectionGroups = new ArrayList < > ( ) ; groupToIterator = new HashMap < > ( ) ; loops = new HashMap < > ( 10 ) ; super . visitClassContext ( classContext ) ; } finally { collectionGroups = null ; groupToIterator = null ; loops = null ...
public class Client { /** * { @ inheritDoc } */ public void setPermissions ( IConnection conn , Collection < String > permissions ) { } }
if ( permissions == null ) { conn . removeAttribute ( PERMISSIONS ) ; } else { conn . setAttribute ( PERMISSIONS , permissions ) ; }
public class ExecutionEntityImpl { /** * The current flow element , will be filled during operation execution */ public FlowElement getCurrentFlowElement ( ) { } }
if ( currentFlowElement == null ) { String processDefinitionId = getProcessDefinitionId ( ) ; if ( processDefinitionId != null ) { org . activiti . bpmn . model . Process process = ProcessDefinitionUtil . getProcess ( processDefinitionId ) ; currentFlowElement = process . getFlowElement ( getCurrentActivityId ( ) , tru...
public class ResultFactory { /** * Find a parser to handle the protocol response body based on the content type found in the response * and the expected result type specified by the user ; if one or both fields is missing then * attempts to choose a sensible default . * @ param mediaType The content type in the r...
ResponseFormat format = null ; // Prefer MIME type when choosing result format . if ( mediaType != null ) { mediaType = stripParams ( mediaType ) ; format = mimeFormats . get ( mediaType ) ; if ( format == null ) { logger . warn ( "Unrecognized media type ({}) in SPARQL server response" , mediaType ) ; } else { logger ...
public class ResponseTypeBuilder { /** * Dummy convert * @ param decision * @ return */ private String getStatusCode ( DecisionType decision ) { } }
if ( fXACMLParsingError ) { return STATUS_CODE_SYNTAX_ERROR ; } else if ( fProcessingError ) { return STATUS_CODE_PROCESSING_ERROR ; } else if ( decision == DecisionType . Deny || decision == DecisionType . Permit ) { return STATUS_CODE_OK ; } else if ( decision == DecisionType . Indeterminate || decision == DecisionTy...
public class Worker { /** * Remove ourselves from parents worker threads and close our zk connection */ private void shutdown ( ) { } }
parent . workerThreads . get ( plan ) . remove ( this ) ; if ( zk != null ) { try { logger . debug ( "closing " + zk . getSessionId ( ) ) ; zk . close ( ) ; zk = null ; } catch ( InterruptedException e1 ) { logger . debug ( e1 ) ; } logger . debug ( "shutdown complete" ) ; }
public class DefaultPool { /** * { @ inheritDoc } */ public void destroyConnectionListener ( ConnectionListener cl ) throws ResourceException { } }
if ( getInternalStatistics ( ) . isEnabled ( ) ) getInternalStatistics ( ) . deltaDestroyedCount ( ) ; try { cl . getManagedConnection ( ) . destroy ( ) ; } catch ( Exception e ) { throw new ResourceException ( e ) ; } finally { cl . setState ( DESTROYED ) ; semaphore . release ( ) ; }
public class TextRangeCalculator { /** * Calculates the beginLine of a violation report . * @ param pmdViolation The violation for which the beginLine should be calculated . * @ return The beginLine is assumed to be the line with the smallest number . However , if the smallest number is * out - of - range ( non -...
int minLine = Math . min ( pmdViolation . getBeginLine ( ) , pmdViolation . getEndLine ( ) ) ; return minLine > 0 ? minLine : calculateEndLine ( pmdViolation ) ;
public class Graph { /** * 对graph进行调试用的 */ public void printGraph ( ) { } }
for ( Term term : terms ) { if ( term == null ) { continue ; } System . out . print ( term . getName ( ) + "\t" + term . score ( ) + " ," ) ; while ( ( term = term . next ( ) ) != null ) { System . out . print ( term + "\t" + term . score ( ) + " ," ) ; } System . out . println ( ) ; }
public class SVGAndroidRenderer { private void render ( SVG . Symbol obj , Box viewPort ) { } }
debug ( "Symbol render" ) ; if ( viewPort . width == 0f || viewPort . height == 0f ) return ; // " If attribute ' preserveAspectRatio ' is not specified , then the effect is as if a value of xMidYMid meet were specified . " PreserveAspectRatio positioning = ( obj . preserveAspectRatio != null ) ? obj . preserveAspectRa...
public class LspGetq { /** * compose LSP parameter from elementary LSP with previous LSP . */ public static void lsp_prev_compose ( float lsp_ele [ ] , /* ( i ) Q13 : LSP vectors */ float lsp [ ] , /* ( o ) Q13 : quantized LSP parameters */ float fg [ ] [ ] , /* ( i ) Q15 : MA prediction coef . */ float freq_prev [ ] [...
int j , k ; for ( j = 0 ; j < LD8KConstants . M ; j ++ ) { lsp [ j ] = lsp_ele [ j ] * fg_sum [ j ] ; for ( k = 0 ; k < LD8KConstants . MA_NP ; k ++ ) lsp [ j ] += freq_prev [ k ] [ j ] * fg [ k ] [ j ] ; } return ;
public class ns_ns_savedconfig { /** * Use this operation to get saved configuration from NetScaler Instance . */ public static ns_ns_savedconfig get ( nitro_service client , ns_ns_savedconfig resource ) throws Exception { } }
resource . validate ( "get" ) ; return ( ( ns_ns_savedconfig [ ] ) resource . get_resources ( client ) ) [ 0 ] ;
public class AbstractFieldStyler { /** * Create the PdfFormField that will be used to add a form field to the pdf . * @ return * @ throws IOException * @ throws DocumentException * @ throws VectorPrintException */ @ Override public PdfFormField makeField ( ) throws IOException , DocumentException , VectorPrintE...
switch ( getFieldtype ( ) ) { case TEXT : return ( ( TextField ) bf ) . getTextField ( ) ; case COMBO : return ( ( TextField ) bf ) . getComboField ( ) ; case LIST : return ( ( TextField ) bf ) . getListField ( ) ; case BUTTON : return ( ( PushbuttonField ) bf ) . getField ( ) ; case CHECKBOX : return ( ( RadioCheckFie...
public class ESClient { /** * Sets the batch size . * @ param persistenceUnit * the persistence unit * @ param puProperties * the pu properties */ private void setBatchSize ( String persistenceUnit , Map < String , Object > puProperties ) { } }
String batch_Size = null ; if ( puProperties != null ) { Object externalBatchSize = puProperties . get ( PersistenceProperties . KUNDERA_BATCH_SIZE ) ; externalBatchSize = externalBatchSize != null ? externalBatchSize . toString ( ) : null ; batch_Size = puProperties != null ? ( String ) externalBatchSize : null ; if (...
public class DoCopy { /** * Copy a resource . * @ param transaction indicates that the method is within the scope of a WebDAV transaction * @ param req Servlet request * @ param resp Servlet response * @ return true if the copy is successful * @ throws WebdavException if an error in the underlying store occur...
// Parsing destination header String destinationPath = parseDestinationHeader ( req , resp ) ; if ( destinationPath == null ) { return false ; } String path = getRelativePath ( req ) ; if ( path . equals ( destinationPath ) ) { resp . sendError ( WebdavStatus . SC_FORBIDDEN ) ; return false ; } Hashtable < String , Int...
public class FunctionType { /** * Computes the supremum or infimum of two functions . Because sup ( ) and inf ( ) share a lot of logic * for functions , we use a single helper . * @ param leastSuper If true , compute the supremum of { @ code this } with { @ code that } . Otherwise , * compute the infimum . * @ ...
// NOTE ( nicksantos ) : When we remove the unknown type , the function types // form a lattice with the universal constructor at the top of the lattice , // and the LEAST _ FUNCTION _ TYPE type at the bottom of the lattice . // When we introduce the unknown type , it ' s much more difficult to make // heads or tails o...
public class SQSMessageProducer { /** * Not verified on the client side , but SQS Attribute names must be valid * letter or digit on the basic multilingual plane in addition to allowing * ' _ ' , ' - ' and ' . ' . No component of an attribute name may be empty , thus an * attribute name may neither start nor end ...
Map < String , MessageAttributeValue > messageAttributes = new HashMap < String , MessageAttributeValue > ( ) ; Enumeration < String > propertyNames = message . getPropertyNames ( ) ; while ( propertyNames . hasMoreElements ( ) ) { String propertyName = propertyNames . nextElement ( ) ; // This is generated from SQS me...
public class HttpClientVerifyBuilder { /** * Adds parameter condition . Parameter value must match . * @ param name parameter name * @ param matcher parameter value matcher * @ return verification builder */ public HttpClientVerifyBuilder withParameter ( String name , Matcher < String > matcher ) { } }
ruleBuilder . addParameterCondition ( name , matcher ) ; return this ;
public class BaseAttribute { /** * todo dk : think about specific method versions for each allowed type */ public void setValue ( Object newValue ) { } }
Object checkedValue = checkValue ( newValue ) ; setDirty ( isDifferent ( baseValue , checkedValue ) ) ; if ( isDifferent ( value , checkedValue ) ) { // firePropertyChange doesn ' t do this check sufficiently firePropertyChange ( VALUE , value , value = checkedValue ) ; // set inline to avoid recursion }
public class Database { /** * Prepare and return SQLite3 statement for SQL . Only available * in SQLite 3.0 and above , otherwise a no - op . * @ param sql SQL statement to be prepared * @ return a Stmt object */ public Stmt prepare ( String sql ) throws jsqlite . Exception { } }
synchronized ( this ) { Stmt stmt = new Stmt ( ) ; stmt_prepare ( sql , stmt ) ; return stmt ; }
public class Converter { /** * convertBase64ToHex */ private static void convertDateString ( String str ) { } }
try { Date date = Utils . dateFromString ( str ) ; display ( "Date to millis: " + date . getTime ( ) ) ; } catch ( Exception e ) { }
public class UCaseProps { /** * / * Is followed by one or more cc = = 230 ? */ private final boolean isFollowedByMoreAbove ( ContextIterator iter ) { } }
int c ; int dotType ; if ( iter == null ) { return false ; } for ( iter . reset ( 1 ) ; ( c = iter . next ( ) ) >= 0 ; ) { dotType = getDotType ( c ) ; if ( dotType == ABOVE ) { return true ; /* at least one cc = = 230 following */ } else if ( dotType != OTHER_ACCENT ) { return false ; /* next base character , no more ...
public class ResultCodeMapper { /** * Checks the result code and raises an exception is not { @ link # MDB _ SUCCESS } . * @ param rc the LMDB result code * @ throws LmdbNativeException the resolved exception */ static void checkRc ( final int rc ) throws LmdbNativeException { } }
switch ( rc ) { case MDB_SUCCESS : return ; case Dbi . BadDbiException . MDB_BAD_DBI : throw new Dbi . BadDbiException ( ) ; case BadReaderLockException . MDB_BAD_RSLOT : throw new BadReaderLockException ( ) ; case BadException . MDB_BAD_TXN : throw new BadException ( ) ; case Dbi . BadValueSizeException . MDB_BAD_VALS...
public class GetIdentityMailFromDomainAttributesResult { /** * A map of identities to custom MAIL FROM attributes . * @ param mailFromDomainAttributes * A map of identities to custom MAIL FROM attributes . */ public void setMailFromDomainAttributes ( java . util . Map < String , IdentityMailFromDomainAttributes > m...
this . mailFromDomainAttributes = mailFromDomainAttributes == null ? null : new com . amazonaws . internal . SdkInternalMap < String , IdentityMailFromDomainAttributes > ( mailFromDomainAttributes ) ;
public class Timer { /** * Times and records the duration of an event . * @ param event a { @ link Callable } whose { @ link Callable # call ( ) } method implements a process * whose duration should be timed * @ param < T > the type of the value returned by { @ code event } * @ return the value returned by { @ ...
final long startTime = clock . getTick ( ) ; try { return event . call ( ) ; } finally { update ( clock . getTick ( ) - startTime ) ; }
public class MkCoPTree { /** * Approximates the lower hull . * @ param convexHull * @ param log _ kDist * @ param sum _ log _ kDist * @ param sum _ log _ k _ kDist */ private ApproximationLine approximateLowerHull ( ConvexHull convexHull , double [ ] log_k , double sum_log_k , double sum_log_k2 , double [ ] log...
// StringBuilder msg = new StringBuilder ( 1000 ) ; int [ ] lowerHull = convexHull . getLowerHull ( ) ; int l = convexHull . getNumberOfPointsInLowerHull ( ) ; int k_0 = settings . kmax - lowerHull . length + 1 ; // linear search on all line segments on the lower convex hull // msg . append ( " lower hull l = " ) . app...
public class Transaction { /** * Adds the given output to this transaction . The output must be completely initialized . Returns the given output . */ public TransactionOutput addOutput ( TransactionOutput to ) { } }
unCache ( ) ; to . setParent ( this ) ; outputs . add ( to ) ; adjustLength ( outputs . size ( ) , to . length ) ; return to ;
public class RecordMapper { /** * Implement in inner class in domain class decorator to ensure access to private and protected fields * @ param field * @ param object * @ throws IllegalAccessException */ protected void setField ( Field field , Object object ) throws IllegalAccessException { } }
dataObject . setField ( field , object ) ;
public class JcsegServer { /** * reset a JcsegTaskConfig from a JSONObject * @ param config * @ param json */ private void resetJcsegTaskConfig ( JcsegTaskConfig config , JSONObject json ) { } }
if ( json . has ( "jcseg_maxlen" ) ) { config . setMaxLength ( json . getInt ( "jcseg_maxlen" ) ) ; } if ( json . has ( "jcseg_icnname" ) ) { config . setICnName ( json . getBoolean ( "jcseg_icnname" ) ) ; } if ( json . has ( "jcseg_pptmaxlen" ) ) { config . setPPT_MAX_LENGTH ( json . getInt ( "jcseg_pptmaxlen" ) ) ; }...
public class LdapConnection { /** * Get the unique name for the specified distinguished name . * @ param dn The distinguished name . * @ param entityType The entity type for the distinguished name . * @ param attrs The attributes for the entity . * @ return The unique name . * @ throws WIMException If there w...
final String METHODNAME = "getUniqueName" ; String uniqueName = null ; dn = iLdapConfigMgr . switchToNode ( dn ) ; if ( iLdapConfigMgr . needTranslateRDN ( ) && iLdapConfigMgr . needTranslateRDN ( entityType ) ) { try { if ( entityType != null ) { LdapEntity ldapEntity = iLdapConfigMgr . getLdapEntity ( entityType ) ; ...
public class MortarScope { /** * Returns the service associated with the given name . * @ throws IllegalArgumentException if no such service can be found * @ throws IllegalStateException if this scope is dead * @ see # hasService */ public < T > T getService ( String serviceName ) { } }
T service = findService ( serviceName , true ) ; if ( service == null ) { throw new IllegalArgumentException ( format ( "No service found named \"%s\"" , serviceName ) ) ; } return service ;
public class ScanSpec { /** * Applicable only when an expression has been specified . Used to * specify the actual values for the attribute - value placeholders . * @ see ScanRequest # withExpressionAttributeValues ( Map ) */ public ScanSpec withValueMap ( Map < String , Object > valueMap ) { } }
if ( valueMap == null ) this . valueMap = null ; else this . valueMap = Collections . unmodifiableMap ( new LinkedHashMap < String , Object > ( valueMap ) ) ; return this ;
public class NetworkUtils { /** * Finds an available port . * @ param maxRetries * the maximum number of retries before an { @ link org . junit . internal . AssumptionViolatedException } is * thrown . * @ return the number of the port that is available */ public static int findAvailablePort ( int maxRetries ) {...
int retries = 0 ; int randomPort ; boolean portAvailable ; do { randomPort = randomPort ( ) ; portAvailable = isPortAvailable ( randomPort ) ; retries ++ ; } while ( retries <= maxRetries && ! portAvailable ) ; assumeTrue ( "no open port found" , portAvailable ) ; return randomPort ;
public class BaseTraceService { /** * Inject the internal WsMessageRouter . */ protected void setWsMessageRouter ( WsMessageRouter msgRouter ) { } }
internalMessageRouter . set ( msgRouter ) ; // Pass the earlierMessages queue to the router . // Now that the internalMessageRouter is non - null , this class will // NOT add any more messages to the earlierMessages queue . // The MessageRouter basically owns the earlierMessages queue // from now on . if ( earlierMessa...
public class BaseAsyncInterceptor { /** * Used internally to set up the interceptor . */ @ Override public final void setNextInterceptor ( AsyncInterceptor nextInterceptor ) { } }
this . nextInterceptor = nextInterceptor ; this . nextDDInterceptor = nextInterceptor instanceof DDAsyncInterceptor ? ( DDAsyncInterceptor ) nextInterceptor : null ;
public class AbstractProxyFactory { /** * Returns the constructor of the indirection handler class . * @ return The constructor for indirection handlers */ private synchronized Constructor getIndirectionHandlerConstructor ( ) { } }
if ( _indirectionHandlerConstructor == null ) { Class [ ] paramType = { PBKey . class , Identity . class } ; try { _indirectionHandlerConstructor = getIndirectionHandlerClass ( ) . getConstructor ( paramType ) ; } catch ( NoSuchMethodException ex ) { throw new MetadataException ( "The class " + _indirectionHandlerClass...
public class ApiOvhDedicatedCloud { /** * Get this object properties * REST : GET / dedicatedCloud / location / { pccZone } / hostProfile / { id } * @ param pccZone [ required ] Name of pccZone * @ param id [ required ] Id of Host profile */ public OvhHostProfile location_pccZone_hostProfile_id_GET ( String pccZo...
String qPath = "/dedicatedCloud/location/{pccZone}/hostProfile/{id}" ; StringBuilder sb = path ( qPath , pccZone , id ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhHostProfile . class ) ;
public class SeaGlassLookAndFeel { /** * Initialize the spinner UI settings ; * @ param d the UI defaults map . */ private void defineSpinners ( UIDefaults d ) { } }
d . put ( "spinnerNextBorderBottomEnabled" , new Color ( 0x4779bf ) ) ; d . put ( "spinnerNextBorderBottomPressed" , new Color ( 0x4879bf ) ) ; d . put ( "spinnerNextInteriorBottomEnabled" , new Color ( 0x85abcf ) ) ; d . put ( "spinnerNextInteriorBottomPressed" , new Color ( 0x6e92b6 ) ) ; d . put ( "spinnerPrevBorder...