2 Replies Latest reply on Jun 24, 2008 6:31 AM by timfox

    Work done on CP branch without any corresponding JIRA

    timfox

      I am trying to prepare the CP branch to release 1.4.0.SP3_CP03 for EAP 4.3.CP02, and I have done a diff between its current state and the state from the 1.4.0.SP3_CP02 tag, and I see several changes which have no corresponding JIRAs:

      Index: tests/src/org/jboss/test/messaging/tools/container/ClassLoaderJMXWrapper.java
      ===================================================================
      --- tests/src/org/jboss/test/messaging/tools/container/ClassLoaderJMXWrapper.java (.../branches/Branch_JBossMessaging_1_4_0_SP3_CP) (revision 4568)
      +++ tests/src/org/jboss/test/messaging/tools/container/ClassLoaderJMXWrapper.java (.../tags/JBossMessaging_1_4_0_SP3_CP02) (revision 4568)
      @@ -21,7 +21,9 @@
       */
       package org.jboss.test.messaging.tools.container;
      
      -import org.jboss.util.loading.DelegatingClassLoader;
      +import java.lang.reflect.Array;
      +import java.net.URL;
      +import java.net.URLClassLoader;
      
       /**
       * We extend URLClassLoader just to prevent UnifiedLoaderRepository3 to generate spurious warning
      @@ -33,7 +35,7 @@
       *
       * $Id$
       */
      -public class ClassLoaderJMXWrapper extends DelegatingClassLoader implements ClassLoaderJMXWrapperMBean
      +public class ClassLoaderJMXWrapper extends URLClassLoader implements ClassLoaderJMXWrapperMBean
       {
       // Constants -----------------------------------------------------
      
      @@ -41,13 +43,45 @@
      
       // Attributes ----------------------------------------------------
      
      + private ClassLoader delegate;
      +
       // Constructors --------------------------------------------------
      
       public ClassLoaderJMXWrapper(ClassLoader delegate)
       {
      - super(delegate);
      + super(new URL[0]);
      + this.delegate = delegate;
       }
      
      + // ClassLoaderJMXWrapperMBean implementation ---------------------
      +
      + public Class loadClass(String name) throws ClassNotFoundException
      + {
      + if (name.endsWith("[]"))
      + {
      + name = name.substring(0, name.length() - 2);
      +
      + //The classloader of an array type is the classloader of it's element (if non primitive)
      +
      + Class cl = delegate.loadClass(name);
      +
      + Object arr = Array.newInstance(cl, 0);
      +
      + return arr.getClass();
      + }
      + else
      + {
      + return delegate.loadClass(name);
      + }
      + }
      +
      + // ClassLoader overrides -----------------------------------------
      +
      + public URL getResource(String name)
      + {
      + return delegate.getResource(name);
      + }
      +
       // Public --------------------------------------------------------
      
       // Package protected ---------------------------------------------
      Index: tests/src/org/jboss/test/messaging/tools/ServerManagement.java
      ===================================================================
      --- tests/src/org/jboss/test/messaging/tools/ServerManagement.java (.../branches/Branch_JBossMessaging_1_4_0_SP3_CP) (revision 4568)
      +++ tests/src/org/jboss/test/messaging/tools/ServerManagement.java (.../tags/JBossMessaging_1_4_0_SP3_CP02) (revision 4568)
      @@ -500,13 +500,13 @@
      
       String classPath = System.getProperty("java.class.path");
      
      - if (System.getProperty("os.name").toLowerCase().contains("windows"))
      + if (System.getProperty("os.name").equals("Linux"))
       {
      - sb.append("-cp").append(" \"").append(classPath).append("\" ");
      + sb.append("-cp").append(" ").append(classPath).append(" ");
       }
       else
       {
      - sb.append("-cp").append(" ").append(classPath).append(" ");
      + sb.append("-cp").append(" \"").append(classPath).append("\" ");
       }
      
       // As there is a problem with Multicast and JGroups on Linux (in certain JDKs)
      Index: tests/src/org/jboss/test/messaging/jms/bridge/SimpleCrashWithRestartTest.java
      ===================================================================
      --- tests/src/org/jboss/test/messaging/jms/bridge/SimpleCrashWithRestartTest.java (.../branches/Branch_JBossMessaging_1_4_0_SP3_CP) (revision 4568)
      +++ tests/src/org/jboss/test/messaging/jms/bridge/SimpleCrashWithRestartTest.java (.../tags/JBossMessaging_1_4_0_SP3_CP02) (revision 4568)
      @@ -1,136 +0,0 @@
      -/*
      - * JBoss, Home of Professional Open Source
      - * Copyright 2005, JBoss Inc., and individual contributors as indicated
      - * by the @authors tag. See the copyright.txt in the distribution for a
      - * full listing of individual contributors.
      - *
      - * This is free software; you can redistribute it and/or modify it
      - * under the terms of the GNU Lesser General Public License as
      - * published by the Free Software Foundation; either version 2.1 of
      - * the License, or (at your option) any later version.
      - *
      - * This software is distributed in the hope that it will be useful,
      - * but WITHOUT ANY WARRANTY; without even the implied warranty of
      - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
      - * Lesser General Public License for more details.
      - *
      - * You should have received a copy of the GNU Lesser General Public
      - * License along with this software; if not, write to the Free
      - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
      - * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
      - */
      -package org.jboss.test.messaging.jms.bridge;
      -
      -import java.util.Properties;
      -
      -import org.jboss.jms.jndi.JMSProviderAdapter;
      -import org.jboss.jms.server.bridge.Bridge;
      -import org.jboss.logging.Logger;
      -import org.jboss.test.messaging.tools.ServerManagement;
      -import org.jboss.test.messaging.tools.TestJMSProviderAdaptor;
      -import org.jboss.test.messaging.tools.aop.PoisonInterceptor;
      -
      -/**
      - * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
      - * @version <tt>$Revision$</tt>
      - *
      - * $Id$
      - *
      - */
      -public class SimpleCrashWithRestartTest extends BridgeTestBase
      -{
      - private static final Logger log = Logger.getLogger(ReconnectTest.class);
      -
      - public SimpleCrashWithRestartTest(String name)
      - {
      - super(name);
      - }
      -
      - protected void setUp() throws Exception
      - {
      - super.setUp();
      -
      - //Now install local JMSProviderAdaptor classes
      -
      - Properties props1 = new Properties();
      - props1.putAll(ServerManagement.getJNDIEnvironment(1));
      -
      - JMSProviderAdapter targetAdaptor =
      - new TestJMSProviderAdaptor(props1, "/XAConnectionFactory", "adaptor1");
      -
      - sc.installJMSProviderAdaptor("adaptor1", targetAdaptor);
      -
      - sc.startRecoveryManager();
      - }
      -
      - protected void tearDown() throws Exception
      - {
      - super.tearDown();
      -
      - sc.stopRecoveryManager();
      -
      - sc.uninstallJMSProviderAdaptor("adaptor1");
      -
      - log.debug(this + " torn down");
      - }
      -
      - /*
      - * Send some messages
      - * Crash the server after prepare but on commit
      - * Bring up the destination server
      - * Send some more messages
      - * Verify all messages are received
      - */
      - public void testCrashAndRestart() throws Exception
      - {
      - Bridge bridge = null;
      -
      - try
      - {
      - final int NUM_MESSAGES = 10;
      -
      - bridge = new Bridge(cff0, cff1, sourceQueueFactory, targetQueueFactory,
      - null, null, null, null,
      - null, 1000, -1, Bridge.QOS_AT_MOST_ONCE,
      - NUM_MESSAGES, -1,
      - null, null, false);
      -
      - bridge.start();
      -
      - sendMessages(cf0, sourceQueue, 0, NUM_MESSAGES, true);
      -
      - checkMessagesReceived(cf1, targetQueue, Bridge.QOS_ONCE_AND_ONLY_ONCE, NUM_MESSAGES, true);
      -
      - ServerManagement.kill(1);
      -
      -
      - // >30 sec (timeout on remoting)
      - Thread.sleep(35000);
      -
      - ServerManagement.start(1, "all", false);
      - ServerManagement.deployQueue("targetQueue", 1);
      -
      - setUpAdministeredObjects();
      -
      - sendMessages(cf0, sourceQueue, 0, NUM_MESSAGES, true);
      -
      - checkMessagesReceived(cf1, targetQueue, Bridge.QOS_AT_MOST_ONCE, NUM_MESSAGES, true);
      - }
      - finally
      - {
      - if (bridge != null)
      - {
      - try
      - {
      - bridge.stop();
      - }
      - catch (Exception e)
      - {
      - log.error("Failed to stop bridge", e);
      - }
      - }
      - }
      - }
      -
      - // Inner classes -------------------------------------------------------------------
      -}
      Index: src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java
      ===================================================================
      --- src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java (.../branches/Branch_JBossMessaging_1_4_0_SP3_CP) (revision 4568)
      +++ src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java (.../tags/JBossMessaging_1_4_0_SP3_CP02) (revision 4568)
      @@ -2556,7 +2556,7 @@
       map.put("CREATE_COUNTER",
       "CREATE TABLE JBM_COUNTER (NAME VARCHAR(255), NEXT_ID BIGINT, PRIMARY KEY(NAME))");
       // Id cache
      - map.put("CREATE_ID_CACHE", "CREATE TABLE JBM_ID_CACHE (NODE_ID INTEGER, CNTR INTEGER, JBM_ID VARCHAR(255), PRIMARY KEY(NODE_ID, CNTR))");
      + map.put("CREATE_ID_CACHE", "CREATE TABLE JBM_ID_CACHE (NODE_ID INTEGER, CNTR INTEGER, JBM_ID VARCHAR(255), PRIMARY KEY(NODEID, CNTR))");
       return map;
       }
      
      @@ -2603,8 +2603,8 @@
       "UPDATE JBM_MSG_REF SET CHANNEL_ID = ? WHERE CHANNEL_ID = ?");
       map.put("MOVE_REFERENCE",
       "UPDATE JBM_MSG_REF SET CHANNEL_ID = ? WHERE MESSAGE_ID = ? AND CHANNEL_ID = ?");
      - map.put("LOAD_ID_CACHE", "SELECT CNTR, JBM_ID FROM JBM_ID_CACHE WHERE NODE_ID = ?");
      - map.put("UPDATE_ID_IN_CACHE", "UPDATE JBM_ID_CACHE SET JBM_ID = ? WHERE NODE_ID = ? AND CNTR = ?");
      + map.put("LOAD_ID_CACHE", "SELECT CNTR, ID FROM JBM_ID_CACHE WHERE NODE_ID = ?");
      + map.put("UPDATE_ID_IN_CACHE", "UPDATE JBM_ID_CACHE SET JBM_ID = ? WHERE NODE_ID = ? CNTR = ?");
       map.put("INSERT_ID_IN_CACHE", "INSERT INTO JBM_ID_CACHE (NODE_ID, CNTR, JBM_ID) VALUES (?, ?, ?)");
      


      I have probably said this before, but doing work on the CP branch ***must be tracked by a corresponding JIRA***.

      I know what one of the changes is for (NODE_ID bug), but unless someone comes up with a JIRA and explanation for the others I will just revert them.