signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CreateCommitRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateCommitRequest createCommitRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createCommitRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createCommitRequest . getRepositoryName ( ) , REPOSITORYNAME_BINDING ) ; protocolMarshaller . marshall ( createCommitRequest . getBranchName ( ) , BRANCHNAME_BINDING...
public class GoogleMapShapeConverter { /** * Convert a { @ link MultiLatLng } to a { @ link MultiPoint } * @ param latLngs lat lngs * @ param hasZ has z flag * @ param hasM has m flag * @ return multi point */ public MultiPoint toMultiPoint ( List < LatLng > latLngs , boolean hasZ , boolean hasM ) { } }
MultiPoint multiPoint = new MultiPoint ( hasZ , hasM ) ; for ( LatLng latLng : latLngs ) { Point point = toPoint ( latLng ) ; multiPoint . addPoint ( point ) ; } return multiPoint ;
public class EnvLoader { /** * Adds a dependency to the current environment . * @ param depend the dependency to add */ public static void addDependency ( Dependency depend ) { } }
ClassLoader loader = Thread . currentThread ( ) . getContextClassLoader ( ) ; addDependency ( depend , loader ) ;
public class RandomVariableLowMemory { /** * / * ( non - Javadoc ) * @ see net . finmath . stochastic . RandomVariableInterface # abs ( ) */ public RandomVariableInterface abs ( ) { } }
if ( isDeterministic ( ) ) { double newValueIfNonStochastic = Math . abs ( valueIfNonStochastic ) ; return new RandomVariableLowMemory ( time , newValueIfNonStochastic ) ; } else { double [ ] newRealizations = new double [ realizations . length ] ; for ( int i = 0 ; i < newRealizations . length ; i ++ ) { newRealizatio...
public class TiffWriter { /** * Write strip data . * @ param ifd the ifd * @ return the array list * @ throws IOException Signals that an I / O exception has occurred . */ private ArrayList < Integer > writeStripData ( IFD ifd ) throws IOException { } }
ArrayList < Integer > newStripOffsets = new ArrayList < Integer > ( ) ; IfdTags metadata = ifd . getMetadata ( ) ; TagValue stripOffsets = metadata . get ( 273 ) ; TagValue stripSizes = metadata . get ( 279 ) ; for ( int i = 0 ; i < stripOffsets . getCardinality ( ) ; i ++ ) { try { int pos = ( int ) data . position ( ...
public class Spies { /** * Proxies a binary function spying for first parameter . * @ param < T1 > the function first parameter type * @ param < T2 > the function second parameter type * @ param < R > the function result type * @ param function the function that will be spied * @ param param1 a box that will ...
return spy ( function , Box . < R > empty ( ) , param1 , Box . < T2 > empty ( ) ) ;
public class ModelsImpl { /** * Creates a single child in an existing composite entity model . * @ param appId The application ID . * @ param versionId The version ID . * @ param cEntityId The composite entity extractor ID . * @ param addCompositeEntityChildOptionalParameter the object representing the optional...
return addCompositeEntityChildWithServiceResponseAsync ( appId , versionId , cEntityId , addCompositeEntityChildOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ;
public class LiveEventsInner { /** * Create Live Event . * Creates a Live Event . * @ param resourceGroupName The name of the resource group within the Azure subscription . * @ param accountName The Media Services account name . * @ param liveEventName The name of the Live Event . * @ param parameters Live Ev...
return createWithServiceResponseAsync ( resourceGroupName , accountName , liveEventName , parameters , autoStart ) . map ( new Func1 < ServiceResponse < LiveEventInner > , LiveEventInner > ( ) { @ Override public LiveEventInner call ( ServiceResponse < LiveEventInner > response ) { return response . body ( ) ; } } ) ;
public class AbstractClassLoader { /** * Get the synchronized object for loading the given class . */ public static ISynchronizationPoint < NoException > getClassLoadingSP ( String name ) { } }
synchronized ( classLoadingSP ) { Pair < Thread , JoinPoint < NoException > > p = classLoadingSP . get ( name ) ; if ( p == null ) { JoinPoint < NoException > jp = new JoinPoint < NoException > ( ) ; jp . addToJoin ( 1 ) ; jp . start ( ) ; classLoadingSP . put ( name , new Pair < Thread , JoinPoint < NoException > > ( ...
public class ResultPartitionMetrics { public static void registerQueueLengthMetrics ( MetricGroup group , ResultPartition partition ) { } }
ResultPartitionMetrics metrics = new ResultPartitionMetrics ( partition ) ; group . gauge ( "totalQueueLen" , metrics . getTotalQueueLenGauge ( ) ) ; group . gauge ( "minQueueLen" , metrics . getMinQueueLenGauge ( ) ) ; group . gauge ( "maxQueueLen" , metrics . getMaxQueueLenGauge ( ) ) ; group . gauge ( "avgQueueLen" ...
public class LockingTree { /** * Return a { @ link HasInputStream } where all read access to the underlying data is synchronized around the path * @ param path path * @ param stream stream * @ return synchronized stream access */ protected HasInputStream synchStream ( final Path path , final HasInputStream stream...
return new HasInputStream ( ) { @ Override public InputStream getInputStream ( ) throws IOException { ByteArrayOutputStream bytes = new ByteArrayOutputStream ( ) ; writeContent ( bytes ) ; return new ByteArrayInputStream ( bytes . toByteArray ( ) ) ; } @ Override public long writeContent ( OutputStream outputStream ) t...
public class OptionsImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case SimpleAntlrPackage . OPTIONS__OPTION_VALUES : return optionValues != null && ! optionValues . isEmpty ( ) ; } return super . eIsSet ( featureID ) ;
public class GeneralTopologyContextImpl { /** * Gets information about who is consuming the outputs of the specified component , * and how . * @ return Map from stream id to component id to the Grouping used . */ public Map < String , Map < String , TopologyAPI . Grouping > > getTargets ( String componentId ) { } }
Map < String , Map < String , TopologyAPI . Grouping > > retVal = new HashMap < > ( ) ; if ( ! outputs . containsKey ( componentId ) ) { return retVal ; } for ( TopologyAPI . OutputStream ostream : outputs . get ( componentId ) ) { Map < String , TopologyAPI . Grouping > targetMap = new HashMap < > ( ) ; for ( Map . En...
public class N { /** * Returns a new array with removes all the occurrences of specified elements from < code > a < / code > * @ param a * @ param elements * @ return * @ see Collection # removeAll ( Collection ) */ @ SafeVarargs public static float [ ] removeAll ( final float [ ] a , final float ... elements )...
if ( N . isNullOrEmpty ( a ) ) { return N . EMPTY_FLOAT_ARRAY ; } else if ( N . isNullOrEmpty ( elements ) ) { return a . clone ( ) ; } else if ( elements . length == 1 ) { return removeAllOccurrences ( a , elements [ 0 ] ) ; } final FloatList list = FloatList . of ( a . clone ( ) ) ; list . removeAll ( FloatList . of ...
public class ForTokens { /** * { @ inheritDoc } */ public ParameterDescription . InDefinedShape get ( int index ) { } }
int offset = declaringMethod . isStatic ( ) ? 0 : 1 ; for ( ParameterDescription . Token token : tokens . subList ( 0 , index ) ) { offset += token . getType ( ) . getStackSize ( ) . getSize ( ) ; } return new ParameterDescription . Latent ( declaringMethod , tokens . get ( index ) , index , offset ) ;
public class StrBuilder { /** * Searches the string builder using the matcher to find the first * match searching from the given index . * Matchers can be used to perform advanced searching behaviour . * For example you could write a matcher to find the character ' a ' * followed by a number . * @ param match...
startIndex = ( startIndex < 0 ? 0 : startIndex ) ; if ( matcher == null || startIndex >= size ) { return - 1 ; } final int len = size ; final char [ ] buf = buffer ; for ( int i = startIndex ; i < len ; i ++ ) { if ( matcher . isMatch ( buf , i , startIndex , len ) > 0 ) { return i ; } } return - 1 ;
public class HadoopUtils { /** * Moves a src { @ link Path } from a srcFs { @ link FileSystem } to a dst { @ link Path } on a dstFs { @ link FileSystem } . If * the srcFs and the dstFs have the same scheme , and neither of them or S3 schemes , then the { @ link Path } is simply * renamed . Otherwise , the data is f...
if ( srcFs . getUri ( ) . getScheme ( ) . equals ( dstFs . getUri ( ) . getScheme ( ) ) && ! FS_SCHEMES_NON_ATOMIC . contains ( srcFs . getUri ( ) . getScheme ( ) ) && ! FS_SCHEMES_NON_ATOMIC . contains ( dstFs . getUri ( ) . getScheme ( ) ) ) { renamePath ( srcFs , src , dst ) ; } else { copyPath ( srcFs , src , dstFs...
public class QLearningDiscrete { /** * Single step of training * @ param obs last obs * @ return relevant info for next step */ protected QLStepReturn < O > trainStep ( O obs ) { } }
Integer action ; INDArray input = getInput ( obs ) ; boolean isHistoryProcessor = getHistoryProcessor ( ) != null ; if ( isHistoryProcessor ) getHistoryProcessor ( ) . record ( input ) ; int skipFrame = isHistoryProcessor ? getHistoryProcessor ( ) . getConf ( ) . getSkipFrame ( ) : 1 ; int historyLength = isHistoryProc...
public class HttpQuery { /** * Sends a 500 error page to the client . * Handles responses from deprecated API calls as well as newer , versioned * API calls * @ param cause The unexpected exception that caused this error . */ @ Override public void internalError ( final Exception cause ) { } }
logError ( "Internal Server Error on " + request ( ) . getUri ( ) , cause ) ; if ( this . api_version > 0 ) { // always default to the latest version of the error formatter since we // need to return something switch ( this . api_version ) { case 1 : default : sendReply ( HttpResponseStatus . INTERNAL_SERVER_ERROR , se...
public class PdfStamper { /** * Applies a digital signature to a document . The returned PdfStamper * can be used normally as the signature is only applied when closing . * Note that the pdf is created in memory . * A possible use is : * < pre > * KeyStore ks = KeyStore . getInstance ( " pkcs12 " ) ; * ks ....
return createSignature ( reader , os , pdfVersion , null , false ) ;
public class PluginDefaultGroovyMethods { /** * Returns a sequential { @ link Stream } with the specified array as its * source . * @ param self The array , assumed to be unmodified during use * @ return a { @ code Stream } for the array */ public static Stream < Integer > stream ( int [ ] self ) { } }
return IntStream . range ( 0 , self . length ) . mapToObj ( i -> self [ i ] ) ;
public class ManagementLocksInner { /** * Deletes the management lock of a resource or any level below the resource . * To delete management locks , you must have access to Microsoft . Authorization / * or Microsoft . Authorization / locks / * actions . Of the built - in roles , only Owner and User Access Administrat...
return ServiceFuture . fromResponse ( deleteAtResourceLevelWithServiceResponseAsync ( resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , lockName ) , serviceCallback ) ;
public class BeatFinder { /** * Stop listening for beats . */ public synchronized void stop ( ) { } }
if ( isRunning ( ) ) { socket . get ( ) . close ( ) ; socket . set ( null ) ; deliverLifecycleAnnouncement ( logger , false ) ; }
public class ClasspathSqlResource { /** * { @ inheritDoc } */ @ Override public InputStream getInputStream ( ) throws IOException { } }
ClassLoader cl = Thread . currentThread ( ) . getContextClassLoader ( ) ; return cl . getResourceAsStream ( sqlPath ) ;
public class ColumnDefEx { /** * Combines both defaultContentType and defaultContent and generates proper content . */ public String calcDefaultContent ( ) { } }
if ( defaultContentType == null ) return defaultContent ; String s ; switch ( defaultContentType ) { case BUTTON : s = "<button data-role='none'>" ; if ( ! Empty . is ( defaultContent ) ) s += defaultContent ; return s + "</button>" ; case CHECKBOX : case CHECKBOX_ROWSELECT : s = "<input type='checkbox' data-role='none...
public class NumberFormat { /** * Formats a number and appends the resulting text to the given string * buffer . * The number can be of any subclass of { @ link java . lang . Number } . * This implementation extracts the number ' s value using * { @ link java . lang . Number # longValue ( ) } for all integral t...
if ( number instanceof Long || number instanceof Integer || number instanceof Short || number instanceof Byte || number instanceof AtomicInteger || number instanceof AtomicLong || ( number instanceof BigInteger && ( ( BigInteger ) number ) . bitLength ( ) < 64 ) ) { return format ( ( ( Number ) number ) . longValue ( )...
public class RepositoryURIResolver { /** * Resolves the " repository " URI . * @ param path * the href to the resource * @ return the resolved Source or null if the resource was not found * @ throws TransformerException * if no URL can be constructed from the path */ protected StreamSource resolveRepositoryUR...
StreamSource resolvedSource = null ; try { if ( path != null ) { URL url = new URL ( path ) ; InputStream in = url . openStream ( ) ; if ( in != null ) { resolvedSource = new StreamSource ( in ) ; } } else { throw new TransformerException ( "Resource does not exist. \"" + path + "\" is not accessible." ) ; } } catch ( ...
public class AbstractClassLoader { /** * Add a class loader from a resource contained by this class loader , for example an inner jar file . */ public final void addSubLoader ( AbstractClassLoader loader ) { } }
if ( subLoaders == null ) subLoaders = new ArrayList < > ( ) ; subLoaders . add ( loader ) ;
public class StackdriverExportUtils { /** * Convert a OpenCensus Point to a StackDriver Point */ @ VisibleForTesting static Point createPoint ( io . opencensus . metrics . export . Point point , @ javax . annotation . Nullable io . opencensus . common . Timestamp startTimestamp ) { } }
TimeInterval . Builder timeIntervalBuilder = TimeInterval . newBuilder ( ) ; timeIntervalBuilder . setEndTime ( convertTimestamp ( point . getTimestamp ( ) ) ) ; if ( startTimestamp != null ) { timeIntervalBuilder . setStartTime ( convertTimestamp ( startTimestamp ) ) ; } Point . Builder builder = Point . newBuilder ( ...
public class Utils { /** * Closes a closeable ( usually stream ) , suppressing any IOExceptions . * @ param closeable the resource to close quietly , may be { @ code null } */ public static void close ( Closeable closeable ) { } }
if ( closeable != null ) { try { closeable . close ( ) ; } catch ( IOException ioe ) { // Suppress the exception logger . log ( Level . FINEST , "Unable to close resource." , ioe ) ; } }
public class PrimitiveArrays { /** * Returns the value of the element with the maximum value */ public static int max ( byte [ ] array , int offset , int length ) { } }
int max = - Integer . MAX_VALUE ; for ( int i = 0 ; i < length ; i ++ ) { int tmp = array [ offset + i ] ; if ( tmp > max ) { max = tmp ; } } return max ;
public class BloomFilter { /** * Initializes and increases the capacity of this < tt > BloomFilter < / tt > instance , if necessary , * to ensure that it can accurately estimate the membership of elements given the expected * number of insertions . This operation forgets all previous memberships when resizing . *...
checkArgument ( expectedInsertions >= 0 ) ; checkArgument ( fpp > 0 && fpp < 1 ) ; double optimalBitsFactor = - Math . log ( fpp ) / ( Math . log ( 2 ) * Math . log ( 2 ) ) ; int optimalNumberOfBits = ( int ) ( expectedInsertions * optimalBitsFactor ) ; int optimalSize = optimalNumberOfBits >>> BITS_PER_LONG_SHIFT ; if...
public class Composite { /** * / * Flush is a package method used by Page . flush ( ) to locate the * most nested composite , write out and empty its contents . */ void flush ( OutputStream out , String encoding ) throws IOException { } }
flush ( new OutputStreamWriter ( out , encoding ) ) ;
public class AbstractJPAComponent { /** * Process application " started " event . */ public void startedApplication ( JPAApplInfo applInfo ) throws RuntimeWarning // d406994.2 { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "startedApplication : " + applInfo . getApplName ( ) ) ; // To save footprint , if an application does not have any JPA access , remove // the unnecessary appInfo object from list . if ( ap...
public class MulticastSocket { /** * Set the default time - to - live for multicast packets sent out * on this { @ code MulticastSocket } in order to control the * scope of the multicasts . * < P > The ttl < B > must < / B > be in the range { @ code 0 < = ttl < = * 255 } or an { @ code IllegalArgumentException ...
if ( ttl < 0 || ttl > 255 ) { throw new IllegalArgumentException ( "ttl out of range" ) ; } if ( isClosed ( ) ) throw new SocketException ( "Socket is closed" ) ; getImpl ( ) . setTimeToLive ( ttl ) ;
public class ViewPropertyAnimatorPreHC { /** * Starts the underlying Animator for a set of properties . We use a single animator that * simply runs from 0 to 1 , and then use that fractional value to set each property * value accordingly . */ private void startAnimation ( ) { } }
ValueAnimator animator = ValueAnimator . ofFloat ( 1.0f ) ; ArrayList < NameValuesHolder > nameValueList = ( ArrayList < NameValuesHolder > ) mPendingAnimations . clone ( ) ; mPendingAnimations . clear ( ) ; int propertyMask = 0 ; int propertyCount = nameValueList . size ( ) ; for ( int i = 0 ; i < propertyCount ; ++ i...
public class SqlDateTimeUtils { /** * Format a timestamp as specific . * @ param ts the timestamp to format . * @ param format the string formatter . * @ param tz the time zone */ public static String dateFormat ( long ts , String format , TimeZone tz ) { } }
SimpleDateFormat formatter = FORMATTER_CACHE . get ( format ) ; formatter . setTimeZone ( tz ) ; Date dateTime = new Date ( ts ) ; return formatter . format ( dateTime ) ;
public class RythmEngine { /** * ( 3rd party API , not for user application ) * Get an new template class by { @ link org . rythmengine . resource . ITemplateResource template resource } * @ param resource the template resource * @ return template class */ public TemplateClass getTemplateClass ( ITemplateResource...
String key = S . str ( resource . getKey ( ) ) ; TemplateClass tc = classes ( ) . getByTemplate ( key ) ; if ( null == tc ) { tc = new TemplateClass ( resource , this ) ; } return tc ;
public class JWT { /** * Verify whether the JWT is valid . If valid return the decoded instance . * @ param jwt jwt * @ param secret signature key * @ return the decoded jwt instance * @ throws DecodeException if jwt is illegal */ public static JWT verify ( String jwt , String secret ) { } }
return verify ( jwt , secret == null ? null : secret . getBytes ( StandardCharsets . UTF_8 ) ) ;
public class DefaultJiraClient { /** * Get a list of Boards . It ' s saved as Team in Hygieia * @ return List of Team */ @ Override public List < Team > getBoards ( ) { } }
int count = 0 ; int startAt = 0 ; boolean isLast = false ; List < Team > result = new ArrayList < > ( ) ; while ( ! isLast ) { String url = featureSettings . getJiraBaseUrl ( ) + ( featureSettings . getJiraBaseUrl ( ) . endsWith ( "/" ) ? "" : "/" ) + BOARD_TEAMS_REST_SUFFIX + "?startAt=" + startAt ; try { ResponseEnti...
public class Transliterator { /** * Register a Transliterator object . * < p > Because ICU may choose to cache Transliterator objects internally , this must * be called at application startup , prior to any calls to * Transliterator . getInstance to avoid undefined behavior . * @ param trans the Transliterator ...
registry . put ( trans . getID ( ) , trans , visible ) ;
public class AbstractOutputWriter { /** * Convert value of this setting to a Java < b > long < / b > . * If the property is not found , the < code > defaultValue < / code > is returned . If the property is not a long , an exception is thrown . * @ param name name of the property * @ param defaultValue default val...
if ( settings . containsKey ( name ) ) { String value = settings . get ( name ) . toString ( ) ; try { return Long . parseLong ( value ) ; } catch ( Exception e ) { throw new IllegalArgumentException ( "Setting '" + name + "=" + value + "' is not a long on " + this . toString ( ) ) ; } } else { return defaultValue ; }
public class ResizeTransformer { /** * Changes X view position using layout ( ) method . * @ param verticalDragOffset used to calculate the new X position . */ @ Override public void updatePosition ( float verticalDragOffset ) { } }
int right = getViewRightPosition ( verticalDragOffset ) ; int left = right - layoutParams . width ; int top = getView ( ) . getTop ( ) ; int bottom = top + layoutParams . height ; getView ( ) . layout ( left , top , right , bottom ) ;
public class ModuleItem { /** * add stats for new modules that are added : called when a module item is added */ private void addToStatsTree ( ModuleItem mi ) { } }
ArrayList colMembers = myStatsWithChildren . subCollections ( ) ; if ( colMembers == null ) { colMembers = new ArrayList ( 1 ) ; myStatsWithChildren . setSubcollections ( colMembers ) ; } colMembers . add ( mi . getStats ( true ) ) ;
public class ThriftClient { /** * ( non - Javadoc ) * @ see com . impetus . kundera . client . Client # deleteByColumn ( java . lang . String , * java . lang . String , java . lang . String , java . lang . Object ) */ @ Override public void deleteByColumn ( String schemaName , String tableName , String columnName ,...
if ( ! isOpen ( ) ) { throw new PersistenceException ( "ThriftClient is closed." ) ; } Connection conn = null ; try { conn = getConnection ( ) ; ColumnPath path = new ColumnPath ( tableName ) ; conn . getClient ( ) . remove ( CassandraUtilities . toBytes ( columnValue , columnValue . getClass ( ) ) , path , generator ....
public class ListRuleNamesByTargetRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListRuleNamesByTargetRequest listRuleNamesByTargetRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listRuleNamesByTargetRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listRuleNamesByTargetRequest . getTargetArn ( ) , TARGETARN_BINDING ) ; protocolMarshaller . marshall ( listRuleNamesByTargetRequest . getNextToken ( ) , NE...
public class PAXWicketFilterFactory { /** * / * ( non - Javadoc ) * @ see org . ops4j . pax . wicket . api . FilterFactory # createFilter ( org . ops4j . pax . wicket . api . ConfigurableFilterConfig ) */ public Filter createFilter ( ConfigurableFilterConfig filterConfig ) throws ServletException { } }
return new Filter ( ) { public void init ( FilterConfig filterConfig ) throws ServletException { // Do init tasks here } public void doFilter ( ServletRequest request , ServletResponse response , FilterChain chain ) throws IOException , ServletException { // do filter here chain . doFilter ( request , response ) ; } pu...
public class PageSourceImpl { /** * return source path as String * @ return source path as String */ @ Override public String getDisplayPath ( ) { } }
if ( ! mapping . hasArchive ( ) ) { return StringUtil . toString ( getPhyscalFile ( ) , null ) ; } else if ( isLoad ( LOAD_PHYSICAL ) ) { return StringUtil . toString ( getPhyscalFile ( ) , null ) ; } else if ( isLoad ( LOAD_ARCHIVE ) ) { return StringUtil . toString ( getArchiveSourcePath ( ) , null ) ; } else { boole...
public class ReportDistributor { /** * Returns true if the application is debuggable . * @ return true if the application is debuggable . */ private boolean isDebuggable ( ) { } }
final PackageManager pm = context . getPackageManager ( ) ; try { return ( pm . getApplicationInfo ( context . getPackageName ( ) , 0 ) . flags & ApplicationInfo . FLAG_DEBUGGABLE ) > 0 ; } catch ( PackageManager . NameNotFoundException e ) { return false ; }
public class CmsVfsDriver { /** * Returns the parent id of the given resource . < p > * @ param dbc the current database context * @ param projectId the current project id * @ param resourcename the resource name to read the parent id for * @ return the parent id of the given resource * @ throws CmsDataAccess...
if ( "/" . equalsIgnoreCase ( resourcename ) ) { return CmsUUID . getNullUUID ( ) . toString ( ) ; } String parent = CmsResource . getParentFolder ( resourcename ) ; parent = CmsFileUtil . removeTrailingSeparator ( parent ) ; ResultSet res = null ; PreparedStatement stmt = null ; Connection conn = null ; String parentI...
public class AdminDictProtwordsAction { private static OptionalEntity < ProtwordsItem > getEntity ( final CreateForm form ) { } }
switch ( form . crudMode ) { case CrudMode . CREATE : final ProtwordsItem entity = new ProtwordsItem ( 0 , StringUtil . EMPTY ) ; return OptionalEntity . of ( entity ) ; case CrudMode . EDIT : if ( form instanceof EditForm ) { return ComponentUtil . getComponent ( ProtwordsService . class ) . getProtwordsItem ( form . ...
public class FSA { /** * A factory for reading automata in any of the supported versions . * @ param stream * The input stream to read automaton data from . The stream is not * closed . * @ return Returns an instantiated automaton . Never null . * @ throws IOException * If the input stream does not represen...
final FSAHeader header = FSAHeader . read ( stream ) ; switch ( header . version ) { case FSA5 . VERSION : return new FSA5 ( stream ) ; case CFSA . VERSION : return new CFSA ( stream ) ; case CFSA2 . VERSION : return new CFSA2 ( stream ) ; default : throw new IOException ( String . format ( Locale . ROOT , "Unsupported...
public class CmsGitToolOptionsPanel { /** * Sets the flags for the current action . < p > */ public void setActionFlags ( ) { } }
m_checkinBean . setFetchAndResetBeforeImport ( m_fetchAndReset . getValue ( ) . booleanValue ( ) ) ; switch ( m_mode ) { case checkOut : m_checkinBean . setCheckout ( true ) ; m_checkinBean . setResetHead ( false ) ; m_checkinBean . setResetRemoteHead ( false ) ; break ; case checkIn : m_checkinBean . setCheckout ( fal...
public class WebAppFilterManager { /** * PI08268 */ private boolean setDefaultMethod ( HttpServletRequest httpServletReq , String attributeTargetClass , String httpMethod ) { } }
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "setDefaultMethod" , "set attribute checkdefaultmethod [" + httpMethod + "] , and [" + attributeTargetClass + "]" ) ; httpServletReq . setAttribute ( "com.ibm.ws.we...
public class AbstractAlpineQueryManager { /** * Refreshes and detaches an objects . * @ param pcs the instances to detach * @ param < T > the type to return * @ return the detached instances * @ since 1.3.0 */ public < T > List < T > detach ( List < T > pcs ) { } }
pm . getFetchPlan ( ) . setDetachmentOptions ( FetchPlan . DETACH_LOAD_FIELDS ) ; return new ArrayList < > ( pm . detachCopyAll ( pcs ) ) ;
public class JacksonJsonHandler { /** * { @ inheritDoc } */ @ Override public void writeJson ( Writer writer , Map < String , ? > value ) throws IOException { } }
mapper . writeValue ( writer , value ) ;
public class DITableInfo { /** * Retrieves , if definitely known , the transfer size for values of the * specified column , in bytes . < p > * @ param i zero - based column index * @ return the transfer size for values of the * specified column , in bytes */ Integer getColBufLen ( int i ) { } }
int size ; int type ; ColumnSchema column ; column = table . getColumn ( i ) ; type = column . getDataType ( ) . getJDBCTypeCode ( ) ; switch ( type ) { case Types . SQL_CHAR : case Types . SQL_CLOB : case Types . VARCHAR_IGNORECASE : case Types . SQL_VARCHAR : { size = column . getDataType ( ) . precision > Integer . ...
public class MyProxyServerAuthorization { /** * Performs MyProxy server authorization checks . The hostname of * the server is compared with the hostname specified in the * server ' s ( topmost ) certificate in the certificate chain . The * hostnames must match exactly ( in case - insensitive way ) . The * serv...
try { this . authzMyProxyService . authorize ( context , host ) ; } catch ( AuthorizationException e ) { this . authzHostService . authorize ( context , host ) ; }
public class AWSCodePipelineClient { /** * Removes the connection between the webhook that was created by CodePipeline and the external tool with events to * be detected . Currently only supported for webhooks that target an action type of GitHub . * @ param deregisterWebhookWithThirdPartyRequest * @ return Resul...
request = beforeClientExecution ( request ) ; return executeDeregisterWebhookWithThirdParty ( request ) ;
public class OPFHandler { /** * Returns an immutable list of the items in the spine . May contain duplicates * if several < code > itemref < / code > elements point to the same item . * Returns the empty list if the items have not been parsed yet . * @ return the list of items in the spine , guaranteed non - null...
return ( items != null ) ? items . getSpineItems ( ) : ImmutableList . < OPFItem > of ( ) ;
public class GeneratedDUserDaoImpl { /** * query - by method for field createdBy * @ param createdBy the specified attribute * @ return an Iterable of DUsers for the specified createdBy */ public Iterable < DUser > queryByCreatedBy ( java . lang . String createdBy ) { } }
return queryByField ( null , DUserMapper . Field . CREATEDBY . getFieldName ( ) , createdBy ) ;
public class ReqQueue { /** * 增加并发安全机制 , 日后如遇到长连接处理速度极限可以考虑去掉synchronized关键字 , 但需要仔细验证并发安全问题 */ public void writeAndFlush ( ResponseWrapper ... responses ) { } }
synchronized ( this ) { for ( ResponseWrapper response : responses ) { msgId_response . put ( response . getRequest ( ) . getMsgId ( ) , response ) ; } toContinue ( ) ; if ( isTooMany ( ) ) { processTooMany ( ) ; } }
public class DescribeImagePermissionsRequest { /** * The 12 - digit identifier of one or more AWS accounts with which the image is shared . * @ param sharedAwsAccountIds * The 12 - digit identifier of one or more AWS accounts with which the image is shared . */ public void setSharedAwsAccountIds ( java . util . Col...
if ( sharedAwsAccountIds == null ) { this . sharedAwsAccountIds = null ; return ; } this . sharedAwsAccountIds = new java . util . ArrayList < String > ( sharedAwsAccountIds ) ;
public class IPv6AddressSection { /** * Whether this section is consistent with an EUI64 section , * which means it came from an extended 8 byte address , * and the corresponding segments in the middle match 0xff and 0xfe * @ param partial whether missing segments are considered a match * @ return */ public boo...
int segmentCount = getSegmentCount ( ) ; int endIndex = addressSegmentIndex + segmentCount ; if ( addressSegmentIndex <= 5 ) { if ( endIndex > 6 ) { int index3 = 5 - addressSegmentIndex ; IPv6AddressSegment seg3 = getSegment ( index3 ) ; IPv6AddressSegment seg4 = getSegment ( index3 + 1 ) ; return seg4 . matchesWithMas...
public class FileExecutor { /** * 解析JSON * @ param url { @ link URL } * @ return { @ link JSONObject } * @ throws IOException 异常 * @ since 1.1.0 */ public static JSONObject parseJsonObject ( URL url ) throws IOException { } }
String path = url . toString ( ) ; if ( path . startsWith ( ValueConsts . LOCAL_FILE_URL ) ) { return parseJsonObject ( NetUtils . urlToString ( url ) ) ; } else { return JSONObject . parseObject ( read ( url ) ) ; }
public class CovarianceMatrix { /** * Add a single value with weight 1.0. * @ param val Value */ public void put ( double [ ] val ) { } }
assert ( val . length == mean . length ) ; final double nwsum = wsum + 1. ; // Compute new means for ( int i = 0 ; i < mean . length ; i ++ ) { final double delta = val [ i ] - mean [ i ] ; nmea [ i ] = mean [ i ] + delta / nwsum ; } // Update covariance matrix for ( int i = 0 ; i < mean . length ; i ++ ) { for ( int j...
public class Messages { /** * Get a message bundle of the given type . * @ param type the bundle type class * @ return the bundle */ public static < T > T getBundle ( final Class < T > type ) { } }
return doPrivileged ( new PrivilegedAction < T > ( ) { public T run ( ) { final Locale locale = Locale . getDefault ( ) ; final String lang = locale . getLanguage ( ) ; final String country = locale . getCountry ( ) ; final String variant = locale . getVariant ( ) ; Class < ? extends T > bundleClass = null ; if ( varia...
public class Strings { /** * Splits the input string using the given separator to identify its tokens ; * it will also trim the tokens , depending on the trim parameter . * @ param strings * the string to split . * @ param separator * the character sequence to use as a token separator . * @ param trim * w...
StringTokeniser tokeniser = new StringTokeniser ( separator ) ; String [ ] tokens = tokeniser . tokenise ( strings ) ; if ( trim ) { for ( int i = 0 ; i < tokens . length ; ++ i ) { tokens [ i ] = tokens [ i ] != null ? tokens [ i ] . trim ( ) : tokens [ i ] ; } } return tokens ;
public class PhysicalEntityWrapper { /** * Binds to downstream interactions . */ public void initDownstream ( ) { } }
for ( Interaction inter : getDownstreamInteractions ( pe . getParticipantOf ( ) ) ) { AbstractNode node = ( AbstractNode ) graph . getGraphObject ( inter ) ; if ( node == null ) continue ; if ( inter instanceof Conversion ) { Conversion conv = ( Conversion ) inter ; ConversionWrapper conW = ( ConversionWrapper ) node ;...
public class ResourceKey { /** * Constructs new resource key from plain string according to following rules : < ul > * < li > Last dot in the string separates key bundle from key id . < / li > * < li > Strings starting from the dot represent a key with < code > null < / code > bundle ( default bundle ) . < / li > ...
int idx = key . lastIndexOf ( BUNDLE_ID_SEPARATOR ) ; if ( idx < 0 ) { return new ResourceKey ( null , key ) ; } String bundle = idx > 0 ? key . substring ( 0 , idx ) : null ; String id = idx < key . length ( ) - 1 ? key . substring ( idx + 1 ) : null ; return key ( bundle , id ) ;
public class Vector4 { /** * Sets all of the elements of the vector . * @ return a reference to this vector , for chaining . */ public Vector4 set ( FloatBuffer buf ) { } }
return set ( buf . get ( ) , buf . get ( ) , buf . get ( ) , buf . get ( ) ) ;
public class SchemaGenerator { /** * This is the main recursive spot that builds out the various forms of Output types * @ param buildCtx the context we need to work out what we are doing * @ param rawType the type to be built * @ return an output type */ @ SuppressWarnings ( { } }
"unchecked" , "TypeParameterUnusedInFormals" } ) private < T extends GraphQLOutputType > T buildOutputType ( BuildContext buildCtx , Type rawType ) { TypeDefinition typeDefinition = buildCtx . getTypeDefinition ( rawType ) ; TypeInfo typeInfo = TypeInfo . typeInfo ( rawType ) ; GraphQLOutputType outputType = buildCtx ....
public class VerificationCreator { /** * Add the requested post parameters to the Request . * @ param request Request to add post params to */ private void addPostParams ( final Request request ) { } }
if ( to != null ) { request . addPostParam ( "To" , to ) ; } if ( channel != null ) { request . addPostParam ( "Channel" , channel ) ; } if ( customMessage != null ) { request . addPostParam ( "CustomMessage" , customMessage ) ; } if ( sendDigits != null ) { request . addPostParam ( "SendDigits" , sendDigits ) ; } if (...
public class VersionControlGit { /** * Different from cloneRepo in that will clone only a single branch . * For quicker clone of specific branch / tag . */ public void cloneBranch ( String branch ) throws Exception { } }
CloneCommand cloneCommand = Git . cloneRepository ( ) . setURI ( repositoryUrl ) . setDirectory ( localRepo . getDirectory ( ) . getParentFile ( ) ) . setBranchesToClone ( Arrays . asList ( branch ) ) . setCloneAllBranches ( false ) . setBranch ( branch ) ; if ( credentialsProvider != null ) cloneCommand . setCredentia...
public class CmsContentTypeVisitor { /** * Returns if an element with the given path will be displayed at root level of a content editor tab . < p > * @ param path the element path * @ return < code > true < / code > if an element with the given path will be displayed at root level of a content editor tab */ privat...
path = path . substring ( 1 ) ; if ( ! path . contains ( "/" ) ) { return true ; } if ( m_tabInfos != null ) { for ( CmsTabInfo info : m_tabInfos ) { if ( info . isCollapsed ( ) && path . startsWith ( info . getStartName ( ) ) && ! path . substring ( info . getStartName ( ) . length ( ) + 1 ) . contains ( "/" ) ) { ret...
public class JavaClasspathParser { /** * Backward compatibility : only accessible and non - accessible files are suported . */ private static IAccessRule [ ] getAccessRules ( IPath [ ] accessibleFiles , IPath [ ] nonAccessibleFiles ) { } }
final int accessibleFilesLength = accessibleFiles == null ? 0 : accessibleFiles . length ; final int nonAccessibleFilesLength = nonAccessibleFiles == null ? 0 : nonAccessibleFiles . length ; final int length = accessibleFilesLength + nonAccessibleFilesLength ; if ( length == 0 ) { return null ; } final IAccessRule [ ] ...
public class SecureEmbeddedServer { /** * Returns the application configuration . * @ return */ protected org . apache . commons . configuration . Configuration getConfiguration ( ) { } }
try { return ApplicationProperties . get ( ) ; } catch ( AtlasException e ) { throw new RuntimeException ( "Unable to load configuration: " + ApplicationProperties . APPLICATION_PROPERTIES ) ; }
public class ZProxy { /** * Creates a new proxy in a ZeroMQ way . * This proxy will be less efficient than the * { @ link # newZProxy ( ZContext , String , org . zeromq . ZProxy . Proxy , String , Object . . . ) low - level one } . * @ param ctx the context used for the proxy . * Possibly null , in this case a ...
return newZProxy ( ctx , name , sockets , motdelafin , args ) ;
public class CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl { /** * Sets the user local service . * @ param userLocalService the user local service */ public void setUserLocalService ( com . liferay . portal . kernel . service . UserLocalService userLocalService ) { } }
this . userLocalService = userLocalService ;
public class XMLUtils { /** * Transform file with XML filters . Only file URIs are supported . * @ param input absolute URI to transform and replace * @ param filters XML filters to transform file with , may be an empty list */ public void transform ( final URI input , final List < XMLFilter > filters ) throws DITA...
assert input . isAbsolute ( ) ; if ( ! input . getScheme ( ) . equals ( "file" ) ) { throw new IllegalArgumentException ( "Only file URI scheme supported: " + input ) ; } transform ( new File ( input ) , filters ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcPreDefinedPropertySet ( ) { } }
if ( ifcPreDefinedPropertySetEClass == null ) { ifcPreDefinedPropertySetEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 444 ) ; } return ifcPreDefinedPropertySetEClass ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link MultiSolidType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link MultiSolidType } { @ code > } */ ...
return new JAXBElement < MultiSolidType > ( _MultiSolid_QNAME , MultiSolidType . class , null , value ) ;
public class BigQuerySnippets { /** * [ VARIABLE " my _ table _ name " ] */ public TableResult listTableDataFromId ( String datasetName , String tableName ) { } }
// [ START bigquery _ browse _ table ] TableId tableIdObject = TableId . of ( datasetName , tableName ) ; // This example reads the result 100 rows per RPC call . If there ' s no need to limit the number , // simply omit the option . TableResult tableData = bigquery . listTableData ( tableIdObject , TableDataListOption...
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertIfcFootingTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class EntityUtils { /** * Convert a string value to a typed value based on a non - entity - referencing attribute data type . * @ param valueStr string value * @ param attr non - entity - referencing attribute * @ return typed value * @ throws MolgenisDataException if attribute references another entity ...
// Reference types cannot be processed because we lack an entityManager in this route . if ( EntityTypeUtils . isReferenceType ( attr ) ) { throw new MolgenisDataException ( "getTypedValue(String, AttributeMetadata) can't be used for attributes referencing entities" ) ; } return getTypedValue ( valueStr , attr , null )...
public class GSEAConverter { /** * Creates GSEA entries from the pathways contained in the model . * @ param model Model * @ return a set of GSEA entries */ public Collection < GMTEntry > convert ( final Model model ) { } }
final Collection < GMTEntry > toReturn = new TreeSet < GMTEntry > ( new Comparator < GMTEntry > ( ) { @ Override public int compare ( GMTEntry o1 , GMTEntry o2 ) { return o1 . toString ( ) . compareTo ( o2 . toString ( ) ) ; } } ) ; Model l3Model ; // convert to level 3 in necessary if ( model . getLevel ( ) == BioPAXL...
public class QueryParameters { /** * Updates value of specified key * @ param key Key * @ param value Value * @ return this instance of QueryParameters */ public QueryParameters updateValue ( String key , Object value ) { } }
this . values . put ( processKey ( key ) , value ) ; return this ;
public class AbstractLinear { /** * ComponentListener methods */ @ Override public void componentResized ( final ComponentEvent EVENT ) { } }
final Container PARENT = getParent ( ) ; if ( ( PARENT != null ) && ( PARENT . getLayout ( ) == null ) ) { setSize ( getWidth ( ) , getHeight ( ) ) ; } else { // setSize ( new Dimension ( getWidth ( ) , getHeight ( ) ) ) ; setPreferredSize ( new Dimension ( getWidth ( ) , getHeight ( ) ) ) ; } calcInnerBounds ( ) ; if ...
public class ElasticMeterRegistry { /** * VisibleForTesting */ String indexName ( ) { } }
ZonedDateTime dt = ZonedDateTime . ofInstant ( new Date ( config ( ) . clock ( ) . wallTime ( ) ) . toInstant ( ) , ZoneOffset . UTC ) ; return config . index ( ) + config . indexDateSeparator ( ) + indexDateFormatter . format ( dt ) ;
public class BasicCloner { /** * Sets CloneImplementors to be used . * @ param implementors The implementors */ public void setImplementors ( Map < Class < ? > , CloneImplementor > implementors ) { } }
// this . implementors = implementors ; this . allImplementors = new HashMap < Class < ? > , CloneImplementor > ( ) ; allImplementors . putAll ( builtInImplementors ) ; allImplementors . putAll ( implementors ) ;
public class PrimeFacesListAdapter { /** * Converts a string based Row Key to the Key Type as specified by the * DataController ( adaptee ) . * @ param rowKey * string based Row Key * @ return the converted key */ @ SuppressWarnings ( "unchecked" ) K convertToGetValueOfParameter ( final String rowKey ) { } }
final Object parameterValue = ConvertUtils . convert ( rowKey , getkeyofParameterType ) ; if ( parameterValue . getClass ( ) . equals ( getkeyofParameterType ) ) { return ( K ) parameterValue ; } else { throw new RuntimeException ( "Unable to convert String " + "based rowKey to " + getkeyofParameterType . getName ( ) )...
public class RemoteTransaction { /** * - - - - - interface Callback - - - - - */ @ Override public void callback ( final AbstractMessage msg ) { } }
synchronized ( lock ) { hasTimeout = false ; message = msg ; lock . notify ( ) ; }
public class DefaultVfs { /** * Recursively list the full resource path of all the resources that are children of the * resource identified by a URL . * @ param url The URL that identifies the resource to list . * @ param path The path to the resource that is identified by the URL . Generally , this is the * va...
InputStream is = null ; try { List < String > resources = new ArrayList < String > ( ) ; // First , try to find the URL of a JAR file containing the requested resource . If a JAR // file is found , then we ' ll list child resources by reading the JAR . URL jarUrl = findJarForResource ( url ) ; if ( jarUrl != null ) { i...
public class ApiOvhTelephony { /** * List the phones with Sip slot available * REST : GET / telephony / { billingAccount } / line / { serviceName } / phoneCanBeAssociable * @ param billingAccount [ required ] The name of your billingAccount * @ param serviceName [ required ] * @ deprecated */ public ArrayList <...
String qPath = "/telephony/{billingAccount}/line/{serviceName}/phoneCanBeAssociable" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t8 ) ;
public class InMemoryPartition { /** * releases all of the partition ' s segments ( pages and overflow buckets ) * @ param target memory pool to release segments to */ public void clearAllMemory ( List < MemorySegment > target ) { } }
// return the overflow segments if ( this . overflowSegments != null ) { for ( int k = 0 ; k < this . numOverflowSegments ; k ++ ) { target . add ( this . overflowSegments [ k ] ) ; } } // return the partition buffers target . addAll ( this . partitionPages ) ; this . partitionPages . clear ( ) ;
public class CompressionUtilities { /** * Compress a folder and its contents . * @ param srcFolder path to the folder to be compressed . * @ param destZipFile path to the final output zip file . * @ param addBaseFolder flag to decide whether to add also the provided base ( srcFolder ) folder or not . * @ throws...
if ( new File ( srcFolder ) . isDirectory ( ) ) { try ( FileOutputStream fileWriter = new FileOutputStream ( destZipFile ) ; ZipOutputStream zip = new ZipOutputStream ( fileWriter ) ) { addFolderToZip ( "" , srcFolder , zip , addBaseFolder ) ; // $ NON - NLS - 1 $ } } else { throw new IOException ( srcFolder + " is not...
public class SignatureFileVerifier { /** * returns true if signer contains exactly the same code signers as * oldSigner and newSigner , false otherwise . oldSigner * is allowed to be null . */ static boolean matches ( CodeSigner [ ] signers , CodeSigner [ ] oldSigners , CodeSigner [ ] newSigners ) { } }
// special case if ( ( oldSigners == null ) && ( signers == newSigners ) ) return true ; boolean match ; // make sure all oldSigners are in signers if ( ( oldSigners != null ) && ! isSubSet ( oldSigners , signers ) ) return false ; // make sure all newSigners are in signers if ( ! isSubSet ( newSigners , signers ) ) { ...
public class ActiveSyncManager { /** * Apply AddSyncPoint entry and journal the entry . * @ param context journal context * @ param entry addSyncPoint entry */ public void applyAndJournal ( Supplier < JournalContext > context , AddSyncPointEntry entry ) { } }
try { apply ( entry ) ; context . get ( ) . append ( Journal . JournalEntry . newBuilder ( ) . setAddSyncPoint ( entry ) . build ( ) ) ; } catch ( Throwable t ) { ProcessUtils . fatalError ( LOG , t , "Failed to apply %s" , entry ) ; throw t ; // fatalError will usually system . exit }
public class AliPayApi { /** * 电脑网站支付 ( PC支付 ) * @ param httpResponse * { HttpServletResponse } * @ param model * { AlipayTradePagePayModel } * @ param notifyUrl * 异步通知URL * @ param returnUrl * 同步通知URL * @ throws { AlipayApiException } * @ throws { IOException } */ public static void tradePage ( Htt...
AlipayTradePagePayRequest request = new AlipayTradePagePayRequest ( ) ; request . setBizModel ( model ) ; request . setNotifyUrl ( notifyUrl ) ; request . setReturnUrl ( returnUrl ) ; String form = AliPayApiConfigKit . getAliPayApiConfig ( ) . getAlipayClient ( ) . pageExecute ( request ) . getBody ( ) ; // 调用SDK生成表单 h...
public class ProposalLineItem { /** * Gets the lastReservationDateTime value for this ProposalLineItem . * @ return lastReservationDateTime * The last { @ link DateTime } when the { @ link ProposalLineItem } * reserved inventory . * This attribute is read - only . */ public com . google . api . ads . admanager . ...
return lastReservationDateTime ;