Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 17 jdk.jfr.jmod - JFR Module
JDK 17 jdk.jfr.jmod is the JMOD file for JDK 17 JFR module.
JDK 17 JFR module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.jfr.jmod.
JDK 17 JFR module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 JFR module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.jfr.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/jfr/internal/jfc/model/Utilities.java
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package jdk.jfr.internal.jfc.model;
import java.util.StringJoiner;
public final class Utilities {
private static final String[] UNITS = new String[] {
"ns", "us", "ns", "ms", "s", "m", "h", "d" // order matters
};
static XmlElement instantiate(Class<? extends XmlElement> type) {
try {
return type.getDeclaredConstructor().newInstance();
} catch (Exception e) {
throw new InternalError("Unable to instantiate " + type, e);
}
}
static String elementName(Class<? extends XmlElement> type) {
String name = type.getSimpleName();
if (name.startsWith("Xml") && name.length() > 3) {
return name.substring(3).toLowerCase();
}
throw new InternalError("Unexpected class " + type);
}
static String escapeAll(String text) {
StringBuilder s = new StringBuilder();
for (int i = 0; i < text.length(); i++) {
addCharacter(s, text.charAt(i));
}
return s.toString();
}
private static void addCharacter(StringBuilder s, char c) {
if (c == 34) {
s.append(""");
return;
}
if (c == 38) {
s.append("&");
return;
}
if (c == 39) {
s.append("'");
return;
}
if (c == 60) {
s.append("<");
return;
}
if (c == 62) {
s.append(">");
return;
}
if (c > 0x7F) {
s.append("&#");
s.append((int) c);
s.append(';');
return;
}
s.append(c);
}
static void checkValid(String value, Object... valid) {
StringJoiner sj = new StringJoiner(", ");
for (Object v : valid) {
if (v.equals(value)) {
return;
}
sj.add("'" + v + "'");
}
String msg = "Incorrect value '" + value + "'. Valid values are " + sj.toString() + ".";
int index = msg.lastIndexOf(",");
if (index != -1) {
msg = msg.substring(0, index) + " and" + msg.substring(index + 1);
}
throw new IllegalArgumentException(msg);
}
static String parseTimespan(String s) {
StringBuilder sb = new StringBuilder();
try {
for (String unit : UNITS) {
if (s.endsWith(unit)) {
return parseForUnit(s, unit);
}
}
Long.parseLong(s);
sb.append("Timespan '" + s + "' is missing unit.");
} catch (NumberFormatException nfe) {
sb.append("'" + s + "' is not a valid timespan." + System.lineSeparator());
sb.append("Should be numeric value followed by a unit, i.e. 20 ms.");
}
sb.append(" Valid units are ns, us, ms, s, m, h and d.");
throw new IllegalArgumentException(sb.toString());
}
private static String parseForUnit(String s, String unit) {
String number = s.trim().substring(0, s.length() - unit.length());
return Long.parseLong(number.trim()) + " " + unit;
}
}
⏎ jdk/jfr/internal/jfc/model/Utilities.java
Or download all of them as a single archive file:
File name: jdk.jfr-17.0.5-src.zip File size: 363343 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.jlink.jmod - JLink Tool
2023-04-17, ≈67🔥, 0💬
Popular Posts:
What Is jaxb-api-2.1.6.jar? Java Architecture for XML Binding (JAXB) is a Java API that allows Java ...
What Is poi-ooxml-3.5.jar? poi-ooxml-3.5.jar is one of the JAR files for Apache POI 3.5, which provi...
How to download and install Apache ZooKeeper Source Package? Apache ZooKeeper is an open-source serv...
commons-io-2.6-sources.j aris the source JAR file for Apache Commons IO 2.6, which is a library of u...
The JDT project provides the tool plug-ins that implement a Java IDE supporting the development of a...