signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class NonBlockingByteArrayInputStream { /** * Skips < code > n < / code > bytes of input from this input stream . Fewer bytes * might be skipped if the end of the input stream is reached . The actual * number < code > k < / code > of bytes to be skipped is equal to the smaller of * < code > n < / code > and < code > count - pos < / code > . The value < code > k < / code > is * added into < code > pos < / code > and < code > k < / code > is returned . * @ param n * the number of bytes to be skipped . * @ return the actual number of bytes skipped . */ @ Override public long skip ( final long n ) { } }
final long nSkip = m_nPos + n > m_nCount ? m_nCount - m_nPos : n ; if ( nSkip <= 0 ) return 0 ; m_nPos += nSkip ; return nSkip ;
public class CRLReasonCodeExtension { /** * Return the reason as a CRLReason enum . */ public CRLReason getReasonCode ( ) { } }
// if out - of - range , return UNSPECIFIED if ( reasonCode > 0 && reasonCode < values . length ) { return values [ reasonCode ] ; } else { return CRLReason . UNSPECIFIED ; }
public class Transformation2D { /** * Transforms a tolerance value . * @ param tolerance * The tolerance value . */ public double transform ( double tolerance ) { } }
// the function should be implemented as follows : find encompassing // circle for the transformed circle of radius = Tolerance . // this is approximation . Point2D pt1 = new Point2D ( ) ; Point2D pt2 = new Point2D ( ) ; /* * pt [ 0 ] . Set ( 0 , 0 ) ; pt [ 1 ] . Set ( 1 , 0 ) ; pt [ 2 ] . Set ( 0 , 1 ) ; Transform ( pt ) ; * pt [ 1 ] - = pt [ 0 ] ; pt [ 2 ] - = pt [ 0 ] ; */ pt1 . setCoords ( xx , yx ) ; pt2 . setCoords ( xy , yy ) ; pt1 . sub ( pt1 ) ; double d1 = pt1 . sqrLength ( ) * 0.5 ; pt1 . setCoords ( xx , yx ) ; pt2 . setCoords ( xy , yy ) ; pt1 . add ( pt2 ) ; double d2 = pt1 . sqrLength ( ) * 0.5 ; return tolerance * ( ( d1 > d2 ) ? Math . sqrt ( d1 ) : Math . sqrt ( d2 ) ) ;
public class Registry { /** * Computes a transitive closure of the { @ link Server } dependencies . * @ param server the { @ link Server } to compute transitive dependencies for * @ return the transitive dependencies */ private Set < T > getTransitiveDeps ( T server ) { } }
Set < T > result = new HashSet < > ( ) ; Deque < T > queue = new ArrayDeque < > ( ) ; queue . add ( server ) ; while ( ! queue . isEmpty ( ) ) { Set < Class < ? extends Server > > deps = queue . pop ( ) . getDependencies ( ) ; if ( deps == null ) { continue ; } for ( Class < ? extends Server > clazz : deps ) { T dep = mRegistry . get ( clazz ) ; if ( dep == null ) { continue ; } if ( dep . equals ( server ) ) { throw new RuntimeException ( "Dependency cycle encountered" ) ; } if ( result . contains ( dep ) ) { continue ; } queue . add ( dep ) ; result . add ( dep ) ; } } return result ;
public class PersonGroupPersonsImpl { /** * Create a new person in a specified person group . * @ param personGroupId Id referencing a particular person group . * @ param createOptionalParameter the object representing the optional parameters to be set before calling this API * @ 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 < Person > createAsync ( String personGroupId , CreatePersonGroupPersonsOptionalParameter createOptionalParameter , final ServiceCallback < Person > serviceCallback ) { } }
return ServiceFuture . fromResponse ( createWithServiceResponseAsync ( personGroupId , createOptionalParameter ) , serviceCallback ) ;
public class S3RestUtils { /** * Calls the given { @ link S3RestUtils . RestCallable } and handles any exceptions thrown . * @ param < T > the return type of the callable * @ param resource the resource ( bucket or object ) to be operated on * @ param callable the callable to call * @ return the response object */ public static < T > Response call ( String resource , S3RestUtils . RestCallable < T > callable ) { } }
try { // TODO ( cc ) : reconsider how to enable authentication if ( SecurityUtils . isSecurityEnabled ( ServerConfiguration . global ( ) ) && AuthenticatedClientUser . get ( ServerConfiguration . global ( ) ) == null ) { AuthenticatedClientUser . set ( LoginUser . get ( ServerConfiguration . global ( ) ) . getName ( ) ) ; } } catch ( IOException e ) { LOG . warn ( "Failed to set AuthenticatedClientUser in REST service handler: {}" , e . getMessage ( ) ) ; return createErrorResponse ( new S3Exception ( e , resource , S3ErrorCode . INTERNAL_ERROR ) ) ; } try { return createResponse ( callable . call ( ) ) ; } catch ( S3Exception e ) { LOG . warn ( "Unexpected error invoking REST endpoint: {}" , e . getErrorCode ( ) . getDescription ( ) ) ; return createErrorResponse ( e ) ; }
public class MacAuthUtils { /** * Returns a signature base string . * The signature base string is constructed by concatenating together , in order , the * following HTTP request elements , each followed by a new line character ( % x0A ) : * 1 . The nonce value generated for the request . * 2 . The HTTP request method in upper case . For example : " HEAD " , * " GET " , " POST " , etc . * 3 . The HTTP request - URI as defined by [ RFC2616 ] section 5.1.2. * 4 . The hostname included in the HTTP request using the " Host " * request header field in lower case . * 5 . The port as included in the HTTP request using the " Host " request * header field . If the header field does not include a port , the * default value for the scheme MUST be used ( e . g . 80 for HTTP and * 443 for HTTPS ) . * 6 . The request payload body hash as described in Section 3.2 if one * was calculated and included in the request , otherwise , an empty * string . Note that the body hash of an empty payload body is not * an empty string . * 7 . The value of the " ext " " Authorization " request header field * attribute if one was included in the request , otherwise , an empty * string . * Each element is followed by a new line character ( % x0A ) including the * last element and even when an element value is an empty string . * @ see < a href = " https : / / tools . ietf . org / html / draft - hammer - oauth - v2 - mac - token - 05 # section - 3.3.1 " > 3.3.1. * Normalized Request String < / a > * @ param nonce the nonce value * @ param requestMethod the request method * @ param headerHost the " Host " request header field value * @ param requestUrl request url * @ param payloadBodyHash the request payload body hash * @ param ext the " ext " " Authorization " request header field attribute * @ return signature base string * @ throws AuthException if some of parameters has unacceptable value */ public static String getSignatureBaseString ( String nonce , String requestMethod , String headerHost , String requestUrl , @ Nullable String payloadBodyHash , @ Nullable String ext ) throws AuthException { } }
return nonce + '\n' + requestMethod . toUpperCase ( ) + '\n' + normalizeUrl ( headerHost , requestUrl ) + '\n' + ( payloadBodyHash != null ? payloadBodyHash : "" ) + '\n' + ( ext != null ? ext : "" ) + '\n' ;
public class UseParserFactory { /** * Create use parser instance . * @ param dbType database type * @ param shardingRule databases and tables sharding rule * @ param lexerEngine lexical analysis engine . * @ return use parser instance */ public static AbstractUseParser newInstance ( final DatabaseType dbType , final ShardingRule shardingRule , final LexerEngine lexerEngine ) { } }
switch ( dbType ) { case H2 : case MySQL : return new MySQLUseParser ( lexerEngine ) ; default : throw new UnsupportedOperationException ( String . format ( "Cannot support database [%s]." , dbType ) ) ; }
public class PdfUtilities { /** * Merges PDF files . * @ param inputPdfFiles array of input files * @ param outputPdfFile output file */ public static void mergePdf ( File [ ] inputPdfFiles , File outputPdfFile ) { } }
if ( PDFBOX . equals ( System . getProperty ( PDF_LIBRARY ) ) ) { PdfBoxUtilities . mergePdf ( inputPdfFiles , outputPdfFile ) ; } else { try { PdfGsUtilities . mergePdf ( inputPdfFiles , outputPdfFile ) ; } catch ( Exception e ) { System . setProperty ( PDF_LIBRARY , PDFBOX ) ; mergePdf ( inputPdfFiles , outputPdfFile ) ; } }
public class UpdateFlowEntitlementRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateFlowEntitlementRequest updateFlowEntitlementRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateFlowEntitlementRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateFlowEntitlementRequest . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( updateFlowEntitlementRequest . getEncryption ( ) , ENCRYPTION_BINDING ) ; protocolMarshaller . marshall ( updateFlowEntitlementRequest . getEntitlementArn ( ) , ENTITLEMENTARN_BINDING ) ; protocolMarshaller . marshall ( updateFlowEntitlementRequest . getFlowArn ( ) , FLOWARN_BINDING ) ; protocolMarshaller . marshall ( updateFlowEntitlementRequest . getSubscribers ( ) , SUBSCRIBERS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class AddAttachmentsToSetRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AddAttachmentsToSetRequest addAttachmentsToSetRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( addAttachmentsToSetRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( addAttachmentsToSetRequest . getAttachmentSetId ( ) , ATTACHMENTSETID_BINDING ) ; protocolMarshaller . marshall ( addAttachmentsToSetRequest . getAttachments ( ) , ATTACHMENTS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class CmsEditLoginMessageDialog { /** * Commits the edited login message to the login manager . < p > */ @ Override public void actionCommit ( ) { } }
List < Throwable > errors = new ArrayList < Throwable > ( ) ; try { // set the edited message OpenCms . getLoginManager ( ) . setLoginMessage ( getCms ( ) , m_loginMessage ) ; // update the system configuration OpenCms . writeConfiguration ( CmsVariablesConfiguration . class ) ; // clear the message object setDialogObject ( null ) ; } catch ( Throwable t ) { errors . add ( t ) ; } // set the list of errors to display when saving failed setCommitErrors ( errors ) ;
public class DescribeConfigurationRecorderStatusResult { /** * A list that contains status of the specified recorders . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setConfigurationRecordersStatus ( java . util . Collection ) } or * { @ link # withConfigurationRecordersStatus ( java . util . Collection ) } if you want to override the existing values . * @ param configurationRecordersStatus * A list that contains status of the specified recorders . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeConfigurationRecorderStatusResult withConfigurationRecordersStatus ( ConfigurationRecorderStatus ... configurationRecordersStatus ) { } }
if ( this . configurationRecordersStatus == null ) { setConfigurationRecordersStatus ( new com . amazonaws . internal . SdkInternalList < ConfigurationRecorderStatus > ( configurationRecordersStatus . length ) ) ; } for ( ConfigurationRecorderStatus ele : configurationRecordersStatus ) { this . configurationRecordersStatus . add ( ele ) ; } return this ;
public class ChunkedFileSet { /** * Ideally all methods after the close should throw an Exception if called , * but that will involve changing a lot of code ( this file and callers ) * and testing . So reseting most of the collections so that the read returns * empty data . Before this method was introduced JVM used to crash when the * memory mapped file was accessed after it was closed . */ private void reset ( ) { } }
this . numChunks = 0 ; this . baseDir = null ; this . indexFileSizes . clear ( ) ; this . dataFileSizes . clear ( ) ; this . fileNames . clear ( ) ; this . indexFiles . clear ( ) ; this . mappedIndexFileReader . clear ( ) ; this . dataFiles . clear ( ) ; this . chunkIdToChunkStart . clear ( ) ; this . chunkIdToNumChunks . clear ( ) ;
public class Task { private void cancelInvokable ( AbstractInvokable invokable ) { } }
// in case of an exception during execution , we still call " cancel ( ) " on the task if ( invokable != null && invokableHasBeenCanceled . compareAndSet ( false , true ) ) { try { invokable . cancel ( ) ; } catch ( Throwable t ) { LOG . error ( "Error while canceling task {}." , taskNameWithSubtask , t ) ; } }
public class CloudSdkChecker { /** * Validates the cloud SDK installation * @ param cloudSdk CloudSdk with a configured sdk home directory */ public void checkCloudSdk ( CloudSdk cloudSdk , String version ) throws CloudSdkVersionFileException , CloudSdkNotFoundException , CloudSdkOutOfDateException { } }
if ( ! version . equals ( cloudSdk . getVersion ( ) . toString ( ) ) ) { throw new RuntimeException ( "Specified Cloud SDK version (" + version + ") does not match installed version (" + cloudSdk . getVersion ( ) + ")." ) ; } cloudSdk . validateCloudSdk ( ) ;
public class ErrorLogReader { /** * Read all the errors in a log since a given timestamp . * @ param buffer containing the { @ link DistinctErrorLog } . * @ param consumer to be called for each exception encountered . * @ param sinceTimestamp for filtering errors that have been recorded since this time . * @ return the number of entries that has been read . */ public static int read ( final AtomicBuffer buffer , final ErrorConsumer consumer , final long sinceTimestamp ) { } }
int entries = 0 ; int offset = 0 ; final int capacity = buffer . capacity ( ) ; while ( offset < capacity ) { final int length = buffer . getIntVolatile ( offset + LENGTH_OFFSET ) ; if ( 0 == length ) { break ; } final long lastObservationTimestamp = buffer . getLongVolatile ( offset + LAST_OBSERVATION_TIMESTAMP_OFFSET ) ; if ( lastObservationTimestamp >= sinceTimestamp ) { ++ entries ; consumer . accept ( buffer . getInt ( offset + OBSERVATION_COUNT_OFFSET ) , buffer . getLong ( offset + FIRST_OBSERVATION_TIMESTAMP_OFFSET ) , lastObservationTimestamp , buffer . getStringWithoutLengthUtf8 ( offset + ENCODED_ERROR_OFFSET , length - ENCODED_ERROR_OFFSET ) ) ; } offset += align ( length , RECORD_ALIGNMENT ) ; } return entries ;
public class ProcessCommunicatorImpl { /** * / * ( non - Javadoc ) * @ see tuwien . auto . calimero . process . ProcessCommunicator # readString * ( tuwien . auto . calimero . GroupAddress ) */ public String readString ( GroupAddress dst ) throws KNXTimeoutException , KNXRemoteException , KNXLinkClosedException , KNXFormatException { } }
final byte [ ] apdu = readFromGroup ( dst , priority , 0 , 14 ) ; final DPTXlatorString t = new DPTXlatorString ( DPTXlatorString . DPT_STRING_8859_1 ) ; extractGroupASDU ( apdu , t ) ; return t . getValue ( ) ;
public class CreateHttpNamespaceRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateHttpNamespaceRequest createHttpNamespaceRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createHttpNamespaceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createHttpNamespaceRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( createHttpNamespaceRequest . getCreatorRequestId ( ) , CREATORREQUESTID_BINDING ) ; protocolMarshaller . marshall ( createHttpNamespaceRequest . getDescription ( ) , DESCRIPTION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class SessionDriver { /** * A helper function to get the local address of the machine * @ return the local address of the current machine * @ throws IOException */ static java . net . InetAddress getLocalAddress ( ) throws IOException { } }
try { return java . net . InetAddress . getLocalHost ( ) ; } catch ( java . net . UnknownHostException e ) { throw new IOException ( e ) ; }
public class DescribeFlowLogsResult { /** * Information about the flow logs . * @ param flowLogs * Information about the flow logs . */ public void setFlowLogs ( java . util . Collection < FlowLog > flowLogs ) { } }
if ( flowLogs == null ) { this . flowLogs = null ; return ; } this . flowLogs = new com . amazonaws . internal . SdkInternalList < FlowLog > ( flowLogs ) ;
public class ResourceURL { /** * Returns true if the URL passed to it corresponds to a directory . This is slightly tricky due to some quirks * of the { @ link JarFile } API . Only jar : / / and file : / / URLs are supported . * @ param resourceURL the URL to check * @ return true if resource is a directory */ public static boolean isDirectory ( URL resourceURL ) throws URISyntaxException { } }
final String protocol = resourceURL . getProtocol ( ) ; switch ( protocol ) { case "jar" : try { final JarURLConnection jarConnection = ( JarURLConnection ) resourceURL . openConnection ( ) ; final JarEntry entry = jarConnection . getJarEntry ( ) ; if ( entry . isDirectory ( ) ) { return true ; } // WARNING ! Heuristics ahead . // It turns out that JarEntry # isDirectory ( ) really just tests whether the filename ends in a ' / ' . // If you try to open the same URL without a trailing ' / ' , it ' ll succeed — but the result won ' t be // what you want . We try to get around this by calling getInputStream ( ) on the file inside the jar . // This seems to return null for directories ( though that behavior is undocumented as far as I // can tell ) . If you have a better idea , please improve this . final String relativeFilePath = entry . getName ( ) ; final JarFile jarFile = jarConnection . getJarFile ( ) ; final ZipEntry zipEntry = jarFile . getEntry ( relativeFilePath ) ; final InputStream inputStream = jarFile . getInputStream ( zipEntry ) ; return inputStream == null ; } catch ( IOException e ) { throw new ResourceNotFoundException ( e ) ; } case "file" : return new File ( resourceURL . toURI ( ) ) . isDirectory ( ) ; default : throw new IllegalArgumentException ( "Unsupported protocol " + resourceURL . getProtocol ( ) + " for resource " + resourceURL ) ; }
public class NodeImpl { /** * { @ inheritDoc } * Overwritten by TextImpl , CommentImpl and ProcessingInstructionImpl */ public String getTextContent ( ) throws DOMException { } }
StringBuilder sb = new StringBuilder ( ) ; getTextContent ( sb ) ; return sb . toString ( ) ;
public class FileLogInput { /** * @ return the last complete page read . */ protected long getCurrentPage ( ) { } }
if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "getCurrentPage" ) ; long currentPage = sectorValidatedInputStream . currentPage ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "getCurrentPage" , "returns =" + currentPage + "(long)" ) ; return currentPage ;
public class Postcard { public void officeManagedLogging ( String title , String key , Object value ) { } }
assertArgumentNotNull ( "title" , title ) ; assertArgumentNotNull ( "key" , key ) ; assertArgumentNotNull ( "value" , value ) ; if ( officeManagedLoggingMap == null ) { officeManagedLoggingMap = new LinkedHashMap < String , Map < String , Object > > ( 4 ) ; } Map < String , Object > valueMap = officeManagedLoggingMap . get ( title ) ; if ( valueMap == null ) { valueMap = new LinkedHashMap < String , Object > ( 4 ) ; officeManagedLoggingMap . put ( title , valueMap ) ; } valueMap . put ( key , value ) ;
public class Exceptions { /** * TODO : was package - level initially */ public static RuntimeException launderCacheLoaderException ( Exception e ) { } }
if ( ! ( e instanceof CacheLoaderException ) ) return new CacheLoaderException ( "Exception in CacheLoader" , e ) ; else return ( CacheLoaderException ) e ;
public class BigtableTableAdminGrpcClient { /** * { @ inheritDoc } */ @ Override public void deleteTable ( DeleteTableRequest request ) { } }
createUnaryListener ( request , deleteTableRpc , request . getName ( ) ) . getBlockingResult ( ) ;
public class SocketServer { /** * Blocks until the server has started successfully or an exception is * thrown . * @ throws VoldemortException if a problem occurs during start - up wrapping * the original exception . */ public void awaitStartupCompletion ( ) { } }
try { Object obj = startedStatusQueue . take ( ) ; if ( obj instanceof Throwable ) throw new VoldemortException ( ( Throwable ) obj ) ; } catch ( InterruptedException e ) { // this is okay , if we are interrupted we can stop waiting }
public class InterproceduralCallGraph { /** * ( non - Javadoc ) * @ see * edu . umd . cs . findbugs . graph . AbstractGraph # addVertex ( edu . umd . cs . findbugs * . graph . AbstractVertex ) */ @ Override public void addVertex ( InterproceduralCallGraphVertex v ) { } }
super . addVertex ( v ) ; methodDescToVertexMap . put ( v . getXmethod ( ) . getMethodDescriptor ( ) , v ) ;
public class SessionDataNode { /** * - - - - - private methods - - - - - */ private void incrementVersion ( ) throws FrameworkException { } }
// increment version on each change final Long version = getProperty ( SessionDataNode . version ) ; if ( version == null ) { setProperty ( SessionDataNode . version , 1L ) ; } else { setProperty ( SessionDataNode . version , version + 1 ) ; }
public class QueryLoggingCommand { @ Override public DBCursor cursor ( DBCollection dbCollection ) { } }
logger . debug ( "Executing {} for {} cursor" , delegate , dbCollection . getFullName ( ) ) ; DBCursor dbCursor = delegate . cursor ( dbCollection ) ; if ( logger . isDebugEnabled ( ) ) { StringBuilder sb = new StringBuilder ( ) ; DBObject plan = dbCursor . explain ( ) ; sb . append ( "MongoDB query plan:\n" ) ; sb . append ( "\tcursor = \"" ) . append ( plan . get ( "cursor" ) ) . append ( "\"\n" ) ; sb . append ( "\tnscanned = \"" ) . append ( plan . get ( "nscanned" ) ) . append ( "\"\n" ) ; sb . append ( "\tn = \"" ) . append ( plan . get ( "n" ) ) . append ( "\"\n" ) ; sb . append ( "\tmillis = \"" ) . append ( plan . get ( "millis" ) ) . append ( "\"\n" ) ; logger . debug ( sb . toString ( ) ) ; } return dbCursor ;
public class AmazonSageMakerClient { /** * Gets a list of labeling jobs assigned to a specified work team . * @ param listLabelingJobsForWorkteamRequest * @ return Result of the ListLabelingJobsForWorkteam operation returned by the service . * @ throws ResourceNotFoundException * Resource being access is not found . * @ sample AmazonSageMaker . ListLabelingJobsForWorkteam * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / sagemaker - 2017-07-24 / ListLabelingJobsForWorkteam " * target = " _ top " > AWS API Documentation < / a > */ @ Override public ListLabelingJobsForWorkteamResult listLabelingJobsForWorkteam ( ListLabelingJobsForWorkteamRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeListLabelingJobsForWorkteam ( request ) ;
public class RenameHandler { /** * Gets the map of renamed for an enum type . * An empty map is returned if there are no renames . * @ param type the enum type , not null * @ return a copy of the set of enum renames , not null */ public Map < String , Enum < ? > > getEnumRenames ( Class < ? > type ) { } }
if ( type == null ) { throw new IllegalArgumentException ( "type must not be null" ) ; } Map < String , Enum < ? > > map = enumRenames . get ( type ) ; if ( map == null ) { return new HashMap < String , Enum < ? > > ( ) ; } return new HashMap < String , Enum < ? > > ( map ) ;
public class AmazonEC2Client { /** * Allocates a Dedicated Host to your account . At a minimum , specify the instance size type , Availability Zone , and * quantity of hosts to allocate . * @ param allocateHostsRequest * @ return Result of the AllocateHosts operation returned by the service . * @ sample AmazonEC2 . AllocateHosts * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ec2-2016-11-15 / AllocateHosts " target = " _ top " > AWS API * Documentation < / a > */ @ Override public AllocateHostsResult allocateHosts ( AllocateHostsRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeAllocateHosts ( request ) ;
public class BaseValidator { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public boolean validateModcaString8 ( String modcaString8 , DiagnosticChain diagnostics , Map < Object , Object > context ) { } }
boolean result = validateModcaString8_MinLength ( modcaString8 , diagnostics , context ) ; if ( result || diagnostics != null ) result &= validateModcaString8_MaxLength ( modcaString8 , diagnostics , context ) ; return result ;
public class Parser { /** * Return the biggest common startsWith string * @ param completionList list to compare * @ return biggest common startsWith string */ public static String findStartsWithTerminalString ( List < TerminalString > completionList ) { } }
StringBuilder builder = new StringBuilder ( ) ; for ( TerminalString completion : completionList ) while ( builder . length ( ) < completion . getCharacters ( ) . length ( ) && startsWithTerminalString ( completion . getCharacters ( ) . substring ( 0 , builder . length ( ) + 1 ) , completionList ) ) builder . append ( completion . getCharacters ( ) . charAt ( builder . length ( ) ) ) ; return builder . toString ( ) ;
public class CmsSetupBean { /** * Returns html code to display the errors occurred . < p > * @ param pathPrefix to adjust the path * @ return html code */ public String displayErrors ( String pathPrefix ) { } }
if ( pathPrefix == null ) { pathPrefix = "" ; } StringBuffer html = new StringBuffer ( 512 ) ; html . append ( "<table border='0' cellpadding='5' cellspacing='0' style='width: 100%; height: 100%;'>" ) ; html . append ( "\t<tr>" ) ; html . append ( "\t\t<td style='vertical-align: middle; height: 100%;'>" ) ; html . append ( getHtmlPart ( "C_BLOCK_START" , "Error" ) ) ; html . append ( "\t\t\t<table border='0' cellpadding='0' cellspacing='0' style='width: 100%;'>" ) ; html . append ( "\t\t\t\t<tr>" ) ; html . append ( "\t\t\t\t\t<td><img src='" ) . append ( pathPrefix ) . append ( "resources/error.png' border='0'></td>" ) ; html . append ( "\t\t\t\t\t<td>&nbsp;&nbsp;</td>" ) ; html . append ( "\t\t\t\t\t<td style='width: 100%;'>" ) ; Iterator < String > iter = getErrors ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { String msg = iter . next ( ) ; html . append ( "\t\t\t\t\t\t" ) ; html . append ( msg ) ; html . append ( "<br/>" ) ; } html . append ( "\t\t\t\t\t</td>" ) ; html . append ( "\t\t\t\t</tr>" ) ; html . append ( "\t\t\t</table>" ) ; html . append ( getHtmlPart ( "C_BLOCK_END" ) ) ; html . append ( "\t\t</td>" ) ; html . append ( "\t</tr>" ) ; html . append ( "</table>" ) ; return html . toString ( ) ;
public class AVIMConversationsQuery { /** * 增加查询条件 , 当conversation的属性中对应的字段中的元素包含所有的值才可返回 * @ param key * @ param values * @ return */ public AVIMConversationsQuery whereContainsAll ( String key , Collection < ? > values ) { } }
conditions . whereContainsAll ( key , values ) ; return this ;
public class MtasSolrComponentFacet { /** * ( non - Javadoc ) * @ see * mtas . solr . handler . component . util . MtasSolrComponent # create ( mtas . codec . util . * CodecComponent . BasicComponent , java . lang . Boolean ) */ public SimpleOrderedMap < Object > create ( ComponentFacet facet , Boolean encode ) throws IOException { } }
SimpleOrderedMap < Object > mtasFacetResponse = new SimpleOrderedMap < > ( ) ; mtasFacetResponse . add ( "key" , facet . key ) ; HashMap < MtasDataCollector < ? , ? > , HashMap < String , MtasSolrMtasResult > > functionData = new HashMap < > ( ) ; for ( int i = 0 ; i < facet . baseFields . length ; i ++ ) { if ( facet . baseFunctionList [ i ] != null ) { for ( MtasDataCollector < ? , ? > functionDataCollector : facet . baseFunctionList [ i ] . keySet ( ) ) { SubComponentFunction [ ] tmpSubComponentFunctionList = facet . baseFunctionList [ i ] . get ( functionDataCollector ) ; if ( tmpSubComponentFunctionList != null ) { HashMap < String , MtasSolrMtasResult > tmpList = new HashMap < > ( ) ; for ( SubComponentFunction tmpSubComponentFunction : tmpSubComponentFunctionList ) { tmpList . put ( tmpSubComponentFunction . key , new MtasSolrMtasResult ( tmpSubComponentFunction . dataCollector , tmpSubComponentFunction . dataType , tmpSubComponentFunction . statsType , tmpSubComponentFunction . statsItems , null , null ) ) ; } functionData . put ( functionDataCollector , tmpList ) ; } } } } MtasSolrMtasResult data = new MtasSolrMtasResult ( facet . dataCollector , facet . baseDataTypes , facet . baseStatsTypes , facet . baseStatsItems , null , facet . baseSortTypes , facet . baseSortDirections , null , facet . baseNumbers , functionData ) ; if ( encode ) { mtasFacetResponse . add ( "_encoded_list" , MtasSolrResultUtil . encode ( data ) ) ; } else { mtasFacetResponse . add ( "list" , data ) ; MtasSolrResultUtil . rewrite ( mtasFacetResponse , searchComponent ) ; } return mtasFacetResponse ;
public class SuppressCache { /** * Returns the total count of all values */ public int size ( ) { } }
int count = 0 ; for ( Value val : map . values ( ) ) count += val . count ( ) ; return count ;
public class WCheckBoxSelectExample { /** * Examples of readonly states . */ private void addReadOnlyExamples ( ) { } }
add ( new WHeading ( HeadingLevel . H3 , "Read-only WCheckBoxSelect examples" ) ) ; add ( new ExplanatoryText ( "These examples all use the same list of options: the states and territories list from the editable examples above." + " When the readOnly state is specified only those options which are selected are output." ) ) ; // NOTE : when there are 0 or 1 selections the frame is not rendered . add ( new WHeading ( HeadingLevel . H4 , "Read only with no selection" ) ) ; WCheckBoxSelect select = new WCheckBoxSelect ( "australian_state" ) ; add ( select ) ; select . setReadOnly ( true ) ; select . setToolTip ( "Read only with no selection" ) ; add ( new WText ( "end of unselected read only example" ) ) ; add ( new WHeading ( HeadingLevel . H4 , "Read only with one selection" ) ) ; select = new SelectWithSingleSelected ( "australian_state" ) ; add ( select ) ; select . setReadOnly ( true ) ; select . setToolTip ( "Read only with one selection" ) ; add ( new WHeading ( HeadingLevel . H4 , "Read only with many selections and no frame" ) ) ; select = new SelectWithSingleSelected ( "australian_state" ) ; add ( select ) ; select . setReadOnly ( true ) ; select . setToolTip ( "Read only with many selections" ) ; select . setFrameless ( true ) ; add ( new WHeading ( HeadingLevel . H4 , "Read only with many selections and COLUMN layout" ) ) ; select = new SelectWithSingleSelected ( "australian_state" ) ; add ( select ) ; select . setReadOnly ( true ) ; select . setToolTip ( "Read only with many selections" ) ; select . setButtonLayout ( WCheckBoxSelect . LAYOUT_COLUMNS ) ; select . setButtonColumns ( 3 ) ; // read only in a WFieldLayout add ( new WHeading ( HeadingLevel . H4 , "Read only in a WFieldLayout" ) ) ; add ( new ExplanatoryText ( "Each read only example is preceded by an editable example with the same options and selection. This is to ensure the" + " CSS works properly." ) ) ; WFieldLayout layout = new WFieldLayout ( ) ; layout . setLabelWidth ( 25 ) ; add ( layout ) ; // no selections select = new WCheckBoxSelect ( "australian_state" ) ; select . setFrameless ( true ) ; layout . addField ( "No selections were made" , select ) ; select = new WCheckBoxSelect ( "australian_state" ) ; select . setFrameless ( true ) ; select . setReadOnly ( true ) ; layout . addField ( "No selections were made (read only)" , select ) ; // one selection select = new SelectWithSingleSelected ( "australian_state" ) ; select . setFrameless ( true ) ; layout . addField ( "One selection was made" , select ) ; select = new SelectWithSingleSelected ( "australian_state" ) ; select . setFrameless ( true ) ; select . setReadOnly ( true ) ; layout . addField ( "One selection was made (read only)" , select ) ; // many selections select = new SelectWithManySelected ( "australian_state" ) ; layout . addField ( "Many selections with frame" , select ) ; select = new SelectWithManySelected ( "australian_state" ) ; select . setReadOnly ( true ) ; layout . addField ( "Many selections with frame (read only)" , select ) ; // columns with selections select = new SelectWithSingleSelected ( "australian_state" ) ; select . setButtonLayout ( WCheckBoxSelect . LAYOUT_COLUMNS ) ; select . setButtonColumns ( 3 ) ; select . setFrameless ( true ) ; layout . addField ( "many selections, frameless, COLUMN layout (3 columns)" , select ) ; select = new SelectWithManySelected ( "australian_state" ) ; select . setReadOnly ( true ) ; select . setButtonLayout ( WCheckBoxSelect . LAYOUT_COLUMNS ) ; select . setButtonColumns ( 3 ) ; select . setFrameless ( true ) ; layout . addField ( "many selections, frameless, COLUMN layout (3 columns) (read only)" , select ) ; // flat with selections select = new SelectWithManySelected ( "australian_state" ) ; select . setButtonLayout ( WCheckBoxSelect . LAYOUT_FLAT ) ; select . setFrameless ( true ) ; layout . addField ( "Many selections, frameless, FLAT layout" , select ) ; select = new SelectWithManySelected ( "australian_state" ) ; select . setReadOnly ( true ) ; select . setButtonLayout ( WCheckBoxSelect . LAYOUT_FLAT ) ; select . setFrameless ( true ) ; layout . addField ( "Many selections, frameless, FLAT layout (read only)" , select ) ;
public class ProfilerTimerFilter { /** * Gets the total number of times the method has been called that is represented by the * { @ link IoEventType } * @ param type * The { @ link IoEventType } that the user wants to get the total number of method calls * @ return * The total number of method calls for the method represented by the { @ link IoEventType } */ public long getTotalCalls ( IoEventType type ) { } }
switch ( type ) { case MESSAGE_RECEIVED : if ( profileMessageReceived ) { return messageReceivedTimerWorker . getCallsNumber ( ) ; } break ; case MESSAGE_SENT : if ( profileMessageSent ) { return messageSentTimerWorker . getCallsNumber ( ) ; } break ; case SESSION_CREATED : if ( profileSessionCreated ) { return sessionCreatedTimerWorker . getCallsNumber ( ) ; } break ; case SESSION_OPENED : if ( profileSessionOpened ) { return sessionOpenedTimerWorker . getCallsNumber ( ) ; } break ; case SESSION_IDLE : if ( profileSessionIdle ) { return sessionIdleTimerWorker . getCallsNumber ( ) ; } break ; case SESSION_CLOSED : if ( profileSessionClosed ) { return sessionClosedTimerWorker . getCallsNumber ( ) ; } break ; } throw new IllegalArgumentException ( "You are not monitoring this event. Please add this event first." ) ;
public class FloatingActionButton { /** * Initializes the animation , which is used while showing * < b > Action Button < / b > * @ deprecated since 1.0.2 and will be removed in version 2.0.0. * Use < b > show _ animation < / b > and < b > hide _ animation < / b > in XML instead * @ param attrs attributes of the XML tag that is inflating the view */ @ Deprecated private void initShowAnimation ( TypedArray attrs ) { } }
if ( attrs . hasValue ( R . styleable . ActionButton_animation_onShow ) ) { final int animResId = attrs . getResourceId ( R . styleable . ActionButton_animation_onShow , Animations . NONE . animResId ) ; setShowAnimation ( Animations . load ( getContext ( ) , animResId ) ) ; }
public class Retrospective { /** * A read - only collection of Stories Identified in the Retrospective . * @ param filter filter for getting list of stories . * @ return collection of Stories Identified in the Retrospective . */ public Collection < Story > getIdentifiedStories ( StoryFilter filter ) { } }
filter = ( filter != null ) ? filter : new StoryFilter ( ) ; filter . identifiedIn . clear ( ) ; filter . identifiedIn . add ( this ) ; return getInstance ( ) . get ( ) . story ( filter ) ;
public class CodedConstant { /** * Write object to byte array by { @ link FieldType } . * @ param out the out * @ param order the order * @ param type the type * @ param o the o * @ param list the list * @ param withTag the with tag * @ throws IOException Signals that an I / O exception has occurred . */ public static void writeObject ( CodedOutputStream out , int order , FieldType type , Object o , boolean list , boolean withTag ) throws IOException { } }
if ( o == null ) { return ; } if ( type == FieldType . OBJECT ) { Class cls = o . getClass ( ) ; Codec target = ProtobufProxy . create ( cls ) ; if ( withTag ) { out . writeRawVarint32 ( makeTag ( order , WireFormat . WIRETYPE_LENGTH_DELIMITED ) ) ; } out . writeRawVarint32 ( target . size ( o ) ) ; target . writeTo ( o , out ) ; return ; } if ( type == FieldType . BOOL ) { if ( withTag ) { out . writeBool ( order , ( Boolean ) o ) ; } else { out . writeBoolNoTag ( ( Boolean ) o ) ; } } else if ( type == FieldType . BYTES ) { byte [ ] bb = ( byte [ ] ) o ; if ( withTag ) { out . writeBytes ( order , ByteString . copyFrom ( bb ) ) ; } else { out . writeBytesNoTag ( ByteString . copyFrom ( bb ) ) ; } } else if ( type == FieldType . DOUBLE ) { if ( withTag ) { out . writeDouble ( order , ( Double ) o ) ; } else { out . writeDoubleNoTag ( ( Double ) o ) ; } } else if ( type == FieldType . FIXED32 ) { if ( withTag ) { out . writeFixed32 ( order , ( Integer ) o ) ; } else { out . writeFixed32NoTag ( ( Integer ) o ) ; } } else if ( type == FieldType . FIXED64 ) { if ( withTag ) { out . writeFixed64 ( order , ( Long ) o ) ; } else { out . writeFixed64NoTag ( ( Long ) o ) ; } } else if ( type == FieldType . FLOAT ) { if ( withTag ) { out . writeFloat ( order , ( Float ) o ) ; } else { out . writeFloatNoTag ( ( Float ) o ) ; } } else if ( type == FieldType . INT32 ) { if ( withTag ) { out . writeInt32 ( order , ( Integer ) o ) ; } else { out . writeInt32NoTag ( ( Integer ) o ) ; } } else if ( type == FieldType . INT64 ) { if ( withTag ) { out . writeInt64 ( order , ( Long ) o ) ; } else { out . writeInt64NoTag ( ( Long ) o ) ; } } else if ( type == FieldType . SFIXED32 ) { if ( withTag ) { out . writeSFixed32 ( order , ( Integer ) o ) ; } else { out . writeSFixed32NoTag ( ( Integer ) o ) ; } } else if ( type == FieldType . SFIXED64 ) { if ( withTag ) { out . writeSFixed64 ( order , ( Long ) o ) ; } else { out . writeSFixed64NoTag ( ( Long ) o ) ; } } else if ( type == FieldType . SINT32 ) { if ( withTag ) { out . writeSInt32 ( order , ( Integer ) o ) ; } else { out . writeSInt32NoTag ( ( Integer ) o ) ; } } else if ( type == FieldType . SINT64 ) { if ( withTag ) { out . writeSInt64 ( order , ( Long ) o ) ; } else { out . writeSInt64NoTag ( ( Long ) o ) ; } } else if ( type == FieldType . STRING ) { if ( withTag ) { out . writeBytes ( order , ByteString . copyFromUtf8 ( String . valueOf ( o ) ) ) ; } else { out . writeBytesNoTag ( ByteString . copyFromUtf8 ( String . valueOf ( o ) ) ) ; } } else if ( type == FieldType . UINT32 ) { if ( withTag ) { out . writeUInt32 ( order , ( Integer ) o ) ; } else { out . writeUInt32NoTag ( ( Integer ) o ) ; } } else if ( type == FieldType . UINT64 ) { if ( withTag ) { out . writeUInt64 ( order , ( Long ) o ) ; } else { out . writeUInt64NoTag ( ( Long ) o ) ; } } else if ( type == FieldType . ENUM ) { int value = 0 ; if ( o instanceof EnumReadable ) { value = ( ( EnumReadable ) o ) . value ( ) ; } else if ( o instanceof Enum ) { value = ( ( Enum ) o ) . ordinal ( ) ; } if ( withTag ) { out . writeEnum ( order , value ) ; } else { out . writeEnumNoTag ( value ) ; } }
public class Attributes { /** * Returns an opaque string containing the escaped sequence of the given bytes , * including the initial opaque prefix \ FF . * < br / > * For example the byte array < code > [ 0xCA , 0xFE ] < / code > will be converted into the string * < code > \ FF \ CA \ FE < / code > . * @ param bytes The bytes to escape into an opaque string * @ return the opaque string obtained escaping the given bytes * @ see # opaqueToBytes ( String ) */ public static String bytesToOpaque ( byte [ ] bytes ) { } }
StringBuilder result = new StringBuilder ( ) ; result . append ( OPAQUE_PREFIX ) ; for ( byte aByte : bytes ) { result . append ( ESCAPE ) ; int code = aByte & 0xFF ; if ( code < 16 ) result . append ( "0" ) ; result . append ( Integer . toHexString ( code ) . toUpperCase ( ) ) ; } return result . toString ( ) ;
public class EKBCommit { /** * Adds a collection of models which shall be updated in the EDB . If one of the given objects is not a model , an * IllegalArgumentException is thrown . */ public EKBCommit addUpdates ( Collection < ? > updates ) { } }
if ( updates != null ) { for ( Object update : updates ) { checkIfModel ( update ) ; this . updates . add ( ( OpenEngSBModel ) update ) ; } } return this ;
public class StrictBufferedInputStream { /** * Workaround for an unexpected behavior of ' BufferedInputStream ' ! */ @ Override public int read ( final byte [ ] buffer , final int bufPos , final int length ) throws IOException { } }
int i = super . read ( buffer , bufPos , length ) ; if ( ( i == length ) || ( i == - 1 ) ) return i ; int j = super . read ( buffer , bufPos + i , length - i ) ; if ( j == - 1 ) return i ; return j + i ;
public class FnBigInteger { /** * It performs a module operation and returns the value * of ( input mod module ) which is always positive * ( whereas remainder is not ) * @ param module the module * @ return the result of ( input mod module ) */ public final static Function < BigInteger , BigInteger > module ( short module ) { } }
return new Module ( fromNumber ( Short . valueOf ( module ) ) ) ;
public class FieldType { /** * Return the value of field in the data argument if it is not the default value for the class . If it is the default * then null is returned . */ public < FV > FV getFieldValueIfNotDefault ( Object object ) throws SQLException { } }
@ SuppressWarnings ( "unchecked" ) FV fieldValue = ( FV ) extractJavaFieldValue ( object ) ; if ( isFieldValueDefault ( fieldValue ) ) { return null ; } else { return fieldValue ; }
public class CQLService { /** * Get the { @ link PreparedStatement } for the given { @ link CQLStatementCache . Update } to * the given table name . If needed , the update statement is compiled and cached . * @ param update Update statement type . * @ param storeName Store ( ColumnFamily ) name . * @ return PreparedStatement for requested table / update . */ public PreparedStatement getPreparedUpdate ( Update update , String storeName ) { } }
String tableName = storeToCQLName ( storeName ) ; return m_statementCache . getPreparedUpdate ( tableName , update ) ;
public class ServiceEndpointPoliciesInner { /** * Updates service Endpoint Policies . * @ param resourceGroupName The name of the resource group . * @ param serviceEndpointPolicyName The name of the service endpoint policy . * @ param tags Resource tags . * @ 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 < ServiceEndpointPolicyInner > updateAsync ( String resourceGroupName , String serviceEndpointPolicyName , Map < String , String > tags , final ServiceCallback < ServiceEndpointPolicyInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( updateWithServiceResponseAsync ( resourceGroupName , serviceEndpointPolicyName , tags ) , serviceCallback ) ;
public class PhysicalDatabaseParent { /** * Constructor * @ param mapParams time The default cache review interval . * @ param mapParams prefix The prefix on the physical file name . * @ param mapParams suffix The suffix on the physical file name . * @ param mapParams app The application object ( The application object is used by databases that need information about the location of physical data ) . * @ param mapParams dbclass The class name of the Database to build if not found ( see getPDatabase ( ) ) . */ public void init ( Map < String , Object > mapParams ) { } }
m_htDBList = new Hashtable < Object , PDatabase > ( ) ; m_mapParams = mapParams ; Object strMinutes = this . getProperty ( TIME ) ; int iMinutes = - 1 ; // Default time try { if ( strMinutes instanceof String ) iMinutes = Integer . parseInt ( ( String ) strMinutes ) ; } catch ( NumberFormatException ex ) { iMinutes = - 1 ; } this . setCacheMinutes ( iMinutes ) ;
public class OkHttpChannelBuilder { /** * { @ inheritDoc } * @ since 1.3.0 */ @ Override public OkHttpChannelBuilder keepAliveTimeout ( long keepAliveTimeout , TimeUnit timeUnit ) { } }
Preconditions . checkArgument ( keepAliveTimeout > 0L , "keepalive timeout must be positive" ) ; keepAliveTimeoutNanos = timeUnit . toNanos ( keepAliveTimeout ) ; keepAliveTimeoutNanos = KeepAliveManager . clampKeepAliveTimeoutInNanos ( keepAliveTimeoutNanos ) ; return this ;
public class IdAndNameListBox { /** * fill entries of the listbox . * @ param pentries list of entries */ public final void fillEntryCollections ( final Collection < ? extends IdAndNameBean < T > > pentries ) { } }
this . entries . clear ( ) ; this . entries . addAll ( pentries ) ; clear ( ) ; for ( final IdAndNameBean < T > entry : this . entries ) { this . addItem ( entry . getName ( ) , Objects . toString ( entry . getId ( ) ) ) ; }
public class LdapConnection { /** * Method to create the search results cache , if configured . */ private void createSearchResultsCache ( ) { } }
final String METHODNAME = "createSearchResultsCache" ; if ( iSearchResultsCacheEnabled ) { if ( FactoryManager . getCacheUtil ( ) . isCacheAvailable ( ) ) { iSearchResultsCache = FactoryManager . getCacheUtil ( ) . initialize ( "SearchResultsCache" , iSearchResultsCacheSize , iSearchResultsCacheSize , iSearchResultsCacheTimeOut ) ; if ( iSearchResultsCache != null ) { if ( tc . isDebugEnabled ( ) ) { StringBuilder strBuf = new StringBuilder ( METHODNAME ) ; strBuf . append ( " \nSearch Results Cache: " ) . append ( iSearchResultsCacheName ) . append ( " is enabled:\n" ) ; strBuf . append ( "\tCacheSize: " ) . append ( iSearchResultsCacheSize ) . append ( "\n" ) ; strBuf . append ( "\tCacheTimeOut: " ) . append ( iSearchResultsCacheTimeOut ) . append ( "\n" ) ; strBuf . append ( "\tCacheResultSizeLimit: " ) . append ( iSearchResultSizeLmit ) . append ( "\n" ) ; Tr . debug ( tc , strBuf . toString ( ) ) ; } } } }
public class DeviceAttribute_3DAODefaultImpl { public void insert_ul ( final long [ ] argin ) { } }
final int [ ] values = new int [ argin . length ] ; for ( int i = 0 ; i < argin . length ; i ++ ) { values [ i ] = ( int ) argin [ i ] ; } attrval . r_dim . dim_x = argin . length ; attrval . r_dim . dim_y = 0 ; DevVarULongArrayHelper . insert ( attrval . value , values ) ;
public class Monitors { /** * Create a new timer with a name and context . The returned timer will maintain separate * sub - monitors for each distinct set of tags returned from the context on an update operation . */ public static Timer newTimer ( String name , TaggingContext context ) { } }
return newTimer ( name , TimeUnit . MILLISECONDS , context ) ;
public class PersonGroupPersonsImpl { /** * Create a new person in a specified person group . * @ param personGroupId Id referencing a particular person group . * @ param createOptionalParameter the object representing the optional parameters to be set before calling this API * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws APIErrorException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the Person object if successful . */ public Person create ( String personGroupId , CreatePersonGroupPersonsOptionalParameter createOptionalParameter ) { } }
return createWithServiceResponseAsync ( personGroupId , createOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ;
public class ListRetirableGrantsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListRetirableGrantsRequest listRetirableGrantsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listRetirableGrantsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listRetirableGrantsRequest . getLimit ( ) , LIMIT_BINDING ) ; protocolMarshaller . marshall ( listRetirableGrantsRequest . getMarker ( ) , MARKER_BINDING ) ; protocolMarshaller . marshall ( listRetirableGrantsRequest . getRetiringPrincipal ( ) , RETIRINGPRINCIPAL_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class GenericUtils { /** * Encapsulate the logic to read an entire byte array from the input stream . * @ param in * @ param len * @ return new array read from stream * @ throws IOException */ static public byte [ ] readValue ( ObjectInput in , int len ) throws IOException { } }
int bytesRead = 0 ; byte [ ] data = new byte [ len ] ; for ( int offset = 0 ; offset < len ; offset += bytesRead ) { bytesRead = in . read ( data , offset , len - offset ) ; if ( bytesRead == - 1 ) { throw new IOException ( "Could not retrieve " ) ; } } return data ;
public class RedCardableAssist { public void assertExecuteMethodResponseDefined ( ActionResponse response ) { } }
if ( response . isUndefined ( ) ) { final ExceptionMessageBuilder br = new ExceptionMessageBuilder ( ) ; br . addNotice ( "Cannot return undefined resopnse from the execute method." ) ; br . addItem ( "Advice" ) ; br . addElement ( "Not allowed to return undefined() in execute method." ) ; br . addElement ( "If you want to return response as empty body," ) ; br . addElement ( "use asEmptyBody() like this:" ) ; br . addElement ( " @Execute" ) ; br . addElement ( " public HtmlResponse index() {" ) ; br . addElement ( " return HtmlResponse.asEmptyBody();" ) ; br . addElement ( " }" ) ; br . addItem ( "Action Execute" ) ; br . addElement ( execute ) ; final String msg = br . buildExceptionMessage ( ) ; throw new ExecuteMethodReturnUndefinedResponseException ( msg ) ; }
public class NlpResult { /** * returns a subset of the found entities . * Only entities that are of type < code > T < / code > are returned . T needs to extend the { @ link BaseNlpEntity } . * @ param clazz * the filter class * @ return List of entites , only the filtered elements are returned . */ public < T extends BaseNlpEntity > List < T > getEntities ( Class < T > clazz ) { } }
List < BaseNlpEntity > resultList = new ArrayList < > ( ) ; for ( BaseNlpEntity item : getEntities ( ) ) { if ( item . getClass ( ) . equals ( clazz ) ) { resultList . add ( item ) ; } } return ( List < T > ) resultList ;
public class ConsentDecisionCouchDbRepository { /** * Find all consent decisions for a given principal , service pair . Should only be one . * @ param principal User to search for . * @ param service Service name to search for . * @ return Consent decisions matching the given principal and service names . */ @ View ( name = "by_consent_decision" , map = "function(doc) {emit([doc.principal, doc.service], doc)}" ) public List < CouchDbConsentDecision > findConsentDecision ( final String principal , final String service ) { } }
val view = createQuery ( "by_consent_decision" ) . key ( ComplexKey . of ( principal , service ) ) . includeDocs ( true ) ; return db . queryView ( view , CouchDbConsentDecision . class ) ;
public class MethodParameter { /** * Create a new MethodParameter for the given method or constructor . * This is a convenience constructor for scenarios where a Method or Constructor reference is treated in a generic fashion . * @ param methodOrConstructor the Method or Constructor to specify a parameter for * @ param parameterIndex the index of the parameter * @ return the corresponding MethodParameter instance */ public static MethodParameter forMethodOrConstructor ( Object methodOrConstructor , int parameterIndex ) { } }
if ( methodOrConstructor instanceof Method ) { return new MethodParameter ( ( Method ) methodOrConstructor , parameterIndex ) ; } else if ( methodOrConstructor instanceof Constructor ) { return new MethodParameter ( ( Constructor < ? > ) methodOrConstructor , parameterIndex ) ; } else { throw new IllegalArgumentException ( "Given object [" + methodOrConstructor + "] is neither a Method nor a Constructor" ) ; }
public class ModifyDocumentPermissionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ModifyDocumentPermissionRequest modifyDocumentPermissionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( modifyDocumentPermissionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( modifyDocumentPermissionRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( modifyDocumentPermissionRequest . getPermissionType ( ) , PERMISSIONTYPE_BINDING ) ; protocolMarshaller . marshall ( modifyDocumentPermissionRequest . getAccountIdsToAdd ( ) , ACCOUNTIDSTOADD_BINDING ) ; protocolMarshaller . marshall ( modifyDocumentPermissionRequest . getAccountIdsToRemove ( ) , ACCOUNTIDSTOREMOVE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class HumanName { /** * Returns all of the components of the name ( prefix , given , family , suffix ) as a single string with a single spaced * string separating each part . * If none of the parts are populated , returns the { @ link # getTextElement ( ) text } element value instead . */ public String getNameAsSingleString ( ) { } }
List < StringType > nameParts = new ArrayList < StringType > ( ) ; nameParts . addAll ( getPrefix ( ) ) ; nameParts . addAll ( getGiven ( ) ) ; nameParts . add ( getFamilyElement ( ) ) ; nameParts . addAll ( getSuffix ( ) ) ; if ( nameParts . size ( ) > 0 ) { return joinStringsSpaceSeparated ( nameParts ) ; } else { return getTextElement ( ) . getValue ( ) ; }
public class ClientIOHandler { /** * ( non - Javadoc ) * @ see * org . jboss . netty . channel . SimpleChannelHandler # exceptionCaught ( org . jboss . * netty . channel . ChannelHandlerContext , * org . jboss . netty . channel . ExceptionEvent ) */ public void exceptionCaught ( ChannelHandlerContext ctx , ExceptionEvent e ) throws Exception { } }
Throwable cause = e . getCause ( ) ; // do not print exception if it is BindException . // we are trying to search available port below 1024 . It is not good to // print a flood // of error logs during the searching . if ( cause instanceof java . net . BindException ) { return ; } LOG . error ( "Exception on connection to " + getRemoteAddress ( ) , e . getCause ( ) ) ; // close the channel unless we are connecting and it is // NotYetConnectedException if ( ! ( ( cause instanceof NotYetConnectedException ) && _connection . getConnectionState ( ) . equals ( Connection . State . CONNECTING ) ) ) { ctx . getChannel ( ) . close ( ) ; }
public class CPOptionValuePersistenceImpl { /** * Returns a range of all the cp option values where groupId = & # 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 CPOptionValueModelImpl } . 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 start the lower bound of the range of cp option values * @ param end the upper bound of the range of cp option values ( not inclusive ) * @ return the range of matching cp option values */ @ Override public List < CPOptionValue > findByGroupId ( long groupId , int start , int end ) { } }
return findByGroupId ( groupId , start , end , null ) ;
public class ProxyBuilder { /** * Creates a proxy object out of the specified root object and the specified interfaces * and implementations . * @ return a proxy object that is still of type T but additionally implements all specified * interfaces . * @ throws ProxyException if the proxy could not be created . */ public T build ( ) throws ProxyException { } }
if ( this . root == null ) { throw new IllegalArgumentException ( "root must not be null!" ) ; } if ( this . interfacesToImplementations . isEmpty ( ) ) { // nothing to proxy return this . root ; } try { ProxyMethodHandler methodHandler = new ProxyMethodHandler ( root , interfacesToImplementations ) ; ProxyFactory proxyFactory = new ProxyFactory ( ) ; proxyFactory . setSuperclass ( root . getClass ( ) ) ; proxyFactory . setInterfaces ( interfacesToImplementations . keySet ( ) . toArray ( new Class [ ] { } ) ) ; return ( T ) proxyFactory . create ( new Class [ 0 ] , new Object [ 0 ] , methodHandler ) ; } catch ( Exception e ) { throw new ProxyException ( e ) ; }
public class YarnResourceManager { /** * Converts a Flink application status enum to a YARN application status enum . * @ param status The Flink application status . * @ return The corresponding YARN application status . */ private FinalApplicationStatus getYarnStatus ( ApplicationStatus status ) { } }
if ( status == null ) { return FinalApplicationStatus . UNDEFINED ; } else { switch ( status ) { case SUCCEEDED : return FinalApplicationStatus . SUCCEEDED ; case FAILED : return FinalApplicationStatus . FAILED ; case CANCELED : return FinalApplicationStatus . KILLED ; default : return FinalApplicationStatus . UNDEFINED ; } }
public class ObjectBindingAssert { /** * Verifies that the actual observable has the same value as the given observable . * @ param expectedValue the observable value to compare with the actual observables current value . * @ return { @ code this } assertion instance . */ public ObjectBindingAssert < T > hasSameValue ( ObservableObjectValue < T > expectedValue ) { } }
new ObservableValueAssertions < > ( actual ) . hasSameValue ( expectedValue ) ; return this ;
public class MediaChannel { /** * Enables the channel and activates it ' s resources . */ public void open ( ) { } }
// generate a new unique identifier for the channel this . ssrc = SsrcGenerator . generateSsrc ( ) ; this . statistics . setSsrc ( this . ssrc ) ; this . open = true ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( this . mediaType + " channel " + this . ssrc + " is open" ) ; }
public class VpnGateway { /** * Any VPCs attached to the virtual private gateway . * @ return Any VPCs attached to the virtual private gateway . */ public java . util . List < VpcAttachment > getVpcAttachments ( ) { } }
if ( vpcAttachments == null ) { vpcAttachments = new com . amazonaws . internal . SdkInternalList < VpcAttachment > ( ) ; } return vpcAttachments ;
public class PrintfFormat { /** * Return a substring starting at * < code > start < / code > and ending at either the end * of the String < code > s < / code > , the next unpaired * percent sign , or at the end of the String if the * last character is a percent sign . * @ param s Control string . * @ param start Position in the string * < code > s < / code > to begin looking for the start * of a control string . * @ return the substring from the start position * to the beginning of the control string . */ private String nonControl ( String s , int start ) { } }
m_cPos = s . indexOf ( "%" , start ) ; if ( m_cPos == - 1 ) { m_cPos = s . length ( ) ; } return s . substring ( start , m_cPos ) ;
public class JBossModuleLoader { /** * Get a { @ link ModuleSpec } that was added to this instance * @ param revisionId id to search for * @ return the instance associated with the given revisionIds */ @ Nullable public ModuleSpec getModuleSpec ( ModuleIdentifier revisionId ) { } }
Objects . requireNonNull ( revisionId , "revisionId" ) ; return moduleSpecs . get ( revisionId ) ;
public class Cache2kBuilder { /** * Constructs a cache name out of the class name and field name . Result example : * { @ code com . example . ImagePool . id2Image } * < p > See { @ link # name ( String ) } for a general discussion about cache names . * @ see # name ( String ) */ public final Cache2kBuilder < K , V > name ( Class < ? > _class , String _fieldName ) { } }
if ( _fieldName == null ) { throw new NullPointerException ( ) ; } config ( ) . setName ( _class . getName ( ) + "." + _fieldName ) ; return this ;
public class InternalTextureLoader { /** * Create an empty texture * @ param width The width of the new texture * @ param height The height of the new texture * @ return The created empty texture * @ throws IOException Indicates a failure to create the texture on the graphics hardware */ public Texture createTexture ( final int width , final int height , final int filter ) throws IOException { } }
ImageData ds = new EmptyImageData ( width , height ) ; return getTexture ( ds , filter ) ;
public class BpmnDeployer { /** * It is possible to deploy a process containing a start and intermediate * message event that wait for the same message or to have two processes , one * with a message start event and the other one with a message intermediate * event , that subscribe for the same message . Therefore we have to find out * if there are subscriptions for the other type of event and remove those . * @ param eventSubscription * @ param subscriptionsForSameMessageName */ protected List < EventSubscriptionEntity > filterSubscriptionsOfDifferentType ( EventSubscriptionDeclaration eventSubscription , List < EventSubscriptionEntity > subscriptionsForSameMessageName ) { } }
ArrayList < EventSubscriptionEntity > filteredSubscriptions = new ArrayList < EventSubscriptionEntity > ( subscriptionsForSameMessageName ) ; for ( EventSubscriptionEntity subscriptionEntity : new ArrayList < EventSubscriptionEntity > ( subscriptionsForSameMessageName ) ) { if ( isSubscriptionOfDifferentTypeAsDeclaration ( subscriptionEntity , eventSubscription ) ) { filteredSubscriptions . remove ( subscriptionEntity ) ; } } return filteredSubscriptions ;
public class AnnotationTypeRequiredMemberWriterImpl { /** * { @ inheritDoc } */ public Content getAnnotationDocTreeHeader ( MemberDoc member , Content annotationDetailsTree ) { } }
annotationDetailsTree . addContent ( writer . getMarkerAnchor ( member . name ( ) + ( ( ExecutableMemberDoc ) member ) . signature ( ) ) ) ; Content annotationDocTree = writer . getMemberTreeHeader ( ) ; Content heading = new HtmlTree ( HtmlConstants . MEMBER_HEADING ) ; heading . addContent ( member . name ( ) ) ; annotationDocTree . addContent ( heading ) ; return annotationDocTree ;
public class AbstractDoclet { /** * Generate the class files for single classes specified on the command line . * @ param classtree the data structure representing the class tree . */ private void generateClassFiles ( ClassTree classtree ) { } }
String [ ] packageNames = configuration . classDocCatalog . packageNames ( ) ; for ( int packageNameIndex = 0 ; packageNameIndex < packageNames . length ; packageNameIndex ++ ) { generateClassFiles ( configuration . classDocCatalog . allClasses ( packageNames [ packageNameIndex ] ) , classtree ) ; }
public class Integer { /** * Parses the string argument as an unsigned integer in the radix * specified by the second argument . An unsigned integer maps the * values usually associated with negative numbers to positive * numbers larger than { @ code MAX _ VALUE } . * The characters in the string must all be digits of the * specified radix ( as determined by whether { @ link * java . lang . Character # digit ( char , int ) } returns a nonnegative * value ) , except that the first character may be an ASCII plus * sign { @ code ' + ' } ( { @ code ' \ u005Cu002B ' } ) . The resulting * integer value is returned . * < p > An exception of type { @ code NumberFormatException } is * thrown if any of the following situations occurs : * < ul > * < li > The first argument is { @ code null } or is a string of * length zero . * < li > The radix is either smaller than * { @ link java . lang . Character # MIN _ RADIX } or * larger than { @ link java . lang . Character # MAX _ RADIX } . * < li > Any character of the string is not a digit of the specified * radix , except that the first character may be a plus sign * { @ code ' + ' } ( { @ code ' \ u005Cu002B ' } ) provided that the * string is longer than length 1. * < li > The value represented by the string is larger than the * largest unsigned { @ code int } , 2 < sup > 32 < / sup > - 1. * < / ul > * @ param s the { @ code String } containing the unsigned integer * representation to be parsed * @ param radix the radix to be used while parsing { @ code s } . * @ return the integer represented by the string argument in the * specified radix . * @ throws NumberFormatException if the { @ code String } * does not contain a parsable { @ code int } . * @ since 1.8 */ public static int parseUnsignedInt ( String s , int radix ) throws NumberFormatException { } }
if ( s == null ) { throw new NumberFormatException ( "null" ) ; } int len = s . length ( ) ; if ( len > 0 ) { char firstChar = s . charAt ( 0 ) ; if ( firstChar == '-' ) { throw new NumberFormatException ( String . format ( "Illegal leading minus sign " + "on unsigned string %s." , s ) ) ; } else { if ( len <= 5 || // Integer . MAX _ VALUE in Character . MAX _ RADIX is 6 digits ( radix == 10 && len <= 9 ) ) { // Integer . MAX _ VALUE in base 10 is 10 digits return parseInt ( s , radix ) ; } else { long ell = Long . parseLong ( s , radix ) ; if ( ( ell & 0xffff_ffff_0000_0000L ) == 0 ) { return ( int ) ell ; } else { throw new NumberFormatException ( String . format ( "String value %s exceeds " + "range of unsigned int." , s ) ) ; } } } } else { throw NumberFormatException . forInputString ( s ) ; }
public class PoolablePreparedStatement { /** * Method setBlob . * @ param parameterIndex * @ param inputStream * @ param length * @ throws SQLException * @ see java . sql . PreparedStatement # setBlob ( int , InputStream , long ) */ @ Override public void setBlob ( int parameterIndex , InputStream inputStream , long length ) throws SQLException { } }
internalStmt . setBlob ( parameterIndex , inputStream , length ) ;
public class XAttributeInfoImpl { /** * / * ( non - Javadoc ) * @ see org . deckfour . xes . summary . XAttributeInfo # getAttributesForType ( org . deckfour . xes . model . XAttribute . Type ) */ public Collection < XAttribute > getAttributesForType ( Class < ? extends XAttribute > type ) { } }
Set < XAttribute > typeSet = typeMap . get ( type ) ; if ( typeSet == null ) { typeSet = new HashSet < XAttribute > ( 0 ) ; } return Collections . unmodifiableCollection ( typeSet ) ;
public class SerializedConfigValue { /** * not private because we use it to deserialize ConfigException */ static SimpleConfigOrigin readOrigin ( DataInput in , SimpleConfigOrigin baseOrigin ) throws IOException { } }
Map < SerializedField , Object > m = new EnumMap < SerializedField , Object > ( SerializedField . class ) ; while ( true ) { Object v = null ; SerializedField field = readCode ( in ) ; switch ( field ) { case END_MARKER : return SimpleConfigOrigin . fromBase ( baseOrigin , m ) ; case ORIGIN_DESCRIPTION : in . readInt ( ) ; // discard length v = in . readUTF ( ) ; break ; case ORIGIN_LINE_NUMBER : in . readInt ( ) ; // discard length v = in . readInt ( ) ; break ; case ORIGIN_END_LINE_NUMBER : in . readInt ( ) ; // discard length v = in . readInt ( ) ; break ; case ORIGIN_TYPE : in . readInt ( ) ; // discard length v = in . readUnsignedByte ( ) ; break ; case ORIGIN_URL : in . readInt ( ) ; // discard length v = in . readUTF ( ) ; break ; case ORIGIN_RESOURCE : in . readInt ( ) ; // discard length v = in . readUTF ( ) ; break ; case ORIGIN_COMMENTS : in . readInt ( ) ; // discard length int size = in . readInt ( ) ; List < String > list = new ArrayList < String > ( size ) ; for ( int i = 0 ; i < size ; ++ i ) { list . add ( in . readUTF ( ) ) ; } v = list ; break ; case ORIGIN_NULL_URL : // FALL THRU case ORIGIN_NULL_RESOURCE : // FALL THRU case ORIGIN_NULL_COMMENTS : // nothing to read besides code and length in . readInt ( ) ; // discard length v = "" ; // just something non - null to put in the map break ; case ROOT_VALUE : case ROOT_WAS_CONFIG : case VALUE_DATA : case VALUE_ORIGIN : throw new IOException ( "Not expecting this field here: " + field ) ; case UNKNOWN : // skip unknown field skipField ( in ) ; break ; } if ( v != null ) m . put ( field , v ) ; }
public class Journal { /** * setter for volume - sets The volume number of the journal in which the article was published , O * @ generated * @ param v value to set into the feature */ public void setVolume ( String v ) { } }
if ( Journal_Type . featOkTst && ( ( Journal_Type ) jcasType ) . casFeat_volume == null ) jcasType . jcas . throwFeatMissing ( "volume" , "de.julielab.jules.types.Journal" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Journal_Type ) jcasType ) . casFeatCode_volume , v ) ;
public class SparseWeightedDirectedTypedEdgeSet { /** * { @ inheritDoc } */ public boolean contains ( Object o ) { } }
if ( ! ( o instanceof WeightedDirectedTypedEdge ) ) return false ; @ SuppressWarnings ( "unchecked" ) WeightedDirectedTypedEdge < T > e = ( WeightedDirectedTypedEdge < T > ) o ; if ( e . from ( ) == rootVertex ) { Set < WeightedDirectedTypedEdge < T > > edges = outEdges . get ( e . to ( ) ) ; return edges . contains ( e ) ; } else if ( e . to ( ) == rootVertex ) { Set < WeightedDirectedTypedEdge < T > > edges = inEdges . get ( e . from ( ) ) ; return edges . contains ( e ) ; } return false ;
public class GetStatusPRequest { /** * < code > optional . alluxio . grpc . file . GetStatusPOptions options = 2 ; < / code > */ public alluxio . grpc . GetStatusPOptionsOrBuilder getOptionsOrBuilder ( ) { } }
return options_ == null ? alluxio . grpc . GetStatusPOptions . getDefaultInstance ( ) : options_ ;
public class ChunkedInputStream { /** * Maintain next symbol for current state = State . NORMAL . * @ param state Current state . * @ param line Current chunk size line . * @ param next Next symbol . * @ return New state . */ private static State nextNormal ( final State state , final ByteArrayOutputStream line , final int next ) { } }
final State result ; switch ( next ) { case '\r' : result = State . R ; break ; case '\"' : result = State . QUOTED_STRING ; break ; default : result = state ; line . write ( next ) ; break ; } return result ;
public class PropertiesCoreExtension { /** * Get the number of values for the property * @ param property * property name * @ return number of values */ public int numValues ( String property ) { } }
int count = 0 ; if ( has ( ) ) { TResult result = queryForValues ( property ) ; try { count = result . getCount ( ) ; } finally { result . close ( ) ; } } return count ;
public class ApiOvhIp { /** * Get this object properties * REST : GET / ip / { ip } / arp / { ipBlocked } * @ param ip [ required ] * @ param ipBlocked [ required ] your IP */ public OvhArpBlockedIp ip_arp_ipBlocked_GET ( String ip , String ipBlocked ) throws IOException { } }
String qPath = "/ip/{ip}/arp/{ipBlocked}" ; StringBuilder sb = path ( qPath , ip , ipBlocked ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhArpBlockedIp . class ) ;
public class ApiOvhIp { /** * Get this object properties * REST : GET / ip / { ip } / ripe * @ param ip [ required ] */ public OvhRipeInfos ip_ripe_GET ( String ip ) throws IOException { } }
String qPath = "/ip/{ip}/ripe" ; StringBuilder sb = path ( qPath , ip ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhRipeInfos . class ) ;
public class SynthesisFilter { /** * Calculate 32 PCM samples and put the into the Obuffer - object . */ public void calculate_pcm_samples ( Obuffer buffer ) { } }
compute_new_v ( ) ; compute_pcm_samples ( buffer ) ; actual_write_pos = ( actual_write_pos + 1 ) & 0xf ; actual_v = ( actual_v == v1 ) ? v2 : v1 ; // initialize samples [ ] : // for ( register float * floatp = samples + 32 ; floatp > samples ; ) // * - - floatp = 0.0f ; // MDM : this may not be necessary . The Layer III decoder always // outputs 32 subband samples , but I haven ' t checked layer I & II . for ( int p = 0 ; p < 32 ; p ++ ) samples [ p ] = 0.0f ;
public class HadoopUtil { /** * Parses a string in the format [ filename ] : [ filename2 ] : [ filename3 ] into a String array of filenames * @ param linkedWorkbookString list of filename as one String * @ return String Array containing the filenames as separate Strings */ public static String [ ] parseLinkedWorkbooks ( String linkedWorkbooksString ) { } }
if ( "" . equals ( linkedWorkbooksString ) ) { return new String [ 0 ] ; } // first split by ] : [ String [ ] tempSplit = linkedWorkbooksString . split ( "\\]:\\[" ) ; // 1st case just one filename remove first [ and last ] if ( tempSplit . length == 1 ) { tempSplit [ 0 ] = tempSplit [ 0 ] . substring ( 1 , tempSplit [ 0 ] . length ( ) - 1 ) ; } else if ( tempSplit . length > 1 ) { // 2nd case two or more filenames // remove first [ tempSplit [ 0 ] = tempSplit [ 0 ] . substring ( 1 , tempSplit [ 0 ] . length ( ) ) ; // remove last ] tempSplit [ tempSplit . length - 1 ] = tempSplit [ tempSplit . length - 1 ] . substring ( 0 , tempSplit [ tempSplit . length - 1 ] . length ( ) - 1 ) ; } return tempSplit ;
public class CommerceDiscountUserSegmentRelUtil { /** * Returns the first commerce discount user segment rel in the ordered set where commerceDiscountId = & # 63 ; . * @ param commerceDiscountId the commerce discount ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching commerce discount user segment rel * @ throws NoSuchDiscountUserSegmentRelException if a matching commerce discount user segment rel could not be found */ public static CommerceDiscountUserSegmentRel findByCommerceDiscountId_First ( long commerceDiscountId , OrderByComparator < CommerceDiscountUserSegmentRel > orderByComparator ) throws com . liferay . commerce . discount . exception . NoSuchDiscountUserSegmentRelException { } }
return getPersistence ( ) . findByCommerceDiscountId_First ( commerceDiscountId , orderByComparator ) ;
public class LObjCharPredicateBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */ @ Nonnull public static < T > LObjCharPredicateBuilder < T > objCharPredicate ( Consumer < LObjCharPredicate < T > > consumer ) { } }
return new LObjCharPredicateBuilder ( consumer ) ;
public class OpDef { /** * < pre > * Description of the input ( s ) . * < / pre > * < code > repeated . tensorflow . OpDef . ArgDef input _ arg = 2 ; < / code > */ public org . tensorflow . framework . OpDef . ArgDefOrBuilder getInputArgOrBuilder ( int index ) { } }
return inputArg_ . get ( index ) ;
public class Win32Lnk { /** * Parses a { @ code . lnk } file to find the real file . * @ param pPath the path to the { @ code . lnk } file * @ return a new file object that * @ throws java . io . IOException if the { @ code . lnk } cannot be parsed */ static File parse ( final File pPath ) throws IOException { } }
if ( ! pPath . getName ( ) . endsWith ( ".lnk" ) ) { return pPath ; } File result = pPath ; LittleEndianDataInputStream in = new LittleEndianDataInputStream ( new BufferedInputStream ( new FileInputStream ( pPath ) ) ) ; try { byte [ ] magic = new byte [ 4 ] ; in . readFully ( magic ) ; byte [ ] guid = new byte [ 16 ] ; in . readFully ( guid ) ; if ( ! ( Arrays . equals ( LNK_MAGIC , magic ) && Arrays . equals ( LNK_GUID , guid ) ) ) { // System . out . println ( " Not a symlink " ) ; // Not a symlink return pPath ; } // Get the flags int flags = in . readInt ( ) ; // System . out . println ( " flags : " + Integer . toBinaryString ( flags & 0xff ) ) ; // Get to the file settings /* int attributes = */ in . readInt ( ) ; // File attributes // 0 Target is read only . // 1 Target is hidden . // 2 Target is a system file . // 3 Target is a volume label . ( Not possible ) // 4 Target is a directory . // 5 Target has been modified since last backup . ( archive ) // 6 Target is encrypted ( NTFS EFS ) // 7 Target is Normal ? ? // 8 Target is temporary . // 9 Target is a sparse file . // 10 Target has reparse point data . // 11 Target is compressed . // 12 Target is offline . // System . out . println ( " attributes : " + Integer . toBinaryString ( attributes ) ) ; // NOTE : Cygwin . lnks are not directory links , can ' t rely on this . . : - / in . skipBytes ( 48 ) ; // TODO : Make sense of this data . . . // Skipped data : // long time 1 ( creation ) // long time 2 ( modification ) // long time 3 ( last access ) // int file length // int icon number // int ShowVnd value // int hotkey // int , int - unknown : 0,0 // If the shell settings are present , skip them if ( ( flags & FLAG_ITEM_ID_LIST ) != 0 ) { // Shell Item Id List present // System . out . println ( " Shell Item Id List present " ) ; int shellLen = in . readShort ( ) ; // Short // System . out . println ( " shellLen : " + shellLen ) ; // TODO : Probably need to parse this data , to determine // Cygwin folders . . . /* int read = 2; int itemLen = in . readShort ( ) ; while ( itemLen > 0 ) { System . out . println ( " - - > ITEM : " + itemLen ) ; BufferedReader reader = new BufferedReader ( new InputStreamReader ( new SubStream ( in , itemLen - 2 ) ) ) ; / / byte [ ] itemBytes = new byte [ itemLen - 2 ] ; / / NOTE : Lenght included / / in . readFully ( itemBytes ) ; String item = reader . readLine ( ) ; System . out . println ( " item : \ " " + item + " \ " " ) ; itemLen = in . readShort ( ) ; read + = itemLen ; System . out . println ( " read : " + read ) ; */ in . skipBytes ( shellLen ) ; } if ( ( flags & FLAG_FILE_LOC_INFO ) != 0 ) { // File Location Info Table present // System . out . println ( " File Location Info Table present " ) ; // 0h 1 dword This is the total length of this structure and all following data // 4h 1 dword This is a pointer to first offset after this structure . 1Ch // 8h 1 dword Flags // Ch 1 dword Offset of local volume info // 10h 1 dword Offset of base pathname on local system // 14h 1 dword Offset of network volume info // 18h 1 dword Offset of remaining pathname // Flags : // Bit Meaning // 0 Available on a local volume // 1 Available on a network share // TODO : Make sure the path is on a local disk , etc . . int tableLen = in . readInt ( ) ; // Int // System . out . println ( " tableLen : " + tableLen ) ; in . readInt ( ) ; // Skip int locFlags = in . readInt ( ) ; // System . out . println ( " locFlags : " + Integer . toBinaryString ( locFlags ) ) ; if ( ( locFlags & 0x01 ) != 0 ) { // System . out . println ( " Available local " ) ; } if ( ( locFlags & 0x02 ) != 0 ) { // System . err . println ( " Available on network path " ) ; } // Get the local volume and local system values in . skipBytes ( 4 ) ; // TODO : see above for structure int localSysOff = in . readInt ( ) ; // System . out . println ( " localSysOff : " + localSysOff ) ; in . skipBytes ( localSysOff - 20 ) ; // Relative to start of chunk byte [ ] pathBytes = new byte [ tableLen - localSysOff - 1 ] ; in . readFully ( pathBytes , 0 , pathBytes . length ) ; String path = new String ( pathBytes , 0 , pathBytes . length - 1 ) ; /* ByteArrayOutputStream bytes = new ByteArrayOutputStream ( ) ; byte read ; / / Read bytes until the null ( 0 ) character while ( true ) { read = in . readByte ( ) ; if ( read = = 0 ) { break ; bytes . write ( read & 0xff ) ; String path = new String ( bytes . toByteArray ( ) , 0 , bytes . size ( ) ) ; */ // Recurse to end of link chain // TODO : This may cause endless loop if cyclic chain . . . // System . out . println ( " path : \ " " + path + " \ " " ) ; try { result = parse ( new File ( path ) ) ; } catch ( StackOverflowError e ) { throw new IOException ( "Cannot resolve cyclic link: " + e . getMessage ( ) ) ; } } if ( ( flags & FLAG_DESC_STRING ) != 0 ) { // Description String present , skip it . // System . out . println ( " Description String present " ) ; // The string length is the first word which must also be skipped . int descLen = in . readShort ( ) ; // System . out . println ( " descLen : " + descLen ) ; byte [ ] descBytes = new byte [ descLen ] ; in . readFully ( descBytes , 0 , descLen ) ; // String desc = new String ( descBytes , 0 , descLen ) ; // System . out . println ( " desc : " + desc ) ; } if ( ( flags & FLAG_REL_PATH_STRING ) != 0 ) { // Relative Path String present // System . out . println ( " Relative Path String present " ) ; // The string length is the first word which must also be skipped . int pathLen = in . readShort ( ) ; // System . out . println ( " pathLen : " + pathLen ) ; byte [ ] pathBytes = new byte [ pathLen ] ; in . readFully ( pathBytes , 0 , pathLen ) ; String path = new String ( pathBytes , 0 , pathLen ) ; // TODO : This may cause endless loop if cyclic chain . . . // System . out . println ( " path : \ " " + path + " \ " " ) ; if ( result == pPath ) { try { result = parse ( new File ( pPath . getParentFile ( ) , path ) ) ; } catch ( StackOverflowError e ) { throw new IOException ( "Cannot resolve cyclic link: " + e . getMessage ( ) ) ; } } } if ( ( flags & FLAG_WORKING_DIRECTORY ) != 0 ) { // System . out . println ( " Working Directory present " ) ; } if ( ( flags & FLAG_COMMAND_LINE_ARGS ) != 0 ) { // System . out . println ( " Command Line Arguments present " ) ; // NOTE : This means this . lnk is not a folder , don ' t follow result = pPath ; } if ( ( flags & FLAG_ICON_FILENAME ) != 0 ) { // System . out . println ( " Icon Filename present " ) ; } if ( ( flags & FLAG_ADDITIONAL_INFO ) != 0 ) { // System . out . println ( " Additional Info present " ) ; } } finally { in . close ( ) ; } return result ;
public class JavaClass { /** * Returns the matching method */ public JMethod getMethod ( String name , JClass [ ] paramTypes ) { } }
loop : for ( JMethod method : getMethods ( ) ) { if ( ! method . getName ( ) . equals ( name ) ) continue ; JClass [ ] mParamTypes = method . getParameterTypes ( ) ; if ( mParamTypes . length != paramTypes . length ) continue ; for ( int i = 0 ; i < paramTypes . length ; i ++ ) { if ( ! paramTypes [ i ] . getName ( ) . equals ( mParamTypes [ i ] . getName ( ) ) ) continue loop ; } return method ; } return null ;
public class CompressedForest { /** * Fetches trees from DKV and converts to a node - local structure . * @ return fetched trees */ public final LocalCompressedForest fetch ( ) { } }
int ntrees = _treeKeys . length ; CompressedTree [ ] [ ] trees = new CompressedTree [ ntrees ] [ ] ; for ( int t = 0 ; t < ntrees ; t ++ ) { Key [ ] treek = _treeKeys [ t ] ; trees [ t ] = new CompressedTree [ treek . length ] ; for ( int i = 0 ; i < treek . length ; i ++ ) if ( treek [ i ] != null ) trees [ t ] [ i ] = DKV . get ( treek [ i ] ) . get ( ) ; } return new LocalCompressedForest ( trees , _domains ) ;