signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class InsertVertexOperation { private void insert ( Geometry geom , GeometryIndex index , Coordinate coordinate ) throws GeometryIndexNotFoundException { } }
if ( index . hasChild ( ) && geom . getGeometries ( ) != null && geom . getGeometries ( ) . length > index . getValue ( ) ) { insert ( geom . getGeometries ( ) [ index . getValue ( ) ] , index . getChild ( ) , coordinate ) ; } else if ( index . getType ( ) == GeometryIndexType . TYPE_EDGE ) { insertAfterEdge ( geom , index , coordinate ) ; } else if ( index . getType ( ) == GeometryIndexType . TYPE_VERTEX ) { insertAfterVertex ( geom , index , coordinate ) ; } else { throw new GeometryIndexNotFoundException ( "Could not match index with given geometry." ) ; }
public class XCalElement { /** * Adds a value . * @ param dataType the data type or null for the " unknown " data type * @ param value the value * @ return the created element */ public Element append ( ICalDataType dataType , String value ) { } }
String dataTypeStr = toLocalName ( dataType ) ; return append ( dataTypeStr , value ) ;
public class JodaWorkingWeek { /** * Return a new JodaWorkingWeek if the status for the given day has changed . * @ param working * true if working day * @ param givenDayOfWeek * e . g . DateTimeConstants . MONDAY , DateTimeConstants . TUESDAY , etc */ public JodaWorkingWeek withWorkingDayFromDateTimeConstant ( final boolean working , final int givenDayOfWeek ) { } }
final int dayOfWeek = jodaToCalendarDayConstant ( givenDayOfWeek ) ; return new JodaWorkingWeek ( super . withWorkingDayFromCalendar ( working , dayOfWeek ) ) ;
public class VariantBuilder { /** * Generates a new Breakend object by parsing the alternate string of a breakend ( e . g A ] 2:321681 ] ) * @ param alternate String containing details of a mate breakend . Expected VCF - like format , e . g . A ] 2:321681 ] . Can * also be " . " to indicate there ' s no mate ( single breakend ) . * @ return A Breakend object filled in with the coordinates parsed from the alternate string . IF there ' s no mate * breakend ( e . g . alternate = ' . ' ) , null will be returned . */ public static Breakend parseBreakend ( String reference , String alternate ) { } }
if ( isMateBreakend ( alternate ) ) { Matcher matcher = BREAKEND_MATED_PATTERN . matcher ( alternate ) ; if ( matcher . matches ( ) ) { String insSeqLeft = matcher . group ( 1 ) ; String bracket = matcher . group ( 2 ) ; String chromosome = matcher . group ( 3 ) ; Integer start = Integer . valueOf ( matcher . group ( 4 ) ) ; String bracket2 = matcher . group ( 5 ) ; String insSeqRight = matcher . group ( 6 ) ; chromosome = Region . normalizeChromosome ( chromosome ) ; if ( ! bracket . equals ( bracket2 ) || bracket . isEmpty ( ) ) { throw breakendParseException ( alternate ) ; } String insSeq ; BreakendOrientation type ; char thisJunctionOrientation ; char mateJunctionOrientation ; if ( insSeqLeft . isEmpty ( ) ) { if ( insSeqRight . isEmpty ( ) ) { throw breakendParseException ( alternate ) ; } else { insSeq = insSeqRight ; thisJunctionOrientation = 'E' ; if ( insSeq . endsWith ( reference ) ) { insSeq = insSeq . substring ( 0 , insSeq . length ( ) - reference . length ( ) ) ; } } } else { if ( insSeqRight . isEmpty ( ) ) { insSeq = insSeqLeft ; thisJunctionOrientation = 'S' ; if ( insSeq . startsWith ( reference ) ) { insSeq = insSeq . substring ( reference . length ( ) ) ; } } else { throw breakendParseException ( alternate ) ; } } if ( insSeq . isEmpty ( ) || insSeq . equals ( "." ) ) { insSeq = null ; } mateJunctionOrientation = bracket . equals ( "]" ) ? 'S' : 'E' ; if ( thisJunctionOrientation == 'S' ) { if ( mateJunctionOrientation == 'S' ) { type = BreakendOrientation . SS ; } else { type = BreakendOrientation . SE ; } } else { if ( mateJunctionOrientation == 'S' ) { type = BreakendOrientation . ES ; } else { type = BreakendOrientation . EE ; } } return new Breakend ( new BreakendMate ( chromosome , start , null , null ) , type , insSeq ) ; } else { throw breakendParseException ( alternate ) ; } } return null ;
public class JsonModelBuilder { /** * Attaches property builder for the given types . * @ param creators * @ return this * @ author vvakame */ public < P > JsonModelBuilder < T > add ( JsonPropertyBuilderCreator < T > ... creators ) { } }
for ( JsonPropertyBuilderCreator < T > creator : creators ) { addSub ( creator . < P > get ( ) ) ; } return this ;
public class SingleListBox { /** * Utility function to set the current value in a ListBox . * @ return returns true if the option corresponding to the value * was successfully selected in the ListBox */ public static final boolean setSelectedValue ( ListBox list , String value , boolean addMissingValues ) { } }
if ( value == null ) { list . setSelectedIndex ( 0 ) ; return false ; } else { int index = findValueInListBox ( list , value ) ; if ( index >= 0 ) { list . setSelectedIndex ( index ) ; return true ; } if ( addMissingValues ) { list . addItem ( value , value ) ; // now that it ' s there , search again index = findValueInListBox ( list , value ) ; list . setSelectedIndex ( index ) ; return true ; } return false ; }
public class XmlEscape { /** * Perform a ( configurable ) XML 1.1 < strong > escape < / strong > operation on a < tt > char [ ] < / tt > input * meant to be an XML attribute value . * This method will perform an escape operation according to the specified * { @ link org . unbescape . xml . XmlEscapeType } and { @ link org . unbescape . xml . XmlEscapeLevel } * argument values . * Besides , being an attribute value also < tt > & # 92 ; t < / tt > , < tt > & # 92 ; n < / tt > and < tt > & # 92 ; r < / tt > will * be escaped to avoid white - space normalization from removing line feeds ( turning them into white * spaces ) during future parsing operations . * All other < tt > char [ ] < / tt > - based < tt > escapeXml11 * ( . . . ) < / tt > methods call this one with preconfigured * < tt > type < / tt > and < tt > level < / tt > values . * This method is < strong > thread - safe < / strong > . * @ param text the < tt > char [ ] < / tt > to be escaped . * @ param offset the position in < tt > text < / tt > at which the escape operation should start . * @ param len the number of characters in < tt > text < / tt > that should be escaped . * @ param writer the < tt > java . io . Writer < / tt > to which the escaped result will be written . Nothing will * be written at all to this writer if input is < tt > null < / tt > . * @ param type the type of escape operation to be performed , see { @ link org . unbescape . xml . XmlEscapeType } . * @ param level the escape level to be applied , see { @ link org . unbescape . xml . XmlEscapeLevel } . * @ throws IOException if an input / output exception occurs * @ since 1.1.5 */ public static void escapeXml11Attribute ( final char [ ] text , final int offset , final int len , final Writer writer , final XmlEscapeType type , final XmlEscapeLevel level ) throws IOException { } }
escapeXml ( text , offset , len , writer , XmlEscapeSymbols . XML11_ATTRIBUTE_SYMBOLS , type , level ) ;
public class DefaultGroovyMethods { /** * Iterates through this aggregate Object transforming each item into a new value using the < code > transform < / code > closure * and adding it to the supplied < code > collector < / code > . * @ param self an aggregate Object with an Iterator returning its items * @ param collector the Collection to which the transformed values are added * @ param transform the closure used to transform each item of the aggregate object * @ return the collector with all transformed values added to it * @ since 1.0 */ public static < T > Collection < T > collect ( Object self , Collection < T > collector , Closure < ? extends T > transform ) { } }
return collect ( InvokerHelper . asIterator ( self ) , collector , transform ) ;
public class AbstractAddStepHandler { /** * Rollback runtime changes made in { @ link # performRuntime ( OperationContext , org . jboss . dmr . ModelNode , org . jboss . as . controller . registry . Resource ) } . * Any services that were added in { @ link org . jboss . as . controller . OperationContext . Stage # RUNTIME } will be automatically removed after this * method executes . Called from the { @ link org . jboss . as . controller . OperationContext . ResultHandler } or * { @ link org . jboss . as . controller . OperationContext . RollbackHandler } passed to { @ code OperationContext . completeStep ( . . . ) } . * To provide compatible behavior with previous releases , this default implementation calls the deprecated * { @ link # rollbackRuntime ( OperationContext , org . jboss . dmr . ModelNode , org . jboss . dmr . ModelNode , java . util . List ) } * variant , passing in an empty list for the { @ code controllers } parameter . Subclasses that overrode that method are * encouraged to instead override this one . < strong > Subclasses that override this method should not call * { @ code super . rollbackRuntime ( . . . ) . } < / strong > * @ param context the operation context * @ param operation the operation being executed * @ param resource persistent configuration model node that corresponds to the address of { @ code operation } */ @ SuppressWarnings ( "deprecation" ) protected void rollbackRuntime ( OperationContext context , final ModelNode operation , final Resource resource ) { } }
rollbackRuntime ( context , operation , resource . getModel ( ) , new ArrayList < ServiceController < ? > > ( 0 ) ) ;
public class MapfishParser { /** * Get the value of a primitive type from the request data . * @ param fieldName the name of the attribute to get from the request data . * @ param pAtt the primitive attribute . * @ param requestData the data to retrieve the value from . */ public static Object parsePrimitive ( final String fieldName , final PrimitiveAttribute < ? > pAtt , final PObject requestData ) { } }
Class < ? > valueClass = pAtt . getValueClass ( ) ; Object value ; try { value = parseValue ( false , new String [ 0 ] , valueClass , fieldName , requestData ) ; } catch ( UnsupportedTypeException e ) { String type = e . type . getName ( ) ; if ( e . type . isArray ( ) ) { type = e . type . getComponentType ( ) . getName ( ) + "[]" ; } throw new RuntimeException ( "The type '" + type + "' is not a supported type when parsing json. " + "See documentation for supported types.\n\nUnsupported type found in attribute " + fieldName + "\n\nTo support more types add the type to " + "parseValue and parseArrayValue in this class and add a test to the test class" , e ) ; } pAtt . validateValue ( value ) ; return value ;
public class MemberConfig { /** * Sets the member identifier . * @ param id the member identifier * @ return the member configuration */ public MemberConfig setId ( String id ) { } }
return setId ( id != null ? MemberId . from ( id ) : null ) ;
public class Drawer { /** * method to replace a previous set header * @ param view * @ param padding * @ param divider */ public void setHeader ( @ NonNull View view , boolean padding , boolean divider ) { } }
setHeader ( view , padding , divider , null ) ;
public class UserManager { /** * Get the user with the specified email address * @ param sEmailAddress * The email address to be checked . May be < code > null < / code > . * @ return < code > null < / code > if no such user exists * @ see # getUserOfEmailAddress ( String ) * @ since 8.1.3 */ @ Nullable public IUser getUserOfEmailAddressIgnoreCase ( @ Nullable final String sEmailAddress ) { } }
if ( StringHelper . hasNoText ( sEmailAddress ) ) return null ; return findFirst ( x -> sEmailAddress . equalsIgnoreCase ( x . getEmailAddress ( ) ) ) ;
public class TreePath { /** * Gets a tree path for a tree node within a subtree identified by a TreePath object . * @ return null if the node is not found */ public static TreePath getPath ( TreePath path , Tree target ) { } }
path . getClass ( ) ; target . getClass ( ) ; class Result extends Error { static final long serialVersionUID = - 5942088234594905625L ; TreePath path ; Result ( TreePath path ) { this . path = path ; } } class PathFinder extends TreePathScanner < TreePath , Tree > { public TreePath scan ( Tree tree , Tree target ) { if ( tree == target ) { throw new Result ( new TreePath ( getCurrentPath ( ) , target ) ) ; } return super . scan ( tree , target ) ; } } if ( path . getLeaf ( ) == target ) { return path ; } try { new PathFinder ( ) . scan ( path , target ) ; } catch ( Result result ) { return result . path ; } return null ;
public class Matrix4x3d { /** * Apply a translation to this matrix by translating by the given number of * units in x , y and z . * If < code > M < / code > is < code > this < / code > matrix and < code > T < / code > the translation * matrix , then the new matrix will be < code > M * T < / code > . So when * transforming a vector < code > v < / code > with the new matrix by using * < code > M * T * v < / code > , the translation will be applied first ! * In order to set the matrix to a translation transformation without post - multiplying * it , use { @ link # translation ( double , double , double ) } . * @ see # translation ( double , double , double ) * @ param x * the offset to translate in x * @ param y * the offset to translate in y * @ param z * the offset to translate in z * @ return this */ public Matrix4x3d translate ( double x , double y , double z ) { } }
if ( ( properties & PROPERTY_IDENTITY ) != 0 ) return translation ( x , y , z ) ; Matrix4x3d c = this ; c . m30 = c . m00 * x + c . m10 * y + c . m20 * z + c . m30 ; c . m31 = c . m01 * x + c . m11 * y + c . m21 * z + c . m31 ; c . m32 = c . m02 * x + c . m12 * y + c . m22 * z + c . m32 ; c . properties &= ~ ( PROPERTY_IDENTITY ) ; return this ;
public class Search { /** * Creates merged search index for suggestion . */ private SearchIndex makeSuggestIndex ( StaplerRequest req ) { } }
SearchIndexBuilder builder = new SearchIndexBuilder ( ) ; for ( Ancestor a : req . getAncestors ( ) ) { if ( a . getObject ( ) instanceof SearchableModelObject ) { SearchableModelObject smo = ( SearchableModelObject ) a . getObject ( ) ; builder . add ( smo . getSearchIndex ( ) ) ; } } return builder . make ( ) ;
public class Vector2i { /** * / * ( non - Javadoc ) * @ see org . joml . Vector2ic # negate ( org . joml . Vector2i ) */ public Vector2i negate ( Vector2i dest ) { } }
dest . x = - x ; dest . y = - y ; return dest ;
public class ResponsePromise { /** * Attach Netty Promise * @ param promise netty promise to set up response promise with */ public void attachNettyPromise ( Promise < T > promise ) { } }
promise . addListener ( promiseHandler ) ; Promise < T > oldPromise = this . promise ; this . promise = promise ; if ( oldPromise != null ) { oldPromise . removeListener ( promiseHandler ) ; oldPromise . cancel ( true ) ; }
public class RedisStorage { /** * Store a job in Redis * @ param jobDetail the { @ link org . quartz . JobDetail } object to be stored * @ param replaceExisting if true , any existing job with the same group and name as the given job will be overwritten * @ param jedis a thread - safe Redis connection * @ throws org . quartz . ObjectAlreadyExistsException */ @ Override @ SuppressWarnings ( "unchecked" ) public void storeJob ( JobDetail jobDetail , boolean replaceExisting , Jedis jedis ) throws ObjectAlreadyExistsException { } }
final String jobHashKey = redisSchema . jobHashKey ( jobDetail . getKey ( ) ) ; final String jobDataMapHashKey = redisSchema . jobDataMapHashKey ( jobDetail . getKey ( ) ) ; final String jobGroupSetKey = redisSchema . jobGroupSetKey ( jobDetail . getKey ( ) ) ; if ( ! replaceExisting && jedis . exists ( jobHashKey ) ) { throw new ObjectAlreadyExistsException ( jobDetail ) ; } Pipeline pipe = jedis . pipelined ( ) ; pipe . hmset ( jobHashKey , ( Map < String , String > ) mapper . convertValue ( jobDetail , new TypeReference < HashMap < String , String > > ( ) { } ) ) ; if ( jobDetail . getJobDataMap ( ) != null && ! jobDetail . getJobDataMap ( ) . isEmpty ( ) ) { pipe . hmset ( jobDataMapHashKey , getStringDataMap ( jobDetail . getJobDataMap ( ) ) ) ; } pipe . sadd ( redisSchema . jobsSet ( ) , jobHashKey ) ; pipe . sadd ( redisSchema . jobGroupsSet ( ) , jobGroupSetKey ) ; pipe . sadd ( jobGroupSetKey , jobHashKey ) ; pipe . sync ( ) ;
public class PeriodicalLog { /** * Builds the MBeanInfo for all the exposed attributes . * @ throws IntrospectionException */ private void buildMBeanInfo ( ) throws IntrospectionException { } }
if ( m_mode == Mode . JMX_ONLY || m_mode == Mode . ALL ) { MBeanAttributeInfo [ ] attributes = null ; int numAttrs = m_jmxAttributes != null ? m_jmxAttributes . length : 0 ; int numItems = CONSTANT_ATTRS_PER_ITEM + m_percentiles . length ; attributes = new MBeanAttributeInfo [ numAttrs * numItems + 5 ] ; if ( m_jmxAttributes != null ) { for ( int i = 0 ; i < m_jmxAttributes . length ; i ++ ) { String name = m_jmxAttributes [ i ] . trim ( ) ; attributes [ numItems * i ] = new MBeanAttributeInfo ( name + ATTR_POSTFIX_AVG , "double" , "Average value (in milliseconds)" , true , false , false ) ; attributes [ numItems * i + 1 ] = new MBeanAttributeInfo ( name + ATTR_POSTFIX_STDDEV , "double" , "Standard Deviation" , true , false , false ) ; attributes [ numItems * i + 2 ] = new MBeanAttributeInfo ( name + ATTR_POSTFIX_MIN , "double" , "Minimum value" , true , false , false ) ; attributes [ numItems * i + 3 ] = new MBeanAttributeInfo ( name + ATTR_POSTFIX_MAX , "double" , "Maximum value" , true , false , false ) ; attributes [ numItems * i + 4 ] = new MBeanAttributeInfo ( name + ATTR_POSTFIX_COUNT , "int" , "Number of invocations" , true , false , false ) ; // Generate the percentile titles as / < perc > // Drops the fractions if they ' re zero . // TODO : There ' s probably a prettier way to do this . for ( int p = 0 ; p < m_percentiles . length ; p ++ ) { String perTitle = saneDoubleToString ( m_percentiles [ p ] ) ; attributes [ numItems * i + 5 + p ] = new MBeanAttributeInfo ( name + "/" + perTitle , "double" , perTitle + "th percentile" , true , false , false ) ; } } } // Add internal management attributes if there ' s a need for // JMX attributes [ attributes . length - 1 ] = new MBeanAttributeInfo ( JMX_QUEUE_LENGTH , "int" , "Current StopWatch processing queue length (i.e. how many StopWatches are currently unprocessed)" , true , false , false ) ; attributes [ attributes . length - 2 ] = new MBeanAttributeInfo ( JMX_DROPPED_STOPWATCHES , "long" , "How many StopWatches have been dropped due to processing restrictions" , true , false , false ) ; attributes [ attributes . length - 3 ] = new MBeanAttributeInfo ( JMX_PERIOD_SECONDS , "int" , "Current logging period (seconds)" , true , true , false ) ; attributes [ attributes . length - 4 ] = new MBeanAttributeInfo ( JMX_SLOW_LOG_PERCENTILE , "double" , "Which percentile gets logged to slowlog" , true , true , false ) ; attributes [ attributes . length - 5 ] = new MBeanAttributeInfo ( JMX_SLOW_LOG_TOGGLE , "boolean" , "Is slow logging on?" , true , true , false ) ; // Create the actual BeanInfo instance . MBeanOperationInfo [ ] operations = null ; MBeanConstructorInfo [ ] constructors = null ; MBeanNotificationInfo [ ] notifications = null ; m_beanInfo = new MBeanInfo ( getClass ( ) . getName ( ) , "PeriodicalLog for logger " + getName ( ) , attributes , constructors , operations , notifications ) ; } else { m_beanInfo = null ; }
public class AbstractXTree { /** * Returns true if in the specified node an underflow occurred , false * otherwise . If < code > node < / code > is a supernode , never returns * < code > true < / code > , as this method automatically shortens the node ' s * capacity by one page size in case of an underflow . If this leads to a * normal page size , the node is converted into a normal ( non - super ) node an * it is removed from { @ link # supernodes } . * @ param node the node to be tested for underflow * @ return true if in the specified node an underflow occurred , false * otherwise */ @ Override protected boolean hasUnderflow ( N node ) { } }
if ( node . isLeaf ( ) ) { return node . getNumEntries ( ) < leafMinimum ; } else { if ( node . isSuperNode ( ) ) { if ( node . getCapacity ( ) - node . getNumEntries ( ) >= dirCapacity ) { int newCapacity = node . shrinkSuperNode ( dirCapacity ) ; if ( newCapacity == dirCapacity ) { assert ! node . isSuperNode ( ) ; // convert into a normal node ( and insert into the index file ) if ( node . isSuperNode ( ) ) { throw new IllegalStateException ( "This node should not be a supernode anymore" ) ; } N n = supernodes . remove ( Long . valueOf ( node . getPageID ( ) ) ) ; assert ( n != null ) ; // update the old reference in the file writeNode ( node ) ; } } return false ; } return node . getNumEntries ( ) < dirMinimum ; }
public class RelationalOperationsMatrix { /** * with the boundary of Line B . */ private void interiorAreaBoundaryLine_ ( int half_edge , int id_a , int id_b , int cluster_index_b ) { } }
if ( m_matrix [ MatrixPredicate . InteriorBoundary ] == 0 ) return ; if ( m_topo_graph . getHalfEdgeUserIndex ( m_topo_graph . getHalfEdgePrev ( m_topo_graph . getHalfEdgeTwin ( half_edge ) ) , m_visited_index ) != 1 ) { int cluster = m_topo_graph . getHalfEdgeTo ( half_edge ) ; int clusterParentage = m_topo_graph . getClusterParentage ( cluster ) ; if ( ( clusterParentage & id_a ) == 0 ) { int faceParentage = m_topo_graph . getHalfEdgeFaceParentage ( half_edge ) ; if ( ( faceParentage & id_a ) != 0 ) { int index = m_topo_graph . getClusterUserIndex ( cluster , cluster_index_b ) ; if ( ( clusterParentage & id_b ) != 0 && ( index % 2 != 0 ) ) { assert ( index != - 1 ) ; m_matrix [ MatrixPredicate . InteriorBoundary ] = 0 ; } } } }
public class Group { /** * Adds devices matching patterns < pl > to the group * @ throws DevFailed */ public void add ( final String [ ] pl ) throws DevFailed { } }
synchronized ( this ) { for ( final String element : pl ) { if ( element != null ) { final Vector v = factory . instanciate ( element ) ; final Iterator it = v . iterator ( ) ; while ( it . hasNext ( ) ) { add_i ( ( GroupElement ) it . next ( ) ) ; } } } }
public class Positions { /** * Positions the owner to the left inside its parent . < br > * Respects the parent padding . * @ param spacing the spacing * @ return the int supplier */ public static IntSupplier leftAligned ( IChild < ? > owner , int spacing ) { } }
return ( ) -> { return Padding . of ( owner . getParent ( ) ) . left ( ) + spacing ; } ;
public class JBossASClient { /** * Convienence method that executes the request . * @ param request request to execute * @ return results results of execution * @ throws Exception any error */ public ModelNode execute ( ModelNode request ) throws Exception { } }
ModelControllerClient mcc = getModelControllerClient ( ) ; return mcc . execute ( request , OperationMessageHandler . logging ) ;
public class TagletManager { /** * Initialize JavaFX - related tags . */ private void initJavaFXTaglets ( ) { } }
addStandardTaglet ( new PropertyGetterTaglet ( ) ) ; addStandardTaglet ( new PropertySetterTaglet ( ) ) ; addStandardTaglet ( new SimpleTaglet ( "propertyDescription" , message . getText ( "doclet.PropertyDescription" ) , SimpleTaglet . FIELD + SimpleTaglet . METHOD ) ) ; addStandardTaglet ( new SimpleTaglet ( "defaultValue" , message . getText ( "doclet.DefaultValue" ) , SimpleTaglet . FIELD + SimpleTaglet . METHOD ) ) ; addStandardTaglet ( new SimpleTaglet ( "treatAsPrivate" , null , SimpleTaglet . FIELD + SimpleTaglet . METHOD + SimpleTaglet . TYPE ) ) ;
public class Configurer { /** * Get the node at the following path . * @ param path The node path . * @ return The node found , < code > null < / code > if none . */ private Xml getNodeDefault ( String ... path ) { } }
Xml node = root ; for ( final String element : path ) { if ( ! node . hasChild ( element ) ) { return null ; } node = node . getChild ( element ) ; } return node ;
public class CellConstraints { /** * Sets the column , row , width , and height ; sets the horizontal and vertical alignment using the * specified alignment objects . The row span ( height ) is set to 1 * < strong > Examples : < / strong > < pre > * cc . xyw ( 1 , 3 , 2 , CellConstraints . LEFT , CellConstraints . BOTTOM ) ; * cc . xyw ( 1 , 3 , 7 , CellConstraints . CENTER , CellConstraints . FILL ) ; * < / pre > * @ param col the new column index * @ param row the new row index * @ param colSpan the column span or grid width * @ param colAlign horizontal component alignment * @ param rowAlign vertical component alignment * @ return this * @ throws IllegalArgumentException if an alignment orientation is invalid */ public CellConstraints xyw ( int col , int row , int colSpan , Alignment colAlign , Alignment rowAlign ) { } }
return xywh ( col , row , colSpan , 1 , colAlign , rowAlign ) ;
public class BlockFileTableSet { /** * Reads the table located at the given index . */ private Table readTable ( int index ) { } }
// Get the block TableBlock block = _blocks . get ( getBlock ( index ) ) ; // Return the table located at the block offset return block . getTable ( getBlockOffset ( index ) ) ;
public class XdsLoadReportStore { /** * Generates a { @ link ClusterStats } containing load stats in locality granularity . * This method should be called in the same synchronized context that * { @ link XdsLoadBalancer # helper # getSynchronizationContext } returns . */ ClusterStats generateLoadReport ( Duration interval ) { } }
ClusterStats . Builder statsBuilder = ClusterStats . newBuilder ( ) . setClusterName ( clusterName ) . setLoadReportInterval ( interval ) ; for ( Map . Entry < Locality , XdsClientLoadRecorder . ClientLoadCounter > entry : localityLoadCounters . entrySet ( ) ) { XdsClientLoadRecorder . ClientLoadSnapshot snapshot = entry . getValue ( ) . snapshot ( ) ; statsBuilder . addUpstreamLocalityStats ( UpstreamLocalityStats . newBuilder ( ) . setLocality ( entry . getKey ( ) ) . setTotalSuccessfulRequests ( snapshot . callsSucceed ) . setTotalErrorRequests ( snapshot . callsFailed ) . setTotalRequestsInProgress ( snapshot . callsInProgress ) ) ; // Discard counters for localities that are no longer exposed by the remote balancer and // no RPCs ongoing . if ( ! entry . getValue ( ) . isActive ( ) && snapshot . callsInProgress == 0 ) { localityLoadCounters . remove ( entry . getKey ( ) ) ; } } for ( Map . Entry < String , AtomicLong > entry : dropCounters . entrySet ( ) ) { statsBuilder . addDroppedRequests ( DroppedRequests . newBuilder ( ) . setCategory ( entry . getKey ( ) ) . setDroppedCount ( entry . getValue ( ) . getAndSet ( 0 ) ) ) ; } return statsBuilder . build ( ) ;
public class AppServiceCertificateOrdersInner { /** * Verify domain ownership for this certificate order . * Verify domain ownership for this certificate order . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param certificateOrderName Name of the certificate order . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceResponse } object if successful . */ public Observable < Void > verifyDomainOwnershipAsync ( String resourceGroupName , String certificateOrderName ) { } }
return verifyDomainOwnershipWithServiceResponseAsync ( resourceGroupName , certificateOrderName ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class WebSocket { /** * Perform the opening handshake . */ private Map < String , List < String > > shakeHands ( ) throws WebSocketException { } }
// The raw socket created by WebSocketFactory . Socket socket = mSocketConnector . getSocket ( ) ; // Get the input stream of the socket . WebSocketInputStream input = openInputStream ( socket ) ; // Get the output stream of the socket . WebSocketOutputStream output = openOutputStream ( socket ) ; // Generate a value for Sec - WebSocket - Key . String key = generateWebSocketKey ( ) ; // Send an opening handshake to the server . writeHandshake ( output , key ) ; // Read the response from the server . Map < String , List < String > > headers = readHandshake ( input , key ) ; // Keep the input stream and the output stream to pass them // to the reading thread and the writing thread later . mInput = input ; mOutput = output ; // The handshake succeeded . return headers ;
public class Intersectionf { /** * Determine whether the given undirected line segment intersects the given axis - aligned box , * 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 lineSegment * the line segment * @ param aabb * the AABB * @ 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 ( LineSegmentf lineSegment , AABBf aabb , Vector2f result ) { } }
return intersectLineSegmentAab ( lineSegment . aX , lineSegment . aY , lineSegment . aZ , lineSegment . bX , lineSegment . bY , lineSegment . bZ , aabb . minX , aabb . minY , aabb . minZ , aabb . maxX , aabb . maxY , aabb . maxZ , result ) ;
public class SagaType { /** * Creates a type indicating to start a complete new saga . */ public static SagaType startsNewSaga ( final Class < ? extends Saga > sagaClass ) { } }
checkNotNull ( sagaClass , "The type of the saga has to be defined." ) ; SagaType sagaType = new SagaType ( ) ; sagaType . startsNew = true ; sagaType . sagaClass = sagaClass ; return sagaType ;
public class XCAPClientResourceAdaptor { /** * ( non - Javadoc ) * @ see javax . slee . resource . ResourceAdaptor # setResourceAdaptorContext ( javax . slee . resource . ResourceAdaptorContext ) */ public void setResourceAdaptorContext ( javax . slee . resource . ResourceAdaptorContext raContext ) { } }
this . raContext = raContext ; this . tracer = raContext . getTracer ( "XCAPClientResourceAdaptor" ) ; sbbInterface = new XCAPClientResourceAdaptorSbbInterfaceImpl ( this ) ; this . sleeEndpoint = raContext . getSleeEndpoint ( ) ; this . eventLookupFacility = raContext . getEventLookupFacility ( ) ; try { this . getResponseEvent = eventLookupFacility . getFireableEventType ( new EventTypeID ( "GetResponseEvent" , "org.restcomm" , "2.0" ) ) ; this . putResponseEvent = eventLookupFacility . getFireableEventType ( new EventTypeID ( "PutResponseEvent" , "org.restcomm" , "2.0" ) ) ; this . deleteResponseEvent = eventLookupFacility . getFireableEventType ( new EventTypeID ( "DeleteResponseEvent" , "org.restcomm" , "2.0" ) ) ; } catch ( Exception e ) { if ( tracer . isWarningEnabled ( ) ) tracer . warning ( "Could not look up Response Event" , e ) ; }
public class A_CmsStaticExportHandler { /** * Gets the exported detail page files which need to be purged . < p > * @ param cms the current cms context * @ param res the published resource * @ param vfsName the vfs name * @ return the list of files to be purged */ private List < File > getDetailPageFiles ( CmsObject cms , CmsPublishedResource res , String vfsName ) { } }
List < File > files = new ArrayList < File > ( ) ; try { if ( ( OpenCms . getRunLevel ( ) < OpenCms . RUNLEVEL_4_SERVLET_ACCESS ) ) { // Accessing the ADE manager during setup may not work . // also folders can not be displayed in detail pages return files ; } List < String > urlNames = cms . getAllUrlNames ( res . getStructureId ( ) ) ; Collection < String > detailpages = OpenCms . getADEManager ( ) . getDetailPageFinder ( ) . getAllDetailPages ( cms , res . getType ( ) ) ; for ( String urlName : urlNames ) { for ( String detailPage : detailpages ) { String rfsName = CmsStringUtil . joinPaths ( OpenCms . getStaticExportManager ( ) . getRfsName ( cms , detailPage ) , urlName , CmsStaticExportManager . DEFAULT_FILE ) ; String rfsExportFileName = CmsFileUtil . normalizePath ( OpenCms . getStaticExportManager ( ) . getExportPath ( vfsName ) + rfsName . substring ( OpenCms . getStaticExportManager ( ) . getRfsPrefix ( vfsName ) . length ( ) ) ) ; File file = new File ( rfsExportFileName ) ; if ( file . exists ( ) && ! files . contains ( file ) ) { files . add ( file ) ; } } } } catch ( CmsException e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } return files ;
public class JavaAssets { /** * Adds the given directory to the search path for resources . * < p > TODO : remove ? get ? < / p > */ public void addDirectory ( File dir ) { } }
File [ ] ndirs = new File [ directories . length + 1 ] ; System . arraycopy ( directories , 0 , ndirs , 0 , directories . length ) ; ndirs [ ndirs . length - 1 ] = dir ; directories = ndirs ;
public class TriangularSolver_ZDRM { /** * Solves for non - singular lower triangular matrices with real valued diagonal elements * using forward substitution . * < br > * b = L < sup > - 1 < / sup > b < br > * < br > * where b is a vector , L is an n by n matrix . < br > * @ param L An n by n non - singular lower triangular matrix . Not modified . * @ param b A vector of length n . Modified . * @ param n The size of the matrices . */ public static void solveL_diagReal ( double L [ ] , double [ ] b , int n ) { } }
// for ( int i = 0 ; i < n ; i + + ) { // double sum = b [ i ] ; // for ( int k = 0 ; k < i ; k + + ) { // sum - = L [ i * n + k ] * b [ k ] ; // b [ i ] = sum / L [ i * n + i ] ; int stride = n * 2 ; for ( int i = 0 ; i < n ; i ++ ) { double realSum = b [ i * 2 ] ; double imagSum = b [ i * 2 + 1 ] ; int indexL = i * stride ; int indexB = 0 ; for ( int k = 0 ; k < i ; k ++ ) { double realL = L [ indexL ++ ] ; double imagL = L [ indexL ++ ] ; double realB = b [ indexB ++ ] ; double imagB = b [ indexB ++ ] ; realSum -= realL * realB - imagL * imagB ; imagSum -= realL * imagB + imagL * realB ; } double realL = L [ indexL ] ; b [ i * 2 ] = realSum / realL ; b [ i * 2 + 1 ] = imagSum / realL ; }
public class ReservoirLongsSketch { /** * Computes an estimated subset sum from the entire stream for objects matching a given * predicate . Provides a lower bound , estimate , and upper bound using a target of 2 standard * deviations . * < p > This is technically a heuristic method , and tries to err on the conservative side . < / p > * @ param predicate A predicate to use when identifying items . * @ return A summary object containing the estimate , upper and lower bounds , and the total * sketch weight . */ public SampleSubsetSummary estimateSubsetSum ( final Predicate < Long > predicate ) { } }
if ( itemsSeen_ == 0 ) { return new SampleSubsetSummary ( 0.0 , 0.0 , 0.0 , 0.0 ) ; } final long numSamples = getNumSamples ( ) ; final double samplingRate = numSamples / ( double ) itemsSeen_ ; assert samplingRate >= 0.0 ; assert samplingRate <= 1.0 ; int predTrueCount = 0 ; for ( int i = 0 ; i < numSamples ; ++ i ) { if ( predicate . test ( data_ [ i ] ) ) { ++ predTrueCount ; } } // if in exact mode , we can return an exact answer if ( itemsSeen_ <= reservoirSize_ ) { return new SampleSubsetSummary ( predTrueCount , predTrueCount , predTrueCount , numSamples ) ; } final double lbTrueFraction = pseudoHypergeometricLBonP ( numSamples , predTrueCount , samplingRate ) ; final double estimatedTrueFraction = ( 1.0 * predTrueCount ) / numSamples ; final double ubTrueFraction = pseudoHypergeometricUBonP ( numSamples , predTrueCount , samplingRate ) ; return new SampleSubsetSummary ( itemsSeen_ * lbTrueFraction , itemsSeen_ * estimatedTrueFraction , itemsSeen_ * ubTrueFraction , itemsSeen_ ) ;
public class Datamodel { /** * Creates a { @ link ValueSnak } . * @ param propertyId * @ param value * @ return a { @ link ValueSnak } corresponding to the input */ public static ValueSnak makeValueSnak ( PropertyIdValue propertyId , Value value ) { } }
return factory . getValueSnak ( propertyId , value ) ;
public class AbstractXMLBasedDataSource { /** * Reads up to ( @ code maxScansToRead ) scans from the iterator , checking for continuity of scans in * the original file , so it could do sequential reads . * @ param scanNumsIter iterator over scan numbers to be read * @ param maxScansToReadInBatch max number of scans to read from the provided iterator * @ param readTasks a list , where scan index elements , that were read in this call , will be * placed * @ param index the index of XML files * @ param file random acccess file to read from * @ param readBuf the buffer to read to , might be changed and grown , new instance will be returned * by this method * @ return the read buffer , might not be the same array instance , the buffer could have been grown * to accommodate all spectra from the iterator . */ private byte [ ] readListOfSpectra ( ListIterator < Integer > scanNumsIter , int maxScansToReadInBatch , ArrayList < OffsetLength > readTasks , NavigableMap < Integer , ? extends XMLBasedIndexElement > index , RandomAccessFile file , byte [ ] readBuf ) throws IOException { } }
if ( ! scanNumsIter . hasNext ( ) ) { throw new IllegalArgumentException ( "Scan number iterator had no active elements" ) ; } Arrays . fill ( readBuf , ( byte ) 2 ) ; Integer scanNumCur ; Integer scanNumPrev = null ; Integer scanNumLower ; int batchStart = 0 ; int batchLen = 0 ; int readBufPos = 0 ; // process the first scan scanNumCur = scanNumsIter . next ( ) ; OffsetLength offsetLength = index . get ( scanNumCur ) . getOffsetLength ( ) ; if ( offsetLength == null ) { throw new IllegalArgumentException ( "The scan number requested for reading was not in the index" ) ; } readTasks . add ( offsetLength ) ; batchLen ++ ; if ( ! scanNumsIter . hasNext ( ) || maxScansToReadInBatch == 1 ) { long readOffset = readTasks . get ( batchStart ) . offset ; int readLength = ( int ) ( offsetLength . offset - readOffset + offsetLength . length ) ; // check if the buffer size is enough and expand accordingly , or clean the old buffer int spaceLeft = readBuf . length - readBufPos ; if ( spaceLeft < readLength ) { readBuf = Arrays . copyOf ( readBuf , readBuf . length + readLength ) ; // grow more than needed } file . seek ( readOffset ) ; file . readFully ( readBuf , readBufPos , readLength ) ; return readBuf ; } while ( scanNumsIter . hasNext ( ) && readTasks . size ( ) < maxScansToReadInBatch ) { scanNumCur = scanNumsIter . next ( ) ; offsetLength = index . get ( scanNumCur ) . getOffsetLength ( ) ; if ( offsetLength == null ) { throw new IllegalArgumentException ( "The scan number requested for reading was not in the index" ) ; } scanNumLower = index . lowerKey ( scanNumCur ) ; // check continuity of requested spectra in the file if ( scanNumPrev != scanNumLower ) { // discontinuity or no more scans // flush the current batch long readOffset = readTasks . get ( batchStart ) . offset ; OffsetLength lastReadTask = readTasks . get ( batchStart + batchLen - 1 ) ; int readLength = ( int ) ( lastReadTask . offset - readOffset + lastReadTask . length ) ; // check if the buffer size is enough and expand accordingly , or clean the old buffer int spaceLeft = readBuf . length - readBufPos ; if ( spaceLeft < readLength ) { readBuf = Arrays . copyOf ( readBuf , readBuf . length + readLength ) ; // grow more than needed } file . seek ( readOffset ) ; file . readFully ( readBuf , readBufPos , readLength ) ; readBufPos += readLength ; batchLen = 0 ; batchStart = readTasks . size ( ) ; } readTasks . add ( offsetLength ) ; batchLen ++ ; scanNumPrev = scanNumCur ; } if ( batchLen > 0 ) { // if we have something left to process , flush the last batch long readOffset = readTasks . get ( batchStart ) . offset ; OffsetLength lastReadTask = readTasks . get ( batchStart + batchLen - 1 ) ; int readLength = ( int ) ( lastReadTask . offset - readOffset + lastReadTask . length ) ; // check if the buffer size is enough and expand accordingly , or clean the old buffer int spaceLeft = readBuf . length - readBufPos ; if ( spaceLeft < readLength ) { readBuf = Arrays . copyOf ( readBuf , readBuf . length + readLength ) ; // grow more than needed } file . seek ( readOffset ) ; file . readFully ( readBuf , readBufPos , readLength ) ; } return readBuf ;
public class MemcachedConnection { /** * Construct a String containing information about all nodes and their state . * @ return a stringified representation of the connection status . */ public String connectionsStatus ( ) { } }
StringBuilder connStatus = new StringBuilder ( ) ; connStatus . append ( "Connection Status {" ) ; for ( MemcachedNode node : locator . getAll ( ) ) { connStatus . append ( " " ) . append ( node . getSocketAddress ( ) ) . append ( " active: " ) . append ( node . isActive ( ) ) . append ( ", authed: " ) . append ( node . isAuthenticated ( ) ) . append ( MessageFormat . format ( ", last read: {0} ms ago" , node . lastReadDelta ( ) ) ) ; } connStatus . append ( " }" ) ; return connStatus . toString ( ) ;
public class MtasDataAdvanced { /** * ( non - Javadoc ) * @ see mtas . codec . util . collector . MtasDataCollector # reduceToSegmentKeys ( ) */ @ Override public void reduceToSegmentKeys ( ) { } }
if ( segmentRegistration != null && size > 0 ) { int sizeCopy = size ; String [ ] keyListCopy = keyList . clone ( ) ; T1 [ ] advancedValueSumListCopy = advancedValueSumList . clone ( ) ; T1 [ ] advancedValueMaxListCopy = advancedValueMaxList . clone ( ) ; T1 [ ] advancedValueMinListCopy = advancedValueMinList . clone ( ) ; T1 [ ] advancedValueSumOfSquaresListCopy = advancedValueSumOfSquaresList . clone ( ) ; T2 [ ] advancedValueSumOfLogsListCopy = advancedValueSumOfLogsList . clone ( ) ; long [ ] advancedValueNListCopy = advancedValueNList . clone ( ) ; size = 0 ; for ( int i = 0 ; i < sizeCopy ; i ++ ) { if ( segmentKeys . contains ( keyListCopy [ i ] ) ) { keyList [ size ] = keyListCopy [ i ] ; advancedValueSumList [ size ] = advancedValueSumListCopy [ i ] ; advancedValueMaxList [ size ] = advancedValueMaxListCopy [ i ] ; advancedValueMinList [ size ] = advancedValueMinListCopy [ i ] ; advancedValueSumOfSquaresList [ size ] = advancedValueSumOfSquaresListCopy [ i ] ; advancedValueSumOfLogsList [ size ] = advancedValueSumOfLogsListCopy [ i ] ; advancedValueNList [ size ] = advancedValueNListCopy [ i ] ; size ++ ; } } }
public class HttpApiUtil { /** * Returns a { @ link BiFunction } for a { @ link CompletionStage # handle ( BiFunction ) } which returns an object * if the specified { @ link Throwable } is { @ code null } . Otherwise , it throws the { @ code cause } . */ @ SuppressWarnings ( "unchecked" ) static < T , U > BiFunction < ? super T , Throwable , ? extends U > returnOrThrow ( Supplier < ? super U > supplier ) { } }
return ( unused , cause ) -> { throwUnsafelyIfNonNull ( cause ) ; return ( U ) supplier . get ( ) ; } ;
public class IfcDraughtingCalloutImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) public EList < IfcDraughtingCalloutElement > getContents ( ) { } }
return ( EList < IfcDraughtingCalloutElement > ) eGet ( Ifc2x3tc1Package . Literals . IFC_DRAUGHTING_CALLOUT__CONTENTS , true ) ;
public class Static { /** * Verify if a resource is fresh , fresh means that its cache headers are validated against the local resource and * etags last - modified headers are still the same . * @ param request * @ return { boolean } */ private boolean isFresh ( final YokeRequest request ) { } }
// defaults boolean etagMatches = true ; boolean notModified = true ; // fields String modifiedSince = request . getHeader ( "if-modified-since" ) ; String noneMatch = request . getHeader ( "if-none-match" ) ; String [ ] noneMatchTokens = null ; String lastModified = request . response ( ) . getHeader ( "last-modified" ) ; String etag = request . response ( ) . getHeader ( "etag" ) ; // unconditional request if ( modifiedSince == null && noneMatch == null ) { return false ; } // parse if - none - match if ( noneMatch != null ) { noneMatchTokens = noneMatch . split ( " *, *" ) ; } // if - none - match if ( noneMatchTokens != null ) { etagMatches = false ; for ( String s : noneMatchTokens ) { if ( etag . equals ( s ) || "*" . equals ( noneMatchTokens [ 0 ] ) ) { etagMatches = true ; break ; } } } // if - modified - since if ( modifiedSince != null ) { try { Date modifiedSinceDate = parse ( modifiedSince ) ; Date lastModifiedDate = parse ( lastModified ) ; notModified = lastModifiedDate . getTime ( ) <= modifiedSinceDate . getTime ( ) ; } catch ( ParseException e ) { notModified = false ; } } return etagMatches && notModified ;
public class DataTableBeanExample { /** * Creates and configures the table to be used by the example . * @ return a new configured table . */ private WDataTable createTable ( ) { } }
WDataTable tbl = new WDataTable ( ) ; tbl . addColumn ( new WTableColumn ( "First name" , new WTextField ( ) ) ) ; tbl . addColumn ( new WTableColumn ( "Last name" , new WTextField ( ) ) ) ; tbl . addColumn ( new WTableColumn ( "DOB" , new WDateField ( ) ) ) ; return tbl ;
public class SingleSignOnSessionsEndpoint { /** * Endpoint for destroying a single SSO Session . * @ param ticketGrantingTicket the ticket granting ticket * @ return result map */ @ DeleteOperation public Map < String , Object > destroySsoSession ( @ Selector final String ticketGrantingTicket ) { } }
val sessionsMap = new HashMap < String , Object > ( 1 ) ; try { this . centralAuthenticationService . destroyTicketGrantingTicket ( ticketGrantingTicket ) ; sessionsMap . put ( STATUS , HttpServletResponse . SC_OK ) ; sessionsMap . put ( TICKET_GRANTING_TICKET , ticketGrantingTicket ) ; } catch ( final Exception e ) { LOGGER . error ( e . getMessage ( ) , e ) ; sessionsMap . put ( STATUS , HttpServletResponse . SC_INTERNAL_SERVER_ERROR ) ; sessionsMap . put ( TICKET_GRANTING_TICKET , ticketGrantingTicket ) ; sessionsMap . put ( "message" , e . getMessage ( ) ) ; } return sessionsMap ;
public class DefaultDockerClient { /** * Create a new { @ link DefaultDockerClient } builder prepopulated with values loaded from the * DOCKER _ HOST and DOCKER _ CERT _ PATH environment variables . * @ return Returns a builder that can be used to further customize and then build the client . * @ throws DockerCertificateException if we could not build a DockerCertificates object */ public static Builder fromEnv ( ) throws DockerCertificateException { } }
final String endpoint = DockerHost . endpointFromEnv ( ) ; final Path dockerCertPath = Paths . get ( firstNonNull ( DockerHost . certPathFromEnv ( ) , DockerHost . defaultCertPath ( ) ) ) ; final Builder builder = new Builder ( ) ; final Optional < DockerCertificatesStore > certs = DockerCertificates . builder ( ) . dockerCertPath ( dockerCertPath ) . build ( ) ; if ( endpoint . startsWith ( UNIX_SCHEME + "://" ) ) { builder . uri ( endpoint ) ; } else if ( endpoint . startsWith ( NPIPE_SCHEME + "://" ) ) { builder . uri ( endpoint ) ; } else { final String stripped = endpoint . replaceAll ( ".*://" , "" ) ; final HostAndPort hostAndPort = HostAndPort . fromString ( stripped ) ; final String hostText = hostAndPort . getHost ( ) ; final String scheme = certs . isPresent ( ) ? "https" : "http" ; final int port = hostAndPort . getPortOrDefault ( DockerHost . defaultPort ( ) ) ; final String address = isNullOrEmpty ( hostText ) ? DockerHost . defaultAddress ( ) : hostText ; builder . uri ( scheme + "://" + address + ":" + port ) ; } if ( certs . isPresent ( ) ) { builder . dockerCertificates ( certs . get ( ) ) ; } return builder ;
public class DescribeLifecycleHookTypesResult { /** * The lifecycle hook types . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setLifecycleHookTypes ( java . util . Collection ) } or { @ link # withLifecycleHookTypes ( java . util . Collection ) } if * you want to override the existing values . * @ param lifecycleHookTypes * The lifecycle hook types . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeLifecycleHookTypesResult withLifecycleHookTypes ( String ... lifecycleHookTypes ) { } }
if ( this . lifecycleHookTypes == null ) { setLifecycleHookTypes ( new com . amazonaws . internal . SdkInternalList < String > ( lifecycleHookTypes . length ) ) ; } for ( String ele : lifecycleHookTypes ) { this . lifecycleHookTypes . add ( ele ) ; } return this ;
public class CommercePaymentMethodGroupRelServiceBaseImpl { /** * Sets the image remote service . * @ param imageService the image remote service */ public void setImageService ( com . liferay . portal . kernel . service . ImageService imageService ) { } }
this . imageService = imageService ;
public class TokenParser { /** * Returns an array of tokens that contains tokenized string . * @ param text the string to parse * @ param optimize whether to optimize tokens * @ return an array of tokens */ public static Token [ ] parse ( String text , boolean optimize ) { } }
if ( text == null ) { return null ; } if ( text . length ( ) == 0 ) { Token t = new Token ( text ) ; return new Token [ ] { t } ; } Token [ ] tokens = null ; List < Token > tokenList = Tokenizer . tokenize ( text , optimize ) ; if ( ! tokenList . isEmpty ( ) ) { tokens = tokenList . toArray ( new Token [ 0 ] ) ; if ( optimize ) { tokens = Tokenizer . optimize ( tokens ) ; } } return tokens ;
public class CmsContentEditor { /** * Initializes the locale selector . < p > */ private void initLocaleSelect ( ) { } }
if ( m_availableLocales . size ( ) < 2 ) { return ; } Map < String , String > selectOptions = new HashMap < String , String > ( ) ; for ( Entry < String , String > localeEntry : m_availableLocales . entrySet ( ) ) { if ( m_contentLocales . contains ( localeEntry . getKey ( ) ) ) { selectOptions . put ( localeEntry . getKey ( ) , localeEntry . getValue ( ) ) ; } else { selectOptions . put ( localeEntry . getKey ( ) , localeEntry . getValue ( ) + " [-]" ) ; } } if ( m_localeSelect == null ) { m_localeSelect = new CmsSelectBox ( selectOptions ) ; m_toolbar . insertRight ( m_localeSelect , 1 ) ; m_localeSelect . addStyleName ( I_CmsLayoutBundle . INSTANCE . generalCss ( ) . inlineBlock ( ) ) ; m_localeSelect . getElement ( ) . getStyle ( ) . setWidth ( 100 , Unit . PX ) ; m_localeSelect . getElement ( ) . getStyle ( ) . setVerticalAlign ( VerticalAlign . MIDDLE ) ; m_localeSelect . addValueChangeHandler ( new ValueChangeHandler < String > ( ) { public void onValueChange ( ValueChangeEvent < String > event ) { switchLocale ( event . getValue ( ) ) ; } } ) ; } else { m_localeSelect . setItems ( selectOptions ) ; } m_localeSelect . setFormValueAsString ( m_locale ) ; if ( m_deleteLocaleButton == null ) { m_deleteLocaleButton = createButton ( Messages . get ( ) . key ( Messages . GUI_TOOLBAR_DELETE_LOCALE_0 ) , "opencms-icon-remove-locale" ) ; m_deleteLocaleButton . addClickHandler ( new ClickHandler ( ) { public void onClick ( ClickEvent event ) { confirmDeleteLocale ( ) ; } } ) ; m_toolbar . insertRight ( m_deleteLocaleButton , 2 ) ; } if ( m_contentLocales . size ( ) > 1 ) { m_deleteLocaleButton . enable ( ) ; } else { m_deleteLocaleButton . disable ( Messages . get ( ) . key ( Messages . GUI_TOOLBAR_CANT_DELETE_LAST_LOCALE_0 ) ) ; } if ( m_copyLocaleButton == null ) { m_copyLocaleButton = createButton ( I_CmsButton . ButtonData . COPY_LOCALE_BUTTON . getTitle ( ) , I_CmsButton . ButtonData . COPY_LOCALE_BUTTON . getIconClass ( ) ) ; m_copyLocaleButton . addClickHandler ( new ClickHandler ( ) { public void onClick ( ClickEvent event ) { openCopyLocaleDialog ( ) ; } } ) ; m_toolbar . insertRight ( m_copyLocaleButton , 3 ) ; }
public class BeaconManager { /** * Convenience method for logging debug by the library * @ param tag * @ param message * @ deprecated This will be removed in a later release . Use * { @ link org . altbeacon . beacon . logging . LogManager # d ( String , String , Object . . . ) } instead . */ @ Deprecated public static void logDebug ( String tag , String message ) { } }
LogManager . d ( tag , message ) ;
public class AmazonLightsailClient { /** * Copies an instance or disk snapshot from one AWS Region to another in Amazon Lightsail . * @ param copySnapshotRequest * @ return Result of the CopySnapshot operation returned by the service . * @ throws ServiceException * A general service exception . * @ throws InvalidInputException * Lightsail throws this exception when user input does not conform to the validation rules of an input * field . < / p > < note > * Domain - related APIs are only available in the N . Virginia ( us - east - 1 ) Region . Please set your AWS Region * configuration to us - east - 1 to create , view , or edit these resources . * @ throws NotFoundException * Lightsail throws this exception when it cannot find a resource . * @ throws OperationFailureException * Lightsail throws this exception when an operation fails to execute . * @ throws AccessDeniedException * Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to * access a resource . * @ throws AccountSetupInProgressException * Lightsail throws this exception when an account is still in the setup in progress state . * @ throws UnauthenticatedException * Lightsail throws this exception when the user has not been authenticated . * @ sample AmazonLightsail . CopySnapshot * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / lightsail - 2016-11-28 / CopySnapshot " target = " _ top " > AWS API * Documentation < / a > */ @ Override public CopySnapshotResult copySnapshot ( CopySnapshotRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeCopySnapshot ( request ) ;
public class DelegatingSignMessageDecryptionService { /** * { @ inheritDoc } */ @ Override public Message decrypt ( SignMessage signMessage ) throws DecryptionException { } }
ServiceableComponent < SignMessageDecryptionService > component = null ; try { component = service . getServiceableComponent ( ) ; if ( null == component ) { throw new DecryptionException ( "SignMessageDecryptionService: Error accessing underlying component: Invalid configuration" ) ; } else { final SignMessageDecryptionService svc = component . getComponent ( ) ; return svc . decrypt ( signMessage ) ; } } finally { if ( null != component ) { component . unpinComponent ( ) ; } }
public class MapBasedDatabasePlatformSupport { /** * Constructs the URL for the database by using a { @ link URI } to construct the URL . * @ param databaseType - The databaseType for which the URL should be constructed . * @ param hostname - The hostname without any port information used to connect to . * @ param port - The port used to connect to the database * @ param databaseName - The database name used to connect to . The usage is * implementation specific ( e . g . for Oracle this is the SID ) * @ return - the database specific URL * @ throws IllegalArgumentException if there is no scheme available for the database * type or if the information is not valid to construct a URL . */ @ Override public String getDatabaseUrlForDatabase ( DatabaseType databaseType , String hostname , int port , String databaseName ) { } }
String scheme = this . getSchemeNames ( ) . get ( databaseType ) ; String authenticationInfo = this . getAuthenticationInfo ( ) . get ( databaseType ) ; Assert . notNull ( databaseType , String . format ( "No scheme name found for database :'%s'" , databaseType . name ( ) ) ) ; try { return new URI ( scheme , authenticationInfo , hostname , port , databaseName != null ? "/" + databaseName : null , null , null ) . toString ( ) ; } catch ( URISyntaxException e ) { throw new IllegalArgumentException ( "Error constructing URI from Host:'" + hostname + "' and port:'" + port + "' and database name:'" + databaseName + "'!" ) ; }
public class CareWebUtil { /** * Shows help topic in help viewer . * @ param module The id of the help module . * @ param topic The id of the desired topic . * @ param label The label to display for the topic . */ public static void showHelpTopic ( String module , String topic , String label ) { } }
getShell ( ) . getHelpViewer ( ) ; HelpUtil . show ( module , topic , label ) ;
public class ProjectCalendarException { /** * { @ inheritDoc } */ @ Override public int compareTo ( ProjectCalendarException o ) { } }
long fromTime1 = m_fromDate . getTime ( ) ; long fromTime2 = o . m_fromDate . getTime ( ) ; return ( ( fromTime1 < fromTime2 ) ? ( - 1 ) : ( ( fromTime1 == fromTime2 ) ? 0 : 1 ) ) ;
public class StreamServer { /** * Closes something quietly . * @ param c closable */ private void closeQuietly ( Closeable c ) { } }
if ( c != null ) { try { c . close ( ) ; } catch ( Throwable t ) { logger . warn ( "Error closing, ignoring" , t ) ; } }
public class DefaultGroupParser { /** * 解析 * @ param group * @ param parser * @ return */ @ Override public Object parse ( IGroup group , JsonRuleParser parser ) { } }
StringBuffer operate = new StringBuffer ( ) ; // NOT if ( group . getNot ( ) != null && group . getNot ( ) ) { operate . append ( "( NOT " ) ; } if ( group . getRules ( ) . size ( ) > 0 ) { operate . append ( "( " ) ; } // rules List < Object > params = new ArrayList < Object > ( ) ; for ( int i = 0 ; i < group . getRules ( ) . size ( ) ; i ++ ) { // json parse Operation operation = ( Operation ) parser . parse ( group . getRules ( ) . get ( i ) ) ; // operate operate . append ( operation . getOperate ( ) ) ; if ( i < group . getRules ( ) . size ( ) - 1 ) { operate . append ( EnumCondition . AND . equals ( group . getCondition ( ) ) ? " AND " : " OR " ) ; } // params if ( operation . getHasValue ( ) ) { if ( operation . getValue ( ) instanceof List ) { params . addAll ( ( Collection < ? > ) operation . getValue ( ) ) ; } else { params . add ( operation . getValue ( ) ) ; } } } if ( group . getRules ( ) . size ( ) > 0 ) { operate . append ( " )" ) ; } if ( group . getNot ( ) != null && group . getNot ( ) ) { operate . append ( " )" ) ; } return new Operation ( operate , params ) ;
public class TopicDefinition { /** * Test if this topic definition supports the given delivery mode * @ param deliveryMode a delivery mode * @ return true if the mode is supported */ public boolean supportDeliveryMode ( int deliveryMode ) { } }
switch ( deliveryMode ) { case DeliveryMode . PERSISTENT : return initialBlockCount > 0 ; case DeliveryMode . NON_PERSISTENT : return maxNonPersistentMessages > 0 ; default : throw new IllegalArgumentException ( "Invalid delivery mode : " + deliveryMode ) ; }
public class RSAWithBase64 { /** * 从Base64字符中解出私钥 * < p > Function : decryptPrivateKey < / p > * < p > Description : < / p > * @ param privateKeyStr * @ return * @ author acexy @ thankjava . com * @ date 2016年8月11日 上午9:43:39 * @ version 1.0 */ public static PrivateKey decryptPrivateKey ( String privateKeyStr ) { } }
try { KeyFactory keyFactory = KeyFactory . getInstance ( algorithm ) ; PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec ( Base64Util . decode ( privateKeyStr ) ) ; return keyFactory . generatePrivate ( keySpec ) ; } catch ( NoSuchAlgorithmException e ) { e . printStackTrace ( ) ; } catch ( InvalidKeySpecException e ) { e . printStackTrace ( ) ; } return null ;
public class AstaDatabaseReader { /** * Retrieve a number of rows matching the supplied query . * @ param sql query statement * @ return result set * @ throws SQLException */ private List < Row > getRows ( String sql ) throws SQLException { } }
allocateConnection ( ) ; try { List < Row > result = new LinkedList < Row > ( ) ; m_ps = m_connection . prepareStatement ( sql ) ; m_rs = m_ps . executeQuery ( ) ; populateMetaData ( ) ; while ( m_rs . next ( ) ) { result . add ( new MpdResultSetRow ( m_rs , m_meta ) ) ; } return ( result ) ; } finally { releaseConnection ( ) ; }
public class RateMeDialogTimer { /** * Set opt out flag . If it is true , the rate dialog will never shown unless app data is cleared . */ public static void setOptOut ( final Context context , boolean optOut ) { } }
SharedPreferences pref = context . getSharedPreferences ( PREF_NAME , Context . MODE_PRIVATE ) ; Editor editor = pref . edit ( ) ; editor . putBoolean ( KEY_OPT_OUT , optOut ) ; editor . apply ( ) ;
public class ComputationGraph { /** * Fit the ComputationGraph using the specified inputs and labels ( and mask arrays ) * @ param inputs The network inputs ( features ) * @ param labels The network labels * @ param featureMaskArrays Mask arrays for inputs / features . Typically used for RNN training . May be null . * @ param labelMaskArrays Mas arrays for the labels / outputs . Typically used for RNN training . May be null . */ public void fit ( INDArray [ ] inputs , INDArray [ ] labels , INDArray [ ] featureMaskArrays , INDArray [ ] labelMaskArrays ) { } }
try { fitHelper ( inputs , labels , featureMaskArrays , labelMaskArrays ) ; } catch ( OutOfMemoryError e ) { CrashReportingUtil . writeMemoryCrashDump ( this , e ) ; throw e ; }
public class Yaml { /** * Dumps { @ code data } into a { @ code OutputStream } using a { @ code UTF - 8} * encoding . * @ param data the data * @ param output the output stream */ public void dumpAll ( Iterable < ? extends YamlNode > data , OutputStream output ) { } }
dumpAll ( data . iterator ( ) , output ) ;
public class WebSocket { /** * Execute { @ link # connect ( ) } asynchronously by creating a new thread and * calling { @ code connect ( ) } in the thread . If { @ code connect ( ) } failed , * { @ link WebSocketListener # onConnectError ( WebSocket , WebSocketException ) * onConnectError ( ) } method of { @ link WebSocketListener } is called . * @ return * { @ code this } object . * @ since 1.8 */ public WebSocket connectAsynchronously ( ) { } }
Thread thread = new ConnectThread ( this ) ; // Get the reference ( just in case ) ListenerManager lm = mListenerManager ; if ( lm != null ) { lm . callOnThreadCreated ( ThreadType . CONNECT_THREAD , thread ) ; } thread . start ( ) ; return this ;
public class WeldCollections { /** * Returns the supplied collection as a multi - row string with every toString ( ) of every element of the collection * in its own row . * Example : toMultiRowString ( Arrays . asList ( " aaa " , " bbb " , " ccc " ) ) will return : * < pre > * - aaa , * - bbb , * - ccc * < / pre > */ public static String toMultiRowString ( Collection < ? > collection ) { } }
if ( collection == null ) { return null ; } if ( collection . isEmpty ( ) ) { return "(empty collection)" ; } StringBuilder builder = new StringBuilder ( "\n - " ) ; for ( Iterator < ? > iterator = collection . iterator ( ) ; iterator . hasNext ( ) ; ) { builder . append ( iterator . next ( ) ) ; if ( iterator . hasNext ( ) ) { builder . append ( ",\n - " ) ; } } return builder . toString ( ) ;
public class InappropriateToStringUse { /** * overrides the visitor to reset the stack * @ param classContext * the context object of the currently parsed class */ @ Override public void visitClassContext ( ClassContext classContext ) { } }
try { stack = new OpcodeStack ( ) ; toStringRegisters = new HashMap < > ( ) ; packageName = classContext . getJavaClass ( ) . getPackageName ( ) ; super . visitClassContext ( classContext ) ; } finally { stack = null ; toStringRegisters = null ; }
public class CommandExecutionSpec { /** * Check the non existence of a text at a command output * @ param search */ @ Then ( "^the command output does not contain '(.+?)'$" ) public void notFindShellOutput ( String search ) throws Exception { } }
assertThat ( commonspec . getCommandResult ( ) ) . as ( "NotContains " + search + "." ) . doesNotContain ( search ) ;
public class StaticClassWriter { /** * { @ inheritDoc } */ @ Override protected String getCommonSuperClass ( final String type1 , final String type2 ) { } }
if ( ! alwaysStatic ) { try { return super . getCommonSuperClass ( type1 , type2 ) ; } catch ( Throwable e ) { // Try something else . . . } } // Exactly the same as in ClassWriter , but gets the superclass // directly from the class file . ClassInfo ci1 , ci2 ; try { ci1 = new ClassInfo ( type1 , classLoader , alwaysStatic ) ; ci2 = new ClassInfo ( type2 , classLoader , alwaysStatic ) ; } catch ( Throwable e ) { throw new RuntimeException ( e ) ; } if ( ci1 . isAssignableFrom ( ci2 ) ) { return type1 ; } if ( ci2 . isAssignableFrom ( ci1 ) ) { return type2 ; } if ( ci1 . isInterface ( ) || ci2 . isInterface ( ) ) { return "java/lang/Object" ; } do { // Should never be null , because if ci1 were the Object class // or an interface , it would have been caught above . ci1 = ci1 . getSuperclass ( ) ; } while ( ! ci1 . isAssignableFrom ( ci2 ) ) ; return ci1 . getType ( ) . getInternalName ( ) ;
public class DMatrixRMaj { /** * Assigns the element in the Matrix to the specified value . Performs a bounds check to make sure * the requested element is part of the matrix . < br > * < br > * a < sub > ij < / sub > = value < br > * @ param row The row of the element . * @ param col The column of the element . * @ param value The element ' s new value . */ @ Override public void set ( int row , int col , double value ) { } }
if ( col < 0 || col >= numCols || row < 0 || row >= numRows ) { throw new IllegalArgumentException ( "Specified element is out of bounds: (" + row + " , " + col + ")" ) ; } data [ row * numCols + col ] = value ;
public class RelFacts { /** * Returns a relation factory that generates * < code > Relation < / code > s interface backed by a < code > Map < / code > * from keys to < code > Set < / code > s of values . The map is created * by < code > mapFact < / code > and the sets by < code > setFact < / code > . * The two parameters allow the programmer to finely tune the * relations from the program . */ public static < K , V > RelationFactory < K , V > mapSet ( MapFactory < K , Set < V > > mapFact , SetFactory < V > setFact ) { } }
return new jpaul . DataStructs . MapSetRelationFactory < K , V > ( mapFact , setFact ) ;
public class AnnotationUtility { /** * Gets the annotation attribute as boolean . * @ param model the model * @ param annotation the annotation * @ param attribute the attribute * @ param defaultValue the default value * @ return the annotation attribute as boolean */ public static Boolean getAnnotationAttributeAsBoolean ( ModelWithAnnotation model , Class < ? extends Annotation > annotation , AnnotationAttributeType attribute , Boolean defaultValue ) { } }
return getAnnotationAttribute ( model , annotation , attribute , defaultValue , new OnAnnotationAttributeListener < Boolean > ( ) { @ Override public Boolean onFound ( String value ) { return Boolean . valueOf ( value ) ; } } ) ;
public class TTFSubSetFile { /** * Returns a subset of the original font . * @ param in FontFileReader to read from * @ param name Name to be checked for in the font file * @ param glyphs Map of glyphs ( glyphs has old index as ( Integer ) key and * new index as ( Integer ) value ) * @ return A subset of the original font * @ throws IOException in case of an I / O problem */ public byte [ ] readFont ( FontFileReader in , String name , Map glyphs ) throws IOException { } }
// Check if TrueType collection , and that the name exists in the collection if ( ! checkTTC ( in , name ) ) { throw new IOException ( "Failed to read font" ) ; } output = new byte [ in . getFileSize ( ) ] ; readDirTabs ( in ) ; readFontHeader ( in ) ; getNumGlyphs ( in ) ; readHorizontalHeader ( in ) ; readHorizontalMetrics ( in ) ; readIndexToLocation ( in ) ; scanGlyphs ( in , glyphs ) ; createDirectory ( ) ; // Create the TrueType header and directory createHead ( in ) ; createHhea ( in , glyphs . size ( ) ) ; // Create the hhea table createHmtx ( in , glyphs ) ; // Create hmtx table createMaxp ( in , glyphs . size ( ) ) ; // copy the maxp table try { createCvt ( in ) ; // copy the cvt table } catch ( IOException ex ) { // Cvt is optional ( only required for OpenType ( MS ) fonts ) // log . error ( " TrueType warning : " + ex . getMessage ( ) ) ; } try { createFpgm ( in ) ; // copy fpgm table } catch ( IOException ex ) { // Fpgm is optional ( only required for OpenType ( MS ) fonts ) // log . error ( " TrueType warning : " + ex . getMessage ( ) ) ; } try { createPrep ( in ) ; // copy prep table } catch ( IOException ex ) { // Prep is optional ( only required for OpenType ( MS ) fonts ) // log . error ( " TrueType warning : " + ex . getMessage ( ) ) ; } try { createLoca ( glyphs . size ( ) ) ; // create empty loca table } catch ( IOException ex ) { // Loca is optional ( only required for OpenType ( MS ) fonts ) // log . error ( " TrueType warning : " + ex . getMessage ( ) ) ; } try { createGlyf ( in , glyphs ) ; } catch ( IOException ex ) { // Glyf is optional ( only required for OpenType ( MS ) fonts ) // log . error ( " TrueType warning : " + ex . getMessage ( ) ) ; } pad4 ( ) ; createCheckSumAdjustment ( ) ; byte [ ] ret = new byte [ realSize ] ; System . arraycopy ( output , 0 , ret , 0 , realSize ) ; return ret ;
public class DirectoryServiceClient { /** * Set the Directory Server list . * @ param servers * the Directory Server list . */ public void setDirectoryServers ( List < String > servers ) { } }
if ( servers == null || servers . size ( ) == 0 ) { return ; } directoryServers = new DirectoryServers ( servers ) ; connection . setDirectoryServers ( directoryServers . getNextDirectoryServer ( ) ) ;
public class EquivalentFragmentSets { /** * Modify the given collection of { @ link EquivalentFragmentSet } to introduce certain optimisations , such as the * { @ link AttributeIndexFragmentSet } . * This involves substituting various { @ link EquivalentFragmentSet } with other { @ link EquivalentFragmentSet } . */ public static void optimiseFragmentSets ( Collection < EquivalentFragmentSet > fragmentSets , TransactionOLTP tx ) { } }
// Repeatedly apply optimisations until they don ' t alter the query boolean changed = true ; while ( changed ) { changed = false ; for ( FragmentSetOptimisation optimisation : OPTIMISATIONS ) { changed |= optimisation . apply ( fragmentSets , tx ) ; } }
public class ResourceManager { /** * Retrieve resource for specified Classes package . * The basename is determined by name of classes package * postfixed with " . Resources " . * @ param clazz the Class * @ param locale the locale of the package resources requested . * @ return the Resources */ public static Resources getPackageResources ( Class clazz , Locale locale ) { } }
return getBaseResources ( getPackageResourcesBaseName ( clazz ) , locale , clazz . getClassLoader ( ) ) ;
public class CodeBook { /** * returns entry number and * modifies a * to the quantization value */ int errorv ( float [ ] a ) { } }
int best = best ( a , 1 ) ; for ( int k = 0 ; k < dim ; k ++ ) { a [ k ] = valuelist [ best * dim + k ] ; } return ( best ) ;
public class ExtensionUtils { /** * Delete and return the value of the passed special property . * @ param extension the extension from which to extract custom property * @ param propertySuffix the property suffix * @ param def the default value * @ return the value or { @ code def } if none was found * @ since 8.3M1 */ public static String importProperty ( MutableExtension extension , String propertySuffix , String def ) { } }
return StringUtils . defaultString ( importProperty ( extension , propertySuffix ) , def ) ;
public class DBCleanService { /** * Return { @ link JDBCWorkspaceDataContainer # SOURCE _ NAME } parameter from workspace configuration . */ private static String getSourceNameParameter ( WorkspaceEntry wsEntry ) throws DBCleanException { } }
try { return wsEntry . getContainer ( ) . getParameterValue ( JDBCWorkspaceDataContainer . SOURCE_NAME ) ; } catch ( RepositoryConfigurationException e ) { throw new DBCleanException ( e ) ; }
public class BigtableVeneerSettingsFactory { /** * To build default Retry settings for Point Read . */ private static void buildReadRowSettings ( Builder builder , BigtableOptions options ) { } }
RetrySettings retrySettings = buildIdempotentRetrySettings ( builder . readRowSettings ( ) . getRetrySettings ( ) , options ) ; builder . readRowSettings ( ) . setRetrySettings ( retrySettings ) . setRetryableCodes ( buildRetryCodes ( options . getRetryOptions ( ) ) ) ;
public class ChessboardCornerClusterToGrid { /** * Sorts edges so that they point towards nodes in an increasing counter clockwise direction */ void sortEdgesCCW ( FastQueue < Node > corners ) { } }
for ( int nodeIdx = 0 ; nodeIdx < corners . size ; nodeIdx ++ ) { Node na = corners . get ( nodeIdx ) ; // reference node to do angles relative to . double ref = Double . NaN ; int count = 0 ; for ( int i = 0 ; i < 4 ; i ++ ) { order [ i ] = i ; tmpEdges [ i ] = na . edges [ i ] ; if ( na . edges [ i ] == null ) { directions [ i ] = Double . MAX_VALUE ; } else { Node nb = na . edges [ i ] ; double angleB = Math . atan2 ( nb . y - na . y , nb . x - na . x ) ; if ( Double . isNaN ( ref ) ) { ref = angleB ; directions [ i ] = 0 ; } else { directions [ i ] = UtilAngle . distanceCCW ( ref , angleB ) ; } count ++ ; } } sorter . sort ( directions , 0 , 4 , order ) ; for ( int i = 0 ; i < 4 ; i ++ ) { na . edges [ i ] = tmpEdges [ order [ i ] ] ; } if ( count == 2 ) { // If there are only two then we define the order to be defined by the one which minimizes // CCW direction if ( directions [ order [ 1 ] ] > Math . PI ) { na . edges [ 0 ] = tmpEdges [ order [ 1 ] ] ; na . edges [ 1 ] = tmpEdges [ order [ 0 ] ] ; } else { na . edges [ 0 ] = tmpEdges [ order [ 0 ] ] ; na . edges [ 1 ] = tmpEdges [ order [ 1 ] ] ; } } else if ( count == 3 ) { // Edges need to point along the 4 possible directions , in the case of 3 edges , there might // need to be a gap at a different location than at the end int selected = - 1 ; double largestAngle = 0 ; for ( int i = 0 , j = 2 ; i < 3 ; j = i , i ++ ) { double ccw = UtilAngle . distanceCCW ( directions [ order [ j ] ] , directions [ order [ i ] ] ) ; if ( ccw > largestAngle ) { largestAngle = ccw ; selected = j ; } } for ( int i = 2 ; i > selected ; i -- ) { na . edges [ i + 1 ] = na . edges [ i ] ; } na . edges [ selected + 1 ] = null ; } }
public class Timex3 { /** * setter for timexMod - sets * @ generated * @ param v value to set into the feature */ public void setTimexMod ( String v ) { } }
if ( Timex3_Type . featOkTst && ( ( Timex3_Type ) jcasType ) . casFeat_timexMod == null ) jcasType . jcas . throwFeatMissing ( "timexMod" , "de.unihd.dbs.uima.types.heideltime.Timex3" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Timex3_Type ) jcasType ) . casFeatCode_timexMod , v ) ;
public class Xsd2CobolTypesModelBuilder { /** * Retrieve the properties of a decimal type . * @ param cobolAnnotations the current set of COBOL annotations * @ param clazz the target java numeric type * @ return the properties of a decimal type */ private < T extends Number > Map < String , Object > getCobolDecimalType ( CobolAnnotations cobolAnnotations , Class < T > clazz ) { } }
String cobolType = cobolAnnotations . getCobolType ( ) ; Map < String , Object > props = new LinkedHashMap < String , Object > ( ) ; switch ( CobolTypes . valueOf ( cobolType ) ) { case ZONED_DECIMAL_ITEM : props . put ( COBOL_TYPE_NAME_PROP_NAME , "CobolZonedDecimalType" ) ; props . put ( SIGN_LEADING_PROP_NAME , cobolAnnotations . signLeading ( ) ) ; props . put ( SIGN_SEPARATE_PROP_NAME , cobolAnnotations . signSeparate ( ) ) ; break ; case PACKED_DECIMAL_ITEM : props . put ( COBOL_TYPE_NAME_PROP_NAME , "CobolPackedDecimalType" ) ; break ; case BINARY_ITEM : props . put ( COBOL_TYPE_NAME_PROP_NAME , "CobolBinaryType" ) ; break ; case NATIVE_BINARY_ITEM : props . put ( COBOL_TYPE_NAME_PROP_NAME , "CobolBinaryType" ) ; // TODO create a CobolNativeBinaryType // props . put ( " minInclusive " , " " ) ; // props . put ( " maxInclusive " , " " ) ; break ; case SINGLE_FLOAT_ITEM : props . put ( COBOL_TYPE_NAME_PROP_NAME , "CobolFloatType" ) ; break ; case DOUBLE_FLOAT_ITEM : props . put ( COBOL_TYPE_NAME_PROP_NAME , "CobolDoubleType" ) ; break ; default : throw new Xsd2ConverterException ( "Unsupported COBOL numeric type " + cobolType ) ; } props . put ( SIGNED_PROP_NAME , cobolAnnotations . signed ( ) ) ; props . put ( TOTAL_DIGITS_PROP_NAME , cobolAnnotations . totalDigits ( ) ) ; props . put ( FRACTION_DIGITS_PROP_NAME , cobolAnnotations . fractionDigits ( ) ) ; props . put ( JAVA_TYPE_NAME_PROP_NAME , getShortTypeName ( clazz ) ) ; if ( cobolAnnotations . odoObject ( ) ) { props . put ( ODO_OBJECT_PROP_NAME , true ) ; odoObjects . put ( cobolAnnotations . getCobolName ( ) , props ) ; } return props ;
public class GeoJsonReaderDriver { /** * Parses the featureCollection to collect the field properties * @ param jp * @ throws IOException * @ throws SQLException */ private void parseFeaturesMetadata ( JsonParser jp ) throws IOException , SQLException { } }
jp . nextToken ( ) ; // FIELD _ NAME features // Passes all the properties until " Feature " object is found while ( ! jp . getText ( ) . equalsIgnoreCase ( GeoJsonField . FEATURES ) && ! jp . getText ( ) . equalsIgnoreCase ( GeoJsonField . CRS ) ) { jp . nextToken ( ) ; if ( jp . getCurrentToken ( ) . equals ( JsonToken . START_ARRAY ) || jp . getCurrentToken ( ) . equals ( JsonToken . START_OBJECT ) ) { jp . skipChildren ( ) ; } jp . nextToken ( ) ; } if ( jp . getText ( ) . equalsIgnoreCase ( GeoJsonField . CRS ) ) { parsedSRID = readCRS ( jp ) ; } if ( jp . getText ( ) . equalsIgnoreCase ( GeoJsonField . FEATURES ) ) { jp . nextToken ( ) ; // START _ ARRAY [ JsonToken token = jp . nextToken ( ) ; // START _ OBJECT { while ( token != JsonToken . END_ARRAY ) { jp . nextToken ( ) ; // FIELD _ NAME type jp . nextToken ( ) ; // VALUE _ STRING Feature String geomType = jp . getText ( ) ; if ( geomType . equalsIgnoreCase ( GeoJsonField . FEATURE ) ) { if ( progress . isCanceled ( ) ) { throw new SQLException ( "Canceled by user" ) ; } parseFeatureMetadata ( jp ) ; token = jp . nextToken ( ) ; // START _ OBJECT new feature featureCounter ++ ; if ( nodeCountProgress ++ % readFileSizeEachNode == 0 ) { // Update Progress try { progress . setStep ( ( int ) ( ( ( double ) fc . position ( ) / fileSize ) * 100 ) ) ; } catch ( IOException ex ) { // Ignore } } } else { throw new SQLException ( "Malformed GeoJSON file. Expected 'Feature', found '" + geomType + "'" ) ; } } // LOOP END _ ARRAY ] } else { throw new SQLException ( "Malformed GeoJSON file. Expected 'features', found '" + jp . getText ( ) + "'" ) ; }
public class Char { /** * Eats a UTF8 code from a String . There is also a built - in way in Java that converts * UTF8 to characters and back , but it does not work with all characters . */ public static char eatUtf8 ( String a , int [ ] n ) { } }
if ( a . length ( ) == 0 ) { n [ 0 ] = 0 ; return ( ( char ) 0 ) ; } n [ 0 ] = Utf8Length ( a . charAt ( 0 ) ) ; if ( a . length ( ) >= n [ 0 ] ) { switch ( n [ 0 ] ) { case 1 : return ( a . charAt ( 0 ) ) ; case 2 : if ( ( a . charAt ( 1 ) & 0xC0 ) != 0x80 ) break ; return ( ( char ) ( ( ( a . charAt ( 0 ) & 0x1F ) << 6 ) + ( a . charAt ( 1 ) & 0x3F ) ) ) ; case 3 : if ( ( a . charAt ( 1 ) & 0xC0 ) != 0x80 || ( a . charAt ( 2 ) & 0xC0 ) != 0x80 ) break ; return ( ( char ) ( ( ( a . charAt ( 0 ) & 0x0F ) << 12 ) + ( ( a . charAt ( 1 ) & 0x3F ) << 6 ) + ( ( a . charAt ( 2 ) & 0x3F ) ) ) ) ; case 4 : if ( ( a . charAt ( 1 ) & 0xC0 ) != 0x80 || ( a . charAt ( 2 ) & 0xC0 ) != 0x80 || ( a . charAt ( 3 ) & 0xC0 ) != 0x80 ) break ; return ( ( char ) ( ( ( a . charAt ( 0 ) & 0x07 ) << 18 ) + ( ( a . charAt ( 1 ) & 0x3F ) << 12 ) + ( ( a . charAt ( 2 ) & 0x3F ) << 6 ) + ( ( a . charAt ( 3 ) & 0x3F ) ) ) ) ; } } n [ 0 ] = - 1 ; return ( ( char ) 0 ) ;
public class CommerceRegionPersistenceImpl { /** * Returns the first commerce region in the ordered set where uuid = & # 63 ; . * @ param uuid the uuid * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching commerce region * @ throws NoSuchRegionException if a matching commerce region could not be found */ @ Override public CommerceRegion findByUuid_First ( String uuid , OrderByComparator < CommerceRegion > orderByComparator ) throws NoSuchRegionException { } }
CommerceRegion commerceRegion = fetchByUuid_First ( uuid , orderByComparator ) ; if ( commerceRegion != null ) { return commerceRegion ; } StringBundler msg = new StringBundler ( 4 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . append ( uuid ) ; msg . append ( "}" ) ; throw new NoSuchRegionException ( msg . toString ( ) ) ;
public class ControlContainerContext { /** * Called by BeanContextSupport superclass during construction and deserialization to * initialize subclass transient state */ public void initialize ( ) { } }
super . initialize ( ) ; // Register the ResourceContext provider on all new ControlContainerContext instances . addService ( org . apache . beehive . controls . api . context . ResourceContext . class , ResourceContextImpl . getProvider ( ) ) ;
public class NoteNameIndexRenderer { /** * { @ inheritDoc } */ @ Override public final String getIndexName ( ) { } }
final Note note = noteRenderer . getGedObject ( ) ; if ( ! note . isSet ( ) ) { return "" ; } final String nameHtml = noteRenderer . getTitleString ( ) ; return "<a href=\"note?db=" + note . getDbName ( ) + "&amp;id=" + note . getString ( ) + "\" class=\"name\" id=\"note-" + note . getString ( ) + "\">" + nameHtml + " (" + note . getString ( ) + ")</a>" ;
public class ParallelMultiInstanceBehavior { /** * Handles the parallel case of spawning the instances . Will create child executions accordingly for every instance needed . */ protected int createInstances ( DelegateExecution execution ) { } }
int nrOfInstances = resolveNrOfInstances ( execution ) ; if ( nrOfInstances < 0 ) { throw new ActivitiIllegalArgumentException ( "Invalid number of instances: must be non-negative integer value" + ", but was " + nrOfInstances ) ; } execution . setMultiInstanceRoot ( true ) ; setLoopVariable ( execution , NUMBER_OF_INSTANCES , nrOfInstances ) ; setLoopVariable ( execution , NUMBER_OF_COMPLETED_INSTANCES , 0 ) ; setLoopVariable ( execution , NUMBER_OF_ACTIVE_INSTANCES , nrOfInstances ) ; List < DelegateExecution > concurrentExecutions = new ArrayList < DelegateExecution > ( ) ; for ( int loopCounter = 0 ; loopCounter < nrOfInstances ; loopCounter ++ ) { DelegateExecution concurrentExecution = Context . getCommandContext ( ) . getExecutionEntityManager ( ) . createChildExecution ( ( ExecutionEntity ) execution ) ; concurrentExecution . setCurrentFlowElement ( activity ) ; concurrentExecution . setActive ( true ) ; concurrentExecution . setScope ( false ) ; concurrentExecutions . add ( concurrentExecution ) ; logLoopDetails ( concurrentExecution , "initialized" , loopCounter , 0 , nrOfInstances , nrOfInstances ) ; } // Before the activities are executed , all executions MUST be created up front // Do not try to merge this loop with the previous one , as it will lead // to bugs , due to possible child execution pruning . for ( int loopCounter = 0 ; loopCounter < nrOfInstances ; loopCounter ++ ) { DelegateExecution concurrentExecution = concurrentExecutions . get ( loopCounter ) ; // executions can be inactive , if instances are all automatics // ( no - waitstate ) and completionCondition has been met in the meantime if ( concurrentExecution . isActive ( ) && ! concurrentExecution . isEnded ( ) && concurrentExecution . getParent ( ) . isActive ( ) && ! concurrentExecution . getParent ( ) . isEnded ( ) ) { setLoopVariable ( concurrentExecution , getCollectionElementIndexVariable ( ) , loopCounter ) ; executeOriginalBehavior ( concurrentExecution , loopCounter ) ; } } // See ACT - 1586 : ExecutionQuery returns wrong results when using multi // instance on a receive task The parent execution must be set to false , so it wouldn ' t show up in // the execution query when using . activityId ( something ) . Do not we cannot nullify the // activityId ( that would have been a better solution ) , as it would break boundary event behavior . if ( ! concurrentExecutions . isEmpty ( ) ) { ExecutionEntity executionEntity = ( ExecutionEntity ) execution ; executionEntity . setActive ( false ) ; } return nrOfInstances ;
public class PHPObject { /** * < p > equalsTo . < / p > * @ param o a { @ link java . lang . Object } object . * @ return a boolean . */ protected boolean equalsTo ( Object o ) { } }
if ( o instanceof PHPObject ) { PHPObject phpObject = ( PHPObject ) o ; try { String expr = PHPInterpeter . getObject ( this . phpSudId ) + "->equals(" + PHPInterpeter . getObject ( phpObject . phpSudId ) + ")" ; Object z = container . getObjectParser ( ) . parse ( expr ) ; if ( z instanceof Boolean ) { Boolean res = ( Boolean ) z ; return res ; } } catch ( PHPException e ) { LOGGER . error ( "Error when calling equalsTo " + e . toString ( ) ) ; } } else { LOGGER . error ( "Equals call on bad object type : " + o . getClass ( ) . getCanonicalName ( ) ) ; } return false ;
public class SQLSelect { /** * Add a timestamp value to the select . * @ param _ isoDateTime String to be casted to a timestamp * @ return this */ public SQLSelect addTimestampValue ( final String _isoDateTime ) { } }
parts . add ( new Value ( Context . getDbType ( ) . getTimestampValue ( _isoDateTime ) ) ) ; return this ;
public class ThemeUiHelper { /** * Method to get the { @ link JsStatement } to insert the hover style on your * { @ link Component } * @ param component * Wicket component * @ return the JsStatement */ public static JsStatement hover ( Component component ) { } }
component . setOutputMarkupId ( true ) ; return new JsQuery ( component ) . $ ( ) . chain ( "hover" , "function() { $(this).addClass('ui-state-hover'); }" , "function() { $(this).removeClass('ui-state-hover'); }" ) ;
public class BordersBuilder { /** * Set all borders * @ param size the size of the borders as a length * @ param color the color fo the borders * @ param style the style of the borders * @ return this for fluent style */ public BordersBuilder all ( final Length size , final Color color , final BorderAttribute . Style style ) { } }
return this . all ( new BorderAttribute ( size , color , style ) ) ;
public class AmazonInspectorClient { /** * Starts the assessment run specified by the ARN of the assessment template . For this API to function properly , you * must not exceed the limit of running up to 500 concurrent agents per AWS account . * @ param startAssessmentRunRequest * @ return Result of the StartAssessmentRun operation returned by the service . * @ throws InternalException * Internal server error . * @ throws InvalidInputException * The request was rejected because an invalid or out - of - range value was supplied for an input parameter . * @ throws LimitExceededException * The request was rejected because it attempted to create resources beyond the current AWS account limits . * The error code describes the limit exceeded . * @ throws AccessDeniedException * You do not have required permissions to access the requested resource . * @ throws NoSuchEntityException * The request was rejected because it referenced an entity that does not exist . The error code describes * the entity . * @ throws InvalidCrossAccountRoleException * Amazon Inspector cannot assume the cross - account role that it needs to list your EC2 instances during the * assessment run . * @ throws AgentsAlreadyRunningAssessmentException * You started an assessment run , but one of the instances is already participating in another assessment * run . * @ throws ServiceTemporarilyUnavailableException * The serice is temporary unavailable . * @ sample AmazonInspector . StartAssessmentRun * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / inspector - 2016-02-16 / StartAssessmentRun " target = " _ top " > AWS * API Documentation < / a > */ @ Override public StartAssessmentRunResult startAssessmentRun ( StartAssessmentRunRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeStartAssessmentRun ( request ) ;
public class DiscountCurveInterpolation { /** * Returns the zero rate for a given maturity , i . e . , - ln ( df ( T ) ) / T where T is the given maturity and df ( T ) is * the discount factor at time $ T $ . * @ param maturity The given maturity . * @ return The zero rate . */ public RandomVariable getZeroRate ( double maturity ) { } }
if ( maturity == 0 ) { return this . getZeroRate ( 1.0E-14 ) ; } return getDiscountFactor ( maturity ) . log ( ) . div ( - maturity ) ;
public class BlankString2NullFieldConversion { /** * @ see FieldConversion # javaToSql ( Object ) */ public Object javaToSql ( Object source ) { } }
if ( source instanceof String ) { if ( ( ( String ) source ) . trim ( ) . length ( ) == 0 ) return null ; } return source ;
public class MPXWriter { /** * This method is called to format a percentage value . * @ param value numeric value * @ return percentage value */ private String formatPercentage ( Number value ) { } }
return ( value == null ? null : m_formats . getPercentageDecimalFormat ( ) . format ( value ) + "%" ) ;