UcasRichard / snakeyaml

Automatically exported from code.google.com/p/snakeyaml
Apache License 2.0
0 stars 0 forks source link

dump wrongfully omits JavaBean class name #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
STEPS TO REPRODUCE:
Run BasicDumpTest.java, which generates an error.

OUTPUT OF DUMP:

!!DataSources
dataSources:
- &id001 {name: null}
- name: null
  parent: *id001
  password: null
  url: null
  username: null

EXPECTED OUTPUT:

!!DataSources
dataSources:
- &id001 !!DataSource {name: null}
- !!JDBCDataSource 
  name: null
  parent: *id001
  password: null
  url: null
  username: null

VERSION
snakeyaml 1.3

Original issue reported on code.google.com by derrick....@gmail.com on 27 Jul 2009 at 9:03

Attachments:

GoogleCodeExporter commented 9 years ago
Oh, and a canonical dump does this, which also seems wrong (it is explicitly
declaring the JavaBean objects as maps)

---
!!DataSources {
  ? !!str "dataSources"
  : !!seq [
    &id001 !!map {
      ? !!str "name"
      : !!null "null",
    },
    !!map {
      ? !!str "name"
      : !!null "null",
      ? !!str "parent"
      : *id001,
      ? !!str "password"
      : !!null "null",
      ? !!str "url"
      : !!null "null",
      ? !!str "username"
      : !!null "null",
    },
  ],
}

Original comment by derrick....@gmail.com on 27 Jul 2009 at 9:26

GoogleCodeExporter commented 9 years ago

Original comment by aso...@gmail.com on 28 Jul 2009 at 6:30

GoogleCodeExporter commented 9 years ago
Thank you for your time. The bug is fixed. (it will be released in version 1.4)
I have extended the test you provided. You can see it here:
http://code.google.com/p/snakeyaml/source/browse/src/test/java/org/yaml/snakeyam
l/issues/issue10/BasicDumpTest.java

testTag -  your code
testTag2 - using JavaBeanDumper
testTag3 - different order. This order makes the global tag for DataSource 
redundant.

Original comment by aso...@gmail.com on 28 Jul 2009 at 8:11

GoogleCodeExporter commented 9 years ago

Original comment by aso...@gmail.com on 6 Aug 2009 at 10:00