signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class TimeoutImpl { /** * Get the timeout from the policy and start the timer * @ param timeoutTask */ private void start ( Runnable timeoutTask ) { } }
long timeout = timeoutPolicy . getTimeout ( ) . toNanos ( ) ; start ( timeoutTask , timeout ) ;
public class druidGParser { /** * druidG . g : 433:1 : selectorFilter returns [ Filter filter ] : e = getEquals ; */ public final Filter selectorFilter ( ) throws RecognitionException { } }
Filter filter = null ; EqualsToHolder e = null ; filter = new Filter ( "selector" ) ; try { // druidG . g : 435:2 : ( e = getEquals ) // druidG . g : 435:4 : e = getEquals { pushFollow ( FOLLOW_getEquals_in_selectorFilter2973 ) ; e = getEquals ( ) ; state . _fsp -- ; filter . dimension = e . name ; filter . value = unq...
public class MessageDrivenBeanTypeImpl { /** * Returns all < code > timer < / code > elements * @ return list of < code > timer < / code > */ public List < TimerType < MessageDrivenBeanType < T > > > getAllTimer ( ) { } }
List < TimerType < MessageDrivenBeanType < T > > > list = new ArrayList < TimerType < MessageDrivenBeanType < T > > > ( ) ; List < Node > nodeList = childNode . get ( "timer" ) ; for ( Node node : nodeList ) { TimerType < MessageDrivenBeanType < T > > type = new TimerTypeImpl < MessageDrivenBeanType < T > > ( this , "t...
public class JavaEscape { /** * Perform a Java < strong > unescape < / strong > operation on a < tt > String < / tt > input . * No additional configuration arguments are required . Unescape operations * will always perform < em > complete < / em > Java unescape of SECs , u - based and octal escapes . * This metho...
if ( text == null ) { return null ; } if ( text . indexOf ( '\\' ) < 0 ) { // Fail fast , avoid more complex ( and less JIT - table ) method to execute if not needed return text ; } return JavaEscapeUtil . unescape ( text ) ;
public class ColorFidelityImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setColSub ( Integer newColSub ) { } }
Integer oldColSub = colSub ; colSub = newColSub ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . COLOR_FIDELITY__COL_SUB , oldColSub , colSub ) ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcStructuralLoadSingleForceWarping ( ) { } }
if ( ifcStructuralLoadSingleForceWarpingEClass == null ) { ifcStructuralLoadSingleForceWarpingEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 650 ) ; } return ifcStructuralLoadSingleForceWarpingEClass ;
public class ClassFinderActivator { /** * Get the package name of this class name . * NOTE : This is exactly the same as Util . getPackageName , move this ! * @ param className * @ return */ public static String getPackageName ( String className , boolean resource ) { } }
String packageName = null ; if ( className != null ) { if ( className . indexOf ( File . separator ) != - 1 ) { className = className . substring ( 0 , className . lastIndexOf ( File . separator ) ) ; packageName = className . replace ( File . separator . charAt ( 0 ) , '.' ) ; } else if ( className . indexOf ( '/' ) !...
public class CmsTabDialog { /** * Returns the start html for the tab content area of the dialog window . < p > * @ param title the title for the dialog * @ param attributes additional attributes for the content & lt ; div & gt ; area of the tab dialog * @ return the start html for the tab content area of the dial...
return dialogTabContent ( HTML_START , title , attributes ) ;
public class Validate { /** * < p > Validate that the specified argument object fall between the two * inclusive values specified ; otherwise , throws an exception . < / p > * < pre > Validate . inclusiveBetween ( 0 , 2 , 1 ) ; < / pre > * @ param < T > the type of the argument object * @ param start the inclus...
// TODO when breaking BC , consider returning value if ( value . compareTo ( start ) < 0 || value . compareTo ( end ) > 0 ) { throw new IllegalArgumentException ( StringUtils . simpleFormat ( DEFAULT_INCLUSIVE_BETWEEN_EX_MESSAGE , value , start , end ) ) ; }
public class ComponentsJmxRegistration { /** * Unregisters all the MBeans registered through { @ link # registerMBeans ( Collection ) } . * @ param resourceDMBeans */ public void unregisterMBeans ( Collection < ResourceDMBean > resourceDMBeans ) throws CacheException { } }
log . trace ( "Unregistering jmx resources.." ) ; try { for ( ResourceDMBean resource : resourceDMBeans ) { JmxUtil . unregisterMBean ( getObjectName ( resource ) , mBeanServer ) ; } } catch ( Exception e ) { throw new CacheException ( "Failure while unregistering mbeans" , e ) ; }
public class ListFuncSup { /** * define a function to deal with each element in the list with given * start index * @ param func * a function takes in each element from list * @ param index * the index where to start iteration * @ return return ' last loop value ' . < br > * check * < a href = " https :...
return ( R ) forEach ( $ ( func ) , index ) ;
public class JNIWriter { /** * Emit a class file for a given class . * @ param c The class from which a class file is generated . */ public FileObject write ( ClassSymbol c ) throws IOException { } }
String className = c . flatName ( ) . toString ( ) ; FileObject outFile = fileManager . getFileForOutput ( StandardLocation . NATIVE_HEADER_OUTPUT , "" , className . replaceAll ( "[.$]" , "_" ) + ".h" , null ) ; Writer out = outFile . openWriter ( ) ; try { write ( out , c ) ; if ( verbose ) log . printVerbose ( "wrote...
public class FastQueue { /** * Returns the first index which equals ( ) obj . - 1 is there is no match * @ param obj The object being searched for * @ return index or - 1 if not found */ public int indexOf ( T obj ) { } }
for ( int i = 0 ; i < size ; i ++ ) { if ( data [ i ] . equals ( obj ) ) { return i ; } } return - 1 ;
public class TimeSeriesLookup { /** * Compiles a scanner with the given salt ID if salting is enabled AND we ' re * not scanning the meta table . * @ param salt An ID for the salt bucket * @ return A scanner to send to HBase . */ private Scanner getScanner ( final int salt ) { } }
final Scanner scanner = tsdb . getClient ( ) . newScanner ( query . useMeta ( ) ? tsdb . metaTable ( ) : tsdb . dataTable ( ) ) ; scanner . setFamily ( query . useMeta ( ) ? TSMeta . FAMILY : TSDB . FAMILY ( ) ) ; if ( metric_uid != null ) { byte [ ] key ; if ( query . useMeta ( ) || Const . SALT_WIDTH ( ) < 1 ) { key ...
public class CurrencyToken { /** * This method tries to evaluate the localized display name for a * { @ link CurrencyUnit } . It uses { @ link Currency # getDisplayName ( Locale ) } if * the given currency code maps to a JDK { @ link Currency } instance . * If not found { @ code currency . getCurrencyCode ( ) } i...
Currency jdkCurrency = getCurrency ( currency . getCurrencyCode ( ) ) ; if ( jdkCurrency != null ) { return jdkCurrency . getDisplayName ( locale ) ; } return currency . getCurrencyCode ( ) ;
public class DriverClientDispatcher { /** * We must implement this synchronously in order to catch exceptions and * forward them back via the bridge before the server shuts down , after * this method returns . * @ param stopTime stop time */ @ SuppressWarnings ( "checkstyle:illegalCatch" ) public Throwable dispat...
try { for ( final EventHandler < StopTime > handler : stopHandlers ) { handler . onNext ( stopTime ) ; } return null ; } catch ( Throwable t ) { return t ; }
public class ContainerAS { /** * Register the synchronization object with this activity session */ public void registerSynchronization ( Synchronization s ) throws CPIException { } }
try { ivContainer . uowCtrl . enlistWithSession ( s ) ; // enlistSession ( s ) } catch ( CSIException e ) { throw new CPIException ( e . toString ( ) ) ; }
public class MySQLMultiDbJDBCConnection { /** * { @ inheritDoc } */ public void delete ( NodeData data ) throws RepositoryException , UnsupportedOperationException , InvalidItemStateException , IllegalStateException { } }
addedNodes . remove ( data . getIdentifier ( ) ) ; super . delete ( data ) ;
public class LogRecordStack { /** * Returns thread id from the current stack . It is called by log handler * to get thread id which is either passed for the record in a request or * obtained from the thread directly . * @ return thread id from the stack . */ public static int getThreadID ( ) { } }
StackInfo result = MDC . get ( ) ; return result == null ? HpelHelper . getIntThreadId ( ) : result . threadId ;
public class GetObjectInformationRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetObjectInformationRequest getObjectInformationRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getObjectInformationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getObjectInformationRequest . getDirectoryArn ( ) , DIRECTORYARN_BINDING ) ; protocolMarshaller . marshall ( getObjectInformationRequest . getObjectReference...
public class LogManager { /** * Send a verbose log message to the logger . * @ param tag Used to identify the source of a log message . It usually identifies * the class or activity where the log call occurs . * @ param message The message you would like logged . This message may contain string formatting * whi...
sLogger . v ( t , tag , message , args ) ;
public class Server { /** * Return scope key . Scope key consists of host name concatenated with context path by slash symbol * @ param hostName * Host name * @ param contextPath * Context path * @ return Scope key as string */ protected String getKey ( String hostName , String contextPath ) { } }
return String . format ( "%s/%s" , ( hostName == null ? EMPTY : hostName ) , ( contextPath == null ? EMPTY : contextPath ) ) ;
public class ExperimentsInner { /** * Creates an Experiment . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param workspaceName The name of the workspace . Workspace names can only contain a combination of alphanumeric characters along with dash ( - ) and underscore ( _ ...
return beginCreateWithServiceResponseAsync ( resourceGroupName , workspaceName , experimentName ) . map ( new Func1 < ServiceResponse < ExperimentInner > , ExperimentInner > ( ) { @ Override public ExperimentInner call ( ServiceResponse < ExperimentInner > response ) { return response . body ( ) ; } } ) ;
public class Lookup { /** * Gets the Cache that will be used as the default for the specified * class by future Lookups . * @ param dclass The class whose cache is being retrieved . * @ return The default cache for the specified class . */ public static synchronized Cache getDefaultCache ( int dclass ) { } }
DClass . check ( dclass ) ; Cache c = ( Cache ) defaultCaches . get ( Mnemonic . toInteger ( dclass ) ) ; if ( c == null ) { c = new Cache ( dclass ) ; defaultCaches . put ( Mnemonic . toInteger ( dclass ) , c ) ; } return c ;
public class QuotedStringTokenizer { /** * Unquote a string . * @ param s The string to unquote . * @ return quoted string */ public static String unquote ( String s ) { } }
if ( s == null ) return null ; if ( s . length ( ) < 2 ) return s ; char first = s . charAt ( 0 ) ; char last = s . charAt ( s . length ( ) - 1 ) ; if ( first != last || ( first != '"' && first != '\'' ) ) return s ; StringBuffer b = new StringBuffer ( s . length ( ) - 2 ) ; synchronized ( b ) { boolean quote = false ;...
public class BatchGetDeploymentGroupsRequest { /** * The names of the deployment groups . * @ return The names of the deployment groups . */ public java . util . List < String > getDeploymentGroupNames ( ) { } }
if ( deploymentGroupNames == null ) { deploymentGroupNames = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return deploymentGroupNames ;
public class SimpleNaviRpcClient { /** * 调用通信 * @ param method * 方法 * @ param args * 参数 * @ param parameterTypes * 参数类型 * @ param genericReturnType * 泛型返回结果类型 * @ param attachment附加信息 * @ return 结果对象 * @ throws Throwable * 异常信息 */ public Object transport ( String methodName , Object [ ] args , C...
ResponseDTO response ; long start = System . currentTimeMillis ( ) ; try { RequestDTO request = makeRequestDTO ( methodName , args , parameterTypes ) ; if ( attachment != null ) { attachmentHandler . handle ( request , attachment ) ; } byte [ ] reqBytes = serializeHandler . serialize ( request , RequestDTO . class ) ; ...
public class EvolutionDurations { /** * Return an new { @ code EvolutionDurations } object with the given values . * @ param offspringSelectionDuration the duration needed for selecting the * offspring population * @ param survivorsSelectionDuration the duration needed for selecting the * survivors population ...
return new EvolutionDurations ( offspringSelectionDuration , survivorsSelectionDuration , offspringAlterDuration , offspringFilterDuration , survivorFilterDuration , evaluationDuration , evolveDuration ) ;
public class CmsCommandInitGenerator { /** * This method generates the source code for the class initializer class . < p > * @ param logger the logger to be used * @ param context the generator context * @ param subclasses the classes for which the generated code should the initClass ( ) method */ public void gen...
PrintWriter printWriter = context . tryCreate ( logger , PACKAGE_NAME , CLASS_NAME ) ; if ( printWriter == null ) { return ; } ClassSourceFileComposerFactory composer = new ClassSourceFileComposerFactory ( PACKAGE_NAME , CLASS_NAME ) ; composer . addImplementedInterface ( INIT_INTERFACE_NAME ) ; SourceWriter sourceWrit...
public class QualifiedName { /** * For an identifier of the form " a . b . c . d " , returns " a . b . c " * For an identifier of the form " a " , returns absent */ public Optional < QualifiedName > getPrefix ( ) { } }
if ( parts . size ( ) == 1 ) { return Optional . empty ( ) ; } List < String > subList = parts . subList ( 0 , parts . size ( ) - 1 ) ; return Optional . of ( new QualifiedName ( subList , subList ) ) ;
public class ForSignatureVisitor { /** * Visits a type which might define an owner type . * @ param ownableType The visited generic type . */ private void onOwnableType ( Generic ownableType ) { } }
Generic ownerType = ownableType . getOwnerType ( ) ; if ( ownerType != null && ownerType . getSort ( ) . isParameterized ( ) ) { onOwnableType ( ownerType ) ; signatureVisitor . visitInnerClassType ( ownableType . asErasure ( ) . getSimpleName ( ) ) ; } else { signatureVisitor . visitClassType ( ownableType . asErasure...
public class Replication { /** * Restarts the replication . This blocks until the replication successfully stops . * Alternatively , you can stop ( ) the replication and create a brand new one and start ( ) it . */ @ InterfaceAudience . Public public void restart ( ) { } }
// stop replicator if necessary if ( this . isRunning ( ) ) { final CountDownLatch stopped = new CountDownLatch ( 1 ) ; ChangeListener listener = new ChangeListener ( ) { @ Override public void changed ( ChangeEvent event ) { if ( event . getTransition ( ) != null && event . getTransition ( ) . getDestination ( ) == Re...
public class LoadBalancersInner { /** * Gets the specified load balancer . * @ param resourceGroupName The name of the resource group . * @ param loadBalancerName The name of the load balancer . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the ...
return getByResourceGroupWithServiceResponseAsync ( resourceGroupName , loadBalancerName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class AnnotationStringConverterFactory { /** * Finds the conversion method . * @ param cls the class to find a method for , not null * @ param toString the toString method , not null * @ param searchSuperclasses whether to search superclasses * @ return the method to call , null means not found * @ thr...
// find in superclass hierarchy Class < ? > loopCls = cls ; while ( loopCls != null ) { Method fromString = findFromString ( loopCls ) ; if ( fromString != null ) { return new MethodsStringConverter < T > ( cls , toString , fromString , loopCls ) ; } if ( searchSuperclasses == false ) { break ; } loopCls = loopCls . ge...
public class SearchModule { /** * Scans the classpath for Search implementations , through the * { @ link ServiceLoader } mechanism and returns one . * @ param classSimpleName the name of the class name to look for and load * @ return a Search instance if found , or null */ final Search loadExternalSearch ( Strin...
ServiceLoader < Search > searchLoader = ServiceLoader . load ( Search . class , Para . getParaClassLoader ( ) ) ; for ( Search search : searchLoader ) { if ( search != null && classSimpleName . equalsIgnoreCase ( search . getClass ( ) . getSimpleName ( ) ) ) { return search ; } } return null ;
public class NetFlowV9Parser { /** * like above , but contains all records for the template id as raw bytes */ public static Integer parseRecordShallow ( ByteBuf bb ) { } }
final int start = bb . readerIndex ( ) ; int usedTemplateId = bb . readUnsignedShort ( ) ; int length = bb . readUnsignedShort ( ) ; int end = bb . readerIndex ( ) - 4 + length ; bb . readerIndex ( end ) ; return usedTemplateId ;
public class QueryBuilder { /** * Constructs a query from the current configuration of this Builder . * @ return a { @ link GazetteerQuery } configuration object */ public GazetteerQuery build ( ) { } }
return new GazetteerQuery ( location , maxResults , fuzzyMode , ancestryMode , includeHistorical , filterDupes , parentIds , featureCodes ) ;
public class Stream { /** * Sets a timeout by supplying the absolute milliseconds timestamp when the { @ code Stream } * will be forcedly closed . If the supplied value is null , any previously set timeout is * removed . In case the { @ code Stream has already been closed } , or has just timed out due to a * prev...
Preconditions . checkArgument ( timestamp == null || timestamp > System . currentTimeMillis ( ) ) ; synchronized ( this . state ) { if ( this . state . closed ) { return this ; // NOP , already closed } if ( this . state . timeoutFuture != null ) { if ( ! this . state . timeoutFuture . cancel ( false ) ) { return this ...
public class MultiQueueExecutor { /** * Calls flushTermination ( ) , flushUpdate ( ) , flushInsert ( ) and shutdown ( ) and waits for all pending tasks * to finish . * To ensure proper error handling , this method must be called . */ public void waitUntilFinished ( ) { } }
flushTermination ( ) ; flushUpdate ( ) ; flushInsert ( ) ; shutdown ( ) ; for ( int i = 0 ; i < numberOfQueues ; i ++ ) { while ( ! executors [ i ] . isTerminated ( ) ) { try { executors [ i ] . awaitTermination ( 10000000 , TimeUnit . SECONDS ) ; } catch ( InterruptedException e ) { // ignore } } } if ( useBulkInsert ...
public class SlingI18nMap { /** * Build i18n resource XML in Sling i18n Message format . * @ return XML */ public String getI18nXmlString ( ) { } }
Format format = Format . getPrettyFormat ( ) ; XMLOutputter outputter = new XMLOutputter ( format ) ; return outputter . outputString ( buildI18nXml ( ) ) ;
public class Nucleotide { /** * This method returns the HELM notation for nucleotide linker * @ return linker notation */ public String getLinkerNotation ( ) { } }
String pSymbol = getPhosphateSymbol ( ) ; String result = null ; if ( null == pSymbol || pSymbol . length ( ) == 0 ) { result = "" ; } else { if ( pSymbol . length ( ) > 1 ) result = "[" + pSymbol + "]" ; else result = pSymbol ; } return result ;
public class GalleriesApi { /** * Return the list of galleries to which a photo has been added . Galleries are returned sorted by date which the photo was added to the gallery . * < br > * This method does not require authentication . * @ param photoId Required . The ID of the photo to fetch a list of galleries f...
JinxUtils . validateParams ( photoId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.galleries.getListForPhoto" ) ; params . put ( "photo_id" , photoId ) ; if ( perPage > 0 ) { params . put ( "per_page" , Integer . toString ( perPage ) ) ; } if ( page > 0 ) { params . put ( ...
public class PhynixxManagedConnectionFactory { /** * the connection is released to the pool */ @ Override public void connectionReleased ( IManagedConnectionEvent < C > event ) { } }
IPhynixxManagedConnection < C > proxy = event . getManagedConnection ( ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Proxy " + proxy + " released" ) ; }
public class AbstractRestController { /** * Create / save an entity . */ @ RequestMapping ( method = RequestMethod . POST ) public ResponseEntity < E > save ( HttpServletRequest request ) { } }
final String simpleClassName = getEntityClass ( ) . getSimpleName ( ) ; final String errorMessagePrefix = "Error when saving entity of type " + simpleClassName + ": " ; BufferedReader reader = null ; // read and parse the json request body try { reader = request . getReader ( ) ; E entity = objectMapper . readValue ( r...
public class VariableNumMap { /** * Gets the index of the variable named { @ code variableName } . Returns * { @ code - 1 } if no such variable exists . * @ param variableName * @ return */ public final int getVariableByName ( String variableName ) { } }
int index = getVariableIndex ( variableName ) ; if ( index == - 1 ) { return index ; } else { return nums [ index ] ; }
public class CalendarConverter { /** * Gets the millis , which is the Calendar millis value . * @ param object the Calendar to convert , must not be null * @ param chrono the chronology result from getChronology , non - null * @ return the millisecond value * @ throws NullPointerException if the object is null ...
Calendar calendar = ( Calendar ) object ; return calendar . getTime ( ) . getTime ( ) ;
public class StringUtils { /** * URL - Decodes a given string using ISO - 8859-1 . No UnsupportedEncodingException to handle as it is dealt with in * this method . */ public static String decodeUrlIso ( String stringToDecode ) { } }
try { return URLDecoder . decode ( stringToDecode , "ISO-8859-1" ) ; } catch ( UnsupportedEncodingException e1 ) { throw new RuntimeException ( e1 ) ; }
public class ConsoleMenu { /** * Gets a String from the System . in . * @ param msg * for the command line * @ return String as entered by the user of the console app */ public static String getString ( final String msg ) { } }
ConsoleMenu . print ( msg ) ; BufferedReader bufReader = null ; String opt = null ; try { bufReader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; opt = bufReader . readLine ( ) ; } catch ( final IOException ex ) { log ( ex ) ; System . exit ( 1 ) ; } return opt ;
public class InjectionUtils { /** * Liberty Change for CXF Begain */ private static boolean isAsyncMethod ( Method method ) { } }
Class < ? > [ ] parameterTypes = method . getParameterTypes ( ) ; for ( Class < ? > c : parameterTypes ) { if ( c . isAssignableFrom ( javax . ws . rs . container . AsyncResponse . class ) ) return true ; } return false ;
public class EmailCommandInstruction { /** * ( non - Javadoc ) * @ see net . roboconf . core . commands . AbstractCommandInstruction # doValidate ( ) */ @ Override public List < ParsingError > doValidate ( ) { } }
List < ParsingError > result = new ArrayList < > ( ) ; if ( Utils . isEmptyOrWhitespaces ( this . msg ) ) result . add ( error ( ErrorCode . CMD_EMAIL_NO_MESSAGE ) ) ; return result ;
public class Battery { /** * Calculates the rectangle that specifies the area that is available * for painting the gauge . This means that if the component has insets * that are larger than 0 , these will be taken into account . */ private void calcInnerBounds ( ) { } }
final java . awt . Insets INSETS = getInsets ( ) ; INNER_BOUNDS . setBounds ( INSETS . left , INSETS . top , ( getWidth ( ) - INSETS . left - INSETS . right ) , ( getHeight ( ) - INSETS . top - INSETS . bottom ) ) ;
public class GetLoggerDefinitionVersionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetLoggerDefinitionVersionRequest getLoggerDefinitionVersionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getLoggerDefinitionVersionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getLoggerDefinitionVersionRequest . getLoggerDefinitionId ( ) , LOGGERDEFINITIONID_BINDING ) ; protocolMarshaller . marshall ( getLoggerDefinitionVersi...
public class AWSGreengrassClient { /** * Creates a version of a resource definition that has already been defined . * @ param createResourceDefinitionVersionRequest * @ return Result of the CreateResourceDefinitionVersion operation returned by the service . * @ throws BadRequestException * invalid request * @...
request = beforeClientExecution ( request ) ; return executeCreateResourceDefinitionVersion ( request ) ;
public class FileUtil { /** * 按照给定的readerHandler读取文件中的数据 * @ param < T > 集合类型 * @ param readerHandler Reader处理类 * @ param path 文件的绝对路径 * @ param charset 字符集 * @ return 从文件中load出的数据 * @ throws IORuntimeException IO异常 * @ deprecated 使用FileUtil # load ( String , String , ReaderHandler ) 代替 */ @ Deprecated pu...
return FileReader . create ( file ( path ) , CharsetUtil . charset ( charset ) ) . read ( readerHandler ) ;
public class NodeWriteTrx { /** * Building name consisting out of prefix and name . NamespaceUri is not used * over here . * @ param pQName * the { @ link QName } of an element * @ return a string with [ prefix : ] localname */ public static String buildName ( final QName pQName ) { } }
if ( pQName == null ) { throw new NullPointerException ( "mQName must not be null!" ) ; } String name ; if ( pQName . getPrefix ( ) . isEmpty ( ) ) { name = pQName . getLocalPart ( ) ; } else { name = new StringBuilder ( pQName . getPrefix ( ) ) . append ( ":" ) . append ( pQName . getLocalPart ( ) ) . toString ( ) ; }...
public class Isomorphism { /** * { @ inheritDoc } * @ param reactant * @ param product */ @ Override public void init ( IAtomContainer reactant , IAtomContainer product , boolean removeHydrogen , boolean cleanAndConfigureMolecule ) throws CDKException { } }
this . removeHydrogen = removeHydrogen ; init ( new MolHandler ( reactant , removeHydrogen , cleanAndConfigureMolecule ) , new MolHandler ( product , removeHydrogen , cleanAndConfigureMolecule ) ) ;
public class ClassGraph { /** * Scan one or more specific packages and their sub - packages . * N . B . Automatically calls { @ link # enableClassInfo ( ) } - - call { @ link # whitelistPaths ( String . . . ) } instead if you * only need to scan resources . * @ param packageNames * The fully - qualified names o...
enableClassInfo ( ) ; for ( final String packageName : packageNames ) { final String packageNameNormalized = WhiteBlackList . normalizePackageOrClassName ( packageName ) ; if ( packageNameNormalized . startsWith ( "!" ) || packageNameNormalized . startsWith ( "-" ) ) { throw new IllegalArgumentException ( "This style o...
public class VirtualMachineScaleSetsInner { /** * Update a VM scale set . * @ param resourceGroupName The name of the resource group . * @ param vmScaleSetName The name of the VM scale set to create or update . * @ param parameters The scale set object . * @ param serviceCallback the async ServiceCallback to ha...
return ServiceFuture . fromResponse ( updateWithServiceResponseAsync ( resourceGroupName , vmScaleSetName , parameters ) , serviceCallback ) ;
public class AbstractExecutableMemberWriter { /** * Get the type parameters for the executable member . * @ param member the member for which to get the type parameters . * @ return the type parameters . */ protected Content getTypeParameters ( ExecutableMemberDoc member ) { } }
LinkInfoImpl linkInfo = new LinkInfoImpl ( configuration , LinkInfoImpl . Kind . MEMBER_TYPE_PARAMS , member ) ; return writer . getTypeParameterLinks ( linkInfo ) ;
public class SqlModifyBuilder { /** * Generate . * @ param classBuilder * the class builder * @ param method * the method */ public static void generate ( TypeSpec . Builder classBuilder , SQLiteModelMethod method ) { } }
ModifyType updateResultType = detectModifyType ( method , method . jql . operationType ) ; // if true , field must be associate to ben attributes TypeName returnType = method . getReturnClass ( ) ; if ( updateResultType == null ) { throw ( new InvalidMethodSignException ( method ) ) ; } // generate method code MethodSp...
public class SIAImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case AfplibPackage . SIA__ADJSTMNT : return getADJSTMNT ( ) ; case AfplibPackage . SIA__DIRCTION : return getDIRCTION ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
public class MaterialComboBox { /** * Add Value directly to combobox component * @ param text - The text you want to labeled on the option item * @ param value - The value you want to pass through in this option */ public Option addItem ( String text , T value ) { } }
if ( ! values . contains ( value ) ) { Option option = buildOption ( text , value ) ; values . add ( value ) ; listbox . add ( option ) ; return option ; } return null ;
public class HylaFaxClientSpi { /** * This function will submit a new fax job . < br > * The fax job ID may be populated by this method in the provided * fax job object . * @ param client * The client instance * @ param faxJob * The fax job object containing the needed information * @ throws Exception *...
// get job Job job = faxJob . getHylaFaxJob ( ) ; // add document to fax String filePath = faxJob . getFilePath ( ) ; job . addDocument ( filePath ) ; // submit job client . submit ( job ) ;
public class WsByteBufferUtils { /** * Convert an array of buffers to a byte array . The buffers will remain * unchanged * by this conversion . This will stop on the first null buffer . A null or * empty * list will return a null byte [ ] . * @ param list * @ return byte [ ] */ public static final byte [ ] ...
if ( null == list ) return null ; int size = 0 ; for ( int i = 0 ; i < list . length && null != list [ i ] ; i ++ ) { size += list [ i ] . limit ( ) ; } if ( 0 == size ) return null ; byte [ ] output = new byte [ size ] ; int offset = 0 ; int position = 0 ; for ( int i = 0 ; i < list . length && null != list [ i ] ; i ...
public class CreateTriggerRequest { /** * The tags to use with this trigger . You may use tags to limit access to the trigger . For more information about * tags in AWS Glue , see < a href = " http : / / docs . aws . amazon . com / glue / latest / dg / monitor - tags . html " > AWS Tags in AWS * Glue < / a > in the...
setTags ( tags ) ; return this ;
public class CPRuleAssetCategoryRelPersistenceImpl { /** * Returns all the cp rule asset category rels . * @ return the cp rule asset category rels */ @ Override public List < CPRuleAssetCategoryRel > findAll ( ) { } }
return findAll ( QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class AuthFilterJAAS { /** * ( non - Javadoc ) * @ see javax . servlet . Filter # doFilter ( javax . servlet . ServletRequest , * javax . servlet . ServletResponse , javax . servlet . FilterChain ) */ @ Override public void doFilter ( ServletRequest request , ServletResponse response , FilterChain chain ) th...
HttpServletRequest req = ( HttpServletRequest ) request ; HttpServletResponse res = ( HttpServletResponse ) response ; // This is a hack to skip challenge authentication of API - A methods via the // REST API if API - A AuthN is off ( as indicated by the " authnAPIA " // filter init - param ) . // If API - A AuthN is o...
public class Matrix4x3d { /** * Store the values of the given matrix < code > m < / code > into < code > this < / code > matrix . * @ param m * the matrix to copy the values from * @ return this */ public Matrix4x3d set ( Matrix4x3dc m ) { } }
m00 = m . m00 ( ) ; m01 = m . m01 ( ) ; m02 = m . m02 ( ) ; m10 = m . m10 ( ) ; m11 = m . m11 ( ) ; m12 = m . m12 ( ) ; m20 = m . m20 ( ) ; m21 = m . m21 ( ) ; m22 = m . m22 ( ) ; m30 = m . m30 ( ) ; m31 = m . m31 ( ) ; m32 = m . m32 ( ) ; properties = m . properties ( ) ; return this ;
public class PTSaxton2006 { /** * For calculating SKSAT * @ param soilParas should include 1 . Sand weight percentage by layer * ( [ 0,100 ] % ) , 2 . Clay weight percentage by layer ( [ 0,100 ] % ) , 3 . Organic * matter weight percentage by layer ( [ 0,100 ] % ) , ( = SLOC * 1.72 ) , 4 . Grave * weight percen...
if ( soilParas != null && soilParas . length >= 3 ) { if ( soilParas . length >= 4 ) { return divide ( calcSatBulk ( soilParas [ 0 ] , soilParas [ 1 ] , soilParas [ 2 ] , divide ( soilParas [ 3 ] , "100" ) ) , "10" , 3 ) ; } else { return divide ( calcSatMatric ( soilParas [ 0 ] , soilParas [ 1 ] , soilParas [ 2 ] ) , ...
public class Exp { /** * Backward pass : * dG / dx _ i + = dG / dy _ i dy _ i / dx _ i = dG / dy _ i exp ( x _ i ) */ @ Override public void backward ( ) { } }
Tensor tmp = new Tensor ( yAdj ) ; // copy tmp . elemMultiply ( y ) ; modInX . getOutputAdj ( ) . elemAdd ( tmp ) ;
public class nitro_service { /** * Use this API to enable the feature on Netscaler . * @ param feature feature to be enabled . * @ return status of the operation performed . * @ throws Exception Nitro exception . */ public base_response enable_features ( String [ ] features ) throws Exception { } }
base_response result = null ; nsfeature resource = new nsfeature ( ) ; resource . set_feature ( features ) ; options option = new options ( ) ; option . set_action ( "enable" ) ; result = resource . perform_operation ( this , option ) ; return result ;
public class Client { /** * Get a batch of users assigned to privilege . * @ param id Id of the privilege * @ param batchSize Size of the Batch * @ param afterCursor Reference to continue collecting items of next page * @ return OneLoginResponse of User ( Batch ) * @ throws OAuthSystemException - if there is ...
ExtractionContext context = extractResourceBatch ( ( Object ) id , batchSize , afterCursor , Constants . GET_USERS_ASSIGNED_TO_PRIVILEGE_URL ) ; List < Long > userIds = new ArrayList < Long > ( batchSize ) ; afterCursor = getUsersAssignedToPrivilegesBatch ( userIds , context . url , context . bearerRequest , context . ...
public class RuntimeDataServiceImpl { /** * start * task methods */ @ Override public UserTaskInstanceDesc getTaskByWorkItemId ( Long workItemId ) { } }
Map < String , Object > params = new HashMap < String , Object > ( ) ; params . put ( "workItemId" , workItemId ) ; params . put ( "maxResults" , 1 ) ; List < UserTaskInstanceDesc > tasks = commandService . execute ( new QueryNameCommand < List < UserTaskInstanceDesc > > ( "getTaskInstanceByWorkItemId" , params ) ) ; i...
public class ContextClassLoaderUtils { /** * Executes a piece of code ( callable . call ) using a specific class loader set as context class loader . * If the curent thread context clas loader is already set , it will be restored after execution . * @ param classLoader clas loader to be used as context clas loader ...
Thread currentThread = null ; ClassLoader backupClassLoader = null ; try { if ( classLoader != null ) { currentThread = Thread . currentThread ( ) ; backupClassLoader = currentThread . getContextClassLoader ( ) ; currentThread . setContextClassLoader ( classLoader ) ; } return callable . call ( ) ; } finally { if ( cla...
public class UploadServletUnjar { /** * The file was uploaded successfully , return an HTML string to display . * NOTE : This is supplied to provide a convenient place to override this servlet and * do some processing or supply a different ( or no ) return string . */ public String successfulFileUpload ( File file ...
String strHTML = super . successfulFileUpload ( file , properties ) ; strHTML = "<a href=\"/\">Home</a>" + RETURN + strHTML ; // Create a properties object to describe where to move these files String strPath = file . getPath ( ) ; // May as well use the passed - in properties object ( No properties are usable ) proper...
public class DefaultResourceDataBroker { /** * See : { @ link ResourceDataBroker # ruleFileExists ( String ) } * Checks if a resource in the grammar checker ' s { @ code / rules } exists . * @ param path Path to an item from the { @ code / rules } directory . * @ return { @ code true } if the resource file exists...
String completePath = getCompleteRulesUrl ( path ) ; return ResourceDataBroker . class . getResource ( completePath ) != null ;
public class AbstractUdfStreamOperator { @ Override public void setup ( StreamTask < ? , ? > containingTask , StreamConfig config , Output < StreamRecord < OUT > > output ) { } }
super . setup ( containingTask , config , output ) ; FunctionUtils . setFunctionRuntimeContext ( userFunction , getRuntimeContext ( ) ) ;
public class Reflection { /** * make a forced class casting . * @ param obj the object you want to cast from . * @ param clazz the class your want to cast to . * @ return The casted object . */ @ SuppressWarnings ( "unchecked" ) private static < T > T cast ( Object obj , Class < T > clazz ) { } }
if ( obj == null ) { return null ; } if ( clazz == null ) { throw new IllegalArgumentException ( "parameter 'Class<T> clazz' is not allowed to be null." ) ; } if ( clazz . isEnum ( ) && obj instanceof String ) { Class < Enum > enumClazz = ( Class < Enum > ) clazz ; return ( T ) Enum . valueOf ( enumClazz , obj . toStri...
public class LazySocket { /** * Returns the internal wrapped socket or null if not connected . After * calling recycle , this LazySocket instance is closed . */ CheckedSocket recycle ( ) { } }
CheckedSocket s ; if ( mClosed ) { s = null ; } else { s = mSocket ; mSocket = null ; mClosed = true ; } return s ;
public class Validator { /** * Validates field to be a valid URL * @ param name The field to check * @ param message A custom error message instead of the default one */ public void expectUrl ( String name , String message ) { } }
String value = Optional . ofNullable ( get ( name ) ) . orElse ( "" ) ; if ( ! UrlValidator . getInstance ( ) . isValid ( value ) ) { addError ( name , Optional . ofNullable ( message ) . orElse ( messages . get ( Validation . URL_KEY . name ( ) , name ) ) ) ; }
public class MultimediaListItemRenderer { /** * { @ inheritDoc } */ @ Override public StringBuilder renderAsListItem ( final StringBuilder builder , final boolean newLine , final int pad ) { } }
builder . append ( "<li>" ) ; renderListItemContents ( builder ) ; builder . append ( "</li>\n" ) ; return builder ;
public class AmazonSimpleEmailServiceClient { /** * Composes an email message using an email template and immediately queues it for sending . * In order to send email using the < code > SendTemplatedEmail < / code > operation , your call to the API must meet the * following requirements : * < ul > * < li > * ...
request = beforeClientExecution ( request ) ; return executeSendTemplatedEmail ( request ) ;
public class Phrase { /** * Entry point into this API . * @ throws IllegalArgumentException if pattern contains any syntax errors . */ public static Phrase from ( Fragment f , @ StringRes int patternResourceId ) { } }
return from ( f . getResources ( ) , patternResourceId ) ;
public class ClusteringKeyMapper { /** * Adds to the specified document the clustering key contained in the specified cell name . * @ param document The document where the clustering key is going to be added . * @ param cellName A cell name containing the clustering key to be added . */ public final void addFields ...
String serializedKey = ByteBufferUtils . toString ( cellName . toByteBuffer ( ) ) ; Field field = new StringField ( FIELD_NAME , serializedKey , Field . Store . YES ) ; document . add ( field ) ;
public class IdentityPatchContext { /** * Create a patch representing what we actually processed . This may contain some fixed content hashes for removed * modules . * @ param original the original * @ return the processed patch */ protected Patch createProcessedPatch ( final Patch original ) { } }
// Process elements final List < PatchElement > elements = new ArrayList < PatchElement > ( ) ; // Process layers for ( final PatchEntry entry : getLayers ( ) ) { final PatchElement element = createPatchElement ( entry , entry . element . getId ( ) , entry . modifications ) ; elements . add ( element ) ; } // Process a...
public class PredefinedTokenTokenizer { /** * Will only return either tokens with type PREDEFINED or UNDEFINED */ @ Override public List < Token > tokenize ( String s ) { } }
List < Token > result = new ArrayList < Token > ( ) ; result . add ( new UndefinedToken ( s ) ) ; for ( PredefinedTokenDefinition predefinedTokenDefinition : _predefinedTokenDefitions ) { Set < Pattern > patterns = predefinedTokenDefinition . getTokenRegexPatterns ( ) ; for ( Pattern pattern : patterns ) { for ( ListIt...
public class StringUtil { /** * Converts the specified byte array into a hexadecimal value and appends it to the specified buffer . */ public static < T extends Appendable > T toHexStringPadded ( T dst , byte [ ] src , int offset , int length ) { } }
final int end = offset + length ; for ( int i = offset ; i < end ; i ++ ) { byteToHexStringPadded ( dst , src [ i ] ) ; } return dst ;
public class AbstractVisitor { /** * read commands */ @ Override public Object visitSizeCommand ( InvocationContext ctx , SizeCommand command ) throws Throwable { } }
return handleDefault ( ctx , command ) ;
public class StandardSubstructureSets { /** * Load a list of SMARTS patterns from the specified file . * Each line in the file corresponds to a pattern with the following structure : * PATTERN _ DESCRIPTION : SMARTS _ PATTERN , < i > e . g . , Thioketone : [ # 6 ] [ CX3 ] ( = [ SX1 ] ) [ # 6 ] < / i > * Empty lin...
InputStream ins = StandardSubstructureSets . class . getClassLoader ( ) . getResourceAsStream ( filename ) ; BufferedReader reader = new BufferedReader ( new InputStreamReader ( ins ) ) ; List < String > tmp = new ArrayList < String > ( ) ; String line ; while ( ( line = reader . readLine ( ) ) != null ) { if ( line . ...
public class BiomorphApplet { /** * Initialise and layout the GUI . * @ param container The Swing component that will contain the GUI controls . */ @ Override protected void prepareGUI ( Container container ) { } }
renderer = new SwingBiomorphRenderer ( ) ; console = new SwingConsole ( 5 ) ; selectionDialog = new JDialog ( ( JFrame ) null , "Biomorph Selection" , true ) ; biomorphHolder = new JPanel ( new GridLayout ( 1 , 1 ) ) ; container . add ( new ControlPanel ( ) , BorderLayout . WEST ) ; container . add ( biomorphHolder , B...
public class JsMessageVisitor { /** * Visit a call to goog . getMsgWithFallback . */ private void visitFallbackFunctionCall ( NodeTraversal t , Node call ) { } }
// Check to make sure the function call looks like : // goog . getMsgWithFallback ( MSG _ 1 , MSG _ 2 ) ; if ( call . getChildCount ( ) != 3 || ! call . getSecondChild ( ) . isName ( ) || ! call . getLastChild ( ) . isName ( ) ) { compiler . report ( JSError . make ( call , BAD_FALLBACK_SYNTAX ) ) ; return ; } Node fir...
public class SchemaImpl { /** * Installs the schema handler on the reader . * @ param in The reader . * @ param sr The schema receiver . * @ return The installed handler that implements also SchemaFuture . */ SchemaFuture installHandlers ( XMLReader in , SchemaReceiverImpl sr ) { } }
Handler h = new Handler ( sr ) ; in . setContentHandler ( h ) ; return h ;
public class ControlledBounceProxyModule { /** * ( non - Javadoc ) * @ see com . google . inject . AbstractModule # configure ( ) */ @ Override protected void configure ( ) { } }
bind ( MessagingService . class ) . to ( MessagingServiceImpl . class ) ; bind ( BounceProxyLifecycleMonitor . class ) . to ( MonitoringServiceClient . class ) ; bind ( BounceProxyInformation . class ) . toProvider ( BounceProxyInformationProvider . class ) ;
public class CPSpecificationOptionPersistenceImpl { /** * Caches the cp specification options in the entity cache if it is enabled . * @ param cpSpecificationOptions the cp specification options */ @ Override public void cacheResult ( List < CPSpecificationOption > cpSpecificationOptions ) { } }
for ( CPSpecificationOption cpSpecificationOption : cpSpecificationOptions ) { if ( entityCache . getResult ( CPSpecificationOptionModelImpl . ENTITY_CACHE_ENABLED , CPSpecificationOptionImpl . class , cpSpecificationOption . getPrimaryKey ( ) ) == null ) { cacheResult ( cpSpecificationOption ) ; } else { cpSpecificati...
public class CmsPermissionDialog { /** * Displays the user permissions . < p > * @ param user the selected user */ void displayUserPermissions ( CmsUser user ) { } }
CmsPermissionView view = buildPermissionEntryForm ( user . getId ( ) , buildPermissionsForCurrentUser ( ) , false , false ) ; view . hideDeniedColumn ( ) ; m_userPermissions . addComponent ( view ) ;
public class Version { /** * Returns the " version " entry from a jar file ' s manifest , if available . * If the class isn ' t in a jar file , or that jar file doesn ' t define a * " version " entry , then a " not available " string is returned . * @ param jarClass any class from the target jar */ public static ...
String j2objcVersion = null ; String path = jarClass . getProtectionDomain ( ) . getCodeSource ( ) . getLocation ( ) . getPath ( ) ; try ( JarFile jar = new JarFile ( URLDecoder . decode ( path , "UTF-8" ) ) ) { Manifest manifest = jar . getManifest ( ) ; j2objcVersion = manifest . getMainAttributes ( ) . getValue ( "v...
public class StunAttributeFactory { /** * Create a DataAtttribute . * @ param data * the data * @ return newly created DataAttribute */ public static DataAttribute createDataAttributeWithoutPadding ( byte data [ ] ) { } }
DataAttribute attribute = new DataAttribute ( false ) ; attribute . setData ( data ) ; return attribute ;
public class LPSolver { /** * Solves the LP problem and returns the result . * @ param linearObjectiveFunction * @ param linearConstraintsList * @ param nonNegative * @ param maximize * @ return */ public static LPResult solve ( double [ ] linearObjectiveFunction , List < LPSolver . LPConstraint > linearConst...
int m = linearConstraintsList . size ( ) ; List < LinearConstraint > constraints = new ArrayList < > ( m ) ; for ( LPSolver . LPConstraint constraint : linearConstraintsList ) { String sign = constraint . getSign ( ) ; Relationship relationship = null ; if ( LPSolver . GEQ . equals ( sign ) ) { relationship = Relations...
public class MockFileItem { /** * { @ inheritDoc } */ @ Override public byte [ ] get ( ) { } }
if ( deleted ) { throw new IllegalStateException ( "delete() called" ) ; } if ( contents != null ) { byte [ ] data = new byte [ contents . length ] ; System . arraycopy ( contents , 0 , data , 0 , contents . length ) ; return data ; } return null ;
public class LocalCall { /** * Calls this salt call via the async client and returns the results * as they come in via the event stream . * @ param client SaltClient instance * @ param target the target for the function * @ param events the event stream to use * @ param cancel future to cancel the action * ...
return callAsync ( client , target , auth , events , cancel , Optional . of ( batch ) ) ;