Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

210-依赖库-暂停当前线程依赖库 #226

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

dellge
Copy link

@dellge dellge commented Sep 6, 2024

暂停当前线程依赖库提交
包含threadSleep、wait、notify、notifyAll 4个方法,详细可以看下READEM.md文件
dellge

Copy link
Contributor

github-actions bot commented Sep 6, 2024

关联ACTION

存在多处package修改:

IDUtil涉及的修改:

└── IDUtil
   ├── src
   │  ├── IDUtil-1.0.2.jar
   │  ├── library-IDUtil-1.0.2.zip
   │  ├── main
   │  │  └── java
   │  │     └── com
   │  │        └── netease
   │  │           └── lib
   │  │              └── generate
   │  │                 └── IDUtil.java
   │  └── test
   │     └── java
   │        └── com
   │           └── netease
   │              └── lib
   │                 └── generate
   │                    └── AppTest.java
   ├── 后端readme
   └── pom.xml

threadPause涉及的修改:

└── threadPause_dellge
   ├── jar
   │  ├── nasl-metadata-collector-0.10.1.jar
   │  ├── nasl-metadata-collector-0.8.0.jar
   │  └── nasl-metadata-maven-plugin-1.3.0
   │     ├── install.bat
   │     ├── install.sh
   │     ├── nasl-metadata-maven-plugin-1.3.0.jar
   │     └── pom.xml
   ├── pom.xml
   ├── src
   │  └── main
   │     └── java
   │        └── com
   │           └── example
   │              └── demo
   │                 └── api
   │                    └── TestApi.java
   ├── 依赖库使用文档说明.docx
   ├── 前端readme模板【勿删】
   ├── 后端readme模板【勿删】
   └── README.md

资产共建大赛提交内容中原有的截图,现升级为依赖库使用说明文档。现交内容包括

  1. 依赖库代码本身;2. readme代码说明文档;3. 依赖库使用文档说明。
    其中readme面向开发者,使用文档面向使用者。
    请自己阅读提交作品路径说明。
    https://github.com/netease-lcap/CodeWaveAssetCompetition2024/blob/main/%E8%B5%84%E4%BA%A7%E5%85%B1%E5%BB%BA%E5%A4%A7%E8%B5%9B%E6%8F%90%E4%BA%A4%E5%86%85%E5%AE%B9%E8%AF%B4%E6%98%8E.md

参考作品https://github.com/netease-lcap/CodeWaveAssetCompetition2024/tree/main/demo_bjz_JiazhenBao

tips:README.md和依赖库使用文档说明.docx需要保持文件名称不动。后续我们会对提交的PR自动校验目录结构~

Copy link
Contributor

github-actions bot commented Sep 6, 2024

关联ACTION

threadPause存在错误:

Command failed: mvn clean package -DskipTests

Copy link
Contributor

github-actions bot commented Sep 6, 2024

关联ACTION

threadPause存在错误:

Command failed: mvn clean package -DskipTests

Copy link
Contributor

github-actions bot commented Sep 6, 2024

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TestApi {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议改为ThreadUtil等,具有一定工具类含义的类命名

* @param millisecond 毫秒
*/
@NaslLogic
public static String threadSleep(Integer millisecond) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议增加对入参millisecond的判断,如果是负数,最好有友好提示

@lijie0458
Copy link
Collaborator

1、readme中的图片改成本地引用,不要贴codewave里上传的图片,如果应用被删除了图片就访问不到了
2、将wait、notify、notifyAll的入参改成string类型,可以使用String作为同步锁,注意synchronized (string)锁的对象不是同一个,仅仅是值相等,此时的字符串是在堆栈中,修改锁的内容为synchronized (string.intern())可以从常量池获取
3、加一个wait(Long time)方法引入超时等待模式,超过指定时间也会自己释放,避免陷入死锁
4、打印日志使用log.error(),不要用e.printStackTrace();
5、pom文件里加上name标签和description标签,这些会被脚手架获取,在codewave平台上传依赖库的时候会展示为名称和描述

Copy link
Contributor

关联ACTION

threadPause存在错误:

Command failed: mvn clean package -DskipTests

Copy link
Contributor

@lyjamare
Copy link
Collaborator

功能及代码已验收,待评分

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants