code stringlengths 12 2.05k | label_name stringlengths 6 8 | label int64 0 95 |
|---|---|---|
public void setEntityResolver(EntityResolver entityResolver) {
this.entityResolver = entityResolver;
} | CWE-611 | 13 |
private TextBlock getTitleBlock(IGroup g) {
final Display label = g.getDisplay();
if (label == null)
return TextBlockUtils.empty(0, 0);
final ISkinParam skinParam = dotData.getSkinParam();
final FontConfiguration fontConfiguration;
if (UseStyle.useBetaStyle()) {
final SName sname = dotData.getUmlDiagr... | CWE-918 | 16 |
private ModelAndView renameGroup(HttpServletRequest request, HttpServletResponse response) throws Exception {
String oldName = request.getParameter("groupName");
String newName = request.getParameter("newName");
if (StringUtils.hasText(oldName) && StringUtils.hasText(newNam... | CWE-79 | 1 |
private ModelAndView renameGroup(HttpServletRequest request, HttpServletResponse response) throws Exception {
String oldName = request.getParameter("groupName");
String newName = request.getParameter("newName");
if (StringUtils.hasText(oldName) && StringUtils.hasText(newNam... | CWE-79 | 1 |
public <T> T toBean(Class<T> beanClass) {
setTag(new Tag(beanClass));
if (getVersion() != null) {
try {
MigrationHelper.migrate(getVersion(), beanClass.newInstance(), this);
removeVersion();
} catch (InstantiationException | IllegalAccessException e) {
throw new RuntimeExce... | CWE-502 | 15 |
private static String getOrderClause(Set<String> joinAliases, String alias, Order order) {
String property = order.getProperty();
boolean qualifyReference = !property.contains("("); // ( indicates a function
for (String joinAlias : joinAliases) {
if (property.startsWith(joinAlias.concat("."))) {
qualify... | CWE-89 | 0 |
private void parse(UserRequest ureq) {
String[] sFiles = ureq.getHttpReq().getParameterValues(FORM_ID);
if (sFiles == null || sFiles.length == 0) return;
files = Arrays.asList(sFiles);
} | CWE-22 | 2 |
public void spliceToFile() throws Throwable {
EventLoopGroup group = new EpollEventLoopGroup(1);
File file = File.createTempFile("netty-splice", null);
file.deleteOnExit();
SpliceHandler sh = new SpliceHandler(file);
ServerBootstrap bs = new ServerBootstrap();
bs.cha... | CWE-378 | 80 |
public EfficiencyStatement getUserEfficiencyStatementByCourseRepositoryEntry(RepositoryEntry courseRepoEntry, Identity identity){
UserEfficiencyStatementImpl s = getUserEfficiencyStatementFull(courseRepoEntry, identity);
if(s == null || s.getStatementXml() == null) {
return null;
}
return (EfficiencyStateme... | CWE-91 | 78 |
public String getExecutable()
{
if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
{
return super.getExecutable();
}
return unifyQuotes( super.getExecutable());
} | CWE-78 | 6 |
public XssHttpServletRequestWrapper(HttpServletRequest request) {
super(request);
} | CWE-79 | 1 |
protected int addFileNames(List<String> list) { // This appears to only be used by unit tests and the copy
// constructor
for (String file : list) {
workUnitList.add(new WorkUnit(file));
}
return size();
} | CWE-502 | 15 |
private void ondata(String data) {
try {
this.decoder.add(data);
} catch (DecodingException e) {
this.onerror(e);
}
} | CWE-476 | 46 |
final protected SymbolContext getContext() {
if (UseStyle.useBetaStyle() == false)
return getContextLegacy();
final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder());
final HColor lineColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(),
skinParam.getI... | CWE-918 | 16 |
void requestResetPasswordUnexistingUser()
{
when(this.userReference.toString()).thenReturn("user:Foobar");
when(this.userManager.exists(this.userReference)).thenReturn(false);
String exceptionMessage = "User [user:Foobar] doesn't exist";
when(this.localizationManager.getTranslati... | CWE-640 | 20 |
public Claims validateToken(String token) throws AuthenticationException {
try {
RsaKeyUtil rsaKeyUtil = new RsaKeyUtil();
PublicKey publicKey = rsaKeyUtil.fromPemEncoded(keycloakPublicKey);
return Jwts.parser().setSigningKey(publicKey).parseJws(token.replace("Bearer ", ... | CWE-290 | 85 |
public void doFilter(ServletRequest srequest, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
/* HttpServletRequest request = (HttpServletRequest) srequest;
//final String realIp = request.getHeader(X_FORWARDED_FOR);
//if (realIp != null) {
filterChain.doFil... | CWE-79 | 1 |
private Runnable getDiscoveryRequestSetup(final String url) {
return new Runnable() {
public void run() {
expect(request.getHeader("Origin")).andStubReturn(null);
expect(request.getHeader("Referer")).andStubReturn(null);
expect(request.getRemoteHos... | CWE-79 | 1 |
protected SAXContentHandler createContentHandler(XMLReader reader) {
return new SAXContentHandler(getDocumentFactory(), dispatchHandler);
} | CWE-611 | 13 |
final protected CommandExecutionResult executeArg(TimingDiagram diagram, LineLocation location, RegexResult arg) {
final String compact = arg.get("COMPACT", 0);
final String code = arg.get("CODE", 0);
String full = arg.get("FULL", 0);
if (full == null) {
full = code;
}
final TimingStyle type = TimingSty... | CWE-918 | 16 |
public static String printFormattedMetadata(final IBaseDataObject payload) {
final StringBuilder out = new StringBuilder();
out.append(LS);
for (final Map.Entry<String, Collection<Object>> entry : payload.getParameters().entrySet()) {
out.append(entry.getKey() + SEP + entry.getVa... | CWE-502 | 15 |
public static void closeSubsequentFS(Path path) {
if(path != null && FileSystems.getDefault() != path.getFileSystem()) {
IOUtils.closeQuietly(path.getFileSystem());
}
} | CWE-22 | 2 |
public Document read(Reader reader) throws DocumentException {
InputSource source = new InputSource(reader);
if (this.encoding != null) {
source.setEncoding(this.encoding);
}
return read(source);
} | CWE-611 | 13 |
final protected Style getStyle() {
return getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder());
} | CWE-918 | 16 |
protected final boolean loadMore() throws IOException
{
if (_inputStream != null) {
_currInputProcessed += _inputEnd;
int count = _inputStream.read(_inputBuffer, 0, _inputBuffer.length);
if (count > 0) {
_inputPtr = 0;
_inputEnd = coun... | CWE-770 | 37 |
void sendResetPasswordEmailRequest() throws Exception
{
when(this.referenceSerializer.serialize(this.userReference)).thenReturn("user:Foobar");
when(this.userProperties.getFirstName()).thenReturn("Foo");
when(this.userProperties.getLastName()).thenReturn("Bar");
AuthenticationRe... | CWE-640 | 20 |
void allReservedCharacters() {
final PathAndQuery res = PathAndQuery.parse("/#/:[]@!$&'()*+,;=?a=/#/:[]@!$&'()*+,;=");
assertThat(res).isNotNull();
assertThat(res.path()).isEqualTo("/#/:[]@!$&'()*+,;=");
assertThat(res.query()).isEqualTo("a=/#/:[]@!$&'()*+,;=");
final PathAn... | CWE-22 | 2 |
public void testBourneShellQuotingCharacters()
throws Exception
{
// { ' ', '$', ';', '&', '|', '<', '>', '*', '?', '(', ')' };
// test with values http://steve-parker.org/sh/bourne.shtml Appendix B - Meta-characters and Reserved Words
Commandline commandline = new Commandline( n... | CWE-78 | 6 |
private ModelAndView renameGroup(HttpServletRequest request, HttpServletResponse response) throws Exception {
String oldName = request.getParameter("groupName");
String newName = request.getParameter("newName");
if (StringUtils.hasText(oldName) && StringUtils.hasText(newNam... | CWE-79 | 1 |
private void testKeyFactory(ECPublicKey pub, ECPrivateKey priv)
throws Exception
{
KeyFactory ecFact = KeyFactory.getInstance("ECDSA");
ECPublicKeySpec pubSpec = (ECPublicKeySpec)ecFact.getKeySpec(pub, ECPublicKeySpec.class);
ECPrivateKeySpec privSpec = (ECPrivateKeySpec)ecFac... | CWE-347 | 25 |
private Template getClassloaderTemplate(ClassLoader classloader, String suffixPath, String templateName)
{
String templatePath = suffixPath + templateName;
URL url = classloader.getResource(templatePath);
return url != null ? new ClassloaderTemplate(new ClassloaderResource(url, templat... | CWE-22 | 2 |
void requestResetPasswordNoEmail() throws Exception
{
when(this.userManager.exists(this.userReference)).thenReturn(true);
String exceptionMessage = "User has no email address.";
when(this.localizationManager.getTranslationPlain("xe.admin.passwordReset.error.noEmail"))
.thenRe... | CWE-640 | 20 |
private static boolean pathContainsDoubleDots(Bytes path) {
final int length = path.length;
byte b0 = 0;
byte b1 = 0;
byte b2 = '/';
for (int i = 1; i < length; i++) {
final byte b3 = path.data[i];
if (b3 == '/' && b2 == '.' && b1 == '.' && b0 == '/') ... | CWE-22 | 2 |
public void testWrapMemoryMapped() throws Exception {
File file = File.createTempFile("netty-test", "tmp");
FileChannel output = null;
FileChannel input = null;
ByteBuf b1 = null;
ByteBuf b2 = null;
try {
output = new RandomAccessFile(file, "rw").getChann... | CWE-379 | 83 |
public static Document toXml(final List<IBaseDataObject> list) {
final Element root = new Element("payload-list");
for (final IBaseDataObject d : list) {
final Document doc = toXml(d);
root.addContent(doc.detachRootElement());
logger.debug("Adding xml content for ... | CWE-502 | 15 |
private Document parseXml(String xmlContent) {
try {
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document document = builder.parse(new InputSource(new StringReader(xmlContent)));
document.getDocumentElement().normalize();
return document;
} catch (Exception e)... | CWE-611 | 13 |
public boolean equals(Object o)
{
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DefaultResetPasswordRequestResponse that = (DefaultResetPasswordRequestResponse) o;
return new EqualsBuilder... | CWE-640 | 20 |
public void initWithcustomAccessRestrictor() throws ServletException {
prepareStandardInitialisation();
servlet.destroy();
} | CWE-79 | 1 |
private static File newFile() throws IOException {
File file = File.createTempFile("netty-", ".tmp");
file.deleteOnExit();
final FileOutputStream out = new FileOutputStream(file);
out.write(data);
out.close();
return file;
} | CWE-378 | 80 |
public void clientIdChanged(ClientModel client, String newClientId) {
logger.debugf("Updating clientId from '%s' to '%s'", client.getClientId(), newClientId);
UserModel serviceAccountUser = realmManager.getSession().users().getServiceAccount(client);
if (serviceAccountUser != null) {
... | CWE-798 | 18 |
public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset,
byte[] ciphertext, int ciphertextOffset, int length)
throws ShortBufferException {
int space;
if (ciphertextOffset > ciphertext.length)
space = 0;
else
space = ciphertext.length - ciphertextOffset;
if (keySpec == null) {
... | CWE-125 | 47 |
public static byte[] serializeToBytes(final Object payload) throws IOException {
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
serializeToStream(bos, payload);
return bos.toByteArray();
} | CWE-502 | 15 |
public boolean importWiki(File file, String filename, File targetDirectory) {
try {
Path path = FileResource.getResource(file, filename);
if(path == null) {
return false;
}
Path destDir = targetDirectory.toPath();
Files.walkFileTree(path, new ImportVisitor(destDir));
PathUtils.closeSubseque... | CWE-22 | 2 |
public XMLReader getXMLReader() throws SAXException {
if (xmlReader == null) {
xmlReader = createXMLReader();
}
return xmlReader;
} | CWE-611 | 13 |
public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset,
byte[] ciphertext, int ciphertextOffset, int length)
throws ShortBufferException {
int space;
if (ciphertextOffset > ciphertext.length)
space = 0;
else
space = ciphertext.length - ciphertextOffset;
if (keySpec == null) {
... | CWE-787 | 24 |
protected BigDecimal bcdToBigDecimal() {
if (usingBytes) {
// Converting to a string here is faster than doing BigInteger/BigDecimal arithmetic.
BigDecimal result = new BigDecimal(toNumberString());
if (isNegative()) {
result = result.negate();
... | CWE-190 | 19 |
public PersistentTask updateTask(Task task, Serializable runnableTask, Identity modifier, Date scheduledDate) {
PersistentTask ptask = dbInstance.getCurrentEntityManager()
.find(PersistentTask.class, task.getKey(), LockModeType.PESSIMISTIC_WRITE);
if(ptask != null) {
ptask.setLastModified(new Date());
pt... | CWE-91 | 78 |
public SAXReader(DocumentFactory factory, boolean validating) {
this.factory = factory;
this.validating = validating;
} | CWE-611 | 13 |
private final HColor getBackColor(UmlDiagramType umlDiagramType, Style style) {
if (EntityUtils.groupRoot(group))
return null;
final HColor result = group.getColors().getColor(ColorType.BACK);
if (result != null)
return result;
final Stereotype stereo = group.getStereotype();
if (UseStyle.useBetaSty... | CWE-918 | 16 |
public XssHttpServletRequestWrapper(HttpServletRequest request) {
super(request);
} | CWE-79 | 1 |
public static String decodePath(String path) {
if (path.indexOf('%') < 0) {
// No need to decoded; not percent-encoded
return path;
}
// Decode percent-encoded characters.
// An invalid character is replaced with 0xFF, which will be replaced into '�' by UTF-8... | CWE-22 | 2 |
public void saveCustomConfigAndCompileCSS(Map<String, Map<String, Object>> customConfig, CourseEnvironment courseEnvironment){
VFSContainer themeBase = null;
VFSContainer base = null;
base = (VFSContainer) courseEnvironment.getCourseBaseContainer().resolve(CourseLayoutHelper.LAYOUT_COURSE_SUBFOLDER);
if (base ... | CWE-91 | 78 |
setStringInputSource(ThreadContext context, IRubyObject data, IRubyObject url)
{
source = new InputSource();
ParserContext.setUrl(context, source, url);
Ruby ruby = context.getRuntime();
if (!(data instanceof RubyString)) {
throw ruby.newArgumentError("must be kind_of String");
}
Ru... | CWE-241 | 68 |
public TMap readMapBegin() throws TException {
int size = readVarint32();
byte keyAndValueType = size == 0 ? 0 : readByte();
return new TMap(
getTType((byte) (keyAndValueType >> 4)), getTType((byte) (keyAndValueType & 0xf)), size);
} | CWE-770 | 37 |
public Response attachTaskFile(@PathParam("courseId") Long courseId, @PathParam("nodeId") String nodeId,
@Context HttpServletRequest request) {
ICourse course = CoursesWebService.loadCourse(courseId);
CourseEditorTreeNode parentNode = getParentNode(course, nodeId);
if(course == null) {
return Response.ser... | CWE-22 | 2 |
void plus() {
final PathAndQuery res = PathAndQuery.parse("/+?a+b=c+d");
assertThat(res).isNotNull();
assertThat(res.path()).isEqualTo("/+");
assertThat(res.query()).isEqualTo("a+b=c+d");
final PathAndQuery res2 = PathAndQuery.parse("/%2b?a%2bb=c%2bd");
assertThat(re... | CWE-22 | 2 |
public TSet readSetBegin() throws TException {
return new TSet(readByte(), readI32());
} | CWE-770 | 37 |
private Template getClassloaderTemplate(String suffixPath, String templateName)
{
return getClassloaderTemplate(Thread.currentThread().getContextClassLoader(), suffixPath, templateName);
} | CWE-22 | 2 |
final protected CommandExecutionResult executeArg(TimingDiagram diagram, LineLocation location, RegexResult arg) {
final String compact = arg.get("COMPACT", 0);
final String code = arg.get("CODE", 0);
final String full = arg.get("FULL", 0);
return diagram.createBinary(code, full, compact != null);
} | CWE-918 | 16 |
public void configure(ICourse course, CourseNode newNode, ModuleConfiguration moduleConfig) {
if(displayType != null && (STCourseNodeEditController.CONFIG_VALUE_DISPLAY_TOC.equals(displayType)
|| STCourseNodeEditController.CONFIG_VALUE_DISPLAY_PEEKVIEW.equals(displayType)
|| STCourseNodeEditControlle... | CWE-22 | 2 |
public static final void testClosedArray() {
// Discovered by fuzzer with seed -Dfuzz.seed=df3b4778ce54d00a
assertSanitized("-1742461140214282", "\ufeff-01742461140214282]");
} | CWE-611 | 13 |
void semicolon() {
final PathAndQuery res = PathAndQuery.parse("/;?a=b;c=d");
assertThat(res).isNotNull();
assertThat(res.path()).isEqualTo("/;");
assertThat(res.query()).isEqualTo("a=b;c=d");
// '%3B' in a query string should never be decoded into ';'.
final PathAnd... | CWE-22 | 2 |
public RefUpdated uploadFiles(Collection<FileUpload> uploads, String directory, String commitMessage) {
Map<String, BlobContent> newBlobs = new HashMap<>();
String parentPath = getDirectory();
if (directory != null) {
if (parentPath != null)
parentPath += "/" + directory;
else
paren... | CWE-434 | 5 |
public boolean isStringInternEnabled() {
return stringInternEnabled;
} | CWE-611 | 13 |
protected void onStart() {
super.onStart();
Intent intent = getIntent();
intent.putExtra(
SettingsActivity.SP_FEED_LIST_LAYOUT,
mPrefs.getString(SettingsActivity.SP_FEED_LIST_LAYOUT, "0")
);
setResult(RESULT_OK,intent);
} | CWE-829 | 86 |
public void testReadBytesAndWriteBytesWithFileChannel() throws IOException {
File file = File.createTempFile("file-channel", ".tmp");
RandomAccessFile randomAccessFile = null;
try {
randomAccessFile = new RandomAccessFile(file, "rw");
FileChannel channel = randomAcces... | CWE-378 | 80 |
public void testMatchTwoTypes() {
JWKMatcher matcher = new JWKMatcher.Builder().keyTypes(KeyType.RSA, KeyType.EC).build();
assertTrue(matcher.matches(new RSAKey.Builder(new Base64URL("n"), new Base64URL("e")).keyID("1").build()));
assertTrue(matcher.matches(new ECKey.Builder(ECKey.Curve.P_256, new Base64URL("x... | CWE-347 | 25 |
public int decryptWithAd(byte[] ad, byte[] ciphertext,
int ciphertextOffset, byte[] plaintext, int plaintextOffset,
int length) throws ShortBufferException, BadPaddingException {
int space;
if (ciphertextOffset > ciphertext.length)
space = 0;
else
space = ciphertext.length - ciphertextOffset;
if (l... | CWE-125 | 47 |
public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset,
byte[] ciphertext, int ciphertextOffset, int length) throws ShortBufferException {
int space;
if (ciphertextOffset > ciphertext.length)
space = 0;
else
space = ciphertext.length - ciphertextOffset;
if (!haskey) {
// The key ... | CWE-125 | 47 |
public void testGetBytesAndSetBytesWithFileChannel() throws IOException {
File file = File.createTempFile("file-channel", ".tmp");
RandomAccessFile randomAccessFile = null;
try {
randomAccessFile = new RandomAccessFile(file, "rw");
FileChannel channel = randomAccessFi... | CWE-379 | 83 |
private void saveToFile(VFSLeaf glossaryFile, List<GlossaryItem> glossaryItemArr) {
// cdata-tags should be used instead of strings, overwrite writer.
glossaryItemArr = removeEmptyGlossaryItems(glossaryItemArr);
XStreamHelper.writeObject(xstreamWriter, glossaryFile, glossaryItemArr);
} | CWE-91 | 78 |
private XMLGregorianCalendar toXMLGregorianCalendar(ZonedDateTime instant) {
if (instant == null) {
return null;
}
return new XMLGregorianCalendarImpl(GregorianCalendar.from(instant));
} | CWE-611 | 13 |
public int addFileName(String file) {
workUnitList.add(new WorkUnit(file));
return size();
} | CWE-502 | 15 |
public OutputStream getOutputStream(boolean append) {
return null;
} | CWE-91 | 78 |
public void testGetShellCommandLineBash()
throws Exception
{
Commandline cmd = new Commandline( new BourneShell() );
cmd.setExecutable( "/bin/echo" );
cmd.addArguments( new String[] {
"hello world"
} );
String[] shellCommandline = cmd.getShellCommandl... | CWE-78 | 6 |
public static File createTempFile(String prefix, String suffix, File directory) throws IOException {
if (javaVersion() >= 7) {
if (directory == null) {
return Files.createTempFile(prefix, suffix).toFile();
}
return Files.createTempFile(directory.toPath(), ... | CWE-379 | 83 |
public void testSelectByType() {
JWKSelector selector = new JWKSelector(new JWKMatcher.Builder().keyType(KeyType.RSA).build());
List<JWK> keyList = new ArrayList<>();
keyList.add(new RSAKey.Builder(new Base64URL("n"), new Base64URL("e")).keyID("1").build());
keyList.add(new ECKey.Builder(ECKey.Curve.P_256, n... | CWE-347 | 25 |
protected SymbolContext getContextLegacy() {
return new SymbolContext(HColorUtils.COL_D7E0F2, HColorUtils.COL_038048).withStroke(new UStroke(1.5));
} | CWE-918 | 16 |
protected StyleSignatureBasic getStyleSignature() {
if (type == TimingStyle.CONCISE)
return StyleSignatureBasic.of(SName.root, SName.element, SName.timingDiagram, SName.concise);
if (type == TimingStyle.ROBUST)
return StyleSignatureBasic.of(SName.root, SName.element, SName.timingDiagram, SName.robust);
thr... | CWE-918 | 16 |
private ZonedDateTime toZonedDateTime(XMLGregorianCalendar instant) {
if (instant == null) {
return null;
}
return instant.toGregorianCalendar().toZonedDateTime();
} | CWE-611 | 13 |
private List<GlossaryItem> loadGlossaryItemListFromFile(VFSLeaf glossaryFile) {
List<GlossaryItem> glossaryItemList = new ArrayList<>();
if (glossaryFile == null) { return new ArrayList<>(); }
Object glossObj = XStreamHelper.readObject(xstreamReader, glossaryFile);
if (glossObj instanceof ArrayList) {
Ar... | CWE-91 | 78 |
public boolean isIgnoreComments() {
return ignoreComments;
} | CWE-611 | 13 |
public String getOrderBy() {
return orderBy;
} | CWE-89 | 0 |
public void create_withNullThreadPool() throws Exception {
final JettyServerFactory jettyServerFactory = mock(JettyServerFactory.class);
final StaticFilesConfiguration staticFilesConfiguration = mock(StaticFilesConfiguration.class);
final Routes routes = mock(Routes.class);
when(jet... | CWE-22 | 2 |
private static ECPrivateKey generateECPrivateKey(final ECKey.Curve curve)
throws Exception {
final ECParameterSpec ecParameterSpec = curve.toECParameterSpec();
KeyPairGenerator generator = KeyPairGenerator.getInstance("EC");
generator.initialize(ecParameterSpec);
KeyPair keyPair = generator.generateKey... | CWE-347 | 25 |
public static void unzipFilesToPath(String jarPath, String destinationDir) throws IOException {
File file = new File(jarPath);
try (JarFile jar = new JarFile(file)) {
// fist get all directories,
// then make those directory on the destination Path
/*for (Enumera... | CWE-22 | 2 |
public SAXReader(XMLReader xmlReader) {
this.xmlReader = xmlReader;
} | CWE-611 | 13 |
void relative() {
assertThat(PathAndQuery.parse("foo")).isNull();
} | CWE-22 | 2 |
public <T extends JiffleRuntime> T getRuntimeInstance(Class<T> baseClass) throws
it.geosolutions.jaiext.jiffle.JiffleException {
RuntimeModel model = RuntimeModel.get(baseClass);
if (model == null) {
throw new it.geosolutions.jaiext.jiffle.JiffleException(baseClass.getName() ... | CWE-94 | 14 |
public void testSelectByTwoTypes() {
JWKSelector selector = new JWKSelector(new JWKMatcher.Builder().keyTypes(KeyType.RSA, KeyType.EC).build());
List<JWK> keyList = new ArrayList<>();
keyList.add(new RSAKey.Builder(new Base64URL("n"), new Base64URL("e")).keyID("1").build());
keyList.add(new ECKey.Builder(ECK... | CWE-347 | 25 |
private void parseAttributesForKnownElements(Map<String, List<Entry>> subdirs, Node desc) {
// NOTE: NamedNodeMap does not have any particular order...
NamedNodeMap attributes = desc.getAttributes();
for (Node attr : asIterable(attributes)) {
if (!XMP.ELEMENTS.contains(attr.getN... | CWE-611 | 13 |
public void create_withThreadPool() throws Exception {
final QueuedThreadPool threadPool = new QueuedThreadPool(100);
final JettyServerFactory jettyServerFactory = mock(JettyServerFactory.class);
final StaticFilesConfiguration staticFilesConfiguration = mock(StaticFilesConfiguration.class);
... | CWE-22 | 2 |
public int decryptWithAd(byte[] ad, byte[] ciphertext,
int ciphertextOffset, byte[] plaintext, int plaintextOffset,
int length) throws ShortBufferException, BadPaddingException {
int space;
if (ciphertextOffset > ciphertext.length)
space = 0;
else
space = ciphertext.length - ciphertextOffset;
if (l... | CWE-787 | 24 |
protected String getCorsDomain(String referer, String userAgent)
{
String dom = null;
if (referer != null && referer.toLowerCase()
.matches("https?://([a-z0-9,-]+[.])*draw[.]io/.*"))
{
dom = referer.toLowerCase().substring(0,
referer.indexOf(".draw.io/") + 8);
}
else if (referer != null && refe... | CWE-918 | 16 |
public void setXMLReader(XMLReader reader) {
this.xmlReader = reader;
} | CWE-611 | 13 |
private Path getFilePath(String path) {
return baseDirPath.map(dir -> dir.resolve(path)).orElseGet(() -> Paths.get(path));
} | CWE-22 | 2 |
void requestResetPassword() throws Exception
{
when(this.userManager.exists(this.userReference)).thenReturn(true);
InternetAddress email = new InternetAddress("foobar@xwiki.org");
when(this.userProperties.getEmail()).thenReturn(email);
BaseObject xObject = mock(BaseObject.class);... | CWE-640 | 20 |
public void setXMLFilter(XMLFilter filter) {
this.xmlFilter = filter;
} | CWE-611 | 13 |
void checkVerificationCodeUnexistingUser()
{
when(this.userReference.toString()).thenReturn("user:Foobar");
when(this.userManager.exists(this.userReference)).thenReturn(false);
String exceptionMessage = "User [user:Foobar] doesn't exist";
when(this.localizationManager.getTranslat... | CWE-640 | 20 |
public String toString() {
if (query == null) {
return path;
}
return path + "?" + query;
} | CWE-22 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.