_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q177900
ColorMap.subrange
test
void subrange(int from, int to, State lp, State rp) throws RegexException { /* Avoid one call to map.get() for each character in the range. * This map will usually contain one item, but in complex cases more. * For example, if we had [a-f][g-h] and then someone asked for [f-g], there ...
java
{ "resource": "" }
q177901
ColorMap.okcolors
test
void okcolors(Nfa nfa) { ColorDesc cd; ColorDesc scd; Arc a; short sco; for (short co = 0; co < colorDescs.size(); co++) { cd = colorDescs.get(co); if (cd == null) { continue; // not in use at all, so can't have a subcolor. } ...
java
{ "resource": "" }
q177902
ColorMap.colorchain
test
void colorchain(Arc a) { ColorDesc cd = colorDescs.get(a.co); a.colorchain = cd.arcs; cd.arcs = a; }
java
{ "resource": "" }
q177903
ColorMap.uncolorchain
test
void uncolorchain(Arc a) { ColorDesc cd = colorDescs.get(a.co); Arc aa; aa = cd.arcs; if (aa == a) { /* easy case */ cd.arcs = a.colorchain; } else { for (; aa != null && aa.colorchain != a; aa = aa.colorchain) { // } ...
java
{ "resource": "" }
q177904
ColorMap.dumpcolors
test
void dumpcolors() { /* * we want to organize this by colors. */ for (int co = 0; co < colorDescs.size(); co++) { ColorDesc cd = colorDescs.get(co); if (cd != null) { dumpcolor(co, cd); } } }
java
{ "resource": "" }
q177905
Lex.lexstart
test
void lexstart() throws RegexException { prefixes(); /* may turn on new type bits etc. */ if (0 != (v.cflags & Flags.REG_QUOTE)) { assert 0 == (v.cflags & (Flags.REG_ADVANCED | Flags.REG_EXPANDED | Flags.REG_NEWLINE)); intocon(L_Q); } else if (0 != (v.cflags & Fla...
java
{ "resource": "" }
q177906
Lex.prefixes
test
void prefixes() throws RegexException { /* literal string doesn't get any of this stuff */ if (0 != (v.cflags & Flags.REG_QUOTE)) { return; } /* initial "***" gets special things */ if (have(4) && next3('*', '*', '*')) { switch (charAtNowPlus(3)) { ca...
java
{ "resource": "" }
q177907
Lex.lexnest
test
void lexnest(char[] interpolated) { assert v.savepattern == null; /* only one level of nesting */ v.savepattern = v.pattern; v.savenow = v.now; v.savestop = v.stop; v.savenow = v.now; v.pattern = interpolated; v.now = 0; v.stop = v.pattern.length; }
java
{ "resource": "" }
q177908
RuntimeColorMap.getcolor
test
short getcolor(int codepoint) { try { return fullMap.get(codepoint); } catch (NullPointerException npe) { throw new RuntimeException(String.format(" CP %08x no mapping", codepoint)); } }
java
{ "resource": "" }
q177909
Dfa.initialize
test
StateSet initialize(int start) { // Discard state sets; reuse would be faster if we kept them, // but then we'd need the real cache. stateSets.clear(); StateSet stateSet = new StateSet(nstates, ncolors); stateSet.states.set(cnfa.pre); stateSet.noprogress = true; /...
java
{ "resource": "" }
q177910
Dfa.lastcold
test
int lastcold() { int nopr = 0; for (StateSet ss : stateSets.values()) { if (ss.noprogress && nopr < ss.getLastSeen()) { nopr = ss.getLastSeen(); } } return nopr; }
java
{ "resource": "" }
q177911
Locale.eclass
test
static UnicodeSet eclass(char c, boolean cases) { /* otherwise, none */ if (cases) { return allcases(c); } else { UnicodeSet set = new UnicodeSet(); set.add(c); return set; } }
java
{ "resource": "" }
q177912
Locale.cclass
test
public static UnicodeSet cclass(String cclassName, boolean casefold) throws RegexException { try { if (casefold) { return KNOWN_SETS_CI.get(cclassName); } else { return KNOWN_SETS_CS.get(cclassName); } } catch (ExecutionException e) { ...
java
{ "resource": "" }
q177913
CnfaBuilder.carcsort
test
void carcsort(int first, int last) { int p; int q; long tmp; if (last - first <= 1) { return; } for (p = first; p <= last; p++) { for (q = p; q <= last; q++) { short pco = Cnfa.carcColor(arcs[p]); short qco = Cnfa....
java
{ "resource": "" }
q177914
Subre.dumpst
test
String dumpst(boolean nfapresent) { StringBuilder sb = new StringBuilder(); sb.append(String.format("%s. `%c'", shortId(), op)); if (0 != (flags & LONGER)) { sb.append(" longest"); } if (0 != (flags & SHORTER)) { sb.append(" shortest"); } ...
java
{ "resource": "" }
q177915
Nfa.newstate
test
State newstate(int flag) { State newState = new State(); newState.no = nstates++; // a unique number. if (states == null) { states = newState; } if (slast != null) { assert slast.next == null; slast.next = newState; } newState.p...
java
{ "resource": "" }
q177916
Nfa.moveouts
test
void moveouts(State old, State newState) { Arc a; assert old != newState; while ((a = old.outs) != null) { cparc(a, newState, a.to); freearc(a); } }
java
{ "resource": "" }
q177917
Nfa.moveins
test
void moveins(State old, State newState) { Arc a; assert old != newState; while ((a = old.ins) != null) { cparc(a, a.from, newState); freearc(a); } assert old.nins == 0; assert old.ins == null; }
java
{ "resource": "" }
q177918
Nfa.copyins
test
void copyins(State old, State newState) { Arc a; assert old != newState; for (a = old.ins; a != null; a = a.inchain) { cparc(a, a.from, newState); } }
java
{ "resource": "" }
q177919
Nfa.copyouts
test
void copyouts(State old, State newState) { Arc a; assert old != newState; for (a = old.outs; a != null; a = a.outchain) { cparc(a, newState, a.to); } }
java
{ "resource": "" }
q177920
Nfa.dropstate
test
void dropstate(State s) { Arc a; while ((a = s.ins) != null) { freearc(a); } while ((a = s.outs) != null) { freearc(a); } freestate(s); }
java
{ "resource": "" }
q177921
Nfa.freestate
test
void freestate(State s) { assert s != null; assert s.nins == 0; assert s.nouts == 0; if (s.next != null) { s.next.prev = s.prev; } else { assert s == slast; slast = s.prev; } if (s.prev != null) { s.prev.next = s.nex...
java
{ "resource": "" }
q177922
Nfa.cparc
test
void cparc(Arc oa, State from, State to) { newarc(oa.type, oa.co, from, to); }
java
{ "resource": "" }
q177923
Nfa.duptraverse
test
void duptraverse(State s, State stmp) { Arc a; if (s.tmp != null) { return; /* already done */ } s.tmp = (stmp == null) ? newstate() : stmp; if (s.tmp == null) { return; } for (a = s.outs; a != null; a = a.outchain) { dup...
java
{ "resource": "" }
q177924
Nfa.specialcolors
test
void specialcolors() { /* false colors for BOS, BOL, EOS, EOL */ if (parent == null) { bos[0] = cm.pseudocolor(); bos[1] = cm.pseudocolor(); eos[0] = cm.pseudocolor(); eos[1] = cm.pseudocolor(); } else { assert parent.bos[0] != Constants.CO...
java
{ "resource": "" }
q177925
Nfa.dumpnfa
test
void dumpnfa() { if (!LOG.isDebugEnabled() || !IS_DEBUG) { return; } LOG.debug("dump nfa"); StringBuilder sb = new StringBuilder(); sb.append(String.format("pre %d, post %d init %d final %d", pre.no, post.no, init.no, finalState.no)); if (bos[0] != Constant...
java
{ "resource": "" }
q177926
Nfa.dumpstate
test
void dumpstate(State s) { Arc a; if (!LOG.isDebugEnabled() || !IS_DEBUG) { return; } StringBuilder sb = new StringBuilder(); sb.append(String.format("State %d%s%c", s.no, (s.tmp != null) ? "T" : "", (s.flag != 0) ? (char)s.flag : '.')); if (s...
java
{ "resource": "" }
q177927
Nfa.dumparcs
test
void dumparcs(State s, StringBuilder sb) { int pos; assert s.nouts > 0; /* printing arcs in reverse order is usually clearer */ pos = dumprarcs(s.outs, s, 1, sb); if (pos != 1) { //sb.append("\n"); } }
java
{ "resource": "" }
q177928
Nfa.dumprarcs
test
int dumprarcs(Arc a, State s, int pos, StringBuilder sb) { if (a.outchain != null) { pos = dumprarcs(a.outchain, s, pos, sb); } dumparc(a, s, sb); if (pos == 5) { sb.append("\n"); pos = 1; } else { pos++; } return po...
java
{ "resource": "" }
q177929
Nfa.dumparc
test
void dumparc(Arc a, State s, StringBuilder sb) { sb.append("\t"); switch (a.type) { case Compiler.PLAIN: sb.append(String.format("[%d]", a.co)); break; case Compiler.AHEAD: sb.append(String.format(">%d>", a.co)); break; case Compil...
java
{ "resource": "" }
q177930
Nfa.optimize
test
long optimize() throws RegexException { LOG.debug("initial cleanup"); cleanup(); /* may simplify situation */ dumpnfa(); LOG.debug("empties"); fixempties(); /* get rid of EMPTY arcs */ LOG.debug("constraints"); pullback(); /* pull back constraints backward ...
java
{ "resource": "" }
q177931
Nfa.analyze
test
long analyze() { Arc a; Arc aa; if (pre.outs == null) { return Flags.REG_UIMPOSSIBLE; } for (a = pre.outs; a != null; a = a.outchain) { for (aa = a.to.outs; aa != null; aa = aa.outchain) { if (aa.to == post) { return Fl...
java
{ "resource": "" }
q177932
Nfa.combine
test
int combine(Arc con, Arc a) throws RegexException { //# define CA(ct,at) (((ct)<<CHAR_BIT) | (at)) //CA(con->type, a->type)) { switch ((con.type << 8) | a.type) { case '^' << 8 | Compiler.PLAIN: /* newlines are handled separately */ case '$' << 8 | Compiler.PLAIN: ...
java
{ "resource": "" }
q177933
Nfa.cleanup
test
void cleanup() { State s; State nexts; int n; /* clear out unreachable or dead-end states */ /* use pre to mark reachable, then post to mark can-reach-post */ markreachable(pre, null, pre); markcanreach(post, pre, post); for (s = states; s != null; s = nexts) { ...
java
{ "resource": "" }
q177934
Nfa.markreachable
test
void markreachable(State s, State okay, State mark) { Arc a; if (s.tmp != okay) { return; } s.tmp = mark; for (a = s.outs; a != null; a = a.outchain) { markreachable(a.to, okay, mark); } }
java
{ "resource": "" }
q177935
Nfa.markcanreach
test
void markcanreach(State s, State okay, State mark) { Arc a; if (s.tmp != okay) { return; } s.tmp = mark; for (a = s.ins; a != null; a = a.inchain) { markcanreach(a.from, okay, mark); } }
java
{ "resource": "" }
q177936
Nfa.fixempties
test
void fixempties() { State s; State nexts; Arc a; Arc nexta; boolean progress; /* find and eliminate empties until there are no more */ do { progress = false; for (s = states; s != null; s = nexts) { nexts = s.next; ...
java
{ "resource": "" }
q177937
Nfa.unempty
test
boolean unempty(Arc a) { State from = a.from; State to = a.to; boolean usefrom; /* work on from, as opposed to to? */ assert a.type == Compiler.EMPTY; assert from != pre && to != post; if (from == to) { /* vacuous loop */ freearc(a); ...
java
{ "resource": "" }
q177938
AnalyzeTask.getRuleParameters
test
private Map<String, String> getRuleParameters() throws CliExecutionException { Map<String, String> ruleParameters; if (ruleParametersFile == null) { ruleParameters = Collections.emptyMap(); } else { Properties properties = new Properties(); try { ...
java
{ "resource": "" }
q177939
AnalyzeTask.getRuleInterpreterPlugins
test
private Map<String, Collection<RuleInterpreterPlugin>> getRuleInterpreterPlugins() throws CliExecutionException { try { return pluginRepository.getRuleInterpreterPluginRepository().getRuleInterpreterPlugins(Collections.<String, Object> emptyMap()); } catch (PluginRepositoryException e) { ...
java
{ "resource": "" }
q177940
AnalyzeTask.getReportPlugins
test
private Map<String, ReportPlugin> getReportPlugins(ReportContext reportContext) throws CliExecutionException { ReportPluginRepository reportPluginRepository; try { reportPluginRepository = pluginRepository.getReportPluginRepository(); return reportPluginRepository.getReportPlugin...
java
{ "resource": "" }
q177941
AbstractAnalyzeTask.getRuleSelection
test
protected RuleSelection getRuleSelection(RuleSet ruleSet) { return RuleSelection.select(ruleSet, groupIds,constraintIds, conceptIds); }
java
{ "resource": "" }
q177942
Main.run
test
public void run(String[] args) throws CliExecutionException { Options options = gatherOptions(taskFactory); CommandLine commandLine = getCommandLine(args, options); interpretCommandLine(commandLine, options, taskFactory); }
java
{ "resource": "" }
q177943
Main.getErrorMessage
test
private static String getErrorMessage(CliExecutionException e) { StringBuffer messageBuilder = new StringBuffer(); Throwable current = e; do { messageBuilder.append("-> "); messageBuilder.append(current.getMessage()); current = current.getCause(); } ...
java
{ "resource": "" }
q177944
Main.gatherStandardOptions
test
@SuppressWarnings("static-access") private void gatherStandardOptions(final Options options) { options.addOption(OptionBuilder.withArgName("p").withDescription( "Path to property file; default is jqassistant.properties in the class path").withLongOpt("properties").hasArg().create("p")); ...
java
{ "resource": "" }
q177945
Main.gatherTasksOptions
test
private void gatherTasksOptions(TaskFactory taskFactory, Options options) { for (Task task : taskFactory.getTasks()) { for (Option option : task.getOptions()) { options.addOption(option); } } }
java
{ "resource": "" }
q177946
Main.gatherTaskNames
test
private String gatherTaskNames(TaskFactory taskFactory) { final StringBuilder builder = new StringBuilder(); for (String taskName : taskFactory.getTaskNames()) { builder.append("'").append(taskName).append("' "); } return builder.toString().trim(); }
java
{ "resource": "" }
q177947
Main.interpretCommandLine
test
private void interpretCommandLine(CommandLine commandLine, Options options, TaskFactory taskFactory) throws CliExecutionException { if(commandLine.hasOption(OPTION_HELP)) { printUsage(options, null); System.exit(1); } List<String> taskNames = commandLine.getArgList(); ...
java
{ "resource": "" }
q177948
Main.getCommandLine
test
private CommandLine getCommandLine(String[] args, Options options) { final CommandLineParser parser = new BasicParser(); CommandLine commandLine = null; try { commandLine = parser.parse(options, args); } catch (ParseException e) { printUsage(options, e.getMessage(...
java
{ "resource": "" }
q177949
Main.executeTask
test
private void executeTask(Task task, Options option, CommandLine commandLine, PluginRepository pluginRepository, Map<String, Object> properties) throws CliExecutionException { try { task.withStandardOptions(commandLine); task.withOptions(commandLine); } catch (CliConfi...
java
{ "resource": "" }
q177950
Main.readProperties
test
private Map<String, Object> readProperties(CommandLine commandLine) throws CliConfigurationException { final Properties properties = new Properties(); InputStream propertiesStream; if (commandLine.hasOption("p")) { File propertyFile = new File(commandLine.getOptionValue("p")); ...
java
{ "resource": "" }
q177951
Main.printUsage
test
private void printUsage(final Options options, final String errorMessage) { if(errorMessage != null) { System.out.println("Error: " + errorMessage); } final HelpFormatter formatter = new HelpFormatter(); formatter.printHelp(Main.class.getCanonicalName() + " <task> [options]",...
java
{ "resource": "" }
q177952
Main.getHomeDirectory
test
private File getHomeDirectory() { String dirName = System.getenv(ENV_JQASSISTANT_HOME); if (dirName != null) { File dir = new File(dirName); if (dir.exists()) { LOGGER.debug("Using JQASSISTANT_HOME '" + dir.getAbsolutePath() + "'."); return dir; ...
java
{ "resource": "" }
q177953
Main.createPluginClassLoader
test
private ClassLoader createPluginClassLoader() throws CliExecutionException { ClassLoader parentClassLoader = Task.class.getClassLoader(); File homeDirectory = getHomeDirectory(); if (homeDirectory != null) { File pluginDirectory = new File(homeDirectory, DIRECTORY_PLUGINS); ...
java
{ "resource": "" }
q177954
CountryBoundaries.getContainingIds
test
public Set<String> getContainingIds( double minLongitude, double minLatitude, double maxLongitude, double maxLatitude) { Set<String> ids = new HashSet<>(); forCellsIn(minLongitude, minLatitude, maxLongitude, maxLatitude, cell -> { if(ids.isEmpty()) { ids.addAll(cell.getContainingIds()); ...
java
{ "resource": "" }
q177955
CountryBoundaries.getIntersectingIds
test
public Set<String> getIntersectingIds( double minLongitude, double minLatitude, double maxLongitude, double maxLatitude) { Set<String> ids = new HashSet<>(); forCellsIn(minLongitude, minLatitude, maxLongitude, maxLatitude, cell -> { ids.addAll(cell.getAllIds()); }); return ids; }
java
{ "resource": "" }
q177956
Router.uri
test
public String uri(HttpMethod method, T target, Object... params) { MethodlessRouter<T> router = (method == null) ? anyMethodRouter : routers.get(method); // Fallback to anyMethodRouter if no router is found for the method if (router == null) { router = anyMethodRouter; } ...
java
{ "resource": "" }
q177957
OrderlessRouter.addRoute
test
public OrderlessRouter<T> addRoute(String pathPattern, T target) { PathPattern p = new PathPattern(pathPattern); if (routes.containsKey(p)) { return this; } routes.put(p, target); addReverseRoute(target, p); return this; }
java
{ "resource": "" }
q177958
MethodlessRouter.size
test
public int size() { return first.routes().size() + other.routes().size() + last.routes().size(); }
java
{ "resource": "" }
q177959
MethodlessRouter.addRouteFirst
test
public MethodlessRouter<T> addRouteFirst(String pathPattern, T target) { first.addRoute(pathPattern, target); return this; }
java
{ "resource": "" }
q177960
MethodlessRouter.addRoute
test
public MethodlessRouter<T> addRoute(String pathPattern, T target) { other.addRoute(pathPattern, target); return this; }
java
{ "resource": "" }
q177961
MethodlessRouter.addRouteLast
test
public MethodlessRouter<T> addRouteLast(String pathPattern, T target) { last.addRoute(pathPattern, target); return this; }
java
{ "resource": "" }
q177962
MethodlessRouter.anyMatched
test
public boolean anyMatched(String[] requestPathTokens) { return first.anyMatched(requestPathTokens) || other.anyMatched(requestPathTokens) || last.anyMatched(requestPathTokens); }
java
{ "resource": "" }
q177963
HibernateBookmarkStore.smartEqual
test
private Criterion smartEqual(String property, Object value) { if (value == null) { return Restrictions.isNull(property); } else { return Restrictions.eq(property, value); } }
java
{ "resource": "" }
q177964
FileSystemBookmarkStore.getStoreFileName
test
protected String getStoreFileName(String owner, String name) { final StringBuilder fileNameBuff = new StringBuilder(); fileNameBuff.append(owner != null ? "_" + owner : "null"); fileNameBuff.append("_"); fileNameBuff.append(name != null ? "_" + name : "null"); fileNameBu...
java
{ "resource": "" }
q177965
DefaultBookmarksComparator.compareFolders
test
protected int compareFolders(final Entry e1, final Entry e2) { final boolean f1 = e1 instanceof Folder; final boolean f2 = e2 instanceof Folder; if (f1 && !f2) { return -1; } else if (!f1 && f2) { return 1; } else { ret...
java
{ "resource": "" }
q177966
DefaultBookmarksComparator.compareEntries
test
protected int compareEntries(final Entry e1, final Entry e2) { return new CompareToBuilder() .append(e1.getName(), e2.getName()) .append(e1.getNote(), e2.getNote()) .append(e1.getCreated(), e2.getCreated()) .append(e1.getModified(), e2.getModified()) ....
java
{ "resource": "" }
q177967
DefaultBookmarksComparator.compareBookmarks
test
protected int compareBookmarks(final Entry e1, final Entry e2) { if (e1 instanceof Bookmark && e2 instanceof Bookmark) { final Bookmark b1 = (Bookmark)e1; final Bookmark b2 = (Bookmark)e2; return new CompareToBuilder() .append(b1.getUrl(), b2.getUrl()) ...
java
{ "resource": "" }
q177968
JspServletWrapper.setServletClassLastModifiedTime
test
public void setServletClassLastModifiedTime(long lastModified) { if (this.servletClassLastModifiedTime < lastModified) { synchronized (this) { if (this.servletClassLastModifiedTime < lastModified) { this.servletClassLastModifiedTime = lastModified; ...
java
{ "resource": "" }
q177969
JspServletWrapper.getDependants
test
public java.util.List<String> getDependants() { try { Object target; if (isTagFile) { if (reload) { tagHandlerClass = ctxt.load(); } target = tagHandlerClass.newInstance(); } else { target = getServlet(); } if (target != null && target in...
java
{ "resource": "" }
q177970
JasperLoader.findClass
test
public Class findClass(String className) throws ClassNotFoundException { // If the class file is in memory, use it byte[] cdata = this.bytecodes.get(className); String path = className.replace('.', '/') + ".class"; if (cdata == null) { // If the bytecode preprocessor is not...
java
{ "resource": "" }
q177971
BasicAuthentication.parseAuthorization
test
public static String[] parseAuthorization ( final HttpServletRequest request ) { final String auth = request.getHeader ( "Authorization" ); logger.debug ( "Auth header: {}", auth ); if ( auth == null || auth.isEmpty () ) { return null; } final String[] t...
java
{ "resource": "" }
q177972
ProtectedFunctionMapper.getInstance
test
public static ProtectedFunctionMapper getInstance() { ProtectedFunctionMapper funcMapper; if (SecurityUtil.isPackageProtectionEnabled()) { funcMapper = AccessController.doPrivileged( new PrivilegedAction<ProtectedFunctionMapper>() { public ProtectedFunctionMapper run() { return new ProtectedFunc...
java
{ "resource": "" }
q177973
ProtectedFunctionMapper.mapFunction
test
public void mapFunction(String fnQName, final Class<?> c, final String methodName, final Class<?>[] args ) { java.lang.reflect.Method method; if (SecurityUtil.isPackageProtectionEnabled()){ try{ method = AccessController.doPrivileged( new PrivilegedExcept...
java
{ "resource": "" }
q177974
ProtectedFunctionMapper.getMapForFunction
test
public static ProtectedFunctionMapper getMapForFunction( String fnQName, final Class<?> c, final String methodName, final Class<?>[] args ) { java.lang.reflect.Method method; ProtectedFunctionMapper funcMapper; if (SecurityUtil.isPackageProtectionEnabled()){ fun...
java
{ "resource": "" }
q177975
ProtectedFunctionMapper.resolveFunction
test
public Method resolveFunction(String prefix, String localName) { if (this.fnmap != null) { return this.fnmap.get(prefix + ":" + localName); } return theMethod; }
java
{ "resource": "" }
q177976
XMLString.setValues
test
public void setValues(char[] ch, int offset, int length) { this.ch = ch; this.offset = offset; this.length = length; }
java
{ "resource": "" }
q177977
VariableResolverImpl.resolveVariable
test
public Object resolveVariable (String pName) throws javax.servlet.jsp.el.ELException { ELContext elContext = pageContext.getELContext(); ELResolver elResolver = elContext.getELResolver(); try { return elResolver.getValue(elContext, null, pName); } catch (javax.el...
java
{ "resource": "" }
q177978
ParserController.parse
test
public Node.Nodes parse(String inFileName) throws FileNotFoundException, JasperException, IOException { // If we're parsing a packaged tag file or a resource included by it // (using an include directive), ctxt.getTagFileJar() returns the // JAR file from which to read the tag file or included resource, /...
java
{ "resource": "" }
q177979
ParserController.parse
test
public Node.Nodes parse(String inFileName, Node parent, URL jarFileUrl) throws FileNotFoundException, JasperException, IOException { // For files that are statically included, isTagfile and directiveOnly // remain unchanged. return doParse(inFileName, parent, jarFileUrl); }
java
{ "resource": "" }
q177980
ParserController.parseTagFileDirectives
test
public Node.Nodes parseTagFileDirectives(String inFileName) throws FileNotFoundException, JasperException, IOException { boolean isTagFileSave = isTagFile; boolean directiveOnlySave = directiveOnly; isTagFile = true; directiveOnly = true; Node.Nodes page = doParse(inFile...
java
{ "resource": "" }
q177981
ParserController.doParse
test
private Node.Nodes doParse(String inFileName, Node parent, URL jarFileUrl) throws FileNotFoundException, JasperException, IOException { Node.Nodes parsedPage = null; isEncodingSpecifiedInProlog = false; isDefaultPageEncoding = false; has...
java
{ "resource": "" }
q177982
JspCompilationContext.createCompiler
test
public Compiler createCompiler(boolean jspcMode) throws JasperException { if (jspCompiler != null ) { return jspCompiler; } jspCompiler = new Compiler(this, jsw, jspcMode); return jspCompiler; }
java
{ "resource": "" }
q177983
JspCompilationContext.getResourceAsStream
test
public java.io.InputStream getResourceAsStream(String res) throws JasperException { return context.getResourceAsStream(canonicalURI(res)); }
java
{ "resource": "" }
q177984
OsgiSitemapGenerator.calcLastMod
test
private Optional<Instant> calcLastMod () { Instant globalLastMod = null; for ( final ChannelInformation ci : this.channelService.list () ) { final Optional<Instant> lastMod = ofNullable ( ci.getState ().getModificationTimestamp () ); if ( globalLastMod == null || la...
java
{ "resource": "" }
q177985
JSPContextFinder.basicFindClassLoaders
test
ArrayList basicFindClassLoaders() { Class[] stack = contextFinder.getClassContext(); ArrayList result = new ArrayList(1); ClassLoader previousLoader = null; for (int i = 1; i < stack.length; i++) { ClassLoader tmp = stack[i].getClassLoader(); if (checkClass(stack[i]) && tmp != null && tmp != this) { i...
java
{ "resource": "" }
q177986
JSPContextFinder.checkClassLoader
test
private boolean checkClassLoader(ClassLoader classloader) { if (classloader == null || classloader == getParent()) return false; for (ClassLoader parent = classloader.getParent(); parent != null; parent = parent.getParent()) if (parent == this) return false; return true; }
java
{ "resource": "" }
q177987
JSPContextFinder.startLoading
test
private boolean startLoading(String name) { Set classesAndResources = (Set) cycleDetector.get(); if (classesAndResources != null && classesAndResources.contains(name)) return false; if (classesAndResources == null) { classesAndResources = new HashSet(3); cycleDetector.set(classesAndResources); } cla...
java
{ "resource": "" }
q177988
SingleXZInputStream.readStreamHeader
test
private static byte[] readStreamHeader(InputStream in) throws IOException { byte[] streamHeader = new byte[DecoderUtil.STREAM_HEADER_SIZE]; new DataInputStream(in).readFully(streamHeader); return streamHeader; }
java
{ "resource": "" }
q177989
Pagination.paginate
test
public static <T> PaginationResult<T> paginate ( final Integer startPage, final int pageSize, final List<T> fullDataSet ) { return paginate ( startPage, pageSize, ( start, length ) -> { final int len = fullDataSet.size (); if ( start > len ) { return Coll...
java
{ "resource": "" }
q177990
MetaKey.fromString
test
public static MetaKey fromString ( final String string ) { final int idx = string.indexOf ( ':' ); if ( idx < 1 ) { // -1: none at all, 0: empty namespace return null; } if ( idx + 1 >= string.length () ) { // empty key segment ...
java
{ "resource": "" }
q177991
RpmBuilder.fillRequirements
test
private void fillRequirements () throws IOException { this.requirements.add ( new Dependency ( "rpmlib(CompressedFileNames)", "3.0.4-1", RpmDependencyFlags.LESS, RpmDependencyFlags.EQUAL, RpmDependencyFlags.RPMLIB ) ); if ( !this.options.getFileDigestAlgorithm ().equals ( DigestAlgorithm.MD5 ) ) ...
java
{ "resource": "" }
q177992
ImplicitTagLibraryInfo.getTagFile
test
public TagFileInfo getTagFile(String shortName) { TagFileInfo tagFile = super.getTagFile(shortName); if (tagFile == null) { String path = tagFileMap.get(shortName); if (path == null) { return null; } TagInfo tagInfo = null; try { tagInfo = TagFileProcessor.parseTagFileDirectives(pc, ...
java
{ "resource": "" }
q177993
ImplicitTagLibraryInfo.parseImplicitTld
test
private void parseImplicitTld(JspCompilationContext ctxt, String path) throws JasperException { InputStream is = null; TreeNode tld = null; try { URL uri = ctxt.getResource(path); if (uri == null) { // no implicit.tld return; ...
java
{ "resource": "" }
q177994
OutputSpooler.getChecksum
test
public String getChecksum ( final String fileName, final String algorithm ) { if ( !this.digests.contains ( algorithm ) ) { return null; } final String result = this.checksums.get ( fileName + ":" + algorithm ); if ( result == null ) { throw ...
java
{ "resource": "" }
q177995
OutputSpooler.getSize
test
public long getSize ( final String fileName ) { final Long result = this.sizes.get ( fileName ); if ( result == null ) { throw new IllegalStateException ( String.format ( "Stream '%s' not closed or was not added", fileName ) ); } return result; }
java
{ "resource": "" }
q177996
ChannelController.validateChannelName
test
private static void validateChannelName ( final String name, final ValidationContext ctx ) { if ( name == null || name.isEmpty () ) { return; } final Matcher m = ChannelService.NAME_PATTERN.matcher ( name ); if ( !m.matches () ) { ctx.error ( ...
java
{ "resource": "" }
q177997
SeekableXZInputStream.seekToBlock
test
public void seekToBlock(int blockNumber) throws IOException { if (in == null) throw new XZIOException("Stream closed"); if (blockNumber < 0 || blockNumber >= blockCount) throw new XZIOException("Invalid XZ Block number: " + blockNumber); // This is a bit silly implement...
java
{ "resource": "" }
q177998
SeekableXZInputStream.locateBlockByPos
test
private void locateBlockByPos(BlockInfo info, long pos) { if (pos < 0 || pos >= uncompressedSize) throw new IndexOutOfBoundsException( "Invalid uncompressed position: " + pos); // Locate the Stream that contains the target position. IndexDecoder index; fo...
java
{ "resource": "" }
q177999
UnzipServlet.getMavenArtifacts
test
protected static List<MavenVersionedArtifact> getMavenArtifacts ( final String channelId, final Supplier<Collection<ArtifactInformation>> artifactsSupplier, final String groupId, final String artifactId, final boolean snapshot, final Predicate<ComparableVersion> versionFilter ) { final List<MavenVersionedAr...
java
{ "resource": "" }