Skip to content

Commit

Permalink
style: update workflows and github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglbme committed Feb 26, 2021
1 parent a9eb717 commit 9a554e9
Show file tree
Hide file tree
Showing 27 changed files with 116 additions and 116 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/branch-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ jobs:
with:
github_token: ${{ github.token }}
source_ref: ${{ github.ref }}
target_branch: "main"
target_branch: main
commit_message_template: "[Automated] Merged {source_ref} into {target_branch}"
2 changes: 1 addition & 1 deletion .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:
uses: creyD/[email protected]
with:
prettier_options: --write **/*.{md}
commit_message: "style: prettify code"
commit_message: "style: prettify code or document"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 7 additions & 7 deletions docs/Mybatis/核心处理层/Mybatis-DyanmicSqlSourcce.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ public class StaticTextSqlNode implements SqlNode {

- `org.apache.ibatis.scripting.xmltags.DynamicContext#appendSql`

```JAVA
public void appendSql(String sql) {
sqlBuilder.add(sql);
}
```java
public void appendSql(String sql) {
sqlBuilder.add(sql);
}
```

- 解析`trim`标签
Expand All @@ -102,7 +102,7 @@ public class StaticTextSqlNode implements SqlNode {

![image-20191219152655746](../../../images/mybatis/image-20191219152655746.png)

```JAVA
```java
@Override
public boolean apply(DynamicContext context) {
if (evaluator.evaluateBoolean(test, context.getBindings())) {
Expand All @@ -116,7 +116,7 @@ public class StaticTextSqlNode implements SqlNode {

- `evaluator.evaluateBoolean(test, context.getBindings())`方法

```JAVA
```java
/**
* @param expression 判断语句,ID != null
* @param parameterObject 参数列表
Expand All @@ -135,7 +135,7 @@ public class StaticTextSqlNode implements SqlNode {

```

```JAVA
```java
/**
* 取值
* @param expression 判断语句,ID=NULL
Expand Down
14 changes: 7 additions & 7 deletions docs/Spring/JDBC/Spring-jdbc.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

- 实体对象

```JAVA
```java
public class HsLog {
private Integer id;

Expand All @@ -50,7 +50,7 @@

- DAO

```JAVA
```java
public interface HsLogDao {
List<HsLog> findAll();

Expand All @@ -61,7 +61,7 @@

- 实现类

```JAVA
```java
public class HsLogDaoImpl extends JdbcDaoSupport implements HsLogDao {


Expand Down Expand Up @@ -154,7 +154,7 @@

- 运行方法

```JAVA
```java

public class SpringJDBCSourceCode {
public static void main(String[] args) {
Expand Down Expand Up @@ -251,7 +251,7 @@

- `org.springframework.jdbc.datasource.DataSourceUtils#releaseConnection`

```JAVA
```java
public static void releaseConnection(@Nullable Connection con, @Nullable DataSource dataSource) {
try {
doReleaseConnection(con, dataSource);
Expand Down Expand Up @@ -289,7 +289,7 @@ public static void doReleaseConnection(@Nullable Connection con, @Nullable DataS

链接数

```JAVA
```java
/**
* Increase the reference count by one because the holder has been requested
* (i.e. someone requested the resource held by it).
Expand Down Expand Up @@ -412,7 +412,7 @@ public void setDataSource(@Nullable DataSource dataSource) {
}
```

```JAVA
```java
@Override
public List<T> extractData(ResultSet rs) throws SQLException {
List<T> results = (this.rowsExpected > 0 ? new ArrayList<>(this.rowsExpected) : new ArrayList<>());
Expand Down
20 changes: 10 additions & 10 deletions docs/Spring/RMI/Spring-RMI.md
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ public class RMIClientSourceCode {
1. 调用父类的`afterPropertiesSet`方法判断`serviceUrl`是否为空
2. 执行`prepare()`方法

```JAVA
```java
public void prepare() throws RemoteLookupFailureException {
// Cache RMI stub on initialization?
if (this.lookupStubOnStartup) {
Expand Down Expand Up @@ -553,7 +553,7 @@ public class RMIClientSourceCode {

#### org.springframework.remoting.rmi.RmiClientInterceptor#lookupStub

```JAVA
```java
protected Remote lookupStub() throws RemoteLookupFailureException {
try {
Remote stub = null;
Expand Down Expand Up @@ -625,7 +625,7 @@ protected Remote lookupStub() throws RemoteLookupFailureException {

- 通过类图我们可以知道`RmiProxyFactoryBean`实现了`MethodInterceptor`,具体实现方法在`org.springframework.remoting.rmi.RmiClientInterceptor#invoke`

```JAVA
```java
@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
// 获取remote
Expand All @@ -649,7 +649,7 @@ protected Remote lookupStub() throws RemoteLookupFailureException {

```

```JAVA
```java
protected Remote getStub() throws RemoteLookupFailureException {
if (!this.cacheStub || (this.lookupStubOnStartup && !this.refreshStubOnConnectFailure)) {
// 如果缓存stub存在直接获取,否则创建
Expand All @@ -668,7 +668,7 @@ protected Remote lookupStub() throws RemoteLookupFailureException {

- `org.springframework.remoting.rmi.RmiClientInterceptor#doInvoke(org.aopalliance.intercept.MethodInvocation, org.springframework.remoting.rmi.RmiInvocationHandler)`

```JAVA
```java
@Nullable
protected Object doInvoke(MethodInvocation methodInvocation, RmiInvocationHandler invocationHandler)
throws RemoteException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
Expand All @@ -693,7 +693,7 @@ protected Remote lookupStub() throws RemoteLookupFailureException {

- `org.springframework.remoting.rmi.RmiInvocationWrapper#invoke`

```JAVA
```java
/**
* Delegates the actual invocation handling to the RMI exporter.
*
Expand All @@ -712,7 +712,7 @@ protected Remote lookupStub() throws RemoteLookupFailureException {

- 继续跟踪`org.springframework.remoting.rmi.RmiBasedExporter#invoke`

```JAVA
```java
@Override
protected Object invoke(RemoteInvocation invocation, Object targetObject)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
Expand All @@ -723,7 +723,7 @@ protected Remote lookupStub() throws RemoteLookupFailureException {

- 继续跟踪`org.springframework.remoting.support.RemoteInvocationBasedExporter#invoke`

```JAVA
```java
protected Object invoke(RemoteInvocation invocation, Object targetObject)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {

Expand Down Expand Up @@ -761,7 +761,7 @@ protected Remote lookupStub() throws RemoteLookupFailureException {

![image-20200226083247784](../../../images/spring/image-20200226083247784.png)

```JAVA
```java
public class DefaultRemoteInvocationExecutor implements RemoteInvocationExecutor {

@Override
Expand All @@ -776,7 +776,7 @@ public class DefaultRemoteInvocationExecutor implements RemoteInvocationExecutor
}
```

```JAVA
```java
public Object invoke(Object targetObject)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {

Expand Down
8 changes: 4 additions & 4 deletions docs/Spring/SpringMVC/SpringMVC-CROS.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public class JSONController {

- `org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#initCorsConfiguration`

```JAVA
```java
@Override
protected CorsConfiguration initCorsConfiguration(Object handler, Method method, RequestMappingInfo mappingInfo) {
// 重新创建,为什么不作为参数传递: 还有别的实现方法
Expand Down Expand Up @@ -244,7 +244,7 @@ public class JSONController {
- 实现**BeanDefinitionParser** 接口的都有一个**parse**方法直接看方法.
- 通过查看我们可以知道最终目的获取 xml 标签中的属性,对 **CorsConfiguration**进行初始化,最后 Spring 中注册

```JAVA
```java
public class CorsBeanDefinitionParser implements BeanDefinitionParser {

@Override
Expand Down Expand Up @@ -341,7 +341,7 @@ public class CorsBeanDefinitionParser implements BeanDefinitionParser {

- 跨域信息

```JAVA
```java
/**
* 允许请求源
*/
Expand Down Expand Up @@ -511,7 +511,7 @@ public class CorsBeanDefinitionParser implements BeanDefinitionParser {

![image-20200123093733129](../../../images/springMVC/clazz/image-20200123093733129.png)

```JAVA
```java
@Override
@SuppressWarnings("resource")
public boolean processRequest(@Nullable CorsConfiguration config, HttpServletRequest request,
Expand Down
10 changes: 5 additions & 5 deletions docs/Spring/TX/Spring-transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ public class DeclarativeTransactionTest {

- `tm.getTransaction`

```JAVA
```java
@Override
public final TransactionStatus getTransaction(@Nullable TransactionDefinition definition)
throws TransactionException {
Expand Down Expand Up @@ -577,7 +577,7 @@ public class DeclarativeTransactionTest {

- `org.springframework.jdbc.datasource.DataSourceTransactionManager#doGetTransaction`

```JAVA
```java
@Override
protected Object doGetTransaction() {
DataSourceTransactionObject txObject = new DataSourceTransactionObject();
Expand All @@ -594,7 +594,7 @@ public class DeclarativeTransactionTest {

- `org.springframework.transaction.support.AbstractPlatformTransactionManager#suspend`

```JAVA
```java
@Nullable
protected final SuspendedResourcesHolder suspend(@Nullable Object transaction)
throws TransactionException {
Expand Down Expand Up @@ -642,7 +642,7 @@ public class DeclarativeTransactionTest {

- `prepareTransactionInfo`简单的`new`对象并且绑定线程

```JAVA
```java
protected TransactionInfo prepareTransactionInfo(@Nullable PlatformTransactionManager tm,
@Nullable TransactionAttribute txAttr, String joinpointIdentification,
@Nullable TransactionStatus status) {
Expand Down Expand Up @@ -1654,7 +1654,7 @@ static Object unwrapResourceIfNecessary(Object resource) {

- `ScopedProxyUnwrapper.unwrapIfNecessary`

```JAVA
```java
private static class ScopedProxyUnwrapper {

public static Object unwrapIfNecessary(Object resource) {
Expand Down
4 changes: 2 additions & 2 deletions docs/Spring/clazz/Spring-ApplicationListener.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class DemoApplicationListener implements ApplicationListener {
</beans>
```

```JAVA
```java
public class ListenerSourceCode {
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext("Listener-demo.xml");
Expand Down Expand Up @@ -68,7 +68,7 @@ public class ListenerSourceCode {

## 注册

```JAVA
```java
protected void registerListeners() {
// Register statically specified listeners first.
// 读取 ApplicationListener
Expand Down
4 changes: 2 additions & 2 deletions docs/Spring/clazz/Spring-BeanDefinitionParserDelegate.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ public AbstractBeanDefinition parseBeanDefinitionElement(

- 将 xml 标签的数据读取到内存中设置给`AbstractBeanDefinition`

```JAVA
```java
public AbstractBeanDefinition parseBeanDefinitionAttributes(Element ele, String beanName,
@Nullable BeanDefinition containingBean, AbstractBeanDefinition bd) {

Expand Down Expand Up @@ -971,7 +971,7 @@ public Object parseIdRefElement(Element ele) {

- `org.springframework.beans.factory.xml.BeanDefinitionParserDelegate#parseValueElement`

```JAVA
```java
public Object parseValueElement(Element ele, @Nullable String defaultTypeName) {
// It's a literal value.
// 获取 xml 中的文本变量
Expand Down
12 changes: 6 additions & 6 deletions docs/Spring/clazz/Spring-BeanFactoryPostProcessor.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ public class BeanFactoryPostProcessorSourceCode {

- `org.springframework.context.support.AbstractApplicationContext#refresh`

```JAVA
```java
invokeBeanFactoryPostProcessors(beanFactory);
```

```JAVA
```java
protected void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory) {
PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(beanFactory, getBeanFactoryPostProcessors());

Expand All @@ -100,7 +100,7 @@ public class BeanFactoryPostProcessorSourceCode {

- `org.springframework.context.support.PostProcessorRegistrationDelegate#invokeBeanFactoryPostProcessors(org.springframework.beans.factory.config.ConfigurableListableBeanFactory, java.util.List<org.springframework.beans.factory.config.BeanFactoryPostProcessor>)`

```JAVA
```java
public static void invokeBeanFactoryPostProcessors(
ConfigurableListableBeanFactory beanFactory, List<BeanFactoryPostProcessor> beanFactoryPostProcessors) {

Expand Down Expand Up @@ -373,13 +373,13 @@ public class DemoInstantiationAwareBeanPostProcessor implements InstantiationAwa

`org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#createBean(java.lang.String, org.springframework.beans.factory.support.RootBeanDefinition, java.lang.Object[])`中有如下代码

```JAVA
```java
Object bean = resolveBeforeInstantiation(beanName, mbdToUse);
```

- `org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#resolveBeforeInstantiation`

```JAVA
```java
@Nullable
protected Object resolveBeforeInstantiation(String beanName, RootBeanDefinition mbd) {
Object bean = null;
Expand All @@ -405,7 +405,7 @@ public class DemoInstantiationAwareBeanPostProcessor implements InstantiationAwa

- `org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#applyBeanPostProcessorsBeforeInstantiation`

```JAVA
```java
@Nullable
protected Object applyBeanPostProcessorsBeforeInstantiation(Class<?> beanClass, String beanName) {
for (BeanPostProcessor bp : getBeanPostProcessors()) {
Expand Down
2 changes: 1 addition & 1 deletion docs/Spring/clazz/Spring-BeanNameGenerator.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface BeanNameGenerator {

- 调用工具类方法进行生成

```JAVA
```java
@Override
public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
return BeanDefinitionReaderUtils.generateBeanName(definition, registry);
Expand Down
Loading

0 comments on commit 9a554e9

Please sign in to comment.