signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class RequestConvertImpl { /** * TODO not correctly formulated doc */
public < T > T parseBody ( Class < T > clazz ) throws ParsableException , MediaTypeException { } } | String contentType = request . getContentType ( ) ; // if the content type header was not provided , we throw
if ( contentType == null || contentType . isEmpty ( ) ) { throw new MediaTypeException ( "Missing media type header" ) ; } // extract the actual content type in case charset is also a part of the string
content... |
public class MwsUtl { /** * Calculate String to Sign for SignatureVersion 0
* @ param parameters
* request parameters
* @ return String to Sign */
private static String calculateStringToSignV0 ( Map < String , String > parameters ) { } } | StringBuilder data = new StringBuilder ( ) ; data . append ( parameters . get ( "Action" ) ) . append ( parameters . get ( "Timestamp" ) ) ; return data . toString ( ) ; |
public class Utils { /** * Causes the current thread to wait until it is signalled or interrupted ,
* or the specified waiting time elapses . This method originally appears
* in the { @ link Condition } interface , but it was moved to here since it
* can only be emulated , with very little accuracy guarantees : t... | if ( nanosTimeout <= 0 ) return nanosTimeout ; long now = nanoTime ( ) ; cond . await ( nanosTimeout , TimeUnit . NANOSECONDS ) ; return nanosTimeout - ( nanoTime ( ) - now ) ; |
public class Metric { /** * < code > optional string instance = 1 ; < / code > */
public java . lang . String getInstance ( ) { } } | java . lang . Object ref = instance_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; if ( bs . isValidUtf8 ( ) ) { instance_ = s ; } ret... |
public class StreamUtils { /** * Copies the content of the Reader to the provided OutputStream using the provided encoding .
* @ param in The character data to convert .
* @ param out The OutputStream to send the data to .
* @ param encoding The character encoding that should be used for the byte stream .
* @ p... | OutputStreamWriter writer = new OutputStreamWriter ( out , encoding ) ; copyReaderToWriter ( in , writer , close ) ; |
public class SVG { /** * Change the document positioning by altering the " preserveAspectRatio "
* attribute of the root { @ code < svg > } element . See the
* documentation for { @ link PreserveAspectRatio } for more information
* on how positioning works .
* @ param preserveAspectRatio the new { @ code preser... | "WeakerAccess" , "unused" } ) public void setDocumentPreserveAspectRatio ( PreserveAspectRatio preserveAspectRatio ) { if ( this . rootElement == null ) throw new IllegalArgumentException ( "SVG document is empty" ) ; this . rootElement . preserveAspectRatio = preserveAspectRatio ; |
public class CWF2XML { /** * Returns the exclusion lookup key for the property .
* @ param name The property name .
* @ param cmpname The component name ( may be null ) .
* @ param value The property value ( may be null ) .
* @ return The exclusion lookup key . */
private String excludeKey ( String name , Strin... | StringBuilder sb = new StringBuilder ( cmpname == null ? "" : cmpname + "." ) ; sb . append ( name ) . append ( value == null ? "" : "=" + value ) ; return sb . toString ( ) ; |
public class AbstractErrorWebExceptionHandler { /** * Render the given error data as a view , using a template view if available or a
* static HTML file if available otherwise . This will return an empty
* { @ code Publisher } if none of the above are available .
* @ param viewName the view name
* @ param respo... | if ( isTemplateAvailable ( viewName ) ) { return responseBody . render ( viewName , error ) ; } Resource resource = resolveResource ( viewName ) ; if ( resource != null ) { return responseBody . body ( BodyInserters . fromResource ( resource ) ) ; } return Mono . empty ( ) ; |
public class PermissionEvaluator { /** * Checks if the operated account is a direct child of effective account
* @ param operatedAccount
* @ return */
public boolean isDirectChildOfAccount ( final Account effectiveAccount , final Account operatedAccount ) { } } | return operatedAccount . getParentSid ( ) . equals ( effectiveAccount . getSid ( ) ) ; |
public class Projections { /** * Create a typed array projection for the given type and expressions
* @ param < T > type of projection
* @ param type type of the projection
* @ param exprs arguments for the projection
* @ return factory expression */
public static < T > ArrayConstructorExpression < T > array ( ... | return new ArrayConstructorExpression < T > ( type , exprs ) ; |
public class Utils { /** * Trims all elements inside the array , modifying the original array .
* @ param strings The string array
* @ return The passed string array , trimmed */
public static String [ ] trimArray ( String [ ] strings ) { } } | for ( int i = 0 ; i < strings . length ; i ++ ) { strings [ i ] = strings [ i ] . trim ( ) ; } return strings ; |
public class BugResolution { /** * Reports an exception to the user . This method could be overwritten by a
* subclass to handle some exceptions individual .
* @ param e
* not null */
protected void reportException ( Exception e ) { } } | Assert . isNotNull ( e ) ; FindbugsPlugin . getDefault ( ) . logException ( e , e . getLocalizedMessage ( ) ) ; MessageDialog . openError ( FindbugsPlugin . getShell ( ) , "BugResolution failed." , e . getLocalizedMessage ( ) ) ; |
public class ContextFromVertx { /** * Like { @ link # parameter ( String , String ) } , but converts the
* parameter to Integer if found .
* The parameter is decoded by default .
* @ param name The name of the parameter
* @ param defaultValue A default value if parameter not found .
* @ return The value of th... | return request . parameterAsInteger ( name , defaultValue ) ; |
public class AWSGlueClient { /** * Updates a trigger definition .
* @ param updateTriggerRequest
* @ return Result of the UpdateTrigger operation returned by the service .
* @ throws InvalidInputException
* The input provided was not valid .
* @ throws InternalServiceException
* An internal service error oc... | request = beforeClientExecution ( request ) ; return executeUpdateTrigger ( request ) ; |
public class AbstractOrientedBox3F { /** * Replies if the specified boxes intersect .
* This function is assuming that < var > lx1 < / var > is lower
* or equal to < var > ux1 < / var > , < var > ly1 < / var > is lower
* or equal to < var > uy1 < / var > , and so on .
* The extents are assumed to be positive or... | assert ( lowerx <= upperx ) ; assert ( lowery <= uppery ) ; assert ( lowerz <= upperz ) ; assert ( extentAxis1 >= 0 ) ; assert ( extentAxis2 >= 0 ) ; assert ( extentAxis3 >= 0 ) ; double aabbCenterx , aabbCentery , aabbCenterz ; aabbCenterx = ( upperx + lowerx ) / 2.f ; aabbCentery = ( uppery + lowery ) / 2.f ; aabbCen... |
public class StringType { /** * { @ inheritDoc } */
@ Override public Object readValue ( final Attribute _attribute , final List < Object > _objectList ) throws EFapsException { } } | Object ret = null ; if ( _objectList . size ( ) < 1 ) { ret = null ; } else if ( _objectList . size ( ) > 1 ) { final List < String > list = new ArrayList < String > ( ) ; for ( final Object object : _objectList ) { list . add ( object == null ? "" : object . toString ( ) . trim ( ) ) ; } ret = list ; } else { final Ob... |
public class ScannerRegistry { /** * Returns the correct implementation of a { @ link LocationScanner }
* depending on the scheme or null of no scanner for this scheme is
* registered .
* @ param scheme the scheme that should be supported
* @ return { @ link JarLocationScanner } if scheme is " jar " , { @ link ... | notNullOrEmpty ( scheme , "scheme" ) ; return this . scanners . get ( scheme . toLowerCase ( ) ) ; |
public class xen_health_sr { /** * < pre >
* Converts API response of bulk operation into object and returns the object array in case of get request .
* < / pre > */
protected base_resource [ ] get_nitro_bulk_response ( nitro_service service , String response ) throws Exception { } } | xen_health_sr_responses result = ( xen_health_sr_responses ) service . get_payload_formatter ( ) . string_to_resource ( xen_health_sr_responses . class , response ) ; if ( result . errorcode != 0 ) { if ( result . errorcode == SESSION_NOT_EXISTS ) service . clear_session ( ) ; throw new nitro_exception ( result . messa... |
public class RestNodeHandler { /** * Deletes the subgraph at the node with the specified id , including all descendants .
* @ param request the servlet request ; may not be null or unauthenticated
* @ param rawRepositoryName the URL - encoded repository name
* @ param rawWorkspaceName the URL - encoded workspace ... | assert rawRepositoryName != null ; assert rawWorkspaceName != null ; assert id != null ; Session session = getSession ( request , rawRepositoryName , rawWorkspaceName ) ; Node node = nodeWithId ( id , session ) ; node . remove ( ) ; session . save ( ) ; |
public class ShanksAgentMovementCapability { /** * Move the agent to the target location with the specific speed . Call this
* method always you want to move . This method only moves the agent a
* fragment equals to the velocity .
* @ param simulation
* @ param agent
* @ param currentLocation
* @ param targ... | if ( currentLocation . is2DLocation ( ) && targetLocation . is2DLocation ( ) ) { ShanksAgentMovementCapability . goTo ( simulation , agent , currentLocation . getLocation2D ( ) , targetLocation . getLocation2D ( ) , speed ) ; } else if ( currentLocation . is3DLocation ( ) && targetLocation . is3DLocation ( ) ) { Shanks... |
public class TCPPort { /** * Processes a new connection by scheduling initial read .
* @ param socket */
public void processNewConnection ( SocketIOChannel socket ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "processNewConnection" ) ; } VirtualConnection vc = vcf . createConnection ( ) ; TCPConnLink bc = ( TCPConnLink ) tcpChannel . getConnectionLink ( vc ) ; TCPReadRequestContextImpl bcRead = bc . getTCPReadConnLink ( ) ; bc . s... |
public class StartTime { /** * Returns { @ link Date } representation of StartTime as parsed at a given timezone .
* Master does not return a timezone associated with StartTime timestamp string ,
* therefore an explicit timezone needs to be provided for correct parsing .
* @ param tz TimeZone associated with mast... | if ( dateString == null ) { return null ; } startJobDateFormat . setTimeZone ( tz ) ; try { return startJobDateFormat . parse ( dateString ) ; } catch ( ParseException e ) { // This exception should not be possible . Even when dealing with TZ DST
// transitions , all dates exist . Time that does not exist because of
//... |
public class PinViewBaseHelper { /** * Generate a Split { @ link TextView } with all attributes to add to { @ link PinView }
* @ param i index of new split
* @ return new split */
TextView generateSplit ( int i ) { } } | TextView split = new TextView ( getContext ( ) ) ; int generateViewId = PinViewUtils . generateViewId ( ) ; split . setId ( generateViewId ) ; setStylesSplit ( split ) ; pinSplitsIds [ i ] = generateViewId ; return split ; |
public class ClassPathMapperScanner { /** * Calls the parent search that will search and register all the candidates .
* Then the registered objects are post processed to set them as
* MapperFactoryBeans */
@ Override public Set < BeanDefinitionHolder > doScan ( String ... basePackages ) { } } | Set < BeanDefinitionHolder > beanDefinitions = super . doScan ( basePackages ) ; if ( beanDefinitions . isEmpty ( ) ) { logger . warn ( "No MyBatis mapper was found in '" + Arrays . toString ( basePackages ) + "' package. Please check your configuration." ) ; } else { processBeanDefinitions ( beanDefinitions ) ; } retu... |
public class DeadCodeEliminator { /** * Remove the OCNI comment associated with a native method , if it exists . */
private void removeMethodOCNI ( MethodDeclaration method ) { } } | int methodStart = method . getStartPosition ( ) ; String src = unit . getSource ( ) . substring ( methodStart , methodStart + method . getLength ( ) ) ; if ( src . contains ( "/*-[" ) ) { int ocniStart = methodStart + src . indexOf ( "/*-[" ) ; Iterator < Comment > commentsIter = unit . getCommentList ( ) . iterator ( ... |
public class Gson { /** * This method serializes the specified object into its equivalent representation as a tree of
* { @ link JsonElement } s . This method should be used when the specified object is not a generic
* type . This method uses { @ link Class # getClass ( ) } to get the type for the specified object ... | if ( src == null ) { return JsonNull . INSTANCE ; } return toJsonTree ( src , src . getClass ( ) ) ; |
public class ClassWriterImpl { /** * { @ inheritDoc } */
@ Override public void addSubClassInfo ( Content classInfoTree ) { } } | if ( utils . isClass ( typeElement ) ) { if ( typeElement . getQualifiedName ( ) . toString ( ) . equals ( "java.lang.Object" ) || typeElement . getQualifiedName ( ) . toString ( ) . equals ( "org.omg.CORBA.Object" ) ) { return ; // Don ' t generate the list , too huge
} Set < TypeElement > subclasses = classtree . dir... |
public class BTools { /** * < b > getSpaces < / b > < br >
* public static String getSpaces ( int SpacesCount ) < br >
* Returns asked count of spaces . < br >
* If count of spaces is < 0 returns ' ? ' .
* @ param SpacesCount = spaces count
* @ return spaces */
public static String getSpaces ( int SpacesCount... | if ( SpacesCount < 0 ) return "?" ; String Info = "" ; for ( int K = 1 ; K <= SpacesCount ; K ++ ) { Info += " " ; } return Info ; |
public class ControlMessageInjector { /** * Apply injections to the input { @ link RecordStreamWithMetadata } .
* { @ link ControlMessage } s may be injected before , after , or around the input record .
* A { @ link MetadataUpdateControlMessage } will update the current input { @ link GlobalMetadata } and pass the... | init ( workUnitState ) ; setInputGlobalMetadata ( inputStream . getGlobalMetadata ( ) , workUnitState ) ; Flowable < StreamEntity < DI > > outputStream = inputStream . getRecordStream ( ) . flatMap ( in -> { if ( in instanceof ControlMessage ) { if ( in instanceof MetadataUpdateControlMessage ) { setInputGlobalMetadata... |
public class Pattern7 { /** * Matches when all observable sequences have an available
* element and projects the elements by invoking the selector function .
* @ param selector
* the function that will be invoked for elements in the source sequences .
* @ return the plan for the matching
* @ throws NullPointe... | if ( selector == null ) { throw new NullPointerException ( ) ; } return new Plan7 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , R > ( this , selector ) ; |
public class ZealotKhala { /** * 生成带 " AND " 前缀的 " NOT IN " 范围查询的SQL片段 .
* @ param field 数据库字段
* @ param values 数组的值
* @ return ZealotKhala实例 */
public ZealotKhala andNotIn ( String field , Object [ ] values ) { } } | return this . doIn ( ZealotConst . AND_PREFIX , field , values , true , false ) ; |
public class EntityInfo { /** * 获取Entity的DELETE SQL
* @ param bean Entity对象
* @ return String */
public String getDeleteNamesPrepareSQL ( T bean ) { } } | if ( this . tableStrategy == null ) return deleteNamesPrepareSQL ; return deleteNamesPrepareSQL . replace ( "${newtable}" , getTable ( bean ) ) ; |
public class NotificationInvocationHandler { /** * { @ inheritDoc } */
public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { } } | Object returnValue = null ; try { returnValue = method . invoke ( target , args ) ; } catch ( InvocationTargetException ite ) { throw ite . getTargetException ( ) ; } if ( messaging != null && ! exec . isShutdown ( ) ) { exec . submit ( new Notifier ( method , args , returnValue ) ) ; } return returnValue ; |
public class InstanceSet { /** * 用本样本集合默认的 “ 数据类型转换管道 ” 通过 “ 数据读取器 ” 批量建立样本集合
* @ param reader 数据读取器
* @ throws Exception */
public void loadThruPipes ( Reader reader ) throws Exception { } } | // 通过迭代加入样本
while ( reader . hasNext ( ) ) { Instance inst = reader . next ( ) ; if ( pipes != null ) pipes . addThruPipe ( inst ) ; this . add ( inst ) ; } |
public class UTF8ByteArrayUtils { /** * Find the first occurrence of the given byte b in a UTF - 8 encoded string
* @ param utf a byte array containing a UTF - 8 encoded string
* @ param start starting offset
* @ param end ending position
* @ param b the byte to find
* @ return position that first byte occure... | for ( int i = start ; i < end ; i ++ ) { if ( utf [ i ] == b ) { return i ; } } return - 1 ; |
public class QueryAgreementApi { /** * 请求push协议展示 */
public void queryAgreement ( QueryAgreementHandler handler ) { } } | HMSAgentLog . i ( "queryAgreement:handler=" + StrUtils . objDesc ( handler ) ) ; this . handler = handler ; connect ( ) ; |
public class CmsColorpickerWidget { /** * Check the stored color value to prevent display issues in the generated HTML ouput . < p >
* @ param color the color value to check
* @ return the checked color value */
private String checkColor ( String color ) { } } | if ( color != null ) { if ( color . indexOf ( "#" ) == - 1 ) { // add the " # " to the color string
color = "#" + color ; } int colLength = color . length ( ) ; if ( ( colLength == 4 ) || ( colLength == 7 ) ) { return color ; } } return "#FFFFFF" ; |
public class AABBUtils { /** * Create stair shaped bounding boxes . < br >
* The position of the bounding boxes corners are interpolated between < code > fx [ 0 ] < / code > ( start ) and < code > fx [ 1 ] < / code > ( end ) . < br >
* The second index determines the mininum ( < code > fx [ . ] < b > [ 0 ] < / b > ... | final float delta = 1 / ( float ) slices ; final int START = 0 ; final int MIN = 0 ; final int END = 1 ; final int MAX = 1 ; AxisAlignedBB [ ] aabb = new AxisAlignedBB [ slices ] ; for ( int i = 0 ; i < slices ; i ++ ) { float bx = fx [ START ] [ MIN ] + ( fx [ END ] [ MIN ] - fx [ START ] [ MIN ] ) * i * delta ; float... |
public class SynchronizeFXTomcatChannel { /** * CommandTransferServer */
@ Override public void onConnectFinished ( final Object client ) { } } | synchronized ( connections ) { final SynchronizeFXTomcatConnection syncFxClient = ( SynchronizeFXTomcatConnection ) client ; connections . add ( syncFxClient ) ; connectionThreads . put ( syncFxClient , Executors . newSingleThreadExecutor ( new ThreadFactory ( ) { @ Override public Thread newThread ( final Runnable run... |
public class XPathScanner { /** * Return the token that will be returned by the scanner after the call of
* nextToken ( ) , without changing the internal state of the scanner .
* @ param paramNext
* number of next tokens to be read
* @ return token that will be read after calling nextToken ( ) */
public IXPathT... | int nextCount = paramNext ; // save current position of the scanner , to restore it later
final int lastPos = mPos ; IXPathToken token = nextToken ( ) ; while ( -- nextCount > 0 ) { token = nextToken ( ) ; if ( token . getType ( ) == TokenType . SPACE ) { nextCount ++ ; } } // reset position
mPos = lastPos ; return tok... |
public class InsightClient { /** * Perform a Standard Insight Request with a number and country .
* @ param number A single phone number that you need insight about in national or international format .
* @ param country If a number does not have a country code or it is uncertain , set the two - character country c... | return getStandardNumberInsight ( StandardInsightRequest . withNumberAndCountry ( number , country ) ) ; |
public class DescribeJobRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeJobRequest describeJobRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeJobRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeJobRequest . getJobId ( ) , JOBID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage... |
public class StreamingIndexedData { /** * Return the next page from pageBuffer that has a non - zero position count , or null if none available */
private static Page extractNonEmptyPage ( PageBuffer pageBuffer ) { } } | Page page = pageBuffer . poll ( ) ; while ( page != null && page . getPositionCount ( ) == 0 ) { page = pageBuffer . poll ( ) ; } return page ; |
public class ImageInfo { /** * To use this class as a command line application , give it either
* some file names as parameters ( information on them will be
* printed to standard output , one line per file ) or call
* it with no parameters . It will then check data given to it
* via standard input .
* @ para... | ImageInfo imageInfo = new ImageInfo ( ) ; imageInfo . setDetermineImageNumber ( true ) ; boolean verbose = determineVerbosity ( args ) ; if ( args . length == 0 ) { run ( null , System . in , imageInfo , verbose ) ; } else { int index = 0 ; while ( index < args . length ) { InputStream in = null ; try { String name = a... |
public class ListRecordsResult { /** * A list of all records .
* @ param records
* A list of all records . */
public void setRecords ( java . util . Collection < Record > records ) { } } | if ( records == null ) { this . records = null ; return ; } this . records = new com . amazonaws . internal . SdkInternalList < Record > ( records ) ; |
public class Tokenizer { /** * Returns an array of tokens that is optimized .
* Eliminates unnecessary white spaces for the first and last tokens .
* @ param tokens the tokens before optimizing
* @ return the optimized tokens */
public static Token [ ] optimize ( Token [ ] tokens ) { } } | if ( tokens == null ) { return null ; } String firstVal = null ; String lastVal = null ; if ( tokens . length == 1 ) { if ( tokens [ 0 ] . getType ( ) == TokenType . TEXT ) { firstVal = tokens [ 0 ] . getDefaultValue ( ) ; } } else if ( tokens . length > 1 ) { if ( tokens [ 0 ] . getType ( ) == TokenType . TEXT ) { fir... |
public class WebAppConfiguration { /** * Returns the serveServletsByClassname .
* @ return boolean */
public boolean isServeServletsByClassnameEnabled ( ) { } } | // PK52059 START
disallowServeServletsByClassnameProp = WCCustomProperties . DISALLOW_SERVE_SERVLETS_BY_CLASSNAME_PROP ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "isServeServletsByClassnameEnabled" , "di... |
public class Collections { /** * Concatenate two Iterators
* @ param a a non - null Iterator
* @ param b a non - null Iterator
* @ return an Iterator that will iterate through all the values of ' a ' , and then all the values of ' b '
* @ param < T > the value type */
public static < T > Iterator < T > concat (... | assert ( a != null ) ; assert ( b != null ) ; return new Iterator < T > ( ) { @ Override public boolean hasNext ( ) { return a . hasNext ( ) || b . hasNext ( ) ; } @ Override public T next ( ) { if ( a . hasNext ( ) ) { return a . next ( ) ; } return b . next ( ) ; } @ Override public void remove ( ) { throw new Unsupp... |
public class DirtyItemList { /** * Appends the dirty object tile at the given coordinates to the dirty item list .
* @ param scobj the scene object that is dirty . */
public void appendDirtyObject ( SceneObject scobj ) { } } | DirtyItem item = getDirtyItem ( ) ; item . init ( scobj , scobj . info . x , scobj . info . y ) ; _items . add ( item ) ; |
public class DefaultReconfigurationProblem { /** * A naive heuristic to be sure every variables will be instantiated . */
private void defaultHeuristic ( ) { } } | IntStrategy intStrat = Search . intVarSearch ( new FirstFail ( csp ) , new IntDomainMin ( ) , csp . retrieveIntVars ( true ) ) ; SetStrategy setStrat = new SetStrategy ( csp . retrieveSetVars ( ) , new InputOrder < > ( csp ) , new SetDomainMin ( ) , true ) ; RealStrategy realStrat = new RealStrategy ( csp . retrieveRea... |
public class ClassUseWriter { /** * Add the package use information .
* @ param pkg the package that uses the given class
* @ param contentTree the content tree to which the package use information will be added */
protected void addPackageUse ( PackageElement pkg , Content contentTree ) { } } | Content thFirst = HtmlTree . TH_ROW_SCOPE ( HtmlStyle . colFirst , getHyperLink ( getPackageAnchorName ( pkg ) , new StringContent ( utils . getPackageName ( pkg ) ) ) ) ; contentTree . addContent ( thFirst ) ; HtmlTree tdLast = new HtmlTree ( HtmlTag . TD ) ; tdLast . addStyle ( HtmlStyle . colLast ) ; addSummaryComme... |
public class PiElectronegativityDescriptor { /** * Sets the parameters attribute of the PiElectronegativityDescriptor
* object
* @ param params The number of maximum iterations . 1 = maxIterations . 2 = maxResonStruc .
* @ exception CDKException Description of the Exception */
@ Override public void setParameters... | if ( params . length > 3 ) throw new CDKException ( "PartialPiChargeDescriptor only expects three parameter" ) ; if ( ! ( params [ 0 ] instanceof Integer ) ) throw new CDKException ( "The parameter must be of type Integer" ) ; maxIterations = ( Integer ) params [ 0 ] ; if ( params . length > 1 && params [ 1 ] != null )... |
public class LdiSrl { public static boolean isQuotedAnything ( String str , String quotation ) { } } | assertStringNotNull ( str ) ; assertQuotationNotNull ( quotation ) ; return isQuotedAnything ( str , quotation , quotation ) ; |
public class Bean { /** * Report a bound indexed property update to any registered listeners . < p >
* No event is fired if old and new values are equal and non - null .
* @ param propertyName The programmatic name of the property that was changed .
* @ param index index of the property element that was changed .... | PropertyChangeSupport aChangeSupport = this . changeSupport ; if ( aChangeSupport == null ) { return ; } aChangeSupport . fireIndexedPropertyChange ( propertyName , index , oldValue , newValue ) ; |
public class ThriftConnectionPool { /** * 判断连接代理类是否可用的方法
* @ param connection
* 需要检测的连接代理类对象
* @ return true为可用 false为不可用 */
public boolean isConnectionHandleAlive ( ThriftConnectionHandle < T > connection ) { } } | boolean result = false ; boolean logicallyClosed = connection . logicallyClosed . get ( ) ; try { connection . logicallyClosed . compareAndSet ( true , false ) ; // 反射调用ping方法
T client = null ; if ( this . thriftServiceType == ThriftServiceType . SINGLE_INTERFACE ) { client = connection . getClient ( ) ; } else { Map <... |
public class AppEventsLogger { /** * Logs a purchase event with Facebook , in the specified amount and with the specified currency . Additional
* detail about the purchase can be passed in through the parameters bundle .
* @ param purchaseAmount Amount of purchase , in the currency specified by the ' currency ' par... | if ( purchaseAmount == null ) { notifyDeveloperError ( "purchaseAmount cannot be null" ) ; return ; } else if ( currency == null ) { notifyDeveloperError ( "currency cannot be null" ) ; return ; } if ( parameters == null ) { parameters = new Bundle ( ) ; } parameters . putString ( AppEventsConstants . EVENT_PARAM_CURRE... |
public class AbstractChainableEvent { /** * { @ inheritDoc }
* @ since 1.2.0 */
@ Override public ChainableEvent onFailure ( Event onFailureEvent ) { } } | this . onFailureChains . add ( new ChainLink ( ) . onFailure ( linkChainIdentifier ( onFailureEvent ) ) ) ; return this ; |
public class SSLEngineImpl { /** * Non - application OutputRecords go through here . */
void writeRecord ( EngineOutputRecord eor ) throws IOException { } } | // eventually compress as well .
writer . writeRecord ( eor , writeMAC , writeCipher ) ; /* * Check the sequence number state
* Note that in order to maintain the connection I / O
* properly , we check the sequence number after the last
* record writing process . As we request renegotiation
* or close the conne... |
public class Line { /** * Marks this line empty . Also sets previous / next line ' s empty attributes . */
public void setEmpty ( ) { } } | m_sValue = "" ; m_nLeading = 0 ; m_nTrailing = 0 ; m_bIsEmpty = true ; if ( m_aNext != null ) m_aNext . m_bPrevEmpty = true ; |
public class RowList { /** * Tries to get BLOB from raw | value | .
* @ param value the binary value
* @ return the created BLOB
* @ throws SQLException if fails to create the BLOB */
public java . sql . Blob getBlob ( final Object value ) throws SQLException { } } | if ( value instanceof java . sql . Blob ) return ( java . sql . Blob ) value ; if ( value instanceof byte [ ] ) { return new SerialBlob ( ( byte [ ] ) value ) ; |
public class Program { /** * Add a piecewise function .
* @ param name is the name of the function
* @ param argumentName argument name
* @ return the function */
public PiecewiseFunction addPiecewiseFunction ( String name , String argumentName ) { } } | return addFunction ( new PiecewiseFunction ( name , argumentName ) ) ; |
public class DeviceProxyDAODefaultImpl { public int read_attribute_asynch ( final DeviceProxy deviceProxy , final String [ ] attnames ) throws DevFailed { } } | checkIfTango ( deviceProxy , "read_attributes_asynch" ) ; build_connection ( deviceProxy ) ; // Create the request object
Request request ; if ( deviceProxy . device_5 != null ) { request = deviceProxy . device_5 . _request ( "read_attributes_5" ) ; setRequestArgsForReadAttr ( request , attnames , get_source ( devicePr... |
public class WiringPage { /** * returns true if location is not already set in the properties , otherwise false */
private boolean setLocation ( String global , String context , Map < String , Object > properties ) { } } | String locationKey = "location." + context ; Object propvalue = properties . get ( locationKey ) ; if ( propvalue == null ) { properties . put ( locationKey , global ) ; } else if ( propvalue . getClass ( ) . isArray ( ) ) { Object [ ] locations = ( Object [ ] ) propvalue ; if ( ArrayUtils . contains ( locations , glob... |
public class ScoreTemplate { /** * Sets the text attributes of several fields
* @ param fields
* one of { @ link ScoreElements } constants
* @ param attrib
* Map of attributes
* @ see java . awt . font . TextAttribute */
public void setTextAttributes ( byte [ ] fields , Hashtable attrib ) { } } | for ( byte field : fields ) { getFieldInfos ( field ) . m_textAttributes = attrib ; } notifyListeners ( ) ; |
public class BsFavoriteLogCB { public FavoriteLogCB acceptPK ( String id ) { } } | assertObjectNotNull ( "id" , id ) ; BsFavoriteLogCB cb = this ; cb . query ( ) . docMeta ( ) . setId_Equal ( id ) ; return ( FavoriteLogCB ) this ; |
public class TemperatureConversion { /** * Convert a temperature value from the Farenheit temperature scale to another .
* @ param to TemperatureScale
* @ param temperature value in degrees Farenheit
* @ return converted temperature value in the requested to scale */
public static double convertFromFarenheit ( Te... | switch ( to ) { case FARENHEIT : return temperature ; case CELSIUS : return convertFarenheitToCelsius ( temperature ) ; case KELVIN : return convertFarenheitToKelvin ( temperature ) ; case RANKINE : return convertFarenheitToRankine ( temperature ) ; default : throw ( new RuntimeException ( "Invalid termpature conversio... |
public class SelectFormat { /** * / * package */
static int findSubMessage ( MessagePattern pattern , int partIndex , String keyword ) { } } | int count = pattern . countParts ( ) ; int msgStart = 0 ; // Iterate over ( ARG _ SELECTOR , message ) pairs until ARG _ LIMIT or end of select - only pattern .
do { MessagePattern . Part part = pattern . getPart ( partIndex ++ ) ; MessagePattern . Part . Type type = part . getType ( ) ; if ( type == MessagePattern . P... |
public class NetFlowV5Parser { /** * < pre >
* | BYTES | CONTENTS | DESCRIPTION |
* | 0-1 | version | NetFlow export format version number |
* | 2-3 | count | Number of flows exported in this packet ( 1-30 ) |
* | 4-7 | sys _ uptime | Current time in milliseconds since the export device booted |
* | 8-11 | un... | final int version = bb . readUnsignedShort ( ) ; if ( version != 5 ) { throw new InvalidFlowVersionException ( version ) ; } final int count = bb . readUnsignedShort ( ) ; final long sysUptime = bb . readUnsignedInt ( ) ; final long unixSecs = bb . readUnsignedInt ( ) ; final long unixNsecs = bb . readUnsignedInt ( ) ;... |
public class TimerNpImpl { /** * Determines if Timer methods are allowed based on the ' cancelled ' state
* of the timer instance relative to the current thread and transaction .
* NoSuchObjectLocalException is thrown if the timer has been cancelled . < p >
* Returns true if the current thread is running in the s... | // If a cancel has been committed then the timer " does not exist " ,
// unless the cancel occurred after the timer started running
// and the current thread is for that running timeout method .
if ( ivDestroyed && ivTimeoutThread != Thread . currentThread ( ) ) { String msg = "Timer with ID " + ivTaskId + " has been c... |
public class CmsDriverManager { /** * Removes a resource from the given organizational unit . < p >
* @ param dbc the current db context
* @ param orgUnit the organizational unit to remove the resource from
* @ param resource the resource that is to be removed from the organizational unit
* @ throws CmsExceptio... | m_monitor . flushCache ( CmsMemoryMonitor . CacheType . HAS_ROLE , CmsMemoryMonitor . CacheType . ROLE_LIST ) ; getUserDriver ( dbc ) . removeResourceFromOrganizationalUnit ( dbc , orgUnit , resource ) ; |
public class JsonRuntimeReporterHelper { /** * This method will generate Configuration summary by fetching the details from ReportDataGenerator */
private JsonObject generateConfigSummary ( ) throws JsonParseException { } } | logger . entering ( ) ; if ( jsonConfigSummary == null ) { jsonConfigSummary = new JsonObject ( ) ; for ( Entry < String , String > temp : ConfigSummaryData . getConfigSummary ( ) . entrySet ( ) ) { jsonConfigSummary . addProperty ( temp . getKey ( ) , temp . getValue ( ) ) ; } } logger . exiting ( jsonConfigSummary ) ... |
public class ScheduleRunConfigurationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ScheduleRunConfiguration scheduleRunConfiguration , ProtocolMarshaller protocolMarshaller ) { } } | if ( scheduleRunConfiguration == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( scheduleRunConfiguration . getExtraDataPackageArn ( ) , EXTRADATAPACKAGEARN_BINDING ) ; protocolMarshaller . marshall ( scheduleRunConfiguration . getNetworkPro... |
public class EventBus { /** * Remove the sticky events which can be assigned to specified < code > eventType < / code > and posted with the specified < code > eventId < / code > .
* @ param eventType
* @ param eventId
* @ return true if one or one more than sticky events are removed , otherwise , < code > false <... | final List < Object > keyToRemove = new ArrayList < > ( ) ; synchronized ( stickyEventMap ) { for ( Map . Entry < Object , String > entry : stickyEventMap . entrySet ( ) ) { if ( N . equals ( entry . getValue ( ) , eventId ) && eventType . isAssignableFrom ( entry . getKey ( ) . getClass ( ) ) ) { keyToRemove . add ( e... |
public class BackendTransaction { /** * Applies the specified insertion and deletion mutations on the property index to the provided key .
* Both , the list of additions or deletions , may be empty or NULL if there is nothing to be added and / or deleted .
* @ param key Key
* @ param additions List of entries ( c... | indexStore . mutateEntries ( key , additions , deletions , storeTx ) ; |
public class Payload { /** * Create a PayloadFetcher to execute fetch .
* @ param pathAccountSid The SID of the Account that created the resource to
* fetch
* @ param pathReferenceSid The SID of the recording to which the AddOnResult
* resource that contains the payload to fetch belongs
* @ param pathAddOnRes... | return new PayloadFetcher ( pathAccountSid , pathReferenceSid , pathAddOnResultSid , pathSid ) ; |
public class TransformJobDefinitionMarshaller { /** * Marshall the given parameter object . */
public void marshall ( TransformJobDefinition transformJobDefinition , ProtocolMarshaller protocolMarshaller ) { } } | if ( transformJobDefinition == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( transformJobDefinition . getMaxConcurrentTransforms ( ) , MAXCONCURRENTTRANSFORMS_BINDING ) ; protocolMarshaller . marshall ( transformJobDefinition . getMaxPaylo... |
public class ISO9660Directory { /** * Add file
* @ param file File to be added */
public void addFile ( ISO9660File file ) { } } | file . setParentDirectory ( this ) ; files . add ( file ) ; sorted = false ; |
public class ClassUtils { /** * Flattens the array into a single , long string . The separator string gets
* added between the objects , but not after the last one . Uses the " toString ( ) "
* method of the objects to turn them into a string .
* @ param linesthe lines to flatten
* @ param septhe separator
* ... | StringBuilder result ; int i ; result = new StringBuilder ( ) ; for ( i = 0 ; i < lines . length ; i ++ ) { if ( i > 0 ) result . append ( sep ) ; result . append ( lines [ i ] . toString ( ) ) ; } return result . toString ( ) ; |
public class CloudFormation { /** * signal success to the given CloudFormation stack . < br >
* < br >
* Needed AWS actions :
* < ul >
* < li > cloudformation : SignalResource < / li >
* < / ul > */
public void signalReady ( String stackName , String resourceName ) { } } | Preconditions . checkArgument ( stackName != null && ! stackName . isEmpty ( ) ) ; Preconditions . checkArgument ( resourceName != null && ! resourceName . isEmpty ( ) ) ; SignalResourceRequest req = new SignalResourceRequest ( ) ; req . setLogicalResourceId ( resourceName ) ; req . setStackName ( stackName ) ; req . s... |
public class ErrorTools { /** * Log a JMS exception with an error level
* @ param e
* @ param log */
public static void log ( String context , JMSException e , Log log ) { } } | StringBuilder message = new StringBuilder ( ) ; if ( context != null ) { message . append ( "[" ) ; message . append ( context ) ; message . append ( "] " ) ; } if ( e . getErrorCode ( ) != null ) { message . append ( "error={" ) ; message . append ( e . getErrorCode ( ) ) ; message . append ( "} " ) ; } message . appe... |
public class EntityField { /** * 获取指定的注解
* @ param annotationClass
* @ param < T >
* @ return */
public < T extends Annotation > T getAnnotation ( Class < T > annotationClass ) { } } | T result = null ; if ( field != null ) { result = field . getAnnotation ( annotationClass ) ; } if ( result == null && setter != null ) { result = setter . getAnnotation ( annotationClass ) ; } if ( result == null && getter != null ) { result = getter . getAnnotation ( annotationClass ) ; } return result ; |
public class AbstractAsyncChannel { /** * Performs a read or write operation .
* @ param buffers -
* a Direct ByteBuffer array for the operation
* @ param position -
* a position in a file for the operation .
* @ param isRead -
* true for a read operation , false for a write operation
* @ return a future ... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "multiIO(.," + position + "," + isRead + "," + forceQueue + "," + bytesRequested + "," + useJITBuffer + ",.," + asyncIO ) ; } // Sanity check on the arguments
if ( buffers == null ) { throw new IllegalArgumentException ( ) ; ... |
public class Cluster { /** * Primary callback which is triggered upon successful Zookeeper connection . */
void onConnect ( ) throws InterruptedException , IOException { } } | if ( state . get ( ) != NodeState . Fresh ) { if ( previousZKSessionStillActive ( ) ) { LOG . info ( "ZooKeeper session re-established before timeout." ) ; return ; } LOG . warn ( "Rejoined after session timeout. Forcing shutdown and clean startup." ) ; ensureCleanStartup ( ) ; } LOG . info ( "Connected to Zookeeper (I... |
public class PooledClusterConnectionProvider { /** * Reset the internal connection cache . This is necessary because the { @ link Partitions } have no reference to the connection
* cache .
* Synchronize on { @ code stateLock } to initiate a happens - before relation and clear the thread caches of other threads . */... | synchronized ( stateLock ) { Arrays . fill ( writers , null ) ; Arrays . fill ( readers , null ) ; } |
public class HMac { /** * 初始化
* @ param algorithm 算法
* @ param key 密钥
* @ return { @ link HMac }
* @ throws CryptoException Cause by IOException */
public HMac init ( String algorithm , byte [ ] key ) { } } | return init ( algorithm , ( null == key ) ? null : new SecretKeySpec ( key , algorithm ) ) ; |
public class TimestampUtils { /** * Get a shared calendar , applying the supplied time zone or the default time zone if null .
* @ param timeZone time zone to be set for the calendar
* @ return The shared calendar . */
public Calendar getSharedCalendar ( TimeZone timeZone ) { } } | if ( timeZone == null ) { timeZone = getDefaultTz ( ) ; } Calendar tmp = calendarWithUserTz ; tmp . setTimeZone ( timeZone ) ; return tmp ; |
public class BooleanUtils { /** * Performs a logical AND on all the Boolean values and returns true if an only if all Boolean values evaluate
* to true , as determined by the BooleanUtils . valueOf method on the Boolean wrapper object . If the Boolean array
* is null , then the result of the AND operation is false ... | boolean result = ( values != null ) ; // innocent until proven guilty
if ( result ) { for ( Boolean value : values ) { result &= valueOf ( value ) ; if ( ! result ) { // short - circuit if we find a false value
break ; } } } return result ; |
public class BrowseIterator { /** * Loads the next page
* @ return false if there are no more pages to load */
private boolean loadPage ( ) { } } | Collection < T > list ; if ( pages . size ( ) <= pageIndex ) { return false ; } list = pages . get ( pageIndex ) ; currentPage = list . iterator ( ) ; return true ; |
public class Vector { /** * Sets the size of this vector . If the new size is greater than the
* current size , new { @ code null } items are added to the end of
* the vector . If the new size is less than the current size , all
* components at index { @ code newSize } and greater are discarded .
* @ param newS... | modCount ++ ; if ( newSize > elementCount ) { ensureCapacityHelper ( newSize ) ; } else { for ( int i = newSize ; i < elementCount ; i ++ ) { elementData [ i ] = null ; } } elementCount = newSize ; |
public class DCProgressBar { /** * Sets the value of the progress bar , if the new value is greater than the
* previous value .
* @ param newValue
* @ return whether or not the value was greater , and thus updated */
public boolean setValueIfGreater ( final int newValue ) { } } | final boolean greater = _value . setIfSignificantToUser ( newValue ) ; if ( greater ) { WidgetUtils . invokeSwingAction ( ( ) -> DCProgressBar . super . setValue ( newValue ) ) ; } return greater ; |
public class Client { /** * ( non - Javadoc )
* @ see org . restcomm . protocols . ss7 . map . api . service . supplementary . MAPServiceSupplementaryListener
* # onProcessUnstructuredSSRequestIndication ( org . mobicents . protocols . ss7 . map .
* api . service . supplementary . ProcessUnstructuredSSRequestIndi... | // This error condition . Client should never receive the
// ProcessUnstructuredSSRequestIndication
logger . error ( String . format ( "onProcessUnstructuredSSRequestIndication for Dialog=%d and invokeId=%d" , procUnstrReqInd . getMAPDialog ( ) . getLocalDialogId ( ) , procUnstrReqInd . getInvokeId ( ) ) ) ; |
public class ParallelLists { /** * implements the visitor to reset the opcode stack , and the file maps
* @ param obj
* the currently parsed method code block */
@ Override public void visitCode ( final Code obj ) { } } | stack . resetForMethodEntry ( this ) ; indexToFieldMap . clear ( ) ; super . visitCode ( obj ) ; |
public class IOGroovyMethods { /** * Iterates through the given reader line by line . Each line is passed to the
* given 1 or 2 arg closure . If the closure has two arguments , the line count is passed
* as the second argument . The Reader is closed before this method returns .
* @ param self a Reader , closed af... | "String" , "String,Integer" } ) Closure < T > closure ) throws IOException { BufferedReader br ; int count = firstLine ; T result = null ; if ( self instanceof BufferedReader ) br = ( BufferedReader ) self ; else br = new BufferedReader ( self ) ; try { while ( true ) { String line = br . readLine ( ) ; if ( line == nu... |
public class TaskInfo { /** * Serialize task information .
* @ param out The stream to which this object is serialized .
* @ throws IOException */
private void writeObject ( ObjectOutputStream out ) throws IOException { } } | final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "writeObject" , new Object [ ] { nonserTaskClassName , nonserTriggerClassName , "initial delay " + initialDelay , "interval " + interval , isFixedRate ? "fixed rate" : false , submittedAsCal... |
public class ViewsFilter { /** * Resolves the view for the given method and response body . Subclasses can override to customize .
* @ param route Request route
* @ param responseBody Response body
* @ return view name to be rendered */
@ SuppressWarnings ( "WeakerAccess" ) protected Optional < String > resolveVi... | Optional optionalViewName = route . getValue ( View . class ) ; if ( optionalViewName . isPresent ( ) ) { return Optional . of ( ( String ) optionalViewName . get ( ) ) ; } else if ( responseBody instanceof ModelAndView ) { return ( ( ModelAndView ) responseBody ) . getView ( ) ; } return Optional . empty ( ) ; |
public class GISTreeSetUtil { /** * Replies the bounds of the area covered by the node and normalize it to
* fit as well as possible the coordinates of the given reference .
* The normalization is done by { @ link # normalize ( Rectangle2d , Rectangle2afp ) } .
* @ param node is the node for which the bounds must... | final Rectangle2d b = getNodeBuildingBounds ( node ) ; assert b != null ; normalize ( b , reference ) ; return b ; |
public class FSABuilder { /** * Build a minimal , deterministic automaton from a sorted list of byte
* sequences .
* @ param input Input sequences to build automaton from .
* @ return Returns the automaton encoding all input sequences . */
public static FSA build ( byte [ ] [ ] input ) { } } | final FSABuilder builder = new FSABuilder ( ) ; for ( byte [ ] chs : input ) { builder . add ( chs , 0 , chs . length ) ; } return builder . complete ( ) ; |
public class AuditingInterceptor { /** * Store the SecurityEvent generated for this request to a persistent store ( database , file , JMS , etc )
* @ param auditEvent
* the SecurityEvent generated for this request
* @ throws Exception
* if the data store is not configured or if an error occurs during storage */... | if ( myDataStore == null ) throw new InternalErrorException ( "No data store provided to persist audit events" ) ; myDataStore . store ( auditEvent ) ; |
public class ColorUtils { /** * Calculate the mix color of 2 colors .
* @ param color1
* first color
* @ param color2
* second color
* @ param weight
* balance point between the two colors in range of 0 to 1.
* @ return the resulting color */
static double mix ( double color1 , double color2 , double weig... | long col1 = Double . doubleToRawLongBits ( color1 ) ; long col2 = Double . doubleToRawLongBits ( color2 ) ; int alpha1 = ( int ) ( col1 >>> 48 ) ; int red1 = ( int ) ( col1 >> 32 ) & 0xFFFF ; int green1 = ( int ) ( col1 >> 16 ) & 0xFFFF ; int blue1 = ( int ) ( col1 ) & 0xFFFF ; int alpha2 = ( int ) ( col2 >>> 48 ) ; in... |
public class DefaultAESCBCCipher { /** * This method is used to encrypt ( Symmetric ) plainText coming in input using AES algorithm
* @ param plainText the plain text string to be encrypted
* @ return Base64 encoded AES encrypted cipher text */
@ Override public String encrypt ( String plainText ) { } } | this . encryptionLock . lock ( ) ; try { byte [ ] cipherBytes = null ; try { cipherBytes = encryptCipher . doFinal ( plainText . getBytes ( charset ) ) ; } catch ( UnsupportedEncodingException | IllegalBlockSizeException | BadPaddingException e ) { logger . error ( "DefaultAESCBCCipher failed to encrypt text" , e ) ; t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.