signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class JSONML { /** * Convert a well - formed ( but not necessarily valid ) XML string into a JSONArray using the JsonML transform . Each XML tag is represented as a JSONArray in which the first element is the tag name . If * the tag has attributes , then the second element will be JSONObject containing the name / value pairs . If the tag contains children , then strings and JSONArrays will represent the child content and * tags . Comments , prologs , DTDs , and < code > & lt ; [ [ ] ] > < / code > are ignored . * @ param x * An XMLTokener . * @ return A JSONArray containing the structured signalData from the XML string . * @ throws JSONException */ public static JSONArray toJSONArray ( XMLTokener x ) throws JSONException { } }
return ( JSONArray ) parse ( x , true , null ) ;
public class CmsModulesUploadFromServer { /** * Creates the list of widgets for this dialog . < p > */ @ Override protected void defineWidgets ( ) { } }
List selectOptions = getModulesFromServer ( ) ; if ( selectOptions . isEmpty ( ) ) { // no import modules available , display message addWidget ( new CmsWidgetDialogParameter ( this , "moduleupload" , PAGES [ 0 ] , new CmsDisplayWidget ( key ( Messages . GUI_MODULES_IMPORT_NOT_AVAILABLE_0 ) ) ) ) ; } else { // add the file select box widget addWidget ( new CmsWidgetDialogParameter ( this , "moduleupload" , PAGES [ 0 ] , new CmsSelectWidget ( selectOptions ) ) ) ; }
public class AWSDynamoUtils { /** * Returns the table name for a given app id . Table names are usually in the form ' prefix - appid ' . * @ param appIdentifier app id * @ return the table name */ public static String getTableNameForAppid ( String appIdentifier ) { } }
if ( StringUtils . isBlank ( appIdentifier ) ) { return null ; } else { if ( isSharedAppid ( appIdentifier ) ) { // app is sharing a table with other apps appIdentifier = SHARED_TABLE ; } return ( App . isRoot ( appIdentifier ) || appIdentifier . startsWith ( Config . PARA . concat ( "-" ) ) ) ? appIdentifier : Config . PARA + "-" + appIdentifier ; }
public class LayerUtil { /** * Returns the depth of the given layer in its local scene graph . A root layer ( one with null * parent ) will always return 0. */ public static int graphDepth ( Layer layer ) { } }
int depth = - 1 ; while ( layer != null ) { layer = layer . parent ( ) ; depth ++ ; } return depth ;
public class FluentAnswer { /** * Creates a new instance for the given type . * @ param type * the return type of the answer * @ param < T > * generic parameter of the return type * @ return new Answer that returns the mock itself */ public static < T extends Query < ? , R > , R extends Object > FluentAnswer < T , R > createAnswer ( Class < T > type ) { } }
return new FluentAnswer < T , R > ( type ) ;
public class DefaultMultipartResourceRequest { /** * { @ inheritDoc } */ @ Override public Enumeration < String > getParameterNames ( ) { } }
Set < String > paramNames = new HashSet < String > ( ) ; Enumeration < String > paramEnum = super . getParameterNames ( ) ; while ( paramEnum . hasMoreElements ( ) ) { paramNames . add ( ( String ) paramEnum . nextElement ( ) ) ; } paramNames . addAll ( getMultipartParameters ( ) . keySet ( ) ) ; return Collections . enumeration ( paramNames ) ;
public class ST_IsValidDetail { /** * Returns a valid _ detail as an array of objects * [ 0 ] = isvalid , [ 1 ] = reason , [ 2 ] = error location * isValid equals true if the geometry is valid . * reason correponds to an error message describing this error . * error returns the location of this error ( on the { @ link Geometry } * containing the error . * @ param geometry * @ param flag * @ return */ public static Object [ ] isValidDetail ( Geometry geometry , int flag ) { } }
if ( geometry != null ) { if ( flag == 0 ) { return detail ( geometry , false ) ; } else if ( flag == 1 ) { return detail ( geometry , true ) ; } else { throw new IllegalArgumentException ( "Supported arguments is 0 or 1." ) ; } } return null ;
public class LifecycleQueryChaincodeDefinitionProposalResponse { /** * The validation parameter bytes that were set when the chaincode was defined . * @ return validation parameter . * @ throws ProposalException */ public byte [ ] getValidationParameter ( ) throws ProposalException { } }
ByteString payloadBytes = parsePayload ( ) . getValidationParameter ( ) ; if ( null == payloadBytes ) { return null ; } return payloadBytes . toByteArray ( ) ;
public class KubernetesClientTimeoutException { /** * Creates a string listing all the resources that are not ready . * @ param resources The resources that are not ready . * @ return */ private static String notReadyToString ( Iterable < HasMetadata > resources ) { } }
StringBuilder sb = new StringBuilder ( ) ; sb . append ( "Resources that are not ready: " ) ; boolean first = true ; for ( HasMetadata r : resources ) { if ( first ) { first = false ; } else { sb . append ( ", " ) ; } sb . append ( "[Kind:" ) . append ( r . getKind ( ) ) . append ( " Name:" ) . append ( r . getMetadata ( ) . getName ( ) ) . append ( " Namespace:" ) . append ( r . getMetadata ( ) . getNamespace ( ) ) . append ( "]" ) ; } return sb . toString ( ) ;
public class JsonBuilder { /** * Allows you to add incomplete object builders without calling get ( ) * @ param elements json builders * @ return json array with the builder objects */ public static @ Nonnull JsonSet set ( JsonBuilder ... elements ) { } }
JsonSet jjArray = new JsonSet ( ) ; for ( JsonBuilder b : elements ) { jjArray . add ( b ) ; } return jjArray ;
public class SheetResourcesImpl { /** * Imports a sheet . * It mirrors to the following Smartsheet REST API method : POST / sheets / import * @ param file path to the CSV file * @ param sheetName destination sheet name * @ param headerRowIndex index ( 0 based ) of row to be used for column names * @ param primaryRowIndex index ( 0 based ) of primary column * @ return the created sheet * @ throws IllegalArgumentException if any argument is null or empty string * @ throws InvalidRequestException if there is any problem with the REST API request * @ throws AuthorizationException if there is any problem with the REST API authorization ( access token ) * @ throws ResourceNotFoundException if the resource cannot be found * @ throws ServiceUnavailableException if the REST API service is not available ( possibly due to rate limiting ) * @ throws SmartsheetException if there is any other error during the operation */ public Sheet importCsv ( String file , String sheetName , Integer headerRowIndex , Integer primaryRowIndex ) throws SmartsheetException { } }
return importFile ( "sheets/import" , file , "text/csv" , sheetName , headerRowIndex , primaryRowIndex ) ;
public class ClassUtils { /** * 迭代查询全部方法 , 包括本类和父类 * @ param clazz 对象类 * @ return 所有字段列表 */ public static List < Method > getAllMethods ( Class clazz ) { } }
List < Method > all = new ArrayList < Method > ( ) ; for ( Class < ? > c = clazz ; c != Object . class && c != null ; c = c . getSuperclass ( ) ) { Method [ ] methods = c . getDeclaredMethods ( ) ; // 所有方法 , 不包含父类 for ( Method method : methods ) { int mod = method . getModifiers ( ) ; // native的不要 if ( Modifier . isNative ( mod ) ) { continue ; } method . setAccessible ( true ) ; // 不管private还是protect都可以 all . add ( method ) ; } } return all ;
public class DefaultPushNotificationMessageMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DefaultPushNotificationMessage defaultPushNotificationMessage , ProtocolMarshaller protocolMarshaller ) { } }
if ( defaultPushNotificationMessage == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( defaultPushNotificationMessage . getAction ( ) , ACTION_BINDING ) ; protocolMarshaller . marshall ( defaultPushNotificationMessage . getBody ( ) , BODY_BINDING ) ; protocolMarshaller . marshall ( defaultPushNotificationMessage . getData ( ) , DATA_BINDING ) ; protocolMarshaller . marshall ( defaultPushNotificationMessage . getSilentPush ( ) , SILENTPUSH_BINDING ) ; protocolMarshaller . marshall ( defaultPushNotificationMessage . getSubstitutions ( ) , SUBSTITUTIONS_BINDING ) ; protocolMarshaller . marshall ( defaultPushNotificationMessage . getTitle ( ) , TITLE_BINDING ) ; protocolMarshaller . marshall ( defaultPushNotificationMessage . getUrl ( ) , URL_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ExecutionEnvironment { /** * Creates a new data set that contains the given elements . The elements must all be of the same type , * for example , all of the { @ link String } or { @ link Integer } . The sequence of elements must not be empty . * < p > The framework will try and determine the exact type from the collection elements . * In case of generic elements , it may be necessary to manually supply the type information * via { @ link # fromCollection ( Collection , TypeInformation ) } . * < p > Note that this operation will result in a non - parallel data source , i . e . a data source with * a parallelism of one . * @ param data The elements to make up the data set . * @ return A DataSet representing the given list of elements . */ @ SafeVarargs public final < X > DataSource < X > fromElements ( X ... data ) { } }
if ( data == null ) { throw new IllegalArgumentException ( "The data must not be null." ) ; } if ( data . length == 0 ) { throw new IllegalArgumentException ( "The number of elements must not be zero." ) ; } TypeInformation < X > typeInfo ; try { typeInfo = TypeExtractor . getForObject ( data [ 0 ] ) ; } catch ( Exception e ) { throw new RuntimeException ( "Could not create TypeInformation for type " + data [ 0 ] . getClass ( ) . getName ( ) + "; please specify the TypeInformation manually via " + "ExecutionEnvironment#fromElements(Collection, TypeInformation)" , e ) ; } return fromCollection ( Arrays . asList ( data ) , typeInfo , Utils . getCallLocationName ( ) ) ;
public class MediaServicesInner { /** * Regenerates a primary or secondary key for a Media Service . * @ param resourceGroupName Name of the resource group within the Azure subscription . * @ param mediaServiceName Name of the Media Service . * @ param keyType The keyType indicating which key you want to regenerate , Primary or Secondary . Possible values include : ' Primary ' , ' Secondary ' * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the RegenerateKeyOutputInner object */ public Observable < RegenerateKeyOutputInner > regenerateKeyAsync ( String resourceGroupName , String mediaServiceName , KeyType keyType ) { } }
return regenerateKeyWithServiceResponseAsync ( resourceGroupName , mediaServiceName , keyType ) . map ( new Func1 < ServiceResponse < RegenerateKeyOutputInner > , RegenerateKeyOutputInner > ( ) { @ Override public RegenerateKeyOutputInner call ( ServiceResponse < RegenerateKeyOutputInner > response ) { return response . body ( ) ; } } ) ;
public class URLUtils { /** * Encode multi form parameters */ public static String encodeForms ( Collection < ? extends Parameter < String > > queries , Charset charset ) { } }
StringBuilder sb = new StringBuilder ( ) ; try { for ( Parameter < String > query : queries ) { sb . append ( URLEncoder . encode ( query . name ( ) , charset . name ( ) ) ) ; sb . append ( '=' ) ; sb . append ( URLEncoder . encode ( query . value ( ) , charset . name ( ) ) ) ; sb . append ( '&' ) ; } } catch ( UnsupportedEncodingException e ) { // should not happen throw new RequestsException ( e ) ; } if ( sb . length ( ) > 0 ) { sb . deleteCharAt ( sb . length ( ) - 1 ) ; } return sb . toString ( ) ;
public class TypeConverter { /** * Get the class to use . In case the passed class is a primitive type , the * corresponding wrapper class is used . * @ param aClass * The class to check . Can be < code > null < / code > but should not be * < code > null < / code > . * @ return < code > null < / code > if the parameter is < code > null < / code > . */ @ Nullable private static Class < ? > _getUsableClass ( @ Nullable final Class < ? > aClass ) { } }
final Class < ? > aPrimitiveWrapperType = ClassHelper . getPrimitiveWrapperClass ( aClass ) ; return aPrimitiveWrapperType != null ? aPrimitiveWrapperType : aClass ;
public class CollectionMapperFactory { /** * Returns the Mapper for the given field . If a Mapper exists in the cache that can map the given * field , the cached Mapper will be returned . Otherwise , a new Mapper is created and returned . * @ param field * the field of an entity for which a Mapper is to be produced . * @ return A Mapper to handle the mapping of the field . */ public Mapper getMapper ( Field field ) { } }
Type genericType = field . getGenericType ( ) ; Property propertyAnnotation = field . getAnnotation ( Property . class ) ; boolean indexed = true ; if ( propertyAnnotation != null ) { indexed = propertyAnnotation . indexed ( ) ; } String cacheKey = computeCacheKey ( genericType , indexed ) ; Mapper mapper = cache . get ( cacheKey ) ; if ( mapper == null ) { mapper = createMapper ( field , indexed ) ; } return mapper ;
public class CompactChangeEvent { /** * Creates a copy of this change event with uncommitted writes flag set to false . * @ return new change event without uncommitted writes flag */ public CompactChangeEvent < DocumentT > withoutUncommittedWrites ( ) { } }
return new CompactChangeEvent < > ( this . getOperationType ( ) , this . getFullDocument ( ) , this . getDocumentKey ( ) , this . getUpdateDescription ( ) , this . getStitchDocumentVersion ( ) , this . getStitchDocumentHash ( ) , false ) ;
public class ProcessEngineConfigurationImpl { /** * password digest / / / / / */ protected void initPasswordDigest ( ) { } }
if ( saltGenerator == null ) { saltGenerator = new Default16ByteSaltGenerator ( ) ; } if ( passwordEncryptor == null ) { passwordEncryptor = new Sha512HashDigest ( ) ; } if ( customPasswordChecker == null ) { customPasswordChecker = Collections . emptyList ( ) ; } if ( passwordManager == null ) { passwordManager = new PasswordManager ( passwordEncryptor , customPasswordChecker ) ; }
public class RefreshableThreadObject { /** * Remove the object from the Thread instances * @ param env */ public void remove ( Env env ) { } }
T obj = objs . remove ( Thread . currentThread ( ) ) ; if ( obj != null ) obj . destroy ( env ) ;
public class ResourceErrorMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ResourceError resourceError , ProtocolMarshaller protocolMarshaller ) { } }
if ( resourceError == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( resourceError . getErrorCode ( ) , ERRORCODE_BINDING ) ; protocolMarshaller . marshall ( resourceError . getErrorMessage ( ) , ERRORMESSAGE_BINDING ) ; protocolMarshaller . marshall ( resourceError . getErrorTimestamp ( ) , ERRORTIMESTAMP_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class CalibratingTimer { /** * Returns the difference between _ startStamp and current ( ) */ protected long elapsed ( ) { } }
long current = current ( ) ; if ( _driftRatio != 1.0 ) { long elapsed = current - _priorCurrent ; _startStamp += ( elapsed - ( elapsed * _driftRatio ) ) ; } _priorCurrent = current ; return current - _startStamp ;
public class TransformIterable { /** * Convert array from D type to type which set by { @ code dClass } parameter . * @ return array with type { @ code dClass } . */ public Object [ ] toArray ( ) { } }
ArrayList < D > l = new ArrayList < D > ( ) ; for ( S o : wrapped ) { l . add ( xform . transform ( o , clazz ) ) ; } return l . toArray ( ) ;
public class SemanticServiceImpl { /** * { @ inheritDoc } */ @ Override public void checkListUsage ( final Statement statement , final Document document ) throws SemanticWarning { } }
Object object = statement . getObject ( ) ; if ( object != null && ! statement . hasNestedStatement ( ) && object . getTerm ( ) . getFunctionEnum ( ) == FunctionEnum . LIST && ! statement . getRelationshipType ( ) . isListable ( ) ) { if ( document != null ) { pruneStatement ( statement , document ) ; } final String err = SEMANTIC_LIST_IMPROPER_CONTEXT ; final String name = statement . toBELShortForm ( ) ; throw new SemanticWarning ( name , err , null ) ; }
public class JSONArray { /** * Get the enum value associated with a key . * @ param < E > * Enum Type * @ param clazz * The type of enum to retrieve . * @ param index * The index must be between 0 and length ( ) - 1. * @ return The enum value at the index location or null if not found */ public < E extends Enum < E > > E optEnum ( Class < E > clazz , int index ) { } }
return this . optEnum ( clazz , index , null ) ;
public class XMLConfigFactory { /** * load XML Document from XML File * @ param is InoutStream to read * @ return returns the Document * @ throws SAXException * @ throws IOException */ private static Document _loadDocument ( InputStream is ) throws SAXException , IOException { } }
InputSource source = new InputSource ( is ) ; return XMLUtil . parse ( source , null , false ) ;
public class MavenJDOMWriter { /** * Method updateNotifier . * @ param value * @ param element * @ param counter * @ param xmlTag */ protected void updateNotifier ( Notifier value , String xmlTag , Counter counter , Element element ) { } }
Element root = element ; Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleElement ( innerCount , root , "type" , value . getType ( ) , "mail" ) ; findAndReplaceSimpleElement ( innerCount , root , "sendOnError" , ( value . isSendOnError ( ) == true ) ? null : String . valueOf ( value . isSendOnError ( ) ) , "true" ) ; findAndReplaceSimpleElement ( innerCount , root , "sendOnFailure" , ( value . isSendOnFailure ( ) == true ) ? null : String . valueOf ( value . isSendOnFailure ( ) ) , "true" ) ; findAndReplaceSimpleElement ( innerCount , root , "sendOnSuccess" , ( value . isSendOnSuccess ( ) == true ) ? null : String . valueOf ( value . isSendOnSuccess ( ) ) , "true" ) ; findAndReplaceSimpleElement ( innerCount , root , "sendOnWarning" , ( value . isSendOnWarning ( ) == true ) ? null : String . valueOf ( value . isSendOnWarning ( ) ) , "true" ) ; findAndReplaceSimpleElement ( innerCount , root , "address" , value . getAddress ( ) , null ) ; findAndReplaceProperties ( innerCount , root , "configuration" , value . getConfiguration ( ) ) ;
public class GenericTableColumnsModel { /** * Callback method for set the canEdit array from the generic given type . This method is invoked * in the constructor from the derived classes and can be overridden so users can provide their * own version of a column classes */ protected void onSetCanEdit ( ) { } }
Field [ ] fields = ReflectionExtensions . getDeclaredFields ( getType ( ) , "serialVersionUID" ) ; canEdit = new boolean [ fields . length ] ; for ( int i = 0 ; i < fields . length ; i ++ ) { canEdit [ i ] = false ; }
public class Billing { /** * < pre > * Billing configurations for sending metrics to the consumer project . * There can be multiple consumer destinations per service , each one must have * a different monitored resource type . A metric can be used in at most * one consumer destination . * < / pre > * < code > repeated . google . api . Billing . BillingDestination consumer _ destinations = 8 ; < / code > */ public java . util . List < com . google . api . Billing . BillingDestination > getConsumerDestinationsList ( ) { } }
return consumerDestinations_ ;
public class XSLServlet { /** * Get or Create a transformer for the specified stylesheet . * @ param req * @ param servletTask * @ param screen * @ return * @ throws ServletException * @ throws IOException */ public Transformer getTransformer ( HttpServletRequest req , ServletTask servletTask , ScreenModel screen ) throws ServletException , IOException { } }
String stylesheet = null ; if ( stylesheet == null ) stylesheet = req . getParameter ( DBParams . TEMPLATE ) ; if ( stylesheet == null ) if ( screen != null ) if ( screen . getScreenFieldView ( ) != null ) stylesheet = screen . getScreenFieldView ( ) . getStylesheetPath ( ) ; if ( stylesheet == null ) stylesheet = req . getParameter ( "stylesheet" ) ; if ( stylesheet == null ) stylesheet = "org/jbundle/res/docs/styles/xsl/flat/base/menus" ; try { if ( hmTransformers . get ( stylesheet ) != null ) return hmTransformers . get ( stylesheet ) ; String stylesheetFixed = BaseServlet . fixStylesheetPath ( stylesheet , screen , true ) ; InputStream stylesheetStream = this . getFileStream ( servletTask , stylesheetFixed , null ) ; if ( stylesheetStream == null ) { stylesheetFixed = BaseServlet . fixStylesheetPath ( stylesheet , screen , false ) ; // Try it without browser mod stylesheetStream = this . getFileStream ( servletTask , stylesheetFixed , null ) ; } if ( stylesheetStream == null ) Utility . getLogger ( ) . warning ( "XmlFile not found " + stylesheetFixed ) ; // TODO - Display an error here StreamSource stylesheetSource = new StreamSource ( stylesheetStream ) ; if ( tFact == null ) tFact = TransformerFactory . newInstance ( ) ; URIResolver resolver = new MyURIResolver ( servletTask , stylesheetFixed ) ; tFact . setURIResolver ( resolver ) ; Transformer transformer = tFact . newTransformer ( stylesheetSource ) ; // transformer . setOutputProperty ( OutputKeys . INDENT , " yes " ) ; // transformer . setOutputProperty ( OutputKeys . METHOD , " xml " ) ; hmTransformers . put ( stylesheet , transformer ) ; return transformer ; } catch ( TransformerConfigurationException ex ) { ex . printStackTrace ( ) ; } return null ;
public class ManagedContext { /** * This should only be called when SIGINT is received */ private void close ( ) { } }
lock . lock ( ) ; try { for ( SocketBase s : sockets ) { try { s . setSocketOpt ( ZMQ . ZMQ_LINGER , 0 ) ; s . close ( ) ; } catch ( Exception ignore ) { } } sockets . clear ( ) ; } finally { lock . unlock ( ) ; }
public class VirtualNetworkGatewaysInner { /** * Gets pre - generated VPN profile for P2S client of the virtual network gateway in the specified resource group . The profile needs to be generated first using generateVpnProfile . * @ param resourceGroupName The name of the resource group . * @ param virtualNetworkGatewayName The name of the virtual network gateway . * @ 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 String object if successful . */ public String getVpnProfilePackageUrl ( String resourceGroupName , String virtualNetworkGatewayName ) { } }
return getVpnProfilePackageUrlWithServiceResponseAsync ( resourceGroupName , virtualNetworkGatewayName ) . toBlocking ( ) . last ( ) . body ( ) ;
public class GoogleCredential { /** * { @ link Beta } < br / > * Return a credential defined by a Json file . * @ param credentialStream the stream with the credential definition . * @ return the credential defined by the credentialStream . * @ throws IOException if the credential cannot be created from the stream . */ @ Beta public static GoogleCredential fromStream ( InputStream credentialStream ) throws IOException { } }
return fromStream ( credentialStream , Utils . getDefaultTransport ( ) , Utils . getDefaultJsonFactory ( ) ) ;
public class FunctionCall { /** * Get a parameter assignment . * @ param name the parameter name * @ return the number */ public Number getParameter ( String name ) { } }
Number number = bindings . get ( name ) ; if ( number == null ) { throw new FuzzerException ( function . getName ( ) + ": undefined parameter '" + name + "'" ) ; } return number ;
public class CarRent { /** * Rent a car available in the last serach result * @ param intp - the command interpreter instance */ public void racRent ( ) { } }
pos = pos - 1 ; String userName = CarSearch . getLastSearchParams ( ) [ 0 ] ; String pickupDate = CarSearch . getLastSearchParams ( ) [ 1 ] ; String returnDate = CarSearch . getLastSearchParams ( ) [ 2 ] ; this . searcher . search ( userName , pickupDate , returnDate ) ; if ( searcher != null && searcher . getCars ( ) != null && pos < searcher . getCars ( ) . size ( ) && searcher . getCars ( ) . get ( pos ) != null ) { RESStatusType resStatus = reserver . reserveCar ( searcher . getCustomer ( ) , searcher . getCars ( ) . get ( pos ) , pickupDate , returnDate ) ; ConfirmationType confirm = reserver . getConfirmation ( resStatus , searcher . getCustomer ( ) , searcher . getCars ( ) . get ( pos ) , pickupDate , returnDate ) ; RESCarType car = confirm . getCar ( ) ; CustomerDetailsType customer = confirm . getCustomer ( ) ; System . out . println ( MessageFormat . format ( CONFIRMATION , confirm . getDescription ( ) , confirm . getReservationId ( ) , customer . getName ( ) , customer . getEmail ( ) , customer . getCity ( ) , customer . getStatus ( ) , car . getBrand ( ) , car . getDesignModel ( ) , confirm . getFromDate ( ) , confirm . getToDate ( ) , padl ( car . getRateDay ( ) , 10 ) , padl ( car . getRateWeekend ( ) , 10 ) , padl ( confirm . getCreditPoints ( ) . toString ( ) , 7 ) ) ) ; } else { System . out . println ( "Invalid selection: " + ( pos + 1 ) ) ; // $ NON - NLS - 1 $ }
public class DashboardAuditServiceImpl { /** * Calculates audit response for a given dashboard * @ param dashboardTitle * @ param dashboardType * @ param businessService * @ param businessApp * @ param beginDate * @ param endDate * @ param auditTypes * @ return @ DashboardReviewResponse for a given dashboard * @ throws AuditException */ @ SuppressWarnings ( "PMD.NPathComplexity" ) @ Override public DashboardReviewResponse getDashboardReviewResponse ( String dashboardTitle , DashboardType dashboardType , String businessService , String businessApp , long beginDate , long endDate , Set < AuditType > auditTypes ) throws AuditException { } }
validateParameters ( dashboardTitle , dashboardType , businessService , businessApp , beginDate , endDate ) ; DashboardReviewResponse dashboardReviewResponse = new DashboardReviewResponse ( ) ; Dashboard dashboard = getDashboard ( dashboardTitle , dashboardType , businessService , businessApp ) ; if ( dashboard == null ) { dashboardReviewResponse . addAuditStatus ( DashboardAuditStatus . DASHBOARD_NOT_REGISTERED ) ; return dashboardReviewResponse ; } dashboardReviewResponse . setDashboardTitle ( dashboard . getTitle ( ) ) ; dashboardReviewResponse . setBusinessApplication ( StringUtils . isEmpty ( businessApp ) ? dashboard . getConfigurationItemBusAppName ( ) : businessApp ) ; dashboardReviewResponse . setBusinessService ( StringUtils . isEmpty ( businessService ) ? dashboard . getConfigurationItemBusServName ( ) : businessService ) ; if ( auditTypes . contains ( AuditType . ALL ) ) { auditTypes . addAll ( Sets . newHashSet ( AuditType . values ( ) ) ) ; auditTypes . remove ( AuditType . ALL ) ; } auditTypes . forEach ( auditType -> { Evaluator evaluator = auditModel . evaluatorMap ( ) . get ( auditType ) ; try { Collection < AuditReviewResponse > auditResponse = evaluator . evaluate ( dashboard , beginDate , endDate , null ) ; dashboardReviewResponse . addReview ( auditType , auditResponse ) ; dashboardReviewResponse . addAuditStatus ( auditModel . successStatusMap ( ) . get ( auditType ) ) ; } catch ( AuditException e ) { if ( e . getErrorCode ( ) == AuditException . NO_COLLECTOR_ITEM_CONFIGURED ) { dashboardReviewResponse . addAuditStatus ( auditModel . errorStatusMap ( ) . get ( auditType ) ) ; } } } ) ; return dashboardReviewResponse ;
public class BeanPropertiesToCsvHeaderConverter { public String toHeaderRow ( Class < ? > objectClass ) { } }
if ( ClassPath . isPrimitive ( objectClass ) || Scheduler . isDateOrTime ( objectClass ) ) return new StringBuilder ( objectClass . getSimpleName ( ) ) . append ( "\n" ) . toString ( ) ; Method [ ] methodArray = objectClass . getMethods ( ) ; Method m ; String methodName = null ; methods = new TreeMap < String , Method > ( ) ; for ( int i = 0 ; i < methodArray . length ; i ++ ) { m = methodArray [ i ] ; methodName = m . getName ( ) ; if ( ! methodName . startsWith ( GET_PREFIX ) || m . getParameterCount ( ) != 0 || methodName . equals ( "getClass" ) ) continue ; // not properties methods . put ( methodName , m ) ; } StringBuilder csv = new StringBuilder ( ) ; for ( String keyMethodName : methods . keySet ( ) ) { if ( csv . length ( ) != 0 ) csv . append ( SEPARATOR ) ; csv . append ( QUOTE ) . append ( format ( toFieldName ( keyMethodName ) ) ) . append ( QUOTE ) ; } csv . append ( NEWLINE ) ; return csv . toString ( ) ;
public class CmsSearchIndex { /** * Adds a parameter . < p > * @ param key the key / name of the parameter * @ param value the value of the parameter */ @ Override public void addConfigurationParameter ( String key , String value ) { } }
if ( PERMISSIONS . equals ( key ) ) { m_checkPermissions = Boolean . valueOf ( value ) . booleanValue ( ) ; } else if ( EXTRACT_CONTENT . equals ( key ) ) { setExtractContent ( Boolean . valueOf ( value ) . booleanValue ( ) ) ; } else if ( BACKUP_REINDEXING . equals ( key ) ) { m_backupReindexing = Boolean . valueOf ( value ) . booleanValue ( ) ; } else if ( LANGUAGEDETECTION . equals ( key ) ) { setLanguageDetection ( Boolean . valueOf ( value ) . booleanValue ( ) ) ; } else if ( IGNORE_EXPIRATION . equals ( key ) ) { m_ignoreExpiration = Boolean . valueOf ( value ) . booleanValue ( ) ; } else if ( PRIORITY . equals ( key ) ) { m_priority = Integer . parseInt ( value ) ; if ( m_priority < Thread . MIN_PRIORITY ) { m_priority = Thread . MIN_PRIORITY ; LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_SEARCH_PRIORITY_TOO_LOW_2 , value , new Integer ( Thread . MIN_PRIORITY ) ) ) ; } else if ( m_priority > Thread . MAX_PRIORITY ) { m_priority = Thread . MAX_PRIORITY ; LOG . debug ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_SEARCH_PRIORITY_TOO_HIGH_2 , value , new Integer ( Thread . MAX_PRIORITY ) ) ) ; } } if ( MAX_HITS . equals ( key ) ) { try { m_maxHits = Integer . parseInt ( value ) ; } catch ( NumberFormatException e ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_INVALID_PARAM_3 , value , key , getName ( ) ) ) ; } if ( m_maxHits < ( MAX_HITS_DEFAULT / 100 ) ) { m_maxHits = MAX_HITS_DEFAULT ; LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_INVALID_PARAM_3 , value , key , getName ( ) ) ) ; } } else if ( TIME_RANGE . equals ( key ) ) { m_checkTimeRange = Boolean . valueOf ( value ) . booleanValue ( ) ; } else if ( CmsSearchIndex . EXCERPT . equals ( key ) ) { m_createExcerpt = Boolean . valueOf ( value ) . booleanValue ( ) ; } else if ( LUCENE_RAM_BUFFER_SIZE_MB . equals ( key ) ) { try { m_luceneRAMBufferSizeMB = Double . valueOf ( value ) ; } catch ( NumberFormatException e ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_INVALID_PARAM_3 , value , key , getName ( ) ) ) ; } }
public class StoreDefinitionUtils { /** * Ensure that new store definitions that are specified for an update do not include breaking changes to the store . * Non - breaking changes include changes to * description * preferredWrites * requiredWrites * preferredReads * requiredReads * retentionPeriodDays * retentionScanThrottleRate * retentionFrequencyDays * viewOf * zoneCountReads * zoneCountWrites * owners * memoryFootprintMB * non breaking changes include the serializer definition , as long as the type ( name field ) is unchanged for * keySerializer * valueSerializer * transformSerializer * @ param oldStoreDef * @ param newStoreDef */ public static void validateNewStoreDefIsNonBreaking ( StoreDefinition oldStoreDef , StoreDefinition newStoreDef ) { } }
if ( ! oldStoreDef . getName ( ) . equals ( newStoreDef . getName ( ) ) ) { throw new VoldemortException ( "Cannot compare stores of different names: " + oldStoreDef . getName ( ) + " and " + newStoreDef . getName ( ) ) ; } String store = oldStoreDef . getName ( ) ; verifySamePropertyForUpdate ( oldStoreDef . getReplicationFactor ( ) , newStoreDef . getReplicationFactor ( ) , "ReplicationFactor" , store ) ; verifySamePropertyForUpdate ( oldStoreDef . getType ( ) , newStoreDef . getType ( ) , "Type" , store ) ; verifySameSerializerType ( oldStoreDef . getKeySerializer ( ) , newStoreDef . getKeySerializer ( ) , "KeySerializer" , store ) ; verifySameSerializerType ( oldStoreDef . getValueSerializer ( ) , newStoreDef . getValueSerializer ( ) , "ValueSerializer" , store ) ; verifySameSerializerType ( oldStoreDef . getTransformsSerializer ( ) , newStoreDef . getTransformsSerializer ( ) , "TransformSerializer" , store ) ; verifySamePropertyForUpdate ( oldStoreDef . getRoutingPolicy ( ) , newStoreDef . getRoutingPolicy ( ) , "RoutingPolicy" , store ) ; verifySamePropertyForUpdate ( oldStoreDef . getRoutingStrategyType ( ) , newStoreDef . getRoutingStrategyType ( ) , "RoutingStrategyType" , store ) ; verifySamePropertyForUpdate ( oldStoreDef . getZoneReplicationFactor ( ) , newStoreDef . getZoneReplicationFactor ( ) , "ZoneReplicationFactor" , store ) ; verifySamePropertyForUpdate ( oldStoreDef . getValueTransformation ( ) , newStoreDef . getValueTransformation ( ) , "ValueTransformation" , store ) ; verifySamePropertyForUpdate ( oldStoreDef . getSerializerFactory ( ) , newStoreDef . getSerializerFactory ( ) , "SerializerFactory" , store ) ; verifySamePropertyForUpdate ( oldStoreDef . getHintedHandoffStrategyType ( ) , newStoreDef . getHintedHandoffStrategyType ( ) , "HintedHandoffStrategyType" , store ) ; verifySamePropertyForUpdate ( oldStoreDef . getHintPrefListSize ( ) , newStoreDef . getHintPrefListSize ( ) , "HintPrefListSize" , store ) ;
public class BooleanOperation { /** * < div color = ' red ' style = " font - size : 24px ; color : red " > < b > < i > < u > JCYPHER < / u > < / i > < / b > < / div > * < div color = ' red ' style = " font - size : 18px ; color : red " > < i > test for containment in a list of matched domain objects < / i > < / div > * < br / > */ public < E > TerminalResult IN ( DomainObjectMatch < E > domainObjects ) { } }
DomainObjectMatch < ? > delegate = APIAccess . getDelegate ( domainObjects ) ; DomainObjectMatch < ? > match = delegate != null ? delegate : domainObjects ; getPredicateExpression ( ) . setOperator ( Operator . IN ) ; getPredicateExpression ( ) . setValue_2 ( match ) ; TerminalResult ret = APIAccess . createTerminalResult ( this . getPredicateExpression ( ) ) ; QueryRecorder . recordInvocation ( this , "IN" , ret , QueryRecorder . placeHolder ( match ) ) ; return ret ;
public class KafkaTopicsDescriptor { /** * Check if the input topic matches the topics described by this KafkaTopicDescriptor . * @ return true if found a match . */ public boolean isMatchingTopic ( String topic ) { } }
if ( isFixedTopics ( ) ) { return getFixedTopics ( ) . contains ( topic ) ; } else { return topicPattern . matcher ( topic ) . matches ( ) ; }
public class DataGridStateFactory { /** * Get an instance of a DataGridStateFactory given a { @ link ServletRequest } . * @ param request the current { @ link ServletRequest } * @ return an instance of the factory */ public static final DataGridStateFactory getInstance ( ServletRequest request ) { } }
Object obj = request . getAttribute ( KEY ) ; if ( obj != null ) { assert obj instanceof DataGridStateFactory ; return ( DataGridStateFactory ) obj ; } else { DataGridStateFactory factory = new DataGridStateFactory ( request ) ; request . setAttribute ( KEY , factory ) ; return factory ; }
public class CertificatesInner { /** * Generate verification code for proof of possession flow . * Generates verification code for proof of possession flow . The verification code will be used to generate a leaf certificate . * @ param resourceGroupName The name of the resource group that contains the IoT hub . * @ param resourceName The name of the IoT hub . * @ param certificateName The name of the certificate * @ param ifMatch ETag of the Certificate . * @ 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 < CertificateWithNonceDescriptionInner > generateVerificationCodeAsync ( String resourceGroupName , String resourceName , String certificateName , String ifMatch , final ServiceCallback < CertificateWithNonceDescriptionInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( generateVerificationCodeWithServiceResponseAsync ( resourceGroupName , resourceName , certificateName , ifMatch ) , serviceCallback ) ;
public class BundlePackagerMojo { /** * Execute method creates application bundle . Also creates the application distribution if the * { @ link # wisdomDirectory } parameter is not set and if { @ link # disableDistributionPackaging } * is set to false . * @ throws MojoExecutionException if the bundle or the distribution cannot be created * correctly , or if the resulting artifacts cannot be copied to their final destinations . */ @ Override public void execute ( ) throws MojoExecutionException { } }
try { createApplicationBundle ( ) ; if ( ! disableDistributionPackaging ) { if ( wisdomDirectory != null ) { getLog ( ) . warn ( "Cannot create the distribution of " + project . getArtifactId ( ) + " because it is using a remote Wisdom server (" + wisdomDirectory . getAbsolutePath ( ) + ")." ) ; } else { createApplicationDistribution ( ) ; } } else { getLog ( ) . debug ( "Creation of the zip file disabled" ) ; } } catch ( Exception e ) { throw new MojoExecutionException ( "Cannot build wisdom application" , e ) ; } displayNonBundleLibraryWarning ( ) ;
public class ThriftCodecByteCodeGenerator { /** * Defines the code to construct the struct ( or builder ) instance and stores it in a local * variable . */ private LocalVariableDefinition constructStructInstance ( MethodDefinition read , Map < Short , LocalVariableDefinition > structData ) { } }
LocalVariableDefinition instance = read . addLocalVariable ( structType , "instance" ) ; // create the new instance ( or builder ) if ( metadata . getBuilderClass ( ) == null ) { read . newObject ( structType ) . dup ( ) ; } else { read . newObject ( metadata . getBuilderClass ( ) ) . dup ( ) ; } // invoke constructor ThriftConstructorInjection constructor = metadata . getConstructorInjection ( ) . get ( ) ; // push parameters on stack for ( ThriftParameterInjection parameter : constructor . getParameters ( ) ) { read . loadVariable ( structData . get ( parameter . getId ( ) ) ) ; } // invoke constructor read . invokeConstructor ( constructor . getConstructor ( ) ) . storeVariable ( instance ) ; return instance ;
public class Items { /** * Gets a read - only view all the { @ link Item } s recursively in the { @ link ItemGroup } tree visible to the supplied * authentication without concern for the order in which items are returned . Each iteration * of the view will be " live " reflecting the items available between the time the iteration was started and the * time the iteration was completed , however if items are moved during an iteration - depending on the move - it * may be possible for such items to escape the entire iteration . * @ param root the root . * @ param type the type . * @ param < T > the type . * @ return An { @ link Iterable } for all items . * @ since 2.37 */ public static < T extends Item > Iterable < T > allItems ( Authentication authentication , ItemGroup root , Class < T > type ) { } }
return new AllItemsIterable < > ( root , authentication , type ) ;
public class DefaultJsonWriter { /** * { @ inheritDoc } */ @ Override public final void setIndent ( String indent ) { } }
if ( indent . length ( ) == 0 ) { this . indent = null ; this . separator = ":" ; } else { this . indent = indent ; this . separator = ": " ; }
public class LittleEndian { /** * Sets a 32 - bit integer in the given byte array at the given offset . */ public static void setInt32 ( byte [ ] dst , int offset , long value ) throws IllegalArgumentException { } }
assert value <= Integer . MAX_VALUE : "value out of range" ; dst [ offset + 0 ] = ( byte ) ( value & 0xFF ) ; dst [ offset + 1 ] = ( byte ) ( ( value >>> 8 ) & 0xFF ) ; dst [ offset + 2 ] = ( byte ) ( ( value >>> 16 ) & 0xFF ) ; dst [ offset + 3 ] = ( byte ) ( ( value >>> 24 ) & 0xFF ) ;
public class ListStatistics { /** * once we have the Item available to determine it from . */ public final void updateTotal ( int oldSizeInBytes , int newSizeInBytes ) throws SevereMessageStoreException { } }
boolean doCallback = false ; synchronized ( this ) { // We ' re only replacing an old size estimation // with a new one so we do not need to change // or inspect the count total and watermark // Check whether we were between our limits before // before this update . boolean wasBelowHighLimit = ( _countTotalBytes < _watermarkBytesHigh ) ; boolean wasAboveLowLimit = ( _countTotalBytes >= _watermarkBytesLow ) ; // Update our count to the new value by adding the // difference between the old and new sizes _countTotalBytes = _countTotalBytes + ( newSizeInBytes - oldSizeInBytes ) ; if ( ( wasBelowHighLimit && _countTotalBytes >= _watermarkBytesHigh ) // Was below the HIGH watermark but now isn ' t || ( wasAboveLowLimit && _countTotalBytes < _watermarkBytesLow ) ) // OR was above LOW watermark but now isn ' t { doCallback = true ; } } if ( doCallback ) { _owningStreamLink . eventWatermarkBreached ( ) ; }
public class Counter { /** * This method will apply normalization to counter values and totals . */ public void normalize ( ) { } }
for ( T key : keySet ( ) ) { setCount ( key , getCount ( key ) / totalCount . get ( ) ) ; } rebuildTotals ( ) ;
public class DataSourceTypeImpl { /** * Returns the < code > max - idle - time < / code > element * @ return the node defined for the element < code > max - idle - time < / code > */ public Integer getMaxIdleTime ( ) { } }
if ( childNode . getTextValueForPatternName ( "max-idle-time" ) != null && ! childNode . getTextValueForPatternName ( "max-idle-time" ) . equals ( "null" ) ) { return Integer . valueOf ( childNode . getTextValueForPatternName ( "max-idle-time" ) ) ; } return null ;
public class DB { /** * Set JDBDT save - point . * @ param callInfo Call info . */ void save ( CallInfo callInfo ) { } }
access ( callInfo , ( ) -> { if ( ! savepointSupport ) { throw new UnsupportedOperationException ( "Savepoints are not supported by the database driver." ) ; } logSetup ( callInfo ) ; clearSavePointIfSet ( ) ; if ( connection . getAutoCommit ( ) ) { throw new InvalidOperationException ( "Auto-commit is set for database connection." ) ; } savepoint = connection . setSavepoint ( ) ; return 0 ; } ) ;
public class UrlMappingsHolderFactoryBean { /** * Set the ApplicationContext that this object runs in . * Normally this call will be used to initialize the object . * < p > Invoked after population of normal bean properties but before an init callback such * as { @ link org . springframework . beans . factory . InitializingBean # afterPropertiesSet ( ) } * or a custom init - method . Invoked after { @ link org . springframework . context . ResourceLoaderAware # setResourceLoader } , * { @ link org . springframework . context . ApplicationEventPublisherAware # setApplicationEventPublisher } and * { @ link org . springframework . context . MessageSourceAware } , if applicable . * @ param applicationContext the ApplicationContext object to be used by this object * @ throws org . springframework . context . ApplicationContextException * in case of context initialization errors * @ throws org . springframework . beans . BeansException * if thrown by application context methods * @ see org . springframework . beans . factory . BeanInitializationException */ public void setApplicationContext ( ApplicationContext applicationContext ) throws BeansException { } }
this . applicationContext = applicationContext ; setGrailsApplication ( applicationContext . getBean ( GrailsApplication . APPLICATION_ID , GrailsApplication . class ) ) ; setPluginManager ( applicationContext . containsBean ( GrailsPluginManager . BEAN_NAME ) ? applicationContext . getBean ( GrailsPluginManager . BEAN_NAME , GrailsPluginManager . class ) : null ) ;
public class RepairingHandler { /** * TODO : really need to pass partition ID ? */ public void updateLastKnownStaleSequence ( MetaDataContainer metaData , int partition ) { } }
long lastReceivedSequence ; long lastKnownStaleSequence ; do { lastReceivedSequence = metaData . getSequence ( ) ; lastKnownStaleSequence = metaData . getStaleSequence ( ) ; if ( lastKnownStaleSequence >= lastReceivedSequence ) { break ; } } while ( ! metaData . casStaleSequence ( lastKnownStaleSequence , lastReceivedSequence ) ) ; if ( logger . isFinestEnabled ( ) ) { logger . finest ( format ( "%s:[map=%s,partition=%d,lowerSequencesStaleThan=%d,lastReceivedSequence=%d]" , "Stale sequences updated" , name , partition , metaData . getStaleSequence ( ) , metaData . getSequence ( ) ) ) ; }
public class URLStreamHandlerAdapter { /** * @ see org . osgi . service . url . URLStreamHandlerService # toExternalForm ( java . net . URL ) */ @ Override public String toExternalForm ( URL url ) { } }
try { return ( String ) _toExternalForm . invoke ( getInstance ( ) , new Object [ ] { url } ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , getClass ( ) . getName ( ) , "toExternalForm" , url ) ; return null ; }
public class dnspolicy { /** * Use this API to fetch dnspolicy resource of given name . */ public static dnspolicy get ( nitro_service service , String name ) throws Exception { } }
dnspolicy obj = new dnspolicy ( ) ; obj . set_name ( name ) ; dnspolicy response = ( dnspolicy ) obj . get_resource ( service ) ; return response ;
public class NettyServer { /** * close all channels , and release resources */ public void close ( ) { } }
LOG . info ( "Begin to shutdown NettyServer" ) ; if ( allChannels != null ) { new Thread ( new Runnable ( ) { @ Override public void run ( ) { try { // await ( 5 , TimeUnit . SECONDS ) // sometimes allChannels . close ( ) will block the exit thread allChannels . close ( ) . await ( 1 , TimeUnit . SECONDS ) ; LOG . info ( "Successfully close all channel" ) ; factory . releaseExternalResources ( ) ; } catch ( Exception ignored ) { } allChannels = null ; } } ) . start ( ) ; JStormUtils . sleepMs ( 1000 ) ; } LOG . info ( "Successfully shutdown NettyServer" ) ;
public class AmazonLexModelBuildingClient { /** * Gets a list of built - in intents that meet the specified criteria . * This operation requires permission for the < code > lex : GetBuiltinIntents < / code > action . * @ param getBuiltinIntentsRequest * @ return Result of the GetBuiltinIntents operation returned by the service . * @ throws LimitExceededException * The request exceeded a limit . Try your request again . * @ throws InternalFailureException * An internal Amazon Lex error occurred . Try your request again . * @ throws BadRequestException * The request is not well formed . For example , a value is invalid or a required field is missing . Check the * field values , and try again . * @ sample AmazonLexModelBuilding . GetBuiltinIntents * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / lex - models - 2017-04-19 / GetBuiltinIntents " target = " _ top " > AWS * API Documentation < / a > */ @ Override public GetBuiltinIntentsResult getBuiltinIntents ( GetBuiltinIntentsRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeGetBuiltinIntents ( request ) ;
public class IntTupleStreams { /** * Returns a stream that returns the { @ link MutableIntTuple } s from the * given delegate that are contained in the given bounds . < br > * < br > * Copies of the given tuples will be stored internally . < br > * < br > * @ param < T > The type of the stream elements * @ param min The minimum , inclusive * @ param max The maximum , exclusive * @ param delegate The delegate iterator * @ return The stream * @ throws IllegalArgumentException If the given tuples do not * have the same { @ link Tuple # getSize ( ) size } */ public static < T extends MutableIntTuple > Stream < T > clampingStream ( IntTuple min , IntTuple max , Stream < T > delegate ) { } }
Utils . checkForEqualSize ( min , max ) ; IntTuple localMin = IntTuples . copy ( min ) ; IntTuple localMax = IntTuples . copy ( max ) ; return delegate . filter ( t -> IntTuples . areElementsGreaterThanOrEqual ( t , localMin ) && IntTuples . areElementsLessThan ( t , localMax ) ) ;
public class CommonOps_DDF5 { /** * Performs an element by element scalar multiplication . < br > * < br > * b < sub > i < / sub > = & alpha ; * a < sub > i < / sub > * @ param alpha the amount each element is multiplied by . * @ param a The vector that is to be scaled . Not modified . * @ param b Where the scaled matrix is stored . Modified . */ public static void scale ( double alpha , DMatrix5 a , DMatrix5 b ) { } }
b . a1 = a . a1 * alpha ; b . a2 = a . a2 * alpha ; b . a3 = a . a3 * alpha ; b . a4 = a . a4 * alpha ; b . a5 = a . a5 * alpha ;
import java . math . * ; public class CalculateMinimumSumOfFactors { /** * This java function calculates the minimum sum of factors of a number . * > > > calculateMinimumSumOfFactors ( 12) * > > > calculateMinimumSumOfFactors ( 105) * 15 * > > > calculateMinimumSumOfFactors ( 2) */ public static double calculateMinimumSumOfFactors ( int inputNumber ) { } }
double factorSum = 0 ; int divisor = 2 ; while ( ( divisor * divisor ) <= inputNumber ) { while ( ( inputNumber % divisor ) == 0 ) { factorSum += divisor ; inputNumber /= divisor ; } divisor += 1 ; } factorSum += inputNumber ; return factorSum ;
public class UniverseApi { /** * Get item group information Get information on an item group - - - This * route expires daily at 11:05 * @ param groupId * An Eve item group ID ( required ) * @ param acceptLanguage * Language to use in the response ( optional , default to en - us ) * @ param datasource * The server name you would like data from ( optional , default to * tranquility ) * @ param ifNoneMatch * ETag from a previous request . A 304 will be returned if this * matches the current ETag ( optional ) * @ param language * Language to use in the response , takes precedence over * Accept - Language ( optional , default to en - us ) * @ return GroupResponse * @ throws ApiException * If fail to call the API , e . g . server error or cannot * deserialize the response body */ public GroupResponse getUniverseGroupsGroupId ( Integer groupId , String acceptLanguage , String datasource , String ifNoneMatch , String language ) throws ApiException { } }
ApiResponse < GroupResponse > resp = getUniverseGroupsGroupIdWithHttpInfo ( groupId , acceptLanguage , datasource , ifNoneMatch , language ) ; return resp . getData ( ) ;
public class OutgoingFileTransfer { /** * This method handles the stream negotiation process and transmits the file * to the remote user . It returns immediately and the progress of the file * transfer can be monitored through several methods : * < UL > * < LI > { @ link FileTransfer # getStatus ( ) } * < LI > { @ link FileTransfer # getProgress ( ) } * < LI > { @ link FileTransfer # isDone ( ) } * < / UL > * @ param file the file to transfer to the remote entity . * @ param description a description for the file to transfer . * @ throws SmackException * If there is an error during the negotiation process or the * sending of the file . */ public synchronized void sendFile ( final File file , final String description ) throws SmackException { } }
checkTransferThread ( ) ; if ( file == null || ! file . exists ( ) || ! file . canRead ( ) ) { throw new IllegalArgumentException ( "Could not read file" ) ; } else { setFileInfo ( file . getAbsolutePath ( ) , file . getName ( ) , file . length ( ) ) ; } transferThread = new Thread ( new Runnable ( ) { @ Override public void run ( ) { try { outputStream = negotiateStream ( file . getName ( ) , file . length ( ) , description ) ; } catch ( XMPPErrorException e ) { handleXMPPException ( e ) ; return ; } catch ( Exception e ) { setException ( e ) ; } if ( outputStream == null ) { return ; } if ( ! updateStatus ( Status . negotiated , Status . in_progress ) ) { return ; } InputStream inputStream = null ; try { inputStream = new FileInputStream ( file ) ; writeToStream ( inputStream , outputStream ) ; } catch ( FileNotFoundException e ) { setStatus ( FileTransfer . Status . error ) ; setError ( Error . bad_file ) ; setException ( e ) ; } catch ( IOException e ) { setStatus ( FileTransfer . Status . error ) ; setException ( e ) ; } finally { CloseableUtil . maybeClose ( inputStream , LOGGER ) ; CloseableUtil . maybeClose ( outputStream , LOGGER ) ; } updateStatus ( Status . in_progress , FileTransfer . Status . complete ) ; } } , "File Transfer " + streamID ) ; transferThread . start ( ) ;
public class ApplicationSession { /** * When a correct login occurs , read all relevant userinformation into * session . * @ param event * the loginEvent that triggered this handler . */ protected void handleLoginEvent ( LoginEvent event ) { } }
ApplicationSessionInitializer asi = getApplicationSessionInitializer ( ) ; if ( asi != null ) { asi . initializeUser ( ) ; Map < String , Object > userAttributes = asi . getUserAttributes ( ) ; if ( userAttributes != null ) { setUserAttributes ( userAttributes ) ; } } Authentication auth = ( Authentication ) event . getSource ( ) ; propertyChangeSupport . firePropertyChange ( USER , null , auth ) ;
public class HtmlDocumentUtils { /** * Searches for the given selector if found it returns the text of the first result . * @ param aElementSelector The selector for the searched element . * @ param aDocument The document in which will be searched . * @ return A { @ link Optional } containing the found element or else an empty { @ link Optional } . */ public static Optional < String > getElementString ( final String aElementSelector , final Document aDocument ) { } }
final Elements selected = aDocument . select ( aElementSelector ) ; if ( ! selected . isEmpty ( ) ) { return Optional . of ( selected . first ( ) . text ( ) ) ; } return Optional . empty ( ) ;
public class ColorComponent { /** * Gets the { @ link EnumDyeColor color } for the { @ link IBlockState } . * @ param state the state * @ return the EnumDyeColor , null if the block is not { @ link ColorComponent } */ public static EnumDyeColor getColor ( IBlockState state ) { } }
ColorComponent cc = IComponent . getComponent ( ColorComponent . class , state . getBlock ( ) ) ; if ( cc == null ) return EnumDyeColor . WHITE ; PropertyEnum < EnumDyeColor > property = cc . getProperty ( ) ; if ( property == null || ! state . getProperties ( ) . containsKey ( property ) ) return EnumDyeColor . WHITE ; return state . getValue ( property ) ;
public class ArgumentMatchers { /** * Object argument that is reflection - equal to the given value with support for excluding * selected fields from a class . * This matcher can be used when equals ( ) is not implemented on compared objects . * Matcher uses java reflection API to compare fields of wanted and actual object . * Works similarly to < code > EqualsBuilder . reflectionEquals ( this , other , excludeFields ) < / code > from * apache commons library . * < b > Warning < / b > The equality check is shallow ! * See examples in javadoc for { @ link ArgumentMatchers } class * @ param value the given value . * @ param excludeFields fields to exclude , if field does not exist it is ignored . * @ return < code > null < / code > . */ public static < T > T refEq ( T value , String ... excludeFields ) { } }
reportMatcher ( new ReflectionEquals ( value , excludeFields ) ) ; return null ;
public class Calendar { /** * Sets all the calendar field values and the time value * ( millisecond offset from the < a href = " # Epoch " > Epoch < / a > ) of * this < code > Calendar < / code > undefined . This means that { @ link * # isSet ( int ) isSet ( ) } will return < code > false < / code > for all the * calendar fields , and the date and time calculations will treat * the fields as if they had never been set . A * < code > Calendar < / code > implementation class may use its specific * default field values for date / time calculations . For example , * < code > GregorianCalendar < / code > uses 1970 if the * < code > YEAR < / code > field value is undefined . * @ see # clear ( int ) */ public final void clear ( ) { } }
for ( int i = 0 ; i < fields . length ; ) { stamp [ i ] = fields [ i ] = 0 ; // UNSET = = 0 isSet [ i ++ ] = false ; } areAllFieldsSet = areFieldsSet = false ; isTimeSet = false ;
public class PersonRecognition { /** * 构建viterbi路径 * @ param terms * @ return */ private Viterbi < PersonNode > getPersonNodeViterbi ( Term [ ] terms ) { } }
Term first ; PersonNatureAttr fPna ; Term second ; Term third ; Term from ; for ( int i = 0 ; i < terms . length - 1 ; i ++ ) { first = terms [ i ] ; if ( first == null ) { continue ; } fPna = getPersonNature ( first ) ; setNode ( first , A ) ; if ( fPna . getY ( ) > 0 ) { setNode ( first , Y ) ; } if ( ! fPna . isActive ( ) ) { continue ; } second = first . to ( ) ; if ( second . getOffe ( ) == terms . length || second . getName ( ) . length ( ) > 2 ) { // 说明到结尾了 , 或者后面长度不符合规则 continue ; } third = second . to ( ) ; from = first . from ( ) ; // XD if ( first . getName ( ) . length ( ) == 2 ) { setNode ( from , K ) ; setNode ( from , M ) ; setNode ( first , X ) ; setNode ( second , D ) ; setNode ( third , M ) ; setNode ( third , L ) ; continue ; } setNode ( from , K ) ; setNode ( from , M ) ; setNode ( first , B ) ; setNode ( third , M ) ; setNode ( third , L ) ; // BZ if ( second . getName ( ) . length ( ) == 2 ) { setNode ( second , Z ) ; continue ; } else { // BE setNode ( second , E ) ; } if ( third . getOffe ( ) == terms . length || third . getName ( ) . length ( ) > 1 ) { // 说明到结尾了 , 或者后面长度不符合规则 continue ; } // BCD setNode ( first , B ) ; setNode ( second , C ) ; setNode ( third , D ) ; setNode ( third . to ( ) , M ) ; setNode ( third . to ( ) , L ) ; } PersonNatureAttr begin = DATDictionary . person ( "BEGIN" ) ; nodes [ 0 ] [ 6 ] = null ; nodes [ 0 ] [ 4 ] = new PersonNode ( 4 , "B" , - Math . log ( begin . getK ( ) ) ) ; nodes [ 0 ] [ 10 ] = new PersonNode ( 10 , "B" , - Math . log ( begin . getA ( ) ) ) ; PersonNatureAttr end = DATDictionary . person ( "END" ) ; nodes [ terms . length ] [ 5 ] = new PersonNode ( 5 , "E" , - Math . log ( end . getL ( ) ) ) ; nodes [ terms . length ] [ 6 ] = null ; nodes [ terms . length ] [ 10 ] = new PersonNode ( 10 , "E" , - Math . log ( end . getA ( ) ) ) ; return new Viterbi < PersonNode > ( nodes , new Values < PersonNode > ( ) { @ Override public int step ( Node < PersonNode > node ) { return node . getObj ( ) . name . length ( ) ; } @ Override public double selfSscore ( Node < PersonNode > node ) { return node . getObj ( ) . score ; } } ) ;
public class RealVoltDB { /** * Verify the integrity of the newly updated catalog stored on the ZooKeeper */ @ Override public String verifyJarAndPrepareProcRunners ( byte [ ] catalogBytes , String diffCommands , byte [ ] catalogBytesHash , byte [ ] deploymentBytes ) { } }
ImmutableMap . Builder < String , Class < ? > > classesMap = ImmutableMap . < String , Class < ? > > builder ( ) ; InMemoryJarfile newCatalogJar ; JarLoader jarLoader ; String errorMsg ; try { newCatalogJar = new InMemoryJarfile ( catalogBytes ) ; jarLoader = newCatalogJar . getLoader ( ) ; for ( String classname : jarLoader . getClassNames ( ) ) { try { Class < ? > procCls = CatalogContext . classForProcedureOrUDF ( classname , jarLoader ) ; classesMap . put ( classname , procCls ) ; } // LinkageError catches most of the various class loading errors we ' d // care about here . catch ( UnsupportedClassVersionError e ) { errorMsg = "Cannot load classes compiled with a higher version of Java than currently" + " in use. Class " + classname + " was compiled with " ; Integer major = 0 ; // update the matcher pattern for various jdk Pattern pattern = Pattern . compile ( "version\\s(\\d+).(\\d+)" ) ; Matcher matcher = pattern . matcher ( e . getMessage ( ) ) ; if ( matcher . find ( ) ) { major = Integer . parseInt ( matcher . group ( 1 ) ) ; } else { hostLog . info ( "Unable to parse compile version number from UnsupportedClassVersionError." ) ; } if ( VerifyCatalogAndWriteJar . SupportedJavaVersionMap . containsKey ( major ) ) { errorMsg = errorMsg . concat ( VerifyCatalogAndWriteJar . SupportedJavaVersionMap . get ( major ) + ", current runtime version is " + System . getProperty ( "java.version" ) + "." ) ; } else { errorMsg = errorMsg . concat ( "an incompatible Java version." ) ; } hostLog . info ( errorMsg ) ; return errorMsg ; } catch ( LinkageError | ClassNotFoundException e ) { String cause = e . getMessage ( ) ; if ( cause == null && e . getCause ( ) != null ) { cause = e . getCause ( ) . getMessage ( ) ; } errorMsg = "Error loading class \'" + classname + "\': " + e . getClass ( ) . getCanonicalName ( ) + " for " + cause ; hostLog . info ( errorMsg ) ; return errorMsg ; } } } catch ( Exception e ) { // catch all exceptions , anything may fail now can be safely rolled back return e . getMessage ( ) ; } CatalogContext ctx = VoltDB . instance ( ) . getCatalogContext ( ) ; Catalog newCatalog = ctx . getNewCatalog ( diffCommands ) ; Database db = newCatalog . getClusters ( ) . get ( "cluster" ) . getDatabases ( ) . get ( "database" ) ; CatalogMap < Procedure > catalogProcedures = db . getProcedures ( ) ; int siteCount = m_nodeSettings . getLocalSitesCount ( ) + 1 ; // + MPI site ctx . m_preparedCatalogInfo = new CatalogContext . CatalogInfo ( catalogBytes , catalogBytesHash , deploymentBytes ) ; ctx . m_preparedCatalogInfo . m_catalog = newCatalog ; ctx . m_preparedCatalogInfo . m_preparedProcRunners = new ConcurrentLinkedQueue < > ( ) ; for ( long i = 0 ; i < siteCount ; i ++ ) { try { ImmutableMap < String , ProcedureRunner > userProcRunner = LoadedProcedureSet . loadUserProcedureRunners ( catalogProcedures , null , classesMap . build ( ) , null ) ; ctx . m_preparedCatalogInfo . m_preparedProcRunners . offer ( userProcRunner ) ; } catch ( Exception e ) { String msg = "error setting up user procedure runners using NT-procedure pattern: " + e . getMessage ( ) ; hostLog . info ( msg ) ; return msg ; } } return null ;
public class ZoomSlider { /** * Update the list of scales to include only the list of usable scales ( from all possible scales ) . */ public void updateUsableScales ( ) { } }
Bbox bgBounds = backgroundPart . getBounds ( ) ; /* * First move background a little bit to right based on difference in width with the sliderUnit . */ int internalHorMargin = ( int ) ( sliderUnit . getBounds ( ) . getWidth ( ) - backgroundPart . getBounds ( ) . getWidth ( ) ) / 2 ; bgBounds . setX ( internalHorMargin ) ; int backgroundPartHeight = ( int ) bgBounds . getHeight ( ) ; int sliderAreaHeight = 0 ; /* * Needed for aligning the sliderUnit ' s y with currentScale ' s y . */ int currentUnitY = sliderAreaHeight ; double currentScale = mapWidget . getMapModel ( ) . getMapView ( ) . getCurrentScale ( ) ; List < Bbox > partBounds = new ArrayList < Bbox > ( ) ; List < ScaleInfo > zoomLevels = mapWidget . getMapModel ( ) . getMapInfo ( ) . getScaleConfiguration ( ) . getZoomLevels ( ) ; int size = zoomLevels . size ( ) ; currentScaleList . clear ( ) ; boolean scaleFound = false ; for ( int i = size - 1 ; i >= 0 ; i -- ) { double scale = zoomLevels . get ( i ) . getPixelPerUnit ( ) ; if ( mapWidget . getMapModel ( ) . getMapView ( ) . isResolutionAvailable ( 1.0 / scale ) ) { Bbox bounds = ( Bbox ) bgBounds . clone ( ) ; bounds . setY ( sliderAreaHeight ) ; partBounds . add ( bounds ) ; currentScaleList . add ( scale ) ; if ( scale <= currentScale && ! scaleFound ) { scaleFound = true ; currentUnitY = sliderAreaHeight ; } sliderAreaHeight += backgroundPartHeight ; } } /* * Align zoom slider unit with current zoom */ Bbox bounds = sliderUnit . getBounds ( ) ; bounds . setY ( currentUnitY ) ; /* * Zoom slider area */ sliderArea = new SliderArea ( SLIDER_AREA , ( int ) sliderUnit . getBounds ( ) . getWidth ( ) , sliderAreaHeight , sliderUnit , backgroundPart , partBounds , mapWidget , new ZoomSliderController ( this ) ) ; sliderArea . setHorizontalMargin ( ( int ) - bgBounds . getX ( ) ) ; sliderArea . setVerticalMargin ( ( int ) backgroundPart . getBounds ( ) . getWidth ( ) ) ; /* * Zoom out button internal margin . */ zoomOut . getBackground ( ) . getBounds ( ) . setY ( sliderArea . getVerticalMargin ( ) + sliderAreaHeight ) ; zoomOut . getIcon ( ) . getBounds ( ) . setY ( sliderArea . getVerticalMargin ( ) + sliderAreaHeight ) ;
public class DeviceProxy { public void command_inout_asynch ( String cmdname , DeviceData argin , CallBack cb ) throws DevFailed { } }
deviceProxyDAO . command_inout_asynch ( this , cmdname , argin , cb ) ;
public class ResolvedDependenciesCache { /** * Convenience method around { @ link # resolve ( com . cloudbees . sdk . GAV ) } since most often * the result is used to create a classloader , which wants URL [ ] . */ public URL [ ] resolveToURLs ( GAV gav ) throws IOException , RepositoryException { } }
List < URL > jars = new ArrayList < URL > ( ) ; for ( File f : resolve ( gav ) ) { jars . add ( f . toURI ( ) . toURL ( ) ) ; } return jars . toArray ( new URL [ jars . size ( ) ] ) ;
public class FileUtil { /** * Recursively delete a directory . * @ param fs { @ link FileSystem } on which the path is present * @ param dir directory to recursively delete * @ throws IOException * @ deprecated Use { @ link FileSystem # delete ( Path , boolean ) } */ @ Deprecated public static void fullyDelete ( FileSystem fs , Path dir ) throws IOException { } }
fs . delete ( dir , true ) ;
public class FEELParser { /** * Either namePart is a string of digits , or it must be a valid name itself */ public static boolean isVariableNamePartValid ( String namePart , Scope scope ) { } }
if ( DIGITS_PATTERN . matcher ( namePart ) . matches ( ) ) { return true ; } if ( REUSABLE_KEYWORDS . contains ( namePart ) ) { return scope . followUp ( namePart , true ) ; } return isVariableNameValid ( namePart ) ;
public class Static { /** * Compares two objects . This method is careful about < code > null < / code > values . * @ param thisObject One object * @ param thatObject Other object * @ return < code > true < / code > if the one object equals the other object ; < code > false < / code > otherwise */ public static boolean equal ( Object thisObject , Object thatObject ) { } }
return thisObject == null ? thatObject == null : thisObject . equals ( thatObject ) ;
public class ReflectionUtils { /** * Get all non static , non transient , fields of the passed in class , including * private fields . Note , the special this $ field is also not returned . The result * is cached in a static ConcurrentHashMap to benefit execution performance . * @ param c Class instance * @ return Collection of only the fields in the passed in class * that would need further processing ( reference fields ) . This * makes field traversal on a class faster as it does not need to * continually process known fields like primitives . */ public static Collection < Field > getDeepDeclaredFields ( Class c ) { } }
if ( _reflectedFields . containsKey ( c ) ) { return _reflectedFields . get ( c ) ; } Collection < Field > fields = new ArrayList < > ( ) ; Class curr = c ; while ( curr != null ) { getDeclaredFields ( curr , fields ) ; curr = curr . getSuperclass ( ) ; } _reflectedFields . put ( c , fields ) ; return fields ;
public class CmsFlexController { /** * Adds another flex request / response pair to the stack . < p > * @ param req the request to add * @ param res the response to add */ public void push ( CmsFlexRequest req , CmsFlexResponse res ) { } }
m_flexRequestList . add ( req ) ; m_flexResponseList . add ( res ) ; m_flexContextInfoList . add ( new CmsFlexRequestContextInfo ( ) ) ; updateRequestContextInfo ( ) ;
public class EvaluateClustering { /** * Given an array summarizing selected measures , set the appropriate flag options */ protected void setMeasures ( boolean [ ] measures ) { } }
this . generalEvalOption . setValue ( measures [ 0 ] ) ; this . f1Option . setValue ( measures [ 1 ] ) ; this . entropyOption . setValue ( measures [ 2 ] ) ; this . cmmOption . setValue ( measures [ 3 ] ) ; this . ssqOption . setValue ( measures [ 4 ] ) ; this . separationOption . setValue ( measures [ 5 ] ) ; this . silhouetteOption . setValue ( measures [ 6 ] ) ; this . statisticalOption . setValue ( measures [ 7 ] ) ;
public class Slice { /** * Compare slice with other slice . * Slice ordering : * - Firstly ordered by start ( offset ) position . * - Secondly ordered by reverse length ( longest slice first ) . * Result is undefined of the two slices point to different byte buffers . * @ param o The other slice . * @ return Compared value . */ @ Override public int compareTo ( Slice o ) { } }
if ( o . off != off ) { return Integer . compare ( off , o . off ) ; } return Integer . compare ( o . len , len ) ;
public class PairtreeUtils { /** * Maps the supplied ID to a Pairtree path using the supplied base path . * @ param aID An ID to map to a Pairtree path * @ param aBasePath The base path to use in the mapping * @ param aEncapsulatedName The name of the encapsulating directory * @ return The Pairtree path for the supplied ID */ public static String mapToPtPath ( final String aBasePath , final String aID , final String aEncapsulatedName ) { } }
final String ptPath ; Objects . requireNonNull ( aID ) ; if ( aEncapsulatedName == null ) { ptPath = concat ( aBasePath , mapToPtPath ( aID ) ) ; } else { ptPath = concat ( aBasePath , mapToPtPath ( aID ) , encodeID ( aEncapsulatedName ) ) ; } return ptPath ;
public class Resources { /** * Consolidates the information contained in multiple responses for the same path . * Internally creates new resources . */ public void consolidateMultiplePaths ( ) { } }
Map < String , Set < ResourceMethod > > oldResources = resources ; resources = new HashMap < > ( ) ; oldResources . keySet ( ) . forEach ( s -> consolidateMultipleMethodsForSamePath ( s , oldResources . get ( s ) ) ) ;
public class CmsDialogUploadButtonHandler { /** * Opens the upload dialog for the given file references . < p > * @ param files the file references */ public void openDialogWithFiles ( List < CmsFileInfo > files ) { } }
if ( m_uploadDialog == null ) { try { m_uploadDialog = GWT . create ( CmsUploadDialogImpl . class ) ; I_CmsUploadContext context = m_contextFactory . get ( ) ; m_uploadDialog . setContext ( context ) ; updateDialog ( ) ; if ( m_button != null ) { // the current upload button is located outside the dialog , reinitialize it with a new button handler instance m_button . reinitButton ( new CmsDialogUploadButtonHandler ( m_contextFactory , m_targetFolder , m_isTargetRootPath ) ) ; } } catch ( Exception e ) { CmsErrorDialog . handleException ( new Exception ( "Deserialization of dialog data failed. This may be caused by expired java-script resources, please clear your browser cache and try again." , e ) ) ; return ; } } m_uploadDialog . addFiles ( files ) ; if ( m_button != null ) { m_button . createFileInput ( ) ; }
public class SibRaDestinationSession { /** * Closes this session . Delegates . * @ throws SIErrorException * if the delegation fails * @ throws SIResourceException * if the delegation fails * @ throws SIConnectionLostException * if the delegation fails */ public void close ( ) throws SIConnectionLostException , SIResourceException , SIErrorException , SIConnectionDroppedException { } }
final String methodName = "close" ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName ) ; } _delegateSession . close ( ) ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; }
public class Completable { /** * Returns a Completable which calls the given onEvent callback with the ( throwable ) for an onError * or ( null ) for an onComplete signal from this Completable before delivering said signal to the downstream . * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / Completable . doOnEvent . png " alt = " " > * < dl > * < dt > < b > Scheduler : < / b > < / dt > * < dd > { @ code doOnEvent } does not operate by default on a particular { @ link Scheduler } . < / dd > * < / dl > * @ param onEvent the event callback * @ return the new Completable instance * @ throws NullPointerException if onEvent is null */ @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Completable doOnEvent ( final Consumer < ? super Throwable > onEvent ) { } }
ObjectHelper . requireNonNull ( onEvent , "onEvent is null" ) ; return RxJavaPlugins . onAssembly ( new CompletableDoOnEvent ( this , onEvent ) ) ;
public class ServerView { /** * / * @ inheritDoc */ public void inputChanged ( final Viewer viewer , Object oldInput , Object newInput ) { } }
if ( oldInput == CONTENT_ROOT ) ServerRegistry . getInstance ( ) . removeListener ( this ) ; if ( newInput == CONTENT_ROOT ) ServerRegistry . getInstance ( ) . addListener ( this ) ;
public class DisposalMethod { /** * A disposer method is bound to a producer if the producer is assignable to the disposed parameter . * @ param enhancedDisposedParameter * @ return the set of required qualifiers for the given disposed parameter */ private Set < QualifierInstance > getRequiredQualifiers ( EnhancedAnnotatedParameter < ? , ? super X > enhancedDisposedParameter ) { } }
Set < Annotation > disposedParameterQualifiers = enhancedDisposedParameter . getMetaAnnotations ( Qualifier . class ) ; if ( disposedParameterQualifiers . isEmpty ( ) ) { disposedParameterQualifiers = Collections . < Annotation > singleton ( Default . Literal . INSTANCE ) ; } return beanManager . getServices ( ) . get ( MetaAnnotationStore . class ) . getQualifierInstances ( disposedParameterQualifiers ) ;
public class UpdateCsvClassifierRequest { /** * A list of strings representing column names . * @ param header * A list of strings representing column names . */ public void setHeader ( java . util . Collection < String > header ) { } }
if ( header == null ) { this . header = null ; return ; } this . header = new java . util . ArrayList < String > ( header ) ;
public class JCasUtil2 { /** * Same as { @ linkplain org . apache . uima . fit . util . JCasUtil # select ( org . apache . uima . jcas . cas . FSArray , Class ) } * but works across all views in jcas . * @ param jCas jcas * @ param type desired type * @ return collection of annotations */ public static < T extends TOP > Collection < T > selectFromAllViews ( JCas jCas , Class < T > type ) { } }
Collection < T > result = new ArrayList < T > ( ) ; try { Iterator < JCas > viewIterator = jCas . getViewIterator ( ) ; while ( viewIterator . hasNext ( ) ) { JCas next = viewIterator . next ( ) ; result . addAll ( JCasUtil . select ( next , type ) ) ; } return result ; } catch ( CASException ex ) { throw new RuntimeException ( ex ) ; }
public class KerberosAuthenticator { /** * Creates the Hadoop authentication HTTP cookie . * @ param resp the response object . * @ param token authentication token for the cookie . * @ param domain the cookie domain . * @ param path the cookie path . * @ param expires UNIX timestamp that indicates the expire date of the * cookie . It has no effect if its value & lt ; 0. * @ param isSecure is the cookie secure ? * @ param isCookiePersistent whether the cookie is persistent or not . * the following code copy / past from Hadoop 3.0.0 copied to avoid compilation issue due to new signature , * org . apache . hadoop . security . authentication . server . AuthenticationFilter # createAuthCookie * javax . servlet . http . HttpServletResponse , * java . lang . String , * java . lang . String , * java . lang . String , * long , boolean , boolean ) */ private static void tokenToAuthCookie ( HttpServletResponse resp , String token , String domain , String path , long expires , boolean isCookiePersistent , boolean isSecure ) { } }
resp . addHeader ( "Set-Cookie" , tokenToCookieString ( token , domain , path , expires , isCookiePersistent , isSecure ) ) ;
public class RaftContext { /** * Sets the state term . * @ param term The state term . */ public void setTerm ( long term ) { } }
if ( term > this . term ) { this . term = term ; this . leader = null ; this . lastVotedFor = null ; meta . storeTerm ( this . term ) ; meta . storeVote ( this . lastVotedFor ) ; log . debug ( "Set term {}" , term ) ; }
public class MultipartProcessor { /** * Adds a file field to the multipart message , but takes in an InputStream instead of * just a file to read bytes from . * @ param name Field name * @ param fileName Name of the " file " being uploaded . * @ param inputStream Stream of bytes to use in place of a file . * @ throws IOException Thrown when writing / reading from streams fails . */ public void addFileField ( String name , String fileName , InputStream inputStream ) throws IOException { } }
writer . append ( "--" ) . append ( boundary ) . append ( LINE_BREAK ) ; writer . append ( "Content-Disposition: form-data; name=\"" ) . append ( name ) . append ( "\"; filename=\"" ) . append ( fileName ) . append ( "\"" ) . append ( LINE_BREAK ) ; String probableContentType = URLConnection . guessContentTypeFromName ( fileName ) ; writer . append ( "Content-Type: " ) . append ( probableContentType ) . append ( LINE_BREAK ) ; writer . append ( "Content-Transfer-Encoding: binary" ) . append ( LINE_BREAK ) ; writer . append ( LINE_BREAK ) ; writer . flush ( ) ; streamToOutput ( inputStream ) ; writer . append ( LINE_BREAK ) ; writer . flush ( ) ;
public class SameDiff { /** * Adds outgoing arguments to the graph for the specified DifferentialFunction * Also checks for input arguments and updates the graph adding an appropriate edge when the full graph is declared . * @ param variables Variables - arguments for the specified differential function * @ param function Differential function */ public void addOutgoingFor ( SDVariable [ ] variables , DifferentialFunction function ) { } }
String [ ] varNames = new String [ variables . length ] ; for ( int i = 0 ; i < varNames . length ; i ++ ) { varNames [ i ] = variables [ i ] . getVarName ( ) ; } addOutgoingFor ( varNames , function ) ;
public class BatchGetItemOutcome { /** * Returns a map of table name to the list of retrieved items */ public Map < String , List < Item > > getTableItems ( ) { } }
Map < String , List < Map < String , AttributeValue > > > res = result . getResponses ( ) ; Map < String , List < Item > > map = new LinkedHashMap < String , List < Item > > ( res . size ( ) ) ; for ( Map . Entry < String , List < Map < String , AttributeValue > > > e : res . entrySet ( ) ) { String tableName = e . getKey ( ) ; List < Map < String , AttributeValue > > items = e . getValue ( ) ; map . put ( tableName , InternalUtils . toItemList ( items ) ) ; } return map ;
public class TcpResources { /** * Safely check if existing resource exist and proceed to update / cleanup if new * resources references are passed . * @ param ref the resources atomic reference * @ param loops the eventual new { @ link LoopResources } * @ param provider the eventual new { @ link ConnectionProvider } * @ param onNew a { @ link TcpResources } factory * @ param name a name for resources * @ param < T > the reified type of { @ link TcpResources } * @ return an existing or new { @ link TcpResources } */ protected static < T extends TcpResources > T getOrCreate ( AtomicReference < T > ref , @ Nullable LoopResources loops , @ Nullable ConnectionProvider provider , BiFunction < LoopResources , ConnectionProvider , T > onNew , String name ) { } }
T update ; for ( ; ; ) { T resources = ref . get ( ) ; if ( resources == null || loops != null || provider != null ) { update = create ( resources , loops , provider , name , onNew ) ; if ( ref . compareAndSet ( resources , update ) ) { if ( resources != null ) { if ( loops != null ) { if ( log . isWarnEnabled ( ) ) { log . warn ( "[{}] resources will use a new LoopResources: {}," + "the previous LoopResources will be disposed" , name , loops ) ; } resources . defaultLoops . dispose ( ) ; } if ( provider != null ) { if ( log . isWarnEnabled ( ) ) { log . warn ( "[{}] resources will use a new ConnectionProvider: {}," + "the previous ConnectionProvider will be disposed" , name , provider ) ; } resources . defaultProvider . dispose ( ) ; } } else { String loopType = loops == null ? "default" : "provided" ; if ( log . isDebugEnabled ( ) ) { log . debug ( "[{}] resources will use the {} LoopResources: {}" , name , loopType , update . defaultLoops ) ; } String poolType = provider == null ? "default" : "provided" ; if ( log . isDebugEnabled ( ) ) { log . debug ( "[{}] resources will use the {} ConnectionProvider: {}" , name , poolType , update . defaultProvider ) ; } } return update ; } else { update . _dispose ( ) ; } } else { return resources ; } }
public class AbstractPacketOutputStream { /** * Buffer growing use 4 size only to avoid creating / copying that are expensive operations . * possible size * < ol > * < li > SMALL _ BUFFER _ SIZE = 8k ( default ) < / li > * < li > MEDIUM _ BUFFER _ SIZE = 128k < / li > * < li > LARGE _ BUFFER _ SIZE = 1M < / li > * < li > getMaxPacketLength = 16M ( + 4 is using no compression ) < / li > * < / ol > * @ param len length to add */ private void growBuffer ( int len ) throws IOException { } }
int bufferLength = buf . length ; int newCapacity ; if ( bufferLength == SMALL_BUFFER_SIZE ) { if ( len + pos < MEDIUM_BUFFER_SIZE ) { newCapacity = MEDIUM_BUFFER_SIZE ; } else if ( len + pos < LARGE_BUFFER_SIZE ) { newCapacity = LARGE_BUFFER_SIZE ; } else { newCapacity = getMaxPacketLength ( ) ; } } else if ( bufferLength == MEDIUM_BUFFER_SIZE ) { if ( len + pos < LARGE_BUFFER_SIZE ) { newCapacity = LARGE_BUFFER_SIZE ; } else { newCapacity = getMaxPacketLength ( ) ; } } else if ( bufferContainDataAfterMark ) { // want to add some information to buffer without having the command Header // must grow buffer until having all the query newCapacity = Math . max ( len + pos , getMaxPacketLength ( ) ) ; } else { newCapacity = getMaxPacketLength ( ) ; } if ( mark != - 1 && len + pos > newCapacity ) { // buffer is > 16M with mark . // flush until mark , reset pos at beginning flushBufferStopAtMark ( ) ; if ( len + pos <= bufferLength ) { return ; } // need to keep all data , buffer can grow more than maxPacketLength // grow buffer if needed if ( len + pos > newCapacity ) { newCapacity = len + pos ; } } byte [ ] newBuf = new byte [ newCapacity ] ; System . arraycopy ( buf , 0 , newBuf , 0 , pos ) ; buf = newBuf ;
public class ChangeFocusOnChangeHandler { /** * Set this cloned listener to the same state at this listener . * @ param field The field this new listener will be added to . * @ param The new listener to sync to this . * @ param Has the init method been called ? * @ return True if I called init . */ public boolean syncClonedListener ( BaseField field , FieldListener listener , boolean bInitCalled ) { } }
if ( ! bInitCalled ) ( ( ChangeFocusOnChangeHandler ) listener ) . init ( null , m_screenField , m_fldTarget ) ; bInitCalled = super . syncClonedListener ( field , listener , true ) ; ( ( ChangeFocusOnChangeHandler ) listener ) . setChangeFocusIfNull ( m_bChangeIfNull ) ; return bInitCalled ;
public class ElasticSearchResponseStore { /** * { @ inheritDoc } */ @ Override public void addResponse ( Response response ) { } }
logger . warn ( "Security response " + response . getAction ( ) + " triggered for user: " + response . getUser ( ) . getUsername ( ) ) ; try { responseRepository . save ( response ) ; } catch ( JsonProcessingException e ) { throw new RuntimeException ( e ) ; } super . notifyListeners ( response ) ;
public class ExecutionContext { /** * Creates an OrFuture that is already completed with a { @ link Good } . * @ param good the success value * @ param < G > the success type * @ return an instance of OrFuture */ public < G , B > OrFuture < G , B > goodFuture ( G good ) { } }
return this . < G , B > promise ( ) . success ( good ) . future ( ) ;