signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Row { /** * View row as a simple map . */ public Map < String , Object > asMap ( ) { } }
Map < String , Object > map = new HashMap < > ( ) ; Set < String > keys = columnNameToIdxMap . keySet ( ) ; Iterator < String > iterator = keys . iterator ( ) ; while ( iterator . hasNext ( ) ) { String colum = iterator . next ( ) . toString ( ) ; int index = columnNameToIdxMap . get ( colum ) ; map . put ( colum , val...
public class ScreenSizeExtensions { /** * Toggle full screen . * @ param frame * the frame */ public static void toggleFullScreen ( @ NonNull JFrame frame ) { } }
GraphicsDevice device = frame . getGraphicsConfiguration ( ) . getDevice ( ) ; frame . setExtendedState ( JFrame . MAXIMIZED_BOTH ) ; if ( frame . equals ( device . getFullScreenWindow ( ) ) ) { device . setFullScreenWindow ( null ) ; } else { frame . setVisible ( true ) ; device . setFullScreenWindow ( frame ) ; }
public class nsip6 { /** * Use this API to unset the properties of nsip6 resource . * Properties that need to be unset are specified in args array . */ public static base_response unset ( nitro_service client , nsip6 resource , String [ ] args ) throws Exception { } }
nsip6 unsetresource = new nsip6 ( ) ; unsetresource . ipv6address = resource . ipv6address ; unsetresource . td = resource . td ; return unsetresource . unset_resource ( client , args ) ;
public class Condition { /** * < p > Sample : < code > $ ( " h1 " ) . shouldHave ( exactText ( " Hello " ) ) < / code > < / p > * < p > Case insensitive < / p > * < p > NB ! Ignores multiple whitespaces between words < / p > * @ param text expected text of HTML element */ public static Condition exactText ( final...
return new Condition ( "exact text" ) { @ Override public boolean apply ( Driver driver , WebElement element ) { return Html . text . equals ( element . getText ( ) , text ) ; } @ Override public String toString ( ) { return name + " '" + text + '\'' ; } } ;
public class ApiOvhIpLoadbalancing { /** * Delete this description of a private network in the vRack . It must not be used by any farm server * REST : DELETE / ipLoadbalancing / { serviceName } / vrack / network / { vrackNetworkId } * @ param serviceName [ required ] The internal name of your IP load balancing * ...
String qPath = "/ipLoadbalancing/{serviceName}/vrack/network/{vrackNetworkId}" ; StringBuilder sb = path ( qPath , serviceName , vrackNetworkId ) ; exec ( qPath , "DELETE" , sb . toString ( ) , null ) ;
public class Main { /** * Main program of the batch compiler . * @ param args the command line arguments . */ public static void main ( String [ ] args ) { } }
final int retCode = createMainObject ( ) . runCompiler ( args ) ; System . exit ( retCode ) ;
public class ExecuteMethodValidatorChecker { protected void doCheckGenericBeanValidationMismatch ( Field field ) { } }
// # hope cannot check now : public List < ROOM > roomList ; final Class < ? > genericType = getFieldGenericType ( field ) ; // only first generic # for _ now if ( genericType == null ) { return ; } if ( mayBeNestedBeanType ( genericType ) ) { // e . g . LandBean < PiariBean > pathDeque . push ( "@generic" ) ; doCheckN...
public class ContainerMetadataUpdateTransaction { /** * Pre - processes the given Operation . See OperationMetadataUpdater . preProcessOperation for more details on behavior . * @ param operation The operation to pre - process . * @ throws ContainerException If the given operation was rejected given the current sta...
checkNotSealed ( ) ; if ( operation instanceof SegmentOperation ) { val segmentMetadata = getSegmentUpdateTransaction ( ( ( SegmentOperation ) operation ) . getStreamSegmentId ( ) ) ; if ( segmentMetadata . isDeleted ( ) ) { throw new StreamSegmentNotExistsException ( segmentMetadata . getName ( ) ) ; } if ( operation ...
public class Task { /** * Invokes the callable using the given executor , returning a Task to represent the operation . */ public static < TResult > Task < TResult > call ( final Callable < TResult > callable , Executor executor , final CancellationToken ct ) { } }
final bolts . TaskCompletionSource < TResult > tcs = new bolts . TaskCompletionSource < > ( ) ; try { executor . execute ( new Runnable ( ) { @ Override public void run ( ) { if ( ct != null && ct . isCancellationRequested ( ) ) { tcs . setCancelled ( ) ; return ; } try { tcs . setResult ( callable . call ( ) ) ; } cat...
public class UTF8Checker { /** * Check if the given ByteBuffer contains non UTF - 8 data . * @ param buf the ByteBuffer to check * @ param position the index in the { @ link ByteBuffer } to start from * @ param length the number of bytes to operate on * @ throws UnsupportedEncodingException is thrown if non UTF...
int limit = position + length ; for ( int i = position ; i < limit ; i ++ ) { checkUTF8 ( buf . get ( i ) ) ; }
public class CATBrowseConsumer { /** * Sends a message to the client in chunks . This is easier on the Java memory manager as it means * it can avoid allocating very large chunks of memory in one contiguous block . This may result * in multiple JFap sends for each message chunk . * @ param sibMessage * @ return...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "sendChunkedMessage" , sibMessage ) ; long retValue = 0 ; // First of all we must encode the message ourselves CommsServerByteBuffer buffer = poolManager . allocate ( ) ; ConversationState convState = ( ConversationSt...
public class Compound { /** * deprecated methods starting here . */ @ Deprecated public void connect ( Object from , String from_out , Object to , String to_in ) { } }
controller . connect ( from , from_out , to , to_in ) ;
public class DiagnosticsInner { /** * Get site detector response . * Get site detector response . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param siteName Site Name * @ param detectorName Detector Resource Name * @ param slot Slot Name * @ param startTime Sta...
return ServiceFuture . fromResponse ( getSiteDetectorResponseSlotWithServiceResponseAsync ( resourceGroupName , siteName , detectorName , slot , startTime , endTime , timeGrain ) , serviceCallback ) ;
public class DateUtil { /** * Converts the specified < code > calendar < / code > with the specified { @ code format } to a new instance of XMLGregorianCalendar . * < code > null < / code > is returned if the specified < code > date < / code > is null or empty . * @ param calendar * @ param format * @ param tim...
if ( N . isNullOrEmpty ( calendar ) || ( calendar . length ( ) == 4 && "null" . equalsIgnoreCase ( calendar ) ) ) { return null ; } return createXMLGregorianCalendar ( parse ( calendar , format , timeZone ) ) ;
public class PPORGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . PPORG__RG_LENGTH : setRGLength ( RG_LENGTH_EDEFAULT ) ; return ; case AfplibPackage . PPORG__OBJ_TYPE : setObjType ( OBJ_TYPE_EDEFAULT ) ; return ; case AfplibPackage . PPORG__PROC_FLGS : setProcFlgs ( PROC_FLGS_EDEFAULT ) ; return ; case AfplibPackage . PPORG__XOCA_OSET : se...
public class Viewport { /** * If the specified viewport intersects this viewport , return true and set this viewport to that intersection , * otherwise return false and do not change this viewport . No check is performed to see if either viewport is empty . * To just test for intersection , use intersects ( ) * @...
return intersect ( v . left , v . top , v . right , v . bottom ) ;
public class BaseMessageEndpointFactory { /** * d450478 - added entire method */ @ Override public void applicationStarted ( String appName ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "MEF.applicationStarted for application " + appName ) ; } // Change state to the active state and notify all threads // that were blocked while we were activating this endpoint . synchronized ( ivStateLock ) { ivState = ACTIV...
public class HpsmCollectorTask { /** * Takes configurationItemNameList ( list of all APP / component names ) and List < Cmdb > from client and sets flag to false for old items in mongo * @ param configurationItemNameList * @ return return count of items invalidated */ private int cleanUpOldCmdbItems ( List < String...
int inValidCount = 0 ; for ( Cmdb cmdb : cmdbRepository . findAllByValidConfigItem ( true ) ) { String configItem = cmdb . getConfigurationItem ( ) ; if ( configurationItemNameList != null && ! configurationItemNameList . contains ( configItem ) ) { cmdb . setValidConfigItem ( false ) ; cmdbRepository . save ( cmdb ) ;...
public class EmulatedFields { /** * Finds and returns the int value of a given field named { @ code name } in the * receiver . If the field has not been assigned any value yet , the default * value { @ code defaultValue } is returned instead . * @ param name * the name of the field to find . * @ param default...
ObjectSlot slot = findMandatorySlot ( name , int . class ) ; return slot . defaulted ? defaultValue : ( ( Integer ) slot . fieldValue ) . intValue ( ) ;
public class L3ToSBGNPDConverter { /** * Gets the map of stoichiometry coefficients of participants . * @ param conv the conversion * @ return map from physical entities to their stoichiometry */ private Map < PhysicalEntity , Stoichiometry > getStoichiometry ( Conversion conv ) { } }
Map < PhysicalEntity , Stoichiometry > map = new HashMap < PhysicalEntity , Stoichiometry > ( ) ; for ( Stoichiometry stoc : conv . getParticipantStoichiometry ( ) ) map . put ( stoc . getPhysicalEntity ( ) , stoc ) ; return map ;
public class ReComputeTimeOffsetHandler { /** * Constructor . * @ param field The basefield owner of this listener ( usually null and set on setOwner ( ) ) . * @ param iTargetFieldSeq The date field sequence in this owner to use to calc the difference . * @ param fldOtherDate The other date field to use in calcul...
m_fldOtherDate = fldOtherDate ; super . init ( field , targetFieldName , null ) ;
public class SelectiveAccessHandler { /** * adds section handling for a specified relative level . . . */ public void addSectionHandling ( int level , EnumMap < SIT , EnumMap < CIT , Boolean > > sh ) { } }
sectionHandling . put ( SectionType . SECTION_LEVEL . toString ( ) + level , sh ) ;
public class BaseAPI { /** * 通用post请求 * @ param url 地址 , 其中token用 # 代替 * @ param json 参数 , json格式 * @ return 请求结果 */ protected BaseResponse executePost ( String url , String json ) { } }
return executePost ( url , json , null ) ;
public class TmsConfigurationService { /** * Transforms a TMS tile - set description object into a Geomajas { @ link ScaleInfo } object . * @ param tileSet * The tile set description . * @ return The default Geomajas scale object . */ public ScaleInfo asScaleInfo ( TileSet tileSet ) { } }
ScaleInfo scaleInfo = new ScaleInfo ( ) ; scaleInfo . setPixelPerUnit ( 1 / tileSet . getUnitsPerPixel ( ) ) ; return scaleInfo ;
public class AbstractCasView { /** * Gets error description from . * @ param model the model * @ return the error description from */ protected String getErrorDescriptionFrom ( final Map < String , Object > model ) { } }
return model . get ( CasViewConstants . MODEL_ATTRIBUTE_NAME_ERROR_DESCRIPTION ) . toString ( ) ;
public class WizardDialog { /** * create a peer for this * dialog , using the given * peer as a parent . * @ param parentPeer * @ return * @ throws java . lang . Exception */ public XWindowPeer createWindowPeer ( XWindowPeer _xWindowParentPeer ) throws com . sun . star . script . BasicErrorException { } }
try { if ( _xWindowParentPeer == null ) { XWindow xWindow = ( XWindow ) UnoRuntime . queryInterface ( XWindow . class , m_xDlgContainer ) ; xWindow . setVisible ( false ) ; Object tk = m_xMCF . createInstanceWithContext ( "com.sun.star.awt.Toolkit" , m_xContext ) ; XToolkit xToolkit = ( XToolkit ) UnoRuntime . queryInt...
public class appflowaction { /** * Use this API to fetch filtered set of appflowaction resources . * filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */ public static appflowaction [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } }
appflowaction obj = new appflowaction ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; appflowaction [ ] response = ( appflowaction [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class OrmDescriptorImpl { /** * If not already created , a new < code > sql - result - set - mapping < / code > element will be created and returned . * Otherwise , the first existing < code > sql - result - set - mapping < / code > element will be returned . * @ return the instance defined for the element <...
List < Node > nodeList = model . get ( "sql-result-set-mapping" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new SqlResultSetMappingImpl < OrmDescriptor > ( this , "sql-result-set-mapping" , model , nodeList . get ( 0 ) ) ; } return createSqlResultSetMapping ( ) ;
public class AbstractSaml20ObjectBuilder { /** * New issuer . * @ param issuerValue the issuer * @ return the issuer */ public Issuer newIssuer ( final String issuerValue ) { } }
val issuer = newSamlObject ( Issuer . class ) ; issuer . setValue ( issuerValue ) ; return issuer ;
public class FlickrCrawler { /** * convert filename to clean filename */ public static String convertToFileSystemChar ( String name ) { } }
String erg = "" ; Matcher m = Pattern . compile ( "[a-z0-9 _#&@\\[\\(\\)\\]\\-\\.]" , Pattern . CASE_INSENSITIVE ) . matcher ( name ) ; while ( m . find ( ) ) { erg += name . substring ( m . start ( ) , m . end ( ) ) ; } if ( erg . length ( ) > 200 ) { erg = erg . substring ( 0 , 200 ) ; System . out . println ( "cut f...
public class MenuDrawer { /** * Sets whether the drawer indicator should be enabled . { @ link # setupUpIndicator ( android . app . Activity ) } must be * called first . * @ param enabled Whether the drawer indicator should enabled . */ public void setDrawerIndicatorEnabled ( boolean enabled ) { } }
if ( mActionBarHelper == null ) { throw new IllegalStateException ( "setupUpIndicator(Activity) has not been called" ) ; } mDrawerIndicatorEnabled = enabled ; if ( enabled ) { mActionBarHelper . setActionBarUpIndicator ( mSlideDrawable , isMenuVisible ( ) ? mDrawerOpenContentDesc : mDrawerClosedContentDesc ) ; } else {...
public class ForRawType { /** * { @ inheritDoc } */ public Generic onTypeVariable ( Generic typeVariable ) { } }
return declaringType . isGenerified ( ) ? new Generic . OfNonGenericType . Latent ( typeVariable . asErasure ( ) , typeVariable ) : typeVariable ;
public class AcceptHash { /** * Concatenate the provided key with the Magic GUID and return the Base64 encoded form . * @ param key the key to hash * @ return the < code > Sec - WebSocket - Accept < / code > header response ( per opening handshake spec ) */ public static String hashKey ( String key ) { } }
try { MessageDigest md = MessageDigest . getInstance ( "SHA1" ) ; md . update ( key . getBytes ( StandardCharsets . UTF_8 ) ) ; md . update ( MAGIC ) ; return new String ( B64Code . encode ( md . digest ( ) ) ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
public class FaxServiceImp { /** * ( non - Javadoc ) * @ see com . popbill . api . FaxService # search ( java . lang . String , java . lang . String , java . lang . String , java . lang . String [ ] , java . lang . Boolean , java . lang . Boolean , int , int , java . lang . String , java . lang . String ) */ @ Overri...
if ( sDate == null ) throw new PopbillException ( - 99999999 , "시작일자가 입력되지 않았습니다." ) ; if ( eDate == null ) throw new PopbillException ( - 99999999 , "종료일자가 입력되지 않았습니다." ) ; String uri = "/FAX/Search?SDate=" + sDate ; uri += "&EDate=" + eDate ; uri += "&State=" + Arrays . toString ( state ) . replaceAll ( "\\[|\\]|\\s"...
public class JCusolverSp { /** * < pre > * - - - - - GPU eigenvalue solver by shift inverse * solve A * x = lambda * x * where lambda is the eigenvalue nearest mu0. * [ eig ] stands for eigenvalue solver * [ si ] stands for shift - inverse * < / pre > */ public static int cusolverSpScsreigvsi ( cusolverSpHa...
return checkResult ( cusolverSpScsreigvsiNative ( handle , m , nnz , descrA , csrValA , csrRowPtrA , csrColIndA , mu0 , x0 , maxite , eps , mu , x ) ) ;
public class IdGeneratorImpl { /** * Generates a number of random bytes . * < p > The chance of collisions of k IDs taken from a population of N possibilities is < code > * 1 - Math . exp ( - 0.5 * k * ( k - 1 ) / N ) < / code > * < p > A couple collision chances for 5 bytes < code > N = 256 ^ 5 < / code > : * ...
byte [ ] randomBytes = new byte [ nBytes ] ; random . nextBytes ( randomBytes ) ; return randomBytes ;
public class ReflectionUtils { /** * Returns true if an annotation for the specified type is found on the * getter method or its corresponding class field . */ static < T extends Annotation > boolean getterOrFieldHasAnnotation ( Method getter , Class < T > annotationClass ) { } }
return getAnnotationFromGetterOrField ( getter , annotationClass ) != null ;
public class BaseBuilder { /** * Adds a builder step for this builder , upon build these steps will be called in the same order they came in on . * @ param methodName cannot be < code > null < / code > or empty . * @ param args may be < code > null < / code > or empty . * @ param argTypes argument class types can...
if ( StringUtils . isBlank ( methodName ) ) { throw new IllegalArgumentException ( "methodName cannot be null or empty." ) ; } steps . add ( new Step ( methodName , args , argTypes , builderMethod ) ) ;
public class ZipUtils { /** * Unzips a zip from an input stream into an output folder . * @ param inputStream the zip input stream * @ param outputFolder the output folder where the files * @ throws IOException */ public static void unZipFiles ( InputStream inputStream , File outputFolder ) throws IOException { }...
ZipInputStream zis = new ZipInputStream ( inputStream ) ; ZipEntry ze = zis . getNextEntry ( ) ; while ( ze != null ) { File file = new File ( outputFolder , ze . getName ( ) ) ; OutputStream os = new BufferedOutputStream ( FileUtils . openOutputStream ( file ) ) ; try { IOUtils . copy ( zis , os ) ; } finally { IOUtil...
public class reportIssue { /** * This runs in UI when background thread finishes */ @ Override protected void onPostExecute ( String result ) { } }
super . onPostExecute ( result ) ; if ( result . equals ( "ok" ) ) { progress . dismiss ( ) ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . LOLLIPOP ) { mActivity . showDoneAnimation ( ) ; } else { ( ( Activity ) mContext ) . finish ( ) ; } } else if ( result . equals ( "org.eclipse.egit.github.core.client....
public class ConnectionSourceSkeleton { /** * Learn relevant information about this connection source . */ public void discoverConnnectionProperties ( ) { } }
Connection connection = null ; try { connection = getConnection ( ) ; if ( connection == null ) { getLogger ( ) . warn ( "Could not get a conneciton" ) ; return ; } DatabaseMetaData meta = connection . getMetaData ( ) ; Util util = new Util ( ) ; util . setLoggerRepository ( repository ) ; if ( overriddenSupportsGetGen...
public class ChannelFrameworkImpl { /** * @ see * com . ibm . wsspi . channelfw . ChannelFramework # deregisterFactory ( java . lang . String */ @ Override public void deregisterFactory ( String name ) { } }
final boolean bTrace = TraceComponent . isAnyTracingEnabled ( ) ; if ( bTrace && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Removing factory registration: " + name ) ; } Class < ? > factory = null ; synchronized ( this . factories ) { factory = this . factories . remove ( name ) ; } if ( null != factory ) { final S...
public class DatabaseAccountsInner { /** * Online the specified region for the specified Azure Cosmos DB database account . * @ param resourceGroupName Name of an Azure resource group . * @ param accountName Cosmos DB database account name . * @ param region Cosmos DB region , with spaces between words and each w...
return onlineRegionWithServiceResponseAsync ( resourceGroupName , accountName , region ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class SimulatorTaskTracker { /** * Stops running a task attempt on the task tracker . It also updates the * number of available slots accordingly . * @ param finalStatus the TaskStatus containing the task id and final * status of the task attempt . This rountine asserts a lot of the * finalStatus params ...
TaskAttemptID taskId = finalStatus . getTaskID ( ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Finishing running task id=" + taskId + ", now=" + now ) ; } SimulatorTaskInProgress tip = tasks . get ( taskId ) ; if ( tip == null ) { throw new IllegalArgumentException ( "Unknown task attempt " + taskId + " complete...
public class QueueContainer { /** * Rolls back the effects of the { @ link # txnPollReserve ( long , String ) } . * The { @ code backup } parameter defines whether this item was stored * on a backup queue or a primary queue . * It will return the item to the queue or backup map if it wasn ' t * offered as a par...
TxQueueItem item = txMap . remove ( itemId ) ; if ( item == null ) { return false ; } if ( backup ) { getBackupMap ( ) . put ( itemId , item ) ; } else { addTxItemOrdered ( item ) ; } cancelEvictionIfExists ( ) ; return true ;
public class ThymeleafHtmlRenderer { @ Override public void render ( RequestManager requestManager , ActionRuntime runtime , NextJourney journey ) throws IOException , ServletException { } }
if ( isThymeleafJourney ( journey ) ) { showRendering ( journey ) ; final WebContext context = createTemplateContext ( requestManager ) ; exportErrorsToContext ( requestManager , context , runtime ) ; exportFormPropertyToContext ( requestManager , context , runtime ) ; final String html = createResponseBody ( templateE...
public class FilterDriver { /** * This method is to determine automatically join the Simple and Big . * @ param masterLabels label of master data * @ param masterColumn master column * @ param dataColumn data column * @ param masterSeparator separator * @ param regex master join is regex * @ param masterDat...
setSimpleJoin ( masterLabels , masterColumn , dataColumn , masterSeparator , regex , masterData ) ;
public class WithMavenStepExecution2 { /** * Sets the maven repo location according to the provided parameter on the agent * @ return path on the build agent to the repo or { @ code null } if not defined * @ throws InterruptedException when processing remote calls * @ throws IOException when reading files */ @ Nu...
String expandedMavenLocalRepo ; if ( StringUtils . isEmpty ( step . getMavenLocalRepo ( ) ) ) { expandedMavenLocalRepo = null ; } else { // resolve relative / absolute with workspace as base String expandedPath = envOverride . expand ( env . expand ( step . getMavenLocalRepo ( ) ) ) ; if ( FileUtils . isAbsolutePath ( ...
public class Main { /** * Prepare the command for execution from a bash script . The final command will have commands to * set up any needed environment variables needed by the child process . */ private static List < String > prepareBashCommand ( List < String > cmd , Map < String , String > childEnv ) { } }
if ( childEnv . isEmpty ( ) ) { return cmd ; } List < String > newCmd = new ArrayList < > ( ) ; newCmd . add ( "env" ) ; for ( Map . Entry < String , String > e : childEnv . entrySet ( ) ) { newCmd . add ( String . format ( "%s=%s" , e . getKey ( ) , e . getValue ( ) ) ) ; } newCmd . addAll ( cmd ) ; return newCmd ;
public class RBACRegistry { /** * If some combination of { @ link ObjectName } and MBean ' s class name is detected as < em > special < / em > , we may * cache the JSONified { @ link MBeanInfo } as well * @ param nameObject * @ param mBeanInfo * @ return */ private String isSpecialClass ( ObjectName nameObject ...
String domain = nameObject . getDomain ( ) ; if ( "org.apache.camel" . equals ( domain ) && mBeanInfo . getClassName ( ) != null ) { // some real data in env with 12 Camel contexts deployed // - components ( total : 102) // - consumers ( total : 511) // - context ( total : 12) // - endpoints ( total : 818) // - errorha...
public class CmsClientStringUtil { /** * Generates a purely random uuid . < p > * @ return the generated uuid */ public static String randomUUID ( ) { } }
String base = CmsUUID . getNullUUID ( ) . toString ( ) ; String hexDigits = "0123456789abcdef" ; StringBuffer result = new StringBuffer ( ) ; for ( int i = 0 ; i < base . length ( ) ; i ++ ) { char ch = base . charAt ( i ) ; if ( ch == '-' ) { result . append ( ch ) ; } else if ( ch == '0' ) { result . append ( hexDigi...
public class DataModel { /** * < p > Return the set of { @ link DataModelListener } s interested in * notifications from this { @ link DataModel } . If there are no such * listeners , an empty array is returned . < / p > */ public DataModelListener [ ] getDataModelListeners ( ) { } }
if ( listeners == null ) { return EMPTY_DATA_MODEL_LISTENER ; } else { return listeners . toArray ( new DataModelListener [ listeners . size ( ) ] ) ; }
public class IOUtils { /** * Calculates GCG checksum for entire list of sequences * @ param sequences list of sequences * @ return GCG checksum */ public static < S extends Sequence < C > , C extends Compound > int getGCGChecksum ( List < S > sequences ) { } }
int check = 0 ; for ( S as : sequences ) { check += getGCGChecksum ( as ) ; } return check % 10000 ;
public class LangAlt { /** * Process a property . */ protected void process ( StringBuffer buf , Object lang ) { } }
buf . append ( "<rdf:li xml:lang=\"" ) ; buf . append ( lang ) ; buf . append ( "\" >" ) ; buf . append ( get ( lang ) ) ; buf . append ( "</rdf:li>" ) ;
public class WaitersGeneratorTasks { /** * Constructs the data model and submits tasks for every generating Acceptor for each waiter definition in the intermediate * model */ private List < GeneratorTask > createWaiterAcceptorClassTasks ( ) throws IOException { } }
List < GeneratorTask > generatorTasks = new ArrayList < > ( ) ; for ( Map . Entry < String , WaiterDefinitionModel > entry : model . getWaiters ( ) . entrySet ( ) ) { if ( containsAllStatusMatchers ( entry ) ) { continue ; } final String waiterName = entry . getKey ( ) ; final WaiterDefinitionModel waiterModel = entry ...
public class Tuple16 { /** * Skip 6 degrees from this tuple . */ public final Tuple10 < T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 > skip6 ( ) { } }
return new Tuple10 < > ( v7 , v8 , v9 , v10 , v11 , v12 , v13 , v14 , v15 , v16 ) ;
public class VersionListener { /** * Get whatever is on the stack and make a version range out of it * @ see net . ossindex . version . parser . VersionBaseListener # exitRange ( net . ossindex . version . parser . VersionParser . RangeContext ) */ @ Override public void exitRange ( VersionParser . RangeContext ctx )...
Object o = stack . pop ( ) ; if ( o instanceof IVersion ) { // range = new SemanticVersionRange ( ( SemanticVersion ) o ) ; range = new VersionSet ( ( IVersion ) o ) ; } else if ( o instanceof IVersionRange ) { range = ( IVersionRange ) o ; }
public class DateIntervalFormat { /** * Concat a single date pattern with a time interval pattern , * set it into the intervalPatterns , while field is time field . * This is used to handle time interval patterns on skeleton with * both time and date . Present the date followed by * the range expression for the...
PatternInfo timeItvPtnInfo = intervalPatterns . get ( DateIntervalInfo . CALENDAR_FIELD_TO_PATTERN_LETTER [ field ] ) ; if ( timeItvPtnInfo != null ) { String timeIntervalPattern = timeItvPtnInfo . getFirstPart ( ) + timeItvPtnInfo . getSecondPart ( ) ; String pattern = SimpleFormatterImpl . formatRawPattern ( dtfmt , ...
public class CinchContext { /** * Create a new SpringFlapMapFunction , which implements Spark ' s FlatMapFunction interface . */ public < T , R > FlatMapFunction < T , R > flatMapFunction ( Class < ? extends FlatMapFunction < T , R > > springBeanClass ) { } }
return new SpringFlatMapFunction < > ( springConfigurationClass , springBeanClass ) ;
public class Introspector { /** * Gets the < code > BeanInfo < / code > object which contains the information of * the properties , events and methods of the specified bean class . * The < code > Introspector < / code > will cache the < code > BeanInfo < / code > * object . Subsequent calls to this method will be...
BeanInfo beanInfo = theCache . get ( beanClass ) ; if ( beanInfo == null ) { beanInfo = new SimpleBeanInfo ( beanClass ) ; theCache . put ( beanClass , beanInfo ) ; } return beanInfo ;
public class AmazonEC2Client { /** * Describes the connection notifications for VPC endpoints and VPC endpoint services . * @ param describeVpcEndpointConnectionNotificationsRequest * @ return Result of the DescribeVpcEndpointConnectionNotifications operation returned by the service . * @ sample AmazonEC2 . Descr...
request = beforeClientExecution ( request ) ; return executeDescribeVpcEndpointConnectionNotifications ( request ) ;
public class WebSocket { /** * Called by the reading thread as its last step . */ void onReadingThreadFinished ( WebSocketFrame closeFrame ) { } }
synchronized ( mThreadsLock ) { mReadingThreadFinished = true ; mServerCloseFrame = closeFrame ; if ( mWritingThreadFinished == false ) { // Wait for the writing thread to finish . return ; } } // Both the reading thread and the writing thread have finished . onThreadsFinished ( ) ;
public class ReflectUtils { /** * 从包中获取所有的类 * @ param packageName 包名 * @ return { @ link List } * @ throws IOException 异常 * @ throws ClassNotFoundException 异常 */ public static List < Class < ? > > getClasses ( String packageName ) throws IOException , ClassNotFoundException { } }
List < Class < ? > > classes = new ArrayList < > ( ) ; String packageDirName = packageName . replace ( '.' , '/' ) ; Enumeration < URL > dirs = Thread . currentThread ( ) . getContextClassLoader ( ) . getResources ( packageDirName ) ; while ( dirs . hasMoreElements ( ) ) { URL url = dirs . nextElement ( ) ; String prot...
public class Request { /** * 添加请求消息体 */ public Request setContent ( String content ) { } }
if ( body == null ) body = new RequestBody ( ) ; this . body . setContent ( content ) ; return this ;
public class Facets { /** * Returns a facet of the given subject if supported , throwing an * exception otherwise . * This does not attempt to cast the subject to the requested type , since * the { @ link Faceted } interface declares the intent to control the * conversion . * @ return not null . * @ throws ...
if ( subject != null ) { T facet = subject . asFacet ( facetType ) ; if ( facet != null ) return facet ; } throw new UnsupportedFacetException ( facetType , subject ) ;
public class QualitygatesService { /** * This is part of the internal API . * This is a POST request . * @ see < a href = " https : / / next . sonarqube . com / sonarqube / web _ api / api / qualitygates / deselect " > Further information about this action online ( including a response example ) < / a > * @ since...
call ( new PostRequest ( path ( "deselect" ) ) . setParam ( "organization" , request . getOrganization ( ) ) . setParam ( "projectId" , request . getProjectId ( ) ) . setParam ( "projectKey" , request . getProjectKey ( ) ) . setMediaType ( MediaTypes . JSON ) ) . content ( ) ;
public class CmsDetailPageDuplicateEliminatingSitemapGenerator { /** * Gets the path map containing the contents for the given type . < p > * @ param typeName the type name * @ return the path map with the content resources * @ throws CmsException if something goes wrong */ private CmsPathMap < CmsResource > getP...
if ( ! m_pathMapsByType . containsKey ( typeName ) ) { CmsPathMap < CmsResource > pathMap = readPathMapForType ( OpenCms . getResourceManager ( ) . getResourceType ( typeName ) ) ; m_pathMapsByType . put ( typeName , pathMap ) ; } return m_pathMapsByType . get ( typeName ) ;
public class EntityType { /** * getIdClass . * @ return a { @ link java . lang . Class } object . */ @ SuppressWarnings ( "unchecked" ) public Class < ? extends Serializable > getIdType ( ) { } }
Type type = propertyTypes . get ( idName ) ; return ( Class < ? extends Serializable > ) ( null != type ? type . getReturnedClass ( ) : null ) ;
public class PlanAssembler { /** * Return true if tableList includes at least one matview . */ private boolean tableListIncludesReadOnlyView ( List < Table > tableList ) { } }
for ( Table table : tableList ) { if ( table . getMaterializer ( ) != null && ! TableType . isStream ( table . getMaterializer ( ) . getTabletype ( ) ) ) { return true ; } } return false ;
public class JulianDate { /** * Creates a { @ code JulianDate } validating the input . * @ param prolepticYear the Julian proleptic - year * @ param month the Julian month - of - year , from 1 to 12 * @ param dayOfMonth the Julian day - of - month , from 1 to 31 * @ return the date in Julian calendar system , n...
JulianChronology . YEAR_RANGE . checkValidValue ( prolepticYear , YEAR ) ; MONTH_OF_YEAR . checkValidValue ( month ) ; DAY_OF_MONTH . checkValidValue ( dayOfMonth ) ; if ( dayOfMonth > 28 ) { int dom = 31 ; switch ( month ) { case 2 : dom = ( JulianChronology . INSTANCE . isLeapYear ( prolepticYear ) ? 29 : 28 ) ; brea...
public class SecWorkContextHandler { /** * This method is called by the WorkProxy class to associate the in - flown * SecurityContext with the work manager thread that will perform the work . * Note that this should support the case of nested work submission . * @ param credService The credentials service * @ p...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "associate" , new Object [ ] { J2CSecurityHelper . objectId ( workCtx ) , providerId } ) ; } // Check if application security is enabled and only in that case // do the security context association . if ( WSSecurityHelper . i...
public class ModMessageManager { /** * Registers a message handler . < br > * If no instance for the message handler is passed , only static methods will be registered to handle messages . * @ param mod the mod * @ param messageHandlerClass the message handler class * @ param messageHandler the message handler ...
Method [ ] methods = messageHandlerClass . getMethods ( ) ; for ( Method method : methods ) { ModMessage ann = method . getAnnotation ( ModMessage . class ) ; if ( ann == null ) continue ; String name = ann . value ( ) . equals ( "" ) ? method . getName ( ) : ann . value ( ) ; boolean isStatic = Modifier . isStatic ( m...
public class BatchDetectDominantLanguageResult { /** * A list of objects containing the results of the operation . The results are sorted in ascending order by the * < code > Index < / code > field and match the order of the documents in the input list . If all of the documents contain * an error , the < code > Res...
if ( this . resultList == null ) { setResultList ( new java . util . ArrayList < BatchDetectDominantLanguageItemResult > ( resultList . length ) ) ; } for ( BatchDetectDominantLanguageItemResult ele : resultList ) { this . resultList . add ( ele ) ; } return this ;
public class FastByteArrayProvider { /** * Returns a byte array of the specified length . * Note that the returned array may have been used before and therefore the array ' s values are not guaranteed to be * < code > 0 < / code > . * The method consecutively checks { @ link # arrays } for an array of the correct...
for ( int i = 0 ; i < size ; ++ i ) { if ( length == arrays [ i ] . length ) { // swap ( if not already at the front ) and return if ( i > 0 ) { tmp = arrays [ i ] ; arrays [ i ] = arrays [ i - 1 ] ; arrays [ i - 1 ] = tmp ; return tmp ; } // no swapping , so element was and still is at the front of the // list return ...
public class dnssrvrec { /** * Use this API to update dnssrvrec resources . */ public static base_responses update ( nitro_service client , dnssrvrec resources [ ] ) throws Exception { } }
base_responses result = null ; if ( resources != null && resources . length > 0 ) { dnssrvrec updateresources [ ] = new dnssrvrec [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { updateresources [ i ] = new dnssrvrec ( ) ; updateresources [ i ] . domain = resources [ i ] . domain ; updateres...
public class PropertyDoc { /** * Trims off the first word of the specified string and capitalizes the * new first word */ private static final String trimFirstWord ( String s ) { } }
s = s . trim ( ) ; char [ ] chars = s . toCharArray ( ) ; int firstSpace = - 1 ; for ( int i = 0 ; i < chars . length ; i ++ ) { char c = chars [ i ] ; if ( Character . isWhitespace ( c ) ) { firstSpace = i ; break ; } } if ( firstSpace == - 1 ) { return s ; } s = s . substring ( firstSpace ) . trim ( ) ; s = capitaliz...
public class FessMessages { /** * Add the created action message for the key ' success . delete _ doc _ from _ index ' with parameters . * < pre > * message : Started a process to delete the document from index . * < / pre > * @ param property The property name for the message . ( NotNull ) * @ return this . ...
assertPropertyNotNull ( property ) ; add ( property , new UserMessage ( SUCCESS_delete_doc_from_index ) ) ; return this ;
public class XMLOutputter { /** * Sets the capacity for the stack of open elements . The new capacity must * at least allow the stack to contain the current open elements . * @ param newCapacity the new capacity , & gt ; = { @ link # getElementStackSize ( ) } . * @ throws IllegalArgumentException if < code > newC...
// Check argument if ( newCapacity < _elementStack . length ) { throw new IllegalArgumentException ( "newCapacity < getElementStackSize()" ) ; } int currentCapacity = _elementStack . length ; // Short - circuit if possible if ( currentCapacity == newCapacity ) { return ; } String [ ] newStack = new String [ newCapacity...
public class CmsWebdavServlet { /** * Copy the contents of the specified input stream to the specified * output stream , and ensure that both streams are closed before returning * ( even in the face of an exception ) . < p > * @ param item the RepositoryItem * @ param ostream the output stream to write to * @...
IOException exception = null ; while ( ( exception == null ) && ( ranges . hasNext ( ) ) ) { InputStream resourceInputStream = new ByteArrayInputStream ( item . getContent ( ) ) ; InputStream istream = new BufferedInputStream ( resourceInputStream , m_input ) ; CmsWebdavRange currentRange = ranges . next ( ) ; // Writi...
public class AbstractSession { /** * Get a previously calculated output * @ param enforceExistence If true : throw an exception if the array does not exist */ public T get ( String variable , String frame , int iteration , FrameIter parentFrameIter , boolean enforceExistence ) { } }
// TODO eventually we ' ll cache and reuse VarId objects here to avoid garbage generation on lookup etc VarId varId = newVarId ( variable , frame , iteration , parentFrameIter ) ; T out = nodeOutputs . get ( varId ) ; if ( enforceExistence ) { Preconditions . checkNotNull ( out , "No output found for variable %s (frame...
public class BoyerMoore { /** * Makes the jump table based on the mismatched character information . */ private static int [ ] makeCharTable ( byte [ ] needle ) { } }
int [ ] table = new int [ ALPHABET_SIZE ] ; int l = needle . length ; for ( int i = 0 ; i < ALPHABET_SIZE ; ++ i ) { table [ i ] = l ; } l -- ; for ( int i = 0 ; i < l ; ++ i ) { table [ needle [ i ] & 0xff ] = l - i ; } return table ;
public class Matrix4f { /** * Set < code > this < / code > matrix to < code > T * R * S * M < / code > , where < code > T < / code > is a translation by the given < code > ( tx , ty , tz ) < / code > , * < code > R < / code > is a rotation - and possibly scaling - transformation specified by the quaternion < code > (...
float w2 = qw * qw ; float x2 = qx * qx ; float y2 = qy * qy ; float z2 = qz * qz ; float zw = qz * qw ; float xy = qx * qy ; float xz = qx * qz ; float yw = qy * qw ; float yz = qy * qz ; float xw = qx * qw ; float nm00 = w2 + x2 - z2 - y2 ; float nm01 = xy + zw + zw + xy ; float nm02 = xz - yw + xz - yw ; float nm10 ...
public class RESTService { /** * Attempt to match the given REST request to a registered command . If it does , return * the corresponding { @ link RegisteredCommand } and update the given variable map with * decoded URI variables . For example , if the matching command is defined as : * < pre > * GET / { appli...
String cmdOwner = null ; if ( appDef != null ) { StorageService ss = SchemaService . instance ( ) . getStorageService ( appDef ) ; cmdOwner = ss . getClass ( ) . getSimpleName ( ) ; } return m_cmdRegistry . findCommand ( cmdOwner , method , uri , query , variableMap ) ;
public class PID { /** * Command - line interactive tester . If one arg given , prints normalized form * of that PID and exits . If no args , enters interactive mode . */ public static void main ( String [ ] args ) throws Exception { } }
if ( args . length > 0 ) { PID p = new PID ( args [ 0 ] ) ; System . out . println ( "Normalized : " + p . toString ( ) ) ; System . out . println ( "To filename : " + p . toFilename ( ) ) ; System . out . println ( "From filename : " + PID . fromFilename ( p . toFilename ( ) ) . toString ( ) ) ; } else { System ....
public class LoopInfo { /** * set all fields of the loop info * @ param currentIndex current index * @ param effectiveIndex the times ' last loop value ' has been modified * @ param lastRes last loop result * @ return < code > this < / code > */ public LoopInfo < R > setValues ( int currentIndex , int effective...
this . currentIndex = currentIndex ; this . effectiveIndex = effectiveIndex ; this . lastRes = lastRes ; return this ;
public class FnInteger { /** * It returns the { @ link String } representation of the target as a currency in the * default { @ link Locale } * @ return the { @ link String } representation of the input as a currency */ public static final Function < Integer , String > toCurrencyStr ( ) { } }
return ( Function < Integer , String > ) ( ( Function ) FnNumber . toCurrencyStr ( ) ) ;
public class ConfigurationItem { /** * A mapping of key value tags associated with the resource . * @ param tags * A mapping of key value tags associated with the resource . * @ return Returns a reference to this object so that method calls can be chained together . */ public ConfigurationItem withTags ( java . u...
setTags ( tags ) ; return this ;
public class ResourceAssignment { /** * Set a cost value . * @ param index cost index ( 1-10) * @ param value cost value */ public void setCost ( int index , Number value ) { } }
set ( selectField ( AssignmentFieldLists . CUSTOM_COST , index ) , value ) ;
public class StreamletImpl { /** * Set the id of the stream to be used by the children nodes . * Usage ( assuming source is a Streamlet object with two output streams : stream1 and stream2 ) : * source . withStream ( " stream1 " ) . filter ( . . . ) . log ( ) ; * source . withStream ( " stream2 " ) . filter ( . ....
checkNotBlank ( streamId , "streamId can't be empty" ) ; Set < String > availableIds = getAvailableStreamIds ( ) ; if ( availableIds . contains ( streamId ) ) { return new StreamletShadow < R > ( this ) { @ Override public String getStreamId ( ) { return streamId ; } } ; } else { throw new RuntimeException ( String . f...
public class Lockable { /** * Accessors for locking state . Minimal self - checking ; primitive results */ private boolean is_locked ( Key < Job > job_key ) { } }
if ( _lockers == null ) return false ; for ( int i = ( _lockers . length == 1 ? 0 : 1 ) ; i < _lockers . length ; i ++ ) { Key k = _lockers [ i ] ; if ( job_key == k || ( job_key != null && k != null && job_key . equals ( k ) ) ) return true ; } return false ;
public class WSJdbcResultSet { /** * Gets the name of the SQL cursor used by this ResultSet . * In SQL , a result table is retrieved through a cursor that is named . The current row of a result can be updated or * deleted using a positioned update / delete statement that references the cursor name . To insure that ...
try { return rsetImpl . getCursorName ( ) ; } catch ( SQLException ex ) { FFDCFilter . processException ( ex , "com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.getCursorName" , "1129" , this ) ; throw WSJdbcUtil . mapException ( this , ex ) ; } catch ( NullPointerException nullX ) { // No FFDC code needed ; we might be close...
public class FeatureGenerators { /** * Applies { @ code featureGenerator } to each data point and * returns the sum of the resulting feature vectors . * @ param featureGenerator * @ param data * @ return */ public static < A , B > CountAccumulator < B > getFeatureCounts ( FeatureGenerator < A , B > featureGener...
MapReduceExecutor executor = MapReduceConfiguration . getMapReduceExecutor ( ) ; Mapper < A , Map < B , Double > > mapper = new FeatureCountMapper < A , B > ( featureGenerator ) ; Reducer < Map < B , Double > , CountAccumulator < B > > reducer = new FeatureCountReducer < B > ( ) ; return executor . mapReduce ( data , m...
public class WTree { /** * { @ inheritDoc } */ @ Override protected void initialiseComponentModel ( ) { } }
super . initialiseComponentModel ( ) ; // Copy the custom tree ( if set ) to allow the nodes to be updated per user TreeItemIdNode custom = getCustomTree ( ) ; if ( custom != null ) { TreeItemIdNode copy = TreeItemUtil . copyTreeNode ( custom ) ; setCustomTree ( copy ) ; }
public class ObjectUtils { /** * This method tries to map the values of the given object on the valueModels of the formModel . Instead of * setting the object as a backing object , all valueModels are processed one by one and the corresponding * property value is fetched from the objectToMap and set on that valueMo...
BeanWrapper beanWrapper = new BeanWrapperImpl ( objectToMap ) ; for ( String fieldName : ( Set < String > ) formModel . getFieldNames ( ) ) { try { formModel . getValueModel ( fieldName ) . setValue ( beanWrapper . getPropertyValue ( fieldName ) ) ; } catch ( BeansException be ) { // silently ignoring , just mapping va...
public class GradleDependencyResolutionHelper { /** * Get the collection of Gradle projects along with their GAV definitions . This collection is used for determining if an * artifact specification represents a Gradle project or not . * @ param project the Gradle project that is being analyzed . * @ return a map ...
return getCachedReference ( project , "thorntail_project_gav_collection" , ( ) -> { Map < String , Project > gavMap = new HashMap < > ( ) ; project . getRootProject ( ) . getAllprojects ( ) . forEach ( p -> { gavMap . put ( p . getGroup ( ) + ":" + p . getName ( ) + ":" + p . getVersion ( ) , p ) ; } ) ; return gavMap ...
public class StringUtil { /** * Tests a string array , to see if all items are null or an empty string . * @ param pStringArray The string array to check . * @ return true if the string array is null or only contains string items * that are null or contain only whitespace , otherwise false . */ public static bool...
// No elements to test if ( pStringArray == null ) { return true ; } // Test all the elements for ( String string : pStringArray ) { if ( ! isEmpty ( string ) ) { return false ; } } // All elements are empty return true ;
public class TaskClient { /** * Ack for the task poll . * @ param taskId Id of the task to be polled * @ param workerId user identified worker . * @ return true if the task was found with the given ID and acknowledged . False otherwise . If the server returns false , the client should NOT attempt to ack again . *...
Preconditions . checkArgument ( StringUtils . isNotBlank ( taskId ) , "Task id cannot be blank" ) ; String response = postForEntity ( "tasks/{taskId}/ack" , null , new Object [ ] { "workerid" , workerId } , String . class , taskId ) ; return Boolean . valueOf ( response ) ;
public class TranslationsResource { /** * Update translation for the given locale . * @ param keyName key name * @ param representation translation representation * @ return status code 204 ( no content ) or 404 ( not found ) if key or target translation is null . */ @ PUT @ Path ( "/{key}" ) @ Consumes ( MediaTy...
WebAssertions . assertNotNull ( representation , "The translation should not be null" ) ; TranslationValueRepresentation translationToUpdate = representation . getTarget ( ) ; WebAssertions . assertNotNull ( translationToUpdate , "The translation target should not be null" ) ; Key key = keyRepository . get ( keyName ) ...
public class Matrices { /** * Creates a 2D orthographic projection matrix . This method is analogous to the now * deprecated { @ code gluOrtho2D } method . * @ param left left vertical clipping plane * @ param right right vertical clipping plane * @ param bottom bottom horizontal clipping plane * @ param top ...
final float m00 = 2f / ( right - left ) ; final float m11 = 2f / ( top - bottom ) ; final float m22 = - 1f ; final float m30 = - ( right + left ) / ( right - left ) ; final float m31 = - ( top + bottom ) / ( top - bottom ) ; return new Mat4 ( m00 , 0f , 0f , 0f , 0f , m11 , 0f , 0f , 0f , 0f , m22 , 0f , m30 , m31 , 0f...
public class LoggerFactory { /** * Gets an { @ link XMLResourceBundle } wrapped SLF4J { @ link org . slf4j . Logger } . * @ param aClass A class to use for the logger name * @ param aBundleName The name of the resource bundle to use * @ return A resource bundle aware logger */ public static Logger getLogger ( fin...
return getLogger ( aClass . getName ( ) , aBundleName ) ;