code stringlengths 12 2.05k | label_name stringclasses 5
values | label int64 0 4 |
|---|---|---|
public void testGetShellCommandLineNonWindows()
throws Exception
{
Commandline cmd = new Commandline( new BourneShell() );
cmd.setExecutable( "/usr/bin" );
cmd.addArguments( new String[] {
"a",
"b"
} );
String[] shellCommandline = cmd.getSh... | 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 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 (keySpec == null) {
... | Base | 1 |
protected List<EfficiencyStatement> findEfficiencyStatements(IdentityRef identity) {
List<EfficiencyStatement> efficiencyStatements = new ArrayList<>();
StringBuilder sb = new StringBuilder();
sb.append("select statement from effstatement as statement")
.append(" where statement.identity.key=:identityKey");
... | 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 void shouldNotGetModificationsFromOtherBranches() throws Exception {
makeACommitToSecondBranch();
hg(workingDirectory, "pull").runOrBomb(null);
List<Modification> actual = hgCommand.modificationsSince(new StringRevision(REVISION_0));
assertThat(actual.size(), is(2));
... | Class | 2 |
public static synchronized InitialContext getInitialContext(final Hints hints)
throws NamingException {
return getInitialContext();
} | Class | 2 |
public byte[] allocateJobCaches(byte[] cacheAllocationRequestBytes) {
CacheAllocationRequest allocationRequest = (CacheAllocationRequest) SerializationUtils
.deserialize(cacheAllocationRequestBytes);
return SerializationUtils.serialize((Serializable) jobManager.allocateJobCaches(
getJobToken(), allocati... | Base | 1 |
private String getMimeType(HttpServletRequest pReq) {
String requestMimeType = pReq.getParameter(ConfigKey.MIME_TYPE.getKeyValue());
if (requestMimeType != null) {
return requestMimeType;
}
return configMimeType;
} | Base | 1 |
public byte[] decrypt(final JWEHeader header,
final Base64URL encryptedKey,
final Base64URL iv,
final Base64URL cipherText,
final Base64URL authTag)
throws JOSEException {
final JWEAlgorithm alg = header.getAlgorithm();
final ECDH.AlgorithmMode algMode = ECDH.resolveAlgorithm... | Base | 1 |
public static DomainSocketAddress newSocketAddress() {
try {
File file;
do {
file = File.createTempFile("NETTY", "UDS");
if (!file.delete()) {
throw new IOException("failed to delete: " + file);
}
} while... | Base | 1 |
public <T> List<T> search(final String filter, final Object[] filterArgs, final Mapper<T> mapper, final int maxResultCount) {
final List<T> searchResults = new ArrayList<>();
for (String searchBase : ldapConfiguration.getSearchBases()) {
int resultsToFetch = resultsToFetch(maxResultCount... | Class | 2 |
public void addUser(JpaUser user) throws UnauthorizedException {
if (!UserDirectoryUtils.isCurrentUserAuthorizedHandleRoles(securityService, user.getRoles()))
throw new UnauthorizedException("The user is not allowed to set the admin role on other users");
// Create a JPA user with an encoded password.
... | Class | 2 |
public void testEntryEquals() {
final HttpHeadersBase nameValue = newEmptyHeaders();
nameValue.add("name", "value");
final HttpHeadersBase nameValueCopy = newEmptyHeaders();
nameValueCopy.add("name", "value");
final Map.Entry<AsciiString, String> same1 = nameValue.iterator().... | Class | 2 |
public <T> T toBean(Class<T> beanClass) {
setTag(new Tag(beanClass));
if (getVersion() != null) {
try {
MigrationHelper.migrate(getVersion(), beanClass.newInstance(), this);
removeVersion();
} catch (InstantiationException | IllegalAccessException e) {
throw new RuntimeExce... | Base | 1 |
void setup()
{
this.saveAction = new SaveAction();
context = oldcore.getXWikiContext();
xWiki = mock(XWiki.class);
context.setWiki(this.xWiki);
mockRequest = mock(XWikiRequest.class);
context.setRequest(mockRequest);
mockResponse = mock(XWikiResponse.c... | Class | 2 |
public Object getResourceDataForKey(String key) {
Object data = null;
String dataString = null;
Matcher matcher = DATA_SEPARATOR_PATTERN.matcher(key);
if (matcher.find()) {
if (log.isDebugEnabled()) {
log.debug(Messages.getMessage(
Messages.RESTORE_DATA_FROM_RESOURCE_URI_INFO, key,
d... | Base | 1 |
public void shouldThrowExceptionForBadConnection() throws Exception {
String url = "http://not-exists";
HgCommand hgCommand = new HgCommand(null, null, null, null, null);
assertThatThrownBy(() -> hgCommand.checkConnection(new UrlArgument(url)))
.isExactlyInstanceOf(CommandLi... | Class | 2 |
public void validateFail2(ViolationCollector col) {
col.addViolation(FAILED + "2");
} | Class | 2 |
public SAXReader(boolean validating) {
this.validating = validating;
} | Base | 1 |
private static void handleErrorResponse(HttpURLConnection conn, String url, String moduleFullName) {
try (BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getErrorStream(), Charset.defaultCharset()))) {
StringBuilder result = new StringBuilder();
... | Base | 1 |
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 void emptyHeaderNameNotAllowed() {
newEmptyHeaders().add("", "foo");
} | Class | 2 |
public RedirectView callback(@RequestParam(defaultValue = "/") String redirect,
@PathVariable String serverId,
@RequestParam String code,
@RequestParam String state,
HttpServletRequest... | Compound | 4 |
public void newDocumentWebHomeFromURLTemplateProviderSpecifiedButOldPageTypeButOverriddenFromUIToNonTerminal()
throws Exception
{
// new document = xwiki:X.Y.WebHome
DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("X", "Y"), "WebHome");
XWikiDoc... | Class | 2 |
public void authorizeRequest(Operation op) {
op.complete();
} | Class | 2 |
public void testFormat() throws Exception {
assertEquals("<a> <b>c</b></a>", format("<a><b>c</b></a>", 1).replaceAll("[\r\n]", ""));
assertEquals("<a> <b>c</b></a>", format("<a><b>c</b></a>", 3).replaceAll("[\r\n]", ""));
assertEquals("<a><b>c</b></a>", format("<a><b>c</b></a>", -21));
... | Base | 1 |
public void translate(ServerPingPacket packet, GeyserSession session) {
session.sendDownstreamPacket(new ClientPongPacket(packet.getId()));
} | Class | 2 |
public void translate(ServerMultiBlockChangePacket packet, GeyserSession session) {
for (BlockChangeRecord record : packet.getRecords()) {
ChunkUtils.updateBlock(session, record.getBlock(), record.getPosition());
}
} | Class | 2 |
public void existingDocumentFromUITemplateSpecified() throws Exception
{
// current document = xwiki:Main.WebHome
DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome");
XWikiDocument document = mock(XWikiDocument.class);
when(docum... | Class | 2 |
default List<MediaType> accept() {
return getAll(HttpHeaders.ACCEPT)
.stream()
.flatMap(x -> Arrays.stream(x.split(",")))
.flatMap(s -> ConversionService.SHARED.convert(s, MediaType.class).map(Stream::of).orElse(Stream.empty()))
.distinct()
.collec... | Class | 2 |
public void translate(ServerWindowPropertyPacket packet, GeyserSession session) {
Inventory inventory = InventoryUtils.getInventory(session, packet.getWindowId());
if (inventory == null)
return;
InventoryTranslator translator = session.getInventoryTranslator();
if (trans... | Class | 2 |
public void validateFail3(ViolationCollector col) {
col.addViolation(FAILED + "3");
} | Class | 2 |
public void onTaskSelectionEvent(@Observes TaskSelectionEvent event){
selectedTaskId = event.getTaskId();
selectedTaskName = event.getTaskName();
view.getTaskIdAndName().setText(String.valueOf(selectedTaskId) + " - "+selectedTaskName);
view.getContent().clear();
... | Base | 1 |
private SearchResult lookupUser(String accountName) throws NamingException {
InitialDirContext context = initContext();
String searchString = searchFilter.replace(":login", accountName);
SearchControls searchControls = new SearchControls();
String[] attributeFilter = {idAttribute, ... | 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 |
private static final RestrictorCheck CORS_CHECK = new RestrictorCheck() {
/** {@inheritDoc} */
public boolean check(Restrictor restrictor, Object... args) {
return restrictor.isCorsAccessAllowed((String) args[0]);
}
}; | Compound | 4 |
public static XStream createXStreamInstance() {
return new EnhancedXStream(false);
} | Base | 1 |
public String accessToken(String username) {
Algorithm algorithm = Algorithm.HMAC256(SECRET);
return JWT.create()
.withExpiresAt(new Date(new Date().getTime() + ACCESS_EXPIRE_TIME))
.withIssuer(ISSUER)
.withClaim("username", username)
... | 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 boolean isCorsAccessAllowed(String pOrigin) {
return checkRestrictorService(CORS_CHECK,pOrigin);
} | Compound | 4 |
private void securityCheck(String filename) {
Assert.doesNotContain(filename, "..");
} | Base | 1 |
function findLateSubscriptionSortedByPriority() {
if (late_subscriptions.length === 0) {
return null;
}
late_subscriptions.sort(compare_subscriptions);
// istanbul ignore next
if (doDebug) {
debugLog(
... | Base | 1 |
public void create() throws Exception {
final JettyServerFactory jettyServerFactory = mock(JettyServerFactory.class);
final StaticFilesConfiguration staticFilesConfiguration = mock(StaticFilesConfiguration.class);
final Routes routes = mock(Routes.class);
when(jettyServerFactory.cre... | Base | 1 |
public String getEncryptedValue() {
try {
Cipher cipher = KEY.encrypt();
// add the magic suffix which works like a check sum.
return new String(Base64.encode(cipher.doFinal((value+MAGIC).getBytes("UTF-8"))));
} catch (GeneralSecurityException e) {
thr... | Class | 2 |
public static Object readObject(XStream xStream, String xml) {
try(InputStream is = new ByteArrayInputStream(xml.getBytes(ENCODING))) {
return readObject(xStream, is);
} catch (Exception e) {
throw new OLATRuntimeException(XStreamHelper.class,
"could not read Object from string: " + xml, e);
}
} | Base | 1 |
public void headersWithSameNamesButDifferentValuesShouldNotBeEquivalent() {
final HttpHeadersBase headers1 = newEmptyHeaders();
headers1.add("name1", "value1");
final HttpHeadersBase headers2 = newEmptyHeaders();
headers1.add("name1", "value2");
assertThat(headers1).isNotEqua... | Class | 2 |
public void shouldThrowExceptionIfUpdateFails() throws Exception {
InMemoryStreamConsumer output =
ProcessOutputStreamConsumer.inMemoryConsumer();
// delete repository in order to fail the hg pull command
assertThat(FileUtils.deleteQuietly(serverRepo), is(true));
//... | Class | 2 |
public InvalidExtensionException(String[] allowedExtension, String extension, String filename)
{
super("filename : [" + filename + "], extension : [" + extension + "], allowed extension : [" + Arrays.toString(allowedExtension) + "]");
this.allowedExtension = allowedExtension;
this.ex... | Base | 1 |
public void translate(ServerUpdateViewDistancePacket packet, GeyserSession session) {
session.setRenderDistance(packet.getViewDistance());
} | Class | 2 |
public PlayerAnalog(String code, ISkinParam skinParam, TimingRuler ruler, boolean compact) {
super(code, skinParam, ruler, compact);
this.suggestedHeight = 100;
} | Base | 1 |
public List<Modification> modificationsSince(Revision revision) {
InMemoryStreamConsumer consumer = inMemoryConsumer();
bombUnless(pull(consumer), "Failed to run hg pull command: " + consumer.getAllOutput());
CommandLine hg = hg("log",
"-r", "tip:" + revision.getRevision(),
... | Class | 2 |
void consecutiveSlashes() {
final PathAndQuery res = PathAndQuery.parse(
"/path//with///consecutive////slashes?/query//with///consecutive////slashes");
assertThat(res).isNotNull();
assertThat(res.path()).isEqualTo("/path/with/consecutive/slashes");
assertThat(res.quer... | Base | 1 |
public <T extends Result> T setResult(Class<T> resultClass) throws SQLException {
try {
if (isDebugEnabled()) {
debugCode(
"getSource(" + (resultClass != null ? resultClass.getSimpleName() + ".class" : "null") + ')');
}
checkEditabl... | Base | 1 |
public void translate(ServerDisconnectPacket packet, GeyserSession session) {
session.disconnect(MessageTranslator.convertMessage(packet.getReason(), session.getLocale()));
} | Class | 2 |
public PersistentTask updateTask(Task task, Serializable runnableTask, Identity modifier, Date scheduledDate) {
PersistentTask ptask = dbInstance.getCurrentEntityManager()
.find(PersistentTask.class, task.getKey(), LockModeType.PESSIMISTIC_WRITE);
if(ptask != null) {
ptask.setLastModified(new Date());
pt... | Base | 1 |
private String escapeEl(@Nullable String s) {
if (s == null || s.isEmpty()) {
return s;
}
final Matcher m = ESCAPE_PATTERN.matcher(s);
final StringBuffer sb = new StringBuffer(s.length() + 16);
while (m.find()) {
m.appendReplacement(sb, "\\\\\\${");
... | Class | 2 |
public Argument<Publisher> argumentType() {
return Argument.of(Publisher.class);
} | Class | 2 |
private boolean extract(ArrayList<String> errors, URL source, File target) {
FileOutputStream os = null;
InputStream is = null;
boolean extracting = false;
try {
if (!target.exists() || isStale(source, target) ) {
is = source.openStream();
... | Base | 1 |
private void ensureCorrectTheme(Intent data) {
String oldListLayout = data.getStringExtra(SettingsActivity.SP_FEED_LIST_LAYOUT);
String newListLayout = mPrefs.getString(SettingsActivity.SP_FEED_LIST_LAYOUT,"0");
if (ThemeChooser.themeRequiresRestartOfUI() || !newListLayout.equals(oldListLay... | Base | 1 |
public void handle(HttpServletRequest request, HttpServletResponse response)
throws Exception
{
// We're sending an XML response, so set the response content type to text/xml
response.setContentType("text/xml");
// Parse the incoming request as XML
SAXReader xmlReader = new SAXReader();
D... | Class | 2 |
private <T> T unmarshallFromDocument(Document document, Class<T> type) throws SAMLException {
try {
JAXBContext context = JAXBContext.newInstance(type);
Unmarshaller unmarshaller = context.createUnmarshaller();
JAXBElement<T> element = unmarshaller.unmarshal(document, type);
return element... | Base | 1 |
protected void setDispatchHandler(DispatchHandler dispatchHandler) {
this.dispatchHandler = dispatchHandler;
} | Base | 1 |
final void setObject(CharSequence name, Iterable<?> values) {
final AsciiString normalizedName = normalizeName(name);
requireNonNull(values, "values");
final int h = normalizedName.hashCode();
final int i = index(h);
remove0(h, i, normalizedName);
for (Object v: val... | 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 static void main(String[] args) {
// Will serve all static file are under "/public" in classpath if the route isn't consumed by others routes.
staticFileLocation("/public");
get("/hello", (request, response) -> {
return "Hello World!";
});
} | Base | 1 |
public void translate(ServerVehicleMovePacket packet, GeyserSession session) {
Entity entity = session.getRidingVehicleEntity();
if (entity == null) return;
entity.moveAbsolute(session, Vector3f.from(packet.getX(), packet.getY(), packet.getZ()), packet.getYaw(), packet.getPitch(), false, tr... | Class | 2 |
private <T> Document marshallToDocument(JAXBElement<T> object, Class<T> type) throws SAMLException {
try {
JAXBContext context = JAXBContext.newInstance(type);
Marshaller marshaller = context.createMarshaller();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setName... | Base | 1 |
public static void main(String[] args) throws LifecycleException {
String webappDirLocation;
if (Constants.IN_JAR) {
webappDirLocation = "webapp";
} else {
webappDirLocation = "src/main/webapp/";
}
Tomcat tomcat = new Tomcat();
String webPort... | Base | 1 |
void controlChars() {
assertThat(PathAndQuery.parse("/\0")).isNull();
assertThat(PathAndQuery.parse("/a\nb")).isNull();
assertThat(PathAndQuery.parse("/a\u007fb")).isNull();
// Escaped
assertThat(PathAndQuery.parse("/%00")).isNull();
assertThat(PathAndQuery.parse("/a... | Base | 1 |
public void existingDocumentTerminalFromUI() throws Exception
{
// current document = xwiki:Main.WebHome
DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome");
XWikiDocument document = mock(XWikiDocument.class);
when(document.getDo... | Class | 2 |
private String getSkinResourcePath(String resource)
{
String skinFolder = getSkinFolder();
String resourcePath = skinFolder + resource;
// Prevent inclusion of templates from other directories
Path normalizedResource = Paths.get(resourcePath).normalize();
// Protect agai... | Base | 1 |
private void testBSI()
throws Exception
{
KeyPairGenerator kpGen = KeyPairGenerator.getInstance("ECDSA", "BC");
kpGen.initialize(new ECGenParameterSpec(TeleTrusTObjectIdentifiers.brainpoolP512r1.getId()));
KeyPair kp = kpGen.generateKeyPair();
byte[] data = "Hello Worl... | Base | 1 |
public void existingDocumentNonTerminalFromUIDeprecatedIgnoringPage() throws Exception
{
// current document = xwiki:Main.WebHome
DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome");
XWikiDocument document = mock(XWikiDocument.class);
... | Class | 2 |
private static Stream<Arguments> provideFilesAndExpectedExceptionType() {
return Stream.of(
Arguments.of("abnormal/corrupt-header.rar", CorruptHeaderException.class),
Arguments.of("abnormal/mainHeaderNull.rar", BadRarArchiveException.class)
);
} | 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 encodeByteArray2() {
Packet<byte[]> packet = new Packet<>(Parser.BINARY_EVENT);
packet.data = new byte[2];
packet.id = 0;
packet.nsp = "/";
Helpers.testBin(packet);
} | Base | 1 |
public Argument<CompletableFuture> argumentType() {
return Argument.of(CompletableFuture.class);
} | Class | 2 |
public synchronized <T extends Result> T setResult(Class<T> resultClass) throws SQLException {
checkFreed();
initialize();
if (resultClass == null || DOMResult.class.equals(resultClass)) {
domResult = new DOMResult();
active = true;
return (T) domResult;
} else if (SAXResult.class.e... | Base | 1 |
public void multipleValuesPerNameIteratorEmpty() {
final HttpHeadersBase headers = newEmptyHeaders();
assertThat(headers.valueIterator("name")).isExhausted();
assertThatThrownBy(() -> headers.valueIterator("name").next())
.isInstanceOf(NoSuchElementException.class);
} | Class | 2 |
public static final String getRevision() {
return "a";
} | Class | 2 |
public HgVersion version() {
CommandLine hg = createCommandLine("hg").withArgs("version").withEncoding("utf-8");
String hgOut = execute(hg, new NamedProcessTag("hg version check")).outputAsString();
return HgVersion.parse(hgOut);
} | Class | 2 |
public static ByteBuffer serializeToByteBuffer(final Object payload) throws IOException {
return ByteBuffer.wrap(serializeToBytes(payload));
} | Base | 1 |
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
ServletException {
if (request instanceof HttpServletRequest && response instanceof HttpServletResponse) {
HttpServletRequest httpReq = (HttpServletRequest) request;
... | Class | 2 |
public void setXMLReaderClassName(String xmlReaderClassName)
throws SAXException {
setXMLReader(XMLReaderFactory.createXMLReader(xmlReaderClassName));
} | Base | 1 |
void allReservedCharacters() {
final PathAndQuery res = PathAndQuery.parse("/#/:[]@!$&'()*+,;=?a=/#/:[]@!$&'()*+,;=");
assertThat(res).isNotNull();
assertThat(res.path()).isEqualTo("/#/:[]@!$&'()*+,;=");
assertThat(res.query()).isEqualTo("a=/#/:[]@!$&'()*+,;=");
final PathAn... | Base | 1 |
public void testSetOrdersPseudoHeadersCorrectly() {
final HttpHeadersBase headers = newHttp2Headers();
final HttpHeadersBase other = newEmptyHeaders();
other.add("name2", "value2");
other.add("name3", "value3");
other.add("name4", "value4");
other.authority("foo");
... | Class | 2 |
protected void afterFeaturesReceived() throws SecurityRequiredException, NotConnectedException {
StartTls startTlsFeature = getFeature(StartTls.ELEMENT, StartTls.NAMESPACE);
if (startTlsFeature != null) {
if (startTlsFeature.required() && config.getSecurityMode() == SecurityMode.disabled... | Class | 2 |
final void addObject(CharSequence name, Iterable<?> values) {
final AsciiString normalizedName = normalizeName(name);
requireNonNull(values, "values");
for (Object v : values) {
requireNonNullElement(values, v);
addObject(normalizedName, v);
}
} | Class | 2 |
public void testGetShellCommandLineBash_WithSingleQuotedArg()
throws Exception
{
Commandline cmd = new Commandline( new BourneShell() );
cmd.setExecutable( "/bin/echo" );
cmd.addArguments( new String[] {
"\'hello world\'"
} );
String[] shellCommandlin... | 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 |
void sendResetPasswordEmailRequest() throws Exception
{
when(this.referenceSerializer.serialize(this.userReference)).thenReturn("user:Foobar");
when(this.userProperties.getFirstName()).thenReturn("Foo");
when(this.userProperties.getLastName()).thenReturn("Bar");
AuthenticationRe... | Base | 1 |
protected DispatchHandler getDispatchHandler() {
if (dispatchHandler == null) {
dispatchHandler = new DispatchHandler();
}
return dispatchHandler;
} | Base | 1 |
public void highlightInMuc(Conversation conversation, String nick) {
switchToConversation(conversation, null, false, nick, false);
} | Class | 2 |
public void testSelectByUseNotSpecifiedOrSignature() {
JWKSelector selector = new JWKSelector(new JWKMatcher.Builder().keyUses(KeyUse.SIGNATURE, null).build());
List<JWK> keyList = new ArrayList<>();
keyList.add(new RSAKey.Builder(new Base64URL("n"), new Base64URL("e")).keyID("1").keyUse(KeyUse.SIGNATURE).buil... | Base | 1 |
public static byte[] serializeToBytes(final Object payload) throws IOException {
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
serializeToStream(bos, payload);
return bos.toByteArray();
} | Base | 1 |
public void debug() throws IOException, ServletException {
servlet = new AgentServlet();
initConfigMocks(new String[]{ConfigKey.DEBUG.getKeyValue(), "true"},null,"No access restrictor found",null);
context.log(find("URI:"));
context.log(find("Path-Info:"));
context.log(find("... | Compound | 4 |
public int clone(ConsoleOutputStreamConsumer outputStreamConsumer, UrlArgument repositoryUrl) {
CommandLine hg = createCommandLine("hg").withArgs("clone").withArg("-b").withArg(branch).withArg(repositoryUrl)
.withArg(workingDir.getAbsolutePath()).withNonArgSecrets(secrets).withEncoding("utf-... | Class | 2 |
callback: (request: PublishRequest, response: PublishResponse) => void; | Base | 1 |
public void setProperty(String name, Object value) throws SAXException {
getXMLReader().setProperty(name, value);
} | Base | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.