signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class CmsModuleLog { /** * Logs a module action . < p >
* @ param moduleName the module name
* @ param action the action
* @ param ok true if the action was successful */
public synchronized void log ( String moduleName , Action action , boolean ok ) { } } | if ( moduleName == null ) { return ; } SimpleDateFormat format = new SimpleDateFormat ( DATE_FORMAT_STRING ) ; String now = format . format ( new Date ( ) ) ; String message = now + " " + action . getPrintName ( ) + " " + ( ok ? "0" : "1" ) ; log ( moduleName , message ) ; |
public class RepositoryManager { /** * Pair adding to the repositories map and resetting the numRepos int .
* @ param repositoryId
* @ param repositoryHolder */
private void addRepository ( String repositoryId , RepositoryWrapper repositoryHolder ) { } } | repositories . put ( repositoryId , repositoryHolder ) ; try { numRepos = getNumberOfRepositories ( ) ; } catch ( WIMException e ) { // okay
} |
public class BaseBuffer { /** * { @ inheritDoc } */
@ Override public final int indexOf ( final int maxBytes , final byte ... bytes ) throws IOException , ByteNotFoundException , IllegalArgumentException { } } | if ( bytes . length == 0 ) { throw new IllegalArgumentException ( "No bytes specified. Not sure what you want me to look for" ) ; } final int start = getReaderIndex ( ) ; int index = - 1 ; while ( hasReadableBytes ( ) && getReaderIndex ( ) - start < maxBytes && index == - 1 ) { if ( isByteInArray ( readByte ( ) , bytes ) ) { index = getReaderIndex ( ) - 1 ; } } setReaderIndex ( start ) ; if ( getReaderIndex ( ) - start >= maxBytes ) { throw new ByteNotFoundException ( maxBytes , bytes ) ; } return index ; |
public class LinearBargraph { /** * < editor - fold defaultstate = " collapsed " desc = " Visualization " > */
@ Override protected void paintComponent ( Graphics g ) { } } | if ( ! isInitialized ( ) ) { return ; } final Graphics2D G2 = ( Graphics2D ) g . create ( ) ; G2 . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; G2 . setRenderingHint ( RenderingHints . KEY_RENDERING , RenderingHints . VALUE_RENDER_QUALITY ) ; G2 . setRenderingHint ( RenderingHints . KEY_STROKE_CONTROL , RenderingHints . VALUE_STROKE_NORMALIZE ) ; G2 . setRenderingHint ( RenderingHints . KEY_TEXT_ANTIALIASING , RenderingHints . VALUE_TEXT_ANTIALIAS_ON ) ; if ( ! isFrameVisible ( ) ) { G2 . translate ( getInnerBounds ( ) . x - 17 , getInnerBounds ( ) . y - 17 ) ; } else { G2 . translate ( getInnerBounds ( ) . x , getInnerBounds ( ) . y ) ; } // Draw combined background image
G2 . drawImage ( bImage , 0 , 0 , null ) ; // Parameters neede for setting the indicators to the right location
final double PIXEL_RANGE ; final double RANGE ; final double PIXEL_SCALE ; if ( getInnerBounds ( ) . width < getInnerBounds ( ) . height ) { // Vertical
PIXEL_RANGE = getInnerBounds ( ) . height * 0.8567961165048543 - getInnerBounds ( ) . height * 0.12864077669902912 ; RANGE = ( getMaxValue ( ) - getMinValue ( ) ) ; PIXEL_SCALE = PIXEL_RANGE / RANGE ; } else { // Horizontal
PIXEL_RANGE = getInnerBounds ( ) . width * 0.8567961165048543 - getInnerBounds ( ) . width * 0.12864077669902912 ; RANGE = ( getMaxValue ( ) - getMinValue ( ) ) ; PIXEL_SCALE = PIXEL_RANGE / RANGE ; } // Draw threshold indicator
if ( isThresholdVisible ( ) ) { final double VALUE_POS ; final AffineTransform OLD_TRANSFORM = G2 . getTransform ( ) ; if ( getInnerBounds ( ) . width < getInnerBounds ( ) . height ) { // Vertical orientation
if ( getMinValue ( ) < 0 ) { VALUE_POS = getInnerBounds ( ) . height * 0.8567961165048543 + getMinValue ( ) * PIXEL_SCALE - getThreshold ( ) * PIXEL_SCALE ; } else { VALUE_POS = getInnerBounds ( ) . height * 0.8567961165048543 - getMinValue ( ) * PIXEL_SCALE - getThreshold ( ) * PIXEL_SCALE ; } G2 . translate ( getInnerBounds ( ) . width * 0.4357142857142857 - thresholdImage . getWidth ( ) - 2 + getInnerBounds ( ) . x , VALUE_POS - thresholdImage . getHeight ( ) / 2.0 + getInnerBounds ( ) . y ) ; } else { // Horizontal orientation
VALUE_POS = getThreshold ( ) * PIXEL_SCALE - getMinValue ( ) * PIXEL_SCALE ; G2 . translate ( getInnerBounds ( ) . width * 0.14285714285714285 - thresholdImage . getWidth ( ) / 2.0 + VALUE_POS + getInnerBounds ( ) . x , getInnerBounds ( ) . height * 0.5714285714 + 2 + getInnerBounds ( ) . y ) ; } G2 . drawImage ( thresholdImage , 0 , 0 , null ) ; G2 . setTransform ( OLD_TRANSFORM ) ; } // Draw min measured value indicator
if ( isMinMeasuredValueVisible ( ) ) { final double VALUE_POS ; final AffineTransform OLD_TRANSFORM = G2 . getTransform ( ) ; if ( getInnerBounds ( ) . width < getInnerBounds ( ) . height ) { // Vertical orientation
if ( getMinValue ( ) < 0 ) { VALUE_POS = getInnerBounds ( ) . height * 0.8567961165048543 + getMinValue ( ) * PIXEL_SCALE - getMinMeasuredValue ( ) * PIXEL_SCALE ; } else { VALUE_POS = getInnerBounds ( ) . height * 0.8567961165048543 - getMinValue ( ) * PIXEL_SCALE - getMinMeasuredValue ( ) * PIXEL_SCALE ; } G2 . translate ( getInnerBounds ( ) . width * 0.37 - minMeasuredImage . getWidth ( ) - 2 + getInnerBounds ( ) . x , VALUE_POS - minMeasuredImage . getHeight ( ) / 2.0 + getInnerBounds ( ) . y ) ; } else { // Horizontal orientation
VALUE_POS = getMinMeasuredValue ( ) * PIXEL_SCALE - getMinValue ( ) * PIXEL_SCALE ; G2 . translate ( getInnerBounds ( ) . width * 0.14285714285714285 - minMeasuredImage . getWidth ( ) / 2.0 + VALUE_POS + getInnerBounds ( ) . x , getInnerBounds ( ) . height * 0.63 + 2 + getInnerBounds ( ) . y ) ; } G2 . drawImage ( minMeasuredImage , 0 , 0 , null ) ; G2 . setTransform ( OLD_TRANSFORM ) ; } // Draw max measured value indicator
if ( isMaxMeasuredValueVisible ( ) ) { final double VALUE_POS ; final AffineTransform OLD_TRANSFORM = G2 . getTransform ( ) ; if ( getInnerBounds ( ) . width < getInnerBounds ( ) . height ) { // Vertical orientation
if ( getMinValue ( ) < 0 ) { VALUE_POS = getInnerBounds ( ) . height * 0.8567961165048543 + getMinValue ( ) * PIXEL_SCALE - getMaxMeasuredValue ( ) * PIXEL_SCALE ; } else { VALUE_POS = getInnerBounds ( ) . height * 0.8567961165048543 - getMinValue ( ) * PIXEL_SCALE - getMaxMeasuredValue ( ) * PIXEL_SCALE ; } G2 . translate ( getInnerBounds ( ) . width * 0.37 - maxMeasuredImage . getWidth ( ) - 2 + getInnerBounds ( ) . x , VALUE_POS - maxMeasuredImage . getHeight ( ) / 2.0 + getInnerBounds ( ) . y ) ; } else { // Horizontal orientation
VALUE_POS = getMaxMeasuredValue ( ) * PIXEL_SCALE - getMinValue ( ) * PIXEL_SCALE ; G2 . translate ( getInnerBounds ( ) . width * 0.14285714285714285 - maxMeasuredImage . getWidth ( ) / 2.0 + VALUE_POS + getInnerBounds ( ) . x , getInnerBounds ( ) . height * 0.63 + 2 + getInnerBounds ( ) . y ) ; } G2 . drawImage ( maxMeasuredImage , 0 , 0 , null ) ; G2 . setTransform ( OLD_TRANSFORM ) ; } // Draw LED if enabled
if ( isLedVisible ( ) ) { G2 . drawImage ( getCurrentLedImage ( ) , ( int ) ( getInnerBounds ( ) . width * getLedPosition ( ) . getX ( ) ) , ( int ) ( getInnerBounds ( ) . height * getLedPosition ( ) . getY ( ) ) , null ) ; } // Draw user LED if enabled
if ( isUserLedVisible ( ) ) { G2 . drawImage ( getCurrentUserLedImage ( ) , ( int ) ( getInnerBounds ( ) . width * getUserLedPosition ( ) . getX ( ) ) , ( int ) ( getInnerBounds ( ) . height * getUserLedPosition ( ) . getY ( ) ) , null ) ; } // Draw LCD display
if ( isLcdVisible ( ) ) { if ( getLcdColor ( ) == LcdColor . CUSTOM ) { G2 . setColor ( getCustomLcdForeground ( ) ) ; } else { G2 . setColor ( getLcdColor ( ) . TEXT_COLOR ) ; } G2 . setFont ( getLcdUnitFont ( ) ) ; final double UNIT_STRING_WIDTH ; if ( isLcdTextVisible ( ) ) { if ( isLcdUnitStringVisible ( ) ) { unitLayout = new TextLayout ( getLcdUnitString ( ) , G2 . getFont ( ) , RENDER_CONTEXT ) ; UNIT_BOUNDARY . setFrame ( unitLayout . getBounds ( ) ) ; G2 . drawString ( getLcdUnitString ( ) , ( int ) ( LCD . getX ( ) + ( LCD . getWidth ( ) - UNIT_BOUNDARY . getWidth ( ) ) - LCD . getWidth ( ) * 0.03 ) , ( int ) ( LCD . getY ( ) + LCD . getHeight ( ) * 0.76 ) ) ; UNIT_STRING_WIDTH = UNIT_BOUNDARY . getWidth ( ) ; } else { UNIT_STRING_WIDTH = 0 ; } G2 . setFont ( getLcdValueFont ( ) ) ; switch ( getModel ( ) . getNumberSystem ( ) ) { case HEX : valueLayout = new TextLayout ( Integer . toHexString ( ( int ) getLcdValue ( ) ) . toUpperCase ( ) , G2 . getFont ( ) , RENDER_CONTEXT ) ; VALUE_BOUNDARY . setFrame ( valueLayout . getBounds ( ) ) ; G2 . drawString ( Integer . toHexString ( ( int ) getLcdValue ( ) ) . toUpperCase ( ) , ( int ) ( LCD . getX ( ) + ( LCD . getWidth ( ) - UNIT_STRING_WIDTH - VALUE_BOUNDARY . getWidth ( ) ) - LCD . getWidth ( ) * 0.09 ) , ( int ) ( LCD . getY ( ) + LCD . getHeight ( ) * 0.76 ) ) ; break ; case OCT : valueLayout = new TextLayout ( Integer . toOctalString ( ( int ) getLcdValue ( ) ) , G2 . getFont ( ) , RENDER_CONTEXT ) ; VALUE_BOUNDARY . setFrame ( valueLayout . getBounds ( ) ) ; G2 . drawString ( Integer . toOctalString ( ( int ) getLcdValue ( ) ) , ( int ) ( LCD . getX ( ) + ( LCD . getWidth ( ) - UNIT_STRING_WIDTH - VALUE_BOUNDARY . getWidth ( ) ) - LCD . getWidth ( ) * 0.09 ) , ( int ) ( LCD . getY ( ) + LCD . getHeight ( ) * 0.76 ) ) ; break ; case DEC : default : valueLayout = new TextLayout ( formatLcdValue ( getLcdValue ( ) ) , G2 . getFont ( ) , RENDER_CONTEXT ) ; VALUE_BOUNDARY . setFrame ( valueLayout . getBounds ( ) ) ; G2 . drawString ( formatLcdValue ( getLcdValue ( ) ) , ( int ) ( LCD . getX ( ) + ( LCD . getWidth ( ) - UNIT_STRING_WIDTH - VALUE_BOUNDARY . getWidth ( ) ) - LCD . getWidth ( ) * 0.09 ) , ( int ) ( LCD . getY ( ) + LCD . getHeight ( ) * 0.76 ) ) ; break ; } } if ( ! getLcdInfoString ( ) . isEmpty ( ) ) { G2 . setFont ( getLcdInfoFont ( ) ) ; infoLayout = new TextLayout ( getLcdInfoString ( ) , G2 . getFont ( ) , RENDER_CONTEXT ) ; INFO_BOUNDARY . setFrame ( infoLayout . getBounds ( ) ) ; G2 . drawString ( getLcdInfoString ( ) , LCD . getBounds ( ) . x + 5 , LCD . getBounds ( ) . y + ( int ) INFO_BOUNDARY . getHeight ( ) + 5 ) ; } // Draw lcd threshold indicator
if ( getLcdNumberSystem ( ) == NumberSystem . DEC && isLcdThresholdVisible ( ) && getLcdValue ( ) >= getLcdThreshold ( ) ) { G2 . drawImage ( lcdThresholdImage , ( int ) ( LCD . getX ( ) + LCD . getHeight ( ) * 0.0568181818 ) , ( int ) ( LCD . getY ( ) + LCD . getHeight ( ) - lcdThresholdImage . getHeight ( ) - LCD . getHeight ( ) * 0.0568181818 ) , null ) ; } } // Draw the active leds in dependence on the current value and the peak value
// drawValue ( G2 , getWidth ( ) , getHeight ( ) ) ;
drawValue ( G2 , getInnerBounds ( ) . width , getInnerBounds ( ) . height ) ; // Draw foreground
if ( isForegroundVisible ( ) ) { G2 . drawImage ( fImage , 0 , 0 , null ) ; } // Draw glow indicator
if ( isGlowVisible ( ) ) { if ( isGlowing ( ) ) { G2 . setComposite ( AlphaComposite . getInstance ( AlphaComposite . SRC_OVER , getGlowAlpha ( ) ) ) ; G2 . drawImage ( glowImageOn , 0 , 0 , null ) ; G2 . setComposite ( AlphaComposite . getInstance ( AlphaComposite . SRC_OVER , 1f ) ) ; } else { G2 . drawImage ( glowImageOff , 0 , 0 , null ) ; } } if ( ! isEnabled ( ) ) { G2 . drawImage ( disabledImage , 0 , 0 , null ) ; } G2 . dispose ( ) ; |
public class ConversionAnalyzer { /** * Returns true if the field name is contained in the values array , false otherwise .
* @ param values array of values
* @ param field field name to check
* @ return true if the field name is contained in the values array , false otherwise */
private boolean isPresentIn ( String [ ] values , String field ) { } } | for ( String value : values ) if ( value . equalsIgnoreCase ( JMapConversion . ALL ) || value . equals ( field ) ) return true ; return false ; |
public class AbstractHttpProtocolHandler { /** * { @ inheritDoc } */
@ Override protected File downloadResource ( URLConnection urlConnection , String namespaceDownloadLocation ) throws ResourceDownloadError { } } | HttpURLConnection httpUrlConnection = ( HttpURLConnection ) urlConnection ; try { httpUrlConnection . setConnectTimeout ( ProtocolHandlerConstants . CONNECTION_TIMEOUT ) ; httpUrlConnection . setInstanceFollowRedirects ( true ) ; final int code = httpUrlConnection . getResponseCode ( ) ; if ( code != HttpURLConnection . HTTP_OK ) { final String url = urlConnection . getURL ( ) . toString ( ) ; final String msg = "Bad response code: " + code ; throw new ResourceDownloadError ( url , msg ) ; } return super . downloadResource ( httpUrlConnection , namespaceDownloadLocation ) ; } catch ( InterruptedIOException e ) { final String url = urlConnection . getURL ( ) . toString ( ) ; final String msg = "Interrupted I/O" ; throw new ResourceDownloadError ( url , msg , e ) ; } catch ( IOException e ) { final String url = urlConnection . getURL ( ) . toString ( ) ; final String msg = e . getMessage ( ) ; throw new ResourceDownloadError ( url , msg , e ) ; } |
public class CreateFileExtensions { /** * Creates a new directory from the given { @ link File } object
* @ param dir
* The directory to create
* @ return the { @ link FileCreationState } with the result */
public static FileCreationState newDirectory ( final File dir ) { } } | FileCreationState fileCreationState = FileCreationState . ALREADY_EXISTS ; // If the directory does not exists
if ( ! dir . exists ( ) ) { // then
fileCreationState = FileCreationState . FAILED ; // create it . . .
if ( dir . mkdir ( ) ) { fileCreationState = FileCreationState . CREATED ; } } return fileCreationState ; |
public class OriginEndpoint { /** * A list of source IP CIDR blocks that will be allowed to access the OriginEndpoint .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setWhitelist ( java . util . Collection ) } or { @ link # withWhitelist ( java . util . Collection ) } if you want to
* override the existing values .
* @ param whitelist
* A list of source IP CIDR blocks that will be allowed to access the OriginEndpoint .
* @ return Returns a reference to this object so that method calls can be chained together . */
public OriginEndpoint withWhitelist ( String ... whitelist ) { } } | if ( this . whitelist == null ) { setWhitelist ( new java . util . ArrayList < String > ( whitelist . length ) ) ; } for ( String ele : whitelist ) { this . whitelist . add ( ele ) ; } return this ; |
public class MaterialDataPager { /** * Set and update the ui fields of the pager after the datasource load callback */
protected void updateUi ( ) { } } | pageSelection . updatePageNumber ( currentPage ) ; pageSelection . updateTotalPages ( getTotalPages ( ) ) ; // Action label ( current selection ) in either the form " x - y of z " or " y of z " ( when page has only 1 record )
int firstRow = offset + 1 ; int lastRow = ( isExcess ( ) & isLastPage ( ) ) ? totalRows : ( offset + limit ) ; actionsPanel . getActionLabel ( ) . setText ( ( firstRow == lastRow ? lastRow : firstRow + "-" + lastRow ) + " of " + totalRows ) ; actionsPanel . getIconNext ( ) . setEnabled ( true ) ; actionsPanel . getIconPrev ( ) . setEnabled ( true ) ; if ( ! isNext ( ) ) { actionsPanel . getIconNext ( ) . setEnabled ( false ) ; } if ( ! isPrevious ( ) ) { actionsPanel . getIconPrev ( ) . setEnabled ( false ) ; } |
public class TextUtility { /** * 是否全是分隔符
* @ param sString
* @ return */
public static boolean isAllDelimiter ( byte [ ] sString ) { } } | int nLen = sString . length ; int i = 0 ; while ( i < nLen - 1 && ( getUnsigned ( sString [ i ] ) == 161 || getUnsigned ( sString [ i ] ) == 163 ) ) { i += 2 ; } if ( i < nLen ) return false ; return true ; |
public class DataUrlBuilder { /** * Creates a new { @ link DataUrl } instance
* @ return New { @ link DataUrl } instance
* @ throws NullPointerException if data or encoding is { @ code null } */
public DataUrl build ( ) throws NullPointerException { } } | if ( data == null ) { throw new NullPointerException ( "data is null!" ) ; } else if ( encoding == null ) { throw new NullPointerException ( "encoding is null!" ) ; } return new DataUrl ( data , encoding , mimeType , headers ) ; |
public class LoggerRepositoryExImpl { /** * Add a { @ link LoggerRepositoryEventListener } to the repository . The
* listener will be called when repository events occur .
* @ param listener listener */
public void addLoggerRepositoryEventListener ( final LoggerRepositoryEventListener listener ) { } } | synchronized ( repositoryEventListeners ) { if ( repositoryEventListeners . contains ( listener ) ) { LogLog . warn ( "Ignoring attempt to add a previously " + "registered LoggerRepositoryEventListener." ) ; } else { repositoryEventListeners . add ( listener ) ; } } |
public class VecmathUtil { /** * Create a unit vector for a bond with the start point being the specified atom .
* @ param atom start of vector
* @ param bond the bond used to create the vector
* @ return unit vector */
static Vector2d newUnitVector ( final IAtom atom , final IBond bond ) { } } | return newUnitVector ( atom . getPoint2d ( ) , bond . getOther ( atom ) . getPoint2d ( ) ) ; |
public class TrainingSpecification { /** * A list of the instance types that this algorithm can use for training .
* @ param supportedTrainingInstanceTypes
* A list of the instance types that this algorithm can use for training .
* @ see TrainingInstanceType */
public void setSupportedTrainingInstanceTypes ( java . util . Collection < String > supportedTrainingInstanceTypes ) { } } | if ( supportedTrainingInstanceTypes == null ) { this . supportedTrainingInstanceTypes = null ; return ; } this . supportedTrainingInstanceTypes = new java . util . ArrayList < String > ( supportedTrainingInstanceTypes ) ; |
public class Args { /** * Produces a flagged key / value pair list given a flag name and a { @ link Map } .
* @ return { @ code [ - - flagName , key1 = value1 , - - flagName , key2 = value2 , . . . ] } or { @ code [ ] } if
* keyValueMapping = empty / null */
static List < String > flaggedKeyValues ( final String flagName , @ Nullable Map < ? , ? > keyValueMapping ) { } } | List < String > result = Lists . newArrayList ( ) ; if ( keyValueMapping != null && keyValueMapping . size ( ) > 0 ) { for ( Map . Entry < ? , ? > entry : keyValueMapping . entrySet ( ) ) { result . addAll ( string ( flagName , entry . getKey ( ) + "=" + entry . getValue ( ) ) ) ; } return result ; } return Collections . emptyList ( ) ; |
public class HTMLUtil { /** * Inserts a { @ code < br > } tag before every newline . */
public static String makeLinear ( String text ) { } } | if ( text == null ) { return text ; } // handle both line ending formats
text = text . replace ( "\n" , "<br>\n" ) ; return text ; |
public class AbstractHeaderFile { /** * tries to delete the file
* @ throws IOException */
public void delete ( ) throws IOException { } } | close ( ) ; if ( osFile != null ) { boolean deleted = osFile . delete ( ) ; while ( ! deleted ) { try { Thread . sleep ( 100 ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; logger . error ( "{} not deleted." , osFile ) ; } System . gc ( ) ; deleted = osFile . delete ( ) ; } } |
public class GetUserDefinedFunctionRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetUserDefinedFunctionRequest getUserDefinedFunctionRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getUserDefinedFunctionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getUserDefinedFunctionRequest . getCatalogId ( ) , CATALOGID_BINDING ) ; protocolMarshaller . marshall ( getUserDefinedFunctionRequest . getDatabaseName ( ) , DATABASENAME_BINDING ) ; protocolMarshaller . marshall ( getUserDefinedFunctionRequest . getFunctionName ( ) , FUNCTIONNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class GeomUtil { /** * Subtract one shape from another - note this is experimental and doesn ' t
* currently handle islands
* @ param target The target to be subtracted from
* @ param missing The shape to subtract
* @ return The newly created shapes */
public Shape [ ] subtract ( Shape target , Shape missing ) { } } | target = target . transform ( new Transform ( ) ) ; missing = missing . transform ( new Transform ( ) ) ; int count = 0 ; for ( int i = 0 ; i < target . getPointCount ( ) ; i ++ ) { if ( missing . contains ( target . getPoint ( i ) [ 0 ] , target . getPoint ( i ) [ 1 ] ) ) { count ++ ; } } if ( count == target . getPointCount ( ) ) { return new Shape [ 0 ] ; } if ( ! target . intersects ( missing ) ) { return new Shape [ ] { target } ; } int found = 0 ; for ( int i = 0 ; i < missing . getPointCount ( ) ; i ++ ) { if ( target . contains ( missing . getPoint ( i ) [ 0 ] , missing . getPoint ( i ) [ 1 ] ) ) { if ( ! onPath ( target , missing . getPoint ( i ) [ 0 ] , missing . getPoint ( i ) [ 1 ] ) ) { found ++ ; } } } for ( int i = 0 ; i < target . getPointCount ( ) ; i ++ ) { if ( missing . contains ( target . getPoint ( i ) [ 0 ] , target . getPoint ( i ) [ 1 ] ) ) { if ( ! onPath ( missing , target . getPoint ( i ) [ 0 ] , target . getPoint ( i ) [ 1 ] ) ) { found ++ ; } } } if ( found < 1 ) { return new Shape [ ] { target } ; } return combine ( target , missing , true ) ; |
public class AmazonECSClient { /** * Updates the Amazon ECS container agent on a specified container instance . Updating the Amazon ECS container agent
* does not interrupt running tasks or services on the container instance . The process for updating the agent
* differs depending on whether your container instance was launched with the Amazon ECS - optimized AMI or another
* operating system .
* < code > UpdateContainerAgent < / code > requires the Amazon ECS - optimized AMI or Amazon Linux with the
* < code > ecs - init < / code > service installed and running . For help updating the Amazon ECS container agent on other
* operating systems , see < a
* href = " https : / / docs . aws . amazon . com / AmazonECS / latest / developerguide / ecs - agent - update . html # manually _ update _ agent "
* > Manually Updating the Amazon ECS Container Agent < / a > in the < i > Amazon Elastic Container Service Developer
* Guide < / i > .
* @ param updateContainerAgentRequest
* @ return Result of the UpdateContainerAgent operation returned by the service .
* @ throws ServerException
* These errors are usually caused by a server issue .
* @ throws ClientException
* These errors are usually caused by a client action , such as using an action or resource on behalf of a
* user that doesn ' t have permissions to use the action or resource , or specifying an identifier that is not
* valid .
* @ throws InvalidParameterException
* The specified parameter is invalid . Review the available parameters for the API request .
* @ throws ClusterNotFoundException
* The specified cluster could not be found . You can view your available clusters with < a > ListClusters < / a > .
* Amazon ECS clusters are Region - specific .
* @ throws UpdateInProgressException
* There is already a current Amazon ECS container agent update in progress on the specified container
* instance . If the container agent becomes disconnected while it is in a transitional stage , such as
* < code > PENDING < / code > or < code > STAGING < / code > , the update process can get stuck in that state . However ,
* when the agent reconnects , it resumes where it stopped previously .
* @ throws NoUpdateAvailableException
* There is no update available for this Amazon ECS container agent . This could be because the agent is
* already running the latest version , or it is so old that there is no update path to the current version .
* @ throws MissingVersionException
* Amazon ECS is unable to determine the current version of the Amazon ECS container agent on the container
* instance and does not have enough information to proceed with an update . This could be because the agent
* running on the container instance is an older or custom version that does not use our version
* information .
* @ sample AmazonECS . UpdateContainerAgent
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ecs - 2014-11-13 / UpdateContainerAgent " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public UpdateContainerAgentResult updateContainerAgent ( UpdateContainerAgentRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeUpdateContainerAgent ( request ) ; |
public class CommerceRegionUtil { /** * Returns the last commerce region in the ordered set where commerceCountryId = & # 63 ; .
* @ param commerceCountryId the commerce country ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the last matching commerce region , or < code > null < / code > if a matching commerce region could not be found */
public static CommerceRegion fetchByCommerceCountryId_Last ( long commerceCountryId , OrderByComparator < CommerceRegion > orderByComparator ) { } } | return getPersistence ( ) . fetchByCommerceCountryId_Last ( commerceCountryId , orderByComparator ) ; |
public class FileReportGenerator { /** * Utility method to guess the output name generated for this output parameter .
* @ param output the specified output .
* @ return the real generated filename . */
public String outputNameFor ( String output ) { } } | Report report = openReport ( output ) ; return outputNameOf ( report ) ; |
public class RAMJobStore { /** * Get a handle to the next trigger to be fired , and mark it as ' reserved ' by the calling
* scheduler .
* @ see # releaseAcquiredTrigger ( SchedulingContext , Trigger ) */
@ Override public List < OperableTrigger > acquireNextTriggers ( long noLaterThan , int maxCount , long timeWindow ) { } } | synchronized ( lock ) { List < OperableTrigger > result = new ArrayList < OperableTrigger > ( ) ; while ( true ) { TriggerWrapper tw ; try { tw = timeWrappedTriggers . first ( ) ; if ( tw == null ) { return result ; } timeWrappedTriggers . remove ( tw ) ; } catch ( java . util . NoSuchElementException nsee ) { return result ; } if ( tw . trigger . getNextFireTime ( ) == null ) { continue ; } if ( applyMisfire ( tw ) ) { if ( tw . trigger . getNextFireTime ( ) != null ) { timeWrappedTriggers . add ( tw ) ; } continue ; } if ( tw . getTrigger ( ) . getNextFireTime ( ) . getTime ( ) > noLaterThan + timeWindow ) { timeWrappedTriggers . add ( tw ) ; return result ; } tw . state = TriggerWrapper . STATE_ACQUIRED ; tw . trigger . setFireInstanceId ( getFiredTriggerRecordId ( ) ) ; OperableTrigger trig = ( OperableTrigger ) tw . trigger . clone ( ) ; result . add ( trig ) ; if ( result . size ( ) == maxCount ) { return result ; } } } |
public class ResumeProcessesRequest { /** * One or more of the following processes . If you omit this parameter , all processes are specified .
* < ul >
* < li >
* < code > Launch < / code >
* < / li >
* < li >
* < code > Terminate < / code >
* < / li >
* < li >
* < code > HealthCheck < / code >
* < / li >
* < li >
* < code > ReplaceUnhealthy < / code >
* < / li >
* < li >
* < code > AZRebalance < / code >
* < / li >
* < li >
* < code > AlarmNotification < / code >
* < / li >
* < li >
* < code > ScheduledActions < / code >
* < / li >
* < li >
* < code > AddToLoadBalancer < / code >
* < / li >
* < / ul >
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setScalingProcesses ( java . util . Collection ) } or { @ link # withScalingProcesses ( java . util . Collection ) } if you
* want to override the existing values .
* @ param scalingProcesses
* One or more of the following processes . If you omit this parameter , all processes are specified . < / p >
* < ul >
* < li >
* < code > Launch < / code >
* < / li >
* < li >
* < code > Terminate < / code >
* < / li >
* < li >
* < code > HealthCheck < / code >
* < / li >
* < li >
* < code > ReplaceUnhealthy < / code >
* < / li >
* < li >
* < code > AZRebalance < / code >
* < / li >
* < li >
* < code > AlarmNotification < / code >
* < / li >
* < li >
* < code > ScheduledActions < / code >
* < / li >
* < li >
* < code > AddToLoadBalancer < / code >
* < / li >
* @ return Returns a reference to this object so that method calls can be chained together . */
public ResumeProcessesRequest withScalingProcesses ( String ... scalingProcesses ) { } } | if ( this . scalingProcesses == null ) { setScalingProcesses ( new com . amazonaws . internal . SdkInternalList < String > ( scalingProcesses . length ) ) ; } for ( String ele : scalingProcesses ) { this . scalingProcesses . add ( ele ) ; } return this ; |
public class ListWidget { /** * This method is called if the data set has been changed . Subclasses might want to override
* this method to add some extra logic .
* Go through all items in the list :
* - reuse the existing views in the list
* - add new views in the list if needed
* - trim the unused views
* - request re - layout
* @ param preferableCenterPosition the preferable center position . If it is - 1 - keep the
* current center position . */
private void onChangedImpl ( final int preferableCenterPosition ) { } } | for ( ListOnChangedListener listener : mOnChangedListeners ) { listener . onChangedStart ( this ) ; } Log . d ( Log . SUBSYSTEM . LAYOUT , TAG , "onChangedImpl(%s): items [%d] views [%d] mLayouts.size() = %d " + "preferableCenterPosition = %d" , getName ( ) , getDataCount ( ) , getViewCount ( ) , mContent . mLayouts . size ( ) , preferableCenterPosition ) ; // TODO : selectively recycle data based on the changes in the data set
mPreferableCenterPosition = preferableCenterPosition ; recycleChildren ( ) ; |
public class FullDTDReader { /** * Method that may need to be called by attribute default value
* validation code , during parsing . . . .
* Note : see base class for some additional remarks about this
* method . */
@ Override public EntityDecl findEntity ( String entName ) { } } | if ( mPredefdGEs != null ) { EntityDecl decl = mPredefdGEs . get ( entName ) ; if ( decl != null ) { return decl ; } } return mGeneralEntities . get ( entName ) ; |
public class CommerceUserSegmentCriterionPersistenceImpl { /** * Returns the first commerce user segment criterion in the ordered set where commerceUserSegmentEntryId = & # 63 ; .
* @ param commerceUserSegmentEntryId the commerce user segment entry ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the first matching commerce user segment criterion
* @ throws NoSuchUserSegmentCriterionException if a matching commerce user segment criterion could not be found */
@ Override public CommerceUserSegmentCriterion findByCommerceUserSegmentEntryId_First ( long commerceUserSegmentEntryId , OrderByComparator < CommerceUserSegmentCriterion > orderByComparator ) throws NoSuchUserSegmentCriterionException { } } | CommerceUserSegmentCriterion commerceUserSegmentCriterion = fetchByCommerceUserSegmentEntryId_First ( commerceUserSegmentEntryId , orderByComparator ) ; if ( commerceUserSegmentCriterion != null ) { return commerceUserSegmentCriterion ; } StringBundler msg = new StringBundler ( 4 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "commerceUserSegmentEntryId=" ) ; msg . append ( commerceUserSegmentEntryId ) ; msg . append ( "}" ) ; throw new NoSuchUserSegmentCriterionException ( msg . toString ( ) ) ; |
public class Container { /** * Returns true if a connection can be established to the given socket address within the
* timeout provided .
* @ param socketAddress
* socket address
* @ param timeoutMsecs
* timeout
* @ return true if a connection can be established to the given socket address */
public static boolean isSocketAlive ( final SocketAddress socketAddress , final int timeoutMsecs ) { } } | final Socket socket = new Socket ( ) ; try { socket . connect ( socketAddress , timeoutMsecs ) ; socket . close ( ) ; return true ; } catch ( final SocketTimeoutException exception ) { return false ; } catch ( final IOException exception ) { return false ; } |
public class HttpServiceTracker { /** * Change the servlet properties to these properties .
* @ param servlet
* @ param properties
* @ return */
public boolean changeServletProperties ( Servlet servlet , Dictionary < String , String > properties ) { } } | if ( servlet instanceof WebappServlet ) { Dictionary < String , String > dictionary = ( ( WebappServlet ) servlet ) . getProperties ( ) ; properties = BaseBundleActivator . putAll ( properties , dictionary ) ; } return this . setServletProperties ( servlet , properties ) ; |
public class MtasFunctionParserFunctionBasic { /** * Basic .
* @ param operator the operator
* @ param item the item
* @ throws ParseException the parse exception */
private void basic ( String operator , MtasFunctionParserItem item ) throws ParseException { } } | if ( ! defined ( ) ) { String type = item . getType ( ) ; MtasFunctionParserFunction parser ; tmpOperatorList . add ( operator ) ; if ( operator . equals ( BASIC_OPERATOR_DIVIDE ) ) { dataType = CodecUtil . DATA_TYPE_DOUBLE ; } switch ( type ) { case MtasFunctionParserItem . TYPE_N : tmpTypeList . add ( type ) ; tmpIdList . add ( 0 ) ; needPositions = true ; if ( sumRule && degree != null ) { if ( operator . equals ( BASIC_OPERATOR_ADD ) || operator . equals ( BASIC_OPERATOR_SUBTRACT ) ) { if ( degree < 0 ) { sumRule = false ; degree = null ; } else if ( degree > 0 ) { sumRule = false ; } } else if ( operator . equals ( BASIC_OPERATOR_POWER ) && ( degree != 0 ) ) { sumRule = false ; degree = null ; } } break ; case MtasFunctionParserItem . TYPE_ARGUMENT : tmpTypeList . add ( type ) ; tmpIdList . add ( item . getId ( ) ) ; needArgument . add ( item . getId ( ) ) ; if ( sumRule && degree != null ) { if ( operator . equals ( BASIC_OPERATOR_ADD ) || operator . equals ( BASIC_OPERATOR_SUBTRACT ) ) { if ( degree != 1 ) { sumRule = false ; } if ( degree >= 0 ) { degree = Math . max ( degree , 1 ) ; } else { degree = null ; } } else if ( operator . equals ( BASIC_OPERATOR_MULTIPLY ) ) { if ( degree != 0 ) { sumRule = false ; } degree += 1 ; } else if ( operator . equals ( BASIC_OPERATOR_DIVIDE ) ) { sumRule = false ; degree -= 1 ; } else if ( operator . equals ( BASIC_OPERATOR_POWER ) ) { sumRule = false ; degree = null ; } } break ; case MtasFunctionParserItem . TYPE_CONSTANT_LONG : tmpTypeList . add ( type ) ; tmpIdList . add ( tmpConstantLongs . size ( ) ) ; tmpConstantLongs . add ( item . getValueLong ( ) ) ; if ( sumRule && degree != null ) { if ( operator . equals ( BASIC_OPERATOR_ADD ) || operator . equals ( BASIC_OPERATOR_SUBTRACT ) ) { if ( degree < 0 ) { sumRule = false ; degree = null ; } else if ( degree > 0 ) { sumRule = false ; } } else if ( operator . equals ( BASIC_OPERATOR_POWER ) && ( degree != 0 ) ) { sumRule = false ; degree = null ; } } break ; case MtasFunctionParserItem . TYPE_CONSTANT_DOUBLE : tmpTypeList . add ( type ) ; tmpIdList . add ( tmpConstantDoubles . size ( ) ) ; dataType = CodecUtil . DATA_TYPE_DOUBLE ; tmpConstantDoubles . add ( item . getValueDouble ( ) ) ; if ( sumRule && degree != null ) { if ( operator . equals ( BASIC_OPERATOR_ADD ) || operator . equals ( BASIC_OPERATOR_SUBTRACT ) ) { if ( degree < 0 ) { sumRule = false ; degree = null ; } else if ( degree > 0 ) { sumRule = false ; } } else if ( operator . equals ( BASIC_OPERATOR_POWER ) && ( degree != 0 ) ) { sumRule = false ; degree = null ; } } break ; case MtasFunctionParserItem . TYPE_PARSER_LONG : tmpTypeList . add ( type ) ; tmpIdList . add ( tmpParserLongs . size ( ) ) ; parser = item . getParser ( ) ; parser . close ( ) ; tmpParserLongs . add ( parser ) ; sumRule = sumRule ? parser . sumRule ( ) : false ; needPositions = needPositions ? needPositions : parser . needPositions ( ) ; needArgument . addAll ( parser . needArgument ) ; if ( sumRule && degree != null ) { if ( operator . equals ( BASIC_OPERATOR_ADD ) || operator . equals ( BASIC_OPERATOR_SUBTRACT ) ) { if ( ! parser . degree . equals ( degree ) ) { sumRule = false ; if ( degree < 0 ) { degree = null ; } else { degree = Math . max ( degree , parser . degree ) ; } } } else if ( operator . equals ( BASIC_OPERATOR_MULTIPLY ) ) { if ( degree != 0 || parser . degree != 0 ) { sumRule = false ; } degree += parser . degree ; } else if ( operator . equals ( BASIC_OPERATOR_POWER ) && ( degree != 0 ) ) { sumRule = false ; degree = null ; } } break ; case MtasFunctionParserItem . TYPE_PARSER_DOUBLE : tmpTypeList . add ( type ) ; tmpIdList . add ( tmpParserDoubles . size ( ) ) ; dataType = CodecUtil . DATA_TYPE_DOUBLE ; parser = item . getParser ( ) ; parser . close ( ) ; tmpParserDoubles . add ( parser ) ; sumRule = sumRule ? parser . sumRule ( ) : false ; needPositions = needPositions ? needPositions : parser . needPositions ( ) ; needArgument . addAll ( parser . needArgument ) ; if ( sumRule && degree != null ) { if ( operator . equals ( BASIC_OPERATOR_ADD ) || operator . equals ( BASIC_OPERATOR_SUBTRACT ) ) { if ( ! parser . degree . equals ( degree ) ) { sumRule = false ; if ( degree < 0 ) { degree = null ; } else { degree = Math . max ( degree , parser . degree ) ; } } } else if ( operator . equals ( BASIC_OPERATOR_MULTIPLY ) ) { if ( degree != 0 || parser . degree != 0 ) { sumRule = false ; } degree += parser . degree ; } else if ( operator . equals ( BASIC_OPERATOR_POWER ) && ( degree != 0 ) ) { sumRule = false ; degree = null ; } } break ; default : throw new ParseException ( "incorrect type" ) ; } } else { throw new ParseException ( "already defined" ) ; } |
public class Dom { /** * < p > Creates a new DOM element in the given name - space . If the name - space is HTML , a normal element will be
* created . < / p > < p > There is an exception when using Internet Explorer ! For Internet Explorer a new element will be
* created of type " namespace : tag " . < / p >
* @ param ns The name - space to be used in the element creation .
* @ param tag The tag - name to be used in the element creation .
* @ return Returns a newly created DOM element in the given name - space . */
public static Element createElementNS ( String ns , String tag ) { } } | return IMPL . createElementNS ( ns , tag ) ; |
public class Parse { /** * Designates that the specifed punctuation follows this parse .
* @ param punct The punctuation set . */
public void addNextPunctuation ( Parse punct ) { } } | if ( this . nextPunctSet == null ) { this . nextPunctSet = new LinkedHashSet ( ) ; } nextPunctSet . add ( punct ) ; |
public class SubPlanAssembler { /** * Insert a send receive pair above the supplied scanNode .
* @ param scanNode that needs to be distributed
* @ return return the newly created receive node ( which is linked to the new sends ) */
protected static AbstractPlanNode addSendReceivePair ( AbstractPlanNode scanNode ) { } } | SendPlanNode sendNode = new SendPlanNode ( ) ; sendNode . addAndLinkChild ( scanNode ) ; ReceivePlanNode recvNode = new ReceivePlanNode ( ) ; recvNode . addAndLinkChild ( sendNode ) ; return recvNode ; |
public class LdapConnection { /** * Clone the given { @ link NamingNumeration } .
* @ param results The results to clone .
* @ param clone1 { @ link CachedNamingEnumeration } with the original results .
* @ param clone2 { @ link CachedNamingEnumeration } with the cloned results .
* @ return The number of entries in the results .
* @ throws WIMSystemException If the results could not be cloned . */
@ FFDCIgnore ( SizeLimitExceededException . class ) private static int cloneSearchResults ( NamingEnumeration < SearchResult > results , CachedNamingEnumeration clone1 , CachedNamingEnumeration clone2 ) throws WIMSystemException { } } | final String METHODNAME = "cloneSearchResults(NamingEnumeration, CachedNamingEnumeration, CachedNamingEnumeration)" ; int count = 0 ; try { while ( results . hasMore ( ) ) { SearchResult result = results . nextElement ( ) ; Attributes attrs = ( Attributes ) result . getAttributes ( ) . clone ( ) ; SearchResult cachedResult = new SearchResult ( result . getName ( ) , null , null , attrs ) ; clone1 . add ( result ) ; clone2 . add ( cachedResult ) ; count ++ ; } } catch ( SizeLimitExceededException e ) { // if size limit is reached because of LDAP server limit , then log the result
// and return the available results
if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , METHODNAME + " " + e . toString ( true ) , e ) ; } catch ( NamingException e ) { String msg = Tr . formatMessage ( tc , WIMMessageKey . NAMING_EXCEPTION , WIMMessageHelper . generateMsgParms ( e . toString ( true ) ) ) ; throw new WIMSystemException ( WIMMessageKey . NAMING_EXCEPTION , msg , e ) ; } return count ; |
public class DOM2DTM { /** * Directly call the
* characters method on the passed ContentHandler for the
* string - value of the given node ( see http : / / www . w3 . org / TR / xpath # data - model
* for the definition of a node ' s string - value ) . Multiple calls to the
* ContentHandler ' s characters methods may well occur for a single call to
* this method .
* @ param nodeHandle The node ID .
* @ param ch A non - null reference to a ContentHandler .
* @ throws org . xml . sax . SAXException */
public void dispatchCharactersEvents ( int nodeHandle , org . xml . sax . ContentHandler ch , boolean normalize ) throws org . xml . sax . SAXException { } } | if ( normalize ) { XMLString str = getStringValue ( nodeHandle ) ; str = str . fixWhiteSpace ( true , true , false ) ; str . dispatchCharactersEvents ( ch ) ; } else { int type = getNodeType ( nodeHandle ) ; Node node = getNode ( nodeHandle ) ; dispatchNodeData ( node , ch , 0 ) ; // Text coalition - - a DTM text node may represent multiple
// DOM nodes .
if ( TEXT_NODE == type || CDATA_SECTION_NODE == type ) { while ( null != ( node = logicalNextDOMTextNode ( node ) ) ) { dispatchNodeData ( node , ch , 0 ) ; } } } |
public class DialogPreference { /** * Sets the margin of the preference ' s dialog .
* @ param left
* The left margin , which should be set , in pixels as an { @ link Integer } value . The left
* margin must be at least 0
* @ param top
* The left margin , which should be set , in pixels as an { @ link Integer } value . The left
* margin must be at least 0
* @ param right
* The left margin , which should be set , in pixels as an { @ link Integer } value . The left
* margin must be at least 0
* @ param bottom
* The left margin , which should be set , in pixels as an { @ link Integer } value . The left
* margin must be at least 0 */
public final void setDialogMargin ( final int left , final int top , final int right , final int bottom ) { } } | this . dialogMargin = new int [ ] { left , top , right , bottom } ; |
public class Viennet4 { /** * EvaluateConstraints ( ) method */
private void evaluateConstraints ( DoubleSolution solution ) { } } | double [ ] constraint = new double [ this . getNumberOfConstraints ( ) ] ; double x1 = solution . getVariableValue ( 0 ) ; double x2 = solution . getVariableValue ( 1 ) ; constraint [ 0 ] = - x2 - ( 4.0 * x1 ) + 4.0 ; constraint [ 1 ] = x1 + 1.0 ; constraint [ 2 ] = x2 - x1 + 2.0 ; double overallConstraintViolation = 0.0 ; int violatedConstraints = 0 ; for ( int i = 0 ; i < getNumberOfConstraints ( ) ; i ++ ) { if ( constraint [ i ] < 0.0 ) { overallConstraintViolation += constraint [ i ] ; violatedConstraints ++ ; } } overallConstraintViolationDegree . setAttribute ( solution , overallConstraintViolation ) ; numberOfViolatedConstraints . setAttribute ( solution , violatedConstraints ) ; |
public class MapTileCollisionRendererModel { /** * Render horizontal collision from current vector .
* @ param g The graphic buffer .
* @ param function The collision function .
* @ param range The collision range .
* @ param th The tile height .
* @ param y The current vertical location . */
private static void renderX ( Graphic g , CollisionFunction function , CollisionRange range , int th , int y ) { } } | if ( UtilMath . isBetween ( y , range . getMinY ( ) , range . getMaxY ( ) ) ) { g . drawRect ( function . getRenderX ( y ) , th - y - 1 , 0 , 0 , false ) ; } |
public class PathUtil { /** * create a path from an array of components
* @ param components path components strings
* @ return a path string */
public static String pathStringFromComponents ( String [ ] components ) { } } | if ( null == components || components . length == 0 ) { return null ; } return cleanPath ( join ( components , SEPARATOR ) ) ; |
public class RedundentExprEliminator { /** * To be removed . */
protected int oldFindAndEliminateRedundant ( int start , int firstOccuranceIndex , ExpressionOwner firstOccuranceOwner , ElemTemplateElement psuedoVarRecipient , Vector paths ) throws org . w3c . dom . DOMException { } } | QName uniquePseudoVarName = null ; boolean foundFirst = false ; int numPathsFound = 0 ; int n = paths . size ( ) ; Expression expr1 = firstOccuranceOwner . getExpression ( ) ; if ( DEBUG ) assertIsLocPathIterator ( expr1 , firstOccuranceOwner ) ; boolean isGlobal = ( paths == m_absPaths ) ; LocPathIterator lpi = ( LocPathIterator ) expr1 ; for ( int j = start ; j < n ; j ++ ) { ExpressionOwner owner2 = ( ExpressionOwner ) paths . elementAt ( j ) ; if ( null != owner2 ) { Expression expr2 = owner2 . getExpression ( ) ; boolean isEqual = expr2 . deepEquals ( lpi ) ; if ( isEqual ) { LocPathIterator lpi2 = ( LocPathIterator ) expr2 ; if ( ! foundFirst ) { foundFirst = true ; // Insert variable decl into psuedoVarRecipient
// We want to insert this into the first legitimate
// position for a variable .
ElemVariable var = createPseudoVarDecl ( psuedoVarRecipient , lpi , isGlobal ) ; if ( null == var ) return 0 ; uniquePseudoVarName = var . getName ( ) ; changeToVarRef ( uniquePseudoVarName , firstOccuranceOwner , paths , psuedoVarRecipient ) ; // Replace the first occurance with the variable ' s XPath , so
// that further reduction may take place if needed .
paths . setElementAt ( var . getSelect ( ) , firstOccuranceIndex ) ; numPathsFound ++ ; } changeToVarRef ( uniquePseudoVarName , owner2 , paths , psuedoVarRecipient ) ; // Null out the occurance , so we don ' t have to test it again .
paths . setElementAt ( null , j ) ; // foundFirst = true ;
numPathsFound ++ ; } } } // Change all globals in xsl : templates , etc , to global vars no matter what .
if ( ( 0 == numPathsFound ) && ( paths == m_absPaths ) ) { ElemVariable var = createPseudoVarDecl ( psuedoVarRecipient , lpi , true ) ; if ( null == var ) return 0 ; uniquePseudoVarName = var . getName ( ) ; changeToVarRef ( uniquePseudoVarName , firstOccuranceOwner , paths , psuedoVarRecipient ) ; paths . setElementAt ( var . getSelect ( ) , firstOccuranceIndex ) ; numPathsFound ++ ; } return numPathsFound ; |
public class DrawableContainerCompat { /** * Sets the currently displayed drawable by index .
* If an invalid index is specified , the current drawable will be set to
* { @ code null } and the index will be set to { @ code - 1 } .
* @ param index the index of the drawable to display
* @ return { @ code true } if the drawable changed , { @ code false } otherwise */
boolean selectDrawable ( int index ) { } } | if ( index == mCurIndex ) { return false ; } final long now = SystemClock . uptimeMillis ( ) ; if ( DEBUG ) { android . util . Log . i ( TAG , toString ( ) + " from " + mCurIndex + " to " + index + ": exit=" + mDrawableContainerState . mExitFadeDuration + " enter=" + mDrawableContainerState . mEnterFadeDuration ) ; } if ( mDrawableContainerState . mExitFadeDuration > 0 ) { if ( mLastDrawable != null ) { mLastDrawable . setVisible ( false , false ) ; } if ( mCurrDrawable != null ) { mLastDrawable = mCurrDrawable ; mLastIndex = mCurIndex ; mExitAnimationEnd = now + mDrawableContainerState . mExitFadeDuration ; } else { mLastDrawable = null ; mLastIndex = - 1 ; mExitAnimationEnd = 0 ; } } else if ( mCurrDrawable != null ) { mCurrDrawable . setVisible ( false , false ) ; } if ( index >= 0 && index < mDrawableContainerState . mNumChildren ) { final Drawable d = mDrawableContainerState . getChild ( index ) ; mCurrDrawable = d ; mCurIndex = index ; if ( d != null ) { if ( mDrawableContainerState . mEnterFadeDuration > 0 ) { mEnterAnimationEnd = now + mDrawableContainerState . mEnterFadeDuration ; } initializeDrawableForDisplay ( d ) ; } } else { mCurrDrawable = null ; mCurIndex = - 1 ; } if ( mEnterAnimationEnd != 0 || mExitAnimationEnd != 0 ) { if ( mAnimationRunnable == null ) { mAnimationRunnable = new Runnable ( ) { @ Override public void run ( ) { animate ( true ) ; invalidateSelf ( ) ; } } ; } else { unscheduleSelf ( mAnimationRunnable ) ; } // Compute first frame and schedule next animation .
animate ( true ) ; } invalidateSelf ( ) ; return true ; |
public class ThreadPoolManager { /** * 前一个任务结束 , 等待固定时间 , 下一个任务开始执行
* @ param runnable 你要提交的任务
* @ param delayInMilli 前一个任务结束后多久开始进行下一个任务 , 单位毫秒 */
public static ScheduledFuture scheduleWithFixedDelay ( Runnable runnable , long delayInMilli ) { } } | /* 我们默认设定一个runnable生命周期与一个msgId一一对应 */
Runnable proxy = wrapRunnable ( runnable , null ) ; return newSingleThreadScheduler ( ) . scheduleWithFixedDelay ( proxy , 0 , delayInMilli , TimeUnit . MILLISECONDS ) ; |
public class ExecuteMethodValidatorChecker { protected boolean isCannotNotEmptyType ( Class < ? > fieldType ) { } } | return Number . class . isAssignableFrom ( fieldType ) // Integer , Long , . . .
|| int . class . equals ( fieldType ) || long . class . equals ( fieldType ) // primitive numbers
|| TemporalAccessor . class . isAssignableFrom ( fieldType ) // LocalDate , . . .
|| java . util . Date . class . isAssignableFrom ( fieldType ) // old date
|| Boolean . class . isAssignableFrom ( fieldType ) || boolean . class . equals ( fieldType ) // boolean
|| Classification . class . isAssignableFrom ( fieldType ) ; // CDef |
public class WebSiteManagementClientImpl { /** * Validate if a resource can be created .
* Validate if a resource can be created .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param validateRequest Request with the resources to validate .
* @ 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 < ValidateResponseInner > validateAsync ( String resourceGroupName , ValidateRequest validateRequest , final ServiceCallback < ValidateResponseInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( validateWithServiceResponseAsync ( resourceGroupName , validateRequest ) , serviceCallback ) ; |
public class ProcessorExsltFunction { /** * End an ElemExsltFunction , and verify its validity . */
public void endElement ( StylesheetHandler handler , String uri , String localName , String rawName ) throws SAXException { } } | ElemTemplateElement function = handler . getElemTemplateElement ( ) ; validate ( function , handler ) ; // may throw exception
super . endElement ( handler , uri , localName , rawName ) ; |
public class SearchExpressionFacade { /** * Checks if the given expression can be nested . e . g . @ form : @ parent This should not be possible e . g . with @ none or @ all .
* @ param expression The search expression .
* @ return < code > true < / code > if it ' s nestable . */
protected static boolean isNestable ( String expression ) { } } | return ! ( expression . contains ( SearchExpressionConstants . ALL_KEYWORD ) || expression . contains ( SearchExpressionConstants . NONE_KEYWORD ) || expression . contains ( SearchExpressionConstants . PFS_PREFIX ) ) ; |
public class NarUtil { /** * Returns the Bcel Class corresponding to the given class filename
* @ param filename
* the absolute file name of the class
* @ return the Bcel Class .
* @ throws IOException */
public static JavaClass getBcelClass ( final String filename ) throws IOException { } } | final ClassParser parser = new ClassParser ( filename ) ; return parser . parse ( ) ; |
public class AbstractAggregatorImpl { /** * Returns a mapping of resource aliases to IResources defined in the init - params .
* If the IResource is null , then the alias is for the aggregator itself rather
* than a resource location .
* @ param initParams
* The aggregator init - params
* @ return Mapping of aliases to IResources */
protected Map < String , URI > getPathsAndAliases ( InitParams initParams ) { } } | final String sourceMethod = "getPahtsAndAliases" ; // $ NON - NLS - 1 $
boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( AbstractAggregatorImpl . class . getName ( ) , sourceMethod , new Object [ ] { initParams } ) ; } Map < String , URI > resourcePaths = new HashMap < String , URI > ( ) ; List < String > aliases = initParams . getValues ( InitParams . ALIAS_INITPARAM ) ; for ( String alias : aliases ) { addAlias ( alias , null , "alias" , resourcePaths ) ; // $ NON - NLS - 1 $
} List < String > resourceIds = initParams . getValues ( InitParams . RESOURCEID_INITPARAM ) ; for ( String resourceId : resourceIds ) { aliases = initParams . getValues ( resourceId + ":alias" ) ; // $ NON - NLS - 1 $
List < String > baseNames = initParams . getValues ( resourceId + ":base-name" ) ; // $ NON - NLS - 1 $
if ( aliases == null || aliases . size ( ) != 1 ) { throw new IllegalArgumentException ( resourceId + ":aliases" ) ; // $ NON - NLS - 1 $
} if ( baseNames == null || baseNames . size ( ) != 1 ) { throw new IllegalArgumentException ( resourceId + ":base-name" ) ; // $ NON - NLS - 1 $
} String alias = aliases . get ( 0 ) ; String baseName = baseNames . get ( 0 ) ; // make sure not root path
boolean isPathComp = false ; for ( String part : alias . split ( "/" ) ) { // $ NON - NLS - 1 $
if ( part . length ( ) > 0 ) { isPathComp = true ; break ; } } // Make sure basename doesn ' t start with ' / '
if ( baseName . startsWith ( "/" ) ) { // $ NON - NLS - 1 $
throw new IllegalArgumentException ( "Root relative base-name not allowed: " + baseName ) ; // $ NON - NLS - 1 $
} if ( ! isPathComp ) { throw new IllegalArgumentException ( resourceId + ":alias = " + alias ) ; // $ NON - NLS - 1 $
} addAlias ( alias , URI . create ( baseName ) , resourceId + ":alias" , resourcePaths ) ; // $ NON - NLS - 1 $
} if ( isTraceLogging ) { log . exiting ( AbstractAggregatorImpl . class . getName ( ) , sourceMethod , resourcePaths ) ; } return Collections . unmodifiableMap ( resourcePaths ) ; |
public class PICTImageReader { /** * Read a long comment from the stream . */
private byte [ ] readLongComment ( final DataInput pStream ) throws IOException { } } | // Comment kind and data byte count
short kind = pStream . readShort ( ) ; int length = pStream . readUnsignedShort ( ) ; if ( DEBUG ) { System . out . println ( "Long comment: " + kind + ", " + length + " bytes" ) ; } // Get as many bytes as indicated by byte count
byte [ ] bytes = new byte [ length ] ; pStream . readFully ( bytes , 0 , length ) ; return bytes ; |
public class JUnitMatchers { /** * This is useful for fluently combining matchers where either may pass , for example :
* < pre >
* assertThat ( string , either ( containsString ( " a " ) ) . or ( containsString ( " b " ) ) ) ;
* < / pre >
* @ deprecated Please use { @ link CoreMatchers # either ( Matcher ) } instead . */
@ Deprecated public static < T > CombinableEitherMatcher < T > either ( Matcher < ? super T > matcher ) { } } | return CoreMatchers . either ( matcher ) ; |
public class DateValidityChecker { /** * Method that checks the time validity . Uses the standard Certificate . checkValidity method .
* @ throws CertPathValidatorException If certificate has expired or is not yet valid . */
public void invoke ( X509Certificate cert , GSIConstants . CertificateType certType ) throws CertPathValidatorException { } } | try { cert . checkValidity ( ) ; } catch ( CertificateExpiredException e ) { throw new CertPathValidatorException ( "Certificate " + cert . getSubjectDN ( ) + " expired" , e ) ; } catch ( CertificateNotYetValidException e ) { throw new CertPathValidatorException ( "Certificate " + cert . getSubjectDN ( ) + " not yet valid." , e ) ; } |
public class ChineseCalendar { /** * Return the major solar term on or before a given date . This
* will be an integer from 1 . . 12 , with 1 corresponding to 330 degrees ,
* 2 to 0 degrees , 3 to 30 degrees , . . . , and 12 to 300 degrees .
* @ param days days after January 1 , 1970 0:00 Asia / Shanghai */
private int majorSolarTerm ( int days ) { } } | astro . setTime ( daysToMillis ( days ) ) ; // Compute ( floor ( solarLongitude / ( pi / 6 ) ) + 2 ) % 12
int term = ( ( int ) Math . floor ( 6 * astro . getSunLongitude ( ) / Math . PI ) + 2 ) % 12 ; if ( term < 1 ) { term += 12 ; } return term ; |
public class Permute { /** * This will undo a permutation . */
public boolean previous ( ) { } } | if ( indexes . length <= 1 || permutation <= 0 ) return false ; int N = indexes . length - 2 ; int k = N ; while ( counters [ k ] <= k ) { k -- ; } swap ( counters [ k ] , k ) ; counters [ k ] -- ; swap ( k , counters [ k ] ) ; int foo = k + 1 ; while ( counters [ k + 1 ] == k + 1 && k < indexes . length - 2 ) { k ++ ; swap ( k , indexes . length - 1 ) ; } for ( int i = foo ; i < indexes . length - 1 ; i ++ ) { counters [ i ] = indexes . length - 1 ; } permutation -- ; return true ; |
public class TypeMetadata { /** * Return a copy of this TypeMetadata with the metadata entry for all kinds from { @ code other }
* combined with the same kind from this .
* @ param other the TypeMetadata to combine with this
* @ return a new TypeMetadata updated with all entries from { @ code other } */
public TypeMetadata combineAll ( TypeMetadata other ) { } } | Assert . checkNonNull ( other ) ; TypeMetadata out = new TypeMetadata ( ) ; Set < Entry . Kind > keys = new HashSet < > ( contents . keySet ( ) ) ; keys . addAll ( other . contents . keySet ( ) ) ; for ( Entry . Kind key : keys ) { if ( contents . containsKey ( key ) ) { if ( other . contents . containsKey ( key ) ) { out . add ( key , contents . get ( key ) . combine ( other . contents . get ( key ) ) ) ; } else { out . add ( key , contents . get ( key ) ) ; } } else if ( other . contents . containsKey ( key ) ) { out . add ( key , other . contents . get ( key ) ) ; } } return out ; |
public class JacksonDBCollection { /** * Enable the given feature
* @ param feature The feature to enable
* @ return this object */
public JacksonDBCollection < T , K > enable ( Feature feature ) { } } | features . put ( feature , true ) ; return this ; |
public class PCMUtil { /** * A helper method to get a PCM ( share the limitation of _ loadPCMContainter )
* @ param filename
* @ return
* @ throws IOException */
public static PCM loadPCM ( String filename ) throws IOException { } } | PCMContainer pcmContainer = loadPCMContainer ( filename ) ; // Get the PCM
PCM pcm = pcmContainer . getPcm ( ) ; return pcm ; |
public class SCSIResponseParser { /** * { @ inheritDoc } */
@ Override protected final void checkIntegrity ( ) throws InternetSCSIException { } } | String exceptionMessage ; do { Utils . isReserved ( logicalUnitNumber ) ; if ( response != ServiceResponse . COMMAND_COMPLETED_AT_TARGET ) { if ( bidirectionalReadResidualOverflow || bidirectionalReadResidualUnderflow || residualOverflow || residualUnderflow ) { exceptionMessage = "Theses bits must to be 0, because the command is not completed at the target." ; break ; } if ( status != SCSIStatus . GOOD ) { exceptionMessage = "Status Code is only valid, because the command is not completed at the target." ; break ; } } if ( bidirectionalReadResidualOverflow && bidirectionalReadResidualUnderflow ) { exceptionMessage = "The 'o' and 'u' bits must be set mutal exclusion." ; break ; } if ( residualOverflow && residualUnderflow ) { exceptionMessage = "The 'O' and 'U' bits must be set mutal exclusion." ; break ; } if ( ( ! residualOverflow && ! residualUnderflow ) && residualCount != 0 ) { exceptionMessage = "ResidualCount is only valid either the ResidualOverflow or ResidualUnderflow-Flag is set." ; break ; } if ( ( ! bidirectionalReadResidualOverflow && ! bidirectionalReadResidualUnderflow ) && bidirectionalReadResidualCount != 0 ) { exceptionMessage = "BidirectionalResidualCount is only valid either the " + "BidirectionalResidualOverflow or BidirectionalResidualUnderflow-Flag is set." ; break ; } if ( response != ServiceResponse . COMMAND_COMPLETED_AT_TARGET && expectedDataSequenceNumber != 0 ) { exceptionMessage = "The ExpectedDataSequenceNumber is not valid, because the command is not " + "completed at the target." ; break ; } // message is checked correctly
return ; } while ( false ) ; throw new InternetSCSIException ( exceptionMessage ) ; |
public class ServiceAccessorImp { /** * ( non - Javadoc )
* @ see com . jdon . container . access . ServiceAccessor # getService ( com . jdon . container . access . UserTargetMetaDef ) */
public Object getService ( ) { } } | Debug . logVerbose ( "[JdonFramework] enter getService: " + ComponentKeys . PROXYINSTANCE_FACTORY + " in action" , module ) ; TargetMetaRequest targetMetaRequest = targetMetaRequestsHolder . getTargetMetaRequest ( ) ; targetMetaRequest . setVisitableName ( ComponentKeys . PROXYINSTANCE_FACTORY ) ; ComponentVisitor componentVisitor = targetMetaRequest . getComponentVisitor ( ) ; return componentVisitor . visit ( ) ; |
public class JDBCStoreResource { /** * The method is called from the transaction manager if the complete
* transaction is completed . < br / > Nothing is to do here , because the
* commitment is done by the { @ link ConnectionResource } instance .
* @ param _ xid global transaction identifier ( not used , because each file
* with the file id gets a new VFS store resource instance )
* @ param _ onePhase < i > true < / i > if it is a one phase commitment transaction
* ( not used ) */
@ Override public void commit ( final Xid _xid , final boolean _onePhase ) { } } | if ( JDBCStoreResource . LOG . isDebugEnabled ( ) ) { JDBCStoreResource . LOG . debug ( "commit (xid = " + _xid + ", one phase = " + _onePhase + ")" ) ; } |
public class JdepsFilter { /** * - - - - - Dependency . Filter - - - - - */
@ Override public boolean accepts ( Dependency d ) { } } | if ( d . getOrigin ( ) . equals ( d . getTarget ( ) ) ) return false ; // filter same package dependency
String pn = d . getTarget ( ) . getPackageName ( ) ; if ( filterSamePackage && d . getOrigin ( ) . getPackageName ( ) . equals ( pn ) ) { return false ; } // filter if the target package matches the given filter
if ( filterPattern != null && filterPattern . matcher ( pn ) . matches ( ) ) { return false ; } // filter if the target matches the given filtered package name or regex
return filter != null ? filter . accepts ( d ) : true ; |
public class Version { /** * Determines whether s is a positive number . If it is , the number is returned ,
* otherwise the result is - 1.
* @ param s The String to check .
* @ return The positive number ( incl . 0 ) if s a number , or - 1 if it is not . */
private static int isNumeric ( String s ) { } } | final char [ ] chars = s . toCharArray ( ) ; int num = 0 ; // note : this method does not account for leading zeroes as could occur in build
// meta data parts . Leading zeroes are thus simply ignored when parsing the
// number .
for ( int i = 0 ; i < chars . length ; ++ i ) { final char c = chars [ i ] ; if ( c >= '0' && c <= '9' ) { num = num * DECIMAL + Character . digit ( c , DECIMAL ) ; } else { return - 1 ; } } return num ; |
public class RecoverableUnitIdTable { /** * Return an array of all the objects currently
* held in the table .
* @ return An array of all the objects in the table */
public final synchronized Object [ ] getAllObjects ( ) { } } | if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getAllObjects" ) ; Object [ ] values = _idMap . values ( ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getAllObjects" , values ) ; return values ; |
public class DTDTypingNonValidator { /** * public XMLValidationSchema getSchema ( ) */
@ Override public void validateElementStart ( String localName , String uri , String prefix ) throws XMLStreamException { } } | // Ok , can we find the element definition ?
mTmpKey . reset ( prefix , localName ) ; DTDElement elem = mElemSpecs . get ( mTmpKey ) ; // whether it ' s found or not , let ' s add a stack frame :
int elemCount = mElemCount ++ ; if ( elemCount >= mElems . length ) { mElems = ( DTDElement [ ] ) DataUtil . growArrayBy50Pct ( mElems ) ; } mElems [ elemCount ] = mCurrElem = elem ; mAttrCount = 0 ; mIdAttrIndex = - 2 ; // -2 as a " don ' t know yet " marker
/* but if not found , can not obtain any type information . Not
* a validation problem though , since we are doing none . . .
* Oh , also , unlike with real validation , not having actual element
* information is ok ; can still have attributes ! */
if ( elem == null ) { // | | ! elem . isDefined ( ) )
mCurrAttrDefs = NO_ATTRS ; mHasAttrDefaults = false ; mCurrDefaultAttrs = null ; mHasNormalizableAttrs = false ; return ; } // If element found , does it have any attributes ?
mCurrAttrDefs = elem . getAttributes ( ) ; if ( mCurrAttrDefs == null ) { mCurrAttrDefs = NO_ATTRS ; mHasAttrDefaults = false ; mCurrDefaultAttrs = null ; mHasNormalizableAttrs = false ; return ; } // Any normalization needed ?
mHasNormalizableAttrs = mNormAttrs || elem . attrsNeedValidation ( ) ; // Any default values ?
mHasAttrDefaults = elem . hasAttrDefaultValues ( ) ; if ( mHasAttrDefaults ) { /* Special count also contains ones with # REQUIRED value , but
* that ' s a minor sub - optimality . . . */
int specCount = elem . getSpecialCount ( ) ; BitSet bs = mTmpDefaultAttrs ; if ( bs == null ) { mTmpDefaultAttrs = bs = new BitSet ( specCount ) ; } else { bs . clear ( ) ; } mCurrDefaultAttrs = bs ; } else { mCurrDefaultAttrs = null ; } |
public class BeanInfoUtil { /** * Determine if the descriptor is visible given a visibility constraint . */
public static boolean isVisible ( FeatureDescriptor descriptor , IScriptabilityModifier constraint ) { } } | if ( constraint == null ) { return true ; } IScriptabilityModifier modifier = getVisibilityModifier ( descriptor ) ; if ( modifier == null ) { return true ; } return modifier . satisfiesConstraint ( constraint ) ; |
public class XClosureImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setExplicitSyntax ( boolean newExplicitSyntax ) { } } | boolean oldExplicitSyntax = explicitSyntax ; explicitSyntax = newExplicitSyntax ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , XbasePackage . XCLOSURE__EXPLICIT_SYNTAX , oldExplicitSyntax , explicitSyntax ) ) ; |
public class DirectoryHelper { /** * Safely close { @ link Closeable } instance . Log error
* in case of exception . */
public static void safeClose ( Closeable obj ) { } } | try { obj . close ( ) ; } catch ( IOException e ) { LOG . error ( "Error while closing " + obj , e ) ; } |
public class GaussianArray { /** * 由于sigma和dim使用了常数 , 所以高期总卷积最终是固定的 , 不需要每次都计算出来 , 可以先计算好然后缓存起来 。 */
public static float [ ] makeMask ( float sigma , int dim ) { } } | // 卷积核必须是奇数 , 才能有一个明显的中心核 :
dim |= 1 ; // 保证奇数矩阵
float [ ] mask = new float [ dim ] ; float sigma2sq = 2 * sigma * sigma ; float normalizeFactor = 1.0f / ( ( float ) Math . sqrt ( 2.0 * Math . PI ) * sigma ) ; for ( int i = 0 ; i < dim ; i ++ ) { int relPos = i - mask . length / 2 ; float G = ( relPos * relPos ) / sigma2sq ; G = ( float ) Math . exp ( - G ) ; G *= normalizeFactor ; mask [ i ] = G ; } return mask ; |
public class DescribeResourcePoliciesResult { /** * The resource policies that exist in this account .
* @ param resourcePolicies
* The resource policies that exist in this account . */
public void setResourcePolicies ( java . util . Collection < ResourcePolicy > resourcePolicies ) { } } | if ( resourcePolicies == null ) { this . resourcePolicies = null ; return ; } this . resourcePolicies = new com . amazonaws . internal . SdkInternalList < ResourcePolicy > ( resourcePolicies ) ; |
public class CacheManagerBuilder { /** * Adds a { @ link CacheConfiguration } linked to the specified alias to the returned builder .
* @ param alias the cache alias
* @ param configuration the { @ code CacheConfiguration }
* @ param < K > the cache key type
* @ param < V > the cache value type
* @ return a new builder with the added cache configuration
* @ see CacheConfigurationBuilder */
public < K , V > CacheManagerBuilder < T > withCache ( String alias , CacheConfiguration < K , V > configuration ) { } } | return new CacheManagerBuilder < > ( this , configBuilder . addCache ( alias , configuration ) ) ; |
public class IntrospectionResultToSchema { /** * Returns a IDL Document that reprSesents the schema as defined by the introspection result map
* @ param introspectionResult the result of an introspection query on a schema
* @ return a IDL Document of the schema */
@ SuppressWarnings ( "unchecked" ) public Document createSchemaDefinition ( Map < String , Object > introspectionResult ) { } } | assertTrue ( introspectionResult . get ( "__schema" ) != null , "__schema expected" ) ; Map < String , Object > schema = ( Map < String , Object > ) introspectionResult . get ( "__schema" ) ; Map < String , Object > queryType = ( Map < String , Object > ) schema . get ( "queryType" ) ; assertNotNull ( queryType , "queryType expected" ) ; TypeName query = TypeName . newTypeName ( ) . name ( ( String ) queryType . get ( "name" ) ) . build ( ) ; boolean nonDefaultQueryName = ! "Query" . equals ( query . getName ( ) ) ; SchemaDefinition . Builder schemaDefinition = SchemaDefinition . newSchemaDefinition ( ) ; schemaDefinition . operationTypeDefinition ( OperationTypeDefinition . newOperationTypeDefinition ( ) . name ( "query" ) . typeName ( query ) . build ( ) ) ; Map < String , Object > mutationType = ( Map < String , Object > ) schema . get ( "mutationType" ) ; boolean nonDefaultMutationName = false ; if ( mutationType != null ) { TypeName mutation = TypeName . newTypeName ( ) . name ( ( String ) mutationType . get ( "name" ) ) . build ( ) ; nonDefaultMutationName = ! "Mutation" . equals ( mutation . getName ( ) ) ; schemaDefinition . operationTypeDefinition ( OperationTypeDefinition . newOperationTypeDefinition ( ) . name ( "mutation" ) . typeName ( mutation ) . build ( ) ) ; } Map < String , Object > subscriptionType = ( Map < String , Object > ) schema . get ( "subscriptionType" ) ; boolean nonDefaultSubscriptionName = false ; if ( subscriptionType != null ) { TypeName subscription = TypeName . newTypeName ( ) . name ( ( ( String ) subscriptionType . get ( "name" ) ) ) . build ( ) ; nonDefaultSubscriptionName = ! "Subscription" . equals ( subscription . getName ( ) ) ; schemaDefinition . operationTypeDefinition ( OperationTypeDefinition . newOperationTypeDefinition ( ) . name ( "subscription" ) . typeName ( subscription ) . build ( ) ) ; } Document . Builder document = Document . newDocument ( ) ; if ( nonDefaultQueryName || nonDefaultMutationName || nonDefaultSubscriptionName ) { document . definition ( schemaDefinition . build ( ) ) ; } List < Map < String , Object > > types = ( List < Map < String , Object > > ) schema . get ( "types" ) ; for ( Map < String , Object > type : types ) { TypeDefinition typeDefinition = createTypeDefinition ( type ) ; if ( typeDefinition == null ) continue ; document . definition ( typeDefinition ) ; } return document . build ( ) ; |
public class LongTuples { /** * Computes the maximum value that occurs in the given tuple ,
* or < code > Long . MIN _ VALUE < / code > if the given tuple has a
* size of 0.
* @ param t The input tuple
* @ return The maximum value */
public static long max ( LongTuple t ) { } } | return LongTupleFunctions . reduce ( t , Long . MIN_VALUE , Math :: max ) ; |
public class AbstractGeneratorExtraConfigWithDeps { /** * { @ inheritDoc } */
public String getDependencyFilename ( Artifact artifact , Boolean outputJarVersion ) { } } | return dependencyFilenameStrategy . getDependencyFilename ( artifact , outputJarVersion , useUniqueVersions ) ; |
public class CrossAppClient { /** * Set cross app no disturb
* https : / / docs . jiguang . cn / jmessage / server / rest _ api _ im / # api _ 1
* @ param username Necessary
* @ param array CrossNoDisturb array
* @ return No content
* @ throws APIConnectionException connect exception
* @ throws APIRequestException request exception */
public ResponseWrapper setCrossNoDisturb ( String username , CrossNoDisturb [ ] array ) throws APIConnectionException , APIRequestException { } } | StringUtils . checkUsername ( username ) ; CrossNoDisturbPayload payload = new CrossNoDisturbPayload . Builder ( ) . setCrossNoDistrub ( array ) . build ( ) ; return _httpClient . sendPost ( _baseUrl + crossUserPath + "/" + username + "/nodisturb" , payload . toString ( ) ) ; |
public class GetCommentsForPullRequestRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetCommentsForPullRequestRequest getCommentsForPullRequestRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getCommentsForPullRequestRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getCommentsForPullRequestRequest . getPullRequestId ( ) , PULLREQUESTID_BINDING ) ; protocolMarshaller . marshall ( getCommentsForPullRequestRequest . getRepositoryName ( ) , REPOSITORYNAME_BINDING ) ; protocolMarshaller . marshall ( getCommentsForPullRequestRequest . getBeforeCommitId ( ) , BEFORECOMMITID_BINDING ) ; protocolMarshaller . marshall ( getCommentsForPullRequestRequest . getAfterCommitId ( ) , AFTERCOMMITID_BINDING ) ; protocolMarshaller . marshall ( getCommentsForPullRequestRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( getCommentsForPullRequestRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class HashMap { /** * Implements Map . putAll and Map constructor
* @ param m the map
* @ param evict false when initially constructing this map , else
* true ( relayed to method afterNodeInsertion ) . */
final void putMapEntries ( Map < ? extends K , ? extends V > m , boolean evict ) { } } | int s = m . size ( ) ; if ( s > 0 ) { if ( table == null ) { // pre - size
float ft = ( ( float ) s / loadFactor ) + 1.0F ; int t = ( ( ft < ( float ) MAXIMUM_CAPACITY ) ? ( int ) ft : MAXIMUM_CAPACITY ) ; if ( t > threshold ) threshold = tableSizeFor ( t ) ; } else if ( s > threshold ) resize ( ) ; for ( Map . Entry < ? extends K , ? extends V > e : m . entrySet ( ) ) { K key = e . getKey ( ) ; V value = e . getValue ( ) ; putVal ( hash ( key ) , key , value , false , evict ) ; } } |
public class StreamHelper { /** * Get the content of the passed stream as a list of lines in the passed
* character set .
* @ param aIS
* The input stream to read from . May be < code > null < / code > .
* @ param aCharset
* The character set to use . May not be < code > null < / code > .
* @ param aTargetList
* The list to be filled with the lines . May not be < code > null < / code > . */
public static void readStreamLines ( @ WillClose @ Nullable final InputStream aIS , @ Nonnull final Charset aCharset , @ Nonnull final List < String > aTargetList ) { } } | if ( aIS != null ) readStreamLines ( aIS , aCharset , 0 , CGlobal . ILLEGAL_UINT , aTargetList :: add ) ; |
public class ModifySourceCollectionInStream { /** * Returns true if and only if the given MethodInvocationTree
* < p > 1 ) is a Stream API invocation , . e . g . map , filter , collect 2 ) the source of the stream has
* the same expression representation as streamSourceExpression . */
private static boolean isStreamApiInvocationOnStreamSource ( @ Nullable ExpressionTree rootTree , ExpressionTree streamSourceExpression , VisitorState visitorState ) { } } | ExpressionTree expressionTree = rootTree ; while ( STREAM_API_INVOCATION_MATCHER . matches ( expressionTree , visitorState ) ) { expressionTree = ASTHelpers . getReceiver ( expressionTree ) ; } if ( ! COLLECTION_TO_STREAM_MATCHER . matches ( expressionTree , visitorState ) ) { return false ; } return isSameExpression ( ASTHelpers . getReceiver ( expressionTree ) , streamSourceExpression ) ; |
public class SystemFunctionResolver { /** * Type Functions */
private Convert resolveConvert ( FunctionRef fun ) { } } | checkNumberOfOperands ( fun , 1 ) ; final Convert convert = of . createConvert ( ) . withOperand ( fun . getOperand ( ) . get ( 0 ) ) ; final SystemModel sm = builder . getSystemModel ( ) ; switch ( fun . getName ( ) ) { case "ToString" : convert . setToType ( builder . dataTypeToQName ( sm . getString ( ) ) ) ; break ; case "ToBoolean" : convert . setToType ( builder . dataTypeToQName ( sm . getBoolean ( ) ) ) ; break ; case "ToInteger" : convert . setToType ( builder . dataTypeToQName ( sm . getInteger ( ) ) ) ; break ; case "ToDecimal" : convert . setToType ( builder . dataTypeToQName ( sm . getDecimal ( ) ) ) ; break ; case "ToQuantity" : convert . setToType ( builder . dataTypeToQName ( sm . getQuantity ( ) ) ) ; break ; case "ToRatio" : convert . setToType ( builder . dataTypeToQName ( sm . getRatio ( ) ) ) ; break ; case "ToDate" : convert . setToType ( builder . dataTypeToQName ( sm . getDate ( ) ) ) ; break ; case "ToDateTime" : convert . setToType ( builder . dataTypeToQName ( sm . getDateTime ( ) ) ) ; break ; case "ToTime" : convert . setToType ( builder . dataTypeToQName ( sm . getTime ( ) ) ) ; break ; case "ToConcept" : convert . setToType ( builder . dataTypeToQName ( sm . getConcept ( ) ) ) ; break ; default : throw new IllegalArgumentException ( String . format ( "Could not resolve call to system operator %s. Unknown conversion type." , fun . getName ( ) ) ) ; } builder . resolveCall ( "System" , fun . getName ( ) , new ConvertInvocation ( convert ) ) ; return convert ; |
public class MaintenanceScheduleHelper { /** * Validates the format of the maintenance window duration
* @ param duration
* in " HH : mm : ss " string format . This format is popularly used but
* can be confused with time of the day , hence conversion to ISO
* specified format for time duration is required .
* @ throws InvalidMaintenanceScheduleException
* if the duration doesn ' t have a valid format to be converted
* to ISO . */
public static void validateDuration ( final String duration ) { } } | try { if ( StringUtils . hasText ( duration ) ) { convertDurationToLocalTime ( duration ) ; } } catch ( final DateTimeParseException e ) { throw new InvalidMaintenanceScheduleException ( "Provided duration is not valid" , e , e . getErrorIndex ( ) ) ; } |
public class OrderNoteUrl { /** * Get Resource Url for DeleteReturnNote
* @ param noteId Unique identifier of a particular note to retrieve .
* @ param returnId Unique identifier of the return whose items you want to get .
* @ return String Resource Url */
public static MozuUrl deleteReturnNoteUrl ( String noteId , String returnId ) { } } | UrlFormatter formatter = new UrlFormatter ( "/api/commerce/returns/{returnId}/notes/{noteId}" ) ; formatter . formatUrl ( "noteId" , noteId ) ; formatter . formatUrl ( "returnId" , returnId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; |
public class CountryCache { /** * Reset the cache to the initial state . */
public void reinitialize ( ) { } } | m_aRWLock . writeLocked ( m_aCountries :: clear ) ; for ( final Locale aLocale : LocaleCache . getInstance ( ) . getAllLocales ( ) ) { final String sCountry = aLocale . getCountry ( ) ; if ( StringHelper . hasText ( sCountry ) ) addCountry ( sCountry ) ; } if ( LOGGER . isDebugEnabled ( ) ) LOGGER . debug ( "Reinitialized " + CountryCache . class . getName ( ) ) ; |
public class ArteVideoDetailsDeserializer { /** * ermittelt Ausstrahlungsdatum aus der Liste der Ausstrahlungen
* @ param broadcastArray
* @ return */
private String getBroadcastDate ( JsonArray broadcastArray ) { } } | String broadcastDate = "" ; String broadcastBeginFirst = "" ; String broadcastBeginMajor = "" ; String broadcastBeginMinor = "" ; // nach Priorität der BroadcastTypen den relevanten Eintrag suchen
// FIRST _ BROADCAST = > MAJOR _ REBROADCAST = > MINOR _ REBROADCAST
// dabei die " aktuellste " Ausstrahlung verwenden
for ( int i = 0 ; i < broadcastArray . size ( ) ; i ++ ) { JsonObject broadcastObject = broadcastArray . get ( i ) . getAsJsonObject ( ) ; if ( broadcastObject . has ( JSON_ELEMENT_BROADCASTTYPE ) && broadcastObject . has ( JSON_ELEMENT_BROADCAST ) ) { String value = this . getBroadcastDateConsideringCatchupRights ( broadcastObject ) ; if ( ! value . isEmpty ( ) ) { String type = broadcastObject . get ( JSON_ELEMENT_BROADCASTTYPE ) . getAsString ( ) ; switch ( type ) { case BROADCASTTTYPE_FIRST : broadcastBeginFirst = value ; break ; case BROADCASTTTYPE_MAJOR_RE : broadcastBeginMajor = value ; break ; case BROADCASTTTYPE_MINOR_RE : broadcastBeginMinor = value ; break ; default : LOG . debug ( "New broadcasttype: " + type ) ; } } } } if ( ! broadcastBeginFirst . isEmpty ( ) ) { broadcastDate = broadcastBeginFirst ; } else if ( ! broadcastBeginMajor . isEmpty ( ) ) { broadcastDate = broadcastBeginMajor ; } else if ( ! broadcastBeginMinor . isEmpty ( ) ) { broadcastDate = broadcastBeginMinor ; } // wenn kein Ausstrahlungsdatum vorhanden , dann die erste Ausstrahlung nehmen
// egal , wann die CatchupRights liegen , damit ein " sinnvolles " Datum vorhanden ist
if ( broadcastDate . isEmpty ( ) ) { broadcastDate = getBroadcastDateIgnoringCatchupRights ( broadcastArray , BROADCASTTTYPE_FIRST ) ; } // wenn immer noch leer , dann die Major - Ausstrahlung verwenden
if ( broadcastDate . isEmpty ( ) ) { broadcastDate = getBroadcastDateIgnoringCatchupRights ( broadcastArray , BROADCASTTTYPE_MAJOR_RE ) ; } return broadcastDate ; |
public class ComboButton { /** * Adds a button to this { @ link ComboButton } . Beware that this method does
* change the styling ( colors , borders etc . ) of the button to make it fit
* the { @ link ComboButton } .
* @ param button */
public void addButton ( final AbstractButton button ) { } } | WidgetUtils . setDefaultButtonStyle ( button ) ; final EmptyBorder baseBorder = new EmptyBorder ( WidgetUtils . BORDER_WIDE_WIDTH - 1 , 9 , WidgetUtils . BORDER_WIDE_WIDTH - 1 , 9 ) ; if ( getComponentCount ( ) == 0 ) { button . setBorder ( baseBorder ) ; } else { final Component lastComponent = getComponent ( getComponentCount ( ) - 1 ) ; if ( lastComponent instanceof AbstractButton ) { // previous component was also a button - add a line on the left
// side
final Border outsideBorder = new MatteBorder ( 0 , 1 , 0 , 0 , WidgetUtils . BG_COLOR_LESS_BRIGHT ) ; button . setBorder ( new CompoundBorder ( outsideBorder , baseBorder ) ) ; } else { button . setBorder ( baseBorder ) ; } } button . setOpaque ( false ) ; _buttons . add ( button ) ; add ( button ) ; |
public class CmsDomUtil { /** * Returns the text content to any HTML .
* @ param html the HTML
* @ return the text content */
public static String stripHtml ( String html ) { } } | if ( html == null ) { return null ; } Element el = DOM . createDiv ( ) ; el . setInnerHTML ( html ) ; return el . getInnerText ( ) ; |
public class HttpContext { /** * Execute a PATCH request .
* @ param uri The URI to call
* @ param obj The object to use for the PATCH */
protected void executePatchRequest ( URI uri , Object obj ) { } } | executePatchRequest ( uri , obj , null , null ) ; |
public class GenericServletWrapper { /** * Method that processes the request , and ultimately invokes the service ( ) on the
* Servlet target . Subclasses may override this method to put in additional
* logic ( eg . , reload / retranslation logic in the case of JSP containers ) . Subclasses
* must call this method by invoking super . handleRequest ( ) if they want
* the webcontainer to handle initialization and servicing of the target in
* a proper way .
* An example scenario :
* < tt >
* class SimpleJSPServletWrapper extends GenericServletWrapper
* public void handleRequest ( ServletRequest req , ServletResponse res )
* String jspFile = getFileFromRequest ( req ) ; / / get the JSP target
* if ( hasFileChangedOnDisk ( jspFile ) )
* prepareForReload ( ) ;
* / / invalidate the target and targetClassLoader
* setTargetClassLoader ( null ) ;
* setTarget ( null ) ;
* JSPServlet jsp = compileJSP ( jspFile ) ;
* ClassLoader loader = getLoaderForServlet ( jsp ) ;
* setTarget ( jsp . getClassName ( ) ) ;
* setTargetClassLoader ( loader ) ;
* super . handleRequest ( req , res ) ;
* < / tt > */
public void handleRequest ( ServletRequest req , ServletResponse res ) throws Exception { } } | wrapper . handleRequest ( req , res ) ; |
public class PropertyResolver { /** * Retrieves a property value , replacing values like $ { token } using the Properties to look them up . Shamelessly
* adapted from :
* http : / / maven . apache . org / plugins / maven - war - plugin / xref / org / apache / maven / plugin / war / PropertyUtils . html It will
* leave unresolved properties alone , trying for System properties , and environment variables and implements
* reparsing ( in the case that the value of a property contains a key ) , and will not loop endlessly on a pair like
* test = $ { test }
* @ param key property key
* @ param properties project properties
* @ param environment environment variables
* @ return resolved property value
* @ throws IllegalArgumentException when properties are circularly defined */
public String getPropertyValue ( String key , Properties properties , Properties environment ) { } } | String value = properties . getProperty ( key ) ; ExpansionBuffer buffer = new ExpansionBuffer ( value ) ; CircularDefinitionPreventer circularDefinitionPreventer = new CircularDefinitionPreventer ( ) . visited ( key , value ) ; while ( buffer . hasMoreLegalPlaceholders ( ) ) { String newKey = buffer . extractPropertyKey ( ) ; String newValue = fromPropertiesThenSystemThenEnvironment ( newKey , properties , environment ) ; circularDefinitionPreventer . visited ( newKey , newValue ) ; buffer . add ( newKey , newValue ) ; } return buffer . toString ( ) ; |
public class Arc42DocumentationTemplate { /** * Adds a " Runtime View " section relating to a { @ link SoftwareSystem } from one or more files .
* @ param softwareSystem the { @ link SoftwareSystem } the documentation content relates to
* @ param files one or more File objects that point to the documentation content
* @ return a documentation { @ link Section }
* @ throws IOException if there is an error reading the files */
public Section addRuntimeViewSection ( SoftwareSystem softwareSystem , File ... files ) throws IOException { } } | return addSection ( softwareSystem , "Runtime View" , files ) ; |
public class EscapedFunctions2 { /** * locate translation
* @ param buf The buffer to append into
* @ param parsedArgs arguments
* @ throws SQLException if something wrong happens */
public static void sqllocate ( StringBuilder buf , List < ? extends CharSequence > parsedArgs ) throws SQLException { } } | if ( parsedArgs . size ( ) == 2 ) { appendCall ( buf , "position(" , " in " , ")" , parsedArgs ) ; } else if ( parsedArgs . size ( ) == 3 ) { String tmp = "position(" + parsedArgs . get ( 0 ) + " in substring(" + parsedArgs . get ( 1 ) + " from " + parsedArgs . get ( 2 ) + "))" ; buf . append ( "(" ) . append ( parsedArgs . get ( 2 ) ) . append ( "*sign(" ) . append ( tmp ) . append ( ")+" ) . append ( tmp ) . append ( ")" ) ; } else { throw new PSQLException ( GT . tr ( "{0} function takes two or three arguments." , "locate" ) , PSQLState . SYNTAX_ERROR ) ; } |
public class YQueue { /** * Removes an element from the front end of the queue . */
public T pop ( ) { } } | T val = beginChunk . values [ beginPos ] ; beginChunk . values [ beginPos ] = null ; beginPos ++ ; if ( beginPos == size ) { beginChunk = beginChunk . next ; beginChunk . prev = null ; beginPos = 0 ; } return val ; |
public class PlainTime { /** * < p > Wird von der { @ code ratio ( ) } - Function des angegebenenElements
* aufgerufen . < / p >
* @ param element reference time element
* @ return { @ code true } if element maximum is reduced else { @ code false } */
boolean hasReducedRange ( ChronoElement < ? > element ) { } } | return ( ( ( element == MILLI_OF_DAY ) && ( ( this . nano % MIO ) != 0 ) ) || ( ( element == HOUR_FROM_0_TO_24 ) && ! this . isFullHour ( ) ) || ( ( element == MINUTE_OF_DAY ) && ! this . isFullMinute ( ) ) || ( ( element == SECOND_OF_DAY ) && ( this . nano != 0 ) ) || ( ( element == MICRO_OF_DAY ) && ( ( this . nano % KILO ) != 0 ) ) ) ; |
public class ElUtil { /** * Checks if the given variable name is a reserved keyword and SHOULD NOT be used as a key for an Environment attribute . */
public static boolean isReservedVariable ( String variableName ) { } } | return ReservedVariables . NOW . equalsIgnoreCase ( variableName ) || ReservedVariables . WORKFLOW_INSTANCE_ID . equalsIgnoreCase ( variableName ) ; |
public class lbwlm { /** * Use this API to delete lbwlm of given name . */
public static base_response delete ( nitro_service client , String wlmname ) throws Exception { } } | lbwlm deleteresource = new lbwlm ( ) ; deleteresource . wlmname = wlmname ; return deleteresource . delete_resource ( client ) ; |
public class XMemcachedClientBuilder { /** * ( non - Javadoc )
* @ see net . rubyeye . xmemcached . MemcachedClientBuilder # build ( ) */
public MemcachedClient build ( ) throws IOException { } } | XMemcachedClient memcachedClient ; // kestrel protocol use random session locator .
if ( this . commandFactory . getProtocol ( ) == Protocol . Kestrel ) { if ( ! ( this . sessionLocator instanceof RandomMemcachedSessionLocaltor ) ) { log . warn ( "Recommend to use `net.rubyeye.xmemcached.impl.RandomMemcachedSessionLocaltor` as session locator for kestrel protocol." ) ; } } if ( this . weights == null ) { memcachedClient = new XMemcachedClient ( this . sessionLocator , this . sessionComparator , this . bufferAllocator , this . configuration , this . socketOptions , this . commandFactory , this . transcoder , this . addressMap , this . stateListeners , this . authInfoMap , this . connectionPoolSize , this . connectTimeout , this . name , this . failureMode ) ; } else { if ( this . addressMap == null ) { throw new IllegalArgumentException ( "Null Address map" ) ; } if ( this . addressMap . size ( ) > this . weights . length ) { throw new IllegalArgumentException ( "Weights Array's length is less than server's number" ) ; } memcachedClient = new XMemcachedClient ( this . sessionLocator , this . sessionComparator , this . bufferAllocator , this . configuration , this . socketOptions , this . commandFactory , this . transcoder , this . addressMap , this . weights , this . stateListeners , this . authInfoMap , this . connectionPoolSize , this . connectTimeout , this . name , this . failureMode ) ; } this . configureClient ( memcachedClient ) ; return memcachedClient ; |
public class AsyncCompletionHandlerBase { /** * { @ inheritDoc } */
public STATE onBodyPartReceived ( final HttpResponseBodyPart content ) throws Exception { } } | builder . accumulate ( content ) ; return STATE . CONTINUE ; |
public class CmsElementRename { /** * Checks if the selected new element is valid for the selected template . < p >
* @ param page the xml page
* @ param element the element name
* @ return true if ALL _ TEMPLATES selected or the element is valid for the selected template ; otherwise false */
private boolean isValidElement ( CmsXmlPage page , String element ) { } } | CmsFile file = page . getFile ( ) ; String template ; try { template = getCms ( ) . readPropertyObject ( getCms ( ) . getSitePath ( file ) , CmsPropertyDefinition . PROPERTY_TEMPLATE , true ) . getValue ( null ) ; } catch ( CmsException e ) { return false ; } return isValidTemplateElement ( template , element ) ; |
public class JBBPDslBuilder { /** * Add named fixed length bit array .
* @ param name name of the array , if null then anonymous one
* @ param bits length of the field , must not be null
* @ param size number of elements in array , if negative then till the end of stream
* @ return the builder instance , must not be null */
public JBBPDslBuilder BitArray ( final String name , final JBBPBitNumber bits , final int size ) { } } | return this . BitArray ( name , bits , arraySizeToString ( size ) ) ; |
public class CmsOrgUnitManager { /** * Removes a resource from the given organizational unit . < p >
* @ param cms the opencms context
* @ param ouFqn the fully qualified name of the organizational unit to remove the resource from
* @ param resourceName the name of the resource that is to be removed from the organizational unit
* @ throws CmsException if something goes wrong */
public void removeResourceFromOrgUnit ( CmsObject cms , String ouFqn , String resourceName ) throws CmsException { } } | CmsOrganizationalUnit orgUnit = readOrganizationalUnit ( cms , ouFqn ) ; CmsResource resource = cms . readResource ( resourceName , CmsResourceFilter . ALL ) ; m_securityManager . removeResourceFromOrgUnit ( cms . getRequestContext ( ) , orgUnit , resource ) ; |
public class ArrowSerde { /** * Create the dimensions for the flatbuffer builder
* @ param bufferBuilder the buffer builder to use
* @ param arr the input array
* @ return */
public static int createDims ( FlatBufferBuilder bufferBuilder , INDArray arr ) { } } | int [ ] tensorDimOffsets = new int [ arr . rank ( ) ] ; int [ ] nameOffset = new int [ arr . rank ( ) ] ; for ( int i = 0 ; i < tensorDimOffsets . length ; i ++ ) { nameOffset [ i ] = bufferBuilder . createString ( "" ) ; tensorDimOffsets [ i ] = TensorDim . createTensorDim ( bufferBuilder , arr . size ( i ) , nameOffset [ i ] ) ; } return Tensor . createShapeVector ( bufferBuilder , tensorDimOffsets ) ; |
public class ClassUtils { /** * Intializes the specified class if not initialized already .
* This is required for EnumUtils if the enum class has not yet been loaded . */
public static void initializeClass ( Class clazz ) { } } | try { Class . forName ( clazz . getName ( ) , true , Thread . currentThread ( ) . getContextClassLoader ( ) ) ; } catch ( ClassNotFoundException e ) { throw new RuntimeException ( e ) ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.