summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2009-02-06 21:08:25 +0000
committerArtur Signell <artur.signell@itmill.com>2009-02-06 21:08:25 +0000
commit968543e763cb6e5e7a8bc06cfe6061a04d3ace29 (patch)
treef136fd1536fb1eb0173cbc439cf5147d9f6c7ab6
parent09523c85dad781ff56b0bf29f270094d8b827e4d (diff)
downloadvaadin-framework-968543e763cb6e5e7a8bc06cfe6061a04d3ace29.tar.gz
vaadin-framework-968543e763cb6e5e7a8bc06cfe6061a04d3ace29.zip
Fixed sampler source resolving issue where the Feature was not in the same package as the example
svn changeset:6762/svn branch:trunk
-rw-r--r--src/com/itmill/toolkit/demo/sampler/Feature.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/com/itmill/toolkit/demo/sampler/Feature.java b/src/com/itmill/toolkit/demo/sampler/Feature.java
index 6061fac094..8fb4880008 100644
--- a/src/com/itmill/toolkit/demo/sampler/Feature.java
+++ b/src/com/itmill/toolkit/demo/sampler/Feature.java
@@ -57,8 +57,8 @@ abstract public class Feature {
* May return null, if the example has no related resources.
* </p>
* <p>
- * The name of the NamedExternalResource will be shown in the UI. <br/> Note
- * that Javadoc should be referenced via {@link #getRelatedAPI()}.
+ * The name of the NamedExternalResource will be shown in the UI. <br/>
+ * Note that Javadoc should be referenced via {@link #getRelatedAPI()}.
* </p>
*
* @see #getThemeBase()
@@ -132,8 +132,15 @@ abstract public class Feature {
if (javaSource == null) {
StringBuffer src = new StringBuffer();
try {
+ /*
+ * Use package name + class name so the class loader won't
+ * have to guess the package name.
+ */
+ String resourceName = "/"
+ + getExample().getClass().getName().replace('.',
+ '/') + ".java";
InputStream is = getClass().getResourceAsStream(
- getExample().getClass().getSimpleName() + ".java");
+ resourceName);
BufferedReader bis = new BufferedReader(
new InputStreamReader(is));
for (String line = bis.readLine(); null != line; line = bis