_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q178000 | LZMAEncoderNormal.updateOptStateAndReps | test | private void updateOptStateAndReps() {
int optPrev = opts[optCur].optPrev;
assert optPrev < optCur;
if (opts[optCur].prev1IsLiteral) {
--optPrev;
if (opts[optCur].hasPrev2) {
opts[optCur].state.set(opts[opts[optCur].optPrev2].state);
if (... | java | {
"resource": ""
} |
q178001 | LZMAEncoderNormal.calc1BytePrices | test | private void calc1BytePrices(int pos, int posState,
int avail, int anyRepPrice) {
// This will be set to true if using a literal or a short rep.
boolean nextIsByte = false;
int curByte = lz.getByte(0);
int matchByte = lz.getByte(opts[optCur].reps[0] + 1)... | java | {
"resource": ""
} |
q178002 | LZMAEncoderNormal.calcLongRepPrices | test | private int calcLongRepPrices(int pos, int posState,
int avail, int anyRepPrice) {
int startLen = MATCH_LEN_MIN;
int lenLimit = Math.min(avail, niceLen);
for (int rep = 0; rep < REPS; ++rep) {
int len = lz.getMatchLen(opts[optCur].reps[rep], lenLimi... | java | {
"resource": ""
} |
q178003 | LZMAEncoderNormal.calcNormalMatchPrices | test | private void calcNormalMatchPrices(int pos, int posState, int avail,
int anyMatchPrice, int startLen) {
// If the longest match is so long that it would not fit into
// the opts array, shorten the matches.
if (matches.len[matches.count - 1] > avail) {
... | java | {
"resource": ""
} |
q178004 | UTF8Reader.expectedByte | test | private void expectedByte(int position, int count)
throws UTFDataFormatException {
throw new UTFDataFormatException(
Localizer.getMessage("jsp.error.xml.expectedByte",
Integer.toString(position),
Integer.toString(count)));
} | java | {
"resource": ""
} |
q178005 | UTF8Reader.invalidByte | test | private void invalidByte(int position, int count, int c)
throws UTFDataFormatException {
throw new UTFDataFormatException(
Localizer.getMessage("jsp.error.xml.invalidByte",
Integer.toString(position),
Integer.toString(count)));
} | java | {
"resource": ""
} |
q178006 | TldScanner.scanTlds | test | private void scanTlds() throws JasperException {
mappings = new HashMap<String, String[]>();
// Make a local copy of the system jar cache
jarTldCacheLocal.putAll(jarTldCache);
try {
processWebDotXml();
scanJars();
processTldsInFileSystem("/WEB-INF/... | java | {
"resource": ""
} |
q178007 | TldScanner.scanTld | test | private TldInfo scanTld(String resourcePath, String entryName,
InputStream stream)
throws JasperException {
try {
// Parse the tag library descriptor at the specified resource path
TreeNode tld = new ParserUtils().parseXMLDocument(
... | java | {
"resource": ""
} |
q178008 | JspRuntimeContext.addWrapper | test | public void addWrapper(String jspUri, JspServletWrapper jsw) {
jsps.remove(jspUri);
jsps.put(jspUri,jsw);
} | java | {
"resource": ""
} |
q178009 | JspRuntimeContext.getParentClassLoader | test | public ClassLoader getParentClassLoader() {
ClassLoader parentClassLoader =
Thread.currentThread().getContextClassLoader();
if (parentClassLoader == null) {
parentClassLoader = this.getClass().getClassLoader();
}
return parentClassLoader;
} | java | {
"resource": ""
} |
q178010 | JspRuntimeContext.setBytecode | test | public void setBytecode(String name, byte[] bytecode) {
if (bytecode == null) {
bytecodes.remove(name);
bytecodeBirthTimes.remove(name);
return;
}
bytecodes.put(name, bytecode);
bytecodeBirthTimes.put(name, Long.valueOf(System.currentTimeMillis()));
... | java | {
"resource": ""
} |
q178011 | JspRuntimeContext.getBytecodeBirthTime | test | public long getBytecodeBirthTime(String name) {
Long time = bytecodeBirthTimes.get(name);
return (time != null? time.longValue(): 0);
} | java | {
"resource": ""
} |
q178012 | JspRuntimeContext.saveBytecode | test | public void saveBytecode(String className, String classFileName) {
byte[] bytecode = getBytecode(className);
if (bytecode != null) {
try {
FileOutputStream fos = new FileOutputStream(classFileName);
fos.write(bytecode);
fos.close();
... | java | {
"resource": ""
} |
q178013 | JspRuntimeContext.checkCompile | test | private void checkCompile() {
for (JspServletWrapper jsw: jsps.values()) {
if (jsw.isTagFile()) {
// Skip tag files in background compiliations, since modified
// tag files will be recompiled anyway when their client JSP
// pages are compiled. This al... | java | {
"resource": ""
} |
q178014 | JspRuntimeContext.initClassPath | test | private void initClassPath() {
/* Classpath can be specified in one of two ways, depending on
whether the compilation is embedded or invoked from Jspc.
1. Calculated by the web container, and passed to Jasper in the
context attribute.
2. Jspc directly invoke JspCo... | java | {
"resource": ""
} |
q178015 | JspRuntimeContext.threadStart | test | protected void threadStart() {
// Has the background thread already been started?
if (thread != null) {
return;
}
// Start the background thread
threadDone = false;
thread = new Thread(this, threadName);
thread.setDaemon(true);
thread.start()... | java | {
"resource": ""
} |
q178016 | JspRuntimeContext.threadStop | test | protected void threadStop() {
if (thread == null) {
return;
}
threadDone = true;
thread.interrupt();
try {
thread.join();
} catch (InterruptedException e) {
;
}
thread = null;
} | java | {
"resource": ""
} |
q178017 | JspRuntimeContext.run | test | public void run() {
// Loop until the termination semaphore is set
while (!threadDone) {
// Wait for our check interval
threadSleep();
// Check for included files which are newer than the
// JSP which uses them.
try {
... | java | {
"resource": ""
} |
q178018 | ChannelServiceImpl.findByName | test | private Optional<ChannelInstance> findByName ( final String name )
{
if ( name == null )
{
return empty ();
}
final String id = this.manager.accessCall ( KEY_STORAGE, ChannelServiceAccess.class, channels -> {
return channels.mapToId ( name );
} );
... | java | {
"resource": ""
} |
q178019 | ChannelServiceImpl.findChannel | test | private ChannelInstance findChannel ( final By by )
{
final Optional<ChannelInstance> channel;
try ( Locked l = lock ( this.readLock ) )
{
channel = find ( by );
}
if ( !channel.isPresent () )
{
throw new ChannelNotFoundException ( by.toString... | java | {
"resource": ""
} |
q178020 | ChannelServiceImpl.updateDeployGroupCache | test | private void updateDeployGroupCache ( final ChannelServiceAccess model )
{
// this will simply rebuild the complete map
// clear first
this.deployKeysMap.clear ();
// fill afterwards
for ( final Map.Entry<String, Set<String>> entry : model.getDeployGroupMap ().entrySet () )... | java | {
"resource": ""
} |
q178021 | ChannelServiceImpl.listGroups | test | @Override
public List<DeployGroup> listGroups ( final int position, final int count )
{
return this.manager.accessCall ( KEY_STORAGE, ChannelServiceAccess.class, model -> {
return split ( model.getDeployGroups (), position, count );
} );
} | java | {
"resource": ""
} |
q178022 | Streams.copy | test | public static long copy ( final InputStream in, final OutputStream out ) throws IOException
{
Objects.requireNonNull ( in );
Objects.requireNonNull ( out );
final byte[] buffer = new byte[COPY_BUFFER_SIZE];
long result = 0;
int rc;
while ( ( rc = in.read ( buffer ) ... | java | {
"resource": ""
} |
q178023 | Parser.parse | test | public static Node.Nodes parse(ParserController pc,
String path,
JspReader reader,
Node parent,
boolean isTagFile,
boolean directivesOnly,
URL jarFileUrl,
String pageEnc,
String jspConfigPageEnc,
boole... | java | {
"resource": ""
} |
q178024 | Parser.parseAttributes | test | public static Attributes parseAttributes(ParserController pc,
JspReader reader)
throws JasperException {
Parser tmpParser = new Parser(pc, reader, false, false, null, false);
return tmpParser.parseAttributes();
} | java | {
"resource": ""
} |
q178025 | Parser.parseQuoted | test | private String parseQuoted(String tx) {
StringBuilder buf = new StringBuilder();
int size = tx.length();
int i = 0;
while (i < size) {
char ch = tx.charAt(i);
if (ch == '&') {
if (i+5 < size && tx.charAt(i+1) == 'a'
&& tx.charAt(i+2) == 'p' && tx.charAt(i+3) == 'o'
&& tx.charAt(i+4) ... | java | {
"resource": ""
} |
q178026 | Parser.addInclude | test | private void addInclude(Node parent, List files) throws JasperException {
if( files != null ) {
Iterator iter = files.iterator();
while (iter.hasNext()) {
String file = (String) iter.next();
AttributesImpl attrs = new AttributesImpl();
attr... | java | {
"resource": ""
} |
q178027 | Parser.parseJspAttributeAndBody | test | private boolean parseJspAttributeAndBody( Node parent, String tag,
String bodyType )
throws JasperException
{
boolean result = false;
if( reader.matchesOptionalSpacesFollowedBy( "<jsp:attribute" ) ) {
// May be an EmptyBody, depending on whether
// ... | java | {
"resource": ""
} |
q178028 | TreeNode.addAttribute | test | public void addAttribute(String name, String value) {
if (attributes == null)
attributes = new HashMap<String, String>();
attributes.put(name, value);
} | java | {
"resource": ""
} |
q178029 | TreeNode.addChild | test | public void addChild(TreeNode node) {
if (children == null)
children = new ArrayList<TreeNode>();
children.add(node);
} | java | {
"resource": ""
} |
q178030 | TreeNode.findAttributes | test | public Iterator<String> findAttributes() {
Set<String> attrs;
if (attributes == null)
attrs = Collections.emptySet();
else
attrs = attributes.keySet();
return attrs.iterator();
} | java | {
"resource": ""
} |
q178031 | TreeNode.findChildren | test | public Iterator<TreeNode> findChildren() {
List<TreeNode> nodes;
if (children == null)
nodes = Collections.emptyList();
else
nodes = children;
return nodes.iterator();
} | java | {
"resource": ""
} |
q178032 | TreeNode.findChildren | test | public Iterator<TreeNode> findChildren(String name) {
List<TreeNode> results;
if (children == null)
results = Collections.emptyList();
else {
results = new ArrayList<TreeNode>();
for (TreeNode item: children) {
if (name.equals(item.getName()))... | java | {
"resource": ""
} |
q178033 | MavenCoordinates.toBase | test | public MavenCoordinates toBase ()
{
if ( this.classifier == null && this.extension == null )
{
return this;
}
return new MavenCoordinates ( this.groupId, this.artifactId, this.version );
} | java | {
"resource": ""
} |
q178034 | JspContextWrapper.findAlias | test | private String findAlias(String varName) {
if (aliases == null)
return varName;
String alias = aliases.get(varName);
if (alias == null) {
return varName;
}
return alias;
} | java | {
"resource": ""
} |
q178035 | SystemLogHandler.setThread | test | public static void setThread() {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
data.set(baos);
streams.set(new PrintStream(baos));
} | java | {
"resource": ""
} |
q178036 | SystemLogHandler.unsetThread | test | public static String unsetThread() {
ByteArrayOutputStream baos =
(ByteArrayOutputStream) data.get();
if (baos == null) {
return null;
}
streams.set(null);
data.set(null);
return baos.toString();
} | java | {
"resource": ""
} |
q178037 | SystemLogHandler.findStream | test | protected PrintStream findStream() {
PrintStream ps = (PrintStream) streams.get();
if (ps == null) {
ps = wrapped;
}
return ps;
} | java | {
"resource": ""
} |
q178038 | RepoBuilder.writeOptional | test | protected static void writeOptional ( final StringWriter writer, final String fieldName, final String value )
{
if ( value != null )
{
write ( writer, fieldName, value );
}
} | java | {
"resource": ""
} |
q178039 | RepoBuilder.write | test | protected static void write ( final StringWriter writer, final String fieldName, final String value )
{
writer.write ( fieldName + ": " + value + "\n" );
} | java | {
"resource": ""
} |
q178040 | XmlHelper.addElement | test | public static Element addElement ( final Element parent, final String name )
{
final Element ele = parent.getOwnerDocument ().createElement ( name );
parent.appendChild ( ele );
return ele;
} | java | {
"resource": ""
} |
q178041 | XmlHelper.addElementFirst | test | public static Element addElementFirst ( final Element parent, final String name )
{
final Element ele = parent.getOwnerDocument ().createElement ( name );
parent.insertBefore ( ele, null );
return ele;
} | java | {
"resource": ""
} |
q178042 | BodyContentImpl.writeOut | test | public void writeOut(Writer out) throws IOException {
if (writer == null) {
out.write(cb, 0, nextChar);
// Flush not called as the writer passed could be a BodyContent and
// it doesn't allow to flush.
}
} | java | {
"resource": ""
} |
q178043 | BodyContentImpl.setWriter | test | void setWriter(Writer writer) {
this.writer = writer;
if (writer != null) {
// According to the spec, the JspWriter returned by
// JspContext.pushBody(java.io.Writer writer) must behave as
// though it were unbuffered. This means that its getBufferSize()
// must always return 0. The implementatio... | java | {
"resource": ""
} |
q178044 | BodyContentImpl.reAllocBuff | test | private void reAllocBuff(int len) {
if (bufferSize + len <= cb.length) {
bufferSize = cb.length;
return;
}
if (len < cb.length) {
len = cb.length;
}
bufferSize = cb.length + len;
char[] tmp = new char[bufferSize];
System.arraycopy(... | java | {
"resource": ""
} |
q178045 | ELFunctionMapper.map | test | public static void map(Compiler compiler, Node.Nodes page)
throws JasperException {
ELFunctionMapper map = new ELFunctionMapper();
map.ds = new StringBuilder();
map.ss = new StringBuilder();
page.visit(map.new ELFunctionVisitor());
// Append the declarations to the root node
String ds = map.ds.toString();
... | java | {
"resource": ""
} |
q178046 | StorageManager.getSameParent | test | private static State getSameParent ( final State parent, final MetaKey key )
{
State current = parent;
while ( current != null )
{
if ( current.key.equals ( key ) )
{
return current;
}
current = current.parent;
}
... | java | {
"resource": ""
} |
q178047 | StorageManager.registerModel | test | public StorageRegistration registerModel ( final long lockPriority, final MetaKey key, final StorageModelProvider<?, ?> storageProvider ) throws ModelInitializationException
{
this.modelLock.writeLock ().lock ();
try
{
testClosed ();
if ( this.modelKeyMap.containsKey... | java | {
"resource": ""
} |
q178048 | CacheStore.stream | test | public boolean stream ( final MetaKey key, final IOConsumer<InputStream> consumer ) throws IOException
{
return streamFrom ( this.dataPath, key, consumer );
} | java | {
"resource": ""
} |
q178049 | JobController.monitor | test | @RequestMapping ( "/{id}/monitor" )
public ModelAndView monitor ( @PathVariable ( "id" ) final String id)
{
final JobHandle job = this.manager.getJob ( id );
if ( job != null )
{
logger.debug ( "Job: {} - {}", job.getId (), job.getState () );
}
else
{... | java | {
"resource": ""
} |
q178050 | AbstractChannelServiceServlet.isAuthenticated | test | protected boolean isAuthenticated ( final By by, final HttpServletRequest request )
{
final String[] authToks = parseAuthorization ( request );
if ( authToks == null )
{
return false;
}
// we don't enforce the "deploy" user name anymore
final String dep... | java | {
"resource": ""
} |
q178051 | UrlSetWriter.finish | test | public void finish () throws IOException
{
if ( !this.finished )
{
this.finished = true;
writeEnd ();
}
try
{
this.out.close ();
}
catch ( final XMLStreamException e )
{
throw new IOException ( e );
... | java | {
"resource": ""
} |
q178052 | ChannelData.makeGson | test | public static Gson makeGson ( final boolean pretty )
{
final GsonBuilder gb = new GsonBuilder ();
if ( pretty )
{
gb.setPrettyPrinting ();
}
gb.registerTypeAdapter ( Node.class, new NodeAdapter () );
gb.registerTypeAdapter ( byte[].class, new ByteArrayAd... | java | {
"resource": ""
} |
q178053 | LZMAEncoder.encodeForLZMA2 | test | public boolean encodeForLZMA2() {
// LZMA2 uses RangeEncoderToBuffer so IOExceptions aren't possible.
try {
if (!lz.isStarted() && !encodeInit())
return false;
while (uncompressedSize <= LZMA2_UNCOMPRESSED_LIMIT
&& rc.getPendingSize() <= LZMA2... | java | {
"resource": ""
} |
q178054 | MetaKeys.union | test | public static Map<MetaKey, String> union ( final Map<MetaKey, String> providedMetaData, final Map<MetaKey, String> extractedMetaData )
{
final int size1 = providedMetaData != null ? providedMetaData.size () : 0;
final int size2 = extractedMetaData != null ? extractedMetaData.size () : 0;
if... | java | {
"resource": ""
} |
q178055 | JspRuntimeLibrary.getThrowable | test | public static Throwable getThrowable(ServletRequest request) {
Throwable error = (Throwable) request.getAttribute(SERVLET_EXCEPTION);
if (error == null) {
error = (Throwable) request.getAttribute(JSP_EXCEPTION);
if (error != null) {
/*
* The only place that sets JSP_EXCEPTION is
* PageContextImpl.ha... | java | {
"resource": ""
} |
q178056 | Uploader.isCheckSum | test | private String isCheckSum ( final Coordinates c )
{
final String cext = c.getExtension ();
if ( cext == null )
{
return null;
}
for ( final String ext : this.options.getChecksumExtensions () )
{
if ( cext.endsWith ( "." + ext ) )
... | java | {
"resource": ""
} |
q178057 | LZMAOutputStream.finish | test | public void finish() throws IOException {
if (!finished) {
if (exception != null)
throw exception;
try {
if (expectedUncompressedSize != -1
&& expectedUncompressedSize != currentUncompressedSize)
throw new XZIOE... | java | {
"resource": ""
} |
q178058 | PageContextImpl.getException | test | public Exception getException() {
Throwable t = JspRuntimeLibrary.getThrowable(request);
// Only wrap if needed
if((t != null) && (! (t instanceof Exception))) {
t = new JspException(t);
}
return (Exception) t;
} | java | {
"resource": ""
} |
q178059 | PageContextImpl.evaluateExpression | test | public static Object evaluateExpression(final String expression,
final Class expectedType,
final PageContext pageContext,
final ProtectedFunctionMapper functionMap)
throws ELException
{
Object retValue;
if (SecurityUtil.isPackageProtectionEnabled()){
try {
... | java | {
"resource": ""
} |
q178060 | SystemServiceImpl.makePrefixFromOsgiProperties | test | protected String makePrefixFromOsgiProperties ()
{
final String port = System.getProperty ( "org.osgi.service.http.port" );
if ( port == null )
{
return null;
}
final StringBuilder sb = new StringBuilder ();
sb.append ( "http://" ).append ( discoverHostna... | java | {
"resource": ""
} |
q178061 | XmlFiles.isXml | test | public static boolean isXml ( final Path path ) throws IOException
{
final XmlToolsFactory xml = Activator.getXmlToolsFactory ();
final XMLInputFactory xin = xml.newXMLInputFactory ();
try ( InputStream stream = new BufferedInputStream ( Files.newInputStream ( path ) ) )
{
... | java | {
"resource": ""
} |
q178062 | TagFileProcessor.parseTagFileDirectives | test | public static TagInfo parseTagFileDirectives(ParserController pc,
String name,
String path,
TagLibraryInfo tagLibInfo)
throws JasperException {
ErrorDispatcher err = pc.getCompiler().getErrorDispatcher();
Node.Nodes page = null;
try {
pa... | java | {
"resource": ""
} |
q178063 | TagFileProcessor.loadTagFile | test | private Class loadTagFile(Compiler compiler,
String tagFilePath, TagInfo tagInfo,
PageInfo parentPageInfo)
throws JasperException {
JspCompilationContext ctxt = compiler.getCompilationContext();
JspRuntimeContext rctxt = ctxt.getRuntim... | java | {
"resource": ""
} |
q178064 | TagFileProcessor.removeProtoTypeFiles | test | public void removeProtoTypeFiles(String classFileName) {
Iterator<Compiler> iter = tempVector.iterator();
while (iter.hasNext()) {
Compiler c = iter.next();
if (classFileName == null) {
c.removeGeneratedClassFiles();
} else if (classFileName.equals(
... | java | {
"resource": ""
} |
q178065 | JspC.main | test | public static void main(String arg[]) {
if (arg.length == 0) {
System.out.println(Localizer.getMessage("jspc.usage"));
} else {
JspC jspc = new JspC();
try {
jspc.setArgs(arg);
if (jspc.helpNeeded) {
System.out.printl... | java | {
"resource": ""
} |
q178066 | JspC.setUriroot | test | public void setUriroot( String s ) {
uriRoot = s;
if (s != null) {
try {
uriRoot=new File( s ).getCanonicalPath();
} catch( Exception ex ) {
uriRoot=s;
}
}
} | java | {
"resource": ""
} |
q178067 | JspC.scanFiles | test | public void scanFiles( File base ) throws JasperException {
Stack<String> dirs = new Stack<String>();
dirs.push(base.toString());
if (extensions == null) {
extensions = new ArrayList<String>();
extensions.add("jsp");
extensions.add("jspx");
}
w... | java | {
"resource": ""
} |
q178068 | JspC.locateUriRoot | test | private void locateUriRoot( File f ) {
String tUriBase = uriBase;
if (tUriBase == null) {
tUriBase = "/";
}
try {
if (f.exists()) {
f = new File(f.getCanonicalPath());
while (f != null) {
File g = new File(f, "WE... | java | {
"resource": ""
} |
q178069 | JspC.initSystemClassLoader | test | private ClassLoader initSystemClassLoader() throws IOException {
String sysClassPath = getSystemClassPath();
if (sysClassPath == null) {
return null;
}
ArrayList<URL> urls = new ArrayList<URL>();
StringTokenizer tokenizer = new StringTokenizer(sysClassPath,
... | java | {
"resource": ""
} |
q178070 | HC4.movePos | test | private int movePos() {
int avail = movePos(4, 4);
if (avail != 0) {
if (++lzPos == Integer.MAX_VALUE) {
int normalizationOffset = Integer.MAX_VALUE - cyclicSize;
hash.normalize(normalizationOffset);
normalize(chain, cyclicSize, normalizationO... | java | {
"resource": ""
} |
q178071 | JspReader.matches | test | boolean matches(String string) throws JasperException {
Mark mark = mark();
int ch = 0;
int i = 0;
do {
ch = nextChar();
if (((char) ch) != string.charAt(i++)) {
reset(mark);
return false;
}
} while (i < string.length());
return true;
} | java | {
"resource": ""
} |
q178072 | JspReader.matchesOptionalSpacesFollowedBy | test | boolean matchesOptionalSpacesFollowedBy( String s )
throws JasperException
{
Mark mark = mark();
skipSpaces();
boolean result = matches( s );
if( !result ) {
reset( mark );
}
return result;
} | java | {
"resource": ""
} |
q178073 | JspReader.skipUntil | test | Mark skipUntil(String limit) throws JasperException {
Mark ret = null;
int limlen = limit.length();
int ch;
skip:
for (ret = mark(), ch = nextChar() ; ch != -1 ;
ret = mark(), ch = nextChar()) {
if (ch == limit.charAt(0)) {
Mark restart =... | java | {
"resource": ""
} |
q178074 | JspReader.skipUntilIgnoreEsc | test | Mark skipUntilIgnoreEsc(String limit) throws JasperException {
Mark ret = null;
int limlen = limit.length();
int ch;
int prev = 'x'; // Doesn't matter
skip:
for (ret = mark(), ch = nextChar() ; ch != -1 ;
ret = mark(), prev = ch, ch = nextChar()) {
if (ch == '\\' && prev == '\\') {
ch =... | java | {
"resource": ""
} |
q178075 | JspReader.skipUntilETag | test | Mark skipUntilETag(String tag) throws JasperException {
Mark ret = skipUntil("</" + tag);
if (ret != null) {
skipSpaces();
if (nextChar() != '>')
ret = null;
}
return ret;
} | java | {
"resource": ""
} |
q178076 | JspReader.parseToken | test | String parseToken(boolean quoted) throws JasperException {
StringBuilder stringBuffer = new StringBuilder();
skipSpaces();
stringBuffer.setLength(0);
if (!hasMoreInput()) {
return "";
}
int ch = peekChar();
if (quoted) {
if (ch == '"' || ch == '\'') {
char endQuote = ch == ... | java | {
"resource": ""
} |
q178077 | JspReader.popFile | test | private boolean popFile() throws JasperException {
// Is stack created ? (will happen if the Jsp file we're looking at is
// missing.
if (current == null || currFileId < 0) {
return false;
}
// Restore parser state:
String fName = getFile(currFileId);
currFileId = unregisterSourceFile(fName);
if (currFil... | java | {
"resource": ""
} |
q178078 | Coordinates.makeUnclassified | test | public Coordinates makeUnclassified ()
{
if ( this.classifier == null )
{
return this;
}
return new Coordinates ( this.groupId, this.artifactId, this.version, this.qualifiedVersion, null, this.extension );
} | java | {
"resource": ""
} |
q178079 | AspectInformation.filterIds | test | public static List<AspectInformation> filterIds ( final List<AspectInformation> list, final Predicate<String> predicate )
{
if ( list == null )
{
return null;
}
return list.stream ().filter ( ( i ) -> predicate.test ( i.getFactoryId () ) ).collect ( Collectors.toList () ... | java | {
"resource": ""
} |
q178080 | AspectInformation.getMissingIds | test | public String[] getMissingIds ( final List<AspectInformation> assignedAspects )
{
final Set<AspectInformation> required = new HashSet<> ();
addRequired ( required, this, assignedAspects );
return required.stream ().map ( AspectInformation::getFactoryId ).toArray ( size -> new String[size] ... | java | {
"resource": ""
} |
q178081 | ParserUtils.setSchemaResourcePrefix | test | public static void setSchemaResourcePrefix(String prefix) {
if (prefix != null && prefix.startsWith("file:")) {
schemaResourcePrefix = uencode(prefix);
isSchemaResourcePrefixFileUrl = true;
} else {
schemaResourcePrefix = prefix;
isSchemaResourcePrefixFil... | java | {
"resource": ""
} |
q178082 | ParserUtils.setDtdResourcePrefix | test | public static void setDtdResourcePrefix(String prefix) {
if (prefix != null && prefix.startsWith("file:")) {
dtdResourcePrefix = uencode(prefix);
isDtdResourcePrefixFileUrl = true;
} else {
dtdResourcePrefix = prefix;
isDtdResourcePrefixFileUrl = false;
... | java | {
"resource": ""
} |
q178083 | ParserUtils.uencode | test | private static String uencode(String prefix) {
if (prefix != null && prefix.startsWith("file:")) {
StringTokenizer tokens = new StringTokenizer(prefix, "/\\:", true);
StringBuilder stringBuilder = new StringBuilder();
while (tokens.hasMoreElements()) {
String ... | java | {
"resource": ""
} |
q178084 | ParserUtils.convert | test | protected TreeNode convert(TreeNode parent, Node node) {
// Construct a new TreeNode for this node
TreeNode treeNode = new TreeNode(node.getNodeName(), parent);
// Convert all attributes of this node
NamedNodeMap attributes = node.getAttributes();
if (attributes != null) {
... | java | {
"resource": ""
} |
q178085 | BindingManager.mergeErrors | test | private static void mergeErrors ( final BindingResult bindingResult, final BindingResult result )
{
if ( bindingResult == null )
{
return;
}
result.addErrors ( bindingResult.getLocalErrors () );
for ( final Map.Entry<String, BindingResult> child : bindingResult.... | java | {
"resource": ""
} |
q178086 | BindingManager.initializeBinder | test | private void initializeBinder ( final Binder binder )
{
for ( final Method m : binder.getClass ().getMethods () )
{
if ( !m.isAnnotationPresent ( Binder.Initializer.class ) )
{
continue;
}
final Call call = bind ( m, binder );
... | java | {
"resource": ""
} |
q178087 | ChannelAspectProcessor.scanAspectInformations | test | public static Map<String, ChannelAspectInformation> scanAspectInformations ( final BundleContext context )
{
Collection<ServiceReference<ChannelAspectFactory>> refs;
try
{
refs = context.getServiceReferences ( ChannelAspectFactory.class, null );
}
catch ( final In... | java | {
"resource": ""
} |
q178088 | SmapUtil.unqualify | test | private static String unqualify(String path) {
path = path.replace('\\', '/');
return path.substring(path.lastIndexOf('/') + 1);
} | java | {
"resource": ""
} |
q178089 | TagPluginManager.invokePlugin | test | private void invokePlugin(Node.CustomTag n) {
TagPlugin tagPlugin = tagPlugins.get(n.getTagHandlerClass().getName());
if (tagPlugin == null) {
return;
}
TagPluginContext tagPluginContext = new TagPluginContextImpl(n, pageInfo);
n.setTagPluginContext(tagPluginContext);
tagPlugin.doTag(tagPluginContext);
... | java | {
"resource": ""
} |
q178090 | BasicArrayCache.getByteArray | test | public byte[] getByteArray(int size, boolean fillWithZeros) {
byte[] array = getArray(byteArrayCache, size);
if (array == null)
array = new byte[size];
else if (fillWithZeros)
Arrays.fill(array, (byte)0x00);
return array;
} | java | {
"resource": ""
} |
q178091 | BasicArrayCache.getIntArray | test | public int[] getIntArray(int size, boolean fillWithZeros) {
int[] array = getArray(intArrayCache, size);
if (array == null)
array = new int[size];
else if (fillWithZeros)
Arrays.fill(array, 0);
return array;
} | java | {
"resource": ""
} |
q178092 | AetherImporter.asResult | test | public static AetherResult asResult ( final Collection<ArtifactResult> results, final ImportConfiguration cfg, final Optional<DependencyResult> dependencyResult )
{
final AetherResult result = new AetherResult ();
// create set of requested coordinates
final Set<String> requested = new Has... | java | {
"resource": ""
} |
q178093 | TagLibraryInfoImpl.getResourceAsStream | test | private InputStream getResourceAsStream(String uri)
throws JasperException
{
try {
// see if file exists on the filesystem first
String real = ctxt.getRealPath(uri);
if (real == null) {
return ctxt.getResourceAsStream(uri);
} else {
... | java | {
"resource": ""
} |
q178094 | TagLibraryInfoImpl.validate | test | public ValidationMessage[] validate(PageData thePage) {
TagLibraryValidator tlv = getTagLibraryValidator();
if (tlv == null) return null;
String uri = getURI();
if (uri.startsWith("/")) {
uri = URN_JSPTLD + uri;
}
ValidationMessage[] messages = tlv.validate(getPrefixStrin... | java | {
"resource": ""
} |
q178095 | Mark.pushStream | test | public void pushStream(char[] inStream, int inFileid, String name,
String inBaseDir, String inEncoding)
{
// store current state in stack
includeStack.push(new IncludeState(cursor, line, col, fileid, fileName, baseDir,
encoding, stream) );
// set new variables
cursor = 0;
line = 1;
col = 1;
... | java | {
"resource": ""
} |
q178096 | XMLEncodingDetector.getEncoding | test | public static Object[] getEncoding(String fname, JarFile jarFile,
JspCompilationContext ctxt,
ErrorDispatcher err)
throws IOException, JasperException
{
InputStream inStream = JspUtil.getInputStream(fname, jarFile, ctxt,
... | java | {
"resource": ""
} |
q178097 | XMLEncodingDetector.scanXMLDecl | test | private void scanXMLDecl() throws IOException, JasperException {
if (skipString("<?xml")) {
fMarkupDepth++;
// NOTE: special case where document starts with a PI
// whose name starts with "xml" (e.g. "xmlfoo")
if (XMLChar.isName(peekChar())) {
fStringBuffer.clear();
fStringBuffer.append(... | java | {
"resource": ""
} |
q178098 | XMLEncodingDetector.reportFatalError | test | private void reportFatalError(String msgId, String arg)
throws JasperException {
err.jspError(msgId, arg);
} | java | {
"resource": ""
} |
q178099 | JspCServletContext.getRealPath | test | public String getRealPath(String path) {
if (!myResourceBaseURL.getProtocol().equals("file"))
return (null);
if (!path.startsWith("/"))
return (null);
try {
return
(getResource(path).getFile().replace('/', File.separatorChar));
} catch... | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.