signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class TextClockSkin { /** * * * * * * Initialization * * * * * */ @ Override protected void initGraphics ( ) { } }
// Set initial size if ( Double . compare ( clock . getPrefWidth ( ) , 0.0 ) <= 0 || Double . compare ( clock . getPrefHeight ( ) , 0.0 ) <= 0 || Double . compare ( clock . getWidth ( ) , 0.0 ) <= 0 || Double . compare ( clock . getHeight ( ) , 0.0 ) <= 0 ) { if ( clock . getPrefWidth ( ) > 0 && clock . getPrefHeight ( ) > 0 ) { clock . setPrefSize ( clock . getPrefWidth ( ) , clock . getPrefHeight ( ) ) ; } else { clock . setPrefSize ( PREFERRED_WIDTH , PREFERRED_HEIGHT ) ; } } timeText = new Text ( ) ; timeText . setTextOrigin ( VPos . CENTER ) ; timeText . setFill ( textColor ) ; dateText = new Text ( ) ; dateText . setTextOrigin ( VPos . CENTER ) ; dateText . setFill ( dateColor ) ; pane = new Pane ( timeText , dateText ) ; pane . setBorder ( new Border ( new BorderStroke ( clock . getBorderPaint ( ) , BorderStrokeStyle . SOLID , CornerRadii . EMPTY , new BorderWidths ( clock . getBorderWidth ( ) ) ) ) ) ; pane . setBackground ( new Background ( new BackgroundFill ( clock . getBackgroundPaint ( ) , CornerRadii . EMPTY , Insets . EMPTY ) ) ) ; getChildren ( ) . setAll ( pane ) ;
public class Usage { /** * < pre > * The full resource name of a channel used for sending notifications to the * service producer . * Google Service Management currently only supports * [ Google Cloud Pub / Sub ] ( https : / / cloud . google . com / pubsub ) as a notification * channel . To use Google Cloud Pub / Sub as the channel , this must be the name * of a Cloud Pub / Sub topic that uses the Cloud Pub / Sub topic name format * documented in https : / / cloud . google . com / pubsub / docs / overview . * < / pre > * < code > string producer _ notification _ channel = 7 ; < / code > */ public java . lang . String getProducerNotificationChannel ( ) { } }
java . lang . Object ref = producerNotificationChannel_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; producerNotificationChannel_ = s ; return s ; }
public class SimpleDOReader { /** * { @ inheritDoc } */ @ Override public String [ ] getObjectHistory ( String PID ) { } }
String [ ] dsIDs = ListDatastreamIDs ( null ) ; TreeSet < String > modDates = new TreeSet < String > ( ) ; for ( String element : dsIDs ) { Date [ ] dsDates = getDatastreamVersions ( element ) ; for ( Date element2 : dsDates ) { modDates . add ( DateUtility . convertDateToString ( element2 ) ) ; } } return modDates . toArray ( EMPTY_STRING_ARRAY ) ;
public class Util { /** * Fills the provided buffer it with bytes from the * provided channel . The amount of data to read is * dependant on the available space in the provided * buffer . * @ param in the channel to read from * @ param buffer the buffer to read into * @ return the provided buffer * @ throws IOException if an IO error occurs */ public static ByteBuffer fill ( ReadableByteChannel in , ByteBuffer buffer ) throws IOException { } }
while ( buffer . hasRemaining ( ) ) if ( in . read ( buffer ) == - 1 ) throw new BufferUnderflowException ( ) ; buffer . flip ( ) ; return buffer ;
public class Promises { /** * Repeats the operations of provided { @ code supplier } infinitely , * until one of the { @ code Promise } s completes exceptionally . */ @ NotNull public static Promise < Void > repeat ( @ NotNull Supplier < Promise < Void > > supplier ) { } }
return Promise . ofCallback ( cb -> repeatImpl ( supplier , cb ) ) ;
public class ABITrace { /** * Fetch the basecalls from the trace data . */ private void setBasecalls ( ) { } }
baseCalls = new int [ seqLength ] ; byte [ ] qq = new byte [ seqLength * 2 ] ; getSubArray ( qq , PLOC ) ; DataInputStream dis = new DataInputStream ( new ByteArrayInputStream ( qq ) ) ; for ( int i = 0 ; i <= seqLength - 1 ; ++ i ) { try { baseCalls [ i ] = ( int ) dis . readShort ( ) ; } catch ( IOException e ) // This shouldn ' t happen . If it does something must be seriously wrong . { throw new IllegalStateException ( "Unexpected IOException encountered while manipulating internal streams." ) ; } }
public class ErrorCollector { /** * Create { @ link DeploymentException } with message concatenated from collected exceptions . * @ return comprehensive exception . */ public DeploymentException composeComprehensiveException ( ) { } }
StringBuilder sb = new StringBuilder ( ) ; for ( Exception exception : exceptionsToPublish ) { sb . append ( exception . getMessage ( ) ) ; sb . append ( "\n" ) ; } return new DeploymentException ( sb . toString ( ) ) ;
public class DefaultNexusIQClient { /** * Get report links for a given application . * @ param application nexus application * @ return a list of report links */ @ Override public List < LibraryPolicyReport > getApplicationReport ( NexusIQApplication application ) { } }
List < LibraryPolicyReport > applicationReports = new ArrayList < > ( ) ; String appReportLinkUrl = String . format ( application . getInstanceUrl ( ) + API_V2_REPORTS_LINKS , application . getApplicationId ( ) ) ; try { JSONArray reports = parseAsArray ( appReportLinkUrl ) ; if ( ( reports == null ) || ( reports . isEmpty ( ) ) ) return null ; for ( Object element : reports ) { LibraryPolicyReport appReport = new LibraryPolicyReport ( ) ; String stage = str ( ( JSONObject ) element , "stage" ) ; appReport . setStage ( stage ) ; appReport . setEvaluationDate ( timestamp ( ( JSONObject ) element , "evaluationDate" ) ) ; appReport . setReportDataUrl ( application . getInstanceUrl ( ) + "/" + str ( ( JSONObject ) element , "reportDataUrl" ) ) ; appReport . setReportUIUrl ( application . getInstanceUrl ( ) + "/" + str ( ( JSONObject ) element , "reportHtmlUrl" ) ) ; applicationReports . add ( appReport ) ; } } catch ( ParseException e ) { LOG . error ( "Could not parse response from: " + appReportLinkUrl , e ) ; } catch ( RestClientException rce ) { LOG . error ( "RestClientException: " + appReportLinkUrl + ". Error code=" + rce . getMessage ( ) ) ; } return applicationReports ;
public class UidFactory { /** * serverId ( 16位 ) - sec ( 32位 ) - seq ( 16位 ) * @ param serverId 支持65535个服务器 * @ return */ public static long getId ( int serverId ) { } }
synchronized ( seq ) { long second = System . currentTimeMillis ( ) / 1000 ; System . out . println ( "second:" + second ) ; int inc = seq . incrementAndGet ( ) ; System . out . println ( "inc:" + inc ) ; return ( ( long ) ( serverId & 0xFFFF ) ) << 48 | ( ( second & 0x00000000FFFFFFFF ) << 16 ) | ( inc & 0x0000FFFF ) ; }
public class PtoPOutputHandler { /** * This method checks to see if rollback is required * @ param transaction The transaction to rollback . */ protected void handleRollback ( LocalTransaction transaction ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "handleRollback" , transaction ) ; // Roll back the transaction if we created it . if ( transaction != null ) { try { transaction . rollback ( ) ; } catch ( SIException e ) { // FFDC FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.PtoPOutputHandler.handleRollback" , "1:1644:1.241" , this ) ; SibTr . exception ( tc , e ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "handleRollback" ) ;
public class ns_configtemplate { /** * < pre > * Converts API response of bulk operation into object and returns the object array in case of get request . * < / pre > */ protected base_resource [ ] get_nitro_bulk_response ( nitro_service service , String response ) throws Exception { } }
ns_configtemplate_responses result = ( ns_configtemplate_responses ) service . get_payload_formatter ( ) . string_to_resource ( ns_configtemplate_responses . class , response ) ; if ( result . errorcode != 0 ) { if ( result . errorcode == SESSION_NOT_EXISTS ) service . clear_session ( ) ; throw new nitro_exception ( result . message , result . errorcode , ( base_response [ ] ) result . ns_configtemplate_response_array ) ; } ns_configtemplate [ ] result_ns_configtemplate = new ns_configtemplate [ result . ns_configtemplate_response_array . length ] ; for ( int i = 0 ; i < result . ns_configtemplate_response_array . length ; i ++ ) { result_ns_configtemplate [ i ] = result . ns_configtemplate_response_array [ i ] . ns_configtemplate [ 0 ] ; } return result_ns_configtemplate ;
public class CmsEntityObserver { /** * Calls an entity change listener , catching any errors . < p > * @ param entity the entity with which the change listener should be called * @ param listener the change listener */ protected void safeExecuteChangeListener ( CmsEntity entity , I_CmsEntityChangeListener listener ) { } }
try { listener . onEntityChange ( entity ) ; } catch ( Exception e ) { String stack = CmsClientStringUtil . getStackTrace ( e , "<br />" ) ; CmsDebugLog . getInstance ( ) . printLine ( "<br />" + e . getMessage ( ) + "<br />" + stack ) ; }
public class AuthenticationGuard { /** * Obtains a reentrant lock for the given authentication data . * @ param authenticationData * @ return the reentrant lock assigned to the given authentication data . */ public synchronized ReentrantLock requestAccess ( AuthenticationData authenticationData ) { } }
ReentrantLock currentLock = null ; currentLock = authenticationDataLocks . get ( authenticationData ) ; if ( currentLock == null ) { currentLock = new ReentrantLock ( ) ; authenticationDataLocks . put ( authenticationData , currentLock ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "The size of the authenticationDataLocks is " , authenticationDataLocks . size ( ) ) ; } return currentLock ;
public class hqlParser { /** * hql . g : 491:1 : betweenList : concatenation AND ! concatenation ; */ public final hqlParser . betweenList_return betweenList ( ) throws RecognitionException { } }
hqlParser . betweenList_return retval = new hqlParser . betweenList_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; Token AND182 = null ; ParserRuleReturnScope concatenation181 = null ; ParserRuleReturnScope concatenation183 = null ; CommonTree AND182_tree = null ; try { // hql . g : 492:2 : ( concatenation AND ! concatenation ) // hql . g : 492:4 : concatenation AND ! concatenation { root_0 = ( CommonTree ) adaptor . nil ( ) ; pushFollow ( FOLLOW_concatenation_in_betweenList2265 ) ; concatenation181 = concatenation ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , concatenation181 . getTree ( ) ) ; AND182 = ( Token ) match ( input , AND , FOLLOW_AND_in_betweenList2267 ) ; pushFollow ( FOLLOW_concatenation_in_betweenList2270 ) ; concatenation183 = concatenation ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , concatenation183 . getTree ( ) ) ; } retval . stop = input . LT ( - 1 ) ; retval . tree = ( CommonTree ) adaptor . rulePostProcessing ( root_0 ) ; adaptor . setTokenBoundaries ( retval . tree , retval . start , retval . stop ) ; } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; retval . tree = ( CommonTree ) adaptor . errorNode ( input , retval . start , input . LT ( - 1 ) , re ) ; } finally { // do for sure before leaving } return retval ;
public class ISO8601Utils { /** * Check if the expected character exist at the given offset in the value . * @ param value the string to check at the specified offset * @ param offset the offset to look for the expected character * @ param expected the expected character * @ return true if the expected character exist at the given offset */ private static boolean checkOffset ( String value , int offset , char expected ) { } }
return ( offset < value . length ( ) ) && ( value . charAt ( offset ) == expected ) ;
public class WriteBuffer { /** * Resets the write buffer to a particular point . */ public void truncate ( final long position ) { } }
final int index = index ( position ) ; final int offset = offset ( position ) ; final Block block = blocks . get ( index ) ; this . index = index ; block . limit = offset ; current = block ;
public class StreamAppenderatorDriver { /** * Persist all data indexed through this driver so far . Blocks until complete . * Should be called after all data has been added through { @ link # add ( InputRow , String , Supplier , boolean , boolean ) } . * @ param committer committer representing all data that has been added so far * @ return commitMetadata persisted */ public Object persist ( final Committer committer ) throws InterruptedException { } }
try { log . info ( "Persisting data." ) ; final long start = System . currentTimeMillis ( ) ; final Object commitMetadata = appenderator . persistAll ( wrapCommitter ( committer ) ) . get ( ) ; log . info ( "Persisted pending data in %,dms." , System . currentTimeMillis ( ) - start ) ; return commitMetadata ; } catch ( InterruptedException e ) { throw e ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
public class Animation { /** * Create a copy of this animation . Note that the frames * are not duplicated but shared with the original * @ return A copy of this animation */ public Animation copy ( ) { } }
Animation copy = new Animation ( ) ; copy . spriteSheet = spriteSheet ; copy . frames = frames ; copy . autoUpdate = autoUpdate ; copy . direction = direction ; copy . loop = loop ; copy . pingPong = pingPong ; copy . speed = speed ; return copy ;
public class DefaultRallyClient { /** * Helper method to find the remaining days */ public int getRemainingDays ( String startDate , String endDate , Date currentDate ) throws java . text . ParseException { } }
DateFormat dateFormat = new SimpleDateFormat ( "yyyy-MM-dd" ) ; Calendar iterationEndDate = Calendar . getInstance ( ) ; iterationEndDate . setTime ( dateFormat . parse ( endDate ) ) ; Calendar iterationStartDate = Calendar . getInstance ( ) ; iterationStartDate . setTime ( dateFormat . parse ( startDate ) ) ; Calendar currentCalendarDate = Calendar . getInstance ( ) ; currentCalendarDate . setTime ( currentDate ) ; int remainingDays = 0 ; if ( ( iterationStartDate . compareTo ( currentCalendarDate ) == 1 ) || ( iterationEndDate . compareTo ( currentCalendarDate ) == - 1 ) ) { return remainingDays ; } while ( iterationEndDate . compareTo ( currentCalendarDate ) == 1 ) { if ( ( currentCalendarDate . get ( Calendar . DAY_OF_WEEK ) != Calendar . SATURDAY ) && ( currentCalendarDate . get ( Calendar . DAY_OF_WEEK ) != Calendar . SUNDAY ) ) { ++ remainingDays ; } currentCalendarDate . add ( Calendar . DAY_OF_MONTH , 1 ) ; } return remainingDays ;
public class Utils { /** * Logs an exception with the given logger and the given level . * Writing a stack trace may be time - consuming in some environments . * To prevent useless computing , this method checks the current log level * before trying to log anything . * @ param logger the logger * @ param t an exception or a throwable * @ param logLevel the log level ( see { @ link Level } ) * @ param message a message to insert before the stack trace */ public static void logException ( Logger logger , Level logLevel , Throwable t , String message ) { } }
if ( logger . isLoggable ( logLevel ) ) { StringBuilder sb = new StringBuilder ( ) ; if ( message != null ) { sb . append ( message ) ; sb . append ( "\n" ) ; } sb . append ( writeExceptionButDoNotUseItForLogging ( t ) ) ; logger . log ( logLevel , sb . toString ( ) ) ; }
public class ImageUtils { /** * 扭曲图片 * @ param srcBmp * @ param bXDir * @ return */ public static BufferedImage twistImage ( BufferedImage srcBmp , int width , int height , boolean bXDir ) { } }
double dMultValue = getRandomDouble ( 1 , 3 ) ; double dPhase = getRandomDouble ( 0 , PI2 ) ; if ( width > srcBmp . getWidth ( ) ) width = srcBmp . getWidth ( ) ; if ( height > srcBmp . getHeight ( ) ) height = srcBmp . getHeight ( ) ; BufferedImage destBmp = new BufferedImage ( width , height , BufferedImage . TYPE_INT_RGB ) ; Graphics g = destBmp . getGraphics ( ) ; // 设定背景色 g . setColor ( Color . white ) ; g . fillRect ( 0 , 0 , width , height ) ; // 画边框 g . setColor ( Color . black ) ; g . drawRect ( 0 , 0 , width - 1 , height - 1 ) ; g . dispose ( ) ; double dBaseAxisLen = bXDir ? ( double ) height : ( double ) width ; for ( int i = 1 ; i < width - 1 ; i ++ ) { for ( int j = 1 ; j < height - 1 ; j ++ ) { double dx = 0 ; dx = bXDir ? ( PI2 * ( double ) j ) / dBaseAxisLen : ( PI2 * ( double ) i ) / dBaseAxisLen ; dx += dPhase ; double dy = Math . sin ( dx ) ; // 取得当前点的颜色 int nOldX = 0 , nOldY = 0 ; nOldX = bXDir ? i + ( int ) ( dy * dMultValue ) : i ; nOldY = bXDir ? j : j + ( int ) ( dy * dMultValue ) ; int color = srcBmp . getRGB ( i , j ) ; if ( nOldX >= 1 && nOldX < width - 1 && nOldY >= 1 && nOldY < height - 1 ) { destBmp . setRGB ( nOldX , nOldY , color ) ; } } } return destBmp ;
public class JsonParser { /** * Parse a JSON Array from the given JSON parser ( which is closed after parsing completes ) into * the given destination collection . * @ param destinationCollectionClass class of destination collection ( must have a public default * constructor ) * @ param destinationItemClass class of destination collection item ( must have a public default * constructor ) * @ since 1.15 */ public final < T > Collection < T > parseArrayAndClose ( Class < ? > destinationCollectionClass , Class < T > destinationItemClass ) throws IOException { } }
return parseArrayAndClose ( destinationCollectionClass , destinationItemClass , null ) ;
public class ThreadSafety { /** * Gets the possibly inherited marker annotation on the given symbol , and reverse - propagates * containerOf spec ' s from super - classes . */ public AnnotationInfo getInheritedAnnotation ( Symbol sym , VisitorState state ) { } }
return getAnnotation ( sym , markerAnnotations , state ) ;
public class SplunkAppender { /** * Create appender . * @ param name the name * @ param appenderRef the appender ref * @ param config the config * @ return the appender */ @ PluginFactory public static SplunkAppender build ( @ PluginAttribute ( "name" ) final String name , @ PluginElement ( "AppenderRef" ) final AppenderRef appenderRef , @ PluginConfiguration final Configuration config ) { } }
return new SplunkAppender ( name , config , appenderRef ) ;
public class HttpConnection { /** * 初始化http或https请求参数 < br > * 有些时候htts请求会出现com . sun . net . ssl . internal . www . protocol . https . HttpsURLConnectionOldImpl的实现 , 此为sun内部api , 按照普通http请求处理 * @ param hostnameVerifier 域名验证器 , 非https传入null * @ param ssf SSLSocketFactory , 非https传入null * @ return { @ link HttpURLConnection } , https返回 { @ link HttpsURLConnection } */ private HttpURLConnection openHttp ( ) throws IOException { } }
final URLConnection conn = openConnection ( ) ; if ( false == conn instanceof HttpURLConnection ) { // 防止其它协议造成的转换异常 throw new HttpException ( "'{}' is not a http connection, make sure URL is format for http." , conn . getClass ( ) . getName ( ) ) ; } return ( HttpURLConnection ) conn ;
public class DefaultExamSystem { /** * Creates a fresh ExamSystem . Your options will be combined with internal defaults . If you need * to change the system after it has been created , you fork ( ) it . Forking will not add default * options again . * @ param options * options to be used to define the new system . * @ return a fresh instance of { @ literal DefaultExamSystem } * @ throws IOException * in case of an instantiation problem . ( IO related ) */ public static ExamSystem create ( Option [ ] options ) throws IOException { } }
LOG . info ( "Pax Exam System (Version: " + Info . getPaxExamVersion ( ) + ") created." ) ; return new DefaultExamSystem ( options ) ;
public class LineageInfo { /** * Load all lineage information from { @ link State } s of a dataset * @ param states All states which belong to the same dataset * @ return A collection of { @ link LineageEventBuilder } s put in the state */ public static Collection < LineageEventBuilder > load ( Collection < ? extends State > states ) { } }
Preconditions . checkArgument ( states != null && ! states . isEmpty ( ) ) ; Set < LineageEventBuilder > allEvents = Sets . newHashSet ( ) ; for ( State state : states ) { Map < String , Set < LineageEventBuilder > > branchedEvents = load ( state ) ; branchedEvents . values ( ) . forEach ( allEvents :: addAll ) ; } return allEvents ;
public class MessageMD5ChecksumHandler { /** * Throw an exception if the MD5 checksums returned in the SendMessageBatchResult do not match * the client - side calculation based on the original messages in the SendMessageBatchRequest . */ private static void sendMessageBatchOperationMd5Check ( SendMessageBatchRequest sendMessageBatchRequest , SendMessageBatchResult sendMessageBatchResult ) { } }
Map < String , SendMessageBatchRequestEntry > idToRequestEntryMap = new HashMap < String , SendMessageBatchRequestEntry > ( ) ; if ( sendMessageBatchRequest . getEntries ( ) != null ) { for ( SendMessageBatchRequestEntry entry : sendMessageBatchRequest . getEntries ( ) ) { idToRequestEntryMap . put ( entry . getId ( ) , entry ) ; } } if ( sendMessageBatchResult . getSuccessful ( ) != null ) { for ( SendMessageBatchResultEntry entry : sendMessageBatchResult . getSuccessful ( ) ) { String messageBody = idToRequestEntryMap . get ( entry . getId ( ) ) . getMessageBody ( ) ; String bodyMd5Returned = entry . getMD5OfMessageBody ( ) ; String clientSideBodyMd5 = calculateMessageBodyMd5 ( messageBody ) ; if ( ! clientSideBodyMd5 . equals ( bodyMd5Returned ) ) { throw new AmazonClientException ( String . format ( MD5_MISMATCH_ERROR_MESSAGE_WITH_ID , MESSAGE_BODY , entry . getId ( ) , clientSideBodyMd5 , bodyMd5Returned ) ) ; } Map < String , MessageAttributeValue > messageAttr = idToRequestEntryMap . get ( entry . getId ( ) ) . getMessageAttributes ( ) ; if ( messageAttr != null && ! messageAttr . isEmpty ( ) ) { String attrMd5Returned = entry . getMD5OfMessageAttributes ( ) ; String clientSideAttrMd5 = calculateMessageAttributesMd5 ( messageAttr ) ; if ( ! clientSideAttrMd5 . equals ( attrMd5Returned ) ) { throw new AmazonClientException ( String . format ( MD5_MISMATCH_ERROR_MESSAGE_WITH_ID , MESSAGE_ATTRIBUTES , entry . getId ( ) , clientSideAttrMd5 , attrMd5Returned ) ) ; } } } }
public class BatchEditLineHandler { /** * / * ( non - Javadoc ) * @ see org . jboss . as . cli . handlers . CommandHandlerWithHelp # doHandle ( org . jboss . as . cli . CommandContext ) */ @ Override protected void doHandle ( CommandContext ctx ) throws CommandFormatException { } }
BatchManager batchManager = ctx . getBatchManager ( ) ; if ( ! batchManager . isBatchActive ( ) ) { throw new CommandFormatException ( "No active batch." ) ; } Batch batch = batchManager . getActiveBatch ( ) ; final int batchSize = batch . size ( ) ; if ( batchSize == 0 ) { throw new CommandFormatException ( "The batch is empty." ) ; } String argsStr = ctx . getArgumentsString ( ) ; if ( argsStr == null ) { throw new CommandFormatException ( "Missing line number." ) ; } int i = 0 ; while ( i < argsStr . length ( ) ) { if ( Character . isWhitespace ( argsStr . charAt ( i ) ) ) { break ; } ++ i ; } if ( i == argsStr . length ( ) ) { throw new CommandFormatException ( "Missing the new command line after the index." ) ; } String intStr = argsStr . substring ( 0 , i ) ; int lineNumber ; try { lineNumber = Integer . parseInt ( intStr ) ; } catch ( NumberFormatException e ) { throw new CommandFormatException ( "Failed to parse line number '" + intStr + "': " + e . getLocalizedMessage ( ) ) ; } if ( lineNumber < 1 || lineNumber > batchSize ) { throw new CommandFormatException ( lineNumber + " isn't in range [1.." + batchSize + "]." ) ; } String editedLine = argsStr . substring ( i ) . trim ( ) ; if ( editedLine . length ( ) == 0 ) { throw new CommandFormatException ( "Missing the new command line after the index." ) ; } if ( editedLine . charAt ( 0 ) == '"' ) { if ( editedLine . length ( ) > 1 && editedLine . charAt ( editedLine . length ( ) - 1 ) == '"' ) { editedLine = editedLine . substring ( 1 , editedLine . length ( ) - 1 ) ; } } BatchedCommand newCmd = ctx . toBatchedCommand ( editedLine ) ; batch . set ( lineNumber - 1 , newCmd ) ; ctx . printLine ( "#" + lineNumber + " " + newCmd . getCommand ( ) ) ;
public class AbstractConverterSet { /** * - - - UTILITY METHODS - - - */ protected static final UUID byteArrayToUUID ( byte [ ] from ) { } }
ByteBuffer b12 ; if ( from . length != 16 ) { b12 = ByteBuffer . wrap ( Arrays . copyOf ( from , 16 ) ) ; } else { b12 = ByteBuffer . wrap ( from ) ; } long msb = b12 . getLong ( ) ; long lsb = b12 . getLong ( ) ; return new UUID ( msb , lsb ) ;
public class PropertyBuilder { /** * Build the comments for the property . Do nothing if * { @ link Configuration # nocomment } is set to true . * @ param node the XML element that specifies which components to document * @ param propertyDocTree the content tree to which the documentation will be added */ public void buildPropertyComments ( XMLNode node , Content propertyDocTree ) { } }
if ( ! configuration . nocomment ) { writer . addComments ( currentProperty , propertyDocTree ) ; }
public class CompressFilterSettings { /** * Enable or disable Deflate compression . This only has an effect if * { @ link # isResponseCompressionEnabled ( ) } is < code > true < / code > * @ param bResponseDeflateEnabled * < code > true < / code > to enable it , < code > false < / code > to disable it * @ return { @ link EChange } */ @ Nonnull public static EChange setResponseDeflateEnabled ( final boolean bResponseDeflateEnabled ) { } }
return s_aRWLock . writeLocked ( ( ) -> { if ( s_bResponseDeflateEnabled == bResponseDeflateEnabled ) return EChange . UNCHANGED ; s_bResponseDeflateEnabled = bResponseDeflateEnabled ; LOGGER . info ( "CompressFilter responseDeflateEnabled=" + bResponseDeflateEnabled ) ; return EChange . CHANGED ; } ) ;
public class CommonOps_DDRM { /** * This computes the trace of the matrix : < br > * < br > * trace = & sum ; < sub > i = 1 : n < / sub > { a < sub > ii < / sub > } < br > * where n = min ( numRows , numCols ) * @ param a A square matrix . Not modified . */ public static double trace ( DMatrix1Row a ) { } }
int N = Math . min ( a . numRows , a . numCols ) ; double sum = 0 ; int index = 0 ; for ( int i = 0 ; i < N ; i ++ ) { sum += a . get ( index ) ; index += 1 + a . numCols ; } return sum ;
public class Targeting { /** * Gets the customTargeting value for this Targeting . * @ return customTargeting * Specifies the collection of custom criteria that is targeted * by the * { @ link LineItem } . * Once the { @ link LineItem } is updated or modified with * custom targeting , the * server may return a normalized , but equivalent representation * of the custom * targeting expression . * { @ code customTargeting } will have up to three levels * of expressions * including itself . * The top level { @ code CustomCriteriaSet } i . e . the { @ code * customTargeting } * object can only contain a { @ link CustomCriteriaSet . LogicalOperator # OR } * of * all its children . * The second level of { @ code CustomCriteriaSet } objects * can only contain * { @ link CustomCriteriaSet . LogicalOperator # AND } of all * their children . If * a { @ link CustomCriteria } is placed on this level , * the server will wrap it * in a { @ link CustomCriteriaSet } . * The third level can only comprise of { @ link CustomCriteria } * objects . * The resulting custom targeting tree would be of the * form : * < br / > * < img src = " https : / / chart . apis . google . com / chart ? cht = gv & chl = digraph { customTargeting _ LogicalOperator _ OR - % 3ECustomCriteriaSet _ LogicalOperator _ AND _ 1 - % 3ECustomCriteria _ 1 ; CustomCriteriaSet _ LogicalOperator _ AND _ 1 - % 3Eellipsis1 ; customTargeting _ LogicalOperator _ OR - % 3Eellipsis2 ; ellipsis1 [ label = % 22 . . . % 22 , shape = none , fontsize = 32 ] ; ellipsis2 [ label = % 22 . . . % 22 , shape = none , fontsize = 32 ] } & chs = 450x200 " / > */ public com . google . api . ads . admanager . axis . v201811 . CustomCriteriaSet getCustomTargeting ( ) { } }
return customTargeting ;
public class MutableInterval { /** * Sets the period of this time interval , preserving the start instant * and using the ISOChronology in the default zone for calculations . * @ param period new period for interval , null means zero length * @ throws IllegalArgumentException if the end is before the start * @ throws ArithmeticException if the end instant exceeds the capacity of a long */ public void setPeriodAfterStart ( ReadablePeriod period ) { } }
if ( period == null ) { setEndMillis ( getStartMillis ( ) ) ; } else { setEndMillis ( getChronology ( ) . add ( period , getStartMillis ( ) , 1 ) ) ; }
public class DescribeInstancesResult { /** * Information about the reservations . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setReservations ( java . util . Collection ) } or { @ link # withReservations ( java . util . Collection ) } if you want to * override the existing values . * @ param reservations * Information about the reservations . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeInstancesResult withReservations ( Reservation ... reservations ) { } }
if ( this . reservations == null ) { setReservations ( new com . amazonaws . internal . SdkInternalList < Reservation > ( reservations . length ) ) ; } for ( Reservation ele : reservations ) { this . reservations . add ( ele ) ; } return this ;
public class Matrix { /** * Outer product */ public Frame outerProd ( ) { } }
int xrows = ( int ) _x . numRows ( ) ; int xcols = _x . numCols ( ) ; Vec [ ] x_vecs = _x . vecs ( ) ; for ( int j = 0 ; j < xcols ; j ++ ) { if ( x_vecs [ j ] . isEnum ( ) ) throw new IllegalArgumentException ( "Multiplication not meaningful for factor column " + j ) ; } Vec [ ] output = new Vec [ xrows ] ; String [ ] names = new String [ xrows ] ; for ( int i = 0 ; i < xrows ; i ++ ) { output [ i ] = Vec . makeSeq ( xrows ) ; names [ i ] = "C" + String . valueOf ( i + 1 ) ; } for ( int i = 0 ; i < xrows ; i ++ ) { for ( int j = 0 ; j < xrows ; j ++ ) { double d = 0 ; for ( int k = 0 ; k < xcols ; k ++ ) d += x_vecs [ k ] . at ( i ) * x_vecs [ k ] . at ( k ) ; output [ j ] . set ( i , d ) ; } } return new Frame ( names , output ) ;
public class ModuleConfigurationProvider { /** * From root to given project */ static List < ProjectDefinition > getTopDownParentProjects ( ProjectDefinition project ) { } }
List < ProjectDefinition > result = new ArrayList < > ( ) ; ProjectDefinition p = project ; while ( p != null ) { result . add ( 0 , p ) ; p = p . getParent ( ) ; } return result ;
public class Moment { /** * < p > Pr & uuml ; ft , ob eine negative Schaltsekunde vorliegt . < / p > * @ param posixTime UNIX - time in seconds * @ param ts local timestamp used for error message * @ throws ChronoException if a negative leap second is touched */ static void checkNegativeLS ( long posixTime , PlainTimestamp ts ) { } }
LeapSeconds ls = LeapSeconds . getInstance ( ) ; if ( ls . supportsNegativeLS ( ) && ( ls . strip ( ls . enhance ( posixTime ) ) > posixTime ) ) { throw new ChronoException ( "Illegal local timestamp due to " + "negative leap second: " + ts ) ; }
public class AbstractProxySessionManager { /** * Returns id of the session opened for the given Raft group . * Returns { @ link # NO _ SESSION _ ID } if no session exists . */ public final long getSession ( RaftGroupId groupId ) { } }
SessionState session = sessions . get ( groupId ) ; return session != null ? session . id : NO_SESSION_ID ;
public class CloudSpannerConnectionPoolDataSource { /** * Gets a connection which may be pooled by the app server or middleware implementation of * DataSource . * @ throws java . sql . SQLException Occurs when the physical database connection cannot be * established . */ @ Override public CloudSpannerPooledConnection getPooledConnection ( String user , String password ) throws SQLException { } }
return new CloudSpannerPooledConnection ( getConnection ( user , password ) , defaultAutoCommit ) ;
public class JIT_Tie { /** * Adds the _ invoke method inherited by Tie from InvokeHandler . < p > * The _ invoke method of org . omg . CORBA . portable . InvokeHandler is * invoked by the ORB to dispatch a request to the servant ( wrapper ) . * The genarated implementation must determine which method is being * invoked , and route the request to the corresponding private * ' delegate ' method on the Tie that knows how to decode / encode the * arguments and return value . < p > * @ param cw ASM ClassWriter to add the constructor to . * @ param tieClassName fully qualified name of the Tie class * with ' / ' as the separator character * ( i . e . internal name ) . * @ param idlNames OMG IDL names corresponding to the * remoteMethods for this tie . */ private static void add_invokeMethod ( ClassWriter cw , String tieClassName , String [ ] idlNames ) { } }
GeneratorAdapter mg ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , INDENT + "adding method : _invoke " + "(Ljava/lang/String;Lorg/omg/CORBA/portable/InputStream;" + "Lorg/omg/CORBA/portable/ResponseHandler;)" + "Lorg/omg/CORBA/portable/OutputStream;" ) ; // public OutputStream _ invoke ( String method , // InputStream _ in , // ResponseHandler reply ) // throws SystemException Type returnType = TYPE_CORBA_OutputStream ; Type [ ] argTypes = new Type [ ] { TYPE_String , TYPE_CORBA_InputStream , TYPE_CORBA_ResponseHandler } ; Type [ ] exceptionTypes = new Type [ ] { TYPE_CORBA_SystemException } ; org . objectweb . asm . commons . Method m = new org . objectweb . asm . commons . Method ( "_invoke" , returnType , argTypes ) ; // Create an ASM GeneratorAdapter object for the ASM Method , which // makes generating dynamic code much easier . . . as it keeps track // of the position of the arguements and local variables , etc . mg = new GeneratorAdapter ( ACC_PUBLIC , m , null , exceptionTypes , cw ) ; // Begin Method Code . . . mg . visitCode ( ) ; /* * mg . visitFieldInsn ( GETSTATIC , " java / lang / System " , " out " , " Ljava / io / PrintStream ; " ) ; * mg . visitTypeInsn ( NEW , " java / lang / StringBuilder " ) ; * mg . visitInsn ( DUP ) ; * mg . visitMethodInsn ( INVOKESPECIAL , " java / lang / StringBuilder " , " < init > " , " ( ) V " ) ; * mg . visitLdcInsn ( " _ invoke called for " ) ; * mg . visitMethodInsn ( INVOKEVIRTUAL , " java / lang / StringBuilder " , " append " , " ( Ljava / lang / String ; ) Ljava / lang / StringBuilder ; " ) ; * mg . visitVarInsn ( ALOAD , 1 ) ; * mg . visitMethodInsn ( INVOKEVIRTUAL , " java / lang / StringBuilder " , " append " , " ( Ljava / lang / String ; ) Ljava / lang / StringBuilder ; " ) ; * mg . visitMethodInsn ( INVOKEVIRTUAL , " java / lang / StringBuilder " , " toString " , " ( ) Ljava / lang / String ; " ) ; * mg . visitMethodInsn ( INVOKEVIRTUAL , " java / io / PrintStream " , " println " , * " ( Ljava / lang / String ; ) V " ) ; */ // try Label try_begin = new Label ( ) ; mg . visitLabel ( try_begin ) ; // InputStream in = ( org . omg . CORBA _ 2_3 . portable . InputStream ) _ in ; int in = mg . newLocal ( TYPE_CORBA_2_3_InputStream ) ; mg . loadArg ( 1 ) ; mg . checkCast ( TYPE_CORBA_2_3_InputStream ) ; mg . storeLocal ( in ) ; // The next code to ' generate ' is a switch statement , which is basically // what ' _ invoke ' is all about . The code will ' switch ' based on the // hashCode of the OMG IDL name of the method invoked , and each ' case ' // will determine the specific method for that hashCode , and delegate // the work to a private method by that name . However , before adding the // ' switch ' statement , a few things need to be set up : // First , in bytecode , all of the ' switch ' statement keys ( hashCode // values in this case ) must be in ascending order . So , all of the OMG // IDL names for the methods must be sorted in hashcode ascending order . // Second , the ' switch ' bytecode requires arrays of the possible key // values ( hashCodes ) , and labels ( case jump points ) . So , pre - create // the arrays and labels ( in ascending order ) . These arrays will be // created with a length equal to the number of methods , since this will // be the most likely scenario : one ' case ' per method . // Finally , if two or more methods happen to have the same hashCode , // then reduce the size of the ' switch / case ' arrays . Note that each // method will still have a unique label , just not all will be // ' case ' statements . // Clone the array returned by reflections ( so the caller isn ' t affected ) // and then use the java Arrays utility method to perform the sort . A // special hash sort comparator is used that knows how to sort objects // based on the hashCode , rather than ' natural order ' . int numMethods = idlNames . length ; String [ ] sortedNames = idlNames . clone ( ) ; Arrays . sort ( sortedNames , new HashSorter < String > ( ) ) ; int numCases = 0 ; // might not equal numMethods ! int [ ] case_keys = new int [ numMethods ] ; // idl hashCodes Label [ ] case_labels = new Label [ numMethods ] ; Label case_default = new Label ( ) ; Label [ ] method_labels = new Label [ numMethods ] ; // Create a Label for every method , and add that Label and corresponding // hashcode to the lists for the ' case ' statements if the hashCode is not // a duplicate . for ( int i = 0 ; i < numMethods ; ++ i ) { Label method_label = new Label ( ) ; method_labels [ i ] = method_label ; int hashCode = sortedNames [ i ] . hashCode ( ) ; if ( i == 0 || hashCode != sortedNames [ i - 1 ] . hashCode ( ) ) { case_keys [ numCases ] = hashCode ; case_labels [ numCases ] = method_label ; ++ numCases ; } } // Reduce the sizes of the ' switch / case ' statement arrays if some // methods had the same hashCode . if ( numCases != numMethods ) { int [ ] new_keys = new int [ numCases ] ; System . arraycopy ( case_keys , 0 , new_keys , 0 , numCases ) ; case_keys = new_keys ; Label [ ] new_labels = new Label [ numCases ] ; System . arraycopy ( case_labels , 0 , new_labels , 0 , numCases ) ; case_labels = new_labels ; } // switch ( method . hashCode ( ) ) mg . loadArg ( 0 ) ; mg . visitMethodInsn ( INVOKEVIRTUAL , "java/lang/String" , "hashCode" , "()I" ) ; mg . visitLookupSwitchInsn ( case_default , case_keys , case_labels ) ; // / / For all methods . . . . add the following case : // / / Note : if multiple methods have the same hash code , then there // / / would be multiple ' if ' statements for that ' case ' // case < hash code > : // if ( method . equals ( < idl name > ) ) // return < idl name > ( in , reply ) ; / / private delegate method // / / Note : no break statement . Fall through . . . to the ' default ' // / / for the BadOperationException . . . bytcode is much much easier // / / without the break statements . for ( int i = 0 ; i < numMethods ; ++ i ) { mg . visitLabel ( method_labels [ i ] ) ; mg . loadArg ( 0 ) ; mg . push ( sortedNames [ i ] ) ; mg . visitMethodInsn ( INVOKEVIRTUAL , "java/lang/String" , "equals" , "(Ljava/lang/Object;)Z" ) ; int nextMethod = i + 1 ; Label next_label = case_default ; if ( nextMethod < numMethods ) next_label = method_labels [ nextMethod ] ; mg . visitJumpInsn ( IFEQ , next_label ) ; mg . loadThis ( ) ; mg . loadLocal ( in ) ; mg . loadArg ( 2 ) ; mg . visitMethodInsn ( INVOKESPECIAL , tieClassName , sortedNames [ i ] , "(Lorg/omg/CORBA_2_3/portable/InputStream;Lorg/omg/CORBA/portable/ResponseHandler;)Lorg/omg/CORBA/portable/OutputStream;" ) ; mg . returnValue ( ) ; } // default : mg . visitLabel ( case_default ) ; // throw new BAD _ OPERATION ( method ) ; // Note : RMIC uses the default constructor . The method name is passed // here to provide a more meaningful exception . mg . visitTypeInsn ( NEW , "org/omg/CORBA/BAD_OPERATION" ) ; mg . visitInsn ( DUP ) ; mg . loadArg ( 0 ) ; mg . visitMethodInsn ( INVOKESPECIAL , "org/omg/CORBA/BAD_OPERATION" , "<init>" , "(Ljava/lang/String;)V" ) ; mg . visitInsn ( ATHROW ) ; // } / / end switch // } / / end try Label try_end = new Label ( ) ; mg . visitLabel ( try_end ) ; // catch ( SystemException ex ) // throw ex ; Label catch_SysException_label = try_end ; int ex = mg . newLocal ( TYPE_CORBA_SystemException ) ; mg . storeLocal ( ex ) ; mg . loadLocal ( ex ) ; mg . visitInsn ( ATHROW ) ; // catch ( Throwable th ) // throw new UnknownException ( th ) ; Label catch_Throwable_label = new Label ( ) ; mg . visitLabel ( catch_Throwable_label ) ; int th = mg . newLocal ( TYPE_Throwable ) ; mg . storeLocal ( th ) ; mg . visitTypeInsn ( NEW , "org/omg/CORBA/portable/UnknownException" ) ; mg . visitInsn ( DUP ) ; mg . loadLocal ( th ) ; mg . visitMethodInsn ( INVOKESPECIAL , "org/omg/CORBA/portable/UnknownException" , "<init>" , "(Ljava/lang/Throwable;)V" ) ; mg . visitInsn ( ATHROW ) ; // All Try - Catch - Finally definitions for above mg . visitTryCatchBlock ( try_begin , try_end , catch_SysException_label , "org/omg/CORBA/SystemException" ) ; mg . visitTryCatchBlock ( try_begin , try_end , catch_Throwable_label , "java/lang/Throwable" ) ; // End Method Code . . . mg . endMethod ( ) ; // GeneratorAdapter accounts for visitMaxs ( x , y ) mg . visitEnd ( ) ;
public class StorageAccountsInner { /** * List SAS credentials of a storage account . * @ param resourceGroupName The name of the resource group within the user ' s subscription . The name is case insensitive . * @ param accountName The name of the storage account within the specified resource group . Storage account names must be between 3 and 24 characters in length and use numbers and lower - case letters only . * @ param parameters The parameters to provide to list SAS credentials for the storage account . * @ 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 < ListAccountSasResponseInner > listAccountSASAsync ( String resourceGroupName , String accountName , AccountSasParameters parameters , final ServiceCallback < ListAccountSasResponseInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( listAccountSASWithServiceResponseAsync ( resourceGroupName , accountName , parameters ) , serviceCallback ) ;
public class CmsSolrSpellchecker { /** * Perform a security check against OpenCms . * @ param cms The OpenCms object . * @ throws CmsPermissionViolationException in case of the anonymous guest user */ private void performPermissionCheck ( CmsObject cms ) throws CmsPermissionViolationException { } }
if ( cms . getRequestContext ( ) . getCurrentUser ( ) . isGuestUser ( ) ) { throw new CmsPermissionViolationException ( null ) ; }
public class JpaBaseRepository { /** * Determines the ID for the entity * @ param entity The entity to retrieve the ID for * @ return The ID */ @ SuppressWarnings ( "deprecation" ) // No good alternative in the Hibernate API yet protected ID extractId ( T entity ) { } }
final Class < ? > entityClass = TypeHelper . getTypeArguments ( JpaBaseRepository . class , this . getClass ( ) ) . get ( 0 ) ; final SessionFactory sf = ( SessionFactory ) ( getEntityManager ( ) . getEntityManagerFactory ( ) ) ; final ClassMetadata cmd = sf . getClassMetadata ( entityClass ) ; final SessionImplementor si = ( SessionImplementor ) ( getEntityManager ( ) . getDelegate ( ) ) ; @ SuppressWarnings ( "unchecked" ) final ID result = ( ID ) cmd . getIdentifier ( entity , si ) ; return result ;
public class RaftLog { /** * Returns the log entry stored at { @ code entryIndex } . Entry is retrieved * only from the current log , not from the snapshot entry . * If no entry available at this index , then { @ code null } is returned . * Important : Log entry indices start from 1 , not 0. */ public LogEntry getLogEntry ( long entryIndex ) { } }
if ( entryIndex < 1 ) { throw new IllegalArgumentException ( "Illegal index: " + entryIndex + ". Index starts from 1." ) ; } if ( ! containsLogEntry ( entryIndex ) ) { return null ; } LogEntry logEntry = logs . read ( toSequence ( entryIndex ) ) ; assert logEntry . index ( ) == entryIndex : "Expected: " + entryIndex + ", Entry: " + logEntry ; return logEntry ;
public class HttpMethodBase { /** * Tests if the this method is ready to be executed . * @ param state the { @ link HttpState state } information associated with this method * @ param conn the { @ link HttpConnection connection } to be used * @ throws HttpException If the method is in invalid state . */ private void checkExecuteConditions ( HttpState state , HttpConnection conn ) throws HttpException { } }
if ( state == null ) { throw new IllegalArgumentException ( "HttpState parameter may not be null" ) ; } if ( conn == null ) { throw new IllegalArgumentException ( "HttpConnection parameter may not be null" ) ; } if ( this . aborted ) { throw new IllegalStateException ( "Method has been aborted" ) ; } if ( ! validate ( ) ) { throw new ProtocolException ( "HttpMethodBase object not valid" ) ; }
public class Setting { /** * 转换为Properties对象 , 原分组变为前缀 * @ return Properties对象 */ public Properties toProperties ( ) { } }
final Properties properties = new Properties ( ) ; String group ; for ( Entry < String , LinkedHashMap < String , String > > groupEntry : this . groupedMap . entrySet ( ) ) { group = groupEntry . getKey ( ) ; for ( Entry < String , String > entry : groupEntry . getValue ( ) . entrySet ( ) ) { properties . setProperty ( StrUtil . isEmpty ( group ) ? entry . getKey ( ) : group + CharUtil . DOT + entry . getKey ( ) , entry . getValue ( ) ) ; } } return properties ;
public class ScriptRuntime { /** * Escapes the reserved characters in a value of an attribute * @ param value Unescaped text * @ return The escaped text */ public static String escapeAttributeValue ( Object value , Context cx ) { } }
XMLLib xmlLib = currentXMLLib ( cx ) ; return xmlLib . escapeAttributeValue ( value ) ;
public class JawrSassResolver { /** * Adds a path to the linked resource * @ param path * the resource path */ protected void addLinkedResource ( String path ) { } }
FilePathMapping linkedResource = getFilePathMapping ( path ) ; if ( linkedResource != null ) { addLinkedResource ( linkedResource ) ; if ( bundle != null ) { bundle . getLinkedFilePathMappings ( ) . add ( new FilePathMapping ( bundle , linkedResource . getPath ( ) , linkedResource . getLastModified ( ) ) ) ; } }
public class MultiHybridSerializerStrategy { /** * Serialize a MultiNormalizerHybrid to a output stream * @ param normalizer the normalizer * @ param stream the output stream to write to * @ throws IOException */ public void write ( @ NonNull MultiNormalizerHybrid normalizer , @ NonNull OutputStream stream ) throws IOException { } }
try ( DataOutputStream dos = new DataOutputStream ( stream ) ) { writeStatsMap ( normalizer . getInputStats ( ) , dos ) ; writeStatsMap ( normalizer . getOutputStats ( ) , dos ) ; writeStrategy ( normalizer . getGlobalInputStrategy ( ) , dos ) ; writeStrategy ( normalizer . getGlobalOutputStrategy ( ) , dos ) ; writeStrategyMap ( normalizer . getPerInputStrategies ( ) , dos ) ; writeStrategyMap ( normalizer . getPerOutputStrategies ( ) , dos ) ; }
public class DeviceImpl { /** * get Status * @ return status */ @ Override public String status ( ) { } }
MDC . setContextMap ( contextMap ) ; xlogger . entry ( ) ; try { status = getStatus ( ) ; } catch ( final DevFailed e ) { try { stateImpl . stateMachine ( DeviceState . UNKNOWN ) ; statusImpl . statusMachine ( DevFailedUtils . toString ( e ) , DeviceState . UNKNOWN ) ; status = DevFailedUtils . toString ( e ) ; } catch ( final DevFailed e1 ) { logger . debug ( NOT_IMPORTANT_ERROR , e1 ) ; } logger . debug ( NOT_IMPORTANT_ERROR , e ) ; } return status ;
public class Geometry { /** * Canvas arcTo ' s have a variable center , as points a , b and c form two lines from the same point at a tangent to the arc ' s cirlce . * This returns the arcTo arc start , center and end points . * @ param p0 * @ param p1 * @ param r * @ return */ public static final Point2DArray getCanvasArcToPoints ( final Point2D p0 , final Point2D p1 , final Point2D p2 , final double r ) { } }
// see tangents drawn from same point to a circle // http : / / www . mathcaptain . com / geometry / tangent - of - a - circle . html final double a0 = getAngleBetweenTwoLines ( p0 , p1 , p2 ) / 2 ; final double ln = getLengthFromASA ( RADIANS_90 - a0 , r , a0 ) ; Point2D dv = p1 . sub ( p0 ) ; Point2D dx = dv . unit ( ) ; Point2D dl = dx . mul ( ln ) ; final Point2D ps = p1 . sub ( dl ) ; // ps is arc start point dv = p1 . sub ( p2 ) ; dx = dv . unit ( ) ; dl = dx . mul ( ln ) ; final Point2D pe = p1 . sub ( dl ) ; // ep is arc end point // this gets the direction as a unit , from p1 to the center final Point2D midPoint = new Point2D ( ( ps . getX ( ) + pe . getX ( ) ) / 2 , ( ps . getY ( ) + pe . getY ( ) ) / 2 ) ; dx = midPoint . sub ( p1 ) . unit ( ) ; final Point2D pc = p1 . add ( dx . mul ( distance ( r , ln ) ) ) ; return new Point2DArray ( ps , pc , pe ) ;
public class ValueEnforcer { /** * Check that the passed String is neither < code > null < / code > nor empty . * @ param < T > * Type to be checked and returned * @ param aValue * The String to check . * @ param aName * The name of the value ( e . g . the parameter name ) * @ return The passed value . * @ throws IllegalArgumentException * if the passed value is empty */ public static < T extends CharSequence > T notEmpty ( final T aValue , @ Nonnull final Supplier < ? extends String > aName ) { } }
notNull ( aValue , aName ) ; if ( isEnabled ( ) ) if ( aValue . length ( ) == 0 ) throw new IllegalArgumentException ( "The value of the string '" + aName . get ( ) + "' may not be empty!" ) ; return aValue ;
public class MwsConnection { /** * Sets UserAgent property * @ param applicationName * @ param applicationVersion * @ param programmingLanguage * @ param additionalNameValuePairs */ public synchronized void setUserAgent ( String applicationName , String applicationVersion , String programmingLanguage , String ... additionalNameValuePairs ) { } }
checkUpdatable ( ) ; StringBuilder b = new StringBuilder ( ) ; b . append ( applicationName ) ; b . append ( "/" ) ; b . append ( applicationVersion ) ; b . append ( " (Language=" ) ; b . append ( programmingLanguage ) ; int i = 0 ; while ( i < additionalNameValuePairs . length ) { String name = additionalNameValuePairs [ i ] ; String value = additionalNameValuePairs [ i + 1 ] ; b . append ( "; " ) ; b . append ( name ) ; b . append ( "=" ) ; b . append ( value ) ; i += 2 ; } b . append ( ")" ) ; this . userAgent = b . toString ( ) ;
public class AbstractLexicalAnalyzer { /** * 丑陋的规则系统 * @ param sentence * @ param normalized * @ param wordList */ protected void segmentAfterRule ( String sentence , String normalized , List < String > wordList ) { } }
if ( ! enableRuleBasedSegment ) { segmenter . segment ( sentence , normalized , wordList ) ; return ; } int start = 0 ; int end = start ; byte preType = typeTable [ normalized . charAt ( end ) ] ; byte curType ; while ( ++ end < normalized . length ( ) ) { curType = typeTable [ normalized . charAt ( end ) ] ; if ( curType != preType ) { if ( preType == CharType . CT_NUM ) { // 浮点数识别 if ( ",,.." . indexOf ( normalized . charAt ( end ) ) != - 1 ) { if ( end + 1 < normalized . length ( ) ) { if ( typeTable [ normalized . charAt ( end + 1 ) ] == CharType . CT_NUM ) { continue ; } } } else if ( "年月日时分秒" . indexOf ( normalized . charAt ( end ) ) != - 1 ) { preType = curType ; // 交给统计分词 continue ; } } pushPiece ( sentence , normalized , start , end , preType , wordList ) ; start = end ; } preType = curType ; } if ( end == normalized . length ( ) ) pushPiece ( sentence , normalized , start , end , preType , wordList ) ;
public class Discovery { /** * Query system notices . * Queries for notices ( errors or warnings ) that might have been generated by the system . Notices are generated when * ingesting documents and performing relevance training . See the [ Discovery service * documentation ] ( https : / / cloud . ibm . com / docs / services / discovery ? topic = discovery - query - concepts # query - concepts ) for * more details on the query language . * @ param queryNoticesOptions the { @ link QueryNoticesOptions } containing the options for the call * @ return a { @ link ServiceCall } with a response type of { @ link QueryNoticesResponse } */ public ServiceCall < QueryNoticesResponse > queryNotices ( QueryNoticesOptions queryNoticesOptions ) { } }
Validator . notNull ( queryNoticesOptions , "queryNoticesOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "collections" , "notices" } ; String [ ] pathParameters = { queryNoticesOptions . environmentId ( ) , queryNoticesOptions . collectionId ( ) } ; RequestBuilder builder = RequestBuilder . get ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments , pathParameters ) ) ; builder . query ( "version" , versionDate ) ; Map < String , String > sdkHeaders = SdkCommon . getSdkHeaders ( "discovery" , "v1" , "queryNotices" ) ; for ( Entry < String , String > header : sdkHeaders . entrySet ( ) ) { builder . header ( header . getKey ( ) , header . getValue ( ) ) ; } builder . header ( "Accept" , "application/json" ) ; if ( queryNoticesOptions . filter ( ) != null ) { builder . query ( "filter" , queryNoticesOptions . filter ( ) ) ; } if ( queryNoticesOptions . query ( ) != null ) { builder . query ( "query" , queryNoticesOptions . query ( ) ) ; } if ( queryNoticesOptions . naturalLanguageQuery ( ) != null ) { builder . query ( "natural_language_query" , queryNoticesOptions . naturalLanguageQuery ( ) ) ; } if ( queryNoticesOptions . passages ( ) != null ) { builder . query ( "passages" , String . valueOf ( queryNoticesOptions . passages ( ) ) ) ; } if ( queryNoticesOptions . aggregation ( ) != null ) { builder . query ( "aggregation" , queryNoticesOptions . aggregation ( ) ) ; } if ( queryNoticesOptions . count ( ) != null ) { builder . query ( "count" , String . valueOf ( queryNoticesOptions . count ( ) ) ) ; } if ( queryNoticesOptions . returnFields ( ) != null ) { builder . query ( "return" , RequestUtils . join ( queryNoticesOptions . returnFields ( ) , "," ) ) ; } if ( queryNoticesOptions . offset ( ) != null ) { builder . query ( "offset" , String . valueOf ( queryNoticesOptions . offset ( ) ) ) ; } if ( queryNoticesOptions . sort ( ) != null ) { builder . query ( "sort" , RequestUtils . join ( queryNoticesOptions . sort ( ) , "," ) ) ; } if ( queryNoticesOptions . highlight ( ) != null ) { builder . query ( "highlight" , String . valueOf ( queryNoticesOptions . highlight ( ) ) ) ; } if ( queryNoticesOptions . passagesFields ( ) != null ) { builder . query ( "passages.fields" , RequestUtils . join ( queryNoticesOptions . passagesFields ( ) , "," ) ) ; } if ( queryNoticesOptions . passagesCount ( ) != null ) { builder . query ( "passages.count" , String . valueOf ( queryNoticesOptions . passagesCount ( ) ) ) ; } if ( queryNoticesOptions . passagesCharacters ( ) != null ) { builder . query ( "passages.characters" , String . valueOf ( queryNoticesOptions . passagesCharacters ( ) ) ) ; } if ( queryNoticesOptions . deduplicateField ( ) != null ) { builder . query ( "deduplicate.field" , queryNoticesOptions . deduplicateField ( ) ) ; } if ( queryNoticesOptions . similar ( ) != null ) { builder . query ( "similar" , String . valueOf ( queryNoticesOptions . similar ( ) ) ) ; } if ( queryNoticesOptions . similarDocumentIds ( ) != null ) { builder . query ( "similar.document_ids" , RequestUtils . join ( queryNoticesOptions . similarDocumentIds ( ) , "," ) ) ; } if ( queryNoticesOptions . similarFields ( ) != null ) { builder . query ( "similar.fields" , RequestUtils . join ( queryNoticesOptions . similarFields ( ) , "," ) ) ; } return createServiceCall ( builder . build ( ) , ResponseConverterUtils . getObject ( QueryNoticesResponse . class ) ) ;
public class ProjectiveDependencyParser { /** * Runs the parsing algorithm of ( Eisner , 2000 ) as described in McDonald ( 2006 ) . * @ param scores Input : The edge weights . * @ param inChart Output : The parse chart . */ private static void insideAlgorithm ( final double [ ] [ ] scores , final ProjTreeChart inChart , boolean singleRoot ) { } }
final int n = scores . length ; final int startIdx = singleRoot ? 1 : 0 ; // Initialize . for ( int s = 0 ; s < n ; s ++ ) { inChart . setScore ( s , s , RIGHT , COMPLETE , 0.0 ) ; inChart . setScore ( s , s , LEFT , COMPLETE , 0.0 ) ; } // Parse . for ( int width = 1 ; width < n ; width ++ ) { for ( int s = startIdx ; s < n - width ; s ++ ) { int t = s + width ; // First create incomplete items . for ( int r = s ; r < t ; r ++ ) { for ( int d = 0 ; d < 2 ; d ++ ) { double edgeScore = ( d == LEFT ) ? scores [ t ] [ s ] : scores [ s ] [ t ] ; double score = inChart . getScore ( s , r , RIGHT , COMPLETE ) + inChart . getScore ( r + 1 , t , LEFT , COMPLETE ) + edgeScore ; inChart . updateCell ( s , t , d , INCOMPLETE , score , r ) ; } } // Second create complete items . // - - Left side . for ( int r = s ; r < t ; r ++ ) { final int d = LEFT ; double score = inChart . getScore ( s , r , d , COMPLETE ) + inChart . getScore ( r , t , d , INCOMPLETE ) ; inChart . updateCell ( s , t , d , COMPLETE , score , r ) ; } // - - Right side . for ( int r = s + 1 ; r <= t ; r ++ ) { final int d = RIGHT ; double score = inChart . getScore ( s , r , d , INCOMPLETE ) + inChart . getScore ( r , t , d , COMPLETE ) ; inChart . updateCell ( s , t , d , COMPLETE , score , r ) ; } } } if ( singleRoot ) { // Build goal constituents by combining left and right complete // constituents , on the left and right respectively . This corresponds to // left and right triangles . ( Note : this is the opposite of how we // build an incomplete constituent . ) for ( int r = 1 ; r < n ; r ++ ) { double score = inChart . getScore ( 1 , r , LEFT , COMPLETE ) + inChart . getScore ( r , n - 1 , RIGHT , COMPLETE ) + scores [ 0 ] [ r ] ; inChart . updateCell ( 0 , r , RIGHT , INCOMPLETE , score , r ) ; inChart . updateCell ( 0 , n - 1 , RIGHT , COMPLETE , score , r ) ; } }
public class Iconics { /** * Creates a new SpannableStringBuilder and will iterate over the textSpanned once and copy over * all characters , it will also directly replace icon font placeholders with the correct mapping . * Afterwards it will apply the styles */ @ NonNull public static Spanned style ( @ NonNull Context ctx , @ Nullable HashMap < String , ITypeface > fonts , @ NonNull Spanned textSpanned , @ Nullable List < CharacterStyle > styles , @ Nullable HashMap < String , List < CharacterStyle > > stylesFor ) { } }
fonts = init ( ctx , fonts ) ; // find all icons which should be replaced with the iconFont TextStyleContainer textStyleContainer = IconicsUtils . findIcons ( textSpanned , fonts ) ; // create spannableString to set the spans on SpannableString sb = SpannableString . valueOf ( textStyleContainer . spannableStringBuilder ) ; // set all the icons and styles IconicsUtils . applyStyles ( ctx , sb , textStyleContainer . styleContainers , styles , stylesFor ) ; return sb ;
public class SipServletMessageImpl { /** * ( non - Javadoc ) * @ see javax . servlet . sip . SipServletMessage # getParameterableHeader ( java . lang . String ) */ public Parameterable getParameterableHeader ( String name ) throws ServletParseException { } }
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getParameterableHeader - name=" + name ) ; } if ( name == null ) throw new NullPointerException ( "Parametrable header name cant be null!!!" ) ; String nameToSearch = getCorrectHeaderName ( name ) ; Header h = this . message . getHeader ( nameToSearch ) ; if ( ! isParameterable ( name ) ) { throw new ServletParseException ( name + " header is not parameterable !" ) ; } if ( h == null ) { return null ; } return createParameterable ( h , getFullHeaderName ( name ) , message instanceof Request ) ;
public class ConverterUtil { /** * Splits a string into a numeric part and a character part . The input string should conform to the format * < code > [ numeric _ part ] [ char _ part ] < / code > with an optional whitespace between the two parts . * The < code > char _ part < / code > should only contain letters as defined by { @ link Character # isLetter ( char ) } while * the < code > numeric _ part < / code > will be parsed regardless of content . * Any whitespace will be trimmed from the beginning and end of both parts , however , the < code > numeric _ part < / code > * can contain whitespaces within it . * @ param input the string to split . * @ return an array of two strings . */ static String [ ] splitNumericAndChar ( String input ) { } }
// ATTN : String . trim ( ) may not trim all UTF - 8 whitespace characters properly . // The original implementation used its own unicodeTrim ( ) method that I decided not to include until the need // arises . For more information , see : // https : / / github . com / typesafehub / config / blob / v1.3.0 / config / src / main / java / com / typesafe / config / impl / ConfigImplUtil . java # L118 - L164 int i = input . length ( ) - 1 ; while ( i >= 0 ) { char c = input . charAt ( i ) ; if ( ! Character . isLetter ( c ) ) break ; i -= 1 ; } return new String [ ] { input . substring ( 0 , i + 1 ) . trim ( ) , input . substring ( i + 1 ) . trim ( ) } ;
public class ApiBuilder { /** * Create the URL * @ param properties * @ return * @ throws RottenTomatoesException */ public static String create ( Map < String , String > properties ) throws RottenTomatoesException { } }
if ( StringUtils . isBlank ( apiKey ) ) { throw new RottenTomatoesException ( ApiExceptionType . INVALID_URL , "Missing API Key" ) ; } StringBuilder urlBuilder = new StringBuilder ( API_SITE ) ; urlBuilder . append ( API_VERSION ) ; urlBuilder . append ( getUrlFromProps ( properties ) ) ; urlBuilder . append ( API_PREFIX ) . append ( apiKey ) ; for ( Map . Entry < String , String > property : properties . entrySet ( ) ) { // Validate the key / value if ( StringUtils . isNotBlank ( property . getKey ( ) ) && StringUtils . isNotBlank ( property . getValue ( ) ) ) { urlBuilder . append ( "&" ) . append ( property . getKey ( ) ) . append ( "=" ) . append ( property . getValue ( ) ) ; } } LOG . trace ( "URL: {}" , urlBuilder . toString ( ) ) ; return urlBuilder . toString ( ) ;
public class RPCRecordDecoder { /** * / * ( non - Javadoc ) * @ see org . jboss . netty . handler . codec . frame . FrameDecoder # decode ( org . jboss . netty . channel . ChannelHandlerContext , org . jboss . netty . channel . Channel , org . jboss . netty . buffer . ChannelBuffer ) */ protected Object decode ( ChannelHandlerContext channelHandlerContext , Channel channel , ChannelBuffer channelBuffer ) throws Exception { } }
// Wait until the length prefix is available . if ( channelBuffer . readableBytes ( ) < 4 ) { // If null is returned , it means there is not enough data yet . // FrameDecoder will call again when there is a sufficient amount of data available . return null ; } // marking the current reading position channelBuffer . markReaderIndex ( ) ; // get the fragment size and wait until the entire fragment is available . long fragSize = channelBuffer . readUnsignedInt ( ) ; boolean lastFragment = RecordMarkingUtil . isLastFragment ( fragSize ) ; fragSize = RecordMarkingUtil . maskFragmentSize ( fragSize ) ; if ( channelBuffer . readableBytes ( ) < fragSize ) { channelBuffer . resetReaderIndex ( ) ; return null ; } // seek to the beginning of the next fragment channelBuffer . skipBytes ( ( int ) fragSize ) ; _recordLength += 4 + ( int ) fragSize ; // check the last fragment if ( ! lastFragment ) { // not the last fragment , the data is put in an internally maintained cumulative buffer return null ; } byte [ ] rpcResponse = new byte [ _recordLength ] ; channelBuffer . readerIndex ( channelBuffer . readerIndex ( ) - _recordLength ) ; channelBuffer . readBytes ( rpcResponse , 0 , _recordLength ) ; _recordLength = 0 ; return rpcResponse ;
public class Window { /** * Gets the a future by its key . * @ param key The key for the request * @ return The future or null if it doesn ' t exist . */ public WindowFuture < K , R , P > get ( K key ) { } }
return this . futures . get ( key ) ;
public class BTreeLeaf { /** * Positions the current slot right before the first index record that matches * the specified search range . */ private void moveSlotBefore ( ) { } }
/* * int slot = 0 ; while ( slot < currentPage . getNumRecords ( ) & & * searchRange . largerThan ( getKey ( currentPage , slot ) ) ) slot + + ; * currentSlot = slot - 1; */ // Optimization : Use binary search rather than sequential search int startSlot = 0 , endSlot = currentPage . getNumRecords ( ) - 1 ; int middleSlot = ( startSlot + endSlot ) / 2 ; SearchKey searchMin = searchRange . getMin ( ) ; if ( endSlot >= 0 ) { while ( middleSlot != startSlot ) { if ( searchMin . compareTo ( getKey ( currentPage , middleSlot , keyType . length ( ) ) ) > 0 ) startSlot = middleSlot ; else endSlot = middleSlot ; middleSlot = ( startSlot + endSlot ) / 2 ; } if ( searchMin . compareTo ( getKey ( currentPage , endSlot , keyType . length ( ) ) ) > 0 ) currentSlot = endSlot ; else if ( searchMin . compareTo ( getKey ( currentPage , startSlot , keyType . length ( ) ) ) > 0 ) currentSlot = startSlot ; else currentSlot = startSlot - 1 ; } else currentSlot = - 1 ;
public class TaskDefinition { /** * The launch type to use with your task . For more information , see < a * href = " https : / / docs . aws . amazon . com / AmazonECS / latest / developerguide / launch _ types . html " > Amazon ECS Launch Types < / a > * in the < i > Amazon Elastic Container Service Developer Guide < / i > . * @ param compatibilities * The launch type to use with your task . For more information , see < a * href = " https : / / docs . aws . amazon . com / AmazonECS / latest / developerguide / launch _ types . html " > Amazon ECS Launch * Types < / a > in the < i > Amazon Elastic Container Service Developer Guide < / i > . * @ return Returns a reference to this object so that method calls can be chained together . * @ see Compatibility */ public TaskDefinition withCompatibilities ( Compatibility ... compatibilities ) { } }
com . amazonaws . internal . SdkInternalList < String > compatibilitiesCopy = new com . amazonaws . internal . SdkInternalList < String > ( compatibilities . length ) ; for ( Compatibility value : compatibilities ) { compatibilitiesCopy . add ( value . toString ( ) ) ; } if ( getCompatibilities ( ) == null ) { setCompatibilities ( compatibilitiesCopy ) ; } else { getCompatibilities ( ) . addAll ( compatibilitiesCopy ) ; } return this ;
public class MigrateArgs { /** * Migrate one or more { @ code keys } . * @ param keys must not be { @ literal null } . * @ return { @ code this } { @ link MigrateArgs } . */ @ SafeVarargs public final MigrateArgs < K > keys ( K ... keys ) { } }
LettuceAssert . notEmpty ( keys , "Keys must not be empty" ) ; this . keys . addAll ( Arrays . asList ( keys ) ) ; return this ;
public class BaseGraphMapper { /** * This method converts given TF * @ param tfGraph * @ return */ @ Override public SameDiff importGraph ( GRAPH_TYPE tfGraph ) { } }
return importGraph ( tfGraph , Collections . < String , OpImportOverride < GRAPH_TYPE , NODE_TYPE , ATTR_TYPE > > emptyMap ( ) , null ) ;
public class DialogPlus { /** * It is called when the show ( ) method is called * @ param view is the dialog plus view */ private void onAttached ( View view ) { } }
decorView . addView ( view ) ; contentContainer . startAnimation ( inAnim ) ; contentContainer . requestFocus ( ) ; holder . setOnKeyListener ( new View . OnKeyListener ( ) { @ Override public boolean onKey ( View v , int keyCode , KeyEvent event ) { switch ( event . getAction ( ) ) { case KeyEvent . ACTION_UP : if ( keyCode == KeyEvent . KEYCODE_BACK ) { if ( onBackPressListener != null ) { onBackPressListener . onBackPressed ( DialogPlus . this ) ; } if ( isCancelable ) { onBackPressed ( DialogPlus . this ) ; } return true ; } break ; default : break ; } return false ; } } ) ;
public class GenericRepository { /** * Merge the state of the given entity into the current persistence context . */ @ Transactional public E merge ( E entity ) { } }
System . out . println ( "merge: " + entity . entityClassName ( ) + ": " + entity + ": " + entity . getId ( ) ) ; return entityManager . merge ( entity ) ;
public class Cob2XsdMain { /** * Check the input parameter and keep it only if it is valid . * @ param input a file or folder name ( relative or absolute ) */ public void setInput ( final String input ) { } }
if ( input == null ) { throw ( new IllegalArgumentException ( "You must provide a COBOL source folder or file" ) ) ; } File file = new File ( input ) ; if ( file . exists ( ) ) { if ( file . isDirectory ( ) && file . list ( ) . length == 0 ) { throw new IllegalArgumentException ( "Folder " + input + " is empty" ) ; } } else { throw new IllegalArgumentException ( "Input file or folder " + input + " not found" ) ; } _input = file ;
public class QuotaLimitingStore { /** * Ensure the current throughput levels for the tracked operation does not * exceed set quota limits . Throws an exception if exceeded quota . * @ param quotaKey * @ param trackedOp */ private void checkRateLimit ( String quotaKey , Tracked trackedOp ) { } }
String quotaValue = null ; try { if ( ! metadataStore . getQuotaEnforcingEnabledUnlocked ( ) ) { return ; } quotaValue = quotaStore . cacheGet ( quotaKey ) ; // Store may not have any quotas if ( quotaValue == null ) { return ; } // But , if it does float currentRate = getThroughput ( trackedOp ) ; float allowedRate = Float . parseFloat ( quotaValue ) ; // TODO the histogram should be reasonably accurate to do all // these things . . ( ghost qps and all ) // Report the current quota usage level quotaStats . reportQuotaUsed ( trackedOp , Utils . safeGetPercentage ( currentRate , allowedRate ) ) ; // check if we have exceeded rate . if ( currentRate > allowedRate ) { quotaStats . reportRateLimitedOp ( trackedOp ) ; throw new QuotaExceededException ( "Exceeded rate limit for " + quotaKey + ". Maximum allowed : " + allowedRate + " Current: " + currentRate ) ; } } catch ( NumberFormatException nfe ) { // move on , if we cannot parse quota value properly logger . debug ( "Invalid formatting of quota value for key " + quotaKey + " : " + quotaValue ) ; }
public class MethodAnnotation { /** * Factory method to create the MethodAnnotation from the classname , method * name , signature , etc . The method tries to look up source line information * for the method . * @ param className * name of the class containing the method * @ param methodName * name of the method * @ param methodSig * signature of the method * @ param accessFlags * the access flags of the method * @ return the MethodAnnotation */ public static MethodAnnotation fromForeignMethod ( @ SlashedClassName String className , String methodName , String methodSig , int accessFlags ) { } }
className = ClassName . toDottedClassName ( className ) ; // Create MethodAnnotation . // It won ' t have source lines yet . MethodAnnotation methodAnnotation = new MethodAnnotation ( className , methodName , methodSig , ( accessFlags & Const . ACC_STATIC ) != 0 ) ; SourceLineAnnotation sourceLines = SourceLineAnnotation . getSourceAnnotationForMethod ( className , methodName , methodSig ) ; methodAnnotation . setSourceLines ( sourceLines ) ; return methodAnnotation ;
public class ParseBool { /** * Checks the preconditions for constructing a new ParseBool processor . * @ param trueValues * the array of Strings which represent true * @ param falseValues * the array of Strings which represent false * @ throws IllegalArgumentException * if trueValues or falseValues is empty * @ throws NullPointerException * if trueValues or falseValues is null */ private static void checkPreconditions ( final String [ ] trueValues , final String [ ] falseValues ) { } }
if ( trueValues == null ) { throw new NullPointerException ( "trueValues should not be null" ) ; } else if ( trueValues . length == 0 ) { throw new IllegalArgumentException ( "trueValues should not be empty" ) ; } if ( falseValues == null ) { throw new NullPointerException ( "falseValues should not be null" ) ; } else if ( falseValues . length == 0 ) { throw new IllegalArgumentException ( "falseValues should not be empty" ) ; }
public class ManagedClustersInner { /** * Reset AAD Profile of a managed cluster . * Update the AAD Profile for a managed cluster . * @ param resourceGroupName The name of the resource group . * @ param resourceName The name of the managed cluster resource . * @ param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable for the request */ public Observable < ServiceResponse < Void > > resetAADProfileWithServiceResponseAsync ( String resourceGroupName , String resourceName , ManagedClusterAADProfile parameters ) { } }
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( resourceName == null ) { throw new IllegalArgumentException ( "Parameter resourceName is required and cannot be null." ) ; } if ( parameters == null ) { throw new IllegalArgumentException ( "Parameter parameters is required and cannot be null." ) ; } Validator . validate ( parameters ) ; final String apiVersion = "2019-02-01" ; Observable < Response < ResponseBody > > observable = service . resetAADProfile ( this . client . subscriptionId ( ) , resourceGroupName , resourceName , apiVersion , parameters , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) ; return client . getAzureClient ( ) . getPostOrDeleteResultAsync ( observable , new TypeToken < Void > ( ) { } . getType ( ) ) ;
public class FileChannelJournalSegmentReader { /** * Reads the next entry in the segment . */ @ SuppressWarnings ( "unchecked" ) private void readNext ( ) { } }
// Compute the index of the next entry in the segment . final long index = getNextIndex ( ) ; try { // Read more bytes from the segment if necessary . if ( memory . remaining ( ) < maxEntrySize ) { long position = channel . position ( ) + memory . position ( ) ; channel . position ( position ) ; memory . clear ( ) ; channel . read ( memory ) ; channel . position ( position ) ; memory . flip ( ) ; } // Mark the buffer so it can be reset if necessary . memory . mark ( ) ; try { // Read the length of the entry . final int length = memory . getInt ( ) ; // If the buffer length is zero then return . if ( length <= 0 || length > maxEntrySize ) { memory . reset ( ) . limit ( memory . position ( ) ) ; nextEntry = null ; return ; } // Read the checksum of the entry . long checksum = memory . getInt ( ) & 0xFFFFFFFFL ; // Compute the checksum for the entry bytes . final Checksum crc32 = new CRC32 ( ) ; crc32 . update ( memory . array ( ) , memory . position ( ) , length ) ; // If the stored checksum equals the computed checksum , return the entry . if ( checksum == crc32 . getValue ( ) ) { int limit = memory . limit ( ) ; memory . limit ( memory . position ( ) + length ) ; E entry = namespace . deserialize ( memory ) ; memory . limit ( limit ) ; nextEntry = new Indexed < > ( index , entry , length ) ; } else { memory . reset ( ) . limit ( memory . position ( ) ) ; nextEntry = null ; } } catch ( BufferUnderflowException e ) { memory . reset ( ) . limit ( memory . position ( ) ) ; nextEntry = null ; } } catch ( IOException e ) { throw new StorageException ( e ) ; }
public class StreamService { /** * { @ inheritDoc } */ public void deleteStream ( IStreamCapableConnection conn , Number streamId ) { } }
IClientStream stream = conn . getStreamById ( streamId ) ; if ( stream != null ) { if ( stream instanceof IClientBroadcastStream ) { IClientBroadcastStream bs = ( IClientBroadcastStream ) stream ; IBroadcastScope bsScope = getBroadcastScope ( conn . getScope ( ) , bs . getPublishedName ( ) ) ; if ( bsScope != null && conn instanceof BaseConnection ) { ( ( BaseConnection ) conn ) . unregisterBasicScope ( bsScope ) ; } } stream . close ( ) ; } conn . unreserveStreamId ( streamId ) ;
public class EligibilityResponse { /** * syntactic sugar */ public ErrorsComponent addError ( ) { } }
ErrorsComponent t = new ErrorsComponent ( ) ; if ( this . error == null ) this . error = new ArrayList < ErrorsComponent > ( ) ; this . error . add ( t ) ; return t ;
public class ConsoleBuilder { /** * Print columns to console * @ param columns Collections of CharSequences to print */ public static void print ( final Collection < ? extends CharSequence > columns ) { } }
print ( new Applyable < ConsoleReaderWrapper > ( ) { public void apply ( ConsoleReaderWrapper consoleReaderWrapper ) { consoleReaderWrapper . print ( columns ) ; } } ) ;
public class GoogleCalendarService { /** * Performs an immediate delete request on the google calendar api . * @ param calendar The calendar to be removed . * @ throws IOException For unexpected errors */ public void deleteCalendar ( GoogleCalendar calendar ) throws IOException { } }
dao . calendars ( ) . delete ( calendar . getId ( ) ) . execute ( ) ;
public class LossMixtureDensity { /** * This method returns the score for each of the given outputs against the * given set of labels . For a mixture density network , this is done by * extracting the " alpha " , " mu " , and " sigma " components of each gaussian * and computing the negative log likelihood that the labels fall within * a linear combination of these gaussian distributions . The smaller * the negative log likelihood , the higher the probability that the given * labels actually would fall within the distribution . Therefore by * minimizing the negative log likelihood , we get to a position of highest * probability that the gaussian mixture explains the phenomenon . * @ param labels Labels give the sample output that the network should * be trying to converge on . * @ param preOutput The output of the last layer ( before applying the activation function ) . * @ param activationFn The activation function of the current layer . * @ param mask Mask to apply to score evaluation ( not supported for this cost function ) . * @ return */ @ Override public INDArray computeScoreArray ( INDArray labels , INDArray preOutput , IActivation activationFn , INDArray mask ) { } }
labels = labels . castTo ( preOutput . dataType ( ) ) ; // No - op if already correct dtype INDArray output = activationFn . getActivation ( preOutput . dup ( ) , false ) ; MixtureDensityComponents mdc = extractComponents ( output ) ; INDArray scoreArr = negativeLogLikelihood ( labels , mdc . alpha , mdc . mu , mdc . sigma ) ; if ( mask != null ) { LossUtil . applyMask ( scoreArr , mask ) ; } return scoreArr ;
public class EntityNameFinderService { /** * Gets all the entity types and tries to instantiate and cache a finder for each one . There * needn ' t be a finder for every entity type , so if there ' s no entry in the portal . properties , * we just log the fact and continue . */ private synchronized void initialize ( ) { } }
Iterator types = EntityTypesLocator . getEntityTypes ( ) . getAllEntityTypes ( ) ; String factoryName = null ; while ( types . hasNext ( ) ) { Class type = ( Class ) types . next ( ) ; if ( type != Object . class ) { String factoryKey = "org.apereo.portal.services.EntityNameFinderService.NameFinderFactory.implementation_" + type . getName ( ) ; try { factoryName = PropertiesManager . getProperty ( factoryKey ) ; } catch ( Exception runtime ) { String dMsg = "EntityNameFinderService.initialize(): " + "could not find property for " + type . getName ( ) + " factory." ; log . debug ( dMsg ) ; } if ( factoryName != null ) { try { IEntityNameFinderFactory factory = ( IEntityNameFinderFactory ) Class . forName ( factoryName ) . newInstance ( ) ; getNameFinders ( ) . put ( type , factory . newFinder ( ) ) ; } catch ( Exception e ) { String eMsg = "EntityNameFinderService.initialize(): " + "Could not instantiate finder for " + type . getName ( ) + ": " ; log . error ( eMsg , e ) ; } } } } setInitialized ( true ) ;
public class CouchClient { /** * Get document along with its revision history , and the result is converted to a * < code > DocumentRevs < / code > object . * @ see < code > DocumentRevs < / code > */ public DocumentRevs getDocRevisions ( String id , String rev ) { } }
return getDocRevisions ( id , rev , new CouchClientTypeReference < DocumentRevs > ( DocumentRevs . class ) ) ;
public class ComputerVisionManager { /** * Initializes an instance of Computer Vision API client . * @ param credentials the management credentials for Azure * @ param endpoint Supported Cognitive Services endpoints . * @ return the Computer Vision API client */ public static ComputerVisionClient authenticate ( ServiceClientCredentials credentials , String endpoint ) { } }
return authenticate ( "https://{endpoint}/vision/v2.0/" , credentials ) . withEndpoint ( endpoint ) ;
public class NFastArrayList { /** * Add a value to the List * @ param value */ public final NFastArrayList < M > set ( final int i , final M value ) { } }
m_jso . set ( i , value ) ; return this ;
public class OpenAPIModelFilterAdapter { /** * { @ inheritDoc } */ @ Override public Discriminator visitDiscriminator ( Context context , Discriminator d ) { } }
visitor . visitDiscriminator ( context , d ) ; return d ;
public class ByteBufferUtils { /** * NB : while Druid no longer support Java 7 , this method would still work with that version as well . */ private static MethodHandle unmapJava7Or8 ( MethodHandles . Lookup lookup ) throws ReflectiveOperationException { } }
// " Compile " a MethodHandle that is roughly equivalent to the following lambda : // ( ByteBuffer buffer ) - > { // sun . misc . Cleaner cleaner = ( ( java . nio . DirectByteBuffer ) byteBuffer ) . cleaner ( ) ; // if ( nonNull ( cleaner ) ) // cleaner . clean ( ) ; // else // noop ( cleaner ) ; / / the noop is needed because MethodHandles # guardWithTest always needs both if and else Class < ? > directBufferClass = Class . forName ( "java.nio.DirectByteBuffer" ) ; Method m = directBufferClass . getMethod ( "cleaner" ) ; m . setAccessible ( true ) ; MethodHandle directBufferCleanerMethod = lookup . unreflect ( m ) ; Class < ? > cleanerClass = directBufferCleanerMethod . type ( ) . returnType ( ) ; MethodHandle cleanMethod = lookup . findVirtual ( cleanerClass , "clean" , MethodType . methodType ( void . class ) ) ; MethodHandle nonNullTest = lookup . findStatic ( Objects . class , "nonNull" , MethodType . methodType ( boolean . class , Object . class ) ) . asType ( MethodType . methodType ( boolean . class , cleanerClass ) ) ; MethodHandle noop = MethodHandles . dropArguments ( MethodHandles . constant ( Void . class , null ) . asType ( MethodType . methodType ( void . class ) ) , 0 , cleanerClass ) ; MethodHandle unmapper = MethodHandles . filterReturnValue ( directBufferCleanerMethod , MethodHandles . guardWithTest ( nonNullTest , cleanMethod , noop ) ) . asType ( MethodType . methodType ( void . class , ByteBuffer . class ) ) ; return unmapper ;
public class ClassLoaderWithRegistry { /** * Add a package name which should be loaded with this classloader . * @ param _ packageName name of the package , has to end with ' . ' */ public void addIncludedPackageNames ( String _packageName ) { } }
if ( _packageName . endsWith ( "." ) ) { includePackageNames . add ( _packageName ) ; ComponentRegistry . getInstance ( ) . addPackageToIncludeList ( _packageName ) ; }
public class ChargeSkin { /** * * * * * * Initialization * * * * * */ private void initGraphics ( ) { } }
// Set initial size if ( Double . compare ( gauge . getPrefWidth ( ) , 0.0 ) <= 0 || Double . compare ( gauge . getPrefHeight ( ) , 0.0 ) <= 0 || Double . compare ( gauge . getWidth ( ) , 0.0 ) <= 0 || Double . compare ( gauge . getHeight ( ) , 0.0 ) <= 0 ) { if ( gauge . getPrefWidth ( ) > 0 && gauge . getPrefHeight ( ) > 0 ) { gauge . setPrefSize ( gauge . getPrefWidth ( ) , gauge . getPrefHeight ( ) ) ; } else { gauge . setPrefSize ( PREFERRED_WIDTH , PREFERRED_HEIGHT ) ; } } for ( int i = 0 ; i < 12 ; i ++ ) { Region bar = new Region ( ) ; bar . setPrefSize ( 20 , 20 + ( i * 4 ) ) ; bars [ i ] = bar ; } pane = new HBox ( bars ) ; pane . setSpacing ( PREFERRED_WIDTH * 0.01960784 ) ; pane . setAlignment ( Pos . BOTTOM_CENTER ) ; pane . setFillHeight ( false ) ; pane . setBackground ( new Background ( new BackgroundFill ( backgroundPaint , new CornerRadii ( 1024 ) , Insets . EMPTY ) ) ) ; pane . setBorder ( new Border ( new BorderStroke ( borderPaint , BorderStrokeStyle . SOLID , new CornerRadii ( 1024 ) , new BorderWidths ( borderWidth ) ) ) ) ; getChildren ( ) . setAll ( pane ) ;
public class Rational { /** * Add the specified value to this value and return the result as a new object * ( also a rational ) . If the two values have different denominators , they will * first be converted so that they have common denominators . * @ param value The value to add to this rational . * @ return A new rational value that is the sum of this value and the specified * value . */ public Rational add ( Rational value ) { } }
if ( denominator == value . getDenominator ( ) ) { return new Rational ( numerator + value . getNumerator ( ) , denominator ) ; } else { return new Rational ( numerator * value . getDenominator ( ) + value . getNumerator ( ) * denominator , denominator * value . getDenominator ( ) ) ; }
public class EntityDocumentBuilder { /** * Adds an additional alias to the constructed document . * @ param text * the text of the alias * @ param languageCode * the language code of the alias * @ return builder object to continue construction */ public T withAlias ( String text , String languageCode ) { } }
withAlias ( factory . getMonolingualTextValue ( text , languageCode ) ) ; return getThis ( ) ;
public class JnlpFileHandler { /** * / * Main method to lookup an entry ( NEW for JavaWebStart 1.5 + ) */ public synchronized DownloadResponse getJnlpFileEx ( JnlpResource jnlpres , DownloadRequest dreq ) throws IOException { } }
String path = jnlpres . getPath ( ) ; URL resource = jnlpres . getResource ( ) ; long lastModified = jnlpres . getLastModified ( ) ; _log . addDebug ( "lastModified: " + lastModified + " " + new Date ( lastModified ) ) ; if ( lastModified == 0 ) { _log . addWarning ( "servlet.log.warning.nolastmodified" , path ) ; } // fix for 4474854 : use the request URL as key to look up jnlp file // in hash map String reqUrl = HttpUtils . getRequestURL ( dreq . getHttpRequest ( ) ) . toString ( ) ; // SQE : To support query string , we changed the hash key from Request URL to ( Request URL + query string ) if ( dreq . getQuery ( ) != null ) { reqUrl += dreq . getQuery ( ) ; } // Check if entry already exist in HashMap JnlpFileEntry jnlpFile = ( JnlpFileEntry ) _jnlpFiles . get ( reqUrl ) ; if ( jnlpFile != null && jnlpFile . getLastModified ( ) == lastModified ) { // Entry found in cache , so return it return jnlpFile . getResponse ( ) ; } // Read information from WAR file long timeStamp = lastModified ; String mimeType = _servletContext . getMimeType ( path ) ; if ( mimeType == null ) { mimeType = JNLP_MIME_TYPE ; } StringBuilder jnlpFileTemplate = new StringBuilder ( ) ; URLConnection conn = resource . openConnection ( ) ; BufferedReader br = new BufferedReader ( new InputStreamReader ( conn . getInputStream ( ) , "UTF-8" ) ) ; String line = br . readLine ( ) ; if ( line != null && line . startsWith ( "TS:" ) ) { timeStamp = parseTimeStamp ( line . substring ( 3 ) ) ; _log . addDebug ( "Timestamp: " + timeStamp + " " + new Date ( timeStamp ) ) ; if ( timeStamp == 0 ) { _log . addWarning ( "servlet.log.warning.notimestamp" , path ) ; timeStamp = lastModified ; } line = br . readLine ( ) ; } while ( line != null ) { jnlpFileTemplate . append ( line ) ; line = br . readLine ( ) ; } String jnlpFileContent = specializeJnlpTemplate ( dreq . getHttpRequest ( ) , path , jnlpFileTemplate . toString ( ) ) ; /* SQE : We need to add query string back to href in jnlp file . We also need to handle JRE requirement for * the test . We reconstruct the xml DOM object , modify the value , then regenerate the jnlpFileContent . */ String query = dreq . getQuery ( ) ; String testJRE = dreq . getTestJRE ( ) ; _log . addDebug ( "Double check query string: " + query ) ; // For backward compatibility : Always check if the href value exists . // Bug 4939273 : We will retain the jnlp template structure and will NOT add href value . Above old // approach to always check href value caused some test case not run . if ( query != null ) { byte [ ] cb = jnlpFileContent . getBytes ( "UTF-8" ) ; ByteArrayInputStream bis = new ByteArrayInputStream ( cb ) ; try { DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder builder = factory . newDocumentBuilder ( ) ; Document document = builder . parse ( bis ) ; if ( document != null && document . getNodeType ( ) == Node . DOCUMENT_NODE ) { boolean modified = false ; Element root = document . getDocumentElement ( ) ; if ( root . hasAttribute ( "href" ) ) { String href = root . getAttribute ( "href" ) ; root . setAttribute ( "href" , href + "?" + query ) ; modified = true ; } // Update version value for j2se tag if ( testJRE != null ) { NodeList j2seNL = root . getElementsByTagName ( "j2se" ) ; if ( j2seNL != null ) { Element j2se = ( Element ) j2seNL . item ( 0 ) ; String ver = j2se . getAttribute ( "version" ) ; if ( ver . length ( ) > 0 ) { j2se . setAttribute ( "version" , testJRE ) ; modified = true ; } } } _hook . preCommit ( dreq , document ) ; TransformerFactory tFactory = TransformerFactory . newInstance ( ) ; Transformer transformer = tFactory . newTransformer ( ) ; DOMSource source = new DOMSource ( document ) ; StringWriter sw = new StringWriter ( ) ; StreamResult result = new StreamResult ( sw ) ; transformer . transform ( source , result ) ; jnlpFileContent = sw . toString ( ) ; _log . addDebug ( "Converted jnlpFileContent: " + jnlpFileContent ) ; // Since we modified the file on the fly , we always update the timestamp value with current time if ( modified ) { timeStamp = new java . util . Date ( ) . getTime ( ) ; _log . addDebug ( "Last modified on the fly: " + timeStamp ) ; } } } catch ( Exception e ) { _log . addDebug ( e . toString ( ) , e ) ; } } // Convert to bytes as a UTF - 8 encoding byte [ ] byteContent = jnlpFileContent . getBytes ( "UTF-8" ) ; // Create entry DownloadResponse resp = DownloadResponse . getFileDownloadResponse ( byteContent , mimeType , timeStamp , jnlpres . getReturnVersionId ( ) ) ; jnlpFile = new JnlpFileEntry ( resp , lastModified ) ; _jnlpFiles . put ( reqUrl , jnlpFile ) ; return resp ;
public class Main { /** * Attempts to sign in or register the account specified by the login form . * If there are form errors ( invalid email , missing fields , etc . ) , the * errors are presented and no actual login attempt is made . */ public void attemptLogin ( ) { } }
// Reset errors . mEmail . setError ( null ) ; mPassword . setError ( null ) ; // Check for a valid email address . if ( TextUtils . isEmpty ( mEmail . getText ( ) ) ) { mEmail . setError ( getString ( R . string . error_field_required ) ) ; return ; } q . task ( new CocoTask < String > ( ) { @ Override public String backgroundWork ( ) throws Exception { Thread . sleep ( 2000 ) ; return "Hello " ; } @ Override public void callback ( String result ) { q . toast ( result + mEmail . getText ( ) ) ; // q . startActivity ( ListAct . class ) ; } @ Override public void pre ( ) { q . v ( mLoginStatusMessage ) . text ( R . string . login_progress_signing_in ) ; } } . progress ( mLoginStatus ) . view ( mLoginForm ) ) ;
public class PropertyLoader { /** * This will realise the set of resources returned from @ see constructResourcesList and * as a fully populated properties object , including System properties * @ return returns a fully populated Properties object with values from the config , the override and the System ( in that order of precedence ) * @ throws IOException */ public Properties buildConsolidatedProperties ( ) throws IOException { } }
// Cannot use the spring classes here because they a ) use the logger early , which // scuppers log4j and b ) they ' re designed to do bean value overriding - not to be // used directly in this fashion Properties properties = new Properties ( ) ; // Read them from the list of resources then mix in System for ( Resource r : constructResourceList ( ) ) { try ( InputStream is = r . getInputStream ( ) ) { properties . load ( is ) ; } } // System for ( String propertyName : System . getProperties ( ) . stringPropertyNames ( ) ) { properties . setProperty ( propertyName , System . getProperty ( propertyName ) ) ; } return properties ;
public class CurrentInProgressMetadata { /** * Clear out the data in the ZNode specified in the constructor to indicate * that no segment is currently in progress . This does not delete the * actual ZNode . * @ throws IOException If there is an unrecoverable error talking to * ZooKeeper */ public void clear ( ) throws IOException { } }
try { zooKeeper . setData ( fullyQualifiedZNode , null , expectedZNodeVersion . get ( ) ) ; } catch ( KeeperException . BadVersionException e ) { LOG . error ( fullyQualifiedZNode + " has been updated by another process" , e ) ; throw new StaleVersionException ( fullyQualifiedZNode + "has been updated by another process!" ) ; } catch ( KeeperException e ) { keeperException ( "Unrecoverable ZooKeeper error clearing " + fullyQualifiedZNode , e ) ; } catch ( InterruptedException e ) { interruptedException ( "Interrupted clearing " + fullyQualifiedZNode , e ) ; }
public class GrpcUtils { /** * Converts a proto type to a wire type . * @ param localityPTier the proto type to convert * @ return the converted wire type */ public static TieredIdentity . LocalityTier fromProto ( alluxio . grpc . LocalityTier localityPTier ) { } }
return new TieredIdentity . LocalityTier ( localityPTier . getTierName ( ) , localityPTier . hasValue ( ) ? localityPTier . getValue ( ) : null ) ;
public class RelsValidator { /** * validate the value against the xsd definition * NCName : : = ( Letter | ' _ ' ) ( NCNameChar ) * NCNameChar : : = Letter | Digit | ' . ' | ' - ' | ' _ ' | * CombiningChar | Extender */ private static boolean isValid ( String stValue ) { } }
int scan ; boolean bValid = true ; for ( scan = 0 ; scan < stValue . length ( ) ; scan ++ ) { if ( scan == 0 ) bValid = XMLChar . isNCNameStart ( stValue . charAt ( scan ) ) ; else bValid = XMLChar . isNCName ( stValue . charAt ( scan ) ) ; if ( ! bValid ) break ; } return bValid ;
public class EngineDataAccessCache { /** * changed to append in all cases */ public synchronized void setActivityInstanceStatus ( ActivityInstance actInst , Integer status , String statusMessage ) throws SQLException { } }
if ( cache_activity_transition == CACHE_ONLY ) { actInst . setStatusCode ( status ) ; actInst . setMessage ( statusMessage ) ; } else { edadb . setActivityInstanceStatus ( actInst , status , statusMessage ) ; }
public class ListVolumeInitiatorsResult { /** * The host names and port numbers of all iSCSI initiators that are connected to the gateway . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setInitiators ( java . util . Collection ) } or { @ link # withInitiators ( java . util . Collection ) } if you want to * override the existing values . * @ param initiators * The host names and port numbers of all iSCSI initiators that are connected to the gateway . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListVolumeInitiatorsResult withInitiators ( String ... initiators ) { } }
if ( this . initiators == null ) { setInitiators ( new com . amazonaws . internal . SdkInternalList < String > ( initiators . length ) ) ; } for ( String ele : initiators ) { this . initiators . add ( ele ) ; } return this ;
public class ParentBinding { /** * The getter must be placed in the same package as the parent getter , to ensure that its return * type is visible . */ public String getGetterMethodPackage ( ) { } }
Binding parentBinding = parentBindings . getBinding ( key ) ; if ( parentBinding == null ) { // The parent binding should exist by the time this is called . errorManager . logError ( "No parent binding found in %s for %s." , parentBindings , key ) ; return "" ; } else { return parentBinding . getGetterMethodPackage ( ) ; }