signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class TurfMeasurement { /** * Takes a { @ link LineString } and measures its length in the specified units .
* @ param lineString geometry to measure
* @ param units one of the units found inside { @ link TurfConstants . TurfUnitCriteria }
* @ return length of the input line in the units specified
* @ see < a href = " http : / / turfjs . org / docs / # linedistance " > Turf Line Distance documentation < / a >
* @ since 1.2.0 */
public static double length ( @ NonNull LineString lineString , @ NonNull @ TurfConstants . TurfUnitCriteria String units ) { } } | List < Point > coordinates = lineString . coordinates ( ) ; return length ( coordinates , units ) ; |
public class AmazonSageMakerClient { /** * Stops a running labeling job . A job that is stopped cannot be restarted . Any results obtained before the job is
* stopped are placed in the Amazon S3 output bucket .
* @ param stopLabelingJobRequest
* @ return Result of the StopLabelingJob operation returned by the service .
* @ throws ResourceNotFoundException
* Resource being access is not found .
* @ sample AmazonSageMaker . StopLabelingJob
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / sagemaker - 2017-07-24 / StopLabelingJob " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public StopLabelingJobResult stopLabelingJob ( StopLabelingJobRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeStopLabelingJob ( request ) ; |
public class DateList { /** * Add a date to the list . The date will be updated to reflect the timezone of this list .
* @ param date
* the date to add
* @ return true
* @ see List # add ( java . lang . Object ) */
public final boolean add ( final Date date ) { } } | if ( ! this . isUtc ( ) && this . getTimeZone ( ) == null ) { /* If list hasn ' t been initialized yet use defaults from the first added date element */
if ( date instanceof DateTime ) { DateTime dateTime = ( DateTime ) date ; if ( dateTime . isUtc ( ) ) { this . setUtc ( true ) ; } else { this . setTimeZone ( dateTime . getTimeZone ( ) ) ; } } } if ( date instanceof DateTime ) { DateTime dateTime = ( DateTime ) date ; if ( isUtc ( ) ) { dateTime . setUtc ( true ) ; } else { dateTime . setTimeZone ( getTimeZone ( ) ) ; } } else if ( ! Value . DATE . equals ( getType ( ) ) ) { final DateTime dateTime = new DateTime ( date ) ; dateTime . setTimeZone ( getTimeZone ( ) ) ; return dates . add ( dateTime ) ; } return dates . add ( date ) ; |
public class Get { /** * Retrieves the text of the element . If the element isn ' t present , a null
* value will be returned .
* @ return String : the text of the element */
public String text ( ) { } } | if ( ! element . is ( ) . present ( ) ) { return null ; } WebElement webElement = element . getWebElement ( ) ; return webElement . getText ( ) ; |
public class CmsUpdateDBHistoryPrincipals { /** * Inserts deleted users / groups in the history principals table . < p >
* @ param dbCon the db connection interface
* @ return true if the USER _ DATEDELETED needs updating , false if not
* @ throws SQLException if something goes wrong */
private boolean insertHistoryPrincipals ( CmsSetupDb dbCon ) throws SQLException { } } | System . out . println ( new Exception ( ) . getStackTrace ( ) [ 0 ] . toString ( ) ) ; createHistPrincipalsTable ( dbCon ) ; boolean updateUserDateDeleted = false ; if ( isKeepHistory ( ) && ! hasData ( dbCon ) ) { dbCon . updateSqlStatement ( readQuery ( QUERY_HISTORY_PRINCIPALS_RESOURCES ) , null , null ) ; dbCon . updateSqlStatement ( readQuery ( QUERY_HISTORY_PRINCIPALS_PROJECTS_GROUPS ) , null , null ) ; dbCon . updateSqlStatement ( readQuery ( QUERY_HISTORY_PRINCIPALS_PROJECTS_MANAGERGROUPS ) , null , null ) ; dbCon . updateSqlStatement ( readQuery ( QUERY_HISTORY_PRINCIPALS_PROJECTS_PUBLISHED ) , null , null ) ; dbCon . updateSqlStatement ( readQuery ( QUERY_HISTORY_PRINCIPALS_PROJECTS_USERS ) , null , null ) ; updateUserDateDeleted = true ; // update the colum USER _ DATETELETED
} return updateUserDateDeleted ; |
public class A_CmsHtmlWidget { /** * Returns the start or end HTML for the OpenCms specific button row . < p >
* Use this method to generate the start and end html for the button row . < p >
* Overwrite the method if the integrated editor needs a specific layout for the button row start or end html . < p >
* @ param segment the HTML segment ( START / END )
* @ param widgetDialog the dialog where the widget is used on
* @ return the html String for the OpenCms specific button row */
protected String buildOpenCmsButtonRow ( int segment , I_CmsWidgetDialog widgetDialog ) { } } | StringBuffer result = new StringBuffer ( 256 ) ; if ( segment == CmsWorkplace . HTML_START ) { // generate line and start row HTML
result . append ( widgetDialog . buttonBarHorizontalLine ( ) ) ; result . append ( widgetDialog . buttonBar ( CmsWorkplace . HTML_START ) ) ; result . append ( widgetDialog . buttonBarStartTab ( 0 , 0 ) ) ; } else { // close button row and generate end line
result . append ( widgetDialog . buttonBar ( CmsWorkplace . HTML_END ) ) ; result . append ( widgetDialog . buttonBarHorizontalLine ( ) ) ; } return result . toString ( ) ; |
public class Handler { /** * handleTransaction Handles request to execute a transaction . */
public void handleTransaction ( ChaincodeMessage message ) { } } | // The defer followed by triggering a go routine dance is needed to ensure that the previous state transition
// is completed before the next one is triggered . The previous state transition is deemed complete only when
// the beforeInit function is exited . Interesting bug fix ! !
Runnable task = ( ) -> { // better not be nil
ChaincodeMessage nextStatemessage = null ; boolean send = true ; // Defer
try { // Get the function and args from Payload
ChaincodeInput input ; try { input = ChaincodeInput . parseFrom ( message . getPayload ( ) ) ; } catch ( Exception e ) { logger . debug ( String . format ( "[%s]Incorrect payload format. Sending %s" , shortID ( message ) , ERROR ) ) ; // Send ERROR message to chaincode support and change state
nextStatemessage = ChaincodeMessage . newBuilder ( ) . setType ( ERROR ) . setPayload ( message . getPayload ( ) ) . setTxid ( message . getTxid ( ) ) . build ( ) ; return ; } // Mark as a transaction ( allow put / del state )
markIsTransaction ( message . getTxid ( ) , true ) ; // Create the ChaincodeStub which the chaincode can use to callback
ChaincodeStub stub = new ChaincodeStub ( message . getTxid ( ) , this , message . getSecurityContext ( ) ) ; // Call chaincode ' s Run
ByteString response ; try { response = chaincode . runHelper ( stub , getFunction ( input . getArgsList ( ) ) , getParameters ( input . getArgsList ( ) ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; System . err . flush ( ) ; // Send ERROR message to chaincode support and change state
logger . error ( String . format ( "[%s]Error running chaincode. Transaction execution failed. Sending %s" , shortID ( message ) , ERROR ) ) ; nextStatemessage = ChaincodeMessage . newBuilder ( ) . setType ( ERROR ) . setPayload ( message . getPayload ( ) ) . setTxid ( message . getTxid ( ) ) . build ( ) ; return ; } finally { deleteIsTransaction ( message . getTxid ( ) ) ; } logger . debug ( String . format ( "[%s]Transaction completed. Sending %s" , shortID ( message ) , COMPLETED ) ) ; // Send COMPLETED message to chaincode support and change state
Builder builder = ChaincodeMessage . newBuilder ( ) . setType ( COMPLETED ) . setTxid ( message . getTxid ( ) ) ; if ( response != null ) builder . setPayload ( response ) ; nextStatemessage = builder . build ( ) ; } finally { triggerNextState ( nextStatemessage , send ) ; } } ; new Thread ( task ) . start ( ) ; |
public class BigtableTableAdminSettings { /** * Create a new builder preconfigured to connect to the Bigtable emulator . */
public static Builder newBuilderForEmulator ( int port ) { } } | Builder builder = newBuilder ( ) . setProjectId ( "fake-project" ) . setInstanceId ( "fake-instance" ) ; builder . stubSettings ( ) . setCredentialsProvider ( NoCredentialsProvider . create ( ) ) . setEndpoint ( "localhost:" + port ) . setTransportChannelProvider ( InstantiatingGrpcChannelProvider . newBuilder ( ) . setPoolSize ( 1 ) . setChannelConfigurator ( new ApiFunction < ManagedChannelBuilder , ManagedChannelBuilder > ( ) { @ Override public ManagedChannelBuilder apply ( ManagedChannelBuilder input ) { return input . usePlaintext ( ) ; } } ) . build ( ) ) ; return builder ; |
public class MaxHistory { /** * Loads a { @ link MaxHistory } from { @ code file } , or generates a new one that
* will be saved to { @ code file } . */
public static MaxHistory forFolder ( File file ) { } } | if ( file . exists ( ) ) { try { return readHistory ( file ) ; } catch ( CouldNotReadCoreException e ) { e . printStackTrace ( ) ; file . delete ( ) ; } } return new MaxHistory ( file ) ; |
public class BasicDoubleLinkedNode { /** * This method inserts the given { @ code node } into the list immediately after the position represented by this node .
* @ param node is the { @ link BasicDoubleLinkedNode node } to add . */
public void insertAsNext ( BasicDoubleLinkedNode < V > node ) { } } | BasicDoubleLinkedNode < V > next = getNext ( ) ; if ( next != null ) { next . previous = node ; node . setNext ( next ) ; } node . previous = this ; setNext ( node ) ; |
public class CreateSchemaRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateSchemaRequest createSchemaRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( createSchemaRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createSchemaRequest . getName ( ) , NAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class StringUtil { /** * Truncates the string so it has length less than or equal to the given limit . If truncation
* occurs , the result will end with the given appendage . Returns null if the input is null . */
public static String truncate ( String str , int limit , String appendage ) { } } | if ( str == null || str . length ( ) <= limit ) { return str ; } return str . substring ( 0 , limit - appendage . length ( ) ) + appendage ; |
public class RTreeIndexCoreExtension { /** * Load the RTree Spatial Index Values
* @ param tableName
* table name
* @ param geometryColumnName
* geometry column name
* @ param idColumnName
* id column name */
public void loadRTreeIndex ( String tableName , String geometryColumnName , String idColumnName ) { } } | String sqlName = GeoPackageProperties . getProperty ( SQL_PROPERTY , LOAD_PROPERTY ) ; executeSQL ( sqlName , tableName , geometryColumnName , idColumnName ) ; |
public class ComparableExtensions { /** * The comparison operator < code > less than < / code > .
* @ param left
* a comparable
* @ param right
* the value to compare with
* @ return < code > left . compareTo ( right ) < 0 < / code > */
@ Pure /* not guaranteed , since compareTo ( ) is invoked */
@ Inline ( "($1.compareTo($2) < 0)" ) public static < C > boolean operator_lessThan ( Comparable < ? super C > left , C right ) { } } | return left . compareTo ( right ) < 0 ; |
public class Sneaky { /** * Sneaky throws a BinaryOperator lambda .
* @ param binaryOperator BinaryOperator that can throw an exception
* @ param < T > type of the two arguments and the return type of the binaryOperator
* @ return a BinaryOperator as defined in java . util . function */
public static < T , E extends Exception > BinaryOperator < T > sneaked ( SneakyBinaryOperator < T , E > binaryOperator ) { } } | return ( t1 , t2 ) -> { @ SuppressWarnings ( "unchecked" ) SneakyBinaryOperator < T , RuntimeException > castedBinaryOperator = ( SneakyBinaryOperator < T , RuntimeException > ) binaryOperator ; return castedBinaryOperator . apply ( t1 , t2 ) ; } ; |
public class XtextSemanticSequencer { /** * Contexts :
* AbstractNegatedToken returns UntilToken
* UntilToken returns UntilToken
* Constraint :
* terminal = TerminalTokenElement */
protected void sequence_UntilToken ( ISerializationContext context , UntilToken semanticObject ) { } } | if ( errorAcceptor != null ) { if ( transientValues . isValueTransient ( semanticObject , XtextPackage . Literals . ABSTRACT_NEGATED_TOKEN__TERMINAL ) == ValueTransient . YES ) errorAcceptor . accept ( diagnosticProvider . createFeatureValueMissing ( semanticObject , XtextPackage . Literals . ABSTRACT_NEGATED_TOKEN__TERMINAL ) ) ; } SequenceFeeder feeder = createSequencerFeeder ( context , semanticObject ) ; feeder . accept ( grammarAccess . getUntilTokenAccess ( ) . getTerminalTerminalTokenElementParserRuleCall_1_0 ( ) , semanticObject . getTerminal ( ) ) ; feeder . finish ( ) ; |
public class CleaneLingStyleSolver { /** * Marks a given literal .
* @ param lit the literal */
protected void mark ( final int lit ) { } } | final CLVar v = var ( lit ) ; assert v . mark ( ) == 0 ; v . setMark ( sign ( lit ) ) ; this . seen . push ( lit ) ; |
public class ParameterizationFunction { /** * Determines the alpha values where this function has a minumum and maximum
* value in the given interval .
* @ param interval the hyper bounding box defining the interval
* @ return he alpha values where this function has a minumum and maximum value
* in the given interval */
public HyperBoundingBox determineAlphaMinMax ( HyperBoundingBox interval ) { } } | final int dim = vec . getDimensionality ( ) ; if ( interval . getDimensionality ( ) != dim - 1 ) { throw new IllegalArgumentException ( "Interval needs to have dimensionality d=" + ( dim - 1 ) + ", read: " + interval . getDimensionality ( ) ) ; } if ( extremumType . equals ( ExtremumType . CONSTANT ) ) { double [ ] centroid = SpatialUtil . centroid ( interval ) ; return new HyperBoundingBox ( centroid , centroid ) ; } double [ ] alpha_min = new double [ dim - 1 ] ; double [ ] alpha_max = new double [ dim - 1 ] ; if ( SpatialUtil . contains ( interval , alphaExtremum ) ) { if ( extremumType . equals ( ExtremumType . MINIMUM ) ) { alpha_min = alphaExtremum ; for ( int d = dim - 2 ; d >= 0 ; d -- ) { alpha_max [ d ] = determineAlphaMax ( d , alpha_max , interval ) ; } } else { alpha_max = alphaExtremum ; for ( int d = dim - 2 ; d >= 0 ; d -- ) { alpha_min [ d ] = determineAlphaMin ( d , alpha_min , interval ) ; } } } else { for ( int d = dim - 2 ; d >= 0 ; d -- ) { alpha_min [ d ] = determineAlphaMin ( d , alpha_min , interval ) ; alpha_max [ d ] = determineAlphaMax ( d , alpha_max , interval ) ; } } return new HyperBoundingBox ( alpha_min , alpha_max ) ; |
public class RebalanceUtils { /** * Given a list of store definitions , makes sure that rebalance supports all
* of them . If not it throws an error .
* @ param storeDefList List of store definitions
* @ return Filtered list of store definitions which rebalancing supports */
public static List < StoreDefinition > validateRebalanceStore ( List < StoreDefinition > storeDefList ) { } } | List < StoreDefinition > returnList = new ArrayList < StoreDefinition > ( storeDefList . size ( ) ) ; for ( StoreDefinition def : storeDefList ) { if ( ! def . isView ( ) && ! canRebalanceList . contains ( def . getType ( ) ) ) { throw new VoldemortException ( "Rebalance does not support rebalancing of stores of type " + def . getType ( ) + " - " + def . getName ( ) ) ; } else if ( ! def . isView ( ) ) { returnList . add ( def ) ; } else { logger . debug ( "Ignoring view " + def . getName ( ) + " for rebalancing" ) ; } } return returnList ; |
public class ManagementClient { /** * Retrieves a queue from the service namespace
* @ param path - The path of the queue relative to service bus namespace .
* @ return - QueueDescription containing information about the queue .
* @ throws IllegalArgumentException - Thrown if path is null , empty , or not in right format or length .
* @ throws TimeoutException - The operation times out . The timeout period is initiated through ClientSettings . operationTimeout
* @ throws MessagingEntityNotFoundException - Entity with this name doesn ' t exist .
* @ throws AuthorizationFailedException - No sufficient permission to perform this operation . Please check ClientSettings . tokenProvider has correct details .
* @ throws ServerBusyException - The server is busy . You should wait before you retry the operation .
* @ throws ServiceBusException - An internal error or an unexpected exception occurred .
* @ throws InterruptedException if the current thread was interrupted */
public QueueDescription getQueue ( String path ) throws ServiceBusException , InterruptedException { } } | return Utils . completeFuture ( this . asyncClient . getQueueAsync ( path ) ) ; |
public class AbstractJdbcDAO { /** * Returns the { @ link PreparedStatement } wrapping a sql statement in
* < tt > sql < / tt > .
* The prepared statement ' s < tt > autoGeneratedKeys < / tt > feature is set via
* the additional parameter .
* @ param sql { @ link String } the sql statement to use in the
* { @ link PreparedStatement } , which can take parameter substitutions - ' ? ' .
* @ param autoGeneratedKeys < tt > int < / tt > the auto generated keys feature
* in the { @ link PreparedStatement }
* @ return { @ link PreparedStatement } the prepared statement , which could
* be either new or cached
* @ throws SQLException Thrown if a database exception occurred or if the
* < tt > dbConnection < / tt > is no longer valid and cannot be re - established */
protected PreparedStatement getPreparedStatement ( String sql , int autoGeneratedKeys ) throws SQLException { } } | String replacedSQL = injectSchema ( sql ) ; // use the auto generated key parameter as part of the key
return dbConnection . getPreparedStatement ( replacedSQL , autoGeneratedKeys + replacedSQL , autoGeneratedKeys ) ; |
public class RequestProbeIntrospector { /** * This method will dump all the registered probe extensions with their configuration details ( SampleRate , Context information required , Invoke only for root , Entry enabled , Exit enabled , Include types )
* @ param writer */
private void probeExtensionIntrospectors ( PrintWriter writer ) { } } | List < ProbeExtension > registeredProbeExtensions = RequestProbeService . getProbeExtensions ( ) ; List < String > probeExtensionRefList = new ArrayList < String > ( ) { { add ( "Probe extension" ) ; add ( "" ) ; add ( "" ) ; } } ; List < String > sampleRateList = new ArrayList < String > ( ) { { add ( "Sample" ) ; add ( "Rate" ) ; add ( "" ) ; } } ; List < String > contextInfoRequiredList = new ArrayList < String > ( ) { { add ( "ContextInfo" ) ; add ( "required" ) ; add ( "" ) ; } } ; List < String > invokeOnyForRootList = new ArrayList < String > ( ) { { add ( "Invoke only" ) ; add ( "for root" ) ; add ( "" ) ; } } ; List < String > entryEnabledList = new ArrayList < String > ( ) { { add ( "Entry" ) ; add ( "enabled" ) ; add ( "" ) ; } } ; List < String > exitEnabledList = new ArrayList < String > ( ) { { add ( "Exit" ) ; add ( "enabled" ) ; add ( "" ) ; } } ; List < String > includeTypeList = new ArrayList < String > ( ) { { add ( "Include Types" ) ; add ( "" ) ; add ( "" ) ; } } ; List < Integer > indentationLength = new ArrayList < Integer > ( ) ; int maxSpaceRequired = 0 ; for ( ProbeExtension probeExtension : registeredProbeExtensions ) { probeExtensionRefList . add ( probeExtension . toString ( ) ) ; sampleRateList . add ( "" + probeExtension . getRequestSampleRate ( ) ) ; invokeOnyForRootList . add ( probeExtension . invokeForRootEventsOnly ( ) ? "True" : "False" ) ; entryEnabledList . add ( probeExtension . invokeForEventEntry ( ) ? "True" : "False" ) ; exitEnabledList . add ( probeExtension . invokeForEventExit ( ) ? "True" : "False" ) ; if ( probeExtension . getContextInfoRequirement ( ) == 0 ) { contextInfoRequiredList . add ( "ALL_EVENTS" ) ; } else if ( probeExtension . getContextInfoRequirement ( ) == 1 ) { contextInfoRequiredList . add ( "EVENTS_MATCHING_SPECIFIED_EVENT_TYPES" ) ; } else { contextInfoRequiredList . add ( "NONE" ) ; } StringBuilder eventTypes = new StringBuilder ( ) ; String eventTypeStr = "" ; if ( probeExtension . invokeForEventTypes ( ) == null ) { eventTypeStr = "ALL" ; } else { for ( String eventType : probeExtension . invokeForEventTypes ( ) ) { eventTypes . append ( eventType + "," ) ; } eventTypeStr = eventTypes . toString ( ) . substring ( 0 , eventTypes . length ( ) - 1 ) ; } includeTypeList . add ( eventTypeStr ) ; } // Find the indentation required for Probe Extension Reference . .
for ( String probeExtensionRef : probeExtensionRefList ) { if ( probeExtensionRef . length ( ) > maxSpaceRequired ) { maxSpaceRequired = probeExtensionRef . length ( ) ; } } indentationLength . add ( maxSpaceRequired + EXTRA_SPACE_REQUIRED ) ; // Find the indentation required for Sample Rate . .
maxSpaceRequired = 0 ; for ( String sampleRate : sampleRateList ) { if ( sampleRate . length ( ) > maxSpaceRequired ) { maxSpaceRequired = sampleRate . length ( ) ; } } indentationLength . add ( maxSpaceRequired + EXTRA_SPACE_REQUIRED ) ; // Find the indentation required for context info required . .
maxSpaceRequired = 0 ; for ( String contextInfoRequired : contextInfoRequiredList ) { if ( contextInfoRequired . length ( ) > maxSpaceRequired ) { maxSpaceRequired = contextInfoRequired . length ( ) ; } } indentationLength . add ( maxSpaceRequired + EXTRA_SPACE_REQUIRED ) ; // Find the indentation required for invokeOnyForRoot . .
maxSpaceRequired = 0 ; for ( String invokeOnyForRoot : invokeOnyForRootList ) { if ( invokeOnyForRoot . length ( ) > maxSpaceRequired ) { maxSpaceRequired = invokeOnyForRoot . length ( ) ; } } indentationLength . add ( maxSpaceRequired + EXTRA_SPACE_REQUIRED ) ; // Find the indentation required for entryEnabledList . .
maxSpaceRequired = 0 ; for ( String entryEnabled : entryEnabledList ) { if ( entryEnabled . length ( ) > maxSpaceRequired ) { maxSpaceRequired = entryEnabled . length ( ) ; } } indentationLength . add ( maxSpaceRequired + EXTRA_SPACE_REQUIRED ) ; // Find the indentation required for exitEnabledList . .
maxSpaceRequired = 0 ; for ( String exitEnabled : exitEnabledList ) { if ( exitEnabled . length ( ) > maxSpaceRequired ) { maxSpaceRequired = exitEnabled . length ( ) ; } } indentationLength . add ( maxSpaceRequired + EXTRA_SPACE_REQUIRED ) ; writer . println ( ) ; writer . println ( "------------------------------------------------------------------------------" ) ; writer . println ( " Registered Probe Extensions " ) ; writer . println ( "------------------------------------------------------------------------------" ) ; for ( int i = 0 ; i < probeExtensionRefList . size ( ) ; i ++ ) { writer . println ( String . format ( "%-" + indentationLength . get ( 0 ) + "s%-" + indentationLength . get ( 1 ) + "s%-" + indentationLength . get ( 2 ) + "s" + "%-" + indentationLength . get ( 3 ) + "s%-" + indentationLength . get ( 4 ) + "s%-" + indentationLength . get ( 5 ) + "s%s" , probeExtensionRefList . get ( i ) , sampleRateList . get ( i ) , contextInfoRequiredList . get ( i ) , invokeOnyForRootList . get ( i ) , entryEnabledList . get ( i ) , exitEnabledList . get ( i ) , includeTypeList . get ( i ) ) ) ; } if ( registeredProbeExtensions . size ( ) == 0 ) { // No active probe extensions available
writer . println ( "----- No probe extensions are registered ----- " ) ; } |
public class Pages { /** * Reads bytes to fill the last page .
* @ return false for eof */
private boolean fillLast ( ) throws IOException { } } | int count ; if ( lastFilled == pageSize ) { throw new IllegalStateException ( ) ; } count = src . read ( pages [ lastNo ] , lastFilled , pageSize - lastFilled ) ; if ( count <= 0 ) { if ( count == 0 ) { throw new IllegalStateException ( ) ; } return false ; } lastFilled += count ; return true ; |
public class CmsJspLoader { /** * Updates a JSP page in the " real " file system in case the VFS resource has changed . < p >
* Also processes the < code > & lt ; % @ cms % & gt ; < / code > tags before the JSP is written to the real FS .
* Also recursively updates all files that are referenced by a < code > & lt ; % @ cms % & gt ; < / code > tag
* on this page to make sure the file actually exists in the real FS .
* All < code > & lt ; % @ include % & gt ; < / code > tags are parsed and the name in the tag is translated
* from the OpenCms VFS path to the path in the real FS .
* The same is done for filenames in < code > & lt ; % @ page errorPage = . . . % & gt ; < / code > tags . < p >
* @ param resource the requested JSP file resource in the VFS
* @ param controller the controller for the JSP integration
* @ param updatedFiles a Set containing all JSP pages that have been already updated
* @ return the file name of the updated JSP in the " real " FS
* @ throws ServletException might be thrown in the process of including the JSP
* @ throws IOException might be thrown in the process of including the JSP
* @ throws CmsLoaderException if the resource type can not be read */
public String updateJsp ( CmsResource resource , CmsFlexController controller , Set < String > updatedFiles ) throws IOException , ServletException , CmsLoaderException { } } | String jspVfsName = resource . getRootPath ( ) ; String extension ; boolean isHardInclude ; int loaderId = OpenCms . getResourceManager ( ) . getResourceType ( resource . getTypeId ( ) ) . getLoaderId ( ) ; if ( ( loaderId == CmsJspLoader . RESOURCE_LOADER_ID ) && ( ! jspVfsName . endsWith ( JSP_EXTENSION ) ) ) { // this is a true JSP resource that does not end with " . jsp "
extension = JSP_EXTENSION ; isHardInclude = false ; } else { // not a JSP resource or already ends with " . jsp "
extension = "" ; // if this is a JSP we don ' t treat it as hard include
isHardInclude = ( loaderId != CmsJspLoader . RESOURCE_LOADER_ID ) ; } String jspTargetName = CmsFileUtil . getRepositoryName ( m_jspWebAppRepository , jspVfsName + extension , controller . getCurrentRequest ( ) . isOnline ( ) ) ; // check if page was already updated
if ( updatedFiles . contains ( jspTargetName ) ) { // no need to write the already included file to the real FS more then once
return jspTargetName ; } String jspPath = CmsFileUtil . getRepositoryName ( m_jspRepository , jspVfsName + extension , controller . getCurrentRequest ( ) . isOnline ( ) ) ; File d = new File ( jspPath ) . getParentFile ( ) ; if ( ( d == null ) || ( d . exists ( ) && ! ( d . isDirectory ( ) && d . canRead ( ) ) ) ) { CmsMessageContainer message = Messages . get ( ) . container ( Messages . LOG_ACCESS_DENIED_1 , jspPath ) ; LOG . error ( message . key ( ) ) ; // can not continue
throw new ServletException ( message . key ( ) ) ; } if ( ! d . exists ( ) ) { // create directory structure
d . mkdirs ( ) ; } ReentrantReadWriteLock readWriteLock = getFileLock ( jspVfsName ) ; try { // get a read lock for this jsp
readWriteLock . readLock ( ) . lock ( ) ; File jspFile = new File ( jspPath ) ; // check if the JSP must be updated
boolean mustUpdate = false ; long jspModificationDate = 0 ; if ( ! jspFile . exists ( ) ) { // file does not exist in real FS
mustUpdate = true ; // make sure the parent folder exists
File folder = jspFile . getParentFile ( ) ; if ( ! folder . exists ( ) ) { boolean success = folder . mkdirs ( ) ; if ( ! success ) { LOG . error ( org . opencms . db . Messages . get ( ) . getBundle ( ) . key ( org . opencms . db . Messages . LOG_CREATE_FOLDER_FAILED_1 , folder . getAbsolutePath ( ) ) ) ; } } } else { jspModificationDate = jspFile . lastModified ( ) ; if ( jspModificationDate < resource . getDateLastModified ( ) ) { // file in real FS is older then file in VFS
mustUpdate = true ; } else if ( controller . getCurrentRequest ( ) . isDoRecompile ( ) ) { // recompile is forced with parameter
mustUpdate = true ; } else { // check if update is needed
if ( controller . getCurrentRequest ( ) . isOnline ( ) ) { mustUpdate = ! m_onlineJsps . containsKey ( jspVfsName ) ; } else { mustUpdate = ! m_offlineJsps . containsKey ( jspVfsName ) ; } // check strong links only if update is needed
if ( mustUpdate ) { // update strong link dependencies
mustUpdate = updateStrongLinks ( resource , controller , updatedFiles ) ; } } } if ( mustUpdate ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_WRITING_JSP_1 , jspTargetName ) ) ; } // jsp needs updating , acquire a write lock
readWriteLock . readLock ( ) . unlock ( ) ; readWriteLock . writeLock ( ) . lock ( ) ; try { // check again if updating is still necessary as this might have happened while waiting for the write lock
if ( ! jspFile . exists ( ) || ( jspModificationDate == jspFile . lastModified ( ) ) ) { updatedFiles . add ( jspTargetName ) ; byte [ ] contents ; String encoding ; try { CmsObject cms = controller . getCmsObject ( ) ; contents = cms . readFile ( resource ) . getContents ( ) ; // check the " content - encoding " property for the JSP , use system default if not found on path
encoding = cms . readPropertyObject ( resource , CmsPropertyDefinition . PROPERTY_CONTENT_ENCODING , true ) . getValue ( ) ; if ( encoding == null ) { encoding = OpenCms . getSystemInfo ( ) . getDefaultEncoding ( ) ; } else { encoding = CmsEncoder . lookupEncoding ( encoding . trim ( ) , encoding ) ; } } catch ( CmsException e ) { controller . setThrowable ( e , jspVfsName ) ; throw new ServletException ( Messages . get ( ) . getBundle ( ) . key ( Messages . ERR_LOADER_JSP_ACCESS_1 , jspVfsName ) , e ) ; } try { // parse the JSP and modify OpenCms critical directives
contents = parseJsp ( contents , encoding , controller , updatedFiles , isHardInclude ) ; if ( LOG . isInfoEnabled ( ) ) { // check for existing file and display some debug info
LOG . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_JSP_PERMCHECK_4 , new Object [ ] { jspFile . getAbsolutePath ( ) , Boolean . valueOf ( jspFile . exists ( ) ) , Boolean . valueOf ( jspFile . isFile ( ) ) , Boolean . valueOf ( jspFile . canWrite ( ) ) } ) ) ; } // write the parsed JSP content to the real FS
synchronized ( CmsJspLoader . class ) { // this must be done only one file at a time
FileOutputStream fs = new FileOutputStream ( jspFile ) ; fs . write ( contents ) ; fs . close ( ) ; // we set the modification date to ( approximately ) that of the VFS resource . This is needed because in the Online project , the old version of a JSP
// may be generated in the RFS JSP repository * after * the JSP has been changed , but * before * it has been published , which would lead
// to it not being updated after the changed JSP is published .
// Note : the RFS may only support second precision for the last modification date
jspFile . setLastModified ( ( 1 + ( resource . getDateLastModified ( ) / 1000 ) ) * 1000 ) ; } if ( controller . getCurrentRequest ( ) . isOnline ( ) ) { m_onlineJsps . put ( jspVfsName , Boolean . TRUE ) ; } else { m_offlineJsps . put ( jspVfsName , Boolean . TRUE ) ; } if ( LOG . isInfoEnabled ( ) ) { LOG . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_UPDATED_JSP_2 , jspTargetName , jspVfsName ) ) ; } } catch ( FileNotFoundException e ) { throw new ServletException ( Messages . get ( ) . getBundle ( ) . key ( Messages . ERR_LOADER_JSP_WRITE_1 , jspFile . getName ( ) ) , e ) ; } } } finally { readWriteLock . readLock ( ) . lock ( ) ; readWriteLock . writeLock ( ) . unlock ( ) ; } } // update " last modified " and " expires " date on controller
controller . updateDates ( jspFile . lastModified ( ) , CmsResource . DATE_EXPIRED_DEFAULT ) ; } finally { // m _ processingFiles . remove ( jspVfsName ) ;
readWriteLock . readLock ( ) . unlock ( ) ; } return jspTargetName ; |
public class CanalServiceImpl { /** * 删除 */
public void remove ( final Long canalId ) { } } | Assert . assertNotNull ( canalId ) ; transactionTemplate . execute ( new TransactionCallbackWithoutResult ( ) { protected void doInTransactionWithoutResult ( TransactionStatus status ) { try { Canal canal = findById ( canalId ) ; canalDao . delete ( canalId ) ; arbitrateViewService . removeCanal ( canal . getName ( ) ) ; // 删除canal节点信息
} catch ( Exception e ) { logger . error ( "ERROR ## remove canal(" + canalId + ") has an exception!" ) ; throw new ManagerException ( e ) ; } } } ) ; |
public class DefaultGroovyMethods { /** * Decorates a list allowing it to grow when called with a non - existent index value .
* When called with such values , the list is grown in size and a default value
* is placed in the list by calling a supplied < code > init < / code > Closure . Null values
* can be stored in the list .
* How it works : The decorated list intercepts all calls
* to < code > getAt ( index ) < / code > and < code > get ( index ) < / code > . If an index greater than
* or equal to the current < code > size ( ) < / code > is used , the list will grow automatically
* up to the specified index . Gaps will be filled by calling the < code > init < / code > Closure .
* If generating a default value is a costly operation consider using < code > withLazyDefault < / code > .
* Example usage :
* < pre class = " groovyTestCase " >
* def list = [ 0 , 1 ] . withEagerDefault { 42 }
* assert list [ 0 ] = = 0
* assert list [ 1 ] = = 1
* assert list [ 3 ] = = 42 / / default value
* assert list = = [ 0 , 1 , 42 , 42 ] / / gap filled with default value
* / / illustrate using the index when generating default values
* def list2 = [ 5 ] . withEagerDefault { index - > index * index }
* assert list2[3 ] = = 9
* assert list2 = = [ 5 , 1 , 4 , 9]
* / / illustrate what happens with null values
* list2[2 ] = null
* assert list2[2 ] = = null
* assert list2 = = [ 5 , 1 , null , 9]
* < / pre >
* @ param self a List
* @ param init a Closure with the target index as parameter which generates the default value
* @ return the wrapped List
* @ since 1.8.7 */
public static < T > List < T > withEagerDefault ( List < T > self , Closure init ) { } } | return ListWithDefault . newInstance ( self , false , init ) ; |
public class ConstantsSummaryWriterImpl { /** * { @ inheritDoc } */
public void addLinkToPackageContent ( PackageDoc pkg , String parsedPackageName , Set < String > printedPackageHeaders , Content contentListTree ) { } } | String packageName = pkg . name ( ) ; // add link to summary
Content link ; if ( packageName . length ( ) == 0 ) { link = getHyperLink ( getDocLink ( SectionName . UNNAMED_PACKAGE_ANCHOR ) , defaultPackageLabel , "" , "" ) ; } else { Content packageNameContent = getPackageLabel ( parsedPackageName ) ; packageNameContent . addContent ( ".*" ) ; link = getHyperLink ( DocLink . fragment ( parsedPackageName ) , packageNameContent , "" , "" ) ; printedPackageHeaders . add ( parsedPackageName ) ; } contentListTree . addContent ( HtmlTree . LI ( link ) ) ; |
public class JSONObject { /** * 将JSON内容写入Writer
* @ param writer writer
* @ param indentFactor 缩进因子 , 定义每一级别增加的缩进量
* @ param indent 本级别缩进量
* @ return Writer
* @ throws JSONException JSON相关异常 */
private Writer doWrite ( Writer writer , int indentFactor , int indent ) throws IOException { } } | writer . write ( CharUtil . DELIM_START ) ; boolean isFirst = true ; final boolean isIgnoreNullValue = this . config . isIgnoreNullValue ( ) ; final int newIndent = indent + indentFactor ; for ( Entry < String , Object > entry : this . entrySet ( ) ) { if ( ObjectUtil . isNull ( entry . getKey ( ) ) || ( ObjectUtil . isNull ( entry . getValue ( ) ) && isIgnoreNullValue ) ) { continue ; } if ( isFirst ) { isFirst = false ; } else { // 键值对分隔
writer . write ( CharUtil . COMMA ) ; } // 换行缩进
if ( indentFactor > 0 ) { writer . write ( CharUtil . LF ) ; } InternalJSONUtil . indent ( writer , newIndent ) ; writer . write ( JSONUtil . quote ( entry . getKey ( ) . toString ( ) ) ) ; writer . write ( CharUtil . COLON ) ; if ( indentFactor > 0 ) { // 冒号后的空格
writer . write ( CharUtil . SPACE ) ; } InternalJSONUtil . writeValue ( writer , entry . getValue ( ) , indentFactor , newIndent , this . config ) ; } // 结尾符
if ( indentFactor > 0 ) { writer . write ( CharUtil . LF ) ; } InternalJSONUtil . indent ( writer , indent ) ; writer . write ( CharUtil . DELIM_END ) ; return writer ; |
public class SentenceSeg { /** * get the next sentence
* @ return Sentence
* @ throws IOException */
public Sentence next ( ) throws IOException { } } | gisb . clear ( ) ; int c , pos = - 1 ; while ( ( c = readNext ( ) ) != - 1 ) { // clear the whitespace of the begainning
if ( StringUtil . isWhitespace ( c ) ) continue ; if ( c == '\n' || c == '\t' || c == '…' ) continue ; if ( StringUtil . isCnPunctuation ( c ) ) { switch ( ( char ) c ) { case '“' : case '【' : case '(' : case '《' : case '{' : break ; default : continue ; } } if ( StringUtil . isEnPunctuation ( c ) ) { switch ( ( char ) c ) { case '"' : /* case ' [ ' :
case ' ( ' :
case ' { ' :
case ' < ' : */
break ; default : continue ; } } pos = idx ; gisb . clear ( ) . append ( ( char ) c ) ; while ( ( c = readNext ( ) ) != - 1 ) { boolean endTag = false ; /* * here , define the sentence end tag
* punctuation like the following : */
switch ( ( char ) c ) { case '"' : gisb . append ( '"' ) ; readUntil ( '"' ) ; break ; case '“' : gisb . append ( '“' ) ; readUntil ( '”' ) ; break ; case '【' : gisb . append ( '【' ) ; readUntil ( '】' ) ; break ; case '《' : gisb . append ( '《' ) ; readUntil ( '》' ) ; break ; case '.' : { int chr = readNext ( ) ; gisb . append ( ( char ) c ) ; if ( StringUtil . isEnLetter ( chr ) ) { reader . unread ( chr ) ; continue ; } else { endTag = true ; } break ; } case '。' : case ';' : case ';' : case '?' : case '?' : case '!' : case '!' : case '…' : { endTag = true ; gisb . append ( ( char ) c ) ; break ; } case ':' : case ':' : case '\n' : { endTag = true ; break ; } default : gisb . append ( ( char ) c ) ; } if ( endTag ) break ; } // clear the whitespace from the back
for ( int i = gisb . length ( ) - 1 ; i >= 0 ; i -- ) { char chr = gisb . charAt ( i ) ; if ( chr == ' ' || chr == '\t' ) gisb . deleteCharAt ( i ) ; else break ; } if ( gisb . length ( ) <= 1 ) continue ; return new Sentence ( gisb . toString ( ) , pos ) ; } return null ; |
public class CommerceAddressPersistenceImpl { /** * Removes all the commerce addresses where commerceCountryId = & # 63 ; from the database .
* @ param commerceCountryId the commerce country ID */
@ Override public void removeByCommerceCountryId ( long commerceCountryId ) { } } | for ( CommerceAddress commerceAddress : findByCommerceCountryId ( commerceCountryId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( commerceAddress ) ; } |
public class ResultSet { /** * The rows in the table .
* @ param rows
* The rows in the table . */
public void setRows ( java . util . Collection < Row > rows ) { } } | if ( rows == null ) { this . rows = null ; return ; } this . rows = new java . util . ArrayList < Row > ( rows ) ; |
public class QueryBuilder { /** * Return a { @ link QueryCommand } representing the currently - built query .
* @ return the resulting query command ; never null
* @ see # clear ( ) */
public QueryCommand query ( ) { } } | QueryCommand result = new Query ( source , constraint , orderings , columns , limit , distinct ) ; if ( this . firstQuery != null ) { // EXCEPT has a higher precedence than INTERSECT or UNION , so if the first query is
// an INTERSECT or UNION SetQuery , the result should be applied to the RHS of the previous set . . .
if ( firstQuery instanceof SetQuery && firstQuerySetOperation == Operation . EXCEPT ) { SetQuery setQuery = ( SetQuery ) firstQuery ; QueryCommand left = setQuery . getLeft ( ) ; QueryCommand right = setQuery . getRight ( ) ; SetQuery exceptQuery = new SetQuery ( right , Operation . EXCEPT , result , firstQueryAll ) ; result = new SetQuery ( left , setQuery . operation ( ) , exceptQuery , setQuery . isAll ( ) ) ; } else { result = new SetQuery ( this . firstQuery , this . firstQuerySetOperation , result , this . firstQueryAll ) ; } } return result ; |
public class RegistriesInner { /** * Lists the login credentials for the specified container registry .
* @ param resourceGroupName The name of the resource group to which the container registry belongs .
* @ param registryName The name of the container registry .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the RegistryListCredentialsResultInner object if successful . */
public RegistryListCredentialsResultInner listCredentials ( String resourceGroupName , String registryName ) { } } | return listCredentialsWithServiceResponseAsync ( resourceGroupName , registryName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class SpatialDbsImportUtils { /** * Create a spatial table using a shapefile as schema .
* @ param db the database to use .
* @ param shapeFile the shapefile to use .
* @ param newTableName the new name of the table . If null , the shp name is used .
* @ return the name of the created table .
* @ param avoidSpatialIndex if < code > true < / code > , no spatial index will be created . This is useful if many records
* have to be inserted and the index will be created later manually .
* @ return the name of the created table .
* @ throws Exception */
public static String createTableFromShp ( ASpatialDb db , File shapeFile , String newTableName , boolean avoidSpatialIndex ) throws Exception { } } | FileDataStore store = FileDataStoreFinder . getDataStore ( shapeFile ) ; SimpleFeatureSource featureSource = store . getFeatureSource ( ) ; SimpleFeatureType schema = featureSource . getSchema ( ) ; if ( newTableName == null ) { newTableName = FileUtilities . getNameWithoutExtention ( shapeFile ) ; } return createTableFromSchema ( db , schema , newTableName , avoidSpatialIndex ) ; |
public class CostlessMeldPairingHeap { /** * Decrease the key of a node . */
@ SuppressWarnings ( "unchecked" ) private void decreaseKey ( Node < K , V > n , K newKey ) { } } | int c ; if ( comparator == null ) { c = ( ( Comparable < ? super K > ) newKey ) . compareTo ( n . key ) ; } else { c = comparator . compare ( newKey , n . key ) ; } if ( c > 0 ) { throw new IllegalArgumentException ( "Keys can only be decreased!" ) ; } n . key = newKey ; if ( c == 0 || root == n ) { // root or no change in key
return ; } else if ( n . o_s == null && n . poolIndex == Node . NO_INDEX ) { // no root , no parent and no pool index
throw new IllegalArgumentException ( "Invalid handle!" ) ; } else if ( n . o_s == null ) { // no parent and not root , so inside pool
Node < K , V > poolMin = decreasePool [ decreasePoolMinPos ] ; if ( comparator == null ) { c = ( ( Comparable < ? super K > ) newKey ) . compareTo ( poolMin . key ) ; } else { c = comparator . compare ( newKey , poolMin . key ) ; } if ( c < 0 ) { decreasePoolMinPos = n . poolIndex ; } return ; } else { // node has a parent
Node < K , V > oldestChild = cutOldestChild ( n ) ; if ( oldestChild != null ) { linkInPlace ( oldestChild , n ) ; } else { cutFromParent ( n ) ; } // append node ( minus oldest child ) to decrease pool
addPool ( n , true ) ; // if decrease pool has > = ceil ( logn ) trees , consolidate
double sizeAsDouble = size ; if ( decreasePoolSize >= Math . getExponent ( sizeAsDouble ) + 1 ) { consolidate ( ) ; } } |
public class AjaxBehavior { /** * Utility for restoring bindings from state */
private static Map < String , ValueExpression > restoreBindings ( FacesContext context , Object state ) { } } | // Note : This code is copied from UIComponentBase . See note above
// in saveBindings ( ) .
if ( state == null ) { return ( null ) ; } Object values [ ] = ( Object [ ] ) state ; String names [ ] = ( String [ ] ) values [ 0 ] ; Object states [ ] = ( Object [ ] ) values [ 1 ] ; Map < String , ValueExpression > bindings = new HashMap < String , ValueExpression > ( names . length ) ; for ( int i = 0 ; i < names . length ; i ++ ) { bindings . put ( names [ i ] , ( ValueExpression ) UIComponentBase . restoreAttachedState ( context , states [ i ] ) ) ; } return ( bindings ) ; |
public class ScriptPattern { /** * Returns true if this script is of the form { @ code OP _ 0 < hash > } and hash is 20 bytes long . This can only be a P2WPKH
* scriptPubKey . This script type was introduced with segwit . */
public static boolean isP2WPKH ( Script script ) { } } | if ( ! isP2WH ( script ) ) return false ; List < ScriptChunk > chunks = script . chunks ; if ( ! chunks . get ( 0 ) . equalsOpCode ( OP_0 ) ) return false ; byte [ ] chunk1data = chunks . get ( 1 ) . data ; return chunk1data != null && chunk1data . length == SegwitAddress . WITNESS_PROGRAM_LENGTH_PKH ; |
public class AWSServerMigrationClient { /** * Stops replicating an application .
* @ param stopAppReplicationRequest
* @ return Result of the StopAppReplication operation returned by the service .
* @ throws UnauthorizedOperationException
* You lack permissions needed to perform this operation . Check your IAM policies , and ensure that you are
* using the correct access keys .
* @ throws InvalidParameterException
* A specified parameter is not valid .
* @ throws MissingRequiredParameterException
* A required parameter is missing .
* @ throws InternalErrorException
* An internal error occurred .
* @ throws OperationNotPermittedException
* This operation is not allowed .
* @ sample AWSServerMigration . StopAppReplication
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / sms - 2016-10-24 / StopAppReplication " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public StopAppReplicationResult stopAppReplication ( StopAppReplicationRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeStopAppReplication ( request ) ; |
public class DeleteScanListener { /** * Do whatever processing that needs to be done on this directory .
* @ return caller specific information about this directory . */
public void postProcessThisDirectory ( File fileDir , Object objDirID ) { } } | if ( DBConstants . TRUE . equalsIgnoreCase ( this . getProperty ( "deleteDir" ) ) ) fileDir . delete ( ) ; |
public class SOAPHelper { /** * Write message with attachments to stream
* @ param msg
* @ return */
public static InputStream toInputStream ( SOAPMessage msg ) { } } | if ( msg == null ) return null ; ByteArrayOutputStream os = new ByteArrayOutputStream ( ) ; try { msg . writeTo ( os ) ; } catch ( Exception e ) { throw S1SystemError . wrap ( e ) ; } return new ByteArrayInputStream ( os . toByteArray ( ) ) ; |
public class CmsGitCheckin { /** * Imports a module from the given zip file . < p >
* @ param file the module file to import
* @ throws CmsException if soemthing goes wrong
* @ return true if there were no errors during the import */
private boolean importModule ( File file ) throws CmsException { } } | m_logStream . println ( "Trying to import module from " + file . getAbsolutePath ( ) ) ; I_CmsReport report = new CmsPrintStreamReport ( m_logStream , OpenCms . getWorkplaceManager ( ) . getWorkplaceLocale ( getCmsObject ( ) ) , false ) ; OpenCms . getModuleManager ( ) . replaceModule ( m_cms , file . getAbsolutePath ( ) , report ) ; file . delete ( ) ; if ( report . hasError ( ) || report . hasWarning ( ) ) { m_logStream . println ( "Import failed, see opencms.log for details" ) ; return false ; } return true ; |
public class XForLoopExpressionImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setEachExpression ( XExpression newEachExpression ) { } } | if ( newEachExpression != eachExpression ) { NotificationChain msgs = null ; if ( eachExpression != null ) msgs = ( ( InternalEObject ) eachExpression ) . eInverseRemove ( this , EOPPOSITE_FEATURE_BASE - XbasePackage . XFOR_LOOP_EXPRESSION__EACH_EXPRESSION , null , msgs ) ; if ( newEachExpression != null ) msgs = ( ( InternalEObject ) newEachExpression ) . eInverseAdd ( this , EOPPOSITE_FEATURE_BASE - XbasePackage . XFOR_LOOP_EXPRESSION__EACH_EXPRESSION , null , msgs ) ; msgs = basicSetEachExpression ( newEachExpression , msgs ) ; if ( msgs != null ) msgs . dispatch ( ) ; } else if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , XbasePackage . XFOR_LOOP_EXPRESSION__EACH_EXPRESSION , newEachExpression , newEachExpression ) ) ; |
public class IsProtonInAromaticSystemDescriptor { /** * The method is a proton descriptor that evaluate if a proton is bonded to an aromatic system or if there is distance of 2 bonds .
* It is needed to call the addExplicitHydrogensToSatisfyValency method from the class tools . HydrogenAdder .
* @ param atom The IAtom for which the DescriptorValue is requested
* @ param atomContainer AtomContainer
* @ return true if the proton is bonded to an aromatic atom . */
@ Override public DescriptorValue calculate ( IAtom atom , IAtomContainer atomContainer ) { } } | IAtomContainer clonedAtomContainer ; try { clonedAtomContainer = ( IAtomContainer ) atomContainer . clone ( ) ; } catch ( CloneNotSupportedException e ) { return new DescriptorValue ( getSpecification ( ) , getParameterNames ( ) , getParameters ( ) , new IntegerResult ( ( int ) Double . NaN ) , NAMES , e ) ; } IAtom clonedAtom = clonedAtomContainer . getAtom ( atomContainer . indexOf ( atom ) ) ; int isProtonInAromaticSystem = 0 ; IAtomContainer mol = atom . getBuilder ( ) . newInstance ( IAtomContainer . class , clonedAtomContainer ) ; if ( checkAromaticity ) { try { AtomContainerManipulator . percieveAtomTypesAndConfigureAtoms ( mol ) ; Aromaticity . cdkLegacy ( ) . apply ( mol ) ; } catch ( CDKException e ) { return new DescriptorValue ( getSpecification ( ) , getParameterNames ( ) , getParameters ( ) , new IntegerResult ( ( int ) Double . NaN ) , NAMES , e ) ; } } List < IAtom > neighboor = mol . getConnectedAtomsList ( clonedAtom ) ; IAtom neighbour0 = ( IAtom ) neighboor . get ( 0 ) ; if ( atom . getSymbol ( ) . equals ( "H" ) ) { // logger . debug ( " aromatic proton " ) ;
if ( neighbour0 . getFlag ( CDKConstants . ISAROMATIC ) ) { isProtonInAromaticSystem = 1 ; } else { List < IAtom > betaAtoms = clonedAtomContainer . getConnectedAtomsList ( neighbour0 ) ; for ( IAtom betaAtom : betaAtoms ) { if ( betaAtom . getFlag ( CDKConstants . ISAROMATIC ) ) { isProtonInAromaticSystem = 2 ; } else { isProtonInAromaticSystem = 0 ; } } } } else { isProtonInAromaticSystem = 0 ; } return new DescriptorValue ( getSpecification ( ) , getParameterNames ( ) , getParameters ( ) , new IntegerResult ( isProtonInAromaticSystem ) , NAMES ) ; |
public class ArchivalUrlASXReplayRenderer { /** * / * ( non - Javadoc )
* @ see org . archive . wayback . archivalurl . ArchivalUrlReplayRenderer # updatePage ( org . archive . wayback . replay . HTMLPage , javax . servlet . http . HttpServletRequest , javax . servlet . http . HttpServletResponse , org . archive . wayback . core . WaybackRequest , org . archive . wayback . core . CaptureSearchResult , org . archive . wayback . core . Resource , org . archive . wayback . ResultURIConverter , org . archive . wayback . core . CaptureSearchResults ) */
@ Override protected void updatePage ( TextDocument page , HttpServletRequest httpRequest , HttpServletResponse httpResponse , WaybackRequest wbRequest , CaptureSearchResult result , Resource resource , ResultURIConverter uriConverter , CaptureSearchResults results ) throws ServletException , IOException { } } | page . resolveASXRefUrls ( ) ; |
public class DescribeMatchmakingRuleSetsResult { /** * Collection of requested matchmaking rule set objects .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setRuleSets ( java . util . Collection ) } or { @ link # withRuleSets ( java . util . Collection ) } if you want to override
* the existing values .
* @ param ruleSets
* Collection of requested matchmaking rule set objects .
* @ return Returns a reference to this object so that method calls can be chained together . */
public DescribeMatchmakingRuleSetsResult withRuleSets ( MatchmakingRuleSet ... ruleSets ) { } } | if ( this . ruleSets == null ) { setRuleSets ( new java . util . ArrayList < MatchmakingRuleSet > ( ruleSets . length ) ) ; } for ( MatchmakingRuleSet ele : ruleSets ) { this . ruleSets . add ( ele ) ; } return this ; |
public class ProcessDefinitionManager { /** * Deletes the given process definition from the database and cache .
* If cascadeToHistory and cascadeToInstances is set to true it deletes
* the history and the process instances .
* * Note * : If more than one process definition , from one deployment , is deleted in
* a single transaction and the cascadeToHistory and cascadeToInstances flag was set to true it
* can cause a dirty deployment cache . The process instances of ALL process definitions must be deleted ,
* before every process definition can be deleted ! In such cases the cascadeToInstances flag
* have to set to false !
* On deletion of all process instances , the task listeners will be deleted as well .
* Deletion of tasks and listeners needs the redeployment of deployments .
* It can cause to problems if is done sequential with the deletion of process definition
* in a single transaction .
* * For example * :
* Deployment contains two process definition . First process definition
* and instances will be removed , also cleared from the cache .
* Second process definition will be removed and his instances .
* Deletion of instances will cause redeployment this deploys again
* first into the cache . Only the second will be removed from cache and
* first remains in the cache after the deletion process .
* @ param processDefinition the process definition which should be deleted
* @ param processDefinitionId the id of the process definition
* @ param cascadeToHistory if true the history will deleted as well
* @ param cascadeToInstances if true the process instances are deleted as well
* @ param skipCustomListeners if true skips the custom listeners on deletion of instances
* @ param skipIoMappings specifies whether input / output mappings for tasks should be invoked */
public void deleteProcessDefinition ( ProcessDefinition processDefinition , String processDefinitionId , boolean cascadeToHistory , boolean cascadeToInstances , boolean skipCustomListeners , boolean skipIoMappings ) { } } | if ( cascadeToHistory ) { cascadeDeleteHistoryForProcessDefinition ( processDefinitionId ) ; if ( cascadeToInstances ) { cascadeDeleteProcessInstancesForProcessDefinition ( processDefinitionId , skipCustomListeners , skipIoMappings ) ; } } else { ProcessInstanceQueryImpl procInstQuery = new ProcessInstanceQueryImpl ( ) . processDefinitionId ( processDefinitionId ) ; long processInstanceCount = getProcessInstanceManager ( ) . findProcessInstanceCountByQueryCriteria ( procInstQuery ) ; if ( processInstanceCount != 0 ) { throw LOG . deleteProcessDefinitionWithProcessInstancesException ( processDefinitionId , processInstanceCount ) ; } } // remove related authorization parameters in IdentityLink table
getIdentityLinkManager ( ) . deleteIdentityLinksByProcDef ( processDefinitionId ) ; // remove timer start events :
deleteTimerStartEventsForProcessDefinition ( processDefinition ) ; // delete process definition from database
getDbEntityManager ( ) . delete ( ProcessDefinitionEntity . class , "deleteProcessDefinitionsById" , processDefinitionId ) ; // remove process definition from cache :
Context . getProcessEngineConfiguration ( ) . getDeploymentCache ( ) . removeProcessDefinition ( processDefinitionId ) ; deleteSubscriptionsForProcessDefinition ( processDefinitionId ) ; // delete job definitions
getJobDefinitionManager ( ) . deleteJobDefinitionsByProcessDefinitionId ( processDefinition . getId ( ) ) ; |
public class HadoopKeyStoreManager { /** * Sets the password in the currently openend keystore . Do not forget to store it afterwards
* @ param alias
* @ param password to store
* @ param passwordPassword password for encrypting password . You can use the same as the keystore password
* @ throws NoSuchAlgorithmException
* @ throws InvalidKeySpecException
* @ throws KeyStoreException */
public void setPassword ( String alias , String password , String passwordPassword ) throws NoSuchAlgorithmException , InvalidKeySpecException , KeyStoreException { } } | SecretKeyFactory skf = SecretKeyFactory . getInstance ( "PBE" ) ; SecretKey pSecret = skf . generateSecret ( new PBEKeySpec ( password . toCharArray ( ) ) ) ; KeyStore . PasswordProtection kspp = new KeyStore . PasswordProtection ( passwordPassword . toCharArray ( ) ) ; this . keystore . setEntry ( alias , new KeyStore . SecretKeyEntry ( pSecret ) , kspp ) ; |
public class SameDiff { /** * Variable initialization with a specified { @ link WeightInitScheme }
* This method creates VARIABLE type SDVariable - i . e . , must be floating point , and is a trainable parameter . See { @ link VariableType } for more details .
* @ param name the name of the variable
* @ param shape the shape of the array to be created
* @ param weightInitScheme the weight initialization scheme
* @ return the created variable */
public SDVariable var ( @ NonNull String name , @ NonNull WeightInitScheme weightInitScheme , @ NonNull org . nd4j . linalg . api . buffer . DataType dataType , @ NonNull long ... shape ) { } } | return var ( name , VariableType . VARIABLE , weightInitScheme , dataType , shape ) ; |
public class HalFormsSerializers { /** * Extract template details from a { @ link RepresentationModel } ' s { @ link Affordance } s .
* @ param resource
* @ return */
private static Map < String , HalFormsTemplate > findTemplates ( RepresentationModel < ? > resource ) { } } | if ( ! resource . hasLink ( IanaLinkRelations . SELF ) ) { return Collections . emptyMap ( ) ; } Map < String , HalFormsTemplate > templates = new HashMap < > ( ) ; List < Affordance > affordances = resource . getLink ( IanaLinkRelations . SELF ) . map ( Link :: getAffordances ) . orElse ( Collections . emptyList ( ) ) ; affordances . stream ( ) . map ( it -> it . getAffordanceModel ( MediaTypes . HAL_FORMS_JSON ) ) . map ( HalFormsAffordanceModel . class :: cast ) . filter ( it -> ! it . hasHttpMethod ( HttpMethod . GET ) ) . peek ( it -> validate ( resource , it ) ) . forEach ( it -> { HalFormsTemplate template = HalFormsTemplate . forMethod ( it . getHttpMethod ( ) ) . withProperties ( it . getInputProperties ( ) ) ; /* * First template in HAL - FORMS is " default " . */
templates . put ( templates . isEmpty ( ) ? "default" : it . getName ( ) , template ) ; } ) ; return templates ; |
public class SimpleMatcher { /** * Default implementation of getValue ( ) , SetVal subclasses will
* override
* @ param msg
* @ param contextValue
* @ throws MatchingException
* @ throws BadMessageFormatMatchingException */
Object getValue ( MatchSpaceKey msg , Object contextValue ) throws MatchingException , BadMessageFormatMatchingException { } } | return msg . getIdentifierValue ( id , false , contextValue , false ) ; |
public class DatanodeDescriptor { /** * Add data - node to the block .
* Add block to the head of the list of blocks belonging to the data - node . */
boolean addBlock ( BlockInfo b ) { } } | int dnIndex = b . addNode ( this ) ; if ( dnIndex < 0 ) return false ; // add to the head of the data - node list
blockList = b . listInsert ( blockList , this , dnIndex ) ; numOfBlocks ++ ; return true ; |
public class ParserDQL { /** * no < row value expression > and no < predicate > */
Expression XreadAllTypesCommonValueExpression ( boolean boole ) { } } | Expression e = XreadAllTypesTerm ( boole ) ; int type = 0 ; boolean end = false ; while ( true ) { switch ( token . tokenType ) { case Tokens . PLUS : type = OpTypes . ADD ; boole = false ; break ; case Tokens . MINUS : type = OpTypes . SUBTRACT ; boole = false ; break ; case Tokens . CONCAT : type = OpTypes . CONCAT ; boole = false ; break ; case Tokens . OR : if ( boole ) { type = OpTypes . OR ; break ; } // $ FALL - THROUGH $
default : end = true ; break ; } if ( end ) { break ; } read ( ) ; Expression a = e ; e = XreadAllTypesTerm ( boole ) ; e = boole ? new ExpressionLogical ( type , a , e ) : new ExpressionArithmetic ( type , a , e ) ; } return e ; |
public class IntlPhoneInput { /** * Hide keyboard from phoneEdit field */
public void hideKeyboard ( ) { } } | InputMethodManager inputMethodManager = ( InputMethodManager ) getContext ( ) . getApplicationContext ( ) . getSystemService ( Context . INPUT_METHOD_SERVICE ) ; inputMethodManager . hideSoftInputFromWindow ( mPhoneEdit . getWindowToken ( ) , 0 ) ; |
public class SammonMappingDemo { /** * Execute the MDS algorithm and return a swing JComponent representing
* the clusters . */
public JComponent learn ( ) { } } | JPanel pane = new JPanel ( new GridLayout ( 1 , 2 ) ) ; double [ ] [ ] data = dataset [ datasetIndex ] . toArray ( new double [ dataset [ datasetIndex ] . size ( ) ] [ ] ) ; String [ ] labels = dataset [ datasetIndex ] . toArray ( new String [ dataset [ datasetIndex ] . size ( ) ] ) ; if ( labels [ 0 ] == null ) { Attribute [ ] attr = dataset [ datasetIndex ] . attributes ( ) ; labels = new String [ attr . length ] ; for ( int i = 0 ; i < labels . length ; i ++ ) { labels [ i ] = attr [ i ] . getName ( ) ; } } long clock = System . currentTimeMillis ( ) ; SammonMapping sammon = new SammonMapping ( data , 2 ) ; System . out . format ( "Learn Sammon's Mapping (k=2) from %d samples in %dms\n" , data . length , System . currentTimeMillis ( ) - clock ) ; PlotCanvas plot = ScatterPlot . plot ( sammon . getCoordinates ( ) , labels ) ; plot . setTitle ( "Sammon's Mapping (k = 2)" ) ; pane . add ( plot ) ; clock = System . currentTimeMillis ( ) ; sammon = new SammonMapping ( data , 3 ) ; System . out . format ( "Learn Sammon's Mapping (k=3) from %d samples in %dms\n" , data . length , System . currentTimeMillis ( ) - clock ) ; plot = ScatterPlot . plot ( sammon . getCoordinates ( ) , labels ) ; plot . setTitle ( "Sammon's Mapping (k = 3)" ) ; pane . add ( plot ) ; return pane ; |
public class CmsSearchIndex { /** * Shuts down the search index . < p >
* This will close the local Lucene index searcher instance . < p > */
@ Override public void shutDown ( ) { } } | super . shutDown ( ) ; indexSearcherClose ( ) ; if ( m_analyzer != null ) { m_analyzer . close ( ) ; } if ( CmsLog . INIT . isInfoEnabled ( ) ) { CmsLog . INIT . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . INIT_SHUTDOWN_INDEX_1 , getName ( ) ) ) ; } |
public class ClientSideHandlerGeneratorImpl { /** * Returns the header section for the client side handler
* @ param request
* the HTTP request
* @ return the header section for the client side handler */
protected StringBuffer getHeaderSection ( HttpServletRequest request ) { } } | StringBuffer sb = new StringBuffer ( mainScriptTemplate . toString ( ) ) ; sb . append ( "JAWR.app_context_path='" ) . append ( request . getContextPath ( ) ) . append ( "';\n" ) ; return sb ; |
public class AbstractCollectionBindTransform { /** * ( non - Javadoc )
* @ see com . abubusoft . kripton . processor . bind . transform . BindTransform #
* generateParseOnXml ( com . abubusoft . kripton . processor . bind . BindTypeContext ,
* com . squareup . javapoet . MethodSpec . Builder , java . lang . String ,
* com . squareup . javapoet . TypeName , java . lang . String ,
* com . abubusoft . kripton . processor . bind . model . BindProperty ) */
@ Override public void generateParseOnXml ( BindTypeContext context , MethodSpec . Builder methodBuilder , String parserName , TypeName beanClass , String beanName , BindProperty property ) { } } | TypeName elementTypeName = extractTypeParameterName ( property ) ; // @ formatter : off
methodBuilder . beginControlFlow ( "" ) ; switch ( collectionType ) { case ARRAY : methodBuilder . addStatement ( "$T<$T> collection=new $T<>()" , ArrayList . class , elementTypeName . box ( ) , ArrayList . class ) ; break ; case LIST : case SET : // it ' s for sure a parametrized type
ParameterizedTypeName collectionTypeName = ( ParameterizedTypeName ) property . getPropertyType ( ) . getTypeName ( ) ; methodBuilder . addStatement ( "$T<$T> collection=new $T<>()" , defineCollectionClass ( collectionTypeName ) , elementTypeName . box ( ) , defineCollectionClass ( collectionTypeName ) ) ; break ; } methodBuilder . addStatement ( "$T item" , elementTypeName . box ( ) ) ; BindTransform transform = BindTransformer . lookup ( elementTypeName ) ; BindProperty elementProperty = BindProperty . builder ( elementTypeName , property ) . inCollection ( true ) . build ( ) ; if ( property . xmlInfo . isWrappedCollection ( ) ) { // with wrap element
methodBuilder . beginControlFlow ( "while ($L.nextTag() != $T.END_TAG && $L.getName().toString().equals($S))" , parserName , XmlPullParser . class , parserName , property . xmlInfo . labelItem ) ; } else { // no wrap element
methodBuilder . addCode ( "// add first element\n" ) ; methodBuilder . addStatement ( "item=$L" , DEFAULT_VALUE ) ; methodBuilder . beginControlFlow ( "if ($L.isEmptyElement())" , parserName ) ; methodBuilder . addCode ( "// if there's a an empty collection it marked with attribute emptyCollection\n" ) ; methodBuilder . beginControlFlow ( "if ($T.getAttributeAsBoolean($L, $S, false)==false)" , XmlAttributeUtils . class , parserName , EMPTY_COLLECTION_ATTRIBUTE_NAME ) ; methodBuilder . addStatement ( "collection.add(item)" ) ; methodBuilder . endControlFlow ( ) ; methodBuilder . addStatement ( "$L.nextTag()" , parserName ) ; methodBuilder . nextControlFlow ( "else" ) ; transform . generateParseOnXml ( context , methodBuilder , parserName , null , "item" , elementProperty ) ; methodBuilder . addStatement ( "collection.add(item)" ) ; methodBuilder . endControlFlow ( ) ; methodBuilder . beginControlFlow ( "while ($L.nextTag() != $T.END_TAG && $L.getName().toString().equals($S))" , parserName , XmlPullParser . class , parserName , BindProperty . xmlName ( property ) ) ; } // for all
methodBuilder . beginControlFlow ( "if ($L.isEmptyElement())" , parserName ) ; methodBuilder . addStatement ( "item=$L" , DEFAULT_VALUE ) ; methodBuilder . addStatement ( "$L.nextTag()" , parserName ) ; methodBuilder . nextControlFlow ( "else" ) ; transform . generateParseOnXml ( context , methodBuilder , parserName , null , "item" , elementProperty ) ; methodBuilder . endControlFlow ( ) ; methodBuilder . addStatement ( "collection.add(item)" ) ; methodBuilder . endControlFlow ( ) ; if ( collectionType == CollectionType . ARRAY ) { if ( TypeUtility . isTypePrimitive ( elementTypeName ) ) { methodBuilder . addStatement ( setter ( beanClass , beanName , property , "$T.as$TTypeArray(collection)" ) , CollectionUtils . class , elementTypeName . box ( ) ) ; } else if ( TypeUtility . isTypeWrappedPrimitive ( elementTypeName ) ) { methodBuilder . addStatement ( setter ( beanClass , beanName , property , "$T.as$TArray(collection)" ) , CollectionUtils . class , elementTypeName ) ; } else { methodBuilder . addStatement ( setter ( beanClass , beanName , property , "$T.asArray(collection, new $T[collection.size()])" ) , CollectionUtils . class , elementTypeName ) ; } } else { methodBuilder . addStatement ( setter ( beanClass , beanName , property , "collection" ) ) ; } if ( ! property . xmlInfo . isWrappedCollection ( ) ) { methodBuilder . addStatement ( "read=false" ) ; } methodBuilder . endControlFlow ( ) ; // @ formatter : on |
public class AlgorithmChecker { /** * Try to set the trust anchor of the checker .
* If there is no trust anchor specified and the checker has not started ,
* set the trust anchor .
* @ param anchor the trust anchor selected to validate the target
* certificate */
void trySetTrustAnchor ( TrustAnchor anchor ) { } } | // Don ' t bother if the check has started or trust anchor has already
// specified .
if ( prevPubKey == null ) { if ( anchor == null ) { throw new IllegalArgumentException ( "The trust anchor cannot be null" ) ; } // Don ' t bother to change the trustedPubKey .
if ( anchor . getTrustedCert ( ) != null ) { prevPubKey = anchor . getTrustedCert ( ) . getPublicKey ( ) ; } else { prevPubKey = anchor . getCAPublicKey ( ) ; } } |
public class ContentLoader { /** * Loads content from an external content definition into the underlying repository .
* @ param contentDefinition
* URL pointing to the resource that defines the content to be loaded .
* @ return The root node , defined by the content ' s document element , is returned .
* @ throws RepositoryException */
public Node loadContent ( URL contentDefinition ) throws RepositoryException { } } | LOG . info ( "Loading Content" ) ; final Session session = repository . getAdminSession ( ) ; final XMLContentLoader loader = new XMLContentLoader ( ) ; return loader . loadContent ( session , contentDefinition ) ; |
public class Navigator { /** * Prints navigation history */
private void dumpHistory ( ) { } } | if ( navigationManager . dumpHistoryOnLocationChange ) { navigationManager . logger . trace ( "" ) ; navigationManager . logger . trace ( "Nav Controller: dump: begin ---------------------------------------------->" ) ; NavLocation curLoc = navigationManager . getModel ( ) . getCurrentLocation ( ) ; while ( curLoc != null ) { navigationManager . logger . trace ( "Nav Controller: dump: {}({})" , curLoc . getLocationId ( ) ) ; curLoc = curLoc . getPreviousLocation ( ) ; } navigationManager . logger . trace ( "Nav Controller: dump: end ---------------------------------------------->" ) ; navigationManager . logger . trace ( "" ) ; } |
public class JvmFloatAnnotationValueImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case TypesPackage . JVM_FLOAT_ANNOTATION_VALUE__VALUES : getValues ( ) . clear ( ) ; return ; } super . eUnset ( featureID ) ; |
public class DBObject { /** * Arrays . asList ( ) cannot be expanded . */
private void setSystemField ( String fieldName , String value ) { } } | if ( Utils . isEmpty ( value ) ) { m_valueMap . remove ( fieldName ) ; } else { m_valueMap . put ( fieldName , Arrays . asList ( value ) ) ; } |
public class Compiler { /** * Replace a source input dynamically . Intended for incremental
* re - compilation .
* If the new source input doesn ' t parse , then keep the old input
* in the AST and return false .
* @ return Whether the new AST was attached successfully . */
boolean replaceIncrementalSourceAst ( JsAst ast ) { } } | CompilerInput oldInput = getInput ( ast . getInputId ( ) ) ; checkNotNull ( oldInput , "No input to replace: %s" , ast . getInputId ( ) . getIdName ( ) ) ; Node newRoot = checkNotNull ( ast . getAstRoot ( this ) ) ; Node oldRoot = oldInput . getAstRoot ( this ) ; oldRoot . replaceWith ( newRoot ) ; CompilerInput newInput = new CompilerInput ( ast ) ; putCompilerInput ( ast . getInputId ( ) , newInput ) ; JSModule module = oldInput . getModule ( ) ; if ( module != null ) { module . addAfter ( newInput , oldInput ) ; module . remove ( oldInput ) ; } // Verify the input id is set properly .
checkState ( newInput . getInputId ( ) . equals ( oldInput . getInputId ( ) ) ) ; InputId inputIdOnAst = newInput . getAstRoot ( this ) . getInputId ( ) ; checkState ( newInput . getInputId ( ) . equals ( inputIdOnAst ) ) ; return true ; |
public class JobManager { /** * Cancel either the pending { @ link JobRequest } or the running { @ link Job } .
* @ param jobId The unique ID of the { @ link JobRequest } or running { @ link Job } .
* @ return { @ code true } if a request or job were found and canceled . */
public boolean cancel ( int jobId ) { } } | // call both methods
boolean result = cancelInner ( getJobRequest ( jobId , true ) ) | cancelInner ( getJob ( jobId ) ) ; JobProxy . Common . cleanUpOrphanedJob ( mContext , jobId ) ; // do this as well , just in case
return result ; |
public class BigDecimalMathExperimental { /** * variations on sqrt ( ) */
public static BigDecimal sqrtUsingNewtonPrint ( BigDecimal x , MathContext mathContext ) { } } | switch ( x . signum ( ) ) { case 0 : return ZERO ; case - 1 : throw new ArithmeticException ( "Illegal sqrt(x) for x < 0: x = " + x ) ; } MathContext mc = new MathContext ( mathContext . getPrecision ( ) + 4 , mathContext . getRoundingMode ( ) ) ; BigDecimal acceptableError = ONE . movePointLeft ( mathContext . getPrecision ( ) + 1 ) ; BigDecimal result = BigDecimal . valueOf ( Math . sqrt ( x . doubleValue ( ) ) ) ; BigDecimal last ; do { last = result ; result = x . divide ( result , mc ) . add ( last ) . divide ( TWO , mc ) ; System . out . printf ( "%5d, " , countSameCharacters ( last . toPlainString ( ) , result . toPlainString ( ) ) ) ; } while ( result . subtract ( last ) . abs ( ) . compareTo ( acceptableError ) > 0 ) ; return result . round ( mathContext ) ; |
public class ComboButton { /** * Adds a button to this { @ link ComboButton }
* @ param text
* the text of the button
* @ param icon
* the icon of the button
* @ param toggleButton
* whether or not this button should be a toggle button ( true ) or
* a regular button ( false )
* @ return */
public AbstractButton addButton ( final String text , final Icon icon , final boolean toggleButton ) { } } | final AbstractButton button ; if ( toggleButton ) { button = new JToggleButton ( text , icon ) ; button . addActionListener ( _commonToggleButtonActionListener ) ; } else { button = new JButton ( text , icon ) ; } addButton ( button ) ; return button ; |
public class Monitors { /** * Increment a counter that is used to measure the rate at which some event
* is occurring . Consider a simple queue , counters would be used to measure
* things like the rate at which items are being inserted and removed .
* @ param className
* @ param name
* @ param additionalTags */
private static void counter ( String className , String name , String ... additionalTags ) { } } | getCounter ( className , name , additionalTags ) . increment ( ) ; |
public class ToXMLStream { /** * Starts a whitespace preserving section . All characters printed
* within a preserving section are printed without indentation and
* without consolidating multiple spaces . This is equivalent to
* the < tt > xml : space = & quot ; preserve & quot ; < / tt > attribute . Only XML
* and HTML serializers need to support this method .
* The contents of the whitespace preserving section will be delivered
* through the regular < tt > characters < / tt > event .
* @ throws org . xml . sax . SAXException */
public void startPreserving ( ) throws org . xml . sax . SAXException { } } | // Not sure this is really what we want . - sb
m_preserves . push ( true ) ; m_ispreserve = true ; |
public class AbstractEDBService { /** * Updates all deleted objects with the timestamp , mark them as deleted and persist them through the entity manager . */
private void updateDeletedObjectsThroughEntityManager ( List < String > oids , Long timestamp ) { } } | for ( String id : oids ) { EDBObject o = new EDBObject ( id ) ; o . updateTimestamp ( timestamp ) ; o . setDeleted ( true ) ; JPAObject j = EDBUtils . convertEDBObjectToJPAObject ( o ) ; entityManager . persist ( j ) ; } |
public class Exceptions { /** * Throws a NullPointerException if the arg argument is null . Throws an IllegalArgumentException if the Collections arg
* argument has a size of zero .
* @ param < T > The type of elements in the provided collection .
* @ param < V > The actual type of the collection .
* @ param arg The argument to check .
* @ param argName The name of the argument ( to be included in the exception message ) .
* @ return The arg .
* @ throws NullPointerException If arg is null .
* @ throws IllegalArgumentException If arg is not null , but has a length of zero . */
public static < T , V extends Collection < T > > V checkNotNullOrEmpty ( V arg , String argName ) throws NullPointerException , IllegalArgumentException { } } | Preconditions . checkNotNull ( arg , argName ) ; checkArgument ( ! arg . isEmpty ( ) , argName , "Cannot be an empty collection." ) ; return arg ; |
public class HandlerHolder { /** * Get the < code > Filter < / code > representing the target handler ' s filter
* specification .
* @ return the compiled < code > Filter < / code > instance or < code > null < / code > if
* no filter specification was declared
* @ throws InvalidSyntaxException
* if the filter specification syntax is not valid */
Filter getFilter ( ) throws InvalidSyntaxException { } } | if ( filter == null && filterSpec != null ) { filter = eventEngine . getBundleContext ( ) . createFilter ( filterSpec ) ; } return filter ; |
public class DatabaseDAODefaultImpl { /** * / * ( non - Javadoc )
* @ see fr . esrf . TangoApi . IDatabaseDAO # get _ class _ for _ device ( java . lang . String ) */
public String get_class_for_device ( Database database , String deviceName ) throws DevFailed { } } | if ( ! database . isAccess_checked ( ) ) checkAccess ( database ) ; DeviceData argIn = new DeviceData ( ) ; argIn . insert ( deviceName ) ; DeviceData argOut = command_inout ( database , "DbGetClassForDevice" , argIn ) ; return argOut . extractString ( ) ; |
public class ZipFileContainerFactory { /** * Attempt to create a root - of - roots zip file type container .
* Anser null if the container data is not a file or is not a valid
* zip file .
* @ return A new root - of - roots zip file type container . */
@ Override public ArtifactContainer createContainer ( File cacheDir , Object containerData ) { } } | if ( ! ( containerData instanceof File ) ) { return null ; } File fileContainerData = ( File ) containerData ; if ( ! FileUtils . fileIsFile ( fileContainerData ) ) { return null ; } if ( ! isZip ( fileContainerData ) ) { return null ; } return new ZipFileContainer ( cacheDir , fileContainerData , this ) ; |
public class AbstractForm { /** * Converts a basic value to the given basic type ( numeric and simple types ) , if possible . If conversion is not possible , an exception will be thrown .
* @ param value Input value
* @ param type Target type
* @ return Converted value */
protected static Object convertBasicValue ( String value , Class < ? > type ) { } } | if ( type == null ) { throw new IllegalArgumentException ( "Type cannot be null" ) ; } if ( String . class . equals ( type ) ) { return value ; } if ( value == null || value . trim ( ) . isEmpty ( ) ) { return null ; } try { value = value . trim ( ) ; if ( Byte . class . equals ( type ) ) { return Byte . parseByte ( value ) ; } else if ( Short . class . equals ( type ) ) { return Short . parseShort ( value ) ; } else if ( Integer . class . equals ( type ) ) { return Integer . parseInt ( value ) ; } else if ( Long . class . equals ( type ) ) { return Long . parseLong ( value ) ; } else if ( BigInteger . class . equals ( type ) ) { return new BigInteger ( value ) ; } else if ( Float . class . equals ( type ) ) { return Float . parseFloat ( value ) ; } else if ( Double . class . equals ( type ) ) { return Double . parseDouble ( value ) ; } else if ( BigDecimal . class . equals ( type ) ) { return new BigDecimal ( value ) ; } else if ( Boolean . class . equals ( type ) ) { return Boolean . parseBoolean ( value ) ; } } catch ( Exception e ) { throw new UniformException ( String . format ( "Error while converting value %s to data type %s. Make sure the element has correct values and/or validators" , value , type . getName ( ) ) , e ) ; } throw new UnsupportedOperationException ( "Could not convert value to unknown type: " + type . getName ( ) ) ; |
public class AmazonEC2Client { /** * Unassigns one or more IPv6 addresses from a network interface .
* @ param unassignIpv6AddressesRequest
* @ return Result of the UnassignIpv6Addresses operation returned by the service .
* @ sample AmazonEC2 . UnassignIpv6Addresses
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ec2-2016-11-15 / UnassignIpv6Addresses " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public UnassignIpv6AddressesResult unassignIpv6Addresses ( UnassignIpv6AddressesRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeUnassignIpv6Addresses ( request ) ; |
public class GeneralStorable { /** * Returns the value belonging to the given field as byte
* @ param index
* the index of the requested field
* @ return the requested value
* @ throws IOException */
public byte getValueAsByte ( int index ) throws IOException { } } | if ( index >= structure . valueSizes . size ( ) ) { throw new IOException ( "Index " + index + " is out of range." ) ; } return value [ index ] ; |
public class Cappuccino { /** * Convenience method for { @ link Espresso # registerIdlingResources ( android . support . test . espresso . IdlingResource . . . )
* Espresso # registerIdlingResources ( IdlingResource . . . ) } , which first instantiates an { @ link CappuccinoIdlingResource } ,
* then registers it with { @ code Espresso } .
* @ param name The name from which to generate an { @ code CappuccinoIdlingResource } .
* @ throws CappuccinoException if there is no { @ code CappuccinoResourceWatcher } associated
* with the given { @ param name } . */
public static void registerIdlingResource ( @ NonNull String name ) { } } | throwIfAbsent ( name ) ; CappuccinoIdlingResource idlingResource = new CappuccinoIdlingResource ( name ) ; mIdlingResourceRegistry . put ( name , idlingResource ) ; Espresso . registerIdlingResources ( idlingResource ) ; |
public class BitStrings { /** * 将一个字符串 , 按照boolString的形式进行变化 . 如果boolString [ i ] ! = 0则保留str [ i ] , 否则置0
* @ param str a { @ link java . lang . String } object .
* @ param boolString a { @ link java . lang . String } object .
* @ return a { @ link java . lang . String } object . */
public static String andWith ( final String str , final String boolString ) { } } | if ( Strings . isEmpty ( str ) ) { return null ; } if ( Strings . isEmpty ( boolString ) ) { return str ; } if ( str . length ( ) < boolString . length ( ) ) { return str ; } final StringBuilder buffer = new StringBuilder ( str ) ; for ( int i = 0 ; i < buffer . length ( ) ; i ++ ) { if ( boolString . charAt ( i ) == '0' ) { buffer . setCharAt ( i , '0' ) ; } } return buffer . toString ( ) ; |
public class SSOCookieHelperImpl { /** * Remove a cookie from the response
* @ param subject
* @ param resp */
@ Override public void removeSSOCookieFromResponse ( HttpServletResponse resp ) { } } | if ( resp instanceof com . ibm . wsspi . webcontainer . servlet . IExtendedResponse ) { ( ( com . ibm . wsspi . webcontainer . servlet . IExtendedResponse ) resp ) . removeCookie ( getSSOCookiename ( ) ) ; removeJwtSSOCookies ( ( com . ibm . wsspi . webcontainer . servlet . IExtendedResponse ) resp ) ; } |
public class MathExpr { /** * Convenient method , which lets you apply the program function without
* explicitly create a wrapper array .
* < pre > { @ code
* final double result = MathExpr . parse ( " 2 * z + 3 * x - y " ) . eval ( 3 , 2 , 1 ) ;
* assert result = = 9.0;
* } < / pre >
* @ see # apply ( Double [ ] )
* @ see # eval ( String , double . . . )
* @ param args the function arguments
* @ return the evaluated value
* @ throws NullPointerException if the given variable array is { @ code null }
* @ throws IllegalArgumentException if the length of the arguments array
* is smaller than the program arity */
public double eval ( final double ... args ) { } } | final double val = apply ( DoubleStream . of ( args ) . boxed ( ) . toArray ( Double [ ] :: new ) ) ; return val == - 0.0 ? 0.0 : val ; |
public class Segment { /** * 将一条路径转为最终结果
* @ param vertexList
* @ param offsetEnabled 是否计算offset
* @ return */
protected static List < Term > convert ( List < Vertex > vertexList , boolean offsetEnabled ) { } } | assert vertexList != null ; assert vertexList . size ( ) >= 2 : "这条路径不应当短于2" + vertexList . toString ( ) ; int length = vertexList . size ( ) - 2 ; List < Term > resultList = new ArrayList < Term > ( length ) ; Iterator < Vertex > iterator = vertexList . iterator ( ) ; iterator . next ( ) ; if ( offsetEnabled ) { int offset = 0 ; for ( int i = 0 ; i < length ; ++ i ) { Vertex vertex = iterator . next ( ) ; Term term = convert ( vertex ) ; term . offset = offset ; offset += term . length ( ) ; resultList . add ( term ) ; } } else { for ( int i = 0 ; i < length ; ++ i ) { Vertex vertex = iterator . next ( ) ; Term term = convert ( vertex ) ; resultList . add ( term ) ; } } return resultList ; |
public class File { /** * Copy a file or directory from src to dst
* @ param src File or directory to copy
* @ param dst Destination path
* @ param recurse Recurse flag
* @ param removeExisting If true , all files in the target directory are removed ,
* and then the files are copied from the source
* @ return The { @ link LocalCall } object to make the call */
public static LocalCall < Boolean > copy ( String src , String dst , boolean recurse , boolean removeExisting ) { } } | Map < String , Object > args = new LinkedHashMap < > ( ) ; args . put ( "src" , src ) ; args . put ( "dst" , dst ) ; args . put ( "recurse" , recurse ) ; args . put ( "remove_existing" , removeExisting ) ; return new LocalCall < > ( "file.copy" , Optional . empty ( ) , Optional . of ( args ) , new TypeToken < Boolean > ( ) { } ) ; |
public class Titan0Element { /** * ( non - Javadoc )
* @ see
* org . apache . atlas . repository . graphdb . AtlasElement # setListProperty ( java .
* lang . String , java . util . List ) */
@ Override public void setListProperty ( String propertyName , List < String > values ) { } } | setProperty ( propertyName , values ) ; |
public class ListFindingsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListFindingsRequest listFindingsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( listFindingsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listFindingsRequest . getAssessmentRunArns ( ) , ASSESSMENTRUNARNS_BINDING ) ; protocolMarshaller . marshall ( listFindingsRequest . getFilter ( ) , FILTER_BINDING ) ; protocolMarshaller . marshall ( listFindingsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( listFindingsRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class Traverson { /** * Follow the { @ link Link } s of the current resource , selected by its link - relation type and returns a { @ link Stream }
* containing the returned { @ link HalRepresentation HalRepresentations } .
* The EmbeddedTypeInfo is used to define the specific type of embedded items .
* Templated links are expanded to URIs using the specified template variables .
* If the current node has { @ link Embedded embedded } items with the specified { @ code rel } ,
* these items are used instead of resolving the associated { @ link Link } .
* @ param type the specific type of the returned HalRepresentations
* @ param embeddedTypeInfo specification of the type of embedded items
* @ param moreEmbeddedTypeInfos more embedded type - infos
* @ param < T > type of the returned HalRepresentations
* @ return this
* @ throws IOException if a low - level I / O problem ( unexpected end - of - input , network error ) occurs .
* @ throws JsonParseException if the json document can not be parsed by Jackson ' s ObjectMapper
* @ throws JsonMappingException if the input JSON structure can not be mapped to the specified HalRepresentation type
* @ since 1.0.0 */
@ SuppressWarnings ( "unchecked" ) public < T extends HalRepresentation > Stream < T > streamAs ( final Class < T > type , final EmbeddedTypeInfo embeddedTypeInfo , final EmbeddedTypeInfo ... moreEmbeddedTypeInfos ) throws IOException { } } | if ( moreEmbeddedTypeInfos == null || moreEmbeddedTypeInfos . length == 0 ) { return streamAs ( type , embeddedTypeInfo != null ? singletonList ( embeddedTypeInfo ) : emptyList ( ) ) ; } else { final List < EmbeddedTypeInfo > typeInfos = new ArrayList < > ( ) ; typeInfos . add ( requireNonNull ( embeddedTypeInfo ) ) ; typeInfos . addAll ( asList ( moreEmbeddedTypeInfos ) ) ; return streamAs ( type , typeInfos ) ; } |
public class LssClient { /** * Get your live preset by live preset name .
* @ param name Live preset name .
* @ return Your live preset */
public GetPresetResponse getPreset ( String name ) { } } | GetPresetRequest request = new GetPresetRequest ( ) ; request . setName ( name ) ; return getPreset ( request ) ; |
public class TioWebsocketMsgHandler { /** * handshake
* @ param httpRequest tio - http - request
* @ param httpResponse tio - http - response
* @ param channelContext context
* @ return tio - http - response
* @ throws Exception e */
@ Override public HttpResponse handshake ( HttpRequest httpRequest , HttpResponse httpResponse , ChannelContext channelContext ) throws Exception { } } | String clientip = httpRequest . getClientIp ( ) ; log . debugf ( "receive {}'s websocket handshake packet \r\n{}" , clientip , httpRequest . toString ( ) ) ; TioWebsocketMethodMapper handshake = methods . getHandshake ( ) ; if ( handshake != null ) { handshake . getMethod ( ) . invoke ( handshake . getInstance ( ) , httpRequest , httpResponse , channelContext ) ; } return httpResponse ; |
public class POJODefinition { /** * / * Public API */
public static POJODefinition find ( Class < ? > forType ) { } } | try { return _find ( forType ) ; } catch ( Exception e ) { throw new IllegalArgumentException ( String . format ( "Failed to introspect ClassDefinition for type '%s': %s" , forType . getName ( ) , e . getMessage ( ) ) , e ) ; } |
public class UpdateFolderRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UpdateFolderRequest updateFolderRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( updateFolderRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateFolderRequest . getAuthenticationToken ( ) , AUTHENTICATIONTOKEN_BINDING ) ; protocolMarshaller . marshall ( updateFolderRequest . getFolderId ( ) , FOLDERID_BINDING ) ; protocolMarshaller . marshall ( updateFolderRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( updateFolderRequest . getParentFolderId ( ) , PARENTFOLDERID_BINDING ) ; protocolMarshaller . marshall ( updateFolderRequest . getResourceState ( ) , RESOURCESTATE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class RslNode { /** * Returns the relation associated with the given attribute .
* @ param attribute the attribute of the relation .
* @ return the relation for the attribute . Null , if not found . */
public NameOpValue getParam ( String attribute ) { } } | if ( _relations == null || attribute == null ) return null ; return ( NameOpValue ) _relations . get ( canonicalize ( attribute ) ) ; |
public class StorageResourceId { /** * Parses { @ link StorageResourceId } from specified string and generationId . */
public static StorageResourceId fromObjectName ( String objectName , long generationId ) { } } | Matcher matcher = OBJECT_NAME_IN_GCS_PATTERN . matcher ( objectName ) ; checkArgument ( matcher . matches ( ) , "'%s' is not a valid GCS object name." , objectName ) ; String bucketName = matcher . group ( 2 ) ; String relativePath = matcher . group ( 4 ) ; if ( bucketName == null ) { checkArgument ( generationId == UNKNOWN_GENERATION_ID , "Cannot specify generationId '%s' for root object '%s'" , generationId , objectName ) ; return ROOT ; } else if ( relativePath != null ) { return new StorageResourceId ( bucketName , relativePath , generationId ) ; } checkArgument ( generationId == UNKNOWN_GENERATION_ID , "Cannot specify generationId '%s' for bucket '%s'" , generationId , objectName ) ; return new StorageResourceId ( bucketName ) ; |
public class Ensure { /** * Checks if the given String is null or contains only whitespaces .
* The String is trimmed before the empty check .
* @ param argument the String to check for null or emptiness
* @ param argumentName the name of the argument to check .
* This is used in the exception message .
* @ return the String that was given as argument
* @ throws IllegalArgumentException in case argument is null or empty */
public static String notNullOrEmpty ( String argument , String argumentName ) { } } | if ( argument == null || argument . trim ( ) . isEmpty ( ) ) { throw new IllegalArgumentException ( "Argument " + argumentName + " must not be null or empty." ) ; } return argument ; |
public class Bean { /** * Resolves current class field dependencies for the specified reference .
* @ param reference the specified reference */
private void resolveCurrentclassFieldDependencies ( final Object reference ) { } } | for ( final FieldInjectionPoint injectionPoint : fieldInjectionPoints ) { final Object injection = beanManager . getInjectableReference ( injectionPoint ) ; final Field field = injectionPoint . getAnnotated ( ) . getJavaMember ( ) ; try { final Field declaredField = proxyClass . getDeclaredField ( field . getName ( ) ) ; if ( declaredField . isAnnotationPresent ( Inject . class ) ) { try { declaredField . set ( reference , injection ) ; } catch ( final Exception e ) { throw new RuntimeException ( e ) ; } } } catch ( final NoSuchFieldException ex ) { try { field . set ( reference , injection ) ; } catch ( final Exception e ) { throw new RuntimeException ( e ) ; } } } |
public class ExtendedRelationsDao { /** * Get the relations to the related table
* @ param relatedTable
* related table
* @ return extended relations
* @ throws SQLException
* upon failure */
public List < ExtendedRelation > getRelatedTableRelations ( String relatedTable ) throws SQLException { } } | return queryForEq ( ExtendedRelation . COLUMN_RELATED_TABLE_NAME , relatedTable ) ; |
public class GraphicsWidget { /** * Apply a new < code > GraphicsController < / code > on the graphics . When an old controller is to be removed for this new
* controller , its < code > onDeactivate < / code > method will be called . For the new controller , its
* < code > onActivate < / code > method will be called .
* @ param graphicsController
* The new < code > GraphicsController < / code > to be applied on the graphics . */
public void setController ( GraphicsController graphicsController ) { } } | for ( HandlerRegistration registration : handlers ) { registration . removeHandler ( ) ; } if ( controller != null ) { controller . onDeactivate ( ) ; controller = null ; } handlers = new ArrayList < HandlerRegistration > ( ) ; if ( null == graphicsController ) { graphicsController = fallbackController ; } if ( graphicsController != null ) { handlers . add ( eventWidget . addMouseDownHandler ( graphicsController ) ) ; handlers . add ( eventWidget . addMouseMoveHandler ( graphicsController ) ) ; handlers . add ( eventWidget . addMouseOutHandler ( graphicsController ) ) ; handlers . add ( eventWidget . addMouseOverHandler ( graphicsController ) ) ; handlers . add ( eventWidget . addMouseUpHandler ( graphicsController ) ) ; handlers . add ( eventWidget . addMouseWheelHandler ( graphicsController ) ) ; handlers . add ( eventWidget . addDoubleClickHandler ( graphicsController ) ) ; controller = graphicsController ; controller . onActivate ( ) ; } |
public class EurekaClinicalClient { /** * Tests array membership .
* @ param arr the array .
* @ param member an object .
* @ return < code > true < / code > if the provided object is a member of the
* provided array , or < code > false < / code > if not . */
private static boolean contains ( Object [ ] arr , Object member ) { } } | for ( Object mem : arr ) { if ( Objects . equals ( mem , member ) ) { return true ; } } return false ; |
public class ThriftSubSliceCounterQuery { /** * Set the supercolumn to run the slice query on */
@ Override public SubSliceCounterQuery < K , SN , N > setSuperColumn ( SN superColumn ) { } } | this . superColumn = superColumn ; return this ; |
public class SipDigestAuthenticationMechanism { /** * Return the MessageDigest object to be used for calculating session identifiers . If none has been created yet , initialize
* one the first time this method is called . */
protected synchronized MessageDigest getDigest ( ) { } } | if ( this . digest == null ) { try { this . digest = MessageDigest . getInstance ( algorithm ) ; } catch ( NoSuchAlgorithmException e ) { try { this . digest = MessageDigest . getInstance ( DEFAULT_ALGORITHM ) ; } catch ( NoSuchAlgorithmException f ) { this . digest = null ; } } } return ( this . digest ) ; |
public class InternalSARLLexer { /** * $ ANTLR start " T _ _ 50" */
public final void mT__50 ( ) throws RecognitionException { } } | try { int _type = T__50 ; int _channel = DEFAULT_TOKEN_CHANNEL ; // InternalSARL . g : 36:7 : ( ' var ' )
// InternalSARL . g : 36:9 : ' var '
{ match ( "var" ) ; } state . type = _type ; state . channel = _channel ; } finally { } |
public class DeviceAttributeDAODefaultImpl { public void setAttributeValue ( final AttributeValue attributeValue ) { } } | deviceAttribute_3 = new DeviceAttribute_3 ( attributeValue ) ; use_union = false ; attributeValue_5 . name = attributeValue . name ; attributeValue_5 . quality = attributeValue . quality ; attributeValue_5 . data_format = AttrDataFormat . FMT_UNKNOWN ; attributeValue_5 . time = attributeValue . time ; attributeValue_5 . r_dim = new AttributeDim ( ) ; attributeValue_5 . w_dim = new AttributeDim ( ) ; attributeValue_5 . r_dim . dim_x = attributeValue . dim_x ; attributeValue_5 . r_dim . dim_y = attributeValue . dim_y ; attributeValue_5 . w_dim . dim_x = 0 ; attributeValue_5 . w_dim . dim_y = 0 ; attributeValue_5 . err_list = null ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.