Skip to content
Snippets Groups Projects
Commit 34c58b5f authored by Radek Ošlejšek's avatar Radek Ošlejšek
Browse files

Style checker updated to 3.1.1. Publiv final fields for immutable classes permitted

parent 7045deeb
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,8 @@
<publicPackages> <!-- expose API/packages to other modules -->
<publicPackage>cz.fidentis.analyst.mesh.core.*</publicPackage>
<publicPackage>cz.fidentis.analyst.mesh.io.*</publicPackage>
<!--<publicPackage>cz.fidentis.analyst.mesh.core.MeshFacet</publicPackage>-->
<!--<publicPackage>cz.fidentis.analyst.mesh.core.MeshPoint</publicPackage>-->
</publicPackages>
</configuration>
</plugin>
......
package cz.fidentis.analyst.symmetry;
/**
*
* @author Natália Bebjaková
*
* Helping representation of triangle in symmetry estimate
*/
public class Triangle {
protected int vertex1;
protected int vertex2;
protected int vertex3;
/**
* Creates new triangle
*
* @param v1 first vertex
* @param v2 second vertex
* @param v3 third vertex
*/
public Triangle(int v1, int v2, int v3) {
this.vertex1 = v1;
this.vertex2 = v2;
this.vertex3 = v3;
}
/**
*
* @return first vertex of triangle
*/
public int getVertex1() {
return vertex1;
}
/**
*
* @param vertex1 new vertex
*/
public void setVertex1(int vertex1) {
this.vertex1 = vertex1;
}
/**
*
* @return second vertex of triangle
*/
public int getVertex2() {
return vertex2;
}
/**
*
* @param vertex2 new vertex
*/
public void setVertex2(int vertex2) {
this.vertex2 = vertex2;
}
/**
*
* @return third vertex of triangle
*/
public int getVertex3() {
return vertex3;
}
/**
*
* @param vertex3 new vertex
*/
public void setVertex3(int vertex3) {
this.vertex3 = vertex3;
}
/**
* Triangles are same if they have same vertices
*
* @param obj other triangle
* @return true if two triangles are same
*/
@Override
public boolean equals(Object obj) {
if (obj instanceof Triangle) {
Triangle t = (Triangle)obj;
if (((this.vertex1 == t.vertex1) || (this.vertex1 == t.vertex2) || (this.vertex1 == t.vertex3)) &&
((this.vertex2 == t.vertex1) || (this.vertex2 == t.vertex2) || (this.vertex2 == t.vertex3)) &&
((this.vertex3 == t.vertex1) || (this.vertex3 == t.vertex2) || (this.vertex3 == t.vertex3))) {
return (true);
}
}
return (false);
}
/**
*
* @return hascode of the triangle
*/
@Override
public int hashCode() {
return (this.vertex1 * 100 ^ this.vertex2 * 100 ^ this.vertex3);
}
}
......@@ -13,10 +13,14 @@
<module name="TreeWalker">
<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
<module name="JavadocMethod">
<module name="MissingJavadocMethodCheck">
<property name="scope" value="public"/>
<property name="allowMissingPropertyJavadoc" value="true"/>
</module>
<!--<module name="JavadocMethod">
<property name="scope" value="public"/>
<property name="allowMissingPropertyJavadoc" value="true"/>
</module>
</module>-->
<module name="JavadocType">
<property name="scope" value="public"/>
</module>
......@@ -54,9 +58,9 @@
<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="LineLength">
<!--<module name="LineLength">
<property name="max" value="220"/>
</module>
</module>-->
<module name="MethodLength">
<property name="max" value="50"/>
<property name="countEmpty" value="false"/>
......@@ -91,7 +95,9 @@
<!-- See http://checkstyle.sf.net/config_design.html -->
<module name="FinalClass"/>
<module name="InterfaceIsType"/>
<module name="VisibilityModifier"/>
<module name="VisibilityModifier">
<property name="allowPublicFinalFields" value="true"/>
</module>
<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
......
......@@ -13,7 +13,7 @@
<properties>
<netbeans.version>RELEASE113</netbeans.version>
<brandingToken>fidentisanalyst</brandingToken>
<version.maven.plugin.checkstyle>2.17</version.maven.plugin.checkstyle>
<version.maven.plugin.checkstyle>3.1.1</version.maven.plugin.checkstyle>
<version.plugin.checkstyle>8.5</version.plugin.checkstyle>
<version.plugin.source>2.4</version.plugin.source>
<version.javax.vecmath>1.5.2</version.javax.vecmath>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment