signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class ClassFile { /** * Return internal representation of buf [ offset . . offset + len - 1 ] , converting ' / ' to ' . ' .
* Note : the naming is the inverse of that used by JVMS 4.2 The Internal Form Of Names ,
* which defines " internal name " to be the form using " / " instead of " . " */
public static byte [ ] internalize ( byte [ ] buf , int offset , int len ) { } }
|
byte [ ] translated = new byte [ len ] ; for ( int j = 0 ; j < len ; j ++ ) { byte b = buf [ offset + j ] ; if ( b == '/' ) translated [ j ] = ( byte ) '.' ; else translated [ j ] = b ; } return translated ;
|
public class HttpURLConnection { /** * Returns the key for the { @ code n } < sup > th < / sup > header field .
* @ param pIndex an index .
* @ return the key for the { @ code n } < sup > th < / sup > header field ,
* or { @ code null } if there are fewer than { @ code n }
* fields . */
public String getHeaderFieldKey ( int pIndex ) { } }
|
// TODO : getInputStream ( ) first , to make sure we have header fields
if ( pIndex >= responseHeaders . length ) { return null ; } String field = responseHeaders [ pIndex ] ; if ( StringUtil . isEmpty ( field ) ) { return null ; } int idx = field . indexOf ( ':' ) ; return StringUtil . toLowerCase ( ( ( idx > 0 ) ? field . substring ( 0 , idx ) : field ) ) ;
|
public class Config13BuilderImpl { /** * Get the sources , default , discovered and user registered sources are
* included as appropriate .
* Call this method only from within a ' synchronized ( this ) block
* @ return sources as a sorted set */
@ Override protected SortedSources getSources ( ) { } }
|
SortedSources sources = new SortedSources ( getUserSources ( ) ) ; if ( addDefaultSourcesFlag ( ) ) { sources . addAll ( Config13DefaultSources . getDefaultSources ( getClassLoader ( ) ) ) ; } if ( addDiscoveredSourcesFlag ( ) ) { sources . addAll ( Config13DefaultSources . getDiscoveredSources ( getClassLoader ( ) ) ) ; } sources = sources . unmodifiable ( ) ; return sources ;
|
public class GaussianNumericAttributeClassObserver { /** * assume all values equal to splitValue go to lhs */
public double [ ] [ ] getClassDistsResultingFromBinarySplit ( double splitValue ) { } }
|
DoubleVector lhsDist = new DoubleVector ( ) ; DoubleVector rhsDist = new DoubleVector ( ) ; for ( int i = 0 ; i < this . attValDistPerClass . size ( ) ; i ++ ) { GaussianEstimator estimator = this . attValDistPerClass . get ( i ) ; if ( estimator != null ) { if ( splitValue < this . minValueObservedPerClass . getValue ( i ) ) { rhsDist . addToValue ( i , estimator . getTotalWeightObserved ( ) ) ; } else if ( splitValue >= this . maxValueObservedPerClass . getValue ( i ) ) { lhsDist . addToValue ( i , estimator . getTotalWeightObserved ( ) ) ; } else { double [ ] weightDist = estimator . estimatedWeight_LessThan_EqualTo_GreaterThan_Value ( splitValue ) ; lhsDist . addToValue ( i , weightDist [ 0 ] + weightDist [ 1 ] ) ; rhsDist . addToValue ( i , weightDist [ 2 ] ) ; } } } return new double [ ] [ ] { lhsDist . getArrayRef ( ) , rhsDist . getArrayRef ( ) } ;
|
public class ConstructorWriterImpl { /** * { @ inheritDoc } */
@ Override public void addTags ( ExecutableElement constructor , Content constructorDocTree ) { } }
|
writer . addTagsInfo ( constructor , constructorDocTree ) ;
|
public class ZeroMQNetworkService { /** * Receive data from the network .
* @ param socket
* - network reader .
* @ return the envelope received over the network .
* @ throws IOException
* if the envelope cannot be read from the network . */
private static EventEnvelope extractEnvelope ( Socket socket ) throws IOException { } }
|
// To - Do : Read the ZeroMQ socket via a NIO wrapper to support large data :
// indeed the arrays has a maximal size bounded by a native int value , and
// the real data could be larger than this limit .
byte [ ] data = socket . recv ( ZMQ . DONTWAIT ) ; byte [ ] cdata ; int oldSize = 0 ; while ( socket . hasReceiveMore ( ) ) { cdata = socket . recv ( ZMQ . DONTWAIT ) ; oldSize = data . length ; data = Arrays . copyOf ( data , data . length + cdata . length ) ; System . arraycopy ( cdata , 0 , data , oldSize , cdata . length ) ; } final ByteBuffer buffer = ByteBuffer . wrap ( data ) ; final byte [ ] contextId = readBlock ( buffer ) ; assert contextId != null && contextId . length > 0 ; final byte [ ] spaceId = readBlock ( buffer ) ; assert spaceId != null && spaceId . length > 0 ; final byte [ ] scope = readBlock ( buffer ) ; assert scope != null && scope . length > 0 ; final byte [ ] headers = readBlock ( buffer ) ; assert headers != null && headers . length > 0 ; final byte [ ] body = readBlock ( buffer ) ; assert body != null && body . length > 0 ; return new EventEnvelope ( contextId , spaceId , scope , headers , body ) ;
|
public class YEmitter { /** * syck _ emitter _ set _ resolver */
@ JRubyMethod public static IRubyObject set_resolver ( IRubyObject self , IRubyObject resolver ) { } }
|
( ( RubyObject ) self ) . fastSetInstanceVariable ( "@resolver" , resolver ) ; return self ;
|
public class CollapseSpliterator { /** * < ? | acc | last > + r */
private R pushRight ( R acc , T last ) { } }
|
a = none ( ) ; if ( right == null ) return acc ; synchronized ( root ) { Connector < T , R > r = right ; if ( r == null ) return acc ; right = null ; r . lhs = null ; T raleft = r . left ; r . left = none ( ) ; if ( r . acc == NONE ) { if ( acc == NONE ) { r . drain ( ) ; } else { r . acc = acc ; r . right = last ; } return none ( ) ; } if ( acc == NONE ) { return r . drainRight ( ) ; } if ( mergeable . test ( last , raleft ) ) { r . acc = combiner . apply ( acc , r . acc ) ; return r . drainRight ( ) ; } if ( r . right == NONE ) right = new Connector < > ( this , r . drain ( ) , null ) ; return acc ; }
|
public class JaxWsHandler { /** * Extracts the { @ link JaxWsSoapContextHandler } object from a SOAP client ' s
* handler chain .
* In the event that no { @ code JaxWsSoapContextHandler } object could be found ,
* this method throws an { @ code IllegalStateException } .
* @ param soapClient the JAX - WS soap client whose handler is needed
* @ return the { @ code JaxWsSoapContextHandler } handler in the given client ' s
* handler chain */
private JaxWsSoapContextHandler getContextHandlerFromClient ( BindingProvider soapClient ) { } }
|
@ SuppressWarnings ( "rawtypes" ) // getHandlerChain returns a list of raw Handler .
List < Handler > handlers = soapClient . getBinding ( ) . getHandlerChain ( ) ; for ( Handler < ? > handler : handlers ) { if ( handler instanceof JaxWsSoapContextHandler ) { return ( JaxWsSoapContextHandler ) handler ; } } throw new IllegalStateException ( "The SOAP client passed into the JaxWsHandler does not " + "have the necessary context handler on its binding chain." ) ;
|
public class WriterFactoryImpl { /** * { @ inheritDoc } */
public MemberSummaryWriter getMemberSummaryWriter ( AnnotationTypeWriter annotationTypeWriter , int memberType ) throws Exception { } }
|
switch ( memberType ) { case VisibleMemberMap . ANNOTATION_TYPE_FIELDS : return ( AnnotationTypeFieldWriterImpl ) getAnnotationTypeFieldWriter ( annotationTypeWriter ) ; case VisibleMemberMap . ANNOTATION_TYPE_MEMBER_OPTIONAL : return ( AnnotationTypeOptionalMemberWriterImpl ) getAnnotationTypeOptionalMemberWriter ( annotationTypeWriter ) ; case VisibleMemberMap . ANNOTATION_TYPE_MEMBER_REQUIRED : return ( AnnotationTypeRequiredMemberWriterImpl ) getAnnotationTypeRequiredMemberWriter ( annotationTypeWriter ) ; default : return null ; }
|
public class MMAXAnnotation { /** * setter for attributeList - sets List of attributes of the MMAX annotation .
* @ generated
* @ param v value to set into the feature */
public void setAttributeList ( FSArray v ) { } }
|
if ( MMAXAnnotation_Type . featOkTst && ( ( MMAXAnnotation_Type ) jcasType ) . casFeat_attributeList == null ) jcasType . jcas . throwFeatMissing ( "attributeList" , "de.julielab.jules.types.mmax.MMAXAnnotation" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( MMAXAnnotation_Type ) jcasType ) . casFeatCode_attributeList , jcasType . ll_cas . ll_getFSRef ( v ) ) ;
|
public class GenomicsChannel { /** * Create a new gRPC channel to the Google Genomics API , using the application default credentials
* for auth .
* @ param fields Which fields to return in the partial response , or null for none .
* @ return The ManagedChannel .
* @ throws SSLException
* @ throws IOException */
public static ManagedChannel fromDefaultCreds ( String fields ) throws SSLException , IOException { } }
|
return fromCreds ( CredentialFactory . getApplicationDefaultCredentials ( ) , fields ) ;
|
public class DurationHelper { /** * Converts a formatted String into a Duration object .
* @ param formattedDuration
* String in { @ link # DURATION _ FORMAT }
* @ return duration
* @ throws DateTimeParseException
* when String is in wrong format */
public static Duration formattedStringToDuration ( final String formattedDuration ) { } }
|
if ( formattedDuration == null ) { return null ; } final TemporalAccessor ta = DateTimeFormatter . ofPattern ( DURATION_FORMAT ) . parse ( formattedDuration . trim ( ) ) ; return Duration . between ( LocalTime . MIDNIGHT , LocalTime . from ( ta ) ) ;
|
public class Service { /** * < pre >
* Quota configuration .
* < / pre >
* < code > . google . api . Quota quota = 10 ; < / code > */
public com . google . api . Quota getQuota ( ) { } }
|
return quota_ == null ? com . google . api . Quota . getDefaultInstance ( ) : quota_ ;
|
public class ClusterLocator { /** * Locates the local address of the nearest node if one exists .
* @ param cluster The cluster in which to search for the node .
* @ param doneHandler A handler to be called once the address has been located . */
public void locateCluster ( String cluster , Handler < AsyncResult < String > > doneHandler ) { } }
|
Set < String > registry = vertx . sharedData ( ) . getSet ( cluster ) ; synchronized ( registry ) { if ( ! registry . isEmpty ( ) ) { locateNode ( cluster , new HashSet < > ( registry ) , doneHandler ) ; } }
|
public class JsonService { /** * Get a boolean value from a { @ link JSONObject } .
* @ param jsonObject The object to get the key value from .
* @ param key The name of the key to search the value for .
* @ return Returns the value for the key in the object .
* @ throws JSONException Thrown in case the key could not be found in the JSON object . */
public static Boolean getBooleanValue ( JSONObject jsonObject , String key ) throws JSONException { } }
|
checkArguments ( jsonObject , key ) ; JSONValue value = jsonObject . get ( key ) ; Boolean result = null ; if ( value != null && value . isBoolean ( ) != null ) { return ( ( JSONBoolean ) value ) . booleanValue ( ) ; } return result ;
|
public class AbstractInstanceManager { /** * Create a proxy instance which corresponds to the given datastore type .
* @ param datastoreType
* The datastore type .
* @ param < T >
* The instance type .
* @ return The instance . */
private < T > T newInstance ( DatastoreId id , DatastoreType datastoreType , DynamicType < ? > types , TransactionalCache . Mode cacheMode ) { } }
|
validateType ( types ) ; InstanceInvocationHandler invocationHandler = new InstanceInvocationHandler ( datastoreType , getProxyMethodService ( ) ) ; T instance = proxyFactory . createInstance ( invocationHandler , types . getCompositeType ( ) ) ; cache . put ( id , instance , cacheMode ) ; return instance ;
|
public class techsupport { /** * < pre >
* Use this operation to delete technical support file .
* < / pre > */
public static techsupport delete ( nitro_service client , techsupport resource ) throws Exception { } }
|
resource . validate ( "delete" ) ; return ( ( techsupport [ ] ) resource . delete_resource ( client ) ) [ 0 ] ;
|
public class CWSEvaluator { /** * 在标准答案与分词结果上执行评测
* @ param goldFile
* @ param predFile
* @ return */
public static Result evaluate ( String goldFile , String predFile ) throws IOException { } }
|
return evaluate ( goldFile , predFile , null ) ;
|
public class WQConstraint { /** * Encode this constraint in the query string value format
* @ return */
public String encodeValue ( ) { } }
|
switch ( function ) { case EQ : if ( value != null && value . startsWith ( "_" ) ) return function . getPrefix ( ) + value ; else return value ; default : if ( function . hasBinaryParam ( ) ) return function . getPrefix ( ) + value + ".." + value2 ; else if ( function . hasParam ( ) ) return function . getPrefix ( ) + value ; else return function . getPrefix ( ) ; }
|
public class ConvertCode { /** * Move the files in this directory to the new directory . */
public void run ( ) { } }
|
String sourceDir = this . getProperty ( SOURCE_DIR ) ; sourceDir = ConvertBase . fixFilePath ( sourceDir , File . separator ) ; this . setProperty ( SOURCE_DIR , sourceDir ) ; String destDir = this . getProperty ( DEST_DIR ) ; destDir = ConvertBase . fixFilePath ( destDir , File . separator ) ; if ( destDir != null ) if ( destDir . equals ( sourceDir ) ) destDir += "out" ; this . setProperty ( DEST_DIR , destDir ) ; String strSourcePackage = this . getProperty ( SOURCE_PACKAGE ) ; if ( strSourcePackage == null ) strSourcePackage = ConvertBase . fixFilePath ( sourceDir , "." ) ; String strDestPackage = this . getProperty ( DEST_PACKAGE ) ; if ( strDestPackage == null ) strDestPackage = ConvertBase . fixFilePath ( destDir , "." ) ; sourceDir = this . getFullPath ( sourceDir ) ; File fileDir = new File ( sourceDir ) ; if ( fileDir . isDirectory ( ) ) this . moveDirectory ( fileDir , null ) ;
|
public class DMatrixUtils { /** * Returns the median of the vector .
* @ param vector The input vector as a double array
* @ return The median of the vector */
public static double median ( double [ ] vector ) { } }
|
final double [ ] sorted = vector . clone ( ) ; Arrays . sort ( sorted ) ; if ( vector . length % 2 == 1 ) { return sorted [ vector . length / 2 ] ; } return ( sorted [ vector . length / 2 - 1 ] + sorted [ vector . length / 2 ] ) / 2 ;
|
public class JDBCStorageConnection { /** * Reads count of nodes in workspace .
* @ return
* nodes count
* @ throws RepositoryException
* if a database access error occurs */
public long getNodesCount ( ) throws RepositoryException { } }
|
try { ResultSet countNodes = findNodesCount ( ) ; try { if ( countNodes . next ( ) ) { return countNodes . getLong ( 1 ) ; } else { throw new SQLException ( "ResultSet has't records." ) ; } } finally { JDBCUtils . freeResources ( countNodes , null , null ) ; } } catch ( SQLException e ) { throw new RepositoryException ( "Can not calculate nodes count" , e ) ; }
|
public class Input { /** * Returns true if enough bytes are available to read a long with { @ link # readVarLong ( boolean ) } . */
public boolean canReadVarLong ( ) throws KryoException { } }
|
if ( limit - position >= 9 ) return true ; if ( optional ( 5 ) <= 0 ) return false ; int p = position , limit = this . limit ; byte [ ] buffer = this . buffer ; if ( ( buffer [ p ++ ] & 0x80 ) == 0 ) return true ; if ( p == limit ) return false ; if ( ( buffer [ p ++ ] & 0x80 ) == 0 ) return true ; if ( p == limit ) return false ; if ( ( buffer [ p ++ ] & 0x80 ) == 0 ) return true ; if ( p == limit ) return false ; if ( ( buffer [ p ++ ] & 0x80 ) == 0 ) return true ; if ( p == limit ) return false ; if ( ( buffer [ p ++ ] & 0x80 ) == 0 ) return true ; if ( p == limit ) return false ; if ( ( buffer [ p ++ ] & 0x80 ) == 0 ) return true ; if ( p == limit ) return false ; if ( ( buffer [ p ++ ] & 0x80 ) == 0 ) return true ; if ( p == limit ) return false ; if ( ( buffer [ p ++ ] & 0x80 ) == 0 ) return true ; if ( p == limit ) return false ; return true ;
|
public class MathUtil { /** * 将坐标以原点为中心旋转
* @ param point 坐标
* @ param angle 旋转弧度 ( 注意 : 不是度数 , 是弧度 ) , 为正时表示逆时针旋转 , 为负时表示顺时针旋转 , 顺时针旋转不精确 , 尽量使用逆时针旋转 , 可以使用内置的弧度ANGLE _ N 。
* @ return 旋转后的坐标 , 不精确 ( 弧度对应的角度是90、180、270、360时是精确的 , 尽量使用这些值 ) */
public static Point spin ( Point point , double angle ) { } }
|
return spin ( Collections . singletonList ( point ) , angle ) . get ( 0 ) ;
|
public class LogicTransformer { /** * recurse through the rule condition elements updating the declaration objecs */
private void processElement ( final DeclarationScopeResolver resolver , final Stack < RuleConditionElement > contextStack , final RuleConditionElement element ) { } }
|
if ( element instanceof Pattern ) { Pattern pattern = ( Pattern ) element ; for ( RuleConditionElement ruleConditionElement : pattern . getNestedElements ( ) ) { processElement ( resolver , contextStack , ruleConditionElement ) ; } for ( Constraint constraint : pattern . getConstraints ( ) ) { if ( constraint instanceof Declaration ) { continue ; } replaceDeclarations ( resolver , pattern , constraint ) ; } } else if ( element instanceof EvalCondition ) { processEvalCondition ( resolver , ( EvalCondition ) element ) ; } else if ( element instanceof Accumulate ) { for ( RuleConditionElement rce : element . getNestedElements ( ) ) { processElement ( resolver , contextStack , rce ) ; } Accumulate accumulate = ( Accumulate ) element ; replaceDeclarations ( resolver , accumulate ) ; } else if ( element instanceof From ) { DataProvider provider = ( ( From ) element ) . getDataProvider ( ) ; Declaration [ ] decl = provider . getRequiredDeclarations ( ) ; for ( Declaration aDecl : decl ) { Declaration resolved = resolver . getDeclaration ( aDecl . getIdentifier ( ) ) ; if ( resolved != null && resolved != aDecl ) { provider . replaceDeclaration ( aDecl , resolved ) ; } else if ( resolved == null ) { // it is probably an implicit declaration , so find the corresponding pattern
Pattern old = aDecl . getPattern ( ) ; Pattern current = resolver . findPatternByIndex ( old . getIndex ( ) ) ; if ( current != null && old != current ) { resolved = new Declaration ( aDecl . getIdentifier ( ) , aDecl . getExtractor ( ) , current ) ; provider . replaceDeclaration ( aDecl , resolved ) ; } } } } else if ( element instanceof QueryElement ) { QueryElement qe = ( QueryElement ) element ; Pattern pattern = qe . getResultPattern ( ) ; for ( Entry < String , Declaration > entry : pattern . getInnerDeclarations ( ) . entrySet ( ) ) { Declaration resolved = resolver . getDeclaration ( entry . getValue ( ) . getIdentifier ( ) ) ; if ( resolved != null && resolved != entry . getValue ( ) && resolved . getPattern ( ) != pattern ) { entry . setValue ( resolved ) ; } } List < Integer > varIndexes = asList ( qe . getVariableIndexes ( ) ) ; for ( int i = 0 ; i < qe . getArguments ( ) . length ; i ++ ) { if ( ! ( qe . getArguments ( ) [ i ] instanceof QueryArgument . Declr ) ) { continue ; } Declaration declr = ( ( QueryArgument . Declr ) qe . getArguments ( ) [ i ] ) . getDeclaration ( ) ; Declaration resolved = resolver . getDeclaration ( declr . getIdentifier ( ) ) ; if ( resolved != declr && resolved . getPattern ( ) != pattern ) { qe . getArguments ( ) [ i ] = new QueryArgument . Declr ( resolved ) ; } if ( ClassObjectType . DroolsQuery_ObjectType . isAssignableFrom ( resolved . getPattern ( ) . getObjectType ( ) ) ) { // if the resolved still points to DroolsQuery , we know this is the first unification pattern , so redeclare it as the visible Declaration
declr = pattern . addDeclaration ( declr . getIdentifier ( ) ) ; // this bit is different , notice its the ArrayElementReader that we wire up to , not the declaration .
ArrayElementReader reader = new ArrayElementReader ( new SelfReferenceClassFieldReader ( Object [ ] . class ) , i , resolved . getDeclarationClass ( ) ) ; declr . setReadAccessor ( reader ) ; varIndexes . add ( i ) ; } } qe . setVariableIndexes ( toIntArray ( varIndexes ) ) ; } else if ( element instanceof ConditionalBranch ) { processBranch ( resolver , ( ConditionalBranch ) element ) ; } else { contextStack . push ( element ) ; for ( RuleConditionElement ruleConditionElement : element . getNestedElements ( ) ) { processElement ( resolver , contextStack , ruleConditionElement ) ; } contextStack . pop ( ) ; }
|
public class ServletEnvironment { /** * Set the session handler .
* @ param sessionHandler The sessionHandler to set . */
public void setSessionHandler ( SessionHandler sessionHandler ) { } }
|
handler . setSessionsEnabled ( sessionHandler != null ) ; handler . setSessionHandler ( sessionHandler ) ;
|
public class Address { /** * Compares this object with the specified object for order . Returns a
* negative integer , zero , or a positive integer as this object is less
* than , equal to , or greater than the specified object .
* < p > The implementor must ensure < code > sgn ( x . compareTo ( y ) ) = =
* - sgn ( y . compareTo ( x ) ) < / code > for all < code > x < / code > and < code > y < / code > . ( This
* implies that < code > x . compareTo ( y ) < / code > must throw an exception iff
* < code > y . compareTo ( x ) < / code > throws an exception . )
* < p > The implementor must also ensure that the relation is transitive :
* < code > ( x . compareTo ( y ) & gt ; 0 & amp ; & amp ; y . compareTo ( z ) & gt ; 0 ) < / code > implies
* < code > x . compareTo ( z ) & gt ; 0 < / code > .
* < p > Finally , the implementor must ensure that < code > x . compareTo ( y ) = = 0 < / code >
* implies that < code > sgn ( x . compareTo ( z ) ) = = sgn ( y . compareTo ( z ) ) < / code > , for all
* < code > z < / code > .
* < p > It is strongly recommended , but < i > not < / i > strictly required that
* < code > ( x . compareTo ( y ) = = 0 ) = = ( x . equals ( y ) ) < / code > . Generally speaking , any
* class that implements the < code > Comparable < / code > interface and violates this
* condition should clearly indicate this fact . The recommended language is
* " Note : this class has a natural ordering that is inconsistent with
* equals . "
* < p > In the foregoing description , the notation < code > sgn ( < / code > < i > expression < / i >
* < code > ) < / code > designates the mathematical < i > signum < / i > function , which is
* defined to return one of < code > - 1 < / code > , < code > 0 < / code > , or < code > 1 < / code > according
* to whether the value of < i > expression < / i > is negative , zero or positive .
* @ param address is the address to be compared .
* @ return a negative integer , zero , or a positive integer as this object is
* less than , equal to , or greater than the specified object . */
@ Override @ Pure public int compareTo ( Address address ) { } }
|
if ( address == null ) { return 1 ; } return this . agentId . compareTo ( address . getUUID ( ) ) ;
|
public class LargeObject { /** * See # size ( ) for information about efficiency .
* @ return the size of the large object
* @ throws SQLException if a database - access error occurs . */
public long size64 ( ) throws SQLException { } }
|
long cp = tell64 ( ) ; seek64 ( 0 , SEEK_END ) ; long sz = tell64 ( ) ; seek64 ( cp , SEEK_SET ) ; return sz ;
|
public class SipNetworkInterfaceManagerImpl { /** * Compute all the outbound interfaces for this manager */
protected void computeOutboundInterfaces ( ) { } }
|
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Outbound Interface List : " ) ; } List < SipURI > newlyComputedOutboundInterfaces = new CopyOnWriteArrayList < SipURI > ( ) ; Set < String > newlyComputedOutboundInterfacesIpAddresses = new CopyOnWriteArraySet < String > ( ) ; Iterator < MobicentsExtendedListeningPoint > it = getExtendedListeningPoints ( ) ; while ( it . hasNext ( ) ) { MobicentsExtendedListeningPoint extendedListeningPoint = it . next ( ) ; for ( String ipAddress : extendedListeningPoint . getIpAddresses ( ) ) { try { newlyComputedOutboundInterfacesIpAddresses . add ( ipAddress ) ; javax . sip . address . SipURI jainSipURI = SipFactoryImpl . addressFactory . createSipURI ( null , ipAddress ) ; jainSipURI . setPort ( extendedListeningPoint . getPort ( ) ) ; jainSipURI . setTransportParam ( extendedListeningPoint . getTransport ( ) ) ; SipURI sipURI = new SipURIImpl ( jainSipURI , ModifiableRule . NotModifiable ) ; newlyComputedOutboundInterfaces . add ( sipURI ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Outbound Interface : " + jainSipURI ) ; } } catch ( ParseException e ) { logger . error ( "cannot add the following listening point " + ipAddress + ":" + extendedListeningPoint . getPort ( ) + ";transport=" + extendedListeningPoint . getTransport ( ) + " to the outbound interfaces" , e ) ; } } } outboundInterfaces = newlyComputedOutboundInterfaces ; outboundInterfacesIpAddresses = newlyComputedOutboundInterfacesIpAddresses ;
|
public class ExtractCoocurrencesFilterDistance { /** * Adds all cooccurrences ( no filtering ) . Subclasses can implement finer
* filtering .
* @ param jCas
* @ param enclosingAnnot
* @ param annot1
* @ param annot2
* @ param ids1
* @ param ids2 */
@ Override protected Cooccurrence filterCooccurence ( JCas jCas , Annotation enclosingAnnot , Annotation annot1 , Annotation annot2 , String [ ] ids1 , String [ ] ids2 ) { } }
|
if ( distance ( annot1 , annot2 ) < maximumDistance ) { return super . filterCooccurence ( jCas , enclosingAnnot , annot1 , annot2 , ids1 , ids2 ) ; } else { return null ; }
|
public class MethodFinder { /** * Loads up the data structures for my target class ' s methods . */
protected void maybeLoadMethods ( ) { } }
|
if ( _methodMap == null ) { _methodMap = new HashMap < String , List < Member > > ( ) ; Method [ ] methods = _clazz . getMethods ( ) ; for ( int i = 0 ; i < methods . length ; ++ i ) { Method m = methods [ i ] ; String methodName = m . getName ( ) ; Class < ? > [ ] paramTypes = m . getParameterTypes ( ) ; List < Member > list = _methodMap . get ( methodName ) ; if ( list == null ) { list = new ArrayList < Member > ( ) ; _methodMap . put ( methodName , list ) ; } if ( ! ClassUtil . classIsAccessible ( _clazz ) ) { m = ClassUtil . getAccessibleMethodFrom ( _clazz , methodName , paramTypes ) ; } if ( m != null ) { list . add ( m ) ; _paramMap . put ( m , paramTypes ) ; } } }
|
public class FlatMapOperatorBase { @ Override protected List < OUT > executeOnCollections ( List < IN > input , RuntimeContext ctx , ExecutionConfig executionConfig ) throws Exception { } }
|
FlatMapFunction < IN , OUT > function = userFunction . getUserCodeObject ( ) ; FunctionUtils . setFunctionRuntimeContext ( function , ctx ) ; FunctionUtils . openFunction ( function , parameters ) ; ArrayList < OUT > result = new ArrayList < OUT > ( input . size ( ) ) ; TypeSerializer < IN > inSerializer = getOperatorInfo ( ) . getInputType ( ) . createSerializer ( executionConfig ) ; TypeSerializer < OUT > outSerializer = getOperatorInfo ( ) . getOutputType ( ) . createSerializer ( executionConfig ) ; CopyingListCollector < OUT > resultCollector = new CopyingListCollector < OUT > ( result , outSerializer ) ; for ( IN element : input ) { IN inCopy = inSerializer . copy ( element ) ; function . flatMap ( inCopy , resultCollector ) ; } FunctionUtils . closeFunction ( function ) ; return result ;
|
public class TableLayoutBuilder { /** * Inserts a new row . A gap row with specified RowSpec will be inserted
* before this row . */
public TableLayoutBuilder row ( RowSpec gapRowSpec ) { } }
|
row ( ) ; gapRows . put ( new Integer ( currentRow ) , gapRowSpec ) ; return this ;
|
public class ObjectEditorTable { /** * Set the data to be viewed or edited . */
public void setData ( Collection < ? > data ) { } }
|
_data . clear ( ) ; _data . addAll ( data ) ; _model . fireTableDataChanged ( ) ;
|
public class AmazonAlexaForBusinessClient { /** * Retrieves the details of a gateway .
* @ param getGatewayRequest
* @ return Result of the GetGateway operation returned by the service .
* @ throws NotFoundException
* The resource is not found .
* @ sample AmazonAlexaForBusiness . GetGateway
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / alexaforbusiness - 2017-11-09 / GetGateway " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public GetGatewayResult getGateway ( GetGatewayRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeGetGateway ( request ) ;
|
public class DefaultNamespaceService { /** * { @ inheritDoc } */
@ Override public Set < String > search ( String resourceLocation , Pattern pattern ) throws IndexingFailure , ResourceDownloadError { } }
|
if ( resourceLocation == null ) { throw new InvalidArgument ( "resourceLocation" , resourceLocation ) ; } if ( pattern == null ) { throw new InvalidArgument ( "pattern" , pattern ) ; } // check and open namespace for this resource location
synchronized ( resourceLocation ) { if ( ! isOpen ( resourceLocation ) ) { String indexPath = doCompile ( resourceLocation ) ; openNamespace ( resourceLocation , indexPath ) ; } } return doSearch ( resourceLocation , pattern ) ;
|
public class ArrayUtils { /** * < p > Defensive programming technique to change a < code > null < / code >
* reference to an empty one . < / p >
* < p > This method returns an empty array for a < code > null < / code > input array . < / p >
* < p > As a memory optimizing technique an empty array passed in will be overridden with
* the empty < code > public static < / code > references in this class . < / p >
* @ param array the array to check for < code > null < / code > or empty
* @ return the same array , < code > public static < / code > empty array if < code > null < / code > or empty input
* @ since 2.5 */
public static Object [ ] nullToEmpty ( Object [ ] array ) { } }
|
if ( array == null || array . length == 0 ) { return EMPTY_OBJECT_ARRAY ; } return array ;
|
public class ChunkedFileSet { /** * Given a partition ID , determine which replica of this partition is hosted by the
* current node , if any .
* Note : This is an implementation detail of the READONLY _ V2 naming scheme , and should
* not be used outside of that scope .
* @ param partitionId for which we want to know the replica type
* @ return the requested partition ' s replica type ( which ranges from 0 to replication
* factor - 1 ) if the partition is hosted on the current node , or - 1 if the
* requested partition is not hosted on this node . */
private int getReplicaTypeForPartition ( int partitionId ) { } }
|
List < Integer > routingPartitionList = routingStrategy . getReplicatingPartitionList ( partitionId ) ; // Determine if we should host this partition , and if so , whether we are a primary ,
// secondary or n - ary replica for it
int correctReplicaType = - 1 ; for ( int replica = 0 ; replica < routingPartitionList . size ( ) ; replica ++ ) { if ( nodePartitionIds . contains ( routingPartitionList . get ( replica ) ) ) { // This means the partitionId currently being iterated on should be hosted
// by this node . Let ' s remember its replica type in order to make sure the
// files we have are properly named .
correctReplicaType = replica ; break ; } } return correctReplicaType ;
|
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcSoundPowerLevelMeasure ( ) { } }
|
if ( ifcSoundPowerLevelMeasureEClass == null ) { ifcSoundPowerLevelMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 865 ) ; } return ifcSoundPowerLevelMeasureEClass ;
|
public class TagVLiteralOrFilter { /** * Overridden here so that we can resolve the literal values if we don ' t have
* too many of them AND we ' re not searching with case insensitivity . */
@ Override public Deferred < byte [ ] > resolveTagkName ( final TSDB tsdb ) { } }
|
final Config config = tsdb . getConfig ( ) ; // resolve tag values if the filter is NOT case insensitive and there are
// fewer literals than the expansion limit
if ( ! case_insensitive && literals . size ( ) <= config . getInt ( "tsd.query.filter.expansion_limit" ) ) { return resolveTags ( tsdb , literals ) ; } else { return super . resolveTagkName ( tsdb ) ; }
|
public class DrizzlePreparedStatement { /** * Sets the designated parameter to the given input stream , which will have the specified number of bytes . When a
* very large ASCII value is input to a < code > LONGVARCHAR < / code > parameter , it may be more practical to send it via
* a < code > java . io . InputStream < / code > . Data will be read from the stream as needed until end - of - file is reached . The
* JDBC driver will do any necessary conversion from ASCII to the database char format .
* < P > < B > Note : < / B > This stream object can either be a standard Java stream object or your own subclass that
* implements the standard interface .
* @ param parameterIndex the first parameter is 1 , the second is 2 , . . .
* @ param x the Java input stream that contains the ASCII parameter value
* @ param length the number of bytes in the stream
* @ throws java . sql . SQLException if parameterIndex does not correspond to a parameter marker in the SQL statement ;
* if a database access error occurs or this method is called on a closed
* < code > PreparedStatement < / code > */
public void setAsciiStream ( final int parameterIndex , final InputStream x , final int length ) throws SQLException { } }
|
if ( x == null ) { setNull ( parameterIndex , Types . BLOB ) ; return ; } try { setParameter ( parameterIndex , new StreamParameter ( x , length ) ) ; } catch ( IOException e ) { throw SQLExceptionMapper . getSQLException ( "Could not read stream" , e ) ; }
|
public class ScopedMailAPI { /** * Unconditionally queue a mail
* @ param aSMTPSettings
* The SMTP settings to use . May not be < code > null < / code > .
* @ param aMailData
* The data of the email to be send . May not be < code > null < / code > .
* @ return { @ link ESuccess } */
@ Nonnull public ESuccess queueMail ( @ Nonnull final ISMTPSettings aSMTPSettings , @ Nonnull final IMutableEmailData aMailData ) { } }
|
return MailAPI . queueMail ( aSMTPSettings , aMailData ) ;
|
public class JsJmsStreamMessageImpl { /** * Provide an estimate of encoded length of the payload */
int guessPayloadLength ( ) { } }
|
int length = 0 ; // Total guess at average size of stream entry
try { List < Object > payload = getBodyList ( ) ; length = payload . size ( ) * 40 ; } catch ( UnsupportedEncodingException e ) { // No FFDC code needed
// hmm . . . how do we figure out a reasonable length
} return length ;
|
public class WriteCloseableDataStore { /** * Methods below simply defer to delegate */
@ Override public Iterator < Table > listTables ( @ Nullable String fromTableExclusive , long limit ) { } }
|
return _delegate . listTables ( fromTableExclusive , limit ) ;
|
public class JSDocInfoBuilder { /** * Records an implemented interface . */
public boolean recordImplementedInterface ( JSTypeExpression interfaceName ) { } }
|
if ( interfaceName != null && currentInfo . addImplementedInterface ( interfaceName ) ) { populated = true ; return true ; } else { return false ; }
|
public class DfuServiceInitiator { /** * Sets custom UUIDs for the experimental Buttonless DFU Service from SDK 12 . x . Use this method
* if your DFU implementation uses different UUID for at least one of the given UUIDs .
* Parameter set to < code > null < / code > will reset the UUID to the default value .
* Remember to call { @ link # setUnsafeExperimentalButtonlessServiceInSecureDfuEnabled ( boolean ) }
* with parameter < code > true < / code > if you intent to use this service .
* @ param buttonlessDfuServiceUuid custom Buttonless DFU service UUID or null , if default
* is to be used
* @ param buttonlessDfuControlPointUuid custom Buttonless DFU characteristic UUID or null ,
* if default is to be used
* @ return the builder */
public DfuServiceInitiator setCustomUuidsForExperimentalButtonlessDfu ( @ Nullable final UUID buttonlessDfuServiceUuid , @ Nullable final UUID buttonlessDfuControlPointUuid ) { } }
|
final ParcelUuid [ ] uuids = new ParcelUuid [ 2 ] ; uuids [ 0 ] = buttonlessDfuServiceUuid != null ? new ParcelUuid ( buttonlessDfuServiceUuid ) : null ; uuids [ 1 ] = buttonlessDfuControlPointUuid != null ? new ParcelUuid ( buttonlessDfuControlPointUuid ) : null ; experimentalButtonlessDfuUuids = uuids ; return this ;
|
public class VdmBreakpointPropertyPage { /** * Creates the button to toggle enablement of the breakpoint
* @ param parent
* @ throws CoreException */
protected void createEnabledButton ( Composite parent ) throws CoreException { } }
|
fEnabledButton = createCheckButton ( parent , "Enable" ) ; fEnabledButton . setSelection ( getBreakpoint ( ) . isEnabled ( ) ) ;
|
public class AbstractLinear { /** * Returns the image of the MinMeasuredValue and MaxMeasuredValue dependend
* on the given color
* @ param WIDTH
* @ param HEIGHT
* @ param COLOR
* @ return a buffered image of either the min measured value or the max measured value indicator */
protected BufferedImage create_MEASURED_VALUE_Image ( final int WIDTH , final int HEIGHT , final Color COLOR ) { } }
|
if ( WIDTH <= 20 || HEIGHT <= 20 ) // 20 is needed otherwise the image size could be smaller than 1
{ return UTIL . createImage ( 1 , 1 , Transparency . TRANSLUCENT ) ; } final int IMAGE_WIDTH ; final int IMAGE_HEIGHT ; if ( getOrientation ( ) == Orientation . VERTICAL ) { // Vertical orientation
IMAGE_WIDTH = ( int ) ( WIDTH * 0.05 ) ; IMAGE_HEIGHT = IMAGE_WIDTH ; } else { // Horizontal orientation
IMAGE_HEIGHT = ( int ) ( HEIGHT * 0.05 ) ; IMAGE_WIDTH = IMAGE_HEIGHT ; } final BufferedImage IMAGE = UTIL . createImage ( IMAGE_WIDTH , IMAGE_HEIGHT , Transparency . TRANSLUCENT ) ; final Graphics2D G2 = IMAGE . createGraphics ( ) ; G2 . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; final GeneralPath INDICATOR = new GeneralPath ( ) ; INDICATOR . setWindingRule ( Path2D . WIND_EVEN_ODD ) ; if ( getOrientation ( ) == Orientation . VERTICAL ) { INDICATOR . moveTo ( IMAGE_WIDTH , IMAGE_HEIGHT * 0.5 ) ; INDICATOR . lineTo ( 0.0 , 0.0 ) ; INDICATOR . lineTo ( 0.0 , IMAGE_HEIGHT ) ; INDICATOR . closePath ( ) ; } else { INDICATOR . moveTo ( IMAGE_WIDTH * 0.5 , 0.0 ) ; INDICATOR . lineTo ( IMAGE_WIDTH , IMAGE_HEIGHT ) ; INDICATOR . lineTo ( 0.0 , IMAGE_HEIGHT ) ; INDICATOR . closePath ( ) ; } G2 . setColor ( COLOR ) ; G2 . fill ( INDICATOR ) ; G2 . dispose ( ) ; return IMAGE ;
|
public class InternalSARLLexer { /** * $ ANTLR start " T _ _ 123" */
public final void mT__123 ( ) throws RecognitionException { } }
|
try { int _type = T__123 ; int _channel = DEFAULT_TOKEN_CHANNEL ; // InternalSARL . g : 109:8 : ( ' ELSE ' )
// InternalSARL . g : 109:10 : ' ELSE '
{ match ( "ELSE" ) ; } state . type = _type ; state . channel = _channel ; } finally { }
|
public class TagletWriterImpl { /** * { @ inheritDoc } */
public Content returnTagOutput ( Element element , DocTree returnTag ) { } }
|
ContentBuilder result = new ContentBuilder ( ) ; CommentHelper ch = utils . getCommentHelper ( element ) ; result . addContent ( HtmlTree . DT ( HtmlTree . SPAN ( HtmlStyle . returnLabel , new StringContent ( configuration . getText ( "doclet.Returns" ) ) ) ) ) ; result . addContent ( HtmlTree . DD ( htmlWriter . commentTagsToContent ( returnTag , element , ch . getDescription ( configuration , returnTag ) , false ) ) ) ; return result ;
|
public class SqlMapper { /** * 查询返回一个结果 , 多个结果时抛出异常
* @ param sql 执行的sql
* @ param value 参数
* @ param resultType 返回的结果类型
* @ param < T > 泛型类型
* @ return result */
public < T > T selectOne ( String sql , Object value , Class < T > resultType ) { } }
|
List < T > list = selectList ( sql , value , resultType ) ; return getOne ( list ) ;
|
public class QrHelperFunctions_ZDRM { /** * Finds the magnitude of the largest element in the row
* @ param A Complex matrix
* @ param row Row in A
* @ param col0 First column in A to be copied
* @ param col1 Last column in A + 1 to be copied
* @ return magnitude of largest element */
public static double computeRowMax ( ZMatrixRMaj A , int row , int col0 , int col1 ) { } }
|
double max = 0 ; int indexA = A . getIndex ( row , col0 ) ; double h [ ] = A . data ; for ( int i = col0 ; i < col1 ; i ++ ) { double realVal = h [ indexA ++ ] ; double imagVal = h [ indexA ++ ] ; double magVal = realVal * realVal + imagVal * imagVal ; if ( max < magVal ) { max = magVal ; } } return Math . sqrt ( max ) ;
|
public class JInternalFrameExtensions { /** * Adds the given { @ link View } object to the given { @ link JInternalFrame } object .
* @ param internalFrame
* the { @ link JInternalFrame } object .
* @ param view
* the { @ link View } object to add */
public static void addViewToFrame ( final JInternalFrame internalFrame , final View < ? , ? > view ) { } }
|
internalFrame . add ( view . getComponent ( ) , BorderLayout . CENTER ) ; internalFrame . pack ( ) ;
|
public class JvmMemberImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setDeclaringType ( JvmDeclaredType newDeclaringType ) { } }
|
if ( newDeclaringType != eInternalContainer ( ) || ( eContainerFeatureID ( ) != TypesPackage . JVM_MEMBER__DECLARING_TYPE && newDeclaringType != null ) ) { if ( EcoreUtil . isAncestor ( this , newDeclaringType ) ) throw new IllegalArgumentException ( "Recursive containment not allowed for " + toString ( ) ) ; NotificationChain msgs = null ; if ( eInternalContainer ( ) != null ) msgs = eBasicRemoveFromContainer ( msgs ) ; if ( newDeclaringType != null ) msgs = ( ( InternalEObject ) newDeclaringType ) . eInverseAdd ( this , TypesPackage . JVM_DECLARED_TYPE__MEMBERS , JvmDeclaredType . class , msgs ) ; msgs = basicSetDeclaringType ( newDeclaringType , msgs ) ; if ( msgs != null ) msgs . dispatch ( ) ; } else if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , TypesPackage . JVM_MEMBER__DECLARING_TYPE , newDeclaringType , newDeclaringType ) ) ;
|
public class StringUtil { /** * Returns true if the String is considered a " safe " string where only specific
* characters are allowed to be used . Useful for checking passwords or other
* information you don ' t want a user to be able to type just anything in .
* This method does not allow any whitespace characters , newlines , carriage returns .
* Primarily allows [ a - z ] [ A - Z ] [ 0-9 ] and a few other useful ASCII characters
* such as " : ~ ! @ # $ % ^ * ( ) - _ + = / \ \ , . [ ] { } | ? < > " ( but not the quote chars ) */
public static boolean isSafeString ( String string0 ) { } }
|
for ( int i = 0 ; i < string0 . length ( ) ; i ++ ) { if ( ! isSafeChar ( string0 . charAt ( i ) ) ) { return false ; } } return true ;
|
public class StereoMatch { /** * Verify the tetrahedral stereochemistry ( clockwise / anticlockwise ) of atom
* { @ code u } is preserved in the target when the { @ code mapping } is used .
* @ param u tetrahedral index in the target
* @ param mapping mapping of vertices
* @ return the tetrahedral configuration is preserved */
private boolean checkTetrahedral ( int u , int [ ] mapping ) { } }
|
int v = mapping [ u ] ; if ( targetTypes [ v ] != Type . Tetrahedral ) return false ; ITetrahedralChirality queryElement = ( ITetrahedralChirality ) queryElements [ u ] ; ITetrahedralChirality targetElement = ( ITetrahedralChirality ) targetElements [ v ] ; // access neighbors of each element , then map the query to the target
int [ ] us = neighbors ( queryElement , queryMap ) ; int [ ] vs = neighbors ( targetElement , targetMap ) ; us = map ( u , v , us , mapping ) ; if ( us == null ) return false ; int p = permutationParity ( us ) * parity ( queryElement . getStereo ( ) ) ; int q = permutationParity ( vs ) * parity ( targetElement . getStereo ( ) ) ; return p == q ;
|
public class EmailMessage { /** * Adding one bcc - address to the EmailMessage .
* @ param internetAddress
* The InternetAddress - object .
* @ throws MessagingException
* is thrown if the underlying implementation does not support modification of
* existing values */
public void addBcc ( final Address internetAddress ) throws MessagingException { } }
|
super . addRecipient ( javax . mail . Message . RecipientType . BCC , internetAddress ) ;
|
public class HttpContinue { /** * Returns true if this exchange requires the server to send a 100 ( Continue ) response .
* @ param exchange The exchange
* @ return < code > true < / code > if the server needs to send a continue response */
public static boolean requiresContinueResponse ( final HttpServerExchange exchange ) { } }
|
if ( ! COMPATIBLE_PROTOCOLS . contains ( exchange . getProtocol ( ) ) || exchange . isResponseStarted ( ) || ! exchange . getConnection ( ) . isContinueResponseSupported ( ) || exchange . getAttachment ( ALREADY_SENT ) != null ) { return false ; } HeaderMap requestHeaders = exchange . getRequestHeaders ( ) ; return requiresContinueResponse ( requestHeaders ) ;
|
public class Mutations { /** * Extracts sub mutations by { @ code from } - { @ code to } mutation indices .
* @ param from index in current mutations object pointing to the first mutation to be extracted
* @ param to index in current mutations object pointing to the next after last mutation to be extracted
* @ return sub mutations */
public Mutations < S > getRange ( int from , int to ) { } }
|
return new Mutations < > ( alphabet , Arrays . copyOfRange ( mutations , from , to ) ) ;
|
public class SPDateTimeUtil { /** * Get formatted date ' last modified at ' by entity .
* @ param baseEntity
* the entity
* @ param datePattern
* pattern how to format the date ( cp . { @ code SimpleDateFormat } )
* @ return String formatted date */
public static String formatLastModifiedAt ( final BaseEntity baseEntity , final String datePattern ) { } }
|
if ( baseEntity == null ) { return "" ; } return formatDate ( baseEntity . getLastModifiedAt ( ) , "" , datePattern ) ;
|
public class Auth { /** * Deletes the user from AUTH _ KS . USERS _ CF .
* @ param username Username to delete .
* @ throws RequestExecutionException */
public static void deleteUser ( String username ) throws RequestExecutionException { } }
|
QueryProcessor . process ( String . format ( "DELETE FROM %s.%s WHERE name = '%s'" , AUTH_KS , USERS_CF , escape ( username ) ) , consistencyForUser ( username ) ) ;
|
public class RemotePDPProvider { /** * Get a list of all PDP domains for a given PDB entry
* @ param pdbId PDB ID
* @ return Set of domain names , e . g . " PDP : 4HHBAa "
* @ throws IOException if the server cannot be reached */
@ Override public SortedSet < String > getPDPDomainNamesForPDB ( String pdbId ) throws IOException { } }
|
SortedSet < String > results = null ; try { URL u = new URL ( server + "getPDPDomainNamesForPDB?pdbId=" + pdbId ) ; logger . info ( "Fetching {}" , u ) ; InputStream response = URLConnectionTools . getInputStream ( u ) ; String xml = JFatCatClient . convertStreamToString ( response ) ; results = XMLUtil . getDomainRangesFromXML ( xml ) ; } catch ( MalformedURLException e ) { logger . error ( "Problem generating PDP request URL for " + pdbId , e ) ; throw new IllegalArgumentException ( "Invalid PDB name: " + pdbId , e ) ; } return results ;
|
public class OrcParser { /** * This method is written to check and make sure any value written to a column of type long
* is more than Long . MIN _ VALUE . If this is not true , a warning will be passed to the user .
* @ param l
* @ param cIdx
* @ param rowNumber
* @ param dout */
private void check_Min_Value ( long l , int cIdx , int rowNumber , ParseWriter dout ) { } }
|
if ( l <= Long . MIN_VALUE ) { String warning = "Orc Parser: Long.MIN_VALUE: " + l + " is found in column " + cIdx + " row " + rowNumber + " of stripe " + _cidx + ". This value is used for sentinel and will not be parsed correctly." ; dout . addError ( new ParseWriter . ParseErr ( warning , _cidx , rowNumber , - 2L ) ) ; }
|
public class IHEAuditor { /** * Get alternate user id for the system ' s ActiveParticipant in
* audit messages . This is either set in configuration or
* the the auditor will attempt to determine it from the JVM ' s process
* id .
* @ see org . openhealthtools . ihe . atna . auditor . context . AuditorModuleConfig # setSystemAltUserId ( String )
* @ return The alternate user id */
public String getSystemAltUserId ( ) { } }
|
// If a localized value is set , use it
if ( ! EventUtils . isEmptyOrNull ( systemAltUserId ) ) { return systemAltUserId ; } // Check if a configuration parameter is set
systemAltUserId = getConfig ( ) . getSystemAltUserId ( ) ; if ( ! EventUtils . isEmptyOrNull ( systemAltUserId ) ) { return systemAltUserId ; } // If both are empty , attempt to determine the alternate user id
// per IHE specifications ( e . g . owner JVM ' s process id )
String processId = null ; try { // JVM specification says the runtime bean name may contain
// the process and context information about the JVM , including
// process ID . Attempt to get this information
RuntimeMXBean mx = ManagementFactory . getRuntimeMXBean ( ) ; processId = mx . getName ( ) ; int pointer ; if ( ( pointer = processId . indexOf ( '@' ) ) != - 1 ) { processId = processId . substring ( 0 , pointer ) ; } } catch ( Throwable t ) { // Ignore errors and exceptions , we ' ll just fake it
} // If we can ' t get the process ID or if it ' s not set , fake it
if ( EventUtils . isEmptyOrNull ( processId ) ) { processId = String . valueOf ( ( int ) ( Math . random ( ) * 1000 ) ) ; } systemAltUserId = processId ; return systemAltUserId ;
|
public class NotifierFuncMain { /** * overloaded functions */
public < A , B , C , D , E , R > R callAdd ( A a , B b , C c , D d , E e , Notifier < A , B , C , D , E , R > notifier ) { } }
|
R result = notifier . apply ( a , b , c , d , e ) ; return result ;
|
public class TaskServiceImpl { /** * Get Task type queue sizes .
* @ param taskTypes List of task types .
* @ return map of task type as Key and queue size as value . */
@ Service public Map < String , Integer > getTaskQueueSizes ( List < String > taskTypes ) { } }
|
return executionService . getTaskQueueSizes ( taskTypes ) ;
|
public class TreeBuilder { /** * Convert data content for all resources matching the resource selector and the path selector
* @ param converter content converter
* @ param pathSelector path selector
* @ param resourceSelector resource selector
* @ return builder */
public TreeBuilder < T > convert ( ContentConverter < T > converter , PathSelector pathSelector , ResourceSelector < T > resourceSelector ) { } }
|
return TreeBuilder . < T > builder ( new ConverterTree < T > ( build ( ) , converter , pathSelector , resourceSelector ) ) ;
|
public class AbstractAstVisitorRule { /** * Return true if this rule should be applied for the specified ClassNode , based on the
* configuration of this rule .
* @ param classNode - the ClassNode
* @ return true if this rule should be applied for the specified ClassNode */
protected boolean shouldApplyThisRuleTo ( ClassNode classNode ) { } }
|
// TODO Consider caching applyTo , doNotApplyTo and associated WildcardPatterns
boolean shouldApply = true ; String applyTo = getApplyToClassNames ( ) ; String doNotApplyTo = getDoNotApplyToClassNames ( ) ; if ( applyTo != null && applyTo . length ( ) > 0 ) { WildcardPattern pattern = new WildcardPattern ( applyTo , true ) ; shouldApply = pattern . matches ( classNode . getNameWithoutPackage ( ) ) || pattern . matches ( classNode . getName ( ) ) ; } if ( shouldApply && doNotApplyTo != null && doNotApplyTo . length ( ) > 0 ) { WildcardPattern pattern = new WildcardPattern ( doNotApplyTo , true ) ; shouldApply = ! pattern . matches ( classNode . getNameWithoutPackage ( ) ) && ! pattern . matches ( classNode . getName ( ) ) ; } return shouldApply ;
|
public class RF1Importer { /** * Processes the raw RF1 files and generates a { @ link VersionRows } . */
public VersionRows extractVersionRows ( ) { } }
|
// Read all the concepts from the raw data
List < ConceptRow > crs = new ArrayList < ConceptRow > ( ) ; BufferedReader br = null ; try { br = new BufferedReader ( new InputStreamReader ( conceptsFile ) ) ; String line = br . readLine ( ) ; // Skip first line
while ( null != ( line = br . readLine ( ) ) ) { line = new String ( line . getBytes ( ) , "UTF8" ) ; if ( line . trim ( ) . length ( ) < 1 ) { continue ; } int idx1 = line . indexOf ( '\t' ) ; int idx2 = line . indexOf ( '\t' , idx1 + 1 ) ; int idx3 = line . indexOf ( '\t' , idx2 + 1 ) ; int idx4 = line . indexOf ( '\t' , idx3 + 1 ) ; int idx5 = line . indexOf ( '\t' , idx4 + 1 ) ; // 0 . . idx1 = = conceptId
// idx1 + 1 . . idx2 = = conceptStatus
// idx2 + 1 . . idx3 = = fullySpecifiedName
// idx3 + 1 . . idx4 = = ctv3Id
// idx4 + 1 . . idx5 = = snomedId
// idx5 + 1 . . end = = isPrimitive
if ( idx1 < 0 || idx2 < 0 || idx3 < 0 || idx4 < 0 || idx5 < 0 ) { br . close ( ) ; throw new RuntimeException ( "Concepts: Mis-formatted " + "line, expected at least 6 tab-separated fields, " + "got: " + line ) ; } final String conceptId = line . substring ( 0 , idx1 ) ; final String conceptStatus = line . substring ( idx1 + 1 , idx2 ) ; final String fullySpecifiedName = line . substring ( idx2 + 1 , idx3 ) ; final String ctv3Id = line . substring ( idx3 + 1 , idx4 ) ; final String snomedId = line . substring ( idx4 + 1 , idx5 ) ; final String isPrimitive = line . substring ( idx5 + 1 ) ; crs . add ( new ConceptRow ( conceptId , conceptStatus , fullySpecifiedName , ctv3Id , snomedId , isPrimitive ) ) ; } } catch ( Exception e ) { throw new RuntimeException ( e ) ; } finally { if ( br != null ) { try { br . close ( ) ; } catch ( Exception e ) { } } } // Read all the relationships from the raw data
List < RelationshipRow > rrs = new ArrayList < RelationshipRow > ( ) ; try { br = new BufferedReader ( new InputStreamReader ( relationshipsFile ) ) ; String line = br . readLine ( ) ; // Skip first line
while ( null != ( line = br . readLine ( ) ) ) { if ( line . trim ( ) . length ( ) < 1 ) { continue ; } int idx1 = line . indexOf ( '\t' ) ; int idx2 = line . indexOf ( '\t' , idx1 + 1 ) ; int idx3 = line . indexOf ( '\t' , idx2 + 1 ) ; int idx4 = line . indexOf ( '\t' , idx3 + 1 ) ; int idx5 = line . indexOf ( '\t' , idx4 + 1 ) ; int idx6 = line . indexOf ( '\t' , idx5 + 1 ) ; // 0 . . idx1 = = relationshipId
// idx1 + 1 . . idx2 = = conceptId1
// idx2 + 1 . . idx3 = = relationshipType
// idx3 + 1 . . idx4 = = conceptId2
// idx4 + 1 . . idx5 = = characteristicType
// idx5 + 1 . . idx6 = = refinability
// idx6 + 1 . . end = = relationshipGroup
if ( idx1 < 0 || idx2 < 0 || idx3 < 0 || idx4 < 0 || idx5 < 0 || idx6 < 0 ) { br . close ( ) ; throw new RuntimeException ( "Concepts: Mis-formatted " + "line, expected 7 tab-separated fields, " + "got: " + line ) ; } final String relationshipId = line . substring ( 0 , idx1 ) ; final String conceptId1 = line . substring ( idx1 + 1 , idx2 ) ; final String relationshipType = line . substring ( idx2 + 1 , idx3 ) ; final String conceptId2 = line . substring ( idx3 + 1 , idx4 ) ; final String characteristicType = line . substring ( idx4 + 1 , idx5 ) ; final String refinability = line . substring ( idx5 + 1 , idx6 ) ; final String relationshipGroup = line . substring ( idx6 + 1 ) ; rrs . add ( new RelationshipRow ( relationshipId , conceptId1 , relationshipType , conceptId2 , characteristicType , refinability , relationshipGroup ) ) ; } } catch ( Exception e ) { throw new RuntimeException ( e ) ; } finally { if ( br != null ) { try { br . close ( ) ; } catch ( Exception e ) { } } } // In this case we know we are dealing with a single version so we need
// to generate a single version row
VersionRows vr = new VersionRows ( version ) ; vr . getConceptRows ( ) . addAll ( crs ) ; vr . getRelationshipRows ( ) . addAll ( rrs ) ; return vr ;
|
public class GeneralPurposeFFT_F64_1D { /** * rfftf1 : further processing of Real forward FFT */
void rfftf ( final double a [ ] , final int offa ) { } }
|
if ( n == 1 ) return ; int l1 , l2 , na , kh , nf , ip , iw , ido , idl1 ; final int twon = 2 * n ; nf = ( int ) wtable_r [ 1 + twon ] ; na = 1 ; l2 = n ; iw = twon - 1 ; for ( int k1 = 1 ; k1 <= nf ; ++ k1 ) { kh = nf - k1 ; ip = ( int ) wtable_r [ kh + 2 + twon ] ; l1 = l2 / ip ; ido = n / l2 ; idl1 = ido * l1 ; iw -= ( ip - 1 ) * ido ; na = 1 - na ; switch ( ip ) { case 2 : if ( na == 0 ) { radf2 ( ido , l1 , a , offa , ch , 0 , iw ) ; } else { radf2 ( ido , l1 , ch , 0 , a , offa , iw ) ; } break ; case 3 : if ( na == 0 ) { radf3 ( ido , l1 , a , offa , ch , 0 , iw ) ; } else { radf3 ( ido , l1 , ch , 0 , a , offa , iw ) ; } break ; case 4 : if ( na == 0 ) { radf4 ( ido , l1 , a , offa , ch , 0 , iw ) ; } else { radf4 ( ido , l1 , ch , 0 , a , offa , iw ) ; } break ; case 5 : if ( na == 0 ) { radf5 ( ido , l1 , a , offa , ch , 0 , iw ) ; } else { radf5 ( ido , l1 , ch , 0 , a , offa , iw ) ; } break ; default : if ( ido == 1 ) na = 1 - na ; if ( na == 0 ) { radfg ( ido , ip , l1 , idl1 , a , offa , ch , 0 , iw ) ; na = 1 ; } else { radfg ( ido , ip , l1 , idl1 , ch , 0 , a , offa , iw ) ; na = 0 ; } break ; } l2 = l1 ; } if ( na == 1 ) return ; System . arraycopy ( ch , 0 , a , offa , n ) ;
|
public class VCard { /** * Load VCard information for a connected user . XMPPConnection should be authenticated
* and not anonymous .
* @ param connection connection .
* @ throws XMPPErrorException
* @ throws NoResponseException
* @ throws NotConnectedException
* @ throws InterruptedException
* @ deprecated use { @ link VCardManager # loadVCard ( ) } instead . */
@ Deprecated public void load ( XMPPConnection connection ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { } }
|
load ( connection , null ) ;
|
public class appfwlearningdata { /** * Use this API to delete appfwlearningdata resources . */
public static base_responses delete ( nitro_service client , appfwlearningdata resources [ ] ) throws Exception { } }
|
base_responses result = null ; if ( resources != null && resources . length > 0 ) { appfwlearningdata deleteresources [ ] = new appfwlearningdata [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { deleteresources [ i ] = new appfwlearningdata ( ) ; deleteresources [ i ] . profilename = resources [ i ] . profilename ; deleteresources [ i ] . starturl = resources [ i ] . starturl ; deleteresources [ i ] . cookieconsistency = resources [ i ] . cookieconsistency ; deleteresources [ i ] . fieldconsistency = resources [ i ] . fieldconsistency ; deleteresources [ i ] . formactionurl_ffc = resources [ i ] . formactionurl_ffc ; deleteresources [ i ] . crosssitescripting = resources [ i ] . crosssitescripting ; deleteresources [ i ] . formactionurl_xss = resources [ i ] . formactionurl_xss ; deleteresources [ i ] . sqlinjection = resources [ i ] . sqlinjection ; deleteresources [ i ] . formactionurl_sql = resources [ i ] . formactionurl_sql ; deleteresources [ i ] . fieldformat = resources [ i ] . fieldformat ; deleteresources [ i ] . formactionurl_ff = resources [ i ] . formactionurl_ff ; deleteresources [ i ] . csrftag = resources [ i ] . csrftag ; deleteresources [ i ] . csrfformoriginurl = resources [ i ] . csrfformoriginurl ; deleteresources [ i ] . xmldoscheck = resources [ i ] . xmldoscheck ; deleteresources [ i ] . xmlwsicheck = resources [ i ] . xmlwsicheck ; deleteresources [ i ] . xmlattachmentcheck = resources [ i ] . xmlattachmentcheck ; deleteresources [ i ] . totalxmlrequests = resources [ i ] . totalxmlrequests ; } result = delete_bulk_request ( client , deleteresources ) ; } return result ;
|
public class ServletUtil { /** * Converts a possibly - relative path to a context - relative absolute path .
* Resolves . / and . . / at the beginning of the URL but not in the middle of the URL .
* If the URL begins with http : , https : , file : , mailto : , telnet : , tel : , or cid : , it is not altered .
* @ param servletPath Required when path might be altered . */
public static String getAbsolutePath ( String servletPath , String relativeUrlPath ) throws MalformedURLException { } }
|
char firstChar ; if ( relativeUrlPath . length ( ) > 0 && ( firstChar = relativeUrlPath . charAt ( 0 ) ) != '/' && firstChar != '#' // Skip anchor - only paths
&& ! relativeUrlPath . startsWith ( "http:" ) && ! relativeUrlPath . startsWith ( "https:" ) && ! relativeUrlPath . startsWith ( "file:" ) && ! relativeUrlPath . startsWith ( "mailto:" ) && ! relativeUrlPath . startsWith ( "telnet:" ) && ! relativeUrlPath . startsWith ( "tel:" ) && ! relativeUrlPath . startsWith ( "cid:" ) ) { NullArgumentException . checkNotNull ( servletPath , "servletPath" ) ; int slashPos = servletPath . lastIndexOf ( '/' ) ; if ( slashPos == - 1 ) throw new MalformedURLException ( "No slash found in servlet path: " + servletPath ) ; final String newPath = relativeUrlPath ; final int newPathLen = newPath . length ( ) ; int newPathStart = 0 ; boolean modified ; do { modified = false ; if ( newPathLen >= ( newPathStart + 2 ) && newPath . regionMatches ( newPathStart , "./" , 0 , 2 ) ) { newPathStart += 2 ; modified = true ; } if ( newPathLen >= ( newPathStart + 3 ) && newPath . regionMatches ( newPathStart , "../" , 0 , 3 ) ) { slashPos = servletPath . lastIndexOf ( '/' , slashPos - 1 ) ; if ( slashPos == - 1 ) throw new MalformedURLException ( "Too many ../ in relativeUrlPath: " + relativeUrlPath ) ; newPathStart += 3 ; modified = true ; } } while ( modified ) ; relativeUrlPath = new StringBuilder ( ( slashPos + 1 ) + ( newPathLen - newPathStart ) ) . append ( servletPath , 0 , slashPos + 1 ) . append ( newPath , newPathStart , newPathLen ) . toString ( ) ; } return relativeUrlPath ;
|
public class SQLExecutor { @ Beta public static SQLExecutor w ( final String url , final String user , final String password ) { } }
|
return new SQLExecutor ( JdbcUtil . createDataSource ( url , user , password ) ) ;
|
public class SeekableStreamIndexTaskRunner { /** * Signals the ingestion loop to pause .
* @ return one of the following Responses : 400 Bad Request if the task has started publishing ; 202 Accepted if the
* method has timed out and returned before the task has paused ; 200 OK with a map of the current partition sequences
* in the response body if the task successfully paused */
@ POST @ Path ( "/pause" ) @ Produces ( MediaType . APPLICATION_JSON ) public Response pauseHTTP ( @ Context final HttpServletRequest req ) throws InterruptedException { } }
|
authorizationCheck ( req , Action . WRITE ) ; return pause ( ) ;
|
public class DisplayResourceCommand { /** * ( non - Javadoc )
* @ see org . apache . commons . chain . Command # execute ( org . apache . commons . chain . Context ) */
public boolean execute ( Context context ) throws Exception { } }
|
GenericWebAppContext webCtx = ( GenericWebAppContext ) context ; HttpServletResponse response = webCtx . getResponse ( ) ; HttpServletRequest request = webCtx . getRequest ( ) ; // standalone request ?
String servletPath = request . getPathInfo ( ) ; boolean doClose = true ; // or included ?
if ( servletPath == null ) { servletPath = ( String ) request . getAttribute ( "javax.servlet.include.path_info" ) ; if ( servletPath != null ) doClose = false ; } Node file = ( Node ) webCtx . getSession ( ) . getItem ( ( String ) context . get ( pathKey ) ) ; file . refresh ( false ) ; Node content = null ; try { content = JCRCommandHelper . getNtResourceRecursively ( file ) ; } catch ( ItemNotFoundException e ) { // Patch for ver 1.0 back compatibility
// as exo : image was not primary item
if ( file . isNodeType ( "exo:article" ) ) { try { content = file . getNode ( "exo:image" ) ; } catch ( PathNotFoundException e1 ) { throw e ; // new ItemNotFoundException ( " No nt : resource node found at
// " + file . getPath ( ) + " nor primary items of nt : resource type
} } else { throw e ; // new ItemNotFoundException ( " No nt : resource node found at
// " + file . getPath ( ) + " nor primary items of nt : resource type
} } // if ( file . isNodeType ( " nt : file " ) ) {
// content = file . getNode ( " jcr : content " ) ;
// } else if ( file . isNodeType ( " exo : article " ) ) {
// content = file . getNode ( " exo : image " ) ;
// } else
// throw new Exception ( " Invalid node type , expected nt : file or exo : article ,
// have " + file . getPrimaryNodeType ( ) . getName ( ) + " at " + file . getPath ( ) ) ;
Property data ; try { data = content . getProperty ( "jcr:data" ) ; } catch ( PathNotFoundException e ) { throw new PathNotFoundException ( "No jcr:data node found at " + content . getPath ( ) ) ; } String mime = content . getProperty ( "jcr:mimeType" ) . getString ( ) ; String encoding = content . hasProperty ( "jcr:encoding" ) ? content . getProperty ( "jcr:encoding" ) . getString ( ) : DEFAULT_ENCODING ; MimeTypeResolver resolver = new MimeTypeResolver ( ) ; String fileName = file . getName ( ) ; String fileExt = "" ; if ( fileName . lastIndexOf ( "." ) > - 1 ) { fileExt = fileName . substring ( fileName . lastIndexOf ( "." ) + 1 ) ; fileName = fileName . substring ( 0 , fileName . lastIndexOf ( "." ) ) ; } String mimeExt = resolver . getExtension ( mime ) ; if ( fileExt == null || fileExt . length ( ) == 0 ) { fileExt = mimeExt ; } response . setContentType ( mime + "; charset=" + encoding ) ; String parameter = ( String ) context . get ( "cache-control-max-age" ) ; String cacheControl = parameter == null ? "" : "public, max-age=" + parameter ; response . setHeader ( "Cache-Control: " , cacheControl ) ; response . setHeader ( "Pragma: " , "" ) ; // leave blank to avoid IE errors
response . setHeader ( "Content-disposition" , "attachment; filename=\"" + fileName + "." + fileExt + "\"" ) ; if ( mime . startsWith ( "text" ) ) { PrintWriter out = response . getWriter ( ) ; out . write ( data . getString ( ) ) ; out . flush ( ) ; if ( doClose ) out . close ( ) ; } else { InputStream is = data . getStream ( ) ; byte [ ] buf = new byte [ is . available ( ) ] ; is . read ( buf ) ; ServletOutputStream os = response . getOutputStream ( ) ; os . write ( buf ) ; os . flush ( ) ; if ( doClose ) os . close ( ) ; } return true ;
|
public class FiguerasSSSRFinder { /** * Returns a Vector that contains the union of Vectors vec1 and vec2
* @ param list1 The first vector
* @ param list2 The second vector
* @ return the union of the two list */
private List < IAtom > getUnion ( List < IAtom > list1 , List < IAtom > list2 ) { } }
|
// FIXME : the JavaDoc does not describe what happens : that vec1 gets to be the union !
// jm : pretty sure retainAll would do the trick here but don ' t want to change the
// functionality as item only present in list1 are not removed ( i . e . not union )
List < IAtom > is = new ArrayList < IAtom > ( list1 ) ; for ( int f = list2 . size ( ) - 1 ; f > - 1 ; f -- ) { if ( ! list1 . contains ( list2 . get ( f ) ) ) is . add ( list2 . get ( f ) ) ; } return is ;
|
public class RtpStatistics { /** * Checks whether this SSRC is still a sender .
* If an RTP packet has not been transmitted since time tc - 2T , the
* participant removes itself from the sender table , decrements the sender
* count , and sets we _ sent to false .
* @ return whether this SSRC is still considered a sender */
public boolean isSenderTimeout ( ) { } }
|
long t = rtcpReceiverInterval ( false ) ; long minTime = getCurrentTime ( ) - ( 2 * t ) ; if ( this . rtpSentOn < minTime ) { removeSender ( this . ssrc ) ; } return this . weSent ;
|
public class CPDefinitionVirtualSettingPersistenceImpl { /** * Returns the cp definition virtual setting with the primary key or throws a { @ link com . liferay . portal . kernel . exception . NoSuchModelException } if it could not be found .
* @ param primaryKey the primary key of the cp definition virtual setting
* @ return the cp definition virtual setting
* @ throws NoSuchCPDefinitionVirtualSettingException if a cp definition virtual setting with the primary key could not be found */
@ Override public CPDefinitionVirtualSetting findByPrimaryKey ( Serializable primaryKey ) throws NoSuchCPDefinitionVirtualSettingException { } }
|
CPDefinitionVirtualSetting cpDefinitionVirtualSetting = fetchByPrimaryKey ( primaryKey ) ; if ( cpDefinitionVirtualSetting == null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } throw new NoSuchCPDefinitionVirtualSettingException ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } return cpDefinitionVirtualSetting ;
|
public class TransformerImpl { /** * Subroutine of simplifyTree to handle EQ nodes */
private static Selector simplifyEQ ( Selector sel0 , Selector sel1 ) { } }
|
if ( sel0 . getType ( ) != Selector . BOOLEAN ) return new OperatorImpl ( Selector . EQ , sel0 , sel1 ) ; else return makeOR ( makeAND ( simplifyTree ( sel0 ) , simplifyTree ( sel1 ) ) , makeAND ( simplifyNOT ( sel0 ) , simplifyNOT ( sel1 ) ) ) ;
|
public class JCusparse { /** * If the given result is not cusparseStatus . CUSPARSE _ STATUS _ SUCCESS
* and exceptions have been enabled , this method will throw a
* CudaException with an error message that corresponds to the
* given result code . Otherwise , the given result is simply
* returned .
* @ param result The result to check
* @ return The result that was given as the parameter
* @ throws CudaException If exceptions have been enabled and
* the given result code is not cusparseStatus . CUSPARSE _ STATUS _ SUCCESS */
private static int checkResult ( int result ) { } }
|
if ( exceptionsEnabled && result != cusparseStatus . CUSPARSE_STATUS_SUCCESS ) { throw new CudaException ( cusparseStatus . stringFor ( result ) ) ; } return result ;
|
public class PatternBox { /** * Pattern for a Conversion has an input PhysicalEntity and another output PhysicalEntity that
* belongs to the same EntityReference .
* @ param p pattern to update
* @ param ctrlLabel label
* @ return the pattern */
public static Pattern stateChange ( Pattern p , String ctrlLabel ) { } }
|
if ( p == null ) p = new Pattern ( Conversion . class , "Conversion" ) ; if ( ctrlLabel == null ) p . add ( new Participant ( RelType . INPUT ) , "Conversion" , "input PE" ) ; else p . add ( new Participant ( RelType . INPUT , true ) , ctrlLabel , "Conversion" , "input PE" ) ; p . add ( linkToSpecific ( ) , "input PE" , "input simple PE" ) ; p . add ( peToER ( ) , "input simple PE" , "changed generic ER" ) ; p . add ( new ConversionSide ( ConversionSide . Type . OTHER_SIDE ) , "input PE" , "Conversion" , "output PE" ) ; p . add ( equal ( false ) , "input PE" , "output PE" ) ; p . add ( linkToSpecific ( ) , "output PE" , "output simple PE" ) ; p . add ( peToER ( ) , "output simple PE" , "changed generic ER" ) ; p . add ( linkedER ( false ) , "changed generic ER" , "changed ER" ) ; return p ;
|
public class SendBulkTemplatedEmailRequest { /** * A list of tags , in the form of name / value pairs , to apply to an email that you send to a destination using
* < code > SendBulkTemplatedEmail < / code > .
* @ param defaultTags
* A list of tags , in the form of name / value pairs , to apply to an email that you send to a destination using
* < code > SendBulkTemplatedEmail < / code > . */
public void setDefaultTags ( java . util . Collection < MessageTag > defaultTags ) { } }
|
if ( defaultTags == null ) { this . defaultTags = null ; return ; } this . defaultTags = new com . amazonaws . internal . SdkInternalList < MessageTag > ( defaultTags ) ;
|
public class RandomAccessFile { /** * Moves this file ' s file pointer to a new position , from where following
* { @ code read } , { @ code write } or { @ code skip } operations are done . The
* position may be greater than the current length of the file , but the
* file ' s length will only change if the moving of the pointer is followed
* by a { @ code write } operation .
* @ param offset
* the new file pointer position .
* @ throws IOException
* if this file is closed , { @ code pos < 0 } or another I / O error
* occurs . */
public void seek ( long offset ) throws IOException { } }
|
if ( offset < 0 ) { throw new IOException ( "offset < 0: " + offset ) ; } try { Libcore . os . lseek ( fd , offset , SEEK_SET ) ; } catch ( ErrnoException errnoException ) { throw errnoException . rethrowAsIOException ( ) ; }
|
public class LocalTransactionWrapper { /** * Register the current object with the Synchronisation manager for the current transaction */
@ Override public boolean addSync ( ) throws ResourceException { } }
|
if ( tc . isEntryEnabled ( ) ) { Tr . entry ( this , tc , "addSync" ) ; } try { UOWCoordinator uowCoord = mcWrapper . getUOWCoordinator ( ) ; if ( uowCoord != null ) { if ( uowCoord . isGlobal ( ) ) { if ( mcWrapper . isConnectionSynchronizationProvider ( ) ) { throw new UnsupportedOperationException ( "com.ibm.ws.Transaction.SynchronizationProvider" ) ; /* * Use the Synchronization object from the managed connection to
* register . */
// Synchronization s = ( ( SynchronizationProvider ) mcWrapper . getManagedConnection ( ) ) . getSynchronization ( ) ;
// LocationSpecificFunction . instance . getTransactionManager ( ) . registerSynchronization ( uowCoord , s , EmbeddableWebSphereTransactionManager . SYNC _ TIER _ INNER ) ;
} /* * This code will remain here just in case we run into this
* case . We should not be isEnlistmentDisabled in this code .
* Log a message and return , if isEnlistmentDisabled is true . */
if ( mcWrapper . isEnlistmentDisabled ( ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Managed connection isEnlistmentDisabled is true." ) ; Tr . debug ( this , tc , "Returning without registering." ) ; } if ( tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "addSync" , false ) ; } return false ; } /* * Use our XATransactionWrapper */
// Global Transaction
EmbeddableWebSphereTransactionManager tranMgr = mcWrapper . pm . connectorSvc . transactionManager ; tranMgr . registerSynchronization ( uowCoord , this ) ; mcWrapper . markLocalTransactionWrapperInUse ( ) ; registeredForSync = true ; } else { // Local Transaction
// No need to register for synchronization for unshared / LTC / res - control = Application .
// Instead of cleanup being done via after completion it will either happen at close or
// commit / rollback which ever happens last . This will allow the connection to be returned
// to the pool prior to the end of the LTC scope allowing better utilization of the connection .
boolean shareable = mcWrapper . getConnectionManager ( ) . shareable ( ) ; if ( ! shareable && ! J2CUtilityClass . isContainerAtBoundary ( mcWrapper . pm . connectorSvc . transactionManager ) ) { // Register an instance of an RRS no - transaction wrapper
// so the TM will create an RRS NativeLocalTranasction . The wrapper
// provides " empty " TransactioWrapper and Synchronization behaviors ,
// but indicates to the TM that the LTC requires RRS support .
// if ( tc . isEntryEnabled ( ) ) {
// Tr . exit ( this , tc , " addSync : returning without registering . " ) ;
// return false ;
if ( this . isRRSTransactional ( ) ) { ( ( SynchronizationRegistryUOWScope ) uowCoord ) . registerInterposedSynchronization ( new RRSNoTransactionWrapper ( ) ) ; } else { if ( tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "addSync" , "returning without registering" ) ; } return false ; } } else { if ( mcWrapper . isConnectionSynchronizationProvider ( ) ) { throw new UnsupportedOperationException ( "com.ibm.ws.Transaction.SynchronizationProvider" ) ; /* * Use the Synchronization object from the managed connection to
* register . */
// Synchronization s = ( ( SynchronizationProvider ) mcWrapper . getManagedConnection ( ) ) . getSynchronization ( ) ;
// ( ( SynchronizationRegistryUOWScope ) uowCoord ) . registerInterposedSynchronization ( s ) ;
// registeredForSync = false ;
} else { /* * In order
* to take advantage of the new level of code in which MCWrapper has the isEnlistmentDisabled ( ) */
if ( mcWrapper . isEnlistmentDisabled ( ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Managed connection isEnlistmentDisabled is true." ) ; Tr . debug ( this , tc , "Returning without registering." ) ; } if ( tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "addSync" , false ) ; } return false ; } ( ( SynchronizationRegistryUOWScope ) uowCoord ) . registerInterposedSynchronization ( this ) ; mcWrapper . markLocalTransactionWrapperInUse ( ) ; registeredForSync = true ; } } } } else { // No transaction context . Should never happen .
Tr . error ( tc , "NO_VALID_TRANSACTION_CONTEXT_J2CA0040" , "addSync" , null , mcWrapper . gConfigProps . cfName ) ; throw new ResourceException ( "INTERNAL ERROR: No valid transaction context present" ) ; } } catch ( ResourceException e ) { com . ibm . ws . ffdc . FFDCFilter . processException ( e , "com.ibm.ejs.j2c.LocalTransactionWrapper.addSync" , "594" , this ) ; Tr . error ( tc , "REGISTER_WITH_SYNCHRONIZATION_EXCP_J2CA0026" , "addSync" , e , "Exception" ) ; throw e ; } catch ( Exception e ) { com . ibm . ws . ffdc . FFDCFilter . processException ( e , "com.ibm.ejs.j2c.LocalTransactionWrapper.addSync" , "605" , this ) ; Tr . error ( tc , "REGISTER_WITH_SYNCHRONIZATION_EXCP_J2CA0026" , "addSync" , e , "Exception" ) ; ResourceException re = new ResourceException ( "addSync: caught Exception" ) ; re . initCause ( e ) ; throw re ; } if ( tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "addSync" , registeredForSync ) ; } return registeredForSync ;
|
public class VirtualMachinesInner { /** * Run command on the VM .
* @ param resourceGroupName The name of the resource group .
* @ param vmName The name of the virtual machine .
* @ param parameters Parameters supplied to the Run command operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the RunCommandResultInner object if successful . */
public RunCommandResultInner beginRunCommand ( String resourceGroupName , String vmName , RunCommandInput parameters ) { } }
|
return beginRunCommandWithServiceResponseAsync ( resourceGroupName , vmName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ;
|
public class ChronicleMapBuilder { /** * Shortcut for { @ link # valueMarshallers ( BytesReader , BytesWriter )
* valueMarshallers ( marshaller , marshaller ) } . */
public < M extends BytesReader < V > & BytesWriter < ? super V > > ChronicleMapBuilder < K , V > valueMarshaller ( @ NotNull M marshaller ) { } }
|
return valueMarshallers ( marshaller , marshaller ) ;
|
public class URIDestinationCreator { /** * Extract the value of the named property from URI .
* Find the named property in the name value pairs of the uri and return the value ,
* or null if the property is not present .
* @ param propName the name of the property whose value is required
* @ param uri the URI to search in
* @ return */
public String extractPropertyFromURI ( String propName , String uri ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "extractPropertyFromURI" , new Object [ ] { propName , uri } ) ; String result = null ; // only something to do if uri is non - null & non - empty u
if ( uri != null ) { uri = uri . trim ( ) ; if ( ! uri . equals ( "" ) ) { String [ ] parts = splitOnNonEscapedChar ( uri , '?' , 2 ) ; // parts [ 1 ] ( if present ) is the NVPs , so only something to do if present & non - empty
if ( parts . length >= 2 ) { String nvps = parts [ 1 ] . trim ( ) ; if ( ! nvps . equals ( "" ) ) { // break the nvps string into an array of name = value strings
// Use a regular expression to split on an ' & ' only if it isn ' t preceeded by a ' \ ' .
String [ ] nvpArray = splitOnNonEscapedChar ( nvps , '&' , - 1 ) ; // Search the array for the named property
String propNameE = propName + "=" ; for ( int i = 0 ; i < nvpArray . length ; i ++ ) { String nvp = nvpArray [ i ] ; if ( nvp . startsWith ( propNameE ) ) { // everything after the = is the value
result = nvp . substring ( propNameE . length ( ) ) ; break ; // exit the loop
} } } } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "extractPropertyFromURI" , result ) ; return result ;
|
public class User { /** * Gets a reference to the authentication extension .
* @ return the authentication extension */
private static ExtensionAuthentication getAuthenticationExtension ( ) { } }
|
if ( extensionAuth == null ) { extensionAuth = Control . getSingleton ( ) . getExtensionLoader ( ) . getExtension ( ExtensionAuthentication . class ) ; } return extensionAuth ;
|
public class AppServiceEnvironmentsInner { /** * Reboot all machines in an App Service Environment .
* Reboot all machines in an App Service Environment .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param name Name of the App Service Environment .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */
public void reboot ( String resourceGroupName , String name ) { } }
|
rebootWithServiceResponseAsync ( resourceGroupName , name ) . toBlocking ( ) . single ( ) . body ( ) ;
|
public class AlgorithmId { /** * DER encode this object onto an output stream .
* Implements the < code > DerEncoder < / code > interface .
* @ param out
* the output stream on which to write the DER encoding .
* @ exception IOException on encoding error . */
public void derEncode ( OutputStream out ) throws IOException { } }
|
DerOutputStream bytes = new DerOutputStream ( ) ; DerOutputStream tmp = new DerOutputStream ( ) ; bytes . putOID ( algid ) ; // Setup params from algParams since no DER encoding is given
if ( constructedFromDer == false ) { if ( algParams != null ) { params = new DerValue ( algParams . getEncoded ( ) ) ; } else { params = null ; } } if ( params == null ) { // Changes backed out for compatibility with Solaris
// Several AlgorithmId should omit the whole parameter part when
// it ' s NULL . They are - - -
// rfc3370 2.1 : Implementations SHOULD generate SHA - 1
// AlgorithmIdentifiers with absent parameters .
// rfc3447 C1 : When id - sha1 , id - sha256 , id - sha384 and id - sha512
// are used in an AlgorithmIdentifier the parameters ( which are
// optional ) SHOULD be omitted .
// rfc3279 2.3.2 : The id - dsa algorithm syntax includes optional
// domain parameters . . . When omitted , the parameters component
// MUST be omitted entirely
// rfc3370 3.1 : When the id - dsa - with - sha1 algorithm identifier
// is used , the AlgorithmIdentifier parameters field MUST be absent .
/* if (
algid . equals ( ( Object ) SHA _ oid ) | |
algid . equals ( ( Object ) SHA256 _ oid ) | |
algid . equals ( ( Object ) SHA384 _ oid ) | |
algid . equals ( ( Object ) SHA512 _ oid ) | |
algid . equals ( ( Object ) DSA _ oid ) | |
algid . equals ( ( Object ) sha1WithDSA _ oid ) ) {
; / / no parameter part encoded
} else {
bytes . putNull ( ) ; */
bytes . putNull ( ) ; } else { bytes . putDerValue ( params ) ; } tmp . write ( DerValue . tag_Sequence , bytes ) ; out . write ( tmp . toByteArray ( ) ) ;
|
public class IfcPresentationLayerWithStyleImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) public EList < IfcPresentationStyleSelect > getLayerStyles ( ) { } }
|
return ( EList < IfcPresentationStyleSelect > ) eGet ( Ifc2x3tc1Package . Literals . IFC_PRESENTATION_LAYER_WITH_STYLE__LAYER_STYLES , true ) ;
|
public class ImageLoaderCurrent { /** * Process the INode records stored in the fsimage .
* @ param in Datastream to process
* @ param v Visitor to walk over INodes
* @ param numInodes Number of INodes stored in file
* @ param skipBlocks Process all the blocks within the INode ?
* @ throws VisitException
* @ throws IOException */
private void processINodes ( DataInputStream in , ImageVisitor v , long numInodes , boolean skipBlocks ) throws IOException { } }
|
v . visitEnclosingElement ( ImageElement . INODES , ImageElement . NUM_INODES , numInodes ) ; if ( LayoutVersion . supports ( Feature . FSIMAGE_NAME_OPTIMIZATION , imageVersion ) ) { processLocalNameINodes ( in , v , numInodes , skipBlocks ) ; } else { // full path name
processFullNameINodes ( in , v , numInodes , skipBlocks ) ; } v . leaveEnclosingElement ( ) ; // INodes
|
public class ArrayMath { /** * PRINTING FUNCTIONS */
public static String toBinaryString ( byte [ ] b ) { } }
|
StringBuilder s = new StringBuilder ( ) ; for ( byte by : b ) { for ( int j = 7 ; j >= 0 ; j -- ) { if ( ( by & ( 1 << j ) ) > 0 ) { s . append ( '1' ) ; } else { s . append ( '0' ) ; } } s . append ( ' ' ) ; } return s . toString ( ) ;
|
public class SingleNonNioFileObjectStore { /** * ( non - Javadoc )
* @ see com . ibm . ws . objectManager . AbstractSingleFileObjectStore # readDirectory ( int , long , long ) */
final AbstractSingleFileObjectStore . Directory makeDirectory ( int minimumNodeSize , long directoryRootByteAddress , long directoryRootLength ) throws ObjectManagerException { } }
|
return new Directory ( minimumNodeSize , directoryRootByteAddress , directoryRootLength ) ;
|
public class Constant { /** * Constructs a new instance of the specified type with value converted from
* the input byte array .
* @ param type
* the specified type
* @ param val
* the byte array contains the value
* @ return a constant of specified type with value converted from the byte
* array */
public static Constant newInstance ( Type type , byte [ ] val ) { } }
|
switch ( type . getSqlType ( ) ) { case ( INTEGER ) : return new IntegerConstant ( val ) ; case ( BIGINT ) : return new BigIntConstant ( val ) ; case ( DOUBLE ) : return new DoubleConstant ( val ) ; case ( VARCHAR ) : return new VarcharConstant ( val , type ) ; } throw new UnsupportedOperationException ( "Unspported SQL type: " + type . getSqlType ( ) ) ;
|
public class CollectionUtils { /** * Returns a list of all modes in the Collection . ( If the Collection has multiple items with the
* highest frequency , all of them will be returned . ) */
public static < T > Set < T > modes ( Collection < T > values ) { } }
|
Counter < T > counter = new ClassicCounter < T > ( values ) ; List < Double > sortedCounts = CollectionUtils . sorted ( counter . values ( ) ) ; Double highestCount = sortedCounts . get ( sortedCounts . size ( ) - 1 ) ; Counters . retainAbove ( counter , highestCount ) ; return counter . keySet ( ) ;
|
public class FrenchRepublicanCalendar { /** * / * [ deutsch ]
* < p > Erzeugt ein neues franz & ouml ; sisches Republikdatum als Erg & auml ; nzungstag . < / p >
* @ param year republican year in range 1-1202
* @ param sansculottides the complementary day
* @ return new instance of { @ code FrenchRepublicanCalendar }
* @ throws IllegalArgumentException in case of any inconsistencies */
public static FrenchRepublicanCalendar of ( int year , Sansculottides sansculottides ) { } }
|
if ( ( year < 1 ) || ( year > MAX_YEAR ) ) { throw new IllegalArgumentException ( "Year out of range: " + year ) ; } else if ( ( sansculottides == Sansculottides . LEAP_DAY ) && ! isLeapYear ( year ) ) { throw new IllegalArgumentException ( "Day of Revolution only exists in leap years: " + year ) ; } return new FrenchRepublicanCalendar ( year , 360 + sansculottides . getValue ( ) ) ;
|
public class ntp_sync { /** * Use this API to fetch filtered set of ntp _ sync resources .
* filter string should be in JSON format . eg : " vm _ state : DOWN , name : [ a - z ] + " */
public static ntp_sync [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } }
|
ntp_sync obj = new ntp_sync ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; ntp_sync [ ] response = ( ntp_sync [ ] ) obj . getfiltered ( service , option ) ; return response ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.