code
stringlengths
12
2.05k
label_name
stringclasses
5 values
label
int64
0
4
public void existingDocumentNonTerminalFromUIDeprecated() throws Exception { // current document = xwiki:Main.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class); when(d...
Class
2
public void translate(ServerOpenWindowPacket packet, GeyserSession session) { if (packet.getWindowId() == 0) { return; } InventoryTranslator newTranslator = InventoryTranslator.INVENTORY_TRANSLATORS.get(packet.getType()); Inventory openInventory = session.getOpenInventor...
Class
2
public void afterClearHeadersShouldBeEmpty() { final HttpHeadersBase headers = newEmptyHeaders(); headers.add("name1", "value1"); headers.add("name2", "value2"); assertThat(headers.size()).isEqualTo(2); headers.clear(); assertThat(headers.size()).isEqualTo(0); ...
Class
2
public int decryptWithAd(byte[] ad, byte[] ciphertext, int ciphertextOffset, byte[] plaintext, int plaintextOffset, int length) throws ShortBufferException, BadPaddingException { int space; if (ciphertextOffset > ciphertext.length) space = 0; else space = ciphertext.length - ciphertextOffset; if (l...
Base
1
public BCXMSSPrivateKey(PrivateKeyInfo keyInfo) throws IOException { XMSSKeyParams keyParams = XMSSKeyParams.getInstance(keyInfo.getPrivateKeyAlgorithm().getParameters()); this.treeDigest = keyParams.getTreeDigest().getAlgorithm(); XMSSPrivateKey xmssPrivateKey = XMSSPrivateKey....
Base
1
public static Object deserialize(final String s) { ObjectInputStream ois = null; try { ois = new ObjectInputStream(new ByteArrayInputStream(s.getBytes("8859_1"))); return ois.readObject(); } catch (Exception e) { logger.error("Cannot deserialize payload us...
Base
1
public void drawU(UGraphic ug) { ug = ug.apply(backColor.bg()).apply(borderColor); final URectangle rect = new URectangle(dim.getWidth(), dim.getHeight()).rounded(rounded); rect.setDeltaShadow(shadowing); ug.apply(stroke).draw(rect); final double yLine = titleHeight + attributeHeight; ug = ug.apply(imgBa...
Base
1
public XssHttpServletRequestWrapper(HttpServletRequest request) { super(request); }
Base
1
public DefaultFileSystemResourceLoader(Path path) { this.baseDirPath = Optional.of(path); }
Base
1
final protected CommandExecutionResult executeArg(TimingDiagram diagram, LineLocation location, RegexResult arg) { final String compact = arg.get("COMPACT", 0); final String code = arg.get("CODE", 0); final String full = arg.get("FULL", 0); return diagram.createBinary(code, full, compact != null); }
Base
1
public void translate(ServerPlayerHealthPacket packet, GeyserSession session) { SessionPlayerEntity entity = session.getPlayerEntity(); int health = (int) Math.ceil(packet.getHealth()); SetHealthPacket setHealthPacket = new SetHealthPacket(); setHealthPacket.setHealth(health); ...
Class
2
public void translate(ServerEntityTeleportPacket packet, GeyserSession session) { Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId()); if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); } ...
Class
2
protected Response attachToPost(Long messageKey, String filename, InputStream file, HttpServletRequest request) { //load message Message mess = fom.loadMessage(messageKey); if(mess == null) { return Response.serverError().status(Status.NOT_FOUND).build(); } if(!forum.equalsByPersistableKey(mess.getForum(...
Base
1
callback: (request: PublishRequest, response: PublishResponse) => void;
Class
2
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 key ...
Base
1
public void addViolation(String propertyName, String message) { violationOccurred = true; String messageTemplate = escapeEl(message); context.buildConstraintViolationWithTemplate(messageTemplate) .addPropertyNode(propertyName) .addConstraintViolation(); }
Class
2
public boolean matches(ConditionContext context) { BeanContext beanContext = context.getBeanContext(); if (beanContext instanceof ApplicationContext) { List<String> paths = ((ApplicationContext) beanContext) .getEnvironment() .getProperty(FileWatch...
Class
2
private X509TrustManager createTrustManager() { X509TrustManager trustManager = new X509TrustManager() { /** * {@InheritDoc} * * @see javax.net.ssl.X509TrustManager#checkClientTrusted(java.security.cert.X509Certificate[], java.lang.String) */ public void checkClientTrusted...
Class
2
public SecretKey deriveKey(final SecretKey sharedSecret, final int keyLengthBits, final byte[] otherInfo) throws JOSEException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); final MessageDigest md = getMessageDigest(); for (int i=1; i <= computeDigestCycles(ByteUtils.bitLength(md....
Class
2
public void testGetBytesAndSetBytesWithFileChannel() throws IOException { File file = File.createTempFile("file-channel", ".tmp"); RandomAccessFile randomAccessFile = null; try { randomAccessFile = new RandomAccessFile(file, "rw"); FileChannel channel = randomAccessFi...
Base
1
public void translate(ServerPlayerActionAckPacket packet, GeyserSession session) { ChunkUtils.updateBlock(session, packet.getNewState(), packet.getPosition()); if (packet.getAction() == PlayerAction.START_DIGGING && !packet.isSuccessful()) { LevelEventPacket stopBreak = new LevelEventPac...
Class
2
public boolean archiveNodeData(Locale locale, ICourse course, ArchiveOptions options, ZipOutputStream exportStream, String archivePath, String charset) { String filename = "checklist_" + StringHelper.transformDisplayNameToFileSystemName(getShortName()) + "_" + Formatter.formatDatetimeFilesystemSave(new Da...
Base
1
public static String serializeToString(final Object payload) throws IOException { final ByteArrayOutputStream bos = new ByteArrayOutputStream(); serializeToStream(bos, payload); String agentData = null; try { agentData = bos.toString("8859_1"); } catch (Unsupporte...
Base
1
protected boolean evaluate(InputSource inputSource) { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); DocumentBuilder dbuilder = factory.newDocumentBuilder(); Document doc = dbuilder.parse(inputSource); ...
Base
1
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { String filename = file.getFileName().toString(); Path normalizedPath = file.normalize(); if(!normalizedPath.startsWith(destDir)) { throw new IOException("Invalid ZIP"); } if(filename.endsWith(...
Base
1
public static OHttpSessionManager getInstance() { return instance; }
Class
2
public void testMatchUseNotSpecifiedOrSignature() { JWKMatcher matcher = new JWKMatcher.Builder().keyUses(KeyUse.SIGNATURE, null).build(); assertTrue(matcher.matches(new RSAKey.Builder(new Base64URL("n"), new Base64URL("e")).keyID("1").keyUse(KeyUse.SIGNATURE).build())); assertTrue(matcher.matches(new ECKey.Bu...
Base
1
void rawUnicode() { // 2- and 3-byte UTF-8 final PathAndQuery res1 = PathAndQuery.parse("/\u00A2?\u20AC"); // ¢ and € assertThat(res1).isNotNull(); assertThat(res1.path()).isEqualTo("/%C2%A2"); assertThat(res1.query()).isEqualTo("%E2%82%AC"); // 4-byte UTF-8 ...
Base
1
public void setIgnoreComments(boolean ignoreComments) { this.ignoreComments = ignoreComments; }
Base
1
public void translate(ServerSpawnParticlePacket packet, GeyserSession session) { Function<Vector3f, BedrockPacket> particleCreateFunction = createParticle(session, packet.getParticle()); if (particleCreateFunction != null) { if (packet.getAmount() == 0) { // 0 means don't...
Class
2
public static Document parseText(String text) throws DocumentException { SAXReader reader = new SAXReader(); try { reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); reader.setFeature("http://xml.org/sax/features/external-general-entit...
Base
1
private X509HostnameVerifier createHostNameVerifier() { X509HostnameVerifier verifier = new X509HostnameVerifier() { /** * {@InheritDoc} * * @see org.apache.http.conn.ssl.X509HostnameVerifier#verify(java.lang.String, javax.net.ssl.SSLSocket) */ public void verify(String ho...
Class
2
public static void execute(String url, String proxyHost, int proxyPort, String proxyUsername, String proxyPassword, String accessToken, String orgName, String moduleName, String version, Path baloPath) { initializeSsl(); HttpURLConnection conn = createHttpUrlConnection(convertToUrl(url),...
Base
1
private Certificate toCertificate(KeyDescriptorType keyDescriptorType) { try { List<Object> keyData = keyDescriptorType.getKeyInfo().getContent(); for (Object keyDatum : keyData) { if (keyDatum instanceof JAXBElement<?>) { JAXBElement<?> element = (JAXBElement<?>) keyDatum; ...
Base
1
void requestResetPasswordNoEmail() throws Exception { when(this.userManager.exists(this.userReference)).thenReturn(true); String exceptionMessage = "User has no email address."; when(this.localizationManager.getTranslationPlain("xe.admin.passwordReset.error.noEmail")) .thenRe...
Base
1
private String marshallToString(Document document) throws TransformerException { StringWriter sw = new StringWriter(); TransformerFactory tf = TransformerFactory.newInstance(); Transformer transformer = tf.newTransformer(); transformer.transform(new DOMSource(document), new StreamResult(sw)); retu...
Base
1
public void testMatchOperation() { JWKMatcher matcher = new JWKMatcher.Builder().keyOperation(KeyOperation.DECRYPT).build(); assertTrue(matcher.matches(new RSAKey.Builder(new Base64URL("n"), new Base64URL("e")).keyID("1") .keyOperations(new HashSet<>(Collections.singletonList(KeyOperation.DECRYPT))).build()))...
Base
1
public Document read(URL url) throws DocumentException { String systemID = url.toExternalForm(); InputSource source = new InputSource(systemID); if (this.encoding != null) { source.setEncoding(this.encoding); } return read(source); }
Base
1
public void translate(ServerEntityHeadLookPacket packet, GeyserSession session) { Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId()); if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); } ...
Class
2
private Runnable getDiscoveryRequestSetup(final String url) { return new Runnable() { public void run() { expect(request.getHeader("Origin")).andStubReturn(null); expect(request.getHeader("Referer")).andStubReturn(null); expect(request.getRemoteHos...
Base
1
public void checkConnection(UrlArgument repositoryURL) { execute(createCommandLine("hg").withArgs("id", "--id").withArg(repositoryURL).withNonArgSecrets(secrets).withEncoding("utf-8"), new NamedProcessTag(repositoryURL.forDisplay())); }
Class
2
public void newDocumentWebHomeFromURLTemplateProviderSpecifiedTerminal() throws Exception { // new document = xwiki:X.Y.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("X", "Y"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class); ...
Class
2
public static ResourceEvaluation evaluate(File file, String filename) { ResourceEvaluation eval = new ResourceEvaluation(); try { ImsManifestFileFilter visitor = new ImsManifestFileFilter(); Path fPath = PathUtils.visit(file, filename, visitor); if(visitor.isValid()) { Path realManifestPath = visitor....
Base
1
public InputSource resolveEntity(String publicId, String systemId) { // try create a relative URI reader... if ((systemId != null) && (systemId.length() > 0)) { if ((uriPrefix != null) && (systemId.indexOf(':') <= 0)) { systemId = uriPrefix + systemId;...
Base
1
public void setIncludeInternalDTDDeclarations(boolean include) { this.includeInternalDTDDeclarations = include; }
Base
1
public void resetPassword(UserReference userReference, String newPassword) throws ResetPasswordException { this.checkUserReference(userReference); XWikiContext context = this.contextProvider.get(); DocumentUserReference documentUserReference = (DocumentUserReference) userReferen...
Base
1
public void translate(FilterTextPacket packet, GeyserSession session) { if (session.getOpenInventory() instanceof CartographyContainer) { // We don't want to be able to rename in the cartography table return; } packet.setFromServer(true); session.sendUpstreamP...
Class
2
public static String getAttachedFilePath(String inputStudyOid) { // Using a standard library to validate/Sanitize user inputs which will be used in path expression to prevent from path traversal String studyOid = FilenameUtils.getName(inputStudyOid); String attachedFilePath = CoreResources.getFie...
Base
1
public void corsWildCard() { InputStream is = getClass().getResourceAsStream("/allow-origin2.xml"); PolicyRestrictor restrictor = new PolicyRestrictor(is); assertTrue(restrictor.isCorsAccessAllowed("http://bla.com")); assertTrue(restrictor.isCorsAccessAllowed("http://www.jolokia.org...
Compound
4
public byte[] toByteArray() { /* index || secretKeySeed || secretKeyPRF || publicSeed || root */ int n = params.getDigestSize(); int indexSize = (params.getHeight() + 7) / 8; int secretKeySize = n; int secretKeyPRFSize = n; int publicSeedSize = n; int rootSize =...
Base
1
protected SymbolContext getContextLegacy() { return new SymbolContext(HColorUtils.COL_D7E0F2, HColorUtils.COL_038048).withStroke(new UStroke(1.5)); }
Base
1
public void existingDocumentFromUITemplateProviderSpecifiedTerminal() throws Exception { // current document = xwiki:Main.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class); ...
Class
2
public SecureIntrospector(String[] badClasses, String[] badPackages, Logger log) { super(badClasses, badPackages, log); this.secureClassMethods.add("getname"); this.secureClassMethods.add("getName"); this.secureClassMethods.add("getsimpleName"); this.secureClassMethods.a...
Class
2
public void spliceToFile() throws Throwable { EventLoopGroup group = new EpollEventLoopGroup(1); File file = File.createTempFile("netty-splice", null); file.deleteOnExit(); SpliceHandler sh = new SpliceHandler(file); ServerBootstrap bs = new ServerBootstrap(); bs.cha...
Base
1
protected void showCreateContactDialog(final String prefilledJid, final Invite invite) { FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); Fragment prev = getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG_DIALOG); if (prev != null) { ft.remove(prev); } ft.addToBackStack(nul...
Class
2
private static AsciiString create(String name) { return AsciiString.cached(Ascii.toLowerCase(name)); }
Class
2
public void initWithCustomLogHandler() throws Exception { servlet = new AgentServlet(); config = createMock(ServletConfig.class); context = createMock(ServletContext.class); HttpTestUtil.prepareServletConfigMock(config, new String[]{ConfigKey.LOGHANDLER_CLASS.getKeyValue(), CustomLo...
Compound
4
public void subValidateFail(ViolationCollector col) { col.addViolation(FAILED+"subclass"); }
Class
2
public ResetPasswordRequestResponse requestResetPassword(UserReference userReference) throws ResetPasswordException { this.checkUserReference(userReference); UserProperties userProperties = this.userPropertiesResolver.resolve(userReference); InternetAddress email = userProperties.getEma...
Base
1
public void existingDocumentFromUITemplateProviderSpecifiedButOldSpaceType() throws Exception { // current document = xwiki:Main.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome"); XWikiDocument document = mock(XWikiDocument.cla...
Class
2
void semicolon() { final PathAndQuery res = PathAndQuery.parse("/;?a=b;c=d"); assertThat(res).isNotNull(); assertThat(res.path()).isEqualTo("/;"); assertThat(res.query()).isEqualTo("a=b;c=d"); // '%3B' in a query string should never be decoded into ';'. final PathAnd...
Base
1
public void newDocumentWebHomeFromURL() throws Exception { // new document = xwiki:X.Y.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("X", "Y"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class); when(document.getDocumentRe...
Class
2
public Media createMedia(String title, String description, Object mediaObject, String businessPath, Identity author) { Media media = null; if (mediaObject instanceof EfficiencyStatement) { EfficiencyStatement statement = (EfficiencyStatement) mediaObject; String xml = myXStream.toXML(statement); media = ...
Base
1
private List<GlossaryItem> loadGlossaryItemListFromFile(VFSLeaf glossaryFile) { List<GlossaryItem> glossaryItemList = new ArrayList<>(); if (glossaryFile == null) { return new ArrayList<>(); } Object glossObj = XStreamHelper.readObject(xstreamReader, glossaryFile); if (glossObj instanceof ArrayList) { Ar...
Base
1
public OHttpSession removeSession(final String iSessionId) { acquireExclusiveLock(); try { return sessions.remove(iSessionId); } finally { releaseExclusiveLock(); } }
Class
2
void checkVerificationCodeUnexistingUser() { when(this.userReference.toString()).thenReturn("user:Foobar"); when(this.userManager.exists(this.userReference)).thenReturn(false); String exceptionMessage = "User [user:Foobar] doesn't exist"; when(this.localizationManager.getTranslat...
Base
1
public static HttpURLConnection createHttpUrlConnection(URL url, String proxyHost, int proxyPort, String proxyUsername, String proxyPassword) { try { Proxy proxy = getProxy(proxyHost, proxyPort, proxyUsername, proxyPassword); // set proxy if exists. if (proxy ...
Base
1
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 translate(EmotePacket packet, GeyserSession session) { if (session.getConnector().getConfig().getEmoteOffhandWorkaround() != EmoteOffhandWorkaroundOption.DISABLED) { // Activate the workaround - we should trigger the offhand now ClientPlayerActionPacket swapHandsPacket = ...
Class
2
public CommandExecutionResult createRobustConcise(String code, String full, TimingStyle type, boolean compact) { final Player player = new PlayerRobustConcise(type, full, getSkinParam(), ruler, compactByDefault || compact); players.put(code, player); lastPlayer = player; return CommandExecutionResult.ok(); }
Base
1
public void testWhitespaceBeforeTransferEncoding01() { String requestStr = "GET /some/path HTTP/1.1\r\n" + " Transfer-Encoding : chunked\r\n" + "Content-Length: 1\r\n" + "Host: netty.io\r\n\r\n" + "a"; testInvalidHeaders0(requestStr); ...
Base
1
public SpotProtocolDecoder(Protocol protocol) { super(protocol); try { documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); xPath = XPathFactory.newInstance().newXPath(); messageExpression = xPath.compile("//messageList/message"); }...
Base
1
public int size() { return ByteUtils.bitLength(n.decode()); }
Class
2
public void corsAccessCheck() { BackendManager backendManager = new BackendManager(config,log); assertTrue(backendManager.isCorsAccessAllowed("http://bla.com")); backendManager.destroy(); }
Compound
4
public void testNotThrowWhenConvertFails() { final HttpHeadersBase headers = newEmptyHeaders(); headers.set("name1", ""); assertThat(headers.getInt("name1")).isNull(); assertThat(headers.getInt("name1", 1)).isEqualTo(1); assertThat(headers.getDouble("name")).isNull(); ...
Class
2
protected BigInteger chooseRandomPrime(int bitlength, BigInteger e, BigInteger sqrdBound) { int iterations = getNumberOfIterations(bitlength, param.getCertainty()); for (int i = 0; i != 5 * bitlength; i++) { BigInteger p = new BigInteger(bitlength, 1, param.getRandom()); ...
Class
2
public void existingDocumentFromUITopLevelDocument() throws Exception { // current document = xwiki:Main.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class); when(docume...
Class
2
public SAXReader(String xmlReaderClassName, boolean validating) throws SAXException { if (xmlReaderClassName != null) { this.xmlReader = XMLReaderFactory .createXMLReader(xmlReaderClassName); } this.validating = validating; }
Base
1
public Collection<StyleSignatureBasic> toSignatures() { List<StyleSignatureBasic> results = new ArrayList<>(Collections.singletonList(StyleSignatureBasic.empty())); boolean star = false; for (Iterator<String> it = data.iterator(); it.hasNext();) { String s = it.next(); if (s.endsWith("*")) { star = tru...
Base
1
public void testCurveCheckNegative_P256_attackPt2() throws Exception { // The malicious JWE contains a public key with order 2447 String maliciousJWE = "eyJhbGciOiJFQ0RILUVTK0ExMjhLVyIsImVuYyI6IkExMjhDQkMtSFMyNTYiLCJlcGsiOnsia3R5IjoiRUMiLCJ4IjoiWE9YR1E5XzZRQ3ZCZzN1OHZDSS1VZEJ2SUNBRWNOTkJyZnFkN3RHN29RNCIsInkiO...
Base
1
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 void translate(ServerSpawnPaintingPacket packet, GeyserSession session) { Vector3f position = Vector3f.from(packet.getPosition().getX(), packet.getPosition().getY(), packet.getPosition().getZ()); PaintingEntity entity = new PaintingEntity(packet.getEntityId(), session.getEnti...
Class
2
void noEncoding() { final PathAndQuery res = PathAndQuery.parse("/a?b=c"); assertThat(res).isNotNull(); assertThat(res.path()).isEqualTo("/a"); assertThat(res.query()).isEqualTo("b=c"); }
Base
1
public void multipleValuesPerNameIterator() { final HttpHeadersBase headers = newEmptyHeaders(); headers.add("name1", "value1"); headers.add("name1", "value2"); assertThat(headers.size()).isEqualTo(2); final List<String> values = ImmutableList.copyOf(headers.valueIterator("n...
Class
2
private void ensureInitialized() throws SQLException { if (!initialized) { throw new PSQLException( GT.tr( "This SQLXML object has not been initialized, so you cannot retrieve data from it."), PSQLState.OBJECT_NOT_IN_STATE); } // Is anyone loading data into us at t...
Base
1
private static File newFile() throws IOException { File file = File.createTempFile("netty-", ".tmp"); file.deleteOnExit(); final FileOutputStream out = new FileOutputStream(file); out.write(data); out.close(); return file; }
Base
1
public static SecretKey deriveSharedSecret(final ECPublicKey publicKey, final ECPrivateKey privateKey, final Provider provider) throws JOSEException { // Get an ECDH key agreement instance from the JCA provider KeyAgreement keyAgreement; try { if (provider != null) { keyAgreement = K...
Base
1
public void translate(PacketViolationWarningPacket packet, GeyserSession session) { // Not translated since this is something that the developers need to know session.getConnector().getLogger().error("Packet violation warning sent from client! " + packet.toString()); }
Class
2
public void testFileRegionCountLargerThenFile(ServerBootstrap sb, Bootstrap cb) throws Throwable { File file = File.createTempFile("netty-", ".tmp"); file.deleteOnExit(); final FileOutputStream out = new FileOutputStream(file); out.write(data); out.close(); sb.child...
Base
1
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...
Compound
4
public void existingDocumentFromUITemplateProviderExistingButNoneSelected() throws Exception { // current document = xwiki:Main.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome"); XWikiDocument document = mock(XWikiDocument.clas...
Class
2
private <T> byte[] marshallToBytes(JAXBElement<T> object, Class<T> type) throws SAMLException { try { JAXBContext context = JAXBContext.newInstance(type); Marshaller marshaller = context.createMarshaller(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); marshaller.marshal(object...
Base
1
void percent() { final PathAndQuery res = PathAndQuery.parse("/%25"); assertThat(res).isNotNull(); assertThat(res.path()).isEqualTo("/%25"); assertThat(res.query()).isNull(); }
Base
1
public URIDryConverter(URI base, Map<PackageID, Manifest> dependencyManifests, boolean isBuild) { super(base, dependencyManifests, isBuild); this.base = URI.create(base.toString() + "/modules/info/"); try { SSLContext sc = SSLContext.getInstance("SSL"); sc.init(null, ...
Base
1
public void configure(ServletContextHandler context) { context.setContextPath("/"); context.getSessionHandler().setMaxInactiveInterval(serverConfig.getSessionTimeout()); context.setInitParameter(EnvironmentLoader.ENVIRONMENT_CLASS_PARAM, DefaultWebEnvironment.class.getName()); context.addEventListener(ne...
Base
1
public void withRestrictor() throws InvalidSyntaxException, MalformedObjectNameException { setupRestrictor(new InnerRestrictor(true,false,true,false,true,false,true)); assertTrue(restrictor.isHttpMethodAllowed(HttpMethod.GET)); assertFalse(restrictor.isTypeAllowed(RequestType.EXEC)); ...
Compound
4
final protected FontConfiguration getFontConfiguration() { if (UseStyle.useBetaStyle() == false) return FontConfiguration.create(skinParam, FontParam.TIMING, null); return FontConfiguration.create(skinParam, StyleSignatureBasic.of(SName.root, SName.element, SName.timingDiagram) .getMergedStyle(skinParam.get...
Base
1
private DefaultHttpClient makeHttpClient() { DefaultHttpClient defaultHttpClient = new DefaultHttpClient(); try { logger.debug("Installing forgiving hostname verifier and trust managers"); X509TrustManager trustManager = createTrustManager(); X509HostnameVerifier hostNameVerifier = createHo...
Class
2
public static byte[] decryptAuthenticated(final SecretKey secretKey, final byte[] iv, final byte[] cipherText, final byte[] aad, final byte[] authTag, ...
Base
1
public static <T> T throw0(Throwable throwable) { if (throwable == null) throw new NullPointerException(); getUnsafe().throwException(throwable); throw new RuntimeException(); }
Class
2