id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
19,300 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/table/MTable.java | MTable.addColumn | public MTable<T> addColumn(final String attribute, final String libelle) {
final int modelIndex = getColumnCount();
final TableColumn tableColumn = new TableColumn(modelIndex);
// on met l'énumération de l'attribut comme identifier dans le TableColumn pour s'en servir dans MTableModel
tableColumn.setIdentif... | java | public MTable<T> addColumn(final String attribute, final String libelle) {
final int modelIndex = getColumnCount();
final TableColumn tableColumn = new TableColumn(modelIndex);
// on met l'énumération de l'attribut comme identifier dans le TableColumn pour s'en servir dans MTableModel
tableColumn.setIdentif... | [
"public",
"MTable",
"<",
"T",
">",
"addColumn",
"(",
"final",
"String",
"attribute",
",",
"final",
"String",
"libelle",
")",
"{",
"final",
"int",
"modelIndex",
"=",
"getColumnCount",
"(",
")",
";",
"final",
"TableColumn",
"tableColumn",
"=",
"new",
"TableCol... | Ajoute une colonne dans la table.
@param attribute
Nom de l'attribut des objets à afficher dans la colonne<br/>
@param libelle
Libellé à afficher en entête de la colonne
@return this (fluent) | [
"Ajoute",
"une",
"colonne",
"dans",
"la",
"table",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/table/MTable.java#L118-L133 |
19,301 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/web/pdf/PdfMBeansReport.java | PdfMBeansReport.writeTree | void writeTree() throws DocumentException {
// MBeans pour la plateforme
margin = 0;
final MBeanNode platformNode = mbeans.get(0);
writeTree(platformNode.getChildren());
for (final MBeanNode node : mbeans) {
if (node != platformNode) {
newPage();
addToDocument(new Chunk(node.getName(), bo... | java | void writeTree() throws DocumentException {
// MBeans pour la plateforme
margin = 0;
final MBeanNode platformNode = mbeans.get(0);
writeTree(platformNode.getChildren());
for (final MBeanNode node : mbeans) {
if (node != platformNode) {
newPage();
addToDocument(new Chunk(node.getName(), bo... | [
"void",
"writeTree",
"(",
")",
"throws",
"DocumentException",
"{",
"// MBeans pour la plateforme\r",
"margin",
"=",
"0",
";",
"final",
"MBeanNode",
"platformNode",
"=",
"mbeans",
".",
"get",
"(",
"0",
")",
";",
"writeTree",
"(",
"platformNode",
".",
"getChildren... | Affiche l'arbre des MBeans.
@throws DocumentException e | [
"Affiche",
"l",
"arbre",
"des",
"MBeans",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/web/pdf/PdfMBeansReport.java#L62-L76 |
19,302 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/util/MSwingUtilities.java | MSwingUtilities.getScaledInstance | public static ImageIcon getScaledInstance(ImageIcon icon, int targetWidth, int targetHeight) {
return new ImageIcon(getScaledInstance(icon.getImage(), targetWidth, targetHeight));
} | java | public static ImageIcon getScaledInstance(ImageIcon icon, int targetWidth, int targetHeight) {
return new ImageIcon(getScaledInstance(icon.getImage(), targetWidth, targetHeight));
} | [
"public",
"static",
"ImageIcon",
"getScaledInstance",
"(",
"ImageIcon",
"icon",
",",
"int",
"targetWidth",
",",
"int",
"targetHeight",
")",
"{",
"return",
"new",
"ImageIcon",
"(",
"getScaledInstance",
"(",
"icon",
".",
"getImage",
"(",
")",
",",
"targetWidth",
... | Redimensionne une ImageIcon.
@param icon ImageIcon
@param targetWidth int
@param targetHeight int
@return ImageIcon | [
"Redimensionne",
"une",
"ImageIcon",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/util/MSwingUtilities.java#L217-L219 |
19,303 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/util/MSwingUtilities.java | MSwingUtilities.getScaledInstance | public static Image getScaledInstance(Image img, int targetWidth, int targetHeight) {
final int type = BufferedImage.TYPE_INT_ARGB;
Image ret = img;
final int width = ret.getWidth(null);
final int height = ret.getHeight(null);
if (width != targetWidth && height != targetHeight) {
// a priori plus per... | java | public static Image getScaledInstance(Image img, int targetWidth, int targetHeight) {
final int type = BufferedImage.TYPE_INT_ARGB;
Image ret = img;
final int width = ret.getWidth(null);
final int height = ret.getHeight(null);
if (width != targetWidth && height != targetHeight) {
// a priori plus per... | [
"public",
"static",
"Image",
"getScaledInstance",
"(",
"Image",
"img",
",",
"int",
"targetWidth",
",",
"int",
"targetHeight",
")",
"{",
"final",
"int",
"type",
"=",
"BufferedImage",
".",
"TYPE_INT_ARGB",
";",
"Image",
"ret",
"=",
"img",
";",
"final",
"int",
... | Redimensionne une image.
@param img Image
@param targetWidth int
@param targetHeight int
@return Image | [
"Redimensionne",
"une",
"image",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/util/MSwingUtilities.java#L228-L244 |
19,304 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/TransportFormatAdapter.java | TransportFormatAdapter.writeXml | public static void writeXml(Serializable serializable, OutputStream output) throws IOException {
TransportFormat.XML.writeSerializableTo(serializable, output);
} | java | public static void writeXml(Serializable serializable, OutputStream output) throws IOException {
TransportFormat.XML.writeSerializableTo(serializable, output);
} | [
"public",
"static",
"void",
"writeXml",
"(",
"Serializable",
"serializable",
",",
"OutputStream",
"output",
")",
"throws",
"IOException",
"{",
"TransportFormat",
".",
"XML",
".",
"writeSerializableTo",
"(",
"serializable",
",",
"output",
")",
";",
"}"
] | Export XML.
@param serializable Serializable
@param output OutputStream
@throws IOException e | [
"Export",
"XML",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/TransportFormatAdapter.java#L41-L43 |
19,305 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/TransportFormatAdapter.java | TransportFormatAdapter.writeJson | public static void writeJson(Serializable serializable, OutputStream output)
throws IOException {
TransportFormat.JSON.writeSerializableTo(serializable, output);
} | java | public static void writeJson(Serializable serializable, OutputStream output)
throws IOException {
TransportFormat.JSON.writeSerializableTo(serializable, output);
} | [
"public",
"static",
"void",
"writeJson",
"(",
"Serializable",
"serializable",
",",
"OutputStream",
"output",
")",
"throws",
"IOException",
"{",
"TransportFormat",
".",
"JSON",
".",
"writeSerializableTo",
"(",
"serializable",
",",
"output",
")",
";",
"}"
] | Export JSON.
@param serializable Serializable
@param output OutputStream
@throws IOException e | [
"Export",
"JSON",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/TransportFormatAdapter.java#L51-L54 |
19,306 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/Main.java | Main.initLookAndFeel | private static void initLookAndFeel() {
// UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
for (final LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
try {
UIManager.setLookAndFeel(info.getClassName());
break;
}... | java | private static void initLookAndFeel() {
// UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
for (final LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
try {
UIManager.setLookAndFeel(info.getClassName());
break;
}... | [
"private",
"static",
"void",
"initLookAndFeel",
"(",
")",
"{",
"// UIManager.setLookAndFeel(\"javax.swing.plaf.nimbus.NimbusLookAndFeel\");\r",
"for",
"(",
"final",
"LookAndFeelInfo",
"info",
":",
"UIManager",
".",
"getInstalledLookAndFeels",
"(",
")",
")",
"{",
"if",
"("... | Initialisation du L&F. | [
"Initialisation",
"du",
"L&F",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/Main.java#L144-L156 |
19,307 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/common/I18N.java | I18N.getResourceBundle | public static ResourceBundle getResourceBundle() {
final Locale currentLocale = getCurrentLocale();
if (Locale.ENGLISH.getLanguage().equals(currentLocale.getLanguage())) {
// there is no translations_en.properties because translations.properties is in English
// but if user is English, do not let getBundl... | java | public static ResourceBundle getResourceBundle() {
final Locale currentLocale = getCurrentLocale();
if (Locale.ENGLISH.getLanguage().equals(currentLocale.getLanguage())) {
// there is no translations_en.properties because translations.properties is in English
// but if user is English, do not let getBundl... | [
"public",
"static",
"ResourceBundle",
"getResourceBundle",
"(",
")",
"{",
"final",
"Locale",
"currentLocale",
"=",
"getCurrentLocale",
"(",
")",
";",
"if",
"(",
"Locale",
".",
"ENGLISH",
".",
"getLanguage",
"(",
")",
".",
"equals",
"(",
"currentLocale",
".",
... | Retourne les traductions pour la locale courante.
@return Locale | [
"Retourne",
"les",
"traductions",
"pour",
"la",
"locale",
"courante",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/common/I18N.java#L82-L93 |
19,308 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/common/I18N.java | I18N.getStringForJavascript | public static String getStringForJavascript(String key) {
final String string = getString(key);
// ici, le résultat ne contient pas de valeur variable ni d'attaque puisque ce sont des messages internes et fixes,
// donc pas besoin d'encoder avec javascriptEncode, et on conserve les apostrophes lisibles dans le... | java | public static String getStringForJavascript(String key) {
final String string = getString(key);
// ici, le résultat ne contient pas de valeur variable ni d'attaque puisque ce sont des messages internes et fixes,
// donc pas besoin d'encoder avec javascriptEncode, et on conserve les apostrophes lisibles dans le... | [
"public",
"static",
"String",
"getStringForJavascript",
"(",
"String",
"key",
")",
"{",
"final",
"String",
"string",
"=",
"getString",
"(",
"key",
")",
";",
"// ici, le résultat ne contient pas de valeur variable ni d'attaque puisque ce sont des messages internes et fixes,\r",
... | Retourne une traduction dans la locale courante et l'encode pour affichage en javascript.
@param key clé d'un libellé dans les fichiers de traduction
@return String | [
"Retourne",
"une",
"traduction",
"dans",
"la",
"locale",
"courante",
"et",
"l",
"encode",
"pour",
"affichage",
"en",
"javascript",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/common/I18N.java#L116-L122 |
19,309 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/common/I18N.java | I18N.htmlEncode | public static String htmlEncode(String text, boolean encodeSpace) {
// ces encodages html sont incomplets mais suffisants pour le monitoring
String result = text.replaceAll("[&]", "&").replaceAll("[<]", "<")
.replaceAll("[>]", ">").replaceAll("[\n]", "<br/>");
if (encodeSpace) {
result = res... | java | public static String htmlEncode(String text, boolean encodeSpace) {
// ces encodages html sont incomplets mais suffisants pour le monitoring
String result = text.replaceAll("[&]", "&").replaceAll("[<]", "<")
.replaceAll("[>]", ">").replaceAll("[\n]", "<br/>");
if (encodeSpace) {
result = res... | [
"public",
"static",
"String",
"htmlEncode",
"(",
"String",
"text",
",",
"boolean",
"encodeSpace",
")",
"{",
"// ces encodages html sont incomplets mais suffisants pour le monitoring\r",
"String",
"result",
"=",
"text",
".",
"replaceAll",
"(",
"\"[&]\"",
",",
"\"&\"",
... | Encode pour affichage en html.
@param text message à encoder
@param encodeSpace booléen selon que les espaces sont encodés en nbsp (insécables)
@return String | [
"Encode",
"pour",
"affichage",
"en",
"html",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/common/I18N.java#L156-L164 |
19,310 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/model/Counter.java | Counter.readFromFile | void readFromFile() throws IOException {
final Counter counter = new CounterStorage(this).readFromFile();
if (counter != null) {
final Counter newCounter = clone();
startDate = counter.getStartDate();
requests.clear();
for (final CounterRequest request : counter.getRequests()) {
requests.put(... | java | void readFromFile() throws IOException {
final Counter counter = new CounterStorage(this).readFromFile();
if (counter != null) {
final Counter newCounter = clone();
startDate = counter.getStartDate();
requests.clear();
for (final CounterRequest request : counter.getRequests()) {
requests.put(... | [
"void",
"readFromFile",
"(",
")",
"throws",
"IOException",
"{",
"final",
"Counter",
"counter",
"=",
"new",
"CounterStorage",
"(",
"this",
")",
".",
"readFromFile",
"(",
")",
";",
"if",
"(",
"counter",
"!=",
"null",
")",
"{",
"final",
"Counter",
"newCounter... | Lecture du counter depuis son fichier.
@throws IOException e | [
"Lecture",
"du",
"counter",
"depuis",
"son",
"fichier",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/model/Counter.java#L935-L952 |
19,311 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MPrinter.java | MPrinter.chooseFile | protected File chooseFile(final JTable table, final String extension) throws IOException {
final JFileChooser myFileChooser = getFileChooser();
final MExtensionFileFilter filter = new MExtensionFileFilter(extension);
myFileChooser.addChoosableFileFilter(filter);
String title = buildTitle(table);
if (... | java | protected File chooseFile(final JTable table, final String extension) throws IOException {
final JFileChooser myFileChooser = getFileChooser();
final MExtensionFileFilter filter = new MExtensionFileFilter(extension);
myFileChooser.addChoosableFileFilter(filter);
String title = buildTitle(table);
if (... | [
"protected",
"File",
"chooseFile",
"(",
"final",
"JTable",
"table",
",",
"final",
"String",
"extension",
")",
"throws",
"IOException",
"{",
"final",
"JFileChooser",
"myFileChooser",
"=",
"getFileChooser",
"(",
")",
";",
"final",
"MExtensionFileFilter",
"filter",
"... | Choix du fichier pour un export.
@return File
@param table
JTable
@param extension
String
@throws IOException
Erreur disque | [
"Choix",
"du",
"fichier",
"pour",
"un",
"export",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MPrinter.java#L152-L184 |
19,312 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/util/MWaitCursor.java | MWaitCursor.restore | public void restore() {
if (window instanceof RootPaneContainer) {
final Component glassPane = ((RootPaneContainer) window).getGlassPane();
glassPane.setVisible(windowGlassPaneVisible);
glassPane.setCursor(oldWindowCursor);
}
if (window != null) {
window.setCursor(oldWindowCursor);
}
} | java | public void restore() {
if (window instanceof RootPaneContainer) {
final Component glassPane = ((RootPaneContainer) window).getGlassPane();
glassPane.setVisible(windowGlassPaneVisible);
glassPane.setCursor(oldWindowCursor);
}
if (window != null) {
window.setCursor(oldWindowCursor);
}
} | [
"public",
"void",
"restore",
"(",
")",
"{",
"if",
"(",
"window",
"instanceof",
"RootPaneContainer",
")",
"{",
"final",
"Component",
"glassPane",
"=",
"(",
"(",
"RootPaneContainer",
")",
"window",
")",
".",
"getGlassPane",
"(",
")",
";",
"glassPane",
".",
"... | Restore l'ancien curseur, en fin de traitement. | [
"Restore",
"l",
"ancien",
"curseur",
"en",
"fin",
"de",
"traitement",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/util/MWaitCursor.java#L67-L76 |
19,313 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/MonitoringGuiceInterceptor.java | MonitoringGuiceInterceptor.getRequestName | protected String getRequestName(MethodInvocation invocation) {
final String classPart = getClassPart(invocation);
final String methodPart = getMethodPart(invocation);
return classPart + '.' + methodPart;
} | java | protected String getRequestName(MethodInvocation invocation) {
final String classPart = getClassPart(invocation);
final String methodPart = getMethodPart(invocation);
return classPart + '.' + methodPart;
} | [
"protected",
"String",
"getRequestName",
"(",
"MethodInvocation",
"invocation",
")",
"{",
"final",
"String",
"classPart",
"=",
"getClassPart",
"(",
"invocation",
")",
";",
"final",
"String",
"methodPart",
"=",
"getMethodPart",
"(",
"invocation",
")",
";",
"return"... | Determine request name for a method invocation.
@param invocation the method invocation (not null)
@return the request name for this invocation | [
"Determine",
"request",
"name",
"for",
"a",
"method",
"invocation",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/MonitoringGuiceInterceptor.java#L91-L95 |
19,314 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/model/RrdNioBackend.java | RrdNioBackend.write | @Override
protected synchronized void write(long offset, byte[] b) throws IOException {
if (byteBuffer != null) {
byteBuffer.position((int) offset);
byteBuffer.put(b);
} else {
throw new IOException("Write failed, file " + getPath() + " not mapped for I/O");
}
} | java | @Override
protected synchronized void write(long offset, byte[] b) throws IOException {
if (byteBuffer != null) {
byteBuffer.position((int) offset);
byteBuffer.put(b);
} else {
throw new IOException("Write failed, file " + getPath() + " not mapped for I/O");
}
} | [
"@",
"Override",
"protected",
"synchronized",
"void",
"write",
"(",
"long",
"offset",
",",
"byte",
"[",
"]",
"b",
")",
"throws",
"IOException",
"{",
"if",
"(",
"byteBuffer",
"!=",
"null",
")",
"{",
"byteBuffer",
".",
"position",
"(",
"(",
"int",
")",
"... | Writes bytes to the underlying RRD file on the disk
@param offset Starting file offset
@param b Bytes to be written. | [
"Writes",
"bytes",
"to",
"the",
"underlying",
"RRD",
"file",
"on",
"the",
"disk"
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/model/RrdNioBackend.java#L171-L179 |
19,315 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/model/RrdNioBackend.java | RrdNioBackend.read | @Override
protected synchronized void read(long offset, byte[] b) throws IOException {
if (byteBuffer != null) {
byteBuffer.position((int) offset);
byteBuffer.get(b);
} else {
throw new IOException("Read failed, file " + getPath() + " not mapped for I/O");
}
} | java | @Override
protected synchronized void read(long offset, byte[] b) throws IOException {
if (byteBuffer != null) {
byteBuffer.position((int) offset);
byteBuffer.get(b);
} else {
throw new IOException("Read failed, file " + getPath() + " not mapped for I/O");
}
} | [
"@",
"Override",
"protected",
"synchronized",
"void",
"read",
"(",
"long",
"offset",
",",
"byte",
"[",
"]",
"b",
")",
"throws",
"IOException",
"{",
"if",
"(",
"byteBuffer",
"!=",
"null",
")",
"{",
"byteBuffer",
".",
"position",
"(",
"(",
"int",
")",
"o... | Reads a number of bytes from the RRD file on the disk
@param offset Starting file offset
@param b Buffer which receives bytes read from the file. | [
"Reads",
"a",
"number",
"of",
"bytes",
"from",
"the",
"RRD",
"file",
"on",
"the",
"disk"
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/model/RrdNioBackend.java#L187-L195 |
19,316 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/model/RrdNioBackend.java | RrdNioBackend.close | @Override
public synchronized void close() throws IOException {
// cancel synchronization
try {
if (syncTask != null) {
syncTask.cancel();
}
sync();
unmapFile();
} finally {
super.close();
}
} | java | @Override
public synchronized void close() throws IOException {
// cancel synchronization
try {
if (syncTask != null) {
syncTask.cancel();
}
sync();
unmapFile();
} finally {
super.close();
}
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"// cancel synchronization\r",
"try",
"{",
"if",
"(",
"syncTask",
"!=",
"null",
")",
"{",
"syncTask",
".",
"cancel",
"(",
")",
";",
"}",
"sync",
"(",
")",
... | Closes the underlying RRD file.
@throws IOException Thrown in case of I/O error | [
"Closes",
"the",
"underlying",
"RRD",
"file",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/model/RrdNioBackend.java#L202-L214 |
19,317 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/util/ShadowPopupFactory.java | ShadowPopupFactory.uninstall | public static void uninstall() {
final PopupFactory factory = PopupFactory.getSharedInstance();
if (!(factory instanceof ShadowPopupFactory)) {
return;
}
final PopupFactory stored = ((ShadowPopupFactory) factory).storedFactory;
PopupFactory.setSharedInstance(stored);
} | java | public static void uninstall() {
final PopupFactory factory = PopupFactory.getSharedInstance();
if (!(factory instanceof ShadowPopupFactory)) {
return;
}
final PopupFactory stored = ((ShadowPopupFactory) factory).storedFactory;
PopupFactory.setSharedInstance(stored);
} | [
"public",
"static",
"void",
"uninstall",
"(",
")",
"{",
"final",
"PopupFactory",
"factory",
"=",
"PopupFactory",
".",
"getSharedInstance",
"(",
")",
";",
"if",
"(",
"!",
"(",
"factory",
"instanceof",
"ShadowPopupFactory",
")",
")",
"{",
"return",
";",
"}",
... | Uninstalls the ShadowPopupFactory and restores the original
popup factory as the new shared popup factory.
@see #install() | [
"Uninstalls",
"the",
"ShadowPopupFactory",
"and",
"restores",
"the",
"original",
"popup",
"factory",
"as",
"the",
"new",
"shared",
"popup",
"factory",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/util/ShadowPopupFactory.java#L118-L126 |
19,318 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/web/PrometheusController.java | PrometheusController.report | void report(boolean includeLastValue) throws IOException {
// see https://prometheus.io/docs/instrumenting/exposition_formats/ for text format
// memory
reportOnMemoryInformations(javaInformations.getMemoryInformations());
// jvm & system
reportOnJavaInformations();
// tomcat
if (javaInformatio... | java | void report(boolean includeLastValue) throws IOException {
// see https://prometheus.io/docs/instrumenting/exposition_formats/ for text format
// memory
reportOnMemoryInformations(javaInformations.getMemoryInformations());
// jvm & system
reportOnJavaInformations();
// tomcat
if (javaInformatio... | [
"void",
"report",
"(",
"boolean",
"includeLastValue",
")",
"throws",
"IOException",
"{",
"// see https://prometheus.io/docs/instrumenting/exposition_formats/ for text format\r",
"// memory\r",
"reportOnMemoryInformations",
"(",
"javaInformations",
".",
"getMemoryInformations",
"(",
... | Produce the full report.
@param includeLastValue boolean
@throws IOException e | [
"Produce",
"the",
"full",
"report",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/web/PrometheusController.java#L211-L234 |
19,319 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/web/PrometheusController.java | PrometheusController.reportOnCollector | private void reportOnCollector() {
for (final Counter counter : collector.getCounters()) {
if (!counter.isDisplayed()) {
continue;
}
final List<CounterRequest> requests = counter.getRequests();
long hits = 0;
long duration = 0;
long errors = 0;
for (final CounterRequest cr : requests... | java | private void reportOnCollector() {
for (final Counter counter : collector.getCounters()) {
if (!counter.isDisplayed()) {
continue;
}
final List<CounterRequest> requests = counter.getRequests();
long hits = 0;
long duration = 0;
long errors = 0;
for (final CounterRequest cr : requests... | [
"private",
"void",
"reportOnCollector",
"(",
")",
"{",
"for",
"(",
"final",
"Counter",
"counter",
":",
"collector",
".",
"getCounters",
"(",
")",
")",
"{",
"if",
"(",
"!",
"counter",
".",
"isDisplayed",
"(",
")",
")",
"{",
"continue",
";",
"}",
"final"... | Reports on hits, errors, and duration sum for all counters in the collector.
Bypasses the {@link JRobin#getLastValue()} methods to provide real-time counters as well as
improving performance from bypassing JRobin reads in the getLastValue() method. | [
"Reports",
"on",
"hits",
"errors",
"and",
"duration",
"sum",
"for",
"all",
"counters",
"in",
"the",
"collector",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/web/PrometheusController.java#L353-L382 |
19,320 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/web/PrometheusController.java | PrometheusController.reportOnLastValues | private void reportOnLastValues() throws IOException {
Collection<JRobin> jrobins = collector.getDisplayedCounterJRobins();
for (final JRobin jrobin : jrobins) {
printDouble(MetricType.GAUGE, "last_value_" + camelToSnake(jrobin.getName()),
"javamelody value per minute", jrobin.getLastValue());
}
... | java | private void reportOnLastValues() throws IOException {
Collection<JRobin> jrobins = collector.getDisplayedCounterJRobins();
for (final JRobin jrobin : jrobins) {
printDouble(MetricType.GAUGE, "last_value_" + camelToSnake(jrobin.getName()),
"javamelody value per minute", jrobin.getLastValue());
}
... | [
"private",
"void",
"reportOnLastValues",
"(",
")",
"throws",
"IOException",
"{",
"Collection",
"<",
"JRobin",
">",
"jrobins",
"=",
"collector",
".",
"getDisplayedCounterJRobins",
"(",
")",
";",
"for",
"(",
"final",
"JRobin",
"jrobin",
":",
"jrobins",
")",
"{",... | Includes the traditional 'graph' fields from the 'lastValue' API.
These fields are summary fields aggregated over `javamelody.resolutions-seconds` (default 60), which
is normally an odd thing to pass to Prometheus. Most (all?) of these can be calculated inside
Prometheus from the Collector stats.
Note: This lookup s... | [
"Includes",
"the",
"traditional",
"graph",
"fields",
"from",
"the",
"lastValue",
"API",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/web/PrometheusController.java#L397-L409 |
19,321 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/web/PrometheusController.java | PrometheusController.camelToSnake | private static String camelToSnake(String camel) {
return CAMEL_TO_SNAKE_PATTERN.matcher(camel).replaceAll("$1_$2").toLowerCase(Locale.US);
} | java | private static String camelToSnake(String camel) {
return CAMEL_TO_SNAKE_PATTERN.matcher(camel).replaceAll("$1_$2").toLowerCase(Locale.US);
} | [
"private",
"static",
"String",
"camelToSnake",
"(",
"String",
"camel",
")",
"{",
"return",
"CAMEL_TO_SNAKE_PATTERN",
".",
"matcher",
"(",
"camel",
")",
".",
"replaceAll",
"(",
"\"$1_$2\"",
")",
".",
"toLowerCase",
"(",
"Locale",
".",
"US",
")",
";",
"}"
] | Converts a camelCase or CamelCase string to camel_case
@param camel String
@return String | [
"Converts",
"a",
"camelCase",
"or",
"CamelCase",
"string",
"to",
"camel_case"
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/web/PrometheusController.java#L516-L518 |
19,322 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/web/PrometheusController.java | PrometheusController.sanitizeName | private static String sanitizeName(String name) {
final String lowerCaseName = name.toLowerCase(Locale.US);
final String separatorReplacedName = SANITIZE_TO_UNDERSCORE_PATTERN.matcher(lowerCaseName)
.replaceAll(UNDERSCORE);
return SANITIZE_REMOVE_PATTERN.matcher(separatorReplacedName).replaceAll(EMPTY_STR... | java | private static String sanitizeName(String name) {
final String lowerCaseName = name.toLowerCase(Locale.US);
final String separatorReplacedName = SANITIZE_TO_UNDERSCORE_PATTERN.matcher(lowerCaseName)
.replaceAll(UNDERSCORE);
return SANITIZE_REMOVE_PATTERN.matcher(separatorReplacedName).replaceAll(EMPTY_STR... | [
"private",
"static",
"String",
"sanitizeName",
"(",
"String",
"name",
")",
"{",
"final",
"String",
"lowerCaseName",
"=",
"name",
".",
"toLowerCase",
"(",
"Locale",
".",
"US",
")",
";",
"final",
"String",
"separatorReplacedName",
"=",
"SANITIZE_TO_UNDERSCORE_PATTER... | converts to lowercase, replaces common separators with underscores, and strips all remaining non-alpha-numeric characters.
@param name String
@return String | [
"converts",
"to",
"lowercase",
"replaces",
"common",
"separators",
"with",
"underscores",
"and",
"strips",
"all",
"remaining",
"non",
"-",
"alpha",
"-",
"numeric",
"characters",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/web/PrometheusController.java#L525-L530 |
19,323 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/web/PrometheusController.java | PrometheusController.printLong | private void printLong(MetricType metricType, String name, String description, long value) {
printHeader(metricType, name, description);
printLongWithFields(name, null, value);
} | java | private void printLong(MetricType metricType, String name, String description, long value) {
printHeader(metricType, name, description);
printLongWithFields(name, null, value);
} | [
"private",
"void",
"printLong",
"(",
"MetricType",
"metricType",
",",
"String",
"name",
",",
"String",
"description",
",",
"long",
"value",
")",
"{",
"printHeader",
"(",
"metricType",
",",
"name",
",",
"description",
")",
";",
"printLongWithFields",
"(",
"name... | prints a long metric value, including HELP and TYPE rows | [
"prints",
"a",
"long",
"metric",
"value",
"including",
"HELP",
"and",
"TYPE",
"rows"
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/web/PrometheusController.java#L533-L536 |
19,324 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/web/PrometheusController.java | PrometheusController.printDouble | private void printDouble(MetricType metricType, String name, String description, double value) {
printHeader(metricType, name, description);
printDoubleWithFields(name, null, value);
} | java | private void printDouble(MetricType metricType, String name, String description, double value) {
printHeader(metricType, name, description);
printDoubleWithFields(name, null, value);
} | [
"private",
"void",
"printDouble",
"(",
"MetricType",
"metricType",
",",
"String",
"name",
",",
"String",
"description",
",",
"double",
"value",
")",
"{",
"printHeader",
"(",
"metricType",
",",
"name",
",",
"description",
")",
";",
"printDoubleWithFields",
"(",
... | prints a double metric value, including HELP and TYPE rows | [
"prints",
"a",
"double",
"metric",
"value",
"including",
"HELP",
"and",
"TYPE",
"rows"
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/web/PrometheusController.java#L539-L542 |
19,325 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/web/PrometheusController.java | PrometheusController.printLongWithFields | private void printLongWithFields(String name, String fields, long value) {
print(METRIC_PREFIX);
print(name);
if (fields != null) {
print(fields);
}
print(' ');
println(String.valueOf(value));
} | java | private void printLongWithFields(String name, String fields, long value) {
print(METRIC_PREFIX);
print(name);
if (fields != null) {
print(fields);
}
print(' ');
println(String.valueOf(value));
} | [
"private",
"void",
"printLongWithFields",
"(",
"String",
"name",
",",
"String",
"fields",
",",
"long",
"value",
")",
"{",
"print",
"(",
"METRIC_PREFIX",
")",
";",
"print",
"(",
"name",
")",
";",
"if",
"(",
"fields",
"!=",
"null",
")",
"{",
"print",
"("... | prints a long metric value with optional fields | [
"prints",
"a",
"long",
"metric",
"value",
"with",
"optional",
"fields"
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/web/PrometheusController.java#L545-L553 |
19,326 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/web/PrometheusController.java | PrometheusController.printDoubleWithFields | private void printDoubleWithFields(String name, String fields, double value) {
print(METRIC_PREFIX);
print(name);
if (fields != null) {
print(fields);
}
print(' ');
println(decimalFormat.format(value));
} | java | private void printDoubleWithFields(String name, String fields, double value) {
print(METRIC_PREFIX);
print(name);
if (fields != null) {
print(fields);
}
print(' ');
println(decimalFormat.format(value));
} | [
"private",
"void",
"printDoubleWithFields",
"(",
"String",
"name",
",",
"String",
"fields",
",",
"double",
"value",
")",
"{",
"print",
"(",
"METRIC_PREFIX",
")",
";",
"print",
"(",
"name",
")",
";",
"if",
"(",
"fields",
"!=",
"null",
")",
"{",
"print",
... | prints a double metric value with optional fields | [
"prints",
"a",
"double",
"metric",
"value",
"with",
"optional",
"fields"
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/web/PrometheusController.java#L556-L564 |
19,327 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/web/PrometheusController.java | PrometheusController.printHeader | private void printHeader(MetricType metricType, String name, String description) {
print("# HELP ");
print(METRIC_PREFIX);
print(name);
print(' ');
println(description);
print("# TYPE ");
print(METRIC_PREFIX);
print(name);
print(' ');
println(metricType.getCode());
} | java | private void printHeader(MetricType metricType, String name, String description) {
print("# HELP ");
print(METRIC_PREFIX);
print(name);
print(' ');
println(description);
print("# TYPE ");
print(METRIC_PREFIX);
print(name);
print(' ');
println(metricType.getCode());
} | [
"private",
"void",
"printHeader",
"(",
"MetricType",
"metricType",
",",
"String",
"name",
",",
"String",
"description",
")",
"{",
"print",
"(",
"\"# HELP \"",
")",
";",
"print",
"(",
"METRIC_PREFIX",
")",
";",
"print",
"(",
"name",
")",
";",
"print",
"(",
... | prints the HELP and TYPE rows | [
"prints",
"the",
"HELP",
"and",
"TYPE",
"rows"
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/web/PrometheusController.java#L567-L579 |
19,328 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/FilterContext.java | FilterContext.unregisterJmxExpose | private void unregisterJmxExpose() {
if (jmxNames.isEmpty()) {
return;
}
try {
final MBeanServer platformMBeanServer = MBeans.getPlatformMBeanServer();
for (final ObjectName name : jmxNames) {
platformMBeanServer.unregisterMBean(name);
}
} catch (final JMException e) {
LOG.warn("fai... | java | private void unregisterJmxExpose() {
if (jmxNames.isEmpty()) {
return;
}
try {
final MBeanServer platformMBeanServer = MBeans.getPlatformMBeanServer();
for (final ObjectName name : jmxNames) {
platformMBeanServer.unregisterMBean(name);
}
} catch (final JMException e) {
LOG.warn("fai... | [
"private",
"void",
"unregisterJmxExpose",
"(",
")",
"{",
"if",
"(",
"jmxNames",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"try",
"{",
"final",
"MBeanServer",
"platformMBeanServer",
"=",
"MBeans",
".",
"getPlatformMBeanServer",
"(",
")",
";",
... | Unregisters CounterRequestMXBean beans. | [
"Unregisters",
"CounterRequestMXBean",
"beans",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/FilterContext.java#L512-L524 |
19,329 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/print/AdvancedPageNumberEvents.java | AdvancedPageNumberEvents.onGenericTag | @Override
public void onGenericTag(final PdfWriter writer, final Document document, final Rectangle rect,
final String text) {
// rien ici
} | java | @Override
public void onGenericTag(final PdfWriter writer, final Document document, final Rectangle rect,
final String text) {
// rien ici
} | [
"@",
"Override",
"public",
"void",
"onGenericTag",
"(",
"final",
"PdfWriter",
"writer",
",",
"final",
"Document",
"document",
",",
"final",
"Rectangle",
"rect",
",",
"final",
"String",
"text",
")",
"{",
"// rien ici\r",
"}"
] | we override the onGenericTag method.
@param writer
PdfWriter
@param document
Document
@param rect
Rectangle
@param text
String | [
"we",
"override",
"the",
"onGenericTag",
"method",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/AdvancedPageNumberEvents.java#L59-L63 |
19,330 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/print/AdvancedPageNumberEvents.java | AdvancedPageNumberEvents.onOpenDocument | @Override
public void onOpenDocument(final PdfWriter writer, final Document document) {
try {
bf = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
cb = writer.getDirectContent();
template = cb.createTemplate(50, 50);
} catch (final DocumentException de) {
throw n... | java | @Override
public void onOpenDocument(final PdfWriter writer, final Document document) {
try {
bf = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
cb = writer.getDirectContent();
template = cb.createTemplate(50, 50);
} catch (final DocumentException de) {
throw n... | [
"@",
"Override",
"public",
"void",
"onOpenDocument",
"(",
"final",
"PdfWriter",
"writer",
",",
"final",
"Document",
"document",
")",
"{",
"try",
"{",
"bf",
"=",
"BaseFont",
".",
"createFont",
"(",
"BaseFont",
".",
"HELVETICA",
",",
"BaseFont",
".",
"CP1252",... | we override the onOpenDocument method.
@param writer
PdfWriter
@param document
Document | [
"we",
"override",
"the",
"onOpenDocument",
"method",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/AdvancedPageNumberEvents.java#L73-L84 |
19,331 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/print/AdvancedPageNumberEvents.java | AdvancedPageNumberEvents.onEndPage | @Override
public void onEndPage(final PdfWriter writer, final Document document) {
final int pageN = writer.getPageNumber();
final String text = pageN + " / ";
final float len = bf.getWidthPoint(text, 8);
cb.beginText();
cb.setFontAndSize(bf, 8);
final float width = document.getPageSize().getWidth()... | java | @Override
public void onEndPage(final PdfWriter writer, final Document document) {
final int pageN = writer.getPageNumber();
final String text = pageN + " / ";
final float len = bf.getWidthPoint(text, 8);
cb.beginText();
cb.setFontAndSize(bf, 8);
final float width = document.getPageSize().getWidth()... | [
"@",
"Override",
"public",
"void",
"onEndPage",
"(",
"final",
"PdfWriter",
"writer",
",",
"final",
"Document",
"document",
")",
"{",
"final",
"int",
"pageN",
"=",
"writer",
".",
"getPageNumber",
"(",
")",
";",
"final",
"String",
"text",
"=",
"pageN",
"+",
... | we override the onEndPage method.
@param writer
PdfWriter
@param document
Document | [
"we",
"override",
"the",
"onEndPage",
"method",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/AdvancedPageNumberEvents.java#L112-L124 |
19,332 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/print/AdvancedPageNumberEvents.java | AdvancedPageNumberEvents.onCloseDocument | @Override
public void onCloseDocument(final PdfWriter writer, final Document document) {
template.beginText();
template.setFontAndSize(bf, 8);
template.showText(String.valueOf(writer.getPageNumber() - 1));
template.endText();
} | java | @Override
public void onCloseDocument(final PdfWriter writer, final Document document) {
template.beginText();
template.setFontAndSize(bf, 8);
template.showText(String.valueOf(writer.getPageNumber() - 1));
template.endText();
} | [
"@",
"Override",
"public",
"void",
"onCloseDocument",
"(",
"final",
"PdfWriter",
"writer",
",",
"final",
"Document",
"document",
")",
"{",
"template",
".",
"beginText",
"(",
")",
";",
"template",
".",
"setFontAndSize",
"(",
"bf",
",",
"8",
")",
";",
"templ... | we override the onCloseDocument method.
@param writer
PdfWriter
@param document
Document | [
"we",
"override",
"the",
"onCloseDocument",
"method",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/AdvancedPageNumberEvents.java#L134-L140 |
19,333 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/model/JRobin.java | JRobin.initBackendFactory | public static void initBackendFactory(Timer timer) throws IOException {
RrdNioBackend.setFileSyncTimer(timer);
try {
if (!RrdBackendFactory.getDefaultFactory().getFactoryName()
.equals(RrdNioBackendFactory.FACTORY_NAME)) {
RrdBackendFactory.registerAndSetAsDefaultFactory(new RrdNioBackendFactory(... | java | public static void initBackendFactory(Timer timer) throws IOException {
RrdNioBackend.setFileSyncTimer(timer);
try {
if (!RrdBackendFactory.getDefaultFactory().getFactoryName()
.equals(RrdNioBackendFactory.FACTORY_NAME)) {
RrdBackendFactory.registerAndSetAsDefaultFactory(new RrdNioBackendFactory(... | [
"public",
"static",
"void",
"initBackendFactory",
"(",
"Timer",
"timer",
")",
"throws",
"IOException",
"{",
"RrdNioBackend",
".",
"setFileSyncTimer",
"(",
"timer",
")",
";",
"try",
"{",
"if",
"(",
"!",
"RrdBackendFactory",
".",
"getDefaultFactory",
"(",
")",
"... | JavaMelody uses a custom RrdNioBackendFactory,
in order to use its own and cancelable file sync timer.
@param timer Timer
@throws IOException e | [
"JavaMelody",
"uses",
"a",
"custom",
"RrdNioBackendFactory",
"in",
"order",
"to",
"use",
"its",
"own",
"and",
"cancelable",
"file",
"sync",
"timer",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/model/JRobin.java#L138-L149 |
19,334 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MCsvWriter.java | MCsvWriter.formatCsv | protected String formatCsv(final String text, final char csvSeparator) {
String result = text;
if (result.indexOf('\n') != -1) {
// le retour chariot fonctionne dans les dernières versions d'excel entre des doubles quotes
// mais il ne fonctionne pas dans OpenOffice 1.1.2
result = result.replace('\n',... | java | protected String formatCsv(final String text, final char csvSeparator) {
String result = text;
if (result.indexOf('\n') != -1) {
// le retour chariot fonctionne dans les dernières versions d'excel entre des doubles quotes
// mais il ne fonctionne pas dans OpenOffice 1.1.2
result = result.replace('\n',... | [
"protected",
"String",
"formatCsv",
"(",
"final",
"String",
"text",
",",
"final",
"char",
"csvSeparator",
")",
"{",
"String",
"result",
"=",
"text",
";",
"if",
"(",
"result",
".",
"indexOf",
"(",
"'",
"'",
")",
"!=",
"-",
"1",
")",
"{",
"// le retour c... | Encode un texte pour l'export au format csv ou csv local.
@return String
@param text
String
@param csvSeparator
char | [
"Encode",
"un",
"texte",
"pour",
"l",
"export",
"au",
"format",
"csv",
"ou",
"csv",
"local",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MCsvWriter.java#L84-L102 |
19,335 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MCsvWriter.java | MCsvWriter.writeCsvHeader | protected void writeCsvHeader(final JTable table, final Writer out, final char csvSeparator)
throws IOException {
// récupération des informations utiles
final int columnCount = table.getColumnModel().getColumnCount();
final String eol = System.getProperty("line.separator");
if (table.getName() != nul... | java | protected void writeCsvHeader(final JTable table, final Writer out, final char csvSeparator)
throws IOException {
// récupération des informations utiles
final int columnCount = table.getColumnModel().getColumnCount();
final String eol = System.getProperty("line.separator");
if (table.getName() != nul... | [
"protected",
"void",
"writeCsvHeader",
"(",
"final",
"JTable",
"table",
",",
"final",
"Writer",
"out",
",",
"final",
"char",
"csvSeparator",
")",
"throws",
"IOException",
"{",
"// récupération des informations utiles\r",
"final",
"int",
"columnCount",
"=",
"table",
... | Exporte les headers csv d'une JTable..
@param table
JTable
@param out
Writer
@param csvSeparator
char
@throws IOException
Erreur disque | [
"Exporte",
"les",
"headers",
"csv",
"d",
"une",
"JTable",
".."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MCsvWriter.java#L190-L220 |
19,336 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/web/FilterServletResponseWrapper.java | FilterServletResponseWrapper.close | public void close() throws IOException {
if (writer != null) {
writer.close();
} else if (stream != null) {
stream.close();
}
} | java | public void close() throws IOException {
if (writer != null) {
writer.close();
} else if (stream != null) {
stream.close();
}
} | [
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"!=",
"null",
")",
"{",
"writer",
".",
"close",
"(",
")",
";",
"}",
"else",
"if",
"(",
"stream",
"!=",
"null",
")",
"{",
"stream",
".",
"close",
"(",
")",
";"... | Ferme le flux.
@throws IOException e | [
"Ferme",
"le",
"flux",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/web/FilterServletResponseWrapper.java#L166-L172 |
19,337 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MRtfWriter.java | MRtfWriter.createWriter | @Override
protected DocWriter createWriter(final MBasicTable table, final Document document,
final OutputStream out) {
final RtfWriter2 writer = RtfWriter2.getInstance(document, out);
// title
final String title = buildTitle(table);
if (title != null) {
final HeaderFooter header = new RtfHeaderF... | java | @Override
protected DocWriter createWriter(final MBasicTable table, final Document document,
final OutputStream out) {
final RtfWriter2 writer = RtfWriter2.getInstance(document, out);
// title
final String title = buildTitle(table);
if (title != null) {
final HeaderFooter header = new RtfHeaderF... | [
"@",
"Override",
"protected",
"DocWriter",
"createWriter",
"(",
"final",
"MBasicTable",
"table",
",",
"final",
"Document",
"document",
",",
"final",
"OutputStream",
"out",
")",
"{",
"final",
"RtfWriter2",
"writer",
"=",
"RtfWriter2",
".",
"getInstance",
"(",
"do... | We create a writer that listens to the document and directs a RTF-stream to out
@param table
MBasicTable
@param document
Document
@param out
OutputStream
@return DocWriter | [
"We",
"create",
"a",
"writer",
"that",
"listens",
"to",
"the",
"document",
"and",
"directs",
"a",
"RTF",
"-",
"stream",
"to",
"out"
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MRtfWriter.java#L124-L151 |
19,338 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/MonitoringSpringInterceptor.java | MonitoringSpringInterceptor.invoke | @Override
public Object invoke(MethodInvocation invocation) throws Throwable {
// cette méthode est appelée par spring aop
if (DISABLED || !SPRING_COUNTER.isDisplayed()) {
return invocation.proceed();
}
// nom identifiant la requête
final String requestName = getRequestName(invocation);
boolea... | java | @Override
public Object invoke(MethodInvocation invocation) throws Throwable {
// cette méthode est appelée par spring aop
if (DISABLED || !SPRING_COUNTER.isDisplayed()) {
return invocation.proceed();
}
// nom identifiant la requête
final String requestName = getRequestName(invocation);
boolea... | [
"@",
"Override",
"public",
"Object",
"invoke",
"(",
"MethodInvocation",
"invocation",
")",
"throws",
"Throwable",
"{",
"// cette méthode est appelée par spring aop\r",
"if",
"(",
"DISABLED",
"||",
"!",
"SPRING_COUNTER",
".",
"isDisplayed",
"(",
")",
")",
"{",
"retur... | Performs method invocation.
@param invocation method invocation
@return return object from the method
@throws Throwable anything thrown by the method | [
"Performs",
"method",
"invocation",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/MonitoringSpringInterceptor.java#L64-L86 |
19,339 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/MonitoringProxy.java | MonitoringProxy.invokeTarget | public static Object invokeTarget(Object target, Method method, Object[] args,
final String requestName) throws IllegalAccessException, InvocationTargetException {
boolean systemError = false;
try {
SERVICES_COUNTER.bindContextIncludingCpu(requestName);
return method.invoke(target, args);
} catch (... | java | public static Object invokeTarget(Object target, Method method, Object[] args,
final String requestName) throws IllegalAccessException, InvocationTargetException {
boolean systemError = false;
try {
SERVICES_COUNTER.bindContextIncludingCpu(requestName);
return method.invoke(target, args);
} catch (... | [
"public",
"static",
"Object",
"invokeTarget",
"(",
"Object",
"target",
",",
"Method",
"method",
",",
"Object",
"[",
"]",
"args",
",",
"final",
"String",
"requestName",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"boolean",
"syst... | Invoke target.
@param target Instance to call
@param method Method to call
@param args Method arguments
@param requestName Request name to display
@return Result
@throws IllegalAccessException e
@throws InvocationTargetException e | [
"Invoke",
"target",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/MonitoringProxy.java#L177-L194 |
19,340 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/model/LabradorRetriever.java | LabradorRetriever.openConnection | private URLConnection openConnection() throws IOException {
final URLConnection connection = url.openConnection();
connection.setUseCaches(false);
if (CONNECTION_TIMEOUT > 0) {
connection.setConnectTimeout(CONNECTION_TIMEOUT);
}
if (READ_TIMEOUT > 0) {
connection.setReadTimeout(READ_TIMEOUT);
... | java | private URLConnection openConnection() throws IOException {
final URLConnection connection = url.openConnection();
connection.setUseCaches(false);
if (CONNECTION_TIMEOUT > 0) {
connection.setConnectTimeout(CONNECTION_TIMEOUT);
}
if (READ_TIMEOUT > 0) {
connection.setReadTimeout(READ_TIMEOUT);
... | [
"private",
"URLConnection",
"openConnection",
"(",
")",
"throws",
"IOException",
"{",
"final",
"URLConnection",
"connection",
"=",
"url",
".",
"openConnection",
"(",
")",
";",
"connection",
".",
"setUseCaches",
"(",
"false",
")",
";",
"if",
"(",
"CONNECTION_TIME... | Ouvre la connection http.
@return Object
@throws IOException Exception de communication | [
"Ouvre",
"la",
"connection",
"http",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/model/LabradorRetriever.java#L288-L310 |
19,341 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/model/LabradorRetriever.java | LabradorRetriever.createMockResultOfCall | @SuppressWarnings("unchecked")
private <T> T createMockResultOfCall() throws IOException {
final Object result;
final String request = url.toString();
if (!request.contains(HttpParameter.PART.getName() + '=')
&& !request.contains(HttpParameter.JMX_VALUE.getName())
|| request.contains(HttpPart.DEFAU... | java | @SuppressWarnings("unchecked")
private <T> T createMockResultOfCall() throws IOException {
final Object result;
final String request = url.toString();
if (!request.contains(HttpParameter.PART.getName() + '=')
&& !request.contains(HttpParameter.JMX_VALUE.getName())
|| request.contains(HttpPart.DEFAU... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"<",
"T",
">",
"T",
"createMockResultOfCall",
"(",
")",
"throws",
"IOException",
"{",
"final",
"Object",
"result",
";",
"final",
"String",
"request",
"=",
"url",
".",
"toString",
"(",
")",
";",
... | bouchon pour tests unitaires | [
"bouchon",
"pour",
"tests",
"unitaires"
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/model/LabradorRetriever.java#L372-L388 |
19,342 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MExtensionFileFilter.java | MExtensionFileFilter.accept | @Override
public boolean accept(final File file) {
if (file != null) {
if (file.isDirectory()) {
return true;
}
final String extension = getExtension(file);
if (extension != null && filters.containsKey(extension)) {
return true;
}
}
return false;
} | java | @Override
public boolean accept(final File file) {
if (file != null) {
if (file.isDirectory()) {
return true;
}
final String extension = getExtension(file);
if (extension != null && filters.containsKey(extension)) {
return true;
}
}
return false;
} | [
"@",
"Override",
"public",
"boolean",
"accept",
"(",
"final",
"File",
"file",
")",
"{",
"if",
"(",
"file",
"!=",
"null",
")",
"{",
"if",
"(",
"file",
".",
"isDirectory",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"final",
"String",
"extension",
... | Return true if this file should be shown in the directory pane, false if it shouldn't.
Files that begin with "." are ignored.
@return boolean
@param file
File
@see #getExtension
@see javax.swing.filechooser.FileFilter#accept | [
"Return",
"true",
"if",
"this",
"file",
"should",
"be",
"shown",
"in",
"the",
"directory",
"pane",
"false",
"if",
"it",
"shouldn",
"t",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MExtensionFileFilter.java#L111-L124 |
19,343 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MExtensionFileFilter.java | MExtensionFileFilter.getExtension | public String getExtension(final File file) {
if (file != null) {
final String fileName = file.getName();
final int i = fileName.lastIndexOf('.');
if (i > 0 && i < fileName.length() - 1) {
return fileName.substring(i + 1).toLowerCase(Locale.getDefault());
}
}
return null;
} | java | public String getExtension(final File file) {
if (file != null) {
final String fileName = file.getName();
final int i = fileName.lastIndexOf('.');
if (i > 0 && i < fileName.length() - 1) {
return fileName.substring(i + 1).toLowerCase(Locale.getDefault());
}
}
return null;
} | [
"public",
"String",
"getExtension",
"(",
"final",
"File",
"file",
")",
"{",
"if",
"(",
"file",
"!=",
"null",
")",
"{",
"final",
"String",
"fileName",
"=",
"file",
".",
"getName",
"(",
")",
";",
"final",
"int",
"i",
"=",
"fileName",
".",
"lastIndexOf",
... | Return the extension portion of the file's name.
@return String
@param file
File | [
"Return",
"the",
"extension",
"portion",
"of",
"the",
"file",
"s",
"name",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MExtensionFileFilter.java#L193-L202 |
19,344 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/Main.java | Main.extractFromJar | private static File extractFromJar(String resource, String fileName, String suffix)
throws IOException {
final URL res = Main.class.getResource(resource);
// put this jar in a file system so that we can load jars from there
final File tmp;
try {
tmp = File.createTempFile(fileName, suffix);
} ca... | java | private static File extractFromJar(String resource, String fileName, String suffix)
throws IOException {
final URL res = Main.class.getResource(resource);
// put this jar in a file system so that we can load jars from there
final File tmp;
try {
tmp = File.createTempFile(fileName, suffix);
} ca... | [
"private",
"static",
"File",
"extractFromJar",
"(",
"String",
"resource",
",",
"String",
"fileName",
",",
"String",
"suffix",
")",
"throws",
"IOException",
"{",
"final",
"URL",
"res",
"=",
"Main",
".",
"class",
".",
"getResource",
"(",
"resource",
")",
";",
... | Extract a resource from jar, mark it for deletion upon exit, and return its location. | [
"Extract",
"a",
"resource",
"from",
"jar",
"mark",
"it",
"for",
"deletion",
"upon",
"exit",
"and",
"return",
"its",
"location",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/Main.java#L256-L282 |
19,345 | javamelody/javamelody | javamelody-for-standalone/src/main/java/net/bull/javamelody/EmbeddedServer.java | EmbeddedServer.start | public static void start(int port, Map<Parameter, String> parameters) throws Exception {
// Init jetty
final Server server = new Server(port);
final ContextHandlerCollection contexts = new ContextHandlerCollection();
final ServletContextHandler context = new ServletContextHandler(contexts, "/",
Servlet... | java | public static void start(int port, Map<Parameter, String> parameters) throws Exception {
// Init jetty
final Server server = new Server(port);
final ContextHandlerCollection contexts = new ContextHandlerCollection();
final ServletContextHandler context = new ServletContextHandler(contexts, "/",
Servlet... | [
"public",
"static",
"void",
"start",
"(",
"int",
"port",
",",
"Map",
"<",
"Parameter",
",",
"String",
">",
"parameters",
")",
"throws",
"Exception",
"{",
"// Init jetty\r",
"final",
"Server",
"server",
"=",
"new",
"Server",
"(",
"port",
")",
";",
"final",
... | Start the server with a http port and optional javamelody parameters.
@param port Http port
@param parameters Optional javamelody parameters
@throws Exception e | [
"Start",
"the",
"server",
"with",
"a",
"http",
"port",
"and",
"optional",
"javamelody",
"parameters",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-for-standalone/src/main/java/net/bull/javamelody/EmbeddedServer.java#L26-L54 |
19,346 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/web/HttpAuth.java | HttpAuth.isUserAuthorized | private boolean isUserAuthorized(HttpServletRequest httpRequest) {
if (authorizedUsers == null) {
return true;
}
// Get Authorization header
final String auth = httpRequest.getHeader("Authorization");
if (auth == null) {
return false; // no auth
}
if (!auth.toUpperCase(Locale.ENGLISH).start... | java | private boolean isUserAuthorized(HttpServletRequest httpRequest) {
if (authorizedUsers == null) {
return true;
}
// Get Authorization header
final String auth = httpRequest.getHeader("Authorization");
if (auth == null) {
return false; // no auth
}
if (!auth.toUpperCase(Locale.ENGLISH).start... | [
"private",
"boolean",
"isUserAuthorized",
"(",
"HttpServletRequest",
"httpRequest",
")",
"{",
"if",
"(",
"authorizedUsers",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"// Get Authorization header\r",
"final",
"String",
"auth",
"=",
"httpRequest",
".",
"ge... | Check if the user is authorized, when using the "authorized-users" parameter
@param httpRequest HttpServletRequest
@return true if the user is authorized | [
"Check",
"if",
"the",
"user",
"is",
"authorized",
"when",
"using",
"the",
"authorized",
"-",
"users",
"parameter"
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/web/HttpAuth.java#L116-L135 |
19,347 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/SessionListener.java | SessionListener.invalidateAllSessionsExceptCurrentSession | public static void invalidateAllSessionsExceptCurrentSession(HttpSession currentSession) {
for (final HttpSession session : SESSION_MAP_BY_ID.values()) {
try {
if (currentSession != null && currentSession.getId().equals(session.getId())) {
// si l'utilisateur exécutant l'action a une session http,
... | java | public static void invalidateAllSessionsExceptCurrentSession(HttpSession currentSession) {
for (final HttpSession session : SESSION_MAP_BY_ID.values()) {
try {
if (currentSession != null && currentSession.getId().equals(session.getId())) {
// si l'utilisateur exécutant l'action a une session http,
... | [
"public",
"static",
"void",
"invalidateAllSessionsExceptCurrentSession",
"(",
"HttpSession",
"currentSession",
")",
"{",
"for",
"(",
"final",
"HttpSession",
"session",
":",
"SESSION_MAP_BY_ID",
".",
"values",
"(",
")",
")",
"{",
"try",
"{",
"if",
"(",
"currentSess... | since 1.49 | [
"since",
"1",
".",
"49"
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/SessionListener.java#L160-L174 |
19,348 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/model/Base64Coder.java | Base64Coder.encodeLines | public static String encodeLines(byte[] in, int iOff, int iLen, int lineLen,
String lineSeparator) {
final int blockLen = lineLen * 3 / 4;
if (blockLen <= 0) {
throw new IllegalArgumentException();
}
final int lines = (iLen + blockLen - 1) / blockLen;
final int bufLen = (iLen + 2) / 3 * 4 + lines... | java | public static String encodeLines(byte[] in, int iOff, int iLen, int lineLen,
String lineSeparator) {
final int blockLen = lineLen * 3 / 4;
if (blockLen <= 0) {
throw new IllegalArgumentException();
}
final int lines = (iLen + blockLen - 1) / blockLen;
final int bufLen = (iLen + 2) / 3 * 4 + lines... | [
"public",
"static",
"String",
"encodeLines",
"(",
"byte",
"[",
"]",
"in",
",",
"int",
"iOff",
",",
"int",
"iLen",
",",
"int",
"lineLen",
",",
"String",
"lineSeparator",
")",
"{",
"final",
"int",
"blockLen",
"=",
"lineLen",
"*",
"3",
"/",
"4",
";",
"i... | Encodes a byte array into Base 64 format and breaks the output into lines.
@param in An array containing the data bytes to be encoded.
@param iOff Offset of the first byte in <code>in</code> to be processed.
@param iLen Number of bytes to be processed in <code>in</code>, starting at <code>i... | [
"Encodes",
"a",
"byte",
"array",
"into",
"Base",
"64",
"format",
"and",
"breaks",
"the",
"output",
"into",
"lines",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/model/Base64Coder.java#L99-L116 |
19,349 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/model/Base64Coder.java | Base64Coder.encode | public static char[] encode(byte[] in, int iOff, int iLen) { // NOPMD
final int oDataLen = (iLen * 4 + 2) / 3; // output length without padding
final int oLen = (iLen + 2) / 3 * 4; // output length including padding
final char[] out = new char[oLen];
int ip = iOff;
final int iEnd = iOff + iLen;
int op... | java | public static char[] encode(byte[] in, int iOff, int iLen) { // NOPMD
final int oDataLen = (iLen * 4 + 2) / 3; // output length without padding
final int oLen = (iLen + 2) / 3 * 4; // output length including padding
final char[] out = new char[oLen];
int ip = iOff;
final int iEnd = iOff + iLen;
int op... | [
"public",
"static",
"char",
"[",
"]",
"encode",
"(",
"byte",
"[",
"]",
"in",
",",
"int",
"iOff",
",",
"int",
"iLen",
")",
"{",
"// NOPMD\r",
"final",
"int",
"oDataLen",
"=",
"(",
"iLen",
"*",
"4",
"+",
"2",
")",
"/",
"3",
";",
"// output length wit... | Encodes a byte array into Base64 format.
No blanks or line breaks are inserted in the output.
@param in An array containing the data bytes to be encoded.
@param iOff Offset of the first byte in <code>in</code> to be processed.
@param iLen Number of bytes to process in <code>in</code>, starting at <code>iOff</code>... | [
"Encodes",
"a",
"byte",
"array",
"into",
"Base64",
"format",
".",
"No",
"blanks",
"or",
"line",
"breaks",
"are",
"inserted",
"in",
"the",
"output",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/model/Base64Coder.java#L147-L170 |
19,350 | javamelody/javamelody | javamelody-spring-boot-starter/src/main/java/net/bull/javamelody/JavaMelodyAutoConfiguration.java | JavaMelodyAutoConfiguration.defaultAdvisorAutoProxyCreator | @Bean
@ConditionalOnMissingBean(DefaultAdvisorAutoProxyCreator.class)
@ConditionalOnProperty(prefix = JavaMelodyConfigurationProperties.PREFIX, name = "advisor-auto-proxy-creator-enabled", matchIfMissing = false)
public DefaultAdvisorAutoProxyCreator defaultAdvisorAutoProxyCreator() {
return new DefaultAdvisorAuto... | java | @Bean
@ConditionalOnMissingBean(DefaultAdvisorAutoProxyCreator.class)
@ConditionalOnProperty(prefix = JavaMelodyConfigurationProperties.PREFIX, name = "advisor-auto-proxy-creator-enabled", matchIfMissing = false)
public DefaultAdvisorAutoProxyCreator defaultAdvisorAutoProxyCreator() {
return new DefaultAdvisorAuto... | [
"@",
"Bean",
"@",
"ConditionalOnMissingBean",
"(",
"DefaultAdvisorAutoProxyCreator",
".",
"class",
")",
"@",
"ConditionalOnProperty",
"(",
"prefix",
"=",
"JavaMelodyConfigurationProperties",
".",
"PREFIX",
",",
"name",
"=",
"\"advisor-auto-proxy-creator-enabled\"",
",",
"... | Now disabled by default, since dependency spring-boot-starter-aop was added in 1.76.
@return DefaultAdvisorAutoProxyCreator | [
"Now",
"disabled",
"by",
"default",
"since",
"dependency",
"spring",
"-",
"boot",
"-",
"starter",
"-",
"aop",
"was",
"added",
"in",
"1",
".",
"76",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-spring-boot-starter/src/main/java/net/bull/javamelody/JavaMelodyAutoConfiguration.java#L181-L186 |
19,351 | javamelody/javamelody | javamelody-spring-boot-starter/src/main/java/net/bull/javamelody/JavaMelodyAutoConfiguration.java | JavaMelodyAutoConfiguration.monitoringFeignClientAdvisor | @SuppressWarnings("unchecked")
@Bean
@ConditionalOnClass(name = "org.springframework.cloud.openfeign.FeignClient")
@ConditionalOnProperty(prefix = JavaMelodyConfigurationProperties.PREFIX, name = "spring-monitoring-enabled", matchIfMissing = true)
// we check that the DefaultAdvisorAutoProxyCreator above is not ena... | java | @SuppressWarnings("unchecked")
@Bean
@ConditionalOnClass(name = "org.springframework.cloud.openfeign.FeignClient")
@ConditionalOnProperty(prefix = JavaMelodyConfigurationProperties.PREFIX, name = "spring-monitoring-enabled", matchIfMissing = true)
// we check that the DefaultAdvisorAutoProxyCreator above is not ena... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Bean",
"@",
"ConditionalOnClass",
"(",
"name",
"=",
"\"org.springframework.cloud.openfeign.FeignClient\"",
")",
"@",
"ConditionalOnProperty",
"(",
"prefix",
"=",
"JavaMelodyConfigurationProperties",
".",
"PREFIX",
... | Monitoring of Feign clients.
@return MonitoringSpringAdvisor
@throws ClassNotFoundException should not happen | [
"Monitoring",
"of",
"Feign",
"clients",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-spring-boot-starter/src/main/java/net/bull/javamelody/JavaMelodyAutoConfiguration.java#L279-L322 |
19,352 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/model/RrdNioBackendFactory.java | RrdNioBackendFactory.open | @Override
protected RrdBackend open(String path, boolean readOnly) throws IOException {
return new RrdNioBackend(path, readOnly, syncPeriod);
} | java | @Override
protected RrdBackend open(String path, boolean readOnly) throws IOException {
return new RrdNioBackend(path, readOnly, syncPeriod);
} | [
"@",
"Override",
"protected",
"RrdBackend",
"open",
"(",
"String",
"path",
",",
"boolean",
"readOnly",
")",
"throws",
"IOException",
"{",
"return",
"new",
"RrdNioBackend",
"(",
"path",
",",
"readOnly",
",",
"syncPeriod",
")",
";",
"}"
] | Creates RrdNioBackend object for the given file path.
@param path File path
@param readOnly True, if the file should be accessed in read/only mode.
False otherwise.
@return RrdNioBackend object which handles all I/O operations for the given file path
@throws IOException Thrown in case of I/O error. | [
"Creates",
"RrdNioBackend",
"object",
"for",
"the",
"given",
"file",
"path",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/model/RrdNioBackendFactory.java#L82-L85 |
19,353 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/MonitoringFilter.java | MonitoringFilter.registerApplicationNodeInCollectServer | public static void registerApplicationNodeInCollectServer(String applicationName,
URL collectServerUrl, URL applicationNodeUrl) {
if (collectServerUrl == null || applicationNodeUrl == null) {
throw new IllegalArgumentException(
"collectServerUrl and applicationNodeUrl must not be null");
}
final ... | java | public static void registerApplicationNodeInCollectServer(String applicationName,
URL collectServerUrl, URL applicationNodeUrl) {
if (collectServerUrl == null || applicationNodeUrl == null) {
throw new IllegalArgumentException(
"collectServerUrl and applicationNodeUrl must not be null");
}
final ... | [
"public",
"static",
"void",
"registerApplicationNodeInCollectServer",
"(",
"String",
"applicationName",
",",
"URL",
"collectServerUrl",
",",
"URL",
"applicationNodeUrl",
")",
"{",
"if",
"(",
"collectServerUrl",
"==",
"null",
"||",
"applicationNodeUrl",
"==",
"null",
"... | Asynchronously calls the optional collect server to register this application's node to be monitored.
@param applicationName Name of the application in the collect server:<br/>
if it already exists the node will be added with the other nodes, if null name will be "contextPath_hostname".
@param collectServerUrl Url of t... | [
"Asynchronously",
"calls",
"the",
"optional",
"collect",
"server",
"to",
"register",
"this",
"application",
"s",
"node",
"to",
"be",
"monitored",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/MonitoringFilter.java#L538-L585 |
19,354 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/MonitoringFilter.java | MonitoringFilter.unregisterApplicationNodeInCollectServer | public static void unregisterApplicationNodeInCollectServer() throws IOException {
if (unregisterApplicationNodeInCollectServerUrl != null) {
new LabradorRetriever(unregisterApplicationNodeInCollectServerUrl).post(null);
LOG.info("application node removed from the collect server");
}
} | java | public static void unregisterApplicationNodeInCollectServer() throws IOException {
if (unregisterApplicationNodeInCollectServerUrl != null) {
new LabradorRetriever(unregisterApplicationNodeInCollectServerUrl).post(null);
LOG.info("application node removed from the collect server");
}
} | [
"public",
"static",
"void",
"unregisterApplicationNodeInCollectServer",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"unregisterApplicationNodeInCollectServerUrl",
"!=",
"null",
")",
"{",
"new",
"LabradorRetriever",
"(",
"unregisterApplicationNodeInCollectServerUrl",
")... | Call the optional collect server to unregister this application's node.
@throws IOException e | [
"Call",
"the",
"optional",
"collect",
"server",
"to",
"unregister",
"this",
"application",
"s",
"node",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/MonitoringFilter.java#L591-L596 |
19,355 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/common/Mailer.java | Mailer.send | public void send(String toAddress, String subject, String message, List<File> attachments,
boolean highPriority) throws NamingException, MessagingException {
assert toAddress != null;
assert subject != null;
assert message != null;
final InternetAddress[] toAddresses = InternetAddress.parse(toAddress, f... | java | public void send(String toAddress, String subject, String message, List<File> attachments,
boolean highPriority) throws NamingException, MessagingException {
assert toAddress != null;
assert subject != null;
assert message != null;
final InternetAddress[] toAddresses = InternetAddress.parse(toAddress, f... | [
"public",
"void",
"send",
"(",
"String",
"toAddress",
",",
"String",
"subject",
",",
"String",
"message",
",",
"List",
"<",
"File",
">",
"attachments",
",",
"boolean",
"highPriority",
")",
"throws",
"NamingException",
",",
"MessagingException",
"{",
"assert",
... | Envoie un mail.
@param toAddress Adresses mails des destinataires séparées par des virgules.
@param subject Titre du mail
@param message Corps du mail
@param attachments Liste de fichiers à attacher
@param highPriority Priorité haute
@throws NamingException e
@throws MessagingException e | [
"Envoie",
"un",
"mail",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/common/Mailer.java#L136-L186 |
19,356 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MXmlWriter.java | MXmlWriter.writeXml | protected void writeXml(MListTable<?> table, OutputStream outputStream) throws IOException {
final List<?> list = table.getList();
TransportFormatAdapter.writeXml((Serializable) list, outputStream);
} | java | protected void writeXml(MListTable<?> table, OutputStream outputStream) throws IOException {
final List<?> list = table.getList();
TransportFormatAdapter.writeXml((Serializable) list, outputStream);
} | [
"protected",
"void",
"writeXml",
"(",
"MListTable",
"<",
"?",
">",
"table",
",",
"OutputStream",
"outputStream",
")",
"throws",
"IOException",
"{",
"final",
"List",
"<",
"?",
">",
"list",
"=",
"table",
".",
"getList",
"(",
")",
";",
"TransportFormatAdapter",... | Exporte une MListTable dans un fichier au format xml.
@param table MListTable
@param outputStream OutputStream
@throws IOException Erreur disque | [
"Exporte",
"une",
"MListTable",
"dans",
"un",
"fichier",
"au",
"format",
"xml",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MXmlWriter.java#L73-L76 |
19,357 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/web/pdf/PdfDocumentFactory.java | PdfDocumentFactory.createWriter | private void createWriter(Document document, String title)
throws DocumentException, IOException {
final PdfWriter writer = PdfWriter.getInstance(document, output);
//writer.setViewerPreferences(PdfWriter.PageLayoutTwoColumnLeft);
// title
final HeaderFooter header = new HeaderFooter(new Phrase(title)... | java | private void createWriter(Document document, String title)
throws DocumentException, IOException {
final PdfWriter writer = PdfWriter.getInstance(document, output);
//writer.setViewerPreferences(PdfWriter.PageLayoutTwoColumnLeft);
// title
final HeaderFooter header = new HeaderFooter(new Phrase(title)... | [
"private",
"void",
"createWriter",
"(",
"Document",
"document",
",",
"String",
"title",
")",
"throws",
"DocumentException",
",",
"IOException",
"{",
"final",
"PdfWriter",
"writer",
"=",
"PdfWriter",
".",
"getInstance",
"(",
"document",
",",
"output",
")",
";",
... | We create a writer that listens to the document and directs a PDF-stream to output | [
"We",
"create",
"a",
"writer",
"that",
"listens",
"to",
"the",
"document",
"and",
"directs",
"a",
"PDF",
"-",
"stream",
"to",
"output"
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/web/pdf/PdfDocumentFactory.java#L180-L199 |
19,358 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MPdfWriter.java | MPdfWriter.writePdf | protected void writePdf(final MBasicTable table, final OutputStream out) throws IOException {
try {
// step 1: creation of a document-object
final Rectangle pageSize = landscape ? PageSize.A4.rotate() : PageSize.A4;
final Document document = new Document(pageSize, 50, 50, 50, 50);
// step 2: we creat... | java | protected void writePdf(final MBasicTable table, final OutputStream out) throws IOException {
try {
// step 1: creation of a document-object
final Rectangle pageSize = landscape ? PageSize.A4.rotate() : PageSize.A4;
final Document document = new Document(pageSize, 50, 50, 50, 50);
// step 2: we creat... | [
"protected",
"void",
"writePdf",
"(",
"final",
"MBasicTable",
"table",
",",
"final",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"try",
"{",
"// step 1: creation of a document-object\r",
"final",
"Rectangle",
"pageSize",
"=",
"landscape",
"?",
"PageSize"... | Ecrit le pdf.
@param table
MBasicTable
@param out
OutputStream
@throws IOException
e | [
"Ecrit",
"le",
"pdf",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MPdfWriter.java#L153-L195 |
19,359 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MPdfWriter.java | MPdfWriter.createWriter | protected DocWriter createWriter(final MBasicTable table, final Document document,
final OutputStream out) throws DocumentException {
final PdfWriter writer = PdfWriter.getInstance(document, out);
// writer.setViewerPreferences(PdfWriter.PageLayoutTwoColumnLeft);
// title
if (table.getName() != null) ... | java | protected DocWriter createWriter(final MBasicTable table, final Document document,
final OutputStream out) throws DocumentException {
final PdfWriter writer = PdfWriter.getInstance(document, out);
// writer.setViewerPreferences(PdfWriter.PageLayoutTwoColumnLeft);
// title
if (table.getName() != null) ... | [
"protected",
"DocWriter",
"createWriter",
"(",
"final",
"MBasicTable",
"table",
",",
"final",
"Document",
"document",
",",
"final",
"OutputStream",
"out",
")",
"throws",
"DocumentException",
"{",
"final",
"PdfWriter",
"writer",
"=",
"PdfWriter",
".",
"getInstance",
... | We create a writer that listens to the document and directs a PDF-stream to out
@param table
MBasicTable
@param document
Document
@param out
OutputStream
@return DocWriter
@throws DocumentException
e | [
"We",
"create",
"a",
"writer",
"that",
"listens",
"to",
"the",
"document",
"and",
"directs",
"a",
"PDF",
"-",
"stream",
"to",
"out"
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MPdfWriter.java#L210-L234 |
19,360 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MPdfWriter.java | MPdfWriter.renderHeaders | protected void renderHeaders(final MBasicTable table, final Table datatable)
throws BadElementException {
final int columnCount = table.getColumnCount();
final TableColumnModel columnModel = table.getColumnModel();
// size of columns
float totalWidth = 0;
for (int i = 0; i < columnCount; i++) {
t... | java | protected void renderHeaders(final MBasicTable table, final Table datatable)
throws BadElementException {
final int columnCount = table.getColumnCount();
final TableColumnModel columnModel = table.getColumnModel();
// size of columns
float totalWidth = 0;
for (int i = 0; i < columnCount; i++) {
t... | [
"protected",
"void",
"renderHeaders",
"(",
"final",
"MBasicTable",
"table",
",",
"final",
"Table",
"datatable",
")",
"throws",
"BadElementException",
"{",
"final",
"int",
"columnCount",
"=",
"table",
".",
"getColumnCount",
"(",
")",
";",
"final",
"TableColumnModel... | Effectue le rendu des headers.
@param table
MBasicTable
@param datatable
Table
@throws BadElementException
e | [
"Effectue",
"le",
"rendu",
"des",
"headers",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MPdfWriter.java#L246-L277 |
19,361 | javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MPdfWriter.java | MPdfWriter.renderList | protected void renderList(final MBasicTable table, final Table datatable)
throws BadElementException {
final int columnCount = table.getColumnCount();
final int rowCount = table.getRowCount();
// data rows
final Font font = FontFactory.getFont(FontFactory.HELVETICA, 10, Font.NORMAL);
datatable.getDef... | java | protected void renderList(final MBasicTable table, final Table datatable)
throws BadElementException {
final int columnCount = table.getColumnCount();
final int rowCount = table.getRowCount();
// data rows
final Font font = FontFactory.getFont(FontFactory.HELVETICA, 10, Font.NORMAL);
datatable.getDef... | [
"protected",
"void",
"renderList",
"(",
"final",
"MBasicTable",
"table",
",",
"final",
"Table",
"datatable",
")",
"throws",
"BadElementException",
"{",
"final",
"int",
"columnCount",
"=",
"table",
".",
"getColumnCount",
"(",
")",
";",
"final",
"int",
"rowCount",... | Effectue le rendu de la liste.
@param table
MBasicTable
@param datatable
Table
@throws BadElementException
e | [
"Effectue",
"le",
"rendu",
"de",
"la",
"liste",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MPdfWriter.java#L289-L316 |
19,362 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/model/PeriodCounterFactory.java | PeriodCounterFactory.getWeekCounter | Counter getWeekCounter() {
final Counter weekCounter = createPeriodCounter("yyyyWW", currentDayCounter.getStartDate());
addRequestsAndErrorsForRange(weekCounter, Period.SEMAINE.getRange());
return weekCounter;
} | java | Counter getWeekCounter() {
final Counter weekCounter = createPeriodCounter("yyyyWW", currentDayCounter.getStartDate());
addRequestsAndErrorsForRange(weekCounter, Period.SEMAINE.getRange());
return weekCounter;
} | [
"Counter",
"getWeekCounter",
"(",
")",
"{",
"final",
"Counter",
"weekCounter",
"=",
"createPeriodCounter",
"(",
"\"yyyyWW\"",
",",
"currentDayCounter",
".",
"getStartDate",
"(",
")",
")",
";",
"addRequestsAndErrorsForRange",
"(",
"weekCounter",
",",
"Period",
".",
... | compteur des 7 derniers jours | [
"compteur",
"des",
"7",
"derniers",
"jours"
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/model/PeriodCounterFactory.java#L84-L88 |
19,363 | javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/model/PeriodCounterFactory.java | PeriodCounterFactory.getYearCounter | Counter getYearCounter() throws IOException {
final Counter yearCounter = createPeriodCounter("yyyy", currentDayCounter.getStartDate());
yearCounter.addRequestsAndErrors(currentDayCounter);
final Calendar dayCalendar = Calendar.getInstance();
final int currentMonth = dayCalendar.get(Calendar.MONTH);
dayC... | java | Counter getYearCounter() throws IOException {
final Counter yearCounter = createPeriodCounter("yyyy", currentDayCounter.getStartDate());
yearCounter.addRequestsAndErrors(currentDayCounter);
final Calendar dayCalendar = Calendar.getInstance();
final int currentMonth = dayCalendar.get(Calendar.MONTH);
dayC... | [
"Counter",
"getYearCounter",
"(",
")",
"throws",
"IOException",
"{",
"final",
"Counter",
"yearCounter",
"=",
"createPeriodCounter",
"(",
"\"yyyy\"",
",",
"currentDayCounter",
".",
"getStartDate",
"(",
")",
")",
";",
"yearCounter",
".",
"addRequestsAndErrors",
"(",
... | compteur des 366 derniers jours | [
"compteur",
"des",
"366",
"derniers",
"jours"
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/model/PeriodCounterFactory.java#L121-L145 |
19,364 | twitter/finagle | finagle-example/src/main/java/com/twitter/finagle/example/java/http/CatsDB.java | CatsDB.get | public Cat get(Integer id) {
if (DB.isEmpty()) {
addExampleCats();
}
return DB.get(id);
} | java | public Cat get(Integer id) {
if (DB.isEmpty()) {
addExampleCats();
}
return DB.get(id);
} | [
"public",
"Cat",
"get",
"(",
"Integer",
"id",
")",
"{",
"if",
"(",
"DB",
".",
"isEmpty",
"(",
")",
")",
"{",
"addExampleCats",
"(",
")",
";",
"}",
"return",
"DB",
".",
"get",
"(",
"id",
")",
";",
"}"
] | Get the Cat for a given id. | [
"Get",
"the",
"Cat",
"for",
"a",
"given",
"id",
"."
] | 872be5f2b147fa50351bdbf08b003a26745e1df8 | https://github.com/twitter/finagle/blob/872be5f2b147fa50351bdbf08b003a26745e1df8/finagle-example/src/main/java/com/twitter/finagle/example/java/http/CatsDB.java#L11-L17 |
19,365 | twitter/finagle | finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/ZooKeeperUtils.java | ZooKeeperUtils.isRetryable | public static boolean isRetryable(KeeperException e) {
Objects.requireNonNull(e);
switch (e.code()) {
case CONNECTIONLOSS:
case SESSIONEXPIRED:
case SESSIONMOVED:
case OPERATIONTIMEOUT:
return true;
case RUNTIMEINCONSISTENCY:
case DATAINCONSISTENCY:
case MARSH... | java | public static boolean isRetryable(KeeperException e) {
Objects.requireNonNull(e);
switch (e.code()) {
case CONNECTIONLOSS:
case SESSIONEXPIRED:
case SESSIONMOVED:
case OPERATIONTIMEOUT:
return true;
case RUNTIMEINCONSISTENCY:
case DATAINCONSISTENCY:
case MARSH... | [
"public",
"static",
"boolean",
"isRetryable",
"(",
"KeeperException",
"e",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"e",
")",
";",
"switch",
"(",
"e",
".",
"code",
"(",
")",
")",
"{",
"case",
"CONNECTIONLOSS",
":",
"case",
"SESSIONEXPIRED",
":",
... | Returns true if the given exception indicates an error that can be resolved by retrying the
operation without modification.
@param e the exception to check
@return true if the causing operation is strictly retryable | [
"Returns",
"true",
"if",
"the",
"given",
"exception",
"indicates",
"an",
"error",
"that",
"can",
"be",
"resolved",
"by",
"retrying",
"the",
"operation",
"without",
"modification",
"."
] | 872be5f2b147fa50351bdbf08b003a26745e1df8 | https://github.com/twitter/finagle/blob/872be5f2b147fa50351bdbf08b003a26745e1df8/finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/ZooKeeperUtils.java#L76-L110 |
19,366 | twitter/finagle | finagle-serversets/src/main/java/com/twitter/finagle/common/base/MorePreconditions.java | MorePreconditions.checkNotBlank | public static String checkNotBlank(String argument) {
Objects.requireNonNull(argument, ARG_NOT_BLANK_MSG);
if (StringUtils.isBlank(argument)) {
throw new IllegalArgumentException(ARG_NOT_BLANK_MSG);
}
return argument;
} | java | public static String checkNotBlank(String argument) {
Objects.requireNonNull(argument, ARG_NOT_BLANK_MSG);
if (StringUtils.isBlank(argument)) {
throw new IllegalArgumentException(ARG_NOT_BLANK_MSG);
}
return argument;
} | [
"public",
"static",
"String",
"checkNotBlank",
"(",
"String",
"argument",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"argument",
",",
"ARG_NOT_BLANK_MSG",
")",
";",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"argument",
")",
")",
"{",
"throw",
"new... | Checks that a string is both non-null and non-empty.
@see #checkNotBlank(String, String, Object...) | [
"Checks",
"that",
"a",
"string",
"is",
"both",
"non",
"-",
"null",
"and",
"non",
"-",
"empty",
"."
] | 872be5f2b147fa50351bdbf08b003a26745e1df8 | https://github.com/twitter/finagle/blob/872be5f2b147fa50351bdbf08b003a26745e1df8/finagle-serversets/src/main/java/com/twitter/finagle/common/base/MorePreconditions.java#L41-L47 |
19,367 | twitter/finagle | finagle-example/src/main/java/com/twitter/finagle/example/java/http/JsonUtils.java | JsonUtils.toBytes | public static byte[] toBytes(Object value) {
try {
return mapper.writeValueAsBytes(value);
} catch (Exception e) {
System.out.println(e.getMessage());
throw new IllegalArgumentException(
String.format("Could not transform to bytes: %s", e.getMessage()));... | java | public static byte[] toBytes(Object value) {
try {
return mapper.writeValueAsBytes(value);
} catch (Exception e) {
System.out.println(e.getMessage());
throw new IllegalArgumentException(
String.format("Could not transform to bytes: %s", e.getMessage()));... | [
"public",
"static",
"byte",
"[",
"]",
"toBytes",
"(",
"Object",
"value",
")",
"{",
"try",
"{",
"return",
"mapper",
".",
"writeValueAsBytes",
"(",
"value",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"System",
".",
"out",
".",
"println",
... | Convert an Object to an array of bytes. | [
"Convert",
"an",
"Object",
"to",
"an",
"array",
"of",
"bytes",
"."
] | 872be5f2b147fa50351bdbf08b003a26745e1df8 | https://github.com/twitter/finagle/blob/872be5f2b147fa50351bdbf08b003a26745e1df8/finagle-example/src/main/java/com/twitter/finagle/example/java/http/JsonUtils.java#L15-L23 |
19,368 | twitter/finagle | finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/ZooKeeperClient.java | ZooKeeperClient.digestCredentials | public static Credentials digestCredentials(String username, String password) {
MorePreconditions.checkNotBlank(username);
Objects.requireNonNull(password);
// TODO(John Sirois): DigestAuthenticationProvider is broken - uses platform default charset
// (on server) and so we just have to hope here that ... | java | public static Credentials digestCredentials(String username, String password) {
MorePreconditions.checkNotBlank(username);
Objects.requireNonNull(password);
// TODO(John Sirois): DigestAuthenticationProvider is broken - uses platform default charset
// (on server) and so we just have to hope here that ... | [
"public",
"static",
"Credentials",
"digestCredentials",
"(",
"String",
"username",
",",
"String",
"password",
")",
"{",
"MorePreconditions",
".",
"checkNotBlank",
"(",
"username",
")",
";",
"Objects",
".",
"requireNonNull",
"(",
"password",
")",
";",
"// TODO(John... | Creates a set of credentials for the zoo keeper digest authentication mechanism.
@param username the username to authenticate with
@param password the password to authenticate with
@return a set of credentials that can be used to authenticate the zoo keeper client | [
"Creates",
"a",
"set",
"of",
"credentials",
"for",
"the",
"zoo",
"keeper",
"digest",
"authentication",
"mechanism",
"."
] | 872be5f2b147fa50351bdbf08b003a26745e1df8 | https://github.com/twitter/finagle/blob/872be5f2b147fa50351bdbf08b003a26745e1df8/finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/ZooKeeperClient.java#L121-L130 |
19,369 | twitter/finagle | finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/ZooKeeperClient.java | ZooKeeperClient.get | public synchronized ZooKeeper get(Duration connectionTimeout)
throws ZooKeeperConnectionException, InterruptedException, TimeoutException {
if (zooKeeper == null) {
final CountDownLatch connected = new CountDownLatch(1);
Watcher watcher = new Watcher() {
@Override public void process(Watc... | java | public synchronized ZooKeeper get(Duration connectionTimeout)
throws ZooKeeperConnectionException, InterruptedException, TimeoutException {
if (zooKeeper == null) {
final CountDownLatch connected = new CountDownLatch(1);
Watcher watcher = new Watcher() {
@Override public void process(Watc... | [
"public",
"synchronized",
"ZooKeeper",
"get",
"(",
"Duration",
"connectionTimeout",
")",
"throws",
"ZooKeeperConnectionException",
",",
"InterruptedException",
",",
"TimeoutException",
"{",
"if",
"(",
"zooKeeper",
"==",
"null",
")",
"{",
"final",
"CountDownLatch",
"co... | Returns the current active ZK connection or establishes a new one if none has yet been
established or a previous connection was disconnected or had its session time out. This
method will attempt to re-use sessions when possible.
@param connectionTimeout the maximum amount of time to wait for the connection to the ZK
... | [
"Returns",
"the",
"current",
"active",
"ZK",
"connection",
"or",
"establishes",
"a",
"new",
"one",
"if",
"none",
"has",
"yet",
"been",
"established",
"or",
"a",
"previous",
"connection",
"was",
"disconnected",
"or",
"had",
"its",
"session",
"time",
"out",
".... | 872be5f2b147fa50351bdbf08b003a26745e1df8 | https://github.com/twitter/finagle/blob/872be5f2b147fa50351bdbf08b003a26745e1df8/finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/ZooKeeperClient.java#L357-L418 |
19,370 | twitter/finagle | finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/Group.java | Group.getMemberId | public String getMemberId(String nodePath) {
MorePreconditions.checkNotBlank(nodePath);
if (!nodePath.startsWith(path + "/")) {
throw new IllegalArgumentException(
String.format("Not a member of this group[%s]: %s", path, nodePath));
}
String memberId = StringUtils.substringAfterLast(no... | java | public String getMemberId(String nodePath) {
MorePreconditions.checkNotBlank(nodePath);
if (!nodePath.startsWith(path + "/")) {
throw new IllegalArgumentException(
String.format("Not a member of this group[%s]: %s", path, nodePath));
}
String memberId = StringUtils.substringAfterLast(no... | [
"public",
"String",
"getMemberId",
"(",
"String",
"nodePath",
")",
"{",
"MorePreconditions",
".",
"checkNotBlank",
"(",
"nodePath",
")",
";",
"if",
"(",
"!",
"nodePath",
".",
"startsWith",
"(",
"path",
"+",
"\"/\"",
")",
")",
"{",
"throw",
"new",
"IllegalA... | Returns the member id given a node path. | [
"Returns",
"the",
"member",
"id",
"given",
"a",
"node",
"path",
"."
] | 872be5f2b147fa50351bdbf08b003a26745e1df8 | https://github.com/twitter/finagle/blob/872be5f2b147fa50351bdbf08b003a26745e1df8/finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/Group.java#L124-L138 |
19,371 | twitter/finagle | finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/Group.java | Group.getMemberIds | public Iterable<String> getMemberIds()
throws ZooKeeperConnectionException, KeeperException, InterruptedException {
return zkClient.get().getChildren(path, false)
.stream()
.filter(nodeNameFilter)
.collect(Collectors.toList());
} | java | public Iterable<String> getMemberIds()
throws ZooKeeperConnectionException, KeeperException, InterruptedException {
return zkClient.get().getChildren(path, false)
.stream()
.filter(nodeNameFilter)
.collect(Collectors.toList());
} | [
"public",
"Iterable",
"<",
"String",
">",
"getMemberIds",
"(",
")",
"throws",
"ZooKeeperConnectionException",
",",
"KeeperException",
",",
"InterruptedException",
"{",
"return",
"zkClient",
".",
"get",
"(",
")",
".",
"getChildren",
"(",
"path",
",",
"false",
")"... | Returns the current list of group member ids by querying ZooKeeper synchronously.
@return the ids of all the present members of this group
@throws ZooKeeperConnectionException if there was a problem connecting to ZooKeeper
@throws KeeperException if there was a problem reading this group's member ids
@throws Interrupt... | [
"Returns",
"the",
"current",
"list",
"of",
"group",
"member",
"ids",
"by",
"querying",
"ZooKeeper",
"synchronously",
"."
] | 872be5f2b147fa50351bdbf08b003a26745e1df8 | https://github.com/twitter/finagle/blob/872be5f2b147fa50351bdbf08b003a26745e1df8/finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/Group.java#L148-L154 |
19,372 | twitter/finagle | finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/Group.java | Group.getMemberData | public byte[] getMemberData(String memberId)
throws ZooKeeperConnectionException, KeeperException, InterruptedException {
return zkClient.get().getData(getMemberPath(memberId), false, null);
} | java | public byte[] getMemberData(String memberId)
throws ZooKeeperConnectionException, KeeperException, InterruptedException {
return zkClient.get().getData(getMemberPath(memberId), false, null);
} | [
"public",
"byte",
"[",
"]",
"getMemberData",
"(",
"String",
"memberId",
")",
"throws",
"ZooKeeperConnectionException",
",",
"KeeperException",
",",
"InterruptedException",
"{",
"return",
"zkClient",
".",
"get",
"(",
")",
".",
"getData",
"(",
"getMemberPath",
"(",
... | Gets the data for one of this groups members by querying ZooKeeper synchronously.
@param memberId the id of the member whose data to retrieve
@return the data associated with the {@code memberId}
@throws ZooKeeperConnectionException if there was a problem connecting to ZooKeeper
@throws KeeperException if there was a ... | [
"Gets",
"the",
"data",
"for",
"one",
"of",
"this",
"groups",
"members",
"by",
"querying",
"ZooKeeper",
"synchronously",
"."
] | 872be5f2b147fa50351bdbf08b003a26745e1df8 | https://github.com/twitter/finagle/blob/872be5f2b147fa50351bdbf08b003a26745e1df8/finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/Group.java#L165-L168 |
19,373 | twitter/finagle | finagle-serversets/src/main/java/com/twitter/finagle/common/util/BackoffHelper.java | BackoffHelper.doUntilResult | public <T, E extends Exception> T doUntilResult(ExceptionalSupplier<T, E> task)
throws InterruptedException, BackoffStoppedException, E {
T result = task.get(); // give an immediate try
return (result != null) ? result : retryWork(task);
} | java | public <T, E extends Exception> T doUntilResult(ExceptionalSupplier<T, E> task)
throws InterruptedException, BackoffStoppedException, E {
T result = task.get(); // give an immediate try
return (result != null) ? result : retryWork(task);
} | [
"public",
"<",
"T",
",",
"E",
"extends",
"Exception",
">",
"T",
"doUntilResult",
"(",
"ExceptionalSupplier",
"<",
"T",
",",
"E",
">",
"task",
")",
"throws",
"InterruptedException",
",",
"BackoffStoppedException",
",",
"E",
"{",
"T",
"result",
"=",
"task",
... | Executes the given task using the configured backoff strategy until the task succeeds as
indicated by returning a non-null value.
@param task the retryable task to execute until success
@return the result of the successfully executed task
@throws InterruptedException if interrupted while waiting for the task to execut... | [
"Executes",
"the",
"given",
"task",
"using",
"the",
"configured",
"backoff",
"strategy",
"until",
"the",
"task",
"succeeds",
"as",
"indicated",
"by",
"returning",
"a",
"non",
"-",
"null",
"value",
"."
] | 872be5f2b147fa50351bdbf08b003a26745e1df8 | https://github.com/twitter/finagle/blob/872be5f2b147fa50351bdbf08b003a26745e1df8/finagle-serversets/src/main/java/com/twitter/finagle/common/util/BackoffHelper.java#L118-L122 |
19,374 | twitter/finagle | finagle-serversets/src/main/java/com/twitter/finagle/common/io/JsonCodec.java | JsonCodec.create | public static <T> JsonCodec<T> create(Class<T> clazz) {
return new JsonCodec<T>(clazz, DefaultGsonHolder.INSTANCE);
} | java | public static <T> JsonCodec<T> create(Class<T> clazz) {
return new JsonCodec<T>(clazz, DefaultGsonHolder.INSTANCE);
} | [
"public",
"static",
"<",
"T",
">",
"JsonCodec",
"<",
"T",
">",
"create",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"new",
"JsonCodec",
"<",
"T",
">",
"(",
"clazz",
",",
"DefaultGsonHolder",
".",
"INSTANCE",
")",
";",
"}"
] | Creates a new JSON codec instance for objects of the specified class.
@param clazz the class of the objects the created codec is for.
@return a newly constructed JSON codec instance for objects of the requested class. | [
"Creates",
"a",
"new",
"JSON",
"codec",
"instance",
"for",
"objects",
"of",
"the",
"specified",
"class",
"."
] | 872be5f2b147fa50351bdbf08b003a26745e1df8 | https://github.com/twitter/finagle/blob/872be5f2b147fa50351bdbf08b003a26745e1df8/finagle-serversets/src/main/java/com/twitter/finagle/common/io/JsonCodec.java#L53-L55 |
19,375 | twitter/finagle | finagle-serversets/src/main/java/com/twitter/finagle/common/io/JsonCodec.java | JsonCodec.create | public static <T> JsonCodec<T> create(Class<T> clazz, Gson gson) {
return new JsonCodec<T>(clazz, gson);
} | java | public static <T> JsonCodec<T> create(Class<T> clazz, Gson gson) {
return new JsonCodec<T>(clazz, gson);
} | [
"public",
"static",
"<",
"T",
">",
"JsonCodec",
"<",
"T",
">",
"create",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Gson",
"gson",
")",
"{",
"return",
"new",
"JsonCodec",
"<",
"T",
">",
"(",
"clazz",
",",
"gson",
")",
";",
"}"
] | Creates a new JSON codec instance for objects of the specified class and the specified Gson
instance. You can use this method if you need to customize the behavior of the Gson
serializer.
@param clazz the class of the objects the created codec is for.
@param gson the Gson instance to use for serialization/deserializat... | [
"Creates",
"a",
"new",
"JSON",
"codec",
"instance",
"for",
"objects",
"of",
"the",
"specified",
"class",
"and",
"the",
"specified",
"Gson",
"instance",
".",
"You",
"can",
"use",
"this",
"method",
"if",
"you",
"need",
"to",
"customize",
"the",
"behavior",
"... | 872be5f2b147fa50351bdbf08b003a26745e1df8 | https://github.com/twitter/finagle/blob/872be5f2b147fa50351bdbf08b003a26745e1df8/finagle-serversets/src/main/java/com/twitter/finagle/common/io/JsonCodec.java#L66-L68 |
19,376 | twitter/finagle | finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/ServerSets.java | ServerSets.serializeServiceInstance | public static byte[] serializeServiceInstance(
ServiceInstance serviceInstance, Codec<ServiceInstance> codec) throws IOException {
ByteArrayOutputStream output = new ByteArrayOutputStream();
codec.serialize(serviceInstance, output);
return output.toByteArray();
} | java | public static byte[] serializeServiceInstance(
ServiceInstance serviceInstance, Codec<ServiceInstance> codec) throws IOException {
ByteArrayOutputStream output = new ByteArrayOutputStream();
codec.serialize(serviceInstance, output);
return output.toByteArray();
} | [
"public",
"static",
"byte",
"[",
"]",
"serializeServiceInstance",
"(",
"ServiceInstance",
"serviceInstance",
",",
"Codec",
"<",
"ServiceInstance",
">",
"codec",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"output",
"=",
"new",
"ByteArrayOutputStream",
... | Returns a serialized Thrift service instance object, with given endpoints and codec.
@param serviceInstance the Thrift service instance object to be serialized
@param codec the codec to use to serialize a Thrift service instance object
@return byte array that contains a serialized Thrift service instance | [
"Returns",
"a",
"serialized",
"Thrift",
"service",
"instance",
"object",
"with",
"given",
"endpoints",
"and",
"codec",
"."
] | 872be5f2b147fa50351bdbf08b003a26745e1df8 | https://github.com/twitter/finagle/blob/872be5f2b147fa50351bdbf08b003a26745e1df8/finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/ServerSets.java#L36-L42 |
19,377 | twitter/finagle | finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/ServerSets.java | ServerSets.deserializeServiceInstance | public static ServiceInstance deserializeServiceInstance(
byte[] data, Codec<ServiceInstance> codec) throws IOException {
return codec.deserialize(new ByteArrayInputStream(data));
} | java | public static ServiceInstance deserializeServiceInstance(
byte[] data, Codec<ServiceInstance> codec) throws IOException {
return codec.deserialize(new ByteArrayInputStream(data));
} | [
"public",
"static",
"ServiceInstance",
"deserializeServiceInstance",
"(",
"byte",
"[",
"]",
"data",
",",
"Codec",
"<",
"ServiceInstance",
">",
"codec",
")",
"throws",
"IOException",
"{",
"return",
"codec",
".",
"deserialize",
"(",
"new",
"ByteArrayInputStream",
"(... | Creates a service instance object deserialized from byte array.
@param data the byte array contains a serialized Thrift service instance
@param codec the codec to use to deserialize the byte array | [
"Creates",
"a",
"service",
"instance",
"object",
"deserialized",
"from",
"byte",
"array",
"."
] | 872be5f2b147fa50351bdbf08b003a26745e1df8 | https://github.com/twitter/finagle/blob/872be5f2b147fa50351bdbf08b003a26745e1df8/finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/ServerSets.java#L69-L73 |
19,378 | JCTools/JCTools | jctools-channels/src/main/java/org/jctools/channels/proxy/ProxyChannelFactory.java | ProxyChannelFactory.createProxy | public static <E> ProxyChannel<E> createProxy(int capacity,
Class<E> iFace,
WaitStrategy waitStrategy,
Class<? extends ProxyChannelRingBuffer> backendType) {
if (!iFace.isInterface()) {
throw new IllegalArgumentException("Not an interface: " + iFace);
}
... | java | public static <E> ProxyChannel<E> createProxy(int capacity,
Class<E> iFace,
WaitStrategy waitStrategy,
Class<? extends ProxyChannelRingBuffer> backendType) {
if (!iFace.isInterface()) {
throw new IllegalArgumentException("Not an interface: " + iFace);
}
... | [
"public",
"static",
"<",
"E",
">",
"ProxyChannel",
"<",
"E",
">",
"createProxy",
"(",
"int",
"capacity",
",",
"Class",
"<",
"E",
">",
"iFace",
",",
"WaitStrategy",
"waitStrategy",
",",
"Class",
"<",
"?",
"extends",
"ProxyChannelRingBuffer",
">",
"backendType... | Create a proxy channel using a user supplied back end.
@param capacity
The minimum capacity for unprocessed invocations the channel
should support
@param iFace
Interface the proxy must implement
@param waitStrategy
A wait strategy to be invoked when the backing data structure
is full
@param backendType
The back end ty... | [
"Create",
"a",
"proxy",
"channel",
"using",
"a",
"user",
"supplied",
"back",
"end",
"."
] | 9250fe316ec84209cbba0a41682f341256df781e | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-channels/src/main/java/org/jctools/channels/proxy/ProxyChannelFactory.java#L111-L183 |
19,379 | JCTools/JCTools | jctools-core/src/main/java/org/jctools/util/Pow2.java | Pow2.align | public static long align(final long value, final int alignment) {
if (!isPowerOfTwo(alignment)) {
throw new IllegalArgumentException("alignment must be a power of 2:" + alignment);
}
return (value + (alignment - 1)) & ~(alignment - 1);
} | java | public static long align(final long value, final int alignment) {
if (!isPowerOfTwo(alignment)) {
throw new IllegalArgumentException("alignment must be a power of 2:" + alignment);
}
return (value + (alignment - 1)) & ~(alignment - 1);
} | [
"public",
"static",
"long",
"align",
"(",
"final",
"long",
"value",
",",
"final",
"int",
"alignment",
")",
"{",
"if",
"(",
"!",
"isPowerOfTwo",
"(",
"alignment",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"alignment must be a power of 2:\"... | Align a value to the next multiple up of alignment. If the value equals an alignment multiple then it
is returned unchanged.
@param value to be aligned up.
@param alignment to be used, must be a power of 2.
@return the value aligned to the next boundary. | [
"Align",
"a",
"value",
"to",
"the",
"next",
"multiple",
"up",
"of",
"alignment",
".",
"If",
"the",
"value",
"equals",
"an",
"alignment",
"multiple",
"then",
"it",
"is",
"returned",
"unchanged",
"."
] | 9250fe316ec84209cbba0a41682f341256df781e | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-core/src/main/java/org/jctools/util/Pow2.java#L55-L60 |
19,380 | JCTools/JCTools | jctools-experimental/src/main/java/org/jctools/queues/MpscRelaxedArrayQueue.java | MpscRelaxedArrayQueue.isFull | private boolean isFull(final long producerPosition)
{
final long consumerPosition = lvConsumerPosition();
final long producerLimit = consumerPosition + this.cycleLength;
if (producerPosition < producerLimit)
{
soProducerLimit(producerLimit);
return false;
... | java | private boolean isFull(final long producerPosition)
{
final long consumerPosition = lvConsumerPosition();
final long producerLimit = consumerPosition + this.cycleLength;
if (producerPosition < producerLimit)
{
soProducerLimit(producerLimit);
return false;
... | [
"private",
"boolean",
"isFull",
"(",
"final",
"long",
"producerPosition",
")",
"{",
"final",
"long",
"consumerPosition",
"=",
"lvConsumerPosition",
"(",
")",
";",
"final",
"long",
"producerLimit",
"=",
"consumerPosition",
"+",
"this",
".",
"cycleLength",
";",
"i... | Given the nature of getAndAdd progress on producerPosition and given the potential risk for over claiming it is
quite possible for this method to report a queue which is not full as full. | [
"Given",
"the",
"nature",
"of",
"getAndAdd",
"progress",
"on",
"producerPosition",
"and",
"given",
"the",
"potential",
"risk",
"for",
"over",
"claiming",
"it",
"is",
"quite",
"possible",
"for",
"this",
"method",
"to",
"report",
"a",
"queue",
"which",
"is",
"... | 9250fe316ec84209cbba0a41682f341256df781e | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-experimental/src/main/java/org/jctools/queues/MpscRelaxedArrayQueue.java#L321-L334 |
19,381 | JCTools/JCTools | jctools-experimental/src/main/java/org/jctools/queues/MpscRelaxedArrayQueue.java | MpscRelaxedArrayQueue.fixProducerOverClaim | private boolean fixProducerOverClaim(
final int activeCycleIndex,
final long producerCycleClaim,
final boolean slowProducer)
{
final long expectedProducerCycleClaim = producerCycleClaim + 1;
//try to fix the overclaim bringing it back to a lower or a safe position
if ... | java | private boolean fixProducerOverClaim(
final int activeCycleIndex,
final long producerCycleClaim,
final boolean slowProducer)
{
final long expectedProducerCycleClaim = producerCycleClaim + 1;
//try to fix the overclaim bringing it back to a lower or a safe position
if ... | [
"private",
"boolean",
"fixProducerOverClaim",
"(",
"final",
"int",
"activeCycleIndex",
",",
"final",
"long",
"producerCycleClaim",
",",
"final",
"boolean",
"slowProducer",
")",
"{",
"final",
"long",
"expectedProducerCycleClaim",
"=",
"producerCycleClaim",
"+",
"1",
";... | It tries to fix a producer overclaim.
@return {@code true} if the claim is now safe to be used,{@code false} otherwise and is needed to retry the claim. | [
"It",
"tries",
"to",
"fix",
"a",
"producer",
"overclaim",
"."
] | 9250fe316ec84209cbba0a41682f341256df781e | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-experimental/src/main/java/org/jctools/queues/MpscRelaxedArrayQueue.java#L406-L433 |
19,382 | JCTools/JCTools | jctools-channels/src/main/java/org/jctools/channels/OffHeapFixedMessageSizeRingBuffer.java | OffHeapFixedMessageSizeRingBuffer.writeReference | protected void writeReference(long offset, Object reference) {
assert referenceMessageSize != 0 : "References are not in use";
// Is there a way to compute the element offset once and just
// arithmetic?
UnsafeRefArrayAccess.spElement(references, UnsafeRefArrayAccess.calcElementOffset(of... | java | protected void writeReference(long offset, Object reference) {
assert referenceMessageSize != 0 : "References are not in use";
// Is there a way to compute the element offset once and just
// arithmetic?
UnsafeRefArrayAccess.spElement(references, UnsafeRefArrayAccess.calcElementOffset(of... | [
"protected",
"void",
"writeReference",
"(",
"long",
"offset",
",",
"Object",
"reference",
")",
"{",
"assert",
"referenceMessageSize",
"!=",
"0",
":",
"\"References are not in use\"",
";",
"// Is there a way to compute the element offset once and just",
"// arithmetic?",
"Unsa... | Write a reference to the given position
@param offset index into the reference array
@param reference | [
"Write",
"a",
"reference",
"to",
"the",
"given",
"position"
] | 9250fe316ec84209cbba0a41682f341256df781e | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-channels/src/main/java/org/jctools/channels/OffHeapFixedMessageSizeRingBuffer.java#L248-L253 |
19,383 | JCTools/JCTools | jctools-channels/src/main/java/org/jctools/channels/OffHeapFixedMessageSizeRingBuffer.java | OffHeapFixedMessageSizeRingBuffer.readReference | protected Object readReference(long offset) {
assert referenceMessageSize != 0 : "References are not in use";
// Is there a way to compute the element offset once and just
// arithmetic?
return UnsafeRefArrayAccess.lpElement(references, UnsafeRefArrayAccess.calcElementOffset(offset));
... | java | protected Object readReference(long offset) {
assert referenceMessageSize != 0 : "References are not in use";
// Is there a way to compute the element offset once and just
// arithmetic?
return UnsafeRefArrayAccess.lpElement(references, UnsafeRefArrayAccess.calcElementOffset(offset));
... | [
"protected",
"Object",
"readReference",
"(",
"long",
"offset",
")",
"{",
"assert",
"referenceMessageSize",
"!=",
"0",
":",
"\"References are not in use\"",
";",
"// Is there a way to compute the element offset once and just",
"// arithmetic?",
"return",
"UnsafeRefArrayAccess",
... | Read a reference at the given position
@param offset index into the reference array
@return | [
"Read",
"a",
"reference",
"at",
"the",
"given",
"position"
] | 9250fe316ec84209cbba0a41682f341256df781e | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-channels/src/main/java/org/jctools/channels/OffHeapFixedMessageSizeRingBuffer.java#L260-L265 |
19,384 | JCTools/JCTools | jctools-experimental/src/main/java/org/jctools/counters/FixedSizeStripedLongCounter.java | FixedSizeStripedLongCounter.probe | private int probe() {
// Fast path for reliable well-distributed probe, available from JDK 7+.
// As long as PROBE is final this branch will be inlined.
if (PROBE != -1) {
int probe;
if ((probe = UNSAFE.getInt(Thread.currentThread(), PROBE)) == 0) {
Thread... | java | private int probe() {
// Fast path for reliable well-distributed probe, available from JDK 7+.
// As long as PROBE is final this branch will be inlined.
if (PROBE != -1) {
int probe;
if ((probe = UNSAFE.getInt(Thread.currentThread(), PROBE)) == 0) {
Thread... | [
"private",
"int",
"probe",
"(",
")",
"{",
"// Fast path for reliable well-distributed probe, available from JDK 7+.",
"// As long as PROBE is final this branch will be inlined.",
"if",
"(",
"PROBE",
"!=",
"-",
"1",
")",
"{",
"int",
"probe",
";",
"if",
"(",
"(",
"probe",
... | Returns the probe value for the current thread.
If target JDK version is 7 or higher, than ThreadLocalRandom-specific
value will be used, xorshift with thread id otherwise. | [
"Returns",
"the",
"probe",
"value",
"for",
"the",
"current",
"thread",
".",
"If",
"target",
"JDK",
"version",
"is",
"7",
"or",
"higher",
"than",
"ThreadLocalRandom",
"-",
"specific",
"value",
"will",
"be",
"used",
"xorshift",
"with",
"thread",
"id",
"otherwi... | 9250fe316ec84209cbba0a41682f341256df781e | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-experimental/src/main/java/org/jctools/counters/FixedSizeStripedLongCounter.java#L109-L132 |
19,385 | JCTools/JCTools | jctools-core/src/main/java/org/jctools/maps/ConcurrentAutoTable.java | ConcurrentAutoTable.set | public void set( long x ) {
CAT newcat = new CAT(null,4,x);
// Spin until CAS works
while( !CAS_cat(_cat,newcat) ) {/*empty*/}
} | java | public void set( long x ) {
CAT newcat = new CAT(null,4,x);
// Spin until CAS works
while( !CAS_cat(_cat,newcat) ) {/*empty*/}
} | [
"public",
"void",
"set",
"(",
"long",
"x",
")",
"{",
"CAT",
"newcat",
"=",
"new",
"CAT",
"(",
"null",
",",
"4",
",",
"x",
")",
";",
"// Spin until CAS works",
"while",
"(",
"!",
"CAS_cat",
"(",
"_cat",
",",
"newcat",
")",
")",
"{",
"/*empty*/",
"}"... | Atomically set the sum of the striped counters to specified value.
Rather more expensive than a simple store, in order to remain atomic. | [
"Atomically",
"set",
"the",
"sum",
"of",
"the",
"striped",
"counters",
"to",
"specified",
"value",
".",
"Rather",
"more",
"expensive",
"than",
"a",
"simple",
"store",
"in",
"order",
"to",
"remain",
"atomic",
"."
] | 9250fe316ec84209cbba0a41682f341256df781e | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-core/src/main/java/org/jctools/maps/ConcurrentAutoTable.java#L52-L56 |
19,386 | JCTools/JCTools | jctools-build/src/main/java/org/jctools/queues/atomic/JavaParsingAtomicArrayQueueGenerator.java | JavaParsingAtomicArrayQueueGenerator.replaceParentClassesForAtomics | private void replaceParentClassesForAtomics(ClassOrInterfaceDeclaration n) {
for (ClassOrInterfaceType parent : n.getExtendedTypes()) {
if ("ConcurrentCircularArrayQueue".equals(parent.getNameAsString())) {
parent.setName("AtomicReferenceArrayQueue");
} else if ("Concurre... | java | private void replaceParentClassesForAtomics(ClassOrInterfaceDeclaration n) {
for (ClassOrInterfaceType parent : n.getExtendedTypes()) {
if ("ConcurrentCircularArrayQueue".equals(parent.getNameAsString())) {
parent.setName("AtomicReferenceArrayQueue");
} else if ("Concurre... | [
"private",
"void",
"replaceParentClassesForAtomics",
"(",
"ClassOrInterfaceDeclaration",
"n",
")",
"{",
"for",
"(",
"ClassOrInterfaceType",
"parent",
":",
"n",
".",
"getExtendedTypes",
"(",
")",
")",
"{",
"if",
"(",
"\"ConcurrentCircularArrayQueue\"",
".",
"equals",
... | Searches all extended or implemented super classes or interfaces for
special classes that differ with the atomics version and replaces them
with the appropriate class.
@param n | [
"Searches",
"all",
"extended",
"or",
"implemented",
"super",
"classes",
"or",
"interfaces",
"for",
"special",
"classes",
"that",
"differ",
"with",
"the",
"atomics",
"version",
"and",
"replaces",
"them",
"with",
"the",
"appropriate",
"class",
"."
] | 9250fe316ec84209cbba0a41682f341256df781e | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-build/src/main/java/org/jctools/queues/atomic/JavaParsingAtomicArrayQueueGenerator.java#L157-L169 |
19,387 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/ServiceInfo.java | ServiceInfo.of | public static ServiceInfo of(String serviceName, ServiceAcl... acls) {
return new ServiceInfo(serviceName, TreePVector.from(Arrays.asList(acls)));
} | java | public static ServiceInfo of(String serviceName, ServiceAcl... acls) {
return new ServiceInfo(serviceName, TreePVector.from(Arrays.asList(acls)));
} | [
"public",
"static",
"ServiceInfo",
"of",
"(",
"String",
"serviceName",
",",
"ServiceAcl",
"...",
"acls",
")",
"{",
"return",
"new",
"ServiceInfo",
"(",
"serviceName",
",",
"TreePVector",
".",
"from",
"(",
"Arrays",
".",
"asList",
"(",
"acls",
")",
")",
")"... | Factory method to create ServiceInfo instances that contain a single locatable service.
@param serviceName
@param acls for the single locatableService of this Service.
@return | [
"Factory",
"method",
"to",
"create",
"ServiceInfo",
"instances",
"that",
"contain",
"a",
"single",
"locatable",
"service",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/ServiceInfo.java#L81-L83 |
19,388 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/MessageProtocol.java | MessageProtocol.withContentType | public MessageProtocol withContentType(String contentType) {
return new MessageProtocol(Optional.ofNullable(contentType), charset, version);
} | java | public MessageProtocol withContentType(String contentType) {
return new MessageProtocol(Optional.ofNullable(contentType), charset, version);
} | [
"public",
"MessageProtocol",
"withContentType",
"(",
"String",
"contentType",
")",
"{",
"return",
"new",
"MessageProtocol",
"(",
"Optional",
".",
"ofNullable",
"(",
"contentType",
")",
",",
"charset",
",",
"version",
")",
";",
"}"
] | Return a copy of this message protocol with the content type set to the given content type.
@param contentType The content type to set.
@return A copy of this message protocol. | [
"Return",
"a",
"copy",
"of",
"this",
"message",
"protocol",
"with",
"the",
"content",
"type",
"set",
"to",
"the",
"given",
"content",
"type",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/MessageProtocol.java#L99-L101 |
19,389 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/MessageProtocol.java | MessageProtocol.withCharset | public MessageProtocol withCharset(String charset) {
return new MessageProtocol(contentType, Optional.ofNullable(charset), version);
} | java | public MessageProtocol withCharset(String charset) {
return new MessageProtocol(contentType, Optional.ofNullable(charset), version);
} | [
"public",
"MessageProtocol",
"withCharset",
"(",
"String",
"charset",
")",
"{",
"return",
"new",
"MessageProtocol",
"(",
"contentType",
",",
"Optional",
".",
"ofNullable",
"(",
"charset",
")",
",",
"version",
")",
";",
"}"
] | Return a copy of this message protocol with the charset set to the given charset.
@param charset The charset to set.
@return A copy of this message protocol. | [
"Return",
"a",
"copy",
"of",
"this",
"message",
"protocol",
"with",
"the",
"charset",
"set",
"to",
"the",
"given",
"charset",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/MessageProtocol.java#L109-L111 |
19,390 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/MessageProtocol.java | MessageProtocol.withVersion | public MessageProtocol withVersion(String version) {
return new MessageProtocol(contentType, charset, Optional.ofNullable(version));
} | java | public MessageProtocol withVersion(String version) {
return new MessageProtocol(contentType, charset, Optional.ofNullable(version));
} | [
"public",
"MessageProtocol",
"withVersion",
"(",
"String",
"version",
")",
"{",
"return",
"new",
"MessageProtocol",
"(",
"contentType",
",",
"charset",
",",
"Optional",
".",
"ofNullable",
"(",
"version",
")",
")",
";",
"}"
] | Return a copy of this message protocol with the version set to the given version.
@param version The version to set.
@return A copy of this message protocol. | [
"Return",
"a",
"copy",
"of",
"this",
"message",
"protocol",
"with",
"the",
"version",
"set",
"to",
"the",
"given",
"version",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/MessageProtocol.java#L119-L121 |
19,391 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/MessageProtocol.java | MessageProtocol.isText | public boolean isText() {
boolean isJson = contentType.map(contentType -> "application/json".equals(contentType)).orElse(false);
boolean isPlainText = contentType.map(contentType -> "text/plain".equals(contentType)).orElse(false);
return charset.isPresent() || isJson || isPlainText;
} | java | public boolean isText() {
boolean isJson = contentType.map(contentType -> "application/json".equals(contentType)).orElse(false);
boolean isPlainText = contentType.map(contentType -> "text/plain".equals(contentType)).orElse(false);
return charset.isPresent() || isJson || isPlainText;
} | [
"public",
"boolean",
"isText",
"(",
")",
"{",
"boolean",
"isJson",
"=",
"contentType",
".",
"map",
"(",
"contentType",
"->",
"\"application/json\"",
".",
"equals",
"(",
"contentType",
")",
")",
".",
"orElse",
"(",
"false",
")",
";",
"boolean",
"isPlainText",... | Whether this message protocol is a text based protocol.
This is determined by whether the charset is defined.
@return true if this message protocol is text based. | [
"Whether",
"this",
"message",
"protocol",
"is",
"a",
"text",
"based",
"protocol",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/MessageProtocol.java#L130-L135 |
19,392 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/MessageProtocol.java | MessageProtocol.isUtf8 | public boolean isUtf8() {
if (charset.isPresent()) {
return utf8Charset.equals(Charset.forName(charset.get()));
} else {
return false;
}
} | java | public boolean isUtf8() {
if (charset.isPresent()) {
return utf8Charset.equals(Charset.forName(charset.get()));
} else {
return false;
}
} | [
"public",
"boolean",
"isUtf8",
"(",
")",
"{",
"if",
"(",
"charset",
".",
"isPresent",
"(",
")",
")",
"{",
"return",
"utf8Charset",
".",
"equals",
"(",
"Charset",
".",
"forName",
"(",
"charset",
".",
"get",
"(",
")",
")",
")",
";",
"}",
"else",
"{",... | Whether the protocol uses UTF-8.
@return true if the charset used by this protocol is UTF-8, false if it's some other encoding or if no charset is
defined. | [
"Whether",
"the",
"protocol",
"uses",
"UTF",
"-",
"8",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/MessageProtocol.java#L145-L151 |
19,393 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/MessageProtocol.java | MessageProtocol.toContentTypeHeader | public Optional<String> toContentTypeHeader() {
return contentType.map(ct -> {
if (charset.isPresent()) {
return ct + "; charset=" + charset.get();
} else {
return ct;
}
});
} | java | public Optional<String> toContentTypeHeader() {
return contentType.map(ct -> {
if (charset.isPresent()) {
return ct + "; charset=" + charset.get();
} else {
return ct;
}
});
} | [
"public",
"Optional",
"<",
"String",
">",
"toContentTypeHeader",
"(",
")",
"{",
"return",
"contentType",
".",
"map",
"(",
"ct",
"->",
"{",
"if",
"(",
"charset",
".",
"isPresent",
"(",
")",
")",
"{",
"return",
"ct",
"+",
"\"; charset=\"",
"+",
"charset",
... | Convert this message protocol to a content type header, if the content type is defined.
@return The message protocol as a content type header. | [
"Convert",
"this",
"message",
"protocol",
"to",
"a",
"content",
"type",
"header",
"if",
"the",
"content",
"type",
"is",
"defined",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/MessageProtocol.java#L158-L166 |
19,394 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/MessageProtocol.java | MessageProtocol.fromContentTypeHeader | public static MessageProtocol fromContentTypeHeader(Optional<String> contentType) {
return contentType.map(ct -> {
String[] parts = ct.split(";");
String justContentType = parts[0];
Optional<String> charset = Optional.empty();
for (int i = 1; i < parts.length; i++... | java | public static MessageProtocol fromContentTypeHeader(Optional<String> contentType) {
return contentType.map(ct -> {
String[] parts = ct.split(";");
String justContentType = parts[0];
Optional<String> charset = Optional.empty();
for (int i = 1; i < parts.length; i++... | [
"public",
"static",
"MessageProtocol",
"fromContentTypeHeader",
"(",
"Optional",
"<",
"String",
">",
"contentType",
")",
"{",
"return",
"contentType",
".",
"map",
"(",
"ct",
"->",
"{",
"String",
"[",
"]",
"parts",
"=",
"ct",
".",
"split",
"(",
"\";\"",
")"... | Parse a message protocol from a content type header, if defined.
@param contentType The content type header to parse.
@return The parsed message protocol. | [
"Parse",
"a",
"message",
"protocol",
"from",
"a",
"content",
"type",
"header",
"if",
"defined",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/MessageProtocol.java#L174-L188 |
19,395 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/deser/PathParamSerializers.java | PathParamSerializers.required | public static <Param> PathParamSerializer<Param> required(String name, Function<String, Param> deserialize,
Function<Param, String> serialize) {
return new NamedPathParamSerializer<Param>(name) {
@Override
public PSequence<Str... | java | public static <Param> PathParamSerializer<Param> required(String name, Function<String, Param> deserialize,
Function<Param, String> serialize) {
return new NamedPathParamSerializer<Param>(name) {
@Override
public PSequence<Str... | [
"public",
"static",
"<",
"Param",
">",
"PathParamSerializer",
"<",
"Param",
">",
"required",
"(",
"String",
"name",
",",
"Function",
"<",
"String",
",",
"Param",
">",
"deserialize",
",",
"Function",
"<",
"Param",
",",
"String",
">",
"serialize",
")",
"{",
... | Create a PathParamSerializer for required parameters. | [
"Create",
"a",
"PathParamSerializer",
"for",
"required",
"parameters",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/deser/PathParamSerializers.java#L30-L47 |
19,396 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/deser/PathParamSerializers.java | PathParamSerializers.optional | public static <Param> PathParamSerializer<Optional<Param>> optional(String name,
Function<String, Param> deserialize,
Function<Param, String> serialize) {
return new N... | java | public static <Param> PathParamSerializer<Optional<Param>> optional(String name,
Function<String, Param> deserialize,
Function<Param, String> serialize) {
return new N... | [
"public",
"static",
"<",
"Param",
">",
"PathParamSerializer",
"<",
"Optional",
"<",
"Param",
">",
">",
"optional",
"(",
"String",
"name",
",",
"Function",
"<",
"String",
",",
"Param",
">",
"deserialize",
",",
"Function",
"<",
"Param",
",",
"String",
">",
... | Create a PathParamSerializer for optional parameters. | [
"Create",
"a",
"PathParamSerializer",
"for",
"optional",
"parameters",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/deser/PathParamSerializers.java#L52-L71 |
19,397 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/deser/PathParamSerializers.java | PathParamSerializers.list | public static <Param> PathParamSerializer<List<Param>> list(String name,
Function<PSequence<String>, Param> deserialize,
Function<Param, PSequence<String>> serialize) {
return new Nam... | java | public static <Param> PathParamSerializer<List<Param>> list(String name,
Function<PSequence<String>, Param> deserialize,
Function<Param, PSequence<String>> serialize) {
return new Nam... | [
"public",
"static",
"<",
"Param",
">",
"PathParamSerializer",
"<",
"List",
"<",
"Param",
">",
">",
"list",
"(",
"String",
"name",
",",
"Function",
"<",
"PSequence",
"<",
"String",
">",
",",
"Param",
">",
"deserialize",
",",
"Function",
"<",
"Param",
",",... | Create a PathParamSerializer for List parameters. | [
"Create",
"a",
"PathParamSerializer",
"for",
"List",
"parameters",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/deser/PathParamSerializers.java#L93-L111 |
19,398 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/deser/PathParamSerializers.java | PathParamSerializers.set | public static <Param> PathParamSerializer<Set<Param>> set(String name,
Function<PSequence<String>, Param> deserialize,
Function<Param, PSequence<String>> serialize) {
return new NamedPath... | java | public static <Param> PathParamSerializer<Set<Param>> set(String name,
Function<PSequence<String>, Param> deserialize,
Function<Param, PSequence<String>> serialize) {
return new NamedPath... | [
"public",
"static",
"<",
"Param",
">",
"PathParamSerializer",
"<",
"Set",
"<",
"Param",
">",
">",
"set",
"(",
"String",
"name",
",",
"Function",
"<",
"PSequence",
"<",
"String",
">",
",",
"Param",
">",
"deserialize",
",",
"Function",
"<",
"Param",
",",
... | Create a PathParamSerializer for Set parameters. | [
"Create",
"a",
"PathParamSerializer",
"for",
"Set",
"parameters",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/deser/PathParamSerializers.java#L117-L135 |
19,399 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/deser/RawExceptionMessage.java | RawExceptionMessage.messageAsText | public String messageAsText() {
if (protocol.charset().isPresent()) {
return message.decodeString(protocol.charset().get());
} else {
return Base64.getEncoder().encodeToString(message.toArray());
}
} | java | public String messageAsText() {
if (protocol.charset().isPresent()) {
return message.decodeString(protocol.charset().get());
} else {
return Base64.getEncoder().encodeToString(message.toArray());
}
} | [
"public",
"String",
"messageAsText",
"(",
")",
"{",
"if",
"(",
"protocol",
".",
"charset",
"(",
")",
".",
"isPresent",
"(",
")",
")",
"{",
"return",
"message",
".",
"decodeString",
"(",
"protocol",
".",
"charset",
"(",
")",
".",
"get",
"(",
")",
")",... | Get the message as text.
If this is a binary message (that is, the message protocol does not define a charset), encodes it using Base64.
@return The message as text. | [
"Get",
"the",
"message",
"as",
"text",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/deser/RawExceptionMessage.java#L73-L79 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.