Porting RarInfo tool to master branch

17 views
Skip to first unread message

Flavia Rainone

unread,
Sep 13, 2016, 3:31:38 AM9/13/16
to IronJacamar Developers
Hi,


I'm working on porting RarInfo tool to master branch. I'll post any questions that come up during that here.

One thing that I noticed is that some parameters are no longer in Defaults and are not necessary for creating XaPoolImpl:

USE_STRICT_MIN;
INTERLEAVING;
NO_TX_SEPARATE_POOL

For now, I'm ignoring this while I finish writing the tests. I'm assuming they are no longer needed and should be discarded from RarInfo.
Let me know if I'm right about this.

Thanks!
Flavia

Flavia Rainone

unread,
Sep 21, 2016, 4:12:48 AM9/21/16
to IronJacamar Developers
I'm testsing RarInfo, I'm having a problem with Validator.rules.
When Validator tries to load the rules class, it gets an exception, because it cannot find MCFNull:
java.lang.IllegalArgumentException: MCFNull
    at org.ironjacamar.validator.Validator.extractRules(Validator.java:168)
    at org.ironjacamar.validator.Validator.validate(Validator.java:112)
    at org.ironjacamar.validator.Validation.validate(Validation.java:235)
    at org.ironjacamar.validator.Validation.validate(Validation.java:168)
    at org.ironjacamar.as.rarinfo.Main.rarInfo(Main.java:384)
    at org.ironjacamar.as.rarinfo.RarInfoTestCase.testLazyRar(RarInfoTestCase.java:67)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84)
Caused by: java.lang.ClassNotFoundException: MCFNull
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at org.ironjacamar.validator.Validator.extractRules(Validator.java:161)
    ... 29 more
Compliant:    No

The problem is that Validator specifies class names for the rules without pointing the package name:
https://github.com/ironjacamar/ironjacamar/blob/master/validator/src/main/java/org/ironjacamar/validator/Validator.java#L43
My question is how to fix it? I'm assuming that Validator is using class names, and trying to load them, because probably the rule class could change per execution?
Otherwise, wouldn't it be better to just use the MCFNull Rule class directly, instead of trying to load it?

Thanks!
Flavia

Stefano Maestri

unread,
Sep 21, 2016, 4:57:44 AM9/21/16
to Flavia Rainone, IronJacamar Developers
Hi Flavia,

well, the reason is in the comment above the line you are pointing "we may want to externalize them into a properties file", That said, we have never externalized them in years, so it's not an effective need. IMHO we can use classes directly and if and when we would need to externalize them it will be a very rapid refactoring to support the use case.
Please fix this as part of you work or rar info, but please follow these steps to better keep track of changes:
  1. Open an issue in our github issue tracker, link this forum post into the issue, and assign it to you
  2. Open a branch w/ related changes and open a PR for this.
  3. I'll review it and merge change to the master and you will be able to rebase your current branch (rarinfo one) to the new master and send another PR only w/ rarinfo related changes
Thanks a lot

regards
S.

--
You received this message because you are subscribed to the Google Groups "IronJacamar Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ironjacamar-developers+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Flavia Rainone

unread,
Sep 27, 2016, 4:46:12 AM9/27/16
to IronJacamar Developers, frai...@redhat.com
I created the Jira #570 and the problem is solved.
The rarinfo tool is almost ready for the PR. I'm adding the last remaining test cases and I'll do the PR:
https://github.com/fl4via/ironjacamar/commit/996caae39276cb48b0b8699a45f744dea1580609
Reply all
Reply to author
Forward
0 new messages