signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Sort { /** * quick sort algorithm * @ param arr an array of Comparable items */ public static < T extends Comparable < ? super T > > void quicksort ( T [ ] arr ) { } }
quicksort ( arr , 0 , arr . length - 1 ) ;
public class BeanWrapperUpdater { /** * { @ inheritDoc } */ public void update ( Object target , Object value ) { } }
BeanWrapper bw = new BeanWrapperImpl ( target ) ; bw . registerCustomEditor ( Date . class , new CustomDateEditor ( new SimpleDateFormat ( "yyyy-MM-dd" ) , true ) ) ; bw . setPropertyValue ( propertyName , value ) ;
public class CmsCmisTypeManager { /** * Collects the descendants of a type . < p > * @ param depth the depth up to which the descendants should be collected * @ param tc the parent type * @ param includePropertyDefinitions true if the property definitions should be included * @ return the descendants of the typ...
TypeDefinitionContainerImpl result = new TypeDefinitionContainerImpl ( ) ; TypeDefinition type = copyTypeDefintion ( tc . getTypeDefinition ( ) ) ; if ( ! includePropertyDefinitions ) { type . getPropertyDefinitions ( ) . clear ( ) ; } result . setTypeDefinition ( type ) ; if ( depth != 0 ) { if ( tc . getChildren ( ) ...
public class EnumType { /** * Returns the constant named { @ code name } , or null if this enum has no such constant . */ public EnumConstant constant ( String name ) { } }
for ( EnumConstant constant : constants ( ) ) { if ( constant . name ( ) . equals ( name ) ) { return constant ; } } return null ;
public class StreamResourceTracker { /** * Indicate that a stream is constructed at this Location . * @ param streamOpenLocation * the Location * @ param stream * the Stream opened at this Location */ public void addStreamOpenLocation ( Location streamOpenLocation , Stream stream ) { } }
if ( FindOpenStream . DEBUG ) { System . out . println ( "Stream open location at " + streamOpenLocation ) ; } streamOpenLocationMap . put ( streamOpenLocation , stream ) ; if ( stream . isUninteresting ( ) ) { uninterestingStreamEscapeSet . add ( stream ) ; }
public class TileMapServiceInfo100 { @ Override protected void parse ( Node node ) { } }
NamedNodeMap attributes = node . getAttributes ( ) ; version = getValueRecursive ( attributes . getNamedItem ( "version" ) ) ; NodeList childNodes = node . getChildNodes ( ) ; for ( int i = 0 ; i < childNodes . getLength ( ) ; i ++ ) { Node child = childNodes . item ( i ) ; String nodeName = child . getNodeName ( ) ; i...
public class Utils { /** * Search for the given method in the given class . * @ param te Class to search into . * @ param method Method to be searched . * @ return ExecutableElement Method found , null otherwise . */ public ExecutableElement findMethod ( TypeElement te , ExecutableElement method ) { } }
for ( Element m : getMethods ( te ) ) { if ( executableMembersEqual ( method , ( ExecutableElement ) m ) ) { return ( ExecutableElement ) m ; } } return null ;
public class BaasUser { /** * Returns data associate to this user for the specific * scope as a { @ link com . baasbox . android . json . JsonObject } . * If the data is not visible to the current logged in user * returns null . * The returned { @ link com . baasbox . android . json . JsonObject } should be tre...
switch ( scope ) { case PRIVATE : return privateData ; case FRIEND : return friendVisibleData ; case REGISTERED : return registeredVisibleData ; case PUBLIC : return publicVisibleData ; default : throw new IllegalArgumentException ( "scope cannot be null" ) ; }
public class MultiLocatitionSquidCheck { /** * Add the given message to the current SourceFile object * @ see SquidAstVisitorContext < G extends Grammar > . createLineViolation ( ) for simple violations */ protected void createMultiLocationViolation ( CxxReportIssue message ) { } }
SourceFile sourceFile = getSourceFile ( ) ; Set < CxxReportIssue > messages = getMultiLocationCheckMessages ( sourceFile ) ; if ( messages == null ) { messages = new HashSet < > ( ) ; } messages . add ( message ) ; setMultiLocationViolation ( sourceFile , messages ) ;
public class LinkedWorkspaceStorageCacheImpl { /** * { @ inheritDoc } */ public void addChildNodes ( final NodeData parentData , final List < NodeData > childItems ) { } }
if ( enabled && parentData != null && childItems != null ) { String logInfo = null ; if ( LOG . isDebugEnabled ( ) ) { logInfo = "parent: " + parentData . getQPath ( ) . getAsString ( ) + " " + parentData . getIdentifier ( ) + " " + childItems . size ( ) ; LOG . debug ( name + ", addChildNodes() >>> " + logInfo ) ...
public class WindowSpecificationImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setYBWIND ( Integer newYBWIND ) { } }
Integer oldYBWIND = ybwind ; ybwind = newYBWIND ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . WINDOW_SPECIFICATION__YBWIND , oldYBWIND , ybwind ) ) ;
public class DirectoryConnection { /** * Change the Directory Authentication . * It will reopen session use the new authentication . * If failed , need to close the session . * @ param userName * @ param password */ public void setDirectoryUser ( String userName , String password ) { } }
this . authData = generateDirectoryAuthData ( userName , password ) ; if ( getStatus ( ) . isConnected ( ) ) { ErrorCode ec = sendConnectProtocol ( this . getConnectTimeOut ( ) ) ; if ( ErrorCode . SESSION_EXPIRED . equals ( ec ) ) { LOGGER . info ( "Session Expired, cleanup the client session." ) ; closeSession ( ) ; ...
public class RtfDestinationColorTable { /** * Processes the color triplet parsed from the document . * Add it to the import mapping so colors can be mapped when encountered * in the RTF import or conversion . */ private void processColor ( ) { } }
if ( red != - 1 && green != - 1 && blue != - 1 ) { if ( this . rtfParser . isImport ( ) ) { this . importHeader . importColor ( Integer . toString ( this . colorNr ) , new Color ( this . red , this . green , this . blue ) ) ; } if ( this . rtfParser . isConvert ( ) ) { colorMap . put ( Integer . toString ( this . color...
public class MultiRuntimeYarnBootstrapDriverConfigGenerator { /** * Adds yarn runtime definitions to the builder . * @ param yarnJobSubmissionParams Yarn job submission parameters * @ param jobSubmissionParameters Generic job submission parameters * @ param builder The multi runtime builder */ private void addYar...
// create and serialize yarn configuration if defined final Configuration yarnDriverConfiguration = createYarnConfiguration ( yarnJobSubmissionParams , jobSubmissionParameters ) ; // add yarn runtime to the builder builder . addRuntime ( yarnDriverConfiguration , RuntimeIdentifier . RUNTIME_NAME ) ;
public class EntryStream { /** * Returns an { @ code EntryStream } consisting of the entries whose values are * results of replacing source values with the contents of a mapped stream * produced by applying the provided mapping function to each source value * and keys are left intact . Each mapped stream is * {...
return new EntryStream < > ( stream ( ) . flatMap ( e -> withKey ( e . getKey ( ) , mapper . apply ( e . getValue ( ) ) ) ) , context ) ;
public class ClassSourceFactory { /** * Create a class - source from the given source . */ public ClassSource create ( final String source ) { } }
checkNotNull ( source ) ; String trimmed = source . trim ( ) ; log . trace ( "Creating class-source from: {}" , trimmed ) ; // First try and parse the source as a URL try { return new ClassSourceImpl ( new URL ( trimmed ) , null , null ) ; } catch ( MalformedURLException e ) { log . trace ( "Not a URL" , e ) ; } // FIX...
public class Matrix4x3f { /** * Apply an orthographic projection transformation for a left - handed coordinate system to this matrix and store the result in < code > dest < / code > . * This method is equivalent to calling { @ link # orthoLH ( float , float , float , float , float , float , Matrix4x3f ) orthoLH ( ) }...
// calculate right matrix elements float rm00 = 2.0f / ( right - left ) ; float rm11 = 2.0f / ( top - bottom ) ; float rm30 = - ( right + left ) / ( right - left ) ; float rm31 = - ( top + bottom ) / ( top - bottom ) ; // perform optimized multiplication // compute the last column first , because other columns do not d...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link CodeType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link CodeType } { @ code > } */ @ XmlElement...
return new JAXBElement < CodeType > ( _MeasureDescription_QNAME , CodeType . class , null , value ) ;
public class SipPhone { /** * This method is the same as addBuddy ( uri , duration , eventId , timeout ) except that the duration * is defaulted to the default period defined in the event package RFC ( 3600 seconds ) and no event * " id " parameter will be included . * @ param uri the URI ( ie , sip : bob @ nist ...
return addBuddy ( uri , DEFAULT_SUBSCRIBE_DURATION , null , timeout ) ;
public class StreamMessageImpl { /** * ( non - Javadoc ) * @ see javax . jms . StreamMessage # internalReadObject ( ) */ public Object internalReadObject ( ) throws JMSException { } }
if ( ! bodyIsReadOnly ) throw new MessageNotReadableException ( "Message body is write only" ) ; if ( readPos >= body . size ( ) ) throw new MessageEOFException ( "End of stream reached" ) ; if ( currentByteInputStream != null ) throw new MessageFormatException ( "Cannot read another object before the end of the byte a...
public class AbstractLocation { /** * Reverses and ( if possible ) complements the Sequence so as to represent * the reverse strand ( if one exists ) . Also does checking to see if the * location we are on is on the reverse strand or not . */ @ SuppressWarnings ( "unchecked" ) protected < C extends Compound > Seque...
if ( getStrand ( ) != Strand . NEGATIVE ) { return sequence ; } Sequence < C > reversed = new ReversedSequenceView < C > ( sequence ) ; // " safe " operation as we have tried to check this if ( canComplement ( sequence ) ) { Sequence < ComplementCompound > casted = ( Sequence < ComplementCompound > ) reversed ; Complem...
public class AbstractInputParser { /** * buildCommandLine . * @ param out a { @ link java . lang . StringBuilder } object . * @ param depth a { @ link java . util . List } object . * @ param line a { @ link java . util . List } object . * @ param value a { @ link java . lang . String } object . */ protected voi...
for ( int n = 0 ; n < line . size ( ) ; n ++ ) { if ( depth . size ( ) <= n ) { /* * This is a new command */ depth . add ( line . get ( n ) ) ; /* * an empty keyword means a positional parameter */ if ( line . get ( n ) . key . length ( ) > 0 ) out . append ( "--" + line . get ( n ) . key ) ; /* * if the depth so far ...
public class Document { /** * Signals that an new page has to be started . * @ return < CODE > true < / CODE > if the page was added , < CODE > false < / CODE > * if not . */ public boolean newPage ( ) { } }
if ( ! open || close ) { return false ; } DocListener listener ; for ( Iterator iterator = listeners . iterator ( ) ; iterator . hasNext ( ) ; ) { listener = ( DocListener ) iterator . next ( ) ; listener . newPage ( ) ; } return true ;
public class StreamingGeometryGenerator { /** * Pretty sure this is working correctly */ @ SuppressWarnings ( "unchecked" ) public double [ ] placement3DToMatrix ( AbstractHashMapVirtualObject ifcAxis2Placement3D ) { } }
EReference refDirectionFeature = packageMetaData . getEReference ( "IfcAxis2Placement3D" , "RefDirection" ) ; AbstractHashMapVirtualObject location = ifcAxis2Placement3D . getDirectFeature ( packageMetaData . getEReference ( "IfcPlacement" , "Location" ) ) ; if ( ifcAxis2Placement3D . getDirectFeature ( packageMetaData...
public class HttpUrlHelper { /** * According to inline comment in { @ link okhttp3 . HttpUrl . Builder # parse ( HttpUrl base , String input ) } : * < blockquote > * Username , password and port are optional . * [ username [ : password ] @ ] host [ : port ] * < / blockquote > * This function replaces the char...
String username = parsedUrl . username ( ) ; String password = parsedUrl . password ( ) ; if ( username . isEmpty ( ) && password . isEmpty ( ) ) { return originalUrl ; } if ( ! username . isEmpty ( ) && ! password . isEmpty ( ) ) { String encodedUsername = parsedUrl . encodedUsername ( ) ; String encodedPassword = par...
public class SignalRsInner { /** * Create a new SignalR service and update an exiting SignalR service . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param resourceName The name of the SignalR...
return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( resourceGroupName , resourceName , parameters ) , serviceCallback ) ;
public class StringDataStore { /** * Stores string data and returns a token by which that data can be retrieved * @ param cookieData serialized cookie data * @ return alphanumeric token value by which data can be retrieved */ public String storeData ( String cookieData ) { } }
try { String token = generateToken ( ) ; ensureSpaceExists ( ) ; s3StorageProvider . addHiddenContent ( this . hiddenSpaceName , token , Constants . MEDIA_TYPE_APPLICATION_JSON , IOUtil . writeStringToStream ( cookieData ) ) ; return token ; } catch ( Exception e ) { throw new DuraCloudRuntimeException ( e ) ; }
public class DurationDatatype { /** * Returns the total number of months specified by the year and month fields of the duration */ private static BigInteger computeMonths ( Duration d ) { } }
return d . getYears ( ) . multiply ( BigInteger . valueOf ( 12 ) ) . add ( d . getMonths ( ) ) ;
public class TokenStream { /** * Attempt to consume the next token if it matches one of the supplied values . * @ param options the options for the value of the current token * @ return true if the current token ' s value did match one of the suplied options , or false otherwise * @ throws IllegalStateException i...
if ( completed ) return false ; for ( String option : options ) { if ( canConsume ( option ) ) return true ; } return false ;
public class CSVParser { /** * Parses an incoming String and returns an array of elements . This method is * used when the data spans multiple lines . * @ param sNextLine * current line to be processed * @ return the tokenized list of elements , or < code > null < / code > if nextLine is * < code > null < / c...
return _parseLine ( sNextLine , true ) ;
public class ModelsHandler { /** * TODO : almost identical to ModelsHandler ; refactor */ public static Model getFromDKV ( String param_name , String key_str ) { } }
return getFromDKV ( param_name , Key . make ( key_str ) ) ;
public class FacebookRestClient { /** * Retrieves the user ID of the user logged in to this API session * @ return the Facebook user ID of the logged - in user */ public int users_getLoggedInUser ( ) throws FacebookException , IOException { } }
T result = this . callMethod ( FacebookMethod . USERS_GET_LOGGED_IN_USER ) ; return extractInt ( result ) ;
public class UtlInvLine { /** * < p > adjust invoice lines and Update its totals after tax line has * been changed ( Invoice basis ) . < / p > * @ param pReqVars additional param * @ param pInv Invoice * @ param pAs accounting settings * @ param pTxRules not NULL * @ throws Exception - an exception */ publi...
List < SalesInvoiceServiceLine > txdLns = this . utlInvBase . retrTxdLnsAdjInv ( pReqVars , pInv , pAs , pTxRules , this . invTxMeth ) ; this . utlInvBase . adjustInvoiceLns ( pReqVars , pInv , txdLns , pAs , this . invTxMeth ) ; this . utlInvBase . updInvTots ( pReqVars , pInv , pAs , this . invTxMeth ) ;
public class MPOImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . MPO__RG : return rg != null && ! rg . isEmpty ( ) ; } return super . eIsSet ( featureID ) ;
public class FilterImpl { /** * Wraps the filter in FilterImpl * @ param path the path * @ param filter the filter * @ return the wrapped route */ static FilterImpl create ( final String path , final Filter filter ) { } }
return create ( path , DEFAULT_ACCEPT_TYPE , filter ) ;
public class StorageConfiguration { /** * Serializing a { @ link StorageConfiguration } to a json file . * @ param pConfig * to be serialized * @ throws TTIOException */ public static void serialize ( final StorageConfiguration pConfig ) throws TTIOException { } }
try { FileWriter fileWriter = new FileWriter ( new File ( pConfig . mFile , Paths . ConfigBinary . getFile ( ) . getName ( ) ) ) ; JsonWriter jsonWriter = new JsonWriter ( fileWriter ) ; jsonWriter . beginObject ( ) ; jsonWriter . name ( "file" ) . value ( pConfig . mFile . getAbsolutePath ( ) ) ; jsonWriter . endObjec...
public class Canny { /** * private utility methods */ private void initArrays ( ) { } }
if ( data == null || picsize != data . length ) { data = new int [ picsize ] ; magnitude = new int [ picsize ] ; xConv = new float [ picsize ] ; yConv = new float [ picsize ] ; xGradient = new float [ picsize ] ; yGradient = new float [ picsize ] ; }
public class ReasonerQueries { /** * create an atomic query by combining an existing atomic query and a substitution * @ param q base query for substitution to be attached * @ param sub ( partial ) substitution * @ return atomic query with the substitution contained in the query */ public static ReasonerAtomicQue...
return q . withSubstitution ( sub ) . inferTypes ( ) ;
public class HoconTreeTraversingParser { /** * public byte getByteValue ( ) throws IOException , JsonParseException */ @ Override public NumberType getNumberType ( ) throws IOException , JsonParseException { } }
ConfigValue n = currentNumericNode ( ) ; if ( n == null ) return null ; Number value = ( Number ) n . unwrapped ( ) ; if ( value instanceof Double ) { return NumberType . DOUBLE ; } else if ( value instanceof Long ) { return NumberType . LONG ; } else { return NumberType . INT ; }
public class CharPredicates { /** * A { @ link CharPredicate } that returns true if both { @ code predicate1 } and * { @ code predicate2 } evaluates to true . */ public static CharPredicate and ( final CharPredicate predicate1 , final CharPredicate predicate2 ) { } }
return new CharPredicate ( ) { @ Override public boolean isChar ( char c ) { return predicate1 . isChar ( c ) && predicate2 . isChar ( c ) ; } @ Override public String toString ( ) { return predicate1 + " and " + predicate2 ; } } ;
public class JspTranslatorUtil { /** * PM12828 - need to account for a case where type is [ Lcom . ibm . sample . TagsAttr ; */ public static Class toClass ( String type , ClassLoader loader ) throws ClassNotFoundException { } }
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINER ) ) { logger . logp ( Level . FINER , CLASS_NAME , "toClass(String, ClassLoader)" , " type= [" + type + "] loader= [" + loader + "]" ) ; } Class c = null ; int i0 = type . indexOf ( '[' ) ; int dims = 0 ; if ( i...
public class QrStructuralCounts_DSCC { /** * Computes leftmost [ i ] = min ( find ( A [ i , : ) ) * @ param leftmost ( output ) storage for left most elements */ void findMinElementIndexInRows ( int leftmost [ ] ) { } }
Arrays . fill ( leftmost , 0 , m , - 1 ) ; // leftmost [ i ] = min ( find ( A ( i , : ) ) ) for ( int k = n - 1 ; k >= 0 ; k -- ) { int idx0 = A . col_idx [ k ] ; int idx1 = A . col_idx [ k + 1 ] ; for ( int p = idx0 ; p < idx1 ; p ++ ) { leftmost [ A . nz_rows [ p ] ] = k ; } }
public class Env { /** * Copy from display offset d , nth slot */ void push_slot ( int d , int n ) { } }
assert d == 0 ; // Should use a fcn ' s closure for d > 1 int idx = _display [ _tod - d ] + n ; push ( 1 ) ; _ary [ _sp - 1 ] = addRef ( _ary [ idx ] ) ; _d [ _sp - 1 ] = _d [ idx ] ; _fcn [ _sp - 1 ] = addRef ( _fcn [ idx ] ) ; _str [ _sp - 1 ] = _str [ idx ] ; assert _ary [ 0 ] == null || check_refcnt ( _ary [ 0 ] . ...
public class SlotProfile { /** * Returns a slot profile for the given resource profile and the prior allocations . * @ param resourceProfile specifying the slot requirements * @ param priorAllocations specifying the prior allocations * @ return Slot profile with the given resource profile and prior allocations */...
return new SlotProfile ( resourceProfile , Collections . emptyList ( ) , priorAllocations ) ;
public class Collections { /** * Filter an { @ link Iterable } using { @ link Filter } s and return a new { @ link Iterable } . * { @ link Filter } s are applied in given order on each element from source collection . < br / > * The returned collection contain all the source elements accepted by at least one { @ li...
if ( Arrays . isEmpty ( filters ) ) { List < T > copy = new ArrayList < T > ( ) ; for ( T each : list ) { copy . add ( each ) ; } return copy ; } return filterToList ( list , filters ) ;
public class PolicyExecutorImpl { /** * Because this method is timed , tasks will never run on the invoker ' s current thread . */ @ Override @ FFDCIgnore ( value = { } }
RejectedExecutionException . class } ) public < T > T invokeAny ( Collection < ? extends Callable < T > > tasks , PolicyTaskCallback [ ] callbacks , long timeout , TimeUnit unit ) throws InterruptedException , ExecutionException , TimeoutException { int taskCount = tasks . size ( ) ; long stop = System . nanoTime ( ) +...
public class FieldErrorBuilder { /** * { @ link FieldError } のインスタンスを組み立てる 。 * @ return { @ link FieldError } のインスタンス */ public FieldError build ( ) { } }
final FieldError error = new FieldError ( objectName , field , conversionFailure , codes , variables ) ; error . setDefaultMessage ( defaultMessage ) ; error . setSheetName ( sheetName ) ; error . setLabel ( label ) ; error . setRejectedValue ( rejectedValue ) ; error . setAddress ( address ) ; return error ;
public class HttpServer { /** * Define routes for the server through the provided { @ link HttpServerRoutes } builder . * @ param routesBuilder provides a route builder to be mutated in order to define routes . * @ return a new { @ link HttpServer } starting the router on subscribe */ public final HttpServer route ...
Objects . requireNonNull ( routesBuilder , "routeBuilder" ) ; HttpServerRoutes routes = HttpServerRoutes . newRoutes ( ) ; routesBuilder . accept ( routes ) ; return handle ( routes ) ;
public class AttributeValidator { /** * Validate whether the attribute names defined by the orderBy attribute point to existing * attributes in the referenced entity . * @ param attr attribute * @ param orderBy orderBy of attribute * @ throws MolgenisDataException if orderBy contains attribute names that do not...
if ( orderBy != null ) { EntityType refEntity = attr . getRefEntity ( ) ; if ( refEntity != null ) { for ( Sort . Order orderClause : orderBy ) { String refAttrName = orderClause . getAttr ( ) ; if ( refEntity . getAttribute ( refAttrName ) == null ) { throw new MolgenisDataException ( format ( "Unknown entity [%s] att...
public class Rapids { /** * Parse a Rapids expression string into an Abstract Syntax Tree object . * @ param rapids expression to parse */ public static AstRoot parse ( String rapids ) { } }
Rapids r = new Rapids ( rapids ) ; AstRoot res = r . parseNext ( ) ; if ( r . skipWS ( ) != ' ' ) throw new IllegalASTException ( "Syntax error: illegal Rapids expression `" + rapids + "`" ) ; return res ;
public class FTPProtocolHandler { /** * { @ inheritDoc } */ @ Override public File downloadResource ( String namespace , String namespaceDownloadLocation ) throws ResourceDownloadError { } }
try { URL ftpNamespaceUrl = new URL ( namespace ) ; ftpConnector . connectAndLogin ( ftpNamespaceUrl ) ; String filePath = ftpNamespaceUrl . getFile ( ) . substring ( 1 ) ; // remove leading ' / ' since it ' s merely a delimiter in the ftp url specification . ftpConnector . retrieveFile ( filePath , namespaceDownloadLo...
public class ObjectUtils { /** * This is a utility method for getting raw objects that may have been proxied . It is intended to be used in cases * where raw implementations are needed rather than working with interfaces which they implement . * @ param bean * the potential proxy . * @ param recursive * wheth...
Assert . notNull ( recursive , "recursive" ) ; Object unwrapped = bean ; // If the given object is a proxy , set the return value as the object being proxied , otherwise return the given // object if ( ( bean != null ) && ( bean instanceof Advised ) && ( AopUtils . isAopProxy ( bean ) ) ) { final Advised advised = ( Ad...
public class XMLUpdateShredder { /** * Add a new text node . * @ param paramAdd * determines how to add the node * @ param paramTextEvent * the current { @ link Character } event from the StAX parser . * @ throws TTException * if adding text node fails */ private void addNewText ( final EAdd paramAdd , fina...
assert paramTextEvent != null ; final String text = paramTextEvent . getData ( ) . trim ( ) ; final ByteBuffer textByteBuffer = ByteBuffer . wrap ( TypedValue . getBytes ( text ) ) ; if ( textByteBuffer . array ( ) . length > 0 ) { if ( paramAdd == EAdd . ASFIRSTCHILD ) { mWtx . insertTextAsFirstChild ( new String ( te...
public class SarlBatchCompiler { /** * Replies the message for the given issue . * @ param issue the issue . * @ param uri URI to the problem . * @ param message the formatted message . * @ since 0.6 */ private void notifiesIssueMessageListeners ( Issue issue , org . eclipse . emf . common . util . URI uri , St...
for ( final IssueMessageListener listener : this . messageListeners ) { listener . onIssue ( issue , uri , message ) ; }
public class Barcode39 { /** * Places the barcode in a < CODE > PdfContentByte < / CODE > . The * barcode is always placed at coordinates ( 0 , 0 ) . Use the * translation matrix to move it elsewhere . < p > * The bars and text are written in the following colors : < p > * < P > < TABLE BORDER = 1 > * < TR > ...
String fullCode = code ; float fontX = 0 ; String bCode = code ; if ( extended ) bCode = getCode39Ex ( code ) ; if ( font != null ) { if ( generateChecksum && checksumText ) fullCode += getChecksum ( bCode ) ; if ( startStopText ) fullCode = "*" + fullCode + "*" ; fontX = font . getWidthPoint ( fullCode = altText != nu...
public class FilePublisher { /** * Registers a { @ link FileSubscriber } with a { @ link ReloadableFile } . So when the { @ code reloadableFile } is reloaded , * the fileSubscriber will be notified . Multiple file subscribers can be registered with the same reloadable file . * @ param reloadableFile the reloadable ...
IdentificationSet < FileSubscriber > subscribers = fileSubscribers . get ( reloadableFile ) ; if ( subscribers == null ) { subscribers = new IdentificationSet < > ( false ) ; fileSubscribers . put ( reloadableFile , subscribers ) ; } subscribers . add ( fileSubscriber , identification ) ;
public class TableWorks { /** * Drops constriants and their indexes in table . Uses set of names . */ void makeNewTable ( OrderedHashSet dropConstraintSet , OrderedHashSet dropIndexSet ) { } }
Table tn = table . moveDefinition ( session , table . tableType , null , null , null , - 1 , 0 , dropConstraintSet , dropIndexSet ) ; if ( tn . indexList . length == table . indexList . length ) { database . persistentStoreCollection . releaseStore ( tn ) ; return ; } tn . moveData ( session , table , - 1 , 0 ) ; datab...
public class PeerToPeerService { /** * - - - - - private methods - - - - - */ private SecurityContext getUserContext ( final RepositoryObject obj ) { } }
final String userId = obj . getUserId ( ) ; Principal principal = null ; if ( userId != null ) { final App app = StructrApp . getInstance ( ) ; try ( final Tx tx = app . tx ( ) ) { // TODO : change this , userId is currently the name of a user , // WITHOUT ANY AUTHENTICATION . principal = app . nodeQuery ( Principal . ...
public class DOMContext { /** * breaks the nodeId reference . */ public void setCurrentFrame ( RemoteWebElement iframe , RemoteWebElement document , RemoteWebElement window ) { } }
this . iframe = iframe ; this . document = document ; this . window = window ; if ( iframe != null ) { isOnMainFrame = false ; } else { isOnMainFrame = true ; } // switchToDefaultContent . revert to main document if it was set . if ( iframe == null && document == null ) { this . document = mainDocument ; this . window ...
public class HttpRequestParser { /** * Parses a path value * @ param buffer The buffer * @ param state The current state * @ param exchange The exchange builder * @ return The number of bytes remaining */ @ SuppressWarnings ( "unused" ) final void handleQueryParameters ( ByteBuffer buffer , ParseState state , H...
StringBuilder stringBuilder = state . stringBuilder ; int queryParamPos = state . pos ; int mapCount = state . mapCount ; boolean urlDecodeRequired = state . urlDecodeRequired ; String nextQueryParam = state . nextQueryParam ; // so this is a bit funky , because it not only deals with parsing , but // also deals with U...
public class DirectoryLookupService { /** * Get the ModelServiceInstance by serviceName and instanceAddress . * @ param serviceName the service name . * @ param instanceAddress the instanceAddress . * @ return the ModelServiceInstance . * @ since 1.2 */ public ModelServiceInstance getModelServiceInstanceByAddre...
ModelService service = getModelService ( serviceName ) ; if ( service != null && service . getServiceInstances ( ) != null ) { for ( ModelServiceInstance instance : service . getServiceInstances ( ) ) { if ( instance . getAddress ( ) . equals ( instanceAddress ) ) { return instance ; } } } return null ;
public class DateTimeFormatterBuilder { /** * Instructs the printer to emit text and numbers to display time zone * offset from UTC . A parser will use the parsed time zone offset to adjust * the datetime . * If zero offset print text is supplied , then it will be printed when the zone is zero . * If zero offse...
return append0 ( new TimeZoneOffset ( zeroOffsetPrintText , zeroOffsetParseText , showSeparators , minFields , maxFields ) ) ;
public class Validator { /** * 验证是否为生日 < br > * 只支持以下几种格式 : * < ul > * < li > yyyyMMdd < / li > * < li > yyyy - MM - dd < / li > * < li > yyyy / MM / dd < / li > * < li > yyyyMMdd < / li > * < li > yyyy年MM月dd日 < / li > * < / ul > * @ param value 值 * @ return 是否为生日 */ public static boolean isBirthday...
if ( isMactchRegex ( BIRTHDAY , value ) ) { Matcher matcher = BIRTHDAY . matcher ( value ) ; if ( matcher . find ( ) ) { int year = Integer . parseInt ( matcher . group ( 1 ) ) ; int month = Integer . parseInt ( matcher . group ( 3 ) ) ; int day = Integer . parseInt ( matcher . group ( 5 ) ) ; return isBirthday ( year ...
public class TypeUtil { /** * Parse an int from a substring . * Negative numbers are not handled . * @ param s String * @ param offset Offset within string * @ param length Length of integer or - 1 for remainder of string * @ param base base of the integer * @ return the parsed integer * @ throws NumberFo...
int value = 0 ; if ( length < 0 ) { length = s . length ( ) - offset ; } for ( int i = 0 ; i < length ; i ++ ) { char c = s . charAt ( offset + i ) ; int digit = convertHexDigit ( ( int ) c ) ; if ( digit < 0 || digit >= base ) { throw new NumberFormatException ( s . substring ( offset , offset + length ) ) ; } value =...
public class GeometryTools { /** * Scales a molecule such that it fills a given percentage of a given * dimension . * See comment for center ( IAtomContainer atomCon , Dimension areaDim , HashMap renderingCoordinates ) for details on coordinate sets * @ param atomCon The molecule to be scaled * @ param areaDim ...
Dimension molDim = get2DDimension ( atomCon ) ; double widthFactor = ( double ) areaDim . width / ( double ) molDim . width ; double heightFactor = ( double ) areaDim . height / ( double ) molDim . height ; double scaleFactor = Math . min ( widthFactor , heightFactor ) * fillFactor ; scaleMolecule ( atomCon , scaleFact...
public class Skip32 { /** * Encrypts the provided value using the specified key * The key should be a byte array of 10 elements . * @ param value * @ param key * @ return The encrypted value */ public static int encrypt ( int value , byte [ ] key ) { } }
int [ ] buf = new int [ 4 ] ; buf [ 0 ] = ( ( value >> 24 ) & 0xff ) ; buf [ 1 ] = ( ( value >> 16 ) & 0xff ) ; buf [ 2 ] = ( ( value >> 8 ) & 0xff ) ; buf [ 3 ] = ( ( value >> 0 ) & 0xff ) ; skip32 ( key , buf , true ) ; int out = ( ( buf [ 0 ] ) << 24 ) | ( ( buf [ 1 ] ) << 16 ) | ( ( buf [ 2 ] ) << 8 ) | ( buf [ 3 ]...
public class BaseHttpTask { /** * Clean - up the param string */ public static String cleanParam ( String [ ] strParams , boolean bSetDefault , String strDefault ) { } }
if ( ( strParams == null ) || ( strParams . length == 0 ) ) strParams = new String [ 1 ] ; if ( strParams [ 0 ] == null ) if ( bSetDefault ) strParams [ 0 ] = strDefault ; if ( strParams [ 0 ] == null ) return null ; try { return URLDecoder . decode ( strParams [ 0 ] , DBConstants . URL_ENCODING ) ; } catch ( java . io...
public class TephraHBaseUtils { /** * Gets a Record based on information passed . * @ param tableName * to do the get . * @ param id * of the Record needed * @ throws IOException */ @ Override public Record get ( final String tableName , final URI id ) throws IOException { } }
logger . debug ( "TEPHRA Begin of get(" + tableName + ", " + id + ")" ) ; final TransactionAwareHTable txTable = ( TransactionAwareHTable ) getTable ( tableName ) ; Record resGotten = null ; if ( txTable != null ) { // Resource ' s Key final Get get = new Get ( Bytes . toBytes ( id . toString ( ) ) ) . setMaxVersions (...
public class BaseDataJsonFieldBo { /** * Get a " data " ' s sub - attribute using d - path . * @ param dPath * @ return * @ see DPathUtils */ public JsonNode getDataAttr ( String dPath ) { } }
Lock lock = lockForRead ( ) ; try { return DPathUtils . getValue ( dataJson , dPath ) ; } finally { lock . unlock ( ) ; }
public class Graphics { /** * Reset the line width in use to the default for this graphics context */ public void resetLineWidth ( ) { } }
predraw ( ) ; Renderer . getLineStripRenderer ( ) . setWidth ( 1.0f ) ; GL . glLineWidth ( 1.0f ) ; GL . glPointSize ( 1.0f ) ; postdraw ( ) ;
public class Scanners { /** * A scanner for a non - nestable block comment that starts with { @ code begin } and ends with * { @ code end } . * @ param begin begins a block comment * @ param end ends a block comment * @ param commented the commented pattern . * @ return the Scanner for the block comment . */ ...
return Parsers . sequence ( begin , end . not ( ) . next ( commented ) . skipMany ( ) , end ) ;
public class ModelSqlUtils { /** * 从对象中获取update语句 * @ param po * @ return * @ throws Exception */ public static SqlParamsPairs getUpdateFromObject ( Object po ) throws Exception { } }
// 用来存放insert语句 StringBuffer updateSql = new StringBuffer ( ) ; // 用来存放where语句 StringBuffer whereSql = new StringBuffer ( ) ; // 用来存放参数值 List < Object > params = new ArrayList < Object > ( ) ; // 用来存储id Object idValue = null ; // 分析表名 String tableName = getTableName ( po . getClass ( ) ) ; updateSql . append ( "update ...
public class BundleClassResolverHelper { /** * Register class resolver . */ public final void register ( ) { } }
synchronized ( lock ) { if ( serviceRegistration == null ) { BundleClassResolver resolver = new BundleClassResolver ( ) ; serviceRegistration = bundleContext . registerService ( SERVICE_NAMES , resolver , serviceProperties ) ; } }
public class LocalTime { /** * Returns a copy of this time with the specified period added . * If the addition is zero , then < code > this < / code > is returned . * This method is typically used to add multiple copies of complex * period instances . Adding one field is best achieved using methods * like { @ l...
if ( period == null || scalar == 0 ) { return this ; } long instant = getChronology ( ) . add ( period , getLocalMillis ( ) , scalar ) ; return withLocalMillis ( instant ) ;
public class TimecodeBuilder { /** * Constructs a Timecode instance with the fields defined in this builder * @ return * @ throws IllegalArgumentException * if any of the fields are invalid / incompatible */ public Timecode build ( ) { } }
// If drop - frame is not specified ( and timebase is drop frame capable ) default to true final boolean dropFrame = ( this . dropFrame != null ) ? this . dropFrame . booleanValue ( ) : getRate ( ) . canBeDropFrame ( ) ; return new Timecode ( negative , days , hours , minutes , seconds , frames , rate , dropFrame ) ;
public class GeneratorUtils { /** * PK65013 - already know if this isTagFile or not and pageContextVar is set accordingly */ public static void generateLocalVariables ( JavaCodeWriter out , Element jspElement , String pageContextVar ) throws JspCoreException { } }
if ( hasUseBean ( jspElement ) ) { out . println ( "HttpSession session = " + pageContextVar + ".getSession();" ) ; out . println ( "ServletContext application = " + pageContextVar + ".getServletContext();" ) ; } if ( hasUseBean ( jspElement ) || hasIncludeAction ( jspElement ) || hasSetProperty ( jspElement ) || hasFo...
public class AnnotationsClassLoader { /** * Find the resource with the given name . A resource is some data * ( images , audio , text , etc . ) that can be accessed by class code in a * way that is independent of the location of the code . The name of a * resource is a " / " - separated path name that identifies ...
if ( log . isDebugEnabled ( ) ) log . debug ( "getResource(" + name + ")" ) ; URL url = null ; // (1 ) Delegate to parent if requested if ( delegate ) { if ( log . isDebugEnabled ( ) ) log . debug ( " Delegating to parent classloader " + parent ) ; ClassLoader loader = parent ; if ( loader == null ) loader = system ; ...
public class FSABuilder { /** * Lexicographic order of input sequences . By default , consistent with the " C " * sort ( absolute value of bytes , 0-255 ) . */ private static int compare ( byte [ ] s1 , int start1 , int lens1 , byte [ ] s2 , int start2 , int lens2 ) { } }
final int max = Math . min ( lens1 , lens2 ) ; for ( int i = 0 ; i < max ; i ++ ) { final byte c1 = s1 [ start1 ++ ] ; final byte c2 = s2 [ start2 ++ ] ; if ( c1 != c2 ) return ( c1 & 0xff ) - ( c2 & 0xff ) ; } return lens1 - lens2 ;
public class Lexer { /** * make it return nameEnd ! */ private final int fetchNameForNoNamedGroup ( int startCode , boolean ref ) { } }
int src = p ; value = 0 ; int sign = 1 ; int endCode = nameEndCodePoint ( startCode ) ; int pnumHead = p ; int nameEnd = stop ; String err = null ; if ( ! left ( ) ) { newValueException ( EMPTY_GROUP_NAME ) ; } else { fetch ( ) ; if ( c == endCode ) newValueException ( EMPTY_GROUP_NAME ) ; if ( enc . isDigit ( c ) ) { ...
public class SelectListClauseParser { /** * TODO : panjuan parse distinct column name */ private String getDistinctColumnName ( final String innerExpression ) { } }
Pattern pattern = Pattern . compile ( "\\(\\s*DISTINCT\\s+(\\S+)\\s*\\)" , Pattern . CASE_INSENSITIVE ) ; Matcher matcher = pattern . matcher ( innerExpression ) ; String result = "" ; if ( matcher . find ( ) ) { result = matcher . group ( 1 ) ; } return result ;
public class Assembler { /** * ge succeeds if and only if value1 & gt ; = value2 * < p > Stack : . . . , value1 , value2 = & gt ; . . . * @ param type * @ param target * @ throws IOException */ public void if_tcmpge ( TypeMirror type , String target ) throws IOException { } }
pushType ( type ) ; if_tcmpge ( target ) ; popType ( ) ;
public class TransferDb { /** * Method declaration * @ param type * @ param r * @ param p * @ throws SQLException */ private void transferRow ( TransferResultSet r , PreparedStatement p , int len , int [ ] types ) throws DataAccessPointException , SQLException { } }
for ( int i = 1 ; i <= len ; i ++ ) { int t = types [ i ] ; Object o = r . getObject ( i ) ; if ( o == null ) { if ( p != null ) { p . setNull ( i , t ) ; } } else { o = helper . convertColumnValue ( o , i , t ) ; p . setObject ( i , o ) ; } } if ( p != null ) { p . execute ( ) ; }
public class Util { /** * Creates a filtered sublist . * @ since 1.176 */ @ Nonnull public static < T > List < T > filter ( @ Nonnull Iterable < ? > base , @ Nonnull Class < T > type ) { } }
List < T > r = new ArrayList < > ( ) ; for ( Object i : base ) { if ( type . isInstance ( i ) ) r . add ( type . cast ( i ) ) ; } return r ;
public class GrammaticalStructure { /** * Returns all the dependencies of a certain node . * @ param node The node to return dependents for * @ return map of dependencies */ private static Map < Class < ? extends CoreAnnotation > , Set < TreeGraphNode > > getAllDependents ( TreeGraphNode node ) { } }
Map < Class < ? extends CoreAnnotation > , Set < TreeGraphNode > > newMap = Generics . newHashMap ( ) ; for ( Class < ? > o : node . label . keySet ( ) ) { try { // The line below will exception unless it ' s a GrammaticalRelationAnnotation , // so the effect is that only the GrammaticalRelationAnnotation things get pu...
public class KeyState { /** * Returns the Glass window on which this event state is located . */ MonocleWindow getWindow ( boolean recalculateCache ) { } }
if ( window == null || recalculateCache ) { window = ( MonocleWindow ) MonocleWindowManager . getInstance ( ) . getFocusedWindow ( ) ; } return window ;
public class Histogram { /** * Find the a value < em > n < / em > such that the percentile falls within [ * < em > n < / em > , < em > n + step < / em > ) . This method does a < em > LINEAR < / em > probe * of the histogram . I . e . , this method is O ( nBuckets ) . * @ param quantile The percentile to find * ...
resetIfNeeded ( ) ; int total = 0 ; for ( int i = 0 ; i < nBuckets ; i ++ ) { total += buckets [ i ] ; double currQuantile = ( ( double ) total ) / ( ( double ) size ) ; if ( currQuantile >= quantile ) { return i * step ; } } return 0 ;
public class ThreadLocalProxyCopyOnWriteArrayList { /** * Returns < tt > true < / tt > if this list contains the specified element . * More formally , returns < tt > true < / tt > if and only if this list contains * at least one element < tt > e < / tt > such that * < tt > ( o = = null & nbsp ; ? & nbsp ; e = = n...
Object [ ] elements = getArray ( ) ; return indexOf ( o , elements , 0 , elements . length ) >= 0 ;
public class FilteredBreakIteratorBuilder { /** * Construct a FilteredBreakIteratorBuilder based on rules in a locale . * The rules are taken from CLDR exception data for the locale , * see http : / / www . unicode . org / reports / tr35 / tr35 - general . html # Segmentation _ Exceptions * This is the equivalent...
FilteredBreakIteratorBuilder ret = new SimpleFilteredSentenceBreakIterator . Builder ( where ) ; return ret ;
public class Member { /** * Tasks and Tests owned by this member . * @ param filter Filter for Tasks and Tests . * @ return Collection of bases of a Tasks or Tests in the VersionOne System . */ public Collection < SecondaryWorkitem > getOwnedSecondaryWorkitems ( SecondaryWorkitemFilter filter ) { } }
filter = ( filter != null ) ? filter : new SecondaryWorkitemFilter ( ) ; filter . owners . clear ( ) ; filter . owners . add ( this ) ; return getInstance ( ) . get ( ) . secondaryWorkitems ( filter ) ;
public class vrid6_nsip_binding { /** * Use this API to fetch vrid6 _ nsip _ binding resources of given name . */ public static vrid6_nsip_binding [ ] get ( nitro_service service , Long id ) throws Exception { } }
vrid6_nsip_binding obj = new vrid6_nsip_binding ( ) ; obj . set_id ( id ) ; vrid6_nsip_binding response [ ] = ( vrid6_nsip_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class OpenSSLFactory { /** * Sets the caCertificateFile . */ public void setCACertificateFile ( Path caCertificateFile ) { } }
try { _caCertificateFile = caCertificateFile . toRealPath ( ) . toString ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; }
public class ParaClient { /** * Simple id search . * @ param < P > type of the object * @ param id the id * @ return the object if found or null */ public < P extends ParaObject > P findById ( String id ) { } }
MultivaluedMap < String , String > params = new MultivaluedHashMap < > ( ) ; params . putSingle ( Config . _ID , id ) ; List < P > list = getItems ( find ( "id" , params ) ) ; return list . isEmpty ( ) ? null : list . get ( 0 ) ;
public class SchemaService { /** * Check to the applications for this tenant . */ private void checkTenants ( ) { } }
m_logger . info ( "The following tenants and applications are defined:" ) ; Collection < Tenant > tenantList = TenantService . instance ( ) . getTenants ( ) ; for ( Tenant tenant : tenantList ) { checkTenantApps ( tenant ) ; } if ( tenantList . size ( ) == 0 ) { m_logger . info ( " <no tenants>" ) ; }
public class GenericUtils { /** * Generic method to copy the entire length of each buffer . * @ param src * @ param dst * @ return byte [ ] */ static public byte [ ] expandByteArray ( byte [ ] src , byte [ ] dst ) { } }
int srcLength = ( null != src ) ? src . length : 0 ; int dstLength = ( null != dst ) ? dst . length : 0 ; return expandByteArray ( src , dst , 0 , srcLength , 0 , dstLength ) ;
public class TimeRestrictedAccessPolicy { /** * Evaluates whether the destination provided matches any of the configured * pathsToIgnore and matches specified time range . * @ param config * The { @ link IgnoredResourcesConfig } containing the * pathsToIgnore * @ param destination * The destination to evalu...
if ( destination == null || destination . trim ( ) . length ( ) == 0 ) { destination = "/" ; // $ NON - NLS - 1 $ } List < TimeRestrictedAccess > rulesEnabledForPath = getRulesMatchingPath ( config , destination ) ; if ( rulesEnabledForPath . size ( ) != 0 ) { DateTime currentTime = new DateTime ( DateTimeZone . UTC ) ...
public class SQLFunctions { /** * split ( Column str , java . lang . String pattern ) */ public static Tuple < String , String > split ( String strColumn , String pattern , String valueName ) { } }
String name = "split_" + random ( ) ; if ( valueName == null ) { return new Tuple ( name , "def " + name + " = doc['" + strColumn + "'].value.split('" + pattern + "')" ) ; } else { return new Tuple ( name , strColumn + "; def " + name + " = " + valueName + ".split('" + pattern + "')" ) ; }
public class ConfigurationAsyncClient { /** * Deletes the { @ link ConfigurationSetting } with a matching key , along with the given label and etag . * If { @ link ConfigurationSetting # etag ( ) etag } is specified and is not the wildcard character ( { @ code " * " } ) , * then the setting is < b > only < / b > de...
// Validate that setting and key is not null . The key is used in the service URL so it cannot be null . validateSetting ( setting ) ; return service . delete ( serviceEndpoint , setting . key ( ) , setting . label ( ) , getETagValue ( setting . etag ( ) ) , null ) ;
public class Es6RewriteDestructuring { /** * the parameter list contains a usage of OBJECT _ REST . */ private void pullDestructuringOutOfParams ( Node paramList , Node function ) { } }
Node insertSpot = null ; Node body = function . getLastChild ( ) ; int i = 0 ; Node next = null ; for ( Node param = paramList . getFirstChild ( ) ; param != null ; param = next , i ++ ) { next = param . getNext ( ) ; if ( param . isDefaultValue ( ) ) { Node nameOrPattern = param . removeFirstChild ( ) ; // We ' ll be ...
public class StatusProto { /** * Convert a { @ link com . google . rpc . Status } instance to a { @ link StatusException } . * < p > The returned { @ link StatusException } will wrap a { @ link Status } whose code and description * are set from the code and message in { @ code statusProto } . { @ code statusProto }...
return toStatus ( statusProto ) . asException ( toMetadata ( statusProto ) ) ;
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public TextOrientationIAxis createTextOrientationIAxisFromString ( EDataType eDataType , String initialValue ) { } }
TextOrientationIAxis result = TextOrientationIAxis . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;