signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class JSTypeRegistry { /** * Creates a function type . The last parameter type of the function is * considered a variable length argument . * @ param returnType the function ' s return type * @ param parameterTypes the parameters ' types */ private FunctionType createNativeFunctionTypeWithVarArgs ( JSType ...
return createNativeFunctionType ( returnType , createParametersWithVarArgs ( parameterTypes ) ) ;
public class CredentialsManager { /** * Stores the given credentials in the storage . Must have an access _ token or id _ token and a expires _ in value . * @ param credentials the credentials to save in the storage . */ public void saveCredentials ( @ NonNull Credentials credentials ) { } }
if ( ( isEmpty ( credentials . getAccessToken ( ) ) && isEmpty ( credentials . getIdToken ( ) ) ) || credentials . getExpiresAt ( ) == null ) { throw new CredentialsManagerException ( "Credentials must have a valid date of expiration and a valid access_token or id_token value." ) ; } storage . store ( KEY_ACCESS_TOKEN ...
public class AmazonElastiCacheClient { /** * Returns information about reserved cache nodes for this account , or about a specified reserved cache node . * @ param describeReservedCacheNodesRequest * Represents the input of a < code > DescribeReservedCacheNodes < / code > operation . * @ return Result of the Desc...
request = beforeClientExecution ( request ) ; return executeDescribeReservedCacheNodes ( request ) ;
public class CachedDateTimeZone { /** * Returns a new CachedDateTimeZone unless given zone is already cached . */ public static CachedDateTimeZone forZone ( DateTimeZone zone ) { } }
if ( zone instanceof CachedDateTimeZone ) { return ( CachedDateTimeZone ) zone ; } return new CachedDateTimeZone ( zone ) ;
public class BrokerUtil { /** * Converts a list of objects to a string of M subscripts . * @ param subscripts List to convert . * @ return List of subscripts in M format . */ public static String buildSubscript ( Iterable < Object > subscripts ) { } }
StringBuilder sb = new StringBuilder ( ) ; for ( Object subscript : subscripts ) { String value = toString ( subscript ) ; if ( value . isEmpty ( ) ) { throw new RuntimeException ( "Null subscript not allowed." ) ; } if ( sb . length ( ) > 0 ) { sb . append ( "," ) ; } if ( StringUtils . isNumeric ( value ) ) { sb . ap...
public class ClientManager { /** * This method attempts to retrieve and process the instrumentation information contained * within the collector configuration . * @ return Whether the configuration has been retrieved and processed */ protected static boolean processConfig ( ) { } }
// Read configuration CollectorConfiguration config = configService . getCollector ( null , null , null , null ) ; if ( config != null ) { try { updateInstrumentation ( config ) ; } catch ( Exception e ) { log . severe ( "Failed to update instrumentation rules: " + e ) ; } } return config != null ;
public class ResourceHelper { /** * Optimize the resource chain by trying to combine two resources to a new one * @ param securityContext * @ param request * @ param resourceMap * @ param propertyView * @ return finalResource * @ throws FrameworkException */ public static Resource optimizeNestedResourceChai...
final List < Resource > resourceChain = ResourceHelper . parsePath ( securityContext , request , resourceMap , propertyView ) ; ViewFilterResource view = null ; int num = resourceChain . size ( ) ; boolean found = false ; do { for ( Iterator < Resource > it = resourceChain . iterator ( ) ; it . hasNext ( ) ; ) { Resour...
public class Pipeline { /** * This is a migration method for global to processor options . Currently used * by the merge - processor which gets the ' source : once ' option from the global * scope . */ private Map < String , Object > injectGlobalOptionsFallback ( final Version version , final Manifest manifest , fi...
final Map < String , Object > copy = new HashMap < String , Object > ( options ) ; copy . put ( "version" , version . toString ( ) ) ; if ( manifest != null ) { if ( "merge" . equals ( name ) ) { copy . put ( "source" , GlobalOptions . isSourceOnce ( manifest ) ? "once" : "" ) ; } } return copy ;
public class PersonConfidentialVisitor { /** * Visit an Attribute . Certain Attributes contribute interest data . * @ see GedObjectVisitor # visit ( Attribute ) */ @ Override public void visit ( final Attribute attribute ) { } }
if ( "Restriction" . equals ( attribute . getString ( ) ) && "confidential" . equals ( attribute . getTail ( ) ) ) { isConfidential = true ; }
public class DatabaseHashMap { /** * Get the session table definition if exists . It also checks * If existing table matches what session manager is looking for */ private boolean getTableDefinition ( Connection tbcon ) throws SQLException { } }
boolean defExists = false ; boolean smallExists = false ; boolean mediumExists = false ; boolean largeExists = false ; // informix size calculation doesn ' t // work . i . e rs1 . getInt ( " COLUMN _ SIZE " ) doesn ' t work // if ( usingInformix ) // return false ; DatabaseMetaData dmd = tbcon . getMetaData ( ) ; Strin...
public class Utils { /** * Converts MQTT message type to a textual description . */ public static String msgType2String ( int type ) { } }
switch ( type ) { case AbstractMessage . CONNECT : return "CONNECT" ; case AbstractMessage . CONNACK : return "CONNACK" ; case AbstractMessage . PUBLISH : return "PUBLISH" ; case AbstractMessage . PUBACK : return "PUBACK" ; case AbstractMessage . PUBREC : return "PUBREC" ; case AbstractMessage . PUBREL : return "PUBREL...
public class ExecutionGraph { /** * Identifies an execution by the specified channel ID and returns it . * @ param id * the channel ID to identify the vertex with * @ return the execution vertex which has a channel with ID < code > id < / code > or < code > null < / code > if no such vertex * exists in the exec...
final ExecutionEdge edge = this . edgeMap . get ( id ) ; if ( edge == null ) { return null ; } if ( id . equals ( edge . getOutputChannelID ( ) ) ) { return edge . getOutputGate ( ) . getVertex ( ) ; } return edge . getInputGate ( ) . getVertex ( ) ;
public class BeanDefinitionParser { /** * Parse an array element . * @ param arrayEle a { @ link org . w3c . dom . Element } object . * @ param bd a { @ link org . springframework . beans . factory . config . BeanDefinition } object . * @ return a { @ link java . lang . Object } object . */ public Object parseArr...
String elementType = arrayEle . getAttribute ( VALUE_TYPE_ATTRIBUTE ) ; NodeList nl = arrayEle . getChildNodes ( ) ; ManagedArray target = new ManagedArray ( elementType , nl . getLength ( ) ) ; target . setSource ( extractSource ( arrayEle ) ) ; target . setElementTypeName ( elementType ) ; target . setMergeEnabled ( ...
public class BTools { /** * < b > getSDbl < / b > < br > * public static String getSDbl ( double Value , int DecPrec , boolean ShowPlusSign ) < br > * Returns double converted to string . < br > * If Value is Double . NaN returns " NaN " . < br > * If DecPrec is < 0 is DecPrec set 0 . < br > * If ShowPlusSign...
String PlusSign = "" ; if ( ShowPlusSign && Value > 0 ) PlusSign = "+" ; if ( ShowPlusSign && Value == 0 ) PlusSign = " " ; return PlusSign + getSDbl ( Value , DecPrec ) ;
public class SegmentMeanShiftSearchGray { /** * Performs mean - shift clustering on the input image * @ param image Input image */ @ Override public void process ( T image ) { } }
// initialize data structures this . image = image ; this . stopRequested = false ; modeLocation . reset ( ) ; modeColor . reset ( ) ; modeMemberCount . reset ( ) ; interpolate . setImage ( image ) ; pixelToMode . reshape ( image . width , image . height ) ; quickMode . reshape ( image . width , image . height ) ; // m...
public class dnssrvrec { /** * Use this API to add dnssrvrec resources . */ public static base_responses add ( nitro_service client , dnssrvrec resources [ ] ) throws Exception { } }
base_responses result = null ; if ( resources != null && resources . length > 0 ) { dnssrvrec addresources [ ] = new dnssrvrec [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { addresources [ i ] = new dnssrvrec ( ) ; addresources [ i ] . domain = resources [ i ] . domain ; addresources [ i ]...
public class DocumentTransformer { /** * Split a string into pieces based on delimiters . Similar to the perl function of the same name . The delimiters are not * included in the returned strings . * @ param str Full string * @ param splitter Characters to split on * @ return List of String pieces from full str...
StringTokenizer tokens = new StringTokenizer ( str , splitter ) ; ArrayList < String > l = new ArrayList < > ( tokens . countTokens ( ) ) ; while ( tokens . hasMoreTokens ( ) ) { l . add ( tokens . nextToken ( ) ) ; } return l ;
public class authenticationauthnprofile { /** * Use this API to fetch filtered set of authenticationauthnprofile resources . * filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */ public static authenticationauthnprofile [ ] get_filtered ( nitro_service service , String filter ) throw...
authenticationauthnprofile obj = new authenticationauthnprofile ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; authenticationauthnprofile [ ] response = ( authenticationauthnprofile [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class SESNotificationManager { /** * / * ( non - Javadoc ) * @ see org . duracloud . mill . notification . NotificationManager # sendEmail ( java . lang . String , java . lang . String ) */ @ Override public void sendEmail ( String subject , String body ) { } }
if ( ArrayUtils . isEmpty ( this . recipientEmailAddresses ) ) { log . warn ( "No recipients configured - no one to notify: ignoring..." ) ; return ; } SendEmailRequest email = new SendEmailRequest ( ) ; try { Destination destination = new Destination ( ) ; destination . setToAddresses ( Arrays . asList ( this . recipi...
public class DescribeReservedNodesResult { /** * The list of < code > ReservedNode < / code > objects . * @ param reservedNodes * The list of < code > ReservedNode < / code > objects . */ public void setReservedNodes ( java . util . Collection < ReservedNode > reservedNodes ) { } }
if ( reservedNodes == null ) { this . reservedNodes = null ; return ; } this . reservedNodes = new com . amazonaws . internal . SdkInternalList < ReservedNode > ( reservedNodes ) ;
public class Preconditions { /** * Checks that the given string is not blank and throws a customized * { @ link NullPointerException } if it is { @ code null } , and a customized * { @ link IllegalArgumentException } if it is empty or whitespace . Intended for doing parameter * validation in methods and construct...
checkNotNull ( str , messageFormat , messageArgs ) ; checkArgument ( Strings . isNotBlank ( str ) , messageFormat , messageArgs ) ; return str ;
public class CmsCloneModuleThread { /** * Copies the explorer type icons . < p > * @ param iconPaths the path to the location where the icons are located * @ throws CmsException if something goes wrong */ private void cloneExplorerTypeIcons ( Map < String , String > iconPaths ) throws CmsException { } }
for ( Map . Entry < String , String > entry : iconPaths . entrySet ( ) ) { String source = ICON_PATH + entry . getKey ( ) ; String target = ICON_PATH + entry . getValue ( ) ; if ( getCms ( ) . existsResource ( source ) && ! getCms ( ) . existsResource ( target ) ) { getCms ( ) . copyResource ( source , target ) ; } }
public class VanityPharma { /** * Gets the vanityPharmaText value for this VanityPharma . * @ return vanityPharmaText * The text that will be displayed in display URL of the text * ad when website description * is the selected display mode for vanity pharma URLs . */ public com . google . api . ads . adwords . ax...
return vanityPharmaText ;
public class JTimePopup { /** * Create this calendar in a popup menu and synchronize the text field on change . * @ param strDateParam The name of the date property ( defaults to " date " ) . * @ param dateTarget The initial date for this button . */ public static JButton createCalendarButton ( String strDateParam ...
JTimeButton button = new JTimeButton ( strDateParam , dateTarget ) ; // button . setMargin ( NO _ INSETS ) ; button . setOpaque ( false ) ; return button ;
public class TopLevelDomainsInner { /** * Gets all legal agreements that user needs to accept before purchasing a domain . * Gets all legal agreements that user needs to accept before purchasing a domain . * @ param name Name of the top - level domain . * @ param agreementOption Domain agreement options . * @ t...
return listAgreementsWithServiceResponseAsync ( name , agreementOption ) . map ( new Func1 < ServiceResponse < Page < TldLegalAgreementInner > > , Page < TldLegalAgreementInner > > ( ) { @ Override public Page < TldLegalAgreementInner > call ( ServiceResponse < Page < TldLegalAgreementInner > > response ) { return resp...
public class RaftAgent { /** * Setup serialization and deserialization for Jackson - annotated { @ code Command } objects . * This method should < strong > only < / strong > be called once . * @ param commandSubclassKlass the base class of the Jackson - annotated { @ code Command } classes * @ param < CommandSubc...
checkState ( ! running ) ; checkState ( ! initialized ) ; checkState ( ! setupConversion ) ; RaftRPC . setupJacksonAnnotatedCommandSerializationAndDeserialization ( mapper , commandSubclassKlass ) ; setupConversion = true ;
public class Indexer { /** * Index the given mutation , adding mutations to the index and metrics table * Like typical use of a BatchWriter , this method does not flush mutations to the underlying index table . * For higher throughput the modifications to the metrics table are tracked in memory and added to the met...
// Increment the cardinality for the number of rows in the table metrics . get ( METRICS_TABLE_ROW_COUNT ) . incrementAndGet ( ) ; // Set the first and last row values of the table based on existing row IDs if ( firstRow == null || byteArrayComparator . compare ( mutation . getRow ( ) , firstRow ) < 0 ) { firstRow = mu...
public class ErrorReporter { /** * Writes the error to the specified < code > PrintWriter < / code > . */ public void write ( PrintWriter writer ) { } }
this . output = writer ; dispatch ( base , false ) ; writer . flush ( ) ;
public class ApiKeyResource1 { /** * RESTful endpoint for updating an API key . Note that all attributes of the key will be updated to match the * provided object . */ @ PUT @ Consumes ( MediaType . APPLICATION_JSON ) @ Path ( "{id}" ) public SuccessResponse updateApiKey ( @ PathParam ( "id" ) String id , EmoApiKey e...
checkArgument ( emoApiKey . getId ( ) . equals ( id ) , "Body contains conflicting API key identifier" ) ; return updateApiKey ( id , new UpdateEmoApiKeyRequest ( ) . setOwner ( emoApiKey . getOwner ( ) ) . setDescription ( emoApiKey . getDescription ( ) ) . setAssignedRoles ( emoApiKey . getRoles ( ) ) . setUnassignOt...
public class SqlAnalyzer { /** * Extract from value string every placeholder : { } , replace it with ? and then convert every field typeName with column typeName . The result is a pair : the first value is the elaborated string . The second is the list of parameters associated to * ? . This second parameter is the li...
SQLiteEntity entity = method . getEntity ( ) ; usedMethodParameters = new HashSet < String > ( ) ; paramNames = new ArrayList < String > ( ) ; paramGetters = new ArrayList < String > ( ) ; usedBeanPropertyNames = new ArrayList < String > ( ) ; paramTypeNames = new ArrayList < TypeName > ( ) ; // replace placeholder : {...
public class AbstractCasWebflowConfigurer { /** * Create flow variable flow variable . * @ param flow the flow * @ param id the id * @ param type the type * @ return the flow variable */ public FlowVariable createFlowVariable ( final Flow flow , final String id , final Class type ) { } }
val opt = Arrays . stream ( flow . getVariables ( ) ) . filter ( v -> v . getName ( ) . equalsIgnoreCase ( id ) ) . findFirst ( ) ; if ( opt . isPresent ( ) ) { return opt . get ( ) ; } val flowVar = new FlowVariable ( id , new BeanFactoryVariableValueFactory ( type , applicationContext . getAutowireCapableBeanFactory ...
public class DatabaseSpec { /** * Gets a connection spec configured with the user , password and * connection string specified . Connections created from this connection * spec will have auto commit turned off . * @ return a { @ link ConnectionSpec } . */ public ConnectionSpec toConnectionSpec ( ) { } }
try { return getDatabaseAPI ( ) . newConnectionSpecInstance ( getConnect ( ) , getUser ( ) , getPasswd ( ) , false ) ; } catch ( InvalidConnectionSpecArguments ex ) { throw new AssertionError ( ex ) ; }
public class NamespaceParser { /** * unparseTokens . * @ param prefix a { @ link java . lang . String } object . * @ param args a { @ link java . util . List } object . * @ param out a { @ link java . lang . StringBuilder } object . */ static public void unparseTokens ( final String prefix , final List < ICmdLine...
final Iterator < ICmdLineArg < ? > > aIter = args . iterator ( ) ; while ( aIter . hasNext ( ) ) { final ICmdLineArg < ? > arg = aIter . next ( ) ; if ( arg . isParsed ( ) ) arg . exportNamespace ( prefix , out ) ; }
public class SubsetIterator { /** * Fill the given collection with the items from the next subset . The collection is < b > not < / b > * cleared so already contained items will be retained . A reference to this same collection * is returned after it has been modified . * To store the next subset in a newly alloc...
// check if there is a next subset to generate if ( ! hasNext ( ) ) { throw new NoSuchElementException ( "No more subsets to be generated." ) ; } // fill collection with currently selected items ( returned at the end of the method ) for ( int i = 0 ; i < t . length - 1 ; i ++ ) { // skip last element ( = dummy ) subset...
public class DockerUtils { /** * Deletes a Docker image if it exists . * @ param imageId the image ID ( not null ) * @ param dockerClient a Docker client */ public static void deleteImageIfItExists ( String imageId , DockerClient dockerClient ) { } }
if ( imageId != null ) { List < Image > images = dockerClient . listImagesCmd ( ) . exec ( ) ; if ( findImageById ( imageId , images ) != null ) dockerClient . removeImageCmd ( imageId ) . withForce ( true ) . exec ( ) ; }
public class MtasFetchData { /** * Gets the file . * @ param prefix the prefix * @ param postfix the postfix * @ return the file * @ throws MtasParserException the mtas parser exception */ public Reader getFile ( String prefix , String postfix ) throws MtasParserException { } }
String file = getString ( ) ; if ( ( file != null ) && ! file . equals ( "" ) ) { if ( prefix != null ) { file = prefix + file ; } if ( postfix != null ) { file = file + postfix ; } Path path = ( new File ( file ) ) . toPath ( ) ; if ( Files . isReadable ( path ) ) { try { return new InputStreamReader ( new GZIPInputSt...
public class StopThreadsCleanUp { /** * Get { @ link Runnable } of given thread , if any */ private Runnable getRunnable ( ClassLoaderLeakPreventor preventor , Thread thread ) { } }
if ( oracleTarget == null && ibmRunnable == null ) { // Not yet initialized oracleTarget = preventor . findField ( Thread . class , "target" ) ; // Sun / Oracle JRE ibmRunnable = preventor . findField ( Thread . class , "runnable" ) ; // IBM JRE } return ( oracleTarget != null ) ? ( Runnable ) preventor . getFieldValue...
public class PublicCardUrl { /** * Get Resource Url for Delete * @ param cardId Unique identifier of the card associated with the customer account billing contact . * @ return String Resource Url */ public static MozuUrl deleteUrl ( String cardId ) { } }
UrlFormatter formatter = new UrlFormatter ( "/payments/commerce/payments/cards/{cardId}" ) ; formatter . formatUrl ( "cardId" , cardId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . PCI_POD ) ;
public class Configuration { /** * Return the XML DOM corresponding to this Configuration . */ private synchronized Document asXmlDocument ( ) throws IOException { } }
Document doc ; try { doc = DocumentBuilderFactory . newInstance ( ) . newDocumentBuilder ( ) . newDocument ( ) ; } catch ( ParserConfigurationException pe ) { throw new IOException ( pe ) ; } Element conf = doc . createElement ( "configuration" ) ; doc . appendChild ( conf ) ; conf . appendChild ( doc . createTextNode ...
public class Repository { /** * < p > removeSpecification . < / p > * @ param specification a { @ link com . greenpepper . server . domain . Specification } object . * @ throws com . greenpepper . server . GreenPepperServerException if any . */ public void removeSpecification ( Specification specification ) throws ...
if ( ! specifications . contains ( specification ) ) throw new GreenPepperServerException ( GreenPepperServerErrorKey . SPECIFICATION_NOT_FOUND , "Specification not found" ) ; specifications . remove ( specification ) ; specification . setRepository ( null ) ;
public class Predicates { /** * Creates a predicate which returns true if an attribute selected from an object passed to accept method * is not contained in the iterable . */ public static < T > Predicates < T > attributeNotIn ( Function < ? super T , ? > function , Iterable < ? > iterable ) { } }
return new AttributePredicate < T , Object > ( function , Predicates . notIn ( iterable ) ) ;
public class HtmlSerializerMiddlewares { /** * Sync middleware for POJO . * @ param templateName The template name , respective to the " resources " folder * @ param < T > The Type of the parameters * @ return the middlware */ public static < T > Middleware < SyncHandler < T > , AsyncHandler < Response < ByteStri...
Middleware < SyncHandler < T > , AsyncHandler < T > > syncToAsync = Middleware :: syncToAsync ; return syncToAsync . and ( htmlSerialize ( templateName ) ) ;
public class CmsPropertyEditorHelper { /** * Determines if the title property should be changed in case of a ' NavText ' change . < p > * @ param properties the current resource properties * @ return < code > true < / code > if the title property should be changed in case of a ' NavText ' change */ private boolean ...
return ( properties == null ) || ( properties . get ( CmsPropertyDefinition . PROPERTY_TITLE ) == null ) || ( properties . get ( CmsPropertyDefinition . PROPERTY_TITLE ) . getValue ( ) == null ) || ( ( properties . get ( CmsPropertyDefinition . PROPERTY_NAVTEXT ) != null ) && properties . get ( CmsPropertyDefinition . ...
public class AmazonDynamoDBAsyncClient { /** * Updates the provisioned throughput for the given table . * Setting the throughput for a table helps you manage performance and is * part of the Provisioned Throughput feature of Amazon DynamoDB . * @ param updateTableRequest Container for the necessary parameters to ...
return executorService . submit ( new Callable < UpdateTableResult > ( ) { public UpdateTableResult call ( ) throws Exception { return updateTable ( updateTableRequest ) ; } } ) ;
public class DatatypeConverter { /** * Print an extended attribute currency value . * @ param value currency value * @ return string representation */ public static final String printExtendedAttributeCurrency ( Number value ) { } }
return ( value == null ? null : NUMBER_FORMAT . get ( ) . format ( value . doubleValue ( ) * 100 ) ) ;
public class RequestHelper { /** * Returns the { @ link Slot } for the given slot name from the request . * This method attempts to retrieve the requested { @ link Slot } from the incoming request . If the slot does not * exist in the request , an { @ link Optional } empty is returned . * This method returns an {...
Map < String , Slot > slots = castRequestType ( handlerInput , IntentRequest . class ) . getIntent ( ) . getSlots ( ) ; if ( slots != null ) { return Optional . ofNullable ( slots . get ( slotName ) ) ; } return Optional . empty ( ) ;
public class filterhtmlinjectionvariable { /** * Use this API to update filterhtmlinjectionvariable resources . */ public static base_responses update ( nitro_service client , filterhtmlinjectionvariable resources [ ] ) throws Exception { } }
base_responses result = null ; if ( resources != null && resources . length > 0 ) { filterhtmlinjectionvariable updateresources [ ] = new filterhtmlinjectionvariable [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { updateresources [ i ] = new filterhtmlinjectionvariable ( ) ; updateresources...
public class HiveRegistrationPolicyBase { /** * Enrich the table - level properties with properties carried over from ingestion runtime . * Extend this class to add more runtime properties if required . */ protected State getRuntimePropsEnrichedTblProps ( ) { } }
State tableProps = new State ( this . props . getTablePartitionProps ( ) ) ; if ( this . props . getRuntimeTableProps ( ) . isPresent ( ) ) { tableProps . setProp ( HiveMetaStoreUtils . RUNTIME_PROPS , this . props . getRuntimeTableProps ( ) . get ( ) ) ; } return tableProps ;
public class RenderingErrorMarshaller { /** * Marshall the given parameter object . */ public void marshall ( RenderingError renderingError , ProtocolMarshaller protocolMarshaller ) { } }
if ( renderingError == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( renderingError . getCode ( ) , CODE_BINDING ) ; protocolMarshaller . marshall ( renderingError . getMessage ( ) , MESSAGE_BINDING ) ; } catch ( Exception e ) { throw new ...
public class SimplePBKDF2 { /** * Verification function . * @ param formatted * & quot ; salt : iteration - count : derived - key & quot ; ( depends on * effective formatter ) . This value should come from server - side * storage . * @ param candidatePassword * The password that is checked against the forma...
// Parameter as member of Engine was not the smartest design decision back then . . . PBKDF2Parameters p = getParameters ( ) ; PBKDF2Parameters q = new PBKDF2Parameters ( ) ; q . hashAlgorithm = p . hashAlgorithm ; q . hashCharset = p . hashCharset ; boolean verifyOK = false ; if ( ! getFormatter ( ) . fromString ( q ,...
public class CommandMessage { /** * { @ inheritDoc } */ @ Override protected void addParameters ( StringBuilder result ) { } }
super . addParameters ( result ) ; result . append ( ",messageRefType=" ) ; result . append ( messageRefType ) ; result . append ( ",operation=" ) ; result . append ( operation ) ;
public class TypeQualifierApplications { /** * Look for a default type qualifier annotation . * @ param o * an AnnotatedObject * @ param typeQualifierValue * a TypeQualifierValue * @ param elementType * type of element for which we ' re looking for a default * annotation * @ return default TypeQualifier...
// Try to find a default annotation using the standard JSR - 305 // default annotation mechanism . TypeQualifierAnnotation result ; Collection < AnnotationValue > values = TypeQualifierResolver . resolveTypeQualifierDefaults ( o . getAnnotations ( ) , elementType ) ; TypeQualifierAnnotation tqa = extractAnnotation ( va...
public class MailSender { /** * Send . * @ param mailInfo the mail info */ public void send ( final MailInfo mailInfo ) { } }
try { final MultiPartEmail email = new MultiPartEmail ( ) ; email . setCharset ( "utf-8" ) ; mailInfo . fillEmail ( email ) ; email . send ( ) ; } catch ( Exception e ) { JK . throww ( e ) ; }
public class IfcDocumentInformationImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) public EList < IfcActorSelect > getEditors ( ) { } }
return ( EList < IfcActorSelect > ) eGet ( Ifc2x3tc1Package . Literals . IFC_DOCUMENT_INFORMATION__EDITORS , true ) ;
public class FrameSplitter { /** * The task computes ESPC per split */ static long [ /* nsplits */ ] [ /* nchunks */ ] computeEspcPerSplit ( long [ ] espc , long len , double [ ] ratios ) { } }
assert espc . length > 0 && espc [ 0 ] == 0 ; assert espc [ espc . length - 1 ] == len ; long [ ] partSizes = partitione ( len , ratios ) ; // Split of whole vector int nparts = ratios . length + 1 ; long [ ] [ ] r = new long [ nparts ] [ espc . length ] ; // espc for each partition long nrows = 0 ; long start = 0 ; fo...
public class Widget { /** * Remove the layout { @ link Layout } from the chain * @ param layout { @ link Layout } * @ return true if layout has been removed successfully , false - otherwise */ public boolean removeLayout ( final Layout layout ) { } }
boolean removed = mLayouts . remove ( layout ) ; if ( layout != null && removed ) { layout . onLayoutApplied ( null , new Vector3Axis ( ) ) ; } return removed ;
public class InterceptorMetaDataFactory { /** * d472972 - rewrote entire method to pass CTS . */ private EJBInterceptorBinding findInterceptorBindingForMethod ( final Method method ) { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "findInterceptorBindingForMethod: " + method . toString ( ) ) ; } // Use style 4 binding if there is one for the method . String methodSignature = MethodAttribUtils . methodSignature ( me...
public class Validate { /** * Checks if the given String is a positive double value . < br > * This method tries to parse a double value and then checks if it is bigger than 0. * @ param value The String value to validate . * @ return The parsed double value * @ throws ParameterException if the given String val...
Double doubleValue = Validate . isDouble ( value ) ; positive ( doubleValue ) ; return doubleValue ;
public class BaseAdditiveAttributeMerger { /** * Do a deep clone of an attribute Map to ensure it is completley mutable . * @ param attributes Attribute map * @ return Mutable attribute map */ protected Map < String , List < Object > > buildMutableAttributeMap ( final Map < String , List < Object > > attributes ) {...
final Map < String , List < Object > > mutableValuesBuilder = this . createMutableAttributeMap ( attributes . size ( ) ) ; for ( final Map . Entry < String , List < Object > > attrEntry : attributes . entrySet ( ) ) { final String key = attrEntry . getKey ( ) ; List < Object > value = attrEntry . getValue ( ) ; if ( va...
public class Util { /** * Send this document as text to this output stream . * @ param doc */ public static void convertDOMToXML ( Node doc , Writer out ) { } }
try { // Use a Transformer for output TransformerFactory tFactory = TransformerFactory . newInstance ( ) ; Transformer transformer = tFactory . newTransformer ( ) ; DOMSource source = new DOMSource ( doc ) ; StreamResult result = new StreamResult ( out ) ; transformer . transform ( source , result ) ; } catch ( Transfo...
public class MatchAllWeight { /** * { @ inheritDoc } */ @ Override public Explanation explain ( IndexReader reader , int doc ) throws IOException { } }
return new Explanation ( Similarity . getDefault ( ) . idf ( reader . maxDoc ( ) , reader . maxDoc ( ) ) , "matchAll" ) ;
public class AdWordsServicesWithRateLimiter { /** * Gets a rate - limit - aware client for the service represented by the interface with a reference to * the session . * < p > The objects returned by this method are not thread - safe . * @ param < T > the service type * @ param session your current session * ...
T originalInterfaceObject = adWordsServices . get ( session , interfaceClass ) ; return getProxyObject ( originalInterfaceObject , session , interfaceClass , false ) ;
public class LonePairGenerator { /** * { @ inheritDoc } */ @ Override public IRenderingElement generate ( IAtomContainer container , RendererModel model ) { } }
ElementGroup group = new ElementGroup ( ) ; // TODO : put into RendererModel final double SCREEN_RADIUS = 1.0 ; // separation between centers final double SCREEN_SEPARATION = 2.5 ; final Color RADICAL_COLOR = Color . BLACK ; // XXX : is this the best option ? final double ATOM_RADIUS = ( ( AtomRadius ) model . getParam...
public class PowerMock { /** * A utility method that may be used to nicely mock several methods in an * easy way ( by just passing in the method names of the method you wish to * mock ) . Note that you cannot uniquely specify a method to mock using this * method if there are several methods with the same name in ...
return createNiceMock ( type , Whitebox . getMethods ( where , methodNames ) ) ;
public class ApiOvhEmailexchange { /** * Alter this object properties * REST : PUT / email / exchange / { organizationName } / service / { exchangeService } / sharedAccount / { sharedEmailAddress } * @ param body [ required ] New object properties * @ param organizationName [ required ] The internal name of your ...
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/sharedAccount/{sharedEmailAddress}" ; StringBuilder sb = path ( qPath , organizationName , exchangeService , sharedEmailAddress ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ;
public class CmsResourceUtil { /** * Returns the big icon resource for the given resource . < p > * @ param explorerType the resource explorer type settings * @ param resourceName the resource name * @ return the icon resource */ public static Resource getBigIconResource ( CmsExplorerTypeSettings explorerType , S...
if ( explorerType == null ) { explorerType = OpenCms . getWorkplaceManager ( ) . getExplorerTypeSetting ( ( resourceName == null ) && ! CmsResource . isFolder ( resourceName ) ? CmsResourceTypeUnknownFile . RESOURCE_TYPE_NAME : CmsResourceTypeUnknownFolder . RESOURCE_TYPE_NAME ) ; } if ( ! explorerType . getIconRules (...
public class AbstractAppender { /** * Builds an empty AppendEntries request . * Empty append requests are used as heartbeats to followers . */ @ SuppressWarnings ( "unchecked" ) protected AppendRequest buildAppendEmptyRequest ( MemberState member ) { } }
Entry prevEntry = getPrevEntry ( member ) ; ServerMember leader = context . getLeader ( ) ; return AppendRequest . builder ( ) . withTerm ( context . getTerm ( ) ) . withLeader ( leader != null ? leader . id ( ) : 0 ) . withLogIndex ( prevEntry != null ? prevEntry . getIndex ( ) : 0 ) . withLogTerm ( prevEntry != null ...
public class Menus { /** * Set up the key areas . */ public void setupKeys ( ) { } }
KeyAreaInfo keyArea = null ; keyArea = new KeyAreaInfo ( this , Constants . UNIQUE , ID_KEY ) ; keyArea . addKeyField ( ID , Constants . ASCENDING ) ; keyArea = new KeyAreaInfo ( this , Constants . NOT_UNIQUE , PARENT_FOLDER_ID_KEY ) ; keyArea . addKeyField ( PARENT_FOLDER_ID , Constants . ASCENDING ) ; keyArea . addKe...
public class TangoEventsAdapter { public void addTangoChangeListener ( ITangoChangeListener listener , String attrName , String [ ] filters , boolean stateless ) throws DevFailed { } }
TangoChange tangoChange ; String key = deviceName + "/" + attrName ; if ( ( tangoChange = tango_change_source . get ( key ) ) == null ) { tangoChange = new TangoChange ( deviceProxy , attrName , filters ) ; tango_change_source . put ( key , tangoChange ) ; } synchronized ( moni ) { tangoChange . addTangoChangeListener ...
public class Annotations { /** * Attach @ ConnectionDefinition * @ param mcf The managed connection factory * @ param cd The connection definition * @ param classLoader The class loader * @ param configProperties The config properties * @ param plainConfigProperties The plain config properties * @ return Th...
if ( trace ) log . trace ( "Processing: " + cd ) ; ArrayList < ConfigProperty > validProperties = new ArrayList < ConfigProperty > ( ) ; if ( configProperties != null ) { for ( ConfigProperty configProperty : configProperties ) { if ( mcf . equals ( ( ( ConfigPropertyImpl ) configProperty ) . getAttachedClassName ( ) )...
public class AsciiArtRenderer { /** * < b > Example : < / b > * { @ code > } */ @ Override public void renderNothing ( PositionedText target , double x , double y , boolean forward ) { } }
target . add ( x , y , ">" ) ;
public class TextReport { /** * Test events subscriptions . */ @ Subscribe public void onStart ( AggregatedStartEvent e ) throws IOException { } }
this . totalSuites = e . getSuiteCount ( ) ; logShort ( "Executing " + totalSuites + Pluralize . pluralize ( totalSuites , " suite" ) + " with " + e . getSlaveCount ( ) + Pluralize . pluralize ( e . getSlaveCount ( ) , " JVM" ) + ".\n" , false ) ; forkedJvmCount = e . getSlaveCount ( ) ; jvmIdFormat = " J%-" + ( 1 + ( ...
public class Types { /** * Resolve a sub type of the given super type . * @ param superType * the super type * @ param subType * the sub type to resolve * @ return * resolved type * @ see TypeResolver # resolveSubtype ( ResolvedType , Class ) */ @ NonNull public static ResolvedType resolveSubtype ( @ NonN...
return typeResolver . resolveSubtype ( superType , subType ) ;
public class LuceneQueryHits { /** * { @ inheritDoc } */ public void close ( ) throws IOException { } }
if ( scorer != null ) { // make sure scorer frees resources scorer . advance ( Integer . MAX_VALUE ) ; } if ( releaseReaderOnClose && reader != null && reader instanceof ReleaseableIndexReader ) { ( ( ReleaseableIndexReader ) reader ) . release ( ) ; }
public class DomainModelControllerService { /** * bit of stuff */ @ Override protected void boot ( final BootContext context ) throws ConfigurationPersistenceException { } }
final ServiceTarget serviceTarget = context . getServiceTarget ( ) ; boolean ok = false ; boolean reachedServers = false ; try { // Install server inventory callback ServerInventoryCallbackService . install ( serviceTarget ) ; // handler for domain server auth . DomainManagedServerCallbackHandler . install ( serviceTar...
public class CommerceTierPriceEntryPersistenceImpl { /** * Returns the commerce tier price entry with the primary key or throws a { @ link com . liferay . portal . kernel . exception . NoSuchModelException } if it could not be found . * @ param primaryKey the primary key of the commerce tier price entry * @ return ...
CommerceTierPriceEntry commerceTierPriceEntry = fetchByPrimaryKey ( primaryKey ) ; if ( commerceTierPriceEntry == null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } throw new NoSuchTierPriceEntryException ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } r...
public class LevelDB { /** * Returns metadata about indices for the given type . */ LevelDBTypeInfo getTypeInfo ( Class < ? > type ) throws Exception { } }
LevelDBTypeInfo ti = types . get ( type ) ; if ( ti == null ) { LevelDBTypeInfo tmp = new LevelDBTypeInfo ( this , type , getTypeAlias ( type ) ) ; ti = types . putIfAbsent ( type , tmp ) ; if ( ti == null ) { ti = tmp ; } } return ti ;
public class SimpleMMcifConsumer { /** * Here we link entities to chains . * Also if entities are not present in file , this initialises the entities with some heuristics , see { @ link org . biojava . nbio . structure . io . EntityFinder } */ private void linkEntities ( ) { } }
for ( int i = 0 ; i < allModels . size ( ) ; i ++ ) { for ( Chain chain : allModels . get ( i ) ) { // logger . info ( " linking entities for " + chain . getId ( ) + " " + chain . getName ( ) ) ; String entityId = asymId2entityId . get ( chain . getId ( ) ) ; if ( entityId == null ) { // this can happen for instance if...
public class TcpIpHandlerAdapter { /** * / * ( non - Javadoc ) * @ see org . apache . mina . core . service . IoHandlerAdapter # sessionOpened ( org . apache . mina . core . session . IoSession ) */ @ Override public final void sessionOpened ( final IoSession session ) throws Exception { } }
session . write ( this . welcome ) ; session . write ( ENDLINE ) ; session . write ( "> " ) ; super . sessionOpened ( session ) ;
public class IterUtil { /** * 将键列表和值列表转换为Map < br > * 以键为准 , 值与键位置需对应 。 如果键元素数多于值元素 , 多余部分值用null代替 。 < br > * 如果值多于键 , 忽略多余的值 。 * @ param < K > 键类型 * @ param < V > 值类型 * @ param keys 键列表 * @ param values 值列表 * @ param isOrder 是否有序 * @ return 标题内容Map * @ since 4.1.12 */ public static < K , V > Map < K ...
return toMap ( null == keys ? null : keys . iterator ( ) , null == values ? null : values . iterator ( ) , isOrder ) ;
public class ScaleTypeDrawable { /** * Sets the focus point . * If ScaleType . FOCUS _ CROP is used , focus point will attempted to be centered within a view . * Each coordinate is a real number in [ 0,1 ] range , in the coordinate system where top - left * corner of the image corresponds to ( 0 , 0 ) and the bot...
if ( Objects . equal ( mFocusPoint , focusPoint ) ) { return ; } if ( mFocusPoint == null ) { mFocusPoint = new PointF ( ) ; } mFocusPoint . set ( focusPoint ) ; configureBounds ( ) ; invalidateSelf ( ) ;
public class IOStreamConnector { /** * public IOStreamConnectorState getState ( ) { return state ; } */ public void close ( ) { } }
if ( thread == null ) { closed = true ; } running = false ; if ( thread != null ) { thread . interrupt ( ) ; }
public class TemporalAdjusters { /** * Obtains a { @ code TemporalAdjuster } that wraps a date adjuster . * The { @ code TemporalAdjuster } is based on the low level { @ code Temporal } interface . * This method allows an adjustment from { @ code LocalDate } to { @ code LocalDate } * to be wrapped to match the te...
Objects . requireNonNull ( dateBasedAdjuster , "dateBasedAdjuster" ) ; return ( temporal ) -> { LocalDate input = LocalDate . from ( temporal ) ; LocalDate output = dateBasedAdjuster . apply ( input ) ; return temporal . with ( output ) ;
public class ResourceadapterTypeImpl { /** * Returns all < code > security - permission < / code > elements * @ return list of < code > security - permission < / code > */ public List < SecurityPermissionType < ResourceadapterType < T > > > getAllSecurityPermission ( ) { } }
List < SecurityPermissionType < ResourceadapterType < T > > > list = new ArrayList < SecurityPermissionType < ResourceadapterType < T > > > ( ) ; List < Node > nodeList = childNode . get ( "security-permission" ) ; for ( Node node : nodeList ) { SecurityPermissionType < ResourceadapterType < T > > type = new SecurityPe...
public class SaverDef { /** * < pre > * The operation to run when saving a model checkpoint . * < / pre > * < code > optional string save _ tensor _ name = 2 ; < / code > */ public java . lang . String getSaveTensorName ( ) { } }
java . lang . Object ref = saveTensorName_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; saveTensorName_ = s ; return s ; }
public class ManageAddOnsDialog { /** * Notifies that the given { @ code addOn } as not successfully uninstalled . Add - ons that were not successfully uninstalled are * not re - selectable . * @ param addOn the add - on that was not successfully uninstalled * @ since 2.4.0 */ public void notifyAddOnFailedUninsta...
if ( EventQueue . isDispatchThread ( ) ) { installedAddOnsModel . notifyAddOnFailedUninstallation ( addOn ) ; } else { EventQueue . invokeLater ( new Runnable ( ) { @ Override public void run ( ) { notifyAddOnFailedUninstallation ( addOn ) ; } } ) ; }
public class X509CertImpl { /** * DER encode this object onto an output stream . * Implements the < code > DerEncoder < / code > interface . * @ param out the output stream on which to write the DER encoding . * @ exception IOException on encoding error . */ public void derEncode ( OutputStream out ) throws IOExc...
if ( signedCert == null ) throw new IOException ( "Null certificate to encode" ) ; out . write ( signedCert . clone ( ) ) ;
public class CircularSlider { /** * common initializer method */ private void init ( Context context , AttributeSet attrs , int defStyleAttr ) { } }
TypedArray a = context . obtainStyledAttributes ( attrs , R . styleable . CircularSlider , defStyleAttr , 0 ) ; // read all available attributes float startAngle = a . getFloat ( R . styleable . CircularSlider_start_angle , ( float ) Math . PI / 2 ) ; float angle = a . getFloat ( R . styleable . CircularSlider_angle , ...
public class BundleUtils { /** * Returns a optional { @ link java . lang . String } array value . In other words , returns the value mapped by key if it exists and is a { @ link java . lang . String } array . * The bundle argument is allowed to be { @ code null } . If the bundle is null , this method returns null . ...
return optStringArray ( bundle , key , new String [ 0 ] ) ;
public class CmsResourceFilter { /** * Validates if a CmsResource fits to all filer settings . < p > * Please note that the " visible permission " setting of the filter is NOT checked * in this method since the permission information is not part of the resource . * The visible permission information in the filter...
if ( this == ALL ) { // shortcut for " ALL " filter where nothing is filtered return true ; } // check for required resource state switch ( m_filterState ) { case EXCLUDED : if ( resource . getState ( ) . equals ( m_state ) ) { return false ; } break ; case REQUIRED : if ( ! resource . getState ( ) . equals ( m_state )...
public class RhinoSecurityManager { /** * Get the class of the top - most stack element representing a script . * @ return The class of the top - most script in the current stack , * or null if no script is currently running */ protected Class < ? > getCurrentScriptClass ( ) { } }
Class < ? > [ ] context = getClassContext ( ) ; for ( Class < ? > c : context ) { if ( c != InterpretedFunction . class && NativeFunction . class . isAssignableFrom ( c ) || PolicySecurityController . SecureCaller . class . isAssignableFrom ( c ) ) { return c ; } } return null ;
public class SubmissionDocumentRepositoryMongoImpl { /** * { @ inheritDoc } */ @ Override public final Iterable < SubmissionDocument > findAll ( final String filename ) { } }
final Query searchQuery = new Query ( Criteria . where ( "filename" ) . is ( filename ) ) ; final List < SubmissionDocumentMongo > submissionDocumentsMongo = mongoTemplate . find ( searchQuery , SubmissionDocumentMongo . class ) ; if ( submissionDocumentsMongo == null ) { return null ; } final List < SubmissionDocument...
public class DoubleProperty { /** * Retrieves the value of this double property . If the property has no * value , returns the default value . If there is no default value , returns * the given default value . In all cases , the returned value is limited to * the min / max value range given during construction . ...
final String value = getInternal ( Double . toString ( defaultValue ) , false ) ; if ( value == null ) { return limit ( defaultValue ) ; } double v = Double . parseDouble ( value ) ; // need to limit value in case setString ( ) was called directly with // an out - of - range value return limit ( v ) ;
public class OWLOntologyID_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 read the * obje...
deserialize ( streamReader , instance ) ;
public class WorkflowProgress { /** * Gets the steps value for this WorkflowProgress . * @ return steps * The steps in this workflow . */ public com . google . api . ads . admanager . axis . v201808 . ProgressStep [ ] getSteps ( ) { } }
return steps ;
public class DocImpl { /** * Utility for subclasses which read HTML documentation files . */ String readHTMLDocumentation ( InputStream input , FileObject filename ) throws IOException { } }
byte [ ] filecontents = new byte [ input . available ( ) ] ; try { DataInputStream dataIn = new DataInputStream ( input ) ; dataIn . readFully ( filecontents ) ; } finally { input . close ( ) ; } String encoding = env . getEncoding ( ) ; String rawDoc = ( encoding != null ) ? new String ( filecontents , encoding ) : ne...
public class RandomCollection { /** * Resets this object so it behaves like a newly constructed instance . */ @ Override public void reset ( ) { } }
this . priorityElements = Lists . newArrayList ( originalElements ) ; Collections . shuffle ( priorityElements ) ; this . currentElements = Lists . newArrayListWithExpectedSize ( 2 * originalElements . size ( ) ) ; this . currentElements . addAll ( originalElements ) ;
public class Graph { /** * Adds a new edge to this graph , given a new Edge object . It uses the GraphStructure attribute ' s * addEdge method to add the new edge to this graph . If one of the node ids of the given Edge object * does not exists in this graph , a NodeNotFoundException is thrown . Otherwise , the edg...
structure . addEdge ( e ) ; for ( EdgeListener listener : edgeListeners ) listener . onInsert ( e ) ;
public class MediaTypes { /** * Merge with this one . * @ param types Types * @ return Merged list */ public MediaTypes merge ( final MediaTypes types ) { } }
final SortedSet < MediaType > set = new TreeSet < > ( ) ; set . addAll ( this . list ) ; set . addAll ( types . list ) ; return new MediaTypes ( set ) ;
public class PartialResponseWriter { /** * < p class = " changed _ added _ 2_0 " > Write the start of a partial response . < / p > * @ throws IOException if an input / output error occurs * @ since 2.0 */ public void startDocument ( ) throws IOException { } }
ResponseWriter writer = getWrapped ( ) ; String encoding = writer . getCharacterEncoding ( ) ; if ( encoding == null ) { encoding = "utf-8" ; } writer . writePreamble ( "<?xml version='1.0' encoding='" + encoding + "'?>\n" ) ; writer . startElement ( "partial-response" , null ) ; FacesContext ctx = FacesContext . getCu...