--- old/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java 2016-09-22 17:06:52.409801054 +0300 +++ new/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java 2016-09-22 17:06:52.293797469 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -108,6 +108,9 @@ */ public final class BeanGenerator implements Outline { + /** JAXB module name. JAXB dependency is mandatory in generated Java module. */ + private static final String JAXB_PACKAGE = "java.xml.bind"; + /** Simplifies class/interface creation and collision detection. */ private final CodeModelClassFactory codeModelClassFactory; private final ErrorReceiver errorReceiver; @@ -254,6 +257,10 @@ getPackageContext(ei._package()).objectFactoryGenerator().populate(ei); } + if (model.options.getModuleName() != null) { + codeModel._prepareModuleInfo(model.options.getModuleName(), JAXB_PACKAGE); + } + if (model.options.debugMode) { generateClassList(); }