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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
21,000 | qos-ch/slf4j | slf4j-ext/src/main/java/org/slf4j/cal10n/LocLogger.java | LocLogger.warn | public void warn(Enum<?> key, Object... args) {
if (!logger.isWarnEnabled()) {
return;
}
String translatedMsg = imc.getMessage(key, args);
MessageParameterObj mpo = new MessageParameterObj(key, args);
if (instanceofLAL) {
((LocationAwareLogger) logger).lo... | java | public void warn(Enum<?> key, Object... args) {
if (!logger.isWarnEnabled()) {
return;
}
String translatedMsg = imc.getMessage(key, args);
MessageParameterObj mpo = new MessageParameterObj(key, args);
if (instanceofLAL) {
((LocationAwareLogger) logger).lo... | [
"public",
"void",
"warn",
"(",
"Enum",
"<",
"?",
">",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"!",
"logger",
".",
"isWarnEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"String",
"translatedMsg",
"=",
"imc",
".",
"getMessage",
"... | Log a localized message at the WARN level.
@param key
the key used for localization
@param args
optional arguments | [
"Log",
"a",
"localized",
"message",
"at",
"the",
"WARN",
"level",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-ext/src/main/java/org/slf4j/cal10n/LocLogger.java#L137-L149 |
21,001 | qos-ch/slf4j | slf4j-ext/src/main/java/org/slf4j/cal10n/LocLogger.java | LocLogger.error | public void error(Enum<?> key, Object... args) {
if (!logger.isErrorEnabled()) {
return;
}
String translatedMsg = imc.getMessage(key, args);
MessageParameterObj mpo = new MessageParameterObj(key, args);
if (instanceofLAL) {
((LocationAwareLogger) logger).... | java | public void error(Enum<?> key, Object... args) {
if (!logger.isErrorEnabled()) {
return;
}
String translatedMsg = imc.getMessage(key, args);
MessageParameterObj mpo = new MessageParameterObj(key, args);
if (instanceofLAL) {
((LocationAwareLogger) logger).... | [
"public",
"void",
"error",
"(",
"Enum",
"<",
"?",
">",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"!",
"logger",
".",
"isErrorEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"String",
"translatedMsg",
"=",
"imc",
".",
"getMessage",
... | Log a localized message at the ERROR level.
@param key
the key used for localization
@param args
optional arguments | [
"Log",
"a",
"localized",
"message",
"at",
"the",
"ERROR",
"level",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-ext/src/main/java/org/slf4j/cal10n/LocLogger.java#L159-L171 |
21,002 | qos-ch/slf4j | slf4j-ext/src/main/java/org/slf4j/ext/XLogger.java | XLogger.entry | public void entry(Object... argArray) {
if (instanceofLAL && logger.isTraceEnabled(ENTRY_MARKER)) {
String messagePattern = null;
if (argArray.length < ENTRY_MESSAGE_ARRAY_LEN) {
messagePattern = ENTRY_MESSAGE_ARRAY[argArray.length];
} else {
m... | java | public void entry(Object... argArray) {
if (instanceofLAL && logger.isTraceEnabled(ENTRY_MARKER)) {
String messagePattern = null;
if (argArray.length < ENTRY_MESSAGE_ARRAY_LEN) {
messagePattern = ENTRY_MESSAGE_ARRAY[argArray.length];
} else {
m... | [
"public",
"void",
"entry",
"(",
"Object",
"...",
"argArray",
")",
"{",
"if",
"(",
"instanceofLAL",
"&&",
"logger",
".",
"isTraceEnabled",
"(",
"ENTRY_MARKER",
")",
")",
"{",
"String",
"messagePattern",
"=",
"null",
";",
"if",
"(",
"argArray",
".",
"length"... | Log method entry.
@param argArray
supplied parameters | [
"Log",
"method",
"entry",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-ext/src/main/java/org/slf4j/ext/XLogger.java#L115-L126 |
21,003 | qos-ch/slf4j | slf4j-ext/src/main/java/org/slf4j/ext/XLogger.java | XLogger.throwing | public <T extends Throwable> T throwing(T throwable) {
if (instanceofLAL) {
((LocationAwareLogger) logger).log(THROWING_MARKER, FQCN, LocationAwareLogger.ERROR_INT, "throwing", null, throwable);
}
return throwable;
} | java | public <T extends Throwable> T throwing(T throwable) {
if (instanceofLAL) {
((LocationAwareLogger) logger).log(THROWING_MARKER, FQCN, LocationAwareLogger.ERROR_INT, "throwing", null, throwable);
}
return throwable;
} | [
"public",
"<",
"T",
"extends",
"Throwable",
">",
"T",
"throwing",
"(",
"T",
"throwable",
")",
"{",
"if",
"(",
"instanceofLAL",
")",
"{",
"(",
"(",
"LocationAwareLogger",
")",
"logger",
")",
".",
"log",
"(",
"THROWING_MARKER",
",",
"FQCN",
",",
"LocationA... | Log an exception being thrown. The generated log event uses Level ERROR.
@param throwable
the exception being caught. | [
"Log",
"an",
"exception",
"being",
"thrown",
".",
"The",
"generated",
"log",
"event",
"uses",
"Level",
"ERROR",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-ext/src/main/java/org/slf4j/ext/XLogger.java#L157-L162 |
21,004 | qos-ch/slf4j | slf4j-ext/src/main/java/org/slf4j/ext/XLogger.java | XLogger.throwing | public <T extends Throwable> T throwing(Level level, T throwable) {
if (instanceofLAL) {
((LocationAwareLogger) logger).log(THROWING_MARKER, FQCN, level.level, "throwing", null, throwable);
}
return throwable;
} | java | public <T extends Throwable> T throwing(Level level, T throwable) {
if (instanceofLAL) {
((LocationAwareLogger) logger).log(THROWING_MARKER, FQCN, level.level, "throwing", null, throwable);
}
return throwable;
} | [
"public",
"<",
"T",
"extends",
"Throwable",
">",
"T",
"throwing",
"(",
"Level",
"level",
",",
"T",
"throwable",
")",
"{",
"if",
"(",
"instanceofLAL",
")",
"{",
"(",
"(",
"LocationAwareLogger",
")",
"logger",
")",
".",
"log",
"(",
"THROWING_MARKER",
",",
... | Log an exception being thrown allowing the log level to be specified.
@param level
the logging level to use.
@param throwable
the exception being caught. | [
"Log",
"an",
"exception",
"being",
"thrown",
"allowing",
"the",
"log",
"level",
"to",
"be",
"specified",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-ext/src/main/java/org/slf4j/ext/XLogger.java#L172-L177 |
21,005 | qos-ch/slf4j | slf4j-ext/src/main/java/org/slf4j/ext/XLogger.java | XLogger.catching | public void catching(Throwable throwable) {
if (instanceofLAL) {
((LocationAwareLogger) logger).log(CATCHING_MARKER, FQCN, LocationAwareLogger.ERROR_INT, "catching", null, throwable);
}
} | java | public void catching(Throwable throwable) {
if (instanceofLAL) {
((LocationAwareLogger) logger).log(CATCHING_MARKER, FQCN, LocationAwareLogger.ERROR_INT, "catching", null, throwable);
}
} | [
"public",
"void",
"catching",
"(",
"Throwable",
"throwable",
")",
"{",
"if",
"(",
"instanceofLAL",
")",
"{",
"(",
"(",
"LocationAwareLogger",
")",
"logger",
")",
".",
"log",
"(",
"CATCHING_MARKER",
",",
"FQCN",
",",
"LocationAwareLogger",
".",
"ERROR_INT",
"... | Log an exception being caught. The generated log event uses Level ERROR.
@param throwable
the exception being caught. | [
"Log",
"an",
"exception",
"being",
"caught",
".",
"The",
"generated",
"log",
"event",
"uses",
"Level",
"ERROR",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-ext/src/main/java/org/slf4j/ext/XLogger.java#L185-L189 |
21,006 | qos-ch/slf4j | slf4j-ext/src/main/java/org/slf4j/ext/XLogger.java | XLogger.catching | public void catching(Level level, Throwable throwable) {
if (instanceofLAL) {
((LocationAwareLogger) logger).log(CATCHING_MARKER, FQCN, level.level, "catching", null, throwable);
}
} | java | public void catching(Level level, Throwable throwable) {
if (instanceofLAL) {
((LocationAwareLogger) logger).log(CATCHING_MARKER, FQCN, level.level, "catching", null, throwable);
}
} | [
"public",
"void",
"catching",
"(",
"Level",
"level",
",",
"Throwable",
"throwable",
")",
"{",
"if",
"(",
"instanceofLAL",
")",
"{",
"(",
"(",
"LocationAwareLogger",
")",
"logger",
")",
".",
"log",
"(",
"CATCHING_MARKER",
",",
"FQCN",
",",
"level",
".",
"... | Log an exception being caught allowing the log level to be specified.
@param level
the logging level to use.
@param throwable
the exception being caught. | [
"Log",
"an",
"exception",
"being",
"caught",
"allowing",
"the",
"log",
"level",
"to",
"be",
"specified",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-ext/src/main/java/org/slf4j/ext/XLogger.java#L199-L203 |
21,007 | qos-ch/slf4j | slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java | SimpleLogger.formatAndLog | private void formatAndLog(int level, String format, Object arg1, Object arg2) {
if (!isLevelEnabled(level)) {
return;
}
FormattingTuple tp = MessageFormatter.format(format, arg1, arg2);
log(level, tp.getMessage(), tp.getThrowable());
} | java | private void formatAndLog(int level, String format, Object arg1, Object arg2) {
if (!isLevelEnabled(level)) {
return;
}
FormattingTuple tp = MessageFormatter.format(format, arg1, arg2);
log(level, tp.getMessage(), tp.getThrowable());
} | [
"private",
"void",
"formatAndLog",
"(",
"int",
"level",
",",
"String",
"format",
",",
"Object",
"arg1",
",",
"Object",
"arg2",
")",
"{",
"if",
"(",
"!",
"isLevelEnabled",
"(",
"level",
")",
")",
"{",
"return",
";",
"}",
"FormattingTuple",
"tp",
"=",
"M... | For formatted messages, first substitute arguments and then log.
@param level
@param format
@param arg1
@param arg2 | [
"For",
"formatted",
"messages",
"first",
"substitute",
"arguments",
"and",
"then",
"log",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java#L350-L356 |
21,008 | qos-ch/slf4j | slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java | SimpleLogger.trace | public void trace(String format, Object param1) {
formatAndLog(LOG_LEVEL_TRACE, format, param1, null);
} | java | public void trace(String format, Object param1) {
formatAndLog(LOG_LEVEL_TRACE, format, param1, null);
} | [
"public",
"void",
"trace",
"(",
"String",
"format",
",",
"Object",
"param1",
")",
"{",
"formatAndLog",
"(",
"LOG_LEVEL_TRACE",
",",
"format",
",",
"param1",
",",
"null",
")",
";",
"}"
] | Perform single parameter substitution before logging the message of level
TRACE according to the format outlined above. | [
"Perform",
"single",
"parameter",
"substitution",
"before",
"logging",
"the",
"message",
"of",
"level",
"TRACE",
"according",
"to",
"the",
"format",
"outlined",
"above",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java#L403-L405 |
21,009 | qos-ch/slf4j | slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java | SimpleLogger.trace | public void trace(String format, Object param1, Object param2) {
formatAndLog(LOG_LEVEL_TRACE, format, param1, param2);
} | java | public void trace(String format, Object param1, Object param2) {
formatAndLog(LOG_LEVEL_TRACE, format, param1, param2);
} | [
"public",
"void",
"trace",
"(",
"String",
"format",
",",
"Object",
"param1",
",",
"Object",
"param2",
")",
"{",
"formatAndLog",
"(",
"LOG_LEVEL_TRACE",
",",
"format",
",",
"param1",
",",
"param2",
")",
";",
"}"
] | Perform double parameter substitution before logging the message of level
TRACE according to the format outlined above. | [
"Perform",
"double",
"parameter",
"substitution",
"before",
"logging",
"the",
"message",
"of",
"level",
"TRACE",
"according",
"to",
"the",
"format",
"outlined",
"above",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java#L411-L413 |
21,010 | qos-ch/slf4j | slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java | SimpleLogger.debug | public void debug(String format, Object param1) {
formatAndLog(LOG_LEVEL_DEBUG, format, param1, null);
} | java | public void debug(String format, Object param1) {
formatAndLog(LOG_LEVEL_DEBUG, format, param1, null);
} | [
"public",
"void",
"debug",
"(",
"String",
"format",
",",
"Object",
"param1",
")",
"{",
"formatAndLog",
"(",
"LOG_LEVEL_DEBUG",
",",
"format",
",",
"param1",
",",
"null",
")",
";",
"}"
] | Perform single parameter substitution before logging the message of level
DEBUG according to the format outlined above. | [
"Perform",
"single",
"parameter",
"substitution",
"before",
"logging",
"the",
"message",
"of",
"level",
"DEBUG",
"according",
"to",
"the",
"format",
"outlined",
"above",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java#L445-L447 |
21,011 | qos-ch/slf4j | slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java | SimpleLogger.debug | public void debug(String format, Object param1, Object param2) {
formatAndLog(LOG_LEVEL_DEBUG, format, param1, param2);
} | java | public void debug(String format, Object param1, Object param2) {
formatAndLog(LOG_LEVEL_DEBUG, format, param1, param2);
} | [
"public",
"void",
"debug",
"(",
"String",
"format",
",",
"Object",
"param1",
",",
"Object",
"param2",
")",
"{",
"formatAndLog",
"(",
"LOG_LEVEL_DEBUG",
",",
"format",
",",
"param1",
",",
"param2",
")",
";",
"}"
] | Perform double parameter substitution before logging the message of level
DEBUG according to the format outlined above. | [
"Perform",
"double",
"parameter",
"substitution",
"before",
"logging",
"the",
"message",
"of",
"level",
"DEBUG",
"according",
"to",
"the",
"format",
"outlined",
"above",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java#L453-L455 |
21,012 | qos-ch/slf4j | slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java | SimpleLogger.info | public void info(String format, Object arg) {
formatAndLog(LOG_LEVEL_INFO, format, arg, null);
} | java | public void info(String format, Object arg) {
formatAndLog(LOG_LEVEL_INFO, format, arg, null);
} | [
"public",
"void",
"info",
"(",
"String",
"format",
",",
"Object",
"arg",
")",
"{",
"formatAndLog",
"(",
"LOG_LEVEL_INFO",
",",
"format",
",",
"arg",
",",
"null",
")",
";",
"}"
] | Perform single parameter substitution before logging the message of level
INFO according to the format outlined above. | [
"Perform",
"single",
"parameter",
"substitution",
"before",
"logging",
"the",
"message",
"of",
"level",
"INFO",
"according",
"to",
"the",
"format",
"outlined",
"above",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java#L487-L489 |
21,013 | qos-ch/slf4j | slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java | SimpleLogger.info | public void info(String format, Object arg1, Object arg2) {
formatAndLog(LOG_LEVEL_INFO, format, arg1, arg2);
} | java | public void info(String format, Object arg1, Object arg2) {
formatAndLog(LOG_LEVEL_INFO, format, arg1, arg2);
} | [
"public",
"void",
"info",
"(",
"String",
"format",
",",
"Object",
"arg1",
",",
"Object",
"arg2",
")",
"{",
"formatAndLog",
"(",
"LOG_LEVEL_INFO",
",",
"format",
",",
"arg1",
",",
"arg2",
")",
";",
"}"
] | Perform double parameter substitution before logging the message of level
INFO according to the format outlined above. | [
"Perform",
"double",
"parameter",
"substitution",
"before",
"logging",
"the",
"message",
"of",
"level",
"INFO",
"according",
"to",
"the",
"format",
"outlined",
"above",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java#L495-L497 |
21,014 | qos-ch/slf4j | slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java | SimpleLogger.warn | public void warn(String format, Object arg) {
formatAndLog(LOG_LEVEL_WARN, format, arg, null);
} | java | public void warn(String format, Object arg) {
formatAndLog(LOG_LEVEL_WARN, format, arg, null);
} | [
"public",
"void",
"warn",
"(",
"String",
"format",
",",
"Object",
"arg",
")",
"{",
"formatAndLog",
"(",
"LOG_LEVEL_WARN",
",",
"format",
",",
"arg",
",",
"null",
")",
";",
"}"
] | Perform single parameter substitution before logging the message of level
WARN according to the format outlined above. | [
"Perform",
"single",
"parameter",
"substitution",
"before",
"logging",
"the",
"message",
"of",
"level",
"WARN",
"according",
"to",
"the",
"format",
"outlined",
"above",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java#L529-L531 |
21,015 | qos-ch/slf4j | slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java | SimpleLogger.warn | public void warn(String format, Object arg1, Object arg2) {
formatAndLog(LOG_LEVEL_WARN, format, arg1, arg2);
} | java | public void warn(String format, Object arg1, Object arg2) {
formatAndLog(LOG_LEVEL_WARN, format, arg1, arg2);
} | [
"public",
"void",
"warn",
"(",
"String",
"format",
",",
"Object",
"arg1",
",",
"Object",
"arg2",
")",
"{",
"formatAndLog",
"(",
"LOG_LEVEL_WARN",
",",
"format",
",",
"arg1",
",",
"arg2",
")",
";",
"}"
] | Perform double parameter substitution before logging the message of level
WARN according to the format outlined above. | [
"Perform",
"double",
"parameter",
"substitution",
"before",
"logging",
"the",
"message",
"of",
"level",
"WARN",
"according",
"to",
"the",
"format",
"outlined",
"above",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java#L537-L539 |
21,016 | qos-ch/slf4j | slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java | SimpleLogger.error | public void error(String format, Object arg) {
formatAndLog(LOG_LEVEL_ERROR, format, arg, null);
} | java | public void error(String format, Object arg) {
formatAndLog(LOG_LEVEL_ERROR, format, arg, null);
} | [
"public",
"void",
"error",
"(",
"String",
"format",
",",
"Object",
"arg",
")",
"{",
"formatAndLog",
"(",
"LOG_LEVEL_ERROR",
",",
"format",
",",
"arg",
",",
"null",
")",
";",
"}"
] | Perform single parameter substitution before logging the message of level
ERROR according to the format outlined above. | [
"Perform",
"single",
"parameter",
"substitution",
"before",
"logging",
"the",
"message",
"of",
"level",
"ERROR",
"according",
"to",
"the",
"format",
"outlined",
"above",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java#L571-L573 |
21,017 | qos-ch/slf4j | slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java | SimpleLogger.error | public void error(String format, Object arg1, Object arg2) {
formatAndLog(LOG_LEVEL_ERROR, format, arg1, arg2);
} | java | public void error(String format, Object arg1, Object arg2) {
formatAndLog(LOG_LEVEL_ERROR, format, arg1, arg2);
} | [
"public",
"void",
"error",
"(",
"String",
"format",
",",
"Object",
"arg1",
",",
"Object",
"arg2",
")",
"{",
"formatAndLog",
"(",
"LOG_LEVEL_ERROR",
",",
"format",
",",
"arg1",
",",
"arg2",
")",
";",
"}"
] | Perform double parameter substitution before logging the message of level
ERROR according to the format outlined above. | [
"Perform",
"double",
"parameter",
"substitution",
"before",
"logging",
"the",
"message",
"of",
"level",
"ERROR",
"according",
"to",
"the",
"format",
"outlined",
"above",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java#L579-L581 |
21,018 | qos-ch/slf4j | jul-to-slf4j/src/main/java/org/slf4j/bridge/SLF4JBridgeHandler.java | SLF4JBridgeHandler.isInstalled | public static boolean isInstalled() throws SecurityException {
java.util.logging.Logger rootLogger = getRootLogger();
Handler[] handlers = rootLogger.getHandlers();
for (int i = 0; i < handlers.length; i++) {
if (handlers[i] instanceof SLF4JBridgeHandler) {
return tru... | java | public static boolean isInstalled() throws SecurityException {
java.util.logging.Logger rootLogger = getRootLogger();
Handler[] handlers = rootLogger.getHandlers();
for (int i = 0; i < handlers.length; i++) {
if (handlers[i] instanceof SLF4JBridgeHandler) {
return tru... | [
"public",
"static",
"boolean",
"isInstalled",
"(",
")",
"throws",
"SecurityException",
"{",
"java",
".",
"util",
".",
"logging",
".",
"Logger",
"rootLogger",
"=",
"getRootLogger",
"(",
")",
";",
"Handler",
"[",
"]",
"handlers",
"=",
"rootLogger",
".",
"getHa... | Returns true if SLF4JBridgeHandler has been previously installed, returns false otherwise.
@return true if SLF4JBridgeHandler is already installed, false other wise
@throws SecurityException | [
"Returns",
"true",
"if",
"SLF4JBridgeHandler",
"has",
"been",
"previously",
"installed",
"returns",
"false",
"otherwise",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/jul-to-slf4j/src/main/java/org/slf4j/bridge/SLF4JBridgeHandler.java#L160-L169 |
21,019 | qos-ch/slf4j | jul-to-slf4j/src/main/java/org/slf4j/bridge/SLF4JBridgeHandler.java | SLF4JBridgeHandler.getSLF4JLogger | protected Logger getSLF4JLogger(LogRecord record) {
String name = record.getLoggerName();
if (name == null) {
name = UNKNOWN_LOGGER_NAME;
}
return LoggerFactory.getLogger(name);
} | java | protected Logger getSLF4JLogger(LogRecord record) {
String name = record.getLoggerName();
if (name == null) {
name = UNKNOWN_LOGGER_NAME;
}
return LoggerFactory.getLogger(name);
} | [
"protected",
"Logger",
"getSLF4JLogger",
"(",
"LogRecord",
"record",
")",
"{",
"String",
"name",
"=",
"record",
".",
"getLoggerName",
"(",
")",
";",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"name",
"=",
"UNKNOWN_LOGGER_NAME",
";",
"}",
"return",
"LoggerF... | Return the Logger instance that will be used for logging. | [
"Return",
"the",
"Logger",
"instance",
"that",
"will",
"be",
"used",
"for",
"logging",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/jul-to-slf4j/src/main/java/org/slf4j/bridge/SLF4JBridgeHandler.java#L206-L212 |
21,020 | qos-ch/slf4j | jul-to-slf4j/src/main/java/org/slf4j/bridge/SLF4JBridgeHandler.java | SLF4JBridgeHandler.getMessageI18N | private String getMessageI18N(LogRecord record) {
String message = record.getMessage();
if (message == null) {
return null;
}
ResourceBundle bundle = record.getResourceBundle();
if (bundle != null) {
try {
message = bundle.getString(messa... | java | private String getMessageI18N(LogRecord record) {
String message = record.getMessage();
if (message == null) {
return null;
}
ResourceBundle bundle = record.getResourceBundle();
if (bundle != null) {
try {
message = bundle.getString(messa... | [
"private",
"String",
"getMessageI18N",
"(",
"LogRecord",
"record",
")",
"{",
"String",
"message",
"=",
"record",
".",
"getMessage",
"(",
")",
";",
"if",
"(",
"message",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"ResourceBundle",
"bundle",
"=",
... | Get the record's message, possibly via a resource bundle.
@param record
@return | [
"Get",
"the",
"record",
"s",
"message",
"possibly",
"via",
"a",
"resource",
"bundle",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/jul-to-slf4j/src/main/java/org/slf4j/bridge/SLF4JBridgeHandler.java#L255-L282 |
21,021 | qos-ch/slf4j | slf4j-ext/src/main/java/org/slf4j/agent/AgentPremain.java | AgentPremain.printStartStopTimes | private static void printStartStopTimes() {
final long start = System.currentTimeMillis();
System.err.println("Start at " + new Date());
Thread hook = new Thread() {
@Override
public void run() {
long timePassed = System.currentTimeMillis() - start;
... | java | private static void printStartStopTimes() {
final long start = System.currentTimeMillis();
System.err.println("Start at " + new Date());
Thread hook = new Thread() {
@Override
public void run() {
long timePassed = System.currentTimeMillis() - start;
... | [
"private",
"static",
"void",
"printStartStopTimes",
"(",
")",
"{",
"final",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"System",
".",
"err",
".",
"println",
"(",
"\"Start at \"",
"+",
"new",
"Date",
"(",
")",
")",
";",
"Thre... | Print the start message to System.err with the time NOW, and register a
shutdown hook which will print the stop message to System.err with the
time then and the number of milliseconds passed since. | [
"Print",
"the",
"start",
"message",
"to",
"System",
".",
"err",
"with",
"the",
"time",
"NOW",
"and",
"register",
"a",
"shutdown",
"hook",
"which",
"will",
"print",
"the",
"stop",
"message",
"to",
"System",
".",
"err",
"with",
"the",
"time",
"then",
"and"... | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-ext/src/main/java/org/slf4j/agent/AgentPremain.java#L112-L125 |
21,022 | qos-ch/slf4j | log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java | Category.isEnabledFor | public boolean isEnabledFor(Priority p) {
switch (p.level) {
case Level.TRACE_INT:
return slf4jLogger.isTraceEnabled();
case Level.DEBUG_INT:
return slf4jLogger.isDebugEnabled();
case Level.INFO_INT:
return slf4jLogger.isInfoEnabled();
case Lev... | java | public boolean isEnabledFor(Priority p) {
switch (p.level) {
case Level.TRACE_INT:
return slf4jLogger.isTraceEnabled();
case Level.DEBUG_INT:
return slf4jLogger.isDebugEnabled();
case Level.INFO_INT:
return slf4jLogger.isInfoEnabled();
case Lev... | [
"public",
"boolean",
"isEnabledFor",
"(",
"Priority",
"p",
")",
"{",
"switch",
"(",
"p",
".",
"level",
")",
"{",
"case",
"Level",
".",
"TRACE_INT",
":",
"return",
"slf4jLogger",
".",
"isTraceEnabled",
"(",
")",
";",
"case",
"Level",
".",
"DEBUG_INT",
":"... | Determines whether the priority passed as parameter is enabled in the
underlying SLF4J logger. Each log4j priority is mapped directly to its
SLF4J equivalent, except for FATAL which is mapped as ERROR.
@param p
the priority to check against
@return true if this logger is enabled for the given level, false
otherwise. | [
"Determines",
"whether",
"the",
"priority",
"passed",
"as",
"parameter",
"is",
"enabled",
"in",
"the",
"underlying",
"SLF4J",
"logger",
".",
"Each",
"log4j",
"priority",
"is",
"mapped",
"directly",
"to",
"its",
"SLF4J",
"equivalent",
"except",
"for",
"FATAL",
... | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java#L171-L187 |
21,023 | qos-ch/slf4j | slf4j-migrator/src/main/java/org/slf4j/migrator/ProjectConverter.java | ProjectConverter.scanFileList | private void scanFileList(List<File> lstFiles) {
progressListener.onFileScanBegin();
Iterator<File> itFile = lstFiles.iterator();
while (itFile.hasNext()) {
File currentFile = itFile.next();
progressListener.onFileScan(currentFile);
scanFile(currentFile);
... | java | private void scanFileList(List<File> lstFiles) {
progressListener.onFileScanBegin();
Iterator<File> itFile = lstFiles.iterator();
while (itFile.hasNext()) {
File currentFile = itFile.next();
progressListener.onFileScan(currentFile);
scanFile(currentFile);
... | [
"private",
"void",
"scanFileList",
"(",
"List",
"<",
"File",
">",
"lstFiles",
")",
"{",
"progressListener",
".",
"onFileScanBegin",
"(",
")",
";",
"Iterator",
"<",
"File",
">",
"itFile",
"=",
"lstFiles",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"itF... | Convert a list of files
@param lstFiles | [
"Convert",
"a",
"list",
"of",
"files"
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-migrator/src/main/java/org/slf4j/migrator/ProjectConverter.java#L84-L92 |
21,024 | qos-ch/slf4j | slf4j-migrator/src/main/java/org/slf4j/migrator/ProjectConverter.java | ProjectConverter.scanFile | private void scanFile(File file) {
try {
InplaceFileConverter fc = new InplaceFileConverter(ruleSet, progressListener);
fc.convert(file);
} catch (IOException exc) {
addException(new ConversionException(exc.toString()));
}
} | java | private void scanFile(File file) {
try {
InplaceFileConverter fc = new InplaceFileConverter(ruleSet, progressListener);
fc.convert(file);
} catch (IOException exc) {
addException(new ConversionException(exc.toString()));
}
} | [
"private",
"void",
"scanFile",
"(",
"File",
"file",
")",
"{",
"try",
"{",
"InplaceFileConverter",
"fc",
"=",
"new",
"InplaceFileConverter",
"(",
"ruleSet",
",",
"progressListener",
")",
";",
"fc",
".",
"convert",
"(",
"file",
")",
";",
"}",
"catch",
"(",
... | Convert the specified file Read each line and ask matcher implementation
for conversion Rewrite the line returned by matcher
@param file | [
"Convert",
"the",
"specified",
"file",
"Read",
"each",
"line",
"and",
"ask",
"matcher",
"implementation",
"for",
"conversion",
"Rewrite",
"the",
"line",
"returned",
"by",
"matcher"
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-migrator/src/main/java/org/slf4j/migrator/ProjectConverter.java#L100-L107 |
21,025 | qos-ch/slf4j | slf4j-jdk14/src/main/java/org/slf4j/jul/JDK14LoggerAdapter.java | JDK14LoggerAdapter.trace | public void trace(String msg) {
if (logger.isLoggable(Level.FINEST)) {
log(SELF, Level.FINEST, msg, null);
}
} | java | public void trace(String msg) {
if (logger.isLoggable(Level.FINEST)) {
log(SELF, Level.FINEST, msg, null);
}
} | [
"public",
"void",
"trace",
"(",
"String",
"msg",
")",
"{",
"if",
"(",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINEST",
")",
")",
"{",
"log",
"(",
"SELF",
",",
"Level",
".",
"FINEST",
",",
"msg",
",",
"null",
")",
";",
"}",
"}"
] | Log a message object at level FINEST.
@param msg
- the message object to be logged | [
"Log",
"a",
"message",
"object",
"at",
"level",
"FINEST",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-jdk14/src/main/java/org/slf4j/jul/JDK14LoggerAdapter.java#L77-L81 |
21,026 | qos-ch/slf4j | slf4j-jdk14/src/main/java/org/slf4j/jul/JDK14LoggerAdapter.java | JDK14LoggerAdapter.info | public void info(String msg) {
if (logger.isLoggable(Level.INFO)) {
log(SELF, Level.INFO, msg, null);
}
} | java | public void info(String msg) {
if (logger.isLoggable(Level.INFO)) {
log(SELF, Level.INFO, msg, null);
}
} | [
"public",
"void",
"info",
"(",
"String",
"msg",
")",
"{",
"if",
"(",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"INFO",
")",
")",
"{",
"log",
"(",
"SELF",
",",
"Level",
".",
"INFO",
",",
"msg",
",",
"null",
")",
";",
"}",
"}"
] | Log a message object at the INFO level.
@param msg
- the message object to be logged | [
"Log",
"a",
"message",
"object",
"at",
"the",
"INFO",
"level",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-jdk14/src/main/java/org/slf4j/jul/JDK14LoggerAdapter.java#L276-L280 |
21,027 | qos-ch/slf4j | slf4j-jdk14/src/main/java/org/slf4j/jul/JDK14LoggerAdapter.java | JDK14LoggerAdapter.warn | public void warn(String msg) {
if (logger.isLoggable(Level.WARNING)) {
log(SELF, Level.WARNING, msg, null);
}
} | java | public void warn(String msg) {
if (logger.isLoggable(Level.WARNING)) {
log(SELF, Level.WARNING, msg, null);
}
} | [
"public",
"void",
"warn",
"(",
"String",
"msg",
")",
"{",
"if",
"(",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"WARNING",
")",
")",
"{",
"log",
"(",
"SELF",
",",
"Level",
".",
"WARNING",
",",
"msg",
",",
"null",
")",
";",
"}",
"}"
] | Log a message object at the WARNING level.
@param msg
- the message object to be logged | [
"Log",
"a",
"message",
"object",
"at",
"the",
"WARNING",
"level",
"."
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-jdk14/src/main/java/org/slf4j/jul/JDK14LoggerAdapter.java#L377-L381 |
21,028 | jamesdbloom/mockserver | mockserver-client-java/src/main/java/org/mockserver/client/MockServerClient.java | MockServerClient.isRunning | public boolean isRunning(int attempts, long timeout, TimeUnit timeUnit) {
try {
HttpResponse httpResponse = sendRequest(request().withMethod("PUT").withPath(calculatePath("status")));
if (httpResponse.getStatusCode() == HttpStatusCode.OK_200.code()) {
return true;
... | java | public boolean isRunning(int attempts, long timeout, TimeUnit timeUnit) {
try {
HttpResponse httpResponse = sendRequest(request().withMethod("PUT").withPath(calculatePath("status")));
if (httpResponse.getStatusCode() == HttpStatusCode.OK_200.code()) {
return true;
... | [
"public",
"boolean",
"isRunning",
"(",
"int",
"attempts",
",",
"long",
"timeout",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"try",
"{",
"HttpResponse",
"httpResponse",
"=",
"sendRequest",
"(",
"request",
"(",
")",
".",
"withMethod",
"(",
"\"PUT\"",
")",
".",
... | Returns whether server MockServer is running, by polling the MockServer a configurable amount of times | [
"Returns",
"whether",
"server",
"MockServer",
"is",
"running",
"by",
"polling",
"the",
"MockServer",
"a",
"configurable",
"amount",
"of",
"times"
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-client-java/src/main/java/org/mockserver/client/MockServerClient.java#L198-L216 |
21,029 | jamesdbloom/mockserver | mockserver-client-java/src/main/java/org/mockserver/client/MockServerClient.java | MockServerClient.bind | public List<Integer> bind(Integer... ports) {
String boundPorts = sendRequest(request().withMethod("PUT").withPath(calculatePath("bind")).withBody(portBindingSerializer.serialize(portBinding(ports)), StandardCharsets.UTF_8)).getBodyAsString();
return portBindingSerializer.deserialize(boundPorts).getPort... | java | public List<Integer> bind(Integer... ports) {
String boundPorts = sendRequest(request().withMethod("PUT").withPath(calculatePath("bind")).withBody(portBindingSerializer.serialize(portBinding(ports)), StandardCharsets.UTF_8)).getBodyAsString();
return portBindingSerializer.deserialize(boundPorts).getPort... | [
"public",
"List",
"<",
"Integer",
">",
"bind",
"(",
"Integer",
"...",
"ports",
")",
"{",
"String",
"boundPorts",
"=",
"sendRequest",
"(",
"request",
"(",
")",
".",
"withMethod",
"(",
"\"PUT\"",
")",
".",
"withPath",
"(",
"calculatePath",
"(",
"\"bind\"",
... | Bind new ports to listen on | [
"Bind",
"new",
"ports",
"to",
"listen",
"on"
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-client-java/src/main/java/org/mockserver/client/MockServerClient.java#L221-L224 |
21,030 | jamesdbloom/mockserver | mockserver-client-java/src/main/java/org/mockserver/client/MockServerClient.java | MockServerClient.reset | public MockServerClient reset() {
MockServerEventBus.getInstance().publish(EventType.RESET);
sendRequest(request().withMethod("PUT").withPath(calculatePath("reset")));
return clientClass.cast(this);
} | java | public MockServerClient reset() {
MockServerEventBus.getInstance().publish(EventType.RESET);
sendRequest(request().withMethod("PUT").withPath(calculatePath("reset")));
return clientClass.cast(this);
} | [
"public",
"MockServerClient",
"reset",
"(",
")",
"{",
"MockServerEventBus",
".",
"getInstance",
"(",
")",
".",
"publish",
"(",
"EventType",
".",
"RESET",
")",
";",
"sendRequest",
"(",
"request",
"(",
")",
".",
"withMethod",
"(",
"\"PUT\"",
")",
".",
"withP... | Reset MockServer by clearing all expectations | [
"Reset",
"MockServer",
"by",
"clearing",
"all",
"expectations"
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-client-java/src/main/java/org/mockserver/client/MockServerClient.java#L266-L270 |
21,031 | jamesdbloom/mockserver | mockserver-client-java/src/main/java/org/mockserver/client/MockServerClient.java | MockServerClient.clear | public MockServerClient clear(HttpRequest httpRequest) {
sendRequest(request().withMethod("PUT").withPath(calculatePath("clear")).withBody(httpRequest != null ? httpRequestSerializer.serialize(httpRequest) : "", StandardCharsets.UTF_8));
return clientClass.cast(this);
} | java | public MockServerClient clear(HttpRequest httpRequest) {
sendRequest(request().withMethod("PUT").withPath(calculatePath("clear")).withBody(httpRequest != null ? httpRequestSerializer.serialize(httpRequest) : "", StandardCharsets.UTF_8));
return clientClass.cast(this);
} | [
"public",
"MockServerClient",
"clear",
"(",
"HttpRequest",
"httpRequest",
")",
"{",
"sendRequest",
"(",
"request",
"(",
")",
".",
"withMethod",
"(",
"\"PUT\"",
")",
".",
"withPath",
"(",
"calculatePath",
"(",
"\"clear\"",
")",
")",
".",
"withBody",
"(",
"htt... | Clear all expectations and logs that match the http
@param httpRequest the http request that is matched against when deciding whether to clear each expectation if null all expectations are cleared | [
"Clear",
"all",
"expectations",
"and",
"logs",
"that",
"match",
"the",
"http"
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-client-java/src/main/java/org/mockserver/client/MockServerClient.java#L277-L280 |
21,032 | jamesdbloom/mockserver | mockserver-client-java/src/main/java/org/mockserver/client/MockServerClient.java | MockServerClient.clear | public MockServerClient clear(HttpRequest httpRequest, ClearType type) {
sendRequest(request().withMethod("PUT").withPath(calculatePath("clear")).withQueryStringParameter("type", type.name().toLowerCase()).withBody(httpRequest != null ? httpRequestSerializer.serialize(httpRequest) : "", StandardCharsets.UTF_8))... | java | public MockServerClient clear(HttpRequest httpRequest, ClearType type) {
sendRequest(request().withMethod("PUT").withPath(calculatePath("clear")).withQueryStringParameter("type", type.name().toLowerCase()).withBody(httpRequest != null ? httpRequestSerializer.serialize(httpRequest) : "", StandardCharsets.UTF_8))... | [
"public",
"MockServerClient",
"clear",
"(",
"HttpRequest",
"httpRequest",
",",
"ClearType",
"type",
")",
"{",
"sendRequest",
"(",
"request",
"(",
")",
".",
"withMethod",
"(",
"\"PUT\"",
")",
".",
"withPath",
"(",
"calculatePath",
"(",
"\"clear\"",
")",
")",
... | Clear expectations, logs or both that match the http
@param httpRequest the http request that is matched against when deciding whether to clear each expectation if null all expectations are cleared
@param type the type to clear, EXPECTATION, LOG or BOTH | [
"Clear",
"expectations",
"logs",
"or",
"both",
"that",
"match",
"the",
"http"
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-client-java/src/main/java/org/mockserver/client/MockServerClient.java#L288-L291 |
21,033 | jamesdbloom/mockserver | mockserver-client-java/src/main/java/org/mockserver/client/MockServerClient.java | MockServerClient.verifyZeroInteractions | public MockServerClient verifyZeroInteractions() throws AssertionError {
Verification verification = verification().withRequest(request()).withTimes(exactly(0));
String result = sendRequest(request().withMethod("PUT").withPath(calculatePath("verify")).withBody(verificationSerializer.serialize(verificati... | java | public MockServerClient verifyZeroInteractions() throws AssertionError {
Verification verification = verification().withRequest(request()).withTimes(exactly(0));
String result = sendRequest(request().withMethod("PUT").withPath(calculatePath("verify")).withBody(verificationSerializer.serialize(verificati... | [
"public",
"MockServerClient",
"verifyZeroInteractions",
"(",
")",
"throws",
"AssertionError",
"{",
"Verification",
"verification",
"=",
"verification",
"(",
")",
".",
"withRequest",
"(",
"request",
"(",
")",
")",
".",
"withTimes",
"(",
"exactly",
"(",
"0",
")",
... | Verify no requests have been have been sent.
@throws AssertionError if any request has been found | [
"Verify",
"no",
"requests",
"have",
"been",
"have",
"been",
"sent",
"."
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-client-java/src/main/java/org/mockserver/client/MockServerClient.java#L367-L375 |
21,034 | jamesdbloom/mockserver | mockserver-client-java/src/main/java/org/mockserver/client/MockServerClient.java | MockServerClient.retrieveRecordedExpectations | public Expectation[] retrieveRecordedExpectations(HttpRequest httpRequest) {
String recordedExpectations = retrieveRecordedExpectations(httpRequest, Format.JSON);
if (!Strings.isNullOrEmpty(recordedExpectations) && !recordedExpectations.equals("[]")) {
return expectationSerializer.deserializ... | java | public Expectation[] retrieveRecordedExpectations(HttpRequest httpRequest) {
String recordedExpectations = retrieveRecordedExpectations(httpRequest, Format.JSON);
if (!Strings.isNullOrEmpty(recordedExpectations) && !recordedExpectations.equals("[]")) {
return expectationSerializer.deserializ... | [
"public",
"Expectation",
"[",
"]",
"retrieveRecordedExpectations",
"(",
"HttpRequest",
"httpRequest",
")",
"{",
"String",
"recordedExpectations",
"=",
"retrieveRecordedExpectations",
"(",
"httpRequest",
",",
"Format",
".",
"JSON",
")",
";",
"if",
"(",
"!",
"Strings"... | Retrieve the request-response combinations that have been recorded as a list of expectations, only those that match the httpRequest parameter are returned, use null to retrieve all requests
@param httpRequest the http request that is matched against when deciding whether to return each request, use null for the parame... | [
"Retrieve",
"the",
"request",
"-",
"response",
"combinations",
"that",
"have",
"been",
"recorded",
"as",
"a",
"list",
"of",
"expectations",
"only",
"those",
"that",
"match",
"the",
"httpRequest",
"parameter",
"are",
"returned",
"use",
"null",
"to",
"retrieve",
... | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-client-java/src/main/java/org/mockserver/client/MockServerClient.java#L417-L424 |
21,035 | jamesdbloom/mockserver | mockserver-client-java/src/main/java/org/mockserver/client/MockServerClient.java | MockServerClient.retrieveLogMessages | public String retrieveLogMessages(HttpRequest httpRequest) {
HttpResponse httpResponse = sendRequest(
request()
.withMethod("PUT")
.withPath(calculatePath("retrieve"))
.withQueryStringParameter("type", RetrieveType.LOGS.name())
.withBod... | java | public String retrieveLogMessages(HttpRequest httpRequest) {
HttpResponse httpResponse = sendRequest(
request()
.withMethod("PUT")
.withPath(calculatePath("retrieve"))
.withQueryStringParameter("type", RetrieveType.LOGS.name())
.withBod... | [
"public",
"String",
"retrieveLogMessages",
"(",
"HttpRequest",
"httpRequest",
")",
"{",
"HttpResponse",
"httpResponse",
"=",
"sendRequest",
"(",
"request",
"(",
")",
".",
"withMethod",
"(",
"\"PUT\"",
")",
".",
"withPath",
"(",
"calculatePath",
"(",
"\"retrieve\""... | Retrieve the logs associated to a specific requests, this shows all logs for expectation matching, verification, clearing, etc
@param httpRequest the http request that is matched against when deciding whether to return each request, use null for the parameter to retrieve for all requests
@return all log messages recor... | [
"Retrieve",
"the",
"logs",
"associated",
"to",
"a",
"specific",
"requests",
"this",
"shows",
"all",
"logs",
"for",
"expectation",
"matching",
"verification",
"clearing",
"etc"
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-client-java/src/main/java/org/mockserver/client/MockServerClient.java#L451-L460 |
21,036 | jamesdbloom/mockserver | mockserver-client-java/src/main/java/org/mockserver/client/MockServerClient.java | MockServerClient.retrieveActiveExpectations | public Expectation[] retrieveActiveExpectations(HttpRequest httpRequest) {
String activeExpectations = retrieveActiveExpectations(httpRequest, Format.JSON);
if (!Strings.isNullOrEmpty(activeExpectations) && !activeExpectations.equals("[]")) {
return expectationSerializer.deserializeArray(act... | java | public Expectation[] retrieveActiveExpectations(HttpRequest httpRequest) {
String activeExpectations = retrieveActiveExpectations(httpRequest, Format.JSON);
if (!Strings.isNullOrEmpty(activeExpectations) && !activeExpectations.equals("[]")) {
return expectationSerializer.deserializeArray(act... | [
"public",
"Expectation",
"[",
"]",
"retrieveActiveExpectations",
"(",
"HttpRequest",
"httpRequest",
")",
"{",
"String",
"activeExpectations",
"=",
"retrieveActiveExpectations",
"(",
"httpRequest",
",",
"Format",
".",
"JSON",
")",
";",
"if",
"(",
"!",
"Strings",
".... | Retrieve the active expectations match the httpRequest parameter, use null for the parameter to retrieve all expectations
@param httpRequest the http request that is matched against when deciding whether to return each expectation, use null for the parameter to retrieve for all requests
@return an array of all expecta... | [
"Retrieve",
"the",
"active",
"expectations",
"match",
"the",
"httpRequest",
"parameter",
"use",
"null",
"for",
"the",
"parameter",
"to",
"retrieve",
"all",
"expectations"
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-client-java/src/main/java/org/mockserver/client/MockServerClient.java#L563-L570 |
21,037 | jamesdbloom/mockserver | mockserver-netty/src/main/java/org/mockserver/cli/Main.java | Main.main | public static void main(String... arguments) {
try {
Map<String, String> parsedArguments = parseArguments(arguments);
MOCK_SERVER_LOGGER.debug(SERVER_CONFIGURATION, "Using command line options: {}", Joiner.on(", ").withKeyValueSeparator("=").join(parsedArguments));
if (pars... | java | public static void main(String... arguments) {
try {
Map<String, String> parsedArguments = parseArguments(arguments);
MOCK_SERVER_LOGGER.debug(SERVER_CONFIGURATION, "Using command line options: {}", Joiner.on(", ").withKeyValueSeparator("=").join(parsedArguments));
if (pars... | [
"public",
"static",
"void",
"main",
"(",
"String",
"...",
"arguments",
")",
"{",
"try",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"parsedArguments",
"=",
"parseArguments",
"(",
"arguments",
")",
";",
"MOCK_SERVER_LOGGER",
".",
"debug",
"(",
"SERVER_CONF... | Run the MockServer directly providing the arguments as specified below.
@param arguments the entries are in pairs:
- "-serverPort" followed by the mandatory server local port,
- "-proxyRemotePort" followed by the optional proxyRemotePort port that enabled port forwarding mode,
- "-proxyRemoteHost" followed by ... | [
"Run",
"the",
"MockServer",
"directly",
"providing",
"the",
"arguments",
"as",
"specified",
"below",
"."
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-netty/src/main/java/org/mockserver/cli/Main.java#L68-L94 |
21,038 | jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/socket/tls/KeyStoreFactory.java | KeyStoreFactory.saveCertificateAsKeyStore | private static KeyStore saveCertificateAsKeyStore(KeyStore existingKeyStore, boolean deleteOnExit, String keyStoreFileName, String certificationAlias, Key privateKey, char[] keyStorePassword, Certificate[] chain, X509Certificate caCert) {
try {
KeyStore keyStore = existingKeyStore;
if (k... | java | private static KeyStore saveCertificateAsKeyStore(KeyStore existingKeyStore, boolean deleteOnExit, String keyStoreFileName, String certificationAlias, Key privateKey, char[] keyStorePassword, Certificate[] chain, X509Certificate caCert) {
try {
KeyStore keyStore = existingKeyStore;
if (k... | [
"private",
"static",
"KeyStore",
"saveCertificateAsKeyStore",
"(",
"KeyStore",
"existingKeyStore",
",",
"boolean",
"deleteOnExit",
",",
"String",
"keyStoreFileName",
",",
"String",
"certificationAlias",
",",
"Key",
"privateKey",
",",
"char",
"[",
"]",
"keyStorePassword"... | Save X509Certificate in KeyStore file. | [
"Save",
"X509Certificate",
"in",
"KeyStore",
"file",
"."
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/socket/tls/KeyStoreFactory.java#L76-L114 |
21,039 | jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/model/HttpRequest.java | HttpRequest.withBody | public HttpRequest withBody(String body, Charset charset) {
if (body != null) {
this.body = new StringBody(body, charset);
}
return this;
} | java | public HttpRequest withBody(String body, Charset charset) {
if (body != null) {
this.body = new StringBody(body, charset);
}
return this;
} | [
"public",
"HttpRequest",
"withBody",
"(",
"String",
"body",
",",
"Charset",
"charset",
")",
"{",
"if",
"(",
"body",
"!=",
"null",
")",
"{",
"this",
".",
"body",
"=",
"new",
"StringBody",
"(",
"body",
",",
"charset",
")",
";",
"}",
"return",
"this",
"... | The exact string body to match on such as "this is an exact string body"
@param body the body on such as "this is an exact string body"
@param charset character set the string will be encoded in | [
"The",
"exact",
"string",
"body",
"to",
"match",
"on",
"such",
"as",
"this",
"is",
"an",
"exact",
"string",
"body"
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/model/HttpRequest.java#L249-L254 |
21,040 | jamesdbloom/mockserver | mockserver-netty/src/main/java/org/mockserver/exception/ExceptionHandler.java | ExceptionHandler.shouldNotIgnoreException | public static boolean shouldNotIgnoreException(Throwable cause) {
String message = String.valueOf(cause.getMessage()).toLowerCase();
// is ssl exception
if (cause.getCause() instanceof SSLException || cause instanceof DecoderException | cause instanceof NotSslRecordException) {
retu... | java | public static boolean shouldNotIgnoreException(Throwable cause) {
String message = String.valueOf(cause.getMessage()).toLowerCase();
// is ssl exception
if (cause.getCause() instanceof SSLException || cause instanceof DecoderException | cause instanceof NotSslRecordException) {
retu... | [
"public",
"static",
"boolean",
"shouldNotIgnoreException",
"(",
"Throwable",
"cause",
")",
"{",
"String",
"message",
"=",
"String",
".",
"valueOf",
"(",
"cause",
".",
"getMessage",
"(",
")",
")",
".",
"toLowerCase",
"(",
")",
";",
"// is ssl exception",
"if",
... | returns true is the exception was caused by the connection being closed | [
"returns",
"true",
"is",
"the",
"exception",
"was",
"caused",
"by",
"the",
"connection",
"being",
"closed"
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-netty/src/main/java/org/mockserver/exception/ExceptionHandler.java#L34-L91 |
21,041 | jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/configuration/ConfigurationProperties.java | ConfigurationProperties.logLevel | public static void logLevel(String level) {
if (!Arrays.asList("TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF").contains(level)) {
throw new IllegalArgumentException("log level \"" + level + "\" is not legal it must be one of \"TRACE\", \"DEBUG\", \"INFO\", \"WARN\", \"ERROR\", \"OFF\"");
}... | java | public static void logLevel(String level) {
if (!Arrays.asList("TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF").contains(level)) {
throw new IllegalArgumentException("log level \"" + level + "\" is not legal it must be one of \"TRACE\", \"DEBUG\", \"INFO\", \"WARN\", \"ERROR\", \"OFF\"");
}... | [
"public",
"static",
"void",
"logLevel",
"(",
"String",
"level",
")",
"{",
"if",
"(",
"!",
"Arrays",
".",
"asList",
"(",
"\"TRACE\"",
",",
"\"DEBUG\"",
",",
"\"INFO\"",
",",
"\"WARN\"",
",",
"\"ERROR\"",
",",
"\"OFF\"",
")",
".",
"contains",
"(",
"level",... | Override the default logging level of INFO
@param level the log level, which can be TRACE, DEBUG, INFO, WARN, ERROR, OFF | [
"Override",
"the",
"default",
"logging",
"level",
"of",
"INFO"
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/configuration/ConfigurationProperties.java#L286-L292 |
21,042 | jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/socket/tls/KeyAndCertificateFactory.java | KeyAndCertificateFactory.generateKeyPair | KeyPair generateKeyPair(int keySize) throws Exception {
KeyPairGenerator generator = KeyPairGenerator.getInstance(KEY_GENERATION_ALGORITHM, PROVIDER_NAME);
generator.initialize(keySize, new SecureRandom());
return generator.generateKeyPair();
} | java | KeyPair generateKeyPair(int keySize) throws Exception {
KeyPairGenerator generator = KeyPairGenerator.getInstance(KEY_GENERATION_ALGORITHM, PROVIDER_NAME);
generator.initialize(keySize, new SecureRandom());
return generator.generateKeyPair();
} | [
"KeyPair",
"generateKeyPair",
"(",
"int",
"keySize",
")",
"throws",
"Exception",
"{",
"KeyPairGenerator",
"generator",
"=",
"KeyPairGenerator",
".",
"getInstance",
"(",
"KEY_GENERATION_ALGORITHM",
",",
"PROVIDER_NAME",
")",
";",
"generator",
".",
"initialize",
"(",
... | Create a random 2048 bit RSA key pair with the given length | [
"Create",
"a",
"random",
"2048",
"bit",
"RSA",
"key",
"pair",
"with",
"the",
"given",
"length"
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/socket/tls/KeyAndCertificateFactory.java#L129-L133 |
21,043 | jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/socket/tls/KeyAndCertificateFactory.java | KeyAndCertificateFactory.createCACert | private X509Certificate createCACert(PublicKey publicKey, PrivateKey privateKey) throws Exception {
// signers name
X500Name issuerName = new X500Name("CN=www.mockserver.com, O=MockServer, L=London, ST=England, C=UK");
// subjects name - the same as we are self signed.
X500Name subject... | java | private X509Certificate createCACert(PublicKey publicKey, PrivateKey privateKey) throws Exception {
// signers name
X500Name issuerName = new X500Name("CN=www.mockserver.com, O=MockServer, L=London, ST=England, C=UK");
// subjects name - the same as we are self signed.
X500Name subject... | [
"private",
"X509Certificate",
"createCACert",
"(",
"PublicKey",
"publicKey",
",",
"PrivateKey",
"privateKey",
")",
"throws",
"Exception",
"{",
"// signers name",
"X500Name",
"issuerName",
"=",
"new",
"X500Name",
"(",
"\"CN=www.mockserver.com, O=MockServer, L=London, ST=Englan... | Create a certificate to use by a Certificate Authority, signed by a self signed certificate. | [
"Create",
"a",
"certificate",
"to",
"use",
"by",
"a",
"Certificate",
"Authority",
"signed",
"by",
"a",
"self",
"signed",
"certificate",
"."
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/socket/tls/KeyAndCertificateFactory.java#L138-L168 |
21,044 | jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/socket/tls/KeyAndCertificateFactory.java | KeyAndCertificateFactory.createCASignedCert | private X509Certificate createCASignedCert(PublicKey publicKey, X509Certificate certificateAuthorityCert, PrivateKey certificateAuthorityPrivateKey, PublicKey certificateAuthorityPublicKey, String domain, String[] subjectAlternativeNameDomains, String[] subjectAlternativeNameIps) throws Exception {
// signers ... | java | private X509Certificate createCASignedCert(PublicKey publicKey, X509Certificate certificateAuthorityCert, PrivateKey certificateAuthorityPrivateKey, PublicKey certificateAuthorityPublicKey, String domain, String[] subjectAlternativeNameDomains, String[] subjectAlternativeNameIps) throws Exception {
// signers ... | [
"private",
"X509Certificate",
"createCASignedCert",
"(",
"PublicKey",
"publicKey",
",",
"X509Certificate",
"certificateAuthorityCert",
",",
"PrivateKey",
"certificateAuthorityPrivateKey",
",",
"PublicKey",
"certificateAuthorityPublicKey",
",",
"String",
"domain",
",",
"String",... | Create a server certificate for the given domain and subject alternative names, signed by the given Certificate Authority. | [
"Create",
"a",
"server",
"certificate",
"for",
"the",
"given",
"domain",
"and",
"subject",
"alternative",
"names",
"signed",
"by",
"the",
"given",
"Certificate",
"Authority",
"."
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/socket/tls/KeyAndCertificateFactory.java#L173-L218 |
21,045 | jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/socket/tls/KeyAndCertificateFactory.java | KeyAndCertificateFactory.saveCertificateAsPEMFile | private String saveCertificateAsPEMFile(Object x509Certificate, String filename, boolean deleteOnExit) throws IOException {
File pemFile = File.createTempFile(filename, null);
try (FileWriter pemfileWriter = new FileWriter(pemFile)) {
try (JcaPEMWriter jcaPEMWriter = new JcaPEMWriter(pemfile... | java | private String saveCertificateAsPEMFile(Object x509Certificate, String filename, boolean deleteOnExit) throws IOException {
File pemFile = File.createTempFile(filename, null);
try (FileWriter pemfileWriter = new FileWriter(pemFile)) {
try (JcaPEMWriter jcaPEMWriter = new JcaPEMWriter(pemfile... | [
"private",
"String",
"saveCertificateAsPEMFile",
"(",
"Object",
"x509Certificate",
",",
"String",
"filename",
",",
"boolean",
"deleteOnExit",
")",
"throws",
"IOException",
"{",
"File",
"pemFile",
"=",
"File",
".",
"createTempFile",
"(",
"filename",
",",
"null",
")... | Saves X509Certificate as Base-64 encoded PEM file. | [
"Saves",
"X509Certificate",
"as",
"Base",
"-",
"64",
"encoded",
"PEM",
"file",
"."
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/socket/tls/KeyAndCertificateFactory.java#L272-L283 |
21,046 | jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/socket/tls/KeyAndCertificateFactory.java | KeyAndCertificateFactory.loadPrivateKeyFromPEMFile | private RSAPrivateKey loadPrivateKeyFromPEMFile(String filename) {
try {
String publicKeyFile = FileReader.readFileFromClassPathOrPath(filename);
byte[] publicKeyBytes = DatatypeConverter.parseBase64Binary(publicKeyFile.replace("-----BEGIN RSA PRIVATE KEY-----", "").replace("-----END RSA... | java | private RSAPrivateKey loadPrivateKeyFromPEMFile(String filename) {
try {
String publicKeyFile = FileReader.readFileFromClassPathOrPath(filename);
byte[] publicKeyBytes = DatatypeConverter.parseBase64Binary(publicKeyFile.replace("-----BEGIN RSA PRIVATE KEY-----", "").replace("-----END RSA... | [
"private",
"RSAPrivateKey",
"loadPrivateKeyFromPEMFile",
"(",
"String",
"filename",
")",
"{",
"try",
"{",
"String",
"publicKeyFile",
"=",
"FileReader",
".",
"readFileFromClassPathOrPath",
"(",
"filename",
")",
";",
"byte",
"[",
"]",
"publicKeyBytes",
"=",
"DatatypeC... | Load PrivateKey from PEM file. | [
"Load",
"PrivateKey",
"from",
"PEM",
"file",
"."
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/socket/tls/KeyAndCertificateFactory.java#L300-L308 |
21,047 | jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/socket/tls/KeyAndCertificateFactory.java | KeyAndCertificateFactory.loadX509FromPEMFile | private X509Certificate loadX509FromPEMFile(String filename) {
try {
return (X509Certificate) CertificateFactory.getInstance("X.509").generateCertificate(FileReader.openStreamToFileFromClassPathOrPath(filename));
} catch (Exception e) {
throw new RuntimeException("Exception readi... | java | private X509Certificate loadX509FromPEMFile(String filename) {
try {
return (X509Certificate) CertificateFactory.getInstance("X.509").generateCertificate(FileReader.openStreamToFileFromClassPathOrPath(filename));
} catch (Exception e) {
throw new RuntimeException("Exception readi... | [
"private",
"X509Certificate",
"loadX509FromPEMFile",
"(",
"String",
"filename",
")",
"{",
"try",
"{",
"return",
"(",
"X509Certificate",
")",
"CertificateFactory",
".",
"getInstance",
"(",
"\"X.509\"",
")",
".",
"generateCertificate",
"(",
"FileReader",
".",
"openStr... | Load X509 from PEM file. | [
"Load",
"X509",
"from",
"PEM",
"file",
"."
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/socket/tls/KeyAndCertificateFactory.java#L313-L319 |
21,048 | jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/model/HttpResponse.java | HttpResponse.response | public static HttpResponse response(String body) {
return new HttpResponse().withStatusCode(OK_200.code()).withReasonPhrase(OK_200.reasonPhrase()).withBody(body);
} | java | public static HttpResponse response(String body) {
return new HttpResponse().withStatusCode(OK_200.code()).withReasonPhrase(OK_200.reasonPhrase()).withBody(body);
} | [
"public",
"static",
"HttpResponse",
"response",
"(",
"String",
"body",
")",
"{",
"return",
"new",
"HttpResponse",
"(",
")",
".",
"withStatusCode",
"(",
"OK_200",
".",
"code",
"(",
")",
")",
".",
"withReasonPhrase",
"(",
"OK_200",
".",
"reasonPhrase",
"(",
... | Static builder to create a response with a 200 status code and the string response body.
@param body a string | [
"Static",
"builder",
"to",
"create",
"a",
"response",
"with",
"a",
"200",
"status",
"code",
"and",
"the",
"string",
"response",
"body",
"."
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/model/HttpResponse.java#L37-L39 |
21,049 | jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/model/HttpResponse.java | HttpResponse.replaceHeader | public HttpResponse replaceHeader(String name, String... values) {
this.headers.replaceEntry(name, values);
return this;
} | java | public HttpResponse replaceHeader(String name, String... values) {
this.headers.replaceEntry(name, values);
return this;
} | [
"public",
"HttpResponse",
"replaceHeader",
"(",
"String",
"name",
",",
"String",
"...",
"values",
")",
"{",
"this",
".",
"headers",
".",
"replaceEntry",
"(",
"name",
",",
"values",
")",
";",
"return",
"this",
";",
"}"
] | Update header to return as a Header object, if a header with
the same name already exists it will be modified
@param name the header name
@param values the header values | [
"Update",
"header",
"to",
"return",
"as",
"a",
"Header",
"object",
"if",
"a",
"header",
"with",
"the",
"same",
"name",
"already",
"exists",
"it",
"will",
"be",
"modified"
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/model/HttpResponse.java#L258-L261 |
21,050 | jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/model/HttpResponse.java | HttpResponse.withCookie | public HttpResponse withCookie(String name, String value) {
this.cookies.withEntry(name, value);
return this;
} | java | public HttpResponse withCookie(String name, String value) {
this.cookies.withEntry(name, value);
return this;
} | [
"public",
"HttpResponse",
"withCookie",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"this",
".",
"cookies",
".",
"withEntry",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Add cookie to return as Set-Cookie header
@param name the cookies name
@param value the cookies value | [
"Add",
"cookie",
"to",
"return",
"as",
"Set",
"-",
"Cookie",
"header"
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/model/HttpResponse.java#L351-L354 |
21,051 | jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/model/HttpTemplate.java | HttpTemplate.template | public static HttpTemplate template(TemplateType type, String template) {
return new HttpTemplate(type).withTemplate(template);
} | java | public static HttpTemplate template(TemplateType type, String template) {
return new HttpTemplate(type).withTemplate(template);
} | [
"public",
"static",
"HttpTemplate",
"template",
"(",
"TemplateType",
"type",
",",
"String",
"template",
")",
"{",
"return",
"new",
"HttpTemplate",
"(",
"type",
")",
".",
"withTemplate",
"(",
"template",
")",
";",
"}"
] | Static builder to create an template for responding or forwarding requests.
@param template the template for the response or request | [
"Static",
"builder",
"to",
"create",
"an",
"template",
"for",
"responding",
"or",
"forwarding",
"requests",
"."
] | 8b84fdd877e57b4eb780c9f8c8b1d65bcb448025 | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/model/HttpTemplate.java#L31-L33 |
21,052 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/weighting/AbstractWeighting.java | AbstractWeighting.weightingToFileName | public static String weightingToFileName(Weighting w, boolean edgeBased) {
return toLowerCase(w.toString()).replaceAll("\\|", "_") + (edgeBased ? "_edge" : "_node");
} | java | public static String weightingToFileName(Weighting w, boolean edgeBased) {
return toLowerCase(w.toString()).replaceAll("\\|", "_") + (edgeBased ? "_edge" : "_node");
} | [
"public",
"static",
"String",
"weightingToFileName",
"(",
"Weighting",
"w",
",",
"boolean",
"edgeBased",
")",
"{",
"return",
"toLowerCase",
"(",
"w",
".",
"toString",
"(",
")",
")",
".",
"replaceAll",
"(",
"\"\\\\|\"",
",",
"\"_\"",
")",
"+",
"(",
"edgeBas... | Replaces all characters which are not numbers, characters or underscores with underscores | [
"Replaces",
"all",
"characters",
"which",
"are",
"not",
"numbers",
"characters",
"or",
"underscores",
"with",
"underscores"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/weighting/AbstractWeighting.java#L101-L103 |
21,053 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/index/QueryResult.java | QueryResult.calcSnappedPoint | public void calcSnappedPoint(DistanceCalc distCalc) {
if (closestEdge == null)
throw new IllegalStateException("No closest edge?");
if (snappedPoint != null)
throw new IllegalStateException("Calculate snapped point only once");
PointList fullPL = getClosestEdge().fetchWa... | java | public void calcSnappedPoint(DistanceCalc distCalc) {
if (closestEdge == null)
throw new IllegalStateException("No closest edge?");
if (snappedPoint != null)
throw new IllegalStateException("Calculate snapped point only once");
PointList fullPL = getClosestEdge().fetchWa... | [
"public",
"void",
"calcSnappedPoint",
"(",
"DistanceCalc",
"distCalc",
")",
"{",
"if",
"(",
"closestEdge",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"No closest edge?\"",
")",
";",
"if",
"(",
"snappedPoint",
"!=",
"null",
")",
"throw",
... | Calculates the closet point on the edge from the query point. | [
"Calculates",
"the",
"closet",
"point",
"on",
"the",
"edge",
"from",
"the",
"query",
"point",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/index/QueryResult.java#L138-L162 |
21,054 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/QueryGraph.java | QueryGraph.lookup | public QueryGraph lookup(QueryResult fromRes, QueryResult toRes) {
List<QueryResult> results = new ArrayList<>(2);
results.add(fromRes);
results.add(toRes);
lookup(results);
return this;
} | java | public QueryGraph lookup(QueryResult fromRes, QueryResult toRes) {
List<QueryResult> results = new ArrayList<>(2);
results.add(fromRes);
results.add(toRes);
lookup(results);
return this;
} | [
"public",
"QueryGraph",
"lookup",
"(",
"QueryResult",
"fromRes",
",",
"QueryResult",
"toRes",
")",
"{",
"List",
"<",
"QueryResult",
">",
"results",
"=",
"new",
"ArrayList",
"<>",
"(",
"2",
")",
";",
"results",
".",
"add",
"(",
"fromRes",
")",
";",
"resul... | Convenient method to initialize this QueryGraph with the two specified query results.
@see #lookup(List) | [
"Convenient",
"method",
"to",
"initialize",
"this",
"QueryGraph",
"with",
"the",
"two",
"specified",
"query",
"results",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/QueryGraph.java#L189-L195 |
21,055 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/QueryGraph.java | QueryGraph.addVirtualEdges | private void addVirtualEdges(IntObjectMap<VirtualEdgeIterator> node2EdgeMap, EdgeFilter filter, boolean base,
int node, int virtNode) {
VirtualEdgeIterator existingIter = node2EdgeMap.get(node);
if (existingIter == null) {
existingIter = new VirtualEdgeIterat... | java | private void addVirtualEdges(IntObjectMap<VirtualEdgeIterator> node2EdgeMap, EdgeFilter filter, boolean base,
int node, int virtNode) {
VirtualEdgeIterator existingIter = node2EdgeMap.get(node);
if (existingIter == null) {
existingIter = new VirtualEdgeIterat... | [
"private",
"void",
"addVirtualEdges",
"(",
"IntObjectMap",
"<",
"VirtualEdgeIterator",
">",
"node2EdgeMap",
",",
"EdgeFilter",
"filter",
",",
"boolean",
"base",
",",
"int",
"node",
",",
"int",
"virtNode",
")",
"{",
"VirtualEdgeIterator",
"existingIter",
"=",
"node... | Creates a fake edge iterator pointing to multiple edge states. | [
"Creates",
"a",
"fake",
"edge",
"iterator",
"pointing",
"to",
"multiple",
"edge",
"states",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/QueryGraph.java#L674-L686 |
21,056 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/debatty/java/stringsimilarity/JaroWinkler.java | JaroWinkler.similarity | public final double similarity(final String s1, final String s2) {
int[] mtp = matches(s1, s2);
float m = mtp[0];
if (m == 0) {
return 0f;
}
double j = ((m / s1.length() + m / s2.length() + (m - mtp[1]) / m))
/ THREE;
double jw = j;
if... | java | public final double similarity(final String s1, final String s2) {
int[] mtp = matches(s1, s2);
float m = mtp[0];
if (m == 0) {
return 0f;
}
double j = ((m / s1.length() + m / s2.length() + (m - mtp[1]) / m))
/ THREE;
double jw = j;
if... | [
"public",
"final",
"double",
"similarity",
"(",
"final",
"String",
"s1",
",",
"final",
"String",
"s2",
")",
"{",
"int",
"[",
"]",
"mtp",
"=",
"matches",
"(",
"s1",
",",
"s2",
")",
";",
"float",
"m",
"=",
"mtp",
"[",
"0",
"]",
";",
"if",
"(",
"m... | Compute JW similarity. | [
"Compute",
"JW",
"similarity",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/debatty/java/stringsimilarity/JaroWinkler.java#L72-L86 |
21,057 | graphhopper/graphhopper | api/src/main/java/com/graphhopper/util/Instruction.java | Instruction.calcDirection | public String calcDirection(Instruction nextI) {
double azimuth = calcAzimuth(nextI);
if (Double.isNaN(azimuth))
return "";
return AC.azimuth2compassPoint(azimuth);
} | java | public String calcDirection(Instruction nextI) {
double azimuth = calcAzimuth(nextI);
if (Double.isNaN(azimuth))
return "";
return AC.azimuth2compassPoint(azimuth);
} | [
"public",
"String",
"calcDirection",
"(",
"Instruction",
"nextI",
")",
"{",
"double",
"azimuth",
"=",
"calcAzimuth",
"(",
"nextI",
")",
";",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"azimuth",
")",
")",
"return",
"\"\"",
";",
"return",
"AC",
".",
"azimuth... | Return the direction like 'NE' based on the first tracksegment of the instruction. If
Instruction does not contain enough coordinate points, an empty string will be returned. | [
"Return",
"the",
"direction",
"like",
"NE",
"based",
"on",
"the",
"first",
"tracksegment",
"of",
"the",
"instruction",
".",
"If",
"Instruction",
"does",
"not",
"contain",
"enough",
"coordinate",
"points",
"an",
"empty",
"string",
"will",
"be",
"returned",
"."
... | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/Instruction.java#L156-L162 |
21,058 | graphhopper/graphhopper | api/src/main/java/com/graphhopper/util/Instruction.java | Instruction.calcAzimuth | public double calcAzimuth(Instruction nextI) {
double nextLat;
double nextLon;
if (points.getSize() >= 2) {
nextLat = points.getLatitude(1);
nextLon = points.getLongitude(1);
} else if (nextI != null && points.getSize() == 1) {
nextLat = nextI.points.... | java | public double calcAzimuth(Instruction nextI) {
double nextLat;
double nextLon;
if (points.getSize() >= 2) {
nextLat = points.getLatitude(1);
nextLon = points.getLongitude(1);
} else if (nextI != null && points.getSize() == 1) {
nextLat = nextI.points.... | [
"public",
"double",
"calcAzimuth",
"(",
"Instruction",
"nextI",
")",
"{",
"double",
"nextLat",
";",
"double",
"nextLon",
";",
"if",
"(",
"points",
".",
"getSize",
"(",
")",
">=",
"2",
")",
"{",
"nextLat",
"=",
"points",
".",
"getLatitude",
"(",
"1",
")... | Return the azimuth in degree based on the first tracksegment of this instruction. If this
instruction contains less than 2 points then NaN will be returned or the specified
instruction will be used if that is the finish instruction. | [
"Return",
"the",
"azimuth",
"in",
"degree",
"based",
"on",
"the",
"first",
"tracksegment",
"of",
"this",
"instruction",
".",
"If",
"this",
"instruction",
"contains",
"less",
"than",
"2",
"points",
"then",
"NaN",
"will",
"be",
"returned",
"or",
"the",
"specif... | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/Instruction.java#L169-L186 |
21,059 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/PathBidirRef.java | PathBidirRef.extract | @Override
public Path extract() {
if (sptEntry == null || edgeTo == null)
return this;
if (sptEntry.adjNode != edgeTo.adjNode)
throw new IllegalStateException("Locations of the 'to'- and 'from'-Edge have to be the same. " + toString() + ", fromEntry:" + sptEntry + ", toEntry... | java | @Override
public Path extract() {
if (sptEntry == null || edgeTo == null)
return this;
if (sptEntry.adjNode != edgeTo.adjNode)
throw new IllegalStateException("Locations of the 'to'- and 'from'-Edge have to be the same. " + toString() + ", fromEntry:" + sptEntry + ", toEntry... | [
"@",
"Override",
"public",
"Path",
"extract",
"(",
")",
"{",
"if",
"(",
"sptEntry",
"==",
"null",
"||",
"edgeTo",
"==",
"null",
")",
"return",
"this",
";",
"if",
"(",
"sptEntry",
".",
"adjNode",
"!=",
"edgeTo",
".",
"adjNode",
")",
"throw",
"new",
"I... | Extracts path from two shortest-path-tree | [
"Extracts",
"path",
"from",
"two",
"shortest",
"-",
"path",
"-",
"tree"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/PathBidirRef.java#L58-L97 |
21,060 | graphhopper/graphhopper | reader-gtfs/src/main/java/com/conveyal/gtfs/GTFSFeed.java | GTFSFeed.loadFromFile | public void loadFromFile(ZipFile zip, String fid) throws IOException {
if (this.loaded) throw new UnsupportedOperationException("Attempt to load GTFS into existing database");
// NB we don't have a single CRC for the file, so we combine all the CRCs of the component files. NB we are not
// simp... | java | public void loadFromFile(ZipFile zip, String fid) throws IOException {
if (this.loaded) throw new UnsupportedOperationException("Attempt to load GTFS into existing database");
// NB we don't have a single CRC for the file, so we combine all the CRCs of the component files. NB we are not
// simp... | [
"public",
"void",
"loadFromFile",
"(",
"ZipFile",
"zip",
",",
"String",
"fid",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"loaded",
")",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"Attempt to load GTFS into existing database\"",
")",
";"... | The order in which we load the tables is important for two reasons.
1. We must load feed_info first so we know the feed ID before loading any other entities. This could be relaxed
by having entities point to the feed object rather than its ID String.
2. Referenced entities must be loaded before any entities that refere... | [
"The",
"order",
"in",
"which",
"we",
"load",
"the",
"tables",
"is",
"important",
"for",
"two",
"reasons",
".",
"1",
".",
"We",
"must",
"load",
"feed_info",
"first",
"so",
"we",
"know",
"the",
"feed",
"ID",
"before",
"loading",
"any",
"other",
"entities",... | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/reader-gtfs/src/main/java/com/conveyal/gtfs/GTFSFeed.java#L112-L172 |
21,061 | graphhopper/graphhopper | reader-gtfs/src/main/java/com/conveyal/gtfs/GTFSFeed.java | GTFSFeed.getOrderedStopTimesForTrip | public Iterable<StopTime> getOrderedStopTimesForTrip (String trip_id) {
Map<Fun.Tuple2, StopTime> tripStopTimes =
stop_times.subMap(
Fun.t2(trip_id, null),
Fun.t2(trip_id, Fun.HI)
);
return tripStopTimes.values();
} | java | public Iterable<StopTime> getOrderedStopTimesForTrip (String trip_id) {
Map<Fun.Tuple2, StopTime> tripStopTimes =
stop_times.subMap(
Fun.t2(trip_id, null),
Fun.t2(trip_id, Fun.HI)
);
return tripStopTimes.values();
} | [
"public",
"Iterable",
"<",
"StopTime",
">",
"getOrderedStopTimesForTrip",
"(",
"String",
"trip_id",
")",
"{",
"Map",
"<",
"Fun",
".",
"Tuple2",
",",
"StopTime",
">",
"tripStopTimes",
"=",
"stop_times",
".",
"subMap",
"(",
"Fun",
".",
"t2",
"(",
"trip_id",
... | For the given trip ID, fetch all the stop times in order of increasing stop_sequence.
This is an efficient iteration over a tree map. | [
"For",
"the",
"given",
"trip",
"ID",
"fetch",
"all",
"the",
"stop",
"times",
"in",
"order",
"of",
"increasing",
"stop_sequence",
".",
"This",
"is",
"an",
"efficient",
"iteration",
"over",
"a",
"tree",
"map",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/reader-gtfs/src/main/java/com/conveyal/gtfs/GTFSFeed.java#L193-L200 |
21,062 | graphhopper/graphhopper | reader-gtfs/src/main/java/com/conveyal/gtfs/GTFSFeed.java | GTFSFeed.getShape | public Shape getShape (String shape_id) {
Shape shape = new Shape(this, shape_id);
return shape.shape_dist_traveled.length > 0 ? shape : null;
} | java | public Shape getShape (String shape_id) {
Shape shape = new Shape(this, shape_id);
return shape.shape_dist_traveled.length > 0 ? shape : null;
} | [
"public",
"Shape",
"getShape",
"(",
"String",
"shape_id",
")",
"{",
"Shape",
"shape",
"=",
"new",
"Shape",
"(",
"this",
",",
"shape_id",
")",
";",
"return",
"shape",
".",
"shape_dist_traveled",
".",
"length",
">",
"0",
"?",
"shape",
":",
"null",
";",
"... | Get the shape for the given shape ID | [
"Get",
"the",
"shape",
"for",
"the",
"given",
"shape",
"ID"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/reader-gtfs/src/main/java/com/conveyal/gtfs/GTFSFeed.java#L203-L206 |
21,063 | graphhopper/graphhopper | reader-gtfs/src/main/java/com/conveyal/gtfs/GTFSFeed.java | GTFSFeed.getInterpolatedStopTimesForTrip | public Iterable<StopTime> getInterpolatedStopTimesForTrip (String trip_id) throws FirstAndLastStopsDoNotHaveTimes {
// clone stop times so as not to modify base GTFS structures
StopTime[] stopTimes = StreamSupport.stream(getOrderedStopTimesForTrip(trip_id).spliterator(), false)
.map(st -... | java | public Iterable<StopTime> getInterpolatedStopTimesForTrip (String trip_id) throws FirstAndLastStopsDoNotHaveTimes {
// clone stop times so as not to modify base GTFS structures
StopTime[] stopTimes = StreamSupport.stream(getOrderedStopTimesForTrip(trip_id).spliterator(), false)
.map(st -... | [
"public",
"Iterable",
"<",
"StopTime",
">",
"getInterpolatedStopTimesForTrip",
"(",
"String",
"trip_id",
")",
"throws",
"FirstAndLastStopsDoNotHaveTimes",
"{",
"// clone stop times so as not to modify base GTFS structures",
"StopTime",
"[",
"]",
"stopTimes",
"=",
"StreamSupport... | For the given trip ID, fetch all the stop times in order, and interpolate stop-to-stop travel times. | [
"For",
"the",
"given",
"trip",
"ID",
"fetch",
"all",
"the",
"stop",
"times",
"in",
"order",
"and",
"interpolate",
"stop",
"-",
"to",
"-",
"stop",
"travel",
"times",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/reader-gtfs/src/main/java/com/conveyal/gtfs/GTFSFeed.java#L211-L256 |
21,064 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/change/ChangeGraphHelper.java | ChangeGraphHelper.applyChanges | public long applyChanges(EncodingManager em, Collection<JsonFeature> features) {
if (em == null)
throw new NullPointerException("EncodingManager cannot be null to change existing graph");
long updates = 0;
for (JsonFeature jsonFeature : features) {
if (!jsonFeature.hasPr... | java | public long applyChanges(EncodingManager em, Collection<JsonFeature> features) {
if (em == null)
throw new NullPointerException("EncodingManager cannot be null to change existing graph");
long updates = 0;
for (JsonFeature jsonFeature : features) {
if (!jsonFeature.hasPr... | [
"public",
"long",
"applyChanges",
"(",
"EncodingManager",
"em",
",",
"Collection",
"<",
"JsonFeature",
">",
"features",
")",
"{",
"if",
"(",
"em",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"EncodingManager cannot be null to change existing grap... | This method applies changes to the graph, specified by the json features.
@return number of successfully applied edge changes | [
"This",
"method",
"applies",
"changes",
"to",
"the",
"graph",
"specified",
"by",
"the",
"json",
"features",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/change/ChangeGraphHelper.java#L68-L90 |
21,065 | graphhopper/graphhopper | api/src/main/java/com/graphhopper/util/shapes/BBox.java | BBox.createInverse | public static BBox createInverse(boolean elevation) {
if (elevation) {
return new BBox(Double.MAX_VALUE, -Double.MAX_VALUE, Double.MAX_VALUE, -Double.MAX_VALUE,
Double.MAX_VALUE, -Double.MAX_VALUE, true);
} else {
return new BBox(Double.MAX_VALUE, -Double.MAX_... | java | public static BBox createInverse(boolean elevation) {
if (elevation) {
return new BBox(Double.MAX_VALUE, -Double.MAX_VALUE, Double.MAX_VALUE, -Double.MAX_VALUE,
Double.MAX_VALUE, -Double.MAX_VALUE, true);
} else {
return new BBox(Double.MAX_VALUE, -Double.MAX_... | [
"public",
"static",
"BBox",
"createInverse",
"(",
"boolean",
"elevation",
")",
"{",
"if",
"(",
"elevation",
")",
"{",
"return",
"new",
"BBox",
"(",
"Double",
".",
"MAX_VALUE",
",",
"-",
"Double",
".",
"MAX_VALUE",
",",
"Double",
".",
"MAX_VALUE",
",",
"-... | Prefills BBox with minimum values so that it can increase. | [
"Prefills",
"BBox",
"with",
"minimum",
"values",
"so",
"that",
"it",
"can",
"increase",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/shapes/BBox.java#L74-L82 |
21,066 | graphhopper/graphhopper | api/src/main/java/com/graphhopper/util/shapes/BBox.java | BBox.calculateIntersection | public BBox calculateIntersection(BBox bBox) {
if (!this.intersects(bBox))
return null;
double minLon = Math.max(this.minLon, bBox.minLon);
double maxLon = Math.min(this.maxLon, bBox.maxLon);
double minLat = Math.max(this.minLat, bBox.minLat);
double maxLat = Math.mi... | java | public BBox calculateIntersection(BBox bBox) {
if (!this.intersects(bBox))
return null;
double minLon = Math.max(this.minLon, bBox.minLon);
double maxLon = Math.min(this.maxLon, bBox.maxLon);
double minLat = Math.max(this.minLat, bBox.minLat);
double maxLat = Math.mi... | [
"public",
"BBox",
"calculateIntersection",
"(",
"BBox",
"bBox",
")",
"{",
"if",
"(",
"!",
"this",
".",
"intersects",
"(",
"bBox",
")",
")",
"return",
"null",
";",
"double",
"minLon",
"=",
"Math",
".",
"max",
"(",
"this",
".",
"minLon",
",",
"bBox",
"... | Calculates the intersecting BBox between this and the specified BBox
@return the intersecting BBox or null if not intersecting | [
"Calculates",
"the",
"intersecting",
"BBox",
"between",
"this",
"and",
"the",
"specified",
"BBox"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/shapes/BBox.java#L125-L135 |
21,067 | graphhopper/graphhopper | api/src/main/java/com/graphhopper/util/shapes/BBox.java | BBox.parseTwoPoints | public static BBox parseTwoPoints(String objectAsString) {
String[] splittedObject = objectAsString.split(",");
if (splittedObject.length != 4)
throw new IllegalArgumentException("BBox should have 4 parts but was " + objectAsString);
double minLat = Double.parseDouble(splittedObjec... | java | public static BBox parseTwoPoints(String objectAsString) {
String[] splittedObject = objectAsString.split(",");
if (splittedObject.length != 4)
throw new IllegalArgumentException("BBox should have 4 parts but was " + objectAsString);
double minLat = Double.parseDouble(splittedObjec... | [
"public",
"static",
"BBox",
"parseTwoPoints",
"(",
"String",
"objectAsString",
")",
"{",
"String",
"[",
"]",
"splittedObject",
"=",
"objectAsString",
".",
"split",
"(",
"\",\"",
")",
";",
"if",
"(",
"splittedObject",
".",
"length",
"!=",
"4",
")",
"throw",
... | This method creates a BBox out of a string in format lat1,lon1,lat2,lon2 | [
"This",
"method",
"creates",
"a",
"BBox",
"out",
"of",
"a",
"string",
"in",
"format",
"lat1",
"lon1",
"lat2",
"lon2"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/shapes/BBox.java#L304-L329 |
21,068 | graphhopper/graphhopper | api/src/main/java/com/graphhopper/util/shapes/BBox.java | BBox.parseBBoxString | public static BBox parseBBoxString(String objectAsString) {
String[] splittedObject = objectAsString.split(",");
if (splittedObject.length != 4)
throw new IllegalArgumentException("BBox should have 4 parts but was " + objectAsString);
double minLon = Double.parseDouble(splittedObje... | java | public static BBox parseBBoxString(String objectAsString) {
String[] splittedObject = objectAsString.split(",");
if (splittedObject.length != 4)
throw new IllegalArgumentException("BBox should have 4 parts but was " + objectAsString);
double minLon = Double.parseDouble(splittedObje... | [
"public",
"static",
"BBox",
"parseBBoxString",
"(",
"String",
"objectAsString",
")",
"{",
"String",
"[",
"]",
"splittedObject",
"=",
"objectAsString",
".",
"split",
"(",
"\",\"",
")",
";",
"if",
"(",
"splittedObject",
".",
"length",
"!=",
"4",
")",
"throw",
... | This method creates a BBox out of a string in format lon1,lon2,lat1,lat2 | [
"This",
"method",
"creates",
"a",
"BBox",
"out",
"of",
"a",
"string",
"in",
"format",
"lon1",
"lon2",
"lat1",
"lat2"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/shapes/BBox.java#L334-L347 |
21,069 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/ch/NodeBasedNodeContractor.java | NodeBasedNodeContractor.addShortcuts | private int addShortcuts(Collection<Shortcut> shortcuts) {
int tmpNewShortcuts = 0;
NEXT_SC:
for (Shortcut sc : shortcuts) {
boolean updatedInGraph = false;
// check if we need to update some existing shortcut in the graph
CHEdgeIterator iter = outEdgeExplorer... | java | private int addShortcuts(Collection<Shortcut> shortcuts) {
int tmpNewShortcuts = 0;
NEXT_SC:
for (Shortcut sc : shortcuts) {
boolean updatedInGraph = false;
// check if we need to update some existing shortcut in the graph
CHEdgeIterator iter = outEdgeExplorer... | [
"private",
"int",
"addShortcuts",
"(",
"Collection",
"<",
"Shortcut",
">",
"shortcuts",
")",
"{",
"int",
"tmpNewShortcuts",
"=",
"0",
";",
"NEXT_SC",
":",
"for",
"(",
"Shortcut",
"sc",
":",
"shortcuts",
")",
"{",
"boolean",
"updatedInGraph",
"=",
"false",
... | Adds the given shortcuts to the graph.
@return the actual number of shortcuts that were added to the graph | [
"Adds",
"the",
"given",
"shortcuts",
"to",
"the",
"graph",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/ch/NodeBasedNodeContractor.java#L234-L283 |
21,070 | graphhopper/graphhopper | reader-gtfs/src/main/java/com/conveyal/gtfs/model/Entity.java | Entity.human | private static final String human (long n) {
if (n >= 1000000) return String.format(Locale.getDefault(), "%.1fM", n/1000000.0);
if (n >= 1000) return String.format(Locale.getDefault(), "%.1fk", n/1000.0);
else return String.format(Locale.getDefault(), "%d", n);
} | java | private static final String human (long n) {
if (n >= 1000000) return String.format(Locale.getDefault(), "%.1fM", n/1000000.0);
if (n >= 1000) return String.format(Locale.getDefault(), "%.1fk", n/1000.0);
else return String.format(Locale.getDefault(), "%d", n);
} | [
"private",
"static",
"final",
"String",
"human",
"(",
"long",
"n",
")",
"{",
"if",
"(",
"n",
">=",
"1000000",
")",
"return",
"String",
".",
"format",
"(",
"Locale",
".",
"getDefault",
"(",
")",
",",
"\"%.1fM\"",
",",
"n",
"/",
"1000000.0",
")",
";",
... | shared code between reading and writing | [
"shared",
"code",
"between",
"reading",
"and",
"writing"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/reader-gtfs/src/main/java/com/conveyal/gtfs/model/Entity.java#L443-L447 |
21,071 | graphhopper/graphhopper | tools/src/main/java/com/graphhopper/tools/Measurement.java | Measurement.writeSummary | private void writeSummary(String summaryLocation, String propLocation) {
logger.info("writing summary to " + summaryLocation);
// choose properties that should be in summary here
String[] properties = {
"graph.nodes",
"graph.edges",
"graph.import_t... | java | private void writeSummary(String summaryLocation, String propLocation) {
logger.info("writing summary to " + summaryLocation);
// choose properties that should be in summary here
String[] properties = {
"graph.nodes",
"graph.edges",
"graph.import_t... | [
"private",
"void",
"writeSummary",
"(",
"String",
"summaryLocation",
",",
"String",
"propLocation",
")",
"{",
"logger",
".",
"info",
"(",
"\"writing summary to \"",
"+",
"summaryLocation",
")",
";",
"// choose properties that should be in summary here",
"String",
"[",
"... | Writes a selection of measurement results to a single line in
a file. Each run of the measurement class will append a new line. | [
"Writes",
"a",
"selection",
"of",
"measurement",
"results",
"to",
"a",
"single",
"line",
"in",
"a",
"file",
".",
"Each",
"run",
"of",
"the",
"measurement",
"class",
"will",
"append",
"a",
"new",
"line",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/tools/src/main/java/com/graphhopper/tools/Measurement.java#L558-L596 |
21,072 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/util/EngineWarmUp.java | EngineWarmUp.warmUp | public static void warmUp(GraphHopper graphHopper, int iterations) {
GraphHopperStorage ghStorage = graphHopper.getGraphHopperStorage();
if (ghStorage == null)
throw new IllegalArgumentException("The storage of GraphHopper must not be empty");
try {
if (ghStorage.isCHPos... | java | public static void warmUp(GraphHopper graphHopper, int iterations) {
GraphHopperStorage ghStorage = graphHopper.getGraphHopperStorage();
if (ghStorage == null)
throw new IllegalArgumentException("The storage of GraphHopper must not be empty");
try {
if (ghStorage.isCHPos... | [
"public",
"static",
"void",
"warmUp",
"(",
"GraphHopper",
"graphHopper",
",",
"int",
"iterations",
")",
"{",
"GraphHopperStorage",
"ghStorage",
"=",
"graphHopper",
".",
"getGraphHopperStorage",
"(",
")",
";",
"if",
"(",
"ghStorage",
"==",
"null",
")",
"throw",
... | Do the 'warm up' for the specified GraphHopper instance.
@param iterations the 'intensity' of the warm up procedure | [
"Do",
"the",
"warm",
"up",
"for",
"the",
"specified",
"GraphHopper",
"instance",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/util/EngineWarmUp.java#L40-L53 |
21,073 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/EncodingManager.java | EncodingManager.create | public static EncodingManager create(FlagEncoderFactory factory, String ghLoc) {
Directory dir = new RAMDirectory(ghLoc, true);
StorableProperties properties = new StorableProperties(dir);
if (!properties.loadExisting())
throw new IllegalStateException("Cannot load properties to fetc... | java | public static EncodingManager create(FlagEncoderFactory factory, String ghLoc) {
Directory dir = new RAMDirectory(ghLoc, true);
StorableProperties properties = new StorableProperties(dir);
if (!properties.loadExisting())
throw new IllegalStateException("Cannot load properties to fetc... | [
"public",
"static",
"EncodingManager",
"create",
"(",
"FlagEncoderFactory",
"factory",
",",
"String",
"ghLoc",
")",
"{",
"Directory",
"dir",
"=",
"new",
"RAMDirectory",
"(",
"ghLoc",
",",
"true",
")",
";",
"StorableProperties",
"properties",
"=",
"new",
"Storabl... | Create the EncodingManager from the provided GraphHopper location. Throws an
IllegalStateException if it fails. Used if no EncodingManager specified on load. | [
"Create",
"the",
"EncodingManager",
"from",
"the",
"provided",
"GraphHopper",
"location",
".",
"Throws",
"an",
"IllegalStateException",
"if",
"it",
"fails",
".",
"Used",
"if",
"no",
"EncodingManager",
"specified",
"on",
"load",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/EncodingManager.java#L117-L138 |
21,074 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/EncodingManager.java | EncodingManager.acceptWay | public boolean acceptWay(ReaderWay way, AcceptWay acceptWay) {
if (!acceptWay.isEmpty())
throw new IllegalArgumentException("AcceptWay must be empty");
for (AbstractFlagEncoder encoder : edgeEncoders) {
acceptWay.put(encoder.toString(), encoder.getAccess(way));
}
... | java | public boolean acceptWay(ReaderWay way, AcceptWay acceptWay) {
if (!acceptWay.isEmpty())
throw new IllegalArgumentException("AcceptWay must be empty");
for (AbstractFlagEncoder encoder : edgeEncoders) {
acceptWay.put(encoder.toString(), encoder.getAccess(way));
}
... | [
"public",
"boolean",
"acceptWay",
"(",
"ReaderWay",
"way",
",",
"AcceptWay",
"acceptWay",
")",
"{",
"if",
"(",
"!",
"acceptWay",
".",
"isEmpty",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"AcceptWay must be empty\"",
")",
";",
"for",
"("... | Determine whether a way is routable for one of the added encoders.
@return if at least one encoder consumes the specified way. Additionally the specified acceptWay is changed
to provide more details. | [
"Determine",
"whether",
"a",
"way",
"is",
"routable",
"for",
"one",
"of",
"the",
"added",
"encoders",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/EncodingManager.java#L384-L392 |
21,075 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/EncodingManager.java | EncodingManager.handleWayTags | public IntsRef handleWayTags(ReaderWay way, AcceptWay acceptWay, long relationFlags) {
IntsRef edgeFlags = createEdgeFlags();
// return if way or ferry
Access access = acceptWay.getAccess();
for (TagParser parser : sharedEncodedValueMap.values()) {
parser.handleWayTags(edgeFl... | java | public IntsRef handleWayTags(ReaderWay way, AcceptWay acceptWay, long relationFlags) {
IntsRef edgeFlags = createEdgeFlags();
// return if way or ferry
Access access = acceptWay.getAccess();
for (TagParser parser : sharedEncodedValueMap.values()) {
parser.handleWayTags(edgeFl... | [
"public",
"IntsRef",
"handleWayTags",
"(",
"ReaderWay",
"way",
",",
"AcceptWay",
"acceptWay",
",",
"long",
"relationFlags",
")",
"{",
"IntsRef",
"edgeFlags",
"=",
"createEdgeFlags",
"(",
")",
";",
"// return if way or ferry",
"Access",
"access",
"=",
"acceptWay",
... | Processes way properties of different kind to determine speed and direction. Properties are
directly encoded in 8 bytes.
@param relationFlags The preprocessed relation flags is used to influence the way properties. | [
"Processes",
"way",
"properties",
"of",
"different",
"kind",
"to",
"determine",
"speed",
"and",
"direction",
".",
"Properties",
"are",
"directly",
"encoded",
"in",
"8",
"bytes",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/EncodingManager.java#L471-L482 |
21,076 | graphhopper/graphhopper | api/src/main/java/com/graphhopper/util/Helper.java | Helper.isFileMapped | public static boolean isFileMapped(ByteBuffer bb) {
if (bb instanceof MappedByteBuffer) {
try {
((MappedByteBuffer) bb).isLoaded();
return true;
} catch (UnsupportedOperationException ex) {
}
}
return false;
} | java | public static boolean isFileMapped(ByteBuffer bb) {
if (bb instanceof MappedByteBuffer) {
try {
((MappedByteBuffer) bb).isLoaded();
return true;
} catch (UnsupportedOperationException ex) {
}
}
return false;
} | [
"public",
"static",
"boolean",
"isFileMapped",
"(",
"ByteBuffer",
"bb",
")",
"{",
"if",
"(",
"bb",
"instanceof",
"MappedByteBuffer",
")",
"{",
"try",
"{",
"(",
"(",
"MappedByteBuffer",
")",
"bb",
")",
".",
"isLoaded",
"(",
")",
";",
"return",
"true",
";"... | Determines if the specified ByteBuffer is one which maps to a file! | [
"Determines",
"if",
"the",
"specified",
"ByteBuffer",
"is",
"one",
"which",
"maps",
"to",
"a",
"file!"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/Helper.java#L233-L242 |
21,077 | graphhopper/graphhopper | api/src/main/java/com/graphhopper/util/Helper.java | Helper.keepIn | public static final double keepIn(double value, double min, double max) {
return Math.max(min, Math.min(value, max));
} | java | public static final double keepIn(double value, double min, double max) {
return Math.max(min, Math.min(value, max));
} | [
"public",
"static",
"final",
"double",
"keepIn",
"(",
"double",
"value",
",",
"double",
"min",
",",
"double",
"max",
")",
"{",
"return",
"Math",
".",
"max",
"(",
"min",
",",
"Math",
".",
"min",
"(",
"value",
",",
"max",
")",
")",
";",
"}"
] | This methods returns the value or min if too small or max if too big. | [
"This",
"methods",
"returns",
"the",
"value",
"or",
"min",
"if",
"too",
"small",
"or",
"max",
"if",
"too",
"big",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/Helper.java#L370-L372 |
21,078 | graphhopper/graphhopper | api/src/main/java/com/graphhopper/util/Helper.java | Helper.round | public static double round(double value, int exponent) {
double factor = Math.pow(10, exponent);
return Math.round(value * factor) / factor;
} | java | public static double round(double value, int exponent) {
double factor = Math.pow(10, exponent);
return Math.round(value * factor) / factor;
} | [
"public",
"static",
"double",
"round",
"(",
"double",
"value",
",",
"int",
"exponent",
")",
"{",
"double",
"factor",
"=",
"Math",
".",
"pow",
"(",
"10",
",",
"exponent",
")",
";",
"return",
"Math",
".",
"round",
"(",
"value",
"*",
"factor",
")",
"/",... | Round the value to the specified exponent | [
"Round",
"the",
"value",
"to",
"the",
"specified",
"exponent"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/Helper.java#L377-L380 |
21,079 | graphhopper/graphhopper | api/src/main/java/com/graphhopper/util/Helper.java | Helper.createFormatter | public static DateFormat createFormatter(String str) {
DateFormat df = new SimpleDateFormat(str, Locale.UK);
df.setTimeZone(UTC);
return df;
} | java | public static DateFormat createFormatter(String str) {
DateFormat df = new SimpleDateFormat(str, Locale.UK);
df.setTimeZone(UTC);
return df;
} | [
"public",
"static",
"DateFormat",
"createFormatter",
"(",
"String",
"str",
")",
"{",
"DateFormat",
"df",
"=",
"new",
"SimpleDateFormat",
"(",
"str",
",",
"Locale",
".",
"UK",
")",
";",
"df",
".",
"setTimeZone",
"(",
"UTC",
")",
";",
"return",
"df",
";",
... | Creates a SimpleDateFormat with the UK locale. | [
"Creates",
"a",
"SimpleDateFormat",
"with",
"the",
"UK",
"locale",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/Helper.java#L405-L409 |
21,080 | graphhopper/graphhopper | api/src/main/java/com/graphhopper/GHResponse.java | GHResponse.hasErrors | public boolean hasErrors() {
if (!errors.isEmpty())
return true;
for (PathWrapper ar : pathWrappers) {
if (ar.hasErrors())
return true;
}
return false;
} | java | public boolean hasErrors() {
if (!errors.isEmpty())
return true;
for (PathWrapper ar : pathWrappers) {
if (ar.hasErrors())
return true;
}
return false;
} | [
"public",
"boolean",
"hasErrors",
"(",
")",
"{",
"if",
"(",
"!",
"errors",
".",
"isEmpty",
"(",
")",
")",
"return",
"true",
";",
"for",
"(",
"PathWrapper",
"ar",
":",
"pathWrappers",
")",
"{",
"if",
"(",
"ar",
".",
"hasErrors",
"(",
")",
")",
"retu... | This method returns true if one of the paths has an error or if the response itself is
erroneous. | [
"This",
"method",
"returns",
"true",
"if",
"one",
"of",
"the",
"paths",
"has",
"an",
"error",
"or",
"if",
"the",
"response",
"itself",
"is",
"erroneous",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/GHResponse.java#L93-L103 |
21,081 | graphhopper/graphhopper | api/src/main/java/com/graphhopper/GHResponse.java | GHResponse.getErrors | public List<Throwable> getErrors() {
List<Throwable> list = new ArrayList<>();
list.addAll(errors);
for (PathWrapper ar : pathWrappers) {
list.addAll(ar.getErrors());
}
return list;
} | java | public List<Throwable> getErrors() {
List<Throwable> list = new ArrayList<>();
list.addAll(errors);
for (PathWrapper ar : pathWrappers) {
list.addAll(ar.getErrors());
}
return list;
} | [
"public",
"List",
"<",
"Throwable",
">",
"getErrors",
"(",
")",
"{",
"List",
"<",
"Throwable",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"list",
".",
"addAll",
"(",
"errors",
")",
";",
"for",
"(",
"PathWrapper",
"ar",
":",
"pathWrapp... | This method returns all the explicitly added errors and the errors of all paths. | [
"This",
"method",
"returns",
"all",
"the",
"explicitly",
"added",
"errors",
"and",
"the",
"errors",
"of",
"all",
"paths",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/GHResponse.java#L108-L115 |
21,082 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/util/TranslationMap.java | TranslationMap.doImport | public TranslationMap doImport(File folder) {
try {
for (String locale : LOCALES) {
TranslationHashMap trMap = new TranslationHashMap(getLocale(locale));
trMap.doImport(new FileInputStream(new File(folder, locale + ".txt")));
add(trMap);
}
... | java | public TranslationMap doImport(File folder) {
try {
for (String locale : LOCALES) {
TranslationHashMap trMap = new TranslationHashMap(getLocale(locale));
trMap.doImport(new FileInputStream(new File(folder, locale + ".txt")));
add(trMap);
}
... | [
"public",
"TranslationMap",
"doImport",
"(",
"File",
"folder",
")",
"{",
"try",
"{",
"for",
"(",
"String",
"locale",
":",
"LOCALES",
")",
"{",
"TranslationHashMap",
"trMap",
"=",
"new",
"TranslationHashMap",
"(",
"getLocale",
"(",
"locale",
")",
")",
";",
... | This loads the translation files from the specified folder. | [
"This",
"loads",
"the",
"translation",
"files",
"from",
"the",
"specified",
"folder",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/util/TranslationMap.java#L51-L63 |
21,083 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/util/TranslationMap.java | TranslationMap.doImport | public TranslationMap doImport() {
try {
for (String locale : LOCALES) {
TranslationHashMap trMap = new TranslationHashMap(getLocale(locale));
trMap.doImport(TranslationMap.class.getResourceAsStream(locale + ".txt"));
add(trMap);
}
... | java | public TranslationMap doImport() {
try {
for (String locale : LOCALES) {
TranslationHashMap trMap = new TranslationHashMap(getLocale(locale));
trMap.doImport(TranslationMap.class.getResourceAsStream(locale + ".txt"));
add(trMap);
}
... | [
"public",
"TranslationMap",
"doImport",
"(",
")",
"{",
"try",
"{",
"for",
"(",
"String",
"locale",
":",
"LOCALES",
")",
"{",
"TranslationHashMap",
"trMap",
"=",
"new",
"TranslationHashMap",
"(",
"getLocale",
"(",
"locale",
")",
")",
";",
"trMap",
".",
"doI... | This loads the translation files from classpath. | [
"This",
"loads",
"the",
"translation",
"files",
"from",
"classpath",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/util/TranslationMap.java#L68-L80 |
21,084 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/util/TranslationMap.java | TranslationMap.getWithFallBack | public Translation getWithFallBack(Locale locale) {
Translation tr = get(locale.toString());
if (tr == null) {
tr = get(locale.getLanguage());
if (tr == null)
tr = get("en");
}
return tr;
} | java | public Translation getWithFallBack(Locale locale) {
Translation tr = get(locale.toString());
if (tr == null) {
tr = get(locale.getLanguage());
if (tr == null)
tr = get("en");
}
return tr;
} | [
"public",
"Translation",
"getWithFallBack",
"(",
"Locale",
"locale",
")",
"{",
"Translation",
"tr",
"=",
"get",
"(",
"locale",
".",
"toString",
"(",
")",
")",
";",
"if",
"(",
"tr",
"==",
"null",
")",
"{",
"tr",
"=",
"get",
"(",
"locale",
".",
"getLan... | Returns the Translation object for the specified locale and falls back to English if the
locale was not found. | [
"Returns",
"the",
"Translation",
"object",
"for",
"the",
"specified",
"locale",
"and",
"falls",
"back",
"to",
"English",
"if",
"the",
"locale",
"was",
"not",
"found",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/util/TranslationMap.java#L102-L110 |
21,085 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/util/TranslationMap.java | TranslationMap.get | public Translation get(String locale) {
locale = locale.replace("-", "_");
Translation tr = translations.get(locale);
if (locale.contains("_") && tr == null)
tr = translations.get(locale.substring(0, 2));
return tr;
} | java | public Translation get(String locale) {
locale = locale.replace("-", "_");
Translation tr = translations.get(locale);
if (locale.contains("_") && tr == null)
tr = translations.get(locale.substring(0, 2));
return tr;
} | [
"public",
"Translation",
"get",
"(",
"String",
"locale",
")",
"{",
"locale",
"=",
"locale",
".",
"replace",
"(",
"\"-\"",
",",
"\"_\"",
")",
";",
"Translation",
"tr",
"=",
"translations",
".",
"get",
"(",
"locale",
")",
";",
"if",
"(",
"locale",
".",
... | Returns the Translation object for the specified locale and returns null if not found. | [
"Returns",
"the",
"Translation",
"object",
"for",
"the",
"specified",
"locale",
"and",
"returns",
"null",
"if",
"not",
"found",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/util/TranslationMap.java#L115-L122 |
21,086 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/util/TranslationMap.java | TranslationMap.postImportHook | private void postImportHook() {
Map<String, String> enMap = get("en").asMap();
StringBuilder sb = new StringBuilder();
for (Translation tr : translations.values()) {
Map<String, String> trMap = tr.asMap();
for (Entry<String, String> enEntry : enMap.entrySet()) {
... | java | private void postImportHook() {
Map<String, String> enMap = get("en").asMap();
StringBuilder sb = new StringBuilder();
for (Translation tr : translations.values()) {
Map<String, String> trMap = tr.asMap();
for (Entry<String, String> enEntry : enMap.entrySet()) {
... | [
"private",
"void",
"postImportHook",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"enMap",
"=",
"get",
"(",
"\"en\"",
")",
".",
"asMap",
"(",
")",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Transl... | This method does some checks and fills missing translation from en | [
"This",
"method",
"does",
"some",
"checks",
"and",
"fills",
"missing",
"translation",
"from",
"en"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/util/TranslationMap.java#L127-L163 |
21,087 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/DAType.java | DAType.getPreferredInt | public static DAType getPreferredInt(DAType type) {
if (type.isInMemory())
return type.isStoring() ? RAM_INT_STORE : RAM_INT;
return type;
} | java | public static DAType getPreferredInt(DAType type) {
if (type.isInMemory())
return type.isStoring() ? RAM_INT_STORE : RAM_INT;
return type;
} | [
"public",
"static",
"DAType",
"getPreferredInt",
"(",
"DAType",
"type",
")",
"{",
"if",
"(",
"type",
".",
"isInMemory",
"(",
")",
")",
"return",
"type",
".",
"isStoring",
"(",
")",
"?",
"RAM_INT_STORE",
":",
"RAM_INT",
";",
"return",
"type",
";",
"}"
] | This method returns RAM_INT if the specified type is in-memory. | [
"This",
"method",
"returns",
"RAM_INT",
"if",
"the",
"specified",
"type",
"is",
"in",
"-",
"memory",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/DAType.java#L95-L99 |
21,088 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/EdgeAccess.java | EdgeAccess.distToInt | private int distToInt(double distance) {
if (distance < 0)
throw new IllegalArgumentException("Distance cannot be negative: " + distance);
if (distance > MAX_DIST) {
distance = MAX_DIST;
}
int integ = (int) Math.round(distance * INT_DIST_FACTOR);
assert in... | java | private int distToInt(double distance) {
if (distance < 0)
throw new IllegalArgumentException("Distance cannot be negative: " + distance);
if (distance > MAX_DIST) {
distance = MAX_DIST;
}
int integ = (int) Math.round(distance * INT_DIST_FACTOR);
assert in... | [
"private",
"int",
"distToInt",
"(",
"double",
"distance",
")",
"{",
"if",
"(",
"distance",
"<",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Distance cannot be negative: \"",
"+",
"distance",
")",
";",
"if",
"(",
"distance",
">",
"MAX_DIST",
"... | Translates double distance to integer in order to save it in a DataAccess object | [
"Translates",
"double",
"distance",
"to",
"integer",
"in",
"order",
"to",
"save",
"it",
"in",
"a",
"DataAccess",
"object"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/EdgeAccess.java#L75-L84 |
21,089 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/EdgeAccess.java | EdgeAccess.internalEdgeAdd | final int internalEdgeAdd(int newEdgeId, int nodeA, int nodeB) {
writeEdge(newEdgeId, nodeA, nodeB, EdgeIterator.NO_EDGE, EdgeIterator.NO_EDGE);
long edgePointer = toPointer(newEdgeId);
int edge = getEdgeRef(nodeA);
if (edge > EdgeIterator.NO_EDGE)
edges.setInt(E_LINKA + edg... | java | final int internalEdgeAdd(int newEdgeId, int nodeA, int nodeB) {
writeEdge(newEdgeId, nodeA, nodeB, EdgeIterator.NO_EDGE, EdgeIterator.NO_EDGE);
long edgePointer = toPointer(newEdgeId);
int edge = getEdgeRef(nodeA);
if (edge > EdgeIterator.NO_EDGE)
edges.setInt(E_LINKA + edg... | [
"final",
"int",
"internalEdgeAdd",
"(",
"int",
"newEdgeId",
",",
"int",
"nodeA",
",",
"int",
"nodeB",
")",
"{",
"writeEdge",
"(",
"newEdgeId",
",",
"nodeA",
",",
"nodeB",
",",
"EdgeIterator",
".",
"NO_EDGE",
",",
"EdgeIterator",
".",
"NO_EDGE",
")",
";",
... | Writes a new edge to the array of edges and adds it to the linked list of edges at nodeA and nodeB | [
"Writes",
"a",
"new",
"edge",
"to",
"the",
"array",
"of",
"edges",
"and",
"adds",
"it",
"to",
"the",
"linked",
"list",
"of",
"edges",
"at",
"nodeA",
"and",
"nodeB"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/EdgeAccess.java#L112-L128 |
21,090 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/EdgeAccess.java | EdgeAccess.writeEdge | final long writeEdge(int edgeId, int nodeA, int nodeB, int nextEdgeA, int nextEdgeB) {
if (edgeId < 0 || edgeId == EdgeIterator.NO_EDGE)
throw new IllegalStateException("Cannot write edge with illegal ID:" + edgeId + "; nodeA:" + nodeA + ", nodeB:" + nodeB);
long edgePointer = toPointer(edg... | java | final long writeEdge(int edgeId, int nodeA, int nodeB, int nextEdgeA, int nextEdgeB) {
if (edgeId < 0 || edgeId == EdgeIterator.NO_EDGE)
throw new IllegalStateException("Cannot write edge with illegal ID:" + edgeId + "; nodeA:" + nodeA + ", nodeB:" + nodeB);
long edgePointer = toPointer(edg... | [
"final",
"long",
"writeEdge",
"(",
"int",
"edgeId",
",",
"int",
"nodeA",
",",
"int",
"nodeB",
",",
"int",
"nextEdgeA",
",",
"int",
"nextEdgeB",
")",
"{",
"if",
"(",
"edgeId",
"<",
"0",
"||",
"edgeId",
"==",
"EdgeIterator",
".",
"NO_EDGE",
")",
"throw",... | Writes plain edge information to the edges index | [
"Writes",
"plain",
"edge",
"information",
"to",
"the",
"edges",
"index"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/EdgeAccess.java#L154-L164 |
21,091 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/EdgeAccess.java | EdgeAccess.internalEdgeDisconnect | final long internalEdgeDisconnect(int edgeToRemove, long edgeToUpdatePointer, int baseNode) {
long edgeToRemovePointer = toPointer(edgeToRemove);
// an edge is shared across the two nodes even if the edge is not in both directions
// so we need to know two edge-pointers pointing to the edge befo... | java | final long internalEdgeDisconnect(int edgeToRemove, long edgeToUpdatePointer, int baseNode) {
long edgeToRemovePointer = toPointer(edgeToRemove);
// an edge is shared across the two nodes even if the edge is not in both directions
// so we need to know two edge-pointers pointing to the edge befo... | [
"final",
"long",
"internalEdgeDisconnect",
"(",
"int",
"edgeToRemove",
",",
"long",
"edgeToUpdatePointer",
",",
"int",
"baseNode",
")",
"{",
"long",
"edgeToRemovePointer",
"=",
"toPointer",
"(",
"edgeToRemove",
")",
";",
"// an edge is shared across the two nodes even if ... | This method disconnects the specified edge from the list of edges of the specified node. It
does not release the freed space to be reused.
@param edgeToUpdatePointer if it is negative then the nextEdgeId will be saved to refToEdges of nodes | [
"This",
"method",
"disconnects",
"the",
"specified",
"edge",
"from",
"the",
"list",
"of",
"edges",
"of",
"the",
"specified",
"node",
".",
"It",
"does",
"not",
"release",
"the",
"freed",
"space",
"to",
"be",
"reused",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/EdgeAccess.java#L172-L185 |
21,092 | graphhopper/graphhopper | api/src/main/java/com/graphhopper/util/AngleCalc.java | AngleCalc.calcAzimuth | public double calcAzimuth(double lat1, double lon1, double lat2, double lon2) {
double orientation = Math.PI / 2 - calcOrientation(lat1, lon1, lat2, lon2);
if (orientation < 0)
orientation += 2 * Math.PI;
return Math.toDegrees(Helper.round4(orientation)) % 360;
} | java | public double calcAzimuth(double lat1, double lon1, double lat2, double lon2) {
double orientation = Math.PI / 2 - calcOrientation(lat1, lon1, lat2, lon2);
if (orientation < 0)
orientation += 2 * Math.PI;
return Math.toDegrees(Helper.round4(orientation)) % 360;
} | [
"public",
"double",
"calcAzimuth",
"(",
"double",
"lat1",
",",
"double",
"lon1",
",",
"double",
"lat2",
",",
"double",
"lon2",
")",
"{",
"double",
"orientation",
"=",
"Math",
".",
"PI",
"/",
"2",
"-",
"calcOrientation",
"(",
"lat1",
",",
"lon1",
",",
"... | Calculate the azimuth in degree for a line given by two coordinates. Direction in 'degree'
where 0 is north, 90 is east, 180 is south and 270 is west. | [
"Calculate",
"the",
"azimuth",
"in",
"degree",
"for",
"a",
"line",
"given",
"by",
"two",
"coordinates",
".",
"Direction",
"in",
"degree",
"where",
"0",
"is",
"north",
"90",
"is",
"east",
"180",
"is",
"south",
"and",
"270",
"is",
"west",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/AngleCalc.java#L113-L119 |
21,093 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/util/BitUtil.java | BitUtil.fromBitString2Long | public final long fromBitString2Long(String str) {
if (str.length() > 64)
throw new UnsupportedOperationException("Strings needs to fit into a 'long' but length was " + str.length());
long res = 0;
int strLen = str.length();
for (int charIndex = 0; charIndex < strLen; charIn... | java | public final long fromBitString2Long(String str) {
if (str.length() > 64)
throw new UnsupportedOperationException("Strings needs to fit into a 'long' but length was " + str.length());
long res = 0;
int strLen = str.length();
for (int charIndex = 0; charIndex < strLen; charIn... | [
"public",
"final",
"long",
"fromBitString2Long",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
".",
"length",
"(",
")",
">",
"64",
")",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"Strings needs to fit into a 'long' but length was \"",
"+",
"str",
... | The only purpose of this method is to test 'reverse'. toBitString is the reverse and both are
independent of the endianness. | [
"The",
"only",
"purpose",
"of",
"this",
"method",
"is",
"to",
"test",
"reverse",
".",
"toBitString",
"is",
"the",
"reverse",
"and",
"both",
"are",
"independent",
"of",
"the",
"endianness",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/util/BitUtil.java#L155-L168 |
21,094 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/tour/TourStrategy.java | TourStrategy.slightlyModifyDistance | protected double slightlyModifyDistance(double distance) {
double distanceModification = random.nextDouble() * .1 * distance;
if (random.nextBoolean())
distanceModification = -distanceModification;
return distance + distanceModification;
} | java | protected double slightlyModifyDistance(double distance) {
double distanceModification = random.nextDouble() * .1 * distance;
if (random.nextBoolean())
distanceModification = -distanceModification;
return distance + distanceModification;
} | [
"protected",
"double",
"slightlyModifyDistance",
"(",
"double",
"distance",
")",
"{",
"double",
"distanceModification",
"=",
"random",
".",
"nextDouble",
"(",
")",
"*",
".1",
"*",
"distance",
";",
"if",
"(",
"random",
".",
"nextBoolean",
"(",
")",
")",
"dist... | Modifies the Distance up to +-10% | [
"Modifies",
"the",
"Distance",
"up",
"to",
"+",
"-",
"10%"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/tour/TourStrategy.java#L54-L59 |
21,095 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/GraphHopper.java | GraphHopper.setGraphHopperLocation | public GraphHopper setGraphHopperLocation(String ghLocation) {
ensureNotLoaded();
if (ghLocation == null)
throw new IllegalArgumentException("graphhopper location cannot be null");
this.ghLocation = ghLocation;
return this;
} | java | public GraphHopper setGraphHopperLocation(String ghLocation) {
ensureNotLoaded();
if (ghLocation == null)
throw new IllegalArgumentException("graphhopper location cannot be null");
this.ghLocation = ghLocation;
return this;
} | [
"public",
"GraphHopper",
"setGraphHopperLocation",
"(",
"String",
"ghLocation",
")",
"{",
"ensureNotLoaded",
"(",
")",
";",
"if",
"(",
"ghLocation",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"graphhopper location cannot be null\"",
")",
";"... | Sets the graphhopper folder. | [
"Sets",
"the",
"graphhopper",
"folder",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/GraphHopper.java#L384-L391 |
21,096 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/GraphHopper.java | GraphHopper.process | private GraphHopper process(String graphHopperLocation) {
setGraphHopperLocation(graphHopperLocation);
GHLock lock = null;
try {
if (ghStorage.getDirectory().getDefaultType().isStoring()) {
lockFactory.setLockDir(new File(graphHopperLocation));
lock = ... | java | private GraphHopper process(String graphHopperLocation) {
setGraphHopperLocation(graphHopperLocation);
GHLock lock = null;
try {
if (ghStorage.getDirectory().getDefaultType().isStoring()) {
lockFactory.setLockDir(new File(graphHopperLocation));
lock = ... | [
"private",
"GraphHopper",
"process",
"(",
"String",
"graphHopperLocation",
")",
"{",
"setGraphHopperLocation",
"(",
"graphHopperLocation",
")",
";",
"GHLock",
"lock",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"ghStorage",
".",
"getDirectory",
"(",
")",
".",
"ge... | Creates the graph from OSM data. | [
"Creates",
"the",
"graph",
"from",
"OSM",
"data",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/GraphHopper.java#L613-L641 |
21,097 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/GraphHopper.java | GraphHopper.load | @Override
public boolean load(String graphHopperFolder) {
if (isEmpty(graphHopperFolder))
throw new IllegalStateException("GraphHopperLocation is not specified. Call setGraphHopperLocation or init before");
if (fullyLoaded)
throw new IllegalStateException("graph is already s... | java | @Override
public boolean load(String graphHopperFolder) {
if (isEmpty(graphHopperFolder))
throw new IllegalStateException("GraphHopperLocation is not specified. Call setGraphHopperLocation or init before");
if (fullyLoaded)
throw new IllegalStateException("graph is already s... | [
"@",
"Override",
"public",
"boolean",
"load",
"(",
"String",
"graphHopperFolder",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"graphHopperFolder",
")",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"GraphHopperLocation is not specified. Call setGraphHopperLocation or init b... | Opens existing graph folder.
@param graphHopperFolder is the folder containing graphhopper files. Can be a compressed file
too ala folder-content.ghz. | [
"Opens",
"existing",
"graph",
"folder",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/GraphHopper.java#L681-L754 |
21,098 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/GraphHopper.java | GraphHopper.postProcessing | public void postProcessing() {
// Later: move this into the GraphStorage.optimize method
// Or: Doing it after preparation to optimize shortcuts too. But not possible yet #12
if (sortGraph) {
if (ghStorage.isCHPossible() && isCHPrepared())
throw new IllegalArgumentEx... | java | public void postProcessing() {
// Later: move this into the GraphStorage.optimize method
// Or: Doing it after preparation to optimize shortcuts too. But not possible yet #12
if (sortGraph) {
if (ghStorage.isCHPossible() && isCHPrepared())
throw new IllegalArgumentEx... | [
"public",
"void",
"postProcessing",
"(",
")",
"{",
"// Later: move this into the GraphStorage.optimize method",
"// Or: Doing it after preparation to optimize shortcuts too. But not possible yet #12",
"if",
"(",
"sortGraph",
")",
"{",
"if",
"(",
"ghStorage",
".",
"isCHPossible",
... | Does the preparation and creates the location index | [
"Does",
"the",
"preparation",
"and",
"creates",
"the",
"location",
"index"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/GraphHopper.java#L813-L841 |
21,099 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/GraphHopper.java | GraphHopper.createWeighting | public Weighting createWeighting(HintsMap hintsMap, FlagEncoder encoder, Graph graph) {
String weightingStr = toLowerCase(hintsMap.getWeighting());
Weighting weighting = null;
if (encoder.supports(GenericWeighting.class)) {
weighting = new GenericWeighting((DataFlagEncoder) encoder,... | java | public Weighting createWeighting(HintsMap hintsMap, FlagEncoder encoder, Graph graph) {
String weightingStr = toLowerCase(hintsMap.getWeighting());
Weighting weighting = null;
if (encoder.supports(GenericWeighting.class)) {
weighting = new GenericWeighting((DataFlagEncoder) encoder,... | [
"public",
"Weighting",
"createWeighting",
"(",
"HintsMap",
"hintsMap",
",",
"FlagEncoder",
"encoder",
",",
"Graph",
"graph",
")",
"{",
"String",
"weightingStr",
"=",
"toLowerCase",
"(",
"hintsMap",
".",
"getWeighting",
"(",
")",
")",
";",
"Weighting",
"weighting... | Based on the hintsMap and the specified encoder a Weighting instance can be
created. Note that all URL parameters are available in the hintsMap as String if
you use the web module.
@param hintsMap all parameters influencing the weighting. E.g. parameters coming via
GHRequest.getHints or directly via "&api.xy=" fro... | [
"Based",
"on",
"the",
"hintsMap",
"and",
"the",
"specified",
"encoder",
"a",
"Weighting",
"instance",
"can",
"be",
"created",
".",
"Note",
"that",
"all",
"URL",
"parameters",
"are",
"available",
"in",
"the",
"hintsMap",
"as",
"String",
"if",
"you",
"use",
... | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/GraphHopper.java#L875-L907 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.