Issue #189 updates to grid from code review comments
Former-commit-id:ef670b81b8
[formerly8a5aa9adc9
] [formerly52f7d6d6fa
] [formerlyaa08ec7929
[formerly52f7d6d6fa
[formerly 25d6e51d9e748a6e05c93fdff0b641731360bfee]]] Former-commit-id:aa08ec7929
Former-commit-id: 8ad44130265d773960cbbc1c53349d188509b617 [formerly8ae8e40f25
] Former-commit-id:d6b85c32b5
This commit is contained in:
parent
21ce531c20
commit
c4e10b3344
2 changed files with 10 additions and 8 deletions
|
@ -46,8 +46,14 @@ import com.raytheon.uf.common.dataplugin.persist.IPersistable;
|
|||
*/
|
||||
public class GridPathProvider extends DefaultPathProvider {
|
||||
|
||||
private static final DecimalFormat forecastHourFormat = new DecimalFormat(
|
||||
"000");
|
||||
private static final ThreadLocal<DecimalFormat> forecastHourFormat = new ThreadLocal<DecimalFormat>() {
|
||||
|
||||
@Override
|
||||
protected DecimalFormat initialValue() {
|
||||
return new DecimalFormat("000");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private static final int SECONDS_PER_HOUR = 3600;
|
||||
|
||||
|
@ -107,10 +113,7 @@ public class GridPathProvider extends DefaultPathProvider {
|
|||
sb.append("000");
|
||||
} else {
|
||||
long number = pdo.getDataTime().getFcstTime() / SECONDS_PER_HOUR;
|
||||
String numberString = null;
|
||||
synchronized (forecastHourFormat) {
|
||||
numberString = forecastHourFormat.format(number);
|
||||
}
|
||||
String numberString = forecastHourFormat.get().format(number);
|
||||
sb.append(numberString);
|
||||
}
|
||||
sb.append(".h5");
|
||||
|
|
|
@ -22,7 +22,6 @@ package com.raytheon.uf.common.dataplugin.grid;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.PrimaryKeyJoinColumn;
|
||||
|
@ -70,7 +69,7 @@ public class GridRecord extends PersistablePluginDataObject implements
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ManyToOne(cascade = { CascadeType.REFRESH })
|
||||
@ManyToOne
|
||||
@PrimaryKeyJoinColumn
|
||||
@DataURI(position = 1, embedded = true)
|
||||
@DynamicSerializeElement
|
||||
|
|
Loading…
Add table
Reference in a new issue