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 ( ) ; builde...
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 qu...
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 ( "-reset...
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 ...
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...
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 ...
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 (...
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 sett...
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 enc...
// 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 genera...
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 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 ( taskletExecutionR...
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 ...
ServiceResponse < Page < WorkerPoolResourceInner > > response = listMultiRolePoolsNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) ; return new PagedList < WorkerPoolResourceInner > ( response . body ( ) ) { @ Override public Page < WorkerPoolResourceInner > nextPage ( String nextPageLink ) { return l...
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 ( "uncheck...
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 > > var...
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 choo...
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...
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 ( ) ) ...
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 p...
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...
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 : /...
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 <...
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 ...
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 ( PartialConvert...
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 r...
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.d...
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 * childre...
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 * @ retur...
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 ( ...
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 ; FailoverGroupInn...
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 , impor...
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 m...
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 v...
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 ...
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 sc...
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 th...
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 ( ) ) ....
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 ...
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 h...
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 . ...
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 ca...
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 formattin...
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 ( fin...
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 ( ) ) ...
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 [ ] ...
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 ,...
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 . Creativ...
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 essent...
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 . i...
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 ; updateres...
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 ...
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 ( ) ...
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 s...
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 ( notificat...
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 TableSch...
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 `...
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 <...
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 >...
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 , BadMessageFormatMatch...
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 ( conte...
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 } ...
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 ( ) ) { batchReco...
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 fire...
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 ( trea...
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 " . . " pa...
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 ...
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 ...
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 ...
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...
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 Il...
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_consumpti...
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 ++ ...
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 re...
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 anim...
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 ( gf...
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 =...
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 environme...
validateNotEmptyContent ( environmentVariables , true , "Environment variable options" ) ; final List < EnvironmentOption > options = new ArrayList < EnvironmentOption > ( ) ; for ( String environmentVariable : environmentVariables ) { options . add ( environment ( environmentVariable ) ) ; } return environment ( optio...
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 { updateSt...
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...
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 ( ...
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 SIConnectionUnavailab...
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 , JFapCh...
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_CONTEX...
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 occ...
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 = Clas...
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 st...