signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ManipulationUtils { /** * Adds the retrieveInternalModelVersion method to the class . */ private static void addRetrieveInternalModelVersion ( CtClass clazz ) throws NotFoundException , CannotCompileException { } }
CtClass [ ] params = generateClassField ( ) ; CtMethod method = new CtMethod ( cp . get ( Integer . class . getName ( ) ) , "retrieveInternalModelVersion" , params , clazz ) ; StringBuilder builder = new StringBuilder ( ) ; builder . append ( createTrace ( "Called retrieveInternalModelVersion" ) ) . append ( String . f...
public class Exceptions { /** * Create a { @ link RSocketException } from a Frame that matches the error code it contains . * @ param frame the frame to retrieve the error code and message from * @ return a { @ link RSocketException } that matches the error code in the Frame * @ throws NullPointerException if { @...
Objects . requireNonNull ( frame , "frame must not be null" ) ; int errorCode = ErrorFrameFlyweight . errorCode ( frame ) ; String message = ErrorFrameFlyweight . dataUtf8 ( frame ) ; switch ( errorCode ) { case APPLICATION_ERROR : return new ApplicationErrorException ( message ) ; case CANCELED : return new CanceledEx...
public class ResourceLocks { /** * deletes unused LockedObjects and resets the counter . works recursively starting at the given LockedObject * @ param lo LockedObject * @ param temporary Clean temporary or real locks * @ return if cleaned */ private boolean cleanLockedObjects ( LockedObject lo , boolean temporar...
if ( lo . children == null ) { if ( lo . owner == null ) { if ( temporary ) { lo . removeTempLockedObject ( ) ; } else { lo . removeLockedObject ( ) ; } return true ; } return false ; } boolean canDelete = true ; int limit = lo . children . length ; for ( int i = 0 ; i < limit ; i ++ ) { if ( ! cleanLockedObjects ( lo ...
public class ClusterSettings { /** * Hazelcast must be started when cluster is activated on all nodes but search ones */ public static boolean shouldStartHazelcast ( AppSettings appSettings ) { } }
return isClusterEnabled ( appSettings . getProps ( ) ) && toNodeType ( appSettings . getProps ( ) ) . equals ( NodeType . APPLICATION ) ;
public class MonthDay { /** * Obtains an instance of { @ code MonthDay } . * The day - of - month must be valid for the month within a leap year . * Hence , for February , day 29 is valid . * For example , passing in April and day 31 will throw an exception , as * there can never be April 31st in any year . By ...
Objects . requireNonNull ( month , "month" ) ; DAY_OF_MONTH . checkValidValue ( dayOfMonth ) ; if ( dayOfMonth > month . maxLength ( ) ) { throw new DateTimeException ( "Illegal value for DayOfMonth field, value " + dayOfMonth + " is not valid for month " + month . name ( ) ) ; } return new MonthDay ( month . getValue ...
public class ASGResource { /** * Changes the status information of the ASG . * @ param asgName the name of the ASG for which the status needs to be changed . * @ param newStatus the new status { @ link ASGStatus } of the ASG . * @ param isReplication a header parameter containing information whether this is repli...
if ( awsAsgUtil == null ) { return Response . status ( 400 ) . build ( ) ; } try { logger . info ( "Trying to update ASG Status for ASG {} to {}" , asgName , newStatus ) ; ASGStatus asgStatus = ASGStatus . valueOf ( newStatus . toUpperCase ( ) ) ; awsAsgUtil . setStatus ( asgName , ( ! ASGStatus . DISABLED . equals ( a...
public class UnindexedFace { /** * An array of reasons that specify why a face wasn ' t indexed . * < ul > * < li > * EXTREME _ POSE - The face is at a pose that can ' t be detected . For example , the head is turned too far away from * the camera . * < / li > * < li > * EXCEEDS _ MAX _ FACES - The number...
if ( reasons == null ) { this . reasons = null ; return ; } this . reasons = new java . util . ArrayList < String > ( reasons ) ;
public class DefaultAsyncSearchQueryResult { /** * A utility method to convert an HTTP 400 response from the search service into a proper * { @ link AsyncSearchQueryResult } . HTTP 400 indicates the request was malformed and couldn ' t * be parsed on the server . As of Couchbase Server 4.5 such a response is a text...
// dummy default values SearchStatus status = new DefaultSearchStatus ( 1L , 1L , 0L ) ; SearchMetrics metrics = new DefaultSearchMetrics ( 0L , 0L , 0d ) ; return new DefaultAsyncSearchQueryResult ( status , Observable . < SearchQueryRow > error ( new FtsMalformedRequestException ( payload ) ) , Observable . < FacetRe...
public class SitesConfigurationBuilder { /** * Defines the site names , from the list of sites names defined within ' backups ' element , to * which this cache backups its data . */ public SitesConfigurationBuilder addInUseBackupSite ( String site ) { } }
Set < String > sites = attributes . attribute ( IN_USE_BACKUP_SITES ) . get ( ) ; sites . add ( site ) ; attributes . attribute ( IN_USE_BACKUP_SITES ) . set ( sites ) ; return this ;
public class CmsStaticExportManager { /** * Sets the link substitution handler class . < p > * @ param handlerClassName the link substitution handler class name */ public void setHandler ( String handlerClassName ) { } }
try { m_handler = ( I_CmsStaticExportHandler ) Class . forName ( handlerClassName ) . newInstance ( ) ; } catch ( Exception e ) { // should never happen LOG . error ( e . getLocalizedMessage ( ) , e ) ; }
public class CPDefinitionVirtualSettingUtil { /** * Returns the cp definition virtual setting where uuid = & # 63 ; and groupId = & # 63 ; or returns < code > null < / code > if it could not be found , optionally using the finder cache . * @ param uuid the uuid * @ param groupId the group ID * @ param retrieveFro...
return getPersistence ( ) . fetchByUUID_G ( uuid , groupId , retrieveFromCache ) ;
public class ContentSpec { /** * Set the Maven POM version that is used in the pom . xml file when building the jDocbook files . * @ param pomVersion The Maven POM version to be used when building . */ public void setPOMVersion ( final String pomVersion ) { } }
if ( pomVersion == null && this . pomVersion == null ) { return ; } else if ( pomVersion == null ) { removeChild ( this . pomVersion ) ; this . pomVersion = null ; } else if ( this . pomVersion == null ) { this . pomVersion = new KeyValueNode < String > ( CommonConstants . CS_MAVEN_POM_VERSION_TITLE , pomVersion ) ; ap...
public class HttpUtil { /** * returns ' true ' if ' lastModified ' is after ' ifModifiedSince ' ( and both values are valid ) */ public static boolean isModifiedSince ( long ifModifiedSince , Calendar lastModified ) { } }
return lastModified != null && isModifiedSince ( ifModifiedSince , lastModified . getTimeInMillis ( ) ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EEnum getIfcConstructionMaterialResourceTypeEnum ( ) { } }
if ( ifcConstructionMaterialResourceTypeEnumEEnum == null ) { ifcConstructionMaterialResourceTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 944 ) ; } return ifcConstructionMaterialResourceTypeEnumEEnum ;
public class Vector2f { /** * / * ( non - Javadoc ) * @ see org . joml . Vector2fc # sub ( float , float , org . joml . Vector2f ) */ public Vector2f sub ( float x , float y , Vector2f dest ) { } }
dest . x = this . x - x ; dest . y = this . y - y ; return dest ;
public class ScreenshotListener { /** * Returns a date suffix string * @ return String */ private String getDateSuffix ( ) { } }
Calendar cal = Calendar . getInstance ( ) ; int year = cal . get ( Calendar . YEAR ) ; int month = cal . get ( Calendar . MONTH ) ; // 0 to 11 int day = cal . get ( Calendar . DAY_OF_MONTH ) ; int hour = cal . get ( Calendar . HOUR_OF_DAY ) ; int minute = cal . get ( Calendar . MINUTE ) ; int second = cal . get ( Calen...
public class EvalVisitor { /** * Protected helper for { @ code computeFunction } . * @ param fn The function object . * @ param args The arguments to the function . * @ param fnNode The function node . Only used for error reporting . * @ return The result of the function called on the given arguments . */ @ For...
try { return new TofuValueFactory ( fnNode , pluginInstances ) . computeForJava ( fn , args , context ) ; } catch ( Exception e ) { throw RenderException . create ( "While computing function \"" + fnNode . toSourceString ( ) + "\": " + e . getMessage ( ) , e ) ; }
public class Files { /** * Remove ALL files and directories from a given base directory . This method remove ALL files and directory tree , * child of given < code > baseDir < / code > but directory itself is not removed . As a result < code > baseDir < / code > becomes * empty , that is , no children . If exceptio...
Params . notNull ( baseDir , "Base directory" ) ; Params . isDirectory ( baseDir , "Base directory" ) ; log . debug ( "Remove files hierarchy with base directory |%s|." , baseDir ) ; removeDirectory ( baseDir ) ;
public class ColumnMapperDouble { /** * { @ inheritDoc } */ @ Override public SortField sortField ( String field , boolean reverse ) { } }
return new SortField ( field , Type . DOUBLE , reverse ) ;
public class ResourceCache { /** * Adds multiple resources to cache . * @ param resources items to add * @ throws IllegalStateException in case < code > init ( ) < / code > was not called */ public void cache ( Map < String , Object > resources ) { } }
verifyState ( ) ; if ( ! cacheLocked . get ( ) ) { resourceCache . get ( ) . putAll ( resources ) ; }
public class AbstractRunMojo { /** * Copy a custom Share Log4J config into the share - war / WEB - INF / classes dir . * There is no custom classpath resolve mechanism for Share log4j , * to log custom stuff overriding standard log4j . properties is needed . * @ throws MojoExecutionException when any problem appe...
if ( ! useCustomShareLog4jConfig ) { getLog ( ) . info ( "NOT overriding share/WEB-INF/classes/log4j.properties" ) ; return ; } final String warOutputDir = getWarOutputDir ( SHARE_WAR_PREFIX_NAME ) ; final String logConfDestDir = warOutputDir + "/WEB-INF/classes" ; getLog ( ) . info ( "Copying Share log4j.properties to...
public class Events { /** * Recursively finds events defined by the given type and its implemented interfaces . * @ param type the type for which to find events * @ return the events defined by the given type and its parent interfaces */ private static Map < Method , EventType > findMethods ( Class < ? > type ) { }...
Map < Method , EventType > events = new HashMap < > ( ) ; for ( Method method : type . getDeclaredMethods ( ) ) { Event event = method . getAnnotation ( Event . class ) ; if ( event != null ) { String name = event . value ( ) . equals ( "" ) ? method . getName ( ) : event . value ( ) ; events . put ( method , EventType...
public class ArrayUtils { /** * 统计Array的长度 * @ param array 数组 * @ return 数组的长度 * @ throws IllegalArgumentException 如果给定的数据不为array */ public static int count ( final Object array ) { } }
if ( isArray ( array ) ) { return Array . getLength ( array ) ; } else if ( array != null ) { throw new IllegalArgumentException ( "Given data is not an array." ) ; } else { return 0 ; }
public class SMailDogmaticPostalPersonnel { protected SMailTextProofreader createProofreader ( ) { } }
final List < SMailTextProofreader > readerList = new ArrayList < SMailTextProofreader > ( 4 ) ; setupProofreader ( readerList ) ; return new SMailBatchProofreader ( readerList ) ;
public class MultiUserChatLight { /** * Change the name of the room . * @ param roomName * @ throws NoResponseException * @ throws XMPPErrorException * @ throws NotConnectedException * @ throws InterruptedException */ public void changeRoomName ( String roomName ) throws NoResponseException , XMPPErrorExcepti...
MUCLightSetConfigsIQ mucLightSetConfigIQ = new MUCLightSetConfigsIQ ( room , roomName , null ) ; connection . createStanzaCollectorAndSend ( mucLightSetConfigIQ ) . nextResultOrThrow ( ) ;
public class PackageNameMapping { /** * Sets the package pattern to match against . */ public static PackageNameMappingWithPackagePattern fromPackage ( String packagePattern ) { } }
PackageNameMapping packageNameMapping = new PackageNameMapping ( ) ; packageNameMapping . setPackagePattern ( packagePattern ) ; return packageNameMapping ;
public class ThresholdSauvola_MT { /** * Converts the input image into a binary image . * @ param input Input image . Not modified . * @ param output Output binary image . Modified . */ @ Override public void process ( GrayF32 input , GrayU8 output ) { } }
inputPow2 . reshape ( input . width , input . height ) ; inputMean . reshape ( input . width , input . height ) ; inputMeanPow2 . reshape ( input . width , input . height ) ; inputPow2Mean . reshape ( input . width , input . height ) ; stdev . reshape ( input . width , input . height ) ; tmp . reshape ( input . width ,...
public class PaaSPropertyManager { /** * returns the properties for group . When the group is specified with * ApplicationProperties . xml ( old style ) , the names of the properties * returned will not contain the group names and ' / ' , for backward * compatibility . When the group is in the new style , where a...
Properties props = new Properties ( ) ; int k = group . length ( ) ; for ( Object key : properties . keySet ( ) ) { String propname = ( String ) key ; int l = propname . length ( ) ; char ch = l > k ? propname . charAt ( k ) : ' ' ; if ( ( ch == '.' || ch == '/' ) && propname . startsWith ( group ) ) { if ( ch == '.' )...
public class BasicBinder { /** * Resolve a Marshaller with the given source and target class . * The marshaller is used as follows : Instances of the source can be marshalled into the target class . * @ param key The key to look up */ public < S , T > ToMarshaller < S , T > findMarshaller ( ConverterKey < S , T > k...
Converter < S , T > converter = findConverter ( key ) ; if ( converter == null ) { return null ; } if ( ToMarshallerConverter . class . isAssignableFrom ( converter . getClass ( ) ) ) { return ( ( ToMarshallerConverter < S , T > ) converter ) . getMarshaller ( ) ; } else { return new ConverterToMarshaller < S , T > ( c...
public class GraphPath { /** * Remove the path ' s elements after the * specified one which is starting * at the specified point . The specified element will * be removed . * < p > This function removes after the < i > first occurence < / i > * of the given object . * @ param obj is the segment to remove ...
return removeAfter ( indexOf ( obj , pt ) , true ) ;
public class GroupBasicAdapter { /** * remove a group * @ param removed the group index to be removed */ public void removeGroup ( int removed ) { } }
List < L > cards = getGroups ( ) ; if ( removed >= 0 && removed < cards . size ( ) ) { boolean changed = cards . remove ( removed ) != null ; if ( changed ) { setData ( cards ) ; } }
public class ModeledUser { /** * Stores all unrestricted ( unprivileged ) attributes within the given Map , * pulling the values of those attributes from the underlying user model . * If no value is yet defined for an attribute , that attribute will be set * to null . * @ param attributes * The Map to store a...
// Set full name attribute attributes . put ( User . Attribute . FULL_NAME , getModel ( ) . getFullName ( ) ) ; // Set email address attribute attributes . put ( User . Attribute . EMAIL_ADDRESS , getModel ( ) . getEmailAddress ( ) ) ; // Set organization attribute attributes . put ( User . Attribute . ORGANIZATION , g...
public class CommonOps_DDRM { /** * Removes columns from the matrix . * @ param A Matrix . Modified * @ param col0 First column * @ param col1 Last column , inclusive . */ public static void removeColumns ( DMatrixRMaj A , int col0 , int col1 ) { } }
if ( col1 < col0 ) { throw new IllegalArgumentException ( "col1 must be >= col0" ) ; } else if ( col0 >= A . numCols || col1 >= A . numCols ) { throw new IllegalArgumentException ( "Columns which are to be removed must be in bounds" ) ; } int step = col1 - col0 + 1 ; int offset = 0 ; for ( int row = 0 , idx = 0 ; row <...
public class UserRegistryWrapper { /** * { @ inheritDoc } */ @ Override @ FFDCIgnore ( com . ibm . ws . security . registry . CertificateMapFailedException . class ) public String mapCertificate ( X509Certificate [ ] chain ) throws CertificateMapNotSupportedException , CertificateMapFailedException , CustomRegistryExce...
try { return wrappedUr . mapCertificate ( chain ) ; } catch ( RegistryException e ) { throw new CustomRegistryException ( e . getMessage ( ) , e ) ; } catch ( com . ibm . ws . security . registry . CertificateMapNotSupportedException e ) { throw new CertificateMapNotSupportedException ( e . getMessage ( ) , e ) ; } cat...
public class MSBuildExecutor { /** * Execute the build . * The function assumes that at least 1 platform configuration has been provided * in a list via { @ link # setPlatforms ( List ) } . * @ throws IOException if there is a problem executing MSBuild * @ throws InterruptedException if execution is interrupted...
for ( BuildPlatform platform : buildPlatforms ) { for ( BuildConfiguration configuration : platform . getConfigurations ( ) ) { int exitCode = runMSBuild ( platform . getName ( ) , configuration . getName ( ) ) ; if ( exitCode != 0 ) { return exitCode ; } } } return 0 ;
public class ByteCodeWriter { /** * Writes UTF - 8 */ public void writeUTF8 ( ByteArrayBuffer bb , String value ) { } }
bb . clear ( ) ; for ( int i = 0 ; i < value . length ( ) ; i ++ ) { int ch = value . charAt ( i ) ; if ( ch > 0 && ch < 0x80 ) bb . append ( ch ) ; else if ( ch < 0x800 ) { bb . append ( 0xc0 + ( ch >> 6 ) ) ; bb . append ( 0x80 + ( ch & 0x3f ) ) ; } else { bb . append ( 0xe0 + ( ch >> 12 ) ) ; bb . append ( 0x80 + ( ...
public class NetworkClient { /** * Returns the specified network . Gets a list of available networks by making a list ( ) request . * < p > Sample code : * < pre > < code > * try ( NetworkClient networkClient = NetworkClient . create ( ) ) { * ProjectGlobalNetworkName network = ProjectGlobalNetworkName . of ( "...
GetNetworkHttpRequest request = GetNetworkHttpRequest . newBuilder ( ) . setNetwork ( network == null ? null : network . toString ( ) ) . build ( ) ; return getNetwork ( request ) ;
public class ViewHandler { /** * < p class = " changed _ added _ 2_0 " > Return a JSF action URL derived * from the < code > viewId < / code > argument that is suitable to be used * by the { @ link NavigationHandler } to issue a redirect request to * the URL using a NonFaces request . Compliant implementations ...
return getActionURL ( context , viewId ) ;
public class StructureImpl { /** * { @ inheritDoc } */ @ Override public void addChain ( Chain chain , int modelnr ) { } }
// if model has not been initialized , init it ! chain . setStructure ( this ) ; if ( models . isEmpty ( ) ) { Model model = new Model ( ) ; List < Chain > modelChains = new ArrayList < > ( ) ; modelChains . add ( chain ) ; model . setChains ( modelChains ) ; models . add ( model ) ; } else { Model model = models . get...
public class RecursiveTypeAnalysis { @ Override public void visitTypeNominal ( Type . Nominal type , Set < QualifiedName > visited ) { } }
// Extract declaration link Decl . Link < Decl . Type > link = type . getLink ( ) ; // Sanity check type makes sense if ( link . isResolved ( ) ) { // Extract the declaration to which this type refers . Decl . Type decl = link . getTarget ( ) ; // Recursively traverse it . visitType ( decl , visited ) ; }
public class LightBulb { /** * Enables / disables the glowing of the lightbulb * @ param ON */ public void setOn ( final boolean ON ) { } }
boolean oldState = on ; on = ON ; propertySupport . firePropertyChange ( STATE_PROPERTY , oldState , on ) ; repaint ( getInnerBounds ( ) ) ;
public class A_CmsXmlDocument { /** * Marshals ( writes ) the content of the current XML document * into an output stream . < p > * @ param out the output stream to write to * @ param encoding the encoding to use * @ return the output stream with the XML content * @ throws CmsXmlException if something goes wr...
return CmsXmlUtils . marshal ( m_document , out , encoding ) ;
public class RF2Importer { /** * Loads all the module dependency information from all RF2 inputs into a single { @ link IModuleDependencyRefset } . * @ return * @ throws ImportException */ protected IModuleDependencyRefset loadModuleDependencies ( RF2Input input ) throws ImportException { } }
Set < InputStream > iss = new HashSet < > ( ) ; InputType inputType = input . getInputType ( ) ; for ( String md : input . getModuleDependenciesRefsetFiles ( ) ) { try { iss . add ( input . getInputStream ( md ) ) ; } catch ( NullPointerException | IOException e ) { final String message = StructuredLog . ModuleLoadFail...
public class STAXXMLReader { /** * Reads data from specified { @ code reader } , and delegates translated SAX Events * to { @ code handler } . * < b > Note : < / b > The { @ code reader } is not closed by this method . * @ param reader reader to reads data from * @ param handler the SAXHandler which receives SA...
"unchecked" } ) public static void fire ( XMLStreamReader reader , SAXDelegate handler ) throws SAXException { Attributes attrs = new STAXAttributes ( reader ) ; int eventType = reader . getEventType ( ) ; while ( true ) { switch ( eventType ) { case START_DOCUMENT : handler . setDocumentLocator ( new STAXLocator ( rea...
public class GeneratorSet { /** * Adds a new test case generator for the given system function . */ public void addGenerator ( String functionName , ITestCaseGenerator generator ) { } }
String functionKey = getFunctionKey ( functionName ) ; if ( generators_ . containsKey ( functionKey ) ) { throw new IllegalArgumentException ( "Generator already defined for function=" + functionName ) ; } if ( generator != null ) { generators_ . put ( functionKey , generator ) ; }
public class EnvLoader { /** * Adds a permission to the current environment . * @ param perm the permission to add . * @ return the old attribute value */ public static void addPermission ( Permission perm ) { } }
ClassLoader loader = Thread . currentThread ( ) . getContextClassLoader ( ) ; addPermission ( perm , loader ) ;
public class Media { /** * Create a MediaDeleter to execute delete . * @ param pathAccountSid The SID of the Account that created the resource ( s ) to * delete * @ param pathMessageSid The SID of the Message resource that this Media * resource belongs to * @ param pathSid The unique string that identifies th...
return new MediaDeleter ( pathAccountSid , pathMessageSid , pathSid ) ;
public class BeanBuilder { /** * Parses the bean definition groovy script by first exporting the given { @ link Binding } . */ public void parse ( InputStream script , Binding binding ) { } }
if ( script == null ) throw new IllegalArgumentException ( "No script is provided" ) ; setBinding ( binding ) ; CompilerConfiguration cc = new CompilerConfiguration ( ) ; cc . setScriptBaseClass ( ClosureScript . class . getName ( ) ) ; GroovyShell shell = new GroovyShell ( classLoader , binding , cc ) ; ClosureScript ...
public class IsomorphicGraphCounter { /** * { @ inheritDoc } */ public G max ( ) { } }
int maxCount = - 1 ; G max = null ; for ( Map < G , Integer > m : orderAndSizeToGraphs . values ( ) ) { for ( Map . Entry < G , Integer > e : m . entrySet ( ) ) { if ( e . getValue ( ) > maxCount ) { maxCount = e . getValue ( ) ; max = e . getKey ( ) ; } } } return max ;
public class SheetUpdateRequestResourcesImpl { /** * Gets a list of all Update Requests that have future schedules associated with the specified Sheet . * It mirrors to the following Smartsheet REST API method : GET / sheets / { sheetId } / updaterequests * @ param paging the object containing the pagination parame...
String path = "sheets/" + sheetId + "/updaterequests" ; HashMap < String , Object > parameters = new HashMap < String , Object > ( ) ; if ( paging != null ) { parameters = paging . toHashMap ( ) ; } path += QueryUtil . generateUrl ( null , parameters ) ; return this . listResourcesWithWrapper ( path , UpdateRequest . c...
public class SARLOperationHelper { /** * Replies if the given operator is a reassignment operator . * A reassignment operator changes its left operand . * @ param operator the operator . * @ return { @ code true } if the operator changes its left operand . */ protected boolean isReassignmentOperator ( XBinaryOper...
if ( operator . isReassignFirstArgument ( ) ) { return true ; } final QualifiedName operatorName = this . operatorMapping . getOperator ( QualifiedName . create ( operator . getFeature ( ) . getSimpleName ( ) ) ) ; final QualifiedName compboundOperatorName = this . operatorMapping . getSimpleOperator ( operatorName ) ;...
public class ApplicationCache { /** * Returns the cache of deployments for the given application , creating one if it doesn ' t exist . * @ param applicationId The id of the application for the cache of deployments * @ return The cache of deployments for the given application */ public DeploymentCache deployments (...
DeploymentCache cache = deployments . get ( applicationId ) ; if ( cache == null ) deployments . put ( applicationId , cache = new DeploymentCache ( applicationId ) ) ; return cache ;
public class STFastGroupDir { /** * Stolen ruthlessly from * { @ link File # getName ( ) } */ private static final String getFileName ( String path ) { } }
int index = path . lastIndexOf ( '/' ) ; // stop using File . separatorChar as we are not even remotely close to be using that ANYwhere else - apparently . This makes it fail on Windows systems int prefixLength = prefixLength ( path ) ; if ( index < prefixLength ) return path . substring ( prefixLength ) ; return path ...
public class PersonDirectoryConfiguration { /** * Looks in the base UP _ USER table , doesn ' t find attributes but will ensure a result if it the * user exists in the portal database and is searched for by username , results are cached by the * outer caching DAO . */ @ Bean ( name = "uPortalJdbcUserSource" ) @ Qua...
final String sql = "SELECT USER_NAME FROM UP_USER WHERE {0}" ; final SingleRowJdbcPersonAttributeDao rslt = new SingleRowJdbcPersonAttributeDao ( personDb , sql ) ; rslt . setUsernameAttributeProvider ( getUsernameAttributeProvider ( ) ) ; rslt . setQueryAttributeMapping ( Collections . singletonMap ( USERNAME_ATTRIBUT...
public class ResultViewTablePanel { /** * < / editor - fold > / / GEN - END : initComponents */ private void cmdExportResultActionPerformed ( java . awt . event . ActionEvent evt ) { } }
// GEN - FIRST : event _ buttonSaveResultsActionPerformed JFileChooser fileChooser = new JFileChooser ( System . getProperty ( "user.dir" ) ) ; fileChooser . setDialogTitle ( "Export to..." ) ; int response = fileChooser . showSaveDialog ( this ) ; if ( response == JFileChooser . APPROVE_OPTION ) { File targetFile = fi...
public class RestController { /** * Creates a new workflow instance . * < pre > * Request : POST / workflowInstance { workflowName : " credit . step1 " , workflowVersion : null , arguments : { " arg1 " : { " refNum " : 1 , " date " : " 22.09.2014 " } , " arg2 " : [ true , 1 , " text " ] } , label1 : " one " , label...
MediaType . APPLICATION_JSON_VALUE , MediaType . TEXT_XML_VALUE } ) public ResponseEntity < WorkflowInstanceRestModel > create ( @ RequestBody String body ) { JsonObject root = JsonParserUtil . parseJson ( body ) ; CreateWorkflowInstance request = new CreateWorkflowInstance ( ) ; request . setWorkflowName ( JsonParserU...
public class Match { /** * Finds a name for the variable . * @ param ele element to check * @ return a name */ public String getAName ( BioPAXElement ele ) { } }
String name = null ; if ( ele instanceof Named ) { Named n = ( Named ) ele ; if ( n . getDisplayName ( ) != null && n . getDisplayName ( ) . length ( ) > 0 ) name = n . getDisplayName ( ) ; else if ( n . getStandardName ( ) != null && n . getStandardName ( ) . length ( ) > 0 ) name = n . getStandardName ( ) ; else if (...
public class Engine { /** * Get config value . * @ param key - config key * @ param defaultValue - default value * @ return config value * @ see # getEngine ( ) */ public String getProperty ( String key , String defaultValue ) { } }
String value = getProperty ( key , String . class ) ; return StringUtils . isEmpty ( value ) ? defaultValue : value ;
public class Result { /** * For SQLEXECUTE * For execution of SQL prepared statements . * The parameters are set afterwards as the Result is reused */ public static Result newPreparedExecuteRequest ( Type [ ] types , long statementId ) { } }
Result result = newResult ( ResultConstants . EXECUTE ) ; result . metaData = ResultMetaData . newSimpleResultMetaData ( types ) ; result . statementID = statementId ; result . navigator . add ( ValuePool . emptyObjectArray ) ; return result ;
public class CmsXmlContent { /** * Synchronizes the locale independent fields for the given locale . < p > * @ param cms the cms context * @ param skipPaths the paths to skip * @ param sourceLocale the source locale */ public void synchronizeLocaleIndependentValues ( CmsObject cms , Collection < String > skipPath...
if ( getContentDefinition ( ) . getContentHandler ( ) . hasSynchronizedElements ( ) && ( getLocales ( ) . size ( ) > 1 ) ) { for ( String elementPath : getContentDefinition ( ) . getContentHandler ( ) . getSynchronizations ( ) ) { synchronizeElement ( cms , elementPath , skipPaths , sourceLocale ) ; } }
public class UCaseProps { /** * compare s , which has a length , with t = unfold [ unfoldOffset . . ] , which has a maximum length or is NUL - terminated * must be s . length ( ) > 0 and max > 0 and s . length ( ) < = max */ private final int strcmpMax ( String s , int unfoldOffset , int max ) { } }
int i1 , length , c1 , c2 ; length = s . length ( ) ; max -= length ; /* we require length < = max , so no need to decrement max in the loop */ i1 = 0 ; do { c1 = s . charAt ( i1 ++ ) ; c2 = unfold [ unfoldOffset ++ ] ; if ( c2 == 0 ) { return 1 ; /* reached the end of t but not of s */ } c1 -= c2 ; if ( c1 != 0 ) { re...
public class Task { private void startProcessingRequest ( final T data ) { } }
Logger . v ( "Task[%s] start processing request" , this ) ; if ( mExecutor != null ) { final ProcessingPrioritizable < T > prioritizable = new ProcessingPrioritizable < T > ( this , data ) ; final ProcessingRequest < T > request = new ProcessingRequest < T > ( prioritizable , mPriority . ordinal ( ) , this ) ; mExecuto...
public class NumberUtilities { /** * Given an double string , it checks if it ' s a valid double ( base on apaches NumberUtils . createDouble ) and if * it ' s between the lowerBound and upperBound ( including the lower bound and excluding the upper one ) * @ param doubleStr the integer string to check * @ param ...
return isValidDouble ( doubleStr , lowerBound , upperBound , true , false ) ;
public class DistributedSolidMessage { /** * This method will be started in context of executor , either Shard , Client or Backup node */ @ Override public void processMessage ( ) { } }
if ( overwrite ) storage . setArray ( key , payload ) ; else if ( ! storage . arrayExists ( key ) ) storage . setArray ( key , payload ) ;
public class Mixer { /** * < p > mix . < / p > * @ param sample1 a { @ link ameba . captcha . audio . Sample } object . * @ param volAdj1 a double . * @ param sample2 a { @ link ameba . captcha . audio . Sample } object . * @ param volAdj2 a double . * @ return a { @ link ameba . captcha . audio . Sample } ob...
double [ ] s1_ary = sample1 . getInterleavedSamples ( ) ; double [ ] s2_ary = sample2 . getInterleavedSamples ( ) ; double [ ] mixed = mix ( s1_ary , volAdj1 , s2_ary , volAdj2 ) ; return buildSample ( sample1 . getSampleCount ( ) , mixed ) ;
public class HashMap { /** * Computes key . hashCode ( ) and spreads ( XORs ) higher bits of hash * to lower . Because the table uses power - of - two masking , sets of * hashes that vary only in bits above the current mask will * always collide . ( Among known examples are sets of Float keys * holding consecut...
int h ; return ( key == null ) ? 0 : ( h = key . hashCode ( ) ) ^ ( h >>> 16 ) ;
public class AuroraProtocol { /** * Reinitialize loopAddresses with all hosts : all servers in randomize order with cluster * address . If there is an active connection , connected host are remove from list . * @ param listener current listener * @ param loopAddresses the list to reinitialize */ private static vo...
// if all servers have been connected without result // add back all servers List < HostAddress > servers = new ArrayList < > ( ) ; servers . addAll ( listener . getUrlParser ( ) . getHostAddresses ( ) ) ; Collections . shuffle ( servers ) ; // if cluster host is set , add it to the end of the list if ( listener . getC...
public class MessageStoreImpl { /** * lohith liberty change , these are currently dummy as MessageStore is not used as a component by Admin */ @ Override public final void initialize ( JsRecoveryMessagingEngine recoveryME , String mode ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "initialize" , new Object [ ] { recoveryME , mode } ) ; this . _messagingEngine = recoveryME ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "initialize" , "Assi...
public class Span { /** * Adjusts the start and end Position of the Span , if they are * larger than the offset . */ public Span adjust ( int offset , int n ) { } }
if ( offset < 0 ) return this ; // null if ( offset < end ) { end += n ; if ( end < offset ) end = offset ; } else return this ; // null if ( offset < start ) { start += n ; if ( start < offset ) start = offset ; } return this ;
public class MapboxOfflineRouter { /** * Uses libvalhalla and local tile data to generate mapbox - directions - api - like JSON . * @ param route the { @ link OfflineRoute } to get a { @ link DirectionsRoute } from * @ param callback a callback to pass back the result */ public void findRoute ( @ NonNull OfflineRou...
offlineNavigator . retrieveRouteFor ( route , callback ) ;
public class UpdateAccountAuditConfigurationRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateAccountAuditConfigurationRequest updateAccountAuditConfigurationRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateAccountAuditConfigurationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateAccountAuditConfigurationRequest . getRoleArn ( ) , ROLEARN_BINDING ) ; protocolMarshaller . marshall ( updateAccountAuditConfigurationReque...
public class IsotopeHandler { /** * { @ inheritDoc } */ @ Override public void startElement ( String uri , String local , String raw , Attributes atts ) { } }
currentChars = "" ; dictRef = "" ; logger . debug ( "startElement: " , raw ) ; logger . debug ( "uri: " , uri ) ; logger . debug ( "local: " , local ) ; logger . debug ( "raw: " , raw ) ; if ( "isotope" . equals ( local ) ) { workingIsotope = createIsotopeOfElement ( currentElement , atts ) ; } else if ( "isotopeList" ...
public class CollectUtils { /** * 将一个集合按照固定大小查分成若干个集合 。 * @ param list a { @ link java . util . List } object . * @ param count a int . * @ param < T > a T object . * @ return a { @ link java . util . List } object . */ public static < T > List < List < T > > split ( final List < T > list , final int count ) { ...
List < List < T > > subIdLists = CollectUtils . newArrayList ( ) ; if ( list . size ( ) < count ) { subIdLists . add ( list ) ; } else { int i = 0 ; while ( i < list . size ( ) ) { int end = i + count ; if ( end > list . size ( ) ) { end = list . size ( ) ; } subIdLists . add ( list . subList ( i , end ) ) ; i += count...
public class AbstractDetachableListServiceModel { /** * { @ inheritDoc } */ @ Override protected List < E > load ( ) { } }
context = BundleReference . class . cast ( serviceType . getClassLoader ( ) ) . getBundle ( ) . getBundleContext ( ) ; List < E > returnValues = new ArrayList < E > ( ) ; Collection < ServiceReference < T > > refs = Collections . EMPTY_LIST ; try { refs = context . getServiceReferences ( serviceType , filter ) ; } catc...
public class AntClassLoader { /** * Get the certificates for a given jar entry , if it is indeed a jar . * @ param container the File from which to read the entry * @ param entry the entry of which the certificates are requested * @ return the entry ' s certificates or null is the container is * not a jar or it...
if ( container . isDirectory ( ) ) { return null ; } JarFile jarFile = ( JarFile ) jarFiles . get ( container ) ; if ( jarFile == null ) { return null ; } JarEntry ent = jarFile . getJarEntry ( entry ) ; return ent == null ? null : ent . getCertificates ( ) ;
public class web { /** * Queries the given URL with a list of params via POST * @ param url the url to query * @ param params list of pair - values * @ return the result JSON */ public static JSONObject getJSONFromUrlViaPOST ( String url , List < NameValuePair > params ) { } }
InputStream is = null ; JSONObject jObj = null ; String json = "" ; // Making HTTP request try { // defaultHttpClient DefaultHttpClient httpClient = new DefaultHttpClient ( ) ; HttpPost httpPost = new HttpPost ( url ) ; httpPost . setEntity ( new UrlEncodedFormEntity ( params ) ) ; HttpResponse httpResponse = httpClien...
public class CmsMessageBundleEditor { /** * Unlock all edited resources . */ private void cleanUpAction ( ) { } }
try { m_model . deleteDescriptorIfNecessary ( ) ; } catch ( CmsException e ) { LOG . error ( m_messages . key ( Messages . ERR_DELETING_DESCRIPTOR_0 ) , e ) ; } // unlock resource m_model . unlock ( ) ;
public class CmsJspTagContentLoad { /** * Initializes this content load tag . < p > * @ param container the parent container ( could be a preloader ) * @ throws JspException in case something goes wrong */ protected void init ( I_CmsXmlContentContainer container ) throws JspException { } }
// check if the tag contains a pageSize , pageIndex and pageNavLength attribute , or none of them int pageAttribCount = 0 ; pageAttribCount += CmsStringUtil . isNotEmpty ( m_pageSize ) ? 1 : 0 ; pageAttribCount += CmsStringUtil . isNotEmpty ( m_pageIndex ) ? 1 : 0 ; if ( ( pageAttribCount > 0 ) && ( pageAttribCount < 2...
public class VictimsSQL { /** * Give a query and list of objects to set , a prepared statement is created , * cached and returned with the objects set in the order they are provided . * @ param query * @ param objects * @ return * @ throws SQLException */ protected PreparedStatement setObjects ( Connection co...
PreparedStatement ps = statement ( connection , query ) ; setObjects ( ps , objects ) ; return ps ;
public class TcpChannelHub { /** * the transaction id are generated as unique timestamps * @ param timeMs in milliseconds * @ return a unique transactionId */ public long nextUniqueTransaction ( long timeMs ) { } }
long id = timeMs ; for ( ; ; ) { long old = transactionID . get ( ) ; if ( old >= id ) id = old + 1 ; if ( transactionID . compareAndSet ( old , id ) ) break ; } return id ;
public class MCAAuthorizationManager { /** * Unregisters authentication listener * @ param realm the realm the listener was registered for */ public void unregisterAuthenticationListener ( String realm ) { } }
if ( realm != null && ! realm . isEmpty ( ) ) { challengeHandlers . remove ( realm ) ; }
public class Log { /** * Androlog Init Method . This method loads the Androlog Configuration from : * < ol > * < li > < code > / SDCARD / fileName < / code > if the file name if not * < code > null < / code > < / li > * < li > < code > / SDCARD / Application _ Package . properties < / code > if the file name ...
reset ( ) ; Log . context = context ; String file = fileName != null && ! fileName . endsWith ( ".properties" ) ? fileName + ".properties" : fileName ; if ( file == null && context != null ) { file = context . getPackageName ( ) + ".properties" ; } // Check from SDCard InputStream fileIs = LogHelper . getConfigurationF...
public class WRadioButtonSelectExample { /** * Examples of readonly states . When in a read only state only the selected option is output . Since a * WRadioButtonSeelct can only have 0 or 1 selected option the LAYOUT and FRAME are ignored . */ private void addReadOnlyExamples ( ) { } }
add ( new WHeading ( HeadingLevel . H3 , "Read-only WRadioButtonSelect examples" ) ) ; add ( new ExplanatoryText ( "These examples all use the same list of options: the states and territories list from the editable examples above. " + "When the readOnly state is specified only that option which is selected is output.\n...
public class UtilFolder { /** * Construct a usable path using a list of string , automatically separated by the portable separator . * @ param separator The separator to use ( must not be < code > null < / code > ) . * @ param path The list of directories , if has , and file ( must not be < code > null < / code > )...
Check . notNull ( separator ) ; Check . notNull ( path ) ; final StringBuilder fullPath = new StringBuilder ( path . length ) ; for ( int i = 0 ; i < path . length ; i ++ ) { if ( i == path . length - 1 ) { fullPath . append ( path [ i ] ) ; } else if ( path [ i ] != null && path [ i ] . length ( ) > 0 ) { fullPath . a...
public class RDBMSEntityReader { /** * ( non - Javadoc ) * @ see * com . impetus . kundera . persistence . EntityReader # findById ( java . lang . Object , * com . impetus . kundera . metadata . model . EntityMetadata , java . util . List , * com . impetus . kundera . client . Client ) */ @ Override public Enha...
List < String > relationNames = m . getRelationNames ( ) ; if ( relationNames != null && ! relationNames . isEmpty ( ) ) { Set < String > keys = new HashSet < String > ( 1 ) ; keys . add ( primaryKey . toString ( ) ) ; String query = getSqlQueryFromJPA ( m , relationNames , keys ) ; List < EnhanceEntity > results = pop...
public class PyValidator { /** * Check that import mapping are known . * @ param importDeclaration the declaration . */ @ Check public void checkImportsMapping ( XImportDeclaration importDeclaration ) { } }
final JvmDeclaredType type = importDeclaration . getImportedType ( ) ; doTypeMappingCheck ( importDeclaration , type , this . typeErrorHandler1 ) ;
public class M { /** * Returns an < code > IfNotExists < / code > object which represents an < a href = * " http : / / docs . aws . amazon . com / amazondynamodb / latest / developerguide / Expressions . Modifying . html " * > if _ not _ exists ( path , operand ) < / a > function call where path refers to that * ...
return new IfNotExistsFunction < M > ( this , new LiteralOperand ( defaultValue ) ) ;
public class PublisherFlexible { /** * Gets the publisher of the specified type , if it is wrapped by the " Flexible Publish " publisher in a project . * Null is returned if no such publisher is found . * @ param project The project * @ param type The type of the publisher */ public T find ( AbstractProject < ? ,...
// First check that the Flexible Publish plugin is installed : if ( Jenkins . getInstance ( ) . getPlugin ( FLEXIBLE_PUBLISH_PLUGIN ) != null ) { // Iterate all the project ' s publishers and find the flexible publisher : for ( Publisher publisher : project . getPublishersList ( ) ) { // Found the flexible publisher : ...
public class Circle { /** * Set the CircleStrokeColor property * The stroke color of the circle . * To update the circle on the map use { @ link CircleManager # update ( Annotation ) } . * @ param color value for String */ public void setCircleStrokeColor ( @ ColorInt int color ) { } }
jsonObject . addProperty ( CircleOptions . PROPERTY_CIRCLE_STROKE_COLOR , ColorUtils . colorToRgbaString ( color ) ) ;
public class Requests { /** * Create a new { @ link PublishNotify } instance that is used to publish * metadata to an { @ link Identifier } . * @ param i1 the { @ link Identifier } to which the given metadata is published to * @ param md the metadata that shall be published * @ return the new { @ link PublishNo...
return createPublishNotify ( i1 , null , md ) ;
public class DataWriterBuilder { /** * Tell the writer how many branches are being used . * @ param branches is the number of branches * @ return this { @ link DataWriterBuilder } instance */ public DataWriterBuilder < S , D > withBranches ( int branches ) { } }
this . branches = branches ; log . debug ( "With branches: {}" , this . branches ) ; return this ;
public class Source { /** * Sets the source buffer . Equivalent to unqueueing all buffers , then queuing the provided * buffer . Cannot be called when the source is playing or paused . * @ param buffer the buffer to set , or < code > null < / code > to clear . */ public void setBuffer ( Buffer buffer ) { } }
_queue . clear ( ) ; if ( buffer != null ) { _queue . add ( buffer ) ; } AL10 . alSourcei ( _id , AL10 . AL_BUFFER , buffer == null ? AL10 . AL_NONE : buffer . getId ( ) ) ;
public class Inflector { /** * Turns a non - negative number into an ordinal string used to denote the position in an ordered sequence , such as 1st , 2nd , * 3rd , 4th . * @ param number the non - negative number * @ return the string with the number and ordinal suffix */ public String ordinalize ( int number ) ...
String numberStr = Integer . toString ( number ) ; if ( 11 <= number && number <= 13 ) return numberStr + "th" ; int remainder = number % 10 ; if ( remainder == 1 ) return numberStr + "st" ; if ( remainder == 2 ) return numberStr + "nd" ; if ( remainder == 3 ) return numberStr + "rd" ; return numberStr + "th" ;
public class GeoCodeMongo { /** * { @ inheritDoc } */ @ Override public GeoDocument addDocument ( final GeoDocument document ) { } }
if ( document == null || document . getName ( ) == null ) { return document ; } geoDocumentRepository . save ( ( GeoDocumentMongo ) document ) ; return document ;
public class TransactionHandler { /** * Used by stack for relaying received MGCP response messages to the application . * @ param message * receive MGCP response message . */ public void receiveResponse ( byte [ ] data , SplitDetails [ ] msg , Integer txID , ReturnCode returnCode ) { } }
cancelReTransmissionTimer ( ) ; cancelLongtranTimer ( ) ; JainMgcpResponseEvent event = null ; try { event = decodeResponse ( data , msg , txID , returnCode ) ; } catch ( Exception e ) { logger . error ( "Could not decode message: " , e ) ; } event . setTransactionHandle ( remoteTID ) ; if ( this . isProvisional ( even...
public class AnalyticFormulas { /** * Re - implementation of the Excel PRICE function ( a rather primitive bond price formula ) . * The re - implementation is not exact , because this function does not consider daycount conventions . * We assume we have ( int ) timeToMaturity / frequency future periods and the runn...
double price = 0.0 ; if ( timeToMaturity > 0 ) { price += redemption ; } double paymentTime = timeToMaturity ; while ( paymentTime > 0 ) { price += coupon ; // Discount back price = price / ( 1.0 + yield / frequency ) ; paymentTime -= 1.0 / frequency ; } // Accrue running period double accrualPeriod = 0.0 - paymentTime...
public class SeriesCalculator { /** * Returns the factor of the term with specified index . * @ param index the index ( starting with 0) * @ return the factor of the specified term */ protected BigRational getFactor ( int index ) { } }
while ( factors . size ( ) <= index ) { BigRational factor = getCurrentFactor ( ) ; factors . add ( factor ) ; calculateNextFactor ( ) ; } return factors . get ( index ) ;
public class ResourcesInner { /** * Creates a resource . * @ param resourceGroupName The name of the resource group for the resource . The name is case insensitive . * @ param resourceProviderNamespace The namespace of the resource provider . * @ param parentResourcePath The parent resource identity . * @ param...
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( resourceProviderNamespace == null ) { throw new IllegalArgumentException ( "Parameter resourceProviderNamespace is required and cannot be null." ) ; } if ( parentResourcePath ...
public class ResourceadapterImpl { /** * Returns all < code > security - permission < / code > elements * @ return list of < code > security - permission < / code > */ public List < SecurityPermission < Resourceadapter < T > > > getAllSecurityPermission ( ) { } }
List < SecurityPermission < Resourceadapter < T > > > list = new ArrayList < SecurityPermission < Resourceadapter < T > > > ( ) ; List < Node > nodeList = childNode . get ( "security-permission" ) ; for ( Node node : nodeList ) { SecurityPermission < Resourceadapter < T > > type = new SecurityPermissionImpl < Resourcea...
public class JobHistoryFileParserBase { /** * fetches the submit time from a raw job history byte representation * @ param jobHistoryRaw from which to pull the SUBMIT _ TIME * @ return the job submit time in milliseconds since January 1 , 1970 UTC ; * or 0 if no value can be found . */ public static long getSubmi...
long submitTimeMillis = 0 ; if ( null == jobHistoryRaw ) { return submitTimeMillis ; } HadoopVersion hv = JobHistoryFileParserFactory . getVersion ( jobHistoryRaw ) ; switch ( hv ) { case TWO : // look for the job submitted event , since that has the job submit time int startIndex = ByteUtil . indexOf ( jobHistoryRaw ,...