[JBoss JIRA] (LOGTOOL-116) Locale is not used in the actual string format.
by James Perkins (JIRA)
[ https://issues.jboss.org/browse/LOGTOOL-116?page=com.atlassian.jira.plugi... ]
James Perkins reassigned LOGTOOL-116:
-------------------------------------
Assignee: James Perkins
> Locale is not used in the actual string format.
> -----------------------------------------------
>
> Key: LOGTOOL-116
> URL: https://issues.jboss.org/browse/LOGTOOL-116
> Project: Log Tool
> Issue Type: Bug
> Affects Versions: 2.0.1.Final
> Reporter: David Lloyd
> Assignee: James Perkins
> Priority: Minor
> Fix For: 2.0.2.Final, 2.1.0.Alpha1
>
>
> The {{String.format()}} method accepts a Locale parameter. We should be using the Locale of the implementation class. Since the format method is called from a final method, we need a polymorphic way of getting the Locale instance; therefore, a protected method should be added to the generated base class like this:
> {code}
> protected Locale getLoggingLocale() {
> return Locale.ROOT;
> }
> {code}
> Then each subclass should return a locale object specific to that class. The locale object returned should either be one of the following:
> * Locale.CANADA - for "en_CA"
> * Locale.CANADA_FRENCH - for "fr_CA"
> * Locale.CHINESE - for "zh"
> * Locale.ENGLISH - for "en"
> * Locale.FRANCE - for "fr_FR"
> * Locale.FRENCH - for "fr"
> * Locale.GERMAN - for "de"
> * Locale.GERMANY - for "de_DE"
> * Locale.ITALIAN - for "it"
> * Locale.ITALY - for "it_IT"
> * Locale.JAPAN - for "ja_JP"
> * Locale.JAPANESE - for "ja"
> * Locale.KOREA - for "ko_KR"
> * Locale.KOREAN - for "ko"
> * Locale.SIMPLIFIED_CHINESE - for "zh_CN"
> * Locale.TRADITIONAL_CHINESE - for "zh_TW"
> * Locale.UK - for "en_GB"
> * Locale.US - for "en_US"
> If the locale is not one of the above, then the correct Locale should be created in a private constant field of the class like this:
> {code}
> private static final Locale LOCALE = new Locale("hu");
> // or...
> private static final Locale LOCALE = new Locale("hu", "HU");
> // or...
> private static final Locale LOCALE = new Locale("hu", "HU", "technl");
> // ...and then...
> @Override
> protected Locale getLoggingLocale() {
> return LOCALE;
> }
> {code}
> Finally, all calls to {{format()}} should be rewritten to use the locale *from the method* like this:
> {code}
> final NamingException result = new NamingException(String.format(getLoggingLocale(), objectFromReference$str()));
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 8 months
[JBoss JIRA] (LOGTOOL-117) Unused import in generated log class
by James Perkins (JIRA)
[ https://issues.jboss.org/browse/LOGTOOL-117?page=com.atlassian.jira.plugi... ]
James Perkins reassigned LOGTOOL-117:
-------------------------------------
Assignee: James Perkins
> Unused import in generated log class
> ------------------------------------
>
> Key: LOGTOOL-117
> URL: https://issues.jboss.org/browse/LOGTOOL-117
> Project: Log Tool
> Issue Type: Bug
> Affects Versions: 2.0.1.Final
> Reporter: David Lloyd
> Assignee: James Perkins
> Priority: Minor
> Fix For: 2.0.2.Final, 2.1.0.Alpha1
>
>
> The class "org.jboss.logging.Logger.Level" is being imported without being used; all references to constants in this class are fully qualified. Either use the import (now that imports are safe, theoretically), or delete it and stick with qualified names.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 8 months
[JBoss JIRA] (LOGTOOL-115) Ambiguous import problem with conflicting class name
by James Perkins (JIRA)
[ https://issues.jboss.org/browse/LOGTOOL-115?page=com.atlassian.jira.plugi... ]
James Perkins resolved LOGTOOL-115.
-----------------------------------
Resolution: Done
Fixed by JDeparser upgrade in LOGTOOL-118
> Ambiguous import problem with conflicting class name
> ----------------------------------------------------
>
> Key: LOGTOOL-115
> URL: https://issues.jboss.org/browse/LOGTOOL-115
> Project: Log Tool
> Issue Type: Bug
> Affects Versions: 2.0.1.Final
> Reporter: David Lloyd
> Assignee: James Perkins
> Fix For: 2.0.2.Final, 2.1.0.Alpha1
>
>
> If I have two classes with the same simple name in the logging interface, and a single method uses both of them, the generated class fails to qualify one of them, resulting in compilation errors like this:
> {noformat}
> [ERROR] /home/david/src/java/wildfly-naming/target/generated-sources/annotations/org/wildfly/naming/client/_private/Messages_$logger.java:[35,8] org.wildfly.naming.client._private.Messages_$logger is not abstract and does not override abstract method authenticationFailed(org.wildfly.security.auth.AuthenticationException) in org.wildfly.naming.client._private.Messages
> [ERROR] /home/david/src/java/wildfly-naming/target/generated-sources/annotations/org/wildfly/naming/client/_private/Messages_$logger.java:[403,5] method does not override or implement a method from a supertype
> {noformat}
> The source looks like this:
> {code}
> // ...
> import org.wildfly.security.auth.AuthenticationException;
> // ...
> @MessageLogger(projectCode = "WFNAM", length = 5)
> public interface Messages extends BasicLogger {
> // ...
> @Message(id = 32, value = "Peer authentication failed")
> javax.naming.AuthenticationException authenticationFailed(@Cause AuthenticationException cause);
> // ...
> {code}
> The generated code is:
> {code}
> private static final String authenticationFailed = "WFNAM00032: Peer authentication failed";
> protected String authenticationFailed$str() {
> return authenticationFailed;
> }
> @Override
> public final AuthenticationException authenticationFailed(final AuthenticationException cause) { // XXX This is a problem line; return type is not qualified
> final AuthenticationException result = new AuthenticationException(String.format(authenticationFailed$str())); // XXX and this type and constructor are also not qualified
> result.initCause(cause);
> final StackTraceElement[] st = result.getStackTrace();
> result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
> return result;
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 8 months
[JBoss JIRA] (LOGTOOL-115) Ambiguous import problem with conflicting class name
by James Perkins (JIRA)
[ https://issues.jboss.org/browse/LOGTOOL-115?page=com.atlassian.jira.plugi... ]
James Perkins updated LOGTOOL-115:
----------------------------------
Fix Version/s: 2.0.2.Final
2.1.0.Alpha1
> Ambiguous import problem with conflicting class name
> ----------------------------------------------------
>
> Key: LOGTOOL-115
> URL: https://issues.jboss.org/browse/LOGTOOL-115
> Project: Log Tool
> Issue Type: Bug
> Affects Versions: 2.0.1.Final
> Reporter: David Lloyd
> Assignee: James Perkins
> Fix For: 2.0.2.Final, 2.1.0.Alpha1
>
>
> If I have two classes with the same simple name in the logging interface, and a single method uses both of them, the generated class fails to qualify one of them, resulting in compilation errors like this:
> {noformat}
> [ERROR] /home/david/src/java/wildfly-naming/target/generated-sources/annotations/org/wildfly/naming/client/_private/Messages_$logger.java:[35,8] org.wildfly.naming.client._private.Messages_$logger is not abstract and does not override abstract method authenticationFailed(org.wildfly.security.auth.AuthenticationException) in org.wildfly.naming.client._private.Messages
> [ERROR] /home/david/src/java/wildfly-naming/target/generated-sources/annotations/org/wildfly/naming/client/_private/Messages_$logger.java:[403,5] method does not override or implement a method from a supertype
> {noformat}
> The source looks like this:
> {code}
> // ...
> import org.wildfly.security.auth.AuthenticationException;
> // ...
> @MessageLogger(projectCode = "WFNAM", length = 5)
> public interface Messages extends BasicLogger {
> // ...
> @Message(id = 32, value = "Peer authentication failed")
> javax.naming.AuthenticationException authenticationFailed(@Cause AuthenticationException cause);
> // ...
> {code}
> The generated code is:
> {code}
> private static final String authenticationFailed = "WFNAM00032: Peer authentication failed";
> protected String authenticationFailed$str() {
> return authenticationFailed;
> }
> @Override
> public final AuthenticationException authenticationFailed(final AuthenticationException cause) { // XXX This is a problem line; return type is not qualified
> final AuthenticationException result = new AuthenticationException(String.format(authenticationFailed$str())); // XXX and this type and constructor are also not qualified
> result.initCause(cause);
> final StackTraceElement[] st = result.getStackTrace();
> result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
> return result;
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 8 months
[JBoss JIRA] (DROOLS-1359) Race condition in MVELDialectRuntimeData.getParserConfiguration
by Anuj Shah (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1359?page=com.atlassian.jira.plugi... ]
Anuj Shah commented on DROOLS-1359:
-----------------------------------
I have a test case that i can only get to fail with break points to simulate the race. The stack trace is:
{noformat}
[Error: unable to resolve method using strict-mode: drools1359.Fact.staticMethod(java.lang.String)]
[Near : {... staticMethod(arg) ....}]
^
[Line: 1, Column: 1]
at org.mvel2.compiler.PropertyVerifier.getMethod(PropertyVerifier.java:579)
at org.mvel2.compiler.PropertyVerifier.analyze(PropertyVerifier.java:120)
at org.mvel2.compiler.ExpressionCompiler.verify(ExpressionCompiler.java:373)
at org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:266)
at org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:52)
at org.mvel2.MVEL.compileExpression(MVEL.java:810)
at org.drools.core.base.mvel.MVELCompilationUnit.compile(MVELCompilationUnit.java:433)
at org.drools.core.base.mvel.MVELCompilationUnit.getCompiledExpression(MVELCompilationUnit.java:249)
at org.drools.core.rule.constraint.MvelConstraint.createMvelConditionEvaluator(MvelConstraint.java:254)
at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:238)
at org.drools.core.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:204)
at org.drools.core.reteoo.AlphaNode.assertObject(AlphaNode.java:141)
at org.drools.core.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:60)
at org.drools.core.reteoo.ObjectTypeNode.propagateAssert(ObjectTypeNode.java:298)
at org.drools.core.phreak.PropagationEntry$Insert.execute(PropagationEntry.java:93)
at org.drools.core.phreak.SynchronizedPropagationList.flush(SynchronizedPropagationList.java:96)
at org.drools.core.phreak.SynchronizedPropagationList.flush(SynchronizedPropagationList.java:69)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.flushPropagations(StatefulKnowledgeSessionImpl.java:1993)
at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1289)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1294)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1281)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1260)
at drools1359.TestRaceCondition$1.call(TestRaceCondition.java:73)
at drools1359.TestRaceCondition$1.call(TestRaceCondition.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
{noformat}
> Race condition in MVELDialectRuntimeData.getParserConfiguration
> ---------------------------------------------------------------
>
> Key: DROOLS-1359
> URL: https://issues.jboss.org/browse/DROOLS-1359
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 5.5.0.Final, 6.5.0.Final
> Reporter: Anuj Shah
> Assignee: Mario Fusco
>
> MVELDialectRuntimeData attempts to hold a lazy loaded ParserConfiguration. The getParserConfiguration method sets this to a new configuration object and then sets the imports on the configuration. Between these two steps another thread could retrieve the stale configuration and use it. This could result in a number of exceptions in compilation.
> A simple fix is to delay assignment of new ParserConfiguration until after the imports are set.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 8 months