signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class HelpFormatter { /** * Print the help for the specified Options to the specified writer , using the * specified width , left padding and description padding . * @ param aPW * The printWriter to write the help to * @ param nWidth * The number of characters to display per line * @ param aOptions * The command line Options * @ param nLeftPad * the number of characters of padding to be prefixed to each line * @ param nDescPad * the number of characters of padding to be prefixed to each * description line */ public void printOptions ( @ Nonnull final PrintWriter aPW , final int nWidth , @ Nonnull final Options aOptions , final int nLeftPad , final int nDescPad ) { } }
final StringBuilder aSB = new StringBuilder ( ) ; renderOptions ( aSB , nWidth , aOptions , nLeftPad , nDescPad ) ; aPW . println ( aSB . toString ( ) ) ;
public class UtilLepetitEPnP { /** * Computes the camera control points as weighted sum of null points . * @ param beta Beta values which describe the weights of null points * @ param nullPts Null points that the camera point is a weighted sum of * @ param cameraPts The output */ public static void computeCameraControl ( double beta [ ] , List < Point3D_F64 > nullPts [ ] , FastQueue < Point3D_F64 > cameraPts , int numControl ) { } }
cameraPts . reset ( ) ; for ( int i = 0 ; i < numControl ; i ++ ) { cameraPts . grow ( ) . set ( 0 , 0 , 0 ) ; } for ( int i = 0 ; i < numControl ; i ++ ) { double b = beta [ i ] ; // System . out . printf ( " % 7.3f " , b ) ; for ( int j = 0 ; j < numControl ; j ++ ) { Point3D_F64 s = cameraPts . get ( j ) ; Point3D_F64 p = nullPts [ i ] . get ( j ) ; s . x += b * p . x ; s . y += b * p . y ; s . z += b * p . z ; } }
public class DbPro { /** * Update Record . * < pre > * Example : * Db . use ( ) . update ( " user _ role " , " user _ id , role _ id " , record ) ; * < / pre > * @ param tableName the table name of the Record save to * @ param primaryKey the primary key of the table , composite primary key is separated by comma character : " , " * @ param record the Record object * @ param true if update succeed otherwise false */ public boolean update ( String tableName , String primaryKey , Record record ) { } }
Connection conn = null ; try { conn = config . getConnection ( ) ; return update ( config , conn , tableName , primaryKey , record ) ; } catch ( Exception e ) { throw new ActiveRecordException ( e ) ; } finally { config . close ( conn ) ; }
public class XMLUtils { /** * Add or set attribute . Convenience method for { @ link # addOrSetAttribute ( AttributesImpl , String , String , String , String , String ) } . * @ param atts attributes * @ param att attribute node */ public static void addOrSetAttribute ( final AttributesImpl atts , final Node att ) { } }
if ( att . getNodeType ( ) != Node . ATTRIBUTE_NODE ) { throw new IllegalArgumentException ( ) ; } final Attr a = ( Attr ) att ; String localName = a . getLocalName ( ) ; if ( localName == null ) { localName = a . getName ( ) ; final int i = localName . indexOf ( ':' ) ; if ( i != - 1 ) { localName = localName . substring ( i + 1 ) ; } } addOrSetAttribute ( atts , a . getNamespaceURI ( ) != null ? a . getNamespaceURI ( ) : NULL_NS_URI , localName , a . getName ( ) != null ? a . getName ( ) : localName , a . isId ( ) ? "ID" : "CDATA" , a . getValue ( ) ) ;
public class HCSpecialNodeHandler { /** * Extract all out - of - band child nodes for the passed element . Must be called * after the element is finished ! All out - of - band nodes are detached from * their parent so that the original node can be reused . Wrapped nodes where * the inner node is an out of band node are also considered and removed . * @ param aParentElement * The parent element to extract the nodes from . May not be * < code > null < / code > . * @ param aTargetList * The target list to be filled . May not be < code > null < / code > . */ public static void recursiveExtractAndRemoveOutOfBandNodes ( @ Nonnull final IHCNode aParentElement , @ Nonnull final List < IHCNode > aTargetList ) { } }
ValueEnforcer . notNull ( aParentElement , "ParentElement" ) ; ValueEnforcer . notNull ( aTargetList , "TargetList" ) ; // Using HCUtils . iterateTree would be too tedious here _recursiveExtractAndRemoveOutOfBandNodes ( aParentElement , aTargetList , 0 ) ;
public class MaterialAPI { /** * 上传永久视频素材文件 。 * @ param file 素材文件 * @ param title 素材标题 * @ param introduction 素材描述信息 * @ return 上传结果 */ public UploadMaterialResponse uploadMaterialFile ( File file , String title , String introduction ) { } }
UploadMaterialResponse response ; String url = "http://api.weixin.qq.com/cgi-bin/material/add_material?access_token=#" ; BaseResponse r ; if ( StrUtil . isBlank ( title ) ) { r = executePost ( url , null , file ) ; } else { final Map < String , String > param = new HashMap < String , String > ( ) ; param . put ( "title" , title ) ; param . put ( "introduction" , introduction ) ; r = executePost ( url , JSONUtil . toJson ( param ) , file ) ; } String resultJson = isSuccess ( r . getErrcode ( ) ) ? r . getErrmsg ( ) : r . toJsonString ( ) ; response = JSONUtil . toBean ( resultJson , UploadMaterialResponse . class ) ; return response ;
public class BaseTableLayout { /** * Removes all widgets and cells from the table ( same as { @ link # clear ( ) } ) * and additionally resets all table properties and cell , column , and row * defaults . */ public void reset ( ) { } }
clear ( ) ; padTop = null ; padLeft = null ; padBottom = null ; padRight = null ; align = CENTER ; if ( debug != Debug . none ) toolkit . clearDebugRectangles ( this ) ; debug = Debug . none ; cellDefaults . defaults ( ) ; for ( int i = 0 , n = columnDefaults . size ( ) ; i < n ; i ++ ) { Cell < C , T > columnCell = columnDefaults . get ( i ) ; if ( columnCell != null ) toolkit . freeCell ( columnCell ) ; } columnDefaults . clear ( ) ;
public class JSONHelpers { /** * Check if the value at { @ code key } is a { @ link Boolean } or can , * optionally , be coerced into a { @ code Boolean } . * @ param json { @ link JSONObject } to inspect * @ param key Item in object to check * @ param coerce If { @ code true } , check if the value can be coerced to * { @ code Boolean } * @ return { @ code True } if the item exists and is a { @ code Boolean } ; * { @ code false } otherwise */ public static boolean hasBoolean ( final JSONObject json , final String key , final boolean coerce ) { } }
if ( ! coerce ) { return hasBoolean ( json , key ) ; } // This could be trivially implemented as // ` return JSON . toBoolean ( json . opt ( key ) ) ! = null ` // but JSON is not public Object o = json . opt ( key ) ; if ( o == null || o == JSONObject . NULL ) { return false ; } if ( o instanceof Boolean ) { return true ; } if ( o instanceof Integer || o instanceof Long ) { final Long num = ( Long ) o ; return num == 0 || num == 1 ; } if ( o instanceof String ) { final String s = ( String ) o ; return s . compareToIgnoreCase ( "false" ) == 0 || s . compareToIgnoreCase ( "true" ) == 0 ; } return false ;
public class ChronoFormatter { /** * / * [ deutsch ] * < p > Entspricht { @ link # with ( Timezone ) with ( Timezone . of ( tzid ) ) } . < / p > * @ param tzid timezone id * @ return changed copy with the new or changed attribute while this instance remains unaffected * @ throws IllegalArgumentException if given timezone cannot be loaded */ @ Override public ChronoFormatter < T > withTimezone ( TZID tzid ) { } }
return this . with ( Timezone . of ( tzid ) ) ;
public class SimpleShadingAlgorithm { /** * should calculate values from - 128 to + 127 using whatever range required ( within reason ) * @ param in a grade , ascent per projected distance ( along coordinate axis ) */ protected double exaggerate ( double in ) { } }
double x = in * scale ; x = Math . max ( - 128d , Math . min ( 128d , x ) ) ; double ret = ( Math . sin ( 0.5d * Math . PI * Math . sin ( 0.5d * Math . PI * Math . sin ( 0.5d * Math . PI * x / 128d ) ) ) * 128 * ( 1d - linearity ) + x * linearity ) ; return ret ;
public class SftpClient { /** * Download the remote file to the local computer . If the paths provided are * not absolute the current working directory is used . * @ param remote * the regular expression path / name of the remote files * @ param local * the path / name to place the file on the local computer * @ param progress * @ return SftpFile [ ] * @ throws SftpStatusException * @ throws FileNotFoundException * @ throws SshException * @ throws TransferCancelledException */ public SftpFile [ ] getFiles ( String remote , String local , FileTransferProgress progress , boolean resume ) throws FileNotFoundException , SftpStatusException , SshException , TransferCancelledException { } }
return getFileMatches ( remote , local , progress , resume ) ;
public class Filelistener { /** * Shutdown listening to the defined folders and release all bonds to * Treetank . * @ throws TTException * @ throws IOException */ public void shutDownListener ( ) throws TTException , IOException { } }
for ( ExecutorService s : mExecutorMap . values ( ) ) { s . shutdown ( ) ; while ( ! s . isTerminated ( ) ) { // Do nothing . try { Thread . sleep ( 1000 ) ; } catch ( InterruptedException e ) { LOGGER . error ( e . getStackTrace ( ) . toString ( ) ) ; } } } Thread thr = mProcessingThread ; if ( thr != null ) { thr . interrupt ( ) ; } mWatcher . close ( ) ; releaseSessions ( ) ;
public class BaseBsoneerCodec { /** * To be used if and only if it belongs to { @ link java . util } package * @ param writer * @ param coll * @ param encoderContext */ @ SuppressWarnings ( { } }
"unchecked" , "rawtypes" } ) protected void encode ( BsonWriter writer , Collection < ? > coll , EncoderContext encoderContext ) { writer . writeStartArray ( ) ; Iterator < ? > iterator = coll . iterator ( ) ; while ( iterator . hasNext ( ) ) { Object next = iterator . next ( ) ; if ( next == null ) { writer . writeNull ( ) ; } else { Codec codec = registry . get ( next . getClass ( ) ) ; encoderContext . encodeWithChildContext ( codec , writer , next ) ; } } writer . writeEndArray ( ) ;
public class FreeMarkerTag { /** * Returns reference to a current session map . * @ return reference to a current session map . */ protected Map session ( ) { } }
Map session ; try { SimpleHash sessionHash = ( SimpleHash ) get ( "session" ) ; session = sessionHash . toMap ( ) ; } catch ( Exception e ) { logger ( ) . warn ( "failed to get a session map in context, returning session without data!!!" , e ) ; session = new HashMap ( ) ; } return Collections . unmodifiableMap ( session ) ;
public class LambdaFunctionSucceededEventDetailsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( LambdaFunctionSucceededEventDetails lambdaFunctionSucceededEventDetails , ProtocolMarshaller protocolMarshaller ) { } }
if ( lambdaFunctionSucceededEventDetails == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( lambdaFunctionSucceededEventDetails . getOutput ( ) , OUTPUT_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class FieldCriteria { /** * static FieldCriteria buildNotEqualToCriteria ( Object anAttribute , Object aValue , String anAlias ) */ static FieldCriteria buildNotEqualToCriteria ( Object anAttribute , Object aValue , UserAlias anAlias ) { } }
return new FieldCriteria ( anAttribute , aValue , NOT_EQUAL , anAlias ) ;
public class JDBCSQLXML { /** * Retrieves a new DOMResult for setting the XML value designated by this * SQLXML instance . * @ param resultClass The class of the result , or null . * @ throws java . sql . SQLException if there is an error processing the XML * value * @ return for setting the XML value designated by this SQLXML instance . */ @ SuppressWarnings ( "unchecked" ) protected < T extends Result > T createStAXResult ( Class < T > resultClass ) throws SQLException { } }
StAXResult result = null ; OutputStream outputStream = this . setBinaryStreamImpl ( ) ; Constructor ctor ; XMLOutputFactory factory ; XMLStreamWriter xmlStreamWriter ; try { factory = XMLOutputFactory . newInstance ( ) ; xmlStreamWriter = factory . createXMLStreamWriter ( outputStream ) ; if ( resultClass == null ) { result = new StAXResult ( xmlStreamWriter ) ; } else { ctor = resultClass . getConstructor ( XMLStreamWriter . class ) ; result = ( StAXResult ) ctor . newInstance ( xmlStreamWriter ) ; } } catch ( SecurityException ex ) { throw Exceptions . resultInstantiation ( ex ) ; } catch ( IllegalArgumentException ex ) { throw Exceptions . resultInstantiation ( ex ) ; } catch ( IllegalAccessException ex ) { throw Exceptions . resultInstantiation ( ex ) ; } catch ( InvocationTargetException ex ) { throw Exceptions . resultInstantiation ( ex . getTargetException ( ) ) ; } catch ( FactoryConfigurationError ex ) { throw Exceptions . resultInstantiation ( ex ) ; } catch ( InstantiationException ex ) { throw Exceptions . resultInstantiation ( ex ) ; } catch ( NoSuchMethodException ex ) { throw Exceptions . resultInstantiation ( ex ) ; } catch ( XMLStreamException ex ) { throw Exceptions . resultInstantiation ( ex ) ; } return ( T ) result ;
public class ShanksSimulation { /** * Unregisters an agent . * @ param agentID - The ID for the agent */ public void unregisterShanksAgent ( String agentID ) { } }
if ( this . agents . containsKey ( agentID ) ) { // this . agents . get ( agentID ) . stop ( ) ; if ( stoppables . containsKey ( agentID ) ) { this . agents . remove ( agentID ) ; this . stoppables . remove ( agentID ) . stop ( ) ; } else { // No stoppable , stops the agent logger . warning ( "No stoppable found while trying to stop the agent. Attempting direct stop..." ) ; this . agents . remove ( agentID ) . stop ( ) ; } }
public class SlidingTabLayout { /** * Set the text on the specified tab ' s TextView . * @ param index the index of the tab whose TextView you want to update * @ param text the text to display on the specified tab ' s TextView */ public void setTabText ( int index , String text ) { } }
TextView tv = ( TextView ) mTabTitleViews . get ( index ) ; if ( tv != null ) { tv . setText ( text ) ; }
public class RendererRecyclerViewAdapter { /** * Use { @ link # setStates ( HashMap ) } */ @ Deprecated public void setViewStates ( @ NonNull final SparseArray < ViewState > states ) { } }
mViewStates . clear ( ) ; for ( int i = 0 ; i < states . size ( ) ; i ++ ) { final int key = states . keyAt ( i ) ; final ViewState value = states . get ( key ) ; mViewStates . put ( key , value ) ; }
public class ForkedFrameworkFactory { /** * Forks a Java VM process running an OSGi framework and returns a { @ link RemoteFramework } * handle to it . * @ param vmArgs * VM arguments * @ param systemProperties * system properties for the forked Java VM * @ param frameworkProperties * framework properties for the remote framework * @ param beforeFrameworkClasspath * system classpath entries before the framework itself * @ param afterFrameworkClasspath * system classpath entries after the framework itself * @ return remote framework */ public RemoteFramework fork ( List < String > vmArgs , Map < String , String > systemProperties , Map < String , Object > frameworkProperties , List < String > beforeFrameworkClasspath , List < String > afterFrameworkClasspath ) { } }
// TODO make port range configurable FreePort freePort = new FreePort ( 21000 , 21099 ) ; port = freePort . getPort ( ) ; LOG . debug ( "using RMI registry at port {}" , port ) ; String rmiName = "ExamRemoteFramework-" + UUID . randomUUID ( ) . toString ( ) ; try { String address = InetAddress . getLoopbackAddress ( ) . getHostAddress ( ) ; System . setProperty ( "java.rmi.server.hostname" , address ) ; registry = LocateRegistry . createRegistry ( port ) ; Map < String , String > systemPropsNew = new HashMap < > ( systemProperties ) ; systemPropsNew . put ( "java.rmi.server.hostname" , address ) ; systemPropsNew . put ( RemoteFramework . RMI_PORT_KEY , Integer . toString ( port ) ) ; systemPropsNew . put ( RemoteFramework . RMI_NAME_KEY , rmiName ) ; String [ ] vmOptions = buildSystemProperties ( vmArgs , systemPropsNew ) ; String [ ] args = buildFrameworkProperties ( frameworkProperties ) ; javaRunner = new DefaultJavaRunner ( false ) ; javaRunner . exec ( vmOptions , buildClasspath ( beforeFrameworkClasspath , afterFrameworkClasspath ) , RemoteFrameworkImpl . class . getName ( ) , args , getJavaHome ( ) , null ) ; return findRemoteFramework ( address , port , rmiName ) ; } catch ( RemoteException | ExecutionException | URISyntaxException exc ) { throw new TestContainerException ( exc ) ; }
public class DistributedCacheStream { /** * The next ones are key tracking terminal operators */ @ Override public Iterator < R > iterator ( ) { } }
log . tracef ( "Distributed iterator invoked with rehash: %s" , rehashAware ) ; if ( ! rehashAware ) { // Non rehash doesn ' t care about lost segments or completed ones CloseableIterator < R > closeableIterator = nonRehashRemoteIterator ( dm . getReadConsistentHash ( ) , segmentsToFilter , null , IdentityPublisherDecorator . getInstance ( ) , intermediateOperations ) ; onClose ( closeableIterator :: close ) ; return closeableIterator ; } else { Iterable < IntermediateOperation > ops = iteratorOperation . prepareForIteration ( intermediateOperations , ( Function ) nonNullKeyFunction ( ) ) ; CloseableIterator < R > closeableIterator ; if ( segmentCompletionListener != null && iteratorOperation != IteratorOperation . FLAT_MAP ) { closeableIterator = new CompletionListenerRehashIterator < > ( ops , segmentCompletionListener ) ; } else { closeableIterator = new RehashIterator < > ( ops ) ; } onClose ( closeableIterator :: close ) ; // This cast messes up generic checking , but that is okay Function < R , R > function = iteratorOperation . getFunction ( ) ; if ( function != null ) { return new IteratorMapper < > ( closeableIterator , function ) ; } else { return closeableIterator ; } }
public class LibertySSLSocketFactory { /** * Returns a copy of the environment ' s default socket factory . */ public static javax . net . SocketFactory getDefault ( ) { } }
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getDefault" ) ; if ( thisClass == null ) { try { thisClass = new com . ibm . ws . ssl . protocol . LibertySSLSocketFactory ( ) ; } catch ( Exception e ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "SSLSocketFactory exception getting default socket factory." , new Object [ ] { e } ) ; FFDCFilter . processException ( e , "SSLSocketFactory" , "getDefault" , thisClass ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getDefault" ) ; return thisClass ;
public class GerritHandler { /** * Checks if the event should be ignored . * @ param event the event to check . * @ return true if it should be ignored , false if not . */ private boolean ignoreEvent ( CommentAdded event ) { } }
Account account = event . getAccount ( ) ; if ( account == null ) { return false ; } String accountEmail = account . getEmail ( ) ; if ( StringUtils . isEmpty ( accountEmail ) ) { return false ; } Provider provider = event . getProvider ( ) ; if ( provider != null ) { String ignoreEMail = ignoreEMails . get ( provider . getName ( ) ) ; if ( StringUtils . isNotEmpty ( ignoreEMail ) && accountEmail . endsWith ( ignoreEMail ) ) { return true ; } } return false ;
public class ApplicationGatewaysInner { /** * Stops the specified application gateway in a resource group . * @ param resourceGroupName The name of the resource group . * @ param applicationGatewayName The name of the application 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 */ public void beginStop ( String resourceGroupName , String applicationGatewayName ) { } }
beginStopWithServiceResponseAsync ( resourceGroupName , applicationGatewayName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class CommandLineIndicatorRunner { /** * Checks if normalization is set * @ param args * @ return */ private static boolean checkAboutNormalization ( String args [ ] ) { } }
boolean normalize = false ; if ( args . length == 4 ) { if ( args [ 3 ] . equals ( "TRUE" ) ) { normalize = true ; } else if ( args [ 3 ] . equals ( "FALSE" ) ) { normalize = false ; } else { throw new JMetalException ( "The value for normalizing must be TRUE or FALSE" ) ; } } return normalize ;
public class Parser { /** * 12.8 The break Statement */ private ParseTree parseBreakStatement ( ) { } }
SourcePosition start = getTreeStartLocation ( ) ; eat ( TokenType . BREAK ) ; IdentifierToken name = null ; if ( ! peekImplicitSemiColon ( ) ) { name = eatIdOpt ( ) ; } eatPossibleImplicitSemiColon ( ) ; return new BreakStatementTree ( getTreeLocation ( start ) , name ) ;
public class Int2IntHashMap { /** * Primitive specialised version of { @ link # computeIfAbsent ( Object , Function ) } * @ param key to search on . * @ param mappingFunction to provide a value if the get returns null . * @ return the value if found otherwise the missing value . */ public int computeIfAbsent ( final int key , final IntUnaryOperator mappingFunction ) { } }
int value = get ( key ) ; if ( value == missingValue ) { value = mappingFunction . applyAsInt ( key ) ; if ( value != missingValue ) { put ( key , value ) ; } } return value ;
public class RpcProtocol { /** * Converts an invocation into an rpc request . */ public RpcRequest getRequest ( final Invocation invocation ) { } }
if ( invocation == null ) throw new NullPointerException ( "invocation" ) ; MethodDescriptor < ? , ? > method = invocation . getMethod ( ) ; if ( ! method . isTerminal ( ) ) { throw new IllegalArgumentException ( "Last invocation method must be terminal" ) ; } RpcRequest request = new RpcRequest ( method . isPost ( ) ? RpcRequest . POST : RpcRequest . GET ) ; for ( Invocation invocation1 : invocation . toChain ( ) ) { writeInvocation ( request , invocation1 ) ; } return request ;
public class ProcessorTemplateHandler { /** * This will be called by any handleX ( ) methods ( only when throttling is enabled ) whenever they have to execute * work that might potentially get stopped and therefore be left in the pending queue . */ private void queueProcessable ( final IEngineProcessable processableModel ) { } }
ensurePendingCapacity ( ) ; final TemplateFlowController controller = this . flowController ; this . pendingProcessings [ this . pendingProcessingsSize ] = processableModel ; this . pendingProcessingsSize ++ ; if ( controller . stopProcessing ) { controller . processorTemplateHandlerPending = true ; return ; } final boolean processed = this . pendingProcessings [ this . pendingProcessingsSize - 1 ] . process ( ) ; if ( ! processed ) { controller . processorTemplateHandlerPending = true ; return ; } this . pendingProcessingsSize -- ; controller . processorTemplateHandlerPending = false ;
public class Image { /** * Sets the explicit masking . * @ param mask * the mask to be applied * @ throws DocumentException * on error */ public void setImageMask ( Image mask ) throws DocumentException { } }
if ( this . mask ) throw new DocumentException ( "An image mask cannot contain another image mask." ) ; if ( ! mask . mask ) throw new DocumentException ( "The image mask is not a mask. Did you do makeMask()?" ) ; imageMask = mask ; smask = ( mask . bpc > 1 && mask . bpc <= 8 ) ;
public class TreeNode { /** * Recursively sorts all children using the given comparator of TreeNode . */ public void sortChildrenByNode ( Comparator < TreeNode < T > > comparator ) { } }
Collections . sort ( children , comparator ) ; for ( TreeNode < T > child : children ) { child . sortChildrenByNode ( comparator ) ; }
public class State { /** * Signals to leave this state over specified transition * @ param name the name of the transition . */ public State signal ( String name ) throws UnknownTransitionException { } }
Transition t = find ( name ) ; if ( t != null ) { return t . process ( this ) ; } throw new UnknownTransitionException ( name ) ;
public class Introspector { /** * < p > getMethods . < / p > * @ param name a { @ link java . lang . String } object . * @ return a { @ link java . util . List } object . */ public List < Method > getMethods ( String name ) { } }
List < Method > methods = new ArrayList < Method > ( ) ; for ( Method method : target . getMethods ( ) ) { if ( compare ( method . getName ( ) , name ) ) methods . add ( method ) ; } return methods ;
public class Calendar { /** * Compute the Julian day number as specified by this calendar ' s fields . */ protected int computeJulianDay ( ) { } }
// We want to see if any of the date fields is newer than the // JULIAN _ DAY . If not , then we use JULIAN _ DAY . If so , then we do // the normal resolution . We only use JULIAN _ DAY if it has been // set by the user . This makes it possible for the caller to set // the calendar to a time and call clear ( MONTH ) to reset the MONTH // to January . This is legacy behavior . Without this , // clear ( MONTH ) has no effect , since the internally set JULIAN _ DAY // is used . if ( stamp [ JULIAN_DAY ] >= MINIMUM_USER_STAMP ) { int bestStamp = newestStamp ( ERA , DAY_OF_WEEK_IN_MONTH , UNSET ) ; bestStamp = newestStamp ( YEAR_WOY , EXTENDED_YEAR , bestStamp ) ; if ( bestStamp <= stamp [ JULIAN_DAY ] ) { return internalGet ( JULIAN_DAY ) ; } } int bestField = resolveFields ( getFieldResolutionTable ( ) ) ; if ( bestField < 0 ) { bestField = DAY_OF_MONTH ; } return handleComputeJulianDay ( bestField ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EEnum getIfcObjectiveEnum ( ) { } }
if ( ifcObjectiveEnumEEnum == null ) { ifcObjectiveEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1022 ) ; } return ifcObjectiveEnumEEnum ;
public class DataKey { /** * creates a data key with the given name , data type , the given permission * to allow null values and a default value . You can set the default value to * null to signal that there should be no default value . * @ param < T > the type * @ param name the name of the key that is stored in the xdata file * @ param dataClass the type ' s class * @ param allowNull allow null values ? * @ param defaultValue the default value to use when there is no value set for this key . * If set to null this will be the same as setting no default value . * @ return */ public static < T > DataKey < T > create ( String name , Class < T > dataClass , boolean allowNull , T defaultValue ) { } }
if ( dataClass . isPrimitive ( ) ) { throw new IllegalArgumentException ( "primitives are not supported - please use their corresponding wrappers" ) ; } if ( dataClass . isArray ( ) ) { throw new IllegalArgumentException ( "arrays are not supported - please use a list with their corresponding wrapper" ) ; } return new DataKey ( name , dataClass , allowNull , defaultValue ) ;
public class PropertyConverter { /** * Converts a string denoting an amount of bytes into an integer value . Strings are expected to follow this form where # equals a digit : # M The following are permitted for denoting binary size : K = kilobytes , M = megabytes , G = gigabytes * @ param memSize * memory * @ return size as an integer */ public static int convertStringToMemorySizeInt ( String memSize ) { } }
int result = 0 ; if ( memSize . endsWith ( "K" ) ) { result = Integer . valueOf ( StringUtils . remove ( memSize , 'K' ) ) * 1000 ; } else if ( memSize . endsWith ( "M" ) ) { result = Integer . valueOf ( StringUtils . remove ( memSize , 'M' ) ) * 1000 * 1000 ; } else if ( memSize . endsWith ( "G" ) ) { result = Integer . valueOf ( StringUtils . remove ( memSize , 'G' ) ) * 1000 * 1000 * 1000 ; } return result ;
public class LiteralImpl { /** * Determine Selector type code of a Literal value according to its class . Used by the * Literal constructor and by the Evaluator * @ param value the value whose type is requested * @ return one of the available literal type codes or Selector . INVALID */ static int objectType ( Object value ) { } }
if ( value instanceof String ) return STRING ; else if ( value instanceof Boolean ) // was BooleanValue return BOOLEAN ; else if ( value instanceof Number ) // was NumericValue // NumericValue types are ordered INT . . DOUBLE starting at zero . Selector types are // ordered INT . . DOUBLE starting at Selector . INT . return EvaluatorImpl . getType ( ( Number ) value ) + Selector . INT ; // was ( ( NumericValue ) value ) . type ( ) else if ( value instanceof Serializable ) return OBJECT ; else return INVALID ;
public class WorkItemConfigurationsInner { /** * Gets default work item configurations that exist for the application . * @ param resourceGroupName The name of the resource group . * @ param resourceName The name of the Application Insights component resource . * @ 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 < WorkItemConfigurationInner > getDefaultAsync ( String resourceGroupName , String resourceName , final ServiceCallback < WorkItemConfigurationInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( getDefaultWithServiceResponseAsync ( resourceGroupName , resourceName ) , serviceCallback ) ;
public class ServiceRegistryLoader { /** * / * ( non - Javadoc ) * @ see org . jboss . arquillian . core . spi . ServiceLoader # all ( java . lang . Class ) */ @ Override public < T > Collection < T > all ( Class < T > serviceClass ) { } }
List < T > serviceImpls = new ArrayList < T > ( ) ; Set < Class < ? extends T > > serviceImplClasses = registry . getServiceImpls ( serviceClass ) ; for ( Class < ? extends T > serviceImplClass : serviceImplClasses ) { T serviceImpl = createServiceInstance ( serviceImplClass ) ; serviceImpls . add ( serviceImpl ) ; } return serviceImpls ;
public class KeyValueHandler { /** * Helper method to decode all simple subdocument response messages . * @ param request the current request . * @ param msg the current response message . * @ param ctx the handler context . * @ param status the response status code . * @ return the decoded response or null if none did match . */ private static CouchbaseResponse handleSubdocumentResponseMessages ( BinaryRequest request , FullBinaryMemcacheResponse msg , ChannelHandlerContext ctx , ResponseStatus status , boolean seqOnMutation ) { } }
if ( ! ( request instanceof BinarySubdocRequest ) ) return null ; BinarySubdocRequest subdocRequest = ( BinarySubdocRequest ) request ; long cas = msg . getCAS ( ) ; short statusCode = msg . getStatus ( ) ; String bucket = request . bucket ( ) ; MutationToken mutationToken = null ; if ( msg . getExtrasLength ( ) > 0 ) { mutationToken = extractToken ( bucket , seqOnMutation , status . isSuccess ( ) , msg . getExtras ( ) , request . partition ( ) ) ; } ByteBuf fragment ; if ( msg . content ( ) != null && msg . content ( ) . readableBytes ( ) > 0 ) { fragment = msg . content ( ) ; } else if ( msg . content ( ) != null ) { msg . content ( ) . release ( ) ; fragment = Unpooled . EMPTY_BUFFER ; } else { fragment = Unpooled . EMPTY_BUFFER ; } return new SimpleSubdocResponse ( status , statusCode , bucket , fragment , subdocRequest , cas , mutationToken ) ;
public class StackTraceFilter { /** * Finds the source file of the target stack trace . * Returns the default value if source file cannot be found . */ public String findSourceFile ( StackTraceElement [ ] target , String defaultValue ) { } }
for ( StackTraceElement e : target ) { if ( CLEANER . isIn ( e ) ) { return e . getFileName ( ) ; } } return defaultValue ;
public class ApiOvhTelephony { /** * Create a new fax ScreenLists * REST : POST / telephony / { billingAccount } / fax / { serviceName } / screenLists * @ param whitelistedNumbers [ required ] List of numbers allowed to send a fax * @ param whitelistedTSI [ required ] List of logins ( TSI or ID ) allowed to send a fax * @ param blacklistedNumbers [ required ] List of numbers not allowed to send a fax * @ param blacklistedTSI [ required ] List of logins ( TSI or ID ) not allowed to send a fax * @ param filteringList [ required ] Which list is active ( blackist , whitelist or none ) * @ param billingAccount [ required ] The name of your billingAccount * @ param serviceName [ required ] */ public OvhFaxScreen billingAccount_fax_serviceName_screenLists_POST ( String billingAccount , String serviceName , String [ ] blacklistedNumbers , String [ ] blacklistedTSI , OvhFaxScreenListTypeEnum filteringList , String [ ] whitelistedNumbers , String [ ] whitelistedTSI ) throws IOException { } }
String qPath = "/telephony/{billingAccount}/fax/{serviceName}/screenLists" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "blacklistedNumbers" , blacklistedNumbers ) ; addBody ( o , "blacklistedTSI" , blacklistedTSI ) ; addBody ( o , "filteringList" , filteringList ) ; addBody ( o , "whitelistedNumbers" , whitelistedNumbers ) ; addBody ( o , "whitelistedTSI" , whitelistedTSI ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhFaxScreen . class ) ;
public class ChunkedIntArray { /** * This test supports DTM . getNextPreceding . */ int specialFind ( int startPos , int position ) { } }
// We have to look all the way up the ancestor chain // to make sure we don ' t have an ancestor . int ancestor = startPos ; while ( ancestor > 0 ) { // Get the node whose index = = ancestor ancestor *= slotsize ; int chunkpos = ancestor >> lowbits ; int slotpos = ancestor & lowmask ; int [ ] chunk = chunks . elementAt ( chunkpos ) ; // Get that node ' s parent ( Note that this assumes w [ 1] // is the parent node index . That ' s really a DTM feature // rather than a ChunkedIntArray feature . ) ancestor = chunk [ slotpos + 1 ] ; if ( ancestor == position ) break ; } if ( ancestor <= 0 ) { return position ; } return - 1 ;
public class DisplaySingle { /** * Returns a copy of the ArrayList that stores the sections . * The sections could be defined by a start value , a stop value * and a color . One has to create a Section object from the * class Section . * The sections are stored in a ArrayList so there could be * multiple . This might be a useful feature if you need to have * exactly defined areas that you could not visualize with the * track feature . * @ return a list of sections */ public List < Section > getSections ( ) { } }
List < Section > sectionsCopy = new ArrayList < Section > ( sections . size ( ) ) ; sectionsCopy . addAll ( sections ) ; return sectionsCopy ;
public class LevelSkin { /** * * * * * * Private Methods * * * * * */ private void setBar ( final double VALUE ) { } }
double factor = VALUE / gauge . getRange ( ) ; if ( gauge . isGradientBarEnabled ( ) && ! gauge . getGradientBarStops ( ) . isEmpty ( ) ) { Color color = gauge . getGradientLookup ( ) . getColorAt ( factor ) ; fluidBody . setFill ( color ) ; fluidTop . setFill ( color . darker ( ) ) ; } else if ( gauge . getSectionsVisible ( ) && ! sections . isEmpty ( ) ) { int listSize = sections . size ( ) ; for ( int i = 0 ; i < listSize ; i ++ ) { if ( sections . get ( i ) . contains ( VALUE ) ) { Color color = sections . get ( i ) . getColor ( ) ; fluidBody . setFill ( color ) ; fluidTop . setFill ( color . darker ( ) ) ; break ; } } } double centerY = height * 0.71111111 - factor * 0.58888889 * height ; fluidTop . setCenterY ( centerY ) ; fluidUpperRight . setControlY1 ( centerY + 0.58888889 * height ) ; fluidUpperRight . setControlY2 ( centerY ) ; fluidUpperRight . setY ( centerY ) ; fluidUpperCenter . setControlY1 ( centerY + 0.06666667 * height ) ; fluidUpperCenter . setControlY2 ( centerY + 0.12222222 * height ) ; fluidUpperCenter . setY ( centerY + 0.12222222 * height ) ; fluidUpperLeft . setControlY1 ( centerY + 0.12222222 * height ) ; fluidUpperLeft . setControlY2 ( centerY + 0.06666667 * height ) ; fluidUpperLeft . setY ( centerY ) ; valueText . setText ( String . format ( locale , formatString , factor * 100 ) ) ; valueText . relocate ( ( width - valueText . getLayoutBounds ( ) . getWidth ( ) ) * 0.5 , ( height - valueText . getLayoutBounds ( ) . getHeight ( ) ) * 0.5 ) ;
public class ListCreatedArtifactsResult { /** * List of created artifacts up to the maximum number of results specified in the request . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setCreatedArtifactList ( java . util . Collection ) } or { @ link # withCreatedArtifactList ( java . util . Collection ) } * if you want to override the existing values . * @ param createdArtifactList * List of created artifacts up to the maximum number of results specified in the request . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListCreatedArtifactsResult withCreatedArtifactList ( CreatedArtifact ... createdArtifactList ) { } }
if ( this . createdArtifactList == null ) { setCreatedArtifactList ( new java . util . ArrayList < CreatedArtifact > ( createdArtifactList . length ) ) ; } for ( CreatedArtifact ele : createdArtifactList ) { this . createdArtifactList . add ( ele ) ; } return this ;
public class Monetary { /** * Checks if a { @ link MonetaryRounding } is available given a roundingId . * @ param roundingName The rounding identifier . * @ param providers the providers and ordering to be used . By default providers and ordering as defined in * # getDefaultProviders is used . * @ return true , if a corresponding { @ link javax . money . MonetaryRounding } is available . * @ throws IllegalArgumentException if no such rounding is registered using a * { @ link javax . money . spi . RoundingProviderSpi } instance . */ public static boolean isRoundingAvailable ( String roundingName , String ... providers ) { } }
return Optional . ofNullable ( monetaryRoundingsSingletonSpi ( ) ) . orElseThrow ( ( ) -> new MonetaryException ( "No MonetaryRoundingsSpi loaded, query functionality is not available." ) ) . isRoundingAvailable ( roundingName , providers ) ;
public class BaseTokenSigningAndEncryptionService { /** * Gets json web signature . * @ param claims the claims * @ return the json web signature */ protected JsonWebSignature createJsonWebSignature ( final JwtClaims claims ) { } }
val jws = new JsonWebSignature ( ) ; val jsonClaims = claims . toJson ( ) ; jws . setPayload ( jsonClaims ) ; jws . setAlgorithmHeaderValue ( AlgorithmIdentifiers . NONE ) ; jws . setAlgorithmConstraints ( AlgorithmConstraints . NO_CONSTRAINTS ) ; return jws ;
public class PodLogs { /** * Important note . You must close this stream or else you can leak connections . */ public InputStream streamNamespacedPodLog ( String namespace , String name , String container ) throws ApiException , IOException { } }
return streamNamespacedPodLog ( namespace , name , container , null , null , false ) ;
public class DefaultGroovyMethods { /** * Iterates through this collection transforming each entry into a new value using Closure . IDENTITY * as a transformer , basically returning a list of items copied from the original collection . * < pre class = " groovyTestCase " > assert [ 1,2,3 ] = = [ 1,2,3 ] . collect ( ) < / pre > * @ param self a collection * @ return a List of the transformed values * @ see Closure # IDENTITY * @ since 1.8.5 * @ deprecated use the Iterable version instead */ @ Deprecated public static < T > List < T > collect ( Collection < T > self ) { } }
return collect ( ( Iterable < T > ) self ) ;
public class Response { /** * Wraps the text with the given JavaScript function name , and responds . * Content - Type header is set to " application / javascript " . */ public ChannelFuture respondJsonPText ( Object text , String function ) throws Exception { } }
return respondJs ( function + "(" + text + ");\r\n" ) ;
public class MemoryFileSystem { /** * { @ inheritDoc } */ public long getLastModified ( DirectoryEntry directoryEntry ) throws IOException { } }
long lastModified = 0 ; Entry [ ] entries = listEntries ( directoryEntry ) ; if ( entries != null ) { for ( Entry entry : entries ) { lastModified = Math . max ( lastModified , entry . getLastModified ( ) ) ; } } return lastModified ;
public class InternalSimpleAntlrLexer { /** * $ ANTLR start " RULE _ ID " */ public final void mRULE_ID ( ) throws RecognitionException { } }
try { int _type = RULE_ID ; int _channel = DEFAULT_TOKEN_CHANNEL ; // InternalSimpleAntlr . g : 1732:9 : ( ( ' $ ' ) ? ( ' a ' . . ' z ' | ' A ' . . ' Z ' | ' _ ' ) ( ' a ' . . ' z ' | ' A ' . . ' Z ' | ' _ ' | ' 0 ' . . ' 9 ' ) * ) // InternalSimpleAntlr . g : 1732:11 : ( ' $ ' ) ? ( ' a ' . . ' z ' | ' A ' . . ' Z ' | ' _ ' ) ( ' a ' . . ' z ' | ' A ' . . ' Z ' | ' _ ' | ' 0 ' . . ' 9 ' ) * { // InternalSimpleAntlr . g : 1732:11 : ( ' $ ' ) ? int alt2 = 2 ; int LA2_0 = input . LA ( 1 ) ; if ( ( LA2_0 == '$' ) ) { alt2 = 1 ; } switch ( alt2 ) { case 1 : // InternalSimpleAntlr . g : 1732:11 : ' $ ' { match ( '$' ) ; } break ; } if ( ( input . LA ( 1 ) >= 'A' && input . LA ( 1 ) <= 'Z' ) || input . LA ( 1 ) == '_' || ( input . LA ( 1 ) >= 'a' && input . LA ( 1 ) <= 'z' ) ) { input . consume ( ) ; } else { MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } // InternalSimpleAntlr . g : 1732:40 : ( ' a ' . . ' z ' | ' A ' . . ' Z ' | ' _ ' | ' 0 ' . . ' 9 ' ) * loop3 : do { int alt3 = 2 ; int LA3_0 = input . LA ( 1 ) ; if ( ( ( LA3_0 >= '0' && LA3_0 <= '9' ) || ( LA3_0 >= 'A' && LA3_0 <= 'Z' ) || LA3_0 == '_' || ( LA3_0 >= 'a' && LA3_0 <= 'z' ) ) ) { alt3 = 1 ; } switch ( alt3 ) { case 1 : // InternalSimpleAntlr . g : { if ( ( input . LA ( 1 ) >= '0' && input . LA ( 1 ) <= '9' ) || ( input . LA ( 1 ) >= 'A' && input . LA ( 1 ) <= 'Z' ) || input . LA ( 1 ) == '_' || ( input . LA ( 1 ) >= 'a' && input . LA ( 1 ) <= 'z' ) ) { input . consume ( ) ; } else { MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; default : break loop3 ; } } while ( true ) ; } state . type = _type ; state . channel = _channel ; } finally { }
public class BoxRequestUserUpdate { /** * Sets the new name for the user in the request . * @ param name new name for the user . * @ return request with the updated name . */ public R setName ( String name ) { } }
mBodyMap . put ( BoxUser . FIELD_NAME , name ) ; return ( R ) this ;
public class ReflectionUtils { /** * Determine whether the given method is originally declared by { @ link java . lang . Object } . */ public static boolean isObjectMethod ( Method method ) { } }
if ( method == null ) { return false ; } try { Object . class . getDeclaredMethod ( method . getName ( ) , method . getParameterTypes ( ) ) ; return true ; } catch ( Exception ex ) { return false ; }
public class MutableDataPoint { /** * Copy constructor * @ param value A datapoint value . */ public static MutableDataPoint fromPoint ( final DataPoint value ) { } }
if ( value . isInteger ( ) ) return ofLongValue ( value . timestamp ( ) , value . longValue ( ) ) ; else return ofDoubleValue ( value . timestamp ( ) , value . doubleValue ( ) ) ;
public class WSJdbcResultSet { /** * Returns the Statement that produced this ResultSet object . If the result set was generated some other * way , such as by a DatabaseMetaData method , this method returns null . * @ return * the Statment that produced the result set or null if the result set was produced some other way * @ throws SQLException if a database access error occurs . */ public Statement getStatement ( ) throws SQLException { } }
// The parent of a ResultSet may be a Statement or a MetaData . // For ResultSets created by MetaDatas , the getStatement method should return null , // unless the result set is closed . if ( state == State . CLOSED || parentWrapper == null ) throw createClosedException ( "ResultSet" ) ; if ( parentWrapper instanceof WSJdbcDatabaseMetaData ) return null ; return ( Statement ) parentWrapper ;
public class CloudwatchLogsExportConfiguration { /** * The list of log types to enable . * @ param enableLogTypes * The list of log types to enable . */ public void setEnableLogTypes ( java . util . Collection < String > enableLogTypes ) { } }
if ( enableLogTypes == null ) { this . enableLogTypes = null ; return ; } this . enableLogTypes = new com . amazonaws . internal . SdkInternalList < String > ( enableLogTypes ) ;
public class Vpc { /** * Information about the IPv4 CIDR blocks associated with the VPC . * @ return Information about the IPv4 CIDR blocks associated with the VPC . */ public java . util . List < VpcCidrBlockAssociation > getCidrBlockAssociationSet ( ) { } }
if ( cidrBlockAssociationSet == null ) { cidrBlockAssociationSet = new com . amazonaws . internal . SdkInternalList < VpcCidrBlockAssociation > ( ) ; } return cidrBlockAssociationSet ;
public class EsMarshalling { /** * Marshals the given bean into the given map . * @ param bean the bean * @ return the content builder * @ throws StorageException when a storage problem occurs while storing a bean */ public static XContentBuilder marshall ( ContractBean bean ) throws StorageException { } }
try ( XContentBuilder builder = XContentFactory . jsonBuilder ( ) ) { preMarshall ( bean ) ; builder . startObject ( ) . field ( "id" , bean . getId ( ) ) . field ( "clientOrganizationId" , bean . getClient ( ) . getClient ( ) . getOrganization ( ) . getId ( ) ) . field ( "clientOrganizationName" , bean . getClient ( ) . getClient ( ) . getOrganization ( ) . getName ( ) ) . field ( "clientId" , bean . getClient ( ) . getClient ( ) . getId ( ) ) . field ( "clientName" , bean . getClient ( ) . getClient ( ) . getName ( ) ) . field ( "clientVersion" , bean . getClient ( ) . getVersion ( ) ) . field ( "apiOrganizationId" , bean . getApi ( ) . getApi ( ) . getOrganization ( ) . getId ( ) ) . field ( "apiOrganizationName" , bean . getApi ( ) . getApi ( ) . getOrganization ( ) . getName ( ) ) . field ( "apiId" , bean . getApi ( ) . getApi ( ) . getId ( ) ) . field ( "apiName" , bean . getApi ( ) . getApi ( ) . getName ( ) ) . field ( "apiVersion" , bean . getApi ( ) . getVersion ( ) ) . field ( "apiDescription" , bean . getApi ( ) . getApi ( ) . getDescription ( ) ) . field ( "planName" , bean . getPlan ( ) . getPlan ( ) . getName ( ) ) . field ( "planId" , bean . getPlan ( ) . getPlan ( ) . getId ( ) ) . field ( "planVersion" , bean . getPlan ( ) . getVersion ( ) ) . field ( "createdOn" , bean . getCreatedOn ( ) . getTime ( ) ) . field ( "createdBy" , bean . getCreatedBy ( ) ) . endObject ( ) ; postMarshall ( bean ) ; return builder ; } catch ( IOException e ) { throw new StorageException ( e ) ; }
public class Util { /** * Returns an immutable list containing { @ code elements } . */ @ SafeVarargs public static < T > List < T > immutableList ( T ... elements ) { } }
return Collections . unmodifiableList ( asList ( elements . clone ( ) ) ) ;
public class Layer { /** * Returns the name of this layer . This defaults to the simple name of the class , but can be set * programmatically to aid in debugging . See { @ link # setName } . */ public String name ( ) { } }
// lazily init name if it ' s not been set if ( name == null ) { name = getClass ( ) . getName ( ) ; name = name . substring ( name . lastIndexOf ( "." ) + 1 ) . intern ( ) ; } return name ;
public class DoubleIntIndex { /** * Returns the index of the lowest element = = the given search target , * or - 1 * @ return index or - 1 if not found */ private int binaryFirstSearch ( ) { } }
int low = 0 ; int high = count ; int mid = 0 ; int compare = 0 ; int found = count ; while ( low < high ) { mid = ( low + high ) / 2 ; compare = compare ( mid ) ; if ( compare < 0 ) { high = mid ; } else if ( compare > 0 ) { low = mid + 1 ; } else { high = mid ; found = mid ; } } return found == count ? - 1 : found ;
public class Util { /** * Returns the number of retained valid items in the sketch given k and n . * @ param k the given configured k of the sketch * @ param n the current number of items seen by the sketch * @ return the number of retained items in the sketch given k and n . */ static int computeRetainedItems ( final int k , final long n ) { } }
final int bbCnt = computeBaseBufferItems ( k , n ) ; final long bitPattern = computeBitPattern ( k , n ) ; final int validLevels = computeValidLevels ( bitPattern ) ; return bbCnt + ( validLevels * k ) ;
public class CmsCopyMoveDialog { /** * Preselects the target folder . < p > * @ param resource the target resource */ public void setTargetForlder ( CmsResource resource ) { } }
if ( resource . isFolder ( ) ) { if ( m_context . getResources ( ) . size ( ) == 1 ) { try { if ( m_dialogMode . equals ( DialogMode . copy ) | ( m_dialogMode . equals ( DialogMode . copy_and_move ) && CmsResource . getParentFolder ( m_context . getResources ( ) . get ( 0 ) . getRootPath ( ) ) . equals ( resource . getRootPath ( ) ) ) ) { m_targetPath . setValue ( getTargetName ( m_context . getResources ( ) . get ( 0 ) , resource ) ) ; } else { m_targetPath . setValue ( getCms ( ) . getSitePath ( resource ) + getTargetName ( m_context . getResources ( ) . get ( 0 ) , resource ) ) ; } } catch ( CmsException e ) { m_targetPath . setValue ( getCms ( ) . getSitePath ( resource ) ) ; } } else { m_targetPath . setValue ( getCms ( ) . getSitePath ( resource ) ) ; } updateDefaultActions ( resource . getRootPath ( ) ) ; } else { throw new CmsIllegalArgumentException ( org . opencms . workplace . commons . Messages . get ( ) . container ( org . opencms . workplace . commons . Messages . ERR_COPY_MULTI_TARGET_NOFOLDER_1 , A_CmsUI . getCmsObject ( ) . getSitePath ( resource ) ) ) ; }
public class CommerceDiscountPersistenceImpl { /** * Returns the commerce discounts before and after the current commerce discount in the ordered set where uuid = & # 63 ; . * @ param commerceDiscountId the primary key of the current commerce discount * @ param uuid the uuid * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the previous , current , and next commerce discount * @ throws NoSuchDiscountException if a commerce discount with the primary key could not be found */ @ Override public CommerceDiscount [ ] findByUuid_PrevAndNext ( long commerceDiscountId , String uuid , OrderByComparator < CommerceDiscount > orderByComparator ) throws NoSuchDiscountException { } }
CommerceDiscount commerceDiscount = findByPrimaryKey ( commerceDiscountId ) ; Session session = null ; try { session = openSession ( ) ; CommerceDiscount [ ] array = new CommerceDiscountImpl [ 3 ] ; array [ 0 ] = getByUuid_PrevAndNext ( session , commerceDiscount , uuid , orderByComparator , true ) ; array [ 1 ] = commerceDiscount ; array [ 2 ] = getByUuid_PrevAndNext ( session , commerceDiscount , uuid , orderByComparator , false ) ; return array ; } catch ( Exception e ) { throw processException ( e ) ; } finally { closeSession ( session ) ; }
public class Check { /** * Ensures that a passed iterable as a parameter of the calling method is not empty . * The following example describes how to use it . * < pre > * & # 064 ; ArgumentsChecked * public setIterable ( Iterable & lt ; String & gt ; iterable ) { * this . iterable = Check . notEmpty ( iterable , & quot ; iterable & quot ; ) ; * < / pre > * @ param iterable * an iterable which should not be empty * @ param name * name of object reference ( in source code ) * @ return the passed reference that is not empty * @ throws IllegalNullArgumentException * if the given argument { @ code iterable } is { @ code null } * @ throws IllegalEmptyArgumentException * if the given argument { @ code iterable } is empty */ @ ArgumentsChecked @ Throws ( { } }
IllegalNullArgumentException . class , IllegalEmptyArgumentException . class } ) public static < T extends Iterable < ? > > T notEmpty ( @ Nonnull final T iterable , @ Nullable final String name ) { notNull ( iterable , name ) ; notEmpty ( iterable , ! iterable . iterator ( ) . hasNext ( ) , name ) ; return iterable ;
public class Sets { /** * This is a replacement for Guava ' s Sets # union ( Set , Set ) . * @ param set1 * @ param set2 * @ return an unmodifiable view of the union of two sets */ public static < E > Set < E > union ( final Set < ? extends E > set1 , final Set < ? extends E > set2 ) { } }
checkArgumentNotNull ( set1 , "set1" ) ; checkArgumentNotNull ( set2 , "set2" ) ; // Set 2 minus set 1 final Set < E > difference = new HashSet < > ( set2 ) ; difference . removeAll ( set1 ) ; // Following stream does not compile on some JDKs // See also https : / / bugs . openjdk . java . net / browse / JDK - 8051443 // set2 . stream ( ) . filter ( ( e ) - > ! set1 . contains ( e ) ) . collect ( Collectors . toSet ( ) ) ; return new AbstractSet < E > ( ) { @ Override public Iterator < E > iterator ( ) { final Iterator < E > iterator = Iterators . concat ( ImmutableList . of ( set1 . iterator ( ) , difference . iterator ( ) ) . iterator ( ) ) ; // Remove operation is not supported by default return new Iterator < E > ( ) { @ Override public boolean hasNext ( ) { return iterator . hasNext ( ) ; } @ Override public E next ( ) { return iterator . next ( ) ; } } ; } @ Override public int size ( ) { return set1 . size ( ) + difference . size ( ) ; } @ Override public boolean isEmpty ( ) { return set1 . isEmpty ( ) && difference . isEmpty ( ) ; } @ Override public boolean contains ( Object o ) { return set1 . contains ( o ) || difference . contains ( o ) ; } } ;
public class BaseClassFinderService { /** * Find this class ' s bundle in the repository * @ param className * @ param versionRange version * @ return */ private Class < ? > getClassFromBundle ( Object resource , String className , String versionRange ) { } }
Class < ? > c = null ; if ( resource == null ) { Object classAccess = this . getClassBundleService ( null , className , versionRange , null , 0 ) ; if ( classAccess != null ) { try { c = Class . forName ( className ) ; } catch ( ClassNotFoundException e ) { e . printStackTrace ( ) ; } } } else { Bundle bundle = this . findBundle ( resource , bundleContext , ClassFinderActivator . getPackageName ( className , false ) , versionRange ) ; try { c = bundle . loadClass ( className ) ; } catch ( ClassNotFoundException e ) { c = null ; } } return c ;
public class FileItemWrap { /** * Returns the content type passed by the browser or < code > null < / code > if not defined . * @ return The content type passed by the browser or < code > null < / code > if not defined . */ @ Override public String getMimeType ( ) { } }
String contentType = backing . getContentType ( ) ; // IE6 ( and apparently IE7 ) are broken and send the MIME type " image / pjpeg " // regardless of whether the image is a progressive jpeg or not . Sending the // incorrect MIME type back can cause display issues . It is always safe to // change it to just be " image / jpeg " . if ( "image/pjpeg" . equals ( contentType ) ) { contentType = "image/jpeg" ; } return contentType ;
public class SerDeUtilsWrapper { /** * Get serialized json using an orc object and corresponding object * inspector Adapted from * { @ link org . apache . hadoop . hive . serde2 . SerDeUtils # getJSONString ( Object , ObjectInspector ) } * @ param obj * @ param objIns * @ return */ public static String getJSON ( Object obj , ObjectInspector objIns ) { } }
StringBuilder sb = new StringBuilder ( ) ; buildJSONString ( sb , obj , objIns ) ; return sb . toString ( ) ;
public class ChunkMapReader { /** * Get changed files table . * @ return map of changed files , absolute temporary files */ public Map < URI , URI > getChangeTable ( ) { } }
for ( final Map . Entry < URI , URI > e : changeTable . entrySet ( ) ) { assert e . getKey ( ) . isAbsolute ( ) ; assert e . getValue ( ) . isAbsolute ( ) ; } return Collections . unmodifiableMap ( changeTable ) ;
public class DeviceImpl { /** * Add an attribute to the device * @ param attribute * @ throws DevFailed */ public synchronized void addAttribute ( final AttributeImpl attribute ) throws DevFailed { } }
// add attribute only if it doesn ' t exists AttributeImpl result = null ; for ( final AttributeImpl attr : attributeList ) { if ( attr . getName ( ) . equalsIgnoreCase ( attribute . getName ( ) ) ) { result = attribute ; break ; } } if ( result == null ) { attributeList . add ( attribute ) ; // set default polling configuration if ( attrPollRingDepth . containsKey ( attribute . getName ( ) . toLowerCase ( Locale . ENGLISH ) ) ) { attribute . setPollRingDepth ( attrPollRingDepth . get ( attribute . getName ( ) . toLowerCase ( Locale . ENGLISH ) ) ) ; } else { attribute . setPollRingDepth ( pollRingDepth ) ; } }
public class CommonsInterface { /** * Retrieves a list of the current Commons institutions . * This method does not require authentication . * @ return List of Institution * @ throws FlickrException */ public ArrayList < Institution > getInstitutions ( ) throws FlickrException { } }
ArrayList < Institution > institutions = new ArrayList < Institution > ( ) ; Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_INSTITUTIONS ) ; Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } Element mElement = response . getPayload ( ) ; NodeList mNodes = mElement . getElementsByTagName ( "institution" ) ; for ( int i = 0 ; i < mNodes . getLength ( ) ; i ++ ) { Element element = ( Element ) mNodes . item ( i ) ; institutions . add ( parseInstitution ( element ) ) ; } return institutions ;
public class CountingMemoryCache { /** * Removes all the items from the cache . */ public void clear ( ) { } }
ArrayList < Entry < K , V > > oldExclusives ; ArrayList < Entry < K , V > > oldEntries ; synchronized ( this ) { oldExclusives = mExclusiveEntries . clear ( ) ; oldEntries = mCachedEntries . clear ( ) ; makeOrphans ( oldEntries ) ; } maybeClose ( oldEntries ) ; maybeNotifyExclusiveEntryRemoval ( oldExclusives ) ; maybeUpdateCacheParams ( ) ;
public class NodeUtil { /** * Converts an operator ' s token value ( see { @ link Token } ) to a string * representation . * @ param operator the operator ' s token value to convert * @ return the string representation or { @ code null } if the token value is * not an operator */ public static String opToStr ( Token operator ) { } }
switch ( operator ) { case BITOR : return "|" ; case OR : return "||" ; case BITXOR : return "^" ; case AND : return "&&" ; case BITAND : return "&" ; case SHEQ : return "===" ; case EQ : return "==" ; case NOT : return "!" ; case NE : return "!=" ; case SHNE : return "!==" ; case LSH : return "<<" ; case IN : return "in" ; case LE : return "<=" ; case LT : return "<" ; case URSH : return ">>>" ; case RSH : return ">>" ; case GE : return ">=" ; case GT : return ">" ; case MUL : return "*" ; case DIV : return "/" ; case MOD : return "%" ; case EXPONENT : return "**" ; case BITNOT : return "~" ; case ADD : case POS : return "+" ; case SUB : case NEG : return "-" ; case ASSIGN : return "=" ; case ASSIGN_BITOR : return "|=" ; case ASSIGN_BITXOR : return "^=" ; case ASSIGN_BITAND : return "&=" ; case ASSIGN_LSH : return "<<=" ; case ASSIGN_RSH : return ">>=" ; case ASSIGN_URSH : return ">>>=" ; case ASSIGN_ADD : return "+=" ; case ASSIGN_SUB : return "-=" ; case ASSIGN_MUL : return "*=" ; case ASSIGN_EXPONENT : return "**=" ; case ASSIGN_DIV : return "/=" ; case ASSIGN_MOD : return "%=" ; case VOID : return "void" ; case TYPEOF : return "typeof" ; case INSTANCEOF : return "instanceof" ; default : return null ; }
public class Pagination { /** * Determines the offset and limit based on pagination strategy . * @ param strategy the pagination strategy to use * @ param o1 the offset or page number to use * @ param o2 the number of results to limit a result - set to ( aka , the size of the page ) */ private void calculateStrategy ( final Strategy strategy , final int o1 , final int o2 ) { } }
if ( Strategy . OFFSET == strategy ) { this . offset = o1 ; this . limit = o2 ; } else if ( Strategy . PAGES == strategy ) { this . offset = ( o1 * o2 ) - o2 ; this . limit = o2 ; }
public class Step { /** * Update a html input text with " " . * @ param pageElement * Is target element * @ param args * list of arguments to format the found selector with * @ throws TechnicalException * is thrown if you have a technical error ( format , configuration , datas , . . . ) in NoraUi . * Exception with { @ value com . github . noraui . utils . Messages # FAIL _ MESSAGE _ ERROR _ CLEAR _ ON _ INPUT } message ( with screenshot , no exception ) * @ throws FailureException * if the scenario encounters a functional error */ protected void clearText ( PageElement pageElement , Object ... args ) throws TechnicalException , FailureException { } }
clearText ( pageElement , null , args ) ;
public class PluginHelper { /** * Decodes stream data based on content encoding * @ param contentEncoding * @ param bytes * @ return String representing the stream data */ public static String getByteArrayDataAsString ( String contentEncoding , byte [ ] bytes ) { } }
ByteArrayOutputStream byteout = null ; if ( contentEncoding != null && contentEncoding . equals ( "gzip" ) ) { // GZIP ByteArrayInputStream bytein = null ; GZIPInputStream zis = null ; try { bytein = new ByteArrayInputStream ( bytes ) ; zis = new GZIPInputStream ( bytein ) ; byteout = new ByteArrayOutputStream ( ) ; int res = 0 ; byte buf [ ] = new byte [ 1024 ] ; while ( res >= 0 ) { res = zis . read ( buf , 0 , buf . length ) ; if ( res > 0 ) { byteout . write ( buf , 0 , res ) ; } } zis . close ( ) ; bytein . close ( ) ; byteout . close ( ) ; return byteout . toString ( ) ; } catch ( Exception e ) { // No action to take } } else if ( contentEncoding != null && contentEncoding . equals ( "deflate" ) ) { try { // DEFLATE byte [ ] buffer = new byte [ 1024 ] ; Inflater decompresser = new Inflater ( ) ; byteout = new ByteArrayOutputStream ( ) ; decompresser . setInput ( bytes ) ; while ( ! decompresser . finished ( ) ) { int count = decompresser . inflate ( buffer ) ; byteout . write ( buffer , 0 , count ) ; } byteout . close ( ) ; decompresser . end ( ) ; return byteout . toString ( ) ; } catch ( Exception e ) { // No action to take } } return new String ( bytes ) ;
public class hqlParser { /** * hql . g : 279:1 : fromJoin : ( ( ( ( LEFT | RIGHT ) ( OUTER ) ? ) | FULL | INNER ) ? JOIN ^ ( FETCH ) ? path ( asAlias ) ? ( propertyFetch ) ? ( withClause ) ? | ( ( ( LEFT | RIGHT ) ( OUTER ) ? ) | FULL | INNER ) ? JOIN ^ ( FETCH ) ? ELEMENTS ! OPEN ! path CLOSE ! ( asAlias ) ? ( propertyFetch ) ? ( withClause ) ? ) ; */ public final hqlParser . fromJoin_return fromJoin ( ) throws RecognitionException { } }
hqlParser . fromJoin_return retval = new hqlParser . fromJoin_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; Token set63 = null ; Token OUTER64 = null ; Token FULL65 = null ; Token INNER66 = null ; Token JOIN67 = null ; Token FETCH68 = null ; Token set73 = null ; Token OUTER74 = null ; Token FULL75 = null ; Token INNER76 = null ; Token JOIN77 = null ; Token FETCH78 = null ; Token ELEMENTS79 = null ; Token OPEN80 = null ; Token CLOSE82 = null ; ParserRuleReturnScope path69 = null ; ParserRuleReturnScope asAlias70 = null ; ParserRuleReturnScope propertyFetch71 = null ; ParserRuleReturnScope withClause72 = null ; ParserRuleReturnScope path81 = null ; ParserRuleReturnScope asAlias83 = null ; ParserRuleReturnScope propertyFetch84 = null ; ParserRuleReturnScope withClause85 = null ; CommonTree set63_tree = null ; CommonTree OUTER64_tree = null ; CommonTree FULL65_tree = null ; CommonTree INNER66_tree = null ; CommonTree JOIN67_tree = null ; CommonTree FETCH68_tree = null ; CommonTree set73_tree = null ; CommonTree OUTER74_tree = null ; CommonTree FULL75_tree = null ; CommonTree INNER76_tree = null ; CommonTree JOIN77_tree = null ; CommonTree FETCH78_tree = null ; CommonTree ELEMENTS79_tree = null ; CommonTree OPEN80_tree = null ; CommonTree CLOSE82_tree = null ; try { // hql . g : 280:2 : ( ( ( ( LEFT | RIGHT ) ( OUTER ) ? ) | FULL | INNER ) ? JOIN ^ ( FETCH ) ? path ( asAlias ) ? ( propertyFetch ) ? ( withClause ) ? | ( ( ( LEFT | RIGHT ) ( OUTER ) ? ) | FULL | INNER ) ? JOIN ^ ( FETCH ) ? ELEMENTS ! OPEN ! path CLOSE ! ( asAlias ) ? ( propertyFetch ) ? ( withClause ) ? ) int alt32 = 2 ; switch ( input . LA ( 1 ) ) { case LEFT : case RIGHT : { int LA32_1 = input . LA ( 2 ) ; if ( ( LA32_1 == OUTER ) ) { int LA32_5 = input . LA ( 3 ) ; if ( ( LA32_5 == JOIN ) ) { switch ( input . LA ( 4 ) ) { case FETCH : { int LA32_6 = input . LA ( 5 ) ; if ( ( LA32_6 == IDENT ) ) { alt32 = 1 ; } else if ( ( LA32_6 == ELEMENTS ) ) { alt32 = 2 ; } else { int nvaeMark = input . mark ( ) ; try { for ( int nvaeConsume = 0 ; nvaeConsume < 5 - 1 ; nvaeConsume ++ ) { input . consume ( ) ; } NoViableAltException nvae = new NoViableAltException ( "" , 32 , 6 , input ) ; throw nvae ; } finally { input . rewind ( nvaeMark ) ; } } } break ; case IDENT : { alt32 = 1 ; } break ; case ELEMENTS : { alt32 = 2 ; } break ; default : int nvaeMark = input . mark ( ) ; try { for ( int nvaeConsume = 0 ; nvaeConsume < 4 - 1 ; nvaeConsume ++ ) { input . consume ( ) ; } NoViableAltException nvae = new NoViableAltException ( "" , 32 , 4 , input ) ; throw nvae ; } finally { input . rewind ( nvaeMark ) ; } } } else { int nvaeMark = input . mark ( ) ; try { for ( int nvaeConsume = 0 ; nvaeConsume < 3 - 1 ; nvaeConsume ++ ) { input . consume ( ) ; } NoViableAltException nvae = new NoViableAltException ( "" , 32 , 5 , input ) ; throw nvae ; } finally { input . rewind ( nvaeMark ) ; } } } else if ( ( LA32_1 == JOIN ) ) { switch ( input . LA ( 3 ) ) { case FETCH : { int LA32_6 = input . LA ( 4 ) ; if ( ( LA32_6 == IDENT ) ) { alt32 = 1 ; } else if ( ( LA32_6 == ELEMENTS ) ) { alt32 = 2 ; } else { int nvaeMark = input . mark ( ) ; try { for ( int nvaeConsume = 0 ; nvaeConsume < 4 - 1 ; nvaeConsume ++ ) { input . consume ( ) ; } NoViableAltException nvae = new NoViableAltException ( "" , 32 , 6 , input ) ; throw nvae ; } finally { input . rewind ( nvaeMark ) ; } } } break ; case IDENT : { alt32 = 1 ; } break ; case ELEMENTS : { alt32 = 2 ; } break ; default : int nvaeMark = input . mark ( ) ; try { for ( int nvaeConsume = 0 ; nvaeConsume < 3 - 1 ; nvaeConsume ++ ) { input . consume ( ) ; } NoViableAltException nvae = new NoViableAltException ( "" , 32 , 4 , input ) ; throw nvae ; } finally { input . rewind ( nvaeMark ) ; } } } else { int nvaeMark = input . mark ( ) ; try { input . consume ( ) ; NoViableAltException nvae = new NoViableAltException ( "" , 32 , 1 , input ) ; throw nvae ; } finally { input . rewind ( nvaeMark ) ; } } } break ; case FULL : { int LA32_2 = input . LA ( 2 ) ; if ( ( LA32_2 == JOIN ) ) { switch ( input . LA ( 3 ) ) { case FETCH : { int LA32_6 = input . LA ( 4 ) ; if ( ( LA32_6 == IDENT ) ) { alt32 = 1 ; } else if ( ( LA32_6 == ELEMENTS ) ) { alt32 = 2 ; } else { int nvaeMark = input . mark ( ) ; try { for ( int nvaeConsume = 0 ; nvaeConsume < 4 - 1 ; nvaeConsume ++ ) { input . consume ( ) ; } NoViableAltException nvae = new NoViableAltException ( "" , 32 , 6 , input ) ; throw nvae ; } finally { input . rewind ( nvaeMark ) ; } } } break ; case IDENT : { alt32 = 1 ; } break ; case ELEMENTS : { alt32 = 2 ; } break ; default : int nvaeMark = input . mark ( ) ; try { for ( int nvaeConsume = 0 ; nvaeConsume < 3 - 1 ; nvaeConsume ++ ) { input . consume ( ) ; } NoViableAltException nvae = new NoViableAltException ( "" , 32 , 4 , input ) ; throw nvae ; } finally { input . rewind ( nvaeMark ) ; } } } else { int nvaeMark = input . mark ( ) ; try { input . consume ( ) ; NoViableAltException nvae = new NoViableAltException ( "" , 32 , 2 , input ) ; throw nvae ; } finally { input . rewind ( nvaeMark ) ; } } } break ; case INNER : { int LA32_3 = input . LA ( 2 ) ; if ( ( LA32_3 == JOIN ) ) { switch ( input . LA ( 3 ) ) { case FETCH : { int LA32_6 = input . LA ( 4 ) ; if ( ( LA32_6 == IDENT ) ) { alt32 = 1 ; } else if ( ( LA32_6 == ELEMENTS ) ) { alt32 = 2 ; } else { int nvaeMark = input . mark ( ) ; try { for ( int nvaeConsume = 0 ; nvaeConsume < 4 - 1 ; nvaeConsume ++ ) { input . consume ( ) ; } NoViableAltException nvae = new NoViableAltException ( "" , 32 , 6 , input ) ; throw nvae ; } finally { input . rewind ( nvaeMark ) ; } } } break ; case IDENT : { alt32 = 1 ; } break ; case ELEMENTS : { alt32 = 2 ; } break ; default : int nvaeMark = input . mark ( ) ; try { for ( int nvaeConsume = 0 ; nvaeConsume < 3 - 1 ; nvaeConsume ++ ) { input . consume ( ) ; } NoViableAltException nvae = new NoViableAltException ( "" , 32 , 4 , input ) ; throw nvae ; } finally { input . rewind ( nvaeMark ) ; } } } else { int nvaeMark = input . mark ( ) ; try { input . consume ( ) ; NoViableAltException nvae = new NoViableAltException ( "" , 32 , 3 , input ) ; throw nvae ; } finally { input . rewind ( nvaeMark ) ; } } } break ; case JOIN : { switch ( input . LA ( 2 ) ) { case FETCH : { int LA32_6 = input . LA ( 3 ) ; if ( ( LA32_6 == IDENT ) ) { alt32 = 1 ; } else if ( ( LA32_6 == ELEMENTS ) ) { alt32 = 2 ; } else { int nvaeMark = input . mark ( ) ; try { for ( int nvaeConsume = 0 ; nvaeConsume < 3 - 1 ; nvaeConsume ++ ) { input . consume ( ) ; } NoViableAltException nvae = new NoViableAltException ( "" , 32 , 6 , input ) ; throw nvae ; } finally { input . rewind ( nvaeMark ) ; } } } break ; case IDENT : { alt32 = 1 ; } break ; case ELEMENTS : { alt32 = 2 ; } break ; default : int nvaeMark = input . mark ( ) ; try { input . consume ( ) ; NoViableAltException nvae = new NoViableAltException ( "" , 32 , 4 , input ) ; throw nvae ; } finally { input . rewind ( nvaeMark ) ; } } } break ; default : NoViableAltException nvae = new NoViableAltException ( "" , 32 , 0 , input ) ; throw nvae ; } switch ( alt32 ) { case 1 : // hql . g : 280:4 : ( ( ( LEFT | RIGHT ) ( OUTER ) ? ) | FULL | INNER ) ? JOIN ^ ( FETCH ) ? path ( asAlias ) ? ( propertyFetch ) ? ( withClause ) ? { root_0 = ( CommonTree ) adaptor . nil ( ) ; // hql . g : 280:4 : ( ( ( LEFT | RIGHT ) ( OUTER ) ? ) | FULL | INNER ) ? int alt21 = 4 ; switch ( input . LA ( 1 ) ) { case LEFT : case RIGHT : { alt21 = 1 ; } break ; case FULL : { alt21 = 2 ; } break ; case INNER : { alt21 = 3 ; } break ; } switch ( alt21 ) { case 1 : // hql . g : 280:6 : ( ( LEFT | RIGHT ) ( OUTER ) ? ) { // hql . g : 280:6 : ( ( LEFT | RIGHT ) ( OUTER ) ? ) // hql . g : 280:8 : ( LEFT | RIGHT ) ( OUTER ) ? { set63 = input . LT ( 1 ) ; if ( input . LA ( 1 ) == LEFT || input . LA ( 1 ) == RIGHT ) { input . consume ( ) ; adaptor . addChild ( root_0 , adaptor . create ( set63 ) ) ; state . errorRecovery = false ; } else { MismatchedSetException mse = new MismatchedSetException ( null , input ) ; throw mse ; } // hql . g : 280:25 : ( OUTER ) ? int alt20 = 2 ; int LA20_0 = input . LA ( 1 ) ; if ( ( LA20_0 == OUTER ) ) { alt20 = 1 ; } switch ( alt20 ) { case 1 : // hql . g : 280:26 : OUTER { OUTER64 = ( Token ) match ( input , OUTER , FOLLOW_OUTER_in_fromJoin1168 ) ; OUTER64_tree = ( CommonTree ) adaptor . create ( OUTER64 ) ; adaptor . addChild ( root_0 , OUTER64_tree ) ; } break ; } } } break ; case 2 : // hql . g : 280:38 : FULL { FULL65 = ( Token ) match ( input , FULL , FOLLOW_FULL_in_fromJoin1176 ) ; FULL65_tree = ( CommonTree ) adaptor . create ( FULL65 ) ; adaptor . addChild ( root_0 , FULL65_tree ) ; } break ; case 3 : // hql . g : 280:45 : INNER { INNER66 = ( Token ) match ( input , INNER , FOLLOW_INNER_in_fromJoin1180 ) ; INNER66_tree = ( CommonTree ) adaptor . create ( INNER66 ) ; adaptor . addChild ( root_0 , INNER66_tree ) ; } break ; } JOIN67 = ( Token ) match ( input , JOIN , FOLLOW_JOIN_in_fromJoin1185 ) ; JOIN67_tree = ( CommonTree ) adaptor . create ( JOIN67 ) ; root_0 = ( CommonTree ) adaptor . becomeRoot ( JOIN67_tree , root_0 ) ; // hql . g : 280:60 : ( FETCH ) ? int alt22 = 2 ; int LA22_0 = input . LA ( 1 ) ; if ( ( LA22_0 == FETCH ) ) { alt22 = 1 ; } switch ( alt22 ) { case 1 : // hql . g : 280:61 : FETCH { FETCH68 = ( Token ) match ( input , FETCH , FOLLOW_FETCH_in_fromJoin1189 ) ; FETCH68_tree = ( CommonTree ) adaptor . create ( FETCH68 ) ; adaptor . addChild ( root_0 , FETCH68_tree ) ; } break ; } pushFollow ( FOLLOW_path_in_fromJoin1193 ) ; path69 = path ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , path69 . getTree ( ) ) ; // hql . g : 280:74 : ( asAlias ) ? int alt23 = 2 ; int LA23_0 = input . LA ( 1 ) ; if ( ( LA23_0 == AS || LA23_0 == IDENT ) ) { alt23 = 1 ; } switch ( alt23 ) { case 1 : // hql . g : 280:75 : asAlias { pushFollow ( FOLLOW_asAlias_in_fromJoin1196 ) ; asAlias70 = asAlias ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , asAlias70 . getTree ( ) ) ; } break ; } // hql . g : 280:85 : ( propertyFetch ) ? int alt24 = 2 ; int LA24_0 = input . LA ( 1 ) ; if ( ( LA24_0 == FETCH ) ) { alt24 = 1 ; } switch ( alt24 ) { case 1 : // hql . g : 280:86 : propertyFetch { pushFollow ( FOLLOW_propertyFetch_in_fromJoin1201 ) ; propertyFetch71 = propertyFetch ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , propertyFetch71 . getTree ( ) ) ; } break ; } // hql . g : 280:102 : ( withClause ) ? int alt25 = 2 ; int LA25_0 = input . LA ( 1 ) ; if ( ( LA25_0 == WITH ) ) { alt25 = 1 ; } switch ( alt25 ) { case 1 : // hql . g : 280:103 : withClause { pushFollow ( FOLLOW_withClause_in_fromJoin1206 ) ; withClause72 = withClause ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , withClause72 . getTree ( ) ) ; } break ; } } break ; case 2 : // hql . g : 281:4 : ( ( ( LEFT | RIGHT ) ( OUTER ) ? ) | FULL | INNER ) ? JOIN ^ ( FETCH ) ? ELEMENTS ! OPEN ! path CLOSE ! ( asAlias ) ? ( propertyFetch ) ? ( withClause ) ? { root_0 = ( CommonTree ) adaptor . nil ( ) ; // hql . g : 281:4 : ( ( ( LEFT | RIGHT ) ( OUTER ) ? ) | FULL | INNER ) ? int alt27 = 4 ; switch ( input . LA ( 1 ) ) { case LEFT : case RIGHT : { alt27 = 1 ; } break ; case FULL : { alt27 = 2 ; } break ; case INNER : { alt27 = 3 ; } break ; } switch ( alt27 ) { case 1 : // hql . g : 281:6 : ( ( LEFT | RIGHT ) ( OUTER ) ? ) { // hql . g : 281:6 : ( ( LEFT | RIGHT ) ( OUTER ) ? ) // hql . g : 281:8 : ( LEFT | RIGHT ) ( OUTER ) ? { set73 = input . LT ( 1 ) ; if ( input . LA ( 1 ) == LEFT || input . LA ( 1 ) == RIGHT ) { input . consume ( ) ; adaptor . addChild ( root_0 , adaptor . create ( set73 ) ) ; state . errorRecovery = false ; } else { MismatchedSetException mse = new MismatchedSetException ( null , input ) ; throw mse ; } // hql . g : 281:25 : ( OUTER ) ? int alt26 = 2 ; int LA26_0 = input . LA ( 1 ) ; if ( ( LA26_0 == OUTER ) ) { alt26 = 1 ; } switch ( alt26 ) { case 1 : // hql . g : 281:26 : OUTER { OUTER74 = ( Token ) match ( input , OUTER , FOLLOW_OUTER_in_fromJoin1228 ) ; OUTER74_tree = ( CommonTree ) adaptor . create ( OUTER74 ) ; adaptor . addChild ( root_0 , OUTER74_tree ) ; } break ; } } } break ; case 2 : // hql . g : 281:38 : FULL { FULL75 = ( Token ) match ( input , FULL , FOLLOW_FULL_in_fromJoin1236 ) ; FULL75_tree = ( CommonTree ) adaptor . create ( FULL75 ) ; adaptor . addChild ( root_0 , FULL75_tree ) ; } break ; case 3 : // hql . g : 281:45 : INNER { INNER76 = ( Token ) match ( input , INNER , FOLLOW_INNER_in_fromJoin1240 ) ; INNER76_tree = ( CommonTree ) adaptor . create ( INNER76 ) ; adaptor . addChild ( root_0 , INNER76_tree ) ; } break ; } JOIN77 = ( Token ) match ( input , JOIN , FOLLOW_JOIN_in_fromJoin1245 ) ; JOIN77_tree = ( CommonTree ) adaptor . create ( JOIN77 ) ; root_0 = ( CommonTree ) adaptor . becomeRoot ( JOIN77_tree , root_0 ) ; // hql . g : 281:60 : ( FETCH ) ? int alt28 = 2 ; int LA28_0 = input . LA ( 1 ) ; if ( ( LA28_0 == FETCH ) ) { alt28 = 1 ; } switch ( alt28 ) { case 1 : // hql . g : 281:61 : FETCH { FETCH78 = ( Token ) match ( input , FETCH , FOLLOW_FETCH_in_fromJoin1249 ) ; FETCH78_tree = ( CommonTree ) adaptor . create ( FETCH78 ) ; adaptor . addChild ( root_0 , FETCH78_tree ) ; } break ; } ELEMENTS79 = ( Token ) match ( input , ELEMENTS , FOLLOW_ELEMENTS_in_fromJoin1253 ) ; OPEN80 = ( Token ) match ( input , OPEN , FOLLOW_OPEN_in_fromJoin1256 ) ; pushFollow ( FOLLOW_path_in_fromJoin1259 ) ; path81 = path ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , path81 . getTree ( ) ) ; CLOSE82 = ( Token ) match ( input , CLOSE , FOLLOW_CLOSE_in_fromJoin1261 ) ; // hql . g : 281:97 : ( asAlias ) ? int alt29 = 2 ; int LA29_0 = input . LA ( 1 ) ; if ( ( LA29_0 == AS || LA29_0 == IDENT ) ) { alt29 = 1 ; } switch ( alt29 ) { case 1 : // hql . g : 281:98 : asAlias { pushFollow ( FOLLOW_asAlias_in_fromJoin1265 ) ; asAlias83 = asAlias ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , asAlias83 . getTree ( ) ) ; } break ; } // hql . g : 281:108 : ( propertyFetch ) ? int alt30 = 2 ; int LA30_0 = input . LA ( 1 ) ; if ( ( LA30_0 == FETCH ) ) { alt30 = 1 ; } switch ( alt30 ) { case 1 : // hql . g : 281:109 : propertyFetch { pushFollow ( FOLLOW_propertyFetch_in_fromJoin1270 ) ; propertyFetch84 = propertyFetch ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , propertyFetch84 . getTree ( ) ) ; } break ; } // hql . g : 281:125 : ( withClause ) ? int alt31 = 2 ; int LA31_0 = input . LA ( 1 ) ; if ( ( LA31_0 == WITH ) ) { alt31 = 1 ; } switch ( alt31 ) { case 1 : // hql . g : 281:126 : withClause { pushFollow ( FOLLOW_withClause_in_fromJoin1275 ) ; withClause85 = withClause ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , withClause85 . getTree ( ) ) ; } break ; } } break ; } retval . stop = input . LT ( - 1 ) ; retval . tree = ( CommonTree ) adaptor . rulePostProcessing ( root_0 ) ; adaptor . setTokenBoundaries ( retval . tree , retval . start , retval . stop ) ; } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; retval . tree = ( CommonTree ) adaptor . errorNode ( input , retval . start , input . LT ( - 1 ) , re ) ; } finally { // do for sure before leaving } return retval ;
public class GridBagLayoutBuilder { /** * Appends the given label to the end of the current line . The label does * not " grow . " * @ param label the label to append * @ param colSpan the number of columns to span * @ return " this " to make it easier to string together append calls */ public GridBagLayoutBuilder appendLabel ( JLabel label , int colSpan ) { } }
return append ( label , colSpan , 1 , false , false ) ;
public class FilterSupportStatus { /** * Static constructor for a not supported status caused by sub - filters not being supported . * @ param unsupportedSubfilters a { @ link java . util . List } object . * @ return a { @ link com . google . cloud . bigtable . hbase . adapters . filters . FilterSupportStatus } object . */ public static FilterSupportStatus newCompositeNotSupported ( List < FilterSupportStatus > unsupportedSubfilters ) { } }
StringBuilder builder = new StringBuilder ( ) ; for ( FilterSupportStatus subStatus : unsupportedSubfilters ) { builder . append ( subStatus . getReason ( ) ) ; builder . append ( "\n" ) ; } return new FilterSupportStatus ( false , builder . toString ( ) ) ;
public class NumericsUtilities { /** * Normalizes a value for a given normalization max ( assuming the lower is 0 ) . * @ param max the max of the sampling values . * @ param min the min of the sampling values . * @ param value the current value from the sampling values to be normalized . * @ param normMax the normalization maximum to use . * @ return the normalized value . */ public static double normalize ( double max , double min , double value , double normMax ) { } }
return normMax / ( 1 + ( ( max - value ) / ( value - min ) ) ) ;
public class HealthManager { /** * Construct all required command line options */ private static Options constructCliOptions ( ) { } }
Options options = new Options ( ) ; Option cluster = Option . builder ( "c" ) . desc ( "Cluster name in which the topology needs to run on" ) . longOpt ( CliArgs . CLUSTER . text ) . hasArgs ( ) . argName ( CliArgs . CLUSTER . text ) . required ( ) . build ( ) ; Option role = Option . builder ( "r" ) . desc ( "Role under which the topology needs to run" ) . longOpt ( CliArgs . ROLE . text ) . hasArgs ( ) . argName ( CliArgs . ROLE . text ) . required ( ) . build ( ) ; Option environment = Option . builder ( "e" ) . desc ( "Environment under which the topology needs to run" ) . longOpt ( CliArgs . ENVIRONMENT . text ) . hasArgs ( ) . argName ( CliArgs . ENVIRONMENT . text ) . build ( ) ; Option heronHome = Option . builder ( "d" ) . desc ( "Directory where heron is installed" ) . longOpt ( CliArgs . HERON_HOME . text ) . hasArgs ( ) . argName ( "heron home dir" ) . build ( ) ; Option configFile = Option . builder ( "p" ) . desc ( "Path of the config files" ) . longOpt ( CliArgs . CONFIG_PATH . text ) . hasArgs ( ) . argName ( "config path" ) . build ( ) ; Option topologyName = Option . builder ( "n" ) . desc ( "Name of the topology" ) . longOpt ( CliArgs . TOPOLOGY_NAME . text ) . hasArgs ( ) . argName ( "topology name" ) . required ( ) . build ( ) ; Option metricsSourceURL = Option . builder ( "t" ) . desc ( "metrics data source url with port number" ) . longOpt ( CliArgs . METRIC_SOURCE_URL . text ) . hasArgs ( ) . argName ( "data source url" ) . build ( ) ; // candidate metrics sources are : // org . apache . heron . healthmgr . sensors . TrackerMetricsProvider ( default ) // org . apache . heron . healthmgr . sensors . MetricsCacheMetricsProvider Option metricsSourceType = Option . builder ( "s" ) . desc ( "metrics data source type" ) . longOpt ( CliArgs . METRIC_SOURCE_TYPE . text ) . hasArg ( ) . argName ( "data source type" ) . build ( ) ; // candidates : // local : Health manager is started manually // cluster : Health manager is started by executor on container 0 ( default ) Option mode = Option . builder ( "m" ) . desc ( "Health manager process mode, cluster or local" ) . longOpt ( CliArgs . MODE . text ) . hasArg ( ) . argName ( "process mode" ) . build ( ) ; Option metricsMgrPort = Option . builder ( "m" ) . desc ( "Port of local MetricsManager" ) . longOpt ( CliArgs . METRICSMGR_PORT . text ) . hasArgs ( ) . argName ( "metrics_manager port" ) . required ( ) . build ( ) ; Option verbose = Option . builder ( "v" ) . desc ( "Enable debug logs" ) . longOpt ( CliArgs . VERBOSE . text ) . build ( ) ; options . addOption ( cluster ) ; options . addOption ( role ) ; options . addOption ( environment ) ; options . addOption ( heronHome ) ; options . addOption ( configFile ) ; options . addOption ( topologyName ) ; options . addOption ( metricsSourceType ) ; options . addOption ( metricsSourceURL ) ; options . addOption ( mode ) ; options . addOption ( metricsMgrPort ) ; options . addOption ( verbose ) ; return options ;
public class HMapLens { /** * A lens that focuses on a value at a { @ link TypeSafeKey . Simple } & lt ; A & gt ; in an { @ link HMap } , as a { @ link Maybe } . * @ param key the key * @ param < A > the value type at the key * @ return the lens */ public static < A > Lens . Simple < HMap , Maybe < A > > valueAt ( TypeSafeKey < ? , A > key ) { } }
return simpleLens ( m -> m . get ( key ) , ( m , maybeA ) -> maybeA . fmap ( a -> m . put ( key , a ) ) . orElseGet ( ( ) -> m . remove ( key ) ) ) ;
public class NotificationRemoteCallback { /** * Called when receiving a broadcast . * @ param remote * @ param entry * @ param intent * @ param intentAction */ public void onReceive ( NotificationRemote remote , NotificationEntry entry , Intent intent , String intentAction ) { } }
if ( DBG ) Log . d ( TAG , "onReceive - " + entry . ID + ", " + intentAction ) ;
public class TypeQualifierApplications { /** * Get the direct annotations ( if any ) on given AnnotatedObject . * @ param m * an AnnotatedObject * @ return Collection of AnnotationValues representing annotations directly * applied to this AnnotatedObject */ private static Collection < AnnotationValue > getDirectAnnotation ( AnnotatedObject m ) { } }
Collection < AnnotationValue > result = getDirectObjectAnnotations ( ) . get ( m ) ; if ( result != null ) { return result ; } if ( m . getAnnotationDescriptors ( ) . isEmpty ( ) ) { return Collections . < AnnotationValue > emptyList ( ) ; } result = TypeQualifierResolver . resolveTypeQualifiers ( m . getAnnotations ( ) ) ; if ( result . size ( ) == 0 ) { result = Collections . < AnnotationValue > emptyList ( ) ; } getDirectObjectAnnotations ( ) . put ( m , result ) ; return result ;
public class MoleculeSetRenderer { /** * Determine the overlap of the diagram with the screen , and shift ( if * necessary ) the diagram draw center . It returns a rectangle only because * that is a convenient class to hold the four parameters calculated , but it * is not a rectangle representing an area . . . * @ param screenBounds * the bounds of the screen * @ param diagramBounds * the bounds of the diagram * @ return the shape that the screen should be */ @ Override public Rectangle shift ( Rectangle screenBounds , Rectangle diagramBounds ) { } }
int screenMaxX = screenBounds . x + screenBounds . width ; int screenMaxY = screenBounds . y + screenBounds . height ; int diagramMaxX = diagramBounds . x + diagramBounds . width ; int diagramMaxY = diagramBounds . y + diagramBounds . height ; int leftOverlap = screenBounds . x - diagramBounds . x ; int rightOverlap = diagramMaxX - screenMaxX ; int topOverlap = screenBounds . y - diagramBounds . y ; int bottomOverlap = diagramMaxY - screenMaxY ; int diffx = 0 ; int diffy = 0 ; int width = screenBounds . width ; int height = screenBounds . height ; if ( leftOverlap > 0 ) { diffx = leftOverlap ; } if ( rightOverlap > 0 ) { width += rightOverlap ; } if ( topOverlap > 0 ) { diffy = topOverlap ; } if ( bottomOverlap > 0 ) { height += bottomOverlap ; } if ( diffx != 0 || diffy != 0 ) { this . shiftDrawCenter ( diffx , diffy ) ; } return new Rectangle ( diffx , diffy , width , height ) ;
public class ValueFileIOHelper { /** * Copy input to output data using NIO . Input and output streams will be closed after the * operation . * @ param in * InputStream * @ param out * OutputStream * @ return The number of bytes , possibly zero , that were actually copied * @ throws IOException * if error occurs */ protected long copyClose ( InputStream in , OutputStream out ) throws IOException { } }
try { try { return copy ( in , out ) ; } finally { in . close ( ) ; } } finally { out . close ( ) ; }
public class CommerceOrderPersistenceImpl { /** * Returns a range of all the commerce orders where groupId = & # 63 ; and userId = & # 63 ; and orderStatus = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link CommerceOrderModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order . * @ param groupId the group ID * @ param userId the user ID * @ param orderStatus the order status * @ param start the lower bound of the range of commerce orders * @ param end the upper bound of the range of commerce orders ( not inclusive ) * @ return the range of matching commerce orders */ @ Override public List < CommerceOrder > findByG_U_O ( long groupId , long userId , int orderStatus , int start , int end ) { } }
return findByG_U_O ( groupId , userId , orderStatus , start , end , null ) ;
public class MultiMap { /** * Test for a specific single value in the map . * NOTE : This is a SLOW operation , and is actively discouraged . * @ param value the value to search for * @ return true if contains simple value */ public boolean containsSimpleValue ( V value ) { } }
for ( List < V > vals : values ( ) ) { if ( ( vals . size ( ) == 1 ) && vals . contains ( value ) ) { return true ; } } return false ;
public class ReflectionUtil { /** * Iterates over all fields of the given class and all its super classes * and calls action . act ( ) for the fields that are annotated with the given annotation . */ public static void forEachField ( final Object object , Class < ? > clazz , final FieldPredicate predicate , final FieldAction action ) { } }
forEachSuperClass ( clazz , new ClassAction ( ) { @ Override public void act ( Class < ? > clazz ) throws Exception { for ( Field field : clazz . getDeclaredFields ( ) ) { if ( predicate . isTrue ( field ) ) { action . act ( object , field ) ; } } } } ) ;
public class OneQuery { /** * Execute the query synchronously * @ return the result of the query . */ public T get ( ) { } }
final SQLiteDatabase db = Sprinkles . getDatabase ( ) ; final Cursor c = db . rawQuery ( rawQuery , null ) ; T result = null ; if ( c . moveToFirst ( ) ) { result = Utils . getResultFromCursor ( resultClass , c ) ; } c . close ( ) ; return result ;
public class Keep { /** * Register a value in the keep . Compact the keep if it is full . The next * time this value is encountered , its integer can be sent instead . * @ param value A value . */ public void register ( Object value ) { } }
if ( JSONzip . probe ) { int integer = find ( value ) ; if ( integer >= 0 ) { JSONzip . log ( "\nDuplicate key " + value ) ; } } if ( this . length >= this . capacity ) { compact ( ) ; } this . list [ this . length ] = value ; this . map . put ( value , this . length ) ; this . ticks [ this . length ] = 1 ; if ( JSONzip . probe ) { JSONzip . log ( "<" + this . length + " " + value + "> " ) ; } this . length += 1 ;
public class IntDoubleVectorSlice { /** * Updates this vector to be the entrywise product ( i . e . Hadamard product ) of this vector with the other . */ public void product ( IntDoubleVector other ) { } }
// TODO : Add special case for IntDoubleDenseVector . for ( int i = 0 ; i < size ; i ++ ) { elements [ i + start ] *= other . get ( i ) ; }
public class QueryBuilder { /** * Delegates to { @ link # withCommitId ( CommitId ) } */ public QueryBuilder withCommitId ( BigDecimal commitId ) { } }
Validate . argumentIsNotNull ( commitId ) ; queryParamsBuilder . commitId ( CommitId . valueOf ( commitId ) ) ; return this ;
public class ChronoFormatter { /** * / * [ deutsch ] * < p > Erzeugt eine Kopie , die die angegebene Kalenderreform verwendet . < / p > * < p > Zu beachten : Diese Methode wird jedes gregorianische Umstellungsdatum & uuml ; berschreiben , das * von der L & auml ; ndereinstellung dieses Formatierers abgeleitet werden mag . < / p > * @ param history chronological history describing historical calendar reforms * @ return changed copy with given history while this instance remains unaffected * @ since 3.1 */ public ChronoFormatter < T > with ( ChronoHistory history ) { } }
if ( history == null ) { throw new NullPointerException ( "Missing calendar history." ) ; } Attributes attrs = new Attributes . Builder ( ) . setAll ( this . globalAttributes . getAttributes ( ) ) . setCalendarVariant ( history . getVariant ( ) ) . build ( ) ; AttributeSet as = this . globalAttributes . withInternal ( HistoricAttribute . CALENDAR_HISTORY , history ) . withAttributes ( attrs ) ; return new ChronoFormatter < > ( this , as , history ) ;
public class DescribeSimulationApplicationRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeSimulationApplicationRequest describeSimulationApplicationRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeSimulationApplicationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeSimulationApplicationRequest . getApplication ( ) , APPLICATION_BINDING ) ; protocolMarshaller . marshall ( describeSimulationApplicationRequest . getApplicationVersion ( ) , APPLICATIONVERSION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }