-
Bug
-
Resolution: Won't Fix
-
P3
-
None
-
6
-
x86
-
linux
FULL PRODUCT VERSION :
# java -version
java version "1.5.0_12"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
Java HotSpot(TM) Client VM (build 1.5.0_12-b04, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
# uname -a
Linux dev199.shsolutions.com 2.6.18-1.2798.fc6 #1 SMP Mon Oct 16 14:37:32 EDT 2006 i686 i686 i386 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
B/c the constructor definition for ObjectName changed from 1.5 to 1.6
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
import java.util.Hashtable;
import java.util.Properties;
import javax.management.ObjectName;
import javax.management.MalformedObjectNameException;
/**
* Hello world!
*
*/
public class App
{
public String value = "hi";
public ObjectName objectName;
public Hashtable<String,String> props;
public Properties properties;
public App() {
}
public static void main( String[] args ) throws MalformedObjectNameException
{
App app = new App();
app.props = new Hashtable<String,String>();
app.props.put("11","22");
app.properties = new Properties();
app.properties.setProperty("1","a");
app.properties.setProperty("2","b");
app.objectName = new ObjectName("string name", app.properties);
System.out.println( "Hello World! : " + app.value );
System.out.println( "ObjectName is : " + app.objectName );
}
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Hello World! : hi
ObjectName is : string name:2=b,1=a
ACTUAL -
Cannot even compile....
ERROR MESSAGES/STACK TRACES THAT OCCUR :
[INFO] Compilation failure
App.java:[36,22] cannot find symbol
symbol : constructor ObjectName(java.lang.String,java.util.Properties)
location: class javax.management.ObjectName
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.util.Hashtable;
import java.util.Properties;
import javax.management.ObjectName;
import javax.management.MalformedObjectNameException;
/**
* Hello world!
*
*/
public class App
{
public String value = "hi";
public ObjectName objectName;
public Hashtable<String,String> props;
public Properties properties;
public App() {
}
public static void main( String[] args ) throws MalformedObjectNameException
{
App app = new App();
app.props = new Hashtable<String,String>();
app.props.put("11","22");
app.properties = new Properties();
app.properties.setProperty("1","a");
app.properties.setProperty("2","b");
// The line below compiles in 1.5 but not in 1.6
app.objectName = new ObjectName("string name", app.properties);
System.out.println( "Hello World! : " + app.value );
System.out.println( "ObjectName is : " + app.objectName );
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
no work around
Release Regression From : 5.0u12
The above release value was the last known release where this
bug was not reproducible. Since then there has been a regression.
Release Regression From : 5.0u12
The above release value was the last known release where this
bug was not reproducible. Since then there has been a regression.
# java -version
java version "1.5.0_12"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
Java HotSpot(TM) Client VM (build 1.5.0_12-b04, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
# uname -a
Linux dev199.shsolutions.com 2.6.18-1.2798.fc6 #1 SMP Mon Oct 16 14:37:32 EDT 2006 i686 i686 i386 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
B/c the constructor definition for ObjectName changed from 1.5 to 1.6
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
import java.util.Hashtable;
import java.util.Properties;
import javax.management.ObjectName;
import javax.management.MalformedObjectNameException;
/**
* Hello world!
*
*/
public class App
{
public String value = "hi";
public ObjectName objectName;
public Hashtable<String,String> props;
public Properties properties;
public App() {
}
public static void main( String[] args ) throws MalformedObjectNameException
{
App app = new App();
app.props = new Hashtable<String,String>();
app.props.put("11","22");
app.properties = new Properties();
app.properties.setProperty("1","a");
app.properties.setProperty("2","b");
app.objectName = new ObjectName("string name", app.properties);
System.out.println( "Hello World! : " + app.value );
System.out.println( "ObjectName is : " + app.objectName );
}
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Hello World! : hi
ObjectName is : string name:2=b,1=a
ACTUAL -
Cannot even compile....
ERROR MESSAGES/STACK TRACES THAT OCCUR :
[INFO] Compilation failure
App.java:[36,22] cannot find symbol
symbol : constructor ObjectName(java.lang.String,java.util.Properties)
location: class javax.management.ObjectName
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.util.Hashtable;
import java.util.Properties;
import javax.management.ObjectName;
import javax.management.MalformedObjectNameException;
/**
* Hello world!
*
*/
public class App
{
public String value = "hi";
public ObjectName objectName;
public Hashtable<String,String> props;
public Properties properties;
public App() {
}
public static void main( String[] args ) throws MalformedObjectNameException
{
App app = new App();
app.props = new Hashtable<String,String>();
app.props.put("11","22");
app.properties = new Properties();
app.properties.setProperty("1","a");
app.properties.setProperty("2","b");
// The line below compiles in 1.5 but not in 1.6
app.objectName = new ObjectName("string name", app.properties);
System.out.println( "Hello World! : " + app.value );
System.out.println( "ObjectName is : " + app.objectName );
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
no work around
Release Regression From : 5.0u12
The above release value was the last known release where this
bug was not reproducible. Since then there has been a regression.
Release Regression From : 5.0u12
The above release value was the last known release where this
bug was not reproducible. Since then there has been a regression.
- relates to
-
JDK-5056707 Generification conflict: Properties vs. javax.naming.spi.ObjectFactory
-
- Resolved
-
-
JDK-6368455 (props) Properties should extend Hashtable<String,String> not Hashtable<Object,Object>
-
- Closed
-