signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class EventLocalMap { /** * Check the target row / column for a value . If nothing exists locally
* and a parent map exists , that will be checked .
* @ param row
* @ param column
* @ return V , null if nothing exists */
private V get ( int row , int column ) { } } | if ( null == this . values || row >= this . values . length || null == this . values [ row ] || NO_VALUE == this . values [ row ] [ column ] ) { if ( null != this . parentMap ) { return this . parentMap . get ( row , column ) ; } return null ; } // something exists locally and it ' s not NO _ VALUE , could be null
retu... |
public class CPRuleUserSegmentRelUtil { /** * Removes the cp rule user segment rel with the primary key from the database . Also notifies the appropriate model listeners .
* @ param CPRuleUserSegmentRelId the primary key of the cp rule user segment rel
* @ return the cp rule user segment rel that was removed
* @ ... | return getPersistence ( ) . remove ( CPRuleUserSegmentRelId ) ; |
public class MVELConsequenceBuilder { /** * Allows newlines to demarcate expressions , as per MVEL command line .
* If expression spans multiple lines ( ie inside an unbalanced bracket ) then
* it is left alone .
* Uses character based iteration which is at least an order of magnitude faster then a single
* sim... | StringBuilder result = new StringBuilder ( ) ; char [ ] cs = s . toCharArray ( ) ; int brace = 0 ; int sqre = 0 ; int crly = 0 ; int skippedNewLines = 0 ; boolean inString = false ; char lastNonWhite = ';' ; for ( int i = 0 ; i < cs . length ; i ++ ) { char c = cs [ i ] ; switch ( c ) { case ' ' : case '\t' : if ( ! in... |
public class CLI { /** * Parse the command interface parameters with the argParser .
* @ param args
* the arguments passed through the CLI
* @ throws IOException
* exception if problems with the incoming data
* @ throws JDOMException
* if xml formatting exception */
public final void parseCLI ( final String... | try { this . parsedArguments = this . argParser . parseArgs ( args ) ; System . err . println ( "CLI options: " + this . parsedArguments ) ; if ( args [ 0 ] . equals ( "parse" ) ) { annotate ( System . in , System . out ) ; } else if ( args [ 0 ] . equals ( "eval" ) ) { eval ( ) ; } else if ( args [ 0 ] . equals ( "tra... |
public class FieldInfo { /** * Sets the given field in the given object to the given value using reflection .
* < p > If the field is final , it checks that the value being set is identical to the existing
* value . */
public static void setFieldValue ( Field field , Object obj , Object value ) { } } | if ( Modifier . isFinal ( field . getModifiers ( ) ) ) { Object finalValue = getFieldValue ( field , obj ) ; if ( value == null ? finalValue != null : ! value . equals ( finalValue ) ) { throw new IllegalArgumentException ( "expected final value <" + finalValue + "> but was <" + value + "> on " + field . getName ( ) + ... |
public class PluralCodeGenerator { /** * Maps an integer to each AND condition ' s canonical representation . */
@ SafeVarargs private final Map < String , FieldSpec > buildConditionFields ( Map < String , PluralData > ... pluralMaps ) { } } | Map < String , FieldSpec > index = new LinkedHashMap < > ( ) ; int seq = 0 ; for ( Map < String , PluralData > pluralMap : pluralMaps ) { for ( Map . Entry < String , PluralData > entry : pluralMap . entrySet ( ) ) { PluralData data = entry . getValue ( ) ; // Iterate over the rules , drilling into the OR conditions an... |
public class FtBasic { /** * Make a loop cycle .
* @ param server Server socket
* @ throws IOException If fails */
private void loop ( final ServerSocket server ) throws IOException { } } | try { this . back . accept ( server . accept ( ) ) ; } catch ( final SocketTimeoutException ignored ) { } |
public class ListPresetsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListPresetsRequest listPresetsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( listPresetsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listPresetsRequest . getCategory ( ) , CATEGORY_BINDING ) ; protocolMarshaller . marshall ( listPresetsRequest . getListBy ( ) , LISTBY_BINDING ) ; protocolMarshaller... |
public class ApplicationTemp { /** * Return a sub - directory of the application temp .
* @ param subDir the sub - directory name
* @ return a sub - directory */
public File getDir ( String subDir ) { } } | File dir = new File ( getDir ( ) , subDir ) ; dir . mkdirs ( ) ; return dir ; |
public class ColumnCondition { /** * Collects the column specification for the bind variables of this operation .
* @ param boundNames the list of column specification where to collect the
* bind variables of this term in . */
public void collectMarkerSpecification ( VariableSpecifications boundNames ) { } } | if ( collectionElement != null ) collectionElement . collectMarkerSpecification ( boundNames ) ; if ( operator . equals ( Operator . IN ) && inValues != null ) { for ( Term value : inValues ) value . collectMarkerSpecification ( boundNames ) ; } else { value . collectMarkerSpecification ( boundNames ) ; } |
public class CheckSumUtils { /** * Returns the checksum value of the input stream taking in count the
* algorithm passed in parameter
* @ param is
* the input stream
* @ param algorithm
* the checksum algorithm
* @ return the checksum value
* @ throws IOException
* if an exception occurs . */
public sta... | if ( algorithm . equals ( JawrConstant . CRC32_ALGORITHM ) ) { return getCRC32Checksum ( is ) ; } else if ( algorithm . equals ( JawrConstant . MD5_ALGORITHM ) ) { return getMD5Checksum ( is ) ; } else { throw new BundlingProcessException ( "The checksum algorithm '" + algorithm + "' is not supported.\n" + "The only su... |
public class CweDB { /** * Loads a HashMap containing the CWE data from a resource found in the jar .
* @ return a HashMap of CWE data */
@ SuppressWarnings ( "unchecked" ) private static Map < String , String > loadData ( ) { } } | final String filePath = "data/cwe.hashmap.serialized" ; try ( InputStream input = FileUtils . getResourceAsStream ( filePath ) ; ObjectInputStream oin = new ObjectInputStream ( input ) ) { return ( HashMap < String , String > ) oin . readObject ( ) ; } catch ( ClassNotFoundException ex ) { LOGGER . warn ( "Unable to lo... |
public class AceGenerator { /** * Write a GZIP compressed string to a file .
* This method GZIP compresses a string and writes it to a file . This method
* automatically closes the OutputStream used to create the file .
* @ param dest Destination { @ link File }
* @ param json String to GZIP compress and write ... | FileOutputStream fos = new FileOutputStream ( dest ) ; GZIPOutputStream gos = new GZIPOutputStream ( fos ) ; gos . write ( json . getBytes ( "UTF-8" ) ) ; gos . close ( ) ; fos . close ( ) ; |
public class ValidatorProcessParameters { /** * A { @ link FieldSearchQuery } may be made from a terms string or a query
* string , but not both . */
private FieldSearchQuery assembleFieldSearchQuery ( String query , String terms ) { } } | if ( terms != null ) { return new FieldSearchQuery ( terms ) ; } else { try { return new FieldSearchQuery ( Condition . getConditions ( query ) ) ; } catch ( QueryParseException e ) { throw new ValidatorProcessUsageException ( "Value '" + query + "' of parameter '" + PARAMETER_QUERY + "' is not a valid query string." )... |
public class BaseAmiInfo { /** * Parse an AMI description into its component parts .
* @ param imageDescription description field of an AMI created by Netflix ' s bakery
* @ return bean representing the component parts of the AMI description */
public static BaseAmiInfo parseDescription ( String imageDescription ) ... | BaseAmiInfo info = new BaseAmiInfo ( ) ; if ( imageDescription == null ) { return info ; } info . baseAmiId = extractBaseAmiId ( imageDescription ) ; info . baseAmiName = extractBaseAmiName ( imageDescription ) ; if ( info . baseAmiName != null ) { Matcher dateMatcher = AMI_DATE_PATTERN . matcher ( info . baseAmiName )... |
public class ExpressRouteConnectionsInner { /** * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit .
* @ param resourceGroupName The name of the resource group .
* @ param expressRouteGatewayName The name of the ExpressRoute gateway .
* @ param connectionName The name of the connec... | return createOrUpdateWithServiceResponseAsync ( resourceGroupName , expressRouteGatewayName , connectionName , putExpressRouteConnectionParameters ) . map ( new Func1 < ServiceResponse < ExpressRouteConnectionInner > , ExpressRouteConnectionInner > ( ) { @ Override public ExpressRouteConnectionInner call ( ServiceRespo... |
public class ContentStoreImpl { /** * { @ inheritDoc } */
@ Override public Content getContent ( String spaceId , String contentId , Long startByte , Long endByte ) throws ContentStoreException { } } | // validate args
if ( startByte == null || startByte < 0 ) { throw new IllegalArgumentException ( "startByte must be equal to or greater than zero." ) ; } else if ( endByte != null && endByte <= startByte ) { throw new IllegalArgumentException ( "endByte must be null or greater than the startByte." ) ; } return execute... |
public class CmsSearchParameters { /** * Creates a merged parameter set from this parameters , restricted by the given other parameters . < p >
* This is mainly intended for " search in search result " functions . < p >
* The restricted query is build of the queries of both parameters , appended with AND . < p >
... | // append queries
StringBuffer query = new StringBuffer ( 256 ) ; if ( getQuery ( ) != null ) { // don ' t blow up unnecessary closures ( if CmsSearch is reused and restricted several times )
boolean closure = ! getQuery ( ) . startsWith ( "+(" ) ; if ( closure ) { query . append ( "+(" ) ; } query . append ( getQuery ... |
public class PaymentChannelClient { /** * If this is an ongoing payment channel increase we need to call setException ( ) on its future .
* @ param reason is the reason for aborting
* @ param message is the detailed message */
private void setIncreasePaymentFutureIfNeeded ( PaymentChannelCloseException . CloseReaso... | if ( increasePaymentFuture != null && ! increasePaymentFuture . isDone ( ) ) { increasePaymentFuture . setException ( new PaymentChannelCloseException ( message , reason ) ) ; } |
public class Builder { /** * Returns a new { @ link GeoDistanceSortField } for the specified field .
* @ param field the name of the geo point field mapper to be used for sorting
* @ param latitude the latitude in degrees of the point to min distance sort by
* @ param longitude the longitude in degrees of the poi... | return new GeoDistanceSortField ( field , latitude , longitude ) ; |
public class PubSubManager { /** * Gets the affiliations on the root node .
* @ return List of affiliations
* @ throws XMPPErrorException
* @ throws NoResponseException
* @ throws NotConnectedException
* @ throws InterruptedException */
public List < Affiliation > getAffiliations ( ) throws NoResponseExceptio... | PubSub reply = sendPubsubPacket ( Type . get , new NodeExtension ( PubSubElementType . AFFILIATIONS ) , null ) ; AffiliationsExtension listElem = reply . getExtension ( PubSubElementType . AFFILIATIONS ) ; return listElem . getAffiliations ( ) ; |
public class ExpressionParser { /** * Creates a { @ code Version } instance for the specified integers .
* @ param major
* the major version number
* @ param minor
* the minor version number
* @ param patch
* the patch version number
* @ return the version for the specified integers */
private Version ver... | return Version . forIntegers ( major , minor , patch ) ; |
public class ConfigurationPropertyName { /** * Create a new { @ link ConfigurationPropertyName } by appending the given element
* value .
* @ param elementValue the single element value to append
* @ return a new { @ link ConfigurationPropertyName }
* @ throws InvalidConfigurationPropertyNameException if elemen... | if ( elementValue == null ) { return this ; } Elements additionalElements = probablySingleElementOf ( elementValue ) ; return new ConfigurationPropertyName ( this . elements . append ( additionalElements ) ) ; |
public class Auth { /** * Checks if the user is a known superuser .
* @ param username Username to query .
* @ return true is the user is a superuser , false if they aren ' t or don ' t exist at all . */
public static boolean isSuperuser ( String username ) { } } | UntypedResultSet result = selectUser ( username ) ; return ! result . isEmpty ( ) && result . one ( ) . getBoolean ( "super" ) ; |
public class ptp { /** * Use this API to fetch all the ptp resources that are configured on netscaler . */
public static ptp get ( nitro_service service ) throws Exception { } } | ptp obj = new ptp ( ) ; ptp [ ] response = ( ptp [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ; |
public class WindowRequest { /** * 返回这个窗口的私有属性名加portal主控请求对象共同属性的属性名 */
@ SuppressWarnings ( "unchecked" ) public Enumeration getAttributeNames ( ) { } } | HashSet < String > keys ; synchronized ( mutex ) { keys = new HashSet < String > ( window . getAttributes ( ) . keySet ( ) ) ; Enumeration < String > names = super . getAttributeNames ( ) ; while ( names . hasMoreElements ( ) ) { String name = ( String ) names . nextElement ( ) ; if ( deleteAttributes == null || ! dele... |
public class Node { /** * Validates that at least one pattern was specified , merges all patterns together , and returns the result
* @ param pattern
* @ param patterns
* @ return */
private Pattern [ ] validateAndMergePatternInput ( final Pattern pattern , final Pattern ... patterns ) { } } | // Precondition check
if ( pattern == null ) { throw new IllegalArgumentException ( "At least one pattern must not be specified" ) ; } final List < Pattern > merged = new ArrayList < Pattern > ( ) ; merged . add ( pattern ) ; for ( final Pattern p : patterns ) { merged . add ( p ) ; } return merged . toArray ( PATTERN_... |
public class NetworkServiceRecordAgent { /** * Deletes a specific VirtualNetworkFunctionRecord .
* @ param id the ID of the NetworkServiceRecord containing the VirtualNetworkFunctionRecord
* @ param idVnfr the ID of the VirtualNetworkFunctionRecord to delete
* @ throws SDKException if the request fails */
@ Help ... | String url = id + "/vnfrecords" + "/" + idVnfr ; requestDelete ( url ) ; |
public class AndroidRuntime { /** * Gets the stack trace element that appears before the passed logger class name .
* @ param loggerClassName
* Logger class name that should appear before the expected stack trace element
* @ param trace
* Source stack trace
* @ return Found stack trace element or { @ code nul... | int index = 0 ; while ( index < trace . length && ! loggerClassName . equals ( trace [ index ] . getClassName ( ) ) ) { index = index + 1 ; } while ( index < trace . length && loggerClassName . equals ( trace [ index ] . getClassName ( ) ) ) { index = index + 1 ; } if ( index < trace . length ) { return trace [ index ]... |
public class App { /** * Returns a map of user - defined data types and their validation annotations .
* @ return the constraints map */
public Map < String , Map < String , Map < String , Map < String , ? > > > > getValidationConstraints ( ) { } } | if ( validationConstraints == null ) { validationConstraints = new LinkedHashMap < > ( ) ; } return validationConstraints ; |
public class OpenPgpPubSubUtil { /** * Fetch the latest { @ link SecretkeyElement } from the private backup node .
* @ see < a href = " https : / / xmpp . org / extensions / xep - 0373 . html # synchro - pep " >
* XEP - 0373 § 5 . Synchronizing the Secret Key with a Private PEP Node < / a >
* @ param pepManager t... | PubSubManager pm = pepManager . getPepPubSubManager ( ) ; LeafNode secretKeyNode = pm . getOrCreateLeafNode ( PEP_NODE_SECRET_KEY ) ; List < PayloadItem < SecretkeyElement > > list = secretKeyNode . getItems ( 1 ) ; if ( list . size ( ) == 0 ) { LOGGER . log ( Level . INFO , "No secret key published!" ) ; return null ;... |
public class ObjectArrayList { /** * Determines whether the receiver is sorted ascending , according to the < i > natural ordering < / i > of its
* elements . All elements in this range must implement the
* < tt > Comparable < / tt > interface . Furthermore , all elements in this range
* must be < i > mutually co... | if ( size == 0 ) return true ; checkRangeFromTo ( from , to , size ) ; Object [ ] theElements = elements ; for ( int i = from + 1 ; i <= to ; i ++ ) { if ( ( ( Comparable ) theElements [ i ] ) . compareTo ( ( Comparable ) theElements [ i - 1 ] ) < 0 ) return false ; } return true ; |
public class PrcAdditionCostLineSave { /** * < p > Insert immutable line into DB . < / p >
* @ param pAddParam additional param
* @ param pEntity entity
* @ throws Exception - an exception */
public final void updateOwner ( final Map < String , Object > pAddParam , final AdditionCostLine pEntity ) throws Exceptio... | String query = "select sum(ITSTOTAL) as ITSTOTAL from" + " ADDITIONCOSTLINE where ITSOWNER=" + pEntity . getItsOwner ( ) . getItsId ( ) ; Double total = getSrvDatabase ( ) . evalDoubleResult ( query , "ITSTOTAL" ) ; pEntity . getItsOwner ( ) . setTotalAdditionCost ( BigDecimal . valueOf ( total ) . setScale ( getSrvAcc... |
public class MACUtil { /** * Get all the MAC addresses of the hardware we are running on that we can find . */
public static String [ ] getMACAddresses ( ) { } } | String [ ] cmds ; if ( RunAnywhere . isWindows ( ) ) { cmds = WINDOWS_CMDS ; } else { cmds = UNIX_CMDS ; } return parseMACs ( tryCommands ( cmds ) ) ; |
public class Option { /** * Define a default value for the option .
* @ param defaultValue - the default value
* @ return the updated Option
* @ throws RequiredParametersException if the list of possible values for the parameter is not empty and the default
* value passed is not in the list . */
public Option d... | if ( this . choices . isEmpty ( ) ) { return this . setDefaultValue ( defaultValue ) ; } else { if ( this . choices . contains ( defaultValue ) ) { return this . setDefaultValue ( defaultValue ) ; } else { throw new RequiredParametersException ( "Default value " + defaultValue + " is not in the list of valid values for... |
public class CacheKeyUtils { /** * 生成缓存key
* @ param prefix
* @ param args
* @ return */
public static String generate ( String prefix , Object ... args ) { } } | if ( args == null || args . length == 0 ) return prefix ; StringBuilder keyBuilder = new StringBuilder ( prefix ) ; String keyString = null ; if ( args != null && args . length > 0 ) { keyBuilder . append ( ":" ) ; StringBuilder argsBuilder = new StringBuilder ( ) ; for ( int i = 0 ; i < args . length ; i ++ ) { if ( a... |
public class SftpSubsystemChannel { /** * Post a read request to the server and return the request id ; this is used
* to optimize file downloads . In normal operation the files are transfered
* by using a synchronous set of requests , however this slows the download
* as the client has to wait for the servers re... | try { UnsignedInteger32 requestId = nextRequestId ( ) ; Packet msg = createPacket ( ) ; msg . write ( SSH_FXP_READ ) ; msg . writeInt ( requestId . longValue ( ) ) ; msg . writeBinaryString ( handle ) ; msg . writeUINT64 ( offset ) ; msg . writeInt ( len ) ; sendMessage ( msg ) ; return requestId ; } catch ( SshIOExcep... |
public class JarClassLoader { /** * Loads the { @ link Class } for the supplied class name .
* @ throws ClassNotFoundException If the class for the supplied name can ' t be found */
@ Override public Class < ? > loadClass ( final String aName ) throws ClassNotFoundException { } } | Class < ? > loadedClass = findLoadedClass ( aName ) ; if ( loadedClass == null ) { try { loadedClass = findClass ( aName ) ; } catch ( final ClassNotFoundException details ) { LOGGER . trace ( "Class for {} not found... trying super class" , aName , details ) ; loadedClass = super . loadClass ( aName ) ; } } return loa... |
public class StanfordNNDepParser { /** * 4 . Dependency Label */
private GrammaticalStructure tagDependencies ( List < ? extends HasWord > taggedWords ) { } } | GrammaticalStructure gs = nndepParser . predict ( taggedWords ) ; return gs ; |
public class ActualRequestHandler { /** * Checks if the origin is allowed
* @ param request
* @ param config */
private String checkOriginHeader ( HttpServletRequest request , JCorsConfig config ) { } } | String originHeader = request . getHeader ( CorsHeaders . ORIGIN_HEADER ) ; Constraint . ensureNotEmpty ( originHeader , "Cross-Origin requests must specify an Origin Header" ) ; String [ ] origins = originHeader . split ( " " ) ; for ( String origin : origins ) { Constraint . ensureTrue ( config . isOriginAllowed ( or... |
public class EventServicesImpl { /** * Returns the process instances by process name and master request ID .
* @ param processName
* @ param masterRequestId
* @ return the list of process instances . If the process definition is not found , null
* is returned ; if process definition is found but no process inst... | TransactionWrapper transaction = null ; EngineDataAccessDB edao = new EngineDataAccessDB ( ) ; try { Process procdef = ProcessCache . getProcess ( processName , 0 ) ; if ( procdef == null ) return null ; transaction = edao . startTransaction ( ) ; return edao . getProcessInstancesByMasterRequestId ( masterRequestId , p... |
public class LabelParameterVersionRequest { /** * One or more labels to attach to the specified parameter version .
* @ return One or more labels to attach to the specified parameter version . */
public java . util . List < String > getLabels ( ) { } } | if ( labels == null ) { labels = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return labels ; |
public class Chars { /** * @ param str
* @ return 字符类型序列 */
public static String getTypeString ( String str ) { } } | CharType [ ] tag = getType ( str ) ; String s = type2String ( tag ) ; return s ; |
public class BinaryArrayWeakHeap { /** * Join two weak heaps into one .
* @ param i
* root of the first weak heap
* @ param j
* root of the second weak heap
* @ return true if already a weak heap , false if a flip was needed */
protected boolean joinWithComparator ( int i , int j ) { } } | if ( comparator . compare ( array [ j ] , array [ i ] ) < 0 ) { K tmp = array [ i ] ; array [ i ] = array [ j ] ; array [ j ] = tmp ; reverse . flip ( j ) ; return false ; } return true ; |
public class ListSigningJobsResult { /** * A list of your signing jobs .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setJobs ( java . util . Collection ) } or { @ link # withJobs ( java . util . Collection ) } if you want to override the
* existing valu... | if ( this . jobs == null ) { setJobs ( new java . util . ArrayList < SigningJob > ( jobs . length ) ) ; } for ( SigningJob ele : jobs ) { this . jobs . add ( ele ) ; } return this ; |
public class CurseFilter { /** * Return a comicy replacement of the specified length . */
public static String comicChars ( int length ) { } } | char [ ] chars = new char [ length ] ; for ( int ii = 0 ; ii < length ; ii ++ ) { chars [ ii ] = RandomUtil . pickRandom ( COMIC_CHARS ) ; } return new String ( chars ) ; |
public class ECKey { /** * Signs the given hash and returns the R and S components as BigIntegers and
* put them in ECDSASignature
* @ param input
* to sign
* @ return ECDSASignature signature that contains the R and S components */
public ECDSASignature doSign ( byte [ ] input ) { } } | if ( input . length != 32 ) { throw new IllegalArgumentException ( "Expected 32 byte input to ECDSA signature, not " + input . length ) ; } // No decryption of private key required .
if ( privKey == null ) throw new MissingPrivateKeyException ( ) ; if ( privKey instanceof BCECPrivateKey ) { ECDSASigner signer = new ECD... |
public class ModelAdapter { /** * Translates received messages through message query to chat SDK model .
* @ param messagesReceived Foundation message objects .
* @ return Chat SDK message objects . */
public List < ChatMessage > adaptMessages ( List < MessageReceived > messagesReceived ) { } } | List < ChatMessage > chatMessages = new ArrayList < > ( ) ; if ( messagesReceived != null ) { for ( MessageReceived msg : messagesReceived ) { ChatMessage adaptedMessage = ChatMessage . builder ( ) . populate ( msg ) . build ( ) ; List < ChatMessageStatus > adaptedStatuses = adaptStatuses ( msg . getConversationId ( ) ... |
public class ClockInterval { /** * / * [ deutsch ]
* < p > Interpretiert den angegebenen Text als Intervall mit Hilfe eines lokalisierten
* Intervallmusters . < / p >
* < p > Falls der angegebene Formatierer keine Referenz zu einer Sprach - und L & auml ; ndereinstellung hat , wird
* das Intervallmuster & quot ... | return parse ( text , parser , IsoInterval . getIntervalPattern ( parser ) ) ; |
public class TransletRuleRegistry { /** * Returns the translet name of the prefix and suffix are combined .
* @ param transletName the translet name
* @ param absolutely whether to allow absolutely name for translet
* @ return the new translet name */
public String applyTransletNamePattern ( String transletName ,... | DefaultSettings defaultSettings = assistantLocal . getDefaultSettings ( ) ; if ( defaultSettings == null ) { return transletName ; } if ( StringUtils . startsWith ( transletName , ActivityContext . NAME_SEPARATOR_CHAR ) ) { if ( absolutely ) { return transletName ; } transletName = transletName . substring ( 1 ) ; } if... |
public class Cartographer { /** * Serializes the map into it ' s json representation into the provided { @ link Writer } . If you want
* to retrieve the json as a string , use { @ link # toJson ( Map ) } instead . */
public void toJson ( Map < ? , ? > map , Writer writer ) throws IOException { } } | if ( map == null ) { throw new IllegalArgumentException ( "map == null" ) ; } if ( writer == null ) { throw new IllegalArgumentException ( "writer == null" ) ; } JsonWriter jsonWriter = new JsonWriter ( writer ) ; jsonWriter . setLenient ( isLenient ) ; if ( prettyPrint ) { jsonWriter . setIndent ( " " ) ; } try { map... |
public class AddConstructors { /** * Adds the constructor by key reference to the node type . */
private void addConstructorByKeyRef ( ) { } } | context . constructorByKeyRef = MethodSpec . constructorBuilder ( ) . addParameter ( keyRefSpec ) ; addCommonParameters ( context . constructorByKeyRef ) ; if ( isBaseClass ( ) ) { assignKeyRefAndValue ( ) ; } else { callParentByKeyRef ( ) ; } |
public class AStar { /** * Add listener on A * algorithm events .
* @ param listener the listener . */
public void addAStarListener ( AStarListener < ST , PT > listener ) { } } | if ( this . listeners == null ) { this . listeners = new ArrayList < > ( ) ; } this . listeners . add ( listener ) ; |
public class Scanner { /** * the default is left untouched . */
private void setRadix ( int radix ) { } } | // Android - changed : Complain loudly if a bogus radix is being set .
if ( radix > Character . MAX_RADIX ) { throw new IllegalArgumentException ( "radix == " + radix ) ; } if ( this . radix != radix ) { // Force rebuilding and recompilation of radix dependent patterns
integerPattern = null ; this . radix = radix ; } |
public class XMLGregorianCalendar { /** * < p > Return millisecond precision of { @ link # getFractionalSecond ( ) } . < / p >
* < p > This method represents a convenience accessor to infinite
* precision fractional second value returned by
* { @ link # getFractionalSecond ( ) } . The returned value is the rounde... | BigDecimal fractionalSeconds = getFractionalSecond ( ) ; // is field undefined ?
if ( fractionalSeconds == null ) { return DatatypeConstants . FIELD_UNDEFINED ; } return getFractionalSecond ( ) . movePointRight ( 3 ) . intValue ( ) ; |
public class PropertyWidgetFactoryImpl { /** * Creates ( and registers ) a widget that fits the specified configured
* property .
* @ param propertyDescriptor
* @ return */
@ Override public PropertyWidget < ? > create ( final ConfiguredPropertyDescriptor propertyDescriptor ) { } } | // first check if there is a mapping created for this property
// descriptor
final PropertyWidget < ? > propertyWidget = _propertyWidgetCollection . getMappedPropertyWidget ( propertyDescriptor ) ; if ( propertyWidget != null ) { return propertyWidget ; } final HiddenProperty hiddenProperty = propertyDescriptor . getAn... |
public class SourceFile { /** * Returns true if the supplied text appears in the non - auto - generated section . */
public boolean containsString ( String text ) { } } | for ( int ii = 0 , nn = _lines . size ( ) ; ii < nn ; ii ++ ) { // don ' t look inside the autogenerated areas
if ( ! ( ii >= _nstart && ii < _nend ) && ! ( ii >= _mstart && ii < _mend ) && _lines . get ( ii ) . contains ( text ) ) { return true ; } } return false ; |
public class BasePanel { /** * This is a special method that runs some code when this screen is opened as a task . */
public void run ( ) { } } | int iSFieldCount = this . getSFieldCount ( ) ; // Keep out of loop because of chance of free ( ) during run ( )
for ( int iFieldSeq = 0 ; iFieldSeq < iSFieldCount ; iFieldSeq ++ ) { // See if any of my children want to handle this command
ScreenField sField = this . getSField ( iFieldSeq ) ; if ( sField instanceof Base... |
public class RoaringArray { /** * Append the values from another array , no copy is made ( use with care )
* @ param sa other array
* @ param startingIndex starting index in the other array
* @ param end endingIndex ( exclusive ) in the other array */
protected void append ( RoaringArray sa , int startingIndex , ... | extendArray ( end - startingIndex ) ; for ( int i = startingIndex ; i < end ; ++ i ) { this . keys [ this . size ] = sa . keys [ i ] ; this . values [ this . size ] = sa . values [ i ] ; this . size ++ ; } |
public class PackageProcessor { /** * ( non - Javadoc )
* @ see org . osgi . util . tracker . BundleTrackerCustomizer # addingBundle ( org . osgi . framework . Bundle , org . osgi . framework . BundleEvent ) */
@ Override public Object addingBundle ( Bundle bundle , BundleEvent event ) { } } | // Packages become available on resolution , so take that as the state we care about
// ignore gateway bundles
if ( ! isGateway ( bundle ) ) { /* * Make sure privatePackages isn ' t null .
* If new bundles arrive while we ' re still populating our package list , we ' ll go through all bundles twice ,
* but at least... |
public class SimpleBlas { /** * Compute c < - a * b + beta * c ( general matrix matrix
* multiplication ) */
public static FloatMatrix gemm ( float alpha , FloatMatrix a , FloatMatrix b , float beta , FloatMatrix c ) { } } | NativeBlas . sgemm ( 'N' , 'N' , c . rows , c . columns , a . columns , alpha , a . data , 0 , a . rows , b . data , 0 , b . rows , beta , c . data , 0 , c . rows ) ; return c ; |
public class GoogleAppEngineControlFilter { /** * { @ inheritDoc } */
@ Override protected Client createClient ( String configServiceName ) throws GeneralSecurityException , IOException { } } | return new Client . Builder ( configServiceName ) . setStatsLogFrequency ( statsLogFrequency ( ) ) . setHttpTransport ( UrlFetchTransport . getDefaultInstance ( ) ) . setFactory ( ThreadManager . backgroundThreadFactory ( ) ) . build ( ) ; |
public class FullscreenVideoView { /** * Try to call state PREPARED
* Only if SurfaceView is already created and MediaPlayer is prepared
* Video is loaded and is ok to play . */
protected void tryToPrepare ( ) { } } | Log . d ( TAG , "tryToPrepare" ) ; if ( this . surfaceIsReady && this . videoIsReady ) { if ( this . mediaPlayer != null && this . mediaPlayer . getVideoWidth ( ) != 0 && this . mediaPlayer . getVideoHeight ( ) != 0 ) { this . initialMovieWidth = this . mediaPlayer . getVideoWidth ( ) ; this . initialMovieHeight = this... |
public class PageFlowUtils { /** * Get or create the current { @ link GlobalApp } instance .
* @ deprecated Use { @ link # getGlobalApp } instead .
* @ param request the current HttpServletRequest .
* @ param response the current HttpServletResponse
* @ return the current { @ link GlobalApp } from the user sess... | ServletContext servletContext = InternalUtils . getServletContext ( request ) ; return ensureGlobalApp ( request , response , servletContext ) ; |
public class DBFRow { /** * Reads the data as Float
* @ param columnIndex
* columnIndex
* @ return the data as Float */
public float getFloat ( int columnIndex ) { } } | Object fieldValue = data [ columnIndex ] ; if ( fieldValue == null ) { return 0.0f ; } if ( fieldValue instanceof Number ) { return ( ( Number ) fieldValue ) . floatValue ( ) ; } throw new DBFException ( "Unsupported type for Number at column:" + columnIndex + " " + fieldValue . getClass ( ) . getCanonicalName ( ) ) ; |
public class InmemCounter { /** * { @ inheritDoc } */
@ Override public void set ( long timestampMs , long value ) { } } | long key = toTimeSeriesPoint ( timestampMs ) ; counter . put ( key , value ) ; if ( counter . size ( ) > maxNumBlocks ) { reduce ( ) ; } |
public class EngineeringObjectEnhancer { /** * Converts a list of SimpleModelWrapper objects to a list of OpenEngSBModel objects */
private List < OpenEngSBModel > convertSimpleModelWrapperList ( List < AdvancedModelWrapper > wrappers ) { } } | List < OpenEngSBModel > models = new ArrayList < OpenEngSBModel > ( ) ; for ( AdvancedModelWrapper wrapper : wrappers ) { models . add ( wrapper . getUnderlyingModel ( ) ) ; } return models ; |
public class Stream { /** * Put the stream in try - catch to stop the back - end reading thread if error happens
* < br / >
* < code >
* try ( Stream < Integer > stream = Stream . parallelConcat ( a , b , . . . ) ) {
* stream . forEach ( N : : println ) ;
* < / code >
* @ param c
* @ return */
public stat... | return parallelConcat ( c , DEFAULT_READING_THREAD_NUM ) ; |
public class IndexedElementsBinder { /** * Bind indexed elements to the supplied collection .
* @ param name the name of the property to bind
* @ param target the target bindable
* @ param elementBinder the binder to use for elements
* @ param aggregateType the aggregate type , may be a collection or an array
... | for ( ConfigurationPropertySource source : getContext ( ) . getSources ( ) ) { bindIndexed ( source , name , target , elementBinder , result , aggregateType , elementType ) ; if ( result . wasSupplied ( ) && result . get ( ) != null ) { return ; } } |
public class CmsVfsBundleManager { /** * Collects all locales possibly used in the system . < p >
* @ return the collection of all locales */
private static Collection < Locale > getAllLocales ( ) { } } | Set < Locale > result = new HashSet < Locale > ( ) ; result . addAll ( OpenCms . getWorkplaceManager ( ) . getLocales ( ) ) ; result . addAll ( OpenCms . getLocaleManager ( ) . getAvailableLocales ( ) ) ; return result ; |
public class CleaneLingStyleSolver { /** * Returns { @ code true } if the current clause is a trivial clause , { @ code false } otherwise .
* @ return { @ code true } if the current clause is a trivial clause */
protected boolean trivialClause ( ) { } } | boolean res = false ; final LNGIntVector newAddedLits = new LNGIntVector ( this . addedlits . size ( ) ) ; for ( int i = 0 ; i < this . addedlits . size ( ) ; i ++ ) { final int lit = this . addedlits . get ( i ) ; assert lit != 0 ; final int m = marked ( lit ) ; if ( m < 0 ) { res = true ; break ; } else if ( m == 0 )... |
public class RestServiceExceptionFacade { /** * Create a response message as a JSON - String from the given parts .
* @ param status is the HTTP { @ link Status } .
* @ param error is the catched or wrapped { @ link NlsRuntimeException } .
* @ param message is the JSON message attribute .
* @ param code is the ... | return createResponse ( status , message , code , error . getUuid ( ) , errorsMap ) ; |
public class DragableArea { /** * Enable capturing of ' mousemove ' and ' mouseup ' events . */
protected void enableStop ( ) { } } | EventTarget targ = svgp . getDocument ( ) . getRootElement ( ) ; targ . addEventListener ( SVGConstants . SVG_EVENT_MOUSEMOVE , this , false ) ; targ . addEventListener ( SVGConstants . SVG_EVENT_MOUSEUP , this , false ) ; // FIXME : listen on the background object !
targ . addEventListener ( SVGConstants . SVG_EVENT_M... |
public class AbstractLogger { /** * Log a message at fatal level .
* @ param message the message to log
* @ param exception the exception that caused the message to be generated */
public void fatal ( Object message , Throwable exception ) { } } | log ( Level . FATAL , message , exception ) ; |
public class Calendar { /** * Create CalendarPeriodAssociative using an adding function . < br >
* PeriodAssociative are periods associated with an integer , result of the
* add function .
* @ param periodsAndValues
* @ param addFunction
* @ return CalendarPeriodAssociative */
public < T > CalendarPeriodAssoc... | if ( trees . size ( ) != values . size ( ) ) { assert false : "Calendar.MakeUpCalendarPeriodAssociative : trees and values should have the same size !" ; return null ; } int nbPeriod = trees . size ( ) ; if ( nbPeriod == 0 ) return new CalendarPeriodAssociative < T > ( ) ; // get the first non empty period
CalendarPeri... |
public class HtmlWriter { /** * Generates HTML Output for a { @ link Template } . */
private static String templateToHtml ( Template t ) { } } | if ( t == null ) { return "null" ; } StringBuilder result = new StringBuilder ( ) ; result . append ( "<table class=\"Template\">\n" + "<tr><th class=\"Template\">Template</th></tr>\n" + "<tr><td class=\"Template\">" + "Name: \"" + convertTags ( t . getName ( ) ) + "\"<br>" + "</td></tr>\n" ) ; if ( t . getParameters (... |
public class CmsBasicDialog { /** * Sets the window which contains this dialog to full height with a given minimal height in pixel . < p >
* @ param minHeight minimal height in pixel */
public void setWindowMinFullHeight ( int minHeight ) { } } | Window window = CmsVaadinUtils . getWindow ( this ) ; if ( window == null ) { return ; } window . setHeight ( "90%" ) ; setHeight ( "100%" ) ; setContentMinHeight ( minHeight ) ; window . center ( ) ; |
public class TaskScheduler { /** * Start this task running in this thread .
* @ param objJobDef The job to run in this thread . */
@ SuppressWarnings ( { } } | "rawtypes" , "unchecked" } ) public void runThread ( Object objJobDef ) { if ( objJobDef instanceof Task ) { Task task = ( Task ) objJobDef ; if ( task . getApplication ( ) == null ) // init ( ) ed yet ?
task . initTask ( this . getApplication ( ) , null ) ; // No , Initialize it
task . run ( ) ; } else if ( ( objJobDe... |
public class EncodingGetRequest { /** * 对参数值进行编码 */
@ Override public String getParameter ( String name ) { } } | if ( this . charset . equalsIgnoreCase ( this . originCharset ) ) { return super . getParameter ( name ) ; } String value = super . getParameter ( name ) ; if ( value == null ) { return null ; } try { value = new String ( value . getBytes ( this . originCharset ) , this . charset ) ; } catch ( UnsupportedEncodingExcept... |
public class VirtualFileSystem { /** * Returns { @ linkplain InputStream } to read contents of the specified file from the beginning .
* @ param txn { @ linkplain Transaction } instance
* @ param file { @ linkplain File } instance
* @ return { @ linkplain java . io . InputStream } to read contents of the specifie... | return new VfsInputStream ( this , txn , file . getDescriptor ( ) ) ; |
public class FileBasedExtractor { /** * Closes the current file being read . */
public void closeCurrentFile ( ) { } } | try { this . closer . close ( ) ; } catch ( IOException e ) { if ( this . currentFile != null ) { LOG . error ( "Failed to close file: " + this . currentFile , e ) ; } } |
public class DialogRootView { /** * Initializes the view . */
private void initialize ( ) { } } | scrollableArea = ScrollableArea . create ( null , null ) ; showDividersOnScroll = true ; dividerColor = ContextCompat . getColor ( getContext ( ) , R . color . divider_color_light ) ; dividerMargin = 0 ; dialogPadding = new int [ ] { 0 , 0 , 0 , 0 } ; paint = new Paint ( ) ; paint . setXfermode ( new PorterDuffXfermode... |
public class LDLTFactorization { /** * Solves Q . x = b
* @ param b vector
* @ return the solution x
* @ see " S . Boyd and L . Vandenberghe , Convex Optimization , p . 672" */
public DoubleMatrix1D solve ( DoubleMatrix1D b ) { } } | if ( b . size ( ) != dim ) { log . error ( "wrong dimension of vector b: expected " + dim + ", actual " + b . size ( ) ) ; throw new RuntimeException ( "wrong dimension of vector b: expected " + dim + ", actual " + b . size ( ) ) ; } // with scaling , we must solve U . Q . U . z = U . b , after that we have x = U . z
i... |
public class SingleItemModelListener { /** * { @ inheritDoc } */
@ SuppressWarnings ( "unchecked" ) @ Override public void itemStateChanged ( final ItemEvent e ) { } } | final ItemSelectable is = e . getItemSelectable ( ) ; final Object selected [ ] = is . getSelectedObjects ( ) ; final T selectedItem = ( selected . length == 0 ) ? null : ( T ) selected [ 0 ] ; System . out . println ( selectedItem ) ; model . setObject ( selectedItem ) ; |
public class InvocationManager { /** * Registers the supplied invocation dispatcher , returning a marshaller that can be used to
* send requests to the provider for whom the dispatcher is proxying .
* @ param dispatcher the dispatcher to be registered . */
public < T extends InvocationMarshaller < ? > > T registerD... | return registerDispatcher ( dispatcher , null ) ; |
public class ENU { /** * Converts an Earth - Centered Earth - Fixed ( ECEF ) coordinate to ENU .
* @ param cEcef the ECEF coordinate .
* @ return the ENU coordinate .
* @ throws MatrixException */
public Coordinate ecefToEnu ( Coordinate cEcef ) { } } | double deltaX = cEcef . x - _ecefROriginX ; double deltaY = cEcef . y - _ecefROriginY ; double deltaZ = cEcef . z - _ecefROriginZ ; double [ ] [ ] deltas = new double [ ] [ ] { { deltaX } , { deltaY } , { deltaZ } } ; RealMatrix deltaMatrix = MatrixUtils . createRealMatrix ( deltas ) ; RealMatrix enuMatrix = _rotationM... |
public class RedBlackTree { /** * to the queue */
private void keys ( RedBlackTreeNode < Key , Value > x , Queue < Key > queue , Key lo , Key hi ) { } } | if ( x == null ) return ; int cmplo = lo . compareTo ( x . getKey ( ) ) ; int cmphi = hi . compareTo ( x . getKey ( ) ) ; if ( cmplo < 0 ) keys ( x . getLeft ( ) , queue , lo , hi ) ; if ( cmplo <= 0 && cmphi >= 0 ) queue . offer ( x . getKey ( ) ) ; if ( cmphi > 0 ) keys ( x . getRight ( ) , queue , lo , hi ) ; |
public class SyncRecordMessageFilterHandler { /** * Update the listener to listen for changes to the following record . */
public void updateListener ( Object bookmark ) { } } | if ( m_recordMessageFilter != null ) { if ( bookmark == null ) bookmark = NO_BOOKMARK ; Hashtable < String , Object > properties = new Hashtable < String , Object > ( ) ; properties . put ( DBConstants . STRING_OBJECT_ID_HANDLE , bookmark ) ; m_recordMessageFilter . updateFilterTree ( properties ) ; } |
public class JSDocInfo { /** * Documents a reference ( i . e . adds a " see " reference to the list ) . */
boolean documentReference ( String reference ) { } } | if ( ! lazyInitDocumentation ( ) ) { return true ; } if ( documentation . sees == null ) { documentation . sees = new ArrayList < > ( ) ; } documentation . sees . add ( reference ) ; return true ; |
public class CmsResourceTypeXmlContainerPage { /** * Returns the container - page type id , but returns - 1 instead of throwing an exception when an error happens . < p >
* @ return the container - page type id */
public static int getContainerPageTypeIdSafely ( ) { } } | try { return getContainerPageTypeId ( ) ; } catch ( CmsLoaderException e ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( e . getLocalizedMessage ( ) , e ) ; } return - 1 ; } |
public class ComponentProxy { /** * < p > isGetOverwritesMethod . < / p >
* @ param method a { @ link java . lang . reflect . Method } object .
* @ return a boolean . */
protected static boolean isGetOverwritesMethod ( Method method ) { } } | return method . getReturnType ( ) == Map . class && method . getParameterTypes ( ) . length == 0 && method . getName ( ) . equals ( "getOverwrites" ) ; |
public class JoinPoint { /** * Shortcut method to create a JoinPoint waiting for the given tasks , < b > the JoinPoint is started by this method . < / b >
* If any task has error or is cancelled , the join point is immediately unblocked , even other tasks are still pending . */
public static JoinPoint < Exception > f... | JoinPoint < Exception > jp = new JoinPoint < > ( ) ; for ( Task < ? , ? > task : tasks ) jp . addToJoin ( task . getOutput ( ) ) ; jp . start ( ) ; return jp ; |
public class Predicates { /** * Factory for ' and ' and ' or ' predicates . */
private static Predicate join ( final String joinWord , final List < Predicate > preds ) { } } | return new Predicate ( ) { public void init ( AbstractSqlCreator creator ) { for ( Predicate p : preds ) { p . init ( creator ) ; } } public String toSql ( ) { StringBuilder sb = new StringBuilder ( ) . append ( "(" ) ; boolean first = true ; for ( Predicate p : preds ) { if ( ! first ) { sb . append ( " " ) . append (... |
public class RpcInternalContext { /** * set local address .
* @ param host the host
* @ param port the port
* @ return context local address */
@ Deprecated public RpcInternalContext setLocalAddress ( String host , int port ) { } } | if ( host == null ) { return this ; } if ( port < 0 || port > 0xFFFF ) { port = 0 ; } // 提前检查是否为空 , 防止createUnresolved抛出异常 , 损耗性能
this . localAddress = InetSocketAddress . createUnresolved ( host , port ) ; return this ; |
public class Utils { /** * Throws a { @ link NullPointerException } if the given object is null . */
@ NonNull public static < T > T assertNotNull ( T object , String item ) { } } | if ( object == null ) { throw new NullPointerException ( item + " == null" ) ; } return object ; |
public class Log { /** * / * DEBUG */
public static void debug ( String msg ) { } } | log ( null , LEVEL_DEBUG , msg , null , null , null , null , null , null , null , null , null , null , null , null , null , null , 0 ) ; |
public class DescribeLoadBalancerAttributesResult { /** * Information about the load balancer attributes .
* @ param attributes
* Information about the load balancer attributes . */
public void setAttributes ( java . util . Collection < LoadBalancerAttribute > attributes ) { } } | if ( attributes == null ) { this . attributes = null ; return ; } this . attributes = new java . util . ArrayList < LoadBalancerAttribute > ( attributes ) ; |
public class ClusterManager { /** * reset current viewport , re - cluster the items when zoom has changed , else
* add not clustered items . */
private synchronized void resetViewport ( boolean isMoving ) { } } | isClustering = true ; clusterTask = new ClusterTask ( ) ; clusterTask . execute ( new Boolean [ ] { isMoving } ) ; |
public class SpeakUtil { /** * Sends a system ATTENTION message notification to the specified object with the supplied
* message content . A system message is one that will be rendered where the speak messages are
* rendered , but in a way that makes it clear that it is a message from the server .
* Attention mes... | sendSystem ( speakObj , bundle , message , SystemMessage . ATTENTION ) ; |
public class BelatedCreator { /** * Returns real or bogus object . If real object is returned , then future
* invocations of this method return the same real object instance . This
* method waits for the real object to be created , if it is blocked . If
* real object creation fails immediately , then this method ... | if ( mReal != null ) { return mReal ; } if ( mBogus != null && mMinRetryDelayMillis < 0 ) { return mBogus ; } if ( mCreateThread == null ) { mCreateThread = new CreateThread ( ) ; cThreadPool . submit ( mCreateThread ) ; } if ( timeoutMillis != 0 ) { final long start = System . nanoTime ( ) ; try { if ( timeoutMillis <... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.