Unnamed: 0
int64
0
637
label
int64
0
1
code
stringlengths
24
8.83k
100
0
public DescriptorExtensionList compute(Class key) { return DescriptorExtensionList.createDescriptorList(Jenkins.this,key); } }; /** * {@link Computer}s in this Hudson system. Read-only. */
101
0
public synchronized Throwable fillInStackTrace() { // This class does not provide a stack trace return this; } } /** Unexpected end of data. */ private static final IOException EXCEPTION_EOF = new DecodeException("EOF"); /** %xx with not-hex digit */ private...
102
0
private final static int skipSpace(InputAccessor acc, byte b) throws IOException { while (true) { int ch = (int) b & 0xFF; if (!(ch == ' ' || ch == '\r' || ch == '\n' || ch == '\t')) { return ch; } if (!acc.hasMoreBytes()) { ...
103
0
public void destroy() { expiredExchanges.clear(); super.destroy(); }
104
0
public ChannelRequestMatcherRegistry requires(String attribute) { return addAttribute(attribute, requestMatchers); } } }
105
0
public Builder withIndex(int val) { index = val; return this; }
106
0
void send(final String format, final Object... args); }
107
0
public void beforeHandshake(SocketWrapper<Socket> socket) { } } }
108
0
public void fileTest() { File file = FileUtil.file("d:/aaa", "bbb"); Assert.assertNotNull(file); //构建目录中出现非子目录抛出异常 FileUtil.file(file, "../ccc"); } @Test
109
0
public String toString() { return getValue().toString(); }
110
0
private BeanDefinition createSecurityFilterChain(BeanDefinition matcher, ManagedList<?> filters) { BeanDefinitionBuilder sfc = BeanDefinitionBuilder .rootBeanDefinition(DefaultSecurityFilterChain.class); sfc.addConstructorArgValue(matcher); sfc.addConstructorArgValue(filters); return sfc.getBeanDefiniti...
111
0
public String idFromFilename(@Nonnull String filename) { if (filename.matches("[a-z0-9_. -]+")) { return filename; } else { StringBuilder buf = new StringBuilder(filename.length()); final char[] chars = filename.toCharArray(); ...
112
0
protected synchronized void stopInternal() throws LifecycleException { super.stopInternal(); sso = null; }
113
0
public Map<String,WebXml> getFragments() { return fragments; } } }
114
0
private void testModified() throws Exception { KeyFactory kFact = KeyFactory.getInstance("DSA", "BC"); PublicKey pubKey = kFact.generatePublic(PUBLIC_KEY); Signature sig = Signature.getInstance("DSA", "BC"); for (int i = 0; i != MODIFIED_SIGNATURES.length; i++) {...
115
0
public void setUp() throws Exception { super.setUp(); _successfulResult = mock(AuthenticationResult.class); _errorResult = mock(AuthenticationResult.class); _authenticationProvider = mock(UsernamePasswordAuthenticationProvider.class); when(_authenticationProvider.authenti...
116
0
protected void doStop() throws Exception { super.doStop(); // only stop non-shared client if (!sharedClient && client != null) { client.stop(); // stop thread pool Object tp = getClientThreadPool(); if (tp instanceof LifeCycle) { ...
117
0
public int doRead(ByteChunk chunk, Request req) throws IOException { if (endChunk) return -1; if(needCRLFParse) { needCRLFParse = false; parseCRLF(false); } if (remaining <= 0) { if (!parseChunkHeader()) { thr...
118
0
private static void addUsers(final Set<User> users, final TaskListener listener, @CheckForNull Run<?,?> run, final EnvVars env, final Set<InternetAddress> to, final Set<InternetAddress> cc, final Set<InternetAddress> bcc, final IDebug debug) { for (final User user : users) { if (EmailRec...
119
0
public String getDisplayName() { return "Suspects Causing the Build to Begin Failing"; } } }
120
0
public Object getProperty(String name) { String repl = name; if (replacements.get(name) != null) { repl = (String) replacements.get(name); } return IntrospectionUtils.getProperty(protocolHandler, repl); } /** * Set a configured property. */
121
0
public C anyRequest() { return requestMatchers(ANY_REQUEST); } /** * Maps a {@link List} of * {@link org.springframework.security.web.util.matcher.AntPathRequestMatcher} * instances. * * @param method the {@link HttpMethod} to use for any * {@link HttpMethod}. * * @return the object that is chaine...
122
0
protected abstract Log getLog(); /** * The string manager for this package. */
123
0
private void assertRecoveryStateWithoutStage(RecoveryState state, int shardId, Type type, String sourceNode, String targetNode, boolean hasRestoreSource) { assertThat(state.getShardId().getId(), equalTo(shardId)); assertThat(state.getType(), equalTo(t...
124
0
public BeanDefinition parse(Element element, ParserContext parserContext) { List<Element> interceptUrls = DomUtils.getChildElementsByTagName(element, "intercept-url"); // Check for attributes that aren't allowed in this context for (Element elt : interceptUrls) { if (StringUtils.hasLength(elt .getAt...
125
0
private String getComponentName() { Class c = getClass(); String name = c.getName(); int dot = name.lastIndexOf('.'); return name.substring(dot + 1).toLowerCase(); } @Inject(value = StrutsConstants.STRUTS_DEVMODE, required = false)
126
0
public void testSecurityAnnotationsSimple() throws Exception { doTest(DenyAllServlet.class.getName(), false, false, false); }
127
0
public boolean nextRow(ContentHandler handler, ParseContext context) throws IOException, SAXException { //lazy initialization if (results == null) { reset(); } try { if (!results.next()) { return false; } } catch (SQLExcepti...
128
0
public int getIndex() { return index; } @Override
129
0
public EnumSet<MetaData.XContentContext> context() { return EnumSet.of(MetaData.XContentContext.GATEWAY, MetaData.XContentContext.SNAPSHOT); } } } }
130
0
public static void beforeTests() throws Exception { initCore("solrconfig.xml","schema.xml"); } @Override @Before
131
0
public Object create(Context context) throws Exception { ObjectFactory objFactory = context.getContainer().getInstance(ObjectFactory.class); try { return objFactory.buildBean(name, null, true); } catch (ClassNotFoundException ex) { throw new Co...
132
0
public void changePassword_Returns422UnprocessableEntity_NewPasswordSameAsOld() throws Exception { Mockito.reset(passwordValidator); when(expiringCodeStore.retrieveCode("emailed_code")) .thenReturn(new ExpiringCode("emailed_code", new Timestamp(System.currentTimeMillis()+ UaaResetPassw...
133
0
protected void startInternal() throws LifecycleException { String pathName = getPathname(); try (InputStream is = ConfigFileLoader.getInputStream(pathName)) { // Load the contents of the database file if (log.isDebugEnabled()) { log.debug(sm.getString("memoryR...
134
0
public Container getContainer() { return (container); } /** * Set the Container with which this Realm has been associated. * * @param container The associated Container */ @Override
135
0
public String getIconFileName() { return PLUGIN_IMAGES_URL + "icon.png"; } @Override
136
0
public String toString() { final StringBuilder sb = new StringBuilder(); sb.append( "MetaConstraint" ); sb.append( "{constraintType=" ).append( constraintDescriptor.getAnnotation().annotationType().getName() ); sb.append( ", location=" ).append( location ); sb.append( "}" ); return sb.toString(); }
137
0
protected Collection<String> getStandardAttributes() { Class clz = getClass(); Collection<String> standardAttributes = standardAttributesMap.get(clz); if (standardAttributes == null) { Collection<Method> methods = AnnotationUtils.getAnnotatedMethods(clz, StrutsTagAttribute.class)...
138
0
public Builder withIndex(long val) { index = val; return this; }
139
0
private Priority getPriority(String severity) { if (SEVERITY_FATAL.equals(severity) || SEVERITY_ERROR.equals(severity)) { return Priority.HIGH; } if (SEVERITY_INFORMATIONAL.equals(severity)) { return Priority.LOW; } return Priority.NORMAL; }
140
0
public static <E> Closure<E> forClosure(final int count, final Closure<? super E> closure) { if (count <= 0 || closure == null) { return NOPClosure.<E>nopClosure(); } if (count == 1) { return (Closure<E>) closure; } return new ForClosure<E>(count, clos...
141
0
public static boolean isWindows() { return WINDOWS_SEPARATOR == File.separatorChar; } /** * 列出目录文件<br> * 给定的绝对路径不能是压缩包中的路径 * * @param path 目录绝对路径或者相对路径 * @return 文件列表(包含目录) */
142
0
public String getOriginalName() { return originalName; } } }
143
0
protected void engineInitVerify(PublicKey publicKey) throws InvalidKeyException { CipherParameters param = ECUtils.generatePublicKeyParameter(publicKey); digest.reset(); signer.init(false, param); }
144
0
public void readRequest(HttpServletRequest request, HttpMessage message) { LOG.trace("readRequest {}", request); // lets force a parse of the body and headers message.getBody(); // populate the headers from the request Map<String, Object> headers = message.getHeaders...
145
0
public void testStripExpression() throws Exception { // given ValueStack stack = container.getInstance(ValueStackFactory.class).createValueStack(); String anExpression = "%{foo}"; // when String actual = ComponentUtils.stripExpressionIfAltSyntax(stack, anExpression); ...
146
0
public void setMaxExtensionSize(int maxExtensionSize) { this.maxExtensionSize = maxExtensionSize; } /** * This field indicates if the protocol is treated as if it is secure. This * normally means https is being used but can be used to fake https e.g * behind a reverse proxy. */...
147
0
public boolean isStatisticsProvider() { return false; }
148
0
public void addRecipients(final ExtendedEmailPublisherContext context, final EnvVars env, final Set<InternetAddress> to, final Set<InternetAddress> cc, final Set<InternetAddress> bcc) { final class Debug implements RecipientProviderUtilities.IDebug { private final ExtendedEmailPublisher...
149
0
private void filterWithParameterForMethod(String methodParam, String expectedMethod) throws IOException, ServletException { MockHttpServletRequest request = new MockHttpServletRequest("POST", "/hotels"); if(methodParam != null) { request.addParameter("_method", methodParam); } MockHttpServletResponse res...
150
0
public void restorePersistentSettingsTest() throws Exception { logger.info("--> start 2 nodes"); Settings nodeSettings = settingsBuilder() .put("discovery.type", "zen") .put("discovery.zen.ping_timeout", "200ms") .put("discovery.initial_state_timeout",...
151
0
public void init(FilterConfig conf) throws ServletException { if (conf != null && "zookeeper".equals(conf.getInitParameter("signer.secret.provider"))) { SolrZkClient zkClient = (SolrZkClient)conf.getServletContext().getAttribute(KerberosPlugin.DELEGATION_TOKEN_ZK_CLIENT); try { conf....
152
0
javax.xml.transform.Templates processFromNode(Node node, String systemID) throws TransformerConfigurationException { m_DOMsystemID = systemID; return processFromNode(node); } /** * Get InputSource specification(s) that are associated with the * given document specified in the source p...
153
0
protected abstract void handle(Message msg) throws IOException; @Override
154
0
public String[] getRoles(Principal principal) { if (principal instanceof GenericPrincipal) { return ((GenericPrincipal) principal).getRoles(); } String className = principal.getClass().getSimpleName(); throw new IllegalStateException(sm.getString("realmBase.cannotGetRole...
155
0
public ClassLoader bind(boolean usePrivilegedAction, ClassLoader originalClassLoader) { Loader loader = getLoader(); ClassLoader webApplicationClassLoader = null; if (loader != null) { webApplicationClassLoader = loader.getClassLoader(); } if (originalClassLoader...
156
0
public void testInvalidData() throws IOException { Map<String, String> invalidData = new HashMap(); invalidData.put("foo", "bar"); NamedTemporaryFile tempFile = new NamedTemporaryFile("invalid_parser_data", null); try (FileOutputStream fos = new FileOutputStream(tempFile.get().toString()); Zi...
157
0
public void addSecurityRole(String role) { securityRoles.add(role); } @Override
158
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()); }
159
0
public static SVGAttr fromString(String str) { // First check cache to see if it is there SVGAttr attr = cache.get(str); if (attr != null) return attr; // Do the (slow) Enum.valueOf() if (str.equals("class")) { cache.put(str, CLASS); ...
160
0
static public void configureLC(LoggerContext lc, String configFile) throws JoranException { JoranConfigurator configurator = new JoranConfigurator(); lc.reset(); configurator.setContext(lc); configurator.doConfigure(configFile); }
161
0
public void connect(HttpConsumer consumer) throws Exception { component.connect(consumer); }
162
0
public static int log2(int n) { int log = 0; while ((n >>= 1) != 0) { log++; } return log; } /** * Convert int/long to n-byte array. * * @param value int/long value. * @param sizeInByte Size of byte array in byte. * @retu...
163
0
public String getBindDN() { return bindDN.stringValue(); } /** * Retrieves the password for this simple bind request, if no password * provider has been configured. * * @return The password for this simple bind request, or {@code null} if a * password provider will be used to obt...
164
0
protected Log getLog() { return log; } @Override
165
0
public boolean isReadOnly() { return false; }
166
0
public void execute(FunctionContext context) { RegionConfiguration configuration = (RegionConfiguration) context.getArguments(); if (this.cache.getLogger().fineEnabled()) { StringBuilder builder = new StringBuilder(); builder.append("Function ").append(ID).append(" received request: ").append(conf...
167
0
public void setSubjectName(String subjectName) { this.subjectName = subjectName; }
168
0
public void testRejectBindWithDNButNoPasswordAsyncMode() throws Exception { final InMemoryDirectoryServer ds = getTestDS(true, true); final LDAPConnectionOptions options = new LDAPConnectionOptions(); options.setUseSynchronousMode(false); final LDAPConnection conn = ds.getConnection(optio...
169
0
public Collection<ResourcePermission> getRequiredPermissions(String regionName) { return Collections.singletonList(ResourcePermissions.DATA_MANAGE); }
170
0
public void addRecipients(final ExtendedEmailPublisherContext context, final EnvVars env, final Set<InternetAddress> to, final Set<InternetAddress> cc, final Set<InternetAddress> bcc) { final class Debug implements RecipientProviderUtilities.IDebug { private final ExtendedEmailPublisher...
171
0
public void doStart() throws Exception { URI rootURI; if (serverInfo != null) { rootURI = serverInfo.resolveServer(configuredDir); } else { rootURI = configuredDir; } if (!rootURI.getScheme().equals("file")) { throw new IllegalStateExceptio...
172
0
public void setLimit(int limit) { if (buffered == null) { buffered = new ByteChunk(4048); buffered.setLimit(limit); } } // ---------------------------------------------------- InputBuffer Methods /** * Reads the request body and buffers it. */
173
0
public LockoutPolicy getLockoutPolicy() { if(isEnabled) { LockoutPolicy res = IdentityZoneHolder.get().getConfig().getClientLockoutPolicy(); return res.getLockoutAfterFailures() != -1 ? res : defaultLockoutPolicy; } else { return disabledLockoutPolicy; } ...
174
0
private static void post(JenkinsRule.WebClient webClient, String relative, String expectedContentType, Integer expectedStatus) throws IOException { WebRequest request = new WebRequest( UrlUtils.toUrlUnsafe(webClient.getContextPath() + relative), H...
175
0
private void detectJPA() { // check whether we have Persistence on the classpath Class<?> persistenceClass; try { persistenceClass = run( LoadClass.action( PERSISTENCE_CLASS_NAME, this.getClass() ) ); } catch ( ValidationException e ) { log.debugf( "Cannot find %s on classpath. Assuming non JPA 2 ...
176
0
public String getName() { return name; }
177
0
public static <T> Transformer<T, T> cloneTransformer() { return INSTANCE; } /** * Constructor. */
178
0
public static ASN1Enumerated getInstance( ASN1TaggedObject obj, boolean explicit) { ASN1Primitive o = obj.getObject(); if (explicit || o instanceof ASN1Enumerated) { return getInstance(o); } else { return fromOctet...
179
0
public void servletSecurityAnnotationScan() throws ServletException;
180
0
protected AbstractOutputBuffer<Long> getOutputBuffer() { return outputBuffer; }
181
0
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 ...
182
0
public void process(Exchange exchange) throws Exception {
183
0
public void testLauncherServerReuse() throws Exception { ChildProcAppHandle handle1 = null; ChildProcAppHandle handle2 = null; ChildProcAppHandle handle3 = null; try { handle1 = LauncherServer.newAppHandle(); handle2 = LauncherServer.newAppHandle(); LauncherServer server1 = handle1....
184
0
void set(String format, Hash hash) throws ANTLRException { set(format,1,hash); } /** * Returns true if n-th bit is on. */
185
0
private static int getNumberOfIterations(int bits, int certainty) { /* * NOTE: We enforce a minimum 'certainty' of 100 for bits >= 1024 (else 80). Where the * certainty is higher than the FIPS 186-4 tables (C.2/C.3) cater to, extra iterations * are added at the "worst case rat...
186
0
public void setMaxSize(String maxSize) { this.maxSize = Long.parseLong(maxSize); } @Inject
187
0
public <T> T postProcess(T object) { throw new IllegalStateException( ObjectPostProcessor.class.getName() + " is a required bean. Ensure you have used @EnableWebSecurity and @Configuration"); } };
188
0
public String path() { return "path"; } } } public void loadConfig(Class<?>... configs) { this.context = new AnnotationConfigWebApplicationContext(); this.context.register(configs); this.context.setServletContext(new MockServletContext()); this.context.refresh(); this.context.getAutowireCapabl...
189
0
public boolean timedOut() { return timedOut; } } }
190
0
public void destroy() { // NOOP } /** * Initialize this servlet. */ @Override
191
0
public void testBadColorSpace() { TesseractOCRConfig config = new TesseractOCRConfig(); config.setColorspace("someth!ng"); }
192
0
private File getFileParameterFolderUnderBuild(AbstractBuild<?, ?> build){ return new File(build.getRootDir(), FOLDER_NAME); } /** * Default implementation from {@link File}. */
193
0
public void nextBytes(byte[] bytes) { if (first) { super.nextBytes(bytes); first = false; } else { bytes[bytes.length - 1] = 2; } } } }
194
0
protected Timestamp getPasswordLastModifiedTimestamp(Timestamp t) { Calendar cal = new GregorianCalendar(); cal.set(Calendar.MILLISECOND, 0); return new Timestamp(cal.getTimeInMillis()); } @Override
195
0
public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate, final Class<?>[] paramTypes, final Object[] args) { if (classToInstantiate == null) { throw new NullPointerEx...
196
0
public Object evaluate(MessageEvaluationContext message) throws JMSException { try { if (message.isDropped()) { return null; } return evaluator.evaluate(message.getMessage()) ? Boolean.TRUE : Boolean.FALSE; } catch (IOException e) { thr...
197
0
private boolean shutdownDB(String dbName) { boolean ok = true; boolean gotSQLExc = false; try { DerbyConnectionUtil.getDerbyConnection(dbName, DerbyConnectionUtil.SHUTDOWN_DB_PROP); } catch (SQLException se) { gotSQLExc = true; } ...
198
0
public DeserializerFactory withConfig(DeserializerFactoryConfig config) { if (_factoryConfig == config) { return this; } /* 22-Nov-2010, tatu: Handling of subtypes is tricky if we do immutable-with-copy-ctor; * and we pretty much have to here either choose between...
199
0
public void setTransferException(boolean transferException) { this.transferException = transferException; }