signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class DateUtils { /** * 比较两个时间相差多少分钟 */
public static long getDiffMinutes ( Date d1 , Date d2 ) { } } | long diffSeconds = getDiffSeconds ( d1 , d2 ) ; return diffSeconds / 60 ; |
public class CalendarPanel { /** * getLastDayOfMonth , This returns the last day of the month for the specified year and month .
* Implementation notes : As of this writing , the below implementation is verified to work
* correctly for negative years , as those years are to defined in the iso 8601 your format that
* is used by java . time . YearMonth . This functionality can be tested by by checking to see if to
* see if the year " - 0004 " is correctly displayed as a leap year . Leap years have 29 days in
* February . There should be 29 days in the month of " February 1 , - 0004 " . */
private int getLastDayOfMonth ( YearMonth yearMonth ) { } } | LocalDate firstDayOfMonth = LocalDate . of ( yearMonth . getYear ( ) , yearMonth . getMonth ( ) , 1 ) ; int lastDayOfMonth = firstDayOfMonth . lengthOfMonth ( ) ; return lastDayOfMonth ; |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EEnum getUSCBYPSIDEN ( ) { } } | if ( uscbypsidenEEnum == null ) { uscbypsidenEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 76 ) ; } return uscbypsidenEEnum ; |
public class SquareGridTools { /** * Finds the side which intersects the line segment from the center of target to center of node */
protected int findIntersection ( SquareNode target , SquareNode node ) { } } | lineCenters . a = target . center ; lineCenters . b = node . center ; for ( int i = 0 ; i < 4 ; i ++ ) { int j = ( i + 1 ) % 4 ; lineSide . a = target . square . get ( i ) ; lineSide . b = target . square . get ( j ) ; if ( Intersection2D_F64 . intersection ( lineCenters , lineSide , dummy ) != null ) { return i ; } } return - 1 ; |
public class ChannelFrameworkImpl { /** * Get the number of chains that are currently using this channel in the
* runtime
* which are in the STARTED state .
* @ param channelName
* @ return number of chains in STARTED state */
public synchronized int getNumStartedChainsUsingChannel ( String channelName ) { } } | int numStartedChains = 0 ; ChannelContainer channelContainer = this . channelRunningMap . get ( channelName ) ; if ( null != channelContainer ) { for ( Chain chain : channelContainer . getChainMap ( ) . values ( ) ) { if ( chain . getState ( ) == RuntimeState . STARTED ) { numStartedChains ++ ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getNumStartedChainsUsingChannel: " + channelName + "=" + numStartedChains ) ; } return numStartedChains ; |
public class CatalystSerializableSerializer { /** * Reads an object reference .
* @ param type The reference type .
* @ param buffer The reference buffer .
* @ param serializer The serializer with which the object is being read .
* @ return The reference to read . */
@ SuppressWarnings ( "unchecked" ) private T readReference ( Class < T > type , BufferInput < ? > buffer , Serializer serializer ) { } } | ReferencePool < ? > pool = pools . get ( type ) ; if ( pool == null ) { Constructor < ? > constructor = constructorMap . get ( type ) ; if ( constructor == null ) { try { constructor = type . getDeclaredConstructor ( ReferenceManager . class ) ; constructor . setAccessible ( true ) ; constructorMap . put ( type , constructor ) ; } catch ( NoSuchMethodException e ) { throw new SerializationException ( "failed to instantiate reference: must provide a single argument constructor" , e ) ; } } pool = new ReferencePool < > ( createFactory ( constructor ) ) ; pools . put ( type , pool ) ; } T object = ( T ) pool . acquire ( ) ; object . readObject ( buffer , serializer ) ; return object ; |
public class FctBnEntitiesProcessors { /** * < p > Get PrcEntityFfolDelete ( create and put into map ) . < / p >
* @ return requested PrcEntityFfolDelete
* @ throws Exception - an exception */
protected final PrcEntityFfolDelete < RS , IHasId < Object > , Object > createPutPrcEntityFfolDelete ( ) throws Exception { } } | PrcEntityFfolDelete < RS , IHasId < Object > , Object > proc = new PrcEntityFfolDelete < RS , IHasId < Object > , Object > ( ) ; proc . setSrvOrm ( getSrvOrm ( ) ) ; proc . setGettersRapiHolder ( getGettersRapiHolder ( ) ) ; // assigning fully initialized object :
this . processorsMap . put ( PrcEntityFfolDelete . class . getSimpleName ( ) , proc ) ; return proc ; |
public class SpiderPanel { /** * Gets the label storing the name of the count of added URIs .
* @ return the found count name label */
private JLabel getAddedCountNameLabel ( ) { } } | if ( addedCountNameLabel == null ) { addedCountNameLabel = new JLabel ( ) ; addedCountNameLabel . setText ( Constant . messages . getString ( "spider.toolbar.added.label" ) ) ; } return addedCountNameLabel ; |
public class EmailTemplateRendererService { /** * transforms plain text into HTML by
* < ul >
* < li > escaping HTML entities
* < li > converting URLs to & lt ; a href & gt ; tags
* < li > converting linebreaks to & lt ; br & gt ;
* < li > surrounding the text with a valid HTML4 markup
* < / ul >
* @ param text the plain text to convert
* @ return a HTMLified version of the text */
public String textToHtml ( final String text ) { } } | String escaped = HtmlUtil . escapeToHtml ( text ) ; Matcher matcher = URL_TO_HTML_HREF_PATTERN . matcher ( escaped ) ; escaped = matcher . replaceAll ( "<a href=\"$0\">$0</a>" ) ; matcher = NEWLINE_TO_BR_PATTERN . matcher ( escaped ) ; escaped = matcher . replaceAll ( "<br />" ) ; return "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">" + "\n" + "<html><head>" + "\n" + "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />" + "\n" + "</head><body>" + "\n" + escaped + "\n" + "</body></html>" + "\n" ; |
public class ProjectsInner { /** * Get project information .
* The project resource is a nested resource representing a stored migration project . The GET method retrieves information about a project .
* @ param groupName Name of the resource group
* @ param serviceName Name of the service
* @ param projectName Name of the project
* @ 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 ProjectInner object if successful . */
public ProjectInner get ( String groupName , String serviceName , String projectName ) { } } | return getWithServiceResponseAsync ( groupName , serviceName , projectName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class AbstractUndoableCommand { /** * { @ inheritDoc } */
@ Override protected void perform ( final Wave wave ) throws CommandException { } } | // Get the undo / redo flag to know which action to perform
if ( wave . contains ( UndoRedoWaves . UNDO_REDO ) ) { // The flag is true perform undo action
if ( wave . get ( UndoRedoWaves . UNDO_REDO ) ) { undo ( ) ; } else { // The flag is false perform redo action
redo ( ) ; } } else { // If the flag is not set we must initialize the command
init ( wave ) ; // Get existing wave data
final List < WaveData < ? > > data = wave . waveDatas ( ) ; // and add the undoable command
data . add ( WBuilder . waveData ( UndoRedoWaves . UNDOABLE_COMMAND , this ) ) ; // in order to register it into the right command stack
callCommand ( StackUpCommand . class , data . toArray ( new WaveDataBase [ data . size ( ) ] ) ) ; } |
public class ExtractUtil { /** * Return the response codes as String from a JavaDoc comment block .
* @ param jdoc The javadoc block comment .
* @ return the response codes as String */
public static List < String > extractResponseCodes ( JavadocComment jdoc ) { } } | List < String > list = new ArrayList < > ( ) ; list . addAll ( extractDocAnnotation ( DOC_RESPONSE_CODE , jdoc ) ) ; return list ; |
public class HttpOutboundServiceContextImpl { /** * @ see
* com . ibm . ws . http . channel . internal . HttpServiceContextImpl # createChunkTrailer */
@ Override protected WsByteBuffer createChunkTrailer ( ) { } } | if ( ! getLink ( ) . isReconnectAllowed ( ) ) { // use the " shared " chunk trailer object
return super . createChunkTrailer ( ) ; } // if reconnects are allowed , then these buffers must be unique
// per chunk , otherwise we get data corruption
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "OSC creating chunk trailer" ) ; } WsByteBuffer buffer = allocateBuffer ( 32 ) ; buffer . put ( CHUNK_TRAILER_DATA ) ; buffer . flip ( ) ; return buffer ; |
public class CmsJlanUsers { /** * Translates user names by replacing a custom OU separator with the standard OU separator ' / ' .
* This is needed because either JLAN or the client cuts off the part before the slash during authentication ,
* so OpenCms never gets to see it . So if we want CIFS authentication for users from non - root OUs , we need to use
* a different separator . < p >
* @ param name the user name to translate
* @ return the translated user name */
public static final String translateUser ( String name ) { } } | String ouSeparator = ( String ) ( OpenCms . getRuntimeProperty ( PARAM_JLAN_OU_SEPARATOR ) ) ; if ( ouSeparator == null ) { ouSeparator = DEFAULT_OU_SEPARATOR ; } String result = name ; result = result . replace ( ouSeparator , "/" ) ; return result ; |
public class PgPreparedStatement { /** * This stores an Object into a parameter . */
public void setObject ( int parameterIndex , Object x ) throws SQLException { } } | checkClosed ( ) ; if ( x == null ) { setNull ( parameterIndex , Types . OTHER ) ; } else if ( x instanceof UUID && connection . haveMinimumServerVersion ( ServerVersion . v8_3 ) ) { setUuid ( parameterIndex , ( UUID ) x ) ; } else if ( x instanceof SQLXML ) { setSQLXML ( parameterIndex , ( SQLXML ) x ) ; } else if ( x instanceof String ) { setString ( parameterIndex , ( String ) x ) ; } else if ( x instanceof BigDecimal ) { setBigDecimal ( parameterIndex , ( BigDecimal ) x ) ; } else if ( x instanceof Short ) { setShort ( parameterIndex , ( Short ) x ) ; } else if ( x instanceof Integer ) { setInt ( parameterIndex , ( Integer ) x ) ; } else if ( x instanceof Long ) { setLong ( parameterIndex , ( Long ) x ) ; } else if ( x instanceof Float ) { setFloat ( parameterIndex , ( Float ) x ) ; } else if ( x instanceof Double ) { setDouble ( parameterIndex , ( Double ) x ) ; } else if ( x instanceof byte [ ] ) { setBytes ( parameterIndex , ( byte [ ] ) x ) ; } else if ( x instanceof java . sql . Date ) { setDate ( parameterIndex , ( java . sql . Date ) x ) ; } else if ( x instanceof Time ) { setTime ( parameterIndex , ( Time ) x ) ; } else if ( x instanceof Timestamp ) { setTimestamp ( parameterIndex , ( Timestamp ) x ) ; } else if ( x instanceof Boolean ) { setBoolean ( parameterIndex , ( Boolean ) x ) ; } else if ( x instanceof Byte ) { setByte ( parameterIndex , ( Byte ) x ) ; } else if ( x instanceof Blob ) { setBlob ( parameterIndex , ( Blob ) x ) ; } else if ( x instanceof Clob ) { setClob ( parameterIndex , ( Clob ) x ) ; } else if ( x instanceof Array ) { setArray ( parameterIndex , ( Array ) x ) ; } else if ( x instanceof PGobject ) { setPGobject ( parameterIndex , ( PGobject ) x ) ; } else if ( x instanceof Character ) { setString ( parameterIndex , ( ( Character ) x ) . toString ( ) ) ; // # if mvn . project . property . postgresql . jdbc . spec > = " JDBC4.2"
} else if ( x instanceof LocalDate ) { setDate ( parameterIndex , ( LocalDate ) x ) ; } else if ( x instanceof LocalTime ) { setTime ( parameterIndex , ( LocalTime ) x ) ; } else if ( x instanceof LocalDateTime ) { setTimestamp ( parameterIndex , ( LocalDateTime ) x ) ; } else if ( x instanceof OffsetDateTime ) { setTimestamp ( parameterIndex , ( OffsetDateTime ) x ) ; // # endif
} else if ( x instanceof Map ) { setMap ( parameterIndex , ( Map < ? , ? > ) x ) ; } else if ( x instanceof Number ) { setNumber ( parameterIndex , ( Number ) x ) ; } else if ( PrimitiveArraySupport . isSupportedPrimitiveArray ( x ) ) { setPrimitiveArray ( parameterIndex , x ) ; } else { // Can ' t infer a type .
throw new PSQLException ( GT . tr ( "Can''t infer the SQL type to use for an instance of {0}. Use setObject() with an explicit Types value to specify the type to use." , x . getClass ( ) . getName ( ) ) , PSQLState . INVALID_PARAMETER_TYPE ) ; } |
public class PeerReplicationResource { /** * Process batched replication events from peer eureka nodes .
* The batched events are delegated to underlying resources to generate a
* { @ link ReplicationListResponse } containing the individual responses to the batched events
* @ param replicationList
* The List of replication events from peer eureka nodes
* @ return A batched response containing the information about the responses of individual events */
@ Path ( "batch" ) @ POST public Response batchReplication ( ReplicationList replicationList ) { } } | try { ReplicationListResponse batchResponse = new ReplicationListResponse ( ) ; for ( ReplicationInstance instanceInfo : replicationList . getReplicationList ( ) ) { try { batchResponse . addResponse ( dispatch ( instanceInfo ) ) ; } catch ( Exception e ) { batchResponse . addResponse ( new ReplicationInstanceResponse ( Status . INTERNAL_SERVER_ERROR . getStatusCode ( ) , null ) ) ; logger . error ( "{} request processing failed for batch item {}/{}" , instanceInfo . getAction ( ) , instanceInfo . getAppName ( ) , instanceInfo . getId ( ) , e ) ; } } return Response . ok ( batchResponse ) . build ( ) ; } catch ( Throwable e ) { logger . error ( "Cannot execute batch Request" , e ) ; return Response . status ( Status . INTERNAL_SERVER_ERROR ) . build ( ) ; } |
public class XAssignmentImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case XbasePackage . XASSIGNMENT__ASSIGNABLE : return getAssignable ( ) ; case XbasePackage . XASSIGNMENT__VALUE : return getValue ( ) ; case XbasePackage . XASSIGNMENT__EXPLICIT_STATIC : return isExplicitStatic ( ) ; case XbasePackage . XASSIGNMENT__STATIC_WITH_DECLARING_TYPE : return isStaticWithDeclaringType ( ) ; } return super . eGet ( featureID , resolve , coreType ) ; |
public class GetBlockingUsers { /** * Usage : java twitter4j . examples . block . GetBlockingUsers
* @ param args message */
public static void main ( String [ ] args ) { } } | try { Twitter twitter = new TwitterFactory ( ) . getInstance ( ) ; int page = 1 ; List < User > users ; do { users = twitter . getBlocksList ( page ) ; for ( User user : users ) { System . out . println ( "@" + user . getScreenName ( ) ) ; } page ++ ; // this code ends up in an infinite loop due to the issue 1988
// http : / / code . google . com / p / twitter - api / issues / detail ? id = 1988
} while ( users . size ( ) > 0 && page <= 10 ) ; System . out . println ( "done." ) ; System . exit ( 0 ) ; } catch ( TwitterException te ) { te . printStackTrace ( ) ; System . out . println ( "Failed to get blocking users: " + te . getMessage ( ) ) ; System . exit ( - 1 ) ; } |
public class UCharacter { /** * Determines if the specified code point may be any part of a Unicode
* identifier other than the starting character .
* A code point may be part of a Unicode identifier if and only if it is
* one of the following :
* < ul >
* < li > Lu Uppercase letter
* < li > Ll Lowercase letter
* < li > Lt Titlecase letter
* < li > Lm Modifier letter
* < li > Lo Other letter
* < li > Nl Letter number
* < li > Pc Connecting punctuation character
* < li > Nd decimal number
* < li > Mc Spacing combining mark
* < li > Mn Non - spacing mark
* < li > Cf formatting code
* < / ul >
* Up - to - date Unicode implementation of
* java . lang . Character . isUnicodeIdentifierPart ( ) . < br >
* See < a href = http : / / www . unicode . org / unicode / reports / tr8 / > UTR # 8 < / a > .
* @ param ch code point to determine if is can be part of a Unicode
* identifier
* @ return true if code point is any character belonging a unicode
* identifier suffix after the first character */
public static boolean isUnicodeIdentifierPart ( int ch ) { } } | // if props = = 0 , it will just fall through and return false
// cat = = format
return ( ( 1 << getType ( ch ) ) & ( ( 1 << UCharacterCategory . UPPERCASE_LETTER ) | ( 1 << UCharacterCategory . LOWERCASE_LETTER ) | ( 1 << UCharacterCategory . TITLECASE_LETTER ) | ( 1 << UCharacterCategory . MODIFIER_LETTER ) | ( 1 << UCharacterCategory . OTHER_LETTER ) | ( 1 << UCharacterCategory . LETTER_NUMBER ) | ( 1 << UCharacterCategory . CONNECTOR_PUNCTUATION ) | ( 1 << UCharacterCategory . DECIMAL_DIGIT_NUMBER ) | ( 1 << UCharacterCategory . COMBINING_SPACING_MARK ) | ( 1 << UCharacterCategory . NON_SPACING_MARK ) ) ) != 0 || isIdentifierIgnorable ( ch ) ; |
public class WebDriverLikeCommandExecutor { /** * send the request to the remote server for execution . */
public < T > T execute ( WebDriverLikeRequest request ) { } } | Response response = null ; long total = 0 ; try { HttpClient client = newHttpClientWithTimeout ( ) ; String url = remoteURL + request . getPath ( ) ; BasicHttpEntityEnclosingRequest r = new BasicHttpEntityEnclosingRequest ( request . getMethod ( ) , url ) ; if ( request . hasPayload ( ) ) { r . setEntity ( new StringEntity ( request . getPayload ( ) . toString ( ) , "UTF-8" ) ) ; } HttpHost h = new HttpHost ( remoteURL . getHost ( ) , remoteURL . getPort ( ) ) ; long start = System . currentTimeMillis ( ) ; HttpResponse res = client . execute ( h , r ) ; total = System . currentTimeMillis ( ) - start ; response = Helper . exctractResponse ( res ) ; } catch ( Exception e ) { throw new WebDriverException ( e ) ; } response = errorHandler . throwIfResponseFailed ( response , total ) ; try { return cast ( response . getValue ( ) ) ; } catch ( ClassCastException e ) { log . warning ( e . getMessage ( ) + " for " + response . getValue ( ) ) ; throw e ; } |
public class TimeUtil { /** * Tests if a given instant is aligned with the execution times of a { @ link Schedule } .
* @ param instant The instant to test
* @ param schedule The schedule to test against
* @ return true if the given instant aligns with the schedule */
public static boolean isAligned ( Instant instant , Schedule schedule ) { } } | // executionTime . isMatch ignores seconds for unix cron
// so we fail the check immediately if there is a sub - minute value
if ( ! instant . truncatedTo ( ChronoUnit . MINUTES ) . equals ( instant ) ) { return false ; } final ExecutionTime executionTime = ExecutionTime . forCron ( cron ( schedule ) ) ; final ZonedDateTime utcDateTime = instant . atZone ( UTC ) ; return executionTime . isMatch ( utcDateTime ) ; |
public class GenericMinMaxValidatorTag { /** * This method returns the Validator , you have to cast it to the correct type and apply the min and max values .
* @ return
* @ throws JspException */
@ Override protected Validator createValidator ( ) throws JspException { } } | if ( null == _minimum && null == _maximum ) { throw new JspException ( "a minimum and / or a maximum have to be specified" ) ; } ELContext elContext = FacesContext . getCurrentInstance ( ) . getELContext ( ) ; if ( null != _minimum ) { _min = getValue ( _minimum . getValue ( elContext ) ) ; } if ( null != _maximum ) { _max = getValue ( _maximum . getValue ( elContext ) ) ; } if ( null != _minimum && null != _maximum ) { if ( ! isMinLTMax ( ) ) { throw new JspException ( "maximum limit must be greater than the minimum limit" ) ; } } return super . createValidator ( ) ; |
public class ByteUtils { /** * Converts a byte array to a { @ link RubyArray } of Byte .
* @ param bytes
* a byte array
* @ return { @ link RubyArray } of Byte */
public static RubyArray < Byte > toList ( byte [ ] bytes ) { } } | RubyArray < Byte > list = Ruby . Array . create ( ) ; for ( byte b : bytes ) { list . add ( b ) ; } return list ; |
public class JobValidator { /** * Validate the Job ' s added Linux capabilities .
* @ param job The Job to check .
* @ return A set of error Strings */
private Set < String > validateAddCapabilities ( final Job job ) { } } | final Set < String > caps = job . getAddCapabilities ( ) ; if ( caps == null ) { return emptySet ( ) ; } final Set < String > errors = Sets . newHashSet ( ) ; final Set < String > disallowedCaps = Sets . difference ( caps , whitelistedCapabilities ) ; if ( ! disallowedCaps . isEmpty ( ) ) { errors . add ( String . format ( "The following Linux capabilities aren't allowed by the Helios master: '%s'. " + "The allowed capabilities are: '%s'." , Joiner . on ( ", " ) . join ( disallowedCaps ) , Joiner . on ( ", " ) . join ( whitelistedCapabilities ) ) ) ; } return errors ; |
public class RemoteResourceIndex { /** * do an HTTP request , plus parse the result into an XML DOM */
protected Document getHttpDocument ( String url ) throws IOException , SAXException { } } | URL u = new URL ( url ) ; URLConnection conn = u . openConnection ( ) ; conn . setConnectTimeout ( connectTimeout ) ; conn . setReadTimeout ( readTimeout ) ; return ( getDocumentBuilder ( ) ) . parse ( conn . getInputStream ( ) , url ) ; |
public class base_resource { /** * Use this method to perform a any post operation . . . etc
* operation on MPS resource .
* @ param service nitro _ service object .
* @ return status of the operation performed .
* @ throws Exception API exception is thrown . */
public base_resource [ ] perform_operation ( nitro_service service ) throws Exception { } } | if ( ! service . isLogin ( ) && ! get_object_type ( ) . equals ( "login" ) ) service . login ( ) ; return post_request ( service , null ) ; |
public class ResultIterator { /** * ( non - Javadoc )
* @ see java . util . Iterator # next ( ) */
@ Override public E next ( ) { } } | if ( current != null && checkOnEmptyResult ( ) && current . equals ( results . get ( results . size ( ) - 1 ) ) ) { hasNext ( ) ; } if ( scrollComplete ) { throw new NoSuchElementException ( "Nothing to scroll further for:" + entityMetadata . getEntityClazz ( ) ) ; } E lastFetchedEntity = getEntity ( results . get ( results . size ( ) - 1 ) ) ; start = lastFetchedEntity != null ? idValueInByteArr ( ) : null ; current = getEntity ( results . get ( results . size ( ) - 1 ) ) ; return current ; |
public class ConstantSize { /** * Creates and returns a ConstantSize from the given encoded size and unit description .
* @ param encodedValueAndUnit the size ' s value and unit as string , trimmed and in lower case
* @ param horizontaltrue for horizontal , false for vertical
* @ return a constant size for the given encoding and unit description
* @ throws IllegalArgumentException if the unit requires integer but the value is not an integer */
static ConstantSize valueOf ( String encodedValueAndUnit , boolean horizontal ) { } } | String [ ] split = ConstantSize . splitValueAndUnit ( encodedValueAndUnit ) ; String encodedValue = split [ 0 ] ; String encodedUnit = split [ 1 ] ; Unit unit = Unit . valueOf ( encodedUnit , horizontal ) ; double value = Double . parseDouble ( encodedValue ) ; if ( unit . requiresIntegers ) { checkArgument ( value == ( int ) value , "%s value %s must be an integer." , unit , encodedValue ) ; } return new ConstantSize ( value , unit ) ; |
public class StaticWord2Vec { /** * Words nearest based on positive and negative words
* PLEASE NOTE : This method is not available in this implementation .
* @ param positive the positive words
* @ param negative the negative words
* @ param top the top n words
* @ return the words nearest the mean of the words */
@ Override public Collection < String > wordsNearestSum ( Collection < String > positive , Collection < String > negative , int top ) { } } | throw new UnsupportedOperationException ( "Method isn't implemented. Please use usual Word2Vec implementation" ) ; |
public class DeviceSecretVerifierConfigTypeMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeviceSecretVerifierConfigType deviceSecretVerifierConfigType , ProtocolMarshaller protocolMarshaller ) { } } | if ( deviceSecretVerifierConfigType == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deviceSecretVerifierConfigType . getPasswordVerifier ( ) , PASSWORDVERIFIER_BINDING ) ; protocolMarshaller . marshall ( deviceSecretVerifierConfigType . getSalt ( ) , SALT_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class ApiOvhPrice { /** * Get price of dedicated Cloud hourly filer ressources
* REST : GET / price / dedicatedCloud / 2018v2 / rbx2a / infrastructure / filer / hourly / { filerProfile }
* @ param filerProfile [ required ] type of the hourly ressources you want to order */
public OvhPrice dedicatedCloud_2018v2_rbx2a_infrastructure_filer_hourly_filerProfile_GET ( net . minidev . ovh . api . price . dedicatedcloud . _2018v2 . rbx2a . infrastructure . filer . OvhHourlyEnum filerProfile ) throws IOException { } } | String qPath = "/price/dedicatedCloud/2018v2/rbx2a/infrastructure/filer/hourly/{filerProfile}" ; StringBuilder sb = path ( qPath , filerProfile ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhPrice . class ) ; |
public class JmesPathEvaluationVisitor { /** * Evaluate the expressions as per the given comparison
* operator .
* @ param op JmesPath comparison operator type
* @ param input Input json node against which evaluation is done
* @ return Result of the comparison */
@ Override public JsonNode visit ( Comparator op , JsonNode input ) { } } | JsonNode lhsNode = op . getLhsExpr ( ) . accept ( this , input ) ; JsonNode rhsNode = op . getRhsExpr ( ) . accept ( this , input ) ; if ( op . matches ( lhsNode , rhsNode ) ) { return BooleanNode . TRUE ; } return BooleanNode . FALSE ; |
public class HttpServerOperations { /** * There is no need of invoking { @ link # discard ( ) } , the inbound will
* be canceled on channel inactive event if there is no subscriber available
* @ param err the { @ link Throwable } cause */
@ Override protected void onOutboundError ( Throwable err ) { } } | if ( ! channel ( ) . isActive ( ) ) { super . onOutboundError ( err ) ; return ; } if ( markSentHeaders ( ) ) { log . error ( format ( channel ( ) , "Error starting response. Replying error status" ) , err ) ; HttpResponse response = new DefaultFullHttpResponse ( HttpVersion . HTTP_1_1 , HttpResponseStatus . INTERNAL_SERVER_ERROR ) ; response . headers ( ) . setInt ( HttpHeaderNames . CONTENT_LENGTH , 0 ) . set ( HttpHeaderNames . CONNECTION , HttpHeaderValues . CLOSE ) ; channel ( ) . writeAndFlush ( response ) . addListener ( ChannelFutureListener . CLOSE ) ; return ; } markSentBody ( ) ; log . error ( format ( channel ( ) , "Error finishing response. Closing connection" ) , err ) ; channel ( ) . writeAndFlush ( EMPTY_BUFFER ) . addListener ( ChannelFutureListener . CLOSE ) ; |
public class ESRIFileUtil { /** * Generate a shape file index ( . shx ) from an ESRI shape file ( . shp ) .
* @ param shapeFile is the ESRI shape file .
* @ return the index filename .
* @ throws IOException when invalid conversion . */
@ Pure public static URL generateShapeFileIndexFromShapeFile ( File shapeFile ) throws IOException { } } | final File shxFile = FileSystem . replaceExtension ( shapeFile , "." + ShapeFileIndexFilter . EXTENSION_SHX ) ; // $ NON - NLS - 1 $
try ( ShapeFileReader < Object > shpReader = new ShapeFileReader < > ( shapeFile , new NullFactory ( ) ) ) { try ( ShapeFileIndexWriter shxWriter = new ShapeFileIndexWriter ( shxFile , shpReader . getShapeElementType ( ) , shpReader . getBoundsFromHeader ( ) ) ) { int offset = shpReader . getFileReadingPosition ( ) ; int newOffset ; int shpLength ; while ( shpReader . read ( ) != null ) { newOffset = shpReader . getFileReadingPosition ( ) ; // byte length - file header length - record header length
shpLength = newOffset - offset ; shxWriter . write ( shpLength ) ; offset = newOffset ; } } } return shxFile . toURI ( ) . toURL ( ) ; |
public class DeviceManager { /** * Open an RFCOMM socket to the Bluetooth device .
* The device may or may not actually exist , the argument is just a
* reference to it . */
private BluetoothSocket setupSocket ( BluetoothDevice device ) throws BluetoothException { } } | if ( device == null ) { Log . w ( TAG , "Can't setup socket -- device is null" ) ; throw new BluetoothException ( ) ; } Log . d ( TAG , "Scanning services on " + device ) ; BluetoothSocket socket ; try { socket = device . createRfcommSocketToServiceRecord ( RFCOMM_UUID ) ; } catch ( IOException e ) { String error = "Unable to open a socket to device " + device ; Log . w ( TAG , error ) ; throw new BluetoothException ( error , e ) ; } return socket ; |
public class FatDirectoryEntry { /** * Sets the startCluster .
* @ param startCluster The startCluster to set */
void setStartCluster ( long startCluster ) { } } | if ( startCluster > Integer . MAX_VALUE ) throw new AssertionError ( ) ; if ( this . type == FatType . FAT32 ) { LittleEndian . setInt16 ( data , 0x1a , ( int ) ( startCluster & 0xffff ) ) ; LittleEndian . setInt16 ( data , 0x14 , ( int ) ( ( startCluster >> 16 ) & 0xffff ) ) ; } else { LittleEndian . setInt16 ( data , 0x1a , ( int ) startCluster ) ; } |
public class PayMchAPI { /** * 查询红包记录 < br >
* 用于商户对已发放的红包进行查询红包的具体信息 , 可支持普通红包和裂变包 。
* @ since 2.8.5
* @ param gethbinfo gethbinfo
* @ param key key
* @ return GethbinfoResult */
public static GethbinfoResult mmpaymkttransfersGethbinfo ( Gethbinfo gethbinfo , String key ) { } } | Map < String , String > map = MapUtil . objectToMap ( gethbinfo ) ; String sign = SignatureUtil . generateSign ( map , gethbinfo . getSign_type ( ) , key ) ; gethbinfo . setSign ( sign ) ; String secapiPayRefundXML = XMLConverUtil . convertToXML ( gethbinfo ) ; HttpUriRequest httpUriRequest = RequestBuilder . post ( ) . setHeader ( xmlHeader ) . setUri ( baseURI ( ) + "/mmpaymkttransfers/gethbinfo" ) . setEntity ( new StringEntity ( secapiPayRefundXML , Charset . forName ( "utf-8" ) ) ) . build ( ) ; return LocalHttpClient . keyStoreExecuteXmlResult ( gethbinfo . getMch_id ( ) , httpUriRequest , GethbinfoResult . class , gethbinfo . getSign_type ( ) , key ) ; |
public class Consumers { /** * yields all elements of the iterator ( in a list ) .
* @ param < E > the iterator element type
* @ param iterator the iterator that will be consumed
* @ return a list filled with iterator values */
public static < E > List < E > all ( Iterator < E > iterator ) { } } | final Function < Iterator < E > , ArrayList < E > > consumer = new ConsumeIntoCollection < > ( new ArrayListFactory < E > ( ) ) ; return consumer . apply ( iterator ) ; |
public class Heatmap { /** * 设置gradientColors值
* @ param gradientColors */
public Heatmap gradientColors ( Object ... gradientColors ) { } } | if ( gradientColors == null || gradientColors . length == 0 ) { return this ; } this . gradientColors ( ) . addAll ( Arrays . asList ( gradientColors ) ) ; return this ; |
public class TagService { /** * Read the tag structure from the provided stream . */
public void readTags ( InputStream tagsXML ) { } } | SAXParserFactory factory = SAXParserFactory . newInstance ( ) ; try { SAXParser saxParser = factory . newSAXParser ( ) ; saxParser . parse ( tagsXML , new TagsSaxHandler ( this ) ) ; } catch ( ParserConfigurationException | SAXException | IOException ex ) { throw new RuntimeException ( "Failed parsing the tags definition: " + ex . getMessage ( ) , ex ) ; } |
public class ThemeUtil { /** * Obtains the boolean value , which corresponds to a specific resource id , from a context ' s
* theme .
* @ param context
* The context , which should be used , as an instance of the class { @ link Context } . The
* context may not be null
* @ param resourceId
* The resource id of the attribute , which should be obtained , as an { @ link Integer }
* value . The resource id must corresponds to a valid theme attribute
* @ param defaultValue
* The default value , which should be returned , if the given resource id is invalid , as
* a { @ link Boolean } value
* @ return The boolean value , which has been obtained , as an { @ link Boolean } value or false , if
* the given resource id is invalid */
public static boolean getBoolean ( @ NonNull final Context context , @ AttrRes final int resourceId , final boolean defaultValue ) { } } | return getBoolean ( context , - 1 , resourceId , defaultValue ) ; |
public class JobEnableOptions { /** * Set a timestamp indicating the last modified time of the resource known to the client . The operation will be performed only if the resource on the service has not been modified since the specified time .
* @ param ifUnmodifiedSince the ifUnmodifiedSince value to set
* @ return the JobEnableOptions object itself . */
public JobEnableOptions withIfUnmodifiedSince ( DateTime ifUnmodifiedSince ) { } } | if ( ifUnmodifiedSince == null ) { this . ifUnmodifiedSince = null ; } else { this . ifUnmodifiedSince = new DateTimeRfc1123 ( ifUnmodifiedSince ) ; } return this ; |
public class Equ { /** * evaluate .
* @ return a { @ link java . lang . Object } object .
* @ throws java . lang . Exception if any . */
public Object evaluate ( ) throws Exception { } } | final ValueStack values = new ValueStack ( ) ; if ( rpn == null ) return null ; if ( variablesThatExistedBeforePreviousEvaluation != null ) for ( final String varName : getSupport ( ) . getVariableNames ( ) ) { if ( variablesThatExistedBeforePreviousEvaluation . contains ( varName ) ) continue ; getSupport ( ) . removeVariable ( varName ) ; } /* * Save variable names that exist before the equation . If the equation
* assigns values to variables then they will be new names . */
variablesThatExistedBeforePreviousEvaluation = getSupport ( ) . getVariableNames ( ) ; for ( final Iterator < EquPart > parts = rpn . iterator ( ) ; parts . hasNext ( ) ; ) { final EquPart part = parts . next ( ) ; part . setEqu ( this ) ; part . resolve ( values ) ; } if ( values . isEmpty ( ) ) return null ; final Object result = values . firstElement ( ) ; values . clear ( ) ; return result ; |
public class OBOOntology { /** * Given a set of IDs , return a set that contains all of the IDs , the
* children of those IDs , the grandchildren , etc .
* @ param s
* The initial " seed " ID .
* @ return The full set of IDs . */
public Set < String > getIdsForIdWithDescendants ( String s ) { } } | buildIsTypeOf ( ) ; Stack < String > idsToConsider = new Stack < String > ( ) ; idsToConsider . add ( s ) ; Set < String > resultIds = new HashSet < String > ( ) ; while ( ! idsToConsider . isEmpty ( ) ) { String id = idsToConsider . pop ( ) ; if ( ! resultIds . contains ( id ) ) { resultIds . add ( id ) ; if ( terms . containsKey ( id ) ) idsToConsider . addAll ( terms . get ( id ) . getIsTypeOf ( ) ) ; } } return resultIds ; |
public class CertificatesInner { /** * Retrieve the certificate identified by certificate name .
* @ param resourceGroupName Name of an Azure Resource group .
* @ param automationAccountName The name of the automation account .
* @ param certificateName The name of certificate .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the CertificateInner object */
public Observable < CertificateInner > getAsync ( String resourceGroupName , String automationAccountName , String certificateName ) { } } | return getWithServiceResponseAsync ( resourceGroupName , automationAccountName , certificateName ) . map ( new Func1 < ServiceResponse < CertificateInner > , CertificateInner > ( ) { @ Override public CertificateInner call ( ServiceResponse < CertificateInner > response ) { return response . body ( ) ; } } ) ; |
public class Assert { /** * Formats the specified { @ link String message } containing possible placeholders as defined by { @ link MessageFormat } .
* @ param message { @ link String } containing the message to format .
* @ param arguments array of { @ link Object arguments } used when formatting the { @ link String message } .
* @ return the { @ link String message } formatted with the { @ link Object arguments } .
* @ see java . text . MessageFormat # format ( String , Object . . . ) */
private static String messageFormat ( String message , Object ... arguments ) { } } | return ( arguments == null ? message : MessageFormat . format ( message , arguments ) ) ; |
public class Record { /** * Retains only the properties specified , clearing the remaining ones . Note that the ID is not
* affected .
* @ param properties
* an array with the properties to retain , possibly empty ( in which case all the
* stored properties will be cleared )
* @ return this record object , for call chaining */
public synchronized Record retain ( final URI ... properties ) { } } | for ( final URI property : doGetProperties ( ) ) { boolean retain = false ; for ( int i = 0 ; i < properties . length ; ++ i ) { if ( property . equals ( properties [ i ] ) ) { retain = true ; break ; } } if ( ! retain ) { doSet ( property , ImmutableSet . < Object > of ( ) ) ; } } return this ; |
public class OMVRBTree { /** * From CLR */
protected void rotateLeft ( final OMVRBTreeEntry < K , V > p ) { } } | if ( p != null ) { OMVRBTreeEntry < K , V > r = p . getRight ( ) ; p . setRight ( r . getLeft ( ) ) ; if ( r . getLeft ( ) != null ) r . getLeft ( ) . setParent ( p ) ; r . setParent ( p . getParent ( ) ) ; if ( p . getParent ( ) == null ) setRoot ( r ) ; else if ( p . getParent ( ) . getLeft ( ) == p ) p . getParent ( ) . setLeft ( r ) ; else p . getParent ( ) . setRight ( r ) ; p . setParent ( r ) ; r . setLeft ( p ) ; } |
public class BarPlot { /** * Calculate bar width and position . */
private void init ( ) { } } | width = Double . MAX_VALUE ; for ( int i = 1 ; i < data . length ; i ++ ) { double w = Math . abs ( data [ i ] [ 0 ] - data [ i - 1 ] [ 0 ] ) ; if ( width > w ) { width = w ; } } leftTop = new double [ data . length ] [ 2 ] ; rightTop = new double [ data . length ] [ 2 ] ; leftBottom = new double [ data . length ] [ 2 ] ; rightBottom = new double [ data . length ] [ 2 ] ; for ( int i = 0 ; i < data . length ; i ++ ) { leftTop [ i ] [ 0 ] = data [ i ] [ 0 ] - width / 2 ; leftTop [ i ] [ 1 ] = data [ i ] [ 1 ] ; rightTop [ i ] [ 0 ] = data [ i ] [ 0 ] + width / 2 ; rightTop [ i ] [ 1 ] = data [ i ] [ 1 ] ; leftBottom [ i ] [ 0 ] = data [ i ] [ 0 ] - width / 2 ; leftBottom [ i ] [ 1 ] = 0 ; rightBottom [ i ] [ 0 ] = data [ i ] [ 0 ] + width / 2 ; rightBottom [ i ] [ 1 ] = 0 ; } |
public class ByteCodeClassScanner { /** * Parses a field entry . */
private void scanField ( InputStream is ) throws IOException { } } | // int accessFlags = readShort ( ) ;
// int nameIndex = readShort ( ) ;
// int descriptorIndex = readShort ( ) ;
is . skip ( 6 ) ; int attributesCount = readShort ( is ) ; for ( int i = 0 ; i < attributesCount ; i ++ ) { scanAttributeForAnnotation ( is ) ; } |
public class GenericExtendedSet { /** * { @ inheritDoc } */
@ SuppressWarnings ( "unchecked" ) @ Override public boolean remove ( Object o ) { } } | if ( elements instanceof List < ? > ) { try { final List < T > l = ( List < T > ) elements ; int pos = Collections . binarySearch ( l , ( T ) o ) ; if ( pos < 0 ) return false ; l . remove ( pos ) ; return true ; } catch ( ClassCastException e ) { return false ; } } return elements . remove ( o ) ; |
public class OffsetGroup { /** * Returns whether , for all offsets present in both groups , this { @ code OffsetGroup } ' s
* offset { @ link Offset # precedesOrEquals ( Offset ) } the other ' s . */
public boolean precedesOrEqualsForAllOffsetTypesInBoth ( final OffsetGroup other ) { } } | return charOffset ( ) . precedesOrEquals ( other . charOffset ( ) ) && edtOffset ( ) . precedesOrEquals ( other . edtOffset ( ) ) && ( ! byteOffset ( ) . isPresent ( ) || ! other . byteOffset ( ) . isPresent ( ) || byteOffset ( ) . get ( ) . precedesOrEquals ( other . byteOffset ( ) . get ( ) ) ) && ( ! asrTime ( ) . isPresent ( ) || ! other . asrTime ( ) . isPresent ( ) || asrTime ( ) . get ( ) . precedesOrEquals ( other . asrTime ( ) . get ( ) ) ) ; |
public class X509Factory { /** * Parses the data in the given input stream as a sequence of DER
* encoded X . 509 certificates ( in binary or base 64 encoded format ) OR
* as a single PKCS # 7 encoded blob ( in binary or base64 encoded format ) . */
private Collection < ? extends java . security . cert . Certificate > parseX509orPKCS7Cert ( InputStream is ) throws CertificateException , IOException { } } | Collection < X509CertImpl > coll = new ArrayList < > ( ) ; byte [ ] data = readOneBlock ( is ) ; if ( data == null ) { return new ArrayList < > ( 0 ) ; } try { PKCS7 pkcs7 = new PKCS7 ( data ) ; X509Certificate [ ] certs = pkcs7 . getCertificates ( ) ; // certs are optional in PKCS # 7
if ( certs != null ) { return Arrays . asList ( certs ) ; } else { // no crls provided
return new ArrayList < > ( 0 ) ; } } catch ( ParsingException e ) { while ( data != null ) { coll . add ( new X509CertImpl ( data ) ) ; data = readOneBlock ( is ) ; } } return coll ; |
public class ChunkListener { /** * Calls { @ link IBlockListener . Pre # onBlockSet ( net . minecraft . world . World , BlockPos , BlockPos , IBlockState , IBlockState ) } for the listener
* { @ link BlockPos } .
* @ param chunk the chunk
* @ param listener the listener
* @ param modified the modified
* @ param oldState the old state
* @ param newState the new state
* @ return true , if successful */
public boolean callPreListener ( Chunk chunk , BlockPos listener , BlockPos modified , IBlockState oldState , IBlockState newState ) { } } | IBlockListener . Pre bl = IComponent . getComponent ( IBlockListener . Pre . class , chunk . getWorld ( ) . getBlockState ( listener ) . getBlock ( ) ) ; return bl . onBlockSet ( chunk . getWorld ( ) , listener , modified , oldState , newState ) ; |
public class ProfilePackageWriterImpl { /** * { @ inheritDoc } */
public void addClassesSummary ( ClassDoc [ ] classes , String label , String tableSummary , String [ ] tableHeader , Content packageSummaryContentTree ) { } } | HtmlTree li = new HtmlTree ( HtmlTag . LI ) ; li . addStyle ( HtmlStyle . blockList ) ; addClassesSummary ( classes , label , tableSummary , tableHeader , li , profileValue ) ; packageSummaryContentTree . addContent ( li ) ; |
public class ApplicationVersion { /** * Installs the XML update scripts of the schema definitions for this
* version defined in { @ link # number } .
* @ param _ install install instance with all cached XML definitions
* @ param _ latestVersionNumber latest version number ( defined in the
* version . xml file )
* @ param _ profiles profiles to be applied
* @ param _ userName name of logged in user
* @ param _ password password of logged in user
* @ throws InstallationException on error */
public void install ( final Install _install , final long _latestVersionNumber , final Set < Profile > _profiles , final String _userName , final String _password ) throws InstallationException { } } | // reload cache if needed
if ( this . reloadCacheNeeded ) { this . application . reloadCache ( ) ; } try { // start transaction ( with user name if needed )
if ( this . loginNeeded ) { Context . begin ( _userName ) ; } else { Context . begin ( ) ; } _install . install ( this . number , _latestVersionNumber , _profiles , this . ignoredSteps ) ; // commit transaction
Context . commit ( ) ; // execute all scripts
for ( final AbstractScript script : this . scripts ) { script . execute ( _userName , _password ) ; } // Compile esjp ' s in the database ( if the compile flag is set ) .
if ( this . compile ) { this . application . compileAll ( _userName , true ) ; } } catch ( final EFapsException e ) { throw new InstallationException ( "error in Context" , e ) ; } |
public class PropertiesUtils { /** * Returns properties by given path . < br >
* e . g : < br >
* " testFolder / propertiesName " or " testFolder / propertiesName . properties "
* @ param propertiesPath
* the properties path .
* @ return properties by given path .
* @ throws PropertiesException */
public static Properties getProperties ( final String propertiesPath ) throws PropertiesException { } } | Properties properties ; String propertiesFilePath = getPropertiesFilePath ( propertiesPath ) ; if ( propertiesFilePath == null ) { throw new PropertiesException ( String . format ( "Loading '%s' properties failed, no such properties." , propertiesPath ) ) ; } FileInputStream fileInputStream = null ; try { properties = new Properties ( ) ; fileInputStream = new FileInputStream ( propertiesFilePath ) ; properties . load ( fileInputStream ) ; fileInputStream . close ( ) ; return properties ; } catch ( Exception e ) { try { if ( fileInputStream != null ) fileInputStream . close ( ) ; } catch ( IOException e1 ) { e1 . printStackTrace ( ) ; } throw new PropertiesException ( String . format ( "Loading '%s' properties failed." , propertiesPath ) , e ) ; } |
public class AbstractReplicatorConfiguration { /** * Sets a filter object for validating whether the documents can be pulled from the
* remote endpoint . Only documents for which the object returns true are replicated .
* @ param pullFilter The filter to filter the document to be pulled .
* @ return The self object . */
@ NonNull public ReplicatorConfiguration setPullFilter ( ReplicationFilter pullFilter ) { } } | if ( readonly ) { throw new IllegalStateException ( "ReplicatorConfiguration is readonly mode." ) ; } this . pullFilter = pullFilter ; return getReplicatorConfiguration ( ) ; |
public class PlayerStatsService { /** * Retrieve post - game stats for a team
* @ param teamId The id of the team
* @ param gameId The if of the game
* @ return Post - game stats */
public EndOfGameStats getTeamEndOfGameStats ( TeamId teamId , long gameId ) { } } | return client . sendRpcAndWait ( SERVICE , "getTeamEndOfGameStats" , teamId , gameId ) ; |
public class DataIO { /** * Create a CSTable from a URL source .
* @ param url the table URL
* @ param name the name of the table
* @ return a new CSTable
* @ throws IOException */
public static CSTable table ( URL url , String name ) throws IOException { } } | return new URLTable ( url , name ) ; |
public class UploadFile { /** * Upload file with AutoIT .
* Use only this : button . upload ( " C : \ \ text . txt " ) ;
* @ param filePath e . g . " " C : \ \ text . txt "
* @ return true | false */
@ Override public boolean upload ( String filePath ) { } } | WebLocator upload = new WebLocator ( this ) . setTag ( "input" ) . setType ( "file" ) ; return upload ( upload , filePath ) ; |
public class VersionsImpl { /** * Creates a new version using the current snapshot of the selected application version .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param cloneOptionalParameter the object representing the optional parameters to be set before calling this API
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the String object */
public Observable < ServiceResponse < String > > cloneWithServiceResponseAsync ( UUID appId , String versionId , CloneOptionalParameter cloneOptionalParameter ) { } } | if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( appId == null ) { throw new IllegalArgumentException ( "Parameter appId is required and cannot be null." ) ; } if ( versionId == null ) { throw new IllegalArgumentException ( "Parameter versionId is required and cannot be null." ) ; } final String version = cloneOptionalParameter != null ? cloneOptionalParameter . version ( ) : null ; return cloneWithServiceResponseAsync ( appId , versionId , version ) ; |
public class Token { /** * Give back the current token if there is already one known to the
* Object Store for the same ManagedObject .
* @ return Token already known to the ObjectStore . */
protected Token current ( ) { } } | final String methodName = "current" ; Token currentToken ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName + toString ( ) ) ; currentToken = objectStore . like ( this ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName , new Object [ ] { currentToken , Integer . toHexString ( currentToken . hashCode ( ) ) } ) ; return currentToken ; |
public class AbstractParser { /** * Method used to get Transaction counter
* @ return the number of card transaction
* @ throws CommunicationException communication error */
protected int getTransactionCounter ( ) throws CommunicationException { } } | int ret = UNKNOW ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Get Transaction Counter ATC" ) ; } byte [ ] data = template . get ( ) . getProvider ( ) . transceive ( new CommandApdu ( CommandEnum . GET_DATA , 0x9F , 0x36 , 0 ) . toBytes ( ) ) ; if ( ResponseUtils . isSucceed ( data ) ) { // Extract ATC
byte [ ] val = TlvUtil . getValue ( data , EmvTags . APP_TRANSACTION_COUNTER ) ; if ( val != null ) { ret = BytesUtils . byteArrayToInt ( val ) ; } } return ret ; |
public class InputGate { /** * Reads a record from one of the associated input channels . Channels are read such that one buffer from a channel is
* consecutively consumed . The buffers in turn are consumed in the order in which they arrive .
* Note that this method is not guaranteed to return a record , because the currently available channel data may not always
* constitute an entire record , when events or partial records are part of the data .
* When called even though no data is available , this call will block until data is available , so this method should be called
* when waiting is desired ( such as when synchronously consuming a single gate ) or only when it is known that data is available
* ( such as when reading a union of multiple input gates ) .
* @ param target The record object into which to construct the complete record .
* @ return The result indicating whether a complete record is available , a event is available , only incomplete data
* is available ( NONE ) , or the gate is exhausted .
* @ throws IOException Thrown when an error occurred in the network stack relating to this channel .
* @ throws InterruptedException Thrown , when the thread working on this channel is interrupted . */
public InputChannelResult readRecord ( T target ) throws IOException , InterruptedException { } } | if ( this . channelToReadFrom == - 1 ) { if ( this . isClosed ( ) ) { return InputChannelResult . END_OF_STREAM ; } if ( Thread . interrupted ( ) ) { throw new InterruptedException ( ) ; } this . channelToReadFrom = waitForAnyChannelToBecomeAvailable ( ) ; } InputChannelResult result = this . getInputChannel ( this . channelToReadFrom ) . readRecord ( target ) ; switch ( result ) { case INTERMEDIATE_RECORD_FROM_BUFFER : // full record and we can stay on the same channel
return InputChannelResult . INTERMEDIATE_RECORD_FROM_BUFFER ; case LAST_RECORD_FROM_BUFFER : // full record , but we must switch the channel afterwards
this . channelToReadFrom = - 1 ; return InputChannelResult . LAST_RECORD_FROM_BUFFER ; case END_OF_SUPERSTEP : this . channelToReadFrom = - 1 ; return InputChannelResult . END_OF_SUPERSTEP ; case TASK_EVENT : // task event
this . currentEvent = this . getInputChannel ( this . channelToReadFrom ) . getCurrentEvent ( ) ; this . channelToReadFrom = - 1 ; // event always marks a unit as consumed
return InputChannelResult . TASK_EVENT ; case NONE : // internal event or an incomplete record that needs further chunks
// the current unit is exhausted
this . channelToReadFrom = - 1 ; return InputChannelResult . NONE ; case END_OF_STREAM : // channel is done
this . channelToReadFrom = - 1 ; return isClosed ( ) ? InputChannelResult . END_OF_STREAM : InputChannelResult . NONE ; default : // silence the compiler
throw new RuntimeException ( ) ; } |
public class AffineTransformation { /** * Simple linear ( symmetric ) scaling .
* @ param scale Scaling factor */
public void addScaling ( double scale ) { } } | // invalidate inverse
inv = null ; // Note : last ROW is not included .
for ( int i = 0 ; i < dim ; i ++ ) { for ( int j = 0 ; j <= dim ; j ++ ) { trans [ i ] [ j ] = trans [ i ] [ j ] * scale ; } } // As long as relative vectors aren ' t used , this would also work :
// trans [ dim ] [ dim ] = trans [ dim ] [ dim ] / scale ; |
public class HTTP2Session { /** * This method is called when receiving a GO _ AWAY from the other peer .
* We check the close state to act appropriately :
* < ul >
* < li > NOT _ CLOSED : we move to REMOTELY _ CLOSED and queue a disconnect , so
* that the content of the queue is written , and then the connection
* closed . We notify the application after being terminated .
* See < code > HTTP2Session . ControlEntry # succeeded ( ) < / code > < / li >
* < li > In all other cases , we do nothing since other methods are already
* performing their actions . < / li >
* < / ul >
* @ param frame the GO _ AWAY frame that has been received .
* @ see # close ( int , String , Callback )
* @ see # onShutdown ( )
* @ see # onIdleTimeout ( ) */
@ Override public void onGoAway ( final GoAwayFrame frame ) { } } | if ( log . isDebugEnabled ( ) ) { log . debug ( "Received {}" , frame . toString ( ) ) ; } while ( true ) { CloseState current = closed . get ( ) ; switch ( current ) { case NOT_CLOSED : { if ( closed . compareAndSet ( current , CloseState . REMOTELY_CLOSED ) ) { // We received a GO _ AWAY , so try to write
// what ' s in the queue and then disconnect .
notifyClose ( this , frame , new DisconnectCallback ( ) ) ; return ; } break ; } default : { if ( log . isDebugEnabled ( ) ) { log . debug ( "Ignored {}, already closed" , frame . toString ( ) ) ; } return ; } } } |
public class CodeDeliveryDetailsTypeMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CodeDeliveryDetailsType codeDeliveryDetailsType , ProtocolMarshaller protocolMarshaller ) { } } | if ( codeDeliveryDetailsType == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( codeDeliveryDetailsType . getDestination ( ) , DESTINATION_BINDING ) ; protocolMarshaller . marshall ( codeDeliveryDetailsType . getDeliveryMedium ( ) , DELIVERYMEDIUM_BINDING ) ; protocolMarshaller . marshall ( codeDeliveryDetailsType . getAttributeName ( ) , ATTRIBUTENAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class ImageMotionPtkSmartRespawn { /** * Computes an axis - aligned rectangle that contains all the inliers . It then computes the area contained in
* that rectangle to the total area of the image
* @ param imageArea width * height */
private void computeContainment ( int imageArea ) { } } | // mark that the track is in the inlier set and compute the containment rectangle
contRect . x0 = contRect . y0 = Double . MAX_VALUE ; contRect . x1 = contRect . y1 = - Double . MAX_VALUE ; for ( AssociatedPair p : motion . getModelMatcher ( ) . getMatchSet ( ) ) { Point2D_F64 t = p . p2 ; if ( t . x > contRect . x1 ) contRect . x1 = t . x ; if ( t . y > contRect . y1 ) contRect . y1 = t . y ; if ( t . x < contRect . x0 ) contRect . x0 = t . x ; if ( t . y < contRect . y0 ) contRect . y0 = t . y ; } containment = contRect . area ( ) / imageArea ; |
public class AmazonGuardDutyClient { /** * Updates the IPSet specified by the IPSet ID .
* @ param updateIPSetRequest
* UpdateIPSet request body .
* @ return Result of the UpdateIPSet operation returned by the service .
* @ throws BadRequestException
* 400 response
* @ throws InternalServerErrorException
* 500 response
* @ sample AmazonGuardDuty . UpdateIPSet
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / guardduty - 2017-11-28 / UpdateIPSet " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public UpdateIPSetResult updateIPSet ( UpdateIPSetRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeUpdateIPSet ( request ) ; |
public class MessagingClientFactoryRegistry { /** * Removes a messaging client factory from this registry .
* @ param factory the messaging client factory to remove .
* @ return { @ code true } if the factory has been removed , { @ code false } if the factory was not registered . */
public boolean removeMessagingClientFactory ( IMessagingClientFactory factory ) { } } | final String type = factory . getType ( ) ; this . logger . fine ( "Removing messaging client factory: " + type ) ; final boolean result = this . factories . remove ( type , factory ) ; if ( result ) notifyListeners ( factory , false ) ; return result ; |
public class Kryo { /** * Reads a class and returns its registration .
* @ return May be null .
* @ see ClassResolver # readClass ( Input ) */
public Registration readClass ( Input input ) { } } | if ( input == null ) throw new IllegalArgumentException ( "input cannot be null." ) ; try { return classResolver . readClass ( input ) ; } finally { if ( depth == 0 && autoReset ) reset ( ) ; } |
public class SphericalUtil { /** * Returns the signed area of a closed path on a sphere of given radius .
* The computed area uses the same units as the radius squared .
* Used by SphericalUtilTest . */
static double computeSignedArea ( List < IGeoPoint > path , double radius ) { } } | int size = path . size ( ) ; if ( size < 3 ) { return 0 ; } double total = 0 ; IGeoPoint prev = path . get ( size - 1 ) ; double prevTanLat = tan ( ( PI / 2 - toRadians ( prev . getLatitude ( ) ) ) / 2 ) ; double prevLng = toRadians ( prev . getLongitude ( ) ) ; // For each edge , accumulate the signed area of the triangle formed by the North Pole
// and that edge ( " polar triangle " ) .
for ( IGeoPoint point : path ) { double tanLat = tan ( ( PI / 2 - toRadians ( point . getLatitude ( ) ) ) / 2 ) ; double lng = toRadians ( point . getLongitude ( ) ) ; total += polarTriangleArea ( tanLat , lng , prevTanLat , prevLng ) ; prevTanLat = tanLat ; prevLng = lng ; } return total * ( radius * radius ) ; |
public class DeepLearningTask { /** * Create local workspace ( neurons ) and link them to shared weights */
@ Override protected boolean chunkInit ( ) { } } | if ( _localmodel . get_processed_local ( ) >= _useFraction * _fr . numRows ( ) ) return false ; _neurons = makeNeuronsForTraining ( _localmodel ) ; _dropout_rng = RandomUtils . getRNG ( System . currentTimeMillis ( ) ) ; return true ; |
public class MultiPath { /** * Adds segments from a source multipath to this MultiPath .
* @ param src
* The source MultiPath to add segments from .
* @ param srcPathIndex
* The index of the path in the the source MultiPath .
* @ param srcSegmentFrom
* The index of first segment in the path to start adding from .
* The value has to be between 0 and
* src . getSegmentCount ( srcPathIndex ) - 1.
* @ param srcSegmentCount
* The number of segments to add . If 0 , the function does
* nothing .
* @ param bStartNewPath
* When true , a new path is added and segments are added to it .
* Otherwise the segments are added to the last path of this
* MultiPath .
* If bStartNewPath false , the first point of the first source
* segment is not added . This is done to ensure proper connection
* to existing segments . When the source path is closed , and the
* closing segment is among those to be added , it is added also
* as a closing segment , not as a real segment . Use add _ segment
* instead if you do not like that behavior .
* This MultiPath obtains all missing attributes from the src
* MultiPath . */
public void addSegmentsFromPath ( MultiPath src , int srcPathIndex , int srcSegmentFrom , int srcSegmentCount , boolean bStartNewPath ) { } } | m_impl . addSegmentsFromPath ( ( MultiPathImpl ) src . _getImpl ( ) , srcPathIndex , srcSegmentFrom , srcSegmentCount , bStartNewPath ) ; |
public class EasyBind { /** * Invokes { @ code subscriber } for the current and every new value of
* { @ code observable } .
* @ param observable observable value to subscribe to
* @ param subscriber action to invoke for values of { @ code observable } .
* @ return a subscription that can be used to stop invoking subscriber
* for any further { @ code observable } changes . */
public static < T > Subscription subscribe ( ObservableValue < T > observable , Consumer < ? super T > subscriber ) { } } | subscriber . accept ( observable . getValue ( ) ) ; ChangeListener < ? super T > listener = ( obs , oldValue , newValue ) -> subscriber . accept ( newValue ) ; observable . addListener ( listener ) ; return ( ) -> observable . removeListener ( listener ) ; |
public class Row { /** * Create row with new header .
* @ param headerDefinition the header definition
* @ return a new Row with the new header definition */
public Row withPaddedHeader ( final HeaderDefinition headerDefinition ) { } } | if ( _headerDefinition != headerDefinition ) { String [ ] values = new String [ headerDefinition . size ( ) ] ; System . arraycopy ( _values , 0 , values , 0 , _values . length ) ; return Row . of ( headerDefinition , values ) ; } else { return this ; } |
public class Nodes { /** * Expects a { @ link # init ( Node ) } call with the given node before this one is called */
private static void setInputMapUnsafe ( Node node , InputMap < ? > im ) { } } | getProperties ( node ) . put ( P_INPUTMAP , im ) ; |
public class ApiOvhIpLoadbalancing { /** * HTTP routes for this iplb
* REST : GET / ipLoadbalancing / { serviceName } / http / route
* @ param frontendId [ required ] Filter the value of frontendId property ( = )
* @ param serviceName [ required ] The internal name of your IP load balancing */
public ArrayList < Long > serviceName_http_route_GET ( String serviceName , Long frontendId ) throws IOException { } } | String qPath = "/ipLoadbalancing/{serviceName}/http/route" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "frontendId" , frontendId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t2 ) ; |
public class BshClassPath { /** * Implements NameSource
* Add a listener who is notified upon changes to names in this space . */
public void addNameSourceListener ( NameSource . Listener listener ) { } } | if ( nameSourceListeners == null ) nameSourceListeners = new ArrayList ( ) ; nameSourceListeners . add ( listener ) ; |
public class AppUtil { /** * Starts the web browser in order to show a specific URI . If an error occurs while starting the
* web browser an { @ link ActivityNotFoundException } will be thrown .
* @ param context
* The context , the web browser should be started from , as an instance of the class
* { @ link Context } . The context may not be null
* @ param uri
* The URI , which should be shown , as an instance of the class { @ link Uri } . The URI may
* not be null */
public static void startWebBrowser ( @ NonNull final Context context , @ NonNull final Uri uri ) { } } | Condition . INSTANCE . ensureNotNull ( context , "The context may not be null" ) ; Condition . INSTANCE . ensureNotNull ( uri , "The URI may not be null" ) ; Intent intent = new Intent ( Intent . ACTION_VIEW , uri ) ; if ( intent . resolveActivity ( context . getPackageManager ( ) ) == null ) { throw new ActivityNotFoundException ( "Web browser not available" ) ; } context . startActivity ( intent ) ; |
public class ObjectFactory2 { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ActedOnBehalfOf } { @ code > } } */
@ XmlElementDecl ( namespace = "http://www.w3.org/ns/prov#" , name = "actedOnBehalfOf" ) public JAXBElement < ActedOnBehalfOf > createActedOnBehalfOf ( ActedOnBehalfOf value ) { } } | return new JAXBElement < ActedOnBehalfOf > ( _ActedOnBehalfOf_QNAME , ActedOnBehalfOf . class , null , value ) ; |
public class BaseServiceImp { /** * ( non - Javadoc )
* @ see com . popbill . api . BaseService # updateCorpInfo ( java . lang . String , com . popbill . api . CorpInfo , java . lang . String ) */
@ Override public Response updateCorpInfo ( String CorpNum , CorpInfo corpInfo ) throws PopbillException { } } | String postData = toJsonString ( corpInfo ) ; return httppost ( "/CorpInfo" , CorpNum , postData , null , Response . class ) ; |
public class DataSynchronizer { /** * Aggregates documents according to the specified aggregation pipeline .
* @ param pipeline the aggregation pipeline
* @ param resultClass the class to decode each document into
* @ param < ResultT > the target document type of the iterable .
* @ return an iterable containing the result of the aggregation operation */
< ResultT > AggregateIterable < ResultT > aggregate ( final MongoNamespace namespace , final List < ? extends Bson > pipeline , final Class < ResultT > resultClass ) { } } | this . waitUntilInitialized ( ) ; ongoingOperationsGroup . enter ( ) ; try { return getLocalCollection ( namespace ) . aggregate ( pipeline , resultClass ) ; } finally { ongoingOperationsGroup . exit ( ) ; } |
public class CmsADEConfigData { /** * Gets the property configuration as a map of CmsXmlContentProperty instances . < p >
* @ return the map of property configurations */
public Map < String , CmsXmlContentProperty > getPropertyConfigurationAsMap ( ) { } } | Map < String , CmsXmlContentProperty > result = new LinkedHashMap < String , CmsXmlContentProperty > ( ) ; for ( CmsPropertyConfig propConf : getPropertyConfiguration ( ) ) { result . put ( propConf . getName ( ) , propConf . getPropertyData ( ) ) ; } return result ; |
public class PlatformDescription { /** * The custom AMIs supported by the platform .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setCustomAmiList ( java . util . Collection ) } or { @ link # withCustomAmiList ( java . util . Collection ) } if you want
* to override the existing values .
* @ param customAmiList
* The custom AMIs supported by the platform .
* @ return Returns a reference to this object so that method calls can be chained together . */
public PlatformDescription withCustomAmiList ( CustomAmi ... customAmiList ) { } } | if ( this . customAmiList == null ) { setCustomAmiList ( new com . amazonaws . internal . SdkInternalList < CustomAmi > ( customAmiList . length ) ) ; } for ( CustomAmi ele : customAmiList ) { this . customAmiList . add ( ele ) ; } return this ; |
public class JsonWriter { /** * Fast - Path UTF - 8 implementation . */
private static void writeUtf8 ( OutputAccessor out , CharSequence seq , int len ) { } } | // We can use the _ set methods as these not need to do any index checks and reference checks .
// This is possible as we called ensureWritable ( . . . ) before .
for ( int i = 0 ; i < len ; i ++ ) { char c = seq . charAt ( i ) ; switch ( c ) { case '\b' : out . write ( B ) ; continue ; case '\t' : out . write ( T ) ; continue ; case '\n' : out . write ( N ) ; continue ; case '\f' : out . write ( F ) ; continue ; case '\r' : out . write ( R ) ; continue ; case '\"' : out . write ( QUOT ) ; continue ; case '\\' : out . write ( BSLASH ) ; continue ; } if ( c < 0x20 ) { escape ( out , c ) ; } else if ( c < 0x80 ) { out . write ( ( byte ) c ) ; } else if ( c < 0x800 ) { out . write ( ( byte ) ( 0xc0 | ( c >> 6 ) ) ) ; out . write ( ( byte ) ( 0x80 | ( c & 0x3f ) ) ) ; } else if ( isSurrogate ( c ) ) { if ( ! Character . isHighSurrogate ( c ) ) { out . write ( WRITE_UTF_UNKNOWN ) ; continue ; } final char c2 ; try { // Surrogate Pair consumes 2 characters . Optimistically try to get the next character to avoid
// duplicate bounds checking with charAt . If an IndexOutOfBoundsException is thrown we will
// re - throw a more informative exception describing the problem .
c2 = seq . charAt ( ++ i ) ; } catch ( IndexOutOfBoundsException e ) { out . write ( WRITE_UTF_UNKNOWN ) ; break ; } if ( ! Character . isLowSurrogate ( c2 ) ) { out . write ( WRITE_UTF_UNKNOWN ) ; out . write ( ( byte ) ( Character . isHighSurrogate ( c2 ) ? WRITE_UTF_UNKNOWN : c2 ) ) ; continue ; } int codePoint = Character . toCodePoint ( c , c2 ) ; // See http : / / www . unicode . org / versions / Unicode7.0.0 / ch03 . pdf # G2630.
escape ( out , c ) ; escape ( out , codePoint ) ; } else { out . write ( ( byte ) ( 0xe0 | ( c >> 12 ) ) ) ; out . write ( ( byte ) ( 0x80 | ( ( c >> 6 ) & 0x3f ) ) ) ; out . write ( ( byte ) ( 0x80 | ( c & 0x3f ) ) ) ; } } |
public class FixupStream { /** * { @ inheritDoc } */
public void writeExternal ( ObjectOutput out ) throws IOException { } } | out . writeInt ( iItemStateId ) ; out . writeInt ( iValueDataId ) ; |
public class AbstractQueryRunner { /** * Creates new StatementHandler instance
* @ param statementHandlerClazz StatementHandler implementation class
* @ return new StatementHandler implementation instance */
private StatementHandler getStatementHandler ( Class < ? extends StatementHandler > statementHandlerClazz ) { } } | StatementHandler result = null ; Constructor < ? extends StatementHandler > constructor = null ; Class < ? extends StatementHandler > clazz = statementHandlerClazz ; try { constructor = clazz . getConstructor ( Overrider . class ) ; result = constructor . newInstance ( overrider ) ; } catch ( SecurityException e ) { throw new MjdbcRuntimeException ( ERROR_SH_INIT_FAILED , e ) ; } catch ( NoSuchMethodException e ) { throw new MjdbcRuntimeException ( ERROR_SH_INIT_FAILED , e ) ; } catch ( IllegalArgumentException e ) { throw new MjdbcRuntimeException ( ERROR_SH_INIT_FAILED , e ) ; } catch ( InstantiationException e ) { throw new MjdbcRuntimeException ( ERROR_SH_INIT_FAILED , e ) ; } catch ( IllegalAccessException e ) { throw new MjdbcRuntimeException ( ERROR_SH_INIT_FAILED , e ) ; } catch ( InvocationTargetException e ) { throw new MjdbcRuntimeException ( ERROR_SH_INIT_FAILED , e ) ; } return result ; |
public class TypeConverter { /** * Convert given value to given target
* @ param fromValue
* the value to convert
* @ param toType
* target target
* @ param < T >
* target of the result
* @ return the value converted to given target
* @ throws TypeCastException
* if conversion was not possible */
@ SuppressWarnings ( "unchecked" ) public static < T > T convert ( Object fromValue , Class < T > toType ) throws TypeCastException { } } | return convert ( fromValue , toType , ( String ) null ) ; |
public class AccountClient { /** * Create a secret to be used with a specific API key .
* @ param apiKey The API key that the secret is to be used with .
* @ param secret The contents of the secret .
* @ return SecretResponse object which contains the created secret from the API .
* @ throws IOException if a network error occurred contacting the Nexmo Account API
* @ throws NexmoClientException if there was a problem wit hthe Nexmo request or response object indicating that the request was unsuccessful . */
public SecretResponse createSecret ( String apiKey , String secret ) throws IOException , NexmoClientException { } } | return createSecret ( new CreateSecretRequest ( apiKey , secret ) ) ; |
public class ObjectGraphDump { /** * Visits all the fields in the given complex object .
* @ param node the ObjectGraphNode containing the object . */
private void visitComplexType ( final ObjectGraphNode node ) { } } | Field [ ] fields = getAllInstanceFields ( node . getValue ( ) ) ; for ( int i = 0 ; i < fields . length ; i ++ ) { Object fieldValue = readField ( fields [ i ] , node . getValue ( ) ) ; String fieldType = fields [ i ] . getType ( ) . getName ( ) ; ObjectGraphNode childNode = new ObjectGraphNode ( ++ nodeCount , fields [ i ] . getName ( ) , fieldType , fieldValue ) ; node . add ( childNode ) ; visit ( childNode ) ; } |
public class AdminCommandScheduled { /** * Parses command - line input and prints help menu .
* @ throws IOException */
public static void executeHelp ( String [ ] args , PrintStream stream ) throws IOException { } } | String subCmd = ( args . length > 0 ) ? args [ 0 ] : "" ; if ( subCmd . equals ( "list" ) ) { SubCommandScheduledList . printHelp ( stream ) ; } else if ( subCmd . equals ( "stop" ) ) { SubCommandScheduledStop . printHelp ( stream ) ; } else if ( subCmd . equals ( "enable" ) ) { SubCommandScheduledEnable . printHelp ( stream ) ; } else { printHelp ( stream ) ; } |
public class AbstractWhereClauseMatchCriteria { /** * Adds a parameterized selection criterion of the form " column [ operator ] ? "
* to the where clause .
* @ param column Database column name .
* @ param operator the operator to use to separate . */
protected void addCriteria ( String column , String operator ) { } } | if ( this . sbClause . length ( ) == 0 ) { this . sbClause . append ( "WHERE" ) ; } else { this . sbClause . append ( " AND" ) ; } this . sbClause . append ( ' ' ) ; this . sbClause . append ( column ) ; this . sbClause . append ( ' ' ) ; this . sbClause . append ( operator ) ; this . sbClause . append ( " ?" ) ; |
public class ServerStats { /** * Gets the 75 - th percentile in the total amount of time spent handling a request , in milliseconds . */
@ Monitor ( name = "ResponseTimeMillis75Percentile" , type = DataSourceType . INFORMATIONAL , description = "75th percentile in total time to handle a request, in milliseconds" ) public double getResponseTime75thPercentile ( ) { } } | return getResponseTimePercentile ( Percent . SEVENTY_FIVE ) ; |
public class ProjectApi { /** * Adds a hook to project .
* < pre > < code > POST / projects / : id / hooks < / code > < / pre >
* @ param projectIdOrPath projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance , required
* @ param url the callback URL for the hook
* @ param doPushEvents flag specifying whether to do push events
* @ param doIssuesEvents flag specifying whether to do issues events
* @ param doMergeRequestsEvents flag specifying whether to do merge requests events
* @ return the added ProjectHook instance
* @ throws GitLabApiException if any exception occurs */
public ProjectHook addHook ( Object projectIdOrPath , String url , boolean doPushEvents , boolean doIssuesEvents , boolean doMergeRequestsEvents ) throws GitLabApiException { } } | GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "url" , url ) . withParam ( "push_events" , doPushEvents ) . withParam ( "issues_enabled" , doIssuesEvents ) . withParam ( "merge_requests_events" , doMergeRequestsEvents ) ; Response response = post ( Response . Status . CREATED , formData , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "hooks" ) ; return ( response . readEntity ( ProjectHook . class ) ) ; |
public class WriteQueue { /** * Adds a new Write to the end of the queue .
* @ param write The write to add . */
synchronized void add ( Write write ) { } } | Exceptions . checkNotClosed ( this . closed , this ) ; this . writes . addLast ( write ) ; this . totalLength += write . data . getLength ( ) ; write . setQueueAddedTimestamp ( this . timeSupplier . get ( ) ) ; |
public class Reductions { /** * Returns the max element contained in the iterator
* @ param < E > the iterator element type parameter
* @ param < C > the comparator type parameter
* @ param iterator the iterator to be consumed
* @ param comparator the comparator to be used to evaluate the max element
* @ param init the initial value to be used
* @ return the max element contained in the iterator */
public static < E , C extends Comparator < E > > E maximum ( Iterator < E > iterator , C comparator , E init ) { } } | return Reductions . reduce ( iterator , BinaryOperator . maxBy ( comparator ) , init ) ; |
public class AsyncCallObject { void command_inout_reply ( int timeout ) { } } | DevError [ ] errors = null ; DeviceData argout = null ; try { if ( timeout == NO_TIMEOUT ) argout = dev . command_inout_reply ( this ) ; else argout = dev . command_inout_reply ( this , timeout ) ; } catch ( AsynReplyNotArrived e ) { errors = e . errors ; } catch ( DevFailed e ) { errors = e . errors ; } cb . cmd_ended ( new CmdDoneEvent ( dev , names [ 0 ] , argout , errors ) ) ; |
public class CRCResourceManagementImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setResClassFlg ( Integer newResClassFlg ) { } } | Integer oldResClassFlg = resClassFlg ; resClassFlg = newResClassFlg ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . CRC_RESOURCE_MANAGEMENT__RES_CLASS_FLG , oldResClassFlg , resClassFlg ) ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.