Skip to content

Commit

Permalink
Changelog, remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
dbwiddis committed Jul 28, 2018
1 parent 84910c6 commit 2c3bbe6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 33 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* [#561](https://github.com/oshi/oshi/pull/561): Optimize Process CPU sort. - [@dbwiddis](https://github.com/dbwiddis).
* [#564](https://github.com/oshi/oshi/pull/564): Cache WMI connections. - [@dbwiddis](https://github.com/dbwiddis).
* [#567](https://github.com/oshi/oshi/pull/567): Cache USB devices. - [@dbwiddis](https://github.com/dbwiddis).
* [#569](https://github.com/oshi/oshi/pull/569): Remove threetenbp dependency. - [@dbwiddis](https://github.com/dbwiddis).
* Your contribution here.

3.6.2 (7/10/18)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Downloads
---------
| Stable Release Version | Current Development Version | Dependencies |
| ------------- | ------------- | ------------- |
| [oshi-core-3.6.2](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.github.oshi&a=oshi-core&v=3.6.2&e=jar) | [oshi-core-3.7.0-SNAPSHOT](https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=com.github.oshi&a=oshi-core&v=3.7.0-SNAPSHOT&e=jar) | [JNA](https://github.com/java-native-access/jna)[SLF4J](http://www.slf4j.org/) [threetenbp](http://www.threeten.org/threetenbp/) |
| [oshi-core-3.6.2](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.github.oshi&a=oshi-core&v=3.6.2&e=jar) | [oshi-core-3.7.0-SNAPSHOT](https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=com.github.oshi&a=oshi-core&v=3.7.0-SNAPSHOT&e=jar) | [JNA](https://github.com/java-native-access/jna)[SLF4J](http://www.slf4j.org/) |
| [oshi-json-3.6.2](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.github.oshi&a=oshi-json&v=3.6.2&e=jar) | [oshi-json-3.7.0-SNAPSHOT](https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=com.github.oshi&a=oshi-json&v=3.7.0-SNAPSHOT&e=jar) | [javax.json](https://jsonp.java.net/download.html) |

Projects using OSHI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public ValueType getType() {
* Sets to track USB devices in cache
*/
private static Set<String> devicesToAdd = new HashSet<>();
private static Set<String> devicesToRemove = null;
private static Set<String> devicesToRemove = new HashSet<>();

/*
* Map to build the recursive tree structure
Expand Down Expand Up @@ -202,7 +202,7 @@ private static void updateDeviceCache() {
usbDeviceCache.remove(deviceID);
LOG.debug("Removing {} from USB device cache.", deviceID);
}
devicesToRemove = null;
devicesToRemove.clear();
// Create list to add
if (!devicesToAdd.isEmpty()) {
StringBuilder sb = new StringBuilder();
Expand Down
30 changes: 0 additions & 30 deletions oshi-core/src/main/java/oshi/util/FormatUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -216,34 +214,6 @@ public static long getUnsignedInt(int x) {
return x & 0x00000000ffffffffL;
}

/**
* Convert a MM/dd/yyyy string representation to a java Date
*
* @param date
* a string in the form MM/dd/yyyy
* @return the corresponding Date, or null if it's unparseable
*/
public static Date formatStringDate(String date) {
if (date == null) {
return null;
}
try {
Calendar c = Calendar.getInstance();
c.set(Calendar.YEAR, Integer.parseInt(date.substring(6, 10)));
// Calendar uses 0-indexed months
c.set(Calendar.MONTH, Integer.parseInt(date.substring(0, 2)) - 1);
c.set(Calendar.DATE, Integer.parseInt(date.substring(3, 5)));
c.set(Calendar.HOUR, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
c.set(Calendar.MILLISECOND, 0);
return new Date(c.getTimeInMillis());
} catch (StringIndexOutOfBoundsException | // If date not 22+ chars
NumberFormatException e) { // If the fields didn't parse
return null;
}
}

/**
* Represent a 32 bit value as if it were an unsigned integer.
*
Expand Down

0 comments on commit 2c3bbe6

Please sign in to comment.