Commit Graph

503 Commits

Author SHA1 Message Date
Havoc Pennington
6de4a991d4 In ConfigSubstitution, never ignoreFallbacks
Because the upcoming "allow self-references" behavior will
require looking at fallbacks.
2012-03-29 08:54:52 -04:00
Havoc Pennington
5566a091af Print problem object if merging an object yields non-object 2012-03-29 08:52:01 -04:00
Havoc Pennington
450a91ac22 add /bin-test-lib to .gitignore
This is a separate eclipse output folder for test-lib, because it
has test01.conf and so does the main src/test/resources
2012-03-28 23:34:47 -04:00
Havoc Pennington
5187a7ad4d To detect cycles, track visited MemoKey not visited nodes
Otherwise we can get a fake cycle when we try to do a partial
resolve on a node we are currently doing a full resolve on.
2012-03-28 23:07:00 -04:00
Havoc Pennington
db85e5ec8a Reimplement cycle detection with a traversed-node-set
This is probably not different from the depth counter
in practical situations, but it does guarantee 100%
that we are only detecting true cycles. Since we want
true cycles to have different semantics (in a following
patch), I feel better about this implementation.
2012-03-28 19:50:27 -04:00
Havoc Pennington
16871b597e add a future todo item about including URLs 2012-03-28 14:23:04 -04:00
Havoc Pennington
ef79b804e7 Link to the Typesafe CLA web form from the README 2012-03-27 07:53:13 -04:00
Havoc Pennington
4bee83c8a8 if -Dconfig.resource resource name starts with "/", drop the "/"
this is for compatibility with previous behavior.
2012-03-02 10:14:36 -05:00
Havoc Pennington
f497419970 minor clarifications and typo fixes in the spec 2012-03-01 19:47:14 -05:00
Havoc Pennington
08229c85b3 update NEWS for 0.3.0 2012-03-01 14:07:02 -05:00
Havoc Pennington
830df6b055 update version in README 2012-03-01 12:12:05 -05:00
Havoc Pennington
e96850c3b3 put -SNAPSHOT back in version 2012-03-01 12:10:03 -05:00
Havoc Pennington
b6759fcd0f 0.3.0 2012-03-01 12:09:17 -05:00
Havoc Pennington
27bdc06346 cache the default config and default reference config per-classloader
this is intended to avoid reparsing files over and over if you
load a few libraries that all use the default config.
2012-02-29 15:53:03 -05:00
Havoc Pennington
30bdac884b Add ConfigFactory.load variants that let you supply a ClassLoader 2012-02-29 12:05:35 -05:00
Havoc Pennington
9733578ebb Do not cache default config, and use context class loader to load it
So we get any reference.conf from the context class loader.

This does NOT fix loading non-default configs, we need new API
to allow passing in a class loader for that. It also makes
things a bit less efficient since it no longer caches;
in the future we could do a per-class-loader cache.
2012-02-29 10:44:24 -05:00
Havoc Pennington
e2c0979422 Some formatting changes
(basically change from 80 to 100 column wrap)
2012-02-28 13:03:02 -05:00
Havoc Pennington
1310bc258a Add -Dconfig.trace=loads feature to log where config is loaded from to stderr 2012-02-28 13:02:34 -05:00
Havoc Pennington
d32ba9aee8 add tests for resolving mutually-referring objects 2012-02-25 10:31:45 -05:00
Havoc Pennington
7ed9eee67e add test coverage on ConfigDelayedMerge render(), relativized() 2012-02-25 00:17:21 -05:00
Havoc Pennington
fb17706961 add check to SimpleConfigList that resolveStatus is correct 2012-02-24 23:49:43 -05:00
Havoc Pennington
7844f13dfa Maintain SimpleConfigObject.resolveStatus when adding/removing keys
withOnlyKey, withoutKey were buggy and didn't correctly update the
resolved status.
2012-02-24 23:47:51 -05:00
Havoc Pennington
a59e31f744 Redo substitution resolving to better handle complex cases.
The main idea of this patch is to introduce "partial resolution"
which means resolving only the minimum branch of the object tree
to get to a desired value. By using partial resolution whenever
possible, more interdependencies between substitutions are permitted.

