signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class EntityManagerSession { /** * Removes the from cache . * @ param < T > * the generic type * @ param entityClass * the entity class * @ param id * the id * @ param spillOverToL2 * the spill over to l2 */ protected < T > void remove ( Class < T > entityClass , Object id , boolean spillOverToL2...
String key = cacheKey ( entityClass , id ) ; LOG . debug ( "Removing from L1 >> " + key ) ; Object o = sessionCache . remove ( key ) ; if ( spillOverToL2 ) { LOG . debug ( "Removing from L2 >> " + key ) ; Cache c = ( Cache ) getL2Cache ( ) ; if ( c != null ) { c . evict ( entityClass , key ) ; } }
public class ChannelManager { /** * Retrieve all the stored channels */ public synchronized Collection < T > getAllChannels ( ) { } }
Collection < T > allChannels = new ArrayList < T > ( ) ; allChannels . addAll ( this . channels ) ; allChannels . addAll ( this . channelsWithId . values ( ) ) ; return allChannels ;
public class SphericalUtil { /** * Returns the IGeoPoint which lies the given fraction of the way between the * origin IGeoPoint and the destination IGeoPoint . * @ param from The IGeoPoint from which to start . * @ param to The IGeoPoint toward which to travel . * @ param fraction A fraction of the distance to...
// http : / / en . wikipedia . org / wiki / Slerp double fromLat = toRadians ( from . getLatitude ( ) ) ; double fromLng = toRadians ( from . getLongitude ( ) ) ; double toLat = toRadians ( to . getLatitude ( ) ) ; double toLng = toRadians ( to . getLongitude ( ) ) ; double cosFromLat = cos ( fromLat ) ; double cosToLa...
public class ConsumerUtil { /** * Verifies that tokenIssuer is one of the values specified in the * comma - separated issuers string . */ boolean validateIssuer ( String consumerConfigId , String issuers , String tokenIssuer ) throws InvalidClaimException { } }
boolean isIssuer = false ; if ( issuers == null || issuers . isEmpty ( ) ) { String msg = Tr . formatMessage ( tc , "JWT_TRUSTED_ISSUERS_NULL" , new Object [ ] { tokenIssuer , consumerConfigId } ) ; throw new InvalidClaimException ( msg ) ; } StringTokenizer st = new StringTokenizer ( issuers , "," ) ; while ( st . has...
public class BugInstance { /** * Add a class annotation for the classNode . * @ param classNode * the ASM visitor * @ return this object */ @ Nonnull public BugInstance addClass ( ClassNode classNode ) { } }
String dottedClassName = ClassName . toDottedClassName ( classNode . name ) ; ClassAnnotation classAnnotation = new ClassAnnotation ( dottedClassName ) ; add ( classAnnotation ) ; return this ;
public class UndoRedoService { /** * Undo the last command . */ public void undo ( ) { } }
// If there is at least one command left to undo if ( this . commandStack . size ( ) > 0 ) { // Here put the last command on the undone stack this . undoneStack . add ( this . commandStack . get ( this . commandStack . size ( ) - 1 ) ) ; // here remove the last command of the command stack this . commandStack . remove ...
public class GeometryUtilities { /** * Calculates the angle between two { @ link LineSegment } s . * @ param l1 the first segment . * @ param l2 the second segment . * @ return the angle between the two segments , starting from the first segment * moving clockwise . */ public static double angleBetween ( LineSe...
double azimuth1 = azimuth ( l1 . p0 , l1 . p1 ) ; double azimuth2 = azimuth ( l2 . p0 , l2 . p1 ) ; if ( azimuth1 < azimuth2 ) { return azimuth2 - azimuth1 ; } else { return 360 - azimuth1 + azimuth2 ; }
public class BootstrapContextImpl { /** * Returns the JCAContextProvider for the specified work context class . * @ param workContextClass a WorkContext implementation class or ExecutionContext . * @ return the JCAContextProvider for the specified work context class . */ JCAContextProvider getJCAContextProvider ( C...
JCAContextProvider provider = null ; for ( Class < ? > cl = workContextClass ; provider == null && cl != null ; cl = cl . getSuperclass ( ) ) provider = contextProviders . getService ( cl . getName ( ) ) ; return provider ;
public class Util { /** * URL encode a path segment . This is just a thin wrapper around UriUtils . encodePathSegment . It * is intended for the case where you are building URLs in JS . c : url + escapeBody doesn ' t * correctly escape the contents ( especially " < / script > " ) , and fn : escapeXml incorrectly en...
try { return UriUtils . encodePathSegment ( val , "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { // should be unreachable . . . throw new RuntimeException ( e ) ; }
public class ListWorkerBlocksResult { /** * The list of WorkerBlocks , containing the collection of Worker IDs and reasons for blocking . * @ param workerBlocks * The list of WorkerBlocks , containing the collection of Worker IDs and reasons for blocking . */ public void setWorkerBlocks ( java . util . Collection <...
if ( workerBlocks == null ) { this . workerBlocks = null ; return ; } this . workerBlocks = new java . util . ArrayList < WorkerBlock > ( workerBlocks ) ;
public class CartUrl { /** * Get Resource Url for GetUserCartSummary * @ param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object . This parameter should only be used to retrieve data . Attempting to update data using this parameter may cau...
UrlFormatter formatter = new UrlFormatter ( "/api/commerce/carts/user/{userId}/summary?responseFields={responseFields}" ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "userId" , userId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD...
public class BaseMessagingEngineImpl { /** * @ see com . ibm . ws . sib . admin . JsMessagingEngine # loadLocalizations ( ) */ public final void loadLocalizations ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "loadLocalizations" , this ) ; _localizer . loadLocalizations ( ) ; try { setJsDestinationUUIDCache ( _localizer . updatedDestDefList ) ; } catch ( Exception e ) { SibTr . entry ( tc , "Exception while updating UUID Destinat...
public class MessageProcessor { /** * Gets a reference to the actual bus which this messaging engine belongs * to . * @ return */ public JsBus getBus ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getBus" ) ; JsBus jsBus = ( JsBus ) _engine . getBus ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getBus" , jsBus ) ; return jsBus ;
public class PropertyUtils { /** * Return the value of the specified simple property of the specified bean , * with string conversions . * @ param bean * Bean whose property is to be extracted * @ param name * Name of the property to be extracted * @ return the value of the specified simple property of the ...
String value = null ; // Retrieve the property getter method for the specified property PropertyDescriptor descriptor = getPropertyDescriptor ( bean , name ) ; if ( descriptor == null ) { throw new NoSuchMethodException ( "Unknown property '" + name + "'" ) ; } Method readMethod = descriptor . getReadMethod ( ) ; if ( ...
public class AWSMediaLiveClient { /** * Produces a summary of an Input Security Group * @ param describeInputSecurityGroupRequest * Placeholder documentation for DescribeInputSecurityGroupRequest * @ return Result of the DescribeInputSecurityGroup operation returned by the service . * @ throws BadRequestExcepti...
request = beforeClientExecution ( request ) ; return executeDescribeInputSecurityGroup ( request ) ;
public class CmsContainerpageController { /** * Tells the controller that group - container editing has started . < p > * @ param groupContainer the group container * @ param isElementGroup < code > true < / code > if the group container is an element group and not an inheritance group */ public void startEditingGr...
removeEditButtonsPositionTimer ( ) ; I_CmsSimpleCallback < Boolean > callback = new I_CmsSimpleCallback < Boolean > ( ) { public void execute ( Boolean arg ) { if ( arg . booleanValue ( ) ) { if ( isElementGroup ) { m_groupEditor = CmsGroupContainerEditor . openGroupcontainerEditor ( groupContainer , CmsContainerpageCo...
public class ErrorReporter { /** * Writes the error to the specified < code > PrintStream < / code > . */ public void write ( PrintStream stream ) { } }
this . output = stream ; dispatch ( base , false ) ; stream . flush ( ) ;
public class NetUtility { /** * Process an HTML get or post . * @ param req The servlet request . * @ param res The servlet response object . * @ exception ServletException From inherited class . * @ exception IOException From inherited class . */ public static void getNetTable ( String strRecordClass , String ...
String oldLanguage = null ; if ( strLanguage != null ) if ( strLanguage . length ( ) > 0 ) { // Possible concurrency problems oldLanguage = recordOwner . getTask ( ) . getApplication ( ) . getLanguage ( true ) ; if ( ! strLanguage . equals ( oldLanguage ) ) recordOwner . getTask ( ) . getApplication ( ) . setLanguage (...
public class Checks { /** * Checks if the given string is a valid metadata identifier . */ public static String checkMetadataIdentifier ( String s ) { } }
// Note that we avoid using regular expressions here , since we ' ve not used it anywhere else // thus far in Flogger ( avoid it make it more likely that Flogger can be transpiled for things // like GWT ) . if ( s . isEmpty ( ) ) { throw new IllegalArgumentException ( "identifier must not be empty" ) ; } if ( ! isLette...
public class InstanceAdminExample { /** * Demonstrates how to add a cluster to an instance . */ public void addCluster ( ) { } }
System . out . printf ( "%nAdding cluster: %s to instance: %s%n" , CLUSTER , instanceId ) ; // [ START bigtable _ create _ cluster ] try { adminClient . createCluster ( CreateClusterRequest . of ( instanceId , CLUSTER ) . setZone ( "us-central1-c" ) . setServeNodes ( 3 ) . setStorageType ( StorageType . SSD ) ) ; Syste...
public class CommercePriceListAccountRelUtil { /** * Returns the first commerce price list account rel in the ordered set where commercePriceListId = & # 63 ; . * @ param commercePriceListId the commerce price list ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code...
return getPersistence ( ) . fetchByCommercePriceListId_First ( commercePriceListId , orderByComparator ) ;
public class HylaFAXClientConnectionFactoryImpl { /** * Releases the resource from the connection . * @ param resource * The resource */ @ Override protected void releaseResourceImpl ( HylaFAXClient resource ) { } }
try { // release client resource . quit ( ) ; } catch ( Exception exception ) { // log error this . LOGGER . logDebug ( new Object [ ] { "Error while closing client." } , exception ) ; }
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EEnum getIfcProfileTypeEnum ( ) { } }
if ( ifcProfileTypeEnumEEnum == null ) { ifcProfileTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1037 ) ; } return ifcProfileTypeEnumEEnum ;
public class TextImpl { /** * Returns the first text or CDATA node in the current sequence of text and * CDATA nodes . */ private TextImpl firstTextNodeInCurrentRun ( ) { } }
TextImpl firstTextInCurrentRun = this ; for ( Node p = getPreviousSibling ( ) ; p != null ; p = p . getPreviousSibling ( ) ) { short nodeType = p . getNodeType ( ) ; if ( nodeType == Node . TEXT_NODE || nodeType == Node . CDATA_SECTION_NODE ) { firstTextInCurrentRun = ( TextImpl ) p ; } else { break ; } } return firstT...
public class ChemObjectDiff { /** * Compare two { @ link IChemObject } classes and return the difference as an { @ link IDifference } . * @ param first the first of the two classes to compare * @ param second the second of the two classes to compare * @ return an { @ link IDifference } representation of the diffe...
if ( ! ( first instanceof IChemObject && second instanceof IChemObject ) ) { return null ; } IChemObject firstElem = ( IChemObject ) first ; IChemObject secondElem = ( IChemObject ) second ; ChemObjectDifference coDiff = new ChemObjectDifference ( "ChemObjectDiff" ) ; // Compare flags boolean [ ] firstFlags = firstElem...
public class Tuple6 { /** * Skip 2 degrees from this tuple . */ public final Tuple4 < T3 , T4 , T5 , T6 > skip2 ( ) { } }
return new Tuple4 < > ( v3 , v4 , v5 , v6 ) ;
public class DestinationManager { /** * Deletes the system destination from the given destination address */ public void deleteSystemDestination ( JsDestinationAddress destAddr ) throws SIResourceException , SINotPossibleInCurrentConfigurationException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "deleteSystemDestination" , new Object [ ] { destAddr } ) ; BaseDestinationHandler destinationHandler = null ; DestinationTypeFilter filter = new DestinationTypeFilter ( ) ; filter . VISIBLE = Boolean . TRUE ; filter . ALIAS...
public class HtmlExample { /** * < p > addChild . < / p > * @ return a { @ link com . greenpepper . Example } object . */ public Example addChild ( ) { } }
if ( hasChild ( ) ) { return child . addSibling ( ) ; } else { if ( childTags . isEmpty ( ) ) throw new IllegalStateException ( "No child tag" ) ; List < String > moreTags = new ArrayList < String > ( childTags ) ; String childTag = firstPattern ( CollectionUtil . shift ( moreTags ) ) ; child = createSpecification ( ch...
public class SameDiff { /** * Get the input variable ( s ) for the specified differential function * @ param function the function reference to get the input variable ( s ) for * @ return the input variables for the given function */ public SDVariable [ ] getInputVariablesForFunction ( DifferentialFunction function...
val inputs = getInputsForFunction ( function ) ; if ( inputs == null ) { throw new ND4JIllegalStateException ( "No inputs found for function " + function ) ; } val vars = new SDVariable [ inputs . length ] ; for ( int i = 0 ; i < inputs . length ; i ++ ) { vars [ i ] = getVariable ( inputs [ i ] ) ; if ( vars [ i ] == ...
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public IfcActuatorTypeEnum createIfcActuatorTypeEnumFromString ( EDataType eDataType , String initialValue ) { } }
IfcActuatorTypeEnum result = IfcActuatorTypeEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class AsciiTableWidth { /** * Creates a new width object . * @ param minWidth minimum column width as number of characters * @ param maxWidth maximum column width as number of characters * @ return self to allow for chaining */ public AsciiTableWidth add ( final int minWidth , final int maxWidth ) { } }
this . minWidths = ArrayUtils . add ( this . minWidths , minWidth ) ; this . maxWidths = ArrayUtils . add ( this . maxWidths , maxWidth ) ; return this ;
public class CmsSearch { /** * Adds an individual query for a search field that MUST NOT occur . < p > * If this is used , any setting made with { @ link # setQuery ( String ) } and { @ link # setField ( String [ ] ) } * will be ignored and only the individual field search settings will be used . < p > * When com...
addFieldQuery ( fieldName , searchQuery , BooleanClause . Occur . MUST_NOT ) ;
public class GrammarKeywordAccessFragment2 { /** * Returns all grammars from the hierarchy that are used from rules of this grammar . * @ param grammar the grammar . * @ return the used grammars . */ protected static List < Grammar > getEffectivelyUsedGrammars ( final Grammar grammar ) { } }
final List < AbstractRule > allRules = GrammarUtil . allRules ( grammar ) ; final List < Grammar > map = ListExtensions . < AbstractRule , Grammar > map ( allRules , it -> GrammarUtil . getGrammar ( it ) ) ; final Iterable < Grammar > filter = IterableExtensions . < Grammar > filter ( map , it -> Boolean . valueOf ( it...
public class Handshaker { /** * Select a protocol version from the list . Called from * ServerHandshaker to negotiate protocol version . * Return the lower of the protocol version suggested in the * clien hello and the highest supported by the server . */ ProtocolVersion selectProtocolVersion ( ProtocolVersion pr...
if ( activeProtocols == null ) { activeProtocols = getActiveProtocols ( ) ; } return activeProtocols . selectProtocolVersion ( protocolVersion ) ;
public class Functions { /** * Gets the default value for a primitive wrapper . * @ param type * Primitive wrapper type . * @ return The default value . */ public static Object defaultValue ( final Class < ? > type ) { } }
final Object value = WRAPPER_DEFAULTS . get ( Objects . requireNonNull ( type ) ) ; if ( value == null ) { throw new IllegalArgumentException ( "Not primitive wrapper" ) ; } return value ;
public class ImagesInner { /** * Create or update an image . * @ param resourceGroupName The name of the resource group . * @ param imageName The name of the image . * @ param parameters Parameters supplied to the Create Image operation . * @ throws IllegalArgumentException thrown if parameters fail the validat...
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , imageName , parameters ) . toBlocking ( ) . last ( ) . body ( ) ;
public class Message { /** * Factory method for Message list , returns a list of Message objects with page , size preference * @ param page the page * @ param size the page size * @ return the list * @ throws IOException unexpected error */ public static ResourceList < Message > list ( final int page , final in...
return list ( BandwidthClient . getInstance ( ) , page , size ) ;
public class Util { /** * Used to adjust a collection toAdjust so that it looks like the collection * newCol . The collection newCol will be unchanged but the result object will * contain a list of added and removed values . * @ param newCol make it look like this * @ param toAdjust if non - null will be adjust...
final AdjustCollectionResult < T > acr = new AdjustCollectionResult < > ( ) ; acr . removed = new ArrayList < > ( ) ; acr . added = new ArrayList < > ( ) ; acr . added . addAll ( newCol ) ; if ( toAdjust != null ) { for ( final T ent : toAdjust ) { if ( newCol . contains ( ent ) ) { acr . added . remove ( ent ) ; conti...
public class PackedBits8 { /** * Appends bits on to the end of the stack . * @ param bits Storage for bits . Relevant bits start at the front . * @ param numberOfBits Number of relevant bits in ' bits ' * @ param swapOrder If true then the first bit in ' bits ' will be the last bit in this array . */ public void ...
if ( numberOfBits > 32 ) throw new IllegalArgumentException ( "Number of bits exceeds the size of bits" ) ; int indexTail = size ; growArray ( numberOfBits , true ) ; if ( swapOrder ) { for ( int i = 0 ; i < numberOfBits ; i ++ ) { set ( indexTail + i , ( bits >> i ) & 1 ) ; } } else { for ( int i = 0 ; i < numberOfBit...
public class AndPermission { /** * Get compatible Android 7.0 and lower versions of Uri . * @ param fragment { @ link android . app . Fragment } . * @ param file apk file . * @ return uri . */ public static Uri getFileUri ( android . app . Fragment fragment , File file ) { } }
return getFileUri ( fragment . getActivity ( ) , file ) ;
public class StreamSegmentNameUtils { /** * Checks if the given stream segment name is formatted for a Transaction Segment or regular segment . * @ param streamSegmentName The name of the StreamSegment to check for transaction delimiter . * @ return true if stream segment name contains transaction delimiter , false...
// Check to see if the given name is a properly formatted Transaction . int endOfStreamNamePos = streamSegmentName . lastIndexOf ( TRANSACTION_DELIMITER ) ; if ( endOfStreamNamePos < 0 || endOfStreamNamePos + TRANSACTION_DELIMITER . length ( ) + TRANSACTION_ID_LENGTH > streamSegmentName . length ( ) ) { return false ; ...
public class RequestTracker { /** * Add new request to the tracking * @ param sRequestID * The unique request ID . * @ param aRequestScope * The request scope itself . */ public static void addRequest ( @ Nonnull @ Nonempty final String sRequestID , @ Nonnull final IRequestWebScope aRequestScope ) { } }
getInstance ( ) . m_aRequestTrackingMgr . addRequest ( sRequestID , aRequestScope , s_aParallelRunningCallbacks ) ;
public class StochasticUtils { /** * - - - - - AVERAGES - - - - - */ public static < T extends Number > double getAverage ( Collection < T > values , AVERAGE_TYPE type ) { } }
switch ( type ) { case ARITHMETIC : double sum = 0.0 ; for ( T t : values ) { sum += t . doubleValue ( ) ; } return sum / values . size ( ) ; default : throw new IllegalArgumentException ( "\"" + type + "\" is not a valid verage-type!" ) ; }
public class DdlUtilsDataHandling { /** * Returns the sql necessary to add the data XML contained in the given input stream . * Note that the data is expected to match the repository metadata ( not the table schema ) . * Also note that you should not use the reader after passing it to this method except closing *...
try { DataSet set = ( DataSet ) _digester . parse ( input ) ; set . insert ( _platform , _dbModel , batchSize ) ; } catch ( Exception ex ) { if ( ex instanceof DataTaskException ) { // is not declared by digester , but may be thrown throw ( DataTaskException ) ex ; } else { throw new DataTaskException ( ex ) ; } }
public class GeoDistance { /** * { @ inheritDoc } */ @ Override public int compareTo ( GeoDistance other ) { } }
return Double . valueOf ( getValue ( GeoDistanceUnit . MILLIMETRES ) ) . compareTo ( other . getValue ( GeoDistanceUnit . MILLIMETRES ) ) ;
public class ResumingStreamingResultScanner { /** * { @ inheritDoc } */ @ Override public final FlatRow [ ] next ( int count ) throws IOException { } }
ArrayList < FlatRow > resultList = new ArrayList < > ( count ) ; for ( int i = 0 ; i < count ; i ++ ) { FlatRow row = next ( ) ; if ( row == null ) { break ; } resultList . add ( row ) ; } return resultList . toArray ( new FlatRow [ resultList . size ( ) ] ) ;
public class Page { /** * It ' s IE if int > = 0 * Use int found in " ieVersion " * Official IE 7 * Mozilla / 4.0 ( compatible ; MSIE 7.0 ; Windows NT 5.1 ; . NET CLR 1.1.4322; * . NET CLR 2.0.50727 ; . NET CLR 3.0.4506.2152 ; . NET CLR 3.5.30729) * Official IE 8 * Mozilla / 4.0 ( compatible ; MSIE 8.0 ; Wi...
BROWSER br = trans . get ( slot , null ) ; if ( br == null ) { String agent = trans . agent ( ) ; int msie ; if ( agent . contains ( "iPhone" ) /* other phones ? */ ) { br = BROWSER . iPhone ; } else if ( ( msie = agent . indexOf ( "MSIE" ) ) >= 0 ) { msie += 5 ; int end = agent . indexOf ( ";" , msie ) ; float ver ; t...
public class A_CmsListExplorerDialog { /** * Adds the standard explorer view columns to the list . < p > * @ see org . opencms . workplace . list . A _ CmsListDialog # setColumns ( org . opencms . workplace . list . CmsListMetadata ) */ @ Override protected void setColumns ( CmsListMetadata metadata ) { } }
setColumnVisibilities ( ) ; // position 0 : icon CmsListColumnDefinition typeIconCol = new CmsListColumnDefinition ( LIST_COLUMN_TYPEICON ) ; typeIconCol . setName ( Messages . get ( ) . container ( Messages . GUI_EXPLORER_LIST_COLS_ICON_0 ) ) ; typeIconCol . setHelpText ( Messages . get ( ) . container ( Messages . GU...
public class HttpChain { /** * Stop this chain . The chain will have to be recreated when port is updated * notification / follow - on of stop operation is in the chainStopped listener method . */ @ FFDCIgnore ( InvalidRuntimeStateException . class ) public synchronized void stop ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "stop chain " + this ) ; } // When the chain is being stopped , remove the previously // registered EndPoint created in update endpointMgr . removeEndPoint ( endpointName ) ; // We don ' t have to check enabled / disab...
public class ToolUtils { /** * Finds strings similar to a string the user has entered and then * generates a " Did you mean one of these " message * @ param available all possibilities * @ param it the string the user has entered * @ return the " Did you mean . . . " string */ public static String getDidYouMean...
String message = "" ; Collection < String > mins = Levenshtein . findSimilar ( available , it ) ; if ( mins . size ( ) > 0 ) { if ( mins . size ( ) == 1 ) { message += "Did you mean this?" ; } else { message += "Did you mean one of these?" ; } for ( String m : mins ) { message += "\n\t" + m ; } } return message ;
public class SchemaBasedPartitionedDataWriterBuilder { /** * Use the name field of { @ link # schema } to partition path */ @ Override protected String getPartitionedFileName ( State properties , String originalFileName ) { } }
Schema schema = this . getSchema ( ) ; if ( schema != null ) { return new Path ( schema . getName ( ) , originalFileName ) . toString ( ) ; } else { return originalFileName ; }
public class HttpServerBuilder { /** * Defines a ZIP resource on the classpath that provides the static content the server should host . * @ param contextRoot * the root path to the content * @ param contentResource * the name of the classpath resource denoting a file that should be hosted . If the file denotes...
URL resource = resolver . resolve ( contentResource , CallStack . getCallerClass ( ) ) ; resources . put ( contextRoot , resource ) ; return this ;
public class Task { /** * Set an enterprise field value . * @ param index field index * @ param value field value */ public void setEnterpriseDate ( int index , Date value ) { } }
set ( selectField ( TaskFieldLists . ENTERPRISE_DATE , index ) , value ) ;
public class GoldUtils { /** * Writes a gouldi entry to the given path . Note that if the file already exists , it will be * overwritten and logging a warning message . * @ param outputPath where the gouldi entry will be stored * @ param goldEntry the gouldi entry as java object * @ throws IOException */ public...
try { try { Files . createFile ( outputPath ) ; } catch ( FileAlreadyExistsException e ) { LOG . warn ( "File already exists!" ) ; } try ( Writer out = new BufferedWriter ( new OutputStreamWriter ( new FileOutputStream ( outputPath . toFile ( ) ) , "UTF-8" ) ) ) { out . write ( goldEntry . toString ( ) ) ; } } catch ( ...
public class SoapServerFaultResponseActionBuilder { /** * Sets the attachment with content resource . * @ param contentId * @ param contentType * @ param contentResource * @ param charset * @ return */ public SoapServerFaultResponseActionBuilder attachment ( String contentId , String contentType , Resource co...
SoapAttachment attachment = new SoapAttachment ( ) ; attachment . setContentId ( contentId ) ; attachment . setContentType ( contentType ) ; try { attachment . setContent ( FileUtils . readToString ( contentResource , charset ) ) ; } catch ( IOException e ) { throw new CitrusRuntimeException ( "Failed to read attachmen...
public class EngineeringObjectModelWrapper { /** * Generates the model description of a field which is annotated with the OpenEngSBForeignKey annotation . */ private ModelDescription getModelDescriptionFromField ( Field field ) { } }
OpenEngSBForeignKey key = field . getAnnotation ( OpenEngSBForeignKey . class ) ; ModelDescription description = new ModelDescription ( key . modelType ( ) , key . modelVersion ( ) ) ; return description ;
public class NlsAccess { /** * This method sets ( overrides ) the { @ link NlsMessageFactory } . This allows to exchange the { @ link NlsMessageFactory } * and thereby the implementation of { @ link net . sf . mmm . util . nls . api . NlsMessage } . < br > * The desired behavior of a universal translator can depend...
if ( NlsAccess . factory == null ) { NlsAccess . factory = factory ; } else if ( NlsAccess . factory != factory ) { LOG . warn ( "NlsTemplateResolver is already set to {} and will not be changed to {}." , NlsAccess . factory , factory ) ; }
public class LightMetaBean { /** * finds constructor which matches types exactly */ private static < T extends Bean > Constructor < T > findConstructor ( Class < T > beanType , List < Class < ? > > propertyTypes ) { } }
Class < ? > [ ] types = propertyTypes . toArray ( new Class < ? > [ propertyTypes . size ( ) ] ) ; try { Constructor < T > con = beanType . getDeclaredConstructor ( types ) ; return con ; } catch ( NoSuchMethodException ex ) { // try a more lenient search // this handles cases where field is a concrete class and constr...
public class GVRFutureOnGlThread { /** * To get the result we get from run ( ) . With timeout request . * @ param timeout * The timeout number . * @ param unit * The time unit bound to timeout number . * @ return The result from the Callable we put in . * @ throws InterruptedException * When this thread i...
synchronized ( lock ) { if ( mIsCancelled ) { throw new CancellationException ( "The task on GVRFutureOnGlThread has already been cancelled." ) ; } if ( mIsDone ) { return t ; } if ( unit == null ) { lock . wait ( ) ; } else { lock . wait ( unit . convert ( timeout , TimeUnit . MILLISECONDS ) ) ; } if ( mIsCancelled ) ...
public class GasteigerMarsiliPartialCharges { /** * Main method which assigns Gasteiger Marisili partial sigma charges . * @ param ac AtomContainer * @ param setCharge The Charge * @ return AtomContainer with partial charges * @ exception Exception Possible Exceptions */ public IAtomContainer assignGasteigerMar...
// if ( setCharge ) { // atomTypeCharges . setCharges ( ac ) ; / / not necessary initial charge /* add the initial charge to 0 . According results of Gasteiger */ for ( int i = 0 ; i < ac . getAtomCount ( ) ; i ++ ) ac . getAtom ( i ) . setCharge ( 0.0 ) ; double [ ] gasteigerFactors = assignGasteigerSigmaMarsiliFactor...
public class MLUInt8 { /** * Casts < code > Double [ ] < / code > to < code > byte [ ] < / code > * @ param - source < code > Byte [ ] < / code > * @ return - result < code > byte [ ] < / code > */ private static Byte [ ] castToByte ( byte [ ] d ) { } }
Byte [ ] dest = new Byte [ d . length ] ; for ( int i = 0 ; i < d . length ; i ++ ) { dest [ i ] = ( byte ) d [ i ] ; } return dest ;
public class RenderingIntentImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . RENDERING_INTENT__RESERVED : setReserved ( ( Integer ) newValue ) ; return ; case AfplibPackage . RENDERING_INTENT__IOCARI : setIOCARI ( ( Integer ) newValue ) ; return ; case AfplibPackage . RENDERING_INTENT__OCRI : setOCRI ( ( Integer ) newValue ) ; return ; case AfplibPack...
public class ODataRendererUtils { /** * This method returns odata context based on oDataUri . * Throws ODataRenderException in case context is not defined . * @ param entityDataModel The entity data model . * @ param oDataUri is object which is the root of an abstract syntax tree that describes * @ return strin...
return getContextURL ( oDataUri , entityDataModel , false ) ;
public class Dao { /** * Creates a raw query and enables auto updates for the given single table * @ param table the affected table . updates get triggered if the observed tables changes . Use * { @ code null } or * { @ link # rawQuery ( String ) } if you don ' t want to register for automatic updates * @ param...
return rawQueryOnManyTables ( table == null ? null : Collections . singleton ( table ) , sql ) ;
public class LiveData { /** * Posts a task to a main thread to set the given value . So if you have a following code * executed in the main thread : * < pre class = " prettyprint " > * liveData . postValue ( " a " ) ; * liveData . setValue ( " b " ) ; * < / pre > * The value " b " would be set at first and ...
boolean postTask ; synchronized ( mDataLock ) { postTask = mPendingData == NOT_SET ; mPendingData = value ; } if ( ! postTask ) { return ; } ArchTaskExecutor . getInstance ( ) . postToMainThread ( mPostValueRunnable ) ;
public class PlacesInterface { /** * Get informations about a place . * This method does not require authentication . * @ param placeId * A Flickr Places ID . Optional , can be null . ( While optional , you must pass either a valid Places ID or a WOE ID . ) * @ param woeId * A Where On Earth ( WOE ) ID . Opti...
Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_INFO ) ; if ( placeId != null ) { parameters . put ( "place_id" , placeId ) ; } if ( woeId != null ) { parameters . put ( "woe_id" , woeId ) ; } Response response = transportAPI . get ( transportAPI . get...
public class UpdateCommand { /** * Sends a update message to a Cadmium site . This method will block until the update is complete . * @ param site2 The uri to a Cadmium site . * @ param repo The git repository to tell the site to change to . * @ param branch The branch to switch to . * @ param revision The revi...
return sendUpdateMessage ( site2 , repo , branch , revision , comment , token , UPDATE_ENDPOINT ) ;
public class BlockThreadManager { /** * Add a BlockEncodeRequest to the manager . This will immediately attempt * to assign a request to an encoding thread ( which may not occur if no * threads are currently available ) . Requests are passed back to the * currently set FLACEncoder object when finished and ready t...
// add request to the manager ( requests are automatically removed when complete ) process = true ; boolean r = true ; try { unassignedEncodeRequests . put ( ber ) ; synchronized ( outstandingCountLock ) { outstandingCount ++ ; } startFrameThreads ( ) ; } catch ( InterruptedException e ) { r = false ; Thread . currentT...
public class JSONTokener { /** * Returns the string up to but not including any of the given characters or * a newline character . This does not consume the excluded character . */ private String nextToInternal ( String excluded ) { } }
int start = pos ; for ( ; pos < in . length ( ) ; pos ++ ) { char c = in . charAt ( pos ) ; if ( c == '\r' || c == '\n' || excluded . indexOf ( c ) != - 1 ) { return in . substring ( start , pos ) ; } } return in . substring ( start ) ;
public class MemberSummaryBuilder { /** * Build the summary for the optional members . * @ param node the XML element that specifies which components to document * @ param memberSummaryTree the content tree to which the documentation will be added */ public void buildAnnotationTypeRequiredMemberSummary ( XMLNode no...
MemberSummaryWriter writer = memberSummaryWriters . get ( VisibleMemberMap . Kind . ANNOTATION_TYPE_MEMBER_REQUIRED ) ; VisibleMemberMap visibleMemberMap = getVisibleMemberMap ( VisibleMemberMap . Kind . ANNOTATION_TYPE_MEMBER_REQUIRED ) ; addSummary ( writer , visibleMemberMap , false , memberSummaryTree ) ;
public class ComplexNumber { /** * Adds the complex number with a scalar value . * @ param z1 Complex Number . * @ param scalar Scalar value . * @ return Returns new ComplexNumber instance containing the add of specified complex number with scalar value . */ public static ComplexNumber Add ( ComplexNumber z1 , do...
return new ComplexNumber ( z1 . real + scalar , z1 . imaginary ) ;
public class BaseTraceService { /** * Based on config ( sourceList ) , need to connect the synchronized handler to configured source / conduit . . * Or disconnect it . */ private void updateConduitSyncHandlerConnection ( List < String > sourceList , SynchronousHandler handler ) { } }
if ( sourceList . contains ( "message" ) ) { logConduit . addSyncHandler ( handler ) ; } else { logConduit . removeSyncHandler ( handler ) ; } if ( sourceList . contains ( "trace" ) ) { traceConduit . addSyncHandler ( handler ) ; } else { traceConduit . removeSyncHandler ( handler ) ; }
public class CPInstancePersistenceImpl { /** * Returns a range of all the cp instances where CPDefinitionId = & # 63 ; and displayDate & lt ; & # 63 ; and status = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end ...
return findByC_LtD_S ( CPDefinitionId , displayDate , status , start , end , null ) ;
public class ListFunctionsResult { /** * A list of Lambda functions . * @ param functions * A list of Lambda functions . */ public void setFunctions ( java . util . Collection < FunctionConfiguration > functions ) { } }
if ( functions == null ) { this . functions = null ; return ; } this . functions = new com . amazonaws . internal . SdkInternalList < FunctionConfiguration > ( functions ) ;
public class InjectorConfiguration { /** * Specify that the given class should be created using the factory instance specified . * @ param classDefinition the class that should be produced using a factory . * @ param factory the factory class that creates the class definition * @ param < T > type of the class *...
if ( classDefinition . equals ( Injector . class ) ) { throw new DependencyInjectionFailedException ( "Cowardly refusing to define a global factory for Injector since that would lead to a Service Locator pattern. If you need the injector, please define it on a per-class or per-method basis." ) ; } // noinspection unche...
public class BeaconEvent { /** * Utility method to parse e generic event to a more specific one * @ param event the generic event to parse * @ return an option containing the parsed value or non if it could not be parsed */ public static Optional < BeaconEvent > parse ( Event event ) { } }
Matcher matcher = PATTERN . matcher ( event . getTag ( ) ) ; if ( matcher . matches ( ) ) { BeaconEvent result = new BeaconEvent ( matcher . group ( 1 ) , matcher . group ( 2 ) , matcher . group ( 3 ) , event . getData ( JsonElement . class ) ) ; return Optional . of ( result ) ; } else { return Optional . empty ( ) ; ...
public class SerialInterrupt { /** * Java consumer code can all this method to unregister itself as a listener for pin state * changes . * @ see com . pi4j . jni . SerialInterruptListener * @ see com . pi4j . jni . SerialInterruptEvent * @ param fileDescriptor the serial file descriptor / handle */ public stati...
if ( listeners . containsKey ( fileDescriptor ) ) { listeners . remove ( fileDescriptor ) ; disableSerialDataReceiveCallback ( fileDescriptor ) ; }
public class TopoGraph { /** * Sets a user index value for a half edge */ void setHalfEdgeUserIndex ( int half_edge , int index , int value ) { } }
int i = getHalfEdgeIndex_ ( half_edge ) ; AttributeStreamOfInt32 stream = m_edgeIndices . get ( index ) ; if ( stream . size ( ) <= i ) stream . resize ( m_halfEdgeData . size ( ) , - 1 ) ; stream . write ( i , value ) ;
public class AccountsInner { /** * Gets the first page of Data Lake Analytics accounts , if any , within the current subscription . This includes a link to the next page , if any . * @ param filter OData filter . Optional . * @ param top The number of items to return . Optional . * @ param skip The number of item...
ServiceResponse < Page < DataLakeAnalyticsAccountBasicInner > > response = listSinglePageAsync ( filter , top , skip , select , orderby , count ) . toBlocking ( ) . single ( ) ; return new PagedList < DataLakeAnalyticsAccountBasicInner > ( response . body ( ) ) { @ Override public Page < DataLakeAnalyticsAccountBasicIn...
public class DistributedFileSystem { /** * Start lease recovery * @ param f the name of the file to start lease recovery * @ return if the file is closed or not * @ throws IOException */ @ Deprecated public boolean recoverLease ( Path f ) throws IOException { } }
return dfs . recoverLease ( getPathName ( f ) , false ) ;
public class SeleniumSpec { /** * Verifies that a webelement previously found has { @ code attribute } with { @ code value } ( as a regexp ) * @ param index * @ param attribute * @ param value */ @ Then ( "^the element on index '(\\d+?)' has '(.+?)' as '(.+?)'$" ) public void assertSeleniumHasAttributeValue ( Int...
assertThat ( this . commonspec , commonspec . getPreviousWebElements ( ) ) . as ( "There are less found elements than required" ) . hasAtLeast ( index ) ; String val = commonspec . getPreviousWebElements ( ) . getPreviousWebElements ( ) . get ( index ) . getAttribute ( attribute ) ; assertThat ( this . commonspec , val...
public class Logger { /** * Writes the given text to the output file . * @ param text * log message */ private synchronized void log ( final String text ) { } }
try { this . writer . write ( text ) ; } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; }
public class AuditManager { /** * Gets the audit thread context that is unique per thread . * If / when a common thread storage framework is supplied , then this method * implementation may need to be updated to take it into consideration . * @ return the subject thread context . */ @ Trivial protected AuditThrea...
ThreadLocal < AuditThreadContext > currentThreadLocal = getThreadLocal ( ) ; AuditThreadContext auditThreadContext = currentThreadLocal . get ( ) ; if ( auditThreadContext == null ) { auditThreadContext = new AuditThreadContext ( ) ; currentThreadLocal . set ( auditThreadContext ) ; } return auditThreadContext ;
public class SchedulerForType { /** * Find a matching pair of node , request by looping through the requests in * the session , looking at the hosts in each request and making look - ups * into the node manager . * @ param session The session * @ param level The locality level at which we are trying to schedule...
Iterator < ResourceRequestInfo > pendingRequestIterator = session . getPendingRequestIteratorForType ( type ) ; while ( pendingRequestIterator . hasNext ( ) ) { ResourceRequestInfo req = pendingRequestIterator . next ( ) ; Set < String > excluded = req . getExcludeHosts ( ) ; if ( req . getHosts ( ) == null || req . ge...
public class PageFlowUtils { /** * Get the shared flow with the given class name . * @ param sharedFlowClassName the class name of the shared flow to retrieve . * @ param request the current HttpServletRequest . * @ return the { @ link SharedFlowController } of the given class name which is stored in the user ses...
StorageHandler sh = Handlers . get ( servletContext ) . getStorageHandler ( ) ; HttpServletRequest unwrappedRequest = unwrapMultipart ( request ) ; RequestContext rc = new RequestContext ( unwrappedRequest , null ) ; String attrName = ScopedServletUtils . getScopedSessionAttrName ( InternalConstants . SHARED_FLOW_ATTR_...
public class JandexApplicationHelper { /** * Method to create jars , wars and ears for testing . Resources are created * as needed and added to dropins or apps directories as specified . */ private static void addEarToServer ( LibertyServer server , String dir , String earName , boolean addEarResources , String warNa...
if ( warName == null ) return ; // If server is already started and app exists no need to add it . if ( server . isStarted ( ) ) { String appName = warName . substring ( 0 , warName . indexOf ( ".war" ) ) ; Set < String > appInstalled = server . getInstalledAppNames ( appName ) ; LOG . info ( "addEarToServer : " + appN...
public class RingBufferBuilder { /** * Create a builder for ring buffers that use the supplied { @ link Executor } to create threads for each { @ link Consumer } * instance . The ring buffer will allow entries to be added from multiple threads . * @ param executor the executor that should be used to create threads ...
return new RingBufferBuilder < > ( executor , StandardConsumerAdapter . < T , C > create ( ) ) . multipleProducers ( ) ;
public class CmsMessageBundleEditorOptions { /** * Sets the path of the edited file in the corresponding display . * @ param editedFilePath path of the edited file to set . */ public void setEditedFilePath ( final String editedFilePath ) { } }
m_filePathField . setReadOnly ( false ) ; m_filePathField . setValue ( editedFilePath ) ; m_filePathField . setReadOnly ( true ) ;
public class NavigationAnimationFactory { /** * Create a new zoom in { @ link NavigationAnimation } that zooms in one resolution , to the requested position . * @ param mapPresenter The map onto which you want the zoom in animation to run . * @ param position The position to arrive at . * @ return The animation ....
View endView = null ; int index = mapPresenter . getViewPort ( ) . getResolutionIndex ( mapPresenter . getViewPort ( ) . getResolution ( ) ) ; if ( index < mapPresenter . getViewPort ( ) . getResolutionCount ( ) - 1 ) { endView = new View ( position , mapPresenter . getViewPort ( ) . getResolution ( index + 1 ) ) ; } e...
public class InputStreamProvider { /** * open the file and read the magic number from the beginning * this is used to determine the compression type * @ param in an input stream to read from * @ return the magic number * @ throws IOException */ private int getMagicNumber ( InputStream in ) throws IOException { ...
int t = in . read ( ) ; if ( t < 0 ) throw new EOFException ( "Failed to read magic number" ) ; int magic = ( t & 0xff ) << 8 ; t = in . read ( ) ; if ( t < 0 ) throw new EOFException ( "Failed to read magic number" ) ; magic += t & 0xff ; return magic ;
public class WhereCondition { /** * Add columnName into WHERE clause * @ param columnName * @ return */ public WhereCondition Col ( String columnName ) { } }
mSgSQL . append ( columnName ) ; checkTokenOrderIsCorrect ( ESqlToken . COLUMN ) ; return WhereCondition . this ;
public class ApiOvhDbaaslogs { /** * Returns details of specified graylog stream alert * REST : GET / dbaas / logs / { serviceName } / output / graylog / stream / { streamId } / alert / { alertId } * @ param serviceName [ required ] Service name * @ param streamId [ required ] Stream ID * @ param alertId [ requ...
String qPath = "/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/alert/{alertId}" ; StringBuilder sb = path ( qPath , serviceName , streamId , alertId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhStreamAlertCondition . class ) ;
public class ClassWriter { public MethodWriter visitMethod ( final int access , final String name , final String desc , final String [ ] exceptions ) { } }
MethodWriter cw = new MethodWriter ( this , access , name , desc , exceptions ) ; this . methods . add ( cw ) ; return cw ;
public class ExternalChildResourceImpl { /** * Add a dependency task group for this model . * @ param dependency the dependency . * @ return key to be used as parameter to taskResult ( string ) method to retrieve result of root * task in the given dependency task group */ protected String addDependency ( TaskGrou...
Objects . requireNonNull ( dependency ) ; this . taskGroup ( ) . addDependencyTaskGroup ( dependency . taskGroup ( ) ) ; return dependency . taskGroup ( ) . key ( ) ;
public class DateFormat { /** * Creates a { @ link DateFormat } object that can be used to format dates in * the calendar system specified by < code > cal < / code > . * @ param cal The calendar system for which a date format is desired . * @ param dateStyle The type of date format desired . This can be * { @ l...
return getDateTimeInstance ( cal , dateStyle , - 1 , ULocale . forLocale ( locale ) ) ;
public class AmazonDynamoDBClient { /** * < code > TransactWriteItems < / code > is a synchronous write operation that groups up to 10 action requests . These * actions can target items in different tables , but not in different AWS accounts or regions , and no two actions * can target the same item . For example ,...
request = beforeClientExecution ( request ) ; return executeTransactWriteItems ( request ) ;
public class FluentCondition { /** * Create a logical AND operator between current condition and conditions * provided in parameters . * For example : * < pre > * requiredClass ( " javax . mail . Transport " ) . and ( requiredClass ( " foo . Bar " ) ) ; * < / pre > * Means that the result will be true only ...
List < Condition < T > > merged = new ArrayList < > ( ) ; merged . add ( delegate ) ; for ( Condition < T > condition : conditions ) { merged . add ( condition ) ; } return Conditions . and ( merged ) ;
public class MessageToClientManager { /** * Create a MessageToClient from MessageFromClient for session Only for available test use case * @ param message * @ param session * @ return */ MessageToClient _createMessageToClient ( MessageFromClient message , T session ) { } }
MessageToClient messageToClient = new MessageToClient ( ) ; messageToClient . setId ( message . getId ( ) ) ; try { Class cls = Class . forName ( message . getDataService ( ) ) ; Object dataService = this . getDataService ( session , cls ) ; logger . debug ( "Process message {}" , message ) ; List < Object > arguments ...
public class EMFGeneratorFragment { /** * Create a clone of the original grammar . The clone will not refer to a node model . */ private Grammar cloneGrammarIntoNewResourceSet ( Grammar original ) { } }
Resource originalResource = original . eResource ( ) ; ResourceSet clonedResourceSet = EcoreUtil2 . clone ( new XtextResourceSet ( ) , originalResource . getResourceSet ( ) ) ; Resource clonedResource = clonedResourceSet . getResource ( originalResource . getURI ( ) , false ) ; Grammar clonedGrammar = ( Grammar ) clone...
public class ResponseTypeNormalizer { /** * Normalizes the body type ( e . g . removes nested { @ link GenericEntity } s ) . * @ param type The type * @ return The normalized type */ static String normalizeResponseWrapper ( final String type ) { } }
if ( ! getTypeParameters ( type ) . isEmpty ( ) && isAssignableTo ( type , Types . GENERIC_ENTITY ) ) return getTypeParameters ( type ) . get ( 0 ) ; return type ;