idx
int64 0
34.9k
| question
stringlengths 12
26.4k
| target
stringlengths 15
2.15k
|
---|---|---|
0 | @ Override public int runCommand ( boolean mergeErrorIntoOutput , String ... commands ) throws IOException , InterruptedException { return runCommand ( mergeErrorIntoOutput , new ArrayList < String > ( Arrays . asList ( commands ) ) ) ; } | Returns the index of the frequency band that contains the requested frequency. |
1 | private int findPLV ( int M_PriceList_ID ) { Timestamp priceDate = null ; String dateStr = Env . getContext ( Env . getCtx ( ) , p_WindowNo , "DateOrdered" ) ; if ( dateStr != null && dateStr . length ( ) > 0 ) priceDate = Env . getContextAsDate ( Env . getCtx ( ) , p_WindowNo , "DateOrdered" ) ; else { dateStr = Env . getContext ( Env . getCtx ( ) , p_WindowNo , "DateInvoiced" ) ; if ( dateStr != null && dateStr . length ( ) > 0 ) priceDate = Env . getContextAsDate ( Env . getCtx ( ) , p_WindowNo , "DateInvoiced" ) ; } if ( priceDate == null ) priceDate = new Timestamp ( System . currentTimeMillis ( ) ) ; log . config ( "M_PriceList_ID=" + M_PriceList_ID + " - " + priceDate ) ; int retValue = 0 ; String sql = "SELECT plv.M_PriceList_Version_ID, plv.ValidFrom " + "FROM M_PriceList pl, M_PriceList_Version plv " + "WHERE pl.M_PriceList_ID=plv.M_PriceList_ID" + " AND plv.IsActive='Y'" + " AND pl.M_PriceList_ID=? " + "ORDER BY plv.ValidFrom DESC" ; try { PreparedStatement pstmt = DB . prepareStatement ( sql , null ) ; pstmt . setInt ( 1 , M_PriceList_ID ) ; ResultSet rs = pstmt . executeQuery ( ) ; while ( rs . next ( ) && retValue == 0 ) { Timestamp plDate = rs . getTimestamp ( 2 ) ; if ( ! priceDate . before ( plDate ) ) retValue = rs . getInt ( 1 ) ; } rs . close ( ) ; pstmt . close ( ) ; } catch ( SQLException e ) { log . log ( Level . SEVERE , sql , e ) ; } Env . setContext ( Env . getCtx ( ) , p_WindowNo , "M_PriceList_Version_ID" , retValue ) ; return retValue ; } | Deserializes passed in bytes using provided class loader. |
2 | public static boolean memoryIsLow ( ) { return availableMemory ( ) * 100 < RUNTIME . totalMemory ( ) * 5 ; } | Validates a potential settings directory. This returns the validated directory, or throws an IOException if it can't be validated. |
3 | public String describeAttributes ( ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( "[" ) ; boolean first = true ; for ( Object key : attributes . keySet ( ) ) { if ( first ) { first = false ; } else { sb . append ( ", " ) ; } sb . append ( key ) ; sb . append ( "==" ) ; sb . append ( attributes . get ( key ) ) ; } sb . append ( "]" ) ; return sb . toString ( ) ; } | Returns a single value for option or null if not present. |
4 | public static byte [ ] nextBytes ( byte [ ] buffer ) { sRandom . nextBytes ( buffer ) ; return buffer ; } | Used to send SSDP packet |
5 | public void removeAllFromDamaged ( final Collection < Unit > damagedUnits ) { for ( final Unit u : damagedUnits ) { while ( m_damaged . contains ( u ) ) { m_damaged . remove ( u ) ; } } } | Clears the password reset state. |
6 | private IJavaElement [ ] computeChildren ( ArrayList namesWithoutExtension ) { int size = namesWithoutExtension . size ( ) ; if ( size == 0 ) return NO_ELEMENTS ; IJavaElement [ ] children = new IJavaElement [ size ] ; for ( int i = 0 ; i < size ; i ++ ) { String nameWithoutExtension = ( String ) namesWithoutExtension . get ( i ) ; children [ i ] = new ClassFile ( this , manager , nameWithoutExtension ) ; } return children ; } | Print the the trace of methods from where the error originated. This will trace all nested exception objects, as well as this object. |
7 | public Object [ ] toArray ( ) { Object [ ] result = new Object [ size ] ; System . arraycopy ( elementData , 0 , result , 0 , size ) ; return result ; } | Redraw a given table |
8 | private static int lastIndexOf ( Object o , Object [ ] elements , int index ) { if ( o == null ) { for ( int i = index ; i >= 0 ; i -- ) if ( elements [ i ] == null ) return i ; } else { for ( int i = index ; i >= 0 ; i -- ) if ( o . equals ( elements [ i ] ) ) return i ; } return - 1 ; } | Checks the reference to a type in a type annotation. |
9 | public static byte [ ] generateMac ( byte [ ] byteCipherText , SecretKey integrityKey ) throws NoSuchAlgorithmException , InvalidKeyException { Mac sha256_HMAC = Mac . getInstance ( HMAC_ALGORITHM ) ; sha256_HMAC . init ( integrityKey ) ; return sha256_HMAC . doFinal ( byteCipherText ) ; } | Tracks tunnelling to a proxy in a proxy chain. This will extend the tracked proxy chain, but it does not mark the route as tunnelled. Only end-to-end tunnels are considered there. |
10 | @ Override protected void onDeleteComplete ( int token , Object cookie , int result ) { if ( token == mDeleteToken ) { synchronized ( sDeletingThreadsLock ) { sDeletingThreads = false ; if ( DELETEDEBUG ) { Log . v ( TAG , "Conversation onDeleteComplete sDeletingThreads: " + sDeletingThreads ) ; } sDeletingThreadsLock . notifyAll ( ) ; } UnreadBadgeService . update ( mContext ) ; NotificationManager . create ( mContext ) ; } } | Sends SEND_SUCCESS automatically. As we're on our way out of the system at this point, there's no need to hold them up, or append anything new to the response. |
11 | public static double log10 ( double val ) { if ( val > 0.0 ) return Math . log10 ( val ) ; return HUGE_NEGATIVE ; } | This method must be called before batch updating of registers. |
12 | private static ILaunchConfiguration createNewLaunchConfiguration ( IProject project ) throws CoreException , OperationCanceledException { String initialName = calculateLaunchConfigName ( project ) ; ILaunchConfiguration launchConfig = GwtSuperDevModeCodeServerLaunchUtil . createLaunchConfig ( initialName , project ) ; return launchConfig ; } | Returns true if the substring of the receiver, in the range thisCurrent, thisLast matches the substring of selector in the ranme sCurrent to sLast based on CSS selector matching. |
13 | protected long parseDate ( ) throws IOException { if ( _utcCalendar == null ) _utcCalendar = Calendar . getInstance ( TimeZone . getTimeZone ( "UTC" ) ) ; return parseDate ( _utcCalendar ) ; } | Add an object id. |
14 | @ Override public Request < List < BuilderStatus > > builds ( ProjectReference projectReference ) { List < DummyBuilderStatus > current = currentBuilderStatuses . get ( projectReference . name ( ) ) ; List < BuilderStatus > update = new ArrayList < > ( ) ; if ( current != null ) { for ( DummyBuilderStatus dummyBuilderStatus : current ) { update . add ( dummyBuilderStatus ) ; } } return new DummyRequest < > ( update ) ; } | Open the datagram connection |
15 | public String lookahead ( ) { if ( buf != null ) { return new String ( buf , bufPos , buf . length - bufPos ) ; } else { return text . substring ( pos . getIndex ( ) ) ; } } | Instantiates a new Body sID byte offset pair. |
16 | protected int entityIndex ( Entity entity ) { return Arrays . binarySearch ( entities , entity ) ; } | Create a contact selector based on the native address book. This selector adds a default value to allow no contact selection |
17 | public void runTest ( ) throws Throwable { Document doc ; NodeList elementList ; Node nameNode ; CharacterData child ; doc = ( Document ) load ( "staff" , true ) ; elementList = doc . getElementsByTagName ( "address" ) ; nameNode = elementList . item ( 0 ) ; child = ( CharacterData ) nameNode . getFirstChild ( ) ; { boolean success = false ; try { child . insertData ( - 5 , "ABC" ) ; } catch ( DOMException ex ) { success = ( ex . code == DOMException . INDEX_SIZE_ERR ) ; } assertTrue ( "throws_INDEX_SIZE_ERR" , success ) ; } } | Check if two values are equal, and if not throw an exception. |
18 | public void testObsoleteDstZoneName ( ) throws Exception { SimpleDateFormat format = new SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm zzzz" , Locale . US ) ; Date normal = format . parse ( "1970-01-01T00:00 EET" ) ; Date dst = format . parse ( "1970-01-01T00:00 EEST" ) ; assertEquals ( 60 * 60 * 1000 , normal . getTime ( ) - dst . getTime ( ) ) ; } | Re-implementation of same method from org.apache.commons.collections.CollectionUtils. |
19 | public abstract boolean isLoggable ( Level level ) ; | Converts the contents of the segment to lower case. |
20 | public String replaceTokens ( String queryString , String replacement , String ... nonReplacementTokenPrefixes ) { Matcher matcher = tokenPattern . matcher ( queryString ) ; StringBuffer buf = new StringBuffer ( ) ; while ( matcher . find ( ) ) { String origToken = matcher . group ( 1 ) ; if ( origToken != null ) { matcher . appendReplacement ( buf , "" ) ; if ( tokenStartsWithPrefix ( origToken , nonReplacementTokenPrefixes ) ) { buf . append ( "${" + origToken + "}" ) ; } else { buf . append ( replacement ) ; } } } matcher . appendTail ( buf ) ; return buf . toString ( ) ; } | Prints information about the selected item into a graphical text window. |
21 | public boolean isPlural ( ) { return typeString . contains ( SUFFIX_PLURAL ) ; } | Sets the interval that a circuit breaker can see the latest accumulated count of events. |
22 | public void insert ( ForceItem item ) { try { insert ( item , root , xMin , yMin , xMax , yMax ) ; } catch ( StackOverflowError e ) { e . printStackTrace ( ) ; } } | Writes the tags from this ExifInterface object into a jpeg compressed bitmap, removing prior exif tags. |
23 | private void handleHovering ( int x , int y ) { handleCellHover ( x , y ) ; if ( columnHeadersVisible ) { handleHoverOnColumnHeader ( x , y ) ; } } | Whether the fullscreen keyboard should be used in landscape mode. |
24 | public static void drawCircledText ( Graphics2D g , Font font , String text , int x , int y ) { Graphics2D g2 = ( Graphics2D ) g . create ( ) ; g2 . setFont ( font ) ; FontMetrics fm = g2 . getFontMetrics ( ) ; int padding = 4 ; Rectangle2D bounds = fm . getStringBounds ( text , g2 ) ; double th = bounds . getHeight ( ) ; double tw = bounds . getWidth ( ) ; float radius = ( float ) ( Math . max ( th , tw ) / 2f + padding ) ; Ellipse2D . Float circle = new Ellipse2D . Float ( x - radius , y - radius , 2 * radius + 1 , 2 * radius + 1 ) ; g2 . fill ( circle ) ; g2 . setColor ( Color . BLACK ) ; g2 . drawString ( text , ( int ) ( x - tw / 2 ) , ( y + fm . getAscent ( ) / 2 ) ) ; if ( DEBUG ) { g2 . setColor ( Color . RED ) ; g2 . drawLine ( x - 50 , y , x + 50 , y ) ; g2 . drawLine ( x , y - 50 , x , y + 50 ) ; } g2 . dispose ( ) ; } | This method automatically closes a previous element (if not already closed). |
25 | private void registerEnd ( final String prefixSingular , final String prefixPlural , final String endString ) { prefixEndList . add ( new PrefixEntry ( endString , prefixSingular , prefixPlural ) ) ; registerPrefix ( prefixSingular , prefixPlural ) ; } | execute shell commands, default return result msg |
26 | public void addObserver ( Observer observer ) { observers . add ( observer ) ; } | Add download request to the download request queue. |
27 | public String toString ( ) { return "[PKCS #10 certificate request:\n" + subjectPublicKeyInfo . toString ( ) + " subject: <" + subject + ">" + "\n" + " attributes: " + attributeSet . toString ( ) + "\n]" ; } | Compare the dimension ID's from two factlines |
28 | public SystemPropertiesTableModel ( ) { columnNames = new String [ 2 ] ; columnNames [ 0 ] = res . getString ( "SystemPropertiesTableModel.NameColumn" ) ; columnNames [ 1 ] = res . getString ( "SystemPropertiesTableModel.ValueColumn" ) ; data = new Object [ 0 ] [ 0 ] ; } | Build reflect bytecode from accessor list. |
29 | public boolean cancelJob ( long id , boolean isPersistent ) { JobHolder holder ; synchronized ( getNextJobLock ) { if ( jobConsumerExecutor . isRunning ( id , isPersistent ) ) return false ; if ( isPersistent ) { synchronized ( persistentJobQueue ) { holder = persistentJobQueue . findJobById ( id ) ; if ( holder == null ) return false ; persistentJobQueue . remove ( holder ) ; } } else { synchronized ( nonPersistentJobQueue ) { holder = nonPersistentJobQueue . findJobById ( id ) ; if ( holder == null ) return false ; nonPersistentJobQueue . remove ( holder ) ; } } } BaseJob baseJob = holder . getBaseJob ( ) ; if ( dependencyInjector != null ) { dependencyInjector . inject ( baseJob ) ; } baseJob . onCancel ( ) ; return true ; } | Appends a parameter name |
30 | public static boolean isSimpleMatchPattern ( String str ) { return str . indexOf ( '*' ) != - 1 ; } | Parse the PIDF input |
31 | public String readScript ( String fname ) throws IOException { StringBuilder sb = new StringBuilder ( ) ; BufferedReader in = null ; try { if ( fname . startsWith ( "hdfs:" ) || fname . startsWith ( "gpfs:" ) ) { FileSystem fs = FileSystem . get ( ConfigurationManager . getCachedJobConf ( ) ) ; Path scriptPath = new Path ( fname ) ; in = new BufferedReader ( new InputStreamReader ( fs . open ( scriptPath ) ) ) ; } else { in = new BufferedReader ( new FileReader ( fname ) ) ; } String tmp = null ; while ( ( tmp = in . readLine ( ) ) != null ) { sb . append ( tmp ) ; sb . append ( "\n" ) ; } } finally { IOUtilFunctions . closeSilently ( in ) ; } return sb . toString ( ) ; } | Method generates key using Advanced Encryption Standard algorithm. |
32 | public static BinaryFieldAccessor create ( Field field , int id ) { BinaryWriteMode mode = BinaryUtils . mode ( field . getType ( ) ) ; switch ( mode ) { case P_BYTE : return new BytePrimitiveAccessor ( field , id ) ; case P_BOOLEAN : return new BooleanPrimitiveAccessor ( field , id ) ; case P_SHORT : return new ShortPrimitiveAccessor ( field , id ) ; case P_CHAR : return new CharPrimitiveAccessor ( field , id ) ; case P_INT : return new IntPrimitiveAccessor ( field , id ) ; case P_LONG : return new LongPrimitiveAccessor ( field , id ) ; case P_FLOAT : return new FloatPrimitiveAccessor ( field , id ) ; case P_DOUBLE : return new DoublePrimitiveAccessor ( field , id ) ; case BYTE : case BOOLEAN : case SHORT : case CHAR : case INT : case LONG : case FLOAT : case DOUBLE : case DECIMAL : case STRING : case UUID : case DATE : case TIMESTAMP : case BYTE_ARR : case SHORT_ARR : case INT_ARR : case LONG_ARR : case FLOAT_ARR : case DOUBLE_ARR : case CHAR_ARR : case BOOLEAN_ARR : case DECIMAL_ARR : case STRING_ARR : case UUID_ARR : case DATE_ARR : case TIMESTAMP_ARR : case ENUM_ARR : case OBJECT_ARR : case BINARY_OBJ : case BINARY : return new DefaultFinalClassAccessor ( field , id , mode , false ) ; default : return new DefaultFinalClassAccessor ( field , id , mode , ! U . isFinal ( field . getType ( ) ) ) ; } } | Is Table Client Level Only |
33 | private String result ( HttpURLConnection conn , boolean input ) throws IOException { StringBuffer sb = new StringBuffer ( ) ; if ( input ) { InputStream is = conn . getInputStream ( ) ; BufferedReader reader = new BufferedReader ( new InputStreamReader ( is , "utf-8" ) ) ; String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { sb . append ( line ) ; } reader . close ( ) ; is . close ( ) ; } Map < String , Object > result = new HashMap < String , Object > ( ) ; result . put ( "code" , conn . getResponseCode ( ) ) ; result . put ( "mesg" , conn . getResponseMessage ( ) ) ; result . put ( "type" , conn . getContentType ( ) ) ; result . put ( "data" , sb ) ; String output = String . valueOf ( conn . getResponseCode ( ) ) ; setOutputResponseCode ( output ) ; Gson gson = new Gson ( ) ; String json = gson . toJson ( result ) ; logger . info ( "json = " + json ) ; return json ; } | Escape XML entities and illegal characters in the given string. This enhances the functionality of org.apache.commons.lang.StringEscapeUtils.escapeXml by escaping low-valued unprintable characters, which are not permitted by the W3C XML 1.0 specification. |
34 | public boolean isBannedMethod ( String sig ) { return banned_methods . contains ( sig ) ; } | The java -help message is split into 3 parts, an invariant, followed by a set of platform dependent variant messages, finally an invariant set of lines. This method initializes the help message for the first time, and also assembles the invariant header part of the message. |
35 | private SendReturn send ( int messageType , String message ) throws InterruptedException , ExtractorException { String length = String . format ( "%d" , message . length ( ) ) ; String lenlen = String . format ( "%d" , length . length ( ) ) ; String type = String . format ( "%04d" , messageType ) ; String outMessage ; int bytesRead ; String replyString ; int ll ; int t ; SendReturn retval = new SendReturn ( ) ; boolean lengthKnown ; int totalBytesRead = 0 ; int totalBytesNeeded ; boolean longMessageSupport = true ; if ( ! connected ) throw new OracleExtractException ( "Not connected" ) ; outMessage = lenlen + length + type + message ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Sending Message type " + messageType ) ; logger . debug ( " - Message is -> " + message ) ; logger . debug ( " - Therefore sending -> " + outMessage ) ; } out . println ( outMessage ) ; if ( messageType != Const . MessageControl ) { try { if ( longMessageSupport ) { lengthKnown = false ; totalBytesRead = 0 ; totalBytesNeeded = 0 ; for ( ; ; ) { bytesRead = in . read ( replyBuffer , totalBytesRead , replyBufferSize - totalBytesRead - 1 ) ; if ( bytesRead == - 1 ) { throw new OracleExtractException ( "End of Stream" ) ; } totalBytesRead += bytesRead ; logger . debug ( "Read = " + bytesRead + " total = " + totalBytesRead + " needed = " + totalBytesNeeded ) ; if ( lengthKnown ) { if ( totalBytesRead >= totalBytesNeeded ) break ; else continue ; } if ( totalBytesRead <= 9 ) continue ; lengthKnown = true ; replyBuffer [ totalBytesRead ] = '\0' ; lengthBuffer [ 0 ] = replyBuffer [ 0 ] ; lengthBuffer [ 1 ] = replyBuffer [ 1 ] ; lengthBuffer [ 2 ] = replyBuffer [ 2 ] ; lengthBuffer [ 3 ] = replyBuffer [ 3 ] ; lengthBuffer [ 4 ] = replyBuffer [ 4 ] ; lengthBuffer [ 5 ] = replyBuffer [ 5 ] ; lengthBuffer [ 6 ] = replyBuffer [ 6 ] ; lengthBuffer [ 7 ] = replyBuffer [ 7 ] ; lengthBuffer [ 8 ] = replyBuffer [ 8 ] ; lengthBuffer [ 9 ] = replyBuffer [ 9 ] ; lengthBuffer [ 10 ] = '\0' ; String lengthString = new String ( lengthBuffer ) ; totalBytesNeeded = Integer . parseInt ( lengthString . substring ( 1 , 9 ) , 16 ) ; totalBytesNeeded += 13 ; if ( totalBytesNeeded + 1 > replyBufferSize ) increaseReplyBuffer ( totalBytesNeeded + 1 ) ; if ( totalBytesRead >= totalBytesNeeded ) break ; } } else { totalBytesRead = in . read ( replyBuffer ) ; } } catch ( ClosedByInterruptException e ) { throw new InterruptedException ( "Oracle extractor was interrupted" ) ; } catch ( IOException e ) { throw new OracleExtractException ( "End of Stream" ) ; } if ( totalBytesRead == - 1 ) { throw new OracleExtractException ( "End of Stream" ) ; } replyBuffer [ totalBytesRead ] = '\0' ; replyString = new String ( replyBuffer , 0 , totalBytesRead ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Reply = \"" + replyString + "\"\n" ) ; } ll = Integer . parseInt ( replyString . substring ( 0 , 1 ) ) ; t = Integer . parseInt ( replyString . substring ( 1 + ll , 1 + ll + 4 ) ) ; replyString = replyString . substring ( 1 + ll + 4 ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Reply = \"" + replyString + "\"\n" ) ; } retval . type = t ; retval . reply = replyString ; } else { retval . type = Const . ReplyReserved ; retval . reply = new String ( "Empty" ) ; } if ( retval . type == Const . ReplyError ) throw new OracleExtractException ( "Error from C Oracle Extractor" ) ; msgCount ++ ; return retval ; } | iterate over children recursively and do some operations |
36 | private float interpolate ( ) { long currTime = System . currentTimeMillis ( ) ; float elapsed = ( currTime - startTime ) / ZOOM_TIME ; elapsed = Math . min ( 1f , elapsed ) ; return interpolator . getInterpolation ( elapsed ) ; } | Gets whether the path is empty. |
37 | private void attachPlot ( SVGPlot newplot ) { this . plot = newplot ; if ( newplot == null ) { super . setSVGDocument ( null ) ; return ; } newplot . synchronizeWith ( synchronizer ) ; super . setSVGDocument ( newplot . getDocument ( ) ) ; super . setDisableInteractions ( newplot . getDisableInteractions ( ) ) ; } | Loader must be non-null; |
38 | void seek ( int position ) throws IOException { mDexFile . seek ( position ) ; } | Collects x-www-form-urlencoded body parameters as per OAuth Core 1.0 spec section 9.1.1 |
39 | public E take ( ) throws InterruptedException { final ReentrantLock lock = this . lock ; lock . lockInterruptibly ( ) ; try { for ( ; ; ) { E first = q . peek ( ) ; if ( first == null ) available . await ( ) ; else { long delay = first . getDelay ( NANOSECONDS ) ; if ( delay <= 0 ) return q . poll ( ) ; first = null ; if ( leader != null ) available . await ( ) ; else { Thread thisThread = Thread . currentThread ( ) ; leader = thisThread ; try { available . awaitNanos ( delay ) ; } finally { if ( leader == thisThread ) leader = null ; } } } } } finally { if ( leader == null && q . peek ( ) != null ) available . signal ( ) ; lock . unlock ( ) ; } } | Construct an evaluator for a given predicate expression. |
40 | public void shutdown ( ) throws Exception { try { if ( solrClient != null ) solrClient . close ( ) ; List < Callable < JettySolrRunner > > shutdowns = new ArrayList < > ( jettys . size ( ) ) ; for ( final JettySolrRunner jetty : jettys ) { shutdowns . add ( null ) ; } jettys . clear ( ) ; Collection < Future < JettySolrRunner > > futures = executor . invokeAll ( shutdowns ) ; Exception shutdownError = checkForExceptions ( "Error shutting down MiniSolrCloudCluster" , futures ) ; if ( shutdownError != null ) { throw shutdownError ; } } finally { executor . shutdown ( ) ; executor . awaitTermination ( 2 , TimeUnit . SECONDS ) ; try { if ( ! externalZkServer ) { zkServer . shutdown ( ) ; } } finally { System . clearProperty ( "zkHost" ) ; } } } | Just a trivial test of construction. This one merely makes sure that a valid construction doesn't fail. It doesn't try to verify anything about the constructed instance, other than checking for the existence of optimized dex files. |
41 | private static Control createRequestControl ( final Class clazz , final Class [ ] paramTypes , final Object [ ] params ) { Constructor constructor = ClassUtils . getConstructorIfAvailable ( clazz , paramTypes ) ; if ( constructor == null ) { LdapExceptionUtils . generateErrorException ( LdapErrorCodes . ERR_10005_CONTROL_CONTRUCTOR_NOT_FOUND , new String [ ] { clazz . toString ( ) , StringUtils . arrayToCommaDelimitedString ( paramTypes ) } , LOGGER ) ; } Control result = null ; try { result = ( Control ) constructor . newInstance ( params ) ; } catch ( Exception e ) { LdapExceptionUtils . generateErrorException ( LdapErrorCodes . ERR_10006_CONTROL_INSTANCE_FAILED , new String [ ] { clazz . toString ( ) , StringUtils . arrayToCommaDelimitedString ( paramTypes ) , StringUtils . arrayToCommaDelimitedString ( params ) } , LOGGER , e ) ; } return result ; } | Check whether the given Enumeration contains the given element. |
42 | private static boolean isInCornerTargetZone ( float x , float y , float handleX , float handleY , float targetRadius ) { return Math . abs ( x - handleX ) <= targetRadius && Math . abs ( y - handleY ) <= targetRadius ; } | Write the entry in LDIF form to System.out. |
43 | public boolean isNewState ( ) { return fileName . equals ( "" ) ; } | Creates the instances panel with no initial instances. |
44 | public boolean offer ( E e ) { final ReentrantLock lock = this . lock ; lock . lock ( ) ; try { q . offer ( e ) ; if ( q . peek ( ) == e ) { leader = null ; available . signal ( ) ; } return true ; } finally { lock . unlock ( ) ; } } | Reorder and merge like edit sections. Merge equalities. Any edit section can move as long as it doesn't cross an equality. |
45 | public void updateLeagueHistory ( ) { Collections . sort ( teamList , new TeamCompPoll ( ) ) ; String [ ] yearTop10 = new String [ 10 ] ; Team tt ; for ( int i = 0 ; i < 10 ; ++ i ) { tt = teamList . get ( i ) ; yearTop10 [ i ] = tt . abbr + " (" + tt . wins + "-" + tt . losses + ")" ; } leagueHistory . add ( yearTop10 ) ; } | Create an outgoing multicast query or response. |
46 | public SuffixFileFilter ( String [ ] suffixes , IOCase caseSensitivity ) { if ( suffixes == null ) { throw new IllegalArgumentException ( "The array of suffixes must not be null" ) ; } this . suffixes = new String [ suffixes . length ] ; System . arraycopy ( suffixes , 0 , this . suffixes , 0 , suffixes . length ) ; this . caseSensitivity = caseSensitivity == null ? IOCase . SENSITIVE : caseSensitivity ; } | Bitwise equality comparison. DER encoded values have a single encoding, so that bitwise equality of the encoded values is an efficient way to establish equivalence of the unencoded values. |
47 | private void updateFont ( ) { String fontName = fontList . getValue ( ) ; Integer fontSize = FALLBACK_FONT_SIZE ; try { fontSize = Integer . parseInt ( fontSizeList . getValue ( ) ) ; } catch ( NumberFormatException ex ) { } font = new Font ( fontName , Font . PLAIN , fontSize ) ; preview . setFont ( font ) ; } | Static helper method for populating attributes from a database cursor. |
48 | public static Properties readPropertyFileFromFileSystem ( final File propertyFileLocation ) throws ConfigurationException { final Properties fileProperties = new Properties ( ) ; try { final InputStream inputStream = new FileInputStream ( propertyFileLocation ) ; fileProperties . load ( inputStream ) ; inputStream . close ( ) ; } catch ( IOException e ) { throw new ConfigurationException ( "Cannot load the properties file" , e ) ; } return fileProperties ; } | Method to handle update button |
49 | public void addTranslator ( ClassPool cp , Translator t ) throws NotFoundException , CannotCompileException { source = cp ; translator = t ; t . start ( cp ) ; } | Calculates the lighting of the item based on rotation. |
50 | public void test_GetCurve ( ) { assertEquals ( "wrong elliptic curve" , curve , ecps . getCurve ( ) ) ; } | Adds another ImageContainer to the list of those interested in the results of the request. |
51 | @ Override public void close ( ) throws IOException { fInputStream . close ( ) ; } | Initializes the disk cache. Note that this includes disk access so this should not be executed on the main/UI thread. By default an ImageProvider does not initialize the disk cache when it is created, instead you should call initDiskCache() to initialize it on a background thread. |
52 | public static void sleep ( ) { try { Thread . sleep ( TestSettings . RESPONSE_WAIT ) ; } catch ( InterruptedException e ) { } } | Prints a short integer to standard output and flushes standard output. |
53 | public void add ( URI uri , HttpCookie cookie ) { if ( cookie == null ) { throw new NullPointerException ( "cookie is null" ) ; } lock . lock ( ) ; try { cookieJar . remove ( cookie ) ; if ( cookie . getMaxAge ( ) != 0 ) { cookieJar . add ( cookie ) ; if ( cookie . getDomain ( ) != null ) { addIndex ( domainIndex , cookie . getDomain ( ) , cookie ) ; } if ( uri != null ) { addIndex ( uriIndex , getEffectiveURI ( uri ) , cookie ) ; } } } finally { lock . unlock ( ) ; } } | Make a new model instance. |
54 | public void delete ( RandomAccessFile raf , RandomAccessFile tempRaf ) throws IOException , CannotWriteException { FlacTag emptyTag = new FlacTag ( null , new ArrayList < MetadataBlockDataPicture > ( ) ) ; raf . seek ( 0 ) ; tempRaf . seek ( 0 ) ; write ( emptyTag , raf , tempRaf ) ; } | Returns whether the current access token is valid |
55 | void show ( Rectangle bounds ) { if ( ! isCreated ( ) ) { return ; } if ( log . isLoggable ( PlatformLogger . Level . FINER ) ) { log . finer ( "showing menu window + " + getWindow ( ) + " at " + bounds ) ; } XToolkit . awtLock ( ) ; try { reshape ( bounds . x , bounds . y , bounds . width , bounds . height ) ; xSetVisible ( true ) ; toFront ( ) ; selectItem ( getFirstSelectableItem ( ) , false ) ; } finally { XToolkit . awtUnlock ( ) ; } } | Returns the union of the two specified collection of IDs. |
56 | void downcase ( final StringBuffer text , final int leng ) { for ( int i = 0 ; i < leng ; i ++ ) { if ( Character . isUpperCase ( text . charAt ( i ) ) ) { text . setCharAt ( i , Character . toLowerCase ( text . charAt ( i ) ) ) ; } } } | Returns a string representation of this identifier. |
57 | public int indexOfKey ( Object key ) { return key == null ? indexOfNull ( ) : indexOf ( key , key . hashCode ( ) ) ; } | Runs the callback on all switch nodes within the aggregate (WILL BE ONLY ONE). |
58 | public void releaseExternalResources ( ) { if ( ! isClosed . get ( ) ) { logger . info ( "Releasing all ParallelClient resources... " ) ; ActorConfig . shutDownActorSystemForce ( ) ; httpClientStore . shutdown ( ) ; tcpSshPingResourceStore . shutdown ( ) ; taskManager . cleanWaitTaskQueue ( ) ; taskManager . cleanInprogressJobMap ( ) ; isClosed . set ( true ) ; logger . info ( "Have released all ParallelClient resources " + "(actor system + async+sync http client + task queue)" + "\nNow safe to stop your application." ) ; } else { logger . debug ( "NO OP. ParallelClient resources have already been released." ) ; } } | Adds a correlation set to this interpreter. |
59 | @ Override public Enumeration < Option > listOptions ( ) { Vector < Option > newVector = new Vector < Option > ( 4 ) ; newVector . addElement ( new Option ( "\tSpecify the random number seed (default 1)" , "S" , 1 , "-S <num>" ) ) ; newVector . addElement ( new Option ( "\tThe maximum class distribution spread.\n" + "\t0 = no maximum spread, 1 = uniform distribution, 10 = allow at most\n" + "\ta 10:1 ratio between the classes (default 0)" , "M" , 1 , "-M <num>" ) ) ; newVector . addElement ( new Option ( "\tAdjust weights so that total weight per class is maintained.\n" + "\tIndividual instance weighting is not preserved. (default no\n" + "\tweights adjustment" , "W" , 0 , "-W" ) ) ; newVector . addElement ( new Option ( "\tThe maximum count for any class value (default 0 = unlimited).\n" , "X" , 0 , "-X <num>" ) ) ; return newVector . elements ( ) ; } | State3 Allocate - Commit - Free - Commit Tracks writeCache state through allocation |
60 | public BatchedImageRequest ( Request < ? > request , ImageContainer container ) { mRequest = request ; mContainers . add ( container ) ; } | Closes the cache and deletes all of its stored values. This will delete all files in the cache directory including files that weren't created by the cache. |
61 | @ Override public IScanListIterator < IEntryCacheInfo > establishScan ( K startPos , short relation , K endPos , boolean endPosInclusive , boolean ordered ) { ordered |= FORCE_ORDERED_SCAN ; long startTime = _recentExtendedIndexUpdates != null ? System . currentTimeMillis ( ) : 0 ; IScanListIterator < IEntryCacheInfo > res = ordered ? establishScanOrdered ( startPos , relation , endPos , endPosInclusive ) : establishScanUnOrdered ( startPos , relation , endPos , endPosInclusive ) ; if ( _recentExtendedIndexUpdates != null && ! _recentExtendedIndexUpdates . isEmpty ( ) ) { MultiStoredList < IEntryCacheInfo > msl = new MultiStoredList < IEntryCacheInfo > ( ) ; msl . add ( res ) ; msl . add ( _recentExtendedIndexUpdates . iterator ( startTime , ( ExtendedIndexIterator ) res ) ) ; return msl ; } else return res ; } | Scan the list of controllers to see if an existing controller can be reused. If not, create a new one. Controllers can be reused if the directory is the same. If a controller is found that matches directory and device then terminate the app on that device and select that controller. NB: Currently controllers are not shared due to limitations of the debugger. |
62 | public static BytesToNameCanonicalizer createRoot ( ) { long now = System . currentTimeMillis ( ) ; int seed = ( ( ( int ) now ) + ( ( int ) now > > > 32 ) ) | 1 ; return createRoot ( seed ) ; } | HTML-escapes the String representation of the given Object. |
63 | public void fillFieldValues ( List < SynapseUpdateRule > ruleList ) { HebbianRule synapseRef = ( HebbianRule ) ruleList . get ( 0 ) ; if ( ! NetworkUtils . isConsistent ( ruleList , HebbianRule . class , "getLearningRate" ) ) { tfLearningRate . setText ( SimbrainConstants . NULL_STRING ) ; } else { tfLearningRate . setText ( Double . toString ( synapseRef . getLearningRate ( ) ) ) ; } } | Partitions the instances around a pivot. Used by quicksort and kthSmallestValue. |
64 | public static int countArgumentPlaceholders ( final String messagePattern ) { if ( messagePattern == null ) { return 0 ; } final int delim = messagePattern . indexOf ( DELIM_START ) ; if ( delim == - 1 ) { return 0 ; } int result = 0 ; boolean isEscaped = false ; for ( int i = 0 ; i < messagePattern . length ( ) ; i ++ ) { final char curChar = messagePattern . charAt ( i ) ; if ( curChar == ESCAPE_CHAR ) { isEscaped = ! isEscaped ; } else if ( curChar == DELIM_START ) { if ( ! isEscaped && i < messagePattern . length ( ) - 1 && messagePattern . charAt ( i + 1 ) == DELIM_STOP ) { result ++ ; i ++ ; } isEscaped = false ; } else { isEscaped = false ; } } return result ; } | Notifies the ClientsManager that these requests were already executed. |
65 | protected abstract boolean isEndOfChunk ( char currPrefix , String currLabel , char nextPrefix , String nextLabel ) ; | Creates an Oid object from its ASN.1 DER encoding. This refers to the full encoding including tag and length. The structure and encoding of Oids is defined in ISOIEC-8824 and ISOIEC-8825. This method is identical in functionality to its byte array counterpart. |
66 | public void clear ( ) { set . clear ( ) ; fireContentsChanged ( this , 0 , 0 ) ; } | Constructs a position component from given point. |
67 | static String toString ( @ NotNull final Bytes buffer , long position , long len ) throws BufferUnderflowException { final long pos = buffer . readPosition ( ) ; final long limit = buffer . readLimit ( ) ; buffer . readPositionRemaining ( position , len ) ; try { final StringBuilder builder = new StringBuilder ( ) ; while ( buffer . readRemaining ( ) > 0 ) { builder . append ( ( char ) buffer . readByte ( ) ) ; } return builder . toString ( ) ; } finally { buffer . readLimit ( limit ) ; buffer . readPosition ( pos ) ; } } | Writes a string. This method cannot be inherited from the Writer class because it must suppress I/O exceptions. |
68 | void collectUnresponsiveMembers ( Set s ) { if ( stillWaiting ( ) ) { InternalDistributedMember [ ] memberList = getMembers ( ) ; synchronized ( memberList ) { for ( int i = 0 ; i < memberList . length ; i ++ ) { InternalDistributedMember m = memberList [ i ] ; if ( m != null ) { s . add ( m ) ; } } } } } | Returns the number of mappings in this ActivityMap. Does not include mappings stored in the parent map. |
69 | private void initFromAuthHeader ( String authHeader ) { this . authHeader = authHeader ; if ( authHeader == null ) throw new NullPointerException ( "No authentication header information" ) ; Matcher authMatcher = SCHEME_PATTERN . matcher ( authHeader ) ; if ( ! authMatcher . matches ( ) ) { throw new IllegalStateException ( "Unable to parse auth header: " + authHeader ) ; } scheme = authMatcher . group ( 1 ) ; if ( authMatcher . groupCount ( ) > 1 ) { Matcher paramMatcher = PARAM_PATTERN . matcher ( authMatcher . group ( 2 ) ) ; while ( paramMatcher . find ( ) ) { String value = paramMatcher . group ( 2 ) ; if ( value == null ) { value = paramMatcher . group ( 3 ) ; } parameters . put ( paramMatcher . group ( 1 ) , value ) ; } } } | Removes the element at index ix from array, creating a new array. |
70 | public String toString ( ) { String s = "KeyIdentifier [\n" ; HexDumpEncoder encoder = new HexDumpEncoder ( ) ; s += encoder . encodeBuffer ( octetString ) ; s += "]\n" ; return ( s ) ; } | Adds a statement to the batch. |
71 | public static void addStartupListener ( StartUpListener s ) { s_startupListeners . add ( s ) ; } | Removes all highlighting information of the given level. |
72 | public void testWrite2 ( ) throws Exception { byte [ ] data = new byte [ ] { - 127 , - 100 , - 50 , - 10 , - 1 , 0 , 1 , 10 , 50 , 127 } ; TestOutputStream tos = new TestOutputStream ( ) ; CipherOutputStream cos = new CipherOutputStream ( tos , new NullCipher ( ) ) ; cos . write ( data ) ; cos . flush ( ) ; byte [ ] result = tos . toByteArray ( ) ; if ( ! Arrays . equals ( result , data ) ) { fail ( "CipherOutputStream wrote incorrect data." ) ; } try { cos . write ( null ) ; fail ( "NullPointerException expected" ) ; } catch ( NullPointerException e ) { } } | Register a class alias. |
73 | @ VisibleForTesting static boolean shouldOpenAfterDownload ( DownloadInfo downloadInfo ) { String type = downloadInfo . getMimeType ( ) ; return downloadInfo . hasUserGesture ( ) && ! isAttachment ( downloadInfo . getContentDisposition ( ) ) && MIME_TYPES_TO_OPEN . contains ( type ) ; } | Calls the C function exit, with an optional code, to terminate the host program. |
74 | @ Transactional public void save ( final List < WorkFlowMatrix > actualWorkFlowMatrixDetails , final String [ ] departments ) { for ( final String dept : departments ) { for ( final WorkFlowMatrix workFlowMatrix : actualWorkFlowMatrixDetails ) { final WorkFlowMatrix wfObj = workFlowMatrix . clone ( ) ; if ( dept . equals ( DEFAULT ) ) { wfObj . setDepartment ( "ANY" ) ; } else { wfObj . setDepartment ( dept ) ; } workflowMatrixRepository . save ( wfObj ) ; } } } | Constructs a new map with the same mappings as the given map. The map is created with a capacity of twice the number of mappings in the given map or 11 (whichever is greater), and a default load factor, which is 0.75. |
75 | public void write ( String file ) throws Exception { write ( new File ( file ) ) ; } | Collects statistics about database connection memory usage, in the case where the caller might not actually own the connection. |
76 | private static boolean fieldsEqual ( Object a , Object b ) { return a == b || ( a != null && a . equals ( b ) ) ; } | a random avaiable port between start and end |
77 | private boolean extraEntity ( String outputString , int charToMap ) { boolean extra = false ; if ( charToMap < ASCII_MAX ) { switch ( charToMap ) { case '"' : if ( ! outputString . equals ( """ ) ) extra = true ; break ; case '&' : if ( ! outputString . equals ( "&" ) ) extra = true ; break ; case '<' : if ( ! outputString . equals ( "<" ) ) extra = true ; break ; case '>' : if ( ! outputString . equals ( ">" ) ) extra = true ; break ; default : extra = true ; } } return extra ; } | Does the escaping of tag values. This function assumes you'll put double quotes ('"') around your tag value. |
78 | public static String quoteIfNeeded ( String s , String delim ) { if ( s == null ) return null ; if ( s . length ( ) == 0 ) return "\"\"" ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { char c = s . charAt ( i ) ; if ( c == '\\' || c == '"' || c == '\'' || Character . isWhitespace ( c ) || delim . indexOf ( c ) >= 0 ) { StringBuffer b = new StringBuffer ( s . length ( ) + 8 ) ; quote ( b , s ) ; return b . toString ( ) ; } } return s ; } | After rotating, the matrix needs to be translated. This function finds the area of image which was previously centered and adjusts translations so that is again the center, post-rotation. |
79 | public static void report ( ) { if ( License . isDeveloper ( ) ) { for ( final Object obj : SPIES ) { Diagnostic . developerLog ( obj . toString ( ) ) ; } } } | Uppercases the first character of a string. |
80 | @ Deprecated public void write ( byte b [ ] , int off , int len ) { if ( len < 0 ) throw new ArrayIndexOutOfBoundsException ( len ) ; for ( int i = 0 ; i < len ; ++ i ) write ( b [ off + i ] ) ; } | Actions a Pull Event |
81 | public void or ( Criteria criteria ) { oredCriteria . add ( criteria ) ; } | Converts from JDK Date to DateUnit |
82 | public final void testNextBytesbyteArray03 ( ) throws NoSuchAlgorithmException , NoSuchProviderException { SecureRandom sr1 ; SecureRandom sr2 ; byte [ ] myBytes1 ; byte [ ] myBytes2 ; for ( int i = 1 ; i < LENGTH / 2 ; i += INCR ) { sr1 = SecureRandom . getInstance ( algorithm , provider ) ; sr2 = SecureRandom . getInstance ( algorithm , provider ) ; boolean flag = true ; myBytes1 = new byte [ i ] ; myBytes2 = new byte [ i ] ; sr1 . nextBytes ( myBytes1 ) ; sr2 . nextBytes ( myBytes2 ) ; for ( int j = 0 ; j < i ; j ++ ) { flag &= myBytes1 [ j ] == myBytes2 [ j ] ; } sr1 . nextBytes ( myBytes1 ) ; sr2 . nextBytes ( myBytes2 ) ; for ( int j = 0 ; j < i ; j ++ ) { flag &= myBytes1 [ j ] == myBytes2 [ j ] ; } if ( flag ) { fail ( "TESTING RANDOM NUMBER GENERATOR QUALITY: IGNORE THIS FAILURE IF INTERMITTENT :: i=" + i ) ; } } } | We only rebuild the journal when it will halve the size of the journal and eliminate at least 2000 ops. |
83 | public Cursor query ( SQLiteDatabase db , String [ ] projectionIn , String selection , String [ ] selectionArgs , String groupBy , String having , String sortOrder , String limit ) { if ( mTables == null ) { return null ; } if ( mStrict && selection != null && selection . length ( ) > 0 ) { String sqlForValidation = buildQuery ( projectionIn , "(" + selection + ")" , groupBy , having , sortOrder , limit ) ; validateSql ( db , sqlForValidation ) ; } String sql = buildQuery ( projectionIn , selection , groupBy , having , sortOrder , limit ) ; return db . rawQueryWithFactory ( mFactory , sql , selectionArgs , SQLiteDatabase . findEditTable ( mTables ) ) ; } | Hides the splash screen, closes the window, and releases all associated resources. |
84 | private static String replaceChars ( String str ) { StringBuffer buf = new StringBuffer ( str ) ; int length = buf . length ( ) ; for ( int i = 0 ; i < length ; i ++ ) { char currentChar = buf . charAt ( i ) ; if ( currentChar == ' ' ) { buf . setCharAt ( i , '%' ) ; buf . insert ( i + 1 , "20" ) ; length = length + 2 ; i = i + 2 ; } else if ( currentChar == '\\' ) { buf . setCharAt ( i , '/' ) ; } } return buf . toString ( ) ; } | Close the Closeable. Ignore any problems that might occur. |
85 | public boolean isPaused ( ) { return false ; } | Check for equality of two Expression objects. |
86 | public Builder trustCertificates ( KeyStore trustStore ) throws GeneralSecurityException { SSLContext sslContext = SslUtils . getTlsSslContext ( ) ; SslUtils . initSslContext ( sslContext , trustStore , SslUtils . getPkixTrustManagerFactory ( ) ) ; return setSslSocketFactory ( sslContext . getSocketFactory ( ) ) ; } | Returns the minimum value. If either value is NaN, the other value is returned. If both are NaN, NaN is returned. |
87 | public void rejectReInvite ( int code ) { if ( sLogger . isActivated ( ) ) { sLogger . debug ( "ReInvite has been rejected" ) ; } synchronized ( mWaitUserAnswer ) { mReInviteStatus = InvitationStatus . INVITATION_REJECTED ; mWaitUserAnswer . notifyAll ( ) ; } } | Removes the listener, see addWebEventListener for details |
88 | public static Point parsePoint ( String str , SpatialContext ctx ) throws InvalidShapeException { try { double x , y ; str = str . trim ( ) ; int commaIdx = str . indexOf ( ',' ) ; if ( commaIdx == - 1 ) { int spaceIdx = str . indexOf ( ' ' ) ; if ( spaceIdx == - 1 ) throw new InvalidShapeException ( "Point must be in 'lat, lon' or 'x y' format: " + str ) ; int middleEndIdx = findIndexNotSpace ( str , spaceIdx + 1 , + 1 ) ; x = Double . parseDouble ( str . substring ( 0 , spaceIdx ) ) ; y = Double . parseDouble ( str . substring ( middleEndIdx ) ) ; } else { int middleStartIdx = findIndexNotSpace ( str , commaIdx - 1 , - 1 ) ; int middleEndIdx = findIndexNotSpace ( str , commaIdx + 1 , + 1 ) ; y = Double . parseDouble ( str . substring ( 0 , middleStartIdx + 1 ) ) ; x = Double . parseDouble ( str . substring ( middleEndIdx ) ) ; } x = ctx . normX ( x ) ; y = ctx . normY ( y ) ; return ctx . makePoint ( x , y ) ; } catch ( InvalidShapeException e ) { throw e ; } catch ( Exception e ) { throw new InvalidShapeException ( e . toString ( ) , e ) ; } } | Dumps this message in a string. |
89 | public boolean isPrune ( ) { return prune ; } | Writes the characters from the specified string to the target. |
90 | public void enqueueNormal ( String methodName , int count ) { Deque < InvocationHandler > handlers = getHandlers ( methodName ) ; for ( int i = 0 ; i < count ; i ++ ) { handlers . add ( delegateHandler ) ; } } | Verifies that one or more of needles are contained in value. This is case insensitive |
91 | @ SuppressWarnings ( "unchecked" ) @ Override protected Object readPostProcess ( Object o ) throws Exception { Enumeration < Object > enm ; Vector < Vector < ? > > deserialized ; Object key ; deserialized = ( Vector < Vector < ? > > ) super . readPostProcess ( o ) ; rebuildBeanConnections ( deserialized , REGULAR_CONNECTION ) ; enm = m_BeanConnectionRelation . keys ( ) ; while ( enm . hasMoreElements ( ) ) { key = enm . nextElement ( ) ; if ( ! ( key instanceof MetaBean ) ) { continue ; } rebuildBeanConnections ( deserialized , key ) ; } if ( getDataType ( ) == DATATYPE_USERCOMPONENTS ) { removeUserToolBarBeans ( deserialized ) ; } return deserialized ; } | computes the correlation coefficient |
92 | public static boolean canSee ( IGame game , Entity ae , Targetable target ) { return canSee ( game , ae , target , true , null , null ) ; } | Saving method. (see NBT_Tag) |
93 | @ Override void toXML ( StringBuilder xml , int level ) { indent ( xml , level ) ; xml . append ( "<string>" ) ; for ( int i = 0 ; i < bytes . length ; i ++ ) { byte b = bytes [ i ] ; if ( b < 16 ) xml . append ( '0' ) ; xml . append ( Integer . toHexString ( b ) ) ; } xml . append ( "</string>" ) ; } | Converts an HTTP header name to a selector compatible property name. '-' character is converted to '$'. The return property name will also be all lower case with an "http_" prepended. For example "Content-Type" would be converted to "http_content$type"; |
94 | public final int readLine ( char [ ] buf , int length , boolean isChop ) throws IOException { byte [ ] readBuffer = _readBuffer ; int offset = 0 ; while ( true ) { int readOffset = _readOffset ; int sublen = Math . min ( length , _readLength - readOffset ) ; for ( ; sublen > 0 ; sublen -- ) { int ch = readBuffer [ readOffset ++ ] & 0xff ; if ( ch != '\n' ) { } else if ( isChop ) { _readOffset = readOffset ; if ( offset > 0 && buf [ offset - 1 ] == '\r' ) return offset - 1 ; else return offset ; } else { buf [ offset ++ ] = ( char ) ch ; _readOffset = readOffset ; return offset + 1 ; } buf [ offset ++ ] = ( char ) ch ; } _readOffset = readOffset ; if ( readOffset <= _readLength ) { if ( ! readBuffer ( ) ) { return offset ; } } if ( length <= offset ) return length + 1 ; } } | Initialize the Diffie-Hellman keys. This method is not thread safe |
95 | public static void gotoOffset ( final CDebugPerspectiveModel model , final IAddress offset , final boolean focusMemoryWindow ) { model . setActiveMemoryAddress ( offset , focusMemoryWindow ) ; } | A regular translation from a data value to a Java2D value. |
96 | public List < AbstractCondition > toConditionsList ( ) { List < AbstractCondition > list = new ArrayList < > ( ) ; for ( Node < AbstractCondition > node : toList ( ) ) { list . add ( node . getData ( ) ) ; } return list ; } | Construct and create a Graph that can be used to separate specific plotters to their own graphs on the metrics website. Plotters can be added to the graph object returned. |
97 | protected void initBatchBuffer ( ) { try { if ( ! isIncremental ( ) ) { m_BatchBuffer = m_Loader . getDataSet ( ) ; } else { m_BatchBuffer = null ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } } | Add a group of methods to this class as miranda methods. For a definition of Miranda methods, see the comment above the method addMirandaMethods() in the file sun/tools/java/ClassDeclaration.java |
98 | public BigdataSailRepositoryConnection cxn ( ) { return tlTx . get ( ) ; } | removes a specific payment info from the list |
99 | public void processConnection ( DataInputStream dis , DataOutputStream dosParam ) throws IOException , Exception { GZIPOutputStream gzip = new GZIPOutputStream ( new BufferedOutputStream ( dosParam ) ) ; DataOutputStream dos = new DataOutputStream ( gzip ) ; byte responseStatus = ResponseStatus . STATUS_ERROR ; try { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; String name = dis . readUTF ( ) ; String pw = dis . readUTF ( ) ; String serializer = dis . readUTF ( ) ; @ SuppressWarnings ( "unused" ) String locale = dis . readUTF ( ) ; byte action = dis . readByte ( ) ; Context . openSession ( ) ; try { Context . authenticate ( name , pw ) ; } catch ( ContextAuthenticationException ex ) { responseStatus = ResponseStatus . STATUS_ACCESS_DENIED ; } if ( responseStatus != ResponseStatus . STATUS_ACCESS_DENIED ) { DataOutputStream dosTemp = new DataOutputStream ( baos ) ; if ( action == ACTION_DOWNLOAD_PATIENTS ) downloadPatients ( String . valueOf ( dis . readInt ( ) ) , dosTemp , serializer , false ) ; else if ( action == ACTION_DOWNLOAD_SS_PATIENTS ) downloadPatients ( String . valueOf ( dis . readInt ( ) ) , dosTemp , serializer , true ) ; else if ( action == ACTION_DOWNLOAD_COHORTS ) PatientDownloadManager . downloadCohorts ( dosTemp , serializer ) ; else if ( action == ACTION_DOWNLOAD_SAVED_SEARCHES ) PatientDownloadManager . downloadSavesSearches ( dosTemp , serializer ) ; else if ( action == ACTION_DOWNLOAD_FORMS ) XformDownloadManager . downloadXforms ( dosTemp , serializer ) ; else if ( action == ACTION_UPLOAD_FORMS ) submitXforms ( dis , dosTemp , serializer ) ; else if ( action == ACTION_DOWNLOAD_USERS ) UserDownloadManager . downloadUsers ( dosTemp , serializer ) ; else if ( action == ACTION_DOWNLOAD_USERS_AND_FORMS ) downloadUsersAndForms ( dosTemp , serializer ) ; else if ( action == ACTION_DOWNLOAD_FILTERED_PATIENTS ) downloadPatients ( dis . readUTF ( ) , dis . readUTF ( ) , dosTemp , serializer ) ; responseStatus = ResponseStatus . STATUS_SUCCESS ; } dos . writeByte ( responseStatus ) ; if ( responseStatus == ResponseStatus . STATUS_SUCCESS ) dos . write ( baos . toByteArray ( ) ) ; dos . close ( ) ; gzip . finish ( ) ; } catch ( Exception ex ) { log . error ( ex . getMessage ( ) , ex ) ; try { dos . writeByte ( responseStatus ) ; dos . flush ( ) ; gzip . finish ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } finally { Context . closeSession ( ) ; } } | Wait for all the files to be sent to host system. |
End of preview. Expand
in Dataset Viewer.
No dataset card yet
New: Create and edit this dataset card directly on the website!
Contribute a Dataset Card- Downloads last month
- 8