signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class XmlUtil { /** * 在已有节点上创建子节点 * @ param node 节点 * @ param tagName 标签名 * @ return 子节点 * @ since 4.0.9 */ public static Element appendChild ( Node node , String tagName ) { } }
Document doc = ( node instanceof Document ) ? ( Document ) node : node . getOwnerDocument ( ) ; Element child = doc . createElement ( tagName ) ; node . appendChild ( child ) ; return child ;
public class Version { /** * < pre > * Automatic scaling is based on request rate , response latencies , and other * application metrics . * < / pre > * < code > . google . appengine . v1 . AutomaticScaling automatic _ scaling = 3 ; < / code > */ public com . google . appengine . v1 . AutomaticScalingOrBuilder ...
if ( scalingCase_ == 3 ) { return ( com . google . appengine . v1 . AutomaticScaling ) scaling_ ; } return com . google . appengine . v1 . AutomaticScaling . getDefaultInstance ( ) ;
public class CmsSubscriptionManager { /** * Mark the given resource as visited by the user . < p > * @ param cms the current users context * @ param resourcePath the name of the resource to mark as visited * @ param user the user that visited the resource * @ throws CmsException if something goes wrong */ publi...
CmsResource resource = cms . readResource ( resourcePath , CmsResourceFilter . ALL ) ; markResourceAsVisitedBy ( cms , resource , user ) ;
public class ContainerDefinition { /** * A list of DNS search domains that are presented to the container . This parameter maps to < code > DnsSearch < / code > * in the < a href = " https : / / docs . docker . com / engine / api / v1.35 / # operation / ContainerCreate " > Create a container < / a > * section of th...
if ( dnsSearchDomains == null ) { this . dnsSearchDomains = null ; return ; } this . dnsSearchDomains = new com . amazonaws . internal . SdkInternalList < String > ( dnsSearchDomains ) ;
public class SavedRevision { /** * The contents of this revision of the document . * Any keys in the dictionary that begin with " _ " , such as " _ id " and " _ rev " , contain * CouchbaseLite metadata . * @ return contents of this revision of the document . */ @ Override @ InterfaceAudience . Public public Map <...
Map < String , Object > properties = revisionInternal . getProperties ( ) ; if ( ! checkedProperties ) { if ( properties == null ) { if ( loadProperties ( ) == true ) { properties = revisionInternal . getProperties ( ) ; } } checkedProperties = true ; } return properties != null ? Collections . unmodifiableMap ( proper...
public class ExplodeAnimation { /** * Initializes the animation with the attributes of the given explode info object . */ protected void init ( ExplodeInfo info , int x , int y , int width , int height ) { } }
_info = info ; _ox = x ; _oy = y ; _owid = width ; _ohei = height ; _info . rvel = ( float ) ( ( 2.0f * Math . PI ) * _info . rvel ) ; _chunkcount = ( _info . xchunk * _info . ychunk ) ; _cxpos = new int [ _chunkcount ] ; _cypos = new int [ _chunkcount ] ; _sxvel = new float [ _chunkcount ] ; _syvel = new float [ _chun...
public class JavaDocument { /** * Overide bracket matching for other languages */ protected String addWhiteSpace ( int offset ) throws BadLocationException { } }
StringBuilder whiteSpace = new StringBuilder ( ) ; int line = _root . getElementIndex ( offset ) ; int i = _root . getElement ( line ) . getStartOffset ( ) ; while ( true ) { String temp = getText ( i , 1 ) ; if ( temp . equals ( " " ) || temp . equals ( "\t" ) ) { whiteSpace . append ( temp ) ; i ++ ; } else { break ;...
public class JMThread { /** * Gets thread queue . * @ param executorService the executor service * @ return the thread queue */ public static BlockingQueue < Runnable > getThreadQueue ( ExecutorService executorService ) { } }
if ( executorService instanceof ThreadPoolExecutor ) return ( ( ThreadPoolExecutor ) executorService ) . getQueue ( ) ; throw JMExceptionManager . handleExceptionAndReturnRuntimeEx ( log , new IllegalArgumentException ( "Unsupported ExecutorService - Use ThrJMThread.newThreadPool Or newSingleThreadPool To Get ExecutorS...
public class DisassociateConnectionFromLagRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DisassociateConnectionFromLagRequest disassociateConnectionFromLagRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( disassociateConnectionFromLagRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( disassociateConnectionFromLagRequest . getConnectionId ( ) , CONNECTIONID_BINDING ) ; protocolMarshaller . marshall ( disassociateConnectionFromLagR...
public class ChaiUtility { /** * Derives a unique entry name for an ldap container . Assumes CN as the naming attribute . * @ param baseName A text name that will be used for the base of the obejct name . Punctuation and spaces will be stripped . * @ param containerDN Directory container in which to check for a uni...
char ch ; final StringBuilder cnStripped = new StringBuilder ( ) ; final String effectiveBasename = ( baseName == null ) ? "" : baseName ; // First boil down the root name . Preserve only the alpha - numerics . for ( int i = 0 ; i < effectiveBasename . length ( ) ; i ++ ) { ch = effectiveBasename . charAt ( i ) ; if ( ...
public class MonitorRegistry { /** * Returns all service monitors . */ public List < ServiceMonitor > getServiceMonitors ( ) { } }
List < ServiceMonitor > serviceMonitors = new ArrayList < > ( ) ; serviceMonitors . addAll ( getDynamicServices ( ServiceMonitor . class ) ) ; return serviceMonitors ;
public class PreauthorizationService { /** * Returns and refresh data of a specific { @ link Preauthorization } . * @ param preauthorization * A { @ link Preauthorization } with Id . * @ return Refreshed instance of the given { @ link Preauthorization } . */ public Preauthorization get ( final Preauthorization pr...
return RestfulUtils . show ( PreauthorizationService . PATH , preauthorization , Preauthorization . class , super . httpClient ) ;
public class StreamSegmentService { /** * region StreamSegmentStore Implementation */ @ Override public CompletableFuture < Void > append ( String streamSegmentName , byte [ ] data , Collection < AttributeUpdate > attributeUpdates , Duration timeout ) { } }
return invoke ( streamSegmentName , container -> container . append ( streamSegmentName , data , attributeUpdates , timeout ) , "append" , streamSegmentName , data . length , attributeUpdates ) ;
public class TopologyBuilder { /** * Define a new bolt in this topology with the specified amount of parallelism . * @ param id the id of this component . This id is referenced by other components that want to consume this bolt ' s outputs . * @ param bolt the bolt * @ param parallelismHint the number of tasks th...
validateComponentName ( id ) ; BoltDeclarer b = new BoltDeclarer ( id , bolt , parallelismHint ) ; bolts . put ( id , b ) ; return b ;
public class AkubraLowlevelStorage { /** * Overwrites the content of the given blob in a way that guarantees the * original content is not destroyed until the replacement is successfully * put in its place . */ private static void safeOverwrite ( Blob origBlob , InputStream content ) { } }
BlobStoreConnection connection = origBlob . getConnection ( ) ; String origId = origBlob . getId ( ) . toString ( ) ; // write new content to origId / new Blob newBlob = null ; try { newBlob = connection . getBlob ( new URI ( origId + "/new" ) , null ) ; copy ( content , newBlob . openOutputStream ( - 1 , false ) ) ; }...
public class Hasher { /** * Hashes byte array . * @ return Hash of the given byte array . */ protected String hashByteArray ( byte [ ] data ) { } }
if ( mCRC32 != null ) { return hashCRC32 ( data ) ; } else if ( mHashAlgorithm != null ) { return messageDigest ( data ) ; } else { // Default . return hashCRC32 ( data ) ; }
public class PrivacyMetric { /** * < code > . google . privacy . dlp . v2 . PrivacyMetric . KAnonymityConfig k _ anonymity _ config = 3 ; < / code > */ public com . google . privacy . dlp . v2 . PrivacyMetric . KAnonymityConfig getKAnonymityConfig ( ) { } }
if ( typeCase_ == 3 ) { return ( com . google . privacy . dlp . v2 . PrivacyMetric . KAnonymityConfig ) type_ ; } return com . google . privacy . dlp . v2 . PrivacyMetric . KAnonymityConfig . getDefaultInstance ( ) ;
public class HelperBase { /** * Copy values from delegate RepositoryOperation to this ServiceOperation */ private void addDefaultValues ( ServiceOperation operation ) { } }
if ( operation . getDelegate ( ) != null ) { copyFromDelegate ( operation , operation . getDelegate ( ) , true ) ; } else if ( operation . getServiceDelegate ( ) != null ) { // make sure that the service delegate has been populated first addDefaultValues ( operation . getServiceDelegate ( ) ) ; // recursive call // ( c...
public class MeanVariance { /** * Create and initialize a new array of MeanVariance * @ param dimensionality Dimensionality * @ return New and initialized Array */ public static MeanVariance [ ] newArray ( int dimensionality ) { } }
MeanVariance [ ] arr = new MeanVariance [ dimensionality ] ; for ( int i = 0 ; i < dimensionality ; i ++ ) { arr [ i ] = new MeanVariance ( ) ; } return arr ;
public class AggregateMojo { /** * Scans the dependencies of the projects in aggregate . * @ param engine the engine used to perform the scanning * @ return a collection of exceptions * @ throws MojoExecutionException thrown if a fatal exception occurs */ @ Override protected ExceptionCollection scanDependencies ...
ExceptionCollection exCol = scanArtifacts ( getProject ( ) , engine , true ) ; for ( MavenProject childProject : getDescendants ( this . getProject ( ) ) ) { final ExceptionCollection ex = scanArtifacts ( childProject , engine , true ) ; if ( ex != null ) { if ( exCol == null ) { exCol = ex ; } exCol . getExceptions ( ...
public class ApiOvhIp { /** * Your OVH IPs * REST : GET / ip * @ param description [ required ] Filter the value of description property ( like ) * @ param ip [ required ] Filter the value of ip property ( contains or equals ) * @ param routedTo _ serviceName [ required ] Filter the value of routedTo . serviceN...
String qPath = "/ip" ; StringBuilder sb = path ( qPath ) ; query ( sb , "description" , description ) ; query ( sb , "ip" , ip ) ; query ( sb , "routedTo.serviceName" , routedTo_serviceName ) ; query ( sb , "type" , type ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t2 ...
public class TldVarianceFilter { /** * Computes the variance inside the specified rectangle . * @ return variance */ protected double computeVarianceSafe ( int x0 , int y0 , int x1 , int y1 ) { } }
// can use unsafe operations here since x0 > 0 and y0 > 0 double square = GIntegralImageOps . block_zero ( integralSq , x0 - 1 , y0 - 1 , x1 - 1 , y1 - 1 ) ; double area = ( x1 - x0 ) * ( y1 - y0 ) ; double mean = GIntegralImageOps . block_zero ( integral , x0 - 1 , y0 - 1 , x1 - 1 , y1 - 1 ) / area ; return square / a...
public class MultiPartFaxJob2HTTPRequestConverter { /** * Creates a HTTP request with the common data . * @ param faxClientSpi * The HTTP fax client SPI * @ param faxActionType * The fax action type * @ return The HTTP request to send */ protected HTTPRequest createCommonHTTPRequest ( HTTPFaxClientSpi faxClie...
// setup common request data HTTPRequest httpRequest = new HTTPRequest ( ) ; String resource = faxClientSpi . getHTTPResource ( faxActionType ) ; httpRequest . setResource ( resource ) ; String urlParameters = faxClientSpi . getHTTPURLParameters ( ) ; httpRequest . setParametersText ( urlParameters ) ; return httpReque...
public class PkRSS { /** * Saves / Deletes an { @ link Article } object to the favorites database . * @ param article Article object to save . * @ param favorite Whether to save or delete . { @ code true } to save ; { @ code false } to delete . * @ return { @ code true } if successful , { @ code false } if otherw...
long time = System . currentTimeMillis ( ) ; log ( "Adding article " + article . getId ( ) + " to favorites..." ) ; try { if ( favorite ) favoriteDatabase . add ( article ) ; else favoriteDatabase . delete ( article ) ; } catch ( Exception e ) { log ( "Error " + ( favorite ? "saving article to" : "deleting article from...
public class RandomStringUtils { /** * < p > Creates a random string based on a variety of options , using * supplied source of randomness . < / p > * < p > If start and end are both { @ code 0 } , start and end are set * to { @ code ' ' } and { @ code ' z ' } , the ASCII printable * characters , will be used ,...
if ( count == 0 ) { return StringUtils . EMPTY ; } else if ( count < 0 ) { throw new IllegalArgumentException ( "Requested random string length " + count + " is less than 0." ) ; } if ( chars != null && chars . length == 0 ) { throw new IllegalArgumentException ( "The chars array must not be empty" ) ; } if ( start == ...
public class ProxyServlet { /** * Called by { @ code init } to set the remote port . Must be a number . * Default is { @ code 80 } . * @ param pRemotePort */ public void setRemotePort ( String pRemotePort ) { } }
try { remotePort = Integer . parseInt ( pRemotePort ) ; } catch ( NumberFormatException e ) { log ( "RemotePort must be a number!" , e ) ; }
public class MyExceptionHandler { /** * TypeMismatchException中获取到参数错误类型 * @ param e */ private ModelAndView getParamErrors ( TypeMismatchException e ) { } }
Throwable t = e . getCause ( ) ; if ( t instanceof ConversionFailedException ) { ConversionFailedException x = ( ConversionFailedException ) t ; TypeDescriptor type = x . getTargetType ( ) ; Annotation [ ] annotations = type != null ? type . getAnnotations ( ) : new Annotation [ 0 ] ; Map < String , String > errors = n...
public class CommerceRegionUtil { /** * Returns all the commerce regions where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ return the matching commerce regions */ public static List < CommerceRegion > findByUuid_C ( String uuid , long companyId ) { } }
return getPersistence ( ) . findByUuid_C ( uuid , companyId ) ;
public class FnBigDecimal { /** * It rounds the input number with the given scale and { @ link RoundingMode } . The input * number will be converted into a { @ link BigDecimal } with the given scale and * roundingMode * @ param scale the scale * @ param roundingMode the { @ link RoundingMode } * @ return the ...
return FnNumber . roundBigDecimal ( scale , roundingMode ) ;
public class LongPersistedValueData { /** * { @ inheritDoc } */ public void writeExternal ( ObjectOutput out ) throws IOException { } }
out . writeInt ( orderNumber ) ; out . writeLong ( value ) ;
public class DummyLogOutput { /** * ( non - Javadoc ) * @ see com . ibm . ws . objectManager . LogOutput # writeNext ( com . ibm . ws . objectManager . LogRecord , long , boolean ) */ protected long writeNext ( LogRecord logRecord , long reservedDelta , boolean checkSpace , boolean flush ) throws ObjectManagerExcepti...
final String methodName = "writeNext" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Object [ ] { logRecord , new Long ( reservedDelta ) , new Boolean ( checkSpace ) , new Boolean ( flush ) } ) ; long usableLogSequenceNumber ; // Take a lock on ...
public class HistoricDate { /** * / * [ deutsch ] * < p > Konstruiert ein neues Tupel aus den angegebenen historischen Zeitkomponenten . < / p > * < p > Hinweis : Eine detaillierte Validierung wird nicht gemacht . Das ist stattdessen Aufgabe * der { @ code ChronoHistory } . < / p > * @ param era historic era ...
if ( era == null ) { throw new NullPointerException ( "Missing historic era." ) ; } else if ( dom < 1 || dom > 31 ) { throw new IllegalArgumentException ( "Day of month out of range: " + toString ( era , yearOfEra , month , dom ) ) ; } else if ( month < 1 || month > 12 ) { throw new IllegalArgumentException ( "Month ou...
public class FilesConfigurationSource { /** * Get configuration set for a given { @ code environment } from this source in a form of { @ link Properties } . * { @ link Environment } name is prepended to all file paths from { @ link ConfigFilesProvider } * to form an absolute configuration file path . If environment...
Properties properties = new Properties ( ) ; Path rootPath ; if ( environment . getName ( ) . trim ( ) . isEmpty ( ) ) { rootPath = Paths . get ( System . getProperty ( "user.home" ) ) ; } else { rootPath = Paths . get ( environment . getName ( ) ) ; } if ( ! rootPath . toFile ( ) . exists ( ) ) { throw new MissingEnvi...
public class IntStream { /** * Returns a sequential ordered { @ code IntStream } from { @ code startInclusive } * ( inclusive ) to { @ code endInclusive } ( inclusive ) by an incremental step of * { @ code 1 } . * @ param startInclusive the ( inclusive ) initial value * @ param endInclusive the inclusive upper ...
if ( startInclusive > endInclusive ) { return empty ( ) ; } else if ( startInclusive == endInclusive ) { return of ( startInclusive ) ; } else { return new IntStream ( new IntRangeClosed ( startInclusive , endInclusive ) ) ; }
public class DataTableRenderer { /** * This methods generates the HTML code of the current b : dataTable . * < code > encodeBegin < / code > generates the start of the component . After the , the * JSF framework calls < code > encodeChildren ( ) < / code > to generate the HTML code * between the beginning and the...
if ( ! component . isRendered ( ) ) { return ; } DataTable dataTable = ( DataTable ) component ; Map < Integer , String > columnSortOrder = dataTable . getColumnSortOrderMap ( ) ; int pageLength = dataTable . getPageLength ( ) ; String orderString = "[]" ; if ( columnSortOrder != null ) { StringBuilder sb = new StringB...
public class GraniteUi { /** * From the list of resource types get the first one that exists . * @ param resourceResolver Resource resolver * @ param resourceTypes ResourceTypes * @ return Existing resource type */ public static @ Nullable String getExistingResourceType ( @ NotNull ResourceResolver resourceResolv...
for ( String path : resourceTypes ) { if ( resourceResolver . getResource ( path ) != null ) { return path ; } } return null ;
public class Scheduler { /** * 1 seconds = 1/60 minutes * @ param start between time * @ param end finish time * @ return duration in minutes */ public static double durationMinutes ( LocalDateTime start , LocalDateTime end ) { } }
return Duration . between ( start , end ) . toMinutes ( ) ;
public class WebFacesConfigDescriptorImpl { /** * If not already created , a new < code > factory < / code > element will be created and returned . * Otherwise , the first existing < code > factory < / code > element will be returned . * @ return the instance defined for the element < code > factory < / code > */ p...
List < Node > nodeList = model . get ( "factory" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new FacesConfigFactoryTypeImpl < WebFacesConfigDescriptor > ( this , "factory" , model , nodeList . get ( 0 ) ) ; } return createFactory ( ) ;
public class DecoratedUserContext { /** * Decorates a newly - created UserContext ( as would be returned by * getUserContext ( ) ) , invoking the decorate ( ) function of the given * AuthenticationProvider to apply an additional layer of decoration . If the * AuthenticationProvider originated the given UserContex...
// Skip the AuthenticationProvider which produced the UserContext // being decorated if ( authProvider != userContext . getAuthenticationProvider ( ) ) { // Apply layer of wrapping around UserContext UserContext decorated = authProvider . decorate ( userContext , authenticatedUser , credentials ) ; // Do not allow misb...
public class Math { /** * Determines if the polygon contains the specified coordinates . * @ param x the specified x coordinate . * @ param y the specified y coordinate . * @ return true if the Polygon contains the specified coordinates ; false otherwise . */ public static boolean contains ( double [ ] [ ] polygo...
if ( polygon . length <= 2 ) { return false ; } int hits = 0 ; int n = polygon . length ; double lastx = polygon [ n - 1 ] [ 0 ] ; double lasty = polygon [ n - 1 ] [ 1 ] ; double curx , cury ; // Walk the edges of the polygon for ( int i = 0 ; i < n ; lastx = curx , lasty = cury , i ++ ) { curx = polygon [ i ] [ 0 ] ; ...
public class BatchPutScheduledUpdateGroupActionRequest { /** * One or more scheduled actions . The maximum number allowed is 50. * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setScheduledUpdateGroupActions ( java . util . Collection ) } or * { @ link # wi...
if ( this . scheduledUpdateGroupActions == null ) { setScheduledUpdateGroupActions ( new com . amazonaws . internal . SdkInternalList < ScheduledUpdateGroupActionRequest > ( scheduledUpdateGroupActions . length ) ) ; } for ( ScheduledUpdateGroupActionRequest ele : scheduledUpdateGroupActions ) { this . scheduledUpdateG...
public class RoomInfoImpl { /** * / * ( non - Javadoc ) * @ see com . tvd12 . ezyfox . core . command . UpdateRoomInfo # removeAllVariables ( ) */ @ Override public void removeAllVariables ( ) { } }
List < RoomVariable > vars = room . getVariables ( ) ; for ( RoomVariable var : vars ) var . setNull ( ) ; api . setRoomVariables ( null , room , vars , true , true , false ) ;
public class Ui { /** * Get color array values form array resource * @ param resources Resources * @ param resId Resources id * @ return color array */ public static int [ ] getColorsFromArrayRes ( Resources resources , int resId ) { } }
try { @ SuppressLint ( "Recycle" ) TypedArray array = resources . obtainTypedArray ( resId ) ; if ( array . length ( ) > 0 ) { final int len = array . length ( ) ; final int [ ] colors = new int [ len ] ; for ( int i = 0 ; i < len ; i ++ ) { colors [ i ] = array . getColor ( i , 0 ) ; } return colors ; } } catch ( Reso...
public class NextGenRTLogger { public void persistToFile ( ) throws IOException { } }
if ( logFile != null ) { FileOutputStream fos = new FileOutputStream ( logFile + ".rtbin" ) ; ObjectOutputStream out = new ObjectOutputStream ( fos ) ; out . writeObject ( cpuMap ) ; out . writeObject ( busMap ) ; out . writeObject ( objectMap ) ; out . writeObject ( classDefMap ) ; out . writeObject ( operationMap ) ;...
public class IntervalComparator { /** * ~ Methoden - - - - - */ @ Override public int compare ( ChronoInterval < T > o1 , ChronoInterval < T > o2 ) { } }
Boundary < T > bs1 = o1 . getStart ( ) ; Boundary < T > bs2 = o2 . getStart ( ) ; if ( bs1 . isInfinite ( ) ) { if ( bs2 . isInfinite ( ) ) { return this . compareEnd ( o1 , o2 ) ; } else { return - 1 ; } } else if ( bs2 . isInfinite ( ) ) { return 1 ; } T start1 = bs1 . getTemporal ( ) ; T start2 = bs2 . getTemporal (...
public class DRL6Expressions { /** * src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 622:1 : parExpression returns [ BaseDescr result ] : LEFT _ PAREN expr = expression RIGHT _ PAREN ; */ public final BaseDescr parExpression ( ) throws RecognitionException { } }
BaseDescr result = null ; ParserRuleReturnScope expr = null ; try { // src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 623:5 : ( LEFT _ PAREN expr = expression RIGHT _ PAREN ) // src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 623:7 : LEFT _ PAREN expr = e...
public class rnat6 { /** * Use this API to clear rnat6 resources . */ public static base_responses clear ( nitro_service client , rnat6 resources [ ] ) throws Exception { } }
base_responses result = null ; if ( resources != null && resources . length > 0 ) { rnat6 clearresources [ ] = new rnat6 [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { clearresources [ i ] = new rnat6 ( ) ; clearresources [ i ] . name = resources [ i ] . name ; } result = perform_operation...
public class Parser { /** * A { @ link Parser } that returns { @ code defaultValue } if { @ code this } fails with no partial match . */ public final Parser < T > optional ( T defaultValue ) { } }
return Parsers . or ( this , Parsers . constant ( defaultValue ) ) ;
public class VCardManager { /** * Returns true if the given entity understands the vCard - XML format and allows the exchange of such . * @ param jid * @ param connection * @ return true if the given entity understands the vCard - XML format and exchange . * @ throws XMPPErrorException * @ throws NoResponseEx...
return VCardManager . getInstanceFor ( connection ) . isSupported ( jid ) ;
public class ApiOvhRouter { /** * Add a VPN to your router * REST : POST / router / { serviceName } / vpn * @ param serverPrivNet [ required ] Server ' s private network * @ param psk [ required ] Your PSK key * @ param clientIp [ required ] IP you will be connecting from / NULL ( allow all ) * @ param client...
String qPath = "/router/{serviceName}/vpn" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "clientIp" , clientIp ) ; addBody ( o , "clientPrivNet" , clientPrivNet ) ; addBody ( o , "psk" , psk ) ; addBody ( o , "serverPrivNet" , ser...
public class Retryer { /** * Sets the strategy that sleeps a fixed amount of time after the first * failed attempt and in incrementing amounts of time after each additional failed attempt . * @ param initialSleepTime * @ param initialSleepUnit * @ param increment * @ param incrementUnit * @ return */ public...
return incrementingWait ( checkNotNull ( initialSleepUnit ) . toMillis ( initialSleepTime ) , checkNotNull ( incrementUnit ) . toMillis ( increment ) ) ;
public class GraphHopper { /** * Potentially wraps the specified weighting into a TurnWeighting instance . */ public Weighting createTurnWeighting ( Graph graph , Weighting weighting , TraversalMode tMode ) { } }
FlagEncoder encoder = weighting . getFlagEncoder ( ) ; if ( encoder . supports ( TurnWeighting . class ) && ! tMode . equals ( TraversalMode . NODE_BASED ) ) return new TurnWeighting ( weighting , ( TurnCostExtension ) graph . getExtension ( ) ) ; return weighting ;
public class WebDriverTool { /** * Finds the first element . Uses the internal { @ link WebElementFinder } , which tries to apply * the specified { @ code condition } until it times out . * @ param by * the { @ link By } used to locate the element * @ param condition * a condition the found element must meet ...
return findElement ( by , condition ) ;
public class AmazonQuickSightClient { /** * Generates a server - side embeddable URL and authorization code . Before this can work properly , first you need to * configure the dashboards and user permissions . For more information , see < a * href = " https : / / docs . aws . amazon . com / en _ us / quicksight / l...
request = beforeClientExecution ( request ) ; return executeGetDashboardEmbedUrl ( request ) ;
public class SearchExpressionFacade { /** * Resolves a { @ link UIComponent } for the given expression . * @ param context The { @ link FacesContext } . * @ param source The source component . E . g . a button . * @ param expression The search expression . * @ return A resolved { @ link UIComponent } or < code ...
return resolveComponent ( context , source , expression , SearchExpressionHint . NONE ) ;
public class IoUtil { /** * 从流中读取内容 , 读到输出流中 * @ param < T > 读取对象的类型 * @ param in 输入流 * @ return 输出流 * @ throws IORuntimeException IO异常 * @ throws UtilException ClassNotFoundException包装 */ public static < T > T readObj ( InputStream in ) throws IORuntimeException , UtilException { } }
if ( in == null ) { throw new IllegalArgumentException ( "The InputStream must not be null" ) ; } ObjectInputStream ois = null ; try { ois = new ObjectInputStream ( in ) ; @ SuppressWarnings ( "unchecked" ) // may fail with CCE if serialised form is incorrect final T obj = ( T ) ois . readObject ( ) ; return obj ; } ca...
public class WebDriverTool { /** * Opens a new window and switches to it . The window to switch to is determined by diffing * the given { @ code existingWindowHandles } with the current ones . The difference must be * exactly one window handle which is then used to switch to . * @ param openCommand * logic for ...
String oldHandle = webDriver . getWindowHandle ( ) ; final Set < String > existingWindowHandles = webDriver . getWindowHandles ( ) ; openCommand . run ( ) ; Function < WebDriver , String > function = new Function < WebDriver , String > ( ) { @ Override public String apply ( final WebDriver input ) { Set < String > newW...
public class Utils { /** * Replies the version of the SARL library on the classpath . * @ param typeReferences - the accessor to the types . * @ param context the context that is providing the access to the classpath . * @ param version the version of the SARL library that was found , according to the returned er...
if ( checkSarlVersionClass ) { checkSarlVersionClass = false ; try { final Object v = SARLVersion . class . getDeclaredField ( SARL_VERSION_FIELD_NAME_STR ) ; if ( v == null ) { return SarlLibraryErrorCode . INVALID_SARL_VERSION_BYTECODE ; } } catch ( Throwable e ) { return SarlLibraryErrorCode . INVALID_SARL_VERSION_B...
public class TemplateFilterPageTreeProvider { /** * Searches for page content nodes under the { @ code pRootPath } with given * template It uses a XPATH query and return the node iterator of results . * @ param templates * @ param rootPath * @ return results node iterator * @ throws RepositoryException */ @ S...
String queryString = "/jcr:root" + ISO9075 . encodePath ( rootPath ) + "//*" + "[@cq:template='" + StringUtils . join ( escapeXPathQueryExpressions ( templates ) , "' or @cq:template='" ) + "']" ; QueryManager queryManager = request . getResourceResolver ( ) . adaptTo ( Session . class ) . getWorkspace ( ) . getQueryMa...
public class GosuStringUtil { /** * Replaces all occurrences of Strings within another String . * A < code > null < / code > reference passed to this method is a no - op , or if * any " search string " or " string to replace " is null , that replace will be * ignored . This will not repeat . For repeating replace...
return replaceEach ( text , searchList , replacementList , false , 0 ) ;
public class AbstractIoBuffer { /** * { @ inheritDoc } */ @ Override public final IoBuffer compact ( ) { } }
int remaining = remaining ( ) ; int capacity = capacity ( ) ; if ( capacity == 0 ) { return this ; } if ( isAutoShrink ( ) && remaining <= capacity >>> 2 && capacity > minimumCapacity ) { int newCapacity = capacity ; int minCapacity = Math . max ( minimumCapacity , remaining << 1 ) ; for ( ; ; ) { if ( newCapacity >>> ...
public class Contexts { /** * Creates a new context with the given property mappings . * @ param mappings The property mappings for the context * @ return the context */ public static Context createContext ( Collection < PropertyMapping < ? > > mappings ) { } }
IdentityHashMap < ContextProperty < ? > , Object > properties = new IdentityHashMap < ContextProperty < ? > , Object > ( mappings . size ( ) ) ; for ( final PropertyMapping < ? > mapping : mappings ) { properties . put ( mapping . property , mapping . value ) ; } return ImmutableContext . createUnsafe ( properties ) ;
public class Predict { /** * < p > < b > Note : The streams are NOT closed < / b > < / p > */ static void doPredict ( BufferedReader reader , Writer writer , Model model ) throws IOException { } }
int correct = 0 ; int total = 0 ; double error = 0 ; double sump = 0 , sumt = 0 , sumpp = 0 , sumtt = 0 , sumpt = 0 ; int nr_class = model . getNrClass ( ) ; double [ ] prob_estimates = null ; int n ; int nr_feature = model . getNrFeature ( ) ; if ( model . bias >= 0 ) n = nr_feature + 1 ; else n = nr_feature ; if ( fl...
public class TransformersLogger { /** * Log a warning for the resource at the provided address and the given attributes . The detail message is a default * ' Attributes are not understood in the target model version and this resource will need to be ignored on the target host . ' * @ param address where warning occ...
logAttributeWarning ( address , null , null , attributes ) ;
public class Download { /** * Starts downloading * @ throws IOException if the file could not downloaded */ @ TaskAction public void download ( ) throws IOException { } }
action . execute ( ) ; // handle ' upToDate ' try { if ( action . isUpToDate ( ) ) { Method getState = this . getClass ( ) . getMethod ( "getState" ) ; Object state = getState . invoke ( this ) ; try { // prior to Gradle 3.2 we needed to do this Method upToDate = state . getClass ( ) . getMethod ( "upToDate" ) ; upToDa...
public class IonTextUtils { /** * Prints a single Unicode code point for use in an ASCII - safe JSON string . * @ param out the stream to receive the data . * @ param codePoint a Unicode code point . */ public static void printJsonCodePoint ( Appendable out , int codePoint ) throws IOException { } }
// JSON only allows double - quote strings . printCodePoint ( out , codePoint , EscapeMode . JSON ) ;
public class FunctionArgumentInjector { /** * Get a mapping for function parameter names to call arguments . */ static ImmutableMap < String , Node > getFunctionCallParameterMap ( final Node fnNode , Node callNode , Supplier < String > safeNameIdSupplier ) { } }
checkNotNull ( fnNode ) ; // Create an argName - > expression map ImmutableMap . Builder < String , Node > argMap = ImmutableMap . builder ( ) ; // CALL NODE : [ NAME , ARG1 , ARG2 , . . . ] Node cArg = callNode . getSecondChild ( ) ; if ( cArg != null && NodeUtil . isFunctionObjectCall ( callNode ) ) { argMap . put ( ...
public class AbstractJaxbMojo { /** * Acquires the staleFile for this execution * @ return the staleFile ( used to define where ) for this execution */ protected final File getStaleFile ( ) { } }
final String staleFileName = "." + ( getExecution ( ) == null ? "nonExecutionJaxb" : getExecution ( ) . getExecutionId ( ) ) + "-" + getStaleFileName ( ) ; return new File ( staleFileDirectory , staleFileName ) ;
public class BaseFFDCService { /** * PM39875 - use dumpAlgorithm from legacy FFDC ( See com . ibm . ws . ffdc . FFDCFilter in WAS61 release ) to determine * when a summary table should be dumped . */ synchronized private boolean dumpAlgorithm ( long currentTime ) { } }
boolean dumpTable = false ; numberOfEntiesProcessed ++ ; // Increment the number of entries updated in the table if ( ( lastTimeOfDump == Long . MIN_VALUE ) // Note we check this since if currentTime is zero or more , the line below will be false due to arthimetic overflow || ( currentTime - lastTimeOfDump > highWaterT...
public class CmsClientSitemapEntry { /** * Sets the site path . < p > * @ param sitepath the site path to set */ public void setSitePath ( String sitepath ) { } }
if ( ! isLeafType ( ) && ! sitepath . endsWith ( "/" ) ) { sitepath = sitepath + "/" ; } m_sitePath = sitepath ;
public class JBBPDslBuilder { /** * Add named signed short field . * @ param name name of the field , can be null for anonymous one * @ return the builder instance , must not be null */ public JBBPDslBuilder Short ( final String name ) { } }
final Item item = new Item ( BinType . SHORT , name , this . byteOrder ) ; this . addItem ( item ) ; return this ;
public class VerificationCodeImage { /** * 生成一张背景为白色的空白图片 * @ return 返回此图片 */ private BufferedImage generateBlankImg ( ) { } }
BufferedImage image = new BufferedImage ( w , h , BufferedImage . TYPE_INT_RGB ) ; Graphics2D g2 = ( Graphics2D ) image . getGraphics ( ) ; // 设置图片背景是白色 g2 . setColor ( Color . WHITE ) ; g2 . fillRect ( 0 , 0 , w , h ) ; g2 . dispose ( ) ; return image ;
public class ClassUtils { /** * Determine the common ancestor of the given classes , if any . * @ param clazz1 the class to introspect * @ param clazz2 the other class to introspect * @ return the common ancestor ( i . e . common superclass , one interface * extending the other ) , or { @ code null } if none fo...
if ( clazz1 == null ) { return clazz2 ; } if ( clazz2 == null ) { return clazz1 ; } if ( clazz1 . isAssignableFrom ( clazz2 ) ) { return clazz1 ; } if ( clazz2 . isAssignableFrom ( clazz1 ) ) { return clazz2 ; } Class < ? > ancestor = clazz1 ; do { ancestor = ancestor . getSuperclass ( ) ; if ( ancestor == null || Obje...
public class Conditions { /** * 获得条件的绑定参数映射 * @ param conditions */ public static Map < String , Object > getParamMap ( final Collection < Condition > conditions ) { } }
final Map < String , Object > params = new HashMap < String , Object > ( ) ; for ( final Condition con : conditions ) { params . putAll ( getParamMap ( con ) ) ; } return params ;
public class Base64 { /** * Encodes an input stream to base64 , returning bytes . * The stream is guaranteed to be closed when this method returns , whether * successful or not . * @ param in stream to encode * @ return encoded bytes , or null if there ' s an error reading the stream */ public static byte [ ] e...
Base64OutputStream out = null ; try { ByteArrayOutputStream bytes = new ByteArrayOutputStream ( ) ; out = new Base64OutputStream ( bytes ) ; byte [ ] buf = new byte [ 4096 ] ; int len ; while ( ( len = in . read ( buf ) ) > 0 ) { out . write ( buf , 0 , len ) ; } out . flush ( ) ; return bytes . toByteArray ( ) ; } cat...
public class LineItemSummary { /** * Gets the creationDateTime value for this LineItemSummary . * @ return creationDateTime * This attribute may be { @ code null } for line items created before * this feature was introduced . */ public com . google . api . ads . admanager . axis . v201808 . DateTime getCreationDate...
return creationDateTime ;
public class Transloadit { /** * Returns a list of all templates under the user account * @ param options { @ link Map } extra options to send along with the request . * @ return { @ link ListResponse } * @ throws RequestException if request to transloadit server fails . * @ throws LocalOperationException if so...
Request request = new Request ( this ) ; return new ListResponse ( request . get ( "/templates" , options ) ) ;
public class LibGdxCliOutputBuffer { /** * Add a single line to this buffer . * The line may contain a ' \ n ' character , and it will be honored , but this is discouraged . * @ param text Line text . * @ param color Line color . */ public void println ( String text , Color color ) { } }
final Label label = new Label ( text , skin , "outputEntry" ) ; label . setColor ( color ) ; label . setWrap ( true ) ; addLabel ( label ) ;
public class UtilImpl_IdentityStringSet { /** * { @ inheritDoc } */ @ SuppressWarnings ( "unchecked" ) @ Override public < S > S [ ] toArray ( S [ ] targetArray ) { } }
if ( this . size > targetArray . length ) { Class < ? > componentType = this . storage . getClass ( ) . getComponentType ( ) ; targetArray = ( S [ ] ) Array . newInstance ( componentType , this . size ) ; } System . arraycopy ( this . storage , 0 , targetArray , 0 , this . size ) ; if ( this . size < targetArray . leng...
public class BoneCPDataSource { /** * 获取数据库连接 * @ return 数据库连接 */ public Connection getConnection ( ) throws IOException { } }
Connection conn = null ; if ( this . datasource != null ) { try { conn = this . datasource . getConnection ( ) ; } catch ( SQLException e ) { throw new IOException ( e ) ; } } return conn ;
public class VirtualNetworkPeeringsInner { /** * Gets all virtual network peerings in a virtual network . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedLis...
return listNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < VirtualNetworkPeeringInner > > , Page < VirtualNetworkPeeringInner > > ( ) { @ Override public Page < VirtualNetworkPeeringInner > call ( ServiceResponse < Page < VirtualNetworkPeeringInner > > response ) { return resp...
public class ZPoller { /** * gets all the items of this poller regarding the given input */ protected Iterable < ItemHolder > items ( final Object socketOrChannel ) { } }
final CompositePollItem aggregate = items . get ( socketOrChannel ) ; if ( aggregate == null ) { return Collections . emptySet ( ) ; } return aggregate . holders ;
public class Query { /** * < pre > * { $ and : [ expressions ] } * { $ or : [ expressions ] } * < / pre > */ public static Query logical ( LogOp op , Collection < Query > expressions ) { } }
Query q = new Query ( true ) ; for ( Query x : expressions ) { ( ( ArrayNode ) q . node ) . add ( x . toJson ( ) ) ; } Query a = new Query ( false ) ; a . add ( op . toString ( ) , q . toJson ( ) ) ; return a ;
public class RequestFactory { /** * Create a request builder for a create operation for a multiple items * @ param items The item to update * @ return The request builder */ public UpdateCollectionRequestBuilder < T , ID > update ( List < T > items ) { } }
return new UpdateCollectionRequestBuilder < T , ID > ( version , type , entityName , items ) ;
public class HopkinsStatisticClusteringTendency { /** * Runs the algorithm in the timed evaluation part . * @ param database Database context * @ param relation Relation to analyze */ public Result run ( Database database , Relation < NumberVector > relation ) { } }
final int dim = RelationUtil . dimensionality ( relation ) ; final DistanceQuery < NumberVector > distanceQuery = database . getDistanceQuery ( relation , getDistanceFunction ( ) ) ; final KNNQuery < NumberVector > knnQuery = database . getKNNQuery ( distanceQuery , k + 1 ) ; final double [ ] min = new double [ dim ] ,...
public class JPAApplInfo { /** * Close all EntityManagerFactories in all scopes in this application . */ void closeAllScopeModules ( ) { } }
synchronized ( puScopes ) { for ( String module : puScopes . keySet ( ) ) { close ( module , false ) ; // PK59717 } puScopes . clear ( ) ; }
public class ExclusionRandomizerRegistry { /** * { @ inheritDoc } */ @ Override public Randomizer < ? > getRandomizer ( Field field ) { } }
for ( Predicate < Field > fieldPredicate : fieldPredicates ) { if ( fieldPredicate . test ( field ) ) { return new SkipRandomizer ( ) ; } } return null ;
public class ReloadableResourceBundleMessageSource { /** * Calculate all filenames for the given bundle basename and Locale . * Will calculate filenames for the given Locale , the system Locale * ( if applicable ) , and the default file . * @ param basename the basename of the bundle * @ param locale the locale...
Pair < String , Locale > cacheKey = new Pair < String , Locale > ( basename , locale ) ; return CacheEntry . getValue ( cachedFilenames , cacheKey , cacheMillis , new Callable < List < Pair < String , Resource > > > ( ) { @ Override public List < Pair < String , Resource > > call ( ) throws Exception { List < String > ...
public class SwaptionAnalyticApproximationRebonato { /** * This function calculate the partial derivative < i > d log ( S ) / d log ( L < sub > k < / sub > ) < / i > for * a given swap rate with respect to a vector of forward rates ( on a given forward rate tenor ) . * It also returns some useful other quantities l...
/* * Small workaround for the case that the discount curve is not set . This part will be removed later . */ AnalyticModel model = null ; if ( discountCurveInterface == null ) { discountCurveInterface = new DiscountCurveFromForwardCurve ( forwardCurveInterface . getName ( ) ) ; model = new AnalyticModel ( new CurveInte...
public class XFunctionTypeRefImplCustom { /** * TODO should we update the type as soon as the number of argument types changes ? */ @ Override public JvmType getType ( ) { } }
if ( this . type == null ) { // / / make sure scoping has taken place and installed an IJvmTypeProvider // if ( returnType ! = null ) // returnType . getType ( ) ; JvmType newType = TypesFactory . eINSTANCE . createJvmVoid ( ) ; ( ( InternalEObject ) newType ) . eSetProxyURI ( computeTypeUri ( isProcedure ( ) ) ) ; typ...
public class HttpRequestUtils { /** * parse a string as number and throws exception if parsed value is not a valid integer * @ throws ExecutorManagerException if paramName is not a valid integer */ public static boolean validateIntegerParam ( final Map < String , String > params , final String paramName ) throws Exec...
if ( params != null && params . containsKey ( paramName ) && ! StringUtils . isNumeric ( params . get ( paramName ) ) ) { throw new ExecutorManagerException ( paramName + " should be an integer" ) ; } return true ;
public class CommonOps_DDRM { /** * < p > Performs matrix scalar subtraction : < br > * < br > * c = val - a < br > * c < sub > ij < / sub > = val - a < sub > ij < / sub > < br > * @ param val ( input ) The value that ' s subtracted to each element . * @ param a ( input ) A matrix . Not modified . * @ param...
c . reshape ( a . numRows , a . numCols ) ; final int length = a . getNumElements ( ) ; for ( int i = 0 ; i < length ; i ++ ) { c . data [ i ] = val - a . data [ i ] ; }
public class BsfUtils { /** * Selects the Date Pattern to use based on the given Locale if the input * format is null * @ param locale * Locale ( may be the result of a call to selectLocale ) * @ param momentJSFormat * Input format String * @ return moment . js Date Pattern eg . DD / MM / YYYY */ public sta...
if ( momentJSFormat == null ) { String dateFormat = "" ; if ( withDate ) { dateFormat = ( ( SimpleDateFormat ) DateFormat . getDateInstance ( DateFormat . SHORT , locale ) ) . toPattern ( ) ; } String timeFormat = "" ; if ( withTime ) { timeFormat = ( ( SimpleDateFormat ) DateFormat . getTimeInstance ( DateFormat . MED...
public class PrincipalUserDto { /** * Converts list of alert entity objects to list of alertDto objects . * @ param users alerts List of alert entities . Cannot be null . * @ return List of alertDto objects . * @ throws WebApplicationException If an error occurs . */ public static List < PrincipalUserDto > transf...
if ( users == null ) { throw new WebApplicationException ( "Null entity object cannot be converted to Dto object." , Status . INTERNAL_SERVER_ERROR ) ; } List < PrincipalUserDto > result = new ArrayList < > ( ) ; for ( PrincipalUser user : users ) { result . add ( transformToDto ( user ) ) ; } return result ;
public class ByteArray { /** * Convert a byte array to a long . * @ param value The array to convert . * @ return The long value . */ public static long fromBytes ( byte [ ] value ) { } }
if ( value == null ) return 0 ; long out = 0 ; int length = value . length ; if ( length > 8 ) length = 8 ; for ( int i = 0 ; i < length ; i ++ ) { out = ( out << 8 ) + ( value [ i ] & 0xff ) ; } return out ;
public class URIUtils { /** * Construct a new uri by replacing query parameters in initialUri with the query parameters provided . * @ param initialUri the initial / template URI * @ param queryParams the new query parameters . */ public static URI setQueryParams ( final URI initialUri , final Multimap < String , S...
StringBuilder queryString = new StringBuilder ( ) ; for ( Map . Entry < String , String > entry : queryParams . entries ( ) ) { if ( queryString . length ( ) > 0 ) { queryString . append ( "&" ) ; } queryString . append ( entry . getKey ( ) ) . append ( "=" ) . append ( entry . getValue ( ) ) ; } try { if ( initialUri ...
public class ThinTableModel { /** * Change the tableheader to display this sort column and order . */ public void setSortedByColumn ( JTableHeader tableHeader , int iViewColumn , boolean bOrder ) { } }
if ( ! ( tableHeader . getDefaultRenderer ( ) instanceof SortableHeaderRenderer ) ) tableHeader . setDefaultRenderer ( new SortableHeaderRenderer ( tableHeader . getDefaultRenderer ( ) ) ) ; // Set up header renderer the first time ( ( SortableHeaderRenderer ) tableHeader . getDefaultRenderer ( ) ) . setSortedByColumn ...
public class CssEscape { /** * Perform a CSS String level 1 ( only basic set ) < strong > escape < / strong > operation * on a < tt > String < / tt > input . * < em > Level 1 < / em > means this method will only escape the CSS String basic escape set : * < ul > * < li > The < em > Backslash Escapes < / em > : ...
return escapeCssString ( text , CssStringEscapeType . BACKSLASH_ESCAPES_DEFAULT_TO_COMPACT_HEXA , CssStringEscapeLevel . LEVEL_1_BASIC_ESCAPE_SET ) ;
public class FileLastModifiedFilter { /** * Factory method to create an instance of the { @ link FileLastModifiedFilter } that evaluates and filters { @ link File } s * based on whether they were last modified before the given date / time . * @ param dateTime { @ link LocalDateTime } used to filter { @ link File } ...
return before ( dateTime . atZone ( ZoneId . systemDefault ( ) ) . toInstant ( ) . toEpochMilli ( ) ) ;
public class ClassWriter { /** * Given a symbol , return its name - and - type . */ NameAndType nameType ( Symbol sym ) { } }
return new NameAndType ( fieldName ( sym ) , retrofit ? sym . erasure ( types ) : sym . externalType ( types ) , types ) ; // if we retrofit , then the NameAndType has been read in as is // and no change is necessary . If we compile normally , the // NameAndType is generated from a symbol reference , and the // adjustm...