code stringlengths 12 2.05k | label_name stringclasses 5
values | label int64 0 4 |
|---|---|---|
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
String secret = getSecret();
Key key = new SecretKeySpec(Decoders.BASE64.decode(secret), getSignatureAlgorithm().getJcaName());
Jwt jwt = Jwts.parser().
s... | Base | 1 |
protected void switchToConversation(Contact contact, String body) {
Conversation conversation = xmppConnectionService
.findOrCreateConversation(contact.getAccount(),
contact.getJid(), false, true);
switchToConversation(conversation, body);
} | Class | 2 |
private void testGeneration()
throws Exception
{
//
// ECDSA generation test
//
byte[] data = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
Signature s = Signature.getInstance("ECDSA", "BC");
KeyPairGenerator g = KeyPairGenerator.getInstance("ECDSA", "BC"... | Base | 1 |
public void testSelectByUse() {
JWKSelector selector = new JWKSelector(new JWKMatcher.Builder().keyUse(KeyUse.ENCRYPTION).build());
List<JWK> keyList = new ArrayList<>();
keyList.add(new RSAKey.Builder(new Base64URL("n"), new Base64URL("e")).keyID("1").keyUse(KeyUse.ENCRYPTION).build());
keyList.add(new ECKe... | Base | 1 |
public void translate(ServerPlaySoundPacket packet, GeyserSession session) {
String packetSound;
if (packet.getSound() instanceof BuiltinSound) {
packetSound = ((BuiltinSound) packet.getSound()).getName();
} else if (packet.getSound() instanceof CustomSound) {
packetS... | Class | 2 |
private ByteArrayOutputStream initRequestResponseMocks(String callback,Runnable requestSetup,Runnable responseSetup) throws IOException {
request = createMock(HttpServletRequest.class);
response = createMock(HttpServletResponse.class);
setNoCacheHeaders(response);
expect(request.get... | Base | 1 |
public static AsciiString of(CharSequence name) {
if (name instanceof AsciiString) {
return of((AsciiString) name);
}
final String lowerCased = Ascii.toLowerCase(requireNonNull(name, "name"));
final AsciiString cached = map.get(lowerCased);
return cached != null ... | Class | 2 |
public void resetHandlers() {
getDispatchHandler().resetHandlers();
} | Base | 1 |
public boolean isStringInternEnabled() {
return stringInternEnabled;
} | Base | 1 |
public ResponseEntity<Resource> download(@PathVariable String key) {
LitemallStorage litemallStorage = litemallStorageService.findByKey(key);
if (key == null) {
ResponseEntity.notFound();
}
String type = litemallStorage.getType();
MediaType mediaType = MediaType.p... | Base | 1 |
public static SSLSocketFactory getSslSocketFactory(Properties info) throws PSQLException {
String classname = PGProperty.SSL_FACTORY.get(info);
if (classname == null
|| "org.postgresql.ssl.jdbc4.LibPQFactory".equals(classname)
|| "org.postgresql.ssl.LibPQFactory".equals(classname)) {
ret... | Class | 2 |
public int checkSessionsValidity() {
int expired = 0;
acquireExclusiveLock();
try {
final long now = System.currentTimeMillis();
Entry<String, OHttpSession> s;
for (Iterator<Map.Entry<String, OHttpSession>> it = sessions.entrySet().iterator(); it.hasNext();) {
... | Class | 2 |
public void getLogFile(@PathVariable("filename") String fileName, HttpServletResponse response) throws Exception {
InputStream inputStream = null;
try {
//Validate/Sanitize user input filename using a standard library, prevent from path traversal
String logFileName = getFilePat... | Base | 1 |
public boolean importWiki(File file, String filename, File targetDirectory) {
try {
Path path = FileResource.getResource(file, filename);
if(path == null) {
return false;
}
Path destDir = targetDirectory.toPath();
Files.walkFileTree(path, new ImportVisitor(destDir));
PathUtils.closeSubseque... | Base | 1 |
public void deleteById(Integer id) {
databaseTypeDao.selectOptionalById(id).ifPresent(data -> {
if (DatabaseTypes.has(data.getDatabaseType())) {
throw DomainErrors.MUST_NOT_MODIFY_SYSTEM_DEFAULT_DATABASE_TYPE.exception();
}
databaseTypeDao.deleteById(id);
... | Class | 2 |
private ModelAndView renameGroup(HttpServletRequest request, HttpServletResponse response) throws Exception {
String oldName = request.getParameter("groupName");
String newName = request.getParameter("newName");
if (StringUtils.hasText(oldName) && StringUtils.hasText(newNam... | Base | 1 |
public XMLReader getXMLReader() throws SAXException {
if (xmlReader == null) {
xmlReader = createXMLReader();
}
return xmlReader;
} | Base | 1 |
private static CharSequenceMap toLowercaseMap(Iterator<? extends CharSequence> valuesIter,
int arraySizeHint) {
final CharSequenceMap result = new CharSequenceMap(arraySizeHint);
while (valuesIter.hasNext()) {
final AsciiString lowerCase... | Class | 2 |
public void setSetContentFromFileExceptionally() throws Exception {
final long maxSize = 4;
DiskFileUpload f1 = new DiskFileUpload("file5", "file5", "application/json", null, null, 0);
f1.setMaxSize(maxSize);
try {
f1.setContent(Unpooled.wrappedBuffer(new byte[(int) maxSi... | Base | 1 |
protected IBaseResource addCommonParams(HttpServletRequest theServletRequest, final HomeRequest theRequest, final ModelMap theModel) {
final String serverId = theRequest.getServerIdWithDefault(myConfig);
final String serverBase = theRequest.getServerBase(theServletRequest, myConfig);
final String serverName = th... | Base | 1 |
public void translate(ServerExplosionPacket packet, GeyserSession session) {
for (ExplodedBlockRecord record : packet.getExploded()) {
Vector3f pos = Vector3f.from(packet.getX() + record.getX(), packet.getY() + record.getY(), packet.getZ() + record.getZ());
ChunkUtils.updateBlock(ses... | Class | 2 |
protected HtmlRenderable htmlBody() {
return HtmlElement.li().content(
HtmlElement.span(HtmlAttribute.cssClass("artifact")).content(
HtmlElement.a(HtmlAttribute.href(getUrl()))
.content(getFileName())
)
);
} | Base | 1 |
void newDocumentInvalidName() throws Exception
{
when(mockDocument.isNew()).thenReturn(true);
DocumentReference documentReference = new DocumentReference("XWiki", "Foo", "Bar");
when(mockDocument.getDocumentReference()).thenReturn(documentReference);
when(this.entityNameValidatio... | Class | 2 |
public ConstraintValidatorContext getContext() {
return context;
} | Class | 2 |
private static IRegex getRegexConcat() {
return RegexConcat.build(CommandBinary.class.getName(), RegexLeaf.start(), //
new RegexOptional( //
new RegexConcat( //
new RegexLeaf("COMPACT", "(compact)"), //
RegexLeaf.spaceOneOrMore())), //
new RegexLeaf("binary"), //
RegexLeaf.spaceOneO... | Base | 1 |
private void ondata(byte[] data) {
try {
this.decoder.add(data);
} catch (DecodingException e) {
this.onerror(e);
}
} | Base | 1 |
private void displayVerificationWarningDialog(final Contact contact, final Invite invite) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.verify_omemo_keys);
View view = getLayoutInflater().inflate(R.layout.dialog_verify_fingerprints, null);
final CheckBox isTrustedSour... | Class | 2 |
public EnhancedXStream(boolean export) {
super();
if (export) {
addDefaultImplementation(PersistentList.class, List.class);
addDefaultImplementation(PersistentBag.class, List.class);
addDefaultImplementation(PersistentMap.class, Map.class);
addDefaultImplementation(PersistentSortedMap.class, Map.class... | Base | 1 |
public boolean isIgnoreComments() {
return ignoreComments;
} | Base | 1 |
public String render(TemplateEngineTypeEnum engineType, String templateContent, Map<String, Object> context) {
if (StrUtil.isEmpty(templateContent)) {
return StrUtil.EMPTY;
}
TemplateEngine templateEngine = templateEngineMap.get(engineType);
Assert.notNull(templateEngine, "未找到对应的模板引擎:{}", engineType);
ret... | Class | 2 |
public void subValidateFail(ViolationCollector col) {
col.addViolation(FAILED+"subclass");
} | Class | 2 |
private String deflateAndEncode(byte[] result) {
Deflater deflater = new Deflater(Deflater.DEFLATED, true);
deflater.setInput(result);
deflater.finish();
byte[] deflatedResult = new byte[result.length];
int length = deflater.deflate(deflatedResult);
deflater.end();
byte[] src = Arrays.copy... | Base | 1 |
private Map<String, Argument<?>> initializeTypeParameters(Argument[] genericTypes) {
Map<String, Argument<?>> typeParameters;
if (genericTypes != null && genericTypes.length > 0) {
typeParameters = new LinkedHashMap<>(genericTypes.length);
for (Argument genericType : genericT... | Class | 2 |
public void setEncoding(String encoding) {
this.encoding = encoding;
} | Base | 1 |
public void export(Media media, ManifestBuilder manifest, File mediaArchiveDirectory, Locale locale) {
EfficiencyStatement statement = null;
if(StringHelper.containsNonWhitespace(media.getContent())) {
try {
statement = (EfficiencyStatement)myXStream.fromXML(media.getContent());
} catch (Exception e) {
... | Base | 1 |
private static void appendHexNibble(StringBuilder buf, int nibble) {
if (nibble < 10) {
buf.append((char) ('0' + nibble));
} else {
buf.append((char) ('A' + nibble - 10));
}
} | Base | 1 |
public RainbowParameters(int[] vi)
{
this.vi = vi;
try
{
checkParams();
}
catch (Exception e)
{
e.printStackTrace();
}
} | Base | 1 |
public static void execute(String url, String proxyHost, int proxyPort, String proxyUsername, String proxyPassword,
String terminalWidth) {
initializeSsl();
HttpURLConnection conn = createHttpUrlConnection(convertToUrl(url), proxyHost, proxyPort, proxyUsername,
proxyPassw... | Base | 1 |
public void testQuoteWorkingDirectoryAndExecutable()
{
Shell sh = newShell();
sh.setWorkingDirectory( "/usr/local/bin" );
sh.setExecutable( "chmod" );
String executable = StringUtils.join( sh.getShellCommandLine( new String[]{} ).iterator(), " " );
assertEquals( "/bin/... | Base | 1 |
public void configure(ICourse course, CourseNode newNode, ModuleConfiguration moduleConfig) {
if(displayType != null && (STCourseNodeEditController.CONFIG_VALUE_DISPLAY_TOC.equals(displayType)
|| STCourseNodeEditController.CONFIG_VALUE_DISPLAY_PEEKVIEW.equals(displayType)
|| STCourseNodeEditControlle... | Base | 1 |
public boolean isIncludeInternalDTDDeclarations() {
return includeInternalDTDDeclarations;
} | Base | 1 |
private String doResolveSqlDriverNameFromJar(File driverFile) {
JarFile jarFile = null;
try {
jarFile = new JarFile(driverFile);
} catch (IOException e) {
log.error("resolve driver class name error", e);
throw DomainErrors.DRIVER_CLASS_NAME_OBTAIN_ERROR.ex... | Class | 2 |
public void testRenameTo() throws Exception {
TestHttpData test = new TestHttpData("test", UTF_8, 0);
try {
File tmpFile = File.createTempFile(UUID.randomUUID().toString(), ".tmp");
tmpFile.deleteOnExit();
final int totalByteCount = 4096;
byte[] bytes ... | Base | 1 |
public void testMatchType() {
JWKMatcher matcher = new JWKMatcher.Builder().keyType(KeyType.RSA).build();
assertTrue(matcher.matches(new RSAKey.Builder(new Base64URL("n"), new Base64URL("e")).keyID("1").build()));
assertFalse(matcher.matches(new ECKey.Builder(ECKey.Curve.P_256, new Base64URL("x"), new Base64UR... | Base | 1 |
public static HColor unlinear(HColor color1, HColor color2, int completion) {
if (completion == 0) {
return color1;
}
if (completion == 100) {
return color2;
}
if (color1 instanceof HColorSimple && color2 instanceof HColorSimple) {
return HColorSimple.unlinear((HColorSimple) color1, (HColorSimple) c... | Base | 1 |
public boolean checkUrlParameter(String url)
{
if (url != null)
{
try
{
URL parsedUrl = new URL(url);
String protocol = parsedUrl.getProtocol();
String host = parsedUrl.getHost().toLowerCase();
return (protocol.equals("http") || protocol.equals("https"))
&& !host.endsWith(".internal")... | Base | 1 |
public void existingDocumentFromUI() throws Exception
{
// current document = xwiki:Main.WebHome
DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome");
XWikiDocument document = mock(XWikiDocument.class);
when(document.getDocumentRe... | Class | 2 |
public PersistedMapper persistMapper(String sessionId, String mapperId, Serializable mapper, int expirationTime) {
PersistedMapper m = new PersistedMapper();
m.setMapperId(mapperId);
Date currentDate = new Date();
m.setLastModified(currentDate);
if(expirationTime > 0) {
Calendar cal = Calendar.getInstance... | Base | 1 |
public void newDocumentButNonTerminalFromURL() throws Exception
{
// new document = xwiki:X.Y
DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("X"), "Y");
XWikiDocument document = mock(XWikiDocument.class);
when(document.getDocumentReference()).t... | Class | 2 |
public void testOfAsciiString() {
// Should produce a lower-cased AsciiString.
final AsciiString mixedCased = AsciiString.of("Foo");
assertThat((Object) HttpHeaderNames.of(mixedCased)).isNotSameAs(mixedCased);
assertThat(HttpHeaderNames.of(mixedCased).toString()).isEqualTo("foo");
... | Class | 2 |
public void testCurveCheckNegative_P256_attackPt1()
throws Exception {
// The malicious JWE contains a public key with order 113
String maliciousJWE = "eyJhbGciOiJFQ0RILUVTK0ExMjhLVyIsImVuYyI6IkExMjhDQkMtSFMyNTYiLCJlcGsiOnsia3R5IjoiRUMiLCJ4IjoiZ1RsaTY1ZVRRN3otQmgxNDdmZjhLM203azJVaURpRzJMcFlrV0FhRkpDYyIsInkiOi... | Base | 1 |
public void testSelectByOperationsNotSpecifiedOrSign() {
JWKSelector selector = new JWKSelector(new JWKMatcher.Builder().keyOperations(KeyOperation.SIGN, null).build());
List<JWK> keyList = new ArrayList<>();
keyList.add(new RSAKey.Builder(new Base64URL("n"), new Base64URL("e")).keyID("1")
.keyOperations(ne... | Base | 1 |
public static CharSequence createOptimized(String value) {
return io.netty.handler.codec.http.HttpHeaders.newEntity(value);
} | Class | 2 |
public void newDocumentFromURLTemplateProviderSpecifiedNonTerminalButOverriddenFromUITerminal() throws Exception
{
// new document = xwiki:X.Y
DocumentReference documentReference = new DocumentReference("xwiki", "X", "Y");
XWikiDocument document = mock(XWikiDocument.class);
when(... | Class | 2 |
public void headerMultipleContentLengthValidationShouldPropagate() {
LastInboundHandler inboundHandler = new LastInboundHandler();
request.addLong(HttpHeaderNames.CONTENT_LENGTH, 0);
request.addLong(HttpHeaderNames.CONTENT_LENGTH, 1);
Http2StreamChannel channel = newInboundStream(3, ... | Base | 1 |
public void performTest()
throws Exception
{
testKeyConversion();
testAdaptiveKeyConversion();
decodeTest();
testECDSA239bitPrime();
testECDSA239bitBinary();
testGeneration();
testKeyPairGenerationWithOIDs();
testNamedCurveParameterPreserva... | Base | 1 |
public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
Integer sc = (Integer) request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE);
String msg = (String) request.getAttribute(RequestDispatcher.ERROR_MESSAGE);
Throwable err =... | Base | 1 |
protected XMLReader createXMLReader() throws SAXException {
return SAXHelper.createXMLReader(isValidating());
} | Base | 1 |
public static int beta() {
final int beta = 1;
return beta;
} | Base | 1 |
private void handle(ServletRequestHandler pReqHandler,HttpServletRequest pReq, HttpServletResponse pResp) throws IOException {
JSONAware json = null;
try {
// Check access policy
requestHandler.checkAccess(allowDnsReverseLookup ? pReq.getRemoteHost() : null,
... | Base | 1 |
private final HColor getLineColor(ISkinParam skinParam, Style style) {
if (colors == null || colors.getColor(ColorType.LINE) == null) {
if (UseStyle.useBetaStyle() == false)
return HColorUtils.COL_038048;
return style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());... | Base | 1 |
static DataSource lookupDataSource(Hints hints) throws FactoryException {
Object hint = hints.get(Hints.EPSG_DATA_SOURCE);
if (hint instanceof DataSource) {
return (DataSource) hint;
} else if (hint instanceof String) {
String name = (String) hint;
Initial... | Class | 2 |
public void setExpirationTime(int expirationTime) {
this.expirationTime = expirationTime;
}
| Class | 2 |
protected String getExecutionPreamble()
{
if ( getWorkingDirectoryAsString() == null )
{
return null;
}
String dir = getWorkingDirectoryAsString();
StringBuilder sb = new StringBuilder();
sb.append( "cd " );
sb.append( unifyQuotes( dir ) );
... | Base | 1 |
public static Object readObject(XStream xStream, InputStream is) {
try(InputStreamReader isr = new InputStreamReader(is, ENCODING);) {
return xStream.fromXML(isr);
} catch (Exception e) {
throw new OLATRuntimeException(XStreamHelper.class,
"could not read Object from inputstream: " + is, e);
}
} | Base | 1 |
public void testDirectContextUsage() throws Exception {
assertThat(ConstraintViolations.format(validator.validate(new DirectContextExample())))
.containsExactlyInAnyOrder(FAILED_RESULT);
assertThat(TestLoggerFactory.getAllLoggingEvents())
.isEmpty();
} | Class | 2 |
public void cors() {
InputStream is = getClass().getResourceAsStream("/allow-origin1.xml");
PolicyRestrictor restrictor = new PolicyRestrictor(is);
assertTrue(restrictor.isCorsAccessAllowed("http://bla.com"));
assertFalse(restrictor.isCorsAccessAllowed("http://www.jolokia.org"));
... | Compound | 4 |
public static void loadBouncyCastle() {
new PersistedProperties(event -> {
//
});
} | Base | 1 |
public boolean isCorsAccessAllowed(String pOrigin) {
return corsChecker.check(pOrigin);
} | Compound | 4 |
public void switchToConversation(Conversation conversation, String text) {
switchToConversation(conversation, text, false, null, false);
} | Class | 2 |
public int hashCode()
{
return new HashCodeBuilder(17, 37)
.append(userReference)
.append(userEmail)
.append(verificationCode)
.toHashCode();
} | Base | 1 |
public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset,
byte[] ciphertext, int ciphertextOffset, int length)
throws ShortBufferException {
int space;
if (ciphertextOffset > ciphertext.length)
space = 0;
else
space = ciphertext.length - ciphertextOffset;
if (!haskey) {
// The k... | Base | 1 |
public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset,
byte[] ciphertext, int ciphertextOffset, int length)
throws ShortBufferException {
int space;
if (ciphertextOffset > ciphertext.length)
space = 0;
else
space = ciphertext.length - ciphertextOffset;
if (!haskey) {
// The k... | Base | 1 |
public boolean equals(Object o)
{
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DefaultResetPasswordRequestResponse that = (DefaultResetPasswordRequestResponse) o;
return new EqualsBuilder... | Base | 1 |
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// to get values from the login page
String userName = request.getParameter("aname");
String password = sha.getSHA(request.getParameter("pass"));
// String password = request.getParameter(... | Variant | 0 |
public void translate(ServerDifficultyPacket packet, GeyserSession session) {
SetDifficultyPacket setDifficultyPacket = new SetDifficultyPacket();
setDifficultyPacket.setDifficulty(packet.getDifficulty().ordinal());
session.sendUpstreamPacket(setDifficultyPacket);
session.getWorldCa... | Class | 2 |
public String getHeader(String name) {
//logger.info("Ineader .. parameter .......");
String value = super.getHeader(name);
if (value == null)
return null;
//logger.info("Ineader RequestWrapper ........... value ....");
return cleanXSS(value);
} | Base | 1 |
public Document read(InputStream in) throws DocumentException {
InputSource source = new InputSource(in);
if (this.encoding != null) {
source.setEncoding(this.encoding);
}
return read(source);
} | Base | 1 |
final void addObject(CharSequence name, Object... values) {
final AsciiString normalizedName = normalizeName(name);
requireNonNull(values, "values");
for (Object v : values) {
requireNonNullElement(values, v);
addObject(normalizedName, v);
}
} | Class | 2 |
public Response workspaceClientEnqueue(@FormParam(WorkSpaceAdapter.CLIENT_NAME) String clientName,
@FormParam(WorkSpaceAdapter.WORK_BUNDLE_OBJ) String workBundleString) {
logger.debug("TPWorker incoming execute! check prio={}", Thread.currentThread().getPriority());
// TODO Doesn't look ... | Base | 1 |
setImmediate(() => {
if (!this.pendingPublishRequestCount) {
return;
}
const starving_subscription = this._find_starving_subscription();
if (starving_subscription) {
doDebug && debugLog(chalk.bgWhite.red("feeding most late subscript... | Class | 2 |
public UPathHand(UPath source, Random rnd) {
final UPath result = new UPath();
Point2D last = new Point2D.Double();
for (USegment segment : source) {
final USegmentType type = segment.getSegmentType();
if (type == USegmentType.SEG_MOVETO) {
final double x = segment.getCoord()[0];
final double y ... | Base | 1 |
public void addViolation(String propertyName, Integer index, String message) {
violationOccurred = true;
String messageTemplate = escapeEl(message);
context.buildConstraintViolationWithTemplate(messageTemplate)
.addPropertyNode(propertyName)
.addBeanNode().inI... | Class | 2 |
public boolean isValid(Object value, ConstraintValidatorContext context) {
if (value != null && StringUtils.isNotEmpty(String.valueOf(value))) {
return true;
}
String errorMessage = String.format("Expected not empty value, got '%s'", value);
LOG.warn(errorMessage);
context.bui... | Class | 2 |
public CreateCommentResponse save(CreateCommentRequest createCommentRequest) {
CreateCommentResponse createCommentResponse = new CreateCommentResponse();
if (createCommentRequest.getLogId() != null && createCommentRequest.getComment() != null) {
if (isAllowComment(Integer.valueOf(createC... | Base | 1 |
public static void unzipFilesToPath(String jarPath, String destinationDir) throws IOException {
File file = new File(jarPath);
try (JarFile jar = new JarFile(file)) {
// fist get all directories,
// then make those directory on the destination Path
/*for (Enumera... | Base | 1 |
protected String getContent(SxSource sxSource, FilesystemExportContext exportContext)
{
String content;
// We know we're inside a SX file located at "<S|J>sx/<Space>/<Page>/<s|j>sx<NNN>.<css|js>". Inside this CSS
// there can be URLs and we need to ensure that the prefix for these URLs ... | Base | 1 |
public void translate(ServerEntityCollectItemPacket packet, GeyserSession session) {
// Collected entity is the other entity
Entity collectedEntity = session.getEntityCache().getEntityByJavaId(packet.getCollectedEntityId());
if (collectedEntity == null) return;
// Collector is the en... | Class | 2 |
public void testAddSelf() {
final HttpHeadersBase headers = newEmptyHeaders();
headers.add(headers);
} | Class | 2 |
private HColor getColor(ColorParam colorParam, Stereotype stereo) {
final ISkinParam skinParam = diagram.getSkinParam();
return rose.getHtmlColor(skinParam, stereo, colorParam);
} | Base | 1 |
public static Object instantiate(String classname, Properties info, boolean tryString,
@Nullable String stringarg)
throws ClassNotFoundException, SecurityException, NoSuchMethodException,
IllegalArgumentException, InstantiationException, IllegalAccessException,
InvocationTargetExceptio... | Class | 2 |
private DocumentReferenceResolver<String> getCurrentMixedDocumentReferenceResolver()
{
return Utils.getComponent(DocumentReferenceResolver.TYPE_STRING, CURRENT_MIXED_RESOLVER_HINT);
} | Class | 2 |
public void translate(ServerUnloadChunkPacket packet, GeyserSession session) {
session.getChunkCache().removeChunk(packet.getX(), packet.getZ());
//Checks if a skull is in an unloaded chunk then removes it
Iterator<Vector3i> iterator = session.getSkullCache().keySet().iterator();
wh... | Class | 2 |
public String toString() {
if (query == null) {
return path;
}
return path + "?" + query;
} | Base | 1 |
public void translate(ServerEntityVelocityPacket packet, GeyserSession session) {
Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId());
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
entity = session.getPlayerEntity();
}
... | Class | 2 |
private JsonNode yamlStreamToJson(InputStream yamlStream) {
Yaml reader = new Yaml();
ObjectMapper mapper = new ObjectMapper();
return mapper.valueToTree(reader.load(yamlStream));
} | Base | 1 |
public void testGetChunk() throws Exception {
TestHttpData test = new TestHttpData("test", UTF_8, 0);
try {
File tmpFile = File.createTempFile(UUID.randomUUID().toString(), ".tmp");
tmpFile.deleteOnExit();
FileOutputStream fos = new FileOutputStream(tmpFile);
... | Base | 1 |
public File loadOrDownload(String databaseType, String driverFileUrl) {
String filePath = driverFilePath(driverBaseDirectory, databaseType);
Path path = Path.of(filePath);
if (Files.exists(path)) {
// ignore
log.debug("{} already exists, ignore download from {}", file... | Class | 2 |
public Directory read(final ImageInputStream input) throws IOException {
Validate.notNull(input, "input");
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
try {
// TODO: Consider parsing using SAX?
// T... | Base | 1 |
public void addViolation(String message) {
violationOccurred = true;
String messageTemplate = escapeEl(message);
context.buildConstraintViolationWithTemplate(messageTemplate)
.addConstraintViolation();
} | Class | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.