Changeset e67dd15


Ignore:
Timestamp:
Aug 12, 2012 11:19:49 AM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
cfcafd2
Parents:
a76f840
Message:
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/gnu/crypto/prng/BasePRNGStandalone.java

    ra76f840 re67dd15  
    126126                                                  + length + " limit=" + out.length);
    127127
     128      if (buffer == null)
     129          throw new IllegalStateException("Random is shut down - do you have a static ref?");
    128130      if (ndx >= buffer.length) {
    129131         fillBlock();
     
    163165
    164166   private byte nextByteInternal() {//throws LimitReachedException {
     167      if (buffer == null)
     168          throw new IllegalStateException("Random is shut down - do you have a static ref?");
    165169      if (ndx >= buffer.length) {
    166170         this.fillBlock();
  • router/java/src/net/i2p/router/peermanager/CapacityCalculator.java

    ra76f840 re67dd15  
    99 */
    1010class CapacityCalculator {
    11     private static final I2PAppContext _context = I2PAppContext.getGlobalContext();
    1211   
    1312    public static final String PROP_COUNTRY_BONUS = "profileOrganizer.sameCountryBonus";
     
    5554        // now take into account non-rejection tunnel rejections (which haven't
    5655        // incremented the rejection counter, since they were only temporary)
    57         long now = _context.clock().now();
     56        I2PAppContext context = profile.getContext();
     57        long now = context.clock().now();
    5858        if (profile.getTunnelHistory().getLastRejectedTransient() > now - 5*60*1000)
    5959            capacity = 1;
    6060        else if (profile.getTunnelHistory().getLastRejectedProbabalistic() > now - 5*60*1000)
    61             capacity -= _context.random().nextInt(5);
     61            capacity -= context.random().nextInt(5);
    6262
    6363        // boost new profiles
     
    7070        if (profile.isSameCountry()) {
    7171            double bonus = BONUS_SAME_COUNTRY;
    72             String b = _context.getProperty(PROP_COUNTRY_BONUS);
     72            String b = context.getProperty(PROP_COUNTRY_BONUS);
    7373            if (b != null) {
    7474                try {
  • router/java/src/net/i2p/router/peermanager/PeerProfile.java

    ra76f840 re67dd15  
    531531    void setIsFailing(boolean val) { _isFailing = val; }
    532532   
     533    /**
     534     *  Helper for calculators
     535     *  @since 0.9.2
     536     */
     537    RouterContext getContext() {
     538        return _context;
     539    }
     540
    533541    @Override
    534542    public int hashCode() { return _peer.hashCode(); }
     
    575583     *
    576584     */
     585/****
    577586    public static void main(String args[]) {
    578587        RouterContext ctx = new RouterContext(new net.i2p.router.Router());
     
    584593        testProfileSize(ctx, 0, 300000);  // 63MB
    585594    }
     595****/
    586596   
    587597    /**
     
    591601     * </pre>
    592602     */
     603/****
    593604    public static void main2(String args[]) {
    594605        RouterContext ctx = new RouterContext(new net.i2p.router.Router());
     
    655666        Runtime.getRuntime().gc();
    656667    }
     668****/
    657669}
Note: See TracChangeset for help on using the changeset viewer.