signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class AmazonApiGatewayClient { /** * Gets a specified VPC link under the caller ' s account in a region .
* @ param getVpcLinkRequest
* Gets a specified VPC link under the caller ' s account in a region .
* @ return Result of the GetVpcLink operation returned by the service .
* @ throws UnauthorizedException
* The request is denied because the caller has insufficient permissions .
* @ throws NotFoundException
* The requested resource is not found . Make sure that the request URI is correct .
* @ throws TooManyRequestsException
* The request has reached its throttling limit . Retry after the specified time period .
* @ sample AmazonApiGateway . GetVpcLink */
@ Override public GetVpcLinkResult getVpcLink ( GetVpcLinkRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeGetVpcLink ( request ) ; |
public class JsJmsMessageImpl { /** * Perform any specific send - time processing and then call the superclass method
* and return the result .
* The specific send - time processing for a JsJmsMessage is to write back
* the JMS _ IBM _ MQMD _ MsgId property , if set , into the ApiMessageId .
* This method must be called by the Message processor during ' send '
* processing , AFTER the headers are set .
* Javadoc description supplied by JsMessage interface . */
@ Override public JsMessage getSent ( boolean copy ) throws MessageCopyFailedException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getSent" , copy ) ; // We don ' t want to fluff up an MQMD PropertyMap unnecessarily , so we try to
// figure out first whether there have been any MQMD properties set . . . .
if ( hasMQMDPropertiesSet ( ) ) { // If there may be some explicitly set JMS _ IBM _ MQMD _ properties , get it from
// the map . Do NOT just call getMQMDProperty ( ) as that would also look in any
// underlying MQMD .
byte [ ] apiMsgId = ( byte [ ] ) getMQMDSetPropertiesMap ( ) . get ( SIProperties . JMS_IBM_MQMD_MsgId ) ; if ( apiMsgId != null ) { setApiMessageIdAsBytes ( apiMsgId ) ; } } // Finally call the superclass ' s method & return the result .
JsMessage newMsg = super . getSent ( copy ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getSent" , newMsg ) ; return newMsg ; |
public class A_CmsGroupUsersList { /** * Makes a list item from a user . < p >
* @ param user a user
* @ return a list item */
protected CmsListItem makeListItem ( CmsUser user ) { } } | CmsListItem item = getList ( ) . newItem ( user . getId ( ) . toString ( ) ) ; setUserData ( user , item ) ; return item ; |
public class CmsJspStandardContextBean { /** * Returns an EL access wrapper map for the given object . < p >
* If the object is a { @ link CmsResource } , then a { @ link CmsJspResourceWrapper } is returned .
* Otherwise the object is wrapped in a { @ link CmsJspObjectValueWrapper } . < p >
* If the object is already is a wrapper , it is returned unchanged . < p >
* @ return an EL access wrapper map for the given object */
public Map < Object , Object > getWrap ( ) { } } | return CmsCollectionsGenericWrapper . createLazyMap ( obj -> { if ( ( obj instanceof A_CmsJspValueWrapper ) || ( obj instanceof CmsJspResourceWrapper ) ) { return obj ; } else if ( obj instanceof CmsResource ) { return CmsJspResourceWrapper . wrap ( m_cms , ( CmsResource ) obj ) ; } else { return CmsJspObjectValueWrapper . createWrapper ( m_cms , obj ) ; } } ) ; |
public class ChronoLocalDateTimeImpl { @ Override public ChronoZonedDateTime < D > atZone ( ZoneId zoneId ) { } } | return ChronoZonedDateTimeImpl . ofBest ( this , zoneId , null ) ; |
public class SDEFWriter { /** * Write calendar exceptions .
* @ param records list of ProjectCalendars
* @ throws IOException */
private void writeExceptions ( List < ProjectCalendar > records ) throws IOException { } } | for ( ProjectCalendar record : records ) { if ( ! record . getCalendarExceptions ( ) . isEmpty ( ) ) { // Need to move HOLI up here and get 15 exceptions per line as per USACE spec .
// for now , we ' ll write one line for each calendar exception , hope there aren ' t too many
// changing this would be a serious upgrade , too much coding to do today . . . .
for ( ProjectCalendarException ex : record . getCalendarExceptions ( ) ) { writeCalendarException ( record , ex ) ; } } m_eventManager . fireCalendarWrittenEvent ( record ) ; // left here from MPX template , maybe not needed ? ? ?
} |
public class AbstractStreamEx { /** * Produces a list containing cumulative results of applying the
* accumulation function going left to right using given seed value .
* This is a terminal operation .
* The resulting { @ link List } is guaranteed to be mutable .
* For parallel stream it ' s not guaranteed that accumulator will always be
* executed in the same thread .
* This method cannot take all the advantages of parallel streams as it must
* process elements strictly left to right .
* @ param < U > The type of the result
* @ param seed the starting value
* @ param accumulator a < a
* href = " package - summary . html # NonInterference " > non - interfering < / a > ,
* < a href = " package - summary . html # Statelessness " > stateless < / a >
* function for incorporating an additional element into a result
* @ return the { @ code List } where the first element is the seed and every
* successor element is the result of applying accumulator function
* to the previous list element and the corresponding stream
* element . The resulting list is one element longer than this
* stream .
* @ see # foldLeft ( Object , BiFunction )
* @ see # scanRight ( Object , BiFunction )
* @ since 0.2.1 */
public < U > List < U > scanLeft ( U seed , BiFunction < U , ? super T , U > accumulator ) { } } | List < U > result = new ArrayList < > ( ) ; result . add ( seed ) ; forEachOrdered ( t -> result . add ( accumulator . apply ( result . get ( result . size ( ) - 1 ) , t ) ) ) ; return result ; |
public class JdbcRegistry { /** * Simply pull the client from storage .
* @ param apiKey
* @ throws SQLException */
protected Client getClientInternal ( String apiKey ) throws SQLException { } } | QueryRunner run = new QueryRunner ( ds ) ; return run . query ( "SELECT bean FROM gw_clients WHERE api_key = ?" , // $ NON - NLS - 1 $
Handlers . CLIENT_HANDLER , apiKey ) ; |
public class CPOptionValueUtil { /** * Returns the cp option values before and after the current cp option value in the ordered set where CPOptionId = & # 63 ; .
* @ param CPOptionValueId the primary key of the current cp option value
* @ param CPOptionId the cp option ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the previous , current , and next cp option value
* @ throws NoSuchCPOptionValueException if a cp option value with the primary key could not be found */
public static CPOptionValue [ ] findByCPOptionId_PrevAndNext ( long CPOptionValueId , long CPOptionId , OrderByComparator < CPOptionValue > orderByComparator ) throws com . liferay . commerce . product . exception . NoSuchCPOptionValueException { } } | return getPersistence ( ) . findByCPOptionId_PrevAndNext ( CPOptionValueId , CPOptionId , orderByComparator ) ; |
public class Dom { /** * Steps may be empty strings */
public static List < Element > getChildElements ( Element root , String ... steps ) { } } | List < Element > lst ; lst = new ArrayList < > ( ) ; doGetChildElements ( root , steps , 0 , lst ) ; return lst ; |
public class TCPClientConnection { /** * private static final Map < String , Long > timerMap = new ConcurrentHashMap < String , Long > ( ) ; */
protected boolean processBufferedMessages ( Event event ) throws AvpDataException { } } | if ( listeners . size ( ) == 0 ) { // PCB added logging
logger . debug ( "listeners.size() == 0 on connection [{}]" , this . getKey ( ) ) ; try { buffer . add ( event ) ; } catch ( IllegalStateException e ) { logger . debug ( "Got IllegalStateException in processBufferedMessages" ) ; // FIXME : requires JDK6 : buffer . removeLast ( ) ;
Event [ ] tempBuffer = buffer . toArray ( new Event [ buffer . size ( ) ] ) ; buffer . remove ( tempBuffer [ tempBuffer . length - 1 ] ) ; buffer . add ( event ) ; } // PCB added logging
logger . debug ( "processBufferedMessages is returning false" ) ; return false ; } else { logger . debug ( "processBufferedMessages is returning true on connection [{}] as there are listeners" , getKey ( ) ) ; return true ; } |
public class InputStreamUtil { /** * Count number of lines in a file
* @ param filename
* @ return
* @ throws IOException */
public static int countLines ( String filename ) throws IOException { } } | FileInputStream fis = new FileInputStream ( filename ) ; try { return countLines ( new BufferedInputStream ( fis ) ) ; } finally { fis . close ( ) ; } |
public class SessionChangesLog { /** * Creates new changes log with rootPath and its descendants of this one and removes those
* entries .
* @ param rootPath
* @ return ItemDataChangesLog */
public PlainChangesLog pushLog ( QPath rootPath ) { } } | // session instance is always present in SessionChangesLog
PlainChangesLog cLog = new PlainChangesLogImpl ( getDescendantsChanges ( rootPath ) , session ) ; if ( rootPath . equals ( Constants . ROOT_PATH ) ) { clear ( ) ; } else { remove ( rootPath ) ; } return cLog ; |
public class ObjectAnimatorCompat { /** * Constructs and returns an ObjectAnimator that animates between color values . A single
* value implies that that value is the one being animated to . Two values imply starting
* and ending values . More than two values imply a starting value , values to animate through
* along the way , and an ending value ( these values will be distributed evenly across
* the duration of the animation ) .
* @ param target The object whose property is to be animated . This object should have a public
* method on it called { @ code setName ( ) } , where { @ code name } is the value of the
* { @ code propertyName } parameter .
* @ param propertyName The name of the property being animated .
* @ param values A set of values that the animation will animate between over time .
* @ return An ObjectAnimator object that is set up to animate between the given values . */
@ NonNull public static ObjectAnimator ofArgb ( @ Nullable Object target , @ NonNull String propertyName , int ... values ) { } } | if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . LOLLIPOP ) { return ObjectAnimatorCompatLollipop . ofArgb ( target , propertyName , values ) ; } else { return ObjectAnimatorCompatBase . ofArgb ( target , propertyName , values ) ; } |
public class DescribeVpcsRequest { /** * One or more VPC IDs .
* Default : Describes all your VPCs .
* @ return One or more VPC IDs . < / p >
* Default : Describes all your VPCs . */
public java . util . List < String > getVpcIds ( ) { } } | if ( vpcIds == null ) { vpcIds = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return vpcIds ; |
public class AbstractQueryPersonAttributeDao { /** * / * ( non - Javadoc )
* @ see org . jasig . services . persondir . IPersonAttributeDao # getPeopleWithMultivaluedAttributes ( java . util . Map ) */
@ Override public final Set < IPersonAttributes > getPeopleWithMultivaluedAttributes ( final Map < String , List < Object > > query , final IPersonAttributeDaoFilter filter ) { } } | Validate . notNull ( query , "query may not be null." ) ; // Generate the query to pass to the subclass
final QB queryBuilder = this . generateQuery ( query ) ; if ( queryBuilder == null && ( this . queryAttributeMapping != null || this . useAllQueryAttributes == true ) ) { this . logger . debug ( "No queryBuilder was generated for query " + query + ", null will be returned" ) ; return null ; } // Get the username from the query , if specified
final IUsernameAttributeProvider usernameAttributeProvider = this . getUsernameAttributeProvider ( ) ; final String username = usernameAttributeProvider . getUsernameFromQuery ( query ) ; // Execute the query in the subclass
final List < IPersonAttributes > unmappedPeople = this . getPeopleForQuery ( queryBuilder , username ) ; if ( unmappedPeople == null ) { return null ; } // Map the attributes of the found people according to resultAttributeMapping if it is set
final Set < IPersonAttributes > mappedPeople = new LinkedHashSet < > ( ) ; for ( final IPersonAttributes unmappedPerson : unmappedPeople ) { final IPersonAttributes mappedPerson = this . mapPersonAttributes ( unmappedPerson ) ; mappedPeople . add ( mappedPerson ) ; } return Collections . unmodifiableSet ( mappedPeople ) ; |
public class Main { /** * Helper to only set a property if not already set . */
private void maybeSetProperty ( final String name , final String value ) { } } | if ( System . getProperty ( name ) == null ) { System . setProperty ( name , value ) ; } |
public class sslcertkey_sslvserver_binding { /** * Use this API to fetch sslcertkey _ sslvserver _ binding resources of given name . */
public static sslcertkey_sslvserver_binding [ ] get ( nitro_service service , String certkey ) throws Exception { } } | sslcertkey_sslvserver_binding obj = new sslcertkey_sslvserver_binding ( ) ; obj . set_certkey ( certkey ) ; sslcertkey_sslvserver_binding response [ ] = ( sslcertkey_sslvserver_binding [ ] ) obj . get_resources ( service ) ; return response ; |
public class AbstractRadial { /** * Sets the type of the gauge
* TYPE1 a quarter gauge ( 90 deg )
* TYPE2 a two quarter gauge ( 180 deg )
* TYPE3 a three quarter gauge ( 270 deg )
* TYPE4 a four quarter gauge ( 300 deg )
* CUSTOM set the { @ link # setCustomGaugeType ( CustomGaugeType ) custom gauge type } .
* @ param GAUGE _ TYPE */
public void setGaugeType ( final GaugeType GAUGE_TYPE ) { } } | getModel ( ) . setGaugeType ( GAUGE_TYPE ) ; init ( getInnerBounds ( ) . width , getInnerBounds ( ) . height ) ; repaint ( getInnerBounds ( ) ) ; |
public class AbsoluteTimeframe { /** * Construct the Timeframe map to send in the query .
* @ return the Timeframe Json map to send in the query . */
@ Override public Map < String , Object > constructTimeframeArgs ( ) { } } | Map < String , Object > timeframe = null ; if ( start != null && end != null ) { Map < String , Object > absoluteTimeframe = new HashMap < String , Object > ( 3 ) ; absoluteTimeframe . put ( KeenQueryConstants . START , start ) ; absoluteTimeframe . put ( KeenQueryConstants . END , end ) ; timeframe = new HashMap < String , Object > ( 2 ) ; timeframe . put ( KeenQueryConstants . TIMEFRAME , absoluteTimeframe ) ; return timeframe ; } return timeframe ; |
public class JobTargetGroupsInner { /** * Gets all target groups in an agent .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal .
* @ param serverName The name of the server .
* @ param jobAgentName The name of the job agent .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < List < JobTargetGroupInner > > listByAgentAsync ( final String resourceGroupName , final String serverName , final String jobAgentName , final ListOperationCallback < JobTargetGroupInner > serviceCallback ) { } } | return AzureServiceFuture . fromPageResponse ( listByAgentSinglePageAsync ( resourceGroupName , serverName , jobAgentName ) , new Func1 < String , Observable < ServiceResponse < Page < JobTargetGroupInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < JobTargetGroupInner > > > call ( String nextPageLink ) { return listByAgentNextSinglePageAsync ( nextPageLink ) ; } } , serviceCallback ) ; |
public class OmsDrainDir { /** * Calculates the max slope data as an array : [ maxslope , maxdir , elevation , e1 , e2 , sumdev , dirdren1 , dirdren2 , sigma ] */
private double [ ] calculateMaximumSlope ( BitMatrix analizedMatrix , RandomIter pitRandomIter , WritableRandomIter tcaRandomIter , int col , int row ) { } } | double [ ] maxSlopeData = new double [ 10 ] ; int n = 1 , m = 1 ; double dirmax = 0f , e1min = - 9999f , e2min = - 9999f ; analizedMatrix . mark ( col , row ) ; tcaRandomIter . setSample ( col , row , 0 , 1 ) ; double pendmax = 0f ; maxSlopeData [ 3 ] = pitRandomIter . getSampleDouble ( col , row , 0 ) ; /* * per ogni triangolo calcolo la pendenza massima e la direzione di
* deflusso reale . */
for ( int j = 0 ; j <= 7 ; j ++ ) { n = tri [ j ] [ 0 ] ; m = tri [ j ] [ 1 ] ; maxSlopeData [ 4 ] = pitRandomIter . getSampleDouble ( col + order [ n ] [ 1 ] , row + order [ n ] [ 0 ] , 0 ) ; maxSlopeData [ 5 ] = pitRandomIter . getSampleDouble ( col + order [ m ] [ 1 ] , row + order [ m ] [ 0 ] , 0 ) ; /* * verifico che i punti attorno al pixel considerato non siano
* novalue . In questo caso trascuro il triangolo . */
if ( ! isNovalue ( maxSlopeData [ 4 ] ) && ! isNovalue ( maxSlopeData [ 5 ] ) ) { calculateMaxSlopeAndDirection4Triangles ( maxSlopeData ) ; if ( maxSlopeData [ 1 ] > pendmax ) { dirmax = maxSlopeData [ 2 ] ; pendmax = maxSlopeData [ 1 ] ; /* - direzione cardinale */
maxSlopeData [ 7 ] = tri [ j ] [ 0 ] ; /* - direzione diagonale */
maxSlopeData [ 8 ] = tri [ j ] [ 1 ] ; /* - segno del triangolo */
maxSlopeData [ 9 ] = tri [ j ] [ 2 ] ; /* * - quote del triangolo avente pendenza
* maggiore */
e1min = maxSlopeData [ 4 ] ; /* * non necessariamente sono le quote
* minime . */
e2min = maxSlopeData [ 5 ] ; } } } maxSlopeData [ 1 ] = pendmax ; maxSlopeData [ 2 ] = dirmax ; maxSlopeData [ 4 ] = e1min ; maxSlopeData [ 5 ] = e2min ; return maxSlopeData ; |
public class ApiOvhVrack { /** * Move your dedicatedCloud datacenter from a Vrack to another
* REST : POST / vrack / { serviceName } / dedicatedCloudDatacenter / { datacenter } / move
* @ param targetServiceName [ required ] The internal name of your target vrack
* @ param serviceName [ required ] The internal name of your vrack
* @ param datacenter [ required ] Your dedicatedCloud datacenter name */
public OvhTask serviceName_dedicatedCloudDatacenter_datacenter_move_POST ( String serviceName , String datacenter , String targetServiceName ) throws IOException { } } | String qPath = "/vrack/{serviceName}/dedicatedCloudDatacenter/{datacenter}/move" ; StringBuilder sb = path ( qPath , serviceName , datacenter ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "targetServiceName" , targetServiceName ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTask . class ) ; |
public class DSLMapParser { /** * src / main / resources / org / drools / compiler / lang / dsl / DSLMap . g : 106:1 : mapping _ file : ( statement ) * - > ^ ( VT _ DSL _ GRAMMAR ( statement ) * ) ; */
public final DSLMapParser . mapping_file_return mapping_file ( ) throws RecognitionException { } } | DSLMapParser . mapping_file_return retval = new DSLMapParser . mapping_file_return ( ) ; retval . start = input . LT ( 1 ) ; Object root_0 = null ; ParserRuleReturnScope statement1 = null ; RewriteRuleSubtreeStream stream_statement = new RewriteRuleSubtreeStream ( adaptor , "rule statement" ) ; try { // src / main / resources / org / drools / compiler / lang / dsl / DSLMap . g : 107:5 : ( ( statement ) * - > ^ ( VT _ DSL _ GRAMMAR ( statement ) * ) )
// src / main / resources / org / drools / compiler / lang / dsl / DSLMap . g : 107:7 : ( statement ) *
{ // src / main / resources / org / drools / compiler / lang / dsl / DSLMap . g : 107:7 : ( statement ) *
loop1 : while ( true ) { int alt1 = 2 ; int LA1_0 = input . LA ( 1 ) ; if ( ( LA1_0 == EOL || LA1_0 == LEFT_SQUARE ) ) { alt1 = 1 ; } switch ( alt1 ) { case 1 : // src / main / resources / org / drools / compiler / lang / dsl / DSLMap . g : 107:7 : statement
{ pushFollow ( FOLLOW_statement_in_mapping_file275 ) ; statement1 = statement ( ) ; state . _fsp -- ; if ( state . failed ) return retval ; if ( state . backtracking == 0 ) stream_statement . add ( statement1 . getTree ( ) ) ; } break ; default : break loop1 ; } } // AST REWRITE
// elements : statement
// token labels :
// rule labels : retval
// token list labels :
// rule list labels :
// wildcard labels :
if ( state . backtracking == 0 ) { retval . tree = root_0 ; RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream ( adaptor , "rule retval" , retval != null ? retval . getTree ( ) : null ) ; root_0 = ( Object ) adaptor . nil ( ) ; // 108:5 : - > ^ ( VT _ DSL _ GRAMMAR ( statement ) * )
{ // src / main / resources / org / drools / compiler / lang / dsl / DSLMap . g : 108:8 : ^ ( VT _ DSL _ GRAMMAR ( statement ) * )
{ Object root_1 = ( Object ) adaptor . nil ( ) ; root_1 = ( Object ) adaptor . becomeRoot ( ( Object ) adaptor . create ( VT_DSL_GRAMMAR , "VT_DSL_GRAMMAR" ) , root_1 ) ; // src / main / resources / org / drools / compiler / lang / dsl / DSLMap . g : 108:25 : ( statement ) *
while ( stream_statement . hasNext ( ) ) { adaptor . addChild ( root_1 , stream_statement . nextTree ( ) ) ; } stream_statement . reset ( ) ; adaptor . addChild ( root_0 , root_1 ) ; } } retval . tree = root_0 ; } } retval . stop = input . LT ( - 1 ) ; if ( state . backtracking == 0 ) { retval . tree = ( Object ) adaptor . rulePostProcessing ( root_0 ) ; adaptor . setTokenBoundaries ( retval . tree , retval . start , retval . stop ) ; } } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; retval . tree = ( Object ) adaptor . errorNode ( input , retval . start , input . LT ( - 1 ) , re ) ; } finally { // do for sure before leaving
} return retval ; |
public class ChorusAssert { /** * Asserts that two chars are equal . If they are not
* an AssertionFailedError is thrown with the given message . */
static public void assertEquals ( String message , char expected , char actual ) { } } | assertEquals ( message , new Character ( expected ) , new Character ( actual ) ) ; |
public class MappingUtils { /** * Converts java . sql . ResultSet into List of QueryParameters .
* Used for caching purposes to allow ResultSet to be closed and disposed .
* @ param rs ResultSet values from which would be read
* @ return List of QueryParameters ( one for each row )
* @ throws SQLException propagates SQLException sent from ResultSet */
public static List < QueryParameters > convertResultSet ( ResultSet rs ) throws SQLException { } } | List < QueryParameters > result = new ArrayList < QueryParameters > ( ) ; String columnName = null ; while ( rs . next ( ) == true ) { QueryParameters params = new QueryParameters ( ) ; ResultSetMetaData rsmd = rs . getMetaData ( ) ; int cols = rsmd . getColumnCount ( ) ; for ( int i = 1 ; i <= cols ; i ++ ) { columnName = rsmd . getColumnLabel ( i ) ; if ( null == columnName || 0 == columnName . length ( ) ) { columnName = rsmd . getColumnName ( i ) ; } params . set ( columnName , rs . getObject ( i ) ) ; params . updatePosition ( columnName , i - 1 ) ; } result . add ( params ) ; } return result ; |
public class IntegerScalarHandler { /** * Returns one < code > ResultSet < / code > column as an object via the < code > ResultSet . getObject ( )
* < / code > method that performs type conversions .
* @ param rs < code > ResultSet < / code > to process .
* @ return The column or < code > null < / code > if there are no rows in the < code > ResultSet < / code > .
* @ throws SQLException if a database access error occurs
* @ throws ClassCastException if the class datatype does not match the column type
* @ see org . apache . commons . dbutils . ResultSetHandler # handle ( java . sql . ResultSet ) */
@ Override public Integer handle ( ResultSet rs ) throws SQLException { } } | if ( rs . next ( ) ) { if ( this . columnName == null ) { return ( ( Number ) rs . getObject ( this . columnIndex ) ) . intValue ( ) ; } return ( ( Number ) rs . getObject ( this . columnIndex ) ) . intValue ( ) ; } return null ; |
public class IbvQP { /** * - - - - - oo - verbs */
public SVCPostSend postSend ( List < IbvSendWR > wrList , List < IbvSendWR > badwrList ) throws IOException { } } | return verbs . postSend ( this , wrList , badwrList ) ; |
public class PrimitiveByteArray2dJsonDeserializer { /** * { @ inheritDoc } */
@ Override public byte [ ] [ ] doDeserialize ( JsonReader reader , JsonDeserializationContext ctx , JsonDeserializerParameters params ) { } } | byte [ ] [ ] result ; reader . beginArray ( ) ; JsonToken token = reader . peek ( ) ; if ( JsonToken . END_ARRAY == token ) { // empty array
result = new byte [ 0 ] [ 0 ] ; } else if ( JsonToken . STRING == token ) { // byte [ ] are encoded as String
List < byte [ ] > list = new ArrayList < byte [ ] > ( ) ; int size = 0 ; while ( JsonToken . END_ARRAY != token ) { byte [ ] decoded = Base64Utils . fromBase64 ( reader . nextString ( ) ) ; size = Math . max ( size , decoded . length ) ; list . add ( decoded ) ; token = reader . peek ( ) ; } result = new byte [ list . size ( ) ] [ size ] ; int i = 0 ; for ( byte [ ] value : list ) { if ( null != value ) { result [ i ] = value ; } i ++ ; } } else { List < List < Byte > > list = doDeserializeIntoList ( reader , ctx , ByteJsonDeserializer . getInstance ( ) , params , token ) ; List < Byte > firstList = list . get ( 0 ) ; if ( firstList . isEmpty ( ) ) { result = new byte [ list . size ( ) ] [ 0 ] ; } else { result = new byte [ list . size ( ) ] [ firstList . size ( ) ] ; int i = 0 ; int j ; for ( List < Byte > innerList : list ) { j = 0 ; for ( Byte value : innerList ) { if ( null != value ) { result [ i ] [ j ] = value ; } j ++ ; } i ++ ; } } } reader . endArray ( ) ; return result ; |
public class FiniteSetObligation { /** * p ( a , b ) = > exists idx in set dom m & m ( idx ) = f ( a ) */
private PExp getImpliesExpression ( ASetCompSetExp exp , ILexNameToken finmap , ILexNameToken findex ) { } } | if ( exp . getPredicate ( ) == null ) // set comprehension has no predicate
{ return getImpliesExists ( exp , finmap , findex ) ; } else { return AstExpressionFactory . newAImpliesBooleanBinaryExp ( exp . getPredicate ( ) . clone ( ) , getImpliesExists ( exp . clone ( ) , finmap , findex ) ) ; } |
public class AbstractErrorEventDefinitionBuilder { /** * Finishes the building of a error event definition .
* @ param < T >
* @ return the parent event builder */
@ SuppressWarnings ( { } } | "rawtypes" , "unchecked" } ) public < T extends AbstractFlowNodeBuilder > T errorEventDefinitionDone ( ) { return ( T ) ( ( Event ) element . getParentElement ( ) ) . builder ( ) ; |
public class XString { /** * Tests if this string starts with the specified prefix beginning
* a specified index .
* @ param prefix the prefix .
* @ param toffset where to begin looking in the string .
* @ return < code > true < / code > if the character sequence represented by the
* argument is a prefix of the substring of this object starting
* at index < code > toffset < / code > ; < code > false < / code > otherwise .
* The result is < code > false < / code > if < code > toffset < / code > is
* negative or greater than the length of this
* < code > String < / code > object ; otherwise the result is the same
* as the result of the expression
* < pre >
* this . subString ( toffset ) . startsWith ( prefix )
* < / pre >
* @ exception java . lang . NullPointerException if < code > prefix < / code > is
* < code > null < / code > . */
public boolean startsWith ( XMLString prefix , int toffset ) { } } | int to = toffset ; int tlim = this . length ( ) ; int po = 0 ; int pc = prefix . length ( ) ; // Note : toffset might be near - 1 > > > 1.
if ( ( toffset < 0 ) || ( toffset > tlim - pc ) ) { return false ; } while ( -- pc >= 0 ) { if ( this . charAt ( to ) != prefix . charAt ( po ) ) { return false ; } to ++ ; po ++ ; } return true ; |
public class ZoomableCanvas { /** * Notifies listeners on drawing start . */
protected void fireDrawingStart ( ) { } } | final ListenerCollection < EventListener > list = this . listeners ; if ( list != null ) { for ( final DrawingListener listener : list . getListeners ( DrawingListener . class ) ) { listener . onDrawingStart ( ) ; } } |
public class InfraAlertConditionService { /** * Returns the set of alert conditions for the given query parameters .
* @ param queryParams The query parameters
* @ return The set of alert conditions */
public Collection < InfraAlertCondition > list ( List < String > queryParams ) { } } | return HTTP . GET ( "/v2/alerts/conditions" , null , queryParams , INFRA_ALERT_CONDITIONS ) . get ( ) ; |
public class SynchronisationService { /** * Checks if the expectations are met and throws an assert if not
* @ param condition The conditions the element should meet */
public void checkAndAssertForExpectedCondition ( ExpectedCondition < ? > condition ) { } } | if ( ! waitForExpectedCondition ( condition , 0 ) ) { fail ( String . format ( "Element does not meet condition %1$s" , condition . toString ( ) ) ) ; } |
public class PGPUtils { /** * Performs encryption on a single file using a PGP public key .
* @ param path file to be encrypted
* @ param publicKeyStream stream providing the encoded public key
* @ param targetStream stream to receive the encrypted data
* @ throws IOException if there is an error reading or writing from the streams
* @ throws PGPException if the encryption process fails */
public static void encrypt ( Path path , InputStream publicKeyStream , OutputStream targetStream ) throws Exception { } } | PGPPublicKey publicKey = getPublicKey ( publicKeyStream ) ; try ( ByteArrayOutputStream compressed = new ByteArrayOutputStream ( ) ; ArmoredOutputStream armOut = new ArmoredOutputStream ( targetStream ) ) { PGPCompressedDataGenerator compressedGenerator = new PGPCompressedDataGenerator ( PGPCompressedData . ZIP ) ; PGPUtil . writeFileToLiteralData ( compressedGenerator . open ( compressed ) , PGPLiteralData . BINARY , path . toFile ( ) ) ; compressedGenerator . close ( ) ; JcePGPDataEncryptorBuilder encryptorBuilder = new JcePGPDataEncryptorBuilder ( PGPEncryptedData . CAST5 ) . setWithIntegrityPacket ( true ) . setSecureRandom ( new SecureRandom ( ) ) . setProvider ( PROVIDER ) ; PGPEncryptedDataGenerator dataGenerator = new PGPEncryptedDataGenerator ( encryptorBuilder ) ; JcePublicKeyKeyEncryptionMethodGenerator methodGenerator = new JcePublicKeyKeyEncryptionMethodGenerator ( publicKey ) . setProvider ( PROVIDER ) . setSecureRandom ( new SecureRandom ( ) ) ; dataGenerator . addMethod ( methodGenerator ) ; byte [ ] compressedData = compressed . toByteArray ( ) ; OutputStream encryptedOut = dataGenerator . open ( armOut , compressedData . length ) ; encryptedOut . write ( compressedData ) ; encryptedOut . close ( ) ; } |
public class CompoundComparator { /** * Replace the Comparator at the given index using the given sort order .
* @ param index the index of the Comparator to replace
* @ param comparator the Comparator to place at the given index
* @ param ascending the sort order : ascending ( true ) or descending ( false ) */
public void setComparator ( int index , Comparator < T > comparator , boolean ascending ) { } } | this . comparators . set ( index , new InvertibleComparator < > ( comparator , ascending ) ) ; |
public class Keys { /** * Returns a new { @ link SecretKey } with a key length suitable for use with the specified { @ link SignatureAlgorithm } .
* < p > < a href = " https : / / tools . ietf . org / html / rfc7518 # section - 3.2 " > JWA Specification ( RFC 7518 ) , Section 3.2 < / a >
* requires minimum key lengths to be used for each respective Signature Algorithm . This method returns a
* secure - random generated SecretKey that adheres to the required minimum key length . The lengths are : < / p >
* < table >
* < tr >
* < th > Algorithm < / th >
* < th > Key Length < / th >
* < / tr >
* < tr >
* < td > HS256 < / td >
* < td > 256 bits ( 32 bytes ) < / td >
* < / tr >
* < tr >
* < td > HS384 < / td >
* < td > 384 bits ( 48 bytes ) < / td >
* < / tr >
* < tr >
* < td > HS512 < / td >
* < td > 512 bits ( 64 bytes ) < / td >
* < / tr >
* < / table >
* @ param alg the { @ code SignatureAlgorithm } to inspect to determine which key length to use .
* @ return a new { @ link SecretKey } instance suitable for use with the specified { @ link SignatureAlgorithm } .
* @ throws IllegalArgumentException for any input value other than { @ link SignatureAlgorithm # HS256 } ,
* { @ link SignatureAlgorithm # HS384 } , or { @ link SignatureAlgorithm # HS512} */
public static SecretKey secretKeyFor ( SignatureAlgorithm alg ) throws IllegalArgumentException { } } | Assert . notNull ( alg , "SignatureAlgorithm cannot be null." ) ; switch ( alg ) { case HS256 : case HS384 : case HS512 : return Classes . invokeStatic ( MAC , "generateKey" , SIG_ARG_TYPES , alg ) ; default : String msg = "The " + alg . name ( ) + " algorithm does not support shared secret keys." ; throw new IllegalArgumentException ( msg ) ; } |
public class StringUtils { /** * Returns s if it ' s at most maxWidth chars , otherwise chops right side to fit . */
public static String trim ( String s , int maxWidth ) { } } | if ( s . length ( ) <= maxWidth ) { return ( s ) ; } return ( s . substring ( 0 , maxWidth ) ) ; |
public class CoIterator { /** * Use { @ link # getLeft ( ) } and { @ link # getRight ( ) } to get the next elements from the two iterated collections . */
public void next ( ) { } } | boolean hasLeft = currentLeft != null ; boolean hasRight = currentRight != null ; if ( ! hasLeft && ! hasRight ) { throw new NoSuchElementException ( ) ; } int order ; if ( hasLeft && ! hasRight ) { order = - 1 ; } else if ( ! hasLeft ) { order = 1 ; } else { order = comparator . compare ( currentLeft , currentRight ) ; } if ( order < 0 ) { reportedLeft = currentLeft ; currentLeft = nextOrNull ( left ) ; reportedRight = null ; } else if ( order > 0 ) { reportedLeft = null ; reportedRight = currentRight ; currentRight = nextOrNull ( right ) ; } else { reportedLeft = currentLeft ; reportedRight = currentRight ; currentLeft = nextOrNull ( left ) ; currentRight = nextOrNull ( right ) ; } |
public class ZonesInner { /** * Updates a DNS zone . Does not modify DNS records within the zone .
* @ param resourceGroupName The name of the resource group .
* @ param zoneName The name of the DNS zone ( without a terminating dot ) .
* @ param ifMatch The etag of the DNS zone . Omit this value to always overwrite the current zone . Specify the last - seen etag value to prevent accidentally overwritting any concurrent changes .
* @ param tags Resource tags .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the ZoneInner object if successful . */
public ZoneInner update ( String resourceGroupName , String zoneName , String ifMatch , Map < String , String > tags ) { } } | return updateWithServiceResponseAsync ( resourceGroupName , zoneName , ifMatch , tags ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class CoverageDataCore { /** * Get the gridded tile
* @ return gridded tiles */
public List < GriddedTile > getGriddedTile ( ) { } } | List < GriddedTile > griddedTile = null ; try { if ( griddedTileDao . isTableExists ( ) ) { griddedTile = griddedTileDao . query ( tileMatrixSet . getTableName ( ) ) ; } } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to get Gridded Tile for table name: " + tileMatrixSet . getTableName ( ) , e ) ; } return griddedTile ; |
public class JsonWrapperFilteringCharacterPipelineComponent { /** * / * ( non - Javadoc )
* @ see org . apereo . portal . rendering . PipelineComponent # getCacheKey ( javax . servlet . http . HttpServletRequest , javax . servlet . http . HttpServletResponse ) */
@ Override public CacheKey getCacheKey ( HttpServletRequest request , HttpServletResponse response ) throws IllegalStateException { } } | if ( this . wrappedComponent != null ) { return this . wrappedComponent . getCacheKey ( request , response ) ; } else { logger . debug ( "PipelineComponentWrapper.wrapperComponent is null" ) ; throw new IllegalStateException ( "PipelineComponentWrapper.wrapperComponent is null" ) ; } |
public class Multimap { /** * Remove the specified values ( all occurrences ) from the value set associated with keys which satisfy the specified < code > predicate < / code > .
* @ param values
* @ param predicate
* @ return < code > true < / code > if this Multimap is modified by this operation , otherwise < code > false < / code > . */
public < X extends Exception > boolean removeAllIf ( Collection < ? > values , 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 ( removeAll ( k , values ) ) { modified = true ; } } return modified ; |
public class CommerceVirtualOrderItemLocalServiceBaseImpl { /** * Adds the commerce virtual order item to the database . Also notifies the appropriate model listeners .
* @ param commerceVirtualOrderItem the commerce virtual order item
* @ return the commerce virtual order item that was added */
@ Indexable ( type = IndexableType . REINDEX ) @ Override public CommerceVirtualOrderItem addCommerceVirtualOrderItem ( CommerceVirtualOrderItem commerceVirtualOrderItem ) { } } | commerceVirtualOrderItem . setNew ( true ) ; return commerceVirtualOrderItemPersistence . update ( commerceVirtualOrderItem ) ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EEnum getIfcPlateTypeEnum ( ) { } } | if ( ifcPlateTypeEnumEEnum == null ) { ifcPlateTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 871 ) ; } return ifcPlateTypeEnumEEnum ; |
public class WSSecurityServiceImpl { /** * Returns the active UserRegistry . If the active user registry is an instance of
* com . ibm . ws . security . registry . UserRegistry , then it will be wrapped . Otherwise ,
* if the active user registry is an instance of CustomUserRegistryWrapper , then the
* underlying com . ibm . websphere . security . UserRegistry will be returned .
* @ return UserRegistry the active user registry .
* @ throws WSSecurityException */
private UserRegistry getActiveUserRegistry ( ) throws WSSecurityException { } } | final String METHOD = "getUserRegistry" ; UserRegistry activeUserRegistry = null ; try { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHOD + " securityServiceRef " + securityServiceRef ) ; } SecurityService ss = securityServiceRef . getService ( ) ; if ( ss == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHOD + " No SecurityService, returning null" ) ; } } else { UserRegistryService urs = ss . getUserRegistryService ( ) ; if ( urs == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHOD + " No UserRegistryService, returning null" ) ; } } else { if ( urs . isUserRegistryConfigured ( ) ) { com . ibm . ws . security . registry . UserRegistry userRegistry = urs . getUserRegistry ( ) ; activeUserRegistry = urs . getExternalUserRegistry ( userRegistry ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHOD + " Security enabled but no registry configured" ) ; } } } } } catch ( RegistryException e ) { String msg = "getUserRegistryWrapper failed due to an internal error: " + e . getMessage ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , msg , e ) ; } throw new WSSecurityException ( msg , e ) ; } return activeUserRegistry ; |
public class FractionDescriptor { /** * Retrieves a { @ link FractionDescriptor } from the { @ code fractionList } based on the { @ code gav } string .
* < p > The { @ code gav } string contains colon - delimited Maven artifact coordinates . Supported formats are : < / p >
* < ul >
* < li > { @ code artifactId } : the groupId { @ code org . wildfly . swarm } is presumed < / li >
* < li > { @ code artifactId : version } : the groupId { @ code org . wildfly . swarm } is presumed < / li >
* < li > { @ code groupId : artifactId : version } < / li >
* < / ul >
* < p > If the { @ code fractionList } doesn ' t contain such fraction , an exception is thrown . < / p > */
public static FractionDescriptor fromGav ( final FractionList fractionList , final String gav ) { } } | final String [ ] parts = gav . split ( ":" ) ; FractionDescriptor desc = null ; switch ( parts . length ) { case 1 : desc = fractionList . getFractionDescriptor ( THORNTAIL_GROUP_ID , parts [ 0 ] ) ; if ( desc == null ) { throw new RuntimeException ( "Fraction not found: " + gav ) ; } break ; case 2 : desc = fractionList . getFractionDescriptor ( THORNTAIL_GROUP_ID , parts [ 0 ] ) ; if ( desc == null ) { throw new RuntimeException ( "Fraction not found: " + gav ) ; } if ( ! desc . getVersion ( ) . equals ( parts [ 1 ] ) ) { throw new RuntimeException ( "Version mismatch: requested " + gav + ", found " + desc . av ( ) ) ; } break ; case 3 : desc = fractionList . getFractionDescriptor ( parts [ 0 ] , parts [ 1 ] ) ; if ( desc == null ) { throw new RuntimeException ( "Fraction not found: " + gav ) ; } if ( ! desc . getVersion ( ) . equals ( parts [ 2 ] ) ) { throw new RuntimeException ( "Version mismatch: requested " + gav + ", found " + desc . gav ( ) ) ; } break ; default : throw new RuntimeException ( "Invalid fraction spec: " + gav ) ; } return desc ; |
public class CPAttachmentFileEntryPersistenceImpl { /** * Returns the last cp attachment file entry in the ordered set where displayDate & lt ; & # 63 ; and status = & # 63 ; .
* @ param displayDate the display date
* @ param status the status
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the last matching cp attachment file entry
* @ throws NoSuchCPAttachmentFileEntryException if a matching cp attachment file entry could not be found */
@ Override public CPAttachmentFileEntry findByLtD_S_Last ( Date displayDate , int status , OrderByComparator < CPAttachmentFileEntry > orderByComparator ) throws NoSuchCPAttachmentFileEntryException { } } | CPAttachmentFileEntry cpAttachmentFileEntry = fetchByLtD_S_Last ( displayDate , status , orderByComparator ) ; if ( cpAttachmentFileEntry != null ) { return cpAttachmentFileEntry ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "displayDate=" ) ; msg . append ( displayDate ) ; msg . append ( ", status=" ) ; msg . append ( status ) ; msg . append ( "}" ) ; throw new NoSuchCPAttachmentFileEntryException ( msg . toString ( ) ) ; |
public class Store { /** * Creates n new annotation instances , adding them all to the store .
* @ see Store # create ( Class ) */
public void create ( final Class < T > klass , final int n ) { } } | for ( int i = 0 ; i != n ; i ++ ) create ( klass ) ; |
public class AbstractChart { /** * @ param series
* the series to set
* @ return AbstractChart */
public AbstractChart < T , S > setSeries ( Collection < Serie > series ) { } } | this . getChartConfiguration ( ) . setSeries ( series ) ; return this ; |
public class LazyUserTransaction { @ Override protected void doCommit ( ) throws HeuristicMixedException , HeuristicRollbackException , IllegalStateException , RollbackException , SecurityException , SystemException { } } | if ( canTerminateTransactionReally ( ) ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "#lazyTx ...Committing the transaction: {}" , buildLazyTxExp ( ) ) ; } superDoCommit ( ) ; } else { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "#lazyTx *No commit because of non-begun transaction: {}" , buildLazyTxExp ( ) ) ; } } if ( canLazyTransaction ( ) ) { decrementHierarchyLevel ( ) ; resumeForcedlyBegunLazyTransactionIfNeeds ( ) ; // when nested transaction
} if ( isLazyTransactionReadyLazy ( ) && isHerarchyLevelZero ( ) ) { // lazy transaction is supported only for root
returnToReadyLazy ( ) ; } |
public class CommerceTaxFixedRateLocalServiceBaseImpl { /** * Sets the commerce tax fixed rate address rel local service .
* @ param commerceTaxFixedRateAddressRelLocalService the commerce tax fixed rate address rel local service */
public void setCommerceTaxFixedRateAddressRelLocalService ( com . liferay . commerce . tax . engine . fixed . service . CommerceTaxFixedRateAddressRelLocalService commerceTaxFixedRateAddressRelLocalService ) { } } | this . commerceTaxFixedRateAddressRelLocalService = commerceTaxFixedRateAddressRelLocalService ; |
public class WebSocketConnectionManager { /** * Send message to all connections tagged with all given tags
* @ param message the message
* @ param labels the tag labels */
public void sendToTagged ( String message , String ... labels ) { } } | for ( String label : labels ) { sendToTagged ( message , label ) ; } |
public class ThreadJobProcessor { /** * Starts processor thread . */
@ Override public synchronized void start ( ) { } } | if ( ! started . getAndSet ( true ) ) { finished . set ( false ) ; thread . start ( ) ; } |
public class GenericsInfoFactory { /** * Note : ignore classes switch off caching for resolved descriptor ( and if completely resolved version
* contained in cache limited version will be composed one more time ) .
* @ param type finder type to investigate
* @ param ignoreClasses list of classes to ignore during inspection ( useful to avoid interface clashes )
* @ return descriptor for class hierarchy generics substitution */
public static GenericsInfo create ( final Class < ? > type , final Class < ? > ... ignoreClasses ) { } } | GenericsInfo descriptor = ignoreClasses . length > 0 ? GenericInfoUtils . create ( type , ignoreClasses ) : CACHE . get ( type ) ; if ( descriptor == null ) { LOCK . lock ( ) ; try { if ( CACHE . get ( type ) != null ) { // descriptor could be created while thread wait for lock
descriptor = CACHE . get ( type ) ; } else { descriptor = GenericInfoUtils . create ( type ) ; if ( isCacheEnabled ( ) ) { // internal check
if ( CACHE . get ( type ) != null ) { throw new ConcurrentModificationException ( "Descriptor already present in cache" ) ; } CACHE . put ( type , descriptor ) ; } } } finally { LOCK . unlock ( ) ; } } return descriptor ; |
public class ResourceRoot { /** * / * ( non - Javadoc )
* @ see org . jboss . staxmapper . XMLElementWriter # writeContent ( org . jboss . staxmapper . XMLExtendedStreamWriter , java . lang . Object ) */
@ Override public void writeContent ( XMLExtendedStreamWriter writer , Resource value ) throws XMLStreamException { } } | if ( value != null && this != value ) { throw new IllegalStateException ( "Wrong target resource." ) ; } writer . writeStartElement ( ModuleConfigImpl . RESOURCE_ROOT ) ; writer . writeAttribute ( ModuleConfigImpl . PATH , path ) ; writer . writeEndElement ( ) ; |
public class BaseTaskSession { /** * A utility method to get an Input stream from a filename or URL string .
* @ param strFilename The filename or url to open as an Input Stream .
* @ return The imput stream ( or null if there was an error ) . */
public InputStream getInputStream ( String strFilename ) { } } | InputStream inStream = Utility . getInputStream ( strFilename , this . getApplication ( ) ) ; if ( inStream == null ) if ( this . getParentSession ( ) != null ) { Task task = this . getParentSession ( ) . getTask ( ) ; if ( ( task != null ) && ( task != this ) ) inStream = task . getInputStream ( strFilename ) ; } return inStream ; |
public class AsyncJob { /** * Executes the provided code immediately on a background thread
* @ param onBackgroundJob Interface that wraps the code to execute */
public static void doInBackground ( final OnBackgroundJob onBackgroundJob ) { } } | new Thread ( new Runnable ( ) { @ Override public void run ( ) { onBackgroundJob . doOnBackground ( ) ; } } ) . start ( ) ; |
public class AbstractSULOmegaOracle { /** * Gets the { @ link ObservableSUL } .
* @ return the { @ link ObservableSUL } . */
public ObservableSUL < S , I , O > getSul ( ) { } } | if ( sul . canFork ( ) ) { return localSul . get ( ) ; } else { return sul ; } |
public class log { /** * Sends a DEBUG log message and log the exception .
* @ param message The message you would like logged .
* @ param throwable An exception to log */
public static int d ( String message , Throwable throwable ) { } } | return logger ( QuickUtils . DEBUG , message , throwable ) ; |
public class FilterUtil { /** * Try to guess the appropriate factory .
* @ param in Input type
* @ param < V > Vector type
* @ return Factory */
@ SuppressWarnings ( "unchecked" ) public static < V extends NumberVector > NumberVector . Factory < V > guessFactory ( SimpleTypeInformation < V > in ) { } } | NumberVector . Factory < V > factory = null ; if ( in instanceof VectorTypeInformation ) { factory = ( NumberVector . Factory < V > ) ( ( VectorTypeInformation < V > ) in ) . getFactory ( ) ; } if ( factory == null ) { // FIXME : hack . Add factories to simple type information , too ?
try { Field f = in . getRestrictionClass ( ) . getField ( "FACTORY" ) ; factory = ( NumberVector . Factory < V > ) f . get ( null ) ; } catch ( Exception e ) { LoggingUtil . warning ( "Cannot determine factory for type " + in . getRestrictionClass ( ) , e ) ; } } return factory ; |
public class DevicesInner { /** * Creates or updates a Data Box Edge / Gateway resource .
* @ param deviceName The device name .
* @ param resourceGroupName The resource group name .
* @ param dataBoxEdgeDevice The resource object .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < DataBoxEdgeDeviceInner > beginCreateOrUpdateAsync ( String deviceName , String resourceGroupName , DataBoxEdgeDeviceInner dataBoxEdgeDevice , final ServiceCallback < DataBoxEdgeDeviceInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( beginCreateOrUpdateWithServiceResponseAsync ( deviceName , resourceGroupName , dataBoxEdgeDevice ) , serviceCallback ) ; |
public class WSCallbackHandlerFactoryImpl { /** * { @ inheritDoc } */
@ Override public CallbackHandler getCallbackHandler ( byte [ ] credToken ) { } } | AuthenticationData authenticationData = new WSAuthenticationData ( ) ; authenticationData . set ( AuthenticationData . TOKEN , credToken ) ; return new AuthenticationDataCallbackHandler ( authenticationData ) ; |
public class ResultResponseUtil { /** * 设置返回状态 ( 返回码 , 描述 )
* @ param iReturnCode IReturnCode
* @ return ResultResponseUtil */
public ResultResponseUtil status ( IReturnCode iReturnCode ) { } } | this . setCode ( iReturnCode . getCode ( ) ) ; this . setMsg ( iReturnCode . getMsg ( ) ) ; return this ; |
public class SectionLoader { /** * Loads all bytes and information of the reloc section .
* The file on disk is read to fetch the information .
* @ return { @ link RelocationSection } of the given file
* @ throws IOException
* if unable to read the file
* @ throws IllegalStateException
* if unable to load debug section */
public RelocationSection loadRelocSection ( ) throws IOException { } } | Optional < RelocationSection > debug = maybeLoadRelocSection ( ) ; return ( RelocationSection ) getOrThrow ( debug , "unable to load reloc section" ) ; |
public class Schema { /** * Adds all of the fields in the specified schema to this schema .
* @ param sch
* the other schema */
public void addAll ( Schema sch ) { } } | fields . putAll ( sch . fields ) ; if ( myFieldSet != null ) myFieldSet = new TreeSet < String > ( fields . keySet ( ) ) ; |
public class CommercePriceListUserSegmentEntryRelLocalServiceBaseImpl { /** * Deletes the commerce price list user segment entry rel from the database . Also notifies the appropriate model listeners .
* @ param commercePriceListUserSegmentEntryRel the commerce price list user segment entry rel
* @ return the commerce price list user segment entry rel that was removed
* @ throws PortalException */
@ Indexable ( type = IndexableType . DELETE ) @ Override public CommercePriceListUserSegmentEntryRel deleteCommercePriceListUserSegmentEntryRel ( CommercePriceListUserSegmentEntryRel commercePriceListUserSegmentEntryRel ) throws PortalException { } } | return commercePriceListUserSegmentEntryRelPersistence . remove ( commercePriceListUserSegmentEntryRel ) ; |
public class ParagraphVectors { /** * This method returns top N labels nearest to specified document
* @ param document
* @ param topN
* @ return */
public Collection < String > nearestLabels ( LabelledDocument document , int topN ) { } } | if ( document . getReferencedContent ( ) != null ) { return nearestLabels ( document . getReferencedContent ( ) , topN ) ; } else return nearestLabels ( document . getContent ( ) , topN ) ; |
public class Collections { /** * Returns an empty sorted map ( immutable ) . This map is serializable .
* < p > This example illustrates the type - safe way to obtain an empty map :
* < pre > { @ code
* SortedMap < String , Date > s = Collections . emptySortedMap ( ) ;
* } < / pre >
* @ implNote Implementations of this method need not create a separate
* { @ code SortedMap } object for each call .
* @ param < K > the class of the map keys
* @ param < V > the class of the map values
* @ return an empty sorted map
* @ since 1.8 */
@ SuppressWarnings ( "unchecked" ) public static final < K , V > SortedMap < K , V > emptySortedMap ( ) { } } | return ( SortedMap < K , V > ) UnmodifiableNavigableMap . EMPTY_NAVIGABLE_MAP ; |
public class ConcurrentLinkedDeque { /** * Reconstitutes this deque from a stream ( that is , deserializes it ) .
* @ param s the stream
* @ throws ClassNotFoundException if the class of a serialized object
* could not be found
* @ throws java . io . IOException if an I / O error occurs */
private void readObject ( java . io . ObjectInputStream s ) throws java . io . IOException , ClassNotFoundException { } } | s . defaultReadObject ( ) ; // Read in elements until trailing null sentinel found
Node < E > h = null , t = null ; for ( Object item ; ( item = s . readObject ( ) ) != null ; ) { @ SuppressWarnings ( "unchecked" ) Node < E > newNode = new Node < E > ( ( E ) item ) ; if ( h == null ) h = t = newNode ; else { t . lazySetNext ( newNode ) ; newNode . lazySetPrev ( t ) ; t = newNode ; } } initHeadTail ( h , t ) ; |
public class FileWriter { /** * 将列表写入文件
* @ param < T > 集合元素类型
* @ param list 列表
* @ param lineSeparator 换行符枚举 ( Windows 、 Mac或Linux换行符 )
* @ param isAppend 是否追加
* @ return 目标文件
* @ throws IORuntimeException IO异常
* @ since 3.1.0 */
public < T > File writeLines ( Collection < T > list , LineSeparator lineSeparator , boolean isAppend ) throws IORuntimeException { } } | try ( PrintWriter writer = getPrintWriter ( isAppend ) ) { for ( T t : list ) { if ( null != t ) { writer . print ( t . toString ( ) ) ; printNewLine ( writer , lineSeparator ) ; writer . flush ( ) ; } } } return this . file ; |
public class BeanProvider { /** * Internal helper method to resolve the right bean and resolve the contextual reference .
* @ param type the type of the bean in question
* @ param beanManager current bean - manager
* @ param beans beans in question
* @ param < T > target type
* @ return the contextual reference */
private static < T > T getContextualReference ( Class < T > type , BeanManager beanManager , Set < Bean < ? > > beans ) { } } | Bean < ? > bean = beanManager . resolve ( beans ) ; // logWarningIfDependent ( bean ) ;
CreationalContext < ? > creationalContext = beanManager . createCreationalContext ( bean ) ; @ SuppressWarnings ( { "unchecked" , "UnnecessaryLocalVariable" } ) T result = ( T ) beanManager . getReference ( bean , type , creationalContext ) ; return result ; |
public class CmsExportPointDriver { /** * Returns the File for the given export point resource . < p >
* @ param rootPath name of a file in the VFS
* @ param exportpoint the name of the export point
* @ return the File for the given export point resource */
protected File getExportPointFile ( String rootPath , String exportpoint ) { } } | StringBuffer exportpath = new StringBuffer ( 128 ) ; exportpath . append ( m_exportpointLookupMap . get ( exportpoint ) ) ; exportpath . append ( rootPath . substring ( exportpoint . length ( ) ) ) ; return new File ( exportpath . toString ( ) ) ; |
public class Subtypes2 { /** * Get known subtypes of given class . The set returned < em > DOES < / em > include
* the class itself .
* @ param classDescriptor
* ClassDescriptor naming a class
* @ return Set of ClassDescriptors which are the known subtypes of the class
* @ throws ClassNotFoundException */
public Set < ClassDescriptor > getSubtypes ( ClassDescriptor classDescriptor ) throws ClassNotFoundException { } } | Set < ClassDescriptor > result = subtypeSetMap . get ( classDescriptor ) ; if ( result == null ) { result = computeKnownSubtypes ( classDescriptor ) ; subtypeSetMap . put ( classDescriptor , result ) ; } return result ; |
public class AuditServiceImpl { /** * Get parameters which passed from the configuration file .
* @ throws RepositoryConfigurationException */
private void readParamsFromFile ( ) { } } | if ( initParams != null ) { ValueParam valParam = initParams . getValueParam ( ADMIN_INDENTITY ) ; if ( valParam != null ) { adminIdentity = valParam . getValue ( ) ; LOG . info ( "Admin identity is read from configuration file" ) ; } ValueParam defaultIdentityParam = initParams . getValueParam ( DEFAULT_INDENTITY ) ; if ( defaultIdentityParam != null ) { defaultIdentity = defaultIdentityParam . getValue ( ) ; LOG . info ( "Default identity is read from configuration file" ) ; } } checkParams ( ) ; |
public class JsonWriter { /** * Write a list of values in an array , for example :
* < pre >
* writer . beginArray ( ) . values ( myValues ) . endArray ( ) ;
* < / pre >
* @ throws org . sonar . api . utils . text . WriterException on any failure */
public JsonWriter values ( Iterable < String > values ) { } } | for ( String value : values ) { value ( value ) ; } return this ; |
public class Field { /** * Returns a new TypeConverter appropriate for the Field ' s type .
* @ throws RpcException If type is not defined in the Contract */
public TypeConverter getTypeConverter ( ) throws RpcException { } } | if ( contract == null ) { throw new IllegalStateException ( "contract cannot be null" ) ; } if ( type == null ) { throw new IllegalStateException ( "field type cannot be null" ) ; } TypeConverter tc = null ; if ( type . equals ( "string" ) ) tc = new StringTypeConverter ( isOptional ) ; else if ( type . equals ( "int" ) ) tc = new IntTypeConverter ( isOptional ) ; else if ( type . equals ( "float" ) ) tc = new FloatTypeConverter ( isOptional ) ; else if ( type . equals ( "bool" ) ) tc = new BoolTypeConverter ( isOptional ) ; else { Struct s = contract . getStructs ( ) . get ( type ) ; if ( s != null ) { tc = new StructTypeConverter ( s , isOptional ) ; } Enum e = contract . getEnums ( ) . get ( type ) ; if ( e != null ) { tc = new EnumTypeConverter ( e , isOptional ) ; } } if ( tc == null ) { throw RpcException . Error . INTERNAL . exc ( "Unknown type: " + type ) ; } else if ( isArray ) { return new ArrayTypeConverter ( tc , isOptional ) ; } else { return tc ; } |
public class UpdateDataSourceRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UpdateDataSourceRequest updateDataSourceRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( updateDataSourceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateDataSourceRequest . getApiId ( ) , APIID_BINDING ) ; protocolMarshaller . marshall ( updateDataSourceRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( updateDataSourceRequest . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( updateDataSourceRequest . getType ( ) , TYPE_BINDING ) ; protocolMarshaller . marshall ( updateDataSourceRequest . getServiceRoleArn ( ) , SERVICEROLEARN_BINDING ) ; protocolMarshaller . marshall ( updateDataSourceRequest . getDynamodbConfig ( ) , DYNAMODBCONFIG_BINDING ) ; protocolMarshaller . marshall ( updateDataSourceRequest . getLambdaConfig ( ) , LAMBDACONFIG_BINDING ) ; protocolMarshaller . marshall ( updateDataSourceRequest . getElasticsearchConfig ( ) , ELASTICSEARCHCONFIG_BINDING ) ; protocolMarshaller . marshall ( updateDataSourceRequest . getHttpConfig ( ) , HTTPCONFIG_BINDING ) ; protocolMarshaller . marshall ( updateDataSourceRequest . getRelationalDatabaseConfig ( ) , RELATIONALDATABASECONFIG_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class ViewHandler { /** * Removes requests as long as they match - breaks at the first non - matching request or when requests is empty
* This method must catch all exceptions ; or else process ( ) might return without setting processing to true again ! */
protected void removeAndProcess ( Collection < R > requests ) { } } | try { Collection < R > removed = new ArrayList < > ( ) ; Iterator < R > it = requests . iterator ( ) ; R first_req = it . next ( ) ; removed . add ( first_req ) ; it . remove ( ) ; while ( it . hasNext ( ) ) { R next = it . next ( ) ; if ( req_matcher . test ( first_req , next ) ) { removed . add ( next ) ; it . remove ( ) ; } else break ; } req_processor . accept ( removed ) ; } catch ( Throwable t ) { log ( ) . error ( "failed processing requests" , t ) ; } |
public class KafkaQueue { /** * Destroy method . */
public void destroy ( ) { } } | try { super . destroy ( ) ; } finally { if ( kafkaClient != null && myOwnKafkaClient ) { try { kafkaClient . destroy ( ) ; } catch ( Exception e ) { LOGGER . warn ( e . getMessage ( ) , e ) ; } finally { kafkaClient = null ; } } } |
public class WARCRecordToSearchResultAdapter { /** * Transform input date to 14 - digit timestamp :
* 2007-08-29T18:00:26Z = > 20070829180026 */
private static String transformWARCDate ( final String input ) { } } | StringBuilder output = new StringBuilder ( 14 ) ; output . append ( input . substring ( 0 , 4 ) ) ; output . append ( input . substring ( 5 , 7 ) ) ; output . append ( input . substring ( 8 , 10 ) ) ; output . append ( input . substring ( 11 , 13 ) ) ; output . append ( input . substring ( 14 , 16 ) ) ; output . append ( input . substring ( 17 , 19 ) ) ; return output . toString ( ) ; |
public class CsvListReader { /** * { @ inheritDoc } */
public List < Object > read ( final CellProcessor ... processors ) throws IOException { } } | if ( processors == null ) { throw new NullPointerException ( "processors should not be null" ) ; } if ( readRow ( ) ) { return executeProcessors ( processors ) ; } return null ; // EOF |
public class DisjointMultiSwapNeighbourhood { /** * Generates the list of all possible moves that perform exactly \ ( k \ ) swaps , where \ ( k \ ) is the desired number
* of swaps specified at construction . Possible fixed IDs are not considered to be swapped . If \ ( m & lt ; k \ )
* IDs are currently selected or unselected ( excluding any fixed IDs ) , no swaps can be performed and the
* returned list will be empty .
* @ param solution solution for which all possible multi swap moves are generated
* @ return list of all multi swap moves , may be empty */
@ Override public List < SubsetMove > getAllMoves ( SubsetSolution solution ) { } } | // create empty list to store generated moves
List < SubsetMove > moves = new ArrayList < > ( ) ; // get set of candidate IDs for deletion and addition
Set < Integer > removeCandidates = getRemoveCandidates ( solution ) ; Set < Integer > addCandidates = getAddCandidates ( solution ) ; // possible to perform desired number of swaps ?
int curNumSwaps = numSwaps ( addCandidates , removeCandidates ) ; if ( curNumSwaps == 0 ) { // impossible : return empty set
return moves ; } // create all moves performing numSwaps swaps
SubsetIterator < Integer > itDel , itAdd ; Set < Integer > del , add ; itDel = new SubsetIterator < > ( removeCandidates , curNumSwaps ) ; while ( itDel . hasNext ( ) ) { del = itDel . next ( ) ; itAdd = new SubsetIterator < > ( addCandidates , curNumSwaps ) ; while ( itAdd . hasNext ( ) ) { add = itAdd . next ( ) ; // create and add move
moves . add ( new GeneralSubsetMove ( add , del ) ) ; } } // return all moves
return moves ; |
public class CleverTapAPI { /** * private multi - value handlers and helpers */
private void _handleMultiValues ( ArrayList < String > values , String key , String command ) { } } | if ( key == null ) return ; if ( values == null || values . isEmpty ( ) ) { _generateEmptyMultiValueError ( key ) ; return ; } ValidationResult vr ; // validate the key
vr = validator . cleanMultiValuePropertyKey ( key ) ; // Check for an error
if ( vr . getErrorCode ( ) != 0 ) { pushValidationResult ( vr ) ; } // reset the key
Object _key = vr . getObject ( ) ; String cleanKey = ( _key != null ) ? vr . getObject ( ) . toString ( ) : null ; // if key is empty generate an error and return
if ( cleanKey == null || cleanKey . isEmpty ( ) ) { _generateInvalidMultiValueKeyError ( key ) ; return ; } key = cleanKey ; try { JSONArray currentValues = _constructExistingMultiValue ( key , command ) ; JSONArray newValues = _cleanMultiValues ( values , key ) ; _validateAndPushMultiValue ( currentValues , newValues , values , key , command ) ; } catch ( Throwable t ) { getConfigLogger ( ) . verbose ( getAccountId ( ) , "Error handling multi value operation for key " + key , t ) ; } |
public class CmsImageCacheHelper { /** * Returns the size of the given image . < p >
* @ param imgName the image name
* @ return the size of the given image */
public String getSize ( String imgName ) { } } | String ret = ( String ) m_sizes . get ( imgName ) ; if ( ret == null ) { return "" ; } return ret ; |
public class CaseHelper { /** * Test method . */
public static void main ( String [ ] args ) { } } | String [ ] input = { "check_ins" , "CheckIns" , "blog_entry" , "BlogEntry" , "blog_entries" , "BlogEntries" , "blogentry" , "blogentries" } ; for ( int i = 0 ; i < input . length ; i ++ ) { System . out . println ( StringUtils . rightPad ( input [ i ] , 20 ) + StringUtils . leftPad ( toUpperCamelCase ( input [ i ] ) , 20 ) + StringUtils . leftPad ( toUnderscore ( input [ i ] , true ) , 20 ) + StringUtils . leftPad ( toUnderscore ( input [ i ] , false ) , 20 ) ) ; } |
public class CmsToolbarClipboardMenu { /** * Saves the favorite list . < p > */
public void saveFavorites ( ) { } } | m_isEditingFavorites = false ; getHandler ( ) . enableFavoriteEditing ( false , m_dndController ) ; List < String > clientIds = new ArrayList < String > ( ) ; Iterator < Widget > it = m_favorites . iterator ( ) ; while ( it . hasNext ( ) ) { try { CmsMenuListItem element = ( CmsMenuListItem ) it . next ( ) ; element . hideRemoveButton ( ) ; element . showEditButton ( ) ; clientIds . add ( element . getId ( ) ) ; } catch ( ClassCastException e ) { CmsDebugLog . getInstance ( ) . printLine ( "Could not cast widget" ) ; } } getHandler ( ) . saveFavoriteList ( clientIds ) ; |
public class AccountsInner { /** * Gets the first page of Data Lake Analytics accounts , if any , within the current subscription . This includes a link to the next page , if any .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; DataLakeAnalyticsAccountBasicInner & gt ; object */
public Observable < Page < DataLakeAnalyticsAccountBasicInner > > listAsync ( ) { } } | return listWithServiceResponseAsync ( ) . map ( new Func1 < ServiceResponse < Page < DataLakeAnalyticsAccountBasicInner > > , Page < DataLakeAnalyticsAccountBasicInner > > ( ) { @ Override public Page < DataLakeAnalyticsAccountBasicInner > call ( ServiceResponse < Page < DataLakeAnalyticsAccountBasicInner > > response ) { return response . body ( ) ; } } ) ; |
public class MAP { /** * Computes the global MAP by first summing the AP ( average precision ) for
* each user and then averaging by the number of users . */
@ Override public void compute ( ) { } } | if ( ! Double . isNaN ( getValue ( ) ) ) { // since the data cannot change , avoid re - doing the calculations
return ; } iniCompute ( ) ; Map < U , List < Pair < I , Double > > > data = processDataAsRankedTestRelevance ( ) ; userMAPAtCutoff = new HashMap < Integer , Map < U , Double > > ( ) ; int nUsers = 0 ; for ( Entry < U , List < Pair < I , Double > > > e : data . entrySet ( ) ) { U user = e . getKey ( ) ; List < Pair < I , Double > > sortedList = e . getValue ( ) ; // number of relevant items for this user
double uRel = getNumberOfRelevantItems ( user ) ; double uMAP = 0.0 ; double uPrecision = 0.0 ; int rank = 0 ; for ( Pair < I , Double > pair : sortedList ) { double rel = pair . getSecond ( ) ; rank ++ ; double itemPrecision = computeBinaryPrecision ( rel ) ; uPrecision += itemPrecision ; if ( itemPrecision > 0 ) { uMAP += uPrecision / rank ; } // compute at a particular cutoff
for ( int at : getCutoffs ( ) ) { if ( rank == at ) { Map < U , Double > m = userMAPAtCutoff . get ( at ) ; if ( m == null ) { m = new HashMap < U , Double > ( ) ; userMAPAtCutoff . put ( at , m ) ; } m . put ( user , uMAP / uRel ) ; } } } // normalize by number of relevant items
uMAP /= uRel ; // assign the MAP of the whole list to those cutoffs larger than the list ' s size
for ( int at : getCutoffs ( ) ) { if ( rank <= at ) { Map < U , Double > m = userMAPAtCutoff . get ( at ) ; if ( m == null ) { m = new HashMap < U , Double > ( ) ; userMAPAtCutoff . put ( at , m ) ; } m . put ( user , uMAP ) ; } } if ( ! Double . isNaN ( uMAP ) ) { setValue ( getValue ( ) + uMAP ) ; getMetricPerUser ( ) . put ( user , uMAP ) ; nUsers ++ ; } } setValue ( getValue ( ) / nUsers ) ; |
public class AbstractAdminObject { /** * Returns the list of events defined for given event type .
* @ param _ eventType event type
* @ return list of events for the given event type */
public List < EventDefinition > getEvents ( final EventType _eventType ) { } } | if ( ! this . eventChecked ) { this . eventChecked = true ; try { EventDefinition . addEvents ( this ) ; } catch ( final EFapsException e ) { AbstractAdminObject . LOG . error ( "Could not read events for Name:; {}', UUID: {}" , this . name , this . uuid ) ; } } return this . events . get ( _eventType ) ; |
public class StorageObjectSummary { /** * Contructs a StorageObjectSummary object from Azure BLOB properties
* Using factory methods to create these objects since Azure can throw ,
* while retrieving the BLOB properties
* @ param listBlobItem an Azure ListBlobItem object
* @ return the ObjectSummary object created */
public static StorageObjectSummary createFromAzureListBlobItem ( ListBlobItem listBlobItem ) throws StorageProviderException { } } | String location , key , md5 ; long size ; // Retrieve the BLOB properties that we need for the Summary
// Azure Storage stores metadata inside each BLOB , therefore the listBlobItem
// will point us to the underlying BLOB and will get the properties from it
// During the process the Storage Client could fail , hence we need to wrap the
// get calls in try / catch and handle possible exceptions
try { location = listBlobItem . getContainer ( ) . getName ( ) ; CloudBlob cloudBlob = ( CloudBlob ) listBlobItem ; key = cloudBlob . getName ( ) ; BlobProperties blobProperties = cloudBlob . getProperties ( ) ; // the content md5 property is not always the actual md5 of the file . But for here , it ' s only
// used for skipping file on PUT command , hense is ok .
md5 = convertBase64ToHex ( blobProperties . getContentMD5 ( ) ) ; size = blobProperties . getLength ( ) ; } catch ( URISyntaxException | StorageException ex ) { // This should only happen if somehow we got here with and invalid URI ( it should never happen )
// . . . or there is a Storage service error . Unlike S3 , Azure fetches metadata from the BLOB itself ,
// and its a lazy operation
throw new StorageProviderException ( ex ) ; } return new StorageObjectSummary ( location , key , md5 , size ) ; |
public class PlotCanvas { /** * Adds a poly line plot to this canvas .
* @ param data a n - by - 2 or n - by - 3 matrix that describes coordinates of points .
* @ param style the stroke style of line . */
public LinePlot line ( double [ ] [ ] data , Line . Style style ) { } } | return line ( null , data , style ) ; |
public class PDFBuilder { /** * Returns the URL of the default stylesheet .
* @ return The URL of the stylesheet . */
protected URL getNonDefaultStylesheetURL ( ) { } } | if ( getNonDefaultStylesheetLocation ( ) != null ) { URL url = this . getClass ( ) . getClassLoader ( ) . getResource ( getNonDefaultStylesheetLocation ( ) ) ; return url ; } else { return null ; } |
public class NegationImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setValue ( Condition newValue ) { } } | if ( newValue != value ) { NotificationChain msgs = null ; if ( value != null ) msgs = ( ( InternalEObject ) value ) . eInverseRemove ( this , EOPPOSITE_FEATURE_BASE - XtextPackage . NEGATION__VALUE , null , msgs ) ; if ( newValue != null ) msgs = ( ( InternalEObject ) newValue ) . eInverseAdd ( this , EOPPOSITE_FEATURE_BASE - XtextPackage . NEGATION__VALUE , null , msgs ) ; msgs = basicSetValue ( newValue , msgs ) ; if ( msgs != null ) msgs . dispatch ( ) ; } else if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , XtextPackage . NEGATION__VALUE , newValue , newValue ) ) ; |
public class CmsSitesConfiguration { /** * Sets the site manager . < p >
* @ param siteManager the site manager to set */
public void setSiteManager ( CmsSiteManagerImpl siteManager ) { } } | m_siteManager = siteManager ; if ( CmsLog . INIT . isInfoEnabled ( ) ) { CmsLog . INIT . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . INIT_SITE_CONFIG_FINISHED_0 ) ) ; } |
public class AbstractInjectionEngine { /** * This method will register an instance of an InjectionMetaDataListener with the current
* engine instance . */
@ Override public void registerInjectionMetaDataListener ( InjectionMetaDataListener metaDataListener ) { } } | if ( metaDataListener == null ) { throw new IllegalArgumentException ( "A null InjectionMetaDataListener cannot be registered " + "with the injection engine." ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "registerInjectionMetaDataListener" , metaDataListener . getClass ( ) . getName ( ) ) ; metaDataListeners . add ( metaDataListener ) ; |
public class IconUtils { /** * Finds an icon from a root directory ( for an application and / or template ) .
* @ param rootDirectory a root directory
* @ return an existing file , or null if no icon was found */
public static File findIcon ( File rootDirectory ) { } } | File result = null ; File [ ] imageFiles = new File ( rootDirectory , Constants . PROJECT_DIR_DESC ) . listFiles ( new ImgeFileFilter ( ) ) ; if ( imageFiles != null ) { // A single image ? Take it . . .
if ( imageFiles . length == 1 ) { result = imageFiles [ 0 ] ; } // Otherwise , find the " application . " file
else for ( File f : imageFiles ) { if ( f . getName ( ) . toLowerCase ( ) . startsWith ( "application." ) ) result = f ; } } return result ; |
public class ImageLoaderCurrent { /** * Process image with full path name
* @ param in image stream
* @ param v visitor
* @ param numInodes number of indoes to read
* @ param skipBlocks skip blocks or not
* @ throws IOException if there is any error occurs */
private void processLocalNameINodes ( DataInputStream in , ImageVisitor v , long numInodes , boolean skipBlocks ) throws IOException { } } | // process root
processINode ( in , v , skipBlocks , "" ) ; numInodes -- ; while ( numInodes > 0 ) { numInodes -= processDirectory ( in , v , skipBlocks ) ; } |
public class Prefer { /** * Create a Prefer header representation from a header string .
* @ param value the header value
* @ return a Prefer object or null on an invalid string */
public static Prefer valueOf ( final String value ) { } } | if ( value != null ) { final Map < String , String > data = new HashMap < > ( ) ; final Set < String > params = new HashSet < > ( ) ; stream ( value . split ( ";" ) ) . map ( String :: trim ) . map ( pref -> pref . split ( "=" , 2 ) ) . forEach ( x -> { if ( x . length == 2 ) { data . put ( x [ 0 ] . trim ( ) , x [ 1 ] . trim ( ) ) ; } else { params . add ( x [ 0 ] . trim ( ) ) ; } } ) ; return new Prefer ( data . get ( PREFER_RETURN ) , parseParameter ( data . get ( PREFER_INCLUDE ) ) , parseParameter ( data . get ( PREFER_OMIT ) ) , params , data . get ( PREFER_HANDLING ) ) ; } return null ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.