signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class KAFDocument { /** * Creates a new chunk . It assigns an appropriate ID to it . The Chunk is added to the document object . * @ param head the chunk head . * @ param phrase type of the phrase . * @ param terms the list of the terms in the chunk . * @ return a new chunk . */ public Chunk newChunk ( S...
String newId = idManager . getNextId ( AnnotationType . CHUNK ) ; Chunk newChunk = new Chunk ( newId , span ) ; newChunk . setPhrase ( phrase ) ; annotationContainer . add ( newChunk , Layer . CHUNKS , AnnotationType . CHUNK ) ; return newChunk ;
public class RuntimeView { /** * Returns a new view schema based from an existing one . */ public static < T > Schema < T > createFrom ( RuntimeSchema < T > ms , Instantiator < T > instantiator , Factory vf , Predicate . Factory pf , String ... args ) { } }
return vf . create ( ms , instantiator , pf , args ) ;
public class DependencyNodeUtil { /** * Returns the first { @ link DependencyNode } object found that satisfy the filter . * @ param nodeIterator A tree iterator * @ param filter the { @ link DependencyNodeFilter } being used * @ return the first element that matches the filter . null if nothing is found * @ se...
while ( nodeIterator . hasNext ( ) ) { T element = nodeIterator . next ( ) ; if ( filter . accept ( element ) ) { return element ; } } return null ;
public class BaseBo { /** * Get a BO ' s attribute . * @ param attrName * @ param clazz * @ return */ public < T > T getAttribute ( String attrName , Class < T > clazz ) { } }
Lock lock = lockForRead ( ) ; try { return MapUtils . getValue ( attributes , attrName , clazz ) ; } finally { lock . unlock ( ) ; }
public class SonarResultParser { /** * Converts a Sonar severity to a Sputnik severity . * @ param severityName severity to convert . */ static Severity getSeverity ( String severityName ) { } }
switch ( severityName ) { case "BLOCKER" : case "CRITICAL" : case "MAJOR" : return Severity . ERROR ; case "MINOR" : return Severity . WARNING ; case "INFO" : return Severity . INFO ; default : log . warn ( "Unknown severity: " + severityName ) ; } return Severity . WARNING ;
public class TriangularSolver_DSCC { /** * Solves for the transpose of a lower triangular matrix against a dense matrix . L < sup > T < / sup > * x = b * @ param L Lower triangular matrix . Diagonal elements are assumed to be non - zero * @ param x ( Input ) Solution matrix ' b ' . ( Output ) matrix ' x ' */ public...
final int N = L . numCols ; for ( int j = N - 1 ; j >= 0 ; j -- ) { int idx0 = L . col_idx [ j ] ; int idx1 = L . col_idx [ j + 1 ] ; for ( int p = idx0 + 1 ; p < idx1 ; p ++ ) { x [ j ] -= L . nz_values [ p ] * x [ L . nz_rows [ p ] ] ; } x [ j ] /= L . nz_values [ idx0 ] ; }
public class CmsLog { /** * Render throwable using Throwable . printStackTrace . * < p > This code copy from " org . apache . log4j . DefaultThrowableRenderer . render ( Throwable throwable ) " < / p > * @ param throwable throwable , may not be null . * @ return string representation . */ public static String [ ]...
StringWriter sw = new StringWriter ( ) ; PrintWriter pw = new PrintWriter ( sw ) ; try { throwable . printStackTrace ( pw ) ; } catch ( RuntimeException ex ) { // nothing to do } pw . flush ( ) ; LineNumberReader reader = new LineNumberReader ( new StringReader ( sw . toString ( ) ) ) ; ArrayList < String > lines = new...
public class SchemaHelper { /** * - - - - - private methods - - - - - */ private static PropertySourceGenerator getSourceGenerator ( final ErrorBuffer errorBuffer , final String className , final PropertyDefinition propertyDefinition ) throws FrameworkException { } }
final String propertyName = propertyDefinition . getPropertyName ( ) ; final Type propertyType = propertyDefinition . getPropertyType ( ) ; final Class < ? extends PropertySourceGenerator > parserClass = parserMap . get ( propertyType ) ; try { return parserClass . getConstructor ( ErrorBuffer . class , String . class ...
public class GcloudStructuredLog { /** * Parses a JSON string representing { @ code gcloud } structured log output . * @ return parsed JSON * @ throws JsonParseException if { @ code jsonString } has syntax errors or incompatible JSON element * type */ public static GcloudStructuredLog parse ( String jsonString ) ...
Preconditions . checkNotNull ( jsonString ) ; try { GcloudStructuredLog log = new Gson ( ) . fromJson ( jsonString , GcloudStructuredLog . class ) ; if ( log == null ) { throw new JsonParseException ( "Empty input: \"" + jsonString + "\"" ) ; } return log ; } catch ( JsonSyntaxException e ) { throw new JsonParseExcepti...
public class Analytics { /** * Retrieve settings from the cache or the network : 1 . If the cache is empty , fetch new settings . * 2 . If the cache is not stale , use it . 2 . If the cache is stale , try to get new settings . */ @ Private ProjectSettings getSettings ( ) { } }
ProjectSettings cachedSettings = projectSettingsCache . get ( ) ; if ( isNullOrEmpty ( cachedSettings ) ) { return downloadSettings ( ) ; } long expirationTime = cachedSettings . timestamp ( ) + SETTINGS_REFRESH_INTERVAL ; if ( expirationTime > System . currentTimeMillis ( ) ) { return cachedSettings ; } ProjectSetting...
public class GeoParser { /** * Takes an unstructured text document ( as a String ) , extracts the * location names contained therein , and resolves them into * geographic entities representing the best match for those * location names . * @ param inputText unstructured text to be processed * @ return list of ...
return parse ( inputText , ClavinLocationResolver . DEFAULT_ANCESTRY_MODE ) ;
public class JDBCResultSet { /** * < ! - - start generic documentation - - > * Retrieves the value of the designated column in the current row * of this < code > ResultSet < / code > object as * a stream of ASCII characters . The value can then be read in chunks from the * stream . This method is particularly ...
String s = getString ( columnIndex ) ; if ( s == null ) { return null ; } try { return new ByteArrayInputStream ( s . getBytes ( "US-ASCII" ) ) ; } catch ( IOException e ) { return null ; }
public class ModelRegistry { /** * A mapping might apply to any type somewhere within a resource ' s * { @ link MappableTypeHierarchy } . This cache saves the registrar from searching * this entire hierarchy each time the model is resolved by remembering a found * resource type - & gt ; model relationship . */ pr...
synchronized ( this ) { if ( stateId == this . state . get ( ) ) { this . lookupCache . put ( key , sources ) ; } }
public class HttpSimulator { /** * { @ inheritDoc } */ @ Override public void init ( ServletConfig config ) throws ServletException { } }
super . init ( config ) ; Injector injector = Guice . createInjector ( new CoreModule ( ) , new HttpModule ( ) ) ; injector . injectMembers ( this ) ;
public class BatchMethodHandler { /** * Returns request type for the given odata uri . * @ param oDataUri the odata uri * @ return the request type * @ throws ODataTargetTypeException if unable to determine request type */ private Type getRequestType ( ODataRequest oDataRequest , ODataUri oDataUri ) throws ODataT...
TargetType targetType = WriteMethodUtil . getTargetType ( oDataRequest , entityDataModel , oDataUri ) ; return entityDataModel . getType ( targetType . typeName ( ) ) ;
public class StringColumn { /** * Returns a List & lt ; String & gt ; representation of all the values in this column * NOTE : Unless you really need a string consider using the column itself for large datasets as it uses much less memory * @ return values as a list of String . */ public List < String > asList ( ) ...
List < String > strings = new ArrayList < > ( ) ; for ( String category : this ) { strings . add ( category ) ; } return strings ;
public class ChannelBuilder { /** * Creates ChannelBuilders . * @ param classLoader classLoader * @ param serviceDomain serviceDomain * @ param implementationModel implementationModel * @ return ChannelBuilders */ public static List < ChannelBuilder > builders ( ClassLoader classLoader , ServiceDomain serviceDo...
List < ChannelBuilder > builders = new ArrayList < ChannelBuilder > ( ) ; if ( implementationModel != null ) { ChannelsModel channelsModel = implementationModel . getChannels ( ) ; if ( channelsModel != null ) { for ( ChannelModel channelModel : channelsModel . getChannels ( ) ) { if ( channelModel != null ) { builders...
public class IndexAliasMap { /** * Put alias . * @ param alias the alias * @ param index the index */ synchronized public void putAlias ( String alias , int index ) { } }
JMLambda . runByBoolean ( index < size ( ) , ( ) -> aliasIndexMap . put ( alias , index ) , ( ) -> JMExceptionManager . logRuntimeException ( log , "Wrong Index !!! - " + "dataList Size = " + dataList , "setKeyIndexMap" , index ) ) ;
public class ImplSurfDescribeOps { /** * Computes the gradient for a using the derivX kernel found in { @ link boofcv . alg . transform . ii . DerivativeIntegralImage } . * Assumes that the entire region , including the surrounding pixels , are inside the image . */ public static void gradientInner ( GrayF32 ii , dou...
// add 0.5 to c _ x and c _ y to have it round when converted to an integer pixel // this is faster than the straight forward method tl_x += 0.5 ; tl_y += 0.5 ; // round the kernel size int w = ( int ) ( kernelSize + 0.5 ) ; int r = w / 2 ; if ( r <= 0 ) r = 1 ; w = r * 2 + 1 ; int i = 0 ; for ( int y = 0 ; y < regionS...
public class TransliteratorRegistry { /** * Returns an enumeration over visible variant names for the given * source and target . * @ return An < code > Enumeration < / code > over < code > String < / code > objects */ public Enumeration < String > getAvailableVariants ( String source , String target ) { } }
CaseInsensitiveString cisrc = new CaseInsensitiveString ( source ) ; CaseInsensitiveString citrg = new CaseInsensitiveString ( target ) ; Map < CaseInsensitiveString , List < CaseInsensitiveString > > targets = specDAG . get ( cisrc ) ; if ( targets == null ) { return new IDEnumeration ( null ) ; } List < CaseInsensiti...
public class ChannelSelector { /** * @ see com . ibm . ws . ffdc . FFDCSelfIntrospectable # introspectSelf ( ) */ @ Override public String [ ] introspectSelf ( ) { } }
List < String > rc = new ArrayList < String > ( ) ; rc . add ( Thread . currentThread ( ) . getName ( ) ) ; rc . add ( "quit: " + this . quit ) ; rc . add ( "waitingToQuit: " + this . waitingToQuit ) ; rc . add ( "# of keys=" + this . selector . keys ( ) . size ( ) ) ; try { for ( SelectionKey key : this . selector . k...
public class GetFindingsStatisticsRequest { /** * Types of finding statistics to retrieve . * @ param findingStatisticTypes * Types of finding statistics to retrieve . * @ return Returns a reference to this object so that method calls can be chained together . * @ see FindingStatisticType */ public GetFindingsS...
java . util . ArrayList < String > findingStatisticTypesCopy = new java . util . ArrayList < String > ( findingStatisticTypes . length ) ; for ( FindingStatisticType value : findingStatisticTypes ) { findingStatisticTypesCopy . add ( value . toString ( ) ) ; } if ( getFindingStatisticTypes ( ) == null ) { setFindingSta...
public class ImageResolutionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setYResol ( Integer newYResol ) { } }
Integer oldYResol = yResol ; yResol = newYResol ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . IMAGE_RESOLUTION__YRESOL , oldYResol , yResol ) ) ;
public class JSDefinedClass { /** * Adds a field to the list of field members of this defined class . * @ param sName * Name of this field . * @ param aInit * Initial value of this field . * @ return Newly generated field */ @ Nonnull public JSFieldVar field ( @ Nonnull @ Nonempty final String sName , @ Nulla...
final JSFieldVar aField = new JSFieldVar ( this , sName , aInit ) ; return addField ( aField ) ;
public class JspTranslatorUtil { /** * PI12939 */ private static void deleteClassFiles ( JspResources [ ] compileFiles ) { } }
final boolean isAnyTraceEnabled = com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) ; if ( isAnyTraceEnabled && logger . isLoggable ( Level . FINER ) ) { logger . entering ( CLASS_NAME , "deleteClassFiles" , "deleteClassFilesBeforeRecompile is set to true" ) ; } String classfileName = null ; if ( compile...
public class SftpFile { /** * Determine whether the file is pointing to a pipe . * @ return boolean * @ throws SshException * @ throws SftpStatusException */ public boolean isFifo ( ) throws SftpStatusException , SshException { } }
// This is long hand because gcj chokes when it is not ? Investigate why if ( ( getAttributes ( ) . getPermissions ( ) . longValue ( ) & SftpFileAttributes . S_IFIFO ) == SftpFileAttributes . S_IFIFO ) return true ; return false ;
public class BigtableAsyncBufferedMutator { /** * { @ inheritDoc } */ @ Override public List < CompletableFuture < Void > > mutate ( List < ? extends Mutation > mutations ) { } }
return helper . mutate ( mutations ) . stream ( ) . map ( listenableFuture -> toCompletableFuture ( listenableFuture ) . thenApply ( r -> ( Void ) null ) ) . collect ( Collectors . toList ( ) ) ;
public class DateFormat { /** * Returns the date / time formatter with the default formatting style * for the default < code > FORMAT < / code > locale . * @ return a date / time formatter . * @ see Category # FORMAT */ public final static DateFormat getDateTimeInstance ( ) { } }
return get ( DEFAULT , DEFAULT , ULocale . getDefault ( Category . FORMAT ) , null ) ;
public class ByteArrayPersistedValueData { /** * { @ inheritDoc } */ public void writeExternal ( ObjectOutput out ) throws IOException { } }
out . writeInt ( orderNumber ) ; out . writeInt ( value . length ) ; if ( value . length > 0 ) { out . write ( value ) ; }
public class GSCPImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . GSCP__XPOS : return XPOS_EDEFAULT == null ? xpos != null : ! XPOS_EDEFAULT . equals ( xpos ) ; case AfplibPackage . GSCP__YPOS : return YPOS_EDEFAULT == null ? ypos != null : ! YPOS_EDEFAULT . equals ( ypos ) ; } return super . eIsSet ( featureID ) ;
public class CmsGalleryController { /** * Opens the preview for the given resource by the given resource type . < p > * @ param resourcePath the resource path * @ param resourceType the resource type name */ public void openPreview ( String resourcePath , String resourceType ) { } }
if ( m_currentPreview != null ) { m_currentPreview . removePreview ( ) ; } String provider = getProviderName ( resourceType ) ; if ( m_previewFactoryRegistration . containsKey ( provider ) ) { m_handler . m_galleryDialog . useMaxDimensions ( ) ; m_currentPreview = m_previewFactoryRegistration . get ( provider ) . getPr...
public class ListBuffer { /** * Return first element in this buffer and remove */ public A next ( ) { } }
A x = elems . head ; if ( ! elems . isEmpty ( ) ) { elems = elems . tail ; if ( elems . isEmpty ( ) ) last = null ; count -- ; } return x ;
public class MatchParserImpl { /** * Prime a MatchParser object with a String form selector so that its QueryExpr method * will return the corresponding Selector tree . * @ param parser an existing MatchParser object to be reused , or null if a new one is to * be created . * @ param selector the String - form s...
CharStream inStream = new IBMUnicodeCharStream ( new StringReader ( selector ) , 1 , 1 ) ; if ( parser == null ) parser = new MatchParserImpl ( inStream ) ; else ( ( MatchParserImpl ) parser ) . ReInit ( inStream ) ; ( ( MatchParserImpl ) parser ) . strict = strict ; return parser ;
public class PatreonAPI { /** * Get a list of campaigns the current creator is running - also contains other related data like Goals * Note : The first campaign data object is located at index 0 in the data list * @ return the list of campaigns * @ throws IOException Thrown when the GET request failed */ public J...
String path = new URIBuilder ( ) . setPath ( "current_user/campaigns" ) . addParameter ( "include" , "rewards,creator,goals" ) . toString ( ) ; return converter . readDocumentCollection ( getDataStream ( path ) , Campaign . class ) ;
public class PersonNameHelper { /** * Get the display name of the person consisting of titles , first name , middle * name and last name . { @ link # isFirstNameFirst ( ) } is considered ! * @ param aName * The name to be converted . May not be < code > null < / code > . * @ return The non - < code > null < / c...
if ( isFirstNameFirst ( ) ) return getAsCompleteDisplayNameFirstNameFirst ( aName ) ; return getAsCompleteDisplayNameLastNameFirst ( aName ) ;
public class Threshold { /** * Evaluates this threshold against the passed in metric . The returned status * is computed this way : * < ol > * < li > If at least one ok range is specified , if the value falls inside one * of the ok ranges , { @ link Status # OK } is returned . * < li > If at lease one critica...
if ( okThresholdList . isEmpty ( ) && warningThresholdList . isEmpty ( ) && criticalThresholdList . isEmpty ( ) ) { return Status . OK ; } // Perform evaluation escalation for ( Range range : okThresholdList ) { if ( range . isValueInside ( metric , prefix ) ) { return Status . OK ; } } for ( Range range : criticalThre...
public class FastAdapterDiffUtil { /** * convenient function for { @ link # calculateDiff ( ModelAdapter , List , DiffCallback , boolean ) } * @ return the { @ link androidx . recyclerview . widget . DiffUtil . DiffResult } computed . */ public static < A extends ModelAdapter < Model , Item > , Model , Item extends I...
return calculateDiff ( adapter , items , callback , true ) ;
public class Solo { /** * Sets the status of the NavigationDrawer . Examples of status are : { @ code Solo . CLOSED } and { @ code Solo . OPENED } . * @ param status the status that the NavigationDrawer should be set to */ public void setNavigationDrawer ( final int status ) { } }
if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "setNavigationDrawer(" + status + ")" ) ; } setter . setNavigationDrawer ( status ) ;
public class EmxDataProvider { /** * Create an entity from the EMX entity * @ param entityType entity meta data * @ param emxEntity EMX entity * @ return MOLGENIS entity */ private Entity toEntity ( EntityType entityType , Entity emxEntity ) { } }
Entity entity = entityManager . create ( entityType , POPULATE ) ; for ( Attribute attr : entityType . getAtomicAttributes ( ) ) { if ( attr . getExpression ( ) == null && ! attr . isMappedBy ( ) ) { String attrName = attr . getName ( ) ; Object emxValue = emxEntity . get ( attrName ) ; AttributeType attrType = attr . ...
public class ReduceOps { /** * Constructs a { @ code TerminalOp } that implements a functional reduce on * { @ code double } values , producing an optional double result . * @ param operator the combining function * @ return a { @ code TerminalOp } implementing the reduction */ public static TerminalOp < Double ,...
Objects . requireNonNull ( operator ) ; class ReducingSink implements AccumulatingSink < Double , OptionalDouble , ReducingSink > , Sink . OfDouble { private boolean empty ; private double state ; public void begin ( long size ) { empty = true ; state = 0 ; } @ Override public void accept ( double t ) { if ( empty ) { ...
public class AttributeCriterionPane { /** * Return the actual search criterion object , or null if not all fields have been properly filled . * @ return search criterion */ public SearchCriterion getSearchCriterion ( ) { } }
Object operator = operatorSelect . getValue ( ) ; Object value = valueItem . getValue ( ) ; if ( selectedAttribute != null && operator != null ) { String operatorString = getOperatorCodeFromLabel ( operator . toString ( ) ) ; String valueString = "" ; String nameString = selectedAttribute . getName ( ) ; if ( value != ...
public class LicenseClient { /** * Deletes the specified license . * < p > Sample code : * < pre > < code > * try ( LicenseClient licenseClient = LicenseClient . create ( ) ) { * ProjectGlobalLicenseName license = ProjectGlobalLicenseName . of ( " [ PROJECT ] " , " [ LICENSE ] " ) ; * Operation response = lic...
DeleteLicenseHttpRequest request = DeleteLicenseHttpRequest . newBuilder ( ) . setLicense ( license ) . build ( ) ; return deleteLicense ( request ) ;
public class BiconjugateGradient { /** * Returns a simple preconditioner matrix that is the * trivial diagonal part of A in some cases . */ private static Preconditioner diagonalPreconditioner ( Matrix A ) { } }
return new Preconditioner ( ) { public void asolve ( double [ ] b , double [ ] x ) { double [ ] diag = A . diag ( ) ; int n = diag . length ; for ( int i = 0 ; i < n ; i ++ ) { x [ i ] = diag [ i ] != 0.0 ? b [ i ] / diag [ i ] : b [ i ] ; } } } ;
public class PropertyImpl { /** * { @ inheritDoc } */ void loadData ( ItemData data , NodeData parent ) throws RepositoryException , ConstraintViolationException { } }
if ( data . isNode ( ) ) { throw new RepositoryException ( "Load data failed: Property expected" ) ; } this . data = data ; this . propertyData = ( PropertyData ) data ; this . type = propertyData . getType ( ) ; this . qpath = data . getQPath ( ) ; this . location = null ; initDefinitions ( this . propertyData . isMul...
public class Client { /** * 扩展支持以pid or host - port两种方式接入 */ public static JMXConnector connect ( final String hostportOrPid , final String login , final String password ) throws IOException { } }
// . / vjmxcli . sh - 127.0.0.1:8060 gcutil if ( hostportOrPid . contains ( ":" ) ) { JMXServiceURL rmiurl = new JMXServiceURL ( "service:jmx:rmi://" + hostportOrPid + "/jndi/rmi://" + hostportOrPid + "/jmxrmi" ) ; return JMXConnectorFactory . connect ( rmiurl , formatCredentials ( login , password ) ) ; } else { // . ...
public class LocaleFilter { /** * Gets a string representation of the given locale . * This default implementation only supports language , country , and variant . * Country will only be added when language present . * Variant will only be added when both language and country are present . */ protected String toL...
String language = locale . getLanguage ( ) ; if ( language . isEmpty ( ) ) return "" ; String country = locale . getCountry ( ) ; if ( country . isEmpty ( ) ) return language ; String variant = locale . getVariant ( ) ; if ( variant . isEmpty ( ) ) { return language + '-' + country ; } else { return language + '-' + co...
public class CipherInputStream { /** * Skips < code > n < / code > bytes of input from the bytes that can be read * from this input stream without blocking . * < p > Fewer bytes than requested might be skipped . * The actual number of bytes skipped is equal to < code > n < / code > or * the result of a call to ...
int available = ofinish - ostart ; if ( n > available ) { n = available ; } if ( n < 0 ) { return 0 ; } ostart += n ; return n ;
public class AtomicBitflags { /** * Atomically add the given flags to the current set * @ param flags to add * @ return the previous value */ public int set ( final int flags ) { } }
for ( ; ; ) { int current = _flags . get ( ) ; int newValue = current | flags ; if ( _flags . compareAndSet ( current , newValue ) ) { return current ; } }
public class S3ProxyHandler { /** * TODO : bogus values */ private static void writeInitiatorStanza ( XMLStreamWriter xml ) throws XMLStreamException { } }
xml . writeStartElement ( "Initiator" ) ; writeSimpleElement ( xml , "ID" , FAKE_INITIATOR_ID ) ; writeSimpleElement ( xml , "DisplayName" , FAKE_INITIATOR_DISPLAY_NAME ) ; xml . writeEndElement ( ) ;
public class ExtensionsConfigFileReader { /** * / * Roughly corresponds to pbx _ config . c : 2276 */ private static String [ ] harvestApplicationWithArguments ( String arg ) { } }
List < String > args = new ArrayList < > ( ) ; if ( arg . trim ( ) . length ( ) >= 0 ) { String appl = "" , data = "" ; /* Find the first occurrence of either ' ( ' or ' , ' */ int firstc = arg . indexOf ( ',' ) ; int firstp = arg . indexOf ( '(' ) ; if ( firstc != - 1 && ( firstp == - 1 || firstc < firstp ) ) { /* com...
public class ReservationReader { /** * Make the request to the Twilio API to perform the read . * @ param client TwilioRestClient with which to make the request * @ return Reservation ResourceSet */ @ Override public ResourceSet < Reservation > read ( final TwilioRestClient client ) { } }
return new ResourceSet < > ( this , client , firstPage ( client ) ) ;
public class App { /** * An array of < code > EnvironmentVariable < / code > objects that specify environment variables to be associated with the * app . After you deploy the app , these variables are defined on the associated app server instances . For more * information , see < a href = * " http : / / docs . aw...
if ( environment == null ) { this . environment = null ; return ; } this . environment = new com . amazonaws . internal . SdkInternalList < EnvironmentVariable > ( environment ) ;
public class ArrayUtils { /** * needed because Arrays . asList ( ) won ' t to autoboxing , * so if you give it a primitive array you get a * singleton list back with just that array as an element . */ public static List < Integer > asList ( int [ ] array ) { } }
List < Integer > l = new ArrayList < Integer > ( ) ; for ( int i : array ) { l . add ( i ) ; } return l ;
public class EntityClassReader { /** * Will retrieve the value of the geometryfield in the given object . If no geometryfield * exists , null is returned . If more than one exist , a random one is returned . * @ param objectToGet the object from which the geometry is to be fetched . * @ return the geometry of the...
if ( objectToGet == null ) { throw new IllegalArgumentException ( "The given object may not be null" ) ; } if ( objectToGet . getClass ( ) != entityClass ) { throw new InvalidObjectReaderException ( "Class of target object does not correspond with entityclass of this reader." ) ; } if ( geometryAccessor == null ) { ret...
public class SaneSession { /** * Establishes a connection to the SANE daemon running on the given host on the given port . If the * connection cannot be established within the given timeout , * { @ link java . net . SocketTimeoutException } is thrown . * @ param saneAddress * @ param port * @ param timeout Co...
long millis = timeUnit . toMillis ( timeout ) ; Preconditions . checkArgument ( millis >= 0 && millis <= Integer . MAX_VALUE , "Timeout must be between 0 and Integer.MAX_VALUE milliseconds" ) ; // If the user specifies a non - zero timeout that rounds to 0 milliseconds , // set the timeout to 1 millisecond instead . if...
public class SleepingTimer { /** * Enforces the thread waits for the given interval between consecutive ticks . * @ throws InterruptedException if the thread is interrupted while waiting */ public void tick ( ) throws InterruptedException { } }
if ( mPreviousTickMs != 0 ) { long executionTimeMs = mClock . millis ( ) - mPreviousTickMs ; if ( executionTimeMs > mIntervalMs ) { mLogger . warn ( "{} last execution took {} ms. Longer than the interval {}" , mThreadName , executionTimeMs , mIntervalMs ) ; } else { mSleeper . sleep ( Duration . ofMillis ( mIntervalMs...
public class LazySocketFactory { /** * Returns a socket that will lazily connect . */ public CheckedSocket getSocket ( Object session ) throws ConnectException , SocketException { } }
return CheckedSocket . check ( new LazySocket ( mFactory , session ) ) ;
public class ManagementLocksInner { /** * Deletes the management lock at the subscription level . * To delete management locks , you must have access to Microsoft . Authorization / * or Microsoft . Authorization / locks / * actions . Of the built - in roles , only Owner and User Access Administrator are granted those...
return deleteAtSubscriptionLevelWithServiceResponseAsync ( lockName ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class Ec2MachineConfigurator { /** * Creates volume for EBS . * @ return volume ID of newly created volume */ private String createVolume ( String storageId , String snapshotId , int size ) { } }
String volumeType = Ec2IaasHandler . findStorageProperty ( this . targetProperties , storageId , VOLUME_TYPE_PREFIX ) ; if ( volumeType == null ) volumeType = "standard" ; CreateVolumeRequest createVolumeRequest = new CreateVolumeRequest ( ) . withAvailabilityZone ( this . availabilityZone ) . withVolumeType ( volumeTy...
public class KeyVaultClientBaseImpl { /** * List secrets in a specified key vault . * The Get Secrets operation is applicable to the entire vault . However , only the base secret identifier and its attributes are provided in the response . Individual secret versions are not listed in the response . This operation req...
ServiceResponse < Page < SecretItem > > response = getSecretsSinglePageAsync ( vaultBaseUrl , maxresults ) . toBlocking ( ) . single ( ) ; return new PagedList < SecretItem > ( response . body ( ) ) { @ Override public Page < SecretItem > nextPage ( String nextPageLink ) { return getSecretsNextSinglePageAsync ( nextPag...
public class ThriftClient { /** * ( non - Javadoc ) * @ see * com . impetus . client . cassandra . CassandraClientBase # find ( java . util . List , * com . impetus . kundera . metadata . model . EntityMetadata , boolean , * java . util . List , int , java . util . List ) */ @ Override public List find ( List <...
List < Object > entities = new ArrayList < Object > ( ) ; Connection conn = null ; try { // ixClause can be 0,1 or more ! SlicePredicate slicePredicate = new SlicePredicate ( ) ; if ( columns != null && ! columns . isEmpty ( ) ) { List asList = new ArrayList ( 32 ) ; for ( String colName : columns ) { if ( colName != n...
public class TinyAES { /** * Calculate the necessary round keys The number of calculations depends on * key size and block size AES specified a fixed block size of 128 bits and * key sizes 128/192/256 bits This code is written assuming those are the * only possible values */ private int [ ] [ ] generateWorkingKey...
int KC = key . length / 4 ; // key length in words int t ; boolean c1 = KC != 4 ; boolean c2 = KC != 6 ; boolean c3 = KC != 8 ; boolean c4 = ( KC * 4 ) != key . length ; if ( ( c1 && c2 && c3 ) || c4 ) { throw new IllegalArgumentException ( "Key length not 128/192/256 bits, " + key . length * 8 + " instead." ) ; } ROUN...
public class ThreadSafety { /** * ( 3 ) require the super - class to also be a container of its corresponding type parameter . */ private boolean containerOfSubtyping ( Set < String > containerTypeParameters , AnnotationInfo annotation , TypeVariableSymbol typaram , Type tyargument ) { } }
if ( ! tyargument . hasTag ( TypeTag . TYPEVAR ) ) { return false ; } if ( ! containerTypeParameters . contains ( tyargument . asElement ( ) . getSimpleName ( ) . toString ( ) ) || isTypeParameterThreadSafe ( ( TypeVariableSymbol ) tyargument . asElement ( ) , containerTypeParameters ) ) { return false ; } if ( annotat...
public class _HoloActivity { /** * Do not override this method . Use { @ link # onPreInit ( Holo , Bundle ) } and * { @ link # onPostInit ( Holo , Bundle ) } */ protected void onInit ( Holo config , Bundle savedInstanceState ) { } }
if ( mInited ) { throw new IllegalStateException ( "This instance was already inited" ) ; } mInited = true ; if ( config == null ) { config = createConfig ( savedInstanceState ) ; } if ( config == null ) { config = Holo . defaultConfig ( ) ; } onPreInit ( config , savedInstanceState ) ; if ( ! config . ignoreApplicatio...
public class DateConverter { /** * Parse a @ see org . joda . time . DateTime from a String . * @ param dateTimeString timestamp to parse * @ return parsed @ see org . joda . time . DateTime if parseable , null otherwise */ public static DateTime iso8601DateTimeFromString ( String dateTimeString ) { } }
try { return DateTime . parse ( dateTimeString , ISO8601_DATE_TIME_FORMATTER ) ; } catch ( Exception e ) { return null ; }
public class DeepLearningTask { /** * assumption : layer 0 has _ a filled with ( horizontalized categoricals ) double values */ public static void step ( long seed , Neurons [ ] neurons , DeepLearningModel . DeepLearningModelInfo minfo , boolean training , double [ ] responses ) { } }
try { for ( int i = 1 ; i < neurons . length - 1 ; ++ i ) { neurons [ i ] . fprop ( seed , training ) ; } if ( minfo . get_params ( ) . autoencoder ) { neurons [ neurons . length - 1 ] . fprop ( seed , training ) ; if ( training ) { for ( int i = neurons . length - 1 ; i > 0 ; -- i ) { neurons [ i ] . bprop ( ) ; } } }...
public class ConsoleKnownHostsKeyVerification { /** * Prompts the user through the console to verify the host key . * @ param host * the name of the host * @ param pk * the current public key of the host * @ param actual * the actual public key supplied by the host * @ since 0.2.0 */ public void onHostKey...
try { System . out . println ( "The host key supplied by " + host + "(" + pk . getAlgorithm ( ) + ")" + " is: " + actual . getFingerprint ( ) ) ; System . out . println ( "The current allowed key for " + host + " is: " + pk . getFingerprint ( ) ) ; getResponse ( host , actual ) ; } catch ( Exception e ) { e . printStac...
public class AmazonAlexaForBusinessClient { /** * Deletes a room profile by the profile ARN . * @ param deleteProfileRequest * @ return Result of the DeleteProfile operation returned by the service . * @ throws NotFoundException * The resource is not found . * @ throws ConcurrentModificationException * Ther...
request = beforeClientExecution ( request ) ; return executeDeleteProfile ( request ) ;
public class XNSerializables { /** * Create an XNSerializable object through the { @ code creator } function * and load it from the { @ code item } . * @ param < T > the XNSerializable object * @ param item the item to load from * @ param creator the function to create Ts * @ return the created and loaded obj...
T result = creator . get ( ) ; result . load ( item ) ; return result ;
public class BeanExtractor { private Object exctractJsonifiedValue ( ObjectToJsonConverter pConverter , Object pValue , Stack < String > pPathParts ) throws AttributeNotFoundException { } }
if ( pValue . getClass ( ) . isPrimitive ( ) || FINAL_CLASSES . contains ( pValue . getClass ( ) ) || pValue instanceof JSONAware ) { // No further diving , use these directly return pValue ; } else { // For the rest we build up a JSON map with the attributes as keys and the value are List < String > attributes = extra...
public class XLog { /** * Log a message and a throwable with specific log level . * @ param logLevel the specific log level * @ param msg the message to log * @ param tr the throwable to be log * @ since 1.4.0 */ public static void log ( int logLevel , String msg , Throwable tr ) { } }
assertInitialization ( ) ; sLogger . log ( logLevel , msg , tr ) ;
public class MetatypeUtils { /** * Parse a boolean from the provided config value : checks for whether or not * the object read from the Service / Component configuration is a String * or a Metatype converted boolean . * If an exception occurs converting the object parameter : * A translated warning message wil...
if ( obj != null ) { if ( obj instanceof String ) { String value = ( String ) obj ; if ( value . equalsIgnoreCase ( "true" ) ) { return true ; } else if ( value . equalsIgnoreCase ( "false" ) ) { return false ; } else { Tr . warning ( tc , "invalidBoolean" , configAlias , propertyKey , obj ) ; throw new IllegalArgument...
public class Prefser { /** * Gets value from SharedPreferences with a given key and type . * If value is not found , we can return defaultValue . * @ param key key of the preference * @ param typeTokenOfT type token of T ( e . g . { @ code new TypeToken < List < String > > { } ) * @ param defaultValue default v...
Preconditions . checkNotNull ( key , KEY_IS_NULL ) ; Preconditions . checkNotNull ( typeTokenOfT , TYPE_TOKEN_OF_T_IS_NULL ) ; Type typeOfT = typeTokenOfT . getType ( ) ; for ( Map . Entry < Class < ? > , Accessor < ? > > entry : accessorProvider . getAccessors ( ) . entrySet ( ) ) { if ( typeOfT . equals ( entry . get...
public class Span { /** * Concatenates two span lists adding the spans of the second parameter to the * list in first parameter . * @ param allSpans * the spans to which the other spans are added * @ param neSpans * the spans to be added to allSpans */ public static final void concatenateSpans ( final List < ...
for ( final Span span : neSpans ) { allSpans . add ( span ) ; }
public class CmsRelationType { /** * Returns a localized name for the given relation type . < p > * @ param messages the message bundle to use to resolve the name * @ return a localized name */ public String getLocalizedName ( CmsMessages messages ) { } }
String nameKey = "GUI_RELATION_TYPE_" + getName ( ) + "_0" ; return messages . key ( nameKey ) ;
public class CoroutineReader { /** * Deserializes a { @ link CoroutineRunner } object from a byte array . * If you ' re handling your own deserialization and you simply want to reconstruct the deserialized object to the * { @ link CoroutineRunner } , use { @ link # reconstruct ( com . offbynull . coroutines . user ...
if ( data == null ) { throw new NullPointerException ( ) ; } SerializedState serializedState = deserializer . deserialize ( data ) ; return reconstruct ( serializedState ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcEllipseProfileDef ( ) { } }
if ( ifcEllipseProfileDefEClass == null ) { ifcEllipseProfileDefEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 204 ) ; } return ifcEllipseProfileDefEClass ;
public class AWSDeviceFarmClient { /** * Creates a device pool . * @ param createDevicePoolRequest * Represents a request to the create device pool operation . * @ return Result of the CreateDevicePool operation returned by the service . * @ throws ArgumentException * An invalid argument was specified . * @...
request = beforeClientExecution ( request ) ; return executeCreateDevicePool ( request ) ;
public class SwapFile { /** * Mark the file ready for read . */ public void spoolDone ( ) { } }
final CountDownLatch sl = this . spoolLatch . get ( ) ; this . spoolLatch . set ( null ) ; sl . countDown ( ) ;
public class ComplexExpressionExtractor { /** * If an equality ( = = ) expression has double - parentheses , remove one set . * This avoids clang ' s - Wparentheses - equality warning . */ @ Override public void endVisit ( ParenthesizedExpression node ) { } }
Expression expr = node . getExpression ( ) ; if ( expr instanceof ParenthesizedExpression ) { Expression inner = ( ( ParenthesizedExpression ) expr ) . getExpression ( ) ; if ( isEqualityExpression ( inner ) ) { node . replaceWith ( TreeUtil . remove ( expr ) ) ; } } else if ( ! ( node . getParent ( ) instanceof Expres...
public class FacetUrl { /** * Get Resource Url for DeleteFacetById * @ param facetId Unique identifier of the facet to retrieve . * @ return String Resource Url */ public static MozuUrl deleteFacetByIdUrl ( Integer facetId ) { } }
UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/facets/{facetId}" ) ; formatter . formatUrl ( "facetId" , facetId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ;
public class ImplEdgeNonMaxSuppression_MT { /** * Only processes the inner image . Ignoring the border . */ static public void inner4 ( GrayF32 intensity , GrayS8 direction , GrayF32 output ) { } }
final int w = intensity . width ; final int h = intensity . height - 1 ; BoofConcurrency . loopFor ( 1 , h , y -> { int indexI = intensity . startIndex + y * intensity . stride + 1 ; int indexD = direction . startIndex + y * direction . stride + 1 ; int indexO = output . startIndex + y * output . stride + 1 ; int end =...
public class FileHdr { /** * Get the table name . */ public String getTableNames ( boolean bAddQuotes ) { } }
return ( m_tableName == null ) ? Record . formatTableNames ( FILE_HDR_FILE , bAddQuotes ) : super . getTableNames ( bAddQuotes ) ;
public class ServerHistory { /** * Clean up the Tree by DFS traversal . * Remove the node that has no children and no notifications associated * with them . * @ param node */ private void cleanUpHistoryTree ( HistoryNode node ) { } }
if ( node == null || node . children == null ) { return ; } Iterator < HistoryNode > iterator = node . children . iterator ( ) ; while ( iterator . hasNext ( ) ) { HistoryNode child = iterator . next ( ) ; // clean up child cleanUpHistoryTree ( child ) ; // clean up current node ; if ( shouldRemoveNode ( child ) ) { it...
public class FileDownloader { /** * Start the download queue by the same listener . * @ param listener Used to assemble tasks which is bound by the same { @ code listener } * @ param isSerial Whether start tasks one by one rather than parallel . * @ return { @ code true } if start tasks successfully . */ public b...
if ( listener == null ) { Util . w ( TAG , "Tasks with the listener can't start, because the listener " + "provided is null: [null, " + isSerial + "]" ) ; return false ; } List < DownloadTaskAdapter > originalTasks = FileDownloadList . getImpl ( ) . assembleTasksToStart ( listener ) ; if ( originalTasks . isEmpty ( ) )...
public class ApiOvhOrder { /** * Get prices and contracts information * REST : GET / order / email / exchange / { organizationName } / service / { exchangeService } / upgrade * @ param organizationName [ required ] The internal name of your exchange organization * @ param exchangeService [ required ] The internal...
String qPath = "/order/email/exchange/{organizationName}/service/{exchangeService}/upgrade" ; StringBuilder sb = path ( qPath , organizationName , exchangeService ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhOrder . class ) ;
public class RetryPolicies { /** * Set a default policy with some explicit handlers for specific exceptions . */ public static final RetryPolicy retryByException ( RetryPolicy defaultPolicy , Map < Class < ? extends Exception > , RetryPolicy > exceptionToPolicyMap ) { } }
return new ExceptionDependentRetry ( defaultPolicy , exceptionToPolicyMap ) ;
public class ProductSegmentation { /** * Sets the bandwidthSegment value for this ProductSegmentation . * @ param bandwidthSegment * The bandwidth segmentation . { @ link BandwidthGroupTargeting # isTargeted } * must be { @ code true } . * < p > This attribute is optional . */ public void setBandwidthSegment ( co...
this . bandwidthSegment = bandwidthSegment ;
public class QuartzScheduler { /** * Halts the < code > QuartzScheduler < / code > ' s firing of < code > { @ link org . quartz . triggers . Trigger } s * < / code > , and cleans up all resources associated with the QuartzScheduler . * < p > The scheduler cannot be re - started . */ @ Override public void shutdown ...
// delay a little bit in case an added job is still taking it ' s time getting started right // before shutdown is called . try { // System . out . println ( " waiting . . . " ) ; Thread . sleep ( 100 ) ; } catch ( Exception ignore ) { } if ( shuttingDown || closed ) { return ; } shuttingDown = true ; logger . info ( "...
public class HandlerFactory { /** * get a numeric with separators key press handler . * @ return NumericWithSeparatorsKeyPressHandler */ public static final KeyPressHandler getNumericWithSeparatorsKeyPressHandler ( ) { } }
// NOPMD if ( HandlerFactory . numericWsKeyPressHandler == null ) { synchronized ( NumericWithSeparatorsKeyPressHandler . class ) { if ( HandlerFactory . numericWsKeyPressHandler == null ) { HandlerFactory . numericWsKeyPressHandler = new NumericWithSeparatorsKeyPressHandler ( ) ; } } } return HandlerFactory . numericW...
public class AmazonChimeClient { /** * Retrieves details for the specified Amazon Chime account , such as account type and supported licenses . * @ param getAccountRequest * @ return Result of the GetAccount operation returned by the service . * @ throws UnauthorizedClientException * The client is not currently...
request = beforeClientExecution ( request ) ; return executeGetAccount ( request ) ;
public class ContractsApi { /** * Get public contract items ( asynchronously ) Lists items of a public * contract - - - This route is cached for up to 3600 seconds * @ param contractId * ID of a contract ( required ) * @ param datasource * The server name you would like data from ( optional , default to * t...
com . squareup . okhttp . Call call = getContractsPublicItemsContractIdValidateBeforeCall ( contractId , datasource , ifNoneMatch , page , callback ) ; Type localVarReturnType = new TypeToken < List < PublicContractsItemsResponse > > ( ) { } . getType ( ) ; apiClient . executeAsync ( call , localVarReturnType , callbac...
public class SeaGlassTabbedPaneUI { /** * Make sure we have laid out the pane with the current layout . */ private void ensureCurrentLayout ( ) { } }
if ( ! tabPane . isValid ( ) ) { tabPane . validate ( ) ; } /* * If tabPane doesn ' t have a peer yet , the validate ( ) call will silently * fail . We handle that by forcing a layout if tabPane is still invalid . * See bug 4237677. */ if ( ! tabPane . isValid ( ) ) { TabbedPaneLayout layout = ( TabbedPaneLayout ) ...
public class SerializedFormBuilder { /** * Build the field deprecation information . * @ param node the XML element that specifies which components to document * @ param fieldsContentTree content tree to which the documentation will be added */ public void buildFieldDeprecationInfo ( XMLNode node , Content fieldsCo...
if ( ! utils . definesSerializableFields ( currentTypeElement ) ) { fieldWriter . addMemberDeprecatedInfo ( ( VariableElement ) currentMember , fieldsContentTree ) ; }
public class ErrorCodeImpl { /** * ( non - Javadoc ) * @ see org . restcomm . protocols . ss7 . tcap . asn . Encodable # decode ( org . mobicents . protocols . asn . AsnInputStream ) */ public void decode ( AsnInputStream ais ) throws ParseException { } }
try { if ( this . type == ErrorCodeType . Global ) { this . globalErrorCode = ais . readObjectIdentifier ( ) ; } else if ( this . type == ErrorCodeType . Local ) { this . localErrorCode = ais . readInteger ( ) ; } else { throw new ParseException ( null , GeneralProblemType . MistypedComponent ) ; } } catch ( IOExceptio...
public class HSQLDBHandler { /** * adds a table to the memory database * @ param conn * @ param pc * @ param name name of the new table * @ param query data source for table * @ throws SQLException * @ throws PageException */ private static void addTable ( Connection conn , PageContext pc , String name , Qu...
Statement stat ; usedTables . add ( name ) ; stat = conn . createStatement ( ) ; Key [ ] keys = CollectionUtil . keys ( query ) ; int [ ] types = query . getTypes ( ) ; int [ ] innerTypes = toInnerTypes ( types ) ; // CREATE STATEMENT String comma = "" ; StringBuilder create = new StringBuilder ( "CREATE TABLE " + name...
public class hostcpu { /** * Use this API to fetch filtered set of hostcpu resources . * filter string should be in JSON format . eg : " vm _ state : DOWN , name : [ a - z ] + " */ public static hostcpu [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } }
hostcpu obj = new hostcpu ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; hostcpu [ ] response = ( hostcpu [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class CacheHeader { /** * Set expires header to given date . * @ param response Response * @ param date Expires date */ public static void setExpires ( @ NotNull HttpServletResponse response , @ Nullable Date date ) { } }
if ( date == null ) { response . setHeader ( HEADER_EXPIRES , "-1" ) ; } else { response . setHeader ( HEADER_EXPIRES , formatDate ( date ) ) ; }
public class Parser { /** * Parse a ' var ' or ' const ' statement , or a ' var ' init list in a for * statement . * @ param declType A token value : either VAR , CONST , or LET depending on * context . * @ param pos the position where the node should start . It ' s sometimes * the var / const / let keyword ,...
int end ; VariableDeclaration pn = new VariableDeclaration ( pos ) ; pn . setType ( declType ) ; pn . setLineno ( ts . lineno ) ; Comment varjsdocNode = getAndResetJsDoc ( ) ; if ( varjsdocNode != null ) { pn . setJsDocNode ( varjsdocNode ) ; } // Example : // var foo = { a : 1 , b : 2 } , bar = [ 3 , 4 ] ; // var { b ...
public class OkapiUI { /** * GEN - LAST : event _ dataMatrixSquareOnlyCheckActionPerformed */ private void gridmatrixAutoSizeActionPerformed ( java . awt . event . ActionEvent evt ) { } }
// GEN - FIRST : event _ gridmatrixAutoSizeActionPerformed // TODO add your handling code here : gridmatrixUserSizeCombo . setEnabled ( false ) ; gridmatrixUserEccCombo . setEnabled ( false ) ; encodeData ( ) ;