signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Kafka { /** * Configures to start reading partitions from specific offsets , set independently for each partition . * Resets previously set offsets . * @ param specificOffsets the specified offsets for partitions * @ see FlinkKafkaConsumerBase # setStartFromSpecificOffsets ( Map ) */ public Kafka sta...
this . startupMode = StartupMode . SPECIFIC_OFFSETS ; this . specificOffsets = Preconditions . checkNotNull ( specificOffsets ) ; return this ;
public class InternalUtils { /** * Get the Struts ModuleConfig for the given module path . */ public static ModuleConfig getModuleConfig ( String modulePath , ServletContext context ) { } }
return ( ModuleConfig ) context . getAttribute ( Globals . MODULE_KEY + modulePath ) ;
public class WorkItem { /** * Add secondary types patterns ( not nested in the type itself but contained * in the java file ) * @ param fileName * java file name ( not path ! ) without . java suffix * @ param classNamePattern * non null pattern for all matching . class file names * @ return modified classNa...
ICompilationUnit cu = JavaCore . createCompilationUnitFrom ( file ) ; if ( cu == null ) { FindbugsPlugin . getDefault ( ) . logError ( "NULL compilation unit for " + file + ", FB analysis might be incomplete for included types" ) ; return classNamePattern ; } try { IType [ ] types = cu . getTypes ( ) ; if ( types . le...
public class TypeConformanceComputer { /** * Keeps the cumulated distance for all the common raw super types of the given references . * Interfaces that are more directly implemented will get a lower total count than more general * interfaces . */ protected void cumulateDistance ( final List < LightweightTypeRefere...
for ( LightweightTypeReference other : references ) { Multiset < JvmType > otherDistance = LinkedHashMultiset . create ( ) ; initializeDistance ( other , all , otherDistance ) ; cumulatedDistance . retainAll ( otherDistance ) ; for ( Multiset . Entry < JvmType > typeToDistance : otherDistance . entrySet ( ) ) { if ( cu...
public class ComputeNodesImpl { /** * Restarts the specified compute node . * You can restart a node only if it is in an idle or running state . * @ param poolId The ID of the pool that contains the compute node . * @ param nodeId The ID of the compute node that you want to restart . * @ param nodeRebootOption ...
return ServiceFuture . fromHeaderResponse ( rebootWithServiceResponseAsync ( poolId , nodeId , nodeRebootOption , computeNodeRebootOptions ) , serviceCallback ) ;
public class CPRuleUtil { /** * Returns a range of all the cp rules where groupId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < ...
return getPersistence ( ) . findByGroupId ( groupId , start , end ) ;
public class IntTupleIterators { /** * Returns an iterator that returns { @ link MutableIntTuple } s in the * given range . < br > * < br > * Copies of the given tuples will be stored internally . < br > * < br > * Also see < a href = " . . / . . / package - summary . html # IterationOrder " > * Iteration O...
Utils . checkForEqualSize ( min , max ) ; IntTuple localMin = IntTuples . copy ( min ) ; IntTuple localMax = IntTuples . copy ( max ) ; return new IntTupleIterator ( localMin , localMax , IntTupleIncrementors . lexicographicalIncrementor ( ) ) ;
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertIfcCurrencyEnumToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class LetterboxingViewport { /** * Forces update of current world size according to window size . Will try to keep the set aspect ratio . * @ param screenWidth current screen width . * @ param screenHeight current screen height . */ private void updateWorldSize ( final int screenWidth , final int screenHeigh...
final float width = screenWidth * scaleX ; final float height = screenHeight * scaleY ; final float fitHeight = width / aspectRatio ; if ( fitHeight > height ) { setWorldSize ( height * aspectRatio , height ) ; } else { setWorldSize ( width , fitHeight ) ; }
public class HelpModule { /** * Encodes the specified URL path , which may be absolute or relative . * For compressed help sets , use the web / prefix . When using this syntax , CWF requires that the * root folder in the jar file be named " web " with the specified path being relative to that * folder . * @ par...
return url . startsWith ( "/" ) || url . startsWith ( "." ) ? url : url . startsWith ( "web/" ) ? "/" + url : "/web/" + url ;
public class Wings { /** * Unsubscribes to link state changes of the endpoints . * @ param object the { @ link java . lang . Object } you wish to unsubscribe . * @ throws IllegalStateException Wings must be initialized . See { @ link Wings # init ( IWingsModule , Class [ ] ) } . */ public static void unsubscribe ( ...
if ( ! sIsInitialized ) { throw new IllegalStateException ( "Wings must be initialized. See Wings#init()." ) ; } WingsInjector . getBus ( ) . unregister ( object ) ;
public class SemanticSearchServiceImpl { /** * Computes the best matching synonym which is closest to a set of search terms . < br > * Will stem the { @ link OntologyTerm } ' s synonyms and the search terms , and then compute the * maximum { @ link StringDistance } between them . 0 means disjunct , 1 means identica...
// ontologyTerm . getSynonyms ( ) will never be empty because it contains itself as a synonym Optional < Hit < String > > bestSynonym = ontologyTerm . getSynonyms ( ) . stream ( ) . map ( synonym -> Hit . create ( synonym , distanceFrom ( synonym , searchTerms ) ) ) . max ( Comparator . naturalOrder ( ) ) ; return best...
public class ApacheUtils { /** * Returns a new Credentials Provider for use with proxy authentication . */ public static CredentialsProvider newProxyCredentialsProvider ( HttpClientSettings settings ) { } }
final CredentialsProvider provider = new BasicCredentialsProvider ( ) ; provider . setCredentials ( newAuthScope ( settings ) , newNTCredentials ( settings ) ) ; return provider ;
public class SlideShowView { /** * Set the playlist * @ param playlist The playlist to set */ public void setPlaylist ( PlayList playlist ) { } }
this . playlist = playlist ; if ( adapter != null ) { playlist . onSlideCountChanged ( adapter . getCount ( ) ) ; }
public class Types { /** * Return the least upper bound ( lub ) of set of types . If the lub * does not exist return the type of null ( bottom ) . */ public Type lub ( Type ... ts ) { } }
final int UNKNOWN_BOUND = 0 ; final int ARRAY_BOUND = 1 ; final int CLASS_BOUND = 2 ; int [ ] kinds = new int [ ts . length ] ; int boundkind = UNKNOWN_BOUND ; for ( int i = 0 ; i < ts . length ; i ++ ) { Type t = ts [ i ] ; switch ( t . getTag ( ) ) { case CLASS : boundkind |= kinds [ i ] = CLASS_BOUND ; break ; case ...
public class PartialUniqueIndex { /** * Removes and returns the entry associated with the specified key * in the HashMap . Returns null if the HashMap contains no mapping * for this key . */ public Object remove ( Object key ) { } }
Object underlying = this . underlyingObjectGetter . getUnderlyingObject ( key ) ; return removeUsingUnderlying ( underlying ) ;
public class ExcelFunctions { /** * Returns the number of days between two dates . */ public static int days ( EvaluationContext ctx , Object endDate , Object startDate ) { } }
return datedif ( ctx , startDate , endDate , "d" ) ;
public class SecurityActions { /** * Create a new instance by finding a constructor that matches the argumentTypes signature using the arguments for * instantiation . * @ param className * Full classname of class to create * @ param argumentTypes * The constructor argument types * @ param arguments * The ...
// Precondition checks if ( className == null ) { throw new IllegalArgumentException ( "ClassName must be specified" ) ; } if ( argumentTypes == null ) { throw new IllegalArgumentException ( "ArgumentTypes must be specified. Use empty array if no arguments" ) ; } if ( arguments == null ) { throw new IllegalArgumentExce...
public class InProcessLauncher { /** * Starts a Spark application . * @ see AbstractLauncher # startApplication ( SparkAppHandle . Listener . . . ) * @ param listeners Listeners to add to the handle before the app is launched . * @ return A handle for the launched application . */ @ Override public SparkAppHandle...
if ( builder . isClientMode ( builder . getEffectiveConfig ( ) ) ) { LOG . warning ( "It's not recommended to run client-mode applications using InProcessLauncher." ) ; } Method main = findSparkSubmit ( ) ; LauncherServer server = LauncherServer . getOrCreateServer ( ) ; InProcessAppHandle handle = new InProcessAppHand...
public class PageExceptionImpl { /** * set a additional key value * @ param key * @ param value */ public void setAdditional ( Collection . Key key , Object value ) { } }
additional . setEL ( key , StringUtil . toStringEmptyIfNull ( value ) ) ;
public class Output { /** * { @ inheritDoc } */ @ Override public void writeString ( String string ) { } }
final byte [ ] encoded = encodeString ( string ) ; final int len = encoded . length ; if ( len < AMF . LONG_STRING_LENGTH ) { buf . put ( AMF . TYPE_STRING ) ; // write unsigned short buf . put ( ( byte ) ( ( len >> 8 ) & 0xff ) ) ; buf . put ( ( byte ) ( len & 0xff ) ) ; } else { buf . put ( AMF . TYPE_LONG_STRING ) ;...
public class StringUtils { /** * < p > Searches a CharSequence to find the first index of any * character not in the given set of characters . < / p > * < p > A { @ code null } CharSequence will return { @ code - 1 } . * A { @ code null } or zero length search array will return { @ code - 1 } . < / p > * < pre ...
if ( isEmpty ( cs ) || ArrayUtils . isEmpty ( searchChars ) ) { return INDEX_NOT_FOUND ; } final int csLen = cs . length ( ) ; final int csLast = csLen - 1 ; final int searchLen = searchChars . length ; final int searchLast = searchLen - 1 ; outer : for ( int i = 0 ; i < csLen ; i ++ ) { final char ch = cs . charAt ( i...
public class ZapNTLMEngineImpl { /** * Calculate a challenge block */ private static byte [ ] makeRandomChallenge ( final Random random ) throws AuthenticationException { } }
final byte [ ] rval = new byte [ 8 ] ; synchronized ( random ) { random . nextBytes ( rval ) ; } return rval ;
public class AbstractLexicalAnalyzer { /** * 分词 * @ param sentence 文本 * @ param normalized 正规化后的文本 * @ param wordList 储存单词列表 * @ param attributeList 储存用户词典中的词性 , 设为null表示不查询用户词典 */ protected void segment ( final String sentence , final String normalized , final List < String > wordList , final List < CoreDictio...
if ( attributeList != null ) { final int [ ] offset = new int [ ] { 0 } ; CustomDictionary . parseLongestText ( sentence , new AhoCorasickDoubleArrayTrie . IHit < CoreDictionary . Attribute > ( ) { @ Override public void hit ( int begin , int end , CoreDictionary . Attribute value ) { if ( begin != offset [ 0 ] ) { seg...
public class PhaseThreeApplication { /** * Stage five parameter equivalencing . * @ param network the { @ link ProtoNetwork network } to equivalence * @ param equivalences the { @ link Set set } of { @ link EquivalenceDataIndex } * @ param bldr the { @ link StringBuilder } * @ return the { @ code int } count of...
bldr . append ( "Equivalencing parameters" ) ; stageOutput ( bldr . toString ( ) ) ; ProtoNetwork ret = network ; int ct = 0 ; try { ct = p2 . stage3EquivalenceParameters ( ret , equivalences ) ; stageOutput ( "(" + ct + " equivalences)" ) ; } catch ( IOException ioex ) { final String err = ioex . getMessage ( ) ; fata...
public class IoServiceListenerSupport { /** * Calls { @ link IoServiceListener # sessionCreated ( IoSession ) } for all registered listeners . */ public void fireSessionCreated ( IoSession session ) { } }
boolean firstSession = false ; if ( session . getService ( ) instanceof IoConnector ) { synchronized ( managedSessions ) { firstSession = managedSessions . isEmpty ( ) ; } } // If already registered , ignore . if ( managedSessions . putIfAbsent ( session . getId ( ) , session ) != null ) { return ; } // If the first co...
public class Interval { /** * Reads a whole number from the given field of the node . Accepts numbers , * numerical strings and fractions . * @ param node node from which to read * @ param field name of the field to read * @ return the field ' s int value * @ throws NumberFormatException if the content cannot...
String stringValue = node . get ( field ) . asText ( ) ; return ( int ) Float . parseFloat ( stringValue ) ;
public class FullyQualifiedNameImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . FULLY_QUALIFIED_NAME__FQN_TYPE : return FQN_TYPE_EDEFAULT == null ? fqnType != null : ! FQN_TYPE_EDEFAULT . equals ( fqnType ) ; case AfplibPackage . FULLY_QUALIFIED_NAME__FQN_FORMAT : return FQN_FORMAT_EDEFAULT == null ? fqnFormat != null : ! FQN_FORMAT_EDEFAULT . equals ( f...
public class ReflectKit { /** * Load a class according to the class name . * @ param typeName * @ return */ public static Class < ? > form ( String typeName ) { } }
try { return Class . forName ( typeName ) ; } catch ( Exception e ) { log . warn ( "Class.forName fail" , e . getMessage ( ) ) ; return null ; }
public class GeometryExpression { /** * Returns a geometric object that represents the Point * set difference of this geometric object with anotherGeometry . * @ param geometry other geometry * @ return difference between this and the other geometry */ public GeometryExpression < Geometry > difference ( Expressio...
return GeometryExpressions . geometryOperation ( SpatialOps . DIFFERENCE , mixin , geometry ) ;
public class FNPRGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . FNPRG__RESERVED : setReserved ( RESERVED_EDEFAULT ) ; return ; case AfplibPackage . FNPRG__LC_HEIGHT : setLcHeight ( LC_HEIGHT_EDEFAULT ) ; return ; case AfplibPackage . FNPRG__CAP_MHT : setCapMHt ( CAP_MHT_EDEFAULT ) ; return ; case AfplibPackage . FNPRG__MAX_ASC_HT : setMax...
public class Dim { /** * Returns whether the given string is syntactically valid script . */ public boolean stringIsCompilableUnit ( String str ) { } }
DimIProxy action = new DimIProxy ( this , IPROXY_STRING_IS_COMPILABLE ) ; action . text = str ; action . withContext ( ) ; return action . booleanResult ;
public class SchemaService { /** * Delete the given application , including all of its data , from the default tenant . * If the given application doesn ' t exist , the call is a no - op . WARNING : This method * deletes an application regardless of whether it has a key defined . * @ param appName Name of applica...
checkServiceState ( ) ; ApplicationDefinition appDef = getApplication ( appName ) ; if ( appDef == null ) { return ; } deleteApplication ( appName , appDef . getKey ( ) ) ;
public class Quaternionf { /** * Add < code > q2 < / code > to this quaternion . * @ param q2 * the quaternion to add to this * @ return this */ public Quaternionf add ( Quaternionfc q2 ) { } }
x += q2 . x ( ) ; y += q2 . y ( ) ; z += q2 . z ( ) ; w += q2 . w ( ) ; return this ;
public class V1InstanceCreator { /** * Creates a new Regression Suite with title assigned with this Regression Plan . * @ param name Title of the suite . * @ param regressionPlan Regression Plan to assign . * @ return A newly minted Regression Suite that exists in the VersionOne system . */ public RegressionSuite...
return regressionSuite ( name , regressionPlan , null ) ;
public class LineSearchMore94 { /** * Configures the line search . * @ param ftol Tolerance for sufficient decrease . ftol { @ code > } 0 . Smaller value for loose tolerance . Try 1e - 4 * @ param gtol Tolerance for curvature condition . gtol & ge ; 0 . Larger value for loose tolerance . Try 0.9 * @ param xtol Re...
if ( ftol < 0 ) throw new IllegalArgumentException ( "ftol must be >= 0 " ) ; if ( gtol < 0 ) throw new IllegalArgumentException ( "gtol must be >= 0 " ) ; if ( xtol < 0 ) throw new IllegalArgumentException ( "xtol must be >= 0 " ) ; this . ftol = ftol ; this . gtol = gtol ; this . xtol = xtol ; return this ;
public class JsDocInfoParser { /** * Parse a { @ code @ suppress } tag of the form * { @ code @ suppress & # 123 ; warning1 | warning2 & # 125 ; } . * @ param token The current token . */ private JsDocToken parseSuppressTag ( JsDocToken token ) { } }
if ( token != JsDocToken . LEFT_CURLY ) { addParserWarning ( "msg.jsdoc.suppress" ) ; return token ; } else { Set < String > suppressions = new HashSet < > ( ) ; while ( true ) { if ( match ( JsDocToken . STRING ) ) { String name = stream . getString ( ) ; if ( ! suppressionNames . contains ( name ) ) { addParserWarnin...
public class FSDataset { /** * Find the file corresponding to the block and return it if it exists . */ File validateBlockFile ( int namespaceId , Block b ) throws IOException { } }
return getValidateBlockFile ( namespaceId , b , false ) ;
public class AbstractUrl { /** * { @ inheritDoc } */ public boolean isNextIn ( Context context ) { } }
Source source = context . getSource ( ) ; return parseLength ( source , source . getOffset ( ) , context . getTerminator ( ) ) >= 0 ;
public class GraphEntityMapper { /** * Converts a property stored in Neo4J ( nodes or relationship ) to * corresponding entity field value */ public Object fromNeo4JObject ( Object source , Field field ) { } }
Class < ? > targetClass = field . getType ( ) ; if ( targetClass . isAssignableFrom ( BigDecimal . class ) || targetClass . isAssignableFrom ( BigInteger . class ) ) { return PropertyAccessorHelper . fromSourceToTargetClass ( field . getType ( ) , source . getClass ( ) , source ) ; } else if ( targetClass . isAssignabl...
public class RevocationChecker { /** * We have a cert whose revocation status couldn ' t be verified by * a CRL issued by the cert that issued the CRL . See if we can * find a valid CRL issued by a separate key that can verify the * revocation status of this certificate . * Note that this does not provide suppo...
String msg = "revocation status" ; if ( debug != null ) { debug . println ( "RevocationChecker.verifyWithSeparateSigningKey()" + " ---checking " + msg + "..." ) ; } // reject circular dependencies - RFC 3280 is not explicit on how // to handle this , so we feel it is safest to reject them until // the issue is resolved...
public class AmazonEC2Client { /** * Creates a new Capacity Reservation with the specified attributes . * Capacity Reservations enable you to reserve capacity for your Amazon EC2 instances in a specific Availability * Zone for any duration . This gives you the flexibility to selectively add capacity reservations an...
request = beforeClientExecution ( request ) ; return executeCreateCapacityReservation ( request ) ;
public class Overlay { /** * Loads all bytes of the overlay into an array and returns them . * @ return array containing the overlay bytes * @ throws IOException */ public byte [ ] getDump ( ) throws IOException { } }
byte [ ] dump = new byte [ ( int ) getSize ( ) ] ; try ( RandomAccessFile raf = new RandomAccessFile ( file , "r" ) ) { raf . seek ( offset ) ; raf . readFully ( dump ) ; } return dump ;
public class OriginAliasMessage { /** * Returns the length of this message when encoded according to the Client - World Model protocol . * @ return the length , in bytes , of the encoded form of this message . */ public int getMessageLength ( ) { } }
// Message type int messageLength = 1 ; // Number of aliases messageLength += 4 ; if ( this . aliases != null ) { for ( OriginAlias alias : this . aliases ) { // Alias number , name length messageLength += 8 ; try { messageLength += alias . origin . getBytes ( "UTF-16BE" ) . length ; } catch ( UnsupportedEncodingExcept...
public class MuzeiArtSource { /** * This method is invoked on the worker thread with a request to process . * Only one Intent is processed at a time , but the processing happens on a * worker thread that runs independently from other application logic . * So , if this code takes a long time , it will hold up othe...
if ( intent == null ) { return ; } String action = intent . getAction ( ) ; // TODO : permissions ? if ( ACTION_SUBSCRIBE . equals ( action ) ) { processSubscribe ( ( ComponentName ) intent . getParcelableExtra ( EXTRA_SUBSCRIBER_COMPONENT ) , intent . getStringExtra ( EXTRA_TOKEN ) ) ; } else if ( ACTION_HANDLE_COMMAN...
public class CheckpointEndLogRecord { /** * Gives back the serialized LogRecord as arrays of bytes . * @ return ObjectManagerByteArrayOutputStream [ ] the buffers containing the serialized LogRecord . */ public ObjectManagerByteArrayOutputStream [ ] getBuffers ( ) throws ObjectManagerException { } }
if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "getBuffers" ) ; ObjectManagerByteArrayOutputStream [ ] buffers = new ObjectManagerByteArrayOutputStream [ 1 ] ; // Create the buffer to contain the header for this log record . buffers [ 0 ] = new ObjectManagerByteAr...
public class JBBPDslBuilder { /** * Create anonymous custom type array with fixed size . * @ param type custom type , must not be null * @ param size expression to calculate size of the array , must not be null . * @ return the builder instance , must not be null */ public JBBPDslBuilder CustomArray ( final Strin...
return this . CustomArray ( type , null , size , null ) ;
public class br { /** * < pre > * Use this operation to modify Repeater Instance . * < / pre > */ public static br update ( nitro_service client , br resource ) throws Exception { } }
resource . validate ( "modify" ) ; return ( ( br [ ] ) resource . update_resource ( client ) ) [ 0 ] ;
public class FFMQConnectionFactory { /** * / * ( non - Javadoc ) * @ see javax . naming . Referenceable # getReference ( ) */ @ Override public final Reference getReference ( ) throws NamingException { } }
Reference ref = new Reference ( getClass ( ) . getName ( ) , JNDIObjectFactory . class . getName ( ) , null ) ; ref . add ( new StringRefAddr ( "providerURL" , getProviderURL ( ) ) ) ; if ( clientID != null ) ref . add ( new StringRefAddr ( "clientID" , clientID ) ) ; return ref ;
public class SoyFileSet { /** * Extracts all messages from this Soy file set and writes the messages to an output sink . * @ param msgBundleHandler Handler to write the messages . * @ param options Options to configure how to write the extracted messages . * @ param output Where to write the extracted messages . ...
resetErrorReporter ( ) ; SoyMsgBundle bundle = doExtractMsgs ( ) ; msgBundleHandler . writeExtractedMsgs ( bundle , options , output , errorReporter ) ; throwIfErrorsPresent ( ) ; reportWarnings ( ) ;
public class MetadataService { /** * Removes a { @ link RepositoryMetadata } of the specified { @ code repoName } from the specified * { @ code projectName } . */ public CompletableFuture < Revision > removeRepo ( Author author , String projectName , String repoName ) { } }
requireNonNull ( author , "author" ) ; requireNonNull ( projectName , "projectName" ) ; requireNonNull ( repoName , "repoName" ) ; final JsonPointer path = JsonPointer . compile ( "/repos" + encodeSegment ( repoName ) + "/removal" ) ; final Change < JsonNode > change = Change . ofJsonPatch ( METADATA_JSON , asJsonArray...
public class EventImpl { /** * Fire an event containing a value is condition is valid . * @ throws DevFailed * @ param eventSocket */ protected void pushAttributeValueEvent ( ZMQ . Socket eventSocket ) throws DevFailed { } }
xlogger . entry ( ) ; eventTrigger . setError ( null ) ; eventTrigger . updateProperties ( ) ; if ( isSendEvent ( ) ) { sendAttributeValueEvent ( eventSocket ) ; } xlogger . exit ( ) ;
public class ObjectOriginIdentifierImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . OBJECT_ORIGIN_IDENTIFIER__SYSTEM : setSystem ( ( Integer ) newValue ) ; return ; case AfplibPackage . OBJECT_ORIGIN_IDENTIFIER__SYS_ID : setSysID ( ( byte [ ] ) newValue ) ; return ; case AfplibPackage . OBJECT_ORIGIN_IDENTIFIER__MED_ID : setMedID ( ( byte [ ] ) newValue ) ; ...
public class CmsContainerpageController { /** * Schedules an update of the gallery data according to the current element view and the editable containers . < p > */ protected void scheduleGalleryUpdate ( ) { } }
// only if not already scheduled if ( m_galleryUpdateTimer == null ) { m_galleryUpdateTimer = new Timer ( ) { @ Override public void run ( ) { m_galleryUpdateTimer = null ; updateGalleryData ( false , null ) ; } } ; m_galleryUpdateTimer . schedule ( 50 ) ; }
public class TomcatBoot { protected void registerShutdownHook ( ) { } }
if ( suppressShutdownHook ) { return ; } final File markFile = prepareMarkFile ( ) ; final long lastModified = markFile . lastModified ( ) ; final String exp = new SimpleDateFormat ( "yyyy/MM/dd HH:mm:ss.SSS" ) . format ( new Date ( lastModified ) ) ; info ( "...Registering the shutdown hook for the Tomcat: lastModifie...
public class PactDslRequestWithPath { /** * Match a request header . * @ param header Header to match * @ param regex Regular expression to match * @ param headerExample Example value to use */ public PactDslRequestWithPath matchHeader ( String header , String regex , String headerExample ) { } }
requestMatchers . addCategory ( "header" ) . setRule ( header , new RegexMatcher ( regex ) ) ; requestHeaders . put ( header , Collections . singletonList ( headerExample ) ) ; return this ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcRectangularPyramid ( ) { } }
if ( ifcRectangularPyramidEClass == null ) { ifcRectangularPyramidEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 428 ) ; } return ifcRectangularPyramidEClass ;
public class LasUtils { /** * Distance between two points . * @ param r1 the first point . * @ param r2 the second point . * @ return the 3D distance . */ public static double distance3D ( LasRecord r1 , LasRecord r2 ) { } }
double deltaElev = Math . abs ( r1 . z - r2 . z ) ; double projectedDistance = NumericsUtilities . pythagoras ( r1 . x - r2 . x , r1 . y - r2 . y ) ; double distance = NumericsUtilities . pythagoras ( projectedDistance , deltaElev ) ; return distance ;
public class MetaClassImpl { /** * Adds an instance method to this metaclass . * @ param method The method to be added */ public void addNewInstanceMethod ( Method method ) { } }
final CachedMethod cachedMethod = CachedMethod . find ( method ) ; NewInstanceMetaMethod newMethod = new NewInstanceMetaMethod ( cachedMethod ) ; final CachedClass declaringClass = newMethod . getDeclaringClass ( ) ; addNewInstanceMethodToIndex ( newMethod , metaMethodIndex . getHeader ( declaringClass . getTheClass ( ...
public class TupleGenerator { /** * Returns the set of tuples that could satisfy conditions required by the given test case . */ private Iterator < Tuple > getSatisfyingTuples ( final TestCaseDef testCase , VarTupleSet varTupleSet ) { } }
final Comparator < VarBindingDef > byUsage = byUsage ( varTupleSet ) ; return IteratorUtils . transformedIterator ( // Iterate over all combinations of bindings . . . new CartesianProduct < VarBindingDef > ( // . . . combining members from all sets of bindings . . . new ArrayList < Set < VarBindingDef > > ( CollectionU...
public class KMLGeometry { /** * A geographic location defined by longitude , latitude , and ( optional ) * altitude . * Syntax : * < Point id = " ID " > * < ! - - specific to Point - - > * < extrude > 0 < / extrude > < ! - - boolean - - > * < altitudeMode > clampToGround < / altitudeMode > * < ! - - kml ...
sb . append ( "<Point>" ) ; appendExtrude ( extrude , sb ) ; appendAltitudeMode ( altitudeModeEnum , sb ) ; sb . append ( "<coordinates>" ) ; Coordinate coord = point . getCoordinate ( ) ; sb . append ( coord . x ) . append ( "," ) . append ( coord . y ) ; if ( ! Double . isNaN ( coord . z ) ) { sb . append ( "," ) . a...
public class AbstractJaxb { /** * delete all descendant elements that is specified tag type . * @ param tagType */ @ SuppressWarnings ( "unchecked" ) public < T extends AbstractJaxb > void removeDescendants ( Class < T > tagType ) { } }
RemoveDescendantsUtil . removeDescendants ( ( T ) this , tagType ) ;
public class Chorus { /** * to get the suite name we concatenate all the values provided for suite name switch */ public String getSuiteName ( ) { } }
return configReader . isSet ( ChorusConfigProperty . SUITE_NAME ) ? concatenateName ( configReader . getValues ( ChorusConfigProperty . SUITE_NAME ) ) : "" ;
public class JavaUtil { /** * Getting last elements of list in reverse order * @ param elements source list * @ param limit maximum elements count * @ param < T > type of objects * @ return result list */ public static < T > List < T > last ( List < T > elements , int limit ) { } }
ArrayList < T > res = new ArrayList < T > ( ) ; for ( int i = 0 ; i < elements . size ( ) ; i ++ ) { if ( res . size ( ) >= limit ) { break ; } res . add ( elements . get ( elements . size ( ) - 1 - i ) ) ; } return res ;
public class Optional { /** * If a value is present , apply the provided mapping function to it , * and if the result is non - null , return an { @ code Optional } describing the * result . Otherwise return an empty { @ code Optional } . * @ apiNote This method supports post - processing on optional values , with...
Objects . requireNonNull ( mapper ) ; if ( ! isPresent ( ) ) return empty ( ) ; else { return Optional . ofNullable ( mapper . apply ( value ) ) ; }
public class ZmqEventConsumer { @ Override protected void checkDeviceConnection ( DeviceProxy deviceProxy , String attribute , DeviceData deviceData , String event_name ) throws DevFailed { } }
// Check if address is coherent ( ? ? ) deviceData = checkZmqAddress ( deviceData , deviceProxy ) ; String deviceName = deviceProxy . fullName ( ) ; ApiUtil . printTrace ( "checkDeviceConnection for " + deviceName ) ; if ( ! device_channel_map . containsKey ( deviceName ) ) { ApiUtil . printTrace ( " Does NOT Exist"...
public class SelectAlgorithmAndInputPanel { /** * Specifies an image which contains the original input image . After this has been called the * view input image widget is activated and when selected this image will be displayed instead * of the main GUI . This functionality is optional . * @ param image Original ...
inputImage = image ; SwingUtilities . invokeLater ( new Runnable ( ) { public void run ( ) { if ( inputImage == null ) { originalCheck . setEnabled ( false ) ; } else { originalCheck . setEnabled ( true ) ; origPanel . setImage ( inputImage ) ; origPanel . setPreferredSize ( new Dimension ( inputImage . getWidth ( ) , ...
public class RePatternManager { /** * Pattern containing regular expression is finalized , i . e . , created correctly and added to hmAllRePattern . * @ param name key name * @ param rePattern repattern value */ private void finalizeRePattern ( String name , String rePattern ) { } }
// create correct regular expression rePattern = rePattern . replaceFirst ( "\\|" , "" ) ; /* this was added to reduce the danger of getting unusable groups from user - made repattern * files with group - producing parentheses ( i . e . " ( foo | bar ) " while matching against the documents . */ rePattern = rePattern...
public class RegisterWebAppVisitorHS { /** * Creates an instance of a class from class name . * @ param clazz class of the required object * @ param classLoader class loader to use to load the class * @ param className class name for the object to create * @ return created object * @ throws NullArgumentExcept...
return loadClass ( clazz , classLoader , className ) . newInstance ( ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link String } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.ibm.com/websphere/wim" , name = "l" ) public JAXBElement < String > createL ( String value ) { } }
return new JAXBElement < String > ( _L_QNAME , String . class , null , value ) ;
public class ConstantPool { /** * Adds a long constant . */ public LongConstant addLong ( long value ) { } }
LongConstant entry = getLongByValue ( value ) ; if ( entry != null ) return entry ; entry = new LongConstant ( this , _entries . size ( ) , value ) ; addConstant ( entry ) ; addConstant ( null ) ; return entry ;
public class EventManager { /** * Triggers an event through the EventManager . This will call the registered EventObservers with the provided * event . * @ param event object */ public void trigger ( Object event ) { } }
Set < Class > eventTypes = getAllInheritedClasses ( event . getClass ( ) ) ; for ( Class eventType : eventTypes ) { if ( observers . containsKey ( eventType ) ) { for ( EventObserver eventObserver : observers . get ( eventType ) ) { executionQueue . get ( ) . add ( new EventExecution ( event , eventObserver ) ) ; } } }...
public class PropertiesUtil { /** * Resolve the values of properties if any contains $ { . . . } . */ public static void resolve ( Map < String , String > properties ) { } }
boolean resolved = true ; while ( resolved ) { resolved = false ; for ( Map . Entry < String , String > p : properties . entrySet ( ) ) { String v = p . getValue ( ) ; if ( v == null ) continue ; int i = v . indexOf ( "${" ) ; if ( i < 0 ) continue ; int j = v . indexOf ( '}' , i + 2 ) ; if ( j < 0 ) continue ; String ...
public class JDALogger { /** * Utility function to enable logging of complex statements more efficiently ( lazy ) . * @ param lazyLambda * The Supplier used when evaluating the expression * @ return An Object that can be passed to SLF4J ' s logging methods as lazy parameter */ public static Object getLazyString (...
return new Object ( ) { @ Override public String toString ( ) { try { return lazyLambda . getString ( ) ; } catch ( Exception ex ) { StringWriter sw = new StringWriter ( ) ; ex . printStackTrace ( new PrintWriter ( sw ) ) ; return "Error while evaluating lazy String... " + sw . toString ( ) ; } } } ;
public class Type { /** * Checks if the element is assignable to a variable of the desired type . * @ param match current pattern match * @ param ind mapped indices * @ return true if the element is assignable to a variable of the desired type */ @ Override public boolean satisfies ( Match match , int ... ind ) {...
assert ind . length == 1 ; return clazz . isAssignableFrom ( match . get ( ind [ 0 ] ) . getModelInterface ( ) ) ;
public class DeactivateUsers { /** * Runs the example . * @ param adManagerServices the services factory . * @ param session the session . * @ param userId the ID of the user to deactivate . * @ throws ApiException if the API request failed with one or more service errors . * @ throws RemoteException if the A...
// Get the UserService . UserServiceInterface userService = adManagerServices . get ( session , UserServiceInterface . class ) ; // Create a statement to select a user . StatementBuilder statementBuilder = new StatementBuilder ( ) . where ( "WHERE id = :id" ) . orderBy ( "id ASC" ) . limit ( StatementBuilder . SUGGESTE...
public class CreateDevEndpointResult { /** * The security groups assigned to the new DevEndpoint . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setSecurityGroupIds ( java . util . Collection ) } or { @ link # withSecurityGroupIds ( java . util . Collection...
if ( this . securityGroupIds == null ) { setSecurityGroupIds ( new java . util . ArrayList < String > ( securityGroupIds . length ) ) ; } for ( String ele : securityGroupIds ) { this . securityGroupIds . add ( ele ) ; } return this ;
public class TopLevelDomainsInner { /** * Get details of a top - level domain . * Get details of a top - level domain . * @ param name Name of the top - level domain . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if pa...
return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( name ) , serviceCallback ) ;
public class ParallelTask { /** * Cancel on target hosts . * @ param targetHosts * the target hosts * @ return true , if successful */ @ SuppressWarnings ( "deprecation" ) public boolean cancelOnTargetHosts ( List < String > targetHosts ) { } }
boolean success = false ; try { switch ( state ) { case IN_PROGRESS : if ( executionManager != null && ! executionManager . isTerminated ( ) ) { executionManager . tell ( new CancelTaskOnHostRequest ( targetHosts ) , executionManager ) ; logger . info ( "asked task to stop from running on target hosts with count {}..."...
public class ClientMediaEntry { /** * Get media resource as an InputStream , should work regardless of whether you set the media * resource data as an InputStream or as a byte array . */ public InputStream getAsStream ( ) throws ProponoException { } }
if ( getContents ( ) != null && ! getContents ( ) . isEmpty ( ) ) { final Content c = getContents ( ) . get ( 0 ) ; if ( c . getSrc ( ) != null ) { return getResourceAsStream ( ) ; } else if ( inputStream != null ) { return inputStream ; } else if ( bytes != null ) { return new ByteArrayInputStream ( bytes ) ; } else {...
public class SuccessWithValue { /** * Create a new object with the given value . * @ param < DATATYPE > * The data type that is wrapped together with the success indicator * @ param aSuccessIndicator * The success indicator . May not be < code > null < / code > . * @ param aValue * The value to be used . Ma...
return new SuccessWithValue < > ( aSuccessIndicator , aValue ) ;
public class RScriptExporter { /** * Creates an R script file plotting multiple surfaces based on a data frame * generated with 1024 values in the scope of FldExporter : : AllVariables for * the two input variables * @ param file is the R script file * @ param engine is the engine to export * @ throws IOExcep...
if ( engine . getInputVariables ( ) . isEmpty ( ) ) { throw new RuntimeException ( "[exporter error] engine has no input variables to export the surface" ) ; } if ( engine . getOutputVariables ( ) . isEmpty ( ) ) { throw new RuntimeException ( "[exporter error] engine has no output variables to export the surface" ) ; ...
public class BindTypeBuilder { /** * Generate method to parse xml stream . * @ param context * the context * @ param entity * kind of object to manage */ private static void generateParseOnXml ( BindTypeContext context , BindEntity entity ) { } }
// @ formatter : off MethodSpec . Builder methodBuilder = MethodSpec . methodBuilder ( "parseOnXml" ) . addJavadoc ( "parse xml\n" ) . addAnnotation ( Override . class ) . addModifiers ( Modifier . PUBLIC ) // . addParameter ( typeName ( KriptonXmlContext . class ) , " context " ) . addParameter ( typeName ( XMLParser ...
public class AbstractReaderModule { /** * Read a file and process it for list information . * @ param ref system path of the file to process * @ param parseFile file to parse , may be { @ code null } * @ throws DITAOTException if processing failed */ void readFile ( final Reference ref , final URI parseFile ) thr...
currentFile = ref . filename ; assert currentFile . isAbsolute ( ) ; final URI src = parseFile != null ? parseFile : currentFile ; assert src . isAbsolute ( ) ; final URI rel = tempFileNameScheme . generateTempFileName ( currentFile ) ; outputFile = new File ( job . tempDirURI . resolve ( rel ) ) ; final File outputDir...
public class Element { /** * Use the JavaXPath to determine if element is present . If not , then try * finding element . Return false if the element does not exist * @ return true or false * @ throws WidgetException */ private boolean isElementPresent_internal ( ) throws WidgetException { } }
try { try { final boolean isPotentiallyXpathWithLocator = ( locator instanceof EByFirstMatching ) || ( locator instanceof EByXpath ) ; if ( isPotentiallyXpathWithLocator && isElementPresentJavaXPath ( ) ) return true ; } catch ( Exception e ) { // Continue } findElement ( ) ; return true ; } catch ( NoSuchElementExcept...
public class AlbumActivity { /** * Select picture , from album . */ private void selectAlbum ( ) { } }
Album . album ( this ) . multipleChoice ( ) . columnCount ( 2 ) . selectCount ( 6 ) . camera ( true ) . cameraVideoQuality ( 1 ) . cameraVideoLimitDuration ( Integer . MAX_VALUE ) . cameraVideoLimitBytes ( Integer . MAX_VALUE ) . checkedList ( mAlbumFiles ) . widget ( Widget . newDarkBuilder ( this ) . title ( mToolbar...
public class HBaseClient { /** * ( non - Javadoc ) . * @ param < E > * the element type * @ param entityClass * the entity class * @ param col * the col * @ return the list * @ see com . impetus . kundera . client . Client # find ( java . lang . Class , * java . util . Map ) */ @ Override public < E >...
EntityMetadata entityMetadata = KunderaMetadataManager . getEntityMetadata ( kunderaMetadata , getPersistenceUnit ( ) , entityClass ) ; List < E > entities = new ArrayList < E > ( ) ; Map < String , Field > columnFamilyNameToFieldMap = MetadataUtils . createSuperColumnsFieldMap ( entityMetadata , kunderaMetadata ) ; fo...
public class SelectSubPlanAssembler { /** * A method to filter out single - TVE expressions . * @ param expr List of single - TVE expressions . * @ param otherExprs List of multi - TVE expressions . * @ return List of single - TVE expressions from the input collection . */ private static List < AbstractExpression...
List < AbstractExpression > singleTVEExprs = new ArrayList < > ( ) ; for ( AbstractExpression expr : exprs ) { List < TupleValueExpression > tves = ExpressionUtil . getTupleValueExpressions ( expr ) ; if ( tves . size ( ) == 1 ) { singleTVEExprs . add ( expr ) ; } else { otherExprs . add ( expr ) ; } } return singleTVE...
public class Scheduler { /** * Initializes the scheduler by booting up Quartz */ public void initialize ( ) { } }
try { this . quartzScheduler = new StdSchedulerFactory ( ) . getScheduler ( ) ; this . quartzScheduler . setJobFactory ( Application . getInstance ( SchedulerFactory . class ) ) ; } catch ( final SchedulerException e ) { LOG . error ( "Failed to initialize scheduler" , e ) ; }
public class CFEndPointImpl { /** * Identify if one of the outbound channel definitions has a factory that * implements * the LocalChannelFactory . */ private void determineIsLocal ( ) { } }
// Loop through each channel in the outbound chain represented by this // endpoint int i = 0 ; for ( OutboundChannelDefinition def : this . outboundChannelDefs ) { if ( LocalChannelFactory . class . isAssignableFrom ( def . getOutboundFactory ( ) ) ) { // Found Local channel factory . if ( TraceComponent . isAnyTracing...
public class SecStrucCalc { /** * Generate a summary of this SS prediction with information about * the three types of helix turns in different row sequences . * This is similar to the summary output of Jmol , and useful to visualize * the helix patterns . * @ return String helix summary */ public String printH...
StringBuffer g = new StringBuffer ( ) ; // 3-10 helix StringBuffer h = new StringBuffer ( ) ; // alpha helix StringBuffer i = new StringBuffer ( ) ; // pi - helix StringBuffer ss = new StringBuffer ( ) ; // SS summary StringBuffer aa = new StringBuffer ( ) ; // AA one - letter String nl = System . getProperty ( "line.s...
public class JavaUtils { /** * Closes the given object , ignoring IOExceptions . */ public static void closeQuietly ( Closeable closeable ) { } }
try { if ( closeable != null ) { closeable . close ( ) ; } } catch ( IOException e ) { logger . error ( "IOException should not have been thrown." , e ) ; }
public class Cell { /** * Adds { @ link # RIGHT } and clears { @ link # LEFT } for the alignment of the widget within the cell . */ public Cell < C , T > right ( ) { } }
if ( align == null ) align = RIGHT ; else { align |= RIGHT ; align &= ~ LEFT ; } return this ;
public class RemovePermissionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( RemovePermissionRequest removePermissionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( removePermissionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( removePermissionRequest . getFunctionName ( ) , FUNCTIONNAME_BINDING ) ; protocolMarshaller . marshall ( removePermissionRequest . getStatementId ( ) , STATEMENT...
public class BatchDeleteAttributesRequest { /** * A list of items on which to perform the operation . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setItems ( java . util . Collection ) } or { @ link # withItems ( java . util . Collection ) } if you want to...
if ( this . items == null ) { setItems ( new com . amazonaws . internal . SdkInternalList < DeletableItem > ( items . length ) ) ; } for ( DeletableItem ele : items ) { this . items . add ( ele ) ; } return this ;
public class AnnotationUtils { /** * Returns all annotations of a class , also the annotations of the super * classes , implemented interfaces and the annotations that are present in * stereotype annotations . The stereotype annotation will not be included in * the annotation set . * Note that the set can conta...
Set < Annotation > annotationSet = new LinkedHashSet < Annotation > ( ) ; List < Class < ? > > annotationTypes = new ArrayList < Class < ? > > ( ) ; // Iterate through all super types of the given class for ( Class < ? > type : ReflectionUtils . getSuperTypes ( clazz ) ) { Annotation [ ] annotations = type . getAnnotat...
public class ClasspathBuilder { /** * Add source path and resource paths of the project to the list of classpath items . * @ param items Classpath items . * @ param sourceRoots */ private void addSources ( final Collection < File > items , final Collection < String > sourceRoots ) { } }
for ( String path : sourceRoots ) { items . add ( new File ( path ) ) ; }
public class QueryRecord { /** * Free the query record . */ public void free ( ) { } }
super . free ( ) ; // Free first in case you have to Update ( ) the current record ! while ( m_LinkageList . size ( ) > 0 ) { TableLink tableLink = ( TableLink ) m_LinkageList . elementAt ( 0 ) ; tableLink . free ( ) ; } m_LinkageList . removeAllElements ( ) ; m_LinkageList = null ; m_vRecordList . free ( ) ; // Free a...
public class UserMarshaller { /** * Marshall the given parameter object . */ public void marshall ( User user , ProtocolMarshaller protocolMarshaller ) { } }
if ( user == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( user . getUserId ( ) , USERID_BINDING ) ; protocolMarshaller . marshall ( user . getAccountId ( ) , ACCOUNTID_BINDING ) ; protocolMarshaller . marshall ( user . getPrimaryEmail ( )...
public class CPDefinitionInventoryPersistenceImpl { /** * Returns a range of all the cp definition inventories . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the resu...
return findAll ( start , end , null ) ;