Skip to content

Commit

Permalink
Merge pull request #306 from zanata/fix-master
Browse files Browse the repository at this point in the history
Fix javac warnings failing master build
  • Loading branch information
Patrick Huang committed May 9, 2017
2 parents 7196736 + 6d31cc7 commit 59c19e5
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,14 @@ timestamps {

step([$class: 'WarningsPublisher',
consoleParsers: [
[parserName: 'Java Compiler (javac)'], // 339 warnings
[parserName: 'Java Compiler (javac)'], // 357 warnings
// [parserName: 'JavaDoc'],
// [parserName: 'Maven'], // ~279 warnings, but too variable
// TODO check integration test warnings (EAP and WildFly)
//[parserName: 'appserver log messages'], // 119 warnings
//[parserName: 'browser warnings'], // 0 warnings
],
unstableTotalAll: '339',
unstableTotalAll: '357',
unstableTotalHigh: '0',
])
// TODO check integration test warnings (EAP and WildFly)
Expand Down
17 changes: 17 additions & 0 deletions server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1875,6 +1875,23 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<!--
Compiler plugin uses Java compiler API since version 3.0.
Usage of compiler API is much better than forking javac executable.
Compiler API is much faster as it's run in same process.
And most importatly ALL compiler messages are printed by maven.
When standalone javac executable is run maven parses it's output and
some messages are lost in the process!!!
-->
<forceJavacCompilerUse>false</forceJavacCompilerUse>
<useIncrementalCompilation>true</useIncrementalCompilation>
<fork>false</fork>
<compilerArgs>
<arg>-Xlint:-processing</arg>
<arg>-Xlint:all</arg>
</compilerArgs>
</configuration>
<executions>
<!-- Replacing default-compile as it is treated specially by Maven.
We need kotlin-maven-plugin to compile first. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
columnNames = "qualifiedName"))
public class Glossary implements Serializable {

private static final long serialVersionUID = 1L;

public Glossary(String qualifiedName) {
this.qualifiedName = qualifiedName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ public class HAccountActivationKey extends AccountKeyBase
@Temporal(TemporalType.TIMESTAMP)
@Column(nullable = false)
public Date getCreationDate() {
return creationDate;
if (creationDate != null) {
return new Date(creationDate.getTime());
}
return null;
}

public static class EntityListener {
Expand All @@ -55,7 +58,9 @@ private void onPersist(HAccountActivationKey key) {
}

public void setCreationDate(final Date creationDate) {
this.creationDate = creationDate;
if (creationDate != null) {
this.creationDate = new Date(creationDate.getTime());
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public class SlugEntityBaseTest {

static class SlugClass extends SlugEntityBase {

private static final long serialVersionUID = 1L;

public SlugClass(String slug) {
super(slug);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void alwaysEvaluates() throws Exception {
"evaluatesToTrueAlways"));

softly.assertThat(
granter.shouldInvokeGranter(null)).isTrue();
granter.shouldInvokeGranter((Object) null)).isTrue();
softly.assertThat(
granter.shouldInvokeGranter(
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,9 @@
*/
package org.zanata.service.impl;

import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyBoolean;
import static org.mockito.Matchers.anyListOf;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.zanata.model.HCopyTransOptions.ConditionRuleAction.DOWNGRADE_TO_FUZZY;
import static org.zanata.model.HCopyTransOptions.ConditionRuleAction.IGNORE;
import static org.zanata.model.HCopyTransOptions.ConditionRuleAction.REJECT;

import java.util.Arrays;
import java.util.List;
Expand Down

0 comments on commit 59c19e5

Please sign in to comment.