signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class OntopModelSettingsImpl { /** * Returns the boolean value of the given key . */ Optional < Boolean > getBoolean ( String key ) { } }
Object value = get ( key ) ; if ( value == null ) { return Optional . empty ( ) ; } if ( value instanceof Boolean ) { return Optional . of ( ( Boolean ) value ) ; } else if ( value instanceof String ) { return Optional . of ( Boolean . parseBoolean ( ( String ) value ) ) ; } else { throw new InvalidOntopConfigurationEx...
public class DnsCacheManipulator { /** * Remove dns cache entry , cause lookup dns server for host after . * @ param host host * @ throws DnsCacheManipulatorException Operation fail * @ see DnsCacheManipulator # clearDnsCache */ public static void removeDnsCache ( String host ) { } }
try { InetAddressCacheUtil . removeInetAddressCache ( host ) ; } catch ( Exception e ) { final String message = String . format ( "Fail to removeDnsCache for host %s, cause: %s" , host , e . toString ( ) ) ; throw new DnsCacheManipulatorException ( message , e ) ; }
public class CouchbaseClientFactory { /** * Query and get a result by username . * @ param usernameAttribute the username attribute * @ param usernameValue the username value * @ return the n1ql query result * @ throws GeneralSecurityException the general security exception */ public N1qlQueryResult query ( fin...
val theBucket = getBucket ( ) ; val statement = Select . select ( "*" ) . from ( Expression . i ( theBucket . name ( ) ) ) . where ( Expression . x ( usernameAttribute ) . eq ( '\'' + usernameValue + '\'' ) ) ; LOGGER . debug ( "Running query [{}] on bucket [{}]" , statement . toString ( ) , theBucket . name ( ) ) ; va...
public class CSSDataURLHelper { /** * Parse a data URL into this type . * < pre > * Syntax * dataurl : = " data : " [ mediatype ] [ " ; base64 " ] " , " data * mediatype : = [ type " / " subtype ] * ( " ; " parameter ) * data : = * urlchar * parameter : = attribute " = " value * < / pre > * @ param sDat...
if ( ! isDataURL ( sDataURL ) ) return null ; // Skip the constant prefix final String sRest = sDataURL . trim ( ) . substring ( PREFIX_DATA_URL . length ( ) ) ; if ( StringHelper . hasNoText ( sRest ) ) { // Plain " data : " URL - no content return new CSSDataURL ( ) ; } // comma is a special character and must be quo...
public class CheckAccessControls { /** * Returns the instance object type that best represents a method or constructor definition , or * { @ code null } if there is no representative type . * < ul > * < li > Prototype methods = > The instance type having that prototype * < li > Instance methods = > The type the...
checkState ( isFunctionOrClass ( n ) , n ) ; Node parent = n . getParent ( ) ; // We need to handle declaration syntaxes separately in a way that we can ' t determine based on // the type of just one node . // TODO ( nickreid ) : Determine if these can be replaced with FUNCTION and CLASS cases below . if ( NodeUtil . i...
public class DirectoryLookupService { /** * Get the ModelServiceInstance list of the Service . * @ param serviceName * the service name . * @ return * the ModelServiceInstance list of the Service . */ public List < ModelServiceInstance > getModelInstances ( String serviceName ) { } }
ModelService service = getModelService ( serviceName ) ; if ( service == null || service . getServiceInstances ( ) . size ( ) == 0 ) { return Collections . emptyList ( ) ; } else { return new ArrayList < ModelServiceInstance > ( service . getServiceInstances ( ) ) ; }
public class TokenLifeCycleManager { /** * Logic for getting token : < br > * 1 . If has a valid token stored , send it . < br > * 2 . If the stored token has expired , replace it with a new fetched token . < br > * Note : This method is thread - safe and makes only one call to IAM API to replace an expired IAM t...
if ( hasTokenExpired ( ) ) { synchronized ( this ) { if ( hasTokenExpired ( ) ) { try { final IAMToken iamToken = invokeTokenApi ( ) ; expiresAt = ( long ) ( TimeUnit . SECONDS . toNanos ( iamToken . expires_in ) * tokenExpiryThreshold ) + System . nanoTime ( ) ; token = iamToken . access_token ; } catch ( final IAMTok...
public class SeleniumHelper { /** * Sets how long to wait when executing asynchronous script calls . * @ param scriptTimeout time in milliseconds to wait . */ public void setScriptWait ( int scriptTimeout ) { } }
try { driver ( ) . manage ( ) . timeouts ( ) . setScriptTimeout ( scriptTimeout , TimeUnit . MILLISECONDS ) ; } catch ( Exception e ) { // https : / / code . google . com / p / selenium / issues / detail ? id = 6015 System . err . println ( "Unable to set script timeout (known issue for Safari): " + e . getMessage ( ) ...
public class FnJodaTimeUtils { /** * It creates a { @ link Period } with the specified { @ link Chronology } . The input received by the { @ link Function } * must have size 2 and represents the start and end instants of the { @ link Period } * @ param chronology { @ link Chronology } to be used * @ return the { ...
return FnPeriod . baseDateTimeFieldArrayToPeriod ( chronology ) ;
public class AbstractFaxClientSpi { /** * This function adds the fax monitor event listener to the internal fax * event listeners data structure . < br > * Fax jobs will be monitored only if there are active listeners registered . < br > * If the listeners are added after a fob job was submitted , that fax job wo...
boolean faxMonitorEventsSupported = this . isFaxMonitorEventsSupported ( ) ; if ( faxMonitorEventsSupported ) { synchronized ( this . faxMonitorEventListeners ) { this . faxMonitorEventListeners . add ( listener ) ; } } else { this . throwUnsupportedException ( ) ; }
public class JideAbstractView { /** * Returns the view specific menu bar constructed from * the command group given by the toolBarCommandGroupName or * its default * @ return */ public JComponent getViewToolBar ( ) { } }
CommandGroup commandGroup = getCommandGroup ( getToolBarCommandGroupName ( ) ) ; if ( commandGroup == null ) { return null ; } return commandGroup . createToolBar ( ) ;
public class AbstractPac4jDecoder { /** * Populate the context which carries information specific to this binding . * @ param messageContext the current message context */ protected void populateBindingContext ( final SAML2MessageContext messageContext ) { } }
SAMLBindingContext bindingContext = messageContext . getSubcontext ( SAMLBindingContext . class , true ) ; bindingContext . setBindingUri ( getBindingURI ( messageContext ) ) ; bindingContext . setHasBindingSignature ( false ) ; bindingContext . setIntendedDestinationEndpointURIRequired ( SAMLBindingSupport . isMessage...
public class CudaZeroHandler { /** * This method returns total amount of memory allocated within system * @ return */ @ Override public Table < AllocationStatus , Integer , Long > getAllocationStatistics ( ) { } }
Table < AllocationStatus , Integer , Long > table = HashBasedTable . create ( ) ; table . put ( AllocationStatus . HOST , 0 , zeroUseCounter . get ( ) ) ; for ( Integer deviceId : configuration . getAvailableDevices ( ) ) { table . put ( AllocationStatus . DEVICE , deviceId , getAllocatedDeviceMemory ( deviceId ) ) ; }...
public class Ray { /** * Sets this ray from the given ray . * @ param ray The ray * @ return this ray for chaining . */ public Ray < T > set ( Ray < T > ray ) { } }
start . set ( ray . start ) ; end . set ( ray . end ) ; return this ;
public class AnnotationTypeRequiredMemberWriterImpl { /** * { @ inheritDoc } */ public List < String > getSummaryTableHeader ( Element member ) { } }
List < String > header = Arrays . asList ( writer . getModifierTypeHeader ( ) , resources . getText ( "doclet.Annotation_Type_Required_Member" ) , resources . getText ( "doclet.Description" ) ) ; return header ;
public class RequestedGlobalProperties { /** * Filters these properties by what can be preserved by the given SemanticProperties when propagated down * to the given input . * @ param props The SemanticProperties which define which fields are preserved . * @ param input The index of the operator ' s input . * @ ...
// no semantic properties available . All global properties are filtered . if ( props == null ) { throw new NullPointerException ( "SemanticProperties may not be null." ) ; } RequestedGlobalProperties rgProp = new RequestedGlobalProperties ( ) ; switch ( this . partitioning ) { case FULL_REPLICATION : case FORCED_REBAL...
public class SQLTransformer { /** * Checks if is supported JDK type . * @ param typeName * the type name * @ return true , if is supported JDK type */ public static boolean isSupportedJDKType ( TypeName typeName ) { } }
if ( typeName . isPrimitive ( ) ) { return getPrimitiveTransform ( typeName ) != null ; } String name = typeName . toString ( ) ; if ( name . startsWith ( "java.lang" ) ) { return getLanguageTransform ( typeName ) != null ; } if ( name . startsWith ( "java.util" ) ) { return getUtilTransform ( typeName ) != null ; } if...
public class IOUtils { /** * Returns the lines of an < code > InputStream < / code > as a list of Strings . * @ param input the < code > InputStream < / code > to read from . * @ return the list of lines . */ public static List < String > readLines ( InputStream input ) throws IOException { } }
final InputStreamReader reader = new InputStreamReader ( input ) ; return readLines ( reader ) ;
public class Form { /** * Sets a new Object value to a given form ' s field . In fact , the object representation * ( i . e . # toString ) will be the actual value of the field . < p > * If the value to set to the field is not a basic type ( e . g . String , boolean , int , etc . ) you * will need to use { @ link...
if ( ! isSubmitType ( ) ) { throw new IllegalStateException ( "Cannot set an answer if the form is not of type " + "\"submit\"" ) ; } field . resetValues ( ) ; field . addValue ( value . toString ( ) ) ;
public class ContentsDao { /** * Get the bounding box for all tables in the provided projection * @ param projection * desired bounding box projection * @ return bounding box * @ since 3.1.0 */ public BoundingBox getBoundingBox ( Projection projection ) { } }
BoundingBox boundingBox = null ; List < String > tables = null ; try { tables = getTables ( ) ; } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to query for contents tables" , e ) ; } for ( String table : tables ) { BoundingBox tableBoundingBox = getBoundingBox ( projection , table ) ; if ( tableBo...
public class AbstractRoutingClient { /** * Builds a unique ID . * @ param ownerKind the owner kind ( not null ) * @ param applicationName the application name ( can be null ) * @ param scopedInstancePath the scoped instance path ( can be null ) * @ return a non - null string */ public static String buildOwnerId...
StringBuilder sb = new StringBuilder ( ) ; if ( ownerKind == RecipientKind . DM ) { sb . append ( "@DM@" ) ; } else { if ( scopedInstancePath != null ) { sb . append ( scopedInstancePath ) ; sb . append ( " " ) ; } if ( applicationName != null ) { sb . append ( "@ " ) ; sb . append ( applicationName ) ; } } // The " do...
public class SeaGlassSliderUI { /** * { @ inheritDoc } */ @ Override protected void paintMinorTickForHorizSlider ( Graphics g , Rectangle tickBounds , int x ) { } }
setTickColor ( g ) ; super . paintMinorTickForHorizSlider ( g , tickBounds , x ) ;
public class LogHandle { /** * Package access method to close the recovery log . This method directs closes the * two log files and then clears its internal state . * @ exception InternalLogException An unexpected error has occured . */ void closeLog ( ) throws InternalLogException { } }
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "closeLog" , this ) ; // Check that the file is actually open if ( _activeFile == null ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "closeLog" , "InternalLogException" ) ; throw new InternalLogException ( null ) ; } try { _file1 . fileClose ( ) ; _file2 . fileClos...
public class Statement { /** * Return an Observable that emits the emissions from a specified Observable * if a condition evaluates to true , otherwise return an empty Observable * that runs on a specified Scheduler . * < img width = " 640 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / ima...
return ifThen ( condition , then , Observable . < R > empty ( ) . subscribeOn ( scheduler ) ) ;
public class BaseTraceService { /** * Publish a trace log record . * @ param detailLog the trace writer * @ param logRecord * @ param id the trace object id * @ param formattedMsg the result of { @ link BaseTraceFormatter # formatMessage } * @ param formattedVerboseMsg the result of { @ link BaseTraceFormatte...
// check if tracefilename is stdout if ( formattedVerboseMsg == null ) { formattedVerboseMsg = formatter . formatVerboseMessage ( logRecord , formattedMsg , false ) ; } RoutedMessage routedTrace = new RoutedMessageImpl ( formattedMsg , formattedVerboseMsg , null , logRecord ) ; invokeTraceRouters ( routedTrace ) ; /* *...
public class AbstractScaleThesisQueryPageHandler { /** * Updates field caption if field can be found . Used only when query already contains replies . * @ param queryPage query page * @ param fieldName field name * @ param fieldCaption field caption */ protected void synchronizeFieldCaption ( QueryPage queryPage ...
QueryFieldDAO queryFieldDAO = new QueryFieldDAO ( ) ; QueryOptionField queryField = ( QueryOptionField ) queryFieldDAO . findByQueryPageAndName ( queryPage , fieldName ) ; if ( queryField != null ) queryFieldDAO . updateCaption ( queryField , fieldCaption ) ;
public class HmacSignatureBuilder { /** * 完成HMAC认证消息的构建 , 并获得base64编码表示的签名摘要值 . * @ param builderMode * 构建模式的枚举 * @ return HMAC的base64编码表示的签名摘要值字符串 . 若构建失败 , 则返回 < code > null < / code > * @ author zhd * @ since 1.0.0 */ public String buildAsBase64 ( BuilderMode builderMode ) { } }
byte [ ] ret = build ( builderMode ) ; if ( Validator . isEmpty ( ret ) ) { return null ; } return DatatypeConverter . printBase64Binary ( ret ) ;
public class XPathContext { /** * Create a new < code > DTMIterator < / code > that holds exactly one node . * @ param node The node handle that the DTMIterator will iterate to . * @ return The newly created < code > DTMIterator < / code > . */ public DTMIterator createDTMIterator ( int node ) { } }
// DescendantIterator iter = new DescendantIterator ( ) ; DTMIterator iter = new org . apache . xpath . axes . OneStepIteratorForward ( Axis . SELF ) ; iter . setRoot ( node , this ) ; return iter ; // return m _ dtmManager . createDTMIterator ( node ) ;
public class ParserUtils { /** * PArses a URL with all the required parameters * @ param url of the document to parse * @ return the jsoup document * @ throws IOException if the connection fails */ public static Document parseDocument ( String url ) throws IOException { } }
return Jsoup . connect ( url ) . timeout ( Constants . PARSING_TIMEOUT ) . userAgent ( "Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6" ) . referrer ( "http://www.google.com" ) . get ( ) ;
public class ResourceUtil { /** * retrieves the primary type of the resources node */ public static String getPrimaryType ( Resource resource ) { } }
String result = null ; if ( resource != null ) { if ( resource instanceof JcrResource ) { // use the resource itself if it implements the JcrResource interface ( maybe a version of a resource ) result = ( ( JcrResource ) resource ) . getPrimaryType ( ) ; } else { Node node = resource . adaptTo ( Node . class ) ; if ( n...
public class LoopingDatasetFinderSource { /** * Sort input stream lexicographically . Noop if the input stream is already sorted . */ private < T extends URNIdentified > Stream < T > sortStreamLexicographically ( Stream < T > inputStream ) { } }
Spliterator < T > spliterator = inputStream . spliterator ( ) ; if ( spliterator . hasCharacteristics ( Spliterator . SORTED ) && spliterator . getComparator ( ) . equals ( this . lexicographicalComparator ) ) { return StreamSupport . stream ( spliterator , false ) ; } return StreamSupport . stream ( spliterator , fals...
public class MapRow { /** * Retrieve row from a nested table . * @ param name column name * @ return nested table rows */ @ SuppressWarnings ( "unchecked" ) public final List < MapRow > getRows ( String name ) { } }
return ( List < MapRow > ) getObject ( name ) ;
public class Dictionary { /** * 通过词典文件建立词典 * @ param path * @ return * @ throws FileNotFoundException */ private ArrayList < String [ ] > loadDict ( String path ) throws IOException { } }
Scanner scanner = new Scanner ( new FileInputStream ( path ) , "utf-8" ) ; ArrayList < String [ ] > al = new ArrayList < String [ ] > ( ) ; while ( scanner . hasNext ( ) ) { String line = scanner . nextLine ( ) . trim ( ) ; if ( line . length ( ) > 0 ) { String [ ] s = line . split ( "\\s" ) ; al . add ( s ) ; } } scan...
public class CmsRoleManager { /** * Returns all roles , in the given organizational unit . < p > * @ param cms the opencms context * @ param ouFqn the fully qualified name of the organizational unit of the role * @ param includeSubOus include roles of child organizational units * @ return a list of all < code >...
CmsOrganizationalUnit ou = OpenCms . getOrgUnitManager ( ) . readOrganizationalUnit ( cms , ouFqn ) ; List < CmsGroup > groups = m_securityManager . getGroups ( cms . getRequestContext ( ) , ou , includeSubOus , true ) ; List < CmsRole > roles = new ArrayList < CmsRole > ( groups . size ( ) ) ; Iterator < CmsGroup > it...
public class ListManagementImageListsImpl { /** * Creates an image list . * @ param contentType The content type . * @ param bodyParameter Schema of the body . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the ImageList object */ public Observable < Se...
if ( this . client . baseUrl ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.baseUrl() is required and cannot be null." ) ; } if ( contentType == null ) { throw new IllegalArgumentException ( "Parameter contentType is required and cannot be null." ) ; } if ( bodyParameter == null ) { throw n...
public class DirectoryIterator { /** * Command line method to walk the directories provided on the command line * and print out their contents * @ param args Directory names */ public static void main ( String [ ] args ) { } }
DirectoryIterator iter = new DirectoryIterator ( args ) ; while ( iter . hasNext ( ) ) System . out . println ( iter . next ( ) . getAbsolutePath ( ) ) ;
public class CloudDNSResourceRecordSetApi { /** * Has the side effect of removing the priority from the mutableRData . * @ return null or the priority , if it exists for a MX or SRV record */ private Integer getPriority ( Map < String , Object > mutableRData ) { } }
Integer priority = null ; if ( mutableRData . containsKey ( "priority" ) ) { // SRVData priority = Integer . class . cast ( mutableRData . remove ( "priority" ) ) ; } else if ( mutableRData . containsKey ( "preference" ) ) { // MXData priority = Integer . class . cast ( mutableRData . remove ( "preference" ) ) ; } retu...
public class EPubParserUtils { /** * 路径链接 * @ param path1 前路径 * @ param path2 后路径 * @ return */ public static String pathLinker ( String path1 , String path2 ) { } }
if ( ( path1 == null || path1 . equals ( "" ) ) && ( path2 == null || path2 . equals ( "" ) ) ) { return null ; } if ( path1 == null || path1 . equals ( "" ) ) { return path2 ; } if ( path2 == null || path2 . equals ( "" ) ) { return path1 ; } if ( path1 . endsWith ( File . separator ) ) { path1 = path1 . substring ( 0...
public class GroovyCategorySupport { /** * Create a scope based on given categoryClass and invoke closure within that scope . * @ param categoryClass the class containing category methods * @ param closure the closure during which to make the category class methods available * @ return the value returned from the...
return THREAD_INFO . getInfo ( ) . use ( categoryClass , closure ) ;
public class Sort { /** * get the median of the left , center and right * order these and hide the pivot by put it the end of of the array * @ param arr an array of Comparable * @ param left the most - left index of the subarray * @ param right the most - right index of the subarray * @ return T */ private st...
int center = ( left + right ) / 2 ; if ( arr [ left ] . compareTo ( arr [ center ] ) > 0 ) swapReferences ( arr , left , center ) ; if ( arr [ left ] . compareTo ( arr [ right ] ) > 0 ) swapReferences ( arr , left , right ) ; if ( arr [ center ] . compareTo ( arr [ right ] ) > 0 ) swapReferences ( arr , center , right ...
public class FileAwareInputStreamDataWriter { /** * Write the contents of input stream into staging path . * WriteAt indicates the path where the contents of the input stream should be written . When this method is called , * the path writeAt . getParent ( ) will exist already , but the path writeAt will not exist ...
final short replication = copyableFile . getReplication ( this . fs ) ; final long blockSize = copyableFile . getBlockSize ( this . fs ) ; final long fileSize = copyableFile . getFileStatus ( ) . getLen ( ) ; long expectedBytes = fileSize ; Long maxBytes = null ; // Whether writer must write EXACTLY maxBytes . boolean ...
public class MembersInterface { /** * Get a list of the members of a group . The call must be signed on behalf of a Flickr member , and the ability to see the group membership will be * determined by the Flickr member ' s group privileges . * @ param groupId * Return a list of members for this group . The group m...
MembersList < Member > members = new MembersList < Member > ( ) ; Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_LIST ) ; parameters . put ( "group_id" , groupId ) ; if ( perPage > 0 ) { parameters . put ( "per_page" , "" + perPage ) ; } if ( page > 0...
public class EmailIntentSender { /** * Creates a temporary file with the given content and name , to be used as an email attachment * @ param context a context * @ param name the name * @ param content the content * @ return a content uri for the file */ @ Nullable protected Uri createAttachmentFromString ( @ N...
final File cache = new File ( context . getCacheDir ( ) , name ) ; try { IOUtils . writeStringToFile ( cache , content ) ; return AcraContentProvider . getUriForFile ( context , cache ) ; } catch ( IOException ignored ) { } return null ;
public class PropertiesManagerCore { /** * Close GeoPackages not specified in the retain GeoPackage names * @ param retain * GeoPackages to retain */ public void closeRetainGeoPackages ( Collection < String > retain ) { } }
Set < String > close = new HashSet < > ( propertiesMap . keySet ( ) ) ; close . removeAll ( retain ) ; for ( String name : close ) { closeGeoPackage ( name ) ; }
public class PvmExecutionImpl { /** * Ends an execution . Invokes end listeners for the current activity and notifies the flow scope execution * of this happening which may result in the flow scope ending . * @ param completeScope true if ending the execution contributes to completing the BPMN 2.0 scope */ @ Overri...
setCompleteScope ( completeScope ) ; isActive = false ; isEnded = true ; if ( hasReplacedParent ( ) ) { getParent ( ) . replacedBy = null ; } performOperation ( PvmAtomicOperation . ACTIVITY_NOTIFY_LISTENER_END ) ;
public class CocoQuery { /** * Show toast message with long duration * @ param strId */ public void longToast ( final int strId ) { } }
if ( act == null ) return ; act . runOnUiThread ( new Runnable ( ) { public void run ( ) { Toast . makeText ( act , strId , Toast . LENGTH_LONG ) . show ( ) ; } } ) ;
public class MiriamLink { /** * Retrieves the location ( or country ) of a resource ( example : " United Kingdom " ) . * @ param resourceId identifier of a resource ( example : " MIR : 00100009 " ) * @ return the location ( the country ) where the resource is managed */ public static String getResourceLocation ( St...
Resource resource = getResource ( resourceId ) ; return resource . getDataLocation ( ) ;
public class CmsHtmlList { /** * Sets the sorted column . < p > * @ param sortedColumn the sorted column to set * @ throws CmsIllegalArgumentException if the < code > sortedColumn < / code > argument is invalid */ public void setSortedColumn ( String sortedColumn ) throws CmsIllegalArgumentException { } }
// check if the parameter is valid if ( ( getMetadata ( ) . getColumnDefinition ( sortedColumn ) == null ) || ! getMetadata ( ) . getColumnDefinition ( sortedColumn ) . isSorteable ( ) ) { return ; } // reset view setCurrentPage ( 1 ) ; // only reverse order if the column to sort is already sorted if ( sortedColumn . e...
public class StartExportTaskRequest { /** * The file format for the returned export data . Default value is < code > CSV < / code > . < b > Note : < / b > < i > The < / i > * < code > GRAPHML < / code > < i > option has been deprecated . < / i > * @ param exportDataFormat * The file format for the returned export...
if ( exportDataFormat == null ) { this . exportDataFormat = null ; return ; } this . exportDataFormat = new java . util . ArrayList < String > ( exportDataFormat ) ;
public class MutationsUtil { /** * This one shifts indels to the left at homopolymer regions Applicable to KAligner data , which normally put indels * randomly along such regions Required for filterMutations algorithm to work correctly Works inplace * @ param seq1 reference sequence for the mutations * @ param mu...
return shiftIndelsAtHomopolymers ( seq1 , 0 , mutations ) ;
public class PaginatedResult { /** * Retrieves a Set of objects from the result . * @ param < T > the type defined in the Set * @ param clazz the type defined in the Set * @ return a Collection of objects from the result . * @ since 1.0.0 */ @ SuppressWarnings ( "unchecked" ) public < T > Set < T > getSet ( Cla...
return ( Set < T > ) objects ;
public class GradleDependencyResolver { /** * append new task to bom file */ private boolean appendTaskToBomFile ( File buildGradleTmp ) { } }
FileReader fileReader ; BufferedReader bufferedReader = null ; InputStream inputStream = null ; boolean hasDependencies = false ; try { // appending the task only if the build . gradle file has ' dependencies { ' node ( only at the beginning of the line ) // otherwise , later when the task is ran it ' ll fail fileReade...
public class JsonActionInvocation { /** * If the DefaultActionInvocation has been executed before and the Result is * an instance of ActionChainResult , this method will walk down the chain of * ActionChainResults until it finds a non - chain result , which will be * returned . If the DefaultActionInvocation ' s ...
Result returnResult = result ; // If we ' ve chained to other Actions , we need to find the last result while ( returnResult instanceof ActionChainResult ) { ActionProxy aProxy = ( ( ActionChainResult ) returnResult ) . getProxy ( ) ; if ( aProxy != null ) { Result proxyResult = aProxy . getInvocation ( ) . getResult (...
public class Stopwatch { /** * Gets the total elapsed time measured by the current instance , in hours . * 3600000 Ticks = 1 hour ( 60 minutes ) */ public long getElapsedHours ( ) { } }
long elapsed ; if ( running ) { elapsed = ( System . nanoTime ( ) - startTime ) ; } else { elapsed = ( stopTime - startTime ) ; } return elapsed / nsPerHh ;
public class YearMonth { /** * Obtains the current year - month from the specified clock . * This will query the specified clock to obtain the current year - month . * Using this method allows the use of an alternate clock for testing . * The alternate clock may be introduced using { @ link Clock dependency injec...
final LocalDate now = LocalDate . now ( clock ) ; // called once return YearMonth . of ( now . getYear ( ) , now . getMonth ( ) ) ;
public class GenericEncodingStrategy { /** * Generates code to get a Lob from a locator from RawSupport . RawSupport * instance , Storable instance , property name and long locator must be on * the stack . Result is a Lob on the stack , which may be null . */ private void getLobFromLocator ( CodeAssembler a , Stora...
if ( ! info . isLob ( ) ) { throw new IllegalArgumentException ( ) ; } TypeDesc type = info . getStorageType ( ) ; String name ; if ( Blob . class . isAssignableFrom ( type . toClass ( ) ) ) { name = "getBlob" ; } else if ( Clob . class . isAssignableFrom ( type . toClass ( ) ) ) { name = "getClob" ; } else { throw new...
public class CkyPcfgParser { /** * Process a cell ( binary rules only ) using the left - child to constrain the set of rules we consider . * This follows the description in ( Dunlop et al . , 2010 ) . */ private static final void processCellRightChild ( final CnfGrammar grammar , final Chart chart , final int start ,...
// Apply binary rules . for ( int mid = start + 1 ; mid <= end - 1 ; mid ++ ) { ChartCell leftCell = chart . getCell ( start , mid ) ; ChartCell rightCell = chart . getCell ( mid , end ) ; // Loop through each right child non - terminal . for ( final int rightChildNt : rightCell . getNts ( ) ) { double rightScoreForNt ...
public class SQLiteDatabaseSchema { /** * property in different class , but same name , must have same column name . * @ param listEntity * the list entity * @ param p * the p */ private void checkName ( Set < SQLProperty > listEntity , SQLProperty p ) { } }
for ( SQLProperty item : listEntity ) { AssertKripton . assertTrueOrInvalidPropertyName ( item . columnName . equals ( p . columnName ) , item , p ) ; }
public class BigFloat { /** * Returns the the minimum of two { @ link BigFloat } values . * @ param value1 the first { @ link BigFloat } value to compare * @ param value2 the second { @ link BigFloat } value to compare * @ return the minimum { @ link BigFloat } value */ public static BigFloat min ( BigFloat value...
return value1 . compareTo ( value2 ) < 0 ? value1 : value2 ;
public class ReadOnlyObjectPropertyAssert { /** * Verifies that the actual observable has the same value as the given observable . * @ param expectedValue the observable value to compare with the actual observables current value . * @ return { @ code this } assertion instance . */ public ReadOnlyObjectPropertyAsser...
new ObservableValueAssertions < > ( actual ) . hasSameValue ( expectedValue ) ; return this ;
public class PropertyResolverFactory { /** * Return All property values for the input property set mapped by name to value . * @ param list property list * @ param resolver property resolver * @ return All mapped properties by name and value . */ public static Map < String , Object > mapPropertyValues ( final Lis...
final Map < String , Object > inputConfig = new HashMap < String , Object > ( ) ; for ( final Property property : list ) { final Object value = resolver . resolvePropertyValue ( property . getName ( ) , property . getScope ( ) ) ; if ( null == value ) { continue ; } inputConfig . put ( property . getName ( ) , value ) ...
public class AbstractDb { /** * 分页查询 < br > * 查询条件为多个key value对表示 , 默认key = value , 如果使用其它条件可以使用 : where . put ( " key " , " & gt ; 1 " ) , value也可以传Condition对象 , key被忽略 * @ param < T > 结果对象类型 * @ param fields 返回的字段列表 , null则返回所有字段 * @ param where 条件实体类 ( 包含表名 ) * @ param page 页码 * @ param numPerPage 每页条目数 ...
Connection conn = null ; try { conn = this . getConnection ( ) ; return runner . page ( conn , fields , where , page , numPerPage , rsh ) ; } catch ( SQLException e ) { throw e ; } finally { this . closeConnection ( conn ) ; }
public class GsonUtil { /** * 反序列化 * @ param json * @ return */ public static Option fromJSON ( String json ) { } }
Gson gson = new GsonBuilder ( ) . setPrettyPrinting ( ) . registerTypeAdapter ( Series . class , new SeriesDeserializer ( ) ) . registerTypeAdapter ( Axis . class , new AxisDeserializer ( ) ) . create ( ) ; Option option = gson . fromJson ( json , Option . class ) ; return option ;
public class AbstractApi { /** * Perform a file upload with the specified File instance and path objects , returning * a ClientResponse instance with the data returned from the endpoint . * @ param expectedStatus the HTTP status that should be returned from the server * @ param name the name for the form field th...
try { return validate ( getApiClient ( ) . upload ( name , fileToUpload , mediaType , url ) , expectedStatus ) ; } catch ( Exception e ) { throw handle ( e ) ; }
public class DatabasesInner { /** * Returns a list of databases in a server . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ param expand A comma...
return listByServerWithServiceResponseAsync ( resourceGroupName , serverName , expand , filter ) . toBlocking ( ) . single ( ) . body ( ) ;
public class MethodResource { /** * Invokes a Service Definition method on an object , using GET . */ @ Path ( "/{sDef}/{method}" ) @ GET public Response invokeSDefMethodUsingGET ( @ javax . ws . rs . core . Context UriInfo uriInfo , @ PathParam ( RestParam . PID ) String pid , @ PathParam ( RestParam . SDEF ) String s...
try { Date asOfDateTime = DateUtility . parseDateOrNull ( dTime ) ; return buildResponse ( m_access . getDissemination ( getContext ( ) , pid , sDef , method , toProperties ( uriInfo . getQueryParameters ( ) , asOfDateTime != null ) , asOfDateTime ) ) ; } catch ( Exception e ) { return handleException ( e , flash ) ; }
public class HttpClientPipelineConfigurator { /** * See < a href = " https : / / http2 . github . io / http2 - spec / # discover - https " > HTTP / 2 specification < / a > . */ private void configureAsHttps ( Channel ch , InetSocketAddress remoteAddr ) { } }
assert sslCtx != null ; final ChannelPipeline p = ch . pipeline ( ) ; final SslHandler sslHandler = sslCtx . newHandler ( ch . alloc ( ) , remoteAddr . getHostString ( ) , remoteAddr . getPort ( ) ) ; p . addLast ( configureSslHandler ( sslHandler ) ) ; p . addLast ( TrafficLoggingHandler . CLIENT ) ; p . addLast ( new...
public class LdapNameBuilder { /** * Add a Rdn to the built LdapName . * @ param key the rdn attribute key . * @ param value the rdn value . * @ return this builder . */ public LdapNameBuilder add ( String key , Object value ) { } }
Assert . hasText ( key , "key must not be blank" ) ; Assert . notNull ( key , "value must not be null" ) ; try { ldapName . add ( new Rdn ( key , value ) ) ; return this ; } catch ( InvalidNameException e ) { throw new org . springframework . ldap . InvalidNameException ( e ) ; }
public class Types { /** * Adapt a type by computing a substitution which maps a source * type to a target type . * @ param source the source type * @ param target the target type * @ param from the type variables of the computed substitution * @ param to the types of the computed substitution . */ public voi...
new Adapter ( from , to ) . adapt ( source , target ) ;
public class PBKDF2Engine { /** * Core Password Based Key Derivation Function 2. * @ see < a href = " http : / / tools . ietf . org / html / rfc2898 " > RFC 2898 5.2 < / a > * @ param prf * Pseudo Random Function ( i . e . HmacSHA1) * @ param S * Salt as array of bytes . < code > null < / code > means no salt...
if ( S == null ) { S = new byte [ 0 ] ; } int hLen = prf . getHLen ( ) ; int l = ceil ( dkLen , hLen ) ; int r = dkLen - ( l - 1 ) * hLen ; byte T [ ] = new byte [ l * hLen ] ; int ti_offset = 0 ; for ( int i = 1 ; i <= l ; i ++ ) { _F ( T , ti_offset , prf , S , c , i ) ; ti_offset += hLen ; } if ( r < hLen ) { // Inc...
public class StringParser { /** * Parse the given { @ link String } as { @ link BigInteger } with the specified * radix . * @ param sStr * The String to parse . May be < code > null < / code > . * @ param nRadix * The radix to use . Must be & ge ; { @ link Character # MIN _ RADIX } and & le ; * { @ link Cha...
return parseBigInteger ( sStr , nRadix , null ) ;
public class ApplicationUrl { /** * Get Resource Url for RenamePackageFile * @ param applicationKey The application key uniquely identifies the developer namespace , application ID , version , and package in Dev Center . The format is { Dev Account namespace } . { Application ID } . { Application Version } . { Packag...
UrlFormatter formatter = new UrlFormatter ( "/api/platform/developer/packages/{applicationKey}/files_rename?responseFields={responseFields}" ) ; formatter . formatUrl ( "applicationKey" , applicationKey ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( )...
public class SimpleBase { /** * Copy matrix B into this matrix at location ( insertRow , insertCol ) . * @ param insertRow First row the matrix is to be inserted into . * @ param insertCol First column the matrix is to be inserted into . * @ param B The matrix that is being inserted . */ public void insertIntoThi...
convertType . specify ( this , B ) ; B = convertType . convert ( B ) ; // See if this type ' s need to be changed or not if ( convertType . commonType == getType ( ) ) { insert ( B . mat , mat , insertRow , insertCol ) ; } else { T A = convertType . convert ( this ) ; A . insert ( B . mat , A . mat , insertRow , insert...
public class GosuDocument { /** * Returns a style code for the absolute position in the document or null if * no code is mapped . */ public Integer getStyleCodeAtPosition ( int iPosition ) { } }
if ( _locations == null || _locations . isEmpty ( ) ) { return null ; } IParseTree l ; try { l = IParseTree . Search . getDeepestLocation ( _locations , iPosition - _locationsOffset , true ) ; } catch ( Throwable t ) { // Ok , what we are guarding against here is primarly a InnerClassNotFoundException . These can happe...
public class MailAccount { /** * 获得SMTP相关信息 * @ return { @ link Properties } */ public Properties getSmtpProps ( ) { } }
// 全局系统参数 System . setProperty ( SPLIT_LONG_PARAMS , String . valueOf ( this . splitlongparameters ) ) ; final Properties p = new Properties ( ) ; p . put ( MAIL_PROTOCOL , "smtp" ) ; p . put ( SMTP_HOST , this . host ) ; p . put ( SMTP_PORT , String . valueOf ( this . port ) ) ; p . put ( SMTP_AUTH , String . valueOf ...
public class AdGroupCriterionOperation { /** * Gets the exemptionRequests value for this AdGroupCriterionOperation . * @ return exemptionRequests * List of exemption requests for policy violations flagged by * this criterion . * < p > Only set this field when adding criteria that * trigger policy violations *...
return exemptionRequests ;
public class UrlBeautifier { /** * < code > * Adds a new replacement rule that will only be applied to the specified refinement . The original * search term and refinements will be put back into the query object . * If replacement is null the target character will be removed . * Note : Replacements that are cha...
if ( ! ( ( Character ) target ) . equals ( replacement ) ) { replacementRules . add ( new UrlReplacementRule ( target , replacement , refinementName ) ) ; }
public class ListTablesResult { /** * The names of the tables associated with the current account at the current endpoint . The maximum size of this * array is 100. * If < code > LastEvaluatedTableName < / code > also appears in the output , you can use this value as the * < code > ExclusiveStartTableName < / cod...
if ( tableNames == null ) { this . tableNames = null ; return ; } this . tableNames = new java . util . ArrayList < String > ( tableNames ) ;
public class MFVec2f { /** * Insert a new value prior to the index location in the existing value array , * increasing the field length accordingly . * @ param index - where the new values in an SFVec2f object will be placed in the array list * @ param newValue - the new x , y value for the array list */ public v...
if ( newValue . length == 2 ) { try { value . add ( index , new SFVec2f ( newValue [ 0 ] , newValue [ 1 ] ) ) ; } catch ( IndexOutOfBoundsException e ) { Log . e ( TAG , "X3D MFVec2f get1Value(index) out of bounds." + e ) ; } catch ( Exception e ) { Log . e ( TAG , "X3D MFVec2f get1Value(index) exception " + e ) ; } } ...
public class ChainedRow { /** * Returns values aggregated from all the delegates , without overriding * values that already exist . * @ return The Map of aggregated values */ @ Override public Map < String , String > values ( ) { } }
Map < String , String > values = new LinkedHashMap < > ( ) ; for ( Row each : delegates ) { for ( Entry < String , String > entry : each . values ( ) . entrySet ( ) ) { String name = entry . getKey ( ) ; if ( ! values . containsKey ( name ) ) { values . put ( name , entry . getValue ( ) ) ; } } } return values ;
public class NodeSetDTM { /** * Same as setElementAt . * @ param node The node to be set . * @ param index The index of the node to be replaced . * @ throws RuntimeException thrown if this NodeSetDTM is not of * a mutable type . */ public void setItem ( int node , int index ) { } }
if ( ! m_mutable ) throw new RuntimeException ( XSLMessages . createXPATHMessage ( XPATHErrorResources . ER_NODESETDTM_NOT_MUTABLE , null ) ) ; // " This NodeSetDTM is not mutable ! " ) ; super . setElementAt ( node , index ) ;
public class WriteBuffer { /** * Writes a single octet to the buffer , expanding if necessary . */ public void writeByte ( final byte octet ) { } }
if ( remaining ( ) < 1 ) { if ( index == blocks . size ( ) - 1 ) { allocateNewBlock ( ) ; } index ++ ; current = blocks . get ( index ) ; } final Block block = current ; block . data [ block . limit ] = octet ; block . limit ++ ;
public class CmsDriverManager { /** * Returns the set of users that are responsible for a specific resource . < p > * @ param dbc the current database context * @ param resource the resource to get the responsible users from * @ return the set of users that are responsible for a specific resource * @ throws Cms...
Set < CmsUser > result = new HashSet < CmsUser > ( ) ; Iterator < I_CmsPrincipal > principals = readResponsiblePrincipals ( dbc , resource ) . iterator ( ) ; while ( principals . hasNext ( ) ) { I_CmsPrincipal principal = principals . next ( ) ; if ( principal . isGroup ( ) ) { try { result . addAll ( getUsersOfGroup (...
public class GZIPArchiveReader { /** * Reads a short in little - endian from the stream . */ private static short readLEShort ( InputStream in ) throws IOException { } }
short s = ( byte ) in . read ( ) ; s |= ( byte ) in . read ( ) << 8 ; return s ;
public class Person { /** * Method to get the Language of the UserInterface for this Person . Default * is english . * @ return iso code of a language */ public String getLanguage ( ) { } }
return this . attrValues . get ( Person . AttrName . LANGUAGE ) != null ? this . attrValues . get ( Person . AttrName . LANGUAGE ) : Locale . ENGLISH . getISO3Language ( ) ;
public class CPOptionLocalServiceWrapper { /** * Returns the cp option matching the UUID and group . * @ param uuid the cp option ' s UUID * @ param groupId the primary key of the group * @ return the matching cp option , or < code > null < / code > if a matching cp option could not be found */ @ Override public ...
return _cpOptionLocalService . fetchCPOptionByUuidAndGroupId ( uuid , groupId ) ;
public class CmsDefaultXmlContentHandler { /** * Writes the categories if a category widget is present . < p > * @ param cms the cms context * @ param file the file * @ param content the xml content to set the categories for * @ return the perhaps modified file * @ throws CmsException if something goes wrong ...
if ( CmsWorkplace . isTemporaryFile ( file ) ) { // ignore temporary file if the original file exists ( not the case for direct edit : " new " ) if ( CmsResource . isTemporaryFileName ( file . getRootPath ( ) ) ) { String originalFileName = CmsResource . getFolderPath ( file . getRootPath ( ) ) + CmsResource . getName ...
public class HtmlDocletWriter { /** * Get Package link , with target frame . * @ param pkg The link will be to the " package - summary . html " page for this package * @ param target name of the target frame * @ param label tag for the link * @ return a content for the target package link */ public Content getT...
return getHyperLink ( pathString ( pkg , DocPaths . PACKAGE_SUMMARY ) , label , "" , target ) ;
public class OIndexProxy { /** * { @ inheritDoc } */ public Collection < OIdentifiable > getValues ( Collection < ? > iKeys ) { } }
final Object result = lastIndex . getValues ( iKeys ) ; return ( Collection < OIdentifiable > ) applyTailIndexes ( result , - 1 ) ;
public class FilterResults { /** * Main visualizer setup . */ private void init ( ) { } }
this . setLayout ( new BorderLayout ( ) ) ; // MAIN PANEL JPanel mainPanel = new JPanel ( ) ; Border margin = new EmptyBorder ( 10 , 10 , 5 , 10 ) ; mainPanel . setBorder ( margin ) ; mainPanel . setLayout ( new BoxLayout ( mainPanel , BoxLayout . Y_AXIS ) ) ; mainPanel . add ( makeTitlePanel ( ) ) ;
public class LogMonitorSessionIO { /** * Saves current session to the persistent storage */ static void saveCurrentSession ( Context context , LogMonitorSession session ) { } }
if ( context == null ) { throw new IllegalArgumentException ( "Context is null" ) ; } if ( session == null ) { throw new IllegalArgumentException ( "Session is null" ) ; } SharedPreferences prefs = getPrefs ( context ) ; SharedPreferences . Editor editor = prefs . edit ( ) ; editor . putString ( PREFS_KEY_EMAIL_RECIPIE...
public class StoppedAnnotation { /** * { @ inheritDoc } */ public void writeDown ( Text text ) { } }
text . setStyle ( Styles . BACKGROUND_COLOR , Colors . RED ) ; text . setStatus ( Status . FAILLURE ) ; text . setContent ( message ( ) ) ;
public class cachepolicy_cachepolicylabel_binding { /** * Use this API to fetch cachepolicy _ cachepolicylabel _ binding resources of given name . */ public static cachepolicy_cachepolicylabel_binding [ ] get ( nitro_service service , String policyname ) throws Exception { } }
cachepolicy_cachepolicylabel_binding obj = new cachepolicy_cachepolicylabel_binding ( ) ; obj . set_policyname ( policyname ) ; cachepolicy_cachepolicylabel_binding response [ ] = ( cachepolicy_cachepolicylabel_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class AbstractDomainObject { /** * Subclasses may override this method to include or exclude some properties * in toString . By default only " simple " types will be included in toString . * Relations to other domain objects can not be included since we don ' t know * if they are fetched and we don ' t won...
return acceptedToStringTypes . contains ( field . getType ( ) ) || acceptedToStringTypes . contains ( field . getType ( ) . getName ( ) ) ;
public class AbstractWebAppMain { /** * Sets the root application object . */ protected void setApplicationObject ( ) { } }
try { Object app = createApplication ( ) ; context . setAttribute ( APP , app ) ; initializer . set ( app ) ; } catch ( Error e ) { LOGGER . log ( Level . SEVERE , "Failed to initialize " + getApplicationName ( ) , e ) ; initializer . setException ( e ) ; throw e ; } catch ( RuntimeException e ) { LOGGER . log ( Level ...
public class CmsCloneModuleThread { /** * Deletes the temporarily copied classes files . < p > * @ param targetModulePath the target module path * @ param sourcePathPart the path part of the source module * @ param targetPathPart the target path part * @ throws CmsException if something goes wrong */ private vo...
String sourceFirstFolder = sourcePathPart . substring ( 0 , sourcePathPart . indexOf ( '/' ) ) ; String targetFirstFolder = sourcePathPart . substring ( 0 , sourcePathPart . indexOf ( '/' ) ) ; if ( ! sourceFirstFolder . equals ( targetFirstFolder ) ) { getCms ( ) . deleteResource ( targetModulePath + PATH_CLASSES + so...
public class HystrixPropertiesManager { /** * Creates and sets Hystrix command properties . * @ param properties the collapser properties */ public static HystrixCommandProperties . Setter initializeCommandProperties ( List < HystrixProperty > properties ) throws IllegalArgumentException { } }
return initializeProperties ( HystrixCommandProperties . Setter ( ) , properties , CMD_PROP_MAP , "command" ) ;
public class Json { /** * Write to the supplied writer the modified JSON representation of the supplied in - memory { @ link Document } . The resulting * JSON will have no embedded line feeds or extra spaces . * This format is compact and easy for software to read , but usually very difficult for people to read any...
getCompactJsonWriter ( ) . write ( bson , stream ) ;
public class AuthConfigFactoryWrapper { /** * Make sure we don ' t dump multiple messages to the logs by only * initializing once . */ synchronized static void setFactoryImplementation ( ) { } }
if ( initialized ) return ; initialized = true ; String authConfigProvider = Security . getProperty ( AuthConfigFactory . DEFAULT_FACTORY_SECURITY_PROPERTY ) ; if ( authConfigProvider == null || authConfigProvider . isEmpty ( ) ) { Tr . info ( tc , "JASPI_DEFAULT_AUTH_CONFIG_FACTORY" , new Object [ ] { JASPI_PROVIDER_R...
public class DeleteWebhookRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteWebhookRequest deleteWebhookRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteWebhookRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteWebhookRequest . getProjectName ( ) , PROJECTNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " ...