signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class GlobalQuartzScheduler { /** * Add a job listener for all jobs .
* @ param aJobListener
* The job listener to be added . May not be < code > null < / code > . */
public void addJobListener ( @ Nonnull final IJobListener aJobListener ) { } } | ValueEnforcer . notNull ( aJobListener , "JobListener" ) ; try { m_aScheduler . getListenerManager ( ) . addJobListener ( aJobListener , EverythingMatcher . allJobs ( ) ) ; } catch ( final SchedulerException ex ) { throw new IllegalStateException ( "Failed to add job listener " + aJobListener . toString ( ) , ex ) ; } |
public class CmsContainerpageController { /** * Checks if any of the containers are nested containers . < p >
* @ return true if there are nested containers */
protected boolean hasNestedContainers ( ) { } } | boolean hasNestedContainers = false ; for ( CmsContainer container : m_containers . values ( ) ) { if ( container . getParentContainerName ( ) != null ) { hasNestedContainers = true ; break ; } } return hasNestedContainers ; |
public class TargetsMngrImpl { /** * Atomic operations . . . */
@ Override public TargetProperties lockAndGetTarget ( Application app , Instance scopedInstance ) throws IOException { } } | String instancePath = InstanceHelpers . computeInstancePath ( scopedInstance ) ; String targetId = findTargetId ( app , instancePath ) ; if ( targetId == null ) throw new IOException ( "No target was found for " + app + " :: " + instancePath ) ; InstanceContext mappingKey = new InstanceContext ( app , instancePath ) ; ... |
public class AccessControlUtils { /** * Returns the effective visibility of the given name . This can differ
* from the name ' s declared visibility if the file ' s { @ code @ fileoverview }
* JsDoc specifies a default visibility .
* @ param name The name node to compute effective visibility for .
* @ param var... | JSDocInfo jsDocInfo = var . getJSDocInfo ( ) ; Visibility raw = ( jsDocInfo == null || jsDocInfo . getVisibility ( ) == null ) ? Visibility . INHERITED : jsDocInfo . getVisibility ( ) ; if ( raw != Visibility . INHERITED ) { return raw ; } Visibility defaultVisibilityForFile = fileVisibilityMap . get ( var . getSourceF... |
public class FeatureSelectionController { /** * Transform a pixel - length into a real - life distance expressed in map CRS . This depends on the current map scale .
* @ param pixels
* The number of pixels to calculate the distance for .
* @ return The distance the given number of pixels entails . */
private doub... | Coordinate c1 = mapPresenter . getViewPort ( ) . getTransformationService ( ) . transform ( new Coordinate ( 0 , 0 ) , RenderSpace . SCREEN , RenderSpace . WORLD ) ; Coordinate c2 = mapPresenter . getViewPort ( ) . getTransformationService ( ) . transform ( new Coordinate ( pixels , 0 ) , RenderSpace . SCREEN , RenderS... |
public class Alerts { /** * 弹出错误框
* @ param title 标题
* @ param content 内容
* @ return { @ link ButtonType } */
public static Optional < ButtonType > showError ( String title , String content ) { } } | return showError ( title , null , content ) ; |
public class CmsSearchManager { /** * Initializes the spell check index . < p >
* @ param adminCms the ROOT _ ADMIN cms context */
public void initSpellcheckIndex ( CmsObject adminCms ) { } } | if ( CmsSpellcheckDictionaryIndexer . updatingIndexNecessesary ( adminCms ) ) { final CmsSolrSpellchecker spellchecker = OpenCms . getSearchManager ( ) . getSolrDictionary ( ) ; if ( spellchecker != null ) { Runnable initRunner = new Runnable ( ) { public void run ( ) { try { spellchecker . parseAndAddDictionaries ( ad... |
public class BeanDescriptor { /** * Invokes the annotation of the given type .
* @ param name the given setter name
* @ param annotationType the annotation type to look for
* @ param < T > the annotation type
* @ return the annotation object , or null if not found
* @ throws NoSuchMethodException when a sette... | Method method = getSetter ( name ) ; return getSetterAnnotation ( method , annotationType ) ; |
public class DeleteException { /** * Converts a Throwable to a DeleteException . If the Throwable is a
* DeleteException , it will be passed through unmodified ; otherwise , it will be wrapped
* in a new DeleteException .
* @ param cause the Throwable to convert
* @ return a DeleteException */
public static Del... | return ( cause instanceof DeleteException ) ? ( DeleteException ) cause : new DeleteException ( cause ) ; |
public class KunderaCriteriaBuilder { /** * ( non - Javadoc )
* @ see
* javax . persistence . criteria . CriteriaBuilder # neg ( javax . persistence . criteria
* . Expression ) */
@ Override public < N extends Number > Expression < N > neg ( Expression < N > arg0 ) { } } | // TODO Auto - generated method stub
return null ; |
public class MapUtil { /** * 获取Map指定key的值 , 并转换为Float
* @ param map Map
* @ param key 键
* @ return 值
* @ since 4.0.6 */
public static Float getFloat ( Map < ? , ? > map , Object key ) { } } | return get ( map , key , Float . class ) ; |
public class DSUtil { /** * Checks equality of two objects ; deals with the case when
* < code > obj1 < / code > is null , and next invokes
* < code > equals < / code > . */
public static < E > boolean checkEq ( E obj1 , E obj2 ) { } } | if ( obj1 == null ) return obj2 == null ; // make sure we do this short - circuit , just in case it ' s not done by equals
if ( obj1 == obj2 ) return true ; return obj1 . equals ( obj2 ) ; |
public class DiskBuffer { /** * Deletes a buffered { @ link Event } from disk .
* @ param event Event to delete from the disk . */
@ Override public void discard ( Event event ) { } } | File eventFile = new File ( bufferDir , event . getId ( ) . toString ( ) + FILE_SUFFIX ) ; if ( eventFile . exists ( ) ) { logger . debug ( "Discarding Event from offline storage: " + eventFile . getAbsolutePath ( ) ) ; if ( ! eventFile . delete ( ) ) { logger . warn ( "Failed to delete Event: " + eventFile . getAbsolu... |
public class MessageMgr { /** * Resets the collected messages and all counters .
* @ return returns self to allow for chained calls */
public MessageMgr clear ( ) { } } | for ( MessageTypeHandler handler : this . messageHandlers . values ( ) ) { handler . clear ( ) ; } this . messages . clear ( ) ; return this ; |
public class Context { /** * Sets the maximum stack depth ( in terms of number of call frames )
* allowed in a single invocation of interpreter . If the set depth would be
* exceeded , the interpreter will throw an EvaluatorException in the script .
* Defaults to Integer . MAX _ VALUE . The setting only has effec... | if ( sealed ) onSealedMutation ( ) ; if ( optimizationLevel != - 1 ) { throw new IllegalStateException ( "Cannot set maximumInterpreterStackDepth when optimizationLevel != -1" ) ; } if ( max < 1 ) { throw new IllegalArgumentException ( "Cannot set maximumInterpreterStackDepth to less than 1" ) ; } maximumInterpreterSta... |
public class ConfigureNodesLocalHost { /** * If the current node exists in the nodes list , bring it to the front */
@ Override public List < Node > getNodes ( ByteArray key ) { } } | logger . debug ( "Giving pref to localhost ! " ) ; List < Node > nodes = null ; List < Node > reorderedNodes = new ArrayList < Node > ( ) ; try { nodes = super . getNodes ( key ) ; if ( nodes == null ) { return null ; } String currentHost = InetAddress . getLocalHost ( ) . getHostName ( ) ; for ( Node n : nodes ) { if ... |
public class DefaultBambooClient { /** * / / / / Helpers */
private long getCommitTimestamp ( JSONObject jsonItem ) { } } | if ( jsonItem . get ( "timestamp" ) != null ) { return ( Long ) jsonItem . get ( "timestamp" ) ; } else if ( jsonItem . get ( "date" ) != null ) { String dateString = ( String ) jsonItem . get ( "date" ) ; try { return new SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" ) . parse ( dateString ) . getTime ( ) ; } catc... |
public class GetVoiceConnectorRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetVoiceConnectorRequest getVoiceConnectorRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getVoiceConnectorRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getVoiceConnectorRequest . getVoiceConnectorId ( ) , VOICECONNECTORID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall r... |
public class CliCommandBuilder { /** * Sets the timeout used when connecting to the server .
* @ param timeout the time out to use
* @ return the builder */
public CliCommandBuilder setTimeout ( final int timeout ) { } } | if ( timeout > 0 ) { addCliArgument ( CliArgument . TIMEOUT , Integer . toString ( timeout ) ) ; } else { addCliArgument ( CliArgument . TIMEOUT , null ) ; } return this ; |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EEnum getFNCYftUnits ( ) { } } | if ( fncYftUnitsEEnum == null ) { fncYftUnitsEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 23 ) ; } return fncYftUnitsEEnum ; |
public class XSDValidator { /** * Validate some XML against this schema
* @ param document
* @ throws SchemaValidationException
* if the document does not validate against the schema */
public void validate ( final Node document ) throws SchemaValidationException { } } | try { final Validator validator = schema . newValidator ( ) ; validator . validate ( new DOMSource ( document ) ) ; } catch ( SAXException | IOException e ) { throw new SchemaValidationException ( e . getMessage ( ) , e ) ; } |
public class StatsInterface { /** * Get the number of views , comments and favorites on a photo for a given date .
* @ param date
* ( Required ) Stats will be returned for this date . A day according to Flickr Stats starts at midnight GMT for all users , and timestamps will
* automatically be rounded down to the ... | return getStats ( METHOD_GET_PHOTO_STATS , "photo_id" , photoId , date ) ; |
public class NtlmContext { /** * { @ inheritDoc }
* @ see jcifs . smb . SSPContext # dispose ( ) */
@ Override public void dispose ( ) throws SmbException { } } | this . isEstablished = false ; this . sealClientHandle = null ; this . sealServerHandle = null ; this . sealClientKey = null ; this . sealServerKey = null ; this . masterKey = null ; this . signKey = null ; this . verifyKey = null ; this . type1Bytes = null ; |
public class MetaMediaManager { /** * Pauses the sprites and animations that are currently active on this media panel . Also stops
* listening to the frame tick while paused . */
public void setPaused ( boolean paused ) { } } | // sanity check
if ( ( paused && ( _pauseTime != 0 ) ) || ( ! paused && ( _pauseTime == 0 ) ) ) { log . warning ( "Requested to pause when paused or vice-versa" , "paused" , paused ) ; return ; } _paused = paused ; if ( _paused ) { // make a note of our pause time
_pauseTime = _framemgr . getTimeStamp ( ) ; } else { //... |
public class ExceptionDialog { /** * GEN - LAST : event _ btCloseActionPerformed */
private void formWindowOpened ( java . awt . event . WindowEvent evt ) // GEN - FIRST : event _ formWindowOpened
{ } } | // GEN - HEADEREND : event _ formWindowOpened
spDetails . setVisible ( false ) ; pack ( ) ; validate ( ) ; |
public class Gild { /** * Moves to the next stage in the staged test run . @ param stageName the next
* stage name */
public void nextStage ( final String stageName ) { } } | assertNotNull ( "Cannot move to a null stage" , stageName ) ; execs . forEach ( consumer ( StageExec :: preserve ) ) ; stage = stage . nextStage ( stageName ) ; prepare ( ) ; |
public class Boxing { /** * Transforms any array into an array of { @ code byte } .
* @ param src source array
* @ param srcPos start position
* @ param len length
* @ return byte array */
public static byte [ ] unboxBytes ( Object src , int srcPos , int len ) { } } | return unboxBytes ( array ( src ) , srcPos , len ) ; |
public class DeployerResolverOverriderConverter { /** * Convert the ( ServerDetails ) details to ( ServerDetails ) deployerDetails if it doesn ' t exists already
* This convertion comes after a name change ( details - > deployerDetails ) */
private void overrideDeployerDetails ( T overrider , Class overriderClass ) {... | if ( overrider instanceof DeployerOverrider ) { try { Field deployerDetailsField = overriderClass . getDeclaredField ( "deployerDetails" ) ; deployerDetailsField . setAccessible ( true ) ; Object deployerDetails = deployerDetailsField . get ( overrider ) ; if ( deployerDetails == null ) { Field oldDeployerDetailsField ... |
public class IOUtils { /** * Reads reverse int
* @ param in
* Source
* @ return int */
public final static int readReverseInt ( IoBuffer in ) { } } | int value = in . getInt ( ) ; value = ( ( value & 0xFF ) << 24 | ( ( value >> 8 ) & 0x00FF ) << 16 | ( ( value >>> 16 ) & 0x000000FF ) << 8 | ( ( value >>> 24 ) & 0x000000FF ) ) ; return value ; |
public class XMLEncodingDetector { /** * Returns the next character on the input .
* < strong > Note : < / strong > The character is < em > not < / em > consumed .
* @ throws IOException Thrown if i / o error occurs .
* @ throws EOFException Thrown on end of file . */
public int peekChar ( ) throws IOException { ... | // load more characters , if needed
if ( fCurrentEntity . position == fCurrentEntity . count ) { load ( 0 , true ) ; } // peek at character
int c = fCurrentEntity . ch [ fCurrentEntity . position ] ; // return peeked character
if ( fCurrentEntity . isExternal ( ) ) { return c != '\r' ? c : '\n' ; } else { return c ; } |
public class LocalDateTime { /** * Handle broken serialization from other tools .
* @ return the resolved object , not null */
private Object readResolve ( ) { } } | if ( iChronology == null ) { return new LocalDateTime ( iLocalMillis , ISOChronology . getInstanceUTC ( ) ) ; } if ( DateTimeZone . UTC . equals ( iChronology . getZone ( ) ) == false ) { return new LocalDateTime ( iLocalMillis , iChronology . withUTC ( ) ) ; } return this ; |
public class AsmDecompiler { /** * Loads the URL contents and parses them with ASM , producing a { @ link ClassStub } object representing the structure of
* the corresponding class file . Stubs are cached and reused if queried several times with equal URLs .
* @ param url an URL from a class loader , most likely a ... | URI uri ; try { uri = url . toURI ( ) ; } catch ( URISyntaxException e ) { throw new GroovyRuntimeException ( e ) ; } SoftReference < ClassStub > ref = StubCache . map . get ( uri ) ; ClassStub stub = ref == null ? null : ref . get ( ) ; if ( stub == null ) { DecompilingVisitor visitor = new DecompilingVisitor ( ) ; tr... |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcLightSourceGoniometric ( ) { } } | if ( ifcLightSourceGoniometricEClass == null ) { ifcLightSourceGoniometricEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 347 ) ; } return ifcLightSourceGoniometricEClass ; |
public class CPOptionLocalServiceWrapper { /** * Deletes the cp option from the database . Also notifies the appropriate model listeners .
* @ param cpOption the cp option
* @ return the cp option that was removed
* @ throws PortalException */
@ Override public com . liferay . commerce . product . model . CPOptio... | return _cpOptionLocalService . deleteCPOption ( cpOption ) ; |
public class ConnectionHandle { /** * # ifdef JDK > 6 */
public Properties getClientInfo ( ) throws SQLException { } } | Properties result = null ; checkClosed ( ) ; try { result = this . connection . getClientInfo ( ) ; } catch ( SQLException e ) { throw markPossiblyBroken ( e ) ; } return result ; |
public class AmazonRedshiftClient { /** * Returns a list of parameter settings for the specified parameter group family .
* For more information about parameters and parameter groups , go to < a
* href = " https : / / docs . aws . amazon . com / redshift / latest / mgmt / working - with - parameter - groups . html ... | request = beforeClientExecution ( request ) ; return executeDescribeDefaultClusterParameters ( request ) ; |
public class TileGroupsConfig { /** * Export the group data as a node .
* @ param nodeGroups The root node ( must not be < code > null < / code > ) .
* @ param group The group to export ( must not be < code > null < / code > ) . */
private static void exportGroup ( Xml nodeGroups , TileGroup group ) { } } | final Xml nodeGroup = nodeGroups . createChild ( NODE_GROUP ) ; nodeGroup . writeString ( ATT_GROUP_NAME , group . getName ( ) ) ; nodeGroup . writeString ( ATT_GROUP_TYPE , group . getType ( ) . name ( ) ) ; for ( final TileRef tileRef : group . getTiles ( ) ) { final Xml nodeTileRef = TileConfig . exports ( tileRef )... |
public class StringUtils { /** * < p > Swaps the case of a String changing upper and title case to
* lower case , and lower case to upper case . < / p >
* < ul >
* < li > Upper case character converts to Lower case < / li >
* < li > Title case character converts to Lower case < / li >
* < li > Lower case char... | if ( StringUtils . isEmpty ( str ) ) { return str ; } final int strLen = str . length ( ) ; final int newCodePoints [ ] = new int [ strLen ] ; // cannot be longer than the char array
int outOffset = 0 ; for ( int i = 0 ; i < strLen ; ) { final int oldCodepoint = str . codePointAt ( i ) ; final int newCodePoint ; if ( C... |
public class DeviceImpl { public DevCmdHistory [ ] command_inout_history_2 ( final String command , int n ) throws DevFailed , SystemException { } } | Util . out4 . println ( "Device_2Impl.command_inout_history_2 arrived" ) ; final String cmd_str = command . toLowerCase ( ) ; // Record operation request in black box
blackbox . insert_op ( Op_Command_inout_history_2 ) ; // Check that device supports this command
check_command_exists ( cmd_str ) ; // Check that the com... |
public class PdfDocument { /** * Sets the margins .
* @ parammarginLeftthe margin on the left
* @ parammarginRightthe margin on the right
* @ parammarginTopthe margin on the top
* @ parammarginBottomthe margin on the bottom
* @ returna < CODE > boolean < / CODE > */
public boolean setMargins ( float marginLef... | if ( writer != null && writer . isPaused ( ) ) { return false ; } nextMarginLeft = marginLeft ; nextMarginRight = marginRight ; nextMarginTop = marginTop ; nextMarginBottom = marginBottom ; return true ; |
public class XesXmlSerializer { /** * ( non - Javadoc )
* @ see
* org . deckfour . xes . out . XesSerializer # serialize ( org . deckfour . xes . model . XLog ,
* java . io . OutputStream ) */
public void serialize ( XLog log , OutputStream out ) throws IOException { } } | XLogging . log ( "start serializing log to XES.XML" , XLogging . Importance . DEBUG ) ; long start = System . currentTimeMillis ( ) ; SXDocument doc = new SXDocument ( out ) ; doc . addComment ( "This file has been generated with the OpenXES library. It conforms" ) ; doc . addComment ( "to the XML serialization of the ... |
public class ConstructorFilterBuilder { /** * Adds a filter for default access constructors only .
* @ return The builder to support method chaining . */
public ConstructorFilterBuilder isDefault ( ) { } } | add ( new NegationConstructorFilter ( new ModifierConstructorFilter ( Modifier . PUBLIC & Modifier . PROTECTED & Modifier . PRIVATE ) ) ) ; return this ; |
public class CmsSearchManager { /** * Returns an analyzer for the given language . < p >
* The analyzer is selected according to the analyzer configuration . < p >
* @ param locale the locale to get the analyzer for
* @ return the appropriate lucene analyzer
* @ throws CmsSearchException if something goes wrong... | Analyzer analyzer = null ; String className = null ; CmsSearchAnalyzer analyzerConf = m_analyzers . get ( locale ) ; if ( analyzerConf == null ) { throw new CmsSearchException ( Messages . get ( ) . container ( Messages . ERR_ANALYZER_NOT_FOUND_1 , locale ) ) ; } try { analyzer = getAnalyzer ( analyzerConf . getClassNa... |
public class Claim { /** * syntactic sugar */
public Claim addValueCode ( Coding t ) { } } | if ( t == null ) return this ; if ( this . valueCode == null ) this . valueCode = new ArrayList < Coding > ( ) ; this . valueCode . add ( t ) ; return this ; |
public class JcrNodeDefinition { /** * Determine if this node definition will allow a child with the supplied primary type . This method checks this definition ' s
* { @ link # getRequiredPrimaryTypes ( ) } against the supplied primary type and its supertypes . The supplied primary type for the
* child must be or e... | if ( childPrimaryType == null ) { // The definition must have a default primary type . . .
if ( defaultPrimaryTypeName != null ) { return true ; } return false ; } // The supplied primary type must be or extend all of the required primary types . . .
for ( Name requiredPrimaryTypeName : requiredPrimaryTypeNameSet ) { i... |
public class TFIDFAnalyzer { /** * tfidf分析方法
* @ param content 需要分析的文本 / 文档内容
* @ param topN 需要返回的tfidf值最高的N个关键词 , 若超过content本身含有的词语上限数目 , 则默认返回全部
* @ return */
public List < Keyword > analyze ( String content , int topN ) { } } | List < Keyword > keywordList = new ArrayList < > ( ) ; if ( stopWordsSet == null ) { stopWordsSet = new HashSet < > ( ) ; loadStopWords ( stopWordsSet , this . getClass ( ) . getResourceAsStream ( "/stop_words.txt" ) ) ; } if ( idfMap == null ) { idfMap = new HashMap < > ( ) ; loadIDFMap ( idfMap , this . getClass ( ) ... |
public class CmsPreferences { /** * Builds the html for the language select box of the start settings . < p >
* @ param htmlAttributes optional html attributes for the & lgt ; select & gt ; tag
* @ return the html for the language select box */
public String buildSelectLanguage ( String htmlAttributes ) { } } | SelectOptions selectOptions = getOptionsForLanguage ( ) ; return buildSelect ( htmlAttributes , selectOptions ) ; |
public class PlaceManager { /** * Registers an invocation provider and notes the registration such that it will be
* automatically cleared when this manager shuts down . */
protected < T extends InvocationMarshaller < ? > > T addProvider ( InvocationProvider prov , Class < T > mclass ) { } } | T marsh = _invmgr . registerProvider ( prov , mclass ) ; _marshallers . add ( marsh ) ; return marsh ; |
public class ConvertHelper { /** * Konvertiert ein beliebiges Objekt in ein byte - Array und schleust dieses durch ein InputStream .
* @ param o
* @ return
* @ throws IOException */
public static InputStream convertObjectToInputStream ( Object o ) throws IOException { } } | byte [ ] bObject = convertObjectToByteArray ( o ) ; return new ByteArrayInputStream ( bObject ) ; |
public class SessionImpl { /** * { @ inheritDoc } */
public void move ( String srcAbsPath , String destAbsPath ) throws ItemExistsException , PathNotFoundException , VersionException , LockException , RepositoryException { } } | // In this particular case we rely on the default configuration
move ( srcAbsPath , destAbsPath , triggerEventsForDescendantsOnRename , triggerEventsForDescendantsOnMove ) ; |
public class FileWriterServices { /** * Copy path / filename , from jar ocelot - processor in classes directory of current project / module
* @ param path
* @ param filename */
public void copyResourceToClassesOutput ( String path , String filename ) { } } | String fullpath = path + ProcessorConstants . SEPARATORCHAR + filename ; messager . printMessage ( Diagnostic . Kind . MANDATORY_WARNING , " javascript copy js : " + fullpath + " to : class dir" ) ; try ( Writer writer = getFileObjectWriterInClassOutput ( "" , filename ) ) { bodyWriter . write ( writer , OcelotProcesso... |
public class KnowledgePackageImpl { /** * Get the rule flows for this package . The key is the ruleflow id . It will
* be Collections . EMPTY _ MAP if none have been added . */
public Map < String , Process > getRuleFlows ( ) { } } | ProcessPackage rtp = ( ProcessPackage ) getResourceTypePackages ( ) . get ( ResourceType . BPMN2 ) ; return rtp == null ? Collections . emptyMap ( ) : rtp . getRuleFlows ( ) ; |
public class nsacl6 { /** * Use this API to enable nsacl6 of given name . */
public static base_response enable ( nitro_service client , String acl6name ) throws Exception { } } | nsacl6 enableresource = new nsacl6 ( ) ; enableresource . acl6name = acl6name ; return enableresource . perform_operation ( client , "enable" ) ; |
public class Controller { /** * Get para from url with default value if it is null or " " . */
public String getPara ( int index , String defaultValue ) { } } | String result = getPara ( index ) ; return result != null && ! "" . equals ( result ) ? result : defaultValue ; |
public class StopProcessEnginesStep { /** * Stops a process engine , failures are logged but no exceptions are thrown . */
private void stopProcessEngine ( String serviceName , PlatformServiceContainer serviceContainer ) { } } | try { serviceContainer . stopService ( serviceName ) ; } catch ( Exception e ) { LOG . exceptionWhileStopping ( "Process Engine" , serviceName , e ) ; } |
public class IdRange { /** * Parses a uid sequence , a comma separated list of uid ranges .
* Example : 1 2:5 8 : *
* @ param idRangeSequence the sequence
* @ return a list of ranges , never null . */
public static List < IdRange > parseRangeSequence ( String idRangeSequence ) { } } | StringTokenizer tokenizer = new StringTokenizer ( idRangeSequence , " " ) ; List < IdRange > ranges = new ArrayList < > ( ) ; while ( tokenizer . hasMoreTokens ( ) ) { ranges . add ( parseRange ( tokenizer . nextToken ( ) ) ) ; } return ranges ; |
public class BytesWritable { /** * Change the capacity of the backing storage .
* The data is preserved .
* @ param new _ cap The new capacity in bytes . */
public void setCapacity ( int new_cap ) { } } | if ( new_cap != getCapacity ( ) ) { byte [ ] new_data = new byte [ new_cap ] ; if ( new_cap < size ) { size = new_cap ; } if ( size != 0 ) { System . arraycopy ( bytes , 0 , new_data , 0 , size ) ; } bytes = new_data ; } |
public class SequenceLabelerEventStream { /** * Generated previous decision features for each token based on contents of
* the specified map .
* @ param tokens
* The token for which the context is generated .
* @ param prevMap
* A mapping of tokens to their previous decisions .
* @ return An additional cont... | final String [ ] [ ] ac = new String [ tokens . length ] [ 1 ] ; for ( int ti = 0 ; ti < tokens . length ; ti ++ ) { final String pt = prevMap . get ( tokens [ ti ] ) ; ac [ ti ] [ 0 ] = "pd=" + pt ; } return ac ; |
public class Content { /** * Sets the lastModifiedDateTime value for this Content .
* @ param lastModifiedDateTime * The date and time at which this content was last modified .
* This attribute is read - only . */
public void setLastModifiedDateTime ( com . google . api . ads . admanager . axis . v201902 . DateTime... | this . lastModifiedDateTime = lastModifiedDateTime ; |
public class UnixResolverDnsServerAddressStreamProvider { /** * Parse a file of the format < a href = " https : / / linux . die . net / man / 5 / resolver " > / etc / resolv . conf < / a > and return the
* value corresponding to the first ndots in an options configuration .
* @ param etcResolvConf a file of the for... | FileReader fr = new FileReader ( etcResolvConf ) ; BufferedReader br = null ; try { br = new BufferedReader ( fr ) ; String line ; while ( ( line = br . readLine ( ) ) != null ) { if ( line . startsWith ( OPTIONS_ROW_LABEL ) ) { int i = line . indexOf ( NDOTS_LABEL ) ; if ( i >= 0 ) { i += NDOTS_LABEL . length ( ) ; fi... |
public class ServerHandshaker { /** * Get some " ephemeral " RSA keys for this context . This means
* generating them if it ' s not already been done .
* Note that we currently do not implement any ciphersuites that use
* strong ephemeral RSA . ( We do not support the EXPORT1024 ciphersuites
* and standard RSA ... | KeyPair kp = sslContext . getEphemeralKeyManager ( ) . getRSAKeyPair ( export , sslContext . getSecureRandom ( ) ) ; if ( kp == null ) { return false ; } else { tempPublicKey = kp . getPublic ( ) ; tempPrivateKey = kp . getPrivate ( ) ; return true ; } |
public class ClientRegistry { /** * Calls the { @ link IRenderWorldLast } registered to render . < br >
* @ param event the event */
@ SubscribeEvent public void onRenderLast ( RenderWorldLastEvent event ) { } } | for ( IRenderWorldLast renderer : renderWorldLastRenderers ) { if ( renderer . shouldRender ( event , Utils . getClientWorld ( ) ) ) renderer . renderWorldLastEvent ( event , Utils . getClientWorld ( ) ) ; } |
public class TimeSourceProvider { /** * Get a specific TimeSource by class name
* @ param className Class name of the TimeSource to return the instance for
* @ return TimeSource instance */
public static TimeSource getInstance ( String className ) { } } | try { Class < ? > c = Class . forName ( className ) ; Method m = c . getMethod ( "getInstance" ) ; return ( TimeSource ) m . invoke ( null ) ; } catch ( Exception e ) { throw new RuntimeException ( "Error getting TimeSource instance for class \"" + className + "\"" , e ) ; } |
import java . math . BigDecimal ; import java . math . RoundingMode ; class Main { /** * This function rounds up a number to a specific number of digits .
* @ param num A number to round up
* @ param precision Number of decimal places to round up to
* @ return The number rounded up to the given number of decimal ... | BigDecimal bd = new BigDecimal ( Double . toString ( num ) ) ; bd = bd . setScale ( precision , RoundingMode . HALF_UP ) ; return bd . doubleValue ( ) ; |
public class ZooKeeperMasterModel { /** * Returns the current status of the host named by { @ code host } . */
@ Override public HostStatus getHostStatus ( final String host ) { } } | final ZooKeeperClient client = provider . get ( "getHostStatus" ) ; if ( ! ZooKeeperRegistrarUtil . isHostRegistered ( client , host ) ) { log . warn ( "Host {} isn't registered in ZooKeeper." , host ) ; return null ; } final boolean up = checkHostUp ( client , host ) ; final HostInfo hostInfo = getHostInfo ( client , ... |
public class StringUtilities { /** * Return a variable substituted string , but if a value hasn ' t been
* specified , then leave take out the $ { variable } part and leave it
* blank / empty / null .
* @ param attrString to use
* @ param attributes to check for and substitute
* @ return substituted string */... | return computeAttrString ( attrString , attributes , true , null ) ; |
public class PropertyLoader { /** * Returns the generic type of the value for given element . { @ link Field } and { @ link Method }
* are only supported . */
protected Type getValueGenericType ( AnnotatedElement element ) { } } | if ( element instanceof Field ) { return ( ( Field ) element ) . getGenericType ( ) ; } if ( element instanceof Method ) { return ( ( Method ) element ) . getGenericReturnType ( ) ; } throw new PropertyLoaderException ( "Could not get generic type for element" ) ; |
public class PrefsTransformer { /** * Get java . util type Transformable
* @ param type the type
* @ return the util transform */
static PrefsTransform getUtilTransform ( TypeName type ) { } } | String typeName = type . toString ( ) ; // Integer . class . getCanonicalName ( ) . equals ( typeName )
if ( Date . class . getCanonicalName ( ) . equals ( typeName ) ) { return new DatePrefsTransform ( ) ; } if ( Locale . class . getCanonicalName ( ) . equals ( typeName ) ) { return new LocalePrefsTransform ( ) ; } if... |
public class CashbillServiceImp { /** * ( non - Javadoc )
* @ see com . popbill . api . CashbillService # getChargeInfo ( java . lang . String ) */
@ Override public ChargeInfo getChargeInfo ( String CorpNum ) throws PopbillException { } } | return httpget ( "/Cashbill/ChargeInfo" , CorpNum , null , ChargeInfo . class ) ; |
public class LocatedString { /** * Gets the substring of the reference string corresponding to a range of content string
* offsets . This will include intervening characters which may not themselves correspond to
* any content string character .
* Will return { @ link Optional # absent ( ) } if and only if { @ li... | if ( referenceString ( ) . isPresent ( ) ) { return Optional . of ( referenceString ( ) . get ( ) . substringByCodePoints ( OffsetGroupRange . from ( startReferenceOffsetsForContentOffset ( contentOffsets . startInclusive ( ) ) , endReferenceOffsetsForContentOffset ( contentOffsets . endInclusive ( ) ) ) . asCharOffset... |
public class ServletOutputStreamImpl { /** * { @ inheritDoc } */
public void write ( final byte [ ] b , final int off , final int len ) throws IOException { } } | if ( anyAreSet ( state , FLAG_CLOSED ) || servletRequestContext . getOriginalResponse ( ) . isTreatAsCommitted ( ) ) { throw UndertowServletMessages . MESSAGES . streamIsClosed ( ) ; } if ( len < 1 ) { return ; } if ( listener == null ) { ByteBuffer buffer = buffer ( ) ; if ( buffer . remaining ( ) < len ) { writeTooLa... |
public class AppServiceEnvironmentsInner { /** * Get metrics for a specific instance of a multi - role pool of an App Service Environment .
* Get metrics for a specific instance of a multi - role pool of an App Service Environment .
* @ param resourceGroupName Name of the resource group to which the resource belong... | return listMultiRolePoolInstanceMetricsWithServiceResponseAsync ( resourceGroupName , name , instance , details ) . map ( new Func1 < ServiceResponse < Page < ResourceMetricInner > > , Page < ResourceMetricInner > > ( ) { @ Override public Page < ResourceMetricInner > call ( ServiceResponse < Page < ResourceMetricInner... |
public class ParentsRenderer { /** * This method is public for testing purposes only . Do not try to call it
* outside of the context of the rendering engine .
* @ param builder Buffer for holding the rendition
* @ param pad Minimum number spaces for padding each line of the output
* @ param mother Mother */
pu... | renderParent ( builder , pad , mother , "Mother" ) ; |
public class ExcelUtils { /** * 读取Excel表格数据 , 返回 { @ code List [ List [ String ] ] } 类型的数据集合
* @ param excelPath 待读取Excel的路径
* @ param offsetLine Excel表头行 ( 默认是0)
* @ return 返回 { @ code List < List < String > > } 类型的数据集合
* @ throws IOException 异常
* @ throws InvalidFormatException 异常
* @ author Crab2Died */
... | try ( Workbook workbook = WorkbookFactory . create ( new FileInputStream ( new File ( excelPath ) ) ) ) { return readExcel2ObjectsHandler ( workbook , offsetLine , Integer . MAX_VALUE , 0 ) ; } |
public class HttpSessionImpl { /** * Method getValueNames
* @ deprecated
* @ see javax . servlet . http . HttpSession # getValueNames ( ) */
public String [ ] getValueNames ( ) { } } | if ( ! _iSession . isValid ( ) ) throw new IllegalStateException ( ) ; Enumeration enumeration = this . getAttributeNames ( ) ; Vector valueNames = new Vector ( ) ; String name = null ; while ( enumeration . hasMoreElements ( ) ) { name = ( String ) enumeration . nextElement ( ) ; valueNames . add ( name ) ; } String [... |
public class MercatorProjection { /** * Converts a pixel Y coordinate at a certain scale to a latitude coordinate .
* @ param pixelY the pixel Y coordinate that should be converted .
* @ param scaleFactor the scale factor at which the coordinate should be converted .
* @ return the latitude value of the pixel Y c... | long mapSize = getMapSizeWithScaleFactor ( scaleFactor , tileSize ) ; if ( pixelY < 0 || pixelY > mapSize ) { throw new IllegalArgumentException ( "invalid pixelY coordinate at scale " + scaleFactor + ": " + pixelY ) ; } double y = 0.5 - ( pixelY / mapSize ) ; return 90 - 360 * Math . atan ( Math . exp ( - y * ( 2 * Ma... |
public class TagletManager { /** * Initialize the custom tag Lists . */
private void initCustomTaglets ( ) { } } | moduleTags = new ArrayList < > ( ) ; packageTags = new ArrayList < > ( ) ; typeTags = new ArrayList < > ( ) ; fieldTags = new ArrayList < > ( ) ; constructorTags = new ArrayList < > ( ) ; methodTags = new ArrayList < > ( ) ; inlineTags = new ArrayList < > ( ) ; overviewTags = new ArrayList < > ( ) ; for ( Taglet curren... |
public class ClassFieldsTypeField { /** * Get the conversion Map . */
public String [ ] [ ] getPopupMap ( ) { } } | String string [ ] [ ] = { { INCLUDE_CLASS_PACKAGE , "Include class package" } , { INCLUDE_PACKAGE , "Include package" } , { INCLUDE_CLASS , "Include class" } , { CLASS_FIELD , "Class field" } , { NATIVE_FIELD , "Native field" } , { CLASS_NAME , "Class name" } , { SCREEN_CLASS_NAME , "Screen class name" } , { INCLUDE_MO... |
public class ExpressionVisitorImpl { /** * expression : expression ( TIMES | DIVIDE ) expression */
@ Override public Object visitMultiplicationOrDivisionExpression ( ExcellentParser . MultiplicationOrDivisionExpressionContext ctx ) { } } | boolean multiplication = ctx . TIMES ( ) != null ; BigDecimal arg1 = Conversions . toDecimal ( visit ( ctx . expression ( 0 ) ) , m_evalContext ) ; BigDecimal arg2 = Conversions . toDecimal ( visit ( ctx . expression ( 1 ) ) , m_evalContext ) ; if ( ! multiplication && arg2 . equals ( BigDecimal . ZERO ) ) { throw new ... |
public class StrSubstitutor { /** * Replaces all the occurrences of variables within the given source
* builder with their matching values from the resolver .
* @ param source the builder to replace in , updated , null returns zero
* @ return true if altered */
public boolean replaceIn ( final StrBuilder source )... | if ( source == null ) { return false ; } return substitute ( source , 0 , source . length ( ) ) ; |
public class NonVoltDBBackend { /** * Returns true if the < i > columnName < / i > is one of the specified
* < i > columnTypes < / i > , e . g . , one of the integer column types , or one of
* the Geospatial column types - for one or more of the < i > tableNames < / i > ,
* if specified ; otherwise , for any tabl... | if ( debugPrint ) { System . out . println ( " In NonVoltDBBackend.isColumnType:" ) ; System . out . println ( " columnTypes: " + columnTypes ) ; System . out . println ( " columnName : " + columnName ) ; System . out . println ( " tableNames : " + tableNames ) ; } if ( tableNames == null || tableNames . size... |
public class Grena3 { /** * Calculate topocentric solar position , i . e . the location of the sun on the sky for a certain point in time on a
* certain point of the Earth ' s surface .
* This follows the no . 3 algorithm described in Grena , ' Five new algorithms for the computation of sun position
* from 2010 t... | final double t = calcT ( date ) ; final double tE = t + 1.1574e-5 * deltaT ; final double omegaAtE = 0.0172019715 * tE ; final double lambda = - 1.388803 + 1.720279216e-2 * tE + 3.3366e-2 * sin ( omegaAtE - 0.06172 ) + 3.53e-4 * sin ( 2.0 * omegaAtE - 0.1163 ) ; final double epsilon = 4.089567e-1 - 6.19e-9 * tE ; final... |
public class BucketingSink { public static FileSystem createHadoopFileSystem ( Path path , @ Nullable Configuration extraUserConf ) throws IOException { } } | // try to get the Hadoop File System via the Flink File Systems
// that way we get the proper configuration
final org . apache . flink . core . fs . FileSystem flinkFs = org . apache . flink . core . fs . FileSystem . getUnguardedFileSystem ( path . toUri ( ) ) ; final FileSystem hadoopFs = ( flinkFs instanceof HadoopF... |
public class DataProvider { /** * Save entity asynchronously
* @ param entity Target entity
* @ return Operation status result */
public Boolean save ( @ NotNull V entity ) { } } | Timer saveAsyncTimer = METRICS . getTimer ( MetricsType . DATA_PROVIDER_SAVE . name ( ) ) ; Insert insert = QueryBuilder . insertInto ( getEntityMetadata ( ) . getTableName ( ) ) ; List < ColumnMetadata > columns = getEntityMetadata ( ) . getFieldMetaData ( ) ; columns . forEach ( column -> insert . value ( column . ge... |
public class Maybe { /** * Returns a Maybe instance that runs the given Action for each subscriber and
* emits either its exception or simply completes .
* < dl >
* < dt > < b > Scheduler : < / b > < / dt >
* < dd > { @ code fromAction } does not operate by default on a particular { @ link Scheduler } . < / dd ... | ObjectHelper . requireNonNull ( run , "run is null" ) ; return RxJavaPlugins . onAssembly ( new MaybeFromAction < T > ( run ) ) ; |
public class ClickEventLinker { /** * { @ inheritDoc } */
@ Override public void link ( EventLinker . Configuration config ) { } } | final Object context = config . getContext ( ) ; Set < Method > methods = config . getListenerTargets ( EventCategory . CLICK ) ; for ( final Method method : methods ) { OnClickListener onClickListener = new OnClickListener ( ) { @ Override public void onClick ( View v ) { try { if ( ! method . isAccessible ( ) ) metho... |
public class TopologyFactory { /** * Instantiates a new Topology instance .
* @ param operatorName specified name of the operator
* @ param topologyClass specified topology type
* @ return Topology instance
* @ throws InjectionException */
public Topology getNewInstance ( final Class < ? extends Name < String >... | final Injector newInjector = injector . forkInjector ( ) ; newInjector . bindVolatileParameter ( OperatorNameClass . class , operatorName ) ; return newInjector . getInstance ( topologyClass ) ; |
public class DefaultSerialSessionConfig { /** * { @ inheritDoc } */
@ Override protected void doSetAll ( IoSessionConfig config ) { } } | if ( config instanceof SerialSessionConfig ) { SerialSessionConfig cfg = ( SerialSessionConfig ) config ; setInputBufferSize ( cfg . getInputBufferSize ( ) ) ; setReceiveThreshold ( cfg . getReceiveThreshold ( ) ) ; } |
public class ComponentsInner { /** * Returns an Application Insights component .
* @ param resourceGroupName The name of the resource group .
* @ param resourceName The name of the Application Insights component resource .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return t... | return getByResourceGroupWithServiceResponseAsync ( resourceGroupName , resourceName ) . map ( new Func1 < ServiceResponse < ApplicationInsightsComponentInner > , ApplicationInsightsComponentInner > ( ) { @ Override public ApplicationInsightsComponentInner call ( ServiceResponse < ApplicationInsightsComponentInner > re... |
public class PutPolicyRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( PutPolicyRequest putPolicyRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( putPolicyRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( putPolicyRequest . getPolicy ( ) , POLICY_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage (... |
public class GridFTPClient { /** * Create a symbolic link on the FTP server .
* @ param link _ target the path to which the symbolic link should point
* @ param link _ name the path of the symbolic link to create
* @ throws IOException
* @ throws ServerException if an error occurred . */
public void createSymbo... | String arguments = link_target . replaceAll ( " " , "%20" ) + " " + link_name ; Command cmd = new Command ( "SITE SYMLINK" , arguments ) ; try { controlChannel . execute ( cmd ) ; } catch ( UnexpectedReplyCodeException urce ) { throw ServerException . embedUnexpectedReplyCodeException ( urce ) ; } catch ( FTPReplyParse... |
public class Cycles { /** * Find all simple cycles in a molecule . The threshold values can not be
* tuned and is set at a value which will complete in reasonable time for
* most molecules . To change the threshold values please use the stand - alone
* { @ link AllCycles } or { @ link org . openscience . cdk . ri... | return all ( ) . find ( container , container . getAtomCount ( ) ) ; |
public class CmsMultiplexReport { /** * This searches for the first instance of a link in the internal delegate list and
* returns the value of it ' s invocation .
* If no such report is found an empty String will be returned .
* @ see org . opencms . report . I _ CmsReport # getReportUpdate ( ) */
public String ... | for ( I_CmsReport report : m_delegates ) { if ( report . getClass ( ) . getName ( ) . toLowerCase ( ) . contains ( "html" ) ) { return report . getReportUpdate ( ) ; } } return "" ; |
public class PnPInfinitesimalPlanePoseEstimation { /** * R _ v is a 3x3 matrix
* R _ v = I + sin ( theta ) * [ k ] _ x + ( 1 - cos ( theta ) ) [ k ] _ x ^ 2 */
void compute_Rv ( ) { } } | double t = Math . sqrt ( v1 * v1 + v2 * v2 ) ; double s = Math . sqrt ( t * t + 1 ) ; double cosT = 1.0 / s ; double sinT = Math . sqrt ( 1 - 1.0 / ( s * s ) ) ; K_x . data [ 0 ] = 0 ; K_x . data [ 1 ] = 0 ; K_x . data [ 2 ] = v1 ; K_x . data [ 3 ] = 0 ; K_x . data [ 4 ] = 0 ; K_x . data [ 5 ] = v2 ; K_x . data [ 6 ] =... |
public class AbsQuery { /** * Order result by the given key , reversing the order .
* Please do not forget to include the content type if you are requesting to order
* by a field .
* @ param key the key to be reversely ordered by .
* @ return the calling query for chaining .
* @ throws IllegalArgumentExceptio... | checkNotEmpty ( key , "Key to order by must not be empty" ) ; if ( key . startsWith ( "fields." ) && ! hasContentTypeSet ( ) ) { throw new IllegalStateException ( "\"fields.\" cannot be used without setting a content type " + "first." ) ; } this . params . put ( PARAMETER_ORDER , "-" + key ) ; return ( Query ) this ; |
public class StreamEx { /** * Returns a stream where the last element is the replaced with the result
* of applying the given function while the other elements are left intact .
* This is a < a href = " package - summary . html # StreamOps " > quasi - intermediate
* operation < / a > .
* The mapper function is ... | return supply ( new PairSpliterator . PSOfRef < > ( mapper , spliterator ( ) , false ) ) ; |
public class RequestDispatcher { /** * Dispatch the request from a client
* @ param jsonPath built { @ link JsonPath } instance which represents the URI sent in the request
* @ param method type of the request e . g . POST , GET , PATCH
* @ param parameterProvider repository method parameter provider
* @ param ... | try { BaseController controller = controllerRegistry . getController ( jsonPath , method ) ; ResourceInformation resourceInformation = getRequestedResource ( jsonPath ) ; QueryAdapter queryAdapter = queryAdapterBuilder . build ( resourceInformation , parameters ) ; DefaultFilterRequestContext context = new DefaultFilte... |
public class Cipher { /** * Returns an AlgorithmParameterSpec object which contains
* the maximum cipher parameter value according to the
* jurisdiction policy file . If JCE unlimited strength jurisdiction
* policy files are installed or there is no maximum limit on the
* parameters for the specified transforma... | // Android - changed : Remove references to CryptoPermission and throw early
// if transformation = = null or isn ' t valid .
// CryptoPermission cp = getConfiguredPermission ( transformation ) ;
// return cp . getAlgorithmParameterSpec ( ) ;
if ( transformation == null ) { throw new NullPointerException ( "transformat... |
public class OpenIabHelper { /** * Discovers Open Stores .
* @ param listener The callback to handle the result with a list of Open Stores */
public void discoverOpenStores ( @ NotNull final OpenStoresDiscoveredListener listener ) { } } | final List < ServiceInfo > serviceInfos = queryOpenStoreServices ( ) ; final Queue < Intent > bindServiceIntents = new LinkedList < Intent > ( ) ; for ( final ServiceInfo serviceInfo : serviceInfos ) { bindServiceIntents . add ( getBindServiceIntent ( serviceInfo ) ) ; } discoverOpenStores ( listener , bindServiceInten... |
public class ProcessCache { /** * Either a specific version number can be specified , or a Smart Version can be specified which designates an allowable range .
* @ see com . centurylink . mdw . model . asset . Asset # meetsVersionSpec ( String ) */
public static Process getProcessSmart ( AssetVersionSpec spec ) throw... | if ( spec . getPackageName ( ) == null ) throw new DataAccessException ( "Spec must be package-qualified: " + spec ) ; Process match = null ; String specQualifiedName = spec . getQualifiedName ( ) ; if ( specQualifiedName . endsWith ( ".proc" ) ) specQualifiedName = specQualifiedName . substring ( 0 , specQualifiedName... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.