Changeset 9a836ed


Ignore:
Timestamp:
May 25, 2011 5:09:29 PM (9 years ago)
Author:
kytv <kytv@…>
Branches:
master
Children:
075f89f
Parents:
2accbdc (diff), 5526087 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge of '0ab9435836f60e748b89344771eea555219e6262'

and '13180c845a0d2cce619be3b9b139295f2ff49ece'

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/freenet/support/CPUInformation/CPUID.java

    r2accbdc r9a836ed  
    613613     */
    614614    private static final boolean loadFromResource() {
    615         URL resource = null;
    616615        // try 64 bit first, if getResourceName64() returns non-null
    617616        String resourceName = getResourceName64();
    618         if (resourceName != null)
    619             resource = CPUID.class.getClassLoader().getResource(resourceName);
     617        if (resourceName != null) {
     618            boolean success = extractLoadAndCopy(resourceName);
     619            if (success)
     620                return true;
     621        }
    620622       
    621         if (resource == null) {
    622             // now try 32 bit
    623             resourceName = getResourceName();
    624             resource = CPUID.class.getClassLoader().getResource(resourceName);
    625         }
    626 
    627         if (resource == null) {
    628             if (_doLog)
    629                 System.err.println("WARNING: Resource name [" + resourceName + "] was not found");
     623        // now try 32 bit
     624        resourceName = getResourceName();
     625        boolean success = extractLoadAndCopy(resourceName);
     626        if (success)
     627            return true;
     628
     629        if (_doLog)
     630            System.err.println("WARNING: Resource name [" + resourceName + "] was not found");
     631        return false;
     632    }
     633
     634    /**
     635     * Extract a single resource, copy it to a temp location in the file system,
     636     * and attempt to load it. If the load succeeds, copy it to the installation
     637     * directory. Return value reflects only load success - copy will fail silently.
     638     *
     639     * @return true if it was loaded successfully, else false.
     640     * @since 0.8.7
     641     */
     642    private static final boolean extractLoadAndCopy(String resourceName) {
     643        URL resource = CPUID.class.getClassLoader().getResource(resourceName);
     644        if (resource == null)
    630645            return false;
    631         }
    632 
    633646        File outFile = null;
    634647        FileOutputStream fos = null;
     
    653666                ule.printStackTrace();
    654667            }
     668            if (outFile != null)
     669                outFile.delete();
    655670            return false;
    656671        } catch (IOException ioe) {
     
    659674                ioe.printStackTrace();
    660675            }
     676            if (outFile != null)
     677                outFile.delete();
    661678            return false;
    662679        } finally {
  • router/java/src/net/i2p/router/RouterVersion.java

    r2accbdc r9a836ed  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 6;
     21    public final static long BUILD = 7;
    2222
    2323    /** for example "-test" */
Note: See TracChangeset for help on using the changeset viewer.