Java class for anonymous complex type. 14 | * 15 | *
The following schema fragment specifies the expected content contained within this class. 16 | * 17 | *
18 | * <complexType> 19 | * <complexContent> 20 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 21 | * <attGroup ref="{}Name"/> 22 | * </restriction> 23 | * </complexContent> 24 | * </complexType> 25 | *26 | * 27 | * 28 | */ 29 | @XmlAccessorType(XmlAccessType.FIELD) 30 | @XmlType(name = "") 31 | @XmlRootElement(name = "alias") 32 | public class Alias { 33 | 34 | @XmlAttribute(name = "name", required = true) 35 | @XmlSchemaType(name = "anySimpleType") 36 | protected String name; 37 | 38 | /** 39 | * Gets the value of the name property. 40 | * 41 | * @return 42 | * possible object is 43 | * {@link String } 44 | * 45 | */ 46 | public String getName() { 47 | return name; 48 | } 49 | 50 | /** 51 | * Sets the value of the name property. 52 | * 53 | * @param value 54 | * allowed object is 55 | * {@link String } 56 | * 57 | */ 58 | public void setName(String value) { 59 | this.name = value; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /mc-image-substgen/src/main/java/de/kb1000/mcimage/substgen/jaxb/Extensions.java: -------------------------------------------------------------------------------- 1 | 2 | package de.kb1000.mcimage.substgen.jaxb; 3 | 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | import jakarta.xml.bind.annotation.XmlAccessType; 7 | import jakarta.xml.bind.annotation.XmlAccessorType; 8 | import jakarta.xml.bind.annotation.XmlRootElement; 9 | import jakarta.xml.bind.annotation.XmlType; 10 | 11 | 12 | /** 13 | *
Java class for anonymous complex type. 14 | * 15 | *
The following schema fragment specifies the expected content contained within this class. 16 | * 17 | *
18 | * <complexType> 19 | * <complexContent> 20 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 21 | * <sequence> 22 | * <element ref="{}extension" maxOccurs="unbounded" minOccurs="0"/> 23 | * </sequence> 24 | * </restriction> 25 | * </complexContent> 26 | * </complexType> 27 | *28 | * 29 | * 30 | */ 31 | @XmlAccessorType(XmlAccessType.FIELD) 32 | @XmlType(name = "", propOrder = { 33 | "extension" 34 | }) 35 | @XmlRootElement(name = "extensions") 36 | public class Extensions { 37 | 38 | protected List
44 | * This accessor method returns a reference to the live list,
45 | * not a snapshot. Therefore any modification you make to the
46 | * returned list will be present inside the Jakarta XML Binding object.
47 | * This is why there is not a set
method for the extension property.
48 | *
49 | *
50 | * For example, to add a new item, do as follows: 51 | *
52 | * getExtension().add(newItem); 53 | *54 | * 55 | * 56 | *
57 | * Objects of the following type(s) are allowed in the list
58 | * {@link Extension }
59 | *
60 | *
61 | */
62 | public List Java class for anonymous complex type.
14 | *
15 | * The following schema fragment specifies the expected content contained within this class.
16 | *
17 | *
44 | * This accessor method returns a reference to the live list,
45 | * not a snapshot. Therefore any modification you make to the
46 | * returned list will be present inside the Jakarta XML Binding object.
47 | * This is why there is not a
50 | * For example, to add a new item, do as follows:
51 | *
57 | * Objects of the following type(s) are allowed in the list
58 | * {@link Group }
59 | *
60 | *
61 | */
62 | public List Java class for anonymous complex type.
14 | *
15 | * The following schema fragment specifies the expected content contained within this class.
16 | *
17 | *
18 | * <complexType>
19 | * <complexContent>
20 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
21 | * <sequence>
22 | * <element ref="{}group" maxOccurs="unbounded" minOccurs="0"/>
23 | * </sequence>
24 | * </restriction>
25 | * </complexContent>
26 | * </complexType>
27 | *
28 | *
29 | *
30 | */
31 | @XmlAccessorType(XmlAccessType.FIELD)
32 | @XmlType(name = "", propOrder = {
33 | "group"
34 | })
35 | @XmlRootElement(name = "groups")
36 | public class Groups {
37 |
38 | protected Listset
method for the group property.
48 | *
49 | *
52 | * getGroup().add(newItem);
53 | *
54 | *
55 | *
56 | *
18 | * <complexType>
19 | * <complexContent>
20 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
21 | * <attGroup ref="{}Name"/>
22 | * </restriction>
23 | * </complexContent>
24 | * </complexType>
25 | *
26 | *
27 | *
28 | */
29 | @XmlAccessorType(XmlAccessType.FIELD)
30 | @XmlType(name = "")
31 | @XmlRootElement(name = "vecequiv")
32 | public class Vecequiv {
33 |
34 | @XmlAttribute(name = "name", required = true)
35 | @XmlSchemaType(name = "anySimpleType")
36 | protected String name;
37 |
38 | /**
39 | * Gets the value of the name property.
40 | *
41 | * @return
42 | * possible object is
43 | * {@link String }
44 | *
45 | */
46 | public String getName() {
47 | return name;
48 | }
49 |
50 | /**
51 | * Sets the value of the name property.
52 | *
53 | * @param value
54 | * allowed object is
55 | * {@link String }
56 | *
57 | */
58 | public void setName(String value) {
59 | this.name = value;
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/mc-image-substgen/src/main/kotlin/de/kb1000/mcimage/substgen/GeneratePatchedSharedSecrets.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2021-2022 kb1000.
3 | *
4 | * This Source Code Form is subject to the terms of the Mozilla Public
5 | * License, v. 2.0. If a copy of the MPL was not distributed with this
6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 | */
8 |
9 | package de.kb1000.mcimage.substgen
10 |
11 | import org.objectweb.asm.ClassReader
12 | import org.objectweb.asm.ClassVisitor
13 | import org.objectweb.asm.ClassWriter
14 | import org.objectweb.asm.FieldVisitor
15 | import org.objectweb.asm.Opcodes.ASM9
16 | import java.io.InputStream
17 | import java.util.*
18 | import kotlin.io.path.createDirectories
19 | import kotlin.io.path.div
20 | import kotlin.io.path.writeBytes
21 |
22 | fun generatePatchedSharedSecrets() {
23 | val targetFile = jdkPatchTargetDir / "jdk" / "internal" / "access" / "SharedSecrets.class"
24 | targetFile.parent.createDirectories()
25 |
26 | val classReader = TreeMap::class.java.module.getResourceAsStream("jdk/internal/access/SharedSecrets.class").use(::ClassReader)
27 | val classWriter = ClassWriter(classReader, ClassWriter.COMPUTE_FRAMES)
28 | classReader.accept(object : ClassVisitor(ASM9, classWriter) {
29 | override fun visitField(
30 | access: Int,
31 | name: String,
32 | descriptor: String,
33 | signature: String?,
34 | value: Any?
35 | ): FieldVisitor? {
36 | val fv = super.visitField(access, name, descriptor, signature, value) ?: return null
37 | fv.visitAnnotation("Ljdk/internal/vm/annotation/Stable;", true)?.visitEnd()
38 | return fv
39 | }
40 | }, 0)
41 | targetFile.writeBytes(classWriter.toByteArray())
42 | }
--------------------------------------------------------------------------------
/mc-image-substgen/src/main/kotlin/de/kb1000/mcimage/substgen/Main.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2021-2022 kb1000.
3 | *
4 | * This Source Code Form is subject to the terms of the Mozilla Public
5 | * License, v. 2.0. If a copy of the MPL was not distributed with this
6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 | */
8 |
9 | @file:JvmName("Main")
10 |
11 | package de.kb1000.mcimage.substgen
12 |
13 | import java.nio.file.FileSystem
14 | import java.nio.file.FileSystems
15 | import kotlin.io.path.Path
16 | import kotlin.io.path.toPath
17 | import kotlin.reflect.KClass
18 |
19 | fun openJar(c: KClass<*>): FileSystem =
20 | FileSystems.newFileSystem(c.java.protectionDomain.codeSource.location.toURI().toPath())
21 |
22 | var targetDir = Path("mc-image-lib", "gen")
23 |
24 | fun main(args: Array