Skip to content

Commit

Permalink
add explanation why we don't use CollectionUtils.mergePropertiesIntoMap
Browse files Browse the repository at this point in the history
also extend .gitignore to avoid adding logs and stuff

Switch Manufacturing and Distribution to Dispo Framework #523
  • Loading branch information
metas-ts committed May 8, 2017
1 parent 6253707 commit 7aee3d7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
**/.settings/
*.cache
*.diff
*.project
*.classpath
**/.classpath
**/.project

**/activemq-data/
**/data/
**/log/

de.metas.endcustomer.mf15/metasfresh.properties
/de.metas.endcustomer.mf15/de.metas.endcustomer.mf15.swingui/log/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,18 +391,21 @@ public static final Properties copyCtx(final Properties ctx)

final Properties newCtx = new Properties();

for (Enumeration<?> en = ctx.propertyNames(); en.hasMoreElements();)
// we can't use this great tool, because it (reasonably) assumes that the given ctx doews not have null values
// org.springframework.util.CollectionUtils.mergePropertiesIntoMap(ctx, newCtx);

for (final Enumeration<?> en = ctx.propertyNames(); en.hasMoreElements();)
{
String key = (String)en.nextElement();
final String key = (String)en.nextElement();
Object value = ctx.get(key);
if (value == null)
{
// Allow for defaults fallback or potentially overridden accessor...
// Allow for defaults fallback or potentially overridden accessor
value = newCtx.getProperty(key);
}
if (value == null)
{
continue;
continue; // the given ctx might have null values, so this chack is crucial
}
newCtx.put(key, value);
}
Expand Down

0 comments on commit 7aee3d7

Please sign in to comment.