Unnamed: 0 int64 0 637 | label int64 0 1 | code stringlengths 24 8.83k |
|---|---|---|
600 | 1 | public void testTrustedMethodPrevention() {
Response response = WebClient.create(endPoint + TIKA_PATH)
.type("application/pdf")
.accept("text/plain")
.header(TikaResource.X_TIKA_OCR_HEADER_PREFIX +
"trustedPa... |
601 | 1 | public void performTest()
throws Exception
{
testCompat();
testNONEwithDSA();
testDSAsha3(NISTObjectIdentifiers.id_dsa_with_sha3_224, 224, new BigInteger("613202af2a7f77e02b11b5c3a5311cf6b412192bc0032aac3ec127faebfc6bd0", 16));
testDSAsha3(NISTObjectIdentifiers.id_dsa_wi... |
602 | 1 | public void snapshotRecoveryTest() throws Exception {
logger.info("--> start node A");
String nodeA = internalCluster().startNode(settingsBuilder().put("gateway.type", "local"));
logger.info("--> create repository");
assertAcked(client().admin().cluster().preparePutRepository(REPO_N... |
603 | 1 | public synchronized Principal authenticate(Connection dbConnection,
String username,
String credentials) {
// No user or no credentials
// Can't possibly authenticate, don't bother the database then
... |
604 | 1 | public void performTest()
throws Exception
{
byte[] testIv = { 1, 2, 3, 4, 5, 6, 7, 8 };
ASN1Encodable[] values = {
new CAST5CBCParameters(testIv, 128),
new NetscapeCertType(NetscapeCertType.smime),
new VerisignCzagExtension(new DERI... |
605 | 1 | public void setEncoding( String enc ) {
if( !byteC.isNull() ) {
// if the encoding changes we need to reset the converion results
charC.recycle();
hasStrValue=false;
}
byteC.setEncoding(enc);
}
/**
* Sets the content to be a char[]
*
* @param c the bytes
* @param off ... |
606 | 1 | protected String buildErrorMessage(Throwable e, Object[] args) {
String errorKey = "struts.messages.upload.error." + e.getClass().getSimpleName();
if (LOG.isDebugEnabled()) {
LOG.debug("Preparing error message for key: [#0]", errorKey);
}
return LocalizedTextUtil.findText... |
607 | 1 | private BigInteger[] derDecode(
byte[] encoding)
throws IOException
{
ASN1Sequence s = (ASN1Sequence)ASN1Primitive.fromByteArray(encoding);
if (s.size() != 2)
{
throw new IOException("malformed signature");
}
return new BigInteger[]{
... |
608 | 1 | public String encodeCharacter( char[] immune, Character c )
{
String cStr = String.valueOf(c.charValue());
byte[] bytes;
StringBuilder sb;
if(UNENCODED_SET.contains(c))
return cStr;
bytes = toUtf8Bytes(cStr);
sb = new StringBuilder(bytes.length * 3);
for(byte b : bytes)
appendTwoUpperHex(sb.appe... |
609 | 1 | protected void setAuthenticateHeader(Request request,
Response response,
LoginConfig config,
String nOnce) {
// Get the realm name
String realmName = config.getRealmName();
... |
610 | 1 | private Foo writeAndRead(Foo foo) throws IOException, ClassNotFoundException {
writeObject(oos, foo);
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
inputStream = new ObjectInputStream(bis);
Foo fooBack = readFooObject(inputStream);
inputStream.close(... |
611 | 1 | private static void processHeaderConfig(MultivaluedMap<String, String> httpHeaders, Object object, String key, String prefix) {
try {
String property = StringUtils.removeStart(key, prefix);
Field field = null;
try {
object.getClass().getDeclaredField(Stri... |
612 | 1 | public KeystoreInstance createKeystore(String name, char[] password, String keystoreType) throws KeystoreException {
File test = new File(directory, name);
if(test.exists()) {
throw new IllegalArgumentException("Keystore already exists "+test.getAbsolutePath()+"!");
}
try... |
613 | 1 | public void setDefaultLockoutPolicy(LockoutPolicy defaultLockoutPolicy) {
this.defaultLockoutPolicy = defaultLockoutPolicy;
}
|
614 | 1 | protected void initializeFilters(int maxTrailerSize) {
// Create and add the identity filters.
getInputBuffer().addFilter(new IdentityInputFilter());
getOutputBuffer().addFilter(new IdentityOutputFilter());
// Create and add the chunked filters.
getInputBuffer().addFilter(ne... |
615 | 1 | private BeanReference createSecurityFilterChainBean(Element element,
ParserContext pc, List<?> filterChain) {
BeanMetadataElement filterChainMatcher;
String requestMatcherRef = element.getAttribute(ATT_REQUEST_MATCHER_REF);
String filterChainPattern = element.getAttribute(ATT_PATH_PATTERN);
if (StringUtil... |
616 | 1 | public boolean check(String path, Resource resource)
{
int slash = path.lastIndexOf('/');
if (slash<0)
return false;
String suffix=path.substring(slash);
return resource.getAlias().toString().endsWith(suffix);
}
}
}
|
617 | 1 | public Mapper getMapper() {
return (mapper);
}
/**
* Return the maximum size of a POST which will be automatically
* parsed by the container.
*/
|
618 | 1 | public Object getValue(Object parent) {
return ( (Object[]) parent )[index];
}
@Override
|
619 | 1 | public String createDB(String dbName) {
String result = DB_CREATED_MSG + ": " + dbName;
Connection conn = null;
try {
conn = DerbyConnectionUtil.getDerbyConnection(dbName,
DerbyConnectionUtil.CREATE_DB_PROP);
} catch (Throwable e) {
if (e ... |
620 | 1 | public URL resolveConfig(String path) throws FailedToResolveConfigException {
String origPath = path;
// first, try it as a path on the file system
File f1 = new File(path);
if (f1.exists()) {
try {
return f1.toURI().toURL();
} catch (Malformed... |
621 | 1 | public static boolean normalize(MessageBytes uriMB) {
ByteChunk uriBC = uriMB.getByteChunk();
byte[] b = uriBC.getBytes();
int start = uriBC.getStart();
int end = uriBC.getEnd();
// URL * is acceptable
if ((end - start == 1) && b[start] == (byte) '*')
retu... |
622 | 1 | protected void handShake() throws IOException {
ssl.setNeedClientAuth(true);
ssl.startHandshake();
}
/**
* Copied from <code>org.apache.catalina.valves.CertificateValve</code>
*/
|
623 | 1 | public void testIssue1599() throws Exception
{
final String JSON = aposToQuotes(
"{'id': 124,\n"
+" 'obj':[ 'com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl',\n"
+" {\n"
+" 'transletBytecodes' : [ 'AAIAZQ==' ],\n"
+" 'transletName' : 'a.b',\n"
+" 'outputProperties' : { }\n"
+" }\n... |
624 | 1 | public void testWildcardBehaviour_snapshotRestore() throws Exception {
createIndex("foobar");
ensureGreen("foobar");
waitForRelocation();
PutRepositoryResponse putRepositoryResponse = client().admin().cluster().preparePutRepository("dummy-repo")
.setType("fs").setSet... |
625 | 1 | public synchronized JettyHttpBinding getJettyBinding(HttpClient httpClient) {
if (jettyBinding == null) {
jettyBinding = new DefaultJettyHttpBinding();
jettyBinding.setHeaderFilterStrategy(getHeaderFilterStrategy());
jettyBinding.setThrowExceptionOnFailure(isThrowExceptio... |
626 | 1 | protected final String getWindowOpenJavaScript()
{
AppendingStringBuffer buffer = new AppendingStringBuffer(500);
if (isCustomComponent() == true)
{
buffer.append("var element = document.getElementById(\"");
buffer.append(getContentMarkupId());
buffer.append("\");\n");
}
buffer.append("var settin... |
627 | 1 | private void addUserFromChangeSet(ChangeLogSet.Entry change, Set<InternetAddress> to, Set<InternetAddress> cc, Set<InternetAddress> bcc, EnvVars env, TaskListener listener, RecipientProviderUtilities.IDebug debug) {
User user = change.getAuthor();
RecipientProviderUtilities.addUsers(Collections.sing... |
628 | 1 | public final void parse(Set<InputStream> mappingStreams) {
try {
JAXBContext jc = JAXBContext.newInstance( ConstraintMappingsType.class );
Set<String> alreadyProcessedConstraintDefinitions = newHashSet();
for ( InputStream in : mappingStreams ) {
String schemaVersion = xmlParserHelper.getSchemaVersion(... |
629 | 1 | public void addRecipients(final ExtendedEmailPublisherContext context, EnvVars env, Set<InternetAddress> to, Set<InternetAddress> cc, Set<InternetAddress> bcc) {
final class Debug implements RecipientProviderUtilities.IDebug {
private final ExtendedEmailPublisherDescriptor descriptor
... |
630 | 1 | private boolean evaluate(String text) {
try {
InputSource inputSource = new InputSource(new StringReader(text));
return ((Boolean)expression.evaluate(inputSource, XPathConstants.BOOLEAN)).booleanValue();
} catch (XPathExpressionException e) {
return false;
... |
631 | 1 | public void basicWorkFlowTest() throws Exception {
Client client = client();
logger.info("--> creating repository");
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
... |
632 | 1 | public Object getValue(Object parent) {
return parent;
}
@Override
|
633 | 1 | public void handshake(Socket sock) throws IOException {
((SSLSocket)sock).startHandshake();
}
/*
* Determines the SSL cipher suites to be enabled.
*
* @param requestedCiphers Comma-separated list of requested ciphers
* @param supportedCiphers Array of supported ciphers
*
... |
634 | 1 | ValidationException getErrorParsingMappingFileException(@Cause JAXBException e);
@Message(id = 116, value = "%s")
|
635 | 1 | private static ManagedMap<BeanDefinition, BeanDefinition> parseInterceptUrlsForFilterInvocationRequestMap(
MatcherType matcherType, List<Element> urlElts, boolean useExpressions,
boolean addAuthenticatedAll, ParserContext parserContext) {
ManagedMap<BeanDefinition, BeanDefinition> filterInvocationDefinitionMa... |
636 | 1 | public void setApplicationContext(ApplicationContext applicationContext)
throws BeansException {
defaultWebSecurityExpressionHandler.setApplicationContext(applicationContext);
}
|
637 | 1 | public void testDoEnable() throws Exception{
FreeStyleProject project = j.createFreeStyleProject("project");
GlobalMatrixAuthorizationStrategy auth = new GlobalMatrixAuthorizationStrategy();
j.jenkins.setAuthorizationStrategy(auth);
j.jenkins.setCrumbIssuer(null);
HudsonPr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.