[JBoss JIRA] Created: (JASSIST-25) RuntimeException: cannot set to static - when calling CtClassType.setModifiers(int mod)
by Martin Burger (JIRA)
RuntimeException: cannot set to static - when calling CtClassType.setModifiers(int mod)
---------------------------------------------------------------------------------------
Key: JASSIST-25
URL: http://jira.jboss.com/jira/browse/JASSIST-25
Project: Javassist
Issue Type: Bug
Environment: Windows XP SP2, Mac OS 10.4
Reporter: Martin Burger
Assigned To: Shigeru Chiba
Hello!
I wrote a class that removes final modifier from given classes, here's the most relevant method:
Code:
public void instrument(CtClass clazz) {
int modifiers = clazz.getModifiers();
if (Modifier.isFinal(modifiers)) {
logger.info("Will remove final modifier from class: " + clazz.getName());
logger.debug("Old modifiers: " + Modifier.toString(modifiers));
int newModifiers = Modifier.clear(modifiers, Modifier.FINAL);
logger.debug("New modifiers: " + Modifier.toString(newModifiers));
clazz.setModifiers(newModifiers);
} else {
logger.debug("Class is not final, nothing do change: " + clazz.getName());
}
}
Running my util on the JDK classes results in an exception:
Code:
Exception in thread "main" java.lang.RuntimeException: cannot set to static
at javassist.CtClassType.setModifiers(CtClassType.java:374)
The last lines of my log are:
Code:
307 [ main] TRACE mon.javassist.FileInstrumenter - Current jar entry: com/sun/corba/se
/impl/corba/AnyImpl$AnyInputStream.class
307 [ main] INFO y.framework.utils.FinalRemover - Will remove final modifier from cla
ss: com.sun.corba.se.impl.corba.AnyImpl$AnyInputStream
308 [ main] DEBUG y.framework.utils.FinalRemover - Old modifiers: static final
308 [ main] DEBUG y.framework.utils.FinalRemover - New modifiers: static
The class CtClassType contains the following lines:
Code:
public void setModifiers(int mod) {
if (Modifier.isStatic(mod))
throw new RuntimeException("cannot set to static");
checkModify();
int acc = AccessFlag.of(mod) | AccessFlag.SUPER;
getClassFile2().setAccessFlags(acc);
}
So, why is it not possible to change the modifier from "static final" to "static"? AFAIK, static inner classes are allowed, aren't they?
Regards, Martin
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 3 months
[JBoss JIRA] Closed: (JBAS-2950) HAPartition starts successfully even if state transfer fails
by Brian Stansberry (JIRA)
[ http://jira.jboss.com/jira/browse/JBAS-2950?page=all ]
Brian Stansberry closed JBAS-2950.
----------------------------------
Fix Version/s: (was: JBossAS-5.0.0.Beta)
Resolution: Done
> HAPartition starts successfully even if state transfer fails
> ------------------------------------------------------------
>
> Key: JBAS-2950
> URL: http://jira.jboss.com/jira/browse/JBAS-2950
> Project: JBoss Application Server
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Clustering
> Affects Versions: JBossAS-4.0.3 SP1
> Reporter: Brian Stansberry
> Assigned To: Brian Stansberry
> Priority: Critical
> Fix For: JBossAS-4.0.5.CR1
>
>
> Failure to receive state from the coordinator does not prevent starting a cache. The HAPartitionImpl that's starting just *assumes* it is the coordinator and logs an INFO level message.
> We need to determine for sure whether we are the coordinator, and if not, throw an Exception.
> We also do nothing to ensure that the setState() call (which is happening in another thread) executes successfully. We need to look at how TreeCache handles this as an example of what to do.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 3 months
[JBoss JIRA] Created: (JBRULES-389) Use of "exists" causes a ClassCastException
by Edson Tirelli (JIRA)
Use of "exists" causes a ClassCastException
-------------------------------------------
Key: JBRULES-389
URL: http://jira.jboss.com/jira/browse/JBRULES-389
Project: JBoss Rules
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Reteoo
Affects Versions: 3.0.3
Reporter: Edson Tirelli
Assigned To: Edson Tirelli
Fix For: 3.0.4
Using exists with later bound variables will cause ClassCastException.
package com.sample
import org.drools.Cheese
import org.drools.Person
global java.util.List results
rule "Exists with Bindings"
when
exists Cheese()
c: Cheese( $type : type );
p: Person( likes == $type );
then
results.add( $type );
end
Results in:
java.lang.ClassCastException: org.drools.reteoo.InitialFactImpl
at org.drools.base.org.drools.Cheese$getType.getValue(Unknown Source)
at org.drools.base.ClassFieldExtractor.getValue(ClassFieldExtractor.java:79)
at org.drools.rule.Declaration.getValue(Declaration.java:156)
at org.drools.rule.BoundVariableConstraint.isAllowed(BoundVariableConstraint.java:82)
at org.drools.common.BetaNodeBinder.isAllowed(BetaNodeBinder.java:63)
at org.drools.reteoo.TupleSource.attemptJoin(TupleSource.java:99)
at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:165)
at org.drools.reteoo.ObjectSource.propagateAssertObject(ObjectSource.java:119)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:158)
at org.drools.reteoo.Rete.assertObject(Rete.java:120)
at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:180)
at org.drools.reteoo.ReteooWorkingMemory.doAssertObject(ReteooWorkingMemory.java:69)
at org.drools.common.AbstractWorkingMemory.assertObject(AbstractWorkingMemory.java:538)
at org.drools.common.AbstractWorkingMemory.assertObject(AbstractWorkingMemory.java:374)
at org.drools.integrationtests.IntegrationCases.testExistsWithBinding(IntegrationCases.java:2608)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 3 months
[JBoss JIRA] Updated: (JBESB-68) Tidy-up JDBC classes
by Mark Little (JIRA)
[ http://jira.jboss.com/jira/browse/JBESB-68?page=all ]
Mark Little updated JBESB-68:
-----------------------------
Fix Version/s: 4.0
(was: 4.0 Beta 1)
> Tidy-up JDBC classes
> --------------------
>
> Key: JBESB-68
> URL: http://jira.jboss.com/jira/browse/JBESB-68
> Project: JBoss ESB
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Components: Documentation, ESB Core
> Affects Versions: 4.0 Alpha 1
> Reporter: Mark Little
> Assigned To: Mohit Keswani
> Priority: Minor
> Fix For: 4.0
>
>
> - common\src\org\jboss\soa\esb\helpers\persist\JdbcCleanConn.java
> 1) Refactor
> - rename to conventions
> - categorize exceptions instead of using Exception
> - group into a db specific package instead of persist
> - common\src\org\jboss\soa\esb\helpers\persist\SqlDbTable.java
> 1) Refactor
> - rename to conventions e.g getFldName - > getFieldName
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 3 months