signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class PodHeartbeatImpl { /** * Compare and merge the cluster _ root with an update .
* cluster _ root is a special case because the root cluster decides on
* the owning server for the entire cluster . */
private void updateClusterRoot ( ) { } }
|
ArrayList < ServerHeartbeat > serverList = new ArrayList < > ( ) ; for ( ServerHeartbeat server : _serverSelf . getCluster ( ) . getServers ( ) ) { serverList . add ( server ) ; } Collections . sort ( serverList , ( x , y ) -> compareClusterRoot ( x , y ) ) ; UpdatePodBuilder builder = new UpdatePodBuilder ( ) ; builder . name ( "cluster_root" ) ; builder . cluster ( _serverSelf . getCluster ( ) ) ; builder . type ( PodType . solo ) ; builder . depth ( 16 ) ; for ( ServerHeartbeat server : serverList ) { builder . server ( server . getAddress ( ) , server . port ( ) ) ; } long sequence = CurrentTime . currentTime ( ) ; sequence = Math . max ( sequence , _clusterRoot . getSequence ( ) + 1 ) ; builder . sequence ( sequence ) ; UpdatePod update = builder . build ( ) ; updatePodProxy ( update ) ;
|
public class IntegrationResponse { /** * A key - value map specifying response parameters that are passed to the method response from the backend . The key
* is a method response header parameter name and the mapped value is an integration response header value , a static
* value enclosed within a pair of single quotes , or a JSON expression from the integration response body . The
* mapping key must match the pattern of method . response . header . { name } , where name is a valid and unique header
* name . The mapped non - static value must match the pattern of integration . response . header . { name } or
* integration . response . body . { JSON - expression } , where name is a valid and unique response header name and
* JSON - expression is a valid JSON expression without the $ prefix .
* @ param responseParameters
* A key - value map specifying response parameters that are passed to the method response from the backend .
* The key is a method response header parameter name and the mapped value is an integration response header
* value , a static value enclosed within a pair of single quotes , or a JSON expression from the integration
* response body . The mapping key must match the pattern of method . response . header . { name } , where name is a
* valid and unique header name . The mapped non - static value must match the pattern of
* integration . response . header . { name } or integration . response . body . { JSON - expression } , where name is a valid
* and unique response header name and JSON - expression is a valid JSON expression without the $ prefix .
* @ return Returns a reference to this object so that method calls can be chained together . */
public IntegrationResponse withResponseParameters ( java . util . Map < String , String > responseParameters ) { } }
|
setResponseParameters ( responseParameters ) ; return this ;
|
public class SetBugDatabaseInfoTask { /** * ( non - Javadoc )
* @ see
* edu . umd . cs . findbugs . anttask . AbstractFindBugsTask # configureFindbugsEngine */
@ Override protected void configureFindbugsEngine ( ) { } }
|
addOption ( "-name" , name ) ; addOption ( "-timestamp" , timestamp ) ; addOption ( "-source" , source ) ; addOption ( "-findSource" , findSource ) ; addOption ( "-suppress" , suppress ) ; addBoolOption ( "-withMessages" , withMessages ) ; if ( resetSource != null && "true" . equals ( resetSource ) ) { addArg ( "-resetSource" ) ; } addArg ( inputFile ) ; if ( outputFile != null ) { addArg ( outputFile ) ; }
|
public class ClasspathHelper { /** * a little bit cryptic . . . */
static URL tryToGetValidUrl ( String workingDir , String path , String filename ) { } }
|
try { if ( new File ( filename ) . exists ( ) ) return new File ( filename ) . toURI ( ) . toURL ( ) ; if ( new File ( path + File . separator + filename ) . exists ( ) ) return new File ( path + File . separator + filename ) . toURI ( ) . toURL ( ) ; if ( new File ( workingDir + File . separator + filename ) . exists ( ) ) return new File ( workingDir + File . separator + filename ) . toURI ( ) . toURL ( ) ; if ( new File ( new URL ( filename ) . getFile ( ) ) . exists ( ) ) return new File ( new URL ( filename ) . getFile ( ) ) . toURI ( ) . toURL ( ) ; } catch ( MalformedURLException e ) { // don ' t do anything , we ' re going on the assumption it is a jar , which could be wrong
} return null ;
|
public class Track { /** * Return { @ code true } if all track properties are { @ code null } or empty .
* @ return { @ code true } if all track properties are { @ code null } or empty */
public boolean isEmpty ( ) { } }
|
return _name == null && _comment == null && _description == null && _source == null && _links . isEmpty ( ) && _number == null && ( _segments . isEmpty ( ) || _segments . stream ( ) . allMatch ( TrackSegment :: isEmpty ) ) ;
|
public class AccessGridScreen { /** * SetupSFields Method . */
public void setupSFields ( ) { } }
|
Record record = this . getMainRecord ( ) ; BaseField field = record . getField ( DBConstants . MAIN_FIELD ) ; if ( field == record . getCounterField ( ) ) this . addColumn ( field ) ; super . setupSFields ( ) ;
|
public class JndiDestinationResolver { /** * / * ( non - Javadoc )
* @ see net . timewalker . ffmq4 . cluster . resolver . DestinationResolver # getDestination ( net . timewalker . ffmq4 . management . peer . PeerDescriptor , net . timewalker . ffmq4 . management . destination . DestinationReferenceDescriptor , javax . jms . Session ) */
@ Override public Destination getDestination ( PeerDescriptor peer , DestinationReferenceDescriptor destinationReference , Session session ) throws JMSException { } }
|
try { Context jndiContext = JNDITools . getContext ( peer . getJdniInitialContextFactoryName ( ) , peer . getProviderURL ( ) , null ) ; return ( Destination ) jndiContext . lookup ( destinationReference . getDestinationName ( ) ) ; } catch ( NamingException e ) { throw new JMSException ( "Cannot resolve destination in JNDI : " + e . toString ( ) ) ; }
|
public class OptionUtil { /** * 读取模板并写入数据
* @ param option
* @ return */
private static List < String > readLines ( Option option ) { } }
|
String optionStr = GsonUtil . format ( option ) ; InputStream is = null ; InputStreamReader iReader = null ; BufferedReader bufferedReader = null ; List < String > lines = new ArrayList < String > ( ) ; String line ; try { is = OptionUtil . class . getResourceAsStream ( "/template" ) ; iReader = new InputStreamReader ( is , "UTF-8" ) ; bufferedReader = new BufferedReader ( iReader ) ; while ( ( line = bufferedReader . readLine ( ) ) != null ) { if ( line . contains ( "##option##" ) ) { line = line . replace ( "##option##" , optionStr ) ; } lines . add ( line ) ; } } catch ( Exception e ) { } finally { if ( is != null ) { try { is . close ( ) ; } catch ( IOException e ) { // ignore
} } } return lines ;
|
public class Descriptives { /** * Calculates Standard Error of Skweness . Uses a formula as suggested by
* http : / / en . wikipedia . org / wiki / Skewness
* @ param flatDataCollection
* @ return */
public static double skewnessSE ( FlatDataCollection flatDataCollection ) { } }
|
int n = count ( flatDataCollection ) ; if ( n <= 2 ) { throw new IllegalArgumentException ( "The provided collection must have more than 2 elements." ) ; } double skewnessSE = Math . sqrt ( ( 6.0 * n * ( n - 1.0 ) ) / ( ( n - 2.0 ) * ( n + 1.0 ) * ( n + 3.0 ) ) ) ; return skewnessSE ;
|
public class Utils { /** * Given a package , return its file name without the extension .
* @ param packageDoc the package to check .
* @ return the file name of the given package . */
public String getPackageFileHeadName ( PackageDoc packageDoc ) { } }
|
return packageDoc == null || packageDoc . name ( ) . length ( ) == 0 ? DocletConstants . DEFAULT_PACKAGE_FILE_NAME : packageDoc . name ( ) ;
|
public class Settings { /** * Gets a String value for the setting , returning the default value if not
* specified .
* @ param settings
* @ param key the key to get the String setting for
* @ param defaultVal the default value to return if the setting was not specified
* @ return the String value for the setting */
public static String getStringSetting ( Map < String , Object > settings , String key , String defaultVal ) { } }
|
final Object value = settings . get ( key ) ; return value != null ? value . toString ( ) : defaultVal ;
|
public class IfcPortImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcRelConnectsPorts > getConnectedFrom ( ) { } }
|
return ( EList < IfcRelConnectsPorts > ) eGet ( Ifc4Package . Literals . IFC_PORT__CONNECTED_FROM , true ) ;
|
public class SARLQuickfixProvider { /** * Quick fix for " Duplicate type " .
* @ param issue the issue .
* @ param acceptor the quick fix acceptor . */
@ Fix ( IssueCodes . DUPLICATE_TYPE_NAME ) public void fixDuplicateTopElements ( Issue issue , IssueResolutionAcceptor acceptor ) { } }
|
MemberRemoveModification . accept ( this , issue , acceptor ) ;
|
public class ElementPlugin { /** * Registers a listener for the IPluginEventListener callback event . If the listener has already
* been registered , the request is ignored .
* @ param listener Listener to be registered . */
public void registerListener ( IPluginEventListener listener ) { } }
|
if ( pluginEventListeners2 == null ) { pluginEventListeners2 = new ArrayList < > ( ) ; } if ( ! pluginEventListeners2 . contains ( listener ) ) { pluginEventListeners2 . add ( listener ) ; listener . onPluginEvent ( new PluginEvent ( this , PluginAction . SUBSCRIBE ) ) ; }
|
public class IOHelper { /** * This function returns the encoding to use .
* If provided encoding is null , the default system encoding is returend .
* @ param encoding
* The encoding ( may be null for system default encoding )
* @ return The encoding to use */
private static String getEncodingToUse ( String encoding ) { } }
|
// get encoding
String updatedEncoding = encoding ; if ( updatedEncoding == null ) { updatedEncoding = IOHelper . getDefaultEncoding ( ) ; } return updatedEncoding ;
|
public class JavacTaskImpl { /** * Generate code corresponding to the given classes .
* The classes must have previously been returned from { @ link # enter } .
* If there are classes outstanding to be analyzed , that will be done before
* any classes are generated .
* If null is specified , code will be generated for all outstanding classes .
* @ param classes a list of class elements */
public Iterable < ? extends JavaFileObject > generate ( Iterable < ? extends TypeElement > classes ) throws IOException { } }
|
final ListBuffer < JavaFileObject > results = new ListBuffer < JavaFileObject > ( ) ; try { analyze ( null ) ; // ensure all classes have been parsed , entered , and analyzed
if ( classes == null ) { compiler . generate ( compiler . desugar ( genList ) , results ) ; genList . clear ( ) ; } else { Filter f = new Filter ( ) { public void process ( Env < AttrContext > env ) { compiler . generate ( compiler . desugar ( ListBuffer . of ( env ) ) , results ) ; } } ; f . run ( genList , classes ) ; } if ( genList . isEmpty ( ) ) { compiler . reportDeferredDiagnostics ( ) ; cleanup ( ) ; } } finally { if ( compiler != null ) compiler . log . flush ( ) ; } return results ;
|
public class BufferPool { /** * Returns a buffer that has the size of the Bitmessage network message header , 24 bytes .
* @ return a buffer of size 24 */
public synchronized ByteBuffer allocateHeaderBuffer ( ) { } }
|
Stack < ByteBuffer > pool = pools . get ( HEADER_SIZE ) ; if ( pool . isEmpty ( ) ) { return ByteBuffer . allocate ( HEADER_SIZE ) ; } else { return pool . pop ( ) ; }
|
public class VortexWorker { /** * Executes an tasklet request from the { @ link org . apache . reef . vortex . driver . VortexDriver } . */
private void executeTasklet ( final ExecutorService commandExecutor , final ConcurrentMap < Integer , Future > futures , final MasterToWorkerRequest masterToWorkerRequest ) { } }
|
final CountDownLatch latch = new CountDownLatch ( 1 ) ; final TaskletExecutionRequest taskletExecutionRequest = ( TaskletExecutionRequest ) masterToWorkerRequest ; // Scheduler Thread : Pass the command to the worker thread pool to be executed
// Record future to support cancellation .
futures . put ( taskletExecutionRequest . getTaskletId ( ) , commandExecutor . submit ( new Runnable ( ) { @ Override public void run ( ) { final WorkerToMasterReports reports ; final List < WorkerToMasterReport > holder = new ArrayList < > ( ) ; try { // Command Executor : Execute the command
final WorkerToMasterReport workerToMasterReport = new TaskletResultReport ( taskletExecutionRequest . getTaskletId ( ) , taskletExecutionRequest . execute ( ) ) ; holder . add ( workerToMasterReport ) ; } catch ( final InterruptedException ex ) { // Assumes that user ' s thread follows convention that cancelled Futures
// should throw InterruptedException .
final WorkerToMasterReport workerToMasterReport = new TaskletCancelledReport ( taskletExecutionRequest . getTaskletId ( ) ) ; LOG . log ( Level . WARNING , "Tasklet with ID {0} has been cancelled" , taskletExecutionRequest . getTaskletId ( ) ) ; holder . add ( workerToMasterReport ) ; } catch ( Exception e ) { // Command Executor : Tasklet throws an exception
final WorkerToMasterReport workerToMasterReport = new TaskletFailureReport ( taskletExecutionRequest . getTaskletId ( ) , e ) ; holder . add ( workerToMasterReport ) ; } reports = new WorkerToMasterReports ( holder ) ; workerReports . addLast ( kryoUtils . serialize ( reports ) ) ; try { latch . await ( ) ; } catch ( final InterruptedException e ) { LOG . log ( Level . SEVERE , "Cannot wait for Future to be put." ) ; throw new RuntimeException ( e ) ; } futures . remove ( taskletExecutionRequest . getTaskletId ( ) ) ; heartBeatTriggerManager . triggerHeartBeat ( ) ; } } ) ) ; // Signal that future is put .
latch . countDown ( ) ;
|
public class Configs { /** * Creates a component configuration from json .
* @ param config A json component configuration .
* @ return A component configuration . */
@ SuppressWarnings ( "unchecked" ) public static < T extends ComponentConfig < T > > T createComponent ( JsonObject config ) { } }
|
return ( T ) serializer . deserializeObject ( config , ComponentConfig . class ) ;
|
public class AlbumUtils { /** * Generate a random mp4 file path .
* @ return file path .
* @ deprecated use { @ link # randomMP4Path ( Context ) } instead . */
@ NonNull @ Deprecated public static String randomMP4Path ( ) { } }
|
File bucket = Environment . getExternalStoragePublicDirectory ( Environment . DIRECTORY_MOVIES ) ; return randomMP4Path ( bucket ) ;
|
public class AppServiceEnvironmentsInner { /** * Get all multi - role pools .
* Get all multi - role pools .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the PagedList & lt ; WorkerPoolResourceInner & gt ; object if successful . */
public PagedList < WorkerPoolResourceInner > listMultiRolePoolsNext ( final String nextPageLink ) { } }
|
ServiceResponse < Page < WorkerPoolResourceInner > > response = listMultiRolePoolsNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) ; return new PagedList < WorkerPoolResourceInner > ( response . body ( ) ) { @ Override public Page < WorkerPoolResourceInner > nextPage ( String nextPageLink ) { return listMultiRolePoolsNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) . body ( ) ; } } ;
|
public class ModelUtil { /** * Get a collection of all model element instances in a view
* @ param view the collection of DOM elements to find the model element instances for
* @ param model the model of the elements
* @ return the collection of model element instances of the view */
@ SuppressWarnings ( "unchecked" ) public static < T extends ModelElementInstance > Collection < T > getModelElementCollection ( Collection < DomElement > view , ModelInstanceImpl model ) { } }
|
List < ModelElementInstance > resultList = new ArrayList < ModelElementInstance > ( ) ; for ( DomElement element : view ) { resultList . add ( getModelElement ( element , model ) ) ; } return ( Collection < T > ) resultList ;
|
public class ImportHelpers { /** * Updates the imports of an instance with new values .
* @ param instance the instance whose imports must be updated
* @ param variablePrefixToImports the new imports ( can be null ) */
public static void updateImports ( Instance instance , Map < String , Collection < Import > > variablePrefixToImports ) { } }
|
instance . getImports ( ) . clear ( ) ; if ( variablePrefixToImports != null ) instance . getImports ( ) . putAll ( variablePrefixToImports ) ;
|
public class BreakIterator { /** * < strong > [ icu ] < / strong > Registers a new break iterator of the indicated kind , to use in the given
* locale . Clones of the iterator will be returned if a request for a break iterator
* of the given kind matches or falls back to this locale .
* < p > Because ICU may choose to cache BreakIterator objects internally , this must
* be called at application startup , prior to any calls to
* BreakIterator . getInstance to avoid undefined behavior .
* @ param iter the BreakIterator instance to adopt .
* @ param locale the Locale for which this instance is to be registered
* @ param kind the type of iterator for which this instance is to be registered
* @ return a registry key that can be used to unregister this instance
* @ hide unsupported on Android */
public static Object registerInstance ( BreakIterator iter , Locale locale , int kind ) { } }
|
return registerInstance ( iter , ULocale . forLocale ( locale ) , kind ) ;
|
public class BitbayAccountServiceRaw { /** * Corresponds to < code > POST / withdraw < / code > end point .
* @ param currency cryptocurrency to transfer
* @ param quantity amount of cryptocurrency , which will be transferred
* @ param account account number on which money would be transferred
* @ param express true / false
* @ param bicOrSwiftCode swift / bic number
* @ return Success of withdraw
* @ throws ExchangeException if an error occurred . */
public BitbayBaseResponse withdraw ( Currency currency , BigDecimal quantity , String account , boolean express , String bicOrSwiftCode ) { } }
|
BitbayBaseResponse resp = bitbayAuthenticated . withdraw ( apiKey , sign , exchange . getNonceFactory ( ) , currency . getCurrencyCode ( ) , quantity . toString ( ) , account , Boolean . toString ( express ) , bicOrSwiftCode ) ; if ( resp . getMessage ( ) != null ) throw new ExchangeException ( resp . getMessage ( ) ) ; return resp ;
|
public class NumberFormat { /** * format a number with given mask
* @ param number
* @ param mask
* @ return formatted number as string
* @ throws InvalidMaskException */
public String formatX ( Locale locale , double number , String mask ) throws InvalidMaskException { } }
|
return format ( locale , number , convertMask ( mask ) ) ;
|
public class BatchDeleteClusterSnapshotsResult { /** * A list of any errors returned .
* @ param errors
* A list of any errors returned . */
public void setErrors ( java . util . Collection < SnapshotErrorMessage > errors ) { } }
|
if ( errors == null ) { this . errors = null ; return ; } this . errors = new com . amazonaws . internal . SdkInternalList < SnapshotErrorMessage > ( errors ) ;
|
public class VirtualMachineScaleSetsInner { /** * Create or update a VM scale set .
* @ param resourceGroupName The name of the resource group .
* @ param vmScaleSetName The name of the VM scale set to create or update .
* @ param parameters The scale set object .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the VirtualMachineScaleSetInner object if successful . */
public VirtualMachineScaleSetInner createOrUpdate ( String resourceGroupName , String vmScaleSetName , VirtualMachineScaleSetInner parameters ) { } }
|
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , vmScaleSetName , parameters ) . toBlocking ( ) . last ( ) . body ( ) ;
|
public class MariaDbDatabaseMetaData { /** * GetImportedKeysUsingInformationSchema .
* @ param catalog catalog
* @ param table table
* @ return resultset
* @ throws SQLException exception */
public ResultSet getImportedKeysUsingInformationSchema ( String catalog , String table ) throws SQLException { } }
|
if ( table == null ) { throw new SQLException ( "'table' parameter in getImportedKeys cannot be null" ) ; } String sql = "SELECT KCU.REFERENCED_TABLE_SCHEMA PKTABLE_CAT, NULL PKTABLE_SCHEM, KCU.REFERENCED_TABLE_NAME PKTABLE_NAME," + " KCU.REFERENCED_COLUMN_NAME PKCOLUMN_NAME, KCU.TABLE_SCHEMA FKTABLE_CAT, NULL FKTABLE_SCHEM, " + " KCU.TABLE_NAME FKTABLE_NAME, KCU.COLUMN_NAME FKCOLUMN_NAME, KCU.POSITION_IN_UNIQUE_CONSTRAINT KEY_SEQ," + " CASE update_rule " + " WHEN 'RESTRICT' THEN 1" + " WHEN 'NO ACTION' THEN 3" + " WHEN 'CASCADE' THEN 0" + " WHEN 'SET NULL' THEN 2" + " WHEN 'SET DEFAULT' THEN 4" + " END UPDATE_RULE," + " CASE DELETE_RULE" + " WHEN 'RESTRICT' THEN 1" + " WHEN 'NO ACTION' THEN 3" + " WHEN 'CASCADE' THEN 0" + " WHEN 'SET NULL' THEN 2" + " WHEN 'SET DEFAULT' THEN 4" + " END DELETE_RULE," + " RC.CONSTRAINT_NAME FK_NAME," + " NULL PK_NAME," + importedKeyNotDeferrable + " DEFERRABILITY" + " FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE KCU" + " INNER JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS RC" + " ON KCU.CONSTRAINT_SCHEMA = RC.CONSTRAINT_SCHEMA" + " AND KCU.CONSTRAINT_NAME = RC.CONSTRAINT_NAME" + " WHERE " + catalogCond ( "KCU.TABLE_SCHEMA" , catalog ) + " AND " + " KCU.TABLE_NAME = " + escapeQuote ( table ) + " ORDER BY PKTABLE_CAT, PKTABLE_SCHEM, PKTABLE_NAME, KEY_SEQ" ; return executeQuery ( sql ) ;
|
public class ICalendar { /** * Sets the location of a more dynamic , alternate representation of the
* calendar ( such as a website that allows you to interact with the calendar
* data ) .
* @ param url the URL or null to remove
* @ return the property object that was created
* @ see < a
* href = " http : / / tools . ietf . org / html / draft - ietf - calext - extensions - 01 # page - 7 " > draft - ietf - calext - extensions - 01
* p . 7 < / a > */
public Url setUrl ( String url ) { } }
|
Url property = ( url == null ) ? null : new Url ( url ) ; setUrl ( property ) ; return property ;
|
public class HelloSignClient { /** * Retrieves a URL for a file associated with a signature request .
* @ param requestId String signature request ID
* @ return { @ link FileUrlResponse }
* @ throws HelloSignException thrown if there ' s a problem processing the
* HTTP request or the JSON response .
* @ see < a href = " https : / / app . hellosign . com / api / reference # get _ files " > https : / / app . hellosign . com / api / reference # get _ files < / a > */
public FileUrlResponse getFilesUrl ( String requestId ) throws HelloSignException { } }
|
String url = BASE_URI + SIGNATURE_REQUEST_FILES_URI + "/" + requestId ; HttpClient httpClient = this . httpClient . withAuth ( auth ) . withGetParam ( PARAM_GET_URL , "1" ) . get ( url ) ; if ( httpClient . getLastResponseCode ( ) == 404 ) { throw new HelloSignException ( String . format ( "Could not find request with id=%s" , requestId ) ) ; } return new FileUrlResponse ( httpClient . asJson ( ) ) ;
|
public class SessionDriver { /** * Set the name for this session in the ClusterManager
* @ param name the name of this session
* @ throws IOException */
public void setName ( String name ) throws IOException { } }
|
if ( failException != null ) { throw failException ; } if ( name == null || name . length ( ) == 0 ) { return ; } sessionInfo . name = name ; SessionInfo newInfo = new SessionInfo ( sessionInfo ) ; cmNotifier . addCall ( new ClusterManagerService . sessionUpdateInfo_args ( sessionId , newInfo ) ) ;
|
public class ConverterManager { /** * Removes a converter from the set of converters . If the converter was
* not in the set , no changes are made .
* @ param converter the converter to remove , null ignored
* @ return replaced converter , or null */
public PartialConverter removePartialConverter ( PartialConverter converter ) throws SecurityException { } }
|
checkAlterPartialConverters ( ) ; if ( converter == null ) { return null ; } PartialConverter [ ] removed = new PartialConverter [ 1 ] ; iPartialConverters = iPartialConverters . remove ( converter , removed ) ; return removed [ 0 ] ;
|
public class DojoHttpTransport { /** * Handles the
* { @ link com . ibm . jaggr . core . transport . IHttpTransport . LayerContributionType # BEGIN _ MODULES }
* layer listener event .
* When doing server expanded layers , the loader extension JavaScript needs to be in control of
* determining when explicitly requested modules are defined so that it can ensure the modules are
* defined in request order . This prevents the loader from issuing unnecessary , additional , requests
* for unresolved modules when responses arrive out - of - order .
* The markup emitted by this method , together with the { @ link # endModules ( HttpServletRequest , Object ) }
* method , wraps the module definitions within the < code > require . combo . defineModules < / code > function
* call as follows :
* < pre >
* require . combo . defineModules ( [ ' mid1 ' , ' mid2 ' , . . . ] , function ( ) {
* define ( [ . . . ] , function ( . . . ) {
* define ( [ . . . ] , function ( . . . ) {
* < / pre >
* @ param request
* the http request object
* @ param arg
* the set of module names . The iteration order of the set is guaranteed to be
* the same as the order of the subsequent
* { @ link com . ibm . jaggr . core . transport . IHttpTransport . LayerContributionType # BEFORE _ FIRST _ MODULE } ,
* { @ link com . ibm . jaggr . core . transport . IHttpTransport . LayerContributionType # BEFORE _ SUBSEQUENT _ MODULE } ,
* and
* { @ link com . ibm . jaggr . core . transport . IHttpTransport . LayerContributionType # AFTER _ MODULE }
* events .
* @ return the layer contribution */
protected String beginModules ( HttpServletRequest request , Object arg ) { } }
|
StringBuffer sb = new StringBuffer ( ) ; if ( RequestUtil . isServerExpandedLayers ( request ) && request . getParameter ( REQUESTEDMODULESCOUNT_REQPARAM ) != null ) { // it ' s a loader generated request
@ SuppressWarnings ( "unchecked" ) Set < String > modules = ( Set < String > ) arg ; sb . append ( "require.combo.defineModules([" ) ; // $ NON - NLS - 1 $
int i = 0 ; for ( String module : modules ) { sb . append ( i ++ > 0 ? "," : "" ) . append ( "'" ) . append ( module ) . append ( "'" ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ / / $ NON - NLS - 3 $ / / $ NON - NLS - 4 $
} sb . append ( "], function(){\r\n" ) ; // $ NON - NLS - 1 $
} return sb . toString ( ) ;
|
public class ClassUtils { /** * The primitive type for the given type name . For example the value " byte " returns { @ link Byte # TYPE } .
* @ param primitiveType The type name
* @ return An optional type */
public static Optional < Class > getPrimitiveType ( String primitiveType ) { } }
|
return Optional . ofNullable ( PRIMITIVE_TYPE_MAP . get ( primitiveType ) ) ;
|
public class AbstractFxmlView { /** * Scene Builder creates for each FXML document a root container . This
* method omits the root container ( e . g . { @ link AnchorPane } ) and gives you
* the access to its first child .
* @ return the first child of the { @ link AnchorPane } or null if there are no
* children available from this view . */
public Node getViewWithoutRootContainer ( ) { } }
|
final ObservableList < Node > children = getView ( ) . getChildrenUnmodifiable ( ) ; if ( children . isEmpty ( ) ) { return null ; } return children . listIterator ( ) . next ( ) ;
|
public class MapDotApi { /** * Associates new value in map placed at path . New nodes are created with nodeClass if needed .
* @ param map subject original map
* @ param nodeClass class for intermediate nodes
* @ param pathString nodes to walk in map path to place new value
* @ param value new value
* @ return original map */
public static Map dotAssoc ( final Map map , final Class < ? extends Map > nodeClass , final String pathString , final Object value ) { } }
|
if ( pathString == null || pathString . isEmpty ( ) ) { throw new IllegalArgumentException ( PATH_MUST_BE_SPECIFIED ) ; } if ( value == null ) { return map ; } if ( ! pathString . contains ( SEPARATOR ) ) { map . put ( pathString , value ) ; return map ; } return MapApi . assoc ( map , nodeClass , pathString . split ( SEPARATOR_REGEX ) , value ) ;
|
public class DynamicVariableSet { /** * Gets the variables which are replicated in the plate named
* { @ code plateName } .
* @ param plateName
* @ return */
public DynamicVariableSet getPlate ( String plateName ) { } }
|
int index = plateNames . indexOf ( plateName ) ; Preconditions . checkArgument ( index != - 1 ) ; return plates . get ( index ) ;
|
public class WorkflowClient { /** * Retries the last failed task in a workflow
* @ param workflowId the workflow id of the workflow with the failed task */
public void retryLastFailedTask ( String workflowId ) { } }
|
Preconditions . checkArgument ( StringUtils . isNotBlank ( workflowId ) , "workflow id cannot be blank" ) ; stub . retryWorkflow ( WorkflowServicePb . RetryWorkflowRequest . newBuilder ( ) . setWorkflowId ( workflowId ) . build ( ) ) ;
|
public class ExponentialMovingAverage { /** * Adds a new sample to the moving average and returns the updated value .
* @ param newSample the new value to be added
* @ return Double indicating the updated moving average value after adding a new sample . */
public double addNewSample ( double newSample ) { } }
|
final double sample = calculateLog ( newSample ) ; return Double . longBitsToDouble ( valueEncodedAsLong . updateAndGet ( value -> { return Double . doubleToRawLongBits ( sample * newSampleWeight + ( 1.0 - newSampleWeight ) * Double . longBitsToDouble ( value ) ) ; } ) ) ;
|
public class FailoverGroupsInner { /** * Lists the failover groups in a server .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; FailoverGroupInner & gt ; object */
public Observable < Page < FailoverGroupInner > > listByServerNextAsync ( final String nextPageLink ) { } }
|
return listByServerNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < FailoverGroupInner > > , Page < FailoverGroupInner > > ( ) { @ Override public Page < FailoverGroupInner > call ( ServiceResponse < Page < FailoverGroupInner > > response ) { return response . body ( ) ; } } ) ;
|
public class GreenPepperImportMigrator { /** * { @ inheritDoc } */
public MacroDefinition migrate ( MacroDefinition macroDefinition , ConversionContext context ) { } }
|
LOGGER . debug ( "Beginning migration of macro {} " , macroDefinition ) ; final String imports = getV3Imports ( macroDefinition ) ; LOGGER . trace ( "Migrated Parameters to : {}" , imports ) ; Map < String , String > params = new HashMap < String , String > ( ) ; params . put ( GreenPepperImport . IMPORTS_PARAM , imports ) ; MacroDefinition newMacroDefinition = new MacroDefinition ( ) ; newMacroDefinition . setName ( macroDefinition . getName ( ) ) ; MacroBody macroBody = new PlainTextMacroBody ( imports . replaceAll ( "," , "\n" ) ) ; newMacroDefinition . setBody ( macroBody ) ; LOGGER . debug ( "Migrated Macro: {}" , newMacroDefinition ) ; return newMacroDefinition ;
|
public class VirtualMachineScaleSetsInner { /** * Restarts one or more virtual machines in a VM scale set .
* @ param resourceGroupName The name of the resource group .
* @ param vmScaleSetName The name of the VM scale set .
* @ param instanceIds The virtual machine scale set instance ids . Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the OperationStatusResponseInner object if successful . */
public OperationStatusResponseInner beginRestart ( String resourceGroupName , String vmScaleSetName , List < String > instanceIds ) { } }
|
return beginRestartWithServiceResponseAsync ( resourceGroupName , vmScaleSetName , instanceIds ) . toBlocking ( ) . single ( ) . body ( ) ;
|
public class ServiceWrapper { /** * Set the Time To Live ( TTL ) for the services . This method takes a string and
* is provided as a convenience for developers ( like me ) that just wnat to jam
* the string into the wrapper and let it worry about converting it .
* @ param ttlString the number of hops */
public void setTtl ( String ttlString ) { } }
|
if ( ttlString != null && ! ttlString . isEmpty ( ) ) try { this . ttl = Integer . valueOf ( ttlString ) ; } catch ( NumberFormatException e ) { LOGGER . warn ( "Error trying to format the string " + ttlString + " into an Integer." ) ; }
|
public class Exporter { private static SVNException exception ( IOException e ) { } }
|
return new SVNException ( SVNErrorMessage . create ( SVNErrorCode . IO_ERROR , e . getMessage ( ) ) , e ) ;
|
public class StringGrabber { /** * returns a new string that is a substring of this string from left .
* @ param cnt
* @ return */
public StringGrabber left ( int charCount ) { } }
|
String str = getCropper ( ) . getLeftOf ( sb . toString ( ) , charCount ) ; sb = new StringBuilder ( str ) ; return StringGrabber . this ;
|
public class GlobalLogFactory { /** * 自定义日志实现
* @ see Slf4jLogFactory
* @ see Log4jLogFactory
* @ see Log4j2LogFactory
* @ see ApacheCommonsLogFactory
* @ see JdkLogFactory
* @ see ConsoleLogFactory
* @ param logFactoryClass 日志工厂类
* @ return 自定义的日志工厂类 */
public static LogFactory set ( Class < ? extends LogFactory > logFactoryClass ) { } }
|
try { return set ( logFactoryClass . newInstance ( ) ) ; } catch ( Exception e ) { throw new IllegalArgumentException ( "Can not instance LogFactory class!" , e ) ; }
|
public class AssertEquals { /** * Asserts that the element has an attribute with a value equals to the
* value provided . If the element isn ' t present , or the element does not
* have the attribute , this will constitute a failure , same as a mismatch .
* This information will be logged and recorded , with a screenshot for
* traceability and added debugging support .
* @ param attribute - the attribute to be checked
* @ param expectedValue the expected value of the passed attribute of the element */
public void attribute ( String attribute , String expectedValue ) { } }
|
String value = checkAttribute ( attribute , expectedValue , 0 , 0 ) ; String reason = NO_ELEMENT_FOUND ; if ( value == null && getElement ( ) . is ( ) . present ( ) ) { reason = "Attribute doesn't exist" ; } assertNotNull ( reason , value ) ; assertEquals ( "Attribute Mismatch" , expectedValue , value ) ;
|
public class ApiZoneImpl { /** * / * ( non - Javadoc )
* @ see com . tvd12 . ezyfox . core . entities . ApiZone # getRoomsInGroup ( java . lang . String ) */
@ SuppressWarnings ( "unchecked" ) @ Override public < T extends ApiRoom > List < T > getRoomsInGroup ( String groupId ) { } }
|
List < Room > sfsRooms = getZone ( ) . getRoomListFromGroup ( groupId ) ; List < T > answer = new ArrayList < > ( ) ; for ( Room sfsRoom : sfsRooms ) { if ( sfsRoom . containsProperty ( APIKey . ROOM ) ) answer . add ( ( T ) sfsRoom . getProperty ( APIKey . ROOM ) ) ; } return answer ;
|
public class Authorizations { /** * Adds ( assigns ) a permission to those directly associated with the Account . If the Account doesn ' t yet have any
* direct permissions , a new permission collection ( a Set & lt ; String & gt ; ) will be created automatically .
* @ param permissions the permissions to add to those directly assigned to the Account . */
public Authorizations addPermissions ( Collection < Permission > permissions ) { } }
|
this . permissions . addAll ( permissions ) ; this . aggregatePermissions = null ; return this ;
|
public class PdfContentByte { /** * Sets the stroke color to a pattern . The pattern can be
* colored or uncolored .
* @ param p the pattern */
public void setPatternStroke ( PdfPatternPainter p ) { } }
|
if ( p . isStencil ( ) ) { setPatternStroke ( p , p . getDefaultColor ( ) ) ; return ; } checkWriter ( ) ; PageResources prs = getPageResources ( ) ; PdfName name = writer . addSimplePattern ( p ) ; name = prs . addPattern ( name , p . getIndirectReference ( ) ) ; content . append ( PdfName . PATTERN . getBytes ( ) ) . append ( " CS " ) . append ( name . getBytes ( ) ) . append ( " SCN" ) . append_i ( separator ) ;
|
public class CustomUtils { /** * find the best matching resouce bundle of the specified resouce file name . */
public static ResourceBundle getResourceBundle ( File location , String name , Locale locale ) { } }
|
File [ ] files = new File [ ] { new File ( location , name + "_" + locale . toString ( ) + RESOURCE_FILE_EXT ) , new File ( location , name + "_" + locale . getLanguage ( ) + RESOURCE_FILE_EXT ) , new File ( location , name + RESOURCE_FILE_EXT ) } ; for ( File file : files ) { if ( exists ( file ) ) { try { return new PropertyResourceBundle ( new FileReader ( file ) ) ; } catch ( IOException e ) { if ( logger . isLoggable ( Level . FINE ) ) { logger . fine ( "The resource file was not loaded. The exception is " + e . getMessage ( ) ) ; } } } } return null ;
|
public class Introspector { /** * 根据methodName + paramter参数进行获取处理
* @ param clazz
* @ param methodName
* @ param parameter
* @ return */
public FastMethod getFastMethod ( Class < ? > clazz , String methodName , Object ... parameter ) { } }
|
if ( parameter == null ) { return getFastMethod ( clazz , methodName ) ; } Class [ ] types = new Class [ parameter . length ] ; for ( int i = 0 ; i < parameter . length ; i ++ ) { types [ i ] = parameter . getClass ( ) ; } return getFastMethod ( clazz , methodName , types ) ;
|
public class Symm { /** * Convenience for picking up Keyfile
* @ param f
* @ return
* @ throws IOException */
public static Symm obtain ( File f ) throws IOException { } }
|
FileInputStream fis = new FileInputStream ( f ) ; try { return obtain ( fis ) ; } finally { fis . close ( ) ; }
|
public class FnObject { /** * Determines whether the result of executing the specified function
* on the target object and the specified object parameter are NOT equal
* in value , this is , whether < tt > functionResult . compareTo ( object ) ! = 0 < / tt > .
* Both the function result and the specified object have to implement
* { @ link Comparable } .
* @ param object the object to compare to the target
* @ return false if both objects are equal according to " compareTo " , true if not . */
public static final < X > Function < X , Boolean > notEqValueBy ( final IFunction < X , ? > by , final boolean object ) { } }
|
return FnFunc . chain ( by , notEqValue ( object ) ) ;
|
public class RegistryListenerBindingHandler { /** * enforce creation of all watcher before register it */
@ SuppressWarnings ( "unchecked" ) private List < ListenerRegistration > addListenerToRegistry ( ) { } }
|
List < ListenerRegistration > registrationsBuilder = newArrayList ( ) ; for ( Pair < IdMatcher , Watcher > guiceWatcherRegistration : getRegisteredWatchers ( ) ) { Watcher watcher = guiceWatcherRegistration . right ( ) ; IdMatcher idMatcher = guiceWatcherRegistration . left ( ) ; Registration registration = registry . addWatcher ( idMatcher , watcher ) ; ListenerRegistration listenerRegistration = new ListenerRegistration ( registration , idMatcher , watcher ) ; registrationsBuilder . add ( listenerRegistration ) ; } return registrationsBuilder ;
|
public class ConnectionMaintainerImpl { /** * Returns a collection of more candidates that can be tried for
* connections .
* @ return A collection of more candidates that can be tried for
* connections . */
private Collection < T > getMoreCandidates ( ) { } }
|
final Predicate < T > unusedPredicate = new UnusedServer ( ) ; final Collection < T > servers = new LinkedList < T > ( ) ; // We limit the number of times we try to retrieve more candidates . If
// we try several times and fail , we just return an empty collection .
int tries = 0 ; // We pull candidate URIs from the candidate provider .
while ( servers . isEmpty ( ) && ( tries < 3 ) ) { LOG . debug ( "Trying to find candidate servers" ) ; // If we have been flagged to sleep before trying to get more
// candidates , sleep before trying to get more candidates .
if ( m_sleepBeforeTryingToGetMoreCandidates ) { LOG . debug ( "Long sleep..." ) ; ThreadUtils . safeSleep ( 60000 ) ; } else if ( ! m_firstRun ) { LOG . debug ( "Short sleep..." ) ; // Always sleep for a little while to avoid hammering the
// server .
ThreadUtils . safeSleep ( 10000 ) ; } m_firstRun = false ; final Collection < T > candidates = m_candidateProvider . getCandidates ( ) ; LOG . debug ( "Found candidates..." ) ; // We only accept servers that we have not already used . This
// prevents us from establishing connections with the same
// servers more than once .
final Collection < T > unusedCandidates = m_collectionUtils . select ( candidates , unusedPredicate ) ; servers . addAll ( unusedCandidates ) ; ++ tries ; } LOG . debug ( "Found this many candidate servers: " + servers . size ( ) ) ; return servers ;
|
public class BytecodeProducer { /** * Returns a human readable string for the code that this { @ link BytecodeProducer } generates . */
public final String trace ( ) { } }
|
// TODO ( lukes ) : textifier has support for custom label names by overriding appendLabel .
// Consider trying to make use of ( using the Label . info field ? adding a custom NamedLabel
// sub type ? )
Textifier textifier = new Textifier ( Opcodes . ASM7 ) { { // reset tab sizes . Since we don ' t care about formatting class names or method
// signatures ( only code ) . We only need to set the tab2 , tab3 and ltab settings ( tab is
// for class members ) .
this . tab = null ; // trigger an error if used .
this . tab2 = " " ; // tab setting for instructions
this . tab3 = "" ; // tab setting for switch cases
this . ltab = "" ; // tab setting for labels
} } ; gen ( new CodeBuilder ( new TraceMethodVisitor ( textifier ) , 0 , "trace" , "()V" ) ) ; StringWriter writer = new StringWriter ( ) ; textifier . print ( new PrintWriter ( writer ) ) ; return writer . toString ( ) ; // Note textifier always adds a trailing newline
|
public class MdcInjectionFilter { /** * write key properties of the session to the Mapped Diagnostic Context
* sub - classes could override this method to map more / other attributes
* @ param session the session to map
* @ param context key properties will be added to this map */
protected void fillContext ( final IoSession session , final Map < String , String > context ) { } }
|
if ( mdcKeys . contains ( MdcKey . handlerClass ) ) { context . put ( MdcKey . handlerClass . name ( ) , session . getHandler ( ) . getClass ( ) . getName ( ) ) ; } if ( mdcKeys . contains ( MdcKey . remoteAddress ) ) { context . put ( MdcKey . remoteAddress . name ( ) , session . getRemoteAddress ( ) . toString ( ) ) ; } if ( mdcKeys . contains ( MdcKey . localAddress ) ) { context . put ( MdcKey . localAddress . name ( ) , session . getLocalAddress ( ) . toString ( ) ) ; } if ( session . getTransportMetadata ( ) . getAddressType ( ) == InetSocketAddress . class ) { InetSocketAddress remoteAddress = ( InetSocketAddress ) session . getRemoteAddress ( ) ; InetSocketAddress localAddress = ( InetSocketAddress ) session . getLocalAddress ( ) ; if ( mdcKeys . contains ( MdcKey . remoteIp ) ) { context . put ( MdcKey . remoteIp . name ( ) , remoteAddress . getAddress ( ) . getHostAddress ( ) ) ; } if ( mdcKeys . contains ( MdcKey . remotePort ) ) { context . put ( MdcKey . remotePort . name ( ) , String . valueOf ( remoteAddress . getPort ( ) ) ) ; } if ( mdcKeys . contains ( MdcKey . localIp ) ) { context . put ( MdcKey . localIp . name ( ) , localAddress . getAddress ( ) . getHostAddress ( ) ) ; } if ( mdcKeys . contains ( MdcKey . localPort ) ) { context . put ( MdcKey . localPort . name ( ) , String . valueOf ( localAddress . getPort ( ) ) ) ; } }
|
public class SampleFunction { /** * Converts a batch indexing into the sample , to a batch indexing into the
* original function .
* @ param batch The batch indexing into the sample .
* @ return A new batch indexing into the original function , containing only
* the indices from the sample . */
private int [ ] convertBatch ( int [ ] batch ) { } }
|
int [ ] conv = new int [ batch . length ] ; for ( int i = 0 ; i < batch . length ; i ++ ) { conv [ i ] = sample [ batch [ i ] ] ; } return conv ;
|
public class Hessian2Output { /** * Writes a byte buffer to the stream .
* < code > < pre >
* b b16 b18 bytes
* < / pre > < / code > */
public void writeByteBufferPart ( byte [ ] buffer , int offset , int length ) throws IOException { } }
|
while ( length > 0 ) { flushIfFull ( ) ; int sublen = _buffer . length - _offset ; if ( length < sublen ) sublen = length ; _buffer [ _offset ++ ] = BC_BINARY_CHUNK ; _buffer [ _offset ++ ] = ( byte ) ( sublen >> 8 ) ; _buffer [ _offset ++ ] = ( byte ) sublen ; System . arraycopy ( buffer , offset , _buffer , _offset , sublen ) ; _offset += sublen ; length -= sublen ; offset += sublen ; }
|
public class GpioSwitchComponent { /** * Return the current switch state based on the
* GPIO digital output pin state .
* @ return SwitchState */
@ Override public SwitchState getState ( ) { } }
|
if ( pin . isState ( onState ) ) return SwitchState . ON ; else return SwitchState . OFF ;
|
public class BaseFlashCreative { /** * Gets the flashAsset value for this BaseFlashCreative .
* @ return flashAsset * The flash asset . This attribute is required . To view the Flash
* image , use the
* { @ link CreativeAsset # assetUrl } . */
public com . google . api . ads . admanager . axis . v201805 . CreativeAsset getFlashAsset ( ) { } }
|
return flashAsset ;
|
public class ObjectUtil { /** * 针对Class . forName的一个简单封装 , 根据类名获得类
* @ param clsName
* @ return 如果未加载成功 , 则抛出Runtime异常 */
public static Class getClassByName ( String clsName , ClassLoader loader ) { } }
|
try { return Class . forName ( clsName , true , loader ) ; } catch ( ClassNotFoundException e ) { throw new RuntimeException ( e ) ; }
|
public class HeatChart { /** * Generates a new chart < code > Image < / code > based upon the currently held settings and then
* attempts to save that image to disk , to the location provided as a File parameter . The image
* type of the saved file will equal the extension of the filename provided , so it is essential
* that a suitable extension be included on the file name .
* All supported < code > ImageIO < / code > file types are supported , including PNG , JPG and GIF .
* No chart will be generated until this or the related < code > getChartImage ( ) < / code > method are
* called . All successive calls will result in the generation of a new chart image , no caching is
* used .
* @ param outputFile the file location that the generated image file should be written to . The
* File must have a suitable filename , with an extension of a valid image format ( as supported by
* < code > ImageIO < / code > ) .
* @ throws IOException if the output file ' s filename has no extension or if there the file is
* unable to written to . Reasons for this include a non - existant file location ( check with the
* File exists ( ) method on the parent directory ) , or the permissions of the write location may be
* incorrect . */
public void saveToFile ( File outputFile ) throws IOException { } }
|
String filename = outputFile . getName ( ) ; int extPoint = filename . lastIndexOf ( '.' ) ; if ( extPoint < 0 ) { throw new IOException ( "Illegal filename, no extension used." ) ; } // Determine the extension of the filename .
String ext = filename . substring ( extPoint + 1 ) ; // Handle jpg without transparency .
if ( ext . toLowerCase ( ) . equals ( "jpg" ) || ext . toLowerCase ( ) . equals ( "jpeg" ) ) { BufferedImage chart = ( BufferedImage ) getChartImage ( false ) ; // Save our graphic .
saveGraphicJpeg ( chart , outputFile , 1.0f ) ; } else { BufferedImage chart = ( BufferedImage ) getChartImage ( true ) ; ImageIO . write ( chart , ext , outputFile ) ; }
|
public class dnssoarec { /** * Use this API to update dnssoarec resources . */
public static base_responses update ( nitro_service client , dnssoarec resources [ ] ) throws Exception { } }
|
base_responses result = null ; if ( resources != null && resources . length > 0 ) { dnssoarec updateresources [ ] = new dnssoarec [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { updateresources [ i ] = new dnssoarec ( ) ; updateresources [ i ] . domain = resources [ i ] . domain ; updateresources [ i ] . originserver = resources [ i ] . originserver ; updateresources [ i ] . contact = resources [ i ] . contact ; updateresources [ i ] . serial = resources [ i ] . serial ; updateresources [ i ] . refresh = resources [ i ] . refresh ; updateresources [ i ] . retry = resources [ i ] . retry ; updateresources [ i ] . expire = resources [ i ] . expire ; updateresources [ i ] . minimum = resources [ i ] . minimum ; updateresources [ i ] . ttl = resources [ i ] . ttl ; } result = update_bulk_request ( client , updateresources ) ; } return result ;
|
public class Xsd2AvroTranslator { /** * Create an avro complex type field using an XML schema type .
* @ param xsdType the XML schema complex type
* @ param level the depth in the hierarchy
* @ param avroFields array of avro fields being populated
* @ throws Xsd2AvroTranslatorException if something abnormal in the xsd */
private void visit ( XmlSchema xmlSchema , XmlSchemaComplexType xsdType , final int level , final ArrayNode avroFields ) { } }
|
visit ( xmlSchema , xsdType . getParticle ( ) , level , avroFields ) ;
|
public class DeleteVirtualServiceRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeleteVirtualServiceRequest deleteVirtualServiceRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( deleteVirtualServiceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteVirtualServiceRequest . getMeshName ( ) , MESHNAME_BINDING ) ; protocolMarshaller . marshall ( deleteVirtualServiceRequest . getVirtualServiceName ( ) , VIRTUALSERVICENAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class AWSLogsClient { /** * Sets the retention of the specified log group . A retention policy allows you to configure the number of days for
* which to retain log events in the specified log group .
* @ param putRetentionPolicyRequest
* @ return Result of the PutRetentionPolicy operation returned by the service .
* @ throws InvalidParameterException
* A parameter is specified incorrectly .
* @ throws ResourceNotFoundException
* The specified resource does not exist .
* @ throws OperationAbortedException
* Multiple requests to update the same resource were in conflict .
* @ throws ServiceUnavailableException
* The service cannot complete the request .
* @ sample AWSLogs . PutRetentionPolicy
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / logs - 2014-03-28 / PutRetentionPolicy " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public PutRetentionPolicyResult putRetentionPolicy ( PutRetentionPolicyRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executePutRetentionPolicy ( request ) ;
|
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcControl ( ) { } }
|
if ( ifcControlEClass == null ) { ifcControlEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 138 ) ; } return ifcControlEClass ;
|
public class RuleElementImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public NotificationChain basicSetGuarded ( RuleElement newGuarded , NotificationChain msgs ) { } }
|
RuleElement oldGuarded = guarded ; guarded = newGuarded ; if ( eNotificationRequired ( ) ) { ENotificationImpl notification = new ENotificationImpl ( this , Notification . SET , SimpleAntlrPackage . RULE_ELEMENT__GUARDED , oldGuarded , newGuarded ) ; if ( msgs == null ) msgs = notification ; else msgs . add ( notification ) ; } return msgs ;
|
public class KafkaTableSourceBase { /** * Validates a field of the schema to be the processing time attribute .
* @ param proctimeAttribute The name of the field that becomes the processing time field . */
private Optional < String > validateProctimeAttribute ( Optional < String > proctimeAttribute ) { } }
|
return proctimeAttribute . map ( ( attribute ) -> { // validate that field exists and is of correct type
Optional < TypeInformation < ? > > tpe = schema . getFieldType ( attribute ) ; if ( ! tpe . isPresent ( ) ) { throw new ValidationException ( "Processing time attribute '" + attribute + "' is not present in TableSchema." ) ; } else if ( tpe . get ( ) != Types . SQL_TIMESTAMP ( ) ) { throw new ValidationException ( "Processing time attribute '" + attribute + "' is not of type SQL_TIMESTAMP." ) ; } return attribute ;
|
public class ActionContext { /** * Apply content type to response with result provided .
* If ` result ` is an error then it might not apply content type as requested :
* * If request is not ajax request , then use ` text / html `
* * If request is ajax request then apply requested content type only when ` json ` or ` xml ` is requested
* * otherwise use ` text / html `
* @ param result
* the result used to check if it is error result
* @ return this ` ActionContext ` . */
public ActionContext applyContentType ( Result result ) { } }
|
if ( ! result . status ( ) . isError ( ) ) { return applyContentType ( ) ; } return applyContentType ( contentTypeForErrorResult ( req ( ) ) ) ;
|
public class OQueryModel { /** * Set value for named parameter
* @ param paramName name of the parameter to set
* @ param value { @ link IModel } for the parameter value
* @ return this { @ link OQueryModel } */
@ SuppressWarnings ( "unchecked" ) public OQueryModel < K > setParameter ( String paramName , IModel < ? > value ) { } }
|
params . put ( paramName , ( IModel < Object > ) value ) ; super . detach ( ) ; return this ;
|
public class ForkJoinStream { /** * Executes map on the provided stream . If the Stream is parallel , it is
* executed using the custom pool , else it is executed directly from the
* main thread .
* @ param < T >
* @ param < R >
* @ param stream
* @ param mapper
* @ return */
public < T , R > Stream < R > map ( Stream < T > stream , Function < ? super T , ? extends R > mapper ) { } }
|
Callable < Stream < R > > callable = ( ) -> stream . map ( mapper ) ; return ThreadMethods . forkJoinExecution ( callable , concurrencyConfiguration , stream . isParallel ( ) ) ;
|
public class HighwayHash { /** * Computes the hash value after all bytes were processed . Invalidates the
* state .
* NOTE : The 128 - bit HighwayHash algorithm is not yet frozen and subject to change .
* @ return array of size 2 containing 128 - bit hash */
public long [ ] finalize128 ( ) { } }
|
permuteAndUpdate ( ) ; permuteAndUpdate ( ) ; permuteAndUpdate ( ) ; permuteAndUpdate ( ) ; permuteAndUpdate ( ) ; permuteAndUpdate ( ) ; done = true ; long [ ] hash = new long [ 2 ] ; hash [ 0 ] = v0 [ 0 ] + mul0 [ 0 ] + v1 [ 2 ] + mul1 [ 2 ] ; hash [ 1 ] = v0 [ 1 ] + mul0 [ 1 ] + v1 [ 3 ] + mul1 [ 3 ] ; return hash ;
|
public class SetValBooleanMatcher { /** * Override default implementation of getValue ( )
* @ param msg
* @ param contextValue
* @ throws MatchingException
* @ throws BadMessageFormatMatchingException */
Object getValue ( MatchSpaceKey msg , Object contextValue ) throws MatchingException , BadMessageFormatMatchingException { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . entry ( cclass , "getValue" , "msg: " + msg + "contextValue: " + contextValue ) ; // The value which we ' ll return
Boolean resultBool = Boolean . FALSE ; // May need to call MFP multiple times , if our context has multiple nodes
if ( contextValue != null ) { // Currently this must be a list of nodes
if ( contextValue instanceof SetValEvaluationContext ) { SetValEvaluationContext evalContext = ( SetValEvaluationContext ) contextValue ; // Get the node list
ArrayList wrappedParentList = evalContext . getWrappedNodeList ( ) ; // If the list is empty , then we have yet to get the document root
if ( wrappedParentList . isEmpty ( ) ) { // Set up a root ( document ) context for evaluation
Object docRoot = Matching . getEvaluator ( ) . getDocumentRoot ( msg ) ; // Create an object to hold the wrapped node
WrappedNodeResults wrapper = new WrappedNodeResults ( docRoot ) ; // Set the root into the evaluation context
evalContext . addNode ( wrapper ) ; } // Iterate over the nodes
Iterator iter = wrappedParentList . iterator ( ) ; while ( iter . hasNext ( ) ) { WrappedNodeResults nextWrappedNode = ( WrappedNodeResults ) iter . next ( ) ; Object nextParentNode = nextWrappedNode . getNode ( ) ; String debugString = "" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) tc . debug ( this , cclass , "getValue" , "Evaluation context node: " + nextWrappedNode ) ; // If no cached value we ' ll need to call MFP
Boolean tempBool = nextWrappedNode . getEvalBoolResult ( id . getName ( ) ) ; if ( tempBool == null ) { // Call MFP to get the results for this node
tempBool = ( Boolean ) msg . getIdentifierValue ( id , false , nextParentNode , false ) ; // false means dont return a list
// Add result to cache for next time
nextWrappedNode . addEvalBoolResult ( id . getName ( ) , tempBool ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) debugString = "Result from MFP " ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) debugString = "Result from Cache " ; } // Useful debug
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { String asString = ", type: Boolean - <" + tempBool + ">" ; tc . debug ( this , cclass , "getValue" , debugString + "for identifier " + id . getName ( ) + asString ) ; } if ( tempBool . booleanValue ( ) ) { resultBool = Boolean . TRUE ; break ; } } // eof while
} // eof instanceof XPathEvaluationContext
} // eof contextValue not null
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "getValue" , resultBool ) ; return resultBool ;
|
public class PreferencesHelper { /** * Retrieves double value stored as long . */
public static double getDouble ( @ NonNull SharedPreferences prefs , @ NonNull String key , double defaultValue ) { } }
|
long bits = prefs . getLong ( key , Double . doubleToLongBits ( defaultValue ) ) ; return Double . longBitsToDouble ( bits ) ;
|
public class SalesforceRestWriter { /** * For single request , creates HttpUriRequest and decides post / patch operation based on input parameter .
* For batch request , add the record into JsonArray as a subrequest and only creates HttpUriRequest with POST method if it filled the batch size .
* { @ inheritDoc }
* @ see org . apache . gobblin . writer . http . RestJsonWriter # onNewRecord ( org . apache . gobblin . converter . rest . RestEntry ) */
@ Override public Optional < HttpUriRequest > onNewRecord ( RestEntry < JsonObject > record ) { } }
|
Preconditions . checkArgument ( ! StringUtils . isEmpty ( accessToken ) , "Access token has not been acquired." ) ; Preconditions . checkNotNull ( record , "Record should not be null" ) ; RequestBuilder builder = null ; JsonObject payload = null ; if ( batchSize > 1 ) { if ( ! batchRecords . isPresent ( ) ) { batchRecords = Optional . of ( new JsonArray ( ) ) ; } batchRecords . get ( ) . add ( newSubrequest ( record ) ) ; if ( batchRecords . get ( ) . size ( ) < batchSize ) { // No need to send . Return absent .
return Optional . absent ( ) ; } payload = newPayloadForBatch ( ) ; builder = RequestBuilder . post ( ) . setUri ( combineUrl ( getCurServerHost ( ) , batchResourcePath ) ) ; } else { switch ( operation ) { case INSERT_ONLY_NOT_EXIST : builder = RequestBuilder . post ( ) ; break ; case UPSERT : builder = RequestBuilder . patch ( ) ; break ; default : throw new IllegalArgumentException ( operation + " is not supported." ) ; } builder . setUri ( combineUrl ( getCurServerHost ( ) , record . getResourcePath ( ) ) ) ; payload = record . getRestEntryVal ( ) ; } return Optional . of ( newRequest ( builder , payload ) ) ;
|
public class SimpleFormValidator { /** * Performs full check of this form , typically there is no need to call this method manually since form will be automatically
* validated upon field content change . However calling this might be required when change made to field state does not
* cause change event to be fired . For example disabling or enabling field . */
public void validate ( ) { } }
|
formInvalid = false ; errorMsgText = null ; for ( CheckedButtonWrapper wrapper : buttons ) { if ( wrapper . button . isChecked ( ) != wrapper . mustBeChecked ) { wrapper . setButtonStateInvalid ( true ) ; } else { wrapper . setButtonStateInvalid ( false ) ; } } for ( CheckedButtonWrapper wrapper : buttons ) { if ( treatDisabledFieldsAsValid && wrapper . button . isDisabled ( ) ) { continue ; } if ( wrapper . button . isChecked ( ) != wrapper . mustBeChecked ) { errorMsgText = wrapper . errorMsg ; formInvalid = true ; break ; } } for ( VisValidatableTextField field : fields ) { field . validateInput ( ) ; } for ( VisValidatableTextField field : fields ) { if ( treatDisabledFieldsAsValid && field . isDisabled ( ) ) { continue ; } if ( field . isInputValid ( ) == false ) { Array < InputValidator > validators = field . getValidators ( ) ; for ( InputValidator v : validators ) { if ( v instanceof FormInputValidator == false ) { throw new IllegalStateException ( "Fields validated by FormValidator cannot have validators not added using FormValidator methods. " + "Are you adding validators to field manually?" ) ; } FormInputValidator validator = ( FormInputValidator ) v ; if ( validator . getLastResult ( ) == false ) { if ( ! ( validator . isHideErrorOnEmptyInput ( ) && field . getText ( ) . equals ( "" ) ) ) { errorMsgText = validator . getErrorMsg ( ) ; } formInvalid = true ; break ; } } break ; } } updateWidgets ( ) ;
|
public class DoCopy { /** * Return a context - relative path , beginning with a " / " , that represents the canonical version of the specified path after
* " . . " and " . " elements are resolved out . If the specified path attempts to go outside the boundaries of the current context
* ( i . e . too many " . . " path elements are present ) , return < code > null < / code > instead .
* @ param path Path to be normalized
* @ return normalized path */
protected String normalize ( String path ) { } }
|
if ( path == null ) { return null ; } // Create a place for the normalized path
String normalized = path ; if ( normalized . equals ( "/." ) ) { return "/" ; } // Normalize the slashes and add leading slash if necessary
if ( normalized . indexOf ( '\\' ) >= 0 ) { normalized = normalized . replace ( '\\' , '/' ) ; } if ( ! normalized . startsWith ( "/" ) ) { normalized = "/" + normalized ; } // Resolve occurrences of " / / " in the normalized path
while ( true ) { int index = normalized . indexOf ( "//" ) ; if ( index < 0 ) { break ; } normalized = normalized . substring ( 0 , index ) + normalized . substring ( index + 1 ) ; } // Resolve occurrences of " / . / " in the normalized path
while ( true ) { int index = normalized . indexOf ( "/./" ) ; if ( index < 0 ) { break ; } normalized = normalized . substring ( 0 , index ) + normalized . substring ( index + 2 ) ; } // Resolve occurrences of " / . . / " in the normalized path
while ( true ) { int index = normalized . indexOf ( "/../" ) ; if ( index < 0 ) { break ; } if ( index == 0 ) { return ( null ) ; // Trying to go outside our context
} int index2 = normalized . lastIndexOf ( '/' , index - 1 ) ; normalized = normalized . substring ( 0 , index2 ) + normalized . substring ( index + 3 ) ; } // Return the normalized path that we have completed
return ( normalized ) ;
|
public class Step { /** * Checks if input text contains expected value .
* @ param pageElement
* Is target element
* @ param textOrKey
* Is the data to check ( text or text in context ( after a save ) )
* @ return true or false
* @ throws FailureException
* if the scenario encounters a functional error
* @ throws TechnicalException */
protected boolean checkInputText ( PageElement pageElement , String textOrKey ) throws FailureException , TechnicalException { } }
|
WebElement inputText = null ; String value = getTextOrKey ( textOrKey ) ; try { inputText = Context . waitUntil ( ExpectedConditions . presenceOfElementLocated ( Utilities . getLocator ( pageElement ) ) ) ; } catch ( final Exception e ) { new Result . Failure < > ( e . getMessage ( ) , Messages . getMessage ( Messages . FAIL_MESSAGE_UNABLE_TO_FIND_ELEMENT ) , true , pageElement . getPage ( ) . getCallBack ( ) ) ; } return ! ( inputText == null || value == null || inputText . getAttribute ( VALUE ) == null || ! value . equals ( inputText . getAttribute ( VALUE ) . trim ( ) ) ) ;
|
public class Client { /** * Returns a cursor of series specified by a filter .
* @ param filter The series filter
* @ return A Cursor of Series . The cursor . iterator ( ) . next ( ) may throw a { @ link TempoDBException } if an error occurs while making a request .
* @ see Cursor
* @ see Filter
* @ since 1.0.0 */
public Cursor < Series > getSeries ( Filter filter ) { } }
|
URI uri = null ; try { URIBuilder builder = new URIBuilder ( String . format ( "/%s/series/" , API_VERSION ) ) ; addFilterToURI ( builder , filter ) ; uri = builder . build ( ) ; } catch ( URISyntaxException e ) { String message = String . format ( "Could not build URI with input - filter: %s" , filter ) ; throw new IllegalArgumentException ( message , e ) ; } Cursor < Series > cursor = new SeriesCursor ( uri , this ) ; return cursor ;
|
public class ApiOvhCloud { /** * Get your project consumption
* REST : GET / cloud / project / { serviceName } / consumption
* @ param to [ required ] Get usage to
* @ param from [ required ] Get usage from
* @ param serviceName [ required ] The project id */
public OvhProjectUsage project_serviceName_consumption_GET ( String serviceName , Date from , Date to ) throws IOException { } }
|
String qPath = "/cloud/project/{serviceName}/consumption" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "from" , from ) ; query ( sb , "to" , to ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhProjectUsage . class ) ;
|
public class SntpClient { /** * Writes system time ( milliseconds since January 1 , 1970 ) as an NTP time stamp
* at the given offset in the buffer . */
private void writeTimeStamp ( byte [ ] buffer , int offset , long time ) { } }
|
long seconds = time / 1000L ; long milliseconds = time - seconds * 1000L ; seconds += OFFSET_1900_TO_1970 ; // write seconds in big endian format
buffer [ offset ++ ] = ( byte ) ( seconds >> 24 ) ; buffer [ offset ++ ] = ( byte ) ( seconds >> 16 ) ; buffer [ offset ++ ] = ( byte ) ( seconds >> 8 ) ; buffer [ offset ++ ] = ( byte ) ( seconds >> 0 ) ; long fraction = milliseconds * 0x100000000L / 1000L ; // write fraction in big endian format
buffer [ offset ++ ] = ( byte ) ( fraction >> 24 ) ; buffer [ offset ++ ] = ( byte ) ( fraction >> 16 ) ; buffer [ offset ++ ] = ( byte ) ( fraction >> 8 ) ; // low order bits should be random data
buffer [ offset ++ ] = ( byte ) ( Math . random ( ) * 255.0 ) ;
|
public class XSLTElementDef { /** * Tell if the two string refs are equal ,
* equality being defined as :
* 1 ) Both strings are null .
* 2 ) One string is null and the other is empty .
* 3 ) Both strings are non - null , and equal .
* @ param s1 A reference to the first string , or null .
* @ param s2 A reference to the second string , or null .
* @ return true if Both strings are null , or if
* one string is null and the other is empty , or if
* both strings are non - null , and equal because
* s1 . equals ( s2 ) returns true . */
private static boolean equalsMayBeNullOrZeroLen ( String s1 , String s2 ) { } }
|
int len1 = ( s1 == null ) ? 0 : s1 . length ( ) ; int len2 = ( s2 == null ) ? 0 : s2 . length ( ) ; return ( len1 != len2 ) ? false : ( len1 == 0 ) ? true : s1 . equals ( s2 ) ;
|
public class AbstractMediaManager { /** * Renders all registered media in the given layer that intersect the supplied clipping
* rectangle to the given graphics context .
* @ param layer the layer to render ; one of { @ link # FRONT } , { @ link # BACK } , or { @ link # ALL } .
* The front layer contains all animations with a positive render order ; the back layer
* contains all animations with a negative render order ; all , both . */
public void paint ( Graphics2D gfx , int layer , Shape clip ) { } }
|
for ( int ii = 0 , nn = _media . size ( ) ; ii < nn ; ii ++ ) { AbstractMedia media = _media . get ( ii ) ; int order = media . getRenderOrder ( ) ; try { if ( ( ( layer == ALL ) || ( layer == FRONT && order >= 0 ) || ( layer == BACK && order < 0 ) ) && clip . intersects ( media . getBounds ( ) ) ) { media . paint ( gfx ) ; } } catch ( Exception e ) { log . warning ( "Failed to render media" , "media" , media , e ) ; } }
|
public class DRL5Lexer { /** * $ ANTLR start " INCR " */
public final void mINCR ( ) throws RecognitionException { } }
|
try { int _type = INCR ; int _channel = DEFAULT_TOKEN_CHANNEL ; // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 194:6 : ( ' + + ' )
// src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 194:8 : ' + + '
{ match ( "++" ) ; if ( state . failed ) return ; } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving
}
|
public class CoreOptions { /** * Creates a composite option of { @ link EnvironmentOption } s .
* @ param environmentVariables
* process environment variables ( cannot be null or containing null entries )
* @ return composite option of environment variables
* @ throws IllegalArgumentException
* - If environmentVariables array is null or contains null entries */
public static Option environment ( final String ... environmentVariables ) { } }
|
validateNotEmptyContent ( environmentVariables , true , "Environment variable options" ) ; final List < EnvironmentOption > options = new ArrayList < EnvironmentOption > ( ) ; for ( String environmentVariable : environmentVariables ) { options . add ( environment ( environmentVariable ) ) ; } return environment ( options . toArray ( new EnvironmentOption [ options . size ( ) ] ) ) ;
|
public class PID { /** * Factory method that throws an unchecked exception if it ' s not
* well - formed .
* @ param pidString the String value of the PID
* @ return PID */
public static PID getInstance ( String pidString ) { } }
|
try { return new PID ( pidString ) ; } catch ( MalformedPIDException e ) { throw new FaultException ( "Malformed PID: " + e . getMessage ( ) , e ) ; }
|
public class MicronautConsole { /** * Indicates progress as a percentage for the given number and total .
* @ param number The number
* @ param total The total */
@ SuppressWarnings ( "MagicNumber" ) @ Override public void indicateProgressPercentage ( long number , long total ) { } }
|
verifySystemOut ( ) ; progressIndicatorActive = true ; String currMsg = lastMessage ; try { int percentage = Math . round ( NumberMath . multiply ( NumberMath . divide ( number , total ) , 100 ) . floatValue ( ) ) ; if ( ! isAnsiEnabled ( ) ) { out . print ( ".." ) ; out . print ( percentage + '%' ) ; } else { updateStatus ( currMsg + ' ' + percentage + '%' ) ; } } finally { lastMessage = currMsg ; }
|
public class DescribableList { /** * Picks up { @ link DependencyDeclarer } s and allow it to build dependencies . */
public void buildDependencyGraph ( AbstractProject owner , DependencyGraph graph ) { } }
|
for ( Object o : this ) { if ( o instanceof DependencyDeclarer ) { DependencyDeclarer dd = ( DependencyDeclarer ) o ; try { dd . buildDependencyGraph ( owner , graph ) ; } catch ( RuntimeException e ) { LOGGER . log ( Level . SEVERE , "Failed to build dependency graph for " + owner , e ) ; } } }
|
public class NodeReferenceFactory { /** * Returns a valid { @ link Pathref } based on the specified arguments or
* < code > null < / null > if that ' s not possible .
* @ param layoutOwnerUsername
* @ param dlmNoderef
* @ param layout
* @ return a valid { @ link Pathref } or < code > null < / null > */
public Pathref getPathrefFromNoderef ( String layoutOwnerUsername , String dlmNoderef , org . dom4j . Element layout ) { } }
|
Validate . notNull ( layoutOwnerUsername , "Argument 'layoutOwnerUsername' cannot be null." ) ; Validate . notNull ( dlmNoderef , "Argument 'dlmNoderef' cannot be null." ) ; if ( log . isTraceEnabled ( ) ) { StringBuilder msg = new StringBuilder ( ) ; msg . append ( "createPathref: [layoutOwnerUsername='" ) . append ( layoutOwnerUsername ) . append ( "', dlmNoderef='" ) . append ( dlmNoderef ) . append ( "']" ) ; log . trace ( msg . toString ( ) ) ; } Pathref rslt = null ; // default ; signifies we can ' t match a node
final Matcher dlmNodeMatcher = DLM_NODE_PATTERN . matcher ( dlmNoderef ) ; if ( dlmNodeMatcher . matches ( ) ) { final int userId = Integer . valueOf ( dlmNodeMatcher . group ( 1 ) ) ; final String nodeId = dlmNodeMatcher . group ( 2 ) ; final String userName = this . userIdentityStore . getPortalUserName ( userId ) ; final Tuple < String , DistributedUserLayout > userLayoutInfo = getUserLayoutTuple ( userName , userId ) ; if ( userLayoutInfo . second == null ) { this . log . warn ( "no layout for fragment user '" + userLayoutInfo . first + "' Specified dlmNoderef " + dlmNoderef + " cannot be resolved." ) ; return null ; } final Document fragmentLayout = userLayoutInfo . second . getLayout ( ) ; final Node targetElement = this . xPathOperations . evaluate ( "//*[@ID = $nodeId]" , Collections . singletonMap ( "nodeId" , nodeId ) , fragmentLayout , XPathConstants . NODE ) ; // We can only proceed if there ' s a valid match in the document
if ( targetElement != null ) { String xpath = this . xmlUtilities . getUniqueXPath ( targetElement ) ; // Pathref objects that refer to portlets are expected to include
// the fname as the 3rd element ; other pathref objects should leave
// that element blank .
String fname = null ; Node fnameAttr = targetElement . getAttributes ( ) . getNamedItem ( "fname" ) ; if ( fnameAttr != null ) { fname = fnameAttr . getTextContent ( ) ; } rslt = new Pathref ( userLayoutInfo . first , xpath , fname ) ; } } final Matcher userNodeMatcher = USER_NODE_PATTERN . matcher ( dlmNoderef ) ; if ( userNodeMatcher . find ( ) ) { // We need a pathref based on the new style of layout b / c on
// import this users own layout will not be in the database
// when the path is computed back to an Id . . .
final String structId = userNodeMatcher . group ( 1 ) ; final org . dom4j . Node target = layout . selectSingleNode ( "//*[@ID = '" + structId + "']" ) ; if ( target == null ) { this . log . warn ( "no match found on layout for user '" + layoutOwnerUsername + "' for the specified dlmNoderef: " + dlmNoderef ) ; return null ; } String fname = null ; if ( target . getName ( ) . equals ( "channel" ) ) { fname = target . valueOf ( "@fname" ) ; } rslt = new Pathref ( layoutOwnerUsername , target . getUniquePath ( ) , fname ) ; } return rslt ;
|
public class OrderingContextProxy { /** * This method actually creates an ordering context and assigns us an ID ( given to us by the
* server ) .
* @ throws SIConnectionUnavailableException
* @ throws SIConnectionDroppedException
* @ throws SIErrorException */
public void create ( ) throws SIConnectionUnavailableException , SIConnectionDroppedException , SIErrorException { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "create" ) ; CommsByteBuffer request = getCommsByteBuffer ( ) ; request . putShort ( getConnectionObjectID ( ) ) ; CommsByteBuffer reply = null ; try { // Pass on call to server
reply = jfapExchange ( request , JFapChannelConstants . SEG_CREATE_ORDER_CONTEXT , JFapChannelConstants . PRIORITY_HIGH , true ) ; short err = reply . getCommandCompletionCode ( JFapChannelConstants . SEG_CREATE_ORDER_CONTEXT_R ) ; if ( err != CommsConstants . SI_NO_EXCEPTION ) { checkFor_SIConnectionUnavailableException ( reply , err ) ; checkFor_SIConnectionDroppedException ( reply , err ) ; checkFor_SIConnectionLostException ( reply , err ) ; checkFor_SIErrorException ( reply , err ) ; defaultChecker ( reply , err ) ; } short ocId = reply . getShort ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Created the order proxy. ID: " + ocId ) ; // Now save the id
setProxyID ( ocId ) ; } catch ( SIConnectionLostException e ) { // No FFDC Code needed
// Temporarily re - throw as dropped
throw new SIConnectionDroppedException ( "" , e ) ; } finally { if ( reply != null ) reply . release ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "create" ) ;
|
public class XpathUtils { /** * Used to optimize performance by avoiding expensive file access every time
* a DTMManager is constructed as a result of constructing a Xalan xpath
* context ! */
private static void speedUpDTMManager ( ) throws Exception { } }
|
// https : / / github . com / aws / aws - sdk - java / issues / 238
// http : / / stackoverflow . com / questions / 6340802 / java - xpath - apache - jaxp - implementation - performance
if ( System . getProperty ( DTM_MANAGER_DEFAULT_PROP_NAME ) == null ) { Class < ? > XPathContextClass = Class . forName ( XPATH_CONTEXT_CLASS_NAME ) ; Method getDTMManager = XPathContextClass . getMethod ( "getDTMManager" ) ; Object XPathContext = XPathContextClass . newInstance ( ) ; Object dtmManager = getDTMManager . invoke ( XPathContext ) ; if ( DTM_MANAGER_IMPL_CLASS_NAME . equals ( dtmManager . getClass ( ) . getName ( ) ) ) { // This would avoid the file system to be accessed every time
// the internal XPathContext is instantiated .
System . setProperty ( DTM_MANAGER_DEFAULT_PROP_NAME , DTM_MANAGER_IMPL_CLASS_NAME ) ; } }
|
public class vpnglobal_vpnintranetapplication_binding { /** * Use this API to fetch a vpnglobal _ vpnintranetapplication _ binding resources . */
public static vpnglobal_vpnintranetapplication_binding [ ] get ( nitro_service service ) throws Exception { } }
|
vpnglobal_vpnintranetapplication_binding obj = new vpnglobal_vpnintranetapplication_binding ( ) ; vpnglobal_vpnintranetapplication_binding response [ ] = ( vpnglobal_vpnintranetapplication_binding [ ] ) obj . get_resources ( service ) ; return response ;
|
public class AWSSimpleSystemsManagementClient { /** * The status of the associations for the instance ( s ) .
* @ param describeInstanceAssociationsStatusRequest
* @ return Result of the DescribeInstanceAssociationsStatus operation returned by the service .
* @ throws InternalServerErrorException
* An error occurred on the server side .
* @ throws InvalidInstanceIdException
* The following problems can cause this exception : < / p >
* You do not have permission to access the instance .
* SSM Agent is not running . On managed instances and Linux instances , verify that the SSM Agent is running .
* On EC2 Windows instances , verify that the EC2Config service is running .
* SSM Agent or EC2Config service is not registered to the SSM endpoint . Try reinstalling SSM Agent or
* EC2Config service .
* The instance is not in valid state . Valid states are : Running , Pending , Stopped , Stopping . Invalid states
* are : Shutting - down and Terminated .
* @ throws InvalidNextTokenException
* The specified token is not valid .
* @ sample AWSSimpleSystemsManagement . DescribeInstanceAssociationsStatus
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ssm - 2014-11-06 / DescribeInstanceAssociationsStatus "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public DescribeInstanceAssociationsStatusResult describeInstanceAssociationsStatus ( DescribeInstanceAssociationsStatusRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeDescribeInstanceAssociationsStatus ( request ) ;
|
public class JibxContexts { /** * Get the context holder .
* Typically you would not call this directly .
* @ param packageName
* @ param bindingName The JiBX binding name ( defaults to ' binding ' )
* @ return */
public JIBXContextHolder get ( String packageName , String bindingName ) throws JiBXException { } }
|
String version = null ; // Eventually add this to calling method params
synchronized ( this ) { JIBXContextHolder jAXBContextHolder = super . get ( packageName ) ; if ( jAXBContextHolder == null ) { if ( bindingName == null ) bindingName = DEFAULT_BINDING_NAME ; ClassLoader classLoader = null ; try { classLoader = ClassServiceUtility . getClassService ( ) . getBundleClassLoader ( packageName , version ) ; } catch ( ClassNotFoundException e ) { e . printStackTrace ( ) ; } IBindingFactory jc = BindingDirectory . getFactory ( bindingName , packageName , classLoader ) ; jAXBContextHolder = new JIBXContextHolder ( jc ) ; this . put ( packageName , jAXBContextHolder ) ; } return jAXBContextHolder ; }
|
public class DefaultConfiguration { /** * Commit the XChangeBatch control
* @ param root */
public void commit ( Object root ) { } }
|
try { XChangesBatch xUpdateControl = ( XChangesBatch ) UnoRuntime . queryInterface ( XChangesBatch . class , root ) ; xUpdateControl . commitChanges ( ) ; } catch ( WrappedTargetException e ) { e . printStackTrace ( ) ; }
|
public class BaseMessagingEngineImpl { /** * 181851 setter method for _ state - encapsulates debug of state change . */
protected final void setState ( int state ) { } }
|
String thisMethodName = "setState" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , Integer . toString ( state ) ) ; } _state = state ; // 212263 - State changes promoted from debug to info
// 227363 - Only use info for certain state changes . Other state changes
// that are less interesting to users are kept as debug only . The rationale
// for the split is as follows :
// STATE _ UNINITIALIZED = > debug , because not interesting
// STATE _ INITIALIZING = > debug , because trivial change
// STATE _ INITIALIZED = > debug , limited interest
// STATE _ JOINING = > debug , useful when DCS / HAM problems
// STATE _ JOINED = > info , because hi - lites DCS / HAM problems
// STATE _ AUTOSTARTING = > debug , not interesting
// STATE _ STARTING = > info , need to know ME is trying to start
// STATE _ STARTED = > info , essential knowledge
// STATE _ STOPPING = > info , useful indication that ME is trying
// STATE _ STOPPING _ MEMBER = > info , useful cos only state on deactivate path
// STATE _ STOPPED = > info , essential knowledge
// STATE _ DESTROYING = > debug , limited interest
// STATE _ DESTROYED = > debug , limited interest
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName ) ; }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.