signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class RequestBuilder { /** * Adds a file to the request also making the request to become a multi - part post request or removes any file registered * under the given name if the file value is null . */ public RequestBuilder < Resource > set ( final String name , final File file ) { } }
return set ( name , file != null ? new FileBody ( file ) : null ) ;
public class FnJodaToString { /** * It converts the input { @ link LocalTime } into a { @ link String } by means of the given pattern or style * ( depending on the value of formatType parameter ) . * @ param formatType the format { @ link FormatType } * @ param format string with the format used for the output * @ param locale { @ link Locale } to be used * @ return the { @ link String } created from the input and arguments */ public static final Function < LocalTime , String > fromLocalTime ( final FormatType formatType , final String format , final String locale ) { } }
return FnJodaString . localTimeToStr ( FnJodaString . FormatType . valueOf ( formatType . name ( ) ) , format , locale ) ;
public class Plan { /** * Adds a data sink to the set of sinks in this program . * @ param sink The data sink to add . */ public void addDataSink ( GenericDataSinkBase < ? > sink ) { } }
checkNotNull ( sink , "The data sink must not be null." ) ; if ( ! this . sinks . contains ( sink ) ) { this . sinks . add ( sink ) ; }
public class JsonMapper { /** * Serialize a list of objects to a JSON String . * @ param map The map of objects to serialize . */ public String serialize ( Map < String , T > map ) throws IOException { } }
StringWriter sw = new StringWriter ( ) ; JsonGenerator jsonGenerator = LoganSquare . JSON_FACTORY . createGenerator ( sw ) ; serialize ( map , jsonGenerator ) ; jsonGenerator . close ( ) ; return sw . toString ( ) ;
public class SharedResourceHolder { /** * Visible to unit tests . */ synchronized < T > T releaseInternal ( final Resource < T > resource , final T instance ) { } }
final Instance cached = instances . get ( resource ) ; if ( cached == null ) { throw new IllegalArgumentException ( "No cached instance found for " + resource ) ; } Preconditions . checkArgument ( instance == cached . payload , "Releasing the wrong instance" ) ; Preconditions . checkState ( cached . refcount > 0 , "Refcount has already reached zero" ) ; cached . refcount -- ; if ( cached . refcount == 0 ) { if ( GrpcUtil . IS_RESTRICTED_APPENGINE ) { // AppEngine must immediately release shared resources , particularly executors // which could retain request - scoped threads which become zombies after the request // completes . resource . close ( instance ) ; instances . remove ( resource ) ; } else { Preconditions . checkState ( cached . destroyTask == null , "Destroy task already scheduled" ) ; // Schedule a delayed task to destroy the resource . if ( destroyer == null ) { destroyer = destroyerFactory . createScheduledExecutor ( ) ; } cached . destroyTask = destroyer . schedule ( new LogExceptionRunnable ( new Runnable ( ) { @ Override public void run ( ) { synchronized ( SharedResourceHolder . this ) { // Refcount may have gone up since the task was scheduled . Re - check it . if ( cached . refcount == 0 ) { resource . close ( instance ) ; instances . remove ( resource ) ; if ( instances . isEmpty ( ) ) { destroyer . shutdown ( ) ; destroyer = null ; } } } } } ) , DESTROY_DELAY_SECONDS , TimeUnit . SECONDS ) ; } } // Always returning null return null ;
public class LazyFloatTreeReader { /** * Give the next float as a primitive . */ @ Override public float nextFloat ( boolean readStream ) throws IOException , ValueNotPresentException { } }
if ( ! readStream ) { return latestRead ; } if ( ! valuePresent ) { throw new ValueNotPresentException ( "Cannot materialize float.." ) ; } return readFloat ( ) ;
public class SnowizardClient { /** * Execute a request to the Snowizard service URL * @ param host * Host : Port pair to connect to * @ param count * Number of IDs to generate * @ return SnowizardResponse * @ throws IOException * Error in communicating with Snowizard */ @ Nullable public SnowizardResponse executeRequest ( final String host , final int count ) throws IOException { } }
final String uri = String . format ( "http://%s/?count=%d" , host , count ) ; final HttpGet request = new HttpGet ( uri ) ; request . addHeader ( HttpHeaders . ACCEPT , ProtocolBufferMediaType . APPLICATION_PROTOBUF ) ; request . addHeader ( HttpHeaders . USER_AGENT , getUserAgent ( ) ) ; SnowizardResponse snowizard = null ; try { final BasicHttpContext context = new BasicHttpContext ( ) ; final HttpResponse response = client . execute ( request , context ) ; final int code = response . getStatusLine ( ) . getStatusCode ( ) ; if ( code == HttpStatus . SC_OK ) { final HttpEntity entity = response . getEntity ( ) ; if ( entity != null ) { snowizard = SnowizardResponse . parseFrom ( entity . getContent ( ) ) ; } EntityUtils . consumeQuietly ( entity ) ; } } finally { request . releaseConnection ( ) ; } return snowizard ;
public class UniversalIdIntMessage { /** * Create a new { @ link UniversalIdIntMessage } object with specified id and * content . * @ param id * @ param content * @ return */ public static UniversalIdIntMessage newInstance ( Long id , byte [ ] content ) { } }
UniversalIdIntMessage msg = newInstance ( content ) ; msg . setId ( id ) ; return msg ;
public class V1InstanceCreator { /** * Create a new Theme with a name . * @ param name The initial name of the entity . * @ param project The Project this Theme will be in . * @ return A newly minted Theme that exists in the VersionOne system . */ public Theme theme ( String name , Project project ) { } }
return theme ( name , project , null ) ;
public class ContentExposingResource { /** * Utility function for building a Link . * @ param linkUri The URI for the link . * @ param relation the relation string . * @ return the string version of the link . */ private static String buildLink ( final URI linkUri , final String relation ) { } }
return Link . fromUri ( linkUri ) . rel ( relation ) . build ( ) . toString ( ) ;
public class Settings { /** * Sets a property value . * @ param key the key for the property * @ param value the value for the property */ public void setString ( @ NotNull final String key , @ NotNull final String value ) { } }
props . setProperty ( key , value ) ; LOGGER . debug ( "Setting: {}='{}'" , key , value ) ;
public class CollectionHelper { /** * Retrieve the tags and compile them from the different sources * @ param baseTags a list of based tags * @ param methodAnnotation The method annotation that could contain tags * @ param classAnnotation The class annotation that could contain tags * @ return The tags from the different sources */ public static Set < String > getTags ( Set < String > baseTags , ProbeTest methodAnnotation , ProbeTestClass classAnnotation ) { } }
Set < String > tags ; if ( baseTags == null ) { tags = new HashSet < > ( ) ; } else { tags = populateTags ( baseTags , new HashSet < String > ( ) ) ; } if ( classAnnotation != null && classAnnotation . tags ( ) != null ) { tags = populateTags ( new HashSet < > ( Arrays . asList ( classAnnotation . tags ( ) ) ) , tags ) ; } if ( methodAnnotation != null && methodAnnotation . tags ( ) != null ) { tags = populateTags ( new HashSet < > ( Arrays . asList ( methodAnnotation . tags ( ) ) ) , tags ) ; } return tags ;
public class JSDocInfoBuilder { /** * Records that the { @ link JSDocInfo } being built should have its { @ link * JSDocInfo # isStableIdGenerator ( ) } flag set to { @ code true } . * @ return { @ code true } if the stableIdGenerator flag was recorded and { @ code false } if it was * already recorded . */ public boolean recordMappedIdGenerator ( ) { } }
if ( ! currentInfo . isMappedIdGenerator ( ) ) { currentInfo . setMappedIdGenerator ( true ) ; populated = true ; return true ; } else { return false ; }
public class ReservationRepository { /** * Find reservations by reservation id ( not the auto - increment reservation . id ) */ public Reservation findByReservationId ( ReservationId reservationId ) throws NoResultException { } }
EntityManager entityManager = getEntityManager ( ) ; try { return entityManager . createQuery ( "SELECT t FROM io.motown.operatorapi.viewmodel.persistence.entities.Reservation AS t WHERE t.reservationId = :reservationId" , Reservation . class ) . setParameter ( "reservationId" , reservationId . getId ( ) ) . getSingleResult ( ) ; } finally { entityManager . close ( ) ; }
public class MediaservicesInner { /** * List Media Services accounts . * List Media Services accounts in the resource group . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; MediaServiceInner & gt ; object */ public Observable < Page < MediaServiceInner > > listByResourceGroupNextAsync ( final String nextPageLink ) { } }
return listByResourceGroupNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < MediaServiceInner > > , Page < MediaServiceInner > > ( ) { @ Override public Page < MediaServiceInner > call ( ServiceResponse < Page < MediaServiceInner > > response ) { return response . body ( ) ; } } ) ;
public class ConcurrentHashMapV7 { /** * Sets the ith element of given table , with volatile write * semantics . ( See above about use of putOrderedObject . ) */ static final < K , V > void setEntryAt ( HashEntry < K , V > [ ] tab , int i , HashEntry < K , V > e ) { } }
UNSAFE . putOrderedObject ( tab , ( ( long ) i << TSHIFT ) + TBASE , e ) ;
public class ProcessorDef { /** * Adds a source file set . * Files in these set will be processed by this configuration and will not * participate in the auction . * @ param srcSet * Fileset identifying files that should be processed by this * processor * @ throws BuildException * if processor definition is a reference */ public void addFileset ( final ConditionalFileSet srcSet ) throws BuildException { } }
if ( isReference ( ) ) { throw noChildrenAllowed ( ) ; } srcSet . setProject ( getProject ( ) ) ; this . srcSets . addElement ( srcSet ) ;
public class DeleteHsmRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteHsmRequest deleteHsmRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteHsmRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteHsmRequest . getHsmArn ( ) , HSMARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class URLConnection { /** * Return the value for the nth header field . Returns null if * there are fewer than n fields . This can be used in conjunction * with getHeaderFieldKey to iterate through all the headers in the message . */ public String getHeaderField ( int n ) { } }
try { getInputStream ( ) ; } catch ( Exception e ) { return null ; } MessageHeader props = properties ; return props == null ? null : props . getValue ( n ) ;
public class TasksImpl { /** * Adds a collection of tasks to the specified job . * Note that each task must have a unique ID . The Batch service may not return the results for each task in the same order the tasks were submitted in this request . If the server times out or the connection is closed during the request , the request may have been partially or fully processed , or not at all . In such cases , the user should re - issue the request . Note that it is up to the user to correctly handle failures when re - issuing a request . For example , you should use the same task IDs during a retry so that if the prior operation succeeded , the retry will not create extra tasks unexpectedly . If the response contains any tasks which failed to add , a client can retry the request . In a retry , it is most efficient to resubmit only tasks that failed to add , and to omit tasks that were successfully added on the first attempt . The maximum lifetime of a task from addition to completion is 180 days . If a task has not completed within 180 days of being added it will be terminated by the Batch service and left in whatever state it was in at that time . * @ param jobId The ID of the job to which the task collection is to be added . * @ param value The collection of tasks to add . The maximum count of tasks is 100 . The total serialized size of this collection must be less than 1MB . If it is greater than 1MB ( for example if each task has 100 ' s of resource files or environment variables ) , the request will fail with code ' RequestBodyTooLarge ' and should be retried again with fewer tasks . * @ 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 < TaskAddCollectionResult > addCollectionAsync ( String jobId , List < TaskAddParameter > value , final ServiceCallback < TaskAddCollectionResult > serviceCallback ) { } }
return ServiceFuture . fromHeaderResponse ( addCollectionWithServiceResponseAsync ( jobId , value ) , serviceCallback ) ;
public class ProtoParser { /** * com / dyuproject / protostuff / parser / ProtoParser . g : 128:1 : header _ package [ Proto proto ] : PKG ( FULL _ ID | var ) SEMICOLON ; */ public final ProtoParser . header_package_return header_package ( Proto proto ) throws RecognitionException { } }
ProtoParser . header_package_return retval = new ProtoParser . header_package_return ( ) ; retval . start = input . LT ( 1 ) ; Object root_0 = null ; Token PKG36 = null ; Token FULL_ID37 = null ; Token SEMICOLON39 = null ; ProtoParser . var_return var38 = null ; Object PKG36_tree = null ; Object FULL_ID37_tree = null ; Object SEMICOLON39_tree = null ; String value = null ; try { // com / dyuproject / protostuff / parser / ProtoParser . g : 132:5 : ( PKG ( FULL _ ID | var ) SEMICOLON ) // com / dyuproject / protostuff / parser / ProtoParser . g : 132:9 : PKG ( FULL _ ID | var ) SEMICOLON { root_0 = ( Object ) adaptor . nil ( ) ; PKG36 = ( Token ) match ( input , PKG , FOLLOW_PKG_in_header_package889 ) ; if ( state . failed ) return retval ; if ( state . backtracking == 0 ) { PKG36_tree = ( Object ) adaptor . create ( PKG36 ) ; adaptor . addChild ( root_0 , PKG36_tree ) ; } // com / dyuproject / protostuff / parser / ProtoParser . g : 132:13 : ( FULL _ ID | var ) int alt8 = 2 ; switch ( input . LA ( 1 ) ) { case FULL_ID : { alt8 = 1 ; } break ; case TO : case PKG : case SYNTAX : case IMPORT : case OPTION : case MESSAGE : case SERVICE : case ENUM : case REQUIRED : case OPTIONAL : case REPEATED : case EXTENSIONS : case EXTEND : case GROUP : case RPC : case RETURNS : case INT32 : case INT64 : case UINT32 : case UINT64 : case SINT32 : case SINT64 : case FIXED32 : case FIXED64 : case SFIXED32 : case SFIXED64 : case FLOAT : case DOUBLE : case BOOL : case STRING : case BYTES : case DEFAULT : case MAX : case VOID : case ID : { alt8 = 2 ; } break ; default : if ( state . backtracking > 0 ) { state . failed = true ; return retval ; } NoViableAltException nvae = new NoViableAltException ( "" , 8 , 0 , input ) ; throw nvae ; } switch ( alt8 ) { case 1 : // com / dyuproject / protostuff / parser / ProtoParser . g : 132:14 : FULL _ ID { FULL_ID37 = ( Token ) match ( input , FULL_ID , FOLLOW_FULL_ID_in_header_package892 ) ; if ( state . failed ) return retval ; if ( state . backtracking == 0 ) { FULL_ID37_tree = ( Object ) adaptor . create ( FULL_ID37 ) ; adaptor . addChild ( root_0 , FULL_ID37_tree ) ; } if ( state . backtracking == 0 ) { value = ( FULL_ID37 != null ? FULL_ID37 . getText ( ) : null ) ; } } break ; case 2 : // com / dyuproject / protostuff / parser / ProtoParser . g : 132:51 : var { pushFollow ( FOLLOW_var_in_header_package898 ) ; var38 = var ( ) ; state . _fsp -- ; if ( state . failed ) return retval ; if ( state . backtracking == 0 ) adaptor . addChild ( root_0 , var38 . getTree ( ) ) ; if ( state . backtracking == 0 ) { value = ( var38 != null ? input . toString ( var38 . start , var38 . stop ) : null ) ; } } break ; } SEMICOLON39 = ( Token ) match ( input , SEMICOLON , FOLLOW_SEMICOLON_in_header_package903 ) ; if ( state . failed ) return retval ; if ( state . backtracking == 0 ) { if ( proto . getPackageName ( ) != null ) throw new IllegalStateException ( "Multiple package definitions." ) ; proto . setPackageName ( value ) ; if ( ! proto . annotations . isEmpty ( ) ) throw new IllegalStateException ( "Misplaced annotations: " + proto . annotations ) ; } } 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 { } return retval ;
public class SlimClockSkin { /** * * * * * * Initialization * * * * * */ @ Override protected void initGraphics ( ) { } }
// Set initial size if ( Double . compare ( clock . getPrefWidth ( ) , 0.0 ) <= 0 || Double . compare ( clock . getPrefHeight ( ) , 0.0 ) <= 0 || Double . compare ( clock . getWidth ( ) , 0.0 ) <= 0 || Double . compare ( clock . getHeight ( ) , 0.0 ) <= 0 ) { if ( clock . getPrefWidth ( ) > 0 && clock . getPrefHeight ( ) > 0 ) { clock . setPrefSize ( clock . getPrefWidth ( ) , clock . getPrefHeight ( ) ) ; } else { clock . setPrefSize ( PREFERRED_WIDTH , PREFERRED_HEIGHT ) ; } } ZonedDateTime time = clock . getTime ( ) ; secondBackgroundCircle = new Circle ( PREFERRED_WIDTH * 0.5 , PREFERRED_HEIGHT * 0.5 , PREFERRED_WIDTH * 0.48 ) ; secondBackgroundCircle . setStrokeWidth ( PREFERRED_WIDTH * 0.008 ) ; secondBackgroundCircle . setStrokeType ( StrokeType . CENTERED ) ; secondBackgroundCircle . setStrokeLineCap ( StrokeLineCap . ROUND ) ; secondBackgroundCircle . setFill ( null ) ; secondBackgroundCircle . setStroke ( Helper . getTranslucentColorFrom ( clock . getSecondColor ( ) , 0.2 ) ) ; secondBackgroundCircle . setVisible ( clock . isSecondsVisible ( ) ) ; secondBackgroundCircle . setManaged ( clock . isSecondsVisible ( ) ) ; dateText = new Text ( dateTextFormatter . format ( time ) ) ; dateText . setVisible ( clock . isDayVisible ( ) ) ; dateText . setManaged ( clock . isDayVisible ( ) ) ; dateNumbers = new Text ( dateNumberFormatter . format ( time ) ) ; dateNumbers . setVisible ( clock . isDateVisible ( ) ) ; dateNumbers . setManaged ( clock . isDateVisible ( ) ) ; hour = new Text ( HOUR_FORMATTER . format ( time ) ) ; hour . setFill ( clock . getHourColor ( ) ) ; minute = new Text ( MINUTE_FORMATTER . format ( time ) ) ; minute . setFill ( clock . getMinuteColor ( ) ) ; secondArc = new Arc ( PREFERRED_WIDTH * 0.5 , PREFERRED_HEIGHT * 0.5 , PREFERRED_WIDTH * 0.96 , PREFERRED_WIDTH * 0.48 , 90 , ( - 6 * clock . getTime ( ) . getSecond ( ) ) ) ; secondArc . setStrokeWidth ( PREFERRED_WIDTH * 0.008 ) ; secondArc . setStrokeType ( StrokeType . CENTERED ) ; secondArc . setStrokeLineCap ( StrokeLineCap . ROUND ) ; secondArc . setFill ( null ) ; secondArc . setStroke ( clock . getSecondColor ( ) ) ; secondArc . setVisible ( clock . isSecondsVisible ( ) ) ; secondArc . setManaged ( clock . isSecondsVisible ( ) ) ; pane = new Pane ( secondBackgroundCircle , dateText , dateNumbers , hour , minute , secondArc ) ; pane . setBorder ( new Border ( new BorderStroke ( clock . getBorderPaint ( ) , BorderStrokeStyle . SOLID , new CornerRadii ( 1024 ) , new BorderWidths ( clock . getBorderWidth ( ) ) ) ) ) ; pane . setBackground ( new Background ( new BackgroundFill ( clock . getBackgroundPaint ( ) , new CornerRadii ( 1024 ) , Insets . EMPTY ) ) ) ; getChildren ( ) . setAll ( pane ) ;
public class AWSJavaMailTransport { /** * Collates any addresses into the message object . All addresses in the Address array * become of type TO unless they already exist in the Message header . If * they are in the Message header they will stay of the same type . Any * duplicate addresses are removed . Type BCC and then CC takes precedence * over TO when duplicates exist . If any address is invalid an exception is * thrown . */ private void collateRecipients ( Message m , Address [ ] addresses ) throws MessagingException { } }
if ( ! isNullOrEmpty ( addresses ) ) { Hashtable < Address , Message . RecipientType > addressTable = new Hashtable < Address , Message . RecipientType > ( ) ; for ( Address a : addresses ) { addressTable . put ( a , Message . RecipientType . TO ) ; } if ( ! isNullOrEmpty ( m . getRecipients ( Message . RecipientType . TO ) ) ) { for ( Address a : m . getRecipients ( Message . RecipientType . TO ) ) { addressTable . put ( a , Message . RecipientType . TO ) ; } } if ( ! isNullOrEmpty ( m . getRecipients ( Message . RecipientType . CC ) ) ) { for ( Address a : m . getRecipients ( Message . RecipientType . CC ) ) { addressTable . put ( a , Message . RecipientType . CC ) ; } } if ( ! isNullOrEmpty ( m . getRecipients ( Message . RecipientType . BCC ) ) ) { for ( Address a : m . getRecipients ( Message . RecipientType . BCC ) ) { addressTable . put ( a , Message . RecipientType . BCC ) ; } } // Clear the original recipients for collation m . setRecipients ( Message . RecipientType . TO , new Address [ 0 ] ) ; m . setRecipients ( Message . RecipientType . CC , new Address [ 0 ] ) ; m . setRecipients ( Message . RecipientType . BCC , new Address [ 0 ] ) ; Iterator < Address > aIter = addressTable . keySet ( ) . iterator ( ) ; while ( aIter . hasNext ( ) ) { Address a = aIter . next ( ) ; m . addRecipient ( addressTable . get ( a ) , a ) ; } // Simple E - mail needs at least one TO address , so add one if there isn ' t one if ( m . getRecipients ( Message . RecipientType . TO ) == null || m . getRecipients ( Message . RecipientType . TO ) . length == 0 ) { m . setRecipient ( Message . RecipientType . TO , addressTable . keySet ( ) . iterator ( ) . next ( ) ) ; } }
public class Project { /** * Retrieves the total estimate for all stories and defects in this project * optionally filtered . * @ param filter Criteria to filter stories and defects on . * @ param includeChildProjects If true , include open sub projects , otherwise * only include this project . * @ return total estimate of selected Workitems . */ public Double getTotalEstimate ( PrimaryWorkitemFilter filter , boolean includeChildProjects ) { } }
filter = ( filter != null ) ? filter : new PrimaryWorkitemFilter ( ) ; return getRollup ( "Workitems:PrimaryWorkitem" , "Estimate" , filter , includeChildProjects ) ;
public class SphinxLinks { /** * Clone the python unicode translate method in legacy languages younger than python . python * docutils is public domain . * @ param text * string for which translation is needed * @ param patterns * Array of arrays { target , replacement ) . The target is substituted by the replacement . * @ return The translated string * @ see http : / / docs . python . org / 3 / library / stdtypes . html # str . translate */ public String translate ( String text , List < String [ ] > patterns ) { } }
String res = text ; for ( String [ ] each : patterns ) { res = res . replaceAll ( "(?ms)" + each [ 0 ] , each [ 1 ] ) ; } return res ;
public class MappingError { /** * @ inheritDoc * @ see org . kie . compiler . DroolsError # getMessage ( ) */ public String getMessage ( ) { } }
switch ( this . errorCode ) { case ERROR_UNUSED_TOKEN : return "Warning, the token " + this . token + " not used in the mapping." ; case ERROR_UNDECLARED_TOKEN : return "Warning, the token " + this . token + " not found in the expression. (May not be a problem)." ; case ERROR_INVALID_TOKEN : return "Invalid token declaration at offset " + this . offset + ": " + this . token ; case ERROR_UNMATCHED_BRACES : return "Unexpected } found at offset " + this . offset ; default : return "Unkown error at offset: " + this . offset ; }
public class BreadthFirstIterator { /** * Gets the next element in the iteration . * @ return the next element in the iteration . * @ throws java . util . NoSuchElementException if the iteration has exhausted all elements . * @ see java . util . Iterator # next ( ) * @ see # hasNext ( ) */ @ Override public T next ( ) { } }
Assert . isTrue ( hasNext ( ) , new NoSuchElementException ( "The iteration has no more elements!" ) ) ; T value = iterators . peek ( ) . next ( ) ; nextCalled . set ( true ) ; return value ;
public class AbstractApplicationFrame { /** * { @ inheritDoc } */ @ Override protected void onAfterInitialize ( ) { } }
super . onAfterInitialize ( ) ; menu = newDesktopMenu ( this ) ; setJMenuBar ( menu . getMenubar ( ) ) ; setToolBar ( toolbar = newJToolBar ( ) ) ; getContentPane ( ) . add ( mainComponent = newMainComponent ( ) ) ; Optional < BufferedImage > optionalIcon = getIcon ( newIconPath ( ) ) ; if ( optionalIcon . isPresent ( ) ) { setIconImage ( icon = optionalIcon . get ( ) ) ; } setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE ) ; final GraphicsEnvironment ge = GraphicsEnvironment . getLocalGraphicsEnvironment ( ) ; final GraphicsDevice [ ] gs = ge . getScreenDevices ( ) ; setSize ( ScreenSizeExtensions . getScreenWidth ( gs [ 0 ] ) , ScreenSizeExtensions . getScreenHeight ( gs [ 0 ] ) ) ; setVisible ( true ) ; // Set default look and feel . . . setDefaultLookAndFeel ( newLookAndFeels ( ) , this ) ;
public class NetworkUtil { /** * Get a local , IP4 Address , preferable a non - loopback address which is bound to an interface . * @ return * @ throws UnknownHostException * @ throws SocketException */ public static InetAddress getLocalAddress ( ) throws UnknownHostException , SocketException { } }
InetAddress addr = InetAddress . getLocalHost ( ) ; NetworkInterface nif = NetworkInterface . getByInetAddress ( addr ) ; if ( addr . isLoopbackAddress ( ) || addr instanceof Inet6Address || nif == null ) { // Find local address that isn ' t a loopback address InetAddress lookedUpAddr = findLocalAddressViaNetworkInterface ( ) ; // If a local , multicast enabled address can be found , use it . Otherwise // we are using the local address , which might not be what you want addr = lookedUpAddr != null ? lookedUpAddr : InetAddress . getByName ( "127.0.0.1" ) ; } return addr ;
public class IterableOfProtosSubject { /** * Checks that a actual iterable contains none of the excluded objects or fails . ( Duplicates are * irrelevant to this test , which fails if any of the actual elements equal any of the excluded . ) */ public void containsNoneOf ( @ NullableDecl Object firstExcluded , @ NullableDecl Object secondExcluded , @ NullableDecl Object ... restOfExcluded ) { } }
delegate ( ) . containsNoneOf ( firstExcluded , secondExcluded , restOfExcluded ) ;
public class PortletAdministrationHelper { /** * Update permissions for a given owner , activity , and portlet definition combination . Adds new principals ' permissions passed in and removes * principals ' permissions if not in the list for the given activity . */ private void updatePermissions ( IPortletDefinition def , Set < IGroupMember > newPrincipals , String owner , String activity ) { } }
final String portletTargetId = PermissionHelper . permissionTargetIdForPortletDefinition ( def ) ; final IUpdatingPermissionManager pm = authorizationService . newUpdatingPermissionManager ( owner ) ; /* Create the new permissions array */ final List < IPermission > newPermissions = new ArrayList < > ( ) ; for ( final IGroupMember newPrincipal : newPrincipals ) { final IAuthorizationPrincipal authorizationPrincipal = authorizationService . newPrincipal ( newPrincipal ) ; final IPermission permission = pm . newPermission ( authorizationPrincipal ) ; permission . setType ( IPermission . PERMISSION_TYPE_GRANT ) ; permission . setActivity ( activity ) ; permission . setTarget ( portletTargetId ) ; newPermissions . add ( permission ) ; logger . trace ( "In updatePermissions() - adding a new permission of: {}" , permission ) ; } /* Remove former permissions for this portlet / activity */ final IPermission [ ] oldPermissions = pm . getPermissions ( activity , portletTargetId ) ; pm . removePermissions ( oldPermissions ) ; /* Add the new permissions */ pm . addPermissions ( newPermissions . toArray ( new IPermission [ newPermissions . size ( ) ] ) ) ;
public class VdmRefreshAction { /** * Adds the refresh resource actions to the context menu . * @ param menu * context menu to add actions to */ @ SuppressWarnings ( "unchecked" ) @ Override public void fillContextMenu ( IMenuManager menu ) { } }
IStructuredSelection selection = ( IStructuredSelection ) getContext ( ) . getSelection ( ) ; boolean hasClosedProjects = false ; Iterator < Object > resources = selection . iterator ( ) ; while ( resources . hasNext ( ) && ( ! hasClosedProjects ) ) { Object next = resources . next ( ) ; IProject project = null ; if ( next instanceof IProject ) { project = ( IProject ) next ; } else if ( next instanceof IAdaptable ) { project = ( IProject ) ( ( IAdaptable ) next ) . getAdapter ( IProject . class ) ; } if ( project == null ) { continue ; } if ( ! project . isOpen ( ) ) { hasClosedProjects = true ; } } if ( ! hasClosedProjects ) { refreshAction . selectionChanged ( selection ) ; menu . appendToGroup ( ICommonMenuConstants . GROUP_BUILD , refreshAction ) ; }
public class JSBrowseCursor { /** * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . impl . interfaces . BrowseCursor # finished ( ) */ public void finished ( ) { } }
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "finished" ) ; if ( msgStoreNonLockingCursor != null ) { msgStoreNonLockingCursor . finished ( ) ; } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "finished" ) ;
public class Executor { /** * TODO : purge this once RM is doing the work * @ throws IOException */ protected void setupInitialRegistryPaths ( ) throws IOException { } }
if ( registryOperations instanceof RMRegistryOperationsService ) { RMRegistryOperationsService rmRegOperations = ( RMRegistryOperationsService ) registryOperations ; rmRegOperations . initUserRegistryAsync ( RegistryUtils . currentUser ( ) ) ; }
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public CFCRetired1 createCFCRetired1FromString ( EDataType eDataType , String initialValue ) { } }
CFCRetired1 result = CFCRetired1 . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class ScriptBuilder { /** * Adds a copy of the given byte array as a data element ( i . e . PUSHDATA ) at the given index in the program . */ public ScriptBuilder data ( int index , byte [ ] data ) { } }
// implements BIP62 byte [ ] copy = Arrays . copyOf ( data , data . length ) ; int opcode ; if ( data . length == 0 ) { opcode = OP_0 ; } else if ( data . length == 1 ) { byte b = data [ 0 ] ; if ( b >= 1 && b <= 16 ) opcode = Script . encodeToOpN ( b ) ; else opcode = 1 ; } else if ( data . length < OP_PUSHDATA1 ) { opcode = data . length ; } else if ( data . length < 256 ) { opcode = OP_PUSHDATA1 ; } else if ( data . length < 65536 ) { opcode = OP_PUSHDATA2 ; } else { throw new RuntimeException ( "Unimplemented" ) ; } return addChunk ( index , new ScriptChunk ( opcode , copy ) ) ;
public class NetworkUtil { /** * Replace expression $ { host } and $ { ip } with the localhost name or IP in the given string . * In addition the notation $ { env : ENV _ VAR } and $ { prop : sysprop } can be used to refer to environment * and system properties respectively . * @ param pValue value to examine * @ return the value with the variables replaced . * @ throws IllegalArgumentException when the expression is unknown or an error occurs when extracting the host name */ public static String replaceExpression ( String pValue ) { } }
if ( pValue == null ) { return null ; } Matcher matcher = EXPRESSION_EXTRACTOR . matcher ( pValue ) ; StringBuffer ret = new StringBuffer ( ) ; try { while ( matcher . find ( ) ) { String var = matcher . group ( 1 ) ; String value ; if ( var . equalsIgnoreCase ( "host" ) ) { value = getLocalAddress ( ) . getHostName ( ) ; } else if ( var . equalsIgnoreCase ( "ip" ) ) { value = getLocalAddress ( ) . getHostAddress ( ) ; } else { String key = extractKey ( var , "env" ) ; if ( key != null ) { value = System . getenv ( key ) ; } else { key = extractKey ( var , "prop" ) ; if ( key != null ) { value = System . getProperty ( key ) ; } else { throw new IllegalArgumentException ( "Unknown expression " + var + " in " + pValue ) ; } } } matcher . appendReplacement ( ret , value != null ? value . trim ( ) : null ) ; } matcher . appendTail ( ret ) ; } catch ( IOException e ) { throw new IllegalArgumentException ( "Cannot lookup host" + e , e ) ; } return ret . toString ( ) ;
public class ViewQuery { /** * Limit the number of the returned documents to the specified number . * @ param limit the number of documents to return . * @ return the { @ link ViewQuery } object for proper chaining . */ public ViewQuery limit ( final int limit ) { } }
if ( limit < 0 ) { throw new IllegalArgumentException ( "Limit must be >= 0." ) ; } params [ PARAM_LIMIT_OFFSET ] = "limit" ; params [ PARAM_LIMIT_OFFSET + 1 ] = Integer . toString ( limit ) ; return this ;
public class MessageCreator { /** * Add the requested post parameters to the Request . * @ param request Request to add post params to */ private void addPostParams ( final Request request ) { } }
if ( author != null ) { request . addPostParam ( "Author" , author ) ; } if ( attributes != null ) { request . addPostParam ( "Attributes" , attributes ) ; } if ( dateCreated != null ) { request . addPostParam ( "DateCreated" , dateCreated . toString ( ) ) ; } if ( dateUpdated != null ) { request . addPostParam ( "DateUpdated" , dateUpdated . toString ( ) ) ; } if ( body != null ) { request . addPostParam ( "Body" , body ) ; }
public class SyncGroupsInner { /** * Triggers a sync group synchronization . * @ 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 databaseName The name of the database on which the sync group is hosted . * @ param syncGroupName The name of the sync group . * @ 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 < Void > triggerSyncAsync ( String resourceGroupName , String serverName , String databaseName , String syncGroupName , final ServiceCallback < Void > serviceCallback ) { } }
return ServiceFuture . fromResponse ( triggerSyncWithServiceResponseAsync ( resourceGroupName , serverName , databaseName , syncGroupName ) , serviceCallback ) ;
public class CreditBasedPartitionRequestClientHandler { /** * Checks for an error and rethrows it if one was reported . */ private void checkError ( ) throws IOException { } }
final Throwable t = channelError . get ( ) ; if ( t != null ) { if ( t instanceof IOException ) { throw ( IOException ) t ; } else { throw new IOException ( "There has been an error in the channel." , t ) ; } }
public class AppServicePlansInner { /** * Get the send key name and value of a Hybrid Connection . * Get the send key name and value of a Hybrid Connection . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the App Service plan . * @ param namespaceName The name of the Service Bus namespace . * @ param relayName The name of the Service Bus relay . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the HybridConnectionKeyInner object */ public Observable < HybridConnectionKeyInner > listHybridConnectionKeysAsync ( String resourceGroupName , String name , String namespaceName , String relayName ) { } }
return listHybridConnectionKeysWithServiceResponseAsync ( resourceGroupName , name , namespaceName , relayName ) . map ( new Func1 < ServiceResponse < HybridConnectionKeyInner > , HybridConnectionKeyInner > ( ) { @ Override public HybridConnectionKeyInner call ( ServiceResponse < HybridConnectionKeyInner > response ) { return response . body ( ) ; } } ) ;
public class ResourceBundlesHandlerImpl { /** * Reads all the members of a bundle and executes all associated * postprocessors . * @ param bundle * the bundle * @ param variants * the variant map * @ param the * bundling processing status * @ param the * flag indicating if we should process the bundle or not * @ return the resource bundle content , where all postprocessors have been * executed */ private JoinableResourceBundleContent joinAndPostprocessBundle ( JoinableResourceBundle bundle , Map < String , String > variants , BundleProcessingStatus status ) { } }
JoinableResourceBundleContent bundleContent = new JoinableResourceBundleContent ( ) ; StringBuffer bundleData = new StringBuffer ( ) ; StringBuffer store = null ; try { boolean firstPath = true ; // Run through all the files belonging to the bundle Iterator < BundlePath > pathIterator = null ; if ( bundle . getInclusionPattern ( ) . isIncludeOnlyOnDebug ( ) ) { pathIterator = bundle . getItemDebugPathList ( variants ) . iterator ( ) ; } else { pathIterator = bundle . getItemPathList ( variants ) . iterator ( ) ; } for ( Iterator < BundlePath > it = pathIterator ; it . hasNext ( ) ; ) { // File is first created in memory using a stringwriter . StringWriter writer = new StringWriter ( ) ; BufferedWriter bwriter = new BufferedWriter ( writer ) ; String path = ( String ) it . next ( ) . getPath ( ) ; if ( LOGGER . isDebugEnabled ( ) ) LOGGER . debug ( "Adding file [" + path + "] to bundle " + bundle . getId ( ) ) ; // Get a reader on the resource , with appropriate encoding Reader rd = null ; try { rd = resourceHandler . getResource ( bundle , path , true ) ; } catch ( ResourceNotFoundException e ) { // If a mapped file does not exist , a warning is issued and // process continues normally . LOGGER . warn ( "A mapped resource was not found: [" + path + "]. Please check your configuration" ) ; continue ; } // Update the status . status . setLastPathAdded ( path ) ; rd = new UnicodeBOMReader ( rd , config . getResourceCharset ( ) ) ; if ( ! firstPath && ( ( UnicodeBOMReader ) rd ) . hasBOM ( ) ) { ( ( UnicodeBOMReader ) rd ) . skipBOM ( ) ; } else { firstPath = false ; } IOUtils . copy ( rd , bwriter , true ) ; // Add new line at the end if it doesn ' t exist StringBuffer buffer = writer . getBuffer ( ) ; if ( ! buffer . toString ( ) . endsWith ( StringUtils . STR_LINE_FEED ) ) { buffer . append ( StringUtils . STR_LINE_FEED ) ; } // Do unitary postprocessing . status . setProcessingType ( BundleProcessingStatus . FILE_PROCESSING_TYPE ) ; bundleData . append ( executeUnitaryPostProcessing ( bundle , status , buffer , this . unitaryPostProcessor ) ) ; } // Post process bundle as needed store = executeBundlePostProcessing ( bundle , status , bundleData ) ; } catch ( IOException e ) { throw new BundlingProcessException ( "Unexpected IOException generating collected file [" + bundle . getId ( ) + "]." , e ) ; } bundleContent . setContent ( store ) ; return bundleContent ;
public class RegistriesInner { /** * Updates the policies for the specified container registry . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param registryPoliciesUpdateParameters The parameters for updating policies of a container registry . * @ 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 RegistryPoliciesInner object if successful . */ public RegistryPoliciesInner beginUpdatePolicies ( String resourceGroupName , String registryName , RegistryPoliciesInner registryPoliciesUpdateParameters ) { } }
return beginUpdatePoliciesWithServiceResponseAsync ( resourceGroupName , registryName , registryPoliciesUpdateParameters ) . toBlocking ( ) . single ( ) . body ( ) ;
public class SimpleDigitalSkin { /** * * * * * * Resizing * * * * * */ private void resizeStaticText ( ) { } }
double maxWidth = size * 0.455 ; double fontSize = size * 0.08082707 ; titleText . setFont ( Fonts . latoBold ( fontSize ) ) ; if ( titleText . getLayoutBounds ( ) . getWidth ( ) > maxWidth ) { Helper . adjustTextSize ( titleText , maxWidth , fontSize ) ; } titleText . relocate ( ( size - titleText . getLayoutBounds ( ) . getWidth ( ) ) * 0.5 , size * 0.22180451 ) ;
public class PathParameterSessionConfig { /** * Return the specified URL with the specified session identifier * suitably encoded . * @ param url URL to be encoded with the session id * @ param sessionId Session id to be included in the encoded URL */ @ Override public String rewriteUrl ( final String url , final String sessionId ) { } }
if ( ( url == null ) || ( sessionId == null ) ) return ( url ) ; String path = url ; String query = "" ; String anchor = "" ; String fragment = "" ; int question = url . indexOf ( '?' ) ; if ( question >= 0 ) { path = url . substring ( 0 , question ) ; query = url . substring ( question ) ; } int pound = path . indexOf ( '#' ) ; if ( pound >= 0 ) { anchor = path . substring ( pound ) ; path = path . substring ( 0 , pound ) ; } int fragmentIndex = path . lastIndexOf ( ';' ) ; if ( fragmentIndex >= 0 ) { fragment = path . substring ( fragmentIndex ) ; path = path . substring ( 0 , fragmentIndex ) ; } StringBuilder sb = new StringBuilder ( path ) ; if ( sb . length ( ) > 0 ) { // jsessionid can ' t be first . if ( fragmentIndex > 0 ) { if ( fragment . contains ( name ) ) { // this does not necessarily mean that this parameter is present . It could be part of the value , or the // name could be a substring of a larger key name sb . append ( ';' ) ; // we make sure we append the fragment portion String key = null ; StringBuilder paramBuilder = new StringBuilder ( ) ; for ( int i = 1 ; i < fragment . length ( ) ; ++ i ) { char c = fragment . charAt ( i ) ; if ( key == null ) { if ( c == '&' || c == '=' ) { key = paramBuilder . toString ( ) ; paramBuilder . setLength ( 0 ) ; if ( c == '&' ) { if ( ! key . equals ( name ) ) { // we don ' t append if it matches the name sb . append ( key ) ; sb . append ( '&' ) ; } key = null ; } } else { paramBuilder . append ( c ) ; } } else { if ( c == '&' ) { String value = paramBuilder . toString ( ) ; paramBuilder . setLength ( 0 ) ; if ( ! key . equals ( name ) ) { // we don ' t append if it matches the name sb . append ( key ) ; sb . append ( '=' ) ; sb . append ( value ) ; sb . append ( '&' ) ; } key = null ; } else { paramBuilder . append ( c ) ; } } } if ( paramBuilder . length ( ) > 0 ) { if ( key == null ) { key = paramBuilder . toString ( ) ; if ( ! key . equals ( name ) ) { // we don ' t append if it matches the name sb . append ( key ) ; sb . append ( '&' ) ; } } else { String value = paramBuilder . toString ( ) ; if ( ! key . equals ( name ) ) { // we don ' t append if it matches the name sb . append ( key ) ; sb . append ( '=' ) ; sb . append ( value ) ; sb . append ( '&' ) ; } } } } else { sb . append ( fragment ) ; sb . append ( "&" ) ; } } else { sb . append ( ';' ) ; } sb . append ( name ) ; sb . append ( '=' ) ; sb . append ( sessionId ) ; } sb . append ( anchor ) ; sb . append ( query ) ; UndertowLogger . SESSION_LOGGER . tracef ( "Rewrote URL from %s to %s" , url , sessionId ) ; return ( sb . toString ( ) ) ;
public class JarResource { protected boolean checkConnection ( ) { } }
super . checkConnection ( ) ; try { if ( _jarConnection != _connection ) newConnection ( ) ; } catch ( IOException e ) { LogSupport . ignore ( log , e ) ; _jarConnection = null ; } return _jarConnection != null ;
public class JDBC4ResultSet { /** * language . */ @ Override public Date getDate ( int columnIndex ) throws SQLException { } }
checkColumnBounds ( columnIndex ) ; try { Timestamp ts = table . getTimestampAsSqlTimestamp ( columnIndex - 1 ) ; Date result = null ; if ( ts != null ) { result = new Date ( ts . getTime ( ) ) ; } return result ; } catch ( Exception x ) { throw SQLError . get ( x ) ; }
public class AWSGreengrassClient { /** * Retrieves a list of logger definitions . * @ param listLoggerDefinitionsRequest * @ return Result of the ListLoggerDefinitions operation returned by the service . * @ sample AWSGreengrass . ListLoggerDefinitions * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / greengrass - 2017-06-07 / ListLoggerDefinitions " * target = " _ top " > AWS API Documentation < / a > */ @ Override public ListLoggerDefinitionsResult listLoggerDefinitions ( ListLoggerDefinitionsRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeListLoggerDefinitions ( request ) ;
public class SpringSecurityXmAuthenticationContext { /** * { @ inheritDoc } */ @ Override public boolean isRememberMe ( ) { } }
return getAuthentication ( ) . filter ( auth -> REMEMBER_ME_AUTH_CLASS . isAssignableFrom ( auth . getClass ( ) ) ) . isPresent ( ) ;
public class TimeSeriesMetricDeltaSet { /** * Apply a single - argument function to the set . * @ param fn A function that takes a TimeSeriesMetricDelta and returns a TimeSeriesMetricDelta . * @ return The mapped TimeSeriesMetricDelta from this set . */ public TimeSeriesMetricDeltaSet mapOptional ( Function < ? super MetricValue , Optional < ? extends MetricValue > > fn ) { } }
return values_ . map ( fn , ( x ) -> x . entrySet ( ) . stream ( ) . map ( ( entry ) -> apply_fn_optional_ ( entry , fn ) ) ) . mapCombine ( opt_scalar -> opt_scalar . map ( TimeSeriesMetricDeltaSet :: new ) . orElseGet ( ( ) -> new TimeSeriesMetricDeltaSet ( MetricValue . EMPTY ) ) , TimeSeriesMetricDeltaSet :: new ) ;
public class DES { /** * DES算法 , 解密 * @ param data 待解密字符串 * @ param key 解密私钥 , 长度不能够小于8位 * @ return 解密后的字节数组 * @ throws Exception 异常 */ public static String decrypt ( String key , String data ) { } }
if ( data == null ) return null ; try { DESKeySpec dks = new DESKeySpec ( key . getBytes ( ) ) ; SecretKeyFactory keyFactory = SecretKeyFactory . getInstance ( "DES" ) ; // key的长度不能够小于8位字节 Key secretKey = keyFactory . generateSecret ( dks ) ; Cipher cipher = Cipher . getInstance ( ALGORITHM_DES ) ; AlgorithmParameterSpec paramSpec = new IvParameterSpec ( IV_PARAMS_BYTES ) ; cipher . init ( Cipher . DECRYPT_MODE , secretKey , paramSpec ) ; return new String ( cipher . doFinal ( hex2byte ( data . getBytes ( ) ) ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; return data ; }
public class CommerceAvailabilityEstimateUtil { /** * Returns the commerce availability estimate with the primary key or throws a { @ link NoSuchAvailabilityEstimateException } if it could not be found . * @ param commerceAvailabilityEstimateId the primary key of the commerce availability estimate * @ return the commerce availability estimate * @ throws NoSuchAvailabilityEstimateException if a commerce availability estimate with the primary key could not be found */ public static CommerceAvailabilityEstimate findByPrimaryKey ( long commerceAvailabilityEstimateId ) throws com . liferay . commerce . exception . NoSuchAvailabilityEstimateException { } }
return getPersistence ( ) . findByPrimaryKey ( commerceAvailabilityEstimateId ) ;
public class Pnky { /** * See { @ link # first ( Iterable ) } */ @ SafeVarargs public static < V > PnkyPromise < V > first ( final PnkyPromise < ? extends V > ... promises ) { } }
return first ( Lists . newArrayList ( promises ) ) ;
public class XmlRepositoryFactory { /** * Adds / updates specific query ( from { @ link Element } into Repository * @ param element element which would be read */ public static void add ( Element element ) { } }
AssertUtils . assertNotNull ( element ) ; ProcessedInput processedInput = null ; Overrider overrider = new Overrider ( defaultOverride ) ; overrider . override ( XmlParameters . operationType , element . getTagName ( ) ) ; if ( element . hasAttribute ( XmlParameters . outputHandler ) == true ) { overrider . override ( XmlParameters . outputHandler , element . getAttribute ( XmlParameters . outputHandler ) ) ; } if ( element . hasAttribute ( XmlParameters . controlParamCount ) == true ) { overrider . override ( XmlParameters . controlParamCount , Boolean . valueOf ( element . getAttribute ( XmlParameters . controlParamCount ) ) ) ; } if ( element . hasAttribute ( XmlParameters . generateKeys ) == true ) { overrider . override ( XmlParameters . generateKeys , element . getAttribute ( XmlParameters . generateKeys ) ) ; } if ( element . hasAttribute ( XmlParameters . generateKeysColumns ) == true ) { overrider . override ( XmlParameters . generateKeysColumns , element . getAttribute ( XmlParameters . generateKeysColumns ) . split ( "," ) ) ; } String name = element . getAttribute ( "id" ) ; String encodedQuery = element . getTextContent ( ) ; xmlQueryString . put ( name , encodedQuery ) ; xmlOverrideMap . put ( name , overrider ) ;
public class UriTemplateBuilder { /** * Scans the components for an expression with the specified operator . * @ param op * @ return */ private boolean hasExpressionWithOperator ( Operator op ) { } }
for ( UriTemplateComponent c : components ) { if ( Expression . class . isInstance ( c ) ) { Expression e = ( Expression ) c ; if ( e . getOperator ( ) == op ) { return true ; } } } return false ;
public class IpPermission { /** * [ VPC only ] The prefix list IDs for an AWS service . With outbound rules , this is the AWS service to access through * a VPC endpoint from instances associated with the security group . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setPrefixListIds ( java . util . Collection ) } or { @ link # withPrefixListIds ( java . util . Collection ) } if you want * to override the existing values . * @ param prefixListIds * [ VPC only ] The prefix list IDs for an AWS service . With outbound rules , this is the AWS service to access * through a VPC endpoint from instances associated with the security group . * @ return Returns a reference to this object so that method calls can be chained together . */ public IpPermission withPrefixListIds ( PrefixListId ... prefixListIds ) { } }
if ( this . prefixListIds == null ) { setPrefixListIds ( new com . amazonaws . internal . SdkInternalList < PrefixListId > ( prefixListIds . length ) ) ; } for ( PrefixListId ele : prefixListIds ) { this . prefixListIds . add ( ele ) ; } return this ;
public class WSRdbManagedConnectionImpl { /** * Invoked by the JDBC driver when a prepared statement is closed . * @ param event a data structure containing information about the event . */ public void statementClosed ( javax . sql . StatementEvent event ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( this , tc , "statementClosed" , "Notification of statement closed received from the JDBC driver" , AdapterUtil . toString ( event . getSource ( ) ) , AdapterUtil . toString ( event . getStatement ( ) ) ) ; // Statement . close is used instead of these signals .
public class ApplicationManifestUtils { /** * Write { @ link ApplicationManifest } s to a { @ link Path } * @ param path the path to write to * @ param applicationManifests the manifests to write */ public static void write ( Path path , List < ApplicationManifest > applicationManifests ) { } }
try ( OutputStream out = Files . newOutputStream ( path , StandardOpenOption . CREATE , StandardOpenOption . WRITE ) ) { write ( out , applicationManifests ) ; } catch ( IOException e ) { throw Exceptions . propagate ( e ) ; }
public class UUIDCreator { /** * Create a UUID instance from 16 - bit UUID data . * < pre style = " padding : 0.5em ; margin : 1em ; border : 1px solid black ; " > * < span style = " color : green ; " > / / Prepare a byte array containing 32 - bit UUID data ( < b > little < / b > endian ) . < / span > * byte [ ] data = new byte [ ] { ( byte ) 0xAB , ( byte ) 0xCD } ; * < span style = " color : green ; " > / / Create a UUID instance from the byte array . < / span > * UUID uuid = UUIDCreator . { @ link # from16 ( byte [ ] , int , boolean ) from16 } ( data , 0 , < b > true < / b > ) ; * < span style = " color : green ; " > / / uuid represents 0000 < b > cdab < / b > - 0000-1000-8000-00805f9b34fb . < / span > * < / pre > * < br / > * < pre style = " padding : 0.5em ; margin : 1em ; border : 1px solid black ; " > * < span style = " color : green ; " > / / Prepare a byte array containing 32 - bit UUID data ( < b > big < / b > endian ) . < / span > * byte [ ] data = new byte [ ] { ( byte ) 0xCD , ( byte ) 0xAB } ; * < span style = " color : green ; " > / / Create a UUID instance from the byte array . < / span > * UUID uuid = UUIDCreator . { @ link # from16 ( byte [ ] , int , boolean ) from16 } ( data , 0 , < b > false < / b > ) ; * < span style = " color : green ; " > / / uuid represents 0000 < b > cdab < / b > - 0000-1000-8000-00805f9b34fb . < / span > * < / pre > * @ param data * A byte array containing 16 - bit UUID data . * @ param offset * The offset from which 16 - bit UUID data should be read . * @ param littleEndian * { @ code true } if the 16 - bit UUID data is stored in little endian . * { @ code false } for big endian . * @ return * A UUID instance . { @ code null } is returned when { @ code data } * is { @ code null } or { @ code offset } is not valid . */ public static UUID from16 ( byte [ ] data , int offset , boolean littleEndian ) { } }
if ( data == null || offset < 0 || data . length <= ( offset + 1 ) || Integer . MAX_VALUE == offset ) { return null ; } int v2 , v3 ; if ( littleEndian ) { v2 = data [ offset + 1 ] & 0xFF ; v3 = data [ offset + 0 ] & 0xFF ; } else { v2 = data [ offset + 0 ] & 0xFF ; v3 = data [ offset + 1 ] & 0xFF ; } return fromBase ( 0 , 0 , v2 , v3 ) ;
public class InfluxDbEventStore { /** * { @ inheritDoc } */ @ Override public Collection < Event > findEvents ( SearchCriteria criteria ) { } }
ensureInitialized ( ) ; Preconditions . checkNotNull ( criteria , "criteria must be non-null" ) ; Collection < Event > matches = new ArrayList < > ( ) ; User user = criteria . getUser ( ) ; DetectionPoint detectionPoint = criteria . getDetectionPoint ( ) ; Rule rule = criteria . getRule ( ) ; Collection < String > detectionSystemIds = criteria . getDetectionSystemIds ( ) ; DateTime earliest = DateUtils . fromString ( criteria . getEarliest ( ) ) ; String influxQL = Utils . constructInfluxQL ( Utils . EVENTS , user , detectionPoint , null , detectionSystemIds , earliest , Utils . QueryMode . IGNORE_THRESHOLDS ) ; if ( rule != null ) { influxQL += " AND (" ; int i = 0 ; for ( DetectionPoint point : rule . getAllDetectionPoints ( ) ) { influxQL += ( i == 0 ) ? "" : " OR " ; influxQL += "(" ; influxQL += Utils . constructDetectionPointSqlString ( point , Utils . QueryMode . IGNORE_THRESHOLDS ) ; influxQL += ")" ; i ++ ; } influxQL += ")" ; } Query query = new Query ( influxQL , Utils . DATABASE ) ; QueryResult results = influxDB . query ( query ) ; for ( QueryResult . Result result : results . getResults ( ) ) { if ( result == null || result . getSeries ( ) == null ) { continue ; } for ( QueryResult . Series series : result . getSeries ( ) ) { if ( series == null || series . getValues ( ) == null ) { continue ; } for ( List < Object > record : series . getValues ( ) ) { if ( record == null ) { continue ; } matches . add ( gson . fromJson ( Utils . getValue ( Utils . JSON_CONTENT , series , record ) , Event . class ) ) ; } } } return matches ;
public class NestedJarHandler { /** * Create a temporary file , and mark it for deletion on exit . * @ param filePath * The path to derive the temporary filename from . * @ param onlyUseLeafname * If true , only use the leafname of filePath to derive the temporary filename . * @ return The temporary { @ link File } . * @ throws IOException * If the temporary file could not be created . */ private File makeTempFile ( final String filePath , final boolean onlyUseLeafname ) throws IOException { } }
final File tempFile = File . createTempFile ( "ClassGraph--" , TEMP_FILENAME_LEAF_SEPARATOR + sanitizeFilename ( onlyUseLeafname ? leafname ( filePath ) : filePath ) ) ; tempFile . deleteOnExit ( ) ; tempFiles . add ( tempFile ) ; return tempFile ;
public class ReferenceImpl { /** * Remove the reference if the target element is removed * @ param referenceTargetElement the reference target model element instance , which is removed * @ param referenceIdentifier the identifier of the reference to filter reference source elements */ public void referencedElementRemoved ( ModelElementInstance referenceTargetElement , Object referenceIdentifier ) { } }
for ( ModelElementInstance referenceSourceElement : findReferenceSourceElements ( referenceTargetElement ) ) { if ( referenceIdentifier . equals ( getReferenceIdentifier ( referenceSourceElement ) ) ) { removeReference ( referenceSourceElement , referenceTargetElement ) ; } }
public class DescribeClientVpnTargetNetworksRequest { /** * The IDs of the target network associations . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setAssociationIds ( java . util . Collection ) } or { @ link # withAssociationIds ( java . util . Collection ) } if you want * to override the existing values . * @ param associationIds * The IDs of the target network associations . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeClientVpnTargetNetworksRequest withAssociationIds ( String ... associationIds ) { } }
if ( this . associationIds == null ) { setAssociationIds ( new com . amazonaws . internal . SdkInternalList < String > ( associationIds . length ) ) ; } for ( String ele : associationIds ) { this . associationIds . add ( ele ) ; } return this ;
public class OStreamSerializerAnyRuntime { /** * Re - Create any object if the class has a public constructor that accepts a String as unique parameter . */ public Object fromStream ( final byte [ ] iStream ) throws IOException { } }
if ( iStream == null || iStream . length == 0 ) // NULL VALUE return null ; final ByteArrayInputStream is = new ByteArrayInputStream ( iStream ) ; final ObjectInputStream in = new ObjectInputStream ( is ) ; try { return in . readObject ( ) ; } catch ( ClassNotFoundException e ) { throw new OSerializationException ( "Cannot unmarshall Java serialized object" , e ) ; } finally { in . close ( ) ; is . close ( ) ; }
public class RequestInfo { /** * < pre > * Any data that was used to serve this request . For example , an encrypted * stack trace that can be sent back to the service provider for debugging . * < / pre > * < code > string serving _ data = 2 ; < / code > */ public com . google . protobuf . ByteString getServingDataBytes ( ) { } }
java . lang . Object ref = servingData_ ; if ( ref instanceof java . lang . String ) { com . google . protobuf . ByteString b = com . google . protobuf . ByteString . copyFromUtf8 ( ( java . lang . String ) ref ) ; servingData_ = b ; return b ; } else { return ( com . google . protobuf . ByteString ) ref ; }
public class EnvironmentCreator { /** * Add the requested post parameters to the Request . * @ param request Request to add post params to */ private void addPostParams ( final Request request ) { } }
if ( uniqueName != null ) { request . addPostParam ( "UniqueName" , uniqueName ) ; } if ( domainSuffix != null ) { request . addPostParam ( "DomainSuffix" , domainSuffix ) ; }
public class ControlBeanContextServicesSupport { /** * Initialize data structures . */ protected void initialize ( ) { } }
super . initialize ( ) ; _serviceProviders = Collections . synchronizedMap ( new HashMap < Class , ServiceProvider > ( ) ) ; _bcsListeners = Collections . synchronizedList ( new ArrayList < BeanContextServicesListener > ( ) ) ;
public class BeanMappingParser { /** * 根据属性名获取一下匹配的PropertyDescriptor */ private static PropertyDescriptor getMatchPropertyDescriptor ( PropertyDescriptor [ ] srcPds , String property ) { } }
for ( PropertyDescriptor srcPd : srcPds ) { if ( srcPd . getName ( ) . equals ( property ) ) { return srcPd ; } } return null ;
public class CliFrontend { /** * Executes the info action . * @ param args Command line arguments for the info action . */ protected int info ( String [ ] args ) { } }
// Parse command line options CommandLine line ; try { line = parser . parse ( INFO_OPTIONS , args , false ) ; evaluateGeneralOptions ( line ) ; } catch ( MissingOptionException e ) { System . out . println ( e . getMessage ( ) ) ; printHelpForInfo ( ) ; return 1 ; } catch ( UnrecognizedOptionException e ) { System . out . println ( e . getMessage ( ) ) ; printHelpForInfo ( ) ; return 2 ; } catch ( Exception e ) { return handleError ( e ) ; } if ( printHelp ) { printHelpForInfo ( ) ; return 0 ; } boolean description = line . hasOption ( DESCR_OPTION . getOpt ( ) ) ; boolean plan = line . hasOption ( PLAN_OPTION . getOpt ( ) ) ; if ( ! description && ! plan ) { System . out . println ( "ERROR: Specify the information to display." ) ; printHelpForInfo ( ) ; return 1 ; } // - - - - - build the packaged program - - - - - PackagedProgram program ; try { program = buildProgram ( line ) ; } catch ( Throwable t ) { return handleError ( t ) ; } if ( program == null ) { printHelpForInfo ( ) ; return 1 ; } int parallelism = - 1 ; if ( line . hasOption ( PARALLELISM_OPTION . getOpt ( ) ) ) { String parString = line . getOptionValue ( PARALLELISM_OPTION . getOpt ( ) ) ; try { parallelism = Integer . parseInt ( parString ) ; } catch ( NumberFormatException e ) { System . out . println ( "The value " + parString + " is invalid for the degree of parallelism." ) ; printHelpForRun ( ) ; return 1 ; } if ( parallelism <= 0 ) { System . out . println ( "Invalid value for the degree-of-parallelism. Parallelism must be greater than zero." ) ; printHelpForRun ( ) ; return 1 ; } } try { // check for description request if ( description ) { String descr = program . getDescription ( ) ; if ( descr != null ) { System . out . println ( "-------------------- Program Description ---------------------" ) ; System . out . println ( descr ) ; System . out . println ( "--------------------------------------------------------------" ) ; } else { System . out . println ( "No description available for this program." ) ; } } // check for json plan request if ( plan ) { Client client = getClient ( line ) ; String jsonPlan = client . getOptimizedPlanAsJson ( program , parallelism ) ; if ( jsonPlan != null ) { System . out . println ( "----------------------- Execution Plan -----------------------" ) ; System . out . println ( jsonPlan ) ; System . out . println ( "--------------------------------------------------------------" ) ; } else { System . out . println ( "JSON plan could not be compiled." ) ; } } return 0 ; } catch ( Throwable t ) { return handleError ( t ) ; } finally { program . deleteExtractedLibraries ( ) ; }
public class JMRandom { /** * Foreach random int . * @ param streamSize the stream size * @ param random the random * @ param inclusiveLowerBound the inclusive lower bound * @ param exclusiveUpperBound the exclusive upper bound * @ param eachRandomIntConsumer the each random int consumer */ public static void foreachRandomInt ( int streamSize , Random random , int inclusiveLowerBound , int exclusiveUpperBound , IntConsumer eachRandomIntConsumer ) { } }
foreachRandomInt ( streamSize , ( ) -> getBoundedNumber ( random , inclusiveLowerBound , exclusiveUpperBound ) , eachRandomIntConsumer ) ;
public class RestHelper { /** * Creates an url using base url and appending optional segments . * @ param baseUrl a { @ code non - null } string which will act as a base . * @ param pathSegments an option array of segments * @ return a string representing an absolute - url */ public static String urlFrom ( String baseUrl , String ... pathSegments ) { } }
StringBuilder urlBuilder = new StringBuilder ( baseUrl ) ; if ( urlBuilder . charAt ( urlBuilder . length ( ) - 1 ) == '/' ) { urlBuilder . deleteCharAt ( urlBuilder . length ( ) - 1 ) ; } for ( String pathSegment : pathSegments ) { if ( pathSegment . equalsIgnoreCase ( ".." ) ) { urlBuilder . delete ( urlBuilder . lastIndexOf ( "/" ) , urlBuilder . length ( ) ) ; } else { if ( ! pathSegment . startsWith ( "/" ) ) { urlBuilder . append ( "/" ) ; } urlBuilder . append ( pathSegment ) ; } } return urlBuilder . toString ( ) ;
public class APINameChecker { /** * Perform server identify check using given name and throw CertificateException if the check fails . * @ param name * @ param cert * @ throws CertificateException */ public static void verifyAndThrow ( final String name , final X509Certificate cert ) throws CertificateException { } }
if ( ! verify ( name , cert ) ) { throw new CertificateException ( "No name matching " + name + " found" ) ; }
public class ReflectionUtils { /** * This helper method facilitates creation of Wrapper data type object and initialize it with the provided value . * @ param type * The type to instantiate . It has to be only a Wrapper data type [ such as Integer , Float , Boolean * etc . , ] * @ param objectToInvokeUpon * The object upon which the invocation is to be carried out . * @ param valueToAssign * The value to initialize with . * @ return An initialized object that represents the Wrapper data type . */ public static Object instantiateWrapperObject ( Class < ? > type , Object objectToInvokeUpon , String valueToAssign ) { } }
logger . entering ( new Object [ ] { type , objectToInvokeUpon , valueToAssign } ) ; validateParams ( type , objectToInvokeUpon , valueToAssign ) ; checkArgument ( ClassUtils . isPrimitiveWrapper ( type ) , type . getName ( ) + " is NOT a wrapper data type." ) ; try { Object objectToReturn = type . getConstructor ( new Class < ? > [ ] { String . class } ) . newInstance ( valueToAssign ) ; logger . exiting ( objectToInvokeUpon ) ; return objectToReturn ; } catch ( InstantiationException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e ) { throw new ReflectionException ( e ) ; }
public class XMLUtil { /** * Read an enumeration value . * @ param < T > is the type of the enumeration . * @ param document is the XML document to explore . * @ param type is the type of the enumeration . * @ param caseSensitive indicates of the { @ code path } ' s components are case sensitive . * @ param defaultValue is the default value replied if no attribute was found . * @ param path is the list of and ended by the attribute ' s name . * @ return the value of the enumeration or < code > null < / code > if none . */ @ Pure public static < T extends Enum < T > > T getAttributeEnumWithDefault ( Node document , Class < T > type , boolean caseSensitive , T defaultValue , String ... path ) { } }
assert document != null : AssertMessages . notNullParameter ( 0 ) ; assert type != null : AssertMessages . notNullParameter ( 1 ) ; final String v = getAttributeValue ( document , caseSensitive , 0 , path ) ; if ( v != null && ! v . isEmpty ( ) ) { if ( caseSensitive ) { try { final T value = Enum . valueOf ( type , v ) ; if ( value != null ) { return value ; } } catch ( Throwable e ) { } } else { for ( final T value : type . getEnumConstants ( ) ) { if ( v . equalsIgnoreCase ( value . name ( ) ) ) { return value ; } } } } return defaultValue ;
public class MappingUtils { /** * Returns class field value * Is used to return Constants * @ param object Class field of which would be returned * @ param fieldName field name * @ return field value * @ throws org . midao . jdbc . core . exception . MjdbcException if field is not present or access is prohibited */ public static Object returnField ( Object object , String fieldName ) throws MjdbcException { } }
AssertUtils . assertNotNull ( object ) ; Object result = null ; Field field = null ; try { field = object . getClass ( ) . getField ( fieldName ) ; result = field . get ( object ) ; } catch ( NoSuchFieldException ex ) { throw new MjdbcException ( ex ) ; } catch ( IllegalAccessException ex ) { throw new MjdbcException ( ex ) ; } return result ;
public class AnnotationScanner { /** * Scans for classes in URLs . * @ param urls URLs to scan for annotated classes . * @ return Map of annotated classes found . * @ throws IOException If exception occurs . */ private Map < String , Set < String > > scanForAnnotatedClasses ( Set < URL > urls ) throws IOException { } }
AnnotationDB db = new AnnotationDB ( ) ; db . setScanClassAnnotations ( true ) ; db . setScanFieldAnnotations ( false ) ; db . setScanMethodAnnotations ( false ) ; db . setScanParameterAnnotations ( false ) ; db . scanArchives ( urls . toArray ( new URL [ urls . size ( ) ] ) ) ; return db . getAnnotationIndex ( ) ;
public class Parser { /** * Parse from a byte array ( containing utf - 8 encoded string with the Python literal expression in it ) */ public Ast parse ( byte [ ] serialized ) throws ParseException { } }
try { return parse ( new String ( serialized , "utf-8" ) ) ; } catch ( UnsupportedEncodingException e ) { throw new ParseException ( e . toString ( ) ) ; }
public class MtasSolrComponentStatus { /** * ( non - Javadoc ) * @ see * mtas . solr . handler . component . util . MtasSolrComponent # prepare ( org . apache . solr . * handler . component . ResponseBuilder , * mtas . codec . util . CodecComponent . ComponentFields ) */ @ Override public void prepare ( ResponseBuilder rb , ComponentFields mtasFields ) throws IOException { } }
mtasFields . doStatus = true ; String key = rb . req . getParams ( ) . get ( PARAM_MTAS_STATUS + "." + NAME_MTAS_STATUS_KEY , null ) ; boolean getHandler = rb . req . getParams ( ) . getBool ( MtasSolrComponentStatus . PARAM_MTAS_STATUS + "." + NAME_MTAS_STATUS_MTASHANDLER , false ) ; boolean getNumberOfDocuments = rb . req . getParams ( ) . getBool ( MtasSolrComponentStatus . PARAM_MTAS_STATUS + "." + NAME_MTAS_STATUS_NUMBEROFDOCUMENTS , false ) ; boolean getNumberOfSegments = rb . req . getParams ( ) . getBool ( MtasSolrComponentStatus . PARAM_MTAS_STATUS + "." + NAME_MTAS_STATUS_NUMBEROFSEGMENTS , false ) ; mtasFields . status = new ComponentStatus ( rb . req . getCore ( ) . getName ( ) , key , getHandler , getNumberOfDocuments , getNumberOfSegments ) ; mtasFields . status . numberOfDocuments = rb . req . getSearcher ( ) . getRawReader ( ) . numDocs ( ) ; mtasFields . status . numberOfSegments = rb . req . getSearcher ( ) . getRawReader ( ) . leaves ( ) . size ( ) ;
public class WebAppPublisher { /** * Publish a web application . * @ param webApp web application to be published . * @ throws NullArgumentException if web app is null */ public void publish ( final WebApp webApp ) { } }
NullArgumentException . validateNotNull ( webApp , "Web app" ) ; LOG . debug ( "Publishing web application [{}]" , webApp ) ; final BundleContext webAppBundleContext = BundleUtils . getBundleContext ( webApp . getBundle ( ) ) ; if ( webAppBundleContext != null ) { try { Filter filter = webAppBundleContext . createFilter ( String . format ( "(&(objectClass=%s)(bundle.id=%d))" , WebAppDependencyHolder . class . getName ( ) , webApp . getBundle ( ) . getBundleId ( ) ) ) ; ServiceTracker < WebAppDependencyHolder , WebAppDependencyHolder > dependencyTracker = new ServiceTracker < WebAppDependencyHolder , WebAppDependencyHolder > ( webAppBundleContext , filter , new WebAppDependencyListener ( webApp , eventDispatcher , bundleContext ) ) ; webApps . put ( webApp , dependencyTracker ) ; dependencyTracker . open ( ) ; } catch ( InvalidSyntaxException exc ) { throw new IllegalArgumentException ( exc ) ; } } else { LOG . warn ( "Bundle context could not be discovered for bundle [" + webApp . getBundle ( ) + "]" + "Skipping publishing of web application [" + webApp + "]" ) ; }
public class SingleDiscriminatorAlgorithm { /** * Use a VirtualConnection rather than a InboundVirtualConnection for discrimination */ public int discriminate ( VirtualConnection vc , Object discrimData , ConnectionLink prevChannelLink ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "discriminate: " + vc ) ; } ConnectionLink nextChannelLink = nextChannel . getConnectionLink ( vc ) ; prevChannelLink . setApplicationCallback ( nextChannelLink ) ; nextChannelLink . setDeviceLink ( prevChannelLink ) ; return DiscriminationProcess . SUCCESS ;
public class ApiOvhPrice { /** * Get price of dedicated Cloud monthly host ressources * REST : GET / price / dedicatedCloud / 2016v7 / sbg1a / enterprise / host / monthly / { hostProfile } * @ param hostProfile [ required ] type of the monthly ressources you want to order */ public OvhPrice dedicatedCloud_2016v7_sbg1a_enterprise_host_monthly_hostProfile_GET ( net . minidev . ovh . api . price . dedicatedcloud . _2016v7 . sbg1a . enterprise . host . OvhMonthlyEnum hostProfile ) throws IOException { } }
String qPath = "/price/dedicatedCloud/2016v7/sbg1a/enterprise/host/monthly/{hostProfile}" ; StringBuilder sb = path ( qPath , hostProfile ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhPrice . class ) ;
public class ReflectiveVisitorHelper { /** * Determines the most appropriate visit method for the given visitor class * and argument . */ private Method getMethod ( Class visitorClass , Object argument ) { } }
ClassVisitMethods visitMethods = ( ClassVisitMethods ) this . visitorClassVisitMethods . get ( visitorClass ) ; return visitMethods . getVisitMethod ( argument != null ? argument . getClass ( ) : null ) ;
public class FSDataset { /** * check if a data directory is healthy * if some volumes failed - make sure to remove all the blocks that belong * to these volumes * @ throws DiskErrorException */ public void checkDataDir ( ) throws DiskErrorException { } }
long total_blocks = 0 , removed_blocks = 0 ; List < FSVolume > failed_vols = null ; failed_vols = volumes . checkDirs ( ) ; // if there no failed volumes return if ( failed_vols == null ) return ; // else // remove related blocks long mlsec = System . currentTimeMillis ( ) ; lock . writeLock ( ) . lock ( ) ; try { volumeMap . removeUnhealthyVolumes ( failed_vols ) ; } finally { lock . writeLock ( ) . unlock ( ) ; } mlsec = System . currentTimeMillis ( ) - mlsec ; DataNode . LOG . warn ( ">>>>>>>>>>>>Removed " + removed_blocks + " out of " + total_blocks + "(took " + mlsec + " millisecs)" ) ; // report the error StringBuilder sb = new StringBuilder ( ) ; for ( FSVolume fv : failed_vols ) { sb . append ( fv . toString ( ) + ";" ) ; } throw new DiskErrorException ( "DataNode failed volumes:" + sb ) ;
public class FFMQInitialContextFactory { /** * Preload the context with factories */ @ SuppressWarnings ( "unchecked" ) protected void preLoad ( FFMQJNDIContext context ) throws NamingException { } }
context . bind ( FFMQConstants . JNDI_CONNECTION_FACTORY_NAME , new FFMQConnectionFactory ( ( Hashtable < String , Object > ) context . getEnvironment ( ) ) ) ; context . bind ( FFMQConstants . JNDI_QUEUE_CONNECTION_FACTORY_NAME , new FFMQQueueConnectionFactory ( ( Hashtable < String , Object > ) context . getEnvironment ( ) ) ) ; context . bind ( FFMQConstants . JNDI_TOPIC_CONNECTION_FACTORY_NAME , new FFMQTopicConnectionFactory ( ( Hashtable < String , Object > ) context . getEnvironment ( ) ) ) ;
public class DefaultParser { /** * Tells if the token looks like a short option . * @ param token */ private boolean isShortOption ( String token ) { } }
// short options ( - S , - SV , - S = V , - SV1 = V2 , - S1S2) return token . startsWith ( "-" ) && token . length ( ) >= 2 && options . hasShortOption ( token . substring ( 1 , 2 ) ) ;
public class DetectQueryBean { /** * Return true if this class is a query bean using naming conventions for query beans . */ boolean isQueryBean ( String owner ) { } }
int subPackagePos = owner . lastIndexOf ( "/query/" ) ; if ( subPackagePos > - 1 ) { String suffix = owner . substring ( subPackagePos ) ; if ( isQueryBeanSuffix ( suffix ) ) { String domainPackage = owner . substring ( 0 , subPackagePos + 1 ) ; return isQueryBeanPackage ( domainPackage ) ; } } return false ;
public class Emitter { /** * syck _ emit _ 2quoted */ public void emit2Quoted ( int width , Pointer _str , final int len ) { } }
byte [ ] bstr = _str . buffer ; int str = _str . start ; int do_indent = 0 ; int mark = str ; int start = str ; int end = str ; write ( DOUBLE_QUOTE , 1 ) ; while ( mark < str + len ) { if ( do_indent > 0 ) { if ( do_indent == 2 ) { write ( BACKSLASH , 1 ) ; } emitIndent ( ) ; do_indent = 0 ; } switch ( bstr [ mark ] ) { /* Escape sequences allowed within double quotes . */ case '"' : write ( SLASH_QUOTE , 2 ) ; break ; case '\\' : write ( SLASH_SLASH , 2 ) ; break ; case '\0' : write ( SLASH_ZERO , 2 ) ; break ; case 0x07 : write ( SLASH_A , 2 ) ; break ; case '\b' : write ( SLASH_B , 2 ) ; break ; case '\f' : write ( SLASH_F , 2 ) ; break ; case '\r' : write ( SLASH_R , 2 ) ; break ; case '\t' : write ( SLASH_T , 2 ) ; break ; case 0x0B : write ( SLASH_V , 2 ) ; break ; case 0x1B : write ( SLASH_E , 2 ) ; break ; case '\n' : end = mark + 1 ; write ( SLASH_N , 2 ) ; do_indent = 2 ; start = mark + 1 ; if ( start < str + len && ( bstr [ start ] == ' ' || bstr [ start ] == '\n' ) ) { do_indent = 0 ; } break ; case ' ' : if ( width > 0 && bstr [ start ] != ' ' && mark - end > width ) { do_indent = 1 ; end = mark + 1 ; } else { write ( SPACE , 1 ) ; } break ; default : escape ( _str . withStart ( mark ) , 1 ) ; break ; } mark ++ ; } write ( DOUBLE_QUOTE , 1 ) ;
public class ImageIOGreyScale { /** * Returns a < code > BufferedImage < / code > as the result of decoding a supplied < code > File < / code > with an * < code > ImageReader < / code > chosen automatically from among those currently registered . The * < code > File < / code > is wrapped in an < code > ImageInputStream < / code > . If no registered * < code > ImageReader < / code > claims to be able to read the resulting stream , < code > null < / code > is returned . * The current cache settings from < code > getUseCache < / code > and < code > getCacheDirectory < / code > will be used * to control caching in the < code > ImageInputStream < / code > that is created . * Note that there is no < code > read < / code > method that takes a filename as a < code > String < / code > ; use this * method instead after creating a < code > File < / code > from the filename . * This method does not attempt to locate < code > ImageReader < / code > s that can read directly from a * < code > File < / code > ; that may be accomplished using < code > IIORegistry < / code > and * < code > ImageReaderSpi < / code > . * @ param input * a < code > File < / code > to read from . * @ return a < code > BufferedImage < / code > containing the decoded contents of the input , or < code > null < / code > * @ exception IllegalArgumentException * if < code > input < / code > is < code > null < / code > . * @ exception IOException * if an error occurs during reading . */ public static BufferedImage read ( File input ) throws IOException { } }
if ( input == null ) { throw new IllegalArgumentException ( "input == null!" ) ; } if ( ! input . canRead ( ) ) { throw new IIOException ( "Can't read input file!" ) ; } ImageInputStream stream = createImageInputStream ( input ) ; if ( stream == null ) { throw new IIOException ( "Can't create an ImageInputStream!" ) ; } BufferedImage bi = read ( stream ) ; if ( bi == null ) { stream . close ( ) ; } return bi ;
public class PrivacyListManager { /** * Returns the PrivacyListManager instance associated with a given XMPPConnection . * @ param connection the connection used to look for the proper PrivacyListManager . * @ return the PrivacyListManager associated with a given XMPPConnection . */ public static synchronized PrivacyListManager getInstanceFor ( XMPPConnection connection ) { } }
PrivacyListManager plm = INSTANCES . get ( connection ) ; if ( plm == null ) { plm = new PrivacyListManager ( connection ) ; // Register the new instance and associate it with the connection INSTANCES . put ( connection , plm ) ; } return plm ;
public class ForceFieldConfigurator { /** * Method assigns atom types to atoms ( calculates sssr and aromaticity ) * @ return sssrf set * @ exception CDKException Problems detecting aromaticity or making hose codes . */ public IRingSet assignAtomTyps ( IAtomContainer molecule ) throws CDKException { } }
IAtom atom = null ; String hoseCode = "" ; HOSECodeGenerator hcg = new HOSECodeGenerator ( ) ; int NumberOfRingAtoms = 0 ; IRingSet ringSetA = null ; IRingSet ringSetMolecule = Cycles . sssr ( molecule ) . toRingSet ( ) ; boolean isInHeteroRing = false ; try { AtomContainerManipulator . percieveAtomTypesAndConfigureAtoms ( molecule ) ; Aromaticity . cdkLegacy ( ) . apply ( molecule ) ; } catch ( Exception cdk1 ) { throw new CDKException ( "AROMATICITYError: Cannot determine aromaticity due to: " + cdk1 . getMessage ( ) , cdk1 ) ; } for ( int i = 0 ; i < molecule . getAtomCount ( ) ; i ++ ) { atom = molecule . getAtom ( i ) ; if ( ringSetMolecule . contains ( atom ) ) { NumberOfRingAtoms = NumberOfRingAtoms + 1 ; atom . setFlag ( CDKConstants . ISINRING , true ) ; atom . setFlag ( CDKConstants . ISALIPHATIC , false ) ; ringSetA = ringSetMolecule . getRings ( atom ) ; RingSetManipulator . sort ( ringSetA ) ; IRing sring = ( IRing ) ringSetA . getAtomContainer ( ringSetA . getAtomContainerCount ( ) - 1 ) ; atom . setProperty ( "RING_SIZE" , Integer . valueOf ( sring . getRingSize ( ) ) ) ; isInHeteroRing = false ; Iterator < IAtomContainer > containers = RingSetManipulator . getAllAtomContainers ( ringSetA ) . iterator ( ) ; while ( ! isInHeteroRing && containers . hasNext ( ) ) { isInHeteroRing = isHeteroRingSystem ( containers . next ( ) ) ; } } else { atom . setFlag ( CDKConstants . ISALIPHATIC , true ) ; atom . setFlag ( CDKConstants . ISINRING , false ) ; isInHeteroRing = false ; } atom . setProperty ( "MAX_BOND_ORDER" , new Double ( molecule . getMaximumBondOrder ( atom ) . numeric ( ) ) ) ; try { hoseCode = hcg . getHOSECode ( molecule , atom , 3 ) ; // logger . debug ( " HOSECODE GENERATION : ATOM " + i + " HoseCode : " + hoseCode + " " ) ; } catch ( CDKException ex1 ) { System . out . println ( "Could not build HOSECode from atom " + i + " due to " + ex1 . toString ( ) ) ; throw new CDKException ( "Could not build HOSECode from atom " + i + " due to " + ex1 . toString ( ) , ex1 ) ; } try { configureAtom ( atom , hoseCode , isInHeteroRing ) ; } catch ( CDKException ex2 ) { System . out . println ( "Could not final configure atom " + i + " due to " + ex2 . toString ( ) ) ; throw new CDKException ( "Could not final configure atom due to problems with force field" , ex2 ) ; } } // IBond [ ] bond = molecule . getBonds ( ) ; String bondType ; for ( IBond bond : molecule . bonds ( ) ) { // logger . debug ( " bond [ " + i + " ] properties : " + molecule . getBond ( i ) . getProperties ( ) ) ; bondType = "0" ; if ( bond . getOrder ( ) == IBond . Order . SINGLE ) { if ( ( bond . getBegin ( ) . getAtomTypeName ( ) . equals ( "Csp2" ) ) && ( ( bond . getEnd ( ) . getAtomTypeName ( ) . equals ( "Csp2" ) ) || ( bond . getEnd ( ) . getAtomTypeName ( ) . equals ( "C=" ) ) ) ) { bondType = "1" ; } if ( ( bond . getBegin ( ) . getAtomTypeName ( ) . equals ( "C=" ) ) && ( ( bond . getEnd ( ) . getAtomTypeName ( ) . equals ( "Csp2" ) ) || ( bond . getEnd ( ) . getAtomTypeName ( ) . equals ( "C=" ) ) ) ) { bondType = "1" ; } if ( ( bond . getBegin ( ) . getAtomTypeName ( ) . equals ( "Csp" ) ) && ( bond . getEnd ( ) . getAtomTypeName ( ) . equals ( "Csp" ) ) ) { bondType = "1" ; } } // molecule . getBond ( i ) . setProperty ( " MMFF94 bond type " , bondType ) ; bond . setProperty ( "MMFF94 bond type" , bondType ) ; // logger . debug ( " bond [ " + i + " ] properties : " + molecule . getBond ( i ) . getProperties ( ) ) ; } return ringSetMolecule ;
public class SummaryExtractor { /** * get document summary from a string * @ param doc * @ param length * @ return String * @ throws IOException */ public String getSummaryFromString ( String doc , int length ) throws IOException { } }
return getSummary ( new StringReader ( doc ) , length ) ;
public class DefaultConfigurationProvider { /** * < / editor - fold > */ @ Override public void load ( Context ctx , SharedPreferences prefs ) { } }
mNormalizedUserAgent = computeNormalizedUserAgent ( ctx ) ; // cache management starts here // check to see if the shared preferences is set for the tile cache if ( ! prefs . contains ( "osmdroid.basePath" ) ) { // this is the first time startup . run the discovery bit File discoveredBasePath = getOsmdroidBasePath ( ) ; File discoveredCachePath = getOsmdroidTileCache ( ) ; if ( ! discoveredBasePath . exists ( ) || ! StorageUtils . isWritable ( discoveredBasePath ) ) { // this should always be writable . . . discoveredBasePath = new File ( ctx . getFilesDir ( ) , "osmdroid" ) ; discoveredCachePath = new File ( discoveredBasePath , "tiles" ) ; discoveredCachePath . mkdirs ( ) ; } SharedPreferences . Editor edit = prefs . edit ( ) ; edit . putString ( "osmdroid.basePath" , discoveredBasePath . getAbsolutePath ( ) ) ; edit . putString ( "osmdroid.cachePath" , discoveredCachePath . getAbsolutePath ( ) ) ; commit ( edit ) ; setOsmdroidBasePath ( discoveredBasePath ) ; setOsmdroidTileCache ( discoveredCachePath ) ; setUserAgentValue ( ctx . getPackageName ( ) ) ; save ( ctx , prefs ) ; } else { // normal startup , load user preferences and populate the config object setOsmdroidBasePath ( new File ( prefs . getString ( "osmdroid.basePath" , getOsmdroidBasePath ( ) . getAbsolutePath ( ) ) ) ) ; setOsmdroidTileCache ( new File ( prefs . getString ( "osmdroid.cachePath" , getOsmdroidTileCache ( ) . getAbsolutePath ( ) ) ) ) ; setDebugMode ( prefs . getBoolean ( "osmdroid.DebugMode" , debugMode ) ) ; setDebugMapTileDownloader ( prefs . getBoolean ( "osmdroid.DebugDownloading" , debugMapTileDownloader ) ) ; setDebugMapView ( prefs . getBoolean ( "osmdroid.DebugMapView" , debugMapView ) ) ; setDebugTileProviders ( prefs . getBoolean ( "osmdroid.DebugTileProvider" , debugTileProviders ) ) ; setMapViewHardwareAccelerated ( prefs . getBoolean ( "osmdroid.HardwareAcceleration" , isMapViewHardwareAccelerated ) ) ; setUserAgentValue ( prefs . getString ( "osmdroid.userAgentValue" , ctx . getPackageName ( ) ) ) ; load ( prefs , mAdditionalHttpRequestProperties , "osmdroid.additionalHttpRequestProperty." ) ; setGpsWaitTime ( prefs . getLong ( "osmdroid.gpsWaitTime" , gpsWaitTime ) ) ; setTileDownloadThreads ( ( short ) ( prefs . getInt ( "osmdroid.tileDownloadThreads" , tileDownloadThreads ) ) ) ; setTileFileSystemThreads ( ( short ) ( prefs . getInt ( "osmdroid.tileFileSystemThreads" , tileFileSystemThreads ) ) ) ; setTileDownloadMaxQueueSize ( ( short ) ( prefs . getInt ( "osmdroid.tileDownloadMaxQueueSize" , tileDownloadMaxQueueSize ) ) ) ; setTileFileSystemMaxQueueSize ( ( short ) ( prefs . getInt ( "osmdroid.tileFileSystemMaxQueueSize" , tileFileSystemMaxQueueSize ) ) ) ; setExpirationExtendedDuration ( ( long ) prefs . getLong ( "osmdroid.ExpirationExtendedDuration" , expirationAdder ) ) ; setMapViewRecyclerFriendly ( ( boolean ) prefs . getBoolean ( "osmdroid.mapViewRecycler" , mapViewRecycler ) ) ; setAnimationSpeedDefault ( prefs . getInt ( "osmdroid.ZoomSpeedDefault" , animationSpeedDefault ) ) ; setAnimationSpeedShort ( prefs . getInt ( "osmdroid.animationSpeedShort" , animationSpeedShort ) ) ; setCacheMapTileOvershoot ( ( short ) ( prefs . getInt ( "osmdroid.cacheTileOvershoot" , cacheTileOvershoot ) ) ) ; setMapTileDownloaderFollowRedirects ( prefs . getBoolean ( "osmdroid.TileDownloaderFollowRedirects" , mTileDownloaderFollowRedirects ) ) ; if ( prefs . contains ( "osmdroid.ExpirationOverride" ) ) { expirationOverride = prefs . getLong ( "osmdroid.ExpirationOverride" , - 1 ) ; if ( expirationOverride != null && expirationOverride == - 1 ) expirationOverride = null ; } } if ( Build . VERSION . SDK_INT >= 9 ) { // unfortunately API 8 doesn ' t support File . length ( ) // https : / / github / osmdroid / osmdroid / issues / 435 // On startup , we auto set the max cache size to be the current cache size + free disk space // this reduces the chance of osmdroid completely filling up the storage device // if the default max cache size is greater than the available free space // reduce it to 95 % of the available free space + the size of the cache long cacheSize = 0 ; File dbFile = new File ( getOsmdroidTileCache ( ) . getAbsolutePath ( ) + File . separator + SqlTileWriter . DATABASE_FILENAME ) ; if ( dbFile . exists ( ) ) { cacheSize = dbFile . length ( ) ; } long freeSpace = getOsmdroidTileCache ( ) . getFreeSpace ( ) ; // Log . i ( TAG , " Current cache size is " + cacheSize + " free space is " + freeSpace ) ; if ( getTileFileSystemCacheMaxBytes ( ) > ( freeSpace + cacheSize ) ) { setTileFileSystemCacheMaxBytes ( ( long ) ( ( freeSpace + cacheSize ) * 0.95 ) ) ; setTileFileSystemCacheTrimBytes ( ( long ) ( ( freeSpace + cacheSize ) * 0.90 ) ) ; } }
public class DeploymentOperations { /** * Creates an operation to deploy existing deployment content to the runtime . * @ param deployment the deployment to deploy * @ return the deploy operation */ public static Operation createDeployOperation ( final DeploymentDescription deployment ) { } }
Assert . checkNotNullParam ( "deployment" , deployment ) ; final CompositeOperationBuilder builder = CompositeOperationBuilder . create ( true ) ; addDeployOperationStep ( builder , deployment ) ; return builder . build ( ) ;
public class AbstractMarkerLanguageParser { /** * Replies if the given extension is for HTML file . * @ param extension the extension to test . * @ return { @ code true } if the extension is for a HTML file . */ public static boolean isHtmlFileExtension ( String extension ) { } }
for ( final String ext : HTML_FILE_EXTENSIONS ) { if ( Strings . equal ( ext , extension ) ) { return true ; } } return false ;
public class SynchronousRequest { /** * For more info on Recipes search API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 2 / recipes / search " > here < / a > < br / > * @ param isInput is given id an ingredient * @ param id recipe id * @ return list of recipe id * @ throws GuildWars2Exception see { @ link ErrorCode } for detail */ public List < Integer > searchRecipes ( boolean isInput , int id ) throws GuildWars2Exception { } }
try { Response < List < Integer > > response = ( isInput ) ? gw2API . searchInputRecipes ( Integer . toString ( id ) ) . execute ( ) : gw2API . searchOutputRecipes ( Integer . toString ( id ) ) . execute ( ) ; if ( ! response . isSuccessful ( ) ) throwError ( response . code ( ) , response . errorBody ( ) ) ; return response . body ( ) ; } catch ( IOException e ) { throw new GuildWars2Exception ( ErrorCode . Network , "Network Error: " + e . getMessage ( ) ) ; }
public class MediaWikiBot { /** * Performs a Login . * @ param username the username * @ param passwd the password * @ param domain login domain ( Special for LDAPAuth extention to authenticate against LDAP users ) * @ see PostLogin */ public void login ( String username , String passwd , String domain ) { } }
this . login = getPerformedAction ( new PostLogin ( username , passwd , domain ) ) . getLoginData ( ) ; loginChangeUserInfo = true ; if ( getVersion ( ) == Version . UNKNOWN ) { loginChangeVersion = true ; }
public class DescribeEventTopicsRequest { /** * A list of SNS topic names for which to obtain the information . If this member is null , all associations for the * specified Directory ID are returned . * An empty list results in an < code > InvalidParameterException < / code > being thrown . * @ return A list of SNS topic names for which to obtain the information . If this member is null , all associations * for the specified Directory ID are returned . < / p > * An empty list results in an < code > InvalidParameterException < / code > being thrown . */ public java . util . List < String > getTopicNames ( ) { } }
if ( topicNames == null ) { topicNames = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return topicNames ;
public class RequestCertificateRequest { /** * Additional FQDNs to be included in the Subject Alternative Name extension of the ACM certificate . For example , * add the name www . example . net to a certificate for which the < code > DomainName < / code > field is www . example . com if * users can reach your site by using either name . The maximum number of domain names that you can add to an ACM * certificate is 100 . However , the initial limit is 10 domain names . If you need more than 10 names , you must * request a limit increase . For more information , see < a * href = " https : / / docs . aws . amazon . com / acm / latest / userguide / acm - limits . html " > Limits < / a > . * The maximum length of a SAN DNS name is 253 octets . The name is made up of multiple labels separated by periods . * No label can be longer than 63 octets . Consider the following examples : * < ul > * < li > * < code > ( 63 octets ) . ( 63 octets ) . ( 63 octets ) . ( 61 octets ) < / code > is legal because the total length is 253 octets * ( 63 + 1 + 63 + 1 + 63 + 1 + 61 ) and no label exceeds 63 octets . * < / li > * < li > * < code > ( 64 octets ) . ( 63 octets ) . ( 63 octets ) . ( 61 octets ) < / code > is not legal because the total length exceeds 253 * octets ( 64 + 1 + 63 + 1 + 63 + 1 + 61 ) and the first label exceeds 63 octets . * < / li > * < li > * < code > ( 63 octets ) . ( 63 octets ) . ( 63 octets ) . ( 62 octets ) < / code > is not legal because the total length of the DNS * name ( 63 + 1 + 63 + 1 + 63 + 1 + 62 ) exceeds 253 octets . * < / li > * < / ul > * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setSubjectAlternativeNames ( java . util . Collection ) } or * { @ link # withSubjectAlternativeNames ( java . util . Collection ) } if you want to override the existing values . * @ param subjectAlternativeNames * Additional FQDNs to be included in the Subject Alternative Name extension of the ACM certificate . For * example , add the name www . example . net to a certificate for which the < code > DomainName < / code > field is * www . example . com if users can reach your site by using either name . The maximum number of domain names that * you can add to an ACM certificate is 100 . However , the initial limit is 10 domain names . If you need more * than 10 names , you must request a limit increase . For more information , see < a * href = " https : / / docs . aws . amazon . com / acm / latest / userguide / acm - limits . html " > Limits < / a > . < / p > * The maximum length of a SAN DNS name is 253 octets . The name is made up of multiple labels separated by * periods . No label can be longer than 63 octets . Consider the following examples : * < ul > * < li > * < code > ( 63 octets ) . ( 63 octets ) . ( 63 octets ) . ( 61 octets ) < / code > is legal because the total length is 253 * octets ( 63 + 1 + 63 + 1 + 63 + 1 + 61 ) and no label exceeds 63 octets . * < / li > * < li > * < code > ( 64 octets ) . ( 63 octets ) . ( 63 octets ) . ( 61 octets ) < / code > is not legal because the total length exceeds * 253 octets ( 64 + 1 + 63 + 1 + 63 + 1 + 61 ) and the first label exceeds 63 octets . * < / li > * < li > * < code > ( 63 octets ) . ( 63 octets ) . ( 63 octets ) . ( 62 octets ) < / code > is not legal because the total length of the * DNS name ( 63 + 1 + 63 + 1 + 63 + 1 + 62 ) exceeds 253 octets . * < / li > * @ return Returns a reference to this object so that method calls can be chained together . */ public RequestCertificateRequest withSubjectAlternativeNames ( String ... subjectAlternativeNames ) { } }
if ( this . subjectAlternativeNames == null ) { setSubjectAlternativeNames ( new java . util . ArrayList < String > ( subjectAlternativeNames . length ) ) ; } for ( String ele : subjectAlternativeNames ) { this . subjectAlternativeNames . add ( ele ) ; } return this ;
public class CommandServiceJdo { /** * Creates an { @ link CommandJdo } , initializing its * { @ link Command # setExecuteIn ( org . apache . isis . applib . annotation . Command . ExecuteIn ) } nature } to be * { @ link org . apache . isis . applib . services . command . Command . Executor # OTHER rendering } . */ @ Programmatic @ Override public Command create ( ) { } }
CommandJdo command = factoryService . instantiate ( CommandJdo . class ) ; command . setExecutor ( Executor . OTHER ) ; command . setPersistence ( Persistence . IF_HINTED ) ; return command ;