signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class AbstractKeyCodeAction { /** * TODO [ larmic ] find a better way */ private UIForm getForm ( UIComponent component ) { } }
while ( component != null ) { if ( component instanceof UIForm ) { break ; } component = component . getParent ( ) ; } return ( UIForm ) component ;
public class MediaApi { /** * Start monitoring an agent * Start supervisor monitoring of an agent on the specified media channel . When a monitored agent accepts a chat , the supervisor also receives the chat and all related notifications . If the agent is currently in a chat , the supervisor is added to the agent & ...
ApiResponse < ApiSuccessResponse > resp = mediaStartMonitoringWithHttpInfo ( mediatype , mediaStartMonitoringData ) ; return resp . getData ( ) ;
public class BlobContainersInner { /** * Aborts an unlocked immutability policy . The response of delete has immutabilityPeriodSinceCreationInDays set to 0 . ETag in If - Match is required for this operation . Deleting a locked immutability policy is not allowed , only way is to delete the container after deleting all ...
return deleteImmutabilityPolicyWithServiceResponseAsync ( resourceGroupName , accountName , containerName , ifMatch ) . toBlocking ( ) . single ( ) . body ( ) ;
public class ZoomableGraphicsContext { /** * Adds segments to the current path to make a quadratic Bezier curve . * The coordinates are transformed by the current transform as they are * added to the path and unaffected by subsequent changes to the transform . * The current path is a path attribute * used for a...
this . gc . quadraticCurveTo ( doc2fxX ( xc ) , doc2fxY ( yc ) , doc2fxX ( x1 ) , doc2fxY ( y1 ) ) ;
public class ResponseCollector { /** * Waits until all responses have been received , or until a timeout has elapsed . * @ param timeout Number of milliseconds to wait max . This value needs to be greater than 0 , or else * it will be adjusted to 2000 * @ return boolean True if all responses have been received wi...
if ( timeout <= 0 ) timeout = 2000L ; return cond . waitFor ( this :: hasAllResponses , timeout , TimeUnit . MILLISECONDS ) ;
public class PublishLayerVersionResult { /** * The layer ' s compatible runtimes . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setCompatibleRuntimes ( java . util . Collection ) } or { @ link # withCompatibleRuntimes ( java . util . Collection ) } if * ...
if ( this . compatibleRuntimes == null ) { setCompatibleRuntimes ( new com . amazonaws . internal . SdkInternalList < String > ( compatibleRuntimes . length ) ) ; } for ( String ele : compatibleRuntimes ) { this . compatibleRuntimes . add ( ele ) ; } return this ;
public class SimpleFormatter { /** * / * [ deutsch ] * < p > Erzeugt ein neues Format - Objekt f & uuml ; r reine Datumsobjekte mit Hilfe des angegebenen Musters * in der angegebenen Sprach - und L & auml ; ndereinstellung . < / p > * < p > Das Formatmuster wird nur beim Formatieren oder Interpretieren gepr & uum...
return new SimpleFormatter < > ( PlainDate . class , pattern , locale , Leniency . SMART , null ) ;
public class ByteUtil { /** * Converts a int value into a byte array . * @ param val * - int value to convert * @ return value with leading byte that are zeroes striped */ public static byte [ ] intToBytesNoLeadZeroes ( int val ) { } }
if ( val == 0 ) return EMPTY_BYTE_ARRAY ; int lenght = 0 ; int tmpVal = val ; while ( tmpVal != 0 ) { tmpVal = tmpVal >>> 8 ; ++ lenght ; } byte [ ] result = new byte [ lenght ] ; int index = result . length - 1 ; while ( val != 0 ) { result [ index ] = ( byte ) ( val & 0xFF ) ; val = val >>> 8 ; index -= 1 ; } return ...
public class SwaggerBuilder { /** * Registers a custom object model with Swagger . A model is only registered once . * @ param swagger * @ param modelClass * @ return the Swagger ref of the model */ protected String registerModel ( Swagger swagger , Class < ? > modelClass ) { } }
final Tag modelTag = getModelTag ( modelClass ) ; final String ref = modelTag . getName ( ) ; if ( swagger . getDefinitions ( ) != null && swagger . getDefinitions ( ) . containsKey ( ref ) ) { // model already registered return ref ; } ModelImpl model = new ModelImpl ( ) ; swagger . addDefinition ( modelTag . getName ...
public class JasperReportsUtil { /** * public static JasperPrint fillReport ( File jasper , Map params , Connection conn ) throws Exception { * FileInputStream input = new FileInputStream ( jasper ) ; * return JasperFillManager . fillReport ( input , params , conn ) ; */ public static byte [ ] getPdf ( JasperPrint ...
byte [ ] content = null ; ByteArrayOutputStream baos = null ; try { baos = new ByteArrayOutputStream ( ) ; JRPdfExporter exporter = new JRPdfExporter ( ) ; content = getBytes ( exporter , baos , jasperPrint ) ; } finally { if ( baos != null ) { try { baos . flush ( ) ; baos . close ( ) ; } catch ( Exception e ) { e . p...
public class IfcElementImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) public EList < IfcRelCoversBldgElements > getHasCoverings ( ) { } }
return ( EList < IfcRelCoversBldgElements > ) eGet ( Ifc2x3tc1Package . Literals . IFC_ELEMENT__HAS_COVERINGS , true ) ;
public class ByteVector { /** * Return the current byte array containing the bytes . * @ return a copy of the byte array */ public byte [ ] getBytes ( ) { } }
if ( ! changed ) { return buf ; } byte [ ] newBuf = new byte [ bufLen ] ; System . arraycopy ( buf , 0 , newBuf , 0 , bufLen ) ; buf = newBuf ; return buf ;
public class Entity { /** * Get a total of an attribute thru a multi - relation possibly slicing by a * filter . * @ param multiRelationName * @ param filter * @ param numericAttributeName * @ return total of an attribute . */ Double getSum ( String multiRelationName , EntityFilter filter , String numericAttr...
return instance . getSum ( this , multiRelationName , filter , numericAttributeName ) ;
public class MethodInvocationTrap { /** * Converts a ClosureExpression into the String source . * @ param expression a closure * @ return the source the closure was created from */ protected String convertClosureToSource ( ClosureExpression expression ) { } }
try { return ClosureUtils . convertClosureToSource ( source , expression ) ; } catch ( Exception e ) { addError ( e . getMessage ( ) , expression ) ; } return null ;
public class TechnologyTargeting { /** * Sets the browserLanguageTargeting value for this TechnologyTargeting . * @ param browserLanguageTargeting * The languages of browsers being targeted by the { @ link LineItem } . */ public void setBrowserLanguageTargeting ( com . google . api . ads . admanager . axis . v201805 ...
this . browserLanguageTargeting = browserLanguageTargeting ;
public class ChangeControl { /** * Returns true if the requested property is set ; false , otherwise . * @ return * returned object is { @ link boolean } */ @ Override public boolean isSet ( String propName ) { } }
if ( propName . equals ( "checkPoint" ) ) { return isSetCheckPoint ( ) ; } if ( propName . equals ( "changeTypes" ) ) { return isSetChangeTypes ( ) ; } return super . isSet ( propName ) ;
public class FormatReaderComposite { /** * public static FormatReaderComposite basicArrayReader ( String input , String arrayDelimiter , String ignore ) { * return new FormatReaderComposite ( input , new HandlerArrayFromDelimited ( arrayDelimiter ) . ignore ( ignore ) ) ; */ public static FormatReaderComposite basicA...
return new FormatReaderComposite ( input , new HandlerArrayFromDelimited ( arrayDelimiter ) ) ;
public class UserAPI { /** * 获取关注者列表 * @ param nextOpenid 下一个用户的ID * @ return 关注者列表对象 */ public GetUsersResponse getUsers ( String nextOpenid ) { } }
GetUsersResponse response ; LOG . debug ( "获取关注者列表....." ) ; String url = BASE_API_URL + "cgi-bin/user/get?access_token=#" ; if ( StrUtil . isNotBlank ( nextOpenid ) ) { url += "&next_openid=" + nextOpenid ; } BaseResponse r = executeGet ( url ) ; String resultJson = isSuccess ( r . getErrcode ( ) ) ? r . getErrmsg ( )...
public class TapClient { /** * Shuts down all tap streams that are currently running . */ public void shutdown ( ) { } }
synchronized ( omap ) { for ( Map . Entry < TapStream , TapConnectionProvider > me : omap . entrySet ( ) ) { me . getValue ( ) . shutdown ( ) ; } }
public class StackTraceSampleCoordinator { /** * Collects stack traces of a task . * @ param sampleId ID of the sample . * @ param executionId ID of the sampled task . * @ param stackTraces Stack traces of the sampled task . * @ throws IllegalStateException If unknown sample ID and not recently * finished or ...
synchronized ( lock ) { if ( isShutDown ) { return ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Collecting stack trace sample {} of task {}" , sampleId , executionId ) ; } PendingStackTraceSample pending = pendingSamples . get ( sampleId ) ; if ( pending != null ) { pending . collectStackTraces ( executionId , ...
public class CPOptionPersistenceImpl { /** * Returns the cp option with the primary key or throws a { @ link com . liferay . portal . kernel . exception . NoSuchModelException } if it could not be found . * @ param primaryKey the primary key of the cp option * @ return the cp option * @ throws NoSuchCPOptionExcep...
CPOption cpOption = fetchByPrimaryKey ( primaryKey ) ; if ( cpOption == null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } throw new NoSuchCPOptionException ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } return cpOption ;
public class SourceLineAnnotation { /** * Create from Method and bytecode offset in a visited class . * @ param classContext * ClassContext of visited class * @ param method * Method in visited class * @ param pc * bytecode offset in visited method * @ return SourceLineAnnotation describing visited instru...
return fromVisitedInstruction ( classContext . getJavaClass ( ) , method , pc ) ;
public class LocalDateIteratorFactory { /** * given a block of RRULE , EXRULE , RDATE , and EXDATE content lines , parse * them into a single local date iterable . * @ param rdata RRULE , EXRULE , RDATE , and EXDATE lines . * @ param start the first occurrence of the series . * @ param strict true if any failur...
return createLocalDateIterable ( rdata , start , DateTimeZone . UTC , strict ) ;
public class AbstractProtoParserListener { /** * Remove common leading whitespaces from all strings in the list . * Returns new list instance . */ protected List < String > trim ( List < String > comments ) { } }
List < String > trimComments = new ArrayList < > ( ) ; int n = 0 ; boolean tryRemoveWhitespace = true ; while ( tryRemoveWhitespace ) { boolean allLinesAreShorter = true ; for ( String comment : comments ) { if ( comment . length ( ) <= n ) { continue ; } if ( comment . charAt ( n ) != ' ' ) { tryRemoveWhitespace = fal...
public class XmlEmit { /** * / * Write out the tag name , adding the ns abbreviation . * Also add the namespace declarations if this is the first tag * @ param tag * @ throws IOException */ private void emitQName ( final QName tag ) throws IOException { } }
nameSpaces . emitNsAbbr ( tag . getNamespaceURI ( ) , wtr ) ; out ( tag . getLocalPart ( ) ) ; emitNs ( ) ;
public class SeekBarPreference { /** * Obtains the unit , which is used for textual representation of the preference ' s value , from a * specific typed array . * @ param typedArray * The typed array , the unit should be obtained from , as an instance of the class { @ link * TypedArray } . The typed array may n...
setUnit ( typedArray . getText ( R . styleable . AbstractUnitPreference_unit ) ) ;
public class WhileyFileParser { /** * Parse a logical expression of the form : * < pre > * Expr : : = AndOrExpr [ " = = > " UnitExpr ] * < / pre > * @ param scope * The enclosing scope for this statement , which determines the * set of visible ( i . e . declared ) variables and also the current * indentat...
checkNotEof ( ) ; int start = index ; Expr lhs = parseAndOrExpression ( scope , terminated ) ; Token lookahead = tryAndMatch ( terminated , LogicalImplication , LogicalIff ) ; if ( lookahead != null ) { switch ( lookahead . kind ) { case LogicalImplication : { Expr rhs = parseExpression ( scope , terminated ) ; lhs = n...
public class PathHandler { /** * Initialize the log . */ @ PostConstruct public void init ( ) throws ConfigException { } }
try { _pathLog . init ( ) ; super . init ( ) ; WriteStream os = _pathLog . getRotateStream ( ) . getStream ( ) ; /* if ( _ timestamp ! = null ) { _ timestampFilter = new TimestampFilter ( ) ; _ timestampFilter . setTimestamp ( _ timestamp ) ; */ /* String encoding = System . getProperty ( " file . encoding " ) ; ...
public class ComponentClass { /** * Adds the supplied render priority override record to this component class . */ public void addPriorityOverride ( PriorityOverride override ) { } }
if ( _overrides == null ) { _overrides = new ComparableArrayList < PriorityOverride > ( ) ; } _overrides . insertSorted ( override ) ;
public class TranStrategy { /** * This utility method attempts to resume the global transaction * associated with the input control object . If it fails , an * an exception consistent with the EJB exception conventions * is thrown . < p > */ final void resumeGlobalTx ( Transaction control , int action ) // LIDB16...
try { txCtrl . resumeGlobalTx ( control , action ) ; // d165585 Begins if ( TraceComponent . isAnyTracingEnabled ( ) && // d527372 TETxLifeCycleInfo . isTraceEnabled ( ) ) // PQ74774 { // PQ74774 String idStr = txCtrl . txService . getTransaction ( ) . toString ( ) ; int idx ; idStr = ( idStr != null ) ? ( ( ( idx = id...
public class NumberFunctions { /** * Returned expression results in the arctangent of expression2 / expression1. */ public static Expression atan ( String expression1 , String expression2 ) { } }
return atan ( x ( expression1 ) , x ( expression2 ) ) ;
public class ConsumerContainer { /** * Filters the consumers matching the given active flag from the list of managed consumers . * @ param active Whether to filter for active or inactive consumers * @ return The filtered consumers */ protected List < ConsumerHolder > filterConsumersForActiveFlag ( boolean active ) ...
List < ConsumerHolder > consumerHolderSubList = new LinkedList < ConsumerHolder > ( ) ; for ( ConsumerHolder consumerHolder : consumerHolders ) { if ( consumerHolder . isActive ( ) == active ) { consumerHolderSubList . add ( consumerHolder ) ; } } return consumerHolderSubList ;
public class N { /** * Inserts the specified elements at the specified position in the array . * Shifts the element currently at that position ( if any ) and any subsequent * elements to the right ( adds one to their indices ) . * @ param a * the first array whose elements are added to the new array . * @ par...
if ( N . isNullOrEmpty ( a ) && index == 0 ) { return b . clone ( ) ; } final boolean [ ] newArray = new boolean [ a . length + b . length ] ; if ( index > 0 ) { copy ( a , 0 , newArray , 0 , index ) ; } copy ( b , 0 , newArray , index , b . length ) ; if ( index < a . length ) { copy ( a , index , newArray , index + b...
public class GroovyCollections { /** * Finds all combinations of items from the given Iterable aggregate of collections . * So , < code > combinations ( [ [ true , false ] , [ true , false ] ] ) < / code > * is < code > [ [ true , true ] , [ false , true ] , [ true , false ] , [ false , false ] ] < / code > * and...
List collectedCombos = new ArrayList ( ) ; for ( Object collection : collections ) { Iterable items = DefaultTypeTransformation . asCollection ( collection ) ; if ( collectedCombos . isEmpty ( ) ) { for ( Object item : items ) { List l = new ArrayList ( ) ; l . add ( item ) ; collectedCombos . add ( l ) ; } } else { Li...
public class JsassServlet { /** * Resolve the target file for an { @ code @ import } directive . * @ param url The { @ code import } url . * @ param previous The file that contains the { @ code import } directive . * @ return The resolve import objects or { @ code null } if the import file was not found . */ priv...
try { if ( url . startsWith ( "/" ) ) { // absolute imports are searched in / WEB - INF / scss return resolveImport ( Paths . get ( "/WEB-INF/scss" ) . resolve ( url ) ) ; } // find in import paths final List < Path > importPaths = new LinkedList < > ( ) ; // ( a ) relative to the previous import file final String prev...
public class ValueRange { /** * Obtains a fixed value range . * This factory obtains a range where the minimum and maximum values are fixed . * For example , the ISO month - of - year always runs from 1 to 12. * @ param min the minimum value * @ param max the maximum value * @ return the ValueRange for min , ...
if ( min > max ) { throw new IllegalArgumentException ( "Minimum value must be less than maximum value" ) ; } return new ValueRange ( min , min , max , max ) ;
public class DateIntervalInfo { /** * Check whether one field width is numeric while the other is string . * TODO ( xji ) : make it general * @ param fieldWidth one field width * @ param anotherFieldWidth another field width * @ param patternLetter pattern letter char * @ return true if one field width is num...
if ( patternLetter == 'M' ) { if ( fieldWidth <= 2 && anotherFieldWidth > 2 || fieldWidth > 2 && anotherFieldWidth <= 2 ) { return true ; } } return false ;
public class MediaEndpoint { /** * Registers a listener for when the { @ link MediaElement } triggers an * { @ link ErrorEvent } . Notifies the owner with the error . * @ param element the { @ link MediaElement } * @ return { @ link ListenerSubscription } that can be used to deregister the * listener */ protect...
return element . addErrorListener ( new EventListener < ErrorEvent > ( ) { @ Override public void onEvent ( ErrorEvent event ) { owner . sendMediaError ( event ) ; } } ) ;
public class URLIdentifier { /** * Load the structure from the URL * @ return null */ @ Override public Structure loadStructure ( AtomCache cache ) throws StructureException , IOException { } }
StructureFiletype format = StructureFiletype . UNKNOWN ; // Use user - specified format try { Map < String , String > params = parseQuery ( url ) ; if ( params . containsKey ( FORMAT_PARAM ) ) { String formatStr = params . get ( FORMAT_PARAM ) ; format = StructureIO . guessFiletype ( "." + formatStr ) ; } } catch ( Uns...
public class BibliographyFileReader { /** * Reads the first bytes of the given input stream and tries to * determine the file format . Resets the input stream to the position * it had when the method was called . Reads up to 100 KB and before * giving up . Note that you can supply an additional file name to help ...
int len = 1024 * 100 ; String ext = "" ; if ( filename != null ) { int dot = filename . lastIndexOf ( '.' ) ; if ( dot > 0 ) { ext = filename . substring ( dot + 1 ) ; } } // check the first couple of bytes bis . mark ( len ) ; try { byte [ ] firstCharacters = new byte [ 6 ] ; bis . read ( firstCharacters ) ; // check ...
public class AmBaseBolt { /** * Use anchor function ( child message failed . notify fail to parent message . ) , and not use this class ' s key history function . < br > * Send message to downstream component with grouping key . < br > * Use following situation . * < ol > * < li > Not use this class ' s key his...
getCollector ( ) . emit ( this . getExecutingTuple ( ) , new Values ( groupingKey , message ) ) ;
public class PingManager { /** * Ping the server if deemed necessary because automatic server pings are * enabled ( { @ link # setPingInterval ( int ) } ) and the ping interval has expired . */ public void pingServerIfNecessary ( ) { } }
final XMPPConnection connection = connection ( ) ; if ( connection == null ) { // connection has been collected by GC // which means we can stop the thread by breaking the loop return ; } if ( pingInterval <= 0 ) { // Ping has been disabled return ; } long lastStanzaReceived = connection . getLastStanzaReceived ( ) ; i...
public class OrientModelGraphUtils { /** * Gets the value for the given field of a graph object . */ public static String getFieldValue ( ODocument document , String fieldname ) { } }
return ( String ) document . field ( fieldname ) ;
public class PageFlowUtils { /** * Set a named action output , which corresponds to an input declared by the < code > pageInput < / code > JSP tag . * The actual value can be read from within a JSP using the < code > " pageInput " < / code > databinding context . * @ deprecated Use { @ link # addActionOutput } inst...
addActionOutput ( name , value , request ) ;
public class ExcelWriter { /** * 设置列宽 ( 单位为一个字符的宽度 , 例如传入width为10 , 表示10个字符的宽度 ) * @ param columnIndex 列号 ( 从0开始计数 , - 1表示所有列的默认宽度 ) * @ param width 宽度 ( 单位1 ~ 256个字符宽度 ) * @ return this * @ since 4.0.8 */ public ExcelWriter setColumnWidth ( int columnIndex , int width ) { } }
if ( columnIndex < 0 ) { this . sheet . setDefaultColumnWidth ( width ) ; } else { this . sheet . setColumnWidth ( columnIndex , width * 256 ) ; } return this ;
public class BeanHelper { /** * Applies bean action by using default factory . * < p > Bean actions are : * < p > List item property remove by adding ' # ' to the end of pattern . * < p > E . g . list . 3 - same as list . remove ( 3) * < p > List item property assign by adding ' = ' to the end of pattern * < ...
return applyList ( base , fieldname , BeanHelper :: defaultFactory ) ;
public class AtmosRequestMappingHandlerMapping { /** * convert httpMethods String array to RequestMethod array * @ param httpMethods * @ return */ private RequestMethodsRequestCondition getRequestMethodsRequestCondition ( String [ ] httpMethods ) { } }
RequestMethod [ ] requestMethods = new RequestMethod [ httpMethods . length ] ; for ( int i = 0 ; i < requestMethods . length ; i ++ ) { requestMethods [ i ] = RequestMethod . valueOf ( httpMethods [ i ] ) ; } return new RequestMethodsRequestCondition ( requestMethods ) ;
public class ArrayFile { /** * Loads this ArrayFile into a memory - based long array . * @ throws IOException */ public void load ( MemoryLongArray longArray ) throws IOException { } }
if ( ! _file . exists ( ) || _file . length ( ) == 0 ) { return ; } Chronos c = new Chronos ( ) ; DataReader r = IOFactory . createDataReader ( _file , _type ) ; try { r . open ( ) ; r . position ( DATA_START_POSITION ) ; for ( int i = 0 ; i < _arrayLength ; i ++ ) { longArray . set ( i , r . readLong ( ) ) ; } _log . ...
public class LocationIndexTree { /** * Searches also neighbouring tiles until the maximum distance from the query point is reached * ( minResolutionInMeter * regionAround ) . Set to 1 for to force avoiding a fall back , good if you * have strict performance and lookup - quality requirements . Default is 4. */ publi...
if ( numTiles < 1 ) throw new IllegalArgumentException ( "Region of location index must be at least 1 but was " + numTiles ) ; // see # 232 if ( numTiles % 2 == 1 ) numTiles ++ ; this . maxRegionSearch = numTiles ; return this ;
public class NettyContainer { /** * / * horrible , looks like rubby */ private String [ ] extractBasicAuthCredentials ( String authorizationHeader ) { } }
if ( authorizationHeader == null ) { return null ; } String [ ] schemeUserPass = new String [ 3 ] ; String credentials ; final String [ ] headerParts = authorizationHeader . split ( " " ) ; if ( headerParts != null && headerParts . length == 2 ) { schemeUserPass [ 0 ] = headerParts [ 0 ] . equalsIgnoreCase ( "basic" ) ...
public class Matrix4x3d { /** * / * ( non - Javadoc ) * @ see org . joml . Matrix4x3dc # transpose3x3 ( org . joml . Matrix4x3d ) */ public Matrix4x3d transpose3x3 ( Matrix4x3d dest ) { } }
double nm00 = m00 ; double nm01 = m10 ; double nm02 = m20 ; double nm10 = m01 ; double nm11 = m11 ; double nm12 = m21 ; double nm20 = m02 ; double nm21 = m12 ; double nm22 = m22 ; dest . m00 = nm00 ; dest . m01 = nm01 ; dest . m02 = nm02 ; dest . m10 = nm10 ; dest . m11 = nm11 ; dest . m12 = nm12 ; dest . m20 = nm20 ; ...
public class GetOpenIdTokenForDeveloperIdentityRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetOpenIdTokenForDeveloperIdentityRequest getOpenIdTokenForDeveloperIdentityRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getOpenIdTokenForDeveloperIdentityRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getOpenIdTokenForDeveloperIdentityRequest . getIdentityPoolId ( ) , IDENTITYPOOLID_BINDING ) ; protocolMarshaller . marshall ( getOpenIdTokenFo...
public class JCollapsiblePaneBeanInfo { /** * Gets the icon . * @ param type Description of the Parameter * @ return The icon value */ @ Override public Image getIcon ( int type ) { } }
if ( type == BeanInfo . ICON_COLOR_16x16 ) { return iconColor16 ; } if ( type == BeanInfo . ICON_MONO_16x16 ) { return iconMono16 ; } if ( type == BeanInfo . ICON_COLOR_32x32 ) { return iconColor32 ; } if ( type == BeanInfo . ICON_MONO_32x32 ) { return iconMono32 ; } return null ;
public class Conversions { /** * Tries conversion of any value to a decimal */ public static BigDecimal toDecimal ( Object value , EvaluationContext ctx ) { } }
if ( value instanceof Boolean ) { return ( ( Boolean ) value ) ? BigDecimal . ONE : BigDecimal . ZERO ; } else if ( value instanceof Integer ) { return new BigDecimal ( ( Integer ) value ) ; } else if ( value instanceof BigDecimal ) { return ( BigDecimal ) value ; } else if ( value instanceof String ) { try { return ne...
public class PropertyUtil { /** * expand a keyString that may contain references to properties * located in provided Properties object * @ return expanded * @ param keyString string * @ param properties properties */ public static String expand ( String keyString , Properties properties ) { } }
return PropertyUtil . expand ( keyString , ( Map ) properties ) ;
public class SegmentedByteArray { /** * Ensures that the segment at segmentIndex exists * @ param segmentIndex */ private void ensureCapacity ( int segmentIndex ) { } }
while ( segmentIndex >= segments . length ) { segments = Arrays . copyOf ( segments , segments . length * 3 / 2 ) ; } long numSegmentsPopulated = length >> log2OfSegmentSize ; for ( long i = numSegmentsPopulated ; i <= segmentIndex ; i ++ ) { segments [ ( int ) i ] = memoryPool . getSegment ( ) ; length += 1 << log2OfS...
public class SimpleConceptId { /** * Returns a concept propId with the given string identifier . * @ param id a concept identifier { @ link String } . Cannot be * < code > null < / code > . * @ return a { @ link PropDefConceptId } . */ public static ConceptId getInstance ( String id , Metadata metadata ) { } }
List < Object > key = new ArrayList < > ( 1 ) ; key . add ( id ) ; ConceptId result = metadata . getFromConceptIdCache ( key ) ; if ( result != null ) { return result ; } else { result = new SimpleConceptId ( id , metadata ) ; metadata . putInConceptIdCache ( key , result ) ; return result ; }
public class DefaultGroovyMethods { /** * Finds the items matching the IDENTITY Closure ( i . e . & # 160 ; matching Groovy truth ) . * Example : * < pre class = " groovyTestCase " > * def items = [ 1 , 2 , 0 , false , true , ' ' , ' foo ' , [ ] , [ 4 , 5 ] , null ] as Set * assert items . findAll ( ) = = [ 1 ,...
return findAll ( self , Closure . IDENTITY ) ;
public class RuntimeUpdateManagerImpl { /** * Call the { @ code ServerQuiesceListener # serverStopping ( ) } method on all discovered * references . Calls are queued to a small thread pool , which is then stopped . * All invocations are then allowed to complete . * @ param listenerRefs Collection of { @ code Serv...
// Make a copy of existing notifications : we can ' t hold the lock around notifications // to iterate while waiting for the existing notifications to complete because that would // lock - out cleanupNotifications . final Map < String , RuntimeUpdateNotification > existingNotifications = new HashMap < String , RuntimeU...
public class ColorXMLProcessor { /** * Register for " * " and " xml " file extensions the ColorResourceFactoryImpl factory . * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override protected Map < String , Resource . Factory > getRegistrations ( ) { } }
if ( registrations == null ) { super . getRegistrations ( ) ; registrations . put ( XML_EXTENSION , new ColorResourceFactoryImpl ( ) ) ; registrations . put ( STAR_EXTENSION , new ColorResourceFactoryImpl ( ) ) ; } return registrations ;
public class MenuPanel { /** * Override preparePaintComponent in order to populate the recently accessed menu when a user accesses this panel * for the first time . * @ param request the request being responded to . */ @ Override protected void preparePaintComponent ( final Request request ) { } }
super . preparePaintComponent ( request ) ; if ( ! isInitialised ( ) ) { updateRecentMenu ( ) ; setInitialised ( true ) ; } boolean hasRecentMenu = menu . getMenuItems ( ) . size ( ) > 0 ; menu . setVisible ( hasRecentMenu ) ; recentMenuHeading . setVisible ( hasRecentMenu ) ;
public class AbstractIdentityDeserializationInfo { /** * { @ inheritDoc } */ @ Override public final Object readId ( JsonReader reader , JsonDeserializationContext ctx ) { } }
return getDeserializer ( ) . deserialize ( reader , ctx ) ;
public class Transforms { /** * Raises a square matrix to a power < i > n < / i > , which can be positive , negative , or zero . * The behavior is similar to the numpy matrix _ power ( ) function . The algorithm uses * repeated squarings to minimize the number of mmul ( ) operations needed * < p > If < i > n < / ...
Preconditions . checkState ( in . isMatrix ( ) && in . isSquare ( ) , "Input must be a square matrix: got input with shape %s" , in . shape ( ) ) ; if ( n == 0 ) { if ( dup ) return Nd4j . eye ( in . rows ( ) ) ; else return in . assign ( Nd4j . eye ( in . rows ( ) ) ) ; } INDArray temp ; if ( n < 0 ) { temp = InvertMa...
public class CheckJSDoc { /** * Checks that an @ implicitCast annotation is in the externs */ private void validateImplicitCast ( Node n , JSDocInfo info ) { } }
if ( ! inExterns && info != null && info . isImplicitCast ( ) ) { report ( n , TypeCheck . ILLEGAL_IMPLICIT_CAST ) ; }
public class ExportJobResourceMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ExportJobResource exportJobResource , ProtocolMarshaller protocolMarshaller ) { } }
if ( exportJobResource == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( exportJobResource . getRoleArn ( ) , ROLEARN_BINDING ) ; protocolMarshaller . marshall ( exportJobResource . getS3UrlPrefix ( ) , S3URLPREFIX_BINDING ) ; protocolMarsh...
public class AWSComprehendMedicalClient { /** * Inspects the clinical text for personal health information ( PHI ) entities and entity category , location , and * confidence score on that information . * @ param detectPHIRequest * @ return Result of the DetectPHI operation returned by the service . * @ throws I...
request = beforeClientExecution ( request ) ; return executeDetectPHI ( request ) ;
public class BaseFixData { /** * GetRecordFromCode Method . */ public static Record getRecordFromCode ( BaseField field , String strDesc , String strFieldName , Record recSecond ) { } }
if ( ( strDesc == null ) || ( strDesc . length ( ) == 0 ) ) return null ; BaseField fldSecond = null ; if ( strFieldName != null ) fldSecond = recSecond . getField ( strFieldName ) ; if ( fldSecond == null ) fldSecond = recSecond . getField ( "Code" ) ; if ( fldSecond == null ) return null ; recSecond . setKeyArea ( fl...
public class InteractiveElement { /** * ( non - Javadoc ) * @ see qc . automation . framework . widget . IInteractiveElement # isEnabled ( ) */ @ Override public boolean isEnabled ( ) throws WidgetException { } }
try { return getWebElement ( ) . isEnabled ( ) ; } catch ( Exception e ) { throw new WidgetException ( "Error while determing whether element is enabled" , getByLocator ( ) , e ) ; }
public class ArrayUtil { /** * 以 conjunction 为分隔符将数组转换为字符串 * @ param array 数组 * @ param conjunction 分隔符 * @ return 连接后的字符串 */ public static String join ( Object array , CharSequence conjunction ) { } }
if ( isArray ( array ) ) { final Class < ? > componentType = array . getClass ( ) . getComponentType ( ) ; if ( componentType . isPrimitive ( ) ) { final String componentTypeName = componentType . getName ( ) ; switch ( componentTypeName ) { case "long" : return join ( ( long [ ] ) array , conjunction ) ; case "int" : ...
public class MapFormat { /** * Designated method . It gets the string , initializes HashFormat object * and returns converted string . It scans < code > pattern < / code > * for { } brackets , then parses enclosed string and replaces it * with argument ' s < code > get ( ) < / code > value . * @ param pattern S...
MapFormat temp = new MapFormat ( arguments ) ; return temp . format ( pattern ) ;
public class ComputeNodeOperations { /** * Gets the specified compute node . * @ param poolId The ID of the pool . * @ param nodeId the ID of the compute node to get from the pool . * @ return A { @ link ComputeNode } containing information about the specified compute node . * @ throws BatchErrorException Excep...
return getComputeNode ( poolId , nodeId , null , null ) ;
public class Scroller { /** * Scrolls horizontally . * @ param side the side to which to scroll ; { @ link Side # RIGHT } or { @ link Side # LEFT } * @ param scrollPosition the position to scroll to , from 0 to 1 where 1 is all the way . Example is : 0.55. * @ param stepCount how many move steps to include in the...
WindowManager windowManager = ( WindowManager ) inst . getTargetContext ( ) . getSystemService ( Context . WINDOW_SERVICE ) ; int screenHeight = windowManager . getDefaultDisplay ( ) . getHeight ( ) ; int screenWidth = windowManager . getDefaultDisplay ( ) . getWidth ( ) ; float x = screenWidth * scrollPosition ; float...
public class ResolveResult { /** * better option ? we don ' t have variance */ @ SuppressWarnings ( "unchecked" ) ResolveResult < AbstractConfigObject > asObjectResult ( ) { } }
if ( ! ( value instanceof AbstractConfigObject ) ) throw new ConfigException . BugOrBroken ( "Expecting a resolve result to be an object, but it was " + value ) ; Object o = this ; return ( ResolveResult < AbstractConfigObject > ) o ;
public class KeyResolver18 { /** * region Key Wrapping */ private static String wrapSymmetricKey ( KeyPair wrapperKey , SecretKey symmetricKey ) throws NoSuchPaddingException , NoSuchAlgorithmException , InvalidKeyException , IllegalBlockSizeException { } }
Cipher cipher = Cipher . getInstance ( WRAPPER_TRANSFORMATION ) ; cipher . init ( Cipher . WRAP_MODE , wrapperKey . getPublic ( ) ) ; byte [ ] decodedData = cipher . wrap ( symmetricKey ) ; return Base64 . encodeToString ( decodedData , Base64 . DEFAULT ) ;
public class DerbyDdlParser { /** * Parses DDL CREATE ROLE statement * @ param tokens the tokenized { @ link DdlTokenStream } of the DDL input content ; may not be null * @ param parentNode the parent { @ link AstNode } node ; may not be null * @ return the parsed CREATE ROLE statement node * @ throws ParsingEx...
assert tokens != null ; assert parentNode != null ; markStartOfStatement ( tokens ) ; tokens . consume ( CREATE , "ROLE" ) ; String functionName = parseName ( tokens ) ; AstNode functionNode = nodeFactory ( ) . node ( functionName , parentNode , TYPE_CREATE_ROLE_STATEMENT ) ; markEndOfStatement ( tokens , functionNode ...
public class AsyncMessage { /** * { @ inheritDoc } */ @ Override protected void addParameters ( StringBuilder result ) { } }
super . addParameters ( result ) ; result . append ( ",correlationId=" ) ; result . append ( correlationId ) ;
public class SecurityExceptionProcessor { /** * Catches any exception thrown by the processor chain . If the exception is an instance of a { @ link * SecurityProviderException } , the exception is handled to see if authentication is required * ( { @ link AuthenticationRequiredException } ) , or if access to the res...
try { processorChain . processRequest ( context ) ; } catch ( IOException e ) { throw e ; } catch ( Exception e ) { SecurityProviderException se = findSecurityException ( e ) ; if ( se != null ) { handleSecurityProviderException ( se , context ) ; } else { throw e ; } }
public class JSONEmitter { /** * / / / Main ( for testing / demo ) */ public static void main ( String args [ ] ) { } }
// Here ' s an example of how to use JSONEmitter . This produces the following JSON : // { " doc " : { // " fields " : [ // { " Title " : " Zen and the Art of Motorcycle Maintenance " } , // { " Amazon - Link " : " http : / / www . amazon . com / " } , // { " Author " : " Robert Pirsig " } , // { " Publisher " : " Harp...
public class AppLinkNavigation { /** * Navigates to an { @ link AppLink } for the given destination using the default * App Link resolution strategy . * @ param context the Context from which the navigation should be performed . * @ param destination the destination URL for the App Link . * @ return the { @ lin...
return navigateInBackground ( context , destination , getResolver ( context ) ) ;
public class BaseProcessRecords { /** * GetFullPackageName Method . */ public String getFullPackageName ( String classProjectID , String classPackageName ) { } }
if ( classProjectID == null ) return DBConstants . BLANK ; String packageName = classProjectPackages . get ( classProjectID ) ; if ( packageName == null ) return null ; // This class is not accessible if ( packageName . startsWith ( "." ) ) packageName = Constants . ROOT_PACKAGE . substring ( 0 , Constants . ROOT_PACKA...
public class ComponentTree { /** * Send the event to all matching handlers . * @ param event the event * @ param channels the channels the event is sent to */ @ SuppressWarnings ( "PMD.UseVarargs" ) /* default */ void dispatch ( EventPipeline pipeline , EventBase < ? > event , Channel [ ] channels ) { } }
HandlerList handlers = getEventHandlers ( event , channels ) ; handlers . process ( pipeline , event ) ;
public class DdlUtils { /** * 获取DRDS下表的拆分字段 , 返回格式为 id , name * @ param dataSource * @ param schemaName * @ param tableName * @ return */ public static String getShardKeyByDRDS ( final JdbcTemplate jdbcTemplate , final String catalogName , final String schemaName , final String tableName ) { } }
try { return ( String ) jdbcTemplate . execute ( "show partitions from ?" , new PreparedStatementCallback ( ) { public Object doInPreparedStatement ( PreparedStatement ps ) throws SQLException , DataAccessException { DatabaseMetaData metaData = ps . getConnection ( ) . getMetaData ( ) ; // String sName = getIdentifierN...
public class CaptureActivityIntents { /** * Get the width of the scanning rectangle in pixels from { @ code Intent } . * @ param intent Target intent . It can be { @ code null } . * @ return Width of scanning rectangle in pixels if specified , or zero otherwise . */ public static int getWidthOfScanningRectangleInPx...
if ( intent == null ) return 0 ; return intent . getIntExtra ( Intents . Scan . WIDTH , 0 ) ;
public class JaxWsHttpServletRequestAdapter { /** * ( non - Javadoc ) * @ see javax . servlet . ServletRequest # getServerName ( ) */ @ Override public String getServerName ( ) { } }
try { collaborator . preInvoke ( componentMetaData ) ; return request . getServerName ( ) ; } finally { collaborator . postInvoke ( ) ; }
public class DB2JCCHelper { /** * This method returns a sqljConnectContext . It will go to DB2 to get the connection Context . * We need to create a new WSJccConnection to get the phsyical sqlj context . So the sqlj runtime * will use our WSJccConnection to do the work . * @ param a managedConnection * @ param ...
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "getSQLJContext" ) ; Object rtnctx = null ; try { if ( mc . cachedConnection == null ) { mc . cachedConnection = mcf . jdbcRuntime . newConnection ( mc , mc . sqlConn , WSRdbManagedC...
public class GoogleHadoopFileSystemBase { /** * Concat existing files into one file . * @ param trg the path to the target destination . * @ param psrcs the paths to the sources to use for the concatenation . * @ throws IOException IO failure */ @ Override public void concat ( Path trg , Path [ ] psrcs ) throws I...
logger . atFine ( ) . log ( "GHFS.concat: %s, %s" , trg , lazy ( ( ) -> Arrays . toString ( psrcs ) ) ) ; checkArgument ( psrcs . length > 0 , "psrcs must have at least one source" ) ; URI trgPath = getGcsPath ( trg ) ; List < URI > srcPaths = Arrays . stream ( psrcs ) . map ( this :: getGcsPath ) . collect ( toImmutab...
public class DefaultClassPathResourceLoader { /** * Obtains a stream of resource URLs . * @ param path The path * @ return A resource stream */ public Stream < URL > getResources ( String path ) { } }
Enumeration < URL > all ; try { all = classLoader . getResources ( prefixPath ( path ) ) ; } catch ( IOException e ) { return Stream . empty ( ) ; } Stream . Builder < URL > builder = Stream . builder ( ) ; while ( all . hasMoreElements ( ) ) { URL url = all . nextElement ( ) ; builder . accept ( url ) ; } return build...
public class MaterialToast { /** * Quick fire your toast . * @ param msg Message text for your toast . * @ param className class name to custom style your toast . */ public static void fireToast ( String msg , String className ) { } }
new MaterialToast ( ) . toast ( msg , DURATION , className ) ;
public class DoubleSum { /** * { @ inheritDoc } */ @ Override public synchronized String execute ( SampleResult previousResult , Sampler currentSampler ) throws InvalidVariableException { } }
JMeterVariables vars = getVariables ( ) ; Double sum = 0D ; String varName = ( ( CompoundVariable ) values [ values . length - 1 ] ) . execute ( ) . trim ( ) ; for ( int i = 0 ; i < values . length - 1 ; i ++ ) { sum += Double . parseDouble ( ( ( CompoundVariable ) values [ i ] ) . execute ( ) ) ; } try { sum += Double...
public class AbstractPool { /** * { @ inheritDoc } */ @ Override public synchronized void flush ( FlushMode mode ) { } }
if ( isShutdown ( ) ) return ; for ( Credential credential : pools . keySet ( ) ) { ManagedConnectionPool mcp = pools . get ( credential ) ; if ( mcp != null ) { mcp . flush ( mode ) ; if ( mcp . isEmpty ( ) && ! poolConfiguration . isPrefill ( ) ) { mcp . shutdown ( ) ; pools . remove ( credential ) ; if ( Tracer . is...
public class RepositoryResourceImpl { /** * Moves the resource to the desired state * @ param resource * @ param state * @ throws RepositoryBackendException * @ throws RepositoryResourceException */ public void moveToState ( State state ) throws RepositoryBackendException , RepositoryResourceException { } }
if ( getState ( ) == null ) { return ; } int counter = 0 ; while ( getState ( ) != state ) { counter ++ ; StateAction nextAction = getState ( ) . getNextAction ( state ) ; performLifeCycle ( nextAction ) ; if ( counter >= 10 ) { throw new RepositoryResourceLifecycleException ( "Unable to move to state " + state + " aft...
public class PushSelectCriteria { /** * Push the criteria node as close to the originating node as possible . In general , the criteria node usually ends up being * moved to be a parent of the supplied originating node , except in a couple of cases : * < ul > * < li > There are already criteria nodes immediately ...
// To keep things stable , ' originatingNode ' should be the top - most SELECT ( criteria ) node above a SOURCE . . . while ( originatingNode . getParent ( ) . getType ( ) == Type . SELECT ) { originatingNode = originatingNode . getParent ( ) ; if ( originatingNode == criteriaNode ) return false ; } // Find out the bes...
public class Configuration { /** * This method allows you to set maximum host allocation . However , it ' s recommended to leave it as default : Xmx + something . * @ param max amount of memory in bytes */ public Configuration setMaximumZeroAllocation ( long max ) { } }
long xmx = Runtime . getRuntime ( ) . maxMemory ( ) ; if ( max < xmx ) log . warn ( "Setting maximum memory below -Xmx value can cause problems" ) ; if ( max <= 0 ) throw new IllegalStateException ( "You can't set maximum host memory <= 0" ) ; maximumZeroAllocation = max ; return this ;
public class ClassTree { /** * Return the sub - class / interface list for the class / interface passed . * @ param cd class / interface whose sub - class / interface list is required . * @ param isEnum true if the subclasses should be forced to come from the * enum tree . */ public List < ClassDoc > subs ( Class...
if ( isEnum ) { return get ( subEnums , cd ) ; } else if ( cd . isAnnotationType ( ) ) { return get ( subAnnotationTypes , cd ) ; } else if ( cd . isInterface ( ) ) { return get ( subinterfaces , cd ) ; } else if ( cd . isClass ( ) ) { return get ( subclasses , cd ) ; } else { return null ; }
public class AnswerFunctionalInterfaces { /** * Construct an answer from a two parameter answer interface * @ param answer answer interface * @ param < T > return type * @ param < A > input parameter 1 type * @ param < B > input parameter 2 type * @ return a new answer object */ public static < T , A , B > An...
return new Answer < T > ( ) { @ SuppressWarnings ( "unchecked" ) public T answer ( InvocationOnMock invocation ) throws Throwable { return answer . answer ( ( A ) invocation . getArgument ( 0 ) , ( B ) invocation . getArgument ( 1 ) ) ; } } ;
public class ModuleAssets { /** * Publish an Asset . * @ param asset Asset * @ return { @ link CMAAsset } result instance * @ throws IllegalArgumentException if asset is null . * @ throws IllegalArgumentException if asset has no id . * @ throws IllegalArgumentException if asset has no space id . */ public CMA...
assertNotNull ( asset , "asset" ) ; final String assetId = getResourceIdOrThrow ( asset , "asset" ) ; final String spaceId = getSpaceIdOrThrow ( asset , "asset" ) ; final String environmentId = asset . getEnvironmentId ( ) ; return service . publish ( asset . getSystem ( ) . getVersion ( ) , spaceId , environmentId , a...
public class DeleteTaskRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteTaskRequest deleteTaskRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteTaskRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteTaskRequest . getTaskArn ( ) , TASKARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessa...
public class PollForJobsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PollForJobsRequest pollForJobsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( pollForJobsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( pollForJobsRequest . getActionTypeId ( ) , ACTIONTYPEID_BINDING ) ; protocolMarshaller . marshall ( pollForJobsRequest . getMaxBatchSize ( ) , MAXBATCHSIZE_BINDING ) ...
public class ClassFileImporter { /** * Imports all class files at the given { @ link Path file paths } . If a { @ link Path } refers to a single * class file , that file is imported . If a path refers to a directory , * all class files from that directory as well as sub directories will be imported . * < br > < b...
Set < Location > locations = new HashSet < > ( ) ; for ( Path path : paths ) { locations . add ( Location . of ( path ) ) ; } return importLocations ( locations ) ;
public class AssistantInitiationActionsUpdater { /** * Add the requested post parameters to the Request . * @ param request Request to add post params to */ private void addPostParams ( final Request request ) { } }
if ( initiationActions != null ) { request . addPostParam ( "InitiationActions" , Converter . mapToJson ( initiationActions ) ) ; }