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 static String serialize ( List < ServiceRequester > requesterList ) throws IOException { } }
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 > full avalanche < / i > property , meaning that every bit of the value to be hashed * affects every bit of the hash value . * @ param code The integer to be hashed . * @ return The hash code for the integer . */ private static final int hash ( int code ) { } }
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 : - ( code + 1 ) ;
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 / O reasons */ public static Properties loadPropertiesFromClasspath ( String _propertiesFile ) throws IOException { } }
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 rel ;
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 */ private String determineLongestPrefixInMDAG ( String str ) { } }
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 there are no more characters to process . for ( int i = 0 ; i < numberOfChars ; i ++ , onePastPrefixEndIndex ++ ) { char currentChar = str . charAt ( i ) ; if ( currentNode . hasOutgoingTransition ( currentChar ) ) currentNode = currentNode . transition ( currentChar ) ; else break ; } return str . substring ( 0 , onePastPrefixEndIndex ) ;
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 imploded . */ @ Nonnull @ SafeVarargs public static < ELEMENTTYPE > String getImploded ( @ Nullable final ELEMENTTYPE ... aElements ) { } }
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 ( request , response , this ) ; } else { LOGGER . debug ( "No more filters in chain, delegate to servlet" ) ; delegateServlet . service ( request , response ) ; }
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 ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } List < Camera > lst = new ArrayList < Camera > ( ) ; Element mElement = response . getPayload ( ) ; NodeList cameraElements = mElement . getElementsByTagName ( "camera" ) ; for ( int i = 0 ; i < cameraElements . getLength ( ) ; i ++ ) { Element cameraElement = ( Element ) cameraElements . item ( i ) ; Camera cam = new Camera ( ) ; cam . setId ( cameraElement . getAttribute ( "id" ) ) ; cam . setName ( XMLUtilities . getChildValue ( cameraElement , "name" ) ) ; NodeList detailsNodes = cameraElement . getElementsByTagName ( "details" ) ; int n = detailsNodes . getLength ( ) ; if ( n == 1 ) { Element detailElement = ( Element ) detailsNodes . item ( 0 ) ; Details detail = new Details ( ) ; cam . setDetails ( detail ) ; detail . setMegapixels ( XMLUtilities . getChildValue ( detailElement , "megapixels" ) ) ; detail . setZoom ( XMLUtilities . getChildValue ( detailElement , "zoom" ) ) ; detail . setLcdSize ( XMLUtilities . getChildValue ( detailElement , "lcd_screen_size" ) ) ; detail . setStorageType ( XMLUtilities . getChildValue ( detailElement , "memory_type" ) ) ; } NodeList imageNodes = cameraElement . getElementsByTagName ( "images" ) ; n = imageNodes . getLength ( ) ; if ( n == 1 ) { Element imageElement = ( Element ) imageNodes . item ( 0 ) ; cam . setSmallImage ( XMLUtilities . getChildValue ( imageElement , "small" ) ) ; cam . setLargeImage ( XMLUtilities . getChildValue ( imageElement , "large" ) ) ; } lst . add ( cam ) ; } return lst ;
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 * @ see net . time4j . PlainDate * @ see net . time4j . PlainTimestamp */ public static < T extends TimePoint < ? super CalendarUnit , T > > Quarters between ( T t1 , T t2 ) { } }
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 . startedRecordings . put ( recording . getId ( ) , recording ) ;
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 , String fileName ) { } }
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 you are interested in . */ public CurrencyDateCalculatorBuilder < LocalDate > getDefaultCurrencyDateCalculatorBuilder ( final String ccy1 , final String ccy2 , final SpotLag spotLag ) { } }
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 type of the objects to compare . * @ param delegate { @ link Comparator } delegate . * @ return a null - safe , delegating { @ link Comparator } implementation wrapping the given { @ link Comparator } . * @ see java . util . Comparator */ public static < T > Comparator < T > nullSafeArgumentsComparator ( Comparator < T > delegate ) { } }
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 ( ) ) ; } ManyToMany manyToMany = accessibleObject . getAnnotation ( ManyToMany . class ) ; if ( manyToMany != null ) { return newArrayList ( manyToMany . cascade ( ) ) ; } } return newArrayList ( ) ;
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 ( source . charAt ( 0 ) != target . charAt ( 0 ) ) { table [ 0 ] [ 0 ] = Math . min ( REPLACE_COST , DELETE_COST + INSERT_COST ) ; } sourceIndexByCharacter . put ( source . charAt ( 0 ) , 0 ) ; for ( int i = 1 ; i < source . length ( ) ; i ++ ) { int deleteDistance = table [ i - 1 ] [ 0 ] + DELETE_COST ; int insertDistance = ( i + 1 ) * DELETE_COST + INSERT_COST ; int matchDistance = i * DELETE_COST + ( source . charAt ( i ) == target . charAt ( 0 ) ? 0 : REPLACE_COST ) ; table [ i ] [ 0 ] = Math . min ( Math . min ( deleteDistance , insertDistance ) , matchDistance ) ; } for ( int j = 1 ; j < target . length ( ) ; j ++ ) { int deleteDistance = ( j + 1 ) * INSERT_COST + DELETE_COST ; int insertDistance = table [ 0 ] [ j - 1 ] + INSERT_COST ; int matchDistance = j * INSERT_COST + ( source . charAt ( 0 ) == target . charAt ( j ) ? 0 : REPLACE_COST ) ; table [ 0 ] [ j ] = Math . min ( Math . min ( deleteDistance , insertDistance ) , matchDistance ) ; } for ( int i = 1 ; i < source . length ( ) ; i ++ ) { int maxSourceLetterMatchIndex = source . charAt ( i ) == target . charAt ( 0 ) ? 0 : - 1 ; for ( int j = 1 ; j < target . length ( ) ; j ++ ) { Integer candidateSwapIndex = sourceIndexByCharacter . get ( target . charAt ( j ) ) ; int indexJSwap = maxSourceLetterMatchIndex ; int deleteDistance = table [ i - 1 ] [ j ] + DELETE_COST ; int insertDistance = table [ i ] [ j - 1 ] + INSERT_COST ; int matchDistance = table [ i - 1 ] [ j - 1 ] ; if ( source . charAt ( i ) != target . charAt ( j ) ) { matchDistance += REPLACE_COST ; } else { maxSourceLetterMatchIndex = j ; } int swapDistance ; if ( candidateSwapIndex != null && indexJSwap != - 1 ) { int indexISwap = candidateSwapIndex ; int preSwapCost ; if ( indexISwap == 0 && indexJSwap == 0 ) { preSwapCost = 0 ; } else { preSwapCost = table [ Math . max ( 0 , indexISwap - 1 ) ] [ Math . max ( 0 , indexJSwap - 1 ) ] ; } swapDistance = preSwapCost + ( i - indexISwap - 1 ) * DELETE_COST + ( j - indexJSwap - 1 ) * INSERT_COST + SWAP_COST ; } else { swapDistance = Integer . MAX_VALUE ; } table [ i ] [ j ] = Math . min ( Math . min ( Math . min ( deleteDistance , insertDistance ) , matchDistance ) , swapDistance ) ; } sourceIndexByCharacter . put ( source . charAt ( i ) , i ) ; } return table [ source . length ( ) - 1 ] [ target . length ( ) - 1 ] ;
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 an offset of { @ code bucketsFromNow } from now * @ throws IllegalTimePoint if the current now is not defined */ public BucketEndPoints getEndPoints ( final int bucketsFromNow ) throws IllegalTimePoint { } }
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 */ private String passthroughRequest ( HttpMethod method , String endpoint , String payload , HashMap < String , Object > parameters ) throws SmartsheetException { } }
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 ( ) ; entity . setContentType ( "application/json" ) ; entity . setContent ( new ByteArrayInputStream ( payload . getBytes ( ) ) ) ; entity . setContentLength ( payload . getBytes ( ) . length ) ; request . setEntity ( entity ) ; } String res = null ; try { HttpResponse response = this . smartsheet . getHttpClient ( ) . request ( request ) ; switch ( response . getStatusCode ( ) ) { case 200 : String readLine ; try { BufferedReader br ; StringBuilder sb = new StringBuilder ( ) ; br = new BufferedReader ( new InputStreamReader ( response . getEntity ( ) . getContent ( ) ) ) ; while ( ( readLine = br . readLine ( ) ) != null ) { sb . append ( readLine ) ; } br . close ( ) ; res = sb . toString ( ) ; } catch ( IOException e ) { res = null ; } break ; default : handleError ( response ) ; } } finally { smartsheet . getHttpClient ( ) . releaseConnection ( ) ; } return res ;
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 , boolean isFinished ) { } }
JProgressBar pBar = ( JProgressBar ) context . getComponent ( ) ; if ( tileWhenIndeterminate && pBar . isIndeterminate ( ) ) { double offsetFraction = ( double ) getAnimationIndex ( ) / ( double ) getFrameCount ( ) ; int offset = ( int ) ( offsetFraction * tileWidth ) ; if ( pBar . getOrientation ( ) == JProgressBar . HORIZONTAL ) { // If we ' re right - to - left , flip the direction of animation . if ( ! SeaGlassLookAndFeel . isLeftToRight ( pBar ) ) { offset = tileWidth - offset ; } // paint each tile horizontally for ( int i = - tileWidth + offset ; i <= width ; i += tileWidth ) { context . getPainter ( ) . paintProgressBarForeground ( context , g2d , i , 0 , tileWidth , height , pBar . getOrientation ( ) ) ; } } else { // paint each tile vertically for ( int i = - offset ; i < height + tileWidth ; i += tileWidth ) { context . getPainter ( ) . paintProgressBarForeground ( context , g2d , 0 , i , width , tileWidth , pBar . getOrientation ( ) ) ; } } } else { if ( pBar . getOrientation ( ) == JProgressBar . HORIZONTAL ) { int start = 0 ; if ( isFinished ) { size = width ; } else if ( ! SeaGlassLookAndFeel . isLeftToRight ( pBar ) ) { start = width - size ; } context . getPainter ( ) . paintProgressBarForeground ( context , g2d , start , 0 , size , height , pBar . getOrientation ( ) ) ; } else { // When the progress bar is vertical we always paint from bottom // to top , not matter what the component orientation is . int start = height ; if ( isFinished ) { size = height ; } context . getPainter ( ) . paintProgressBarForeground ( context , g2d , 0 , start , width , size , pBar . getOrientation ( ) ) ; } }
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 contents of the file * @ throws IOException * if something goes wrong while reading the file */ public String getFileContentsAsString ( final String fileName , final String encoding ) throws IOException { } }
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.10 */ public Object parseAs ( Type dataType ) throws IOException { } }
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 ( pe == null ) { authenticated = utils . readString ( userNode , UserProperties . JOS_PASSWORD ) . equals ( password ) ; } else { String encryptedPassword = new String ( pe . encrypt ( utils . readString ( userNode , UserProperties . JOS_PASSWORD ) . getBytes ( ) ) ) ; authenticated = encryptedPassword . equals ( password ) ; } if ( authenticated ) { Calendar lastLoginTime = Calendar . getInstance ( ) ; userNode . setProperty ( UserProperties . JOS_LAST_LOGIN_TIME , lastLoginTime ) ; session . save ( ) ; } return authenticated ;
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 . close ( ) ; } ) ; } ) ; } return closeFuture ;
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 goal of the * performance target , usually in terms of spending . * < p > Only specific efficiency target types are allowed * for a volume goal type . The following * mapping explicitly specifies all allowed combinations . * Volume Goal Type : List of Efficiency Target Types * MAXIMIZE _ CLICKS : CPC _ LESS _ THAN _ OR _ EQUAL _ TO * MAXIMIZE _ CONVERSIONS : CPA _ LESS _ THAN _ OR _ EQUAL _ TO * < span class = " constraint Selectable " > This field can * be selected using the value " EfficiencyTargetType " . < / span > < span class = " constraint * Filterable " > This field can be filtered on . < / span > */ public com . google . api . ads . adwords . axis . v201809 . cm . EfficiencyTargetType getEfficiencyTargetType ( ) { } }
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 OperationStatusResponseInner object */ public Observable < OperationStatusResponseInner > getOperationStatusAsync ( String userName , String operationUrl ) { } }
return getOperationStatusWithServiceResponseAsync ( userName , operationUrl ) . map ( new Func1 < ServiceResponse < OperationStatusResponseInner > , OperationStatusResponseInner > ( ) { @ Override public OperationStatusResponseInner call ( ServiceResponse < OperationStatusResponseInner > response ) { return response . body ( ) ; } } ) ;
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_KURA_CLOUD_DEVICEID , deviceId ) ; headers . put ( CAMEL_KURA_CLOUD_QOS , qos ) ; headers . put ( CAMEL_KURA_CLOUD_RETAIN , retain ) ; headers . put ( CAMEL_KURA_CLOUD_PRIORITY , priority ) ; producerTemplate . sendBodyAndHeaders ( target , kuraPayload , headers ) ; return kuraMessageId ;
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 write > * @ throws InvalidArgument Thrown if the length of { @ code bytes } is not * equal to the { @ link # getRecordSize ( ) } * @ throws UnsupportedOperationException Thrown if the mode is set to * read - only */ public void append ( byte [ ] bytes ) throws IOException { } }
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 - adjust size accordingly size += bytes . length ; recordCt = size / recordSize - 1 ;
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 Id referencing a particular persistedFaceId of an existing face . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PersistedFace object */ public Observable < PersistedFace > getFaceAsync ( String personGroupId , UUID personId , UUID 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 < ClassInfo > classInfos ) { } }
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 there ' s a syntax error . */ public void parse ( SajListener listener ) throws IllegalArgumentException { } }
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 machine parsing the first member name . state = State . MEMBER_LIST ; boolean bFinished = false ; String memberName = null ; String value = null ; while ( ! bFinished ) { switch ( state ) { case MEMBER_LIST : // Expect a quote to start a member or a ' } ' to denote an empty list . ch = m_input . nextNonWSChar ( false ) ; if ( ch != '}' ) { // Should a quote to start a member name . state = State . MEMBER ; } else { // Empty object list if ( pop ( ) == Construct . OBJECT ) { listener . onEndObject ( ) ; } if ( emptyStack ( ) ) { bFinished = true ; } state = State . NEXT ; } break ; case MEMBER : // Expect an object member : " name " : < value > . memberName = m_input . nextString ( ch ) ; // Colon should follow ch = m_input . nextNonWSChar ( false ) ; check ( ch == ':' , "Colon expected: " + ch ) ; // Member value shoud be next ch = m_input . nextNonWSChar ( false ) ; if ( ch == '{' ) { listener . onStartObject ( memberName ) ; push ( Construct . OBJECT ) ; state = State . MEMBER_LIST ; } else if ( ch == '[' ) { listener . onStartArray ( memberName ) ; push ( Construct . ARRAY ) ; state = State . VALUE ; } else { // Value must be a literal . value = m_input . nextValue ( ch ) ; listener . onValue ( memberName , value ) ; // Must be followed by next member or object / array closure . state = State . NEXT ; } break ; case VALUE : // Here , we expect an array value : object or literal . ch = m_input . nextNonWSChar ( false ) ; if ( ch == '{' ) { // Push a GHOST so we eat the outer { } pair . push ( Construct . GHOST ) ; state = State . MEMBER_LIST ; } else if ( ch == ']' ) { // Empty array . listener . onEndArray ( ) ; pop ( ) ; if ( emptyStack ( ) ) { bFinished = true ; } else { state = State . NEXT ; } } else if ( ch == '[' ) { // Value is a nested array , which we don ' t currently support . check ( false , "Nested JSON arrays are not supported" ) ; } else { // Value must be a literal value . It is implicitly named " value " value = m_input . nextValue ( ch ) ; listener . onValue ( "value" , value ) ; // Must be followed by next member or object / array terminator state = State . NEXT ; } break ; case NEXT : // Expect a comma or object / array closure . ch = m_input . nextNonWSChar ( false ) ; Construct tos = tos ( ) ; if ( ch == ',' ) { if ( tos == Construct . OBJECT || tos == Construct . GHOST ) { ch = m_input . nextNonWSChar ( false ) ; state = State . MEMBER ; } else { state = State . VALUE ; } } else { switch ( tos ) { case ARRAY : check ( ch == ']' , "']' or ',' expected: " + ch ) ; listener . onEndArray ( ) ; break ; case GHOST : check ( ch == '}' , "'}' or ',' expected: " + ch ) ; break ; case OBJECT : check ( ch == '}' , "'}' or ',' expected: " + ch ) ; listener . onEndObject ( ) ; break ; } pop ( ) ; if ( emptyStack ( ) ) { bFinished = true ; } // If not finished , stay in NEXT state . } break ; default : assert false : "Missing case for state: " + state ; } } // Here , we should be at EOF ch = m_input . nextNonWSChar ( true ) ; check ( ch == EOF , "End of input expected: " + ch ) ;
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 collectionFormat ) { } }
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 . getCharset ( ) , collectionFormat ) ;
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 . getResourceAsStream ( RESORUCE_PATH_PREFIX + localFileName ) ; if ( stream != null ) { return new InputSource ( stream ) ; } return null ;
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 ExecutableFlow flow , final AlerterHolder alerterHolder , final String [ ] extraReasons ) { } }
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 , extraReasons ) ; } catch ( final Exception e ) { logger . error ( "Failed to alert on error for execution " + flow . getExecutionId ( ) , e ) ; } } if ( options . getFlowParameters ( ) . containsKey ( "alert.type" ) ) { final String alertType = options . getFlowParameters ( ) . get ( "alert.type" ) ; final Alerter alerter = alerterHolder . get ( alertType ) ; if ( alerter != null ) { try { alerter . alertOnError ( flow , extraReasons ) ; } catch ( final Exception e ) { logger . error ( "Failed to alert on error by " + alertType + " for execution " + flow . getExecutionId ( ) , e ) ; } } else { logger . error ( "Alerter type " + alertType + " doesn't exist. Failed to alert." ) ; } } } else { if ( options . getSuccessEmails ( ) != null && ! options . getSuccessEmails ( ) . isEmpty ( ) ) { try { mailAlerter . alertOnSuccess ( flow ) ; } catch ( final Exception e ) { logger . error ( "Failed to alert on success for execution " + flow . getExecutionId ( ) , e ) ; } } if ( options . getFlowParameters ( ) . containsKey ( "alert.type" ) ) { final String alertType = options . getFlowParameters ( ) . get ( "alert.type" ) ; final Alerter alerter = alerterHolder . get ( alertType ) ; if ( alerter != null ) { try { alerter . alertOnSuccess ( flow ) ; } catch ( final Exception e ) { logger . error ( "Failed to alert on success by " + alertType + " for execution " + flow . getExecutionId ( ) , e ) ; } } else { logger . error ( "Alerter type " + alertType + " doesn't exist. Failed to alert." ) ; } } }
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_SCANNER , CURRENT_VERSION ) ; subsystem . registerXMLElementWriter ( DeploymentScannerParser_2_0 :: new ) ; final ManagementResourceRegistration registration = subsystem . registerSubsystemModel ( new DeploymentScannerSubsystemDefinition ( ) ) ; registration . registerOperationHandler ( GenericSubsystemDescribeHandler . DEFINITION , GenericSubsystemDescribeHandler . INSTANCE ) ; final ManagementResourceRegistration scanner = registration . registerSubModel ( new DeploymentScannerDefinition ( context . getPathManager ( ) ) ) ; if ( context . getProcessType ( ) . isServer ( ) ) { final ResolvePathHandler resolvePathHandler = ResolvePathHandler . Builder . of ( context . getPathManager ( ) ) . setRelativeToAttribute ( DeploymentScannerDefinition . RELATIVE_TO ) . setPathAttribute ( DeploymentScannerDefinition . PATH ) . build ( ) ; scanner . registerOperationHandler ( resolvePathHandler . getOperationDefinition ( ) , resolvePathHandler ) ; }
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 internal only . * @ hide original deprecated declaration * @ hide draft / provisional / internal are hidden on Android */ @ Deprecated public static PatternInfo genPatternInfo ( String intervalPattern , boolean laterDateFirst ) { } }
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 ( firstPart , secondPart , laterDateFirst ) ;
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 overrides . If no * bean property was found for a column , the position is set to < code > PROPERTY _ NOT _ FOUND < / code > . * @ param rsmd The < code > ResultSetMetaData < / code > containing column information . * @ param props The bean property descriptors . * @ throws SQLException if a database access error occurs * @ return An int [ ] with column index to property index mappings . The 0th element is meaningless * because JDBC column indexing starts at 1. */ @ Override protected int [ ] mapColumnsToProperties ( final ResultSetMetaData rsmd , final PropertyDescriptor [ ] props ) throws SQLException { } }
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 ( ) ) { columnName = rsmd . getColumnName ( col ) ; } String overrideName = columnToFieldOverrides . get ( columnName ) ; if ( overrideName == null ) { overrideName = columnName ; } final String generousColumnName = columnName . replace ( "_" , "" ) ; for ( int i = 0 ; i < props . length ; i ++ ) { final String propName = props [ i ] . getName ( ) ; // see if either the column name , or the generous one matches if ( columnName . equalsIgnoreCase ( propName ) || generousColumnName . equalsIgnoreCase ( propName ) || overrideName . equalsIgnoreCase ( propName ) ) { columnToProperty [ col ] = i ; break ; } } } return columnToProperty ;
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 and duplicate columns are renamed * * @ param tables The tables to join with * @ return The resulting table */ public Table fullOuter ( boolean allowDuplicateColumnNames , Table ... tables ) { } }
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 point to the documentation content * @ return a documentation { @ link Section } * @ throws IOException if there is an error reading the files */ public Section addArchitecturalForcesSection ( SoftwareSystem softwareSystem , File ... files ) throws IOException { } }
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 subjectKeyIdentifier will be disabled . */ @ Override public boolean match ( Certificate cert ) { } }
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 ( CertificateException ce ) { return false ; } } if ( endDate != null ) { try { xcert . checkValidity ( endDate ) ; } catch ( CertificateException ce ) { return false ; } } } // If no SubjectKeyIdentifier extension , don ' t bother to check it . if ( isSKIDSensitive && ( version < 3 || xcert . getExtensionValue ( "2.5.29.14" ) == null ) ) { setSubjectKeyIdentifier ( null ) ; } // In practice , a CA may replace its root certificate and require that // the existing certificate is still valid , even if the AKID extension // does not match the replacement root certificate fields . // Conservatively , we only support the replacement for version 1 and // version 2 certificate . As for version 2 , the certificate extension // may contain sensitive information ( for example , policies ) , the // AKID need to be respected to seek the exact certificate in case // of key or certificate abuse . if ( isSNSensitive && version < 3 ) { setSerialNumber ( null ) ; } return super . match ( cert ) ;
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 */ public static void translate2DCenterTo ( IAtomContainer container , Point2d p ) { } }
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 ( ) , EVENTTYPECODE_BINDING ) ; protocolMarshaller . marshall ( event . getEventTypeCategory ( ) , EVENTTYPECATEGORY_BINDING ) ; protocolMarshaller . marshall ( event . getRegion ( ) , REGION_BINDING ) ; protocolMarshaller . marshall ( event . getAvailabilityZone ( ) , AVAILABILITYZONE_BINDING ) ; protocolMarshaller . marshall ( event . getStartTime ( ) , STARTTIME_BINDING ) ; protocolMarshaller . marshall ( event . getEndTime ( ) , ENDTIME_BINDING ) ; protocolMarshaller . marshall ( event . getLastUpdatedTime ( ) , LASTUPDATEDTIME_BINDING ) ; protocolMarshaller . marshall ( event . getStatusCode ( ) , STATUSCODE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
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 & 0x1F ) << 6 ) | ( b & 0x3F ) ) ; } else if ( ( a & 0xf0 ) == 0xe0 ) { short b = Buffers . readUByte ( buffer ) ; short c = Buffers . readUByte ( buffer ) ; chars [ i ] = ( char ) ( ( ( a & 0x0F ) << 12 ) | ( ( b & 0x3F ) << 6 ) | ( c & 0x3F ) ) ; } else if ( ( a & 0xf0 ) == 0xf0 ) { // throw new UTFDataFormatException ( ) ; } else { // throw new UTFDataFormatException ( ) ; } if ( chars [ i ] == 0 ) { // the end of string . } } return new String ( chars ) ;
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 false ; } boolean haveIdParam = theRequest . getId ( ) != null && ! theRequest . getId ( ) . isEmpty ( ) ; boolean wantIdParam = myIdParamIndex != null ; if ( haveIdParam != wantIdParam ) { return false ; } if ( theRequest . getId ( ) == null ) { return myResourceOperationType == RestOperationTypeEnum . HISTORY_TYPE ; } else if ( theRequest . getId ( ) . hasVersionIdPart ( ) ) { return false ; } return true ;
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 * does not have to be registered in the provider list . * @ param algorithm the name of the requested { @ code CertPathBuilder } * algorithm . See the CertPathBuilder section in the < a href = * " { @ docRoot } openjdk - redirect . html ? v = 8 & path = / technotes / guides / security / StandardNames . html # CertPathBuilder " > * Java Cryptography Architecture Standard Algorithm Name Documentation < / a > * for information about standard algorithm names . * @ param provider the provider . * @ return a { @ code CertPathBuilder } object that implements the * specified algorithm . * @ exception NoSuchAlgorithmException if a CertPathBuilderSpi * implementation for the specified algorithm is not available * from the specified Provider object . * @ exception IllegalArgumentException if the { @ code provider } is * null . * @ see java . security . Provider */ public static CertPathBuilder getInstance ( String algorithm , Provider provider ) throws NoSuchAlgorithmException { } }
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 startDateMillis the start time used to define the complete time horizont . * @ param endDateMillis the end time used to define the complete time horizont . * @ param timeStepMillis the time step used to define the complete time horizont . * @ param parameters a { @ link HashMap map of parameters } to be used for the * distribution model . Supported values are : * < ul > * < li > { @ link ADischargeDistributor # PARAMS _ AVG _ SUP _ 10 } : the mean * of the width function for 10 % of saturated areas * for the superficial flow case . < / li > * < li > { @ link ADischargeDistributor # PARAMS _ AVG _ SUP _ 30 } : the mean * of the width function for 30 % of saturated areas * for the superficial flow case . < / li > * < li > { @ link ADischargeDistributor # PARAMS _ AVG _ SUP _ 60 } : the mean * of the width function for 60 % of saturated areas * for the superficial flow case . < / li > * < li > { @ link ADischargeDistributor # PARAMS _ VAR _ SUP _ 10 } : the variance * of the width function for 10 % of saturated areas * for the superficial flow case . < / li > * < li > { @ link ADischargeDistributor # PARAMS _ VAR _ SUP _ 30 } : the variance * of the width function for 30 % of saturated areas * for the superficial flow case . < / li > * < li > { @ link ADischargeDistributor # PARAMS _ VAR _ SUP _ 60 } : the variance * of the width function for 60 % of saturated areas * for the superficial flow case . < / li > * < li > { @ link ADischargeDistributor # PARAMS _ AVG _ SUB } : the mean * of the width function for the subsuperficial flow case . < / li > * < li > { @ link ADischargeDistributor # PARAMS _ VAR _ SUB } : the variance * of the width function for the subsuperficial flow case . < / li > * < li > { @ link ADischargeDistributor # PARAMS _ V _ SUP } : the * speed of the superficial flow . < / li > * < li > { @ link ADischargeDistributor # PARAMS _ V _ SUB } : the * speed of the subsuperficial flow . < / li > * < / ul > * @ return the created discharge distributor . */ public static ADischargeDistributor createDischargeDistributor ( int distributorType , long startDateMillis , long endDateMillis , long timeStepMillis , HashMap < Integer , Double > parameters ) { } }
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 if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the BuildGetLogResultInner object if successful . */ public BuildGetLogResultInner getLogLink ( String resourceGroupName , String registryName , String buildId ) { } }
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 . getSequenceIntervalEnd ( ) ; if ( begin != null && end != null ) { Glyph . State state = factory . createGlyphState ( ) ; state . setValue ( "x[" + begin . getSequencePosition ( ) + " - " + end . getSequencePosition ( ) + "]" ) ; return state ; } } } else if ( ef instanceof ModificationFeature ) { ModificationFeature mf = ( ModificationFeature ) ef ; SequenceModificationVocabulary modType = mf . getModificationType ( ) ; if ( modType != null ) { Set < String > terms = modType . getTerm ( ) ; if ( terms != null && ! terms . isEmpty ( ) ) { String orig = terms . iterator ( ) . next ( ) ; String term = orig . toLowerCase ( ) ; String s = symbolMapping . containsKey ( term ) ? symbolMapping . get ( term ) : orig ; Glyph . State state = factory . createGlyphState ( ) ; state . setValue ( s ) ; SequenceLocation loc = mf . getFeatureLocation ( ) ; if ( locMapping . containsKey ( term ) ) { state . setVariable ( locMapping . get ( term ) ) ; } if ( loc instanceof SequenceSite ) { SequenceSite ss = ( SequenceSite ) loc ; if ( ss . getSequencePosition ( ) > 0 ) { state . setVariable ( ( state . getVariable ( ) != null ? state . getVariable ( ) : "" ) + ss . getSequencePosition ( ) ) ; } } return state ; } } } // Binding features are ignored return null ;
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 > elements = typeElement . getEnclosedElements ( ) ; List < ExecutableElement > methods = ElementFilter . methodsIn ( elements ) ; return methods . stream ( ) . filter ( method -> { String methodName = method . getSimpleName ( ) . toString ( ) ; if ( getterName . equals ( methodName ) ) { Set < Modifier > modifiers = method . getModifiers ( ) ; return // it ' s not static ! modifiers . contains ( STATIC ) // it ' s either public or package visibility && modifiers . contains ( PUBLIC ) || ! ( modifiers . contains ( PRIVATE ) || modifiers . contains ( PROTECTED ) ) ; } return false ; } ) . findFirst ( ) ;
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 changed . */ public Map < String , Set < String > > getPropertyConnections ( TransformationDescription description ) { } }
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 ( value ) ; case DATE : return valueFactories . getDateFactory ( ) . create ( value ) ; case BOOLEAN : return valueFactories . getBooleanFactory ( ) . create ( value ) ; case URI : return valueFactories . getUriFactory ( ) . create ( value ) ; case REFERENCE : return valueFactories . getReferenceFactory ( ) . create ( value ) ; case SIMPLEREFERENCE : return valueFactories . getSimpleReferenceFactory ( ) . create ( value ) ; case WEAKREFERENCE : return valueFactories . getWeakReferenceFactory ( ) . create ( value ) ; default : return value ; }
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 = ( NoteRenderer ) new GedRendererFactory ( ) . create ( note , noteLinkRenderer . getRenderingContext ( ) ) ; return noteRenderer . getIndexNameHtml ( ) ;
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 ( "VerticalTabbedPane" ) ; } switch ( model ( ) . object ( ) . orientation ( ) ) { case top : this . box . getStyleClass ( ) . add ( "Top" ) ; ( ( HBox ) this . box ) . setAlignment ( Pos . BOTTOM_LEFT ) ; break ; case bottom : this . box . getStyleClass ( ) . add ( "Bottom" ) ; ( ( HBox ) this . box ) . setAlignment ( Pos . TOP_RIGHT ) ; break ; case left : this . box . getStyleClass ( ) . add ( "Left" ) ; ( ( VBox ) this . box ) . setAlignment ( Pos . TOP_RIGHT ) ; break ; case right : this . box . getStyleClass ( ) . add ( "Right" ) ; ( ( VBox ) this . box ) . setAlignment ( Pos . TOP_LEFT ) ; break ; } return this . box ;
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 TableDerived ) { ( ( TableDerived ) table ) . dataExpression = e ; } } else { table = readTableName ( ) ; if ( table . isView ( ) ) { SubQuery sq = getViewSubquery ( ( View ) table ) ; // sq . queryExpression = ( ( View ) table ) . queryExpression ; table = sq . getTable ( ) ; } } boolean hasAs = false ; if ( token . tokenType == Tokens . AS ) { read ( ) ; checkIsNonCoreReservedIdentifier ( ) ; hasAs = true ; } if ( isNonCoreReservedIdentifier ( ) ) { boolean limit = token . tokenType == Tokens . LIMIT || token . tokenType == Tokens . OFFSET ; int position = getPosition ( ) ; alias = HsqlNameManager . getSimpleName ( token . tokenString , isDelimitedIdentifier ( ) ) ; read ( ) ; if ( token . tokenType == Tokens . OPENBRACKET ) { columnNameQuoted = new BitMap ( 32 ) ; columnList = readColumnNames ( columnNameQuoted , false ) ; } else if ( ! hasAs && limit ) { if ( token . tokenType == Tokens . QUESTION || token . tokenType == Tokens . X_VALUE ) { alias = null ; rewind ( position ) ; } } } if ( columnList != null ) { if ( table . getColumnCount ( ) != columnList . size ( ) ) { throw Error . error ( ErrorCode . X_42593 ) ; } columnNameList = new SimpleName [ columnList . size ( ) ] ; for ( int i = 0 ; i < columnList . size ( ) ; i ++ ) { SimpleName name = HsqlNameManager . getSimpleName ( ( String ) columnList . get ( i ) , columnNameQuoted . isSet ( i ) ) ; columnNameList [ i ] = name ; } } RangeVariable range = new RangeVariable ( table , alias , columnList , columnNameList , compileContext ) ; return range ;
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 operation requiring TagOptions failed because the TagOptions migration process has not been performed * for this account . Please use the AWS console to perform the migration process before retrying the * operation . * @ throws ResourceNotFoundException * The specified resource was not found . * @ throws InvalidParametersException * One or more parameters provided to the operation are not valid . * @ throws LimitExceededException * The current limits of the service would have been exceeded by this operation . Decrease your resource use * or increase your service limits and retry the operation . * @ throws DuplicateResourceException * The specified resource is a duplicate . * @ throws InvalidStateException * An attempt was made to modify a resource that is in a state that is not valid . Check your resources to * ensure that they are in valid states before retrying the operation . * @ sample AWSServiceCatalog . AssociateTagOptionWithResource * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / servicecatalog - 2015-12-10 / AssociateTagOptionWithResource " * target = " _ top " > AWS API Documentation < / a > */ @ Override public AssociateTagOptionWithResourceResult associateTagOptionWithResource ( AssociateTagOptionWithResourceRequest request ) { } }
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 * @ param regex master join is regex * @ param masterData master data * @ throws DataFormatException */ protected void setSimpleJoin ( String [ ] masterLabels , String [ ] masterColumn , String [ ] dataColumn , String masterSeparator , boolean regex , List < String > masterData ) throws DataFormatException { } }
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 . setStrings ( SimpleJob . JOIN_MASTER_COLUMN , masterColumn ) ; this . conf . setStrings ( SimpleJob . JOIN_DATA_COLUMN , dataColumn ) ; this . masterSeparator = masterSeparator ; this . conf . setBoolean ( SimpleJob . JOIN_REGEX , regex ) ; this . masterData = masterData ;
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 ( ) ) ; cacheJsonObjs . put ( attrName , node ) ; } } finally { lock . unlock ( ) ; }
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 , BorderLayout . SOUTH ) ; container . add ( controls , BorderLayout . NORTH ) ; Renderer < List < ColouredPolygon > , JComponent > renderer = new PolygonImageSwingRenderer ( targetImage ) ; monitor = new EvolutionMonitor < List < ColouredPolygon > > ( renderer , false ) ; container . add ( monitor . getGUIComponent ( ) , BorderLayout . CENTER ) ;
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 Transaction code * @ param msg The audit event message to check * @ return Whether the message should be sent */ public boolean isEnabled ( AuditEventMessage msg ) { } }
// 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 ) ) { return false ; } // If all conditions are satisified , then auditor is fully enabled return true ;
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 the cp rule ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the previous , current , and next cp rule asset category rel * @ throws NoSuchCPRuleAssetCategoryRelException if a cp rule asset category rel with the primary key could not be found */ @ Override public CPRuleAssetCategoryRel [ ] findByCPRuleId_PrevAndNext ( long CPRuleAssetCategoryRelId , long CPRuleId , OrderByComparator < CPRuleAssetCategoryRel > orderByComparator ) throws NoSuchCPRuleAssetCategoryRelException { } }
CPRuleAssetCategoryRel cpRuleAssetCategoryRel = findByPrimaryKey ( CPRuleAssetCategoryRelId ) ; Session session = null ; try { session = openSession ( ) ; CPRuleAssetCategoryRel [ ] array = new CPRuleAssetCategoryRelImpl [ 3 ] ; array [ 0 ] = getByCPRuleId_PrevAndNext ( session , cpRuleAssetCategoryRel , CPRuleId , orderByComparator , true ) ; array [ 1 ] = cpRuleAssetCategoryRel ; array [ 2 ] = getByCPRuleId_PrevAndNext ( session , cpRuleAssetCategoryRel , CPRuleId , orderByComparator , false ) ; return array ; } catch ( Exception e ) { throw processException ( e ) ; } finally { closeSession ( session ) ; }
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 ( ) , OUTPUTCHANNEL_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
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 lineTo ( double x , double y , double z ) { } }
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" ) ;