signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class LToSrtBiFunctionBuilder { /** * Adds full new case for the argument that are of specific classes ( matched by instanceOf , null is a wildcard ) . */ @ Nonnull public < V1 extends T1 , V2 extends T2 > LToSrtBiFunctionBuilder < T1 , T2 > aCase ( Class < V1 > argC1 , Class < V2 > argC2 , LToSrtBiFunction < V1 , V2 > function ) { } }
PartialCaseWithSrtProduct . The pc = partialCaseFactoryMethod ( ( a1 , a2 ) -> ( argC1 == null || argC1 . isInstance ( a1 ) ) && ( argC2 == null || argC2 . isInstance ( a2 ) ) ) ; pc . evaluate ( function ) ; return self ( ) ;
public class DirectedMultigraph { /** * { @ inheritDoc } */ public boolean remove ( int vertex ) { } }
// If we can remove the vertex from the global set , then at least one of // the type - specific graphs has this vertex . SparseDirectedTypedEdgeSet < T > edges = vertexToEdges . remove ( vertex ) ; if ( edges != null ) { size -= edges . size ( ) ; for ( int other : edges . connected ( ) ) { vertexToEdges . get ( other ) . disconnect ( vertex ) ; } // Check whether removing this vertex has caused us to remove // the last edge for this type in the graph . If so , the graph // no longer has this type and we need to update the state . for ( DirectedTypedEdge < T > e : edges ) updateTypeCounts ( e . edgeType ( ) , - 1 ) ; // Update any of the subgraphs that had this vertex to notify them // that it was removed Iterator < WeakReference < Subgraph > > iter = subgraphs . iterator ( ) ; while ( iter . hasNext ( ) ) { WeakReference < Subgraph > ref = iter . next ( ) ; Subgraph s = ref . get ( ) ; // Check whether this subgraph was already gc ' d ( the subgraph // was no longer in use ) and if so , remove the ref from the list // to avoid iterating over it again if ( s == null ) { iter . remove ( ) ; continue ; } // If we removed the vertex from the subgraph , then check // whether we also removed any of the types in that subgraph if ( s . vertexSubset . remove ( vertex ) ) { Iterator < T > subgraphTypesIter = s . validTypes . iterator ( ) ; while ( subgraphTypesIter . hasNext ( ) ) { if ( ! typeCounts . containsKey ( subgraphTypesIter . next ( ) ) ) subgraphTypesIter . remove ( ) ; } } } return true ; } return false ;
public class AndroidExecutors { /** * Compatibility helper function for * { @ link java . util . concurrent . ThreadPoolExecutor # allowCoreThreadTimeOut ( boolean ) } * Only available on android - 9 + . * @ param executor the { @ link java . util . concurrent . ThreadPoolExecutor } * @ param value true if should time out , else false */ @ SuppressLint ( "NewApi" ) public static void allowCoreThreadTimeout ( ThreadPoolExecutor executor , boolean value ) { } }
if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . GINGERBREAD ) { executor . allowCoreThreadTimeOut ( value ) ; }
public class UserPreferences { /** * Read persistent global UserPreferences from file in the user ' s home * directory . */ public void read ( ) { } }
File prefFile = new File ( SystemProperties . getProperty ( "user.home" ) , PREF_FILE_NAME ) ; if ( ! prefFile . exists ( ) || ! prefFile . isFile ( ) ) { return ; } try { read ( new FileInputStream ( prefFile ) ) ; } catch ( IOException e ) { // Ignore - just use default preferences }
public class PathChildrenCache { /** * NOTE : this is a BLOCKING method . Rebuild the internal cache for the given node by querying * for all needed data WITHOUT generating any events to send to listeners . * @ param fullPath full path of the node to rebuild * @ throws Exception errors */ public void rebuildNode ( String fullPath ) throws Exception { } }
Preconditions . checkArgument ( ZKPaths . getPathAndNode ( fullPath ) . getPath ( ) . equals ( path ) , "Node is not part of this cache: " + fullPath ) ; Preconditions . checkState ( ! executorService . isShutdown ( ) , "cache has been closed" ) ; ensurePath ( ) ; internalRebuildNode ( fullPath ) ; // this is necessary so that any updates that occurred while rebuilding are taken // have to rebuild entire tree in case this node got deleted in the interim offerOperation ( new RefreshOperation ( this , RefreshMode . FORCE_GET_DATA_AND_STAT ) ) ;
public class AndroidExecutors { /** * Creates a proper Cached Thread Pool . Tasks will reuse cached threads if available * or create new threads until the core pool is full . tasks will then be queued . If an * task cannot be queued , a new thread will be created unless this would exceed max pool * size , then the task will be rejected . Threads will time out after 1 second . * Core thread timeout is only available on android - 9 + . * @ return the newly created thread pool */ public static ExecutorService newCachedThreadPool ( ) { } }
ThreadPoolExecutor executor = new ThreadPoolExecutor ( CORE_POOL_SIZE , MAX_POOL_SIZE , KEEP_ALIVE_TIME , TimeUnit . SECONDS , new LinkedBlockingQueue < Runnable > ( ) ) ; allowCoreThreadTimeout ( executor , true ) ; return executor ;
public class MapRow { /** * Retrieve a boolean value . * @ param name column name * @ return boolean value */ public final boolean getBoolean ( String name ) { } }
boolean result = false ; Boolean value = ( Boolean ) getObject ( name ) ; if ( value != null ) { result = BooleanHelper . getBoolean ( value ) ; } return result ;
public class Cache { /** * Adds all data from a Message into the Cache . Each record is added with * the appropriate credibility , and negative answers are cached as such . * @ param in The Message to be added * @ return A SetResponse that reflects what would be returned from a cache * lookup , or null if nothing useful could be cached from the message . * @ see Message */ public SetResponse addMessage ( Message in ) { } }
boolean isAuth = in . getHeader ( ) . getFlag ( Flags . AA ) ; Record question = in . getQuestion ( ) ; Name qname ; Name curname ; int qtype ; int qclass ; int cred ; int rcode = in . getHeader ( ) . getRcode ( ) ; boolean completed = false ; RRset [ ] answers , auth , addl ; SetResponse response = null ; boolean verbose = Options . check ( "verbosecache" ) ; HashSet additionalNames ; if ( ( rcode != Rcode . NOERROR && rcode != Rcode . NXDOMAIN ) || question == null ) return null ; qname = question . getName ( ) ; qtype = question . getType ( ) ; qclass = question . getDClass ( ) ; curname = qname ; additionalNames = new HashSet ( ) ; answers = in . getSectionRRsets ( Section . ANSWER ) ; for ( int i = 0 ; i < answers . length ; i ++ ) { if ( answers [ i ] . getDClass ( ) != qclass ) continue ; int type = answers [ i ] . getType ( ) ; Name name = answers [ i ] . getName ( ) ; cred = getCred ( Section . ANSWER , isAuth ) ; if ( ( type == qtype || qtype == Type . ANY ) && name . equals ( curname ) ) { addRRset ( answers [ i ] , cred ) ; completed = true ; if ( curname == qname ) { if ( response == null ) response = new SetResponse ( SetResponse . SUCCESSFUL ) ; response . addRRset ( answers [ i ] ) ; } markAdditional ( answers [ i ] , additionalNames ) ; } else if ( type == Type . CNAME && name . equals ( curname ) ) { CNAMERecord cname ; addRRset ( answers [ i ] , cred ) ; if ( curname == qname ) response = new SetResponse ( SetResponse . CNAME , answers [ i ] ) ; cname = ( CNAMERecord ) answers [ i ] . first ( ) ; curname = cname . getTarget ( ) ; } else if ( type == Type . DNAME && curname . subdomain ( name ) ) { DNAMERecord dname ; addRRset ( answers [ i ] , cred ) ; if ( curname == qname ) response = new SetResponse ( SetResponse . DNAME , answers [ i ] ) ; dname = ( DNAMERecord ) answers [ i ] . first ( ) ; try { curname = curname . fromDNAME ( dname ) ; } catch ( NameTooLongException e ) { break ; } } } auth = in . getSectionRRsets ( Section . AUTHORITY ) ; RRset soa = null , ns = null ; for ( int i = 0 ; i < auth . length ; i ++ ) { if ( auth [ i ] . getType ( ) == Type . SOA && curname . subdomain ( auth [ i ] . getName ( ) ) ) soa = auth [ i ] ; else if ( auth [ i ] . getType ( ) == Type . NS && curname . subdomain ( auth [ i ] . getName ( ) ) ) ns = auth [ i ] ; } if ( ! completed ) { /* This is a negative response or a referral . */ int cachetype = ( rcode == Rcode . NXDOMAIN ) ? 0 : qtype ; if ( rcode == Rcode . NXDOMAIN || soa != null || ns == null ) { /* Negative response */ cred = getCred ( Section . AUTHORITY , isAuth ) ; SOARecord soarec = null ; if ( soa != null ) soarec = ( SOARecord ) soa . first ( ) ; addNegative ( curname , cachetype , soarec , cred ) ; if ( response == null ) { int responseType ; if ( rcode == Rcode . NXDOMAIN ) responseType = SetResponse . NXDOMAIN ; else responseType = SetResponse . NXRRSET ; response = SetResponse . ofType ( responseType ) ; } /* DNSSEC records are not cached . */ } else { /* Referral response */ cred = getCred ( Section . AUTHORITY , isAuth ) ; addRRset ( ns , cred ) ; markAdditional ( ns , additionalNames ) ; if ( response == null ) response = new SetResponse ( SetResponse . DELEGATION , ns ) ; } } else if ( rcode == Rcode . NOERROR && ns != null ) { /* Cache the NS set from a positive response . */ cred = getCred ( Section . AUTHORITY , isAuth ) ; addRRset ( ns , cred ) ; markAdditional ( ns , additionalNames ) ; } addl = in . getSectionRRsets ( Section . ADDITIONAL ) ; for ( int i = 0 ; i < addl . length ; i ++ ) { int type = addl [ i ] . getType ( ) ; if ( type != Type . A && type != Type . AAAA && type != Type . A6 ) continue ; Name name = addl [ i ] . getName ( ) ; if ( ! additionalNames . contains ( name ) ) continue ; cred = getCred ( Section . ADDITIONAL , isAuth ) ; addRRset ( addl [ i ] , cred ) ; } if ( verbose ) System . out . println ( "addMessage: " + response ) ; return ( response ) ;
public class DefaultGroovyMethods { /** * Returns the longest prefix of this list where each element * passed to the given closure condition evaluates to true . * Similar to { @ link # takeWhile ( Iterable , groovy . lang . Closure ) } * except that it attempts to preserve the type of the original list . * < pre class = " groovyTestCase " > * def nums = [ 1 , 3 , 2 ] * assert nums . takeWhile { it { @ code < } 1 } = = [ ] * assert nums . takeWhile { it { @ code < } 3 } = = [ 1 ] * assert nums . takeWhile { it { @ code < } 4 } = = [ 1 , 3 , 2 ] * < / pre > * @ param self the original list * @ param condition the closure that must evaluate to true to * continue taking elements * @ return a prefix of the given list where each element passed to * the given closure evaluates to true * @ since 1.8.7 */ public static < T > List < T > takeWhile ( List < T > self , @ ClosureParams ( FirstParam . FirstGenericType . class ) Closure condition ) { } }
int num = 0 ; BooleanClosureWrapper bcw = new BooleanClosureWrapper ( condition ) ; for ( T value : self ) { if ( bcw . call ( value ) ) { num += 1 ; } else { break ; } } return take ( self , num ) ;
public class MediaOverlay { /** * Adds a dirty region to this overlay . */ public void addDirtyRegion ( Rectangle rect ) { } }
// Only add dirty regions where rect intersects our actual media as the set region will // propagate out to the repaint manager . for ( AbstractMedia media : _metamgr ) { Rectangle intersection = media . getBounds ( ) . intersection ( rect ) ; if ( ! intersection . isEmpty ( ) ) { _metamgr . getRegionManager ( ) . addDirtyRegion ( intersection ) ; } }
public class FactoryDetectDescribe { /** * Creates a new SIFT feature detector and describer . * @ see CompleteSift * @ param config Configuration for the SIFT detector and descriptor . * @ return SIFT */ public static < T extends ImageGray < T > > DetectDescribePoint < T , BrightFeature > sift ( @ Nullable ConfigCompleteSift config ) { } }
if ( config == null ) config = new ConfigCompleteSift ( ) ; ConfigSiftScaleSpace configSS = config . scaleSpace ; ConfigSiftDetector configDetector = config . detector ; ConfigSiftOrientation configOri = config . orientation ; ConfigSiftDescribe configDesc = config . describe ; SiftScaleSpace scaleSpace = new SiftScaleSpace ( configSS . firstOctave , configSS . lastOctave , configSS . numScales , configSS . sigma0 ) ; OrientationHistogramSift < GrayF32 > orientation = new OrientationHistogramSift < > ( configOri . histogramSize , configOri . sigmaEnlarge , GrayF32 . class ) ; DescribePointSift < GrayF32 > describe = new DescribePointSift < > ( configDesc . widthSubregion , configDesc . widthGrid , configDesc . numHistogramBins , configDesc . sigmaToPixels , configDesc . weightingSigmaFraction , configDesc . maxDescriptorElementValue , GrayF32 . class ) ; NonMaxSuppression nns = FactoryFeatureExtractor . nonmax ( configDetector . extract ) ; NonMaxLimiter nonMax = new NonMaxLimiter ( nns , configDetector . maxFeaturesPerScale ) ; CompleteSift dds = new CompleteSift ( scaleSpace , configDetector . edgeR , nonMax , orientation , describe ) ; return new DetectDescribe_CompleteSift < > ( dds ) ;
public class PrepareRequestInterceptor { /** * Setup accept header depends from the semantic of the request * @ param action * @ param requestHeaders */ private void setupAcceptHeader ( String action , Map < String , String > requestHeaders , Map < String , String > requestParameters ) { } }
// validates whether to add headers for accept for serialization String serializeAcceptFormat = getSerializationResponseFormat ( ) ; if ( StringUtils . hasText ( serializeAcceptFormat ) && ! isDownload ( action ) && ! isDownloadPDF ( requestParameters ) ) { requestHeaders . put ( RequestElements . HEADER_PARAM_ACCEPT , ContentTypes . getContentType ( serializeAcceptFormat ) ) ; } if ( isDownloadPDF ( requestParameters ) ) { requestHeaders . put ( RequestElements . HEADER_PARAM_ACCEPT , ContentTypes . getContentType ( requestParameters . get ( RequestElements . REQ_PARAM_ENTITY_SELECTOR ) ) ) ; }
public class CensusSpringAspect { /** * trace handles methods executed with the ` @ Traced ` annotation . A new span will be created with * an optionally customizable span name . * @ param call the join point to execute * @ return the result of the invocation * @ throws Throwable if the underlying target throws an exception * @ since 0.16.0 */ @ Around ( "@annotation(io.opencensus.contrib.spring.aop.Traced)" ) public Object trace ( ProceedingJoinPoint call ) throws Throwable { } }
MethodSignature signature = ( MethodSignature ) call . getSignature ( ) ; Method method = signature . getMethod ( ) ; Traced annotation = method . getAnnotation ( Traced . class ) ; if ( annotation == null ) { return call . proceed ( ) ; } String spanName = annotation . name ( ) ; if ( spanName . isEmpty ( ) ) { spanName = method . getName ( ) ; } return Handler . proceed ( call , tracer , spanName ) ;
public class Translations { /** * Load from the XML translations file maintained by the FHIR project * @ param filename * @ throws IOException * @ throws SAXException * @ throws FileNotFoundException * @ throws ParserConfigurationException * @ throws Exception */ public void load ( String filename ) throws FileNotFoundException , SAXException , IOException , ParserConfigurationException { } }
DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder builder = factory . newDocumentBuilder ( ) ; loadMessages ( builder . parse ( new CSFileInputStream ( filename ) ) ) ;
public class ElemWithParam { /** * Get the XObject representation of the variable . * @ param transformer non - null reference to the the current transform - time state . * @ param sourceNode non - null reference to the < a href = " http : / / www . w3 . org / TR / xslt # dt - current - node " > current source node < / a > . * @ return the XObject representation of the variable . * @ throws TransformerException */ public XObject getValue ( TransformerImpl transformer , int sourceNode ) throws TransformerException { } }
XObject var ; XPathContext xctxt = transformer . getXPathContext ( ) ; xctxt . pushCurrentNode ( sourceNode ) ; try { if ( null != m_selectPattern ) { var = m_selectPattern . execute ( xctxt , sourceNode , this ) ; var . allowDetachToRelease ( false ) ; } else if ( null == getFirstChildElem ( ) ) { var = XString . EMPTYSTRING ; } else { // Use result tree fragment int df = transformer . transformToRTF ( this ) ; var = new XRTreeFrag ( df , xctxt , this ) ; } } finally { xctxt . popCurrentNode ( ) ; } return var ;
public class MaterialCalendarView { /** * Set the calendar to a specific month or week based on a date . * In month mode , the calendar will be set to the corresponding month . * In week mode , the calendar will be set to the corresponding week . * @ param day a CalendarDay to focus the calendar on . Null will do nothing * @ param useSmoothScroll use smooth scroll when changing months . */ public void setCurrentDate ( @ Nullable CalendarDay day , boolean useSmoothScroll ) { } }
if ( day == null ) { return ; } int index = adapter . getIndexForDay ( day ) ; pager . setCurrentItem ( index , useSmoothScroll ) ; updateUi ( ) ;
public class AtomAPIMMessage { /** * Get the name of a method parameter via its < code > PName < / code > annotation . * @ param m * @ param paramIndex the index of the parameter array . * @ return the parameter name or an empty string if not available . */ private static String getParameterName ( Method m , int paramIndex ) { } }
PName pName = getParameterAnnotation ( m , paramIndex , PName . class ) ; if ( pName != null ) { return pName . value ( ) ; } else { return "" ; }
public class NotesInterface { /** * Add a note to a photo . The Note object bounds and text must be specified . * @ param photoId * The photo ID * @ param note * The Note object * @ return The updated Note object */ public Note add ( String photoId , Note note ) throws FlickrException { } }
Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_ADD ) ; parameters . put ( "photo_id" , photoId ) ; Rectangle bounds = note . getBounds ( ) ; if ( bounds != null ) { parameters . put ( "note_x" , String . valueOf ( bounds . x ) ) ; parameters . put ( "note_y" , String . valueOf ( bounds . y ) ) ; parameters . put ( "note_w" , String . valueOf ( bounds . width ) ) ; parameters . put ( "note_h" , String . valueOf ( bounds . height ) ) ; } String text = note . getText ( ) ; if ( text != null ) { parameters . put ( "note_text" , text ) ; } Response response = transportAPI . post ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } Element noteElement = response . getPayload ( ) ; note . setId ( noteElement . getAttribute ( "id" ) ) ; return note ;
public class CmsWebdavServlet { /** * Adds an xml element to the given parent and sets the appropriate namespace and * prefix . < p > * @ param parent the parent node to add the element * @ param name the name of the new element * @ return the created element with the given name which was added to the given parent */ public static Element addElement ( Element parent , String name ) { } }
return parent . addElement ( new QName ( name , Namespace . get ( "D" , DEFAULT_NAMESPACE ) ) ) ;
public class ConnectionGroupTree { /** * Adds all descendant sharing profiles of the given connections to their * corresponding primary connections already stored under root . * @ param connections * The connections whose descendant sharing profiles should be added to * the tree . * @ param permissions * If specified and non - empty , limit added sharing profiles to only * those for which the current user has any of the given * permissions . Otherwise , all visible sharing profiles are added . * @ throws GuacamoleException * If an error occurs while retrieving the descendants . */ private void addConnectionDescendants ( Collection < Connection > connections , List < ObjectPermission . Type > permissions ) throws GuacamoleException { } }
// If no connections , nothing to do if ( connections . isEmpty ( ) ) return ; // Build lists of sharing profile identifiers for retrieval Collection < String > identifiers = new ArrayList < String > ( ) ; for ( Connection connection : connections ) identifiers . addAll ( connection . getSharingProfileIdentifiers ( ) ) ; // Filter identifiers based on permissions , if requested if ( permissions != null && ! permissions . isEmpty ( ) ) identifiers = sharingProfilePermissions . getAccessibleObjects ( permissions , identifiers ) ; // Retrieve and add all associated sharing profiles if ( ! identifiers . isEmpty ( ) ) { Collection < SharingProfile > sharingProfiles = sharingProfileDirectory . getAll ( identifiers ) ; addSharingProfiles ( sharingProfiles ) ; }
public class DemoActivity { /** * Photos loading failure callback . */ @ Failure ( FlickrApi . LOAD_IMAGES_EVENT ) private void onPhotosLoadFail ( ) { } }
gridAdapter . onNextItemsError ( ) ; // Skipping state restoration if ( savedPagerPosition != NO_POSITION ) { // We can ' t show image right now , so we should return back to list applyFullPagerState ( 0f , true ) ; } clearScreenState ( ) ;
public class BaseAbilityBot { /** * Invokes the method and retrieves its return { @ link Ability } . * @ param obj an bot or extension that this method is invoked with * @ return a { @ link Function } which returns the { @ link Ability } returned by the given method */ private Function < ? super Method , Ability > returnAbility ( Object obj ) { } }
return method -> { try { return ( Ability ) method . invoke ( obj ) ; } catch ( IllegalAccessException | InvocationTargetException e ) { BotLogger . error ( "Could not add ability" , TAG , e ) ; throw propagate ( e ) ; } } ;
public class MMCIFFileTools { /** * Converts a CrystalCell object to a { @ link Cell } object . * @ param c * @ return */ public static Cell convertCrystalCellToCell ( CrystalCell c ) { } }
Cell cell = new Cell ( ) ; cell . setLength_a ( String . format ( "%.3f" , c . getA ( ) ) ) ; cell . setLength_b ( String . format ( "%.3f" , c . getB ( ) ) ) ; cell . setLength_c ( String . format ( "%.3f" , c . getC ( ) ) ) ; cell . setAngle_alpha ( String . format ( "%.3f" , c . getAlpha ( ) ) ) ; cell . setAngle_beta ( String . format ( "%.3f" , c . getBeta ( ) ) ) ; cell . setAngle_gamma ( String . format ( "%.3f" , c . getGamma ( ) ) ) ; return cell ;
public class CommonOps_DDRM { /** * < p > Computes the matrix multiplication outer product : < br > * < br > * c = a * a < sup > T < / sup > < br > * < br > * c < sub > ij < / sub > = & sum ; < sub > k = 1 : m < / sub > { a < sub > ik < / sub > * a < sub > jk < / sub > } * Is faster than using a generic matrix multiplication by taking advantage of symmetry . * @ param a The matrix being multiplied . Not modified . * @ param c Where the results of the operation are stored . Modified . */ public static void multOuter ( DMatrix1Row a , DMatrix1Row c ) { } }
c . reshape ( a . numRows , a . numRows ) ; MatrixMultProduct_DDRM . outer ( a , c ) ;
public class ReportGenerator { /** * Generates a report from a given Velocity Template . The template name * provided can be the name of a template contained in the jar file , such as * ' XmlReport ' or ' HtmlReport ' , or the template name can be the path to a * template file . * @ param template the name of the template to load * @ param file the output file to write the report to * @ throws ReportException is thrown when the report cannot be generated */ @ SuppressFBWarnings ( justification = "try with resources will clean up the output stream" , value = { } }
"OBL_UNSATISFIED_OBLIGATION" } ) protected void processTemplate ( String template , File file ) throws ReportException { ensureParentDirectoryExists ( file ) ; try ( OutputStream output = new FileOutputStream ( file ) ) { processTemplate ( template , output ) ; } catch ( IOException ex ) { throw new ReportException ( String . format ( "Unable to write to file: %s" , file ) , ex ) ; }
public class AVMiPushMessageReceiver { /** * 通知栏消息 , 用户手动点击后触发 * @ param context * @ param miPushMessage */ @ Override public void onNotificationMessageClicked ( Context context , com . xiaomi . mipush . sdk . MiPushMessage miPushMessage ) { } }
processMiNotification ( miPushMessage ) ;
public class Intersectionf { /** * Determine whether the undirected line segment with the end points < code > p0 < / code > and < code > p1 < / code > * intersects the axis - aligned box given as its minimum corner < code > min < / code > and maximum corner < code > max < / code > , * and return the values of the parameter < i > t < / i > in the ray equation < i > p ( t ) = origin + p0 * ( p1 - p0 ) < / i > of the near and far point of intersection . * This method returns < code > true < / code > for a line segment whose either end point lies inside the axis - aligned box . * Reference : < a href = " https : / / dl . acm . org / citation . cfm ? id = 1198748 " > An Efficient and Robust Ray – Box Intersection < / a > * @ see # intersectLineSegmentAab ( Vector3fc , Vector3fc , Vector3fc , Vector3fc , Vector2f ) * @ param p0 * the line segment ' s first end point * @ param p1 * the line segment ' s second end point * @ param min * the minimum corner of the axis - aligned box * @ param max * the maximum corner of the axis - aligned box * @ param result * a vector which will hold the resulting values of the parameter * < i > t < / i > in the ray equation < i > p ( t ) = p0 + t * ( p1 - p0 ) < / i > of the near and far point of intersection * iff the line segment intersects the axis - aligned box * @ return { @ link # INSIDE } if the line segment lies completely inside of the axis - aligned box ; or * { @ link # OUTSIDE } if the line segment lies completely outside of the axis - aligned box ; or * { @ link # ONE _ INTERSECTION } if one of the end points of the line segment lies inside of the axis - aligned box ; or * { @ link # TWO _ INTERSECTION } if the line segment intersects two sides of the axis - aligned box * or lies on an edge or a side of the box */ public static int intersectLineSegmentAab ( Vector3fc p0 , Vector3fc p1 , Vector3fc min , Vector3fc max , Vector2f result ) { } }
return intersectLineSegmentAab ( p0 . x ( ) , p0 . y ( ) , p0 . z ( ) , p1 . x ( ) , p1 . y ( ) , p1 . z ( ) , min . x ( ) , min . y ( ) , min . z ( ) , max . x ( ) , max . y ( ) , max . z ( ) , result ) ;
public class ResultInterpreter { /** * Interprets the class result . * @ param classResult The class result */ private void interpretClassResult ( final ClassResult classResult ) { } }
classResult . getMethods ( ) . forEach ( m -> interpretMethodResult ( m , classResult ) ) ;
public class Expressions { /** * Create a new Path expression * @ param type element type * @ param queryType element expression type * @ param metadata path metadata * @ param < E > element type * @ param < Q > element expression type * @ return path expression */ public static < E , Q extends SimpleExpression < ? super E > > CollectionPath < E , Q > collectionPath ( Class < E > type , Class < Q > queryType , PathMetadata metadata ) { } }
return new CollectionPath < E , Q > ( type , queryType , metadata ) ;
public class BoxesRunTime { /** * - arg */ public static Object negate ( Object arg ) throws NoSuchMethodException { } }
int code = typeCode ( arg ) ; if ( code <= INT ) { int val = unboxCharOrInt ( arg , code ) ; return boxToInteger ( - val ) ; } if ( code <= LONG ) { long val = unboxCharOrLong ( arg , code ) ; return boxToLong ( - val ) ; } if ( code <= FLOAT ) { float val = unboxCharOrFloat ( arg , code ) ; return boxToFloat ( - val ) ; } if ( code <= DOUBLE ) { double val = unboxCharOrDouble ( arg , code ) ; return boxToDouble ( - val ) ; } throw new NoSuchMethodException ( ) ;
public class UIUtils { /** * helper method to set the TranslucentStatusFlag * @ param on */ public static void setTranslucentStatusFlag ( Activity activity , boolean on ) { } }
if ( Build . VERSION . SDK_INT >= 19 ) { setFlag ( activity , WindowManager . LayoutParams . FLAG_TRANSLUCENT_STATUS , on ) ; }
public class CodeBlocks { /** * Joins multiple { @ link CodeBlock } s together with a given delimiter */ @ SuppressWarnings ( "SameParameterValue" ) static CodeBlock join ( Iterable < CodeBlock > codeBlocks , String delimiter ) { } }
CodeBlock . Builder builder = CodeBlock . builder ( ) ; Iterator < CodeBlock > iterator = codeBlocks . iterator ( ) ; while ( iterator . hasNext ( ) ) { builder . add ( iterator . next ( ) ) ; if ( iterator . hasNext ( ) ) { builder . add ( delimiter ) ; } } return builder . build ( ) ;
public class FeatureDescription { /** * Returns the first sentence of the * shortDescription . Returns " " if the shortDescription is the same as * the displayName ( the default for reflection - generated * FeatureDescriptors ) . */ public String getDescriptionFirstSentence ( ) { } }
FeatureDescriptor fd = getFeatureDescriptor ( ) ; if ( fd == null ) { return "" ; } return getTeaToolsUtils ( ) . getDescriptionFirstSentence ( fd ) ;
public class JavaGenerator { /** * Returns the initial value of { @ code field } , or null if it is doesn ' t have one . */ private @ Nullable CodeBlock initialValue ( Field field ) { } }
if ( field . isPacked ( ) || field . isRepeated ( ) ) { return CodeBlock . of ( "$T.newMutableList()" , Internal . class ) ; } else if ( field . type ( ) . isMap ( ) ) { return CodeBlock . of ( "$T.newMutableMap()" , Internal . class ) ; } else { return null ; }
public class WebServiceFilterTranslator { /** * { @ inheritDoc } */ @ Override protected Operand createLessThanExpression ( final LessThanFilter filter , final boolean not ) { } }
if ( filter == null ) { return null ; } final String name = filter . getAttribute ( ) . getName ( ) ; final String value = AttributeUtil . getAsStringValue ( filter . getAttribute ( ) ) ; if ( StringUtil . isBlank ( value ) ) { return null ; } return new Operand ( Operator . LT , name , value , not ) ;
public class Atomix { /** * Returns a new Atomix builder . * The returned builder will be initialized with the provided configuration . * @ param config the Atomix configuration * @ param classLoader the class loader with which to load the Atomix registry * @ return the Atomix builder */ public static AtomixBuilder builder ( AtomixConfig config , ClassLoader classLoader ) { } }
return new AtomixBuilder ( config , AtomixRegistry . registry ( classLoader ) ) ;
public class ScoreBuildHistogram { /** * giving it an improved prediction ) . */ protected void score_decide ( Chunk chks [ ] , Chunk nids , int nnids [ ] ) { } }
for ( int row = 0 ; row < nids . _len ; row ++ ) { // Over all rows int nid = ( int ) nids . at8 ( row ) ; // Get Node to decide from if ( isDecidedRow ( nid ) ) { // already done nnids [ row ] = nid - _leaf ; // will be negative , flagging a completed row continue ; } // Score row against current decisions & assign new split boolean oob = isOOBRow ( nid ) ; if ( oob ) nid = oob2Nid ( nid ) ; // sampled away - we track the position in the tree DTree . DecidedNode dn = _tree . decided ( nid ) ; if ( dn == null || dn . _split == null ) { // Might have a leftover non - split if ( DTree . isRootNode ( dn ) ) { nnids [ row ] = nid - _leaf ; continue ; } nid = dn . _pid ; // Use the parent split decision then int xnid = oob ? nid2Oob ( nid ) : nid ; nids . set ( row , xnid ) ; nnids [ row ] = xnid - _leaf ; dn = _tree . decided ( nid ) ; // Parent steers us } assert ! isDecidedRow ( nid ) ; nid = dn . getChildNodeID ( chks , row ) ; // Move down the tree 1 level if ( ! isDecidedRow ( nid ) ) { if ( oob ) nid = nid2Oob ( nid ) ; // Re - apply OOB encoding nids . set ( row , nid ) ; } nnids [ row ] = nid - _leaf ; }
public class IntStreamEx { /** * Returns the maximum element of this stream according to the provided key * extractor function . * This is a terminal operation . * @ param < V > the type of the { @ code Comparable } sort key * @ param keyExtractor a non - interfering , stateless function * @ return an { @ code OptionalInt } describing the first element of this * stream for which the highest value was returned by key extractor , * or an empty { @ code OptionalInt } if the stream is empty * @ since 0.1.2 */ public < V extends Comparable < ? super V > > OptionalInt maxBy ( IntFunction < V > keyExtractor ) { } }
ObjIntBox < V > result = collect ( ( ) -> new ObjIntBox < > ( null , 0 ) , ( box , i ) -> { V val = Objects . requireNonNull ( keyExtractor . apply ( i ) ) ; if ( box . a == null || box . a . compareTo ( val ) < 0 ) { box . a = val ; box . b = i ; } } , ( box1 , box2 ) -> { if ( box2 . a != null && ( box1 . a == null || box1 . a . compareTo ( box2 . a ) < 0 ) ) { box1 . a = box2 . a ; box1 . b = box2 . b ; } } ) ; return result . a == null ? OptionalInt . empty ( ) : OptionalInt . of ( result . b ) ;
public class ChainWriter { /** * Writes a JavaScript script tag that shows a date and time in the user ' s locale . Prints < code > & amp ; # 160 ; < / code > * if the date is < code > - 1 < / code > . * Writes to the internal < code > PrintWriter < / code > . * @ deprecated * @ see # writeDateTimeJavaScript ( long ) */ @ Deprecated public ChainWriter printDateTimeJS ( long date , Sequence sequence , Appendable scriptOut ) throws IOException { } }
return writeDateTimeJavaScript ( date == - 1 ? null : new Date ( date ) , sequence , scriptOut ) ;
public class ParseUtils { /** * Parses out the timestamp portion of the uid Strings used in the logrepo */ public static long parseTimestampFromUIDString ( String s , final int start , final int end ) { } }
long ret = 0 ; for ( int i = start ; i < end && i < start + 9 ; i ++ ) { ret <<= 5 ; char c = s . charAt ( i ) ; if ( c >= '0' && c <= '9' ) { ret |= c - '0' ; } else if ( c >= 'a' && c <= 'v' ) { ret |= c - 'a' + 10 ; } else if ( c >= 'A' && c <= 'V' ) { ret |= c - 'A' + 10 ; } else { throw new IllegalArgumentException ( s . substring ( start , end ) + " is not a valid UID!" ) ; } } return ret ;
public class Solo { /** * Waits for a View matching the specified resource id . Default timeout is 20 seconds . * @ param id the R . id of the { @ link View } to wait for * @ return { @ code true } if the { @ link View } is displayed and { @ code false } if it is not displayed before the timeout */ public boolean waitForView ( int id ) { } }
if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "waitForView(" + id + ")" ) ; } return waitForView ( id , 0 , Timeout . getLargeTimeout ( ) , true ) ;
public class JmsTemporaryTopicImpl { /** * / * ( non - Javadoc ) * @ see javax . jms . TemporaryTopic # delete ( ) */ public void delete ( ) throws JMSException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "delete" ) ; // check to see if this has already been deleted . // If it has return with out doing anything if ( ! deleted ) { session . deleteTemporaryDestination ( getConsumerSIDestinationAddress ( ) ) ; deleted = true ; ( ( JmsConnectionImpl ) session . getConnection ( ) ) . removeTemporaryDestination ( this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "delete" ) ;
public class PhaseThreeImpl { /** * Returns true if the parameter has a namespace and value , false if not . * @ param p Parameter */ private static boolean validParameter ( final Parameter p ) { } }
if ( p . getNamespace ( ) == null ) { return false ; } if ( p . getValue ( ) == null ) { return false ; } return true ;
public class SeekableStringReader { /** * Returns the rest of the data until the end . */ public String rest ( ) { } }
if ( cursor >= str . length ( ) ) throw new ParseException ( "no more data" ) ; String result = str . substring ( cursor ) ; cursor = str . length ( ) ; return result ;
public class ProductFactoryCascade { /** * Add a given factory to the list of factories at the BEGINNING . * @ param factory The factory to be added . * @ return Cascade with amended factory list . */ public ProductFactoryCascade < T > addFactoryBefore ( ProductFactory < ? extends T > factory ) { } }
ArrayList < ProductFactory < ? extends T > > factories = new ArrayList < ProductFactory < ? extends T > > ( this . factories . size ( ) + 1 ) ; factories . addAll ( this . factories ) ; factories . add ( 0 , factory ) ; return new ProductFactoryCascade < > ( factories ) ;
public class GcsDelegationTokens { /** * Perform the unbonded deployment operations . Create the GCP credential provider chain to use * when talking to GCP when there is no delegation token to work with . authenticating this client * with GCP services , and saves it to { @ link # accessTokenProvider } * @ throws IOException any failure . */ public AccessTokenProvider deployUnbonded ( ) throws IOException { } }
checkState ( ! isBoundToDT ( ) , "Already Bound to a delegation token" ) ; logger . atFine ( ) . log ( "No delegation tokens present: using direct authentication" ) ; accessTokenProvider = tokenBinding . deployUnbonded ( ) ; return accessTokenProvider ;
public class RunController { /** * Run Citrus application with given test package names . * @ param packages */ public void runPackages ( List < String > packages ) { } }
CitrusAppConfiguration citrusAppConfiguration = new CitrusAppConfiguration ( ) ; citrusAppConfiguration . setIncludes ( Optional . ofNullable ( includes ) . orElse ( configuration . getIncludes ( ) ) ) ; citrusAppConfiguration . setPackages ( packages ) ; citrusAppConfiguration . setConfigClass ( configuration . getConfigClass ( ) ) ; citrusAppConfiguration . addDefaultProperties ( configuration . getDefaultProperties ( ) ) ; citrusAppConfiguration . addDefaultProperties ( defaultProperties ) ; run ( citrusAppConfiguration ) ;
public class OmemoManager { /** * Returns true , if the Server supports PEP . * @ param connection XMPPConnection * @ param server domainBareJid of the server to test * @ return true if server supports pep * @ throws XMPPException . XMPPErrorException * @ throws SmackException . NotConnectedException * @ throws InterruptedException * @ throws SmackException . NoResponseException */ public static boolean serverSupportsOmemo ( XMPPConnection connection , DomainBareJid server ) throws XMPPException . XMPPErrorException , SmackException . NotConnectedException , InterruptedException , SmackException . NoResponseException { } }
return ServiceDiscoveryManager . getInstanceFor ( connection ) . discoverInfo ( server ) . containsFeature ( PubSub . NAMESPACE ) ;
public class CmsVfsCache { /** * Adds this instance as an event listener to the CMS event manager . < p > */ protected void registerEventListener ( ) { } }
OpenCms . addCmsEventListener ( this , new int [ ] { I_CmsEventListener . EVENT_RESOURCE_AND_PROPERTIES_MODIFIED , I_CmsEventListener . EVENT_RESOURCES_AND_PROPERTIES_MODIFIED , I_CmsEventListener . EVENT_RESOURCE_MODIFIED , I_CmsEventListener . EVENT_RESOURCES_MODIFIED , I_CmsEventListener . EVENT_RESOURCE_MOVED , I_CmsEventListener . EVENT_RESOURCE_DELETED , I_CmsEventListener . EVENT_PUBLISH_PROJECT , I_CmsEventListener . EVENT_CLEAR_CACHES , I_CmsEventListener . EVENT_CLEAR_ONLINE_CACHES , I_CmsEventListener . EVENT_CLEAR_OFFLINE_CACHES } ) ;
public class ClassUtil { /** * Gets the methods within this class that implements public " bean " methods * ( get and set ) for the property name . Returns an array of methods where * index = 0 is the get method and index = 1 is the set method . * For example , for a name such as " firstName " , this method will * check if the class has both getFirstName ( ) and setFirstName ( ) methods . * Also , this method will validate the return type matches the propertyType * on the getXXX ( ) method and that the setXXX ( ) method only accepts that * propertyType . The search is optionally case sensitive . * @ param type The class to search * @ param propertyName The name to search for * @ param paramType The class type of the property * @ param caseSensitive If the search is case sensitive or not * @ return An array of Methods were index = 0 is the get method and index = 1 is the set method * @ throws java . lang . IllegalAccessException If the method was found , but is not public . * @ throws java . lang . NoSuchMethodException If the method was not found */ public static Method [ ] getBeanMethods ( Class < ? > type , String propertyName , Class < ? > propertyType , boolean caseSensitive ) throws IllegalAccessException , NoSuchMethodException { } }
Method methods [ ] = new Method [ 2 ] ; // search for the " get " methods [ 0 ] = getMethod ( type , "get" + propertyName , propertyType , null , caseSensitive ) ; // search for the " set " methods [ 1 ] = getMethod ( type , "set" + propertyName , null , propertyType , caseSensitive ) ; return methods ;
public class CachedResultSet { /** * Retrieves the rows from a collection of Objects , where a subset of the objects ' ( of type T ) < i > public fields < / i > are taken as result set columns . * @ param < T > the type of the objects in the collection * @ param collection a collection of objects * @ param columns names of a select subset of each object ' s public fields * @ return the result set from the list of objects */ public static < T > CachedResultSet chooseFields ( Collection < T > collection , String ... columns ) { } }
CachedResultSet rs = new CachedResultSet ( columns , new ArrayList < Object [ ] > ( ) ) ; for ( T object : collection ) { Object [ ] row = new Object [ columns . length ] ; for ( int i = 0 ; i < columns . length ; ++ i ) { try { Object value = Beans . getKnownField ( object . getClass ( ) , columns [ i ] ) . get ( object ) ; if ( value != null ) { if ( value . getClass ( ) . isArray ( ) ) { row [ i ] = Strings . join ( value , ';' ) ; } else { row [ i ] = value . toString ( ) ; } } else { row [ i ] = null ; } } catch ( Exception x ) { row [ i ] = null ; } } rs . rows . add ( row ) ; } return rs ;
public class Matrix3x2d { /** * Pre - multiply a rotation to this matrix by rotating the given amount of radians and store the result in < code > dest < / code > . * If < code > M < / code > is < code > this < / code > matrix and < code > R < / code > the rotation matrix , * then the new matrix will be < code > R * M < / code > . So when transforming a * vector < code > v < / code > with the new matrix by using < code > R * M * v < / code > , the * rotation will be applied last ! * In order to set the matrix to a rotation matrix without pre - multiplying the rotation * transformation , use { @ link # rotation ( double ) rotation ( ) } . * Reference : < a href = " http : / / en . wikipedia . org / wiki / Rotation _ matrix # Rotation _ matrix _ from _ axis _ and _ angle " > http : / / en . wikipedia . org < / a > * @ see # rotation ( double ) * @ param ang * the angle in radians to rotate * @ param dest * will hold the result * @ return dest */ public Matrix3x2d rotateLocal ( double ang , Matrix3x2d dest ) { } }
double sin = Math . sin ( ang ) ; double cos = Math . cosFromSin ( sin , ang ) ; double nm00 = cos * m00 - sin * m01 ; double nm01 = sin * m00 + cos * m01 ; double nm10 = cos * m10 - sin * m11 ; double nm11 = sin * m10 + cos * m11 ; double nm20 = cos * m20 - sin * m21 ; double nm21 = sin * m20 + cos * m21 ; dest . m00 = nm00 ; dest . m01 = nm01 ; dest . m10 = nm10 ; dest . m11 = nm11 ; dest . m20 = nm20 ; dest . m21 = nm21 ; return dest ;
public class ServerImpl { /** * Initiates an orderly shutdown in which preexisting calls continue but new calls are rejected . */ @ Override public ServerImpl shutdown ( ) { } }
boolean shutdownTransportServers ; synchronized ( lock ) { if ( shutdown ) { return this ; } shutdown = true ; shutdownTransportServers = started ; if ( ! shutdownTransportServers ) { transportServersTerminated = true ; checkForTermination ( ) ; } } if ( shutdownTransportServers ) { for ( InternalServer ts : transportServers ) { ts . shutdown ( ) ; } } return this ;
public class Transport { /** * Delivers a single child entry by its identifier . */ public < T > T getChildEntry ( Class < ? > parentClass , String parentId , Class < T > classs , String childId , NameValuePair ... params ) throws RedmineException { } }
final EntityConfig < T > config = getConfig ( classs ) ; final URI uri = getURIConfigurator ( ) . getChildIdURI ( parentClass , parentId , classs , childId , params ) ; HttpGet http = new HttpGet ( uri ) ; String response = send ( http ) ; return parseResponse ( response , config . singleObjectName , config . parser ) ;
public class BSHBinaryExpression { /** * object is a non - null and non - void Primitive type */ private boolean isPrimitiveValue ( Object obj ) { } }
return obj instanceof Primitive && obj != Primitive . VOID && obj != Primitive . NULL ;
public class TCPTransportClient { /** * Network init socket */ public void initialize ( ) throws IOException , NotInitializedException { } }
logger . debug ( "Initialising TCPTransportClient. Origin address is [{}] and destination address is [{}]" , origAddress , destAddress ) ; if ( destAddress == null ) { throw new NotInitializedException ( "Destination address is not set" ) ; } socketChannel = SelectorProvider . provider ( ) . openSocketChannel ( ) ; try { if ( origAddress != null ) { socketChannel . socket ( ) . bind ( origAddress ) ; } socketChannel . connect ( destAddress ) ; // PCB added logging socketChannel . configureBlocking ( BLOCKING_IO ) ; getParent ( ) . onConnected ( ) ; } catch ( IOException e ) { if ( origAddress != null ) { socketChannel . socket ( ) . close ( ) ; } socketChannel . close ( ) ; throw e ; }
public class CSSToken { /** * Returns common text stored in token . Content is not modified . * @ return Model view of text in token */ @ Override public String getText ( ) { } }
// sets text from input if not text directly available text = super . getText ( ) ; int t ; try { t = typeMapper . inverse ( ) . get ( type ) ; } catch ( NullPointerException e ) { return text ; } switch ( t ) { case FUNCTION : return text . substring ( 0 , text . length ( ) - 1 ) ; case URI : return extractURI ( text ) ; case UNCLOSED_URI : return extractUNCLOSEDURI ( text ) ; case STRING : return extractSTRING ( text ) ; case UNCLOSED_STRING : return extractUNCLOSEDSTRING ( text ) ; case CLASSKEYWORD : return extractCLASSKEYWORD ( text ) ; case HASH : return extractHASH ( text ) ; default : return text ; }
public class AbstractFilter { /** * Creates a list of Subjects from a servlet request . If no subject is found * a subject called ' anonymous ' is created . * @ param request * the servlet request * @ return a list of Subjects * @ throws ServletException */ protected List < Map < URI , List < AttributeValue > > > getSubjects ( HttpServletRequest request ) throws ServletException { } }
@ SuppressWarnings ( "unchecked" ) Map < String , Set < String > > reqAttr = ( Map < String , Set < String > > ) request . getAttribute ( "FEDORA_AUX_SUBJECT_ATTRIBUTES" ) ; Set < String > fedoraRoles = null ; if ( reqAttr != null ) { fedoraRoles = reqAttr . get ( "fedoraRole" ) ; } String [ ] fedoraRole = null ; if ( fedoraRoles != null && fedoraRoles . size ( ) > 0 ) { fedoraRole = fedoraRoles . toArray ( new String [ fedoraRoles . size ( ) ] ) ; } List < Map < URI , List < AttributeValue > > > subjects = new ArrayList < Map < URI , List < AttributeValue > > > ( ) ; String user = request . getRemoteUser ( ) ; if ( user == null || user . isEmpty ( ) ) { user = "anonymous" ; } // setup the id and value for the requesting subject Map < URI , List < AttributeValue > > subAttr = new HashMap < URI , List < AttributeValue > > ( ) ; List < AttributeValue > attrList = new ArrayList < AttributeValue > ( ) ; attrList . add ( new StringAttribute ( user ) ) ; subAttr . put ( Constants . SUBJECT . LOGIN_ID . getURI ( ) , attrList ) ; if ( fedoraRole != null && fedoraRole . length > 0 ) { attrList = new ArrayList < AttributeValue > ( ) ; for ( String f : fedoraRole ) { attrList . add ( new StringAttribute ( f ) ) ; } subAttr . put ( Constants . SUBJECT . ROLE . getURI ( ) , attrList ) ; } subjects . add ( subAttr ) ; subAttr = new HashMap < URI , List < AttributeValue > > ( ) ; attrList = new ArrayList < AttributeValue > ( ) ; attrList . add ( new StringAttribute ( user ) ) ; subAttr . put ( Constants . SUBJECT . USER_REPRESENTED . getURI ( ) , attrList ) ; if ( fedoraRole != null && fedoraRole . length > 0 ) { attrList = new ArrayList < AttributeValue > ( ) ; for ( String f : fedoraRole ) { attrList . add ( new StringAttribute ( f ) ) ; } subAttr . put ( Constants . SUBJECT . ROLE . getURI ( ) , attrList ) ; } subjects . add ( subAttr ) ; subAttr = new HashMap < URI , List < AttributeValue > > ( ) ; attrList = new ArrayList < AttributeValue > ( ) ; attrList . add ( new StringAttribute ( user ) ) ; subAttr . put ( Constants . SUBJECT . ROLE . getURI ( ) , attrList ) ; if ( fedoraRole != null && fedoraRole . length > 0 ) { attrList = new ArrayList < AttributeValue > ( ) ; for ( String f : fedoraRole ) { attrList . add ( new StringAttribute ( f ) ) ; } subAttr . put ( Constants . SUBJECT . ROLE . getURI ( ) , attrList ) ; } subjects . add ( subAttr ) ; return subjects ;
public class SheetBase { /** * The error message to display when the sheet is in error . * @ return */ public String getErrorMessage ( ) { } }
final Object result = getStateHelper ( ) . eval ( PropertyKeys . errorMessage ) ; if ( result == null ) { return null ; } return result . toString ( ) ;
public class PreferenceActivity { /** * Handles the intent extra , which specifies whether bread crumbs should be shown , not . * @ param extras * The extras of the intent , which has been used to start the activity , as an instance * of the class { @ link Bundle } . The bundle may not be null */ private void handleNoBreadcrumbsIntent ( @ NonNull final Bundle extras ) { } }
if ( extras . containsKey ( EXTRA_NO_BREAD_CRUMBS ) ) { hideBreadCrumb ( extras . getBoolean ( EXTRA_NO_BREAD_CRUMBS ) ) ; }
public class Reflections { /** * 直接调用对象方法 , 无视 private / protected 修饰符 。 * 用于一次性调用的情况 , 否则应使用 getAccessibleMethod ( ) 函数获得 Method 后反复调用 。 * 同时匹配方法名 + 参数类型 。 * @ param target * 目标对象 * @ param name * 方法名 * @ param parameterTypes * 参数类型 * @ param parameterValues * 参数值 * @ param < T > * 期待的返回值类型 * @ return 返回值 */ public static < T > T invokeMethod ( final Object target , final String name , final Class < ? > [ ] parameterTypes , final Object [ ] parameterValues ) { } }
Method method = getAccessibleMethod ( target , name , parameterTypes ) ; if ( method == null ) { throw new IllegalArgumentException ( "Could not find method [" + name + "] on target [" + target + ']' ) ; } try { return ( T ) method . invoke ( target , parameterValues ) ; } catch ( ReflectiveOperationException e ) { throw new ReflectionRuntimeException ( e ) ; }
public class TypeVariableType { /** * A type variable type is assignable only to / from itself or a reference thereof . * For example : < pre > * function foo < T , S > ( t : T , s : S ) * t = s / / illegal , T and S may not have the same type at runtime * t = " hello " / / illegal , T may not be a String * var x : T = t / / ok , x and t are both of type T */ public boolean isAssignableFrom ( IType type ) { } }
if ( type == this ) { return true ; } if ( type instanceof ICompoundType ) { for ( IType t : ( ( ICompoundType ) type ) . getTypes ( ) ) { if ( isAssignableFrom ( t ) ) { return true ; } } return false ; } if ( ! ( type instanceof TypeVariableType ) ) { return false ; } if ( ! getRelativeName ( ) . equals ( type . getRelativeName ( ) ) ) { return false ; } IType thatEncType = type . getEnclosingType ( ) ; IType thisEncType = getEnclosingType ( ) ; return thatEncType == thisEncType || functionTypesEqual ( thisEncType , thatEncType ) || thatEncType instanceof IGosuClassInternal && ( ( IGosuClassInternal ) thatEncType ) . isProxy ( ) && thisEncType == ( ( IGosuClassInternal ) thatEncType ) . getJavaType ( ) ;
public class PrintfFormat { /** * Format an Object . Convert wrapper types to * their primitive equivalents and call the * appropriate internal formatting method . Convert * Strings using an internal formatting method for * Strings . Otherwise use the default formatter * ( use toString ) . * @ param x the Object to format . * @ return the formatted String . * @ exception IllegalArgumentException if the * conversion character is inappropriate for * formatting an unwrapped value . */ public String sprintf ( Object x ) throws IllegalArgumentException { } }
Enumeration e = vFmt . elements ( ) ; ConversionSpecification cs = null ; char c = 0 ; StringBuffer sb = new StringBuffer ( ) ; while ( e . hasMoreElements ( ) ) { cs = ( ConversionSpecification ) e . nextElement ( ) ; c = cs . getConversionCharacter ( ) ; if ( c == '\0' ) sb . append ( cs . getLiteral ( ) ) ; else if ( c == '%' ) sb . append ( "%" ) ; else { if ( x instanceof Byte ) sb . append ( cs . internalsprintf ( ( ( Byte ) x ) . byteValue ( ) ) ) ; else if ( x instanceof Short ) sb . append ( cs . internalsprintf ( ( ( Short ) x ) . shortValue ( ) ) ) ; else if ( x instanceof Integer ) sb . append ( cs . internalsprintf ( ( ( Integer ) x ) . intValue ( ) ) ) ; else if ( x instanceof Long ) sb . append ( cs . internalsprintf ( ( ( Long ) x ) . longValue ( ) ) ) ; else if ( x instanceof Float ) sb . append ( cs . internalsprintf ( ( ( Float ) x ) . floatValue ( ) ) ) ; else if ( x instanceof Double ) sb . append ( cs . internalsprintf ( ( ( Double ) x ) . doubleValue ( ) ) ) ; else if ( x instanceof Character ) sb . append ( cs . internalsprintf ( ( ( Character ) x ) . charValue ( ) ) ) ; else if ( x instanceof String ) sb . append ( cs . internalsprintf ( ( String ) x ) ) ; else sb . append ( cs . internalsprintf ( x ) ) ; } } return sb . toString ( ) ;
public class PropertyUtility { /** * Modifier is acceptable . * @ param item * the item * @ return true , if successful */ static boolean modifierIsAcceptable ( Element item ) { } }
// kotlin define properties as final Object [ ] values = { Modifier . NATIVE , Modifier . STATIC , /* Modifier . FINAL , */ Modifier . ABSTRACT } ; for ( Object i : values ) { if ( item . getModifiers ( ) . contains ( i ) ) return false ; } return true ;
public class AbstractPropertyReader { /** * get XStream Object . * @ return XStream object . */ private XStream getXStreamObject ( ) { } }
if ( xStream == null ) { XStream stream = new XStream ( ) ; stream . alias ( "clientProperties" , ClientProperties . class ) ; stream . alias ( "dataStore" , ClientProperties . DataStore . class ) ; stream . alias ( "schema" , ClientProperties . DataStore . Schema . class ) ; stream . alias ( "table" , ClientProperties . DataStore . Schema . Table . class ) ; stream . alias ( "dataCenter" , ClientProperties . DataStore . Schema . DataCenter . class ) ; stream . alias ( "connection" , ClientProperties . DataStore . Connection . class ) ; stream . alias ( "server" , ClientProperties . DataStore . Connection . Server . class ) ; return stream ; } else { return xStream ; }
public class CheckBase { /** * Checks whether both provided elements are public or protected . If one at least one of them is null , the method * returns false , because the accessibility cannot be truthfully detected in that case . * @ param a first element * @ param b second element * @ return true if both elements are not null and accessible ( i . e . public or protected ) */ public boolean isBothAccessible ( @ Nullable JavaModelElement a , @ Nullable JavaModelElement b ) { } }
if ( a == null || b == null ) { return false ; } return isAccessible ( a ) && isAccessible ( b ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link DateTimeType } * { @ code > } */ @ XmlElementDecl ( namespace = "http://www.w3.org/2005/Atom" , name = "published" , scope = EntryType . class ) public JAXBElement < DateTimeType > createEntryTypePublished ( DateTimeType value ) { } }
return new JAXBElement < DateTimeType > ( ENTRY_TYPE_PUBLISHED_QNAME , DateTimeType . class , EntryType . class , value ) ;
public class ComponentFactory { /** * Factory method for create a new { @ link TextField } . * @ param < T > * the generic type of the model * @ param id * the id * @ param model * the model * @ return the new { @ link TextField } . */ public static < T > TextField < T > newTextField ( final String id , final IModel < T > model ) { } }
final TextField < T > textField = new TextField < > ( id , model ) ; textField . setOutputMarkupId ( true ) ; return textField ;
public class CacheConfigurationBuilder { /** * Adds { @ link org . ehcache . expiry . Expiry } configuration to the returned builder . * { @ code Expiry } is what controls data freshness in a cache . * @ param expiry the expiry to use * @ return a new builder with the added expiry * @ deprecated Use { @ link # withExpiry ( ExpiryPolicy ) } instead */ @ Deprecated public CacheConfigurationBuilder < K , V > withExpiry ( org . ehcache . expiry . Expiry < ? super K , ? super V > expiry ) { } }
return withExpiry ( convertToExpiryPolicy ( requireNonNull ( expiry , "Null expiry" ) ) ) ;
public class Pool { public PondLife get ( int timeoutMs ) throws Exception { } }
PondLife pl = null ; // Defer to other threads before locking if ( _available < _min ) Thread . yield ( ) ; int new_id = - 1 ; // Try to get pondlife without creating new one . synchronized ( this ) { // Wait if none available . if ( _running > 0 && _available == 0 && _size == _pondLife . length && timeoutMs > 0 ) wait ( timeoutMs ) ; // If still running if ( _running > 0 ) { // if pondlife available if ( _available > 0 ) { int id = _index [ -- _available ] ; pl = _pondLife [ id ] ; } else if ( _size < _pondLife . length ) { // Reserve spot for a new one new_id = reservePondLife ( false ) ; } } // create reserved pondlife if ( pl == null && new_id >= 0 ) pl = newPondLife ( new_id ) ; } return pl ;
public class TrajectoryUtil { /** * Splits a trajectory in overlapping / non - overlapping sub - trajectories . * @ param t * @ param windowWidth Window width . Each sub - trajectory will have this length * @ param overlapping Allows the window to overlap * @ return ArrayList with sub - trajectories */ public static ArrayList < Trajectory > splitTrackInSubTracks ( Trajectory t , int windowWidth , boolean overlapping ) { } }
int increment = 1 ; if ( overlapping == false ) { increment = windowWidth ; } ArrayList < Trajectory > subTrajectories = new ArrayList < Trajectory > ( ) ; boolean trackEndReached = false ; for ( int i = 0 ; i < t . size ( ) ; i = i + increment ) { int upperBound = i + ( windowWidth ) ; if ( upperBound > t . size ( ) ) { upperBound = t . size ( ) ; trackEndReached = true ; } Trajectory help = new Trajectory ( 2 , i ) ; for ( int j = i ; j < upperBound ; j ++ ) { help . add ( t . get ( j ) ) ; } subTrajectories . add ( help ) ; if ( trackEndReached ) { i = t . size ( ) ; } } return subTrajectories ;
public class CaptureChangedRecordsFilter { /** * Gets the key to use in the capture state file . If there is not a * captureStateIdentifier available , we want to avoid using a hardcoded key , * since the same file may be used for multiple purposes , even multiple * filters of the same type . Of course this is not desired configuration , * but may be more convenient for lazy users ! * @ return */ private String getPropertyKey ( ) { } }
if ( StringUtils . isNullOrEmpty ( captureStateIdentifier ) ) { if ( lastModifiedColumn . isPhysicalColumn ( ) ) { Table table = lastModifiedColumn . getPhysicalColumn ( ) . getTable ( ) ; if ( table != null && ! StringUtils . isNullOrEmpty ( table . getName ( ) ) ) { return table . getName ( ) + "." + lastModifiedColumn . getName ( ) + ".GreatestLastModifiedTimestamp" ; } } return lastModifiedColumn . getName ( ) + ".GreatestLastModifiedTimestamp" ; } return captureStateIdentifier . trim ( ) + ".GreatestLastModifiedTimestamp" ;
public class LocalFileSink { /** * Before polling messages from the queue , it should check whether to rotate * the file and start to write to new file . * @ throws java . io . IOException */ @ Override protected void beforePolling ( ) throws IOException { } }
// Don ' t rotate if we are not running if ( isRunning && ( writer . getLength ( ) > maxFileSize || System . currentTimeMillis ( ) > nextRotation ) ) { rotate ( ) ; }
public class IntegerSerializer { /** * { @ inheritDoc } */ @ Override public ByteBuffer serialize ( Integer object ) { } }
ByteBuffer byteBuffer = ByteBuffer . allocate ( 4 ) ; byteBuffer . putInt ( object ) . flip ( ) ; return byteBuffer ;
public class RandomVariableDifferentiableAADPathwise { /** * / * for all functions that need to be differentiated and are returned as double in the Interface , write a method to return it as RandomVariableAAD * that is deterministic by its nature . For their double - returning pendant just return the average of the deterministic RandomVariableAAD */ public RandomVariable getAverageAsRandomVariableAAD ( RandomVariable probabilities ) { } }
/* returns deterministic AAD random variable */ return new RandomVariableDifferentiableAADPathwise ( new RandomVariableFromDoubleArray ( getAverage ( probabilities ) ) , Arrays . asList ( this , new RandomVariableFromDoubleArray ( probabilities ) ) , OperatorType . AVERAGE2 ) ;
public class Toothpick { /** * Removes all nodes of { @ code scope } using DFS . We don ' t lock here . * @ param scope the parent scope of which all children will recursively be removed * from the map . We don ' t do anything else to the children nodes are they will be * garbage collected soon . We just cut a whole sub - graph in the references graph of the JVM * normally . */ private static void removeScopeAndChildrenFromMap ( ScopeNode scope ) { } }
MAP_KEY_TO_SCOPE . remove ( scope . getName ( ) ) ; scope . close ( ) ; for ( ScopeNode childScope : scope . childrenScopes . values ( ) ) { removeScopeAndChildrenFromMap ( childScope ) ; }
public class FactoryFinder { /** * Finds the implementation < code > Class < / code > object for the given * factory name , or if that fails , finds the < code > Class < / code > object * for the given fallback class name . The arguments supplied must be * used in order . If using the first argument is successful , the second * one will not be used . * This method is package private so that this code can be shared . * @ return the < code > Class < / code > object of the specified message factory ; * may not be < code > null < / code > * @ param factoryId the name of the factory to find , which is * a system property * @ param fallbackClassName the implementation class name , which is * to be used only if nothing else * is found ; < code > null < / code > to indicate that * there is no fallback class name * @ exception ELException if there is an error */ static Object find ( String factoryId , String fallbackClassName , Properties properties ) { } }
ClassLoader classLoader ; try { if ( System . getSecurityManager ( ) == null ) { classLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; } else { classLoader = AccessController . doPrivileged ( ( PrivilegedAction < ClassLoader > ) ( ) -> Thread . currentThread ( ) . getContextClassLoader ( ) ) ; } } catch ( Exception x ) { throw new ELException ( x . toString ( ) , x ) ; } final String deploymentFactoryClassName = FactoryFinderCache . loadImplementationClassName ( factoryId , classLoader ) ; if ( deploymentFactoryClassName != null && ! deploymentFactoryClassName . equals ( "" ) ) { return newInstance ( deploymentFactoryClassName , classLoader , properties ) ; } // try to read from $ java . home / lib / el . properties try { String javah = System . getProperty ( "java.home" ) ; String configFile = javah + File . separator + "lib" + File . separator + "el.properties" ; File f = new File ( configFile ) ; if ( f . exists ( ) ) { Properties props = new Properties ( ) ; props . load ( new FileInputStream ( f ) ) ; String factoryClassName = props . getProperty ( factoryId ) ; return newInstance ( factoryClassName , classLoader , properties ) ; } } catch ( Exception ex ) { } // Use the system property try { String systemProp = System . getProperty ( factoryId ) ; if ( systemProp != null ) { return newInstance ( systemProp , classLoader , properties ) ; } } catch ( SecurityException se ) { } if ( fallbackClassName == null ) { throw new ELException ( "Provider for " + factoryId + " cannot be found" , null ) ; } return newInstance ( fallbackClassName , classLoader , properties ) ;
public class OmsDePitter { /** * Make cells flow ready by creating a slope starting from the output cell . * @ param iteration the iteration . * @ param pitfillExitNode the exit node . * @ param cellsToMakeFlowReady the cells to check and change at each iteration . * @ param allPitsPositions the marked positions of all existing pits . Necessary to pick only those that * really are part of the pit pool . * @ param pitIter elevation data . * @ param delta the elevation delta to add to the cells to create the slope . */ private void makeCellsFlowReady ( int iteration , GridNode pitfillExitNode , List < GridNode > cellsToMakeFlowReady , BitMatrix allPitsPositions , WritableRandomIter pitIter , float delta ) { } }
iteration ++ ; double exitElevation = pitfillExitNode . elevation ; List < GridNode > connected = new ArrayList < > ( ) ; for ( GridNode checkNode : cellsToMakeFlowReady ) { List < GridNode > validSurroundingNodes = checkNode . getValidSurroundingNodes ( ) ; for ( GridNode gridNode : validSurroundingNodes ) { if ( ! pitfillExitNode . equals ( gridNode ) && allPitsPositions . isMarked ( gridNode . col , gridNode . row ) && gridNode . elevation == exitElevation ) { if ( ! connected . contains ( gridNode ) ) connected . add ( gridNode ) ; } } } if ( connected . size ( ) == 0 ) { return ; } for ( GridNode gridNode : connected ) { double newElev = ( double ) ( gridNode . elevation + delta * ( double ) iteration ) ; gridNode . setValueInMap ( pitIter , newElev ) ; } List < GridNode > updatedConnected = new ArrayList < > ( ) ; for ( GridNode gridNode : connected ) { GridNode updatedNode = new GridNode ( pitIter , gridNode . cols , gridNode . rows , gridNode . xRes , gridNode . yRes , gridNode . col , gridNode . row ) ; updatedConnected . add ( updatedNode ) ; } makeCellsFlowReady ( iteration , pitfillExitNode , updatedConnected , allPitsPositions , pitIter , delta ) ;
public class ApacheHTTPClient { /** * This function sets the request content . * @ param httpRequest * The HTTP request * @ param httpMethodClient * The apache HTTP method */ protected void setRequestContent ( HTTPRequest httpRequest , HttpMethodBase httpMethodClient ) { } }
// set content if ( httpMethodClient instanceof EntityEnclosingMethod ) { EntityEnclosingMethod pushMethod = ( EntityEnclosingMethod ) httpMethodClient ; RequestEntity requestEntity = null ; ContentType contentType = httpRequest . getContentType ( ) ; switch ( contentType ) { case STRING : requestEntity = this . createStringRequestContent ( httpRequest ) ; break ; case BINARY : requestEntity = this . createBinaryRequestContent ( httpRequest ) ; break ; case MULTI_PART : requestEntity = this . createMultiPartRequestContent ( httpRequest , httpMethodClient ) ; break ; default : throw new FaxException ( "Unsupported content type: " + contentType ) ; } // set request data if ( requestEntity != null ) { pushMethod . setRequestEntity ( requestEntity ) ; pushMethod . setContentChunked ( false ) ; } }
public class MachineTime { /** * / * [ deutsch ] * < p > Multipliziert diese Dauer mit dem angegebenen Dezimalfaktor . < / p > * < p > Wenn mehr Kontrolle & uuml ; ber das Rundungsverfahren gebraucht wird , gibt es die * Alternativen { @ link # multipliedBy ( long ) } und { @ link # dividedBy ( long , RoundingMode ) } . < / p > * @ param factor multiplicand * @ return changed copy of this duration * @ throws IllegalArgumentException if given factor is not a finite number */ public MachineTime < U > multipliedBy ( double factor ) { } }
if ( factor == 1.0 ) { return this ; } else if ( factor == 0.0 ) { if ( this . scale == POSIX ) { return cast ( POSIX_ZERO ) ; } else { return cast ( UTC_ZERO ) ; } } else if ( Double . isFinite ( factor ) ) { double len = this . toBigDecimal ( ) . doubleValue ( ) * factor ; MachineTime < ? > mt ; if ( this . scale == POSIX ) { mt = MachineTime . ofPosixSeconds ( len ) ; } else { mt = MachineTime . ofSISeconds ( len ) ; } return cast ( mt ) ; } else { throw new IllegalArgumentException ( "Not finite: " + factor ) ; }
public class Commands { /** * Starts or stops saving a script to a file . * @ param line Command line * @ param callback Callback for command status */ public void script ( String line , DispatchCallback callback ) { } }
if ( sqlLine . getScriptOutputFile ( ) == null ) { startScript ( line , callback ) ; } else { stopScript ( line , callback ) ; }
public class RedisStorage { /** * Unsets the state of the given trigger key by removing the trigger from all trigger state sets . * @ param triggerHashKey the redis key of the desired trigger hash * @ param jedis a thread - safe Redis connection * @ return true if the trigger was removed , false if the trigger was stateless * @ throws org . quartz . JobPersistenceException if the unset operation failed */ @ Override public boolean unsetTriggerState ( final String triggerHashKey , Jedis jedis ) throws JobPersistenceException { } }
boolean removed = false ; Pipeline pipe = jedis . pipelined ( ) ; List < Response < Long > > responses = new ArrayList < > ( RedisTriggerState . values ( ) . length ) ; for ( RedisTriggerState state : RedisTriggerState . values ( ) ) { responses . add ( pipe . zrem ( redisSchema . triggerStateKey ( state ) , triggerHashKey ) ) ; } pipe . sync ( ) ; for ( Response < Long > response : responses ) { removed = response . get ( ) == 1 ; if ( removed ) { jedis . del ( redisSchema . triggerLockKey ( redisSchema . triggerKey ( triggerHashKey ) ) ) ; break ; } } return removed ;
public class Multimap { /** * Remove the specified value ( one occurrence ) from the value set associated with keys which satisfy the specified < code > predicate < / code > . * @ param value * @ param predicate * @ return < code > true < / code > if this Multimap is modified by this operation , otherwise < code > false < / code > . */ public < X extends Exception > boolean removeIf ( E value , Try . BiPredicate < ? super K , ? super V , X > predicate ) throws X { } }
Set < K > removingKeys = null ; for ( Map . Entry < K , V > entry : this . valueMap . entrySet ( ) ) { if ( predicate . test ( entry . getKey ( ) , entry . getValue ( ) ) ) { if ( removingKeys == null ) { removingKeys = new HashSet < > ( ) ; } removingKeys . add ( entry . getKey ( ) ) ; } } if ( N . isNullOrEmpty ( removingKeys ) ) { return false ; } boolean modified = false ; for ( K k : removingKeys ) { if ( remove ( k , value ) ) { modified = true ; } } return modified ;
public class InstanceTemplateClient { /** * Gets the access control policy for a resource . May be empty if no such policy or resource * exists . * < p > Sample code : * < pre > < code > * try ( InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient . create ( ) ) { * ProjectGlobalInstanceTemplateResourceName resource = ProjectGlobalInstanceTemplateResourceName . of ( " [ PROJECT ] " , " [ RESOURCE ] " ) ; * Policy response = instanceTemplateClient . getIamPolicyInstanceTemplate ( resource . toString ( ) ) ; * < / code > < / pre > * @ param resource Name or id of the resource for this request . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ @ BetaApi public final Policy getIamPolicyInstanceTemplate ( String resource ) { } }
GetIamPolicyInstanceTemplateHttpRequest request = GetIamPolicyInstanceTemplateHttpRequest . newBuilder ( ) . setResource ( resource ) . build ( ) ; return getIamPolicyInstanceTemplate ( request ) ;
public class SpiceServiceListenerNotifier { /** * Notify interested observers that the request was cancelled . * @ param request the request that was cancelled . */ public void notifyObserversOfRequestCancellation ( CachedSpiceRequest < ? > request ) { } }
RequestProcessingContext requestProcessingContext = new RequestProcessingContext ( ) ; requestProcessingContext . setExecutionThread ( Thread . currentThread ( ) ) ; post ( new RequestCancelledNotifier ( request , spiceServiceListenerList , requestProcessingContext ) ) ;
public class Timing { /** * Mark section end */ public void end ( ) { } }
if ( this . sectionName != null ) { Log . d ( TAG , "" + this . sectionName + " loaded in " + ( ActorTime . currentTime ( ) - sectionStart ) + " ms" ) ; this . sectionName = null ; }
public class JaxbConfigurationReader { /** * Convenience method to marshal a JAXB configuration object into an output * stream . * @ param configuration * @ param outputStream */ public void marshall ( Configuration configuration , OutputStream outputStream ) { } }
try { final Marshaller marshaller = _jaxbContext . createMarshaller ( ) ; marshaller . setProperty ( Marshaller . JAXB_FORMATTED_OUTPUT , Boolean . TRUE ) ; marshaller . setEventHandler ( new JaxbValidationEventHandler ( ) ) ; marshaller . marshal ( configuration , outputStream ) ; } catch ( JAXBException e ) { throw new IllegalStateException ( e ) ; }
public class CqlDataReaderDAO { /** * Converts rows from a single C * row to a Record . */ private Iterator < Record > decodeRows ( Iterator < Iterable < Row > > rowGroups , final AstyanaxTable table ) { } }
return Iterators . transform ( rowGroups , rowGroup -> { String key = AstyanaxStorage . getContentKey ( getRawKeyFromRowGroup ( rowGroup ) ) ; return newRecordFromCql ( new Key ( table , key ) , rowGroup ) ; } ) ;
public class FlexBase64 { /** * Encodes a fixed and complete byte buffer into a Base64url byte array . * < pre > < code > * / / Encodes " ell " * FlexBase64 . encodeStringURL ( " hello " . getBytes ( " US - ASCII " ) , 1 , 4 , false ) ; * < / code > < / pre > * @ param source the byte array to encode from * @ param pos the position to start encoding at * @ param limit the position to halt encoding at ( exclusive ) * @ param wrap whether or not to wrap at 76 characters with CRLFs * @ return a new byte array containing the encoded ASCII values */ public static byte [ ] encodeBytesURL ( byte [ ] source , int pos , int limit , boolean wrap ) { } }
return Encoder . encodeBytes ( source , pos , limit , wrap , true ) ;
public class MethodConstant { /** * Creates a stack manipulation that loads a method constant onto the operand stack . * @ param methodDescription The method to be loaded onto the stack . * @ return A stack manipulation that assigns a method constant for the given method description . */ public static CanCache of ( MethodDescription . InDefinedShape methodDescription ) { } }
if ( methodDescription . isTypeInitializer ( ) ) { return CanCacheIllegal . INSTANCE ; } else if ( methodDescription . isConstructor ( ) ) { return new ForConstructor ( methodDescription ) ; } else { return new ForMethod ( methodDescription ) ; }
public class TemplatesApi { /** * Gets the definition of a template . * Retrieves the list of templates for the specified account . The request can be limited to a specific folder . * @ param accountId The external account number ( int ) or account ID Guid . ( required ) * @ param options for modifying the method behavior . * @ return EnvelopeTemplateResults * @ throws ApiException if fails to make API call */ public EnvelopeTemplateResults listTemplates ( String accountId , TemplatesApi . ListTemplatesOptions options ) throws ApiException { } }
Object localVarPostBody = "{}" ; // verify the required parameter ' accountId ' is set if ( accountId == null ) { throw new ApiException ( 400 , "Missing the required parameter 'accountId' when calling listTemplates" ) ; } // create path and map variables String localVarPath = "/v2/accounts/{accountId}/templates" . replaceAll ( "\\{format\\}" , "json" ) . replaceAll ( "\\{" + "accountId" + "\\}" , apiClient . escapeString ( accountId . toString ( ) ) ) ; // query params java . util . List < Pair > localVarQueryParams = new java . util . ArrayList < Pair > ( ) ; java . util . Map < String , String > localVarHeaderParams = new java . util . HashMap < String , String > ( ) ; java . util . Map < String , Object > localVarFormParams = new java . util . HashMap < String , Object > ( ) ; if ( options != null ) { localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "count" , options . count ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "folder" , options . folder ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "folder_ids" , options . folderIds ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "from_date" , options . fromDate ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "include" , options . include ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "modified_from_date" , options . modifiedFromDate ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "modified_to_date" , options . modifiedToDate ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "order" , options . order ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "order_by" , options . orderBy ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "search_text" , options . searchText ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "shared_by_me" , options . sharedByMe ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "start_position" , options . startPosition ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "to_date" , options . toDate ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "used_from_date" , options . usedFromDate ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "used_to_date" , options . usedToDate ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "user_filter" , options . userFilter ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "user_id" , options . userId ) ) ; } final String [ ] localVarAccepts = { "application/json" } ; final String localVarAccept = apiClient . selectHeaderAccept ( localVarAccepts ) ; final String [ ] localVarContentTypes = { } ; final String localVarContentType = apiClient . selectHeaderContentType ( localVarContentTypes ) ; String [ ] localVarAuthNames = new String [ ] { "docusignAccessCode" } ; GenericType < EnvelopeTemplateResults > localVarReturnType = new GenericType < EnvelopeTemplateResults > ( ) { } ; return apiClient . invokeAPI ( localVarPath , "GET" , localVarQueryParams , localVarPostBody , localVarHeaderParams , localVarFormParams , localVarAccept , localVarContentType , localVarAuthNames , localVarReturnType ) ;
public class JShellToolBuilder { /** * Create a tool instance for testing . Not in JavaShellToolBuilder . * @ return the tool instance */ public JShellTool rawTool ( ) { } }
if ( prefs == null ) { prefs = new PreferencesStorage ( Preferences . userRoot ( ) . node ( PREFERENCES_NODE ) ) ; } if ( vars == null ) { vars = System . getenv ( ) ; } JShellTool sh = new JShellTool ( cmdIn , cmdOut , cmdErr , console , userIn , userOut , userErr , prefs , vars , locale ) ; sh . testPrompt = capturePrompt ; return sh ;
public class GBSTree { /** * Search after falling off a right edge . * < p > We have fallen off of the right edge because the search key is * greater than the median of the current node . In the example below * if the current node is GHI then the successor node is JKL and the * desired key is greater than H and less than K . If the curent node * is MNO the successor node is PQR and the desired key is greater * than N and less than Q . If the current node is STU there is no * successor node and the desired key is greater than T . < / p > * < pre > * * - - - - - J . K . L - - - - - * * * - - - - - D . E . F - - - - - * * - - - - - P . Q . R - - - - - * * A . B . C G . H . I M . N . O S . T . U * < / pre > * < p > We now have two choices : * < ol > * < li > Check to see if the search key is less than the left - most * key in the successor node . * < li > Check to see if the search key is less than or equal to the * right - most key in the current node . * < / ol > * If either of the above is true we need to search the right half of * the current node . Otherwise we need to search the left half of * the successor node . < / p > * @ param comp The index comparator used by the current search . * @ param p The current node . * @ param l The logical successor node , which is the one from which * we last turned left . * @ param searchKey The key we are trying to find . * @ param point will contain the node and index of the found key * ( if any ) . */ private void rightSearch ( SearchComparator comp , GBSNode p , GBSNode l , Object searchKey , SearchNode point ) { } }
int xcc = comp . compare ( searchKey , p . rightMostKey ( ) ) ; if ( xcc == 0 ) /* Target is right - most key in current */ point . setFound ( p , 0 ) ; else if ( xcc < 0 ) /* Target ( if it exists ) is in right */ { /* half of current node */ int idx = p . searchRight ( comp , searchKey ) ; if ( ! ( idx < 0 ) ) point . setFound ( p , idx ) ; } else /* Target ( if it exists ) is in left */ { /* half of successor ( if it exists ) */ if ( l != null ) { int idx = l . searchLeft ( comp , searchKey ) ; if ( ! ( idx < 0 ) ) point . setFound ( l , idx ) ; } }
public class Builder { /** * Sets the package prefix directories to allow any files installed under * them to be relocatable . * @ param prefixes Path prefixes which may be relocated */ public void setPrefixes ( final String ... prefixes ) { } }
if ( prefixes != null && 0 < prefixes . length ) format . getHeader ( ) . createEntry ( PREFIXES , prefixes ) ;
public class SibRaActivationSpecImpl { /** * ( non - Javadoc ) * @ see com . ibm . wsspi . sib . ra . SibRaActivationSpec # setMessageDeletionMode ( java . lang . String ) */ public void setMessageDeletionMode ( final String messageDeletionMode ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "MessageDeletionMode" , messageDeletionMode ) ; } _messageDeletionMode = messageDeletionMode ;
public class SpotifyApi { /** * Add the current user as a follower of one or more artists or other Spotify users . * @ param type The ID type : either artist or user . * @ param ids A list of the artist or the user Spotify IDs . Maximum : 50 IDs . * @ return A { @ link FollowArtistsOrUsersRequest . Builder } . * @ see < a href = " https : / / developer . spotify . com / web - api / user - guide / # spotify - uris - and - ids " > Spotify : URLs & amp ; IDs < / a > */ public FollowArtistsOrUsersRequest . Builder followArtistsOrUsers ( ModelObjectType type , String [ ] ids ) { } }
return new FollowArtistsOrUsersRequest . Builder ( accessToken ) . setDefaults ( httpManager , scheme , host , port ) . type ( type ) . ids ( concat ( ids , ',' ) ) ;
public class ProtoParser { /** * Reads an field declaration and returns it . */ private FieldElement readField ( String documentation , FieldElement . Label label ) { } }
DataType type = readDataType ( ) ; String name = readName ( ) ; if ( readChar ( ) != '=' ) throw unexpected ( "expected '='" ) ; int tag = readInt ( ) ; FieldElement . Builder builder = FieldElement . builder ( ) . label ( label ) . type ( type ) . name ( name ) . tag ( tag ) ; if ( peekChar ( ) == '[' ) { pos ++ ; while ( true ) { builder . addOption ( readOption ( '=' ) ) ; // Check for optional ' , ' or closing ' ] ' char c = peekChar ( ) ; if ( c == ']' ) { pos ++ ; break ; } else if ( c == ',' ) { pos ++ ; } } } if ( readChar ( ) != ';' ) { throw unexpected ( "expected ';'" ) ; } documentation = tryAppendTrailingDocumentation ( documentation ) ; return builder . documentation ( documentation ) . build ( ) ;
public class UrlTriePrefixGrouper { /** * Get the detailed pages under this group */ public static ArrayList < String > groupToPages ( Triple < String , GoogleWebmasterFilter . FilterOperator , UrlTrieNode > group ) { } }
ArrayList < String > ret = new ArrayList < > ( ) ; if ( group . getMiddle ( ) . equals ( GoogleWebmasterFilter . FilterOperator . EQUALS ) ) { if ( group . getRight ( ) . isExist ( ) ) { ret . add ( group . getLeft ( ) ) ; } } else if ( group . getMiddle ( ) . equals ( GoogleWebmasterFilter . FilterOperator . CONTAINS ) ) { UrlTrie trie = new UrlTrie ( group . getLeft ( ) , group . getRight ( ) ) ; Iterator < Pair < String , UrlTrieNode > > iterator = new UrlTriePostOrderIterator ( trie , 1 ) ; while ( iterator . hasNext ( ) ) { Pair < String , UrlTrieNode > next = iterator . next ( ) ; if ( next . getRight ( ) . isExist ( ) ) { ret . add ( next . getLeft ( ) ) ; } } } return ret ;
public class BaseRowSerializer { /** * Convert base row to binary row . * TODO modify it to code gen , and reuse BinaryRow & BinaryRowWriter . */ @ Override public BinaryRow baseRowToBinary ( BaseRow row ) { } }
if ( row instanceof BinaryRow ) { return ( BinaryRow ) row ; } BinaryRow binaryRow = new BinaryRow ( types . length ) ; BinaryRowWriter writer = new BinaryRowWriter ( binaryRow ) ; writer . writeHeader ( row . getHeader ( ) ) ; for ( int i = 0 ; i < types . length ; i ++ ) { if ( row . isNullAt ( i ) ) { writer . setNullAt ( i ) ; } else { BinaryWriter . write ( writer , i , TypeGetterSetters . get ( row , i , types [ i ] ) , types [ i ] ) ; } } writer . complete ( ) ; return binaryRow ;
public class UploadService { /** * Gets the delegate for an upload request . * @ param uploadId uploadID of the upload request * @ return { @ link UploadStatusDelegate } or null if no delegate has been set for the given * uploadId */ protected static UploadStatusDelegate getUploadStatusDelegate ( String uploadId ) { } }
WeakReference < UploadStatusDelegate > reference = uploadDelegates . get ( uploadId ) ; if ( reference == null ) return null ; UploadStatusDelegate delegate = reference . get ( ) ; if ( delegate == null ) { uploadDelegates . remove ( uploadId ) ; Logger . info ( TAG , "\n\n\nUpload delegate for upload with Id " + uploadId + " is gone!\n" + "Probably you have set it in an activity and the user navigated away from it\n" + "before the upload was completed. From now on, the events will be dispatched\n" + "with broadcast intents. If you see this message, consider switching to the\n" + "UploadServiceBroadcastReceiver registered globally in your manifest.\n" + "Read this:\n" + "https://github.com/gotev/android-upload-service/wiki/Monitoring-upload-status\n" ) ; } return delegate ;