Skip to content

Commit

Permalink
Merge branch 'master' into #779
Browse files Browse the repository at this point in the history
  • Loading branch information
dskalenko committed Jul 4, 2016
2 parents fccf32c + 40fbff8 commit 5ecf699
Show file tree
Hide file tree
Showing 12 changed files with 276 additions and 13 deletions.
1 change: 1 addition & 0 deletions .rultor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ merge:
- carlosmiranda
- darkled
- dmzaytsev
- essobedo
- ggajos
- hdouss
- krzyk
Expand Down
6 changes: 4 additions & 2 deletions PUZZLES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Puzzles

There are 18 active puzzles (87 total):
There are 19 active puzzles (89 total):


<del>unknown</del> [`?`](../master/?)<br/>
Expand Down Expand Up @@ -89,4 +89,6 @@ There are 18 active puzzles (87 total):
&nbsp;&nbsp;&nbsp;&nbsp;[<del>715</del>](https://github.com/teamed/qulice/issues/715) [`?`](../master/?)<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[#752](https://github.com/teamed/qulice/issues/752):[<del>715-04710633</del>](https://github.com/teamed/qulice/issues/752) [`CheckstyleValidatorTest.java:722-723`](../master/qulice-checkstyle/src/test/java/com/qulice/checkstyle/CheckstyleValidatorTest.java#L722-L723)<br/>
&nbsp;&nbsp;&nbsp;&nbsp;[#776](https://github.com/teamed/qulice/issues/776):[**715-2a207c32**](https://github.com/teamed/qulice/issues/776) [`CheckstyleValidatorTest.java:700-701`](../master/qulice-checkstyle/src/test/java/com/qulice/checkstyle/CheckstyleValidatorTest.java#L700-L701)<br/>
&nbsp;&nbsp;&nbsp;&nbsp;[#777](https://github.com/teamed/qulice/issues/777):[**250-1b26b28c**](https://github.com/teamed/qulice/issues/777) [`DuplicateFinderValidator.java:44-54`](../master/qulice-maven-plugin/src/main/java/com/qulice/maven/DuplicateFinderValidator.java#L44-L54)<br/>
&nbsp;&nbsp;&nbsp;&nbsp;[#777](https://github.com/teamed/qulice/issues/777):[**250-1b26b28c**](https://github.com/teamed/qulice/issues/777) [`DuplicateFinderValidator.java:44-54`](../master/qulice-maven-plugin/src/main/java/com/qulice/maven/DuplicateFinderValidator.java#L44-L54)<br/>
&nbsp;&nbsp;&nbsp;&nbsp;[#706](https://github.com/teamed/qulice/issues/706):[<del>706</del>](https://github.com/teamed/qulice/issues/706) [`?`](../master/?)<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[#787](https://github.com/teamed/qulice/issues/787):[**706-72bdab5d**](https://github.com/teamed/qulice/issues/787) [`Wrap.java:78-84`](../master/qulice-findbugs/src/main/java/com/qulice/findbugs/Wrap.java#L78-L84)<br/>
2 changes: 1 addition & 1 deletion TEAM.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The following members are in the project team:
Role | Members
---|---
PM | @davvd
CR | @darkled, @original-brownbear, @carlosmiranda, @dmzaytsev, @pinaf, @ggajos, @hdouss, @mkordas, @longtimeago
CR | @darkled, @original-brownbear, @carlosmiranda, @dmzaytsev, @pinaf, @ggajos, @hdouss, @mkordas, @essobedo, @longtimeago
DEV | @westonized, @kitsook, @dskalenko, @bdragan, @happy-neko, @jrdalpra, @gumbelmj, @prahladyeri, @rui-castro, @vkuchyn
IMP | @westonized, @kitsook, @dskalenko, @bdragan, @happy-neko, @jrdalpra, @gumbelmj, @prahladyeri, @rui-castro, @vkuchyn
ARC | @krzyk
Expand Down
19 changes: 9 additions & 10 deletions qulice-findbugs/src/main/java/com/qulice/findbugs/Wrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
package com.qulice.findbugs;

import com.google.common.base.Function;
import com.google.common.base.Predicates;
import com.google.common.collect.Collections2;
import com.jcabi.aspects.Tv;
import com.mebigfatguy.fbcontrib.utils.BugType;
Expand Down Expand Up @@ -76,6 +75,13 @@ public static void main(final String... args) {
/**
* Run it.
* @param args Arguments
* @todo #706:30min After fix issue mentioned in comment
* https://github.com/teamed/qulice/issues/706#issuecomment-225943946
* rollback the changes done in #706 then remove @Ignore above
* FindBugsValidatorTest.reportsIncorrectlyAddedThrows test
* and fix test findbugs-bed-bogus-exception-declaration.
* For the moment third item is done from comment
* https://github.com/teamed/qulice/issues/706#issuecomment-184611854
*/
public static void run(final String... args) {
final Project project =
Expand All @@ -87,9 +93,8 @@ public static void run(final String... args) {
}
final FindBugs2 findbugs = new FindBugs2();
findbugs.setProject(project);
final Collection<String> ignored = Collections2.filter(
Collections2.transform(
Arrays.asList(BugType.values()),
final Collection<String> ignored = Collections2.transform(
Arrays.asList(BugType.values()),
new Function<BugType, String>() {
@Override
public String apply(final BugType bug) {
Expand All @@ -102,12 +107,6 @@ public String apply(final BugType bug) {
return name;
}
}
),
Predicates.not(
Predicates.equalTo(
BugType.BED_BOGUS_EXCEPTION_DECLARATION.name()
)
)
);
final BugReporter reporter = new PrintingBugReporter() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import com.google.common.base.Joiner;
import com.qulice.spi.Environment;
import com.qulice.spi.ValidationException;
import org.junit.Ignore;
import org.junit.Test;

/**
Expand Down Expand Up @@ -59,6 +60,7 @@ public void passesCorrectFilesWithNoExceptions() throws Exception {
* FindbugsValidator can report incorrectly added throws.
* @throws Exception If something wrong happens inside
*/
@Ignore
@Test(expected = ValidationException.class)
public void reportsIncorrectlyAddedThrows() throws Exception {
final byte[] bytecode = new BytecodeMocker()
Expand Down
1 change: 1 addition & 0 deletions qulice-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@
<pomInclude>hibernate-validator-check/pom.xml</pomInclude>
<pomInclude>pmd-duplicate-string-literals-violations/pom.xml</pomInclude>
<pomInclude>dependency-not-matches-exclude/pom.xml</pomInclude>
<pomInclude>findbugs-bed-bogus-exception-declaration/pom.xml</pomInclude>
</pomIncludes>
<extraArtifacts>
<extraArtifact>${project.groupId}:qulice-checkstyle:${project.version}:jar</extraArtifact>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (c) 2011-2016, Qulice.com
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met: 1) Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer. 2) Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution. 3) Neither the name of the Qulice.com nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
invoker.goals = clean verify
invoker.buildResult = success
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0"?>
<!--
*
* Copyright (c) 2011-2016, Qulice.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met: 1) Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer. 2) Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution. 3) Neither the name of the Qulice.com nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
* NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.qulice.plugin</groupId>
<artifactId>findbugs-bed-bogus-exception-declaration</artifactId>
<version>1.0-SNAPSHOT</version>
<name>findbugs-bed-bogus-exception-declaration</name>
<dependencies>
<dependency>
<groupId>com.jcabi</groupId>
<artifactId>jcabi-aspects</artifactId>
<version>0.22.5</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.8.9</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.qulice</groupId>
<artifactId>qulice-maven-plugin</artifactId>
<version>@project.version@</version>
<configuration>
<license>file:${basedir}/LICENSE.txt</license>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.jcabi</groupId>
<artifactId>jcabi-maven-plugin</artifactId>
<version>0.14</version>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>ajc</goal>
</goals>
<configuration>
<unwovenClassesDir>target/customUnwoven</unwovenClassesDir>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**
* Copyright (c) 2011-2016, Qulice.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met: 1) Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer. 2) Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution. 3) Neither the name of the Qulice.com nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
* NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.qulice.foo;

import com.jcabi.aspects.RetryOnFailure;
import java.io.IOException;
import java.net.Socket;

/**
* Test class with using jcabi-aspects annotation.
* @author Denys Skalenko (d.skalenko@gmail.com)
* @version $Id$
* @since 0.17
*/
public final class TestSocket {

/**
* Socket.
*/
private final Socket socket;

/**
* Constructor.
* @param socket Socket
*/
public TestSocket(final Socket socket) {
this.socket = socket;
}

/**
* Close method.
* @throws IOException If something wrong happens inside
*/
@RetryOnFailure
public void close() throws IOException {
this.socket.close();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* Copyright (c) 2011-2016, Qulice.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met: 1) Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer. 2) Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution. 3) Neither the name of the Qulice.com nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
* NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/**
* Test reproduces case when FindBugs can't find out if the exception
* is thrown, because AspectJ does some magic with bytecode
* when annotation from jcabi-aspects is used,
* even on a method that throws correct exception.
*
* @author Denys Skalenko (d.skalenko@gmail.com)
* @version $Id$
* @since 0.17
*/
package com.qulice.foo;
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* Copyright (c) 2011, Qulice.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met: 1) Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer. 2) Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution. 3) Neither the name of the Qulice.com nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
* NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* Validate that the build doesn't fail with M C BED when
* we use annotation from jcabi-aspects and jcabi-maven-plugin plugin.
* @version $Id$
* @since 0.17
*/
def log = new File(basedir, 'build.log')
assert !log.text.contains('M C BED: Non derivable method')
assert !log.text.contains('declares throwing an exception that isn\'t thrown')
assert log.text.contains('Finishing FindBugs validator')

0 comments on commit 5ecf699

Please sign in to comment.