ConfigDelayedMergeObject was a big problem because a lot of the
code in AbstractConfigObject really didn't work on it, because
it assumed a resolved object; much of that code now moves down
to SimpleConfigObject.
2012-02-24 23:22:25 -05:00
Havoc Pennington
021a958a93 Add a set of failing tests involving resolve() and ConfigDelayedMerge, ConfigDelayedMergeObject 2012-02-24 19:36:06 -05:00
Havoc Pennington
d946c794ef ConfigSubstitution was missing serialVersionUID. Fix. 2012-02-24 17:26:30 -05:00
Havoc Pennington
982dee4047 switch from lift-json 2.4-SNAPSHOT to 2.4 2012-02-24 16:53:54 -05:00
Havoc Pennington
3051608186 add withOnlyKey, withOnlyPath, withoutKey, withoutPath methods
These allow easily pruning a Config or ConfigObject.
Previously would have required some sort of tedious recursive
copying of the nodes in the tree.
2012-02-20 11:15:20 -05:00
Havoc Pennington
71d209070a add some missing serialVersionUID
All the most-derived classes need to have it, not just base classes.

Update expected serializations in the tests to reflect new serialVersionUID.
2012-02-20 11:13:49 -05:00
Havoc Pennington
dc2f52aa24 Merge branch 'serializable' 2012-02-09 13:46:10 -05:00
Havoc Pennington
4979b1345f Merge pull request #4 from brianm/typesafe-master
update readme to include information about unofficial releases in maven central
2012-02-09 10:45:47 -08:00
Brian McCallister
093c19ee0e update readme to include information about unofficial releases in maven central 2012-02-09 10:23:27 -07:00
Havoc Pennington
fdd3eeec16 correct javadoc that claimed Config had a Map interface 2012-02-09 08:57:26 -05:00
Havoc Pennington
682fdbf772 fix a syntax glitch in ConfigFactory.load javadoc 2012-02-09 08:44:36 -05:00
Havoc Pennington
190bf12ebf add serialVersionUID to serializable classes
Also add tests to detect any incompatible change in serialization
format, to be sure such changes are deliberate.
2012-02-06 17:46:03 -05:00
Roland
277e4ca3a2 update copyright headers for 2012 2012-02-03 14:56:54 +01:00
Havoc Pennington
ab4edcfaf8 When serializing lists, convert to LinkedList
ArrayList and emptyList() don't seem to serialize correctly on JDK 1.6.0 betas.
Unknown which other JDKs are affected.
Speculating that the problem is http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6446627
2012-02-01 12:56:26 -05:00
Havoc Pennington
2d8e42686c Make concrete Config and ConfigValue serializable 2012-02-01 12:15:05 -05:00
Havoc Pennington
846c8c116a put back SNAPSHOT after 0.2.1 2012-01-20 18:50:40 -05:00
Havoc Pennington
2c8bf3be7e v0.2.1 2012-01-20 18:50:09 -05:00
Havoc Pennington
bda507b474 Fix behavior of ${?} optional substitution overriding a field
The broken behavior was:
  foo=10
  foo=${?bar}
where 'foo' should be 10 if bar is undefined, but instead
ended up undefined. Now, foo will be 10 (which was the
documented behavior).
2012-01-20 18:37:07 -05:00
Havoc Pennington
8422f34f51 add -SNAPSHOT back after 0.2.0 release 2011-12-14 10:08:39 -05:00
Havoc Pennington
b89e263eb6 v0.2.0 2011-12-14 10:08:07 -05:00
Havoc Pennington
5302c1e90e remove a nonsense comment from Tokenizer.java leftover from earlier patch iteration 2011-12-13 18:34:29 -05:00
Havoc Pennington
c5028bca3d Throw BugOrBroken if a ValidationFailed is created with no problems
Reported by Max in blog comments, thanks.
2011-12-13 18:33:59 -05:00
Havoc Pennington
516b38f44a Track the comments preceding a setting in the ConfigOrigin for the value.
The rule is that any block of comments uninterrupted by another token
or blank line, goes with the following array element or object field.

The comments are shown in the output of ConfigValue.render().

They are also available in the ConfigOrigin API for custom use.

Comments that don't precede an array element of object field
get discarded, they are not available anywhere.
2011-12-13 16:47:21 -05:00
Havoc Pennington
59a2d8d0df try to fix rendering of bullet list in API docs README section 2011-12-10 09:30:41 -05:00
Havoc Pennington
1f3c19f029 discuss withFallback in the README 2011-12-10 09:12:35 -05:00
Havoc Pennington
456535327e some minor docs tweaks 2011-12-09 16:35:26 -05:00
Havoc Pennington
0cb0a8e072 add doc comment to ConfigUtil 2011-12-09 15:50:53 -05:00
Havoc Pennington
a5c78e4f92 link to API docs 2011-12-09 15:48:46 -05:00