// Note that it will not judge whether synchronized already exists, so if synchronized already exists, it will be used twice.
...
...
@@ -194,6 +194,7 @@ The `@constructor` used to generate secondary constructor method for classes, on
- The internal fields are placed in the first bracket block if constructor is currying.
- The type of the internal field must be specified, otherwise the macro extension cannot get the type.
At present, only primitive types and string can be omitted. For example, `var i = 1; var j: int = 1; var k: Object = new Object()` is OK, but `var k = new object()` is not.
- Example
```scala
...
...
@@ -209,11 +210,53 @@ class A2(int: Int, val j: Int, var k: Option[String] = None, t: Option[Long] = S
The `@equalsAndHashCode` annotation is used to generate `equals` and `hashCode` methods for ordinary classes, and them takes into account the influence of super classes.
- Note
-`verbose` Whether to enable detailed log.
-`excludeFields` specifies whether to exclude fields that are not required for the `equals` and `hashCode` methods. Optional,
default is `Nil` (all non private `var` and `val` fields in the class will be used to generate the two methods).
- Both `equals` and `hashCode` methods are affected by super classes, and `canEqual` uses `isInstanceOf` in `equals` method.
Some equals implementations use `that.getClass == this.getClass`
- It uses simple hashcode algorithm, and the hashcode of the parent class are accumulated directly. The algorithm is also used by `case class`.
- If the class of the annotation has already defined the `canEqual` method with the same signature, `canEqual` will not be generated.