signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class TimeParser { /** * hh ( mm ( ss ) ? ) ? */ Rule Time_HHMMSS ( ) { } }
return Sequence ( TwoDigits ( ) , FirstOf ( Sequence ( TwoDigits ( ) , FirstOf ( TwoDigits ( ) , push ( 0 ) ) ) , pushAll ( 0 , 0 ) ) , EOI , swap3 ( ) && push ( convertToTime ( popAsInt ( ) , popAsInt ( ) , popAsInt ( ) ) ) ) ;
public class PcTrendReportMetaData { public static ArrayList < PcTrendedRun > xmlToObject ( String xml ) { } }
Results = new ArrayList < PcTrendedRun > ( ) ; try { DocumentBuilder db = dbf . newDocumentBuilder ( ) ; dom = db . parse ( new InputSource ( new ByteArrayInputStream ( xml . getBytes ( "utf-8" ) ) ) ) ; Element doc = dom . getDocumentElement ( ) ; NodeList nListTrendedRun = doc . getElementsByTagName ( "TrendedRun" ) ; for ( int i = 0 ; i < nListTrendedRun . getLength ( ) ; i ++ ) { Node nTrendedRun = nListTrendedRun . item ( i ) ; NodeList nListChild = nTrendedRun . getChildNodes ( ) ; PcTrendedRun pcTR = new PcTrendedRun ( ) ; for ( int j = 0 ; j < nListChild . getLength ( ) ; j ++ ) { if ( nListChild . item ( j ) . getNodeName ( ) . equals ( "RunID" ) ) { pcTR . setRunID ( Integer . parseInt ( nListChild . item ( j ) . getTextContent ( ) ) ) ; } if ( nListChild . item ( j ) . getNodeName ( ) . equals ( "State" ) ) { pcTR . setState ( nListChild . item ( j ) . getTextContent ( ) ) ; } } Results . add ( pcTR ) ; } } catch ( ParserConfigurationException pce ) { System . out . println ( pce . getMessage ( ) ) ; } catch ( SAXException se ) { System . out . println ( se . getMessage ( ) ) ; } catch ( IOException ioe ) { System . err . println ( ioe . getMessage ( ) ) ; } return Results ;
public class CloudantClient { /** * Get the list of all nodes and the list of active nodes in the cluster . * @ return Membership object encapsulating lists of all nodes and the cluster nodes * @ see < a * href = " https : / / console . bluemix . net / docs / services / Cloudant / api / advanced . html # - get - _ membership - " > * _ membership < / a > */ public Membership getMembership ( ) { } }
URI uri = new URIBase ( getBaseUri ( ) ) . path ( "_membership" ) . build ( ) ; Membership membership = couchDbClient . get ( uri , Membership . class ) ; return membership ;
public class DbxWebAuth { /** * Call this after the user has visited the authorizaton URL with a redirectUrl and copy / pasted * the authorization code that Dropbox gave them . * @ param code The authorization code shown to the user when they clicked " Allow " on the * authorization , page on the Dropbox website , never { @ code null } . * @ param redirectUri The original redirect URI used by { @ link # authorize } , never { @ code null } . * @ throws DbxException if an error occurs communicating with Dropbox . */ public DbxAuthFinish finishFromCode ( String code , String redirectUri ) throws DbxException { } }
return finish ( code , redirectUri , null ) ;
public class WhiteboxImpl { /** * Set the value of a field using reflection . This method will traverse the * super class hierarchy until a field with name < tt > fieldName < / tt > is * found . * @ param object the object to modify * @ param fieldName the name of the field * @ param value the new value of the field */ public static void setInternalState ( Object object , String fieldName , Object [ ] value ) { } }
setInternalState ( object , fieldName , ( Object ) value ) ;
public class GridTable { /** * Move the position of the record . * Note : move is called from other methods in this class to get a relative record . * @ param iRelPosition - Relative position positive or negative or FIRST _ RECORD / LAST _ RECORD . * @ return The fieldlist as the new position or null if eof / bof . * @ exception FILE _ NOT _ OPEN . * @ exception INVALID _ RECORD - Record position is not current or move past EOF or BOF . */ public FieldList move ( int iRelPosition ) throws DBException { } }
m_iLogicalFilePosition = UNKNOWN_POSITION ; FieldList record = this . getNextTable ( ) . move ( iRelPosition ) ; int iCurrentPosition = m_iPhysicalFilePosition ; if ( iRelPosition == DBConstants . FIRST_RECORD ) iCurrentPosition = 0 ; else if ( iRelPosition == DBConstants . LAST_RECORD ) { if ( m_iEndOfFileIndex == UNKNOWN_POSITION ) { // May want to do m _ iEndOfFileIndex = this . getRecordCount ( ) when / if supported iCurrentPosition = UNKNOWN_POSITION ; // -1 if not reached yet in a Next } else iCurrentPosition = m_iEndOfFileIndex - 1 ; // EOF } else iCurrentPosition += iRelPosition ; m_iPhysicalFilePosition = iCurrentPosition ; if ( ( record == null ) && ( ( iRelPosition == DBConstants . FIRST_RECORD ) || ( iRelPosition == DBConstants . NEXT_RECORD ) ) ) // EOF m_iEndOfFileIndex = iCurrentPosition ; // EOF + 1 else { if ( iCurrentPosition != - 1 ) this . addRecordReference ( iCurrentPosition ) ; m_iLogicalFilePosition = iCurrentPosition ; // Last accessed record # } return record ;
public class DefaultTinCanAPIProvider { /** * Build a URI for the REST request . * < p > Note : this converts to URI instead of using a string because the activities / state API * requires you to pass JSON as a GET parameter . The { . . . } confuses the RestTemplate path * parameter handling . By converting to URI , I skip that . * @ param pathFragment The path fragment relative to the LRS REST base URL * @ param params The list of GET parameters to encode . May be null . * @ return The full URI to the LMS REST endpoint */ private URI buildRequestURI ( String pathFragment , List < ? extends NameValuePair > params ) { } }
try { String queryString = "" ; if ( params != null && ! params . isEmpty ( ) ) { queryString = "?" + URLEncodedUtils . format ( params , "UTF-8" ) ; } URI fullURI = new URI ( LRSUrl + pathFragment + queryString ) ; return fullURI ; } catch ( URISyntaxException e ) { throw new RuntimeException ( "Error creating request URI" , e ) ; }
public class SubstitutionContext { /** * For testing */ Object getValueByToken ( int token ) { } }
for ( Map . Entry < Object , Integer > e : valueToToken . entrySet ( ) ) { if ( e . getValue ( ) . intValue ( ) == token ) return e . getKey ( ) ; } return null ;
public class CollisionConstraint { /** * Add the group constraint at the specified orientation . * @ param orientation The orientation . * @ param group The group where constraint is applied . */ public void add ( Orientation orientation , String group ) { } }
final Collection < String > groups = constraints . get ( orientation ) ; groups . add ( group ) ;
public class UserActionEventHandler { /** * Propagate event to handlers * @ param apiUser user agent object */ private void notifyHandlers ( ApiUser apiUser ) { } }
for ( ServerUserHandlerClass handler : serverUserEventHandler ) { Object userAgent = checkUserAgent ( handler , apiUser ) ; ReflectMethodUtil . invokeHandleMethod ( handler . getHandleMethod ( ) , handler . newInstance ( ) , context , userAgent ) ; }
public class ElemNumber { /** * Get the number formatter to be used the format the numbers * @ param transformer non - null reference to the the current transform - time state . * @ param contextNode The node that " . " expresses . * ( $ objectName $ ) @ return The number formatter to be used * @ throws TransformerException */ private DecimalFormat getNumberFormatter ( TransformerImpl transformer , int contextNode ) throws TransformerException { } }
// Patch from Steven Serocki // Maybe we really want to do the clone in getLocale ( ) and return // a clone of the default Locale ? ? Locale locale = ( Locale ) getLocale ( transformer , contextNode ) . clone ( ) ; // Helper to format local specific numbers to strings . DecimalFormat formatter = null ; // synchronized ( locale ) // formatter = ( DecimalFormat ) NumberFormat . getNumberInstance ( locale ) ; String digitGroupSepValue = ( null != m_groupingSeparator_avt ) ? m_groupingSeparator_avt . evaluate ( transformer . getXPathContext ( ) , contextNode , this ) : null ; // Validate grouping separator if an AVT was used ; otherwise this was // validated statically in XSLTAttributeDef . java . if ( ( digitGroupSepValue != null ) && ( ! m_groupingSeparator_avt . isSimple ( ) ) && ( digitGroupSepValue . length ( ) != 1 ) ) { transformer . getMsgMgr ( ) . warn ( this , XSLTErrorResources . WG_ILLEGAL_ATTRIBUTE_VALUE , new Object [ ] { Constants . ATTRNAME_NAME , m_groupingSeparator_avt . getName ( ) } ) ; } String nDigitsPerGroupValue = ( null != m_groupingSize_avt ) ? m_groupingSize_avt . evaluate ( transformer . getXPathContext ( ) , contextNode , this ) : null ; // TODO : Handle digit - group attributes if ( ( null != digitGroupSepValue ) && ( null != nDigitsPerGroupValue ) && // Ignore if separation value is empty string ( digitGroupSepValue . length ( ) > 0 ) ) { try { formatter = ( DecimalFormat ) NumberFormat . getNumberInstance ( locale ) ; formatter . setGroupingSize ( Integer . valueOf ( nDigitsPerGroupValue ) . intValue ( ) ) ; DecimalFormatSymbols symbols = formatter . getDecimalFormatSymbols ( ) ; symbols . setGroupingSeparator ( digitGroupSepValue . charAt ( 0 ) ) ; formatter . setDecimalFormatSymbols ( symbols ) ; formatter . setGroupingUsed ( true ) ; } catch ( NumberFormatException ex ) { formatter . setGroupingUsed ( false ) ; } } return formatter ;
public class TiledMap { /** * Get a propety given to a particular tile . Note that this method will not * perform well and should not be used as part of the default code path in * the game loop . * @ param tileID * The global ID of the tile to retrieve * @ param propertyName * The name of the property to retireve * @ param def * The default value to return * @ return The value assigned to the property on the tile ( or the default * value if none is supplied ) */ public String getTileProperty ( int tileID , String propertyName , String def ) { } }
if ( tileID == 0 ) { return def ; } TileSet set = findTileSet ( tileID ) ; Properties props = set . getProperties ( tileID ) ; if ( props == null ) { return def ; } return props . getProperty ( propertyName , def ) ;
public class OfflineReader { /** * / * - - - Private methods - - - */ private static String decompress ( File file ) throws IOException { } }
if ( file == null || ! file . exists ( ) ) { return Constants . EMPTY_STRING ; } byte [ ] bytes = Base64 . getDecoder ( ) . decode ( IOUtils . toByteArray ( new FileInputStream ( file ) ) ) ; GZIPInputStream gzipInputStream = new GZIPInputStream ( new ByteArrayInputStream ( bytes ) ) ; BufferedReader bf = new BufferedReader ( new InputStreamReader ( gzipInputStream , UTF_8 ) ) ; StringBuilder outStr = new StringBuilder ( Constants . EMPTY_STRING ) ; String line ; while ( ( line = bf . readLine ( ) ) != null ) { outStr . append ( line ) ; } return outStr . toString ( ) ;
public class LongHashSet { /** * Adds the given value to the set . * @ return true if the value was actually new */ public boolean add ( long key ) { } }
final int index = ( ( ( ( int ) ( key >>> 32 ) ) ^ ( ( int ) ( key ) ) ) & 0x7fffffff ) % capacity ; final Entry entryOriginal = table [ index ] ; for ( Entry entry = entryOriginal ; entry != null ; entry = entry . next ) { if ( entry . key == key ) { return false ; } } table [ index ] = new Entry ( key , entryOriginal ) ; size ++ ; if ( size > threshold ) { setCapacity ( 2 * capacity ) ; } return true ;
public class VirtuosoTripleTransaction { /** * Adds the specified RDF statement to the triple store . Virtuoso may buffer the operation , * performing it when more opportune and in any case ensuring that the same effects are * produced as obtainable by directly executing the operation . * @ param statement * the RDF statement to add * @ throws DataCorruptedException * in case a non - recoverable data corruption situation is detected * @ throws IOException * in case another IO error occurs not implying data corruption * @ throws IllegalStateException * in case the transaction is read - only */ public void add ( final Statement statement ) throws DataCorruptedException , IOException { } }
Preconditions . checkNotNull ( statement ) ; checkWritable ( ) ; try { this . connection . add ( statement ) ; } catch ( final RepositoryException ex ) { throw new IOException ( "Failed to add statement: " + statement , ex ) ; }
public class MultipleStrategyRunnerInfile { /** * Runs multiple strategies on some data and outputs the result into a file . * @ param testModel The test datamodel . * @ param userRecommendationFile The file that contains the recommendations * for users . * @ param strategy The strategy to use . * @ param format The format of the printer * @ param rankingFolder Where to write output . * @ param groundtruthFolder Where to read test set . * @ param inputFileName The file names to read . * @ param strategyClassSimpleName The class name of the strategy . * @ param threshold The relevance threshold . * @ param suffix The file suffix . * @ param overwrite Whether or not to overwrite the results file . * @ throws IOException when a file cannot be parsed . */ public static void generateOutput ( final DataModelIF < Long , Long > testModel , final File userRecommendationFile , final EvaluationStrategy < Long , Long > strategy , final EvaluationStrategy . OUTPUT_FORMAT format , final File rankingFolder , final File groundtruthFolder , final String inputFileName , final String strategyClassSimpleName , final String threshold , final String suffix , final Boolean overwrite ) throws IOException { } }
File outRanking = new File ( rankingFolder , "out" + "__" + inputFileName + "__" + strategyClassSimpleName + "__" + threshold + suffix ) ; File outGroundtruth = new File ( groundtruthFolder , "gr" + "__" + inputFileName + "__" + strategyClassSimpleName + "__" + threshold + suffix ) ; StrategyRunnerInfile . generateOutput ( testModel , userRecommendationFile , strategy , format , outRanking , outGroundtruth , overwrite ) ;
public class InstancedConfiguration { /** * Validates Zookeeper - related configuration and prints warnings for possible sources of error . * @ throws IllegalStateException if invalid Zookeeper configuration is encountered */ private void checkZkConfiguration ( ) { } }
Preconditions . checkState ( isSet ( PropertyKey . ZOOKEEPER_ADDRESS ) == getBoolean ( PropertyKey . ZOOKEEPER_ENABLED ) , PreconditionMessage . INCONSISTENT_ZK_CONFIGURATION . toString ( ) , PropertyKey . Name . ZOOKEEPER_ADDRESS , PropertyKey . Name . ZOOKEEPER_ENABLED ) ;
public class JstlLocalizationBundleFactory { /** * Invoked directly after instantiation to allow the configured component to perform * one time initialization . Components are expected to fail loudly if they are not * going to be in a valid state after initialization . * @ param configuration the Configuration object being used by Stripes * @ throws Exception should be thrown if the component cannot be configured well enough to use . */ public void init ( Configuration configuration ) throws Exception { } }
bundleName = configuration . getServletContext ( ) . getInitParameter ( Config . FMT_LOCALIZATION_CONTEXT ) ; if ( bundleName == null ) { throw new StripesRuntimeException ( "JSTL has no resource bundle configured. Please set the context " + "parameter " + Config . FMT_LOCALIZATION_CONTEXT + " to the name of the " + "ResourceBundle to use." ) ; }
public class HtmlEscapeUtil { /** * This methods ( the two versions ) are used instead of Integer . parseInt ( str , radix ) in order to avoid the need * to create substrings of the text being unescaped to feed such method . * - No need to check all chars are within the radix limits - reference parsing code will already have done so . */ static int parseIntFromReference ( final String text , final int start , final int end , final int radix ) { } }
int result = 0 ; for ( int i = start ; i < end ; i ++ ) { final char c = text . charAt ( i ) ; int n = - 1 ; for ( int j = 0 ; j < HEXA_CHARS_UPPER . length ; j ++ ) { if ( c == HEXA_CHARS_UPPER [ j ] || c == HEXA_CHARS_LOWER [ j ] ) { n = j ; break ; } } result *= radix ; if ( result < 0 ) { return 0xFFFD ; } result += n ; if ( result < 0 ) { return 0xFFFD ; } } return result ;
public class ResourceConverter { /** * Reads JSON API spec document and converts it into target type . * @ param dataStream { @ link byte } raw dataStream ( server response ) * @ param clazz { @ link Class } target type * @ param < T > type * @ return { @ link JSONAPIDocument } */ public < T > JSONAPIDocument < T > readDocument ( InputStream dataStream , Class < T > clazz ) { } }
try { resourceCache . init ( ) ; JsonNode rootNode = objectMapper . readTree ( dataStream ) ; // Validate ValidationUtils . ensureNotError ( objectMapper , rootNode ) ; ValidationUtils . ensureValidResource ( rootNode ) ; JsonNode dataNode = rootNode . get ( DATA ) ; // Parse data node without handling relationships T resourceObject ; boolean cached = false ; if ( dataNode != null && dataNode . isObject ( ) ) { String identifier = createIdentifier ( dataNode ) ; cached = identifier != null && resourceCache . contains ( identifier ) ; if ( cached ) { resourceObject = ( T ) resourceCache . get ( identifier ) ; } else { resourceObject = readObject ( dataNode , clazz , false ) ; } } else { resourceObject = null ; } // Parse all included resources resourceCache . cache ( parseIncluded ( rootNode ) ) ; // Connect data node ' s relationships now that all resources have been parsed if ( resourceObject != null && ! cached ) { handleRelationships ( dataNode , resourceObject ) ; } JSONAPIDocument < T > result = new JSONAPIDocument < > ( resourceObject , objectMapper ) ; // Handle top - level meta if ( rootNode . has ( META ) ) { result . setMeta ( mapMeta ( rootNode . get ( META ) ) ) ; } // Handle top - level links if ( rootNode . has ( LINKS ) ) { result . setLinks ( new Links ( mapLinks ( rootNode . get ( LINKS ) ) ) ) ; } return result ; } catch ( RuntimeException e ) { throw e ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } finally { resourceCache . clear ( ) ; }
public class DateTime { /** * Returns a copy of this datetime plus the specified number of years . * The calculation will do its best to only change the year field * retaining the same month of year . * However , in certain circumstances , it may be necessary to alter * smaller fields . For example , 2008-02-29 plus one year cannot result * in 2009-02-29 , so the day of month is adjusted to 2009-02-28. * The following three lines are identical in effect : * < pre > * DateTime added = dt . plusYears ( 6 ) ; * DateTime added = dt . plus ( Period . years ( 6 ) ) ; * DateTime added = dt . withFieldAdded ( DurationFieldType . years ( ) , 6 ) ; * < / pre > * This datetime instance is immutable and unaffected by this method call . * @ param years the amount of years to add , may be negative * @ return the new datetime plus the increased years * @ since 1.1 */ public DateTime plusYears ( int years ) { } }
if ( years == 0 ) { return this ; } long instant = getChronology ( ) . years ( ) . add ( getMillis ( ) , years ) ; return withMillis ( instant ) ;
public class GraphvizConfigVisitor { /** * Produce a Graphviz DOT string for a given TANG configuration . * @ param config TANG configuration object . * @ param showImpl If true , plot IS - A edges for know implementations . * @ param showLegend If true , add legend to the plot . * @ return configuration graph represented as a string in Graphviz DOT format . */ public static String getGraphvizString ( final Configuration config , final boolean showImpl , final boolean showLegend ) { } }
final GraphvizConfigVisitor visitor = new GraphvizConfigVisitor ( config , showImpl , showLegend ) ; final Node root = config . getClassHierarchy ( ) . getNamespace ( ) ; Walk . preorder ( visitor , visitor , root ) ; return visitor . toString ( ) ;
public class JsonMapper { /** * Parse an object from an InputStream . * @ param is The InputStream , most likely from your networking library . */ public T parse ( InputStream is ) throws IOException { } }
JsonParser jsonParser = LoganSquare . JSON_FACTORY . createParser ( is ) ; jsonParser . nextToken ( ) ; return parse ( jsonParser ) ;
public class NetworkServiceRecordAgent { /** * Returns a specific PhysicalNetworkFunctionRecord . * @ param idNsr the ID of the NetworkFunctionRecord containing the PhysicalNetworkFunctionRecord * @ param idPnfr the ID of the requested PhysicalNetworkFunctionRecord * @ return the PhysicalNetworkFunctionRecord * @ throws SDKException if the request fails */ @ Help ( help = "Get the PhysicalNetworkFunctionRecord of a NetworkServiceRecord with specific id" ) public PhysicalNetworkFunctionRecord getPhysicalNetworkFunctionRecord ( final String idNsr , final String idPnfr ) throws SDKException { } }
String url = idNsr + "/pnfrecords" + "/" + idPnfr ; return ( PhysicalNetworkFunctionRecord ) requestGetWithStatusAccepted ( url , PhysicalNetworkFunctionRecord . class ) ;
public class EncryptionUtil { /** * Decrypts the given encrypted message with the specified key type . * @ param text * The encrypted message to be decrypted . * @ param keyType * The key type to be used . * @ return The decrypted message . * @ throws EncryptionException * When it was not possible to decrypt the message . */ public String decrypt ( final byte [ ] text , final KeyType keyType ) throws EncryptionException { } }
final Key key = keyType == KeyType . PRIVATE ? privateKey : publicKey ; try { // get an RSA cipher object and print the provider final Cipher cipher = Cipher . getInstance ( ALGORITHM ) ; // decrypt the text using the private key cipher . init ( Cipher . DECRYPT_MODE , key ) ; byte [ ] dectyptedText = cipher . doFinal ( text ) ; return new String ( dectyptedText , DEFAULT_CHARSET ) ; } catch ( NoSuchAlgorithmException | InvalidKeyException | NoSuchPaddingException | BadPaddingException | IllegalBlockSizeException e ) { throw new EncryptionException ( "Unable to decrypt message: " , e ) ; }
public class ThreadSettingsApi { /** * Sets a Persistent Menu of buttons which is always available to the user . * This menu should contain top - level actions that users can enact at any * point . Having a persistent menu easily communicates the basic * capabilities of your bot for first - time and returning users . The menu can * be invoked by a user , by tapping on the 3 - caret icon on the left of the * composer . * @ param buttons * a list of { @ link Button } ( max 5 elements ) to use as menu . The * buttons can only be { @ link PostbackButton } or * { @ link WebUrlButton } . Phone buttons are not supported . * @ see < a href = * " https : / / developers . facebook . com / docs / messenger - platform / thread - settings / persistent - menu " * > Facebook ' s Persistent Menu Documentation < / a > */ public static void setPersistentMenu ( List < Button > buttons ) { } }
if ( buttons == null || buttons . isEmpty ( ) || buttons . size ( ) > 5 ) { logger . error ( "FbBotMill validation error: Persistent Menu Buttons can't be null or empty and must be less than 5!" ) ; return ; } CallToActionsRequest request = new CallToActionsRequest ( ThreadState . EXISTING_THREAD , buttons ) ; FbBotMillNetworkController . postThreadSetting ( request ) ;
public class GeoCodeMongo { /** * { @ inheritDoc } */ @ Override public GeoDocument getDocument ( final String placeName ) { } }
if ( placeName == null ) { return null ; } return geoDocumentRepository . find ( placeName ) ;
public class CmsOpenGallery { /** * Opens the gallery . < p > * @ throws Exception if something goes wrong */ public void openGallery ( ) throws Exception { } }
String galleryPath = getParamResource ( ) ; if ( ( galleryPath != null ) && ! galleryPath . endsWith ( "/" ) ) { galleryPath += "/" ; } Map < String , String [ ] > params = new HashMap < String , String [ ] > ( ) ; Locale locale = OpenCms . getLocaleManager ( ) . getDefaultLocale ( getCms ( ) , galleryPath ) ; params . put ( "__locale" , new String [ ] { locale . toString ( ) } ) ; params . put ( I_CmsGalleryProviderConstants . CONFIG_GALLERY_MODE , new String [ ] { GalleryMode . view . name ( ) } ) ; try { if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( galleryPath ) ) { // ensure to have a proper site path to the gallery folder , this is needed within the shared site CmsResource galleryFolder = getCms ( ) . readResource ( galleryPath ) ; galleryPath = getCms ( ) . getSitePath ( galleryFolder ) ; } } catch ( CmsException e ) { // nothing to do } params . put ( I_CmsGalleryProviderConstants . CONFIG_GALLERY_PATH , new String [ ] { galleryPath } ) ; params . put ( I_CmsGalleryProviderConstants . CONFIG_RESOURCE_TYPES , new String [ ] { "" } ) ; sendForward ( I_CmsGalleryProviderConstants . VFS_OPEN_GALLERY_PATH , params ) ;
public class IPOImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . IPO__OVLY_NAME : setOvlyName ( ( String ) newValue ) ; return ; case AfplibPackage . IPO__XOL_OSET : setXolOset ( ( Integer ) newValue ) ; return ; case AfplibPackage . IPO__YOL_OSET : setYolOset ( ( Integer ) newValue ) ; return ; case AfplibPackage . IPO__OVLY_ORENT : setOvlyOrent ( ( Integer ) newValue ) ; return ; case AfplibPackage . IPO__TRIPLETS : getTriplets ( ) . clear ( ) ; getTriplets ( ) . addAll ( ( Collection < ? extends Triplet > ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class AmazonEC2Waiters { /** * Builds a SnapshotCompleted waiter by using custom parameters waiterParameters and other parameters defined in the * waiters specification , and then polls until it determines whether the resource entered the desired state or not , * where polling criteria is bound by either default polling strategy or custom polling strategy . */ public Waiter < DescribeSnapshotsRequest > snapshotCompleted ( ) { } }
return new WaiterBuilder < DescribeSnapshotsRequest , DescribeSnapshotsResult > ( ) . withSdkFunction ( new DescribeSnapshotsFunction ( client ) ) . withAcceptors ( new SnapshotCompleted . IsCompletedMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 40 ) , new FixedDelayStrategy ( 15 ) ) ) . withExecutorService ( executorService ) . build ( ) ;
public class DocBookUtilities { /** * Cleans a string for presentation to a translator */ private static String cleanTranslationText ( final String input , final boolean removeWhitespaceFromStart , final boolean removeWhitespaceFromEnd ) { } }
String retValue = XMLUtilities . cleanText ( input ) ; retValue = retValue . trim ( ) ; /* * When presenting the contents of a childless XML node to the translator , there is no need for white space padding . * When building up a translatable string from a succession of text nodes , whitespace becomes important . */ if ( ! removeWhitespaceFromStart ) { if ( PRECEEDING_WHITESPACE_SIMPLE_RE_PATTERN . matcher ( input ) . matches ( ) ) { retValue = " " + retValue ; } } if ( ! removeWhitespaceFromEnd ) { if ( TRAILING_WHITESPACE_SIMPLE_RE_PATTERN . matcher ( input ) . matches ( ) ) { retValue += " " ; } } return retValue ;
public class DensityTree { /** * Sets split size threshold . * @ param splitSizeThreshold the split size threshold * @ return the split size threshold */ @ javax . annotation . Nonnull public com . simiacryptus . util . data . DensityTree setSplitSizeThreshold ( int splitSizeThreshold ) { } }
this . splitSizeThreshold = splitSizeThreshold ; return this ;
public class CmsJspContentAttachmentsBean { /** * Loads the attachments for a given content . < p > * @ param cms the CMS context * @ param content the content * @ param locale the locale * @ return the attachment bean for the given content and locale */ public static CmsJspContentAttachmentsBean getAttachmentsForLocale ( CmsObject cms , CmsResource content , String locale ) { } }
Optional < CmsResource > detailOnly = CmsDetailOnlyContainerUtil . getDetailOnlyPage ( cms , content , locale ) ; if ( ! detailOnly . isPresent ( ) ) { return new CmsJspContentAttachmentsBean ( ) ; } else { try { return new CmsJspContentAttachmentsBean ( cms , detailOnly . get ( ) ) ; } catch ( Exception e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; return new CmsJspContentAttachmentsBean ( ) ; } }
public class VirtualFile { /** * Get file ' s URL as a file . There will be no trailing { @ code " / " } character unless this { @ code VirtualFile } * represents a root . * @ return the url * @ throws MalformedURLException if the URL is somehow malformed */ public URL asFileURL ( ) throws MalformedURLException { } }
return new URL ( VFSUtils . VFS_PROTOCOL , "" , - 1 , getPathName ( false ) , VFSUtils . VFS_URL_HANDLER ) ;
public class LauncherUtils { /** * Returns a packing plan generated by configured packing class */ public PackingPlan createPackingPlan ( final Config config , final Config runtime ) throws PackingException { } }
// Create an instance of the packing class String packingClass = Context . packingClass ( config ) ; IPacking packing ; try { // create an instance of the packing class packing = ReflectionUtils . newInstance ( packingClass ) ; } catch ( IllegalAccessException | InstantiationException | ClassNotFoundException e ) { throw new PackingException ( String . format ( "Failed to instantiate packing instance using packing class %s" , packingClass ) , e ) ; } try { TopologyAPI . Topology topology = Runtime . topology ( runtime ) ; packing . initialize ( config , topology ) ; return packing . pack ( ) ; } finally { SysUtils . closeIgnoringExceptions ( packing ) ; }
public class CmsXmlContentValueSequence { /** * Removes the value element of the sequence type at the selected index from XML content document . < p > * @ param index the index where to remove the value element * @ see CmsXmlContent # removeValue ( String , Locale , int ) */ public void removeValue ( int index ) { } }
m_content . removeValue ( getPath ( ) , getLocale ( ) , index ) ; // re - initialize the value list m_values = m_content . getValues ( getPath ( ) , getLocale ( ) ) ;
public class Signal { /** * Set the current value of this signal * @ param newValue Replacement value * @ return newValue */ public T set ( final T newValue ) { } }
if ( continuous != null ) continuous . offer ( newValue ) ; setDiscreteIfDiff ( newValue ) ; return newValue ;
public class ClassUtils { /** * Return the qualified name of the given method , consisting of * fully qualified interface / class name + " . " + method name . * @ param method the method * @ param clazz the clazz that the method is being invoked on * ( may be { @ code null } to indicate the method ' s declaring class ) * @ return the qualified name of the method * @ since 4.3.4 */ public static String getQualifiedMethodName ( Method method , Class < ? > clazz ) { } }
Assert . notNull ( method , "Method must not be null" ) ; return ( clazz != null ? clazz : method . getDeclaringClass ( ) ) . getName ( ) + '.' + method . getName ( ) ;
public class CircuitBreakerAspect { /** * handle the CompletionStage return types AOP based into configured circuit - breaker */ private Object handleJoinPointCompletableFuture ( ProceedingJoinPoint proceedingJoinPoint , io . github . resilience4j . circuitbreaker . CircuitBreaker circuitBreaker ) { } }
return circuitBreaker . executeCompletionStage ( ( ) -> { try { return ( CompletionStage < ? > ) proceedingJoinPoint . proceed ( ) ; } catch ( Throwable throwable ) { throw new CompletionException ( throwable ) ; } } ) ;
public class RuleOrganizer { /** * Stores all the sub - sequences that generated by Sequitur rules into an array list sorted by * sub - sequence length in ascending order . * @ param grammarRules the set of grammar rules . * @ return the list of all sub - sequences sorted by length in ascending order . */ protected ArrayList < SAXMotif > getAllMotifs ( GrammarRules grammarRules ) { } }
// result ArrayList < SAXMotif > allMotifs = new ArrayList < SAXMotif > ( ) ; int ruleNumber = grammarRules . size ( ) ; // iterate over all rules for ( int i = 0 ; i < ruleNumber ; i ++ ) { // iterate over all segments / motifs / sub - sequences which correspond // to the rule ArrayList < RuleInterval > arrPos = grammarRules . getRuleRecord ( i ) . getRuleIntervals ( ) ; for ( RuleInterval saxPos : arrPos ) { SAXMotif motif = new SAXMotif ( ) ; motif . setPos ( saxPos ) ; motif . setRuleIndex ( i ) ; motif . setClassified ( false ) ; allMotifs . add ( motif ) ; } } // ascending order Collections . sort ( allMotifs ) ; return allMotifs ;
public class EventAdaptor { /** * Adds a new EventHandler for a Event to the EventAdaptor */ public void addHandler ( AptEvent event , AptMethod eventHandler ) { } }
assert event . getEventSet ( ) == _eventSet ; _handlerMap . put ( event , eventHandler ) ;
public class StringParser { /** * Try to interpret the passed object as boolean . This works only if the * passed object is either a { @ link String } or a { @ link Boolean } . * @ param aObject * The object to be interpreted . May be < code > null < / code > . * @ param bDefault * The default value to be returned , if the object cannot be * interpreted . * @ return The boolean representation or the default value if the passed * object cannot be interpreted as a boolean . */ public static boolean parseBool ( @ Nullable final Object aObject , final boolean bDefault ) { } }
if ( aObject instanceof Boolean ) return ( ( Boolean ) aObject ) . booleanValue ( ) ; if ( aObject instanceof String ) return parseBool ( ( String ) aObject ) ; return bDefault ;
public class HttpHandler { /** * The request is now completed , clean everything . * @ param context the context */ private static void cleanup ( ContextFromVertx context ) { } }
// Release all resources , especially uploaded file . if ( context != null ) { context . cleanup ( ) ; } Context . CONTEXT . remove ( ) ;
public class DistinguishedName { /** * If path is surrounded by quotes , strip them . JNDI considers forward slash * ( ' / ' ) special , but LDAP doesn ' t . { @ link CompositeName # toString ( ) } tends * to mangle a { @ link Name } with a slash by surrounding it with quotes * @ param path Path to check and possibly strip . * @ return A String with the possibly stripped path . */ private String unmangleCompositeName ( String path ) { } }
String tempPath ; // Check if CompositeName has mangled the name with quotes if ( path . startsWith ( "\"" ) && path . endsWith ( "\"" ) ) { tempPath = path . substring ( 1 , path . length ( ) - 1 ) ; } else { tempPath = path ; } tempPath = StringUtils . replace ( tempPath , MANGLED_DOUBLE_QUOTES , PROPER_DOUBLE_QUOTES ) ; return tempPath ;
public class Checker { /** * 检查Double是否为null * @ param value 值 * @ param elseValue 为null返回的值 * @ return { @ link Double } * @ since 1.0.8 */ public static Double checkNull ( Double value , Double elseValue ) { } }
return isNull ( value ) ? elseValue : value ;
public class CRFClassifier { /** * Want to make arbitrary probability queries ? Then this is the method for * you . Given the filename , it reads it in and breaks it into documents , and * then makes a CRFCliqueTree for each document . you can then ask the clique * tree for marginals and conditional probabilities of almost anything you * want . */ public List < CRFCliqueTree > getCliqueTrees ( String filename , DocumentReaderAndWriter < IN > readerAndWriter ) { } }
// only for the OCR data does this matter flags . ocrTrain = false ; List < CRFCliqueTree > cts = new ArrayList < CRFCliqueTree > ( ) ; ObjectBank < List < IN > > docs = makeObjectBankFromFile ( filename , readerAndWriter ) ; for ( List < IN > doc : docs ) { cts . add ( getCliqueTree ( doc ) ) ; } return cts ;
public class ServiceHandler { /** * gets supervisor workers by host or supervisor id , note that id priors to host . * @ param host host * @ param id supervisor id * @ return supervisor workers */ private SupervisorWorkers getSupervisorWorkersByHostOrId ( String host , String id ) throws TException { } }
long start = System . nanoTime ( ) ; if ( StringUtils . isBlank ( id ) && StringUtils . isBlank ( host ) ) { throw new TException ( "Must specify host or supervisor id!" ) ; } try { StormClusterState stormClusterState = data . getStormClusterState ( ) ; // all supervisors Map < String , SupervisorInfo > supervisorInfos = Cluster . get_all_SupervisorInfo ( stormClusterState , null ) ; SupervisorInfo supervisorInfo = null ; String ip ; if ( ! StringUtils . isBlank ( id ) ) { supervisorInfo = supervisorInfos . get ( id ) ; host = supervisorInfo . getHostName ( ) ; ip = NetWorkUtils . host2Ip ( host ) ; } else { ip = NetWorkUtils . host2Ip ( host ) ; for ( Entry < String , SupervisorInfo > entry : supervisorInfos . entrySet ( ) ) { SupervisorInfo info = entry . getValue ( ) ; if ( info . getHostName ( ) . equals ( host ) || info . getHostName ( ) . equals ( ip ) ) { id = entry . getKey ( ) ; supervisorInfo = info ; break ; } } } if ( supervisorInfo == null ) { throw new TException ( "unknown supervisor id:" + id ) ; } Map < String , Assignment > assignments = Cluster . get_all_assignment ( stormClusterState , null ) ; Map < Integer , WorkerSummary > portWorkerSummaries = new TreeMap < > ( ) ; int usedSlotNumber = 0 ; Map < String , Map < Integer , String > > topologyTaskToComponent = new HashMap < > ( ) ; Map < String , MetricInfo > metricInfoMap = new HashMap < > ( ) ; for ( Entry < String , Assignment > entry : assignments . entrySet ( ) ) { String topologyId = entry . getKey ( ) ; Assignment assignment = entry . getValue ( ) ; Set < ResourceWorkerSlot > workers = assignment . getWorkers ( ) ; for ( ResourceWorkerSlot worker : workers ) { if ( ! id . equals ( worker . getNodeId ( ) ) ) { continue ; } usedSlotNumber ++ ; Integer port = worker . getPort ( ) ; WorkerSummary workerSummary = portWorkerSummaries . get ( port ) ; if ( workerSummary == null ) { workerSummary = new WorkerSummary ( ) ; workerSummary . set_port ( port ) ; workerSummary . set_topology ( topologyId ) ; workerSummary . set_tasks ( new ArrayList < TaskComponent > ( ) ) ; portWorkerSummaries . put ( port , workerSummary ) ; } Map < Integer , String > taskToComponent = topologyTaskToComponent . get ( topologyId ) ; if ( taskToComponent == null ) { taskToComponent = Cluster . get_all_task_component ( stormClusterState , topologyId , null ) ; topologyTaskToComponent . put ( topologyId , taskToComponent ) ; } int earliest = TimeUtils . current_time_secs ( ) ; for ( Integer taskId : worker . getTasks ( ) ) { TaskComponent taskComponent = new TaskComponent ( ) ; taskComponent . set_component ( taskToComponent . get ( taskId ) ) ; taskComponent . set_taskId ( taskId ) ; Integer startTime = assignment . getTaskStartTimeSecs ( ) . get ( taskId ) ; if ( startTime != null && startTime < earliest ) { earliest = startTime ; } workerSummary . add_to_tasks ( taskComponent ) ; } workerSummary . set_uptime ( TimeUtils . time_delta ( earliest ) ) ; String workerSlotName = getWorkerSlotName ( ip , port ) ; List < MetricInfo > workerMetricInfoList = this . data . getMetricCache ( ) . getMetricData ( topologyId , MetaType . WORKER ) ; if ( workerMetricInfoList . size ( ) > 0 ) { MetricInfo workerMetricInfo = workerMetricInfoList . get ( 0 ) ; // remove metrics that don ' t belong to current worker for ( Iterator < String > itr = workerMetricInfo . get_metrics ( ) . keySet ( ) . iterator ( ) ; itr . hasNext ( ) ; ) { String metricName = itr . next ( ) ; if ( ! metricName . contains ( ip ) ) { itr . remove ( ) ; } } metricInfoMap . put ( workerSlotName , workerMetricInfo ) ; } } } List < WorkerSummary > workerList = new ArrayList < > ( ) ; workerList . addAll ( portWorkerSummaries . values ( ) ) ; Map < String , Integer > supervisorToUsedSlotNum = new HashMap < > ( ) ; supervisorToUsedSlotNum . put ( id , usedSlotNumber ) ; SupervisorSummary supervisorSummary = NimbusUtils . mkSupervisorSummary ( supervisorInfo , id , supervisorToUsedSlotNum ) ; return new SupervisorWorkers ( supervisorSummary , workerList , metricInfoMap ) ; } catch ( TException e ) { LOG . info ( "Failed to get ClusterSummary " , e ) ; throw e ; } catch ( Exception e ) { LOG . info ( "Failed to get ClusterSummary " , e ) ; throw new TException ( e ) ; } finally { long end = System . nanoTime ( ) ; SimpleJStormMetric . updateNimbusHistogram ( "getSupervisorWorkers" , ( end - start ) / TimeUtils . NS_PER_US ) ; }
public class CProductPersistenceImpl { /** * Removes the c product where uuid = & # 63 ; and groupId = & # 63 ; from the database . * @ param uuid the uuid * @ param groupId the group ID * @ return the c product that was removed */ @ Override public CProduct removeByUUID_G ( String uuid , long groupId ) throws NoSuchCProductException { } }
CProduct cProduct = findByUUID_G ( uuid , groupId ) ; return remove ( cProduct ) ;
public class CmsJspTagPdfThumbnail { /** * The implementation of the tag . < p > * @ param request the current request * @ param file the path to the PDF * @ param width the thumbnail width * @ param height the thumbnail height * @ param format the image format * @ throws CmsException if something goes wrong * @ return the link to the PDF thumbnail */ public static String pdfTagAction ( ServletRequest request , String file , int width , int height , String format ) throws CmsException { } }
CmsFlexController controller = CmsFlexController . getController ( request ) ; CmsObject cms = controller . getCmsObject ( ) ; CmsResource pdfRes = cms . readResource ( file ) ; CmsPdfThumbnailLink linkObj = new CmsPdfThumbnailLink ( cms , pdfRes , width , height , format ) ; return linkObj . getLinkWithOptions ( ) ;
public class BufferedMagicNumberStream { /** * Replies the bytes at the specified offset . * @ param offset is the position of the first byte to read . * @ param length is the count of bytes to read . * @ return the array of red bytes . * @ throws IOException in case of problems */ public byte [ ] read ( int offset , int length ) throws IOException { } }
if ( ensureBuffer ( offset , length ) >= length ) { final byte [ ] array = new byte [ length ] ; System . arraycopy ( this . buffer , offset , array , 0 , length ) ; this . pos = offset + length ; return array ; } throw new EOFException ( ) ;
public class DsParser { /** * Parse a XA datasource * @ param reader The reader * @ return The XA datasource * @ exception XMLStreamException Thrown if a stream error occurs * @ exception ParserException Thrown if a parser error occurs * @ exception ValidateException Thrown if a validation error occurs */ protected org . ironjacamar . common . api . metadata . ds . XaDataSource parseXADataSource ( XMLStreamReader reader ) throws XMLStreamException , ParserException , ValidateException { } }
TransactionIsolation transactionIsolation = null ; Map < String , String > xaDataSourceProperty = new HashMap < String , String > ( ) ; Timeout timeoutSettings = null ; DsSecurity securitySettings = null ; Statement statementSettings = null ; Validation validationSettings = null ; String urlDelimiter = null ; String urlProperty = null ; String urlSelectorStrategyClassName = null ; String newConnectionSql = null ; DsXaPool xaPool = null ; Recovery recovery = null ; String xaDataSourceClass = null ; String driver = null ; // attributes reading String id = null ; Boolean enabled = Defaults . ENABLED ; String jndiName = null ; Boolean spy = Defaults . SPY ; Boolean useCcm = Defaults . USE_CCM ; Boolean connectable = Defaults . CONNECTABLE ; Boolean tracking = Defaults . TRACKING ; Map < String , String > expressions = new HashMap < String , String > ( ) ; for ( int i = 0 ; i < reader . getAttributeCount ( ) ; i ++ ) { switch ( reader . getAttributeLocalName ( i ) ) { case XML . ATTRIBUTE_ENABLED : { enabled = attributeAsBoolean ( reader , XML . ATTRIBUTE_ENABLED , Defaults . ENABLED , expressions ) ; break ; } case XML . ATTRIBUTE_JNDI_NAME : { jndiName = attributeAsString ( reader , XML . ATTRIBUTE_JNDI_NAME , expressions ) ; break ; } case XML . ATTRIBUTE_ID : { id = attributeAsString ( reader , XML . ATTRIBUTE_ID , expressions ) ; break ; } case XML . ATTRIBUTE_SPY : { spy = attributeAsBoolean ( reader , XML . ATTRIBUTE_SPY , Defaults . SPY , expressions ) ; break ; } case XML . ATTRIBUTE_USE_CCM : { useCcm = attributeAsBoolean ( reader , XML . ATTRIBUTE_USE_CCM , Defaults . USE_CCM , expressions ) ; break ; } case XML . ATTRIBUTE_CONNECTABLE : { connectable = attributeAsBoolean ( reader , XML . ATTRIBUTE_CONNECTABLE , Defaults . CONNECTABLE , expressions ) ; break ; } case XML . ATTRIBUTE_TRACKING : { tracking = attributeAsBoolean ( reader , XML . ATTRIBUTE_TRACKING , Defaults . TRACKING , expressions ) ; break ; } default : break ; } } // elements reading while ( reader . hasNext ( ) ) { switch ( reader . nextTag ( ) ) { case END_ELEMENT : { if ( XML . ELEMENT_XA_DATASOURCE . equals ( reader . getLocalName ( ) ) ) { return new XADataSourceImpl ( transactionIsolation , timeoutSettings , securitySettings , statementSettings , validationSettings , urlDelimiter , urlProperty , urlSelectorStrategyClassName , id , enabled , jndiName , spy , useCcm , connectable , tracking , xaDataSourceProperty , xaDataSourceClass , driver , newConnectionSql , xaPool , recovery , ! expressions . isEmpty ( ) ? expressions : null ) ; } else { switch ( reader . getLocalName ( ) ) { case XML . ELEMENT_XA_DATASOURCE_PROPERTY : case XML . ELEMENT_XA_DATASOURCE_CLASS : case XML . ELEMENT_DRIVER : case XML . ELEMENT_XA_POOL : case XML . ELEMENT_NEW_CONNECTION_SQL : case XML . ELEMENT_URL_DELIMITER : case XML . ELEMENT_URL_PROPERTY : case XML . ELEMENT_URL_SELECTOR_STRATEGY_CLASS_NAME : case XML . ELEMENT_TRANSACTION_ISOLATION : case XML . ELEMENT_SECURITY : case XML . ELEMENT_STATEMENT : case XML . ELEMENT_TIMEOUT : case XML . ELEMENT_VALIDATION : case XML . ELEMENT_RECOVERY : break ; default : throw new ParserException ( bundle . unexpectedEndTag ( reader . getLocalName ( ) ) ) ; } } break ; } case START_ELEMENT : { switch ( reader . getLocalName ( ) ) { case XML . ELEMENT_XA_DATASOURCE_PROPERTY : { parseConfigProperty ( xaDataSourceProperty , reader , XML . ELEMENT_XA_DATASOURCE_PROPERTY , expressions ) ; break ; } case XML . ELEMENT_XA_DATASOURCE_CLASS : { xaDataSourceClass = elementAsString ( reader , XML . ELEMENT_XA_DATASOURCE_CLASS , expressions ) ; break ; } case XML . ELEMENT_DRIVER : { driver = elementAsString ( reader , XML . ELEMENT_DRIVER , expressions ) ; break ; } case XML . ELEMENT_XA_POOL : { xaPool = parseXaPool ( reader ) ; break ; } case XML . ELEMENT_NEW_CONNECTION_SQL : { newConnectionSql = elementAsString ( reader , XML . ELEMENT_NEW_CONNECTION_SQL , expressions ) ; break ; } case XML . ELEMENT_URL_DELIMITER : { urlDelimiter = elementAsString ( reader , XML . ELEMENT_URL_DELIMITER , expressions ) ; break ; } case XML . ELEMENT_URL_PROPERTY : { urlProperty = elementAsString ( reader , XML . ELEMENT_URL_PROPERTY , expressions ) ; break ; } case XML . ELEMENT_URL_SELECTOR_STRATEGY_CLASS_NAME : { urlSelectorStrategyClassName = elementAsString ( reader , XML . ELEMENT_URL_SELECTOR_STRATEGY_CLASS_NAME , expressions ) ; break ; } case XML . ELEMENT_TRANSACTION_ISOLATION : { String str = elementAsString ( reader , XML . ELEMENT_TRANSACTION_ISOLATION , expressions ) ; transactionIsolation = TransactionIsolation . forName ( str ) ; if ( transactionIsolation == null ) { transactionIsolation = TransactionIsolation . customLevel ( str ) ; } break ; } case XML . ELEMENT_SECURITY : { securitySettings = parseDsSecurity ( reader ) ; break ; } case XML . ELEMENT_STATEMENT : { statementSettings = parseStatementSettings ( reader ) ; break ; } case XML . ELEMENT_TIMEOUT : { timeoutSettings = parseTimeoutSettings ( reader ) ; break ; } case XML . ELEMENT_VALIDATION : { validationSettings = parseValidationSetting ( reader ) ; break ; } case XML . ELEMENT_RECOVERY : { recovery = parseRecovery ( reader ) ; break ; } default : throw new ParserException ( bundle . unexpectedElement ( reader . getLocalName ( ) ) ) ; } break ; } } } throw new ParserException ( bundle . unexpectedEndOfDocument ( ) ) ;
public class ArgTokenizer { /** * Has the specified option been encountered . * @ param opt the option to check * @ return true if the option has been encountered */ boolean hasOption ( String opt ) { } }
Boolean has = options . get ( opt ) ; if ( has == null ) { throw new InternalError ( "hasOption called before allowedOptions or on bad option" ) ; } return has ;
public class bridgegroup_vlan_binding { /** * Use this API to fetch bridgegroup _ vlan _ binding resources of given name . */ public static bridgegroup_vlan_binding [ ] get ( nitro_service service , Long id ) throws Exception { } }
bridgegroup_vlan_binding obj = new bridgegroup_vlan_binding ( ) ; obj . set_id ( id ) ; bridgegroup_vlan_binding response [ ] = ( bridgegroup_vlan_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class SarlBatchCompiler { /** * Null - safe destruction of the given class loaders . * @ param classLoader the class loader to destroy . */ protected void destroyClassLoader ( ClassLoader classLoader ) { } }
if ( classLoader instanceof Closeable ) { try { ( ( Closeable ) classLoader ) . close ( ) ; } catch ( Exception e ) { reportInternalWarning ( Messages . SarlBatchCompiler_18 , e ) ; } }
public class GlobalizationPreferences { /** * Get a copy of the collator according to the settings . * @ return collator explicit or implicit . * @ hide draft / provisional / internal are hidden on Android */ public Collator getCollator ( ) { } }
if ( collator == null ) { return guessCollator ( ) ; } try { return ( Collator ) collator . clone ( ) ; // clone for safety } catch ( CloneNotSupportedException e ) { throw new ICUCloneNotSupportedException ( "Error in cloning collator" , e ) ; }
public class RegistriesInner { /** * Copies an image to this container registry from the specified container registry . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param parameters The parameters specifying the image to copy and the source container registry . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceResponse } object if successful . */ public Observable < ServiceResponse < Void > > beginImportImageWithServiceResponseAsync ( String resourceGroupName , String registryName , ImportImageParameters parameters ) { } }
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( registryName == null ) { throw new IllegalArgumentException ( "Parameter registryName is required and cannot be null." ) ; } if ( parameters == null ) { throw new IllegalArgumentException ( "Parameter parameters is required and cannot be null." ) ; } Validator . validate ( parameters ) ; final String apiVersion = "2017-10-01" ; return service . beginImportImage ( this . client . subscriptionId ( ) , resourceGroupName , registryName , apiVersion , parameters , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < Void > > > ( ) { @ Override public Observable < ServiceResponse < Void > > call ( Response < ResponseBody > response ) { try { ServiceResponse < Void > clientResponse = beginImportImageDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class ContextPreprocessorIt { /** * Eliminates the senses which do not suit to overall context meaning . Filters senses in two steps : * - filtering within node label * - filtering within context * @ param context context to perform sense filtering * @ throws SenseMatcherException SenseMatcherException */ private void senseFiltering ( IContext context ) throws SenseMatcherException { } }
HashMap < IAtomicConceptOfLabel , List < ISense > > refinedSenses = new HashMap < IAtomicConceptOfLabel , List < ISense > > ( ) ; for ( Iterator < INode > i = context . getNodes ( ) ; i . hasNext ( ) ; ) { INode sourceNode = i . next ( ) ; // if node is complex if ( 1 < sourceNode . getNodeData ( ) . getACoLCount ( ) ) { // for each ACoL in the node for ( Iterator < IAtomicConceptOfLabel > j = sourceNode . getNodeData ( ) . getACoLs ( ) ; j . hasNext ( ) ; ) { IAtomicConceptOfLabel sourceACoL = j . next ( ) ; // compare with all the other ACoLs in the node for ( Iterator < IAtomicConceptOfLabel > k = sourceNode . getNodeData ( ) . getACoLs ( ) ; k . hasNext ( ) ; ) { IAtomicConceptOfLabel targetACoL = k . next ( ) ; if ( ! targetACoL . equals ( sourceACoL ) ) { // for each sense in source ACoL for ( Iterator < ISense > s = sourceACoL . getSenses ( ) ; s . hasNext ( ) ; ) { ISense sourceSense = s . next ( ) ; // for each sense in target ACoL for ( Iterator < ISense > t = targetACoL . getSenses ( ) ; t . hasNext ( ) ; ) { ISense targetSense = t . next ( ) ; if ( senseMatcher . isSourceSynonymTarget ( sourceSense , targetSense ) || senseMatcher . isSourceLessGeneralThanTarget ( sourceSense , targetSense ) || senseMatcher . isSourceMoreGeneralThanTarget ( sourceSense , targetSense ) ) { addToRefinedSenses ( refinedSenses , sourceACoL , sourceSense ) ; addToRefinedSenses ( refinedSenses , targetACoL , targetSense ) ; } } } } } } } // sense disambiguation within the context structure // for all ACoLs in the source node for ( Iterator < IAtomicConceptOfLabel > j = sourceNode . getNodeData ( ) . getACoLs ( ) ; j . hasNext ( ) ; ) { IAtomicConceptOfLabel sourceACoL = j . next ( ) ; if ( ! refinedSenses . containsKey ( sourceACoL ) ) { for ( Iterator < ISense > s = sourceACoL . getSenses ( ) ; s . hasNext ( ) ; ) { ISense sourceSense = s . next ( ) ; // for all target nodes ( ancestors and descendants ) senseFilteringAmong ( sourceNode . getDescendants ( ) , sourceSense , sourceACoL , refinedSenses ) ; senseFilteringAmong ( sourceNode . getAncestors ( ) , sourceSense , sourceACoL , refinedSenses ) ; } } } } // Loop on senses of the all concepts and assign to them // senses mark as refined on the previous step // If there are no refined senses save the original ones for ( Iterator < INode > i = context . getNodes ( ) ; i . hasNext ( ) ; ) { for ( Iterator < IAtomicConceptOfLabel > j = i . next ( ) . getNodeData ( ) . getACoLs ( ) ; j . hasNext ( ) ; ) { IAtomicConceptOfLabel acol = j . next ( ) ; List < ISense > refined = refinedSenses . get ( acol ) ; if ( null != refined ) { while ( 0 < acol . getSenseCount ( ) ) { acol . removeSense ( 0 ) ; } for ( ISense sense : refined ) { acol . addSense ( sense ) ; } } } }
public class Indicator { /** * Sets the color definition that will be used to visualize the off state of the symbol * @ param OFF _ COLOR */ public void setOffColor ( final ColorDef OFF_COLOR ) { } }
offColor = OFF_COLOR ; init ( getInnerBounds ( ) . width , getInnerBounds ( ) . height ) ; repaint ( getInnerBounds ( ) ) ;
public class ChannelBuffer { /** * Returns the element of { @ code head } index of * the buffer if it is not empty , otherwise returns * { @ code null } . Increases the value of { @ code head } . * If the buffer will have less elements than { @ code bufferMinSize } * after this poll and { @ code put } promise is not { @ code null } , * { @ code put } will be set { @ code null } after the poll . * If current { @ code exception } is not { @ code null } , * it will be thrown . * @ return element of this buffer at { @ code head } * index if the buffer is not empty , otherwise { @ code null } * @ throws Exception if current { @ code exception } * is not { @ code null } */ @ Nullable public T poll ( ) throws Exception { } }
if ( exception != null ) throw exception ; if ( put != null && willBeExhausted ( ) ) { T item = doPoll ( ) ; SettablePromise < Void > put = this . put ; this . put = null ; put . set ( null ) ; return item ; } return ! isEmpty ( ) ? doPoll ( ) : null ;
public class CodeBuilderUtil { /** * Generate code to throw an exception with an optional message . * @ param b { @ link CodeBuilder } to which to add code * @ param type type of the object to throw * @ param message optional message to provide to the constructor */ public static void throwException ( CodeBuilder b , Class type , String message ) { } }
TypeDesc desc = TypeDesc . forClass ( type ) ; b . newObject ( desc ) ; b . dup ( ) ; if ( message == null ) { b . invokeConstructor ( desc , null ) ; } else { b . loadConstant ( message ) ; b . invokeConstructor ( desc , new TypeDesc [ ] { TypeDesc . STRING } ) ; } b . throwObject ( ) ;
public class XMLUtils { /** * Get first child element by DITA class . * @ param elem root element * @ param cls DITA class to match element * @ return matching element */ public static Optional < Element > getChildElement ( final Element elem , final DitaClass cls ) { } }
final NodeList children = elem . getChildNodes ( ) ; for ( int i = 0 ; i < children . getLength ( ) ; i ++ ) { final Node child = children . item ( i ) ; if ( cls . matches ( child ) ) { return Optional . of ( ( Element ) child ) ; } } return Optional . empty ( ) ;
public class ClassName { /** * Extract a slashed classname from a JVM classname or signature . * @ param originalName * JVM classname or signature * @ return a slashed classname */ public static @ SlashedClassName String extractClassName ( String originalName ) { } }
String name = originalName ; if ( name . charAt ( 0 ) != '[' && name . charAt ( name . length ( ) - 1 ) != ';' ) { return name ; } while ( name . charAt ( 0 ) == '[' ) { name = name . substring ( 1 ) ; } if ( name . charAt ( 0 ) == 'L' && name . charAt ( name . length ( ) - 1 ) == ';' ) { name = name . substring ( 1 , name . length ( ) - 1 ) ; } if ( name . charAt ( 0 ) == '[' ) { throw new IllegalArgumentException ( "Bad class name: " + originalName ) ; } return name ;
public class MtasSolrStatus { /** * Sets the finished . */ public final void setFinished ( ) { } }
if ( ! finished ) { totalTime = ( ( Long ) ( System . currentTimeMillis ( ) - startTime ) ) . intValue ( ) ; shardInfoUpdated = false ; finished = true ; rsp = null ; }
public class EntryStream { /** * Returns a stream consisting of the entries of this stream , additionally * performing the provided action on each entry value as entries are * consumed from the resulting stream . * This is an < a href = " package - summary . html # StreamOps " > intermediate < / a > * operation . * For parallel stream pipelines , the action may be called at whatever time * and in whatever thread the element is made available by the upstream * operation . If the action modifies shared state , it is responsible for * providing the required synchronization . * @ param valueAction a non - interfering action to perform on the values of * the entries as they are consumed from the stream * @ return the new stream * @ since 0.2.3 */ public EntryStream < K , V > peekValues ( Consumer < ? super V > valueAction ) { } }
return peek ( e -> valueAction . accept ( e . getValue ( ) ) ) ;
public class Net { /** * - - Socket options */ static void setSocketOption ( FileDescriptor fd , ProtocolFamily family , SocketOption < ? > name , Object value ) throws IOException { } }
if ( value == null ) throw new IllegalArgumentException ( "Invalid option value" ) ; // only simple values supported by this method Class < ? > type = name . type ( ) ; if ( type != Integer . class && type != Boolean . class ) throw new AssertionError ( "Should not reach here" ) ; // special handling if ( name == StandardSocketOptions . SO_RCVBUF || name == StandardSocketOptions . SO_SNDBUF ) { int i = ( ( Integer ) value ) . intValue ( ) ; if ( i < 0 ) throw new IllegalArgumentException ( "Invalid send/receive buffer size" ) ; } if ( name == StandardSocketOptions . SO_LINGER ) { int i = ( ( Integer ) value ) . intValue ( ) ; if ( i < 0 ) value = Integer . valueOf ( - 1 ) ; if ( i > 65535 ) value = Integer . valueOf ( 65535 ) ; } if ( name == StandardSocketOptions . IP_TOS ) { int i = ( ( Integer ) value ) . intValue ( ) ; if ( i < 0 || i > 255 ) throw new IllegalArgumentException ( "Invalid IP_TOS value" ) ; } if ( name == StandardSocketOptions . IP_MULTICAST_TTL ) { int i = ( ( Integer ) value ) . intValue ( ) ; if ( i < 0 || i > 255 ) throw new IllegalArgumentException ( "Invalid TTL/hop value" ) ; } // map option name to platform level / name OptionKey key = SocketOptionRegistry . findOption ( name , family ) ; if ( key == null ) throw new AssertionError ( "Option not found" ) ; int arg ; if ( type == Integer . class ) { arg = ( ( Integer ) value ) . intValue ( ) ; } else { boolean b = ( ( Boolean ) value ) . booleanValue ( ) ; arg = ( b ) ? 1 : 0 ; } boolean mayNeedConversion = ( family == UNSPEC ) ; setIntOption0 ( fd , mayNeedConversion , key . level ( ) , key . name ( ) , arg ) ;
public class JdbcConnectionSource { /** * Initialize the class after the setters have been called . If you are using the no - arg constructor and Spring type * wiring , this should be called after all of the set methods . * @ throws SQLException * If the driver associated with the database URL is not found in the classpath . */ public void initialize ( ) throws SQLException { } }
if ( initialized ) { return ; } if ( url == null ) { throw new SQLException ( "url was never set on " + getClass ( ) . getSimpleName ( ) ) ; } if ( databaseType == null ) { databaseType = DatabaseTypeUtils . createDatabaseType ( url ) ; } databaseType . loadDriver ( ) ; databaseType . setDriver ( DriverManager . getDriver ( url ) ) ; initialized = true ;
public class ThriftCodecByteCodeGenerator { /** * Defines the code to construct the union ( or builder ) instance and stores it in a local * variable . */ private LocalVariableDefinition constructUnionInstance ( MethodDefinition read ) { } }
LocalVariableDefinition instance = read . addLocalVariable ( structType , "instance" ) ; // create the new instance ( or builder ) if ( metadata . getBuilderClass ( ) == null ) { read . newObject ( structType ) . dup ( ) ; } else { read . newObject ( metadata . getBuilderClass ( ) ) . dup ( ) ; } // switch ( fieldId ) read . loadVariable ( "fieldId" ) ; List < CaseStatement > cases = new ArrayList < > ( ) ; for ( ThriftFieldMetadata field : metadata . getFields ( THRIFT_FIELD ) ) { if ( field . getConstructorInjection ( ) . isPresent ( ) ) { cases . add ( caseStatement ( field . getId ( ) , field . getName ( ) + "-id-field" ) ) ; } } read . switchStatement ( "no-field-ctor" , cases ) ; for ( ThriftFieldMetadata field : metadata . getFields ( THRIFT_FIELD ) ) { if ( field . getConstructorInjection ( ) . isPresent ( ) ) { // case fieldId : read . visitLabel ( field . getName ( ) + "-id-field" ) ; // Load the read value read . loadVariable ( "f_" + field . getName ( ) ) ; read . invokeConstructor ( field . getConstructorInjection ( ) . get ( ) . getConstructor ( ) ) . storeVariable ( instance ) . gotoLabel ( "instance-ok" ) ; } } read . visitLabel ( "no-field-ctor" ) ; // No args c ' tor present . if ( metadata . getConstructorInjection ( ) . isPresent ( ) ) { ThriftConstructorInjection constructor = metadata . getConstructorInjection ( ) . get ( ) ; // invoke constructor read . invokeConstructor ( constructor . getConstructor ( ) ) . storeVariable ( instance ) ; } else { read . pop ( ) // get rid of the half - constructed element . loadConstant ( metadata . getStructClass ( ) ) . loadVariable ( "fieldId" ) . invokeStatic ( SwiftBytecodeHelper . NO_CONSTRUCTOR_FOUND ) . throwException ( ) ; } read . visitLabel ( "instance-ok" ) ; return instance ;
public class SquareCrossClustersIntoGrids { /** * Adds the first row to the list of rows when the seed element has two edges */ List < SquareNode > firstRow2 ( SquareNode seed ) { } }
int indexLower = lowerEdgeIndex ( seed ) ; int indexUpper = addOffset ( indexLower , 1 , seed . square . size ( ) ) ; List < SquareNode > listDown = new ArrayList < > ( ) ; List < SquareNode > list = new ArrayList < > ( ) ; if ( ! addToRow ( seed , indexUpper , 1 , true , listDown ) ) return null ; flipAdd ( listDown , list ) ; list . add ( seed ) ; seed . graph = 0 ; if ( ! addToRow ( seed , indexLower , - 1 , true , list ) ) return null ; return list ;
public class DonutOptions { /** * Creates the Safari data . */ private BrowserUsageData getSafariUsageData ( ) { } }
BrowserUsageData data = new BrowserUsageData ( ) ; data . setBrowserName ( "Safari" ) ; data . setMarketShare ( 7.15f ) ; ColorReference safariColor = new HighchartsColor ( 3 ) ; data . setColor ( safariColor ) ; data . getVersionUsageData ( ) . add ( new VersionUsageData ( "Safari 5.0" , 4.55f , safariColor . brighten ( 0.1f ) ) ) ; data . getVersionUsageData ( ) . add ( new VersionUsageData ( "Safari 4.0" , 1.42f , safariColor . brighten ( 0.2f ) ) ) ; data . getVersionUsageData ( ) . add ( new VersionUsageData ( "Safari Win 5.0" , 0.23f , safariColor . brighten ( 0.3f ) ) ) ; data . getVersionUsageData ( ) . add ( new VersionUsageData ( "Safari 4.1" , 0.21f , safariColor . brighten ( 0.4f ) ) ) ; data . getVersionUsageData ( ) . add ( new VersionUsageData ( "Safari / Maxthon" , 0.20f , safariColor . brighten ( 0.5f ) ) ) ; data . getVersionUsageData ( ) . add ( new VersionUsageData ( "Safari 3.1" , 0.19f , safariColor . brighten ( 0.6f ) ) ) ; data . getVersionUsageData ( ) . add ( new VersionUsageData ( "Safari 4.1" , 0.14f , safariColor . brighten ( 0.7f ) ) ) ; return data ;
public class Dialog { /** * Set the text of neutral action button . * @ param action * @ return The Dialog for chaining methods . */ public Dialog neutralAction ( CharSequence action ) { } }
mNeutralAction . setText ( action ) ; mNeutralAction . setVisibility ( TextUtils . isEmpty ( action ) ? View . GONE : View . VISIBLE ) ; return this ;
public class Optional { /** * Return the value if present , otherwise get the value from the Supplier . * @ param other a Supplier * @ return the value , if present , or the return of the Supplier * @ since 1.7 */ public T orElseSupplier ( final Supplier < T > other ) { } }
checkNotNull ( other , "orElse requires a non null supplier" ) ; if ( isPresent ( ) ) { return get ( ) ; } return other . get ( ) ;
public class BaseClassFinderService { /** * Bundle shutting down . */ public void stop ( BundleContext context ) throws Exception { } }
this . log ( context , LogService . LOG_INFO , "Stopping the " + this . getClass ( ) . getName ( ) + " ClassService bundle" ) ; // I ' m unregistered automatically bundleContext = null ;
public class VmlGraphicsContext { /** * Draw a type ( shapetype for vml ) . * @ param parent * the parent of the shapetype * @ param id * the types ' s unique identifier * @ param symbol * the symbol information * @ param style * The default style to apply on the shape - type . Can be overridden when a shape uses this shape - type . * @ param transformation * the transformation to apply on the symbol */ public void drawSymbolDefinition ( Object parent , String id , SymbolInfo symbol , ShapeStyle style , Matrix transformation ) { } }
if ( isAttached ( ) ) { if ( symbol == null ) { return ; } symbolDefs . put ( id , new SymbolDefinition ( symbol , style ) ) ; if ( symbol . getImage ( ) != null ) { // When it ' s an image symbol , add an extra definition for it ' s selection : SymbolInfo selected = new SymbolInfo ( ) ; ImageInfo selectedImage = new ImageInfo ( ) ; selectedImage . setHref ( symbol . getImage ( ) . getSelectionHref ( ) ) ; selectedImage . setWidth ( symbol . getImage ( ) . getWidth ( ) ) ; selectedImage . setHeight ( symbol . getImage ( ) . getHeight ( ) ) ; selected . setImage ( selectedImage ) ; symbolDefs . put ( id + "-selection" , new SymbolDefinition ( selected , null ) ) ; } }
public class ProteinPocketFinder { /** * Method writes the pockets to pmesh format . */ public void writePocketsToPMesh ( String outPutFileName ) { } }
try { for ( int i = 0 ; i < pockets . size ( ) ; i ++ ) { // go through every // pocket BufferedWriter writer = new BufferedWriter ( new FileWriter ( outPutFileName + "-" + i + ".pmesh" ) ) ; List < Point3d > pocket = pockets . get ( i ) ; writer . write ( pocket . size ( ) + "\n" ) ; for ( int j = 0 ; j < pocket . size ( ) ; j ++ ) { // go through every // grid point of the // actual pocket Point3d actualGridPoint = ( Point3d ) pocket . get ( j ) ; Point3d coords = gridGenerator . getCoordinatesFromGridPoint ( actualGridPoint ) ; writer . write ( coords . x + "\t" + coords . y + "\t" + coords . z + "\n" ) ; } writer . close ( ) ; } } catch ( IOException e ) { logger . debug ( e ) ; }
public class Mode { /** * Creates and returns a new mode object of the current list of options together with * the given one . * < p > If { @ code value } is { @ code null } the option key is removed ( same as * calling { @ link # without ( Key ) } . < / p > * < p > If there is a value for that < code > key < / code > already then this overrides * the previously used value . < / p > */ @ NotNull public < T > Mode with ( @ NotNull Key < T > key , @ Nullable T value ) { } }
return new Mode ( Map ( this . defs , key , value ) ) ;
public class MessageItemReference { /** * ( non - Javadoc ) * @ see com . ibm . ws . sib . store . AbstractItem # getStorageStrategy ( ) */ @ Override public int getStorageStrategy ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getStorageStrategy" ) ; int storageStrat = getMessageItem ( ) . getStorageStrategy ( ) ; // It is possible that this reference has a lesser storage strategy // from the referenced message item . if ( downgradePersistence ) { // the maximum required ' persistence ' is STORE _ MAYBE if ( storageStrat > STORE_MAYBE ) storageStrat = STORE_MAYBE ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getStorageStrategy" , Integer . valueOf ( storageStrat ) ) ; return storageStrat ;
public class CommonUtils { /** * Unwraps a { @ link alluxio . proto . dataserver . Protocol . Response } associated with a channel . * @ param response the response * @ param channel the channel that receives this response */ public static void unwrapResponseFrom ( Protocol . Response response , Channel channel ) throws AlluxioStatusException { } }
Status status = ProtoUtils . fromProto ( response . getStatus ( ) ) ; if ( status != Status . OK ) { throw AlluxioStatusException . from ( status . withDescription ( String . format ( "Channel to %s: %s" , channel . remoteAddress ( ) , response . getMessage ( ) ) ) ) ; }
public class BlockPosUtils { /** * Compares the distance of the passed { @ link BlockPos } to the < i > offset < / i > { @ link Point } . * @ param offset the offset * @ param pos1 the pos 1 * @ param pos2 the pos 2 * @ return the int */ public static int compare ( Point offset , BlockPos pos1 , BlockPos pos2 ) { } }
if ( pos1 . equals ( pos2 ) ) return 0 ; return Double . compare ( pos1 . distanceSq ( offset . x , offset . y , offset . z ) , pos2 . distanceSq ( offset . x , offset . y , offset . z ) ) ;
public class CmsListItemDetails { /** * Sets the id of the list . < p > * @ param listId the id of the list */ @ Override public void setListId ( String listId ) { } }
m_hideAction . setListId ( listId ) ; m_showAction . setListId ( listId ) ;
public class Reliability { /** * Compare this Reliability with another . * The method implements java . util . Comaparable . compareTo and therefore * has the same semantics . * @ param other The Reliability this is to be compared with . * @ return An int indicating the relative values as follows : * < br > > 0 : this > other ( i . e . more Reliable ) . * < br > 0 : this = = other * < br > < 0 : this < other ( i . e . less Reliable ) . * @ ibm - was - base * @ ibm - api */ public final int compareTo ( Object other ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . info ( tc , "this: " + this + ", other: " + other . toString ( ) + ", result: " + ( this . intValue - ( ( Reliability ) other ) . intValue ) ) ; return ( this . intValue - ( ( Reliability ) other ) . intValue ) ;
public class ParamUtils { /** * Sets the dynamic param . * attributes . * Handles Iterable , Iterator , Enumeration , arrays , and direct coercion . * @ throws JspTagException if any dynamic parameter other than " param . * " is given */ public static void setDynamicAttribute ( ParamsAttribute paramsAttribute , String uri , String localName , Object value ) throws JspTagException { } }
assert uri == null ; assert localName . startsWith ( PARAM_ATTRIBUTE_PREFIX ) ; if ( value != null ) { String paramName = localName . substring ( PARAM_ATTRIBUTE_PREFIX . length ( ) ) ; if ( value instanceof Iterable < ? > ) { addIterableParams ( paramsAttribute , paramName , ( Iterable < ? > ) value ) ; } else if ( value instanceof Iterator < ? > ) { addIteratorParams ( paramsAttribute , paramName , ( Iterator < ? > ) value ) ; } else if ( value instanceof Enumeration < ? > ) { addEnumerationParams ( paramsAttribute , paramName , ( Enumeration < ? > ) value ) ; } else if ( value . getClass ( ) . isArray ( ) ) { addArrayParams ( paramsAttribute , paramName , value ) ; } else { addParam ( paramsAttribute , paramName , Coercion . toString ( value ) ) ; } }
public class MultiUserChat { /** * Returns the next available message in the chat . The method call will block * ( not return ) until a stanza is available or the < tt > timeout < / tt > has elapased . * If the timeout elapses without a result , < tt > null < / tt > will be returned . * @ param timeout the maximum amount of time to wait for the next message . * @ return the next message , or < tt > null < / tt > if the timeout elapses without a * message becoming available . * @ throws MucNotJoinedException * @ throws InterruptedException */ public Message nextMessage ( long timeout ) throws MucNotJoinedException , InterruptedException { } }
if ( messageCollector == null ) { throw new MucNotJoinedException ( this ) ; } return messageCollector . nextResult ( timeout ) ;
public class ComException { /** * Cuts off the end of line characters . * @ param s the original String * @ return */ private static String cutEOL ( String s ) { } }
if ( s == null ) return "(Unknown error)" ; if ( s . endsWith ( "\r\n" ) ) return s . substring ( 0 , s . length ( ) - 2 ) ; else return s ;
public class StandaloneConfiguration { /** * Return a JsonElement representation of the configuration . Does not serialize nulls . */ public Map < String , Object > toJson ( ) { } }
Map < String , Object > json = new HashMap < > ( ) ; json . put ( "browserTimeout" , browserTimeout ) ; json . put ( "debug" , debug ) ; json . put ( "jettyMaxThreads" , jettyMaxThreads ) ; json . put ( "log" , log ) ; json . put ( "host" , host ) ; json . put ( "port" , port ) ; json . put ( "role" , role ) ; json . put ( "timeout" , timeout ) ; serializeFields ( json ) ; return json . entrySet ( ) . stream ( ) . filter ( entry -> entry . getValue ( ) != null ) . collect ( toImmutableSortedMap ( natural ( ) , Map . Entry :: getKey , Map . Entry :: getValue ) ) ;
public class DraftServiceLocator { /** * For the given interface , get the stub implementation . * If this service has no port for the given interface , * then ServiceException is thrown . */ public java . rmi . Remote getPort ( Class serviceEndpointInterface ) throws javax . xml . rpc . ServiceException { } }
try { if ( com . google . api . ads . adwords . axis . v201809 . cm . DraftServiceInterface . class . isAssignableFrom ( serviceEndpointInterface ) ) { com . google . api . ads . adwords . axis . v201809 . cm . DraftServiceSoapBindingStub _stub = new com . google . api . ads . adwords . axis . v201809 . cm . DraftServiceSoapBindingStub ( new java . net . URL ( DraftServiceInterfacePort_address ) , this ) ; _stub . setPortName ( getDraftServiceInterfacePortWSDDServiceName ( ) ) ; return _stub ; } } catch ( java . lang . Throwable t ) { throw new javax . xml . rpc . ServiceException ( t ) ; } throw new javax . xml . rpc . ServiceException ( "There is no stub implementation for the interface: " + ( serviceEndpointInterface == null ? "null" : serviceEndpointInterface . getName ( ) ) ) ;
public class AbstractIoSession { /** * { @ inheritDoc } */ public final int getIdleCount ( IdleStatus status ) { } }
if ( getConfig ( ) . getIdleTime ( status ) == 0 ) { if ( status == IdleStatus . BOTH_IDLE ) { idleCountForBoth . set ( 0 ) ; } if ( status == IdleStatus . READER_IDLE ) { idleCountForRead . set ( 0 ) ; } if ( status == IdleStatus . WRITER_IDLE ) { idleCountForWrite . set ( 0 ) ; } } if ( status == IdleStatus . BOTH_IDLE ) { return idleCountForBoth . get ( ) ; } if ( status == IdleStatus . READER_IDLE ) { return idleCountForRead . get ( ) ; } if ( status == IdleStatus . WRITER_IDLE ) { return idleCountForWrite . get ( ) ; } throw new IllegalArgumentException ( "Unknown idle status: " + status ) ;
public class OCommandExecutorSQLTruncateClass { /** * Execute the command . */ public Object execute ( final Map < Object , Object > iArgs ) { } }
if ( schemaClass == null ) throw new OCommandExecutionException ( "Cannot execute the command because it has not been parsed yet" ) ; final long recs = schemaClass . count ( ) ; try { schemaClass . truncate ( ) ; } catch ( IOException e ) { throw new OCommandExecutionException ( "Error on executing command" , e ) ; } return recs ;
public class BeanPropertyAccessor { /** * Returns two arrays of PropertyDescriptors . Array 0 has contains read * PropertyDescriptors , array 1 contains the write PropertyDescriptors . */ private static PropertyDescriptor [ ] [ ] getBeanProperties ( Class < ? > beanType ) { } }
List < PropertyDescriptor > readProperties = new ArrayList < PropertyDescriptor > ( ) ; List < PropertyDescriptor > writeProperties = new ArrayList < PropertyDescriptor > ( ) ; try { Map < ? , ? > map = CompleteIntrospector . getAllProperties ( beanType ) ; Iterator < ? > it = map . values ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { PropertyDescriptor pd = ( PropertyDescriptor ) it . next ( ) ; if ( pd . getReadMethod ( ) != null ) { readProperties . add ( pd ) ; } if ( pd . getWriteMethod ( ) != null ) { writeProperties . add ( pd ) ; } } } catch ( IntrospectionException e ) { throw new RuntimeException ( e . toString ( ) ) ; } PropertyDescriptor [ ] [ ] props = new PropertyDescriptor [ 2 ] [ ] ; props [ 0 ] = new PropertyDescriptor [ readProperties . size ( ) ] ; readProperties . toArray ( props [ 0 ] ) ; props [ 1 ] = new PropertyDescriptor [ writeProperties . size ( ) ] ; writeProperties . toArray ( props [ 1 ] ) ; return props ;
public class ComparableProperty { /** * Creates a { @ code Filter } to indicate whether this property is not equal * to the specified value or not ( ! = , & lt ; & gt ; ) . * @ param value The value to be evaluated . * @ return The { @ code Filter } to indicate whether this property is not equal * to the specified value or not . */ public Filter < T > notEqualTo ( T value ) { } }
return new ComparableFilter < T > ( this , value , Operator . NOT_EQUAL_TO ) ;
public class RepresentationModel { /** * Returns the link with the given relation . * @ param relation must not be { @ literal null } . * @ return the link with the given relation . * @ throws IllegalArgumentException in case no link with the given relation can be found . */ public Link getRequiredLink ( LinkRelation relation ) { } }
Assert . notNull ( relation , "Link relation must not be null!" ) ; return getRequiredLink ( relation . value ( ) ) ;
public class Client { /** * Registers a device using the device ' s unique device ID . * @ param context * @ param properties * @ return a Device object if success */ public Device registerDevice ( UUID deviceId , Map < String , Object > properties ) { } }
assertValidApplicationId ( ) ; if ( properties == null ) { properties = new HashMap < String , Object > ( ) ; } properties . put ( "refreshed" , System . currentTimeMillis ( ) ) ; ApiResponse response = apiRequest ( HttpMethod . PUT , null , properties , organizationId , applicationId , "devices" , deviceId . toString ( ) ) ; return response . getFirstEntity ( Device . class ) ;
public class ModelsImpl { /** * Gets information about the hierarchical entity model . * @ param appId The application ID . * @ param versionId The version ID . * @ param hEntityId The hierarchical entity extractor ID . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the HierarchicalEntityExtractor object */ public Observable < ServiceResponse < HierarchicalEntityExtractor > > getHierarchicalEntityWithServiceResponseAsync ( UUID appId , String versionId , UUID hEntityId ) { } }
if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( appId == null ) { throw new IllegalArgumentException ( "Parameter appId is required and cannot be null." ) ; } if ( versionId == null ) { throw new IllegalArgumentException ( "Parameter versionId is required and cannot be null." ) ; } if ( hEntityId == null ) { throw new IllegalArgumentException ( "Parameter hEntityId is required and cannot be null." ) ; } String parameterizedHost = Joiner . on ( ", " ) . join ( "{Endpoint}" , this . client . endpoint ( ) ) ; return service . getHierarchicalEntity ( appId , versionId , hEntityId , this . client . acceptLanguage ( ) , parameterizedHost , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < HierarchicalEntityExtractor > > > ( ) { @ Override public Observable < ServiceResponse < HierarchicalEntityExtractor > > call ( Response < ResponseBody > response ) { try { ServiceResponse < HierarchicalEntityExtractor > clientResponse = getHierarchicalEntityDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class CmsResourceWrapperUtils { /** * Adds a file extension to the resource name . < p > * If the file with the new extension already exists , an index count will be * added before the final extension . < p > * For example : < code > index . html . 1 . jsp < / code > . < p > * @ see # removeFileExtension ( CmsObject , String , String ) * @ param cms the actual CmsObject * @ param resourcename the name of the resource where to add the file extension * @ param extension the extension to add * @ return the resource name with the added file extension */ public static String addFileExtension ( CmsObject cms , String resourcename , String extension ) { } }
if ( ! extension . startsWith ( "." ) ) { extension = "." + extension ; } if ( ! resourcename . endsWith ( extension ) ) { String name = resourcename + extension ; int count = 0 ; while ( cms . existsResource ( name ) ) { count ++ ; name = resourcename + "." + count + extension ; } return name ; } return resourcename ;
public class SMILESWriter { /** * Writes the content from molecule to output . * @ param molecule Molecule of which the data is given as output . */ public void writeAtomContainer ( IAtomContainer molecule ) { } }
SmilesGenerator sg = new SmilesGenerator ( ) ; if ( useAromaticityFlag . isSet ( ) ) sg = sg . aromatic ( ) ; String smiles = "" ; try { smiles = sg . create ( molecule ) ; logger . debug ( "Generated SMILES: " + smiles ) ; writer . write ( smiles ) ; writer . write ( '\n' ) ; writer . flush ( ) ; logger . debug ( "file flushed..." ) ; } catch ( CDKException | IOException exc ) { logger . error ( "Error while writing Molecule: " , exc . getMessage ( ) ) ; logger . debug ( exc ) ; }
public class ConnectionManager { /** * with a new MCWrapper . The fromMCWrapper can be null - needed for SmartHandle support . */ private void reassociateConnectionHandle ( Object connection , MCWrapper fromMCWrapper , MCWrapper toMCWrapper , UOWCoordinator uowCoord ) throws ResourceException { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "reassociateConnectionHandle" ) ; try { toMCWrapper . associateConnection ( connection , fromMCWrapper ) ; } catch ( ResourceException e ) { /* * If the Resource Adapter throws a ResourceException and we are not in a * transaction and there are no other connections open on the ManagedConnection , * return the ManagedConnection to the pool before * rethrowing the exception . The ManagedConnection is probably OK - the exception * may only be a logon failure or similar so the MC shouldn ' t be ' lost ' . * If we are in a transaction , just throw the exception . Assume we will cleanup during * the aftercompletion call on the tran wrapper . */ com . ibm . ws . ffdc . FFDCFilter . processException ( e , "com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle" , "479" , this ) ; if ( uowCoord == null && toMCWrapper . getHandleCount ( ) == 0 ) { try { toMCWrapper . releaseToPoolManager ( ) ; } catch ( Exception exp ) { // don ' t rethrow , already on exception path com . ibm . ws . ffdc . FFDCFilter . processException ( exp , "com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle" , "487" , this ) ; // if ( TraceComponent . isAnyTracingEnabled ( ) & & tc . isDebugEnabled ( ) ) Tr . error ( tc , "FAILED_CONNECTION_RELEASE_J2CA0022" , new Object [ ] { exp , toMCWrapper . gConfigProps . cfName } ) ; } } throw e ; } catch ( java . lang . Exception e ) { com . ibm . ws . ffdc . FFDCFilter . processException ( e , "com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle" , "495" , this ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "reassociateConnectionHandle: Caught a Non resource exception from mc.associateConnection()" ) ; } Tr . error ( tc , "FAILED_CONNECTION_J2CA0021" , new Object [ ] { e , toMCWrapper . gConfigProps . cfName } ) ; /* * If the Resource Adapter throws an Exception and we are not in a * transaction and there are no other connections open on the ManagedConnection , * return the ManagedConnection to the pool before * rethrowing the exception . The ManagedConnection is probably OK - the exception * may only be a logon failure or similar so the MC shouldn ' t be ' lost ' . * If we are in a transaction , just throw the exception . Assume we will cleanup during * the aftercompletion call on the tran wrapper . */ if ( uowCoord == null && toMCWrapper . getHandleCount ( ) == 0 ) { try { toMCWrapper . releaseToPoolManager ( ) ; } catch ( Exception exp ) { // don ' t rethrow , already on exception path com . ibm . ws . ffdc . FFDCFilter . processException ( exp , "com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle" , "518" , this ) ; // if ( TraceComponent . isAnyTracingEnabled ( ) & & tc . isDebugEnabled ( ) ) Tr . error ( tc , "FAILED_CONNECTION_RELEASE_J2CA0022" , new Object [ ] { exp , toMCWrapper . gConfigProps . cfName } ) ; } } ResourceException re = new ResourceException ( "reassociateConnectionHandle: caught Exception" ) ; re . initCause ( e ) ; throw re ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "reassociateConnectionHandle" ) ;
public class AESUtils { /** * Encrypt the plain text . * @ param key * 256 bit key base64 encoded * @ param plainText * text that needs to be encrypted * @ return the iv as a hex string followed by ' $ ' followed by the encrypted text . */ public static String encrypt ( String key , String plainText ) { } }
SecretKey secret = new SecretKeySpec ( Base64 . decodeBase64 ( key . getBytes ( StandardCharsets . UTF_8 ) ) , "AES" ) ; return encryptBouncyCastle ( secret , plainText ) ;
public class HttpUtils { /** * Get方法 * @ param url * @ return * @ throws Exception */ public static HttpResponse doGetResponse ( String url ) throws Exception { } }
return doGetResponse ( url , null , null , null ) ;
public class ObjectFactory { /** * Finds the implementation Class object in the specified order . The * specified order is the following : * < ol > * < li > query the system property using < code > System . getProperty < / code > * < li > read < code > META - INF / services / < i > factoryId < / i > < / code > file * < li > use fallback classname * < / ol > * @ return instance of factory , never null * @ param factoryId Name of the factory to find , same as * a property name * @ param fallbackClassName Implementation class name , if nothing else * is found . Use null to mean no fallback . * @ exception ObjectFactory . ConfigurationError */ static Object createObject ( String factoryId , String fallbackClassName ) throws ConfigurationError { } }
return createObject ( factoryId , null , fallbackClassName ) ;
public class DataStream { /** * private helper method for custom partitioning */ private < K > DataStream < T > partitionCustom ( Partitioner < K > partitioner , Keys < T > keys ) { } }
KeySelector < T , K > keySelector = KeySelectorUtil . getSelectorForOneKey ( keys , partitioner , getType ( ) , getExecutionConfig ( ) ) ; return setConnectionType ( new CustomPartitionerWrapper < > ( clean ( partitioner ) , clean ( keySelector ) ) ) ;
public class JsApiHdrsImpl { /** * the same as setUserid ( ) */ @ Override public final void setApiUserId ( String value ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setApiUserId" , value ) ; setUserid ( value ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setApiUserId" ) ;