signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class XWikiSyntaxChainingRenderer { /** * { @ inheritDoc } * @ since 2.0RC1 */ @ Override public void beginDefinitionList ( Map < String , String > parameters ) { } }
if ( getBlockState ( ) . getDefinitionListDepth ( ) == 1 && ! getBlockState ( ) . isInList ( ) ) { printEmptyLine ( ) ; } else { print ( "\n" ) ; } printParameters ( parameters ) ;
public class RTMPConnection { /** * Mark message as being written . * @ param message * Message to mark */ protected void writingMessage ( Packet message ) { } }
if ( message . getMessage ( ) instanceof VideoData ) { Number streamId = message . getHeader ( ) . getStreamId ( ) ; final AtomicInteger value = new AtomicInteger ( ) ; AtomicInteger old = pendingVideos . putIfAbsent ( streamId . doubleValue ( ) , value ) ; if ( old == null ) { old = value ; } old . incrementAndGet ( )...
public class ConnectionBase { /** * See { @ link # setState ( int ) } , with additional notification of internal threads . * @ param newState new state to set */ protected final void setStateNotify ( final int newState ) { } }
synchronized ( lock ) { setState ( newState ) ; if ( newState == OK && ! inBlockingSend ) this . sendWaitQueue . release ( false ) ; // worst case : we notify 2 threads , the closing one and 1 sending lock . notifyAll ( ) ; }
public class HessianInput { /** * Reads an object from the input stream with an expected type . */ public Object readObject ( Class cl ) throws IOException { } }
if ( cl == null || cl == Object . class ) return readObject ( ) ; int tag = read ( ) ; switch ( tag ) { case 'N' : return null ; case 'M' : { String type = readType ( ) ; // hessian / 3386 if ( "" . equals ( type ) ) { Deserializer reader ; reader = _serializerFactory . getDeserializer ( cl ) ; return reader . readMap ...
public class ObjectPoolWithThreadAffinity { /** * Clears any objects sitting idle in the pool . */ public synchronized void clear ( ) { } }
pool . forEachUntil ( new DoUntilProcedure < E > ( ) { public boolean execute ( E object ) { destroyObject ( object ) ; return false ; } } ) ; pool . clear ( ) ; numActive = 0 ; notifyAll ( ) ; // num sleeping has changed
public class CommerceWishListItemPersistenceImpl { /** * Returns the first commerce wish list item in the ordered set where commerceWishListId = & # 63 ; . * @ param commerceWishListId the commerce wish list ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) ...
CommerceWishListItem commerceWishListItem = fetchByCommerceWishListId_First ( commerceWishListId , orderByComparator ) ; if ( commerceWishListItem != null ) { return commerceWishListItem ; } StringBundler msg = new StringBundler ( 4 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "commerceWishListId=" ) ...
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getGCCBEZRG ( ) { } }
if ( gccbezrgEClass == null ) { gccbezrgEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 493 ) ; } return gccbezrgEClass ;
public class LongStream { /** * Returns { @ code LongStream } with elements that satisfy the given predicate . * < p > This is an intermediate operation . * < p > Example : * < pre > * predicate : ( a ) - & gt ; a & gt ; 2 * stream : [ 1 , 2 , 3 , 4 , - 8 , 0 , 11] * result : [ 3 , 4 , 11] * < / pre > *...
return new LongStream ( params , new LongFilter ( iterator , predicate ) ) ;
public class Deleter { /** * Actually delete the resource . */ public void delete ( ) throws IOException , PlivoRestException { } }
validate ( ) ; Response < ResponseBody > response = obtainCall ( ) . execute ( ) ; handleResponse ( response ) ;
public class CLibrary { /** * Returns the limit on the number of open files or null * on failure */ public static Integer getOpenFileLimit ( ) { } }
try { Rlimit rlimit = new Rlimit ( ) ; int retval = getrlimit ( System . getProperty ( "os.name" ) . equals ( "Linux" ) ? RLIMIT_NOFILE_LINUX : RLIMIT_NOFILE_MAC_OS_X , rlimit ) ; if ( retval != 0 ) { return null ; } else if ( rlimit . rlim_cur >= 1024 ) { // Seems to be a sensible value that is the default or greater ...
public class SMIDAS { /** * Sets the learning rate used during training * @ param eta the learning rate to use */ public void setEta ( double eta ) { } }
if ( Double . isNaN ( eta ) || Double . isInfinite ( eta ) || eta <= 0 ) throw new ArithmeticException ( "convergence parameter must be a positive value" ) ; this . eta = eta ;
public class Matrix3x2f { /** * Apply a rotation transformation to this matrix by rotating the given amount of radians about * the specified rotation center < code > ( x , y ) < / code > and store the result in < code > dest < / code > . * This method is equivalent to calling : < code > translate ( x , y , dest ) ....
float tm20 = m00 * x + m10 * y + m20 ; float tm21 = m01 * x + m11 * y + m21 ; float cos = ( float ) Math . cos ( ang ) ; float sin = ( float ) Math . sin ( ang ) ; float nm00 = m00 * cos + m10 * sin ; float nm01 = m01 * cos + m11 * sin ; dest . m10 = m00 * - sin + m10 * cos ; dest . m11 = m01 * - sin + m11 * cos ; dest...
public class SARLJvmModelInferrer { /** * Copy the JVM operations from the source to the destination . * @ param source the source . * @ param target the destination . * @ param createdActions the set of actions that are created before ( input ) or during ( output ) the invocation . * @ param bodyBuilder the bu...
final Iterable < JvmOperation > operations = Iterables . transform ( Iterables . filter ( source . getMembers ( ) , it -> { if ( it instanceof JvmOperation ) { final JvmOperation op = ( JvmOperation ) it ; return ! op . isStatic ( ) && op . getVisibility ( ) == JvmVisibility . PUBLIC ; } return false ; } ) , it -> ( Jv...
public class BaggageResolver { /** * 通过请求透传数据 * @ param context RpcInvokeContext * @ param request 请求 */ public static void carryWithRequest ( RpcInvokeContext context , SofaRequest request ) { } }
if ( context != null ) { Map < String , String > requestBaggage = context . getAllRequestBaggage ( ) ; if ( CommonUtils . isNotEmpty ( requestBaggage ) ) { // 需要透传 request . addRequestProp ( RemotingConstants . RPC_REQUEST_BAGGAGE , requestBaggage ) ; } }
public class ParallelStepBuilder { /** * Build a generated job with only one flow in it to submit to the * BatchKernel . This is used to build subjobs from splits . */ public static JSLJob buildFlowInSplitSubJob ( long topLevelJobInstanceId , JobContext jobContext , Split split , Flow flow ) { } }
ObjectFactory jslFactory = new ObjectFactory ( ) ; JSLJob subJob = jslFactory . createJSLJob ( ) ; // Uses the true top - level job instance id , not an internal " subjob " id . String subJobId = generateSubJobId ( topLevelJobInstanceId , split . getId ( ) , flow . getId ( ) ) ; subJob . setId ( subJobId ) ; // Copy al...
public class HealthPinger { /** * Pings the service and completes if successful - and fails if it didn ' t work * for some reason ( reason is in the exception ) . */ private static Observable < PingServiceHealth > pingBinary ( final NetworkAddress hostname , final String bucket , final ClusterFacade core , final long...
final AtomicReference < CouchbaseRequest > request = new AtomicReference < CouchbaseRequest > ( ) ; Observable < NoopResponse > response = Observable . defer ( new Func0 < Observable < NoopResponse > > ( ) { @ Override public Observable < NoopResponse > call ( ) { CouchbaseRequest r = new NoopRequest ( bucket , hostnam...
public class InternalXbaseParser { /** * InternalXbase . g : 1083:1 : entryRuleXExpressionOrVarDeclaration : ruleXExpressionOrVarDeclaration EOF ; */ public final void entryRuleXExpressionOrVarDeclaration ( ) throws RecognitionException { } }
try { // InternalXbase . g : 1084:1 : ( ruleXExpressionOrVarDeclaration EOF ) // InternalXbase . g : 1085:1 : ruleXExpressionOrVarDeclaration EOF { if ( state . backtracking == 0 ) { before ( grammarAccess . getXExpressionOrVarDeclarationRule ( ) ) ; } pushFollow ( FOLLOW_1 ) ; ruleXExpressionOrVarDeclaration ( ) ; sta...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EEnum getIfcObjectTypeEnum ( ) { } }
if ( ifcObjectTypeEnumEEnum == null ) { ifcObjectTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1021 ) ; } return ifcObjectTypeEnumEEnum ;
public class CmsImportVersion10 { /** * Sets the userLastModified . < p > * @ param userLastModified the userLastModified to set * @ see # N _ USERLASTMODIFIED * @ see # addResourceAttributesRules ( Digester , String ) */ public void setUserLastModified ( String userLastModified ) { } }
if ( null == userLastModified ) { // The optional user last modified information is not provided m_resourceBuilder . setUserLastModified ( getRequestContext ( ) . getCurrentUser ( ) . getId ( ) ) ; } else { // use the user last modified information from the manifest try { String userLastModifiedName = OpenCms . getImpo...
public class MessageQueueFilter { /** * Takes the filtered message from message queue . This method will be blocked * until the message becomes available or timeout is detected . * @ param timeoutMs the timeout for blocking , in millisecond . * @ return filtered message tuple . * @ throws InterruptedException i...
MessageTuple tuple = messageQueue . poll ( timeoutMs , TimeUnit . MILLISECONDS ) ; if ( tuple == null ) { throw new TimeoutException ( "Timeout while waiting for the message." ) ; } if ( tuple . getMessage ( ) . getType ( ) == MessageType . SHUT_DOWN ) { // If it ' s SHUT _ DOWN message . throw new LeftCluster ( "Left ...
public class ConsumerService { /** * Dispatch message to callback . Override to address special threading considerations . * @ param channel The channel that delivered the message . * @ param message The message to dispatch . * @ param callbacks The callbacks to receive the message . */ protected void dispatchMes...
for ( IMessageCallback callback : callbacks ) { try { callback . onMessage ( channel , message ) ; } catch ( Exception e ) { } }
public class Problem { /** * Filters and returns first problem input which name * match the given < tt > type < / tt > * @ param type Type of the input to retrieve ( usually small or large ) . * @ return Corresponding input if any , < tt > null < / tt > otherwise . */ public ProblemInput getProblemInput ( final S...
final String name = type . toLowerCase ( ) ; for ( final ProblemInput input : getProblemInputs ( ) ) { if ( input . getName ( ) . equals ( name ) ) { return input ; } } return null ;
public class VasEventHandler { /** * Updates the ' reservable ' property of the charging station . If the charging station cannot be found in the * repository an error is logged . * @ param chargingStationId charging station identifier . * @ param reservable true if the charging station is reservable , false othe...
ChargingStation chargingStation = getChargingStation ( chargingStationId ) ; if ( chargingStation != null ) { chargingStation . setReservable ( reservable ) ; chargingStationRepository . createOrUpdate ( chargingStation ) ; }
public class CommercePriceListPersistenceImpl { /** * Returns an ordered range of all the commerce price lists where commerceCurrencyId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary...
return findByCommerceCurrencyId ( commerceCurrencyId , start , end , orderByComparator , true ) ;
public class SparseBaseLevel1 { /** * Computes the Euclidean norm of a vector . * @ param arr a vector * @ return the Euclidean norm of the vector */ @ Override public double nrm2 ( INDArray arr ) { } }
switch ( arr . data ( ) . dataType ( ) ) { case DOUBLE : DefaultOpExecutioner . validateDataType ( DataType . DOUBLE , arr ) ; return dnrm2 ( arr . length ( ) , arr , 1 ) ; case FLOAT : DefaultOpExecutioner . validateDataType ( DataType . FLOAT , arr ) ; return snrm2 ( arr . length ( ) , arr , 1 ) ; case HALF : return ...
public class RelaxDefaultsParserConfiguration { /** * Insert the Relax NG defaults component */ protected void insertRelaxDefaultsComponent ( ) { } }
if ( fRelaxDefaults == null ) { fRelaxDefaults = new RelaxNGDefaultsComponent ( resolver ) ; addCommonComponent ( fRelaxDefaults ) ; fRelaxDefaults . reset ( this ) ; } XMLDocumentSource prev = fLastComponent ; fLastComponent = fRelaxDefaults ; XMLDocumentHandler next = prev . getDocumentHandler ( ) ; prev . setDocumen...
public class MetaqTemplate { /** * Returns or create a message producer for topic . * @ param topic * @ return * @ since 1.4.5 */ public MessageProducer getOrCreateProducer ( final String topic ) { } }
if ( ! this . shareProducer ) { FutureTask < MessageProducer > task = this . producers . get ( topic ) ; if ( task == null ) { task = new FutureTask < MessageProducer > ( new Callable < MessageProducer > ( ) { @ Override public MessageProducer call ( ) throws Exception { MessageProducer producer = MetaqTemplate . this ...
public class BaseTangramEngine { /** * Set original data list with type { @ link T } in Tangram . * @ param data Original data with type { @ link T } . */ public void setData ( @ Nullable T data ) { } }
Preconditions . checkState ( mGroupBasicAdapter != null , "Must call bindView() first" ) ; List < Card > cards = mDataParser . parseGroup ( data , this ) ; this . setData ( cards ) ;
public class ResponseAttachmentInputStreamSupport { /** * Registers a set of streams that were associated with a particular request . Does nothing if { @ link # shutdown ( ) } * has been invoked , in which case any use of the { @ link # getReadHandler ( ) read handler } will result in behavior * equivalent to what ...
// ^ ^ ^ synchronize on ' this ' to avoid races with shutdown if ( ! stopped ) { // Streams share a timestamp so activity on any is sufficient to keep the rest alive AtomicLong timestamp = new AtomicLong ( System . currentTimeMillis ( ) ) ; for ( int i = 0 ; i < streams . size ( ) ; i ++ ) { OperationResponse . StreamE...
public class SelenideTargetLocator { /** * Switch to window / tab by name / handle / title * @ param nameOrHandleOrTitle name or handle or title of window / tab */ @ Override public WebDriver window ( String nameOrHandleOrTitle ) { } }
try { return Wait ( ) . until ( windowToBeAvailableAndSwitchToIt ( nameOrHandleOrTitle ) ) ; } catch ( TimeoutException e ) { throw new NoSuchWindowException ( "No window found with name or handle or title: " + nameOrHandleOrTitle , e ) ; }
public class UnionPathIterator { /** * Get the analysis bits for this walker , as defined in the WalkerFactory . * @ return One of WalkerFactory # BIT _ DESCENDANT , etc . */ public int getAnalysisBits ( ) { } }
int bits = 0 ; if ( m_exprs != null ) { int n = m_exprs . length ; for ( int i = 0 ; i < n ; i ++ ) { int bit = m_exprs [ i ] . getAnalysisBits ( ) ; bits |= bit ; } } return bits ;
public class ExampleSegmentSuperpixels { /** * Segments and visualizes the image */ public static < T extends ImageBase < T > > void performSegmentation ( ImageSuperpixels < T > alg , T color ) { } }
// Segmentation often works better after blurring the image . Reduces high frequency image components which // can cause over segmentation GBlurImageOps . gaussian ( color , color , 0.5 , - 1 , null ) ; // Storage for segmented image . Each pixel will be assigned a label from 0 to N - 1 , where N is the number // of se...
public class ParsedColInfo { /** * Construct a ParsedColInfo from Volt XML . * Allow caller to specify actions to finalize the parsed expression . */ static public ParsedColInfo fromOrderByXml ( AbstractParsedStmt parsedStmt , VoltXMLElement orderByXml , ExpressionAdjuster adjuster ) { } }
// make sure everything is kosher assert ( orderByXml . name . equalsIgnoreCase ( "orderby" ) ) ; // get desc / asc String desc = orderByXml . attributes . get ( "desc" ) ; boolean descending = ( desc != null ) && ( desc . equalsIgnoreCase ( "true" ) ) ; // get the columnref or other expression inside the orderby node ...
public class AttributeDefinition { /** * Creates a returns a basic model node describing the attribute , after attaching it to the given overall resource * description model node . The node describing the attribute is returned to make it easy to perform further * modification . * @ param resourceDescription the o...
final ModelNode attr = getNoTextDescription ( false ) ; final String description = resolver . getResourceAttributeDescription ( getName ( ) , locale , bundle ) ; attr . get ( ModelDescriptionConstants . DESCRIPTION ) . set ( description ) ; final ModelNode result = resourceDescription . get ( ModelDescriptionConstants ...
public class BoxApiBookmark { /** * Gets a request that moves a bookmark to another folder * @ param id id of bookmark to move * @ param parentId id of parent folder to move bookmark into * @ return request to move a bookmark */ public BoxRequestsBookmark . UpdateBookmark getMoveRequest ( String id , String paren...
BoxRequestsBookmark . UpdateBookmark request = new BoxRequestsBookmark . UpdateBookmark ( id , getBookmarkInfoUrl ( id ) , mSession ) ; request . setParentId ( parentId ) ; return request ;
public class SqlUtility { /** * Extract from value string every placeholder : { } , replace it with ? and * then convert every field typeName with column typeName . The result is a * pair : the first value is the elaborated string . The second is the list of * parameters associated to ? . This second parameter is...
String whereStatement = value ; Pair < String , List < Pair < String , TypeName > > > result = new Pair < String , List < Pair < String , TypeName > > > ( ) ; result . value1 = new ArrayList < Pair < String , TypeName > > ( ) ; // replace placeholder : { } with ? { Matcher matcher = PARAMETER . matcher ( whereStatement...
public class FileOutputCommitter { /** * Delete the temporary directory , including all of the work directories . * This is called for all jobs whose final run state is SUCCEEDED * @ param context the job ' s context . */ public void commitJob ( JobContext context ) throws IOException { } }
// delete the _ temporary folder cleanupJob ( context ) ; // check if the o / p dir should be marked if ( shouldMarkOutputDir ( context . getConfiguration ( ) ) ) { // create a _ success file in the o / p folder markOutputDirSuccessful ( context ) ; }
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcGeometricSetSelect ( ) { } }
if ( ifcGeometricSetSelectEClass == null ) { ifcGeometricSetSelectEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1134 ) ; } return ifcGeometricSetSelectEClass ;
public class Transition { /** * Pauses this transition , sending out calls to { @ link * TransitionListener # onTransitionPause ( Transition ) } to all listeners * and pausing all running animators started by this transition . * @ hide */ public void pause ( @ NonNull View sceneRoot ) { } }
if ( ! mEnded ) { synchronized ( sRunningAnimators ) { ArrayMap < Animator , AnimationInfo > runningAnimators = getRunningAnimators ( ) ; int numOldAnims = runningAnimators . size ( ) ; Object windowId = ViewUtils . getWindowId ( sceneRoot ) ; for ( int i = numOldAnims - 1 ; i >= 0 ; i -- ) { AnimationInfo info = runni...
public class UniversalKafkaQueue { /** * { @ inheritDoc } * @ since 0.7.0 */ @ Override public UniversalKafkaQueue init ( ) throws Exception { } }
super . init ( ) ; if ( getMessageFactory ( ) == null ) { setMessageFactory ( UniversalIdIntQueueMessageFactory . INSTANCE ) ; } return this ;
public class HmlUtils { /** * Create and return zero or more DNA HML Sequences read from the specified reader in FASTA format . * @ param reader reader to read from , must not be null * @ return zero or more DNA HML Sequences read from the specified reader in FASTA format * @ throws IOException if an I / O error ...
checkNotNull ( reader ) ; List < Sequence > sequences = new ArrayList < Sequence > ( ) ; for ( SequenceIterator it = SeqIOTools . readFastaDNA ( reader ) ; it . hasNext ( ) ; ) { try { sequences . add ( createSequence ( it . nextSequence ( ) ) ) ; } catch ( BioException e ) { throw new IOException ( "could not read DNA...
public class HtmlGraphicImage { /** * < p > Return the value of the < code > height < / code > property . < / p > * < p > Contents : Override for the height of this image . */ public java . lang . String getHeight ( ) { } }
return ( java . lang . String ) getStateHelper ( ) . eval ( PropertyKeys . height ) ;
public class MultifactorAuthenticationTrustRecordCouchDbRepository { /** * Find by principal on or after date . * @ param principal Principal to search for * @ param onOrAfterDate start date for search * @ return records for principal after date . */ @ View ( name = "by_principal_date" , map = "function(doc) { if...
val view = createQuery ( "by_principal_date" ) . startKey ( ComplexKey . of ( principal , onOrAfterDate ) ) . endKey ( ComplexKey . of ( principal , "999999" ) ) ; return db . queryView ( view , CouchDbMultifactorAuthenticationTrustRecord . class ) ;
public class DistributedQueue { /** * Start the queue . No other methods work until this is called * @ throws Exception startup errors */ @ Override public void start ( ) throws Exception { } }
if ( ! state . compareAndSet ( State . LATENT , State . STARTED ) ) { throw new IllegalStateException ( ) ; } try { client . create ( ) . creatingParentContainersIfNeeded ( ) . forPath ( queuePath ) ; } catch ( KeeperException . NodeExistsException ignore ) { // this is OK } if ( lockPath != null ) { try { client . cre...
public class Context { /** * Change the current error reporter . * @ return the previous error reporter * @ see org . mozilla . javascript . ErrorReporter */ public final ErrorReporter setErrorReporter ( ErrorReporter reporter ) { } }
if ( sealed ) onSealedMutation ( ) ; if ( reporter == null ) throw new IllegalArgumentException ( ) ; ErrorReporter old = getErrorReporter ( ) ; if ( reporter == old ) { return old ; } Object listeners = propertyListeners ; if ( listeners != null ) { firePropertyChangeImpl ( listeners , errorReporterProperty , old , re...
public class PluginFile { /** * Executes an action . * @ param action the action to execute * @ throws PluginException */ void executeAction ( Action action ) throws PluginException { } }
try { switch ( action . actionType ) { case DELETE : this . logger . fine ( "Deleting " + action . parameter + "..." ) ; File f = new File ( action . parameter ) ; Utils . deleteFilesRecursively ( f ) ; break ; case DOWNLOAD : this . logger . fine ( "Downloading " + action . parameter + "..." ) ; URI uri = UriUtils . u...
public class PathPatternUtils { /** * Normalizes path . Returns string without character < / code > / < / code > at the end . */ private static String normalizePath ( String absPath ) { } }
if ( absPath . endsWith ( "/" ) ) { return absPath . substring ( 0 , absPath . length ( ) - 1 ) ; } return absPath ;
public class Parser { /** * When this is called , the keyword " foreach " has already been read . */ private ForeachStatement parseForeachStatement ( Token token ) throws IOException { } }
SourceInfo info = token . getSourceInfo ( ) ; token = peek ( ) ; if ( token . getID ( ) == Token . LPAREN ) { read ( ) ; } else { error ( "foreach.lparen.expected" , token ) ; } VariableRef loopVar = parseLValue ( ) ; // mod for declarative typing boolean foundASToken = false ; Token asToken = peek ( ) ; if ( asToken ....
public class LogRepositoryListener { /** * ( non - Javadoc ) * @ see org . eclipse . aether . util . listener . AbstractRepositoryListener # * metadataInstalling ( org . eclipse . aether . RepositoryEvent ) */ @ Override public void metadataInstalling ( RepositoryEvent event ) { } }
log . finer ( "Installing " + event . getMetadata ( ) + " to " + event . getFile ( ) ) ;
public class JMXOverRMIServerSocketFactory { /** * ( non - Javadoc ) * @ see java . rmi . server . RMIServerSocketFactory # createServerSocket ( int ) */ @ Override public ServerSocket createServerSocket ( int port ) throws IOException { } }
ServerSocket socket = getSocketFactory ( ) . createServerSocket ( port , backLog , getListenAddress ( ) ) ; if ( manageSockets ) createdSockets . add ( socket ) ; return socket ;
public class JDBC4CallableStatement { /** * Retrieves the value of the designated JDBC TIMESTAMP parameter as a java . sql . Timestamp object , using the given Calendar object to construct the Timestamp object . */ @ Override public Timestamp getTimestamp ( int parameterIndex , Calendar cal ) throws SQLException { } }
checkClosed ( ) ; throw SQLError . noSupport ( ) ;
public class GoogleHadoopFileSystemBase { /** * Appends to an existing file ( optional operation ) . Not supported . * @ param hadoopPath The existing file to be appended . * @ param bufferSize The size of the buffer to be used . * @ param progress For reporting progress if it is not null . * @ return A writabl...
long startTime = System . nanoTime ( ) ; Preconditions . checkArgument ( hadoopPath != null , "hadoopPath must not be null" ) ; logger . atFine ( ) . log ( "GHFS.append: %s, bufferSize: %d (ignored)" , hadoopPath , bufferSize ) ; long duration = System . nanoTime ( ) - startTime ; increment ( Counter . APPEND ) ; incre...
public class ProhibitedCompoundRuleEvaluator { /** * TODO deduplicate / delegate */ private List < Map . Entry < Sentence , Map . Entry < Integer , Integer > > > getRelevantSentences ( List < String > inputs , String token , int maxSentences ) throws IOException { } }
List < Map . Entry < Sentence , Map . Entry < Integer , Integer > > > sentences = new ArrayList < > ( ) ; for ( String input : inputs ) { if ( new File ( input ) . isDirectory ( ) ) { File file = new File ( input , token + ".txt" ) ; if ( ! file . exists ( ) ) { throw new RuntimeException ( "File with example sentences...
public class MarketplacePortletDefinition { /** * private method that sets the parentCategories field and the categories field This will ensure * that the public methods { @ link # getParentCategories ( ) getParentCategories ( ) } and { @ link * # getCategories ( ) getCategories ( ) } will not return null . Empty s...
Set < PortletCategory > allCategories = new HashSet < PortletCategory > ( ) ; this . setParentCategories ( this . portletCategoryRegistry . getParentCategories ( this ) ) ; for ( PortletCategory childCategory : this . parentCategories ) { allCategories . add ( childCategory ) ; allCategories . addAll ( this . portletCa...
public class CpuNDArrayFactory { /** * This method averages input arrays , and returns averaged array * @ param target * @ param arrays * @ return */ @ Override public INDArray average ( INDArray target , INDArray [ ] arrays ) { } }
if ( arrays == null || arrays . length == 0 ) throw new RuntimeException ( "Input arrays are missing" ) ; if ( arrays . length == 1 ) { // Edge case - average 1 array - no op if ( target == null ) { return null ; } return target . assign ( arrays [ 0 ] ) ; } long len = target != null ? target . lengthLong ( ) : arrays ...
public class MapMatching { /** * Filters GPX entries to only those which will be used for map matching ( i . e . those which * are separated by at least 2 * measurementErrorSigman */ private List < Observation > filterGPXEntries ( List < Observation > gpxList ) { } }
List < Observation > filtered = new ArrayList < > ( ) ; Observation prevEntry = null ; int last = gpxList . size ( ) - 1 ; for ( int i = 0 ; i <= last ; i ++ ) { Observation gpxEntry = gpxList . get ( i ) ; if ( i == 0 || i == last || distanceCalc . calcDist ( prevEntry . getPoint ( ) . getLat ( ) , prevEntry . getPoin...
public class HazelcastProperties { /** * Returns the configured value of a { @ link HazelcastProperty } converted to milliseconds if * it is positive , otherwise returns the passed default value . * @ param property the { @ link HazelcastProperty } to get the value from * @ param defaultValue the default value to...
long millis = getMillis ( property ) ; return millis > 0 ? millis : defaultValue ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ArithType } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "minus" ) public JAXBElement < ArithType > createMinus ( ArithType value ) { } }
return new JAXBElement < ArithType > ( _Minus_QNAME , ArithType . class , null , value ) ;
public class Symbol { /** * Search for rectangles which have the same width and x position , and * which join together vertically and merge them together to reduce the * number of rectangles needed to describe a symbol . */ protected void mergeVerticalBlocks ( ) { } }
for ( int i = 0 ; i < rectangles . size ( ) - 1 ; i ++ ) { for ( int j = i + 1 ; j < rectangles . size ( ) ; j ++ ) { Rectangle2D . Double firstRect = rectangles . get ( i ) ; Rectangle2D . Double secondRect = rectangles . get ( j ) ; if ( roughlyEqual ( firstRect . x , secondRect . x ) && roughlyEqual ( firstRect . wi...
public class WaiterExecution { /** * Calls the custom delay strategy to control the sleep time * @ param pollingStrategyContext Provides the polling strategy context . * Includes request and number of retries * attempted so far . */ private void safeCustomDelay ( PollingStrategyContext pollingStrategyContext ) { ...
try { pollingStrategy . getDelayStrategy ( ) . delayBeforeNextRetry ( pollingStrategyContext ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; throw new RuntimeException ( e ) ; }
public class ConditionalCheck { /** * Ensures that a passed map as a parameter of the calling method is not empty . * We recommend to use the overloaded method { @ link Check # notEmpty ( Collection , String ) } and pass as second argument * the name of the parameter to enhance the exception message . * @ param c...
IllegalNullArgumentException . class , IllegalEmptyArgumentException . class } ) public static < T extends Map < ? , ? > > void notEmpty ( final boolean condition , @ Nonnull final T map ) { if ( condition ) { Check . notEmpty ( map ) ; }
public class NumberUtilities { /** * Given an double string , it checks if it ' s a valid double ( based on apaches NumberUtils . createDouble ) * @ param doubleStr the double string to check * @ return true if it ' s valid , otherwise false */ public static boolean isValidDouble ( @ Nullable final String doubleStr...
if ( StringUtils . isBlank ( doubleStr ) ) { return false ; } final String stripedDouble = StringUtils . strip ( doubleStr ) ; try { NumberUtils . createDouble ( stripedDouble ) ; return true ; } catch ( NumberFormatException e ) { return false ; }
public class MFPPush { /** * Set the default push notification options for notifications . * @ param context - this is the Context of the application from getApplicationContext ( ) * @ param options - The MFPPushNotificationOptions with the default parameters */ private void setNotificationOptions ( Context context...
if ( this . appContext == null ) { this . appContext = context . getApplicationContext ( ) ; } this . options = options ; Gson gson = new Gson ( ) ; String json = gson . toJson ( options ) ; SharedPreferences sharedPreferences = appContext . getSharedPreferences ( PREFS_NAME , Context . MODE_PRIVATE ) ; MFPPushUtils . ...
public class CmsLogChannelTable { /** * Filters the table according to given search string . < p > * @ param search string to be looked for . */ @ SuppressWarnings ( "unchecked" ) public void filterTable ( String search ) { } }
m_container . removeAllContainerFilters ( ) ; if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( search ) ) { m_container . addContainerFilter ( new Or ( new SimpleStringFilter ( TableColumn . Channel , search , true , false ) , new SimpleStringFilter ( TableColumn . ParentChannel , search , true , false ) , new SimpleS...
public class WebApplicationHandler { protected synchronized void doStop ( ) throws Exception { } }
try { // Stop servlets super . doStop ( ) ; // Stop filters for ( int i = _filters . size ( ) ; i -- > 0 ; ) { FilterHolder holder = ( FilterHolder ) _filters . get ( i ) ; holder . stop ( ) ; } } finally { _webApplicationContext = null ; _sessionListeners = null ; _requestListeners = null ; _requestAttributeListeners ...
public class TokenCachingStrategy { /** * Puts the expiration date into a Bundle . * @ param bundle * A Bundle in which the expiration date should be stored . * @ param value * The Date representing the expiration date . * @ throws NullPointerException if the passed in Bundle or date value are null */ public ...
Validate . notNull ( bundle , "bundle" ) ; Validate . notNull ( value , "value" ) ; putDate ( bundle , EXPIRATION_DATE_KEY , value ) ;
public class WatermarkDecrementer { /** * { @ inheritDoc } */ public boolean shouldDestroy ( ConnectionListener cl , long timeout , int currentSize , int minPoolSize , int destroyed ) { } }
if ( watermark < 0 ) return currentSize > minPoolSize ; return watermark < currentSize ;
public class ConfluenceGreenPepper { /** * < p > Getter for the field < code > spacePermissionManager < / code > . < / p > * @ return a { @ link com . atlassian . confluence . security . SpacePermissionManager } object . */ public SpacePermissionManager getSpacePermissionManager ( ) { } }
if ( spacePermissionManager != null ) { return spacePermissionManager ; } spacePermissionManager = ( SpacePermissionManager ) ContainerManager . getComponent ( "spacePermissionManager" ) ; return spacePermissionManager ;
public class ClassUtils { /** * < p > Converts an array of { @ code Object } in to an array of { @ code Class } objects . * If any of these objects is null , a null element will be inserted into the array . < / p > * < p > This method returns { @ code null } for a { @ code null } input array . < / p > * @ param a...
if ( array == null ) { return null ; } else if ( array . length == 0 ) { return ArrayUtils . EMPTY_CLASS_ARRAY ; } final Class < ? > [ ] classes = new Class < ? > [ array . length ] ; for ( int i = 0 ; i < array . length ; i ++ ) { classes [ i ] = array [ i ] == null ? null : array [ i ] . getClass ( ) ; } return class...
public class VTimeZone { /** * Append the UNTIL attribute after RRULE line */ private static void appendUNTIL ( Writer writer , String until ) throws IOException { } }
if ( until != null ) { writer . write ( SEMICOLON ) ; writer . write ( ICAL_UNTIL ) ; writer . write ( EQUALS_SIGN ) ; writer . write ( until ) ; }
public class Config { /** * Extends the runtime classpath to include the files or directories specified . * @ param paths one or more strings representing a single JAR file or a directory containing JARs . * @ since 1.0.0 */ public void expandClasspath ( String ... paths ) { } }
if ( paths == null || paths . length == 0 ) { return ; } for ( String path : paths ) { expandClasspath ( new File ( PathUtil . resolve ( path ) ) ) ; }
public class GeometryMergeService { /** * End the merging process by effectively executing the merge operation and returning the result through a * call - back . * @ param callback The call - back function that will receive the merged geometry . * @ throws GeometryMergeException Thrown in case the merging process...
if ( ! busy ) { throw new GeometryMergeException ( "Can't stop the merging process since it is not activated." ) ; } if ( callback == null ) { cancel ( ) ; return ; } merge ( new GeometryFunction ( ) { public void execute ( Geometry geometry ) { callback . execute ( geometry ) ; try { clearGeometries ( ) ; } catch ( Ge...
public class CommerceAccountUserRelPersistenceImpl { /** * Returns an ordered range of all the commerce account user rels where commerceAccountUserId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > a...
boolean pagination = true ; FinderPath finderPath = null ; Object [ ] finderArgs = null ; if ( ( start == QueryUtil . ALL_POS ) && ( end == QueryUtil . ALL_POS ) && ( orderByComparator == null ) ) { pagination = false ; finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_COMMERCEACCOUNTUSERID ; finderArgs = new Object ...
public class CRLNumberExtension { /** * Write the extension to the DerOutputStream . * @ param out the DerOutputStream to write the extension to . * @ exception IOException on encoding errors . */ public void encode ( OutputStream out ) throws IOException { } }
DerOutputStream tmp = new DerOutputStream ( ) ; encode ( out , PKIXExtensions . CRLNumber_Id , true ) ;
public class AmazonConfigClient { /** * Returns the details of one or more retention configurations . If the retention configuration name is not * specified , this action returns the details for all the retention configurations for that account . * < note > * Currently , AWS Config supports only one retention con...
request = beforeClientExecution ( request ) ; return executeDescribeRetentionConfigurations ( request ) ;
public class CountersTable { /** * Count forward until the given node is found , or until * we have looked to the given amount . * @ param support The XPath context to use * @ param numberElem The given xsl : number element . * @ param node The node to count . * @ return The node count , or 0 if not found . ...
int count = 0 ; Vector counters = getCounters ( numberElem ) ; int nCounters = counters . size ( ) ; // XPath countMatchPattern = numberElem . getCountMatchPattern ( support , node ) ; // XPath fromMatchPattern = numberElem . m _ fromMatchPattern ; int target = numberElem . getTargetNode ( support , node ) ; if ( DTM ....
public class KafkaMsgConsumer { /** * Gets a buffer to store consumed messages from a Kafka topic . * @ param topic * @ return * @ since 1.2.0 */ private BlockingQueue < ConsumerRecord < String , byte [ ] > > _getBuffer ( String topic ) { } }
BlockingQueue < ConsumerRecord < String , byte [ ] > > buffer = topicBuffers . get ( topic ) ; if ( buffer == null ) { buffer = new LinkedBlockingQueue < ConsumerRecord < String , byte [ ] > > ( ) ; BlockingQueue < ConsumerRecord < String , byte [ ] > > existingBuffer = topicBuffers . putIfAbsent ( topic , buffer ) ; i...
public class AllFilterPanel { /** * This method initializes jScrollPane * @ return javax . swing . JScrollPane */ private JScrollPane getJScrollPane ( ) { } }
if ( jScrollPane == null ) { jScrollPane = new JScrollPane ( ) ; jScrollPane . setViewportView ( getTableFilter ( ) ) ; jScrollPane . setBorder ( javax . swing . BorderFactory . createEtchedBorder ( javax . swing . border . EtchedBorder . RAISED ) ) ; jScrollPane . setEnabled ( false ) ; } return jScrollPane ;
public class SpriteSheet { /** * Get a sprite at a particular cell on the sprite sheet * @ param x The x position of the cell on the sprite sheet * @ param y The y position of the cell on the sprite sheet * @ return The single image from the sprite sheet */ public Image getSprite ( int x , int y ) { } }
target . init ( ) ; initImpl ( ) ; if ( ( x < 0 ) || ( x >= subImages . length ) ) { throw new RuntimeException ( "SubImage out of sheet bounds: " + x + "," + y ) ; } if ( ( y < 0 ) || ( y >= subImages [ 0 ] . length ) ) { throw new RuntimeException ( "SubImage out of sheet bounds: " + x + "," + y ) ; } return target ....
public class DefaultAgenda { /** * ( non - Javadoc ) * @ see org . kie . common . AgendaI # clearAgendaGroup ( java . lang . String ) */ public void clearAndCancelAgendaGroup ( final String name ) { } }
InternalAgendaGroup agendaGroup = this . agendaGroups . get ( name ) ; if ( agendaGroup != null ) { clearAndCancelAgendaGroup ( agendaGroup ) ; }
public class TemporalProcedures { /** * Format a temporal value to a String * @ param input Any temporal type * @ param format A valid DateTime format pattern ( ie yyyy - MM - dd ' T ' HH : mm : ss . SSSS ) * @ return */ @ UserFunction ( "apoc.temporal.format" ) @ Description ( "apoc.temporal.format(input, format...
try { DateTimeFormatter formatter = getOrCreate ( format ) ; if ( input instanceof LocalDate ) { return ( ( LocalDate ) input ) . format ( formatter ) ; } else if ( input instanceof ZonedDateTime ) { return ( ( ZonedDateTime ) input ) . format ( formatter ) ; } else if ( input instanceof LocalDateTime ) { return ( ( Lo...
public class DocumentRootImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setBorderColor ( String newBorderColor ) { } }
String oldBorderColor = borderColor ; borderColor = newBorderColor ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , ColorPackage . DOCUMENT_ROOT__BORDER_COLOR , oldBorderColor , borderColor ) ) ;
public class DefaultExceptionResolver { /** * { @ inheritDoc } */ public Throwable resolveException ( ObjectNode response ) { } }
ObjectNode errorObject = ObjectNode . class . cast ( response . get ( JsonRpcBasicServer . ERROR ) ) ; if ( ! hasNonNullObjectData ( errorObject , JsonRpcBasicServer . DATA ) ) return createJsonRpcClientException ( errorObject ) ; ObjectNode dataObject = ObjectNode . class . cast ( errorObject . get ( JsonRpcBasicServe...
public class DefuzzifierFactory { /** * Creates a Defuzzifier by executing the registered constructor * @ param key is the unique name by which constructors are registered * @ param resolution is the resolution of an IntegralDefuzzifier * @ param type is the type of a WeightedDefuzzifier * @ return a Defuzzifie...
Defuzzifier result = constructObject ( key ) ; if ( result instanceof IntegralDefuzzifier ) { ( ( IntegralDefuzzifier ) result ) . setResolution ( resolution ) ; } else if ( result instanceof WeightedDefuzzifier ) { ( ( WeightedDefuzzifier ) result ) . setType ( type ) ; } return result ;
public class ParsedOptions { /** * Return a version of this { @ code Option } converted to a particular type . * @ param < T > type to attempt to convert to * @ param option the option * @ return the value parsed into a particular object * @ throws OptionParserException if there are problems turning the option ...
if ( option == null ) { return null ; } String value = getValue ( option ) ; if ( value == null ) { return null ; } OptionValueType valueType = option . getValueType ( ) ; if ( valueType == OptionValueType . STRING ) { return ( T ) value ; } else if ( valueType == OptionValueType . INT ) { try { return ( T ) Integer . ...
public class ProcessEngineConfigurationImpl { public void initServices ( ) { } }
initService ( repositoryService ) ; initService ( runtimeService ) ; initService ( historyService ) ; initService ( taskService ) ; initService ( managementService ) ; initService ( dynamicBpmnService ) ;
public class PowerOfTwoFileAllocator { /** * Remove from the tree . * @ param x the item to remove . */ private Region remove ( Region x ) { } }
this . deletedNode = NULL_NODE ; this . root = remove ( x , this . root ) ; Region d = this . deletedElement ; // deletedElement is set to null to free the reference , // deletedNode is not freed as it will endup pointing to a valid node . this . deletedElement = null ; if ( d == null ) { return null ; } else { return ...
public class BigtableClusterUtilities { /** * Gets the current configuration of the cluster as encapsulated by a { @ link Cluster } object . * @ param clusterId * @ param zoneId * @ return the { @ link Cluster } if it was set . If the cluster is not found , throw a { @ link * NullPointerException } . */ public ...
Cluster response = null ; for ( Cluster cluster : getClusters ( ) . getClustersList ( ) ) { if ( cluster . getName ( ) . endsWith ( "/clusters/" + clusterId ) && cluster . getLocation ( ) . endsWith ( "/locations/" + zoneId ) ) { if ( response == null ) { response = cluster ; } else { throw new IllegalStateException ( ...
public class ClassScaner { /** * 通过过滤器 , 是否满足接受此类的条件 * @ param clazz 类 * @ return 是否接受 */ private void addIfAccept ( String className ) { } }
if ( StrUtil . isBlank ( className ) ) { return ; } int classLen = className . length ( ) ; int packageLen = this . packageName . length ( ) ; if ( classLen == packageLen ) { // 类名和包名长度一致 , 用户可能传入的包名是类名 if ( className . equals ( this . packageName ) ) { addIfAccept ( loadClass ( className ) ) ; } } else if ( classLen >...
public class AnnotationTypeFieldBuilder { /** * Build the member documentation . * @ param node the XML element that specifies which components to document * @ param memberDetailsTree the content tree to which the documentation will be added * @ throws DocletException if there is a problem while building the docu...
if ( writer == null ) { return ; } if ( hasMembersToDocument ( ) ) { writer . addAnnotationFieldDetailsMarker ( memberDetailsTree ) ; Element lastElement = members . get ( members . size ( ) - 1 ) ; for ( Element member : members ) { currentMember = member ; Content detailsTree = writer . getMemberTreeHeader ( ) ; writ...
public class CmsDbSynchronizationView { /** * Adds validators to the input fields . < p > */ protected void addValidators ( ) { } }
m_target . removeAllValidators ( ) ; m_target . addValidator ( new TargetValidator ( ) ) ; for ( Component c : m_componentsToValidate ) { if ( c instanceof CmsPathSelectField ) { ( ( CmsPathSelectField ) c ) . removeAllValidators ( ) ; ( ( CmsPathSelectField ) c ) . addValidator ( new ResourceValidator ( ) ) ; } }
public class WriterUtils { /** * Creates { @ link Path } for case { @ link WriterFilePathType # NAMESPACE _ TABLE } with configurations * { @ link ConfigurationKeys # EXTRACT _ NAMESPACE _ NAME _ KEY } and { @ link ConfigurationKeys # EXTRACT _ TABLE _ NAME _ KEY } * @ param state * @ return a path */ public stat...
Preconditions . checkArgument ( state . contains ( ConfigurationKeys . EXTRACT_NAMESPACE_NAME_KEY ) ) ; Preconditions . checkArgument ( state . contains ( ConfigurationKeys . EXTRACT_TABLE_NAME_KEY ) ) ; String namespace = state . getProp ( ConfigurationKeys . EXTRACT_NAMESPACE_NAME_KEY ) . replaceAll ( "\\." , Path . ...
public class GosuStringUtil { /** * < p > Search a String to find the first index of any * character not in the given set of characters . < / p > * < p > A < code > null < / code > String will return < code > - 1 < / code > . * A < code > null < / code > search string will return < code > - 1 < / code > . < / p >...
if ( isEmpty ( str ) || isEmpty ( searchChars ) ) { return - 1 ; } for ( int i = 0 ; i < str . length ( ) ; i ++ ) { if ( searchChars . indexOf ( str . charAt ( i ) ) < 0 ) { return i ; } } return - 1 ;
public class BpsimFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object createFromString ( EDataType eDataType , String initialValue ) { } }
switch ( eDataType . getClassifierID ( ) ) { case BpsimPackage . RESULT_TYPE : return createResultTypeFromString ( eDataType , initialValue ) ; case BpsimPackage . TIME_UNIT : return createTimeUnitFromString ( eDataType , initialValue ) ; case BpsimPackage . RESULT_TYPE_OBJECT : return createResultTypeObjectFromString ...
public class QuickResultMatcherBase { /** * { @ inheritDoc } */ @ Override public void describeMismatch ( Object item , Description description ) { } }
MatchResult . Mismatch < ? > mismatch = matchResult ( item ) . getMismatch ( ) ; if ( mismatch != null ) { mismatch . describeMismatch ( description ) ; }
public class BytesBufferHandler { /** * { @ inheritDoc } */ @ Override public int readData ( final ByteBuffer target ) { } }
final int toRead = Math . min ( target . remaining ( ) , ( int ) input . readRemaining ( ) ) ; for ( int i = 0 ; i < toRead ; i ++ ) { target . put ( input . readByte ( ) ) ; } return toRead ;
public class InternalPureXbaseParser { /** * InternalPureXbase . g : 500:1 : ruleInitialisedVariableDeclaration returns [ EObject current = null ] : ( ( ) ( ( ( lv _ writeable _ 1_0 = ' var ' ) ) | otherlv _ 2 = ' val ' ) ( ( ( ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) ) ) = > ( ( ( lv _ type _ 3_0 = ruleJvmTy...
EObject current = null ; Token lv_writeable_1_0 = null ; Token otherlv_2 = null ; Token otherlv_6 = null ; EObject lv_type_3_0 = null ; AntlrDatatypeRuleToken lv_name_4_0 = null ; AntlrDatatypeRuleToken lv_name_5_0 = null ; EObject lv_right_7_0 = null ; enterRule ( ) ; try { // InternalPureXbase . g : 506:2 : ( ( ( ) (...
public class URLCoder { /** * Encodes Java string into { @ code x - www - form - urlencoded } format * @ param plain input value * @ return encoded value * @ see URLEncoder # encode ( String , String ) */ public static String encode ( String plain ) { } }
try { return URLEncoder . encode ( plain , "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { throw new IllegalStateException ( "Unable to encode URL entry via " + ENCODING_FOR_URL + ". This should not happen" , e ) ; }
public class MediaWikiApiImpl { /** * normalize the given page title * @ param title * @ return the normalized title e . g . replacing blanks FIXME encode is not good * enough * @ throws Exception */ public String normalizeTitle ( String title ) throws Exception { } }
String result = encode ( title ) ; result = result . replace ( "+" , "_" ) ; return result ;
public class CommerceCurrencyPersistenceImpl { /** * Removes all the commerce currencies where groupId = & # 63 ; from the database . * @ param groupId the group ID */ @ Override public void removeByGroupId ( long groupId ) { } }
for ( CommerceCurrency commerceCurrency : findByGroupId ( groupId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( commerceCurrency ) ; }