Skip to content

Commit a8b295c

Browse files
committed
Consistent javadoc for ParseState and its entry classes
1 parent cf2e0c7 commit a8b295c

File tree

8 files changed

+35
-34
lines changed

8 files changed

+35
-34
lines changed

spring-aop/src/main/java/org/springframework/aop/config/AdviceEntry.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -30,13 +30,14 @@ public class AdviceEntry implements ParseState.Entry {
3030

3131

3232
/**
33-
* Creates a new instance of the {@link AdviceEntry} class.
34-
* @param kind the kind of advice represented by this entry (before, after, around, etc.)
33+
* Create a new {@code AdviceEntry} instance.
34+
* @param kind the kind of advice represented by this entry (before, after, around)
3535
*/
3636
public AdviceEntry(String kind) {
3737
this.kind = kind;
3838
}
3939

40+
4041
@Override
4142
public String toString() {
4243
return "Advice (" + this.kind + ")";

spring-aop/src/main/java/org/springframework/aop/config/AdvisorEntry.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -30,13 +30,14 @@ public class AdvisorEntry implements ParseState.Entry {
3030

3131

3232
/**
33-
* Creates a new instance of the {@link AdvisorEntry} class.
33+
* Create a new {@code AdvisorEntry} instance.
3434
* @param name the bean name of the advisor
3535
*/
3636
public AdvisorEntry(String name) {
3737
this.name = name;
3838
}
3939

40+
4041
@Override
4142
public String toString() {
4243
return "Advisor '" + this.name + "'";

spring-aop/src/main/java/org/springframework/aop/config/AspectEntry.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2007 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@ public class AspectEntry implements ParseState.Entry {
3434

3535

3636
/**
37-
* Create a new AspectEntry.
37+
* Create a new {@code AspectEntry} instance.
3838
* @param id the id of the aspect element
3939
* @param ref the bean name referenced by this aspect element
4040
*/
@@ -43,6 +43,7 @@ public AspectEntry(String id, String ref) {
4343
this.ref = ref;
4444
}
4545

46+
4647
@Override
4748
public String toString() {
4849
return "Aspect: " + (StringUtils.hasLength(this.id) ? "id='" + this.id + "'" : "ref='" + this.ref + "'");

spring-aop/src/main/java/org/springframework/aop/config/PointcutEntry.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,14 +28,16 @@ public class PointcutEntry implements ParseState.Entry {
2828

2929
private final String name;
3030

31+
3132
/**
32-
* Creates a new instance of the {@link PointcutEntry} class.
33+
* Create a new {@code PointcutEntry} instance.
3334
* @param name the bean name of the pointcut
3435
*/
3536
public PointcutEntry(String name) {
3637
this.name = name;
3738
}
3839

40+
3941
@Override
4042
public String toString() {
4143
return "Pointcut '" + this.name + "'";

spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanEntry.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2006 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,18 +24,17 @@
2424
*/
2525
public class BeanEntry implements ParseState.Entry {
2626

27-
private String beanDefinitionName;
27+
private final String beanDefinitionName;
2828

2929

3030
/**
31-
* Creates a new instance of {@link BeanEntry} class.
31+
* Create a new {@code BeanEntry} instance.
3232
* @param beanDefinitionName the name of the associated bean definition
3333
*/
3434
public BeanEntry(String beanDefinitionName) {
3535
this.beanDefinitionName = beanDefinitionName;
3636
}
3737

38-
3938
@Override
4039
public String toString() {
4140
return "Bean '" + this.beanDefinitionName + "'";

spring-beans/src/main/java/org/springframework/beans/factory/parsing/ParseState.java

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,18 @@
2222

2323
/**
2424
* Simple {@link ArrayDeque}-based structure for tracking the logical position during
25-
* a parsing process. {@link Entry entries} are added to the LinkedList at
26-
* each point during the parse phase in a reader-specific manner.
25+
* a parsing process. {@link Entry entries} are added to the ArrayDeque at each point
26+
* during the parse phase in a reader-specific manner.
2727
*
2828
* <p>Calling {@link #toString()} will render a tree-style view of the current logical
29-
* position in the parse phase. This representation is intended for use in
30-
* error messages.
29+
* position in the parse phase. This representation is intended for use in error messages.
3130
*
3231
* @author Rob Harrop
3332
* @author Juergen Hoeller
3433
* @since 2.0
3534
*/
3635
public final class ParseState {
3736

38-
/**
39-
* Tab character used when rendering the tree-style representation.
40-
*/
41-
private static final char TAB = '\t';
42-
4337
/**
4438
* Internal {@link ArrayDeque} storage.
4539
*/
@@ -54,8 +48,8 @@ public ParseState() {
5448
}
5549

5650
/**
57-
* Create a new {@code ParseState} whose {@link ArrayDeque} is a {@link Object#clone clone}
58-
* of that of the passed in {@code ParseState}.
51+
* Create a new {@code ParseState} whose {@link ArrayDeque} is a clone
52+
* of the state in the passed-in {@code ParseState}.
5953
*/
6054
private ParseState(ParseState other) {
6155
this.state = other.state.clone();
@@ -99,13 +93,13 @@ public ParseState snapshot() {
9993
*/
10094
@Override
10195
public String toString() {
102-
StringBuilder sb = new StringBuilder();
96+
StringBuilder sb = new StringBuilder(64);
10397
int i = 0;
10498
for (ParseState.Entry entry : this.state) {
10599
if (i > 0) {
106100
sb.append('\n');
107101
for (int j = 0; j < i; j++) {
108-
sb.append(TAB);
102+
sb.append('\t');
109103
}
110104
sb.append("-> ");
111105
}

spring-beans/src/main/java/org/springframework/beans/factory/parsing/PropertyEntry.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -30,14 +30,12 @@ public class PropertyEntry implements ParseState.Entry {
3030

3131

3232
/**
33-
* Creates a new instance of the {@link PropertyEntry} class.
33+
* Create a new {@code PropertyEntry} instance.
3434
* @param name the name of the JavaBean property represented by this instance
35-
* @throws IllegalArgumentException if the supplied {@code name} is {@code null}
36-
* or consists wholly of whitespace
3735
*/
3836
public PropertyEntry(String name) {
3937
if (!StringUtils.hasText(name)) {
40-
throw new IllegalArgumentException("Invalid property name '" + name + "'.");
38+
throw new IllegalArgumentException("Invalid property name '" + name + "'");
4139
}
4240
this.name = name;
4341
}

spring-beans/src/main/java/org/springframework/beans/factory/parsing/QualifierEntry.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,16 +26,21 @@
2626
*/
2727
public class QualifierEntry implements ParseState.Entry {
2828

29-
private String typeName;
29+
private final String typeName;
3030

3131

32+
/**
33+
* Create a new {@code QualifierEntry} instance.
34+
* @param typeName the name of the qualifier type
35+
*/
3236
public QualifierEntry(String typeName) {
3337
if (!StringUtils.hasText(typeName)) {
34-
throw new IllegalArgumentException("Invalid qualifier type '" + typeName + "'.");
38+
throw new IllegalArgumentException("Invalid qualifier type '" + typeName + "'");
3539
}
3640
this.typeName = typeName;
3741
}
3842

43+
3944
@Override
4045
public String toString() {
4146
return "Qualifier '" + this.typeName + "'";

0 commit comments

Comments
 (0)