proj_name
stringclasses
131 values
relative_path
stringlengths
30
228
class_name
stringlengths
1
68
func_name
stringlengths
1
48
masked_class
stringlengths
78
9.82k
func_body
stringlengths
46
9.61k
len_input
int64
29
2.01k
len_output
int64
14
1.94k
total
int64
55
2.05k
relevant_context
stringlengths
0
38.4k
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/BookComment.java
BookComment
toString
class BookComment implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 评论小说ID */ private Long bookId; /** * 评论用户ID */ private Long userId; /** *...
return "BookComment{" + "id=" + id + ", bookId=" + bookId + ", userId=" + userId + ", commentContent=" + commentContent + ", replyCount=" + replyCount + ", auditStatus=" + auditStatus + ", createTime=" + createTime + ", updateTime=" + updateTime +...
627
102
729
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/BookCommentCopy1.java
BookCommentCopy1
toString
class BookCommentCopy1 implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 评论小说ID */ private Long bookId; /** * 评论用户ID */ private Long userId; /** ...
return "BookCommentCopy1{" + "id=" + id + ", bookId=" + bookId + ", userId=" + userId + ", commentContent=" + commentContent + ", replyCount=" + replyCount + ", auditStatus=" + auditStatus + ", createTime=" + createTime + ", updateTime=" + updateT...
629
104
733
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/BookCommentReply.java
BookCommentReply
toString
class BookCommentReply implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ private Long id; /** * 评论ID */ private Long commentId; /** * 回复用户ID */ private Long userId; /** * 回复内容 */ private String replyCon...
return "BookCommentReply{" + "id=" + id + ", commentId=" + commentId + ", userId=" + userId + ", replyContent=" + replyContent + ", auditStatus=" + auditStatus + ", createTime=" + createTime + ", updateTime=" + updateTime + "}";
544
93
637
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/BookContent.java
BookContent
toString
class BookContent implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 章节ID */ private Long chapterId; /** * 小说章节内容 */ private String content; privat...
return "BookContent{" + "id=" + id + ", chapterId=" + chapterId + ", content=" + content + ", createTime=" + createTime + ", updateTime=" + updateTime + "}";
371
67
438
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/BookInfo.java
BookInfo
toString
class BookInfo implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 作品方向;0-男频 1-女频 */ private Integer workDirection; /** * 类别ID */ private Long categoryId...
return "BookInfo{" + "id=" + id + ", workDirection=" + workDirection + ", categoryId=" + categoryId + ", categoryName=" + categoryName + ", picUrl=" + picUrl + ", bookName=" + bookName + ", authorId=" + authorId + ", authorName=" + authorName + ...
1,485
242
1,727
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/HomeBook.java
HomeBook
toString
class HomeBook implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 推荐类型;0-轮播图 1-顶部栏 2-本周强推 3-热门推荐 4-精品推荐 */ private Integer type; /** * 推荐排序 */ private Integer sort; /** ...
return "HomeBook{" + "id=" + id + ", type=" + type + ", sort=" + sort + ", bookId=" + bookId + ", createTime=" + createTime + ", updateTime=" + updateTime + "}";
471
76
547
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/HomeFriendLink.java
HomeFriendLink
toString
class HomeFriendLink implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 链接名 */ private String linkName; /** * 链接url */ private String linkUrl; /** * 排序号 */ pri...
return "HomeFriendLink{" + "id=" + id + ", linkName=" + linkName + ", linkUrl=" + linkUrl + ", sort=" + sort + ", isOpen=" + isOpen + ", createTime=" + createTime + ", updateTime=" + updateTime + "}";
524
90
614
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/NewsCategory.java
NewsCategory
toString
class NewsCategory implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 类别名 */ private String name; /** * 排序 */ private Integer sort; /** * 创建时间 */ private Local...
return "NewsCategory{" + "id=" + id + ", name=" + name + ", sort=" + sort + ", createTime=" + createTime + ", updateTime=" + updateTime + "}";
373
65
438
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/NewsContent.java
NewsContent
toString
class NewsContent implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 新闻ID */ private Long newsId; /** * 新闻内容 */ private String content; /** * ...
return "NewsContent{" + "id=" + id + ", newsId=" + newsId + ", content=" + content + ", createTime=" + createTime + ", updateTime=" + updateTime + "}";
391
67
458
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/NewsInfo.java
NewsInfo
toString
class NewsInfo implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 类别ID */ private Long categoryId; /** * 类别名 */ private String categoryName; /** ...
return "NewsInfo{" + "id=" + id + ", categoryId=" + categoryId + ", categoryName=" + categoryName + ", sourceName=" + sourceName + ", title=" + title + ", createTime=" + createTime + ", updateTime=" + updateTime + "}";
526
89
615
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/PayAlipay.java
PayAlipay
toString
class PayAlipay implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 商户订单号 */ private String outTradeNo; /** * 支付宝交易号 */ private String tradeNo; /** ...
return "PayAlipay{" + "id=" + id + ", outTradeNo=" + outTradeNo + ", tradeNo=" + tradeNo + ", buyerId=" + buyerId + ", tradeStatus=" + tradeStatus + ", totalAmount=" + totalAmount + ", receiptAmount=" + receiptAmount + ", invoiceAmount=" + invoice...
962
160
1,122
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/PayWechat.java
PayWechat
toString
class PayWechat implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 商户订单号 */ private String outTradeNo; /** * 微信支付订单号 */ private String transactionId; ...
return "PayWechat{" + "id=" + id + ", outTradeNo=" + outTradeNo + ", transactionId=" + transactionId + ", tradeType=" + tradeType + ", tradeState=" + tradeState + ", tradeStateDesc=" + tradeStateDesc + ", amount=" + amount + ", payerTotal=" + paye...
1,067
157
1,224
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/SysLog.java
SysLog
toString
class SysLog implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 用户id */ private Long userId; /** * 用户名 */ private String username; /** * 用户操作 */ private String...
return "SysLog{" + "id=" + id + ", userId=" + userId + ", username=" + username + ", operation=" + operation + ", time=" + time + ", method=" + method + ", params=" + params + ", ip=" + ip + ", createTime=" + createTime + "}";
610
102
712
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/SysMenu.java
SysMenu
toString
class SysMenu implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 父菜单ID;一级菜单为0 */ private Long parentId; /** * 菜单名称 */ private String name; /** * 菜单URL */ priva...
return "SysMenu{" + "id=" + id + ", parentId=" + parentId + ", name=" + name + ", url=" + url + ", type=" + type + ", icon=" + icon + ", sort=" + sort + ", createTime=" + createTime + ", updateTime=" + updateTime + "}";
639
104
743
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/SysRole.java
SysRole
toString
class SysRole implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 角色名称 */ private String roleName; /** * 角色标识 */ private String roleSign; /** * 备注 */ private St...
return "SysRole{" + "id=" + id + ", roleName=" + roleName + ", roleSign=" + roleSign + ", remark=" + remark + ", createTime=" + createTime + ", updateTime=" + updateTime + "}";
450
79
529
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/SysRoleMenu.java
SysRoleMenu
toString
class SysRoleMenu implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 角色ID */ private Long roleId; /** * 菜单ID */ private Long menuId; /** * 创建时间 */ private Loca...
return "SysRoleMenu{" + "id=" + id + ", roleId=" + roleId + ", menuId=" + menuId + ", createTime=" + createTime + ", updateTime=" + updateTime + "}";
389
71
460
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/SysUser.java
SysUser
toString
class SysUser implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 用户名 */ private String username; /** * 密码 */ private String password; /** * 真实姓名 */ private Str...
return "SysUser{" + "id=" + id + ", username=" + username + ", password=" + password + ", name=" + name + ", sex=" + sex + ", birth=" + birth + ", email=" + email + ", mobile=" + mobile + ", status=" + status + ", createTime=" + cr...
756
120
876
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/SysUserRole.java
SysUserRole
toString
class SysUserRole implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 用户ID */ private Long userId; /** * 角色ID */ private Long roleId; /** * 创建时间 */ private Loca...
return "SysUserRole{" + "id=" + id + ", userId=" + userId + ", roleId=" + roleId + ", createTime=" + createTime + ", updateTime=" + updateTime + "}";
388
71
459
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/UserBookshelf.java
UserBookshelf
toString
class UserBookshelf implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 用户ID */ private Long userId; /** * 小说ID */ private Long bookId; /** * 上...
return "UserBookshelf{" + "id=" + id + ", userId=" + userId + ", bookId=" + bookId + ", preContentId=" + preContentId + ", createTime=" + createTime + ", updateTime=" + updateTime + "}";
483
85
568
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/UserComment.java
UserComment
toString
class UserComment implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 评论用户ID */ private Long userId; /** * 评论小说ID */ private Long bookId; /** *...
return "UserComment{" + "id=" + id + ", userId=" + userId + ", bookId=" + bookId + ", commentContent=" + commentContent + ", replyCount=" + replyCount + ", auditStatus=" + auditStatus + ", createTime=" + createTime + ", updateTime=" + updateTime +...
627
102
729
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/UserCommentReply.java
UserCommentReply
toString
class UserCommentReply implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ private Long id; /** * 评论ID */ private Long commentId; /** * 回复用户ID */ private Long userId; /** * 回复内容 */ private String replyCon...
return "UserCommentReply{" + "id=" + id + ", commentId=" + commentId + ", userId=" + userId + ", replyContent=" + replyContent + ", auditStatus=" + auditStatus + ", createTime=" + createTime + ", updateTime=" + updateTime + "}";
544
93
637
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/UserConsumeLog.java
UserConsumeLog
toString
class UserConsumeLog implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 消费用户ID */ private Long userId; /** * 消费使用的金额;单位:屋币 */ private Integer amount; ...
return "UserConsumeLog{" + "id=" + id + ", userId=" + userId + ", amount=" + amount + ", productType=" + productType + ", productId=" + productId + ", producName=" + producName + ", producValue=" + producValue + ", createTime=" + createTime + ...
717
117
834
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/UserFeedback.java
UserFeedback
toString
class UserFeedback implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 反馈用户id */ private Long userId; /** * 反馈内容 */ private String content; /** * 创建时间 */ privat...
return "UserFeedback{" + "id=" + id + ", userId=" + userId + ", content=" + content + ", createTime=" + createTime + ", updateTime=" + updateTime + "}";
383
68
451
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/UserInfo.java
UserInfo
toString
class UserInfo implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 登录名 */ private String username; /** * 登录密码-加密 */ private String password; /** * 加密盐值 */ priva...
return "UserInfo{" + "id=" + id + ", username=" + username + ", password=" + password + ", salt=" + salt + ", nickName=" + nickName + ", userPhoto=" + userPhoto + ", userSex=" + userSex + ", accountBalance=" + accountBalance + ", status=" ...
800
131
931
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/UserPayLog.java
UserPayLog
toString
class UserPayLog implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 充值用户ID */ private Long userId; /** * 充值方式;0-支付宝 1-微信 */ private Integer payChannel; /** * 商户订单号 ...
return "UserPayLog{" + "id=" + id + ", userId=" + userId + ", payChannel=" + payChannel + ", outTradeNo=" + outTradeNo + ", amount=" + amount + ", productType=" + productType + ", productId=" + productId + ", productName=" + productName + ...
918
149
1,067
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dao/entity/UserReadHistory.java
UserReadHistory
toString
class UserReadHistory implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 用户ID */ private Long userId; /** * 小说ID */ private Long bookId; /** *...
return "UserReadHistory{" + "id=" + id + ", userId=" + userId + ", bookId=" + bookId + ", preContentId=" + preContentId + ", createTime=" + createTime + ", updateTime=" + updateTime + "}";
481
83
564
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/dto/es/EsBookDto.java
EsBookDto
build
class EsBookDto { /** * id */ private Long id; /** * 作品方向;0-男频 1-女频 */ private Integer workDirection; /** * 类别ID */ private Long categoryId; /** * 类别名 */ private String categoryName; /** * 小说名 */ private String bookName; ...
return EsBookDto.builder() .id(bookInfo.getId()) .categoryId(bookInfo.getCategoryId()) .categoryName(bookInfo.getCategoryName()) .bookDesc(bookInfo.getBookDesc()) .bookName(bookInfo.getBookName()) .authorId(bookInfo...
440
267
707
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/manager/cache/AuthorInfoCacheManager.java
AuthorInfoCacheManager
getAuthor
class AuthorInfoCacheManager { private final AuthorInfoMapper authorInfoMapper; /** * 查询作家信息,并放入缓存中 */ @Cacheable(cacheManager = CacheConsts.REDIS_CACHE_MANAGER, value = CacheConsts.AUTHOR_INFO_CACHE_NAME, unless = "#result == null") public AuthorInfoDto getAuthor(Long userId) {<FILL...
QueryWrapper<AuthorInfo> queryWrapper = new QueryWrapper<>(); queryWrapper .eq(DatabaseConsts.AuthorInfoTable.COLUMN_USER_ID, userId) .last(DatabaseConsts.SqlEnum.LIMIT_1.getSql()); AuthorInfo authorInfo = authorInfoMapper.selectOne(queryWrapper); if (Objects.isN...
198
152
350
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/manager/cache/BookCategoryCacheManager.java
BookCategoryCacheManager
listCategory
class BookCategoryCacheManager { private final BookCategoryMapper bookCategoryMapper; /** * 根据作品方向查询小说分类列表,并放入缓存中 */ @Cacheable(cacheManager = CacheConsts.CAFFEINE_CACHE_MANAGER, value = CacheConsts.BOOK_CATEGORY_LIST_CACHE_NAME) public List<BookCategoryRespDto> listCategory(Integer ...
QueryWrapper<BookCategory> queryWrapper = new QueryWrapper<>(); queryWrapper.eq(DatabaseConsts.BookCategoryTable.COLUMN_WORK_DIRECTION, workDirection); return bookCategoryMapper.selectList(queryWrapper).stream().map(v -> BookCategoryRespDto.builder() .id(v.getId()) ...
130
105
235
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/manager/cache/BookChapterCacheManager.java
BookChapterCacheManager
getChapter
class BookChapterCacheManager { private final BookChapterMapper bookChapterMapper; /** * 查询小说章节信息,并放入缓存中 */ @Cacheable(cacheManager = CacheConsts.CAFFEINE_CACHE_MANAGER, value = CacheConsts.BOOK_CHAPTER_CACHE_NAME) public BookChapterRespDto getChapter(Long chapterId) {<FILL_FUNCTION_...
BookChapter bookChapter = bookChapterMapper.selectById(chapterId); return BookChapterRespDto.builder() .id(chapterId) .bookId(bookChapter.getBookId()) .chapterNum(bookChapter.getChapterNum()) .chapterName(bookChapter.getChapterName()) .chapter...
202
133
335
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/manager/cache/BookContentCacheManager.java
BookContentCacheManager
getBookContent
class BookContentCacheManager { private final BookContentMapper bookContentMapper; /** * 查询小说内容,并放入缓存中 */ @Cacheable(cacheManager = CacheConsts.REDIS_CACHE_MANAGER, value = CacheConsts.BOOK_CONTENT_CACHE_NAME) public String getBookContent(Long chapterId) {<FILL_FUNCTION_BODY>} @...
QueryWrapper<BookContent> contentQueryWrapper = new QueryWrapper<>(); contentQueryWrapper.eq(DatabaseConsts.BookContentTable.COLUMN_CHAPTER_ID, chapterId) .last(DatabaseConsts.SqlEnum.LIMIT_1.getSql()); BookContent bookContent = bookContentMapper.selectOne(contentQueryWrapper); ...
194
94
288
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/manager/cache/BookInfoCacheManager.java
BookInfoCacheManager
getLastUpdateIdList
class BookInfoCacheManager { private final BookInfoMapper bookInfoMapper; private final BookChapterMapper bookChapterMapper; /** * 从缓存中查询小说信息(先判断缓存中是否已存在,存在则直接从缓存中取,否则执行方法体中的逻辑后缓存结果) */ @Cacheable(cacheManager = CacheConsts.CAFFEINE_CACHE_MANAGER, value = CacheConsts.BOOK_INFO_CACHE...
QueryWrapper<BookInfo> queryWrapper = new QueryWrapper<>(); queryWrapper.eq(DatabaseConsts.BookTable.COLUMN_CATEGORY_ID, categoryId) .gt(DatabaseConsts.BookTable.COLUMN_WORD_COUNT, 0) .orderByDesc(DatabaseConsts.BookTable.COLUMN_LAST_CHAPTER_UPDATE_TIME) .last(Databa...
814
144
958
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/manager/cache/BookRankCacheManager.java
BookRankCacheManager
listRankBooks
class BookRankCacheManager { private final BookInfoMapper bookInfoMapper; /** * 查询小说点击榜列表,并放入缓存中 */ @Cacheable(cacheManager = CacheConsts.REDIS_CACHE_MANAGER, value = CacheConsts.BOOK_VISIT_RANK_CACHE_NAME) public List<BookRankRespDto> listVisitRankBooks() { QueryWrapper<Book...
bookInfoQueryWrapper .gt(DatabaseConsts.BookTable.COLUMN_WORD_COUNT, 0) .last(DatabaseConsts.SqlEnum.LIMIT_30.getSql()); return bookInfoMapper.selectList(bookInfoQueryWrapper).stream().map(v -> { BookRankRespDto respDto = new BookRankRespDto(); respDto.se...
586
277
863
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/manager/cache/FriendLinkCacheManager.java
FriendLinkCacheManager
listFriendLinks
class FriendLinkCacheManager { private final HomeFriendLinkMapper friendLinkMapper; /** * 友情链接列表查询,并放入缓存中 */ @Cacheable(cacheManager = CacheConsts.REDIS_CACHE_MANAGER, value = CacheConsts.HOME_FRIEND_LINK_CACHE_NAME) public List<HomeFriendLinkRespDto> listFriendLinks() {<FILL_FUNCTIO...
// 从友情链接表中查询出友情链接列表 QueryWrapper<HomeFriendLink> queryWrapper = new QueryWrapper<>(); queryWrapper.orderByAsc(DatabaseConsts.CommonColumnEnum.SORT.getName()); return friendLinkMapper.selectList(queryWrapper).stream().map(v -> { HomeFriendLinkRespDto respDto = new HomeFriendL...
126
152
278
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/manager/cache/HomeBookCacheManager.java
HomeBookCacheManager
listHomeBooks
class HomeBookCacheManager { private final HomeBookMapper homeBookMapper; private final BookInfoMapper bookInfoMapper; /** * 查询首页小说推荐,并放入缓存中 */ @Cacheable(cacheManager = CacheConsts.CAFFEINE_CACHE_MANAGER, value = CacheConsts.HOME_BOOK_CACHE_NAME) public List<HomeBookRespDto> li...
// 从首页小说推荐表中查询出需要推荐的小说 QueryWrapper<HomeBook> queryWrapper = new QueryWrapper<>(); queryWrapper.orderByAsc(DatabaseConsts.CommonColumnEnum.SORT.getName()); List<HomeBook> homeBooks = homeBookMapper.selectList(queryWrapper); // 获取推荐小说ID列表 if (!CollectionUtils.isEmpty(hom...
132
497
629
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/manager/cache/NewsCacheManager.java
NewsCacheManager
listLatestNews
class NewsCacheManager { private final NewsInfoMapper newsInfoMapper; /** * 最新新闻列表查询,并放入缓存中 */ @Cacheable(cacheManager = CacheConsts.CAFFEINE_CACHE_MANAGER, value = CacheConsts.LATEST_NEWS_CACHE_NAME) public List<NewsInfoRespDto> listLatestNews() {<FILL_FUNCTION_BODY>} }
// 从新闻信息表中查询出最新发布的两条新闻 QueryWrapper<NewsInfo> queryWrapper = new QueryWrapper<>(); queryWrapper.orderByDesc(DatabaseConsts.CommonColumnEnum.CREATE_TIME.getName()) .last(DatabaseConsts.SqlEnum.LIMIT_2.getSql()); return newsInfoMapper.selectList(queryWrapper).stream().map(v ->...
121
184
305
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/manager/cache/UserInfoCacheManager.java
UserInfoCacheManager
getUser
class UserInfoCacheManager { private final UserInfoMapper userInfoMapper; /** * 查询用户信息,并放入缓存中 */ @Cacheable(cacheManager = CacheConsts.REDIS_CACHE_MANAGER, value = CacheConsts.USER_INFO_CACHE_NAME) public UserInfoDto getUser(Long userId) {<FILL_FUNCTION_BODY>} }
UserInfo userInfo = userInfoMapper.selectById(userId); if (Objects.isNull(userInfo)) { return null; } return UserInfoDto.builder() .id(userInfo.getId()) .status(userInfo.getStatus()).build();
113
74
187
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/manager/dao/UserDaoManager.java
UserDaoManager
listUsers
class UserDaoManager { private final UserInfoMapper userInfoMapper; /** * 根据用户ID集合批量查询用户信息列表 * * @param userIds 需要查询的用户ID集合 * @return 满足条件的用户信息列表 */ public List<UserInfo> listUsers(List<Long> userIds) {<FILL_FUNCTION_BODY>} }
QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<>(); queryWrapper.in(DatabaseConsts.CommonColumnEnum.ID.getName(), userIds); return userInfoMapper.selectList(queryWrapper);
109
54
163
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/manager/message/AbstractMailSender.java
AbstractMailSender
sendMessage
class AbstractMailSender extends AbstractMessageSender { private final MailProperties mailProperties; private final JavaMailSender mailSender; @Override protected void sendMessage(Long toUserId, String messageTitle, String messageContent) {<FILL_FUNCTION_BODY>} }
// TODO 根据消息接收方的用户ID查询出消息接收方的邮件地址 String toEmail = "xxyopen@foxmail.com"; // 开始发送邮件 log.info("发送 HTML 邮件开始:{},{},{}", toEmail, messageTitle, messageContent); // 使用 MimeMessage,MIME 协议 MimeMessage message = mailSender.createMimeMessage(); MimeMessageHelper helper;...
76
297
373
<methods>public non-sealed void <init>() ,public final transient void sendMessage(java.lang.Long, java.lang.Object[]) <variables>private static final java.lang.String PLACEHOLDER
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/manager/message/AbstractMessageSender.java
AbstractMessageSender
sendMessage
class AbstractMessageSender implements MessageSender { private static final String PLACEHOLDER = "{}"; /** * 定义消息发送的模版,子类不能修改此模版 */ @Override public final void sendMessage(Long toUserId, Object... args) {<FILL_FUNCTION_BODY>} /** * 发送消息,具体发送到哪里由子类决定 * * @param toUserId ...
// 1.获取消息标题模版 String titleTemplate = getTitleTemplate(); // 2.获取消息内容模版 String contentTemplate = getContentTemplate(); // 3.解析消息模版,得到最终需要发送的消息标题 String title = resolveTitle(titleTemplate, args); // 4.解析消息内容,得到最终需要发送的消息内容 String content = resolveContent(con...
632
134
766
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/manager/message/AbstractSysNoticeSender.java
AbstractSysNoticeSender
sendMessage
class AbstractSysNoticeSender extends AbstractMessageSender { @Override protected void sendMessage(Long toUserId, String messageTitle, String messageContent) {<FILL_FUNCTION_BODY>} }
// 生成消息的发送时间 LocalDateTime messageDateTime = LocalDateTime.now(); // TODO 在数据库系统通知表中插入一条记录 log.info("系统通知发送成功,{},{},{},{}", toUserId, messageDateTime.format(DateTimeFormatter.ISO_DATE_TIME), messageTitle, messageContent);
55
88
143
<methods>public non-sealed void <init>() ,public final transient void sendMessage(java.lang.Long, java.lang.Object[]) <variables>private static final java.lang.String PLACEHOLDER
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/manager/message/RegisterMailSender.java
RegisterMailSender
getContentTemplate
class RegisterMailSender extends AbstractMailSender { public RegisterMailSender(MailProperties mailProperties, JavaMailSender mailSender) { super(mailProperties, mailSender); } @Override protected String getTitleTemplate() { return "欢迎来到小说精品屋"; } @Override protected String...
return """ <div> 感谢你注册小说精品屋!你的账户现在处于活动状态。 </div> <ul> <li> 你的账户电子邮件:{} <li> 你的账户用户名:{} </ul> <div style="padding: 10px 0 50px 0; text-align: center;"> ...
218
209
427
<methods>public non-sealed void <init>() <variables>private final non-sealed MailProperties mailProperties,private final non-sealed JavaMailSender mailSender
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/manager/mq/AmqpMsgManager.java
AmqpMsgManager
sendAmqpMessage
class AmqpMsgManager { private final AmqpTemplate amqpTemplate; @Value("${spring.amqp.enabled:false}") private boolean amqpEnabled; /** * 发送小说信息改变消息 */ public void sendBookChangeMsg(Long bookId) { if (amqpEnabled) { sendAmqpMessage(amqpTemplate, AmqpConsts.BookChange...
// 如果在事务中则在事务执行完成后再发送,否则可以直接发送 if (TransactionSynchronizationManager.isActualTransactionActive()) { TransactionSynchronizationManager.registerSynchronization( new TransactionSynchronization() { @Override public void afterCommit() { ...
180
132
312
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/manager/redis/VerifyCodeManager.java
VerifyCodeManager
genImgVerifyCode
class VerifyCodeManager { private final StringRedisTemplate stringRedisTemplate; /** * 生成图形验证码,并放入 Redis 中 */ public String genImgVerifyCode(String sessionId) throws IOException {<FILL_FUNCTION_BODY>} /** * 校验图形验证码 */ public boolean imgVerifyCodeOk(String sessionId, String ver...
String verifyCode = ImgVerifyCodeUtils.getRandomVerifyCode(4); String img = ImgVerifyCodeUtils.genVerifyCodeImg(verifyCode); stringRedisTemplate.opsForValue().set(CacheConsts.IMG_VERIFY_CODE_CACHE_KEY + sessionId, verifyCode, Duration.ofMinutes(5)); return img;
234
97
331
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/service/impl/AuthorServiceImpl.java
AuthorServiceImpl
register
class AuthorServiceImpl implements AuthorService { private final AuthorInfoCacheManager authorInfoCacheManager; private final AuthorInfoMapper authorInfoMapper; @Override public RestResp<Void> register(AuthorRegisterReqDto dto) {<FILL_FUNCTION_BODY>} @Override public RestResp<Integer> getSta...
// 校验该用户是否已注册为作家 AuthorInfoDto author = authorInfoCacheManager.getAuthor(dto.getUserId()); if (Objects.nonNull(author)) { // 该用户已经是作家,直接返回 return RestResp.ok(); } // 保存作家注册信息 AuthorInfo authorInfo = new AuthorInfo(); authorInfo.setUserId(d...
153
279
432
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/service/impl/DbSearchServiceImpl.java
DbSearchServiceImpl
searchBooks
class DbSearchServiceImpl implements SearchService { private final BookInfoMapper bookInfoMapper; @Override public RestResp<PageRespDto<BookInfoRespDto>> searchBooks(BookSearchReqDto condition) {<FILL_FUNCTION_BODY>} }
Page<BookInfoRespDto> page = new Page<>(); page.setCurrent(condition.getPageNum()); page.setSize(condition.getPageSize()); List<BookInfo> bookInfos = bookInfoMapper.searchBooks(page, condition); return RestResp.ok( PageRespDto.of(condition.getPageNum(), condition.get...
76
230
306
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/service/impl/EsSearchServiceImpl.java
EsSearchServiceImpl
buildSearchCondition
class EsSearchServiceImpl implements SearchService { private final ElasticsearchClient esClient; @SneakyThrows @Override public RestResp<PageRespDto<BookInfoRespDto>> searchBooks(BookSearchReqDto condition) { SearchResponse<EsBookDto> response = esClient.search(s -> { SearchR...
BoolQuery boolQuery = BoolQuery.of(b -> { // 只查有字数的小说 b.must(RangeQuery.of(m -> m .field(EsConsts.BookIndex.FIELD_WORD_COUNT) .gt(JsonData.of(0)) )._toQuery()); if (!StringUtils.isBlank(condition.getKeyword())) { ...
868
657
1,525
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/service/impl/NewsServiceImpl.java
NewsServiceImpl
getNews
class NewsServiceImpl implements NewsService { private final NewsCacheManager newsCacheManager; private final NewsInfoMapper newsInfoMapper; private final NewsContentMapper newsContentMapper; @Override public RestResp<List<NewsInfoRespDto>> listLatestNews() { return RestResp.ok(newsCache...
NewsInfo newsInfo = newsInfoMapper.selectById(id); QueryWrapper<NewsContent> queryWrapper = new QueryWrapper<>(); queryWrapper.eq(DatabaseConsts.NewsContentTable.COLUMN_NEWS_ID, id) .last(DatabaseConsts.SqlEnum.LIMIT_1.getSql()); NewsContent newsContent = newsContentMapper.s...
133
169
302
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/service/impl/ResourceServiceImpl.java
ResourceServiceImpl
uploadImage
class ResourceServiceImpl implements ResourceService { private final VerifyCodeManager verifyCodeManager; @Value("${novel.file.upload.path}") private String fileUploadPath; @Override public RestResp<ImgVerifyCodeRespDto> getImgVerifyCode() throws IOException { String sessionId = IdWorker....
LocalDateTime now = LocalDateTime.now(); String savePath = SystemConfigConsts.IMAGE_UPLOAD_DIRECTORY + now.format(DateTimeFormatter.ofPattern("yyyy")) + File.separator + now.format(DateTimeFormatter.ofPattern("MM")) + File.separator + now.form...
195
334
529
<no_super_class>
201206030_novel
novel/src/main/java/io/github/xxyopen/novel/service/impl/UserServiceImpl.java
UserServiceImpl
register
class UserServiceImpl implements UserService { private final UserInfoMapper userInfoMapper; private final VerifyCodeManager verifyCodeManager; private final UserFeedbackMapper userFeedbackMapper; private final UserBookshelfMapper userBookshelfMapper; private final JwtUtils jwtUtils; @Overr...
// 校验图形验证码是否正确 if (!verifyCodeManager.imgVerifyCodeOk(dto.getSessionId(), dto.getVelCode())) { // 图形验证码校验失败 throw new BusinessException(ErrorCodeEnum.USER_VERIFY_CODE_ERROR); } // 校验手机号是否已注册 QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<>(); ...
1,105
463
1,568
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/Metrics.java
Metrics
updateSubFiles
class Metrics { private static final Logger LOGGER = LoggerFactory.getLogger(Metrics.class); private static final StatsdConfig statsdConfig = new StatsdConfig() { @Override public String get(String k) { return null; } @Override public StatsdFlavor flavor() ...
// Add tag for per-project reindex. if (statsdRegistry != null && !subFiles.isEmpty()) { String projects = subFiles.stream(). map(s -> s.startsWith(Indexer.PATH_SEPARATOR_STRING) ? s.substring(1) : s). collect(Collectors.joining(",")); Tag...
640
155
795
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/AbstractAnalyzer.java
AbstractAnalyzer
get
class AbstractAnalyzer extends Analyzer { public static final Reader DUMMY_READER = new StringReader(""); protected AnalyzerFactory factory; protected Supplier<JFlexTokenizer> symbolTokenizerFactory; protected Project project; protected Ctags ctags; protected NumLinesLOCAggregator countsAggrega...
if (typeName == null) { return null; } for (Genre g : values()) { if (g.typeName.equals(typeName)) { return g; } } return null;
1,070
63
1,133
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/AnalyzerGuruHelp.java
AnalyzerGuruHelp
reportable
class AnalyzerGuruHelp { private AnalyzerGuruHelp() { } /** * Gets a reportable hunk of text that details * {@link AnalyzerGuru#getPrefixesMap()}, * {@link AnalyzerGuru#getExtensionsMap()}, * {@link AnalyzerGuru#getMagicsMap()}, and * {@link AnalyzerGuru#getAnalyzerFactoryMatchers...
if (value.startsWith("#!")) { return value; } boolean allAsciiPrintable = true; for (int i = 0; i < value.length(); ++i) { char c = value.charAt(i); if (c < ' ' || c > '~') { allAsciiPrintable = false; break; ...
1,714
253
1,967
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/CompatibleAnalyser.java
CompatibleAnalyser
createComponents
class CompatibleAnalyser extends Analyzer { public CompatibleAnalyser() { super(Analyzer.PER_FIELD_REUSE_STRATEGY); } @Override protected TokenStreamComponents createComponents(String fieldName) {<FILL_FUNCTION_BODY>} private JFlexTokenizer createPlainSymbolTokenizer() { return ne...
switch (fieldName) { case QueryBuilder.FULL: return new TokenStreamComponents(createPlainFullTokenizer()); case QueryBuilder.REFS: return new TokenStreamComponents(createPlainSymbolTokenizer()); case QueryBuilder.DEFS: return n...
259
187
446
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/Definitions.java
LineTagMap
occurrences
class LineTagMap implements Serializable { private static final long serialVersionUID = 1191703801007779481L; @SuppressWarnings("java:S116") private final Map<String, Set<Tag>> sym_tags; //NOPMD protected LineTagMap() { this.sym_tags = new HashMap<>(); } } /...
Set<Integer> lines = symbols.get(symbol); return lines == null ? 0 : lines.size();
839
31
870
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/ExpandTabsReader.java
ExpandTabsReader
read
class ExpandTabsReader extends FilterReader { /** The size of tabs. */ private final int tabSize; /** * The position on the current line. Used to decide how many spaces to * insert to fill up to the next tab stop. */ private int pos; /** * Number of spaces to insert (as replace...
for (int i = 0; i < len; i++) { int c = read(); if (c == -1) { return (i > 0 ? i : -1); } cbuf[off + i] = (char) c; } return len;
1,234
76
1,310
<methods>public void close() throws java.io.IOException,public void mark(int) throws java.io.IOException,public boolean markSupported() ,public int read() throws java.io.IOException,public int read(char[], int, int) throws java.io.IOException,public boolean ready() throws java.io.IOException,public void reset() throws ...
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/FileAnalyzerFactory.java
FileAnalyzerFactory
getAnalyzer
class FileAnalyzerFactory extends AnalyzerFactory { /** The user-friendly name of this analyzer. */ private final String name; /** * Create an instance of {@code FileAnalyzerFactory}. */ FileAnalyzerFactory() { this(null, null, null, null, null, null, null, null, false); } /...
AbstractAnalyzer fa = cachedAnalyzer.get(); if (fa == null) { fa = newAnalyzer(); cachedAnalyzer.set(fa); } return fa;
1,254
51
1,305
<methods>public abstract org.opengrok.indexer.analysis.AbstractAnalyzer getAnalyzer() ,public final org.opengrok.indexer.analysis.AbstractAnalyzer.Genre getGenre() ,public abstract java.lang.String getName() ,public boolean hasAnnotations() ,public abstract void returnAnalyzer() <variables>protected final non-sealed Th...
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/HistoryAnalyzer.java
HistoryAnalyzer
createComponents
class HistoryAnalyzer extends Analyzer { private final CharArraySet stopWords; /** * An array containing some common English words that are not usually useful * for searching. */ private static final String[] ENGLISH_STOP_WORDS = { "a", "an", "and", "are", "as", "at", "be", "but", "b...
JFlexTokenizer plainfull = new JFlexTokenizer(new PlainFullTokenizer( AbstractAnalyzer.DUMMY_READER)); //we are counting position increments, this might affect the queries //later and need to be in sync, especially for highlighting of results return new TokenStreamCompon...
445
98
543
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/IteratorReader.java
IteratorReader
read
class IteratorReader extends Reader { private Iterator<String> iterator; private StringReader current; public IteratorReader(Iterable<String> iterable) { if (iterable == null) { throw new IllegalArgumentException("`iterable' is null"); } Iterator<String> iter = iterable....
if (current != null) { int ret = current.read(cbuf, off, len); if (ret > 0 || len == 0) { // If some data was read, or if no data was requested, // we're OK. Return the number of characters read. return ret; } } ...
244
173
417
<methods>public abstract void close() throws java.io.IOException,public void mark(int) throws java.io.IOException,public boolean markSupported() ,public static java.io.Reader nullReader() ,public int read() throws java.io.IOException,public int read(java.nio.CharBuffer) throws java.io.IOException,public int read(char[]...
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/JFlexTokenizer.java
JFlexTokenizer
setAttribs
class JFlexTokenizer extends Tokenizer implements SymbolMatchedListener { private static final int LUCENE_MAX_TOKEN_LENGTH = 32766; private final ScanningSymbolMatcher matcher; private boolean didSetAttribsValues; /** * Initialize an instance, passing a {@link ScanningSymbolMatcher} which ...
clearAttributesEtc(); if (start < Integer.MAX_VALUE && end < Integer.MAX_VALUE) { if (str.length() > LUCENE_MAX_TOKEN_LENGTH) { str = str.substring(0, LUCENE_MAX_TOKEN_LENGTH); /* * Leave `end` unadjusted. The truncated string will represent...
984
259
1,243
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/PathTokenizer.java
PathTokenizer
incrementToken
class PathTokenizer extends Tokenizer { // below should be '/' since we try to convert even windows file separators // to unix ones public static final char DEFAULT_DELIMITER = '/'; private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class); private final OffsetAttribute offset...
clearAttributes(); if (dot) { dot = false; termAtt.setEmpty(); termAtt.append(cdot); termAtt.setLength(1); offsetAtt.setOffset(correctOffset(startPosition), correctOffset(startPosition + 1)); startPosition++; return tru...
294
470
764
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/PendingToken.java
PendingToken
equals
class PendingToken { public final String str; public final int start; public final int end; /** * Initializes an instance with immutable fields for the specified * arguments. * @param str string value * @param start start offset * @param end end offset */ public Pendi...
if (o == this) { return true; } if (!(o instanceof PendingToken)) { return false; } PendingToken other = (PendingToken) o; return start == other.start && end == other.end && str.equals(other.str);
327
79
406
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/PendingTokenOffsetsComparator.java
PendingTokenOffsetsComparator
compare
class PendingTokenOffsetsComparator implements Comparator<PendingToken> { /** * Singleton instance. */ public static final PendingTokenOffsetsComparator INSTANCE = new PendingTokenOffsetsComparator(); @Override public int compare(PendingToken o1, PendingToken o2) {<FILL_FUNCTION_BODY...
// ASC by starting offset. int cmp = Integer.compare(o1.start, o2.start); if (cmp != 0) { return cmp; } // ASC by ending offset cmp = Integer.compare(o1.end, o2.end); return cmp;
128
83
211
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/Scopes.java
Scope
deserialize
class Scope implements Serializable, Comparable<Scope> { private static final long serialVersionUID = 1191703801007779489L; private int lineFrom; private int lineTo; private String name; private String namespace; private String signature; public Scope(int lineF...
try (ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes))) { in.setObjectInputFilter(serialFilter); return (Scopes) in.readObject(); }
953
50
1,003
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/StreamSource.java
StreamSource
fromString
class StreamSource { /** * Get a stream that reads data from the input source. Every call should * return a new instance so that multiple readers can read from the source * without interfering with each other. * * @return an {@code InputStream} * @throws IOException if an error occurs ...
return new StreamSource() { private final byte[] sbuf = str.getBytes(StandardCharsets.UTF_8); @Override public InputStream getStream() throws IOException { return new ByteArrayInputStream(sbuf); } };
297
66
363
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/TextAnalyzer.java
TextAnalyzer
writeXref
class TextAnalyzer extends FileAnalyzer { /** * Creates a new instance of {@link TextAnalyzer}. * @param factory defined instance for the analyzer */ protected TextAnalyzer(AnalyzerFactory factory) { super(factory); } /** * Creates a new instance of {@link TextAnalyzer}. ...
if (args == null) { throw new IllegalArgumentException("`args' is null"); } Xrefer xref = newXref(args.getIn()); xref.setDefs(args.getDefs()); xref.setScopesEnabled(scopesEnabled); xref.setFoldingEnabled(foldingEnabled); xref.setAnnotation(args.getAnn...
558
133
691
<methods>public void <init>(org.opengrok.indexer.analysis.AnalyzerFactory) ,public void analyze(Document, org.opengrok.indexer.analysis.StreamSource, java.io.Writer) throws java.io.IOException, java.lang.InterruptedException,public java.lang.String getCtagsLang() ,public java.lang.String getFileTypeName() ,public final...
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/XrefStyle.java
XrefStyle
getStyle
class XrefStyle { /** * Name of the style definition as given by CTags. */ final String name; /** * Class name used by the style sheets when rendering the xref. */ final String ssClass; /** * The title of the section to which this type belongs, or {@code null} * if thi...
for (XrefStyle style : DEFINITION_STYLES) { if (type.startsWith(style.name)) { return style; } } return null;
630
53
683
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/XrefWork.java
XrefWork
getXrefer
class XrefWork { private Xrefer xrefer; private Exception exception; private final WriteXrefArgs args; private final AbstractAnalyzer analyzer; public XrefWork(WriteXrefArgs args, AbstractAnalyzer analyzer) { this.args = args; this.analyzer = analyzer; } public Xrefer getXr...
RuntimeEnvironment env = RuntimeEnvironment.getInstance(); CompletableFuture<XrefWork> future = CompletableFuture.supplyAsync(() -> { try { xrefer = this.analyzer.writeXref(args); } catch (IOException e) { exceptio...
119
207
326
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/ZeroReader.java
ZeroReader
read
class ZeroReader extends Reader { /** The underlying Reader that is being wrapped. */ private final Reader reader; /** * Initializes to wrap a {@link Reader} that might not always block * appropriately in {@link #read(char[], int, int)}. */ public ZeroReader(Reader reader) { thi...
int n = reader.read(cbuf, off, len); if (n != 0 || len == 0) { return n; } if (len < 0) { throw new IndexOutOfBoundsException("len is negative"); } if (off >= cbuf.length || off < 0) { throw new IndexOutOfBoundsException("off is out o...
528
200
728
<methods>public abstract void close() throws java.io.IOException,public void mark(int) throws java.io.IOException,public boolean markSupported() ,public static java.io.Reader nullReader() ,public int read() throws java.io.IOException,public int read(java.nio.CharBuffer) throws java.io.IOException,public int read(char[]...
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/ada/AdaLexer.java
AdaLexer
takeLiteral
class AdaLexer extends JFlexSymbolMatcher implements JFlexJointLexer, Resettable { /** * Writes {@code value} to output -- if it contains any EOLs then the * {@link JFlexJointLexer#startNewLine()} is called in lieu of outputting * EOL. */ public void takeLiteral(String value, String...
disjointSpan(className); int off = 0; do { int w = 1; int i; int ri = value.indexOf("\r", off); int ni = value.indexOf("\n", off); if (ri == -1 && ni == -1) { String sub = value.substring(off); offer(s...
245
285
530
<methods>public non-sealed void <init>() ,public void clearNonSymbolMatchedListener() ,public void clearSymbolMatchedListener() ,public void setNonSymbolMatchedListener(org.opengrok.indexer.analysis.NonSymbolMatchedListener) ,public void setSymbolMatchedListener(org.opengrok.indexer.analysis.SymbolMatchedListener) <var...
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/archive/BZip2Analyzer.java
BZip2Analyzer
analyze
class BZip2Analyzer extends FileAnalyzer { private Genre g; @Override public Genre getGenre() { if (g != null) { return g; } return super.getGenre(); } protected BZip2Analyzer(AnalyzerFactory factory) { super(factory); } /** * @return {@co...
var optionalNewName = Optional.ofNullable(doc.get(QueryBuilder.PATH)) .filter(path -> path.toUpperCase().endsWith(".BZ2") || path.endsWith(".bz")) .map(path -> path.substring(0, path.lastIndexOf('.'))); if (optionalNewName.isPresent()) { StreamSource bzSrc =...
471
351
822
<methods>public void <init>(org.opengrok.indexer.analysis.AnalyzerFactory) ,public void analyze(Document, org.opengrok.indexer.analysis.StreamSource, java.io.Writer) throws java.io.IOException, java.lang.InterruptedException,public java.lang.String getCtagsLang() ,public java.lang.String getFileTypeName() ,public final...
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/archive/GZIPAnalyzer.java
GZIPAnalyzer
analyze
class GZIPAnalyzer extends FileAnalyzer { private static final Logger LOGGER = LoggerFactory.getLogger(GZIPAnalyzer.class); private Genre g; @Override public Genre getGenre() { if (g != null) { return g; } return super.getGenre(); } protected GZIPAnalyzer(...
AbstractAnalyzer fa; StreamSource gzSrc = wrap(src); String path = doc.get(QueryBuilder.PATH); if (path != null && path.toLowerCase(Locale.ROOT).endsWith(".gz")) { String newname = path.substring(0, path.length() - 3); try (InputStream gzis = gzSrc.getStream()) ...
408
398
806
<methods>public void <init>(org.opengrok.indexer.analysis.AnalyzerFactory) ,public void analyze(Document, org.opengrok.indexer.analysis.StreamSource, java.io.Writer) throws java.io.IOException, java.lang.InterruptedException,public java.lang.String getCtagsLang() ,public java.lang.String getFileTypeName() ,public final...
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/archive/TarAnalyzer.java
TarAnalyzer
analyze
class TarAnalyzer extends FileAnalyzer { protected TarAnalyzer(AnalyzerFactory factory) { super(factory); } /** * @return {@code null} as there is no aligned language */ @Override public String getCtagsLang() { return null; } /** * Gets a version number to b...
ArrayList<String> names = new ArrayList<>(); try (TarInputStream zis = new TarInputStream(src.getStream())) { TarEntry entry; while ((entry = zis.getNextEntry()) != null) { String name = entry.getName(); names.add(name); if (xrefO...
226
151
377
<methods>public void <init>(org.opengrok.indexer.analysis.AnalyzerFactory) ,public void analyze(Document, org.opengrok.indexer.analysis.StreamSource, java.io.Writer) throws java.io.IOException, java.lang.InterruptedException,public java.lang.String getCtagsLang() ,public java.lang.String getFileTypeName() ,public final...
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/archive/ZipAnalyzer.java
ZipAnalyzer
analyze
class ZipAnalyzer extends FileAnalyzer { protected ZipAnalyzer(AnalyzerFactory factory) { super(factory); } /** * @return {@code null} as there is no aligned language */ @Override public String getCtagsLang() { return null; } /** * Gets a version number to b...
ArrayList<String> names = new ArrayList<>(); try (ZipInputStream zis = new ZipInputStream(src.getStream())) { ZipEntry entry; while ((entry = zis.getNextEntry()) != null) { String name = entry.getName(); names.add(name); if (xrefO...
228
153
381
<methods>public void <init>(org.opengrok.indexer.analysis.AnalyzerFactory) ,public void analyze(Document, org.opengrok.indexer.analysis.StreamSource, java.io.Writer) throws java.io.IOException, java.lang.InterruptedException,public java.lang.String getCtagsLang() ,public java.lang.String getFileTypeName() ,public final...
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/archive/ZipMatcherBase.java
ZipMatcherBase
isMagic
class ZipMatcherBase implements FileAnalyzerFactory.Matcher { private static final byte[] MAGIC = {'P', 'K', 3, 4}; private static final int LOCHDRSIZ = 30; private static final int XFHSIZ = 4; @Override public boolean isPreciseMagic() { return true; } @Override public Analyze...
assert in.markSupported(); if (contents.length < MAGIC.length) { return null; } for (int i = 0; i < MAGIC.length; i++) { if (contents[i] != MAGIC[i]) { return null; } } if (!doesCheckExtraFieldID()) { retur...
464
296
760
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/data/IgnorantAnalyzerFactory.java
IgnorantAnalyzerFactory
newAnalyzer
class IgnorantAnalyzerFactory extends FileAnalyzerFactory { private static final String[] SUFFIXES = { "BDF", "XPM", "PS", "AFM", "PDF", "LIB", "PDB" }; private static final String[] MAGICS = { "%!PS-", // post script files "# PaCkAg", "%PDF", "Microso...
// just use a FileAnalyzer since it won't analyze or xref the file return new FileAnalyzer(this);
254
33
287
<methods>public final org.opengrok.indexer.analysis.AbstractAnalyzer getAnalyzer() ,public java.lang.String getName() ,public void returnAnalyzer() <variables>private final non-sealed java.lang.String name
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/data/ImageAnalyzerFactory.java
ImageAnalyzerFactory
newAnalyzer
class ImageAnalyzerFactory extends FileAnalyzerFactory { private static final String NAME = "Image file"; private static final String[] SUFFIXES = { "PNG", "GIF", "JPEG", "JPG", "TIFF", "BMP" }; public ImageAnalyzerFactory() { super(null, null, SUFFIXES, null, null, null, AbstractAnal...
// just use a FileAnalyzer since it won't analyze or xref the file return new FileAnalyzer(this);
145
33
178
<methods>public final org.opengrok.indexer.analysis.AbstractAnalyzer getAnalyzer() ,public java.lang.String getName() ,public void returnAnalyzer() <variables>private final non-sealed java.lang.String name
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/document/DocumentMatcher.java
DocumentMatcher
isMagic
class DocumentMatcher implements Matcher { /** * Set to 512K {@code int}, but {@code NUMCHARS_FIRST_LOOK} and * {@code LINE_LIMIT} should apply beforehand. This value is "effectively * unbounded" without being literally 2_147_483_647 -- as the other limits * will apply first, and the {@link jav...
if (!in.markSupported()) { return null; } in.mark(MARK_READ_LIMIT); // read encoding, and skip past any BOM int bomLength = 0; String encoding = IOUtils.findBOMEncoding(contents); if (encoding == null) { encoding = StandardCharsets.UTF_8...
1,083
624
1,707
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/document/MandocAnalyzer.java
MandocAnalyzer
analyze
class MandocAnalyzer extends TextAnalyzer { /** * Creates a new instance of MandocAnalyzer. * @param factory defined instance for the analyzer */ protected MandocAnalyzer(AnalyzerFactory factory) { super(factory, () -> new JFlexTokenizer(new TroffFullTokenizer( AbstractAn...
// this is to explicitly use appropriate analyzers tokenstream to // workaround #1376 symbols search works like full text search JFlexTokenizer symbolTokenizer = symbolTokenizerFactory.get(); symbolTokenizer.setReader(getReader(src.getStream())); OGKTextField full = new OGKText...
393
284
677
<methods>public org.opengrok.indexer.analysis.Xrefer writeXref(org.opengrok.indexer.analysis.WriteXrefArgs) throws java.io.IOException<variables>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/document/MandocAnalyzerFactory.java
MandocAnalyzerFactory
isMagic
class MandocAnalyzerFactory extends FileAnalyzerFactory { private static final String NAME = "Manual pages"; public static final Matcher MATCHER = new Matcher() { @Override public AnalyzerFactory isMagic(byte[] contents, InputStream in) throws IOException {<FILL_FUNCTION_BODY>}...
return RuntimeEnvironment.getInstance().getMandoc() != null ? getTrueMenMatcher().isMagic(contents, in) : getTrueMdocMatcher().isMagic(contents, in);
730
54
784
<methods>public final org.opengrok.indexer.analysis.AbstractAnalyzer getAnalyzer() ,public java.lang.String getName() ,public void returnAnalyzer() <variables>private final non-sealed java.lang.String name
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/document/MandocRunner.java
MandocRunner
write
class MandocRunner { private static final Logger LOGGER = LoggerFactory.getLogger( MandocRunner.class); private Process mandoc; private OutputStreamWriter mandocIn; private BufferedReader mandocOut; private Thread errThread; private String osOverride = "GENERIC SYSTEM"; /** * ...
if (mandocIn == null) { throw new IllegalStateException("start() must succeed first"); } mandocIn.write(s);
1,415
42
1,457
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/document/TroffAnalyzer.java
TroffAnalyzer
analyze
class TroffAnalyzer extends TextAnalyzer { /** * Creates a new instance of TroffAnalyzer. * @param factory defined instance for the analyzer */ protected TroffAnalyzer(AnalyzerFactory factory) { super(factory, () -> new JFlexTokenizer(new TroffFullTokenizer( AbstractAnaly...
//this is to explicitly use appropriate analyzers tokenstream to workaround #1376 symbols search works like full text search JFlexTokenizer symbolTokenizer = symbolTokenizerFactory.get(); symbolTokenizer.setReader(getReader(src.getStream())); OGKTextField full = new OGKTextField(QueryBu...
370
280
650
<methods>public org.opengrok.indexer.analysis.Xrefer writeXref(org.opengrok.indexer.analysis.WriteXrefArgs) throws java.io.IOException<variables>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/eiffel/EiffelLexer.java
EiffelLexer
maybeEndVerbatim
class EiffelLexer extends JFlexSymbolMatcher implements JFlexJointLexer, Resettable { /** * When matching a Verbatim_string, the expected closer is stored here. */ private String vstring_closer; /** * Resets the instance to an initial state. */ @Override public void res...
int npushback; if (!capture.startsWith(vstring_closer)) { // Nope--so just write the double quote, and push back the rest. offer(capture.substring(0, 1)); npushback = capture.length() - 1; } else { offer(vstring_closer); disjointSpan(n...
745
161
906
<methods>public non-sealed void <init>() ,public void clearNonSymbolMatchedListener() ,public void clearSymbolMatchedListener() ,public void setNonSymbolMatchedListener(org.opengrok.indexer.analysis.NonSymbolMatchedListener) ,public void setSymbolMatchedListener(org.opengrok.indexer.analysis.SymbolMatchedListener) <var...
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/executables/JFieldBuilder.java
JFieldBuilder
write
class JFieldBuilder { private final Map<String, StringWriter> fieldBuilders = new HashMap<>(); boolean hasField(String fieldName) { return fieldBuilders.containsKey(fieldName); } StringWriter write(String fieldName) {<FILL_FUNCTION_BODY>} }
StringWriter res = fieldBuilders.getOrDefault(fieldName, null); if (res != null) { return res; } res = new StringWriter(); fieldBuilders.put(fieldName, res); return res;
80
66
146
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/executables/JarAnalyzer.java
JarAnalyzer
analyze
class JarAnalyzer extends FileAnalyzer { private static final String[] UNSTORED_FIELD_NAMES = new String[] {QueryBuilder.FULL, QueryBuilder.REFS}; protected JarAnalyzer(AnalyzerFactory factory) { super(factory); } /** * @return {@code null} as there is no aligned language ...
JFieldBuilder jfbuilder = new JFieldBuilder(); try (ZipInputStream zis = new ZipInputStream(src.getStream())) { ZipEntry entry; while ((entry = zis.getNextEntry()) != null) { String ename = entry.getName(); if (xrefOut != null) { ...
262
431
693
<methods>public void <init>(org.opengrok.indexer.analysis.AnalyzerFactory) ,public void analyze(Document, org.opengrok.indexer.analysis.StreamSource, java.io.Writer) throws java.io.IOException, java.lang.InterruptedException,public java.lang.String getCtagsLang() ,public java.lang.String getFileTypeName() ,public final...
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/executables/JarAnalyzerFactory.java
JarAnalyzerFactory
description
class JarAnalyzerFactory extends FileAnalyzerFactory { private static final String NAME = "Jar"; private static final String[] SUFFIXES = { "JAR", "WAR", "EAR" }; private static final Matcher MATCHER = new ZipMatcherBase() { @Override public String description() {<FILL_FUNCTI...
return "PK\\{3}\\{4} magic signature with 0xCAFE Extra Field ID";
290
27
317
<methods>public final org.opengrok.indexer.analysis.AbstractAnalyzer getAnalyzer() ,public java.lang.String getName() ,public void returnAnalyzer() <variables>private final non-sealed java.lang.String name
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/executables/JavaClassAnalyzerFactory.java
JavaClassAnalyzerFactory
isMagic
class JavaClassAnalyzerFactory extends FileAnalyzerFactory { private static final String NAME = "Java class"; private static final String[] SUFFIXES = { "CLASS" }; private static final byte[] CAFEBABE = new byte[] {(byte) 0xCA, (byte) 0xFE, (byte) 0xBA, (byte) 0xBE}; private stati...
if (content.length < 8) { return null; } // Require CAFEBABE or indicate no match. for (int i = 0; i < CAFEBABE.length; ++i) { if (content[i] != CAFEBABE[i]) { return null; } } /...
484
214
698
<methods>public final org.opengrok.indexer.analysis.AbstractAnalyzer getAnalyzer() ,public java.lang.String getName() ,public void returnAnalyzer() <variables>private final non-sealed java.lang.String name
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/hcl/HCLLexer.java
HCLLexer
hereOp
class HCLLexer extends JFlexSymbolMatcher implements JFlexJointLexer, Resettable { // Defined to be the equivalent of {Identifier} from HCL.lexh private static final Pattern HERE_TERMINATOR_MATCH = Pattern.compile( "^\\p{javaUnicodeIdentifierStart}(\\p{javaUnicodeIdentifierPart}|-)*"); pri...
if (!capture.startsWith("<<")) { throw new IllegalArgumentException("bad HERE: " + capture); } offer(capture); if (dataHead.hereSettings == null) { dataHead.hereSettings = new LinkedList<>(); } String remaining = capture; boolean indente...
1,532
298
1,830
<methods>public non-sealed void <init>() ,public void clearNonSymbolMatchedListener() ,public void clearSymbolMatchedListener() ,public void setNonSymbolMatchedListener(org.opengrok.indexer.analysis.NonSymbolMatchedListener) ,public void setSymbolMatchedListener(org.opengrok.indexer.analysis.SymbolMatchedListener) <var...
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/javascript/JavaScriptLexer.java
JavaScriptLexer
notInTemplateOrSubstitutionDoesNotEnd
class JavaScriptLexer extends JFlexSymbolMatcher implements JFlexJointLexer, Resettable { private ECMAScriptLexerData data; /** * Represents the stack of data if substitution is nested. */ private Stack<ECMAScriptLexerData> dataStack; public JavaScriptLexer() { data = new EC...
if (data.nEndBrace <= 0) { return true; } if (capture.startsWith("}")) { if (--data.nEndBrace <= 0) { int nRemaining = capture.length() - 1; String opener = capture.substring(0, 1); popData(); yypop(); ...
678
184
862
<methods>public non-sealed void <init>() ,public void clearNonSymbolMatchedListener() ,public void clearSymbolMatchedListener() ,public void setNonSymbolMatchedListener(org.opengrok.indexer.analysis.NonSymbolMatchedListener) ,public void setSymbolMatchedListener(org.opengrok.indexer.analysis.SymbolMatchedListener) <var...
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/lua/LuaUtils.java
LuaUtils
isClosingLongBracket
class LuaUtils { /** * Private to enforce singleton. */ private LuaUtils() { } /** * Counts the level of a Lua opening long bracket specified in * {@code capture}. * @param capture the opening long bracket * @return the bracket level */ public static int countOp...
if (!capture.startsWith("]") || !capture.endsWith("]")) { throw new IllegalArgumentException( "Invalid opening long bracket: " + capture); } int n = 0; for (int i = 1; i + 1 < capture.length(); ++i) { if (capture.charAt(i) != '=') { ...
359
135
494
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/plain/DefinitionsTokenStream.java
DefinitionsTokenStream
initialize
class DefinitionsTokenStream extends TokenStream { /** * Defines the ultimate queue of tokens to be produced by * {@link #incrementToken()}. */ private final List<PendingToken> events = new ArrayList<>(); private final CharTermAttribute termAtt = addAttribute( CharTermAttribute.clas...
if (defs == null) { throw new IllegalArgumentException("`defs' is null"); } if (src == null) { throw new IllegalArgumentException("`src' is null"); } events.clear(); offset = 0; LineBreaker brk = new LineBreaker(); brk.reset(src,...
722
105
827
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/plain/PlainAnalyzer.java
PlainAnalyzer
analyze
class PlainAnalyzer extends TextAnalyzer { /** * Creates a new instance of PlainAnalyzer. * @param factory defined instance for the analyzer */ protected PlainAnalyzer(AnalyzerFactory factory) { super(factory); } /** * Creates a new instance of {@link PlainAnalyzer}. *...
Definitions defs = null; NullWriter nullWriter = null; doc.add(new OGKTextField(QueryBuilder.FULL, getReader(src.getStream()))); String fullPath = doc.get(QueryBuilder.FULLPATH); if (fullPath != null && ctags != null) { defs = ctags.doCtags(fullPath); i...
961
676
1,637
<methods>public org.opengrok.indexer.analysis.Xrefer writeXref(org.opengrok.indexer.analysis.WriteXrefArgs) throws java.io.IOException<variables>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/plain/PlainAnalyzerFactory.java
PlainAnalyzerFactory
readSomePlainCharactersUTF8noBOMwithoutError
class PlainAnalyzerFactory extends FileAnalyzerFactory { private static final String NAME = "Plain Text"; private static final int MIN_CHARS_WHILE_REMAINING = 20; // Up to 4 octets per UTF-8 character private static final int TRY_UTF8_BYTES = MIN_CHARS_WHILE_REMAINING * 4; /** * The reentra...
boolean isEOF = false; byte[] bytes = new byte[TRY_UTF8_BYTES]; in.mark(TRY_UTF8_BYTES); int len = in.read(bytes); in.reset(); if (len < 1) { return false; } if (len != TRY_UTF8_BYTES) { bytes = Arrays.copyOf(bytes, len); ...
568
636
1,204
<methods>public final org.opengrok.indexer.analysis.AbstractAnalyzer getAnalyzer() ,public java.lang.String getName() ,public void returnAnalyzer() <variables>private final non-sealed java.lang.String name
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/plain/XMLAnalyzer.java
XMLAnalyzer
analyze
class XMLAnalyzer extends TextAnalyzer { /** * Creates a new instance of XMLAnalyzer. * @param factory factory to be used */ protected XMLAnalyzer(AnalyzerFactory factory) { super(factory); } /** * @return {@code "XML"} */ @Override public String getCtagsLang()...
doc.add(new OGKTextField(QueryBuilder.FULL, getReader(src.getStream()))); if (xrefOut != null) { try (Reader in = getReader(src.getStream())) { WriteXrefArgs args = new WriteXrefArgs(in, xrefOut); args.setProject(project); XrefWork xrefWork =...
338
218
556
<methods>public org.opengrok.indexer.analysis.Xrefer writeXref(org.opengrok.indexer.analysis.WriteXrefArgs) throws java.io.IOException<variables>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/r/RLexer.java
RLexer
chkLOC
class RLexer extends JFlexSymbolMatcher implements JFlexJointLexer, Resettable { /** * Calls {@link #phLOC()} if the yystate is not SCOMMENT. */ public void chkLOC() {<FILL_FUNCTION_BODY>} /** * Subclasses must override to get the constant value created by JFlex to * represent SCOMMENT...
int yystate = yystate(); if (yystate != SCOMMENT()) { phLOC(); }
122
36
158
<methods>public non-sealed void <init>() ,public void clearNonSymbolMatchedListener() ,public void clearSymbolMatchedListener() ,public void setNonSymbolMatchedListener(org.opengrok.indexer.analysis.NonSymbolMatchedListener) ,public void setSymbolMatchedListener(org.opengrok.indexer.analysis.SymbolMatchedListener) <var...
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/rust/RustUtils.java
RustUtils
countRawHashes
class RustUtils { /** * Private to enforce singleton. */ private RustUtils() { } /** * Counts the number of hashes ('#') before a terminating quote ('"') in * {@code capture}. * @param capture the Rust raw- or raw-byte-string initiator (e.g., * {@code "r##\""}) * @r...
if (!capture.endsWith("\"")) { throw new IllegalArgumentException("`capture' does not end in \""); } int n = 0; for (int i = capture.length() - 2; i >= 0; --i) { if (capture.charAt(i) != '#') { break; } ++n; } ...
493
104
597
<no_super_class>
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/sql/JointSQLLexer.java
JointSQLLexer
chkLOC
class JointSQLLexer extends JFlexSymbolMatcher implements JFlexJointLexer, Resettable { protected int commentLevel; @Override public void reset() { super.reset(); commentLevel = 0; } @Override public void yypop() throws IOException { onDisjointSpanChanged(null, getYYCH...
if (yystate() != BRACKETED_COMMENT() && yystate() != SINGLE_LINE_COMMENT()) { phLOC(); }
313
46
359
<methods>public non-sealed void <init>() ,public void clearNonSymbolMatchedListener() ,public void clearSymbolMatchedListener() ,public void setNonSymbolMatchedListener(org.opengrok.indexer.analysis.NonSymbolMatchedListener) ,public void setSymbolMatchedListener(org.opengrok.indexer.analysis.SymbolMatchedListener) <var...
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/sql/JointSQLSymbolTokenizer.java
JointSQLSymbolTokenizer
offerSymbol
class JointSQLSymbolTokenizer extends JointSQLLexer { private String lastSymbol; /** * Resets the SQL tracked state. {@inheritDoc} */ @Override public void reset() { super.reset(); lastSymbol = null; } /** noop. */ @Override public void offer(String value) { ...
if (ignoreKwd || !getDialectKeywords().contains(value.toLowerCase(Locale.ROOT))) { lastSymbol = value; onSymbolMatched(value, getYYCHAR() + captureOffset); return true; } else { lastSymbol = null; } return false;
330
83
413
<methods>public void chkLOC() ,public void reset() ,public void yypop() throws java.io.IOException<variables>protected int commentLevel
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/sql/JointSQLXref.java
JointSQLXref
offerSymbol
class JointSQLXref extends JointSQLLexer { @Override public void offer(String value) { onNonSymbolMatched(value, getYYCHAR()); } @Override public boolean offerSymbol(String value, int captureOffset, boolean ignoreKwd) {<FILL_FUNCTION_BODY>} /** noop. */ @Override public void s...
Set<String> keywords = ignoreKwd ? null : getDialectKeywords(); return onFilteredSymbolMatched(value, getYYCHAR(), keywords, false);
267
44
311
<methods>public void chkLOC() ,public void reset() ,public void yypop() throws java.io.IOException<variables>protected int commentLevel
oracle_opengrok
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/uue/UuencodeAnalyzer.java
UuencodeAnalyzer
analyze
class UuencodeAnalyzer extends TextAnalyzer { /** * Creates a new instance of UuencodeAnalyzer. * @param factory defined instance for the analyzer */ protected UuencodeAnalyzer(AnalyzerFactory factory) { super(factory, () -> new JFlexTokenizer(new UuencodeFullTokenizer( A...
//this is to explicitly use appropriate analyzers tokenstream to workaround #1376 symbols search works like full text search JFlexTokenizer symbolTokenizer = symbolTokenizerFactory.get(); OGKTextField full = new OGKTextField(QueryBuilder.FULL, symbolTokenizer); symbolTokenizer.setReader...
386
228
614
<methods>public org.opengrok.indexer.analysis.Xrefer writeXref(org.opengrok.indexer.analysis.WriteXrefArgs) throws java.io.IOException<variables>