signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class EmvParser { /** * Method used to extract commons card data
* @ param pGpo
* global processing options response
* @ return true if the extraction succeed
* @ throws CommunicationException communication error */
protected boolean extractCommonsCardData ( final byte [ ] pGpo ) throws CommunicationException { } } | boolean ret = false ; // Extract data from Message Template 1
byte data [ ] = TlvUtil . getValue ( pGpo , EmvTags . RESPONSE_MESSAGE_TEMPLATE_1 ) ; if ( data != null ) { data = ArrayUtils . subarray ( data , 2 , data . length ) ; } else { // Extract AFL data from Message template 2
ret = extractTrackData ( template . get ( ) . getCard ( ) , pGpo ) ; if ( ! ret ) { data = TlvUtil . getValue ( pGpo , EmvTags . APPLICATION_FILE_LOCATOR ) ; } else { extractCardHolderName ( pGpo ) ; } } if ( data != null ) { // Extract Afl
List < Afl > listAfl = extractAfl ( data ) ; // for each AFL
for ( Afl afl : listAfl ) { // check all records
for ( int index = afl . getFirstRecord ( ) ; index <= afl . getLastRecord ( ) ; index ++ ) { byte [ ] info = template . get ( ) . getProvider ( ) . transceive ( new CommandApdu ( CommandEnum . READ_RECORD , index , afl . getSfi ( ) << 3 | 4 , 0 ) . toBytes ( ) ) ; // Extract card data
if ( ResponseUtils . isSucceed ( info ) ) { extractCardHolderName ( info ) ; if ( extractTrackData ( template . get ( ) . getCard ( ) , info ) ) { return true ; } } } } } return ret ; |
public class Collector { /** * value of diff = 0 indicates current day */
private static boolean isFileModifiedInCollectionPeriod ( File file ) { } } | long diff = m_currentTimeMillis - file . lastModified ( ) ; if ( diff >= 0 ) { return TimeUnit . MILLISECONDS . toDays ( diff ) + 1 <= m_config . days ; } return false ; |
public class filterpolicy { /** * Use this API to fetch filterpolicy resource of given name . */
public static filterpolicy get ( nitro_service service , String name ) throws Exception { } } | filterpolicy obj = new filterpolicy ( ) ; obj . set_name ( name ) ; filterpolicy response = ( filterpolicy ) obj . get_resource ( service ) ; return response ; |
public class FlexFlowReader { /** * Make the request to the Twilio API to perform the read .
* @ param client TwilioRestClient with which to make the request
* @ return FlexFlow ResourceSet */
@ Override @ SuppressWarnings ( "checkstyle:linelength" ) public Page < FlexFlow > firstPage ( final TwilioRestClient client ) { } } | Request request = new Request ( HttpMethod . GET , Domains . FLEXAPI . toString ( ) , "/v1/FlexFlows" , client . getRegion ( ) ) ; addQueryParams ( request ) ; return pageForRequest ( client , request ) ; |
public class InstructionView { /** * Looks to see if we have a new step .
* @ param routeProgress provides updated step information
* @ return true if new step , false if not */
private boolean newStep ( RouteProgress routeProgress ) { } } | boolean newStep = currentStep == null || ! currentStep . equals ( routeProgress . currentLegProgress ( ) . currentStep ( ) ) ; currentStep = routeProgress . currentLegProgress ( ) . currentStep ( ) ; return newStep ; |
public class JsonReader { /** * Read the Json from the passed String using a character stream . An
* eventually contained < code > @ charset < / code > rule is ignored .
* @ param sJson
* The source string containing the Json to be parsed . May not be
* < code > null < / code > .
* @ return < code > null < / code > if reading failed , the Json declarations
* otherwise . */
@ Nullable public static IJson readFromString ( @ Nonnull final String sJson ) { } } | return readFromReader ( new NonBlockingStringReader ( sJson ) , ( IJsonParseExceptionCallback ) null ) ; |
public class MathService { private static boolean touchesLineString ( Geometry lineString , Coordinate coordinate ) { } } | // Basic argument checking :
if ( lineString . getCoordinates ( ) == null || lineString . getCoordinates ( ) . length == 0 ) { return false ; } // First loop over the vertices ( end - points ) . This will be the most common case :
for ( int i = 0 ; i < lineString . getCoordinates ( ) . length ; i ++ ) { if ( lineString . getCoordinates ( ) [ i ] . equals ( coordinate ) ) { return true ; } } // Now loop over the edges :
for ( int i = 1 ; i < lineString . getCoordinates ( ) . length ; i ++ ) { double distance = distance ( lineString . getCoordinates ( ) [ i - 1 ] , lineString . getCoordinates ( ) [ i ] , coordinate ) ; if ( distance < PARAM_DEFAULT_DELTA ) { return true ; } } // No touchy !
return false ; |
public class LTriConsumerBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */
@ Nonnull public static < T1 , T2 , T3 > LTriConsumer < T1 , T2 , T3 > triConsumerFrom ( Consumer < LTriConsumerBuilder < T1 , T2 , T3 > > buildingFunction ) { } } | LTriConsumerBuilder builder = new LTriConsumerBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ; |
public class PersonGroupPersonsImpl { /** * Retrieve a person ' s information , including registered persisted faces , name and userData .
* @ param personGroupId Id referencing a particular person group .
* @ param personId Id referencing a particular person .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < Person > getAsync ( String personGroupId , UUID personId , final ServiceCallback < Person > serviceCallback ) { } } | return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( personGroupId , personId ) , serviceCallback ) ; |
public class ScriptUtil { /** * Creates a new { @ link ExecutableScript } from a static source .
* @ param language the language of the script
* @ param source the source code of the script
* @ param scriptFactory the script factory used to create the script
* @ return the newly created script
* @ throws NotValidException if language is null or empty or source is null */
public static ExecutableScript getScriptFromSource ( String language , String source , ScriptFactory scriptFactory ) { } } | ensureNotEmpty ( NotValidException . class , "Script language" , language ) ; ensureNotNull ( NotValidException . class , "Script source" , source ) ; return scriptFactory . createScriptFromSource ( language , source ) ; |
public class FormalParameterBuilderImpl { /** * Initialize the formal parameter .
* @ param context the context of the formal parameter .
* @ param name the name of the formal parameter . */
public void eInit ( XtendExecutable context , String name , IJvmTypeProvider typeContext ) { } } | setTypeResolutionContext ( typeContext ) ; this . context = context ; this . parameter = SarlFactory . eINSTANCE . createSarlFormalParameter ( ) ; this . parameter . setName ( name ) ; this . parameter . setParameterType ( newTypeRef ( this . context , Object . class . getName ( ) ) ) ; this . context . getParameters ( ) . add ( this . parameter ) ; |
public class VarTupleSet { /** * Returns input tuples that bind the given variable . */
private Iterator < Tuple > getBinds ( Iterator < Tuple > tuples , final VarDef var ) { } } | return IteratorUtils . filteredIterator ( tuples , tuple -> tuple . getBinding ( var ) != null ) ; |
public class TBMImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case AfplibPackage . TBM__DIRCTION : setDIRCTION ( ( Integer ) newValue ) ; return ; case AfplibPackage . TBM__PRECSION : setPRECSION ( ( Integer ) newValue ) ; return ; case AfplibPackage . TBM__INCRMENT : setINCRMENT ( ( Integer ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class DBSnapshotAttributesResult { /** * The list of attributes and values for the manual DB snapshot .
* @ return The list of attributes and values for the manual DB snapshot . */
public java . util . List < DBSnapshotAttribute > getDBSnapshotAttributes ( ) { } } | if ( dBSnapshotAttributes == null ) { dBSnapshotAttributes = new com . amazonaws . internal . SdkInternalList < DBSnapshotAttribute > ( ) ; } return dBSnapshotAttributes ; |
public class DefaultClient { /** * { @ inheritDoc } */
@ Override public RequestBuilder newRequestBuilder ( ) { } } | RequestBuilder b = new DefaultRequestBuilder ( ) ; return b . resolver ( FunctionResolver . DEFAULT ) ; |
public class Diagnostics { /** * Collects system information as delivered from the { @ link MemoryMXBean } .
* @ param infos a map where the infos are passed in . */
public static void memInfo ( final Map < String , Object > infos ) { } } | infos . put ( "heap.used" , MEM_BEAN . getHeapMemoryUsage ( ) ) ; infos . put ( "offHeap.used" , MEM_BEAN . getNonHeapMemoryUsage ( ) ) ; infos . put ( "heap.pendingFinalize" , MEM_BEAN . getObjectPendingFinalizationCount ( ) ) ; |
public class Distance { /** * Gets the Chessboard distance between two points .
* @ param x A point in space .
* @ param y A point in space .
* @ return The Chessboard distance between x and y . */
public static double Chessboard ( double [ ] x , double [ ] y ) { } } | double d = 0 ; for ( int i = 0 ; i < x . length ; i ++ ) { d = Math . max ( d , x [ i ] - y [ i ] ) ; } return d ; |
public class AbstractState { /** * Logs a request . */
protected final < R extends Request > R logRequest ( R request ) { } } | LOGGER . trace ( "{} - Received {}" , context . getCluster ( ) . member ( ) . address ( ) , request ) ; return request ; |
public class DefaultRetryPolicy { /** * { @ inheritDoc }
* < p > This implementation retries on the next node if the connection was closed , and rethrows
* ( assuming a driver bug ) in all other cases . */
@ Override public RetryDecision onRequestAborted ( @ NonNull Request request , @ NonNull Throwable error , int retryCount ) { } } | RetryDecision decision = ( error instanceof ClosedConnectionException || error instanceof HeartbeatException ) ? RetryDecision . RETRY_NEXT : RetryDecision . RETHROW ; if ( decision == RetryDecision . RETRY_NEXT && LOG . isTraceEnabled ( ) ) { LOG . trace ( RETRYING_ON_ABORTED , logPrefix , retryCount , error ) ; } return decision ; |
public class LocalDeviceManagementUsb { /** * Gets property value elements of an interface object property .
* @ param objectType the interface object type
* @ param objectInstance the interface object instance ( usually 1)
* @ param propertyId the property identifier ( PID )
* @ param start start index in the property value to start writing to
* @ param elements number of elements to set
* @ return byte array containing the property element data
* @ throws KNXTimeoutException on timeout setting the property elements
* @ throws KNXRemoteException on remote error or invalid response
* @ throws KNXPortClosedException if adapter is closed
* @ throws InterruptedException on interrupt */
public byte [ ] getProperty ( final int objectType , final int objectInstance , final int propertyId , final int start , final int elements ) throws KNXTimeoutException , KNXRemoteException , KNXPortClosedException , InterruptedException { } } | final CEMIDevMgmt req = new CEMIDevMgmt ( CEMIDevMgmt . MC_PROPREAD_REQ , objectType , objectInstance , propertyId , start , elements ) ; send ( req , null ) ; return findFrame ( CEMIDevMgmt . MC_PROPREAD_CON , req ) ; |
public class AddressClient { /** * Creates an address resource in the specified project using the data included in the request .
* < p > Sample code :
* < pre > < code >
* try ( AddressClient addressClient = AddressClient . create ( ) ) {
* ProjectRegionName region = ProjectRegionName . of ( " [ PROJECT ] " , " [ REGION ] " ) ;
* Address addressResource = Address . newBuilder ( ) . build ( ) ;
* Operation response = addressClient . insertAddress ( region . toString ( ) , addressResource ) ;
* < / code > < / pre >
* @ param region Name of the region for this request .
* @ param addressResource A reserved address resource . ( = = resource _ for beta . addresses = = ) ( = =
* resource _ for v1 . addresses = = ) ( = = resource _ for beta . globalAddresses = = ) ( = = resource _ for
* v1 . globalAddresses = = )
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
@ BetaApi public final Operation insertAddress ( String region , Address addressResource ) { } } | InsertAddressHttpRequest request = InsertAddressHttpRequest . newBuilder ( ) . setRegion ( region ) . setAddressResource ( addressResource ) . build ( ) ; return insertAddress ( request ) ; |
public class QueryAtomContainer { /** * Returns the minimum bond order that this atom currently has in the context
* of this AtomContainer .
* @ param atom The atom
* @ return The minimum bond order that this atom currently has */
@ Override public Order getMinimumBondOrder ( IAtom atom ) { } } | IBond . Order min = IBond . Order . QUADRUPLE ; for ( int i = 0 ; i < bondCount ; i ++ ) { if ( bonds [ i ] . contains ( atom ) && bonds [ i ] . getOrder ( ) . ordinal ( ) < min . ordinal ( ) ) { min = bonds [ i ] . getOrder ( ) ; } } return min ; |
public class AbstractMavenScroogeMojo { /** * Executes the mojo . */
public void execute ( ) throws MojoExecutionException , MojoFailureException { } } | try { Set < File > thriftFiles = findThriftFiles ( ) ; final File outputDirectory = getOutputDirectory ( ) ; ImmutableSet < File > outputFiles = findGeneratedFilesInDirectory ( getOutputDirectory ( ) ) ; Set < String > compileRoots = new HashSet < String > ( ) ; compileRoots . add ( "scrooge" ) ; if ( thriftFiles . isEmpty ( ) ) { getLog ( ) . info ( "No thrift files to compile." ) ; } else if ( checkStaleness && ( ( lastModified ( thriftFiles ) + staleMillis ) < lastModified ( outputFiles ) ) ) { getLog ( ) . info ( "Generated thrift files up to date, skipping compile." ) ; attachFiles ( compileRoots ) ; } else { outputDirectory . mkdirs ( ) ; // Quick fix to fix issues with two mvn installs in a row ( ie no clean )
cleanDirectory ( outputDirectory ) ; getLog ( ) . info ( format ( "compiling thrift files %s with Scrooge" , thriftFiles ) ) ; synchronized ( lock ) { ScroogeRunner runner = new ScroogeRunner ( ) ; Map < String , String > thriftNamespaceMap = new HashMap < String , String > ( ) ; for ( ThriftNamespaceMapping mapping : thriftNamespaceMappings ) { thriftNamespaceMap . put ( mapping . getFrom ( ) , mapping . getTo ( ) ) ; } // Include thrifts from resource as well .
Set < File > includes = thriftIncludes ; includes . add ( getResourcesOutputDirectory ( ) ) ; // Include thrift root
final File thriftSourceRoot = getThriftSourceRoot ( ) ; if ( thriftSourceRoot != null && thriftSourceRoot . exists ( ) ) { includes . add ( thriftSourceRoot ) ; } runner . compile ( getLog ( ) , includeOutputDirectoryNamespace ? new File ( outputDirectory , "scrooge" ) : outputDirectory , thriftFiles , includes , thriftNamespaceMap , language , thriftOpts ) ; } attachFiles ( compileRoots ) ; } } catch ( IOException e ) { throw new MojoExecutionException ( "An IO error occurred" , e ) ; } |
public class APIClient { /** * This method allows to query multiple indexes with one API call */
public JSONObject multipleQueries ( List < IndexQuery > queries ) throws AlgoliaException { } } | return multipleQueries ( queries , "none" , RequestOptions . empty ) ; |
public class PolymorphicMapSchema { /** * Return true to */
private static Object fillSingletonMapFrom ( Input input , Schema < ? > schema , Object owner , IdStrategy strategy , boolean graph , Object map ) throws IOException { } } | switch ( input . readFieldNumber ( schema ) ) { case 0 : // both are null
return map ; case 1 : { // key exists
break ; } case 3 : { // key is null
final Wrapper wrapper = new Wrapper ( ) ; Object v = input . mergeObject ( wrapper , strategy . OBJECT_SCHEMA ) ; if ( ! graph || ! ( ( GraphInput ) input ) . isCurrentMessageReference ( ) ) v = wrapper . value ; try { fSingletonMap_v . set ( map , v ) ; } catch ( IllegalArgumentException e ) { throw new RuntimeException ( e ) ; } catch ( IllegalAccessException e ) { throw new RuntimeException ( e ) ; } if ( 0 != input . readFieldNumber ( schema ) ) throw new ProtostuffException ( "Corrupt input." ) ; return map ; } default : throw new ProtostuffException ( "Corrupt input." ) ; } final Wrapper wrapper = new Wrapper ( ) ; Object k = input . mergeObject ( wrapper , strategy . OBJECT_SCHEMA ) ; if ( ! graph || ! ( ( GraphInput ) input ) . isCurrentMessageReference ( ) ) k = wrapper . value ; switch ( input . readFieldNumber ( schema ) ) { case 0 : // key exists but null value
try { fSingletonMap_k . set ( map , k ) ; } catch ( IllegalArgumentException e ) { throw new RuntimeException ( e ) ; } catch ( IllegalAccessException e ) { throw new RuntimeException ( e ) ; } return map ; case 3 : // key and value exist
break ; default : throw new ProtostuffException ( "Corrupt input." ) ; } Object v = input . mergeObject ( wrapper , strategy . OBJECT_SCHEMA ) ; if ( ! graph || ! ( ( GraphInput ) input ) . isCurrentMessageReference ( ) ) v = wrapper . value ; try { fSingletonMap_k . set ( map , k ) ; fSingletonMap_v . set ( map , v ) ; } catch ( IllegalArgumentException e ) { throw new RuntimeException ( e ) ; } catch ( IllegalAccessException e ) { throw new RuntimeException ( e ) ; } if ( 0 != input . readFieldNumber ( schema ) ) throw new ProtostuffException ( "Corrupt input." ) ; return map ; |
public class YarnRegistryViewForProviders { /** * Add a service under a path for the current user
* @ param serviceClass service class to use under ~ user
* @ param serviceName name of the service
* @ param record service record
* @ param deleteTreeFirst perform recursive delete of the path first
* @ return the path the service was created at
* @ throws IOException */
public String putService ( String serviceClass , String serviceName , ServiceRecord record , boolean deleteTreeFirst ) throws IOException { } } | return putService ( user , serviceClass , serviceName , record , deleteTreeFirst ) ; |
public class NarUtil { /** * NOT USED ?
* public static String getAOLKey ( String architecture , String os , Linker
* linker )
* throws MojoFailureException , MojoExecutionException
* / / construct AOL key prefix
* return getArchitecture ( architecture ) + " . " + getOS ( os ) + " . " +
* getLinkerName ( architecture , os , linker ) */
public static AOL getAOL ( final MavenProject project , final String architecture , final String os , final Linker linker , final String aol , final Log log ) throws MojoFailureException , MojoExecutionException { } } | /* To support a linker that is not the default linker specified in the aol . properties */
String aol_linker ; if ( linker != null & linker . getName ( ) != null ) { log . debug ( "linker original name: " + linker . getName ( ) ) ; aol_linker = linker . getName ( ) ; } else { log . debug ( "linker original name not exist " ) ; aol_linker = getLinkerName ( project , architecture , os , linker , log ) ; } log . debug ( "aol_linker: " + aol_linker ) ; return aol == null ? new AOL ( getArchitecture ( architecture ) , getOS ( os ) , aol_linker ) : new AOL ( aol ) ; |
public class SeaGlassLookAndFeel { /** * Use Aqua settings for some properties if we ' re on a Mac .
* @ param d the UI defaults map . */
private void defineAquaSettings ( UIDefaults d ) { } } | try { // Instantiate Aqua but don ' t install it .
Class < ? > lnfClass = Class . forName ( UIManager . getSystemLookAndFeelClassName ( ) , true , Thread . currentThread ( ) . getContextClassLoader ( ) ) ; LookAndFeel aqua = ( LookAndFeel ) lnfClass . newInstance ( ) ; UIDefaults aquaDefaults = aqua . getDefaults ( ) ; // Use Aqua for any menu UI classes .
d . put ( "MenuBarUI" , aquaDefaults . get ( "MenuBarUI" ) ) ; d . put ( "MenuUI" , aquaDefaults . get ( "MenuUI" ) ) ; } catch ( Exception e ) { // TODO Should we do something with this exception ?
e . printStackTrace ( ) ; } |
public class ToXMLStream { /** * Receive notification of a processing instruction .
* @ param target The processing instruction target .
* @ param data The processing instruction data , or null if
* none was supplied .
* @ throws org . xml . sax . SAXException Any SAX exception , possibly
* wrapping another exception .
* @ throws org . xml . sax . SAXException */
public void processingInstruction ( String target , String data ) throws org . xml . sax . SAXException { } } | if ( m_inEntityRef ) return ; flushPending ( ) ; if ( target . equals ( Result . PI_DISABLE_OUTPUT_ESCAPING ) ) { startNonEscaping ( ) ; } else if ( target . equals ( Result . PI_ENABLE_OUTPUT_ESCAPING ) ) { endNonEscaping ( ) ; } else { try { if ( m_elemContext . m_startTagOpen ) { closeStartTag ( ) ; m_elemContext . m_startTagOpen = false ; } else if ( m_needToCallStartDocument ) startDocumentInternal ( ) ; if ( shouldIndent ( ) ) indent ( ) ; final java . io . Writer writer = m_writer ; writer . write ( "<?" ) ; writer . write ( target ) ; if ( data . length ( ) > 0 && ! Character . isSpaceChar ( data . charAt ( 0 ) ) ) writer . write ( ' ' ) ; int indexOfQLT = data . indexOf ( "?>" ) ; if ( indexOfQLT >= 0 ) { // See XSLT spec on error recovery of " ? > " in PIs .
if ( indexOfQLT > 0 ) { writer . write ( data . substring ( 0 , indexOfQLT ) ) ; } writer . write ( "? >" ) ; // add space between .
if ( ( indexOfQLT + 2 ) < data . length ( ) ) { writer . write ( data . substring ( indexOfQLT + 2 ) ) ; } } else { writer . write ( data ) ; } writer . write ( '?' ) ; writer . write ( '>' ) ; /* * Don ' t write out any indentation whitespace now ,
* because there may be non - whitespace text after this .
* Simply mark that at this point if we do decide
* to indent that we should
* add a newline on the end of the current line before
* the indentation at the start of the next line . */
m_startNewLine = true ; } catch ( IOException e ) { throw new SAXException ( e ) ; } } if ( m_tracer != null ) super . fireEscapingEvent ( target , data ) ; |
public class AbstrCFMLExprTransformer { /** * Transfomiert die mathematischen Operatoren Plus und Minus ( 1 , - ) . < br / >
* EBNF : < br / >
* < code > modOp [ ( " - " | " + " ) spaces plusMinusOp ] ; < / code >
* @ return CFXD Element
* @ throws TemplateException */
private Expression plusMinusOp ( Data data ) throws TemplateException { } } | Expression expr = modOp ( data ) ; while ( ! data . srcCode . isLast ( ) ) { // Plus Operation
if ( data . srcCode . forwardIfCurrent ( '+' ) ) expr = _plusMinusOp ( data , expr , Factory . OP_DBL_PLUS ) ; // Minus Operation
else if ( data . srcCode . forwardIfCurrent ( '-' ) ) expr = _plusMinusOp ( data , expr , Factory . OP_DBL_MINUS ) ; else break ; } return expr ; |
public class Ingest { /** * Ingest from directory */
public static void multiFromDirectory ( File dir , String ingestFormat , FedoraAPIAMTOM targetRepoAPIA , FedoraAPIMMTOM targetRepoAPIM , String logMessage , PrintStream log , IngestCounter c ) throws Exception { } } | File [ ] files = dir . listFiles ( ) ; if ( files == null ) { throw new RuntimeException ( "Could not read files from directory " + dir . getPath ( ) ) ; } Arrays . sort ( files , _FILE_COMPARATOR ) ; for ( File element : files ) { if ( ! element . isHidden ( ) && ! element . getName ( ) . startsWith ( "." ) ) { if ( element . isDirectory ( ) ) { multiFromDirectory ( element , ingestFormat , targetRepoAPIA , targetRepoAPIM , logMessage , log , c ) ; } else { try { String pid = oneFromFile ( element , ingestFormat , targetRepoAPIA , targetRepoAPIM , logMessage ) ; c . successes ++ ; IngestLogger . logFromFile ( log , element , pid ) ; } catch ( Exception e ) { // failed . . . just log it and continue
c . failures ++ ; IngestLogger . logFailedFromFile ( log , element , e ) ; } } } } |
public class OwnerAndPermission { /** * Read a { @ link org . apache . gobblin . data . management . copy . OwnerAndPermission } from a { @ link java . io . DataInput } .
* @ throws IOException */
public static OwnerAndPermission read ( DataInput input ) throws IOException { } } | OwnerAndPermission oap = new OwnerAndPermission ( ) ; oap . readFields ( input ) ; return oap ; |
public class PopupMenuUtils { /** * Removes all separators from the given pop up menu .
* @ param popupMenu the pop up menu whose separators will be removed
* @ see javax . swing . JPopupMenu . Separator */
public static void removeAllSeparators ( JPopupMenu popupMenu ) { } } | for ( int i = 0 ; i < popupMenu . getComponentCount ( ) ; i ++ ) { if ( isPopupMenuSeparator ( popupMenu . getComponent ( i ) ) ) { popupMenu . remove ( i ) ; i -- ; } } |
public class FlowLoaderUtils { /** * Check job properties .
* @ param projectId the project id
* @ param props the server props
* @ param jobPropsMap the job props map
* @ param errors the errors */
public static void checkJobProperties ( final int projectId , final Props props , final Map < String , Props > jobPropsMap , final Set < String > errors ) { } } | // if project is in the memory check whitelist , then we don ' t need to check
// its memory settings
if ( ProjectWhitelist . isProjectWhitelisted ( projectId , ProjectWhitelist . WhitelistType . MemoryCheck ) ) { return ; } final MemConfValue maxXms = MemConfValue . parseMaxXms ( props ) ; final MemConfValue maxXmx = MemConfValue . parseMaxXmx ( props ) ; for ( final String jobName : jobPropsMap . keySet ( ) ) { final Props jobProps = jobPropsMap . get ( jobName ) ; final String xms = jobProps . getString ( XMS , null ) ; if ( xms != null && ! PropsUtils . isVariableReplacementPattern ( xms ) && Utils . parseMemString ( xms ) > maxXms . getSize ( ) ) { errors . add ( String . format ( "%s: Xms value has exceeded the allowed limit (max Xms = %s)" , jobName , maxXms . getString ( ) ) ) ; } final String xmx = jobProps . getString ( XMX , null ) ; if ( xmx != null && ! PropsUtils . isVariableReplacementPattern ( xmx ) && Utils . parseMemString ( xmx ) > maxXmx . getSize ( ) ) { errors . add ( String . format ( "%s: Xmx value has exceeded the allowed limit (max Xmx = %s)" , jobName , maxXmx . getString ( ) ) ) ; } // job callback properties check
JobCallbackValidator . validate ( jobName , props , jobProps , errors ) ; } |
public class ApplicationContextProvider { /** * Register bean into application context .
* @ param < T > the type parameter
* @ param applicationContext the application context
* @ param beanClazz the bean clazz
* @ param beanId the bean id
* @ return the type registered */
public static < T > T registerBeanIntoApplicationContext ( final ConfigurableApplicationContext applicationContext , final Class < T > beanClazz , final String beanId ) { } } | val beanFactory = applicationContext . getBeanFactory ( ) ; val provider = beanFactory . createBean ( beanClazz ) ; beanFactory . initializeBean ( provider , beanId ) ; beanFactory . autowireBean ( provider ) ; beanFactory . registerSingleton ( beanId , provider ) ; return provider ; |
public class ConfigurationProperties { /** * The response cache header settings for the given contentType .
* @ param contentType the content type in the format ' type . [ cache | nocache ] ' , e . g . ' page . nocache ' .
* @ return the parameter value if set , or null if not set . */
public static String getResponseCacheHeaderSettings ( final String contentType ) { } } | String parameter = MessageFormat . format ( RESPONSE_CACHE_HEADER_SETTINGS , contentType ) ; return get ( ) . getString ( parameter ) ; |
public class FxFlowableTransformers { /** * Performs the provided onTerminate action on the FX thread
* @ param onDipsose
* @ param < T > */
public static < T > FlowableTransformer < T , T > doOnCancelFx ( Action onDipsose ) { } } | return obs -> obs . doOnCancel ( ( ) -> runOnFx ( onDipsose ) ) ; |
public class ConnectionInputMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ConnectionInput connectionInput , ProtocolMarshaller protocolMarshaller ) { } } | if ( connectionInput == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( connectionInput . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( connectionInput . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( connectionInput . getConnectionType ( ) , CONNECTIONTYPE_BINDING ) ; protocolMarshaller . marshall ( connectionInput . getMatchCriteria ( ) , MATCHCRITERIA_BINDING ) ; protocolMarshaller . marshall ( connectionInput . getConnectionProperties ( ) , CONNECTIONPROPERTIES_BINDING ) ; protocolMarshaller . marshall ( connectionInput . getPhysicalConnectionRequirements ( ) , PHYSICALCONNECTIONREQUIREMENTS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class HttpUtil { /** * Note : The value annotation is set to the setter of httpTimeout here as
* we can ' t autowire any value to its static field ( but the field has to be
* static itself ) .
* @ param httpTimeout the httpTimeout to set */
@ Value ( "${http.timeout}" ) @ SuppressWarnings ( "static-method" ) public void setDefaultHttpTimeout ( int httpTimeout ) { } } | HttpUtil . defaultHttpTimeout = httpTimeout ; HttpUtil . httpTimeout = httpTimeout ; |
public class PngImage { private static void readSignature ( DataInputStream ins ) throws PngException , IOException { } } | long signature = ins . readLong ( ) ; if ( signature != PngImage . SIGNATURE ) { throw new PngException ( "Bad png signature" ) ; } |
public class TransformerImpl { /** * Execute each of the children of a template element .
* @ param elem The ElemTemplateElement that contains the children
* that should execute .
* @ param handler The ContentHandler to where the result events
* should be fed .
* @ throws TransformerException
* @ xsl . usage advanced */
public void executeChildTemplates ( ElemTemplateElement elem , ContentHandler handler ) throws TransformerException { } } | SerializationHandler xoh = this . getSerializationHandler ( ) ; // These may well not be the same ! In this case when calling
// the Redirect extension , it has already set the ContentHandler
// in the Transformer .
SerializationHandler savedHandler = xoh ; try { xoh . flushPending ( ) ; // % REVIEW % Make sure current node is being pushed .
LexicalHandler lex = null ; if ( handler instanceof LexicalHandler ) { lex = ( LexicalHandler ) handler ; } m_serializationHandler = new ToXMLSAXHandler ( handler , lex , savedHandler . getEncoding ( ) ) ; m_serializationHandler . setTransformer ( this ) ; executeChildTemplates ( elem , true ) ; } catch ( TransformerException e ) { throw e ; } catch ( SAXException se ) { throw new TransformerException ( se ) ; } finally { m_serializationHandler = savedHandler ; } |
public class PropertiesConfiguration { /** * Setup the auth mode using the properties file .
* If the " apikey " key is present and not empty it will be used , otherwise the fallback
* to user / pass mode is triggered . Please note that { @ link PropertiesConfiguration } is NOT smart ,
* it will not try to fetch apiKey when configuring the app from a properties file and finding only user / pass data ! */
private void setupAuthMode ( ) { } } | String apiKey = getStringProperty ( P_APIKEY ) ; if ( Strings . isNullOrEmpty ( apiKey ) ) { // try to use the user / pass mode instead
forceUserPassAuthMode ( getStringProperty ( P_USERNAME ) , getStringProperty ( P_PASSWORD ) ) ; } else { // ok the key is present , let ' s use it
forceKeyAuthMode ( apiKey ) ; } |
public class AbstractTemplateResolver { /** * Computes whether a template can be resolved by this resolver or not ,
* applying the corresponding patterns . Meant only for use or override by subclasses .
* @ param configuration the engine configuration .
* @ param ownerTemplate the owner template , if the resource being computed is a fragment . Might be null .
* @ param template the template to be resolved ( usually its name ) .
* @ param templateResolutionAttributes the template resolution attributes , if any . Might be null .
* @ return whether the template is resolvable or not . */
protected boolean computeResolvable ( final IEngineConfiguration configuration , final String ownerTemplate , final String template , final Map < String , Object > templateResolutionAttributes ) { } } | if ( this . resolvablePatternSpec . isEmpty ( ) ) { return true ; } return this . resolvablePatternSpec . matches ( template ) ; |
public class AsyncBenchmark { /** * Core benchmark code .
* Connect . Initialize . Run the loop . Cleanup . Print Results .
* @ throws Exception if anything unexpected happens . */
public void runBenchmark ( ) throws Exception { } } | System . out . print ( HORIZONTAL_RULE ) ; System . out . println ( " Setup & Initialization" ) ; System . out . println ( HORIZONTAL_RULE ) ; // connect to one or more servers , loop until success
connect ( config . servers ) ; // preload keys if requested
System . out . println ( ) ; if ( config . preload ) { System . out . println ( "Preloading data store..." ) ; for ( int i = 0 ; i < config . poolsize ; i ++ ) { String keyStr = String . format ( processor . KeyFormat , i ) ; byte [ ] valArr = processor . generateForStore ( ) . getStoreValue ( ) ; if ( config . multisingleratio != 0.00 ) { client . callProcedure ( new NullCallback ( ) , "STORER.upsert" , keyStr , valArr ) ; } client . callProcedure ( new NullCallback ( ) , "STORE.upsert" , keyStr , valArr ) ; } client . drain ( ) ; System . out . println ( "Preloading complete.\n" ) ; } System . out . print ( HORIZONTAL_RULE ) ; System . out . println ( " Starting Benchmark" ) ; System . out . println ( HORIZONTAL_RULE ) ; // Run the benchmark loop for the requested warmup time
// The throughput may be throttled depending on client configuration
System . out . println ( "Warming up..." ) ; final long warmupEndTime = System . currentTimeMillis ( ) + ( 1000l * config . warmup ) ; while ( warmupEndTime > System . currentTimeMillis ( ) ) { // Decide whether to perform a GET or PUT operation
if ( rand . nextDouble ( ) < config . getputratio ) { // Get a key / value pair using inbuilt select procedure , asynchronously
if ( rand . nextDouble ( ) < config . multisingleratio ) { client . callProcedure ( new NullCallback ( ) , "selectR" , processor . generateRandomKeyForRetrieval ( ) ) ; } else { client . callProcedure ( new NullCallback ( ) , "STORE.select" , processor . generateRandomKeyForRetrieval ( ) ) ; } } else { String table = rand . nextDouble ( ) < config . multisingleratio ? "STORER" : "STORE" ; // Put a key / value pair using inbuilt upsert procedure , asynchronously
final PayloadProcessor . Pair pair = processor . generateForStore ( ) ; client . callProcedure ( new NullCallback ( ) , table + ".upsert" , pair . Key , pair . getStoreValue ( ) ) ; } } // reset the stats after warmup
fullStatsContext . fetchAndResetBaseline ( ) ; periodicStatsContext . fetchAndResetBaseline ( ) ; // print periodic statistics to the console
benchmarkStartTS = System . currentTimeMillis ( ) ; schedulePeriodicStats ( ) ; // Run the benchmark loop for the requested duration
// The throughput may be throttled depending on client configuration
System . out . println ( "\nRunning benchmark..." ) ; final long benchmarkEndTime = System . currentTimeMillis ( ) + ( 1000l * config . duration ) ; while ( benchmarkEndTime > System . currentTimeMillis ( ) ) { // Decide whether to perform a GET or PUT operation
if ( rand . nextDouble ( ) < config . getputratio ) { // Get a key / value pair using inbuilt select procedure , asynchronously
if ( rand . nextDouble ( ) < config . multisingleratio ) { client . callProcedure ( new GetCallback ( ) , "selectR" , processor . generateRandomKeyForRetrieval ( ) ) ; } else { client . callProcedure ( new GetCallback ( ) , "STORE.select" , processor . generateRandomKeyForRetrieval ( ) ) ; } } else { String table = rand . nextDouble ( ) < config . multisingleratio ? "STORER" : "STORE" ; // Put a key / value pair using inbuilt upsert procedure , asynchronously
final PayloadProcessor . Pair pair = processor . generateForStore ( ) ; client . callProcedure ( new PutCallback ( pair ) , table + ".upsert" , pair . Key , pair . getStoreValue ( ) ) ; } } // cancel periodic stats printing
timer . cancel ( ) ; // block until all outstanding txns return
client . drain ( ) ; // print the summary results
printResults ( ) ; // close down the client connections
client . close ( ) ; |
public class StorageAccountsInner { /** * Regenerates one of the access keys for the specified storage account .
* @ param resourceGroupName The name of the resource group within the user ' s subscription . The name is case insensitive .
* @ param accountName The name of the storage account within the specified resource group . Storage account names must be between 3 and 24 characters in length and use numbers and lower - case letters only .
* @ param keyName The name of storage keys that want to be regenerated , possible vaules are key1 , key2.
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the StorageAccountListKeysResultInner object */
public Observable < StorageAccountListKeysResultInner > regenerateKeyAsync ( String resourceGroupName , String accountName , String keyName ) { } } | return regenerateKeyWithServiceResponseAsync ( resourceGroupName , accountName , keyName ) . map ( new Func1 < ServiceResponse < StorageAccountListKeysResultInner > , StorageAccountListKeysResultInner > ( ) { @ Override public StorageAccountListKeysResultInner call ( ServiceResponse < StorageAccountListKeysResultInner > response ) { return response . body ( ) ; } } ) ; |
public class SVGSimpleLinearAxis { /** * Plot an axis with appropriate scales
* @ param plot Plot object
* @ param parent Containing element
* @ param scale axis scale information
* @ param x1 starting coordinate
* @ param y1 starting coordinate
* @ param x2 ending coordinate
* @ param y2 ending coordinate
* @ param labelstyle Style for placing the labels
* @ param style Style library
* @ throws CSSNamingConflict when a conflict occurs in CSS */
public static void drawAxis ( SVGPlot plot , Element parent , LinearScale scale , double x1 , double y1 , double x2 , double y2 , LabelStyle labelstyle , StyleLibrary style ) throws CSSNamingConflict { } } | assert ( parent != null ) ; Element line = plot . svgLine ( x1 , y1 , x2 , y2 ) ; SVGUtil . setCSSClass ( line , CSS_AXIS ) ; parent . appendChild ( line ) ; final double tx = x2 - x1 ; final double ty = y2 - y1 ; // ticks are orthogonal
final double tw = ty * 0.01 ; final double th = - tx * 0.01 ; // choose where to print labels .
final boolean labels , ticks ; switch ( labelstyle ) { case LEFTHAND : case RIGHTHAND : labels = true ; ticks = true ; break ; case NOLABELS : labels = false ; ticks = true ; break ; case ENDLABEL : // end labels are handle specially
case NOTHING : default : labels = false ; ticks = false ; } Alignment pos = Alignment . LL ; if ( labels ) { double angle = FastMath . atan2 ( ty , tx ) ; // System . err . println ( tx + " " + ( - ty ) + " " + angle ) ;
if ( angle > 2.6 ) { // pi . . 2.6 = 180 . . 150
pos = labelstyle == LabelStyle . RIGHTHAND ? Alignment . RC : Alignment . LC ; } else if ( angle > 0.5 ) { // 2.3 . . 0.7 = 130 . . 40
pos = labelstyle == LabelStyle . RIGHTHAND ? Alignment . RR : Alignment . LL ; } else if ( angle > - 0.5 ) { // 0.5 . . - 0.5 = 30 . . - 30
pos = labelstyle == LabelStyle . RIGHTHAND ? Alignment . RC : Alignment . LC ; } else if ( angle > - 2.6 ) { // -0.5 . . - 2.6 = - 30 . . - 150
pos = labelstyle == LabelStyle . RIGHTHAND ? Alignment . RL : Alignment . LR ; } else { // -2.6 . . - pi = - 150 . . - 180
pos = labelstyle == LabelStyle . RIGHTHAND ? Alignment . RC : Alignment . LC ; } } // vertical text offset ; align approximately with middle instead of
// baseline .
double textvoff = style . getTextSize ( StyleLibrary . AXIS_LABEL ) * .35 ; // draw ticks on x axis
if ( ticks || labels ) { int sw = 1 ; { // Compute how many ticks to draw
int numticks = ( int ) ( ( scale . getMax ( ) - scale . getMin ( ) ) / scale . getRes ( ) ) ; double tlen = FastMath . sqrt ( tx * tx + ty * ty ) ; double minl = 10 * style . getLineWidth ( StyleLibrary . AXIS_TICK ) ; // Try proper divisors first .
if ( sw * tlen / numticks < minl ) { for ( int i = 2 ; i <= ( numticks >> 1 ) ; i ++ ) { if ( numticks % i == 0 && i * tlen / numticks >= minl ) { sw = i ; break ; } } } // Otherwise , also allow non - divisors .
if ( sw * tlen / numticks < minl ) { sw = ( int ) Math . floor ( minl * numticks / tlen ) ; } } for ( double tick = scale . getMin ( ) ; tick <= scale . getMax ( ) + scale . getRes ( ) / 10 ; tick += sw * scale . getRes ( ) ) { double x = x1 + tx * scale . getScaled ( tick ) ; double y = y1 + ty * scale . getScaled ( tick ) ; if ( ticks ) { // This is correct . Vectors : ( vec - tvec ) to ( vec + tvec )
Element tickline = plot . svgLine ( x - tw , y - th , x + tw , y + th ) ; SVGUtil . setAtt ( tickline , SVGConstants . SVG_CLASS_ATTRIBUTE , CSS_AXIS_TICK ) ; parent . appendChild ( tickline ) ; } // draw labels
if ( labels ) { double tex = x ; double tey = y ; switch ( pos ) { case LL : case LC : case LR : tex = x + tw * 2.5 ; tey = y + th * 2.5 + textvoff ; break ; case RL : case RC : case RR : tex = x - tw * 2.5 ; tey = y - th * 2.5 + textvoff ; } Element text = plot . svgText ( tex , tey , scale . formatValue ( tick ) ) ; text . setAttribute ( SVGConstants . SVG_CLASS_ATTRIBUTE , CSS_AXIS_LABEL ) ; switch ( pos ) { case LL : case RL : text . setAttribute ( SVGConstants . SVG_TEXT_ANCHOR_ATTRIBUTE , SVGConstants . SVG_START_VALUE ) ; break ; case LC : case RC : text . setAttribute ( SVGConstants . SVG_TEXT_ANCHOR_ATTRIBUTE , SVGConstants . SVG_MIDDLE_VALUE ) ; break ; case LR : case RR : text . setAttribute ( SVGConstants . SVG_TEXT_ANCHOR_ATTRIBUTE , SVGConstants . SVG_END_VALUE ) ; break ; } parent . appendChild ( text ) ; } } } if ( labelstyle == LabelStyle . ENDLABEL ) { { Element text = plot . svgText ( x1 - tx * 0.02 , y1 - ty * 0.02 + textvoff , scale . formatValue ( scale . getMin ( ) ) ) ; text . setAttribute ( SVGConstants . SVG_CLASS_ATTRIBUTE , CSS_AXIS_LABEL ) ; text . setAttribute ( SVGConstants . SVG_TEXT_ANCHOR_ATTRIBUTE , SVGConstants . SVG_MIDDLE_VALUE ) ; parent . appendChild ( text ) ; } { Element text = plot . svgText ( x2 + tx * 0.02 , y2 + ty * 0.02 + textvoff , scale . formatValue ( scale . getMax ( ) ) ) ; text . setAttribute ( SVGConstants . SVG_CLASS_ATTRIBUTE , CSS_AXIS_LABEL ) ; text . setAttribute ( SVGConstants . SVG_TEXT_ANCHOR_ATTRIBUTE , SVGConstants . SVG_MIDDLE_VALUE ) ; parent . appendChild ( text ) ; } } setupCSSClasses ( plot , plot . getCSSClassManager ( ) , style ) ; |
public class CmsJspContentAccessValueWrapper { /** * Factory method to create a new XML content value wrapper . < p >
* In case either parameter is < code > null < / code > , the { @ link # NULL _ VALUE _ WRAPPER } is returned . < p >
* @ param cms the current users OpenCms context
* @ param value the value to warp
* @ param content the content document , required to set the null value info
* @ param valueName the value path name
* @ param locale the selected locale
* @ return a new content value wrapper instance , or < code > null < / code > if any parameter is < code > null < / code > */
public static CmsJspContentAccessValueWrapper createWrapper ( CmsObject cms , I_CmsXmlContentValue value , I_CmsXmlDocument content , String valueName , Locale locale ) { } } | if ( ( value != null ) && ( cms != null ) ) { return new CmsJspContentAccessValueWrapper ( cms , value ) ; } if ( ( content != null ) && ( valueName != null ) && ( locale != null ) && ( cms != null ) ) { CmsJspContentAccessValueWrapper wrapper = new CmsJspContentAccessValueWrapper ( ) ; wrapper . m_nullValueInfo = new NullValueInfo ( content , valueName , locale ) ; wrapper . m_cms = cms ; return wrapper ; } // if no value is available ,
return NULL_VALUE_WRAPPER ; |
public class JmxBuilderModelMBean { /** * Sets up event listeners for this MBean as described in the descriptor .
* The descriptor contains a map with layout
* { item - & gt ; Map [ event : " . . . " , from : ObjectName , callback : & amp ; Closure ] , . . . , }
* @ param server the MBeanServer is to be registered .
* @ param descriptor a map containing info about the event */
public void addEventListeners ( MBeanServer server , Map < String , Map < String , Object > > descriptor ) { } } | for ( Map . Entry < String , Map < String , Object > > item : descriptor . entrySet ( ) ) { Map < String , Object > listener = item . getValue ( ) ; // register with server
ObjectName broadcaster = ( ObjectName ) listener . get ( "from" ) ; try { String eventType = ( String ) listener . get ( "event" ) ; if ( eventType != null ) { NotificationFilterSupport filter = new NotificationFilterSupport ( ) ; filter . enableType ( eventType ) ; server . addNotificationListener ( broadcaster , JmxEventListener . getListener ( ) , filter , listener ) ; } else { server . addNotificationListener ( broadcaster , JmxEventListener . getListener ( ) , null , listener ) ; } } catch ( InstanceNotFoundException e ) { throw new JmxBuilderException ( e ) ; } } |
public class Log { /** * Shuts down this Logger and all its LogTargets
* < p > The LogFactory will no longer return this Logger for its id */
public void shutdown ( ) { } } | if ( this . isShutdown ) { return ; } this . isShutdown = true ; for ( LogTarget target : this . targets ) { target . shutdown ( ) ; } this . factory . remove ( this ) ; |
public class ClassWriter { /** * Write Java - language annotations ; return number of JVM
* attributes written ( zero or one ) . */
int writeJavaAnnotations ( List < Attribute . Compound > attrs ) { } } | if ( attrs . isEmpty ( ) ) return 0 ; ListBuffer < Attribute . Compound > visibles = new ListBuffer < Attribute . Compound > ( ) ; ListBuffer < Attribute . Compound > invisibles = new ListBuffer < Attribute . Compound > ( ) ; for ( Attribute . Compound a : attrs ) { switch ( types . getRetention ( a ) ) { case SOURCE : break ; case CLASS : invisibles . append ( a ) ; break ; case RUNTIME : visibles . append ( a ) ; break ; default : ; // / * fail soft * / throw new AssertionError ( vis ) ;
} } int attrCount = 0 ; if ( visibles . length ( ) != 0 ) { int attrIndex = writeAttr ( names . RuntimeVisibleAnnotations ) ; databuf . appendChar ( visibles . length ( ) ) ; for ( Attribute . Compound a : visibles ) writeCompoundAttribute ( a ) ; endAttr ( attrIndex ) ; attrCount ++ ; } if ( invisibles . length ( ) != 0 ) { int attrIndex = writeAttr ( names . RuntimeInvisibleAnnotations ) ; databuf . appendChar ( invisibles . length ( ) ) ; for ( Attribute . Compound a : invisibles ) writeCompoundAttribute ( a ) ; endAttr ( attrIndex ) ; attrCount ++ ; } return attrCount ; |
public class FormatStep { /** * < p > Erzeugt eine Textausgabe und speichert sie im angegebenen Puffer . < / p >
* @ param formattable object to be formatted
* @ param buffer format buffer any text output will be sent to
* @ param attributes non - sectional control attributes
* @ param positions positions of elements in text ( optional )
* @ param quickPath hint for using quick path
* @ return count of printed characters or { @ code Integer . MAX _ VALUE } if unknown or { @ code - 1 } if not successful
* @ throws IllegalArgumentException if the object is not formattable
* @ throws ChronoException if the object does not contain the element in question
* @ throws IOException if writing into buffer fails
* @ since 3.15/4.12 */
int print ( ChronoDisplay formattable , Appendable buffer , AttributeQuery attributes , Set < ElementPosition > positions , boolean quickPath ) throws IOException { } } | if ( ! this . isPrinting ( formattable ) ) { return 0 ; } AttributeQuery aq = ( quickPath ? this . fullAttrs : this . getQuery ( attributes ) ) ; if ( ( this . padLeft == 0 ) && ( this . padRight == 0 ) ) { return this . processor . print ( formattable , buffer , aq , positions , quickPath ) ; } StringBuilder collector ; int start = - 1 ; int offset = - 1 ; Set < ElementPosition > posBuf = null ; if ( buffer instanceof StringBuilder ) { collector = ( StringBuilder ) buffer ; start = collector . length ( ) ; } else { collector = new StringBuilder ( ) ; } if ( ( buffer instanceof CharSequence ) && ( positions != null ) ) { offset = ( ( ( collector == buffer ) && ( ( this . processor instanceof CustomizedProcessor ) || ( this . processor instanceof StyleProcessor ) ) ) ? 0 : ( ( CharSequence ) buffer ) . length ( ) ) ; posBuf = new LinkedHashSet < > ( ) ; } boolean strict = this . isStrict ( aq ) ; char padChar = this . getPadChar ( aq ) ; int len = collector . length ( ) ; this . processor . print ( formattable , collector , aq , posBuf , quickPath ) ; len = collector . length ( ) - len ; int printed = len ; if ( this . padLeft > 0 ) { if ( strict && ( len > this . padLeft ) ) { throw new IllegalArgumentException ( this . padExceeded ( ) ) ; } int leftPadding = 0 ; while ( printed < this . padLeft ) { if ( start == - 1 ) { buffer . append ( padChar ) ; } else { collector . insert ( start , padChar ) ; } printed ++ ; leftPadding ++ ; } if ( start == - 1 ) { buffer . append ( collector ) ; } if ( offset != - 1 ) { offset += leftPadding ; for ( ElementPosition ep : posBuf ) { positions . add ( new ElementPosition ( ep . getElement ( ) , offset + ep . getStartIndex ( ) , offset + ep . getEndIndex ( ) ) ) ; } } if ( this . padRight > 0 ) { if ( strict && ( len > this . padRight ) ) { throw new IllegalArgumentException ( this . padExceeded ( ) ) ; } while ( len < this . padRight ) { buffer . append ( padChar ) ; len ++ ; printed ++ ; } } } else { // padRight > 0
if ( strict && ( len > this . padRight ) ) { throw new IllegalArgumentException ( this . padExceeded ( ) ) ; } if ( start == - 1 ) { buffer . append ( collector ) ; } while ( printed < this . padRight ) { buffer . append ( padChar ) ; printed ++ ; } if ( offset != - 1 ) { for ( ElementPosition ep : posBuf ) { positions . add ( new ElementPosition ( ep . getElement ( ) , offset + ep . getStartIndex ( ) , offset + ep . getEndIndex ( ) ) ) ; } } } return printed ; |
public class CardinalityLeafSpec { /** * This should only be used by composite specs with an ' @ ' child
* @ return null if no work was done , otherwise returns the re - parented data */
public Object applyToParentContainer ( String inputKey , Object input , WalkedPath walkedPath , Object parentContainer ) { } } | MatchedElement thisLevel = getMatch ( inputKey , walkedPath ) ; if ( thisLevel == null ) { return null ; } return performCardinalityAdjustment ( inputKey , input , walkedPath , ( Map ) parentContainer , thisLevel ) ; |
public class Fn { /** * Split this stream by the specified duration .
* < pre >
* < code >
* Stream < Timed < MyObject > > s = . . . ;
* s . _ _ ( Fn . window ( Duration . ofMinutes ( 3 ) , ( ) - System . currentTimeMillis ( ) ) ) . . . / / Do your stuffs with Stream < Stream < Timed < T > > > ;
* < / code >
* < / pre >
* @ param duration
* @ param startTime
* @ return */
public static < T > Function < Stream < Timed < T > > , Stream < Stream < Timed < T > > > > window ( final Duration duration , final LongSupplier startTime ) { } } | return window ( duration , duration . toMillis ( ) , startTime ) ; |
public class AuditAnnotationAttributes { /** * Gets the repository .
* @ param method the method
* @ return the repository */
public String getTag ( final Method method ) { } } | final Annotation [ ] annotations = method . getAnnotations ( ) ; return this . getTag ( annotations , method ) ; |
public class AbstractWebController { /** * Build a response object that signals a not - okay response with a given status { @ code code } .
* @ param < T > Some type extending the AbstractBase entity
* @ param code The status code to set as response code
* @ param msg The error message passed to the caller
* @ param params A set of Serializable objects that are passed to the caller
* @ return A ResponseEntity with status { @ code code } */
protected < T extends AbstractBase > ResponseEntity < Response < T > > buildNOKResponse ( HttpStatus code , String msg , T ... params ) { } } | return buildResponse ( code , msg , "" , params ) ; |
public class MBeans { /** * ( non - Javadoc )
* @ see com . ibm . websphere . cache . CacheAdminMBean # getCacheIDsInPushPullTable ( java . lang . String , java . lang . String ) */
@ Override public String [ ] getCacheIDsInPushPullTable ( String cacheInstance , String pattern ) throws javax . management . AttributeNotFoundException { } } | // LI4337-17
// Get the cache for this cacheInstance
DCache cache1 = getCache ( cacheInstance ) ; // Check that the input pattern is a valid regular expression
Pattern cpattern = checkPattern ( pattern ) ; // retrieve all the cache ids from PushPullTable
List < String > matchSet = new ArrayList < String > ( 10 ) ; int count = 0 ; Object [ ] list = cache1 . getCacheIdsInPushPullTable ( ) . toArray ( ) ; for ( int i = 0 ; i < list . length ; i ++ ) { String skey = list [ i ] . toString ( ) ; boolean matches = checkMatch ( cpattern , skey ) ; if ( matches ) { matchSet . add ( skey ) ; count ++ ; // if ( tc . isDebugEnabled ( ) ) {
// Tr . debug ( tc , " getCacheIDsInPushPullTable : Cache element # " + count + " = " + skey + " matches the pattern " + pattern + " for cacheInstance = " + cacheInstance ) ;
} } if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getCacheIDsInPushPullTable" + "/" + cacheInstance + "/" + "Exiting. Number of matches found = " + count ) ; } // Allocate output String array # entries matched and return
// Convert to string array and return
String [ ] cids = matchSet . toArray ( new String [ matchSet . size ( ) ] ) ; return cids ; |
public class ApplicationContextTask { /** * Implementation . */
private synchronized ApplicationContext getApplicationContext ( URL config , boolean useCache ) { } } | if ( ! useCache || ! config . equals ( prevUrl ) ) { prevBeans = new FileSystemXmlApplicationContext ( config . toExternalForm ( ) ) ; prevUrl = config ; } return prevBeans ; |
public class SBlinkImageView { /** * Add an Icon to the Icon list .
* @ param iIndex The icon ' s index .
* @ param icon The icon at this index . */
public void addIcon ( Object icon , int iIndex ) { } } | m_rgIcons [ iIndex ] = icon ; if ( this . getScreenFieldView ( ) . getControl ( ) instanceof ExtendedComponent ) // Always
( ( ExtendedComponent ) this . getScreenFieldView ( ) . getControl ( ) ) . addIcon ( icon , iIndex ) ; |
public class SocketFactory { /** * Creates an unconnected socket .
* @ return the unconnected socket
* @ throws IOException if the socket cannot be created
* @ see java . net . Socket # connect ( java . net . SocketAddress )
* @ see java . net . Socket # connect ( java . net . SocketAddress , int )
* @ see java . net . Socket # Socket ( ) */
public Socket createSocket ( ) throws IOException { } } | // bug 6771432:
// The Exception is used by HttpsClient to signal that
// unconnected sockets have not been implemented .
UnsupportedOperationException uop = new UnsupportedOperationException ( ) ; SocketException se = new SocketException ( "Unconnected sockets not implemented" ) ; se . initCause ( uop ) ; throw se ; |
public class AtomicDoubleCastExtensions { /** * Convert the given value to { @ code Float } . This function is not null - safe .
* @ param number a number of { @ code AtomicDouble } type .
* @ return the equivalent value to { @ code number } of { @ code Float } type . */
@ Pure @ Inline ( value = "$2.valueOf($1.floatValue())" , imported = Float . class ) public static Float toFloat ( AtomicDouble number ) { } } | return Float . valueOf ( number . floatValue ( ) ) ; |
public class DiSH { /** * Returns a sorted list of the clusters w . r . t . the subspace dimensionality in
* descending order .
* @ param relation the database storing the objects
* @ param clustersMap the mapping of bits sets to clusters
* @ return a sorted list of the clusters */
private List < Cluster < SubspaceModel > > sortClusters ( Relation < V > relation , Object2ObjectMap < long [ ] , List < ArrayModifiableDBIDs > > clustersMap ) { } } | final int db_dim = RelationUtil . dimensionality ( relation ) ; // int num = 1;
List < Cluster < SubspaceModel > > clusters = new ArrayList < > ( ) ; for ( long [ ] pv : clustersMap . keySet ( ) ) { List < ArrayModifiableDBIDs > parallelClusters = clustersMap . get ( pv ) ; for ( int i = 0 ; i < parallelClusters . size ( ) ; i ++ ) { ArrayModifiableDBIDs c = parallelClusters . get ( i ) ; Cluster < SubspaceModel > cluster = new Cluster < > ( c ) ; cluster . setModel ( new SubspaceModel ( new Subspace ( pv ) , Centroid . make ( relation , c ) . getArrayRef ( ) ) ) ; String subspace = BitsUtil . toStringLow ( cluster . getModel ( ) . getSubspace ( ) . getDimensions ( ) , db_dim ) ; cluster . setName ( parallelClusters . size ( ) > 1 ? ( "Cluster_" + subspace + "_" + i ) : ( "Cluster_" + subspace ) ) ; clusters . add ( cluster ) ; } } // sort the clusters w . r . t . lambda
Comparator < Cluster < SubspaceModel > > comparator = new Comparator < Cluster < SubspaceModel > > ( ) { @ Override public int compare ( Cluster < SubspaceModel > c1 , Cluster < SubspaceModel > c2 ) { return c2 . getModel ( ) . getSubspace ( ) . dimensionality ( ) - c1 . getModel ( ) . getSubspace ( ) . dimensionality ( ) ; } } ; Collections . sort ( clusters , comparator ) ; return clusters ; |
public class Base64 { /** * Encodes a byte array into Base64 string .
* @ param source The data to convert
* @ param off The data offset of what to encode .
* @ param len The number of bytes to encode .
* @ return The Base64 - encoded data as a String
* @ throws NullPointerException if source array is null
* @ since 2.0 */
public static String encodeToString ( final byte [ ] source , int off , int len ) { } } | byte [ ] encoded = encode ( source , off , len ) ; return new String ( encoded , US_ASCII ) ; |
public class StringUtils { /** * 将字符串中特定模式的字符转换成map中对应的值
* use : format ( " my name is $ { name } , and i like $ { like } ! " , { " name " : " L . cm " , " like " : " Java " } )
* @ param s需要转换的字符串
* @ param map转换所需的键值对集合
* @ return { String } 转换后的字符串 */
public static String format ( String s , Map < String , String > map ) { } } | StringBuilder sb = new StringBuilder ( ( int ) ( s . length ( ) * 1.5 ) ) ; int cursor = 0 ; for ( int start , end ; ( start = s . indexOf ( "${" , cursor ) ) != - 1 && ( end = s . indexOf ( '}' , start ) ) != - 1 ; ) { sb . append ( s . substring ( cursor , start ) ) ; String key = s . substring ( start + 2 , end ) ; sb . append ( map . get ( StringUtils . trim ( key ) ) ) ; cursor = end + 1 ; } sb . append ( s . substring ( cursor , s . length ( ) ) ) ; return sb . toString ( ) ; |
public class PlayEngine { /** * Estimate client buffer fill .
* @ param now
* The current timestamp being used .
* @ return True if it appears that the client buffer is full , otherwise false . */
private boolean isClientBufferFull ( final long now ) { } } | // check client buffer length when we ' ve already sent some messages
if ( lastMessageTs > 0 ) { // duration the stream is playing / playback duration
final long delta = now - playbackStart ; // buffer size as requested by the client
final long buffer = subscriberStream . getClientBufferDuration ( ) ; // expected amount of data present in client buffer
final long buffered = lastMessageTs - delta ; log . trace ( "isClientBufferFull: timestamp {} delta {} buffered {} buffer duration {}" , new Object [ ] { lastMessageTs , delta , buffered , buffer } ) ; // fix for SN - 122 , this sends double the size of the client buffer
if ( buffer > 0 && buffered > ( buffer * 2 ) ) { // client is likely to have enough data in the buffer
return true ; } } return false ; |
public class ExpressRouteCircuitsInner { /** * Gets the currently advertised routes table summary associated with the express route circuit in a resource group .
* @ param resourceGroupName The name of the resource group .
* @ param circuitName The name of the express route circuit .
* @ param peeringName The name of the peering .
* @ param devicePath The path of the device .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the ExpressRouteCircuitsRoutesTableSummaryListResultInner object */
public Observable < ExpressRouteCircuitsRoutesTableSummaryListResultInner > beginListRoutesTableSummaryAsync ( String resourceGroupName , String circuitName , String peeringName , String devicePath ) { } } | return beginListRoutesTableSummaryWithServiceResponseAsync ( resourceGroupName , circuitName , peeringName , devicePath ) . map ( new Func1 < ServiceResponse < ExpressRouteCircuitsRoutesTableSummaryListResultInner > , ExpressRouteCircuitsRoutesTableSummaryListResultInner > ( ) { @ Override public ExpressRouteCircuitsRoutesTableSummaryListResultInner call ( ServiceResponse < ExpressRouteCircuitsRoutesTableSummaryListResultInner > response ) { return response . body ( ) ; } } ) ; |
public class Query { /** * Appends a parameter to the query
* @ param name Parameter name
* @ param value Parameter value
* @ return this
* @ throws java . io . UnsupportedEncodingException If the provided value cannot be URL Encoded */
public Query append ( final String name , final String value ) throws UnsupportedEncodingException { } } | params . add ( new Tuple < String , Tuple < String , String > > ( name , new Tuple < String , String > ( value , URLEncoder . encode ( value , "UTF-8" ) ) ) ) ; return this ; |
public class AbstractDocumentQuery { /** * Specifies a proximity distance for the phrase in the last search clause
* http : / / lucene . apache . org / java / 2_4_0 / queryparsersyntax . html # Proximity % 20Searches
* @ param proximity Proximity value */
@ Override public void _proximity ( int proximity ) { } } | List < QueryToken > tokens = getCurrentWhereTokens ( ) ; if ( tokens . isEmpty ( ) ) { throw new IllegalStateException ( "Proximity can only be used right after search clause" ) ; } QueryToken whereToken = tokens . get ( tokens . size ( ) - 1 ) ; if ( ! ( whereToken instanceof WhereToken ) ) { throw new IllegalStateException ( "Proximity can only be used right after search clause" ) ; } if ( ( ( WhereToken ) whereToken ) . getWhereOperator ( ) != WhereOperator . SEARCH ) { throw new IllegalStateException ( "Proximity can only be used right after search clause" ) ; } if ( proximity < 1 ) { throw new IllegalArgumentException ( "Proximity distance must be a positive number" ) ; } ( ( WhereToken ) whereToken ) . getOptions ( ) . setProximity ( proximity ) ; |
public class FileSystemUtil { /** * Find free space on the * nix platform using the ' df ' command .
* @ param path the path to get free space for
* @ param kb whether to normalize to kilobytes
* @ param posix whether to use the POSIX standard format flag
* @ param timeout The timeout amount in milliseconds or no timeout if the value
* is zero or less
* @ return the amount of free drive space on the volume
* @ throws IOException if an error occurs */
long freeSpaceUnix ( final String path , final boolean kb , final boolean posix , final long timeout ) throws IOException { } } | if ( path . isEmpty ( ) ) { throw new IllegalArgumentException ( "Path must not be empty" ) ; } // build and run the ' dir ' command
String flags = "-" ; if ( kb ) { flags += "k" ; } if ( posix ) { flags += "P" ; } final String [ ] cmdAttribs = flags . length ( ) > 1 ? new String [ ] { DF , flags , path } : new String [ ] { DF , path } ; // perform the command , asking for up to 3 lines ( header , interesting , overflow )
final List < String > lines = performCommand ( cmdAttribs , 3 , timeout ) ; if ( lines . size ( ) < 2 ) { // unknown problem , throw exception
throw new IOException ( "Command line '" + DF + "' did not return info as expected " + "for path '" + path + "'- response was " + lines ) ; } final String line2 = lines . get ( 1 ) ; // the line we ' re interested in
// Now , we tokenize the string . The fourth element is what we want .
StringTokenizer tok = new StringTokenizer ( line2 , " " ) ; if ( tok . countTokens ( ) < 4 ) { // could be long Filesystem , thus data on third line
if ( tok . countTokens ( ) == 1 && lines . size ( ) >= 3 ) { final String line3 = lines . get ( 2 ) ; // the line may be interested in
tok = new StringTokenizer ( line3 , " " ) ; } else { throw new IOException ( "Command line '" + DF + "' did not return data as expected " + "for path '" + path + "'- check path is valid" ) ; } } else { tok . nextToken ( ) ; // Ignore Filesystem
} tok . nextToken ( ) ; // Ignore 1K - blocks
tok . nextToken ( ) ; // Ignore Used
final String freeSpace = tok . nextToken ( ) ; return parseBytes ( freeSpace , path ) ; |
public class CmsSearchManager { /** * Initializes the available Cms resource types to be indexed . < p >
* A map stores document factories keyed by a string representing
* a colon separated list of Cms resource types and / or mimetypes . < p >
* The keys of this map are used to trigger a document factory to convert
* a Cms resource into a Lucene index document . < p >
* A document factory is a class implementing the interface
* { @ link org . opencms . search . documents . I _ CmsDocumentFactory } . < p > */
protected void initAvailableDocumentTypes ( ) { } } | CmsSearchDocumentType documenttype = null ; String className = null ; String name = null ; I_CmsDocumentFactory documentFactory = null ; List < String > resourceTypes = null ; List < String > mimeTypes = null ; Class < ? > c = null ; m_documentTypes = new HashMap < String , I_CmsDocumentFactory > ( ) ; for ( int i = 0 , n = m_documentTypeConfigs . size ( ) ; i < n ; i ++ ) { documenttype = m_documentTypeConfigs . get ( i ) ; name = documenttype . getName ( ) ; try { className = documenttype . getClassName ( ) ; resourceTypes = documenttype . getResourceTypes ( ) ; mimeTypes = documenttype . getMimeTypes ( ) ; if ( name == null ) { throw new CmsIndexException ( Messages . get ( ) . container ( Messages . ERR_DOCTYPE_NO_NAME_0 ) ) ; } if ( className == null ) { throw new CmsIndexException ( Messages . get ( ) . container ( Messages . ERR_DOCTYPE_NO_CLASS_DEF_0 ) ) ; } if ( resourceTypes . size ( ) == 0 ) { throw new CmsIndexException ( Messages . get ( ) . container ( Messages . ERR_DOCTYPE_NO_RESOURCETYPE_DEF_0 ) ) ; } try { c = Class . forName ( className ) ; documentFactory = ( I_CmsDocumentFactory ) c . getConstructor ( new Class [ ] { String . class } ) . newInstance ( new Object [ ] { name } ) ; } catch ( ClassNotFoundException exc ) { throw new CmsIndexException ( Messages . get ( ) . container ( Messages . ERR_DOCCLASS_NOT_FOUND_1 , className ) , exc ) ; } catch ( Exception exc ) { throw new CmsIndexException ( Messages . get ( ) . container ( Messages . ERR_DOCCLASS_INIT_1 , className ) , exc ) ; } if ( documentFactory . isUsingCache ( ) ) { // init cache if used by the factory
documentFactory . setCache ( m_extractionResultCache ) ; } for ( Iterator < String > key = documentFactory . getDocumentKeys ( resourceTypes , mimeTypes ) . iterator ( ) ; key . hasNext ( ) ; ) { m_documentTypes . put ( key . next ( ) , documentFactory ) ; } } catch ( CmsException e ) { if ( LOG . isWarnEnabled ( ) ) { LOG . warn ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_DOCTYPE_CONFIG_FAILED_1 , name ) , e ) ; } } } |
public class DescribeMaintenanceWindowTasksRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeMaintenanceWindowTasksRequest describeMaintenanceWindowTasksRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeMaintenanceWindowTasksRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeMaintenanceWindowTasksRequest . getWindowId ( ) , WINDOWID_BINDING ) ; protocolMarshaller . marshall ( describeMaintenanceWindowTasksRequest . getFilters ( ) , FILTERS_BINDING ) ; protocolMarshaller . marshall ( describeMaintenanceWindowTasksRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; protocolMarshaller . marshall ( describeMaintenanceWindowTasksRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class Main { /** * Print a message reporting an uncaught exception from an
* annotation processor . */
void apMessage ( AnnotationProcessingError ex ) { } } | log . printLines ( PrefixKind . JAVAC , "msg.proc.annotation.uncaught.exception" ) ; ex . getCause ( ) . printStackTrace ( log . getWriter ( WriterKind . NOTICE ) ) ; |
public class TableManager { /** * Create D4M tables .
* Five Accumulo tables support D4M . This method creates them
* using the default root ( unless the caller changes that default ) .
* Tedge , TedgeTranspose , TedgeDegree , TedgeMetadata , TedgeText */
public void createTables ( ) { } } | Validate . notNull ( connector , "connector must not be null" ) ; Validate . notNull ( tableOperations , "tableOperations must not be null" ) ; /* * This code sets the default values . If you want to change them ,
* you can over - write the metadata entries instead of changing
* the values here . */
Value defaultFieldDelimiter = new Value ( "\t" . getBytes ( charset ) ) ; Value defaultFactDelimiter = new Value ( "|" . getBytes ( charset ) ) ; int isEdgePresent = tableOperations . exists ( getEdgeTable ( ) ) ? 1 : 0 ; int isTransposePresent = tableOperations . exists ( getTransposeTable ( ) ) ? 1 : 0 ; int isDegreePresent = tableOperations . exists ( getDegreeTable ( ) ) ? 1 : 0 ; int isMetatablePresent = tableOperations . exists ( getMetadataTable ( ) ) ? 1 : 0 ; int isTextPresent = tableOperations . exists ( getTextTable ( ) ) ? 1 : 0 ; int tableCount = isEdgePresent + isTransposePresent + isDegreePresent + isMetatablePresent + isTextPresent ; if ( tableCount > 0 && tableCount < 5 ) { throw new D4MException ( "D4M: RootName[" + getRootName ( ) + "] Inconsistent state - one or more D4M tables is missing." ) ; } if ( tableCount == 5 ) { // assume the tables are correct .
return ; } try { tableOperations . create ( getEdgeTable ( ) ) ; tableOperations . create ( getTransposeTable ( ) ) ; tableOperations . create ( getDegreeTable ( ) ) ; tableOperations . create ( getMetadataTable ( ) ) ; tableOperations . create ( getTextTable ( ) ) ; IteratorSetting degreeIteratorSetting = new IteratorSetting ( 7 , SummingCombiner . class ) ; SummingCombiner . setEncodingType ( degreeIteratorSetting , LongCombiner . Type . STRING ) ; SummingCombiner . setColumns ( degreeIteratorSetting , Collections . singletonList ( new IteratorSetting . Column ( "" , "degree" ) ) ) ; tableOperations . attachIterator ( getDegreeTable ( ) , degreeIteratorSetting ) ; IteratorSetting fieldIteratorSetting = new IteratorSetting ( 7 , SummingCombiner . class ) ; SummingCombiner . setEncodingType ( fieldIteratorSetting , LongCombiner . Type . STRING ) ; SummingCombiner . setColumns ( fieldIteratorSetting , Collections . singletonList ( new IteratorSetting . Column ( "field" , "" ) ) ) ; tableOperations . attachIterator ( getMetadataTable ( ) , fieldIteratorSetting ) ; Mutation mutation = new Mutation ( PROPERTY ) ; mutation . put ( FIELD_DELIMITER_PROPERTY_NAME , EMPTY_CQ , defaultFieldDelimiter ) ; mutation . put ( FACT_DELIMITER_PROPERTY_NAME , EMPTY_CQ , defaultFactDelimiter ) ; BatchWriterConfig bwConfig = new BatchWriterConfig ( ) ; bwConfig . setMaxLatency ( 10000 , TimeUnit . MINUTES ) ; bwConfig . setMaxMemory ( 10000000 ) ; bwConfig . setMaxWriteThreads ( 5 ) ; bwConfig . setTimeout ( 5 , TimeUnit . MINUTES ) ; BatchWriter writer = connector . createBatchWriter ( getMetadataTable ( ) , bwConfig ) ; writer . addMutation ( mutation ) ; writer . close ( ) ; } catch ( AccumuloException | AccumuloSecurityException | TableExistsException | TableNotFoundException e ) { throw new D4MException ( "Error creating tables." , e ) ; } |
public class RadialMenu { /** * Renders the current configuration of this menu . */
public void render ( Graphics2D gfx ) { } } | Component host = _host . getComponent ( ) ; int x = _bounds . x , y = _bounds . y ; if ( _centerLabel != null ) { // render the centerpiece label
_centerLabel . paint ( gfx , x + _centerLabel . closedBounds . x , y + _centerLabel . closedBounds . y , this ) ; } // render each of our items in turn
int icount = _items . size ( ) ; for ( int i = 0 ; i < icount ; i ++ ) { RadialMenuItem item = _items . get ( i ) ; if ( ! item . isIncluded ( this ) ) { continue ; } // we have to wait and render the active item last
if ( item != _activeItem ) { item . render ( host , this , gfx , x + item . closedBounds . x , y + item . closedBounds . y ) ; } } if ( _activeItem != null ) { _activeItem . render ( host , this , gfx , x + _activeItem . closedBounds . x , y + _activeItem . closedBounds . y ) ; } // render our bounds
// gfx . setColor ( Color . green ) ;
// gfx . draw ( _ bounds ) ;
// gfx . setColor ( Color . blue ) ;
// gfx . draw ( _ tbounds ) ; |
public class CurrentInProgressMetadata { /** * Update the data in the ZNode to point to a the ZNode containing the
* metadata for the ledger containing the current in - progress edit log
* segment .
* @ param newPath Path to the metadata for the current ledger
* @ throws StaleVersionException If path read is out of date compared to the
* version in ZooKeeper
* @ throws IOException If there is an error talking to ZooKeeper */
public void update ( String newPath ) throws IOException { } } | String id = hostname + Thread . currentThread ( ) . getId ( ) ; CurrentInProgressMetadataWritable cip = localWritable . get ( ) ; cip . set ( id , newPath ) ; byte [ ] data = WritableUtil . writableToByteArray ( cip ) ; try { zooKeeper . setData ( fullyQualifiedZNode , data , expectedZNodeVersion . get ( ) ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Set " + fullyQualifiedZNode + " to point to " + newPath ) ; } } catch ( KeeperException . BadVersionException e ) { // Throw an exception if we try to update without having read the
// current version
LOG . error ( fullyQualifiedZNode + " has been updated by another process" , e ) ; throw new StaleVersionException ( fullyQualifiedZNode + "has been updated by another process!" ) ; } catch ( KeeperException e ) { keeperException ( "Unrecoverable ZooKeeper error updating " + fullyQualifiedZNode , e ) ; } catch ( InterruptedException e ) { interruptedException ( "Interrupted updating " + fullyQualifiedZNode , e ) ; } |
public class TextSimilarity { /** * 构造权重快速搜索容器
* @ param words 词列表
* @ return Map */
protected Map < String , Float > toFastSearchMap ( List < Word > words ) { } } | Map < String , Float > weights = new ConcurrentHashMap < > ( ) ; if ( words == null ) { return weights ; } words . parallelStream ( ) . forEach ( word -> { if ( word . getWeight ( ) != null ) { weights . put ( word . getText ( ) , word . getWeight ( ) ) ; } else { LOGGER . error ( "词没有权重信息:" + word . getText ( ) ) ; } } ) ; return weights ; |
public class CommitsApi { /** * Get a list of repository commit statuses that meet the provided filter .
* < pre > < code > GitLab Endpoint : GET / projects / : id / repository / commits / : sha / statuses < / code > < / pre >
* @ param projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance
* @ param sha the commit SHA
* @ param filter the commit statuses file , contains ref , stage , name , all
* @ param page the page to get
* @ param perPage the number of commits statuses per page
* @ return a List containing the commit statuses for the specified project and sha that meet the provided filter
* @ throws GitLabApiException GitLabApiException if any exception occurs during execution */
public List < CommitStatus > getCommitStatuses ( Object projectIdOrPath , String sha , CommitStatusFilter filter , int page , int perPage ) throws GitLabApiException { } } | if ( projectIdOrPath == null ) { throw new RuntimeException ( "projectIdOrPath cannot be null" ) ; } if ( sha == null || sha . trim ( ) . isEmpty ( ) ) { throw new RuntimeException ( "sha cannot be null" ) ; } MultivaluedMap < String , String > queryParams = ( filter != null ? filter . getQueryParams ( page , perPage ) . asMap ( ) : getPageQueryParams ( page , perPage ) ) ; Response response = get ( Response . Status . OK , queryParams , "projects" , this . getProjectIdOrPath ( projectIdOrPath ) , "repository" , "commits" , sha , "statuses" ) ; return ( response . readEntity ( new GenericType < List < CommitStatus > > ( ) { } ) ) ; |
public class CmsSitemapController { /** * Undeletes the resource with the given structure id . < p >
* @ param entryId the entry id
* @ param sitePath the site - path */
public void undelete ( CmsUUID entryId , String sitePath ) { } } | CmsSitemapChange change = new CmsSitemapChange ( entryId , sitePath , ChangeType . undelete ) ; CmsSitemapClipboardData data = CmsSitemapView . getInstance ( ) . getController ( ) . getData ( ) . getClipboardData ( ) . copy ( ) ; data . getDeletions ( ) . remove ( entryId ) ; change . setClipBoardData ( data ) ; commitChange ( change , null ) ; |
public class HtmlUtils { /** * Create a HTML paragraph from the given text .
* @ param value the value to enclose in paragraph .
* @ return a HTML paragraphe . */
public static String encloseInParagraphe ( String value ) { } } | Object [ ] _params = { value } ; return FORMAT_PARAGRAPH . format ( _params ) ; |
public class AbstractRemoteClient { /** * Method unlocks this instance .
* @ param maintainer the instance which currently holds the lock .
* @ throws CouldNotPerformException is thrown if the instance could not be
* unlocked . */
@ Override public void unlock ( final Object maintainer ) throws CouldNotPerformException { } } | synchronized ( maintainerLock ) { if ( this . maintainer != null && this . maintainer != maintainer ) { throw new CouldNotPerformException ( "Could not unlock remote because it is locked by another instance!" ) ; } this . maintainer = null ; } |
public class CmsCopyToProjectDialog { /** * Submits the dialog . < p > */
void submit ( ) { } } | CmsResource target = m_context . getResources ( ) . get ( 0 ) ; String resPath = m_context . getCms ( ) . getSitePath ( target ) ; try { m_context . getCms ( ) . copyResourceToProject ( resPath ) ; m_context . finish ( Collections . singletonList ( target . getStructureId ( ) ) ) ; } catch ( CmsException e ) { m_context . error ( e ) ; } |
public class A_CmsPublishGroupHelper { /** * Returns a calendar object representing the start of the day in which a given time lies . < p >
* @ param time a long representing a time
* @ return a calendar object which represents the day in which the time lies */
public Calendar getStartOfDay ( long time ) { } } | Calendar cal = Calendar . getInstance ( ) ; cal . setTimeInMillis ( time ) ; int year = cal . get ( Calendar . YEAR ) ; int month = cal . get ( Calendar . MONTH ) ; int day = cal . get ( Calendar . DAY_OF_MONTH ) ; Calendar result = Calendar . getInstance ( ) ; result . set ( Calendar . YEAR , year ) ; result . set ( Calendar . MONTH , month ) ; result . set ( Calendar . DAY_OF_MONTH , day ) ; return result ; |
public class P1_QueryOp { /** * t为null表示没有记录 , 因此等价于空list */
private < T > T doInterceptAfterQuery ( Class < ? > clazz , T t , StringBuilder sql , List < Object > args ) { } } | List < T > list = new ArrayList < T > ( ) ; if ( t != null ) { list . add ( t ) ; } list = doInteceptAfterQueryList ( clazz , list , 1 , sql , args ) ; return list == null || list . isEmpty ( ) ? null : list . get ( 0 ) ; |
public class DSClient { /** * ( non - Javadoc )
* @ see com . impetus . client . cassandra . CassandraClientBase # find ( com . impetus . kundera . metadata . model . EntityMetadata ,
* java . util . List , java . util . List , int , java . util . List ) */
@ Override public List < EnhanceEntity > find ( EntityMetadata m , List < String > relationNames , List < IndexClause > conditions , int maxResult , List < String > columns ) { } } | throw new UnsupportedOperationException ( "Support available only for thrift/pelops." ) ; |
public class FactoryBackgroundModel { /** * Creates an instance of { @ link BackgroundMovingGmm } .
* @ param config Configures the background model
* @ param imageType Type of input image
* @ return new instance of the background model */
public static < T extends ImageBase < T > , Motion extends InvertibleTransform < Motion > > BackgroundMovingGmm < T , Motion > movingGmm ( @ Nullable ConfigBackgroundGmm config , Point2Transform2Model_F32 < Motion > transform , ImageType < T > imageType ) { } } | if ( config == null ) config = new ConfigBackgroundGmm ( ) ; else config . checkValidity ( ) ; BackgroundMovingGmm < T , Motion > ret ; switch ( imageType . getFamily ( ) ) { case GRAY : ret = new BackgroundMovingGmm_SB ( config . learningPeriod , config . decayCoefient , config . numberOfGaussian , transform , imageType ) ; break ; case PLANAR : case INTERLEAVED : ret = new BackgroundMovingGmm_MB ( config . learningPeriod , config . decayCoefient , config . numberOfGaussian , transform , imageType ) ; break ; default : throw new IllegalArgumentException ( "Unknown image type" ) ; } ret . setInitialVariance ( config . initialVariance ) ; ret . setMaxDistance ( config . maxDistance ) ; ret . setSignificantWeight ( config . significantWeight ) ; ret . setUnknownValue ( config . unknownValue ) ; return ret ; |
public class CampaignManager { /** * Create a empty report . All campaign run will be " Not Executed " */
private void createReport ( ) { } } | CampaignReportManager . getInstance ( ) . startReport ( campaignStartTimeStamp , currentCampaign . getName ( ) ) ; for ( CampaignRun run : currentCampaign . getRuns ( ) ) { CampaignResult result = new CampaignResult ( run . getTestbed ( ) ) ; result . setStatus ( Status . NOT_EXECUTED ) ; CampaignReportManager . getInstance ( ) . putEntry ( result ) ; } CampaignReportManager . getInstance ( ) . refresh ( ) ; |
public class ClassUtil { /** * Make the { @ link Member } accessible if possible , throw
* { @ link IllegalArgumentException } is not .
* @ param member the member to check
* @ return the member
* @ throws IllegalArgumentException if cannot set accessibility */
@ SuppressWarnings ( "deprecation" ) public static < T extends Member > T checkAndFixAccess ( T member ) { } } | com . fasterxml . jackson . databind . util . ClassUtil . checkAndFixAccess ( member ) ; return member ; |
public class AbstractVirtualHostBuilder { /** * Configures SSL or TLS of this { @ link VirtualHost } with the specified { @ code keyCertChainFile } ,
* { @ code keyFile } , { @ code keyPassword } and { @ code tlsCustomizer } . */
public B tls ( File keyCertChainFile , File keyFile , @ Nullable String keyPassword , Consumer < SslContextBuilder > tlsCustomizer ) throws SSLException { } } | requireNonNull ( keyCertChainFile , "keyCertChainFile" ) ; requireNonNull ( keyFile , "keyFile" ) ; requireNonNull ( tlsCustomizer , "tlsCustomizer" ) ; if ( ! keyCertChainFile . exists ( ) ) { throw new SSLException ( "non-existent certificate chain file: " + keyCertChainFile ) ; } if ( ! keyCertChainFile . canRead ( ) ) { throw new SSLException ( "cannot read certificate chain file: " + keyCertChainFile ) ; } if ( ! keyFile . exists ( ) ) { throw new SSLException ( "non-existent key file: " + keyFile ) ; } if ( ! keyFile . canRead ( ) ) { throw new SSLException ( "cannot read key file: " + keyFile ) ; } tls ( buildSslContext ( ( ) -> SslContextBuilder . forServer ( keyCertChainFile , keyFile , keyPassword ) , tlsCustomizer ) ) ; return self ( ) ; |
public class PopupMenuItemHttpMessageContainer { /** * Performs the actions on all the the given messages .
* Defaults to call the method { @ code performAction ( HttpMessage ) } for each message ( with the message as parameter ) .
* Normally overridden if other implementations of { @ code HttpMessageContainer } are supported ( or not the desired
* behaviour ) .
* @ param httpMessages the messages that will be used to perform the actions
* @ see # performAction ( HttpMessage ) */
protected void performActions ( List < HttpMessage > httpMessages ) { } } | for ( HttpMessage httpMessage : httpMessages ) { if ( httpMessage != null ) { performAction ( httpMessage ) ; } } |
public class LoggerOnThread { /** * Rename the source file into the target file , deleting the target if
* necessary .
* @ param source
* @ param target */
private void renameFile ( File source , File target ) { } } | if ( ! source . exists ( ) ) { // don ' t do anything if the source file doesn ' t exist
return ; } if ( target . exists ( ) ) { target . delete ( ) ; } boolean rc = source . renameTo ( target ) ; if ( ! rc ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , getFileName ( ) + ": Unable to rename " + source + " to " + target ) ; } } |
public class Config { /** * Sets the map of WAN replication configurations , mapped by config name .
* @ param wanReplicationConfigs the WAN replication configuration map to set
* @ return this config instance */
public Config setWanReplicationConfigs ( Map < String , WanReplicationConfig > wanReplicationConfigs ) { } } | this . wanReplicationConfigs . clear ( ) ; this . wanReplicationConfigs . putAll ( wanReplicationConfigs ) ; for ( final Entry < String , WanReplicationConfig > entry : this . wanReplicationConfigs . entrySet ( ) ) { entry . getValue ( ) . setName ( entry . getKey ( ) ) ; } return this ; |
public class FTPPoolImpl { /** * returns a client from given connection
* @ param conn
* @ return
* @ return matching wrap
* @ throws IOException
* @ throws ApplicationException */
protected FTPWrap _get ( FTPConnection conn ) throws IOException , ApplicationException { } } | FTPWrap wrap = null ; if ( ! conn . hasLoginData ( ) ) { if ( StringUtil . isEmpty ( conn . getName ( ) ) ) { throw new ApplicationException ( "can't connect ftp server, missing connection definition" ) ; } wrap = wraps . get ( conn . getName ( ) ) ; if ( wrap == null ) { throw new ApplicationException ( "can't connect ftp server, missing connection [" + conn . getName ( ) + "]" ) ; } else if ( ! wrap . getClient ( ) . isConnected ( ) || wrap . getConnection ( ) . getTransferMode ( ) != conn . getTransferMode ( ) ) { wrap . reConnect ( conn . getTransferMode ( ) ) ; } return wrap ; } String name = conn . hasName ( ) ? conn . getName ( ) : "__noname__" ; wrap = wraps . get ( name ) ; if ( wrap != null ) { if ( conn . loginEquals ( wrap . getConnection ( ) ) ) { return _get ( new FTPConnectionImpl ( name , null , null , null , conn . getPort ( ) , conn . getTimeout ( ) , conn . getTransferMode ( ) , conn . isPassive ( ) , conn . getProxyServer ( ) , conn . getProxyPort ( ) , conn . getProxyUser ( ) , conn . getProxyPassword ( ) , conn . getFingerprint ( ) , conn . getStopOnError ( ) , conn . secure ( ) ) ) ; } disconnect ( wrap . getClient ( ) ) ; } wrap = new FTPWrap ( conn ) ; wraps . put ( name , wrap ) ; return wrap ; |
public class NodeServiceImpl { /** * 根据nodeid到找node */
public Node findById ( Long nodeId ) { } } | Assert . assertNotNull ( nodeId ) ; List < Node > nodes = listByIds ( nodeId ) ; if ( nodes . size ( ) != 1 ) { String exceptionCause = "query nodeId:" + nodeId + " return null." ; logger . error ( "ERROR ## " + exceptionCause ) ; throw new ManagerException ( exceptionCause ) ; } return nodes . get ( 0 ) ; |
public class ByteArrayList { /** * Adds all the elements in the given array list to the array list .
* @ param values The values to add to the array list . */
public void add ( ByteArrayList values ) { } } | ensureCapacity ( size + values . size ) ; for ( int i = 0 ; i < values . size ; i ++ ) { this . add ( values . elements [ i ] ) ; } |
public class XMLBuilder2 { /** * Construct a builder from an existing XML document file .
* The provided XML document will be parsed and an XMLBuilder2
* object referencing the document ' s root element will be returned .
* @ param xmlFile
* an XML document file that will be parsed into a DOM .
* @ param enableExternalEntities
* enable external entities ; beware of XML External Entity ( XXE ) injection .
* @ param isNamespaceAware
* enable or disable namespace awareness in the underlying
* { @ link DocumentBuilderFactory }
* @ return
* a builder node that can be used to add more nodes to the XML document .
* @ throws XMLBuilderRuntimeException
* to wrap { @ link ParserConfigurationException } , { @ link SAXException } ,
* { @ link IOException } , { @ link FileNotFoundException } */
public static XMLBuilder2 parse ( File xmlFile , boolean enableExternalEntities , boolean isNamespaceAware ) { } } | try { return XMLBuilder2 . parse ( new InputSource ( new FileReader ( xmlFile ) ) , enableExternalEntities , isNamespaceAware ) ; } catch ( FileNotFoundException e ) { throw wrapExceptionAsRuntimeException ( e ) ; } |
public class AbstractDomainQuery { /** * Open a block , encapsulating predicate expressions */
public TerminalResult BR_OPEN ( ) { } } | ConcatenateExpression ce = new ConcatenateExpression ( Concatenator . BR_OPEN ) ; this . astObjectsContainer . addAstObject ( ce ) ; TerminalResult ret = APIAccess . createTerminalResult ( ce ) ; QueryRecorder . recordInvocation ( this , "BR_OPEN" , ret ) ; return ret ; |
public class ClassAvailableTransformer { /** * Inject the byte code required to call the { @ code processCandidate } proxy
* after class initialization .
* @ param classfileBuffer the source class file
* @ return the modified class file */
byte [ ] transformCandidate ( byte [ ] classfileBuffer ) { } } | // reader - - > serial version uid adder - - > process candidate hook adapter - - > tracing - - > writer
ClassReader reader = new ClassReader ( classfileBuffer ) ; ClassWriter writer = new ClassWriter ( reader , ClassWriter . COMPUTE_MAXS ) ; ClassVisitor visitor = writer ; StringWriter stringWriter = null ; if ( tc . isDumpEnabled ( ) ) { stringWriter = new StringWriter ( ) ; visitor = new CheckClassAdapter ( visitor ) ; visitor = new TraceClassVisitor ( visitor , new PrintWriter ( stringWriter ) ) ; } visitor = new ClassAvailableHookClassAdapter ( visitor ) ; visitor = new SerialVersionUIDAdder ( visitor ) ; // Process the class
reader . accept ( visitor , 0 ) ; if ( stringWriter != null && tc . isDumpEnabled ( ) ) { Tr . dump ( tc , "Transformed class" , stringWriter ) ; } return writer . toByteArray ( ) ; |
public class PHS398FellowshipSupplementalV1_1Generator { /** * This method is used to get TutionRequestedYears data to Budget XMLObject
* from List of BudgetLineItem based on CostElement value of
* TUITION _ COST _ ELEMENTS */
private void setTutionRequestedYears ( Budget budget ) { } } | ProposalDevelopmentBudgetExtContract budgetEx = s2SCommonBudgetService . getBudget ( pdDoc . getDevelopmentProposal ( ) ) ; if ( budgetEx == null ) { return ; } ScaleTwoDecimal tutionTotal = ScaleTwoDecimal . ZERO ; for ( BudgetPeriodContract budgetPeriod : budgetEx . getBudgetPeriods ( ) ) { ScaleTwoDecimal tution = ScaleTwoDecimal . ZERO ; for ( BudgetLineItemContract budgetLineItem : budgetPeriod . getBudgetLineItems ( ) ) { if ( getCostElementsByParam ( ConfigurationConstants . TUITION_COST_ELEMENTS ) . contains ( budgetLineItem . getCostElementBO ( ) . getCostElement ( ) ) ) { tution = tution . add ( budgetLineItem . getLineItemCost ( ) ) ; } } tutionTotal = tutionTotal . add ( tution ) ; switch ( budgetPeriod . getBudgetPeriod ( ) ) { case 1 : budget . setTuitionRequestedYear1 ( tution . bigDecimalValue ( ) ) ; break ; case 2 : budget . setTuitionRequestedYear2 ( tution . bigDecimalValue ( ) ) ; break ; case 3 : budget . setTuitionRequestedYear3 ( tution . bigDecimalValue ( ) ) ; break ; case 4 : budget . setTuitionRequestedYear4 ( tution . bigDecimalValue ( ) ) ; break ; case 5 : budget . setTuitionRequestedYear5 ( tution . bigDecimalValue ( ) ) ; break ; case 6 : budget . setTuitionRequestedYear6 ( tution . bigDecimalValue ( ) ) ; break ; default : break ; } } budget . setTuitionRequestedTotal ( tutionTotal . bigDecimalValue ( ) ) ; if ( ! tutionTotal . equals ( ScaleTwoDecimal . ZERO ) ) { budget . setTuitionAndFeesRequested ( YesNoDataType . Y_YES ) ; } |
public class XmlEscape { /** * Perform an XML 1.0 level 1 ( only markup - significant chars ) < strong > escape < / strong > operation
* on a < tt > Reader < / tt > input meant to be an XML attribute value , writing results to a < tt > Writer < / tt > .
* < em > Level 1 < / em > means this method will only escape the five markup - significant characters which
* are < em > predefined < / em > as Character Entity References in XML :
* < tt > & lt ; < / tt > , < tt > & gt ; < / tt > , < tt > & amp ; < / tt > , < tt > & quot ; < / tt > and < tt > & # 39 ; < / tt > .
* Besides , being an attribute value also < tt > & # 92 ; t < / tt > , < tt > & # 92 ; n < / tt > and < tt > & # 92 ; r < / tt > will
* be escaped to avoid white - space normalization from removing line feeds ( turning them into white
* spaces ) during future parsing operations .
* This method calls { @ link # escapeXml10 ( Reader , Writer , XmlEscapeType , XmlEscapeLevel ) } with the following
* preconfigured values :
* < ul >
* < li > < tt > type < / tt > :
* { @ link org . unbescape . xml . XmlEscapeType # CHARACTER _ ENTITY _ REFERENCES _ DEFAULT _ TO _ HEXA } < / li >
* < li > < tt > level < / tt > :
* { @ link org . unbescape . xml . XmlEscapeLevel # LEVEL _ 1 _ ONLY _ MARKUP _ SIGNIFICANT } < / li >
* < / ul >
* This method is < strong > thread - safe < / strong > .
* @ param reader the < tt > Reader < / tt > reading the text to be escaped .
* @ param writer the < tt > java . io . Writer < / tt > to which the escaped result will be written . Nothing will
* be written at all to this writer if input is < tt > null < / tt > .
* @ throws IOException if an input / output exception occurs
* @ since 1.1.5 */
public static void escapeXml10AttributeMinimal ( final Reader reader , final Writer writer ) throws IOException { } } | escapeXml ( reader , writer , XmlEscapeSymbols . XML10_ATTRIBUTE_SYMBOLS , XmlEscapeType . CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA , XmlEscapeLevel . LEVEL_1_ONLY_MARKUP_SIGNIFICANT ) ; |
public class CmsModuleUpdater { /** * Deletes and publishes resources with ID conflicts .
* @ param cms the CMS context to use
* @ param module the module
* @ param conflictingIds the conflicting ids
* @ throws CmsException if something goes wrong
* @ throws Exception if something goes wrong */
protected void deleteConflictingResources ( CmsObject cms , CmsModule module , Map < CmsUUID , CmsUUID > conflictingIds ) throws CmsException , Exception { } } | CmsProject conflictProject = cms . createProject ( "Deletion of conflicting resources for " + module . getName ( ) , "Deletion of conflicting resources for " + module . getName ( ) , OpenCms . getDefaultUsers ( ) . getGroupAdministrators ( ) , OpenCms . getDefaultUsers ( ) . getGroupAdministrators ( ) , CmsProject . PROJECT_TYPE_TEMPORARY ) ; CmsObject deleteCms = OpenCms . initCmsObject ( cms ) ; deleteCms . getRequestContext ( ) . setCurrentProject ( conflictProject ) ; for ( CmsUUID vfsId : conflictingIds . values ( ) ) { CmsResource toDelete = deleteCms . readResource ( vfsId , CmsResourceFilter . ALL ) ; lock ( deleteCms , toDelete ) ; deleteCms . deleteResource ( toDelete , CmsResource . DELETE_PRESERVE_SIBLINGS ) ; } OpenCms . getPublishManager ( ) . publishProject ( deleteCms ) ; OpenCms . getPublishManager ( ) . waitWhileRunning ( ) ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcVolumetricFlowRateMeasure ( ) { } } | if ( ifcVolumetricFlowRateMeasureEClass == null ) { ifcVolumetricFlowRateMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 760 ) ; } return ifcVolumetricFlowRateMeasureEClass ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.