signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class RequesterService { /** * < p > This implementation converts a given list to a json string . * Due to json string may have reserved keyword that can confuse * { @ link Config } , we first use Base64 to encode the json string , * then use URL encoding to remove characters like ' + , / , = ' . */ public...
String jsonList = objectMapper . writeValueAsString ( requesterList ) ; String base64Str = Base64 . getEncoder ( ) . encodeToString ( jsonList . getBytes ( "UTF-8" ) ) ; return URLEncoder . encode ( base64Str , "UTF-8" ) ;
public class CompactingHashTable { /** * This function hashes an integer value . It is adapted from Bob Jenkins ' website * < a href = " http : / / www . burtleburtle . net / bob / hash / integer . html " > http : / / www . burtleburtle . net / bob / hash / integer . html < / a > . * The hash function has the < i >...
code = ( code + 0x7ed55d16 ) + ( code << 12 ) ; code = ( code ^ 0xc761c23c ) ^ ( code >>> 19 ) ; code = ( code + 0x165667b1 ) + ( code << 5 ) ; code = ( code + 0xd3a2646c ) ^ ( code << 9 ) ; code = ( code + 0xfd7046c5 ) + ( code << 3 ) ; code = ( code ^ 0xb55a4f09 ) ^ ( code >>> 16 ) ; return code >= 0 ? code : - ( cod...
public class ApiKeyRealm { /** * Simple method to build and AuthenticationInfo instance from an API key . */ private ApiKeyAuthenticationInfo createAuthenticationInfo ( String authenticationId , ApiKey apiKey ) { } }
return new ApiKeyAuthenticationInfo ( authenticationId , apiKey , getName ( ) ) ;
public class LogPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getExtendedDataAddedToRevision ( ) { } }
if ( extendedDataAddedToRevisionEClass == null ) { extendedDataAddedToRevisionEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( LogPackage . eNS_URI ) . getEClassifiers ( ) . get ( 29 ) ; } return extendedDataAddedToRevisionEClass ;
public class FileIoUtil { /** * Loads the contents of a properties file located in the Java classpath * into a { @ link Properties } object . * @ param _ propertiesFile properties file located in Java classpath * @ return properties object * @ throws IOException if file not found or loading fails for other I / ...
InputStream is = FileIoUtil . class . getClassLoader ( ) . getResourceAsStream ( _propertiesFile ) ; if ( is == null ) { throw new IOException ( "Resource [" + _propertiesFile + "] not found in classpath." ) ; } Properties props = readProperties ( is ) ; return props ;
public class Alias { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . runtime . SIMPAliasControllable # getDefaultReliability ( ) */ public Reliability getDefaultReliability ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getDefaultReliability" ) ; Reliability rel = aliasDest . getDefaultReliability ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getDefaultReliability" , rel ) ; return re...
public class MDAG { /** * Determines the longest prefix of a given String that is * the prefix of another String previously added to the MDAG . * @ param str the String to be processed * @ return a String of the longest prefix of { @ code str } * that is also a prefix of a String contained in the MDAG */ privat...
MDAGNode currentNode = sourceNode ; int numberOfChars = str . length ( ) ; int onePastPrefixEndIndex = 0 ; // Loop through the characters in str , using them in sequence to _ transition // through the MDAG until the currently processing node doesn ' t have a _ transition // labeled with the current processing char , or...
public class JsonJacksonImpl { /** * 将对象转成json . * @ param obj 对象 * @ return */ @ Override public String toFormatJson ( Object obj ) { } }
if ( obj == null ) { return null ; } try { return writer . writeValueAsString ( obj ) ; } catch ( Exception e ) { throw new JsonException ( e . getMessage ( ) , e ) ; }
public class ParaClient { /** * Deletes an object permanently . * @ param < P > the type of object * @ param obj the object */ public < P extends ParaObject > void delete ( P obj ) { } }
if ( obj == null || obj . getId ( ) == null ) { return ; } invokeDelete ( obj . getType ( ) . concat ( "/" ) . concat ( obj . getId ( ) ) , null ) ;
public class StringHelper { /** * Get a concatenated String from all elements of the passed array , without a * separator . * @ param aElements * The container to convert . May be < code > null < / code > or empty . * @ return The concatenated string . * @ param < ELEMENTTYPE > * The type of elements to be ...
return getImplodedMapped ( aElements , String :: valueOf ) ;
public class PAXWicketFilterChain { /** * { @ inheritDoc } */ public void doFilter ( ServletRequest request , ServletResponse response ) throws IOException , ServletException { } }
int size = filters . size ( ) ; if ( filterIndex < size ) { Filter filter = filters . get ( filterIndex ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "call filter {}/{} of type {} " , new Object [ ] { ( filterIndex + 1 ) , size , filter . getClass ( ) . getName ( ) } ) ; } filterIndex ++ ; filter . doFilter...
public class CamerasInterface { /** * Returns all the brands of cameras that Flickr knows about . * This method does not require authentication . * @ return List of Brands * @ throws FlickrException */ public List < Camera > getBrandModels ( String strBrand ) throws FlickrException { } }
Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_BRAND_MODELS ) ; parameters . put ( "brand" , strBrand ) ; Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { thro...
public class AbstractVectorModel { /** * 获取与向量最相似的词语 ( 默认10个 ) * @ param vector 向量 * @ return 键值对列表 , 键是相似词语 , 值是相似度 , 按相似度降序排列 */ public List < Map . Entry < K , Float > > nearest ( Vector vector ) { } }
return nearest ( vector , 10 ) ;
public class Quarters { /** * / * [ deutsch ] * < p > Bestimmt die gregorianische Quartalsdifferenz zwischen den angegebenen Zeitpunkten . < / p > * @ param < T > generic type of time - points * @ param t1 first time - point * @ param t2 second time - point * @ return result of difference in quarter years *...
long delta = CalendarUnit . QUARTERS . between ( t1 , t2 ) ; return Quarters . of ( MathUtils . safeCast ( delta ) ) ;
public class RecordingService { /** * Changes recording from starting to started , updates global recording * collections and sends RPC response to clients */ protected void updateRecordingManagerCollections ( Session session , Recording recording ) { } }
this . recordingManager . sessionHandler . setRecordingStarted ( session . getSessionId ( ) , recording ) ; this . recordingManager . sessionsRecordings . put ( session . getSessionId ( ) , recording ) ; this . recordingManager . startingRecordings . remove ( recording . getId ( ) ) ; this . recordingManager . startedR...
public class MessageBuilder { /** * Adds an attachment to the message and marks it as spoiler . * @ param stream The stream of the file . * @ param fileName The name of the file . * @ return The current instance in order to chain call methods . */ public MessageBuilder addAttachmentAsSpoiler ( InputStream stream ...
delegate . addAttachment ( stream , "SPOILER_" + fileName ) ; return this ;
public class LocalDateKitCalculatorsFactory { /** * Return a builder using the registered calendars / working weeks and a Modified Forward Holiday handler for the currency pair ; . * If you want to change some of the parameters , simply modify the Builder returned and pass it to the constructor of the * calculator ...
final CurrencyDateCalculatorBuilder < LocalDate > builder = new CurrencyDateCalculatorBuilder < LocalDate > ( ) . currencyPair ( ccy1 , ccy2 , spotLag ) ; return configureCurrencyCalculatorBuilder ( builder ) . tenorHolidayHandler ( new LocalDateModifiedFollowingHandler ( ) ) ;
public class ComparatorUtils { /** * Wraps an exiting { @ link Comparator } in a null - safe , delegating { @ link Comparator } implementation to protect * against { @ literal null } arguments passed to the { @ literal compare } method . * Sorts ( order ) { @ literal null } values last . * @ param < T > Class typ...
return ( T obj1 , T obj2 ) -> ( obj1 == null ? 1 : ( obj2 == null ? - 1 : delegate . compare ( obj1 , obj2 ) ) ) ;
public class MetamodelUtil { /** * Retrieves cascade from metamodel attribute * @ param attribute given pluaral attribute * @ return an empty collection if no jpa relation annotation can be found . */ public Collection < CascadeType > getCascades ( PluralAttribute < ? , ? , ? > attribute ) { } }
if ( attribute . getJavaMember ( ) instanceof AccessibleObject ) { AccessibleObject accessibleObject = ( AccessibleObject ) attribute . getJavaMember ( ) ; OneToMany oneToMany = accessibleObject . getAnnotation ( OneToMany . class ) ; if ( oneToMany != null ) { return newArrayList ( oneToMany . cascade ( ) ) ; } ManyTo...
public class DamerauLevenshteinAlgorithm { /** * Compute the Damerau - Levenshtein distance between the specified source * string and the specified target string . */ static int execute ( String source , String target ) { } }
if ( source . length ( ) == 0 ) { return target . length ( ) * INSERT_COST ; } if ( target . length ( ) == 0 ) { return source . length ( ) * DELETE_COST ; } int [ ] [ ] table = new int [ source . length ( ) ] [ target . length ( ) ] ; Map < Character , Integer > sourceIndexByCharacter = new HashMap < > ( ) ; if ( sour...
public class BucketTimeSeries { /** * Gets the end - points by an offset to now , i . e . , 0 means to get the now bucket , - 1 gets the previous bucket , and + 1 * will get the next bucket . * @ param bucketsFromNow the amount of buckets to retrieve using now as anchor * @ return the end - point ( bucket ) with ...
if ( currentNowIdx == - 1 || now == null ) { throw new IllegalTimePoint ( "The now is not set yet, thus no end-points can be returned" ) ; } return now . move ( bucketsFromNow ) ;
public class PassthroughResourcesImpl { /** * Passthrough request * @ param method HTTP method * @ param endpoint the API endpoint ( required ) * @ param payload optional JSON payload * @ param parameters optional list of resource parameters * @ return the result string * @ throws SmartsheetException */ pri...
Util . throwIfNull ( endpoint ) ; Util . throwIfEmpty ( endpoint ) ; if ( parameters != null ) endpoint += QueryUtil . generateUrl ( null , parameters ) ; HttpRequest request = createHttpRequest ( smartsheet . getBaseURI ( ) . resolve ( endpoint ) , method ) ; if ( payload != null ) { HttpEntity entity = new HttpEntity...
public class SeaGlassProgressBarUI { /** * Paint the actual internal progress bar . * @ param context * @ param g2d * @ param width * @ param height * @ param size * @ param isFinished */ private void paintProgressIndicator ( SeaGlassContext context , Graphics2D g2d , int width , int height , int size , boo...
JProgressBar pBar = ( JProgressBar ) context . getComponent ( ) ; if ( tileWhenIndeterminate && pBar . isIndeterminate ( ) ) { double offsetFraction = ( double ) getAnimationIndex ( ) / ( double ) getFrameCount ( ) ; int offset = ( int ) ( offsetFraction * tileWidth ) ; if ( pBar . getOrientation ( ) == JProgressBar . ...
public class FileUtils { /** * Returns the contents of a file into a String object . < br / > * Please be careful when using this with large files * @ param fileName * the name of the file * @ param encoding * the file encoding . Examples : " UTF - 8 " , " UTF - 16" * @ return a String object with the conte...
return this . getFileContentsAsString ( new File ( fileName ) , encoding ) ;
public class HttpResponse { /** * Parses the content of the HTTP response from { @ link # getContent ( ) } and reads it into a data * type of key / value pairs using the parser returned by { @ link HttpRequest # getParser ( ) } . * @ return parsed data type instance or { @ code null } for no content * @ since 1.1...
if ( ! hasMessageBody ( ) ) { return null ; } return request . getParser ( ) . parseAndClose ( getContent ( ) , getContentCharset ( ) , dataType ) ;
public class AstaDatabaseReader { /** * Retrieves basic meta data from the result set . * @ throws SQLException */ private void populateMetaData ( ) throws SQLException { } }
m_meta . clear ( ) ; ResultSetMetaData meta = m_rs . getMetaData ( ) ; int columnCount = meta . getColumnCount ( ) + 1 ; for ( int loop = 1 ; loop < columnCount ; loop ++ ) { String name = meta . getColumnName ( loop ) ; Integer type = Integer . valueOf ( meta . getColumnType ( loop ) ) ; m_meta . put ( name , type ) ;...
public class SepaUtil { /** * Liefert ein Value - Objekt mit den Summen des Auftrages . * @ param properties Auftrags - Properties . * @ return das Value - Objekt mit der Summe . */ public static Value sumBtgValueObject ( HashMap < String , String > properties ) { } }
Integer maxIndex = maxIndex ( properties ) ; BigDecimal btg = sumBtgValue ( properties , maxIndex ) ; String curr = properties . get ( insertIndex ( "btg.curr" , maxIndex == null ? null : 0 ) ) ; return new Value ( btg , curr ) ;
public class Activator { /** * { @ inheritDoc } */ public final void stop ( BundleContext context ) throws Exception { } }
bundleTrackerAggregator . close ( ) ; httpTracker . close ( ) ; bundleContext = null ; LOGGER . debug ( "Stopped [{}] bundle." , context . getBundle ( ) . getSymbolicName ( ) ) ;
public class UserHandlerImpl { /** * Checks if credentials matches . */ private boolean authenticate ( Session session , String userName , String password , PasswordEncrypter pe ) throws Exception { } }
boolean authenticated ; Node userNode ; try { userNode = utils . getUserNode ( session , userName ) ; } catch ( PathNotFoundException e ) { return false ; } boolean enabled = userNode . canAddMixin ( JCROrganizationServiceImpl . JOS_DISABLED ) ; if ( ! enabled ) { throw new DisabledUserException ( userName ) ; } if ( p...
public class DefaultCopycatClient { /** * Kills the client . * @ return A completable future to be completed once the client ' s session has been killed . */ public synchronized CompletableFuture < Void > kill ( ) { } }
if ( state == State . CLOSED ) return CompletableFuture . completedFuture ( null ) ; if ( closeFuture == null ) { closeFuture = session . kill ( ) . whenComplete ( ( result , error ) -> { setState ( State . CLOSED ) ; CompletableFuture . runAsync ( ( ) -> { ioContext . close ( ) ; eventContext . close ( ) ; transport ....
public class PerformanceTarget { /** * Gets the efficiencyTargetType value for this PerformanceTarget . * @ return efficiencyTargetType * This property specifies desired outcomes for some clicks , conversions * or impressions * statistic for the given time period . It ' s usually * a constraint on the volume go...
return efficiencyTargetType ;
public class GlobalUsersInner { /** * Gets the status of long running operation . * @ param userName The name of the user . * @ param operationUrl The operation url of long running operation * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the OperationSt...
return getOperationStatusWithServiceResponseAsync ( userName , operationUrl ) . map ( new Func1 < ServiceResponse < OperationStatusResponseInner > , OperationStatusResponseInner > ( ) { @ Override public OperationStatusResponseInner call ( ServiceResponse < OperationStatusResponseInner > response ) { return response . ...
public class PanelUserDAO { /** * Updates panel user ' s role * @ param panelUser panel user * @ param panelUserRole new role * @ param modifier modifier * @ return updated user */ public PanelUser updateRole ( PanelUser panelUser , PanelUserRole panelUserRole , User modifier ) { } }
panelUser . setRole ( panelUserRole ) ; panelUser . setLastModified ( new Date ( ) ) ; panelUser . setLastModifier ( modifier ) ; return persist ( panelUser ) ;
public class CamelCloudClient { /** * Helpers */ private int doPublish ( boolean isControl , String deviceId , String topic , KuraPayload kuraPayload , int qos , boolean retain , int priority ) throws KuraException { } }
String target = target ( applicationId + ":" + topic ) ; int kuraMessageId = Math . abs ( new Random ( ) . nextInt ( ) ) ; Map < String , Object > headers = new HashMap < > ( ) ; headers . put ( CAMEL_KURA_CLOUD_CONTROL , isControl ) ; headers . put ( CAMEL_KURA_CLOUD_MESSAGEID , kuraMessageId ) ; headers . put ( CAMEL...
public class RecordFile { /** * Appends a record to this record file , recalculating the * { @ link # getSize ( ) size } and { @ link # getRecordCount ( ) record count } . * @ param bytes { @ code byte [ ] } with length { @ link # getRecordSize ( ) } * @ throws IOException Thrown if an I / O error occurs during w...
if ( readonly ) { throw new UnsupportedOperationException ( RO_MSG ) ; } if ( bytes . length != recordSize ) { final String fmt = "invalid write of %d bytes, expected %d" ; final String msg = format ( fmt , bytes . length , recordSize ) ; throw new InvalidArgument ( msg ) ; } raf . write ( bytes ) ; // write succeeded ...
public class OtpOutputStream { /** * ( non - Javadoc ) * @ see java . io . ByteArrayOutputStream # write ( byte [ ] , int , int ) */ @ Override public synchronized void write ( final byte [ ] b , final int off , final int len ) { } }
if ( off < 0 || off > b . length || len < 0 || off + len - b . length > 0 ) { throw new IndexOutOfBoundsException ( ) ; } ensureCapacity ( super . count + len ) ; System . arraycopy ( b , off , super . buf , super . count , len ) ; super . count += len ;
public class PersonGroupPersonsImpl { /** * Retrieve information about a persisted face ( specified by persistedFaceId , personId and its belonging personGroupId ) . * @ param personGroupId Id referencing a particular person group . * @ param personId Id referencing a particular person . * @ param persistedFaceId...
return getFaceWithServiceResponseAsync ( personGroupId , personId , persistedFaceId ) . map ( new Func1 < ServiceResponse < PersistedFace > , PersistedFace > ( ) { @ Override public PersistedFace call ( ServiceResponse < PersistedFace > response ) { return response . body ( ) ; } } ) ;
public class UrlUtils { /** * Changes the first character to uppercase . * @ param string * String . * @ return Same string with first character in uppercase . */ public String capitalize ( String string ) { } }
if ( string == null || string . length ( ) < 1 ) { return "" ; } return string . substring ( 0 , 1 ) . toUpperCase ( ) + string . substring ( 1 ) ;
public class Utilities { /** * A realiable way to wait for the thread termination * @ param thread thread to wait for */ public static void waitThreadTermination ( Thread thread ) { } }
while ( thread != null && thread . isAlive ( ) ) { thread . interrupt ( ) ; try { thread . join ( ) ; } catch ( InterruptedException e ) { } }
public class IfcClassificationReferenceImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcClassificationReference > getHasReferences ( ) { } }
return ( EList < IfcClassificationReference > ) eGet ( Ifc4Package . Literals . IFC_CLASSIFICATION_REFERENCE__HAS_REFERENCES , true ) ;
public class AnnotationMappingInfo { /** * JAXB用のクラス情報を設定するメソッド 。 * < p > XMLの読み込み時に呼ばれます 。 * < br > ただし 、 Java8からはこのメソッドは呼ばれず 、 { @ link # getClassInfos ( ) } で取得したインスタンスに対して要素が追加されます 。 * < p > 既存の情報はクリアされます 。 < / p > * @ since 1.1 * @ param classInfos クラス情報 */ public void setClassInfos ( final List ...
if ( classInfos == this . classInfos ) { // Java7の場合 、 getterで取得したインスタンスをそのまま設定するため 、 スキップする 。 return ; } this . classInfos . clear ( ) ; for ( ClassInfo item : classInfos ) { addClassInfo ( item ) ; }
public class FunctionTypes { /** * / * @ Nullable */ public FunctionTypeReference getAsFunctionTypeReference ( ParameterizedTypeReference typeReference ) { } }
FunctionTypeKind functionTypeKind = getFunctionTypeKind ( typeReference ) ; if ( functionTypeKind == FunctionTypeKind . PROCEDURE ) { return getAsProcedureOrNull ( typeReference ) ; } else if ( functionTypeKind == FunctionTypeKind . FUNCTION ) { return getAsFunctionOrNull ( typeReference ) ; } return null ;
public class JSONAnnie { /** * Parse the JSON given to the constructor and call the given listener as each construct * is found . An IllegalArgumentException is thrown if a syntax error or unsupported JSON * construct is found . * @ param listener Callback for SAJ eve . ts * @ throws IllegalArgumentException If...
assert listener != null ; // We require the first construct to be an object with no leading whitespace . m_stackPos = 0 ; char ch = m_input . nextChar ( false ) ; check ( ch == '{' , "First character must be '{': " + ch ) ; // Mark outer ' [ ' with a " ghost " object . push ( Construct . GHOST ) ; // Enter the state ma...
public class TableWriteItems { /** * Used to specify the collection of items to be put in the current table in * a batch write operation . * @ return the current instance for method chaining purposes */ public TableWriteItems withItemsToPut ( Collection < Item > itemsToPut ) { } }
if ( itemsToPut == null ) this . itemsToPut = null ; else this . itemsToPut = new ArrayList < Item > ( itemsToPut ) ; return this ;
public class QueryTemplate { /** * Append a value to the Query Template . * @ param queryTemplate to append to . * @ param values to append . * @ return a new QueryTemplate with value appended . */ public static QueryTemplate append ( QueryTemplate queryTemplate , Iterable < String > values , CollectionFormat col...
List < String > queryValues = new ArrayList < > ( queryTemplate . getValues ( ) ) ; queryValues . addAll ( StreamSupport . stream ( values . spliterator ( ) , false ) . filter ( Util :: isNotBlank ) . collect ( Collectors . toList ( ) ) ) ; return create ( queryTemplate . getName ( ) , queryValues , queryTemplate . get...
public class LocalFileEntityResolver { /** * Resolve the given entity locally . */ public InputSource resolveLocalEntity ( String systemID ) throws SAXException , IOException { } }
String localFileName = systemID ; int fileNameStart = localFileName . lastIndexOf ( '/' ) + 1 ; if ( fileNameStart < localFileName . length ( ) ) { localFileName = systemID . substring ( fileNameStart ) ; } ClassLoader cl = LocalFileEntityResolver . class . getClassLoader ( ) ; InputStream stream = cl . getResourceAsSt...
public class ExecutionControllerUtils { /** * When a flow is finished , alert the user as is configured in the execution options . * @ param flow the execution * @ param alerterHolder the alerter holder * @ param extraReasons the extra reasons for alerting */ public static void alertUserOnFlowFinished ( final Exe...
final ExecutionOptions options = flow . getExecutionOptions ( ) ; final Alerter mailAlerter = alerterHolder . get ( "email" ) ; if ( flow . getStatus ( ) != Status . SUCCEEDED ) { if ( options . getFailureEmails ( ) != null && ! options . getFailureEmails ( ) . isEmpty ( ) ) { try { mailAlerter . alertOnError ( flow , ...
public class CalendarViewSkin { /** * Refresh entries from specific page < b > ( Selected Page ) < / b > . It is called * after change selected Page ( ButtonSwitcher ) or check / uncheck any * CalendarSource . */ private void updateCalendarVisibility ( ) { } }
CalendarView view = getSkinnable ( ) ; if ( view . getSelectedPage ( ) == view . getDayPage ( ) ) { view . getDayPage ( ) . refreshData ( ) ; } else if ( view . getSelectedPage ( ) == view . getWeekPage ( ) ) { view . getWeekPage ( ) . refreshData ( ) ; }
public class ValueNumberFrameModelingVisitor { /** * Push given output values onto the current frame . */ private void pushOutputValues ( ValueNumber [ ] outputValueList ) { } }
ValueNumberFrame frame = getFrame ( ) ; for ( ValueNumber aOutputValueList : outputValueList ) { frame . pushValue ( aOutputValueList ) ; }
public class Box { /** * Rotate box within a free space in 2D * @ param dimension space to fit within * @ return if this object fits within the input dimensions */ boolean fitRotate2D ( Dimension dimension ) { } }
if ( dimension . getHeight ( ) < height ) { return false ; } return fitRotate2D ( dimension . getWidth ( ) , dimension . getDepth ( ) ) ;
public class DeploymentScannerExtension { /** * { @ inheritDoc } */ @ Override public void initialize ( ExtensionContext context ) { } }
ROOT_LOGGER . debug ( "Initializing Deployment Scanner Extension" ) ; if ( context . getProcessType ( ) . isHostController ( ) ) { throw DeploymentScannerLogger . ROOT_LOGGER . deploymentScannerNotForDomainMode ( ) ; } final SubsystemRegistration subsystem = context . registerSubsystem ( CommonAttributes . DEPLOYMENT_S...
public class CertificateItem { /** * Set the x509Thumbprint value . * @ param x509Thumbprint the x509Thumbprint value to set * @ return the CertificateItem object itself . */ public CertificateItem withX509Thumbprint ( byte [ ] x509Thumbprint ) { } }
if ( x509Thumbprint == null ) { this . x509Thumbprint = null ; } else { this . x509Thumbprint = Base64Url . encode ( x509Thumbprint ) ; } return this ;
public class AppLogger { /** * Send a INFO log message and log the exception . * @ param msg The message you would like logged . * @ param thr An exception to log */ public static void i ( String msg , Throwable thr ) { } }
if ( DEBUG ) Log . i ( TAG , buildMessage ( msg ) , thr ) ;
public class DateIntervalInfo { /** * Break interval patterns as 2 part and save them into pattern info . * @ param intervalPattern interval pattern * @ param laterDateFirst whether the first date in intervalPattern * is earlier date or later date * @ return pattern info object * @ deprecated This API is ICU ...
int splitPoint = splitPatternInto2Part ( intervalPattern ) ; String firstPart = intervalPattern . substring ( 0 , splitPoint ) ; String secondPart = null ; if ( splitPoint < intervalPattern . length ( ) ) { secondPart = intervalPattern . substring ( splitPoint , intervalPattern . length ( ) ) ; } return new PatternInfo...
public class YankBeanProcessor { /** * The positions in the returned array represent column numbers . The values stored at each * position represent the index in the < code > PropertyDescriptor [ ] < / code > for the bean property * that matches the column name . Also tried to match snake case column names or overr...
final int cols = rsmd . getColumnCount ( ) ; final int [ ] columnToProperty = new int [ cols + 1 ] ; Arrays . fill ( columnToProperty , PROPERTY_NOT_FOUND ) ; for ( int col = 1 ; col <= cols ; col ++ ) { String columnName = rsmd . getColumnLabel ( col ) ; if ( null == columnName || 0 == columnName . length ( ) ) { colu...
public class HashUserRealm { public Principal popRole ( Principal user ) { } }
WrappedUser wu = ( WrappedUser ) user ; return wu . getUserPrincipal ( ) ;
public class DataFrameJoiner { /** * Full outer join to the given tables assuming that they have a column of the name we ' re joining on * @ param allowDuplicateColumnNames if { @ code false } the join will fail if any columns other than the join column have the same name * if { @ code true } the join will succeed ...
Table joined = table ; for ( Table currT : tables ) { joined = fullOuter ( joined , currT , allowDuplicateColumnNames , columnNames ) ; } return joined ;
public class DetectorStreamBufferImpl { /** * This method is called when a { @ link ByteArray } is wiped out of the chain . * @ param byteArray is the array to release . */ protected void release ( ByteArray byteArray ) { } }
if ( byteArray instanceof PooledByteArray ) { PooledByteArray pooledArray = ( PooledByteArray ) byteArray ; if ( pooledArray . release ( ) ) { this . byteArrayPool . release ( byteArray . getBytes ( ) ) ; } }
public class JmsTopicImpl { /** * Get the topicSpace . * @ return the topicSpace * @ see JmsDestinationImpl # getDestName */ @ Override public String getTopicSpace ( ) throws JMSException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getTopicSpace" ) ; String result = getDestName ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getTopicSpace" , result ) ; return result ;
public class ViewpointsAndPerspectivesDocumentationTemplate { /** * Adds an " Architectural Forces " section relating to a { @ link SoftwareSystem } from one or more files . * @ param softwareSystem the { @ link SoftwareSystem } the documentation content relates to * @ param files one or more File objects that poin...
return addSection ( softwareSystem , "Architectural Forces" , files ) ;
public class AdaptableX509CertSelector { /** * Decides whether a < code > Certificate < / code > should be selected . * For the purpose of compatibility , when a certificate is of * version 1 and version 2 , or the certificate does not include * a subject key identifier extension , the selection criterion * of ...
if ( ! ( cert instanceof X509Certificate ) ) { return false ; } X509Certificate xcert = ( X509Certificate ) cert ; int version = xcert . getVersion ( ) ; // Check the validity period for version 1 and 2 certificate . if ( version < 3 ) { if ( startDate != null ) { try { xcert . checkValidity ( startDate ) ; } catch ( C...
public class GeometryUtil { /** * Translates the geometric 2DCenter of the given AtomContainer container to the specified * Point2d p . * @ param container AtomContainer which should be translated . * @ param p New Location of the geometric 2D Center . * @ see # get2DCenter * @ see # translate2DCentreOfMassTo...
Point2d com = get2DCenter ( container ) ; Vector2d translation = new Vector2d ( p . x - com . x , p . y - com . y ) ; for ( IAtom atom : container . atoms ( ) ) { if ( atom . getPoint2d ( ) != null ) { atom . getPoint2d ( ) . add ( translation ) ; } }
public class EventMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Event event , ProtocolMarshaller protocolMarshaller ) { } }
if ( event == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( event . getArn ( ) , ARN_BINDING ) ; protocolMarshaller . marshall ( event . getService ( ) , SERVICE_BINDING ) ; protocolMarshaller . marshall ( event . getEventTypeCode ( ) , EV...
public class DexParser { /** * read Modified UTF - 8 encoding str . * @ param strLen the java - utf16 - char len , not strLen nor bytes len . */ private String readString ( int strLen ) { } }
char [ ] chars = new char [ strLen ] ; for ( int i = 0 ; i < strLen ; i ++ ) { short a = Buffers . readUByte ( buffer ) ; if ( ( a & 0x80 ) == 0 ) { // ascii char chars [ i ] = ( char ) a ; } else if ( ( a & 0xe0 ) == 0xc0 ) { // read one more short b = Buffers . readUByte ( buffer ) ; chars [ i ] = ( char ) ( ( ( a & ...
public class HistoryMethodBinding { /** * ObjectUtils . equals is replaced by a JDK7 method . . */ @ Override public boolean incomingServerRequestMatchesMethod ( RequestDetails theRequest ) { } }
if ( ! Constants . PARAM_HISTORY . equals ( theRequest . getOperation ( ) ) ) { return false ; } if ( theRequest . getResourceName ( ) == null ) { return myResourceOperationType == RestOperationTypeEnum . HISTORY_SYSTEM ; } if ( ! StringUtils . equals ( theRequest . getResourceName ( ) , myResourceName ) ) { return fal...
public class SingularityClient { /** * Get all requests that has been set to a COOLDOWN state by singularity * @ return * All { @ link SingularityRequestParent } instances that their state is COOLDOWN */ public Collection < SingularityRequestParent > getCoolDownSingularityRequests ( ) { } }
final Function < String , String > requestUri = ( host ) -> String . format ( REQUESTS_GET_COOLDOWN_FORMAT , getApiBase ( host ) ) ; return getCollection ( requestUri , "COOLDOWN requests" , REQUESTS_COLLECTION ) ;
public class CertPathBuilder { /** * Returns a { @ code CertPathBuilder } object that implements the * specified algorithm . * < p > A new CertPathBuilder object encapsulating the * CertPathBuilderSpi implementation from the specified Provider * object is returned . Note that the specified Provider object * d...
Instance instance = GetInstance . getInstance ( "CertPathBuilder" , CertPathBuilderSpi . class , algorithm , provider ) ; return new CertPathBuilder ( ( CertPathBuilderSpi ) instance . impl , instance . provider , algorithm ) ;
public class JDBC4PreparedStatement { /** * Sets the designated parameter to the given Java float value . */ @ Override public void setFloat ( int parameterIndex , float x ) throws SQLException { } }
checkParameterBounds ( parameterIndex ) ; this . parameters [ parameterIndex - 1 ] = ( double ) x ;
public class ADischargeDistributor { /** * Creates a { @ link ADischargeDistributor discharge distributor } . * @ param distributorType defines the type to be used . Possible values are : * < ul > * < li > { @ link ADischargeDistributor # DISTRIBUTOR _ TYPE _ NASH NASH : 0 } < / li > * < / ul > * @ param star...
if ( distributorType == DISTRIBUTOR_TYPE_NASH ) { return new NashDischargeDistributor ( startDateMillis , endDateMillis , timeStepMillis , parameters ) ; } else { throw new IllegalArgumentException ( "No such distribution model available." ) ; }
public class BuildsInner { /** * Gets a link to download the build logs . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param buildId The build ID . * @ throws IllegalArgumentException thrown i...
return getLogLinkWithServiceResponseAsync ( resourceGroupName , registryName , buildId ) . toBlocking ( ) . single ( ) . body ( ) ;
public class CommonFeatureStringGenerator { /** * Creates State to represent the entity feature . * @ param ef feature to represent * @ param factory factory that can create the State class * @ return State representing the feature */ public Glyph . State createStateVar ( EntityFeature ef , ObjectFactory factory ...
if ( ef instanceof FragmentFeature ) { FragmentFeature ff = ( FragmentFeature ) ef ; SequenceLocation loc = ff . getFeatureLocation ( ) ; if ( loc instanceof SequenceInterval ) { SequenceInterval si = ( SequenceInterval ) loc ; SequenceSite begin = si . getSequenceIntervalBegin ( ) ; SequenceSite end = si . getSequence...
public class ModelUtils { /** * Resolves a setter method for a field . * @ param field The field * @ return An optional setter method */ Optional < ExecutableElement > findGetterMethodFor ( Element field ) { } }
String getterName = getterNameFor ( field ) ; // FIXME refine this to discover one of possible overloaded methods with correct signature ( i . e . single arg of field type ) TypeElement typeElement = classElementFor ( field ) ; if ( typeElement == null ) { return Optional . empty ( ) ; } List < ? extends Element > elem...
public class StatisticsControl { /** * returns empty list if not in domain mode */ private List < String > getDomainHostServers ( ModelControllerClient mcc , String hostName ) { } }
return getChildrenNames ( PathAddress . EMPTY_ADDRESS . append ( "host" , hostName ) , "server" , mcc ) ;
public class PropertyConnectionCalculator { /** * Calculates the connections of properties of the source and target model of a transformation description . Returns * a map where the keys are the properties of the source model and the values are a set of property names which are * influenced if the key property is c...
Map < String , Set < String > > propertyMap = getSourceProperties ( description . getSourceModel ( ) ) ; fillPropertyMap ( propertyMap , description ) ; resolveTemporaryProperties ( propertyMap ) ; deleteTemporaryProperties ( propertyMap ) ; return propertyMap ;
public class EsIndexColumn { /** * Converts given value to the value of JCR type of this column . * @ param value value to be converted . * @ return converted value . */ protected Object cast ( Object value ) { } }
switch ( type ) { case STRING : return valueFactories . getStringFactory ( ) . create ( value ) ; case LONG : return valueFactories . getLongFactory ( ) . create ( value ) ; case NAME : return valueFactories . getNameFactory ( ) . create ( value ) ; case PATH : return valueFactories . getPathFactory ( ) . create ( valu...
public class ClassInclusion { /** * end nestedClassesOf ( . . . ) */ public static ClassInclusion classOf ( final Class < ? > proposedClass ) { } }
return new ClassInclusion ( ) { @ Override public Class [ ] propose ( ) { if ( proposedClass . isAssignableFrom ( ThirdPartyParseable . class ) && Modifier . isAbstract ( proposedClass . getModifiers ( ) ) ) return new Class [ ] { proposedClass } ; return new Class [ ] { proposedClass } ; } // end propose ( ) } ;
public class NoteLinkNameIndexRenderer { /** * { @ inheritDoc } */ @ Override public String getIndexName ( ) { } }
final NoteLink noteLink = noteLinkRenderer . getGedObject ( ) ; if ( ! noteLink . isSet ( ) ) { return "" ; } final Note note = ( Note ) noteLink . find ( noteLink . getToString ( ) ) ; if ( note == null ) { // Prevents problems with malformed file return noteLink . getToString ( ) ; } final NoteRenderer noteRenderer =...
public class TabbedPaneView { /** * Builds the button bar . * @ param isHorizontal the is horizontal * @ return the pane */ private Pane buildButtonBar ( final boolean isHorizontal ) { } }
if ( isHorizontal ) { this . box = new HBox ( ) ; this . box . setMaxWidth ( Region . USE_COMPUTED_SIZE ) ; this . box . getStyleClass ( ) . add ( "HorizontalTabbedPane" ) ; } else { this . box = new VBox ( ) ; this . box . setMaxHeight ( Region . USE_COMPUTED_SIZE ) ; this . box . getStyleClass ( ) . add ( "VerticalTa...
public class RuleContext { /** * Adds more data providers to the validator . * @ param dataProviders Data providers to be added . * @ return Same rule context . */ public RuleContext < D > read ( final DataProvider < D > ... dataProviders ) { } }
if ( dataProviders != null ) { Collections . addAll ( registeredDataProviders , dataProviders ) ; } return this ;
public class JAXBSerialiser { /** * Helper method to print a serialised object to stdout ( for dev / debugging use ) * @ param obj */ public static void print ( final Object obj ) { } }
System . out . println ( getInstance ( obj . getClass ( ) ) . serialise ( obj ) ) ;
public class SimpleClient { /** * { @ inheritDoc } */ @ Override public Data getSync ( Face face , Name name ) throws IOException { } }
return getSync ( face , getDefaultInterest ( name ) ) ;
public class ParserDQL { /** * Creates a RangeVariable from the parse context . < p > */ protected RangeVariable readTableOrSubquery ( ) { } }
Table table = null ; SimpleName alias = null ; OrderedHashSet columnList = null ; BitMap columnNameQuoted = null ; SimpleName [ ] columnNameList = null ; if ( token . tokenType == Tokens . OPENBRACKET ) { Expression e = XreadTableSubqueryOrJoinedTable ( ) ; table = e . subQuery . getTable ( ) ; if ( table instanceof Ta...
public class AhoCorasickDoubleArrayTrie { /** * 载入 * @ param in 一个ObjectInputStream * @ param value 值 ( 持久化的时候并没有持久化值 , 现在需要额外提供 ) * @ throws IOException * @ throws ClassNotFoundException */ public void load ( ObjectInputStream in , V [ ] value ) throws IOException , ClassNotFoundException { } }
base = ( int [ ] ) in . readObject ( ) ; check = ( int [ ] ) in . readObject ( ) ; fail = ( int [ ] ) in . readObject ( ) ; output = ( int [ ] [ ] ) in . readObject ( ) ; l = ( int [ ] ) in . readObject ( ) ; v = value ;
public class AtomClientFactory { /** * Create AtomService by reading service doc from Atom Server . */ public static ClientAtomService getAtomService ( final String uri , final AuthStrategy authStrategy ) throws ProponoException { } }
return new ClientAtomService ( uri , authStrategy ) ;
public class AWSServiceCatalogClient { /** * Associate the specified TagOption with the specified portfolio or product . * @ param associateTagOptionWithResourceRequest * @ return Result of the AssociateTagOptionWithResource operation returned by the service . * @ throws TagOptionNotMigratedException * An opera...
request = beforeClientExecution ( request ) ; return executeAssociateTagOptionWithResource ( request ) ;
public class FixCapitalization { /** * FixRecord Method . */ public void fixRecord ( Record record ) { } }
super . fixRecord ( record ) ; if ( this . getProperty ( "field" ) != null ) { BaseField field = this . getMainRecord ( ) . getField ( this . getProperty ( "field" ) . toString ( ) ) ; if ( field != null ) this . fixCapitalization ( field ) ; }
public class FilterDriver { /** * Easily supports the Join . To use the setSimpleJoin , * you must be a size master data appear in the memory of the task . * @ param masterLabels label of master data * @ param masterColumn master column * @ param dataColumn data column * @ param masterSeparator separator * ...
if ( masterColumn . length != dataColumn . length ) { throw new DataFormatException ( "masterColumns and dataColumns lenght is miss match." ) ; } this . conf . setInt ( SimpleJob . READER_TYPE , SimpleJob . SOME_COLUMN_JOIN_READER ) ; this . conf . setStrings ( SimpleJob . MASTER_LABELS , masterLabels ) ; this . conf ....
public class AbcGrammar { /** * ifield - part : : = % 5B . % 50 . % 3A * WSP ( ALPHA / tex - text - ifield ) % 5D < p > * < tt > [ P : A ] < / tt > */ Rule IfieldPart ( ) { } }
return Sequence ( String ( "[P:" ) , ZeroOrMore ( WSP ( ) ) . suppressNode ( ) , FirstOfS ( CharRange ( 'A' , 'Z' ) . label ( "ALPHA" ) , TexTextIfield ( ) ) , String ( "]" ) ) . label ( IfieldPart ) ;
public class BaseJsonBo { /** * { @ inheritDoc } */ @ Override protected void triggerChange ( String attrName ) { } }
super . triggerChange ( attrName ) ; Lock lock = lockForRead ( ) ; try { Object value = super . getAttribute ( attrName ) ; if ( value == null ) { cacheJsonObjs . remove ( attrName ) ; } else { JsonNode node = value instanceof JsonNode ? ( JsonNode ) value : SerializationUtils . readJson ( value . toString ( ) ) ; cach...
public class MonaLisaApplet { /** * Initialise and layout the GUI . * @ param container The Swing component that will contain the GUI controls . */ @ Override protected void prepareGUI ( Container container ) { } }
probabilitiesPanel = new ProbabilitiesPanel ( ) ; probabilitiesPanel . setBorder ( BorderFactory . createTitledBorder ( "Evolution Probabilities" ) ) ; JPanel controls = new JPanel ( new BorderLayout ( ) ) ; controls . add ( createParametersPanel ( ) , BorderLayout . NORTH ) ; controls . add ( probabilitiesPanel , Bord...
public class IHEAuditor { /** * Determines if a specific audit message should be sent . Returns true * if all the following are true : < br / > * * The auditor instance is enabled generally * * The auditor is NOT disabled for the message ' s EventID * * The auditor is NOT disabled for the message ' s IHE Transa...
// Check if the auditor is generally enabled if ( ! isAuditorEnabled ( ) ) { return false ; } // Check if the auditor is enabled for a given event id if ( ! isAuditorEnabledForEventId ( msg ) ) { return false ; } // Check if the auditor is enabled for a given IHE transaction if ( ! isAuditorEnabledForTransaction ( msg ...
public class AnnotationQuery { /** * Sets the metric name for the query . * @ param metric The metric name . Cannot be null . */ protected void setMetric ( String metric ) { } }
requireArgument ( metric != null && ! metric . isEmpty ( ) , "Metric name cannot be null or empty." ) ; _metric = metric ;
public class CollectionUtils { /** * As integer type array . * @ param input the input * @ return the int [ ] */ public static int [ ] asIntegerTypeArray ( List < Integer > input ) { } }
int [ ] result = new int [ input . size ( ) ] ; for ( int i = 0 ; i < result . length ; i ++ ) { result [ i ] = input . get ( i ) ; } return result ;
public class CPRuleAssetCategoryRelPersistenceImpl { /** * Returns the cp rule asset category rels before and after the current cp rule asset category rel in the ordered set where CPRuleId = & # 63 ; . * @ param CPRuleAssetCategoryRelId the primary key of the current cp rule asset category rel * @ param CPRuleId th...
CPRuleAssetCategoryRel cpRuleAssetCategoryRel = findByPrimaryKey ( CPRuleAssetCategoryRelId ) ; Session session = null ; try { session = openSession ( ) ; CPRuleAssetCategoryRel [ ] array = new CPRuleAssetCategoryRelImpl [ 3 ] ; array [ 0 ] = getByCPRuleId_PrevAndNext ( session , cpRuleAssetCategoryRel , CPRuleId , ord...
public class DynamicByteBuffer { /** * Creates dynamically growing ByteBuffer upto maxSize . ByteBuffer is * created by mapping a temporary file * @ param mapMode * @ param maxSize * @ return * @ throws IOException */ public static MappedByteBuffer create ( MapMode mapMode , int maxSize ) throws IOException {...
Path tmp = Files . createTempFile ( "dynBB" , "tmp" ) ; try ( FileChannel fc = FileChannel . open ( tmp , READ , WRITE , CREATE , DELETE_ON_CLOSE ) ) { return fc . map ( MapMode . READ_WRITE , 0 , maxSize ) ; }
public class InMemoryRegistry { /** * Gets the client and returns it . * @ param apiKey */ protected Client getClientInternal ( String idx ) { } }
Client client ; synchronized ( mutex ) { client = ( Client ) getMap ( ) . get ( idx ) ; } return client ;
public class AudioChannelMappingMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AudioChannelMapping audioChannelMapping , ProtocolMarshaller protocolMarshaller ) { } }
if ( audioChannelMapping == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( audioChannelMapping . getInputChannelLevels ( ) , INPUTCHANNELLEVELS_BINDING ) ; protocolMarshaller . marshall ( audioChannelMapping . getOutputChannel ( ) , OUTPUTC...
public class Path3f { /** * Adds a point to the path by drawing a straight line from the * current coordinates to the new specified coordinates * specified in double precision . * @ param x the specified X coordinate * @ param y the specified Y coordinate * @ param z the specified Z coordinate */ public void ...
ensureSlots ( true , 3 ) ; this . types [ this . numTypes ++ ] = PathElementType . LINE_TO ; this . coords [ this . numCoords ++ ] = x ; this . coords [ this . numCoords ++ ] = y ; this . coords [ this . numCoords ++ ] = z ; this . isEmpty = null ; this . graphicalBounds = null ; this . logicalBounds = null ;
public class RecoveryManager { /** * Deregisters a recovered transactions existance . This method is triggered from * the FailureScopeController . deregisterTransaction for recovered transactions . * @ param tran The transaction reference object . */ public void deregisterTransaction ( TransactionImpl tran ) { } }
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "deregisterTransaction" , new Object [ ] { this , tran } ) ; _recoveringTransactions . remove ( tran ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "deregisterTransaction" , _recoveringTransactions . size ( ) ) ;
public class ST_RingSideBuffer { /** * Compute a ring buffer on one side of the geometry * @ param geom * @ param bufferSize * @ param numBuffer * @ return * @ throws java . sql . SQLException */ public static Geometry ringSideBuffer ( Geometry geom , double bufferSize , int numBuffer ) throws SQLException { ...
return ringSideBuffer ( geom , bufferSize , numBuffer , "endcap=flat" ) ;