Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-9215

Comparing incompatible types for equality: String.equals(org.jboss.dmr.ModelNode)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.1.0.DR14
    • 7.1.0.DR12
    • Transactions
    • None
    • Not Required

      I found case of comparison of incompatible types for equality: String.equals(org.jboss.dmr.ModelNode)

      https://github.com/wildfly/wildfly/blob/master/transactions/src/main/java/org/jboss/as/txn/subsystem/TransactionSubsystem14Parser.java#L221

      ...
       final String value = reader.getAttributeValue(i);
      ...
      if (!value.equals(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH.getDefaultValue())) {
           needsDefaultRelativeTo = false;
      }
      

      https://github.com/wildfly/wildfly-core/blob/master/controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java#L349

      public ModelNode getDefaultValue() {
          return defaultValue;
      }
      

      Please fix the code to compare the right types.

            zfeng@redhat.com Zheng Feng
            rsvoboda@redhat.com Rostislav Svoboda
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: