signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class VectorTilePainter { /** * Delete a { @ link Paintable } object from the given { @ link MapContext } . It the object does not exist , nothing * will be done . * @ param paintable * The object to be painted . * @ param group * The group where the object resides in ( optional ) . * @ param context...
VectorTile tile = ( VectorTile ) paintable ; context . getVectorContext ( ) . deleteGroup ( tile . getFeatureContent ( ) ) ; context . getVectorContext ( ) . deleteGroup ( tile . getLabelContent ( ) ) ; context . getRasterContext ( ) . deleteGroup ( tile . getFeatureContent ( ) ) ; context . getRasterContext ( ) . dele...
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getSVI ( ) { } }
if ( sviEClass == null ) { sviEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 341 ) ; } return sviEClass ;
public class GroupListHelperImpl { /** * ( non - Javadoc ) * @ see org . apereo . portal . layout . dlm . remoting . IGroupListHelper # getEntity ( org . apereo . portal . groups . IGroupMember ) */ @ Override public JsonEntityBean getEntity ( IGroupMember member ) { } }
// get the type of this member entity EntityEnum entityEnum = getEntityType ( member ) ; // construct a new entity bean for this entity JsonEntityBean entity ; if ( entityEnum . isGroup ( ) ) { entity = new JsonEntityBean ( ( IEntityGroup ) member , entityEnum ) ; } else { entity = new JsonEntityBean ( member , entityE...
public class Slf4jAdapter { /** * { @ inheritDoc } */ @ Override public void warn ( final MessageItem messageItem , final Throwable t ) { } }
getLogger ( ) . warn ( messageItem . getMarker ( ) , messageItem . getText ( ) , t ) ;
public class ModelsImpl { /** * Gets information about the hierarchical entity child model . * @ param appId The application ID . * @ param versionId The version ID . * @ param hEntityId The hierarchical entity extractor ID . * @ param hChildId The hierarchical entity extractor child ID . * @ throws IllegalAr...
if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( appId == null ) { throw new IllegalArgumentException ( "Parameter appId is required and cannot be null." ) ; } if ( versionId == null ) { throw new IllegalArgu...
public class DwgFile { /** * Reads a DWG file and put its objects in the dwgObjects Vector * This method is version independent * @ throws IOException If the file location is wrong */ public void read ( ) throws IOException { } }
System . out . println ( "DwgFile.read() executed ..." ) ; setDwgVersion ( ) ; if ( dwgVersion . equals ( "R13" ) ) { dwgReader = new DwgFileV14Reader ( ) ; dwgReader . read ( this ) ; } else if ( dwgVersion . equals ( "R14" ) ) { dwgReader = new DwgFileV14Reader ( ) ; dwgReader . read ( this ) ; } else if ( dwgVersion...
public class NumberUtil { /** * 将10进制的String安全的转化为Double . * 当str为空或非数字字符串时抛NumberFormatException */ public static Double toDoubleObject ( @ NotNull String str ) { } }
// 统一行为 , 不要有时候抛NPE , 有时候抛NumberFormatException if ( str == null ) { throw new NumberFormatException ( "null" ) ; } return Double . valueOf ( str ) ;
public class AccountsEndpoint { /** * Removes all dependent resources of an account . Some resources like * CDRs are excluded . * @ param sid */ private void removeAccoundDependencies ( Sid sid ) { } }
logger . debug ( "removing accoutn dependencies" ) ; DaoManager daoManager = ( DaoManager ) context . getAttribute ( DaoManager . class . getName ( ) ) ; // remove dependency entities first and dependent entities last . Also , do safer operation first ( as a secondary rule ) daoManager . getAnnouncementsDao ( ) . remov...
public class InMemoryLookupTable { /** * Inserts a word vector * @ param word the word to insert * @ param vector the vector to insert */ @ Override public void putVector ( String word , INDArray vector ) { } }
if ( word == null ) throw new IllegalArgumentException ( "No null words allowed" ) ; if ( vector == null ) throw new IllegalArgumentException ( "No null vectors allowed" ) ; int idx = vocab . indexOf ( word ) ; syn0 . slice ( idx ) . assign ( vector ) ;
public class WaveBase { /** * Retrieve the field value from wave bean * @ param waveItem the wave item to retrieve * @ return the object value */ private Object waveBeanGet ( WaveItem < ? > waveItem ) { } }
for ( final WaveBean wb : waveBeanList ( ) ) { final Object o = Stream . of ( wb . getClass ( ) . getDeclaredFields ( ) ) . filter ( f -> waveItem . name ( ) . equals ( f . getName ( ) ) ) . map ( f -> ClassUtility . getFieldValue ( f , wb ) ) . findFirst ( ) . get ( ) ; if ( o != null ) { return o ; } } return null ;
public class WindowsProcessFaxClientSpi { /** * This function creates and returns the command line arguments for the fax4j * external exe when running the submit fax job action . * @ param faxJob * The fax job object * @ return The full command line arguments line */ protected String createProcessCommandArgumen...
// get values from fax job String targetAddress = faxJob . getTargetAddress ( ) ; String targetName = faxJob . getTargetName ( ) ; String senderName = faxJob . getSenderName ( ) ; File file = faxJob . getFile ( ) ; String fileName = null ; try { fileName = file . getCanonicalPath ( ) ; } catch ( Exception exception ) {...
public class PreferenceActivity { /** * Adapts the background color of the toolbar , which is used to show the bread crumb of the * currently selected navigation preferences , when using the split screen layout . */ private void adaptBreadCrumbBackgroundColor ( ) { } }
if ( breadCrumbToolbar != null ) { GradientDrawable background = ( GradientDrawable ) ContextCompat . getDrawable ( this , R . drawable . breadcrumb_background ) ; background . setColor ( breadCrumbBackgroundColor ) ; ViewUtil . setBackground ( getBreadCrumbToolbar ( ) , background ) ; }
public class VoxbonePhoneNumberProvisioningManager { /** * ( non - Javadoc ) * @ see * PhoneNumberProvisioningManager # init ( org . apache . commons . configuration * . Configuration , boolean ) */ @ Override public void init ( Configuration phoneNumberProvisioningConfiguration , Configuration telestaxProxyConfi...
this . containerConfiguration = containerConfiguration ; telestaxProxyEnabled = telestaxProxyConfiguration . getBoolean ( "enabled" , false ) ; if ( telestaxProxyEnabled ) { uri = telestaxProxyConfiguration . getString ( "uri" ) ; username = telestaxProxyConfiguration . getString ( "username" ) ; password = telestaxPro...
public class ProtocolDataUnitFactory { /** * This method creates a < code > ProtocolDataUnit < / code > instance , which initializes only the digests to use , and * returns it . * @ param headerDigest The name of the digest to use for the protection of the Basic Header Segment . * @ param dataDigest The name of t...
return new ProtocolDataUnit ( digestFactory . create ( headerDigest ) , digestFactory . create ( dataDigest ) ) ;
public class TCPInputPoller { /** * Pop the oldest command from our list and return it . * @ return the oldest unhandled command in our list */ public String getCommand ( ) { } }
String command = "" ; synchronized ( this ) { if ( commandQueue . size ( ) > 0 ) { command = commandQueue . remove ( 0 ) . command ; } } return command ;
public class GeneratePairwiseImageGraph { /** * Puts the inliers from RANSAC into the edge ' s list of associated features * @ param ransac RANSAC * @ param matches List of matches from feature association * @ param edge The edge that the inliers are to be saved to */ private void saveInlierMatches ( ModelMatcher...
int N = ransac . getMatchSet ( ) . size ( ) ; edge . inliers . reset ( ) ; for ( int i = 0 ; i < N ; i ++ ) { int idx = ransac . getInputIndex ( i ) ; edge . inliers . grow ( ) . set ( matches . get ( idx ) ) ; }
public class UIComponent { /** * Sets the < code > hovered < / code > state of this { @ link UIComponent } . * @ param hovered the new state */ public void setHovered ( boolean hovered ) { } }
boolean flag = this . hovered != hovered ; flag |= MalisisGui . setHoveredComponent ( this , hovered ) ; if ( ! flag ) return ; this . hovered = hovered ; fireEvent ( new HoveredStateChange < > ( this , hovered ) ) ; if ( tooltip != null && hovered ) tooltip . animate ( ) ;
public class Spark { /** * Maps one or many filters to be executed before any matching routes * @ param path the path * @ param acceptType the accept type * @ param filters The filters */ public static void before ( String path , String acceptType , Filter ... filters ) { } }
for ( Filter filter : filters ) { getInstance ( ) . before ( path , acceptType , filter ) ; }
public class ParseTreeConstructorFragment { /** * Set the Graphviz command that is issued to paint a debugging diagram . * @ param cmd */ public void setGraphvizCommand ( String cmd ) { } }
if ( cmd != null && cmd . length ( ) == 0 ) cmd = null ; graphvizCommand = cmd ;
public class SubscribeBeanPostProcessor { /** * Unsubscribes the subscriber bean from the corresponding { @ link EventBus } . */ @ Override public void postProcessBeforeDestruction ( final Object bean , final String beanName ) throws BeansException { } }
if ( subscribers . containsKey ( beanName ) ) { Subscribe annotation = getAnnotation ( bean . getClass ( ) , beanName ) ; LOG . debug ( "Unsubscribing the event listener '{}' from event bus '{}' with topic '{}" , beanName , annotation . eventBus ( ) , annotation . topic ( ) ) ; try { EventBus eventBus = getEventBus ( a...
public class Graphics { /** * Sets the color value , position , direction and the angle of the spotlight cone of the No . i spotLight */ public void setSpotLight ( int i , Color color , boolean enableColor , Vector3D v , float nx , float ny , float nz , float angle ) { } }
float spotColor [ ] = { ( float ) color . getRed ( ) , ( float ) color . getGreen ( ) , ( float ) color . getBlue ( ) , ( float ) color . getAlpha ( ) } ; float pos [ ] = { ( float ) v . getX ( ) , ( float ) v . getY ( ) , ( float ) v . getZ ( ) , 0.0f } ; float direction [ ] = { nx , ny , nz } ; float a [ ] = { angle ...
public class Resolve { /** * Find an identifier in a package which matches a specified kind set . * @ param env The current environment . * @ param name The identifier ' s name . * @ param kind Indicates the possible symbol kinds * ( a nonempty subset of TYP , PCK ) . */ Symbol findIdentInPackage ( Env < AttrCo...
Name fullname = TypeSymbol . formFullName ( name , pck ) ; Symbol bestSoFar = typeNotFound ; PackageSymbol pack = null ; if ( ( kind & PCK ) != 0 ) { pack = reader . enterPackage ( fullname ) ; if ( pack . exists ( ) ) return pack ; } if ( ( kind & TYP ) != 0 ) { Symbol sym = loadClass ( env , fullname ) ; if ( sym . e...
public class NamecoinGetNameOperationUDF { /** * Analyzes txOutScript ( ScriptPubKey ) of an output of a Namecoin Transaction to determine the name operation ( if any ) * @ param input BytesWritable containing a txOutScript of a Namecoin Transaction * @ return Text containing the type of name operation , cf . Namec...
String nameOperation = NamecoinUtil . getNameOperation ( input . copyBytes ( ) ) ; return new Text ( nameOperation ) ;
public class UpdateAction { /** * Returns the attribute as a string , substituted if necessary with tokens * using the given substitution context . */ @ Override String asSubstituted ( SubstitutionContext context ) { } }
return value == null ? attribute . asSubstituted ( context ) : attribute . asSubstituted ( context ) + " " + value . asSubstituted ( context ) ;
public class AbstractAttributeDefinitionBuilder { /** * Sets the { @ link AttributeDefinition # getXmlName ( ) xml name } for the attribute , which is only needed * if the name used for the attribute is different from its ordinary * { @ link AttributeDefinition # getName ( ) name in the model } . If not set the def...
// noinspection deprecation this . xmlName = xmlName == null ? this . name : xmlName ; return ( BUILDER ) this ;
public class Utils { /** * encrypts a password * protocol for authentication is like this : 1 . mysql server sends a random array of bytes ( the seed ) 2 . client * makes a sha1 digest of the password 3 . client hashes the output of 2 4 . client digests the seed 5 . client updates * the digest with the output fro...
if ( password == null || password . equals ( "" ) ) { return new byte [ 0 ] ; } final MessageDigest messageDigest = MessageDigest . getInstance ( "SHA-1" ) ; final byte [ ] stage1 = messageDigest . digest ( password . getBytes ( ) ) ; messageDigest . reset ( ) ; final byte [ ] stage2 = messageDigest . digest ( stage1 )...
public class PhotosetsApi { /** * Set the order of photosets for the calling user . * < br > * This method requires authentication with ' write ' permission . * < br > * Note : This method requires an HTTP POST request . * @ param photosetIds a list containing photoset IDs , ordered with the set to show first...
JinxUtils . validateParams ( photosetIds ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.photosets.orderSets" ) ; params . put ( "photoset_ids" , JinxUtils . buildCommaDelimitedList ( photosetIds ) ) ; return jinx . flickrPost ( params , Response . class ) ;
public class ClassPath { public Class < ? > loadClass ( String className , File classPathFile ) throws IOException , ClassFormatError { } }
byte [ ] classBytes = loadClassBytes ( classPathFile ) ; Class < ? > result = defineClass ( className , classBytes , 0 , classBytes . length , null ) ; classes . put ( className , result ) ; return result ;
public class ApplicationContext { /** * Compatibility for disparities in mdw - central hosting mechanism . */ public static String getCentralServicesUrl ( ) { } }
String centralServicesUrl = getMdwCentralUrl ( ) ; if ( centralServicesUrl != null && centralServicesUrl . endsWith ( "/central" ) ) centralServicesUrl = centralServicesUrl . substring ( 0 , centralServicesUrl . length ( ) - 8 ) ; return centralServicesUrl ;
public class WalletApi { /** * Get corporation wallet journal Retrieve the given corporation & # 39 ; s * wallet journal for the given division going 30 days back - - - This route * is cached for up to 3600 seconds - - - Requires one of the following EVE * corporation role ( s ) : Accountant , Junior _ Accountant...
ApiResponse < List < CorporationWalletJournalResponse > > resp = getCorporationsCorporationIdWalletsDivisionJournalWithHttpInfo ( corporationId , division , datasource , ifNoneMatch , page , token ) ; return resp . getData ( ) ;
public class RedisClient { /** * Open a new synchronous connection to the redis server . Use the supplied * { @ link RedisCodec codec } to encode / decode keys and values . * @ param codec Use this codec to encode / decode keys and values . * @ return A new connection . */ public < K , V > RedisConnection < K , V...
return new RedisConnection < K , V > ( connectAsync ( codec ) ) ;
public class Range { /** * Calculate the intersection of { @ code this } and an overlapping Range . * @ param other overlapping Range * @ return range representing the intersection of { @ code this } and { @ code other } ( { @ code this } if equal ) * @ throws IllegalArgumentException if { @ code other } does not...
if ( ! this . isOverlappedBy ( other ) ) { throw new IllegalArgumentException ( StringUtils . simpleFormat ( "Cannot calculate intersection with non-overlapping range %s" , other ) ) ; } if ( this . equals ( other ) ) { return this ; } final T min = getComparator ( ) . compare ( minimum , other . minimum ) < 0 ? other ...
public class CertificateLoginModule { /** * { @ inheritDoc } */ @ Override public boolean commit ( ) throws LoginException { } }
if ( authenticatedId == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Authentication did not occur for this login module, abstaining." ) ; return false ; } setUpSubject ( ) ; return true ;
public class SipCall { /** * This basic method is used to initiate an outgoing MESSAGE . * This method returns when the request message has been sent out . Your calling program must * subsequently call the waitOutgoingMessageResponse ( ) method ( one or more times ) to get the * result ( s ) . * If a DIALOG exi...
return initiateOutgoingMessage ( null , toUri , viaNonProxyRoute , null , null , null ) ;
public class Metric { /** * Construct and print a message based on the timing and checkpoints . This * will look like " 123.456ms ( checkpoint1 = 100.228ms , checkpoint2 = 23.228ms ) " * without the quotes . There will be no spaces or tabs in the output . A * value of { @ code " metricsDisabled " } will be printe...
if ( enabled ) { done ( ) ; writeNanos ( buf , lastCheckpointNanos - startNanos ) ; if ( ! checkpoints . isEmpty ( ) ) { buf . append ( "(" ) ; boolean first = true ; for ( Checkpoint checkpoint : checkpoints ) { if ( first ) { first = false ; } else { buf . append ( ',' ) ; } buf . append ( checkpoint . description ) ...
public class SDMath { /** * Element - wise ( broadcastable ) power function : out = x [ i ] ^ y [ i ] * @ param x Input variable * @ param y Power * @ return Output variable */ public SDVariable pow ( SDVariable x , SDVariable y ) { } }
return pow ( null , x , y ) ;
public class AnnotationTypeBuilder { /** * Copy the doc files for the current ClassDoc if necessary . */ private void copyDocFiles ( ) { } }
PackageDoc containingPackage = annotationTypeDoc . containingPackage ( ) ; if ( ( configuration . packages == null || Arrays . binarySearch ( configuration . packages , containingPackage ) < 0 ) && ! containingPackagesSeen . contains ( containingPackage . name ( ) ) ) { // Only copy doc files dir if the containing pack...
public class DateTimeFormatter { /** * Prints an instant from milliseconds since 1970-01-01T00:00:00Z , * using ISO chronology in the default DateTimeZone . * @ param buf the destination to format to , not null * @ param instant millis since 1970-01-01T00:00:00Z */ public void printTo ( StringBuffer buf , long in...
try { printTo ( ( Appendable ) buf , instant ) ; } catch ( IOException ex ) { // StringBuffer does not throw IOException }
public class Tokenizer { /** * Get the current part as substring * @ return Current value as substring . */ public String getStrippedSubstring ( ) { } }
// TODO : detect Java < 6 and make sure we only return the substring ? // With java 7 , String . substring will arraycopy the characters . int sstart = start , send = end ; while ( sstart < send ) { char c = input . charAt ( sstart ) ; if ( c != ' ' || c != '\n' || c != '\r' || c != '\t' ) { break ; } ++ sstart ; } whi...
public class FessMessages { /** * Add the created action message for the key ' errors . failed _ to _ download _ stopwords _ file ' with parameters . * < pre > * message : Failed to download the Stopwords file . * < / pre > * @ param property The property name for the message . ( NotNull ) * @ return this . (...
assertPropertyNotNull ( property ) ; add ( property , new UserMessage ( ERRORS_failed_to_download_stopwords_file ) ) ; return this ;
public class AlbumActivity { /** * Use different layouts depending on the style . * @ return layout id . */ private int createView ( ) { } }
switch ( mWidget . getUiStyle ( ) ) { case Widget . STYLE_DARK : { return R . layout . album_activity_album_dark ; } case Widget . STYLE_LIGHT : { return R . layout . album_activity_album_light ; } default : { throw new AssertionError ( "This should not be the case." ) ; } }
public class BenchmarkInliningGetSet { /** * Get by index is used here . */ public static long get1D ( DMatrixRMaj A , int n ) { } }
long before = System . currentTimeMillis ( ) ; double total = 0 ; for ( int iter = 0 ; iter < n ; iter ++ ) { int index = 0 ; for ( int i = 0 ; i < A . numRows ; i ++ ) { int end = index + A . numCols ; while ( index != end ) { total += A . get ( index ++ ) ; } } } long after = System . currentTimeMillis ( ) ; // print...
public class WaitStrategies { /** * Returns a strategy which sleeps for an exponential amount of time after the first failed attempt , * and in exponentially incrementing amounts after each failed attempt up to the maximumTime . * @ param maximumTime the maximum time to sleep * @ param maximumTimeUnit the unit of...
Preconditions . checkNotNull ( maximumTimeUnit , "The maximum time unit may not be null" ) ; return new ExponentialWaitStrategy ( 1 , maximumTimeUnit . toMillis ( maximumTime ) ) ;
public class BytesOutputStream { /** * Returns the reference to the output buffer . * @ return the reference to the < tt > byte [ ] < / tt > output buffer . */ public synchronized byte [ ] getBuffer ( ) { } }
byte [ ] dest = new byte [ buf . length ] ; System . arraycopy ( buf , 0 , dest , 0 , dest . length ) ; return dest ;
public class AgreementEvaluator { /** * Evaluate if the detected violations imply any compensation . * @ param agreement Agreement to evaluate . * @ param violationsMap Contains the list of metrics to check for each guarantee term . * @ return list of violations and compensations detected . */ public Map < IGuara...
checkInitialized ( false ) ; Map < IGuaranteeTerm , GuaranteeTermEvaluationResult > result = new HashMap < IGuaranteeTerm , GuaranteeTermEvaluationResult > ( ) ; Date now = new Date ( ) ; for ( IGuaranteeTerm term : violationsMap . keySet ( ) ) { List < IViolation > violations = violationsMap . get ( term ) ; if ( viol...
public class CmsErrorUI { /** * Sets the error attributes to the current session . < p > * @ param cms the cms context * @ param throwable the throwable * @ param request the current request */ private static void setErrorAttributes ( CmsObject cms , Throwable throwable , HttpServletRequest request ) { } }
String errorUri = CmsFlexController . getThrowableResourceUri ( request ) ; if ( errorUri == null ) { errorUri = cms . getRequestContext ( ) . getUri ( ) ; } // try to get the exception root cause Throwable cause = CmsFlexController . getThrowable ( request ) ; if ( cause == null ) { cause = throwable ; } request . get...
public class QueryChemObject { /** * { @ inheritDoc } */ @ Override public void setFlags ( boolean [ ] flagsNew ) { } }
for ( int i = 0 ; i < flagsNew . length ; i ++ ) setFlag ( CDKConstants . FLAG_MASKS [ i ] , flagsNew [ i ] ) ;
public class Subcursor { /** * Return the next item that is deemed a match by the filter specified when the cursor * was created . Items returned by this method are locked . * @ throws SevereMessageStoreException */ public final AbstractItem next ( long lockID ) throws SevereMessageStoreException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "next" , Long . valueOf ( lockID ) ) ; final AbstractItemLink lockedMatchingLink = _next ( lockID ) ; // retrieve the item from the link AbstractItem lockedMatchingItem = null ; if ( null != lockedMatchingLink ) { loc...
public class ApiPreprocessingContext { /** * Runs preprocessing on the specified object . * @ param object the object to preprocess * @ return a result object indicating whether the preprocessing chain completed successfully and * containing the errors collected during preprocessing ( note that a successful chain...
if ( result != null ) { throw new IllegalStateException ( "This preprocessing context has already been used; create another one." ) ; } result = preprocessor . process ( object , this ) ; if ( failOnErrors && apiErrorResponse . hasErrors ( ) ) { throw new ApiErrorsException ( apiErrorResponse ) ; } return this ;
public class Annotations { /** * Returns a builder that can be used to construct an annotation instance . */ public static < T extends Annotation > Builder < T > builder ( Class < T > annotationType ) { } }
return new Builder < T > ( annotationType ) ;
public class XmlString { /** * Sets the string for this XML component . Sets the length of the * component to the length of the passed string . * @ param s a string of xml text * @ throws IllegalArgumentException } if { @ code s } is { @ code null } */ public void setXml ( String s ) { } }
assertNotNull ( s ) ; xml = s ; setLength ( s . length ( ) ) ;
public class SpringLoadedPreProcessor { /** * This method tries to inject the ReflectiveInterceptor methods into any system types that have been rewritten . */ private void injectReflectiveInterceptorMethods ( String slashedClassName , int bits , Class < ? > clazz ) throws NoSuchFieldException , IllegalAccessException ...
// TODO log the bits if ( ( bits & Constants . JLC_GETDECLAREDFIELDS ) != 0 ) { Field f = clazz . getDeclaredField ( "__sljlcgdfs" ) ; f . setAccessible ( true ) ; f . set ( null , method_jlcgdfs ) ; } if ( ( bits & Constants . JLC_GETDECLAREDFIELD ) != 0 ) { Field f = clazz . getDeclaredField ( jlcgdf ) ; f . setAcces...
public class ErrorInterceptor { /** * Intercepts chain to check for unsuccessful requests . * @ param chain provided by the framework to check * @ return the response if no error occurred * @ throws IOException will get thrown if response code is unsuccessful */ @ Override public Response intercept ( Chain chain ...
final Request request = chain . request ( ) ; final Response response = chain . proceed ( request ) ; if ( ! response . isSuccessful ( ) ) { throw new CMAHttpException ( request , response ) ; } return response ;
public class CreateWSDL { /** * GetURIValue Method . */ public String getURIValue ( String strValue ) { } }
String strBaseURI = ( ( PropertiesField ) this . getRecord ( MessageControl . MESSAGE_CONTROL_FILE ) . getField ( MessageControl . PROPERTIES ) ) . getProperty ( MessageControl . BASE_NAMESPACE_URI ) ; if ( strBaseURI == null ) { strBaseURI = this . getProperty ( DBParams . BASE_URL ) ; // Defaults to same site as wsdl...
public class Group { /** * Returns the group ' s size - internal impl */ private int get_size_i ( final boolean fwd ) { } }
int size = 0 ; final Iterator it = elements . iterator ( ) ; while ( it . hasNext ( ) ) { final GroupElement e = ( GroupElement ) it . next ( ) ; if ( e instanceof GroupDeviceElement || fwd ) { size += e . get_size ( true ) ; } } return size ;
public class SideEffectConstructor { /** * overrides the visitor to reset the state and reset the opcode stack * @ param obj * the context object of the currently parsed code */ @ Override public void visitCode ( Code obj ) { } }
state = State . SAW_NOTHING ; stack . resetForMethodEntry ( this ) ; super . visitCode ( obj ) ;
public class syslog_server { /** * < pre > * Performs generic data validation for the operation to be performed * < / pre > */ protected void validate ( String operationType ) throws Exception { } }
super . validate ( operationType ) ; MPSString name_validator = new MPSString ( ) ; name_validator . setConstraintCharSetRegEx ( MPSConstants . GENERIC_CONSTRAINT , "[a-zA-Z0-9_#.:@=-]+" ) ; name_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 128 ) ; name_validator . setConstraintMinStrLen ( M...
public class EtcdClient { /** * Get the Store Statistics of Etcd * @ return vEtcdStoreStatsResponse */ public EtcdStoreStatsResponse getStoreStats ( ) { } }
try { return new EtcdStoreStatsRequest ( this . client , retryHandler ) . send ( ) . get ( ) ; } catch ( IOException | EtcdException | EtcdAuthenticationException | TimeoutException e ) { return null ; }
public class XmlStreamReaderUtils { /** * Returns the value of an attribute as a short . If the attribute is empty , this method returns * the default value provided . * @ param reader * < code > XMLStreamReader < / code > that contains attribute values . * @ param namespace * String * @ param localName *...
final String value = reader . getAttributeValue ( namespace , localName ) ; if ( value != null ) { return Short . parseShort ( value ) ; } return defaultValue ;
public class Normalizer { /** * Convenience method that can have faster implementation * by not allocating buffers . * @ param char32a the first code point to be checked against * @ param str2 the second string * @ param options A bit set of options */ public static int compare ( int char32a , String str2 , int...
return internalCompare ( UTF16 . valueOf ( char32a ) , str2 , options ) ;
public class KTypeArrayList { /** * { @ inheritDoc } */ @ Override public int removeLast ( KType e1 ) { } }
final int index = lastIndexOf ( e1 ) ; if ( index >= 0 ) remove ( index ) ; return index ;
public class DefaultGroovyMethods { /** * Create an array containing elements from an original array plus those from a Collection . * < pre class = " groovyTestCase " > * Integer [ ] a = [ 1 , 2 , 3] * def additions = [ 7 , 8] * assert a + additions = = [ 1 , 2 , 3 , 7 , 8 ] as Integer [ ] * < / pre > * @ p...
return ( T [ ] ) plus ( ( List < T > ) toList ( left ) , ( Collection < T > ) right ) . toArray ( ) ;
public class BiInt2ObjectMap { /** * Put a value into the map . * @ param keyPartA for the key * @ param keyPartB for the key * @ param value to put into the map * @ return the previous value if found otherwise null */ @ SuppressWarnings ( "unchecked" ) public V put ( final int keyPartA , final int keyPartB , f...
final long key = compoundKey ( keyPartA , keyPartB ) ; V oldValue = null ; final int mask = values . length - 1 ; int index = Hashing . hash ( key , mask ) ; while ( null != values [ index ] ) { if ( key == keys [ index ] ) { oldValue = ( V ) values [ index ] ; break ; } index = ++ index & mask ; } if ( null == oldValu...
public class RolloutHelper { /** * Creates an RSQL Filter that matches all targets that are in the provided * group and in the provided groups . * @ param baseFilter * the base filter from the rollout * @ param groups * the rollout groups * @ param group * the target group * @ return RSQL string without...
final String groupFilter = group . getTargetFilterQuery ( ) ; // when any previous group has the same filter as the target group the // overlap is 100% if ( isTargetFilterInGroups ( groupFilter , groups ) ) { return concatAndTargetFilters ( baseFilter , groupFilter ) ; } final String previousGroupFilters = getAllGroups...
public class WxaAPI { /** * 代码管理 < br > * 将第三方提交的代码包提交审核 ( 仅供第三方开发者代小程序调用 ) * @ since 2.8.9 * @ param access _ token access _ token * @ param submitAudit submitAudit * @ return result */ public static SubmitAuditResult submit_audit ( String access_token , SubmitAudit submitAudit ) { } }
String json = JsonUtil . toJSONString ( submitAudit ) ; HttpUriRequest httpUriRequest = RequestBuilder . post ( ) . setHeader ( jsonHeader ) . setUri ( BASE_URI + "/wxa/submit_audit" ) . addParameter ( PARAM_ACCESS_TOKEN , API . accessToken ( access_token ) ) . setEntity ( new StringEntity ( json , Charset . forName ( ...
public class OpenAPIModelFilterAdapter { /** * { @ inheritDoc } */ @ Override public Parameter visitParameter ( Context context , String key , Parameter p ) { } }
visitor . visitParameter ( context , key , p ) ; return p ;
public class HiveAvroORCQueryGenerator { /** * Generate DDL query to create a different format ( default : ORC ) Hive table for a given Avro Schema * @ param schema Avro schema to use to generate the DDL for new Hive table * @ param tblName New Hive table name * @ param tblLocation New hive table location * @ p...
Preconditions . checkNotNull ( schema ) ; Preconditions . checkArgument ( StringUtils . isNotBlank ( tblName ) ) ; Preconditions . checkArgument ( StringUtils . isNotBlank ( tblLocation ) ) ; String dbName = optionalDbName . isPresent ( ) ? optionalDbName . get ( ) : DEFAULT_DB_NAME ; String rowFormatSerde = optionalRo...
public class DescribeBundleTasksResult { /** * Information about the bundle tasks . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setBundleTasks ( java . util . Collection ) } or { @ link # withBundleTasks ( java . util . Collection ) } if you want to * o...
if ( this . bundleTasks == null ) { setBundleTasks ( new com . amazonaws . internal . SdkInternalList < BundleTask > ( bundleTasks . length ) ) ; } for ( BundleTask ele : bundleTasks ) { this . bundleTasks . add ( ele ) ; } return this ;
public class LObjIntBoolPredicateBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */ @ Nonnull public static < T > LObjIntBoolPredicate < T > objIntBoolPredicateFrom ( Consumer < LObjIntBoolPredicateBuilder < T > > b...
LObjIntBoolPredicateBuilder builder = new LObjIntBoolPredicateBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ;
public class HttpServletUtils { /** * Print all the headers * @ param req Incoming HttpServletRequest object */ public static void dumpHeaders ( final HttpServletRequest req ) { } }
Enumeration en = req . getHeaderNames ( ) ; while ( en . hasMoreElements ( ) ) { String name = ( String ) en . nextElement ( ) ; logger . debug ( name + ": " + req . getHeader ( name ) ) ; }
public class BlobContainersInner { /** * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy . The only action allowed on a Locked policy will be this action . ETag in If - Match is required for this operation . * @ param resourceGroupName The name of the resource group within the user ' ...
return ServiceFuture . fromHeaderResponse ( extendImmutabilityPolicyWithServiceResponseAsync ( resourceGroupName , accountName , containerName , ifMatch , immutabilityPeriodSinceCreationInDays ) , serviceCallback ) ;
public class Criteria { /** * Crates new { @ link Predicate } with trailing wildcard for each entry * @ param values * @ return * @ throws InvalidDataAccessApiUsageException for strings with whitespace */ public Criteria startsWith ( Iterable < String > values ) { } }
Assert . notNull ( values , "Collection must not be null" ) ; for ( String value : values ) { startsWith ( value ) ; } return this ;
public class DateFormatDayFormatter { /** * { @ inheritDoc } */ @ Override @ NonNull public String format ( @ NonNull final CalendarDay day ) { } }
return dateFormat . format ( day . getDate ( ) ) ;
public class Tailer { /** * Creates and starts a Tailer for the given file . * @ param file * the file to follow . * @ param listener * the TailerListener to use . * @ param delayMillis * the delay between checks of the file for new content in * milliseconds . * @ param end * Set to true to tail from ...
return Tailer . create ( file , listener , delayMillis , end , false , bufSize ) ;
public class DiskId { /** * Returns a disk identity given the zone and disk names . The disk name must be 1-63 characters * long and comply with RFC1035 . Specifically , the name must match the regular expression { @ code * [ a - z ] ( [ - a - z0-9 ] * [ a - z0-9 ] ) ? } which means the first character must be a lo...
return new DiskId ( null , zone , disk ) ;
public class ArrowButtonPainter { /** * Paint the arrow in pressed state . * @ param g the Graphics2D context to paint with . * @ param width the width . * @ param height the height . */ private void paintForegroundPressed ( Graphics2D g , int width , int height ) { } }
Shape s = decodeArrowPath ( width , height ) ; g . setPaint ( pressedColor ) ; g . fill ( s ) ;
public class ArmeriaConfigurationUtil { /** * Adds annotated HTTP services to the specified { @ link ServerBuilder } . */ public static void configureAnnotatedHttpServices ( ServerBuilder server , List < AnnotatedServiceRegistrationBean > beans , @ Nullable MeterIdPrefixFunctionFactory meterIdPrefixFunctionFactory ) { ...
requireNonNull ( server , "server" ) ; requireNonNull ( beans , "beans" ) ; beans . forEach ( bean -> { Function < Service < HttpRequest , HttpResponse > , ? extends Service < HttpRequest , HttpResponse > > decorator = Function . identity ( ) ; for ( Function < Service < HttpRequest , HttpResponse > , ? extends Service...
public class BasicServer { /** * Ingests the given system object if it doesn ' t exist , OR if it * exists , but this instance of Fedora has never been started . * This ensures that , upon upgrade , the old system object * is replaced with the new one . */ private void preIngestIfNeeded ( boolean firstRun , DOMan...
PID pid = new PID ( objectName . uri . substring ( "info:fedora/" . length ( ) ) ) ; boolean exists = doManager . objectExists ( pid . toString ( ) ) ; if ( exists && firstRun ) { logger . info ( "Purging old system object: {}" , pid ) ; Context context = ReadOnlyContext . getContext ( null , null , null , false ) ; DO...
public class Operators { /** * Fold two opcodes in a single int value ( if required ) . */ private int mergeOpcodes ( int ... opcodes ) { } }
int opcodesLen = opcodes . length ; Assert . check ( opcodesLen == 1 || opcodesLen == 2 ) ; return ( opcodesLen == 1 ) ? opcodes [ 0 ] : ( ( opcodes [ 0 ] << ByteCodes . preShift ) | opcodes [ 1 ] ) ;
public class GetFileInfoPRequest { /** * < code > optional . alluxio . grpc . file . GetFileInfoPOptions options = 2 ; < / code > */ public alluxio . grpc . GetFileInfoPOptionsOrBuilder getOptionsOrBuilder ( ) { } }
return options_ == null ? alluxio . grpc . GetFileInfoPOptions . getDefaultInstance ( ) : options_ ;
public class ResourceParametersImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EList < Parameter > getRole ( ) { } }
if ( role == null ) { role = new EObjectContainmentEList < Parameter > ( Parameter . class , this , BpsimPackage . RESOURCE_PARAMETERS__ROLE ) ; } return role ;
public class MessageDigestValue { /** * Create a new { @ link MessageDigestValue } object based on the passed source * byte array * @ param aBytes * The byte array to create the hash value from . May not be * < code > null < / code > . * @ param eAlgorithm * The algorithm to be used . May not be < code > nu...
final MessageDigest aMD = eAlgorithm . createMessageDigest ( ) ; aMD . update ( aBytes ) ; // aMD goes out of scope anyway , so no need to copy byte [ ] return new MessageDigestValue ( eAlgorithm , aMD . digest ( ) , false ) ;
public class ClassFile { /** * Returns the constant map index to reference * @ param refType * @ param fullyQualifiedname * @ param name * @ param descriptor * @ return */ protected int getRefIndex ( Class < ? extends Ref > refType , String fullyQualifiedname , String name , String descriptor ) { } }
String internalForm = fullyQualifiedname . replace ( '.' , '/' ) ; for ( ConstantInfo ci : listConstantInfo ( refType ) ) { Ref mr = ( Ref ) ci ; int classIndex = mr . getClass_index ( ) ; Clazz clazz = ( Clazz ) getConstantInfo ( classIndex ) ; String cn = getString ( clazz . getName_index ( ) ) ; if ( internalForm . ...
public class SystemUtils { /** * < p > Gets a System property , defaulting to < code > null < / code > if the property * cannot be read . < / p > * < p > If a < code > SecurityException < / code > is caught , the return value is < code > null < / code > . < / p > * @ param name the system property name * @ retu...
try { return System . getProperty ( name ) ; } catch ( AccessControlException ex ) { if ( log . isDebugEnabled ( ) ) { log . debug ( String . format ( "Caught AccessControlException when accessing system property [%s]; " + "its value will be returned [null]. Reason: %s" , name , ex . getMessage ( ) ) ) ; } } return nul...
public class JavaTypeToTypeSignature { /** * get the type signature corresponding to given java type * @ param type * @ return */ private FullTypeSignature getFullTypeSignature ( Type type ) { } }
if ( type instanceof Class < ? > ) { return getTypeSignature ( ( Class < ? > ) type ) ; } if ( type instanceof GenericArrayType ) { return getArrayTypeSignature ( ( GenericArrayType ) type ) ; } if ( type instanceof ParameterizedType ) { return getClassTypeSignature ( ( ParameterizedType ) type ) ; } return null ;
public class Solo { /** * Unlocks the lock screen . */ public void unlockScreen ( ) { } }
if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "unlockScreen()" ) ; } final Activity activity = activityUtils . getCurrentActivity ( false ) ; instrumentation . runOnMainSync ( new Runnable ( ) { @ Override public void run ( ) { if ( activity != null ) { activity . getWindow ( ) . addFlags ( Wi...
public class CommerceNotificationTemplateWrapper { /** * Returns the localized subject of this commerce notification template in the language . Uses the default language if no localization exists for the requested language . * @ param locale the locale of the language * @ return the localized subject of this commer...
return _commerceNotificationTemplate . getSubject ( locale ) ;
public class RequestedModuleNames { /** * Helper routine to unfold folded module names * @ param obj * The folded path list of names , as a string or JSON object * @ param path * The reference path * @ param aPrefixes * Array of loader plugin prefixes * @ param modules * Output - the list of unfolded mo...
final String sourceMethod = "unfoldModulesHelper" ; // $ NON - NLS - 1 $ if ( isTraceLogging ) { log . entering ( RequestedModuleNames . class . getName ( ) , sourceMethod , new Object [ ] { obj , path , aPrefixes != null ? Arrays . asList ( aPrefixes ) : null , modules } ) ; } if ( obj instanceof JSONObject ) { JSONOb...
public class SPX { /** * / * [ deutsch ] * < p > Implementierungsmethode des Interface { @ link Externalizable } . < / p > * @ param in input stream * @ throws IOException in case of I / O - problems * @ throws ClassNotFoundException if class - loading fails */ @ Override public void readExternal ( ObjectInput ...
int header = in . readByte ( ) ; switch ( header ) { case NEGATIVE_DAY_OF_MONTH_PATTERN_TYPE : this . obj = readPattern ( in ) ; break ; default : throw new StreamCorruptedException ( "Unknown serialized type." ) ; }
public class SpeakUtil { /** * Send the specified system message on the specified dobj . */ protected static void sendSystem ( DObject speakObj , String bundle , String message , byte level ) { } }
sendMessage ( speakObj , new SystemMessage ( message , bundle , level ) ) ;
public class ManagementClientImpl { /** * / * ( non - Javadoc ) * @ see tuwien . auto . calimero . mgmt . ManagementClient # readDomainAddress ( boolean ) */ public synchronized List readDomainAddress ( boolean oneDomainOnly ) throws KNXLinkClosedException , KNXInvalidResponseException , KNXTimeoutException { } }
// we allow 6 bytes ASDU for RF domains return makeDOAs ( readBroadcast ( priority , DataUnitBuilder . createCompactAPDU ( DOA_READ , null ) , DOA_RESPONSE , 6 , 6 , oneDomainOnly ) ) ;
public class IdentificationSet { /** * Adds an Element to the Set * @ param x the Element * @ param identification the identification * @ return true if this set did not already contain the specified element */ public boolean add ( X x , Identification identification ) { } }
return map . put ( x , identification ) == null ;
public class JdbcExtractor { /** * Get target column name if column is not found in metadata , then name it * as unknown column If alias is not found , target column is nothing but * source column * @ param sourceColumnName * @ param alias * @ return targetColumnName */ private String getTargetColumnName ( St...
String targetColumnName = alias ; Schema obj = this . getMetadataColumnMap ( ) . get ( sourceColumnName . toLowerCase ( ) ) ; if ( obj == null ) { targetColumnName = ( targetColumnName == null ? "unknown" + this . unknownColumnCounter : targetColumnName ) ; this . unknownColumnCounter ++ ; } else { targetColumnName = (...
public class BugLoader { /** * Create the IFindBugsEngine that will be used to analyze the application . * @ param p * the Project * @ param pcb * the PrintCallBack * @ return the IFindBugsEngine */ private static IFindBugsEngine createEngine ( @ Nonnull Project p , BugReporter pcb ) { } }
FindBugs2 engine = new FindBugs2 ( ) ; engine . setBugReporter ( pcb ) ; engine . setProject ( p ) ; engine . setDetectorFactoryCollection ( DetectorFactoryCollection . instance ( ) ) ; // Honor - effort option if one was given on the command line . engine . setAnalysisFeatureSettings ( Driver . getAnalysisSettingList ...
public class DateUtils { /** * < p > Constructs an < code > Iterator < / code > over each day in a date * range defined by a focus date and range style . < / p > * < p > For instance , passing Thursday , July 4 , 2002 and a * < code > RANGE _ MONTH _ SUNDAY < / code > will return an < code > Iterator < / code > ...
if ( focus == null ) { throw new IllegalArgumentException ( "The date must not be null" ) ; } Calendar start = null ; Calendar end = null ; int startCutoff = Calendar . SUNDAY ; int endCutoff = Calendar . SATURDAY ; switch ( rangeStyle ) { case RANGE_MONTH_SUNDAY : case RANGE_MONTH_MONDAY : // Set start to the first of...
public class CPInstancePersistenceImpl { /** * Returns the first cp instance in the ordered set where groupId = & # 63 ; and status & ne ; & # 63 ; . * @ param groupId the group ID * @ param status the status * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) ...
CPInstance cpInstance = fetchByG_NotST_First ( groupId , status , orderByComparator ) ; if ( cpInstance != null ) { return cpInstance ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "groupId=" ) ; msg . append ( groupId ) ; msg . append ( ", status=" ) ; msg ...
public class StringProcessChain { /** * Replaces each substring of given source string that matches the given * regular expression ignore case sensitive with the given replacement . < br > * @ param target target string want to be replaces . * @ param replacement string of replace to . * @ return a new string h...
StringBuilder result = new StringBuilder ( ) ; String temp = source ; int indexOfIgnoreCase = 0 ; while ( true ) { indexOfIgnoreCase = StringUtils . indexOfIgnoreCase ( temp , target ) ; if ( indexOfIgnoreCase == StringUtils . INDEX_OF_NOT_FOUND ) { result . append ( temp ) ; break ; } result . append ( temp . substrin...
public class DiscreteCosineTransform { /** * 1 - D Backward Discrete Cosine Transform . * @ param data Data . */ public static void Backward ( double [ ] data ) { } }
double [ ] result = new double [ data . length ] ; double sum ; double scale = Math . sqrt ( 2.0 / data . length ) ; for ( int t = 0 ; t < data . length ; t ++ ) { sum = 0 ; for ( int j = 0 ; j < data . length ; j ++ ) { double cos = Math . cos ( ( ( 2 * t + 1 ) * j * Math . PI ) / ( 2 * data . length ) ) ; sum += alph...
public class TagLibraryCache { /** * PK68590 start */ private void loadLooseLibTagFiles ( String looseLibDir , List loadedLocations , String looseKey ) { } }
// PM07608 / / PM03123 if ( logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "loadLooseLibTagFiles" , "looseLibDir {0}" , looseLibDir ) ; } File looseLibDirFile = new File ( looseLibDir ) ; String [ ] list = looseLibDirFile . list ( ) ; if ( list == null ) { // PM03123 null if not de...
public class AgentInternalEventsDispatcher { /** * Posts an event to all registered { @ code BehaviorGuardEvaluator } . * The dispatch of this event will be done asynchronously . * This method will return successfully after the event has been posted to all { @ code BehaviorGuardEvaluator } , and regardless * of a...
assert event != null ; this . executor . execute ( ( ) -> { Iterable < BehaviorGuardEvaluator > behaviorGuardEvaluators = null ; synchronized ( AgentInternalEventsDispatcher . this . behaviorGuardEvaluatorRegistry ) { behaviorGuardEvaluators = AgentInternalEventsDispatcher . this . behaviorGuardEvaluatorRegistry . getB...