Unnamed: 0 int64 0 637 | label int64 0 1 | code stringlengths 24 8.83k |
|---|---|---|
200 | 0 | InstanceManager getInstanceManager() {
return instanceManager;
}
|
201 | 0 | public void testSingletonPatternInSerialization() {
final Object[] singletones = new Object[] {
ExceptionTransformer.INSTANCE,
NOPTransformer.INSTANCE,
StringValueTransformer.stringValueTransformer(),
};
for (final Object original : singletone... |
202 | 0 | public String getCipherSuite() throws IOException {
// Look up the current SSLSession
SSLSession session = ssl.getSession();
if (session == null)
return null;
return session.getCipherSuite();
}
|
203 | 0 | public void processAction(ActionRequest actionRequest,
ActionResponse actionResponse) throws PortletException, IOException {
String action = actionRequest.getParameter("action");
actionResponse.setRenderParameter("action", action);
if (action.equals("showView"))... |
204 | 0 | public void resetPassword_InvalidCodeData() {
ExpiringCode expiringCode = new ExpiringCode("good_code",
new Timestamp(System.currentTimeMillis() + UaaResetPasswordService.PASSWORD_RESET_LIFETIME), "user-id", null);
when(codeStore.retrieveCode("good_code")).thenReturn(expiringCode);
... |
205 | 0 | private void wipeRepositoryDirectories() {
if (repoPath.exists()) {
assertThat(repoPath.getAbsolutePath(), containsString(clusterName));
if (FileSystemUtils.deleteRecursively(repoPath)) {
logger.info("Successfully wiped repository directory for node location: {}", rep... |
206 | 0 | public void init(FilterConfig conf) throws ServletException {
if (conf != null && "zookeeper".equals(conf.getInitParameter("signer.secret.provider"))) {
SolrZkClient zkClient =
(SolrZkClient)conf.getServletContext().getAttribute(DELEGATION_TOKEN_ZK_CLIENT);
try {
conf.getServletConte... |
207 | 0 | public boolean getMapperDirectoryRedirectEnabled() { return false; }
|
208 | 0 | public static boolean isNewAuthenticationPathNeeded(long globalIndex, int xmssHeight, int layer)
{
if (globalIndex == 0)
{
return false;
}
return ((globalIndex + 1) % (long)Math.pow((1 << xmssHeight), layer) == 0) ? true : false;
}
|
209 | 0 | public final Set<Class<?>> getGroupList() {
return constraintDescriptor.getGroups();
}
|
210 | 0 | public void destroy() {
}
|
211 | 0 | protected Log getLog() {
return log;
}
/**
* SSL information.
*/
|
212 | 0 | protected Processor<Long> createUpgradeProcessor(
SocketWrapper<Long> socket,
HttpUpgradeHandler httpUpgradeProcessor)
throws IOException {
return new AprProcessor(socket, httpUpgradeProcessor,
(AprEndpoint) proto.endpoint);
... |
213 | 0 | private Object readResolve() {
Jenkins.getInstance().checkPermission(Jenkins.RUN_SCRIPTS);
return this;
}
|
214 | 0 | public String getDisplayName() {
return "Requestor";
}
}
}
|
215 | 0 | public OutputStream createOutput(String blobName) throws IOException {
maybeIOExceptionOrBlock(blobName);
return super.createOutput(blobName);
}
}
}
}
|
216 | 0 | public void run() {
}
};
/**
* Creates a new instance
* @param objectPostProcessor the {@link ObjectPostProcessor} to use
* @see WebSecurityConfiguration
*/
|
217 | 0 | void toHtml() throws IOException {
writeBackAndRefreshLinks();
writeln("<br/>");
assert sessionsInformations != null;
if (sessionsInformations.isEmpty()) {
writeln("#Aucune_session#");
return;
}
writeTitle("system-users.png", getString("Sessions"));
writeSessions(sessionsInformations);
long tota... |
218 | 0 | public boolean allowsSignup() {
return !disableSignup;
}
/**
* Checks if captcha is enabled on user signup.
*
* @return true if captcha is enabled on signup.
*/
|
219 | 0 | public static String stripExpressionIfAltSyntax(ValueStack stack, String expr) {
if (altSyntax(stack)) {
// does the expression start with %{ and end with }? if so, just cut it off!
if (isExpression(expr)) {
return expr.substring(2, expr.length() - 1);
}
... |
220 | 0 | private void processServletSecurityAnnotation(Servlet servlet) {
// Calling this twice isn't harmful so no syncs
servletSecurityAnnotationScanRequired = false;
ServletSecurity secAnnotation =
servlet.getClass().getAnnotation(ServletSecurity.class);
Context ctxt = (Contex... |
221 | 0 | public long getBytesWritten() {
return bytesWritten;
}
}
}
|
222 | 0 | private void doRedirectTest(String path, int expected) throws IOException {
ByteChunk bc = new ByteChunk();
int rc = getUrl("http://localhost:" + getPort() + path, bc, null);
Assert.assertEquals(expected, rc);
}
/**
* Prepare a string to search in messages that contain a times... |
223 | 0 | public void testEntityExpansionWReq2() throws Exception {
String url = "https://localhost:" + getIdpHttpsPort() + "/fediz-idp/federation?";
url += "wa=wsignin1.0";
url += "&whr=urn:org:apache:cxf:fediz:idp:realm-A";
url += "&wtrealm=urn:org:apache:cxf:fediz:fedizhelloworld";
... |
224 | 0 | Class<?> convertGroup(Class<?> originalGroup);
/**
* Returns a set with {@link GroupConversionDescriptor}s representing the
* group conversions of this cascadable.
*
* @return A set with group conversion descriptors. May be empty, but never
* {@code null}.
*/
|
225 | 0 | public static File checkSlip(File parentFile, File file) throws IllegalArgumentException {
String parentCanonicalPath;
String canonicalPath;
try {
parentCanonicalPath = parentFile.getCanonicalPath();
canonicalPath = file.getCanonicalPath();
} catch (IOException e) {
throw new IORuntimeException(e);
... |
226 | 0 | 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... |
227 | 0 | private boolean isPropertyConfigured(TrustedIdp trustedIdp, String property, boolean defaultValue) {
Map<String, String> parameters = trustedIdp.getParameters();
if (parameters != null && parameters.containsKey(property)) {
return Boolean.parseBoolean(parameters.get(property));
... |
228 | 0 | public void testHandleNeverSendAResponse() throws Exception
{
final AuthenticationResult firstResult = _negotiator.handleResponse(new byte[0]);
assertEquals("Unexpected authentication status", AuthenticationResult.AuthenticationStatus.CONTINUE, firstResult.getStatus());
assertArrayEquals... |
229 | 0 | public Collection<FileAnnotation> parse(final InputStream file, final String moduleName)
throws InvocationTargetException {
try {
SecureDigester digester = new SecureDigester(LintParser.class);
List<LintIssue> issues = new ArrayList<LintIssue>();
digester.pus... |
230 | 0 | private static void zip(File file, String srcRootDir, ZipOutputStream out) throws UtilException {
if (file == null) {
return;
}
final String subPath = FileUtil.subPath(srcRootDir, file); // 获取文件相对于压缩文件夹根目录的子路径
if (file.isDirectory()) {// 如果是目录,则压缩压缩目录中的文件或子目录
final File[] files = file.listFiles();
if... |
231 | 0 | public void initResetPasswordTest() throws Exception {
codeStore = getWebApplicationContext().getBean(ExpiringCodeStore.class);
}
@Test
|
232 | 0 | public final <T> Set<ConstraintViolation<T>> validate(T object, Class<?>... groups) {
Contracts.assertNotNull( object, MESSAGES.validatedObjectMustNotBeNull() );
if ( !beanMetaDataManager.isConstrained( object.getClass() ) ) {
return Collections.emptySet();
}
ValidationOrder validationOrder = determineGro... |
233 | 0 | public String getAlgorithm()
{
return "XMSS";
}
|
234 | 0 | public ProcessGroup getParent() {
return parent.get();
}
|
235 | 0 | private void checkAdmin() {
final Jenkins jenkins = Jenkins.getInstance(); //Hoping this method doesn't change meaning again
if (jenkins != null) {
//If Jenkins is not alive then we are not started, so no unauthorised user might do anything
jenkins.checkPermission(Jenkins.ADM... |
236 | 0 | public int available() throws IOException {
if (max >= 0 && pos >= max) {
return 0;
}
return in.available();
}
}
}
|
237 | 0 | public static void addNamespacePrefix(Element element, String namespaceUri, String prefix) {
element.setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, "xmlns:" + prefix, namespaceUri);
}
|
238 | 0 | public boolean contains(Artifact artifact) {
// Note: getLocation(artifact) does an artifact.isResolved() check - no need to do it here.
File location = getLocation(artifact);
return location.canRead() && (location.isFile() || new File(location, "META-INF").isDirectory());
}
|
239 | 0 | public String getTestString() {
return testString;
}
@Override
|
240 | 0 | public void removeUser(String username) {
UserDatabase database = (UserDatabase) this.resource;
User user = database.findUser(username);
if (user == null) {
return;
}
try {
MBeanUtils.destroyMBean(user);
database.removeUser(user);
... |
241 | 0 | public T transform(final T input) {
if (input == null) {
return null;
}
return PrototypeFactory.prototypeFactory(input).create();
}
|
242 | 0 | public void execute(FunctionContext context) {
Object[] arguments = (Object[]) context.getArguments();
String regionName = (String) arguments[0];
Set<String> keys = (Set<String>) arguments[1];
if (this.cache.getLogger().fineEnabled()) {
StringBuilder builder = new StringBuilder();
builder.... |
243 | 0 | protected void engineInitVerify(
PublicKey publicKey)
throws InvalidKeyException
{
CipherParameters param = DSAUtil.generatePublicKeyParameter(publicKey);
digest.reset();
signer.init(false, param);
}
|
244 | 0 | public void testSave() throws IOException, InterruptedException, ReactorException {
FreeStyleProject p = j.createFreeStyleProject("project");
p.disabled = true;
p.nextBuildNumber = 5;
p.description = "description";
p.save();
j.jenkins.reload();
assertEquals("A... |
245 | 0 | private static void deflater(InputStream in, OutputStream out, int level) {
final DeflaterOutputStream ios = (out instanceof DeflaterOutputStream) ? (DeflaterOutputStream) out : new DeflaterOutputStream(out, new Deflater(level, true));
IoUtil.copy(in, ios);
}
// --------------------------------------------------... |
246 | 0 | protected CoderResult decodeLoop(ByteBuffer in, CharBuffer out) {
if (in.hasArray() && out.hasArray()) {
return decodeHasArray(in, out);
}
return decodeNotHasArray(in, out);
}
|
247 | 0 | public static <I, O> Transformer<I, O> invokerTransformer(final String methodName, final Class<?>[] paramTypes,
final Object[] args) {
if (methodName == null) {
throw new NullPointerException("The method to invoke must not be null");
... |
248 | 0 | private void checkError() throws IOException {
if (error) {
throw new IOException(sm.getString("chunkedInputFilter.error"));
}
}
|
249 | 0 | public final BootstrapConfiguration parseValidationXml() {
InputStream inputStream = getInputStream();
if ( inputStream == null ) {
return BootstrapConfigurationImpl.getDefaultBootstrapConfiguration();
}
try {
String schemaVersion = xmlParserHelper.getSchemaVersion( VALIDATION_XML_FILE, inputStream );
... |
250 | 0 | public ExpressionInterceptUrlRegistry getRegistry() {
return REGISTRY;
}
|
251 | 0 | public Settings settings() {
return this.settings;
}
/**
* The home of the installation.
*/
|
252 | 0 | public void testPrivateKeyParsingSHA256()
throws Exception
{
XMSSMTParameters params = new XMSSMTParameters(20, 10, new SHA256Digest());
XMSSMT mt = new XMSSMT(params, new SecureRandom());
mt.generateKeys();
byte[] privateKey = mt.exportPrivateKey();
byte[] public... |
253 | 0 | public void destroy() {
if (log.isDebugEnabled()) {
log.debug(internal.getMessage("finalizing"));
}
destroyModules();
destroyInternal();
getServletContext().removeAttribute(Globals.ACTION_SERVLET_KEY);
// Release our LogFactory and Log instances (if any... |
254 | 0 | private void loadOtherTesseractConfig(Properties properties) {
for (String k : properties.stringPropertyNames()) {
if (k.contains("_")) {
addOtherTesseractConfig(k, properties.getProperty(k));
}
}
}
|
255 | 0 | public static <T> Transformer<Class<? extends T>, T> instantiateTransformer(final Class<?>[] paramTypes,
final Object[] args) {
if (((paramTypes == null) && (args != null))
|| ((paramTypes != null) && (args == null))... |
256 | 0 | String hash(String plaintext, String salt, int iterations) throws EncryptionException;
/**
* Encrypts the provided plaintext bytes using the cipher transformation
* specified by the property <code>Encryptor.CipherTransformation</code>
* and the <i>master encryption key</i> as specified by the property
* {@c... |
257 | 0 | public HandshakeResponse getHandshakeResponse() {
return handshakeResponse;
}
}
}
|
258 | 0 | public void handleDialog(ActionRequest req, ActionResponse resp) throws IOException, PortletException {
List<String> lines = new ArrayList<String>();
req.getPortletSession().setAttribute("lines", lines);
lines.add("handling dialog");
StringBuilder txt = new StringBuilder(128);
String ... |
259 | 0 | public void configure() throws Exception {
from("direct:start1")
.to("xslt:org/apache/camel/component/xslt/transform_dtd.xsl")
.to("mock:result");
from("direct:start2")
.to("xslt:org... |
260 | 0 | XSLTElementDef getElemDef()
{
return m_elemDef;
}
/**
* Set the element definition that belongs to this element.
*
* @param def The element definition object that produced and constrains this element.
*/
|
261 | 0 | public String getMethod() {
return this.method;
}
}
}
|
262 | 0 | public Result isAllowed(String principalId) {
LockoutPolicy lockoutPolicy = lockoutPolicyRetriever.getLockoutPolicy();
long eventsAfter = timeService.getCurrentTimeMillis() - lockoutPolicy.getCountFailuresWithin() * 1000;
List<AuditEvent> events = auditService.find(principalId, eventsAfter)... |
263 | 0 | public OpenIDLoginConfigurer<HttpSecurity> openidLogin() throws Exception {
return getOrApply(new OpenIDLoginConfigurer<HttpSecurity>());
}
/**
* Adds the Security headers to the response. This is activated by default when using
* {@link WebSecurityConfigurerAdapter}'s default constructor. Accepting the
* d... |
264 | 0 | public String toString()
{
return name;
}
}
}
|
265 | 0 | protected void validateOrderBy(String orderBy) throws IllegalArgumentException {
super.validateOrderBy(orderBy, EXTERNAL_GROUP_MAPPING_FIELDS);
}
|
266 | 0 | public Object createObject(Attributes attributes) {
String username = attributes.getValue("username");
if (username == null) {
username = attributes.getValue("name");
}
String password = attributes.getValue("password");
String fullName = attributes.getValue("fullN... |
267 | 0 | public void testSendingStringMessage() throws Exception {
sendEntityMessage(MESSAGE);
}
|
268 | 0 | public InputSource resolveEntity(String name, String publicId,
String baseURI, String systemId) throws SAXException,
IOException {
throw new SAXException(sm.getString("defaultServlet.blockExternalEntity2",
name, publicId, baseURI, systemId));
... |
269 | 0 | public static void init(TikaConfig config, DigestingParser.Digester digestr,
InputStreamFactory iSF) {
tikaConfig = config;
digester = digestr;
inputStreamFactory = iSF;
}
static {
|
270 | 0 | public void process(Exchange exchange) throws Exception {
|
271 | 0 | public boolean createDB(String dbName, PortletRequest request) {
// ensure there are no illegal chars in DB name
InputUtils.validateSafeInput(dbName);
Connection conn = null;
try {
conn = DerbyConnectionUtil.getDerbyConnection(dbName,
DerbyConnection... |
272 | 0 | public Member getCascadingMember() {
return cascadingMember;
}
@Override
|
273 | 0 | protected void finalize() throws Throwable {
super.finalize();
dispose();
}
|
274 | 0 | protected void handleClob(String tableName, String fieldName, int rowNum,
ResultSet resultSet, int columnIndex,
ContentHandler handler, ParseContext context) throws SQLException, IOException, SAXException {
//no-op for now.
}
@Override
|
275 | 0 | public void testNoConfig() throws Exception {
TesseractOCRConfig config = new TesseractOCRConfig();
assertEquals("Invalid default tesseractPath value", "", config.getTesseractPath());
assertEquals("Invalid default tessdataPath value", "", config.getTessdataPath());
assertEquals("Inva... |
276 | 0 | public void onCreateSSLEngine(SSLEngine engine) {
if (proto.npnHandler != null) {
proto.npnHandler.onCreateEngine(engine);
}
}
}
}
|
277 | 0 | public C mvcMatchers(HttpMethod method, String... mvcPatterns) {
HandlerMappingIntrospector introspector = new HandlerMappingIntrospector(
this.context);
List<RequestMatcher> matchers = new ArrayList<RequestMatcher>(mvcPatterns.length);
for (String mvcPattern : mvcPatterns) {
MvcRequestMatcher matcher = n... |
278 | 0 | public DateTime getSessionNotOnOrAfter() {
return sessionNotOnOrAfter;
}
|
279 | 0 | public String getAlgorithm()
{
return "XMSSMT";
}
|
280 | 0 | public void setDynamicAttribute(String uri, String localName, Object value) throws JspException {
if (ComponentUtils.altSyntax(getStack()) && ComponentUtils.isExpression(value.toString())) {
dynamicAttributes.put(localName, String.valueOf(ObjectUtils.defaultIfNull(findValue(value.toString()), va... |
281 | 0 | public String getDisplayName() {
return "Suspects Causing Unit Tests to Begin Failing";
}
}
}
|
282 | 0 | public MessageBytes newInstance() {
return new MessageBytes();
}
}
}
|
283 | 0 | public static void main(String[] args) {
new RunSQLHelper().runSQL("derbyDB4",
"create table derbyTbl1(num int, addr varchar(40));"
+ "create table derbyTbl2(num int, addr varchar(40));"
+ "create table derbyTbl3(num int, addr varchar(40));"
... |
284 | 0 | public static VersionNumber getVersion() {
try {
return new VersionNumber(VERSION);
} catch (NumberFormatException e) {
try {
// for non-released version of Hudson, this looks like "1.345 (private-foobar), so try to approximate.
int idx = VERSI... |
285 | 0 | public void testUnsafeRedirectActionPrefix() throws Exception {
Map parameterMap = new HashMap();
parameterMap.put("redirectAction:" + "%{3*4}", "");
StrutsMockHttpServletRequest request = new StrutsMockHttpServletRequest();
request.setupGetServletPath("/someServletPath.action");
... |
286 | 0 | public void testBeforeTest() throws IOException {
long clusterSeed = randomLong();
int minNumDataNodes = randomIntBetween(0, 3);
int maxNumDataNodes = randomIntBetween(minNumDataNodes, 4);
final String clusterName = clusterName("shared", Integer.toString(CHILD_JVM_ID), clusterSeed);
... |
287 | 0 | private String extractFullContextPath(HttpServletRequest request) throws MalformedURLException {
String result = null;
String contextPath = request.getContextPath();
String requestUrl = request.getRequestURL().toString();
String requestPath = new URL(requestUrl).getPath();
//... |
288 | 0 | public String filenameOf(@Nonnull String id) {
return super.filenameOf(keyFor(id));
}
/**
* {@inheritDoc}
*/
@Override
|
289 | 0 | ElementKind getKind();
|
290 | 0 | protected void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
log.trace("Service: {}", request);
// is there a consumer registered for the request.
HttpConsumer consumer = getServletResolveConsumerStrategy().resolve(reque... |
291 | 0 | public String getTreeDigest()
{
return DigestUtil.getXMSSDigestName(treeDigest);
}
|
292 | 0 | public void setCustomWorkspace(String customWorkspace) throws IOException {
this.customWorkspace= Util.fixEmptyAndTrim(customWorkspace);
save();
}
|
293 | 0 | public String nextElement() {
underlying.nextElement();
return "application/json";
}
}
} |
294 | 0 | public Set<MediaType> getSupportedTypes(ParseContext context) {
return getWrappedParser().getSupportedTypes(context);
}
/**
* Acts like a regular parser except it ignores the ContentHandler
* and it automatically sets/overwrites the embedded Parser in the
* ParseContext object.
... |
295 | 0 | private void init(InputStream is) {
if (is == null) {
return;
}
Properties props = new Properties();
try {
props.load(is);
} catch (IOException e) {
} finally {
if (is != null) {
try {
is.close();... |
296 | 0 | public String getInfo() {
return (info);
}
|
297 | 0 | public int callback(int num_msg, Pointer msg, Pointer resp, Pointer _) {
LOGGER.fine("pam_conv num_msg="+num_msg);
if(password==null)
return PAM_CONV_ERR;
// allocates pam_response[num_msg]. the caller will free this
Pointe... |
298 | 0 | public boolean isClosed() {
return closed;
}
}
}
|
299 | 0 | private void decodeTest()
{
EllipticCurve curve = new EllipticCurve(
new ECFieldFp(new BigInteger("6277101735386680763835789423207666416083908700390324961279")), // q
new BigInteger("fffffffffffffffffffffffffffffffefffffffffffffffc", 16), // a
new BigInteger("64210519... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.