signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class DefaultGroovyMethods { /** * Support the subscript operator with a collection for a char array * @ param array a char array * @ param indices a collection of indices for the items to retrieve * @ return list of the chars at the given indices * @ since 1.0 */ @ SuppressWarnings ( "unchecked" ) public static List < Character > getAt ( char [ ] array , Collection indices ) { } }
return primitiveArrayGet ( array , indices ) ;
public class IndexingDaoImpl { /** * Get the last transaction id from database * @ return */ public Long getLastTransactionID ( ) { } }
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "[getLastTransactionID]" ) ; } return ( Long ) template . selectOne ( SELECT_LAST_TRANSACTION_ID ) ;
public class IcsProgressBar { /** * < p > Set the range of the progress bar to 0 . . . < tt > max < / tt > . < / p > * @ param max the upper range of this progress bar * @ see # getMax ( ) * @ see # setProgress ( int ) * @ see # setSecondaryProgress ( int ) */ public synchronized void setMax ( int max ) { } }
if ( max < 0 ) { max = 0 ; } if ( max != mMax ) { mMax = max ; postInvalidate ( ) ; if ( mProgress > max ) { mProgress = max ; } refreshProgress ( android . R . id . progress , mProgress , false ) ; }
public class TreeMap { /** * Associates the specified value with the specified key in this map . If the map previously contained a mapping for * this key , the old value is replaced . * @ param key with which the specified value is to be associated . * @ param value to be associated with the specified key . * @ param transaction the put will be globally visible once this transaction commits . * @ return Token of the previous value associated with specified key , or < tt > null < / tt > if there was no mapping for key . A * < tt > null < / tt > return can also indicate that the map previously associated < tt > null < / tt > with the * specified key . * @ throws ClassCastException key cannot be compared with the keys currently in the map . * @ throws NullPointerException key is < tt > null < / tt > and this map uses natural order , or its comparator does not * tolerate < tt > null < / tt > keys . * @ throws ObjectManagerException */ public synchronized Token put ( Object key , Token value , Transaction transaction ) throws ObjectManagerException { } }
return put ( key , value , transaction , false ) ;
public class PicocliRunner { /** * Obtains an instance of the specified { @ code Runnable } command class from the specified context , * injecting any beans from the specified context as required , * then parses the specified command line arguments , populating fields and methods annotated * with picocli { @ link Option @ Option } and { @ link Parameters @ Parameters } * annotations , and finally runs the command . * The caller is responsible for { @ linkplain ApplicationContext # close ( ) closing } the context . * @ param cls the Runnable command class * @ param ctx the ApplicationContext that injects dependencies into the command * @ param args the command line arguments * @ param < R > The runnable type * @ throws InitializationException if the specified command object does not have * a { @ link Command } , { @ link Option } or { @ link Parameters } annotation * @ throws ExecutionException if the Runnable throws an exception */ public static < R extends Runnable > void run ( Class < R > cls , ApplicationContext ctx , String ... args ) { } }
CommandLine . run ( cls , new MicronautFactory ( ctx ) , args ) ;
public class PolicyManager { /** * Obtains a policy or policy set of matching policies from the policy * store . If more than one policy is returned it creates a dynamic policy * set that contains all the applicable policies . * @ param eval * the Evaluation Context * @ return the Policy / PolicySet that applies to this EvaluationCtx * @ throws TopLevelPolicyException * @ throws PolicyIndexException */ public AbstractPolicy getPolicy ( EvaluationCtx eval ) throws TopLevelPolicyException , PolicyIndexException { } }
Map < String , AbstractPolicy > potentialPolicies = m_policyIndex . getPolicies ( eval , m_policyFinder ) ; logger . debug ( "Obtained policies: {}" , potentialPolicies . size ( ) ) ; AbstractPolicy policy = matchPolicies ( eval , potentialPolicies ) ; logger . debug ( "Matched policies and created abstract policy." ) ; return policy ;
public class VpnSitesConfigurationsInner { /** * Gives the sas - url to download the configurations for vpn - sites in a resource group . * @ param resourceGroupName The resource group name . * @ param virtualWANName The name of the VirtualWAN for which configuration of all vpn - sites is needed . * @ param request Parameters supplied to download vpn - sites configuration . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < Void > downloadAsync ( String resourceGroupName , String virtualWANName , GetVpnSitesConfigurationRequest request , final ServiceCallback < Void > serviceCallback ) { } }
return ServiceFuture . fromResponse ( downloadWithServiceResponseAsync ( resourceGroupName , virtualWANName , request ) , serviceCallback ) ;
public class XmlMultiConfiguration { /** * Return the set of variants defined for the given configuration . * If the given identity does not exist then an { @ code IllegalArgumentException } is thrown . If the given identity is * not variant - ed then an empty set is returned . * @ return the set of variants ; possibly empty . * @ throws IllegalArgumentException if the identity does not exist */ public Set < String > variants ( String identity ) throws IllegalArgumentException { } }
Config config = configurations . get ( identity ) ; if ( config == null ) { throw new IllegalArgumentException ( "Identity " + identity + " does not exist." ) ; } else { return config . variants ( ) ; }
public class FluentCloseableIterable { /** * Returns an { @ link Optional } containing the last element in this fluent iterable . * If the iterable is empty , { @ code Optional . absent ( ) } is returned . */ public final Optional < T > last ( ) { } }
// Iterables # getLast was inlined here so we don ' t have to throw / catch a NSEE Iterator < T > iterator = this . iterator ( ) ; if ( ! iterator . hasNext ( ) ) { return empty ( ) ; } while ( true ) { T current = iterator . next ( ) ; if ( ! iterator . hasNext ( ) ) { return Optional . of ( current ) ; } }
public class AddOnLoaderUtils { /** * Gets the passive scan rules of the given { @ code addOn } . The passive scan rules are first loaded , if they weren ' t already . * @ param addOn the add - on whose passive scan rules will be returned * @ param addOnClassLoader the { @ code AddOnClassLoader } of the given { @ code addOn } * @ return an unmodifiable { @ code List } with the passive scan rules , never { @ code null } * @ throws IllegalArgumentException if any of the parameters is { @ code null } . */ public static List < PluginPassiveScanner > getPassiveScanRules ( AddOn addOn , AddOnClassLoader addOnClassLoader ) { } }
validateNotNull ( addOn , "addOn" ) ; validateNotNull ( addOnClassLoader , "addOnClassLoader" ) ; synchronized ( addOn ) { if ( addOn . isLoadedPscanrulesSet ( ) ) { return addOn . getLoadedPscanrules ( ) ; } List < PluginPassiveScanner > pscanrules = loadDeclaredClasses ( addOnClassLoader , addOn . getPscanrules ( ) , PluginPassiveScanner . class , "pscanrule" ) ; addOn . setLoadedPscanrules ( pscanrules ) ; addOn . setLoadedPscanrulesSet ( true ) ; return Collections . unmodifiableList ( pscanrules ) ; }
public class Container { /** * Internal use of the listener API . * @ param event of class CacheEntryModifiedEvent */ @ SuppressWarnings ( { } }
"rawtypes" , "unchecked" } ) @ CacheEntryModified @ CacheEntryCreated @ Deprecated public void onCacheModification ( CacheEntryEvent event ) { if ( ! event . getKey ( ) . equals ( key ) ) return ; if ( event . isPre ( ) ) return ; try { GenericJBossMarshaller marshaller = new GenericJBossMarshaller ( ) ; byte [ ] bb = ( byte [ ] ) event . getValue ( ) ; Call call = ( Call ) marshaller . objectFromByteBuffer ( bb ) ; if ( log . isDebugEnabled ( ) ) log . debugf ( "Receive %s (isOriginLocal=%s) " , call , event . isOriginLocal ( ) ) ; callExecutor . execute ( new AtomicObjectContainerTask ( call ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; }
public class LocaleIDParser { /** * Returns the language , script , country , and variant as separate strings . */ public String [ ] getLanguageScriptCountryVariant ( ) { } }
reset ( ) ; return new String [ ] { getString ( parseLanguage ( ) ) , getString ( parseScript ( ) ) , getString ( parseCountry ( ) ) , getString ( parseVariant ( ) ) } ;
public class LabeledParsedStringDocument { /** * { @ inheritDoc } */ public String text ( ) { } }
StringBuilder sb = new StringBuilder ( nodes . length * 8 ) ; for ( int i = 0 ; i < nodes . length ; ++ i ) { String token = nodes [ i ] . word ( ) ; sb . append ( token ) ; if ( i + 1 < nodes . length ) sb . append ( ' ' ) ; } return sb . toString ( ) ;
public class IntegrationAdapter { /** * Invoked when a Message is received from a Flex client . */ @ SuppressWarnings ( { } }
"unchecked" , "rawtypes" } ) @ Override public Object invoke ( flex . messaging . messages . Message flexMessage ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "received Flex Message: " + flexMessage ) ; } Message < ? > message = null ; if ( this . extractPayload ) { Map headers = flexMessage . getHeaders ( ) ; headers . put ( FlexHeaders . MESSAGE_CLIENT_ID , flexMessage . getClientId ( ) ) ; headers . put ( FlexHeaders . DESTINATION_ID , flexMessage . getDestination ( ) ) ; headers . put ( FlexHeaders . MESSAGE_ID , flexMessage . getMessageId ( ) ) ; headers . put ( FlexHeaders . TIMESTAMP , String . valueOf ( flexMessage . getTimestamp ( ) ) ) ; if ( FlexContext . getFlexClient ( ) != null ) { headers . put ( FlexHeaders . FLEX_CLIENT_ID , FlexContext . getFlexClient ( ) . getId ( ) ) ; } long timestamp = flexMessage . getTimestamp ( ) ; message = MessageBuilder . withPayload ( flexMessage . getBody ( ) ) . copyHeaders ( headers ) . setExpirationDate ( timestamp + flexMessage . getTimeToLive ( ) ) . build ( ) ; } else { message = new GenericMessage < flex . messaging . messages . Message > ( flexMessage ) ; } this . messageChannel . send ( message ) ; return null ;
public class MsgCompiler { /** * Handles a translation consisting of a single raw text node . */ private Statement handleBasicTranslation ( List < SoyPrintDirective > escapingDirectives , Expression soyMsgParts ) { } }
// optimize for simple constant translations ( very common ) // this becomes : renderContext . getSoyMessge ( < id > ) . getParts ( ) . get ( 0 ) . getRawText ( ) SoyExpression text = SoyExpression . forString ( soyMsgParts . invoke ( MethodRef . LIST_GET , constant ( 0 ) ) . checkedCast ( SoyMsgRawTextPart . class ) . invoke ( MethodRef . SOY_MSG_RAW_TEXT_PART_GET_RAW_TEXT ) ) ; // Note : there is no point in trying to stream here , since we are starting with a constant // string . for ( SoyPrintDirective directive : escapingDirectives ) { text = parameterLookup . getRenderContext ( ) . applyPrintDirective ( directive , text ) ; } return appendableExpression . appendString ( text . coerceToString ( ) ) . toStatement ( ) ;
public class SelfExtractor { /** * Display command line usage . */ protected static void displayCommandLineHelp ( SelfExtractor extractor ) { } }
// This method takes a SelfExtractor in case we want to tailor the help to the current archive // Get the name of the JAR file to display in the command syntax " ) ; String jarName = System . getProperty ( "sun.java.command" , "wlp-liberty-developers-core.jar" ) ; String [ ] s = jarName . split ( " " ) ; jarName = s [ 0 ] ; System . out . println ( "\n" + SelfExtract . format ( "usage" ) ) ; System . out . println ( "\njava -jar " + jarName + " [" + SelfExtract . format ( "options" ) + "] [" + SelfExtract . format ( "installLocation" ) + "]\n" ) ; System . out . println ( SelfExtract . format ( "options" ) ) ; System . out . println ( " --acceptLicense" ) ; System . out . println ( " " + SelfExtract . format ( "helpAcceptLicense" ) ) ; System . out . println ( " --verbose" ) ; System . out . println ( " " + SelfExtract . format ( "helpVerbose" ) ) ; System . out . println ( " --viewLicenseAgreement" ) ; System . out . println ( " " + SelfExtract . format ( "helpAgreement" ) ) ; System . out . println ( " --viewLicenseInfo" ) ; System . out . println ( " " + SelfExtract . format ( "helpInformation" ) ) ; if ( extractor . isUserSample ( ) ) { System . out . println ( " --downloadDependencies" ) ; System . out . println ( " " + SelfExtract . format ( "helpDownloadDependencies" ) ) ; }
public class ArrayCoreMap { /** * { @ inheritDoc } */ @ SuppressWarnings ( "unchecked" ) public < VALUE , KEY extends Key < CoreMap , VALUE > > VALUE remove ( Class < KEY > key ) { } }
Object rv = null ; for ( int i = 0 ; i < size ; i ++ ) { if ( keys [ i ] == key ) { rv = values [ i ] ; if ( i < size - 1 ) { System . arraycopy ( keys , i + 1 , keys , i , size - ( i + 1 ) ) ; System . arraycopy ( values , i + 1 , values , i , size - ( i + 1 ) ) ; } size -- ; break ; } } return ( VALUE ) rv ;
public class Matrix3f { /** * Set this matrix to a rotation transformation about the X axis . * When used with a right - handed coordinate system , the produced rotation will rotate a vector * counter - clockwise around the rotation axis , when viewing along the negative axis direction towards the origin . * When used with a left - handed coordinate system , the rotation is clockwise . * Reference : < a href = " http : / / en . wikipedia . org / wiki / Rotation _ matrix # Basic _ rotations " > http : / / en . wikipedia . org < / a > * @ param ang * the angle in radians * @ return this */ public Matrix3f rotationX ( float ang ) { } }
float sin , cos ; sin = ( float ) Math . sin ( ang ) ; cos = ( float ) Math . cosFromSin ( sin , ang ) ; m00 = 1.0f ; m01 = 0.0f ; m02 = 0.0f ; m10 = 0.0f ; m11 = cos ; m12 = sin ; m20 = 0.0f ; m21 = - sin ; m22 = cos ; return this ;
public class Validate { /** * Checks if the given String is a positive integer value . < br > * This method tries to parse an integer value and then checks if it is bigger than 0. * @ param value The String value to validate . * @ return The parsed integer value * @ throws ParameterException if the given String value cannot be parsed as integer or its value is smaller or equal to 0. */ public static Integer positiveInteger ( String value ) { } }
Integer intValue = Validate . isInteger ( value ) ; positive ( intValue ) ; return intValue ;
public class BatchGetImageResult { /** * A list of image objects corresponding to the image references in the request . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setImages ( java . util . Collection ) } or { @ link # withImages ( java . util . Collection ) } if you want to override the * existing values . * @ param images * A list of image objects corresponding to the image references in the request . * @ return Returns a reference to this object so that method calls can be chained together . */ public BatchGetImageResult withImages ( Image ... images ) { } }
if ( this . images == null ) { setImages ( new java . util . ArrayList < Image > ( images . length ) ) ; } for ( Image ele : images ) { this . images . add ( ele ) ; } return this ;
public class JSONObject { /** * Maps { @ code name } to { @ code value } , clobbering any existing name / value * mapping with the same name . * @ return this object . */ public JSONObject put ( String name , long value ) throws JSONException { } }
nameValuePairs . put ( checkName ( name ) , value ) ; return this ;
public class GermanTagger { /** * Removes the irrelevant part of dash - linked words ( SSL - Zertifikat - > Zertifikat ) */ private String sanitizeWord ( String word ) { } }
String result = word ; // Find the last part of the word that is not nothing // Skip words ending in a dash as they ' ll be misrecognized if ( ! word . endsWith ( "-" ) ) { String [ ] splitWord = word . split ( "-" ) ; String lastPart = splitWord . length > 1 && ! splitWord [ splitWord . length - 1 ] . trim ( ) . equals ( "" ) ? splitWord [ splitWord . length - 1 ] : word ; // Find only the actual important part of the word List < String > compoundedWord = compoundTokenizer . tokenize ( lastPart ) ; if ( compoundedWord . size ( ) > 1 ) { lastPart = StringTools . uppercaseFirstChar ( compoundedWord . get ( compoundedWord . size ( ) - 1 ) ) ; } else { lastPart = compoundedWord . get ( compoundedWord . size ( ) - 1 ) ; } // Only give result if the last part is either a noun or an adjective ( or adjective written in Uppercase ) List < TaggedWord > tagged = tag ( lastPart ) ; if ( tagged . size ( ) > 0 && ( StringUtils . startsWithAny ( tagged . get ( 0 ) . getPosTag ( ) , "SUB" , "ADJ" ) || matchesUppercaseAdjective ( lastPart ) ) ) { result = lastPart ; } } return result ;
public class Long { /** * Returns the number of one - bits in the two ' s complement binary * representation of the specified { @ code long } value . This function is * sometimes referred to as the < i > population count < / i > . * @ param i the value whose bits are to be counted * @ return the number of one - bits in the two ' s complement binary * representation of the specified { @ code long } value . * @ since 1.5 */ public static int bitCount ( long i ) { } }
// HD , Figure 5-14 i = i - ( ( i >>> 1 ) & 0x5555555555555555L ) ; i = ( i & 0x3333333333333333L ) + ( ( i >>> 2 ) & 0x3333333333333333L ) ; i = ( i + ( i >>> 4 ) ) & 0x0f0f0f0f0f0f0f0fL ; i = i + ( i >>> 8 ) ; i = i + ( i >>> 16 ) ; i = i + ( i >>> 32 ) ; return ( int ) i & 0x7f ;
public class DataFrames { /** * Standard deviation for a column * @ param dataFrame the dataframe to * get the column from * @ param columnName the name of the column to get the standard * deviation for * @ return the column that represents the standard deviation */ public static Column std ( DataRowsFacade dataFrame , String columnName ) { } }
return functions . sqrt ( var ( dataFrame , columnName ) ) ;
public class QuartzScheduler { /** * Unschedule a job . * @ param jobName * @ param groupName * @ return true if job is found and unscheduled . * @ throws SchedulerException */ public synchronized boolean unscheduleJob ( final String jobName , final String groupName ) throws SchedulerException { } }
return this . scheduler . deleteJob ( new JobKey ( jobName , groupName ) ) ;
public class TypeCheck { /** * Visits the parameters of a CALL or a NEW node . */ private void visitArgumentList ( Node call , FunctionType functionType ) { } }
Iterator < Node > parameters = functionType . getParameters ( ) . iterator ( ) ; Iterator < Node > arguments = NodeUtil . getInvocationArgsAsIterable ( call ) . iterator ( ) ; checkArgumentsMatchParameters ( call , functionType , arguments , parameters , 0 ) ;
public class Suppliers { /** * Returns a supplier which caches the instance retrieved during the first call to { @ code get ( ) } * and returns that value on subsequent calls to { @ code get ( ) } . See : * < a href = " http : / / en . wikipedia . org / wiki / Memoization " > memoization < / a > * < p > The returned supplier is thread - safe . The delegate ' s { @ code get ( ) } method will be invoked at * most once . The supplier ' s serialized form does not contain the cached value , which will be * recalculated when { @ code get ( ) } is called on the reserialized instance . * < p > If { @ code delegate } is an instance created by an earlier call to { @ code * memoize } , it is returned directly . */ public static < T > Supplier < T > memoize ( Supplier < T > delegate ) { } }
return ( delegate instanceof MemoizingSupplier ) ? delegate : new MemoizingSupplier < T > ( Preconditions . checkNotNull ( delegate ) ) ;
public class HtmlRenderer { /** * ( non - Javadoc ) * @ see net . roboconf . doc . generator . internal . AbstractStructuredRenderer * # renderSections ( java . util . List ) */ @ Override protected String renderSections ( List < String > sectionNames ) { } }
StringBuilder sb = new StringBuilder ( ) ; if ( this . options . containsKey ( DocConstants . OPTION_HTML_EXPLODED ) ) { if ( sectionNames . size ( ) > 0 ) { sb . append ( "<ul>\n" ) ; for ( String sectionName : sectionNames ) { int index = sectionName . lastIndexOf ( '/' ) ; String title = sectionName . substring ( index + 1 ) ; sb . append ( "<li><a href=\"" ) ; sb . append ( sectionName . replace ( " " , "%20" ) ) ; sb . append ( ".html\">" ) ; sb . append ( title ) ; sb . append ( "</a></li>\n" ) ; } sb . append ( "</ul>\n" ) ; } } else { sb . append ( "\n<p class=\"separator\"> &nbsp; </p>\n" ) ; } return sb . toString ( ) ;
public class VTimeZone { /** * Writes RFC2445 VTIMEZONE data for this time zone * @ param writer A < code > Writer < / code > used for the output * @ throws IOException If there were problems creating a buffered writer or writing to it . */ public void write ( Writer writer ) throws IOException { } }
BufferedWriter bw = new BufferedWriter ( writer ) ; if ( vtzlines != null ) { for ( String line : vtzlines ) { if ( line . startsWith ( ICAL_TZURL + COLON ) ) { if ( tzurl != null ) { bw . write ( ICAL_TZURL ) ; bw . write ( COLON ) ; bw . write ( tzurl ) ; bw . write ( NEWLINE ) ; } } else if ( line . startsWith ( ICAL_LASTMOD + COLON ) ) { if ( lastmod != null ) { bw . write ( ICAL_LASTMOD ) ; bw . write ( COLON ) ; bw . write ( getUTCDateTimeString ( lastmod . getTime ( ) ) ) ; bw . write ( NEWLINE ) ; } } else { bw . write ( line ) ; bw . write ( NEWLINE ) ; } } bw . flush ( ) ; } else { String [ ] customProperties = null ; if ( olsonzid != null && ICU_TZVERSION != null ) { customProperties = new String [ 1 ] ; customProperties [ 0 ] = ICU_TZINFO_PROP + COLON + olsonzid + "[" + ICU_TZVERSION + "]" ; } writeZone ( writer , tz , customProperties ) ; }
public class GanttBarStyleFactory14 { /** * Maps an integer field ID to a field type . * @ param field field ID * @ return field type */ private TaskField getTaskField ( int field ) { } }
TaskField result = MPPTaskField14 . getInstance ( field ) ; if ( result != null ) { switch ( result ) { case START_TEXT : { result = TaskField . START ; break ; } case FINISH_TEXT : { result = TaskField . FINISH ; break ; } case DURATION_TEXT : { result = TaskField . DURATION ; break ; } default : { break ; } } } return result ;
public class ReflectionUtils { /** * Returns the getter method associated with the object ' s field . * @ param object * the object * @ param fieldName * the name of the field * @ return the getter method * @ throws NullPointerException * if object or fieldName is null * @ throws SuperCsvReflectionException * if the getter doesn ' t exist or is not visible */ public static Method findGetter ( final Object object , final String fieldName ) { } }
if ( object == null ) { throw new NullPointerException ( "object should not be null" ) ; } else if ( fieldName == null ) { throw new NullPointerException ( "fieldName should not be null" ) ; } final Class < ? > clazz = object . getClass ( ) ; // find a standard getter final String standardGetterName = getMethodNameForField ( GET_PREFIX , fieldName ) ; Method getter = findGetterWithCompatibleReturnType ( standardGetterName , clazz , false ) ; // if that fails , try for an isX ( ) style boolean getter if ( getter == null ) { final String booleanGetterName = getMethodNameForField ( IS_PREFIX , fieldName ) ; getter = findGetterWithCompatibleReturnType ( booleanGetterName , clazz , true ) ; } if ( getter == null ) { throw new SuperCsvReflectionException ( String . format ( "unable to find getter for field %s in class %s - check that the corresponding nameMapping element matches the field name in the bean" , fieldName , clazz . getName ( ) ) ) ; } return getter ;
public class CreateIdentityPoolRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateIdentityPoolRequest createIdentityPoolRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createIdentityPoolRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createIdentityPoolRequest . getIdentityPoolName ( ) , IDENTITYPOOLNAME_BINDING ) ; protocolMarshaller . marshall ( createIdentityPoolRequest . getAllowUnauthenticatedIdentities ( ) , ALLOWUNAUTHENTICATEDIDENTITIES_BINDING ) ; protocolMarshaller . marshall ( createIdentityPoolRequest . getSupportedLoginProviders ( ) , SUPPORTEDLOGINPROVIDERS_BINDING ) ; protocolMarshaller . marshall ( createIdentityPoolRequest . getDeveloperProviderName ( ) , DEVELOPERPROVIDERNAME_BINDING ) ; protocolMarshaller . marshall ( createIdentityPoolRequest . getOpenIdConnectProviderARNs ( ) , OPENIDCONNECTPROVIDERARNS_BINDING ) ; protocolMarshaller . marshall ( createIdentityPoolRequest . getCognitoIdentityProviders ( ) , COGNITOIDENTITYPROVIDERS_BINDING ) ; protocolMarshaller . marshall ( createIdentityPoolRequest . getSamlProviderARNs ( ) , SAMLPROVIDERARNS_BINDING ) ; protocolMarshaller . marshall ( createIdentityPoolRequest . getIdentityPoolTags ( ) , IDENTITYPOOLTAGS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Related { /** * An overloaded version of { @ link # with ( org . hawkular . inventory . paths . CanonicalPath , String ) } that uses one of * the { @ link org . hawkular . inventory . api . Relationships . WellKnown } as the name of the relationship . * @ param entityPath the entity that is the target of the relationship * @ param relationship the type of the relationship * @ return a new " related " filter instance */ public static Related with ( CanonicalPath entityPath , Relationships . WellKnown relationship ) { } }
return new Related ( entityPath , relationship . name ( ) , EntityRole . SOURCE ) ;
public class IntBitSet { /** * Add an element . * @ param ele the element to add */ public void add ( int ele ) { } }
int idx ; idx = ele >> SHIFT ; if ( idx >= data . length ) { resize ( idx + 1 + GROW ) ; } data [ ele >> SHIFT ] |= ( 1 << ele ) ;
public class Step { /** * Checks a checkbox type element . * @ param element * Target page element * @ param checked * Final checkbox value * @ param args * list of arguments to format the found selector with * @ throws TechnicalException * is thrown if you have a technical error ( format , configuration , datas , . . . ) in NoraUi . * Failure with { @ value com . github . noraui . utils . Messages # FAIL _ MESSAGE _ UNABLE _ TO _ CHECK _ ELEMENT } message ( with screenshot ) * @ throws FailureException * if the scenario encounters a functional error */ protected void selectCheckbox ( PageElement element , boolean checked , Object ... args ) throws TechnicalException , FailureException { } }
try { final WebElement webElement = Context . waitUntil ( ExpectedConditions . elementToBeClickable ( Utilities . getLocator ( element , args ) ) ) ; if ( webElement . isSelected ( ) != checked ) { webElement . click ( ) ; } } catch ( final Exception e ) { new Result . Failure < > ( e . getMessage ( ) , Messages . format ( Messages . getMessage ( Messages . FAIL_MESSAGE_UNABLE_TO_CHECK_ELEMENT ) , element , element . getPage ( ) . getApplication ( ) ) , true , element . getPage ( ) . getCallBack ( ) ) ; }
public class SystemInputJson { /** * Returns the AssertNotMore condition represented by the given JSON object or an empty * value if no such condition is found . */ private static Optional < ICondition > asNotMoreThan ( JsonObject json ) { } }
return Optional . of ( json ) . filter ( j -> j . containsKey ( NOT_MORE_THAN_KEY ) ) . map ( j -> j . getJsonObject ( NOT_MORE_THAN_KEY ) ) . map ( a -> new AssertNotMore ( a . getString ( PROPERTY_KEY ) , a . getInt ( MAX_KEY ) ) ) ;
public class JPAAuditLogService { /** * / * ( non - Javadoc ) * @ see org . jbpm . process . audit . AuditLogService # findVariableInstances ( long ) */ @ Override public List < VariableInstanceLog > findVariableInstances ( long processInstanceId ) { } }
EntityManager em = getEntityManager ( ) ; Query query = em . createQuery ( "FROM VariableInstanceLog v WHERE v.processInstanceId = :processInstanceId ORDER BY date" ) . setParameter ( "processInstanceId" , processInstanceId ) ; return executeQuery ( query , em , VariableInstanceLog . class ) ;
public class EmbeddedPostgresRules { /** * Returns a { @ link TestRule } to create a Postgres cluster , shared amongst all test cases in this JVM . * The rule contributes { @ link Config } switches to configure each test case to get its own database . */ public static EmbeddedPostgresTestDatabaseRule embeddedDatabaseRule ( @ Nonnull final URI baseUri , final String ... personalities ) { } }
return new EmbeddedPostgresTestDatabaseRule ( baseUri , personalities ) ;
public class Isotopes { /** * Clear the isotope information from atoms that are major isotopes ( e . g . * < sup > 12 < / sup > C , < sup > 1 < / sup > H , etc ) . * @ param mol the molecule */ public static void clearMajorIsotopes ( IAtomContainer mol ) { } }
for ( IAtom atom : mol . atoms ( ) ) if ( isMajor ( atom ) ) { atom . setMassNumber ( null ) ; atom . setExactMass ( null ) ; atom . setNaturalAbundance ( null ) ; }
public class ListEntitlementsResult { /** * A list of entitlements that have been granted to you from other AWS accounts . * @ param entitlements * A list of entitlements that have been granted to you from other AWS accounts . */ public void setEntitlements ( java . util . Collection < ListedEntitlement > entitlements ) { } }
if ( entitlements == null ) { this . entitlements = null ; return ; } this . entitlements = new java . util . ArrayList < ListedEntitlement > ( entitlements ) ;
public class ContentMatcher { /** * Implementation of put method ( handles vacantChild ; overriding methods handle * everything else ) . */ void put ( Conjunction selector , MatchTarget object , InternTable subExpr ) throws MatchingException { } }
vacantChild = nextMatcher ( selector , vacantChild ) ; vacantChild . put ( selector , object , subExpr ) ;
public class XmlUtil { /** * Create a new DocumentBuilder configured for namespaces but not validating . * @ return a new , configured DocumentBuilder */ public static DocumentBuilder newDocumentBuilder ( ) { } }
try { return PARSER_FACTORY . newDocumentBuilder ( ) ; } catch ( ParserConfigurationException e ) { throw ( Error ) new AssertionError ( ) . initCause ( e ) ; }
public class WebSiteManagementClientImpl { /** * List all premier add - on offers . * List all premier add - on offers . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; PremierAddOnOfferInner & gt ; object */ public Observable < Page < PremierAddOnOfferInner > > listPremierAddOnOffersNextAsync ( final String nextPageLink ) { } }
return listPremierAddOnOffersNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < PremierAddOnOfferInner > > , Page < PremierAddOnOfferInner > > ( ) { @ Override public Page < PremierAddOnOfferInner > call ( ServiceResponse < Page < PremierAddOnOfferInner > > response ) { return response . body ( ) ; } } ) ;
public class KernelBootstrap { /** * Get the runtime build version based on the information in the manifest of the * kernel jar : this is not authoritative , as it won ' t include information about * applied iFixes , etc . */ public static void showVersion ( BootstrapConfig bootProps ) { } }
BootstrapManifest bootManifest ; try { bootManifest = BootstrapManifest . readBootstrapManifest ( Boolean . parseBoolean ( bootProps . get ( BootstrapConstants . LIBERTY_BOOT_PROPERTY ) ) ) ; String kernelVersion = bootManifest . getBundleVersion ( ) ; String productInfo = getProductInfoDisplayName ( ) ; processVersion ( bootProps , "info.serverVersion" , kernelVersion , productInfo , true ) ; } catch ( IOException e ) { throw new LaunchException ( "Could not read the jar manifest" , BootstrapConstants . messages . getString ( "error.unknown.kernel.version" ) , e ) ; }
public class ClassInfoList { /** * Find the intersection of this { @ link ClassInfoList } with one or more others . * @ param others * The other { @ link ClassInfoList } s to intersect with this one . * @ return The intersection of this { @ link ClassInfoList } with the others . */ public ClassInfoList intersect ( final ClassInfoList ... others ) { } }
// Put the first ClassInfoList that is not being sorted by name at the head of the list , // so that its order is preserved in the intersection ( # 238) final ArrayDeque < ClassInfoList > intersectionOrder = new ArrayDeque < > ( ) ; intersectionOrder . add ( this ) ; boolean foundFirst = false ; for ( final ClassInfoList other : others ) { if ( other . sortByName ) { intersectionOrder . add ( other ) ; } else if ( ! foundFirst ) { foundFirst = true ; intersectionOrder . push ( other ) ; } else { intersectionOrder . add ( other ) ; } } final ClassInfoList first = intersectionOrder . remove ( ) ; final Set < ClassInfo > reachableClassesIntersection = new LinkedHashSet < > ( first ) ; while ( ! intersectionOrder . isEmpty ( ) ) { reachableClassesIntersection . retainAll ( intersectionOrder . remove ( ) ) ; } final Set < ClassInfo > directlyRelatedClassesIntersection = new LinkedHashSet < > ( directlyRelatedClasses ) ; for ( final ClassInfoList other : others ) { directlyRelatedClassesIntersection . retainAll ( other . directlyRelatedClasses ) ; } return new ClassInfoList ( reachableClassesIntersection , directlyRelatedClassesIntersection , first . sortByName ) ;
public class JaxRsClientFactory { /** * Create a new { @ link Client } instance with the given name and groups . * You own the returned client and are responsible for managing its cleanup . */ public Client newClient ( String clientName , JaxRsFeatureGroup feature , JaxRsFeatureGroup ... moreFeatures ) { } }
return newBuilder ( clientName , feature , moreFeatures ) . build ( ) ;
public class GenerateHalDocsJsonMojo { /** * Get short description anlogous to javadoc method tile : Strip out all HTML tags and use only * the first sentence from the description . * @ param descriptionMarkup Description markup . * @ return Title or null if none defined */ private static String buildShortDescription ( String descriptionMarkup ) { } }
if ( StringUtils . isBlank ( descriptionMarkup ) ) { return null ; } String text = Jsoup . parse ( descriptionMarkup ) . text ( ) ; if ( StringUtils . isBlank ( text ) ) { return null ; } if ( StringUtils . contains ( text , "." ) ) { return StringUtils . substringBefore ( text , "." ) + "." ; } else { return StringUtils . trim ( text ) ; }
public class JsonDeserializer { /** * TODO faster and less new ( ) */ public Number deserializeNumber ( String s ) { } }
if ( s . indexOf ( '.' ) >= 0 || s . indexOf ( 'e' ) >= 0 || s . indexOf ( 'E' ) >= 0 ) { return Double . valueOf ( s ) ; } else { Long l = Long . valueOf ( s ) ; if ( l > Integer . MAX_VALUE || l < Integer . MIN_VALUE ) { return l ; } else { return new Integer ( l . intValue ( ) ) ; } }
public class CommerceAccountOrganizationRelPersistenceImpl { /** * Removes the commerce account organization rel with the primary key from the database . Also notifies the appropriate model listeners . * @ param primaryKey the primary key of the commerce account organization rel * @ return the commerce account organization rel that was removed * @ throws NoSuchAccountOrganizationRelException if a commerce account organization rel with the primary key could not be found */ @ Override public CommerceAccountOrganizationRel remove ( Serializable primaryKey ) throws NoSuchAccountOrganizationRelException { } }
Session session = null ; try { session = openSession ( ) ; CommerceAccountOrganizationRel commerceAccountOrganizationRel = ( CommerceAccountOrganizationRel ) session . get ( CommerceAccountOrganizationRelImpl . class , primaryKey ) ; if ( commerceAccountOrganizationRel == null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } throw new NoSuchAccountOrganizationRelException ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } return remove ( commerceAccountOrganizationRel ) ; } catch ( NoSuchAccountOrganizationRelException nsee ) { throw nsee ; } catch ( Exception e ) { throw processException ( e ) ; } finally { closeSession ( session ) ; }
public class StrategicExecutors { /** * Return a capped { @ link BalancingThreadPoolExecutor } with the given * maximum number of threads , target utilization , smoothing weight , and * balance after values . * @ param maxThreads maximum number of threads to use * @ param targetUtilization a float between 0.0 and 1.0 representing the * percentage of the total CPU time to be used by * this pool * @ param smoothingWeight smooth out the averages of the CPU and wait time * over time such that tasks aren ' t too heavily * skewed with old or spiking data * @ param balanceAfter balance the thread pool after this many tasks * have run */ public static BalancingThreadPoolExecutor newBalancingThreadPoolExecutor ( int maxThreads , float targetUtilization , float smoothingWeight , int balanceAfter ) { } }
ThreadPoolExecutor tpe = new ThreadPoolExecutor ( 1 , maxThreads , 60L , TimeUnit . SECONDS , new SynchronousQueue < Runnable > ( ) , new CallerBlocksPolicy ( ) ) ; return newBalancingThreadPoolExecutor ( tpe , targetUtilization , smoothingWeight , balanceAfter ) ;
public class ResultUtils { /** * Convert result object to array . * @ param result result object * @ param entityType target entity type * @ param projection true to apply projection , false otherwise * @ return converted result */ @ SuppressWarnings ( "PMD.LooseCoupling" ) public static Object convertToArray ( final Object result , final Class entityType , final boolean projection ) { } }
final Collection res = result instanceof Collection // no projection because its applied later ? ( Collection ) result : convertToCollectionImpl ( result , ArrayList . class , entityType , false ) ; final Object array = Array . newInstance ( entityType , res . size ( ) ) ; int i = 0 ; for ( Object obj : res ) { Array . set ( array , i ++ , projection ? applyProjection ( obj , entityType ) : obj ) ; } return array ;
public class OpenAnalysisJobActionListener { /** * Opens a job file * @ param file * @ return */ public Injector openAnalysisJob ( final FileObject file ) { } }
final JaxbJobReader reader = new JaxbJobReader ( _configuration ) ; try { final AnalysisJobBuilder ajb = reader . create ( file ) ; return openAnalysisJob ( file , ajb ) ; } catch ( final NoSuchComponentException e ) { final String message ; if ( Version . EDITION_COMMUNITY . equals ( Version . getEdition ( ) ) ) { message = "<html><p>Failed to open job because of a missing component:</p><pre>" + e . getMessage ( ) + "</pre><p>This may happen if the job requires a " + "<a href=\"https://www.quadient.com/products/quadient-datacleaner#get-started-today\">" + "Commercial Edition of DataCleaner</a>, or an extension that you do not have installed.</p>" + "</html>" ; } else { message = "<html>Failed to open job because of a missing component: " + e . getMessage ( ) + "<br/><br/>" + "This may happen if the job requires an extension that you do not have installed.</html>" ; } WidgetUtils . showErrorMessage ( "Cannot open job" , message ) ; return null ; } catch ( final NoSuchDatastoreException e ) { if ( _windowContext == null ) { // This can happen in case of single - datastore + job file // bootstrapping of DC throw e ; } final AnalysisJobMetadata metadata = reader . readMetadata ( file ) ; final int result = JOptionPane . showConfirmDialog ( null , e . getMessage ( ) + "\n\nDo you wish to open this job as a template?" , "Error: " + e . getMessage ( ) , JOptionPane . OK_CANCEL_OPTION , JOptionPane . ERROR_MESSAGE ) ; if ( result == JOptionPane . OK_OPTION ) { final OpenAnalysisJobAsTemplateDialog dialog = new OpenAnalysisJobAsTemplateDialog ( _windowContext , _configuration , file , metadata , Providers . of ( this ) ) ; dialog . setVisible ( true ) ; } return null ; } catch ( final ComponentConfigurationException e ) { final String message ; final Throwable cause = e . getCause ( ) ; if ( cause != null ) { // check for causes of the mis - configuration . If there ' s a cause // with a message , then show the message first and foremost // ( usually a validation error ) . if ( ! Strings . isNullOrEmpty ( cause . getMessage ( ) ) ) { message = cause . getMessage ( ) ; } else { message = e . getMessage ( ) ; } } else { message = e . getMessage ( ) ; } WidgetUtils . showErrorMessage ( "Failed to validate job configuration" , message , e ) ; return null ; } catch ( final RuntimeException e ) { logger . error ( "Unexpected failure when opening job: {}" , file , e ) ; throw e ; }
public class TabbedPane { /** * { @ inheritDoc } */ @ Override public void insertTab ( String title , Icon icon , Component component , String tip , int index ) { } }
super . insertTab ( title , icon , component , tip , index ) ; setTabComponentAt ( index , new MButtonTabComponent ( this ) ) ;
public class DefaultConvertableBindingBuilder { /** * { @ inheritDoc } */ public < U > TargetValidatableBindingBuilder < S , U , V > using ( Converter < S , U > converter ) { } }
return new DefaultTargetValidatableBindingBuilder < S , U , V > ( getSource ( ) , getSourceValidator ( ) , converter , getCallback ( ) ) ;
public class InventoryConfiguration { /** * Add a field to the list of optional fields that are included in the inventory results . */ public void addOptionalField ( InventoryOptionalField optionalField ) { } }
addOptionalField ( optionalField == null ? ( String ) null : optionalField . toString ( ) ) ;
public class TwitterEndpointServices { /** * Computes the signature for an authorized request per { @ link https : / / dev . twitter . com / oauth / overview / creating - signatures } * @ param requestMethod * @ param targetUrl * @ param params * @ param consumerSecret * @ param tokenSecret * @ return */ public String computeSignature ( String requestMethod , String targetUrl , Map < String , String > params , @ Sensitive String consumerSecret , @ Sensitive String tokenSecret ) { } }
String signatureBaseString = createSignatureBaseString ( requestMethod , targetUrl , params ) ; // Hash the base string using the consumer secret ( and request token secret , if known ) as a key String signature = "" ; try { String secretToEncode = null ; if ( consumerSecret != null ) { secretToEncode = consumerSecret ; } StringBuilder keyString = new StringBuilder ( Utils . percentEncodeSensitive ( secretToEncode ) ) . append ( "&" ) ; if ( tokenSecret != null ) { keyString . append ( Utils . percentEncodeSensitive ( tokenSecret ) ) ; } signature = computeSha1Signature ( signatureBaseString , keyString . toString ( ) ) ; } catch ( GeneralSecurityException e ) { Tr . warning ( tc , "TWITTER_ERROR_CREATING_SIGNATURE" , new Object [ ] { e . getLocalizedMessage ( ) } ) ; } catch ( UnsupportedEncodingException e ) { // Should be using UTF - 8 encoding , so this should be highly unlikely if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Caught unexpected exception: " + e . getLocalizedMessage ( ) , e ) ; } } return signature ;
public class ServicesInner { /** * Start service . * The services resource is the top - level resource that represents the Data Migration Service . This action starts the service and the service can be used for data migration . * @ param groupName Name of the resource group * @ param serviceName Name of the service * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < Void > startAsync ( String groupName , String serviceName , final ServiceCallback < Void > serviceCallback ) { } }
return ServiceFuture . fromResponse ( startWithServiceResponseAsync ( groupName , serviceName ) , serviceCallback ) ;
public class ProfileWriterImpl { /** * { @ inheritDoc } */ public Content getProfileHeader ( String heading ) { } }
String profileName = profile . name ; Content bodyTree = getBody ( true , getWindowTitle ( profileName ) ) ; addTop ( bodyTree ) ; addNavLinks ( true , bodyTree ) ; HtmlTree div = new HtmlTree ( HtmlTag . DIV ) ; div . addStyle ( HtmlStyle . header ) ; Content tHeading = HtmlTree . HEADING ( HtmlConstants . TITLE_HEADING , true , HtmlStyle . title , profileLabel ) ; tHeading . addContent ( getSpace ( ) ) ; Content profileHead = new RawHtml ( heading ) ; tHeading . addContent ( profileHead ) ; div . addContent ( tHeading ) ; bodyTree . addContent ( div ) ; return bodyTree ;
public class StoreFactoryImpl { /** * Creates the default factory implementation . * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public static StoreFactory init ( ) { } }
try { StoreFactory theStoreFactory = ( StoreFactory ) EPackage . Registry . INSTANCE . getEFactory ( StorePackage . eNS_URI ) ; if ( theStoreFactory != null ) { return theStoreFactory ; } } catch ( Exception exception ) { EcorePlugin . INSTANCE . log ( exception ) ; } return new StoreFactoryImpl ( ) ;
public class HttpUtil { /** * configure custom proxy properties from connectionPropertiesMap */ public static void configureCustomProxyProperties ( Map < SFSessionProperty , Object > connectionPropertiesMap ) { } }
if ( connectionPropertiesMap . containsKey ( SFSessionProperty . USE_PROXY ) ) { useProxy = ( boolean ) connectionPropertiesMap . get ( SFSessionProperty . USE_PROXY ) ; } if ( useProxy ) { proxyHost = ( String ) connectionPropertiesMap . get ( SFSessionProperty . PROXY_HOST ) ; proxyPort = Integer . parseInt ( connectionPropertiesMap . get ( SFSessionProperty . PROXY_PORT ) . toString ( ) ) ; proxyUser = ( String ) connectionPropertiesMap . get ( SFSessionProperty . PROXY_USER ) ; proxyPassword = ( String ) connectionPropertiesMap . get ( SFSessionProperty . PROXY_PASSWORD ) ; nonProxyHosts = ( String ) connectionPropertiesMap . get ( SFSessionProperty . NON_PROXY_HOSTS ) ; }
public class RegistriesInner { /** * Creates a container registry with the specified parameters . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param registry The parameters for creating a container registry . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the RegistryInner object if successful . */ public RegistryInner beginCreate ( String resourceGroupName , String registryName , RegistryInner registry ) { } }
return beginCreateWithServiceResponseAsync ( resourceGroupName , registryName , registry ) . toBlocking ( ) . single ( ) . body ( ) ;
public class CloseHelper { /** * Close a { @ link java . lang . AutoCloseable } dealing with nulls and exceptions . * This version re - throws exceptions as runtime exceptions . * @ param closeable to be closed . */ public static void close ( final AutoCloseable closeable ) { } }
try { if ( null != closeable ) { closeable . close ( ) ; } } catch ( final Exception e ) { LangUtil . rethrowUnchecked ( e ) ; }
public class PrimaveraDatabaseReader { /** * Populate data for analytics . */ private void processAnalytics ( ) throws SQLException { } }
allocateConnection ( ) ; try { DatabaseMetaData meta = m_connection . getMetaData ( ) ; String productName = meta . getDatabaseProductName ( ) ; if ( productName == null || productName . isEmpty ( ) ) { productName = "DATABASE" ; } else { productName = productName . toUpperCase ( ) ; } ProjectProperties properties = m_reader . getProject ( ) . getProjectProperties ( ) ; properties . setFileApplication ( "Primavera" ) ; properties . setFileType ( productName ) ; } finally { releaseConnection ( ) ; }
public class BinaryEllipseDetector { /** * Detects ellipses inside the binary image and refines the edges for all detections inside the gray image * @ param gray Grayscale image * @ param binary Binary image of grayscale . 1 = ellipse and 0 = ignored background */ public void process ( T gray , GrayU8 binary ) { } }
results . reset ( ) ; ellipseDetector . process ( binary ) ; if ( ellipseRefiner != null ) ellipseRefiner . setImage ( gray ) ; intensityCheck . setImage ( gray ) ; List < BinaryEllipseDetectorPixel . Found > found = ellipseDetector . getFound ( ) ; for ( BinaryEllipseDetectorPixel . Found f : found ) { if ( ! intensityCheck . process ( f . ellipse ) ) { if ( verbose ) System . out . println ( "Rejecting ellipse. Initial fit didn't have intense enough edge" ) ; continue ; } EllipseInfo r = results . grow ( ) ; r . contour = f . contour ; if ( ellipseRefiner != null ) { if ( ! ellipseRefiner . process ( f . ellipse , r . ellipse ) ) { if ( verbose ) System . out . println ( "Rejecting ellipse. Refined fit didn't have an intense enough edge" ) ; results . removeTail ( ) ; continue ; } else if ( ! intensityCheck . process ( f . ellipse ) ) { if ( verbose ) System . out . println ( "Rejecting ellipse. Refined fit didn't have an intense enough edge" ) ; continue ; } } else { r . ellipse . set ( f . ellipse ) ; } r . averageInside = intensityCheck . averageInside ; r . averageOutside = intensityCheck . averageOutside ; }
public class JobRunner { /** * Add useful JVM arguments so it is easier to map a running Java process to a flow , execution id * and job */ private void insertJVMAargs ( ) { } }
final String flowName = this . node . getParentFlow ( ) . getFlowId ( ) ; final String jobId = this . node . getId ( ) ; String jobJVMArgs = String . format ( "'-Dazkaban.flowid=%s' '-Dazkaban.execid=%s' '-Dazkaban.jobid=%s'" , flowName , this . executionId , jobId ) ; final String previousJVMArgs = this . props . get ( JavaProcessJob . JVM_PARAMS ) ; jobJVMArgs += ( previousJVMArgs == null ) ? "" : " " + previousJVMArgs ; this . logger . info ( "job JVM args: " + jobJVMArgs ) ; this . props . put ( JavaProcessJob . JVM_PARAMS , jobJVMArgs ) ;
public class Element { /** * ( non - Javadoc ) * @ see * qc . automation . framework . widget . IElement # waitForNotAttribute ( java . lang * . String , java . lang . String , java . lang . Long ) */ @ Override public void waitForNotAttribute ( String attributeName , String pattern , long timeout ) throws WidgetException { } }
waitForAttributePatternMatcher ( attributeName , pattern , timeout , false ) ;
public class RythmEngine { /** * Restart the engine with an exception as the cause . * < p > < b > Note < / b > , this is not supposed to be called by user application < / p > * @ param cause */ public void restart ( RuntimeException cause ) { } }
if ( isProdMode ( ) ) throw cause ; if ( ! ( cause instanceof ClassReloadException ) ) { String msg = cause . getMessage ( ) ; if ( cause instanceof RythmException ) { RythmException re = ( RythmException ) cause ; msg = re . getSimpleMessage ( ) ; } logger . warn ( "restarting rythm engine due to %s" , msg ) ; } restart ( ) ;
public class JQLChecker { /** * Retrieve set of projected field . * @ param jqlContext * the jql context * @ param jqlValue * the jql value * @ param entity * the entity * @ return the sets the */ public Set < JQLProjection > extractProjections ( final JQLContext jqlContext , String jqlValue , final Finder < SQLProperty > entity ) { } }
final Set < JQLProjection > result = new LinkedHashSet < JQLProjection > ( ) ; final One < Boolean > projection = new One < Boolean > ( null ) ; analyzeInternal ( jqlContext , jqlValue , new JqlBaseListener ( ) { @ Override public void enterProjected_columns ( Projected_columnsContext ctx ) { if ( projection . value0 == null ) { projection . value0 = true ; } } @ Override public void exitProjected_columns ( Projected_columnsContext ctx ) { projection . value0 = false ; } @ Override public void enterResult_column ( Result_columnContext ctx ) { if ( projection . value0 != true ) return ; ProjectionBuilder builder = ProjectionBuilder . create ( ) ; if ( ctx . getText ( ) . endsWith ( "*" ) ) { builder . type ( ProjectionType . STAR ) ; } else if ( ctx . table_name ( ) != null ) { builder . table ( ctx . expr ( ) . table_name ( ) . getText ( ) ) ; } else if ( ctx . expr ( ) . column_fully_qualified_name ( ) != null && ctx . expr ( ) . column_fully_qualified_name ( ) . column_simple_name ( ) != null ) { Finder < SQLProperty > currentEntity = entity ; if ( ctx . expr ( ) . column_fully_qualified_name ( ) . table_simple_name ( ) != null ) { String entityName = ctx . expr ( ) . column_fully_qualified_name ( ) . table_simple_name ( ) . getText ( ) ; builder . table ( entityName ) ; currentEntity = jqlContext . findEntityByName ( entityName ) ; } String jqlColumnName = ctx . expr ( ) . column_fully_qualified_name ( ) . column_simple_name ( ) . getText ( ) ; builder . column ( jqlColumnName ) ; SQLProperty property = currentEntity . findPropertyByName ( jqlColumnName ) ; AssertKripton . assertTrueOrUnknownPropertyInJQLException ( property != null , jqlContext , jqlColumnName ) ; builder . property ( property ) ; builder . type ( ProjectionType . COLUMN ) ; if ( ctx . column_alias ( ) != null ) { String columnAlias = ctx . column_alias ( ) . getText ( ) ; SQLProperty property1 = entity . findPropertyByName ( columnAlias ) ; AssertKripton . assertTrueOrUnknownPropertyInJQLException ( property1 != null , jqlContext , columnAlias ) ; builder . property ( property1 ) ; // builder . type ( ProjectionType . COLUMN ) ; builder . alias ( columnAlias ) ; } } else { builder . type ( ProjectionType . COMPLEX ) ; builder . expression ( ctx . expr ( ) . getText ( ) ) ; if ( ctx . column_alias ( ) != null ) { String columnAlias = ctx . column_alias ( ) . getText ( ) ; builder . alias ( columnAlias ) ; } } result . add ( builder . build ( ) ) ; } @ Override public void exitResult_column ( Result_columnContext ctx ) { } } ) ; if ( result . size ( ) == 1 && result . toArray ( new JQLProjection [ 1 ] ) [ 0 ] . type == ProjectionType . STAR ) { // the projected columns are full result . clear ( ) ; if ( entity != null ) { for ( SQLProperty item : entity . getCollection ( ) ) { JQLProjection col = new JQLProjection ( ProjectionType . COLUMN , entity . getSimpleName ( ) , item . getName ( ) , null , null , item ) ; result . add ( col ) ; } } } return result ;
public class UtilValidate { /** * Checks to see if the cc number is a valid Master Card number * @ param cc a string representing a credit card number ; Sample number : 5500 0000 0000 0004(16 digits ) * @ return true , if the credit card number is a valid MasterCard number , false otherwise */ public static boolean isMasterCard ( String cc ) { } }
int firstdig = Integer . parseInt ( cc . substring ( 0 , 1 ) ) ; int seconddig = Integer . parseInt ( cc . substring ( 1 , 2 ) ) ; if ( ( cc . length ( ) == 16 ) && ( firstdig == 5 ) && ( ( seconddig >= 1 ) && ( seconddig <= 5 ) ) ) return isCreditCard ( cc ) ; return false ;
public class Sanitizers { /** * Checks that the input is a valid HTML attribute name with normal keyword or textual content or * known safe attribute content . */ public static String filterHtmlAttributes ( SoyValue value ) { } }
value = normalizeNull ( value ) ; if ( isSanitizedContentOfKind ( value , SanitizedContent . ContentKind . ATTRIBUTES ) ) { // We ' re guaranteed to be in a case where key = value pairs are expected . However , if it would // cause issues to directly abut this with more attributes , add a space . For example : // { $ a } { $ b } where $ a is foo = bar and $ b is boo = baz requires a space in between to be parsed // correctly , but not in the case where $ a is foo = " bar " . // TODO : We should be able to get rid of this if the compiler can guarantee spaces between // adjacent print statements in attribute context at compile time . String content = value . coerceToString ( ) ; if ( content . length ( ) > 0 ) { if ( shouldAppendSpace ( content . charAt ( content . length ( ) - 1 ) ) ) { content += ' ' ; } } return content ; } return filterHtmlAttributes ( value . coerceToString ( ) ) ;
public class BoltSendableResponseCallback { /** * 初始化数据 */ protected void init ( ) { } }
// 从ThreadLocal取出当前长连接 , request等信息设置进去 , 需要接到请求时提前设置到ThreadLocal里 RpcInternalContext context = RpcInternalContext . getContext ( ) ; asyncContext = ( AsyncContext ) context . getAttachment ( RpcConstants . HIDDEN_KEY_ASYNC_CONTEXT ) ; request = ( SofaRequest ) context . getAttachment ( RpcConstants . HIDDEN_KEY_ASYNC_REQUEST ) ;
public class ClassRenamer { /** * Rename a type - changing it to specified new name ( which should be the dotted form of the name ) . Retargets are an * optional sequence of retargets to also perform during the rename . Retargets take the form of " a . b : a . c " which will * change all references to a . b to a . c . * @ param dottedNewName dotted name , e . g . com . foo . Bar * @ param classbytes the bytecode for the class to be renamed * @ param retargets retarget rules for references , of the form " a . b : b . a " , " c . d : d . c " * @ return bytecode for the modified class */ public static byte [ ] rename ( String dottedNewName , byte [ ] classbytes , String ... retargets ) { } }
ClassReader fileReader = new ClassReader ( classbytes ) ; RenameAdapter renameAdapter = new RenameAdapter ( dottedNewName , retargets ) ; fileReader . accept ( renameAdapter , 0 ) ; byte [ ] renamed = renameAdapter . getBytes ( ) ; return renamed ;
public class JwkSetConverter { /** * Creates a { @ link RsaJwkDefinition } based on the supplied attributes . * @ param attributes the attributes used to create the { @ link RsaJwkDefinition } * @ return a { @ link JwkDefinition } representation of a RSA Key * @ throws JwkException if at least one attribute value is missing or invalid for a RSA Key */ private JwkDefinition createRsaJwkDefinition ( Map < String , String > attributes ) { } }
// kid String keyId = attributes . get ( KEY_ID ) ; if ( ! StringUtils . hasText ( keyId ) ) { throw new JwkException ( KEY_ID + " is a required attribute for a JWK." ) ; } // use JwkDefinition . PublicKeyUse publicKeyUse = JwkDefinition . PublicKeyUse . fromValue ( attributes . get ( PUBLIC_KEY_USE ) ) ; if ( ! JwkDefinition . PublicKeyUse . SIG . equals ( publicKeyUse ) ) { throw new JwkException ( ( publicKeyUse != null ? publicKeyUse . value ( ) : "unknown" ) + " (" + PUBLIC_KEY_USE + ") is currently not supported." ) ; } // alg JwkDefinition . CryptoAlgorithm algorithm = JwkDefinition . CryptoAlgorithm . fromHeaderParamValue ( attributes . get ( ALGORITHM ) ) ; if ( algorithm != null && ! JwkDefinition . CryptoAlgorithm . RS256 . equals ( algorithm ) && ! JwkDefinition . CryptoAlgorithm . RS384 . equals ( algorithm ) && ! JwkDefinition . CryptoAlgorithm . RS512 . equals ( algorithm ) ) { throw new JwkException ( algorithm . standardName ( ) + " (" + ALGORITHM + ") is currently not supported." ) ; } String modulus = attributes . get ( RSA_PUBLIC_KEY_MODULUS ) ; if ( ! StringUtils . hasText ( modulus ) ) { throw new JwkException ( RSA_PUBLIC_KEY_MODULUS + " is a required attribute for a RSA JWK." ) ; } String exponent = attributes . get ( RSA_PUBLIC_KEY_EXPONENT ) ; if ( ! StringUtils . hasText ( exponent ) ) { throw new JwkException ( RSA_PUBLIC_KEY_EXPONENT + " is a required attribute for a RSA JWK." ) ; } RsaJwkDefinition jwkDefinition = new RsaJwkDefinition ( keyId , publicKeyUse , algorithm , modulus , exponent ) ; return jwkDefinition ;
public class Symtab { /** * Enter a class into symbol table . * @ param s The name of the class . */ private Type enterClass ( String s ) { } }
return reader . enterClass ( names . fromString ( s ) ) . type ;
public class VerbalExpression { /** * Extract exact group from string * @ param toTest - string to extract from * @ param group - group to extract * @ return extracted group * @ since 1.1 */ public String getText ( final String toTest , final int group ) { } }
Matcher m = pattern . matcher ( toTest ) ; StringBuilder result = new StringBuilder ( ) ; while ( m . find ( ) ) { result . append ( m . group ( group ) ) ; } return result . toString ( ) ;
public class ConfluenceGreenPepper { /** * < p > getPlatformTransactionManager . < / p > * @ return a { @ link org . springframework . transaction . PlatformTransactionManager } object . */ public PlatformTransactionManager getPlatformTransactionManager ( ) { } }
if ( transactionManager != null ) { return transactionManager ; } transactionManager = ( PlatformTransactionManager ) ContainerManager . getComponent ( "transactionManager" ) ; return transactionManager ;
public class TraceFactory { /** * Create a platform specific TraceFactory instance . * @ param nls instance which holds the message catalogue to be used for info tracing . * @ return TraceFactory instance loaded . */ public static TraceFactory getTraceFactory ( NLS nls ) { } }
return ( TraceFactory ) Utils . getImpl ( "com.ibm.ws.objectManager.utils.TraceFactoryImpl" , new Class [ ] { NLS . class } , new Object [ ] { nls } ) ;
public class FirestoreAdminClient { /** * Lists the field configuration and metadata for this database . * < p > Currently , [ FirestoreAdmin . ListFields ] [ google . firestore . admin . v1 . FirestoreAdmin . ListFields ] * only supports listing fields that have been explicitly overridden . To issue this query , call * [ FirestoreAdmin . ListFields ] [ google . firestore . admin . v1 . FirestoreAdmin . ListFields ] with the * filter set to ` indexConfig . usesAncestorConfig : false ` . * < p > Sample code : * < pre > < code > * try ( FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient . create ( ) ) { * ParentName parent = ParentName . of ( " [ PROJECT ] " , " [ DATABASE ] " , " [ COLLECTION _ ID ] " ) ; * for ( Field element : firestoreAdminClient . listFields ( parent ) . iterateAll ( ) ) { * / / doThingsWith ( element ) ; * < / code > < / pre > * @ param parent A parent name of the form * ` projects / { project _ id } / databases / { database _ id } / collectionGroups / { collection _ id } ` * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ public final ListFieldsPagedResponse listFields ( ParentName parent ) { } }
ListFieldsRequest request = ListFieldsRequest . newBuilder ( ) . setParent ( parent == null ? null : parent . toString ( ) ) . build ( ) ; return listFields ( request ) ;
public class WSController { /** * Return locale of client * @ param request * @ return */ Locale getLocale ( HandshakeRequest request ) { } }
if ( null != request ) { Map < String , List < String > > headers = request . getHeaders ( ) ; if ( null != headers ) { List < String > accepts = headers . get ( HttpHeaders . ACCEPT_LANGUAGE ) ; logger . debug ( "Get accept-language from client headers : {}" , accepts ) ; if ( null != accepts ) { for ( String accept : accepts ) { try { return localeExtractor . extractFromAccept ( accept ) ; } catch ( LocaleNotFoundException ex ) { } } } } } return Locale . US ;
public class MSExcelOOXMLSignUtil { /** * Cleans up tempfolder * @ throws IOException */ public void close ( ) throws IOException { } }
try { if ( this . tempSignFileOS != null ) { this . tempSignFileOS . close ( ) ; } } finally { if ( ! this . tempSignFile . delete ( ) ) { LOG . warn ( "Could not delete temporary files used for signing" ) ; } }
public class WeekdaySet { /** * This method encodes the given { @ code set } to a bit - mask for { @ link # getValue ( ) } . * @ param weekdays are the { @ link Weekday } s . * @ return the encoded { @ link # getValue ( ) value } . */ private static int encode ( Weekday ... weekdays ) { } }
int bitmask = 0 ; for ( Weekday weekday : weekdays ) { bitmask = bitmask | ( 1 << weekday . ordinal ( ) ) ; } return bitmask ;
public class StringPrefixIterator { /** * / * ( non - Javadoc ) * @ see java . util . Iterator # hasNext ( ) */ public boolean hasNext ( ) { } }
if ( done ) return false ; if ( cachedNext != null ) { return true ; } while ( inner . hasNext ( ) ) { String tmp = inner . next ( ) ; if ( tmp . startsWith ( prefix ) ) { cachedNext = tmp ; return true ; } else if ( tmp . compareTo ( prefix ) > 0 ) { done = true ; return false ; } } return false ;
public class SequenceDisplay { /** * calculate the float that is used for display . * 1 * scale = size of 1 amino acid ( in pixel ) . * maximum @ see MAX _ SCALE * @ param zoomFactor * @ return a float that is the display " scale " - an internal value required for paintin . * user should only interact with the zoomfactor . . . */ private float getScaleForZoom ( int zoomFactor ) { } }
if ( zoomFactor > 100 ) zoomFactor = 100 ; if ( zoomFactor < 1 ) zoomFactor = 1 ; int DEFAULT_X_START = SequenceScalePanel . DEFAULT_X_START ; int DEFAULT_X_RIGHT_BORDER = SequenceScalePanel . DEFAULT_X_RIGHT_BORDER ; int seqLength = getMaxSequenceLength ( ) ; // the maximum width depends on the size of the parent Component int width = getWidth ( ) ; float s = width / ( float ) ( seqLength + DEFAULT_X_START + DEFAULT_X_RIGHT_BORDER ) ; // logger . info ( " scale for 100 % " + s + " " + seqLength + " " + zoomFactor ) ; s = ( 100 ) * s / ( zoomFactor * 1.0f ) ; if ( s > MAX_SCALE ) s = MAX_SCALE ; // logger . info ( " but changed to " + s ) ; return s ;
public class QueryParser { /** * pseudo selector : has ( el ) */ private void has ( ) { } }
tq . consume ( ":has" ) ; String subQuery = tq . chompBalanced ( '(' , ')' ) ; Validate . notEmpty ( subQuery , ":has(el) subselect must not be empty" ) ; evals . add ( new StructuralEvaluator . Has ( parse ( subQuery ) ) ) ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getGSAP ( ) { } }
if ( gsapEClass == null ) { gsapEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 464 ) ; } return gsapEClass ;
public class ORBConfigAdapter { /** * Create an ORB instance using the configured argument * and property bundles . * @ param args The String arguments passed to ORB . init ( ) . * @ param props The property bundle passed to ORB . init ( ) . * @ return An ORB constructed from the provided args and properties . */ private ORB createORB ( String [ ] args , Properties props ) { } }
return ORB . init ( args , props ) ;
public class ElemNumber { /** * Given an XML source node , get the count according to the * parameters set up by the xsl : number attributes . * @ param transformer non - null reference to the the current transform - time state . * @ param sourceNode The source node being counted . * @ return The count of nodes * @ throws TransformerException */ String getCountString ( TransformerImpl transformer , int sourceNode ) throws TransformerException { } }
long [ ] list = null ; XPathContext xctxt = transformer . getXPathContext ( ) ; CountersTable ctable = transformer . getCountersTable ( ) ; if ( null != m_valueExpr ) { XObject countObj = m_valueExpr . execute ( xctxt , sourceNode , this ) ; // According to Errata E24 double d_count = java . lang . Math . floor ( countObj . num ( ) + 0.5 ) ; if ( Double . isNaN ( d_count ) ) return "NaN" ; else if ( d_count < 0 && Double . isInfinite ( d_count ) ) return "-Infinity" ; else if ( Double . isInfinite ( d_count ) ) return "Infinity" ; else if ( d_count == 0 ) return "0" ; else { long count = ( long ) d_count ; list = new long [ 1 ] ; list [ 0 ] = count ; } } else { if ( Constants . NUMBERLEVEL_ANY == m_level ) { list = new long [ 1 ] ; list [ 0 ] = ctable . countNode ( xctxt , this , sourceNode ) ; } else { NodeVector ancestors = getMatchingAncestors ( xctxt , sourceNode , Constants . NUMBERLEVEL_SINGLE == m_level ) ; int lastIndex = ancestors . size ( ) - 1 ; if ( lastIndex >= 0 ) { list = new long [ lastIndex + 1 ] ; for ( int i = lastIndex ; i >= 0 ; i -- ) { int target = ancestors . elementAt ( i ) ; list [ lastIndex - i ] = ctable . countNode ( xctxt , this , target ) ; } } } } return ( null != list ) ? formatNumberList ( transformer , list , sourceNode ) : "" ;
public class MarvinColorModelConverter { /** * Converts a boolean array containing the pixel data in BINARY mode to an * integer array with the pixel data in RGB mode . * @ param binaryArray pixel binary data * @ return pixel integer data in RGB mode . */ public static int [ ] binaryToRgb ( boolean [ ] binaryArray ) { } }
int [ ] rgbArray = new int [ binaryArray . length ] ; for ( int i = 0 ; i < binaryArray . length ; i ++ ) { if ( binaryArray [ i ] ) { rgbArray [ i ] = 0x00000000 ; } else { rgbArray [ i ] = 0x00FFFFFF ; } } return rgbArray ;
public class Query { /** * Validates the query * @ throws IllegalArgumentException if one or more parameters were invalid */ public void validate ( ) { } }
if ( time == null ) { throw new IllegalArgumentException ( "missing time" ) ; } validatePOJO ( time , "time" ) ; if ( metrics == null || metrics . isEmpty ( ) ) { throw new IllegalArgumentException ( "missing or empty metrics" ) ; } final Set < String > variable_ids = new HashSet < String > ( ) ; for ( Metric metric : metrics ) { if ( variable_ids . contains ( metric . getId ( ) ) ) { throw new IllegalArgumentException ( "duplicated metric id: " + metric . getId ( ) ) ; } variable_ids . add ( metric . getId ( ) ) ; } final Set < String > filter_ids = new HashSet < String > ( ) ; for ( Filter filter : filters ) { if ( filter_ids . contains ( filter . getId ( ) ) ) { throw new IllegalArgumentException ( "duplicated filter id: " + filter . getId ( ) ) ; } filter_ids . add ( filter . getId ( ) ) ; } for ( Expression expression : expressions ) { if ( variable_ids . contains ( expression . getId ( ) ) ) { throw new IllegalArgumentException ( "Duplicated variable or expression id: " + expression . getId ( ) ) ; } variable_ids . add ( expression . getId ( ) ) ; } validateCollection ( metrics , "metric" ) ; if ( filters != null ) { validateCollection ( filters , "filter" ) ; } if ( expressions != null ) { validateCollection ( expressions , "expression" ) ; } validateFilters ( ) ; if ( expressions != null ) { validateCollection ( expressions , "expression" ) ; for ( final Expression exp : expressions ) { if ( exp . getVariables ( ) == null ) { throw new IllegalArgumentException ( "No variables found for an " + "expression?! " + JSON . serializeToString ( exp ) ) ; } for ( final String var : exp . getVariables ( ) ) { if ( ! variable_ids . contains ( var ) ) { throw new IllegalArgumentException ( "Expression [" + exp . getExpr ( ) + "] was missing input " + var ) ; } } } }
public class NGConstants { /** * Loads the version number from a file generated by Maven . */ private static String getVersion ( ) { } }
Properties props = new Properties ( ) ; try ( InputStream is = NGConstants . class . getResourceAsStream ( "/META-INF/maven/com.facebook/nailgun-server/pom.properties" ) ) { props . load ( is ) ; } catch ( Throwable e ) { // In static initialization context , outputting or logging an exception is dangerous // It smells bad , but let ' s ignore it } return props . getProperty ( "version" , System . getProperty ( "nailgun.server.version" , "[UNKNOWN]" ) ) ;
public class OcpiRepository { /** * findTokenByUid * @ param uid * @ return */ public Token findTokenByUid ( String uid ) { } }
EntityManager entityManager = getEntityManager ( ) ; try { return entityManager . createQuery ( "SELECT token FROM Token AS token WHERE uid = :uid" , Token . class ) . setParameter ( "uid" , uid ) . setMaxResults ( 1 ) . getSingleResult ( ) ; } catch ( NoResultException e ) { return null ; } finally { entityManager . close ( ) ; }
public class JedisRedisClient { /** * { @ inheritDoc } */ @ SuppressWarnings ( "unchecked" ) @ Override public List < byte [ ] > multiGetAsBinary ( String ... keys ) { } }
Pipeline p = redisClient . pipelined ( ) ; for ( String key : keys ) { p . get ( SafeEncoder . encode ( key ) ) ; } List < ? > result = p . syncAndReturnAll ( ) ; return ( List < byte [ ] > ) result ;
public class CloudwatchLogsExportConfiguration { /** * The list of log types to disable . * @ return The list of log types to disable . */ public java . util . List < String > getDisableLogTypes ( ) { } }
if ( disableLogTypes == null ) { disableLogTypes = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return disableLogTypes ;
public class KeyTranslatorImpl { /** * Adds a mapping from a key press to an action command string that will auto - repeat at the * specified repeat rate . Overwrites any existing mapping and repeat rate that may have * already been registered . * @ param rate the number of times each second that the key press should be repeated while the * key is down , or < code > 0 < / code > to disable auto - repeat for the key . */ public void addPressCommand ( int keyCode , String command , int rate ) { } }
addPressCommand ( keyCode , command , rate , DEFAULT_REPEAT_DELAY ) ;
public class WebListener { /** * Deassociates the current { @ code HttpSessionEvent } from { @ link Session } * context . * @ param se The event the { @ code HttpSession } is destroyed . */ @ SuppressWarnings ( "unchecked" ) public void sessionDestroyed ( HttpSessionEvent se ) { } }
WebContext < HttpSession > context = ( WebContext < HttpSession > ) container . component ( container . contexts ( ) . get ( Session . class ) ) ; context . deassociate ( se . getSession ( ) ) ;
public class RSAUtils { /** * 从字符串中加载私钥 < br > * 加载时使用的是PKCS8EncodedKeySpec ( PKCS # 8编码的Key指令 ) 。 * @ param privateKeyStr * @ return * @ throws Exception */ public static PrivateKey loadPrivateKey ( String privateKeyStr ) throws Exception { } }
try { byte [ ] buffer = base64 . decode ( privateKeyStr ) ; // X509EncodedKeySpec keySpec = new X509EncodedKeySpec ( buffer ) ; PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec ( buffer ) ; KeyFactory keyFactory = KeyFactory . getInstance ( KEY_ALGORITHM ) ; return ( RSAPrivateKey ) keyFactory . generatePrivate ( keySpec ) ; } catch ( NoSuchAlgorithmException e ) { throw new Exception ( "无此算法" ) ; } catch ( InvalidKeySpecException e ) { throw new Exception ( "私钥非法" ) ; } catch ( NullPointerException e ) { throw new Exception ( "私钥数据为空" ) ; }
public class HeadLineInterceptor { /** * Override paint in order to perform processing specific to this interceptor . This implementation is responsible * for rendering the headlines for the UI . * @ param renderContext the renderContext to send the output to . */ @ Override public void paint ( final RenderContext renderContext ) { } }
if ( renderContext instanceof WebXmlRenderContext ) { PageContentHelper . addAllHeadlines ( ( ( WebXmlRenderContext ) renderContext ) . getWriter ( ) , getUI ( ) . getHeaders ( ) ) ; } getBackingComponent ( ) . paint ( renderContext ) ;
public class GetResourcesResult { /** * The current page of elements from this collection . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setItems ( java . util . Collection ) } or { @ link # withItems ( java . util . Collection ) } if you want to override the * existing values . * @ param items * The current page of elements from this collection . * @ return Returns a reference to this object so that method calls can be chained together . */ public GetResourcesResult withItems ( Resource ... items ) { } }
if ( this . items == null ) { setItems ( new java . util . ArrayList < Resource > ( items . length ) ) ; } for ( Resource ele : items ) { this . items . add ( ele ) ; } return this ;
public class JobHistoryRawService { /** * returns the raw byte representation of job history from the result value * @ param value result * @ return byte array of job history raw * @ throws MissingColumnInResultException */ public byte [ ] getJobHistoryRawFromResult ( Result value ) throws MissingColumnInResultException { } }
if ( value == null ) { throw new IllegalArgumentException ( "Cannot create InputStream from null" ) ; } Cell cell = value . getColumnLatestCell ( Constants . RAW_FAM_BYTES , Constants . JOBHISTORY_COL_BYTES ) ; // Could be that there is no conf file ( only a history file ) . if ( cell == null ) { throw new MissingColumnInResultException ( Constants . RAW_FAM_BYTES , Constants . JOBHISTORY_COL_BYTES ) ; } byte [ ] jobHistoryRaw = CellUtil . cloneValue ( cell ) ; return jobHistoryRaw ;
public class Polygon { /** * Convenience method to get a list of inner { @ link LineString } s defining holes inside the * polygon . It is not guaranteed that this instance of Polygon contains holes and thus , might * return a null or empty list . * @ return a List of { @ link LineString } s defining holes inside the polygon * @ since 3.0.0 */ @ Nullable public List < LineString > inner ( ) { } }
List < List < Point > > coordinates = coordinates ( ) ; if ( coordinates . size ( ) <= 1 ) { return new ArrayList ( 0 ) ; } List < LineString > inner = new ArrayList < > ( coordinates . size ( ) - 1 ) ; for ( List < Point > points : coordinates . subList ( 1 , coordinates . size ( ) ) ) { inner . add ( LineString . fromLngLats ( points ) ) ; } return inner ;