signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class AggregationDeserializer { /** * Checks the next { @ link JsonToken } to decide the next appropriate parsing method . * @ param in { @ link JsonReader } object used for parsing * @ param objMap Map used to build the structure for the resulting { @ link QueryAggregation } object * @ throws IOException ...
JsonToken token = in . peek ( ) ; String lastName = "" ; if ( token == JsonToken . NAME ) { lastName = in . nextName ( ) ; token = in . peek ( ) ; } switch ( token ) { case BEGIN_ARRAY : parseArray ( in , objMap , lastName ) ; break ; case BEGIN_OBJECT : parseObject ( in , objMap , lastName ) ; break ; case STRING : ob...
public class TRow { /** * 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 IllegalArgumentException ( ) ; } switch ( field ) { case COL_VALS : return isSetColVals ( ) ; } throw new IllegalStateException ( ) ;
public class ModifyDocumentPermissionRequest { /** * The AWS user accounts that should no longer have access to the document . The AWS user account can either be a * group of account IDs or < i > All < / i > . This action has a higher priority than < i > AccountIdsToAdd < / i > . If you specify * an account ID to a...
if ( accountIdsToRemove == null ) { this . accountIdsToRemove = null ; return ; } this . accountIdsToRemove = new com . amazonaws . internal . SdkInternalList < String > ( accountIdsToRemove ) ;
public class XmlPrintStream { /** * Output a complete element with the given content . * @ param elementName Name of element . * @ param value Content of element . */ public void printElement ( String elementName , Object value ) { } }
println ( "<" + elementName + ">" + ( value == null ? "" : escape ( value . toString ( ) ) ) + "</" + elementName + ">" ) ;
public class ExtensionFilter { /** * Function to filter files based on defined rules . */ @ Override public boolean accept ( File file ) { } }
// All directories are added in the least that can be read by the Application if ( file . isDirectory ( ) && file . canRead ( ) ) { return true ; } else if ( properties . selection_type == DialogConfigs . DIR_SELECT ) { /* True for files , If the selection type is Directory type , ie . * Only directory has to be sele...
public class AnnotationTypeOptionalMemberBuilder { /** * Build the default value for this optional member . * @ param node the XML element that specifies which components to document * @ param annotationDocTree the content tree to which the documentation will be added */ public void buildDefaultValueInfo ( XMLNode ...
( ( AnnotationTypeOptionalMemberWriter ) writer ) . addDefaultValueInfo ( ( MemberDoc ) members . get ( currentMemberIndex ) , annotationDocTree ) ;
public class TimelineModel { /** * Deletes all given events in the model with UI update . * @ param events collection of events to be deleted * @ param timelineUpdater TimelineUpdater instance to delete the events in UI */ public void deleteAll ( Collection < TimelineEvent > events , TimelineUpdater timelineUpdater...
if ( events != null && ! events . isEmpty ( ) ) { for ( TimelineEvent event : events ) { delete ( event , timelineUpdater ) ; } }
public class RestController { /** * Does a rsql / fiql query , returns the result as csv * < p > Parameters : * < p > q : the query * < p > attributes : the attributes to return , if not specified returns all attributes * < p > start : the index of the first row , default 0 * < p > num : the number of results...
final Set < String > attributesSet = toAttributeSet ( attributes ) ; EntityType meta ; Iterable < Entity > entities ; try { meta = dataService . getEntityType ( entityTypeId ) ; Query < Entity > q = new QueryStringParser ( meta , molgenisRSQL ) . parseQueryString ( req . getParameterMap ( ) ) ; String [ ] sortAttribute...
public class CasePreservingProteinSequenceCreator { /** * Takes a { @ link ProteinSequence } which was created by a * { @ link CasePreservingProteinSequenceCreator } . Uses the case info * stored in the user collection to modify the output array . * < p > Sets elements of the output array which correspond to lowe...
// should have been set by seq creator Collection < Object > userCollection = seq . getUserCollection ( ) ; if ( userCollection == null ) throw new IllegalArgumentException ( "Sequence doesn't contain valid case info" ) ; if ( userCollection . size ( ) != out . length ) throw new IllegalArgumentException ( "Sequence le...
public class AtomFeedXmlReader { /** * Parses the atom data without creating the event itself from data & amp ; * meta data . * @ param in * Input stream to read . * @ return Entry . */ public final AtomEntry < Node > readAtomEntry ( final InputStream in ) { } }
final Document doc = parseDocument ( createDocumentBuilder ( ) , in ) ; final XPath xPath = createXPath ( "atom" , "http://www.w3.org/2005/Atom" ) ; final String eventStreamId = findContentText ( doc , xPath , "/atom:entry/atom:content/eventStreamId" ) ; final Integer eventNumber = findContentInteger ( doc , xPath , "/...
public class Sneaky { /** * returns a value from a lambda ( Supplier ) that can potentially throw an exception . * @ param supplier Supplier that can throw an exception * @ param < T > type of supplier ' s return value * @ return a Supplier as defined in java . util . function */ public static < T , E extends Exc...
return sneaked ( supplier ) . get ( ) ;
public class ByteArray { /** * Converts the given String to a byte array . * @ param unicodeString The String to be converted to a byte array . * @ return A byte array representing the String . */ public static byte [ ] fromString ( String unicodeString ) { } }
byte [ ] result = null ; if ( unicodeString != null ) { result = unicodeString . getBytes ( StandardCharsets . UTF_8 ) ; } return result ;
public class CPDAvailabilityEstimateLocalServiceBaseImpl { /** * Updates the cpd availability estimate in the database or adds it if it does not yet exist . Also notifies the appropriate model listeners . * @ param cpdAvailabilityEstimate the cpd availability estimate * @ return the cpd availability estimate that w...
return cpdAvailabilityEstimatePersistence . update ( cpdAvailabilityEstimate ) ;
public class HtmlInputTextarea { /** * < p > Return the value of the < code > rows < / code > property . < / p > * < p > Contents : The number of rows to be displayed . */ public int getRows ( ) { } }
return ( java . lang . Integer ) getStateHelper ( ) . eval ( PropertyKeys . rows , Integer . MIN_VALUE ) ;
public class WebAPI { /** * Imports a model from a JSON file . */ public static void importModel ( ) throws Exception { } }
// Upload file to H2O HttpClient client = new HttpClient ( ) ; PostMethod post = new PostMethod ( URL + "/Upload.json?key=" + JSON_FILE . getName ( ) ) ; Part [ ] parts = { new FilePart ( JSON_FILE . getName ( ) , JSON_FILE ) } ; post . setRequestEntity ( new MultipartRequestEntity ( parts , post . getParams ( ) ) ) ; ...
public class SoftwareModuleAddUpdateWindow { /** * fill the data of a softwareModule in the content of the window */ private void populateValuesOfSwModule ( ) { } }
if ( baseSwModuleId == null ) { return ; } editSwModule = Boolean . TRUE ; softwareModuleManagement . get ( baseSwModuleId ) . ifPresent ( swModule -> { nameTextField . setValue ( swModule . getName ( ) ) ; versionTextField . setValue ( swModule . getVersion ( ) ) ; vendorTextField . setValue ( swModule . getVendor ( )...
public class InvalidityDateExtension { /** * Set the attribute value . */ public void set ( String name , Object obj ) throws IOException { } }
if ( ! ( obj instanceof Date ) ) { throw new IOException ( "Attribute must be of type Date." ) ; } if ( name . equalsIgnoreCase ( DATE ) ) { date = ( Date ) obj ; } else { throw new IOException ( "Name not supported by InvalidityDateExtension" ) ; } encodeThis ( ) ;
public class SSLComponent { /** * DS method to deactivate this component . * @ param context */ @ Deactivate protected synchronized void deactivate ( int reason ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Deactivated: " + reason ) ; } super . deactivate ( MY_ALIAS , reason ) ; repertoireMap . clear ( ) ; repertoirePIDMap . clear ( ) ; keystoreIdMap . clear ( ) ; keystorePidMap . clear ( ) ; SSLConfigManager . getInstance ( ) ...
public class JcrQueryParser { /** * { @ inheritDoc } */ protected Query getPrefixQuery ( String field , String termStr ) throws ParseException { } }
return getWildcardQuery ( field , termStr + "*" ) ;
public class ManagedAuditLoggerImpl { /** * Immediate updates - TODO find some better way to do these if we end up adding more handler types ! */ @ Override public void updateHandlerMaxFailureCount ( String name , int count ) { } }
config . lock ( ) ; try { AuditLogHandler handler = config . getConfiguredHandler ( name ) ; handler . setMaxFailureCount ( count ) ; } finally { config . unlock ( ) ; }
public class SynchronizedCache { /** * 根据预设的缓存清理策略进行缓存清理 */ private synchronized void clean ( ) { } }
while ( checkOverFlow ( ) ) { List < CacheObject > cacheObjectList = sort ( ) ; if ( cacheObjectList != null && cacheObjectList . size ( ) > 0 ) { CacheObject cacheObject = ( CacheObject ) cacheObjectList . get ( 0 ) ; remove ( cacheObject . getKey ( ) ) ; } }
public class ReflectUtil { /** * 获取指定对象的所有属性 , 包含父类属性 * < p > Function : getFieldArrayExcludeUID < / p > * < p > Description : 不抓取serialVersionUID属性 < / p > * @ param clazz * @ return * @ author acexy @ thankjava . com * @ date 2014-12-16 上午11:27:44 * @ version 1.0 */ public static Field [ ] getFieldArray...
Field [ ] currField = clazz . getDeclaredFields ( ) ; clazz = clazz . getSuperclass ( ) ; Field [ ] supField = clazz . getDeclaredFields ( ) ; Field [ ] temp = new Field [ currField . length + supField . length ] ; int length = 0 ; for ( Field curr : currField ) { if ( "serialVersionUID" . equals ( curr . getName ( ) )...
public class ServletMapPrinterFactory { /** * The setter for setting configuration file . It will convert the value to a URI . * @ param configurationFiles the configuration file map . */ public final void setConfigurationFiles ( final Map < String , String > configurationFiles ) throws URISyntaxException { } }
this . configurationFiles . clear ( ) ; this . configurationFileLastModifiedTimes . clear ( ) ; for ( Map . Entry < String , String > entry : configurationFiles . entrySet ( ) ) { if ( ! entry . getValue ( ) . contains ( ":/" ) ) { // assume is a file this . configurationFiles . put ( entry . getKey ( ) , new File ( en...
public class StartConfigurationRecorderRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( StartConfigurationRecorderRequest startConfigurationRecorderRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( startConfigurationRecorderRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( startConfigurationRecorderRequest . getConfigurationRecorderName ( ) , CONFIGURATIONRECORDERNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkCli...
public class DirectoryConnection { /** * Set the DirectoryConnection ConenctionStatus . * @ param status * the ConenctionStatus . */ private void setStatus ( ConnectionStatus status ) { } }
if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Set status to - " + status ) ; } if ( ! this . status . equals ( status ) ) { ConnectionStatus pre = this . status ; this . status = status ; eventThread . queueClientEvent ( new ClientStatusEvent ( pre , status ) ) ; }
public class JSMessageData { /** * Locking : Needs to lock as it relies on the cache & contents remaining in their current state . */ @ Override public int getModelID ( int accessor ) throws JMFUninitializedAccessException , JMFSchemaViolationException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) JmfTr . entry ( this , tc , "getModelID" , new Object [ ] { Integer . valueOf ( accessor ) } ) ; int ans ; checkIndex ( accessor ) ; synchronized ( getMessageLockArtefact ( ) ) { checkDynamic ( accessor ) ; if ( cache [ accessor ] != null ) { an...
public class ModuleBuildReader { /** * Adds the specified future to the list of extra builds . * @ param future The future to add */ public void addExtraBuild ( ModuleBuildFuture future ) { } }
if ( extraBuilds == null ) { extraBuilds = new LinkedList < ModuleBuildFuture > ( ) ; } extraBuilds . add ( future ) ;
public class DatabaseDAODefaultImpl { public List < DbHistory > getClassPipePropertyHistory ( Database database , String className , String pipeName , String propertyName ) throws DevFailed { } }
String [ ] array = new String [ ] { className , pipeName , propertyName } ; DeviceData argIn = new DeviceData ( ) ; argIn . insert ( array ) ; DeviceData argOut = database . command_inout ( "DbGetClassPipePropertyHist" , argIn ) ; return convertPropertyHistory ( argOut . extractStringArray ( ) , true ) ;
public class MapFile { /** * Reads POI data for an area defined by the tile in the upper left and the tile in * the lower right corner . * This implementation takes the data storage of a MapFile into account for greater efficiency . * @ param upperLeft tile that defines the upper left corner of the requested area...
return readMapData ( upperLeft , lowerRight , Selector . POIS ) ;
public class TextProtoNetworkExternalizer { /** * Writes a text table - based proto network and produces a descriptor * including all of the table files . * @ param pn * { @ link ProtoNetwork } , the proto network , which cannot be null * @ param protoNetworkRootPath * { @ link String } , the root path where ...
if ( pn == null ) throw new InvalidArgument ( "protoNetwork is null" ) ; CSVWriter allWriter ; String path = asPath ( protoNetworkRootPath , "all.tbl" ) ; try { allWriter = new CSVWriter ( new FileWriter ( path ) , '\t' , CSVWriter . NO_QUOTE_CHARACTER ) ; } catch ( IOException e ) { final String msg = "Cannot open all...
public class MemberReader { /** * Make the request to the Twilio API to perform the read . * @ param client TwilioRestClient with which to make the request * @ return Member ResourceSet */ @ Override public ResourceSet < Member > read ( final TwilioRestClient client ) { } }
return new ResourceSet < > ( this , client , firstPage ( client ) ) ;
public class MessageUnpacker { /** * Read a byte value at the cursor and proceed the cursor . * @ return * @ throws IOException */ private byte readByte ( ) throws IOException { } }
if ( buffer . size ( ) > position ) { byte b = buffer . getByte ( position ) ; position ++ ; return b ; } else { nextBuffer ( ) ; if ( buffer . size ( ) > 0 ) { byte b = buffer . getByte ( 0 ) ; position = 1 ; return b ; } return readByte ( ) ; }
public class AWSCognitoIdentityProviderClient { /** * Lists the user import jobs . * @ param listUserImportJobsRequest * Represents the request to list the user import jobs . * @ return Result of the ListUserImportJobs operation returned by the service . * @ throws ResourceNotFoundException * This exception i...
request = beforeClientExecution ( request ) ; return executeListUserImportJobs ( request ) ;
public class ItemsInterval { /** * Create a new item based on the existing items and new service period * < ul > * < li > During the build phase , we only consider ADD items . This happens when for instance an existing item was partially repaired * and there is a need to create a new item which represents the par...
// Find the ADD ( build phase ) or CANCEL ( merge phase ) item of this interval final Item item = getResultingItem ( mergeMode ) ; if ( item == null || startDate == null || endDate == null || targetInvoiceId == null ) { return item ; } // Prorate ( build phase ) or repair ( merge phase ) this item , as needed final Inv...
public class CPDefinitionLinkPersistenceImpl { /** * Returns all the cp definition links where CProductId = & # 63 ; and type = & # 63 ; . * @ param CProductId the c product ID * @ param type the type * @ return the matching cp definition links */ @ Override public List < CPDefinitionLink > findByCP_T ( long CPro...
return findByCP_T ( CProductId , type , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class RelationalHSCache { /** * Loads all elements of this class from the data store . Use this method only when you know * exactly what you are doing . Otherwise , you will pull a lot of data . * @ return all objects from the database * @ throws PersistenceException an error occurred executing the query *...
logger . debug ( "enter - list()" ) ; try { return find ( null , null , false ) ; } finally { logger . debug ( "exit - list()" ) ; }
public class CommerceNotificationQueueEntryPersistenceImpl { /** * Creates a new commerce notification queue entry with the primary key . Does not add the commerce notification queue entry to the database . * @ param commerceNotificationQueueEntryId the primary key for the new commerce notification queue entry * @ ...
CommerceNotificationQueueEntry commerceNotificationQueueEntry = new CommerceNotificationQueueEntryImpl ( ) ; commerceNotificationQueueEntry . setNew ( true ) ; commerceNotificationQueueEntry . setPrimaryKey ( commerceNotificationQueueEntryId ) ; commerceNotificationQueueEntry . setCompanyId ( companyProvider . getCompa...
public class AbstractThrowEventBuilder { /** * Creates an empty message event definition with the given id * and returns a builder for the message event definition . * @ param id the id of the message event definition * @ return the message event definition builder object */ public MessageEventDefinitionBuilder m...
MessageEventDefinition messageEventDefinition = createEmptyMessageEventDefinition ( ) ; if ( id != null ) { messageEventDefinition . setId ( id ) ; } element . getEventDefinitions ( ) . add ( messageEventDefinition ) ; return new MessageEventDefinitionBuilder ( modelInstance , messageEventDefinition ) ;
public class CFG { /** * ( non - Javadoc ) * @ see * edu . umd . cs . findbugs . graph . AbstractGraph # removeEdge ( edu . umd . cs . findbugs * . graph . AbstractEdge ) */ @ Override public void removeEdge ( Edge edge ) { } }
super . removeEdge ( edge ) ; // Keep track of removed edges . if ( removedEdgeList == null ) { removedEdgeList = new LinkedList < > ( ) ; } removedEdgeList . add ( edge ) ;
public class DeviceTypesApi { /** * Get Available Manifest Versions * Get a Device Type & # 39 ; s available manifest versions * @ param deviceTypeId deviceTypeId ( required ) * @ return ApiResponse & lt ; ManifestVersionsEnvelope & gt ; * @ throws ApiException If fail to call the API , e . g . server error or ...
com . squareup . okhttp . Call call = getAvailableManifestVersionsValidateBeforeCall ( deviceTypeId , null , null ) ; Type localVarReturnType = new TypeToken < ManifestVersionsEnvelope > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class EndpointInfoBuilder { /** * Sets the available { @ link MediaType } s . */ public EndpointInfoBuilder availableMimeTypes ( MediaType ... availableMimeTypes ) { } }
requireNonNull ( availableMimeTypes , "availableMimeTypes" ) ; return availableMimeTypes ( ImmutableSet . copyOf ( availableMimeTypes ) ) ;
public class DigitalRadial { /** * < editor - fold defaultstate = " collapsed " desc = " Getters and Setters " > */ @ Override public void setValue ( double value ) { } }
super . setValue ( value ) ; // Set active leds relating to the new value calcNoOfActiveLed ( ) ; if ( isValueCoupled ( ) ) { setLcdValue ( value ) ; } repaint ( getInnerBounds ( ) ) ;
public class UCaseProps { /** * simple case mappings - - - - - * * * */ public final int tolower ( int c ) { } }
int props = trie . get ( c ) ; if ( ! propsHasException ( props ) ) { if ( getTypeFromProps ( props ) >= UPPER ) { c += getDelta ( props ) ; } } else { int excOffset = getExceptionsOffset ( props ) ; int excWord = exceptions . charAt ( excOffset ++ ) ; if ( hasSlot ( excWord , EXC_LOWER ) ) { c = getSlotValue ( excWord...
public class AggregatedSuiteResultEvent { /** * The number of tests that have { @ link TestStatus # ERROR } and * include the suite - level errors . */ public int getErrorCount ( ) { } }
int count = 0 ; for ( AggregatedTestResultEvent t : getTests ( ) ) { if ( t . getStatus ( ) == TestStatus . ERROR ) count ++ ; } for ( FailureMirror m : getFailures ( ) ) { if ( m . isErrorViolation ( ) ) count ++ ; } return count ;
public class WebServiceFactory { /** * get a service instance the service must have a interface and implements * it . */ public Object getService ( TargetMetaDef targetMetaDef , RequestWrapper request ) { } }
userTargetMetaDefFactory . createTargetMetaRequest ( targetMetaDef , request . getContextHolder ( ) ) ; return webServiceAccessor . getService ( request ) ;
public class CreateGroupResult { /** * The tags associated with the group . * @ param tags * The tags associated with the group . * @ return Returns a reference to this object so that method calls can be chained together . */ public CreateGroupResult withTags ( java . util . Map < String , String > tags ) { } }
setTags ( tags ) ; return this ;
public class Togglz { /** * The version of Togglz or < code > null < / code > if it cannot be identified */ public static String getVersion ( ) { } }
ClassLoader classLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; if ( classLoader == null ) { classLoader = Togglz . class . getClassLoader ( ) ; } URL url = classLoader . getResource ( "META-INF/maven/org.togglz/togglz-core/pom.properties" ) ; if ( url != null ) { InputStream stream = null ; try { st...
public class BayesInstance { /** * Passes a message from node1 to node2. * node1 projects its trgPotentials into the separator . * node2 then absorbs those trgPotentials from the separator . * @ param sourceClique * @ param sep * @ param targetClique */ public void passMessage ( JunctionTreeClique sourceCliqu...
double [ ] sepPots = separatorStates [ sep . getId ( ) ] . getPotentials ( ) ; double [ ] oldSepPots = Arrays . copyOf ( sepPots , sepPots . length ) ; BayesVariable [ ] sepVars = sep . getValues ( ) . toArray ( new BayesVariable [ sep . getValues ( ) . size ( ) ] ) ; if ( passMessageListener != null ) { passMessageLis...
public class HessianInput { /** * Reads a remote object . */ public Object readRemote ( ) throws IOException { } }
String type = readType ( ) ; String url = readString ( ) ; return resolveRemote ( type , url ) ;
public class CopyHelper { /** * Contains a collection of supported immutable types for copying . * Only keep the types that are worth supporting as record types . * @ param thing : an Object being checked * @ return true if supported immutable type , false otherwise */ private static boolean isImmutableType ( Obj...
return ( ( thing == null ) || ( thing instanceof String ) || ( thing instanceof Integer ) || ( thing instanceof Long ) ) ;
public class EthiopicDate { @ Override // for covariant return type @ SuppressWarnings ( "unchecked" ) public ChronoLocalDateTime < EthiopicDate > atTime ( LocalTime localTime ) { } }
return ( ChronoLocalDateTime < EthiopicDate > ) super . atTime ( localTime ) ;
public class ImporterStatsCollector { /** * Use this when the insert fails even before the request is queued by the InternalConnectionHandler */ public void reportFailure ( String importerName , String procName , boolean decrementPending ) { } }
StatsInfo statsInfo = getStatsInfo ( importerName , procName ) ; if ( decrementPending ) { statsInfo . m_pendingCount . decrementAndGet ( ) ; } statsInfo . m_failureCount . incrementAndGet ( ) ;
public class SanitizedContents { /** * Converts a { @ link SafeHtmlProto } into a Soy { @ link SanitizedContent } of kind HTML . */ public static SanitizedContent fromSafeHtmlProto ( SafeHtmlProto html ) { } }
return SanitizedContent . create ( SafeHtmls . fromProto ( html ) . getSafeHtmlString ( ) , ContentKind . HTML ) ;
public class LogIterator { /** * Moves to the previous log block in reverse order , and positions it after * the last record in that block . */ private void moveToPrevBlock ( ) { } }
blk = new BlockId ( blk . fileName ( ) , blk . number ( ) + 1 ) ; pg . read ( blk ) ; currentRec = 0 + pointerSize ;
public class A_CmsUploadDialog { /** * Calls the submit action if there are any files selected for upload . < p > */ private void commit ( ) { } }
m_selectionDone = true ; if ( ! m_filesToUpload . isEmpty ( ) ) { m_okButton . disable ( Messages . get ( ) . key ( Messages . GUI_UPLOAD_BUTTON_OK_DISABLE_UPLOADING_0 ) ) ; if ( m_uploadButton instanceof UIObject ) { ( ( UIObject ) m_uploadButton ) . getElement ( ) . getStyle ( ) . setDisplay ( Display . NONE ) ; } sh...
public class EditLogFileOutputStream { /** * Write a transaction to the stream . The serialization format is : * < ul > * < li > the opcode ( byte ) < / li > * < li > the transaction id ( long ) < / li > * < li > the actual Writables for the transaction < / li > * < / ul > */ @ Override public void writeRaw (...
doubleBuf . writeRaw ( bytes , offset , length ) ;
public class ServletWebServerApplicationContext { /** * Prepare the { @ link WebApplicationContext } with the given fully loaded * { @ link ServletContext } . This method is usually called from * { @ link ServletContextInitializer # onStartup ( ServletContext ) } and is similar to the * functionality usually prov...
Object rootContext = servletContext . getAttribute ( WebApplicationContext . ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE ) ; if ( rootContext != null ) { if ( rootContext == this ) { throw new IllegalStateException ( "Cannot initialize context because there is already a root application context present - " + "check whether ...
public class JvmTypesBuilder { /** * Attaches the given headText to the given { @ link JvmDeclaredType } . */ public void setFileHeader ( /* @ Nullable */ JvmDeclaredType jvmDeclaredType , /* @ Nullable */ String headerText ) { } }
if ( jvmDeclaredType == null || headerText == null ) { return ; } FileHeaderAdapter fileHeaderAdapter = ( FileHeaderAdapter ) EcoreUtil . getAdapter ( jvmDeclaredType . eAdapters ( ) , FileHeaderAdapter . class ) ; if ( fileHeaderAdapter == null ) { fileHeaderAdapter = new FileHeaderAdapter ( ) ; jvmDeclaredType . eAda...
public class JsonUtil { /** * Returns a field in a Json object as an object . * Throws IllegalArgumentException if the field value is null . * @ param object the Json object * @ param field the field in the Json object to return * @ return the Json field value as a Json object */ public static JsonObject getObj...
final JsonValue value = object . get ( field ) ; throwExceptionIfNull ( value , field ) ; return value . asObject ( ) ;
public class PacketWriter { /** * Signs the provided packet , so a CollectD server can verify that its authenticity . * Wire format : * < pre > * ! Type ( 0x0200 ) ! Length ! * ! Signature ( SHA2 ( username + packet ) ) \ * ! Username ! Packet \ * < / pre > * @ see < a href = " https : / / collectd . org ...
final byte [ ] signature = sign ( password , ( ByteBuffer ) ByteBuffer . allocate ( packet . remaining ( ) + username . length ) . put ( username ) . put ( packet ) . flip ( ) ) ; return ( ByteBuffer ) ByteBuffer . allocate ( BUFFER_SIZE ) . putShort ( ( short ) TYPE_SIGN_SHA256 ) . putShort ( ( short ) ( username . le...
public class HashCodeBuilder { /** * Uses reflection to build a valid hash code from the fields of { @ code object } . * This constructor uses two hard coded choices for the constants needed to build a hash code . * It uses < code > AccessibleObject . setAccessible < / code > to gain access to private fields . This...
return reflectionHashCode ( object , ReflectionToStringBuilder . toNoNullStringArray ( excludeFields ) ) ;
public class DescribeInstanceHealthResult { /** * Information about the health of the instances . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setInstanceStates ( java . util . Collection ) } or { @ link # withInstanceStates ( java . util . Collection ) } ...
if ( this . instanceStates == null ) { setInstanceStates ( new com . amazonaws . internal . SdkInternalList < InstanceState > ( instanceStates . length ) ) ; } for ( InstanceState ele : instanceStates ) { this . instanceStates . add ( ele ) ; } return this ;
public class Grid { /** * Adds the i and j atoms and fills the grid , passing their bounds ( array of size 6 with x , y , z minima and x , y , z maxima ) * This way the bounds don ' t need to be recomputed . * Subsequent call to { @ link # getIndicesContacts ( ) } or { @ link # getAtomContacts ( ) } will produce th...
this . iAtoms = Calc . atomsToPoints ( iAtoms ) ; this . iAtomObjects = iAtoms ; if ( icoordbounds != null ) { this . ibounds = icoordbounds ; } else { this . ibounds = new BoundingBox ( this . iAtoms ) ; } this . jAtoms = Calc . atomsToPoints ( jAtoms ) ; this . jAtomObjects = jAtoms ; if ( jAtoms == iAtoms ) { this ....
public class JCalReader { /** * Reads the next iCalendar object from the JSON data stream . * @ return the iCalendar object or null if there are no more * @ throws JCalParseException if the jCal syntax is incorrect ( the JSON * syntax may be valid , but it is not in the correct jCal format ) . * @ throws JsonPa...
if ( reader . eof ( ) ) { return null ; } context . setVersion ( ICalVersion . V2_0 ) ; JCalDataStreamListenerImpl listener = new JCalDataStreamListenerImpl ( ) ; reader . readNext ( listener ) ; return listener . getICalendar ( ) ;
public class StackHelper { /** * Create a new stack from the given collection . * @ param < ELEMENTTYPE > * The type of elements contained in the stack . * @ param aValues * The values that are to be pushed on the stack . The last element will * be the top element on the stack . May not be < code > null < / c...
return new NonBlockingStack < > ( aValues ) ;
public class EthereumUtil { /** * Decodes an RLPElement from the given ByteBuffer * @ param bb Bytebuffer containing an RLPElement * @ return RLPElement in case the byte stream represents a valid RLPElement , null if not */ private static RLPElement decodeRLPElement ( ByteBuffer bb ) { } }
RLPElement result = null ; byte firstByte = bb . get ( ) ; int firstByteUnsigned = firstByte & 0xFF ; if ( firstByteUnsigned <= 0x7F ) { result = new RLPElement ( new byte [ ] { firstByte } , new byte [ ] { firstByte } ) ; } else if ( ( firstByteUnsigned >= 0x80 ) && ( firstByteUnsigned <= 0xb7 ) ) { // read indicator ...
public class IntInterval { /** * Returns an IntInterval representing the odd values from the value from to the value to . */ public static IntInterval oddsFromTo ( int from , int to ) { } }
if ( from % 2 == 0 ) { if ( from < to ) { from ++ ; } else { from -- ; } } if ( to % 2 == 0 ) { if ( to > from ) { to -- ; } else { to ++ ; } } return IntInterval . fromToBy ( from , to , to > from ? 2 : - 2 ) ;
public class LIBORMarketModelFromCovarianceModel { /** * Creates a LIBOR Market Model for given covariance with a calibration ( if calibration items are given ) . * < br > * If calibrationItems in non - empty and the covariance model is a parametric model , * the covariance will be replaced by a calibrate version...
LIBORMarketModelFromCovarianceModel model = new LIBORMarketModelFromCovarianceModel ( liborPeriodDiscretization , analyticModel , forwardRateCurve , discountCurve , randomVariableFactory , covarianceModel , properties ) ; // Perform calibration , if data is given if ( calibrationProducts != null && calibrationProducts ...
public class TimeGuard { /** * Check all registered time watchers for time bound violations . * @ see # addGuard ( java . lang . String , long ) * @ see # addGuard ( java . lang . String , long , com . igormaznitsa . meta . common . utils . TimeGuard . TimeAlertListener ) * @ since 1.0 */ @ Weight ( value = Weigh...
final long time = System . currentTimeMillis ( ) ; final int stackDepth = ThreadUtils . stackDepth ( ) ; final List < TimeData > list = REGISTRY . get ( ) ; final Iterator < TimeData > iterator = list . iterator ( ) ; while ( iterator . hasNext ( ) ) { final TimeData timeWatchItem = iterator . next ( ) ; if ( timeWatch...
public class CommerceNotificationTemplateUserSegmentRelPersistenceImpl { /** * Returns a range of all the commerce notification template user segment rels where commerceNotificationTemplateId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > star...
return findByCommerceNotificationTemplateId ( commerceNotificationTemplateId , start , end , null ) ;
public class Emitter { /** * Adds a LinkRef to this set of LinkRefs . * @ param sKey * The key / id . * @ param aLinkRef * The LinkRef . */ public void addLinkRef ( @ Nonnull final String sKey , final LinkRef aLinkRef ) { } }
m_aLinkRefs . put ( sKey . toLowerCase ( Locale . US ) , aLinkRef ) ;
public class CcgGrammarUtils { /** * Constructs a distribution over binary combination rules for CCG , * given a set of syntactic categories . This method compiles out all * of the possible ways to combine two adjacent CCG categories using * function application , composition , and any other binary rules . * @ ...
List < HeadedSyntacticCategory > allCategories = syntaxType . getValuesWithCast ( HeadedSyntacticCategory . class ) ; Set < List < Object > > validOutcomes = Sets . newHashSet ( ) ; Set < Combinator > combinators = Sets . newHashSet ( ) ; // Compute function application rules . for ( HeadedSyntacticCategory functionCat...
public class DataTransformProcess { /** * Consolidates transformation objects when possible . Currently only works with { @ link RemoveAttributeTransform } */ private void consolidateTransforms ( ) { } }
for ( int i = 0 ; i < learnedTransforms . size ( ) - 1 ; i ++ ) { DataTransform t1 = learnedTransforms . get ( i ) ; DataTransform t2 = learnedTransforms . get ( i + 1 ) ; if ( ! ( t1 instanceof RemoveAttributeTransform && t2 instanceof RemoveAttributeTransform ) ) continue ; // They are not both RATs RemoveAttributeTr...
public class RunningJobImpl { /** * Inform the client of a failed job . * @ param jobStatusProto status of the failed job */ private synchronized void onJobFailure ( final JobStatusProto jobStatusProto ) { } }
assert jobStatusProto . getState ( ) == ReefServiceProtos . State . FAILED ; final String id = this . jobId ; final Optional < byte [ ] > data = jobStatusProto . hasException ( ) ? Optional . of ( jobStatusProto . getException ( ) . toByteArray ( ) ) : Optional . < byte [ ] > empty ( ) ; final Optional < Throwable > ca...
public class Messenger { /** * Save Group ' s permissions * @ param gid group ' s id * @ param adminSettings settings * @ return promise of void */ @ NotNull @ ObjectiveCName ( "saveGroupPermissionsWithGid:withSettings:" ) public Promise < Void > saveGroupPermissions ( int gid , GroupPermissions adminSettings ) {...
return modules . getGroupsModule ( ) . saveAdminSettings ( gid , adminSettings ) ;
public class DefaultDirectSuperclasses { /** * this compensates for the lack of map */ public static List < Class < ? > > makeArrayClasses ( List < Class < ? > > classes , int dims ) { } }
Iterator < Class < ? > > i = classes . iterator ( ) ; LinkedList < Class < ? > > arrayClasses = new LinkedList < Class < ? > > ( ) ; while ( i . hasNext ( ) ) arrayClasses . add ( makeArrayClass ( i . next ( ) , dims ) ) ; return arrayClasses ;
public class Bytes { /** * Store a < b > short < / b > number into a byte array in a given byte order */ public static void setShort ( int n , byte [ ] b , int off , boolean littleEndian ) { } }
if ( littleEndian ) { b [ off ] = ( byte ) n ; b [ off + 1 ] = ( byte ) ( n >>> 8 ) ; } else { b [ off ] = ( byte ) ( n >>> 8 ) ; b [ off + 1 ] = ( byte ) n ; }
public class InternalXbaseParser { /** * InternalXbase . g : 2961:1 : ruleXSwitchExpression returns [ EObject current = null ] : ( ( ) otherlv _ 1 = ' switch ' ( ( ( ( ( ' ( ' ( ( ruleJvmFormalParameter ) ) ' : ' ) ) = > ( otherlv _ 2 = ' ( ' ( ( lv _ declaredParam _ 3_0 = ruleJvmFormalParameter ) ) otherlv _ 4 = ' : '...
EObject current = null ; Token otherlv_1 = null ; Token otherlv_2 = null ; Token otherlv_4 = null ; Token otherlv_6 = null ; Token otherlv_8 = null ; Token otherlv_10 = null ; Token otherlv_12 = null ; Token otherlv_13 = null ; Token otherlv_15 = null ; EObject lv_declaredParam_3_0 = null ; EObject lv_switch_5_0 = null...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EEnum getIfcStructuralCurveActivityTypeEnum ( ) { } }
if ( ifcStructuralCurveActivityTypeEnumEEnum == null ) { ifcStructuralCurveActivityTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1073 ) ; } return ifcStructuralCurveActivityTypeEnumEEnum ;
public class NOPCSImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case AfplibPackage . NOPCS__IGNDATA : return getIGNDATA ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
public class PgResultSet { /** * # endif */ @ Override public Timestamp getTimestamp ( int i , java . util . Calendar cal ) throws SQLException { } }
checkResultSet ( i ) ; if ( wasNullFlag ) { return null ; } if ( cal == null ) { cal = getDefaultCalendar ( ) ; } int col = i - 1 ; int oid = fields [ col ] . getOID ( ) ; if ( isBinary ( i ) ) { if ( oid == Oid . TIMESTAMPTZ || oid == Oid . TIMESTAMP ) { boolean hasTimeZone = oid == Oid . TIMESTAMPTZ ; TimeZone tz = c...
public class SwingGui { /** * Returns the { @ link FileWindow } for the given URL . */ FileWindow getFileWindow ( String url ) { } }
if ( url == null || url . equals ( "<stdin>" ) ) { return null ; } return fileWindows . get ( url ) ;
public class ISUPMessageFactoryImpl { /** * ( non - Javadoc ) * @ see org . restcomm . protocols . ss7 . isup . ISUPMessageFactory # createUBA ( int ) */ @ Override public UnblockingAckMessage createUBA ( int cic ) { } }
UnblockingAckMessage msg = createUBA ( ) ; CircuitIdentificationCode code = this . parameterFactory . createCircuitIdentificationCode ( ) ; code . setCIC ( cic ) ; msg . setCircuitIdentificationCode ( code ) ; return msg ;
public class MessageSetImpl { /** * Gets messages in the given channel around a given message in any channel until one that meets the given * condition is found . If no message matches the condition , an empty set is returned . * The given message will be part of the result in addition to the messages around if it ...
CompletableFuture < MessageSet > future = new CompletableFuture < > ( ) ; channel . getApi ( ) . getThreadPool ( ) . getExecutorService ( ) . submit ( ( ) -> { try { List < Message > messages = new ArrayList < > ( ) ; Optional < Message > untilMessage = getMessagesAroundAsStream ( channel , around ) . peek ( messages :...
public class Jenkins { /** * Gets the { @ link Jenkins } singleton . * @ return { @ link Jenkins } instance * @ throws IllegalStateException for the reasons that { @ link # getInstanceOrNull } might return null * @ since 2.98 */ @ Nonnull public static Jenkins get ( ) throws IllegalStateException { } }
Jenkins instance = getInstanceOrNull ( ) ; if ( instance == null ) { throw new IllegalStateException ( "Jenkins.instance is missing. Read the documentation of Jenkins.getInstanceOrNull to see what you are doing wrong." ) ; } return instance ;
public class Builder { /** * Use custom serialization / deserialization to store and retrieve objects from disk cache . * @ param maxDiskSizeBytes is the max size of disk in bytes which an be used by the disk cache * layer . * @ param usePrivateFiles is true if you want to use { @ link Context # MODE _ PRIVATE } ...
File folder = getDefaultDiskCacheFolder ( usePrivateFiles , context ) ; return useSerializerInDisk ( maxDiskSizeBytes , folder , serializer ) ;
public class MaxThreadTrackerService { /** * Not needed until workers support dynamic removal ( currently reload required ) */ void unregisterWorkerMax ( String name ) { } }
synchronized ( workers ) { Integer val = workers . remove ( name ) ; if ( val != null ) { total -= val ; } }
public class ExpressionParser { /** * It reads an expression from a reader and fill a tree * @ param reader the reader to be used as the character source , must not be null * @ param tree the result tree to be filled by read items , must not be null * @ param context a preprocessor context to be used for variable...
boolean working = true ; ExpressionItem result = null ; final FilePositionInfo [ ] stack ; final String sourceLine ; final PreprocessingState state = context . getPreprocessingState ( ) ; stack = state . makeIncludeStack ( ) ; sourceLine = state . getLastReadString ( ) ; ExpressionItem prev = null ; while ( working ) {...
public class Application { /** * Get the connection to the server for this applet . * Optionally create the server connection . * @ param localTaskOwner The task that will own this remote task ( or application ) server ) [ If null , get the app server ] . * @ param strUserID The user id ( or name ) to initialize ...
if ( localTaskOwner == null ) localTaskOwner = m_taskMain ; // No task = main task RemoteTask server = m_mapTasks . get ( localTaskOwner ) ; if ( server == null ) if ( bCreateIfNotFound ) { String strServer = this . getAppServerName ( ) ; String strRemoteApp = null ; if ( localTaskOwner != null ) strRemoteApp = localTa...
public class HexUtil { /** * Creates a byte array from a CharSequence ( String , StringBuilder , etc . ) * containing only valid hexidecimal formatted characters . * Each grouping of 2 characters represent a byte in " Big Endian " format . * The hex CharSequence must be an even length of characters . For example ...
if ( hexString == null ) { return null ; } assertOffsetLengthValid ( offset , length , hexString . length ( ) ) ; // a hex string must be in increments of 2 if ( ( length % 2 ) != 0 ) { throw new IllegalArgumentException ( "The hex string did not contain an even number of characters [actual=" + length + "]" ) ; } // co...
public class MeetingApplicationConfiguration { /** * Persistence Manager factory . This determines your database connection . This would have the same usage if * you were connecting to an embedded or remote database . The only difference would be the factory type . * @ return Initialized Persistence Manager Factory...
CacheManagerFactory cacheManagerFactory = new CacheManagerFactory ( ) ; cacheManagerFactory . initialize ( ) ; return cacheManagerFactory ;
public class Sendout { /** * Returns the entity with the required fields for an insert set . * @ return */ public Sendout instantiateForInsert ( ) { } }
Sendout entity = new Sendout ( ) ; entity . setIsRead ( Boolean . FALSE ) ; entity . setCandidate ( new Candidate ( 1 ) ) ; entity . setUser ( new CorporateUser ( 1 ) ) ; return entity ;
public class RythmEngine { /** * Constructors , Configuration and Initializing */ private void _initLogger ( Map < String , ? > conf ) { } }
boolean logEnabled = ( Boolean ) RythmConfigurationKey . LOG_ENABLED . getConfiguration ( conf ) ; if ( logEnabled ) { ILoggerFactory factory = RythmConfigurationKey . LOG_FACTORY_IMPL . getConfiguration ( conf ) ; Logger . registerLoggerFactory ( factory ) ; } else { Logger . registerLoggerFactory ( new NullLogger . F...
public class Transaction { /** * Opens a connection for the specified execution . * @ param event the event causing the open * @ throws SQLException * @ throws PersistenceException */ private synchronized void open ( Execution event , String dsn ) throws SQLException , PersistenceException { } }
try { Connection conn ; if ( connection != null ) { return ; } state = "OPENING" ; try { InitialContext ctx = new InitialContext ( ) ; DataSource ds ; if ( dsn == null ) { dsn = event . getDataSource ( ) ; } if ( dsn == null ) { throw new PersistenceException ( "No data source name" ) ; } state = "LOOKING UP" ; ds = ds...
public class NameService { /** * This method will return the event listener < code > ArrayList < / code > when called . The event listener is * lazily created . * @ return The listener array list . */ private ArrayList getListener ( ) { } }
if ( _listeners != null ) return _listeners ; synchronized ( this ) { if ( _listeners != null ) return _listeners ; _listeners = new ArrayList ( ) ; } return _listeners ;
public class MultipleOutputs { /** * Checks if a named output is alreadyDefined or not . * @ param conf job conf * @ param namedOutput named output names * @ param alreadyDefined whether the existence / non - existence of * the named output is to be checked * @ throws IllegalArgumentException if the output na...
List < String > definedChannels = getNamedOutputsList ( conf ) ; if ( alreadyDefined && definedChannels . contains ( namedOutput ) ) { throw new IllegalArgumentException ( "Named output '" + namedOutput + "' already alreadyDefined" ) ; } else if ( ! alreadyDefined && ! definedChannels . contains ( namedOutput ) ) { thr...
public class SearchableTextComponent { /** * Find the next appearance of the search panel query */ void doFindNext ( ) { } }
String query = searchPanel . getQuery ( ) ; if ( query . isEmpty ( ) ) { return ; } String text = getDocumentText ( ) ; boolean ignoreCase = ! searchPanel . isCaseSensitive ( ) ; int caretPosition = textComponent . getCaretPosition ( ) ; int textLength = text . length ( ) ; int newCaretPosition = ( caretPosition + 1 ) ...
public class TransportClientFactory { /** * Create a completely new { @ link TransportClient } to the remote address . */ private TransportClient createClient ( InetSocketAddress address ) throws IOException , InterruptedException { } }
logger . debug ( "Creating new connection to {}" , address ) ; Bootstrap bootstrap = new Bootstrap ( ) ; bootstrap . group ( workerGroup ) . channel ( socketChannelClass ) // Disable Nagle ' s Algorithm since we don ' t want packets to wait . option ( ChannelOption . TCP_NODELAY , true ) . option ( ChannelOption . SO_K...
public class DefaultDiskStorage { /** * Gets the directory to use to store the given key * @ param resourceId the id of the file we ' re going to store * @ return the directory to store the file in */ private String getSubdirectoryPath ( String resourceId ) { } }
String subdirectory = String . valueOf ( Math . abs ( resourceId . hashCode ( ) % SHARDING_BUCKET_COUNT ) ) ; return mVersionDirectory + File . separator + subdirectory ;
public class MaterialRange { /** * Register the ChangeHandler to become notified if the user changes the slider . * The Handler is called when the user releases the mouse only at the end of the slide * operation . */ @ Override public HandlerRegistration addChangeHandler ( final ChangeHandler handler ) { } }
return getRangeInputElement ( ) . addDomHandler ( handler , ChangeEvent . getType ( ) ) ;