Skip to content

Commit 4ac0727

Browse files
committed
common units, unit conversions, transform updates, extras updates
1 parent b87769a commit 4ac0727

7 files changed

Lines changed: 895 additions & 156 deletions

File tree

src/main/java/mil/nga/crs/CRS.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ public Map<String, Object> getExtras() {
9090
return extras;
9191
}
9292

93+
/**
94+
* Initialize the extras map if not already
95+
*/
96+
public void initializeExtras() {
97+
if (extras == null) {
98+
extras = new LinkedHashMap<>();
99+
}
100+
}
101+
93102
/**
94103
* Determine if there are temporary extras that are not part of the CRS
95104
* definition
@@ -144,9 +153,7 @@ public void setExtras(Map<String, Object> extras) {
144153
* extra value
145154
*/
146155
public void addExtra(String name, Object extra) {
147-
if (extras == null) {
148-
extras = new LinkedHashMap<>();
149-
}
156+
initializeExtras();
150157
extras.put(name, extra);
151158
}
152159

@@ -157,9 +164,7 @@ public void addExtra(String name, Object extra) {
157164
* extra values
158165
*/
159166
public void addExtras(Map<String, Object> extras) {
160-
if (this.extras == null) {
161-
this.extras = new LinkedHashMap<>();
162-
}
167+
initializeExtras();
163168
this.extras.putAll(extras);
164169
}
165170

0 commit comments

Comments
 (0)