signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class AbstractClientOptionsBuilder { /** * Sets the { @ link ContentPreviewerFactory } creating a { @ link ContentPreviewer } which produces the preview * with the maxmium { @ code length } limit for a request and a response . * The previewer is enabled only if the content type of a request / response meets ...
return contentPreviewerFactory ( ContentPreviewerFactory . ofText ( length , defaultCharset ) ) ;
public class AttachToIndexRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AttachToIndexRequest attachToIndexRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( attachToIndexRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( attachToIndexRequest . getDirectoryArn ( ) , DIRECTORYARN_BINDING ) ; protocolMarshaller . marshall ( attachToIndexRequest . getIndexReference ( ) , INDEXREFERENCE_...
public class LayerMap { /** * Get the container element referenced by a item / key combination . * @ param item Plot item * @ param task Visualization task * @ return Container element */ public Element getContainer ( PlotItem item , VisualizationTask task ) { } }
Pair < Element , Visualization > pair = map . get ( key ( item , task ) ) ; return pair == null ? null : pair . first ;
public class AbstractAWTDrawVisitor { /** * Obtain the exact bounding box of the { @ code text } in the provided * graphics environment . * @ param text the text to obtain the bounds of * @ param g2 the graphic environment * @ return bounds of the text * @ see TextLayout */ protected Rectangle2D getTextBounds...
return new TextLayout ( text , g2 . getFont ( ) , g2 . getFontRenderContext ( ) ) . getBounds ( ) ;
public class JSONHelpers { /** * Create a deep copy of { @ code src } in a new { @ link JSONArray } . * Equivalent to calling { @ link # copy ( JSONArray , boolean ) copy ( src , true ) } . * @ param src { @ code JSONArray } to copy * @ return A new { @ code JSONArray } copied from { @ code src } */ public static...
final JSONArray dest = new JSONArray ( ) ; final int len = src . length ( ) ; for ( int i = 0 ; i < len ; ++ i ) { dest . put ( src . opt ( i ) ) ; } return dest ;
public class Mailer { /** * Simply logs host details , credentials used and whether authentication will take place and finally the transport protocol used . */ private void logSession ( Session session , TransportStrategy transportStrategy ) { } }
final String logmsg = "starting mail session (host: %s, port: %s, username: %s, authenticate: %s, transport: %s)" ; Properties properties = session . getProperties ( ) ; logger . debug ( String . format ( logmsg , properties . get ( transportStrategy . propertyNameHost ( ) ) , properties . get ( transportStrategy . pro...
public class IPSetMarshaller { /** * Marshall the given parameter object . */ public void marshall ( IPSet iPSet , ProtocolMarshaller protocolMarshaller ) { } }
if ( iPSet == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( iPSet . getIPSetId ( ) , IPSETID_BINDING ) ; protocolMarshaller . marshall ( iPSet . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( iPSet . getIPSetDescriptors ( )...
public class Exec { /** * Launches the process , returning a handle to it for IO ops , etc < br / > * < strong > the caller must read the output streams : otherwise the buffers may fill up and the remote program will be * suspended * indefinitely < / strong > * @ return * @ throws IOException */ public BasicP...
final Process p = getProcessBuilder ( ) . start ( ) ; return new BasicProcessTracker ( cmd , p , builder . redirectErrorStream ( ) ) ;
public class MesosTaskManagerParameters { /** * Create the Mesos TaskManager parameters . * @ param flinkConfig the TM configuration . */ public static MesosTaskManagerParameters create ( Configuration flinkConfig ) { } }
List < ConstraintEvaluator > constraints = parseConstraints ( flinkConfig . getString ( MESOS_CONSTRAINTS_HARD_HOSTATTR ) ) ; // parse the common parameters ContaineredTaskManagerParameters containeredParameters = ContaineredTaskManagerParameters . create ( flinkConfig , flinkConfig . getInteger ( MESOS_RM_TASKS_MEMORY...
public class CoronaJobTracker { /** * Based on the resource type , get a resource report of the grant # and * task # . Used by coronajobresources . jsp for debugging which resources are * being used * @ param resourceType Map or reduce type * @ return List of the resource reports for the appropriate type sorted...
Map < Integer , ResourceReport > resourceReportMap = new TreeMap < Integer , ResourceReport > ( ) ; synchronized ( lockObject ) { for ( Map . Entry < TaskAttemptID , Integer > entry : taskLookupTable . taskIdToGrantMap . entrySet ( ) ) { if ( ResourceTracker . isNoneGrantId ( entry . getValue ( ) ) ) { // Skip non - ex...
public class RelationImpl { /** * Reifys and returns the RelationReified */ private RelationReified reify ( ) { } }
if ( relationStructure . isReified ( ) ) return relationStructure . reify ( ) ; // Get the role players to transfer Map < Role , Set < Thing > > rolePlayers = structure ( ) . allRolePlayers ( ) ; // Now Reify relationStructure = relationStructure . reify ( ) ; // Transfer relations rolePlayers . forEach ( ( role , thin...
public class QueujSampleView { /** * GEN - LAST : event _ jButton5ActionPerformed */ private void jButton6ActionPerformed ( java . awt . event . ActionEvent evt ) { } }
// GEN - FIRST : event _ jButton6ActionPerformed QueuJPerfTest test = new QueuJPerfTest ( ) ; System . out . println ( test . run ( ) ) ;
public class TableInputFormat { /** * Maps the current HBase Result into a Record . * This implementation simply stores the HBaseKey at position 0 , and the HBase Result object at position 1. * @ param record * @ param key * @ param result */ public void mapResultToRecord ( Record record , HBaseKey key , HBaseR...
record . setField ( 0 , key ) ; record . setField ( 1 , result ) ;
public class ConsoleImpl { /** * ( non - Javadoc ) * @ see org . restcomm . ss7 . management . console . Console # printNewLine ( ) */ @ Override public void printNewLine ( ) { } }
try { console . pushToConsole ( Config . getLineSeparator ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; }
public class SubordinateControlOptionsExample { /** * Build the subordinate control . */ private void buildControl ( ) { } }
buildControlPanel . reset ( ) ; buildTargetPanel . reset ( ) ; // Setup Trigger setupTrigger ( ) ; // Create target SubordinateTarget target = setupTarget ( ) ; // Create Actions com . github . bordertech . wcomponents . subordinate . Action trueAction ; com . github . bordertech . wcomponents . subordinate . Action fa...
public class MessageBirdClient { /** * Function to delete voice call by id * @ param id Voice call ID * @ throws UnauthorizedException if client is unauthorized * @ throws GeneralException general exception */ public void deleteVoiceCall ( final String id ) throws NotFoundException , GeneralException , Unauthoriz...
if ( id == null ) { throw new IllegalArgumentException ( "Voice Message ID must be specified." ) ; } String url = String . format ( "%s%s" , VOICE_CALLS_BASE_URL , VOICECALLSPATH ) ; messageBirdService . deleteByID ( url , id ) ;
public class WebAuthenticatorProxy { /** * Determines if the application has a FORM login configuration in * its web . xml * @ param webRequest * @ return { @ code true } if the application ' s web . xml has a valid form login configuration . */ private boolean appHasWebXMLFormLogin ( WebRequest webRequest ) { } ...
return webRequest . getFormLoginConfiguration ( ) != null && webRequest . getFormLoginConfiguration ( ) . getLoginPage ( ) != null && webRequest . getFormLoginConfiguration ( ) . getErrorPage ( ) != null ;
public class Serializer { /** * Deserialize an instance of the given class from the input stream . * @ param input The { @ link InputStream } that contains the data to deserialize . * @ param klass The { @ link Class } to deserialize the result into . * @ param < T > The type to deserialize the result into . * ...
return objectMapper . readerFor ( klass ) . readValue ( input ) ;
public class DeviceIdentificationVpdPage { /** * Returns the combined length of all contained IDENTIFICATION DESCRIPTORs . * @ return the combined length of all contained IDENTIFICATION DESCRIPTORs */ private short getPageLength ( ) { } }
short pageLength = 0 ; for ( int i = 0 ; i < identificationDescriptors . length ; ++ i ) { pageLength += identificationDescriptors [ i ] . size ( ) ; } return pageLength ;
public class SharedBaseRecordTable { /** * Set the current table target . * @ param table The new current table . */ public void copyRecordInfo ( Record recDest , Record recSource , boolean bCopyEditMode , boolean bOnlyModifiedFields ) { } }
if ( recDest == null ) recDest = this . getCurrentRecord ( ) ; if ( recDest != recSource ) { boolean bAllowFieldChange = false ; // This will disable field behaviors on move boolean bMoveModifiedState = true ; // This will move the modified status to the new field Object [ ] rgobjEnabledFieldsOld = recSource . setEnabl...
public class ResourceDataContainerMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ResourceDataContainer resourceDataContainer , ProtocolMarshaller protocolMarshaller ) { } }
if ( resourceDataContainer == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( resourceDataContainer . getLocalDeviceResourceData ( ) , LOCALDEVICERESOURCEDATA_BINDING ) ; protocolMarshaller . marshall ( resourceDataContainer . getLocalVolume...
public class ExcelFunctions { /** * Moves a date by the given number of months */ public static Temporal edate ( EvaluationContext ctx , Object date , Object months ) { } }
Temporal dateOrDateTime = Conversions . toDateOrDateTime ( date , ctx ) ; int _months = Conversions . toInteger ( months , ctx ) ; return dateOrDateTime . plus ( _months , ChronoUnit . MONTHS ) ;
public class ST_GeometryShadow { /** * Compute the shadow for a linestring * @ param lineString the input linestring * @ param shadowOffset computed according the sun position and the height of * the geometry * @ return */ private static Geometry shadowLine ( LineString lineString , double [ ] shadowOffset , Ge...
Coordinate [ ] coords = lineString . getCoordinates ( ) ; Collection < Polygon > shadows = new ArrayList < Polygon > ( ) ; createShadowPolygons ( shadows , coords , shadowOffset , factory ) ; if ( ! doUnion ) { return factory . buildGeometry ( shadows ) ; } else { if ( ! shadows . isEmpty ( ) ) { CascadedPolygonUnion u...
public class VoiceApi { /** * Get all calls * Get all active calls for the current agent . * @ return ApiResponse & lt ; InlineResponse200 & gt ; * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public ApiResponse < InlineResponse200 > getCallsWithH...
com . squareup . okhttp . Call call = getCallsValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < InlineResponse200 > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class VisualizePairwiseGainMatrix { /** * Show a single visualization . * @ param context Visualizer context * @ param factory Visualizer factory * @ param task Visualization task */ private void showVisualization ( VisualizerContext context , SimilarityMatrixVisualizer factory , VisualizationTask task ) {...
VisualizationPlot plot = new VisualizationPlot ( ) ; Visualization vis = factory . makeVisualization ( context , task , plot , 1.0 , 1.0 , null ) ; plot . getRoot ( ) . appendChild ( vis . getLayer ( ) ) ; plot . getRoot ( ) . setAttribute ( SVGConstants . SVG_WIDTH_ATTRIBUTE , "20cm" ) ; plot . getRoot ( ) . setAttrib...
public class Session { /** * Revoke a list of resources from a session * @ param idList the list of resources to revoke * @ return the list of resource grants that have been revoked */ public List < ResourceGrant > revokeResource ( List < Integer > idList ) { } }
if ( deleted ) { throw new RuntimeException ( "Session: " + sessionId + " has been deleted" ) ; } List < ResourceGrant > canceledGrants = new ArrayList < ResourceGrant > ( ) ; for ( Integer id : idList ) { ResourceRequestInfo req = idToRequest . get ( id ) ; ResourceGrant grant = idToGrant . remove ( id ) ; if ( grant ...
public class ClassUtils { /** * Gets the unqualified , simple name of the Class type for the specified Object . Returns null if the Object reference * is null . * @ param obj the Object who ' s simple class name is determined . * @ return a String value indicating the simple class name of the Object . * @ see j...
return obj != null ? obj . getClass ( ) . getSimpleName ( ) : null ;
public class BeanDefinitionLoader { /** * Set the resource loader to be used by the underlying readers and scanner . * @ param resourceLoader the resource loader */ public void setResourceLoader ( ResourceLoader resourceLoader ) { } }
this . resourceLoader = resourceLoader ; this . xmlReader . setResourceLoader ( resourceLoader ) ; this . scanner . setResourceLoader ( resourceLoader ) ;
public class EastAsianCS { /** * result in utc - days */ private long firstDayOfMonth ( int cycle , int yearOfCycle , EastAsianMonth month ) { } }
long newYear = this . newYear ( cycle , yearOfCycle ) ; long approxStartOfMonth = this . newMoonOnOrAfter ( newYear + ( month . getNumber ( ) - 1 ) * 29 ) ; if ( month . equals ( this . transform ( approxStartOfMonth ) . getMonth ( ) ) ) { return approxStartOfMonth ; } else { return this . newMoonOnOrAfter ( approxStar...
public class SourceUnit { /** * Generates an AST from the CST . You can retrieve it with getAST ( ) . */ public void convert ( ) throws CompilationFailedException { } }
if ( this . phase == Phases . PARSING && this . phaseComplete ) { gotoPhase ( Phases . CONVERSION ) ; } if ( this . phase != Phases . CONVERSION ) { throw new GroovyBugError ( "SourceUnit not ready for convert()" ) ; } // Build the AST try { this . ast = parserPlugin . buildAST ( this , this . classLoader , this . cst ...
public class JdbcConnectionSource { /** * Make a connection to the database . * @ param logger * This is here so we can use the right logger associated with the sub - class . */ @ SuppressWarnings ( "resource" ) protected DatabaseConnection makeConnection ( Logger logger ) throws SQLException { } }
Properties properties = new Properties ( ) ; if ( username != null ) { properties . setProperty ( "user" , username ) ; } if ( password != null ) { properties . setProperty ( "password" , password ) ; } DatabaseConnection connection = new JdbcDatabaseConnection ( DriverManager . getConnection ( url , properties ) ) ; /...
public class DirectoryBuilder { /** * Adds a new partition to the { @ link Directory } on initialization . * @ param partitionId * the id of the partition * @ param suffix * the suffix of the parition so that it can be addressed using a DN * @ return this builder */ public DirectoryBuilder withPartition ( fin...
this . partitions . put ( partitionId , suffix ) ; return this ;
public class Node { /** * Provides a collection of all the nodes in the tree * using a depth - first preorder traversal . * @ param c the closure to run for each node ( a one or two parameter can be used ; if one parameter is given the * closure will be passed the node , for a two param closure the second paramet...
Map < String , Object > options = new ListHashMap < String , Object > ( ) ; options . put ( "preorder" , true ) ; depthFirst ( options , c ) ;
public class NmeaStreamProcessor { /** * Handles the arrival of a new NMEA line at the given arrival time . * @ param line * @ param arrivalTime */ synchronized void line ( String line , long arrivalTime ) { } }
if ( count . incrementAndGet ( ) % logCountFrequency == 0 ) log . info ( "count=" + count . get ( ) + ",buffer size=" + lines . size ( ) ) ; NmeaMessage nmea ; try { nmea = NmeaUtil . parseNmea ( line ) ; } catch ( NmeaMessageParseException e ) { listener . invalidNmea ( line , arrivalTime , e . getMessage ( ) ) ; retu...
public class ScopeContext { /** * remove all scope objects */ public void clear ( ) { } }
try { Scope scope ; // Map . Entry entry , e ; // Map context ; // release all session scopes Iterator < Entry < String , Map < String , Scope > > > sit = cfSessionContexts . entrySet ( ) . iterator ( ) ; Entry < String , Map < String , Scope > > sentry ; Map < String , Scope > context ; Iterator < Entry < String , Sco...
public class SchedulesInner { /** * Retrieve the schedule identified by schedule name . * @ param resourceGroupName Name of an Azure Resource group . * @ param automationAccountName The name of the automation account . * @ param scheduleName The schedule name . * @ throws IllegalArgumentException thrown if para...
return getWithServiceResponseAsync ( resourceGroupName , automationAccountName , scheduleName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class ApiOvhTelephony { /** * External displayed number creation for a given trunk * REST : POST / telephony / { billingAccount } / trunk / { serviceName } / externalDisplayedNumber * @ param number [ required ] External displayed number to create , in international format * @ param autoValidation [ requir...
String qPath = "/telephony/{billingAccount}/trunk/{serviceName}/externalDisplayedNumber" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "autoValidation" , autoValidation ) ; addBody ( o , "number" , number ) ; Stri...
public class NodeGroupClient { /** * Lists nodes in the node group . * < p > Sample code : * < pre > < code > * try ( NodeGroupClient nodeGroupClient = NodeGroupClient . create ( ) ) { * ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName . of ( " [ PROJECT ] " , " [ ZONE ] " , " [ NODE _ GROUP ] " ) ...
ListNodesNodeGroupsHttpRequest request = ListNodesNodeGroupsHttpRequest . newBuilder ( ) . setNodeGroup ( nodeGroup ) . build ( ) ; return listNodesNodeGroups ( request ) ;
public class OrderedList { /** * Returns stream from key to end * @ param key * @ param inclusive * @ param parallel * @ return */ public Stream < T > tailStream ( T key , boolean inclusive , boolean parallel ) { } }
return StreamSupport . stream ( tailSpliterator ( key , inclusive ) , parallel ) ;
public class DataSet { /** * Partitions a DataSet using the specified KeySelector . * < p > < b > Important : < / b > This operation shuffles the whole DataSet over the network and can take significant amount of time . * @ param keyExtractor The KeyExtractor with which the DataSet is hash - partitioned . * @ retu...
final TypeInformation < K > keyType = TypeExtractor . getKeySelectorTypes ( keyExtractor , getType ( ) ) ; return new PartitionOperator < > ( this , PartitionMethod . HASH , new Keys . SelectorFunctionKeys < > ( clean ( keyExtractor ) , this . getType ( ) , keyType ) , Utils . getCallLocationName ( ) ) ;
public class CompilerConfiguration { /** * Checks if the specified bytecode version string represents a JDK 1.5 + compatible * bytecode version . * @ param bytecodeVersion the bytecode version string ( 1.4 , 1.5 , 1.6 , 1.7 or 1.8) * @ return true if the bytecode version is JDK 1.5 + */ public static boolean isPo...
return JDK5 . equals ( bytecodeVersion ) || JDK6 . equals ( bytecodeVersion ) || JDK7 . equals ( bytecodeVersion ) || JDK8 . equals ( bytecodeVersion ) ;
public class JavacState { /** * Run the copy translator only . */ public void performCopying ( File binDir , Map < String , Transformer > suffixRules ) { } }
Map < String , Transformer > sr = new HashMap < String , Transformer > ( ) ; for ( Map . Entry < String , Transformer > e : suffixRules . entrySet ( ) ) { if ( e . getValue ( ) == copyFiles ) { sr . put ( e . getKey ( ) , e . getValue ( ) ) ; } } perform ( binDir , sr ) ;
public class MappeableBitmapContainer { /** * Find the index of the previous clear bit less than or equal to i . * @ param i starting index * @ return index of the previous clear bit */ public int prevClearBit ( final int i ) { } }
int x = i >> 6 ; // i / 64 with sign extension long w = ~ bitmap . get ( x ) ; w <<= 64 - i - 1 ; if ( w != 0L ) { return i - Long . numberOfLeadingZeros ( w ) ; } for ( -- x ; x >= 0 ; -- x ) { long map = ~ bitmap . get ( x ) ; if ( map != 0L ) { return x * 64 + 63 - Long . numberOfLeadingZeros ( map ) ; } } return - ...
public class ConfigServlet { /** * from interface ConfigService */ public ConfigurationResult getConfiguration ( ) throws ServiceException { } }
requireAdminUser ( ) ; final ServletWaiter < ConfigurationResult > waiter = new ServletWaiter < ConfigurationResult > ( "getConfiguration" ) ; _omgr . postRunnable ( new Runnable ( ) { public void run ( ) { Map < String , ConfigurationRecord > tabs = Maps . newHashMap ( ) ; for ( String key : _confReg . getKeys ( ) ) {...
public class XmlRpcDataMarshaller { /** * Transforms the Collection of Specifications into a Vector of Specification parameters . * @ param specifications a { @ link java . util . Collection } object . * @ return the Collection of Specifications into a Vector of Specification parameters */ public static Vector < Ob...
Vector < Object > specificationsParams = new Vector < Object > ( ) ; for ( Specification specification : specifications ) { specificationsParams . add ( specification . marshallize ( ) ) ; } return specificationsParams ;
public class DocumentRootImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setBinomialDistribution ( BinomialDistributionType newBinomialDistribution ) { } }
( ( FeatureMap . Internal ) getMixed ( ) ) . set ( BpsimPackage . Literals . DOCUMENT_ROOT__BINOMIAL_DISTRIBUTION , newBinomialDistribution ) ;
public class PersistenceApi { /** * Initialize Managed Entity & # 39 ; s relationship by attribute name * Hydrate relationship associated to that entity . * @ param request Initilize Relationship Request ( required ) * @ return ApiResponse & lt ; List & lt ; Object & gt ; & gt ; * @ throws ApiException If fail ...
com . squareup . okhttp . Call call = initializePostValidateBeforeCall ( request , null , null ) ; Type localVarReturnType = new TypeToken < List < Object > > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class SemanticHeadFinder { /** * now overally complex so it deals with coordinations . Maybe change this class to use tregrex ? */ private boolean hasPassiveProgressiveAuxiliary ( Tree [ ] kids , HashSet < String > verbalSet ) { } }
if ( DEBUG ) { System . err . println ( "Checking for passive/progressive auxiliary" ) ; } boolean foundPassiveVP = false ; boolean foundPassiveAux = false ; for ( Tree kid : kids ) { if ( DEBUG ) { System . err . println ( " checking in " + kid ) ; } if ( kid . isPreTerminal ( ) ) { Label kidLabel = kid . label ( ) ;...
public class BatchItemRequestSerializer { /** * Method to get the Json string for CDCQuery object * @ param cdcQuery * the CDCQuery entity describing need for query * @ return the json string * @ throws SerializationException * throws SerializationException */ private String getCDCQueryJson ( CDCQuery cdcQuer...
ObjectMapper mapper = getObjectMapper ( ) ; String json = null ; try { json = mapper . writeValueAsString ( cdcQuery ) ; } catch ( Exception e ) { throw new SerializationException ( e ) ; } return json ;
public class JSONValue { /** * Parse input json as a mapTo class * mapTo can be a bean * @ since 2.0 */ public static < T > T parse ( byte [ ] in , Class < T > mapTo ) { } }
try { JSONParser p = new JSONParser ( DEFAULT_PERMISSIVE_MODE ) ; return p . parse ( in , defaultReader . getMapper ( mapTo ) ) ; } catch ( Exception e ) { return null ; }
public class GaussianMixture { /** * Split the most heterogeneous cluster along its main direction ( eigenvector ) . */ private void split ( List < Component > mixture ) { } }
// Find most dispersive cluster ( biggest sigma ) Component componentToSplit = null ; double maxSigma = 0.0 ; for ( Component c : mixture ) { if ( c . distribution . sd ( ) > maxSigma ) { maxSigma = c . distribution . sd ( ) ; componentToSplit = c ; } } // Splits the component double delta = componentToSplit . distribu...
public class MacroErrorManager { /** * Generates Blocks to signify that the passed Macro Block has failed to execute . * @ param macroToReplace the block for the macro that failed to execute and that we ' ll replace with Block * showing to the user that macro has failed * @ param message the message to display to...
List < Block > errorBlocks = this . errorBlockGenerator . generateErrorBlocks ( message , throwable , macroToReplace . isInline ( ) ) ; macroToReplace . getParent ( ) . replaceChild ( wrapInMacroMarker ( macroToReplace , errorBlocks ) , macroToReplace ) ;
public class FontCodedGraphicCharacterSetGlobalIdentifierImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case AfplibPackage . FONT_CODED_GRAPHIC_CHARACTER_SET_GLOBAL_IDENTIFIER__GCSGID : return getGCSGID ( ) ; case AfplibPackage . FONT_CODED_GRAPHIC_CHARACTER_SET_GLOBAL_IDENTIFIER__CPGID : return getCPGID ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
public class Arith { /** * 注意 : 调用此方法的前提是 , 其中有一个对象的类型已经确定是 BigDecimal */ private BigDecimal [ ] toBigDecimals ( Number left , Number right ) { } }
BigDecimal [ ] ret = new BigDecimal [ 2 ] ; if ( left instanceof BigDecimal ) { ret [ 0 ] = ( BigDecimal ) left ; ret [ 1 ] = new BigDecimal ( right . toString ( ) ) ; } else { ret [ 0 ] = new BigDecimal ( left . toString ( ) ) ; ret [ 1 ] = ( BigDecimal ) right ; } return ret ;
public class SpyPath { /** * Returns a new path relative to the current one . * < p > Path only handles scheme : xxx . Subclasses of Path will specialize * the xxx . * @ param userPath relative or absolute path , essentially any url . * @ param newAttributes attributes for the new path . * @ return the new pa...
return new SpyPath ( super . lookup ( userPath , newAttributes ) ) ;
public class PutEventsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PutEventsRequest putEventsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( putEventsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( putEventsRequest . getApplicationId ( ) , APPLICATIONID_BINDING ) ; protocolMarshaller . marshall ( putEventsRequest . getEventsRequest ( ) , EVENTSREQUEST_BINDING ) ; ...
public class DataStream { /** * Windows this data stream to a { @ code AllWindowedStream } , which evaluates windows * over a non key grouped stream . Elements are put into windows by a * { @ link org . apache . flink . streaming . api . windowing . assigners . WindowAssigner } . The grouping of * elements is don...
return new AllWindowedStream < > ( this , assigner ) ;
public class MariaDbDatabaseMetaData { /** * Retrieves a description of the given table ' s indices and statistics . They are ordered by * NON _ UNIQUE , TYPE , INDEX _ NAME , and ORDINAL _ POSITION . * < p > Each index column description has the following columns : < / p > * < ol > * < li > < B > TABLE _ CAT <...
String sql = "SELECT TABLE_SCHEMA TABLE_CAT, NULL TABLE_SCHEM, TABLE_NAME, NON_UNIQUE, " + " TABLE_SCHEMA INDEX_QUALIFIER, INDEX_NAME, 3 TYPE," + " SEQ_IN_INDEX ORDINAL_POSITION, COLUMN_NAME, COLLATION ASC_OR_DESC," + " CARDINALITY, NULL PAGES, NULL FILTER_CONDITION" + " FROM INFORMATION_SCHEMA.STATISTICS" + " WHERE TA...
public class ServiceLocatorImpl { /** * { @ inheritDoc } */ @ Override public SLEndpoint getEndpoint ( final QName serviceName , final String endpoint ) throws ServiceLocatorException , InterruptedException { } }
if ( LOG . isLoggable ( Level . FINE ) ) { LOG . fine ( "Get endpoint information for endpoint " + endpoint + " within service " + serviceName + "..." ) ; } RootNode rootNode = getBackend ( ) . connect ( ) ; ServiceNode serviceNode = rootNode . getServiceNode ( serviceName ) ; EndpointNode endpointNode = serviceNode . ...
public class DataStream { /** * It creates a new { @ link KeyedStream } that uses the provided key with explicit type information * for partitioning its operator states . * @ param key The KeySelector to be used for extracting the key for partitioning . * @ param keyType The type information describing the key ty...
Preconditions . checkNotNull ( key ) ; Preconditions . checkNotNull ( keyType ) ; return new KeyedStream < > ( this , clean ( key ) , keyType ) ;
public class BosClient { /** * Gets the object metadata for the object stored in Bos under the specified bucket and key , * and saves the object contents to the specified file . * Returns < code > null < / code > if the specified constraints weren ' t met . * @ param bucketName The name of the bucket containing t...
return this . getObject ( new GetObjectRequest ( bucketName , key ) , destinationFile ) ;
public class RESTDocBuilder { /** * Process the tag on the Controller . */ private void processControllerClass ( ClassDoc controller , Configuration configuration ) { } }
Tag [ ] controllerTagArray = controller . tags ( WRTagTaglet . NAME ) ; for ( int i = 0 ; i < controllerTagArray . length ; i ++ ) { Set < String > controllerTags = WRTagTaglet . getTagSet ( controllerTagArray [ i ] . text ( ) ) ; for ( Iterator < String > iter = controllerTags . iterator ( ) ; iter . hasNext ( ) ; ) {...
public class DacGpioProviderBase { /** * Set the current value in a percentage of the available range instead of a raw value . * @ param pin * @ param percent percentage value between 0 and 100. */ public void setPercentValue ( Pin pin , Number percent ) { } }
// validate range if ( percent . doubleValue ( ) <= 0 ) { setValue ( pin , getMinSupportedValue ( ) ) ; } else if ( percent . doubleValue ( ) >= 100 ) { setValue ( pin , getMaxSupportedValue ( ) ) ; } else { double value = ( getMaxSupportedValue ( ) - getMinSupportedValue ( ) ) * ( percent . doubleValue ( ) / 100f ) ; ...
public class DeviceImpl { /** * Write attribute ( s ) . * Invoked when the client request the write _ attributes CORBA operation . * This method writes new attribute value . * @ param values * The attribute ( s ) new set value . There is one AttributeValue * object for each attribute to be set * @ exception...
Util . out4 . println ( "DeviceImpl.write_attributes arrived" ) ; // Record operation request in black box blackbox . insert_op ( Op_Write_Attr ) ; // Return exception if the device does not have any attribute final int nb_dev_attr = dev_attr . get_attr_nb ( ) ; if ( nb_dev_attr == 0 ) { Except . throw_exception ( "API...
public class dnsnsrec { /** * Use this API to fetch dnsnsrec resource of given name . */ public static dnsnsrec get ( nitro_service service , String domain ) throws Exception { } }
dnsnsrec obj = new dnsnsrec ( ) ; obj . set_domain ( domain ) ; dnsnsrec response = ( dnsnsrec ) obj . get_resource ( service ) ; return response ;
public class BundleUtils { /** * Checks if the bundle contains a specified key or not . * If bundle is null , this method will return false ; * @ param bundle a bundle . * @ param key a key . * @ return true if bundle is not null and the key exists in the bundle , false otherwise . * @ see android . os . Bund...
return bundle != null && bundle . containsKey ( key ) ;
public class MetadataService { /** * Generates the path of { @ link JsonPointer } of permission of the specified { @ code memberId } in the * specified { @ code repoName } . */ private static JsonPointer perUserPermissionPointer ( String repoName , String memberId ) { } }
return JsonPointer . compile ( "/repos" + encodeSegment ( repoName ) + "/perUserPermissions" + encodeSegment ( memberId ) ) ;
public class JavacTaskImpl { /** * wrap it here */ public Iterable < ? extends Element > analyze ( Iterable < ? extends Element > classes ) { } }
enter ( null ) ; // ensure all classes have been entered final ListBuffer < Element > results = new ListBuffer < > ( ) ; try { if ( classes == null ) { handleFlowResults ( compiler . flow ( compiler . attribute ( compiler . todo ) ) , results ) ; } else { Filter f = new Filter ( ) { @ Override public void process ( Env...
public class UserManager { /** * Change the modifiable data of a user * @ param sUserID * The ID of the user to be modified . May be < code > null < / code > . * @ param sNewLoginName * The new login name . May not be < code > null < / code > . * @ param sNewEmailAddress * The new email address . May be < c...
// Resolve user final User aUser = getOfID ( sUserID ) ; if ( aUser == null ) { AuditHelper . onAuditModifyFailure ( User . OT , sUserID , "no-such-user-id" ) ; return EChange . UNCHANGED ; } m_aRWLock . writeLock ( ) . lock ( ) ; try { EChange eChange = aUser . setLoginName ( sNewLoginName ) ; eChange = eChange . or (...
public class MemoryStatusHealthCheck { /** * 可用内存阈值 = 5M */ @ Override protected Result check ( ) throws Exception { } }
Runtime runtime = Runtime . getRuntime ( ) ; long freeMemory = runtime . freeMemory ( ) ; long totalMemory = runtime . totalMemory ( ) ; long maxMemory = runtime . maxMemory ( ) ; boolean ok = maxMemory - ( totalMemory - freeMemory ) > avalibleMemthreshold ; // 剩余空间小于2M报警 if ( ok ) { return Result . healthy ( ) ; } els...
public class CmsRemoteShellServer { /** * Initializes the RMI registry and exports the remote shell provider to it . < p > */ public void initServer ( ) { } }
if ( m_initialized ) { return ; } try { m_registry = LocateRegistry . createRegistry ( m_port ) ; m_provider = new CmsRemoteShellProvider ( m_port ) ; I_CmsRemoteShellProvider providerStub = ( I_CmsRemoteShellProvider ) ( UnicastRemoteObject . exportObject ( m_provider , m_port ) ) ; m_registry . bind ( CmsRemoteShellC...
public class GitLabApi { /** * Enable the logging of the requests to and the responses from the GitLab server API using the * specified logger . Logging will mask PRIVATE - TOKEN and Authorization headers . * @ param logger the Logger instance to log to * @ param level the logging level ( SEVERE , WARNING , INFO ...
enableRequestResponseLogging ( logger , level , maxEntitySize , MaskingLoggingFilter . DEFAULT_MASKED_HEADER_NAMES ) ;
public class ArmeriaHttpUtil { /** * Converts the specified Netty HTTP / 1 headers into Armeria HTTP / 2 headers . */ public static HttpHeaders toArmeria ( io . netty . handler . codec . http . HttpHeaders inHeaders ) { } }
if ( inHeaders . isEmpty ( ) ) { return HttpHeaders . EMPTY_HEADERS ; } final HttpHeaders out = new DefaultHttpHeaders ( true , inHeaders . size ( ) ) ; toArmeria ( inHeaders , out ) ; return out ;
public class SVG { /** * Read and parse an SVG from the given resource location . * @ param resources the set of Resources in which to locate the file . * @ param resourceId the resource identifier of the SVG document . * @ return an SVG instance on which you can call one of the render methods . * @ throws SVGP...
SVGParser parser = new SVGParser ( ) ; InputStream is = resources . openRawResource ( resourceId ) ; try { return parser . parse ( is , enableInternalEntities ) ; } finally { try { is . close ( ) ; } catch ( IOException e ) { // Do nothing } }
public class Controller { /** * Calls startActivityForResult ( Intent , int , Bundle ) from this Controller ' s host Activity . */ public final void startActivityForResult ( @ NonNull final Intent intent , final int requestCode , @ Nullable final Bundle options ) { } }
executeWithRouter ( new RouterRequiringFunc ( ) { @ Override public void execute ( ) { router . startActivityForResult ( instanceId , intent , requestCode , options ) ; } } ) ;
public class UtilJdbc { /** * Returns a JDBC row data structure from a Stratio Deep Entity . * @ param entity Stratio Deep entity . * @ param < T > Stratio Deep entity type . * @ return JDBC row data structure from a Stratio Deep Entity . * @ throws IllegalAccessException * @ throws InstantiationException *...
Field [ ] fields = AnnotationUtils . filterDeepFields ( entity . getClass ( ) ) ; Map < String , Object > row = new HashMap < > ( ) ; for ( Field field : fields ) { Method method = Utils . findGetter ( field . getName ( ) , entity . getClass ( ) ) ; Object object = method . invoke ( entity ) ; if ( object != null ) { r...
public class OObjectDatabaseTx { /** * Create a new POJO by its class name . Assure to have called the registerEntityClasses ( ) declaring the packages that are part of * entity classes . * @ see OEntityManager . registerEntityClasses ( String ) */ public < RET extends Object > RET newInstance ( final String iClass...
checkSecurity ( ODatabaseSecurityResources . CLASS , ORole . PERMISSION_CREATE , iClassName ) ; try { RET enhanced = ( RET ) OObjectEntityEnhancer . getInstance ( ) . getProxiedInstance ( entityManager . getEntityClass ( iClassName ) , iEnclosingClass , underlying . newInstance ( iClassName ) , iArgs ) ; return ( RET )...
public class DataSetBuilder { /** * Set random filler using < code > int < / code > values . * The specified column will be filled with values that * are uniformly sampled from the interval < code > [ min , max ] < / code > . * @ param column Column name . * @ param min Minimum value . * @ param max Maximum v...
ensureValidRange ( min , max ) ; int n = max - min + 1 ; return set ( column , ( ) -> min + rng . nextInt ( n ) ) ;
public class BitIntegrityErrorTask { /** * / * ( non - Javadoc ) * @ see org . duracloud . common . queue . task . TypedTask # readTask ( org . duracloud . common . queue . task . Task ) */ @ Override public void readTask ( Task task ) { } }
super . readTask ( task ) ; this . description = task . getProperty ( DESCRIPTION_KEY ) ; this . contentChecksum = task . getProperty ( CONTENT_CHECKSUM_KEY ) ; this . storeChecksum = task . getProperty ( STORE_CHECKSUM_KEY ) ; this . storeType = StorageProviderType . valueOf ( task . getProperty ( STORE_TYPE_KEY ) ) ;...
public class NodeManager { /** * Update metrics for alive / dead nodes . */ private void setAliveDeadMetrics ( ) { } }
clusterManager . getMetrics ( ) . setAliveNodes ( nameToNode . size ( ) ) ; int totalHosts = hostsReader . getHosts ( ) . size ( ) ; if ( totalHosts > 0 ) { clusterManager . getMetrics ( ) . setDeadNodes ( totalHosts - nameToNode . size ( ) ) ; }
public class ViewHandler { /** * / / / / / Execute SQL command on the DDF / / / / / */ private DDF sql2ddf ( String sqlCommand , String errorMessage ) throws DDFException { } }
try { return this . getManager ( ) . sql2ddf ( String . format ( sqlCommand , "{1}" ) , new SQLDataSourceDescriptor ( sqlCommand , null , null , null , this . getDDF ( ) . getUUID ( ) . toString ( ) ) ) ; } catch ( Exception e ) { throw new DDFException ( String . format ( errorMessage , this . getDDF ( ) . getTableNam...
public class VisOdomDirectColorDepth { /** * Initialize motion related data structures */ void initMotion ( Planar < I > input ) { } }
if ( solver == null ) { solver = LinearSolverFactory_DDRM . qr ( input . width * input . height * input . getNumBands ( ) , 6 ) ; } // compute image derivative and setup interpolation functions computeD . process ( input , derivX , derivY ) ;
public class SystemKeyspace { /** * Return a map of store host _ ids to IP addresses */ public static Map < InetAddress , UUID > loadHostIds ( ) { } }
Map < InetAddress , UUID > hostIdMap = new HashMap < InetAddress , UUID > ( ) ; for ( UntypedResultSet . Row row : executeInternal ( "SELECT peer, host_id FROM system." + PEERS_CF ) ) { InetAddress peer = row . getInetAddress ( "peer" ) ; if ( row . has ( "host_id" ) ) { hostIdMap . put ( peer , row . getUUID ( "host_i...
public class JpegSegmentData { /** * Removes a specified instance of a segment ' s data from the collection . Use this method when more than one * occurrence of segment data exists for a given type exists . * @ param segmentType identifies the required segment * @ param occurrence the zero - based index of the se...
"MismatchedQueryAndUpdateOfCollection" } ) public void removeSegmentOccurrence ( @ NotNull JpegSegmentType segmentType , int occurrence ) { removeSegmentOccurrence ( segmentType . byteValue , occurrence ) ;
public class UTF8String { /** * Find the ` str ` from left to right . */ private int find ( UTF8String str , int start ) { } }
assert ( str . numBytes > 0 ) ; while ( start <= numBytes - str . numBytes ) { if ( ByteArrayMethods . arrayEquals ( base , offset + start , str . base , str . offset , str . numBytes ) ) { return start ; } start += 1 ; } return - 1 ;
public class ConverterTimeFormats { /** * Returns an ordered functional blend of all input parsers . The attempter will try all functions until it succeeds . * If none succeed will re - throw the first exception * @ param parsers ordered sequence of parsers to try to convert a CharSequence into a TemporalAccessor ...
return date -> { RuntimeException first = null ; for ( Function < CharSequence , TemporalAccessor > parser : parsers ) { try { return parser . apply ( date ) ; } catch ( RuntimeException ex ) { if ( first == null ) first = ex ; } } if ( first == null ) throw new IllegalStateException ( "Empty parse attempter" ) ; throw...
public class Config { /** * Looks up a configuration variable in the " request " scope . * < p > The lookup of configuration variables is performed as if each scope * had its own name space , that is , the same configuration variable name * in one scope does not replace one stored in a different scope . * @ par...
return request . getAttribute ( name + REQUEST_SCOPE_SUFFIX ) ;
public class MathUtils { /** * Generates a binomial distributed number using * the given rng * @ param rng * @ param n * @ param p * @ return */ public static int binomial ( RandomGenerator rng , int n , double p ) { } }
if ( ( p < 0 ) || ( p > 1 ) ) { return 0 ; } int c = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( rng . nextDouble ( ) < p ) { c ++ ; } } return c ;
public class CmsModuleAddResourceTypes { /** * Returns the next available resource type id . < p > * @ return the resource type id */ private int findNextTypeId ( ) { } }
int result = ( int ) ( 20000 + Math . round ( Math . random ( ) * 1000 ) ) ; for ( I_CmsResourceType type : OpenCms . getResourceManager ( ) . getResourceTypes ( ) ) { if ( type . getTypeId ( ) >= result ) { result = type . getTypeId ( ) + 1 ; } } return result ;
public class WaitHelper { /** * Wait until one of the expected values was returned or the number of wait cycles has been exceeded . Throws * { @ link IllegalStateException } if the timeout is reached . * @ param function * Function to read the value from . * @ param expectedValues * List of values that are ac...
final List < T > actualResults = new ArrayList < > ( ) ; int tries = 0 ; while ( tries < maxTries ) { final T result = function . call ( ) ; if ( expectedValues . contains ( result ) ) { return result ; } actualResults . add ( result ) ; tries ++ ; Utils4J . sleep ( sleepMillis ) ; } throw new IllegalStateException ( "...
public class IssueCategoryRegistry { /** * Loads the related graph vertex for the given { @ link IssueCategory } . */ public static IssueCategoryModel loadFromGraph ( GraphContext graphContext , IssueCategory issueCategory ) { } }
return loadFromGraph ( graphContext . getFramed ( ) , issueCategory . getCategoryID ( ) ) ;
public class AsyncDiskService { /** * Shut down all ThreadPools immediately . */ public synchronized List < Runnable > shutdownNow ( ) { } }
LOG . info ( "Shutting down all AsyncDiskService threads immediately..." ) ; List < Runnable > list = new ArrayList < Runnable > ( ) ; for ( Map . Entry < String , ThreadPoolExecutor > e : executors . entrySet ( ) ) { list . addAll ( e . getValue ( ) . shutdownNow ( ) ) ; } return list ;
public class FrameworkBootstrap { /** * / * private void initRouter ( Router router , Injector localInjector ) { * router . compileRoutes ( localInjector . getInstance ( ActionInvoker . class ) ) ; * RouterImpl router = ( RouterImpl ) localInjector . getInstance ( Router . class ) ; * ActionInvoker invoker = loca...
try { ClassLocator locator = new ClassLocator ( pluginsPackage ) ; return locateAll ( locator , ModuleBootstrap . class , impl -> impl . bootstrap ( config ) ) ; } catch ( IllegalArgumentException e ) { logger . warn ( "Did not find any " + ModuleBootstrap . class . getSimpleName ( ) + " implementations" , e ) ; return...
public class Controller { /** * Read a configuration from the database whose name matches the the given * configuration name */ public MigrationConfiguration getMigrationConfiguration ( String configurationName ) throws IOException , LightblueException { } }
DataFindRequest findRequest = new DataFindRequest ( "migrationConfiguration" , null ) ; findRequest . where ( Query . and ( Query . withValue ( "configurationName" , Query . eq , configurationName ) , Query . withValue ( "consistencyCheckerName" , Query . eq , cfg . getName ( ) ) ) ) ; findRequest . select ( Projection...
public class OEmbedRequest { /** * / * package */ HttpParameter [ ] asHttpParameterArray ( ) { } }
ArrayList < HttpParameter > params = new ArrayList < HttpParameter > ( 12 ) ; appendParameter ( "id" , statusId , params ) ; appendParameter ( "url" , url , params ) ; appendParameter ( "maxwidth" , maxWidth , params ) ; params . add ( new HttpParameter ( "hide_media" , hideMedia ) ) ; params . add ( new HttpParameter ...
public class ExpressionDecomposer { /** * Create an expression tree for an expression . * < p > If the result of the expression is needed , then : * < pre > * ASSIGN * tempName * expr * < / pre > * otherwise , simply : ` expr ` */ private static Node buildResultExpression ( Node expr , boolean needResult ...
if ( needResult ) { JSType type = expr . getJSType ( ) ; return withType ( IR . assign ( withType ( IR . name ( tempName ) , type ) , expr ) , type ) . srcrefTree ( expr ) ; } else { return expr ; }
public class PropertySet { /** * Removes a property from this set . */ public PropertySet remove ( String property ) { } }
String candidate = StringUtils . trimToNull ( property ) ; if ( candidate != null ) { properties_ . remove ( candidate , 1 ) ; } return this ;
public class CPSpecificationOptionPersistenceImpl { /** * Returns a range of all the cp specification options . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the resul...
return findAll ( start , end , null ) ;
public class User { /** * Authenticates the user , using its authentication credentials and the authentication method * corresponding to its Context . * @ see SessionManagementMethod * @ see AuthenticationMethod * @ see Context */ public void authenticate ( ) { } }
log . info ( "Authenticating user: " + this . name ) ; WebSession result = null ; try { result = getContext ( ) . getAuthenticationMethod ( ) . authenticate ( getContext ( ) . getSessionManagementMethod ( ) , this . authenticationCredentials , this ) ; } catch ( UnsupportedAuthenticationCredentialsException e ) { log ....
public class ServerDnsAliasesInner { /** * Gets a list of server DNS aliases for a server . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server that the alias...
return listByServerWithServiceResponseAsync ( resourceGroupName , serverName ) . map ( new Func1 < ServiceResponse < Page < ServerDnsAliasInner > > , Page < ServerDnsAliasInner > > ( ) { @ Override public Page < ServerDnsAliasInner > call ( ServiceResponse < Page < ServerDnsAliasInner > > response ) { return response ....