signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class TextUtil { /** * Translate the specified string to upper case and remove the accents . * @ param text is the text to scan . * @ param map is the translation table from an accentuated character to an * unaccentuated character . * @ return the given string without the accents and upper cased */ @ Pur...
final StringBuilder buffer = new StringBuilder ( ) ; for ( final char c : text . toCharArray ( ) ) { final String trans = map . get ( c ) ; if ( trans != null ) { buffer . append ( trans . toUpperCase ( ) ) ; } else { buffer . append ( Character . toUpperCase ( c ) ) ; } } return buffer . toString ( ) ;
public class PropertiesUtil { /** * / / / / / 读取Properties / / / / / */ public static Boolean getBoolean ( Properties p , String name , Boolean defaultValue ) { } }
return BooleanUtil . toBooleanObject ( p . getProperty ( name ) , defaultValue ) ;
public class RoleDefinitionsInner { /** * Creates or updates a role definition . * @ param scope The scope of the role definition . * @ param roleDefinitionId The ID of the role definition . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the RoleDefinit...
return createOrUpdateWithServiceResponseAsync ( scope , roleDefinitionId ) . map ( new Func1 < ServiceResponse < RoleDefinitionInner > , RoleDefinitionInner > ( ) { @ Override public RoleDefinitionInner call ( ServiceResponse < RoleDefinitionInner > response ) { return response . body ( ) ; } } ) ;
public class SemiTransactionalHiveMetastore { /** * { @ code currentLocation } needs to be supplied if a writePath exists for the table . */ public synchronized void createTable ( ConnectorSession session , Table table , PrincipalPrivileges principalPrivileges , Optional < Path > currentPath , boolean ignoreExisting , ...
setShared ( ) ; // When creating a table , it should never have partition actions . This is just a sanity check . checkNoPartitionAction ( table . getDatabaseName ( ) , table . getTableName ( ) ) ; SchemaTableName schemaTableName = new SchemaTableName ( table . getDatabaseName ( ) , table . getTableName ( ) ) ; Action ...
public class ExpressRouteGatewaysInner { /** * Lists ExpressRoute gateways in a given resource group . * @ param resourceGroupName The name of the resource group . * @ return the observable to the List & lt ; ExpressRouteGatewayInner & gt ; object */ public Observable < Page < ExpressRouteGatewayInner > > listByRes...
return listByResourceGroupWithServiceResponseAsync ( resourceGroupName ) . map ( new Func1 < ServiceResponse < List < ExpressRouteGatewayInner > > , Page < ExpressRouteGatewayInner > > ( ) { @ Override public Page < ExpressRouteGatewayInner > call ( ServiceResponse < List < ExpressRouteGatewayInner > > response ) { Pag...
public class Configuration { /** * - - - - - CLIENT PROPERTIES - - - - - */ private HostInfo getClientHost ( ) { } }
String host = AppProperties . get ( SSRKeys . SSR_CLIENT_HOST ) . orElse ( null ) ; if ( isEmpty ( host ) ) { logger . info ( "Client host not provided using '{}' to discover host address" , discovery . getClass ( ) . getSimpleName ( ) ) ; return discovery . resolveHost ( ) ; } else { logger . info ( "Client host provi...
public class Response { /** * 设置响应的Header * @ param name 名 * @ param value 值 , 可以是String , Date , int */ public static void setHeader ( String name , Object value ) { } }
ServletUtil . setHeader ( getServletResponse ( ) , name , value ) ;
public class ReflectionUtils { /** * Looks up a constructor that is explicitly identified . This method should only * be used for constructors that definitely exist . It does not throw the checked * NoSuchMethodException . If the constructor does not exist , it will instead fail * with an unchecked IllegalArgumen...
try { return aClass . getConstructor ( paramTypes ) ; } catch ( NoSuchMethodException ex ) { // This cannot happen if the method is correctly identified . throw new IllegalArgumentException ( "Specified constructor does not exist in class " + aClass . getName ( ) , ex ) ; }
public class MisoScenePanel { /** * Reports the memory usage of the resolved tiles in the current scene block . */ public void reportMemoryUsage ( ) { } }
Map < Tile . Key , BaseTile > base = Maps . newHashMap ( ) ; Set < BaseTile > fringe = Sets . newHashSet ( ) ; Map < Tile . Key , ObjectTile > object = Maps . newHashMap ( ) ; long [ ] usage = new long [ 3 ] ; for ( SceneBlock block : _blocks . values ( ) ) { block . computeMemoryUsage ( base , fringe , object , usage ...
public class CronDefinitionBuilder { /** * Registers a certain FieldDefinition . * @ param definition - FieldDefinition instance , never null */ public void register ( final FieldDefinition definition ) { } }
// ensure that we can ' t register a mandatory definition if there are already optional ones boolean hasOptionalField = false ; for ( final FieldDefinition fieldDefinition : fields . values ( ) ) { if ( fieldDefinition . isOptional ( ) ) { hasOptionalField = true ; break ; } } if ( ! definition . isOptional ( ) && hasO...
public class MacUtils { /** * Return a 6 byte array where each byte represents a value in the MAC * address of the first valid interface found or an * { @ link UnsupportedOperationException } is thrown if an error occurs . */ public static byte [ ] realMacAddress ( ) { } }
byte [ ] mac = null ; try { // enumerations are wonky . . . Enumeration < NetworkInterface > networkInterfaces = getNetworkInterfaces ( ) ; while ( networkInterfaces . hasMoreElements ( ) ) { NetworkInterface n = networkInterfaces . nextElement ( ) ; byte [ ] possibleMac = n . getHardwareAddress ( ) ; if ( possibleMac ...
public class CommerceNotificationTemplateUtil { /** * Returns the commerce notification template where uuid = & # 63 ; and groupId = & # 63 ; or returns < code > null < / code > if it could not be found , optionally using the finder cache . * @ param uuid the uuid * @ param groupId the group ID * @ param retrieve...
return getPersistence ( ) . fetchByUUID_G ( uuid , groupId , retrieveFromCache ) ;
public class Font { /** * Translates a < CODE > String < / CODE > - value of a certain family into the * index that is used for this family in this class . * @ param family * A < CODE > String < / CODE > representing a certain font - family * @ return the corresponding index */ public static int getFamilyIndex ...
if ( family . equalsIgnoreCase ( FontFactory . COURIER ) ) { return COURIER ; } if ( family . equalsIgnoreCase ( FontFactory . HELVETICA ) ) { return HELVETICA ; } if ( family . equalsIgnoreCase ( FontFactory . TIMES_ROMAN ) ) { return TIMES_ROMAN ; } if ( family . equalsIgnoreCase ( FontFactory . SYMBOL ) ) { return S...
public class VoltFile { /** * Merge one directory into another via copying . Useful for simulating * node removal or files being moved from node to node or duplicated . */ public static void moveSubRootContents ( File fromSubRoot , File toSubRoot ) throws IOException { } }
assert ( fromSubRoot . exists ( ) && fromSubRoot . isDirectory ( ) ) ; assert ( toSubRoot . exists ( ) && toSubRoot . isDirectory ( ) ) ; for ( File file : fromSubRoot . listFiles ( ) ) { File fInOtherSubroot = new File ( toSubRoot , file . getName ( ) ) ; if ( file . isDirectory ( ) ) { if ( ! fInOtherSubroot . exists...
public class lbwlm { /** * Use this API to fetch all the lbwlm resources that are configured on netscaler . */ public static lbwlm [ ] get ( nitro_service service , options option ) throws Exception { } }
lbwlm obj = new lbwlm ( ) ; lbwlm [ ] response = ( lbwlm [ ] ) obj . get_resources ( service , option ) ; return response ;
public class Consumers { /** * Yields nth ( 1 - based ) element of the iterable . * @ param < E > the iterable element type * @ param count the element cardinality * @ param iterable the iterable that will be consumed * @ return the nth element */ public static < E > E nth ( long count , Iterable < E > iterable...
dbc . precondition ( iterable != null , "cannot call nth with a null iterable" ) ; final Iterator < E > filtered = new FilteringIterator < E > ( iterable . iterator ( ) , new Nth < E > ( count ) ) ; return new FirstElement < E > ( ) . apply ( filtered ) ;
public class CommsInboundChain { /** * ( non - Javadoc ) * @ see com . ibm . wsspi . channelfw . ChainEventListener # chainStopped ( com . ibm . websphere . channelfw . ChainData ) */ @ Override public void chainStopped ( ChainData chainData ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "chainStopped" , chainData ) ; chainState . set ( ChainState . STOPPED . val ) ; // Wake up anything waiting for the chain to stop // ( see the update method for one example ) stopWait . notifyStopped ( ) ; if ( TraceCompone...
public class FnJodaTimeUtils { /** * It creates an { @ link Interval } from the input { @ link Calendar } targets used as the start and end . * The { @ link Interval } will be created with the given { @ link Chronology } * @ param chronology { @ link Chronology } to be used * @ return the { @ link Interval } crea...
return FnInterval . calendarFieldCollectionToInterval ( chronology ) ;
public class DescribeVTLDevicesResult { /** * An array of VTL device objects composed of the Amazon Resource Name ( ARN ) of the VTL devices . * @ param vTLDevices * An array of VTL device objects composed of the Amazon Resource Name ( ARN ) of the VTL devices . */ public void setVTLDevices ( java . util . Collecti...
if ( vTLDevices == null ) { this . vTLDevices = null ; return ; } this . vTLDevices = new com . amazonaws . internal . SdkInternalList < VTLDevice > ( vTLDevices ) ;
public class ExtensionList { /** * Write access will put the instance into a legacy store . * @ deprecated since 2009-02-23. * Prefer automatic registration . */ @ Override @ Deprecated public boolean add ( T t ) { } }
try { return addSync ( t ) ; } finally { if ( extensions != null ) { fireOnChangeListeners ( ) ; } }
public class Collections { /** * Returns a dynamically typesafe view of the specified sorted set . * Any attempt to insert an element of the wrong type will result in an * immediate { @ link ClassCastException } . Assuming a sorted set * contains no incorrectly typed elements prior to the time a * dynamically t...
return new CheckedSortedSet < > ( s , type ) ;
public class JMXRESTProxyServlet { /** * For any request URL other than the context root , delegate to the * appropriate handler . If no handler is available , a 404 will be set * into the response . * @ param request * @ param response * @ param pathInfo * @ throws IOException */ private void handleWithDel...
// Delegate to handler boolean foundHandler = REST_HANDLER_CONTAINER . handleRequest ( new ServletRESTRequestImpl ( request ) , new ServletRESTResponseImpl ( response ) ) ; if ( ! foundHandler ) { // No handler found , so we send back a 404 " not found " response . String errorMsg = TraceNLS . getFormattedMessage ( thi...
public class ReplicatedHashMap { /** * Removes all of the mappings from this map . */ public void clear ( ) { } }
try { MethodCall call = new MethodCall ( CLEAR ) ; disp . callRemoteMethods ( null , call , call_options ) ; } catch ( Exception e ) { throw new RuntimeException ( "clear() failed" , e ) ; }
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcCivilElement ( ) { } }
if ( ifcCivilElementEClass == null ) { ifcCivilElementEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 94 ) ; } return ifcCivilElementEClass ;
public class MarshallableTypeHints { /** * Get the serialized form size predictor for a particular type . * @ param type Marshallable type for which serialized form size will be predicted * @ return an instance of { @ link BufferSizePredictor } */ public BufferSizePredictor getBufferSizePredictor ( Class < ? > type...
MarshallingType marshallingType = typeHints . get ( type ) ; if ( marshallingType == null ) { // Initialise with isMarshallable to null , meaning it ' s unknown marshallingType = new MarshallingType ( null , new AdaptiveBufferSizePredictor ( ) ) ; MarshallingType prev = typeHints . putIfAbsent ( type , marshallingType ...
public class RedisClient { /** * Returns encoded bytes . * @ param name * field name . * @ return encoded byte array . */ byte [ ] getEncodedBytes ( final String name ) { } }
try { if ( name != null ) { return name . getBytes ( Constants . CHARSET_UTF8 ) ; } } catch ( UnsupportedEncodingException e ) { logger . error ( "Error during persist, Caused by:" , e ) ; throw new PersistenceException ( e ) ; } return null ;
public class ConformerContainer { /** * Returns the lowest index at which the specific IAtomContainer appears in the list or - 1 if is not found . * A given IAtomContainer will occur in the list if the title matches the stored title for * the conformers in this container and if the coordinates for each atom in the ...
IAtomContainer atomContainer = ( IAtomContainer ) o ; if ( ! atomContainer . getTitle ( ) . equals ( title ) ) return - 1 ; if ( atomContainer . getAtomCount ( ) != this . atomContainer . getAtomCount ( ) ) return - 1 ; boolean coordsMatch ; int index = 0 ; for ( Point3d [ ] coords : coordinates ) { coordsMatch = true ...
public class PostgreSqlRepositoryCollection { /** * Updates database column based on attribute changes . * @ param entityType entity meta data * @ param attr current attribute * @ param updatedAttr updated attribute */ private void updateColumn ( EntityType entityType , Attribute attr , Attribute updatedAttr ) { ...
// nullable changes if ( ! Objects . equals ( attr . isNillable ( ) , updatedAttr . isNillable ( ) ) ) { updateNillable ( entityType , attr , updatedAttr ) ; } // unique changes if ( ! Objects . equals ( attr . isUnique ( ) , updatedAttr . isUnique ( ) ) ) { updateUnique ( entityType , attr , updatedAttr ) ; } // reado...
public class FJIterate { /** * Same effect as { @ link Iterate # collect ( Iterable , Function ) } , but executed in parallel batches , * and with potentially reordered result . * @ param allowReorderedResult If the result can be in a different order . * Allowing reordering may yield faster execution . * @ retu...
return FJIterate . collect ( iterable , function , null , allowReorderedResult ) ;
public class Mutator { /** * Creates a superset of the input Schema , taking all the Fields in the input schema * and adding some new ones . The new fields are fully specified in a Field class . * The name of the schema is auto - generated with a static counter . */ public static Schema superSetOf ( Schema schema ,...
return superSetOf ( "superSetSchema" + ( COUNTER ++ ) , schema , newFields ) ;
public class CacheCore { /** * compatible with heron : : tmaster : : TMetricsCollector * @ param metrics The metrics to be added */ public void addMetricException ( TopologyMaster . PublishMetrics metrics ) { } }
synchronized ( CacheCore . class ) { for ( TopologyMaster . MetricDatum metricDatum : metrics . getMetricsList ( ) ) { addMetric ( metricDatum ) ; } for ( TopologyMaster . TmasterExceptionLog exceptionLog : metrics . getExceptionsList ( ) ) { addException ( exceptionLog ) ; } }
public class EnumLookup { /** * Finds the given ID and returns the corresponding enumerate value */ public K find ( final V id ) { } }
final V keyValue = keyForValue ( id ) ; if ( inverse . containsKey ( keyValue ) ) { return inverse . get ( keyValue ) ; } if ( log . isDebugEnabled ( ) ) { log . debug ( "Enum with value " + id + " not found" ) ; } return null ;
public class CommonOps_DDF2 { /** * Performs an in - place element by element scalar division . Scalar denominator . < br > * < br > * a < sub > ij < / sub > = a < sub > ij < / sub > / & alpha ; * @ param a The matrix whose elements are to be divided . Modified . * @ param alpha the amount each element is divid...
a . a11 /= alpha ; a . a12 /= alpha ; a . a21 /= alpha ; a . a22 /= alpha ;
public class XmlStringBuilder { /** * Add the given attribute if { @ code value = > 0 } . * @ param name * @ param value * @ return a reference to this object */ public XmlStringBuilder optIntAttribute ( String name , int value ) { } }
if ( value >= 0 ) { attribute ( name , Integer . toString ( value ) ) ; } return this ;
public class DOValidatorModule { /** * Validates a digital object . * @ param objectAsFile * The digital object provided as a file . * @ param validationType * The level of validation to perform on the digital object . This is * an integer from 0-2 with the following meanings : 0 = VALIDATE _ ALL * ( do all...
dov . validate ( objectAsFile , format , validationType , phase ) ;
public class PlatformDeviceMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PlatformDevice platformDevice , ProtocolMarshaller protocolMarshaller ) { } }
if ( platformDevice == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( platformDevice . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( platformDevice . getType ( ) , TYPE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientE...
public class UnilateralSortMerger { @ Override public MutableObjectIterator < E > getIterator ( ) throws InterruptedException { } }
synchronized ( this . iteratorLock ) { // wait while both the iterator and the exception are not set while ( this . iterator == null && this . iteratorException == null ) { this . iteratorLock . wait ( ) ; } if ( this . iteratorException != null ) { throw new RuntimeException ( "Error obtaining the sorted input: " + th...
public class AgentsClient { /** * Exports the specified agent to a ZIP file . * < p > Operation & lt ; response : * [ ExportAgentResponse ] [ google . cloud . dialogflow . v2 . ExportAgentResponse ] & gt ; * < p > Sample code : * < pre > < code > * try ( AgentsClient agentsClient = AgentsClient . create ( ) )...
ExportAgentRequest request = ExportAgentRequest . newBuilder ( ) . setParent ( parent ) . build ( ) ; return exportAgentAsync ( request ) ;
public class StringUtil { /** * 如果字符串是 < code > null < / code > 或空字符串 < code > " " < / code > , 则返回指定默认字符串 , 否则返回字符串本身 。 * < pre > * StringUtil . defaultIfEmpty ( null , " default " ) = " default " * StringUtil . defaultIfEmpty ( " " , " default " ) = " default " * StringUtil . defaultIfEmpty ( " " , " default ...
return str == null || str . length ( ) == 0 ? defaultStr : str ;
public class MessageFormat { /** * < strong > [ icu ] < / strong > Parses text from the beginning of the given string to produce a map from * argument to values . The method may not use the entire text of the given string . * < p > See the { @ link # parse ( String , ParsePosition ) } method for more information on...
ParsePosition pos = new ParsePosition ( 0 ) ; Map < String , Object > result = new HashMap < String , Object > ( ) ; parse ( 0 , source , pos , null , result ) ; if ( pos . getIndex ( ) == 0 ) // unchanged , returned object is null throw new ParseException ( "MessageFormat parse error!" , pos . getErrorIndex ( ) ) ; re...
public class RegistryManagerImpl { /** * Imports a new service within iServe . The original document is stored * in the server and the transformed version registered within iServe . * @ param servicesContentStream * @ param mediaType * @ return the List of URIs of the services imported * @ throws SalException...
boolean isNativeFormat = MediaType . NATIVE_MEDIATYPE_SYNTAX_MAP . containsKey ( mediaType ) ; // Throw error if Format Unsupported if ( ! isNativeFormat && ! this . serviceTransformationEngine . canTransform ( mediaType ) ) { log . error ( "The media type {} is not natively supported and has no suitable transformer." ...
public class Tsurgeon { /** * Parses a tsurgeon script text input and compiles a tregex pattern and a list * of tsurgeon operations into a pair . * @ param reader Reader to read patterns from * @ return A pair of a tregex and tsurgeon pattern read from a file , or < code > null < / code > * when the operations ...
String patternString = getPatternFromFile ( reader ) ; // System . err . println ( " Read tregex pattern : " + patternString ) ; if ( "" . equals ( patternString ) ) { return null ; } TregexPattern matchPattern = compiler . compile ( patternString ) ; TsurgeonPattern collectedPattern = getTsurgeonOperationsFromReader (...
public class ArrayUtil { /** * find a object in array * @ param array * @ param object object to find * @ return position in array or 0 */ public static int find ( Array array , Object object ) { } }
int len = array . size ( ) ; for ( int i = 1 ; i <= len ; i ++ ) { Object tmp = array . get ( i , null ) ; try { if ( tmp != null && Operator . compare ( object , tmp ) == 0 ) return i ; } catch ( PageException e ) { } } return 0 ;
public class FloatingLabelInstantPicker { /** * Refreshes the widget state when the selection changes */ protected void onSelectedInstantChanged ( ) { } }
if ( selectedInstant == null ) { getInputWidget ( ) . setText ( "" ) ; anchorLabel ( ) ; } else { getInputWidget ( ) . setText ( getInstantPrinter ( ) . print ( selectedInstant ) ) ; floatLabel ( ) ; } if ( instantPickerListener != null ) instantPickerListener . onInstantChanged ( this , selectedInstant ) ;
public class JobConf { /** * Get the value class for the map output data . If it is not set , use the * ( final ) output value class This allows the map output value class to be * different than the final output value class . * @ return the map output value class . */ public Class < ? > getMapOutputValueClass ( )...
Class < ? > retv = getClass ( "mapred.mapoutput.value.class" , null , Object . class ) ; if ( retv == null ) { retv = getOutputValueClass ( ) ; } return retv ;
public class BlobServicesInner { /** * Gets the properties of a storage account ’ s Blob service , including properties for Storage Analytics and CORS ( Cross - Origin Resource Sharing ) rules . * @ param resourceGroupName The name of the resource group within the user ' s subscription . The name is case insensitive ...
return ServiceFuture . fromResponse ( getServicePropertiesWithServiceResponseAsync ( resourceGroupName , accountName ) , serviceCallback ) ;
public class JBBPUtils { /** * Reverse order of bytes in a byte array . * @ param nullableArrayToBeInverted a byte array which order must be reversed , * it can be null * @ return the same array instance but with reversed byte order , null if the * source array is null * @ since 1.1 */ public static byte [ ] ...
if ( nullableArrayToBeInverted != null && nullableArrayToBeInverted . length > 0 ) { int indexStart = 0 ; int indexEnd = nullableArrayToBeInverted . length - 1 ; while ( indexStart < indexEnd ) { final byte a = nullableArrayToBeInverted [ indexStart ] ; nullableArrayToBeInverted [ indexStart ] = nullableArrayToBeInvert...
public class JSDocInfo { /** * Get the message for a given thrown type . */ public String getThrowsDescriptionForType ( JSTypeExpression type ) { } }
if ( documentation == null || documentation . throwsDescriptions == null ) { return null ; } return documentation . throwsDescriptions . get ( type ) ;
public class WorldMapTileSkin { /** * * * * * * Initialization * * * * * */ @ Override protected void initGraphics ( ) { } }
super . initGraphics ( ) ; poiLocations = FXCollections . observableHashMap ( ) ; chartDataLocations = FXCollections . observableHashMap ( ) ; handlerMap = new HashMap < > ( ) ; circleHandlerMap = new HashMap < > ( ) ; countryPaths = tile . getCountryPaths ( ) ; String formatString = new StringBuilder ( "%." ) . append...
public class PeasyViewHolder { /** * Static method to help inflate parent view with layoutId * @ param inflater inflater * @ param parent parent * @ param layoutId layoutId * @ return View */ public static View inflateView ( LayoutInflater inflater , ViewGroup parent , int layoutId ) { } }
return inflater . inflate ( layoutId , parent , false ) ;
public class AsyncConnection { /** * 创建TCP协议客户端连接 * @ param context Context * @ param address 连接点子 * @ param group 连接AsynchronousChannelGroup * @ param readTimeoutSeconds 读取超时秒数 * @ param writeTimeoutSeconds 写入超时秒数 * @ return 连接CompletableFuture */ public static CompletableFuture < AsyncConnection > createT...
return createTCP ( context . getBufferSupplier ( ) , context . getBufferConsumer ( ) , group , context . getSSLContext ( ) , address , readTimeoutSeconds , writeTimeoutSeconds ) ;
public class AbstractRequest { /** * 执行http请求 * @ param getMethod * @ return * @ throws IOException */ @ SuppressWarnings ( "deprecation" ) private final HttpResponse executeHttpRequest ( HttpGet getMethod , String host ) throws Exception { } }
SSLContext sslContext = SSLContexts . custom ( ) . loadTrustMaterial ( null , new TrustStrategy ( ) { @ Override public boolean isTrusted ( X509Certificate [ ] arg0 , String arg1 ) throws CertificateException { return true ; } } ) . build ( ) ; SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory ( sslCont...
public class Handler { /** * Generic method that would allow registration of any properly placed { @ code Handler } class . */ static void register ( Class < ? extends URLStreamHandler > handlerClass ) { } }
checkArgument ( "Handler" . equals ( handlerClass . getSimpleName ( ) ) ) ; String pkg = handlerClass . getPackage ( ) . getName ( ) ; int lastDot = pkg . lastIndexOf ( '.' ) ; checkArgument ( lastDot > 0 , "package for Handler (%s) must have a parent package" , pkg ) ; String parentPackage = pkg . substring ( 0 , last...
public class PresentsDObjectMgr { /** * Sets up an access controller that will be provided to any distributed objects created on the * server . The controllers can subsequently be overridden if desired , but a default controller * is useful for implementing basic access control policies . */ public void setDefaultA...
AccessController oldDefault = _defaultController ; _defaultController = controller ; // switch all objects from the old default ( null , usually ) to the new default . for ( DObject obj : _objects . values ( ) ) { if ( oldDefault == obj . getAccessController ( ) ) { obj . setAccessController ( controller ) ; } }
public class MassToFormulaTool { /** * Put the order the List of IIsotope according the probability occurrence . * @ param isotopes _ TO The List of IIsotope * @ return The list of IIsotope ordered */ private List < IIsotope > orderList ( List < IIsotope > isotopes_TO ) { } }
List < IIsotope > newOrderList = new ArrayList < IIsotope > ( ) ; for ( int i = 0 ; i < orderElements . length ; i ++ ) { String symbol = orderElements [ i ] ; Iterator < IIsotope > itIso = isotopes_TO . iterator ( ) ; while ( itIso . hasNext ( ) ) { IIsotope isotopeToCo = itIso . next ( ) ; if ( isotopeToCo . getSymbo...
public class DummyInternalTransaction { /** * ( non - Javadoc ) * @ see com . ibm . ws . objectManager . InternalTransaction # optimisticReplace ( java . util . List , java . util . List , java . util . List , java . util . List , com . ibm . ws . objectManager . Transaction , * long ) */ protected synchronized voi...
throw new InvalidStateException ( this , InternalTransaction . stateTerminated , InternalTransaction . stateNames [ InternalTransaction . stateTerminated ] ) ;
public class UDPChannel { /** * @ see * com . ibm . wsspi . channelfw . Channel # getConnectionLink ( com . ibm . wsspi . channelfw * . VirtualConnection ) */ public ConnectionLink getConnectionLink ( VirtualConnection vc ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( this , tc , "getConnectionLink" ) ; } UDPConnLink connLink = new UDPConnLink ( workQueueManager , vc , this , getConfig ( ) ) ; // add connection to inUse LinkedList synchronized ( inUse ) { inUse . add ( connLink ) ; } if ( Trace...
public class Iterables { /** * Creates a iterator from given iterable . * @ param iterable the iterable * @ return a iterator */ @ SuppressWarnings ( "unchecked" ) public static Iterator < Object > iterator ( Object iterable ) { } }
Assert . state ( isIterable ( iterable . getClass ( ) ) ) ; return iterable . getClass ( ) . isArray ( ) ? new ArrayIterator ( iterable ) : ( ( Iterable < Object > ) iterable ) . iterator ( ) ;
public class ClassUtil { /** * Writes a class ' bytecode to an < code > OutputStream < / code > . * @ param cl The < code > Class < / code > to write . * @ param out The < code > OutputStream < / code > to write to . * @ throws IOException If unable to write to < code > out < / code > . */ public static void writ...
InputStream in = getClassAsStream ( cl ) ; StreamUtil . writeStream ( in , out ) ; out . flush ( ) ;
public class CPAttachmentFileEntryPersistenceImpl { /** * Returns the cp attachment file entries before and after the current cp attachment file entry in the ordered set where classNameId = & # 63 ; and classPK = & # 63 ; and type = & # 63 ; and status = & # 63 ; . * @ param CPAttachmentFileEntryId the primary key of...
CPAttachmentFileEntry cpAttachmentFileEntry = findByPrimaryKey ( CPAttachmentFileEntryId ) ; Session session = null ; try { session = openSession ( ) ; CPAttachmentFileEntry [ ] array = new CPAttachmentFileEntryImpl [ 3 ] ; array [ 0 ] = getByC_C_T_ST_PrevAndNext ( session , cpAttachmentFileEntry , classNameId , classP...
public class VecUtils { /** * Create a new { @ link Vec } of categorical values from an existing { @ link Vec } . * This method accepts all { @ link Vec } types as input . The original Vec is not mutated . * If src is a categorical { @ link Vec } , a copy is returned . * If src is a numeric { @ link Vec } , the v...
switch ( src . get_type ( ) ) { case Vec . T_CAT : return src . makeCopy ( src . domain ( ) ) ; case Vec . T_NUM : return numericToCategorical ( src ) ; case Vec . T_STR : // PUBDEV - 2204 return stringToCategorical ( src ) ; case Vec . T_TIME : // PUBDEV - 2205 throw new H2OIllegalArgumentException ( "Changing time/da...
public class RootResource { /** * ~ Methods * * * * * */ @ Override public List < Class < ? extends AbstractResource > > getEndpoints ( ) { } }
List < Class < ? extends AbstractResource > > result = new LinkedList < > ( ) ; result . add ( AuditResources . class ) ; result . add ( AuthResources . class ) ; result . add ( AuthResourcesV2 . class ) ; result . add ( AlertResources . class ) ; result . add ( AnnotationResources . class ) ; result . add ( Collection...
public class EntityClass { /** * Factory method . * @ param clazz * the class to wrap * @ param scanOption * whether consider optional OneToOne as required * @ return a wrapper for the entity class */ public static EntityClass from ( final Class clazz , final ScanOption scanOption ) { } }
try { return CACHE . get ( CacheKey . of ( clazz , scanOption ) , new Callable < EntityClass > ( ) { @ Override public EntityClass call ( ) throws Exception { return createEntityClass ( clazz , scanOption ) ; } } ) ; } catch ( ExecutionException e ) { throw Throwables . propagate ( e ) ; }
public class AuthorizedList { /** * Adds a compartment that the user should be allowed to access * @ param theCompartment The compartment name , e . g . " Patient / 123 " ( in this example the user would be allowed to access Patient / 123 as well as Observations where Observation . subject = " Patient / 123 " m , etc...
Validate . notNull ( theCompartment , "theCompartment must not be null" ) ; if ( myAllowedCompartments == null ) { myAllowedCompartments = new ArrayList < > ( ) ; } myAllowedCompartments . add ( theCompartment ) ; return this ;
public class Pool { public void dump ( String msg ) { } }
StringBuffer pond = new StringBuffer ( ) ; StringBuffer avail = new StringBuffer ( ) ; StringBuffer index = new StringBuffer ( ) ; pond . append ( "pond: " ) ; avail . append ( "avail:" ) ; index . append ( "index:" ) ; for ( int i = 0 ; i < _pondLife . length ; i ++ ) { if ( _pondLife [ i ] == null ) pond . append ( "...
public class CmsGalleryController { /** * Looks for an ancestor tree entry for the given path . < p > * @ param possibleParent the possible parent entry * @ param targetPath the target path * @ return the parent entry or < code > null < / code > if there is none */ private CmsGalleryTreeEntry lookForParent ( CmsG...
if ( targetPath . startsWith ( possibleParent . getPath ( ) ) ) { return possibleParent ; } if ( possibleParent . getParent ( ) != null ) { return lookForParent ( possibleParent . getParent ( ) , targetPath ) ; } return null ;
public class Link { /** * This version returns the next physical link ( which may be logically * unlinked ) * @ return the next link object or null if nothing left in the list to return */ public final Link getNextPhysicalLink ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "getNextPhysicalLink" , _positionString ( ) ) ; } Link nextLink = _nextLink ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( this , tc , "getNextPhysicalLink" , nextLink ...
public class LObjDblPredicateBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */ @ Nonnull public static < T > LObjDblPredicate < T > objDblPredicateFrom ( Consumer < LObjDblPredicateBuilder < T > > buildingFunction ...
LObjDblPredicateBuilder builder = new LObjDblPredicateBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ;
public class QueryBuilder { /** * Like { @ link # join ( QueryBuilder ) } but this combines the WHERE statements of two query builders with a SQL " OR " . */ public QueryBuilder < T , ID > joinOr ( QueryBuilder < ? , ? > joinedQueryBuilder ) throws SQLException { } }
addJoinInfo ( JoinType . INNER , null , null , joinedQueryBuilder , JoinWhereOperation . OR ) ; return this ;
public class Cpe { /** * This does not follow the spec precisely because ANY compared to NA is * classified as undefined by the spec ; however , in this implementation ANY * will match NA and return true . * This will compare the left value to the right value and return true if * the left matches the right . No...
if ( left == right ) { return true ; } else if ( left == Part . ANY ) { return true ; } return false ;
public class ExecutorCommand { /** * Invokes runnable asynchronously with respecting circuit logic and cache * logic if configured . If callable completed with success then the * { @ code onSuccess } method is called . If callable throws exception then * { @ code onFailure } method is called * @ param < V > typ...
service . executeAsynchronously ( wrap ( callable , onSuccess , onFailure ) , config ) ;
public class ViewDragHelper { /** * Check if this event as provided to the parent view ' s * onInterceptTouchEvent should cause the parent to intercept the touch * event stream . * @ param ev MotionEvent provided to onInterceptTouchEvent * @ return true if the parent view should return true from * onIntercept...
final int action = MotionEventCompat . getActionMasked ( ev ) ; final int actionIndex = MotionEventCompat . getActionIndex ( ev ) ; if ( action == MotionEvent . ACTION_DOWN ) { // Reset things for a new event stream , just in case we didn ' t get // the whole previous stream . cancel ( ) ; } if ( mVelocityTracker == nu...
public class DeliveryDelayManager { /** * Remove the DeliveryDelayable reference from the DeliveryDelay index . This will remove the * current entry pointed - to by the iterator . * @ param deliveryDelayableReference our reference to the DeliveryDelayable * @ param unlocked true if the item is being removed after...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "remove" , " deliveryDelayableReference=" + deliveryDelayableReference + " unlocked=" + unlocked + " deliveryDelayIndex=" + deliveryDelayIndex . size ( ) ) ; boolean reply = false ; // synchronize on the lockObject sy...
public class MessageBuilder { /** * Creates a JOIN message . * @ return a protobuf message . */ public static Message buildJoin ( Zxid lastZxid ) { } }
ZabMessage . Zxid zxid = toProtoZxid ( lastZxid ) ; ZabMessage . Join join = ZabMessage . Join . newBuilder ( ) . setLastZxid ( zxid ) . build ( ) ; return Message . newBuilder ( ) . setType ( MessageType . JOIN ) . setJoin ( join ) . build ( ) ;
public class Iconics { /** * Test if the icon exists in the currently loaded fonts * @ param context A context to access application resources * @ param icon The icon to verify * @ return true if the icon is available */ public static boolean iconExists ( @ NonNull Context context , @ NonNull String icon ) { } }
try { ITypeface font = findFont ( context , icon . substring ( 0 , 3 ) ) ; icon = icon . replace ( "-" , "_" ) ; font . getIcon ( icon ) ; return true ; } catch ( Exception ignore ) { return false ; }
public class MalisisRegistry { /** * Registers a { @ link IRenderWorldLast } . * @ param renderer the renderer */ @ SideOnly ( Side . CLIENT ) public static void registerRenderWorldLast ( IRenderWorldLast renderer ) { } }
clientRegistry . renderWorldLastRenderers . add ( renderer ) ;
public class ChainReducer { /** * Chains the < code > reduce ( . . . ) < / code > method of the Reducer with the * < code > map ( . . . ) < / code > methods of the Mappers in the chain . */ @ SuppressWarnings ( { } }
"unchecked" } ) public void reduce ( Object key , Iterator values , OutputCollector output , Reporter reporter ) throws IOException { Reducer reducer = chain . getReducer ( ) ; if ( reducer != null ) { reducer . reduce ( key , values , chain . getReducerCollector ( output , reporter ) , reporter ) ; }
public class NumberBindings { /** * A boolean binding that is ` true ` if the given observable double is * * Infinite * * . * See { @ link Double # isInfinite ( double ) } . * @ param observableValue the observable double value to use for the binding . * @ return the boolean binding . */ public static BooleanBind...
return Bindings . createBooleanBinding ( ( ) -> Double . isInfinite ( observableValue . get ( ) ) , observableValue ) ;
public class TargetController { /** * Creates a Deployer { @ link Target } . * @ param params the body of the request with the template parameters that will be used to create the target . The body must * contain at least a { @ code env } and { @ code site _ name } parameter . Other required parameters depend on the...
String env = "" ; String siteName = "" ; boolean replace = false ; String templateName = "" ; Map < String , Object > templateParams = new HashMap < > ( ) ; for ( Map . Entry < String , Object > param : params . entrySet ( ) ) { switch ( param . getKey ( ) ) { case ENV_PATH_VAR_NAME : env = Objects . toString ( param ....
public class DeltaFIFO { /** * Add Sync delta . Caller must hold the lock . */ private void syncKeyLocked ( String key ) { } }
ApiType obj = this . knownObjects . getByKey ( key ) ; if ( obj == null ) { return ; } String id = this . keyOf ( obj ) ; Deque < MutablePair < DeltaType , Object > > deltas = this . items . get ( id ) ; if ( deltas != null && ! ( Collections . isEmptyCollection ( deltas ) ) ) { return ; } this . queueActionLocked ( De...
public class CSSFactory { /** * Returns the registered DeclarationTransformer * @ return DeclarationTransformer instance */ public static final DeclarationTransformer getDeclarationTransformer ( ) { } }
if ( dt == null ) { try { @ SuppressWarnings ( "unchecked" ) Class < ? extends DeclarationTransformerImpl > clazz = ( Class < ? extends DeclarationTransformerImpl > ) Class . forName ( DEFAULT_DECLARATION_TRANSFORMER ) ; Method m = clazz . getMethod ( "getInstance" ) ; registerDeclarationTransformer ( ( DeclarationTran...
public class CudaGridExecutioner { /** * This method checks , if opA and opB are sharing the same operands * @ param opA * @ param opB * @ return */ protected boolean isMatchingZX ( Op opA , Op opB ) { } }
if ( opA . x ( ) == opB . x ( ) && opA . z ( ) == opB . z ( ) && opA . x ( ) == opB . z ( ) ) return true ; return false ;
public class ModelsImpl { /** * Gets information about the application version ' s Pattern . Any model . * @ param appId The application ID . * @ param versionId The version ID . * @ param entityId The entity extractor ID . * @ param serviceCallback the async ServiceCallback to handle successful and failed resp...
return ServiceFuture . fromResponse ( getPatternAnyEntityInfoWithServiceResponseAsync ( appId , versionId , entityId ) , serviceCallback ) ;
public class CharacterSet { /** * Creates a new CharacterSet . If there is already a CharacterSet with the given ID this will be * returned . */ public static CharacterSet createCharacterSet ( final String encoding , final String goodExpression , final String badExpression , final String characterSetId ) throws Unsup...
if ( characterSets . get ( ) . containsKey ( characterSetId ) ) { LOG . info ( "CharacterSet with id=" + characterSetId + " already created" ) ; return characterSets . get ( ) . get ( characterSetId ) ; } CharacterSet cs = new CharacterSet ( encoding , goodExpression , badExpression , characterSetId ) ; characterSets ....
public class ODataEntityProvider { /** * ( non - Javadoc ) * @ see javax . ws . rs . ext . MessageBodyReader # isReadable ( java . lang . Class , * java . lang . reflect . Type , java . lang . annotation . Annotation [ ] , * javax . ws . rs . core . MediaType ) */ @ Override public boolean isReadable ( Class < ? ...
return ODataEntity . isODataEntityType ( type ) ;
public class SipParser { /** * Consume linear whitespace ( LWS ) , which according to RFC3261 section 25.1 * Basic Rules is : * LWS = [ * WSP CRLF ] 1 * WSP ; linear whitespace * @ param buffer * @ return the number of bytes consumed */ public static int consumeLWS ( final Buffer buffer ) throws SipParseExcepti...
final int i = buffer . getReaderIndex ( ) ; consumeWS ( buffer ) ; // if we consume a CRLF we expect at least ONE WS to be present next if ( consumeCRLF ( buffer ) > 0 ) { expectWS ( buffer ) ; } consumeWS ( buffer ) ; if ( buffer . getReaderIndex ( ) == i ) { throw new SipParseException ( i , "Expected at least 1 WSP"...
public class XmlUtilities { /** * Convert the current record to an XML String . * Careful , as this method just returns the XML fragment ( with header or a top - level tag ) . * @ param The record to convert . * @ return The XML representation of this record . */ public static String createXMLStringRecord ( Recor...
String string = DBConstants . BLANK ; DocumentBuilder db = Utility . getDocumentBuilder ( ) ; DocumentBuilder stringdb = Utility . getDocumentBuilder ( ) ; Document doc = null ; synchronized ( db ) { doc = db . newDocument ( ) ; Element elRoot = ( Element ) doc . createElement ( ROOT_TAG ) ; doc . appendChild ( elRoot ...
public class AddValue { /** * Creates the setValue method . */ private MethodSpec makeSetValue ( ) { } }
MethodSpec . Builder setter = MethodSpec . methodBuilder ( "setValue" ) . addModifiers ( context . publicFinalModifiers ( ) ) . addParameter ( vTypeVar , "value" ) . addParameter ( vRefQueueType , "referenceQueue" ) ; if ( isStrongValues ( ) ) { setter . addStatement ( "$T.UNSAFE.putObject(this, $N, $N)" , UNSAFE_ACCES...
public class OrdersInner { /** * Creates or updates an order . * @ param deviceName The device name . * @ param resourceGroupName The resource group name . * @ param order The order to be created or updated . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudExceptio...
return beginCreateOrUpdateWithServiceResponseAsync ( deviceName , resourceGroupName , order ) . toBlocking ( ) . single ( ) . body ( ) ;
public class MailUtil { /** * Delivers the supplied mail message using the machine ' s local mail * SMTP server which must be listening on port 25 . If the * < code > mail . smtp . host < / code > system property is set , that will be * used instead of localhost . * @ exception IOException thrown if an error oc...
deliverMail ( recipients , sender , subject , body , null , null ) ;
public class AbstractEvaluationTask { /** * Performs the evaluation . */ public Boolean call ( ) throws Exception { } }
Boolean result ; try { result = doRun ( ) ; } catch ( Exception e ) { m_Exception = e ; throw e ; } finally { cleanUp ( ) ; } return result ;
public class DynamoDbServiceRegistryFacilitator { /** * Get registered service . * @ param id the id * @ return the registered service */ public RegisteredService get ( final long id ) { } }
val keys = new HashMap < String , AttributeValue > ( ) ; keys . put ( ColumnNames . ID . getColumnName ( ) , new AttributeValue ( String . valueOf ( id ) ) ) ; return getRegisteredServiceByKeys ( keys ) ;
public class DebugStructureInterceptor { /** * Override paint to render additional information for debugging purposes . * @ param renderContext the renderContext to send the output to . */ @ Override public void paint ( final RenderContext renderContext ) { } }
super . paint ( renderContext ) ; if ( ! DebugUtil . isDebugFeaturesEnabled ( ) || ! ( renderContext instanceof WebXmlRenderContext ) ) { return ; } XmlStringBuilder xml = ( ( WebXmlRenderContext ) renderContext ) . getWriter ( ) ; xml . appendTag ( "ui:debug" ) ; writeDebugInfo ( getUI ( ) , xml ) ; xml . appendEndTag...
public class CmsListDirectAction { /** * Help method to resolve the help text to use . < p > * @ param locale the used locale * @ return the help text */ protected String resolveHelpText ( Locale locale ) { } }
String helpText = getHelpText ( ) . key ( locale ) ; if ( ( getColumnForTexts ( ) != null ) && ( getItem ( ) . get ( getColumnForTexts ( ) ) != null ) ) { helpText = new MessageFormat ( helpText , locale ) . format ( new Object [ ] { getItem ( ) . get ( getColumnForTexts ( ) ) } ) ; } return helpText ;
public class GetContactAttributesResult { /** * The attributes to update . * @ param attributes * The attributes to update . * @ return Returns a reference to this object so that method calls can be chained together . */ public GetContactAttributesResult withAttributes ( java . util . Map < String , String > attr...
setAttributes ( attributes ) ; return this ;
public class Engine { private Content doRequest ( String path ) throws IOException { } }
Content result ; result = doRequestNoStats ( path ) ; requestedBytes . addAndGet ( result . bytes . length ) ; return result ;
public class DomainService { /** * Delete a connector . * @ param id the id of the entity to delete . */ public void deleteConnector ( Long chargingStationTypeId , Long evseId , Long id ) { } }
ChargingStationType chargingStationType = chargingStationTypeRepository . findOne ( chargingStationTypeId ) ; Evse evse = getEvseById ( chargingStationType , evseId ) ; Connector connector = getConnectorById ( evse , id ) ; evse . getConnectors ( ) . remove ( connector ) ; chargingStationTypeRepository . createOrUpdate...
public class NodeAvailabilityCache { /** * A set of nodes that are stored as unavailable . * @ return a set of unavailable nodes , never < code > null < / code > . */ public Set < K > getUnavailableNodes ( ) { } }
final Set < K > result = new HashSet < K > ( ) ; for ( final Map . Entry < K , ManagedItem < Boolean > > entry : _map . entrySet ( ) ) { if ( ! entry . getValue ( ) . _value . booleanValue ( ) && ! isExpired ( entry . getValue ( ) ) ) { result . add ( entry . getKey ( ) ) ; } } return result ;
public class HttpServerExchange { /** * Sets the max entity size for this exchange . This cannot be modified after the request channel has been obtained . * @ param maxEntitySize The max entity size */ public HttpServerExchange setMaxEntitySize ( final long maxEntitySize ) { } }
if ( ! isRequestChannelAvailable ( ) ) { throw UndertowMessages . MESSAGES . requestChannelAlreadyProvided ( ) ; } this . maxEntitySize = maxEntitySize ; connection . maxEntitySizeUpdated ( this ) ; return this ;
public class ExitHandler { /** * ( non - Javadoc ) * @ see org . restcomm . ss7 . management . console . CommandHandler # isAvailable ( org . mobicents * . ss7 . management . console . CommandContext ) */ @ Override public boolean isAvailable ( CommandContext commandContext ) { } }
// Available only in disconnected mode if ( commandContext . isControllerConnected ( ) ) { commandContext . printLine ( "The command is not available in the current context. Please disconnnect first" ) ; return false ; } return true ;