signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CommercePriceEntryLocalServiceImpl { /** * This method is used to insert a new CommercePriceEntry or update an * existing one * @ param commercePriceEntryId - < b > Only < / b > used when updating an entity * the matching one will be updated * @ param cpInstanceId - < b > Only < / b > used when adding a new entity * @ param commercePriceListId - < b > Only < / b > used when adding a new entity * to a price list * @ param externalReferenceCode - The external identifier code from a 3rd * party system to be able to locate the same entity in the portal * < b > Only < / b > used when updating an entity ; the first entity with a * matching reference code one will be updated * @ param price * @ param promoPrice * @ param skuExternalReferenceCode - < b > Only < / b > used when adding a new * entity , similar as < code > cpInstanceId < / code > but the external * identifier code from a 3rd party system . If cpInstanceId is used , * it doesn ' t have any effect , otherwise it tries to fetch the * CPInstance against the external code reference * @ param serviceContext * @ return CommercePriceEntry * @ throws PortalException * @ review */ @ Indexable ( type = IndexableType . REINDEX ) @ Override public CommercePriceEntry upsertCommercePriceEntry ( long commercePriceEntryId , long cProductId , String cpInstanceUuid , long commercePriceListId , String externalReferenceCode , BigDecimal price , BigDecimal promoPrice , String skuExternalReferenceCode , ServiceContext serviceContext ) throws PortalException { } }
// Update if ( commercePriceEntryId > 0 ) { try { return updateCommercePriceEntry ( commercePriceEntryId , price , promoPrice , serviceContext ) ; } catch ( NoSuchPriceEntryException nspee ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( "Unable to find price entry with ID: " + commercePriceEntryId ) ; } } } if ( Validator . isNotNull ( externalReferenceCode ) ) { CommercePriceEntry commercePriceEntry = commercePriceEntryPersistence . fetchByC_ERC ( serviceContext . getCompanyId ( ) , externalReferenceCode ) ; if ( commercePriceEntry != null ) { return updateCommercePriceEntry ( commercePriceEntry . getCommercePriceEntryId ( ) , price , promoPrice , serviceContext ) ; } } // Add if ( ( cProductId > 0 ) && ( cpInstanceUuid != null ) ) { validate ( commercePriceListId , cpInstanceUuid ) ; return addCommercePriceEntry ( cProductId , cpInstanceUuid , commercePriceListId , externalReferenceCode , price , promoPrice , serviceContext ) ; } if ( Validator . isNotNull ( skuExternalReferenceCode ) ) { CPInstance cpInstance = _cpInstanceLocalService . getCPInstanceByExternalReferenceCode ( serviceContext . getCompanyId ( ) , skuExternalReferenceCode ) ; validate ( commercePriceListId , cpInstance . getCPInstanceUuid ( ) ) ; CPDefinition cpDefinition = _cpDefinitionLocalService . getCPDefinition ( cpInstance . getCPDefinitionId ( ) ) ; return addCommercePriceEntry ( cpDefinition . getCProductId ( ) , cpInstance . getCPInstanceUuid ( ) , commercePriceListId , externalReferenceCode , price , promoPrice , serviceContext ) ; } StringBundler sb = new StringBundler ( 9 ) ; sb . append ( "{cProductId=" ) ; sb . append ( cProductId ) ; sb . append ( StringPool . COMMA_AND_SPACE ) ; sb . append ( "cpInstanceUuid=" ) ; sb . append ( cpInstanceUuid ) ; sb . append ( StringPool . COMMA_AND_SPACE ) ; sb . append ( "skuExternalReferenceCode=" ) ; sb . append ( skuExternalReferenceCode ) ; sb . append ( CharPool . CLOSE_CURLY_BRACE ) ; throw new NoSuchCPInstanceException ( sb . toString ( ) ) ;
public class HttpServerExchange { /** * Actually resumes reads or writes , if the relevant method has been called . * @ return < code > true < / code > if reads or writes were resumed */ boolean runResumeReadWrite ( ) { } }
boolean ret = false ; if ( anyAreSet ( state , FLAG_SHOULD_RESUME_WRITES ) ) { responseChannel . runResume ( ) ; ret = true ; } if ( anyAreSet ( state , FLAG_SHOULD_RESUME_READS ) ) { requestChannel . runResume ( ) ; ret = true ; } return ret ;
public class LibLoader { /** * Loads a native library with the given { @ link LoadPolicy load policy } . * @ param clazz * The class whose classloader should be used to resolve shipped libraries * @ param name * The name of the class . * @ param policy * The load policy . */ public void loadLibrary ( Class < ? > clazz , String name , LoadPolicy policy ) { } }
if ( loaded . contains ( name ) ) { return ; } switch ( policy ) { case PREFER_SHIPPED : try { loadShippedLibrary ( clazz , name ) ; } catch ( LoadLibraryException ex ) { try { loadSystemLibrary ( name ) ; } catch ( LoadLibraryException ex2 ) { throw ex ; } } break ; case PREFER_SYSTEM : try { loadSystemLibrary ( name ) ; } catch ( LoadLibraryException ex ) { try { loadShippedLibrary ( clazz , name ) ; } catch ( LoadLibraryException ex2 ) { throw ex ; } } break ; case SHIPPED_ONLY : loadShippedLibrary ( clazz , name ) ; break ; case SYSTEM_ONLY : loadSystemLibrary ( name ) ; break ; default : throw new IllegalStateException ( "Unknown policy " + policy ) ; } loaded . add ( name ) ;
public class WSJobRepositoryImpl { /** * { @ inheritDoc } */ @ Override public WSJobExecution createJobExecution ( long jobInstanceId , Properties jobParameters ) { } }
return persistenceManagerService . createJobExecution ( jobInstanceId , jobParameters , new Date ( ) ) ;
public class ShufflingIterable { /** * Returns a new { @ link ShufflingIterable } for the specified iterable and random number generator . * @ param iterable the source iterable * @ param rng the random number generator to use in shuffling the iterable * @ return a new shuffling iterable for contents of the original iterable */ public static < T > ShufflingIterable < T > from ( final Iterable < T > iterable , final Random rng ) { } }
return new ShufflingIterable < > ( iterable , rng ) ;
public class TypesWalker { /** * Walk will stop if visitor tells it ' s enough or when hierarchy incompatibility will be found . * @ param one first type * @ param two second type * @ param visitor visitor */ public static void walk ( final Type one , final Type two , final TypesVisitor visitor ) { } }
// Use possibly more specific generics ( otherwise root class generics would be used as Object and this // way it could be used as upper bound ) // Also , types could contain outer class generics declarations , which must be preserved // e . g . ( Outer < String > . Inner field ) . getGenericType ( ) = = ParameterizedType with parametrized owner // Wrapped into ignore map for very specific case , when type is TypeVariable final Map < String , Type > oneKnownGenerics = new IgnoreGenericsMap ( GenericsResolutionUtils . resolveGenerics ( one , IGNORE_VARS ) ) ; final Map < String , Type > twoKnownGenerics = new IgnoreGenericsMap ( GenericsResolutionUtils . resolveGenerics ( two , IGNORE_VARS ) ) ; // Resolve variables mainly to simplify empty wildcards ( ? extends Object and ? super Object ) to Object // Still have to pass map because of possibly declared outer class generics . Note that for all // types operations ignoring map could be used as we already replaced all variables . These generics // are required only for type context building ( on some level to resolve comparable type ) doWalk ( GenericsUtils . resolveTypeVariables ( one , oneKnownGenerics ) , oneKnownGenerics , GenericsUtils . resolveTypeVariables ( two , twoKnownGenerics ) , twoKnownGenerics , visitor ) ;
public class ListUsageForLicenseConfigurationResult { /** * An array of < code > LicenseConfigurationUsage < / code > objects . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setLicenseConfigurationUsageList ( java . util . Collection ) } or * { @ link # withLicenseConfigurationUsageList ( java . util . Collection ) } if you want to override the existing values . * @ param licenseConfigurationUsageList * An array of < code > LicenseConfigurationUsage < / code > objects . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListUsageForLicenseConfigurationResult withLicenseConfigurationUsageList ( LicenseConfigurationUsage ... licenseConfigurationUsageList ) { } }
if ( this . licenseConfigurationUsageList == null ) { setLicenseConfigurationUsageList ( new java . util . ArrayList < LicenseConfigurationUsage > ( licenseConfigurationUsageList . length ) ) ; } for ( LicenseConfigurationUsage ele : licenseConfigurationUsageList ) { this . licenseConfigurationUsageList . add ( ele ) ; } return this ;
public class IfcProcessImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcRelSequence > getIsSuccessorFrom ( ) { } }
return ( EList < IfcRelSequence > ) eGet ( Ifc4Package . Literals . IFC_PROCESS__IS_SUCCESSOR_FROM , true ) ;
public class FunctionGenerator { /** * Adds the caller of parentExpr to the current body of the last * function that was created . * @ param parentExpr */ private void updateCurrentFunction ( AbstractFunctionExpression parentExpr ) { } }
GroovyExpression expr = parentExpr . getCaller ( ) ; if ( expr instanceof AbstractFunctionExpression ) { AbstractFunctionExpression exprAsFunction = ( AbstractFunctionExpression ) expr ; GroovyExpression exprCaller = exprAsFunction . getCaller ( ) ; parentExpr . setCaller ( exprCaller ) ; updateCurrentFunctionDefintion ( exprAsFunction ) ; }
public class UserLoginProvider { /** * Makes sure there is a UserLogin on a session ; designed to be called by code unrelated to the regular login logic ( the * TemplateExceptionRenderer ) to make sure there ' s at least an anonymous login session set up for that templater * @ param session * @ return */ public UserLogin ensureLoginOnSession ( HttpSession session ) { } }
if ( session . getAttribute ( LOGIN_SESSION_ATTRIBUTE ) == null ) // Fall back on the anonymous user // Save in the " login " session attribute session . setAttribute ( LOGIN_SESSION_ATTRIBUTE , new UserLoginImpl ( null ) ) ; return ( UserLogin ) session . getAttribute ( LOGIN_SESSION_ATTRIBUTE ) ;
public class UserRepository { /** * Validates that the supplied session key is still valid and if so , refreshes it for the * specified number of days . * @ return true if the session was located and refreshed , false if it no longer exists . */ public boolean refreshSession ( String sessionKey , int expireDays ) throws PersistenceException { } }
Calendar cal = Calendar . getInstance ( ) ; cal . add ( Calendar . DATE , expireDays ) ; Date expires = new Date ( cal . getTime ( ) . getTime ( ) ) ; // attempt to update an existing session row , returning true if we found and updated it return ( update ( "update sessions set expires = '" + expires + "' " + "where authcode = " + JDBCUtil . escape ( sessionKey ) ) == 1 ) ;
public class StringGroovyMethods { /** * Appends the String representation of the given operand to this CharSequence . * @ param left a CharSequence * @ param value any Object * @ return the original toString ( ) of the CharSequence with the object appended * @ since 1.8.2 */ public static String plus ( CharSequence left , Object value ) { } }
return left + DefaultGroovyMethods . toString ( value ) ;
public class Condition { /** * With Valid Json Path . * Check to see if incoming path has a valid string value selected via a < a href = " https : / / github . com / jayway / JsonPath / " > * JSONPath < / a > expression . */ public static Condition withPostBodyContainingJsonPath ( final String pattern , final Object value ) { } }
return new Condition ( input -> value . equals ( JsonPath . parse ( input . getPostBody ( ) ) . read ( pattern ) ) ) ;
public class ManagedResourceSummaryMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ManagedResourceSummary managedResourceSummary , ProtocolMarshaller protocolMarshaller ) { } }
if ( managedResourceSummary == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( managedResourceSummary . getResourceType ( ) , RESOURCETYPE_BINDING ) ; protocolMarshaller . marshall ( managedResourceSummary . getAssociationCount ( ) , ASSOCIATIONCOUNT_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class KeyedMultiObjectPool { /** * { @ inheritDoc } */ @ Override protected void onShutDown ( ) { } }
for ( PoolKey < K > k : pool . keySet ( ) ) { PoolableObjects < V > pobjs = objectPool ( k , Boolean . FALSE ) ; pobjs . shutdown ( ) ; }
public class RandomVariableDifferentiableAADStochasticNonOptimized { /** * / * ( non - Javadoc ) * @ see net . finmath . stochastic . RandomVariable # sub ( net . finmath . stochastic . RandomVariable ) */ @ Override public RandomVariable sub ( RandomVariable randomVariable ) { } }
return new RandomVariableDifferentiableAADStochasticNonOptimized ( getValues ( ) . sub ( randomVariable ) , Arrays . asList ( this , randomVariable ) , OperatorType . SUB ) ;
public class AbstractEditor { /** * Method to obtain a message from the message source * defined via the services locator , at the default locale . */ protected String getMessage ( String key , Object [ ] params ) { } }
MessageSource messageSource = ValkyrieRepository . getInstance ( ) . getApplicationConfig ( ) . messageSource ( ) ; return messageSource . getMessage ( key , params , Locale . getDefault ( ) ) ;
public class RosterEntry { /** * Convert a roster entry with the given name to a roster item . As per RFC 6121 § 2.1.2.2 . , clients MUST NOT include * the ' ask ' attribute , thus set { @ code includeAskAttribute } to { @ code false } . * @ param entry the roster entry . * @ param name the name of the roster item . * @ param includeAskAttribute whether or not to include the ' ask ' attribute . * @ return the roster item . */ private static RosterPacket . Item toRosterItem ( RosterEntry entry , String name , boolean includeAskAttribute ) { } }
RosterPacket . Item item = new RosterPacket . Item ( entry . getJid ( ) , name ) ; item . setItemType ( entry . getType ( ) ) ; if ( includeAskAttribute ) { item . setSubscriptionPending ( entry . isSubscriptionPending ( ) ) ; } item . setApproved ( entry . isApproved ( ) ) ; // Set the correct group names for the item . for ( RosterGroup group : entry . getGroups ( ) ) { item . addGroupName ( group . getName ( ) ) ; } return item ;
public class GrahamScanConvexHull2D { /** * Find the starting point , and sort it to the beginning of the list . The * starting point must be on the outer hull . Any " most extreme " point will do , * e . g . the one with the lowest Y coordinate and for ties with the lowest X . */ private void findStartingPoint ( ) { } }
// Well , we already know the best Y value . . . final double bestY = minmaxY . getMin ( ) ; double bestX = Double . POSITIVE_INFINITY ; int bestI = - 1 ; Iterator < double [ ] > iter = this . points . iterator ( ) ; for ( int i = 0 ; iter . hasNext ( ) ; i ++ ) { double [ ] vec = iter . next ( ) ; if ( vec [ 1 ] == bestY && vec [ 0 ] < bestX ) { bestX = vec [ 0 ] ; bestI = i ; } } assert ( bestI >= 0 ) ; // Bring the reference object to the head . if ( bestI > 0 ) { points . add ( 0 , points . remove ( bestI ) ) ; }
public class HierarchyDiscovery { /** * Processing part . Every type variable is mapped to the actual type in the resolvedTypeVariablesMap . This map is used later * on for resolving types . */ private void processTypeVariables ( TypeVariable < ? > [ ] variables , Type [ ] values ) { } }
for ( int i = 0 ; i < variables . length ; i ++ ) { processTypeVariable ( variables [ i ] , values [ i ] ) ; }
public class RelatedGregorianYearRule { /** * ~ Methoden - - - - - */ @ Override public Integer getValue ( T context ) { } }
CalendarSystem < T > calsys = this . getCalendarSystem ( context ) ; T start = context . with ( this . dayOfYear , 1 ) ; return toGregorianYear ( calsys . transform ( start ) ) ;
public class OpDeprecation { /** * < pre > * Explanation of why it was deprecated and what to use instead . * < / pre > * < code > optional string explanation = 2 ; < / code > */ public com . google . protobuf . ByteString getExplanationBytes ( ) { } }
java . lang . Object ref = explanation_ ; if ( ref instanceof java . lang . String ) { com . google . protobuf . ByteString b = com . google . protobuf . ByteString . copyFromUtf8 ( ( java . lang . String ) ref ) ; explanation_ = b ; return b ; } else { return ( com . google . protobuf . ByteString ) ref ; }
public class CollectionData { /** * Puts data into this data tree at the specified key string . * @ param keyStr One or more map keys and / or list indices ( separated by ' . ' if multiple parts ) . * Indicates the path to the location within this data tree . * @ param value The data to put at the specified location . */ public void put ( String keyStr , SoyData value ) { } }
List < String > keys = split ( keyStr , '.' ) ; int numKeys = keys . size ( ) ; CollectionData collectionData = this ; for ( int i = 0 ; i <= numKeys - 2 ; ++ i ) { SoyData nextSoyData = collectionData . getSingle ( keys . get ( i ) ) ; if ( nextSoyData != null && ! ( nextSoyData instanceof CollectionData ) ) { throw new SoyDataException ( "Failed to evaluate key string \"" + keyStr + "\" for put()." ) ; } CollectionData nextCollectionData = ( CollectionData ) nextSoyData ; if ( nextCollectionData == null ) { // Create the SoyData object that will be bound to keys . get ( i ) . We need to check the first // part of keys [ i + 1 ] to know whether to create a SoyMapData or SoyListData ( checking the // first char is sufficient ) . nextCollectionData = ( Character . isDigit ( keys . get ( i + 1 ) . charAt ( 0 ) ) ) ? new SoyListData ( ) : new SoyMapData ( ) ; collectionData . putSingle ( keys . get ( i ) , nextCollectionData ) ; } collectionData = nextCollectionData ; } collectionData . putSingle ( keys . get ( numKeys - 1 ) , ensureValidValue ( value ) ) ;
public class GroovyScript2RestLoader { /** * This method is useful for clients that can send script in request body * without form - data . At required to set specific Content - type header * ' script / groovy ' . * @ param stream the stream that contains groovy source code * @ param uriInfo see javax . ws . rs . core . UriInfo * @ param repository repository name * @ param workspace workspace name * @ param path path to resource to be created * @ return Response with status ' created ' * @ request * { code } * " stream " : the input stream that contains groovy source code * { code } * @ LevelAPI Provisional */ @ POST @ Consumes ( { } }
"script/groovy" } ) @ Path ( "add/{repository}/{workspace}/{path:.*}" ) public Response addScript ( InputStream stream , @ Context UriInfo uriInfo , @ PathParam ( "repository" ) String repository , @ PathParam ( "workspace" ) String workspace , @ PathParam ( "path" ) String path ) { Session ses = null ; try { ses = sessionProviderService . getSessionProvider ( null ) . getSession ( workspace , repositoryService . getRepository ( repository ) ) ; Node node = ( Node ) ses . getItem ( getPath ( path ) ) ; createScript ( node , getName ( path ) , false , stream ) ; ses . save ( ) ; URI location = uriInfo . getBaseUriBuilder ( ) . path ( getClass ( ) , "getScript" ) . build ( repository , workspace , path ) ; return Response . created ( location ) . build ( ) ; } catch ( PathNotFoundException e ) { String msg = "Path " + path + " does not exists" ; LOG . error ( msg ) ; return Response . status ( Response . Status . NOT_FOUND ) . entity ( msg ) . entity ( MediaType . TEXT_PLAIN ) . build ( ) ; } catch ( Exception e ) { LOG . error ( e . getMessage ( ) , e ) ; return Response . status ( Response . Status . INTERNAL_SERVER_ERROR ) . entity ( e . getMessage ( ) ) . type ( MediaType . TEXT_PLAIN ) . build ( ) ; } finally { if ( ses != null ) { ses . logout ( ) ; } }
public class Guestbook { /** * Add a greeting to the specified guestbook . */ private void addGreeting ( String guestbookName , String user , String message ) throws DatastoreException { } }
Entity . Builder greeting = Entity . newBuilder ( ) ; greeting . setKey ( makeKey ( GUESTBOOK_KIND , guestbookName , GREETING_KIND ) ) ; greeting . getMutableProperties ( ) . put ( USER_PROPERTY , makeValue ( user ) . build ( ) ) ; greeting . getMutableProperties ( ) . put ( MESSAGE_PROPERTY , makeValue ( message ) . build ( ) ) ; greeting . getMutableProperties ( ) . put ( DATE_PROPERTY , makeValue ( new Date ( ) ) . build ( ) ) ; Key greetingKey = insert ( greeting . build ( ) ) ; System . out . println ( "greeting key is: " + greetingKey ) ;
public class SqlDateTimeUtils { /** * Parse date time string to timestamp based on the given time zone string and format . * Returns null if parsing failed . * @ param dateStr the date time string * @ param format the date time string format * @ param tzStr the time zone id string */ public static Long toTimestampTz ( String dateStr , String format , String tzStr ) { } }
TimeZone tz = TIMEZONE_CACHE . get ( tzStr ) ; return toTimestamp ( dateStr , format , tz ) ;
public class ZKPaths { /** * Return the children of the given path sorted by sequence number * @ param zookeeper the client * @ param path the path * @ return sorted list of children * @ throws InterruptedException thread interruption * @ throws org . apache . zookeeper . KeeperException zookeeper errors */ public static List < String > getSortedChildren ( ZooKeeper zookeeper , String path ) throws InterruptedException , KeeperException { } }
List < String > children = zookeeper . getChildren ( path , false ) ; List < String > sortedList = Lists . newArrayList ( children ) ; Collections . sort ( sortedList ) ; return sortedList ;
public class ConnectOperation { /** * Emits BluetoothGatt and completes after connection is established . * @ return BluetoothGatt after connection reaches { @ link com . polidea . rxandroidble2 . RxBleConnection . RxBleConnectionState # CONNECTED } * state . * @ throws com . polidea . rxandroidble2 . exceptions . BleDisconnectedException if connection was disconnected / failed before * it was established . */ @ NonNull private Single < BluetoothGatt > getConnectedBluetoothGatt ( ) { } }
// start connecting the BluetoothGatt // note : Due to different Android BLE stack implementations it is not certain whether ` connectGatt ( ) ` or ` BluetoothGattCallback ` // will emit BluetoothGatt first return Single . create ( new SingleOnSubscribe < BluetoothGatt > ( ) { @ Override public void subscribe ( final SingleEmitter < BluetoothGatt > emitter ) throws Exception { final DisposableSingleObserver < BluetoothGatt > disposableGattObserver = getBluetoothGattAndChangeStatusToConnected ( ) // when the connected state will be emitted bluetoothGattProvider should contain valid Gatt . delaySubscription ( rxBleGattCallback . getOnConnectionStateChange ( ) . filter ( new Predicate < RxBleConnection . RxBleConnectionState > ( ) { @ Override public boolean test ( RxBleConnection . RxBleConnectionState rxBleConnectionState ) throws Exception { return rxBleConnectionState == CONNECTED ; } } ) ) // disconnect may happen even if the connection was not established yet . mergeWith ( rxBleGattCallback . < BluetoothGatt > observeDisconnect ( ) . firstOrError ( ) ) . firstOrError ( ) . subscribeWith ( disposableSingleObserverFromEmitter ( emitter ) ) ; emitter . setDisposable ( disposableGattObserver ) ; connectionStateChangedAction . onConnectionStateChange ( CONNECTING ) ; /* * Apparently the connection may be established fast enough to introduce a race condition so the subscription * must be established first before starting the connection . * https : / / github . com / Polidea / RxAndroidBle / issues / 178 */ final BluetoothGatt bluetoothGatt = connectionCompat . connectGatt ( bluetoothDevice , autoConnect , rxBleGattCallback . getBluetoothGattCallback ( ) ) ; /* * Update BluetoothGatt when connection is initiated . It is not certain * if this or RxBleGattCallback . onConnectionStateChange will be first . */ bluetoothGattProvider . updateBluetoothGatt ( bluetoothGatt ) ; } } ) ;
public class CSVExporter { /** * Export all XYChart series as columns in separate CSV files . * @ param chart * @ param path2Dir */ public static void writeCSVColumns ( XYChart chart , String path2Dir ) { } }
for ( XYSeries xySeries : chart . getSeriesMap ( ) . values ( ) ) { writeCSVColumns ( xySeries , path2Dir ) ; }
public class AwsS3ServiceClientImpl { /** * Puts an object . * @ param bucket the bucket to put the object in . * @ param key the key ( or name ) of the object . * @ param acl the ACL to apply to the object ( e . g . private ) . * @ param contentType the content type of the object ( e . g . application / json ) . * @ param body the body of the object . * @ return the result of the put which contains the location of the object . */ public AwsS3PutObjectResult putObject ( @ Nonnull final String bucket , @ Nonnull final String key , @ Nonnull final String acl , @ Nonnull final String contentType , @ Nonnull final String body ) { } }
return proxy . putObject ( bucket , key , acl , contentType , body ) ;
public class TextUtils { /** * Split the input on the given separator char , and unescape each portion using the escape char and special chars * @ param input input string * @ param separator char separating each component * @ param echar escape char * @ param special chars that are escaped * @ return results */ public static String [ ] splitUnescape ( String input , char separator , char echar , char [ ] special ) { } }
return splitUnescape ( input , new char [ ] { separator } , echar , special ) ;
public class IMatrix { /** * Creates a vector with the content of a row from this matrix */ public IVector getVectorFromRow ( int index ) { } }
IVector result = new IVector ( columns ) ; for ( int i = 0 ; i < columns ; i ++ ) { result . realvector [ i ] = realmatrix [ index ] [ i ] ; result . imagvector [ i ] = imagmatrix [ index ] [ i ] ; } return result ;
public class BusNetwork { /** * Remove a bus stop from this network . * If this bus stop removal implies empty hubs , these hubs * will be also removed . * @ param busStop is the bus stop to remove . * @ return < code > true < / code > if the bus stop was successfully removed , otherwise < code > false < / code > */ public boolean removeBusStop ( BusStop busStop ) { } }
if ( this . validBusStops . remove ( busStop ) ) { busStop . setContainer ( null ) ; busStop . setEventFirable ( true ) ; fireShapeChanged ( new BusChangeEvent ( this , BusChangeEventType . STOP_REMOVED , busStop , - 1 , "shape" , // $ NON - NLS - 1 $ null , null ) ) ; checkPrimitiveValidity ( ) ; return true ; } final int idx = ListUtil . remove ( this . invalidBusStops , INVALID_STOP_COMPARATOR , busStop ) ; if ( idx >= 0 ) { busStop . setContainer ( null ) ; fireShapeChanged ( new BusChangeEvent ( this , BusChangeEventType . STOP_REMOVED , busStop , - 1 , "shape" , // $ NON - NLS - 1 $ null , null ) ) ; checkPrimitiveValidity ( ) ; return true ; } return false ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link GeneratorType } * { @ code > } */ @ XmlElementDecl ( namespace = "http://www.w3.org/2005/Atom" , name = "generator" , scope = SourceType . class ) public JAXBElement < GeneratorType > createSourceTypeGenerator ( GeneratorType value ) { } }
return new JAXBElement < GeneratorType > ( FEED_TYPE_GENERATOR_QNAME , GeneratorType . class , SourceType . class , value ) ;
public class UserList { /** * Sets the listType value for this UserList . * @ param listType * Type of this list : remarketing / logical / external remarketing . * < span class = " constraint Selectable " > This field can be selected using * the value " ListType " . < / span > < span class = " constraint Filterable " > This * field can be filtered on . < / span > * < span class = " constraint ReadOnly " > This field is read * only and will be ignored when sent to the API . < / span > */ public void setListType ( com . google . api . ads . adwords . axis . v201809 . rm . UserListType listType ) { } }
this . listType = listType ;
public class Unchecked { /** * Wrap a { @ link CheckedIntUnaryOperator } in a { @ link IntUnaryOperator } with a custom handler for checked exceptions . * Example : * < code > < pre > * IntStream . of ( 1 , 2 , 3 ) . map ( Unchecked . intUnaryOperator ( * if ( i & lt ; 0) * throw new Exception ( " Only positive numbers allowed " ) ; * return i ; * throw new IllegalStateException ( e ) ; * < / pre > < / code > */ public static IntUnaryOperator intUnaryOperator ( CheckedIntUnaryOperator operator , Consumer < Throwable > handler ) { } }
return t -> { try { return operator . applyAsInt ( t ) ; } catch ( Throwable e ) { handler . accept ( e ) ; throw new IllegalStateException ( "Exception handler must throw a RuntimeException" , e ) ; } } ;
public class WeightedDirectedMultigraph { /** * { @ inheritDoc } */ public int degree ( int vertex ) { } }
SparseWeightedDirectedTypedEdgeSet < T > edges = vertexToEdges . get ( vertex ) ; return ( edges == null ) ? 0 : edges . size ( ) ;
public class ContentSpec { /** * Sets the Content Specifications title . * @ param title The title for the content specification */ public void setTitle ( final String title ) { } }
if ( title == null && this . title == null ) { return ; } else if ( title == null ) { removeChild ( this . title ) ; this . title = null ; } else if ( this . title == null ) { this . title = new KeyValueNode < String > ( CommonConstants . CS_TITLE_TITLE , title ) ; appendChild ( this . title , false ) ; } else { this . title . setValue ( title ) ; }
public class GeneralPurposeFFT_F32_1D { /** * radb5 : Real FFT ' s backward processing of factor 5 */ void radb5 ( final int ido , final int l1 , final float in [ ] , final int in_off , final float out [ ] , final int out_off , final int offset ) { } }
final float tr11 = 0.309016994374947451262869435595348477f ; final float ti11 = 0.951056516295153531181938433292089030f ; final float tr12 = - 0.809016994374947340240566973079694435f ; final float ti12 = 0.587785252292473248125759255344746634f ; int i , ic ; float ci2 , ci3 , ci4 , ci5 , di3 , di4 , di5 , di2 , cr2 , cr3 , cr5 , cr4 , ti2 , ti3 , ti4 , ti5 , dr3 , dr4 , dr5 , dr2 , tr2 , tr3 , tr4 , tr5 , w1r , w1i , w2r , w2i , w3r , w3i , w4r , w4i ; int iw1 , iw2 , iw3 , iw4 ; iw1 = offset ; iw2 = iw1 + ido ; iw3 = iw2 + ido ; iw4 = iw3 + ido ; int idx0 = l1 * ido ; for ( int k = 0 ; k < l1 ; k ++ ) { int idx1 = k * ido ; int idx2 = 5 * idx1 ; int idx3 = idx2 + ido ; int idx4 = idx3 + ido ; int idx5 = idx4 + ido ; int idx6 = idx5 + ido ; int idx7 = idx1 + idx0 ; int idx8 = idx7 + idx0 ; int idx9 = idx8 + idx0 ; int idx10 = idx9 + idx0 ; int idx11 = in_off + ido - 1 ; float i1r = in [ in_off + idx2 ] ; ti5 = 2 * in [ in_off + idx4 ] ; ti4 = 2 * in [ in_off + idx6 ] ; tr2 = 2 * in [ idx11 + idx3 ] ; tr3 = 2 * in [ idx11 + idx5 ] ; cr2 = i1r + tr11 * tr2 + tr12 * tr3 ; cr3 = i1r + tr12 * tr2 + tr11 * tr3 ; ci5 = ti11 * ti5 + ti12 * ti4 ; ci4 = ti12 * ti5 - ti11 * ti4 ; out [ out_off + idx1 ] = i1r + tr2 + tr3 ; out [ out_off + idx7 ] = cr2 - ci5 ; out [ out_off + idx8 ] = cr3 - ci4 ; out [ out_off + idx9 ] = cr3 + ci4 ; out [ out_off + idx10 ] = cr2 + ci5 ; } if ( ido == 1 ) return ; for ( int k = 0 ; k < l1 ; ++ k ) { int idx1 = k * ido ; int idx2 = 5 * idx1 ; int idx3 = idx2 + ido ; int idx4 = idx3 + ido ; int idx5 = idx4 + ido ; int idx6 = idx5 + ido ; int idx7 = idx1 + idx0 ; int idx8 = idx7 + idx0 ; int idx9 = idx8 + idx0 ; int idx10 = idx9 + idx0 ; for ( i = 2 ; i < ido ; i += 2 ) { ic = ido - i ; int widx1 = i - 1 + iw1 ; int widx2 = i - 1 + iw2 ; int widx3 = i - 1 + iw3 ; int widx4 = i - 1 + iw4 ; w1r = wtable_r [ widx1 - 1 ] ; w1i = wtable_r [ widx1 ] ; w2r = wtable_r [ widx2 - 1 ] ; w2i = wtable_r [ widx2 ] ; w3r = wtable_r [ widx3 - 1 ] ; w3i = wtable_r [ widx3 ] ; w4r = wtable_r [ widx4 - 1 ] ; w4i = wtable_r [ widx4 ] ; int idx15 = in_off + i ; int idx16 = in_off + ic ; int idx17 = out_off + i ; int iidx1 = idx15 + idx2 ; int iidx2 = idx16 + idx3 ; int iidx3 = idx15 + idx4 ; int iidx4 = idx16 + idx5 ; int iidx5 = idx15 + idx6 ; float i1i = in [ iidx1 - 1 ] ; float i1r = in [ iidx1 ] ; float i2i = in [ iidx2 - 1 ] ; float i2r = in [ iidx2 ] ; float i3i = in [ iidx3 - 1 ] ; float i3r = in [ iidx3 ] ; float i4i = in [ iidx4 - 1 ] ; float i4r = in [ iidx4 ] ; float i5i = in [ iidx5 - 1 ] ; float i5r = in [ iidx5 ] ; ti5 = i3r + i2r ; ti2 = i3r - i2r ; ti4 = i5r + i4r ; ti3 = i5r - i4r ; tr5 = i3i - i2i ; tr2 = i3i + i2i ; tr4 = i5i - i4i ; tr3 = i5i + i4i ; cr2 = i1i + tr11 * tr2 + tr12 * tr3 ; ci2 = i1r + tr11 * ti2 + tr12 * ti3 ; cr3 = i1i + tr12 * tr2 + tr11 * tr3 ; ci3 = i1r + tr12 * ti2 + tr11 * ti3 ; cr5 = ti11 * tr5 + ti12 * tr4 ; ci5 = ti11 * ti5 + ti12 * ti4 ; cr4 = ti12 * tr5 - ti11 * tr4 ; ci4 = ti12 * ti5 - ti11 * ti4 ; dr3 = cr3 - ci4 ; dr4 = cr3 + ci4 ; di3 = ci3 + cr4 ; di4 = ci3 - cr4 ; dr5 = cr2 + ci5 ; dr2 = cr2 - ci5 ; di5 = ci2 - cr5 ; di2 = ci2 + cr5 ; int oidx1 = idx17 + idx1 ; int oidx2 = idx17 + idx7 ; int oidx3 = idx17 + idx8 ; int oidx4 = idx17 + idx9 ; int oidx5 = idx17 + idx10 ; out [ oidx1 - 1 ] = i1i + tr2 + tr3 ; out [ oidx1 ] = i1r + ti2 + ti3 ; out [ oidx2 - 1 ] = w1r * dr2 - w1i * di2 ; out [ oidx2 ] = w1r * di2 + w1i * dr2 ; out [ oidx3 - 1 ] = w2r * dr3 - w2i * di3 ; out [ oidx3 ] = w2r * di3 + w2i * dr3 ; out [ oidx4 - 1 ] = w3r * dr4 - w3i * di4 ; out [ oidx4 ] = w3r * di4 + w3i * dr4 ; out [ oidx5 - 1 ] = w4r * dr5 - w4i * di5 ; out [ oidx5 ] = w4r * di5 + w4i * dr5 ; } }
public class Router { /** * SUBSCRIPTION */ protected void subscribe ( Routee < P > routee ) { } }
if ( ! routees . contains ( routee ) ) routees . add ( routee ) ;
public class BoxesRunTime { /** * arg . toInt */ public static java . lang . Integer toInteger ( Object arg ) throws NoSuchMethodException { } }
if ( arg instanceof java . lang . Integer ) return ( java . lang . Integer ) arg ; if ( arg instanceof java . lang . Long ) return boxToInteger ( ( int ) unboxToLong ( arg ) ) ; if ( arg instanceof java . lang . Double ) return boxToInteger ( ( int ) unboxToDouble ( arg ) ) ; if ( arg instanceof java . lang . Float ) return boxToInteger ( ( int ) unboxToFloat ( arg ) ) ; if ( arg instanceof java . lang . Character ) return boxToInteger ( ( int ) unboxToChar ( arg ) ) ; if ( arg instanceof java . lang . Byte ) return boxToInteger ( ( int ) unboxToByte ( arg ) ) ; if ( arg instanceof java . lang . Short ) return boxToInteger ( ( int ) unboxToShort ( arg ) ) ; throw new NoSuchMethodException ( ) ;
public class DescribeStreamRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeStreamRequest describeStreamRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeStreamRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeStreamRequest . getStreamName ( ) , STREAMNAME_BINDING ) ; protocolMarshaller . marshall ( describeStreamRequest . getStreamARN ( ) , STREAMARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class AbstractUdfOperator { /** * Binds the result produced by a plan rooted at { @ code root } to a variable * used by the UDF wrapped in this operator . * @ param root The root of the plan producing this input . */ public void setBroadcastVariable ( String name , Operator < ? > root ) { } }
if ( name == null ) { throw new IllegalArgumentException ( "The broadcast input name may not be null." ) ; } if ( root == null ) { throw new IllegalArgumentException ( "The broadcast input root operator may not be null." ) ; } this . broadcastInputs . put ( name , root ) ;
public class CudaZeroHandler { /** * This method returns total number of allocated objects in host memory * @ return */ @ Override public long getAllocatedHostObjects ( ) { } }
AtomicLong counter = new AtomicLong ( 0 ) ; for ( Long threadId : zeroAllocations . keySet ( ) ) { counter . addAndGet ( zeroAllocations . get ( threadId ) . size ( ) ) ; } return counter . get ( ) ;
public class AbstractDepthFirstSearch { /** * Classify CROSS and FORWARD edges */ private void classifyUnknownEdges ( ) { } }
Iterator < EdgeType > edgeIter = graph . edgeIterator ( ) ; while ( edgeIter . hasNext ( ) ) { EdgeType edge = edgeIter . next ( ) ; int dfsEdgeType = getDFSEdgeType ( edge ) ; if ( dfsEdgeType == UNKNOWN_EDGE ) { int srcDiscoveryTime = getDiscoveryTime ( getSource ( edge ) ) ; int destDiscoveryTime = getDiscoveryTime ( getTarget ( edge ) ) ; if ( srcDiscoveryTime < destDiscoveryTime ) { // If the source was visited earlier than the // target , it ' s a forward edge . dfsEdgeType = FORWARD_EDGE ; } else { // If the source was visited later than the // target , it ' s a cross edge . dfsEdgeType = CROSS_EDGE ; } setDFSEdgeType ( edge , dfsEdgeType ) ; } }
public class PathUtils { /** * List files ONLY , not include directories . */ public static List < File > listFiles ( File dir , FileFilter filter , boolean recursive ) { } }
List < File > list = new ArrayList < File > ( ) ; listFilesInternal ( list , dir , filter , recursive ) ; return list ;
public class EventMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Event event , ProtocolMarshaller protocolMarshaller ) { } }
if ( event == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( event . getEventId ( ) , EVENTID_BINDING ) ; protocolMarshaller . marshall ( event . getEventName ( ) , EVENTNAME_BINDING ) ; protocolMarshaller . marshall ( event . getReadOnly ( ) , READONLY_BINDING ) ; protocolMarshaller . marshall ( event . getAccessKeyId ( ) , ACCESSKEYID_BINDING ) ; protocolMarshaller . marshall ( event . getEventTime ( ) , EVENTTIME_BINDING ) ; protocolMarshaller . marshall ( event . getEventSource ( ) , EVENTSOURCE_BINDING ) ; protocolMarshaller . marshall ( event . getUsername ( ) , USERNAME_BINDING ) ; protocolMarshaller . marshall ( event . getResources ( ) , RESOURCES_BINDING ) ; protocolMarshaller . marshall ( event . getCloudTrailEvent ( ) , CLOUDTRAILEVENT_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class AsyncAppender { /** * Initialize the batcher that stores the messages and calls the underlying * appenders . * @ param appenderName * - The name of the appender for which the batcher is created */ private void initBatcher ( String appenderName ) { } }
MessageProcessor < LoggingEvent > messageProcessor = new MessageProcessor < LoggingEvent > ( ) { @ Override public void process ( List < LoggingEvent > objects ) { processLoggingEvents ( objects ) ; } } ; String batcherName = this . getClass ( ) . getName ( ) + BATCHER_NAME_LIMITER + appenderName ; batcher = BatcherFactory . createBatcher ( batcherName , messageProcessor ) ; batcher . setTarget ( messageProcessor ) ;
public class CmsDirectEditEntryPoint { /** * Toggles the visibility of the toolbar . < p > * @ param show < code > true < / code > to show the toolbar */ protected void toggleToolbar ( boolean show ) { } }
if ( show ) { CmsDebugLog . consoleLog ( "Showing toolbar" ) ; CmsToolbar . showToolbar ( m_toolbar , true , m_toolbarVisibility , I_CmsLayoutBundle . INSTANCE . toolbarCss ( ) . simpleToolbarShow ( ) ) ; saveToolbarVisibility ( true ) ; } else { CmsDebugLog . consoleLog ( "Hiding toolbar" ) ; CmsToolbar . showToolbar ( m_toolbar , false , m_toolbarVisibility , I_CmsLayoutBundle . INSTANCE . toolbarCss ( ) . simpleToolbarShow ( ) ) ; saveToolbarVisibility ( false ) ; }
public class CommonTree { /** * For every node in this subtree , make sure it ' s start / stop token ' s * are set . Walk depth first , visit bottom up . Only updates nodes * with at least one token index & lt ; 0. */ public void setUnknownTokenBoundaries ( ) { } }
if ( children == null ) { if ( startIndex < 0 || stopIndex < 0 ) { startIndex = stopIndex = token . getTokenIndex ( ) ; } return ; } for ( int i = 0 ; i < children . size ( ) ; i ++ ) { ( ( CommonTree ) children . get ( i ) ) . setUnknownTokenBoundaries ( ) ; } if ( startIndex >= 0 && stopIndex >= 0 ) return ; // already set if ( children . size ( ) > 0 ) { CommonTree firstChild = ( CommonTree ) children . get ( 0 ) ; CommonTree lastChild = ( CommonTree ) children . get ( children . size ( ) - 1 ) ; startIndex = firstChild . getTokenStartIndex ( ) ; stopIndex = lastChild . getTokenStopIndex ( ) ; }
public class UserCredentials { /** * Sets the value of the given field . Any existing value for that field is * replaced . * @ param field * The field whose value should be assigned . * @ param value * The value to assign to the given field . * @ return * The previous value of the field , or null if the value of the field * was not previously defined . */ public String setValue ( Field field , String value ) { } }
return setValue ( field . getName ( ) , value ) ;
public class AdminReqheaderAction { public static OptionalEntity < RequestHeader > getEntity ( final CreateForm form , final String username , final long currentTime ) { } }
switch ( form . crudMode ) { case CrudMode . CREATE : return OptionalEntity . of ( new RequestHeader ( ) ) . map ( entity -> { entity . setCreatedBy ( username ) ; entity . setCreatedTime ( currentTime ) ; return entity ; } ) ; case CrudMode . EDIT : if ( form instanceof EditForm ) { return ComponentUtil . getComponent ( RequestHeaderService . class ) . getRequestHeader ( ( ( EditForm ) form ) . id ) ; } break ; default : break ; } return OptionalEntity . empty ( ) ;
public class OsmMapShapeConverter { /** * Convert a { @ link Geometry } to a Map shape * @ param geometry * @ return */ @ SuppressWarnings ( "unchecked" ) public OsmDroidMapShape toShape ( Geometry geometry ) { } }
OsmDroidMapShape shape = null ; GeometryType geometryType = geometry . getGeometryType ( ) ; switch ( geometryType ) { case POINT : shape = new OsmDroidMapShape ( geometryType , OsmMapShapeType . LAT_LNG , toLatLng ( ( Point ) geometry ) ) ; break ; case LINESTRING : shape = new OsmDroidMapShape ( geometryType , OsmMapShapeType . POLYLINE_OPTIONS , toPolyline ( ( LineString ) geometry ) ) ; break ; case POLYGON : shape = new OsmDroidMapShape ( geometryType , OsmMapShapeType . POLYGON_OPTIONS , toPolygon ( ( Polygon ) geometry ) ) ; break ; case MULTIPOINT : shape = new OsmDroidMapShape ( geometryType , OsmMapShapeType . MULTI_LAT_LNG , toLatLngs ( ( MultiPoint ) geometry ) ) ; break ; case MULTILINESTRING : shape = new OsmDroidMapShape ( geometryType , OsmMapShapeType . MULTI_POLYLINE_OPTIONS , toPolylines ( ( MultiLineString ) geometry ) ) ; break ; case MULTIPOLYGON : shape = new OsmDroidMapShape ( geometryType , OsmMapShapeType . MULTI_POLYGON_OPTIONS , toPolygons ( ( MultiPolygon ) geometry ) ) ; break ; case CIRCULARSTRING : shape = new OsmDroidMapShape ( geometryType , OsmMapShapeType . POLYLINE_OPTIONS , toPolyline ( ( CircularString ) geometry ) ) ; break ; case COMPOUNDCURVE : shape = new OsmDroidMapShape ( geometryType , OsmMapShapeType . MULTI_POLYLINE_OPTIONS , toPolylines ( ( CompoundCurve ) geometry ) ) ; break ; case CURVEPOLYGON : shape = new OsmDroidMapShape ( geometryType , OsmMapShapeType . POLYGON_OPTIONS , toCurvePolygon ( ( CurvePolygon ) geometry ) ) ; break ; case POLYHEDRALSURFACE : shape = new OsmDroidMapShape ( geometryType , OsmMapShapeType . MULTI_POLYGON_OPTIONS , toPolygons ( ( PolyhedralSurface ) geometry ) ) ; break ; case TIN : shape = new OsmDroidMapShape ( geometryType , OsmMapShapeType . MULTI_POLYGON_OPTIONS , toPolygons ( ( TIN ) geometry ) ) ; break ; case TRIANGLE : shape = new OsmDroidMapShape ( geometryType , OsmMapShapeType . POLYGON_OPTIONS , toPolygon ( ( Triangle ) geometry ) ) ; break ; case GEOMETRYCOLLECTION : shape = new OsmDroidMapShape ( geometryType , OsmMapShapeType . COLLECTION , toShapes ( ( GeometryCollection < Geometry > ) geometry ) ) ; break ; default : throw new GeoPackageException ( "Unsupported Geometry Type: " + geometryType . getName ( ) ) ; } return shape ;
public class DataSet { /** * Applies a Map transformation on a { @ link DataSet } . < br / > * The transformation calls a { @ link MapFunction } for each element of the DataSet . * Each MapFunction call returns exactly one element . * @ param mapper The MapFunction that is called for each element of the DataSet . * @ return A MapOperator that represents the transformed DataSet . * @ see MapFunction * @ see MapOperator * @ see DataSet */ public < R > MapOperator < T , R > map ( MapFunction < T , R > mapper ) { } }
if ( mapper == null ) { throw new NullPointerException ( "Map function must not be null." ) ; } return new MapOperator < T , R > ( this , mapper ) ;
public class LastActivityManager { /** * wait until the last activity is stopped * @ param timeOutInMillis timeout for wait */ public void waitForAllActivitiesDestroy ( int timeOutInMillis ) { } }
synchronized ( activityStack ) { long start = System . currentTimeMillis ( ) ; long now = start ; while ( ! activityStack . isEmpty ( ) && start + timeOutInMillis > now ) { try { activityStack . wait ( start - now + timeOutInMillis ) ; } catch ( InterruptedException ignored ) { } now = System . currentTimeMillis ( ) ; } }
public class BatchDetectEntitiesRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( BatchDetectEntitiesRequest batchDetectEntitiesRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( batchDetectEntitiesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( batchDetectEntitiesRequest . getTextList ( ) , TEXTLIST_BINDING ) ; protocolMarshaller . marshall ( batchDetectEntitiesRequest . getLanguageCode ( ) , LANGUAGECODE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ScriptRunner { /** * Invokes the script found at the specified location ( file system or URL ) . * @ param location A file on the file system or a URL . * @ param req A < code > TaskRequest < / code > prepared externally . * @ return The < code > TaskResponse < / code > that results from invoking the * specified script . */ public TaskResponse run ( String location , TaskRequest req ) { } }
// Assertions . if ( location == null ) { String msg = "Argument 'location' cannot be null." ; throw new IllegalArgumentException ( msg ) ; } return run ( compileTask ( location ) , req ) ;
public class GinFactoryModuleBuilder { /** * See the factory configuration examples at { @ link GinFactoryModuleBuilder } . */ public < F > GinModule build ( Class < F > factoryInterface ) { } }
return build ( TypeLiteral . get ( factoryInterface ) ) ;
public class BigDecimalTextField { /** * Format the number and show it . * @ param number Number to set . */ public void setValue ( Number number ) { } }
String txt = null ; if ( number != null ) { txt = this . format . format ( number ) ; } setText ( txt ) ;
public class XbaseFactoryImpl { /** * Creates the default factory implementation . * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public static XbaseFactory init ( ) { } }
try { XbaseFactory theXbaseFactory = ( XbaseFactory ) EPackage . Registry . INSTANCE . getEFactory ( XbasePackage . eNS_URI ) ; if ( theXbaseFactory != null ) { return theXbaseFactory ; } } catch ( Exception exception ) { EcorePlugin . INSTANCE . log ( exception ) ; } return new XbaseFactoryImpl ( ) ;
public class StreamEx { /** * Returns a new { @ code StreamEx } which elements are { @ link List } objects * containing all possible tuples of the elements of supplied collection of * collections . The whole stream forms an n - fold Cartesian product ( or * cross - product ) of the input collections . * Every stream element is the { @ code List } of the same size as supplied * collection . The first element in the list is taken from the first * collection which appears in source and so on . The elements are ordered * lexicographically according to the order of the input collections . * There are no guarantees on the type , mutability , serializability , or * thread - safety of the { @ code List } elements . It ' s however guaranteed that * each element is the distinct object . * The supplied collection is assumed to be unchanged during the operation . * @ param < T > the type of the elements * @ param source the input collection of collections which is used to * generate the cross - product . * @ return the new stream of lists . * @ see # cartesianPower ( int , Collection ) * @ since 0.3.8 */ public static < T > StreamEx < List < T > > cartesianProduct ( Collection < ? extends Collection < T > > source ) { } }
if ( source . isEmpty ( ) ) return StreamEx . of ( new ConstSpliterator . OfRef < > ( Collections . emptyList ( ) , 1 , true ) ) ; return of ( new CrossSpliterator . ToList < > ( source ) ) ;
public class SBT013Analysis { /** * { @ inheritDoc } */ @ Override public void writeToFile ( File analysisCacheFile ) // use Zinc method ( if there is any ) ? { } }
if ( stamps != null ) // stamps were modified , merge now { analysis = analysis . copy ( stamps , analysis . apis ( ) , analysis . relations ( ) , analysis . infos ( ) , analysis . compilations ( ) ) ; stamps = null ; } AnalysisStore analysisStore = Compiler . analysisStore ( analysisCacheFile ) ; analysisStore . set ( analysis , analysisStore . get ( ) . get ( ) . _2 /* compileSetup */ ) ;
public class AbstractCacheableLockManager { /** * Returns lock data by node identifier . */ protected LockData getLockDataById ( String nodeId ) { } }
try { return getLockDataById . run ( nodeId ) ; } catch ( LockException e ) { if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( "An exception occurred: " + e . getMessage ( ) ) ; } } return null ;
public class SimpleTriggerContext { /** * Update this holder ' s state with the latest time values . * @ param lastScheduledExecutionTime * last < i > scheduled < / i > execution time * @ param lastActualExecutionTime * last < i > actual < / i > execution time * @ param lastCompletionTime * last completion time */ public void update ( Date lastScheduledExecutionTime , Date lastActualExecutionTime , Date lastCompletionTime ) { } }
this . lastScheduledExecutionTime = lastScheduledExecutionTime ; this . lastActualExecutionTime = lastActualExecutionTime ; this . lastCompletionTime = lastCompletionTime ;
public class TSL2561Consumer { /** * Device lux range 0.1 - 40,000 + see * https : / / learn . adafruit . com / tsl2561 / overview */ public double readLux ( ) throws IOException { } }
int ambient = readU16LittleEndian ( TSL2561_COMMAND_BIT | TSL2561_REGISTER_CHAN0_LOW ) ; int ir = readU16LittleEndian ( TSL2561_COMMAND_BIT | TSL2561_REGISTER_CHAN1_LOW ) ; if ( ambient >= 0xffff || ir >= 0xffff ) // value ( s ) exeed ( s ) datarange throw new RuntimeException ( "Gain too high. Values exceed range." ) ; if ( false && this . gain == TSL2561Gain . GAIN_1X ) { ambient *= 16 ; // scale 1x to 16x ir *= 16 ; // scale 1x to 16x } double ratio = ( ir / ( float ) ambient ) ; LOG . debug ( "IR Result:" + ir ) ; LOG . debug ( "Ambient Result:" + ambient ) ; /* * For the values below , see * https : / / github . com / adafruit / Adafruit _ TSL2561 * / blob / master / Adafruit _ TSL2561 _ U . h */ double lux = 0d ; if ( ( ratio >= 0 ) && ( ratio <= TSL2561_LUX_K4C ) ) lux = ( TSL2561_LUX_B1C * ambient ) - ( 0.0593 * ambient * ( Math . pow ( ratio , 1.4 ) ) ) ; else if ( ratio <= TSL2561_LUX_K5C ) lux = ( TSL2561_LUX_B5C * ambient ) - ( TSL2561_LUX_M5C * ir ) ; else if ( ratio <= TSL2561_LUX_K6C ) lux = ( TSL2561_LUX_B6C * ambient ) - ( TSL2561_LUX_M6C * ir ) ; else if ( ratio <= TSL2561_LUX_K7C ) lux = ( TSL2561_LUX_B7C * ambient ) - ( TSL2561_LUX_M7C * ir ) ; else if ( ratio > TSL2561_LUX_K8C ) lux = 0 ; return lux ;
public class Choice8 { /** * { @ inheritDoc } */ @ Override public Choice7 < A , B , C , D , E , F , G > converge ( Function < ? super H , ? extends CoProduct7 < A , B , C , D , E , F , G , ? > > convergenceFn ) { } }
return match ( Choice7 :: a , Choice7 :: b , Choice7 :: c , Choice7 :: d , Choice7 :: e , Choice7 :: f , Choice7 :: g , convergenceFn . andThen ( cp7 -> cp7 . match ( Choice7 :: a , Choice7 :: b , Choice7 :: c , Choice7 :: d , Choice7 :: e , Choice7 :: f , Choice7 :: g ) ) ) ;
public class JQMSlider { /** * Sets the value of the slider to the given value * @ param value the new value of the slider , must be in the range of the slider */ @ Override public void setValue ( Double value , boolean fireEvents ) { } }
Double old = getValue ( ) ; if ( old == value || old != null && old . equals ( value ) ) return ; internVal = value ; setInputValueAttr ( value ) ; ignoreChange = true ; try { refresh ( input . getElement ( ) . getId ( ) , doubleToNiceStr ( value ) ) ; } finally { ignoreChange = false ; } if ( fireEvents ) ValueChangeEvent . fire ( this , value ) ;
public class _MethodBindingToMethodExpression { /** * Note : MethodInfo . getParamTypes ( ) may incorrectly return an empty class array if invoke ( ) has not been called . * @ throws IllegalStateException * if expected params types have not been determined . */ @ Override public MethodInfo getMethodInfo ( ELContext context ) throws PropertyNotFoundException , MethodNotFoundException , ELException { } }
checkNullArgument ( context , "elcontext" ) ; checkNullState ( methodBinding , "methodBinding" ) ; if ( methodInfo == null ) { final FacesContext facesContext = ( FacesContext ) context . getContext ( FacesContext . class ) ; if ( facesContext != null ) { methodInfo = invoke ( new Invoker < MethodInfo > ( ) { public MethodInfo invoke ( ) { return new MethodInfo ( null , methodBinding . getType ( facesContext ) , null ) ; } } ) ; } } return methodInfo ;
public class RetryPolicy { /** * Registers the { @ code listener } to be called when an execution is aborted . */ public RetryPolicy < R > onAbort ( CheckedConsumer < ? extends ExecutionCompletedEvent < R > > listener ) { } }
abortListener = EventListener . of ( Assert . notNull ( listener , "listener" ) ) ; return this ;
public class SAX2DTM2 { /** * Receive notification of the beginning of the document . * @ throws SAXException Any SAX exception , possibly * wrapping another exception . * @ see org . xml . sax . ContentHandler # startDocument */ public void startDocument ( ) throws SAXException { } }
int doc = addNode ( DTM . DOCUMENT_NODE , DTM . DOCUMENT_NODE , DTM . NULL , DTM . NULL , 0 , true ) ; m_parents . push ( doc ) ; m_previous = DTM . NULL ; m_contextIndexes . push ( m_prefixMappings . size ( ) ) ; // for the next element .
public class TextMessageBuilder { /** * { @ inheritDoc } Returns a response containing a plain text message . */ public FbBotMillResponse build ( MessageEnvelope envelope ) { } }
User recipient = getRecipient ( envelope ) ; Message message = new TextMessage ( messageText ) ; message . setQuickReplies ( quickReplies ) ; return new FbBotMillMessageResponse ( recipient , message ) ;
public class JsMsgObject { /** * Encode the message part into a byte array buffer . * The buffer will be used for transmitting over the wire , hardening * into a database and any other need for ' serialization ' * Locking : The caller MUST have already synchronized on getPartLockArtefact ( jsPart ) * before calling this method . ( This would have to be true in any case , * as the caller must call getEncodedLength to determine the buffer * size needed . * @ param jsPart The message part to be encoded . * @ param header True if this is the header / first message part , otherwise false . * @ param buffer The buffer to encode the part into . * @ param offset The offset in the buffer at which to start writing the encoded message * @ return the number of bytes written to the buffer . * @ exception MessageEncodeFailedException is thrown if the message part failed to encode . */ private final int encodePartToBuffer ( JsMsgPart jsPart , boolean header , byte [ ] buffer , int offset ) throws MessageEncodeFailedException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "encodePartToBuffer" , new Object [ ] { jsPart , header , buffer , offset } ) ; JMFMessage msg = ( JMFMessage ) jsPart . jmfPart ; int length = 0 ; int newOffset = offset ; try { length = msg . getEncodedLength ( ) ; // If this is a header ( or only ) part it also needs a 4 byte length field at the start // containing the header length if ( header ) { ArrayUtil . writeInt ( buffer , offset , length ) ; newOffset += ArrayUtil . INT_SIZE ; } msg . toByteArray ( buffer , newOffset , length ) ; } catch ( Exception e ) { // Dump the message part , and whatever we ' ve managed to encode so far . FFDCFilter . processException ( e , "com.ibm.ws.sib.mfp.impl.JsMsgObject.encodePartToBuffer" , "jmo600" , this , new Object [ ] { new Object [ ] { MfpConstants . DM_MESSAGE , msg , theMessage } , new Object [ ] { MfpConstants . DM_BUFFER , buffer , Integer . valueOf ( offset ) , Integer . valueOf ( length + ArrayUtil . INT_SIZE ) } } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "encodePartToBuffer encode failed: " + e ) ; throw new MessageEncodeFailedException ( e ) ; } length += ( newOffset - offset ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "encodePartToBuffer" , Integer . valueOf ( length ) ) ; return length ;
public class KerasModelBuilder { /** * Set model architecture from file name pointing to model YAML string . * @ param modelYamlFilename Name of file containing model YAML string * @ return Model Builder * @ throws IOException I / O Exception */ public KerasModelBuilder modelYamlFilename ( String modelYamlFilename ) throws IOException { } }
checkForExistence ( modelYamlFilename ) ; this . modelJson = new String ( Files . readAllBytes ( Paths . get ( modelYamlFilename ) ) ) ; return this ;
public class PersonDirectoryConfiguration { /** * Overrides DAO acts as the root , it handles incorporating attributes from the attribute * swapper utility , wraps the caching DAO */ @ Bean ( name = "personAttributeDao" ) @ Qualifier ( "personAttributeDao" ) public IPersonAttributeDao getPersonAttributeDao ( ) { } }
final PortalRootPersonAttributeDao rslt = new PortalRootPersonAttributeDao ( ) ; rslt . setDelegatePersonAttributeDao ( getRequestAttributeMergingDao ( ) ) ; rslt . setAttributeOverridesMap ( getSessionAttributesOverridesMap ( ) ) ; return rslt ;
public class FilterContext { /** * Unregisters CounterRequestMXBean beans . */ private void unregisterJmxExpose ( ) { } }
if ( jmxNames . isEmpty ( ) ) { return ; } try { final MBeanServer platformMBeanServer = MBeans . getPlatformMBeanServer ( ) ; for ( final ObjectName name : jmxNames ) { platformMBeanServer . unregisterMBean ( name ) ; } } catch ( final JMException e ) { LOG . warn ( "failed to unregister JMX beans" , e ) ; }
public class ColumnSchema { /** * VoltDB added method to get a non - catalog - dependent * representation of this HSQLDB object . * @ param session The current Session object may be needed to resolve * some names . * @ return XML , correctly indented , representing this object . * @ throws HSQLParseException */ VoltXMLElement voltGetColumnXML ( Session session ) throws org . hsqldb_voltpatches . HSQLInterface . HSQLParseException { } }
VoltXMLElement column = new VoltXMLElement ( "column" ) ; // output column metadata column . attributes . put ( "name" , columnName . name ) ; String typestring = Types . getTypeName ( dataType . typeCode ) ; column . attributes . put ( "valuetype" , typestring ) ; column . attributes . put ( "nullable" , String . valueOf ( isNullable ( ) ) ) ; column . attributes . put ( "size" , String . valueOf ( dataType . precision ) ) ; if ( dataType . precision > 1048576 ) { String msg = typestring + " column size for column " ; msg += getTableNameString ( ) + "." + columnName . name ; msg += " is > 1048576 char maximum." ; throw new org . hsqldb_voltpatches . HSQLInterface . HSQLParseException ( msg ) ; } if ( typestring . compareTo ( "VARCHAR" ) == 0 ) { assert ( dataType instanceof CharacterType ) ; CharacterType ct = ( CharacterType ) dataType ; column . attributes . put ( "bytes" , String . valueOf ( ct . inBytes ) ) ; } // see if there is a default value for the column Expression exp = getDefaultExpression ( ) ; // if there is a default value for the column // and the column value is not NULL . ( Ignore " DEFAULT NULL " in DDL ) if ( exp != null ) { if ( exp . valueData != null || ( exp instanceof FunctionSQL && ( ( FunctionSQL ) exp ) . isValueFunction ) ) { exp . dataType = dataType ; // add default value to body of column element VoltXMLElement defaultElem = new VoltXMLElement ( "default" ) ; column . children . add ( defaultElem ) ; defaultElem . children . add ( exp . voltGetXML ( session ) ) ; } } return column ;
public class FastDeserializer { /** * Read a varbinary , serialized the same way VoltDB serializes * strings , but returned as byte [ ] . * @ return The byte [ ] value read from the stream . * @ throws IOException Rethrows any IOExceptions . */ public byte [ ] readVarbinary ( ) throws IOException { } }
final int len = readInt ( ) ; // check for null string if ( len == VoltType . NULL_STRING_LENGTH ) { return null ; } assert len >= 0 ; if ( len < VoltType . NULL_STRING_LENGTH ) { throw new IOException ( "Varbinary length is negative " + len ) ; } if ( len > buffer . remaining ( ) ) { throw new IOException ( "Varbinary length is bigger than total buffer " + len ) ; } // now assume not null final byte [ ] retval = new byte [ len ] ; readFully ( retval ) ; return retval ;
public class Matrix4d { /** * / * ( non - Javadoc ) * @ see org . joml . Matrix4dc # mul ( org . joml . Matrix4x3dc , org . joml . Matrix4d ) */ public Matrix4d mul ( Matrix4x3dc right , Matrix4d dest ) { } }
if ( ( properties & PROPERTY_IDENTITY ) != 0 ) return dest . set ( right ) ; else if ( ( right . properties ( ) & PROPERTY_IDENTITY ) != 0 ) return dest . set ( this ) ; return mulGeneric ( right , dest ) ;
public class ns_ssl_certkey { /** * < pre > * Use this operation to install certificates on NetScaler Instance ( s ) . * < / pre > */ public static ns_ssl_certkey add ( nitro_service client , ns_ssl_certkey resource ) throws Exception { } }
resource . validate ( "add" ) ; return ( ( ns_ssl_certkey [ ] ) resource . perform_operation ( client , "add" ) ) [ 0 ] ;
public class PortalSessionScope { /** * / * ( non - Javadoc ) * @ see org . springframework . beans . factory . config . Scope # get ( java . lang . String , org . springframework . beans . factory . ObjectFactory ) */ @ Override public Object get ( String name , ObjectFactory < ? > objectFactory ) { } }
final HttpSession session = this . getPortalSesion ( true ) ; final Object sessionMutex = WebUtils . getSessionMutex ( session ) ; synchronized ( sessionMutex ) { Object scopedObject = session . getAttribute ( name ) ; if ( scopedObject == null ) { scopedObject = objectFactory . getObject ( ) ; session . setAttribute ( name , scopedObject ) ; } return scopedObject ; }
public class RegionAutoscalerClient { /** * Retrieves a list of autoscalers contained within the specified region . * < p > Sample code : * < pre > < code > * try ( RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient . create ( ) ) { * ProjectRegionName region = ProjectRegionName . of ( " [ PROJECT ] " , " [ REGION ] " ) ; * for ( Autoscaler element : regionAutoscalerClient . listRegionAutoscalers ( region . toString ( ) ) . iterateAll ( ) ) { * / / doThingsWith ( element ) ; * < / code > < / pre > * @ param region Name of the region scoping this request . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ @ BetaApi public final ListRegionAutoscalersPagedResponse listRegionAutoscalers ( String region ) { } }
ListRegionAutoscalersHttpRequest request = ListRegionAutoscalersHttpRequest . newBuilder ( ) . setRegion ( region ) . build ( ) ; return listRegionAutoscalers ( request ) ;
public class MeteredBalancingPolicy { /** * Once a minute , pass off information about the amount of load generated per * work unit off to Zookeeper for use in the claiming and rebalancing process . */ private void scheduleLoadTicks ( ) { } }
Runnable sendLoadToZookeeper = new Runnable ( ) { @ Override public void run ( ) { final List < String > loads = new ArrayList < String > ( ) ; synchronized ( meters ) { for ( Map . Entry < String , Meter > entry : meters . entrySet ( ) ) { final String workUnit = entry . getKey ( ) ; loads . add ( String . format ( "/%s/meta/workload/%s" , cluster . name , workUnit ) ) ; loads . add ( String . valueOf ( entry . getValue ( ) . getOneMinuteRate ( ) ) ) ; } } Iterator < String > it = loads . iterator ( ) ; while ( it . hasNext ( ) ) { final String path = it . next ( ) ; final String rate = it . next ( ) ; try { ZKUtils . setOrCreate ( cluster . zk , path , rate , CreateMode . PERSISTENT ) ; } catch ( Exception e ) { // should we fail the loop too ? LOG . error ( "Problems trying to store load rate for {} (value {}): ({}) {}" , path , rate , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; } } String nodeLoadPath = String . format ( "/%s/nodes/%s" , cluster . name , cluster . myNodeID ) ; try { NodeInfo myInfo = new NodeInfo ( cluster . getState ( ) . toString ( ) , cluster . zk . get ( ) . getSessionId ( ) ) ; byte [ ] myInfoEncoded = JsonUtil . asJSONBytes ( myInfo ) ; ZKUtils . setOrCreate ( cluster . zk , nodeLoadPath , myInfoEncoded , CreateMode . EPHEMERAL ) ; if ( LOG . isDebugEnabled ( ) ) { // TODO : Shouldn ' t be evaluating methods inside of a logging statement . LOG . debug ( "My load: {}" , myLoad ( ) ) ; } } catch ( Exception e ) { LOG . error ( "Error reporting load info to ZooKeeper." , e ) ; } } } ; loadFuture = cluster . scheduleAtFixedRate ( sendLoadToZookeeper , 0 , 1 , TimeUnit . MINUTES ) ;
public class Parser { /** * A { @ link Parser } that runs { @ code this } for 0 ore more times separated and optionally terminated by { @ code * delim } . For example : { @ code " foo ; foo ; foo " } and { @ code " foo ; foo ; " } both matches { @ code foo . sepEndBy ( semicolon ) } . * < p > The return values are collected in a { @ link List } . */ public final Parser < List < T > > sepEndBy ( Parser < ? > delim ) { } }
return Parsers . or ( sepEndBy1 ( delim ) , EmptyListParser . < T > instance ( ) ) ;
public class WikibaseDataFetcher { /** * Fetches the documents for the entities of the given string IDs . The * result is a map from entity IDs to { @ link EntityDocument } objects . It is * possible that a requested ID could not be found : then this key is not set * in the map . * @ param entityIds * string IDs ( e . g . , " P31 " , " Q42 " ) of requested entities * @ return map from IDs for which data could be found to the documents that * were retrieved * @ throws MediaWikiApiErrorException * @ throws IOException */ public Map < String , EntityDocument > getEntityDocuments ( String ... entityIds ) throws MediaWikiApiErrorException , IOException { } }
return getEntityDocuments ( Arrays . asList ( entityIds ) ) ;
public class ResponseToRoomImpl { /** * / * ( non - Javadoc ) * @ see com . tvd12 . ezyfox . core . command . ResponseToRoom # only ( java . lang . String [ ] ) */ @ Override public ResponseToRoom only ( String ... params ) { } }
includedVars . addAll ( Arrays . asList ( params ) ) ; return this ;
public class UnnecessaryStoreBeforeReturn { /** * looks for instructions that are binary operators , and if it is saves the left hand side register ( if it exists ) in the userValue . * @ param seen * the opcode of the currently parsed instruction * @ return the lhs register number if it exists or - 1 */ private int processBinOp ( int seen ) { } }
if ( binaryOps . get ( seen ) && ( stack . getStackDepth ( ) >= 2 ) ) { OpcodeStack . Item item = stack . getStackItem ( 1 ) ; return item . getRegisterNumber ( ) ; } return - 1 ;
public class PdfDocument { /** * If the current line is not empty or null , it is added to the arraylist * of lines and a new empty line is added . */ protected void carriageReturn ( ) { } }
// the arraylist with lines may not be null if ( lines == null ) { lines = new ArrayList ( ) ; } // If the current line is not null if ( line != null ) { // we check if the end of the page is reached ( bugfix by Francois Gravel ) if ( currentHeight + line . height ( ) + leading < indentTop ( ) - indentBottom ( ) ) { // if so nonempty lines are added and the height is augmented if ( line . size ( ) > 0 ) { currentHeight += line . height ( ) ; lines . add ( line ) ; pageEmpty = false ; } } // if the end of the line is reached , we start a new page else { newPage ( ) ; } } if ( imageEnd > - 1 && currentHeight > imageEnd ) { imageEnd = - 1 ; indentation . imageIndentRight = 0 ; indentation . imageIndentLeft = 0 ; } // a new current line is constructed line = new PdfLine ( indentLeft ( ) , indentRight ( ) , alignment , leading ) ;
public class Utils { /** * Get a FileInputStream object using AccessController . doPrivileged ( . . . ) * @ param file the file to get the input stream for * @ return the file input stream * @ throws FileNotFoundException */ public static FileInputStream getFileInputStreamPrivileged ( final File file ) throws FileNotFoundException { } }
final AtomicReference < FileNotFoundException > exceptionRef = new AtomicReference < FileNotFoundException > ( ) ; FileInputStream fis = AccessController . doPrivileged ( new PrivilegedAction < FileInputStream > ( ) { @ Override public FileInputStream run ( ) { try { return new FileInputStream ( file ) ; } catch ( FileNotFoundException e ) { exceptionRef . set ( e ) ; return null ; } } } ) ; if ( exceptionRef . get ( ) != null ) throw exceptionRef . get ( ) ; return fis ;
public class LogManager { /** * Returns a formatter Logger with the specified name . * This logger let you use a { @ link java . util . Formatter } string in the message to format parameters . * Short - hand for { @ code getLogger ( name , StringFormatterMessageFactory . INSTANCE ) } * @ param name The logger name . If null it will default to the name of the calling class . * @ return The Logger , created with a { @ link StringFormatterMessageFactory } * @ throws UnsupportedOperationException if { @ code name } is { @ code null } and the calling class cannot be determined . * @ see Logger # fatal ( Marker , String , Object . . . ) * @ see Logger # fatal ( String , Object . . . ) * @ see Logger # error ( Marker , String , Object . . . ) * @ see Logger # error ( String , Object . . . ) * @ see Logger # warn ( Marker , String , Object . . . ) * @ see Logger # warn ( String , Object . . . ) * @ see Logger # info ( Marker , String , Object . . . ) * @ see Logger # info ( String , Object . . . ) * @ see Logger # debug ( Marker , String , Object . . . ) * @ see Logger # debug ( String , Object . . . ) * @ see Logger # trace ( Marker , String , Object . . . ) * @ see Logger # trace ( String , Object . . . ) * @ see StringFormatterMessageFactory */ public static Logger getFormatterLogger ( final String name ) { } }
return name == null ? getFormatterLogger ( StackLocatorUtil . getCallerClass ( 2 ) ) : getLogger ( name , StringFormatterMessageFactory . INSTANCE ) ;
public class WARCWritable { /** * Appends the current record to a { @ link DataOutput } stream . */ @ Override public void write ( DataOutput out ) throws IOException { } }
if ( record != null ) record . write ( out ) ;
public class CmsDriverManager { /** * Deletes an organizational unit . < p > * Only organizational units that contain no suborganizational unit can be deleted . < p > * The organizational unit can not be delete if it is used in the request context , * or if the current user belongs to it . < p > * All users and groups in the given organizational unit will be deleted . < p > * @ param dbc the current db context * @ param organizationalUnit the organizational unit to delete * @ throws CmsException if operation was not successful * @ see org . opencms . security . CmsOrgUnitManager # deleteOrganizationalUnit ( CmsObject , String ) */ public void deleteOrganizationalUnit ( CmsDbContext dbc , CmsOrganizationalUnit organizationalUnit ) throws CmsException { } }
// check organizational unit in context if ( dbc . getRequestContext ( ) . getOuFqn ( ) . equals ( organizationalUnit . getName ( ) ) ) { throw new CmsDbConsistencyException ( Messages . get ( ) . container ( Messages . ERR_ORGUNIT_DELETE_IN_CONTEXT_1 , organizationalUnit . getName ( ) ) ) ; } // check organizational unit for user if ( dbc . currentUser ( ) . getOuFqn ( ) . equals ( organizationalUnit . getName ( ) ) ) { throw new CmsDbConsistencyException ( Messages . get ( ) . container ( Messages . ERR_ORGUNIT_DELETE_CURRENT_USER_1 , organizationalUnit . getName ( ) ) ) ; } // check sub organizational units if ( ! getOrganizationalUnits ( dbc , organizationalUnit , true ) . isEmpty ( ) ) { throw new CmsDbConsistencyException ( Messages . get ( ) . container ( Messages . ERR_ORGUNIT_DELETE_SUB_ORGUNITS_1 , organizationalUnit . getName ( ) ) ) ; } // check groups List < CmsGroup > groups = getGroups ( dbc , organizationalUnit , true , false ) ; Iterator < CmsGroup > itGroups = groups . iterator ( ) ; while ( itGroups . hasNext ( ) ) { CmsGroup group = itGroups . next ( ) ; if ( ! OpenCms . getDefaultUsers ( ) . isDefaultGroup ( group . getName ( ) ) ) { throw new CmsDbConsistencyException ( Messages . get ( ) . container ( Messages . ERR_ORGUNIT_DELETE_GROUPS_1 , organizationalUnit . getName ( ) ) ) ; } } // check users if ( ! getUsers ( dbc , organizationalUnit , true ) . isEmpty ( ) ) { throw new CmsDbConsistencyException ( Messages . get ( ) . container ( Messages . ERR_ORGUNIT_DELETE_USERS_1 , organizationalUnit . getName ( ) ) ) ; } // delete default groups if needed itGroups = groups . iterator ( ) ; while ( itGroups . hasNext ( ) ) { CmsGroup group = itGroups . next ( ) ; deleteGroup ( dbc , group , null ) ; } // delete projects Iterator < CmsProject > itProjects = getProjectDriver ( dbc ) . readProjects ( dbc , organizationalUnit . getName ( ) ) . iterator ( ) ; while ( itProjects . hasNext ( ) ) { CmsProject project = itProjects . next ( ) ; deleteProject ( dbc , project , false ) ; } // delete roles Iterator < CmsGroup > itRoles = getGroups ( dbc , organizationalUnit , true , true ) . iterator ( ) ; while ( itRoles . hasNext ( ) ) { CmsGroup role = itRoles . next ( ) ; deleteGroup ( dbc , role , null ) ; } // create a publish list for the ' virtual ' publish event CmsResource resource = readResource ( dbc , organizationalUnit . getId ( ) , CmsResourceFilter . DEFAULT ) ; CmsPublishList pl = new CmsPublishList ( resource , false ) ; pl . add ( resource , false ) ; // remove the organizational unit itself getUserDriver ( dbc ) . deleteOrganizationalUnit ( dbc , organizationalUnit ) ; // write the publish history entry getProjectDriver ( dbc ) . writePublishHistory ( dbc , pl . getPublishHistoryId ( ) , new CmsPublishedResource ( resource , - 1 , CmsResourceState . STATE_DELETED ) ) ; // flush relevant caches m_monitor . clearPrincipalsCache ( ) ; m_monitor . flushCache ( CmsMemoryMonitor . CacheType . PROPERTY , CmsMemoryMonitor . CacheType . PROPERTY_LIST ) ; // fire the ' virtual ' publish event Map < String , Object > eventData = new HashMap < String , Object > ( ) ; eventData . put ( I_CmsEventListener . KEY_PUBLISHID , pl . getPublishHistoryId ( ) . toString ( ) ) ; eventData . put ( I_CmsEventListener . KEY_PROJECTID , dbc . currentProject ( ) . getUuid ( ) ) ; eventData . put ( I_CmsEventListener . KEY_DBCONTEXT , dbc ) ; CmsEvent afterPublishEvent = new CmsEvent ( I_CmsEventListener . EVENT_PUBLISH_PROJECT , eventData ) ; OpenCms . fireCmsEvent ( afterPublishEvent ) ; m_lockManager . removeDeletedResource ( dbc , resource . getRootPath ( ) ) ; if ( ! dbc . getProjectId ( ) . isNullUUID ( ) ) { // OU modified event is not needed return ; } // fire OU modified event Map < String , Object > event2Data = new HashMap < String , Object > ( ) ; event2Data . put ( I_CmsEventListener . KEY_OU_NAME , organizationalUnit . getName ( ) ) ; event2Data . put ( I_CmsEventListener . KEY_USER_ACTION , I_CmsEventListener . VALUE_OU_MODIFIED_ACTION_DELETE ) ; OpenCms . fireCmsEvent ( new CmsEvent ( I_CmsEventListener . EVENT_OU_MODIFIED , event2Data ) ) ;
public class DirectoryUtil { /** * Provides a listing of files in a directory , sorted in order * of most to least recent . */ public static File [ ] listFilesSortedByModDate ( File dir ) { } }
File [ ] backupDirFiles = dir . listFiles ( ) ; Arrays . sort ( backupDirFiles , new FileComparator ( ) ) ; return backupDirFiles ;
public class ParamConverterEngine { /** * Creates an instance of T from the given input . Unlike { @ link # convertValue ( String , Class , * java . lang . reflect . Type , String ) } , this method support multi - value parameters . * @ param input the input Strings , may be { @ literal null } or empty * @ param rawType the target class * @ param type the type representation of the raw type , may contains metadata about generics * @ param defaultValue the default value if any * @ return the created object * @ throws IllegalArgumentException if there are no converter available from the type T at the moment */ @ Override public < T > T convertValues ( Collection < String > input , Class < T > rawType , Type type , String defaultValue ) throws IllegalArgumentException { } }
if ( rawType . isArray ( ) ) { if ( input == null ) { input = getMultipleValues ( defaultValue , null ) ; } return createArray ( input , rawType . getComponentType ( ) ) ; } else if ( Collection . class . isAssignableFrom ( rawType ) ) { if ( input == null ) { input = getMultipleValues ( defaultValue , null ) ; } return createCollection ( input , rawType , type ) ; } else { return convertSingleValue ( input , rawType , defaultValue ) ; }
public class ClientIDRegistry { /** * Register a new client ID */ public synchronized void register ( String clientID ) throws InvalidClientIDException { } }
if ( ! clientIDs . add ( clientID ) ) { log . error ( "Client ID already exists : " + clientID ) ; throw new InvalidClientIDException ( "Client ID already exists : " + clientID ) ; } log . debug ( "Registered clientID : " + clientID ) ;
public class TypeConversion { /** * A utility method to convert the long from the byte array to a long . * @ param bytes * The byte array containing the long . * @ param offset * The index at which the long is located . * @ return The long value . */ public static long bytesToLong ( byte [ ] bytes , int offset ) { } }
long result = 0x0 ; for ( int i = offset ; i < offset + 8 ; ++ i ) { result = result << 8 ; result |= ( bytes [ i ] & 0x00000000000000FFl ) ; } return result ;
public class DeviceMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Device device , ProtocolMarshaller protocolMarshaller ) { } }
if ( device == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( device . getCertificateArn ( ) , CERTIFICATEARN_BINDING ) ; protocolMarshaller . marshall ( device . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( device . getSyncShadow ( ) , SYNCSHADOW_BINDING ) ; protocolMarshaller . marshall ( device . getThingArn ( ) , THINGARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class RequestBuilder { /** * Sends an HTTP request based on the current builder configuration . If no * request headers have been set , the header " Content - Type " will be used with * a value of " text / plain ; charset = utf - 8 " . * @ return a { @ link Request } object that can be used to track the request * @ throws RequestException if the call fails to initiate * @ throws NullPointerException if request data has not been set * @ throws NullPointerException if a request callback has not been set */ private Request doSend ( String requestData , final RequestCallback callback ) throws RequestException { } }
XMLHttpRequest xmlHttpRequest = XMLHttpRequest . create ( ) ; evaluateSync ( requestData ) ; try { if ( ( user != null ) && ( password != null ) ) { if ( m_sync ) { xmlHttpRequest . openSync ( httpMethod , url , user , password ) ; } else { xmlHttpRequest . open ( httpMethod , url , user , password ) ; } } else if ( user != null ) { if ( m_sync ) { xmlHttpRequest . openSync ( httpMethod , url , user ) ; } else { xmlHttpRequest . open ( httpMethod , url , user ) ; } } else { if ( m_sync ) { xmlHttpRequest . openSync ( httpMethod , url ) ; } else { xmlHttpRequest . open ( httpMethod , url ) ; } } } catch ( JavaScriptException e ) { RequestPermissionException requestPermissionException = new RequestPermissionException ( url ) ; requestPermissionException . initCause ( new RequestException ( e . getMessage ( ) ) ) ; throw requestPermissionException ; } setHeaders ( xmlHttpRequest ) ; final Request request = new Request ( xmlHttpRequest , timeoutMillis , callback ) ; if ( ! m_sync ) { // Must set the onreadystatechange handler before calling send ( ) . xmlHttpRequest . setOnReadyStateChange ( new ReadyStateChangeHandler ( ) { public void onReadyStateChange ( XMLHttpRequest xhr ) { if ( xhr . getReadyState ( ) == XMLHttpRequest . DONE ) { xhr . clearOnReadyStateChange ( ) ; request . fireOnResponseReceived ( callback ) ; } } } ) ; } try { xmlHttpRequest . send ( requestData ) ; } catch ( JavaScriptException e ) { throw new RequestException ( e . getMessage ( ) ) ; } if ( m_sync ) { xmlHttpRequest . clearOnReadyStateChange ( ) ; request . fireOnResponseReceived ( callback ) ; } return request ;
public class VdmLaunchShortcut { /** * Resolves a type that can be launched from the given scope and launches in the specified mode . * @ param scope * the java elements to consider for a type that can be launched * @ param mode * launch mode * @ param selectTitle * prompting title for choosing a type to launch * @ param emptyMessage * error message when no types are resolved for launching */ private void searchAndLaunch ( Object [ ] scope , String mode , String selectTitle , String emptyMessage ) { } }
INode [ ] types = null ; try { project = findProject ( scope , PlatformUI . getWorkbench ( ) . getProgressService ( ) ) ; ILaunchConfiguration config = findLaunchConfiguration ( project . getName ( ) , getConfigurationType ( ) ) ; if ( config != null ) { // config already exists for the project . launch ( config , mode ) ; return ; } types = findTypes ( scope , PlatformUI . getWorkbench ( ) . getProgressService ( ) ) ; } catch ( InterruptedException e ) { return ; } catch ( CoreException e ) { MessageDialog . openError ( getShell ( ) , LauncherMessages . VdmLaunchShortcut_0 , e . getMessage ( ) ) ; return ; } INode type = null ; if ( types == null || types . length == 0 ) { MessageDialog . openError ( getShell ( ) , LauncherMessages . VdmLaunchShortcut_1 , emptyMessage ) ; } else if ( types . length > 1 ) { type = chooseType ( types , selectTitle ) ; } else { type = types [ 0 ] ; } if ( type != null && project != null ) { launch ( type , mode , project . getName ( ) ) ; }
public class AuditCollectorUtil { /** * Get api authentication headers */ protected static HttpEntity getHeaders ( AuditSettings auditSettings ) { } }
HttpHeaders headers = new HttpHeaders ( ) ; if ( ! CollectionUtils . isEmpty ( auditSettings . getUsernames ( ) ) && ! CollectionUtils . isEmpty ( auditSettings . getApiKeys ( ) ) ) { headers . set ( STR_APIUSER , auditSettings . getUsernames ( ) . iterator ( ) . next ( ) ) ; headers . set ( STR_AUTHORIZATION , STR_APITOKENSPACE + auditSettings . getApiKeys ( ) . iterator ( ) . next ( ) ) ; } return new HttpEntity < > ( headers ) ;
public class KernelApi { /** * / * public static ExplicitIndexHits nodeQueryIndex ( String indexName , Object query , GraphDatabaseService db ) throws Exception { * return getReadOperation ( db ) . nodeExplicitIndexQuery ( indexName , query ) ; * public static ExplicitIndexHits relationshipQueryIndex ( String indexName , Object query , GraphDatabaseService db , Long startNode , Long endNode ) throws Exception { * long startingNode = ( startNode = = null ) ? - 1 : startNode ; * long endingNode = ( endNode = = null ) ? - 1 : endNode ; * return getReadOperation ( db ) . relationshipExplicitIndexQuery ( indexName , query , startingNode , endingNode ) ; */ public static Node getEndNode ( GraphDatabaseService db , long id ) { } }
Relationship rel = db . getRelationshipById ( id ) ; return rel . getEndNode ( ) ;