signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class UpdateEndpointRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateEndpointRequest updateEndpointRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateEndpointRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateEndpointRequest . getApplicationId ( ) , APPLICATIONID_BINDING ) ; protocolMarshaller . marshall ( updateEndpointRequest . getEndpointId ( ) , ENDPOINTID_BIN...
public class MpJwtAppSetupUtils { /** * create app with loginConfig set to Form Login in WEB . xml , and Basic in the App * @ param server * @ throws Exception */ public void deployMicroProfileLoginConfigFormLoginInWebXmlBasicInApp ( LibertyServer server ) throws Exception { } }
List < String > classList = createAppClassListBuildAppNames ( "CommonMicroProfileMarker_FormLoginInWeb_BasicInApp" , "MicroProfileLoginConfigFormLoginInWebXmlBasicInApp" ) ; ShrinkHelper . exportAppToServer ( server , genericCreateArchiveWithJsps ( MpJwtFatConstants . LOGINCONFIG_FORM_LOGIN_IN_WEB_XML_SERVLET_BASIC_IN_...
public class BaseSpscLinkedArrayQueue { /** * { @ inheritDoc } * This implementation is correct for single producer thread use only . */ @ Override public boolean offer ( final E e ) { } }
// Objects . requireNonNull ( e ) ; if ( null == e ) { throw new NullPointerException ( ) ; } // local load of field to avoid repeated loads after volatile reads final E [ ] buffer = producerBuffer ; final long index = lpProducerIndex ( ) ; final long mask = producerMask ; final long offset = calcElementOffset ( index ...
public class UintMap { /** * Get object value assigned with key . * @ return key object value or null if key is absent */ public Object getObject ( int key ) { } }
if ( key < 0 ) Kit . codeBug ( ) ; if ( values != null ) { int index = findIndex ( key ) ; if ( 0 <= index ) { return values [ index ] ; } } return null ;
public class PseudoClassSpecifierChecker { /** * Add { @ code : first - child } elements . * @ see < a href = " http : / / www . w3 . org / TR / css3 - selectors / # first - child - pseudo " > < code > : first - child < / code > pseudo - class < / a > */ private void addFirstChildElements ( ) { } }
for ( Node node : nodes ) { Index index = helper . getIndexInParent ( node , false ) ; if ( index . index == 0 ) result . add ( node ) ; }
public class MultiStatementCypherSubGraphExporter { /** * - - - - Relationships - - - - */ private void exportRelationships ( PrintWriter out , Reporter reporter , int batchSize ) { } }
if ( graph . getRelationships ( ) . iterator ( ) . hasNext ( ) ) { begin ( out ) ; appendRelationships ( out , batchSize , reporter ) ; commit ( out ) ; out . flush ( ) ; }
public class HttpJsonSerializer { /** * Helper object for the format calls to wrap the JSON response in a JSONP * function if requested . Used for code dedupe . * @ param obj The object to serialize * @ return A ChannelBuffer to pass on to the query * @ throws JSONException if serialization failed */ private Ch...
if ( query . hasQueryStringParam ( "jsonp" ) ) { return ChannelBuffers . wrappedBuffer ( JSON . serializeToJSONPBytes ( query . getQueryStringParam ( "jsonp" ) , obj ) ) ; } return ChannelBuffers . wrappedBuffer ( JSON . serializeToBytes ( obj ) ) ;
public class ResourceConverter { /** * Registers relationship resolver for given type . Resolver will be used if relationship resolution is enabled * trough relationship annotation . * @ param resolver resolver instance * @ param type type */ public void setTypeResolver ( RelationshipResolver resolver , Class < ?...
if ( resolver != null ) { String typeName = ReflectionUtils . getTypeName ( type ) ; if ( typeName != null ) { typedResolvers . put ( type , resolver ) ; } }
public class MetricUtils { /** * a metric name composites of : type @ topologyId @ componentId @ taskId @ streamId @ group @ name for non - worker metrics * OR type @ topologyId @ host @ port @ group @ name for worker metrics */ public static String metricName ( String type , String topologyId , String componentId , ...
return concat ( type , topologyId , componentId , taskId , streamId , group , name ) ;
public class ServerTransportAcceptListener { /** * Called when we are about to accept a connection from a peer . * @ param cfConversation */ public ConversationReceiveListener acceptConnection ( Conversation cfConversation ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "acceptConnection" , cfConversation ) ; // Add this conversation to our active conversations list synchronized ( activeConversations ) { Object connectionReference = cfConversation . getConnectionReference ( ) ; ArrayList li...
public class ConsonantUtil { /** * * * * * * BEGINNING OF FUNCTION * * * * * */ / * / public static boolean is_jhalanta ( String str ) { } }
// System . out . print ( " Entered is _ jhalanta , returning : " ) ; String s1 = VarnaUtil . getAntyaVarna ( str ) ; if ( is_jhal ( s1 ) ) { // Log . logInfo ( " true " ) ; return true ; } // Log . logInfo ( " false " ) ; return false ;
public class NormOps_DDRM { /** * Computes the Frobenius matrix norm : < br > * < br > * normF = Sqrt { & sum ; < sub > i = 1 : m < / sub > & sum ; < sub > j = 1 : n < / sub > { a < sub > ij < / sub > < sup > 2 < / sup > } } * This is equivalent to the element wise p = 2 norm . See { @ link # fastNormF } for anot...
double total = 0 ; double scale = CommonOps_DDRM . elementMaxAbs ( a ) ; if ( scale == 0.0 ) return 0.0 ; final int size = a . getNumElements ( ) ; for ( int i = 0 ; i < size ; i ++ ) { double val = a . get ( i ) / scale ; total += val * val ; } return scale * Math . sqrt ( total ) ;
public class S3Sample { /** * Creates a temporary file with text data to demonstrate uploading a file * to Amazon S3 * @ return A newly created temporary file with text data . * @ throws IOException */ private static File createSampleFile ( ) throws IOException { } }
File file = File . createTempFile ( "aws-java-sdk-" , ".txt" ) ; file . deleteOnExit ( ) ; Writer writer = new OutputStreamWriter ( new FileOutputStream ( file ) ) ; writer . write ( "abcdefghijklmnopqrstuvwxyz\n" ) ; writer . write ( "01234567890112345678901234\n" ) ; writer . write ( "!@#$%^&*()-=[]{};':',.<>/?\n" ) ...
public class ButtonTemplate { /** * Build and get message as a string * @ return String the final message */ public String build ( ) { } }
this . message_string = "{" ; if ( this . recipient_id != null ) { this . message_string += "\"recipient\": {\"id\": \"" + this . recipient_id + "\"}," ; } if ( ( this . message_text != null ) && ! ( this . message_text . equals ( "" ) ) && ! ( this . buttons . isEmpty ( ) ) ) { this . message_string += "\"message\": {...
public class IndexHelper { /** * The index of the IndexInfo in which a scan starting with @ name should begin . * @ param name * name of the index * @ param indexList * list of the indexInfo objects * @ param comparator * comparator type * @ param reversed * is name reversed * @ return int index */ pu...
if ( name . isEmpty ( ) ) return lastIndex >= 0 ? lastIndex : reversed ? indexList . size ( ) - 1 : 0 ; if ( lastIndex >= indexList . size ( ) ) return - 1 ; IndexInfo target = new IndexInfo ( name , name , 0 , 0 ) ; /* Take the example from the unit test , and say your index looks like this : [0 . . 5 ] [ 10 . . 15 ...
public class SequenceFile { /** * Construct the preferred type of ' raw ' SequenceFile Writer . * @ param conf The configuration . * @ param out The stream on top which the writer is to be constructed . * @ param keyClass The ' key ' type . * @ param valClass The ' value ' type . * @ param compressionType The...
Writer writer = createWriter ( conf , out , keyClass , valClass , compressionType , codec , new Metadata ( ) ) ; return writer ;
public class CmsDefaultXmlContentHandler { /** * Initializes the default values for this content handler . < p > * Using the default values from the appinfo node , it ' s possible to have more * sophisticated logic for generating the defaults then just using the XML schema " default " * attribute . < p > * @ pa...
Iterator < Element > i = CmsXmlGenericWrapper . elementIterator ( root , APPINFO_DEFAULT ) ; while ( i . hasNext ( ) ) { // iterate all " default " elements in the " defaults " node Element element = i . next ( ) ; String elementName = element . attributeValue ( APPINFO_ATTR_ELEMENT ) ; String defaultValue = element . ...
public class DisplayUtil { /** * Returns the height of the device ' s display . * @ param context * The context , which should be used , as an instance of the class { @ link Context } . The * context may not be null * @ return The height of the device ' s display in pixels as an { @ link Integer } value */ publ...
Condition . INSTANCE . ensureNotNull ( context , "The context may not be null" ) ; return context . getResources ( ) . getDisplayMetrics ( ) . heightPixels ;
public class LocationIndexTree { /** * this method returns the spatial key in reverse order for easier right - shifting */ final long createReverseKey ( double lat , double lon ) { } }
return BitUtil . BIG . reverse ( keyAlgo . encode ( lat , lon ) , keyAlgo . getBits ( ) ) ;
public class InjectorImpl { /** * This gets really nasty now that constructors can invoke operations on us . * The upshot is that we should check to see if instances have been * registered by callees after each recursive invocation of injectFromPlan or * constructor invocations . The error handling currently bail...
if ( ! plan . isFeasible ( ) ) { throw new InjectionException ( "Cannot inject " + plan . getNode ( ) . getFullName ( ) + ": " + plan . toCantInjectString ( ) ) ; } if ( plan . isAmbiguous ( ) ) { throw new InjectionException ( "Cannot inject " + plan . getNode ( ) . getFullName ( ) + " " + plan . toCantInjectString ( ...
public class N { /** * Mostly it ' s designed for one - step operation to complete the operation in one step . * < code > java . util . stream . Stream < / code > is preferred for multiple phases operation . * @ param a * @ param fromIndex * @ param toIndex * @ param func * @ return */ public static < T , R...
checkFromToIndex ( fromIndex , toIndex , len ( a ) ) ; N . checkArgNotNull ( func ) ; if ( N . isNullOrEmpty ( a ) ) { return new ArrayList < > ( ) ; } final List < R > result = new ArrayList < > ( toIndex - fromIndex ) ; for ( int i = fromIndex ; i < toIndex ; i ++ ) { result . add ( func . apply ( a [ i ] ) ) ; } ret...
public class AnimaQuery { /** * Set the column name using lambda * @ param function lambda expressions , use the Model : : getXXX * @ param < R > * @ return AnimaQuery */ public < R > AnimaQuery < T > where ( TypeFunction < T , R > function ) { } }
String columnName = AnimaUtils . getLambdaColumnName ( function ) ; conditionSQL . append ( " AND " ) . append ( columnName ) ; return this ;
public class Project { /** * Get SecondaryWorkitems in this Project filtered as specified in the * passed in filter . * @ param filter Criteria to filter on . Project will be set automatically . * If null , all tasks and tests in the project are returned . * @ param includeSubprojects Specifies whether to inclu...
filter = ( filter != null ) ? filter : new SecondaryWorkitemFilter ( ) ; return getInstance ( ) . get ( ) . secondaryWorkitems ( getFilter ( filter , includeSubprojects ) ) ;
public class DateBag { /** * Wraps a given date in a format that can be easily unbagged */ @ Override public void bag ( Date unBaggedObject ) { } }
if ( unBaggedObject == null ) this . time = 0 ; else this . time = unBaggedObject . getTime ( ) ;
public class GetContentModerationResult { /** * The detected moderation labels and the time ( s ) they were detected . * @ param moderationLabels * The detected moderation labels and the time ( s ) they were detected . */ public void setModerationLabels ( java . util . Collection < ContentModerationDetection > mode...
if ( moderationLabels == null ) { this . moderationLabels = null ; return ; } this . moderationLabels = new java . util . ArrayList < ContentModerationDetection > ( moderationLabels ) ;
public class TableWriterServiceImpl { /** * Opens a new segment writer . The segment ' s sequence id will be the next * sequence number . * @ return the new segment writer */ public OutSegment openWriter ( ) { } }
if ( isGcRequired ( ) ) { // _ gcSequence = _ seqGen . get ( ) ; _table . getGcService ( ) . gc ( _seqGen . get ( ) ) ; _seqSinceGcCount = 0 ; } _seqSinceGcCount ++ ; long sequence = _seqGen . get ( ) ; return openWriterSeq ( sequence ) ;
public class Order { /** * Write members to a MwsWriter . * @ param w * The writer to write to . */ @ Override public void writeFragmentTo ( MwsWriter w ) { } }
w . write ( "AmazonOrderId" , amazonOrderId ) ; w . write ( "SellerOrderId" , sellerOrderId ) ; w . write ( "PurchaseDate" , purchaseDate ) ; w . write ( "LastUpdateDate" , lastUpdateDate ) ; w . write ( "OrderStatus" , orderStatus ) ; w . write ( "FulfillmentChannel" , fulfillmentChannel ) ; w . write ( "SalesChannel"...
public class UpdateIdentityPoolResult { /** * An array of Amazon Resource Names ( ARNs ) of the SAML provider for your identity pool . * @ param samlProviderARNs * An array of Amazon Resource Names ( ARNs ) of the SAML provider for your identity pool . */ public void setSamlProviderARNs ( java . util . Collection <...
if ( samlProviderARNs == null ) { this . samlProviderARNs = null ; return ; } this . samlProviderARNs = new java . util . ArrayList < String > ( samlProviderARNs ) ;
public class FlowControllerFactory { /** * Get a { @ link FlowControllerFactory } . The instance returned may or may not have been cached . * @ param servletContext the current { @ link ServletContext } . * @ return a { @ link FlowControllerFactory } for the given { @ link ServletContext } . */ public static FlowCo...
FlowControllerFactory factory = ( FlowControllerFactory ) servletContext . getAttribute ( CONTEXT_ATTR ) ; assert factory != null : FlowControllerFactory . class . getName ( ) + " was not found in ServletContext attribute " + CONTEXT_ATTR ; factory . reinit ( servletContext ) ; return factory ;
public class XWikiDOMSerializer { /** * Create the DOM given a rootNode and a document builder . * This method is a replica of { @ link DomSerializer # createDOM ( TagNode ) } excepts that it requires to give a * DocumentBuilder . * @ param documentBuilder the { @ link DocumentBuilder } instance to use , Document...
Document document = createDocument ( documentBuilder , rootNode ) ; createSubnodes ( document , document . getDocumentElement ( ) , rootNode . getAllChildren ( ) ) ; return document ;
public class StreamSnapshotSink { /** * Assemble the chunk so that it can be used to construct the VoltTable that * will be passed to EE . * @ param buf * @ return */ public static ByteBuffer getNextChunk ( byte [ ] schemaBytes , ByteBuffer buf , CachedByteBufferAllocator resultBufferAllocator ) { } }
buf . position ( buf . position ( ) + 4 ) ; // skip partition id int length = schemaBytes . length + buf . remaining ( ) ; ByteBuffer outputBuffer = resultBufferAllocator . allocate ( length ) ; outputBuffer . put ( schemaBytes ) ; outputBuffer . put ( buf ) ; outputBuffer . flip ( ) ; return outputBuffer ;
public class SmartTable { /** * Removes the specified style names on the specified row and column . */ public void removeStyleNames ( int row , int column , String ... styles ) { } }
for ( String style : styles ) { getFlexCellFormatter ( ) . removeStyleName ( row , column , style ) ; }
public class JsonGenerator { /** * TODO dirty and incorrect for overlaps */ private void mergeOneOf ( ) { } }
if ( SchemaCompositeMatchers . hasOneOf ( ) . matches ( schema ) ) { SchemaList list = schema . getOneOf ( ) ; Schema choice = list . get ( rnd . nextInt ( list . size ( ) ) ) ; schema . getJson ( ) . remove ( "oneOf" ) ; schema . merge ( choice ) ; }
public class TypeQualifierApplications { /** * static Map < String , Throwable > checked = new HashMap < String , Throwable > ( ) ; */ private static TypeQualifierAnnotation computeEffectiveTypeQualifierAnnotation ( TypeQualifierValue < ? > typeQualifierValue , XMethod xmethod , int parameter ) { } }
if ( DEBUG ) { // System . out . println ( " XX : " // + System . identityHashCode ( typeQualifierValue ) ) ; if ( typeQualifierValue . value != null ) { System . out . println ( " Value is " + typeQualifierValue . value + "(" + typeQualifierValue . value . getClass ( ) . toString ( ) + ")" ) ; } } Map < TypeQualifier...
public class CPSpecificationOptionPersistenceImpl { /** * Removes all the cp specification options where CPOptionCategoryId = & # 63 ; from the database . * @ param CPOptionCategoryId the cp option category ID */ @ Override public void removeByCPOptionCategoryId ( long CPOptionCategoryId ) { } }
for ( CPSpecificationOption cpSpecificationOption : findByCPOptionCategoryId ( CPOptionCategoryId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( cpSpecificationOption ) ; }
public class EventWaitActivity { /** * Method that executes the logic based on the work */ public void execute ( ) throws ActivityException { } }
EventWaitInstance received = registerWaitEvents ( false , true ) ; if ( received != null ) { setReturnCodeAndExitStatus ( received . getCompletionCode ( ) ) ; processMessage ( getExternalEventInstanceDetails ( received . getMessageDocumentId ( ) ) ) ; boolean toFinish = handleCompletionCode ( ) ; if ( toFinish && exitS...
public class DefaultDecoder { /** * Options returned by this method are configured with mDecodeBuffer which is GuardedBy ( " this " ) */ private static BitmapFactory . Options getDecodeOptionsForStream ( EncodedImage encodedImage , Bitmap . Config bitmapConfig ) { } }
final BitmapFactory . Options options = new BitmapFactory . Options ( ) ; // Sample size should ONLY be different than 1 when downsampling is enabled in the pipeline options . inSampleSize = encodedImage . getSampleSize ( ) ; options . inJustDecodeBounds = true ; // fill outWidth and outHeight BitmapFactory . decodeStr...
public class TimelineModel { /** * Deletes a given event in the model with UI update . * @ param event event to be deleted * @ param timelineUpdater TimelineUpdater instance to delete the event in UI */ public void delete ( TimelineEvent event , TimelineUpdater timelineUpdater ) { } }
int index = getIndex ( event ) ; if ( index >= 0 ) { events . remove ( event ) ; if ( timelineUpdater != null ) { // update UI timelineUpdater . delete ( index ) ; } }
public class ExcelWriter { /** * 为指定的key列表添加标题别名 , 如果没有定义key的别名 , 在onlyAlias为false时使用原key * @ param keys 键列表 * @ return 别名列表 */ private Map < ? , ? > aliasMap ( Map < ? , ? > rowMap ) { } }
if ( MapUtil . isEmpty ( this . headerAlias ) ) { return rowMap ; } final Map < Object , Object > filteredMap = new LinkedHashMap < > ( ) ; String aliasName ; for ( Entry < ? , ? > entry : rowMap . entrySet ( ) ) { aliasName = this . headerAlias . get ( entry . getKey ( ) ) ; if ( null != aliasName ) { // 别名键值对加入 filte...
public class Props { /** * Store only those properties defined at this local level * @ param out The output stream to write to * @ throws IOException If the file can ' t be found or there is an io error */ public void storeLocal ( final OutputStream out ) throws IOException { } }
final Properties p = new Properties ( ) ; for ( final String key : this . _current . keySet ( ) ) { p . setProperty ( key , get ( key ) ) ; } p . store ( out , null ) ;
public class KeyVaultClientCustomImpl { /** * List secrets in the specified vault . * @ param vaultBaseUrl * The vault name , e . g . https : / / myvault . vault . azure . net * @ param serviceCallback * the async ServiceCallback to handle successful and failed * responses . * @ return the { @ link ServiceF...
return getSecretsAsync ( vaultBaseUrl , serviceCallback ) ;
public class Invocation { /** * this method can be called concurrently */ void notifyBackupComplete ( ) { } }
int newBackupAcksCompleted = BACKUP_ACKS_RECEIVED . incrementAndGet ( this ) ; Object pendingResponse = this . pendingResponse ; if ( pendingResponse == VOID ) { // no pendingResponse has been set , so we are done since the invocation on the primary needs to complete first return ; } // if a pendingResponse is set , th...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcSpecificHeatCapacityMeasure ( ) { } }
if ( ifcSpecificHeatCapacityMeasureEClass == null ) { ifcSpecificHeatCapacityMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 869 ) ; } return ifcSpecificHeatCapacityMeasureEClass ;
public class CPDefinitionInventoryPersistenceImpl { /** * Removes all the cp definition inventories where uuid = & # 63 ; from the database . * @ param uuid the uuid */ @ Override public void removeByUuid ( String uuid ) { } }
for ( CPDefinitionInventory cpDefinitionInventory : findByUuid ( uuid , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( cpDefinitionInventory ) ; }
public class IntervalTree { /** * Ceiling T . * @ param T the T * @ return the T */ public T ceiling ( T T ) { } }
if ( T == null ) { return null ; } NodeIterator < T > iterator = new NodeIterator < > ( root , T . end ( ) , Integer . MAX_VALUE , true ) ; if ( iterator . hasNext ( ) ) { return iterator . next ( ) ; } return null ;
public class ResourceRegistryImpl { /** * Searches the registry for a resource identified by a JSON API resource * type . If a resource cannot be found , < i > null < / i > is returned . * @ param searchType * resource type * @ return registry entry or < i > null < / i > */ public RegistryEntry getEntry ( Strin...
for ( Map . Entry < Class , RegistryEntry > entry : resources . entrySet ( ) ) { String type = getResourceType ( entry . getKey ( ) ) ; if ( type == null ) { return null ; } if ( type . equals ( searchType ) ) { return entry . getValue ( ) ; } } return null ;
public class GlobalUniqueIndex { /** * JSON representation of committed state * @ return */ private JsonNode toJson ( ) { } }
ObjectNode result = new ObjectNode ( Topology . OBJECT_MAPPER . getNodeFactory ( ) ) ; ArrayNode propertyArrayNode = new ArrayNode ( Topology . OBJECT_MAPPER . getNodeFactory ( ) ) ; for ( PropertyColumn property : this . properties ) { ObjectNode objectNode = property . toNotifyJson ( ) ; objectNode . put ( "schemaNam...
public class HtmlDocletWriter { /** * Get the deprecated phrase as content . * @ param e the Element for which the inline deprecated comment will be added * @ return a content tree for the deprecated phrase . */ public Content getDeprecatedPhrase ( Element e ) { } }
return ( utils . isDeprecatedForRemoval ( e ) ) ? contents . deprecatedForRemovalPhrase : contents . deprecatedPhrase ;
public class ThreadPoolNotifier { /** * Enqueues a notification to run . If the notification fails , it will be retried every two * minutes until 5 attempts are completed . Notifications to the same callback should be * delivered successfully in order . * @ param not */ @ Override protected void enqueueNotificati...
final Runnable r = new Runnable ( ) { @ Override public void run ( ) { not . lastRun = System . currentTimeMillis ( ) ; final SubscriptionSummary summary = postNotification ( not . subscriber , not . mimeType , not . payload ) ; if ( ! summary . isLastPublishSuccessful ( ) ) { not . retryCount ++ ; if ( not . retryCoun...
public class DefaultExceptionContext { /** * { @ inheritDoc } */ @ Override public DefaultExceptionContext setContextValue ( final String label , final Object value ) { } }
for ( final Iterator < Pair < String , Object > > iter = contextValues . iterator ( ) ; iter . hasNext ( ) ; ) { final Pair < String , Object > p = iter . next ( ) ; if ( StringUtils . equals ( label , p . getKey ( ) ) ) { iter . remove ( ) ; } } addContextValue ( label , value ) ; return this ;
public class AT_Row { /** * Sets the right padding character for all cells in the row . * @ param paddingRightChar new padding character , ignored if null * @ return this to allow chaining */ public AT_Row setPaddingRightChar ( Character paddingRightChar ) { } }
if ( this . hasCells ( ) ) { for ( AT_Cell cell : this . getCells ( ) ) { cell . getContext ( ) . setPaddingRightChar ( paddingRightChar ) ; } } return this ;
public class ReflectionUtils { /** * Rethrow the given { @ link Throwable exception } , which is presumably the * < em > target exception < / em > of an { @ link InvocationTargetException } . Should * only be called if no checked exception is expected to be thrown by the * target method . * < p > Rethrows the u...
if ( ex instanceof Exception ) { throw ( Exception ) ex ; } if ( ex instanceof Error ) { throw ( Error ) ex ; } throw new UndeclaredThrowableException ( ex ) ;
public class IntCounter { /** * Returns the total count for all objects in this Counter that pass the * given Filter . Passing in a filter that always returns true is equivalent * to calling { @ link # totalCount ( ) } . */ public int totalIntCount ( Filter < E > filter ) { } }
int total = 0 ; for ( E key : map . keySet ( ) ) { if ( filter . accept ( key ) ) { total += getIntCount ( key ) ; } } return ( total ) ;
public class EnumIO { /** * Retrieves the enum key type from the EnumMap via reflection . This is used by { @ link ObjectSchema } . */ static Class < ? > getKeyTypeFromEnumMap ( Object enumMap ) { } }
if ( __keyTypeFromEnumMap == null ) { throw new RuntimeException ( "Could not access (reflection) the private " + "field *keyType* (enumClass) from: class java.util.EnumMap" ) ; } try { return ( Class < ? > ) __keyTypeFromEnumMap . get ( enumMap ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
public class LoggingHandlerInterceptor { /** * Builds raw request message content from Http servlet request . * @ param request * @ return * @ throws IOException */ private String getRequestContent ( HttpServletRequest request ) throws IOException { } }
StringBuilder builder = new StringBuilder ( ) ; builder . append ( request . getProtocol ( ) ) ; builder . append ( " " ) ; builder . append ( request . getMethod ( ) ) ; builder . append ( " " ) ; builder . append ( request . getRequestURI ( ) ) ; builder . append ( NEWLINE ) ; Enumeration < ? > headerNames = request ...
public class DeviceProxyFactory { public static boolean exists ( String deviceName ) throws DevFailed { } }
// Get full device name ( with tango host ) to manage multi tango _ host String fullDeviceName = new TangoUrl ( deviceName ) . toString ( ) ; // Get it if already exists DeviceProxy dev = proxy_table . get ( fullDeviceName ) ; return ( dev != null ) ;
public class DateLabels { /** * Creates a label which displays date only ( year , month , day ) . * @ param id component id * @ param model model returning date to display * @ return date label */ public static DateLabel forDate ( String id , IModel < Date > model ) { } }
return DateLabel . forDatePattern ( id , model , DATE_PATTERN ) ;
public class BSUImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . BSU__LID : setLID ( ( Integer ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class Tree { /** * Much of the code below is taken from the HtmlBaseTag . We need to eliminate this duplication * through some type of helper methods . */ private String renderDefaultJavaScript ( HttpServletRequest request , String realId ) { } }
String idScript = null ; // map the tagId to the real id if ( TagConfig . isDefaultJavaScript ( ) ) { ScriptRequestState srs = ScriptRequestState . getScriptRequestState ( request ) ; idScript = srs . mapTagId ( getScriptReporter ( ) , _trs . tagId , realId , null ) ; } return idScript ;
public class Stream { /** * If specified array is null , returns an empty { @ code Stream } , * otherwise returns a { @ code Stream } containing elements of this array . * @ param < T > the type of the stream elements * @ param array the array whose elements to be passed to stream * @ return the new stream * ...
return ( array == null ) ? Stream . < T > empty ( ) : Stream . of ( array ) ;
public class ZKPaths { /** * Make sure all the nodes in the path are created . NOTE : Unlike File . mkdirs ( ) , Zookeeper doesn ' t distinguish * between directories and files . So , every node in the path is created . The data for each node is an empty blob * @ param zookeeper the client * @ param path path to ...
PathUtils . validatePath ( path ) ; int pos = 1 ; // skip first slash , root is guaranteed to exist do { pos = path . indexOf ( PATH_SEPARATOR , pos + 1 ) ; if ( pos == - 1 ) { if ( makeLastNode ) { pos = path . length ( ) ; } else { break ; } } String subPath = path . substring ( 0 , pos ) ; if ( zookeeper . exists ( ...
public class CampaignCriterionServiceLocator { /** * For the given interface , get the stub implementation . * If this service has no port for the given interface , * then ServiceException is thrown . */ public java . rmi . Remote getPort ( Class serviceEndpointInterface ) throws javax . xml . rpc . ServiceExceptio...
try { if ( com . google . api . ads . adwords . axis . v201809 . cm . CampaignCriterionServiceInterface . class . isAssignableFrom ( serviceEndpointInterface ) ) { com . google . api . ads . adwords . axis . v201809 . cm . CampaignCriterionServiceSoapBindingStub _stub = new com . google . api . ads . adwords . axis . v...
public class Period { /** * Returns a new period with the specified number of minutes . * This period instance is immutable and unaffected by this method call . * @ param minutes the amount of minutes to add , may be negative * @ return the new period with the increased minutes * @ throws UnsupportedOperationEx...
int [ ] values = getValues ( ) ; // cloned getPeriodType ( ) . setIndexedField ( this , PeriodType . MINUTE_INDEX , values , minutes ) ; return new Period ( values , getPeriodType ( ) ) ;
public class DefaultSegmentedDataContainer { /** * Priority has to be higher than the clear priority - which is currently 999 */ @ Stop ( priority = 9999 ) public void stop ( ) { } }
for ( int i = 0 ; i < maps . length ( ) ; ++ i ) { stopMap ( i , false ) ; }
public class JsonUtil { /** * Writes a resources JSON view to a writer using the default application rules for filtering . * @ param writer the writer for the JSON transformation * @ param resource the resource to transform * @ throws RepositoryException * @ throws IOException */ public static void exportJson (...
exportJson ( writer , resource , MappingRules . getDefaultMappingRules ( ) ) ;
public class CmsUgcSession { /** * Checks that the session is not finished , and throws an exception otherwise . < p > * @ throws CmsUgcException if the session is finished */ private void checkNotFinished ( ) throws CmsUgcException { } }
if ( m_finished ) { String message = Messages . get ( ) . container ( Messages . ERR_FORM_SESSION_ALREADY_FINISHED_0 ) . key ( getCmsObject ( ) . getRequestContext ( ) . getLocale ( ) ) ; throw new CmsUgcException ( CmsUgcConstants . ErrorCode . errInvalidAction , message ) ; }
public class FileOperations { /** * Downloads the specified file from the specified task ' s directory on its compute node . * @ param jobId The ID of the job containing the task . * @ param taskId The ID of the task . * @ param fileName The name of the file to download . * @ param outputStream A stream into wh...
getFileFromTask ( jobId , taskId , fileName , null , outputStream ) ;
public class AnnotationUtils { /** * Get all { @ link Annotation Annotations } from the supplied { @ link Method } . * < p > Correctly handles bridge { @ link Method Methods } generated by the compiler . * @ param method the Method to retrieve annotations from * @ return the annotations found */ public static Ann...
try { return BridgeMethodResolver . findBridgedMethod ( method ) . getAnnotations ( ) ; } catch ( Exception ex ) { // Assuming nested Class values not resolvable within annotation attributes . . . logIntrospectionFailure ( method , ex ) ; return null ; }
public class Parser { /** * Copies all content from { @ code from } to { @ code to } . */ @ Private static StringBuilder read ( Readable from ) throws IOException { } }
StringBuilder builder = new StringBuilder ( ) ; CharBuffer buf = CharBuffer . allocate ( 2048 ) ; for ( ; ; ) { int r = from . read ( buf ) ; if ( r == - 1 ) break ; buf . flip ( ) ; builder . append ( buf , 0 , r ) ; } return builder ;
public class WrappedObjectMapperProcessor { /** * Find the first compatible setter ( conversion from String is supported ) and invoke it . * @ param target * the object to change and setter name . * @ param value * the value . * @ throws IllegalAccessException * when there is a problem . * @ throws Invoca...
Object _objectToChange = target . getObjectToChange ( ) ; Method [ ] _declaredMethods = _objectToChange . getClass ( ) . getDeclaredMethods ( ) ; String _setterName = target . getSetterName ( ) ; for ( Method _candidate : _declaredMethods ) { if ( _candidate . getName ( ) . equals ( _setterName ) ) { Class < ? > [ ] _p...
public class ScriptBlock { /** * Place the JavaScript inside in relationship to the frameword generated JavaScript . * @ param placement The placement of the JavaScript * @ jsptagref . attributedescription String value ' after ' or ' before ' . Places the JavaScript * before or after the JavaScript provided by th...
if ( placement . equals ( "after" ) ) _placement = ScriptPlacement . PLACE_AFTER ; else if ( placement . equals ( "before" ) ) _placement = ScriptPlacement . PLACE_BEFORE ; else _placement = ScriptPlacement . PLACE_INLINE ;
public class GearWearableUtility { /** * Check if a position is within a circle * @ param x x position * @ param y y position * @ param centerX center x of circle * @ param centerY center y of circle * @ return true if within circle , false otherwise */ static boolean isInCircle ( float x , float y , float ce...
return Math . abs ( x - centerX ) < radius && Math . abs ( y - centerY ) < radius ;
public class TextBoxView { /** * Gets the text . * @ param position * the position , where to begin * @ param len * the length of text portion * @ return the text */ protected String getTextEx ( int position , int len ) { } }
try { return getDocument ( ) . getText ( position , len ) ; } catch ( BadLocationException e ) { e . printStackTrace ( ) ; return "" ; }
public class UtilFeature { /** * Creates a FastQueue and declares new instances of the descriptor using the provided * { @ link DetectDescribePoint } . The queue will have declareInstance set to true , otherwise * why would you be using this function ? */ public static < TD extends TupleDesc > FastQueue < TD > crea...
return new FastQueue < TD > ( initialMax , detDesc . getDescriptionType ( ) , true ) { @ Override protected TD createInstance ( ) { return detDesc . createDescription ( ) ; } } ;
public class BinaryProtocol { /** * Close the connection and shutdown the handler thread . * @ throws IOException * @ throws InterruptedException */ public void close ( ) throws IOException , InterruptedException { } }
LOG . debug ( "closing connection" ) ; stream . close ( ) ; uplink . closeConnection ( ) ; uplink . interrupt ( ) ; uplink . join ( ) ;
public class UserPreferences { /** * Sets the key prefix . * @ param keyPrefix the new key prefix */ public static void setKeyPrefix ( final String keyPrefix ) { } }
UserPreferences . keyPrefix = keyPrefix ; try { systemRoot . sync ( ) ; } catch ( final Exception e ) { JKExceptionUtil . handle ( e ) ; }
public class InternalPureXbaseParser { /** * InternalPureXbase . g : 1847:1 : entryRuleOpAdd returns [ String current = null ] : iv _ ruleOpAdd = ruleOpAdd EOF ; */ public final String entryRuleOpAdd ( ) throws RecognitionException { } }
String current = null ; AntlrDatatypeRuleToken iv_ruleOpAdd = null ; try { // InternalPureXbase . g : 1847:45 : ( iv _ ruleOpAdd = ruleOpAdd EOF ) // InternalPureXbase . g : 1848:2 : iv _ ruleOpAdd = ruleOpAdd EOF { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getOpAddRule ( ) ) ; } pushFollow ...
public class JCGLProjectionMatrices { /** * < p > Calculate a matrix that will produce a perspective projection based on * the given view frustum parameters , the aspect ratio of the viewport and a * given horizontal field of view in radians . Note that { @ code fov _ radians } * represents the full horizontal fi...
final double x_max = z_near * StrictMath . tan ( horizontal_fov / 2.0 ) ; final double x_min = - x_max ; final double y_max = x_max / aspect ; final double y_min = - y_max ; return frustumProjectionRHP ( x_min , x_max , y_min , y_max , z_near , z_far ) ;
public class FlowTriggerScheduler { /** * Retrieve the list of scheduled flow triggers from quartz database */ public List < ScheduledFlowTrigger > getScheduledFlowTriggerJobs ( ) { } }
try { final Scheduler quartzScheduler = this . scheduler . getScheduler ( ) ; final List < String > groupNames = quartzScheduler . getJobGroupNames ( ) ; final List < ScheduledFlowTrigger > flowTriggerJobDetails = new ArrayList < > ( ) ; for ( final String groupName : groupNames ) { final JobKey jobKey = new JobKey ( F...
public class ProcfsBasedProcessTree { /** * Get the list of all processes in the system . */ private List < Integer > getProcessList ( ) { } }
String [ ] processDirs = ( new File ( procfsDir ) ) . list ( ) ; List < Integer > processList = new ArrayList < Integer > ( ) ; for ( String dir : processDirs ) { try { int pd = Integer . parseInt ( dir ) ; if ( ( new File ( procfsDir , dir ) ) . isDirectory ( ) ) { processList . add ( Integer . valueOf ( pd ) ) ; } } ...
public class Gauge { /** * Defines the behavior of the visualization where the needle / bar should * always return to 0 after it reached the final value . This setting only makes * sense if animated = = true and the data rate is not too high . * Set to false when using real measured live data . * @ param IS _ T...
if ( null == returnToZero ) { _returnToZero = Double . compare ( getMinValue ( ) , 0.0 ) <= 0 ? IS_TRUE : false ; fireUpdateEvent ( REDRAW_EVENT ) ; } else { returnToZero . set ( IS_TRUE ) ; }
public class StreamMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Stream stream , ProtocolMarshaller protocolMarshaller ) { } }
if ( stream == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( stream . getStreamId ( ) , STREAMID_BINDING ) ; protocolMarshaller . marshall ( stream . getFileId ( ) , FILEID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException...
public class GenericsResolutionUtils { /** * Analyze interface generics . If type is contained in known types - no generics resolution performed * ( trust provided info ) . * @ param types resolved generics of already analyzed types * @ param knownTypes type generics known before analysis ( some middle class gene...
final Class interfaceType = iface instanceof ParameterizedType ? ( Class ) ( ( ParameterizedType ) iface ) . getRawType ( ) : ( Class ) iface ; if ( ! ignoreClasses . contains ( interfaceType ) ) { if ( knownTypes . containsKey ( interfaceType ) ) { // check possibly already resolved generics ( if provided externally )...
public class AbstractTransitionBuilder { /** * Transits a float property from the start value to the end value . * @ param propertyId * @ param vals * @ return self */ public T transitInt ( int propertyId , int ... vals ) { } }
String property = getPropertyName ( propertyId ) ; mHolders . put ( propertyId , PropertyValuesHolder . ofInt ( property , vals ) ) ; mShadowHolders . put ( propertyId , ShadowValuesHolder . ofInt ( property , vals ) ) ; return self ( ) ;
public class HourRange { /** * Converts a given string into an instance of this class . * @ param str * String to convert . * @ return New instance . */ @ Nullable public static HourRange valueOf ( @ Nullable final String str ) { } }
if ( str == null ) { return null ; } return new HourRange ( str ) ;
public class WhileyFileParser { /** * A headless statement is one which has no identifying keyword . The set of * headless statements include assignments , invocations , variable * declarations and named blocks . * @ param scope * The enclosing scope for this statement , which determines the * set of visible ...
int start = index ; // See if it is a named block Identifier blockName = parseOptionalIdentifier ( scope ) ; if ( blockName != null ) { if ( tryAndMatch ( true , Colon ) != null && isAtEOL ( ) ) { int end = index ; matchEndLine ( ) ; scope = scope . newEnclosingScope ( ) ; scope . declareLifetime ( blockName ) ; Stmt ....
public class ChangeTagsForResourceRequest { /** * A complex type that contains a list of the tags that you want to add to the specified health check or hosted zone * and / or the tags that you want to edit < code > Value < / code > for . * You can add a maximum of 10 tags to a health check or a hosted zone . * @ ...
if ( addTags == null ) { this . addTags = null ; return ; } this . addTags = new com . amazonaws . internal . SdkInternalList < Tag > ( addTags ) ;
public class Stamps { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false * otherwise */ public boolean isSet ( _Fields field ) { } }
if ( field == null ) { throw new java . lang . IllegalArgumentException ( ) ; } switch ( field ) { case TX_STAMPS_START : return isSetTxStampsStart ( ) ; case GC_STAMP : return isSetGcStamp ( ) ; } throw new java . lang . IllegalStateException ( ) ;
public class CmsSessionManager { /** * Returns the broadcast queue for the given OpenCms session id . < p > * @ param sessionId the OpenCms session id to get the broadcast queue for * @ return the broadcast queue for the given OpenCms session id */ public Buffer getBroadcastQueue ( String sessionId ) { } }
CmsSessionInfo sessionInfo = getSessionInfo ( getSessionUUID ( sessionId ) ) ; if ( sessionInfo == null ) { // return empty message buffer if the session is gone or not available return BufferUtils . synchronizedBuffer ( new CircularFifoBuffer ( CmsSessionInfo . QUEUE_SIZE ) ) ; } return sessionInfo . getBroadcastQueue...
public class XmlBean { /** * Internal method for handling the configuration of an object . This method * is recursively called for simple and complex properties . */ private void doConfigure ( XmlParser . Node rootNode , Object obj , HashMap < String , String > properties , boolean checkForDuplicates , CollectionHelp...
// loop thru all child nodes if ( rootNode . hasChildren ( ) ) { for ( XmlParser . Node node : rootNode . getChildren ( ) ) { // tag name represents a property we ' re going to set String propertyName = node . getTag ( ) ; // find the property if it exists BeanProperty property = null ; if ( ch != null ) { // make sure...
public class RowService { /** * Returns a { @ link ColumnFamily } composed by the non expired { @ link Cell } s of the specified { @ link ColumnFamily } . * @ param columnFamily A { @ link ColumnFamily } . * @ param timestamp The max allowed timestamp for the { @ link Cell } s . * @ return A { @ link ColumnFamily...
ColumnFamily cleanColumnFamily = ArrayBackedSortedColumns . factory . create ( baseCfs . metadata ) ; for ( Cell cell : columnFamily ) { if ( cell . isLive ( timestamp ) ) { cleanColumnFamily . addColumn ( cell ) ; } } return cleanColumnFamily ;
public class StaticConnectionProvider { /** * from ConnectionProvider */ public void txConnectionFailed ( String ident , Connection conn , SQLException error ) { } }
close ( conn , ident ) ;
public class History { /** * Redos a change in the history . * @ return true if successful , false if there are no changes to redo */ public boolean redo ( ) { } }
LOGGER . trace ( "redo, before, size: " + changes . size ( ) + " pos: " + position . get ( ) + " validPos: " + validPosition . get ( ) ) ; Change nextChange = next ( ) ; if ( nextChange != null ) { doWithoutListeners ( nextChange . getSetting ( ) , nextChange :: redo ) ; LOGGER . trace ( "redo, after, size: " + changes...
public class JsGeometryIndexService { /** * Create a new geometry index instance . * @ param instance * The index service instance to help you create the index . * @ param type * The type for the deepest index value . * @ param values * A list of values for the children to create . * @ return The new inde...
if ( "geometry" . equalsIgnoreCase ( type ) ) { return instance . create ( GeometryIndexType . TYPE_GEOMETRY , values ) ; } else if ( "vertex" . equalsIgnoreCase ( type ) ) { return instance . create ( GeometryIndexType . TYPE_VERTEX , values ) ; } else if ( "edge" . equalsIgnoreCase ( type ) ) { return instance . crea...
public class AssemblyAnalyzer { /** * Performs the analysis on a single Dependency . * @ param dependency the dependency to analyze * @ param engine the engine to perform the analysis under * @ throws AnalysisException if anything goes sideways */ @ Override public void analyzeDependency ( Dependency dependency ,...
final File test = new File ( dependency . getActualFilePath ( ) ) ; if ( ! test . isFile ( ) ) { throw new AnalysisException ( String . format ( "%s does not exist and cannot be analyzed by dependency-check" , dependency . getActualFilePath ( ) ) ) ; } if ( grokAssembly == null ) { LOGGER . warn ( "GrokAssembly didn't ...
public class Schema { /** * Creates a { @ link Type # MAP MAP } { @ link Schema } of the given key and value types . * @ param keySchema Schema of the map key . * @ param valueSchema Schema of the map value * @ return A { @ link Schema } of { @ link Type # MAP MAP } type . */ public static Schema mapOf ( Schema k...
return new Schema ( Type . MAP , null , null , keySchema , valueSchema , null , null , null ) ;
public class Reflecter { /** * Populate the JavaBeans properties of this delegate object , based on the specified name / value pairs * @ param properties * @ return */ public < V > Reflecter < T > populate ( Map < String , V > properties , List < String > excludes ) { } }
if ( Decisions . isEmpty ( ) . apply ( properties ) ) { return this ; } if ( this . delegate . get ( ) . getClass ( ) . isArray ( ) ) { Object els = null ; if ( null != ( els = properties . get ( JSONer . ReadJSON . itemsF ) ) ) { this . delegate = Optional . fromNullable ( Resolves . < T > get ( this . delegate . get ...
public class PlainTextConverter { /** * Called when a { @ link WtTableRow table row } is about to be processed . * @ param n A node representing a table row . */ public void visit ( WtTableRow n ) { } }
if ( currentRow == null ) { currentRow = new ArrayList < String > ( ) ; iterate ( n ) ; if ( currentRow . size ( ) > 0 ) { rows . add ( currentRow ) ; } if ( currentRow . size ( ) == n . getBody ( ) . size ( ) ) { StringBuilder tableRowFormatted = new StringBuilder ( ) ; for ( int i = 0 ; i < currentRow . size ( ) ; i ...
public class NotificationBoard { /** * Get { @ link NotificationEntry } by its id . * @ param notification * @ return NotificationEntry */ public NotificationEntry getNotification ( int notification ) { } }
RowView rowView = getRowView ( notification ) ; return rowView != null ? rowView . getNotification ( ) : null ;
public class AbstractIoSession { /** * { @ inheritDoc } */ @ Override public final Object getCurrentWriteMessage ( ) { } }
WriteRequest req = getCurrentWriteRequest ( ) ; if ( req == null ) { return null ; } return req . getMessage ( ) ;