code stringlengths 12 2.05k | label_name stringclasses 5
values | label int64 0 4 |
|---|---|---|
public void existingDocumentFromUITemplateProviderSpecifiedRestrictionExistsOnParentSpace() throws Exception
{
// current document = xwiki:Main.WebHome
DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome");
XWikiDocument document = mock(XW... | Class | 2 |
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession session = request.getSession(false);
if (session == null) {
AccessControlContext acc = AccessController.getContext();
Subject subject = Subject.getS... | Compound | 4 |
private static boolean pathContainsDoubleDots(Bytes path) {
final int length = path.length;
byte b0 = 0;
byte b1 = 0;
byte b2 = '/';
for (int i = 1; i < length; i++) {
final byte b3 = path.data[i];
if (b3 == '/' && b2 == '.' && b1 == '.' && b0 == '/') ... | Base | 1 |
public void iterateEmptyHeadersShouldThrow() {
final Iterator<Map.Entry<AsciiString, String>> iterator = newEmptyHeaders().iterator();
assertThat(iterator.hasNext()).isFalse();
iterator.next();
} | Class | 2 |
public static final Binder fromPath(Path path)
throws IOException {
try(InputStream inStream = Files.newInputStream(path)) {
return (Binder)myStream.fromXML(inStream);
} catch (Exception e) {
log.error("Cannot import this map: " + path, e);
return null;
}
} | Base | 1 |
private void populateAuthCacheInAllPeers(AuthorizationContext authContext) throws Throwable {
// send a GET request to the ExampleService factory to populate auth cache on each peer.
// since factory is not OWNER_SELECTION service, request goes to the specified node.
for (VerificationHost p... | Class | 2 |
public void testWrapMemoryMapped() throws Exception {
File file = File.createTempFile("netty-test", "tmp");
FileChannel output = null;
FileChannel input = null;
ByteBuf b1 = null;
ByteBuf b2 = null;
try {
output = new RandomAccessFile(file, "rw").getChann... | Base | 1 |
private File tempFile() throws IOException {
String newpostfix;
String diskFilename = getDiskFilename();
if (diskFilename != null) {
newpostfix = '_' + diskFilename;
} else {
newpostfix = getPostfix();
}
File tmpFile;
if (getBaseDirecto... | Base | 1 |
public void iteratorShouldReturnAllNameValuePairs() {
final HttpHeadersBase headers1 = newEmptyHeaders();
headers1.add("name1", "value1", "value2");
headers1.add("name2", "value3");
headers1.add("name3", "value4", "value5", "value6");
headers1.add("name1", "value7", "value8")... | Class | 2 |
public void testRejectECJWKWithUnsupportedCurve()
throws Exception {
KeyPair keyPair = createUnsupportedECKeyPair();
ECPublicKey ecPublicKey = (ECPublicKey)keyPair.getPublic();
ECPrivateKey ecPrivateKey = (ECPrivateKey)keyPair.getPrivate();
ECKey ecJWK = new ECKey.Builder(new ECKey.Curve("P-224"), ecPublic... | Base | 1 |
protected StyleSignatureBasic getStyleSignature() {
return StyleSignatureBasic.of(SName.root, SName.element, SName.timingDiagram, SName.binary);
} | Base | 1 |
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 |
private String getTitleQTI12(QuestionItemImpl item) {
try {
VFSLeaf leaf = qpoolService.getRootLeaf(item);
Item xmlItem = QTIEditHelper.readItemXml(leaf);
return xmlItem.getTitle();
} catch (NullPointerException e) {
log.warn("Cannot read files from dir: " + item.getDirectory());
}
return null;
} | Base | 1 |
public PlayerBinary(String code, ISkinParam skinParam, TimingRuler ruler, boolean compact) {
super(code, skinParam, ruler, compact);
this.style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder());
this.suggestedHeight = 30;
} | Base | 1 |
DefaultResetPasswordRequestResponse(UserReference reference, InternetAddress userEmail, String verificationCode)
{
this.userReference = reference;
this.userEmail = userEmail;
this.verificationCode = verificationCode;
} | Base | 1 |
public Map<String, FileEntry> generatorCode(TableDetails tableDetails, String tablePrefix,
Map<String, String> customProperties, List<TemplateFile> templateFiles) {
Map<String, FileEntry> map = new HashMap<>(templateFiles.size());
// 模板渲染
Map<String, Object> context = GenUtils.getContext(tableDetails, table... | Class | 2 |
void validSaveNewTranslation() throws Exception
{
when(mockForm.getLanguage()).thenReturn("fr");
when(mockClonedDocument.getTranslatedDocument("fr", this.context)).thenReturn(mockClonedDocument);
when(mockClonedDocument.getDocumentReference()).thenReturn(new DocumentReference("xwiki", "M... | Class | 2 |
public boolean loginValidate(String userName, String password) {
String sql = "select * from admin_table where admin_name=? and password=?";
try {
ps=DbUtil.getConnection().prepareStatement(sql);
ps.setString(1, userName);
ps.setString(2,password);
ResultSet rs =ps.executeQuery();
if (rs.next()) {
... | Variant | 0 |
protected String getCorsDomain(String referer, String userAgent)
{
String dom = null;
if (referer != null && referer.toLowerCase()
.matches("https?://([a-z0-9,-]+[.])*draw[.]io/.*"))
{
dom = referer.toLowerCase().substring(0,
referer.indexOf(".draw.io/") + 8);
}
else if (referer != null && refe... | Base | 1 |
public void testSetNullHeaderValue() {
final HttpHeadersBase headers = newEmptyHeaders();
headers.set("test", (String) null);
} | Class | 2 |
public static AlgorithmMode resolveAlgorithmMode(final JWEAlgorithm alg)
throws JOSEException {
if (alg.equals(JWEAlgorithm.ECDH_ES)) {
return AlgorithmMode.DIRECT;
} else if (alg.equals(JWEAlgorithm.ECDH_ES_A128KW) ||
alg.equals(JWEAlgorithm.ECDH_ES_A192KW) ||
alg.equals(JWEAlgorithm.ECDH_ES_A256KW)... | Base | 1 |
public void install(
String displayName, String description, String[] dependencies,
String account, String password, String config) throws URISyntaxException {
String javaHome = System.getProperty("java.home");
String javaBinary = javaHome + "\\bin\\java.exe";
File ... | Base | 1 |
public RechnungCostEditTablePanel(final String id)
{
super(id);
feedbackPanel = new FeedbackPanel("feedback");
ajaxComponents.register(feedbackPanel);
add(feedbackPanel);
this.form = new Form<AbstractRechnungsPositionDO>("form");
add(form);
rows = new RepeatingView("rows");
form.add(... | Compound | 4 |
public boolean isValid(Integer value, ConstraintValidatorContext context) {
if (proxyManager.get(value) != null) {
return true;
}
String errorMessage = String.format("No proxy server found for specified port %d", value);
LOG.warn(errorMessage);
context.buildConstraintViolatio... | Class | 2 |
public void translate(MapInfoRequestPacket packet, GeyserSession session) {
long mapId = packet.getUniqueMapId();
ClientboundMapItemDataPacket mapPacket = session.getStoredMaps().remove(mapId);
if (mapPacket != null) {
// Delay the packet 100ms to prevent the client from ignorin... | Class | 2 |
void relative() {
assertThat(PathAndQuery.parse("foo")).isNull();
} | Base | 1 |
protected SAXContentHandler createContentHandler(XMLReader reader) {
return new SAXContentHandler(getDocumentFactory(), dispatchHandler);
} | Base | 1 |
public void testSetSelfIsNoOp() {
final HttpHeadersBase headers = newEmptyHeaders();
headers.add("name", "value");
headers.set(headers);
assertThat(headers.size()).isEqualTo(1);
} | 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 |
protected void traceLdapEnv(Properties env)
{
if (trace)
{
Properties tmp = new Properties();
tmp.putAll(env);
String credentials = tmp.getProperty(Context.SECURITY_CREDENTIALS);
String bindCredential = tmp.getProperty(BIND_CREDENTIAL);
if (credentials != n... | Class | 2 |
private void initAndSaveDocument(XWikiContext context, XWikiDocument newDocument, String title, String template,
String parent) throws XWikiException
{
XWiki xwiki = context.getWiki();
// Set the locale and default locale, considering that we're creating the original version of the docu... | 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 |
private CallbackHandler getCallbackHandler(
@UnderInitialization(WrappedFactory.class) LibPQFactory this,
Properties info) throws PSQLException {
// Determine the callback handler
CallbackHandler cbh;
String sslpasswordcallback = PGProperty.SSL_PASSWORD_CALLBACK.get(info);
if (sslpasswordc... | Class | 2 |
public static boolean isAbsolute(String url)
{
if (url.startsWith("//")) // //www.domain.com/start
{
return true;
}
if (url.startsWith("/")) // /somePage.html
{
return false;
}
boolean result = false;
try
{
URI uri = new URI(url);
result = uri.isAbsolute();
}
catch (URISyntax... | Base | 1 |
protected void runTeardown() {
Assert.assertTrue("HTTP connection is not allowed", messagedAccessDenied);
} | Class | 2 |
public void setXMLReader(XMLReader reader) {
this.xmlReader = reader;
} | Base | 1 |
public String findFilter( String url_suffix )
{
if( url_suffix == null )
{
throw new IllegalArgumentException( "The url_suffix must not be null." );
}
CaptureType type = em.find( CaptureType.class, url_suffix );
if( type != null )
{
... | Class | 2 |
default boolean contains(String name) {
return get(name, Object.class).isPresent();
} | Class | 2 |
public int getPosition()
{
if ( realPos == -1 )
{
realPos = ( getExecutable() == null ? 0 : 1 );
for ( int i = 0; i < position; i++ )
{
Arg arg = (Arg) arguments.elementAt( i );
realPos += arg... | Base | 1 |
private String tryRewrite(String s) throws IOException, InvalidKeyException {
if (s.length()<24)
return s; // Encrypting "" in Secret produces 24-letter characters, so this must be the minimum length
if (!isBase64(s))
return s; // decode throws IOException if the input is... | Class | 2 |
public void translate(ServerEntityAttachPacket packet, GeyserSession session) {
Entity holderId;
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
holderId = session.getPlayerEntity();
} else {
holderId = session.getEntityCache().getEntityByJavaI... | Class | 2 |
protected TestPolicy(Policy.ParseContext parseContext) throws PolicyException {
super(parseContext);
} | 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 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.hasManifest()) {
Path realManifestPath = visi... | Base | 1 |
private byte[] decodeAndInflate(String encodedRequest) throws SAMLException {
byte[] bytes = Base64.getMimeDecoder().decode(encodedRequest);
Inflater inflater = new Inflater(true);
inflater.setInput(bytes);
inflater.finished();
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();... | Base | 1 |
public void testOfCharSequence() {
// Should produce a lower-cased AsciiString.
assertThat((Object) HttpHeaderNames.of("Foo")).isEqualTo(AsciiString.of("foo"));
// Should reuse known header name instances.
assertThat((Object) HttpHeaderNames.of("date")).isSameAs(HttpHeaderNames.DATE... | Class | 2 |
public User getUser() {
return user;
} | Class | 2 |
public boolean isAvailable() {
try {
GeoTools.getInitialContext();
return true;
} catch (Exception e) {
return false;
}
} | Class | 2 |
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs)
throws IOException {
Path relativeDir = source.relativize(dir);
final Path dirToCreate = Paths.get(destDir.toString(), relativeDir.toString());
if(!dirToCreate.toFile().exists()) {
Files.createDirectory(dirToCreat... | Base | 1 |
public Document read(Reader reader, String systemId)
throws DocumentException {
InputSource source = new InputSource(reader);
source.setSystemId(systemId);
if (this.encoding != null) {
source.setEncoding(this.encoding);
}
return read(source);
} | Base | 1 |
public Controller execute(FolderComponent fc, UserRequest ureq, WindowControl wContr, Translator trans) {
this.translator = trans;
this.folderComponent = fc;
this.fileSelection = new FileSelection(ureq, fc.getCurrentContainerPath());
VFSContainer currentContainer = folderComponent.getCurrentContainer();
Lis... | Base | 1 |
public DropFileContainer(final String id, final String mimeType) {
super(id);
this.mimeType = mimeType;
main = new WebMarkupContainer("main");
add(main);
} | Compound | 4 |
private <P extends T> void translate0(GeyserSession session, PacketTranslator<P> translator, P packet) {
if (session.isClosed()) {
return;
}
try {
translator.translate(packet, session);
} catch (Throwable ex) {
GeyserConnector.getInstance().getLog... | Class | 2 |
public static boolean isAbsolute(String url)
{
if (url.startsWith("//")) // //www.domain.com/start
{
return true;
}
if (url.startsWith("/")) // /somePage.html
{
return false;
}
boolean result = false;
try
{
URI uri = new URI(url);
result = uri.isAbsolute();
}
catch (URISyntax... | Base | 1 |
public void encodeByteArrayDeepInJson() throws JSONException {
JSONObject data = new JSONObject("{a: \"hi\", b: {}, c: {a: \"bye\", b: {}}}");
data.getJSONObject("b").put("why", new byte[3]);
data.getJSONObject("c").getJSONObject("b").put("a", new byte[6]);
Packet<JSONObject> packet... | Base | 1 |
public Controller execute(FolderComponent folderComponent, UserRequest ureq, WindowControl wControl, Translator trans) {
VFSContainer currentContainer = folderComponent.getCurrentContainer();
status = FolderCommandHelper.sanityCheck(wControl, folderComponent);
if(status == FolderCommandStatus.STATUS_FAILED) {
... | Base | 1 |
public void setShouldOverWritePreviousValue() {
final HttpHeadersBase headers = newEmptyHeaders();
headers.set("name", "value1");
headers.set("name", "value2");
assertThat(headers.size()).isEqualTo(1);
assertThat(headers.getAll("name").size()).isEqualTo(1);
assertThat... | Class | 2 |
public UploadFileResponse getCloudUrl(String contextPath, String uri, String finalFilePath, HttpServletRequest request) {
UploadFileResponse uploadFileResponse = new UploadFileResponse();
// try push to cloud
Map<String, String[]> map = new HashMap<>();
map.put("fileInfo", new String... | 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 void testQuoteWorkingDirectoryAndExecutable_WDPathWithSingleQuotes()
{
Shell sh = newShell();
sh.setWorkingDirectory( "/usr/local/'something else'" );
sh.setExecutable( "chmod" );
String executable = StringUtils.join( sh.getShellCommandLine( new String[]{} ).iterator(), ... | Base | 1 |
private static String bytesToHex(byte[] bytes, int length) {
String out = "";
for (int j = 0; j < length; j++) {
int v = bytes[j] & 0xFF;
out += hexArray[v >>> 4];
out += hexArray[v & 0x0F];
out += " ";
}
return out;
} | Base | 1 |
public void translate(ServerEntityRotationPacket packet, GeyserSession session) {
Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId());
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
entity = session.getPlayerEntity();
}
... | Class | 2 |
protected XMLReader installXMLFilter(XMLReader reader) {
XMLFilter filter = getXMLFilter();
if (filter != null) {
// find the root XMLFilter
XMLFilter root = filter;
while (true) {
XMLReader parent = root.getParent();
if (parent ... | Base | 1 |
public static void zipFolderAPKTool(String srcFolder, String destZipFile) throws Exception {
try (FileOutputStream fileWriter = new FileOutputStream(destZipFile);
ZipOutputStream zip = new ZipOutputStream(fileWriter)){
addFolderToZipAPKTool("", srcFolder, zip);
zip.flush... | Base | 1 |
private static boolean nameContainsForbiddenSequence(String name) {
boolean result = false;
if (name != null) {
name = name.toLowerCase();
result = name.startsWith(".") ||
name.contains("../") ||
name.contains("..\\") ||
... | Base | 1 |
public void privateMsgInMuc(Conversation conversation, String nick) {
switchToConversation(conversation, null, false, nick, true);
} | Class | 2 |
public void delete(String databaseType) {
Path path = Paths.get(driverFilePath(driverBaseDirectory, databaseType));
try {
Files.deleteIfExists(path);
} catch (IOException e) {
log.error("delete driver error " + databaseType, e);
}
} | Class | 2 |
private void saveToFile(VFSLeaf glossaryFile, List<GlossaryItem> glossaryItemArr) {
// cdata-tags should be used instead of strings, overwrite writer.
glossaryItemArr = removeEmptyGlossaryItems(glossaryItemArr);
XStreamHelper.writeObject(xstreamWriter, glossaryFile, glossaryItemArr);
} | Base | 1 |
public static File createTempFile(String prefix, String suffix, File directory) throws IOException {
if (javaVersion() >= 7) {
if (directory == null) {
return Files.createTempFile(prefix, suffix).toFile();
}
return Files.createTempFile(directory.toPath(), ... | Base | 1 |
public void translate(ServerSetSlotPacket packet, GeyserSession session) {
if (packet.getWindowId() == 255) { //cursor
GeyserItemStack newItem = GeyserItemStack.from(packet.getItem());
session.getPlayerInventory().setCursor(newItem, session);
InventoryUtils.updateCursor(s... | Class | 2 |
public void accessDenied() {
expect(backend.isRemoteAccessAllowed("localhost","127.0.0.1")).andReturn(false);
replay(backend);
handler.checkClientIPAccess("localhost","127.0.0.1");
} | Compound | 4 |
public void newDocumentFromURLTemplateProviderSpecifiedButNotAllowed() throws Exception
{
// new document = xwiki:X.Y
DocumentReference documentReference =
new DocumentReference("Y", new SpaceReference("X", new WikiReference("xwiki")));
XWikiDocument document = mock(XWikiDocu... | Class | 2 |
public void translate(PositionTrackingDBClientRequestPacket packet, GeyserSession session) {
PositionTrackingDBServerBroadcastPacket broadcastPacket = new PositionTrackingDBServerBroadcastPacket();
broadcastPacket.setTrackingId(packet.getTrackingId());
// Fetch the stored Loadstone
... | Class | 2 |
public static void copyDb(
String jdbcDriverSource,
String usernameSource,
String passwordSource,
String jdbcUrlSource,
String jdbcDriverTarget,
String usernameTarget,
String passwordTarget,
String jdbcUrlTarget,
List<String> includeDbObjects,
List<String> excludeDbObj... | Base | 1 |
protected StyleSignatureBasic getStyleSignature() {
if (type == TimingStyle.CONCISE)
return StyleSignatureBasic.of(SName.root, SName.element, SName.timingDiagram, SName.concise);
if (type == TimingStyle.ROBUST)
return StyleSignatureBasic.of(SName.root, SName.element, SName.timingDiagram, SName.robust);
thr... | Base | 1 |
public void translate(NetworkStackLatencyPacket packet, GeyserSession session) {
long pingId;
// so apparently, as of 1.16.200
// PS4 divides the network stack latency timestamp FOR US!!!
// WTF
if (session.getClientData().getDeviceOs().equals(DeviceOs.PS4)) {
pin... | Class | 2 |
public SymbolContext getContext(ISkinParam skinParam, Style style) {
return new SymbolContext(getBackColor(skinParam, style), getLineColor(skinParam, style))
.withStroke(new UStroke(1.5));
} | Base | 1 |
public BCXMSSMTPrivateKey(PrivateKeyInfo keyInfo)
throws IOException
{
XMSSMTKeyParams keyParams = XMSSMTKeyParams.getInstance(keyInfo.getPrivateKeyAlgorithm().getParameters());
this.treeDigest = keyParams.getTreeDigest().getAlgorithm();
XMSSPrivateKey xmssMtPrivateKey = XMSSPri... | Base | 1 |
public void testCreateHttpUrlConnection() {
HttpURLConnection conn;
// Test without proxy
conn = createHttpUrlConnection(convertToUrl(TEST_URL), "", 0, "", "");
Assert.assertNotNull(conn);
// Test with the proxy
conn = createHttpUrlConnection(convertToUrl(TEST_URL), "... | Base | 1 |
public void failingExample() throws Exception {
assertThat(ConstraintViolations.format(validator.validate(new FailingExample())))
.containsExactlyInAnyOrder(FAILED_RESULT);
assertThat(TestLoggerFactory.getAllLoggingEvents())
.isEmpty();
} | Class | 2 |
private void checkParams()
throws Exception
{
if (vi == null)
{
throw new Exception("no layers defined.");
}
if (vi.length > 1)
{
for (int i = 0; i < vi.length - 1; i++)
{
if (vi[i] >= vi[i + 1])
... | 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 |
default Optional<String> findFirst(CharSequence name) {
return getFirst(name, String.class);
} | Class | 2 |
public static void beforeClass() throws IOException {
final Random r = new Random();
for (int i = 0; i < BYTES.length; i++) {
BYTES[i] = (byte) r.nextInt(255);
}
tmp = File.createTempFile("netty-traffic", ".tmp");
tmp.deleteOnExit();
FileOutputStream out ... | Base | 1 |
public static int version() {
return 1202204;
} | Base | 1 |
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 boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (obj instanceof ClassPathResource) {
ClassPathResource otherRes = (ClassPathResource) obj;
ClassLoader thisLoader = this.classLoader;
ClassLoader otherLoader = otherRes.c... | Base | 1 |
public ProductServletConfigurator(ServerConfig serverConfig, ShiroFilter shiroFilter, GitFilter gitFilter,
GitPreReceiveCallback preReceiveServlet, GitPostReceiveCallback postReceiveServlet,
WicketServlet wicketServlet, WebSocketManager webSocketManager,
AttachmentUploadServlet attachmentUploadServlet, Ser... | Base | 1 |
void colon() {
assertThat(PathAndQuery.parse("/:")).isNotNull();
assertThat(PathAndQuery.parse("/:/")).isNotNull();
assertThat(PathAndQuery.parse("/a/:")).isNotNull();
assertThat(PathAndQuery.parse("/a/:/")).isNotNull();
} | Base | 1 |
public void testPseudoHeadersWithRemovePreservesPseudoIterationOrder() {
final HttpHeadersBase headers = newHttp2Headers();
final HttpHeadersBase nonPseudoHeaders = newEmptyHeaders();
for (Map.Entry<AsciiString, String> entry : headers) {
if (entry.getKey().isEmpty() ||
... | Class | 2 |
public String getSHA(String password) {
try {
// Static getInstance method is called with hashing SHA
MessageDigest md = MessageDigest.getInstance("SHA-256");
// digest() method called
// to calculate message digest of an input
// and return array of byte
byte[] messageDigest = md.digest(password... | Variant | 0 |
public SAXReader(XMLReader xmlReader) {
this.xmlReader = xmlReader;
} | Base | 1 |
protected void onStart() {
super.onStart();
Intent intent = getIntent();
intent.putExtra(
SettingsActivity.SP_FEED_LIST_LAYOUT,
mPrefs.getString(SettingsActivity.SP_FEED_LIST_LAYOUT, "0")
);
setResult(RESULT_OK,intent);
} | Base | 1 |
public ExitCode runWithoutHelp(CommandRunnerParams params)
throws IOException, InterruptedException {
if (saveFilename != null && loadFilename != null) {
params.getConsole().printErrorText("Can't use both --load and --save");
return ExitCode.COMMANDLINE_ERROR;
}
if (saveFilename != nul... | Base | 1 |
final protected SymbolContext getContext() {
if (UseStyle.useBetaStyle() == false)
return getContextLegacy();
final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder());
final HColor lineColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(),
skinParam.getI... | Base | 1 |
public String render(String templateContent, Map<String, Object> context) {
VelocityContext velocityContext = new VelocityContext(context);
try (StringWriter sw = new StringWriter()) {
Velocity.evaluate(velocityContext, sw, "velocityTemplateEngine", templateContent);
return sw.toString();
}
catch (Except... | Class | 2 |
public String list(Model model, // TODO model should no longer be injected
@RequestParam(required = false, defaultValue = "FILENAME") SortBy sortBy,
@RequestParam(required = false, defaultValue = "false") boolean desc,
@RequestParam(required = fal... | Base | 1 |
private final void servlet31(HttpServletRequest request) {
try {
for(Part part:request.getParts()) {
if(part.getContentType() != null && (StringHelper.containsNonWhitespace(part.getSubmittedFileName()) || !part.getContentType().startsWith("text/plain"))) {
contentType = part.getContentType();
filena... | Base | 1 |
public void saveCustomConfigAndCompileCSS(Map<String, Map<String, Object>> customConfig, CourseEnvironment courseEnvironment){
VFSContainer themeBase = null;
VFSContainer base = null;
base = (VFSContainer) courseEnvironment.getCourseBaseContainer().resolve(CourseLayoutHelper.LAYOUT_COURSE_SUBFOLDER);
if (base ... | Base | 1 |
public UserCause(User user, String message) {
super(hudson.slaves.Messages._SlaveComputer_DisconnectedBy(
user!=null ? user.getId() : Jenkins.ANONYMOUS.getName(),
message != null ? " : " + message : ""
));
this.user = user;
} | Class | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.