code stringlengths 12 2.05k | label_name stringclasses 5
values | label int64 0 4 |
|---|---|---|
protected final void populateUrlAttributeMap(final Map<String, String> urlParameters) {
urlParameters.put("pgtUrl", encodeUrl(this.proxyCallbackUrl));
} | 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 k... | Base | 1 |
/*package*/ static SecretKey getLegacyKey() throws GeneralSecurityException {
String secret = SECRET;
if(secret==null) return Jenkins.getInstance().getSecretKeyAsAES128();
return Util.toAes128Key(secret);
} | Class | 2 |
private boolean isStale(URL source, File target) {
if( source.getProtocol().equals("jar") ) {
// unwrap the jar protocol...
try {
String parts[] = source.getFile().split(Pattern.quote("!"));
source = new URL(parts[0]);
} catch (Mal... | Base | 1 |
public static synchronized InitialContext getInitialContext() throws NamingException {
if (context == null) {
try {
context = new InitialContext();
} catch (Exception e) {
throw handleException(e);
}
}
return context;
} | Class | 2 |
private String stripComments(String theScript) {
return BLOCK_COMMENT_STRIPPER.matcher(theScript).replaceAll("");
} | Base | 1 |
public void setStringInternEnabled(boolean stringInternEnabled) {
this.stringInternEnabled = stringInternEnabled;
} | Base | 1 |
void empty() {
final PathAndQuery res = PathAndQuery.parse(null);
assertThat(res).isNotNull();
assertThat(res.path()).isEqualTo("/");
assertThat(res.query()).isNull();
final PathAndQuery res2 = PathAndQuery.parse("");
assertThat(res2).isNotNull();
assertThat(... | Base | 1 |
public void checkConnection(UrlArgument repoUrl) {
final String ref = fullUpstreamRef();
final CommandLine commandLine = git().withArgs("ls-remote").withArg(repoUrl).withArg(ref);
final ConsoleResult result = commandLine.runOrBomb(new NamedProcessTag(repoUrl.forDisplay()));
if (!has... | Class | 2 |
protected int getExpectedErrors() {
return hasJavaNetURLPermission ? 2 : 1; // Security error must be reported as an error. Java 8 reports two errors.
} | Class | 2 |
new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return new java.security.cert.X509Certificate[]{};
}
public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {
... | Base | 1 |
public void todo_oldTasks() {
String taskName = UUID.randomUUID().toString();
PersistentTask ctask = persistentTaskDao.createTask(taskName, new DummyTask());
//simulate a task from a previous boot
PersistentTask ptask = new PersistentTask();
ptask.setCreationDate(new Date());
ptask.setLastModified(new D... | Base | 1 |
public Controller getMediaController(UserRequest ureq, WindowControl wControl, Media media, MediaRenderingHints hints) {
String statementXml = media.getContent();
EfficiencyStatement statement = null;
if(StringHelper.containsNonWhitespace(statementXml)) {
try {
statement = (EfficiencyStatement)myXStream.f... | Base | 1 |
private final HColor getBackColor(UmlDiagramType umlDiagramType, Style style) {
if (EntityUtils.groupRoot(group))
return null;
final HColor result = group.getColors().getColor(ColorType.BACK);
if (result != null)
return result;
final Stereotype stereo = group.getStereotype();
if (UseStyle.useBetaSty... | Base | 1 |
public VFSContainer createChildContainer(String name) {
File fNewFile = new File(getBasefile(), name);
if (!fNewFile.mkdir()) return null;
LocalFolderImpl locFI = new LocalFolderImpl(fNewFile, this);
locFI.setDefaultItemFilter(defaultFilter);
return locFI;
} | 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 VFSLeaf createChildLeaf(String name) {
File fNewFile = new File(getBasefile(), name);
try {
if(!fNewFile.getParentFile().exists()) {
fNewFile.getParentFile().mkdirs();
}
if (!fNewFile.createNewFile()) {
log.warn("Could not create a new leaf::" + name + " in container::" + getBasefile().getA... | Base | 1 |
private String getMimeType(ParsedUri pParsedUri) {
if (pParsedUri.getParameter(ConfigKey.CALLBACK.getKeyValue()) != null) {
return "text/javascript";
} else {
String mimeType = pParsedUri.getParameter(ConfigKey.MIME_TYPE.getKeyValue());
if (mimeType != null) {
... | Base | 1 |
public void translate(ServerEntityRemoveEffectPacket packet, GeyserSession session) {
Entity entity;
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
entity = session.getPlayerEntity();
session.getEffectCache().removeEffect(packet.getEffect());
}... | Class | 2 |
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 |
void requestResetPasswordWithoutPR() throws Exception
{
when(this.authorizationManager.hasAccess(Right.PROGRAM)).thenReturn(false);
assertNull(this.scriptService.requestResetPassword(mock(UserReference.class)));
verify(this.resetPasswordManager, never()).requestResetPassword(any());
... | Base | 1 |
public void setStripWhitespaceText(boolean stripWhitespaceText) {
this.stripWhitespaceText = stripWhitespaceText;
} | Base | 1 |
public String createSession(final String iDatabaseName, final String iUserName, final String iUserPassword) {
acquireExclusiveLock();
try {
final String id = "OS" + System.currentTimeMillis() + random.nextLong();
sessions.put(id, new OHttpSession(id, iDatabaseName, iUserName, iUserPasswor... | Class | 2 |
public void translate(SetPlayerGameTypePacket packet, GeyserSession session) {
// no
SetPlayerGameTypePacket playerGameTypePacket = new SetPlayerGameTypePacket();
playerGameTypePacket.setGamemode(session.getGameMode().ordinal());
session.sendUpstreamPacket(playerGameTypePacket);
... | Class | 2 |
public Element handle(Element request, Map<String, Object> context) throws ServiceException {
ZimbraSoapContext zsc = getZimbraSoapContext(context);
Account account = getRequestedAccount(getZimbraSoapContext(context));
if (!canAccessAccount(zsc, account))
throw ServiceException.... | Class | 2 |
public void translate(ServerUnlockRecipesPacket packet, GeyserSession session) {
if (packet.getAction() == UnlockRecipesAction.REMOVE) {
session.getUnlockedRecipes().removeAll(Arrays.asList(packet.getRecipes()));
} else {
session.getUnlockedRecipes().addAll(Arrays.asList(pack... | Class | 2 |
public void translate(ServerStatisticsPacket packet, GeyserSession session) {
session.updateStatistics(packet.getStatistics());
if (session.isWaitingForStatistics()) {
session.setWaitingForStatistics(false);
StatisticsUtils.buildAndSendStatisticsMenu(session);
}
... | Class | 2 |
final void add(CharSequence name, Iterable<String> values) {
final AsciiString normalizedName = normalizeName(name);
requireNonNull(values, "values");
final int h = normalizedName.hashCode();
final int i = index(h);
for (String v : values) {
requireNonNullElement(... | Class | 2 |
public IdImpl(String id) {
this.id = id;
} | Class | 2 |
public void testAADLengthComputation() {
Assert.assertArrayEquals(AAD_LENGTH, com.nimbusds.jose.crypto.AAD.computeLength(AAD));
} | Class | 2 |
private String escapeString(final String string)
{
if (string == null || string.length() == 0) {
return "\"\"";
}
char c = 0;
int i;
final int len = string.length();
final StringBuilder sb = new StringBuilder(len + 4);
String t;
sb.append('"');
for (i = 0; i < len; i += 1) ... | Base | 1 |
public Controller execute(FolderComponent fc, UserRequest ureq, WindowControl windowControl, Translator trans) {
this.folderComponent = fc;
this.translator = trans;
this.fileSelection = new FileSelection(ureq, fc.getCurrentContainerPath());
VelocityContainer main = new VelocityContainer("mc", VELOCITY_ROO... | Base | 1 |
public XssHttpServletRequestWrapper(HttpServletRequest request) {
super(request);
} | Base | 1 |
protected Map<String, Serializable> getPrincipal(Jwt jwt) {
Map<String, Serializable> principal = new HashMap<>();
principal.put("jwt", (Serializable) jwt.getBody());
return principal;
} | Base | 1 |
private String getLocalePrefix(FacesContext context) {
String localePrefix = null;
localePrefix = context.getExternalContext().getRequestParameterMap().get("loc");
if(localePrefix != null){
return localePrefix;
}
String appBundleName = ... | Base | 1 |
public void newDocumentWebHomeFromURLTemplateProviderSpecifiedButOldPageType() throws Exception
{
// new document = xwiki:X.Y.WebHome
DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("X", "Y"), "WebHome");
XWikiDocument document = mock(XWikiDocument.clas... | Class | 2 |
public void testMatchUse() {
JWKMatcher matcher = new JWKMatcher.Builder().keyUse(KeyUse.ENCRYPTION).build();
assertTrue(matcher.matches(new RSAKey.Builder(new Base64URL("n"), new Base64URL("e")).keyID("1").keyUse(KeyUse.ENCRYPTION).build()));
assertFalse(matcher.matches(new ECKey.Builder(ECKey.Curve.P_256, ne... | Base | 1 |
public void testUri() {
final HttpHeadersBase headers = newHttp2Headers();
assertThat(headers.uri()).isEqualTo(URI.create("https://netty.io/index.html"));
} | Class | 2 |
private boolean isAdmin(String accountName) {
if (this.adminFilter != null) {
try {
InitialDirContext context = initContext();
String searchString = adminFilter.replace(":login", accountName);
SearchControls searchControls = new SearchControls();
... | Class | 2 |
public void addHandler(String path, ElementHandler handler) {
getDispatchHandler().addHandler(path, handler);
} | Base | 1 |
public void existingDocumentFromUITemplateProviderSpecifiedNonTerminal() throws Exception
{
// current document = xwiki:Main.WebHome
DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome");
XWikiDocument document = mock(XWikiDocument.class);... | Class | 2 |
protected int addFileNames(String[] file) { // This appears to only be used by unit tests
for (int i = 0; file != null && i < file.length; i++) {
workUnitList.add(new WorkUnit(file[i]));
}
return size();
} | Base | 1 |
public void corsEmpty() {
InputStream is = getClass().getResourceAsStream("/allow-origin3.xml");
PolicyRestrictor restrictor = new PolicyRestrictor(is);
assertTrue(restrictor.isCorsAccessAllowed("http://bla.com"));
assertTrue(restrictor.isCorsAccessAllowed("http://www.jolokia.org"))... | Compound | 4 |
public void emptyHeadersShouldBeEqual() {
final HttpHeadersBase headers1 = newEmptyHeaders();
final HttpHeadersBase headers2 = newEmptyHeaders();
assertThat(headers2).isEqualTo(headers1);
assertThat(headers2.hashCode()).isEqualTo(headers1.hashCode());
} | Class | 2 |
public Cipher decrypt() {
try {
Cipher cipher = Secret.getCipher(ALGORITHM);
cipher.init(Cipher.DECRYPT_MODE, getKey());
return cipher;
} catch (GeneralSecurityException e) {
throw new AssertionError(e);
}
} | Class | 2 |
public boolean isValid(Object value, ConstraintValidatorContext context) {
final ViolationCollector collector = new ViolationCollector(context);
context.disableDefaultConstraintViolation();
for (ValidationCaller caller : methodMap.computeIfAbsent(value.getClass(), this::findMethods)) {
... | 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 onTurnEnded(TurnEndedEvent event) {
super.onTurnEnded(event);
final String out = event.getTurnSnapshot().getRobots()[0].getOutputStreamSnapshot();
if (out.contains("An error occurred during initialization")) {
messagedInitialization = true;
}
if (out.contains("access denied (java.net.Sock... | Class | 2 |
public Operation.OperationResult executeFixedCostOperation(
final MessageFrame frame, final EVM evm) {
Bytes shiftAmount = frame.popStackItem();
final Bytes value = leftPad(frame.popStackItem());
final boolean negativeNumber = value.get(0) < 0;
if (shiftAmount.size() > 4 && (shiftAmount = shift... | Base | 1 |
public static Document toXml(final List<IBaseDataObject> list) {
final Element root = new Element("payload-list");
for (final IBaseDataObject d : list) {
final Document doc = toXml(d);
root.addContent(doc.detachRootElement());
logger.debug("Adding xml content for ... | Base | 1 |
void plus() {
final PathAndQuery res = PathAndQuery.parse("/+?a+b=c+d");
assertThat(res).isNotNull();
assertThat(res.path()).isEqualTo("/+");
assertThat(res.query()).isEqualTo("a+b=c+d");
final PathAndQuery res2 = PathAndQuery.parse("/%2b?a%2bb=c%2bd");
assertThat(re... | Base | 1 |
public boolean isValidating() {
return validating;
} | Base | 1 |
void requestResetPassword() throws Exception
{
when(this.userManager.exists(this.userReference)).thenReturn(true);
InternetAddress email = new InternetAddress("foobar@xwiki.org");
when(this.userProperties.getEmail()).thenReturn(email);
BaseObject xObject = mock(BaseObject.class);... | Base | 1 |
public Operation.OperationResult executeFixedCostOperation(
final MessageFrame frame, final EVM evm) {
Bytes shiftAmount = frame.popStackItem();
if (shiftAmount.size() > 4 && (shiftAmount = shiftAmount.trimLeadingZeros()).size() > 4) {
frame.popStackItem();
frame.pushStackItem(UInt256.ZERO);... | Base | 1 |
public void newDocumentWebHomeTopLevelFromURL() throws Exception
{
// new document = xwiki:X.WebHome
DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("X"), "WebHome");
XWikiDocument document = mock(XWikiDocument.class);
when(document.getDocumentR... | Class | 2 |
public static void closeSubsequentFS(Path path) {
if(path != null && FileSystems.getDefault() != path.getFileSystem()) {
IOUtils.closeQuietly(path.getFileSystem());
}
} | Base | 1 |
public void testUpdateMapper_serializade_withExpirationDate() {
//create a mapper
String mapperId = UUID.randomUUID().toString();
String sessionId = UUID.randomUUID().toString().substring(0, 32);
PersistentMapper sMapper = new PersistentMapper("mapper-to-persist-until");
PersistedMapper pMapper = mapperDao.p... | Base | 1 |
final void set(CharSequence name, String value) {
final AsciiString normalizedName = normalizeName(name);
requireNonNull(value, "value");
final int h = normalizedName.hashCode();
final int i = index(h);
remove0(h, i, normalizedName);
add0(h, i, normalizedName, value);... | Class | 2 |
public DefaultFileSystemResourceLoader(String path) {
this.baseDirPath = Optional.of(Paths.get(normalize(path)));
} | Base | 1 |
protected int getExpectedErrors() {
return hasJavaNetURLPermission ? 3 : 2; // Security error must be reported as an error
} | Class | 2 |
protected EntityResolver createDefaultEntityResolver(String systemId) {
String prefix = null;
if ((systemId != null) && (systemId.length() > 0)) {
int idx = systemId.lastIndexOf('/');
if (idx > 0) {
prefix = systemId.substring(0, idx + 1);
}
... | Base | 1 |
public void accessAllowed() {
expect(backend.isRemoteAccessAllowed("localhost","127.0.0.1")).andReturn(true);
replay(backend);
handler.checkClientIPAccess("localhost","127.0.0.1");
} | Compound | 4 |
public static String decodePath(String path) {
if (path.indexOf('%') < 0) {
// No need to decoded; not percent-encoded
return path;
}
// Decode percent-encoded characters.
// An invalid character is replaced with 0xFF, which will be replaced into '�' by UTF-8... | Base | 1 |
protected void initOther() throws ServletException {
PropertyUtils.addBeanIntrospector(
SuppressPropertiesBeanIntrospector.SUPPRESS_CLASS);
PropertyUtils.clearDescriptors();
String value = null;
value = getServletConfig().getInitParameter("config");
if (value... | Class | 2 |
public static int getStatusCode(HttpURLConnection conn) {
try {
return conn.getResponseCode();
} catch (IOException e) {
throw ErrorUtil
.createCommandException("connection to the remote repository host failed: " + e.getMessage());
}
} | Base | 1 |
public void testCallbackPost() throws URISyntaxException, IOException, java.text.ParseException {
HttpExchange exchange = prepareExchange("http://localhost:8080/jolokia?callback=data",
"Content-Type","text/plain; charset=UTF-8",
... | Base | 1 |
public boolean isCorsAccessAllowed(String pOrigin) {
return cors;
} | Compound | 4 |
public void translate(AdventureSettingsPacket packet, GeyserSession session) {
boolean isFlying = packet.getSettings().contains(AdventureSetting.FLYING);
if (!isFlying && session.getGameMode() == GameMode.SPECTATOR) {
// We should always be flying in spectator mode
session.se... | Class | 2 |
protected DataSource createDataSource() throws SQLException {
InitialContext context = null;
DataSource source = null;
try {
context = GeoTools.getInitialContext();
source = (DataSource) context.lookup(datasourceName);
} catch (IllegalArgumentException | NoIni... | Class | 2 |
public void addShouldIncreaseAndRemoveShouldDecreaseTheSize() {
final HttpHeadersBase headers = newEmptyHeaders();
assertThat(headers.size()).isEqualTo(0);
headers.add("name1", "value1", "value2");
assertThat(headers.size()).isEqualTo(2);
headers.add("name2", "value3", "value... | Class | 2 |
public Controller execute(FolderComponent folderComponent, UserRequest ureq, WindowControl wControl, Translator translator) {
VFSContainer currentContainer = folderComponent.getCurrentContainer();
VFSContainer rootContainer = folderComponent.getRootContainer();
if (!VFSManager.exists(currentContainer)) {
sta... | Base | 1 |
public void setUp() throws Exception
{
context = oldcore.getXWikiContext();
Utils.setComponentManager(oldcore.getMocker());
QueryManager mockSecureQueryManager =
oldcore.getMocker().registerMockComponent((Type) QueryManager.class, "secure");
mockTemplateProvidersQu... | Class | 2 |
private static ECPublicKey generateECPublicKey(final ECKey.Curve curve)
throws Exception {
final ECParameterSpec ecParameterSpec = curve.toECParameterSpec();
KeyPairGenerator generator = KeyPairGenerator.getInstance("EC");
generator.initialize(ecParameterSpec);
KeyPair keyPair = generator.generateKeyPa... | Base | 1 |
public SAXReader(XMLReader xmlReader, boolean validating) {
this.xmlReader = xmlReader;
this.validating = validating;
} | Base | 1 |
public void translate(EmoteListPacket packet, GeyserSession session) {
if (session.getConnector().getConfig().getEmoteOffhandWorkaround() == EmoteOffhandWorkaroundOption.NO_EMOTES) {
return;
}
session.refreshEmotes(packet.getPieceIds());
} | Class | 2 |
public EfficiencyStatement getUserEfficiencyStatementByResourceKey(Long resourceKey, Identity identity){
StringBuilder sb = new StringBuilder(256);
sb.append("select statement from effstatementstandalone as statement")
.append(" where statement.identity.key=:identityKey and statement.resourceKey=:resourceKey")... | Base | 1 |
public void translate(ServerSpawnPositionPacket packet, GeyserSession session) {
SetSpawnPositionPacket spawnPositionPacket = new SetSpawnPositionPacket();
spawnPositionPacket.setBlockPosition(Vector3i.from(packet.getPosition().getX(), packet.getPosition().getY(), packet.getPosition().getZ()));
... | Class | 2 |
public boolean check(String pArg) {
if (patterns == null || patterns.size() == 0) {
return true;
}
for (Pattern pattern : patterns) {
if (pattern.matcher(pArg).matches()) {
return true;
}
}
return false;
} | Compound | 4 |
public int addWorkUnit(WorkUnit workUnit, long fileModificationTimeInMillis, long fileSize) {
workUnitList.add(workUnit);
if (fileModificationTimeInMillis < oldestFileModificationTime) {
oldestFileModificationTime = fileModificationTimeInMillis;
}
if (fileModificationTime... | Base | 1 |
public void setHeadersShouldOnlyOverwriteHeaders() {
final HttpHeadersBase headers1 = newEmptyHeaders();
headers1.add("name", "value");
headers1.add("name1", "value1");
final HttpHeadersBase headers2 = newEmptyHeaders();
headers2.add("name", "newvalue");
headers2.add... | Class | 2 |
public void existingDocumentFromUITemplateProviderSpecifiedButOldSpaceTypeButOverridenFromUIToTerminal()
throws Exception
{
// current document = xwiki:Main.WebHome
DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome");
XWikiDocume... | Class | 2 |
public void translate(CommandBlockUpdatePacket packet, GeyserSession session) {
String command = packet.getCommand();
boolean outputTracked = packet.isOutputTracked();
if (packet.isBlock()) {
CommandBlockMode mode;
switch (packet.getMode()) {
case CHAI... | Class | 2 |
public static Map<String, String> genHeaderMapByRequest(HttpServletRequest request) {
Map<String, String> map = new HashMap<>();
AdminTokenVO adminTokenVO = AdminTokenThreadLocal.getUser();
if (adminTokenVO != null) {
User user = User.dao.findById(adminTokenVO.getUserId());
... | Class | 2 |
public static SecretKey decryptCEK(final SecretKey kek,
final byte[] iv,
final AuthenticatedCipherText authEncrCEK,
final int keyLength,
final Provider provider)
throws JOSEException {
byte[] keyBytes = AESGCM.decrypt(kek, iv, authEncrCEK.getCipherText(), new byte[0], authEncrCEK.g... | Class | 2 |
public OHttpSession getSession(final String iId) {
acquireSharedLock();
try {
final OHttpSession sess = sessions.get(iId);
if (sess != null)
sess.updateLastUpdatedOn();
return sess;
} finally {
releaseSharedLock();
}
}
| Class | 2 |
public Document read(String systemId) throws DocumentException {
InputSource source = new InputSource(systemId);
if (this.encoding != null) {
source.setEncoding(this.encoding);
}
return read(source);
} | Base | 1 |
public void translate(ServerBlockChangePacket packet, GeyserSession session) {
Position pos = packet.getRecord().getPosition();
boolean updatePlacement = session.getConnector().getPlatformType() != PlatformType.SPIGOT && // Spigot simply listens for the block place event
session.getC... | Class | 2 |
public void doFilter(ServletRequest srequest, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
/* HttpServletRequest request = (HttpServletRequest) srequest;
//final String realIp = request.getHeader(X_FORWARDED_FOR);
//if (realIp != null) {
filterChain.doFil... | Base | 1 |
protected List<String> getRawCommandLine( String executable, String[] arguments )
{
List<String> commandLine = new ArrayList<String>();
StringBuilder sb = new StringBuilder();
if ( executable != null )
{
String preamble = getExecutionPreamble();
if ( prea... | Base | 1 |
public HtmlElement content(String body) {
return content(new TextElement(body));
} | Base | 1 |
void hexadecimal() {
assertThat(PathAndQuery.parse("/%")).isNull();
assertThat(PathAndQuery.parse("/%0")).isNull();
assertThat(PathAndQuery.parse("/%0X")).isNull();
assertThat(PathAndQuery.parse("/%X0")).isNull();
} | Base | 1 |
public void existingDocumentFromUITemplateProviderSpecifiedRestrictionExists() throws Exception
{
// current document = xwiki:Main.WebHome
DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome");
XWikiDocument document = mock(XWikiDocument.c... | Class | 2 |
public void testByteSerialization() throws Exception {
final IBaseDataObject d = DataObjectFactory.getInstance("abc".getBytes(), "testfile", Form.UNKNOWN);
final byte[] bytes = PayloadUtil.serializeToBytes(d);
final String s1 = new String(bytes);
assertTrue("Serializedion must includ... | Base | 1 |
private void checkUserReference(UserReference userReference) throws ResetPasswordException
{
if (!this.userManager.exists(userReference)) {
String exceptionMessage =
this.localizationManager.getTranslationPlain("xe.admin.passwordReset.error.noUser",
userRe... | Base | 1 |
public void iteratorSetShouldFail() {
final HttpHeadersBase headers = newEmptyHeaders();
headers.add("name1", "value1", "value2", "value3");
headers.add("name2", "value4");
assertThat(headers.size()).isEqualTo(4);
assertThatThrownBy(() -> headers.iterator().next().setValue("... | Class | 2 |
public void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) {
//便于Wappalyzer读取
response.addHeader("X-ZrLog", BlogBuildInfoUtil.getVersion());
boolean isPluginPath = false;
for (String path : pluginHandlerPaths) {
if (ta... | Class | 2 |
public void testSetContentFromFile() 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(tmpF... | Base | 1 |
public OutputStream getOutputStream(boolean append) {
return null;
} | Base | 1 |
public void shouldCloneFromRemoteRepo() {
assertThat(clientRepo.listFiles().length > 0, is(true));
} | Class | 2 |
protected int addFileNames(List<String> list) { // This appears to only be used by unit tests and the copy
// constructor
for (String file : list) {
workUnitList.add(new WorkUnit(file));
}
return size();
} | Base | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.