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 return this . values [ row ] [ column ] ;
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 * @ throws NoSuchCPRuleUserSegmentRelException if a cp rule user segment rel with the primary key could not be found */ public static CPRuleUserSegmentRel remove ( long CPRuleUserSegmentRelId ) throws com . liferay . commerce . product . exception . NoSuchCPRuleUserSegmentRelException { } }
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 * simple regex . */ public static String delimitExpressions ( String s ) { } }
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 ( ! inString && lookAhead ( cs , i + 1 ) == '.' ) { continue ; } break ; case '\"' : if ( i == 0 || cs [ i - 1 ] != '\\' ) { inString = ! inString ; } break ; case '/' : if ( i < cs . length - 1 && cs [ i + 1 ] == '*' && ! inString ) { // multi - line comment int start = i ; i += 2 ; // skip the / * for ( ; i < cs . length ; i ++ ) { if ( cs [ i ] == '*' && i < cs . length - 1 && cs [ i + 1 ] == '/' ) { i ++ ; // skip the * / break ; } else if ( cs [ i ] == '\n' || cs [ i ] == '\r' ) { lastNonWhite = checkAndAddSemiColon ( result , inString , brace , sqre , crly , lastNonWhite ) ; } } result . append ( cs , start , i - start ) ; break ; } else if ( i < cs . length - 1 && cs [ i + 1 ] != '/' ) { // not a line comment break ; } // otherwise handle it in the same way as # case '#' : // line comment lastNonWhite = checkAndAddSemiColon ( result , inString , brace , sqre , crly , lastNonWhite ) ; if ( inString ) { result . append ( c ) ; } else { i = processLineComment ( cs , i , result ) ; } continue ; case '(' : brace ++ ; break ; case '{' : crly ++ ; break ; case '[' : sqre ++ ; break ; case ')' : brace -- ; break ; case '}' : crly -- ; break ; case ']' : sqre -- ; break ; default : break ; } if ( c == '\n' || c == '\r' ) { // line break if ( brace == 0 && sqre == 0 && crly == 0 && lastNonWhite != '.' && lookAhead ( cs , i + 1 ) != '.' ) { if ( lastNonWhite != ';' ) { result . append ( ';' ) ; lastNonWhite = ';' ; } for ( int j = 0 ; j < skippedNewLines ; j ++ ) { result . append ( "\n" ) ; } skippedNewLines = 0 ; } else { skippedNewLines ++ ; continue ; } } else if ( ! Character . isWhitespace ( c ) ) { lastNonWhite = c ; } result . append ( c ) ; } for ( int i = 0 ; i < skippedNewLines ; i ++ ) { result . append ( "\n" ) ; } return result . toString ( ) ;
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 [ ] args ) throws IOException , JDOMException { } }
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 ( "train" ) ) { train ( ) ; } else if ( args [ 0 ] . equals ( "server" ) ) { server ( ) ; } else if ( args [ 0 ] . equals ( "client" ) ) { client ( System . in , System . out ) ; } } catch ( final ArgumentParserException e ) { this . argParser . handleError ( e ) ; System . out . println ( "Run java -jar target/ixa-pipe-parse-" + this . version + ".jar" + " (parse|train|eval|server|client) -help for details" ) ; System . exit ( 1 ) ; }
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 ( ) + " field in " + obj . getClass ( ) . getName ( ) ) ; } } else { try { field . set ( obj , value ) ; } catch ( SecurityException e ) { throw new IllegalArgumentException ( e ) ; } catch ( IllegalAccessException e ) { throw new IllegalArgumentException ( e ) ; } }
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 and // building a field to evaluate each AND condition . for ( Map . Entry < String , PluralData . Rule > rule : data . rules ( ) . entrySet ( ) ) { Node < PluralType > orCondition = rule . getValue ( ) . condition ; if ( orCondition == null ) { continue ; } // Render the representation for each AND condition , using that as a // key to map to the corresponding lambda Condition field that // computes it . for ( Node < PluralType > andCondition : orCondition . asStruct ( ) . nodes ( ) ) { String repr = PluralRulePrinter . print ( andCondition ) ; if ( index . containsKey ( repr ) ) { continue ; } // Build the field that represents the evaluation of the AND condition . FieldSpec field = buildConditionField ( seq , andCondition . asStruct ( ) ) ; index . put ( repr , field ) ; seq ++ ; } } } } return index ;
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 . marshall ( listPresetsRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; protocolMarshaller . marshall ( listPresetsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( listPresetsRequest . getOrder ( ) , ORDER_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
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 static String getChecksum ( InputStream is , String algorithm ) throws IOException { } }
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 supported algorithm are 'CRC32' or 'MD5'." ) ; }
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 load CWE data. This should not be an issue." ) ; LOGGER . debug ( "" , ex ) ; } catch ( IOException ex ) { LOGGER . warn ( "Unable to load CWE data due to an IO Error. This should not be an issue." ) ; LOGGER . debug ( "" , ex ) ; } return null ;
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 . * @ throws IOException if there is an I / O error */ public static void generateACEB ( File dest , String json ) throws IOException { } }
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 ) ; if ( dateMatcher . matches ( ) ) { try { // Example : 20100823 info . baseAmiDate = new SimpleDateFormat ( "yyyyMMdd" ) . parse ( dateMatcher . group ( 1 ) ) ; } catch ( Exception ignored ) { // Ignore failure . } } } return info ;
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 connection subresource . * @ param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable for the request */ public Observable < ExpressRouteConnectionInner > createOrUpdateAsync ( String resourceGroupName , String expressRouteGatewayName , String connectionName , ExpressRouteConnectionInner putExpressRouteConnectionParameters ) { } }
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , expressRouteGatewayName , connectionName , putExpressRouteConnectionParameters ) . map ( new Func1 < ServiceResponse < ExpressRouteConnectionInner > , ExpressRouteConnectionInner > ( ) { @ Override public ExpressRouteConnectionInner call ( ServiceResponse < ExpressRouteConnectionInner > response ) { return response . body ( ) ; } } ) ;
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 ( ( ) -> { try { final HttpResponse response = doGetContent ( spaceId , contentId , startByte , endByte ) ; return toContent ( response , spaceId , contentId , startByte , endByte ) ; } catch ( IOException ex ) { throw new ContentStoreException ( ex . getMessage ( ) , ex ) ; } } ) ;
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 > * The lists in the restriction for < code > { @ link # getFields ( ) } < / code > , < code > { @ link # getRoots ( ) } < / code > and * < code > { @ link # getCategories ( ) } < / code > are < b > intersected < / b > with the lists of this search parameters . Only * elements contained in both lists are included for the created search parameters . * If a list in either the restriction or in this search parameters is < code > null < / code > , * the list from the other search parameters is used directly . < p > * The values for * < code > { @ link # isCalculateCategories ( ) } < / code > * and < code > { @ link # getSort ( ) } < / code > of this parameters are used for the restricted parameters . < p > * @ param restriction the parameters to restrict this parameters with * @ return the restricted parameters */ public CmsSearchParameters restrict ( CmsSearchParameters restriction ) { } }
// 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 ( ) ) ; if ( closure ) { query . append ( ")" ) ; } } if ( restriction . getQuery ( ) != null ) { // don ' t let Lucene max terms be exceeded in case someone reuses a CmsSearch and continuously restricts // query with the same restrictions . . . if ( query . indexOf ( restriction . getQuery ( ) ) < 0 ) { query . append ( " +(" ) ; query . append ( restriction . getQuery ( ) ) ; query . append ( ")" ) ; } } // restrict fields List < String > fields = null ; if ( ( m_fields != null ) && ( m_fields . size ( ) > 0 ) ) { if ( ( restriction . getFields ( ) != null ) && ( restriction . getFields ( ) . size ( ) > 0 ) ) { fields = ListUtils . intersection ( m_fields , restriction . getFields ( ) ) ; } else { fields = m_fields ; } } else { fields = restriction . getFields ( ) ; } // restrict roots List < String > roots = null ; if ( ( m_roots != null ) && ( m_roots . size ( ) > 0 ) ) { if ( ( restriction . getRoots ( ) != null ) && ( restriction . getRoots ( ) . size ( ) > 0 ) ) { roots = ListUtils . intersection ( m_roots , restriction . getRoots ( ) ) ; // TODO : This only works if there are equal paths in both parameter sets - for two distinct sets // all root restrictions are dropped with an empty list . } else { roots = m_roots ; } } else { roots = restriction . getRoots ( ) ; } // restrict categories List < String > categories = null ; if ( ( m_categories != null ) && ( m_categories . size ( ) > 0 ) ) { if ( ( restriction . getCategories ( ) != null ) && ( restriction . getCategories ( ) . size ( ) > 0 ) ) { categories = ListUtils . intersection ( m_categories , restriction . getCategories ( ) ) ; } else { categories = m_categories ; } } else { categories = restriction . getCategories ( ) ; } // restrict resource types List < String > resourceTypes = null ; if ( ( m_resourceTypes != null ) && ( m_resourceTypes . size ( ) > 0 ) ) { if ( ( restriction . getResourceTypes ( ) != null ) && ( restriction . getResourceTypes ( ) . size ( ) > 0 ) ) { resourceTypes = ListUtils . intersection ( m_resourceTypes , restriction . getResourceTypes ( ) ) ; } else { resourceTypes = m_resourceTypes ; } } else { resourceTypes = restriction . getResourceTypes ( ) ; } // create the new search parameters CmsSearchParameters result = new CmsSearchParameters ( query . toString ( ) , fields , roots , categories , resourceTypes , m_calculateCategories , m_sort ) ; result . setIndex ( getIndex ( ) ) ; return result ;
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 . CloseReason reason , String message ) { } }
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 point to min distance sort by * @ return a new geo distance sort field */ public static GeoDistanceSortField geoDistance ( String field , double latitude , double longitude ) { } }
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 NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { } }
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 versionOf ( int major , int minor , int patch ) { } }
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 elementValue is not valid */ public ConfigurationPropertyName append ( String elementValue ) { } }
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 || ! deleteAttributes . contains ( name ) ) { keys . add ( name ) ; } } } return new Enumerator ( keys ) ;
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_CAST ) ;
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 ( help = "Delete the VirtualNetworkFunctionRecord of NetworkServiceRecord with specific id" ) public void deleteVirtualNetworkFunctionRecord ( final String id , final String idVnfr ) throws SDKException { } }
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 null } */ private static StackTraceElement findStackTraceElement ( final String loggerClassName , final StackTraceElement [ ] trace ) { } }
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 ] ; } else { return null ; }
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 the PEP manager . * @ return the secret key node or null , if it doesn ' t exist . * @ throws InterruptedException if the thread gets interrupted * @ throws PubSubException . NotALeafNodeException if there is an issue with the PubSub node * @ throws XMPPException . XMPPErrorException if there is an XMPP protocol related issue * @ throws SmackException . NotConnectedException if we are not connected * @ throws SmackException . NoResponseException / watch ? v = 7U0FzQzJzyI */ public static SecretkeyElement fetchSecretKey ( PepManager pepManager ) throws InterruptedException , PubSubException . NotALeafNodeException , XMPPException . XMPPErrorException , SmackException . NotConnectedException , SmackException . NoResponseException { } }
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 ; } SecretkeyElement secretkeyElement = list . get ( 0 ) . getPayload ( ) ; return secretkeyElement ;
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 comparable < / i > ( that is , < tt > e1 . compareTo ( e2 ) < / tt > * must not throw a < tt > ClassCastException < / tt > for any elements * < tt > e1 < / tt > and < tt > e2 < / tt > in the array ) . < p > * @ param from the index of the first element ( inclusive ) to be sorted . * @ param to the index of the last element ( inclusive ) to be sorted . * @ return < tt > true < / tt > if the receiver is sorted ascending , < tt > false < / tt > otherwise . * @ exception IndexOutOfBoundsException index is out of range ( < tt > size ( ) & gt ; 0 & & ( from & lt ; 0 | | from & gt ; to | | to & gt ; = size ( ) ) < / tt > ) . */ public boolean isSortedFromTo ( int from , int to ) { } }
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 Exception { } }
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 ( getSrvAccSettings ( ) . lazyGetAccSettings ( pAddParam ) . getCostPrecision ( ) , getSrvAccSettings ( ) . lazyGetAccSettings ( pAddParam ) . getRoundingMode ( ) ) ) ; pEntity . getItsOwner ( ) . setItsTotal ( pEntity . getItsOwner ( ) . getTotalMaterialsCost ( ) . add ( pEntity . getItsOwner ( ) . getTotalAdditionCost ( ) ) . setScale ( getSrvAccSettings ( ) . lazyGetAccSettings ( pAddParam ) . getCostPrecision ( ) , getSrvAccSettings ( ) . lazyGetAccSettings ( pAddParam ) . getRoundingMode ( ) ) ) ; pEntity . getItsOwner ( ) . setItsCost ( pEntity . getItsOwner ( ) . getItsTotal ( ) . divide ( pEntity . getItsOwner ( ) . getItsQuantity ( ) , getSrvAccSettings ( ) . lazyGetAccSettings ( pAddParam ) . getCostPrecision ( ) , getSrvAccSettings ( ) . lazyGetAccSettings ( pAddParam ) . getRoundingMode ( ) ) ) ; getSrvOrm ( ) . updateEntity ( pAddParam , pEntity . getItsOwner ( ) ) ;
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 defaultValue ( String defaultValue ) throws RequiredParametersException { } }
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 option " + this . longName ) ; } }
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 ( args [ i ] == null ) { argsBuilder . append ( "_null" ) ; } else if ( isSimpleDataType ( args [ i ] ) ) { argsBuilder . append ( args [ i ] . toString ( ) ) ; } else if ( args [ i ] instanceof Collection ) { argsBuilder . append ( args [ i ] . toString ( ) . replaceAll ( "\\s{0,}" , "" ) ) ; } else { argsBuilder . append ( ToStringBuilder . reflectionToString ( args [ i ] , ToStringStyle . SHORT_PREFIX_STYLE ) ) ; } if ( i < args . length - 1 ) argsBuilder . append ( "_" ) ; } keyString = argsBuilder . length ( ) > 32 ? md5 ( argsBuilder ) : argsBuilder . toString ( ) ; keyBuilder . append ( keyString ) ; } return keyBuilder . toString ( ) ;
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 response before sending another * request . * @ param handle * @ param offset * @ param len * @ return UnsignedInteger32 * @ throws SshException */ public UnsignedInteger32 postReadRequest ( byte [ ] handle , long offset , int len ) throws SftpStatusException , SshException { } }
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 ( SshIOException ex ) { throw ex . getRealException ( ) ; } catch ( IOException ex ) { throw new SshException ( ex ) ; }
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 loadedClass ;
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 ( origin ) , String . format ( "The specified origin is not allowed: '%s'" , origin ) ) ; } return originHeader ;
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 instances are found , * an empty list is returned . * @ throws ProcessException * @ throws DataAccessException */ @ Override public List < ProcessInstance > getProcessInstances ( String masterRequestId , String processName ) throws ProcessException , DataAccessException { } }
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 , procdef . getId ( ) ) ; } catch ( SQLException e ) { throw new ProcessException ( 0 , "Failed to remove event waits" , e ) ; } finally { edao . stopTransaction ( transaction ) ; }
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 values . * @ param jobs * A list of your signing jobs . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListSigningJobsResult withJobs ( SigningJob ... jobs ) { } }
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 ECDSASigner ( new HMacDSAKCalculator ( new SHA256Digest ( ) ) ) ; ECPrivateKeyParameters privKeyParams = new ECPrivateKeyParameters ( ( ( BCECPrivateKey ) privKey ) . getD ( ) , CURVE ) ; signer . init ( true , privKeyParams ) ; BigInteger [ ] components = signer . generateSignature ( input ) ; return new ECDSASignature ( components [ 0 ] , components [ 1 ] ) . toCanonicalised ( ) ; } else { try { final Signature ecSig = ECSignatureFactory . getRawInstance ( provider ) ; ecSig . initSign ( privKey ) ; ecSig . update ( input ) ; final byte [ ] derSignature = ecSig . sign ( ) ; return ECDSASignature . decodeFromDER ( derSignature ) . toCanonicalised ( ) ; } catch ( SignatureException | InvalidKeyException ex ) { throw new RuntimeException ( "ECKey signing error" , ex ) ; } }
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 ( ) , msg . getMessageId ( ) , msg . getStatusUpdate ( ) ) ; for ( ChatMessageStatus s : adaptedStatuses ) { adaptedMessage . addStatusUpdate ( s ) ; } chatMessages . add ( adaptedMessage ) ; } } return chatMessages ;
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 ; { 0 } / { 1 } & quot ; verwendet . < / p > * @ param text text to be parsed * @ param parser format object for parsing start and end components * @ return parsed interval * @ throws IndexOutOfBoundsException if given text is empty * @ throws ParseException if the text is not parseable * @ since 3.9/4.6 * @ see # parse ( String , ChronoParser , String ) * @ see net . time4j . format . FormatPatternProvider # getIntervalPattern ( Locale ) */ public static ClockInterval parse ( String text , ChronoParser < PlainTime > parser ) throws ParseException { } }
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 , boolean absolutely ) { } }
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 ( defaultSettings . getTransletNamePrefix ( ) == null && defaultSettings . getTransletNameSuffix ( ) == null ) { return transletName ; } StringBuilder sb = new StringBuilder ( ) ; if ( defaultSettings . getTransletNamePrefix ( ) != null ) { sb . append ( defaultSettings . getTransletNamePrefix ( ) ) ; } if ( transletName != null ) { sb . append ( transletName ) ; } if ( defaultSettings . getTransletNameSuffix ( ) != null ) { sb . append ( defaultSettings . getTransletNameSuffix ( ) ) ; } return sb . toString ( ) ;
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 { mapToWriter ( map , jsonWriter ) ; } finally { jsonWriter . close ( ) ; }
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 rounded * down to milliseconds value of * { @ link # getFractionalSecond ( ) } . When { @ link # getFractionalSecond ( ) } * returns < code > null < / code > , this method must return * { @ link DatatypeConstants # FIELD _ UNDEFINED } . < / p > * < p > Value constraints for this value are summarized in * < a href = " # datetimefield - second " > second field of date / time field mapping table < / a > . < / p > * @ return Millisecond of this < code > XMLGregorianCalendar < / code > . * @ see # getFractionalSecond ( ) * @ see # setTime ( int , int , int ) */ public int getMillisecond ( ) { } }
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 . getAnnotation ( HiddenProperty . class ) ; if ( hiddenProperty != null && hiddenProperty . hiddenForLocalAccess ( ) ) { return null ; } if ( propertyDescriptor . getAnnotation ( Deprecated . class ) != null ) { return null ; } if ( getComponentBuilder ( ) instanceof AnalyzerComponentBuilder ) { final AnalyzerComponentBuilder < ? > analyzer = ( AnalyzerComponentBuilder < ? > ) getComponentBuilder ( ) ; if ( analyzer . isMultipleJobsSupported ( ) ) { if ( analyzer . isMultipleJobsDeterminedBy ( propertyDescriptor ) ) { return new MultipleInputColumnsPropertyWidget ( analyzer , propertyDescriptor ) ; } } } // check for fitting property widgets by type final Class < ? > type = propertyDescriptor . getBaseType ( ) ; final Class < ? extends PropertyWidget < ? > > widgetClass ; if ( propertyDescriptor . isArray ( ) ) { if ( propertyDescriptor . isInputColumn ( ) ) { widgetClass = MultipleInputColumnsPropertyWidget . class ; } else if ( ReflectionUtils . isString ( type ) ) { widgetClass = MultipleStringPropertyWidget . class ; } else if ( type == Dictionary . class ) { widgetClass = MultipleDictionariesPropertyWidget . class ; } else if ( type == SynonymCatalog . class ) { widgetClass = MultipleSynonymCatalogsPropertyWidget . class ; } else if ( type == StringPattern . class ) { widgetClass = MultipleStringPatternPropertyWidget . class ; } else if ( type . isEnum ( ) ) { widgetClass = MultipleEnumPropertyWidget . class ; } else if ( type == Class . class ) { widgetClass = MultipleClassesPropertyWidget . class ; } else if ( type == char . class ) { widgetClass = MultipleCharPropertyWidget . class ; } else if ( ReflectionUtils . isNumber ( type ) ) { widgetClass = MultipleNumberPropertyWidget . class ; } else { // not yet implemented widgetClass = DummyPropertyWidget . class ; } } else { if ( propertyDescriptor . isInputColumn ( ) ) { if ( _componentBuilder . getDescriptor ( ) . getConfiguredPropertiesByType ( InputColumn . class , true ) . size ( ) == 1 ) { // if there is only a single input column property , it // will // be displayed using radiobuttons . widgetClass = SingleInputColumnRadioButtonPropertyWidget . class ; } else { // if there are multiple input column properties , they // will // be displayed using combo boxes . widgetClass = SingleInputColumnComboBoxPropertyWidget . class ; } } else if ( ReflectionUtils . isCharacter ( type ) ) { widgetClass = SingleCharacterPropertyWidget . class ; } else if ( ReflectionUtils . isString ( type ) ) { widgetClass = SingleStringPropertyWidget . class ; } else if ( ReflectionUtils . isBoolean ( type ) ) { widgetClass = SingleBooleanPropertyWidget . class ; } else if ( ReflectionUtils . isNumber ( type ) ) { widgetClass = SingleNumberPropertyWidget . class ; } else if ( ReflectionUtils . isDate ( type ) ) { widgetClass = SingleDatePropertyWidget . class ; } else if ( type == Dictionary . class ) { widgetClass = SingleDictionaryPropertyWidget . class ; } else if ( type == SynonymCatalog . class ) { widgetClass = SingleSynonymCatalogPropertyWidget . class ; } else if ( type == StringPattern . class ) { widgetClass = SingleStringPatternPropertyWidget . class ; } else if ( type . isEnum ( ) ) { widgetClass = SingleEnumPropertyWidget . class ; } else if ( ReflectionUtils . is ( type , Resource . class ) ) { widgetClass = SingleResourcePropertyWidget . class ; } else if ( type == File . class ) { widgetClass = SingleFilePropertyWidget . class ; } else if ( type == Pattern . class ) { widgetClass = SinglePatternPropertyWidget . class ; } else if ( ReflectionUtils . is ( type , Datastore . class ) ) { widgetClass = SingleDatastorePropertyWidget . class ; } else if ( type == Class . class ) { widgetClass = SingleClassPropertyWidget . class ; } else if ( type == Map . class ) { final Class < ? > genericType1 = propertyDescriptor . getTypeArgument ( 0 ) ; final Class < ? > genericType2 = propertyDescriptor . getTypeArgument ( 1 ) ; if ( genericType1 == String . class && genericType2 == String . class ) { widgetClass = MapStringToStringPropertyWidget . class ; } else { // not yet implemented widgetClass = DummyPropertyWidget . class ; } } else { // not yet implemented widgetClass = DummyPropertyWidget . class ; } } final Injector injector = getInjectorForPropertyWidgets ( propertyDescriptor ) ; return injector . getInstance ( widgetClass ) ;
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 BasePanel ) // Run every basepanel { ( ( BasePanel ) sField ) . run ( ) ; } }
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 , int end ) { } }
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 we ' ll be correct . */ BundlePackages bp = populatePackageLists ( ) ; harvestPackageList ( bp , bundle ) ; } return null ;
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 . mediaPlayer . getVideoHeight ( ) ; } resize ( ) ; stopLoading ( ) ; currentState = State . PREPARED ; if ( shouldAutoplay ) start ( ) ; if ( this . preparedListener != null ) this . preparedListener . onPrepared ( mediaPlayer ) ; }
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 session , or a newly - instantiated one * ( based on the user ' s Global . app file ) if none was in the session . Failing that , * return < code > null < / code > . */ public static GlobalApp ensureGlobalApp ( HttpServletRequest request , HttpServletResponse response ) { } }
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 static < T > Stream < T > parallelConcat ( final Collection < ? extends Stream < ? extends T > > c ) { } }
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 * @ param elementType the element type * @ param result the destination for results */ protected final void bindIndexed ( ConfigurationPropertyName name , Bindable < ? > target , AggregateElementBinder elementBinder , ResolvableType aggregateType , ResolvableType elementType , IndexedCollectionSupplier result ) { } }
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 ) { newAddedLits . push ( lit ) ; mark ( lit ) ; } } this . addedlits = newAddedLits ; unmark ( ) ; return res ;
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 { @ link NlsRuntimeException # getCode ( ) error code } . * @ param errorsMap is a map with all validation errors * @ return the corresponding { @ link Response } . */ protected Response createResponse ( Status status , NlsRuntimeException error , String message , String code , Map < String , List < String > > errorsMap ) { } }
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_MOUSEOUT , this , false ) ;
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 > CalendarPeriodAssociative < T > MakeUpCalendarPeriodAssociative ( List < Tree > trees , List < T > values , CalendarPeriodAssociative . AddFunction < T > addFunction ) { } }
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 CalendarPeriodAssociative < T > res = null ; int first = 0 ; do { Tree tree = trees . get ( first ) ; T value = values . get ( first ) ; // PeriodAssociative firstPeriodAndValue = periodsAndValues . get ( // first ) ; // Tree tree = Parse ( firstPeriodAndValue . getFrom ( ) ) ; if ( tree . getNbDays ( ) == 0 ) { first ++ ; if ( first >= nbPeriod ) return new CalendarPeriodAssociative < T > ( ) ; continue ; } CalendarPeriod flat = tree . getFlat ( ) ; res = new CalendarPeriodAssociative < T > ( ) ; res . Init ( flat , value ) ; break ; } while ( true ) ; if ( res == null ) return null ; // no non - empty period for ( int i = first + 1 ; i < nbPeriod ; i ++ ) { Tree tree = trees . get ( i ) ; T value = values . get ( i ) ; if ( tree . getNbDays ( ) == 0 ) { // echo " IGNORING N PERIOD $ i ( " . $ periodsAndValues [ $ i ] [ 0 ] . // " ) BECAUSE EMPTY < br > " ; continue ; } CalendarPeriod flat = tree . getFlat ( ) ; CalendarPeriodAssociative < T > assoc = new CalendarPeriodAssociative < T > ( ) ; assoc . Init ( flat , value ) ; if ( res . Add ( assoc , addFunction ) == null ) return null ; } return res ;
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 ( ) . size ( ) != 0 ) { result . append ( "<tr><td class=\"Template\">" ) ; for ( String parameter : t . getParameters ( ) ) { result . append ( "Parameter: \"" + convertTags ( parameter ) + "\"<br>" ) ; } result . append ( "</td></tr>\n" ) ; } result . append ( "</table>" ) ; return result . toString ( ) ;
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 ( ( objJobDef instanceof String ) || ( objJobDef instanceof Properties ) ) { String strJobDef = null ; Map < String , Object > properties = null ; if ( objJobDef instanceof String ) { strJobDef = ( String ) objJobDef ; properties = new Hashtable < String , Object > ( ) ; Util . parseArgs ( properties , strJobDef ) ; } if ( objJobDef instanceof Properties ) properties = ( Map ) objJobDef ; if ( properties . get ( "webStartPropertiesFile" ) != null ) properties = this . addPropertiesFile ( properties ) ; String strClass = ( String ) properties . get ( Param . TASK ) ; if ( strClass == null ) strClass = ( String ) properties . get ( Param . APPLET ) ; // Applets are also run as tasks Object job = ClassServiceUtility . getClassService ( ) . makeObjectFromClassName ( strClass ) ; if ( job instanceof Task ) { ( ( Task ) job ) . initTask ( this . getApplication ( ) , properties ) ; ( ( Task ) job ) . run ( ) ; } else if ( job instanceof Applet ) { // An applet // new JBaseFrame ( " Applet " , ( Applet ) job ) ; System . out . println ( "********** Applet task type needs to be fixed *********" ) ; } else if ( job instanceof Runnable ) { // A thread ( Is this okay ? ? I already have my own thread ) // x new Thread ( ( Runnable ) job ) . start ( ) ; / / No , don ' t start another thread ( ( Runnable ) job ) . run ( ) ; // This should be okay , as I already have my own thread } else Util . getLogger ( ) . warning ( "Illegal job type passed to TaskScheduler: " + job ) ; } else if ( objJobDef instanceof Runnable ) ( ( Runnable ) objJobDef ) . run ( ) ; else Util . getLogger ( ) . warning ( "Error: Illegal job type" ) ;
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 ( UnsupportedEncodingException e ) { e . printStackTrace ( ) ; } return value ;
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 specified file from the beginning * @ see # readFile ( Transaction , long ) * @ see # readFile ( Transaction , File , long ) * @ see # writeFile ( Transaction , File ) * @ see # writeFile ( Transaction , long ) * @ see # writeFile ( Transaction , File , long ) * @ see # writeFile ( Transaction , long , long ) * @ see # appendFile ( Transaction , File ) * @ see # touchFile ( Transaction , File ) */ public VfsInputStream readFile ( @ NotNull final Transaction txn , @ NotNull final File file ) { } }
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 ( PorterDuff . Mode . MULTIPLY ) ) ;
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 if ( this . rescaler != null ) { // b = ALG . mult ( this . U , b ) ; b = ColtUtils . diagonalMatrixMult ( this . U , b ) ; } // Solve L . y = b final double [ ] y = new double [ dim ] ; for ( int i = 0 ; i < dim ; i ++ ) { double [ ] LI = LData [ i ] ; double sum = 0 ; for ( int j = 0 ; j < i ; j ++ ) { sum += LI [ j ] * y [ j ] ; } y [ i ] = ( b . getQuick ( i ) - sum ) / LI [ i ] ; } // logger . debug ( " b : " + ArrayUtils . toString ( b ) ) ; // logger . debug ( " L . y : " + ArrayUtils . toString ( getL ( ) . operate ( y ) ) ) ; // Solve D . z = y final double [ ] z = new double [ dim ] ; for ( int i = 0 ; i < dim ; i ++ ) { z [ i ] = y [ i ] / DData [ i ] ; } // Solve L [ T ] . x = z final DoubleMatrix1D x = F1 . make ( dim ) ; for ( int i = dim - 1 ; i > - 1 ; i -- ) { double sum = 0 ; for ( int j = dim - 1 ; j > i ; j -- ) { sum += LData [ j ] [ i ] * x . getQuick ( j ) ; } x . setQuick ( i , ( z [ i ] - sum ) / LData [ i ] [ i ] ) ; } if ( this . rescaler != null ) { // return ALG . mult ( this . U , x ) ; return ColtUtils . diagonalMatrixMult ( this . U , x ) ; } else { return x ; }
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 registerDispatcher ( InvocationDispatcher < T > dispatcher ) { } }
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 = _rotationMatrix . multiply ( deltaMatrix ) ; double [ ] column = enuMatrix . getColumn ( 0 ) ; return new Coordinate ( column [ 0 ] , column [ 1 ] , column [ 2 ] ) ;
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 > fromTasks ( Task < ? , ? > ... tasks ) { } }
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 ( joinWord ) . append ( " " ) ; } sb . append ( p . toSql ( ) ) ; first = false ; } return sb . append ( ")" ) . toString ( ) ; } } ;
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 messages are sent when something requires user action that did not result from * direct action by the user . * @ param speakObj the object on which to deliver the message . * @ param bundle the name of the localization bundle that should be used to translate this * system message prior to displaying it to the client . * @ param message the text of the message . */ public static void sendAttention ( DObject speakObj , String bundle , String message ) { } }
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 will not wait , * returning a bogus object immediately instead . * @ param timeoutMillis maximum time to wait for real object before * returning bogus one ; if negative , potentially wait forever * @ throws E exception thrown from createReal */ public synchronized T get ( final int timeoutMillis ) throws E { } }
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 < 0 ) { while ( mReal == null && mCreateThread != null ) { if ( timeoutMillis < 0 ) { wait ( ) ; } } } else { long remaining = timeoutMillis ; while ( mReal == null && mCreateThread != null && ! mFailed ) { wait ( remaining ) ; long elapsed = ( System . nanoTime ( ) - start ) / 1000000L ; if ( ( remaining -= elapsed ) <= 0 ) { break ; } } } } catch ( InterruptedException e ) { } if ( mReal != null ) { return mReal ; } long elapsed = ( System . nanoTime ( ) - start ) / 1000000L ; if ( elapsed >= timeoutMillis ) { timedOutNotification ( elapsed ) ; } } if ( mFailedError != null ) { // Take ownership of error . Also stitch traces together for // context . This gives the illusion that the creation attempt // occurred in this thread . Throwable error = mFailedError ; mFailedError = null ; StackTraceElement [ ] trace = error . getStackTrace ( ) ; error . fillInStackTrace ( ) ; StackTraceElement [ ] localTrace = error . getStackTrace ( ) ; StackTraceElement [ ] completeTrace = new StackTraceElement [ trace . length + localTrace . length ] ; System . arraycopy ( trace , 0 , completeTrace , 0 , trace . length ) ; System . arraycopy ( localTrace , 0 , completeTrace , trace . length , localTrace . length ) ; error . setStackTrace ( completeTrace ) ; ThrowUnchecked . fire ( error ) ; } if ( mBogus == null ) { mRef = new AtomicReference < T > ( createBogus ( ) ) ; mBogus = AccessController . doPrivileged ( new PrivilegedAction < T > ( ) { public T run ( ) { try { return getWrapper ( ) . newInstance ( mRef ) ; } catch ( Exception e ) { ThrowUnchecked . fire ( e ) ; return null ; } } } ) ; } return mBogus ;