signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class DObject { /** * Commits the transaction in which this distributed object is involved . * @ see CompoundEvent # commit */ public void commitTransaction ( ) { } }
if ( _tevent == null ) { String errmsg = "Cannot commit: not involved in a transaction [dobj=" + this + "]" ; throw new IllegalStateException ( errmsg ) ; } // if we are nested , we decrement our nesting count rather than committing the transaction if ( _tcount > 0 ) { _tcount -- ; } else { // we may actually be doing ...
public class AWSMobileClient { /** * Generates customized software development kit ( SDK ) and or tool packages used to integrate mobile web or mobile * app clients with backend AWS resources . * @ param exportBundleRequest * Request structure used to request generation of custom SDK and tool packages required to...
request = beforeClientExecution ( request ) ; return executeExportBundle ( request ) ;
public class GlobalEventDispatcher { /** * Initialize after setting all requisite properties . */ public void init ( ) { } }
IUser user = SecurityUtil . getAuthenticatedUser ( ) ; publisherInfo . setUserId ( user == null ? null : user . getLogicalId ( ) ) ; publisherInfo . setUserName ( user == null ? "" : user . getFullName ( ) ) ; publisherInfo . setAppName ( getAppName ( ) ) ; publisherInfo . setConsumerId ( consumer . getNodeId ( ) ) ; p...
public class Pair { /** * If first and second are Strings , then this returns an MutableInternedPair * where the Strings have been interned , and if this Pair is serialized * and then deserialized , first and second are interned upon * deserialization . * @ param p A pair of Strings * @ return MutableInterned...
return new MutableInternedPair ( p ) ;
public class ICalParameters { /** * Checks the parameters for data consistency problems or deviations from * the specification . * These problems will not prevent the iCalendar object from being written * to a data stream * , but may prevent it from being parsed correctly by the * consuming application . * * ...
List < ValidationWarning > warnings = new ArrayList < ValidationWarning > ( 0 ) ; SyntaxStyle syntax ; switch ( version ) { case V1_0 : syntax = SyntaxStyle . OLD ; break ; default : syntax = SyntaxStyle . NEW ; break ; } /* * Check for invalid characters in names and values . */ for ( Map . Entry < String , List < Str...
public class AbstractRule { /** * Sets the identifier for this Rule . * @ param id a value of type T assigned as this object ' s unique identifier . * @ see org . cp . elements . lang . Identifiable # setId ( Comparable ) * @ throws NullPointerException if the identifier for this Rule is null . */ public final vo...
Assert . notNull ( id , "The identifier for Rule ({0}) cannot be null!" , getClass ( ) . getName ( ) ) ; this . id = id ;
public class RecommendationsInner { /** * Reset all recommendation opt - out settings for a subscription . * Reset all recommendation opt - out settings for a subscription . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceResponse } object if successful ...
return resetAllFiltersWithServiceResponseAsync ( ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class XWikiExtensionRepository { /** * ExtensionRepository */ @ Override public Extension resolve ( ExtensionId extensionId ) throws ResolveException { } }
try { return resolve ( extensionId . getId ( ) , extensionId . getVersion ( ) ) ; } catch ( ResourceNotFoundException e ) { throw new ExtensionNotFoundException ( "Could not find extension [" + extensionId + "]" , e ) ; } catch ( Exception e ) { throw new ResolveException ( "Failed to create extension object for extens...
public class GeoPackageOverlayFactory { /** * Get a map tile from the GeoPackage tile * @ param geoPackageTile GeoPackage tile * @ return tile */ public static Tile getTile ( GeoPackageTile geoPackageTile ) { } }
Tile tile = null ; if ( geoPackageTile != null ) { tile = new Tile ( geoPackageTile . getWidth ( ) , geoPackageTile . getHeight ( ) , geoPackageTile . getData ( ) ) ; } return tile ;
public class FactoryUtils { /** * Creates a { @ link TypeName } from a { @ link TypeMirror } . */ @ Requires ( "type != null" ) @ Ensures ( "result == null || result.getDeclaredName().equals(type.toString())" ) TypeName getTypeNameForType ( TypeMirror type ) { } }
switch ( type . getKind ( ) ) { case NONE : return null ; default : return new TypeName ( type . toString ( ) ) ; }
public class AdminSetUserMFAPreferenceRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AdminSetUserMFAPreferenceRequest adminSetUserMFAPreferenceRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( adminSetUserMFAPreferenceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( adminSetUserMFAPreferenceRequest . getSMSMfaSettings ( ) , SMSMFASETTINGS_BINDING ) ; protocolMarshaller . marshall ( adminSetUserMFAPreferenceRequest ....
public class ModelBuilderSchema { /** * Generic filling from the impl */ @ Override public S fillFromImpl ( B builder ) { } }
// DO NOT , because it can already be running : builder . init ( false ) ; / / check params this . algo = builder . _parms . algoName ( ) . toLowerCase ( ) ; this . algo_full_name = builder . _parms . fullName ( ) ; this . supervised = builder . isSupervised ( ) ; this . can_build = builder . can_build ( ) ; this . vis...
public class DiameterConfiguration { /** * < xsi : element ref = " Extensions " minOccurs = " 0 " maxOccurs = " 1 " / > */ private void updateFromStack ( Stack stack ) { } }
long startTime = System . currentTimeMillis ( ) ; // Update LocalPeer Peer sLocalPeer = stack . getMetaData ( ) . getLocalPeer ( ) ; localPeer . setUri ( sLocalPeer . getUri ( ) . toString ( ) ) ; for ( InetAddress ipAddress : sLocalPeer . getIPAddresses ( ) ) { localPeer . addIpAddress ( ipAddress . getHostAddress ( )...
public class ExpressRouteGatewaysInner { /** * Lists ExpressRoute gateways under a given subscription . * @ return the PagedList < ExpressRouteGatewayInner > object if successful . */ public PagedList < ExpressRouteGatewayInner > list ( ) { } }
PageImpl1 < ExpressRouteGatewayInner > page = new PageImpl1 < > ( ) ; page . setItems ( listWithServiceResponseAsync ( ) . toBlocking ( ) . single ( ) . body ( ) ) ; page . setNextPageLink ( null ) ; return new PagedList < ExpressRouteGatewayInner > ( page ) { @ Override public Page < ExpressRouteGatewayInner > nextPag...
public class Cql2ElmVisitor { /** * Determine if the right - hand side of an < code > IncludedIn < / code > expression can be refactored into the date range * of a < code > Retrieve < / code > . Currently , refactoring is only supported when the RHS is a literal * DateTime interval , a literal DateTime , a paramete...
return rhs . getResultType ( ) . isSubTypeOf ( libraryBuilder . resolveTypeName ( "System" , "DateTime" ) ) || rhs . getResultType ( ) . isSubTypeOf ( new IntervalType ( libraryBuilder . resolveTypeName ( "System" , "DateTime" ) ) ) ; // BTR : The only requirement for the optimization is that the expression be of type ...
public class UTF8String { /** * Levenshtein distance is a metric for measuring the distance of two strings . The distance is * defined by the minimum number of single - character edits ( i . e . insertions , deletions or * substitutions ) that are required to change one of the strings into the other . */ public int...
// Implementation adopted from org . apache . common . lang3 . StringUtils . getLevenshteinDistance int n = numChars ( ) ; int m = other . numChars ( ) ; if ( n == 0 ) { return m ; } else if ( m == 0 ) { return n ; } UTF8String s , t ; if ( n <= m ) { s = this ; t = other ; } else { s = other ; t = this ; int swap ; sw...
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getDescriptorPosition ( ) { } }
if ( descriptorPositionEClass == null ) { descriptorPositionEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 353 ) ; } return descriptorPositionEClass ;
public class CommentAPI { /** * Used to retrieve all the comments that have been made on an object of the * given type and with the given id . It returns a list of all the comments * sorted in ascending order by time created . * @ param reference * The reference to the object from which the comments should be ...
return getResourceFactory ( ) . getApiResource ( "/comment/" + reference . getType ( ) + "/" + reference . getId ( ) ) . get ( new GenericType < List < Comment > > ( ) { } ) ;
public class Config { /** * Read config object stored in JSON format from < code > Reader < / code > * @ param reader object * @ return config * @ throws IOException error */ public static Config fromJSON ( Reader reader ) throws IOException { } }
ConfigSupport support = new ConfigSupport ( ) ; return support . fromJSON ( reader , Config . class ) ;
public class ProjectApi { /** * Get a specific project , which is owned by the authentication user . * < pre > < code > GET / projects / : id < / code > < / pre > * @ param projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance * @ param includeStatistics include proj...
Form formData = new GitLabApiForm ( ) . withParam ( "statistics" , includeStatistics ) ; Response response = get ( Response . Status . OK , formData . asMap ( ) , "projects" , this . getProjectIdOrPath ( projectIdOrPath ) ) ; return ( response . readEntity ( Project . class ) ) ;
public class CommerceNotificationQueueEntryPersistenceImpl { /** * Returns the first commerce notification queue entry in the ordered set where groupId = & # 63 ; . * @ param groupId the group ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the ...
CommerceNotificationQueueEntry commerceNotificationQueueEntry = fetchByGroupId_First ( groupId , orderByComparator ) ; if ( commerceNotificationQueueEntry != null ) { return commerceNotificationQueueEntry ; } StringBundler msg = new StringBundler ( 4 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "group...
public class PathFragment { /** * Constructs path fragments corresponding to the provided filters . * @ param filters the filters to create path fragments from * @ return the path fragments */ public static PathFragment [ ] from ( Filter ... filters ) { } }
PathFragment [ ] ret = new PathFragment [ filters . length ] ; Arrays . setAll ( ret , ( i ) -> new PathFragment ( filters [ i ] ) ) ; return ret ;
public class AnnotatedHttpServiceFactory { /** * Returns the list of { @ link Path } annotated methods . */ private static List < Method > requestMappingMethods ( Object object ) { } }
return getAllMethods ( object . getClass ( ) , withModifier ( Modifier . PUBLIC ) ) . stream ( ) // Lookup super classes just in case if the object is a proxy . . filter ( m -> getAnnotations ( m , FindOption . LOOKUP_SUPER_CLASSES ) . stream ( ) . map ( Annotation :: annotationType ) . anyMatch ( a -> a == Path . clas...
public class BaseScreen { /** * Process the " Login " toolbar command . * @ return true if successful . */ public boolean onLogin ( ) { } }
SStaticString sfStaticField = null ; String strUserName = null ; String strPassword = null ; for ( int i = 0 ; i < this . getSFieldCount ( ) ; i ++ ) { ScreenField sField = this . getSField ( i ) ; if ( sfStaticField == null ) if ( sField instanceof SStaticString ) sfStaticField = ( SStaticString ) sField ; if ( sField...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link LogbaseType } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "logbase" ) public JAXBElement < LogbaseType > createLogbase ( LogbaseType value ) { } }
return new JAXBElement < LogbaseType > ( _Logbase_QNAME , LogbaseType . class , null , value ) ;
public class SentryClient { /** * Sends a message to the Sentry server . * The message will be logged at the { @ link Event . Level # INFO } level . * @ param message message to send to Sentry . */ public void sendMessage ( String message ) { } }
EventBuilder eventBuilder = new EventBuilder ( ) . withMessage ( message ) . withLevel ( Event . Level . INFO ) ; sendEvent ( eventBuilder ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ConversionRefType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link ConversionRefType } { @ code >...
return new JAXBElement < ConversionRefType > ( _ConversionRef_QNAME , ConversionRefType . class , null , value ) ;
public class BitChromosome { /** * Returns the two ' s - complement binary representation of this * large integer . The output array is in < i > big - endian < / i > * byte - order : the most significant byte is at the offset position . * < p > Note : This representation is consistent with { @ code java . lang . ...
if ( bytes . length < _genes . length ) { throw new IndexOutOfBoundsException ( ) ; } System . arraycopy ( _genes , 0 , bytes , 0 , _genes . length ) ; return _genes . length ;
public class JmxBuilderModelMBean { /** * Registers listeners for operation calls ( i . e . method , getter , and setter calls ) when * invoked on this bean from the MBeanServer . Descriptor should contain a map with layout * { @ code item - > [ Map [ methodListener : [ target : " " , tpe : " " , callback : & Closu...
if ( descriptor == null ) return ; for ( Map . Entry < String , Map < String , Map < String , Object > > > item : descriptor . entrySet ( ) ) { // set up method listeners ( such as attributeListener and Operation Listeners ) // item - > [ Map [ methodListener : [ target : " " , tpe : " " , callback : & Closure ] , . . ...
public class Functions { /** * Bind the input of a Procedure to the result of an function , returning a new Procedure . * @ param delegate The Procedure to delegate the invocation to . * @ param function The Function that will create the input for the delegate * @ return A new Procedure */ public static < T1 , T2...
return new BindProcedure < T1 , T2 > ( delegate , function ) ;
public class Scheduler { /** * Schedules the given task on this Scheduler without any time delay . * This method is safe to be called from multiple threads but there are no * ordering or non - overlapping guarantees between tasks . * @ param run the task to execute * @ return the Disposable instance that let ' ...
return scheduleDirect ( run , 0L , TimeUnit . NANOSECONDS ) ;
public class RuntimeModelIo { /** * Loads instances from a file . * @ param instancesFile the file definition of the instances ( can have imports ) * @ param rootDirectory the root directory that contains instance definitions , used to resolve imports * @ param graph the graph to use to resolve instances * @ pa...
InstancesLoadResult result = new InstancesLoadResult ( ) ; INST : { if ( ! instancesFile . exists ( ) ) { RoboconfError error = new RoboconfError ( ErrorCode . PROJ_MISSING_INSTANCE_EP ) ; error . setDetails ( expected ( instancesFile . getAbsolutePath ( ) ) ) ; result . loadErrors . add ( error ) ; break INST ; } From...
public class VisJsComponent { /** * Implements the getHighlightingColor method of the org . corpus _ tools . salt . util . StyleImporter interface . */ @ Override public String setHighlightingColor ( SNode node ) { } }
String color = null ; SFeature featMatched = node . getFeature ( ANNIS_NS , FEAT_MATCHEDNODE ) ; Long matchRaw = featMatched == null ? null : featMatched . getValue_SNUMERIC ( ) ; // token is matched if ( matchRaw != null ) { color = MatchedNodeColors . getHTMLColorByMatch ( matchRaw ) ; return color ; } return color ;
public class TemplateServerServlet { /** * Retrieves all the templates that are newer that the timestamp specified * by the client . The pathInfo from the request specifies which templates * are desired . QueryString parameters " timeStamp " and ? ? ? provide */ public void doGet ( HttpServletRequest req , HttpServ...
getTemplateData ( req , res , req . getPathInfo ( ) ) ;
public class SimplePluginRegistry { /** * ( non - Javadoc ) * @ see org . springframework . plugin . core . PluginRegistry # getPluginFor ( java . lang . Object ) */ @ Override public Optional < T > getPluginFor ( S delimiter ) { } }
Assert . notNull ( delimiter , "Delimiter must not be null!" ) ; return super . getPlugins ( ) . stream ( ) . filter ( it -> it . supports ( delimiter ) ) . findFirst ( ) ;
public class AbstractPrintQuery { /** * Add an select to the PrintQuery . A select is something like : * < code > class [ Emperador _ Products _ ClassFloorLaminate ] . linkto [ SurfaceAttrId ] . attribute [ Value ] < / code > * < br > * The use of the key words like " class " etc is mandatory . Contrary to * { ...
if ( isMarked4execute ( ) ) { for ( final SelectBuilder selectBldr : _selectBldrs ) { addSelect ( selectBldr . toString ( ) ) ; } } return this ;
public class Record { /** * Builds a new Record from its textual representation * @ param name The owner name of the record . * @ param type The record ' s type . * @ param dclass The record ' s class . * @ param ttl The record ' s time to live . * @ param s The textual representation of the rdata . * @ par...
return fromString ( name , type , dclass , ttl , new Tokenizer ( s ) , origin ) ;
public class RippleView { /** * Create Ripple animation centered at x , y * @ param x Horizontal position of the ripple center * @ param y Vertical position of the ripple center */ private void createAnimation ( final float x , final float y ) { } }
if ( this . isEnabled ( ) && ! animationRunning ) { if ( hasToZoom ) this . startAnimation ( scaleAnimation ) ; radiusMax = Math . max ( WIDTH , HEIGHT ) ; if ( rippleType != 2 ) radiusMax /= 2 ; radiusMax -= ripplePadding ; if ( isCentered || rippleType == 1 ) { this . x = getMeasuredWidth ( ) / 2 ; this . y = getMeas...
public class OnExitScriptTypeImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case DroolsPackage . ON_EXIT_SCRIPT_TYPE__SCRIPT : return SCRIPT_EDEFAULT == null ? script != null : ! SCRIPT_EDEFAULT . equals ( script ) ; case DroolsPackage . ON_EXIT_SCRIPT_TYPE__SCRIPT_FORMAT : return SCRIPT_FORMAT_EDEFAULT == null ? scriptFormat != null : ! SCRIPT_FORMAT_EDEFAULT . equals (...
public class RtpPacket { /** * Returns the length of the extensions currently added to this packet . * @ return the length of the extensions currently added to this packet . */ public int getExtensionLength ( ) { } }
if ( ! getExtensionBit ( ) ) return 0 ; // the extension length comes after the RTP header , the CSRC list , and // after two bytes in the extension header called " defined by profile " int extLenIndex = FIXED_HEADER_SIZE + getCsrcCount ( ) * 4 + 2 ; return ( ( buffer . get ( extLenIndex ) << 8 ) | buffer . get ( extLe...
public class MirageUtil { /** * Returns the { @ link SqlContext } instance . * @ param beanDescFactory the bean descriptor factory * @ param param the parameter object * @ return { @ link SqlContext } instance */ public static SqlContext getSqlContext ( BeanDescFactory beanDescFactory , Object param ) { } }
SqlContext context = new SqlContextImpl ( ) ; if ( param != null ) { BeanDesc beanDesc = beanDescFactory . getBeanDesc ( param ) ; for ( int i = 0 ; i < beanDesc . getPropertyDescSize ( ) ; i ++ ) { PropertyDesc pd = beanDesc . getPropertyDesc ( i ) ; context . addArg ( pd . getPropertyName ( ) , pd . getValue ( param ...
public class Predicates { /** * Creates a < b > greater than < / b > predicate that will pass items if the value stored under the given * item { @ code attribute } is greater than the given { @ code value } . * See also < i > Special Attributes < / i > , < i > Attribute Paths < / i > , < i > Handling of { @ code nu...
return new GreaterLessPredicate ( attribute , value , false , false ) ;
public class CompilerResults { /** * Prints out the formatted results . Errors are printed to the standard * error stream and the summary ( if requested ) on standard output . * @ param verbose * whether or not to print verbose compiler output * @ return true if there are no errors ; false otherwise */ public b...
String errors = formatErrors ( ) ; if ( errors != null ) { System . err . println ( errors ) ; } if ( verbose ) { System . out . println ( formatStats ( ) ) ; } return ( errors != null ) ;
public class DOMConfigurator { /** * Used internally to configure the log4j framework by parsing a DOM * tree of XML elements based on < a * href = " doc - files / log4j . dtd " > log4j . dtd < / a > . */ protected void parse ( Element element ) { } }
String rootElementName = element . getTagName ( ) ; if ( ! rootElementName . equals ( CONFIGURATION_TAG ) ) { if ( rootElementName . equals ( OLD_CONFIGURATION_TAG ) ) { LogLog . warn ( "The <" + OLD_CONFIGURATION_TAG + "> element has been deprecated." ) ; LogLog . warn ( "Use the <" + CONFIGURATION_TAG + "> element in...
public class PackageManagerUtils { /** * Checks if the device has a touch screen . * @ param manager the package manager . * @ return { @ code true } if the device has a touch screen . */ @ TargetApi ( Build . VERSION_CODES . FROYO ) public static boolean hasTouchScreenFeature ( PackageManager manager ) { } }
return manager . hasSystemFeature ( PackageManager . FEATURE_TOUCHSCREEN ) ;
public class AdminWhitelistRule { /** * Approves specific callables by their names . */ @ RequirePOST public HttpResponse doApprove ( @ QueryParameter String value ) throws IOException { } }
whitelisted . append ( value ) ; return HttpResponses . ok ( ) ;
public class JSoupMatchers { /** * Creates a { @ link Matcher } for a JSoup { @ link Elements } containing { @ link Element } s with the given { @ code texts } * as their own text content . The order of the elements is important . * @ param texts The texts for which the { @ link Element } s content should match *...
Matcher [ ] elementWithTextMatchers = new Matcher [ texts . length ] ; for ( int i = 0 ; i < elementWithTextMatchers . length ; i ++ ) { elementWithTextMatchers [ i ] = ElementWithOwnText . hasOwnText ( texts [ i ] ) ; } return Matchers . contains ( elementWithTextMatchers ) ;
public class AstUtils { /** * Determine if a { @ link ClassNode } has one or more of the specified annotations on * the class or any of its methods . N . B . the type names are not normally fully * qualified . * @ param node the class to examine * @ param annotations the annotations to look for * @ return { @...
if ( hasAtLeastOneAnnotation ( ( AnnotatedNode ) node , annotations ) ) { return true ; } for ( MethodNode method : node . getMethods ( ) ) { if ( hasAtLeastOneAnnotation ( method , annotations ) ) { return true ; } } return false ;
public class CassandraJavaPairRDD { /** * Produces the empty CassandraRDD which has the same signature and properties , but it does not * perform any validation and it does not even try to return any rows . */ public CassandraJavaPairRDD < K , V > toEmptyCassandraRDD ( ) { } }
CassandraRDD < Tuple2 < K , V > > newRDD = rdd ( ) . toEmptyCassandraRDD ( ) ; return wrap ( newRDD ) ;
public class PrimaveraPMFileReader { /** * Process activity code data . * @ param apibo global activity code data * @ param project project - specific activity code data */ private void processActivityCodes ( APIBusinessObjects apibo , ProjectType project ) { } }
ActivityCodeContainer container = m_projectFile . getActivityCodes ( ) ; Map < Integer , ActivityCode > map = new HashMap < Integer , ActivityCode > ( ) ; List < ActivityCodeTypeType > types = new ArrayList < ActivityCodeTypeType > ( ) ; types . addAll ( apibo . getActivityCodeType ( ) ) ; types . addAll ( project . ge...
public class SchemaConfiguration { /** * getJoinColumn method return ColumnInfo for the join column * @ param columnType * @ param String * joinColumnName . * @ return ColumnInfo object columnInfo . */ private ColumnInfo getJoinColumn ( TableInfo tableInfo , String joinColumnName , Class columnType ) { } }
ColumnInfo columnInfo = new ColumnInfo ( ) ; columnInfo . setColumnName ( joinColumnName ) ; columnInfo . setIndexable ( true ) ; IndexInfo indexInfo = new IndexInfo ( joinColumnName ) ; tableInfo . addToIndexedColumnList ( indexInfo ) ; columnInfo . setType ( columnType ) ; return columnInfo ;
public class Graph { /** * Returns a new Graph after transitive reduction */ public Graph < T > reduce ( ) { } }
Builder < T > builder = new Builder < > ( ) ; nodes . stream ( ) . forEach ( u -> { builder . addNode ( u ) ; edges . get ( u ) . stream ( ) . filter ( v -> ! pathExists ( u , v , false ) ) . forEach ( v -> builder . addEdge ( u , v ) ) ; } ) ; return builder . build ( ) ;
public class PharmacophoreUtils { /** * Write out one or more pharmacophore queries in the CDK XML format . * @ param query The pharmacophore queries * @ param out The OutputStream to write to * @ throws IOException if there is a problem writing the XML document */ public static void writePharmacophoreDefinition ...
writePharmacophoreDefinition ( new PharmacophoreQuery [ ] { query } , out ) ;
public class dnsnameserver { /** * Use this API to delete dnsnameserver resources . */ public static base_responses delete ( nitro_service client , dnsnameserver resources [ ] ) throws Exception { } }
base_responses result = null ; if ( resources != null && resources . length > 0 ) { dnsnameserver deleteresources [ ] = new dnsnameserver [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { deleteresources [ i ] = new dnsnameserver ( ) ; deleteresources [ i ] . ip = resources [ i ] . ip ; delet...
public class UpdateEventConfigurationsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateEventConfigurationsRequest updateEventConfigurationsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateEventConfigurationsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateEventConfigurationsRequest . getEventConfigurations ( ) , EVENTCONFIGURATIONS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException (...
public class DFSOutputStream { /** * Setup the Append pipeline , the length of current pipeline will shrink * if any datanodes are dead during the process . */ private boolean setupPipelineForAppend ( LocatedBlock lastBlock ) throws IOException { } }
if ( nodes == null || nodes . length == 0 ) { String msg = "Could not get block locations. " + "Source file \"" + src + "\" - Aborting..." ; DFSClient . LOG . warn ( msg ) ; setLastException ( new IOException ( msg ) ) ; closed = true ; if ( streamer != null ) streamer . close ( ) ; return false ; } boolean success = c...
public class CommerceNotificationAttachmentLocalServiceUtil { /** * Creates a new commerce notification attachment with the primary key . Does not add the commerce notification attachment to the database . * @ param commerceNotificationAttachmentId the primary key for the new commerce notification attachment * @ re...
return getService ( ) . createCommerceNotificationAttachment ( commerceNotificationAttachmentId ) ;
public class Config { /** * Registers a timer event that executes periodically * @ param conf the map with the existing topology configs * @ param name the name of the timer * @ param interval the frequency in which to run the task * @ param task the task to run */ @ SuppressWarnings ( "unchecked" ) public stat...
if ( interval . isZero ( ) || interval . isNegative ( ) ) { throw new IllegalArgumentException ( "Timer duration needs to be positive" ) ; } if ( ! conf . containsKey ( Config . TOPOLOGY_TIMER_EVENTS ) ) { conf . put ( Config . TOPOLOGY_TIMER_EVENTS , new HashMap < String , Pair < Duration , Runnable > > ( ) ) ; } Map ...
public class AddressConfiguration { /** * A map of custom attributes to attributes to be attached to the message for this address . This payload is added to * the push notification ' s ' data . pinpoint ' object or added to the email / sms delivery receipt event attributes . * @ param context * A map of custom at...
setContext ( context ) ; return this ;
public class CapacitySchedulerConf { /** * Sets the maxCapacity of the given queue . * @ param queue name of the queue * @ param maxCapacity percent of the cluster for the queue . */ public void setMaxCapacity ( String queue , float maxCapacity ) { } }
rmConf . setFloat ( toFullPropertyName ( queue , MAX_CAPACITY_PROPERTY ) , maxCapacity ) ;
public class XmlSchemaParser { /** * Helper function that uses a default value when value not set . * @ param elementNode that should have the attribute * @ param attrName that is to be looked up * @ param defValue String to return if not set * @ return value of the attribute or defValue */ public static String...
final Node attrNode = elementNode . getAttributes ( ) . getNamedItemNS ( null , attrName ) ; if ( attrNode == null ) { return defValue ; } return attrNode . getNodeValue ( ) ;
public class Zips { /** * Unzips the given input stream of a ZIP to the given directory */ public static void unzip ( InputStream in , File toDir ) throws IOException { } }
ZipInputStream zis = new ZipInputStream ( new BufferedInputStream ( in ) ) ; try { ZipEntry entry = zis . getNextEntry ( ) ; while ( entry != null ) { if ( ! entry . isDirectory ( ) ) { String entryName = entry . getName ( ) ; File toFile = new File ( toDir , entryName ) ; toFile . getParentFile ( ) . mkdirs ( ) ; Outp...
public class ElasticSearchIndex { /** * Configure ElasticSearchIndex ' s ES client according to 0.4 . x - 0.5.0 semantics . * This checks local - mode first . If local - mode is true , then it creates a Node that * uses JVM local transport and can ' t talk over the network . If local - mode is * false , then it c...
Node node ; Client client ; if ( config . get ( LOCAL_MODE ) ) { log . debug ( "Configuring ES for JVM local transport" ) ; boolean clientOnly = config . get ( CLIENT_ONLY ) ; boolean local = config . get ( LOCAL_MODE ) ; NodeBuilder builder = NodeBuilder . nodeBuilder ( ) ; Preconditions . checkArgument ( config . has...
public class AbstractCLA { /** * { @ inheritDoc } */ @ Override public Object asEnum ( final String name , final Object [ ] possibleConstants ) throws ParseException { } }
throw new ParseException ( "invalid to store " + this . toString ( ) + " in an Enum" , 0 ) ;
public class WsLogger { /** * @ see java . util . logging . Logger # finest ( java . lang . String ) */ @ Override public void finest ( String msg ) { } }
if ( isLoggable ( Level . FINEST ) ) { log ( Level . FINEST , msg ) ; }
public class KeySnapshot { /** * Get the user keys from this node only . * @ param homeOnly - exclude the non - local ( cached ) keys if set * @ return KeySnapshot containing keys from the local K / V . */ public static KeySnapshot localSnapshot ( boolean homeOnly ) { } }
Object [ ] kvs = H2O . STORE . raw_array ( ) ; ArrayList < KeyInfo > res = new ArrayList < > ( ) ; for ( int i = 2 ; i < kvs . length ; i += 2 ) { Object ok = kvs [ i ] ; if ( ! ( ok instanceof Key ) ) continue ; // Ignore tombstones and Primes and null ' s Key key = ( Key ) ok ; if ( ! key . user_allowed ( ) ) continu...
public class CmisConnector { /** * Converts CMIS object to JCR node . * @ param id the identifier of the CMIS object * @ return JCR node document . */ private Document cmisObject ( String id ) { } }
CmisObject cmisObject ; try { cmisObject = session . getObject ( id ) ; } catch ( CmisObjectNotFoundException e ) { return null ; } // object does not exist ? return null if ( cmisObject == null ) { return null ; } // converting CMIS object to JCR node switch ( cmisObject . getBaseTypeId ( ) ) { case CMIS_FOLDER : retu...
public class SortedRanges { /** * Add the range indices . It is ensured that the added range * doesn ' t overlap the existing ranges . If it overlaps , the * existing overlapping ranges are removed and a single range * having the superset of all the removed ranges and this range * is added . * If the range is...
if ( range . isEmpty ( ) ) { return ; } long startIndex = range . getStartIndex ( ) ; long endIndex = range . getEndIndex ( ) ; // make sure that there are no overlapping ranges SortedSet < Range > headSet = ranges . headSet ( range ) ; if ( headSet . size ( ) > 0 ) { Range previousRange = headSet . last ( ) ; LOG . de...
public class OperationHandler { /** * This method calculates and loads the lists relating to the operations to be performed . * @ param dynamicMethodsToWrite methods to generate */ public void loadStructures ( Set < Method > dynamicMethodsToWrite ) { } }
for ( Field configuredField : getListOfFields ( configuredClass ) ) { String targetFieldName = configReader . retrieveTargetFieldName ( configuredField ) ; if ( targetFieldName == THE_FIELD_IS_NOT_CONFIGURED ) continue ; boolean isNestedMapping = isNestedMapping ( targetFieldName ) ; Field targetField = null ; NestedMa...
public class CheerleaderClient { /** * " Cache " the tracks list of the supported artist retrieved from network in RAM * to avoid requesting SoundCloud API for next call . * @ return { @ link rx . functions . Func1 } used to save the retrieved tracks list */ private Func1 < ArrayList < SoundCloudTrack > , ArrayList...
return new Func1 < ArrayList < SoundCloudTrack > , ArrayList < SoundCloudTrack > > ( ) { @ Override public ArrayList < SoundCloudTrack > call ( ArrayList < SoundCloudTrack > soundCloudTracks ) { if ( soundCloudTracks . size ( ) > 0 ) { mCacheRam . tracks = soundCloudTracks ; } return soundCloudTracks ; } } ;
public class AbstractCompare { /** * Get the value to use in the compare . * It will return the same " value " the client would have used in its subordinate logic . * The compare value will either be ( i ) a date formatted String for WDateFields , ( ii ) a BigDecimal for WNumberFields * or ( iii ) a String value ...
// Date Compare ( Use Date Formatted String - YYYY - MM - DD ) if ( trigger instanceof WDateField ) { return value == null ? null : new SimpleDateFormat ( INTERNAL_DATE_FORMAT ) . format ( value ) ; } else if ( trigger instanceof WNumberField ) { // Number Compare ( Use Number Object ) return value ; } else if ( trigge...
public class NetworkInterfaceMarshaller { /** * Marshall the given parameter object . */ public void marshall ( NetworkInterface networkInterface , ProtocolMarshaller protocolMarshaller ) { } }
if ( networkInterface == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( networkInterface . getSubnetId ( ) , SUBNETID_BINDING ) ; protocolMarshaller . marshall ( networkInterface . getNetworkInterfaceId ( ) , NETWORKINTERFACEID_BINDING ) ; ...
public class JettyBootstrap { /** * Add an exploded ( not packaged ) War application from the current classpath , specifying the context path . * @ param explodedWar * the exploded war path * @ param descriptor * the web . xml descriptor path * @ param contextPath * the path ( base URL ) to make the resourc...
ExplodedWarAppJettyHandler explodedWarAppJettyHandler = new ExplodedWarAppJettyHandler ( getInitializedConfiguration ( ) ) ; explodedWarAppJettyHandler . setWebAppBaseFromClasspath ( explodedWar ) ; explodedWarAppJettyHandler . setDescriptor ( descriptor ) ; explodedWarAppJettyHandler . setContextPath ( contextPath ) ;...
public class PlaybackService { /** * Seek to the precise track position . * The current playing state of the SoundCloud player will be kept . * If playing it remains playing , if paused it remains paused . * @ param context context from which the service will be started . * @ param clientId SoundCloud api clien...
Intent intent = new Intent ( context , PlaybackService . class ) ; intent . setAction ( ACTION_SEEK_TO ) ; intent . putExtra ( BUNDLE_KEY_SOUND_CLOUD_CLIENT_ID , clientId ) ; intent . putExtra ( BUNDLE_KEY_SOUND_CLOUD_TRACK_POSITION , milli ) ; context . startService ( intent ) ;
public class NorwegianDateUtil { /** * Add the given number of days to the calendar and convert to Date . * @ param calendar * The calendar to add to . * @ param days * The number of days to add . * @ return The date object given by the modified calendar . */ private static Date rollGetDate ( Calendar calenda...
Calendar easterSunday = ( Calendar ) calendar . clone ( ) ; easterSunday . add ( Calendar . DATE , days ) ; return easterSunday . getTime ( ) ;
public class SoundLoader { /** * Get the cached Config . */ protected Config getConfig ( String packagePath ) { } }
Config c = _configs . get ( packagePath ) ; if ( c == null ) { Properties props = new Properties ( ) ; String propFilename = packagePath + Sounds . PROP_NAME + ".properties" ; try { props = ConfigUtil . loadInheritedProperties ( propFilename , _rmgr . getClassLoader ( ) ) ; } catch ( IOException ioe ) { log . warning (...
public class PMML4UnitImpl { /** * Retrieves a Map with entries that consist of * key - > a model identifier * value - > the PMML4Model object that the key refers to * where the PMML4Model does not indicate a parent model ( i . e . the * model is not a child model ) * @ return The Map of model identifiers and...
Map < String , PMML4Model > rootModels = new HashMap < > ( ) ; for ( PMML4Model model : this . modelsMap . values ( ) ) { if ( model . getParentModel ( ) == null ) { rootModels . put ( model . getModelId ( ) , model ) ; } } return rootModels ;
public class CoronaJobInProgress { /** * Job state change must happen thru this call */ private void changeStateTo ( int newState ) { } }
synchronized ( lockObject ) { int oldState = this . status . getRunState ( ) ; if ( oldState == newState ) { return ; // old and new states are same } this . status . setRunState ( newState ) ; }
public class LargeList { /** * Return size of list . * @ return size of list . */ public int size ( ) { } }
Record record = client . operate ( this . policy , this . key , ListOperation . size ( this . binNameString ) ) ; if ( record != null ) { return record . getInt ( this . binNameString ) ; } return 0 ;
public class MessageUtils { /** * Retrieve the message from a specific bundle . It does not look on application message bundle * or default message bundle . If it is required to look on those bundles use getMessageFromBundle instead * @ param bundleBaseName baseName of ResourceBundle to load localized messages * ...
if ( bundleBaseName == null ) { throw new NullPointerException ( "Unable to locate ResourceBundle: bundle is null" ) ; } ResourceBundle bundle = ResourceBundle . getBundle ( bundleBaseName , locale ) ; return getMessage ( bundle , messageId , params ) ;
public class CmsPublishProject { /** * Returns the html for the confirmation message . < p > * @ return the html for the confirmation message */ public String buildConfirmation ( ) { } }
StringBuffer result = new StringBuffer ( 512 ) ; result . append ( "<p><div id='conf-msg'>\n" ) ; if ( ! isDirectPublish ( ) ) { result . append ( key ( Messages . GUI_PUBLISH_PROJECT_CONFIRMATION_1 , new Object [ ] { getProjectname ( ) } ) ) ; } else { boolean isFolder = false ; if ( ! isMultiOperation ( ) ) { try { i...
public class AmazonApiGatewayManagementApiClient { /** * Sends the provided data to the specified connection . * @ param postToConnectionRequest * @ return Result of the PostToConnection operation returned by the service . * @ throws GoneException * The connection with the provided id no longer exists . * @ t...
request = beforeClientExecution ( request ) ; return executePostToConnection ( request ) ;
public class BackendConnection { /** * Get connections of current thread datasource . * @ param connectionMode connection mode * @ param dataSourceName data source name * @ param connectionSize size of connections to be get * @ return connections * @ throws SQLException SQL exception */ public List < Connecti...
if ( stateHandler . isInTransaction ( ) ) { return getConnectionsWithTransaction ( connectionMode , dataSourceName , connectionSize ) ; } else { return getConnectionsWithoutTransaction ( connectionMode , dataSourceName , connectionSize ) ; }
public class DialogPreference { /** * Obtains the message of the dialog , which is shown by the preference , from a specific typed * array . * @ param typedArray * The typed array , the message should be obtained from , as an instance of the class * { @ link TypedArray } . The typed array may not be null */ pri...
setDialogMessage ( typedArray . getText ( R . styleable . DialogPreference_android_dialogMessage ) ) ;
public class ThreadedBulkJSONDataESSink { /** * ( non - Javadoc ) * @ see com . sematext . ag . sink . AbstractHttpSink # execute ( org . apache . http . client . methods . HttpRequestBase ) */ @ Override public boolean execute ( HttpRequestBase request ) { } }
DataSenderThread senderThread = new DataSenderThread ( HTTP_CLIENT_INSTANCE , request ) ; senderThread . run ( ) ; return true ;
public class SepaUtil { /** * Erzeugt ein neues XMLCalender - Objekt . * @ param isoDate optional . Das zu verwendende Datum . * Wird es weggelassen , dann wird das aktuelle Datum ( mit Uhrzeit ) verwendet . * @ return das XML - Calendar - Objekt . * @ throws Exception */ public static XMLGregorianCalendar crea...
if ( isoDate == null ) { SimpleDateFormat format = new SimpleDateFormat ( DATETIME_FORMAT ) ; isoDate = format . format ( new Date ( ) ) ; } DatatypeFactory df = DatatypeFactory . newInstance ( ) ; return df . newXMLGregorianCalendar ( isoDate ) ;
public class ApiOvhXdsl { /** * List of incidents * REST : GET / xdsl / incidents * @ param creationDate [ required ] Filter the value of creationDate property ( > ) * @ param endDate [ required ] Filter the value of endDate property ( < ) */ public ArrayList < Long > incidents_GET ( Date creationDate , Date endD...
String qPath = "/xdsl/incidents" ; StringBuilder sb = path ( qPath ) ; query ( sb , "creationDate" , creationDate ) ; query ( sb , "endDate" , endDate ) ; String resp = execN ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t15 ) ;
public class ControllerRegistry { /** * Register the controller methods as routes . * @ param controllerMethods * @ param controller */ private void registerControllerMethods ( Map < Method , Class < ? extends Annotation > > controllerMethods , Controller controller ) { } }
List < Route > controllerRoutes = createControllerRoutes ( controllerMethods ) ; for ( Route controllerRoute : controllerRoutes ) { if ( controller != null ) { ( ( ControllerHandler ) controllerRoute . getRouteHandler ( ) ) . setController ( controller ) ; controllerRoute . bind ( "__controller" , controller ) ; } } th...
public class FacesMessages { /** * Returns style matching the severity error . * @ param clientId * @ return */ public static String getErrorSeverityClass ( String clientId ) { } }
String [ ] levels = { "bf-no-message has-success" , "bf-info" , "bf-warning has-warning" , "bf-error has-error" , "bf-fatal has-error" } ; int level = 0 ; Iterator < FacesMessage > messages = FacesContext . getCurrentInstance ( ) . getMessages ( clientId ) ; if ( null != messages ) { if ( ! messages . hasNext ( ) ) { r...
public class PageRequest { /** * Creates a new unsorted { @ link PageRequest } . * @ param page zero - based page index . * @ param size the size of the page to be returned . * @ since 2.0 */ public static PageRequest of ( final int page , final int size ) { } }
return PageRequest . of ( page , size , Sort . unsorted ( ) ) ;
public class Topicspace { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . runtime . SIMPTopicSpaceControllable # getRemoteTopicSpaceIterator ( ) */ public SIMPIterator getRemoteTopicSpaceIterator ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getRemoteTopicSpaceIterator" ) ; // we get the hashmap of all PSOHs // these are keyed by SIB8Uuid of the remote ME Map pubsubOutHandlers = baseDest . cloneAllPubSubOutputHandlers ( ) ; // we get a corresponding list of AIH...
public class TaskClient { /** * Perform a batch poll for tasks by task type . Batch size is configurable by count . * Returns an iterator that streams tasks as they become available through GRPC . * @ param taskType Type of task to poll for * @ param workerId Name of the client worker . Used for logging . * @ p...
Preconditions . checkArgument ( StringUtils . isNotBlank ( taskType ) , "Task type cannot be blank" ) ; Preconditions . checkArgument ( StringUtils . isNotBlank ( workerId ) , "Worker id cannot be blank" ) ; Preconditions . checkArgument ( count > 0 , "Count must be greater than 0" ) ; Iterator < TaskPb . Task > it = s...
public class JcrLockManager { /** * Attempt to obtain a lock on the supplied node . * @ param node the node ; may not be null * @ param isDeep true if the lock should be a deep lock * @ param isSessionScoped true if the lock should be scoped to the session * @ param timeoutHint desired lock timeout in seconds (...
if ( ! node . isLockable ( ) ) { throw new LockException ( JcrI18n . nodeNotLockable . text ( node . location ( ) ) ) ; } if ( node . isLocked ( ) ) { throw new LockException ( JcrI18n . alreadyLocked . text ( node . location ( ) ) ) ; } if ( node . isNew ( ) || node . isModified ( ) ) { throw new InvalidItemStateExcep...
public class CachingPersonAttributeDaoImpl { /** * Used to specify the placeholder object to put in the cache for null results . Defaults to a minimal Set . Most * installations will not need to set this . * @ param nullResultsObject the nullResultsObject to set */ @ JsonIgnore public void setNullResultsObject ( fi...
if ( nullResultsObject == null ) { throw new IllegalArgumentException ( "nullResultsObject may not be null" ) ; } this . nullResultsObject = nullResultsObject ;
public class DataReader { /** * Recursively parse the zone labels until we get to a zone info object . */ private List < TimeZoneInfo > parseTimeZoneInfo ( JsonObject root , List < String > prefix ) { } }
List < TimeZoneInfo > zones = new ArrayList < > ( ) ; for ( String label : objectKeys ( root ) ) { JsonObject value = resolve ( root , label ) ; List < String > zone = new ArrayList < > ( prefix ) ; zone . add ( label ) ; if ( isTimeZone ( value ) ) { TimeZoneInfo info = parseTimeZoneObject ( value , zone ) ; zones . a...
public class RecordConverter { /** * Convert a set of records in to a matrix * @ param records the records ot convert * @ return the matrix for the records */ public static INDArray toMatrix ( List < List < Writable > > records ) { } }
List < INDArray > toStack = new ArrayList < > ( ) ; for ( List < Writable > l : records ) { toStack . add ( toArray ( l ) ) ; } return Nd4j . vstack ( toStack ) ;
public class NodeIdAwareSocketAddressSupplier { /** * Set the id prefix of the preferred node . * @ param preferredNodeIdPrefix the id prefix of the preferred node */ public void setPreferredNodeIdPrefix ( String preferredNodeIdPrefix ) { } }
LettuceAssert . notNull ( preferredNodeIdPrefix , "preferredNodeIdPrefix must not be null" ) ; boolean resetRoundRobin = false ; if ( this . preferredNodeIdPrefix == null || ! preferredNodeIdPrefix . equals ( this . preferredNodeIdPrefix ) ) { resetRoundRobin = true ; } this . preferredNodeIdPrefix = preferredNodeIdPre...
public class JavaModelUtils { /** * The Java APT throws an internal exception { code com . sun . tools . javac . code . Symbol $ CompletionFailure } if a class is missing from the classpath and { @ link Element # getKind ( ) } is called . This method * handles exceptions when calling the getKind ( ) method to avoid t...
if ( element != null ) { try { final ElementKind kind = element . getKind ( ) ; return Optional . of ( kind ) ; } catch ( Exception e ) { // ignore and fall through to empty } } return Optional . empty ( ) ;
public class ElemTemplateElement { /** * Send endPrefixMapping events to the result tree handler * for all declared prefix mappings in the stylesheet . * @ param transformer non - null reference to the the current transform - time state . * @ param ignorePrefix string prefix to not endPrefixMapping * @ throws T...
try { if ( null != m_prefixTable ) { SerializationHandler rhandler = transformer . getResultTreeHandler ( ) ; int n = m_prefixTable . size ( ) ; for ( int i = 0 ; i < n ; i ++ ) { XMLNSDecl decl = ( XMLNSDecl ) m_prefixTable . get ( i ) ; if ( ! decl . getIsExcluded ( ) && ! ( null != ignorePrefix && decl . getPrefix (...
public class Types { /** * Tries to " read " a { @ link TypeVariable } from an object instance , taking into account { @ link BindTypeVariable } and * { @ link Typed } before falling back to basic type . * @ param o * @ param var * @ param variablesMap prepopulated map for efficiency * @ return Type resolved ...
final Class < ? > rt = Validate . notNull ( o , "null target" ) . getClass ( ) ; Validate . notNull ( var , "no variable to read" ) ; final GenericDeclaration genericDeclaration = var . getGenericDeclaration ( ) ; Validate . isInstanceOf ( Class . class , genericDeclaration , "%s is not declared by a Class" , TypeUtils...