signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class InternalXbaseParser { /** * InternalXbase . g : 933:1 : entryRuleXCasePart : ruleXCasePart EOF ; */ public final void entryRuleXCasePart ( ) throws RecognitionException { } }
try { // InternalXbase . g : 934:1 : ( ruleXCasePart EOF ) // InternalXbase . g : 935:1 : ruleXCasePart EOF { if ( state . backtracking == 0 ) { before ( grammarAccess . getXCasePartRule ( ) ) ; } pushFollow ( FOLLOW_1 ) ; ruleXCasePart ( ) ; state . _fsp -- ; if ( state . failed ) return ; if ( state . backtracking == 0 ) { after ( grammarAccess . getXCasePartRule ( ) ) ; } match ( input , EOF , FOLLOW_2 ) ; if ( state . failed ) return ; } } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { } return ;
public class GVRGearCursorController { /** * Return the current handedness of the Gear Controller . * @ return returns whether the user is using the controller left or right handed . This function * returns < code > null < / code > if the controller is unavailable or the data is stale . */ @ SuppressWarnings ( "unused" ) public Handedness getHandedness ( ) { } }
if ( ( currentControllerEvent == null ) || currentControllerEvent . isRecycled ( ) ) { return null ; } return currentControllerEvent . handedness == 0.0f ? Handedness . LEFT : Handedness . RIGHT ;
public class MemoryStageController { /** * 处理异常termin结束 */ public synchronized void termin ( TerminType type ) { } }
// 构建termin信号 List < Long > processIds = new ArrayList < Long > ( progress . keySet ( ) ) ; Collections . sort ( processIds ) ; // 做一下排序 for ( Long processId : processIds ) { EtlEventData eventData = progress . get ( processId ) . getData ( ) ; TerminEventData data = new TerminEventData ( ) ; data . setPipelineId ( getPipelineId ( ) ) ; data . setType ( type ) ; data . setCode ( "channel" ) ; data . setDesc ( type . toString ( ) ) ; data . setProcessId ( processId ) ; if ( eventData != null ) { data . setBatchId ( eventData . getBatchId ( ) ) ; data . setCurrNid ( eventData . getCurrNid ( ) ) ; data . setStartTime ( eventData . getStartTime ( ) ) ; data . setEndTime ( eventData . getEndTime ( ) ) ; data . setFirstTime ( eventData . getFirstTime ( ) ) ; data . setNumber ( eventData . getNumber ( ) ) ; data . setSize ( eventData . getSize ( ) ) ; data . setExts ( eventData . getExts ( ) ) ; } offerTermin ( data ) ; progress . remove ( processId ) ; } // 重新初始化一下select调度 initSelect ( ) ;
public class OutputPanel { /** * Adds the xml description of the panels content to the StringBuilder . * Errors which occur during the xml transformation will be added to the * ConfigVerification . * @ param builder * Reference to a StringBuilder object * @ param errors * Reference to the ConfigVerification object */ @ Override public void toXML ( final StringBuilder builder , final ConfigVerification errors ) { } }
if ( ! controller . isEnableSQLDatabaseOutput ( ) ) { boolean zipComp = controller . isZipCompressionEnabled ( ) ; boolean multiFile = controller . isMultipleOutputFiles ( ) ; builder . append ( "\t<output>\r\n" ) ; builder . append ( "\t\t<OUTPUT_MODE>" ) ; OutputCompressionEnum comp = controller . getOutputCompression ( ) ; switch ( comp ) { case None : builder . append ( OutputType . UNCOMPRESSED ) ; break ; case BZip2 : builder . append ( OutputType . BZIP2 ) ; break ; case SevenZip : builder . append ( OutputType . SEVENZIP ) ; break ; default : throw new RuntimeException ( "Illegal Output Compression Mode" ) ; } builder . append ( "</OUTPUT_MODE>\r\n" ) ; String path = this . outputPathField . getText ( ) ; if ( path == null || path . equals ( "" ) ) { errors . add ( new ConfigItem ( ConfigItemTypes . WARNING , ConfigErrorKeys . MISSING_VALUE , "No output path has been set." ) ) ; } if ( ! path . endsWith ( File . separator ) && path . contains ( File . separator ) ) { path += File . separator ; } builder . append ( "\t\t<PATH>\"" + path + "\"</PATH>\r\n" ) ; if ( multiFile ) { long sizeLimit = - 1 ; String text = outputSizeLimitField . getText ( ) ; if ( text . length ( ) == 0 ) { errors . add ( new ConfigItem ( ConfigItemTypes . ERROR , ConfigErrorKeys . MISSING_VALUE , "The output limit is missing." ) ) ; } else { try { sizeLimit = Long . parseLong ( text ) ; if ( sizeLimit < 100 * 1024 * 1024 ) { errors . add ( new ConfigItem ( ConfigItemTypes . ERROR , ConfigErrorKeys . VALUE_OUT_OF_RANGE , "The output limit has to be at" + " least 100MB" ) ) ; } } catch ( NumberFormatException nfe ) { errors . add ( new ConfigItem ( ConfigItemTypes . ERROR , ConfigErrorKeys . ILLEGAL_INPUT , "NumberFormatException for the" + " output limit" ) ) ; } } switch ( comp ) { case None : builder . append ( "\t\t<LIMIT_SQL_FILE_SIZE>" + sizeLimit + "</LIMIT_SQL_FILE_SIZE>\r\n" ) ; break ; default : builder . append ( "\t\t<LIMIT_SQL_ARCHIVE_SIZE>" + sizeLimit + "</LIMIT_SQL_ARCHIVE_SIZE>\r\n" ) ; break ; } } builder . append ( "\t\t<MODE_ZIP_COMPRESSION_ENABLED>" + zipComp + "</MODE_ZIP_COMPRESSION_ENABLED>\r\n" ) ; if ( controller . isEnableDataFileOutput ( ) ) { builder . append ( "\t\t<MODE_DATAFILE_OUTPUT>true</MODE_DATAFILE_OUTPUT>\r\n" ) ; } else { builder . append ( "\t\t<MODE_DATAFILE_OUTPUT>false</MODE_DATAFILE_OUTPUT>\r\n" ) ; } builder . append ( "\t</output>\r\n" ) ; }
public class AbstractCRUDRestService { /** * { @ inheritDoc } */ @ Override public List < O > doGetObjects ( final Wave wave ) { } }
LOGGER . trace ( "Get Planets." ) ; final List < O > objects = baseWebTarget ( ) . request ( MediaType . APPLICATION_XML ) . get ( genericList ) ; return objects ;
public class ClassReader { /** * Make a package , given its unqualified name and enclosing package . */ public PackageSymbol enterPackage ( Name name , PackageSymbol owner ) { } }
return enterPackage ( TypeSymbol . formFullName ( name , owner ) ) ;
public class MediaHttpUploader { /** * { @ link Beta } < br / > * The call back method that will be invoked on a server error or an I / O exception during * resumable upload inside { @ link # upload } . * This method changes the current request to query the current status of the upload to find how * many bytes were successfully uploaded before the server error occurred . */ @ Beta void serverErrorCallback ( ) throws IOException { } }
Preconditions . checkNotNull ( currentRequest , "The current request should not be null" ) ; // Query the current status of the upload by issuing an empty PUT request on the upload URI . currentRequest . setContent ( new EmptyContent ( ) ) ; currentRequest . getHeaders ( ) . setContentRange ( "bytes */" + mediaContentLengthStr ) ;
public class GeomajasServiceImpl { /** * Return the { @ link Map } that is registered with the given application and map ID . * @ param applicationId * the application id . * @ param mapId * the map id . * @ return the map . */ @ Export public Map getMap ( String applicationId , String mapId ) { } }
HashMap < String , Map > application = maps . get ( applicationId ) ; if ( null == application ) { return null ; } return application . get ( mapId ) ;
public class BGZFBlockIndex { /** * Writes some statistics about each BGZF block index file given as an * argument . */ public static void main ( String [ ] args ) { } }
if ( args . length == 0 ) { System . out . println ( "Usage: BGZFBlockIndex [BGZF block indices...]\n\n" + "Writes a few statistics about each BGZF block index." ) ; return ; } for ( String arg : args ) { final File f = new File ( arg ) ; if ( f . isFile ( ) && f . canRead ( ) ) { try { System . err . printf ( "%s:\n" , f ) ; final BGZFBlockIndex bi = new BGZFBlockIndex ( f ) ; final long second = bi . secondBlock ( ) ; final long last = bi . lastBlock ( ) ; System . err . printf ( "\t%d blocks\n" + "\tfirst after 0 is at %#014x\n" + "\tlast is at %#014x\n" + "\tassociated BGZF file size %d\n" , bi . size ( ) - 1 , bi . secondBlock ( ) , bi . lastBlock ( ) , bi . fileSize ( ) ) ; } catch ( IOException e ) { System . err . printf ( "Failed to read %s!\n" , f ) ; e . printStackTrace ( ) ; } } else System . err . printf ( "%s does not look like a readable file!\n" , f ) ; }
public class Item { /** * Returns the value of the specified attribute in the current item as a * < code > ByteBuffer < / code > ; or null if the attribute either doesn ' t exist or * the attribute value is null . * @ throws IncompatibleTypeException * if the attribute value cannot be converted into a byte array * @ see # isNull ( String ) # isNull ( String ) to check if the attribute value is * null . * @ see # isPresent ( String ) # isPresent ( String ) to check if the attribute * value is present . */ public ByteBuffer getByteBuffer ( String attrName ) { } }
Object val = attributes . get ( attrName ) ; return toByteBuffer ( val ) ;
public class TextComponentPainter { /** * Paint the border . * @ param g DOCUMENT ME ! * @ param c DOCUMENT ME ! * @ param x DOCUMENT ME ! * @ param y DOCUMENT ME ! * @ param width DOCUMENT ME ! * @ param height DOCUMENT ME ! */ private void paintBorder ( Graphics2D g , JComponent c , int x , int y , int width , int height ) { } }
boolean useToolBarColors = isInToolBar ( c ) ; Shape s ; if ( focused ) { s = shapeGenerator . createRoundRectangle ( x - 2 , y - 2 , width + 3 , height + 3 , CornerSize . OUTER_FOCUS ) ; g . setPaint ( getFocusPaint ( s , FocusType . OUTER_FOCUS , useToolBarColors ) ) ; g . draw ( s ) ; s = shapeGenerator . createRoundRectangle ( x - 1 , y - 1 , width + 1 , height + 1 , CornerSize . INNER_FOCUS ) ; g . setPaint ( getFocusPaint ( s , FocusType . INNER_FOCUS , useToolBarColors ) ) ; g . draw ( s ) ; } if ( type != CommonControlState . DISABLED ) { s = shapeGenerator . createRoundRectangle ( x + 1 , x + 1 , width - 2 , height - 2 , CornerSize . BORDER ) ; internalShadow . fill ( g , s , false , true ) ; } s = shapeGenerator . createRoundRectangle ( x , y , width - 1 , height - 1 , CornerSize . BORDER ) ; g . setPaint ( getTextBorderPaint ( type , ! focused && useToolBarColors ) ) ; g . draw ( s ) ;
public class Signature { /** * Drop the specified number of first arguments from this signature . * @ param n number of arguments to drop * @ return a new signature */ public Signature dropFirst ( int n ) { } }
return new Signature ( methodType . dropParameterTypes ( 0 , n ) , Arrays . copyOfRange ( argNames , n , argNames . length ) ) ;
public class MockServletRequest { /** * Sets the requested path * @ param path the requested path */ public void setRequestPath ( String mapping , String path ) { } }
this . requestPath = path ; int paramStartIdx = requestPath . indexOf ( "?" ) ; if ( StringUtils . isEmpty ( mapping ) ) { if ( paramStartIdx != - 1 ) { this . servletPath = requestPath . substring ( 0 , paramStartIdx ) ; } else { this . servletPath = requestPath ; } } else { this . servletPath = PathNormalizer . asPath ( mapping ) ; String pathInfo = removeServletMappingFromPath ( path , mapping ) ; this . pathInfo = pathInfo ; } // Sets the request URI if ( paramStartIdx == - 1 ) { this . requestURI = requestPath ; } else { this . requestURI = requestPath . substring ( 0 , paramStartIdx ) ; } initParameters ( ) ;
public class Tuple7 { /** * Shallow tuple copy . * @ return A new Tuple with the same fields as this . */ @ Override @ SuppressWarnings ( "unchecked" ) public Tuple7 < T0 , T1 , T2 , T3 , T4 , T5 , T6 > copy ( ) { } }
return new Tuple7 < > ( this . f0 , this . f1 , this . f2 , this . f3 , this . f4 , this . f5 , this . f6 ) ;
public class LazyMultiLoaderWithInclude { /** * Loads the specified id . */ @ SuppressWarnings ( "unchecked" ) @ Override public < TResult > Lazy < TResult > load ( Class < TResult > clazz , String id ) { } }
Lazy < Map < String , TResult > > results = _session . lazyLoadInternal ( clazz , new String [ ] { id } , _includes . toArray ( new String [ 0 ] ) , null ) ; return new Lazy ( ( ) -> results . getValue ( ) . values ( ) . iterator ( ) . next ( ) ) ;
public class DatabasesInner { /** * Exports a database . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ param databaseName The name of the database . * @ param parameters The database export request parameters . * @ 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 ImportExportOperationResultInner object if successful . */ public ImportExportOperationResultInner export ( String resourceGroupName , String serverName , String databaseName , ImportExportDatabaseDefinition parameters ) { } }
return exportWithServiceResponseAsync ( resourceGroupName , serverName , databaseName , parameters ) . toBlocking ( ) . last ( ) . body ( ) ;
public class FilteredTreeModel { /** * Initialize this tree model */ private void init ( ) { } }
TreeNode delegateRoot = null ; if ( delegate != null ) { delegateRoot = ( TreeNode ) delegate . getRoot ( ) ; } thisToDelegate . clear ( ) ; delegateToThis . clear ( ) ; if ( delegateRoot == null ) { root = null ; return ; } root = createNode ( delegateRoot ) ;
public class ClassUtils { /** * < p > Checks if one { @ code Class } can be assigned to a variable of * another { @ code Class } . < / p > * < p > Unlike the { @ link Class # isAssignableFrom ( Class ) } method , * this method takes into account widenings of primitive classes and * { @ code null } s . < / p > * < p > Primitive widenings allow an int to be assigned to a long , float or * double . This method returns the correct result for these cases . < / p > * < p > { @ code Null } may be assigned to any reference type . This method * will return { @ code true } if { @ code null } is passed in and the * toClass is non - primitive . < / p > * < p > Specifically , this method tests whether the type represented by the * specified { @ code Class } parameter can be converted to the type * represented by this { @ code Class } object via an identity conversion * widening primitive or widening reference conversion . See * < em > < a href = " http : / / docs . oracle . com / javase / specs / " > The Java Language Specification < / a > < / em > , * sections 5.1.1 , 5.1.2 and 5.1.4 for details . < / p > * @ param cls the Class to check , may be null * @ param toClass the Class to try to assign into , returns false if null * @ param autoboxing whether to use implicit autoboxing / unboxing between primitives and wrappers * @ return { @ code true } if assignment possible */ public static boolean isAssignable ( Class < ? > cls , final Class < ? > toClass , final boolean autoboxing ) { } }
if ( toClass == null ) { return false ; } // have to check for null , as isAssignableFrom doesn ' t if ( cls == null ) { return ! toClass . isPrimitive ( ) ; } // autoboxing : if ( autoboxing ) { if ( cls . isPrimitive ( ) && ! toClass . isPrimitive ( ) ) { cls = primitiveToWrapper ( cls ) ; if ( cls == null ) { return false ; } } if ( toClass . isPrimitive ( ) && ! cls . isPrimitive ( ) ) { cls = wrapperToPrimitive ( cls ) ; if ( cls == null ) { return false ; } } } if ( cls . equals ( toClass ) ) { return true ; } if ( cls . isPrimitive ( ) ) { if ( ! toClass . isPrimitive ( ) ) { return false ; } if ( Integer . TYPE . equals ( cls ) ) { return Long . TYPE . equals ( toClass ) || Float . TYPE . equals ( toClass ) || Double . TYPE . equals ( toClass ) ; } if ( Long . TYPE . equals ( cls ) ) { return Float . TYPE . equals ( toClass ) || Double . TYPE . equals ( toClass ) ; } if ( Boolean . TYPE . equals ( cls ) ) { return false ; } if ( Double . TYPE . equals ( cls ) ) { return false ; } if ( Float . TYPE . equals ( cls ) ) { return Double . TYPE . equals ( toClass ) ; } if ( Character . TYPE . equals ( cls ) ) { return Integer . TYPE . equals ( toClass ) || Long . TYPE . equals ( toClass ) || Float . TYPE . equals ( toClass ) || Double . TYPE . equals ( toClass ) ; } if ( Short . TYPE . equals ( cls ) ) { return Integer . TYPE . equals ( toClass ) || Long . TYPE . equals ( toClass ) || Float . TYPE . equals ( toClass ) || Double . TYPE . equals ( toClass ) ; } if ( Byte . TYPE . equals ( cls ) ) { return Short . TYPE . equals ( toClass ) || Integer . TYPE . equals ( toClass ) || Long . TYPE . equals ( toClass ) || Float . TYPE . equals ( toClass ) || Double . TYPE . equals ( toClass ) ; } // should never get here return false ; } return toClass . isAssignableFrom ( cls ) ;
public class SOABaseProperties { /** * - - Subjects */ public void setSubjects ( Set < String > subjects ) { } }
Validate . notNull ( subjects ) ; if ( subjects . isEmpty ( ) ) { return ; } Validate . noNullElements ( subjects ) ; setProperty ( SOABaseProperty . SUBJECTS , ArrayUtils . toString ( encapsulateValues ( subjects ) ) ) ;
public class JSONUtils { /** * Creates a new MorphDynaBean from a JSONObject . The MorphDynaBean will have * all the properties of the original JSONObject with the most accurate type . * Values of properties are not copied . */ public static DynaBean newDynaBean ( JSONObject jsonObject , JsonConfig jsonConfig ) { } }
Map props = getProperties ( jsonObject ) ; for ( Iterator entries = props . entrySet ( ) . iterator ( ) ; entries . hasNext ( ) ; ) { Map . Entry entry = ( Map . Entry ) entries . next ( ) ; String key = ( String ) entry . getKey ( ) ; if ( ! JSONUtils . isJavaIdentifier ( key ) ) { String parsedKey = JSONUtils . convertToJavaIdentifier ( key , jsonConfig ) ; if ( parsedKey . compareTo ( key ) != 0 ) { props . put ( parsedKey , props . remove ( key ) ) ; } } } MorphDynaClass dynaClass = new MorphDynaClass ( props ) ; MorphDynaBean dynaBean = null ; try { dynaBean = ( MorphDynaBean ) dynaClass . newInstance ( ) ; dynaBean . setDynaBeanClass ( dynaClass ) ; } catch ( Exception e ) { throw new JSONException ( e ) ; } return dynaBean ;
public class Configuration { /** * Sets difference listener */ public Configuration withDifferenceListener ( DifferenceListener differenceListener ) { } }
return new Configuration ( tolerance , options , ignorePlaceholder , matchers , pathsToBeIgnored , differenceListener ) ;
public class EmojiManager { /** * Tests if a given String is an emoji . * @ param string the string to test * @ return true if the string is an emoji ' s unicode , false else */ public static boolean isEmoji ( String string ) { } }
if ( string == null ) return false ; EmojiParser . UnicodeCandidate unicodeCandidate = EmojiParser . getNextUnicodeCandidate ( string . toCharArray ( ) , 0 ) ; return unicodeCandidate != null && unicodeCandidate . getEmojiStartIndex ( ) == 0 && unicodeCandidate . getFitzpatrickEndIndex ( ) == string . length ( ) ;
public class StringBasedKeyValue { /** * Returns the { @ link String value } as an instance of the given { @ link Class type } . * @ param < T > { @ link Class type } used in the conversion of the { @ link String value } . * @ param type { @ link Class type } used in the conversion of the { @ link String value } . * @ return the { @ link String value } of this key / value data structure as an instance * of the given { @ link Class type } . * @ see # getConversionService ( ) * @ see # getValue ( ) * @ see java . lang . Class */ public < T > Optional < T > getValueAs ( Class < T > type ) { } }
return getValue ( ) . filter ( StringUtils :: hasText ) . map ( value -> getConversionService ( ) . convert ( value , type ) ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcWorkCalendar ( ) { } }
if ( ifcWorkCalendarEClass == null ) { ifcWorkCalendarEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 770 ) ; } return ifcWorkCalendarEClass ;
public class PdfPCell { /** * Sets the cell event for this cell . * @ param cellEvent the cell event */ public void setCellEvent ( PdfPCellEvent cellEvent ) { } }
if ( cellEvent == null ) this . cellEvent = null ; else if ( this . cellEvent == null ) this . cellEvent = cellEvent ; else if ( this . cellEvent instanceof PdfPCellEventForwarder ) ( ( PdfPCellEventForwarder ) this . cellEvent ) . addCellEvent ( cellEvent ) ; else { PdfPCellEventForwarder forward = new PdfPCellEventForwarder ( ) ; forward . addCellEvent ( this . cellEvent ) ; forward . addCellEvent ( cellEvent ) ; this . cellEvent = forward ; }
public class NetworkMonitor { /** * Returns MAC Address of WiFi Adapter < br > * Requires READ _ PHONE _ STATE , ACCESS _ NETWORK _ STATE and ACCESS _ WIFI _ STATE * permissions < br > * @ return String representing MAC Address of WiFi Adapter ; Empty String in * some cases such as No WiFi Adapter is installed or WiFi is turned * off . */ public String getWifiMacAddress ( ) { } }
WifiManager wifiMan = ( WifiManager ) context . getSystemService ( Context . WIFI_SERVICE ) ; if ( wifiMan != null ) { WifiInfo wifiInf = wifiMan . getConnectionInfo ( ) ; return wifiInf . getMacAddress ( ) ; } return "" ;
public class AttributeImpl { /** * set the read value * @ throws DevFailed */ @ Override public void updateValue ( final AttributeValue inValue ) throws DevFailed { } }
xlogger . entry ( getName ( ) ) ; // final Profiler profilerPeriod = new Profiler ( " read attribute " + name ) ; // profilerPeriod . start ( " in " ) ; if ( inValue == null ) { throw DevFailedUtils . newDevFailed ( ExceptionMessages . ATTR_VALUE_NOT_SET , name + " read value has not been updated" ) ; } try { // copy value readValue = ( AttributeValue ) inValue . clone ( ) ; } catch ( final CloneNotSupportedException e ) { throw DevFailedUtils . newDevFailed ( e ) ; } // update quality if necessary if ( readValue . getValue ( ) != null && ! readValue . getQuality ( ) . equals ( AttrQuality . ATTR_INVALID ) ) { updateQuality ( readValue ) ; } // profilerPeriod . start ( " clone " ) ; // profilerPeriod . stop ( ) . print ( ) ; try { if ( readValue . getValue ( ) != null ) { // profilerPeriod . start ( " checkUpdateErrors " ) ; checkUpdateErrors ( readValue ) ; // profilerPeriod . start ( " from2DArrayToArray " ) ; // get as array if necessary ( for image ) readValue . setValueWithoutDim ( ArrayUtils . from2DArrayToArray ( readValue . getValue ( ) ) ) ; // force conversion to check types // profilerPeriod . start ( " toAttributeValue5 " ) ; TangoIDLAttributeUtil . toAttributeValue5 ( this , readValue , null ) ; } else { throw DevFailedUtils . newDevFailed ( ExceptionMessages . ATTR_VALUE_NOT_SET , name + " read value has not been updated" ) ; } // profilerPeriod . start ( " updateDefaultWritePart " ) ; updateDefaultWritePart ( ) ; // profilerPeriod . stop ( ) . print ( ) ; } catch ( final DevFailed e ) { // readValue . setQuality ( AttrQuality . ATTR _ INVALID ) ; readValue . setXDim ( 0 ) ; readValue . setYDim ( 0 ) ; lastError = e ; throw e ; } xlogger . exit ( getName ( ) ) ;
public class PFMHeaderParser { /** * Samples are 1 or 3 samples / pixels , interleaved , IEEE 32 bit floating point values */ @ Override public PNMHeader parse ( ) throws IOException { } }
int width = 0 ; int height = 0 ; float maxSample = tupleType == TupleType . BLACKANDWHITE_WHITE_IS_ZERO ? 1 : 0 ; // PBM has no maxSample line List < String > comments = new ArrayList < String > ( ) ; while ( width == 0 || height == 0 || maxSample == 0 ) { String line = input . readLine ( ) ; if ( line == null ) { throw new IIOException ( "Unexpeced end of stream" ) ; } int commentStart = line . indexOf ( '#' ) ; if ( commentStart >= 0 ) { String comment = line . substring ( commentStart + 1 ) . trim ( ) ; if ( ! comment . isEmpty ( ) ) { comments . add ( comment ) ; } line = line . substring ( 0 , commentStart ) ; } line = line . trim ( ) ; if ( ! line . isEmpty ( ) ) { // We have tokens . . . String [ ] tokens = line . split ( "\\s" ) ; for ( String token : tokens ) { if ( width == 0 ) { width = Integer . parseInt ( token ) ; } else if ( height == 0 ) { height = Integer . parseInt ( token ) ; } else if ( maxSample == 0 ) { maxSample = Float . parseFloat ( token ) ; } else { throw new IIOException ( "Unknown PNM token: " + token ) ; } } } } return new PNMHeader ( fileType , tupleType , width , height , tupleType . getSamplesPerPixel ( ) , byteOrder ( maxSample ) , comments ) ;
public class PersistentExecutorImpl { /** * { @ inheritDoc } */ @ Override public boolean remove ( long taskId ) { } }
String owner = getOwner ( ) ; if ( owner == null ) return false ; TransactionController tranController = new TransactionController ( ) ; boolean result = false ; try { tranController . preInvoke ( ) ; result = taskStore . remove ( taskId , owner , true ) ; } catch ( Throwable x ) { tranController . setFailure ( x ) ; } finally { PersistentStoreException x = tranController . postInvoke ( PersistentStoreException . class ) ; // TODO proposed spec class if ( x != null ) throw x ; } return result ;
public class FaultRootCauseEntityMarshaller { /** * Marshall the given parameter object . */ public void marshall ( FaultRootCauseEntity faultRootCauseEntity , ProtocolMarshaller protocolMarshaller ) { } }
if ( faultRootCauseEntity == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( faultRootCauseEntity . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( faultRootCauseEntity . getExceptions ( ) , EXCEPTIONS_BINDING ) ; protocolMarshaller . marshall ( faultRootCauseEntity . getRemote ( ) , REMOTE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ClustersInner { /** * Gets the gateway settings for the specified cluster . * @ param resourceGroupName The name of the resource group . * @ param clusterName The name of the cluster . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < GatewaySettingsInner > getGatewaySettingsAsync ( String resourceGroupName , String clusterName , final ServiceCallback < GatewaySettingsInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( getGatewaySettingsWithServiceResponseAsync ( resourceGroupName , clusterName ) , serviceCallback ) ;
public class OracleNoSQLClient { /** * Initialize entity . * @ param key * the key * @ param entityMetadata * the entity metadata * @ return the object * @ throws InstantiationException * the instantiation exception * @ throws IllegalAccessException * the illegal access exception */ private Object initializeEntity ( Object key , EntityMetadata entityMetadata ) throws InstantiationException , IllegalAccessException { } }
Object entity = null ; entity = entityMetadata . getEntityClazz ( ) . newInstance ( ) ; if ( key != null ) { PropertyAccessorHelper . setId ( entity , entityMetadata , key ) ; } return entity ;
public class LocalDate { /** * Converts this LocalDate to a full datetime at midnight using the * specified time zone . * This method will throw an exception if the time zone switches * to Daylight Savings Time at midnight and this LocalDate represents * that switchover date . The problem is that there is no such time as * midnight on the required date , and as such an exception is thrown . * This method uses the chronology from this instance plus the time zone * specified . * This instance is immutable and unaffected by this method call . * @ param zone the zone to use , null means default zone * @ return this date as a datetime at midnight * @ deprecated Use { @ link # toDateTimeAtStartOfDay ( DateTimeZone ) } which won ' t throw an exception */ @ Deprecated public DateTime toDateTimeAtMidnight ( DateTimeZone zone ) { } }
zone = DateTimeUtils . getZone ( zone ) ; Chronology chrono = getChronology ( ) . withZone ( zone ) ; return new DateTime ( getYear ( ) , getMonthOfYear ( ) , getDayOfMonth ( ) , 0 , 0 , 0 , 0 , chrono ) ;
public class EbsConfiguration { /** * An array of Amazon EBS volume specifications attached to a cluster instance . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setEbsBlockDeviceConfigs ( java . util . Collection ) } or * { @ link # withEbsBlockDeviceConfigs ( java . util . Collection ) } if you want to override the existing values . * @ param ebsBlockDeviceConfigs * An array of Amazon EBS volume specifications attached to a cluster instance . * @ return Returns a reference to this object so that method calls can be chained together . */ public EbsConfiguration withEbsBlockDeviceConfigs ( EbsBlockDeviceConfig ... ebsBlockDeviceConfigs ) { } }
if ( this . ebsBlockDeviceConfigs == null ) { setEbsBlockDeviceConfigs ( new com . amazonaws . internal . SdkInternalList < EbsBlockDeviceConfig > ( ebsBlockDeviceConfigs . length ) ) ; } for ( EbsBlockDeviceConfig ele : ebsBlockDeviceConfigs ) { this . ebsBlockDeviceConfigs . add ( ele ) ; } return this ;
public class AppServiceEnvironmentsInner { /** * Move an App Service Environment to a different VNET . * Move an App Service Environment to a different VNET . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws DefaultErrorResponseException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the PagedList & lt ; SiteInner & gt ; object if successful . */ public PagedList < SiteInner > beginChangeVnetNext ( final String nextPageLink ) { } }
ServiceResponse < Page < SiteInner > > response = beginChangeVnetNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) ; return new PagedList < SiteInner > ( response . body ( ) ) { @ Override public Page < SiteInner > nextPage ( String nextPageLink ) { return beginChangeVnetNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) . body ( ) ; } } ;
public class SourceManager { /** * Method to add a subscriber to the source * Source manager will allocate a buffer when the source has * atleast one subscriber . * @ param handler The handler that is to be added as subscriber */ public void addSubscriber ( Handler handler ) { } }
String handlerId = CollectorManagerUtils . getHandlerId ( handler ) ; // temporary exception for audit Source / / must change later if ( source . getSourceName ( ) . trim ( ) . equals ( "audit" ) && subscribers . isEmpty ( ) ) { // First subscriber , assign a buffer . bufferMgr = new BufferManagerImpl ( BUFFER_SIZE , sourceId , false ) ; // Inform the source that a buffer is now available // and it can start sending events to this buffer . source . setBufferManager ( this . bufferMgr ) ; } subscribers . add ( handlerId ) ; /* * Inform the handler that this source / buffer / conduit is now available : * Synchronous Handler - Add handler as synchronous handler to the Buffer / Conduit ' s sync handler set * Asynchronous Handler - Add handler as asynchronous handler into the Buffer / Conduit */ if ( handler instanceof SynchronousHandler ) { bufferMgr . addSyncHandler ( ( SynchronousHandler ) handler ) ; } else { bufferMgr . addHandler ( handlerId ) ; }
public class Syntax { /** * Translate specification . * @ return null for errors . */ public Parser translate ( int k , int threadCount , Output output ) throws GenericException { } }
FABuilder builder ; long started ; PDA pda ; ParserTable parserTable ; Map < Integer , PrefixSet > firsts ; ScannerFactory scannerFactory ; IntBitSet usedTerminals ; IntBitSet usedSymbols ; int symbolCount ; StringArrayList symbolTable ; ConflictHandler handler ; ConflictResolver [ ] resolvers ; started = System . currentTimeMillis ( ) ; output . verbose ( "computing firsts" ) ; firsts = grammar . firsts ( k ) ; output . verbose ( "creating pda, " + threadCount + " threads" ) ; pda = PDA . create ( grammar , firsts , k , threadCount ) ; output . verbose ( "done: " + pda . size ( ) + " states, " + ( System . currentTimeMillis ( ) - started ) + " ms" ) ; symbolCount = Math . max ( grammar . getSymbolCount ( ) , whiteSymbols . last ( ) + 1 ) ; handler = new ConflictHandler ( grammar ) ; parserTable = pda . createTable ( symbolCount , handler ) ; parserTable . addWhitespace ( whiteSymbols ) ; symbolTable = grammar . getSymbolTable ( ) ; if ( output . listing != null ) { output . listing . println ( "\nSymbols:" ) ; output . listing . println ( symbolTable . toString ( ) ) ; output . listing . println ( "\nGrammar:" ) ; output . listing . println ( grammar . toString ( ) ) ; output . listing . println ( "\nFirst Sets:" ) ; for ( Map . Entry < Integer , PrefixSet > entry : firsts . entrySet ( ) ) { output . listing . println ( symbolTable . get ( entry . getKey ( ) ) + ":\t" + entry . getValue ( ) . toString ( symbolTable ) ) ; } output . listing . println ( "\nAutomaton:" ) ; pda . print ( output . listing ) ; } if ( output . statistics != null ) { output . statistics . println ( ) ; output . statistics . println ( "parser statistics" ) ; output . statistics . println ( " states: " + pda . size ( ) ) ; output . statistics . println ( " table: [symbols=" + parserTable . getSymbolCount ( ) + "][states=" + parserTable . getStateCount ( ) + "]" ) ; output . statistics . println ( " lr(1) conflicts: " + handler . resolvers ( ) ) ; pda . statistics ( output . statistics ) ; } resolvers = handler . report ( output , grammar ) ; // free memory before computing FA pda = null ; output . verbose ( "processing scanner section" ) ; usedTerminals = new IntBitSet ( ) ; grammar . getUsedTerminals ( usedTerminals ) ; usedTerminals . addAll ( whiteSymbols ) ; output . verbose ( "generating scanner" ) ; builder = FABuilder . run ( scannerRules , usedTerminals , symbolTable , output . verbose ) ; output . listing ( "inline symbols: " + builder . getInlines ( ) ) ; if ( priorities ) { output . verbose ( "use priorities" ) ; Modes . resolveScannerConflicts ( builder . getFA ( ) , scannerRules ) ; } scannerFactory = ScannerFactory . create ( builder . getFA ( ) , builder . getErrorState ( ) , parserTable , whiteSymbols , output . verbose , output . listing ) ; if ( output . statistics != null ) { output . statistics . println ( ) ; output . statistics . println ( "scanner statistics" ) ; output . statistics . println ( " fa states : " + builder . getFA ( ) . size ( ) ) ; output . statistics . println ( " table: char[" + scannerFactory . size ( ) + "]" ) ; } output . verbose ( "scanner done" ) ; usedSymbols = new IntBitSet ( whiteSymbols ) ; usedSymbols . addAll ( builder . getInlines ( ) ) ; grammar . check ( grammar . getStart ( ) , usedSymbols , symbolTable . toList ( ) ) ; return new Parser ( parserTable , resolvers , scannerFactory ) ;
public class Fresco { /** * Initializes Fresco with the default Drawee config . */ public static void initialize ( Context context , @ Nullable ImagePipelineConfig imagePipelineConfig ) { } }
initialize ( context , imagePipelineConfig , null ) ;
public class AbstractLoginServlet { /** * 设置跳转到登录页面时的 < code > state < / code > 参数 。 * 默认生成一串随机 { @ link UUID } , 并去掉 ' - ' 符号作为 < code > state < / code > 。 * @ see # checkOauth2LoginState ( HttpServletRequest , HttpServletResponse ) */ protected String setOauth2LoginState ( HttpServletRequest req , HttpServletResponse resp , String authzEndpoint ) { } }
String state = UUID . randomUUID ( ) . toString ( ) . replace ( "-" , "" ) ; req . getSession ( ) . setAttribute ( "oauth2_login_state" , state ) ; authzEndpoint = Urls . appendQueryString ( authzEndpoint , "state" , state ) ; return authzEndpoint ;
public class ResultLatch { /** * Await up to a maximum time for the result * @ param maxWait max wait time * @ param timeUnit time unit * @ return the result * @ throws Exception errors */ public ResultValue awaitResult ( long maxWait , TimeUnit timeUnit ) throws Exception { } }
if ( ! await ( maxWait , timeUnit ) ) { throw new TimeoutException ( ) ; } return getResultValue ( ) ;
public class LSSerializerImpl { /** * Serializes the specified node to the specified URI and returns true if the Node * was successfully serialized . * @ see org . w3c . dom . ls . LSSerializer # writeToURI ( org . w3c . dom . Node , String ) * @ since DOM Level 3 * @ param nodeArg The Node to serialize . * @ throws org . w3c . dom . ls . LSException SERIALIZE _ ERR : Raised if the * LSSerializer was unable to serialize the node . */ public boolean writeToURI ( Node nodeArg , String uri ) throws LSException { } }
// If nodeArg is null , return false . Should we throw and LSException instead ? if ( nodeArg == null ) { return false ; } // Obtain a reference to the serializer to use Serializer serializer = fXMLSerializer ; serializer . reset ( ) ; if ( nodeArg != fVisitedNode ) { // Determine the XML Document version of the Node String xmlVersion = getXMLVersion ( nodeArg ) ; // Determine the encoding : 1 . LSOutput . encoding , // 2 . Document . inputEncoding , 3 . Document . xmlEncoding . fEncoding = getInputEncoding ( nodeArg ) ; if ( fEncoding == null ) { fEncoding = fEncoding != null ? fEncoding : getXMLEncoding ( nodeArg ) == null ? "UTF-8" : getXMLEncoding ( nodeArg ) ; } serializer . getOutputFormat ( ) . setProperty ( "version" , xmlVersion ) ; // Set the output encoding and xml version properties fDOMConfigProperties . setProperty ( DOMConstants . S_XERCES_PROPERTIES_NS + DOMConstants . S_XML_VERSION , xmlVersion ) ; fDOMConfigProperties . setProperty ( DOMConstants . S_XSL_OUTPUT_ENCODING , fEncoding ) ; // If the node to be serialized is not a Document , Element , or Entity // node // then the XML declaration , or text declaration , should be never be // serialized . if ( ( nodeArg . getNodeType ( ) != Node . DOCUMENT_NODE || nodeArg . getNodeType ( ) != Node . ELEMENT_NODE || nodeArg . getNodeType ( ) != Node . ENTITY_NODE ) && ( ( fFeatures & XMLDECL ) != 0 ) ) { fDOMConfigProperties . setProperty ( DOMConstants . S_XSL_OUTPUT_OMIT_XML_DECL , DOMConstants . DOM3_DEFAULT_FALSE ) ; } fVisitedNode = nodeArg ; } // Update the serializer properties fXMLSerializer . setOutputFormat ( fDOMConfigProperties ) ; try { // If the specified encoding is not supported an // " unsupported - encoding " fatal error is raised . ? ? if ( uri == null ) { String msg = Utils . messages . createMessage ( MsgKey . ER_NO_OUTPUT_SPECIFIED , null ) ; if ( fDOMErrorHandler != null ) { fDOMErrorHandler . handleError ( new DOMErrorImpl ( DOMError . SEVERITY_FATAL_ERROR , msg , MsgKey . ER_NO_OUTPUT_SPECIFIED ) ) ; } throw new LSException ( LSException . SERIALIZE_ERR , msg ) ; } else { // REVISIT : Can this be used to get an absolute expanded URI String absoluteURI = SystemIDResolver . getAbsoluteURI ( uri ) ; URL url = new URL ( absoluteURI ) ; OutputStream urlOutStream = null ; String protocol = url . getProtocol ( ) ; String host = url . getHost ( ) ; // For file protocols , there is no need to use a URL to get its // corresponding OutputStream // Scheme names consist of a sequence of characters . The lower // case letters " a " - - " z " , digits , and the characters plus ( " + " ) , // period ( " . " ) , and hyphen ( " - " ) are allowed . For resiliency , // programs interpreting URLs should treat upper case letters as // equivalent to lower case in scheme names // ( e . g . , allow " HTTP " as well as " http " ) . if ( protocol . equalsIgnoreCase ( "file" ) && ( host == null || host . length ( ) == 0 || host . equals ( "localhost" ) ) ) { // do we also need to check for host . equals ( hostname ) urlOutStream = new FileOutputStream ( getPathWithoutEscapes ( url . getPath ( ) ) ) ; } else { // This should support URL ' s whose schemes are mentioned in // RFC1738 other than file URLConnection urlCon = url . openConnection ( ) ; urlCon . setDoInput ( false ) ; urlCon . setDoOutput ( true ) ; urlCon . setUseCaches ( false ) ; urlCon . setAllowUserInteraction ( false ) ; // When writing to a HTTP URI , a HTTP PUT is performed . if ( urlCon instanceof HttpURLConnection ) { HttpURLConnection httpCon = ( HttpURLConnection ) urlCon ; httpCon . setRequestMethod ( "PUT" ) ; } urlOutStream = urlCon . getOutputStream ( ) ; } // set the OutputStream to that obtained from the systemId serializer . setOutputStream ( urlOutStream ) ; } // Get a reference to the serializer then lets you serilize a DOM // Use this hack till Xalan support JAXP1.3 if ( fDOMSerializer == null ) { fDOMSerializer = ( DOM3Serializer ) serializer . asDOM3Serializer ( ) ; } // Set the error handler on the DOM3Serializer interface implementation if ( fDOMErrorHandler != null ) { fDOMSerializer . setErrorHandler ( fDOMErrorHandler ) ; } // Set the filter on the DOM3Serializer interface implementation if ( fSerializerFilter != null ) { fDOMSerializer . setNodeFilter ( fSerializerFilter ) ; } // Set the NewLine character to be used fDOMSerializer . setNewLine ( fEndOfLine . toCharArray ( ) ) ; // Serializer your DOM , where node is an org . w3c . dom . Node // Assuming that Xalan ' s serializer can serialize any type of DOM // node fDOMSerializer . serializeDOM3 ( nodeArg ) ; } catch ( LSException lse ) { // Rethrow LSException . throw lse ; } catch ( RuntimeException e ) { throw ( LSException ) createLSException ( LSException . SERIALIZE_ERR , e ) . fillInStackTrace ( ) ; } catch ( Exception e ) { if ( fDOMErrorHandler != null ) { fDOMErrorHandler . handleError ( new DOMErrorImpl ( DOMError . SEVERITY_FATAL_ERROR , e . getMessage ( ) , null , e ) ) ; } throw ( LSException ) createLSException ( LSException . SERIALIZE_ERR , e ) . fillInStackTrace ( ) ; } return true ;
public class Client { /** * Verifies a one - time password ( OTP ) value provided for a second factor when multi - factor authentication ( MFA ) is required for SAML authentication . * @ param appId * App ID of the app for which you want to generate a SAML token * @ param devideId * Provide the MFA device _ id you are submitting for verification . * @ param stateToken * Provide the state _ token associated with the MFA device _ id you are submitting for verification . * @ param otpToken * Provide the OTP value for the MFA factor you are submitting for verification . * @ return SAMLEndpointResponse * @ throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection * @ throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and throwOAuthProblemException is enabled * @ throws URISyntaxException - if there is an error when generating the target URL at the URIBuilder constructor * @ see com . onelogin . sdk . model . SAMLEndpointResponse * @ see < a target = " _ blank " href = " https : / / developers . onelogin . com / api - docs / 1 / saml - assertions / verify - factor " > Verify Factor documentation < / a > */ public SAMLEndpointResponse getSAMLAssertionVerifying ( String appId , String devideId , String stateToken , String otpToken ) throws OAuthSystemException , OAuthProblemException , URISyntaxException { } }
return getSAMLAssertionVerifying ( appId , devideId , stateToken , otpToken , null ) ;
public class WsocChain { /** * Initialize this chain manager : Channel and chain names shouldn ' t fluctuate as config changes , * so come up with names associated with this set of channels / chains that will be reused regardless * of start / stop / enable / disable / modify * @ param endpointId The id of the httpEndpoint * @ param cfw Channel framework */ public void init ( String chainId , ChannelFramework cfw ) { } }
tcpName = "TCP-" + chainId ; sslName = "SSL-" + chainId ; httpName = "HTTP-" + chainId ; chainName = chainId ; this . cfw = cfw ; // If there is a chain that is in the CFW with this name , it was potentially // left over from a previous instance of the endpoint . There is no way to get // the state of the existing ( old ) CFW chain to set our chainState accordingly . . . // ( in addition to the old chain pointing to old services and things . . ) // * IF * there is an old chain , stop , destroy , and remove it . try { ChainData cd = cfw . getChain ( chainName ) ; if ( cd != null ) { cfw . removeChain ( cd ) ; } } catch ( ChainException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Error stopping chain " + chainName , this , e ) ; } }
public class ConceptDrawProjectReader { /** * Read a task relationship . * @ param link ConceptDraw PROJECT task link */ private void readRelationship ( Link link ) { } }
Task sourceTask = m_taskIdMap . get ( link . getSourceTaskID ( ) ) ; Task destinationTask = m_taskIdMap . get ( link . getDestinationTaskID ( ) ) ; if ( sourceTask != null && destinationTask != null ) { Duration lag = getDuration ( link . getLagUnit ( ) , link . getLag ( ) ) ; RelationType type = link . getType ( ) ; Relation relation = destinationTask . addPredecessor ( sourceTask , type , lag ) ; relation . setUniqueID ( link . getID ( ) ) ; }
public class PagerRenderer { /** * Build an HTML anchor that contains URL state for navigating to the previous page of a data set . The * previous page is calculated relative to the current location in the { @ link PagerModel } * @ return the HTML markup for anchor to the previous page */ protected String buildLivePreviousLink ( ) { } }
InternalStringBuilder builder = new InternalStringBuilder ( ) ; AbstractRenderAppender appender = new StringBuilderRenderAppender ( builder ) ; buildAnchor ( appender , _gridModel . getUrlBuilder ( ) . getQueryParamsForPreviousPage ( ) , IDataGridMessageKeys . PAGER_MSG_PREVIOUS ) ; return builder . toString ( ) ;
public class StreamsUtils { /** * < p > Generates a stream composed of the N greatest different values of the provided stream , compared using the * provided comparator . If there are no duplicates in the provided stream , then the returned stream will have * N values , assuming that the input stream has more than N values . < / p > * < p > All the duplicates are removed in the returned stream , so in this case the number of elements in the * returned stream may be lesser than N . In this case , the total number of values is not guaranteed , and * may be lesser than N . < / p > * < p > Since this operator extract maxes according to the provided comparator , the result is sorted from the * greatest element to the smallest , thus in the decreasing order , according to the provided comparator . < / p > * < p > The provided implementation uses and insertion buffer of size N to keep the N maxes . * This implementation becomes less and less efficient as N grows . < / p > * < p > A < code > NullPointerException < / code > will be thrown if the provided stream or the comparator is null . < / p > * < p > An < code > IllegalArgumentException < / code > is thrown if N is lesser than 1 . < / p > * @ param stream the processed stream * @ param numberOfMaxes the number of different max values that should be returned . Note that the total number of * values returned may be larger if there are duplicates in the stream * @ param comparator the comparator used to compare the elements of the stream * @ param < E > the type of the provided stream * @ return the filtered stream */ public static < E > Stream < E > filteringMaxKeys ( Stream < E > stream , int numberOfMaxes , Comparator < ? super E > comparator ) { } }
Objects . requireNonNull ( stream ) ; Objects . requireNonNull ( comparator ) ; FilteringMaxKeysSpliterator < E > spliterator = FilteringMaxKeysSpliterator . of ( stream . spliterator ( ) , numberOfMaxes , comparator ) ; return StreamSupport . stream ( spliterator , stream . isParallel ( ) ) . onClose ( stream :: close ) ;
public class ClassGraph { /** * Dot prologue * @ throws IOException */ public void prologue ( ) throws IOException { } }
Options opt = optionProvider . getGlobalOptions ( ) ; OutputStream os ; if ( opt . outputFileName . equals ( "-" ) ) os = System . out ; else { // prepare output file . Use the output file name as a full path unless the output // directory is specified File file = new File ( opt . outputDirectory , opt . outputFileName ) ; // make sure the output directory are there , otherwise create them if ( file . getParentFile ( ) != null && ! file . getParentFile ( ) . exists ( ) ) file . getParentFile ( ) . mkdirs ( ) ; os = new FileOutputStream ( file ) ; } // print prologue w = new PrintWriter ( new OutputStreamWriter ( new BufferedOutputStream ( os ) , opt . outputEncoding ) ) ; w . println ( "#!/usr/local/bin/dot\n" + "#\n" + "# Class diagram \n" + "# Generated by UMLGraph version " + Version . VERSION + " (http://www.spinellis.gr/umlgraph/)\n" + "#\n\n" + "digraph G {\n" + linePrefix + "graph [fontnames=\"svg\"]\n" + linePrefix + "edge [fontname=\"" + opt . edgeFontName + "\",fontsize=" + fmt ( opt . edgeFontSize ) + ",labelfontname=\"" + opt . edgeFontName + "\",labelfontsize=" + fmt ( opt . edgeFontSize ) + ",color=\"" + opt . edgeColor + "\"];\n" + linePrefix + "node [fontname=\"" + opt . nodeFontName + "\",fontcolor=\"" + opt . nodeFontColor + "\",fontsize=" + fmt ( opt . nodeFontSize ) + ",shape=plaintext,margin=0,width=0,height=0];" ) ; w . println ( linePrefix + "nodesep=" + opt . nodeSep + ";" ) ; w . println ( linePrefix + "ranksep=" + opt . rankSep + ";" ) ; if ( opt . horizontal ) w . println ( linePrefix + "rankdir=LR;" ) ; if ( opt . bgColor != null ) w . println ( linePrefix + "bgcolor=\"" + opt . bgColor + "\";\n" ) ;
public class ICUResourceBundle { /** * will throw type mismatch exception if the resource is not a string */ public String getStringWithFallback ( String path ) throws MissingResourceException { } }
// Optimized form of getWithFallback ( path ) . getString ( ) ; ICUResourceBundle actualBundle = this ; String result = findStringWithFallback ( path , actualBundle , null ) ; if ( result == null ) { throw new MissingResourceException ( "Can't find resource for bundle " + this . getClass ( ) . getName ( ) + ", key " + getType ( ) , path , getKey ( ) ) ; } if ( result . equals ( NO_INHERITANCE_MARKER ) ) { throw new MissingResourceException ( "Encountered NO_INHERITANCE_MARKER" , path , getKey ( ) ) ; } return result ;
public class Call { /** * Factor method for Call list , returns a list of Call objects with page , size preference * @ param page the page * @ param size the page size * @ return the list * @ throws IOException unexpected error . */ public static ResourceList < Call > list ( final int page , final int size ) throws IOException { } }
return list ( BandwidthClient . getInstance ( ) , page , size ) ;
public class SerializerScopeProvider { /** * which is quite hard anyway . . . */ public IScope createFeatureCallSerializationScope ( EObject context ) { } }
if ( ! ( context instanceof XAbstractFeatureCall ) ) { return IScope . NULLSCOPE ; } XAbstractFeatureCall call = ( XAbstractFeatureCall ) context ; JvmIdentifiableElement feature = call . getFeature ( ) ; // this and super - logical container aware FeatureScopes if ( feature instanceof JvmType ) { return getTypeScope ( call , ( JvmType ) feature ) ; } if ( feature instanceof JvmConstructor ) { return getThisOrSuperScope ( call , ( JvmConstructor ) feature ) ; } if ( feature instanceof JvmExecutable ) { return getExecutableScope ( call , feature ) ; } if ( feature instanceof JvmFormalParameter || feature instanceof JvmField || feature instanceof XVariableDeclaration || feature instanceof XSwitchExpression ) { return new SingletonScope ( EObjectDescription . create ( feature . getSimpleName ( ) , feature ) , IScope . NULLSCOPE ) ; } return IScope . NULLSCOPE ;
public class Curve { /** * compute a Catmull - Rom spline , but with variable knot spacing . * @ param x the input parameter * @ param numKnots the number of knots in the spline * @ param xknots the array of knot x values * @ param yknots the array of knot y values * @ return the spline value */ public static float Spline ( float x , int numKnots , int [ ] xknots , int [ ] yknots ) { } }
int span ; int numSpans = numKnots - 3 ; float k0 , k1 , k2 , k3 ; float c0 , c1 , c2 , c3 ; if ( numSpans < 1 ) throw new IllegalArgumentException ( "Too few knots in spline" ) ; for ( span = 0 ; span < numSpans ; span ++ ) if ( xknots [ span + 1 ] > x ) break ; if ( span > numKnots - 3 ) span = numKnots - 3 ; float t = ( float ) ( x - xknots [ span ] ) / ( xknots [ span + 1 ] - xknots [ span ] ) ; span -- ; if ( span < 0 ) { span = 0 ; t = 0 ; } k0 = yknots [ span ] ; k1 = yknots [ span + 1 ] ; k2 = yknots [ span + 2 ] ; k3 = yknots [ span + 3 ] ; c3 = - 0.5f * k0 + 1.5f * k1 + - 1.5f * k2 + 0.5f * k3 ; c2 = 1f * k0 + - 2.5f * k1 + 2f * k2 + - 0.5f * k3 ; c1 = - 0.5f * k0 + 0f * k1 + 0.5f * k2 + 0f * k3 ; c0 = 0f * k0 + 1f * k1 + 0f * k2 + 0f * k3 ; return ( ( c3 * t + c2 ) * t + c1 ) * t + c0 ;
public class ObjectOutputStream { /** * Write String { @ code object } into the receiver . It is assumed the * String has not been dumped yet . Returns the handle for this object ( String ) which is dumped here . * Strings are saved encoded with { @ link DataInput modified UTF - 8 } . * @ param object * the string to dump . * @ return the handle assigned to the String being dumped * @ throws IOException * If an IO exception happened when writing the String . */ private int writeNewString ( String object , boolean unshared ) throws IOException { } }
long count = ModifiedUtf8 . countBytes ( object , false ) ; byte [ ] buffer ; int offset = 0 ; if ( count <= 0xffff ) { buffer = new byte [ 1 + SizeOf . SHORT + ( int ) count ] ; buffer [ offset ++ ] = TC_STRING ; Memory . pokeShort ( buffer , offset , ( short ) count , ByteOrder . BIG_ENDIAN ) ; offset += SizeOf . SHORT ; } else { buffer = new byte [ 1 + SizeOf . LONG + ( int ) count ] ; buffer [ offset ++ ] = TC_LONGSTRING ; Memory . pokeLong ( buffer , offset , count , ByteOrder . BIG_ENDIAN ) ; offset += SizeOf . LONG ; } ModifiedUtf8 . encode ( buffer , offset , object ) ; output . write ( buffer , 0 , buffer . length ) ; int handle = nextHandle ( ) ; if ( ! unshared ) { objectsWritten . put ( object , handle ) ; } return handle ;
public class ProtoFileParser { /** * Extensions */ @ Override public void exitExtensions ( final ExtensionsContext ctx ) { } }
final Integer extensionStart = Integer . decode ( ctx . fieldNumber ( ) . getText ( ) ) ; final ExtensionRangeEndContext extensionRangeEnd = ctx . extensionRangeEnd ( ) ; final Integer extensionEnd ; if ( extensionRangeEnd == null ) { extensionEnd = extensionStart ; } else { final FieldNumberContext fieldNumber = extensionRangeEnd . fieldNumber ( ) ; extensionEnd = fieldNumber == null ? MAX_FIELD_NUMBER : Integer . decode ( fieldNumber . getText ( ) ) ; } scopes . addExtensionRange ( extensionStart , extensionEnd , ctx ) ;
public class ZipOutputStream { /** * Closes the current ZIP entry and positions the stream for writing * the next entry . * @ exception ZipException if a ZIP format error has occurred * @ exception IOException if an I / O error has occurred */ public void closeEntry ( ) throws IOException { } }
ensureOpen ( ) ; if ( current != null ) { ZipEntry e = current . entry ; switch ( e . method ) { case DEFLATED : def . finish ( ) ; while ( ! def . finished ( ) ) { deflate ( ) ; } if ( ( e . flag & 8 ) == 0 ) { // verify size , compressed size , and crc - 32 settings if ( e . size != def . getBytesRead ( ) ) { throw new ZipException ( "invalid entry size (expected " + e . size + " but got " + def . getBytesRead ( ) + " bytes)" ) ; } if ( e . csize != def . getBytesWritten ( ) ) { throw new ZipException ( "invalid entry compressed size (expected " + e . csize + " but got " + def . getBytesWritten ( ) + " bytes)" ) ; } if ( e . crc != crc . getValue ( ) ) { throw new ZipException ( "invalid entry CRC-32 (expected 0x" + Long . toHexString ( e . crc ) + " but got 0x" + Long . toHexString ( crc . getValue ( ) ) + ")" ) ; } } else { e . size = def . getBytesRead ( ) ; e . csize = def . getBytesWritten ( ) ; e . crc = crc . getValue ( ) ; writeEXT ( e ) ; } def . reset ( ) ; written += e . csize ; break ; case STORED : // we already know that both e . size and e . csize are the same if ( e . size != written - locoff ) { throw new ZipException ( "invalid entry size (expected " + e . size + " but got " + ( written - locoff ) + " bytes)" ) ; } if ( e . crc != crc . getValue ( ) ) { throw new ZipException ( "invalid entry crc-32 (expected 0x" + Long . toHexString ( e . crc ) + " but got 0x" + Long . toHexString ( crc . getValue ( ) ) + ")" ) ; } break ; default : throw new ZipException ( "invalid compression method" ) ; } crc . reset ( ) ; current = null ; }
public class AbstractMultiCommand { /** * { @ inheritDoc } */ @ Override public final void ready ( ) throws CoreException { } }
synchronized ( this ) { this . subCommandList = defineSubCommand ( ) ; if ( this . subCommandList == null || this . subCommandList . isEmpty ( ) ) { throw new CoreRuntimeException ( "Warning, 'defineSubCommand' should return at least one Command Key." ) ; } for ( final UniqueKey < ? extends Command > commandKey : this . subCommandList ) { localFacade ( ) . retrieve ( commandKey ) ; } } initCommand ( ) ;
public class SearchTransitGatewayRoutesRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < SearchTransitGatewayRoutesRequest > getDryRunRequest ( ) { } }
Request < SearchTransitGatewayRoutesRequest > request = new SearchTransitGatewayRoutesRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class EmailIntentSender { /** * Finds the package name of the default email client supporting attachments * @ param resolveActivity the resolved activity * @ param initialIntents a list of intents to be used when * @ return package name of the default email client , or null if more than one app match */ @ Nullable private String getPackageName ( @ NonNull ComponentName resolveActivity , @ NonNull List < Intent > initialIntents ) { } }
String packageName = resolveActivity . getPackageName ( ) ; if ( packageName . equals ( "android" ) ) { // multiple activities support the intent and no default is set if ( initialIntents . size ( ) > 1 ) { packageName = null ; } else if ( initialIntents . size ( ) == 1 ) { // only one of them supports attachments , use that one packageName = initialIntents . get ( 0 ) . getPackage ( ) ; } } return packageName ;
public class SerDeserializers { /** * loads a single rename file */ private static List < String > loadRenameFile ( URL url ) throws IOException { } }
try ( BufferedReader reader = new BufferedReader ( new InputStreamReader ( url . openStream ( ) , UTF_8 ) ) ) { return reader . lines ( ) . filter ( line -> ! line . isEmpty ( ) && ! line . startsWith ( "#" ) ) . collect ( toList ( ) ) ; }
public class GuildManager { /** * Sets the Splash { @ link net . dv8tion . jda . core . entities . Icon Icon } of this { @ link net . dv8tion . jda . core . entities . Guild Guild } . * @ param splash * The new splash for this { @ link net . dv8tion . jda . core . entities . Guild Guild } * or { @ code null } to reset * @ throws IllegalArgumentException * If the guild ' s { @ link net . dv8tion . jda . core . entities . Guild # getFeatures ( ) features } does not include { @ code INVITE _ SPLASH } * @ return GuildManager for chaining convenience */ @ CheckReturnValue public GuildManager setSplash ( Icon splash ) { } }
Checks . check ( splash == null || getGuild ( ) . getFeatures ( ) . contains ( "INVITE_SPLASH" ) , "Cannot set a splash on this guild" ) ; this . splash = splash ; set |= SPLASH ; return this ;
public class AgentSession { /** * Query for metadata associated with a session id . * @ param sessionID the sessionID to query for . * @ return Map a map of all metadata associated with the sessionID . * @ throws XMPPException if an error occurs while getting information from the server . * @ throws NotConnectedException * @ throws InterruptedException */ public Map < String , List < String > > getChatMetadata ( String sessionID ) throws XMPPException , NotConnectedException , InterruptedException { } }
ChatMetadata request = new ChatMetadata ( ) ; request . setType ( IQ . Type . get ) ; request . setTo ( workgroupJID ) ; request . setSessionID ( sessionID ) ; ChatMetadata response = connection . createStanzaCollectorAndSend ( request ) . nextResult ( ) ; return response . getMetadata ( ) ;
public class LocationDirector { /** * Subscribe to the PlaceObject identified by _ placeId and * call { @ link # gotPlaceObject } with the result . */ protected void subscribeToPlace ( ) { } }
_subber = new SafeSubscriber < PlaceObject > ( _placeId , new Subscriber < PlaceObject > ( ) { public void objectAvailable ( PlaceObject object ) { gotPlaceObject ( object ) ; } public void requestFailed ( int oid , ObjectAccessException cause ) { // aiya ! we were unable to fetch our new place object ; something is badly wrong log . warning ( "Aiya! Unable to fetch place object for new location" , "plid" , oid , "reason" , cause ) ; // clear out our half initialized place info int placeId = _placeId ; _placeId = - 1 ; // let the kids know shit be fucked handleFailure ( placeId , "m.unable_to_fetch_place_object" ) ; } } ) ; _subber . subscribe ( _ctx . getDObjectManager ( ) ) ;
public class TextOrientationImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setBAxis ( Integer newBAxis ) { } }
Integer oldBAxis = bAxis ; bAxis = newBAxis ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . TEXT_ORIENTATION__BAXIS , oldBAxis , bAxis ) ) ;
public class ClassSourceImpl { /** * < p > Attempt to process a specified class . Answer whether processing was handed * successfully by the streamer via { @ link ClassSource _ Streamer # process ( String , InputStream , boolean , boolean , boolean ) } . < / p > * < p > A failure ( false ) result occurs the class is blocked by { @ link ClassSource _ Streamer # doProcess ( String , boolean , boolean , boolean ) } , * or if no resource is available for the class . A failure to open the resource results * in an exception . Certain processing failures also result in an exception . < / p > * < p > An exception thrown by the streamer indicates that the class was not successfully * handled by the streamer . < / p > * < p > A failure to close the stream for the class is handled locally . < / p > * @ param streamer The streamer which is to be used to process the named class . * @ param className The class which is to be processed . * @ param scanPolicy The scan policy of the class source of the named class . * @ return True if processing reaches the streamer . Otherwise , false . * @ throws ClassSource _ Exception Thrown in case of a processing failure . */ @ Trivial protected boolean scanClass ( ClassSource_Streamer streamer , String className , ScanPolicy scanPolicy ) throws ClassSource_Exception { } }
String methodName = "scanClass" ; Object [ ] logParms ; if ( tc . isEntryEnabled ( ) ) { logParms = new Object [ ] { getHashText ( ) , className } ; Tr . entry ( tc , methodName , MessageFormat . format ( "[ {0} ] Name [ {1} ]" , logParms ) ) ; } else { logParms = null ; } if ( ! streamer . doProcess ( className , scanPolicy ) ) { if ( logParms != null ) { Tr . exit ( tc , methodName , MessageFormat . format ( "[ {0} ] Return [ {1} ] [ false ]: Filtered by streamer" , logParms ) ) ; } return false ; } String resourceName = getResourceNameFromClassName ( className ) ; InputStream inputStream = openResourceStream ( className , resourceName ) ; // throws ClassSource _ Exception if ( inputStream == null ) { if ( logParms != null ) { Tr . exit ( tc , methodName , MessageFormat . format ( "[ {0} ] Return [ {1} ] [ false ]: No resource is available" , logParms ) ) ; } return false ; } try { streamer . process ( getCanonicalName ( ) , className , inputStream , scanPolicy ) ; } finally { closeResourceStream ( className , resourceName , inputStream ) ; } if ( logParms != null ) { Tr . exit ( tc , methodName , MessageFormat . format ( "[ {0} ] Return [ {1} ] [ true ]" , logParms ) ) ; } return true ;
public class ByteArrayObjectDataInput { /** * See the general contract of the { @ code readUTF } method of { @ code DataInput } . * Bytes for this operation are read from the contained input stream . * @ return a Unicode string . * @ throws java . io . EOFException if this input stream reaches the end before reading all the bytes * @ throws java . io . IOException if an I / O error occurs * @ throws java . io . UTFDataFormatException if the bytes do not represent a valid modified UTF - 8 encoding of a string * @ see java . io . DataInputStream # readUTF ( java . io . DataInput ) */ @ Override public final String readUTF ( ) throws IOException { } }
int charCount = readInt ( ) ; if ( charCount == NULL_ARRAY_LENGTH ) { return null ; } if ( charBuffer == null || charCount > charBuffer . length ) { charBuffer = new char [ charCount ] ; } byte b ; for ( int i = 0 ; i < charCount ; i ++ ) { b = readByte ( ) ; if ( b < 0 ) { charBuffer [ i ] = Bits . readUtf8Char ( this , b ) ; } else { charBuffer [ i ] = ( char ) b ; } } return new String ( charBuffer , 0 , charCount ) ;
public class SimonBeanUtils { /** * Set property in object target . If values has type other than String setter method or field * with specified type will be used to set value . If value has String type value will be converted * using available converters . If conversion to all of the types accepted by setters fails , field * with corresponding name will be used * @ param target Java bean where a property will be set * @ param property property to be set * @ param value value to be set */ public void setProperty ( Object target , String property , Object value ) { } }
NestedResolver resolver = new NestedResolver ( target , property ) ; if ( value instanceof String ) { convertStringValue ( resolver . getNestedTarget ( ) , resolver . getProperty ( ) , ( String ) value ) ; } else { setObjectValue ( resolver . getNestedTarget ( ) , resolver . getProperty ( ) , value ) ; }
public class KieMavenRepository { /** * Installs the kjar in the given kieModule into the local repository . * @ param releaseId The releaseId with which the kjar will be installed * @ param kieModule The kieModule containing the kjar to be installed * @ param pomfile The pom file to be installed together with the kjar */ public void installArtifact ( AFReleaseId releaseId , InternalKieModule kieModule , File pomfile ) { } }
File jarFile = bytesToFile ( releaseId , kieModule . getBytes ( ) , ".jar" ) ; installArtifact ( releaseId , jarFile , pomfile ) ;
public class WordNet { /** * Create caches of WordNet to speed up matching . * @ param componentKey a key to the component in the configuration * @ param properties configuration * @ throws SMatchException SMatchException */ public static void createWordNetCaches ( String componentKey , Properties properties ) throws SMatchException { } }
properties = getComponentProperties ( makeComponentPrefix ( componentKey , WordNet . class . getSimpleName ( ) ) , properties ) ; if ( properties . containsKey ( JWNL_PROPERTIES_PATH_KEY ) ) { // initialize JWNL ( this must be done before JWNL library can be used ) try { final String configPath = properties . getProperty ( JWNL_PROPERTIES_PATH_KEY ) ; log . info ( "Initializing JWNL from " + configPath ) ; boolean useInternalFiles = true ; if ( properties . containsKey ( USE_INTERNAL_FILES ) ) { useInternalFiles = Boolean . parseBoolean ( properties . getProperty ( USE_INTERNAL_FILES ) ) ; } if ( useInternalFiles == true ) { log . info ( "Using internal files." ) ; InputStream propertiesStream = Thread . currentThread ( ) . getContextClassLoader ( ) . getResource ( configPath ) . openStream ( ) ; String dictionaryPath = Thread . currentThread ( ) . getContextClassLoader ( ) . getResource ( "data" ) . toString ( ) ; dictionaryPath = dictionaryPath . replace ( "file:/" , "" ) ; dictionaryPath = "/" + dictionaryPath + "/" ; log . info ( "dictionaryPath: " + dictionaryPath ) ; String propertiesFromStream = getTextFromStream ( propertiesStream ) ; propertiesFromStream = propertiesFromStream . replace ( DEFAULT_FILE_DICTIONARY_PATH , dictionaryPath ) ; InputStream is = new ByteArrayInputStream ( propertiesFromStream . getBytes ( ) ) ; JWNL . initialize ( is ) ; } else { JWNL . initialize ( new FileInputStream ( configPath ) ) ; } log . info ( "Creating WordNet caches..." ) ; writeMultiwords ( properties ) ; log . info ( "Done" ) ; } catch ( JWNLException e ) { final String errMessage = e . getClass ( ) . getSimpleName ( ) + ": " + e . getMessage ( ) ; log . error ( errMessage , e ) ; throw new SMatchException ( errMessage , e ) ; } catch ( FileNotFoundException e ) { final String errMessage = e . getClass ( ) . getSimpleName ( ) + ": " + e . getMessage ( ) ; log . error ( errMessage , e ) ; throw new SMatchException ( errMessage , e ) ; } catch ( IOException ex ) { java . util . logging . Logger . getLogger ( WordNet . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } } else { final String errMessage = "Cannot find configuration key " + JWNL_PROPERTIES_PATH_KEY ; log . error ( errMessage ) ; throw new SMatchException ( errMessage ) ; }
public class AbstractGpxParserWpt { /** * Fires whenever an XML start markup is encountered . * @ param uri URI of the local element * @ param localName Name of the local element ( without prefix ) * @ param qName qName of the local element ( with prefix ) * @ param attributes Attributes of the local element ( contained in the * markup ) * @ throws SAXException Any SAX exception , possibly wrapping another * exception */ @ Override public void startElement ( String uri , String localName , String qName , Attributes attributes ) throws SAXException { } }
// Clear content buffer getContentBuffer ( ) . delete ( 0 , getContentBuffer ( ) . length ( ) ) ; // Store name of current element in stack getElementNames ( ) . push ( qName ) ;
public class AnalysisResults { /** * Get the IDs of the different searches that have been applied to solve the problem with the * given ID ( unmodifiable view ) . * @ param problemID ID of the problem * @ return IDs of different searches applied to solve the problem * @ throws UnknownIDException if an unknown problem ID is given */ public Set < String > getSearchIDs ( String problemID ) { } }
if ( ! results . containsKey ( problemID ) ) { throw new UnknownIDException ( "Unknown problem ID " + problemID + "." ) ; } return Collections . unmodifiableSet ( results . get ( problemID ) . keySet ( ) ) ;
public class DescribeVpcClassicLinkDnsSupportRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < DescribeVpcClassicLinkDnsSupportRequest > getDryRunRequest ( ) { } }
Request < DescribeVpcClassicLinkDnsSupportRequest > request = new DescribeVpcClassicLinkDnsSupportRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class QClassEqual { /** * { @ inheritDoc } */ @ Override public QClassEqual prepare ( final AbstractTypeQuery _query , final AbstractQPart _part ) throws EFapsException { } }
getAttribute ( ) . prepare ( _query , this ) ; for ( final QClassValue value : this . values ) { value . prepare ( _query , this ) ; } return this ;
public class ProjectTreeController { /** * Add columns to the tree . * @ param parentNode parent tree node * @ param table columns container */ private void addColumns ( MpxjTreeNode parentNode , Table table ) { } }
for ( Column column : table . getColumns ( ) ) { final Column c = column ; MpxjTreeNode childNode = new MpxjTreeNode ( column ) { @ Override public String toString ( ) { return c . getTitle ( ) ; } } ; parentNode . add ( childNode ) ; }
public class Reflect { /** * Determines if a field with the given name is associated with the class * @ param name The field name * @ return True if there is a field with the given name */ public boolean containsField ( String name ) { } }
if ( StringUtils . isNullOrBlank ( name ) ) { return false ; } return ClassDescriptorCache . getInstance ( ) . getClassDescriptor ( clazz ) . getFields ( accessAll ) . stream ( ) . anyMatch ( f -> f . getName ( ) . equals ( name ) ) ;
public class RuleHelper { /** * This method attempts to provide headers for the supplied target * object . * @ param type The target type * @ param target The target instance * @ return The header map */ public Map < String , String > getHeaders ( String type , Object target ) { } }
HeadersAccessor accessor = getHeadersAccessor ( type ) ; if ( accessor != null ) { Map < String , String > ret = accessor . getHeaders ( target ) ; return ret ; } return null ;
public class BufferFastAggregation { /** * Compute overall AND between bitmaps two - by - two . * This function runs in linear time with respect to the number of bitmaps . * @ param bitmaps input bitmaps * @ return aggregated bitmap */ public static MutableRoaringBitmap naive_and ( ImmutableRoaringBitmap ... bitmaps ) { } }
MutableRoaringBitmap answer ; if ( bitmaps . length > 0 ) { answer = ( bitmaps [ 0 ] ) . toMutableRoaringBitmap ( ) ; for ( int k = 1 ; k < bitmaps . length ; ++ k ) { answer = ImmutableRoaringBitmap . and ( answer , bitmaps [ k ] ) ; } } else { answer = new MutableRoaringBitmap ( ) ; } return answer ;
public class LogFactory { /** * 获得日志对象 * @ param name 日志对象名 * @ return 日志对象 */ public Log getLog ( String name ) { } }
Log log = logCache . get ( name ) ; if ( null == log ) { log = createLog ( name ) ; logCache . put ( name , log ) ; } return log ;
public class CalendarCodeGenerator { /** * Build a method to wrap a region in the regionFormat . */ private MethodSpec buildWrapTimeZoneRegionMethod ( TimeZoneData data ) { } }
MethodSpec . Builder method = MethodSpec . methodBuilder ( "wrapTimeZoneRegion" ) . addModifiers ( PROTECTED ) . addParameter ( StringBuilder . class , "b" ) . addParameter ( String . class , "region" ) ; List < Node > format = WRAPPER_PARSER . parseWrapper ( data . regionFormat ) ; for ( Node node : format ) { if ( node instanceof Text ) { Text text = ( Text ) node ; method . addStatement ( "b.append($S)" , text . text ( ) ) ; } else { method . addStatement ( "b.append(region)" ) ; } } return method . build ( ) ;
public class DataOutputEncoder { @ Override public void writeString ( String str ) throws IOException { } }
byte [ ] bytes = Utf8 . getBytesFor ( str ) ; writeBytes ( bytes , 0 , bytes . length ) ;
public class AbstractQueryFactory { /** * - - - - - protected methods - - - - - */ protected void checkOccur ( final T query , final Occurrence occ , final boolean first ) { } }
if ( ! first || occ . equals ( Occurrence . FORBIDDEN ) ) { addOccur ( query , occ , first ) ; }
public class Result { /** * Create a Result class with " OK " status and " Success " for details * This is the easiest to use * @ param value * @ param status * @ return */ public static < R > Result < R > ok ( R value ) { } }
return new Result < R > ( value , OK , SUCCESS , null ) ;
public class BuildContext { /** * This method associates a type definition to a path . These bindings are * checked as part of the validation process . Note that there can be more * than one binding per path . * @ param path * absolute path to bind to the type * @ param fullType * data type to use * @ param template * template where the binding was defined ( used for error * handling ) * @ param sourceRange * location in the template where the binding was defined ( used * for error handling ) */ public void setBinding ( Path path , FullType fullType , Template template , SourceRange sourceRange ) { } }
assert ( path != null ) ; assert ( path . isAbsolute ( ) ) ; assert ( fullType != null ) ; // Must make sure that all of the subtypes for the given type are // defined before adding the binding . try { fullType . verifySubtypesDefined ( types ) ; } catch ( EvaluationException ee ) { throw ee . addExceptionInfo ( sourceRange , template . source , this . getTraceback ( sourceRange ) ) ; } // Retrieve or create the list of bindings for this path . List < FullType > list = bindings . get ( path ) ; if ( list == null ) { list = new LinkedList < FullType > ( ) ; bindings . put ( path , list ) ; } // Add the binding . assert ( list != null ) ; list . add ( fullType ) ;
public class ExpandableDirectByteBuffer { public byte getByte ( final int index ) { } }
boundsCheck0 ( index , SIZE_OF_BYTE ) ; return UNSAFE . getByte ( null , address + index ) ;
public class PipelineBuilder { /** * Adds a instance of expression to the pipeline . * @ param mTransaction * Transaction to operate with . * @ param mSequenceType * sequence type the context item should match . */ public void addInstanceOfExpr ( final INodeReadTrx mTransaction , final SequenceType mSequenceType ) { } }
assert getPipeStack ( ) . size ( ) >= 1 ; final AbsAxis candidate = getPipeStack ( ) . pop ( ) . getExpr ( ) ; final AbsAxis axis = new InstanceOfExpr ( mTransaction , candidate , mSequenceType ) ; if ( getPipeStack ( ) . empty ( ) || getExpression ( ) . getSize ( ) != 0 ) { addExpressionSingle ( ) ; } getExpression ( ) . add ( axis ) ;
public class ArchetypeHelper { /** * This method should do a full Velocity macro processing . . . */ protected String removeInvalidHeaderCommentsAndProcessVelocityMacros ( String text ) { } }
String answer = "" ; String [ ] lines = text . split ( "\r?\n" ) ; for ( String line : lines ) { String l = line . trim ( ) ; // a bit of Velocity here if ( ! l . startsWith ( "##" ) && ! l . startsWith ( "#set(" ) ) { if ( line . contains ( "${D}" ) ) { line = line . replaceAll ( "\\$\\{D\\}" , "\\$" ) ; } answer = answer . concat ( line ) ; answer = answer . concat ( System . lineSeparator ( ) ) ; } } return answer ;
public class StopRelationalDatabaseRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( StopRelationalDatabaseRequest stopRelationalDatabaseRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( stopRelationalDatabaseRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( stopRelationalDatabaseRequest . getRelationalDatabaseName ( ) , RELATIONALDATABASENAME_BINDING ) ; protocolMarshaller . marshall ( stopRelationalDatabaseRequest . getRelationalDatabaseSnapshotName ( ) , RELATIONALDATABASESNAPSHOTNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ACLProperties { /** * Transform owner got from node ' s { @ link AccessControlList } * to tree like { @ link HierarchicalProperty } instance to use in PROPFIND response body * @ param node * @ return { @ link HierarchicalProperty } representation of node owner * @ throws RepositoryException */ public static HierarchicalProperty getOwner ( NodeImpl node ) throws RepositoryException { } }
HierarchicalProperty ownerProperty = new HierarchicalProperty ( PropertyConstants . OWNER ) ; HierarchicalProperty href = new HierarchicalProperty ( new QName ( "DAV:" , "href" ) ) ; href . setValue ( node . getACL ( ) . getOwner ( ) ) ; ownerProperty . addChild ( href ) ; return ownerProperty ;
public class InternalPureXbaseParser { /** * InternalPureXbase . g : 5910:1 : ruleJvmTypeReference returns [ EObject current = null ] : ( ( this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * ) | this _ XFunctionTypeRef _ 3 = ruleXFunctionTypeRef ) ; */ public final EObject ruleJvmTypeReference ( ) throws RecognitionException { } }
EObject current = null ; EObject this_JvmParameterizedTypeReference_0 = null ; EObject this_XFunctionTypeRef_3 = null ; enterRule ( ) ; try { // InternalPureXbase . g : 5916:2 : ( ( ( this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * ) | this _ XFunctionTypeRef _ 3 = ruleXFunctionTypeRef ) ) // InternalPureXbase . g : 5917:2 : ( ( this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * ) | this _ XFunctionTypeRef _ 3 = ruleXFunctionTypeRef ) { // InternalPureXbase . g : 5917:2 : ( ( this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * ) | this _ XFunctionTypeRef _ 3 = ruleXFunctionTypeRef ) int alt106 = 2 ; int LA106_0 = input . LA ( 1 ) ; if ( ( LA106_0 == RULE_ID ) ) { alt106 = 1 ; } else if ( ( LA106_0 == 15 || LA106_0 == 41 ) ) { alt106 = 2 ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return current ; } NoViableAltException nvae = new NoViableAltException ( "" , 106 , 0 , input ) ; throw nvae ; } switch ( alt106 ) { case 1 : // InternalPureXbase . g : 5918:3 : ( this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * ) { // InternalPureXbase . g : 5918:3 : ( this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * ) // InternalPureXbase . g : 5919:4 : this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getJvmTypeReferenceAccess ( ) . getJvmParameterizedTypeReferenceParserRuleCall_0_0 ( ) ) ; } pushFollow ( FOLLOW_65 ) ; this_JvmParameterizedTypeReference_0 = ruleJvmParameterizedTypeReference ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current = this_JvmParameterizedTypeReference_0 ; afterParserOrEnumRuleCall ( ) ; } // InternalPureXbase . g : 5927:4 : ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * loop105 : do { int alt105 = 2 ; int LA105_0 = input . LA ( 1 ) ; if ( ( LA105_0 == 61 ) ) { int LA105_2 = input . LA ( 2 ) ; if ( ( LA105_2 == 62 ) ) { int LA105_3 = input . LA ( 3 ) ; if ( ( synpred49_InternalPureXbase ( ) ) ) { alt105 = 1 ; } } } switch ( alt105 ) { case 1 : // InternalPureXbase . g : 5928:5 : ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) { // InternalPureXbase . g : 5934:5 : ( ( ) ruleArrayBrackets ) // InternalPureXbase . g : 5935:6 : ( ) ruleArrayBrackets { // InternalPureXbase . g : 5935:6 : ( ) // InternalPureXbase . g : 5936:7: { if ( state . backtracking == 0 ) { current = forceCreateModelElementAndSet ( grammarAccess . getJvmTypeReferenceAccess ( ) . getJvmGenericArrayTypeReferenceComponentTypeAction_0_1_0_0 ( ) , current ) ; } } if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getJvmTypeReferenceAccess ( ) . getArrayBracketsParserRuleCall_0_1_0_1 ( ) ) ; } pushFollow ( FOLLOW_65 ) ; ruleArrayBrackets ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { afterParserOrEnumRuleCall ( ) ; } } } break ; default : break loop105 ; } } while ( true ) ; } } break ; case 2 : // InternalPureXbase . g : 5953:3 : this _ XFunctionTypeRef _ 3 = ruleXFunctionTypeRef { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getJvmTypeReferenceAccess ( ) . getXFunctionTypeRefParserRuleCall_1 ( ) ) ; } pushFollow ( FOLLOW_2 ) ; this_XFunctionTypeRef_3 = ruleXFunctionTypeRef ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current = this_XFunctionTypeRef_3 ; afterParserOrEnumRuleCall ( ) ; } } break ; } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
public class RequestContext { /** * Gets the request json object with the specified request . * @ param request the specified request * @ param response the specified response , sets its content type with " application / json " * @ return a json object */ private static JSONObject parseRequestJSONObject ( final HttpServletRequest request , final HttpServletResponse response ) { } }
response . setContentType ( "application/json" ) ; try { BufferedReader reader ; try { reader = request . getReader ( ) ; } catch ( final IllegalStateException illegalStateException ) { reader = new BufferedReader ( new InputStreamReader ( request . getInputStream ( ) ) ) ; } String tmp = IOUtils . toString ( reader ) ; if ( StringUtils . isBlank ( tmp ) ) { tmp = "{}" ; } else { if ( StringUtils . startsWithIgnoreCase ( tmp , "%7B%22" ) ) { tmp = URLs . decode ( tmp ) ; } } return new JSONObject ( tmp ) ; } catch ( final Exception e ) { LOGGER . log ( Level . ERROR , "Parses request JSON object failed [" + e . getMessage ( ) + "], returns an empty json object" ) ; return new JSONObject ( ) ; }
public class WebSiteManagementClientImpl { /** * Get a list of available geographical regions . * Get a list of available geographical regions . * ServiceResponse < PageImpl < GeoRegionInner > > * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the PagedList & lt ; GeoRegionInner & gt ; object wrapped in { @ link ServiceResponse } if successful . */ public Observable < ServiceResponse < Page < GeoRegionInner > > > listGeoRegionsNextSinglePageAsync ( final String nextPageLink ) { } }
if ( nextPageLink == null ) { throw new IllegalArgumentException ( "Parameter nextPageLink is required and cannot be null." ) ; } String nextUrl = String . format ( "%s" , nextPageLink ) ; return service . listGeoRegionsNext ( nextUrl , this . acceptLanguage ( ) , this . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < Page < GeoRegionInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < GeoRegionInner > > > call ( Response < ResponseBody > response ) { try { ServiceResponse < PageImpl < GeoRegionInner > > result = listGeoRegionsNextDelegate ( response ) ; return Observable . just ( new ServiceResponse < Page < GeoRegionInner > > ( result . body ( ) , result . response ( ) ) ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class MybatisAuditingHandler { /** * Setter to inject a { @ code AuditorAware } component to retrieve the current auditor . * @ param auditorAware must not be { @ literal null } . */ public void setAuditorAware ( AuditorAware < ? > auditorAware ) { } }
Assert . notNull ( auditorAware , "AuditorAware must not be null!" ) ; this . auditorAware = Optional . of ( auditorAware ) ;
public class TokenList { /** * Removes elements from begin to end from the list , inclusive . Returns a new list which * is composed of the removed elements */ public TokenList extractSubList ( Token begin , Token end ) { } }
if ( begin == end ) { remove ( begin ) ; return new TokenList ( begin , begin ) ; } else { if ( first == begin ) { first = end . next ; } if ( last == end ) { last = begin . previous ; } if ( begin . previous != null ) { begin . previous . next = end . next ; } if ( end . next != null ) { end . next . previous = begin . previous ; } begin . previous = null ; end . next = null ; TokenList ret = new TokenList ( begin , end ) ; size -= ret . size ( ) ; return ret ; }
public class SyntaxDE { /** * < @ internal @ brief contains the value of the DE in human readable format */ private void initData ( String x , int minsize , int maxsize ) { } }
content = null ; setContent ( x , minsize , maxsize ) ;
public class SEDProcessor { /** * Finds and returns the start of the given sequence after trimming * whitespace characters from the left . * @ param s * the character sequence * @ return the index containing the first non - whitespace character , or the * length of the character sequence if all characters are blank */ private static int findStartTrimWhitespace ( CharSequence s ) { } }
final int len = s . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { if ( ! Character . isWhitespace ( s . charAt ( i ) ) ) { return i ; } } return len ;
public class PresentationManager { /** * Generate a warn entry on the local logger * @ param o Object to log */ public void warn ( Object o ) { } }
if ( o instanceof Throwable ) { logger . warn ( o , ( Throwable ) o ) ; } else { logger . warn ( o ) ; }
public class ImageHeaderReaderAbstract { /** * ImageHeaderReader */ @ Override public boolean is ( Media media ) { } }
Check . notNull ( media ) ; for ( final HeaderProvider provider : providers ) { try ( InputStream input = media . getInputStream ( ) ) { if ( checkHeader ( input , provider . getHeader ( ) ) ) { return true ; } } catch ( final IOException exception ) { Verbose . exception ( exception ) ; } } return false ;
public class ApiOvhMe { /** * Validate your U2F account * REST : POST / me / accessRestriction / u2f / { id } / validate * @ param registrationData [ required ] * @ param clientData [ required ] * @ param id [ required ] The Id of the restriction */ public void accessRestriction_u2f_id_validate_POST ( Long id , String clientData , String registrationData ) throws IOException { } }
String qPath = "/me/accessRestriction/u2f/{id}/validate" ; StringBuilder sb = path ( qPath , id ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "clientData" , clientData ) ; addBody ( o , "registrationData" , registrationData ) ; exec ( qPath , "POST" , sb . toString ( ) , o ) ;
public class Config { /** * Create broken config for DbKit . brokenConfig = Config . createBrokenConfig ( ) ; */ static Config createBrokenConfig ( ) { } }
Config ret = new Config ( ) ; ret . dialect = new MysqlDialect ( ) ; ret . showSql = false ; ret . devMode = false ; ret . transactionLevel = DbKit . DEFAULT_TRANSACTION_LEVEL ; ret . containerFactory = IContainerFactory . defaultContainerFactory ; ret . cache = new EhCache ( ) ; return ret ;
public class Actions { /** * Moves the mouse to the middle of the element . The element is scrolled into view and its * location is calculated using getBoundingClientRect . * @ param target element to move to . * @ return A self reference . */ public Actions moveToElement ( WebElement target ) { } }
if ( isBuildingActions ( ) ) { action . addAction ( new MoveMouseAction ( jsonMouse , ( Locatable ) target ) ) ; } return moveInTicks ( target , 0 , 0 ) ;
public class AuthActivity { /** * Create an intent which can be sent to this activity to start OAuth 2 authentication . * @ param context the source context * @ param appKey the consumer key for the app * @ param desiredUid Encourage user to authenticate account defined by this uid . * ( note that user still can authenticate other accounts ) . * May be null if no uid desired . * @ param alreadyAuthedUids Array of any other uids currently authenticated with this app . * May be null if no uids previously authenticated . * Authentication screen will encourage user to not authorize these * user accounts . ( note that user may still authorize the accounts ) . * @ param sessionId The SESSION _ ID Extra on an OpenWith intent . null if dAuth * is being launched outside of OpenWith flow * @ param webHost the host to use for web authentication , or null for the default * @ param apiType an identifier for the type of API being supported , or null for * the default * @ return a newly created intent . */ public static Intent makeIntent ( Context context , String appKey , String desiredUid , String [ ] alreadyAuthedUids , String sessionId , String webHost , String apiType ) { } }
if ( appKey == null ) throw new IllegalArgumentException ( "'appKey' can't be null" ) ; setAuthParams ( appKey , desiredUid , alreadyAuthedUids , sessionId , webHost , apiType ) ; return new Intent ( context , AuthActivity . class ) ;
public class Normalizer { /** * Normalizes double and ambiguous quotes according to language and corpus . * @ param sentence * the list of tokens * @ param lang * the language */ public static void normalizeDoubleQuotes ( final List < Token > sentence , final String lang ) { } }
boolean isLeft = true ; for ( int i = 0 ; i < sentence . size ( ) ; i ++ ) { if ( lang . equalsIgnoreCase ( "en" ) ) { final Matcher doubleAsciiQuoteMatcher = doubleAsciiQuote . matcher ( sentence . get ( i ) . getTokenValue ( ) ) ; final Matcher singleAsciiQuoteMatcher = singleAsciiQuote . matcher ( sentence . get ( i ) . getTokenValue ( ) ) ; // if current token is " if ( doubleAsciiQuoteMatcher . find ( ) ) { if ( isLeft && i < sentence . size ( ) - 1 && doubleAsciiQuoteAlphaNumeric . matcher ( sentence . get ( i + 1 ) . getTokenValue ( ) ) . find ( ) ) { sentence . get ( i ) . setTokenValue ( "``" ) ; isLeft = false ; } else if ( ! isLeft ) { sentence . get ( i ) . setTokenValue ( "''" ) ; isLeft = true ; } } else if ( singleAsciiQuoteMatcher . find ( ) ) { if ( i < sentence . size ( ) - 2 && sentence . get ( i + 1 ) . getTokenValue ( ) . matches ( "[A-Za-z]" ) && sentence . get ( i + 2 ) . getTokenValue ( ) . matches ( "[^ \t\n\r\u00A0\u00B6]" ) ) { sentence . get ( i ) . setTokenValue ( "`" ) ; } } } }